@wujie-shell/core 1.0.5 → 1.0.7

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.
Files changed (66) hide show
  1. package/bin/wujie-shell.mjs +10 -30
  2. package/dist/bin/wujie-shell.mjs +1 -1
  3. package/dist/src/agents/bundled-agent-skills.mjs +1 -1
  4. package/dist/src/agents/bundled-agents.mjs +1 -1
  5. package/dist/src/agents/codex-home.mjs +1 -0
  6. package/dist/src/agents/runtime-config.mjs +1 -1
  7. package/dist/src/chat/media-archive.mjs +1 -1
  8. package/dist/src/chat/queue.mjs +1 -1
  9. package/dist/src/common/cron-session-key.mjs +1 -1
  10. package/dist/src/common/diagnostics.mjs +1 -1
  11. package/dist/src/common/logging.mjs +1 -1
  12. package/dist/src/common/runtime-logger.mjs +1 -1
  13. package/dist/src/common/sqlite-paths.mjs +1 -1
  14. package/dist/src/common/user-events.mjs +1 -1
  15. package/dist/src/common/utils.mjs +1 -1
  16. package/dist/src/config/controller.mjs +1 -1
  17. package/dist/src/connectors/config-utils.mjs +1 -1
  18. package/dist/src/connectors/constants.mjs +1 -1
  19. package/dist/src/connectors/controller.mjs +1 -1
  20. package/dist/src/connectors/kdocs-cli.mjs +1 -1
  21. package/dist/src/connectors/lark-cli.mjs +1 -1
  22. package/dist/src/electron/instance-identity.mjs +1 -0
  23. package/dist/src/electron/main.mjs +1 -1
  24. package/dist/src/electron/preload.mjs +1 -1
  25. package/dist/src/electron/protocol-url-state.mjs +1 -1
  26. package/dist/src/events/domain-event-journal.mjs +1 -1
  27. package/dist/src/files/generated-files-store.mjs +1 -1
  28. package/dist/src/files/handlers.mjs +1 -1
  29. package/dist/src/gateway/chat-delta.mjs +1 -1
  30. package/dist/src/gateway/controller.mjs +1 -1
  31. package/dist/src/gateway/request-id-title-events.mjs +1 -1
  32. package/dist/src/gateway/ws-client.mjs +1 -1
  33. package/dist/src/index.mjs +1 -1
  34. package/dist/src/log-reporting/handlers.mjs +1 -1
  35. package/dist/src/log-reporting/report-logs.mjs +1 -1
  36. package/dist/src/models/handlers.mjs +1 -1
  37. package/dist/src/preferences/store.mjs +1 -1
  38. package/dist/src/request-id/handlers.mjs +1 -1
  39. package/dist/src/request-id/runtime-bridge.mjs +1 -1
  40. package/dist/src/request-id/session-store.mjs +1 -1
  41. package/dist/src/request-id/title.mjs +1 -1
  42. package/dist/src/review/controller.mjs +1 -0
  43. package/dist/src/runtime/cron-missed-run-policy.mjs +1 -1
  44. package/dist/src/runtime/index.mjs +1 -1
  45. package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
  46. package/dist/src/runtime/patch-chat-attachment-base64.mjs +1 -1
  47. package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
  48. package/dist/src/runtime/patch-codex-isolated-auth.mjs +1 -0
  49. package/dist/src/runtime/patch-provider-request-id-header.mjs +1 -1
  50. package/dist/src/runtime/patch-qqbot-outbound-session-route.mjs +1 -1
  51. package/dist/src/runtime/patch-request-id-title-runtime.mjs +1 -1
  52. package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
  53. package/dist/src/runtime/patch-weixin-outbound-session-route.mjs +1 -1
  54. package/dist/src/runtime/plugin-sync.mjs +1 -1
  55. package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
  56. package/dist/src/sessions/runtime-bridge.mjs +1 -1
  57. package/dist/src/sessions/session-data-service.mjs +1 -1
  58. package/dist/src/sessions/session-runtime-state-service.mjs +1 -1
  59. package/dist/src/sessions/session-runtime-state.mjs +1 -1
  60. package/dist/src/sessions/session-sqlite-store.mjs +1 -1
  61. package/dist/src/skills/import.mjs +1 -1
  62. package/dist/src/skills/market.mjs +1 -1
  63. package/dist/src/terminal/manager.mjs +1 -1
  64. package/dist/src/updates/controller.mjs +1 -1
  65. package/dist/src/updates/loader.mjs +1 -1
  66. package/package.json +7 -19
@@ -1 +1 @@
1
- const _0x209495=_0x1223;(function(_0x10035c,_0x1003f2){const _0x41f6df=_0x1223,_0x172210=_0x10035c();while(!![]){try{const _0xd621d4=-parseInt(_0x41f6df(0x2e4))/0x1+-parseInt(_0x41f6df(0x15c))/0x2+parseInt(_0x41f6df(0x3a4))/0x3+-parseInt(_0x41f6df(0x49a))/0x4+-parseInt(_0x41f6df(0x215))/0x5*(-parseInt(_0x41f6df(0x276))/0x6)+parseInt(_0x41f6df(0x338))/0x7*(-parseInt(_0x41f6df(0x390))/0x8)+parseInt(_0x41f6df(0x24c))/0x9;if(_0xd621d4===_0x1003f2)break;else _0x172210['push'](_0x172210['shift']());}catch(_0x52d2b5){_0x172210['push'](_0x172210['shift']());}}}(_0x1e97,0xf2289));import _0x1e84bc 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{formatLogLine}from'@wujie-shell/logger';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{createSessionDataService}from'../sessions/session-data-service.mjs';import{createSessionSqliteStore}from'../sessions/session-sqlite-store.mjs';import{createTerminalManager}from'../terminal/manager.mjs';import{createShellLogger,exportLogsArchive,getShellLoggerLevel,setShellLoggerLevel,summarizeError,summarizePayload,summarizeText,toHomePath}from'../common/logging.mjs';import{createDiagnosticsWriter,diagnosticEventFromError}from'../common/diagnostics.mjs';import{setRuntimeLoggerLevel}from'../common/runtime-logger.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{registerRequestIdHandlers}from'../request-id/handlers.mjs';import{loadRuntimeInfo,prepareRuntime,resolveRuntimeRoot,getRuntimeSpawnContext,resolveRuntimeLarkCliCommand,runClawOnce}from'../runtime/index.mjs';import{loadCreateUpdateController}from'../updates/loader.mjs';import{createProtocolUrlState}from'./protocol-url-state.mjs';const __dirname=dirname(fileURLToPath(import.meta.url)),preloadPath=join(__dirname,'preload.'+_0x209495(0x2ab)),{app,BrowserWindow,Menu,clipboard,dialog,globalShortcut,ipcMain,protocol,shell}=_0x1e84bc,DEVTOOLS_ACCELERATOR=_0x209495(0x400)+_0x209495(0x23e)+_0x209495(0x49f),APP_RENDERER_PROTOCOL_SCHEME='app',APP_RENDERER_PROTOCOL_HOST='-',APP_RENDERER_ENTRY_URL=APP_RENDERER_PROTOCOL_SCHEME+_0x209495(0x2c1)+APP_RENDERER_PROTOCOL_HOST+(_0x209495(0x1a7)+'tml'),CLAWSPACE_PROTOCOL_SCHEME=_0x209495(0x4f1)+'e',DEBUG_STDOUT=process.env.WUJIE_SHELL_DEBUG==='1'||process.env.VITE_DEV_SERVER_URL||process.env.NODE_ENV!==_0x209495(0x444)+'on',IPC_SLOW_REQUEST_THRESHOLD_MS=0x1f4,SHELL_LOG_LEVELS=new Set([_0x209495(0x18e),_0x209495(0x1db),'info','debug']),LOCAL_FILE_MIME_TYPES=new Map([['.html',_0x209495(0x3ea)+'l;\x20chars'+_0x209495(0x1cc)],[_0x209495(0x457),_0x209495(0x3ea)+'l;\x20chars'+_0x209495(0x1cc)],['.txt',_0x209495(0x4d7)+_0x209495(0x22b)+_0x209495(0x1ab)+'8'],['.md',_0x209495(0x363)+'kdown;\x20c'+_0x209495(0x1c1)+_0x209495(0x32a)],[_0x209495(0x1ac),_0x209495(0x439)+_0x209495(0x1c0)+'script;\x20'+_0x209495(0x3eb)+_0x209495(0x4c8)],['.mjs',_0x209495(0x439)+_0x209495(0x1c0)+_0x209495(0x2fc)+_0x209495(0x3eb)+_0x209495(0x4c8)],[_0x209495(0x2c7),_0x209495(0x3f2)+_0x209495(0x28c)+'t=utf-8'],[_0x209495(0x24b),_0x209495(0x439)+'ion/json'+_0x209495(0x28c)+'t=utf-8'],['.map',_0x209495(0x439)+'ion/json'+';\x20charse'+_0x209495(0x31a)],[_0x209495(0x327),_0x209495(0x289)+'eg'],[_0x209495(0x27b),'image/jp'+'eg'],[_0x209495(0x355),_0x209495(0x1f8)+'g'],[_0x209495(0x1d2),_0x209495(0x305)+'f'],['.bmp',_0x209495(0x493)+'p'],['.svg','image/sv'+_0x209495(0x471)],[_0x209495(0x2fe),'image/we'+'bp'],[_0x209495(0x4cf),'image/x-'+_0x209495(0x37b)],[_0x209495(0x4c6),'video/mp'+'4'],['.mov',_0x209495(0x453)+_0x209495(0x409)],[_0x209495(0x296),_0x209495(0x2ef)+_0x209495(0x199)],[_0x209495(0x210),_0x209495(0x2ef)+_0x209495(0x4bd)],[_0x209495(0x36d),_0x209495(0x2c6)+'bm'],[_0x209495(0x4b7),_0x209495(0x17b)+'eg'],[_0x209495(0x10f),_0x209495(0x1c4)+'v'],['.m4a',_0x209495(0x17b)+'4'],['.aac',_0x209495(0x24d)+'c'],[_0x209495(0x30d),_0x209495(0x2a5)+'g'],[_0x209495(0x197),_0x209495(0x2cc)+'ac'],['.woff',_0x209495(0x143)+'f'],[_0x209495(0x47a),_0x209495(0x143)+'f2'],[_0x209495(0x18a),'font/ttf'],[_0x209495(0x4ae),_0x209495(0x15f)],[_0x209495(0x4de),_0x209495(0x439)+_0x209495(0x47e)+_0x209495(0x171)+_0x209495(0x131)],[_0x209495(0x1da),_0x209495(0x439)+_0x209495(0x1bb)]]);function _0x1223(_0x5bc59c,_0x335a8a){_0x5bc59c=_0x5bc59c-0x10f;const _0x1e97aa=_0x1e97();let _0x12230b=_0x1e97aa[_0x5bc59c];return _0x12230b;}protocol['register'+_0x209495(0x490)+_0x209495(0x369)+'ged']([{'scheme':APP_RENDERER_PROTOCOL_SCHEME,'privileges':{'secure':!![],'standard':!![],'supportFetchAPI':!![],'corsEnabled':!![]}},{'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={},requestIdHooks={},gatewayRuntimeHooks={},sessionSqliteStore=null,sessionDataService=null,diagnosticsWriter=null,userEventWriter=null,isQuitting=![],updateController=null,pendingProtocolArgs=null;const protocolUrlState=createProtocolUrlState();let createWindowPromise=null,ipcHandlersInstalled=![];const rendererSessionMetrics={'inactiveEventCount':0x0,'inactiveBodyReadSuppressedCount':0x0},RENDERER_SESSION_METRIC_LOG_INTERVAL=0x19;function isProductionMode(){const _0x463187=_0x209495;return process.env.NODE_ENV===_0x463187(0x444)+'on';}function resolveDevToolsFlagPath(){const _0x2f0a60=_0x209495;return shellConfig?.[_0x2f0a60(0x121)]?join(shellConfig[_0x2f0a60(0x121)],_0x2f0a60(0x21e)+_0x2f0a60(0x1fe)):'';}function isDevToolsEnabled(){if(!isProductionMode())return!![];const _0x73d405=resolveDevToolsFlagPath();return Boolean(_0x73d405)&&existsSync(_0x73d405);}function attachGatewayBroadcastHandlers(_0x69c379){const _0x4cbc82=_0x209495;for(const _0x16b415 of[_0x4cbc82(0x421)+_0x4cbc82(0x226),'gateway-'+_0x4cbc82(0x2de),_0x4cbc82(0x4f3)+_0x4cbc82(0x4bc)+'t','agent-ev'+'ent',_0x4cbc82(0x33a)+_0x4cbc82(0x45b),_0x4cbc82(0x1fa)+_0x4cbc82(0x1e2)+'n']){_0x69c379['on'](_0x16b415,_0x3db0a9=>broadcast(_0x16b415,_0x3db0a9));}}function ensureSessionSqliteStore(){const _0x4d9a36=_0x209495;if(sessionSqliteStore)return sessionSqliteStore;if(!configController)throw new Error(_0x4d9a36(0x3cb)+_0x4d9a36(0x479)+'ig\x20is\x20no'+'t\x20initia'+_0x4d9a36(0x21b));return sessionSqliteStore=createSessionSqliteStore({'stateDir':configController['resolveS'+_0x4d9a36(0x3ca)]()}),sessionSqliteStore;}function ensureSessionDataService(){const _0x5ed8cf=_0x209495;if(sessionDataService)return sessionDataService['attachGa'+_0x5ed8cf(0x3fb)+_0x5ed8cf(0x1c7)]?.(gatewayController),sessionDataService;if(!configController)throw new Error(_0x5ed8cf(0x3cb)+_0x5ed8cf(0x479)+_0x5ed8cf(0x2cd)+_0x5ed8cf(0x38a)+_0x5ed8cf(0x21b));return sessionDataService=createSessionDataService({'stateDir':configController[_0x5ed8cf(0x137)+_0x5ed8cf(0x3ca)](),'sessionSqliteStore':ensureSessionSqliteStore(),'gatewayController':gatewayController,'broadcast':broadcast,'logger':mainLogger}),sessionDataService[_0x5ed8cf(0x14c)+_0x5ed8cf(0x3b1)+_0x5ed8cf(0x4cc)]?.(_0x24606e=>{const _0x23c04f=_0x5ed8cf;broadcast('sessions'+_0x23c04f(0x119)+_0x23c04f(0x350)+'hanged',_0x24606e);}),sessionDataService[_0x5ed8cf(0x339)+_0x5ed8cf(0x3fb)+_0x5ed8cf(0x1c7)]?.(),sessionDataService;}function updateRendererSessionMetrics(_0xd79ca1){const _0x45a603=_0x209495;if(!_0xd79ca1||typeof _0xd79ca1!==_0x45a603(0x18c))return;if(_0xd79ca1[_0x45a603(0x377)]!==_0x45a603(0x2c5)+_0x45a603(0x486)+'_body_re'+_0x45a603(0x161)+_0x45a603(0x424))return;const _0xc84fdb=_0xd79ca1[_0x45a603(0x1c5)]&&typeof _0xd79ca1['meta']===_0x45a603(0x18c)?_0xd79ca1['meta']:{},_0x199548=Number(_0xc84fdb[_0x45a603(0x315)]);if(!Number[_0x45a603(0x3aa)](_0x199548)||_0x199548<=rendererSessionMetrics[_0x45a603(0x2c5)+_0x45a603(0x284)+_0x45a603(0x2e9)+_0x45a603(0x246)])return;rendererSessionMetrics[_0x45a603(0x2c5)+'BodyRead'+_0x45a603(0x2e9)+_0x45a603(0x246)]=_0x199548,rendererSessionMetrics['inactive'+_0x45a603(0x420)+'nt']=Math['max'](rendererSessionMetrics[_0x45a603(0x2c5)+_0x45a603(0x420)+'nt'],_0x199548);if(_0x199548!==0x1&&_0x199548%RENDERER_SESSION_METRIC_LOG_INTERVAL!==0x0)return;mainLogger?.[_0x45a603(0x448)]?.(_0x45a603(0x31c)+_0x45a603(0x14b)+_0x45a603(0x3dd)+_0x45a603(0x3ff),{'metric':'inactive'+_0x45a603(0x486)+_0x45a603(0x28b)+'ad_suppr'+_0x45a603(0x424),'inactiveEventCount':rendererSessionMetrics[_0x45a603(0x2c5)+_0x45a603(0x420)+'nt'],'inactiveBodyReadSuppressedCount':rendererSessionMetrics[_0x45a603(0x2c5)+_0x45a603(0x284)+'Suppress'+'edCount'],'changeKind':typeof _0xc84fdb['changeKi'+'nd']==='string'?_0xc84fdb['changeKi'+'nd']:null,'origin':typeof _0xc84fdb['origin']===_0x45a603(0x40e)?_0xc84fdb[_0x45a603(0x324)]:null});}function ensureGeneratedFilesStore(){const _0x13701c=_0x209495;if(generatedFilesStore)return generatedFilesStore;if(!configController)throw new Error('wujie-sh'+_0x13701c(0x479)+_0x13701c(0x2cd)+'t\x20initia'+_0x13701c(0x21b));return generatedFilesStore=createGeneratedFilesStore({'stateDir':configController['resolveS'+_0x13701c(0x3ca)]()}),generatedFilesStore;}async function ensureGatewayControllerStarted(){const _0x5bb182=_0x209495;if(!gatewayController&&(!shellConfig||!configController))throw new Error(bootError?_0x5bb182(0x3cb)+_0x5bb182(0x3a9)+'\x20failed:'+'\x20'+bootError:_0x5bb182(0x3cb)+_0x5bb182(0x4ea)+_0x5bb182(0x12b)+_0x5bb182(0x291)+'alized');return!gatewayController&&(mainLogger?.['warn'](_0x5bb182(0x231)+'controll'+_0x5bb182(0x4c5)+'ng;\x20recr'+'eating'),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x5bb182(0x172)+'on'](),'productRuntimeHooks':gatewayRuntimeHooks,'userEventWriter':userEventWriter,'sessionSqliteStore':ensureSessionSqliteStore()}),attachGatewayBroadcastHandlers(gatewayController),ensureSessionDataService()),await gatewayController['start'](),gatewayController;}function getMode(){const _0x2fc6e5=_0x209495;return process.env.VITE_DEV_SERVER_URL?_0x2fc6e5(0x2f0):'prod';}function isGatewayNotInitializedError(_0x36ee89){const _0x217ef2=_0x209495;return _0x36ee89 instanceof Error&&_0x36ee89[_0x217ef2(0x2b6)]===_0x217ef2(0x3cb)+_0x217ef2(0x4ea)+_0x217ef2(0x12b)+_0x217ef2(0x291)+_0x217ef2(0x3e8);}function revealPathInFolder(_0x34acc3){const _0x317a38=_0x209495,_0x48b97f=String(_0x34acc3||'')['trim']();if(!_0x48b97f)return{'ok':![],'error':'path\x20is\x20'+_0x317a38(0x4e0)};return shell[_0x317a38(0x4d8)+_0x317a38(0x2f7)](_0x48b97f),{'ok':!![]};}function resolveProjectRoot(){const _0x3132e7=_0x209495;if(process.env.WUJIE_SHELL_PROJECT_ROOT)return resolve(process.env.WUJIE_SHELL_PROJECT_ROOT);if(app[_0x3132e7(0x280)+'ed']&&process[_0x3132e7(0x3c3)+_0x3132e7(0x247)])return join(process[_0x3132e7(0x3c3)+_0x3132e7(0x247)],'app.asar');return resolve(process[_0x3132e7(0x4a0)]());}function resolveProtocolScheme(){const _0x489d83=_0x209495;return typeof shellConfig?.[_0x489d83(0x2e7)]==='string'?shellConfig[_0x489d83(0x2e7)]['trim']():'';}function summarizeProtocolUrl(_0x8b132b){const _0x5eb8d0=_0x209495,_0x1d0e56=typeof _0x8b132b===_0x5eb8d0(0x40e)?_0x8b132b:'';if(!_0x1d0e56)return summarizeText('',0xa0);try{const _0x21d1e0=new URL(_0x1d0e56);for(const _0x4fd16e of[_0x5eb8d0(0x1f4),_0x5eb8d0(0x2b8)+'e','code',_0x5eb8d0(0x44f),_0x5eb8d0(0x118)]){_0x21d1e0[_0x5eb8d0(0x4b9)+_0x5eb8d0(0x264)][_0x5eb8d0(0x38f)](_0x4fd16e)&&_0x21d1e0[_0x5eb8d0(0x4b9)+_0x5eb8d0(0x264)][_0x5eb8d0(0x39a)](_0x4fd16e,_0x5eb8d0(0x4e7)+'D]');}return summarizeText(_0x21d1e0['toString'](),0xa0);}catch{return summarizeText(_0x1d0e56,0xa0);}}function extractProtocolUrlFromArgs(_0x5885ee=[]){const _0x254e88=_0x209495,_0x4bd619=resolveProtocolScheme();if(!_0x4bd619)return null;return _0x5885ee[_0x254e88(0x189)](_0x4e7b51=>{const _0x40bd34=_0x254e88;if(typeof _0x4e7b51!==_0x40bd34(0x40e))return![];return _0x4e7b51[_0x40bd34(0x4a2)+'th'](_0x4bd619+_0x40bd34(0x2c1));})||null;}function getUsableMainWindow(){const _0x4c1fa8=_0x209495;if(!mainWindow)return null;if(mainWindow['isDestro'+'yed']())return mainWindow=null,protocolUrlState['setRende'+'rerReady'](![]),null;if(mainWindow[_0x4c1fa8(0x19a)+_0x4c1fa8(0x1c7)]?.[_0x4c1fa8(0x2c4)+_0x4c1fa8(0x130)]?.())return mainWindow=null,protocolUrlState['setRende'+_0x4c1fa8(0x45c)](![]),null;return mainWindow;}async function ensureMainWindow(){const _0x12a596=_0x209495,_0x3c30fa=getUsableMainWindow();if(_0x3c30fa)return _0x3c30fa;if(!shellConfig||!ipcHandlersInstalled)return null;return!createWindowPromise&&(createWindowPromise=createWindow()[_0x12a596(0x111)](()=>{createWindowPromise=null;})),await createWindowPromise,getUsableMainWindow();}function restoreMainWindowForPendingProtocolUrl(){if(!shellConfig)return;void ensureMainWindow()['catch'](_0x3ae0eb=>{const _0x334759=_0x1223;mainLogger?.[_0x334759(0x18e)]('protocol'+_0x334759(0x3ac)+_0x334759(0x1d9)+_0x334759(0x365),summarizeError(_0x3ae0eb));});}function queueProtocolUrl(_0x28a408,_0x54ee83,_0x302e22=null){const _0x5c5acc=_0x209495,{duplicate:_0x26bbde}=protocolUrlState['queueUrl'](_0x28a408);mainLogger?.[_0x5c5acc(0x1db)]('protocol'+_0x5c5acc(0x29d)+'ued\x20for\x20'+_0x5c5acc(0x14b),{'url':summarizeProtocolUrl(_0x28a408),'reason':_0x54ee83,'duplicatePending':_0x26bbde,'hasWindow':Boolean(_0x302e22),'isLoadingMainFrame':Boolean(_0x302e22?.[_0x5c5acc(0x19a)+_0x5c5acc(0x1c7)]['isLoadin'+'gMainFra'+'me']()),'protocolRendererReady':protocolUrlState[_0x5c5acc(0x14b)+'Ready']});}function dispatchProtocolUrl(_0x33661d){const _0x590677=_0x209495,_0x25bc35=resolveProtocolScheme();if(typeof _0x33661d!==_0x590677(0x40e))return;if(!_0x25bc35){protocolUrlState[_0x590677(0x3d9)+_0x590677(0x28a)](_0x33661d),mainLogger?.[_0x590677(0x1db)]('protocol'+_0x590677(0x29d)+_0x590677(0x1a6)+_0x590677(0x300)+_0x590677(0x232),{'url':summarizeProtocolUrl(_0x33661d)});return;}if(!_0x33661d[_0x590677(0x4a2)+'th'](_0x25bc35+'://'))return;mainLogger?.[_0x590677(0x1db)](_0x590677(0x2e7)+'\x20url\x20rec'+_0x590677(0x1e6),{'url':summarizeProtocolUrl(_0x33661d)});const _0x33285a=getUsableMainWindow();if(!_0x33285a){queueProtocolUrl(_0x33661d,_0x590677(0x48f)+_0x590677(0x436));if(!_0x33285a)restoreMainWindowForPendingProtocolUrl();return;}if(_0x33285a[_0x590677(0x19a)+'nts'][_0x590677(0x32c)+_0x590677(0x279)+'me']()){queueProtocolUrl(_0x33661d,_0x590677(0x13e)+'main-fra'+'me',_0x33285a);return;}if(!protocolUrlState[_0x590677(0x14b)+_0x590677(0x48e)]){queueProtocolUrl(_0x33661d,'renderer'+_0x590677(0x142)+'dy',_0x33285a);return;}_0x33285a[_0x590677(0x1a9)](),_0x33285a['focus'](),broadcast(_0x590677(0x314)+_0x590677(0x35c),_0x33661d),mainLogger?.[_0x590677(0x1db)](_0x590677(0x2e7)+_0x590677(0x4b1)+_0x590677(0x492),{'url':summarizeProtocolUrl(_0x33661d),'protocolRendererReady':protocolUrlState[_0x590677(0x14b)+'Ready']});}function flushPendingProtocolUrl(){const _0x34ffa7=_0x209495,_0x15cfc6=protocolUrlState[_0x34ffa7(0x47b)+'dingUrl']();if(!_0x15cfc6)return;mainLogger?.['warn'](_0x34ffa7(0x2e7)+_0x34ffa7(0x2ff)+_0x34ffa7(0x3c6)+'shing',{'url':summarizeProtocolUrl(_0x15cfc6)}),void dispatchProtocolUrl(_0x15cfc6);}function getLocalFileMimeType(_0x371ac8){const _0x34ca12=_0x209495;return LOCAL_FILE_MIME_TYPES[_0x34ca12(0x308)](_0x371ac8[_0x34ca12(0x347)](_0x371ac8[_0x34ca12(0x3fa)+_0x34ca12(0x2d4)]('.'))[_0x34ca12(0x469)+_0x34ca12(0x4a4)]())||_0x34ca12(0x439)+_0x34ca12(0x349)+_0x34ca12(0x312);}function resolveRendererDistDir(){const _0x447fa9=_0x209495;return join(shellConfig[_0x447fa9(0x22f)+_0x447fa9(0x326)],_0x447fa9(0x41e));}function decodeAppRendererPath(_0x5f556d){const _0xe87f25=_0x209495;try{const _0x1f5fec=new URL(_0x5f556d);if(_0x1f5fec[_0xe87f25(0x2e7)]!==APP_RENDERER_PROTOCOL_SCHEME+':')return null;if(_0x1f5fec[_0xe87f25(0x3ee)]!==APP_RENDERER_PROTOCOL_HOST)return null;const _0x170efd=resolveRendererDistDir(),_0x148129=decodeURIComponent(_0x1f5fec[_0xe87f25(0x11d)]||_0xe87f25(0x1a7)+'tml'),_0x437b4f=_0x148129[_0xe87f25(0x3b9)](/^\/+/,'')||_0xe87f25(0x38e)+'ml',_0x27477e=resolve(_0x170efd,_0x437b4f);if(_0x27477e!==_0x170efd&&!_0x27477e['startsWi'+'th'](''+_0x170efd+sep))return null;return{'url':_0x1f5fec,'distDir':_0x170efd,'filePath':_0x27477e};}catch{return null;}}function parseSingleRangeHeader(_0x31cb2c,_0x5736d0){const _0x5ebd7e=_0x209495,_0x525e08=/^bytes=(\d*)-(\d*)$/i['exec'](_0x31cb2c[_0x5ebd7e(0x36b)]());if(!_0x525e08)return null;const [,_0x448191,_0x13a4f8]=_0x525e08;if(!_0x448191&&!_0x13a4f8)return null;if(!_0x448191){const _0x2eb422=Number[_0x5ebd7e(0x290)](_0x13a4f8,0xa);if(!Number[_0x5ebd7e(0x3aa)](_0x2eb422)||_0x2eb422<=0x0)return null;const _0x45376f=Math[_0x5ebd7e(0x23d)](_0x5736d0-_0x2eb422,0x0);return{'start':_0x45376f,'end':_0x5736d0-0x1};}const _0xb9b08e=Number[_0x5ebd7e(0x290)](_0x448191,0xa);if(!Number[_0x5ebd7e(0x3aa)](_0xb9b08e)||_0xb9b08e<0x0||_0xb9b08e>=_0x5736d0)return null;const _0x3e4611=_0x13a4f8?Number[_0x5ebd7e(0x290)](_0x13a4f8,0xa):_0x5736d0-0x1;if(!Number['isFinite'](_0x3e4611)||_0x3e4611<_0xb9b08e)return null;return{'start':_0xb9b08e,'end':Math[_0x5ebd7e(0x465)](_0x3e4611,_0x5736d0-0x1)};}function decodeClawspacePath(_0x45a038){const _0x5657c6=_0x209495;try{const _0x4b236e=new URL(_0x45a038);if(_0x4b236e['protocol']!==CLAWSPACE_PROTOCOL_SCHEME+':')return null;if(_0x4b236e[_0x5657c6(0x3ee)]!==_0x5657c6(0x3ef))return null;const _0xc45d77=decodeURIComponent(_0x4b236e[_0x5657c6(0x11d)]);if(!_0xc45d77)return null;if(/^\/[A-Za-z]:\//[_0x5657c6(0x25c)](_0xc45d77))return _0xc45d77['slice'](0x1);return _0xc45d77;}catch{return null;}}function createClawspaceHeaders(_0x12ef70={}){const _0x2b7115=_0x209495;return new Headers({'access-control-allow-origin':'*','access-control-allow-methods':_0x2b7115(0x433)+_0x2b7115(0x345)+'NS','access-control-allow-headers':_0x2b7115(0x29c)+_0x2b7115(0x12f)+_0x2b7115(0x49b),'access-control-expose-headers':_0x2b7115(0x4b4)+'length,\x20'+_0x2b7115(0x4b4)+_0x2b7115(0x397)+_0x2b7115(0x176)+_0x2b7115(0x4a3),..._0x12ef70});}function createLocalFileResponse(_0x15c624,_0x22aec1){const _0x2b1c20=_0x209495,_0x49b9aa=statSync(_0x22aec1);if(!_0x49b9aa[_0x2b1c20(0x3ab)]())return new Response('Not\x20foun'+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':'text/pla'+_0x2b1c20(0x22b)+'set=utf-'+'8'})});const _0x5dea32=getLocalFileMimeType(_0x22aec1),_0x2b445a=createClawspaceHeaders({'content-type':_0x5dea32,'accept-ranges':_0x2b1c20(0x43c),'cache-control':_0x2b1c20(0x1df)});if(_0x15c624[_0x2b1c20(0x2d1)]===_0x2b1c20(0x243))return _0x2b445a[_0x2b1c20(0x39a)](_0x2b1c20(0x4b4)+_0x2b1c20(0x407),String(_0x49b9aa[_0x2b1c20(0x4a9)])),new Response(null,{'status':0xc8,'headers':_0x2b445a});const _0x104167=_0x15c624[_0x2b1c20(0x430)]['get'](_0x2b1c20(0x3ec));if(!_0x104167)return _0x2b445a[_0x2b1c20(0x39a)](_0x2b1c20(0x4b4)+_0x2b1c20(0x407),String(_0x49b9aa[_0x2b1c20(0x4a9)])),new Response(Readable[_0x2b1c20(0x336)](createReadStream(_0x22aec1)),{'status':0xc8,'headers':_0x2b445a});const _0x136402=parseSingleRangeHeader(_0x104167,_0x49b9aa[_0x2b1c20(0x4a9)]);if(!_0x136402)return new Response(null,{'status':0x1a0,'headers':createClawspaceHeaders({...Object[_0x2b1c20(0x35a)+_0x2b1c20(0x4b5)](_0x2b445a[_0x2b1c20(0x3da)]()),'content-range':'bytes\x20*/'+_0x49b9aa[_0x2b1c20(0x4a9)]})});const {start:_0x25104e,end:_0x3eedd2}=_0x136402,_0x160bc8=_0x3eedd2-_0x25104e+0x1,_0xa26b81=new Headers(_0x2b445a);return _0xa26b81[_0x2b1c20(0x39a)](_0x2b1c20(0x4b4)+_0x2b1c20(0x407),String(_0x160bc8)),_0xa26b81[_0x2b1c20(0x39a)](_0x2b1c20(0x4b4)+_0x2b1c20(0x3ec),_0x2b1c20(0x3bb)+_0x25104e+'-'+_0x3eedd2+'/'+_0x49b9aa[_0x2b1c20(0x4a9)]),new Response(Readable[_0x2b1c20(0x336)](createReadStream(_0x22aec1,{'start':_0x25104e,'end':_0x3eedd2})),{'status':0xce,'headers':_0xa26b81});}function installClawspaceProtocolHandler(){protocol['handle'](CLAWSPACE_PROTOCOL_SCHEME,_0x4be8be=>{const _0x3deed0=_0x1223;if(_0x4be8be[_0x3deed0(0x2d1)]===_0x3deed0(0x15e))return new Response(null,{'status':0xcc,'headers':createClawspaceHeaders()});const _0x5d4607=decodeClawspacePath(_0x4be8be[_0x3deed0(0x298)]);if(!_0x5d4607)return new Response(_0x3deed0(0x16f)+_0x3deed0(0x4f1)+_0x3deed0(0x27f),{'status':0x190,'headers':createClawspaceHeaders({'content-type':_0x3deed0(0x4d7)+'in;\x20char'+_0x3deed0(0x1ab)+'8'})});if(!existsSync(_0x5d4607))return new Response(_0x3deed0(0x459)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x3deed0(0x4d7)+_0x3deed0(0x22b)+_0x3deed0(0x1ab)+'8'})});return createLocalFileResponse(_0x4be8be,_0x5d4607);});}function installAppRendererProtocolHandler(){protocol['handle'](APP_RENDERER_PROTOCOL_SCHEME,_0x1000f4=>{const _0x59685a=_0x1223;if(_0x1000f4[_0x59685a(0x2d1)]==='OPTIONS')return new Response(null,{'status':0xcc,'headers':createClawspaceHeaders()});const _0x9c00ff=decodeAppRendererPath(_0x1000f4[_0x59685a(0x298)]);if(!_0x9c00ff)return new Response(_0x59685a(0x16f)+'app\x20url',{'status':0x190,'headers':createClawspaceHeaders({'content-type':_0x59685a(0x4d7)+_0x59685a(0x22b)+_0x59685a(0x1ab)+'8'})});const {url:_0x56fc2e,distDir:_0x210943,filePath:_0x1d8e2d}=_0x9c00ff,_0x74e38b=join(_0x210943,_0x59685a(0x38e)+'ml'),_0x4bac13=existsSync(_0x1d8e2d),_0x248060=_0x4bac13?_0x1d8e2d:_0x74e38b;if(!_0x4bac13&&_0x56fc2e[_0x59685a(0x11d)][_0x59685a(0x257)]('.'))return new Response(_0x59685a(0x459)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x59685a(0x4d7)+_0x59685a(0x22b)+_0x59685a(0x1ab)+'8'})});if(!existsSync(_0x248060))return mainLogger?.[_0x59685a(0x18e)](_0x59685a(0x14b)+_0x59685a(0x2ee)+'ile\x20not\x20'+_0x59685a(0x18f),{'requestUrl':_0x1000f4['url'],'targetPath':_0x248060}),new Response('Not\x20foun'+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x59685a(0x4d7)+_0x59685a(0x22b)+_0x59685a(0x1ab)+'8'})});return createLocalFileResponse(_0x1000f4,_0x248060);});}function broadcast(_0x561d32,_0x243147){const _0x3ec12f=_0x209495;DEBUG_STDOUT&&console['info'](_0x3ec12f(0x256)+_0x3ec12f(0x33e)+_0x3ec12f(0x222),_0x561d32,summarizePayload(_0x243147,{'maxDepth':0x2}));for(const _0x23a18a of BrowserWindow[_0x3ec12f(0x1cf)+_0x3ec12f(0x3b5)]()){!_0x23a18a[_0x3ec12f(0x19a)+'nts'][_0x3ec12f(0x2c4)+_0x3ec12f(0x130)]()&&_0x23a18a[_0x3ec12f(0x19a)+_0x3ec12f(0x1c7)]['send']('wujie-sh'+_0x3ec12f(0x46e)+'t',{'name':_0x561d32,'payload':_0x243147});}}function requestLogReportFromRenderer(_0x35a36f){const _0x25bd0a=_0x209495,_0x4ae8a0=BrowserWindow[_0x25bd0a(0x4ed)+_0x25bd0a(0x495)]()||(mainWindow&&!mainWindow[_0x25bd0a(0x2c4)+'yed']()?mainWindow:null),_0x222b89={'source':_0x35a36f};if(!_0x4ae8a0||_0x4ae8a0[_0x25bd0a(0x19a)+_0x25bd0a(0x1c7)][_0x25bd0a(0x2c4)+'yed']()){broadcast(_0x25bd0a(0x277)+_0x25bd0a(0x23f)+_0x25bd0a(0x1f5),_0x222b89);return;}_0x4ae8a0[_0x25bd0a(0x3bf)+'zed']()&&_0x4ae8a0[_0x25bd0a(0x429)](),_0x4ae8a0['show'](),_0x4ae8a0[_0x25bd0a(0x3d5)](),_0x4ae8a0['webConte'+_0x25bd0a(0x1c7)][_0x25bd0a(0x356)](_0x25bd0a(0x3cb)+_0x25bd0a(0x46e)+'t',{'name':'app:log-'+_0x25bd0a(0x23f)+_0x25bd0a(0x1f5),'payload':_0x222b89});}function installApplicationMenu(){const _0x50e9d5=_0x209495;if(process[_0x50e9d5(0x443)]!=='darwin')return;const _0x112d62=[{'label':shellConfig?.[_0x50e9d5(0x2a7)+_0x50e9d5(0x3af)]||app[_0x50e9d5(0x454)],'submenu':[{'role':'about'},{'type':_0x50e9d5(0x4f7)+'r'},{'role':_0x50e9d5(0x368)},{'type':'separato'+'r'},{'role':_0x50e9d5(0x2b3)},{'role':_0x50e9d5(0x16e)+'rs'},{'role':_0x50e9d5(0x411)},{'type':_0x50e9d5(0x4f7)+'r'},{'role':_0x50e9d5(0x318)}]},{'label':'编辑','submenu':[{'role':'undo'},{'role':_0x50e9d5(0x233)},{'type':_0x50e9d5(0x4f7)+'r'},{'role':_0x50e9d5(0x20f)},{'role':_0x50e9d5(0x19b)},{'role':_0x50e9d5(0x1a3)},{'role':_0x50e9d5(0x3df)+'l'}]},{'label':'显示','submenu':[{'role':'reload'},{'role':_0x50e9d5(0x2c2)+'oad'},{'type':'separato'+'r'},{'role':_0x50e9d5(0x385)+_0x50e9d5(0x4e3)}]},{'role':'windowMe'+'nu','label':'窗口'},{'role':_0x50e9d5(0x40a),'label':'帮助','submenu':[{'label':_0x50e9d5(0x344),'click':()=>{const _0x592bd1=_0x50e9d5;requestLogReportFromRenderer(_0x592bd1(0x439)+'ion-menu');}}]}];Menu[_0x50e9d5(0x2aa)+_0x50e9d5(0x381)+'nu'](Menu[_0x50e9d5(0x22a)+_0x50e9d5(0x3be)+'e'](_0x112d62));}async function loadProductRuntime(){const _0x3cc721=_0x209495,_0x41cf0c=[join(shellConfig[_0x3cc721(0x22f)+_0x3cc721(0x326)],'shell-ru'+_0x3cc721(0x3d2),_0x3cc721(0x2e3)+'s'),join(app[_0x3cc721(0x412)+'th'](),_0x3cc721(0x364)+_0x3cc721(0x3d2),'index.mj'+'s')],_0x1fcfca=_0x41cf0c['find'](_0x63a5a8=>existsSync(_0x63a5a8));if(!_0x1fcfca)return mainLogger?.[_0x3cc721(0x448)]('product\x20'+_0x3cc721(0x120)+'extensio'+_0x3cc721(0x2dd)+_0x3cc721(0x168),{'runtimeCandidates':_0x41cf0c}),{};try{const _0x1922e7=await import(pathToFileURL(_0x1fcfca)[_0x3cc721(0x1d7)]);return mainLogger?.['info'](_0x3cc721(0x141)+_0x3cc721(0x120)+_0x3cc721(0x2a1)+_0x3cc721(0x39c),{'runtimePath':_0x1fcfca}),_0x1922e7;}catch(_0x41ebc5){mainLogger?.[_0x3cc721(0x18e)](_0x3cc721(0x141)+_0x3cc721(0x120)+_0x3cc721(0x2a1)+_0x3cc721(0x316)+_0x3cc721(0x302),{'runtimePath':_0x1fcfca,'error':summarizeError(_0x41ebc5)});throw _0x41ebc5;}}function _0x1e97(){const _0x11a3d2=['s:reveal','elected-','lastInde','tewayEve','openAtLo','app:clip','record','updated','CommandO','config:c','skills:i','keys','plugins:','get-conf','ist','length','setName','icktime','help','before\x20q','agent','ishuRegi','string',':events','uri','unhide','getAppPa','te:quit-','ted','agent_id','meState','contextW','before-q','m-channe','lawMcpSe','andledIn','lConnect','redConte','dist','models\x20c','EventCou','gateway-','select\x20f',':save-we','essed','sync-bun','all','lClient','shellLog','restore','-request','csCliCon','est_fail','showOpen','app:open','getPath','headers','s-snapsh','hatChann','GET,\x20HEA','manifest','g_conten','window','tLogs','terminal','applicat','filters','getPinne','bytes','ishuDocC','#!/bin/s','ngs','Entry','pop','uit:\x20upd','platform','producti','app:star','uncaught','title','info','ximize',':save-di','folder','markQuit','ilConnec','entModel','token','\x20request','stomMode','dispose','video/qu','name','tabs:nav','sourceSe','.htm','lawPlugi','Not\x20foun','recursiv','pdated','rerReady','FeishuDo','hell]\x20fa','all\x20in\x20p','ionUsage','saveWeco','-pinned','dCheck','isabled','min',':save-qq','cron:rem','assign','toLowerC','update','plugin\x20e','electron','logs','ell:even','hecks','abort','g+xml','trationS','setAsDef','atus','config','product-','agents:u','ateway_s','ell\x20conf','.woff2','clearPen','stion','itialize','ion/vnd.','lingUpda','cutoffRo','ens','succeede','changed','leted','d\x20failed','_session','pluginId','workspac','getState','saveTenc','start',':status','models:c','Ready','missing-','SchemesA','update_g','patched','image/bm','ndlers','edWindow','isArray',':get-clo','-level','list','659908lRvnzy','ype','selected',':unpin','s:upsert','+Shift+I','cwd','-life-cy','startsWi','nges','ase','_respons','saveQqbo','appId','agents:l','size','ignore','nectorCo','provider','path','.otf','entDocsC','ges','\x20url\x20dis','ProductR','est\x20comp','content-','ies','saveFeis','.mp3','est\x20star','searchPa','files','level','eam-even','matroska','readConf','indexOf','error、wa','agent\x20de',':rename','lawChann','resolveC','er\x20missi','.mp4','ionEvent','utf-8','openDevT','te:check','model-id','State','tup:get','les:reve','.ico','hell:ipc','g\x20native','inned','\x20client\x20','ls:set-e','ctory','Keys','text/pla','showItem','eam','tate','peratedM','app:syst','defaults','.eot',':\x20gatewa','required','ate\x20inst','register','llscreen','cancelFe','openclaw','startFei','[REDACTE','logs:get','resh-age','ell\x20gate','updateOp','-status','getFocus','lect-fil','syncRunt','dow\x20load','clawspac','top_done','chat-str','untimeHa','Session','ion','separato','models','huChanne','imePlugi','unref','.wav','agent-','finally','agents:c','nput-eve','getRevis',':save-kd','uDocCliC','ocs','state',':runtime','ocolClie',':save','tIdTitle','pathname',':diagnos','function','runtime\x20','dataDir','bot-chan','handle','e\x20first.','enClawMc','\x20CLI\x20wra','dels','enClawCo','config:r','quitAndI','way\x20is\x20n','argv','id\x20title','senderFr','ontent-t','yed','bject',':choose','runtime:','tabs-age','window:i','preventD','resolveS','cron:lis','ItemSett','ap:get',':save-fe','nelSessi','update-c','loading-','ionEntry','apiKey','product\x20','-not-rea','font/wof','shell\x20lo','and-inst','node','ad-binar','lTs',':snapsho','mand','renderer','subscrib','sses','navigati','efault','ileName','window:o','logs:ope','initiali','arch','lConfig',':gateway','files:li','node:fs/','-ready','debug','sender','2984718TRpAoj','plugin\x20c','OPTIONS','font/otf','g\x20update','ad_suppr','listSumm','gatewayP','ncent-ex',':answer-','timeout','saveKdoc','und','getStatu','messages','main','artifact','ocsCliCo','hideOthe','Invalid\x20','rayOnClo','ms-fonto','getVersi','top_star','app:tray','nfig','ccept-ra','logLevel','tup:set','\x20rendere','stringif','audio/mp','writeEve','director','tabs:pos','wujiecla','em:resta','avatar','pServer','indowTok','setSelec',':pin','getKdocs','ead','key','find','.ttf','\x20allowin','object','startWec','error','found','download','plugins','th\x20is\x20re','upsert','unknown','byteLeng','reasonin','.flac','torConfi','msvideo','webConte','copy','orted','skills:u','t-messag','logsDir','utf8','igWriteH','ll-close','paste','ssion:\x20','before-i','ued\x20befo','/index.h','diagnost','show','ith-sess','set=utf-','.js','sharedCo','onReques','saveNetE','-session','window:t','ces.json','s-maximi','iConnect','ectory\x20o','unregist','#f8fafc','kdocs','ite-bina','ipc','ion/wasm','rnal','nabled',':set-clo','ModelId','ion/java','harset=u','ready\x20ex','\x20open-ur','audio/wa','meta','te:get-s','nts','rated-fi','minimize','figs','boot\x20ele','et=utf-8','/chat/co','model','getAllWi','tion\x20fai','number','.gif','fig','#ffffff','filter','quired','href','getMessa','restore\x20','.wasm','warn','startKdo','tabs-com','enClawCh','no-store','roductDa','tatus','-questio','onnector','-url','-logs','eived','cron:cre','\x20main\x20bo','ap:upser','ector\x20se','eted','no\x20defau',':open-cl','content','close','some','ectory','requestB','cle','authCode','equested','irectory','control','image/pn','enClawSk','ask-user','d-state','agent\x20id','map','.flag','setLogin','tease-ma','uest-age','whenRead','cancelKd','loadURL','cancelWe','will-qui','logs:lis','ure','feishu_d','board:wr','customMo','before\x20i','em:open-','app:upda','cut','.mkv','ctron\x20ma','rn、info\x20','Config','uit','33330mgIrBO','ections','app:file','ishu-doc','showSave','\x20quit','lized','e\x20comple','migrateP','devtools','otAfterI',':agent-m','text','nt]','from','Dialog','chat:abo','status','openExte','shouldLo','igate','buildFro','in;\x20char','pendingU','ory-info','unmaximi','projectR','child-pr','gateway\x20','g\x20ready','redo','nstallin','ted\x20conn','models:s','ackgroun',':reorder','ession','yInfo','main\x20win','sessionK','max','rControl','report-r','ile\x20writ','-by-sess','annelCon','HEAD','gin','eated','edCount','sPath','oggle-ma',':usage','d\x20reject','.json','25725564SEHlsA','audio/aa','Version','ools',':\x20stoppi','win32','iled\x20to\x20','n-direct','ot\x20start','checkFor','[wujie-s','includes','tanceLoc','ted-ever','cutoffTe','sConnect','test','aseMailC','vate','Unsuppor','targetDi','sourcePa','unhandle','ort','rams','Terminal',':downloa','relaunch','customNa','parentSe','IPC\x20requ','maxToken','les:dele','complete','ite','stream','elSessio','setImCha','readCurr','limit','meFilter','e:open-d','444cLfUub','app:log-','storyLoa','gMainFra','setRende','.jpeg','filePath','files:re','inimize','e\x20url','isPackag','execPath','api.open','tic','BodyRead','promises','INFO','rocess-g','-shortcu','image/jp','ngUrl','_body_re',';\x20charse','ls:delet','ationSta','dSession','parseInt','ot\x20initi','isIntege','timeoutM','elConfig','\x20shortcu','.avi','roductCo','url','closeToT','s:list','ingleIns','range,\x20c','\x20url\x20que','agent\x20up','generate','ings','extensio','\x20updater','sessionI','ocess\x20go','audio/og','onnectSt','productN','ectSessi','getURL','setAppli','mjs','getLogin','ssion','ing',':resize','fromIpc','nstance','napshot','hide','huDocCon','r\x20ready','message','dated','auth_cod','ions-lis','nConfig','app:info','user','window_f','pdate','child\x20pr','tory','://','forceRel',':message','isDestro','inactive','video/we','.css','now','pen-devt','-port','markConf','audio/fl','ig\x20is\x20no','acts','\x20log','stration','method','ng\x20gatew','ey\x20is\x20re','xOf','ate','cron','skills','maxEntri','ernal\x20ur','zed','onfig','te:downl','n\x20not\x20fo','log','gatewayT','illEntry','mport-zi','oken','index.mj','208568JFRmQC','d-local','type','protocol','feishu','Suppress','sessions','json','ipc\x20requ','shuDocCl','\x20entry\x20f','video/x-','dev','push','lt\x20model','emoji','open','liConnec','startBac','InFolder','deletedS','figured:','versions','ed:\x20','script;\x20','\x20main\x20wi','.webp','\x20pending','re\x20confi','keyDown','\x20to\x20load','role','lawSkill','image/gi','runtimeI','e:shared','get','cron:log','nel','ists',':save-ne','.ogg','d\x20comple','openDire','les:upse','temperat','t-stream','Event','app:prot','count','n\x20failed','catch','quit','choices','t=utf-8','nstall','session\x20','d\x20is\x20req','deleteIm','agentId','saveQqMa','e\x20direct','-state-s','code','origin','Bearer\x20','oot','.jpg','captureI','nfo','tf-8','bin','isLoadin','l\x20prepar','reorderP','s:delete','file\x20rea','reverse','talkDocC','render-p','agents','rver','toWeb','s:hide','1827JUnBPF','attachGa','agents-u','red;\x20set','ettings','listBySe','hell:eve','ocess-go','ources','tabs:req','hideBySe','create','上传日志...','D,\x20OPTIO','runtimeR','slice','dled-res','ion/octe','agents:w','requestS','lect-dir','ternally','kUserQue','baseUrl','-state-c','Everywhe','ncident','keepUnti','agents:d','.png','send','orConfig','config:i','ted-stat','fromEntr','app:gene','ocol-url',':save-te','isInstal','或\x20debug','activate','deleteOp','mChannel','text/mar','shell-ru','failed','\x20is\x20requ','logs:set','services','sPrivile','isMaximi','trim','tp\x20','.webm','operated','onChatHi','setOpenC','ired','ipc_requ','open\x20ext','closed','select\x20d','payload','event','dRejecti','readSess',':choose-','icon',':loading','tabs:ref','canceled','binary\x20f','chat','cationMe','fromWebC','ChannelC','darwin','togglefu','ell-cli.','nt-state','logs\x20exp','request-','t\x20initia','\x20open\x20bl','getRecen','multiSel','index.ht','has','59872oZEuxn','ded','ndow','日志等级必须是\x20','window-a','wechat','mail','range,\x20a','ensureIn','ontext','set','paths','n\x20loaded','mpletion','ready','ap:entry','configPa','match','ector:\x20','h\x0aexec\x20\x22','4378287cyxmWf','command',':process','nnel','files:se','ell\x20boot','isFinite','isFile','\x20window\x20','listSess','wBin','ame','detach','eRuntime','lose','channelI',':summary','ndows',':run-onc','cron:upd','te\x20compl','replace','Updates','bytes\x20','Level','omplete','mTemplat','isMinimi','ywhere','-weixin','tSession','resource','files:wr','l\x20reques','\x20url\x20flu','Update','hidden','ontents','tateDir','wujie-sh','second-i','plugin\x20d','-exit','.\x20Run\x20wu','g\x20level\x20','window:c','ntime','openPath','chrome','focus','groups','\x20complet','nnelEnab','setPendi','entries','ls:list','restart','\x20metric\x20','toISOStr','selectAl','et-self-','t:\x20','settings','-status-','ory\x20open','ocus',':revisio','jie-shel','alized','one','text/htm','charset=','range','Observed','hostname','local','l\x20first','writeCon','text/css','elete','est\x20fail','-token','ncent-do','ory'];_0x1e97=function(){return _0x11a3d2;};return _0x1e97();}function openDevToolsForActiveContext(){const _0x540d28=_0x209495;if(!isDevToolsEnabled())return mainLogger?.[_0x540d28(0x448)](_0x540d28(0x21e)+_0x540d28(0x38b)+'ocked',{'mode':getMode(),'flagPath':resolveDevToolsFlagPath()}),{'ok':![]};const _0x369f37=BrowserWindow['getFocus'+_0x540d28(0x495)]()||mainWindow;if(!_0x369f37||_0x369f37[_0x540d28(0x2c4)+'yed']())return{'ok':![]};return _0x369f37[_0x540d28(0x19a)+_0x540d28(0x1c7)]['openDevT'+_0x540d28(0x24f)]({'mode':_0x540d28(0x3b0)}),_0x369f37[_0x540d28(0x19a)+_0x540d28(0x1c7)][_0x540d28(0x356)](_0x540d28(0x3cb)+_0x540d28(0x46e)+'t',{'name':_0x540d28(0x21e)+_0x540d28(0x288)+'t','payload':{'accelerator':DEVTOOLS_ACCELERATOR}}),{'ok':!![]};}function registerShellShortcuts(){const _0x42c2ec=_0x209495;globalShortcut[_0x42c2ec(0x1b6)+'er'](DEVTOOLS_ACCELERATOR);if(!isDevToolsEnabled())return;const _0x1c73b3=globalShortcut[_0x42c2ec(0x4e2)](DEVTOOLS_ACCELERATOR,openDevToolsForActiveContext);!_0x1c73b3&&console[_0x42c2ec(0x1db)](_0x42c2ec(0x256)+_0x42c2ec(0x45e)+'iled\x20to\x20'+'register'+_0x42c2ec(0x295)+_0x42c2ec(0x3e1)+DEVTOOLS_ACCELERATOR);}async function getRuntimeResourceStatus(){const _0x187cc6=_0x209495;try{const _0x540240=await loadRuntimeInfo(shellConfig[_0x187cc6(0x22f)+_0x187cc6(0x326)]),_0x322ffa=_0x540240[_0x187cc6(0x434)]||{};return{'ok':!![],'runtimeRoot':_0x540240[_0x187cc6(0x346)+_0x187cc6(0x326)],'openclawVersion':_0x540240['openclaw'+_0x187cc6(0x24e)],'generatedAt':_0x322ffa[_0x187cc6(0x29f)+'dAt']||null,'pluginCount':Array[_0x187cc6(0x496)](_0x322ffa[_0x187cc6(0x191)])?_0x322ffa[_0x187cc6(0x191)][_0x187cc6(0x407)]:0x0,'plugins':Array[_0x187cc6(0x496)](_0x322ffa[_0x187cc6(0x191)])?_0x322ffa[_0x187cc6(0x191)]:[],'agents':_0x322ffa[_0x187cc6(0x334)]||null,'skills':_0x322ffa[_0x187cc6(0x2d7)]||null,'wrapper':_0x322ffa[_0x187cc6(0x17f)+_0x187cc6(0x3ae)]||null,'product':_0x322ffa['product']||null};}catch(_0x22f8f7){return{'ok':![],'runtimeRoot':resolveRuntimeRoot(shellConfig?.[_0x187cc6(0x22f)+'oot']||resolveProjectRoot()),'error':_0x22f8f7 instanceof Error?_0x22f8f7[_0x187cc6(0x2b6)]:String(_0x22f8f7)};}}async function createWindow(){const _0x4ed4e7=_0x209495,_0x1fa179=process.env.VITE_DEV_SERVER_URL||APP_RENDERER_ENTRY_URL,_0x39b2b6=process[_0x4ed4e7(0x443)]===_0x4ed4e7(0x384),_0x420f02=process['platform']===_0x4ed4e7(0x251)?![]:!![],_0x40413b=isDevToolsEnabled();mainLogger?.[_0x4ed4e7(0x448)]('creating'+_0x4ed4e7(0x2fd)+_0x4ed4e7(0x392),{'rendererUrl':_0x1fa179,'mode':getMode(),'devToolsEnabled':_0x40413b,'devToolsFlagPath':resolveDevToolsFlagPath()});const _0x9919c4=new BrowserWindow({'width':0x49c,'height':0x30c,'minWidth':0x384,'minHeight':0x26c,'title':shellConfig[_0x4ed4e7(0x2a7)+_0x4ed4e7(0x3af)],'backgroundColor':_0x39b2b6?_0x4ed4e7(0x1d4):_0x4ed4e7(0x1b7),'autoHideMenuBar':!![],'titleBarStyle':_0x4ed4e7(0x3c8),'titleBarOverlay':_0x420f02,..._0x39b2b6?{'trafficLightPosition':{'x':0x10,'y':0xc}}:{},'webPreferences':{'preload':preloadPath,'contextIsolation':!![],'nodeIntegration':![],'sandbox':![],'devTools':_0x40413b}});mainWindow=_0x9919c4,protocolUrlState[_0x4ed4e7(0x27a)+'rerReady'](![]),_0x9919c4['on'](_0x4ed4e7(0x374),()=>{const _0x2500ab=_0x4ed4e7;if(mainWindow!==_0x9919c4)return;mainWindow=null,protocolUrlState[_0x2500ab(0x27a)+_0x2500ab(0x45c)](![]);}),_0x9919c4[_0x4ed4e7(0x19a)+_0x4ed4e7(0x1c7)]['on'](_0x4ed4e7(0x1a5)+_0x4ed4e7(0x113)+'nt',_0x4b6fce=>{const _0x2e84b9=_0x4ed4e7,_0x24ca9b=_0x4b6fce['input'];if(!_0x24ca9b||_0x24ca9b['type']!==_0x2e84b9(0x301))return;const _0x3b1960=String(_0x24ca9b[_0x2e84b9(0x188)]||'')[_0x2e84b9(0x469)+_0x2e84b9(0x4a4)](),_0x34d74e=_0x3b1960==='r',_0x227cdb=process[_0x2e84b9(0x443)]===_0x2e84b9(0x384)?_0x24ca9b['meta']===!![]:_0x24ca9b[_0x2e84b9(0x1f7)]===!![];if(!_0x34d74e||!_0x227cdb)return;_0x4b6fce[_0x2e84b9(0x136)+_0x2e84b9(0x14f)](),broadcast(_0x2e84b9(0x1dd)+_0x2e84b9(0x14a),{'type':_0x2e84b9(0x14e)+'on','action':'reload'});}),_0x9919c4['on'](_0x4ed4e7(0x3d5),()=>{const _0x1b9fcc=_0x4ed4e7;updateController?.['requestB'+'ackgroun'+_0x1b9fcc(0x463)](_0x1b9fcc(0x2bd)+_0x1b9fcc(0x3e5));});const _0x1b61c1=process.env.VITE_DEV_SERVER_URL;_0x1b61c1?(await _0x9919c4[_0x4ed4e7(0x204)](_0x1b61c1),process.env.WUJIE_SHELL_OPEN_DEVTOOLS==='1'&&_0x40413b&&_0x9919c4[_0x4ed4e7(0x19a)+_0x4ed4e7(0x1c7)][_0x4ed4e7(0x4c9)+_0x4ed4e7(0x24f)]({'mode':_0x4ed4e7(0x3b0)})):await _0x9919c4[_0x4ed4e7(0x204)](APP_RENDERER_ENTRY_URL),mainLogger?.['info'](_0x4ed4e7(0x23b)+_0x4ed4e7(0x4f0)+'ed',{'rendererUrl':_0x1fa179,'mode':getMode(),'devToolsEnabled':_0x40413b});}function registerProtocolHandlers(){const _0x564924=_0x209495,_0x109013=resolveProtocolScheme();if(!_0x109013)return;let _0x445b31=![];try{_0x445b31=app[_0x564924(0x280)+'ed']?app[_0x564924(0x473)+'aultProt'+_0x564924(0x11a)+'nt'](_0x109013,process[_0x564924(0x281)],[app[_0x564924(0x412)+'th']()]):![];}catch(_0xbdb6bc){mainLogger?.[_0x564924(0x18e)](_0x564924(0x2e7)+_0x564924(0x4d3)+'registra'+_0x564924(0x1d0)+'led',{'protocol':_0x109013,'error':summarizeError(_0xbdb6bc)});}mainLogger?.[_0x564924(0x1db)]('protocol'+_0x564924(0x4d3)+'register'+'ed',{'protocol':_0x109013,'registered':_0x445b31,'packaged':app[_0x564924(0x280)+'ed'],'defaultClient':app['isDefaul'+'tProtoco'+_0x564924(0x427)](_0x109013),'execPath':toHomePath(process[_0x564924(0x281)]),'appPath':toHomePath(app['getAppPa'+'th']())});const _0x168560=extractProtocolUrlFromArgs(process[_0x564924(0x12c)]);if(_0x168560)protocolUrlState['setPendi'+_0x564924(0x28a)](_0x168560);const _0x3cb456=extractProtocolUrlFromArgs(pendingProtocolArgs||[]);pendingProtocolArgs=null;if(_0x3cb456)protocolUrlState[_0x564924(0x3d9)+'ngUrl'](_0x3cb456);}function normalizeRequestedLogLevel(_0x225f97){const _0xdacb14=_0x209495,_0x37d042=typeof _0x225f97===_0xdacb14(0x40e)?_0x225f97[_0xdacb14(0x36b)]()[_0xdacb14(0x469)+_0xdacb14(0x4a4)]():'';if(!SHELL_LOG_LEVELS['has'](_0x37d042))throw new Error(_0xdacb14(0x393)+_0xdacb14(0x4c0)+_0xdacb14(0x212)+_0xdacb14(0x35f));return _0x37d042;}function writeMainAuditLog(_0x1e5360,_0x390ef9){const _0x13b892=_0x209495;return mainLogger?.['write']?.(formatLogLine({'level':_0x13b892(0x286),'context':'main','message':_0x1e5360,'meta':_0x390ef9}));}async function installIpcHandlers(){const _0x1eead3=_0x209495,_0x5776a7=(_0x2d5c46,_0x1f4931)=>{const _0x3111e0=_0x1223;ipcMain[_0x3111e0(0x123)](_0x2d5c46,async(_0x5cec2a,_0x3cb950)=>{const _0x269b6c=_0x3111e0,_0x15fc97=Date[_0x269b6c(0x2c8)](),_0x2ed91f=_0x5cec2a[_0x269b6c(0x12e)+_0x269b6c(0x3af)]?.[_0x269b6c(0x298)]||_0x5cec2a[_0x269b6c(0x15b)][_0x269b6c(0x2a9)](),_0x2fd7b2=ipcLogger?.[_0x269b6c(0x228)+'g'](_0x269b6c(0x15a));_0x2fd7b2&&ipcLogger[_0x269b6c(0x448)](_0x269b6c(0x2ec)+_0x269b6c(0x4b8)+'ted',{'channel':_0x2d5c46,'senderUrl':_0x2ed91f});DEBUG_STDOUT&&_0x2fd7b2&&console[_0x269b6c(0x448)](_0x269b6c(0x256)+'hell:ipc'+']',_0x2d5c46,'started');try{let _0x43064e;try{_0x43064e=await _0x1f4931(_0x5cec2a,_0x3cb950);}catch(_0x544a25){if(!isGatewayNotInitializedError(_0x544a25))throw _0x544a25;await ensureGatewayControllerStarted(),_0x43064e=await _0x1f4931(_0x5cec2a,_0x3cb950);}const _0x33df6d=Date[_0x269b6c(0x2c8)]()-_0x15fc97;return(_0x2fd7b2||_0x33df6d>IPC_SLOW_REQUEST_THRESHOLD_MS)&&ipcLogger?.[_0x269b6c(0x448)](_0x269b6c(0x2ec)+_0x269b6c(0x4b3)+'leted',{'channel':_0x2d5c46,'durationMs':_0x33df6d,'status':'succeede'+'d'}),await userEventWriter?.[_0x269b6c(0x2b0)]({'channel':_0x2d5c46,'payload':_0x3cb950,'result':_0x43064e,'durationMs':_0x33df6d,'status':_0x269b6c(0x482)+'d'}),DEBUG_STDOUT&&_0x2fd7b2&&console[_0x269b6c(0x448)]('[wujie-s'+_0x269b6c(0x4d0)+']',_0x2d5c46,_0x269b6c(0x26d)+'d',{'durationMs':_0x33df6d,'status':'succeede'+'d'}),_0x43064e;}catch(_0x3912b5){const _0x61069d=Date['now']()-_0x15fc97;ipcLogger?.[_0x269b6c(0x18e)](_0x269b6c(0x2ec)+'est\x20fail'+'ed',{'channel':_0x2d5c46,'durationMs':_0x61069d,'error':summarizeError(_0x3912b5)}),await userEventWriter?.[_0x269b6c(0x2b0)]({'channel':_0x2d5c46,'payload':_0x3cb950,'error':_0x3912b5,'durationMs':_0x61069d,'status':_0x269b6c(0x365)}),await diagnosticsWriter?.['captureI'+_0x269b6c(0x352)](diagnosticEventFromError(_0x3912b5,{'category':'ipc','event':_0x269b6c(0x372)+_0x269b6c(0x42c)+'ed','message':_0x269b6c(0x26a)+_0x269b6c(0x3f4)+_0x269b6c(0x2fb)+_0x2d5c46,'durationMs':_0x61069d,'meta':{'channel':_0x2d5c46,'senderUrl':_0x2ed91f,'payload':summarizePayload(_0x3cb950)}}));DEBUG_STDOUT&&console[_0x269b6c(0x18e)](_0x269b6c(0x256)+'hell:ipc'+']',_0x2d5c46,_0x269b6c(0x365),summarizeError(_0x3912b5));throw _0x3912b5;}});},_0xab79f1=()=>{const _0x2b5138=_0x1223;if(!gatewayController)throw new Error(bootError?_0x2b5138(0x3cb)+_0x2b5138(0x3a9)+'\x20failed:'+'\x20'+bootError:_0x2b5138(0x3cb)+_0x2b5138(0x4ea)+'way\x20is\x20n'+'ot\x20initi'+'alized');return gatewayController;};function _0x467567(){const _0x10e687=_0x1223;for(const _0xb488af of Object[_0x10e687(0x403)](gatewayRuntimeHooks)){delete gatewayRuntimeHooks[_0xb488af];}Object[_0x10e687(0x468)](gatewayRuntimeHooks,productRuntimeHooks,{'onChatHistoryLoaded':async _0x43bb5d=>{const _0x5c5379=_0x10e687;await requestIdHooks?.[_0x5c5379(0x36f)+_0x5c5379(0x278)+_0x5c5379(0x391)]?.(_0x43bb5d),await productRuntimeHooks?.[_0x5c5379(0x36f)+_0x5c5379(0x278)+_0x5c5379(0x391)]?.(_0x43bb5d);},'onRequestIdTitleEvent':async _0x63b057=>{const _0x1aabab=_0x10e687;await requestIdHooks?.[_0x1aabab(0x1ae)+_0x1aabab(0x11c)+'Event']?.(_0x63b057),await productRuntimeHooks?.[_0x1aabab(0x1ae)+_0x1aabab(0x11c)+_0x1aabab(0x313)]?.(_0x63b057);}});}const _0x1f1672=()=>{const _0x360c1b=_0x1223;if(typeof productRuntime[_0x360c1b(0x4e2)+_0x360c1b(0x4b2)+'untimeHa'+_0x360c1b(0x494)]!==_0x360c1b(0x11f))return;const _0x3a2d07=productRuntime[_0x360c1b(0x4e2)+_0x360c1b(0x4b2)+_0x360c1b(0x4f4)+_0x360c1b(0x494)]({'app':app,'BrowserWindow':BrowserWindow,'broadcast':broadcast,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'dialog':dialog,'exportLogsArchive':exportLogsArchive,'filesLogger':filesLogger,'getRuntimeSpawnContext':getRuntimeSpawnContext,'handle':_0x5776a7,'mainLogger':mainLogger,'mainWindow':mainWindow,'rendererLogger':rendererLogger,'requireGateway':_0xab79f1,'sep':sep,'openClawConfigHandlers':{'update':(..._0x2d9dd9)=>configController[_0x360c1b(0x4eb)+_0x360c1b(0x128)+_0x360c1b(0x175)](..._0x2d9dd9),'setPluginConfig':_0x3c4067=>configController[_0x360c1b(0x370)+_0x360c1b(0x458)+_0x360c1b(0x2ba)](_0x3c4067),'setChannelConfig':_0x2d621a=>configController[_0x360c1b(0x370)+_0x360c1b(0x4c3)+_0x360c1b(0x294)](_0x2d621a),'deleteChannelConfig':_0x2e947e=>configController[_0x360c1b(0x361)+_0x360c1b(0x1de)+'annelCon'+_0x360c1b(0x1d3)](_0x2e947e),'setSkillEntry':_0x56aa70=>configController[_0x360c1b(0x370)+_0x360c1b(0x304)+_0x360c1b(0x440)](_0x56aa70),'deleteSkillEntry':_0x11df4c=>configController['deleteOp'+_0x360c1b(0x1f9)+'illEntry'](_0x11df4c),'setMcpServer':_0x591ee9=>configController[_0x360c1b(0x370)+_0x360c1b(0x41a)+'rver'](_0x591ee9),'deleteMcpServer':_0xa5766e=>configController['deleteOp'+'enClawMc'+_0x360c1b(0x182)](_0xa5766e)},'shell':shell,'shellConfig':shellConfig,'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand,'summarizePayload':summarizePayload,'summarizeText':summarizeText,'toHomePath':toHomePath,'writeMutableConfig':_0x2c1ef4})||{};Object[_0x360c1b(0x468)](productRuntimeHooks,_0x3a2d07),_0x467567();};ipcMain['on'](_0x1eead3(0x314)+_0x1eead3(0x35c)+_0x1eead3(0x159),()=>{const _0x330821=_0x1eead3;protocolUrlState[_0x330821(0x27a)+_0x330821(0x45c)](!![]),mainLogger?.[_0x330821(0x1db)](_0x330821(0x2e7)+_0x330821(0x179)+_0x330821(0x2b5),{'hasPendingProtocolUrl':Boolean(protocolUrlState[_0x330821(0x22c)+'rl'])}),flushPendingProtocolUrl();}),_0x5776a7(_0x1eead3(0x2bb),async()=>({'name':shellConfig[_0x1eead3(0x2a7)+_0x1eead3(0x3af)],'version':app['getVersi'+'on'](),'appId':shellConfig[_0x1eead3(0x4a7)],'dataDir':shellConfig[_0x1eead3(0x121)]})),_0x5776a7(_0x1eead3(0x42e)+_0x1eead3(0x1e4),async(_0x30d281,_0x2189ed)=>{const _0x1bbf65=_0x1eead3,_0x10eaa3=typeof _0x2189ed===_0x1bbf65(0x40e)?_0x2189ed:'';if(!_0x10eaa3)return{'ok':![]};return filesLogger?.[_0x1bbf65(0x448)](_0x1bbf65(0x373)+_0x1bbf65(0x2d9)+_0x1bbf65(0x3c5)+_0x1bbf65(0x414),{'url':summarizeText(_0x10eaa3,0xa0)}),await shell[_0x1bbf65(0x227)+_0x1bbf65(0x1bc)](_0x10eaa3),{'ok':!![]};});const _0x2c1ef4=async(_0x361cd3,_0x257809)=>{const _0x383f7a=_0x1eead3;return configController[_0x383f7a(0x2cb)+_0x383f7a(0x1a1)+_0x383f7a(0x41b)+_0x383f7a(0x34d)](),await configController[_0x383f7a(0x3f1)+'fig'](_0x361cd3,_0x257809),{'ok':!![]};};Object['assign'](requestIdHooks,registerRequestIdHandlers({'configController':configController,'handle':_0x5776a7,'mainLogger':mainLogger})),_0x467567(),_0x1f1672(),_0x5776a7(_0x1eead3(0x402)+_0x1eead3(0x2e1)+'p',async(_0x382d3d,_0x2c7a69)=>importMarketSkillZip({'payload':_0x2c7a69,'importSkillZip':_0x131d1b=>importSkillZip({..._0x131d1b,'app':app,'dialog':dialog,'dialogWindow':BrowserWindow[_0x1eead3(0x382)+_0x1eead3(0x3c9)](_0x382d3d['sender'])||mainWindow,'configController':configController}),'configController':configController})),_0x5776a7(_0x1eead3(0x19d)+_0x1eead3(0x2be),(_0x5ac473,_0x1b6650)=>updateManagedSkillConfig({'payload':_0x1b6650,'configController':configController})),_0x5776a7('skills:d'+_0x1eead3(0x3f3),(_0x426b9a,_0x5d84e5)=>deleteMarketSkillRegistryEntry({'payload':_0x5d84e5,'deleteManagedSkill':_0x4a081f=>deleteManagedSkill({..._0x4a081f,'gateway':_0xab79f1(),'configController':configController}),'configController':configController}));const _0x2a7fa4=ensureGeneratedFilesStore();_0x5776a7(_0x1eead3(0x35b)+_0x1eead3(0x1c8)+'les:list',async()=>_0x2a7fa4[_0x1eead3(0x499)]()),_0x5776a7('app:gene'+'rated-fi'+'les:list'+_0x1eead3(0x241)+'ion',async(_0x49c7fe,_0x508348)=>_0x2a7fa4[_0x1eead3(0x33d)+'ssion'](String(_0x508348||''))),_0x5776a7(_0x1eead3(0x35b)+_0x1eead3(0x1c8)+_0x1eead3(0x310)+'rt',async(_0x2d2b5f,_0x3a79d8={})=>_0x2a7fa4['upsert'](_0x3a79d8)),_0x5776a7(_0x1eead3(0x35b)+'rated-fi'+'les:hide',async(_0x6f3d5b,_0xb1157a)=>_0x2a7fa4[_0x1eead3(0x2b3)](String(_0xb1157a||''))),_0x5776a7(_0x1eead3(0x35b)+'rated-fi'+'les:hide'+_0x1eead3(0x241)+_0x1eead3(0x4f6),async(_0x7e7ebe,_0x14e179)=>_0x2a7fa4[_0x1eead3(0x342)+_0x1eead3(0x2ad)](String(_0x14e179||''))),_0x5776a7(_0x1eead3(0x35b)+_0x1eead3(0x1c8)+_0x1eead3(0x26c)+'te',async(_0x22d025,_0x396a50)=>_0x2a7fa4['deleteFi'+'le'](String(_0x396a50||''))),_0x5776a7(_0x1eead3(0x35b)+_0x1eead3(0x1c8)+_0x1eead3(0x26c)+_0x1eead3(0x359)+'e',async(_0x2cf8a5,_0x5a5bf1=[])=>_0x2a7fa4[_0x1eead3(0x2f8)+'tate'](_0x5a5bf1)),_0x5776a7('app:gene'+_0x1eead3(0x1c8)+_0x1eead3(0x4ce)+'al',async(_0x25bef6,_0x2670b7)=>revealPathInFolder(_0x2670b7)),_0x5776a7('artifact'+_0x1eead3(0x29a),async(_0x5cf9eb,_0x5748d2={})=>{const _0x2f59ad=_0x1eead3,_0x2344d0=_0x5748d2&&typeof _0x5748d2===_0x2f59ad(0x18c)&&_0x2f59ad(0x23c)+'ey'in _0x5748d2?String(_0x5748d2[_0x2f59ad(0x23c)+'ey']||''):'';return _0x2344d0?_0x2a7fa4[_0x2f59ad(0x33d)+'ssion'](_0x2344d0):_0x2a7fa4[_0x2f59ad(0x499)]();}),_0x5776a7(_0x1eead3(0x16c)+_0x1eead3(0x49e),async(_0xafda46,_0x5d3d3b={})=>_0x2a7fa4[_0x1eead3(0x193)](_0x5d3d3b)),_0x5776a7('artifact'+_0x1eead3(0x337),async(_0x1a874e,_0x2f6d28={})=>_0x2a7fa4[_0x1eead3(0x2b3)](String(_0x2f6d28['id']||_0x2f6d28||''))),_0x5776a7(_0x1eead3(0x16c)+_0x1eead3(0x32f),async(_0x3c489c,_0x83d373={})=>_0x2a7fa4['deleteFi'+'le'](String(_0x83d373['id']||_0x83d373||''))),_0x5776a7(_0x1eead3(0x16c)+'s:delete'+_0x1eead3(0x1fb),async(_0x10ce14,_0x2d42bd={})=>_0x2a7fa4[_0x1eead3(0x2f8)+_0x1eead3(0x4da)](_0x2d42bd['paths']||_0x2d42bd)),_0x5776a7(_0x1eead3(0x16c)+_0x1eead3(0x3f8),async(_0x1d481d,_0x52665c={})=>{const _0x18c821=_0x1eead3,_0x561b4a=typeof _0x52665c===_0x18c821(0x40e)?_0x52665c:_0x52665c[_0x18c821(0x4ad)]||_0x52665c[_0x18c821(0x410)];return revealPathInFolder(_0x561b4a);});const _0x2b0730=createPreferencesStore({'stateDir':configController[_0x1eead3(0x137)+_0x1eead3(0x3ca)](),'storeFile':_0x1eead3(0x476)+'preferen'+_0x1eead3(0x1b2)}),_0x32d8b1=await _0x2b0730[_0x1eead3(0x308)](_0x1eead3(0x428)+_0x1eead3(0x3bc),configController['paths'][_0x1eead3(0x177)]),_0x4976dd=setShellLoggerLevel(_0x32d8b1);setRuntimeLoggerLevel(_0x32d8b1),mainLogger?.[_0x1eead3(0x448)](_0x1eead3(0x144)+'g\x20level\x20'+_0x1eead3(0x153)+'zed',{'level':_0x4976dd,'configuredLevel':configController[_0x1eead3(0x39b)]['logLevel'],'overriddenByEnv':Boolean(process.env.WUJIE_SHELL_LOG_LEVEL)}),_0x5776a7(_0x1eead3(0x174)+_0x1eead3(0x497)+'se',async()=>_0x2b0730[_0x1eead3(0x308)](_0x1eead3(0x299)+_0x1eead3(0x170)+'se',![])),_0x5776a7('app:tray'+_0x1eead3(0x1be)+'se',async(_0x3e9b51,_0x395f0e)=>_0x2b0730[_0x1eead3(0x39a)](_0x1eead3(0x299)+'rayOnClo'+'se',_0x395f0e===!![])),_0x5776a7(_0x1eead3(0x4e8)+_0x1eead3(0x498),async()=>({'level':getShellLoggerLevel(configController[_0x1eead3(0x39b)]),'overriddenByEnv':Boolean(process.env.WUJIE_SHELL_LOG_LEVEL)})),_0x5776a7(_0x1eead3(0x367)+_0x1eead3(0x498),async(_0x29ad32,_0x52e4fe={})=>{const _0x269f98=_0x1eead3,_0x2c3e5b=normalizeRequestedLogLevel(typeof _0x52e4fe===_0x269f98(0x40e)?_0x52e4fe:_0x52e4fe[_0x269f98(0x4bb)]);await _0x2b0730['set'](_0x269f98(0x428)+_0x269f98(0x3bc),_0x2c3e5b);const _0xf1dbc7=setShellLoggerLevel(_0x2c3e5b);return setRuntimeLoggerLevel(_0x2c3e5b),await writeMainAuditLog(_0x269f98(0x144)+_0x269f98(0x3d0)+_0x269f98(0x483),{'requestedLevel':_0x2c3e5b,'level':_0xf1dbc7,'overriddenByEnv':Boolean(process.env.WUJIE_SHELL_LOG_LEVEL)}),{'ok':!![],'level':_0xf1dbc7,'overriddenByEnv':Boolean(process.env.WUJIE_SHELL_LOG_LEVEL)};}),registerFileHandlers({'app':app,'filesLogger':filesLogger,'handle':_0x5776a7,'sep':sep,'stateDir':configController[_0x1eead3(0x137)+_0x1eead3(0x3ca)](),'toHomePath':toHomePath}),registerProductLogHandlers({'app':app,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'exportLogsArchive':exportLogsArchive,'handle':_0x5776a7,'mainLogger':mainLogger,'rendererLogger':rendererLogger,'summarizeText':summarizeText,'toHomePath':toHomePath}),registerModelHandlers({'handle':_0x5776a7,'modelHandlers':{'saveCustomModel':_0xad9edb=>_0xab79f1()[_0x1eead3(0x4f8)]['saveCust'+'omModel'](_0xad9edb),'deleteCustomModel':_0x193390=>_0xab79f1()['models']['deleteCu'+_0x1eead3(0x451)+'l'](_0x193390)}}),connectorController=createConnectorController({'shellConfig':shellConfig,'configController':configController,'broadcast':broadcast,'shell':shell,'getRuntimeSpawnContext':getRuntimeSpawnContext,'openClawConfigHandlers':{'update':(..._0x22fd44)=>configController['updateOp'+_0x1eead3(0x128)+_0x1eead3(0x175)](..._0x22fd44),'setPluginConfig':_0x91dc56=>configController[_0x1eead3(0x370)+_0x1eead3(0x458)+_0x1eead3(0x2ba)](_0x91dc56),'setChannelConfig':_0x16b2e3=>configController[_0x1eead3(0x370)+_0x1eead3(0x4c3)+_0x1eead3(0x294)](_0x16b2e3),'deleteChannelConfig':_0x5cd593=>configController[_0x1eead3(0x361)+_0x1eead3(0x1de)+_0x1eead3(0x242)+_0x1eead3(0x1d3)](_0x5cd593),'setSkillEntry':_0x34accc=>configController[_0x1eead3(0x370)+'lawSkill'+_0x1eead3(0x440)](_0x34accc),'deleteSkillEntry':_0x334413=>configController[_0x1eead3(0x361)+_0x1eead3(0x1f9)+_0x1eead3(0x2e0)](_0x334413),'setMcpServer':_0xf6453b=>configController[_0x1eead3(0x370)+'lawMcpSe'+_0x1eead3(0x335)](_0xf6453b),'deleteMcpServer':_0x48f84c=>configController[_0x1eead3(0x361)+_0x1eead3(0x125)+_0x1eead3(0x182)](_0x48f84c)},'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand}),_0x5776a7(_0x1eead3(0x358)+_0x1eead3(0x419)+_0x1eead3(0x3db),async()=>connectorController['listImCh'+_0x1eead3(0x242)+_0x1eead3(0x1ca)]()),_0x5776a7(_0x1eead3(0x358)+_0x1eead3(0x419)+_0x1eead3(0x28d)+'e',async(_0x403caf,_0x45b95f={})=>connectorController[_0x1eead3(0x31e)+_0x1eead3(0x383)+_0x1eead3(0x2db)](_0x45b95f)),_0x5776a7(_0x1eead3(0x358)+'m-channe'+_0x1eead3(0x4d4)+'nabled',async(_0xdf616e,_0xad12ee={})=>connectorController[_0x1eead3(0x271)+_0x1eead3(0x3d8)+'led'](_0xad12ee)),_0x5776a7('config:c'+_0x1eead3(0x1e3)+_0x1eead3(0x11b),async(_0x39c565,_0x356f4b={})=>{const _0x42a845=_0x1eead3,_0x456392=String(_0x356f4b['channelI'+'d']||_0x356f4b[_0x42a845(0x376)]?.['channelI'+'d']||_0x356f4b[_0x42a845(0x376)]?.['id']||'');if(!_0x456392)throw new Error(_0x42a845(0x3b3)+_0x42a845(0x31d)+'uired');const _0x2cbd89=_0x356f4b[_0x42a845(0x376)]||_0x356f4b,_0x13bfa9={'feishu':connectorController[_0x42a845(0x4b6)+'huChanne'+_0x42a845(0x155)],'qqbot':connectorController[_0x42a845(0x4a6)+'tChannel'+'Config'],'wecom':connectorController[_0x42a845(0x461)+_0x42a845(0x362)+_0x42a845(0x213)],'qq_mail':connectorController[_0x42a845(0x320)+_0x42a845(0x44d)+_0x42a845(0x198)+'g'],'netease_mail':connectorController[_0x42a845(0x1af)+'aseMailC'+'onnector'+_0x42a845(0x213)],'tencent_exmail':connectorController[_0x42a845(0x48a)+'entExmai'+'lConnect'+_0x42a845(0x357)],'feishu_doc':connectorController['saveFeis'+_0x42a845(0x2b4)+_0x42a845(0x4ab)+_0x42a845(0x175)],'tencent_docs':connectorController[_0x42a845(0x48a)+_0x42a845(0x4af)+_0x42a845(0x1e3)+_0x42a845(0x213)],'kdocs':connectorController[_0x42a845(0x167)+'sConnect'+_0x42a845(0x357)],'dingtalk_doc':connectorController['saveDing'+_0x42a845(0x332)+'onnector'+_0x42a845(0x213)]},_0x4c79c2=_0x13bfa9[_0x456392];if(!_0x4c79c2)throw new Error(_0x42a845(0x25f)+_0x42a845(0x235)+_0x42a845(0x3a2)+_0x456392);return _0x4c79c2(_0x2cbd89);}),_0x5776a7('config:c'+_0x1eead3(0x1e3)+_0x1eead3(0x13b)+'ishu-cha'+_0x1eead3(0x3a7),async(_0x43d9fd,_0x1aede8={})=>connectorController[_0x1eead3(0x4b6)+_0x1eead3(0x4f9)+'lConfig'](_0x1aede8)),_0x5776a7(_0x1eead3(0x401)+'onnector'+_0x1eead3(0x466)+_0x1eead3(0x122)+_0x1eead3(0x30a),async(_0x5eee67,_0x5156ce={})=>connectorController[_0x1eead3(0x4a6)+'tChannel'+'Config'](_0x5156ce)),_0x5776a7(_0x1eead3(0x401)+'onnector'+_0x1eead3(0x423)+'com-chan'+_0x1eead3(0x30a),async(_0x3cdbcc,_0x418edb={})=>connectorController[_0x1eead3(0x461)+_0x1eead3(0x362)+_0x1eead3(0x213)](_0x418edb)),_0x5776a7(_0x1eead3(0x401)+_0x1eead3(0x1e3)+':save-qq'+'-mail',async(_0x15f113,_0x2062b5={})=>connectorController[_0x1eead3(0x320)+_0x1eead3(0x44d)+'torConfi'+'g'](_0x2062b5)),_0x5776a7('config:c'+'onnector'+_0x1eead3(0x30c)+_0x1eead3(0x200)+'il',async(_0x161572,_0x2baf2b={})=>connectorController[_0x1eead3(0x1af)+_0x1eead3(0x25d)+_0x1eead3(0x1e3)+_0x1eead3(0x213)](_0x2baf2b)),_0x5776a7(_0x1eead3(0x401)+'onnector'+_0x1eead3(0x35d)+_0x1eead3(0x164)+_0x1eead3(0x396),async(_0x5a0dce,_0x4c7a17={})=>connectorController['saveTenc'+'entExmai'+_0x1eead3(0x41c)+_0x1eead3(0x357)](_0x4c7a17)),_0x5776a7(_0x1eead3(0x401)+'onnector'+_0x1eead3(0x13b)+_0x1eead3(0x218),async(_0x1fb9da,_0x3d4fe9={})=>connectorController[_0x1eead3(0x4b6)+_0x1eead3(0x2b4)+_0x1eead3(0x4ab)+_0x1eead3(0x175)](_0x3d4fe9)),_0x5776a7(_0x1eead3(0x401)+'onnector'+_0x1eead3(0x35d)+_0x1eead3(0x3f6)+'cs',async(_0x1d61e1,_0x1e3eef={})=>connectorController[_0x1eead3(0x48a)+_0x1eead3(0x4af)+_0x1eead3(0x1e3)+_0x1eead3(0x213)](_0x1e3eef)),_0x5776a7(_0x1eead3(0x401)+'onnector'+_0x1eead3(0x115)+_0x1eead3(0x117),async(_0x412483,_0x1e00b9={})=>connectorController[_0x1eead3(0x167)+_0x1eead3(0x25b)+_0x1eead3(0x357)](_0x1e00b9)),_0x5776a7(_0x1eead3(0x401)+_0x1eead3(0x1e3)+_0x1eead3(0x44a)+'ngtalk-d'+'oc',async(_0xd60e6d,_0x2c4c55={})=>connectorController['saveDing'+_0x1eead3(0x332)+_0x1eead3(0x1e3)+_0x1eead3(0x213)](_0x2c4c55)),_0x5776a7(_0x1eead3(0x401)+_0x1eead3(0x1e3)+'-session'+':start',async(_0x46ebb8,_0x21fb1e={})=>{const _0xea5c1b=_0x1eead3,_0x59620b=String(_0x21fb1e[_0xea5c1b(0x3b3)+'d']||_0x21fb1e['type']||'');if(_0x59620b===_0xea5c1b(0x1b8))return connectorController[_0xea5c1b(0x1dc)+_0xea5c1b(0x42b)+'nectSess'+_0xea5c1b(0x4f6)]();if(_0x59620b===_0xea5c1b(0x209)+'oc')return connectorController[_0xea5c1b(0x4e6)+_0xea5c1b(0x2ed)+_0xea5c1b(0x1b4)+_0xea5c1b(0x4f5)]();if(_0x59620b===_0xea5c1b(0x2e8))return connectorController[_0xea5c1b(0x4e6)+'shuRegis'+_0xea5c1b(0x472)+_0xea5c1b(0x239)](_0x21fb1e);if(_0x59620b==='openclaw'+_0xea5c1b(0x3c1)||_0x59620b===_0xea5c1b(0x395))return connectorController[_0xea5c1b(0x18d)+_0xea5c1b(0x432)+_0xea5c1b(0x270)+'n']({'gatewayPort':_0xab79f1()['gatewayP'+_0xea5c1b(0x263)](),'gatewayToken':_0xab79f1()[_0xea5c1b(0x2df)+_0xea5c1b(0x2e2)]()});throw new Error(_0xea5c1b(0x25f)+'ted\x20conn'+'ector\x20se'+'ssion:\x20'+(_0x59620b||_0xea5c1b(0x194)));}),_0x5776a7(_0x1eead3(0x401)+_0x1eead3(0x1e3)+_0x1eead3(0x1b0)+_0x1eead3(0x48c),async(_0x14356d,_0x11b6b8={})=>{const _0x4b7689=_0x1eead3,_0x288c17=String(_0x11b6b8[_0x4b7689(0x3b3)+'d']||_0x11b6b8[_0x4b7689(0x2e6)]||'');if(_0x288c17===_0x4b7689(0x1b8))return connectorController[_0x4b7689(0x186)+'CliConne'+'ctStatus'](_0x11b6b8);if(_0x288c17===_0x4b7689(0x209)+'oc')return connectorController['getFeish'+_0x4b7689(0x116)+_0x4b7689(0x2a6)+_0x4b7689(0x474)](_0x11b6b8);if(_0x288c17===_0x4b7689(0x2e8))return connectorController['getFeish'+'uRegistr'+_0x4b7689(0x28e)+'tus'](_0x11b6b8);throw new Error(_0x4b7689(0x25f)+_0x4b7689(0x235)+_0x4b7689(0x1ea)+_0x4b7689(0x1a4)+(_0x288c17||'unknown'));}),_0x5776a7(_0x1eead3(0x401)+'onnector'+_0x1eead3(0x1b0)+':cancel',async(_0x142ca2,_0x4c7c9b={})=>{const _0x3e38ef=_0x1eead3,_0x2e7d71=String(_0x4c7c9b[_0x3e38ef(0x3b3)+'d']||_0x4c7c9b[_0x3e38ef(0x2e6)]||'');if(_0x2e7d71===_0x3e38ef(0x1b8))return connectorController[_0x3e38ef(0x203)+_0x3e38ef(0x16d)+'nnectSes'+'sion'](_0x4c7c9b);if(_0x2e7d71===_0x3e38ef(0x209)+'oc')return connectorController[_0x3e38ef(0x4e4)+_0x3e38ef(0x43d)+_0x3e38ef(0x2f5)+_0x3e38ef(0x3c2)](_0x4c7c9b);if(_0x2e7d71===_0x3e38ef(0x2e8))return connectorController[_0x3e38ef(0x4e4)+_0x3e38ef(0x40d)+_0x3e38ef(0x2d0)+_0x3e38ef(0x4f5)](_0x4c7c9b);if(_0x2e7d71===_0x3e38ef(0x4e5)+_0x3e38ef(0x3c1)||_0x2e7d71===_0x3e38ef(0x395))return connectorController[_0x3e38ef(0x205)+'chatChan'+_0x3e38ef(0x13c)+'on']();return{'ok':!![]};}),_0x5776a7(_0x1eead3(0x401)+_0x1eead3(0x1e3)+_0x1eead3(0x1b0)+':complet'+'e',async(_0x350f57,_0x220650={})=>{const _0x3aa236=_0x1eead3,_0x5cdb0c=String(_0x220650[_0x3aa236(0x3b3)+'d']||_0x220650[_0x3aa236(0x2e6)]||'');if(_0x5cdb0c===_0x3aa236(0x209)+'oc')return connectorController[_0x3aa236(0x26d)+_0x3aa236(0x45d)+'cCliConn'+_0x3aa236(0x2a8)+'on'](_0x220650);throw new Error('Unsuppor'+_0x3aa236(0x235)+'ector\x20se'+'ssion:\x20'+(_0x5cdb0c||'unknown'));}),_0x5776a7(_0x1eead3(0x129)+_0x1eead3(0x187),()=>connectorController[_0x1eead3(0x4be)+'igSnapsh'+'ot']());const _0xd811cf=_0x51b10f=>{const _0x3f0798=_0x1eead3,_0x952570=_0x51b10f['agents']&&typeof _0x51b10f[_0x3f0798(0x334)]==='object'?_0x51b10f[_0x3f0798(0x334)]:{};return Array['isArray'](_0x952570[_0x3f0798(0x499)])?_0x952570[_0x3f0798(0x499)]:[];},_0x2be380=_0x48a4cd=>{const _0x286382=_0x1eead3,_0x5e09c7=typeof _0x48a4cd===_0x286382(0x40e)?_0x48a4cd[_0x286382(0x36b)]():'',_0x5ded20=_0x5e09c7[_0x286382(0x3a1)](/^agent:([^:]+):/);return _0x5ded20?.[0x1]||'';},_0x8e0781=(_0xf4366b={},_0x209d5d=[])=>{const _0x391ced=_0x1eead3,_0x308259=Array[_0x391ced(0x496)](_0xf4366b[_0x391ced(0x3d6)])?_0xf4366b['groups']:[],_0x34dd50=Array[_0x391ced(0x496)](_0xf4366b['agents'])?_0xf4366b[_0x391ced(0x334)]:Array[_0x391ced(0x496)](_0xf4366b[_0x391ced(0x499)])?_0xf4366b[_0x391ced(0x499)]:_0x308259[_0x391ced(0x1fd)](_0x215b16=>_0x215b16?.[_0x391ced(0x40c)])[_0x391ced(0x1d5)](Boolean),_0x4846fd=Array[_0x391ced(0x496)](_0x209d5d)?_0x209d5d:[];return _0x34dd50['map'](_0x502178=>{const _0xddea39=_0x391ced,_0x48343f=String(_0x502178?.['id']||_0x502178?.[_0xddea39(0x31f)]||'')['trim'](),_0x336fdc=_0x308259['find'](_0x5f4330=>{const _0x2bdeaf=_0xddea39,_0x241d0e=String(_0x5f4330?.[_0x2bdeaf(0x40c)]?.['id']||_0x5f4330?.['agent']?.['agentId']||'')[_0x2bdeaf(0x36b)]();return _0x241d0e===_0x48343f;});return{..._0x336fdc&&typeof _0x336fdc===_0xddea39(0x18c)?_0x336fdc:{},'agent':_0x502178,'sessions':_0x48343f?_0x4846fd[_0xddea39(0x1d5)](_0x4abe95=>{const _0x2aa691=_0xddea39,_0x77a538=String(_0x4abe95?.[_0x2aa691(0x31f)]||_0x4abe95?.[_0x2aa691(0x415)]||_0x4abe95?.['agent']?.['id']||_0x2be380(_0x4abe95?.[_0x2aa691(0x188)])||'')[_0x2aa691(0x36b)]();return _0x77a538?_0x77a538===_0x48343f:_0x48343f==='main';}):[]};});};_0x5776a7('app:upda'+_0x1eead3(0x1c6)+_0x1eead3(0x4da),async()=>updateController?.[_0x1eead3(0x489)]()),_0x5776a7(_0x1eead3(0x20e)+_0x1eead3(0x4ca),async()=>updateController?.[_0x1eead3(0x255)+_0x1eead3(0x3ba)]()),_0x5776a7('app:upda'+_0x1eead3(0x2dc)+'oad',async()=>updateController?.[_0x1eead3(0x190)+_0x1eead3(0x3c7)]()),_0x5776a7(_0x1eead3(0x20e)+_0x1eead3(0x413)+_0x1eead3(0x145)+_0x1eead3(0x426),async()=>updateController?.[_0x1eead3(0x12a)+'nstall']()),_0x5776a7(_0x1eead3(0x217)+_0x1eead3(0x132),async(_0x182d15,_0x34f5ce={})=>{const _0x34fcdc=_0x1eead3,_0x49b782=await dialog[_0x34fcdc(0x42d)+_0x34fcdc(0x224)](BrowserWindow[_0x34fcdc(0x382)+_0x34fcdc(0x3c9)](_0x182d15['sender'])??mainWindow,{'properties':['openFile',..._0x34f5ce?.[_0x34fcdc(0x273)]!==0x1?[_0x34fcdc(0x38d)+_0x34fcdc(0x216)]:[]],'filters':_0x34f5ce?.[_0x34fcdc(0x268)+_0x34fcdc(0x274)+'s']?[{'name':'Custom','extensions':_0x34f5ce[_0x34fcdc(0x268)+_0x34fcdc(0x274)+'s']}]:undefined});return _0x49b782[_0x34fcdc(0x27c)+'s'][_0x34fcdc(0x1fd)](_0x53865a=>({'path':_0x53865a,'name':_0x53865a['split'](/[\\/]/)[_0x34fcdc(0x441)]()||_0x53865a}));}),_0x5776a7(_0x1eead3(0x217)+_0x1eead3(0x266)+_0x1eead3(0x2e5),async(_0x5e487a,_0x1e234c={})=>{const _0xc49b6e=_0x1eead3,_0x482e7c=String(_0x1e234c[_0xc49b6e(0x261)+'th']||'');if(!_0x482e7c)return{'success':![],'error':_0xc49b6e(0x261)+_0xc49b6e(0x192)+'quired'};const _0x36d8ce=await dialog[_0xc49b6e(0x219)+_0xc49b6e(0x224)](mainWindow,{'defaultPath':_0x1e234c['defaultF'+_0xc49b6e(0x150)]||_0x482e7c['split'](/[\\/]/)[_0xc49b6e(0x441)]()});if(_0x36d8ce[_0xc49b6e(0x37e)]||!_0x36d8ce[_0xc49b6e(0x27c)])return{'success':![],'canceled':!![]};const {copyFile:_0x2695fe}=await import(_0xc49b6e(0x158)+_0xc49b6e(0x285));return await _0x2695fe(_0x482e7c,_0x36d8ce[_0xc49b6e(0x27c)]),{'success':!![],'filePath':_0x36d8ce['filePath']};}),_0x5776a7(_0x1eead3(0x3fd)+_0x1eead3(0x20a)+_0x1eead3(0x26e),async(_0xd58527,_0x1681bb)=>{return clipboard['writeTex'+'t'](String(_0x1681bb??'')),{'ok':!![]};}),_0x5776a7(_0x1eead3(0x4dc)+_0x1eead3(0x180)+'rt',async()=>{const _0x1561ac=_0x1eead3;return app[_0x1561ac(0x267)](),app[_0x1561ac(0x318)](),{'ok':!![]};}),_0x5776a7(_0x1eead3(0x135)+_0x1eead3(0x1b3)+_0x1eead3(0x2da),_0x576756=>Boolean(BrowserWindow[_0x1eead3(0x382)+_0x1eead3(0x3c9)](_0x576756[_0x1eead3(0x15b)])?.[_0x1eead3(0x36a)+_0x1eead3(0x2da)]())),_0x5776a7(_0x1eead3(0x445)+_0x1eead3(0x178),async(_0x27e9f8,_0x29b9ad)=>{const _0x17f494=_0x1eead3;return app[_0x17f494(0x1ff)+'ItemSett'+_0x17f494(0x2a0)]({'openAtLogin':_0x29b9ad===!![]}),{'ok':!![],'enabled':_0x29b9ad===!![]};}),_0x5776a7(_0x1eead3(0x445)+_0x1eead3(0x4cd),async()=>app[_0x1eead3(0x2ac)+_0x1eead3(0x139)+'ings']()[_0x1eead3(0x3fc)+_0x1eead3(0x244)]),_0x5776a7(_0x1eead3(0x217)+_0x1eead3(0x37a)+_0x1eead3(0x44b),async _0x450590=>{const _0x4811c6=_0x1eead3,_0xd2d11e=await dialog[_0x4811c6(0x42d)+_0x4811c6(0x224)](BrowserWindow[_0x4811c6(0x382)+'ontents'](_0x450590[_0x4811c6(0x15b)])??mainWindow,{'properties':[_0x4811c6(0x30f)+_0x4811c6(0x4d5)]});return _0xd2d11e[_0x4811c6(0x27c)+'s'][0x0]||'';}),_0x5776a7('app:syst'+_0x1eead3(0x20d)+'folder',async(_0x4ead5d,_0x32300e)=>{const _0x37a026=_0x1eead3,_0x5557db=await shell[_0x37a026(0x3d3)](String(_0x32300e||''));return _0x5557db||'';}),_0x5776a7('openclaw'+_0x1eead3(0x156)+_0x1eead3(0x3f5),async()=>_0xab79f1()[_0x1eead3(0x2df)+_0x1eead3(0x2e2)]()),_0x5776a7(_0x1eead3(0x4e5)+':gateway'+_0x1eead3(0x2ca),async()=>_0xab79f1()[_0x1eead3(0x163)+_0x1eead3(0x263)]()),_0x5776a7('openclaw'+_0x1eead3(0x3b6)+'e',async(_0x403be7,_0x2a6585=[])=>{const _0x4926b3=_0x1eead3,_0x298be4=await runClawOnce(shellConfig[_0x4926b3(0x22f)+_0x4926b3(0x326)],Array[_0x4926b3(0x496)](_0x2a6585)?_0x2a6585:[]);return{'ok':_0x298be4[_0x4926b3(0x323)]===0x0,..._0x298be4};});const _0x1f74f1=configController[_0x1eead3(0x137)+_0x1eead3(0x3ca)]();sessionSqliteStore=ensureSessionSqliteStore();const _0x2696a1=createAgentSessionsMapStore({'stateDir':_0x1f74f1});_0x5776a7(_0x1eead3(0x2ea)+':fork',async(_0x3bb3a8,_0x19205b={})=>{const _0x4b5533=_0x1eead3,_0x30dd4e=_0x19205b&&typeof _0x19205b===_0x4b5533(0x18c)?_0x19205b:{},_0x1830d2=_0x30dd4e[_0x4b5533(0x269)+'ssionKey']||_0x30dd4e[_0x4b5533(0x23c)+'ey'],_0x61f736=await _0xab79f1()[_0x4b5533(0x2ea)]['create']({..._0x30dd4e,'parentSessionKey':_0x1830d2}),_0x352248=String(_0x61f736?.[_0x4b5533(0x188)]||'')[_0x4b5533(0x36b)](),_0x5e7658=String(_0x61f736?.[_0x4b5533(0x2a3)+'d']||'')['trim']();return _0x352248&&_0x5e7658&&await _0x2696a1[_0x4b5533(0x193)]({'sessionKey':_0x352248,'sessionId':_0x5e7658,'sourceSessionKey':_0x30dd4e[_0x4b5533(0x456)+'ssionKey']||_0x1830d2,...typeof _0x30dd4e[_0x4b5533(0x353)+_0x4b5533(0x148)]==='number'?{'keepUntilTs':_0x30dd4e[_0x4b5533(0x353)+_0x4b5533(0x148)]}:{},...typeof _0x30dd4e[_0x4b5533(0x480)+'le']==='string'?{'cutoffRole':_0x30dd4e[_0x4b5533(0x480)+'le']}:{},...typeof _0x30dd4e['cutoffTe'+'xt']===_0x4b5533(0x40e)?{'cutoffText':_0x30dd4e[_0x4b5533(0x25a)+'xt']}:{}}),_0x61f736;}),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x220)+_0x1eead3(0x13a),async(_0x2e766c,_0x3554dc={})=>_0x2696a1[_0x1eead3(0x308)](_0x3554dc)),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x220)+_0x1eead3(0x1e9)+'t',async(_0x5a2620,_0x4a3a3b={})=>_0x2696a1[_0x1eead3(0x193)](_0x4a3a3b)),_0x5776a7(_0x1eead3(0x2ea)+':agent-m'+_0x1eead3(0x39f),async(_0xf7fd86,_0x31da2c={})=>{const _0x1d0a39=_0x1eead3,_0x53d799=String(_0x31da2c[_0x1d0a39(0x23c)+'ey']||'')[_0x1d0a39(0x36b)]();if(!_0x53d799)return null;return await sessionSqliteStore[_0x1d0a39(0x379)+_0x1d0a39(0x13f)](_0x53d799);}),_0x5776a7(_0x1eead3(0x112)+'reate',async(_0x59c241,_0x10fc89={})=>{const _0x27a868=_0x1eead3,_0x5f5d24=await readMutableConfig(),_0x230ec0=_0x5f5d24[_0x27a868(0x334)]&&typeof _0x5f5d24['agents']==='object'?_0x5f5d24[_0x27a868(0x334)]:{},_0x69b8f8=_0xd811cf(_0x5f5d24),_0x5c035a=String(_0x10fc89['id']||_0x10fc89['name']||_0x27a868(0x110)+Date['now']())['trim']()[_0x27a868(0x3b9)](/\s+/g,'-'),_0x99274c={'id':_0x5c035a,'name':String(_0x10fc89['name']||_0x5c035a),..._0x10fc89[_0x27a868(0x488)+'e']?{'workspace':String(_0x10fc89[_0x27a868(0x488)+'e'])}:{},..._0x10fc89[_0x27a868(0x1ce)]?{'model':_0x10fc89[_0x27a868(0x1ce)]}:{},..._0x10fc89[_0x27a868(0x2f3)]?{'emoji':_0x10fc89[_0x27a868(0x2f3)]}:{},..._0x10fc89[_0x27a868(0x181)]?{'avatar':_0x10fc89[_0x27a868(0x181)]}:{},...Array[_0x27a868(0x496)](_0x10fc89[_0x27a868(0x2d7)])?{'skills':_0x10fc89['skills']}:{}};if(_0x69b8f8[_0x27a868(0x1f0)](_0xe2bd05=>_0xe2bd05?.['id']===_0x5c035a))throw new Error('agent\x20al'+_0x27a868(0x1c2)+_0x27a868(0x30b));return _0x230ec0[_0x27a868(0x499)]=[..._0x69b8f8,_0x99274c],_0x5f5d24[_0x27a868(0x334)]=_0x230ec0,await _0x2c1ef4(_0x5f5d24,'agent\x20cr'+_0x27a868(0x245)),{'ok':!![],'agent':_0x99274c};}),_0x5776a7(_0x1eead3(0x477)+_0x1eead3(0x2be),async(_0x251671,_0x3b2f0a={})=>{const _0x48d7aa=_0x1eead3,_0xf07129=String(_0x3b2f0a['id']||_0x3b2f0a['agentId']||'')['trim']();if(!_0xf07129)throw new Error(_0x48d7aa(0x1fc)+_0x48d7aa(0x366)+_0x48d7aa(0x371));const _0x4647b1=await readMutableConfig(),_0x1920e0=_0x4647b1[_0x48d7aa(0x334)]&&typeof _0x4647b1['agents']===_0x48d7aa(0x18c)?_0x4647b1[_0x48d7aa(0x334)]:{},_0x96f315=_0xd811cf(_0x4647b1),_0xda53d0=_0x96f315['map'](_0x3857ac=>_0x3857ac?.['id']===_0xf07129?{..._0x3857ac,..._0x3b2f0a,'id':_0xf07129}:_0x3857ac);return _0x1920e0[_0x48d7aa(0x499)]=_0xda53d0,_0x4647b1[_0x48d7aa(0x334)]=_0x1920e0,await _0x2c1ef4(_0x4647b1,_0x48d7aa(0x29e)+_0x48d7aa(0x2b7)),{'ok':!![],'agent':_0xda53d0[_0x48d7aa(0x189)](_0x2eb85e=>_0x2eb85e?.['id']===_0xf07129)||null};}),_0x5776a7(_0x1eead3(0x354)+'elete',async(_0x65bb97,_0x2fb9d6={})=>{const _0x471bd0=_0x1eead3,_0x37bef7=String(_0x2fb9d6['id']||_0x2fb9d6[_0x471bd0(0x31f)]||'')['trim']();if(!_0x37bef7)throw new Error('agent\x20id'+'\x20is\x20requ'+_0x471bd0(0x371));const _0x3e73c2=await readMutableConfig(),_0x1d5873=_0x3e73c2[_0x471bd0(0x334)]&&typeof _0x3e73c2[_0x471bd0(0x334)]==='object'?_0x3e73c2[_0x471bd0(0x334)]:{};return _0x1d5873[_0x471bd0(0x499)]=_0xd811cf(_0x3e73c2)[_0x471bd0(0x1d5)](_0x1743a3=>_0x1743a3?.['id']!==_0x37bef7),_0x3e73c2[_0x471bd0(0x334)]=_0x1d5873,await _0x2c1ef4(_0x3e73c2,_0x471bd0(0x4c1)+_0x471bd0(0x484)),{'ok':!![],'agentId':_0x37bef7};}),_0x5776a7(_0x1eead3(0x34a)+_0x1eead3(0x1aa)+_0x1eead3(0x2b9)+'t',async(_0x27454b,_0x2fe27c={})=>{const _0x3da45d=_0x1eead3,[_0x11168a,_0x5a1242]=await Promise[_0x3da45d(0x426)]([_0xab79f1()[_0x3da45d(0x334)][_0x3da45d(0x499)](),ensureSessionDataService()[_0x3da45d(0x162)+'aries'](_0x2fe27c)[_0x3da45d(0x317)](()=>({'sessions':[]}))]),_0x262456=Array[_0x3da45d(0x496)](_0x5a1242[_0x3da45d(0x2ea)])?_0x5a1242['sessions']:[];return{..._0x11168a,'sessions':_0x262456,'groups':_0x8e0781(_0x11168a,_0x262456)};}),terminalManager=createTerminalManager({'cwd':join(configController[_0x1eead3(0x137)+'tateDir'](),_0x1eead3(0x488)+'e'),'emitData':_0x8da1f4=>broadcast(_0x1eead3(0x438)+'-data',_0x8da1f4),'emitExit':_0x30510b=>broadcast(_0x1eead3(0x438)+_0x1eead3(0x3ce),_0x30510b)}),_0x5776a7('terminal'+':create',async(_0x4e4c6c,_0x18c8d4={})=>terminalManager[_0x1eead3(0x343)](_0x18c8d4)),_0x5776a7(_0x1eead3(0x438)+':input',async(_0x16acc5,_0x38546e={})=>terminalManager['input'](_0x38546e)),_0x5776a7('terminal'+_0x1eead3(0x2af),async(_0x135d4b,_0x425907={})=>terminalManager['resize'](_0x425907)),_0x5776a7(_0x1eead3(0x438)+':close',async(_0x3997d3,_0x2d5908={})=>terminalManager[_0x1eead3(0x1ef)](_0x2d5908)),_0x5776a7('plugins:'+_0x1eead3(0x499),async()=>{const _0x396bd0=_0x1eead3,_0x4f423c=gatewayController?.['runtimeI'+'nfo']?.()||{};return _0x4f423c[_0x396bd0(0x191)]||[];}),_0x5776a7('plugins:'+_0x1eead3(0x405)+'ig',async(_0x1dfc4f,_0x53c6dc={})=>{const _0x5eacd7=String(_0x53c6dc['pluginId']||_0x53c6dc['id']||''),_0x3e3ec5=await readMutableConfig(),_0x44751b=_0x3e3ec5['plugins']?.['entries']||{};return _0x5eacd7?_0x44751b[_0x5eacd7]||null:_0x44751b;}),_0x5776a7(_0x1eead3(0x404)+_0x1eead3(0x13d)+'onfig',async(_0x105ee6,_0x278262={})=>{const _0x109e9e=_0x1eead3,_0x49b888=String(_0x278262[_0x109e9e(0x487)]||_0x278262['id']||'');if(!_0x49b888)throw new Error(_0x109e9e(0x487)+_0x109e9e(0x366)+_0x109e9e(0x371));const _0x9a1eeb=await readMutableConfig(),_0x29c6a9=_0x9a1eeb[_0x109e9e(0x191)]&&typeof _0x9a1eeb[_0x109e9e(0x191)]==='object'?_0x9a1eeb[_0x109e9e(0x191)]:{},_0x3f4a01=_0x29c6a9[_0x109e9e(0x3da)]&&typeof _0x29c6a9[_0x109e9e(0x3da)]==='object'?_0x29c6a9[_0x109e9e(0x3da)]:{};return _0x3f4a01[_0x49b888]={..._0x3f4a01[_0x49b888]||{},..._0x278262[_0x109e9e(0x475)]||_0x278262['patch']||{}},_0x29c6a9[_0x109e9e(0x3da)]=_0x3f4a01,_0x9a1eeb[_0x109e9e(0x191)]=_0x29c6a9,_0x2c1ef4(_0x9a1eeb,_0x109e9e(0x15d)+'onfig\x20up'+_0x109e9e(0x2b7));}),_0x5776a7(_0x1eead3(0x404)+'enable',async(_0x13cefd,_0x5de36d={})=>{const _0xdc7a75=_0x1eead3,_0xe456e3=String(_0x5de36d[_0xdc7a75(0x487)]||_0x5de36d['id']||'');if(!_0xe456e3)throw new Error(_0xdc7a75(0x487)+_0xdc7a75(0x366)+_0xdc7a75(0x371));const _0x5718b3=await readMutableConfig(),_0x4ba6b5=_0x5718b3[_0xdc7a75(0x191)]&&typeof _0x5718b3[_0xdc7a75(0x191)]==='object'?_0x5718b3[_0xdc7a75(0x191)]:{},_0xf034a0=_0x4ba6b5['entries']&&typeof _0x4ba6b5[_0xdc7a75(0x3da)]===_0xdc7a75(0x18c)?_0x4ba6b5[_0xdc7a75(0x3da)]:{};return _0xf034a0[_0xe456e3]={..._0xf034a0[_0xe456e3]||{},'enabled':!![]},_0x4ba6b5[_0xdc7a75(0x3da)]=_0xf034a0,_0x5718b3[_0xdc7a75(0x191)]=_0x4ba6b5,_0x2c1ef4(_0x5718b3,_0xdc7a75(0x46b)+_0xdc7a75(0x1bd));}),_0x5776a7(_0x1eead3(0x404)+'disable',async(_0x74be2,_0x6d3f89={})=>{const _0x5d517e=_0x1eead3,_0x1966ad=String(_0x6d3f89[_0x5d517e(0x487)]||_0x6d3f89['id']||'');if(!_0x1966ad)throw new Error(_0x5d517e(0x487)+'\x20is\x20requ'+_0x5d517e(0x371));const _0xe1d342=await readMutableConfig(),_0x58f03c=_0xe1d342[_0x5d517e(0x191)]&&typeof _0xe1d342[_0x5d517e(0x191)]===_0x5d517e(0x18c)?_0xe1d342[_0x5d517e(0x191)]:{},_0x307ae1=_0x58f03c['entries']&&typeof _0x58f03c[_0x5d517e(0x3da)]===_0x5d517e(0x18c)?_0x58f03c[_0x5d517e(0x3da)]:{};return _0x307ae1[_0x1966ad]={..._0x307ae1[_0x1966ad]||{},'enabled':![]},_0x58f03c[_0x5d517e(0x3da)]=_0x307ae1,_0xe1d342['plugins']=_0x58f03c,_0x2c1ef4(_0xe1d342,_0x5d517e(0x3cd)+_0x5d517e(0x464));}),_0x5776a7(_0x1eead3(0x404)+_0x1eead3(0x226),async(_0x294d4c,_0x1284c7={})=>({'plugins':await((async()=>{const _0x29eb51=_0x1eead3,_0x2b8ef4=gatewayController?.[_0x29eb51(0x306)+_0x29eb51(0x329)]?.()||{};if(!_0x1284c7?.[_0x29eb51(0x487)]&&!_0x1284c7?.['id'])return _0x2b8ef4['plugins']||[];const _0x4058c5=String(_0x1284c7[_0x29eb51(0x487)]||_0x1284c7['id']||'');return(_0x2b8ef4['plugins']||[])[_0x29eb51(0x1d5)](_0x3be427=>_0x3be427[_0x29eb51(0x487)]===_0x4058c5);})())})),_0x5776a7(_0x1eead3(0x455)+_0x1eead3(0x229),async(_0x2511ff,_0x48d121)=>({'ok':!![],'payload':_0x48d121})),_0x5776a7(_0x1eead3(0x17e)+_0x1eead3(0x19e)+'e',async(_0x160375,_0x5371c1)=>{const _0x24f7e0=_0x1eead3;return broadcast('tabs-com'+_0x24f7e0(0x14a),_0x5371c1),{'ok':!![]};}),_0x5776a7(_0x1eead3(0x341)+_0x1eead3(0x201)+_0x1eead3(0x387),async()=>{const _0x761696=_0x1eead3;return broadcast(_0x761696(0x134)+_0x761696(0x387)+_0x761696(0x42a),{}),{'ok':!![]};}),_0x5776a7(_0x1eead3(0x37d)+_0x1eead3(0x4e9)+_0x1eead3(0x387),async(_0x18f8a7,_0x1b6f4a={})=>{const _0x4fd566=_0x1eead3;return broadcast('tabs-age'+_0x4fd566(0x387)+'-refresh'+'-request',_0x1b6f4a),{'ok':!![]};}),_0x5776a7('window:m'+_0x1eead3(0x27e),_0x132978=>{const _0x2443cf=_0x1eead3;return BrowserWindow[_0x2443cf(0x382)+_0x2443cf(0x3c9)](_0x132978[_0x2443cf(0x15b)])?.[_0x2443cf(0x1c9)](),{'ok':!![]};}),_0x5776a7(_0x1eead3(0x1b1)+_0x1eead3(0x248)+_0x1eead3(0x449),_0x2e16d=>{const _0x3cae52=_0x1eead3,_0x458154=BrowserWindow[_0x3cae52(0x382)+_0x3cae52(0x3c9)](_0x2e16d[_0x3cae52(0x15b)]);if(!_0x458154)return{'isMaximized':![]};if(_0x458154[_0x3cae52(0x36a)+_0x3cae52(0x2da)]())_0x458154[_0x3cae52(0x22e)+'ze']();else _0x458154['maximize']();return{'isMaximized':_0x458154[_0x3cae52(0x36a)+_0x3cae52(0x2da)]()};}),_0x5776a7(_0x1eead3(0x3d1)+_0x1eead3(0x3b2),_0xe00c3e=>{const _0x5f4217=_0x1eead3;return BrowserWindow[_0x5f4217(0x382)+'ontents'](_0xe00c3e[_0x5f4217(0x15b)])?.[_0x5f4217(0x1ef)](),{'ok':!![]};}),_0x5776a7(_0x1eead3(0x151)+_0x1eead3(0x2c9)+_0x1eead3(0x24f),()=>openDevToolsForActiveContext()),_0x5776a7(_0x1eead3(0x4e5)+_0x1eead3(0x119)+'-info',()=>_0xab79f1()[_0x1eead3(0x306)+_0x1eead3(0x329)]()),_0x5776a7('openclaw'+_0x1eead3(0x156)+_0x1eead3(0x4ec),async()=>(await ensureGatewayControllerStarted())[_0x1eead3(0x169)+'s']()),ipcMain['on'](_0x1eead3(0x4e5)+':gateway'+_0x1eead3(0x3e3)+'snapshot',_0x5ce464=>{_0x5ce464['returnVa'+'lue']=gatewayController?.['getStatu'+'s']?.()??null;}),_0x5776a7(_0x1eead3(0x4e5)+_0x1eead3(0x156)+'-restart',()=>_0xab79f1()[_0x1eead3(0x3dc)](_0x1eead3(0x14b)+_0x1eead3(0x450))),_0x5776a7(_0x1eead3(0x4e5)+_0x1eead3(0x37c)+_0x1eead3(0x4a1)+_0x1eead3(0x1f3),async()=>({'loadingLifeCycle':_0x1eead3(0x39e),'message':'','updatedAt':new Date()[_0x1eead3(0x3de)+_0x1eead3(0x2ae)]()})),_0x5776a7(_0x1eead3(0x4e5)+':gateway'+_0x1eead3(0x1e5),(_0x31068e,_0x424329={})=>_0xab79f1()[_0x1eead3(0x38c)+_0x1eead3(0x437)](_0x424329?.[_0x1eead3(0x273)]??0xc8)),_0x5776a7(_0x1eead3(0x4e5)+_0x1eead3(0x165)+_0x1eead3(0x1fa)+_0x1eead3(0x1e2)+'n',(_0xfd1c30,_0x1389c4)=>_0xab79f1()['answerAs'+_0x1eead3(0x34e)+_0x1eead3(0x47c)](_0x1389c4)),_0x5776a7('openclaw'+_0x1eead3(0x1ed)+'i-window',async()=>{const _0x395ee3=_0x1eead3,_0x2f51af=join(resolveRuntimeRoot(shellConfig[_0x395ee3(0x22f)+_0x395ee3(0x326)]),_0x395ee3(0x32b),_0x395ee3(0x17f)+'w');if(!existsSync(_0x2f51af))throw new Error(_0x395ee3(0x4e5)+_0x395ee3(0x126)+'pper\x20not'+'\x20found:\x20'+_0x2f51af+(_0x395ee3(0x3cf)+_0x395ee3(0x3e7)+_0x395ee3(0x32d)+_0x395ee3(0x124)));const _0x129e92=join(app[_0x395ee3(0x42f)]('temp'),_0x395ee3(0x3cb)+_0x395ee3(0x386)+_0x395ee3(0x3a5));await writeFile(_0x129e92,_0x395ee3(0x43e)+_0x395ee3(0x3a3)+_0x2f51af[_0x395ee3(0x3b9)](/\\/g,'\x5c\x5c')[_0x395ee3(0x3b9)](/"/g,'\x5c\x22')+'\x22\x0a',{'mode':0x1ed});const _0x3bf9c3=spawn(_0x395ee3(0x2f4),['-a',_0x395ee3(0x265),_0x129e92],{'detached':!![],'stdio':_0x395ee3(0x4aa)});return _0x3bf9c3[_0x395ee3(0x4fb)](),{'ok':!![],'cliPath':_0x2f51af};}),_0x5776a7(_0x1eead3(0x4a8)+_0x1eead3(0x406),()=>_0xab79f1()[_0x1eead3(0x334)][_0x1eead3(0x499)]()),_0x5776a7('skills:s'+_0x1eead3(0x1e1),(_0x171ec3,_0x14768c)=>_0xab79f1()[_0x1eead3(0x2d7)][_0x1eead3(0x226)](_0x14768c)),_0x5776a7(_0x1eead3(0x2ea)+':create',(_0x413f11,_0x49ed36)=>_0xab79f1()[_0x1eead3(0x2ea)]['create'](_0x49ed36)),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x149)+'t',(_0x4c78c2,_0x368122)=>ensureSessionDataService()[_0x1eead3(0x162)+'aries'](_0x368122)),_0x5776a7('sessions'+_0x1eead3(0x3b4),(_0x1b2b97,_0x34532f)=>ensureSessionDataService()['getSumma'+'ry'](_0x34532f)),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x3e6)+'n',(_0x533f48,_0x201ced)=>ensureSessionDataService()[_0x1eead3(0x114)+_0x1eead3(0x4f6)](_0x201ced)),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x2c3)+_0x1eead3(0x431)+'ot',(_0x55a4ce,_0x258617)=>ensureSessionDataService()[_0x1eead3(0x1d8)+_0x1eead3(0x4b0)](_0x258617)),_0x5776a7(_0x1eead3(0x2ea)+':artifac'+'ts',(_0xb3e417,_0x3dd64e)=>ensureSessionDataService()['getArtif'+_0x1eead3(0x2ce)](_0x3dd64e)),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x3a6)+'es',(_0x1edcb8,_0x51aeca)=>ensureSessionDataService()['getProce'+_0x1eead3(0x14d)](_0x51aeca)),_0x5776a7('sessions'+':runtime'+_0x1eead3(0x322)+_0x1eead3(0x2b2),(_0x1503d1,_0x279230={})=>ensureSessionDataService()['getRunti'+_0x1eead3(0x416)](String(_0x279230[_0x1eead3(0x23c)+'ey']||_0x279230[_0x1eead3(0x188)]||''))),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x40f),(_0x4259fe,_0x299066={})=>ensureSessionDataService()[_0x1eead3(0x3ad)+_0x1eead3(0x4c7)+'s'](_0x299066)),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x249),async(_0x5f073e,_0x312249={})=>{const _0x1bf17e=_0x1eead3,_0x3fe817=String(_0x312249[_0x1bf17e(0x23c)+'ey']||_0x312249['key']||'')[_0x1bf17e(0x36b)](),_0x3442ff=await ensureSessionSqliteStore()['readSess'+_0x1bf17e(0x460)](_0x3fe817),_0x453c38=await configController[_0x1bf17e(0x272)+_0x1bf17e(0x44e)+'Context']();return{..._0x3442ff,'contextWindowTokens':_0x453c38[_0x1bf17e(0x417)+_0x1bf17e(0x183)+_0x1bf17e(0x481)],'contextWindowSource':_0x453c38['contextW'+'indowSou'+'rce']};}),_0x5776a7('sessions'+':delete',(_0x33bf45,_0x3dd6bf)=>_0xab79f1()['sessions']['delete'](_0x3dd6bf)),_0x5776a7('chat:str'+_0x1eead3(0x4d9),(_0xb7ea0c,_0xb0201a)=>_0xab79f1()['chat'][_0x1eead3(0x26f)](_0xb0201a)),_0x5776a7(_0x1eead3(0x225)+'rt',(_0x1c0685,_0xfdf70d)=>_0xab79f1()[_0x1eead3(0x380)][_0x1eead3(0x470)](_0xfdf70d)),_0x5776a7('logs:wri'+'te',async(_0x5d9592,_0x1311ad={})=>{const _0x4eb53c=_0x1eead3,_0x2cac46=typeof _0x1311ad['level']===_0x4eb53c(0x40e)?_0x1311ad[_0x4eb53c(0x4bb)]:_0x4eb53c(0x448),_0x2541f4=typeof _0x1311ad[_0x4eb53c(0x2b6)]==='string'?_0x1311ad[_0x4eb53c(0x2b6)]:_0x4eb53c(0x14b)+_0x4eb53c(0x2cf),_0x1fc321=typeof _0x1311ad['context']===_0x4eb53c(0x40e)&&_0x1311ad['context'][_0x4eb53c(0x36b)]()?_0x4eb53c(0x14b)+':'+_0x1311ad['context'][_0x4eb53c(0x36b)]():_0x4eb53c(0x14b),_0x14d4d6=_0x1311ad[_0x4eb53c(0x1c5)]&&typeof _0x1311ad['meta']===_0x4eb53c(0x18c)?{...summarizePayload(_0x1311ad[_0x4eb53c(0x1c5)]),'context':_0x1fc321}:{'context':_0x1fc321},_0x551349=rendererLogger;if(_0x551349?.[_0x2cac46])await _0x551349[_0x2cac46](_0x2541f4,_0x14d4d6);else await _0x551349?.[_0x4eb53c(0x448)](_0x2541f4,_0x14d4d6);if(_0x1311ad[_0x4eb53c(0x1a8)+'ic']===!![]||_0x1fc321==='renderer'+_0x4eb53c(0x11e)+_0x4eb53c(0x283)){const _0x51b899=_0x1311ad[_0x4eb53c(0x3fe)]&&typeof _0x1311ad['record']==='object'?_0x1311ad[_0x4eb53c(0x3fe)]:_0x1311ad['meta']?.[_0x4eb53c(0x3fe)]&&typeof _0x1311ad[_0x4eb53c(0x1c5)][_0x4eb53c(0x3fe)]===_0x4eb53c(0x18c)?_0x1311ad[_0x4eb53c(0x1c5)][_0x4eb53c(0x3fe)]:{'level':_0x2cac46,'category':'renderer','event':_0x1fc321,'message':_0x2541f4,'meta':_0x1311ad[_0x4eb53c(0x1c5)]};updateRendererSessionMetrics(_0x51b899),await diagnosticsWriter?.[_0x4eb53c(0x17c)+'nt'](_0x51b899,{'captureIncident':String(_0x51b899[_0x4eb53c(0x4bb)]||_0x2cac46)[_0x4eb53c(0x469)+_0x4eb53c(0x4a4)]()===_0x4eb53c(0x18e)||_0x1311ad[_0x4eb53c(0x328)+_0x4eb53c(0x352)]===!![]});}return{'ok':!![]};}),_0x5776a7('logs:exp'+_0x1eead3(0x263),async(_0xed4890,_0x16d639={})=>{const _0x243b99=_0x1eead3,_0x1f586d=typeof _0x16d639[_0x243b99(0x260)+'r']===_0x243b99(0x40e)&&_0x16d639[_0x243b99(0x260)+'r'][_0x243b99(0x36b)]()?_0x16d639[_0x243b99(0x260)+'r']:undefined,_0x23aaba=await exportLogsArchive({'logsDir':configController[_0x243b99(0x39b)][_0x243b99(0x19f)],'targetDir':_0x1f586d,'appVersion':app[_0x243b99(0x172)+'on']()});return mainLogger?.[_0x243b99(0x448)](_0x243b99(0x388)+_0x243b99(0x19c),{'path':toHomePath(_0x23aaba[_0x243b99(0x4ad)])}),_0x23aaba;}),_0x5776a7(_0x1eead3(0x152)+_0x1eead3(0x253)+_0x1eead3(0x3f7),async()=>{const _0x3f4fc1=_0x1eead3;return await shell[_0x3f4fc1(0x3d3)](configController[_0x3f4fc1(0x39b)]['logsDir']),mainLogger?.[_0x3f4fc1(0x448)]('logs\x20dir'+_0x3f4fc1(0x1b5)+'pened',{'logsDir':toHomePath(configController[_0x3f4fc1(0x39b)][_0x3f4fc1(0x19f)])}),{'ok':!![],'path':configController['paths'][_0x3f4fc1(0x19f)]};}),_0x5776a7(_0x1eead3(0x207)+'t',async()=>{const _0x53fd27=_0x1eead3,_0x1d4168=await readdir(configController[_0x53fd27(0x39b)]['logsDir'],{'recursive':!![]})[_0x53fd27(0x317)](()=>[]);return _0x1d4168;}),_0x5776a7('logs:rea'+'d',async(_0x2b7709,_0x437409={})=>{const _0x2659d6=_0x1eead3,_0x69a904=String(_0x437409[_0x2659d6(0x4ad)]||'');if(!_0x69a904)throw new Error('path\x20is\x20'+'required');return readFile(_0x69a904,_0x2659d6(0x1a0));}),_0x5776a7('files:re'+'ad',async(_0x594eaa,_0x1af50b)=>{const _0xcaf7f9=_0x1eead3,_0x5244c2=Date[_0xcaf7f9(0x2c8)]();try{const _0x52e761=await readFile(_0x1af50b,_0xcaf7f9(0x1a0));return filesLogger?.[_0xcaf7f9(0x448)](_0xcaf7f9(0x330)+_0xcaf7f9(0x30e)+_0xcaf7f9(0x414),{'path':toHomePath(_0x1af50b),'bytes':Buffer[_0xcaf7f9(0x195)+'th'](_0x52e761),'durationMs':Date[_0xcaf7f9(0x2c8)]()-_0x5244c2}),_0x52e761;}catch(_0x574fe0){filesLogger?.[_0xcaf7f9(0x18e)]('file\x20rea'+_0xcaf7f9(0x485),{'path':toHomePath(_0x1af50b),'durationMs':Date[_0xcaf7f9(0x2c8)]()-_0x5244c2,'error':summarizeError(_0x574fe0)});throw _0x574fe0;}}),_0x5776a7(_0x1eead3(0x27d)+_0x1eead3(0x147)+'y',async(_0x2ba9bd,_0x2cbd3b)=>{const _0x4572b7=_0x1eead3,_0x1f57dc=Date['now']();try{const _0x4a15b7=await readFile(_0x2cbd3b);return filesLogger?.[_0x4572b7(0x448)](_0x4572b7(0x37f)+'ile\x20read'+_0x4572b7(0x3d7)+'ed',{'path':toHomePath(_0x2cbd3b),'bytes':_0x4a15b7[_0x4572b7(0x195)+'th'],'durationMs':Date[_0x4572b7(0x2c8)]()-_0x1f57dc}),new Uint8Array(_0x4a15b7);}catch(_0xddff96){filesLogger?.[_0x4572b7(0x18e)](_0x4572b7(0x37f)+'ile\x20read'+'\x20failed',{'path':toHomePath(_0x2cbd3b),'durationMs':Date['now']()-_0x1f57dc,'error':summarizeError(_0xddff96)});throw _0xddff96;}}),_0x5776a7(_0x1eead3(0x3c4)+_0x1eead3(0x26e),async(_0x406ecc,_0x13b0ae={})=>{const _0x49dff8=_0x1eead3,_0x1ab93e=Date[_0x49dff8(0x2c8)]();return await writeFile(_0x13b0ae[_0x49dff8(0x4ad)],_0x13b0ae['content']??'',_0x49dff8(0x1a0)),filesLogger?.[_0x49dff8(0x448)]('file\x20wri'+_0x49dff8(0x3b8)+_0x49dff8(0x1eb),{'path':toHomePath(_0x13b0ae[_0x49dff8(0x4ad)]),'bytes':Buffer[_0x49dff8(0x195)+'th'](String(_0x13b0ae[_0x49dff8(0x1ee)]??'')),'durationMs':Date[_0x49dff8(0x2c8)]()-_0x1ab93e}),{'ok':!![]};}),_0x5776a7(_0x1eead3(0x3c4)+_0x1eead3(0x1b9)+'ry',async(_0x43f017,_0x4eb170={})=>{const _0x57380d=_0x1eead3,_0x4c1ba9=Date[_0x57380d(0x2c8)]();await writeFile(_0x4eb170[_0x57380d(0x4ad)],Buffer[_0x57380d(0x223)](_0x4eb170[_0x57380d(0x1ee)]??[]));const _0x119cea=await stat(_0x4eb170[_0x57380d(0x4ad)])[_0x57380d(0x317)](()=>null);return filesLogger?.[_0x57380d(0x448)](_0x57380d(0x37f)+_0x57380d(0x240)+_0x57380d(0x21c)+_0x57380d(0x414),{'path':toHomePath(_0x4eb170[_0x57380d(0x4ad)]),'bytes':_0x119cea?.[_0x57380d(0x4a9)]??0x0,'durationMs':Date[_0x57380d(0x2c8)]()-_0x4c1ba9}),{'ok':!![]};}),_0x5776a7(_0x1eead3(0x3a8)+_0x1eead3(0x4ee)+'e',async(_0x379420,_0x178709={})=>{const _0x1e006b=_0x1eead3,_0x67e5b2=await dialog[_0x1e006b(0x42d)+_0x1e006b(0x224)](BrowserWindow[_0x1e006b(0x382)+_0x1e006b(0x3c9)](_0x379420[_0x1e006b(0x15b)])??mainWindow,{'title':typeof _0x178709[_0x1e006b(0x447)]===_0x1e006b(0x40e)?_0x178709['title']:undefined,'properties':['openFile',..._0x178709['multiSel'+_0x1e006b(0x216)]?[_0x1e006b(0x38d)+'ections']:[]],'filters':Array[_0x1e006b(0x496)](_0x178709[_0x1e006b(0x43a)])?_0x178709[_0x1e006b(0x43a)]:undefined});return filesLogger?.[_0x1e006b(0x448)](_0x1e006b(0x422)+'ile\x20comp'+'leted',{'canceled':_0x67e5b2[_0x1e006b(0x37e)],'count':_0x67e5b2[_0x1e006b(0x27c)+'s'][_0x1e006b(0x407)],'paths':_0x67e5b2[_0x1e006b(0x27c)+'s'][_0x1e006b(0x1fd)](toHomePath)}),{'canceled':_0x67e5b2['canceled'],'paths':_0x67e5b2['filePath'+'s']};}),_0x5776a7(_0x1eead3(0x157)+'st-direc'+_0x1eead3(0x2c0),async(_0x36a357,_0x36c245={})=>{const _0x22f071=_0x1eead3,_0x38d4f4=resolve(String(_0x36c245[_0x22f071(0x4ad)]||'')),_0x47727b=_0x36c245[_0x22f071(0x45a)+'e']!==![],_0x3ccbc7=Array['isArray'](_0x36c245[_0x22f071(0x2a1)+'ns'])?_0x36c245[_0x22f071(0x2a1)+'ns'][_0x22f071(0x1fd)](_0x31bb97=>String(_0x31bb97)[_0x22f071(0x469)+_0x22f071(0x4a4)]()['replace'](/^\./,''))['filter'](Boolean):null,_0x2abcec=Number['isIntege'+'r'](_0x36c245[_0x22f071(0x2d8)+'es'])&&_0x36c245[_0x22f071(0x2d8)+'es']>0x0?_0x36c245[_0x22f071(0x2d8)+'es']:0xc350,_0x3cacf7=[];let _0x4c7a80=![];async function _0x29a9e1(_0x4e3102){const _0x4c94c4=_0x22f071;if(_0x4c7a80)return;let _0x373aae;try{_0x373aae=await readdir(_0x4e3102,{'withFileTypes':!![]});}catch{return;}for(const _0x584f1d of _0x373aae){if(_0x4c7a80)return;if(_0x584f1d[_0x4c94c4(0x454)][_0x4c94c4(0x4a2)+'th']('.'))continue;const _0x272f67=join(_0x4e3102,_0x584f1d['name']);if(_0x584f1d['isDirect'+_0x4c94c4(0x3f7)]()){if(_0x47727b)await _0x29a9e1(_0x272f67);continue;}if(!_0x584f1d[_0x4c94c4(0x3ab)]())continue;if(_0x3ccbc7){const _0x511327=_0x584f1d['name']['lastInde'+_0x4c94c4(0x2d4)]('.'),_0x54099c=_0x511327>=0x0?_0x584f1d[_0x4c94c4(0x454)][_0x4c94c4(0x347)](_0x511327+0x1)['toLowerC'+_0x4c94c4(0x4a4)]():'';if(!_0x3ccbc7[_0x4c94c4(0x257)](_0x54099c))continue;}if(_0x3cacf7[_0x4c94c4(0x407)]>=_0x2abcec){_0x4c7a80=!![];return;}_0x3cacf7[_0x4c94c4(0x2f1)]({'name':_0x584f1d[_0x4c94c4(0x454)],'path':_0x272f67});}}return await _0x29a9e1(_0x38d4f4),{'path':_0x38d4f4,'entries':_0x3cacf7,'truncated':_0x4c7a80};}),_0x5776a7(_0x1eead3(0x3a8)+_0x1eead3(0x34c)+_0x1eead3(0x1f1),async(_0x47c9fd,_0x2e38a5={})=>{const _0x3a9b99=_0x1eead3,_0x73a677=await dialog[_0x3a9b99(0x42d)+_0x3a9b99(0x224)](BrowserWindow[_0x3a9b99(0x382)+_0x3a9b99(0x3c9)](_0x47c9fd['sender'])??mainWindow,{'title':typeof _0x2e38a5['title']===_0x3a9b99(0x40e)?_0x2e38a5[_0x3a9b99(0x447)]:undefined,'properties':[_0x3a9b99(0x30f)+_0x3a9b99(0x4d5)]});return filesLogger?.[_0x3a9b99(0x448)](_0x3a9b99(0x375)+_0x3a9b99(0x1f6)+_0x3a9b99(0x3d7)+'ed',{'canceled':_0x73a677['canceled'],'count':_0x73a677[_0x3a9b99(0x27c)+'s']['length'],'paths':_0x73a677[_0x3a9b99(0x27c)+'s'][_0x3a9b99(0x1fd)](toHomePath)}),{'canceled':_0x73a677[_0x3a9b99(0x37e)],'paths':_0x73a677['filePath'+'s']};}),_0x5776a7(_0x1eead3(0x488)+'e:direct'+_0x1eead3(0x22d),()=>_0xab79f1()[_0x1eead3(0x488)+'e'][_0x1eead3(0x17d)+_0x1eead3(0x23a)]()),_0x5776a7(_0x1eead3(0x488)+_0x1eead3(0x275)+_0x1eead3(0x1f6),async()=>{const _0x214eff=_0x1eead3,_0x54f44c=await _0xab79f1()['workspac'+'e'][_0x214eff(0x17d)+_0x214eff(0x23a)]();return await shell['openPath'](_0x54f44c['path']),filesLogger?.[_0x214eff(0x448)](_0x214eff(0x488)+_0x214eff(0x321)+_0x214eff(0x3e4)+'ed',{'path':toHomePath(_0x54f44c['path'])}),{'ok':!![],'path':_0x54f44c[_0x214eff(0x4ad)]};}),_0x5776a7('workspac'+_0x1eead3(0x307)+'-context',()=>_0xab79f1()[_0x1eead3(0x488)+'e'][_0x1eead3(0x1ad)+'ntext']()),_0x5776a7(_0x1eead3(0x488)+'e:write-'+'shared-c'+_0x1eead3(0x399),(_0x1ddf97,_0x22684d)=>_0xab79f1()[_0x1eead3(0x488)+'e']['writeSha'+_0x1eead3(0x41d)+'xt'](_0x22684d)),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x4c2),(_0x36e29b,_0x1ea5fa)=>_0xab79f1()[_0x1eead3(0x2ea)]['rename'](_0x1ea5fa)),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x185),async(_0x59819f,_0x3fa80c={})=>{const _0x5d13df=_0x1eead3,_0x4c328e=String(_0x3fa80c[_0x5d13df(0x23c)+'ey']||_0x3fa80c[_0x5d13df(0x188)]||'')[_0x5d13df(0x36b)]();if(!_0x4c328e)throw new Error('sessionK'+'ey\x20is\x20re'+'quired');const _0x17ae3e=await ensureSessionSqliteStore()[_0x5d13df(0x43b)+'dSession'+_0x5d13df(0x4d6)](),_0x3282a2=await _0xab79f1()[_0x5d13df(0x2ea)][_0x5d13df(0x32e)+_0x5d13df(0x4d2)]([_0x4c328e,..._0x17ae3e['filter'](_0x1b2630=>_0x1b2630!==_0x4c328e)]);return _0x3282a2;}),_0x5776a7(_0x1eead3(0x2ea)+_0x1eead3(0x49d),async(_0x8a6709,_0x136c20={})=>{const _0x892f63=_0x1eead3,_0x4155a9=String(_0x136c20['sessionK'+'ey']||_0x136c20[_0x892f63(0x188)]||'')[_0x892f63(0x36b)]();if(!_0x4155a9)throw new Error(_0x892f63(0x23c)+_0x892f63(0x2d3)+_0x892f63(0x1d6));const _0x3f2167=await ensureSessionSqliteStore()['getPinne'+_0x892f63(0x28f)+'Keys']();return await _0xab79f1()[_0x892f63(0x2ea)][_0x892f63(0x32e)+'inned'](_0x3f2167['filter'](_0x4a9fdd=>_0x4a9fdd!==_0x4155a9));}),_0x5776a7('sessions'+_0x1eead3(0x238)+_0x1eead3(0x462),async(_0x5b2c8e,_0x1708f1={})=>{const _0x479441=_0x1eead3,_0x1cf8d3=Array['isArray'](_0x1708f1[_0x479441(0x403)])?_0x1708f1[_0x479441(0x403)]:_0x1708f1;return await _0xab79f1()[_0x479441(0x2ea)][_0x479441(0x32e)+'inned'](_0x1cf8d3);}),_0x5776a7(_0x1eead3(0x402)+_0x1eead3(0x31b),(_0x34ef8d,_0x29645e)=>_0xab79f1()[_0x1eead3(0x2d7)]['install'](_0x29645e)),_0x5776a7(_0x1eead3(0x138)+'t',(_0x31b006,_0x41b618)=>_0xab79f1()[_0x1eead3(0x2d6)]['list'](_0x41b618)),_0x5776a7(_0x1eead3(0x1e7)+'ate',(_0x5b2f76,_0x212fbf)=>_0xab79f1()[_0x1eead3(0x2d6)][_0x1eead3(0x343)](_0x212fbf)),_0x5776a7(_0x1eead3(0x3b7)+_0x1eead3(0x2d5),(_0x532f37,_0x56525f)=>_0xab79f1()[_0x1eead3(0x2d6)][_0x1eead3(0x46a)](_0x56525f)),_0x5776a7(_0x1eead3(0x467)+'ove',(_0xbf7cee,_0x1bf467)=>_0xab79f1()[_0x1eead3(0x2d6)]['remove'](_0x1bf467)),_0x5776a7('cron:run'+'-once',(_0x3712b6,_0x3a4e99)=>_0xab79f1()[_0x1eead3(0x2d6)]['runOnce'](_0x3a4e99)),_0x5776a7(_0x1eead3(0x309)+'s',(_0x19dc91,_0x4dd3d5)=>_0xab79f1()[_0x1eead3(0x2d6)][_0x1eead3(0x46d)](_0x4dd3d5)),_0x5776a7(_0x1eead3(0x48d)+_0x1eead3(0x3bd),async(_0x243864,_0x5e594f={})=>{const _0x590e22=_0x1eead3,_0x1cce23=configController[_0x590e22(0x4c4)+'onfigPat'+'h'](),_0x4ced22=JSON['parse'](await readFile(_0x1cce23,'utf8')),_0x2f23fa=_0x4ced22?.['models']?.['provider'+'s']&&typeof _0x4ced22['models']['provider'+'s']===_0x590e22(0x18c)?_0x4ced22[_0x590e22(0x4f8)][_0x590e22(0x4ac)+'s']:{},_0x2f7941=typeof _0x4ced22?.[_0x590e22(0x334)]?.[_0x590e22(0x4dd)]?.[_0x590e22(0x1ce)]?.['primary']===_0x590e22(0x40e)?_0x4ced22[_0x590e22(0x334)][_0x590e22(0x4dd)][_0x590e22(0x1ce)]['primary']:'',_0x5506ad=String(_0x5e594f['model']||_0x2f7941||'');if(!_0x5506ad[_0x590e22(0x257)]('/'))throw new Error(_0x590e22(0x1ec)+_0x590e22(0x2f2)+'\x20configu'+_0x590e22(0x33b)+'\x20a\x20provi'+'der/mode'+_0x590e22(0x3f0));const _0x1951ae=_0x5506ad[_0x590e22(0x4bf)]('/'),_0x30a5b1=_0x5506ad[_0x590e22(0x347)](0x0,_0x1951ae),_0x15ebd7=_0x5506ad[_0x590e22(0x347)](_0x1951ae+0x1),_0x52da1f=_0x2f23fa[_0x30a5b1];if(!_0x52da1f||typeof _0x52da1f!==_0x590e22(0x18c))throw new Error('provider'+'\x20not\x20con'+_0x590e22(0x2f9)+'\x20'+_0x30a5b1);const _0x3968d2=String(_0x52da1f[_0x590e22(0x34f)]||'https://'+_0x590e22(0x282)+'ai.com/v'+'1')['trim']()[_0x590e22(0x3b9)](/\/$/,''),_0x4b7124=await fetch(_0x3968d2+(_0x590e22(0x1cd)+_0x590e22(0x39d)+'s'),{'method':'POST','headers':{'content-type':'applicat'+'ion/json','Authorization':_0x590e22(0x325)+(_0x52da1f[_0x590e22(0x140)]||''),..._0x52da1f['headers']&&typeof _0x52da1f[_0x590e22(0x430)]==='object'?_0x52da1f['headers']:{}},'body':JSON[_0x590e22(0x17a)+'y']({'model':_0x15ebd7,'max_tokens':Number[_0x590e22(0x292)+'r'](_0x5e594f[_0x590e22(0x26b)+'s'])?_0x5e594f[_0x590e22(0x26b)+'s']:0x400,'temperature':typeof _0x5e594f[_0x590e22(0x311)+'ure']===_0x590e22(0x1d1)?_0x5e594f[_0x590e22(0x311)+_0x590e22(0x208)]:undefined,'messages':Array[_0x590e22(0x496)](_0x5e594f[_0x590e22(0x16a)])?_0x5e594f[_0x590e22(0x16a)]:[]}),'signal':AbortSignal[_0x590e22(0x166)](Number['isIntege'+'r'](_0x5e594f['timeoutM'+'s'])?_0x5e594f[_0x590e22(0x293)+'s']:0x1d4c0)});if(!_0x4b7124['ok']){const _0x1dd660=await _0x4b7124[_0x590e22(0x221)]();throw new Error('model\x20ht'+_0x590e22(0x36c)+_0x4b7124[_0x590e22(0x226)]+':\x20'+_0x1dd660['slice'](0x0,0x190));}const _0x44b0a1=_0x4b7124[_0x590e22(0x430)][_0x590e22(0x308)](_0x590e22(0x389)+'id'),_0xc32e9e=await _0x4b7124[_0x590e22(0x2eb)](),_0x47bbd5=_0xc32e9e?.[_0x590e22(0x319)]?.[0x0]?.[_0x590e22(0x2b6)]??{};if(_0x44b0a1){const _0x18b752=typeof _0x5e594f['title']===_0x590e22(0x40e)&&_0x5e594f[_0x590e22(0x447)][_0x590e22(0x36b)]()?_0x5e594f[_0x590e22(0x447)][_0x590e22(0x36b)]():Array[_0x590e22(0x496)](_0x5e594f[_0x590e22(0x16a)])?String([..._0x5e594f['messages']][_0x590e22(0x331)]()[_0x590e22(0x189)](_0x553a4f=>_0x553a4f?.[_0x590e22(0x303)]===_0x590e22(0x2bc))?.['content']||'')[_0x590e22(0x36b)]():'';_0x18b752&&Promise['resolve'](requestIdHooks?.[_0x590e22(0x1ae)+_0x590e22(0x11c)+_0x590e22(0x313)]?.({'requestId':_0x44b0a1,'title':_0x18b752,'source':_0x590e22(0x4ac)+_0x590e22(0x4a5)+'e','model':_0xc32e9e?.['model']||_0x15ebd7,'provider':_0x30a5b1,'timestamp':Date[_0x590e22(0x2c8)]()}))['catch'](_0x5be843=>{const _0xe54f6=_0x590e22;mainLogger?.[_0xe54f6(0x1db)]?.(_0xe54f6(0x41f)+'omplete\x20'+_0xe54f6(0x389)+_0xe54f6(0x12d)+'\x20event\x20f'+'ailed',{'error':_0x5be843?.[_0xe54f6(0x2b6)]||String(_0x5be843)});});}return{'content':extractModelMessageContent(_0x47bbd5[_0x590e22(0x1ee)]),'reasoning':typeof _0x47bbd5[_0x590e22(0x196)+_0x590e22(0x435)+'t']===_0x590e22(0x40e)?_0x47bbd5[_0x590e22(0x196)+_0x590e22(0x435)+'t']:'','model':_0xc32e9e?.[_0x590e22(0x1ce)]||_0x15ebd7};}),_0x5776a7(_0x1eead3(0x236)+_0x1eead3(0x33c),()=>_0xab79f1()[_0x1eead3(0x4f8)][_0x1eead3(0x3e2)]()),_0x5776a7(_0x1eead3(0x236)+'et-setti'+_0x1eead3(0x43f),(_0x4d5e95,_0x51c3ee)=>_0xab79f1()[_0x1eead3(0x4f8)]['setSetti'+_0x1eead3(0x43f)](_0x51c3ee)),_0x5776a7(_0x1eead3(0x236)+'et-selec'+_0x1eead3(0x259)+_0x1eead3(0x3c0),(_0x5b0f1c,_0x21c50a)=>_0xab79f1()[_0x1eead3(0x4f8)][_0x1eead3(0x184)+'tedModel'+_0x1eead3(0x351)+'re'](_0x21c50a)),_0x5776a7(_0x1eead3(0x236)+_0x1eead3(0x3e0)+_0x1eead3(0x36e),(_0x19727f,_0x1628e2)=>_0xab79f1()[_0x1eead3(0x4f8)]['setSelfO'+_0x1eead3(0x4db)+'odels'](_0x1628e2)),_0x5776a7('models:s'+_0x1eead3(0x3f9)+_0x1eead3(0x4cb),()=>_0xab79f1()[_0x1eead3(0x4f8)][_0x1eead3(0x49c)+_0x1eead3(0x1bf)]()),_0x5776a7('models:c'+'ustom-mo'+_0x1eead3(0x127),()=>_0xab79f1()[_0x1eead3(0x4f8)][_0x1eead3(0x20b)+'dels']()),_0x5776a7(_0x1eead3(0x133)+_0x1eead3(0x425)+_0x1eead3(0x348)+_0x1eead3(0x340),async()=>{const _0x3db034=_0x1eead3,_0x4215b0=await prepareRuntime(shellConfig,{'syncOnly':!![]});return await configController[_0x3db034(0x4ef)+_0x3db034(0x4fa)+'ns'](),{'ok':!![],'syncedAt':new Date()[_0x3db034(0x3de)+_0x3db034(0x2ae)](),'manifest':_0x4215b0,'status':await getRuntimeResourceStatus()};}),_0x5776a7(_0x1eead3(0x133)+_0x1eead3(0x3c3)+_0x1eead3(0x4ec),async()=>getRuntimeResourceStatus());}async function boot(){const _0x13efec=_0x209495;shellConfig=await loadShellConfig(resolveProjectRoot()),app[_0x13efec(0x408)](shellConfig[_0x13efec(0x2a7)+'ame']),configController=createConfigController(shellConfig),mainLogger=createShellLogger(configController[_0x13efec(0x39b)],_0x13efec(0x16b)),ipcLogger=createShellLogger(configController[_0x13efec(0x39b)],_0x13efec(0x1ba)),filesLogger=createShellLogger(configController[_0x13efec(0x39b)],_0x13efec(0x4ba)),rendererLogger=createShellLogger(configController[_0x13efec(0x39b)],_0x13efec(0x14b)),productRuntime=await loadProductRuntime();const _0x5de271=resolveWujieApiEndpoint();diagnosticsWriter=createDiagnosticsWriter({'logsDir':configController[_0x13efec(0x39b)][_0x13efec(0x19f)],'appContext':{'productName':shellConfig[_0x13efec(0x2a7)+_0x13efec(0x3af)],'appId':shellConfig[_0x13efec(0x4a7)],'appVersion':app[_0x13efec(0x172)+'on'](),'platform':process['platform'],'arch':process[_0x13efec(0x154)],..._0x5de271?{'apiEndpoint':_0x5de271}:{}}}),userEventWriter=createUserEventWriter({'logsDir':configController[_0x13efec(0x39b)][_0x13efec(0x19f)],'diagnosticsWriter':diagnosticsWriter});const _0x37e400=await loadCreateUpdateController({'logger':mainLogger});updateController=_0x37e400({'shellConfig':shellConfig,'appName':()=>app[_0x13efec(0x454)],'appVersion':()=>app[_0x13efec(0x172)+'on'](),'broadcast':broadcast,'logger':mainLogger,'prepareQuitAndInstall':async()=>{const _0xffd79d=_0x13efec;await stopGatewayBeforeQuit(_0xffd79d(0x20c)+_0xffd79d(0x234)+_0xffd79d(0x160));}}),updateController[_0x13efec(0x153)+'ze'](),registerProcessLogHooks(),registerProtocolHandlers(),installApplicationMenu(),mainLogger?.['info'](_0x13efec(0x46c)+_0x13efec(0x1e8)+_0x13efec(0x254)+'ed',{'appVersion':app[_0x13efec(0x172)+'on'](),'electronVersion':process[_0x13efec(0x2fa)][_0x13efec(0x46c)],'nodeVersion':process[_0x13efec(0x2fa)][_0x13efec(0x146)],'chromeVersion':process[_0x13efec(0x2fa)][_0x13efec(0x3d4)],'platform':process[_0x13efec(0x443)],'arch':process['arch'],'mode':getMode(),'projectRoot':shellConfig[_0x13efec(0x22f)+_0x13efec(0x326)],'configPath':shellConfig[_0x13efec(0x3a0)+'th'],'dataDir':shellConfig[_0x13efec(0x121)],'devToolsEnabled':isDevToolsEnabled(),'devToolsFlagPath':resolveDevToolsFlagPath(),'logsDir':configController[_0x13efec(0x39b)][_0x13efec(0x19f)],'rendererUrl':process.env.VITE_DEV_SERVER_URL||APP_RENDERER_ENTRY_URL}),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x13efec(0x172)+'on'](),'productRuntimeHooks':gatewayRuntimeHooks,'userEventWriter':userEventWriter,'sessionSqliteStore':ensureSessionSqliteStore()}),typeof productRuntime[_0x13efec(0x21d)+'roductCo'+_0x13efec(0x175)]==='function'&&await productRuntime[_0x13efec(0x21d)+_0x13efec(0x297)+'nfig']({'configController':configController,'mainLogger':mainLogger}),typeof productRuntime[_0x13efec(0x21d)+_0x13efec(0x1e0)+'ta']===_0x13efec(0x11f)?await productRuntime['migrateP'+_0x13efec(0x1e0)+'ta']({'configController':configController,'generatedFilesStore':ensureGeneratedFilesStore(),'mainLogger':mainLogger,'sessionSqliteStore':ensureSessionSqliteStore()}):await ensureGeneratedFilesStore()[_0x13efec(0x398)+_0x13efec(0x47d)+'d'](),attachGatewayBroadcastHandlers(gatewayController),ensureSessionDataService(),await installIpcHandlers(),ipcHandlersInstalled=!![],installAppRendererProtocolHandler(),installClawspaceProtocolHandler(),registerShellShortcuts(),await ensureMainWindow(),await gatewayController[_0x13efec(0x48b)](),updateController[_0x13efec(0x2f6)+'kgroundC'+_0x13efec(0x46f)](),mainLogger?.[_0x13efec(0x448)](_0x13efec(0x46c)+_0x13efec(0x1e8)+'ot\x20compl'+_0x13efec(0x1eb)),updateController['recordBo'+_0x13efec(0x21f)+'nstall']?.();}function registerProcessLogHooks(){const _0x3b52a5=_0x209495;if(registerProcessLogHooks['register'+'ed'])return;registerProcessLogHooks[_0x3b52a5(0x4e2)+'ed']=!![],process['on'](_0x3b52a5(0x446)+'Exceptio'+'n',_0x11854f=>{const _0x5f59e2=_0x3b52a5;mainLogger?.[_0x5f59e2(0x18e)](_0x5f59e2(0x446)+'\x20excepti'+'on',summarizeError(_0x11854f));}),process['on']('unhandle'+_0x3b52a5(0x378)+'on',_0xfe1a03=>{const _0xe6960d=_0x3b52a5;mainLogger?.['error'](_0xe6960d(0x262)+_0xe6960d(0x24a)+_0xe6960d(0x4f6),summarizeError(_0xfe1a03));}),app['on'](_0x3b52a5(0x333)+_0x3b52a5(0x287)+_0x3b52a5(0x3e9),(_0x10e0b6,_0x3991cf,_0x4f6c45)=>{const _0x56942b=_0x3b52a5;mainLogger?.[_0x56942b(0x18e)]('renderer'+'\x20process'+'\x20gone',{'url':_0x3991cf[_0x56942b(0x2a9)](),'details':_0x4f6c45});}),app['on'](_0x3b52a5(0x230)+_0x3b52a5(0x33f)+'ne',(_0x42aae4,_0x32459d)=>{const _0x27809d=_0x3b52a5;mainLogger?.[_0x27809d(0x18e)](_0x27809d(0x2bf)+_0x27809d(0x2a4)+'ne',{'details':_0x32459d});});}async function stopGatewayBeforeQuit(_0x332ed8){const _0x183cba=_0x209495;if(!gatewayController)return;const _0x49a27f=gatewayController,_0x5dd76c=Date[_0x183cba(0x2c8)]();mainLogger?.[_0x183cba(0x448)](_0x332ed8+(_0x183cba(0x250)+_0x183cba(0x2d2)+'ay'),{'event':_0x332ed8===_0x183cba(0x20c)+_0x183cba(0x234)+_0x183cba(0x160)?_0x183cba(0x491)+_0x183cba(0x478)+_0x183cba(0x173)+'t':undefined}),await _0x49a27f['stop'](),gatewayController===_0x49a27f&&(gatewayController=null),mainLogger?.[_0x183cba(0x448)](_0x332ed8+(_0x183cba(0x4df)+'y\x20stoppe'+'d'),{'event':_0x332ed8==='before\x20i'+_0x183cba(0x234)+_0x183cba(0x160)?_0x183cba(0x491)+_0x183cba(0x478)+_0x183cba(0x4f2):undefined,'elapsedMs':Date[_0x183cba(0x2c8)]()-_0x5dd76c});}app['on'](_0x209495(0x394)+_0x209495(0x1a2)+'d',()=>{const _0x29932b=_0x209495;if(process[_0x29932b(0x443)]!==_0x29932b(0x384))app[_0x29932b(0x318)]();}),app['on']('open-url',(_0x3e4b67,_0x2c6686)=>{const _0x14e5ac=_0x209495;_0x3e4b67['preventD'+_0x14e5ac(0x14f)](),mainLogger?.['warn']('protocol'+_0x14e5ac(0x1c3)+'l\x20event',{'url':summarizeProtocolUrl(_0x2c6686),'hasShellConfig':Boolean(shellConfig)}),dispatchProtocolUrl(_0x2c6686);});const gotSingleInstanceLock=app[_0x209495(0x34b)+_0x209495(0x29b)+_0x209495(0x258)+'k']();!gotSingleInstanceLock?app[_0x209495(0x318)]():app['on']('second-i'+_0x209495(0x2b1),(_0x58aafe,_0x17187c)=>{const _0x4f9702=_0x209495,_0x2259ae=extractProtocolUrlFromArgs(_0x17187c);mainLogger?.[_0x4f9702(0x1db)](_0x4f9702(0x3cc)+'nstance\x20'+_0x4f9702(0x377),{'argc':Array[_0x4f9702(0x496)](_0x17187c)?_0x17187c[_0x4f9702(0x407)]:0x0,'hasShellConfig':Boolean(shellConfig),'hasProtocolUrl':Boolean(_0x2259ae),'protocolUrl':_0x2259ae?summarizeProtocolUrl(_0x2259ae):undefined});if(!resolveProtocolScheme()){pendingProtocolArgs=_0x17187c;return;}if(_0x2259ae){dispatchProtocolUrl(_0x2259ae);return;}const _0x5705bd=getUsableMainWindow();if(_0x5705bd){if(_0x5705bd[_0x4f9702(0x3bf)+_0x4f9702(0x2da)]())_0x5705bd[_0x4f9702(0x429)]();_0x5705bd[_0x4f9702(0x1a9)](),_0x5705bd[_0x4f9702(0x3d5)]();}});app['on'](_0x209495(0x360),async()=>{const _0x3bbd8f=_0x209495;if(isQuitting){app[_0x3bbd8f(0x318)]();return;}updateController?.[_0x3bbd8f(0x1f2)+_0x3bbd8f(0x237)+_0x3bbd8f(0x463)]('app_acti'+_0x3bbd8f(0x25e)),BrowserWindow[_0x3bbd8f(0x1cf)+_0x3bbd8f(0x3b5)]()[_0x3bbd8f(0x407)]===0x0&&shellConfig&&await ensureMainWindow();}),app['on'](_0x209495(0x418)+_0x209495(0x214),_0x34f4a8=>{const _0xc6529=_0x209495;isQuitting=!![],updateController?.[_0xc6529(0x44c)+_0xc6529(0x3ed)](),terminalManager?.[_0xc6529(0x452)](),terminalManager=null,productRuntimeHooks?.[_0xc6529(0x452)]?.();for(const _0x510910 of Object[_0xc6529(0x403)](productRuntimeHooks))delete productRuntimeHooks[_0x510910];requestIdHooks?.[_0xc6529(0x452)]?.();for(const _0x559fc1 of Object[_0xc6529(0x403)](requestIdHooks))delete requestIdHooks[_0x559fc1];if(updateController?.[_0xc6529(0x35e)+_0xc6529(0x47f)+'te']?.()){mainLogger?.[_0xc6529(0x448)](_0xc6529(0x40b)+_0xc6529(0x442)+_0xc6529(0x4e1)+_0xc6529(0x45f)+'rogress,'+_0xc6529(0x18b)+_0xc6529(0x4d1)+_0xc6529(0x2a2)+_0xc6529(0x21a));return;}if(!gatewayController)return;_0x34f4a8[_0xc6529(0x136)+'efault'](),void stopGatewayBeforeQuit(_0xc6529(0x40b)+'uit')[_0xc6529(0x111)](()=>{const _0x53ba6b=_0xc6529;app[_0x53ba6b(0x318)]();});}),app['on'](_0x209495(0x206)+'t',()=>{const _0x480676=_0x209495;globalShortcut[_0x480676(0x1b6)+'er'](DEVTOOLS_ACCELERATOR);}),app[_0x209495(0x202)+'y']()['then'](boot)[_0x209495(0x317)](_0x46c488=>{const _0x105feb=_0x209495;bootError=_0x46c488 instanceof Error?_0x46c488[_0x105feb(0x2b6)]:String(_0x46c488),mainLogger?.[_0x105feb(0x18e)](_0x105feb(0x46c)+_0x105feb(0x1e8)+'ot\x20faile'+'d',summarizeError(_0x46c488)),console[_0x105feb(0x18e)](_0x105feb(0x256)+_0x105feb(0x45e)+_0x105feb(0x252)+_0x105feb(0x1cb)+_0x105feb(0x211)+'in',_0x46c488);});
1
+ const _0x5d452e=_0x2082;(function(_0x3a5e14,_0x4505df){const _0x512458=_0x2082,_0x5eaccf=_0x3a5e14();while(!![]){try{const _0x51272f=-parseInt(_0x512458(0x1a0))/0x1*(-parseInt(_0x512458(0x4c9))/0x2)+parseInt(_0x512458(0x5a8))/0x3+-parseInt(_0x512458(0x4de))/0x4+parseInt(_0x512458(0x531))/0x5*(-parseInt(_0x512458(0x2a7))/0x6)+-parseInt(_0x512458(0x377))/0x7*(parseInt(_0x512458(0x237))/0x8)+-parseInt(_0x512458(0x238))/0x9*(parseInt(_0x512458(0x41c))/0xa)+parseInt(_0x512458(0x3cc))/0xb;if(_0x51272f===_0x4505df)break;else _0x5eaccf['push'](_0x5eaccf['shift']());}catch(_0x276d30){_0x5eaccf['push'](_0x5eaccf['shift']());}}}(_0x3973,0xe386c));import _0xdbe985 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{formatLogLine}from'@wujie-shell/logger';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{createSessionDataService}from'../sessions/session-data-service.mjs';import{createSessionSqliteStore}from'../sessions/session-sqlite-store.mjs';import{createTerminalManager}from'../terminal/manager.mjs';import{createShellLogger,exportLogsArchive,getShellLoggerLevel,setShellLoggerLevel,summarizeError,summarizePayload,summarizeText,toHomePath}from'../common/logging.mjs';function _0x3973(){const _0x23ff45=['.m4a','ontents','userData','all','eted','ile\x20read','top_star','.js','ory','finally','enable',':gateway','win32','send','Level','\x20failed','getPath','length,\x20','image/gi','.woff','Invalid\x20','ready\x20ex','.mov','shouldLo','register','-questio','copy','s-maximi','dRejecti','d\x20is\x20req','no\x20defau','epositor','h\x0aexec\x20\x22','ng;\x20recr','omplete','Exceptio','Update','+Shift+I','EventCou','在电脑中显示','list','min','captureI','tProtoco','snapshot','logs:set','cle','e:open-d','l\x20reques',':runtime','disable','ot\x20faile','main','g\x20level\x20','getProce','utf8','ndows','bin','initiali','branch','wechat','\x20request','tabs-com','ocolClie','stion','markConf','feishu','app.asar','les:dele','2gmbfoi','checkFor','\x20rendere','show',':summary','#0000000','isFinite','models\x20c','ll-close','manifest','ai.com/v','ig\x20is\x20no','about','\x20entry\x20f','lConnect','nabled','object','\x20url\x20flu','.css','update','files:wr','5787688evpWCm','logs\x20exp','write','\x20log','runtimeR','nfo','inimize','ctory','key','ocol-url','ngs','-token','gMainFra','bject','elSessio','e\x20comple','select\x20d','\x20pending','will-qui','.bmp','ded','restore','resize','getVersi','reverse','igSnapsh','.mjs','ateway_s','workspac','image/jp','skills:s','path\x20is\x20','iled\x20to\x20','map','te:get-s','push','nstance','t-stream','defaults','agent','ignore','unmaximi','timeoutM','i-window','\x20allowin','video/mp','nstance\x20',':\x20stoppi','ile\x20comp','tewayEve','pluginId','delete','switchBr',':save-kd','HEAD','sessionK','ryPath','getRecen','getAppPa','\x20url\x20dis','CommandO','prod','parse','window\x20a','led','ion/vnd.','toISOStr','now','reposito','maxEntri','er\x20missi','shuDocCl','deleteCu','te:downl','sPrivile','s:hide','logLevel','restart','urnSnaps','max','chat','cron:cre','leted','2594030fgUDdF','services','yInfo','tLogs','isArray','iff','preload.','figs','gatewayT','\x20failed:','\x20open\x20bl','closed','index.ht','y\x20stoppe','hell]\x20fa','aries','startsWi','cron:upd','\x20open-ur','updated','est_fail','pendingU','onfig','name','tateDir','one','file:','mChannel','binary\x20f','Context','level','close','ove','ingleIns','.jpeg','ame','les:hide','selectAl','shuRegis','warn','d\x20of\x20min','window_f','subscrib','.aac',':answer-','_respons','m-channe','skills','reload','app:prot','listImCh','ocess\x20go','text/htm','.flag','ionUsage','files','figured:','hatChann','matroska','add','code','diagnost','t\x20initia','onReques','preventD','-request','rerReady','nimize\x20t','size','open\x20ext','started','ion','normaliz',':agent-m','ists','tIdTitle','peratedM','searchPa','lTs','resolveS','-refresh','ncent-ex','em:resta','origin','tChannel','image/we','com-chan','uit','gateway-','before\x20i','dAt','equested','showOpen','api.open','agentId','ith-sess','xOf','audio/mp','\x20not\x20con','ad-binar','Ready','image/sv','minimize','lect-fil','edWindow','logs\x20dir','-data','readConf','ssionKey','node:fs/','pull','wujiecla','tage-fil','d-state','ector\x20se','bot-chan','runtime:','t:\x20','ired','515874ybgryw','trim','[REDACTE','review:s','ocsCliCo','Terminal',':open-cl','agents','ate','mand','文件不存在,无法','kgroundC','eating','ces.json','.webp','before-q',':save-we','.mp3','trationS','has','.htm','ntime','ernal\x20ur','loadURL','audio/wa',':artifac','isDefaul','ryInfo','shell-ru','.ttf','chrome','535421jfbJDw','ItemSett','models:c','-shortcu','dev','ed\x20windo','platform','n-direct','keyDown','elected-','sessions','content-','stomMode','open-url','token','nnectSes','folder',':save-di','choices','review:g','set=utf-','et-self-','ModelId','changeKi','est\x20fail','window:i','info','-context','ions-lis','way\x20is\x20n','dels','app:syst','main-fra','limit','revertFi','rnal','window:m','enClawCo','Custom','getRevis','zed','ionEvent','provider','recursiv','.png','isFile','\x20is\x20requ','ion/octe','ocus','ishu-cha','clawspac','chat-str','yed','loading-','cutoffRo','storyLoa','roundCol','-not-rea','eam-even','ot\x20compl','app\x20url','start','file\x20wri','-port','nel','toWeb','app:star','et-setti','complete','remove','D,\x20OPTIO','hide','uri','shell\x20lo',':events','filters','acts','ectSessi','cancelFe','cutoffTe','user','.ico','GET,\x20HEA','nts','meta','\x20a\x20provi','atus','st-direc','l\x20prepar','et-repos','customMo','file\x20rea','updateOp','startKdo','writeSha','imizing','ngtalk-d','dled-res','onChatHi','payload','url','g_conten','clearPen','enClawCh',':snapsho','ncident',':save-qq','forceRel',':choose-','window','debug','controll','entDocsC','multiSel','BodyRead','diff','product-','feishu_d','d\x20reject','rogress,','saveDing','it-pull','\x20metric\x20','SchemesA','entModel','app:file','e\x20first.','required','input','indexOf','lawMcpSe','-status-','ipc\x20requ','agent-','type','ion-menu','ase','-mail','failed','CliConne','getAllWi','projectR','te:quit-','orConfig','tf-8','icon','annelCon','ap:entry','models','tml','unknown','8svxtqi','18jUIgul','in;\x20char','ot\x20initi','exec','kdown;\x20c','config:r','force','enClawSk','cron:rem','shared-c','video/we','configPa','ure','nstallin','ensureIn','edCount','files:li','patched','ctStatus','OPTIONS','reasonin','pdated','missing-','cron:run','product','config:c','.mkv','dow\x20load','ccept-ra','-status','saveQqMa','ndow-pre','ens','-by-sess','it-switc','extensio','deletedS','role','.\x20Run\x20wu','n\x20failed','getArtif','getKdocs','uired',':revisio','iConnect','meFilter','d-local','entries','parseInt','fromIpc','node','terminal','dataDir','runtimeI','ype','before\x20q','requestB','-session','audio/fl','ls:delet','quitAndI','ishuDocC','logs:wri','config:i','focus','ued\x20for\x20','.eot','buildFro','ite-bina','create','help','-state-c','w\x20instea','deleteFi','Config','timeout','Event','ile\x20writ','models:s','lConfig','contextW','app:upda','\x20before\x20','skills:i','it-fetch','ocs','cron:log','files:re','deleteOp','function','auth_cod','targetDi','tion\x20fai','openDevT','icktime','catch','quired','uest-age','tatus','ocked','dist','rated-fi','ory\x20open','agent\x20id','setLogin','index.mj','app:info','onnector','tup:set','l;\x20chars','w\x20prepar','18RBItkG',':save','ncy','fetch','-level','headers','s-snapsh','rn、info\x20','sidebar','cwd','Updates','length','\x20configu','setAppli','startFei','/index.h','path','chat:str','set','upsert','pServer','apiKey','.wasm','message','torConfi','getOpaci','text/mar','illEntry','agents:d','-exit','argv','no-store','app:log-','talkDocC','\x20main\x20bo','re\x20confi','setPendi','saveQqbo','onnectSt','openDire','download','e:direct','detach','setRende','director','ng\x20gatew','wujie-sh','g\x20native','orted','execPath','reate','lawSkill','setAsDef','tanceLoc','applicat',':message','bytes\x20*/','sourceSe','agent-ev','unhandle','e\x20failed','getFocus','ell\x20conf','text/css',':run-onc',':set-clo','customNa','ProductR','senderFr','startWec','napshot','INFO','ssion','resource','stration','readSess','image/pn','producti','cCliConn','files:se','r\x20ready','cron:lis','tabs:nav','assign','无法解析本地文件','nt-state','tup:get','ell:even','saveNetE','chatChan','succeede','sourcePa','/chat/co','nConfig','windowMe','restore\x20','parentSe','plugins','ctivatio','pened','ssion:\x20','l\x20first','ontext','getFeish',':downloa','ad_suppr','resolve','ion/json','update_g','devtools','nstall',';\x20charse','ges','temperat',':cancel','review:d','或\x20debug','replace',':process','meState','nput-eve','[wujie-s','rocess-g','text/pla','split','quit','o\x20hide','sync-bun','indowTok',':usage','elete','-ready','ndlers','isMinimi','authCode','sharedCo','openclaw','event','image/x-','before-i','promises','getURL','huDocCon','lawChann','rControl','lawPlugi','isLoadin','ort','setVibra','\x20found:\x20','ted','getSumma','et-selec','ued\x20befo','ections','e-branch','nectorCo','byteLeng','oad','href','setOpenC','isPackag','e\x20direct','kdocs','fromWebC','getStatu','includes','range,\x20c','eam','writeEve','test','then','evert-fi','video/qu',':unpin','ishu-doc','window:o','saveKdoc','ion/wasm','active','ackgroun','electron','versions','sender','Entry','s:upsert','deleteIm','agents:u','agent\x20al','aseMailC','keepUnti','id\x20title','window-a','-life-cy','image/bm','te:check','dispose','temp','tate','anch','irectory','omModel','paths','utf-8','ntext','migrateP','ell\x20boot','font/wof','256431jYGdxu','Unsuppor','returnVa','rename','n\x20loaded','omplete\x20','isInstal',':create','gatewayP','closeToT','darwin','setSelfO','\x20complet','plugins:','canceled','hell:eve','igate','s:delete','groups',':save-fe','artifact','request-','ell\x20gate','model','keys','ources','openFile','video/x-','baseUrl','rayOnClo','t-messag','enClawMc','efault','script;\x20','abort','ask-user','hell:ipc','isDirect','pathname','answerAs','nectSess','fig','\x20minimiz','ationSta','th\x20is\x20re','get-conf','getState','IPC\x20requ','llscreen','it-push','shing','itialize','dingUrl','uRegistr','saveTenc','\x20to\x20load','les:reve','ilConnec','ist',':save-te','top_done','showSave','isIntege','.txt','toLowerC','maxToken','productN','sConnect','.ogg','-restart','igWriteH',':save-ne','nges','Session','ls:list','ate\x20inst','app-acti','ileName','changed','avatar','pdate','cationMe','separato','inactive','les:upse','47050894WFGEDj','t=utf-8','wBin','eated','filePath','title','ey\x20is\x20re','saveFeis','Suppress','et=utf-8','essed','saveWeco','msvideo','createBr',':resize','bytes','\x20url\x20rec','it-unsta','g\x20ready','ools','child-pr','\x20gone','webConte','mpletion','handle','ap:get',':choose','\x20url\x20que','logsDir','e:shared','logs:ope','ternally','inned','ite','cancelKd','isDestro','charset=','unhide','record','ectory\x20o','FeishuDo','redConte','.webm','get','pop','tory','dCheck','resh-age','tabs:req','rver','runOnce','primary','setOpaci','ChannelC','match','runtime\x20','ettings','itory','syncRunt','whenRead','registra','Dialog','ted\x20conn','app:tray','stop','les:list','method','h-branch','creating','slice','ings','range','pper\x20not','lastInde','error','Not\x20foun','isabled','ionEntry','product\x20','mized\x20ma','5064060wGxhMW','shellLog','paste','tus','\x20process','lt\x20model','string','filter','dated','.otf','captureT','g+xml','://','second-i','_session','find','writeCon','tabs-age','messages','Keys','#f8fafc','model\x20ht','\x20excepti','plugin\x20d','hostname','openAtLo','setRepos','listSumm','.gif','startBac','channelI','te\x20compl','jie-shel','ngUrl','ipc_requ','cron','d\x20comple','app:gene','_body_re','select\x20f','readCurr','content','appId','hiding\x20m',':pin','l\x20event','context','hiddenIn','it-creat','isVisibl','nfig','selected','sses','onfigPat','.jpg','mac-mini','ion/java','mport-zi','ishuRegi','oken','getMessa','font/otf','Version','protocol','entExmai',':\x20gatewa','writeTex','audio/og','update-c','-weixin','it-commi','renderer','logs:exp','number','status','getLogin','.html','listBySe','getPinne','uncaught','setSetti','logs:rea','oot','roductDa','it-stage','alized','.flac','vate','ms-fonto','ing','untimeHa','y-info','tedModel','hidden','ead','harset=u','sPath','session\x20',':get-clo','odels','report-r','window:t','elConfig','plugin\x20c'];_0x3973=function(){return _0x23ff45;};return _0x3973();}import{createDiagnosticsWriter,diagnosticEventFromError}from'../common/diagnostics.mjs';import{setRuntimeLoggerLevel}from'../common/runtime-logger.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{registerRequestIdHandlers}from'../request-id/handlers.mjs';import{createReviewController}from'../review/controller.mjs';import{loadRuntimeInfo,prepareRuntime,resolveRuntimeRoot,getRuntimeSpawnContext,resolveRuntimeLarkCliCommand,runClawOnce}from'../runtime/index.mjs';import{loadCreateUpdateController}from'../updates/loader.mjs';import{createProtocolUrlState}from'./protocol-url-state.mjs';import{configureElectronInstance}from'./instance-identity.mjs';const __dirname=dirname(fileURLToPath(import.meta.url)),preloadPath=join(__dirname,_0x5d452e(0x537)+'mjs'),{app,BrowserWindow,Menu,clipboard,dialog,globalShortcut,ipcMain,protocol,shell}=_0xdbe985,DEVTOOLS_ACCELERATOR=_0x5d452e(0x51a)+_0x5d452e(0x337)+_0x5d452e(0x4a9),APP_RENDERER_PROTOCOL_SCHEME='app',APP_RENDERER_PROTOCOL_HOST='-',APP_RENDERER_ENTRY_URL=APP_RENDERER_PROTOCOL_SCHEME+_0x5d452e(0x428)+APP_RENDERER_PROTOCOL_HOST+(_0x5d452e(0x2b6)+'tml'),CLAWSPACE_PROTOCOL_SCHEME='clawspac'+'e',DEBUG_STDOUT=process.env.WUJIE_SHELL_DEBUG==='1'||process.env.VITE_DEV_SERVER_URL||process.env.NODE_ENV!==_0x5d452e(0x2f4)+'on',IPC_SLOW_REQUEST_THRESHOLD_MS=0x1f4,SHELL_LOG_LEVELS=new Set([_0x5d452e(0x416),_0x5d452e(0x558),_0x5d452e(0x1ba),'debug']),LOCAL_FILE_MIME_TYPES=new Map([[_0x5d452e(0x468),_0x5d452e(0x565)+_0x5d452e(0x2a5)+_0x5d452e(0x3d5)],[_0x5d452e(0x195),_0x5d452e(0x565)+_0x5d452e(0x2a5)+_0x5d452e(0x3d5)],[_0x5d452e(0x3b6),'text/pla'+_0x5d452e(0x239)+_0x5d452e(0x1b4)+'8'],['.md',_0x5d452e(0x2c1)+_0x5d452e(0x23c)+_0x5d452e(0x47b)+_0x5d452e(0x230)],[_0x5d452e(0x48b),_0x5d452e(0x2dd)+_0x5d452e(0x454)+'script;\x20'+_0x5d452e(0x3f0)+'utf-8'],[_0x5d452e(0x4f8),_0x5d452e(0x2dd)+_0x5d452e(0x454)+_0x5d452e(0x398)+_0x5d452e(0x3f0)+_0x5d452e(0x372)],[_0x5d452e(0x4db),_0x5d452e(0x2e6)+_0x5d452e(0x316)+_0x5d452e(0x3cd)],['.json',_0x5d452e(0x2dd)+_0x5d452e(0x312)+_0x5d452e(0x316)+_0x5d452e(0x3cd)],['.map',_0x5d452e(0x2dd)+_0x5d452e(0x312)+_0x5d452e(0x316)+_0x5d452e(0x3cd)],[_0x5d452e(0x452),_0x5d452e(0x4fb)+'eg'],[_0x5d452e(0x553),_0x5d452e(0x4fb)+'eg'],[_0x5d452e(0x1cc),_0x5d452e(0x2f3)+'g'],[_0x5d452e(0x438),_0x5d452e(0x496)+'f'],[_0x5d452e(0x4f1),_0x5d452e(0x369)+'p'],['.svg',_0x5d452e(0x596)+_0x5d452e(0x427)],[_0x5d452e(0x18f),_0x5d452e(0x586)+'bp'],[_0x5d452e(0x1f1),_0x5d452e(0x331)+_0x5d452e(0x231)],['.mp4',_0x5d452e(0x50b)+'4'],[_0x5d452e(0x49a),_0x5d452e(0x354)+_0x5d452e(0x296)],['.avi',_0x5d452e(0x392)+_0x5d452e(0x3d8)],[_0x5d452e(0x252),'video/x-'+_0x5d452e(0x56b)],[_0x5d452e(0x3f6),_0x5d452e(0x242)+'bm'],[_0x5d452e(0x192),_0x5d452e(0x592)+'eg'],['.wav',_0x5d452e(0x199)+'v'],[_0x5d452e(0x484),_0x5d452e(0x592)+'4'],[_0x5d452e(0x55c),'audio/aa'+'c'],[_0x5d452e(0x3bb),_0x5d452e(0x45f)+'g'],[_0x5d452e(0x472),_0x5d452e(0x272)+'ac'],[_0x5d452e(0x497),_0x5d452e(0x376)+'f'],['.woff2','font/wof'+'f2'],[_0x5d452e(0x19e),'font/ttf'],[_0x5d452e(0x425),_0x5d452e(0x459)],[_0x5d452e(0x27a),_0x5d452e(0x2dd)+_0x5d452e(0x51f)+_0x5d452e(0x474)+_0x5d452e(0x4eb)],[_0x5d452e(0x2bd),_0x5d452e(0x2dd)+_0x5d452e(0x359)]]);protocol['register'+_0x5d452e(0x21b)+_0x5d452e(0x528)+'ged']([{'scheme':APP_RENDERER_PROTOCOL_SCHEME,'privileges':{'secure':!![],'standard':!![],'supportFetchAPI':!![],'corsEnabled':!![]}},{'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={},requestIdHooks={},gatewayRuntimeHooks={},sessionSqliteStore=null,sessionDataService=null,diagnosticsWriter=null,userEventWriter=null,isQuitting=![],updateController=null,pendingProtocolArgs=null;const protocolUrlState=createProtocolUrlState();let createWindowPromise=null,ipcHandlersInstalled=![];const macMinimizeToHideWindows=new WeakSet(),macMinimizeHidePromises=new WeakMap(),rendererSessionMetrics={'inactiveEventCount':0x0,'inactiveBodyReadSuppressedCount':0x0},RENDERER_SESSION_METRIC_LOG_INTERVAL=0x19;function isProductionMode(){const _0x46c7d1=_0x5d452e;return process.env.NODE_ENV===_0x46c7d1(0x2f4)+'on';}function resolveDevToolsFlagPath(){const _0x874352=_0x5d452e;return shellConfig?.[_0x874352(0x26c)]?join(shellConfig[_0x874352(0x26c)],_0x874352(0x314)+_0x874352(0x566)):'';}function isDevToolsEnabled(){if(!isProductionMode())return!![];const _0x3690d2=resolveDevToolsFlagPath();return Boolean(_0x3690d2)&&existsSync(_0x3690d2);}function attachGatewayBroadcastHandlers(_0x31d6ba){const _0x69b42a=_0x5d452e;for(const _0x5b5055 of[_0x69b42a(0x589)+'status',_0x69b42a(0x589)+'log',_0x69b42a(0x1d3)+_0x69b42a(0x1da)+'t',_0x69b42a(0x2e1)+'ent','agents-u'+_0x69b42a(0x24d),_0x69b42a(0x39a)+_0x69b42a(0x49d)+'n']){_0x31d6ba['on'](_0x5b5055,_0x40b7b2=>broadcast(_0x5b5055,_0x40b7b2));}}function ensureSessionSqliteStore(){const _0x16533c=_0x5d452e;if(sessionSqliteStore)return sessionSqliteStore;if(!configController)throw new Error(_0x16533c(0x2d5)+_0x16533c(0x2e5)+_0x16533c(0x4d4)+'t\x20initia'+'lized');return sessionSqliteStore=createSessionSqliteStore({'stateDir':configController['resolveS'+_0x16533c(0x549)]()}),sessionSqliteStore;}function ensureSessionDataService(){const _0x1e4ee6=_0x5d452e;if(sessionDataService)return sessionDataService['attachGa'+'tewayEve'+_0x1e4ee6(0x1f3)]?.(gatewayController),sessionDataService;if(!configController)throw new Error(_0x1e4ee6(0x2d5)+_0x1e4ee6(0x2e5)+_0x1e4ee6(0x4d4)+_0x1e4ee6(0x56f)+'lized');return sessionDataService=createSessionDataService({'stateDir':configController[_0x1e4ee6(0x580)+_0x1e4ee6(0x549)](),'sessionSqliteStore':ensureSessionSqliteStore(),'gatewayController':gatewayController,'broadcast':broadcast,'logger':mainLogger}),sessionDataService[_0x1e4ee6(0x55b)+'eRuntime'+'State']?.(_0x8c32fd=>{const _0x5bc130=_0x1e4ee6;broadcast('sessions'+_0x5bc130(0x4b5)+_0x5bc130(0x27f)+'hanged',_0x8c32fd);}),sessionDataService['attachGa'+_0x1e4ee6(0x50f)+_0x1e4ee6(0x1f3)]?.(),sessionDataService;}function updateRendererSessionMetrics(_0x2d149d){const _0x1b6bd0=_0x5d452e;if(!_0x2d149d||typeof _0x2d149d!=='object')return;if(_0x2d149d[_0x1b6bd0(0x330)]!=='inactive'+_0x1b6bd0(0x42a)+_0x1b6bd0(0x442)+_0x1b6bd0(0x310)+'essed')return;const _0x53a214=_0x2d149d[_0x1b6bd0(0x1f4)]&&typeof _0x2d149d['meta']===_0x1b6bd0(0x4d9)?_0x2d149d[_0x1b6bd0(0x1f4)]:{},_0x3189b5=Number(_0x53a214['count']);if(!Number['isFinite'](_0x3189b5)||_0x3189b5<=rendererSessionMetrics[_0x1b6bd0(0x3ca)+_0x1b6bd0(0x212)+_0x1b6bd0(0x3d4)+_0x1b6bd0(0x247)])return;rendererSessionMetrics['inactive'+_0x1b6bd0(0x212)+'Suppress'+_0x1b6bd0(0x247)]=_0x3189b5,rendererSessionMetrics[_0x1b6bd0(0x3ca)+_0x1b6bd0(0x4aa)+'nt']=Math[_0x1b6bd0(0x52d)](rendererSessionMetrics[_0x1b6bd0(0x3ca)+_0x1b6bd0(0x4aa)+'nt'],_0x3189b5);if(_0x3189b5!==0x1&&_0x3189b5%RENDERER_SESSION_METRIC_LOG_INTERVAL!==0x0)return;mainLogger?.[_0x1b6bd0(0x1ba)]?.(_0x1b6bd0(0x47d)+'renderer'+_0x1b6bd0(0x21a)+_0x1b6bd0(0x544),{'metric':_0x1b6bd0(0x3ca)+_0x1b6bd0(0x42a)+_0x1b6bd0(0x442)+_0x1b6bd0(0x310)+_0x1b6bd0(0x3d6),'inactiveEventCount':rendererSessionMetrics[_0x1b6bd0(0x3ca)+_0x1b6bd0(0x4aa)+'nt'],'inactiveBodyReadSuppressedCount':rendererSessionMetrics[_0x1b6bd0(0x3ca)+_0x1b6bd0(0x212)+_0x1b6bd0(0x3d4)+'edCount'],'changeKind':typeof _0x53a214[_0x1b6bd0(0x1b7)+'nd']===_0x1b6bd0(0x422)?_0x53a214['changeKi'+'nd']:null,'origin':typeof _0x53a214[_0x1b6bd0(0x584)]===_0x1b6bd0(0x422)?_0x53a214[_0x1b6bd0(0x584)]:null});}function ensureGeneratedFilesStore(){const _0x491f19=_0x5d452e;if(generatedFilesStore)return generatedFilesStore;if(!configController)throw new Error('wujie-sh'+_0x491f19(0x2e5)+_0x491f19(0x4d4)+_0x491f19(0x56f)+'lized');return generatedFilesStore=createGeneratedFilesStore({'stateDir':configController[_0x491f19(0x580)+'tateDir']()}),generatedFilesStore;}async function ensureGatewayControllerStarted(){const _0x3f2750=_0x5d452e;if(!gatewayController&&(!shellConfig||!configController))throw new Error(bootError?_0x3f2750(0x2d5)+_0x3f2750(0x375)+_0x3f2750(0x53a)+'\x20'+bootError:_0x3f2750(0x2d5)+_0x3f2750(0x38d)+_0x3f2750(0x1bd)+_0x3f2750(0x23a)+_0x3f2750(0x471));return!gatewayController&&(mainLogger?.[_0x3f2750(0x558)]('gateway\x20'+_0x3f2750(0x20f)+_0x3f2750(0x524)+_0x3f2750(0x4a5)+_0x3f2750(0x18d)),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x3f2750(0x4f5)+'on'](),'productRuntimeHooks':gatewayRuntimeHooks,'userEventWriter':userEventWriter,'sessionSqliteStore':ensureSessionSqliteStore()}),attachGatewayBroadcastHandlers(gatewayController),ensureSessionDataService()),await gatewayController['start'](),gatewayController;}function getMode(){const _0x240548=_0x5d452e;return process.env.VITE_DEV_SERVER_URL?_0x240548(0x1a4):_0x240548(0x51b);}function isGatewayNotInitializedError(_0x49d815){const _0x196d1c=_0x5d452e;return _0x49d815 instanceof Error&&_0x49d815[_0x196d1c(0x2be)]===_0x196d1c(0x2d5)+_0x196d1c(0x38d)+'way\x20is\x20n'+_0x196d1c(0x23a)+_0x196d1c(0x471);}function revealPathInFolder(_0x190193){const _0x5ce84a=_0x5d452e,_0xd9acf5=String(_0x190193||'')['trim']();if(!_0xd9acf5)return{'ok':![],'error':'path\x20is\x20'+_0x5ce84a(0x21f)};let _0x608de8=_0xd9acf5;if(_0xd9acf5['startsWi'+'th'](CLAWSPACE_PROTOCOL_SCHEME+':'))_0x608de8=decodeClawspacePath(_0xd9acf5)||'';else{if(_0xd9acf5[_0x5ce84a(0x541)+'th'](_0x5ce84a(0x54b)))try{_0x608de8=fileURLToPath(_0xd9acf5);}catch{_0x608de8='';}}if(!_0x608de8)return{'ok':![],'error':_0x5ce84a(0x2fb)+'路径'};if(!existsSync(_0x608de8))return{'ok':![],'error':_0x5ce84a(0x18b)+_0x5ce84a(0x4ab)};return shell['showItem'+'InFolder'](_0x608de8),{'ok':!![]};}function resolveProjectRoot(){const _0x51696e=_0x5d452e;if(process.env.WUJIE_SHELL_PROJECT_ROOT)return resolve(process.env.WUJIE_SHELL_PROJECT_ROOT);if(app[_0x51696e(0x348)+'ed']&&process['resource'+_0x51696e(0x47c)])return join(process[_0x51696e(0x2f0)+_0x51696e(0x47c)],_0x51696e(0x4c7));return resolve(process[_0x51696e(0x2b0)]());}function resolveProtocolScheme(){const _0x2e7639=_0x5d452e;return typeof shellConfig?.[_0x2e7639(0x45b)]===_0x2e7639(0x422)?shellConfig[_0x2e7639(0x45b)]['trim']():'';}function summarizeProtocolUrl(_0x5023d7){const _0x13a11e=_0x5d452e,_0x12eda6=typeof _0x5023d7==='string'?_0x5023d7:'';if(!_0x12eda6)return summarizeText('',0xa0);try{const _0x2e47d5=new URL(_0x12eda6);for(const _0x33fb34 of[_0x13a11e(0x32d),_0x13a11e(0x292)+'e',_0x13a11e(0x56d),_0x13a11e(0x1ae),'state']){_0x2e47d5[_0x13a11e(0x57e)+'rams'][_0x13a11e(0x194)](_0x33fb34)&&_0x2e47d5[_0x13a11e(0x57e)+'rams'][_0x13a11e(0x2b9)](_0x33fb34,_0x13a11e(0x5aa)+'D]');}return summarizeText(_0x2e47d5['toString'](),0xa0);}catch{return summarizeText(_0x12eda6,0xa0);}}function extractProtocolUrlFromArgs(_0x225ece=[]){const _0xd5d49f=resolveProtocolScheme();if(!_0xd5d49f)return null;return _0x225ece['find'](_0x4aac9d=>{const _0x4a3b7a=_0x2082;if(typeof _0x4aac9d!=='string')return![];return _0x4aac9d[_0x4a3b7a(0x541)+'th'](_0xd5d49f+_0x4a3b7a(0x428));})||null;}function getUsableMainWindow(){const _0x510759=_0x5d452e;if(!mainWindow)return null;if(mainWindow[_0x510759(0x3ef)+'yed']())return mainWindow=null,protocolUrlState[_0x510759(0x2d2)+_0x510759(0x573)](![]),null;if(mainWindow[_0x510759(0x3e2)+_0x510759(0x1f3)]?.[_0x510759(0x3ef)+_0x510759(0x1d4)]?.())return mainWindow=null,protocolUrlState[_0x510759(0x2d2)+_0x510759(0x573)](![]),null;return mainWindow;}async function ensureMainWindow(){const _0x12cf56=_0x5d452e,_0x1fe133=getUsableMainWindow();if(_0x1fe133)return _0x1fe133;if(!shellConfig||!ipcHandlersInstalled)return null;return!createWindowPromise&&(createWindowPromise=createWindow()[_0x12cf56(0x48d)](()=>{createWindowPromise=null;})),await createWindowPromise,getUsableMainWindow();}async function prepareMacMinimizedMainWindow(_0x7871bf,_0x3ce4a9){const _0xf040ee=_0x5d452e;if(process['platform']!=='darwin'||!_0x7871bf||_0x7871bf[_0xf040ee(0x3ef)+'yed']()||!_0x7871bf['isMinimi'+_0xf040ee(0x1c8)]())return _0x7871bf;return mainLogger?.[_0xf040ee(0x558)](_0xf040ee(0x579)+'ing\x20mini'+_0xf040ee(0x41b)+'c\x20window'+_0xf040ee(0x28a)+_0xf040ee(0x4cc),{'reason':_0x3ce4a9}),await normalizeMacMinimizeHide(_0x7871bf,{'force':!![]}),_0x7871bf;}function _0x2082(_0x3020a3,_0x446d3c){_0x3020a3=_0x3020a3-0x185;const _0x397363=_0x3973();let _0x20820f=_0x397363[_0x3020a3];return _0x20820f;}async function showMainWindowFromExternalActivation(_0x552cbf,_0x22659a){const _0x14c057=_0x5d452e,_0x3f661b=await prepareMacMinimizedMainWindow(_0x552cbf,_0x22659a);if(!_0x3f661b||_0x3f661b['isDestro'+'yed']())return null;if(_0x3f661b[_0x14c057(0x32c)+_0x14c057(0x1c8)]())_0x3f661b['restore']();return _0x3f661b[_0x14c057(0x4cc)](),_0x3f661b[_0x14c057(0x278)](),process['platform']===_0x14c057(0x381)&&macMinimizeToHideWindows[_0x14c057(0x511)](_0x3f661b),_0x3f661b;}function minimizeOrHideWindow(_0x5d79d9){const _0x4fec6e=_0x5d452e;if(!_0x5d79d9||_0x5d79d9[_0x4fec6e(0x3ef)+_0x4fec6e(0x1d4)]())return;if(process[_0x4fec6e(0x1a6)]===_0x4fec6e(0x381)){mainLogger?.[_0x4fec6e(0x1ba)](_0x4fec6e(0x447)+'ac\x20windo'+_0x4fec6e(0x280)+_0x4fec6e(0x559)+_0x4fec6e(0x1ff)),_0x5d79d9['hide']();return;}_0x5d79d9[_0x4fec6e(0x597)]();}function scheduleMacMinimizeHide(_0x2a0658){const _0x313028=_0x5d452e;if(process[_0x313028(0x1a6)]!=='darwin'||!_0x2a0658||_0x2a0658['isDestro'+'yed']())return Promise[_0x313028(0x311)]();return macMinimizeToHideWindows[_0x313028(0x56c)](_0x2a0658),normalizeMacMinimizeHide(_0x2a0658);}function normalizeMacMinimizeHide(_0x565ddb,_0x351b57={}){const _0x247b65=_0x5d452e;if(process[_0x247b65(0x1a6)]!=='darwin'||!_0x565ddb||_0x565ddb[_0x247b65(0x3ef)+'yed']()||!_0x351b57[_0x247b65(0x23e)]&&!macMinimizeToHideWindows[_0x247b65(0x194)](_0x565ddb))return Promise[_0x247b65(0x311)]();const _0x174ba6=macMinimizeHidePromises[_0x247b65(0x3f7)](_0x565ddb);if(_0x174ba6)return _0x174ba6;const _0x2eafa4=((async()=>{const _0x5c8978=_0x247b65;let _0x2edfe2=0x1,_0xb6a7ab=![];try{_0x2edfe2=_0x565ddb[_0x5c8978(0x2c0)+'ty'](),_0x565ddb['setOpaci'+'ty'](0x0);for(const _0x8bffb7 of[0x0,0x32,0x78,0xfa]){_0x8bffb7>0x0&&await new Promise(_0xe8dfed=>setTimeout(_0xe8dfed,_0x8bffb7));if(_0x565ddb[_0x5c8978(0x3ef)+_0x5c8978(0x1d4)]())return;const _0x5ee405=_0x565ddb[_0x5c8978(0x32c)+'zed']();_0x5ee405&&(_0x565ddb[_0x5c8978(0x4f3)](),_0xb6a7ab=!![]),_0x565ddb[_0x5c8978(0x1e7)]();}mainLogger?.[_0x5c8978(0x1ba)](_0x5c8978(0x579)+'ed\x20mac\x20n'+'ative\x20mi'+_0x5c8978(0x574)+_0x5c8978(0x325),{'restoredFromMinimize':_0xb6a7ab});}finally{!_0x565ddb[_0x5c8978(0x3ef)+_0x5c8978(0x1d4)]()&&_0x565ddb[_0x5c8978(0x400)+'ty'](_0x2edfe2),macMinimizeHidePromises[_0x5c8978(0x511)](_0x565ddb);}})());return macMinimizeHidePromises[_0x247b65(0x2b9)](_0x565ddb,_0x2eafa4),_0x2eafa4;}function restoreMainWindowForPendingProtocolUrl(){const _0x381771=_0x5d452e;if(!shellConfig)return;void ensureMainWindow()[_0x381771(0x297)](_0x850bf5=>{const _0xffa59f=_0x381771;mainLogger?.[_0xffa59f(0x416)]('protocol'+'\x20window\x20'+_0xffa59f(0x306)+_0xffa59f(0x22a),summarizeError(_0x850bf5));});}function queueProtocolUrl(_0x220fd4,_0x41f75c,_0x4f64f4=null){const _0x5eb5d5=_0x5d452e,{duplicate:_0x58f6aa}=protocolUrlState['queueUrl'](_0x220fd4);mainLogger?.[_0x5eb5d5(0x558)](_0x5eb5d5(0x45b)+_0x5eb5d5(0x3e7)+_0x5eb5d5(0x279)+_0x5eb5d5(0x463),{'url':summarizeProtocolUrl(_0x220fd4),'reason':_0x41f75c,'duplicatePending':_0x58f6aa,'hasWindow':Boolean(_0x4f64f4),'isLoadingMainFrame':Boolean(_0x4f64f4?.['webConte'+_0x5eb5d5(0x1f3)][_0x5eb5d5(0x339)+_0x5eb5d5(0x4ea)+'me']()),'protocolRendererReady':protocolUrlState[_0x5eb5d5(0x463)+_0x5eb5d5(0x595)]});}function dispatchProtocolUrl(_0x53618b){const _0x4314dc=_0x5d452e,_0x507ae4=resolveProtocolScheme();if(typeof _0x53618b!==_0x4314dc(0x422))return;if(!_0x507ae4){protocolUrlState[_0x4314dc(0x2cb)+'ngUrl'](_0x53618b),mainLogger?.[_0x4314dc(0x558)](_0x4314dc(0x45b)+'\x20url\x20que'+_0x4314dc(0x340)+_0x4314dc(0x2ca)+_0x4314dc(0x3de),{'url':summarizeProtocolUrl(_0x53618b)});return;}if(!_0x53618b['startsWi'+'th'](_0x507ae4+_0x4314dc(0x428)))return;mainLogger?.['warn'](_0x4314dc(0x45b)+_0x4314dc(0x3dc)+'eived',{'url':summarizeProtocolUrl(_0x53618b)});const _0x45d913=getUsableMainWindow();if(!_0x45d913){queueProtocolUrl(_0x53618b,_0x4314dc(0x24e)+_0x4314dc(0x20d));if(!_0x45d913)restoreMainWindowForPendingProtocolUrl();return;}if(process['platform']===_0x4314dc(0x381)&&_0x45d913['isMinimi'+_0x4314dc(0x1c8)]()){queueProtocolUrl(_0x53618b,_0x4314dc(0x453)+'mized-wi'+_0x4314dc(0x257)+'pare',_0x45d913),void showMainWindowFromExternalActivation(_0x45d913,'protocol'+'-url')[_0x4314dc(0x352)](_0x211974=>{if(_0x211974)flushPendingProtocolUrl();})[_0x4314dc(0x297)](_0x163eb8=>{const _0x1310a5=_0x4314dc;mainLogger?.[_0x1310a5(0x416)](_0x1310a5(0x45b)+_0x1310a5(0x3a1)+_0x1310a5(0x1a5)+_0x1310a5(0x2a6)+_0x1310a5(0x2e3),{'url':summarizeProtocolUrl(_0x53618b),'error':summarizeError(_0x163eb8)});});return;}if(_0x45d913[_0x4314dc(0x3e2)+_0x4314dc(0x1f3)][_0x4314dc(0x339)+_0x4314dc(0x4ea)+'me']()){queueProtocolUrl(_0x53618b,_0x4314dc(0x1d5)+_0x4314dc(0x1c0)+'me',_0x45d913);return;}if(!protocolUrlState['renderer'+_0x4314dc(0x595)]){queueProtocolUrl(_0x53618b,_0x4314dc(0x463)+_0x4314dc(0x1d9)+'dy',_0x45d913);return;}_0x45d913[_0x4314dc(0x4cc)](),_0x45d913[_0x4314dc(0x278)](),broadcast(_0x4314dc(0x562)+'ocol-url',_0x53618b),mainLogger?.['warn'](_0x4314dc(0x45b)+_0x4314dc(0x519)+_0x4314dc(0x249),{'url':summarizeProtocolUrl(_0x53618b),'protocolRendererReady':protocolUrlState[_0x4314dc(0x463)+_0x4314dc(0x595)]});}function flushPendingProtocolUrl(){const _0x4ac77a=_0x5d452e,_0x9c77b9=protocolUrlState[_0x4ac77a(0x206)+_0x4ac77a(0x3ab)]();if(!_0x9c77b9)return;mainLogger?.[_0x4ac77a(0x558)](_0x4ac77a(0x45b)+_0x4ac77a(0x4ef)+_0x4ac77a(0x4da)+_0x4ac77a(0x3a9),{'url':summarizeProtocolUrl(_0x9c77b9)}),void dispatchProtocolUrl(_0x9c77b9);}function getLocalFileMimeType(_0x1fc1ae){const _0xf940df=_0x5d452e;return LOCAL_FILE_MIME_TYPES['get'](_0x1fc1ae[_0xf940df(0x411)](_0x1fc1ae['lastInde'+_0xf940df(0x591)]('.'))['toLowerC'+_0xf940df(0x228)]())||_0xf940df(0x2dd)+_0xf940df(0x1cf)+_0xf940df(0x503);}function resolveRendererDistDir(){const _0xb8f561=_0x5d452e;return join(shellConfig['projectR'+_0xb8f561(0x46e)],_0xb8f561(0x29c));}function decodeAppRendererPath(_0x25a7a0){const _0x2d6130=_0x5d452e;try{const _0x5942a0=new URL(_0x25a7a0);if(_0x5942a0[_0x2d6130(0x45b)]!==APP_RENDERER_PROTOCOL_SCHEME+':')return null;if(_0x5942a0[_0x2d6130(0x434)]!==APP_RENDERER_PROTOCOL_HOST)return null;const _0x349a0c=resolveRendererDistDir(),_0x255da9=decodeURIComponent(_0x5942a0[_0x2d6130(0x39d)]||_0x2d6130(0x2b6)+_0x2d6130(0x235)),_0x27feea=_0x255da9[_0x2d6130(0x31c)](/^\/+/,'')||_0x2d6130(0x53d)+'ml',_0x13599c=resolve(_0x349a0c,_0x27feea);if(_0x13599c!==_0x349a0c&&!_0x13599c['startsWi'+'th'](''+_0x349a0c+sep))return null;return{'url':_0x5942a0,'distDir':_0x349a0c,'filePath':_0x13599c};}catch{return null;}}function parseSingleRangeHeader(_0x46923d,_0x36b1d9){const _0x1e597a=_0x5d452e,_0x460cb3=/^bytes=(\d*)-(\d*)$/i[_0x1e597a(0x23b)](_0x46923d[_0x1e597a(0x5a9)]());if(!_0x460cb3)return null;const [,_0x380387,_0x29b2ef]=_0x460cb3;if(!_0x380387&&!_0x29b2ef)return null;if(!_0x380387){const _0x488189=Number['parseInt'](_0x29b2ef,0xa);if(!Number['isFinite'](_0x488189)||_0x488189<=0x0)return null;const _0x500f87=Math[_0x1e597a(0x52d)](_0x36b1d9-_0x488189,0x0);return{'start':_0x500f87,'end':_0x36b1d9-0x1};}const _0x4f4b6c=Number[_0x1e597a(0x268)](_0x380387,0xa);if(!Number['isFinite'](_0x4f4b6c)||_0x4f4b6c<0x0||_0x4f4b6c>=_0x36b1d9)return null;const _0xac67d7=_0x29b2ef?Number[_0x1e597a(0x268)](_0x29b2ef,0xa):_0x36b1d9-0x1;if(!Number[_0x1e597a(0x4cf)](_0xac67d7)||_0xac67d7<_0x4f4b6c)return null;return{'start':_0x4f4b6c,'end':Math[_0x1e597a(0x4ad)](_0xac67d7,_0x36b1d9-0x1)};}function decodeClawspacePath(_0x265ee2){const _0x5dcadd=_0x5d452e;try{const _0x30287f=new URL(_0x265ee2);if(_0x30287f[_0x5dcadd(0x45b)]!==CLAWSPACE_PROTOCOL_SCHEME+':')return null;if(_0x30287f[_0x5dcadd(0x434)]!=='local')return null;const _0x3d2f83=decodeURIComponent(_0x30287f['pathname']);if(!_0x3d2f83)return null;if(/^\/[A-Za-z]:\//[_0x5dcadd(0x351)](_0x3d2f83))return _0x3d2f83[_0x5dcadd(0x411)](0x1);return _0x3d2f83;}catch{return null;}}function createClawspaceHeaders(_0x1731f0={}){const _0x50a9d5=_0x5d452e;return new Headers({'access-control-allow-origin':'*','access-control-allow-methods':_0x50a9d5(0x1f2)+_0x50a9d5(0x1e6)+'NS','access-control-allow-headers':_0x50a9d5(0x34e)+'ontent-t'+_0x50a9d5(0x26e),'access-control-expose-headers':_0x50a9d5(0x1ab)+_0x50a9d5(0x495)+_0x50a9d5(0x1ab)+'range,\x20a'+_0x50a9d5(0x254)+_0x50a9d5(0x3bf),..._0x1731f0});}function createLocalFileResponse(_0x21c3e5,_0x15c589){const _0x2d5397=_0x5d452e,_0x28f765=statSync(_0x15c589);if(!_0x28f765[_0x2d5397(0x1cd)]())return new Response(_0x2d5397(0x417)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x2d5397(0x322)+_0x2d5397(0x239)+_0x2d5397(0x1b4)+'8'})});const _0x8de609=getLocalFileMimeType(_0x15c589),_0x25b5df=createClawspaceHeaders({'content-type':_0x8de609,'accept-ranges':_0x2d5397(0x3db),'cache-control':_0x2d5397(0x2c6)});if(_0x21c3e5['method']===_0x2d5397(0x514))return _0x25b5df['set'](_0x2d5397(0x1ab)+_0x2d5397(0x2b2),String(_0x28f765['size'])),new Response(null,{'status':0xc8,'headers':_0x25b5df});const _0x24dd1a=_0x21c3e5[_0x2d5397(0x2ac)]['get'](_0x2d5397(0x413));if(!_0x24dd1a)return _0x25b5df[_0x2d5397(0x2b9)](_0x2d5397(0x1ab)+_0x2d5397(0x2b2),String(_0x28f765['size'])),new Response(Readable[_0x2d5397(0x1e1)](createReadStream(_0x15c589)),{'status':0xc8,'headers':_0x25b5df});const _0x43c222=parseSingleRangeHeader(_0x24dd1a,_0x28f765['size']);if(!_0x43c222)return new Response(null,{'status':0x1a0,'headers':createClawspaceHeaders({...Object['fromEntr'+'ies'](_0x25b5df[_0x2d5397(0x267)]()),'content-range':_0x2d5397(0x2df)+_0x28f765[_0x2d5397(0x575)]})});const {start:_0x3d5efa,end:_0x543696}=_0x43c222,_0x3e987f=_0x543696-_0x3d5efa+0x1,_0x513a09=new Headers(_0x25b5df);return _0x513a09[_0x2d5397(0x2b9)](_0x2d5397(0x1ab)+_0x2d5397(0x2b2),String(_0x3e987f)),_0x513a09[_0x2d5397(0x2b9)](_0x2d5397(0x1ab)+_0x2d5397(0x413),'bytes\x20'+_0x3d5efa+'-'+_0x543696+'/'+_0x28f765['size']),new Response(Readable['toWeb'](createReadStream(_0x15c589,{'start':_0x3d5efa,'end':_0x543696})),{'status':0xce,'headers':_0x513a09});}function installClawspaceProtocolHandler(){protocol['handle'](CLAWSPACE_PROTOCOL_SCHEME,_0x27dd30=>{const _0x5988f5=_0x2082;if(_0x27dd30[_0x5988f5(0x40e)]===_0x5988f5(0x24b))return new Response(null,{'status':0xcc,'headers':createClawspaceHeaders()});const _0x18c67b=decodeClawspacePath(_0x27dd30[_0x5988f5(0x204)]);if(!_0x18c67b)return new Response('Invalid\x20'+_0x5988f5(0x1d2)+'e\x20url',{'status':0x190,'headers':createClawspaceHeaders({'content-type':'text/pla'+_0x5988f5(0x239)+_0x5988f5(0x1b4)+'8'})});if(!existsSync(_0x18c67b))return new Response(_0x5988f5(0x417)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x5988f5(0x322)+'in;\x20char'+_0x5988f5(0x1b4)+'8'})});return createLocalFileResponse(_0x27dd30,_0x18c67b);});}function installAppRendererProtocolHandler(){protocol['handle'](APP_RENDERER_PROTOCOL_SCHEME,_0x33d994=>{const _0x401655=_0x2082;if(_0x33d994['method']===_0x401655(0x24b))return new Response(null,{'status':0xcc,'headers':createClawspaceHeaders()});const _0x416bae=decodeAppRendererPath(_0x33d994['url']);if(!_0x416bae)return new Response(_0x401655(0x498)+_0x401655(0x1dc),{'status':0x190,'headers':createClawspaceHeaders({'content-type':_0x401655(0x322)+_0x401655(0x239)+_0x401655(0x1b4)+'8'})});const {url:_0xc3f4e,distDir:_0x20bd1c,filePath:_0x586896}=_0x416bae,_0x2c5bf4=join(_0x20bd1c,'index.ht'+'ml'),_0x133df7=existsSync(_0x586896),_0x4026b7=_0x133df7?_0x586896:_0x2c5bf4;if(!_0x133df7&&_0xc3f4e[_0x401655(0x39d)][_0x401655(0x34d)]('.'))return new Response(_0x401655(0x417)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x401655(0x322)+'in;\x20char'+_0x401655(0x1b4)+'8'})});if(!existsSync(_0x4026b7))return mainLogger?.[_0x401655(0x416)](_0x401655(0x463)+_0x401655(0x4d6)+'ile\x20not\x20'+'found',{'requestUrl':_0x33d994[_0x401655(0x204)],'targetPath':_0x4026b7}),new Response(_0x401655(0x417)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x401655(0x322)+_0x401655(0x239)+_0x401655(0x1b4)+'8'})});return createLocalFileResponse(_0x33d994,_0x4026b7);});}function broadcast(_0x380bbb,_0x40a4b2){const _0x85c070=_0x5d452e;DEBUG_STDOUT&&console[_0x85c070(0x1ba)]('[wujie-s'+_0x85c070(0x386)+'nt]',_0x380bbb,summarizePayload(_0x40a4b2,{'maxDepth':0x2}));for(const _0xc6104d of BrowserWindow['getAllWi'+_0x85c070(0x4bc)]()){!_0xc6104d[_0x85c070(0x3e2)+_0x85c070(0x1f3)]['isDestro'+_0x85c070(0x1d4)]()&&_0xc6104d['webConte'+'nts']['send']('wujie-sh'+_0x85c070(0x2fe)+'t',{'name':_0x380bbb,'payload':_0x40a4b2});}}function requestLogReportFromRenderer(_0x11e3cb){const _0x45b36a=_0x5d452e,_0x4463b7=BrowserWindow[_0x45b36a(0x2e4)+'edWindow']()||(mainWindow&&!mainWindow[_0x45b36a(0x3ef)+'yed']()?mainWindow:null),_0x20a74d={'source':_0x11e3cb};if(!_0x4463b7||_0x4463b7['webConte'+'nts'][_0x45b36a(0x3ef)+'yed']()){broadcast(_0x45b36a(0x2c7)+_0x45b36a(0x480)+_0x45b36a(0x58c),_0x20a74d);return;}_0x4463b7[_0x45b36a(0x32c)+_0x45b36a(0x1c8)]()&&_0x4463b7[_0x45b36a(0x4f3)](),_0x4463b7[_0x45b36a(0x4cc)](),_0x4463b7[_0x45b36a(0x278)](),_0x4463b7[_0x45b36a(0x3e2)+_0x45b36a(0x1f3)][_0x45b36a(0x491)](_0x45b36a(0x2d5)+'ell:even'+'t',{'name':_0x45b36a(0x2c7)+_0x45b36a(0x480)+_0x45b36a(0x58c),'payload':_0x20a74d});}function installApplicationMenu(){const _0x9c8573=_0x5d452e;if(process['platform']!=='darwin')return;const _0x4bfbff=[{'label':shellConfig?.['productN'+_0x9c8573(0x554)]||app[_0x9c8573(0x548)],'submenu':[{'role':_0x9c8573(0x4d5)},{'type':_0x9c8573(0x3c9)+'r'},{'role':_0x9c8573(0x532)},{'type':'separato'+'r'},{'role':'hide'},{'role':'hideOthe'+'rs'},{'role':_0x9c8573(0x3f1)},{'type':_0x9c8573(0x3c9)+'r'},{'role':_0x9c8573(0x324)}]},{'label':'编辑','submenu':[{'role':'undo'},{'role':'redo'},{'type':_0x9c8573(0x3c9)+'r'},{'role':'cut'},{'role':_0x9c8573(0x49e)},{'role':_0x9c8573(0x41e)},{'role':_0x9c8573(0x556)+'l'}]},{'label':'显示','submenu':[{'role':_0x9c8573(0x561)},{'role':_0x9c8573(0x20b)+_0x9c8573(0x345)},{'type':'separato'+'r'},{'role':'togglefu'+_0x9c8573(0x3a7)}]},{'role':_0x9c8573(0x305)+'nu','label':'窗口'},{'role':_0x9c8573(0x27e),'label':'帮助','submenu':[{'label':'上传日志...','click':()=>{const _0x56fba8=_0x9c8573;requestLogReportFromRenderer(_0x56fba8(0x2dd)+_0x56fba8(0x227));}}]}];Menu[_0x9c8573(0x2b4)+_0x9c8573(0x3c8)+'nu'](Menu[_0x9c8573(0x27b)+'mTemplat'+'e'](_0x4bfbff));}async function loadProductRuntime(){const _0x93d2c1=_0x5d452e,_0x1c95e6=[join(shellConfig['projectR'+_0x93d2c1(0x46e)],_0x93d2c1(0x19d)+_0x93d2c1(0x196),_0x93d2c1(0x2a1)+'s'),join(app[_0x93d2c1(0x518)+'th'](),'shell-ru'+_0x93d2c1(0x196),'index.mj'+'s')],_0x49325f=_0x1c95e6[_0x93d2c1(0x42b)](_0x219b58=>existsSync(_0x219b58));if(!_0x49325f)return mainLogger?.[_0x93d2c1(0x1ba)](_0x93d2c1(0x41a)+'runtime\x20'+_0x93d2c1(0x25b)+'n\x20not\x20fo'+'und',{'runtimeCandidates':_0x1c95e6}),{};try{const _0x195985=await import(pathToFileURL(_0x49325f)[_0x93d2c1(0x346)]);return mainLogger?.['info'](_0x93d2c1(0x41a)+_0x93d2c1(0x403)+'extensio'+_0x93d2c1(0x37b),{'runtimePath':_0x49325f}),_0x195985;}catch(_0x52b83b){mainLogger?.[_0x93d2c1(0x416)](_0x93d2c1(0x41a)+_0x93d2c1(0x403)+_0x93d2c1(0x25b)+_0x93d2c1(0x25f)+_0x93d2c1(0x3ae),{'runtimePath':_0x49325f,'error':summarizeError(_0x52b83b)});throw _0x52b83b;}}function openDevToolsForActiveContext(){const _0x506d18=_0x5d452e;if(!isDevToolsEnabled())return mainLogger?.['info'](_0x506d18(0x314)+_0x506d18(0x53b)+_0x506d18(0x29b),{'mode':getMode(),'flagPath':resolveDevToolsFlagPath()}),{'ok':![]};const _0x28e608=BrowserWindow[_0x506d18(0x2e4)+_0x506d18(0x599)]()||mainWindow;if(!_0x28e608||_0x28e608[_0x506d18(0x3ef)+_0x506d18(0x1d4)]())return{'ok':![]};return _0x28e608[_0x506d18(0x3e2)+'nts'][_0x506d18(0x295)+_0x506d18(0x3df)]({'mode':_0x506d18(0x2d1)}),_0x28e608[_0x506d18(0x3e2)+_0x506d18(0x1f3)][_0x506d18(0x491)](_0x506d18(0x2d5)+_0x506d18(0x2fe)+'t',{'name':'devtools'+_0x506d18(0x1a3)+'t','payload':{'accelerator':DEVTOOLS_ACCELERATOR}}),{'ok':!![]};}function registerShellShortcuts(){const _0x3f7041=_0x5d452e;globalShortcut['unregist'+'er'](DEVTOOLS_ACCELERATOR);if(!isDevToolsEnabled())return;const _0x25e93c=globalShortcut[_0x3f7041(0x49c)](DEVTOOLS_ACCELERATOR,openDevToolsForActiveContext);!_0x25e93c&&console[_0x3f7041(0x558)](_0x3f7041(0x320)+_0x3f7041(0x53f)+'iled\x20to\x20'+_0x3f7041(0x49c)+'\x20shortcu'+_0x3f7041(0x5a6)+DEVTOOLS_ACCELERATOR);}async function getRuntimeResourceStatus(){const _0x18a7e9=_0x5d452e;try{const _0x4ab906=await loadRuntimeInfo(shellConfig[_0x18a7e9(0x22d)+_0x18a7e9(0x46e)]),_0x3ce017=_0x4ab906[_0x18a7e9(0x4d2)]||{};return{'ok':!![],'runtimeRoot':_0x4ab906[_0x18a7e9(0x4e2)+_0x18a7e9(0x46e)],'openclawVersion':_0x4ab906[_0x18a7e9(0x32f)+_0x18a7e9(0x45a)],'generatedAt':_0x3ce017['generate'+_0x18a7e9(0x58b)]||null,'pluginCount':Array['isArray'](_0x3ce017[_0x18a7e9(0x308)])?_0x3ce017[_0x18a7e9(0x308)][_0x18a7e9(0x2b2)]:0x0,'plugins':Array['isArray'](_0x3ce017[_0x18a7e9(0x308)])?_0x3ce017['plugins']:[],'agents':_0x3ce017['agents']||null,'skills':_0x3ce017[_0x18a7e9(0x560)]||null,'wrapper':_0x3ce017[_0x18a7e9(0x5a0)+_0x18a7e9(0x3ce)]||null,'product':_0x3ce017[_0x18a7e9(0x250)]||null};}catch(_0x308826){return{'ok':![],'runtimeRoot':resolveRuntimeRoot(shellConfig?.[_0x18a7e9(0x22d)+'oot']||resolveProjectRoot()),'error':_0x308826 instanceof Error?_0x308826[_0x18a7e9(0x2be)]:String(_0x308826)};}}function applyMacWindowVibrancy(_0x1ce45c){const _0xd4fc7f=_0x5d452e;if(process['platform']!==_0xd4fc7f(0x381)||!_0x1ce45c||_0x1ce45c[_0xd4fc7f(0x3ef)+'yed']())return;_0x1ce45c['setBackg'+_0xd4fc7f(0x1d8)+'or']('#0000000'+'0'),_0x1ce45c[_0xd4fc7f(0x33b)+_0xd4fc7f(0x2a9)]('sidebar',{'animationDuration':0x0});}async function createWindow(){const _0x3d7f8b=_0x5d452e,_0xb34670=process.env.VITE_DEV_SERVER_URL||APP_RENDERER_ENTRY_URL,_0x1e968a=process[_0x3d7f8b(0x1a6)]==='darwin',_0x57540b=process['platform']===_0x3d7f8b(0x490)?![]:!![],_0x5c0c75=isDevToolsEnabled();mainLogger?.['info'](_0x3d7f8b(0x410)+'\x20main\x20wi'+'ndow',{'rendererUrl':_0xb34670,'mode':getMode(),'devToolsEnabled':_0x5c0c75,'devToolsFlagPath':resolveDevToolsFlagPath()});const _0x2bd710=new BrowserWindow({'width':0x49c,'height':0x30c,'minWidth':0x384,'minHeight':0x26c,'title':shellConfig[_0x3d7f8b(0x3b9)+_0x3d7f8b(0x554)],'backgroundColor':_0x1e968a?_0x3d7f8b(0x4ce)+'0':_0x3d7f8b(0x430),..._0x1e968a?{'transparent':!![],'vibrancy':_0x3d7f8b(0x2af),'visualEffectState':_0x3d7f8b(0x35a)}:{},'autoHideMenuBar':!![],'titleBarStyle':_0x1e968a?_0x3d7f8b(0x44b)+_0x3d7f8b(0x2b9):_0x3d7f8b(0x479),'titleBarOverlay':_0x57540b,..._0x1e968a?{'trafficLightPosition':{'x':0x1c,'y':0x1a}}:{},'webPreferences':{'preload':preloadPath,'contextIsolation':!![],'nodeIntegration':![],'sandbox':![],'transparent':_0x1e968a,'devTools':_0x5c0c75}});applyMacWindowVibrancy(_0x2bd710),mainWindow=_0x2bd710,protocolUrlState[_0x3d7f8b(0x2d2)+_0x3d7f8b(0x573)](![]),_0x2bd710['on'](_0x3d7f8b(0x53c),()=>{const _0x3d4c4e=_0x3d7f8b;if(mainWindow!==_0x2bd710)return;mainWindow=null,protocolUrlState[_0x3d4c4e(0x2d2)+_0x3d4c4e(0x573)](![]);}),_0x2bd710['on'](_0x3d7f8b(0x597),_0x26fa25=>{const _0x368f5b=_0x3d7f8b;if(process['platform']!=='darwin')return;_0x26fa25?.[_0x368f5b(0x571)+'efault']?.(),void scheduleMacMinimizeHide(_0x2bd710);}),_0x2bd710[_0x3d7f8b(0x3e2)+_0x3d7f8b(0x1f3)]['on'](_0x3d7f8b(0x332)+_0x3d7f8b(0x31f)+'nt',_0x2f21ea=>{const _0x5ed688=_0x3d7f8b,_0x1dc08b=_0x2f21ea['input'];if(!_0x1dc08b||_0x1dc08b[_0x5ed688(0x226)]!==_0x5ed688(0x1a8))return;const _0x18bccf=String(_0x1dc08b[_0x5ed688(0x4e6)]||'')[_0x5ed688(0x3b7)+_0x5ed688(0x228)](),_0x3eeae0=_0x18bccf==='r',_0x58c809=process[_0x5ed688(0x1a6)]===_0x5ed688(0x381)?_0x1dc08b[_0x5ed688(0x1f4)]===!![]:_0x1dc08b['control']===!![];if(!_0x3eeae0||!_0x58c809)return;_0x2f21ea[_0x5ed688(0x571)+'efault'](),broadcast(_0x5ed688(0x4c2)+_0x5ed688(0x18a),{'type':'navigati'+'on','action':_0x5ed688(0x561)});}),_0x2bd710['on']('focus',()=>{const _0x576299=_0x3d7f8b;updateController?.['requestB'+_0x576299(0x35b)+_0x576299(0x3fa)](_0x576299(0x55a)+_0x576299(0x1d0));});const _0x17f8eb=process.env.VITE_DEV_SERVER_URL;_0x17f8eb?(await _0x2bd710[_0x3d7f8b(0x198)](_0x17f8eb),applyMacWindowVibrancy(_0x2bd710),process.env.WUJIE_SHELL_OPEN_DEVTOOLS==='1'&&_0x5c0c75&&_0x2bd710[_0x3d7f8b(0x3e2)+_0x3d7f8b(0x1f3)]['openDevT'+_0x3d7f8b(0x3df)]({'mode':'detach'})):(await _0x2bd710[_0x3d7f8b(0x198)](APP_RENDERER_ENTRY_URL),applyMacWindowVibrancy(_0x2bd710)),mainLogger?.[_0x3d7f8b(0x1ba)]('main\x20win'+_0x3d7f8b(0x253)+'ed',{'rendererUrl':_0xb34670,'mode':getMode(),'devToolsEnabled':_0x5c0c75});}function registerProtocolHandlers(){const _0x12d0f3=_0x5d452e,_0x4b406c=resolveProtocolScheme();if(!_0x4b406c)return;let _0x2e17a4=![];try{_0x2e17a4=app[_0x12d0f3(0x348)+'ed']?app[_0x12d0f3(0x2db)+'aultProt'+_0x12d0f3(0x4c3)+'nt'](_0x4b406c,process[_0x12d0f3(0x2d8)],[app['getAppPa'+'th']()]):![];}catch(_0x5fc5b){mainLogger?.[_0x12d0f3(0x416)]('protocol'+'\x20client\x20'+_0x12d0f3(0x408)+_0x12d0f3(0x294)+_0x12d0f3(0x51e),{'protocol':_0x4b406c,'error':summarizeError(_0x5fc5b)});}mainLogger?.['warn'](_0x12d0f3(0x45b)+'\x20client\x20'+_0x12d0f3(0x49c)+'ed',{'protocol':_0x4b406c,'registered':_0x2e17a4,'packaged':app[_0x12d0f3(0x348)+'ed'],'defaultClient':app[_0x12d0f3(0x19b)+_0x12d0f3(0x4af)+'lClient'](_0x4b406c),'execPath':toHomePath(process['execPath']),'appPath':toHomePath(app[_0x12d0f3(0x518)+'th']())});const _0x25d041=extractProtocolUrlFromArgs(process[_0x12d0f3(0x2c5)]);if(_0x25d041)protocolUrlState[_0x12d0f3(0x2cb)+_0x12d0f3(0x43d)](_0x25d041);const _0x18de04=extractProtocolUrlFromArgs(pendingProtocolArgs||[]);pendingProtocolArgs=null;if(_0x18de04)protocolUrlState[_0x12d0f3(0x2cb)+'ngUrl'](_0x18de04);}function normalizeRequestedLogLevel(_0x291bef){const _0x1e8c5f=_0x5d452e,_0x18dad7=typeof _0x291bef===_0x1e8c5f(0x422)?_0x291bef[_0x1e8c5f(0x5a9)]()[_0x1e8c5f(0x3b7)+_0x1e8c5f(0x228)]():'';if(!SHELL_LOG_LEVELS['has'](_0x18dad7))throw new Error('日志等级必须是\x20'+'error、wa'+_0x1e8c5f(0x2ae)+_0x1e8c5f(0x31b));return _0x18dad7;}function writeMainAuditLog(_0x254fbd,_0x125cff){const _0x43972b=_0x5d452e;return mainLogger?.[_0x43972b(0x4e0)]?.(formatLogLine({'level':_0x43972b(0x2ee),'context':'main','message':_0x254fbd,'meta':_0x125cff}));}async function installIpcHandlers(){const _0x33ccc9=_0x5d452e,_0x2b0ba8=(_0x35dcf3,_0x631c7c)=>{const _0xeec1a5=_0x2082;ipcMain[_0xeec1a5(0x3e4)](_0x35dcf3,async(_0x15a294,_0x42839b)=>{const _0x48094a=_0xeec1a5,_0x55c78d=Date[_0x48094a(0x521)](),_0x3bcac6=_0x15a294[_0x48094a(0x2eb)+'ame']?.[_0x48094a(0x204)]||_0x15a294[_0x48094a(0x35e)][_0x48094a(0x334)](),_0x413bb0=ipcLogger?.[_0x48094a(0x49b)+'g'](_0x48094a(0x20e));_0x413bb0&&ipcLogger[_0x48094a(0x1ba)](_0x48094a(0x224)+'est\x20star'+_0x48094a(0x33d),{'channel':_0x35dcf3,'senderUrl':_0x3bcac6});DEBUG_STDOUT&&_0x413bb0&&console[_0x48094a(0x1ba)]('[wujie-s'+'hell:ipc'+']',_0x35dcf3,_0x48094a(0x577));try{let _0x5dfb6d;try{_0x5dfb6d=await _0x631c7c(_0x15a294,_0x42839b);}catch(_0x45d459){if(!isGatewayNotInitializedError(_0x45d459))throw _0x45d459;await ensureGatewayControllerStarted(),_0x5dfb6d=await _0x631c7c(_0x15a294,_0x42839b);}const _0x3fa300=Date['now']()-_0x55c78d;return(_0x413bb0||_0x3fa300>IPC_SLOW_REQUEST_THRESHOLD_MS)&&ipcLogger?.['info']('ipc\x20requ'+'est\x20comp'+_0x48094a(0x530),{'channel':_0x35dcf3,'durationMs':_0x3fa300,'status':_0x48094a(0x301)+'d'}),await userEventWriter?.[_0x48094a(0x269)]({'channel':_0x35dcf3,'payload':_0x42839b,'result':_0x5dfb6d,'durationMs':_0x3fa300,'status':'succeede'+'d'}),DEBUG_STDOUT&&_0x413bb0&&console[_0x48094a(0x1ba)](_0x48094a(0x320)+_0x48094a(0x39b)+']',_0x35dcf3,'complete'+'d',{'durationMs':_0x3fa300,'status':_0x48094a(0x301)+'d'}),_0x5dfb6d;}catch(_0x329946){const _0xc7db8c=Date[_0x48094a(0x521)]()-_0x55c78d;ipcLogger?.[_0x48094a(0x416)]('ipc\x20requ'+_0x48094a(0x1b8)+'ed',{'channel':_0x35dcf3,'durationMs':_0xc7db8c,'error':summarizeError(_0x329946)}),await userEventWriter?.['fromIpc']({'channel':_0x35dcf3,'payload':_0x42839b,'error':_0x329946,'durationMs':_0xc7db8c,'status':_0x48094a(0x22a)}),await diagnosticsWriter?.[_0x48094a(0x4ae)+_0x48094a(0x209)](diagnosticEventFromError(_0x329946,{'category':'ipc','event':_0x48094a(0x43e)+_0x48094a(0x545)+'ed','message':_0x48094a(0x3a6)+_0x48094a(0x1b8)+'ed:\x20'+_0x35dcf3,'durationMs':_0xc7db8c,'meta':{'channel':_0x35dcf3,'senderUrl':_0x3bcac6,'payload':summarizePayload(_0x42839b)}}));DEBUG_STDOUT&&console[_0x48094a(0x416)](_0x48094a(0x320)+_0x48094a(0x39b)+']',_0x35dcf3,_0x48094a(0x22a),summarizeError(_0x329946));throw _0x329946;}});},_0x198172=()=>{const _0xb5be4d=_0x2082;if(!gatewayController)throw new Error(bootError?_0xb5be4d(0x2d5)+_0xb5be4d(0x375)+_0xb5be4d(0x53a)+'\x20'+bootError:_0xb5be4d(0x2d5)+_0xb5be4d(0x38d)+'way\x20is\x20n'+_0xb5be4d(0x23a)+_0xb5be4d(0x471));return gatewayController;},_0x2874b5=createReviewController({'getGlobalRepositoryPaths':async()=>[resolveProjectRoot()],'getWorkspacePath':async()=>{const _0x4a6e26=_0x2082,_0x46bb0c=await _0x198172()[_0x4a6e26(0x4fa)+'e'][_0x4a6e26(0x2d3)+_0x4a6e26(0x533)]();return String(_0x46bb0c?.[_0x4a6e26(0x2b7)]||'');}});function _0x3f72fd(){const _0x22b926=_0x2082;for(const _0x4ffff8 of Object['keys'](gatewayRuntimeHooks)){delete gatewayRuntimeHooks[_0x4ffff8];}Object[_0x22b926(0x2fa)](gatewayRuntimeHooks,productRuntimeHooks,{'onChatHistoryLoaded':async _0x271e95=>{const _0x1d1e76=_0x22b926;await requestIdHooks?.[_0x1d1e76(0x202)+'storyLoa'+'ded']?.(_0x271e95),await productRuntimeHooks?.['onChatHi'+_0x1d1e76(0x1d7)+_0x1d1e76(0x4f2)]?.(_0x271e95);},'onRequestIdTitleEvent':async _0x5657a3=>{const _0x24b2bc=_0x22b926;await requestIdHooks?.['onReques'+_0x24b2bc(0x57c)+_0x24b2bc(0x284)]?.(_0x5657a3),await productRuntimeHooks?.[_0x24b2bc(0x570)+'tIdTitle'+_0x24b2bc(0x284)]?.(_0x5657a3);}});}const _0x4fb296=()=>{const _0x1dc78a=_0x2082;if(typeof productRuntime[_0x1dc78a(0x49c)+_0x1dc78a(0x2ea)+'untimeHa'+_0x1dc78a(0x32b)]!==_0x1dc78a(0x291))return;const _0x2ac323=productRuntime[_0x1dc78a(0x49c)+_0x1dc78a(0x2ea)+_0x1dc78a(0x476)+_0x1dc78a(0x32b)]({'app':app,'BrowserWindow':BrowserWindow,'broadcast':broadcast,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'dialog':dialog,'exportLogsArchive':exportLogsArchive,'filesLogger':filesLogger,'getRuntimeSpawnContext':getRuntimeSpawnContext,'handle':_0x2b0ba8,'mainLogger':mainLogger,'mainWindow':mainWindow,'rendererLogger':rendererLogger,'requireGateway':_0x198172,'sep':sep,'openClawConfigHandlers':{'update':(..._0xda87ae)=>configController[_0x1dc78a(0x1fc)+_0x1dc78a(0x1c5)+'nfig'](..._0xda87ae),'setPluginConfig':_0x223384=>configController[_0x1dc78a(0x347)+_0x1dc78a(0x338)+'nConfig'](_0x223384),'setChannelConfig':_0x1e44c5=>configController['setOpenC'+_0x1dc78a(0x336)+_0x1dc78a(0x482)](_0x1e44c5),'deleteChannelConfig':_0x585515=>configController[_0x1dc78a(0x290)+_0x1dc78a(0x207)+_0x1dc78a(0x232)+_0x1dc78a(0x3a0)](_0x585515),'setSkillEntry':_0x5a56ba=>configController[_0x1dc78a(0x347)+_0x1dc78a(0x2da)+_0x1dc78a(0x35f)](_0x5a56ba),'deleteSkillEntry':_0x14088f=>configController[_0x1dc78a(0x290)+_0x1dc78a(0x23f)+_0x1dc78a(0x2c2)](_0x14088f),'setMcpServer':_0x5daeb3=>configController['setOpenC'+_0x1dc78a(0x222)+'rver'](_0x5daeb3),'deleteMcpServer':_0x53d503=>configController['deleteOp'+_0x1dc78a(0x396)+_0x1dc78a(0x2bb)](_0x53d503)},'shell':shell,'shellConfig':shellConfig,'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand,'summarizePayload':summarizePayload,'summarizeText':summarizeText,'toHomePath':toHomePath,'writeMutableConfig':_0xb238a4})||{};Object[_0x1dc78a(0x2fa)](productRuntimeHooks,_0x2ac323),_0x3f72fd();};ipcMain['on'](_0x33ccc9(0x562)+_0x33ccc9(0x4e7)+_0x33ccc9(0x32a),()=>{const _0x1923ae=_0x33ccc9;protocolUrlState[_0x1923ae(0x2d2)+_0x1923ae(0x573)](!![]),mainLogger?.[_0x1923ae(0x558)](_0x1923ae(0x45b)+_0x1923ae(0x4cb)+_0x1923ae(0x2f7),{'hasPendingProtocolUrl':Boolean(protocolUrlState[_0x1923ae(0x546)+'rl'])}),flushPendingProtocolUrl();}),_0x2b0ba8(_0x33ccc9(0x2a2),async()=>({'name':shellConfig['productN'+_0x33ccc9(0x554)],'version':app[_0x33ccc9(0x4f5)+'on'](),'appId':shellConfig[_0x33ccc9(0x446)],'dataDir':shellConfig['dataDir']})),_0x2b0ba8('app:open'+'-url',async(_0x26ca2e,_0x374637)=>{const _0x4b8095=_0x33ccc9,_0x264f00=typeof _0x374637===_0x4b8095(0x422)?_0x374637:'';if(!_0x264f00)return{'ok':![]};return filesLogger?.[_0x4b8095(0x1ba)](_0x4b8095(0x576)+_0x4b8095(0x197)+_0x4b8095(0x4b4)+_0x4b8095(0x33d),{'url':summarizeText(_0x264f00,0xa0)}),await shell['openExte'+_0x4b8095(0x1c3)](_0x264f00),{'ok':!![]};});const _0xb238a4=async(_0x33bdb7,_0x1ec310)=>{const _0x5b8a5b=_0x33ccc9;return configController[_0x5b8a5b(0x4c5)+_0x5b8a5b(0x3bd)+'andledIn'+_0x5b8a5b(0x3eb)](),await configController[_0x5b8a5b(0x42c)+_0x5b8a5b(0x3a0)](_0x33bdb7,_0x1ec310),{'ok':!![]};};Object['assign'](requestIdHooks,registerRequestIdHandlers({'configController':configController,'handle':_0x2b0ba8,'mainLogger':mainLogger})),_0x3f72fd(),_0x4fb296(),_0x2b0ba8('skills:i'+_0x33ccc9(0x455)+'p',async(_0x3ad2e9,_0x44bc68)=>importMarketSkillZip({'payload':_0x44bc68,'importSkillZip':_0x225950=>importSkillZip({..._0x225950,'app':app,'dialog':dialog,'dialogWindow':BrowserWindow[_0x33ccc9(0x34b)+'ontents'](_0x3ad2e9[_0x33ccc9(0x35e)])||mainWindow,'configController':configController}),'configController':configController})),_0x2b0ba8('skills:u'+_0x33ccc9(0x3c7),(_0x116da9,_0x2a4306)=>updateManagedSkillConfig({'payload':_0x2a4306,'configController':configController})),_0x2b0ba8('skills:d'+_0x33ccc9(0x329),(_0x6e577c,_0x3b0d31)=>deleteMarketSkillRegistryEntry({'payload':_0x3b0d31,'deleteManagedSkill':_0x303c98=>deleteManagedSkill({..._0x303c98,'gateway':_0x198172(),'configController':configController}),'configController':configController}));const _0x15dc8f=ensureGeneratedFilesStore();_0x2b0ba8(_0x33ccc9(0x441)+_0x33ccc9(0x29d)+'les:list',async()=>_0x15dc8f[_0x33ccc9(0x4ac)]()),_0x2b0ba8('app:gene'+_0x33ccc9(0x29d)+_0x33ccc9(0x40d)+_0x33ccc9(0x259)+_0x33ccc9(0x578),async(_0x49921d,_0x1c9f9e)=>_0x15dc8f[_0x33ccc9(0x469)+_0x33ccc9(0x2ef)](String(_0x1c9f9e||''))),_0x2b0ba8(_0x33ccc9(0x441)+_0x33ccc9(0x29d)+_0x33ccc9(0x3cb)+'rt',async(_0xb357c1,_0x2c3bab={})=>_0x15dc8f[_0x33ccc9(0x2ba)](_0x2c3bab)),_0x2b0ba8(_0x33ccc9(0x441)+_0x33ccc9(0x29d)+_0x33ccc9(0x555),async(_0x372eab,_0x4dbcf9)=>_0x15dc8f[_0x33ccc9(0x1e7)](String(_0x4dbcf9||''))),_0x2b0ba8(_0x33ccc9(0x441)+_0x33ccc9(0x29d)+_0x33ccc9(0x555)+_0x33ccc9(0x259)+_0x33ccc9(0x578),async(_0x1961bd,_0x1b1b7b)=>_0x15dc8f['hideBySe'+_0x33ccc9(0x2ef)](String(_0x1b1b7b||''))),_0x2b0ba8(_0x33ccc9(0x441)+_0x33ccc9(0x29d)+_0x33ccc9(0x4c8)+'te',async(_0x4fe566,_0x19ac57)=>_0x15dc8f[_0x33ccc9(0x281)+'le'](String(_0x19ac57||''))),_0x2b0ba8(_0x33ccc9(0x441)+_0x33ccc9(0x29d)+_0x33ccc9(0x4c8)+'ted-stat'+'e',async(_0x103ab8,_0x103365=[])=>_0x15dc8f[_0x33ccc9(0x25c)+_0x33ccc9(0x36d)](_0x103365)),_0x2b0ba8('app:gene'+_0x33ccc9(0x29d)+_0x33ccc9(0x3af)+'al',async(_0x2d9fbc,_0x5a34c3)=>revealPathInFolder(_0x5a34c3)),_0x2b0ba8('artifact'+'s:list',async(_0x599de6,_0x55f4d2={})=>{const _0x59b024=_0x33ccc9,_0x39189e=_0x55f4d2&&typeof _0x55f4d2===_0x59b024(0x4d9)&&_0x59b024(0x515)+'ey'in _0x55f4d2?String(_0x55f4d2[_0x59b024(0x515)+'ey']||''):'';return _0x39189e?_0x15dc8f[_0x59b024(0x469)+_0x59b024(0x2ef)](_0x39189e):_0x15dc8f[_0x59b024(0x4ac)]();}),_0x2b0ba8(_0x33ccc9(0x38b)+_0x33ccc9(0x360),async(_0x1bac5a,_0x31e7c6={})=>_0x15dc8f['upsert'](_0x31e7c6)),_0x2b0ba8(_0x33ccc9(0x38b)+_0x33ccc9(0x529),async(_0x1ff239,_0x2623ca={})=>_0x15dc8f[_0x33ccc9(0x1e7)](String(_0x2623ca['id']||_0x2623ca||''))),_0x2b0ba8(_0x33ccc9(0x38b)+_0x33ccc9(0x388),async(_0x272e61,_0x57d4a3={})=>_0x15dc8f['deleteFi'+'le'](String(_0x57d4a3['id']||_0x57d4a3||''))),_0x2b0ba8(_0x33ccc9(0x38b)+'s:delete'+_0x33ccc9(0x5a2),async(_0x5b2805,_0x2b571c={})=>_0x15dc8f['deletedS'+_0x33ccc9(0x36d)](_0x2b571c[_0x33ccc9(0x371)]||_0x2b571c)),_0x2b0ba8(_0x33ccc9(0x38b)+'s:reveal',async(_0x52d704,_0x185352={})=>{const _0xd7f585=_0x33ccc9,_0x514497=typeof _0x185352===_0xd7f585(0x422)?_0x185352:_0x185352[_0xd7f585(0x2b7)]||_0x185352[_0xd7f585(0x1e8)];return revealPathInFolder(_0x514497);});const _0x51a9ce=createPreferencesStore({'stateDir':configController[_0x33ccc9(0x580)+_0x33ccc9(0x549)](),'storeFile':_0x33ccc9(0x214)+'preferen'+_0x33ccc9(0x18e)}),_0x394a70=await _0x51a9ce['get']('shellLog'+_0x33ccc9(0x492),configController['paths']['logLevel']),_0x45a5c7=setShellLoggerLevel(_0x394a70);setRuntimeLoggerLevel(_0x394a70),mainLogger?.[_0x33ccc9(0x1ba)](_0x33ccc9(0x1e9)+'g\x20level\x20'+_0x33ccc9(0x4be)+_0x33ccc9(0x1c8),{'level':_0x45a5c7,'configuredLevel':configController[_0x33ccc9(0x371)][_0x33ccc9(0x52a)],'overriddenByEnv':Boolean(process.env.WUJIE_SHELL_LOG_LEVEL)}),_0x2b0ba8(_0x33ccc9(0x40b)+_0x33ccc9(0x47e)+'se',async()=>_0x51a9ce[_0x33ccc9(0x3f7)](_0x33ccc9(0x380)+_0x33ccc9(0x394)+'se',![])),_0x2b0ba8(_0x33ccc9(0x40b)+_0x33ccc9(0x2e8)+'se',async(_0x2d1ebe,_0x39feec)=>_0x51a9ce[_0x33ccc9(0x2b9)]('closeToT'+_0x33ccc9(0x394)+'se',_0x39feec===!![])),_0x2b0ba8('logs:get'+_0x33ccc9(0x2ab),async()=>({'level':getShellLoggerLevel(configController[_0x33ccc9(0x371)]),'overriddenByEnv':Boolean(process.env.WUJIE_SHELL_LOG_LEVEL)})),_0x2b0ba8(_0x33ccc9(0x4b1)+_0x33ccc9(0x2ab),async(_0x10a33f,_0x41d2b4={})=>{const _0x272667=_0x33ccc9,_0x58c8c7=normalizeRequestedLogLevel(typeof _0x41d2b4===_0x272667(0x422)?_0x41d2b4:_0x41d2b4[_0x272667(0x54f)]);await _0x51a9ce[_0x272667(0x2b9)](_0x272667(0x41d)+'Level',_0x58c8c7);const _0x3cbd6e=setShellLoggerLevel(_0x58c8c7);return setRuntimeLoggerLevel(_0x58c8c7),await writeMainAuditLog(_0x272667(0x1e9)+_0x272667(0x4b9)+_0x272667(0x3c5),{'requestedLevel':_0x58c8c7,'level':_0x3cbd6e,'overriddenByEnv':Boolean(process.env.WUJIE_SHELL_LOG_LEVEL)}),{'ok':!![],'level':_0x3cbd6e,'overriddenByEnv':Boolean(process.env.WUJIE_SHELL_LOG_LEVEL)};}),registerFileHandlers({'app':app,'filesLogger':filesLogger,'handle':_0x2b0ba8,'sep':sep,'stateDir':configController[_0x33ccc9(0x580)+'tateDir'](),'toHomePath':toHomePath}),registerProductLogHandlers({'app':app,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'exportLogsArchive':exportLogsArchive,'handle':_0x2b0ba8,'mainLogger':mainLogger,'rendererLogger':rendererLogger,'summarizeText':summarizeText,'toHomePath':toHomePath}),registerModelHandlers({'handle':_0x2b0ba8,'modelHandlers':{'saveCustomModel':_0x17e6fb=>_0x198172()['models']['saveCust'+_0x33ccc9(0x370)](_0x17e6fb),'deleteCustomModel':_0x1d40c0=>_0x198172()['models'][_0x33ccc9(0x526)+_0x33ccc9(0x1ac)+'l'](_0x1d40c0)}}),connectorController=createConnectorController({'shellConfig':shellConfig,'configController':configController,'broadcast':broadcast,'shell':shell,'getRuntimeSpawnContext':getRuntimeSpawnContext,'openClawConfigHandlers':{'update':(..._0x51d7dc)=>configController[_0x33ccc9(0x1fc)+_0x33ccc9(0x1c5)+_0x33ccc9(0x44e)](..._0x51d7dc),'setPluginConfig':_0x3eb38d=>configController[_0x33ccc9(0x347)+_0x33ccc9(0x338)+_0x33ccc9(0x304)](_0x3eb38d),'setChannelConfig':_0x13e282=>configController[_0x33ccc9(0x347)+_0x33ccc9(0x336)+_0x33ccc9(0x482)](_0x13e282),'deleteChannelConfig':_0x565f0a=>configController['deleteOp'+_0x33ccc9(0x207)+'annelCon'+_0x33ccc9(0x3a0)](_0x565f0a),'setSkillEntry':_0x1cacc8=>configController['setOpenC'+_0x33ccc9(0x2da)+_0x33ccc9(0x35f)](_0x1cacc8),'deleteSkillEntry':_0x4ab877=>configController[_0x33ccc9(0x290)+_0x33ccc9(0x23f)+_0x33ccc9(0x2c2)](_0x4ab877),'setMcpServer':_0x4ae360=>configController[_0x33ccc9(0x347)+_0x33ccc9(0x222)+_0x33ccc9(0x3fd)](_0x4ae360),'deleteMcpServer':_0x649a5d=>configController[_0x33ccc9(0x290)+_0x33ccc9(0x396)+_0x33ccc9(0x2bb)](_0x649a5d)},'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand}),_0x2b0ba8(_0x33ccc9(0x277)+'m-channe'+_0x33ccc9(0x3c1),async()=>connectorController[_0x33ccc9(0x563)+'annelCon'+_0x33ccc9(0x538)]()),_0x2b0ba8(_0x33ccc9(0x277)+_0x33ccc9(0x55f)+_0x33ccc9(0x273)+'e',async(_0x53f0bc,_0x37b505={})=>connectorController[_0x33ccc9(0x361)+_0x33ccc9(0x401)+_0x33ccc9(0x547)](_0x37b505)),_0x2b0ba8('config:i'+_0x33ccc9(0x55f)+'ls:set-e'+_0x33ccc9(0x4d8),async(_0x4ee3a9,_0x4c333b={})=>connectorController['setImCha'+'nnelEnab'+_0x33ccc9(0x51e)](_0x4c333b)),_0x2b0ba8('config:c'+_0x33ccc9(0x2a3)+_0x33ccc9(0x2a8),async(_0x3cfbee,_0x1fb545={})=>{const _0x22acdc=_0x33ccc9,_0x1179c8=String(_0x1fb545[_0x22acdc(0x43a)+'d']||_0x1fb545['payload']?.[_0x22acdc(0x43a)+'d']||_0x1fb545[_0x22acdc(0x203)]?.['id']||'');if(!_0x1179c8)throw new Error(_0x22acdc(0x43a)+_0x22acdc(0x4a1)+_0x22acdc(0x262));const _0x377b11=_0x1fb545[_0x22acdc(0x203)]||_0x1fb545,_0x5afa8d={'feishu':connectorController[_0x22acdc(0x3d3)+'huChanne'+_0x22acdc(0x287)],'qqbot':connectorController[_0x22acdc(0x2cc)+_0x22acdc(0x585)+_0x22acdc(0x282)],'wecom':connectorController['saveWeco'+_0x22acdc(0x54c)+_0x22acdc(0x282)],'qq_mail':connectorController['saveQqMa'+_0x22acdc(0x3b0)+_0x22acdc(0x2bf)+'g'],'netease_mail':connectorController[_0x22acdc(0x2ff)+_0x22acdc(0x364)+_0x22acdc(0x2a3)+_0x22acdc(0x282)],'tencent_exmail':connectorController[_0x22acdc(0x3ad)+'entExmai'+_0x22acdc(0x4d7)+_0x22acdc(0x22f)],'feishu_doc':connectorController[_0x22acdc(0x3d3)+'huDocCon'+_0x22acdc(0x343)+_0x22acdc(0x44e)],'tencent_docs':connectorController[_0x22acdc(0x3ad)+_0x22acdc(0x210)+_0x22acdc(0x2a3)+_0x22acdc(0x282)],'kdocs':connectorController[_0x22acdc(0x358)+_0x22acdc(0x3ba)+_0x22acdc(0x22f)],'dingtalk_doc':connectorController[_0x22acdc(0x218)+_0x22acdc(0x2c8)+_0x22acdc(0x2a3)+'Config']},_0x5006b2=_0x5afa8d[_0x1179c8];if(!_0x5006b2)throw new Error(_0x22acdc(0x378)+_0x22acdc(0x40a)+'ector:\x20'+_0x1179c8);return _0x5006b2(_0x377b11);}),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x38a)+_0x33ccc9(0x1d1)+'nnel',async(_0x81a644,_0x521128={})=>connectorController['saveFeis'+'huChanne'+'lConfig'](_0x521128)),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+':save-qq'+_0x33ccc9(0x5a4)+_0x33ccc9(0x1e0),async(_0x2731d8,_0x5b2660={})=>connectorController['saveQqbo'+'tChannel'+_0x33ccc9(0x282)](_0x5b2660)),_0x2b0ba8('config:c'+'onnector'+_0x33ccc9(0x191)+_0x33ccc9(0x587)+'nel',async(_0x4da3e5,_0x3cd9ff={})=>connectorController[_0x33ccc9(0x3d7)+'mChannel'+_0x33ccc9(0x282)](_0x3cd9ff)),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x20a)+_0x33ccc9(0x229),async(_0x360b59,_0x4d1884={})=>connectorController[_0x33ccc9(0x256)+_0x33ccc9(0x3b0)+'torConfi'+'g'](_0x4d1884)),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x3be)+'tease-ma'+'il',async(_0x5cae1a,_0x112380={})=>connectorController['saveNetE'+'aseMailC'+_0x33ccc9(0x2a3)+'Config'](_0x112380)),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x3b2)+_0x33ccc9(0x582)+'mail',async(_0x5b0aa,_0x23c28a={})=>connectorController['saveTenc'+_0x33ccc9(0x45c)+'lConnect'+'orConfig'](_0x23c28a)),_0x2b0ba8(_0x33ccc9(0x251)+'onnector'+_0x33ccc9(0x38a)+_0x33ccc9(0x356),async(_0x4478e3,_0x1c0f03={})=>connectorController['saveFeis'+_0x33ccc9(0x335)+_0x33ccc9(0x343)+_0x33ccc9(0x44e)](_0x1c0f03)),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x3b2)+'ncent-do'+'cs',async(_0x1ab214,_0xe4e1da={})=>connectorController[_0x33ccc9(0x3ad)+_0x33ccc9(0x210)+_0x33ccc9(0x2a3)+_0x33ccc9(0x282)](_0xe4e1da)),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x513)+_0x33ccc9(0x28d),async(_0x44b6cd,_0x337077={})=>connectorController[_0x33ccc9(0x358)+_0x33ccc9(0x3ba)+_0x33ccc9(0x22f)](_0x337077)),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x1b1)+_0x33ccc9(0x200)+'oc',async(_0x26e0fc,_0x2ada3c={})=>connectorController[_0x33ccc9(0x218)+_0x33ccc9(0x2c8)+_0x33ccc9(0x2a3)+_0x33ccc9(0x282)](_0x2ada3c)),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x271)+':start',async(_0x186d8e,_0x426284={})=>{const _0x4762ad=_0x33ccc9,_0x51e4a7=String(_0x426284[_0x4762ad(0x43a)+'d']||_0x426284[_0x4762ad(0x226)]||'');if(_0x51e4a7===_0x4762ad(0x34a))return connectorController[_0x4762ad(0x1fd)+'csCliCon'+_0x4762ad(0x39f)+'ion']();if(_0x51e4a7===_0x4762ad(0x215)+'oc')return connectorController[_0x4762ad(0x2b5)+_0x4762ad(0x525)+_0x4762ad(0x264)+_0x4762ad(0x3c0)]();if(_0x51e4a7===_0x4762ad(0x4c6))return connectorController[_0x4762ad(0x2b5)+_0x4762ad(0x557)+_0x4762ad(0x193)+'ession'](_0x426284);if(_0x51e4a7===_0x4762ad(0x32f)+_0x4762ad(0x461)||_0x51e4a7===_0x4762ad(0x4c0))return connectorController[_0x4762ad(0x2ec)+_0x4762ad(0x56a)+_0x4762ad(0x4ec)+'n']({'gatewayPort':_0x198172()[_0x4762ad(0x37f)+_0x4762ad(0x33a)](),'gatewayToken':_0x198172()['gatewayT'+'oken']()});throw new Error(_0x4762ad(0x378)+_0x4762ad(0x40a)+_0x4762ad(0x5a3)+'ssion:\x20'+(_0x51e4a7||'unknown'));}),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x271)+':status',async(_0x3ce31f,_0x238ad0={})=>{const _0x54dbe1=_0x33ccc9,_0x173b2c=String(_0x238ad0[_0x54dbe1(0x43a)+'d']||_0x238ad0['type']||'');if(_0x173b2c==='kdocs')return connectorController[_0x54dbe1(0x261)+_0x54dbe1(0x22b)+_0x54dbe1(0x24a)](_0x238ad0);if(_0x173b2c===_0x54dbe1(0x215)+'oc')return connectorController[_0x54dbe1(0x30e)+'uDocCliC'+_0x54dbe1(0x2cd)+_0x54dbe1(0x1f6)](_0x238ad0);if(_0x173b2c===_0x54dbe1(0x4c6))return connectorController[_0x54dbe1(0x30e)+_0x54dbe1(0x3ac)+_0x54dbe1(0x3a2)+_0x54dbe1(0x41f)](_0x238ad0);throw new Error(_0x54dbe1(0x378)+_0x54dbe1(0x40a)+_0x54dbe1(0x5a3)+_0x54dbe1(0x30b)+(_0x173b2c||_0x54dbe1(0x236)));}),_0x2b0ba8(_0x33ccc9(0x251)+'onnector'+_0x33ccc9(0x271)+_0x33ccc9(0x319),async(_0xfccaa6,_0x98e653={})=>{const _0x5ecf43=_0x33ccc9,_0x1519f8=String(_0x98e653[_0x5ecf43(0x43a)+'d']||_0x98e653[_0x5ecf43(0x226)]||'');if(_0x1519f8==='kdocs')return connectorController[_0x5ecf43(0x3ee)+_0x5ecf43(0x185)+_0x5ecf43(0x1af)+'sion'](_0x98e653);if(_0x1519f8===_0x5ecf43(0x215)+'oc')return connectorController[_0x5ecf43(0x1ee)+_0x5ecf43(0x275)+'liConnec'+'tSession'](_0x98e653);if(_0x1519f8===_0x5ecf43(0x4c6))return connectorController[_0x5ecf43(0x1ee)+_0x5ecf43(0x456)+_0x5ecf43(0x2f1)+'Session'](_0x98e653);if(_0x1519f8===_0x5ecf43(0x32f)+_0x5ecf43(0x461)||_0x1519f8===_0x5ecf43(0x4c0))return connectorController['cancelWe'+_0x5ecf43(0x300)+'nelSessi'+'on']();return{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x251)+_0x33ccc9(0x2a3)+_0x33ccc9(0x271)+':complet'+'e',async(_0x157303,_0x332311={})=>{const _0x298941=_0x33ccc9,_0x142304=String(_0x332311[_0x298941(0x43a)+'d']||_0x332311['type']||'');if(_0x142304===_0x298941(0x215)+'oc')return connectorController[_0x298941(0x1e4)+_0x298941(0x3f4)+_0x298941(0x2f5)+_0x298941(0x1ed)+'on'](_0x332311);throw new Error(_0x298941(0x378)+_0x298941(0x40a)+_0x298941(0x5a3)+_0x298941(0x30b)+(_0x142304||_0x298941(0x236)));}),_0x2b0ba8(_0x33ccc9(0x23d)+_0x33ccc9(0x47a),()=>connectorController[_0x33ccc9(0x59c)+_0x33ccc9(0x4f7)+'ot']());const _0x2f0404=_0x3a1349=>{const _0x1faf52=_0x33ccc9,_0x135eb7=_0x3a1349[_0x1faf52(0x188)]&&typeof _0x3a1349[_0x1faf52(0x188)]===_0x1faf52(0x4d9)?_0x3a1349['agents']:{};return Array['isArray'](_0x135eb7[_0x1faf52(0x4ac)])?_0x135eb7[_0x1faf52(0x4ac)]:[];},_0x3994b5=_0x1dd9dd=>{const _0xe2a1bb=_0x33ccc9,_0x2da9b1=typeof _0x1dd9dd===_0xe2a1bb(0x422)?_0x1dd9dd[_0xe2a1bb(0x5a9)]():'',_0x31a03=_0x2da9b1[_0xe2a1bb(0x402)](/^agent:([^:]+):/);return _0x31a03?.[0x1]||'';},_0xbdb888=(_0x2c7239={},_0x329acc=[])=>{const _0x8cdae6=_0x33ccc9,_0x1c0401=Array[_0x8cdae6(0x535)](_0x2c7239[_0x8cdae6(0x389)])?_0x2c7239[_0x8cdae6(0x389)]:[],_0x43d785=Array['isArray'](_0x2c7239[_0x8cdae6(0x188)])?_0x2c7239[_0x8cdae6(0x188)]:Array[_0x8cdae6(0x535)](_0x2c7239[_0x8cdae6(0x4ac)])?_0x2c7239['list']:_0x1c0401['map'](_0x5ca85d=>_0x5ca85d?.[_0x8cdae6(0x505)])['filter'](Boolean),_0xb3a648=Array[_0x8cdae6(0x535)](_0x329acc)?_0x329acc:[];return _0x43d785[_0x8cdae6(0x4ff)](_0x1ca515=>{const _0xee88b2=_0x8cdae6,_0x25aa33=String(_0x1ca515?.['id']||_0x1ca515?.['agentId']||'')[_0xee88b2(0x5a9)](),_0x528fb9=_0x1c0401['find'](_0x2428ff=>{const _0x41319b=_0xee88b2,_0x2f9ee8=String(_0x2428ff?.['agent']?.['id']||_0x2428ff?.[_0x41319b(0x505)]?.[_0x41319b(0x58f)]||'')[_0x41319b(0x5a9)]();return _0x2f9ee8===_0x25aa33;});return{..._0x528fb9&&typeof _0x528fb9===_0xee88b2(0x4d9)?_0x528fb9:{},'agent':_0x1ca515,'sessions':_0x25aa33?_0xb3a648[_0xee88b2(0x423)](_0x52edd9=>{const _0x332ea4=_0xee88b2,_0x33789=String(_0x52edd9?.['agentId']||_0x52edd9?.['agent_id']||_0x52edd9?.[_0x332ea4(0x505)]?.['id']||_0x3994b5(_0x52edd9?.['key'])||'')[_0x332ea4(0x5a9)]();return _0x33789?_0x33789===_0x25aa33:_0x25aa33==='main';}):[]};});};_0x2b0ba8(_0x33ccc9(0x289)+_0x33ccc9(0x500)+_0x33ccc9(0x36d),async()=>updateController?.[_0x33ccc9(0x3a5)]()),_0x2b0ba8(_0x33ccc9(0x289)+_0x33ccc9(0x36a),async()=>updateController?.[_0x33ccc9(0x4ca)+_0x33ccc9(0x2b1)]()),_0x2b0ba8(_0x33ccc9(0x289)+_0x33ccc9(0x527)+_0x33ccc9(0x345),async()=>updateController?.[_0x33ccc9(0x2cf)+_0x33ccc9(0x4a8)]()),_0x2b0ba8('app:upda'+_0x33ccc9(0x22e)+'and-inst'+_0x33ccc9(0x487),async()=>updateController?.[_0x33ccc9(0x274)+_0x33ccc9(0x315)]()),_0x2b0ba8(_0x33ccc9(0x21d)+_0x33ccc9(0x3e6),async(_0x27b2e5,_0x4effe0={})=>{const _0x7e286a=_0x33ccc9,_0x21861c=await dialog['showOpen'+_0x7e286a(0x409)](BrowserWindow[_0x7e286a(0x34b)+_0x7e286a(0x485)](_0x27b2e5[_0x7e286a(0x35e)])??mainWindow,{'properties':[_0x7e286a(0x391),..._0x4effe0?.[_0x7e286a(0x1c1)]!==0x1?[_0x7e286a(0x211)+_0x7e286a(0x341)]:[]],'filters':_0x4effe0?.[_0x7e286a(0x2e9)+_0x7e286a(0x265)+'s']?[{'name':_0x7e286a(0x1c6),'extensions':_0x4effe0[_0x7e286a(0x2e9)+'meFilter'+'s']}]:undefined});return _0x21861c['filePath'+'s'][_0x7e286a(0x4ff)](_0x1b8b32=>({'path':_0x1b8b32,'name':_0x1b8b32[_0x7e286a(0x323)](/[\\/]/)['pop']()||_0x1b8b32}));}),_0x2b0ba8(_0x33ccc9(0x21d)+_0x33ccc9(0x30f)+_0x33ccc9(0x266),async(_0x2c5a2d,_0x4f5f47={})=>{const _0x10a527=_0x33ccc9,_0x47b434=String(_0x4f5f47[_0x10a527(0x302)+'th']||'');if(!_0x47b434)return{'success':![],'error':'sourcePa'+_0x10a527(0x3a3)+_0x10a527(0x298)};const _0xaf89b=await dialog[_0x10a527(0x3b4)+_0x10a527(0x409)](mainWindow,{'defaultPath':_0x4f5f47['defaultF'+_0x10a527(0x3c4)]||_0x47b434['split'](/[\\/]/)[_0x10a527(0x3f8)]()});if(_0xaf89b[_0x10a527(0x385)]||!_0xaf89b['filePath'])return{'success':![],'canceled':!![]};const {copyFile:_0x121f8c}=await import(_0x10a527(0x59e)+_0x10a527(0x333));return await _0x121f8c(_0x47b434,_0xaf89b[_0x10a527(0x3d0)]),{'success':!![],'filePath':_0xaf89b[_0x10a527(0x3d0)]};}),_0x2b0ba8('app:clip'+'board:wr'+_0x33ccc9(0x3ed),async(_0x3291ea,_0x1ec7fd)=>{const _0x211535=_0x33ccc9;return clipboard[_0x211535(0x45e)+'t'](String(_0x1ec7fd??'')),{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x1bf)+_0x33ccc9(0x583)+'rt',async()=>{const _0xe356c7=_0x33ccc9;return app['relaunch'](),app[_0xe356c7(0x324)](),{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x1b9)+_0x33ccc9(0x49f)+_0x33ccc9(0x1c8),_0x53b76f=>Boolean(BrowserWindow['fromWebC'+'ontents'](_0x53b76f[_0x33ccc9(0x35e)])?.['isMaximi'+_0x33ccc9(0x1c8)]())),_0x2b0ba8(_0x33ccc9(0x1e2)+_0x33ccc9(0x2a4),async(_0x1750d7,_0x277375)=>{const _0x3af499=_0x33ccc9;return app[_0x3af499(0x2a0)+'ItemSett'+_0x3af499(0x412)]({'openAtLogin':_0x277375===!![]}),{'ok':!![],'enabled':_0x277375===!![]};}),_0x2b0ba8(_0x33ccc9(0x1e2)+_0x33ccc9(0x2fd),async()=>app[_0x33ccc9(0x467)+_0x33ccc9(0x1a1)+_0x33ccc9(0x412)]()[_0x33ccc9(0x435)+'gin']),_0x2b0ba8('app:file'+_0x33ccc9(0x20c)+'folder',async _0x1ac165=>{const _0xefa777=_0x33ccc9,_0x29a74b=await dialog[_0xefa777(0x58d)+_0xefa777(0x409)](BrowserWindow[_0xefa777(0x34b)+_0xefa777(0x485)](_0x1ac165[_0xefa777(0x35e)])??mainWindow,{'properties':[_0xefa777(0x2ce)+_0xefa777(0x4e5)]});return _0x29a74b[_0xefa777(0x3d0)+'s'][0x0]||'';}),_0x2b0ba8(_0x33ccc9(0x1bf)+'em:open-'+_0x33ccc9(0x1b0),async(_0x1a5009,_0x17e4ba)=>{const _0x41c56b=await shell['openPath'](String(_0x17e4ba||''));return _0x41c56b||'';}),_0x2b0ba8('openclaw'+':gateway'+_0x33ccc9(0x4e9),async()=>_0x198172()[_0x33ccc9(0x539)+_0x33ccc9(0x457)]()),_0x2b0ba8(_0x33ccc9(0x32f)+':gateway'+_0x33ccc9(0x1df),async()=>_0x198172()[_0x33ccc9(0x37f)+'ort']()),_0x2b0ba8(_0x33ccc9(0x32f)+_0x33ccc9(0x2e7)+'e',async(_0x3eb071,_0x31f0a7=[])=>{const _0x5976b2=_0x33ccc9,_0x3ef4ec=await runClawOnce(shellConfig[_0x5976b2(0x22d)+_0x5976b2(0x46e)],Array[_0x5976b2(0x535)](_0x31f0a7)?_0x31f0a7:[]);return{'ok':_0x3ef4ec[_0x5976b2(0x56d)]===0x0,..._0x3ef4ec};});const _0x592a2a=configController[_0x33ccc9(0x580)+_0x33ccc9(0x549)]();sessionSqliteStore=ensureSessionSqliteStore();const _0x2e220b=createAgentSessionsMapStore({'stateDir':_0x592a2a});_0x2b0ba8(_0x33ccc9(0x1aa)+':fork',async(_0x31fb27,_0x345161={})=>{const _0x11b40=_0x33ccc9,_0x51c12d=_0x345161&&typeof _0x345161===_0x11b40(0x4d9)?_0x345161:{},_0x9aa7b1=_0x51c12d[_0x11b40(0x307)+_0x11b40(0x59d)]||_0x51c12d[_0x11b40(0x515)+'ey'],_0x278965=await _0x198172()[_0x11b40(0x1aa)][_0x11b40(0x27d)]({..._0x51c12d,'parentSessionKey':_0x9aa7b1}),_0x38c40c=String(_0x278965?.[_0x11b40(0x4e6)]||'')[_0x11b40(0x5a9)](),_0x47713a=String(_0x278965?.['sessionI'+'d']||'')[_0x11b40(0x5a9)]();return _0x38c40c&&_0x47713a&&await _0x2e220b[_0x11b40(0x2ba)]({'sessionKey':_0x38c40c,'sessionId':_0x47713a,'sourceSessionKey':_0x51c12d[_0x11b40(0x2e0)+_0x11b40(0x59d)]||_0x9aa7b1,...typeof _0x51c12d[_0x11b40(0x365)+_0x11b40(0x57f)]==='number'?{'keepUntilTs':_0x51c12d[_0x11b40(0x365)+_0x11b40(0x57f)]}:{},...typeof _0x51c12d[_0x11b40(0x1d6)+'le']===_0x11b40(0x422)?{'cutoffRole':_0x51c12d[_0x11b40(0x1d6)+'le']}:{},...typeof _0x51c12d[_0x11b40(0x1ef)+'xt']===_0x11b40(0x422)?{'cutoffText':_0x51c12d[_0x11b40(0x1ef)+'xt']}:{}}),_0x278965;}),_0x2b0ba8('sessions'+_0x33ccc9(0x57a)+_0x33ccc9(0x3e5),async(_0x3904df,_0x34afc5={})=>_0x2e220b[_0x33ccc9(0x3f7)](_0x34afc5)),_0x2b0ba8(_0x33ccc9(0x1aa)+':agent-m'+'ap:upser'+'t',async(_0xedb74b,_0x316b79={})=>_0x2e220b[_0x33ccc9(0x2ba)](_0x316b79)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x57a)+_0x33ccc9(0x233),async(_0x9059e3,_0x252c41={})=>{const _0x2a99d2=_0x33ccc9,_0x202e7b=String(_0x252c41['sessionK'+'ey']||'')[_0x2a99d2(0x5a9)]();if(!_0x202e7b)return null;return await sessionSqliteStore[_0x2a99d2(0x2f2)+_0x2a99d2(0x419)](_0x202e7b);}),_0x2b0ba8('agents:c'+_0x33ccc9(0x2d9),async(_0x53676d,_0x5067bd={})=>{const _0xb2a56a=_0x33ccc9,_0x35930f=await readMutableConfig(),_0x214c3c=_0x35930f[_0xb2a56a(0x188)]&&typeof _0x35930f[_0xb2a56a(0x188)]==='object'?_0x35930f['agents']:{},_0x1ec58e=_0x2f0404(_0x35930f),_0x18a994=String(_0x5067bd['id']||_0x5067bd[_0xb2a56a(0x548)]||_0xb2a56a(0x225)+Date[_0xb2a56a(0x521)]())['trim']()[_0xb2a56a(0x31c)](/\s+/g,'-'),_0x335ee0={'id':_0x18a994,'name':String(_0x5067bd[_0xb2a56a(0x548)]||_0x18a994),..._0x5067bd[_0xb2a56a(0x4fa)+'e']?{'workspace':String(_0x5067bd['workspac'+'e'])}:{},..._0x5067bd[_0xb2a56a(0x38e)]?{'model':_0x5067bd['model']}:{},..._0x5067bd['emoji']?{'emoji':_0x5067bd['emoji']}:{},..._0x5067bd[_0xb2a56a(0x3c6)]?{'avatar':_0x5067bd[_0xb2a56a(0x3c6)]}:{},...Array['isArray'](_0x5067bd[_0xb2a56a(0x560)])?{'skills':_0x5067bd[_0xb2a56a(0x560)]}:{}};if(_0x1ec58e['some'](_0x3680fe=>_0x3680fe?.['id']===_0x18a994))throw new Error(_0xb2a56a(0x363)+_0xb2a56a(0x499)+_0xb2a56a(0x57b));return _0x214c3c['list']=[..._0x1ec58e,_0x335ee0],_0x35930f[_0xb2a56a(0x188)]=_0x214c3c,await _0xb238a4(_0x35930f,'agent\x20cr'+_0xb2a56a(0x3cf)),{'ok':!![],'agent':_0x335ee0};}),_0x2b0ba8(_0x33ccc9(0x362)+_0x33ccc9(0x3c7),async(_0x103c8a,_0x58322b={})=>{const _0x14b22d=_0x33ccc9,_0x4703a5=String(_0x58322b['id']||_0x58322b['agentId']||'')[_0x14b22d(0x5a9)]();if(!_0x4703a5)throw new Error(_0x14b22d(0x29f)+'\x20is\x20requ'+_0x14b22d(0x5a7));const _0x54f9f1=await readMutableConfig(),_0x2ccfc9=_0x54f9f1[_0x14b22d(0x188)]&&typeof _0x54f9f1[_0x14b22d(0x188)]===_0x14b22d(0x4d9)?_0x54f9f1[_0x14b22d(0x188)]:{},_0x2ff0c8=_0x2f0404(_0x54f9f1),_0x36e4f5=_0x2ff0c8[_0x14b22d(0x4ff)](_0x56b269=>_0x56b269?.['id']===_0x4703a5?{..._0x56b269,..._0x58322b,'id':_0x4703a5}:_0x56b269);return _0x2ccfc9[_0x14b22d(0x4ac)]=_0x36e4f5,_0x54f9f1['agents']=_0x2ccfc9,await _0xb238a4(_0x54f9f1,'agent\x20up'+_0x14b22d(0x424)),{'ok':!![],'agent':_0x36e4f5[_0x14b22d(0x42b)](_0x2b6945=>_0x2b6945?.['id']===_0x4703a5)||null};}),_0x2b0ba8(_0x33ccc9(0x2c3)+_0x33ccc9(0x329),async(_0x4135d5,_0x111970={})=>{const _0x2ca9b2=_0x33ccc9,_0x468c4c=String(_0x111970['id']||_0x111970[_0x2ca9b2(0x58f)]||'')[_0x2ca9b2(0x5a9)]();if(!_0x468c4c)throw new Error(_0x2ca9b2(0x29f)+'\x20is\x20requ'+_0x2ca9b2(0x5a7));const _0xae4f8d=await readMutableConfig(),_0x3f7fe5=_0xae4f8d[_0x2ca9b2(0x188)]&&typeof _0xae4f8d[_0x2ca9b2(0x188)]===_0x2ca9b2(0x4d9)?_0xae4f8d[_0x2ca9b2(0x188)]:{};return _0x3f7fe5['list']=_0x2f0404(_0xae4f8d)[_0x2ca9b2(0x423)](_0x469a73=>_0x469a73?.['id']!==_0x468c4c),_0xae4f8d[_0x2ca9b2(0x188)]=_0x3f7fe5,await _0xb238a4(_0xae4f8d,'agent\x20de'+_0x2ca9b2(0x530)),{'ok':!![],'agentId':_0x468c4c};}),_0x2b0ba8('agents:w'+_0x33ccc9(0x590)+_0x33ccc9(0x1bc)+'t',async(_0x33c777,_0x48906f={})=>{const _0x3a27a5=_0x33ccc9,[_0x19f7a7,_0xe29907]=await Promise[_0x3a27a5(0x487)]([_0x198172()[_0x3a27a5(0x188)][_0x3a27a5(0x4ac)](),ensureSessionDataService()['listSumm'+_0x3a27a5(0x540)](_0x48906f)[_0x3a27a5(0x297)](()=>({'sessions':[]}))]),_0x15eaab=Array[_0x3a27a5(0x535)](_0xe29907['sessions'])?_0xe29907['sessions']:[];return{..._0x19f7a7,'sessions':_0x15eaab,'groups':_0xbdb888(_0x19f7a7,_0x15eaab)};}),terminalManager=createTerminalManager({'cwd':join(configController[_0x33ccc9(0x580)+_0x33ccc9(0x549)](),_0x33ccc9(0x4fa)+'e'),'emitData':_0x8bbd10=>broadcast('terminal'+_0x33ccc9(0x59b),_0x8bbd10),'emitExit':_0x50ab95=>broadcast(_0x33ccc9(0x26b)+_0x33ccc9(0x2c4),_0x50ab95)}),_0x2b0ba8(_0x33ccc9(0x26b)+_0x33ccc9(0x37e),async(_0x4dc2a0,_0x37b188={})=>terminalManager[_0x33ccc9(0x27d)](_0x37b188)),_0x2b0ba8('terminal'+':input',async(_0x42eaf7,_0x1e0fa8={})=>terminalManager[_0x33ccc9(0x220)](_0x1e0fa8)),_0x2b0ba8('terminal'+_0x33ccc9(0x3da),async(_0x1e0e9a,_0x92998f={})=>terminalManager[_0x33ccc9(0x4f4)](_0x92998f)),_0x2b0ba8('terminal'+':close',async(_0x4b1bcd,_0x2f3584={})=>terminalManager[_0x33ccc9(0x550)](_0x2f3584)),_0x2b0ba8(_0x33ccc9(0x384)+_0x33ccc9(0x4ac),async()=>{const _0x4cc41a=_0x33ccc9,_0x5eaae7=gatewayController?.[_0x4cc41a(0x26d)+_0x4cc41a(0x4e3)]?.()||{};return _0x5eaae7['plugins']||[];}),_0x2b0ba8('plugins:'+_0x33ccc9(0x3a4)+'ig',async(_0x56ffb6,_0xdc9473={})=>{const _0xcab5e2=_0x33ccc9,_0x4d213d=String(_0xdc9473[_0xcab5e2(0x510)]||_0xdc9473['id']||''),_0x19f5d9=await readMutableConfig(),_0x5842bf=_0x19f5d9[_0xcab5e2(0x308)]?.[_0xcab5e2(0x267)]||{};return _0x4d213d?_0x5842bf[_0x4d213d]||null:_0x5842bf;}),_0x2b0ba8('plugins:'+_0x33ccc9(0x460)+_0x33ccc9(0x547),async(_0x384f76,_0xadd65d={})=>{const _0x5abd68=_0x33ccc9,_0x5b74e6=String(_0xadd65d['pluginId']||_0xadd65d['id']||'');if(!_0x5b74e6)throw new Error('pluginId'+_0x5abd68(0x1ce)+_0x5abd68(0x5a7));const _0x45f80b=await readMutableConfig(),_0x5d293f=_0x45f80b[_0x5abd68(0x308)]&&typeof _0x45f80b[_0x5abd68(0x308)]===_0x5abd68(0x4d9)?_0x45f80b['plugins']:{},_0x177f0c=_0x5d293f[_0x5abd68(0x267)]&&typeof _0x5d293f['entries']===_0x5abd68(0x4d9)?_0x5d293f[_0x5abd68(0x267)]:{};return _0x177f0c[_0x5b74e6]={..._0x177f0c[_0x5b74e6]||{},..._0xadd65d['config']||_0xadd65d['patch']||{}},_0x5d293f[_0x5abd68(0x267)]=_0x177f0c,_0x45f80b['plugins']=_0x5d293f,_0xb238a4(_0x45f80b,_0x5abd68(0x483)+'onfig\x20up'+_0x5abd68(0x424));}),_0x2b0ba8('plugins:'+_0x33ccc9(0x48e),async(_0x4ce1b5,_0x11ec70={})=>{const _0x1627c4=_0x33ccc9,_0xba2129=String(_0x11ec70[_0x1627c4(0x510)]||_0x11ec70['id']||'');if(!_0xba2129)throw new Error('pluginId'+_0x1627c4(0x1ce)+'ired');const _0x5b312e=await readMutableConfig(),_0x1f90ee=_0x5b312e[_0x1627c4(0x308)]&&typeof _0x5b312e[_0x1627c4(0x308)]==='object'?_0x5b312e['plugins']:{},_0x11e716=_0x1f90ee[_0x1627c4(0x267)]&&typeof _0x1f90ee[_0x1627c4(0x267)]==='object'?_0x1f90ee[_0x1627c4(0x267)]:{};return _0x11e716[_0xba2129]={..._0x11e716[_0xba2129]||{},'enabled':!![]},_0x1f90ee[_0x1627c4(0x267)]=_0x11e716,_0x5b312e[_0x1627c4(0x308)]=_0x1f90ee,_0xb238a4(_0x5b312e,'plugin\x20e'+_0x1627c4(0x4d8));}),_0x2b0ba8(_0x33ccc9(0x384)+_0x33ccc9(0x4b6),async(_0x219b8e,_0x414be0={})=>{const _0x2f54f9=_0x33ccc9,_0x3136e0=String(_0x414be0[_0x2f54f9(0x510)]||_0x414be0['id']||'');if(!_0x3136e0)throw new Error(_0x2f54f9(0x510)+_0x2f54f9(0x1ce)+_0x2f54f9(0x5a7));const _0x57b9ba=await readMutableConfig(),_0x5968be=_0x57b9ba[_0x2f54f9(0x308)]&&typeof _0x57b9ba['plugins']===_0x2f54f9(0x4d9)?_0x57b9ba[_0x2f54f9(0x308)]:{},_0x6ad18b=_0x5968be['entries']&&typeof _0x5968be[_0x2f54f9(0x267)]===_0x2f54f9(0x4d9)?_0x5968be['entries']:{};return _0x6ad18b[_0x3136e0]={..._0x6ad18b[_0x3136e0]||{},'enabled':![]},_0x5968be[_0x2f54f9(0x267)]=_0x6ad18b,_0x57b9ba['plugins']=_0x5968be,_0xb238a4(_0x57b9ba,_0x2f54f9(0x433)+_0x2f54f9(0x418));}),_0x2b0ba8(_0x33ccc9(0x384)+_0x33ccc9(0x466),async(_0x2d1dd9,_0x28ab66={})=>({'plugins':await((async()=>{const _0x5afce9=_0x33ccc9,_0xa1a83d=gatewayController?.[_0x5afce9(0x26d)+'nfo']?.()||{};if(!_0x28ab66?.[_0x5afce9(0x510)]&&!_0x28ab66?.['id'])return _0xa1a83d[_0x5afce9(0x308)]||[];const _0x12a034=String(_0x28ab66[_0x5afce9(0x510)]||_0x28ab66['id']||'');return(_0xa1a83d[_0x5afce9(0x308)]||[])['filter'](_0x1415b5=>_0x1415b5[_0x5afce9(0x510)]===_0x12a034);})())})),_0x2b0ba8(_0x33ccc9(0x2f9)+_0x33ccc9(0x387),async(_0x3532c3,_0x2f6efa)=>({'ok':!![],'payload':_0x2f6efa})),_0x2b0ba8('tabs:pos'+_0x33ccc9(0x395)+'e',async(_0xcb3d0e,_0x328f94)=>{const _0x1f4974=_0x33ccc9;return broadcast(_0x1f4974(0x4c2)+_0x1f4974(0x18a),_0x328f94),{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x3fc)+_0x33ccc9(0x299)+_0x33ccc9(0x2fc),async()=>{const _0x47614a=_0x33ccc9;return broadcast('tabs-age'+'nt-state'+_0x47614a(0x572),{}),{'ok':!![]};}),_0x2b0ba8('tabs:ref'+_0x33ccc9(0x3fb)+_0x33ccc9(0x2fc),async(_0x4ff704,_0x2630c3={})=>{const _0x43ea26=_0x33ccc9;return broadcast(_0x43ea26(0x42d)+'nt-state'+_0x43ea26(0x581)+_0x43ea26(0x572),_0x2630c3),{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x1c4)+_0x33ccc9(0x4e4),_0x326078=>{const _0x3e0a0d=_0x33ccc9;return minimizeOrHideWindow(BrowserWindow[_0x3e0a0d(0x34b)+_0x3e0a0d(0x485)](_0x326078[_0x3e0a0d(0x35e)])),{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x481)+'oggle-ma'+'ximize',_0x2919cb=>{const _0x527a9e=_0x33ccc9,_0x477117=BrowserWindow[_0x527a9e(0x34b)+_0x527a9e(0x485)](_0x2919cb[_0x527a9e(0x35e)]);if(!_0x477117)return{'isMaximized':![]};if(_0x477117['isMaximi'+_0x527a9e(0x1c8)]())_0x477117[_0x527a9e(0x507)+'ze']();else _0x477117['maximize']();return{'isMaximized':_0x477117['isMaximi'+_0x527a9e(0x1c8)]()};}),_0x2b0ba8('window:c'+'lose',_0x42129b=>{const _0x56ff0e=_0x33ccc9;return BrowserWindow[_0x56ff0e(0x34b)+_0x56ff0e(0x485)](_0x42129b[_0x56ff0e(0x35e)])?.[_0x56ff0e(0x550)](),{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x357)+'pen-devt'+_0x33ccc9(0x3df),()=>openDevToolsForActiveContext()),_0x2b0ba8(_0x33ccc9(0x32f)+_0x33ccc9(0x4b5)+'-info',()=>_0x198172()[_0x33ccc9(0x26d)+_0x33ccc9(0x4e3)]()),_0x2b0ba8('openclaw'+':gateway'+_0x33ccc9(0x255),async()=>(await ensureGatewayControllerStarted())[_0x33ccc9(0x34c)+'s']()),ipcMain['on'](_0x33ccc9(0x32f)+_0x33ccc9(0x48f)+_0x33ccc9(0x223)+_0x33ccc9(0x4b0),_0x416d05=>{const _0x1bebf6=_0x33ccc9;_0x416d05[_0x1bebf6(0x379)+'lue']=gatewayController?.[_0x1bebf6(0x34c)+'s']?.()??null;}),_0x2b0ba8(_0x33ccc9(0x32f)+_0x33ccc9(0x48f)+_0x33ccc9(0x3bc),()=>_0x198172()[_0x33ccc9(0x52b)]('renderer'+_0x33ccc9(0x4c1))),_0x2b0ba8(_0x33ccc9(0x32f)+':loading'+_0x33ccc9(0x368)+_0x33ccc9(0x4b2),async()=>({'loadingLifeCycle':'ready','message':'','updatedAt':new Date()[_0x33ccc9(0x520)+_0x33ccc9(0x475)]()})),_0x2b0ba8(_0x33ccc9(0x32f)+_0x33ccc9(0x48f)+'-logs',(_0xaef5e1,_0x270e96={})=>_0x198172()[_0x33ccc9(0x517)+_0x33ccc9(0x534)](_0x270e96?.['limit']??0xc8)),_0x2b0ba8(_0x33ccc9(0x32f)+_0x33ccc9(0x55d)+'ask-user'+_0x33ccc9(0x49d)+'n',(_0x573452,_0x5c1b74)=>_0x198172()[_0x33ccc9(0x39e)+'kUserQue'+_0x33ccc9(0x4c4)](_0x5c1b74)),_0x2b0ba8('openclaw'+_0x33ccc9(0x187)+_0x33ccc9(0x509),async()=>{const _0x5f5a4a=_0x33ccc9,_0x3444f9=join(resolveRuntimeRoot(shellConfig[_0x5f5a4a(0x22d)+'oot']),_0x5f5a4a(0x4bd),_0x5f5a4a(0x5a0)+'w');if(!existsSync(_0x3444f9))throw new Error(_0x5f5a4a(0x32f)+'\x20CLI\x20wra'+_0x5f5a4a(0x414)+_0x5f5a4a(0x33c)+_0x3444f9+(_0x5f5a4a(0x25e)+_0x5f5a4a(0x43c)+_0x5f5a4a(0x1f8)+_0x5f5a4a(0x21e)));const _0x424534=join(app[_0x5f5a4a(0x494)](_0x5f5a4a(0x36c)),_0x5f5a4a(0x2d5)+'ell-cli.'+'command');await writeFile(_0x424534,'#!/bin/s'+_0x5f5a4a(0x4a4)+_0x3444f9[_0x5f5a4a(0x31c)](/\\/g,'\x5c\x5c')['replace'](/"/g,'\x5c\x22')+'\x22\x0a',{'mode':0x1ed});const _0x33947c=spawn('open',['-a',_0x5f5a4a(0x186),_0x424534],{'detached':!![],'stdio':_0x5f5a4a(0x506)});return _0x33947c['unref'](),{'ok':!![],'cliPath':_0x3444f9};}),_0x2b0ba8('agents:l'+_0x33ccc9(0x3b1),()=>_0x198172()[_0x33ccc9(0x188)][_0x33ccc9(0x4ac)]()),_0x2b0ba8(_0x33ccc9(0x4fc)+_0x33ccc9(0x29a),(_0x3c2b84,_0x1cd8cc)=>_0x198172()['skills'][_0x33ccc9(0x466)](_0x1cd8cc)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x37e),(_0x58ef0f,_0x3f696c)=>_0x198172()['sessions']['create'](_0x3f696c)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x208)+'t',(_0x2b0520,_0xd6e961)=>ensureSessionDataService()[_0x33ccc9(0x437)+_0x33ccc9(0x540)](_0xd6e961)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x4cd),(_0xc1c45f,_0x5a2d83)=>ensureSessionDataService()[_0x33ccc9(0x33e)+'ry'](_0x5a2d83)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x263)+'n',(_0x5d3300,_0x19ebff)=>ensureSessionDataService()[_0x33ccc9(0x1c7)+_0x33ccc9(0x578)](_0x19ebff)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x2de)+_0x33ccc9(0x2ad)+'ot',(_0x51e5f3,_0xcd41d7)=>ensureSessionDataService()[_0x33ccc9(0x458)+_0x33ccc9(0x317)](_0xcd41d7)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x19a)+'ts',(_0x3f732d,_0x16ba1e)=>ensureSessionDataService()[_0x33ccc9(0x260)+_0x33ccc9(0x1ec)](_0x16ba1e)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x31d)+'es',(_0x530621,_0xc1af2)=>ensureSessionDataService()[_0x33ccc9(0x4ba)+_0x33ccc9(0x450)](_0xc1af2)),_0x2b0ba8(_0x33ccc9(0x1aa)+':runtime'+'-state-s'+_0x33ccc9(0x2ed),(_0x4c0fca,_0x551c57={})=>ensureSessionDataService()['getRunti'+_0x33ccc9(0x31e)](String(_0x551c57['sessionK'+'ey']||_0x551c57[_0x33ccc9(0x4e6)]||''))),_0x2b0ba8('sessions'+_0x33ccc9(0x1ea),(_0xbd0d44,_0xe0a111={})=>ensureSessionDataService()['listSess'+_0x33ccc9(0x1c9)+'s'](_0xe0a111)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x328),async(_0x30a4c0,_0x1af92e={})=>{const _0x47bbbb=_0x33ccc9,_0x3faddd=String(_0x1af92e[_0x47bbbb(0x515)+'ey']||_0x1af92e[_0x47bbbb(0x4e6)]||'')[_0x47bbbb(0x5a9)](),_0x5a345b=await ensureSessionSqliteStore()['readSess'+_0x47bbbb(0x567)](_0x3faddd),_0x3b242f=await configController[_0x47bbbb(0x444)+_0x47bbbb(0x21c)+_0x47bbbb(0x54e)]();return{..._0x5a345b,'contextWindowTokens':_0x3b242f['contextW'+_0x47bbbb(0x327)+_0x47bbbb(0x258)],'contextWindowSource':_0x3b242f[_0x47bbbb(0x288)+'indowSou'+'rce']};}),_0x2b0ba8(_0x33ccc9(0x1aa)+':delete',(_0xc7b5db,_0x878c05)=>_0x198172()[_0x33ccc9(0x1aa)][_0x33ccc9(0x511)](_0x878c05)),_0x2b0ba8(_0x33ccc9(0x2b8)+_0x33ccc9(0x34f),async(_0x35f04a,_0x450dc4)=>{const _0x42bdd4=_0x33ccc9;return await _0x2874b5[_0x42bdd4(0x426)+_0x42bdd4(0x52c)+'hot'](_0x450dc4?.[_0x42bdd4(0x515)+'ey']||_0x450dc4?.[_0x42bdd4(0x4e6)],_0x450dc4?.['reposito'+_0x42bdd4(0x516)]),_0x198172()[_0x42bdd4(0x52e)]['stream'](_0x450dc4);}),_0x2b0ba8('chat:abo'+'rt',(_0x398055,_0x57af6e)=>_0x198172()[_0x33ccc9(0x52e)][_0x33ccc9(0x399)](_0x57af6e)),_0x2b0ba8('review:r'+_0x33ccc9(0x4a3)+_0x33ccc9(0x477),(_0x3c615b,_0x3727d2={})=>_0x2874b5['reposito'+_0x33ccc9(0x19c)](_0x3727d2[_0x33ccc9(0x522)+_0x33ccc9(0x516)])),_0x2b0ba8(_0x33ccc9(0x5ab)+_0x33ccc9(0x1f9)+_0x33ccc9(0x405),(_0x4db31e,_0x511a8e={})=>_0x2874b5[_0x33ccc9(0x436)+_0x33ccc9(0x405)](_0x511a8e[_0x33ccc9(0x515)+'ey'],_0x511a8e['reposito'+'ryPath'])),_0x2b0ba8(_0x33ccc9(0x31a)+_0x33ccc9(0x536),(_0x436834,_0x37e6a6={})=>_0x2874b5[_0x33ccc9(0x213)](_0x37e6a6)),_0x2b0ba8(_0x33ccc9(0x1b3)+'it-statu'+'s',(_0x1c0ff3,_0x221db9={})=>_0x2874b5['gitStatu'+'s'](_0x221db9)),_0x2b0ba8(_0x33ccc9(0x1b3)+_0x33ccc9(0x470),(_0x5ed9d2,_0x584c03={})=>_0x2874b5['stage'](_0x584c03[_0x33ccc9(0x522)+_0x33ccc9(0x516)],_0x584c03[_0x33ccc9(0x371)])),_0x2b0ba8(_0x33ccc9(0x1b3)+_0x33ccc9(0x3dd)+'ge',(_0xeb0996,_0x3dd5c2={})=>_0x2874b5['unstage'](_0x3dd5c2['reposito'+'ryPath'],_0x3dd5c2[_0x33ccc9(0x371)])),_0x2b0ba8(_0x33ccc9(0x1b3)+_0x33ccc9(0x462)+'t',(_0x1bd491,_0x31dc67={})=>_0x2874b5['commit'](_0x31dc67[_0x33ccc9(0x522)+_0x33ccc9(0x516)],_0x31dc67['message'])),_0x2b0ba8(_0x33ccc9(0x1b3)+_0x33ccc9(0x28c),(_0x46db96,_0x597b23={})=>_0x2874b5[_0x33ccc9(0x2aa)](_0x597b23[_0x33ccc9(0x522)+_0x33ccc9(0x516)])),_0x2b0ba8(_0x33ccc9(0x1b3)+_0x33ccc9(0x219),(_0x40245a,_0x499ef0={})=>_0x2874b5[_0x33ccc9(0x59f)](_0x499ef0[_0x33ccc9(0x522)+'ryPath'])),_0x2b0ba8(_0x33ccc9(0x1b3)+_0x33ccc9(0x3a8),(_0xa313e2,_0x20523b={})=>_0x2874b5[_0x33ccc9(0x501)](_0x20523b[_0x33ccc9(0x522)+'ryPath'])),_0x2b0ba8(_0x33ccc9(0x1b3)+_0x33ccc9(0x25a)+_0x33ccc9(0x40f),(_0x2a5b79,_0x36fb28={})=>_0x2874b5[_0x33ccc9(0x512)+_0x33ccc9(0x36e)](_0x36fb28['reposito'+_0x33ccc9(0x516)],_0x36fb28[_0x33ccc9(0x4bf)])),_0x2b0ba8('review:g'+_0x33ccc9(0x44c)+_0x33ccc9(0x342),(_0x1aa6a2,_0x3d4d8f={})=>_0x2874b5[_0x33ccc9(0x3d9)+_0x33ccc9(0x36e)](_0x3d4d8f['reposito'+_0x33ccc9(0x516)],_0x3d4d8f[_0x33ccc9(0x4bf)])),_0x2b0ba8(_0x33ccc9(0x5ab)+_0x33ccc9(0x5a1)+'e',(_0x4ce589,_0x220cf5={})=>_0x2874b5['stageFil'+'e'](_0x220cf5[_0x33ccc9(0x522)+_0x33ccc9(0x516)],_0x220cf5[_0x33ccc9(0x2b7)])),_0x2b0ba8('review:r'+_0x33ccc9(0x353)+'le',(_0x17fe6a,_0x50b6f0={})=>_0x2874b5[_0x33ccc9(0x1c2)+'le'](_0x50b6f0[_0x33ccc9(0x522)+_0x33ccc9(0x516)],_0x50b6f0[_0x33ccc9(0x2b7)])),_0x2b0ba8(_0x33ccc9(0x276)+'te',async(_0x1b1608,_0x2c140c={})=>{const _0x110d9c=_0x33ccc9,_0x250a19=typeof _0x2c140c[_0x110d9c(0x54f)]===_0x110d9c(0x422)?_0x2c140c['level']:'info',_0x11911f=typeof _0x2c140c[_0x110d9c(0x2be)]===_0x110d9c(0x422)?_0x2c140c[_0x110d9c(0x2be)]:'renderer'+_0x110d9c(0x4e1),_0x4d3b71=typeof _0x2c140c[_0x110d9c(0x44a)]===_0x110d9c(0x422)&&_0x2c140c[_0x110d9c(0x44a)][_0x110d9c(0x5a9)]()?_0x110d9c(0x463)+':'+_0x2c140c[_0x110d9c(0x44a)][_0x110d9c(0x5a9)]():_0x110d9c(0x463),_0x3a6950=_0x2c140c[_0x110d9c(0x1f4)]&&typeof _0x2c140c[_0x110d9c(0x1f4)]===_0x110d9c(0x4d9)?{...summarizePayload(_0x2c140c[_0x110d9c(0x1f4)]),'context':_0x4d3b71}:{'context':_0x4d3b71},_0x4d1b2d=rendererLogger;if(_0x4d1b2d?.[_0x250a19])await _0x4d1b2d[_0x250a19](_0x11911f,_0x3a6950);else await _0x4d1b2d?.[_0x110d9c(0x1ba)](_0x11911f,_0x3a6950);if(_0x2c140c[_0x110d9c(0x56e)+'ic']===!![]||_0x4d3b71===_0x110d9c(0x463)+':diagnos'+'tic'){const _0x3b11b8=_0x2c140c['record']&&typeof _0x2c140c[_0x110d9c(0x3f2)]==='object'?_0x2c140c[_0x110d9c(0x3f2)]:_0x2c140c[_0x110d9c(0x1f4)]?.[_0x110d9c(0x3f2)]&&typeof _0x2c140c[_0x110d9c(0x1f4)][_0x110d9c(0x3f2)]===_0x110d9c(0x4d9)?_0x2c140c[_0x110d9c(0x1f4)]['record']:{'level':_0x250a19,'category':'renderer','event':_0x4d3b71,'message':_0x11911f,'meta':_0x2c140c[_0x110d9c(0x1f4)]};updateRendererSessionMetrics(_0x3b11b8),await diagnosticsWriter?.[_0x110d9c(0x350)+'nt'](_0x3b11b8,{'captureIncident':String(_0x3b11b8[_0x110d9c(0x54f)]||_0x250a19)[_0x110d9c(0x3b7)+'ase']()==='error'||_0x2c140c[_0x110d9c(0x4ae)+_0x110d9c(0x209)]===!![]});}return{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x464)+_0x33ccc9(0x33a),async(_0x49f7ac,_0x51bb39={})=>{const _0x5239c8=_0x33ccc9,_0x4c5614=typeof _0x51bb39[_0x5239c8(0x293)+'r']===_0x5239c8(0x422)&&_0x51bb39[_0x5239c8(0x293)+'r'][_0x5239c8(0x5a9)]()?_0x51bb39[_0x5239c8(0x293)+'r']:undefined,_0x5f1e09=await exportLogsArchive({'logsDir':configController[_0x5239c8(0x371)][_0x5239c8(0x3e8)],'targetDir':_0x4c5614,'appVersion':app['getVersi'+'on']()});return mainLogger?.['info'](_0x5239c8(0x4df)+_0x5239c8(0x2d7),{'path':toHomePath(_0x5f1e09[_0x5239c8(0x2b7)])}),_0x5f1e09;}),_0x2b0ba8(_0x33ccc9(0x3ea)+_0x33ccc9(0x1a7)+'ory',async()=>{const _0x61063b=_0x33ccc9;return await shell['openPath'](configController[_0x61063b(0x371)][_0x61063b(0x3e8)]),mainLogger?.[_0x61063b(0x1ba)](_0x61063b(0x59a)+_0x61063b(0x3f3)+_0x61063b(0x30a),{'logsDir':toHomePath(configController[_0x61063b(0x371)][_0x61063b(0x3e8)])}),{'ok':!![],'path':configController['paths'][_0x61063b(0x3e8)]};}),_0x2b0ba8('logs:lis'+'t',async()=>{const _0x4be608=_0x33ccc9,_0x4b2b78=await readdir(configController[_0x4be608(0x371)][_0x4be608(0x3e8)],{'recursive':!![]})[_0x4be608(0x297)](()=>[]);return _0x4b2b78;}),_0x2b0ba8(_0x33ccc9(0x46d)+'d',async(_0x30f56f,_0xfcca55={})=>{const _0x4a229d=_0x33ccc9,_0x429c73=String(_0xfcca55[_0x4a229d(0x2b7)]||'');if(!_0x429c73)throw new Error(_0x4a229d(0x4fd)+_0x4a229d(0x21f));return readFile(_0x429c73,_0x4a229d(0x4bb));}),_0x2b0ba8(_0x33ccc9(0x28f)+'ad',async(_0x76b9cd,_0x2af37b)=>{const _0x318f86=_0x33ccc9,_0x119c98=Date[_0x318f86(0x521)]();try{const _0x37c61f=await readFile(_0x2af37b,_0x318f86(0x4bb));return filesLogger?.[_0x318f86(0x1ba)]('file\x20rea'+_0x318f86(0x440)+_0x318f86(0x33d),{'path':toHomePath(_0x2af37b),'bytes':Buffer[_0x318f86(0x344)+'th'](_0x37c61f),'durationMs':Date[_0x318f86(0x521)]()-_0x119c98}),_0x37c61f;}catch(_0x15bed9){filesLogger?.[_0x318f86(0x416)](_0x318f86(0x1fb)+'d\x20failed',{'path':toHomePath(_0x2af37b),'durationMs':Date[_0x318f86(0x521)]()-_0x119c98,'error':summarizeError(_0x15bed9)});throw _0x15bed9;}}),_0x2b0ba8(_0x33ccc9(0x28f)+_0x33ccc9(0x594)+'y',async(_0x368a82,_0x1633b3)=>{const _0x393099=_0x33ccc9,_0x45f9da=Date['now']();try{const _0x21fc4b=await readFile(_0x1633b3);return filesLogger?.[_0x393099(0x1ba)](_0x393099(0x54d)+_0x393099(0x489)+_0x393099(0x383)+'ed',{'path':toHomePath(_0x1633b3),'bytes':_0x21fc4b[_0x393099(0x344)+'th'],'durationMs':Date[_0x393099(0x521)]()-_0x45f9da}),new Uint8Array(_0x21fc4b);}catch(_0x1e254f){filesLogger?.[_0x393099(0x416)]('binary\x20f'+_0x393099(0x489)+_0x393099(0x493),{'path':toHomePath(_0x1633b3),'durationMs':Date[_0x393099(0x521)]()-_0x45f9da,'error':summarizeError(_0x1e254f)});throw _0x1e254f;}}),_0x2b0ba8(_0x33ccc9(0x4dd)+_0x33ccc9(0x3ed),async(_0x2479d1,_0x554d28={})=>{const _0x50ac2f=_0x33ccc9,_0x15104c=Date['now']();return await writeFile(_0x554d28[_0x50ac2f(0x2b7)],_0x554d28['content']??'',_0x50ac2f(0x4bb)),filesLogger?.[_0x50ac2f(0x1ba)](_0x50ac2f(0x1de)+_0x50ac2f(0x43b)+_0x50ac2f(0x488),{'path':toHomePath(_0x554d28[_0x50ac2f(0x2b7)]),'bytes':Buffer[_0x50ac2f(0x344)+'th'](String(_0x554d28[_0x50ac2f(0x445)]??'')),'durationMs':Date['now']()-_0x15104c}),{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x4dd)+_0x33ccc9(0x27c)+'ry',async(_0x1a2862,_0x544d3c={})=>{const _0x5bde23=_0x33ccc9,_0xf789bf=Date[_0x5bde23(0x521)]();await writeFile(_0x544d3c[_0x5bde23(0x2b7)],Buffer['from'](_0x544d3c[_0x5bde23(0x445)]??[]));const _0x2e0dfa=await stat(_0x544d3c[_0x5bde23(0x2b7)])[_0x5bde23(0x297)](()=>null);return filesLogger?.['info']('binary\x20f'+_0x5bde23(0x285)+_0x5bde23(0x4ed)+_0x5bde23(0x33d),{'path':toHomePath(_0x544d3c[_0x5bde23(0x2b7)]),'bytes':_0x2e0dfa?.[_0x5bde23(0x575)]??0x0,'durationMs':Date[_0x5bde23(0x521)]()-_0xf789bf}),{'ok':!![]};}),_0x2b0ba8(_0x33ccc9(0x2f6)+_0x33ccc9(0x598)+'e',async(_0x160d50,_0x3481c3={})=>{const _0x2762f2=_0x33ccc9,_0x4657c1=await dialog[_0x2762f2(0x58d)+'Dialog'](BrowserWindow[_0x2762f2(0x34b)+'ontents'](_0x160d50[_0x2762f2(0x35e)])??mainWindow,{'title':typeof _0x3481c3[_0x2762f2(0x3d1)]===_0x2762f2(0x422)?_0x3481c3[_0x2762f2(0x3d1)]:undefined,'properties':[_0x2762f2(0x391),..._0x3481c3['multiSel'+'ections']?[_0x2762f2(0x211)+_0x2762f2(0x341)]:[]],'filters':Array[_0x2762f2(0x535)](_0x3481c3[_0x2762f2(0x1eb)])?_0x3481c3[_0x2762f2(0x1eb)]:undefined});return filesLogger?.[_0x2762f2(0x1ba)](_0x2762f2(0x443)+_0x2762f2(0x50e)+_0x2762f2(0x530),{'canceled':_0x4657c1[_0x2762f2(0x385)],'count':_0x4657c1['filePath'+'s'][_0x2762f2(0x2b2)],'paths':_0x4657c1[_0x2762f2(0x3d0)+'s'][_0x2762f2(0x4ff)](toHomePath)}),{'canceled':_0x4657c1[_0x2762f2(0x385)],'paths':_0x4657c1['filePath'+'s']};}),_0x2b0ba8(_0x33ccc9(0x248)+_0x33ccc9(0x1f7)+_0x33ccc9(0x3f9),async(_0x296582,_0x13a0e3={})=>{const _0x51548c=_0x33ccc9,_0x338184=resolve(String(_0x13a0e3[_0x51548c(0x2b7)]||'')),_0x5d5160=_0x13a0e3[_0x51548c(0x1cb)+'e']!==![],_0x503be3=Array[_0x51548c(0x535)](_0x13a0e3['extensio'+'ns'])?_0x13a0e3[_0x51548c(0x25b)+'ns'][_0x51548c(0x4ff)](_0x2ed12d=>String(_0x2ed12d)[_0x51548c(0x3b7)+_0x51548c(0x228)]()[_0x51548c(0x31c)](/^\./,''))[_0x51548c(0x423)](Boolean):null,_0xe5395f=Number['isIntege'+'r'](_0x13a0e3[_0x51548c(0x523)+'es'])&&_0x13a0e3[_0x51548c(0x523)+'es']>0x0?_0x13a0e3[_0x51548c(0x523)+'es']:0xc350,_0x1a0a30=[];let _0x16dedb=![];async function _0x5c3f78(_0x1e73ac){const _0x4904fe=_0x51548c;if(_0x16dedb)return;let _0x345554;try{_0x345554=await readdir(_0x1e73ac,{'withFileTypes':!![]});}catch{return;}for(const _0xc5f2d7 of _0x345554){if(_0x16dedb)return;if(_0xc5f2d7[_0x4904fe(0x548)][_0x4904fe(0x541)+'th']('.'))continue;const _0x533d83=join(_0x1e73ac,_0xc5f2d7[_0x4904fe(0x548)]);if(_0xc5f2d7[_0x4904fe(0x39c)+_0x4904fe(0x48c)]()){if(_0x5d5160)await _0x5c3f78(_0x533d83);continue;}if(!_0xc5f2d7['isFile']())continue;if(_0x503be3){const _0x35f177=_0xc5f2d7['name'][_0x4904fe(0x415)+_0x4904fe(0x591)]('.'),_0x122d4b=_0x35f177>=0x0?_0xc5f2d7[_0x4904fe(0x548)][_0x4904fe(0x411)](_0x35f177+0x1)[_0x4904fe(0x3b7)+_0x4904fe(0x228)]():'';if(!_0x503be3[_0x4904fe(0x34d)](_0x122d4b))continue;}if(_0x1a0a30[_0x4904fe(0x2b2)]>=_0xe5395f){_0x16dedb=!![];return;}_0x1a0a30[_0x4904fe(0x501)]({'name':_0xc5f2d7[_0x4904fe(0x548)],'path':_0x533d83});}}return await _0x5c3f78(_0x338184),{'path':_0x338184,'entries':_0x1a0a30,'truncated':_0x16dedb};}),_0x2b0ba8('files:se'+'lect-dir'+'ectory',async(_0x8e8528,_0x4d2f05={})=>{const _0x5b1efc=_0x33ccc9,_0x6da9ef=await dialog['showOpen'+_0x5b1efc(0x409)](BrowserWindow[_0x5b1efc(0x34b)+_0x5b1efc(0x485)](_0x8e8528[_0x5b1efc(0x35e)])??mainWindow,{'title':typeof _0x4d2f05['title']===_0x5b1efc(0x422)?_0x4d2f05[_0x5b1efc(0x3d1)]:undefined,'properties':[_0x5b1efc(0x2ce)+_0x5b1efc(0x4e5)]});return filesLogger?.['info'](_0x5b1efc(0x4ee)+_0x5b1efc(0x36f)+'\x20complet'+'ed',{'canceled':_0x6da9ef['canceled'],'count':_0x6da9ef['filePath'+'s']['length'],'paths':_0x6da9ef[_0x5b1efc(0x3d0)+'s'][_0x5b1efc(0x4ff)](toHomePath)}),{'canceled':_0x6da9ef['canceled'],'paths':_0x6da9ef[_0x5b1efc(0x3d0)+'s']};}),_0x2b0ba8(_0x33ccc9(0x4fa)+_0x33ccc9(0x2d0)+'ory-info',()=>_0x198172()[_0x33ccc9(0x4fa)+'e'][_0x33ccc9(0x2d3)+_0x33ccc9(0x533)]()),_0x2b0ba8(_0x33ccc9(0x4fa)+_0x33ccc9(0x4b3)+_0x33ccc9(0x36f),async()=>{const _0x530f16=_0x33ccc9,_0x27b66c=await _0x198172()[_0x530f16(0x4fa)+'e'][_0x530f16(0x2d3)+_0x530f16(0x533)]();return await shell['openPath'](_0x27b66c[_0x530f16(0x2b7)]),filesLogger?.['info'](_0x530f16(0x4fa)+_0x530f16(0x349)+_0x530f16(0x29e)+'ed',{'path':toHomePath(_0x27b66c[_0x530f16(0x2b7)])}),{'ok':!![],'path':_0x27b66c[_0x530f16(0x2b7)]};}),_0x2b0ba8(_0x33ccc9(0x4fa)+_0x33ccc9(0x3e9)+_0x33ccc9(0x1bb),()=>_0x198172()[_0x33ccc9(0x4fa)+'e'][_0x33ccc9(0x32e)+_0x33ccc9(0x373)]()),_0x2b0ba8('workspac'+'e:write-'+_0x33ccc9(0x241)+_0x33ccc9(0x30d),(_0xe2686b,_0x215634)=>_0x198172()[_0x33ccc9(0x4fa)+'e'][_0x33ccc9(0x1fe)+_0x33ccc9(0x3f5)+'xt'](_0x215634)),_0x2b0ba8(_0x33ccc9(0x1aa)+':rename',(_0x3a55f5,_0x52ce1c)=>_0x198172()[_0x33ccc9(0x1aa)][_0x33ccc9(0x37a)](_0x52ce1c)),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x448),async(_0x5afa2f,_0x214613={})=>{const _0x1ae439=_0x33ccc9,_0x1526ec=String(_0x214613[_0x1ae439(0x515)+'ey']||_0x214613['key']||'')['trim']();if(!_0x1526ec)throw new Error(_0x1ae439(0x515)+_0x1ae439(0x3d2)+_0x1ae439(0x298));const _0x1df939=await ensureSessionSqliteStore()[_0x1ae439(0x46a)+'dSession'+_0x1ae439(0x42f)](),_0x3b2caf=await _0x198172()[_0x1ae439(0x1aa)]['reorderP'+_0x1ae439(0x3ec)]([_0x1526ec,..._0x1df939[_0x1ae439(0x423)](_0x2d84c9=>_0x2d84c9!==_0x1526ec)]);return _0x3b2caf;}),_0x2b0ba8(_0x33ccc9(0x1aa)+_0x33ccc9(0x355),async(_0x4cc8bd,_0xd0f1fa={})=>{const _0x3a6b28=_0x33ccc9,_0x57d772=String(_0xd0f1fa['sessionK'+'ey']||_0xd0f1fa[_0x3a6b28(0x4e6)]||'')[_0x3a6b28(0x5a9)]();if(!_0x57d772)throw new Error('sessionK'+_0x3a6b28(0x3d2)+'quired');const _0x5605d2=await ensureSessionSqliteStore()[_0x3a6b28(0x46a)+'dSession'+_0x3a6b28(0x42f)]();return await _0x198172()['sessions']['reorderP'+'inned'](_0x5605d2[_0x3a6b28(0x423)](_0x358199=>_0x358199!==_0x57d772));}),_0x2b0ba8(_0x33ccc9(0x1aa)+':reorder'+'-pinned',async(_0x767298,_0x5b205b={})=>{const _0x109e94=_0x33ccc9,_0x1959b8=Array[_0x109e94(0x535)](_0x5b205b['keys'])?_0x5b205b[_0x109e94(0x38f)]:_0x5b205b;return await _0x198172()['sessions']['reorderP'+_0x109e94(0x3ec)](_0x1959b8);}),_0x2b0ba8(_0x33ccc9(0x28b)+_0x33ccc9(0x315),(_0x222401,_0x264e56)=>_0x198172()['skills']['install'](_0x264e56)),_0x2b0ba8(_0x33ccc9(0x2f8)+'t',(_0x133e7d,_0x548813)=>_0x198172()[_0x33ccc9(0x43f)][_0x33ccc9(0x4ac)](_0x548813)),_0x2b0ba8(_0x33ccc9(0x52f)+_0x33ccc9(0x189),(_0x32fc86,_0x332100)=>_0x198172()['cron'][_0x33ccc9(0x27d)](_0x332100)),_0x2b0ba8(_0x33ccc9(0x542)+_0x33ccc9(0x189),(_0x287bef,_0x3a7650)=>_0x198172()['cron'][_0x33ccc9(0x4dc)](_0x3a7650)),_0x2b0ba8(_0x33ccc9(0x240)+_0x33ccc9(0x551),(_0x2381b0,_0x344a59)=>_0x198172()[_0x33ccc9(0x43f)][_0x33ccc9(0x1e5)](_0x344a59)),_0x2b0ba8(_0x33ccc9(0x24f)+'-once',(_0x18e259,_0x3e2b89)=>_0x198172()[_0x33ccc9(0x43f)][_0x33ccc9(0x3fe)](_0x3e2b89)),_0x2b0ba8(_0x33ccc9(0x28e)+'s',(_0x3ba9c9,_0x1ea4fc)=>_0x198172()['cron']['logs'](_0x1ea4fc)),_0x2b0ba8(_0x33ccc9(0x1a2)+_0x33ccc9(0x4a6),async(_0x2d485e,_0xd6d4d2={})=>{const _0x346574=_0x33ccc9,_0x21ca71=configController['resolveC'+_0x346574(0x451)+'h'](),_0xd874e6=JSON[_0x346574(0x51c)](await readFile(_0x21ca71,_0x346574(0x4bb))),_0x4cec40=_0xd874e6?.['models']?.['provider'+'s']&&typeof _0xd874e6[_0x346574(0x234)][_0x346574(0x1ca)+'s']==='object'?_0xd874e6[_0x346574(0x234)]['provider'+'s']:{},_0x51df=typeof _0xd874e6?.['agents']?.[_0x346574(0x504)]?.[_0x346574(0x38e)]?.[_0x346574(0x3ff)]===_0x346574(0x422)?_0xd874e6[_0x346574(0x188)][_0x346574(0x504)][_0x346574(0x38e)][_0x346574(0x3ff)]:'',_0x5102bf=String(_0xd6d4d2['model']||_0x51df||'');if(!_0x5102bf[_0x346574(0x34d)]('/'))throw new Error(_0x346574(0x4a2)+_0x346574(0x421)+_0x346574(0x2b3)+'red;\x20set'+_0x346574(0x1f5)+'der/mode'+_0x346574(0x30c));const _0xeae945=_0x5102bf[_0x346574(0x221)]('/'),_0x4f69da=_0x5102bf[_0x346574(0x411)](0x0,_0xeae945),_0x58b090=_0x5102bf[_0x346574(0x411)](_0xeae945+0x1),_0x1bd778=_0x4cec40[_0x4f69da];if(!_0x1bd778||typeof _0x1bd778!==_0x346574(0x4d9))throw new Error(_0x346574(0x1ca)+_0x346574(0x593)+_0x346574(0x569)+'\x20'+_0x4f69da);const _0x2b1016=String(_0x1bd778[_0x346574(0x393)]||'https://'+_0x346574(0x58e)+_0x346574(0x4d3)+'1')[_0x346574(0x5a9)]()['replace'](/\/$/,''),_0xdda7e0=await fetch(_0x2b1016+(_0x346574(0x303)+_0x346574(0x3e3)+'s'),{'method':'POST','headers':{'content-type':'applicat'+'ion/json','Authorization':'Bearer\x20'+(_0x1bd778[_0x346574(0x2bc)]||''),..._0x1bd778['headers']&&typeof _0x1bd778['headers']==='object'?_0x1bd778[_0x346574(0x2ac)]:{}},'body':JSON['stringif'+'y']({'model':_0x58b090,'max_tokens':Number[_0x346574(0x3b5)+'r'](_0xd6d4d2['maxToken'+'s'])?_0xd6d4d2[_0x346574(0x3b8)+'s']:0x400,'temperature':typeof _0xd6d4d2[_0x346574(0x318)+_0x346574(0x244)]===_0x346574(0x465)?_0xd6d4d2['temperat'+_0x346574(0x244)]:undefined,'messages':Array[_0x346574(0x535)](_0xd6d4d2[_0x346574(0x42e)])?_0xd6d4d2[_0x346574(0x42e)]:[]}),'signal':AbortSignal[_0x346574(0x283)](Number[_0x346574(0x3b5)+'r'](_0xd6d4d2[_0x346574(0x508)+'s'])?_0xd6d4d2[_0x346574(0x508)+'s']:0x1d4c0)});if(!_0xdda7e0['ok']){const _0x223333=await _0xdda7e0['text']();throw new Error(_0x346574(0x431)+'tp\x20'+_0xdda7e0[_0x346574(0x466)]+':\x20'+_0x223333[_0x346574(0x411)](0x0,0x190));}const _0x4be92e=_0xdda7e0[_0x346574(0x2ac)][_0x346574(0x3f7)](_0x346574(0x38c)+'id'),_0x5495aa=await _0xdda7e0['json'](),_0x4ea8fa=_0x5495aa?.[_0x346574(0x1b2)]?.[0x0]?.[_0x346574(0x2be)]??{};if(_0x4be92e){const _0x2d5909=typeof _0xd6d4d2['title']===_0x346574(0x422)&&_0xd6d4d2['title'][_0x346574(0x5a9)]()?_0xd6d4d2[_0x346574(0x3d1)][_0x346574(0x5a9)]():Array[_0x346574(0x535)](_0xd6d4d2['messages'])?String([..._0xd6d4d2[_0x346574(0x42e)]][_0x346574(0x4f6)]()[_0x346574(0x42b)](_0x559ed8=>_0x559ed8?.[_0x346574(0x25d)]===_0x346574(0x1f0))?.[_0x346574(0x445)]||'')[_0x346574(0x5a9)]():'';_0x2d5909&&Promise[_0x346574(0x311)](requestIdHooks?.[_0x346574(0x570)+_0x346574(0x57c)+_0x346574(0x284)]?.({'requestId':_0x4be92e,'title':_0x2d5909,'source':_0x346574(0x1ca)+_0x346574(0x55e)+'e','model':_0x5495aa?.[_0x346574(0x38e)]||_0x58b090,'provider':_0x4f69da,'timestamp':Date[_0x346574(0x521)]()}))[_0x346574(0x297)](_0x49b95f=>{const _0x563c03=_0x346574;mainLogger?.[_0x563c03(0x558)]?.(_0x563c03(0x4d0)+_0x563c03(0x37c)+_0x563c03(0x38c)+_0x563c03(0x366)+'\x20event\x20f'+'ailed',{'error':_0x49b95f?.['message']||String(_0x49b95f)});});}return{'content':extractModelMessageContent(_0x4ea8fa[_0x346574(0x445)]),'reasoning':typeof _0x4ea8fa[_0x346574(0x24c)+_0x346574(0x205)+'t']===_0x346574(0x422)?_0x4ea8fa[_0x346574(0x24c)+_0x346574(0x205)+'t']:'','model':_0x5495aa?.[_0x346574(0x38e)]||_0x58b090};}),_0x2b0ba8(_0x33ccc9(0x286)+_0x33ccc9(0x404),()=>_0x198172()['models']['settings']()),_0x2b0ba8(_0x33ccc9(0x286)+_0x33ccc9(0x1e3)+_0x33ccc9(0x4e8),(_0x3a34b3,_0x147337)=>_0x198172()[_0x33ccc9(0x234)][_0x33ccc9(0x46c)+'ngs'](_0x147337)),_0x2b0ba8(_0x33ccc9(0x286)+_0x33ccc9(0x33f)+'ted-ever'+'ywhere',(_0x11fe6c,_0x45dd8d)=>_0x198172()[_0x33ccc9(0x234)]['setSelec'+_0x33ccc9(0x478)+'Everywhe'+'re'](_0x45dd8d)),_0x2b0ba8(_0x33ccc9(0x286)+_0x33ccc9(0x1b5)+'operated',(_0xbd7a94,_0x486e90)=>_0x198172()['models'][_0x33ccc9(0x382)+_0x33ccc9(0x57d)+_0x33ccc9(0x47f)](_0x486e90)),_0x2b0ba8(_0x33ccc9(0x286)+_0x33ccc9(0x1a9)+'model-id',()=>_0x198172()[_0x33ccc9(0x234)][_0x33ccc9(0x44f)+_0x33ccc9(0x1b6)]()),_0x2b0ba8(_0x33ccc9(0x1a2)+'ustom-mo'+_0x33ccc9(0x1be),()=>_0x198172()[_0x33ccc9(0x234)][_0x33ccc9(0x1fa)+_0x33ccc9(0x1be)]()),_0x2b0ba8(_0x33ccc9(0x5a5)+_0x33ccc9(0x326)+_0x33ccc9(0x201)+_0x33ccc9(0x390),async()=>{const _0x5cbe3e=_0x33ccc9,_0x6b1b9c=await prepareRuntime(shellConfig,{'syncOnly':!![]});return await configController[_0x5cbe3e(0x406)+'imePlugi'+'ns'](),{'ok':!![],'syncedAt':new Date()[_0x5cbe3e(0x520)+'ing'](),'manifest':_0x6b1b9c,'status':await getRuntimeResourceStatus()};}),_0x2b0ba8(_0x33ccc9(0x5a5)+'resource'+'-status',async()=>getRuntimeResourceStatus());}async function boot(){const _0x2dbaad=_0x5d452e;configController=createConfigController(shellConfig),mainLogger=createShellLogger(configController['paths'],_0x2dbaad(0x4b8)),ipcLogger=createShellLogger(configController[_0x2dbaad(0x371)],'ipc'),filesLogger=createShellLogger(configController[_0x2dbaad(0x371)],_0x2dbaad(0x568)),rendererLogger=createShellLogger(configController[_0x2dbaad(0x371)],_0x2dbaad(0x463)),productRuntime=await loadProductRuntime();const _0x8e0925=resolveWujieApiEndpoint();diagnosticsWriter=createDiagnosticsWriter({'logsDir':configController[_0x2dbaad(0x371)]['logsDir'],'appContext':{'productName':shellConfig['productN'+_0x2dbaad(0x554)],'appId':shellConfig['appId'],'appVersion':app['getVersi'+'on'](),'platform':process['platform'],'arch':process['arch'],..._0x8e0925?{'apiEndpoint':_0x8e0925}:{}}}),userEventWriter=createUserEventWriter({'logsDir':configController[_0x2dbaad(0x371)][_0x2dbaad(0x3e8)],'diagnosticsWriter':diagnosticsWriter});const _0x384f3a=await loadCreateUpdateController({'logger':mainLogger});updateController=_0x384f3a({'shellConfig':shellConfig,'appName':()=>app[_0x2dbaad(0x548)],'appVersion':()=>app['getVersi'+'on'](),'broadcast':broadcast,'logger':mainLogger,'prepareQuitAndInstall':async()=>{const _0x2db79d=_0x2dbaad;await stopGatewayBeforeQuit(_0x2db79d(0x58a)+_0x2db79d(0x245)+'g\x20update');}}),updateController[_0x2dbaad(0x4be)+'ze'](),registerProcessLogHooks(),registerProtocolHandlers(),installApplicationMenu(),mainLogger?.[_0x2dbaad(0x1ba)]('electron'+_0x2dbaad(0x2c9)+'ot\x20start'+'ed',{'appVersion':app[_0x2dbaad(0x4f5)+'on'](),'electronVersion':process[_0x2dbaad(0x35d)][_0x2dbaad(0x35c)],'nodeVersion':process[_0x2dbaad(0x35d)][_0x2dbaad(0x26a)],'chromeVersion':process[_0x2dbaad(0x35d)][_0x2dbaad(0x19f)],'platform':process[_0x2dbaad(0x1a6)],'arch':process['arch'],'mode':getMode(),'projectRoot':shellConfig['projectR'+'oot'],'configPath':shellConfig[_0x2dbaad(0x243)+'th'],'dataDir':shellConfig[_0x2dbaad(0x26c)],'electronUserData':app[_0x2dbaad(0x494)](_0x2dbaad(0x486)),'devToolsEnabled':isDevToolsEnabled(),'devToolsFlagPath':resolveDevToolsFlagPath(),'logsDir':configController[_0x2dbaad(0x371)][_0x2dbaad(0x3e8)],'rendererUrl':process.env.VITE_DEV_SERVER_URL||APP_RENDERER_ENTRY_URL}),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app['getVersi'+'on'](),'productRuntimeHooks':gatewayRuntimeHooks,'userEventWriter':userEventWriter,'sessionSqliteStore':ensureSessionSqliteStore()}),typeof productRuntime[_0x2dbaad(0x374)+'roductCo'+_0x2dbaad(0x44e)]==='function'&&await productRuntime[_0x2dbaad(0x374)+'roductCo'+_0x2dbaad(0x44e)]({'configController':configController,'mainLogger':mainLogger}),typeof productRuntime[_0x2dbaad(0x374)+_0x2dbaad(0x46f)+'ta']===_0x2dbaad(0x291)?await productRuntime[_0x2dbaad(0x374)+'roductDa'+'ta']({'configController':configController,'generatedFilesStore':ensureGeneratedFilesStore(),'mainLogger':mainLogger,'sessionSqliteStore':ensureSessionSqliteStore()}):await ensureGeneratedFilesStore()[_0x2dbaad(0x246)+_0x2dbaad(0x3aa)+'d'](),attachGatewayBroadcastHandlers(gatewayController),ensureSessionDataService(),await installIpcHandlers(),ipcHandlersInstalled=!![],installAppRendererProtocolHandler(),installClawspaceProtocolHandler(),registerShellShortcuts(),await ensureMainWindow(),await gatewayController[_0x2dbaad(0x1dd)](),updateController[_0x2dbaad(0x439)+_0x2dbaad(0x18c)+'hecks'](),mainLogger?.[_0x2dbaad(0x1ba)](_0x2dbaad(0x35c)+'\x20main\x20bo'+_0x2dbaad(0x1db)+_0x2dbaad(0x488)),updateController['recordBo'+'otAfterI'+_0x2dbaad(0x315)]?.();}function registerProcessLogHooks(){const _0x3cb11b=_0x5d452e;if(registerProcessLogHooks[_0x3cb11b(0x49c)+'ed'])return;registerProcessLogHooks[_0x3cb11b(0x49c)+'ed']=!![],process['on'](_0x3cb11b(0x46b)+_0x3cb11b(0x4a7)+'n',_0x4c6863=>{const _0x4d2673=_0x3cb11b;mainLogger?.[_0x4d2673(0x416)]('uncaught'+_0x4d2673(0x432)+'on',summarizeError(_0x4c6863));}),process['on'](_0x3cb11b(0x2e2)+_0x3cb11b(0x4a0)+'on',_0x3c5813=>{const _0xe1cf1=_0x3cb11b;mainLogger?.[_0xe1cf1(0x416)]('unhandle'+_0xe1cf1(0x216)+'ion',summarizeError(_0x3c5813));}),app['on']('render-p'+_0x3cb11b(0x321)+_0x3cb11b(0x54a),(_0x51d668,_0x4adf6f,_0x332aa5)=>{const _0x13ea50=_0x3cb11b;mainLogger?.[_0x13ea50(0x416)](_0x13ea50(0x463)+_0x13ea50(0x420)+_0x13ea50(0x3e1),{'url':_0x4adf6f['getURL'](),'details':_0x332aa5});}),app['on'](_0x3cb11b(0x3e0)+'ocess-go'+'ne',(_0x51adfc,_0x45cd68)=>{const _0x314832=_0x3cb11b;mainLogger?.[_0x314832(0x416)]('child\x20pr'+_0x314832(0x564)+'ne',{'details':_0x45cd68});});}async function stopGatewayBeforeQuit(_0x20450d){const _0x305fc8=_0x5d452e;if(!gatewayController)return;const _0x5636f5=gatewayController,_0x5b68cb=Date['now']();mainLogger?.[_0x305fc8(0x1ba)](_0x20450d+(_0x305fc8(0x50d)+_0x305fc8(0x2d4)+'ay'),{'event':_0x20450d===_0x305fc8(0x58a)+_0x305fc8(0x245)+'g\x20update'?'update_g'+_0x305fc8(0x4f9)+_0x305fc8(0x48a)+'t':undefined}),await _0x5636f5[_0x305fc8(0x40c)](),gatewayController===_0x5636f5&&(gatewayController=null),mainLogger?.['info'](_0x20450d+(_0x305fc8(0x45d)+_0x305fc8(0x53e)+'d'),{'event':_0x20450d===_0x305fc8(0x58a)+_0x305fc8(0x245)+'g\x20update'?_0x305fc8(0x313)+_0x305fc8(0x4f9)+_0x305fc8(0x3b3):undefined,'elapsedMs':Date[_0x305fc8(0x521)]()-_0x5b68cb});}app['on'](_0x5d452e(0x367)+_0x5d452e(0x4d1)+'d',()=>{const _0x4dd081=_0x5d452e;if(process['platform']!=='darwin')app[_0x4dd081(0x324)]();}),app['on'](_0x5d452e(0x1ad),(_0x1a0ec3,_0x33399e)=>{const _0x5b5a5e=_0x5d452e;_0x1a0ec3[_0x5b5a5e(0x571)+_0x5b5a5e(0x397)](),mainLogger?.[_0x5b5a5e(0x558)](_0x5b5a5e(0x45b)+_0x5b5a5e(0x543)+_0x5b5a5e(0x449),{'url':summarizeProtocolUrl(_0x33399e),'hasShellConfig':Boolean(shellConfig)}),dispatchProtocolUrl(_0x33399e);}),shellConfig=await loadShellConfig(resolveProjectRoot()),configureElectronInstance(app,shellConfig);const gotSingleInstanceLock=app['requestS'+_0x5d452e(0x552)+_0x5d452e(0x2dc)+'k']({'appId':shellConfig[_0x5d452e(0x446)],'projectRoot':shellConfig[_0x5d452e(0x22d)+_0x5d452e(0x46e)]});!gotSingleInstanceLock?app['exit'](0x0):app['on']('second-i'+_0x5d452e(0x502),(_0x33a471,_0x8e369e)=>{const _0x98bc81=_0x5d452e,_0x442663=extractProtocolUrlFromArgs(_0x8e369e);mainLogger?.[_0x98bc81(0x558)]('second-i'+_0x98bc81(0x50c)+_0x98bc81(0x330),{'argc':Array[_0x98bc81(0x535)](_0x8e369e)?_0x8e369e[_0x98bc81(0x2b2)]:0x0,'hasShellConfig':Boolean(shellConfig),'hasProtocolUrl':Boolean(_0x442663),'protocolUrl':_0x442663?summarizeProtocolUrl(_0x442663):undefined});if(!resolveProtocolScheme()){pendingProtocolArgs=_0x8e369e;return;}if(_0x442663){dispatchProtocolUrl(_0x442663);return;}const _0x3a84cd=getUsableMainWindow();_0x3a84cd&&void showMainWindowFromExternalActivation(_0x3a84cd,_0x98bc81(0x429)+_0x98bc81(0x502))['catch'](_0x1a3d4d=>{const _0x2a47db=_0x98bc81;mainLogger?.[_0x2a47db(0x416)]('second-i'+'nstance\x20'+_0x2a47db(0x51d)+_0x2a47db(0x309)+_0x2a47db(0x25f),{'error':summarizeError(_0x1a3d4d)});});});app['on']('activate',async()=>{const _0x5ebc05=_0x5d452e;if(isQuitting){app[_0x5ebc05(0x324)]();return;}updateController?.[_0x5ebc05(0x270)+_0x5ebc05(0x35b)+_0x5ebc05(0x3fa)]('app_acti'+_0x5ebc05(0x473));const _0x25dbec=getUsableMainWindow();if(_0x25dbec&&(_0x25dbec[_0x5ebc05(0x32c)+_0x5ebc05(0x1c8)]()||!_0x25dbec[_0x5ebc05(0x44d)+'e']()))await showMainWindowFromExternalActivation(_0x25dbec,_0x5ebc05(0x3c3)+_0x5ebc05(0x473));else BrowserWindow[_0x5ebc05(0x22c)+_0x5ebc05(0x4bc)]()[_0x5ebc05(0x2b2)]===0x0&&shellConfig&&await ensureMainWindow();}),app['on'](_0x5d452e(0x190)+_0x5d452e(0x588),_0x32897d=>{const _0x470d9b=_0x5d452e;isQuitting=!![],updateController?.['markQuit'+'Observed'](),terminalManager?.[_0x470d9b(0x36b)](),terminalManager=null,productRuntimeHooks?.[_0x470d9b(0x36b)]?.();for(const _0xeef877 of Object[_0x470d9b(0x38f)](productRuntimeHooks))delete productRuntimeHooks[_0xeef877];requestIdHooks?.[_0x470d9b(0x36b)]?.();for(const _0x55e4b5 of Object[_0x470d9b(0x38f)](requestIdHooks))delete requestIdHooks[_0x55e4b5];if(updateController?.[_0x470d9b(0x37d)+'lingUpda'+'te']?.()){mainLogger?.['info']('before\x20q'+'uit:\x20upd'+_0x470d9b(0x3c2)+'all\x20in\x20p'+_0x470d9b(0x217)+_0x470d9b(0x50a)+_0x470d9b(0x2d6)+'\x20updater'+'\x20quit');return;}if(!gatewayController)return;_0x32897d[_0x470d9b(0x571)+'efault'](),void stopGatewayBeforeQuit(_0x470d9b(0x26f)+_0x470d9b(0x588))[_0x470d9b(0x48d)](()=>{const _0x37fad6=_0x470d9b;app[_0x37fad6(0x324)]();});}),app['on'](_0x5d452e(0x4f0)+'t',()=>{globalShortcut['unregist'+'er'](DEVTOOLS_ACCELERATOR);});gotSingleInstanceLock&&app[_0x5d452e(0x407)+'y']()[_0x5d452e(0x352)](boot)[_0x5d452e(0x297)](_0x399f5a=>{const _0x469760=_0x5d452e;bootError=_0x399f5a instanceof Error?_0x399f5a[_0x469760(0x2be)]:String(_0x399f5a),mainLogger?.[_0x469760(0x416)]('electron'+_0x469760(0x2c9)+_0x469760(0x4b7)+'d',summarizeError(_0x399f5a)),console['error'](_0x469760(0x320)+_0x469760(0x53f)+_0x469760(0x4fe)+'boot\x20ele'+'ctron\x20ma'+'in',_0x399f5a);});