@wps365-open/comate-cli 0.0.18 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/auth/login.js +1 -1
- package/dist/commands/auth/logout.js +1 -1
- package/dist/commands/auth/status.js +1 -1
- package/dist/commands/code/config.js +1 -0
- package/dist/commands/code/create.js +1 -1
- package/dist/commands/code/deploy.js +1 -1
- package/dist/commands/code/download.js +1 -0
- package/dist/commands/code/fetch-html.js +1 -0
- package/dist/commands/code/files.js +1 -1
- package/dist/commands/code/lookup.js +1 -1
- package/dist/commands/code/publish.js +1 -1
- package/dist/commands/code/recall.js +1 -1
- package/dist/commands/code/resume.js +1 -1
- package/dist/commands/code/send.js +1 -1
- package/dist/commands/code/status.js +1 -1
- package/dist/commands/code/upload.js +1 -1
- package/dist/commands/update.js +1 -1
- package/dist/hooks/init/logger.js +1 -1
- package/dist/hooks/prerun/update-checker.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/account/login-service.js +1 -1
- package/dist/lib/config/constants.js +1 -1
- package/dist/lib/config/manager.js +1 -1
- package/dist/lib/extends/command.js +1 -1
- package/dist/lib/http/auth-headers.js +1 -1
- package/dist/lib/http/client.js +1 -1
- package/dist/lib/log/logger.js +1 -1
- package/dist/lib/service/auth.js +1 -1
- package/dist/lib/service/cloud-agent.js +1 -1
- package/dist/lib/service/cloud-publish.js +1 -1
- package/dist/lib/service/manage.js +1 -1
- package/dist/lib/service/project-context.js +1 -1
- package/oclif.manifest.json +153 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x3b1fef=a15_0x201c;(function(_0x5752a0,_0x5a6c6a){const _0x3500db=a15_0x201c,_0x1b0445=_0x5752a0();while(!![]){try{const _0x1e45ca=-parseInt(_0x3500db(0xd5))/0x1+parseInt(_0x3500db(0xee))/0x2+parseInt(_0x3500db(0x101))/0x3+-parseInt(_0x3500db(0xe1))/0x4+-parseInt(_0x3500db(0xef))/0x5+-parseInt(_0x3500db(0xcd))/0x6*(-parseInt(_0x3500db(0xe4))/0x7)+-parseInt(_0x3500db(0xbf))/0x8*(-parseInt(_0x3500db(0xc2))/0x9);if(_0x1e45ca===_0x5a6c6a)break;else _0x1b0445['push'](_0x1b0445['shift']());}catch(_0x5afaf1){_0x1b0445['push'](_0x1b0445['shift']());}}}(a15_0x2fd5,0x35e71));import a15_0x1ba2ee from'node:fs';import a15_0x4045ac from'node:path';import{Flags}from'@oclif/core';import a15_0x242c83 from'../../lib/extends/command.js';import{uploadFiles}from'../../lib/service/cloud-agent.js';const EXCLUDE_DIRS=new Set([a15_0x3b1fef(0xd4),'.svn','.hg',a15_0x3b1fef(0xfa),a15_0x3b1fef(0xfe),a15_0x3b1fef(0xd7),a15_0x3b1fef(0xc8)]);export default class CodeUpload extends a15_0x242c83{static [a15_0x3b1fef(0xd3)]='上传本地文件或目录到云端\x20Agent\x20会话的\x20sandbox';static [a15_0x3b1fef(0xce)]=!![];static [a15_0x3b1fef(0xd1)]=[a15_0x3b1fef(0xc4),'<%=\x20config.bin\x20%>\x20code\x20upload\x20--thread-id\x20thread_xxx\x20-d\x20./index.html\x20--json',a15_0x3b1fef(0xf4)];static [a15_0x3b1fef(0xca)]={'thread-id':Flags[a15_0x3b1fef(0xf9)]({'description':a15_0x3b1fef(0xf3),'required':!![]}),'dir':Flags['string']({'char':'d','description':a15_0x3b1fef(0xc0),'required':!![]}),'prefix':Flags['string']({'description':a15_0x3b1fef(0xea),'default':a15_0x3b1fef(0xdf)})};async[a15_0x3b1fef(0xe6)](){const _0x108d67=a15_0x3b1fef;await this[_0x108d67(0xf2)]();const {flags:_0xcf0453}=await this[_0x108d67(0xda)](CodeUpload),_0x554ed6=this[_0x108d67(0xfd)](),_0x547ecd=a15_0x4045ac['resolve'](_0xcf0453[_0x108d67(0xf7)]);!a15_0x1ba2ee[_0x108d67(0xe7)](_0x547ecd)&&this['error'](_0x108d67(0xd0)+_0x547ecd);const _0x167574=_0xcf0453[_0x108d67(0xe2)][_0x108d67(0xfc)](/\/+$/,'');!_0x554ed6&&await this[_0x108d67(0xe8)](_0x108d67(0xe3));const _0x2539a8=this[_0x108d67(0xd9)](_0x547ecd,_0x167574);_0x2539a8[_0x108d67(0xc9)]===0x0&&(this[_0x108d67(0xcc)](),this[_0x108d67(0xc3)](_0x108d67(0xdc)));const _0x341b11=_0x2539a8[_0x108d67(0xcf)]((_0x2d61d1,_0x575caa)=>{const _0x387f54=_0x108d67,_0x378110=_0x575caa[_0x387f54(0xc7)];return _0x2d61d1+(Buffer['isBuffer'](_0x378110)?_0x378110['length']:Buffer[_0x387f54(0xeb)](_0x378110));},0x0);!_0x554ed6&&(this[_0x108d67(0xcc)](_0x108d67(0xf0)+_0x2539a8[_0x108d67(0xc9)]+_0x108d67(0xfb)+formatBytes(_0x341b11)+')'),await this[_0x108d67(0xe8)]('正在上传...'));try{await uploadFiles(_0xcf0453[_0x108d67(0xc5)],_0x2539a8);const _0x3a2e8b=_0x2539a8[_0x108d67(0xbe)](_0x414423=>_0x414423[_0x108d67(0xbd)]);this[_0x108d67(0xcc)](_0x108d67(0xf1)+_0x2539a8[_0x108d67(0xc9)]+'\x20个文件');if(!_0x554ed6)for(const _0x418296 of _0x3a2e8b){this['log']('\x20\x20'+_0x418296);}return{'thread_id':_0xcf0453[_0x108d67(0xc5)],'uploaded':_0x2539a8[_0x108d67(0xc9)],'total_bytes':_0x341b11,'files':_0x3a2e8b,'prefix':_0x167574};}catch(_0x478129){this[_0x108d67(0xcc)](),this[_0x108d67(0xc3)](_0x478129 instanceof Error?_0x478129[_0x108d67(0xec)]:String(_0x478129));}}[a15_0x3b1fef(0xd9)](_0x312348,_0x1f7753){const _0x260c51=a15_0x3b1fef,_0x126ec8=a15_0x1ba2ee['statSync'](_0x312348);if(_0x126ec8[_0x260c51(0xe9)]())return this[_0x260c51(0xd8)](_0x312348,_0x1f7753);if(_0x126ec8[_0x260c51(0xe0)]())return this[_0x260c51(0x100)](_0x312348,_0x1f7753);throw new Error(_0x260c51(0xc6)+_0x312348);}[a15_0x3b1fef(0xd8)](_0xf49b33,_0x13380b){const _0x41507e=a15_0x3b1fef,_0x39bde6=a15_0x4045ac[_0x41507e(0xdd)](_0xf49b33),_0x1e95b3=a15_0x1ba2ee[_0x41507e(0xed)](_0xf49b33),_0x2b68eb=[{'name':_0x13380b+'/'+_0x39bde6,'content':_0x1e95b3}];return _0x39bde6!==_0x41507e(0xf8)&&_0x39bde6[_0x41507e(0xf6)](_0x41507e(0xcb))&&_0x2b68eb[_0x41507e(0xe5)]({'name':_0x13380b+'/index.html','content':_0x1e95b3}),_0x2b68eb;}[a15_0x3b1fef(0x100)](_0x3e6f68,_0x14e62e){const _0x38d365=[],_0x452212=_0x2ad0d8=>{const _0x186114=a15_0x201c;for(const _0x43ff8e of a15_0x1ba2ee['readdirSync'](_0x2ad0d8,{'withFileTypes':!![]})){if(_0x43ff8e[_0x186114(0xbd)]['startsWith']('.')&&EXCLUDE_DIRS[_0x186114(0xde)](_0x43ff8e[_0x186114(0xbd)]))continue;const _0x40df26=a15_0x4045ac[_0x186114(0xff)](_0x2ad0d8,_0x43ff8e['name']);if(_0x43ff8e['isDirectory']()){if(EXCLUDE_DIRS[_0x186114(0xde)](_0x43ff8e[_0x186114(0xbd)]))continue;_0x452212(_0x40df26);}else{if(_0x43ff8e[_0x186114(0xe9)]()){const _0x26e101=a15_0x4045ac[_0x186114(0xc1)](_0x3e6f68,_0x40df26)[_0x186114(0xf5)](a15_0x4045ac[_0x186114(0xd2)])[_0x186114(0xff)]('/');_0x38d365[_0x186114(0xe5)]({'name':_0x14e62e+'/'+_0x26e101,'content':a15_0x1ba2ee[_0x186114(0xed)](_0x40df26)});}}}};return _0x452212(_0x3e6f68),_0x38d365;}}function a15_0x201c(_0x52407c,_0x16483b){_0x52407c=_0x52407c-0xbd;const _0x2fd5ad=a15_0x2fd5();let _0x201c3f=_0x2fd5ad[_0x52407c];return _0x201c3f;}function formatBytes(_0x1dea19){const _0x5c05f5=a15_0x3b1fef;if(_0x1dea19<0x400)return _0x1dea19+'\x20B';if(_0x1dea19<0x400*0x400)return(_0x1dea19/0x400)['toFixed'](0x1)+_0x5c05f5(0xdb);return(_0x1dea19/(0x400*0x400))['toFixed'](0x1)+_0x5c05f5(0xd6);}function a15_0x2fd5(){const _0xb68f40=['collectDirectory','397965iOXSSi','name','map','8eFvChg','本地文件或目录路径','relative','657819ytRENM','error','<%=\x20config.bin\x20%>\x20code\x20upload\x20--thread-id\x20thread_xxx\x20-d\x20./my-site\x20--json','thread-id','不支持的文件类型:\x20','content','skills','length','flags','.html','stopLoading','666bTuCnW','enableJsonFlag','reduce','路径不存在:\x20','examples','sep','description','.git','135094lMXxFh','\x20MB','coverage','collectSingleFile','collectLocalFiles','parse','\x20KB','没有可上传的文件','basename','has','code','isDirectory','1077692tIUIOS','prefix','正在收集文件...','24745iqOcVr','push','run','existsSync','createLoading','isFile','sandbox\x20中的目标目录前缀','byteLength','message','readFileSync','161998ncwBRL','269140HHUVCp','收集到\x20','上传完成:\x20','requireAuth','会话\x20ID','<%=\x20config.bin\x20%>\x20code\x20upload\x20--thread-id\x20thread_xxx\x20-d\x20./dist\x20--prefix\x20code\x20--json','split','endsWith','dir','index.html','string','node_modules','\x20个文件\x20(','replace','jsonEnabled','.cache','join'];a15_0x2fd5=function(){return _0xb68f40;};return a15_0x2fd5();}
|
package/dist/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x3376b4=a16_0x2cc6;function a16_0x1ce9(){const _0x54e428=['../../package.json','788529uVuWrv','message','1153881EVNTCc','npm\x20view\x20@wps365-open/comate-cli\x20version\x20--registry=https://registry.npmjs.org/','739726bEMdMo','\x20...','cyan','更新成功:\x20v','正在更新\x20v','createLoading','trim','50iVamkD','enableJsonFlag','pipe','utf-8','29565547GfzIgf','943581VoXQAO','1188120gKCyYL','colorize','6BTHMfN','12ZDiClf','5oySxPF','3759180BTbqlc','version','stopLoading','\x0a手动更新:\x20npm\x20install\x20-g\x20@wps365-open/comate-cli@latest','正在检查最新版本...','error','log','\x20→\x20v'];a16_0x1ce9=function(){return _0x54e428;};return a16_0x1ce9();}(function(_0x251b97,_0x8ce23){const _0x42cdfc=a16_0x2cc6,_0x20b54f=_0x251b97();while(!![]){try{const _0x2380a2=-parseInt(_0x42cdfc(0xf9))/0x1+parseInt(_0x42cdfc(0xed))/0x2*(parseInt(_0x42cdfc(0xfc))/0x3)+-parseInt(_0x42cdfc(0xff))/0x4*(parseInt(_0x42cdfc(0xfe))/0x5)+-parseInt(_0x42cdfc(0xfd))/0x6*(parseInt(_0x42cdfc(0xe9))/0x7)+-parseInt(_0x42cdfc(0xfa))/0x8+parseInt(_0x42cdfc(0xeb))/0x9*(-parseInt(_0x42cdfc(0xf4))/0xa)+parseInt(_0x42cdfc(0xf8))/0xb;if(_0x2380a2===_0x8ce23)break;else _0x20b54f['push'](_0x20b54f['shift']());}catch(_0x340ade){_0x20b54f['push'](_0x20b54f['shift']());}}}(a16_0x1ce9,0x81379));import{execSync}from'node:child_process';function a16_0x2cc6(_0xd007f2,_0x398f51){_0xd007f2=_0xd007f2-0xe9;const _0x1ce9a2=a16_0x1ce9();let _0x2cc661=_0x1ce9a2[_0xd007f2];return _0x2cc661;}import a16_0x12334a from'../lib/extends/command.js';export default class Update extends a16_0x12334a{static ['description']='更新\x20comate-cli\x20到最新版本';static [a16_0x3376b4(0xf5)]=!![];async['run'](){const _0x15280f=a16_0x3376b4;await this['parse'](Update);const {createRequire:_0x40b321}=await import('node:module'),_0x37d45f=_0x40b321(import.meta.url),_0xebebd5=_0x37d45f(_0x15280f(0x107)),_0x559a27=_0xebebd5[_0x15280f(0x100)];!this['jsonEnabled']()&&(this[_0x15280f(0x105)]('当前版本:\x20'+this[_0x15280f(0xfb)]('v'+_0x559a27,_0x15280f(0xef))),await this[_0x15280f(0xf2)](_0x15280f(0x103)));let _0x576977;try{_0x576977=execSync(_0x15280f(0xec),{'encoding':'utf-8','timeout':0x3a98})[_0x15280f(0xf3)]();}catch{this[_0x15280f(0x101)](),this['error']('无法获取最新版本信息,请检查网络连接');}if(_0x576977===_0x559a27)return this['stopLoading']('已是最新版本\x20v'+_0x559a27),{'previousVersion':_0x559a27,'currentVersion':_0x559a27,'updated':![]};!this['jsonEnabled']()&&(this[_0x15280f(0x101)]('发现新版本:\x20v'+_0x576977),await this[_0x15280f(0xf2)](_0x15280f(0xf1)+_0x559a27+_0x15280f(0x106)+_0x576977+_0x15280f(0xee)));try{return execSync('npm\x20install\x20-g\x20@wps365-open/comate-cli@latest\x20--registry=https://registry.npmjs.org/',{'encoding':_0x15280f(0xf7),'timeout':0xea60,'stdio':_0x15280f(0xf6)}),this[_0x15280f(0x101)](_0x15280f(0xf0)+_0x559a27+_0x15280f(0x106)+_0x576977),{'previousVersion':_0x559a27,'currentVersion':_0x576977,'updated':!![]};}catch(_0x1c4862){this['stopLoading'](),this[_0x15280f(0x104)]('更新失败:\x20'+(_0x1c4862 instanceof Error?_0x1c4862[_0x15280f(0xea)]:String(_0x1c4862))+_0x15280f(0x102));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a17_0x176087=a17_0x12fe;(function(_0x1f3299,_0x3393af){const _0xa4fbcc=a17_0x12fe,_0xb422cb=_0x1f3299();while(!![]){try{const _0x3d0f0f=parseInt(_0xa4fbcc(0x1d5))/0x1+parseInt(_0xa4fbcc(0x1d3))/0x2*(parseInt(_0xa4fbcc(0x1d1))/0x3)+-parseInt(_0xa4fbcc(0x1d7))/0x4*(-parseInt(_0xa4fbcc(0x1dd))/0x5)+-parseInt(_0xa4fbcc(0x1cf))/0x6+parseInt(_0xa4fbcc(0x1d9))/0x7+parseInt(_0xa4fbcc(0x1db))/0x8+-parseInt(_0xa4fbcc(0x1da))/0x9*(parseInt(_0xa4fbcc(0x1ce))/0xa);if(_0x3d0f0f===_0x3393af)break;else _0xb422cb['push'](_0xb422cb['shift']());}catch(_0x220a52){_0xb422cb['push'](_0xb422cb['shift']());}}}(a17_0x2e17,0x3bb7e));import{randomUUID}from'node:crypto';import{join}from'node:path';function a17_0x2e17(){const _0x3e9342=['146538fjwDjd','log','20MqouEx','.log','43800cgMdMu','parseInt','1448gvPdoM','SIGINT','3357970OMIqHF','4405302hDRTrj','1648872iXQAeV','env','5645QkgGxB','SIGTERM','20osNQJu','2419290FOtlUI','exit'];a17_0x2e17=function(){return _0x3e9342;};return a17_0x2e17();}function a17_0x12fe(_0x594980,_0x1a5c35){_0x594980=_0x594980-0x1ce;const _0x2e17cc=a17_0x2e17();let _0x12fe67=_0x2e17cc[_0x594980];return _0x12fe67;}import{homedir}from'node:os';import{NewLoggerWithLevel,CleanLogFile}from'../../lib/log/logger.js';import{COMATE_DIR_NAME,ENV_VERBOSE}from'../../lib/config/constants.js';const LOG_SUFFIX=a17_0x176087(0x1d4),hook=async function(){const _0x20b15b=a17_0x176087,_0x15997d=0x3,_0x1fc69a=process[_0x20b15b(0x1dc)][ENV_VERBOSE],_0x413ac9=_0x1fc69a?Math['min'](0x5,Math['max'](0x1,Number[_0x20b15b(0x1d6)](_0x1fc69a,0xa)||_0x15997d)):_0x15997d,_0x16b602=randomUUID(),_0x32c480=join(homedir(),COMATE_DIR_NAME,_0x20b15b(0x1d2),''+_0x16b602+LOG_SUFFIX);NewLoggerWithLevel(_0x413ac9,_0x32c480);const _0x2102a8=()=>{CleanLogFile();};process['on'](_0x20b15b(0x1d0),_0x2102a8),process['on'](_0x20b15b(0x1d8),()=>{_0x2102a8(),process['exit'](0x82);}),process['on'](_0x20b15b(0x1de),()=>{const _0x2bba3=_0x20b15b;_0x2102a8(),process[_0x2bba3(0x1d0)](0x8f);});};export default hook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x571a35,_0x1d6e5a){const _0x1fad6a=a18_0x5772,_0x185257=_0x571a35();while(!![]){try{const _0x207a03=parseInt(_0x1fad6a(0x122))/0x1+parseInt(_0x1fad6a(0x11a))/0x2*(parseInt(_0x1fad6a(0x10d))/0x3)+-parseInt(_0x1fad6a(0x113))/0x4*(parseInt(_0x1fad6a(0x120))/0x5)+parseInt(_0x1fad6a(0x11e))/0x6*(-parseInt(_0x1fad6a(0x11b))/0x7)+parseInt(_0x1fad6a(0x11c))/0x8+parseInt(_0x1fad6a(0x124))/0x9+-parseInt(_0x1fad6a(0x110))/0xa*(parseInt(_0x1fad6a(0x10c))/0xb);if(_0x207a03===_0x1d6e5a)break;else _0x185257['push'](_0x185257['shift']());}catch(_0x4bcf65){_0x185257['push'](_0x185257['shift']());}}}(a18_0x4ce2,0x24883));async function checkForUpdates(_0x47a0e2){const _0x5717d8=a18_0x5772;try{const _0x4f879b=await fetch(_0x5717d8(0x10f),{'signal':AbortSignal[_0x5717d8(0x116)](0x7d0)});if(!_0x4f879b['ok'])return{'hasUpdate':![],'currentVersion':_0x47a0e2,'latestVersion':_0x47a0e2};const _0x50a595=await _0x4f879b[_0x5717d8(0x117)](),_0x2c2815=_0x50a595[_0x5717d8(0x11f)];return{'hasUpdate':_0x2c2815!==_0x47a0e2,'currentVersion':_0x47a0e2,'latestVersion':_0x2c2815};}catch{return{'hasUpdate':![],'currentVersion':_0x47a0e2,'latestVersion':_0x47a0e2};}}const hook=async function(_0xe8bfdb){const _0x158fd1=a18_0x5772,_0x5abfd2=_0xe8bfdb[_0x158fd1(0x121)]['version'],_0x3a0bbf={'hasUpdate':![],'currentVersion':_0x5abfd2,'latestVersion':_0x5abfd2},_0x599d12=await Promise[_0x158fd1(0x111)]([checkForUpdates(_0x5abfd2),new Promise(_0x4e1859=>setTimeout(()=>_0x4e1859(_0x3a0bbf),0x7d0))]);if(_0x599d12[_0x158fd1(0x126)]){const _0x2c0a1c=process[_0x158fd1(0x112)][0x1]?.[_0x158fd1(0x10e)](_0x158fd1(0x11d));if(_0x2c0a1c)return;this[_0x158fd1(0x114)](_0x158fd1(0x115)+_0x599d12[_0x158fd1(0x125)]+_0x158fd1(0x119)+_0x599d12[_0x158fd1(0x123)]),this[_0x158fd1(0x114)](_0x158fd1(0x118));}};export default hook;function a18_0x5772(_0x41a9cf,_0x402734){_0x41a9cf=_0x41a9cf-0x10c;const _0x4ce29c=a18_0x4ce2();let _0x5772c6=_0x4ce29c[_0x41a9cf];return _0x5772c6;}function a18_0x4ce2(){const _0x328b36=['log','\x0a\x20\x20更新可用:\x20','timeout','json','\x20\x20请运行\x20comate-cli\x20update\x20进行更新\x0a','\x20→\x20','42106qbdnTx','133mEgjHJ','1201056pzDyFE','_npx','8838GTJrdw','version','28315bhiOAD','config','192501enPjqj','latestVersion','1193589TlfMxS','currentVersion','hasUpdate','24398vVPRQi','3UKbtsE','includes','https://registry.npmjs.org/@wps365-open/comate-cli/latest','390IwWIbJ','race','argv','164iqZwkc'];a18_0x4ce2=function(){return _0x328b36;};return a18_0x4ce2();}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a19_0x5e5b(_0xeb6ded,_0x1c62ce){_0xeb6ded=_0xeb6ded-0x1ea;var _0x28f020=a19_0x28f0();var _0x5e5b0e=_0x28f020[_0xeb6ded];return _0x5e5b0e;}function a19_0x28f0(){var _0xe32e39=['9200024agkaLx','29PLrXpp','458755cgJILy','1987872nkRLSi','873677lAzoLz','40396RcciMf','1317051Ejqqfz','1705164LsXsUB'];a19_0x28f0=function(){return _0xe32e39;};return a19_0x28f0();}(function(_0x4f9783,_0x5c0bd6){var _0x2c24de=a19_0x5e5b,_0x64cbee=_0x4f9783();while(!![]){try{var _0x11cda6=parseInt(_0x2c24de(0x1f1))/0x1*(-parseInt(_0x2c24de(0x1ed))/0x2)+-parseInt(_0x2c24de(0x1ee))/0x3+parseInt(_0x2c24de(0x1eb))/0x4+parseInt(_0x2c24de(0x1ea))/0x5+-parseInt(_0x2c24de(0x1ef))/0x6+-parseInt(_0x2c24de(0x1ec))/0x7+parseInt(_0x2c24de(0x1f0))/0x8;if(_0x11cda6===_0x5c0bd6)break;else _0x64cbee['push'](_0x64cbee['shift']());}catch(_0xde8585){_0x64cbee['push'](_0x64cbee['shift']());}}}(a19_0x28f0,0x4a73e));export{run}from'@oclif/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27970d,_0x320263){const _0x222508=a20_0x3f03,_0x5dfa7b=_0x27970d();while(!![]){try{const _0xf9f5bf=-parseInt(_0x222508(0x19a))/0x1+-parseInt(_0x222508(0x1ac))/0x2*(parseInt(_0x222508(0x1a3))/0x3)+-parseInt(_0x222508(0x1b2))/0x4*(-parseInt(_0x222508(0x196))/0x5)+-parseInt(_0x222508(0x1aa))/0x6+-parseInt(_0x222508(0x19c))/0x7+-parseInt(_0x222508(0x1b0))/0x8*(-parseInt(_0x222508(0x1a0))/0x9)+parseInt(_0x222508(0x19e))/0xa;if(_0xf9f5bf===_0x320263)break;else _0x5dfa7b['push'](_0x5dfa7b['shift']());}catch(_0x285cd9){_0x5dfa7b['push'](_0x5dfa7b['shift']());}}}(a20_0x5780,0x2c01b));function a20_0x3f03(_0x422f23,_0x5a609f){_0x422f23=_0x422f23-0x193;const _0x57801a=a20_0x5780();let _0x3f031b=_0x57801a[_0x422f23];return _0x3f031b;}import a20_0x4d949f from'node:http';import{randomUUID}from'node:crypto';function a20_0x5780(){const _0x42b035=['listen','random','10YfmhPx','/v7/devhub/users/login_callback','&state=','<html><body><h2>登录成功,请返回终端继续操作</h2><script>setTimeout(()=>window.close(),1000)</script></body></html>','21066wutvuX','EADDRINUSE','1235584tHSNpZ','searchParams','3149380nEgaAS','启动本地服务器失败:\x20','18SJQYsG','text/html;\x20charset=utf-8','\x20被占用,请重试','208014YEXzzT','error','127.0.0.1','回调参数不完整,请重试','app_id','state','端口\x20','301338fZrgdR','end','4xRvpgJ','/?cb=','close','saveUserInfo','618152BBcvyo','get','194504Ooaiyf','/oauth-callback','?cb=','登录超时(60\x20秒),请重试','code','pathname','http://localhost:','message','writeHead'];a20_0x5780=function(){return _0x42b035;};return a20_0x5780();}import a20_0x4a59a1 from'open';import{configManager}from'../config/manager.js';import{getUserToken,getCurrentUser}from'../service/auth.js';import{AGENTSPACE_BASE,WPS_ACCOUNT_BASE,OAUTH_PORT_MIN,OAUTH_PORT_MAX,OAUTH_TIMEOUT_MS}from'../config/constants.js';function pickPort(){const _0xe93453=a20_0x3f03;return OAUTH_PORT_MIN+Math['floor'](Math[_0xe93453(0x195)]()*(OAUTH_PORT_MAX-OAUTH_PORT_MIN+0x1));}function buildLoginUrl(_0x12aee6,_0x6afb22){const _0x398ed8=a20_0x3f03,_0x47eeaa=AGENTSPACE_BASE+_0x398ed8(0x197)+(_0x398ed8(0x1b4)+encodeURIComponent(_0x6afb22)+_0x398ed8(0x198)+_0x12aee6);return WPS_ACCOUNT_BASE+_0x398ed8(0x1ad)+encodeURIComponent(_0x47eeaa);}export async function loginWithBrowser(){const _0x106461=a20_0x3f03,_0x34c9e5=pickPort(),_0x1056ef=randomUUID(),_0x2bce1e=_0x106461(0x1b8)+_0x34c9e5+_0x106461(0x1b3),_0x14a600=await new Promise((_0x48baad,_0x1c7ec4)=>{const _0x5b5ea9=_0x106461,_0x2cf3f6=setTimeout(()=>{const _0x275494=a20_0x3f03;_0x2ddddc[_0x275494(0x1ae)](),_0x1c7ec4(new Error(_0x275494(0x1b5)));},OAUTH_TIMEOUT_MS),_0x2ddddc=a20_0x4d949f['createServer']((_0x1aac0c,_0x33801e)=>{const _0x530998=a20_0x3f03,_0x3c0a41=new URL(_0x1aac0c['url'],_0x530998(0x1b8)+_0x34c9e5);if(_0x3c0a41[_0x530998(0x1b7)]!==_0x530998(0x1b3)){_0x33801e['writeHead'](0x194),_0x33801e[_0x530998(0x1ab)]();return;}const _0xbdf8ab=_0x3c0a41[_0x530998(0x19d)]['get'](_0x530998(0x1b6)),_0x32d135=_0x3c0a41[_0x530998(0x19d)]['get'](_0x530998(0x1a8)),_0x5dea66=_0x3c0a41['searchParams'][_0x530998(0x1b1)](_0x530998(0x1a7));_0x33801e[_0x530998(0x193)](0xc8,{'Content-Type':_0x530998(0x1a1)}),_0x33801e[_0x530998(0x1ab)](_0x530998(0x199)),clearTimeout(_0x2cf3f6),_0x2ddddc[_0x530998(0x1ae)](),!_0xbdf8ab||!_0x32d135||!_0x5dea66?_0x1c7ec4(new Error(_0x530998(0x1a6))):_0x48baad({'code':_0xbdf8ab,'state':_0x32d135,'app_id':_0x5dea66});});_0x2ddddc[_0x5b5ea9(0x194)](_0x34c9e5,_0x5b5ea9(0x1a5),async()=>{const _0x1ff207=_0x5b5ea9;try{const _0x40e55f=buildLoginUrl(_0x1056ef,_0x2bce1e);await a20_0x4a59a1(_0x40e55f);}catch(_0x19e87a){clearTimeout(_0x2cf3f6),_0x2ddddc[_0x1ff207(0x1ae)](),_0x1c7ec4(new Error('无法打开浏览器:\x20'+(_0x19e87a instanceof Error?_0x19e87a[_0x1ff207(0x1b9)]:String(_0x19e87a))));}}),_0x2ddddc['on'](_0x5b5ea9(0x1a4),_0x33eff3=>{const _0x2a69e9=_0x5b5ea9;clearTimeout(_0x2cf3f6),_0x33eff3['code']===_0x2a69e9(0x19b)?_0x1c7ec4(new Error(_0x2a69e9(0x1a9)+_0x34c9e5+_0x2a69e9(0x1a2))):_0x1c7ec4(new Error(_0x2a69e9(0x19f)+_0x33eff3[_0x2a69e9(0x1b9)]));});});if(_0x14a600[_0x106461(0x1a8)]!==_0x1056ef)throw new Error('登录状态校验失败,请重试');const _0x1d5578=await getUserToken(_0x14a600[_0x106461(0x1a7)],_0x14a600[_0x106461(0x1b6)],_0x14a600[_0x106461(0x1a8)]);configManager['saveSid'](_0x1d5578);const _0x2f74fb=await getCurrentUser();return configManager[_0x106461(0x1af)](_0x2f74fb),{'sid':_0x1d5578,'nickname':_0x2f74fb['nickname']};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x298f4e=a21_0x1f84;(function(_0x26f8e3,_0x44531a){const _0x37a3dc=a21_0x1f84,_0x1b93ce=_0x26f8e3();while(!![]){try{const _0x11afc5=parseInt(_0x37a3dc(0x1cc))/0x1+-parseInt(_0x37a3dc(0x1d4))/0x2+-parseInt(_0x37a3dc(0x1c6))/0x3+-parseInt(_0x37a3dc(0x1c9))/0x4*(parseInt(_0x37a3dc(0x1c8))/0x5)+-parseInt(_0x37a3dc(0x1c5))/0x6+-parseInt(_0x37a3dc(0x1d5))/0x7*(parseInt(_0x37a3dc(0x1d1))/0x8)+parseInt(_0x37a3dc(0x1d0))/0x9*(parseInt(_0x37a3dc(0x1cb))/0xa);if(_0x11afc5===_0x44531a)break;else _0x1b93ce['push'](_0x1b93ce['shift']());}catch(_0x651d6){_0x1b93ce['push'](_0x1b93ce['shift']());}}}(a21_0x3eb5,0x8d9a9));import a21_0x3dc480 from'node:path';function a21_0x1f84(_0x61bf60,_0x14a04f){_0x61bf60=_0x61bf60-0x1c4;const _0x3eb597=a21_0x3eb5();let _0x1f848a=_0x3eb597[_0x61bf60];return _0x1f848a;}import{homedir}from'node:os';export const COMATE_DIR_NAME=a21_0x298f4e(0x1ce);export const COMATE_HOME=a21_0x3dc480['join'](homedir(),COMATE_DIR_NAME);export const CONFIG_FILE=a21_0x3dc480[a21_0x298f4e(0x1d3)](COMATE_HOME,a21_0x298f4e(0x1cd));export const LOG_DIR=a21_0x3dc480['join'](COMATE_HOME,'log');function a21_0x3eb5(){const _0x4cdaa2=['336468uWHdIB','config.json','.comate-cli','https://account.wps.cn','9tQUKEE','3344iqHthM','https://365.kdocs.cn/3rd/open','join','1162162ooMmjz','2618UZABzB','https://open.wps.cn/app-studio','https://o.wpsgo.com/app-studio/runtime','5399826EHFPqZ','267156QqLoZp','https://agentspace.wps.cn','3206920UnQddG','4TJGnJr','COMATE_VERBOSE','26113610cVPPah'];a21_0x3eb5=function(){return _0x4cdaa2;};return a21_0x3eb5();}export const ENV_VERBOSE=a21_0x298f4e(0x1ca);export const AGENTSPACE_BASE=a21_0x298f4e(0x1c7);export const APP_STUDIO_BASE=a21_0x298f4e(0x1d6);export const WPS_ACCOUNT_BASE=a21_0x298f4e(0x1cf);export const OPEN_PLATFORM_BASE=a21_0x298f4e(0x1d2);export const RUNTIME_BASE=a21_0x298f4e(0x1c4);export const OAUTH_PORT_MIN=0x2e0f;export const OAUTH_PORT_MAX=0x2e22;export const OAUTH_TIMEOUT_MS=0xea60;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a22_0x42a1(_0x17a8e8,_0x362031){_0x17a8e8=_0x17a8e8-0x194;const _0x59b96f=a22_0x59b9();let _0x42a146=_0x59b96f[_0x17a8e8];return _0x42a146;}const a22_0xca6390=a22_0x42a1;(function(_0x55bb83,_0x4ef308){const _0x5d8679=a22_0x42a1,_0x3ac6d5=_0x55bb83();while(!![]){try{const _0x4a3157=parseInt(_0x5d8679(0x19b))/0x1+parseInt(_0x5d8679(0x1a1))/0x2*(-parseInt(_0x5d8679(0x1ab))/0x3)+-parseInt(_0x5d8679(0x19d))/0x4+parseInt(_0x5d8679(0x1a0))/0x5*(parseInt(_0x5d8679(0x1b5))/0x6)+-parseInt(_0x5d8679(0x198))/0x7*(-parseInt(_0x5d8679(0x194))/0x8)+parseInt(_0x5d8679(0x1ac))/0x9+-parseInt(_0x5d8679(0x197))/0xa;if(_0x4a3157===_0x4ef308)break;else _0x3ac6d5['push'](_0x3ac6d5['shift']());}catch(_0x1fdf41){_0x3ac6d5['push'](_0x3ac6d5['shift']());}}}(a22_0x59b9,0x19d94));import a22_0x3b1121 from'node:crypto';import a22_0x47d6dd from'node:fs';import{homedir}from'node:os';function a22_0x59b9(){const _0x1908dc=['token','toString','parse','save','wps_sid','mkdirSync','user_info','clear','env','final','29136aMnLMA','createDecipheriv','aes-256-gcm','1561670OXknyf','77qSMaBe','.wpscomate','WPS_SID','200300QhqOus','setAuthTag','657012cuvgxQ','readFileSync','saveUserInfo','45JPeHVv','2GwurqB','configPath','user_auth.json','from','writeFileSync','concat','update','subarray','trim','length','372891qVGEkO','1349388bvkQyo','base64','saveSid','invalid\x20ciphertext','string','utf-8','load','stringify','join','106866uTnvhC'];a22_0x59b9=function(){return _0x1908dc;};return a22_0x59b9();}import a22_0x1d67e4 from'node:path';import{CONFIG_FILE}from'./constants.js';const PI_CLIENT_AUTH_PATH=a22_0x1d67e4[a22_0xca6390(0x1b4)](homedir(),a22_0xca6390(0x199),'agent','auth',a22_0xca6390(0x1a3)),PI_CLIENT_KEY=Buffer[a22_0xca6390(0x1a4)]('WpsCom@te#2024!Secur3K3y_Agent!!',a22_0xca6390(0x1b1)),GCM_NONCE_LEN=0xc,GCM_TAG_LEN=0x10;function decryptPiClientToken(_0x18358a){const _0x1e2473=a22_0xca6390,_0x509a68=Buffer[_0x1e2473(0x1a4)](_0x18358a[_0x1e2473(0x1a9)](),_0x1e2473(0x1ad));if(_0x509a68[_0x1e2473(0x1aa)]<=GCM_NONCE_LEN+GCM_TAG_LEN)throw new Error(_0x1e2473(0x1af));const _0xe9e16b=_0x509a68[_0x1e2473(0x1a8)](0x0,GCM_NONCE_LEN),_0x1df661=_0x509a68[_0x1e2473(0x1a8)](GCM_NONCE_LEN,_0x509a68[_0x1e2473(0x1aa)]-GCM_TAG_LEN),_0x31a26a=_0x509a68['subarray'](_0x509a68[_0x1e2473(0x1aa)]-GCM_TAG_LEN),_0x2978c3=a22_0x3b1121[_0x1e2473(0x195)](_0x1e2473(0x196),PI_CLIENT_KEY,_0xe9e16b);return _0x2978c3[_0x1e2473(0x19c)](_0x31a26a),Buffer[_0x1e2473(0x1a6)]([_0x2978c3[_0x1e2473(0x1a7)](_0x1df661),_0x2978c3[_0x1e2473(0x1bf)]()])[_0x1e2473(0x1b7)](_0x1e2473(0x1b1));}function loadPiClientSid(){const _0x49dfb7=a22_0xca6390;try{const _0x368247=a22_0x47d6dd[_0x49dfb7(0x19e)](PI_CLIENT_AUTH_PATH,_0x49dfb7(0x1b1)),_0x30a1b8=JSON[_0x49dfb7(0x1b8)](_0x368247[_0x49dfb7(0x1a9)]());if(typeof _0x30a1b8[_0x49dfb7(0x1b6)]===_0x49dfb7(0x1b0)&&_0x30a1b8[_0x49dfb7(0x1b6)])return decryptPiClientToken(_0x30a1b8[_0x49dfb7(0x1b6)]);if(typeof _0x30a1b8[_0x49dfb7(0x1ba)]==='string'&&_0x30a1b8[_0x49dfb7(0x1ba)])return _0x30a1b8['wps_sid'];}catch{}return null;}export class ConfigManager{[a22_0xca6390(0x1a2)];constructor(_0x21c71f){const _0x4c8ebb=a22_0xca6390;this[_0x4c8ebb(0x1a2)]=_0x21c71f??CONFIG_FILE;}[a22_0xca6390(0x1b2)](){const _0x190b45=a22_0xca6390;let _0x4f3b94=null,_0x40f1cd=null;try{const _0x311184=a22_0x47d6dd[_0x190b45(0x19e)](this['configPath'],'utf-8'),_0x1db473=JSON['parse'](_0x311184);_0x40f1cd=_0x1db473[_0x190b45(0x1ba)]??null,_0x4f3b94=_0x1db473[_0x190b45(0x1bc)]??null;}catch{}const _0x4b5475=loadPiClientSid()??process[_0x190b45(0x1be)][_0x190b45(0x19a)]?.[_0x190b45(0x1a9)]()??_0x40f1cd;return{'wps_sid':_0x4b5475||null,'user_info':_0x4f3b94};}[a22_0xca6390(0x1b9)](_0x8b2a16){const _0x116965=a22_0xca6390,_0x50ed12=a22_0x1d67e4['dirname'](this['configPath']);a22_0x47d6dd[_0x116965(0x1bb)](_0x50ed12,{'recursive':!![]}),a22_0x47d6dd[_0x116965(0x1a5)](this['configPath'],JSON[_0x116965(0x1b3)](_0x8b2a16,null,0x2),_0x116965(0x1b1));}[a22_0xca6390(0x1ae)](_0x2bbb88){const _0x339a57=a22_0xca6390,_0xac1309=this[_0x339a57(0x1b2)]();_0xac1309[_0x339a57(0x1ba)]=_0x2bbb88,this[_0x339a57(0x1b9)](_0xac1309);}[a22_0xca6390(0x19f)](_0x345183){const _0x3c19a2=a22_0xca6390,_0x145f29=this[_0x3c19a2(0x1b2)]();_0x145f29[_0x3c19a2(0x1bc)]=_0x345183,this[_0x3c19a2(0x1b9)](_0x145f29);}[a22_0xca6390(0x1bd)](){const _0x46c0e5=a22_0xca6390;this[_0x46c0e5(0x1b9)]({'wps_sid':null,'user_info':null});}}export const configManager=new ConfigManager();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x54237c=a23_0x3fd2;(function(_0x3d1e53,_0x599a76){const _0x262b04=a23_0x3fd2,_0x229715=_0x3d1e53();while(!![]){try{const _0x446f8d=-parseInt(_0x262b04(0x11c))/0x1*(-parseInt(_0x262b04(0x134))/0x2)+-parseInt(_0x262b04(0x128))/0x3+-parseInt(_0x262b04(0x126))/0x4+-parseInt(_0x262b04(0x11f))/0x5+parseInt(_0x262b04(0x120))/0x6+parseInt(_0x262b04(0x125))/0x7+-parseInt(_0x262b04(0x132))/0x8;if(_0x446f8d===_0x599a76)break;else _0x229715['push'](_0x229715['shift']());}catch(_0x364918){_0x229715['push'](_0x229715['shift']());}}}(a23_0x32b3,0x609ad));function a23_0x3fd2(_0x18a35b,_0x26b6aa){_0x18a35b=_0x18a35b-0x11b;const _0x32b325=a23_0x32b3();let _0x3fd2e7=_0x32b325[_0x18a35b];return _0x3fd2e7;}import{Command}from'@oclif/core';function a23_0x32b3(){const _0x45cc19=['1350344qyWSLM','map','866zZBoQn','finally','log','start','exit','AUTH_REQUIRED','661RgZxdq','default','error','1542655ydudev','2750850rCHlga','wps_sid','未登录,请先执行\x20npx\x20--yes\x20@wps365-open/comate-cli@latest\x20auth\x20login','load','ora','2065357LcUvit','136380bgEtXM','stringify','397881APncRH','string','stop','_actionActive','spinner','stopLoading','logJson','colorize','createLoading','join'];a23_0x32b3=function(){return _0x45cc19;};return a23_0x32b3();}import a23_0x5b7658 from'chalk';import{configManager}from'../config/manager.js';import{FileOnly}from'../log/logger.js';export default class BaseCommand extends Command{[a23_0x54237c(0x12c)];['_actionActive']=![];[a23_0x54237c(0x12f)](_0x298214,_0x1485ae){return a23_0x5b7658[_0x1485ae](_0x298214);}async[a23_0x54237c(0x130)](_0x1839ad){const _0x31d6ac=a23_0x54237c,_0x3e7bd6=await import(_0x31d6ac(0x124));this[_0x31d6ac(0x12c)]=_0x3e7bd6[_0x31d6ac(0x11d)]({'text':_0x1839ad})[_0x31d6ac(0x137)](),this['_actionActive']=!![];}[a23_0x54237c(0x12d)](_0x4759d9){const _0x532bd4=a23_0x54237c;if(!this['spinner'])return;if(_0x4759d9)this[_0x532bd4(0x12c)]['succeed'](_0x4759d9);else this[_0x532bd4(0x12c)][_0x532bd4(0x12a)]();this[_0x532bd4(0x12c)]=undefined,this['_actionActive']=![];}async['requireAuth'](){const _0x3db509=a23_0x54237c,_0x1992b6=configManager[_0x3db509(0x123)]();return!_0x1992b6[_0x3db509(0x121)]&&(this['jsonEnabled']()&&(this[_0x3db509(0x12e)]({'status':'error','message':_0x3db509(0x122),'code':_0x3db509(0x11b)}),this[_0x3db509(0x138)](0x2)),this[_0x3db509(0x11e)](_0x3db509(0x122))),{'sid':_0x1992b6[_0x3db509(0x121)]};}[a23_0x54237c(0x136)](_0x4e130f,..._0x122872){const _0x490318=a23_0x54237c,_0x13ff42=[_0x4e130f,..._0x122872][_0x490318(0x133)](_0x22f229=>typeof _0x22f229===_0x490318(0x129)?_0x22f229:JSON[_0x490318(0x127)](_0x22f229))[_0x490318(0x131)]('\x20');FileOnly(_0x13ff42);if(this[_0x490318(0x12b)])this[_0x490318(0x12d)]();super[_0x490318(0x136)](_0x4e130f,..._0x122872);}async[a23_0x54237c(0x135)](_0x46b64f){const _0x4b73ff=a23_0x54237c;return this[_0x4b73ff(0x12d)](),super[_0x4b73ff(0x135)](_0x46b64f);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a24_0x46e4(){const _0x27540f=['3237728JnucZD','1016834GjPNFe','804904JsTwuf','173922kYPThe','wps_sid','752835sgTxyA','6yicwZg','application/json','191893wDPiAr','wps_sid=','384815bzFrYY'];a24_0x46e4=function(){return _0x27540f;};return a24_0x46e4();}function a24_0xe901(_0x2e69c4,_0xa9841c){_0x2e69c4=_0x2e69c4-0xf2;const _0x46e409=a24_0x46e4();let _0xe901ab=_0x46e409[_0x2e69c4];return _0xe901ab;}(function(_0xe51e71,_0x21837d){const _0x11bdbf=a24_0xe901,_0xe5f24e=_0xe51e71();while(!![]){try{const _0x28799e=parseInt(_0x11bdbf(0xf4))/0x1+-parseInt(_0x11bdbf(0xfa))/0x2+-parseInt(_0x11bdbf(0xfc))/0x3+-parseInt(_0x11bdbf(0xf9))/0x4+parseInt(_0x11bdbf(0xf6))/0x5*(-parseInt(_0x11bdbf(0xf2))/0x6)+parseInt(_0x11bdbf(0xf8))/0x7+parseInt(_0x11bdbf(0xf7))/0x8;if(_0x28799e===_0x21837d)break;else _0xe5f24e['push'](_0xe5f24e['shift']());}catch(_0x2f73ab){_0xe5f24e['push'](_0xe5f24e['shift']());}}}(a24_0x46e4,0x1eb50));import a24_0x5d3531 from'node:crypto';import{configManager}from'../config/manager.js';function generateCsrf(){return a24_0x5d3531['randomBytes'](0x10)['toString']('hex');}export function buildAuthHeaders(){const _0x381b6b=a24_0xe901,_0x54c613=configManager['load'](),_0x3c3bad=generateCsrf(),_0x3ee611={'Content-Type':_0x381b6b(0xf3),'X-CSRFToken':_0x3c3bad};return _0x54c613[_0x381b6b(0xfb)]&&(_0x3ee611['Cookie']=_0x381b6b(0xf5)+_0x54c613[_0x381b6b(0xfb)]+';csrf='+_0x3c3bad),_0x3ee611;}
|
package/dist/lib/http/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a25_0x5ed1(_0x3db854,_0x314043){_0x3db854=_0x3db854-0x13e;const _0x515413=a25_0x5154();let _0x5ed1b4=_0x515413[_0x3db854];return _0x5ed1b4;}const a25_0x350d7c=a25_0x5ed1;(function(_0x4a76d6,_0x5e025f){const _0x45521f=a25_0x5ed1,_0x41ccac=_0x4a76d6();while(!![]){try{const _0x5d9e9b=parseInt(_0x45521f(0x14c))/0x1+-parseInt(_0x45521f(0x152))/0x2*(-parseInt(_0x45521f(0x153))/0x3)+-parseInt(_0x45521f(0x144))/0x4*(-parseInt(_0x45521f(0x157))/0x5)+parseInt(_0x45521f(0x150))/0x6*(-parseInt(_0x45521f(0x14d))/0x7)+parseInt(_0x45521f(0x15d))/0x8*(-parseInt(_0x45521f(0x156))/0x9)+parseInt(_0x45521f(0x143))/0xa+parseInt(_0x45521f(0x140))/0xb*(-parseInt(_0x45521f(0x13e))/0xc);if(_0x5d9e9b===_0x5e025f)break;else _0x41ccac['push'](_0x41ccac['shift']());}catch(_0x4919d3){_0x41ccac['push'](_0x41ccac['shift']());}}}(a25_0x5154,0xf413d));import a25_0x552832 from'axios';import{configManager}from'../config/manager.js';function a25_0x5154(){const _0x13a2bf=['config','message','msg','360968DtPROZ','DNS\x20解析失败,请检查网络连接','create','clear','12mCNzWj','baseURL','17521449YRrRJs','网络错误:\x20','data','19313320uZxHdp','299240TUcBvq','post','get','baseUrl','initialize','url','登录已过期,请重新执行\x20npx\x20--yes\x20@wps365-open/comate-cli@latest\x20auth\x20login','code','183557AQSmDr','14MmvJPf','wrapError','getClient','3109170pvTYxh','axiosInstance','4FExuoB','434703QlUAKm','response','ENOTFOUND','99dgNKyO','115CpzQpH','ECONNREFUSED','status'];a25_0x5154=function(){return _0x13a2bf;};return a25_0x5154();}import{AGENTSPACE_BASE}from'../config/constants.js';import{buildAuthHeaders}from'./auth-headers.js';export class SimpleHttpClient{[a25_0x350d7c(0x151)]=null;['baseUrl'];constructor(_0x4a1e15){const _0x1f9111=a25_0x350d7c;this[_0x1f9111(0x147)]=_0x4a1e15??AGENTSPACE_BASE;}[a25_0x350d7c(0x148)](){const _0x111926=a25_0x350d7c;this[_0x111926(0x151)]=a25_0x552832[_0x111926(0x15f)]({'baseURL':this[_0x111926(0x147)],'headers':buildAuthHeaders(),'timeout':0x7530});}['getClient'](){const _0x12661d=a25_0x350d7c;if(!this['axiosInstance'])this[_0x12661d(0x148)]();return this[_0x12661d(0x151)];}async[a25_0x350d7c(0x146)](_0x92770){const _0x2926d5=a25_0x350d7c;try{const _0x346cee=await this[_0x2926d5(0x14f)]()[_0x2926d5(0x146)](_0x92770);return _0x346cee[_0x2926d5(0x142)];}catch(_0x117030){throw this[_0x2926d5(0x14e)](_0x117030);}}async[a25_0x350d7c(0x145)](_0x191e1d,_0x955d77){const _0x4a8900=a25_0x350d7c;try{const _0xf81a4c=await this[_0x4a8900(0x14f)]()[_0x4a8900(0x145)](_0x191e1d,_0x955d77);return _0xf81a4c[_0x4a8900(0x142)];}catch(_0x64d264){throw this['wrapError'](_0x64d264);}}[a25_0x350d7c(0x14e)](_0x3fb4bd){const _0x3d13a2=a25_0x350d7c;if(_0x3fb4bd[_0x3d13a2(0x154)]){const _0x103204=_0x3fb4bd[_0x3d13a2(0x154)][_0x3d13a2(0x159)],_0x3c7950=_0x3fb4bd[_0x3d13a2(0x15a)]?.[_0x3d13a2(0x149)]??_0x3fb4bd[_0x3d13a2(0x15a)]?.[_0x3d13a2(0x13f)]??'';if(_0x103204===0x191)return configManager[_0x3d13a2(0x160)](),new Error(_0x3d13a2(0x14a));const _0x1618e9=_0x3fb4bd['response'][_0x3d13a2(0x142)],_0x5c9033=_0x1618e9?.[_0x3d13a2(0x15c)]??_0x1618e9?.[_0x3d13a2(0x15b)]??'';return new Error('请求失败\x20('+_0x103204+'):\x20'+(_0x5c9033||_0x3fb4bd[_0x3d13a2(0x15b)])+'\x20['+_0x3c7950+']');}if(_0x3fb4bd[_0x3d13a2(0x14b)]===_0x3d13a2(0x158))return new Error('无法连接到服务器,请检查网络');if(_0x3fb4bd[_0x3d13a2(0x14b)]===_0x3d13a2(0x155))return new Error(_0x3d13a2(0x15e));if(_0x3fb4bd[_0x3d13a2(0x14b)]==='ECONNABORTED')return new Error('请求超时,请稍后重试');return new Error(_0x3d13a2(0x141)+_0x3fb4bd['message']);}}export const httpClient=new SimpleHttpClient();
|
package/dist/lib/log/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x49f386=a26_0x395d;(function(_0x514eb8,_0x491ed9){const _0x1856ab=a26_0x395d,_0x23c201=_0x514eb8();while(!![]){try{const _0x30750a=parseInt(_0x1856ab(0x7e))/0x1*(-parseInt(_0x1856ab(0x7a))/0x2)+-parseInt(_0x1856ab(0x77))/0x3+parseInt(_0x1856ab(0x73))/0x4*(parseInt(_0x1856ab(0x75))/0x5)+-parseInt(_0x1856ab(0x69))/0x6+-parseInt(_0x1856ab(0x71))/0x7*(parseInt(_0x1856ab(0x6e))/0x8)+parseInt(_0x1856ab(0x6b))/0x9+parseInt(_0x1856ab(0x7d))/0xa;if(_0x30750a===_0x491ed9)break;else _0x23c201['push'](_0x23c201['shift']());}catch(_0x6a1c43){_0x23c201['push'](_0x23c201['shift']());}}}(a26_0x5d98,0xbc522));import a26_0x54306a from'node:fs';import a26_0x1dde46 from'node:path';import{LOG_DIR,ENV_VERBOSE}from'../config/constants.js';import{randomUUID}from'node:crypto';let logFilePath=null,logLevel=0x3;function a26_0x395d(_0x3020a6,_0xaed50e){_0x3020a6=_0x3020a6-0x66;const _0x5d9876=a26_0x5d98();let _0x395d42=_0x5d9876[_0x3020a6];return _0x395d42;}const LOG_SUFFIX=a26_0x49f386(0x74);export function NewLoggerWithLevel(_0x53ac01,_0x4cc12e){const _0x5b213a=a26_0x49f386;logLevel=_0x53ac01,logFilePath=_0x4cc12e;const _0x177800=a26_0x1dde46[_0x5b213a(0x72)](_0x4cc12e);a26_0x54306a[_0x5b213a(0x6c)](_0x177800,{'recursive':!![]}),a26_0x54306a[_0x5b213a(0x66)](_0x4cc12e,_0x5b213a(0x78)+new Date()[_0x5b213a(0x6f)]()+'\x0a',_0x5b213a(0x6d));}let hasLogWriteFailed=![];function a26_0x5d98(){const _0x41e1e3=['1380542cAEunr','max','message','21499350xDJXuD','2efBtkP','write','writeFileSync','parseInt','join','1781382ihqqJG','appendFileSync','9391761vljsHA','mkdirSync','utf-8','5569768TqQZPX','toISOString','stderr','7giRPED','dirname','31012xXKHze','.log','515JlHGsh','[comate-cli]\x20log\x20write\x20failed:\x20','2541003rAEXSn','[comate-cli]\x20Log\x20started\x20at\x20','env'];a26_0x5d98=function(){return _0x41e1e3;};return a26_0x5d98();}export function FileOnly(_0x55ec2c){const _0x35680a=a26_0x49f386;if(!logFilePath)return;try{a26_0x54306a[_0x35680a(0x6a)](logFilePath,new Date()[_0x35680a(0x6f)]()+'\x20'+_0x55ec2c+'\x0a',_0x35680a(0x6d));}catch(_0x5a0b33){!hasLogWriteFailed&&(hasLogWriteFailed=!![],process[_0x35680a(0x70)][_0x35680a(0x7f)](_0x35680a(0x76)+(_0x5a0b33 instanceof Error?_0x5a0b33[_0x35680a(0x7c)]:String(_0x5a0b33))+'\x0a'));}}export function CleanLogFile(){logFilePath=null;}export function initLogger(){const _0x7a8dd7=a26_0x49f386,_0x513cbe=0x3,_0x450956=process[_0x7a8dd7(0x79)][ENV_VERBOSE],_0x2c9375=_0x450956?Math['min'](0x5,Math[_0x7a8dd7(0x7b)](0x1,Number[_0x7a8dd7(0x67)](_0x450956,0xa)||_0x513cbe)):_0x513cbe,_0x473dd3=randomUUID(),_0x50f79c=a26_0x1dde46[_0x7a8dd7(0x68)](LOG_DIR,''+_0x473dd3+LOG_SUFFIX);return NewLoggerWithLevel(_0x2c9375,_0x50f79c),_0x50f79c;}export function getLogLevel(){return logLevel;}
|
package/dist/lib/service/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1147fb,_0x597544){const _0x595212=a27_0xc5ca,_0xb90aa4=_0x1147fb();while(!![]){try{const _0x4f89a6=parseInt(_0x595212(0x1cd))/0x1+-parseInt(_0x595212(0x1c6))/0x2*(parseInt(_0x595212(0x1d1))/0x3)+parseInt(_0x595212(0x1c8))/0x4*(-parseInt(_0x595212(0x1c2))/0x5)+parseInt(_0x595212(0x1cf))/0x6+parseInt(_0x595212(0x1cc))/0x7+-parseInt(_0x595212(0x1cb))/0x8+-parseInt(_0x595212(0x1c1))/0x9;if(_0x4f89a6===_0x597544)break;else _0xb90aa4['push'](_0xb90aa4['shift']());}catch(_0x5cd847){_0xb90aa4['push'](_0xb90aa4['shift']());}}}(a27_0x1eeb,0xc2258));import{httpClient}from'../http/client.js';function a27_0xc5ca(_0x503a1f,_0x3d02de){_0x503a1f=_0x503a1f-0x1c0;const _0x1eeb11=a27_0x1eeb();let _0xc5caad=_0x1eeb11[_0x503a1f];return _0xc5caad;}import{AGENTSPACE_BASE}from'../config/constants.js';function a27_0x1eeb(){const _0x440d83=['3551150NFsBMY','msg','data','获取登录凭证失败','2274742vmWCCS','initialize','4oXBseB','/v7/devhub/users/current','code','9985912BtpXxh','10459351JzTiHX','1158689EIqfSp','post','9375168IGnoYF','token','3NdZKWR','获取用户信息失败','2919114beuqob'];a27_0x1eeb=function(){return _0x440d83;};return a27_0x1eeb();}import a27_0x1a0a27 from'axios';export async function getUserToken(_0xb097ea,_0x1572ea,_0x4cf212){const _0x3f0047=a27_0xc5ca,_0x35fb05=await a27_0x1a0a27[_0x3f0047(0x1ce)](AGENTSPACE_BASE+'/v7/devhub/users/user_token',{'app_id':_0xb097ea,'code':_0x1572ea,'state':_0x4cf212});if(_0x35fb05[_0x3f0047(0x1c4)][_0x3f0047(0x1ca)]!==0x0||!_0x35fb05[_0x3f0047(0x1c4)][_0x3f0047(0x1c4)]?.['token'])throw new Error(_0x35fb05[_0x3f0047(0x1c4)][_0x3f0047(0x1c3)]||_0x3f0047(0x1c5));return _0x35fb05[_0x3f0047(0x1c4)][_0x3f0047(0x1c4)][_0x3f0047(0x1d0)];}export async function getCurrentUser(){const _0x14d099=a27_0xc5ca;httpClient[_0x14d099(0x1c7)]();const _0x55ed86=await httpClient['get'](_0x14d099(0x1c9));if(_0x55ed86[_0x14d099(0x1ca)]!==0x0)throw new Error(_0x55ed86[_0x14d099(0x1c3)]||_0x14d099(0x1c0));return _0x55ed86[_0x14d099(0x1c4)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x250e4b=a28_0x4f99;(function(_0x374fa6,_0x12d1cf){const _0x4644a1=a28_0x4f99,_0x3418c6=_0x374fa6();while(!![]){try{const _0xc446d4=parseInt(_0x4644a1(0x181))/0x1+-parseInt(_0x4644a1(0x18a))/0x2*(parseInt(_0x4644a1(0x1ae))/0x3)+parseInt(_0x4644a1(0x17a))/0x4*(parseInt(_0x4644a1(0x187))/0x5)+parseInt(_0x4644a1(0x17f))/0x6+parseInt(_0x4644a1(0x197))/0x7+-parseInt(_0x4644a1(0x192))/0x8*(-parseInt(_0x4644a1(0x17e))/0x9)+-parseInt(_0x4644a1(0x188))/0xa*(parseInt(_0x4644a1(0x17b))/0xb);if(_0xc446d4===_0x12d1cf)break;else _0x3418c6['push'](_0x3418c6['shift']());}catch(_0x51bb9d){_0x3418c6['push'](_0x3418c6['shift']());}}}(a28_0x533d,0x973f8));import{configManager}from'../config/manager.js';import{APP_STUDIO_BASE}from'../config/constants.js';import{buildAuthHeaders}from'../http/auth-headers.js';const CLOUD_API_BASE=process[a28_0x250e4b(0x190)][a28_0x250e4b(0x19b)]??APP_STUDIO_BASE;function getHeaders(){return buildAuthHeaders();}async function assertOk(_0x3b47cd,_0x4d0202){const _0x4065ed=a28_0x250e4b;if(!_0x3b47cd['ok']){const _0x4e8ef4=await _0x3b47cd[_0x4065ed(0x1a9)]()['catch'](()=>'');if(_0x3b47cd[_0x4065ed(0x19e)]===0x191){configManager['clear']();throw new Error(_0x4065ed(0x18f));}if(_0x3b47cd[_0x4065ed(0x19e)]===0x193){let _0x4feb3c=_0x4e8ef4;try{_0x4feb3c=JSON[_0x4065ed(0x198)](_0x4e8ef4)[_0x4065ed(0x1a4)]??_0x4e8ef4;}catch{}throw new Error(_0x4065ed(0x1aa)+_0x4feb3c);}throw new Error(_0x4d0202+'\x20失败\x20('+_0x3b47cd[_0x4065ed(0x19e)]+_0x4065ed(0x17d)+_0x4e8ef4);}}function a28_0x4f99(_0x1b6593,_0x4fb3f0){_0x1b6593=_0x1b6593-0x178;const _0x533d3b=a28_0x533d();let _0x4f9979=_0x533d3b[_0x1b6593];return _0x4f9979;}export async function createThread(_0x3cab69=a28_0x250e4b(0x1b0)){const _0x15fd18=a28_0x250e4b,_0x4b66c6=await fetch(CLOUD_API_BASE+_0x15fd18(0x179),{'method':_0x15fd18(0x1a2),'headers':getHeaders(),'body':JSON[_0x15fd18(0x19c)]({'agent_id':_0x3cab69})});return await assertOk(_0x4b66c6,_0x15fd18(0x193)),_0x4b66c6[_0x15fd18(0x1ad)]();}export async function submitRun(_0x1b89e6){const _0x267ffc=a28_0x250e4b,{threadId:_0xd7e79b,messages:_0x562f7e,assistantId:_0x1845e9}=_0x1b89e6,_0x2ce838={'input':{'messages':_0x562f7e},'stream_mode':[_0x267ffc(0x18d)]};if(_0x1845e9)_0x2ce838['assistant_id']=_0x1845e9;const _0x85e5b7=await fetch(CLOUD_API_BASE+_0x267ffc(0x19f)+_0xd7e79b+_0x267ffc(0x18c),{'method':_0x267ffc(0x1a2),'headers':{...getHeaders(),'Accept':'text/event-stream'},'body':JSON['stringify'](_0x2ce838)});await assertOk(_0x85e5b7,_0x267ffc(0x1ac));if(_0x85e5b7[_0x267ffc(0x194)]){const _0x89936a=_0x85e5b7['body'][_0x267ffc(0x178)]();_0x89936a[_0x267ffc(0x1a3)]()[_0x267ffc(0x195)](()=>{});}return{'thread_id':_0xd7e79b};}export async function resumeRun(_0x3d152e){const _0x58cea8=a28_0x250e4b,{threadId:_0xa06b6f,resumeValue:_0x3947b9,assistantId:_0x32b7b2}=_0x3d152e,_0x1d554e={'command':{'resume':_0x3947b9},'stream_mode':[_0x58cea8(0x18d)]};if(_0x32b7b2)_0x1d554e[_0x58cea8(0x19d)]=_0x32b7b2;const _0x2e1ca8=await fetch(CLOUD_API_BASE+_0x58cea8(0x19f)+_0xa06b6f+_0x58cea8(0x18c),{'method':'POST','headers':{...getHeaders(),'Accept':'text/event-stream'},'body':JSON[_0x58cea8(0x19c)](_0x1d554e)});await assertOk(_0x2e1ca8,_0x58cea8(0x185));if(_0x2e1ca8[_0x58cea8(0x194)]){const _0x59bdd5=_0x2e1ca8[_0x58cea8(0x194)][_0x58cea8(0x178)]();_0x59bdd5[_0x58cea8(0x1a3)]()[_0x58cea8(0x195)](()=>{});}return{'thread_id':_0xa06b6f};}export async function isThreadRunning(_0x72a228){const _0x47750d=a28_0x250e4b;try{const _0x59b4fd=await fetch(CLOUD_API_BASE+'/api/v3/runs/active',{'method':_0x47750d(0x19a),'headers':getHeaders(),'signal':AbortSignal[_0x47750d(0x191)](0x1388)});if(!_0x59b4fd['ok'])return![];const _0x2d78f5=await _0x59b4fd['json']();return _0x2d78f5[_0x47750d(0x183)]?.[_0x47750d(0x18b)](_0x267126=>_0x267126[_0x47750d(0x1ab)]===_0x72a228)??![];}catch{return![];}}function a28_0x533d(){const _0x33117b=['提交消息','json','27lTkllM','isBuffer','app-builder','getReader','/api/v3/threads','1020VvadLL','220NTBmSg','上传文件','):\x20','27981PoLcbO','1448910vljZJH','results','921758AGSlib','name','activeRuns','/state','恢复中断','length','18945bgEDLc','1301960migfXG','获取会话状态','25328AXPkFt','some','/runs/stream','updates','下载文件','登录已过期,请重新执行\x20npx\x20--yes\x20@wps365-open/comate-cli@latest\x20auth\x20login','env','timeout','1264AFZPEz','创建会话','body','catch','content','5017236whqVnW','parse','application/octet-stream','GET','COMATE_CLOUD_API_BASE','stringify','assistant_id','status','/api/v3/threads/','get','octet-stream','POST','cancel','error','headers','content-type','/files/download','append','text','权限不足\x20(403):\x20','threadId'];a28_0x533d=function(){return _0x33117b;};return a28_0x533d();}export async function getThreadState(_0x6f4663){const _0x54b7d5=a28_0x250e4b,_0x3f8015=await fetch(CLOUD_API_BASE+'/api/v3/threads/'+_0x6f4663+_0x54b7d5(0x184),{'method':_0x54b7d5(0x19a),'headers':getHeaders(),'signal':AbortSignal[_0x54b7d5(0x191)](0x3a98)});return await assertOk(_0x3f8015,_0x54b7d5(0x189)),_0x3f8015['json']();}export async function downloadFiles(_0x1fd295,_0x4feceb){const _0x58f531=a28_0x250e4b,_0x3f2923=await fetch(CLOUD_API_BASE+_0x58f531(0x19f)+_0x1fd295+_0x58f531(0x1a7),{'method':'POST','headers':getHeaders(),'body':JSON[_0x58f531(0x19c)]({'paths':_0x4feceb})});await assertOk(_0x3f2923,_0x58f531(0x18e));if(_0x4feceb[_0x58f531(0x186)]===0x1){const _0x422a1a=_0x3f2923[_0x58f531(0x1a5)][_0x58f531(0x1a0)](_0x58f531(0x1a6))??'';if(_0x422a1a['includes'](_0x58f531(0x1a1))){const _0x1bd6de=await _0x3f2923[_0x58f531(0x1a9)]();return[{'path':_0x4feceb[0x0],'content':_0x1bd6de,'error':null}];}}const _0x388962=await _0x3f2923[_0x58f531(0x1ad)]();return _0x388962[_0x58f531(0x180)]??[];}export async function uploadFiles(_0x22a7ba,_0x4ba350){const _0x1f2fef=a28_0x250e4b,_0xdd0da9=new FormData();for(const _0x1d09c4 of _0x4ba350){const _0x2371ea=Buffer[_0x1f2fef(0x1af)](_0x1d09c4[_0x1f2fef(0x196)])?new Uint8Array(_0x1d09c4['content']):_0x1d09c4[_0x1f2fef(0x196)],_0x230849=new Blob([_0x2371ea],{'type':_0x1f2fef(0x199)});_0xdd0da9[_0x1f2fef(0x1a8)](_0x1d09c4['name'],_0x230849,_0x1d09c4[_0x1f2fef(0x182)]);}const _0x3c3946=getHeaders();delete _0x3c3946['Content-Type'];const _0x57c2af=await fetch(CLOUD_API_BASE+'/api/v3/threads/'+_0x22a7ba+'/files/upload',{'method':_0x1f2fef(0x1a2),'headers':_0x3c3946,'body':_0xdd0da9});return await assertOk(_0x57c2af,_0x1f2fef(0x17c)),_0x57c2af['json']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x467aa0=a26_0x7898;(function(_0x4ff6f3,_0x2b097d){const _0x31f669=a26_0x7898,_0x6245ff=_0x4ff6f3();while(!![]){try{const _0x514571=parseInt(_0x31f669(0xf1))/0x1+parseInt(_0x31f669(0xd0))/0x2+parseInt(_0x31f669(0xf3))/0x3*(parseInt(_0x31f669(0xf4))/0x4)+-parseInt(_0x31f669(0xfb))/0x5*(-parseInt(_0x31f669(0xc8))/0x6)+parseInt(_0x31f669(0xe6))/0x7+parseInt(_0x31f669(0xf7))/0x8+-parseInt(_0x31f669(0x10a))/0x9;if(_0x514571===_0x2b097d)break;else _0x6245ff['push'](_0x6245ff['shift']());}catch(_0x161da1){_0x6245ff['push'](_0x6245ff['shift']());}}}(a26_0xfc52,0x80575));import{configManager}from'../config/manager.js';import{APP_STUDIO_BASE,RUNTIME_BASE}from'../config/constants.js';import{buildAuthHeaders}from'../http/auth-headers.js';import{publishVersion,getDeploymentStatus}from'./manage.js';import{FileOnly}from'../log/logger.js';const CLOUD_API_BASE=process[a26_0x467aa0(0x12d)][a26_0x467aa0(0xc1)]??APP_STUDIO_BASE;function log(_0xe7cdd){FileOnly('[publish]\x20'+_0xe7cdd);}function getHeaders(){return buildAuthHeaders();}function a26_0xfc52(){const _0x552a5f=['error','build_building','834364pNRxRr','build\x20reached\x20terminal\x20phase:\x20','15aGAwbv','228916nCYSNd','\x20logs=','/api/v2/projects/','6842032sQNGCj','deploy\x20poll\x20#','部署中\x20(','submitBuild\x20response:\x20phase=','5AjrImR','getBuildStatus:\x20phase=','\x20short_url=','构建超时','deploy\x20FAILED:\x20','\x20失败\x20(','https://o.wpsgo.com/app/','installing','data','skipBuild','catch','构建状态解析失败:\x20','POST','build\x20logs\x20(last\x2010):\x0a','text','29381364SWeFxs','部署超时','\x20timeout=','now','\x20polls','GET','short_url','\x20after\x20','\x20hasResult=','build\x20TIMEOUT\x20after\x20','captureScreenshot\x20POST\x20','部署失败:\x20','projectId','触发部署...','threadId','https://o.wpsgo.com/app-studio/runtime/','\x20versionId=','clear','构建任务已提交','\x20skipBuild=',',\x20starting\x20runtime\x20poll...','\x20zip=','none','build_done','access_url','totalZipSize','match','published','buildCommand','replace','json',':\x20status=','查询构建状态','\x20(poll\x20#','部署成功:\x20','env','\x20→\x20','pending','未知错误','deploying','active','COMATE_CLOUD_API_BASE','captureScreenshot\x20error:\x20','/screenshot','\x20projectId=','N/A','getBuildStatus\x20parse\x20error,\x20raw=','build_pending','1592868YccyRs','/publish/status','):\x20','\x20access_url=','has','result','build\x20FAILED:\x20','stringify','1504148zqdbCn','构建失败:\x20','totalFileCount','deploy_status','build_installing','versionId','\x20error=','deploy\x20TIMEOUT\x20after\x20','phase','登录已过期,请重新执行\x20comate-cli\x20auth\x20login','parse','failed','部署失败','触发部署失败:\x20','logs','\x20message=','deployed','...)','\x20HTTP\x20','submitBuild\x20POST\x20','message','slice','5578762iodgJB','status','publishVersion\x20FAILED:\x20','startsWith','deployment\x20ID\x20extracted:\x20','deploy\x20SUCCESS:\x20','/api/v2/threads/','publishVersion:\x20deploy_status=','\x20\x20result:\x20files='];a26_0xfc52=function(){return _0x552a5f;};return a26_0xfc52();}async function assertOk(_0x3003c4,_0x498a0f){const _0x4909a8=a26_0x467aa0;if(!_0x3003c4['ok']){const _0x9880d7=await _0x3003c4[_0x4909a8(0x109)]()[_0x4909a8(0x105)](()=>'');log(_0x498a0f+_0x4909a8(0xe2)+_0x3003c4[_0x4909a8(0xe7)]+':\x20'+_0x9880d7[_0x4909a8(0xe5)](0x0,0x1f4));if(_0x3003c4[_0x4909a8(0xe7)]===0x191){configManager[_0x4909a8(0x11b)]();throw new Error(_0x4909a8(0xd9));}throw new Error(_0x498a0f+_0x4909a8(0x100)+_0x3003c4[_0x4909a8(0xe7)]+'):\x20'+_0x9880d7);}}export async function submitBuild(_0x17adac){const _0x44b7c1=a26_0x467aa0,{threadId:_0x582a34,projectId:_0x4b6fcc,versionId:_0x529136,buildCommand:_0xc0c950,skipBuild:_0x47ec5b}=_0x17adac,_0x37b5b5={'projectId':_0x4b6fcc,'versionId':_0x529136};if(_0xc0c950)_0x37b5b5[_0x44b7c1(0x126)]=_0xc0c950;if(_0x47ec5b)_0x37b5b5[_0x44b7c1(0x104)]=!![];const _0x5949ef=CLOUD_API_BASE+_0x44b7c1(0xec)+_0x582a34+'/publish';log(_0x44b7c1(0xe3)+_0x5949ef+'\x20body='+JSON[_0x44b7c1(0xcf)](_0x37b5b5));const _0x53771e=await fetch(_0x5949ef,{'method':_0x44b7c1(0x107),'headers':getHeaders(),'body':JSON['stringify'](_0x37b5b5)});await assertOk(_0x53771e,'提交构建');const _0x3e0a7d=await _0x53771e[_0x44b7c1(0x128)](),_0x2dc689=_0x3e0a7d[_0x44b7c1(0x103)]??_0x3e0a7d;return log(_0x44b7c1(0xfa)+_0x2dc689['phase']+_0x44b7c1(0xdf)+_0x2dc689[_0x44b7c1(0xe4)]),_0x2dc689;}export async function getBuildStatus(_0x45c9d5){const _0xff1bd2=a26_0x467aa0,_0x48596e=CLOUD_API_BASE+_0xff1bd2(0xec)+_0x45c9d5+_0xff1bd2(0xc9),_0x21abd3=await fetch(_0x48596e,{'method':_0xff1bd2(0x10f),'headers':getHeaders()});await assertOk(_0x21abd3,_0xff1bd2(0x12a));const _0x238d5a=await _0x21abd3[_0xff1bd2(0x109)]();let _0x57559f;try{_0x57559f=JSON[_0xff1bd2(0xda)](_0x238d5a);}catch{log(_0xff1bd2(0xc6)+_0x238d5a[_0xff1bd2(0xe5)](0x0,0x1f4));throw new Error(_0xff1bd2(0x106)+_0x238d5a[_0xff1bd2(0xe5)](0x0,0xc8));}const _0x9b3e65=_0x57559f[_0xff1bd2(0x103)]??_0x57559f;return log(_0xff1bd2(0xfc)+_0x9b3e65['phase']+'\x20message='+_0x9b3e65[_0xff1bd2(0xe4)]+_0xff1bd2(0xf5)+(_0x9b3e65[_0xff1bd2(0xde)]?.['length']??0x0)+_0xff1bd2(0x112)+!!_0x9b3e65['result']),_0x9b3e65[_0xff1bd2(0xcd)]&&log(_0xff1bd2(0xee)+_0x9b3e65['result'][_0xff1bd2(0xd2)]+_0xff1bd2(0x11f)+_0x9b3e65[_0xff1bd2(0xcd)][_0xff1bd2(0x123)]),_0x9b3e65;}const BUILD_TERMINAL=new Set([a26_0x467aa0(0x125),a26_0x467aa0(0xef)]),POLL_INTERVAL=0xbb8;export async function runFullPublish(_0xf3ad11,_0x3f10bc,_0x2ce1eb=0x927c0){const _0x4edb82=a26_0x467aa0,_0x209233=Date[_0x4edb82(0x10d)]()+_0x2ce1eb;log('runFullPublish\x20start:\x20threadId='+_0xf3ad11['threadId']+_0x4edb82(0xc4)+_0xf3ad11['projectId']+_0x4edb82(0x11a)+_0xf3ad11[_0x4edb82(0xd5)]+_0x4edb82(0x11d)+_0xf3ad11[_0x4edb82(0x104)]+_0x4edb82(0x10c)+_0x2ce1eb+'ms'),await submitBuild(_0xf3ad11),_0x3f10bc?.({'step':'build_pending','message':_0x4edb82(0x11c)});let _0x387057,_0x13ea6c=null,_0x226af6=0x0;while(Date[_0x4edb82(0x10d)]()<_0x209233){const _0x3ac8a4=await getBuildStatus(_0xf3ad11[_0x4edb82(0x118)]);_0x387057=_0x3ac8a4,_0x226af6++;if(_0x3ac8a4['phase']!==_0x13ea6c){log('build\x20phase\x20changed:\x20'+_0x13ea6c+_0x4edb82(0x12e)+_0x3ac8a4[_0x4edb82(0xd8)]+_0x4edb82(0x12b)+_0x226af6+')'),_0x13ea6c=_0x3ac8a4['phase'];const _0x3b1498=mapBuildPhase(_0x3ac8a4[_0x4edb82(0xd8)]);_0x3f10bc?.({'step':_0x3b1498,'message':_0x3ac8a4[_0x4edb82(0xe4)]});}if(_0x3ac8a4[_0x4edb82(0xd8)]===_0x4edb82(0xef))return log(_0x4edb82(0xce)+_0x3ac8a4[_0x4edb82(0xe4)]),_0x3ac8a4[_0x4edb82(0xde)]?.['length']&&log(_0x4edb82(0x108)+_0x3ac8a4[_0x4edb82(0xde)][_0x4edb82(0xe5)](-0xa)['join']('\x0a')),{'status':_0x4edb82(0xdb),'deploy_error':_0x4edb82(0xd1)+_0x3ac8a4[_0x4edb82(0xe4)],'build_result':_0x3ac8a4[_0x4edb82(0xcd)],'build_logs':_0x3ac8a4[_0x4edb82(0xde)]};if(BUILD_TERMINAL[_0x4edb82(0xcc)](_0x3ac8a4[_0x4edb82(0xd8)])){log(_0x4edb82(0xf2)+_0x3ac8a4[_0x4edb82(0xd8)]+_0x4edb82(0x111)+_0x226af6+'\x20polls');break;}await sleep(POLL_INTERVAL);}if(!_0x387057||!BUILD_TERMINAL[_0x4edb82(0xcc)](_0x387057[_0x4edb82(0xd8)]))return log(_0x4edb82(0x113)+_0x226af6+'\x20polls,\x20last\x20phase:\x20'+_0x387057?.['phase']),{'status':_0x4edb82(0xdb),'deploy_error':_0x4edb82(0xfe),'build_logs':_0x387057?.[_0x4edb82(0xde)]};_0x3f10bc?.({'step':_0x4edb82(0xbf),'message':_0x4edb82(0x117)});let _0x5ae3e0,_0x28d3a4;try{const _0x67aa46=await publishVersion(_0xf3ad11[_0x4edb82(0x116)],_0xf3ad11['versionId']);log(_0x4edb82(0xed)+_0x67aa46[_0x4edb82(0xd3)]+_0x4edb82(0xcb)+_0x67aa46[_0x4edb82(0x122)]+_0x4edb82(0xfd)+(_0x67aa46[_0x4edb82(0x110)]??_0x4edb82(0xc5))),_0x5ae3e0=extractDeploymentId(_0x67aa46[_0x4edb82(0x122)]),_0x28d3a4=_0x67aa46['short_url'];}catch(_0x2fffcc){const _0x26de57=_0x2fffcc instanceof Error?_0x2fffcc['message']:String(_0x2fffcc);return log(_0x4edb82(0xe8)+_0x26de57),{'status':_0x4edb82(0xdb),'deploy_error':_0x4edb82(0xdd)+_0x26de57,'build_result':_0x387057?.[_0x4edb82(0xcd)],'build_logs':_0x387057?.['logs']};}if(!_0x5ae3e0)return log('FAILED:\x20no\x20deployment\x20ID\x20extracted'),{'status':_0x4edb82(0xdb),'deploy_error':'未获取到\x20deployment\x20ID','build_result':_0x387057?.['result'],'build_logs':_0x387057?.[_0x4edb82(0xde)]};log(_0x4edb82(0xea)+_0x5ae3e0+_0x4edb82(0x11e)),_0x3f10bc?.({'step':_0x4edb82(0xbf),'message':_0x4edb82(0xf9)+_0x5ae3e0[_0x4edb82(0xe5)](0x0,0x8)+_0x4edb82(0xe1)});let _0x2ba9e0=0x0;while(Date['now']()<_0x209233){await sleep(POLL_INTERVAL),_0x2ba9e0++;let _0x3eff8d;try{_0x3eff8d=await getDeploymentStatus(_0x5ae3e0),log('deploy\x20poll\x20#'+_0x2ba9e0+_0x4edb82(0x129)+_0x3eff8d[_0x4edb82(0xe7)]+_0x4edb82(0xd6)+(_0x3eff8d[_0x4edb82(0xef)]??_0x4edb82(0x120)));}catch(_0x53feb0){log(_0x4edb82(0xf8)+_0x2ba9e0+'\x20error:\x20'+(_0x53feb0 instanceof Error?_0x53feb0[_0x4edb82(0xe4)]:String(_0x53feb0)));continue;}if(_0x3eff8d[_0x4edb82(0xe7)]===_0x4edb82(0xc0)){const _0xe8116c=RUNTIME_BASE+'/'+_0x5ae3e0+'/',_0x4c73e5=_0x28d3a4||_0x3eff8d[_0x4edb82(0x110)],_0x4f902a=_0x4c73e5||_0xe8116c;log(_0x4edb82(0xeb)+_0x4f902a),_0x3f10bc?.({'step':'deployed','message':_0x4edb82(0x12c)+_0x4f902a});const _0x267be8=buildScreenshotUrl(_0x4f902a);return _0x267be8&&void captureScreenshot(_0xf3ad11[_0x4edb82(0x116)],_0x267be8),{'status':_0x4edb82(0xe0),'access_url':_0x4f902a,'short_url':_0x4c73e5,'build_result':_0x387057?.[_0x4edb82(0xcd)]};}if(_0x3eff8d[_0x4edb82(0xe7)]===_0x4edb82(0xdb))return log(_0x4edb82(0xff)+(_0x3eff8d['error']??_0x4edb82(0xbe))),_0x3f10bc?.({'step':_0x4edb82(0xdb),'message':_0x4edb82(0x115)+(_0x3eff8d[_0x4edb82(0xef)]??_0x4edb82(0xbe))}),{'status':'failed','deploy_error':_0x3eff8d[_0x4edb82(0xef)]??_0x4edb82(0xdc),'build_result':_0x387057?.[_0x4edb82(0xcd)],'build_logs':_0x387057?.[_0x4edb82(0xde)]};}return log(_0x4edb82(0xd7)+_0x2ba9e0+_0x4edb82(0x10e)),{'status':_0x4edb82(0xdb),'deploy_error':_0x4edb82(0x10b),'build_result':_0x387057?.[_0x4edb82(0xcd)],'build_logs':_0x387057?.[_0x4edb82(0xde)]};}const SCREENSHOT_RUNTIME_BASE='https://open.wps.cn/app-studio/runtime/',URL_REWRITES=[[a26_0x467aa0(0x101),SCREENSHOT_RUNTIME_BASE],[a26_0x467aa0(0x119),SCREENSHOT_RUNTIME_BASE]];function buildScreenshotUrl(_0x11e72f){const _0x5ae1e9=a26_0x467aa0;if(!_0x11e72f)return undefined;for(const [_0x340558,_0x2d1fd5]of URL_REWRITES){if(_0x11e72f[_0x5ae1e9(0xe9)](_0x340558))return _0x11e72f[_0x5ae1e9(0x127)](_0x340558,_0x2d1fd5);}return undefined;}function a26_0x7898(_0x5a3391,_0x950633){_0x5a3391=_0x5a3391-0xbe;const _0xfc5288=a26_0xfc52();let _0x78982e=_0xfc5288[_0x5a3391];return _0x78982e;}async function captureScreenshot(_0xb4828,_0x16e70b){const _0x3a33b1=a26_0x467aa0,_0x531451=CLOUD_API_BASE+_0x3a33b1(0xf6)+_0xb4828+_0x3a33b1(0xc3);log(_0x3a33b1(0x114)+_0x531451);try{const _0x486265=await fetch(_0x531451,{'method':_0x3a33b1(0x107),'headers':getHeaders(),'body':JSON[_0x3a33b1(0xcf)]({'url':_0x16e70b})});if(!_0x486265['ok']){const _0x358e9f=await _0x486265[_0x3a33b1(0x109)]()[_0x3a33b1(0x105)](()=>'');log('captureScreenshot\x20failed\x20('+_0x486265['status']+_0x3a33b1(0xca)+_0x358e9f[_0x3a33b1(0xe5)](0x0,0xc8));}else log('captureScreenshot:\x20截图任务已提交');}catch(_0x3bb779){log(_0x3a33b1(0xc2)+(_0x3bb779 instanceof Error?_0x3bb779['message']:String(_0x3bb779)));}}function mapBuildPhase(_0x100f77){const _0x4b05fb=a26_0x467aa0;switch(_0x100f77){case _0x4b05fb(0x12f):return _0x4b05fb(0xc7);case _0x4b05fb(0x102):return _0x4b05fb(0xd4);case'building':return _0x4b05fb(0xf0);case'publishing':return'build_publishing';case _0x4b05fb(0x125):return _0x4b05fb(0x121);case _0x4b05fb(0xef):return _0x4b05fb(0xdb);}}function extractDeploymentId(_0x1c82c9){const _0x246b4e=a26_0x467aa0,_0x9a50ed=_0x1c82c9[_0x246b4e(0x124)](/\/([0-9a-f-]{36})\/?/);return _0x9a50ed?.[0x1];}function sleep(_0x4704a2){return new Promise(_0x474884=>setTimeout(_0x474884,_0x4704a2));}
|
|
1
|
+
const a29_0x553e97=a29_0x4011;(function(_0x3c9dfe,_0x450890){const _0x15e9bc=a29_0x4011,_0x102690=_0x3c9dfe();while(!![]){try{const _0x5f21ff=parseInt(_0x15e9bc(0x1f2))/0x1+parseInt(_0x15e9bc(0x218))/0x2*(-parseInt(_0x15e9bc(0x23c))/0x3)+parseInt(_0x15e9bc(0x226))/0x4*(-parseInt(_0x15e9bc(0x252))/0x5)+-parseInt(_0x15e9bc(0x23d))/0x6+-parseInt(_0x15e9bc(0x236))/0x7*(parseInt(_0x15e9bc(0x233))/0x8)+parseInt(_0x15e9bc(0x243))/0x9*(parseInt(_0x15e9bc(0x1f6))/0xa)+parseInt(_0x15e9bc(0x251))/0xb*(parseInt(_0x15e9bc(0x23f))/0xc);if(_0x5f21ff===_0x450890)break;else _0x102690['push'](_0x102690['shift']());}catch(_0x527ac9){_0x102690['push'](_0x102690['shift']());}}}(a29_0x44ff,0xd7fdb));import{configManager}from'../config/manager.js';import{APP_STUDIO_BASE,RUNTIME_BASE}from'../config/constants.js';import{buildAuthHeaders}from'../http/auth-headers.js';import{publishVersion,getDeploymentStatus}from'./manage.js';import{FileOnly}from'../log/logger.js';const CLOUD_API_BASE=process[a29_0x553e97(0x22f)][a29_0x553e97(0x204)]??APP_STUDIO_BASE;function log(_0x55f57b){const _0x588c7a=a29_0x553e97;FileOnly(_0x588c7a(0x1fb)+_0x55f57b);}function getHeaders(){return buildAuthHeaders();}async function assertOk(_0x1e1c63,_0x4d9e00){const _0x5daa09=a29_0x553e97;if(!_0x1e1c63['ok']){const _0x8dbb19=await _0x1e1c63[_0x5daa09(0x24a)]()['catch'](()=>'');log(_0x4d9e00+'\x20HTTP\x20'+_0x1e1c63[_0x5daa09(0x230)]+':\x20'+_0x8dbb19[_0x5daa09(0x23e)](0x0,0x1f4));if(_0x1e1c63[_0x5daa09(0x230)]===0x191){configManager[_0x5daa09(0x1e7)]();throw new Error(_0x5daa09(0x23a));}throw new Error(_0x4d9e00+_0x5daa09(0x1f3)+_0x1e1c63[_0x5daa09(0x230)]+_0x5daa09(0x1f9)+_0x8dbb19);}}export async function submitBuild(_0x303e56){const _0x385e50=a29_0x553e97,{threadId:_0x4cd6c4,projectId:_0x3cbbbd,versionId:_0x177004,buildCommand:_0x2cf06e,skipBuild:_0x1abde5}=_0x303e56,_0x2a1ede={'projectId':_0x3cbbbd,'versionId':_0x177004};if(_0x2cf06e)_0x2a1ede['buildCommand']=_0x2cf06e;if(_0x1abde5)_0x2a1ede[_0x385e50(0x235)]=!![];const _0x370f17=CLOUD_API_BASE+_0x385e50(0x20a)+_0x4cd6c4+_0x385e50(0x21d);log(_0x385e50(0x22a)+_0x370f17+_0x385e50(0x22e)+JSON['stringify'](_0x2a1ede));const _0xa67107=await fetch(_0x370f17,{'method':_0x385e50(0x1fa),'headers':getHeaders(),'body':JSON[_0x385e50(0x238)](_0x2a1ede)});await assertOk(_0xa67107,_0x385e50(0x211));const _0x911a5f=await _0xa67107[_0x385e50(0x240)](),_0x3396a4=_0x911a5f['data']??_0x911a5f;return log(_0x385e50(0x223)+_0x3396a4[_0x385e50(0x202)]+_0x385e50(0x1e9)+_0x3396a4[_0x385e50(0x205)]),_0x3396a4;}export async function getBuildStatus(_0x596aad){const _0x16169f=a29_0x553e97,_0x48f526=CLOUD_API_BASE+'/api/v2/threads/'+_0x596aad+_0x16169f(0x222),_0x39d803=await fetch(_0x48f526,{'method':_0x16169f(0x221),'headers':getHeaders()});await assertOk(_0x39d803,_0x16169f(0x1f4));const _0x576d94=await _0x39d803['text']();let _0x36544f;try{_0x36544f=JSON[_0x16169f(0x1f7)](_0x576d94);}catch{log(_0x16169f(0x1f0)+_0x576d94[_0x16169f(0x23e)](0x0,0x1f4));throw new Error(_0x16169f(0x21b)+_0x576d94[_0x16169f(0x23e)](0x0,0xc8));}const _0x23ad47=_0x36544f['data']??_0x36544f;return log(_0x16169f(0x1fc)+_0x23ad47[_0x16169f(0x202)]+'\x20message='+_0x23ad47['message']+_0x16169f(0x1e8)+(_0x23ad47[_0x16169f(0x24d)]?.[_0x16169f(0x250)]??0x0)+_0x16169f(0x200)+!!_0x23ad47[_0x16169f(0x231)]),_0x23ad47['result']&&log('\x20\x20result:\x20files='+_0x23ad47[_0x16169f(0x231)][_0x16169f(0x210)]+_0x16169f(0x1ef)+_0x23ad47[_0x16169f(0x231)][_0x16169f(0x1ed)]),_0x23ad47;}const BUILD_TERMINAL=new Set([a29_0x553e97(0x24c),a29_0x553e97(0x1ea)]),POLL_INTERVAL=0xbb8;export async function runFullPublish(_0x3b9d84,_0x47ca47,_0x25ee8e=0x927c0){const _0x41ab9f=a29_0x553e97,_0x539512=Date[_0x41ab9f(0x227)]()+_0x25ee8e;log('runFullPublish\x20start:\x20threadId='+_0x3b9d84[_0x41ab9f(0x1e6)]+_0x41ab9f(0x20e)+_0x3b9d84[_0x41ab9f(0x1ec)]+'\x20versionId='+_0x3b9d84[_0x41ab9f(0x234)]+_0x41ab9f(0x248)+_0x3b9d84[_0x41ab9f(0x235)]+_0x41ab9f(0x1f1)+_0x25ee8e+'ms'),await submitBuild(_0x3b9d84),_0x47ca47?.({'step':_0x41ab9f(0x246),'message':'构建任务已提交'});let _0x5ef3d8,_0x253a97=null,_0x35699e=0x0;while(Date[_0x41ab9f(0x227)]()<_0x539512){const _0x804c1f=await getBuildStatus(_0x3b9d84['threadId']);_0x5ef3d8=_0x804c1f,_0x35699e++;if(_0x804c1f[_0x41ab9f(0x202)]!==_0x253a97){log(_0x41ab9f(0x1f8)+_0x253a97+_0x41ab9f(0x23b)+_0x804c1f[_0x41ab9f(0x202)]+_0x41ab9f(0x219)+_0x35699e+')'),_0x253a97=_0x804c1f['phase'];const _0x2049a6=mapBuildPhase(_0x804c1f[_0x41ab9f(0x202)]);_0x47ca47?.({'step':_0x2049a6,'message':_0x804c1f[_0x41ab9f(0x205)]});}if(_0x804c1f[_0x41ab9f(0x202)]===_0x41ab9f(0x1ea))return log(_0x41ab9f(0x24f)+_0x804c1f['message']),_0x804c1f['logs']?.['length']&&log(_0x41ab9f(0x207)+_0x804c1f[_0x41ab9f(0x24d)][_0x41ab9f(0x23e)](-0xa)[_0x41ab9f(0x1eb)]('\x0a')),{'status':'failed','deploy_error':_0x41ab9f(0x241)+_0x804c1f['message'],'build_result':_0x804c1f[_0x41ab9f(0x231)],'build_logs':_0x804c1f['logs']};if(BUILD_TERMINAL['has'](_0x804c1f[_0x41ab9f(0x202)])){log(_0x41ab9f(0x237)+_0x804c1f[_0x41ab9f(0x202)]+_0x41ab9f(0x203)+_0x35699e+_0x41ab9f(0x208));break;}await sleep(POLL_INTERVAL);}if(!_0x5ef3d8||!BUILD_TERMINAL[_0x41ab9f(0x20c)](_0x5ef3d8[_0x41ab9f(0x202)]))return log(_0x41ab9f(0x21e)+_0x35699e+_0x41ab9f(0x1fe)+_0x5ef3d8?.[_0x41ab9f(0x202)]),{'status':_0x41ab9f(0x1f5),'deploy_error':_0x41ab9f(0x1ee),'build_logs':_0x5ef3d8?.[_0x41ab9f(0x24d)]};_0x47ca47?.({'step':_0x41ab9f(0x213),'message':_0x41ab9f(0x206)});let _0x4fd038,_0x2f6816;try{const _0x5eda11=await publishVersion(_0x3b9d84[_0x41ab9f(0x1ec)],_0x3b9d84[_0x41ab9f(0x234)]);log(_0x41ab9f(0x21c)+_0x5eda11['deploy_status']+_0x41ab9f(0x216)+_0x5eda11[_0x41ab9f(0x228)]+_0x41ab9f(0x24b)+(_0x5eda11['short_url']??'N/A')),_0x4fd038=extractDeploymentId(_0x5eda11[_0x41ab9f(0x228)]),_0x2f6816=_0x5eda11[_0x41ab9f(0x214)];}catch(_0x6874d0){const _0x1ef588=_0x6874d0 instanceof Error?_0x6874d0[_0x41ab9f(0x205)]:String(_0x6874d0);return log(_0x41ab9f(0x22b)+_0x1ef588),{'status':_0x41ab9f(0x1f5),'deploy_error':'触发部署失败:\x20'+_0x1ef588,'build_result':_0x5ef3d8?.[_0x41ab9f(0x231)],'build_logs':_0x5ef3d8?.['logs']};}if(!_0x4fd038)return log(_0x41ab9f(0x1fd)),{'status':'failed','deploy_error':'未获取到\x20deployment\x20ID','build_result':_0x5ef3d8?.['result'],'build_logs':_0x5ef3d8?.['logs']};log(_0x41ab9f(0x20b)+_0x4fd038+',\x20starting\x20runtime\x20poll...'),_0x47ca47?.({'step':_0x41ab9f(0x213),'message':'部署中\x20('+_0x4fd038[_0x41ab9f(0x23e)](0x0,0x8)+_0x41ab9f(0x215)});let _0x2a1720=0x0;while(Date[_0x41ab9f(0x227)]()<_0x539512){await sleep(POLL_INTERVAL),_0x2a1720++;let _0x35548a;try{_0x35548a=await getDeploymentStatus(_0x4fd038),log('deploy\x20poll\x20#'+_0x2a1720+_0x41ab9f(0x239)+_0x35548a[_0x41ab9f(0x230)]+_0x41ab9f(0x249)+(_0x35548a[_0x41ab9f(0x1ea)]??'none'));}catch(_0x53b8eb){log(_0x41ab9f(0x209)+_0x2a1720+_0x41ab9f(0x245)+(_0x53b8eb instanceof Error?_0x53b8eb[_0x41ab9f(0x205)]:String(_0x53b8eb)));continue;}if(_0x35548a[_0x41ab9f(0x230)]===_0x41ab9f(0x232)){const _0x300140=RUNTIME_BASE+'/'+_0x4fd038+'/',_0x53c7b7=_0x2f6816||_0x35548a[_0x41ab9f(0x214)],_0x509c2b=_0x53c7b7||_0x300140;log(_0x41ab9f(0x1e5)+_0x509c2b),_0x47ca47?.({'step':_0x41ab9f(0x242),'message':_0x41ab9f(0x229)+_0x509c2b});const _0xc6da7=buildScreenshotUrl(_0x509c2b);return _0xc6da7&&void captureScreenshot(_0x3b9d84[_0x41ab9f(0x1ec)],_0xc6da7),{'status':_0x41ab9f(0x242),'access_url':_0x509c2b,'short_url':_0x53c7b7,'build_result':_0x5ef3d8?.[_0x41ab9f(0x231)]};}if(_0x35548a[_0x41ab9f(0x230)]==='failed')return log('deploy\x20FAILED:\x20'+(_0x35548a[_0x41ab9f(0x1ea)]??_0x41ab9f(0x22c))),_0x47ca47?.({'step':_0x41ab9f(0x1f5),'message':_0x41ab9f(0x24e)+(_0x35548a[_0x41ab9f(0x1ea)]??_0x41ab9f(0x22c))}),{'status':'failed','deploy_error':_0x35548a[_0x41ab9f(0x1ea)]??_0x41ab9f(0x201),'build_result':_0x5ef3d8?.['result'],'build_logs':_0x5ef3d8?.['logs']};}return log(_0x41ab9f(0x244)+_0x2a1720+'\x20polls'),{'status':_0x41ab9f(0x1f5),'deploy_error':_0x41ab9f(0x21f),'build_result':_0x5ef3d8?.[_0x41ab9f(0x231)],'build_logs':_0x5ef3d8?.[_0x41ab9f(0x24d)]};}const SCREENSHOT_RUNTIME_BASE=a29_0x553e97(0x20f),URL_REWRITES=[['https://o.wpsgo.com/app/',SCREENSHOT_RUNTIME_BASE],[a29_0x553e97(0x217),SCREENSHOT_RUNTIME_BASE]];function a29_0x4011(_0x1c08a8,_0xccdc01){_0x1c08a8=_0x1c08a8-0x1e5;const _0x44ff41=a29_0x44ff();let _0x4011d9=_0x44ff41[_0x1c08a8];return _0x4011d9;}function buildScreenshotUrl(_0x523e53){const _0xe4b2c6=a29_0x553e97;if(!_0x523e53)return undefined;for(const [_0x42c691,_0x2bdb21]of URL_REWRITES){if(_0x523e53[_0xe4b2c6(0x224)](_0x42c691))return _0x523e53[_0xe4b2c6(0x20d)](_0x42c691,_0x2bdb21);}return undefined;}async function captureScreenshot(_0x3772d4,_0x5bbd7f){const _0x44d6f7=a29_0x553e97,_0x3b7635=CLOUD_API_BASE+'/api/v2/projects/'+_0x3772d4+'/screenshot';log('captureScreenshot\x20POST\x20'+_0x3b7635);try{const _0x15e162=await fetch(_0x3b7635,{'method':'POST','headers':getHeaders(),'body':JSON[_0x44d6f7(0x238)]({'url':_0x5bbd7f})});if(!_0x15e162['ok']){const _0x34a618=await _0x15e162['text']()[_0x44d6f7(0x22d)](()=>'');log(_0x44d6f7(0x247)+_0x15e162[_0x44d6f7(0x230)]+_0x44d6f7(0x1f9)+_0x34a618[_0x44d6f7(0x23e)](0x0,0xc8));}else log('captureScreenshot:\x20截图任务已提交');}catch(_0x2f1af4){log(_0x44d6f7(0x220)+(_0x2f1af4 instanceof Error?_0x2f1af4['message']:String(_0x2f1af4)));}}function mapBuildPhase(_0x3f168a){const _0x6c75ff=a29_0x553e97;switch(_0x3f168a){case _0x6c75ff(0x212):return _0x6c75ff(0x246);case'installing':return _0x6c75ff(0x225);case'building':return'build_building';case _0x6c75ff(0x21a):return'build_publishing';case _0x6c75ff(0x24c):return'build_done';case _0x6c75ff(0x1ea):return _0x6c75ff(0x1f5);}}function a29_0x44ff(){const _0x43f54e=['build\x20FAILED:\x20','length','2101XWPgbn','3682610JYElvD','deploy\x20SUCCESS:\x20','threadId','clear','\x20logs=','\x20message=','error','join','projectId','totalZipSize','构建超时','\x20zip=','getBuildStatus\x20parse\x20error,\x20raw=','\x20timeout=','1383365IKmxfz','\x20失败\x20(','查询构建状态','failed','490LKFWPn','parse','build\x20phase\x20changed:\x20','):\x20','POST','[publish]\x20','getBuildStatus:\x20phase=','FAILED:\x20no\x20deployment\x20ID\x20extracted','\x20polls,\x20last\x20phase:\x20','match','\x20hasResult=','部署失败','phase','\x20after\x20','COMATE_CLOUD_API_BASE','message','触发部署...','build\x20logs\x20(last\x2010):\x0a','\x20polls','deploy\x20poll\x20#','/api/v2/threads/','deployment\x20ID\x20extracted:\x20','has','replace','\x20projectId=','https://open.wps.cn/app-studio/runtime/','totalFileCount','提交构建','pending','deploying','short_url','...)','\x20access_url=','https://o.wpsgo.com/app-studio/runtime/','4DBsmjL','\x20(poll\x20#','publishing','构建状态解析失败:\x20','publishVersion:\x20deploy_status=','/publish','build\x20TIMEOUT\x20after\x20','部署超时','captureScreenshot\x20error:\x20','GET','/publish/status','submitBuild\x20response:\x20phase=','startsWith','build_installing','8vJjAyV','now','access_url','部署成功:\x20','submitBuild\x20POST\x20','publishVersion\x20FAILED:\x20','未知错误','catch','\x20body=','env','status','result','active','728JhObMj','versionId','skipBuild','27958lHJmmW','build\x20reached\x20terminal\x20phase:\x20','stringify',':\x20status=','登录已过期,请重新执行\x20npx\x20--yes\x20@wps365-open/comate-cli@latest\x20auth\x20login','\x20→\x20','1494063QhODkG','7387836mODfgZ','slice','210648ehNJUf','json','构建失败:\x20','deployed','39006fcIqnB','deploy\x20TIMEOUT\x20after\x20','\x20error:\x20','build_pending','captureScreenshot\x20failed\x20(','\x20skipBuild=','\x20error=','text','\x20short_url=','published','logs','部署失败:\x20'];a29_0x44ff=function(){return _0x43f54e;};return a29_0x44ff();}function extractDeploymentId(_0x1f8f71){const _0x14089e=a29_0x553e97,_0x198a85=_0x1f8f71[_0x14089e(0x1ff)](/\/([0-9a-f-]{36})\/?/);return _0x198a85?.[0x1];}function sleep(_0x4a462c){return new Promise(_0xfb0eae=>setTimeout(_0xfb0eae,_0x4a462c));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x1efb84=a30_0x30f6;function a30_0x3194(){const _0x57f102=['/deployment/recall','8657844AeVDsR','7358008XUzWcr','/api/runtime/v1/deployments/','/scopes/update','data','17597025UaGHHp','/deployments/','/versions/','36476Tuychc','3gCzbic','/versions','2997994eZUfFz','initialize','msg','/teams/my','/api/manage/v1','/projects?team_id=','8UQhpjZ','description','items','/teams','/thread','/configs','post','projectName','1071323tcRHOI','code','&page=1&page_size=100','isArray','config_value','5791885eriwDW','/apps/',',\x20msg:\x20','/projects','get','/apps','/projects/'];a30_0x3194=function(){return _0x57f102;};return a30_0x3194();}(function(_0x2b7e2e,_0x4854a6){const _0xfd270c=a30_0x30f6,_0xb36fba=_0x2b7e2e();while(!![]){try{const _0x5eff71=-parseInt(_0xfd270c(0x1aa))/0x1+parseInt(_0xfd270c(0x19c))/0x2*(-parseInt(_0xfd270c(0x19a))/0x3)+-parseInt(_0xfd270c(0x199))/0x4+parseInt(_0xfd270c(0x189))/0x5+parseInt(_0xfd270c(0x191))/0x6+-parseInt(_0xfd270c(0x192))/0x7+-parseInt(_0xfd270c(0x1a2))/0x8*(-parseInt(_0xfd270c(0x196))/0x9);if(_0x5eff71===_0x4854a6)break;else _0xb36fba['push'](_0xb36fba['shift']());}catch(_0x12dce4){_0xb36fba['push'](_0xb36fba['shift']());}}}(a30_0x3194,0xe2129));import{SimpleHttpClient}from'../http/client.js';import{APP_STUDIO_BASE}from'../config/constants.js';const manageClient=new SimpleHttpClient(APP_STUDIO_BASE),MANAGE_PREFIX=a30_0x1efb84(0x1a0);export async function getMyTeams(){const _0x13e2bb=a30_0x1efb84;manageClient[_0x13e2bb(0x19d)]();const _0x75dfd4=await manageClient['get'](MANAGE_PREFIX+_0x13e2bb(0x19f));if(Array[_0x13e2bb(0x1ad)](_0x75dfd4[_0x13e2bb(0x195)]?.[_0x13e2bb(0x1a4)]))return _0x75dfd4[_0x13e2bb(0x195)][_0x13e2bb(0x1a4)];const _0x1098f4=_0x75dfd4;return _0x1098f4[_0x13e2bb(0x1a4)]??[];}export async function createTeam(_0x1fa88f){const _0x447bc0=a30_0x1efb84;manageClient[_0x447bc0(0x19d)]();const _0x2225a1=await manageClient[_0x447bc0(0x1a8)](MANAGE_PREFIX+_0x447bc0(0x1a5),{'team_name':_0x1fa88f});return unwrap(_0x2225a1);}export async function upsertProjectThread(_0x91d88c,_0xa02460){const _0x5370b7=a30_0x1efb84;manageClient[_0x5370b7(0x19d)]();const _0x524ea3=await manageClient['post'](MANAGE_PREFIX+_0x5370b7(0x18f)+_0x91d88c+_0x5370b7(0x1a6),{'thread_id':_0xa02460});return unwrap(_0x524ea3);}export async function getProjectThread(_0x1f1c72){const _0x27c730=a30_0x1efb84;manageClient[_0x27c730(0x19d)]();const _0x536e9d=await manageClient[_0x27c730(0x18d)](MANAGE_PREFIX+_0x27c730(0x18f)+_0x1f1c72+'/thread');return unwrap(_0x536e9d);}function unwrap(_0x355c0c){const _0x328a42=a30_0x1efb84;if(_0x355c0c[_0x328a42(0x195)]!==undefined&&_0x355c0c[_0x328a42(0x195)]!==null)return _0x355c0c['data'];if(typeof _0x355c0c==='object'&&!(_0x328a42(0x1ab)in _0x355c0c&&_0x328a42(0x19e)in _0x355c0c))return _0x355c0c;throw new Error('API\x20返回数据为空\x20(code:\x20'+_0x355c0c[_0x328a42(0x1ab)]+_0x328a42(0x18b)+_0x355c0c[_0x328a42(0x19e)]+')');}function unwrapList(_0x557658){const _0x41e49c=a30_0x1efb84;return _0x557658['data']?.[_0x41e49c(0x1a4)]??[];}export async function createProject(_0x597287){const _0x377caf=a30_0x1efb84;manageClient['initialize']();const _0x5e3615=await manageClient[_0x377caf(0x1a8)](MANAGE_PREFIX+_0x377caf(0x18c),{'team_id':_0x597287['teamId'],'project_name':_0x597287[_0x377caf(0x1a9)],'description':_0x597287[_0x377caf(0x1a3)]??''});return unwrap(_0x5e3615);}export async function listProjects(_0x70b63b){const _0x1f1ae0=a30_0x1efb84;manageClient['initialize']();const _0x152893=await manageClient[_0x1f1ae0(0x18d)](MANAGE_PREFIX+_0x1f1ae0(0x1a1)+_0x70b63b+_0x1f1ae0(0x1ac));return unwrapList(_0x152893);}export async function getProjectVersions(_0x452dda){const _0xa38d44=a30_0x1efb84;manageClient['initialize']();const _0x53765f=await manageClient[_0xa38d44(0x18d)](MANAGE_PREFIX+_0xa38d44(0x18f)+_0x452dda+_0xa38d44(0x19b));return unwrapList(_0x53765f);}export async function createVersion(_0xdd5ebd,_0x14429b){const _0x3250a9=a30_0x1efb84;manageClient[_0x3250a9(0x19d)]();const _0x5dc325=await manageClient[_0x3250a9(0x1a8)](MANAGE_PREFIX+_0x3250a9(0x18f)+_0xdd5ebd+_0x3250a9(0x19b),{'version_number':_0x14429b,'description':_0x14429b+'\x20version'});return unwrap(_0x5dc325);}export async function publishVersion(_0x402b96,_0x15683a){const _0x546c23=a30_0x1efb84;manageClient[_0x546c23(0x19d)]();const _0xee7bb3=await manageClient[_0x546c23(0x1a8)](MANAGE_PREFIX+_0x546c23(0x18f)+_0x402b96+_0x546c23(0x198)+_0x15683a+'/publish');return unwrap(_0xee7bb3);}export async function getDeploymentStatus(_0x4e127d){const _0x26b69e=a30_0x1efb84;manageClient[_0x26b69e(0x19d)]();const _0x2451e1=await manageClient[_0x26b69e(0x18d)](_0x26b69e(0x193)+_0x4e127d);return unwrap(_0x2451e1);}export async function lookupDeployment(_0x2e6cf7,_0x12c79d){const _0x20ae64=a30_0x1efb84;manageClient[_0x20ae64(0x19d)]();const _0x71d685=await manageClient[_0x20ae64(0x18d)](MANAGE_PREFIX+_0x20ae64(0x197)+_0x2e6cf7+'/'+_0x12c79d);return unwrap(_0x71d685);}export async function recallDeployment(_0x965abd){const _0x291887=a30_0x1efb84;manageClient['initialize']();const _0x450bdd=await manageClient[_0x291887(0x1a8)](MANAGE_PREFIX+_0x291887(0x18f)+_0x965abd+_0x291887(0x190));return unwrap(_0x450bdd);}export async function downloadFrontend(_0x5b905a,_0x5e0e0d){const _0x54b099=a30_0x1efb84;manageClient[_0x54b099(0x19d)]();const _0xc19b1b=await manageClient[_0x54b099(0x18d)](MANAGE_PREFIX+'/projects/'+_0x5b905a+_0x54b099(0x198)+_0x5e0e0d+'/frontend/download');return unwrap(_0xc19b1b);}export async function getProjectConfigs(_0x2d1c87){const _0x158dc1=a30_0x1efb84;manageClient['initialize']();const _0x436462=await manageClient['get'](MANAGE_PREFIX+_0x158dc1(0x18f)+_0x2d1c87+_0x158dc1(0x1a7)),_0x3d67d6=unwrap(_0x436462);if(Array['isArray'](_0x3d67d6)){const _0x328646={};for(const _0x553c7d of _0x3d67d6)_0x328646[_0x553c7d['config_key']]=_0x553c7d[_0x158dc1(0x188)];return _0x328646;}return _0x3d67d6;}export async function setProjectConfig(_0x5e1154,_0xf75480,_0x331a3c){const _0x4e4c8f=a30_0x1efb84;manageClient['initialize'](),await manageClient['post'](MANAGE_PREFIX+_0x4e4c8f(0x18f)+_0x5e1154+_0x4e4c8f(0x1a7),{'config_key':_0xf75480,'config_value':_0x331a3c});}function a30_0x30f6(_0x1c7dcd,_0x2392f6){_0x1c7dcd=_0x1c7dcd-0x188;const _0x31949d=a30_0x3194();let _0x30f648=_0x31949d[_0x1c7dcd];return _0x30f648;}export async function bindAppToProject(_0x3b933c,_0xc2296d,_0x402dce){const _0x1ca4a3=a30_0x1efb84;manageClient[_0x1ca4a3(0x19d)]();const _0x568877=await manageClient[_0x1ca4a3(0x1a8)](MANAGE_PREFIX+_0x1ca4a3(0x18f)+_0x3b933c+_0x1ca4a3(0x18e),{'open_app_id':_0xc2296d,'open_ssid':_0x402dce});return unwrap(_0x568877);}export async function updateProjectAppScopes(_0x3ad5d8,_0x5da010,_0x487bcc){const _0x452eae=a30_0x1efb84;manageClient[_0x452eae(0x19d)]();const _0x28e6e7=await manageClient[_0x452eae(0x1a8)](MANAGE_PREFIX+_0x452eae(0x18f)+_0x3ad5d8+_0x452eae(0x18a)+_0x5da010+_0x452eae(0x194),{'scopes':_0x487bcc});return unwrap(_0x28e6e7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x10fe0a,_0x3ff871){const _0x3c34d3=a31_0xc183,_0x17d839=_0x10fe0a();while(!![]){try{const _0x433d68=-parseInt(_0x3c34d3(0xa6))/0x1*(parseInt(_0x3c34d3(0x89))/0x2)+-parseInt(_0x3c34d3(0xa2))/0x3*(parseInt(_0x3c34d3(0x97))/0x4)+-parseInt(_0x3c34d3(0x8f))/0x5*(parseInt(_0x3c34d3(0xa3))/0x6)+-parseInt(_0x3c34d3(0x8a))/0x7+-parseInt(_0x3c34d3(0x9d))/0x8*(-parseInt(_0x3c34d3(0x87))/0x9)+-parseInt(_0x3c34d3(0x91))/0xa+-parseInt(_0x3c34d3(0xa5))/0xb*(-parseInt(_0x3c34d3(0x8b))/0xc);if(_0x433d68===_0x3ff871)break;else _0x17d839['push'](_0x17d839['shift']());}catch(_0xeae1a2){_0x17d839['push'](_0x17d839['shift']());}}}(a31_0xaabf,0x5dd16));import{getThreadState}from'./cloud-agent.js';import{getBuildStatus}from'./cloud-publish.js';function a31_0xc183(_0x479a2b,_0x535f38){_0x479a2b=_0x479a2b-0x82;const _0xaabfee=a31_0xaabf();let _0xc18394=_0xaabfee[_0x479a2b];return _0xc18394;}import{getProjectVersions}from'./manage.js';function a31_0xaabf(){const _0x5ca1a9=['version_number','result','16DvjEgV','none','string','phase','message','description','8uEbluX','fulfilled','type','object','deploy_status','55362dCpCkL','192462kgLSOP','deployed','6595534EXKLju','1nLeJEY','next','created_at','tasks','length','value','values','isArray','6419403zHHNnl','short_url','33778vdnUHO','1733144yejTQW','12rHDrzW','sort','files','access_url','60aAXsbW','failed','2053620nRLxsI','status','todos','resolve'];a31_0xaabf=function(){return _0x5ca1a9;};return a31_0xaabf();}function extractDescription(_0x174e74){const _0x589f9e=a31_0xc183;if(typeof _0x174e74===_0x589f9e(0x99))return _0x174e74;if(!_0x174e74||typeof _0x174e74!==_0x589f9e(0xa0))return null;const _0x238328=_0x174e74;return _0x238328[_0x589f9e(0x9c)]??_0x238328[_0x589f9e(0x9b)]??_0x238328[_0x589f9e(0x9f)]??null;}function extractInterrupt(_0x2af48){for(const _0x2c15c5 of _0x2af48){const _0x537772=_0x2c15c5,_0x3ff790=_0x537772['interrupts'];if(_0x3ff790?.['length']){const _0x36b56c=_0x3ff790[0x0],_0x58db9d=_0x36b56c['value'];return{'waiting':!![],'description':extractDescription(_0x58db9d),'value':_0x58db9d};}}return{'waiting':![]};}function settled(_0x2c6730){const _0x2524ef=a31_0xc183;return _0x2c6730[_0x2524ef(0x92)]===_0x2524ef(0x9e)?_0x2c6730[_0x2524ef(0x84)]:null;}function buildAgentBlock(_0x1443c1){const _0x309ba6=a31_0xc183;if(!_0x1443c1)return{'messages_count':0x0,'file_count':0x0,'has_todos':![],'tasks_count':0x0};const _0x46d06b=_0x1443c1[_0x309ba6(0x85)]?.['messages'],_0x3fb698=_0x1443c1[_0x309ba6(0x85)]?.[_0x309ba6(0x8d)],_0x53f8d3=_0x1443c1[_0x309ba6(0x85)]?.[_0x309ba6(0x93)];let _0x573154=0x0;return _0x3fb698&&typeof _0x3fb698==='object'&&(_0x573154=Object['keys'](_0x3fb698)['length']),{'messages_count':Array[_0x309ba6(0x86)](_0x46d06b)?_0x46d06b[_0x309ba6(0x83)]:0x0,'file_count':_0x573154,'has_todos':Array[_0x309ba6(0x86)](_0x53f8d3)?_0x53f8d3[_0x309ba6(0x83)]>0x0:![],'tasks_count':Array['isArray'](_0x1443c1[_0x309ba6(0x82)])?_0x1443c1[_0x309ba6(0x82)][_0x309ba6(0x83)]:0x0};}function buildBuildBlock(_0x52256a){const _0x15884a=a31_0xc183;if(!_0x52256a)return{'phase':_0x15884a(0x98),'message':''};return{'phase':_0x52256a[_0x15884a(0x9a)],'message':_0x52256a['message']};}function buildDeployBlock(_0x1873be){const _0x344747=a31_0xc183;if(!_0x1873be)return{'status':_0x344747(0x98),'access_url':null,'short_url':null};const _0x3e8fc3=_0x1873be[_0x344747(0x96)]?.['publishResponse'];if(!_0x3e8fc3)return{'status':'none','access_url':null,'short_url':null};const _0x3353a3={'deployed':_0x344747(0xa4),'deploying':'deploying','failed':_0x344747(0x90)};return{'status':_0x3353a3[_0x3e8fc3[_0x344747(0xa1)]??'']??_0x344747(0x98),'access_url':_0x3e8fc3[_0x344747(0x8e)]||null,'short_url':_0x3e8fc3[_0x344747(0x88)]||null};}function buildProjectBlock(_0x26892f,_0x3d2009){const _0x3bcc35=a31_0xc183;if(!_0x3d2009)return{'id':_0x26892f,'name':null,'versions_count':0x0,'latest_version':null};const _0x58fa7b=[..._0x3d2009][_0x3bcc35(0x8c)]((_0x470083,_0x261e7e)=>_0x261e7e['created_at']-_0x470083[_0x3bcc35(0xa8)]);return{'id':_0x26892f,'name':null,'versions_count':_0x3d2009['length'],'latest_version':_0x58fa7b[0x0]?.[_0x3bcc35(0x95)]??null};}export async function getProjectContext(_0x2f5be7,_0x358628){const _0x2420dc=a31_0xc183,[_0x1cf768,_0x14ef97,_0x289f91]=await Promise['allSettled']([getThreadState(_0x2f5be7),getBuildStatus(_0x2f5be7),_0x358628?getProjectVersions(_0x358628):Promise[_0x2420dc(0x94)](null)]),_0x4c434f=settled(_0x1cf768),_0x410435=settled(_0x14ef97),_0x41a618=settled(_0x289f91),_0x17e0af=buildDeployBlock(_0x410435),_0x4341ad=buildAgentBlock(_0x4c434f),_0x29fa50=_0x4c434f?(_0x4c434f[_0x2420dc(0xa7)]?.[_0x2420dc(0x83)]??0x0)>0x0:![];return{'thread_id':_0x2f5be7,'agent':{..._0x4341ad,'running':_0x29fa50},'interrupt':extractInterrupt(_0x4c434f?.[_0x2420dc(0x82)]??[]),'build':buildBuildBlock(_0x410435),'deploy':_0x17e0af,'project':_0x358628!=null?buildProjectBlock(_0x358628,_0x41a618):null,'urls':{'runtime':_0x17e0af[_0x2420dc(0x88)]||_0x17e0af[_0x2420dc(0x8e)],'short_url':_0x17e0af[_0x2420dc(0x88)]}};}
|