@wujie-shell/core 1.0.4 → 1.0.6

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 -0
  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 _0x328474=_0xddaf;(function(_0x5467bd,_0x11e3e8){const _0x3e99d1=_0xddaf,_0x54754b=_0x5467bd();while(!![]){try{const _0x1878bd=-parseInt(_0x3e99d1(0x238))/0x1*(parseInt(_0x3e99d1(0x242))/0x2)+parseInt(_0x3e99d1(0x209))/0x3*(-parseInt(_0x3e99d1(0x222))/0x4)+parseInt(_0x3e99d1(0x20a))/0x5+parseInt(_0x3e99d1(0x227))/0x6*(parseInt(_0x3e99d1(0x204))/0x7)+-parseInt(_0x3e99d1(0x208))/0x8+parseInt(_0x3e99d1(0x1f5))/0x9+-parseInt(_0x3e99d1(0x236))/0xa*(-parseInt(_0x3e99d1(0x201))/0xb);if(_0x1878bd===_0x11e3e8)break;else _0x54754b['push'](_0x54754b['shift']());}catch(_0x208b64){_0x54754b['push'](_0x54754b['shift']());}}}(_0x2eb2,0xd540e));import{createHash}from'node:crypto';import{spawn}from'node:child_process';import{existsSync}from'node:fs';import{mkdir}from'node:fs/promises';function _0xddaf(_0x22b894,_0x3db520){_0x22b894=_0x22b894-0x1f4;const _0x2eb2f5=_0x2eb2();let _0xddaf8b=_0x2eb2f5[_0x22b894];return _0xddaf8b;}import{homedir,tmpdir}from'node:os';import{basename,isAbsolute,join,relative,resolve}from'node:path';import{createFileLogger,normalizeLogLevel,redactLogValue}from'@wujie-shell/logger';const LOG_MAX_BYTES=0x2*0x400*0x400,LOG_KEEP_COUNT=0x2,loggers=new Map(),CONTENT_PREVIEW_LENGTH=0xf0,URL_SCHEME_RE=/^[A-Za-z][A-Za-z\d+.-]*:\/\//;let activeLogLevel=null;export function createShellLogger(_0x57441f,_0x5f4fc9,_0x316310=_0x5f4fc9){const _0x1d1eef=_0xddaf,_0x368c01=_0x57441f?.[_0x1d1eef(0x219)];if(!_0x368c01||!_0x5f4fc9)return null;const _0x9dfbd3=normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||activeLogLevel||_0x57441f?.[_0x1d1eef(0x228)],_0x1d1eef(0x21a)),_0x103938=join(_0x368c01,_0x5f4fc9,_0x5f4fc9+_0x1d1eef(0x20b)),_0x50c5a3=_0x103938+':'+_0x316310;return!loggers['has'](_0x50c5a3)&&loggers['set'](_0x50c5a3,createFileLogger({'filePath':_0x103938,'context':_0x316310,'maxBytes':LOG_MAX_BYTES,'keepCount':LOG_KEEP_COUNT,'level':_0x9dfbd3})),loggers[_0x1d1eef(0x235)](_0x50c5a3);}export function setShellLoggerLevel(_0x43bcd8){const _0x15c3f2=_0xddaf,_0x466bfc=normalizeLogLevel(_0x43bcd8,_0x15c3f2(0x21a));activeLogLevel=_0x466bfc;const _0x24e706=normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||activeLogLevel,_0x15c3f2(0x21a));for(const _0x50bd87 of loggers[_0x15c3f2(0x23c)]()){_0x50bd87?.['setLevel']?.(_0x24e706);}return _0x24e706;}export function getShellLoggerLevel(_0x11ecaa){const _0x72476f=_0xddaf;return normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||activeLogLevel||_0x11ecaa?.[_0x72476f(0x228)],'info');}export function toHomePath(_0x256cf0){const _0x4152f3=typeof _0x256cf0==='string'?_0x256cf0:'';if(!_0x4152f3)return'';const _0x4cbcbd=homedir(),_0x209e68=isAbsolute(_0x4152f3)?_0x4152f3:resolve(_0x4152f3),_0x539db6=relative(_0x4cbcbd,_0x209e68);if(!_0x539db6||!_0x539db6['startsWi'+'th']('..')&&!isAbsolute(_0x539db6))return _0x539db6?'~/'+_0x539db6:'~';return _0x209e68;}export function hashText(_0x181101){const _0x27db82=_0xddaf;return createHash(_0x27db82(0x240))[_0x27db82(0x22a)](String(_0x181101))[_0x27db82(0x212)]('hex')[_0x27db82(0x21c)](0x0,0x10);}export function truncateText(_0x4e1c22,_0x4e3b76=CONTENT_PREVIEW_LENGTH){const _0x5ef534=_0xddaf,_0x347899=String(_0x4e1c22??'')[_0x5ef534(0x207)](/\s+/g,'\x20')[_0x5ef534(0x1f6)]();if(_0x347899[_0x5ef534(0x1f8)]<=_0x4e3b76)return _0x347899;return _0x347899['slice'](0x0,_0x4e3b76)+_0x5ef534(0x1f7);}export function summarizeText(_0x5a955d,_0x4827b8=CONTENT_PREVIEW_LENGTH){const _0x49e6f0=_0xddaf,_0x3381b1=String(_0x5a955d??'');return{'length':_0x3381b1[_0x49e6f0(0x1f8)],'hash':hashText(_0x3381b1),'preview':truncateText(_0x3381b1,_0x4827b8),'truncated':_0x3381b1['length']>_0x4827b8};}export function summarizeError(_0x17630a){const _0x3e8603=_0xddaf;if(_0x17630a instanceof Error)return{'name':_0x17630a[_0x3e8603(0x21b)],'message':_0x17630a[_0x3e8603(0x246)],'stack':_0x17630a[_0x3e8603(0x200)]};return{'message':String(_0x17630a)};}function _0x2eb2(){const _0x72e142=['includes','digest','ot\x20found','cwd','Array','Compress','win32','\x20-Destin','logsDir','info','name','slice','string','tinue\x27;','add','\x20-Force','stderr','531188VwwSNi','sPrefere','ll.exe','\x20failed\x20','[Circula','6dGlXtv','logLevel','entlyCon','update','isArray','dev','$Progres','utf16le','SIGKILL','from','ing','ignore','zip','textPrev','get','3185050HJkQoN','join','2cVFmJE','\x20timed\x20o','data','entries','values','timeoutM','ectory\x20n','iewLengt','sha256','array','933774OsvMco','-NoProfi','map','test','message','env','.zip','toString','11712672TWuJxP','trim','...','length','nce=\x27Sil','with\x20cod','stringif','\x20-Path\x20','has','close','base64','stack','22UlQsix','Command','logs\x20dir','8078322HCfXDU','ut\x20after','filter','replace','13219536oIgDjs','15KvDesT','5156115zDPfQU','.log','-Encoded','maxDepth','kill','platform','ell-logs'];_0x2eb2=function(){return _0x72e142;};return _0x2eb2();}function summarizePathValue(_0x169660){const _0x41af46=_0xddaf;if(typeof _0x169660!==_0x41af46(0x21d))return _0x169660;if(URL_SCHEME_RE[_0x41af46(0x245)](_0x169660))return _0x169660;if(_0x169660[_0x41af46(0x211)]('/')||_0x169660['includes']('\x5c'))return toHomePath(_0x169660);return _0x169660;}export function summarizePayload(_0x5cd8a8,_0x922802={}){const _0x2cec4b=_0xddaf,_0x42fe1e=_0x922802[_0x2cec4b(0x20d)]??0x4,_0x18d711=new WeakSet();function _0x303fad(_0x391642,_0x5539a5,_0x40dcfb=''){const _0x1a2e2d=_0x2cec4b;if(_0x391642==null)return _0x391642;if(typeof _0x391642===_0x1a2e2d(0x21d)){if(/message|content|prompt|text|body/i[_0x1a2e2d(0x245)](_0x40dcfb))return summarizeText(_0x391642,_0x922802[_0x1a2e2d(0x234)+_0x1a2e2d(0x23f)+'h']);return summarizePathValue(_0x391642);}if(typeof _0x391642!=='object')return _0x391642;if(_0x391642 instanceof Error)return summarizeError(_0x391642);if(_0x18d711[_0x1a2e2d(0x1fd)](_0x391642))return _0x1a2e2d(0x226)+'r]';if(_0x5539a5>=_0x42fe1e)return'['+(Array[_0x1a2e2d(0x22b)](_0x391642)?_0x1a2e2d(0x215):'Object')+']';_0x18d711[_0x1a2e2d(0x21f)](_0x391642);if(Array[_0x1a2e2d(0x22b)](_0x391642))return{'type':_0x1a2e2d(0x241),'length':_0x391642['length'],'items':_0x391642[_0x1a2e2d(0x21c)](0x0,0x5)[_0x1a2e2d(0x244)](_0x56293f=>_0x303fad(_0x56293f,_0x5539a5+0x1,_0x40dcfb)),'truncated':_0x391642[_0x1a2e2d(0x1f8)]>0x5};const _0x5c7aab={};for(const [_0x3baf6c,_0xef8cbe]of Object[_0x1a2e2d(0x23b)](_0x391642)){_0x5c7aab[_0x3baf6c]=_0x303fad(_0xef8cbe,_0x5539a5+0x1,_0x3baf6c);}return redactLogValue(_0x5c7aab);}return _0x303fad(_0x5cd8a8,0x0);}export function summarizeFilePaths(_0x39f8fc=[]){const _0xca4d0=_0xddaf;return(Array['isArray'](_0x39f8fc)?_0x39f8fc:[])['map'](_0x39edd1=>String(_0x39edd1||'')[_0xca4d0(0x1f6)]())[_0xca4d0(0x206)](Boolean)['map'](_0x4b4ec6=>({'path':toHomePath(_0x4b4ec6),'name':basename(_0x4b4ec6)}));}function run(_0x45704f,_0x361429,_0x259372={}){return new Promise((_0x1ba63c,_0x1b97d7)=>{const _0x35dd2e=_0xddaf,_0x2b1b76=Number['isFinite'](_0x259372[_0x35dd2e(0x23d)+'s'])&&_0x259372[_0x35dd2e(0x23d)+'s']>0x0?_0x259372[_0x35dd2e(0x23d)+'s']:0x0,_0x3fd350=spawn(_0x45704f,_0x361429,{'cwd':_0x259372[_0x35dd2e(0x214)],'env':{...process.env,..._0x259372[_0x35dd2e(0x247)]??{}},'stdio':['ignore',_0x35dd2e(0x232),'pipe']});let _0x2c3d14='',_0x121078=![];const _0x300cdd=_0xceea91=>_0x49d392=>{if(_0x121078)return;_0x121078=!![];if(_0x34abc2)clearTimeout(_0x34abc2);_0xceea91(_0x49d392);},_0x713392=_0x300cdd(_0x1ba63c),_0x266aa5=_0x300cdd(_0x1b97d7),_0x34abc2=_0x2b1b76>0x0?setTimeout(()=>{const _0x102249=_0x35dd2e;_0x3fd350[_0x102249(0x20e)](_0x102249(0x22f)),_0x266aa5(new Error(_0x45704f+(_0x102249(0x239)+_0x102249(0x205)+'\x20')+_0x2b1b76+'ms'));},_0x2b1b76):null;_0x3fd350[_0x35dd2e(0x221)]?.['on'](_0x35dd2e(0x23a),_0x3abb00=>{const _0xa21832=_0x35dd2e;_0x2c3d14+=_0x3abb00[_0xa21832(0x1f4)]();}),_0x3fd350['on']('error',_0x266aa5),_0x3fd350['on'](_0x35dd2e(0x1fe),_0x393ae8=>{const _0x544b2e=_0x35dd2e;if(_0x393ae8===0x0){_0x713392();return;}_0x266aa5(new Error(_0x45704f+(_0x544b2e(0x225)+_0x544b2e(0x1fa)+'e=')+_0x393ae8+':\x20'+_0x2c3d14));});});}export async function exportLogsArchive({logsDir:_0x1bccab,targetDir:_0x1c8990,appVersion:appVersion=_0x328474(0x22c)}){const _0x4e8881=_0x328474;if(!_0x1bccab||!existsSync(_0x1bccab))throw new Error(_0x4e8881(0x203)+_0x4e8881(0x23e)+_0x4e8881(0x213)+':\x20'+(_0x1bccab||''));const _0x3df6b7=String(appVersion||_0x4e8881(0x22c))['replace'](/[^A-Za-z0-9._-]/g,'_'),_0x3cc020=new Date()['toISOStr'+_0x4e8881(0x231)]()[_0x4e8881(0x207)](/[-:]/g,'')[_0x4e8881(0x207)](/\..+$/,''),_0x46b333=_0x1c8990||tmpdir();await mkdir(_0x46b333,{'recursive':!![]});const _0x4c31aa=join(_0x46b333,'wujie-sh'+_0x4e8881(0x210)+'-'+_0x3cc020+'-'+_0x3df6b7+_0x4e8881(0x248));if(process[_0x4e8881(0x20f)]===_0x4e8881(0x217)){const _0x2d56a3=[_0x4e8881(0x22d)+_0x4e8881(0x223)+_0x4e8881(0x1f9)+_0x4e8881(0x229)+_0x4e8881(0x21e),_0x4e8881(0x216)+'-Archive'+_0x4e8881(0x1fc)+JSON[_0x4e8881(0x1fb)+'y'](join(_0x1bccab,'*'))+(_0x4e8881(0x218)+'ationPat'+'h\x20')+JSON[_0x4e8881(0x1fb)+'y'](_0x4c31aa)+_0x4e8881(0x220)][_0x4e8881(0x237)]('\x20'),_0x34d405=Buffer[_0x4e8881(0x230)](_0x2d56a3,_0x4e8881(0x22e))[_0x4e8881(0x1f4)](_0x4e8881(0x1ff));await run('powershe'+_0x4e8881(0x224),[_0x4e8881(0x243)+'le',_0x4e8881(0x20c)+_0x4e8881(0x202),_0x34d405],{'timeoutMs':0x7530});}else await run(_0x4e8881(0x233),['-r',_0x4c31aa,'.'],{'cwd':_0x1bccab,'timeoutMs':0x7530});return{'ok':!![],'path':_0x4c31aa};}
1
+ function _0x2c96(_0x3934c2,_0x3339c7){_0x3934c2=_0x3934c2-0x19d;const _0x2f1161=_0x2f11();let _0x2c9625=_0x2f1161[_0x3934c2];return _0x2c9625;}(function(_0x5b1273,_0x52034c){const _0x1c0fe1=_0x2c96,_0x8e029b=_0x5b1273();while(!![]){try{const _0x514b23=-parseInt(_0x1c0fe1(0x1af))/0x1+-parseInt(_0x1c0fe1(0x1e9))/0x2*(-parseInt(_0x1c0fe1(0x1b1))/0x3)+parseInt(_0x1c0fe1(0x1e1))/0x4*(-parseInt(_0x1c0fe1(0x1a2))/0x5)+parseInt(_0x1c0fe1(0x1b6))/0x6*(parseInt(_0x1c0fe1(0x1a0))/0x7)+parseInt(_0x1c0fe1(0x1aa))/0x8*(-parseInt(_0x1c0fe1(0x1a4))/0x9)+parseInt(_0x1c0fe1(0x1a9))/0xa*(-parseInt(_0x1c0fe1(0x1d8))/0xb)+-parseInt(_0x1c0fe1(0x1e5))/0xc*(-parseInt(_0x1c0fe1(0x1b7))/0xd);if(_0x514b23===_0x52034c)break;else _0x8e029b['push'](_0x8e029b['shift']());}catch(_0x79d51b){_0x8e029b['push'](_0x8e029b['shift']());}}}(_0x2f11,0x82c61));import{createHash}from'node:crypto';import{spawn}from'node:child_process';import{existsSync}from'node:fs';function _0x2f11(){const _0x5cca9e=['57DUnQwC','message','logs\x20dir','maxDepth','pipe','36NSjtXG','1811199VMPKwF','ignore','Compress','.log','logsDir','hex','Array','info','ectory\x20n','Object','isArray','\x20timed\x20o','slice','textPrev','stack','length','\x20failed\x20','startsWi','includes','env','join','object','toString','-NoProfi','-Encoded','platform','entlyCon','ll.exe','array','values','close','get','with\x20cod','11jcKByY','\x20-Destin','stringif','filter','name','data','\x20-Path\x20','has','test','41032pUMAbi','setLevel','.zip','string','252mLhbGI','timeoutM','cwd','trim','6654uRODnO','digest','add','ut\x20after','error','win32','logLevel','zip','277018RhBUPI','SIGKILL','250fsnuIU','map','4384647btOpAU','tinue\x27;','nce=\x27Sil','ell-logs','...','1373950iYbYdu','16uBcNwf','isFinite','utf16le','replace','base64','1066130utFskh','sPrefere'];_0x2f11=function(){return _0x5cca9e;};return _0x2f11();}import{mkdir}from'node:fs/promises';import{homedir,tmpdir}from'node:os';import{basename,isAbsolute,join,relative,resolve}from'node:path';import{createFileLogger,normalizeLogLevel,redactLogValue}from'@wujie-shell/logger';const LOG_MAX_BYTES=0x2*0x400*0x400,LOG_KEEP_COUNT=0x2,loggers=new Map(),CONTENT_PREVIEW_LENGTH=0xf0,URL_SCHEME_RE=/^[A-Za-z][A-Za-z\d+.-]*:\/\//;let activeLogLevel=null;export function createShellLogger(_0x52de49,_0x423551,_0x3169a2=_0x423551){const _0x270713=_0x2c96,_0x562be0=_0x52de49?.[_0x270713(0x1bb)];if(!_0x562be0||!_0x423551)return null;const _0x5079d8=normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||activeLogLevel||_0x52de49?.[_0x270713(0x19e)],_0x270713(0x1be)),_0x52fb84=join(_0x562be0,_0x423551,_0x423551+_0x270713(0x1ba)),_0x22e0fc=_0x52fb84+':'+_0x3169a2;return!loggers[_0x270713(0x1df)](_0x22e0fc)&&loggers['set'](_0x22e0fc,createFileLogger({'filePath':_0x52fb84,'context':_0x3169a2,'maxBytes':LOG_MAX_BYTES,'keepCount':LOG_KEEP_COUNT,'level':_0x5079d8})),loggers[_0x270713(0x1d6)](_0x22e0fc);}export function setShellLoggerLevel(_0x1931b1){const _0x48576f=_0x2c96,_0x2b150a=normalizeLogLevel(_0x1931b1,_0x48576f(0x1be));activeLogLevel=_0x2b150a;const _0x47a5de=normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||activeLogLevel,_0x48576f(0x1be));for(const _0x1d8292 of loggers[_0x48576f(0x1d4)]()){_0x1d8292?.[_0x48576f(0x1e2)]?.(_0x47a5de);}return _0x47a5de;}export function getShellLoggerLevel(_0x551bca){const _0x5e3a1e=_0x2c96;return normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||activeLogLevel||_0x551bca?.[_0x5e3a1e(0x19e)],_0x5e3a1e(0x1be));}export function toHomePath(_0x4e17ee){const _0x167a12=_0x2c96,_0x4a6115=typeof _0x4e17ee==='string'?_0x4e17ee:'';if(!_0x4a6115)return'';const _0x5a3e8c=homedir(),_0x2e865c=isAbsolute(_0x4a6115)?_0x4a6115:resolve(_0x4a6115),_0x4791bf=relative(_0x5a3e8c,_0x2e865c);if(!_0x4791bf||!_0x4791bf[_0x167a12(0x1c8)+'th']('..')&&!isAbsolute(_0x4791bf))return _0x4791bf?'~/'+_0x4791bf:'~';return _0x2e865c;}export function hashText(_0x5e1173){const _0x206fe8=_0x2c96;return createHash('sha256')['update'](String(_0x5e1173))[_0x206fe8(0x1ea)](_0x206fe8(0x1bc))[_0x206fe8(0x1c3)](0x0,0x10);}export function truncateText(_0x305fd4,_0x4d9f16=CONTENT_PREVIEW_LENGTH){const _0x1a525c=_0x2c96,_0x47ad2e=String(_0x305fd4??'')['replace'](/\s+/g,'\x20')['trim']();if(_0x47ad2e['length']<=_0x4d9f16)return _0x47ad2e;return _0x47ad2e[_0x1a525c(0x1c3)](0x0,_0x4d9f16)+_0x1a525c(0x1a8);}export function summarizeText(_0x134534,_0x3eead=CONTENT_PREVIEW_LENGTH){const _0x37c762=_0x2c96,_0x2d9bb1=String(_0x134534??'');return{'length':_0x2d9bb1[_0x37c762(0x1c6)],'hash':hashText(_0x2d9bb1),'preview':truncateText(_0x2d9bb1,_0x3eead),'truncated':_0x2d9bb1[_0x37c762(0x1c6)]>_0x3eead};}export function summarizeError(_0x5c1108){const _0x384446=_0x2c96;if(_0x5c1108 instanceof Error)return{'name':_0x5c1108[_0x384446(0x1dc)],'message':_0x5c1108[_0x384446(0x1b2)],'stack':_0x5c1108[_0x384446(0x1c5)]};return{'message':String(_0x5c1108)};}function summarizePathValue(_0xc506eb){const _0x556ba2=_0x2c96;if(typeof _0xc506eb!==_0x556ba2(0x1e4))return _0xc506eb;if(URL_SCHEME_RE[_0x556ba2(0x1e0)](_0xc506eb))return _0xc506eb;if(_0xc506eb[_0x556ba2(0x1c9)]('/')||_0xc506eb['includes']('\x5c'))return toHomePath(_0xc506eb);return _0xc506eb;}export function summarizePayload(_0x5ce0d4,_0x57b4fa={}){const _0x5e0dd2=_0x2c96,_0xe151ff=_0x57b4fa[_0x5e0dd2(0x1b4)]??0x4,_0x54f401=new WeakSet();function _0x157ef8(_0x4e50ab,_0x5345e3,_0x322a21=''){const _0x3b9a5e=_0x5e0dd2;if(_0x4e50ab==null)return _0x4e50ab;if(typeof _0x4e50ab===_0x3b9a5e(0x1e4)){if(/message|content|prompt|text|body/i[_0x3b9a5e(0x1e0)](_0x322a21))return summarizeText(_0x4e50ab,_0x57b4fa[_0x3b9a5e(0x1c4)+'iewLengt'+'h']);return summarizePathValue(_0x4e50ab);}if(typeof _0x4e50ab!==_0x3b9a5e(0x1cc))return _0x4e50ab;if(_0x4e50ab instanceof Error)return summarizeError(_0x4e50ab);if(_0x54f401[_0x3b9a5e(0x1df)](_0x4e50ab))return'[Circula'+'r]';if(_0x5345e3>=_0xe151ff)return'['+(Array[_0x3b9a5e(0x1c1)](_0x4e50ab)?_0x3b9a5e(0x1bd):_0x3b9a5e(0x1c0))+']';_0x54f401[_0x3b9a5e(0x1eb)](_0x4e50ab);if(Array['isArray'](_0x4e50ab))return{'type':_0x3b9a5e(0x1d3),'length':_0x4e50ab[_0x3b9a5e(0x1c6)],'items':_0x4e50ab['slice'](0x0,0x5)[_0x3b9a5e(0x1a3)](_0xe15e29=>_0x157ef8(_0xe15e29,_0x5345e3+0x1,_0x322a21)),'truncated':_0x4e50ab[_0x3b9a5e(0x1c6)]>0x5};const _0x329229={};for(const [_0x41e797,_0x52e782]of Object['entries'](_0x4e50ab)){_0x329229[_0x41e797]=_0x157ef8(_0x52e782,_0x5345e3+0x1,_0x41e797);}return redactLogValue(_0x329229);}return _0x157ef8(_0x5ce0d4,0x0);}export function summarizeFilePaths(_0x13eb2b=[]){const _0x24e424=_0x2c96;return(Array['isArray'](_0x13eb2b)?_0x13eb2b:[])[_0x24e424(0x1a3)](_0x19c111=>String(_0x19c111||'')[_0x24e424(0x1e8)]())[_0x24e424(0x1db)](Boolean)['map'](_0x55d5a0=>({'path':toHomePath(_0x55d5a0),'name':basename(_0x55d5a0)}));}function run(_0x4e1241,_0x1fa7bb,_0x1f665b={}){return new Promise((_0x42ccae,_0x40b3be)=>{const _0x2380e5=_0x2c96,_0x44ae77=Number[_0x2380e5(0x1ab)](_0x1f665b[_0x2380e5(0x1e6)+'s'])&&_0x1f665b[_0x2380e5(0x1e6)+'s']>0x0?_0x1f665b[_0x2380e5(0x1e6)+'s']:0x0,_0x2f8d2a=spawn(_0x4e1241,_0x1fa7bb,{'cwd':_0x1f665b[_0x2380e5(0x1e7)],'env':{...process.env,..._0x1f665b[_0x2380e5(0x1ca)]??{}},'stdio':[_0x2380e5(0x1b8),_0x2380e5(0x1b8),_0x2380e5(0x1b5)]});let _0x2182cc='',_0x53f6c9=![];const _0xda1a93=_0x5037=>_0x4f8f0d=>{if(_0x53f6c9)return;_0x53f6c9=!![];if(_0x4f9244)clearTimeout(_0x4f9244);_0x5037(_0x4f8f0d);},_0x2e0a70=_0xda1a93(_0x42ccae),_0x3d3c3c=_0xda1a93(_0x40b3be),_0x4f9244=_0x44ae77>0x0?setTimeout(()=>{const _0x16b514=_0x2380e5;_0x2f8d2a['kill'](_0x16b514(0x1a1)),_0x3d3c3c(new Error(_0x4e1241+(_0x16b514(0x1c2)+_0x16b514(0x1ec)+'\x20')+_0x44ae77+'ms'));},_0x44ae77):null;_0x2f8d2a['stderr']?.['on'](_0x2380e5(0x1dd),_0xd38aa=>{const _0x3775bd=_0x2380e5;_0x2182cc+=_0xd38aa[_0x3775bd(0x1cd)]();}),_0x2f8d2a['on'](_0x2380e5(0x1ed),_0x3d3c3c),_0x2f8d2a['on'](_0x2380e5(0x1d5),_0x394d30=>{const _0x63f42b=_0x2380e5;if(_0x394d30===0x0){_0x2e0a70();return;}_0x3d3c3c(new Error(_0x4e1241+(_0x63f42b(0x1c7)+_0x63f42b(0x1d7)+'e=')+_0x394d30+':\x20'+_0x2182cc));});});}export async function exportLogsArchive({logsDir:_0x5b1f29,targetDir:_0x35165a,appVersion:appVersion='dev'}){const _0x14aa98=_0x2c96;if(!_0x5b1f29||!existsSync(_0x5b1f29))throw new Error(_0x14aa98(0x1b3)+_0x14aa98(0x1bf)+'ot\x20found'+':\x20'+(_0x5b1f29||''));const _0xe8f61a=String(appVersion||'dev')[_0x14aa98(0x1ad)](/[^A-Za-z0-9._-]/g,'_'),_0x5312c2=new Date()['toISOStr'+'ing']()[_0x14aa98(0x1ad)](/[-:]/g,'')[_0x14aa98(0x1ad)](/\..+$/,''),_0x38db84=_0x35165a||tmpdir();await mkdir(_0x38db84,{'recursive':!![]});const _0x1f6a77=join(_0x38db84,'wujie-sh'+_0x14aa98(0x1a7)+'-'+_0x5312c2+'-'+_0xe8f61a+_0x14aa98(0x1e3));if(process[_0x14aa98(0x1d0)]===_0x14aa98(0x19d)){const _0x2eb547=['$Progres'+_0x14aa98(0x1b0)+_0x14aa98(0x1a6)+_0x14aa98(0x1d1)+_0x14aa98(0x1a5),_0x14aa98(0x1b9)+'-Archive'+_0x14aa98(0x1de)+JSON['stringif'+'y'](join(_0x5b1f29,'*'))+(_0x14aa98(0x1d9)+'ationPat'+'h\x20')+JSON[_0x14aa98(0x1da)+'y'](_0x1f6a77)+'\x20-Force'][_0x14aa98(0x1cb)]('\x20'),_0x543bfd=Buffer['from'](_0x2eb547,_0x14aa98(0x1ac))[_0x14aa98(0x1cd)](_0x14aa98(0x1ae));await run('powershe'+_0x14aa98(0x1d2),[_0x14aa98(0x1ce)+'le',_0x14aa98(0x1cf)+'Command',_0x543bfd],{'timeoutMs':0x7530});}else await run(_0x14aa98(0x19f),['-r',_0x1f6a77,'.'],{'cwd':_0x5b1f29,'timeoutMs':0x7530});return{'ok':!![],'path':_0x1f6a77};}
@@ -1 +1 @@
1
- (function(_0x65aa95,_0x9f099f){const _0x302c1f=_0x57f0,_0x591b3e=_0x65aa95();while(!![]){try{const _0x30b974=-parseInt(_0x302c1f(0xd0))/0x1+-parseInt(_0x302c1f(0xf0))/0x2+parseInt(_0x302c1f(0xd6))/0x3+parseInt(_0x302c1f(0xe4))/0x4*(parseInt(_0x302c1f(0xe6))/0x5)+parseInt(_0x302c1f(0xe1))/0x6*(parseInt(_0x302c1f(0xec))/0x7)+parseInt(_0x302c1f(0xce))/0x8*(-parseInt(_0x302c1f(0xcd))/0x9)+-parseInt(_0x302c1f(0xcf))/0xa;if(_0x30b974===_0x9f099f)break;else _0x591b3e['push'](_0x591b3e['shift']());}catch(_0x2bc4cb){_0x591b3e['push'](_0x591b3e['shift']());}}}(_0x4265,0x3a5a4));import{join}from'node:path';import{createFileLogger,normalizeLogLevel}from'@wujie-shell/logger';const RUNTIME_LOG_MAX_BYTES=0x2*0x400*0x400,RUNTIME_LOG_KEEP_COUNT=0x2,runtimeLoggers=new Map();let runtimeLogLevel=null;export function createRuntimeLogger(_0x4ac4a7,_0x288475='runtime'){const _0x40b565=_0x57f0,_0x5ba607=_0x4ac4a7?.[_0x40b565(0xd5)];if(!_0x5ba607)return null;const _0x319c91=normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||runtimeLogLevel||_0x4ac4a7?.[_0x40b565(0xfa)],'info'),_0x109f1d=join(_0x5ba607,_0x40b565(0xe2),_0x40b565(0xe7)+_0x40b565(0xd1)),_0x465286=_0x109f1d+':'+_0x288475;return!runtimeLoggers[_0x40b565(0xdd)](_0x465286)&&runtimeLoggers[_0x40b565(0xee)](_0x465286,createFileLogger({'filePath':_0x109f1d,'context':_0x288475,'maxBytes':RUNTIME_LOG_MAX_BYTES,'keepCount':RUNTIME_LOG_KEEP_COUNT,'level':_0x319c91})),runtimeLoggers[_0x40b565(0xf6)](_0x465286);}export function setRuntimeLoggerLevel(_0x370e44){const _0x5836ea=_0x57f0,_0x5a0dfc=normalizeLogLevel(_0x370e44,_0x5836ea(0xea));runtimeLogLevel=_0x5a0dfc;const _0x7b719c=normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||runtimeLogLevel,_0x5836ea(0xea));for(const _0x27d16c of runtimeLoggers['values']()){_0x27d16c?.['setLevel']?.(_0x7b719c);}return _0x7b719c;}function _0x4265(){const _0x34f4dd=['logLevel','logsDirN','product','442557deEkIR','32nOcZjb','5134960vFkOPL','3634AbtPwP','log','ginPaths','ath','Version','logsDir','1080939Bcfwul','length','dAt','ame','workflow','skills','oot','has','generate','ion','dataDirN','822UlmLRa','runtime','llPaths','12YmpGuF','LocalPlu','796660HSoUUi','runtime.','openclaw','sDir','info','ecs','17353rXkmoe','plugins','set','productN','450196ziCPRB','LocalAge','pluginSp','LocalSki','logger','wBin','get','nodeVers','installP','resolved'];_0x4265=function(){return _0x34f4dd;};return _0x4265();}function _0x57f0(_0x17e560,_0x53cab5){_0x17e560=_0x17e560-0xcb;const _0x4265e0=_0x4265();let _0x57f0c7=_0x4265e0[_0x17e560];return _0x57f0c7;}export function summarizeShellConfig(_0x59c326){const _0x5baff5=_0x57f0;return{'appId':_0x59c326['appId'],'productName':_0x59c326[_0x5baff5(0xef)+_0x5baff5(0xd9)],'projectRoot':_0x59c326['projectR'+_0x5baff5(0xdc)],'dataDir':_0x59c326['dataDir'],'dataDirName':_0x59c326[_0x5baff5(0xe0)+_0x5baff5(0xd9)],'logsDirName':_0x59c326[_0x5baff5(0xf4)]?.[_0x5baff5(0xcb)+_0x5baff5(0xd9)],'logsDir':_0x59c326[_0x5baff5(0xf4)]?.[_0x5baff5(0xd5)],'openclawVersion':_0x59c326[_0x5baff5(0xe8)]?.[_0x5baff5(0xe8)+_0x5baff5(0xd4)],'nodeVersion':_0x59c326[_0x5baff5(0xe8)]?.[_0x5baff5(0xf7)+_0x5baff5(0xdf)],'pluginSpecCount':_0x59c326['openclaw']?.[_0x5baff5(0xf2)+_0x5baff5(0xeb)]?.[_0x5baff5(0xd7)]??0x0,'localPluginCount':_0x59c326['openclaw']?.[_0x5baff5(0xf9)+_0x5baff5(0xe5)+_0x5baff5(0xd2)]?.['length']??0x0,'localAgentCount':_0x59c326[_0x5baff5(0xe8)]?.[_0x5baff5(0xf9)+_0x5baff5(0xf1)+'ntPaths']?.[_0x5baff5(0xd7)]??0x0,'localSkillCount':_0x59c326[_0x5baff5(0xe8)]?.['resolved'+_0x5baff5(0xf3)+_0x5baff5(0xe3)]?.['length']??0x0,'localAgentPaths':_0x59c326[_0x5baff5(0xe8)]?.['resolved'+_0x5baff5(0xf1)+'ntPaths'],'localSkillPaths':_0x59c326[_0x5baff5(0xe8)]?.['resolved'+_0x5baff5(0xf3)+'llPaths'],'workflowsDir':_0x59c326['openclaw']?.[_0x5baff5(0xda)+_0x5baff5(0xe9)]};}export function summarizeRuntimeManifest(_0x57603a){const _0x44f8cf=_0x57f0;return{'generatedAt':_0x57603a?.[_0x44f8cf(0xde)+_0x44f8cf(0xd8)],'openclawVersion':_0x57603a?.[_0x44f8cf(0xe8)+_0x44f8cf(0xd4)],'nodeVersion':_0x57603a?.[_0x44f8cf(0xf7)+_0x44f8cf(0xdf)],'pluginCount':Array['isArray'](_0x57603a?.[_0x44f8cf(0xed)])?_0x57603a['plugins'][_0x44f8cf(0xd7)]:0x0,'pluginSpecCount':Array['isArray'](_0x57603a?.[_0x44f8cf(0xf2)+_0x44f8cf(0xeb)])?_0x57603a[_0x44f8cf(0xf2)+_0x44f8cf(0xeb)][_0x44f8cf(0xd7)]:0x0,'agentsInstallPath':_0x57603a?.['agents']?.[_0x44f8cf(0xf8)+_0x44f8cf(0xd3)],'skillsInstallPath':_0x57603a?.[_0x44f8cf(0xdb)]?.[_0x44f8cf(0xf8)+'ath'],'wujieclawBin':_0x57603a?.['wujiecla'+_0x44f8cf(0xf5)],'product':_0x57603a?.[_0x44f8cf(0xcc)]};}
1
+ (function(_0x4ce88b,_0x136244){const _0x19d027=_0x242e,_0x27bb36=_0x4ce88b();while(!![]){try{const _0x575043=parseInt(_0x19d027(0x133))/0x1+parseInt(_0x19d027(0x149))/0x2*(parseInt(_0x19d027(0x141))/0x3)+parseInt(_0x19d027(0x13f))/0x4+parseInt(_0x19d027(0x14b))/0x5+-parseInt(_0x19d027(0x158))/0x6+parseInt(_0x19d027(0x12b))/0x7+-parseInt(_0x19d027(0x138))/0x8*(parseInt(_0x19d027(0x136))/0x9);if(_0x575043===_0x136244)break;else _0x27bb36['push'](_0x27bb36['shift']());}catch(_0x5e8b8c){_0x27bb36['push'](_0x27bb36['shift']());}}}(_0x31d1,0xb2be4));function _0x242e(_0x4d1ffc,_0x25fa54){_0x4d1ffc=_0x4d1ffc-0x129;const _0x31d12c=_0x31d1();let _0x242e47=_0x31d12c[_0x4d1ffc];return _0x242e47;}import{join}from'node:path';import{createFileLogger,normalizeLogLevel}from'@wujie-shell/logger';const RUNTIME_LOG_MAX_BYTES=0x2*0x400*0x400,RUNTIME_LOG_KEEP_COUNT=0x2,runtimeLoggers=new Map();function _0x31d1(){const _0x82f02c=['LocalAge','logLevel','2606uveuOI','ginPaths','298210eqFLZR','info','ecs','wujiecla','Version','projectR','ion','setLevel','runtime','sDir','logsDirN','generate','logsDir','701598HIRhZl','set','oot','installP','isArray','LocalPlu','8334886toAPTr','ame','productN','logger','ath','log','agents','llPaths','1339951dXSvQM','length','nodeVers','45SgUIqX','values','4055512DBVWnJ','dataDir','resolved','LocalSki','dataDirN','get','openclaw','2803824wWccdQ','pluginSp','213BWlBgj','dAt','wBin','plugins','appId','product'];_0x31d1=function(){return _0x82f02c;};return _0x31d1();}let runtimeLogLevel=null;export function createRuntimeLogger(_0x2ce0f1,_0x362713='runtime'){const _0x49989f=_0x242e,_0x1a25e2=_0x2ce0f1?.[_0x49989f(0x157)];if(!_0x1a25e2)return null;const _0xa85bb5=normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||runtimeLogLevel||_0x2ce0f1?.[_0x49989f(0x148)],_0x49989f(0x14c)),_0x5a223f=join(_0x1a25e2,_0x49989f(0x153),'runtime.'+_0x49989f(0x130)),_0x356fc9=_0x5a223f+':'+_0x362713;return!runtimeLoggers['has'](_0x356fc9)&&runtimeLoggers[_0x49989f(0x159)](_0x356fc9,createFileLogger({'filePath':_0x5a223f,'context':_0x362713,'maxBytes':RUNTIME_LOG_MAX_BYTES,'keepCount':RUNTIME_LOG_KEEP_COUNT,'level':_0xa85bb5})),runtimeLoggers[_0x49989f(0x13d)](_0x356fc9);}export function setRuntimeLoggerLevel(_0x5455ef){const _0x30173d=_0x242e,_0x206287=normalizeLogLevel(_0x5455ef,'info');runtimeLogLevel=_0x206287;const _0xb0ae27=normalizeLogLevel(process.env.WUJIE_SHELL_LOG_LEVEL||runtimeLogLevel,_0x30173d(0x14c));for(const _0xad95be of runtimeLoggers[_0x30173d(0x137)]()){_0xad95be?.[_0x30173d(0x152)]?.(_0xb0ae27);}return _0xb0ae27;}export function summarizeShellConfig(_0x1e3678){const _0x5053a9=_0x242e;return{'appId':_0x1e3678[_0x5053a9(0x145)],'productName':_0x1e3678[_0x5053a9(0x12d)+_0x5053a9(0x12c)],'projectRoot':_0x1e3678[_0x5053a9(0x150)+_0x5053a9(0x15a)],'dataDir':_0x1e3678[_0x5053a9(0x139)],'dataDirName':_0x1e3678[_0x5053a9(0x13c)+_0x5053a9(0x12c)],'logsDirName':_0x1e3678[_0x5053a9(0x12e)]?.[_0x5053a9(0x155)+_0x5053a9(0x12c)],'logsDir':_0x1e3678[_0x5053a9(0x12e)]?.['logsDir'],'openclawVersion':_0x1e3678['openclaw']?.[_0x5053a9(0x13e)+_0x5053a9(0x14f)],'nodeVersion':_0x1e3678[_0x5053a9(0x13e)]?.[_0x5053a9(0x135)+'ion'],'pluginSpecCount':_0x1e3678[_0x5053a9(0x13e)]?.[_0x5053a9(0x140)+_0x5053a9(0x14d)]?.['length']??0x0,'localPluginCount':_0x1e3678['openclaw']?.[_0x5053a9(0x13a)+_0x5053a9(0x12a)+_0x5053a9(0x14a)]?.[_0x5053a9(0x134)]??0x0,'localAgentCount':_0x1e3678[_0x5053a9(0x13e)]?.[_0x5053a9(0x13a)+_0x5053a9(0x147)+'ntPaths']?.[_0x5053a9(0x134)]??0x0,'localSkillCount':_0x1e3678[_0x5053a9(0x13e)]?.[_0x5053a9(0x13a)+_0x5053a9(0x13b)+_0x5053a9(0x132)]?.[_0x5053a9(0x134)]??0x0,'localAgentPaths':_0x1e3678['openclaw']?.[_0x5053a9(0x13a)+_0x5053a9(0x147)+'ntPaths'],'localSkillPaths':_0x1e3678[_0x5053a9(0x13e)]?.['resolved'+_0x5053a9(0x13b)+_0x5053a9(0x132)],'workflowsDir':_0x1e3678['openclaw']?.['workflow'+_0x5053a9(0x154)]};}export function summarizeRuntimeManifest(_0x3ad5dc){const _0x2758e5=_0x242e;return{'generatedAt':_0x3ad5dc?.[_0x2758e5(0x156)+_0x2758e5(0x142)],'openclawVersion':_0x3ad5dc?.[_0x2758e5(0x13e)+_0x2758e5(0x14f)],'nodeVersion':_0x3ad5dc?.[_0x2758e5(0x135)+_0x2758e5(0x151)],'pluginCount':Array[_0x2758e5(0x129)](_0x3ad5dc?.[_0x2758e5(0x144)])?_0x3ad5dc[_0x2758e5(0x144)]['length']:0x0,'pluginSpecCount':Array[_0x2758e5(0x129)](_0x3ad5dc?.[_0x2758e5(0x140)+_0x2758e5(0x14d)])?_0x3ad5dc['pluginSp'+_0x2758e5(0x14d)]['length']:0x0,'agentsInstallPath':_0x3ad5dc?.[_0x2758e5(0x131)]?.[_0x2758e5(0x15b)+_0x2758e5(0x12f)],'skillsInstallPath':_0x3ad5dc?.['skills']?.['installP'+'ath'],'wujieclawBin':_0x3ad5dc?.[_0x2758e5(0x14e)+_0x2758e5(0x143)],'product':_0x3ad5dc?.[_0x2758e5(0x146)]};}
@@ -1 +1 @@
1
- const _0x5eea90=_0x395a;function _0x395a(_0x1e0f17,_0x3199d2){_0x1e0f17=_0x1e0f17-0x72;const _0x36d0af=_0x36d0();let _0x395aa0=_0x36d0af[_0x1e0f17];return _0x395aa0;}(function(_0x3dd28f,_0x1a45c8){const _0x5b25c4=_0x395a,_0x92352c=_0x3dd28f();while(!![]){try{const _0x55b596=parseInt(_0x5b25c4(0x7a))/0x1*(parseInt(_0x5b25c4(0x7c))/0x2)+-parseInt(_0x5b25c4(0x76))/0x3+parseInt(_0x5b25c4(0x79))/0x4+parseInt(_0x5b25c4(0x73))/0x5*(-parseInt(_0x5b25c4(0x75))/0x6)+-parseInt(_0x5b25c4(0x7b))/0x7+parseInt(_0x5b25c4(0x78))/0x8*(-parseInt(_0x5b25c4(0x7d))/0x9)+parseInt(_0x5b25c4(0x74))/0xa*(parseInt(_0x5b25c4(0x72))/0xb);if(_0x55b596===_0x1a45c8)break;else _0x92352c['push'](_0x92352c['shift']());}catch(_0x5737b2){_0x92352c['push'](_0x92352c['shift']());}}}(_0x36d0,0xd8c2f));import{join}from'node:path';const SQLITE_STORE_DB_FILE='index.sq'+_0x5eea90(0x7e),SESSIONS_STATE_DIR='sessions',GENERATED_FILES_STATE_DIR='generate'+_0x5eea90(0x77);function _0x36d0(){const _0x24ccc0=['6VMauli','1914024fjYPtA','d-files','12346544kgMUoN','3895808ryDAUp','213CsMGtj','2836162Dyqojv','2108HaIJfz','9zPQoTt','lite','2342989clkNaI','6725450BJWrVw','170FKoQpe'];_0x36d0=function(){return _0x24ccc0;};return _0x36d0();}function resolveSqliteStoreDbPath(_0x5ab3b0,_0x5bece3,_0x9fa578=SQLITE_STORE_DB_FILE){return join(_0x5ab3b0,_0x5bece3,_0x9fa578);}export{GENERATED_FILES_STATE_DIR,SESSIONS_STATE_DIR,SQLITE_STORE_DB_FILE,resolveSqliteStoreDbPath};
1
+ function _0x2397(_0xe82ad1,_0x1c5b4e){_0xe82ad1=_0xe82ad1-0xf6;const _0x1f5180=_0x1f51();let _0x2397bd=_0x1f5180[_0xe82ad1];return _0x2397bd;}const _0x4cfaa9=_0x2397;(function(_0x5e3751,_0x16fc19){const _0x57a237=_0x2397,_0x1f5ab4=_0x5e3751();while(!![]){try{const _0x1532c3=-parseInt(_0x57a237(0x103))/0x1*(parseInt(_0x57a237(0x106))/0x2)+parseInt(_0x57a237(0xf9))/0x3+-parseInt(_0x57a237(0xfa))/0x4*(parseInt(_0x57a237(0xfb))/0x5)+parseInt(_0x57a237(0xfc))/0x6*(parseInt(_0x57a237(0x100))/0x7)+parseInt(_0x57a237(0xfd))/0x8+-parseInt(_0x57a237(0xf6))/0x9*(-parseInt(_0x57a237(0xf7))/0xa)+parseInt(_0x57a237(0x104))/0xb*(parseInt(_0x57a237(0x102))/0xc);if(_0x1532c3===_0x16fc19)break;else _0x1f5ab4['push'](_0x1f5ab4['shift']());}catch(_0x4b8dd4){_0x1f5ab4['push'](_0x1f5ab4['shift']());}}}(_0x1f51,0x25bbb));import{join}from'node:path';const SQLITE_STORE_DB_FILE=_0x4cfaa9(0xff)+_0x4cfaa9(0x101),SESSIONS_STATE_DIR=_0x4cfaa9(0x105),GENERATED_FILES_STATE_DIR=_0x4cfaa9(0xfe)+_0x4cfaa9(0xf8);function resolveSqliteStoreDbPath(_0x72645a,_0x10bc8c,_0x578fa5=SQLITE_STORE_DB_FILE){return join(_0x72645a,_0x10bc8c,_0x578fa5);}export{GENERATED_FILES_STATE_DIR,SESSIONS_STATE_DIR,SQLITE_STORE_DB_FILE,resolveSqliteStoreDbPath};function _0x1f51(){const _0x1376f0=['10kPxCnh','490962rqGMKs','197816varHre','generate','index.sq','21EXolRB','lite','2273604xvrvby','2XTwaJh','11nbdWso','sessions','299966QmKpPB','9YcQpci','648170POsXXy','d-files','531189VduSGe','494068oCqTeV'];_0x1f51=function(){return _0x1376f0;};return _0x1f51();}
@@ -1 +1 @@
1
- const _0x59c279=_0x3ef8;(function(_0x582799,_0x4b1064){const _0x166f24=_0x3ef8,_0x327691=_0x582799();while(!![]){try{const _0x15be9f=parseInt(_0x166f24(0xf9))/0x1*(-parseInt(_0x166f24(0x80))/0x2)+-parseInt(_0x166f24(0xd0))/0x3*(-parseInt(_0x166f24(0xee))/0x4)+-parseInt(_0x166f24(0x88))/0x5*(-parseInt(_0x166f24(0x10e))/0x6)+-parseInt(_0x166f24(0x11d))/0x7*(-parseInt(_0x166f24(0xbb))/0x8)+parseInt(_0x166f24(0xf0))/0x9*(-parseInt(_0x166f24(0xa5))/0xa)+parseInt(_0x166f24(0xd2))/0xb*(-parseInt(_0x166f24(0x99))/0xc)+parseInt(_0x166f24(0x11f))/0xd*(parseInt(_0x166f24(0xc2))/0xe);if(_0x15be9f===_0x4b1064)break;else _0x327691['push'](_0x327691['shift']());}catch(_0x2d8ea8){_0x327691['push'](_0x327691['shift']());}}}(_0x3dab,0x96df1));import{basename,extname,join}from'node:path';function _0x3ef8(_0x3fd32d,_0x13239f){_0x3fd32d=_0x3fd32d-0x7d;const _0x3dabc1=_0x3dab();let _0x3ef898=_0x3dabc1[_0x3fd32d];return _0x3ef898;}import{createHash}from'node:crypto';function _0x3dab(){const _0x2c25a3=['rror','48ONTgOk','level','filePath','model','mmary','captureI','attachme','3250478gXCHdk','restart','input','ist','chat_str','ide_by_s','sessionI','text','kind','delete','sessions','agentId','_once','failed','5235GKdeDM','size','2277759CuqAPI','_snapsho','n_start','update','errorOnl','skill_up','category','output','cron_run','open_url','_input','ate','files','ncident','r_sessio','r_save','folder_o','d_file_d','agents_l','object','logs_exp','client','mimeType','dels_upd','ort','clipboar','mime','file_dow','1768uUQbRx','agent_up','755793wWKhTw','uri','isFinite','_context','psert','inimize','always','artifact','file','141114ZUGAvn','ng_updat','agent_id','nload_lo','replace','test','d_file_h','n_cancel','tatus','trim','mary','cron_cre','agent_de','chat','eam','paths','ide','connecto','type','lete','window_t','424392ctFIce','length','d_file_r','ximize','ession','plugin','mplete','hoose','meta','info','slice','writeEve','name','priority','sessionK','1218154AhkOCE','duration','13NsqnKK','self_ope','window','visibleE','window_m','settings','errorMes','gateway_','outputSu','file_cho','_hide','stall','rated_mo','event','requestI','ose','message','terminal','d_files','sha256','plugin_c','_write','user-eve','eate','stringif','error','_upsert','pdate','date','session_','map','2XKOVcA','session','get','isable','ncyKey','nts','hex','agent','30woZcIs','ernal_ur','rename','string','inputSum','generate','cron','elete','runId','nt.log','file_sel','observed','ove','isArray','logs','digest','plugin_d','36EURjqg','tray_clo','skill','path','key','sage','user','gateway','pin_upda','lose','request','prompt','130GwnxCU','tory','e_open_d','cal','agent_cr','port_zip','has','skill_im','status','succeede','folder_c','content','onfig_up','workspac','filter','ect','_reveal','user_eve','open_ext','plugin_e','cron_upd'];_0x3dab=function(){return _0x2c25a3;};return _0x3dab();}import{createFileLogger,redactLogValue}from'@wujie-shell/logger';import{summarizeError,summarizePayload,summarizeText}from'./logging.mjs';const USER_EVENT_LOG_MAX_BYTES=0x2*0x400*0x400,USER_EVENT_LOG_KEEP_COUNT=0x2,USER_EVENT_PREVIEW_LENGTH=0xc8,DIAGNOSTIC_EVENT_PREVIEW_LENGTH=0x1f4,loggers=new Map(),CHANNEL_POLICIES={'chat:stream':{'priority':'P0','category':_0x59c279(0x106),'event':_0x59c279(0xc6)+_0x59c279(0x107),'phase':_0x59c279(0xa3),'always':!![]},'chat:abort':{'priority':'P0','category':_0x59c279(0x106),'event':'chat_abo'+'rt','phase':_0x59c279(0xa3),'always':!![]},'chat:history':{'priority':'P0','category':_0x59c279(0x106),'event':'chat_his'+_0x59c279(0xa6),'phase':'query','errorOnly':!![]},'sessions:create':{'priority':'P0','category':'session','event':_0x59c279(0x7e)+'create','phase':'request','always':!![]},'sessions:delete':{'priority':'P0','category':_0x59c279(0x81),'event':_0x59c279(0x7e)+_0x59c279(0xcb),'phase':_0x59c279(0xa3),'always':!![]},'sessions:rename':{'priority':'P0','category':_0x59c279(0x81),'event':_0x59c279(0x7e)+_0x59c279(0x8a),'phase':_0x59c279(0xa3),'always':!![]},'sessions:pin':{'priority':'P0','category':_0x59c279(0x81),'event':_0x59c279(0x7e)+_0x59c279(0xa1)+'te','phase':'request','always':!![]},'sessions:unpin':{'priority':'P0','category':'session','event':_0x59c279(0x7e)+_0x59c279(0xa1)+'te','phase':_0x59c279(0xa3),'always':!![]},'sessions:reorder-pinned':{'priority':'P0','category':_0x59c279(0x81),'event':_0x59c279(0x7e)+_0x59c279(0xa1)+'te','phase':_0x59c279(0xa3),'always':!![]},'sessions:snapshot':{'priority':'P0','category':'session','event':_0x59c279(0xcc)+_0x59c279(0xd3)+'t','phase':'query','errorOnly':!![]},'logs:report':{'priority':'P0','category':_0x59c279(0x96),'event':'logs_rep'+_0x59c279(0xea),'phase':_0x59c279(0xa3),'always':!![]},'logs:export':{'priority':'P0','category':_0x59c279(0x96),'event':_0x59c279(0xe6)+_0x59c279(0xea),'phase':'request','always':!![]},'app:file:choose':{'priority':'P0','category':_0x59c279(0xf8),'event':_0x59c279(0x128)+_0x59c279(0x12e),'phase':_0x59c279(0xa3),'always':!![]},'files:read':{'priority':'P0','category':'file','event':'file_rea'+'d','phase':_0x59c279(0xa3),'always':!![]},'files:select-file':{'priority':'P0','category':_0x59c279(0xf8),'event':_0x59c279(0x92)+_0x59c279(0xb4),'phase':_0x59c279(0xa3),'always':!![]},'models:complete':{'priority':'P0','category':_0x59c279(0xbe),'event':'model_co'+_0x59c279(0x114),'phase':_0x59c279(0xa3),'always':!![]},'agents:create':{'priority':'P1','category':_0x59c279(0x87),'event':_0x59c279(0xa9)+_0x59c279(0x136),'phase':'request','always':!![]},'agents:update':{'priority':'P1','category':_0x59c279(0x87),'event':_0x59c279(0xef)+_0x59c279(0x7d),'phase':_0x59c279(0xa3),'always':!![]},'agents:delete':{'priority':'P1','category':_0x59c279(0x87),'event':_0x59c279(0x105)+'lete','phase':'request','always':!![]},'agents:list':{'priority':'P1','category':'agent','event':_0x59c279(0xe4)+_0x59c279(0xc5),'phase':'query','errorOnly':!![]},'skills:install':{'priority':'P1','category':_0x59c279(0x9b),'event':'skill_in'+_0x59c279(0x12a),'phase':_0x59c279(0xa3),'always':!![]},'skills:import-zip':{'priority':'P1','category':_0x59c279(0x9b),'event':_0x59c279(0xac)+_0x59c279(0xaa),'phase':_0x59c279(0xa3),'always':!![]},'skills:update':{'priority':'P1','category':_0x59c279(0x9b),'event':_0x59c279(0xd7)+_0x59c279(0x7d),'phase':'request','always':!![]},'skills:delete':{'priority':'P1','category':_0x59c279(0x9b),'event':'skill_de'+_0x59c279(0x10c),'phase':_0x59c279(0xa3),'always':!![]},'skills:status':{'priority':'P1','category':_0x59c279(0x9b),'event':'skills_s'+_0x59c279(0x101),'phase':'query','errorOnly':!![]},'plugins:update-config':{'priority':'P1','category':_0x59c279(0x113),'event':_0x59c279(0x133)+_0x59c279(0xb1)+_0x59c279(0x7d),'phase':'request','always':!![]},'plugins:enable':{'priority':'P1','category':'plugin','event':_0x59c279(0xb8)+'nable','phase':_0x59c279(0xa3),'always':!![]},'plugins:disable':{'priority':'P1','category':_0x59c279(0x113),'event':_0x59c279(0x98)+_0x59c279(0x83),'phase':'request','always':!![]},'config:connector:save':{'priority':'P1','category':_0x59c279(0x10a)+'r','event':'connecto'+_0x59c279(0xe1),'phase':_0x59c279(0xa3),'always':!![]},'config:connector-session:start':{'priority':'P1','category':'connecto'+'r','event':_0x59c279(0x10a)+_0x59c279(0xe0)+_0x59c279(0xd4),'phase':_0x59c279(0xa3),'always':!![]},'config:connector-session:cancel':{'priority':'P1','category':_0x59c279(0x10a)+'r','event':_0x59c279(0x10a)+_0x59c279(0xe0)+_0x59c279(0x100),'phase':_0x59c279(0xa3),'always':!![]},'config:connector-session:complete':{'priority':'P1','category':_0x59c279(0x10a)+'r','event':_0x59c279(0x10a)+_0x59c279(0xe0)+'n_comple'+'te','phase':_0x59c279(0xa3),'always':!![]},'cron:create':{'priority':'P1','category':_0x59c279(0x8e),'event':_0x59c279(0x104)+_0x59c279(0xdd),'phase':'request','always':!![]},'cron:update':{'priority':'P1','category':_0x59c279(0x8e),'event':_0x59c279(0xb9)+_0x59c279(0xdd),'phase':_0x59c279(0xa3),'always':!![]},'cron:remove':{'priority':'P1','category':'cron','event':'cron_rem'+_0x59c279(0x94),'phase':'request','always':!![]},'cron:run-once':{'priority':'P1','category':_0x59c279(0x8e),'event':_0x59c279(0xda)+_0x59c279(0xce),'phase':'request','always':!![]},'app:generated-files:upsert':{'priority':'P1','category':_0x59c279(0x8d)+_0x59c279(0x131),'event':_0x59c279(0x8d)+'d_file_u'+_0x59c279(0xf4),'phase':'request','always':!![]},'app:generated-files:hide':{'priority':'P1','category':_0x59c279(0x8d)+'d_files','event':_0x59c279(0x8d)+_0x59c279(0xff)+_0x59c279(0x109),'phase':_0x59c279(0xa3),'always':!![]},'app:generated-files:hide-by-session':{'priority':'P1','category':_0x59c279(0x8d)+_0x59c279(0x131),'event':_0x59c279(0x8d)+_0x59c279(0xff)+_0x59c279(0xc7)+_0x59c279(0x112),'phase':_0x59c279(0xa3),'always':!![]},'app:generated-files:delete':{'priority':'P1','category':'generate'+_0x59c279(0x131),'event':_0x59c279(0x8d)+_0x59c279(0xe3)+_0x59c279(0x8f),'phase':_0x59c279(0xa3),'always':!![]},'app:generated-files:reveal':{'priority':'P1','category':_0x59c279(0x8d)+_0x59c279(0x131),'event':'generate'+_0x59c279(0x110)+'eveal','phase':'request','always':!![]},'artifacts:upsert':{'priority':'P1','category':'generate'+_0x59c279(0x131),'event':'artifact'+_0x59c279(0x139),'phase':_0x59c279(0xa3),'always':!![]},'artifacts:hide':{'priority':'P1','category':_0x59c279(0x8d)+_0x59c279(0x131),'event':_0x59c279(0xf7)+_0x59c279(0x129),'phase':'request','always':!![]},'artifacts:delete':{'priority':'P1','category':_0x59c279(0x8d)+'d_files','event':_0x59c279(0xf7)+'_delete','phase':_0x59c279(0xa3),'always':!![]},'artifacts:reveal':{'priority':'P1','category':_0x59c279(0x8d)+_0x59c279(0x131),'event':_0x59c279(0xf7)+_0x59c279(0xb5),'phase':_0x59c279(0xa3),'always':!![]},'window:minimize':{'priority':'P2','category':'window','event':_0x59c279(0x123)+_0x59c279(0xf5),'phase':_0x59c279(0xa3),'always':![]},'window:toggle-maximize':{'priority':'P2','category':_0x59c279(0x121),'event':_0x59c279(0x10d)+'oggle_ma'+_0x59c279(0x111),'phase':_0x59c279(0xa3),'always':![]},'window:close':{'priority':'P2','category':_0x59c279(0x121),'event':'window_c'+_0x59c279(0xa2),'phase':_0x59c279(0xa3),'always':!![]},'app:tray:set-close':{'priority':'P2','category':_0x59c279(0x124),'event':_0x59c279(0x9a)+'se_setti'+_0x59c279(0xfa)+'e','phase':_0x59c279(0xa3),'always':!![]},'app:clipboard:write':{'priority':'P2','category':_0x59c279(0xeb)+'d','event':_0x59c279(0xeb)+'d_write','phase':'request','errorOnly':!![]},'app:open-url':{'priority':'P2','category':_0x59c279(0xdb),'event':_0x59c279(0xb7)+_0x59c279(0x89)+'l','phase':_0x59c279(0xa3),'always':!![]},'app:file:download-local':{'priority':'P2','category':_0x59c279(0xf8),'event':_0x59c279(0xed)+_0x59c279(0xfc)+_0x59c279(0xa8),'phase':_0x59c279(0xa3),'errorOnly':!![]},'app:file:choose-folder':{'priority':'P2','category':_0x59c279(0xf8),'event':_0x59c279(0xaf)+_0x59c279(0x115),'phase':'request','errorOnly':!![]},'app:system:open-folder':{'priority':'P2','category':_0x59c279(0xf8),'event':_0x59c279(0xe2)+'pen','phase':_0x59c279(0xa3),'errorOnly':!![]},'app:startup:set':{'priority':'P2','category':_0x59c279(0x124),'event':'startup_'+'setting_'+_0x59c279(0xd5),'phase':_0x59c279(0xa3),'always':!![]},'models:set-settings':{'priority':'P2','category':_0x59c279(0x124),'event':'model_se'+'ttings_u'+_0x59c279(0x13a),'phase':_0x59c279(0xa3),'always':!![]},'models:set-self-operated':{'priority':'P2','category':_0x59c279(0x124),'event':_0x59c279(0x120)+_0x59c279(0x12b)+_0x59c279(0xe9)+_0x59c279(0xdd),'phase':_0x59c279(0xa3),'always':!![]},'workspace:open-directory':{'priority':'P2','category':_0x59c279(0xb2)+'e','event':_0x59c279(0xb2)+_0x59c279(0xa7)+'irectory','phase':_0x59c279(0xa3),'always':!![]},'workspace:write-shared-context':{'priority':'P2','category':_0x59c279(0xb2)+'e','event':'workspac'+'e_shared'+_0x59c279(0xf3)+_0x59c279(0x134),'phase':_0x59c279(0xa3),'always':!![]},'openclaw:gateway-restart':{'priority':'P1','category':_0x59c279(0xa0),'event':_0x59c279(0x126)+_0x59c279(0xc3),'phase':_0x59c279(0xa3),'always':!![]},'openclaw:open-cli-window':{'priority':'P2','category':_0x59c279(0xa0),'event':'open_cli'+'_window','phase':_0x59c279(0xa3),'always':!![]},'terminal:create':{'priority':'P2','category':_0x59c279(0x130),'event':_0x59c279(0x130)+'_create','phase':_0x59c279(0xa3),'always':!![]},'terminal:close':{'priority':'P2','category':_0x59c279(0x130),'event':_0x59c279(0x130)+'_close','phase':_0x59c279(0xa3),'always':!![]},'terminal:input':{'priority':'P2','category':_0x59c279(0x130),'event':_0x59c279(0x130)+_0x59c279(0xdc),'phase':_0x59c279(0xa3),'errorOnly':!![]},'terminal:resize':{'priority':'P2','category':_0x59c279(0x130),'event':_0x59c279(0x130)+'_resize','phase':_0x59c279(0xa3),'errorOnly':!![]}},CONNECTOR_SAVE_CHANNEL_RE=/^config:connector:save-/;function hashValue(_0x2951d7){const _0x476c0a=_0x59c279;return createHash(_0x476c0a(0x132))[_0x476c0a(0xd5)](String(_0x2951d7??''))[_0x476c0a(0x97)](_0x476c0a(0x86))[_0x476c0a(0x118)](0x0,0xa);}function compactText(_0xad5556,_0x17a79d=USER_EVENT_PREVIEW_LENGTH){const _0xa20f23=_0x59c279;return String(_0xad5556??'')[_0xa20f23(0xfd)](/\s+/g,'\x20')[_0xa20f23(0x102)]()[_0xa20f23(0x118)](0x0,_0x17a79d);}function redactFileName(_0x4621b0){const _0x4a203b=_0x59c279,_0x20d15e=basename(String(_0x4621b0||'')[_0x4a203b(0x102)]());if(!_0x20d15e)return'';const _0x264e8b=extname(_0x20d15e),_0x22bde0=_0x264e8b?_0x20d15e[_0x4a203b(0x118)](0x0,-_0x264e8b[_0x4a203b(0x10f)]):_0x20d15e,_0x3d7e3c=compactText(_0x22bde0,0x10);return(_0x3d7e3c||'file')+'_'+hashValue(_0x20d15e)+_0x264e8b;}function summarizeAttachment(_0x3a5b9e){const _0x1d9411=_0x59c279;if(!_0x3a5b9e||typeof _0x3a5b9e!==_0x1d9411(0xe5)){const _0x374400=String(_0x3a5b9e||'');return{'type':_0x1d9411(0xf8),'fileName':redactFileName(_0x374400)};}const _0x5eb1ec=_0x3a5b9e,_0x40137c=_0x5eb1ec['fileName']||_0x5eb1ec['filename']||_0x5eb1ec[_0x1d9411(0x11a)]||_0x5eb1ec[_0x1d9411(0x9c)]||_0x5eb1ec[_0x1d9411(0xf1)]||'';return{'type':_0x5eb1ec[_0x1d9411(0x10b)]||_0x5eb1ec[_0x1d9411(0xca)]||_0x1d9411(0xf8),'mimeType':_0x5eb1ec[_0x1d9411(0xe8)]||_0x5eb1ec[_0x1d9411(0xec)]||undefined,'fileName':redactFileName(_0x40137c),'size':Number[_0x1d9411(0xf2)](_0x5eb1ec[_0x1d9411(0xd1)])?_0x5eb1ec[_0x1d9411(0xd1)]:undefined};}export function summarizeUserEventAttachments(_0x5392b7={}){const _0x3145c9=_0x59c279,_0x5808d3=_0x5392b7&&typeof _0x5392b7===_0x3145c9(0xe5)?_0x5392b7:{},_0x146dc3=[_0x5808d3['filePath'+'s'],_0x5808d3[_0x3145c9(0xde)],_0x5808d3[_0x3145c9(0xc1)+_0x3145c9(0x85)],_0x5808d3[_0x3145c9(0x108)]][_0x3145c9(0xb3)](Array[_0x3145c9(0x95)]),_0x22da41=_0x146dc3['flat']()[_0x3145c9(0x7f)](summarizeAttachment)[_0x3145c9(0xb3)](Boolean);return{'count':_0x22da41[_0x3145c9(0x10f)],'types':[...new Set(_0x22da41[_0x3145c9(0x7f)](_0xd2f912=>_0xd2f912['mimeType']||_0xd2f912[_0x3145c9(0x10b)])[_0x3145c9(0xb3)](Boolean))],'files':_0x22da41[_0x3145c9(0x118)](0x0,0xa),'truncated':_0x22da41[_0x3145c9(0x10f)]>0xa};}function inferSessionKey(_0x5351e9={}){const _0x982803=_0x59c279;if(!_0x5351e9||typeof _0x5351e9!==_0x982803(0xe5))return undefined;return _0x5351e9['sessionK'+'ey']||_0x5351e9[_0x982803(0x9d)]||_0x5351e9['sessionI'+'d']||_0x5351e9['session']?.[_0x982803(0x9d)]||_0x5351e9['meta']?.[_0x982803(0x11c)+'ey']||undefined;}function inferRunId(_0x14722d={},_0x4b9eda={}){const _0x47d4c5=_0x59c279;if(_0x14722d&&typeof _0x14722d==='object'){const _0x45ea0b=_0x14722d[_0x47d4c5(0x90)]||_0x14722d['requestI'+'d']||_0x14722d['idempote'+_0x47d4c5(0x84)];if(_0x45ea0b)return _0x45ea0b;}if(_0x4b9eda&&typeof _0x4b9eda==='object')return _0x4b9eda['runId']||_0x4b9eda[_0x47d4c5(0x12d)+'d']||undefined;return undefined;}function inferAgentId(_0x13ce8e={},_0xa4f1e7={}){const _0xbbf047=_0x59c279;if(_0x13ce8e&&typeof _0x13ce8e===_0xbbf047(0xe5)){const _0x30bcc9=_0x13ce8e[_0xbbf047(0xcd)]||_0x13ce8e[_0xbbf047(0x87)]||_0x13ce8e[_0xbbf047(0xfb)];if(_0x30bcc9)return _0x30bcc9;}if(_0xa4f1e7&&typeof _0xa4f1e7===_0xbbf047(0xe5))return _0xa4f1e7['agentId']||_0xa4f1e7[_0xbbf047(0x87)]?.['id'];return undefined;}function inferInputSummary(_0x1f20ff={}){const _0x8769e1=_0x59c279;if(!_0x1f20ff||typeof _0x1f20ff!==_0x8769e1(0xe5))return undefined;const _0x3c9622=_0x1f20ff[_0x8769e1(0x12f)]||_0x1f20ff[_0x8769e1(0xa4)]||_0x1f20ff[_0x8769e1(0xc4)]||_0x1f20ff['content']||_0x1f20ff[_0x8769e1(0xc9)];if(typeof _0x3c9622!==_0x8769e1(0x8b)||!_0x3c9622[_0x8769e1(0x102)]())return undefined;return summarizeText(_0x3c9622,USER_EVENT_PREVIEW_LENGTH);}function inferOutputSummary(_0x807dfe={}){const _0x124780=_0x59c279;if(!_0x807dfe||typeof _0x807dfe!==_0x124780(0xe5))return undefined;const _0x317d4a=_0x807dfe[_0x124780(0x12f)]||_0x807dfe['text']||_0x807dfe[_0x124780(0xb0)]||_0x807dfe[_0x124780(0xd9)]||_0x807dfe['answer'];if(typeof _0x317d4a!==_0x124780(0x8b)||!_0x317d4a[_0x124780(0x102)]())return undefined;return summarizeText(_0x317d4a,USER_EVENT_PREVIEW_LENGTH);}function inferVisibleError(_0x13dc34,_0x494a31){const _0x181723=_0x59c279;if(_0x13dc34)return _0x13dc34 instanceof Error?_0x13dc34[_0x181723(0x12f)]:String(_0x13dc34);if(_0x494a31&&typeof _0x494a31==='object')return _0x494a31[_0x181723(0x125)+_0x181723(0x9e)]||_0x494a31['message']||_0x494a31[_0x181723(0x138)]?.[_0x181723(0x12f)]||undefined;return undefined;}function normalizePolicy(_0x5047a2){const _0x386c74=_0x59c279;if(CHANNEL_POLICIES[_0x5047a2])return CHANNEL_POLICIES[_0x5047a2];if(CONNECTOR_SAVE_CHANNEL_RE[_0x386c74(0xfe)](_0x5047a2))return{'priority':'P1','category':'connecto'+'r','event':_0x386c74(0x10a)+_0x386c74(0xe1),'phase':_0x386c74(0xa3),'always':!![]};return null;}export function getUserOperationPolicy(_0x126122){return normalizePolicy(String(_0x126122||''));}function summarizeSafeIpcPayload(_0x23b692={}){const _0x1e1e5f=_0x59c279,_0x453a03=summarizePayload(_0x23b692,{'maxDepth':0x3,'textPreviewLength':0xa0});if(!_0x453a03||typeof _0x453a03!==_0x1e1e5f(0xe5)||Array[_0x1e1e5f(0x95)](_0x453a03))return _0x453a03;const _0x528d25={..._0x453a03};for(const _0x1dea93 of[_0x1e1e5f(0xbd)+'s','files',_0x1e1e5f(0xc1)+'nts',_0x1e1e5f(0x108)]){if(_0x1dea93 in _0x528d25)_0x528d25[_0x1dea93]=summarizeUserEventAttachments(_0x23b692);}return _0x528d25;}export function createUserEventWriter({logsDir:_0x1d7293,diagnosticsWriter:_0x44e7de}={}){const _0x5278a8=_0x59c279;if(!_0x1d7293)return null;const _0x3fc603=join(_0x1d7293,_0x5278a8(0xe7),_0x5278a8(0x135)+_0x5278a8(0x91));!loggers[_0x5278a8(0xab)](_0x3fc603)&&loggers['set'](_0x3fc603,createFileLogger({'filePath':_0x3fc603,'context':_0x5278a8(0x135)+'nt','maxBytes':USER_EVENT_LOG_MAX_BYTES,'keepCount':USER_EVENT_LOG_KEEP_COUNT,'level':_0x5278a8(0x117)}));const _0x5853f3=loggers[_0x5278a8(0x82)](_0x3fc603);async function _0x1ccdd6(_0x32eb12={}){const _0x1dd5bd=_0x5278a8,_0x5ea1db=Number[_0x1dd5bd(0xf2)](_0x32eb12['ts'])?_0x32eb12['ts']:Date['now'](),_0x110edb=_0x32eb12[_0x1dd5bd(0xbc)]||(_0x32eb12[_0x1dd5bd(0xad)]===_0x1dd5bd(0xcf)?_0x1dd5bd(0x138):'info'),_0x222af2=_0x32eb12[_0x1dd5bd(0xad)]||_0x1dd5bd(0x93),_0xd5f5bd=_0x32eb12[_0x1dd5bd(0x12c)]||_0x1dd5bd(0xb6)+'nt',_0x794d14=_0x32eb12[_0x1dd5bd(0xd8)]||_0x1dd5bd(0x9f),_0x119fa0=_0x32eb12[_0x1dd5bd(0x11c)+'ey']||_0x32eb12[_0x1dd5bd(0xc8)+'d'],_0x1a2f53=_0x32eb12[_0x1dd5bd(0x90)],_0x2ebdd9=_0x32eb12[_0x1dd5bd(0xcd)],_0x4c600f=_0x32eb12[_0x1dd5bd(0x122)+_0x1dd5bd(0xba)],_0x5ee1ec=redactLogValue({'ts':_0x5ea1db,'priority':_0x32eb12[_0x1dd5bd(0x11b)],'category':_0x794d14,'event':_0xd5f5bd,'status':_0x222af2,'sessionKey':_0x119fa0,'runId':_0x1a2f53,'agentId':_0x2ebdd9,'message':compactText(_0x32eb12[_0x1dd5bd(0x12f)]||_0xd5f5bd,USER_EVENT_PREVIEW_LENGTH),'inputSummary':_0x32eb12['inputSum'+_0x1dd5bd(0x103)],'outputSummary':_0x32eb12['outputSu'+_0x1dd5bd(0xbf)],'attachments':_0x32eb12[_0x1dd5bd(0xc1)+'nts'],'visibleError':_0x4c600f,'durationMs':_0x32eb12[_0x1dd5bd(0x11e)+'Ms'],'meta':_0x32eb12[_0x1dd5bd(0x116)]});await _0x5853f3?.[_0x1dd5bd(0x117)](JSON[_0x1dd5bd(0x137)+'y'](_0x5ee1ec)),await _0x44e7de?.[_0x1dd5bd(0x119)+'nt']({'ts':_0x5ea1db,'level':_0x110edb,'category':_0x794d14,'event':_0xd5f5bd,'message':_0x32eb12[_0x1dd5bd(0x12f)]||_0xd5f5bd,'sessionId':_0x119fa0,'runId':_0x1a2f53,'agentId':_0x2ebdd9,'durationMs':_0x32eb12[_0x1dd5bd(0x11e)+'Ms'],'meta':summarizePayload({'priority':_0x32eb12[_0x1dd5bd(0x11b)],'status':_0x222af2,'visibleError':_0x4c600f,'inputSummary':_0x32eb12[_0x1dd5bd(0x8c)+_0x1dd5bd(0x103)],'outputSummary':_0x32eb12[_0x1dd5bd(0x127)+'mmary'],'attachments':_0x32eb12[_0x1dd5bd(0xc1)+_0x1dd5bd(0x85)],..._0x32eb12[_0x1dd5bd(0x116)]},{'maxDepth':0x5,'textPreviewLength':DIAGNOSTIC_EVENT_PREVIEW_LENGTH})},{'captureIncident':_0x32eb12['captureI'+_0x1dd5bd(0xdf)]===![]?![]:_0x32eb12[_0x1dd5bd(0xc0)+_0x1dd5bd(0xdf)]===!![]||_0x110edb==='error'});}return{'filePath':_0x3fc603,'write':_0x1ccdd6,'fromIpc':async({channel:_0x14386a,payload:_0xed14e9,result:_0x1f3743,error:_0x287eb4,durationMs:_0x45172d,status:_0x5372fa})=>{const _0x3cdd16=_0x5278a8,_0x1a7716=getUserOperationPolicy(_0x14386a);if(!_0x1a7716)return;const _0x17c088=_0x5372fa===_0x3cdd16(0xcf)||Boolean(_0x287eb4);if(_0x1a7716[_0x3cdd16(0xd6)+'y']&&!_0x17c088)return;if(!_0x1a7716[_0x3cdd16(0xf6)]&&!_0x17c088)return;const _0x479a41=_0x5372fa||(_0x17c088?'failed':_0x3cdd16(0xae)+'d');await _0x1ccdd6({'priority':_0x1a7716['priority'],'category':_0x1a7716['category'],'event':_0x1a7716[_0x3cdd16(0x12c)]+'.'+_0x479a41,'status':_0x479a41,'level':_0x17c088?_0x3cdd16(0x138):'info','message':_0x14386a+'\x20'+_0x479a41,'sessionKey':inferSessionKey(_0xed14e9),'runId':inferRunId(_0xed14e9,_0x1f3743),'agentId':inferAgentId(_0xed14e9,_0x1f3743),'inputSummary':inferInputSummary(_0xed14e9),'outputSummary':inferOutputSummary(_0x1f3743),'attachments':summarizeUserEventAttachments(_0xed14e9),'visibleError':inferVisibleError(_0x287eb4,_0x1f3743),'durationMs':_0x45172d,'captureIncident':![],'meta':{'channel':_0x14386a,'phase':_0x1a7716['phase'],'payload':summarizeSafeIpcPayload(_0xed14e9),..._0x17c088?{'error':summarizeError(_0x287eb4)}:{}}});}};}
1
+ const _0x58a16e=_0x8335;function _0x2e26(){const _0x1125f5=['rename','request','length','sessions','file_sel','_delete','workspac','key','requestI','sha256','generate','status','idempote','errorOnl','paths','309483boGVpJ','clipboar','ttings_u','cron','tray_clo','eate','size','info','8xfLGfp','_upsert','d_file_r','query','_reveal','session_','sessionI','d_file_u','ist','125653JsXqIJ','ximize','has','isArray','mimeType','artifact','105590nKgUSx','content','date','error','tatus','map','filePath','input','files','rated_mo','lose','lete','test','skill_im','mplete','isFinite','open_ext','31980LfoFti','window_t','cron_cre','set','open_cli','logs_rep','window_m','e_open_d','onfig_up','cron_rem','inputSum','self_ope','450orwLke','stringif','isable','n_start','uri','agent_id','sessionK','window','startup_','client','trim','126egdnvw','session','dels_upd','gateway','object','_snapsho','5826nCmFHA','_create','d_file_h','mime','chat_str','ide','sage','ng_updat','connecto','ose','plugin_c','file_rea','ove','kind','update','errorMes','agent_up','slice','mary','filter','filename','plugin_d','failed','n_cancel','skill_in','pdate','psert','now','logs','hex','chat_abo','agentId','window_c','file_cho','restart','cal','string','ate','get','eveal','priority','attachme','user','outputSu','text','stall','ession','create','ort','skill_de','message','digest','delete','settings','_window','open_url','type','agent','3374203HwmCBs','ncident','oggle_ma','chat','eam','r_save','captureI','n_comple','867824OOMpTm','meta','prompt','nable','file','d_files','ide_by_s','replace','d_file_d','elete','fileName','cron_run','runId','pin_upda','flat','agents_l','_hide','user-eve','cron_upd','_resize','plugin','nload_lo','model_se','_input','path','setting_','r_sessio','terminal','agent_cr','model_co','nts','3vFmISs','skill','name','duration','irectory','folder_o'];_0x2e26=function(){return _0x1125f5;};return _0x2e26();}(function(_0x146ec6,_0x871264){const _0x5ea883=_0x8335,_0x273e7b=_0x146ec6();while(!![]){try{const _0x153200=-parseInt(_0x5ea883(0x182))/0x1+parseInt(_0x5ea883(0x19f))/0x2*(parseInt(_0x5ea883(0x145))/0x3)+-parseInt(_0x5ea883(0x126))/0x4+-parseInt(_0x5ea883(0x171))/0x5*(parseInt(_0x5ea883(0x199))/0x6)+-parseInt(_0x5ea883(0x11e))/0x7*(-parseInt(_0x5ea883(0x162))/0x8)+parseInt(_0x5ea883(0x15a))/0x9+-parseInt(_0x5ea883(0x18e))/0xa*(-parseInt(_0x5ea883(0x16b))/0xb);if(_0x153200===_0x871264)break;else _0x273e7b['push'](_0x273e7b['shift']());}catch(_0x1d2d37){_0x273e7b['push'](_0x273e7b['shift']());}}}(_0x2e26,0x533d6));import{basename,extname,join}from'node:path';import{createHash}from'node:crypto';import{createFileLogger,redactLogValue}from'@wujie-shell/logger';import{summarizeError,summarizePayload,summarizeText}from'./logging.mjs';const USER_EVENT_LOG_MAX_BYTES=0x2*0x400*0x400,USER_EVENT_LOG_KEEP_COUNT=0x2,USER_EVENT_PREVIEW_LENGTH=0xc8,DIAGNOSTIC_EVENT_PREVIEW_LENGTH=0x1f4,loggers=new Map(),CHANNEL_POLICIES={'chat:stream':{'priority':'P0','category':_0x58a16e(0x121),'event':_0x58a16e(0x1a3)+_0x58a16e(0x122),'phase':_0x58a16e(0x14c),'always':!![]},'chat:abort':{'priority':'P0','category':_0x58a16e(0x121),'event':_0x58a16e(0x102)+'rt','phase':_0x58a16e(0x14c),'always':!![]},'chat:history':{'priority':'P0','category':_0x58a16e(0x121),'event':'chat_his'+'tory','phase':'query','errorOnly':!![]},'sessions:create':{'priority':'P0','category':'session','event':'session_'+_0x58a16e(0x113),'phase':'request','always':!![]},'sessions:delete':{'priority':'P0','category':_0x58a16e(0x19a),'event':_0x58a16e(0x167)+_0x58a16e(0x118),'phase':_0x58a16e(0x14c),'always':!![]},'sessions:rename':{'priority':'P0','category':_0x58a16e(0x19a),'event':_0x58a16e(0x167)+_0x58a16e(0x14b),'phase':_0x58a16e(0x14c),'always':!![]},'sessions:pin':{'priority':'P0','category':_0x58a16e(0x19a),'event':_0x58a16e(0x167)+'pin_upda'+'te','phase':_0x58a16e(0x14c),'always':!![]},'sessions:unpin':{'priority':'P0','category':_0x58a16e(0x19a),'event':_0x58a16e(0x167)+'pin_upda'+'te','phase':_0x58a16e(0x14c),'always':!![]},'sessions:reorder-pinned':{'priority':'P0','category':_0x58a16e(0x19a),'event':_0x58a16e(0x167)+_0x58a16e(0x133)+'te','phase':_0x58a16e(0x14c),'always':!![]},'sessions:snapshot':{'priority':'P0','category':_0x58a16e(0x19a),'event':_0x58a16e(0x14e)+_0x58a16e(0x19e)+'t','phase':_0x58a16e(0x165),'errorOnly':!![]},'logs:report':{'priority':'P0','category':_0x58a16e(0x100),'event':_0x58a16e(0x187)+_0x58a16e(0x114),'phase':_0x58a16e(0x14c),'always':!![]},'logs:export':{'priority':'P0','category':'logs','event':'logs_exp'+_0x58a16e(0x114),'phase':'request','always':!![]},'app:file:choose':{'priority':'P0','category':_0x58a16e(0x12a),'event':_0x58a16e(0x105)+_0x58a16e(0x1a8),'phase':'request','always':!![]},'files:read':{'priority':'P0','category':_0x58a16e(0x12a),'event':_0x58a16e(0x1aa)+'d','phase':'request','always':!![]},'files:select-file':{'priority':'P0','category':_0x58a16e(0x12a),'event':_0x58a16e(0x14f)+'ect','phase':_0x58a16e(0x14c),'always':!![]},'models:complete':{'priority':'P0','category':'model','event':_0x58a16e(0x143)+_0x58a16e(0x17f),'phase':'request','always':!![]},'agents:create':{'priority':'P1','category':_0x58a16e(0x11d),'event':_0x58a16e(0x142)+_0x58a16e(0x15f),'phase':_0x58a16e(0x14c),'always':!![]},'agents:update':{'priority':'P1','category':_0x58a16e(0x11d),'event':_0x58a16e(0x1af)+'date','phase':_0x58a16e(0x14c),'always':!![]},'agents:delete':{'priority':'P1','category':_0x58a16e(0x11d),'event':'agent_de'+'lete','phase':_0x58a16e(0x14c),'always':!![]},'agents:list':{'priority':'P1','category':_0x58a16e(0x11d),'event':_0x58a16e(0x135)+_0x58a16e(0x16a),'phase':_0x58a16e(0x165),'errorOnly':!![]},'skills:install':{'priority':'P1','category':'skill','event':_0x58a16e(0xfc)+_0x58a16e(0x111),'phase':'request','always':!![]},'skills:import-zip':{'priority':'P1','category':'skill','event':_0x58a16e(0x17e)+'port_zip','phase':'request','always':!![]},'skills:update':{'priority':'P1','category':_0x58a16e(0x146),'event':'skill_up'+_0x58a16e(0x173),'phase':'request','always':!![]},'skills:delete':{'priority':'P1','category':_0x58a16e(0x146),'event':_0x58a16e(0x115)+_0x58a16e(0x17c),'phase':'request','always':!![]},'skills:status':{'priority':'P1','category':_0x58a16e(0x146),'event':'skills_s'+_0x58a16e(0x175),'phase':'query','errorOnly':!![]},'plugins:update-config':{'priority':'P1','category':'plugin','event':_0x58a16e(0x1a9)+_0x58a16e(0x18a)+_0x58a16e(0x173),'phase':_0x58a16e(0x14c),'always':!![]},'plugins:enable':{'priority':'P1','category':_0x58a16e(0x13a),'event':'plugin_e'+_0x58a16e(0x129),'phase':_0x58a16e(0x14c),'always':!![]},'plugins:disable':{'priority':'P1','category':_0x58a16e(0x13a),'event':_0x58a16e(0xf9)+_0x58a16e(0x190),'phase':'request','always':!![]},'config:connector:save':{'priority':'P1','category':'connecto'+'r','event':_0x58a16e(0x1a7)+_0x58a16e(0x123),'phase':_0x58a16e(0x14c),'always':!![]},'config:connector-session:start':{'priority':'P1','category':_0x58a16e(0x1a7)+'r','event':_0x58a16e(0x1a7)+_0x58a16e(0x140)+_0x58a16e(0x191),'phase':_0x58a16e(0x14c),'always':!![]},'config:connector-session:cancel':{'priority':'P1','category':_0x58a16e(0x1a7)+'r','event':_0x58a16e(0x1a7)+_0x58a16e(0x140)+_0x58a16e(0xfb),'phase':_0x58a16e(0x14c),'always':!![]},'config:connector-session:complete':{'priority':'P1','category':_0x58a16e(0x1a7)+'r','event':'connecto'+_0x58a16e(0x140)+_0x58a16e(0x125)+'te','phase':_0x58a16e(0x14c),'always':!![]},'cron:create':{'priority':'P1','category':_0x58a16e(0x15d),'event':_0x58a16e(0x184)+_0x58a16e(0x109),'phase':_0x58a16e(0x14c),'always':!![]},'cron:update':{'priority':'P1','category':_0x58a16e(0x15d),'event':_0x58a16e(0x138)+_0x58a16e(0x109),'phase':_0x58a16e(0x14c),'always':!![]},'cron:remove':{'priority':'P1','category':'cron','event':_0x58a16e(0x18b)+_0x58a16e(0x1ab),'phase':_0x58a16e(0x14c),'always':!![]},'cron:run-once':{'priority':'P1','category':'cron','event':_0x58a16e(0x131)+'_once','phase':'request','always':!![]},'app:generated-files:upsert':{'priority':'P1','category':_0x58a16e(0x155)+_0x58a16e(0x12b),'event':_0x58a16e(0x155)+_0x58a16e(0x169)+_0x58a16e(0xfe),'phase':_0x58a16e(0x14c),'always':!![]},'app:generated-files:hide':{'priority':'P1','category':_0x58a16e(0x155)+_0x58a16e(0x12b),'event':_0x58a16e(0x155)+'d_file_h'+_0x58a16e(0x1a4),'phase':_0x58a16e(0x14c),'always':!![]},'app:generated-files:hide-by-session':{'priority':'P1','category':_0x58a16e(0x155)+_0x58a16e(0x12b),'event':_0x58a16e(0x155)+_0x58a16e(0x1a1)+_0x58a16e(0x12c)+_0x58a16e(0x112),'phase':_0x58a16e(0x14c),'always':!![]},'app:generated-files:delete':{'priority':'P1','category':_0x58a16e(0x155)+'d_files','event':_0x58a16e(0x155)+_0x58a16e(0x12e)+_0x58a16e(0x12f),'phase':_0x58a16e(0x14c),'always':!![]},'app:generated-files:reveal':{'priority':'P1','category':_0x58a16e(0x155)+'d_files','event':_0x58a16e(0x155)+_0x58a16e(0x164)+_0x58a16e(0x10b),'phase':'request','always':!![]},'artifacts:upsert':{'priority':'P1','category':_0x58a16e(0x155)+_0x58a16e(0x12b),'event':'artifact'+_0x58a16e(0x163),'phase':_0x58a16e(0x14c),'always':!![]},'artifacts:hide':{'priority':'P1','category':'generate'+'d_files','event':_0x58a16e(0x170)+_0x58a16e(0x136),'phase':_0x58a16e(0x14c),'always':!![]},'artifacts:delete':{'priority':'P1','category':_0x58a16e(0x155)+_0x58a16e(0x12b),'event':'artifact'+_0x58a16e(0x150),'phase':_0x58a16e(0x14c),'always':!![]},'artifacts:reveal':{'priority':'P1','category':_0x58a16e(0x155)+_0x58a16e(0x12b),'event':_0x58a16e(0x170)+_0x58a16e(0x166),'phase':_0x58a16e(0x14c),'always':!![]},'window:minimize':{'priority':'P2','category':'window','event':_0x58a16e(0x188)+'inimize','phase':'request','always':![]},'window:toggle-maximize':{'priority':'P2','category':_0x58a16e(0x195),'event':_0x58a16e(0x183)+_0x58a16e(0x120)+_0x58a16e(0x16c),'phase':'request','always':![]},'window:close':{'priority':'P2','category':_0x58a16e(0x195),'event':_0x58a16e(0x104)+_0x58a16e(0x17b),'phase':_0x58a16e(0x14c),'always':!![]},'app:tray:set-close':{'priority':'P2','category':_0x58a16e(0x119),'event':_0x58a16e(0x15e)+'se_setti'+_0x58a16e(0x1a6)+'e','phase':_0x58a16e(0x14c),'always':!![]},'app:clipboard:write':{'priority':'P2','category':_0x58a16e(0x15b)+'d','event':_0x58a16e(0x15b)+'d_write','phase':_0x58a16e(0x14c),'errorOnly':!![]},'app:open-url':{'priority':'P2','category':_0x58a16e(0x11b),'event':_0x58a16e(0x181)+'ernal_ur'+'l','phase':_0x58a16e(0x14c),'always':!![]},'app:file:download-local':{'priority':'P2','category':_0x58a16e(0x12a),'event':'file_dow'+_0x58a16e(0x13b)+_0x58a16e(0x107),'phase':_0x58a16e(0x14c),'errorOnly':!![]},'app:file:choose-folder':{'priority':'P2','category':'file','event':'folder_c'+'hoose','phase':_0x58a16e(0x14c),'errorOnly':!![]},'app:system:open-folder':{'priority':'P2','category':_0x58a16e(0x12a),'event':_0x58a16e(0x14a)+'pen','phase':'request','errorOnly':!![]},'app:startup:set':{'priority':'P2','category':_0x58a16e(0x119),'event':_0x58a16e(0x196)+_0x58a16e(0x13f)+_0x58a16e(0x1ad),'phase':_0x58a16e(0x14c),'always':!![]},'models:set-settings':{'priority':'P2','category':'settings','event':_0x58a16e(0x13c)+_0x58a16e(0x15c)+_0x58a16e(0xfd),'phase':'request','always':!![]},'models:set-self-operated':{'priority':'P2','category':_0x58a16e(0x119),'event':_0x58a16e(0x18d)+_0x58a16e(0x17a)+_0x58a16e(0x19b)+'ate','phase':'request','always':!![]},'workspace:open-directory':{'priority':'P2','category':'workspac'+'e','event':_0x58a16e(0x151)+_0x58a16e(0x189)+_0x58a16e(0x149),'phase':'request','always':!![]},'workspace:write-shared-context':{'priority':'P2','category':_0x58a16e(0x151)+'e','event':'workspac'+'e_shared'+'_context'+'_write','phase':_0x58a16e(0x14c),'always':!![]},'openclaw:gateway-restart':{'priority':'P1','category':_0x58a16e(0x19c),'event':'gateway_'+_0x58a16e(0x106),'phase':_0x58a16e(0x14c),'always':!![]},'openclaw:open-cli-window':{'priority':'P2','category':_0x58a16e(0x19c),'event':_0x58a16e(0x186)+_0x58a16e(0x11a),'phase':_0x58a16e(0x14c),'always':!![]},'terminal:create':{'priority':'P2','category':_0x58a16e(0x141),'event':_0x58a16e(0x141)+_0x58a16e(0x1a0),'phase':_0x58a16e(0x14c),'always':!![]},'terminal:close':{'priority':'P2','category':_0x58a16e(0x141),'event':'terminal'+'_close','phase':_0x58a16e(0x14c),'always':!![]},'terminal:input':{'priority':'P2','category':_0x58a16e(0x141),'event':'terminal'+_0x58a16e(0x13d),'phase':_0x58a16e(0x14c),'errorOnly':!![]},'terminal:resize':{'priority':'P2','category':_0x58a16e(0x141),'event':'terminal'+_0x58a16e(0x139),'phase':'request','errorOnly':!![]}},CONNECTOR_SAVE_CHANNEL_RE=/^config:connector:save-/;function _0x8335(_0x17392d,_0x33d1b7){_0x17392d=_0x17392d-0xf5;const _0x2e2644=_0x2e26();let _0x83356c=_0x2e2644[_0x17392d];return _0x83356c;}function hashValue(_0x15dc69){const _0x4d5a86=_0x58a16e;return createHash(_0x4d5a86(0x154))[_0x4d5a86(0x1ad)](String(_0x15dc69??''))[_0x4d5a86(0x117)](_0x4d5a86(0x101))[_0x4d5a86(0xf5)](0x0,0xa);}function compactText(_0x476d1f,_0x16a1c4=USER_EVENT_PREVIEW_LENGTH){const _0x4f850e=_0x58a16e;return String(_0x476d1f??'')[_0x4f850e(0x12d)](/\s+/g,'\x20')[_0x4f850e(0x198)]()[_0x4f850e(0xf5)](0x0,_0x16a1c4);}function redactFileName(_0x7ce2c7){const _0x351307=_0x58a16e,_0x41907=basename(String(_0x7ce2c7||'')[_0x351307(0x198)]());if(!_0x41907)return'';const _0x6afcda=extname(_0x41907),_0x2fb1c7=_0x6afcda?_0x41907[_0x351307(0xf5)](0x0,-_0x6afcda['length']):_0x41907,_0x2926aa=compactText(_0x2fb1c7,0x10);return(_0x2926aa||_0x351307(0x12a))+'_'+hashValue(_0x41907)+_0x6afcda;}function summarizeAttachment(_0xec28fb){const _0x4a744a=_0x58a16e;if(!_0xec28fb||typeof _0xec28fb!==_0x4a744a(0x19d)){const _0xd0d2a3=String(_0xec28fb||'');return{'type':_0x4a744a(0x12a),'fileName':redactFileName(_0xd0d2a3)};}const _0x1e396f=_0xec28fb,_0x11b620=_0x1e396f[_0x4a744a(0x130)]||_0x1e396f[_0x4a744a(0xf8)]||_0x1e396f[_0x4a744a(0x147)]||_0x1e396f[_0x4a744a(0x13e)]||_0x1e396f[_0x4a744a(0x192)]||'';return{'type':_0x1e396f[_0x4a744a(0x11c)]||_0x1e396f[_0x4a744a(0x1ac)]||_0x4a744a(0x12a),'mimeType':_0x1e396f[_0x4a744a(0x16f)]||_0x1e396f[_0x4a744a(0x1a2)]||undefined,'fileName':redactFileName(_0x11b620),'size':Number[_0x4a744a(0x180)](_0x1e396f[_0x4a744a(0x160)])?_0x1e396f[_0x4a744a(0x160)]:undefined};}export function summarizeUserEventAttachments(_0x50da63={}){const _0x12d1db=_0x58a16e,_0x112ffd=_0x50da63&&typeof _0x50da63==='object'?_0x50da63:{},_0xc0db06=[_0x112ffd[_0x12d1db(0x177)+'s'],_0x112ffd['files'],_0x112ffd[_0x12d1db(0x10d)+'nts'],_0x112ffd[_0x12d1db(0x159)]]['filter'](Array[_0x12d1db(0x16e)]),_0x5b5e7d=_0xc0db06[_0x12d1db(0x134)]()[_0x12d1db(0x176)](summarizeAttachment)[_0x12d1db(0xf7)](Boolean);return{'count':_0x5b5e7d[_0x12d1db(0x14d)],'types':[...new Set(_0x5b5e7d[_0x12d1db(0x176)](_0x114749=>_0x114749[_0x12d1db(0x16f)]||_0x114749[_0x12d1db(0x11c)])['filter'](Boolean))],'files':_0x5b5e7d['slice'](0x0,0xa),'truncated':_0x5b5e7d['length']>0xa};}function inferSessionKey(_0x370b47={}){const _0x3a4e32=_0x58a16e;if(!_0x370b47||typeof _0x370b47!==_0x3a4e32(0x19d))return undefined;return _0x370b47[_0x3a4e32(0x194)+'ey']||_0x370b47[_0x3a4e32(0x152)]||_0x370b47[_0x3a4e32(0x168)+'d']||_0x370b47[_0x3a4e32(0x19a)]?.['key']||_0x370b47[_0x3a4e32(0x127)]?.[_0x3a4e32(0x194)+'ey']||undefined;}function inferRunId(_0x12972d={},_0x42aa1c={}){const _0x37eeec=_0x58a16e;if(_0x12972d&&typeof _0x12972d===_0x37eeec(0x19d)){const _0x1761fa=_0x12972d[_0x37eeec(0x132)]||_0x12972d[_0x37eeec(0x153)+'d']||_0x12972d[_0x37eeec(0x157)+'ncyKey'];if(_0x1761fa)return _0x1761fa;}if(_0x42aa1c&&typeof _0x42aa1c===_0x37eeec(0x19d))return _0x42aa1c[_0x37eeec(0x132)]||_0x42aa1c[_0x37eeec(0x153)+'d']||undefined;return undefined;}function inferAgentId(_0x5a11fa={},_0xb4dfed={}){const _0x330d69=_0x58a16e;if(_0x5a11fa&&typeof _0x5a11fa===_0x330d69(0x19d)){const _0x2064b4=_0x5a11fa[_0x330d69(0x103)]||_0x5a11fa[_0x330d69(0x11d)]||_0x5a11fa[_0x330d69(0x193)];if(_0x2064b4)return _0x2064b4;}if(_0xb4dfed&&typeof _0xb4dfed===_0x330d69(0x19d))return _0xb4dfed['agentId']||_0xb4dfed[_0x330d69(0x11d)]?.['id'];return undefined;}function inferInputSummary(_0x27bc9f={}){const _0x5d60a9=_0x58a16e;if(!_0x27bc9f||typeof _0x27bc9f!=='object')return undefined;const _0x1477b6=_0x27bc9f['message']||_0x27bc9f[_0x5d60a9(0x128)]||_0x27bc9f[_0x5d60a9(0x178)]||_0x27bc9f['content']||_0x27bc9f['text'];if(typeof _0x1477b6!==_0x5d60a9(0x108)||!_0x1477b6['trim']())return undefined;return summarizeText(_0x1477b6,USER_EVENT_PREVIEW_LENGTH);}function inferOutputSummary(_0x5b3c9e={}){const _0x4df101=_0x58a16e;if(!_0x5b3c9e||typeof _0x5b3c9e!==_0x4df101(0x19d))return undefined;const _0x4c913f=_0x5b3c9e[_0x4df101(0x116)]||_0x5b3c9e[_0x4df101(0x110)]||_0x5b3c9e[_0x4df101(0x172)]||_0x5b3c9e['output']||_0x5b3c9e['answer'];if(typeof _0x4c913f!==_0x4df101(0x108)||!_0x4c913f[_0x4df101(0x198)]())return undefined;return summarizeText(_0x4c913f,USER_EVENT_PREVIEW_LENGTH);}function inferVisibleError(_0x5acefa,_0x12d4f7){const _0x395e51=_0x58a16e;if(_0x5acefa)return _0x5acefa instanceof Error?_0x5acefa[_0x395e51(0x116)]:String(_0x5acefa);if(_0x12d4f7&&typeof _0x12d4f7===_0x395e51(0x19d))return _0x12d4f7[_0x395e51(0x1ae)+_0x395e51(0x1a5)]||_0x12d4f7[_0x395e51(0x116)]||_0x12d4f7[_0x395e51(0x174)]?.['message']||undefined;return undefined;}function normalizePolicy(_0x4ae04c){const _0x18157c=_0x58a16e;if(CHANNEL_POLICIES[_0x4ae04c])return CHANNEL_POLICIES[_0x4ae04c];if(CONNECTOR_SAVE_CHANNEL_RE[_0x18157c(0x17d)](_0x4ae04c))return{'priority':'P1','category':_0x18157c(0x1a7)+'r','event':'connecto'+_0x18157c(0x123),'phase':_0x18157c(0x14c),'always':!![]};return null;}export function getUserOperationPolicy(_0x16780d){return normalizePolicy(String(_0x16780d||''));}function summarizeSafeIpcPayload(_0x4e8b8e={}){const _0x3e9670=_0x58a16e,_0x72ab5b=summarizePayload(_0x4e8b8e,{'maxDepth':0x3,'textPreviewLength':0xa0});if(!_0x72ab5b||typeof _0x72ab5b!==_0x3e9670(0x19d)||Array['isArray'](_0x72ab5b))return _0x72ab5b;const _0x4012e7={..._0x72ab5b};for(const _0x5a6c10 of['filePath'+'s',_0x3e9670(0x179),_0x3e9670(0x10d)+_0x3e9670(0x144),_0x3e9670(0x159)]){if(_0x5a6c10 in _0x4012e7)_0x4012e7[_0x5a6c10]=summarizeUserEventAttachments(_0x4e8b8e);}return _0x4012e7;}export function createUserEventWriter({logsDir:_0x31dff9,diagnosticsWriter:_0x39cdff}={}){const _0x29bcbd=_0x58a16e;if(!_0x31dff9)return null;const _0x2d6ace=join(_0x31dff9,_0x29bcbd(0x197),'user-eve'+'nt.log');!loggers[_0x29bcbd(0x16d)](_0x2d6ace)&&loggers[_0x29bcbd(0x185)](_0x2d6ace,createFileLogger({'filePath':_0x2d6ace,'context':_0x29bcbd(0x137)+'nt','maxBytes':USER_EVENT_LOG_MAX_BYTES,'keepCount':USER_EVENT_LOG_KEEP_COUNT,'level':_0x29bcbd(0x161)}));const _0x2410a6=loggers[_0x29bcbd(0x10a)](_0x2d6ace);async function _0x497947(_0x49114b={}){const _0x31f6d8=_0x29bcbd,_0x42659b=Number[_0x31f6d8(0x180)](_0x49114b['ts'])?_0x49114b['ts']:Date[_0x31f6d8(0xff)](),_0x1f579f=_0x49114b['level']||(_0x49114b['status']===_0x31f6d8(0xfa)?_0x31f6d8(0x174):_0x31f6d8(0x161)),_0x37f2de=_0x49114b[_0x31f6d8(0x156)]||'observed',_0x74bec5=_0x49114b['event']||'user_eve'+'nt',_0x1d8781=_0x49114b['category']||_0x31f6d8(0x10e),_0x313bcf=_0x49114b[_0x31f6d8(0x194)+'ey']||_0x49114b['sessionI'+'d'],_0x35ac7b=_0x49114b[_0x31f6d8(0x132)],_0x28de64=_0x49114b['agentId'],_0x3dcffa=_0x49114b['visibleE'+'rror'],_0x1c8efc=redactLogValue({'ts':_0x42659b,'priority':_0x49114b[_0x31f6d8(0x10c)],'category':_0x1d8781,'event':_0x74bec5,'status':_0x37f2de,'sessionKey':_0x313bcf,'runId':_0x35ac7b,'agentId':_0x28de64,'message':compactText(_0x49114b['message']||_0x74bec5,USER_EVENT_PREVIEW_LENGTH),'inputSummary':_0x49114b[_0x31f6d8(0x18c)+_0x31f6d8(0xf6)],'outputSummary':_0x49114b[_0x31f6d8(0x10f)+'mmary'],'attachments':_0x49114b[_0x31f6d8(0x10d)+_0x31f6d8(0x144)],'visibleError':_0x3dcffa,'durationMs':_0x49114b[_0x31f6d8(0x148)+'Ms'],'meta':_0x49114b[_0x31f6d8(0x127)]});await _0x2410a6?.[_0x31f6d8(0x161)](JSON[_0x31f6d8(0x18f)+'y'](_0x1c8efc)),await _0x39cdff?.['writeEve'+'nt']({'ts':_0x42659b,'level':_0x1f579f,'category':_0x1d8781,'event':_0x74bec5,'message':_0x49114b[_0x31f6d8(0x116)]||_0x74bec5,'sessionId':_0x313bcf,'runId':_0x35ac7b,'agentId':_0x28de64,'durationMs':_0x49114b[_0x31f6d8(0x148)+'Ms'],'meta':summarizePayload({'priority':_0x49114b['priority'],'status':_0x37f2de,'visibleError':_0x3dcffa,'inputSummary':_0x49114b[_0x31f6d8(0x18c)+_0x31f6d8(0xf6)],'outputSummary':_0x49114b['outputSu'+'mmary'],'attachments':_0x49114b[_0x31f6d8(0x10d)+_0x31f6d8(0x144)],..._0x49114b['meta']},{'maxDepth':0x5,'textPreviewLength':DIAGNOSTIC_EVENT_PREVIEW_LENGTH})},{'captureIncident':_0x49114b[_0x31f6d8(0x124)+_0x31f6d8(0x11f)]===![]?![]:_0x49114b[_0x31f6d8(0x124)+'ncident']===!![]||_0x1f579f===_0x31f6d8(0x174)});}return{'filePath':_0x2d6ace,'write':_0x497947,'fromIpc':async({channel:_0x43864e,payload:_0x1d7ce6,result:_0x4be87e,error:_0x10527c,durationMs:_0x2ba0d6,status:_0x2e1b1a})=>{const _0x5361a2=_0x29bcbd,_0x54e670=getUserOperationPolicy(_0x43864e);if(!_0x54e670)return;const _0x552be0=_0x2e1b1a===_0x5361a2(0xfa)||Boolean(_0x10527c);if(_0x54e670[_0x5361a2(0x158)+'y']&&!_0x552be0)return;if(!_0x54e670['always']&&!_0x552be0)return;const _0x1e08fd=_0x2e1b1a||(_0x552be0?'failed':'succeede'+'d');await _0x497947({'priority':_0x54e670[_0x5361a2(0x10c)],'category':_0x54e670['category'],'event':_0x54e670['event']+'.'+_0x1e08fd,'status':_0x1e08fd,'level':_0x552be0?_0x5361a2(0x174):_0x5361a2(0x161),'message':_0x43864e+'\x20'+_0x1e08fd,'sessionKey':inferSessionKey(_0x1d7ce6),'runId':inferRunId(_0x1d7ce6,_0x4be87e),'agentId':inferAgentId(_0x1d7ce6,_0x4be87e),'inputSummary':inferInputSummary(_0x1d7ce6),'outputSummary':inferOutputSummary(_0x4be87e),'attachments':summarizeUserEventAttachments(_0x1d7ce6),'visibleError':inferVisibleError(_0x10527c,_0x4be87e),'durationMs':_0x2ba0d6,'captureIncident':![],'meta':{'channel':_0x43864e,'phase':_0x54e670['phase'],'payload':summarizeSafeIpcPayload(_0x1d7ce6),..._0x552be0?{'error':summarizeError(_0x10527c)}:{}}});}};}
@@ -1 +1 @@
1
- (function(_0x34f5bb,_0x563fab){const _0x125bac=_0x236d,_0x4940ac=_0x34f5bb();while(!![]){try{const _0x59a704=-parseInt(_0x125bac(0x18a))/0x1*(-parseInt(_0x125bac(0x189))/0x2)+parseInt(_0x125bac(0x181))/0x3*(parseInt(_0x125bac(0x182))/0x4)+parseInt(_0x125bac(0x18f))/0x5+-parseInt(_0x125bac(0x17b))/0x6+parseInt(_0x125bac(0x180))/0x7*(-parseInt(_0x125bac(0x193))/0x8)+-parseInt(_0x125bac(0x184))/0x9*(parseInt(_0x125bac(0x18d))/0xa)+-parseInt(_0x125bac(0x179))/0xb;if(_0x59a704===_0x563fab)break;else _0x4940ac['push'](_0x4940ac['shift']());}catch(_0x1ef499){_0x4940ac['push'](_0x4940ac['shift']());}}}(_0x55dc,0xa67b4));import{existsSync}from'node:fs';import{cp,mkdir,readFile,readdir,rm,stat,writeFile}from'node:fs/promises';import{basename,dirname,join,relative}from'node:path';export function asRecord(_0x5201c8){const _0x4aaa6d=_0x236d;return _0x5201c8&&typeof _0x5201c8===_0x4aaa6d(0x18b)&&!Array['isArray'](_0x5201c8)?_0x5201c8:{};}export function asStringArray(_0x28468c){const _0x11dcb1=_0x236d;return Array['isArray'](_0x28468c)?_0x28468c[_0x11dcb1(0x186)](_0x2795a7=>typeof _0x2795a7===_0x11dcb1(0x18c)&&_0x2795a7['trim']())[_0x11dcb1(0x191)](_0x3dba15=>_0x3dba15[_0x11dcb1(0x18e)]()):[];}export function dedupeStrings(_0x484041){const _0x458186=_0x236d;return[...new Set(_0x484041[_0x458186(0x186)](Boolean))];}export function getTrimmedString(_0x37899a){const _0x93c8f7=_0x236d;return typeof _0x37899a===_0x93c8f7(0x18c)?_0x37899a[_0x93c8f7(0x18e)]():'';}export async function readJson(_0x34449b,_0xaadd3b={}){const _0x50d557=_0x236d;try{return JSON[_0x50d557(0x17c)](await readFile(_0x34449b,_0x50d557(0x188)));}catch{return _0xaadd3b;}}export async function writeJson(_0x37518e,_0x145f6b){const _0x4ccd9a=_0x236d;await mkdir(dirname(_0x37518e),{'recursive':!![]}),await writeFile(_0x37518e,JSON[_0x4ccd9a(0x192)+'y'](_0x145f6b,null,0x2)+'\x0a',_0x4ccd9a(0x188));}function _0x55dc(){const _0x1264f8=['parse','openclaw','ory','json','306047cqBxhk','3vmGUYe','3361724lGpZti','isDirect','27mqljhm','package.','filter','.plugin.','utf8','1156toKNxT','892RhEmnW','object','string','2188670FgbrhA','trim','2636225tZxIHr','replaceA','map','stringif','8waQXUF','0.0.0','2639010CdFNdm','name','1566672qeYIsB'];_0x55dc=function(){return _0x1264f8;};return _0x55dc();}export async function copyDirFresh(_0x9085d3,_0x2be1b0){await rm(_0x2be1b0,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(dirname(_0x2be1b0),{'recursive':!![]}),await cp(_0x9085d3,_0x2be1b0,{'recursive':!![]});}function _0x236d(_0x2a46f4,_0x10ad11){_0x2a46f4=_0x2a46f4-0x178;const _0x55dc8c=_0x55dc();let _0x236dbe=_0x55dc8c[_0x2a46f4];return _0x236dbe;}export async function ensureDir(_0x1ede4b){await mkdir(_0x1ede4b,{'recursive':!![]});}export function pathExists(_0xb32803){return existsSync(_0xb32803);}export async function listDirs(_0x4951e3){const _0x4c625e=_0x236d;try{const _0x2a1ba2=await readdir(_0x4951e3,{'withFileTypes':!![],'encoding':_0x4c625e(0x188)});return _0x2a1ba2[_0x4c625e(0x186)](_0x241de7=>_0x241de7[_0x4c625e(0x183)+_0x4c625e(0x17e)]())['map'](_0x39e158=>_0x39e158[_0x4c625e(0x17a)]);}catch{return[];}}export async function getPackageMetadata(_0xcb5a4b){const _0x294983=_0x236d,_0x4a83f7=await readJson(join(_0xcb5a4b,_0x294983(0x185)+'json'),{}),_0x43aac1=asRecord(_0x4a83f7[_0x294983(0x17d)]);return{'name':getTrimmedString(_0x4a83f7[_0x294983(0x17a)])||basename(_0xcb5a4b),'version':getTrimmedString(_0x4a83f7['version'])||_0x294983(0x178),'pluginId':getTrimmedString(_0x43aac1['id'])||getTrimmedString(_0x4a83f7[_0x294983(0x17d)+'Id'])||basename(_0xcb5a4b)};}export async function readPluginManifest(_0x84ab4f){const _0x1abef1=_0x236d,_0x5778b8=join(_0x84ab4f,'openclaw'+_0x1abef1(0x187)+_0x1abef1(0x17f)),_0x53fb1d=await readJson(_0x5778b8,{});return asRecord(_0x53fb1d);}export async function hasFile(_0x1bfa51){try{const _0x4412c1=await stat(_0x1bfa51);return _0x4412c1['isFile']();}catch{return![];}}export function toRuntimeRelative(_0x21aa65,_0xa378a8){const _0x1cf2bb=_0x236d;return relative(_0x21aa65,_0xa378a8)[_0x1cf2bb(0x190)+'ll']('\x5c','/');}
1
+ (function(_0xce7d1a,_0x51065e){const _0x133f0b=_0x3d05,_0x3eef08=_0xce7d1a();while(!![]){try{const _0x326e29=-parseInt(_0x133f0b(0x1f0))/0x1*(-parseInt(_0x133f0b(0x1ec))/0x2)+parseInt(_0x133f0b(0x1de))/0x3+-parseInt(_0x133f0b(0x1e3))/0x4*(-parseInt(_0x133f0b(0x1ea))/0x5)+parseInt(_0x133f0b(0x1dc))/0x6+-parseInt(_0x133f0b(0x1e1))/0x7*(-parseInt(_0x133f0b(0x1db))/0x8)+parseInt(_0x133f0b(0x1ee))/0x9+-parseInt(_0x133f0b(0x1d7))/0xa;if(_0x326e29===_0x51065e)break;else _0x3eef08['push'](_0x3eef08['shift']());}catch(_0x309be5){_0x3eef08['push'](_0x3eef08['shift']());}}}(_0x3b86,0xbd8f3));import{existsSync}from'node:fs';import{cp,mkdir,readFile,readdir,rm,stat,writeFile}from'node:fs/promises';import{basename,dirname,join,relative}from'node:path';export function asRecord(_0x30b4c9){const _0x2e83be=_0x3d05;return _0x30b4c9&&typeof _0x30b4c9===_0x2e83be(0x1eb)&&!Array[_0x2e83be(0x1da)](_0x30b4c9)?_0x30b4c9:{};}export function asStringArray(_0xa1aa69){const _0x509db6=_0x3d05;return Array[_0x509db6(0x1da)](_0xa1aa69)?_0xa1aa69[_0x509db6(0x1e7)](_0x12678e=>typeof _0x12678e==='string'&&_0x12678e[_0x509db6(0x1ef)]())['map'](_0x2af95c=>_0x2af95c[_0x509db6(0x1ef)]()):[];}export function dedupeStrings(_0x1e051f){const _0x552a14=_0x3d05;return[...new Set(_0x1e051f[_0x552a14(0x1e7)](Boolean))];}export function getTrimmedString(_0x13f2e9){const _0x32a6f9=_0x3d05;return typeof _0x13f2e9===_0x32a6f9(0x1e0)?_0x13f2e9[_0x32a6f9(0x1ef)]():'';}export async function readJson(_0x28fc81,_0x281203={}){const _0x5c2664=_0x3d05;try{return JSON[_0x5c2664(0x1e5)](await readFile(_0x28fc81,'utf8'));}catch{return _0x281203;}}export async function writeJson(_0x542154,_0x3732de){const _0x5cfd85=_0x3d05;await mkdir(dirname(_0x542154),{'recursive':!![]}),await writeFile(_0x542154,JSON[_0x5cfd85(0x1dd)+'y'](_0x3732de,null,0x2)+'\x0a',_0x5cfd85(0x1d9));}export async function copyDirFresh(_0x5d3b52,_0x5a1343){await rm(_0x5a1343,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(dirname(_0x5a1343),{'recursive':!![]}),await cp(_0x5d3b52,_0x5a1343,{'recursive':!![]});}function _0x3b86(){const _0xb5276d=['parse','isFile','filter','openclaw','package.','5RFpDGi','object','1434fbpqlC','name','10777248cJOebO','trim','1042bDCIln','version','map','60790180rNeRGA','isDirect','utf8','isArray','2264IFtRWb','8543580MloiSL','stringif','4446036qlJXtP','ory','string','35161wQXcNf','0.0.0','2333664NJiNlA','replaceA'];_0x3b86=function(){return _0xb5276d;};return _0x3b86();}export async function ensureDir(_0x165649){await mkdir(_0x165649,{'recursive':!![]});}export function pathExists(_0xa0737f){return existsSync(_0xa0737f);}export async function listDirs(_0x47b277){const _0x56a904=_0x3d05;try{const _0x5a0263=await readdir(_0x47b277,{'withFileTypes':!![],'encoding':_0x56a904(0x1d9)});return _0x5a0263[_0x56a904(0x1e7)](_0x21a66a=>_0x21a66a[_0x56a904(0x1d8)+_0x56a904(0x1df)]())[_0x56a904(0x1d6)](_0x54c075=>_0x54c075[_0x56a904(0x1ed)]);}catch{return[];}}export async function getPackageMetadata(_0x20cab7){const _0x55bd5d=_0x3d05,_0x47067a=await readJson(join(_0x20cab7,_0x55bd5d(0x1e9)+'json'),{}),_0x167866=asRecord(_0x47067a[_0x55bd5d(0x1e8)]);return{'name':getTrimmedString(_0x47067a['name'])||basename(_0x20cab7),'version':getTrimmedString(_0x47067a[_0x55bd5d(0x1d5)])||_0x55bd5d(0x1e2),'pluginId':getTrimmedString(_0x167866['id'])||getTrimmedString(_0x47067a[_0x55bd5d(0x1e8)+'Id'])||basename(_0x20cab7)};}function _0x3d05(_0x357c96,_0x5bd8a8){_0x357c96=_0x357c96-0x1d5;const _0x3b8697=_0x3b86();let _0x3d0594=_0x3b8697[_0x357c96];return _0x3d0594;}export async function readPluginManifest(_0xaf0f22){const _0x53b151=_0x3d05,_0x451e90=join(_0xaf0f22,_0x53b151(0x1e8)+'.plugin.'+'json'),_0x4308bc=await readJson(_0x451e90,{});return asRecord(_0x4308bc);}export async function hasFile(_0x39b677){const _0xba764f=_0x3d05;try{const _0x310355=await stat(_0x39b677);return _0x310355[_0xba764f(0x1e6)]();}catch{return![];}}export function toRuntimeRelative(_0x2f3fd0,_0x263f95){const _0x11f3fb=_0x3d05;return relative(_0x2f3fd0,_0x263f95)[_0x11f3fb(0x1e4)+'ll']('\x5c','/');}