@wps365-open/comate-cli 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -0
- package/bin/dev.js +7 -0
- package/bin/run.js +5 -0
- package/dist/commands/auth/login.js +1 -0
- package/dist/commands/auth/logout.js +1 -0
- package/dist/commands/auth/status.js +1 -0
- package/dist/commands/code/create.js +1 -0
- package/dist/commands/code/deploy.js +1 -0
- package/dist/commands/code/files.js +1 -0
- package/dist/commands/code/publish.js +1 -0
- package/dist/commands/code/resume.js +1 -0
- package/dist/commands/code/send.js +1 -0
- package/dist/commands/code/status.js +1 -0
- package/dist/commands/code/upload.js +1 -0
- package/dist/commands/update.js +1 -0
- package/dist/hooks/init/logger.js +1 -0
- package/dist/hooks/prerun/update-checker.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/account/login-service.js +1 -0
- package/dist/lib/config/constants.js +1 -0
- package/dist/lib/config/manager.js +1 -0
- package/dist/lib/extends/command.js +1 -0
- package/dist/lib/http/auth-headers.js +1 -0
- package/dist/lib/http/client.js +1 -0
- package/dist/lib/log/logger.js +1 -0
- package/dist/lib/service/auth.js +1 -0
- package/dist/lib/service/cloud-agent.js +1 -0
- package/dist/lib/service/cloud-publish.js +1 -0
- package/dist/lib/service/manage.js +1 -0
- package/dist/lib/service/project-context.js +1 -0
- package/oclif.manifest.json +642 -0
- package/package.json +74 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# wcode
|
|
2
|
+
|
|
3
|
+
AI原生应用研发cli工具
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
|
8
|
+
|
|
9
|
+
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
|
10
|
+
|
|
11
|
+
## Add your files
|
|
12
|
+
|
|
13
|
+
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
|
14
|
+
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
cd existing_repo
|
|
18
|
+
git remote add origin https://ksogit.kingsoft.net/open/app-studio/wcode.git
|
|
19
|
+
git branch -M master
|
|
20
|
+
git push -uf origin master
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Integrate with your tools
|
|
24
|
+
|
|
25
|
+
- [ ] [Set up project integrations](https://ksogit.kingsoft.net/open/app-studio/wcode/-/settings/integrations)
|
|
26
|
+
|
|
27
|
+
## Collaborate with your team
|
|
28
|
+
|
|
29
|
+
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
|
30
|
+
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
|
31
|
+
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
|
32
|
+
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
|
33
|
+
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
|
34
|
+
|
|
35
|
+
## Test and Deploy
|
|
36
|
+
|
|
37
|
+
Use the built-in continuous integration in GitLab.
|
|
38
|
+
|
|
39
|
+
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
|
40
|
+
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
|
41
|
+
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
|
42
|
+
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
|
43
|
+
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
# Editing this README
|
|
48
|
+
|
|
49
|
+
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
|
50
|
+
|
|
51
|
+
## Suggestions for a good README
|
|
52
|
+
|
|
53
|
+
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
|
54
|
+
|
|
55
|
+
## Name
|
|
56
|
+
Choose a self-explaining name for your project.
|
|
57
|
+
|
|
58
|
+
## Description
|
|
59
|
+
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
|
60
|
+
|
|
61
|
+
## Badges
|
|
62
|
+
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
|
63
|
+
|
|
64
|
+
## Visuals
|
|
65
|
+
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
|
72
|
+
|
|
73
|
+
## Support
|
|
74
|
+
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
|
75
|
+
|
|
76
|
+
## Roadmap
|
|
77
|
+
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
|
78
|
+
|
|
79
|
+
## Contributing
|
|
80
|
+
State if you are open to contributions and what your requirements are for accepting them.
|
|
81
|
+
|
|
82
|
+
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
|
83
|
+
|
|
84
|
+
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
|
85
|
+
|
|
86
|
+
## Authors and acknowledgment
|
|
87
|
+
Show your appreciation to those who have contributed to the project.
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
For open source projects, say how it is licensed.
|
|
91
|
+
|
|
92
|
+
## Project status
|
|
93
|
+
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
package/bin/dev.js
ADDED
package/bin/run.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a0_0x1ddb(_0x7e4e79,_0x4d245d){_0x7e4e79=_0x7e4e79-0x76;const _0x24d7ca=a0_0x24d7();let _0x1ddb7a=_0x24d7ca[_0x7e4e79];return _0x1ddb7a;}function a0_0x24d7(){const _0x1e181a=['18888Fgabwo','login','6538356YxBrxK','10zRrQPq','run','flags','670600FXSQSB','jsonEnabled','error','wps_sid','3eZGnTt','如需切换账号,请使用\x20comate-cli\x20auth\x20login\x20-f','log','enableJsonFlag','380328HFlSlg','正在打开浏览器,请在浏览器中完成登录...','133NKTWFI','load','force','message','parse','当前已登录:\x20','本地凭证已过期,重新登录...','登录\x20WPS\x20账号','createLoading','208632DBRdHy','aliases','2088426XxThDQ','3888440ZnJHxm','stopLoading','boolean'];a0_0x24d7=function(){return _0x1e181a;};return a0_0x24d7();}const a0_0x6427bd=a0_0x1ddb;(function(_0x1f91b1,_0x38c40f){const _0x2441a7=a0_0x1ddb,_0x3e5b76=_0x1f91b1();while(!![]){try{const _0x3a588b=-parseInt(_0x2441a7(0x79))/0x1+-parseInt(_0x2441a7(0x8a))/0x2*(-parseInt(_0x2441a7(0x94))/0x3)+parseInt(_0x2441a7(0x90))/0x4*(parseInt(_0x2441a7(0x8d))/0x5)+-parseInt(_0x2441a7(0x86))/0x6+parseInt(_0x2441a7(0x7b))/0x7*(parseInt(_0x2441a7(0x84))/0x8)+parseInt(_0x2441a7(0x8c))/0x9+-parseInt(_0x2441a7(0x87))/0xa;if(_0x3a588b===_0x38c40f)break;else _0x3e5b76['push'](_0x3e5b76['shift']());}catch(_0x19efc2){_0x3e5b76['push'](_0x3e5b76['shift']());}}}(a0_0x24d7,0x6dbce));import{Flags}from'@oclif/core';import a0_0x1b16df from'../../lib/extends/command.js';import{configManager}from'../../lib/config/manager.js';import{getCurrentUser}from'../../lib/service/auth.js';import{loginWithBrowser}from'../../lib/account/login-service.js';export default class AuthLogin extends a0_0x1b16df{static ['description']=a0_0x6427bd(0x82);static [a0_0x6427bd(0x85)]=[a0_0x6427bd(0x8b)];static [a0_0x6427bd(0x78)]=!![];static [a0_0x6427bd(0x8f)]={'force':Flags[a0_0x6427bd(0x89)]({'char':'f','description':'强制重新登录(即使当前已登录)','default':![]})};async[a0_0x6427bd(0x8e)](){const _0x439858=a0_0x6427bd,{flags:_0x4d7465}=await this[_0x439858(0x7f)](AuthLogin);if(!_0x4d7465[_0x439858(0x7d)]){const _0x3bca65=configManager[_0x439858(0x7c)]();if(_0x3bca65[_0x439858(0x93)])try{const _0x499af9=await getCurrentUser();return configManager['saveUserInfo'](_0x499af9),!this[_0x439858(0x91)]()&&(this[_0x439858(0x77)](_0x439858(0x80)+_0x499af9['nickname']),this['log'](_0x439858(0x76))),{'nickname':_0x499af9['nickname'],'alreadyLoggedIn':!![]};}catch{!this['jsonEnabled']()&&this[_0x439858(0x77)](_0x439858(0x81));}}!this['jsonEnabled']()&&await this[_0x439858(0x83)](_0x439858(0x7a));try{const {nickname:_0x45c554}=await loginWithBrowser();return this[_0x439858(0x88)]('登录成功,欢迎\x20'+_0x45c554),{'nickname':_0x45c554,'alreadyLoggedIn':![]};}catch(_0x25400d){this['stopLoading'](),this[_0x439858(0x92)](_0x25400d instanceof Error?_0x25400d[_0x439858(0x7e)]:String(_0x25400d));}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a1_0x5971e0=a1_0x3423;(function(_0x35e6c7,_0x394e8c){const _0xbad07=a1_0x3423,_0x81399=_0x35e6c7();while(!![]){try{const _0x5e781c=parseInt(_0xbad07(0x131))/0x1+-parseInt(_0xbad07(0x137))/0x2+parseInt(_0xbad07(0x136))/0x3+-parseInt(_0xbad07(0x12c))/0x4+parseInt(_0xbad07(0x138))/0x5+-parseInt(_0xbad07(0x13a))/0x6+-parseInt(_0xbad07(0x135))/0x7*(-parseInt(_0xbad07(0x128))/0x8);if(_0x5e781c===_0x394e8c)break;else _0x81399['push'](_0x81399['shift']());}catch(_0x305ea2){_0x81399['push'](_0x81399['shift']());}}}(a1_0xf5f9,0x36a18));function a1_0xf5f9(){const _0xd939ab=['6671OPDuLD','754248bARNhH','859606LRJELF','320355zvEUPK','clear','1603194CdxksC','3296dLHdPd','user_info','parse','aliases','333028iNLwKx','logout','jsonEnabled','未知用户','已登出:\x20','295904zUVCAd','enableJsonFlag','description','log'];a1_0xf5f9=function(){return _0xd939ab;};return a1_0xf5f9();}function a1_0x3423(_0x60c6a2,_0x5ebb54){_0x60c6a2=_0x60c6a2-0x128;const _0xf5f90c=a1_0xf5f9();let _0x342320=_0xf5f90c[_0x60c6a2];return _0x342320;}import a1_0x36f531 from'../../lib/extends/command.js';import{configManager}from'../../lib/config/manager.js';export default class AuthLogout extends a1_0x36f531{static [a1_0x5971e0(0x133)]='登出当前\x20WPS\x20账号';static [a1_0x5971e0(0x12b)]=[a1_0x5971e0(0x12d)];static [a1_0x5971e0(0x132)]=!![];async['run'](){const _0x41b9fd=a1_0x5971e0;await this[_0x41b9fd(0x12a)](AuthLogout);const _0x322d49=configManager['load']();if(!_0x322d49['wps_sid'])return!this[_0x41b9fd(0x12e)]()&&this[_0x41b9fd(0x134)]('当前未登录'),{'loggedOut':![],'nickname':null};const _0x2a228f=_0x322d49[_0x41b9fd(0x129)]?.['nickname']??_0x41b9fd(0x12f);return configManager[_0x41b9fd(0x139)](),!this[_0x41b9fd(0x12e)]()&&this[_0x41b9fd(0x134)](_0x41b9fd(0x130)+_0x2a228f),{'loggedOut':!![],'nickname':_0x2a228f};}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a2_0x2c352d=a2_0x1e91;function a2_0x3ae0(){const _0x216078=['user_info','6qmyfXE','12616ikBXRi','385412TVMKnB','1978070TAIJyP','邮箱:\x20','399bgDXND','nickname','log','已登录,但无缓存的用户信息。请重新执行\x20comate-cli\x20auth\x20login。','82693FYncIl','description','50AYyjaQ','3XTbHnJ','whoami','user_id','jsonEnabled','4aqWpZM','用户:\x20','327740pMWDkK','parse','852uYuLim','ID:\x20\x20\x20','requireAuth','email','5875758dsUrvX','714219OHkfIR','aliases'];a2_0x3ae0=function(){return _0x216078;};return a2_0x3ae0();}(function(_0xa07eb0,_0x52a984){const _0x27f859=a2_0x1e91,_0x2b2145=_0xa07eb0();while(!![]){try{const _0x3aabe4=-parseInt(_0x27f859(0x1a0))/0x1*(parseInt(_0x27f859(0x1a2))/0x2)+-parseInt(_0x27f859(0x1b8))/0x3*(parseInt(_0x27f859(0x1ae))/0x4)+parseInt(_0x27f859(0x1af))/0x5*(-parseInt(_0x27f859(0x1ac))/0x6)+-parseInt(_0x27f859(0x1b1))/0x7*(-parseInt(_0x27f859(0x1ad))/0x8)+parseInt(_0x27f859(0x1a8))/0x9+parseInt(_0x27f859(0x1b7))/0xa*(parseInt(_0x27f859(0x1a9))/0xb)+parseInt(_0x27f859(0x1a4))/0xc*(parseInt(_0x27f859(0x1b5))/0xd);if(_0x3aabe4===_0x52a984)break;else _0x2b2145['push'](_0x2b2145['shift']());}catch(_0x3713f9){_0x2b2145['push'](_0x2b2145['shift']());}}}(a2_0x3ae0,0x5ab7c));function a2_0x1e91(_0x33eab,_0x14d96b){_0x33eab=_0x33eab-0x19e;const _0x3ae071=a2_0x3ae0();let _0x1e9101=_0x3ae071[_0x33eab];return _0x1e9101;}import a2_0x2fca87 from'../../lib/extends/command.js';import{configManager}from'../../lib/config/manager.js';export default class AuthStatus extends a2_0x2fca87{static [a2_0x2c352d(0x1b6)]='显示当前登录用户信息';static [a2_0x2c352d(0x1aa)]=[a2_0x2c352d(0x1b9)];static ['enableJsonFlag']=!![];async['run'](){const _0x26edb8=a2_0x2c352d;await this[_0x26edb8(0x1a3)](AuthStatus),await this[_0x26edb8(0x1a6)]();const _0x1dd49f=configManager['load'](),_0x52bdb1=_0x1dd49f[_0x26edb8(0x1ab)];return!_0x52bdb1&&this['error'](_0x26edb8(0x1b4)),!this[_0x26edb8(0x19f)]()&&(this[_0x26edb8(0x1b3)](_0x26edb8(0x1a1)+_0x52bdb1[_0x26edb8(0x1b2)]),this[_0x26edb8(0x1b3)](_0x26edb8(0x1b0)+_0x52bdb1[_0x26edb8(0x1a7)]),this[_0x26edb8(0x1b3)](_0x26edb8(0x1a5)+_0x52bdb1[_0x26edb8(0x19e)])),_0x52bdb1;}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a3_0x1540(_0x672587,_0x353819){_0x672587=_0x672587-0x13b;const _0x558de3=a3_0x558d();let _0x1540e2=_0x558de3[_0x672587];return _0x1540e2;}const a3_0xcb04fe=a3_0x1540;(function(_0x360218,_0x17296f){const _0x309b2f=a3_0x1540,_0x3bafa3=_0x360218();while(!![]){try{const _0x571122=-parseInt(_0x309b2f(0x14e))/0x1+parseInt(_0x309b2f(0x170))/0x2+parseInt(_0x309b2f(0x15e))/0x3+-parseInt(_0x309b2f(0x156))/0x4+parseInt(_0x309b2f(0x15b))/0x5*(parseInt(_0x309b2f(0x13d))/0x6)+-parseInt(_0x309b2f(0x166))/0x7*(parseInt(_0x309b2f(0x153))/0x8)+-parseInt(_0x309b2f(0x163))/0x9*(-parseInt(_0x309b2f(0x167))/0xa);if(_0x571122===_0x17296f)break;else _0x3bafa3['push'](_0x3bafa3['shift']());}catch(_0x4ea0a7){_0x3bafa3['push'](_0x3bafa3['shift']());}}}(a3_0x558d,0x62746));import{Flags}from'@oclif/core';import a3_0xd5d957 from'../../lib/extends/command.js';import{createThread}from'../../lib/service/cloud-agent.js';function a3_0x558d(){const _0xd29483=['app-buddy','<%=\x20config.bin\x20%>\x20code\x20create\x20--project-name\x20my-app\x20--json','\x20个团队,请通过\x20--team-id\x20指定:\x20','正在初始化...','length','云端\x20Agent\x20ID','139494wPANZp','项目名称(新建或复用同名项目)','error','inquirer','jsonEnabled','flags','integer','8598etzVcV','存在\x20','\x20(id=','thread_id','list','createLoading','正在关联项目与会话...','<%=\x20config.bin\x20%>\x20code\x20create\x20--project-id\x20206\x20--json','stopLoading','now','正在创建云端会话...','map','创建云端\x20Agent\x20会话(自动关联\x20team\x20→\x20project\x20→\x20thread)','run','team-id','log','会话已创建:\x20','640557VKYoYS','message','团队\x20ID(多团队时必填)','项目:\x20','enableJsonFlag','48yFdlfN','examples','resolveTeamId','1334996vrkdZl','我的团队','parse','project-id','项目就绪:\x20','2395cilkWf','team_name','Thread:\x20','213612eUTOZE','复用已有项目\x20ID(跳过项目创建)','project-name','string','请选择团队:','18hICavj','resolveProject','slice','908579FzOPVV','6645000XHMchh','prompt','created_at'];a3_0x558d=function(){return _0xd29483;};return a3_0x558d();}import{getMyTeams,createTeam,createProject,listProjects,upsertProjectThread}from'../../lib/service/manage.js';export default class CodeCreate extends a3_0xd5d957{static ['description']=a3_0xcb04fe(0x149);static [a3_0xcb04fe(0x152)]=!![];static [a3_0xcb04fe(0x154)]=[a3_0xcb04fe(0x16b),a3_0xcb04fe(0x144),'<%=\x20config.bin\x20%>\x20code\x20create\x20--project-name\x20my-app\x20--team-id\x201\x20--json'];static [a3_0xcb04fe(0x13b)]={'project-name':Flags[a3_0xcb04fe(0x161)]({'description':a3_0xcb04fe(0x171)}),'project-id':Flags['integer']({'description':a3_0xcb04fe(0x15f)}),'team-id':Flags[a3_0xcb04fe(0x13c)]({'description':a3_0xcb04fe(0x150)}),'agent-id':Flags[a3_0xcb04fe(0x161)]({'description':a3_0xcb04fe(0x16f),'default':a3_0xcb04fe(0x16a)})};async[a3_0xcb04fe(0x14a)](){const _0x1955b9=a3_0xcb04fe;await this['requireAuth']();const {flags:_0x35d32c}=await this[_0x1955b9(0x158)](CodeCreate),_0x1c491a=this[_0x1955b9(0x174)]();if(!_0x1c491a)await this[_0x1955b9(0x142)](_0x1955b9(0x16d));try{const {projectId:_0x389d49,teamId:_0xfbd7b0,projectName:_0x454075}=await this[_0x1955b9(0x164)](_0x35d32c,_0x1c491a);!_0x1c491a&&(this['stopLoading'](_0x1955b9(0x15a)+_0x454075+_0x1955b9(0x13f)+_0x389d49+')'),await this[_0x1955b9(0x142)](_0x1955b9(0x147)));const _0x4f506a=await createThread(_0x35d32c['agent-id']);return!_0x1c491a&&(this[_0x1955b9(0x145)](_0x1955b9(0x14d)+_0x4f506a['thread_id']),await this[_0x1955b9(0x142)](_0x1955b9(0x143))),await upsertProjectThread(_0x389d49,_0x4f506a[_0x1955b9(0x140)]),this['stopLoading']('关联完成'),!_0x1c491a&&(this[_0x1955b9(0x14c)](_0x1955b9(0x151)+_0x454075),this[_0x1955b9(0x14c)](_0x1955b9(0x15d)+_0x4f506a[_0x1955b9(0x140)])),{'thread_id':_0x4f506a[_0x1955b9(0x140)],'project_id':_0x389d49,'team_id':_0xfbd7b0,'project_name':_0x454075,'created_at':_0x4f506a[_0x1955b9(0x169)]};}catch(_0x1a6b31){this[_0x1955b9(0x145)](),this[_0x1955b9(0x172)](_0x1a6b31 instanceof Error?_0x1a6b31[_0x1955b9(0x14f)]:String(_0x1a6b31));}}async[a3_0xcb04fe(0x164)](_0x5a92a3,_0x50f214){const _0x537423=a3_0xcb04fe;if(_0x5a92a3[_0x537423(0x159)])return{'projectId':_0x5a92a3[_0x537423(0x159)],'teamId':_0x5a92a3[_0x537423(0x14b)]??0x0,'projectName':'project-'+_0x5a92a3[_0x537423(0x159)]};const _0x7e9838=await this[_0x537423(0x155)](_0x5a92a3[_0x537423(0x14b)],_0x50f214),_0x5a3f0b=_0x5a92a3[_0x537423(0x160)]??'app-'+Date[_0x537423(0x146)]()['toString'](0x24)[_0x537423(0x165)](-0x6),_0xfbb09d=await listProjects(_0x7e9838),_0x1d8262=_0xfbb09d['find'](_0x3f1f0a=>_0x3f1f0a['project_name']===_0x5a3f0b);if(_0x1d8262)return{'projectId':_0x1d8262['id'],'teamId':_0x7e9838,'projectName':_0x5a3f0b};const _0x32ecd3=await createProject({'teamId':_0x7e9838,'projectName':_0x5a3f0b});return{'projectId':_0x32ecd3['id'],'teamId':_0x7e9838,'projectName':_0x5a3f0b};}async['resolveTeamId'](_0x303280,_0x18f810){const _0x1a79d5=a3_0xcb04fe;if(_0x303280)return _0x303280;const _0x3d95c5=await getMyTeams();if(_0x3d95c5[_0x1a79d5(0x16e)]===0x0){const _0x53212a=await createTeam(_0x1a79d5(0x157));return _0x53212a['id'];}if(_0x3d95c5[_0x1a79d5(0x16e)]===0x1)return _0x3d95c5[0x0]['id'];if(_0x18f810)throw new Error(_0x1a79d5(0x13e)+_0x3d95c5[_0x1a79d5(0x16e)]+_0x1a79d5(0x16c)+_0x3d95c5[_0x1a79d5(0x148)](_0x546025=>_0x546025['team_name']+'('+_0x546025['id']+')')['join'](',\x20'));const {default:_0x2712c1}=await import(_0x1a79d5(0x173)),{teamId:_0x16088f}=await _0x2712c1[_0x1a79d5(0x168)]([{'type':_0x1a79d5(0x141),'name':'teamId','message':_0x1a79d5(0x162),'choices':_0x3d95c5[_0x1a79d5(0x148)](_0x1c6ee3=>({'name':_0x1c6ee3[_0x1a79d5(0x15c)]+'\x20('+_0x1c6ee3['id']+')','value':_0x1c6ee3['id']}))}]);return _0x16088f;}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a4_0x117a52=a4_0x23ce;(function(_0x1770d1,_0x3edb88){const _0x122b05=a4_0x23ce,_0x14bf7=_0x1770d1();while(!![]){try{const _0x40c7eb=-parseInt(_0x122b05(0xa4))/0x1+-parseInt(_0x122b05(0xaa))/0x2*(-parseInt(_0x122b05(0xa7))/0x3)+parseInt(_0x122b05(0x9f))/0x4*(parseInt(_0x122b05(0xf2))/0x5)+-parseInt(_0x122b05(0xb0))/0x6*(-parseInt(_0x122b05(0xee))/0x7)+-parseInt(_0x122b05(0xcd))/0x8*(-parseInt(_0x122b05(0xd1))/0x9)+-parseInt(_0x122b05(0xc5))/0xa*(parseInt(_0x122b05(0xac))/0xb)+-parseInt(_0x122b05(0x9c))/0xc*(parseInt(_0x122b05(0xe1))/0xd);if(_0x40c7eb===_0x3edb88)break;else _0x14bf7['push'](_0x14bf7['shift']());}catch(_0x540376){_0x14bf7['push'](_0x14bf7['shift']());}}}(a4_0x3a59,0x804a2));import a4_0x577a89 from'node:fs';function a4_0x23ce(_0x39490b,_0x2be021){_0x39490b=_0x39490b-0x9a;const _0x3a59bf=a4_0x3a59();let _0x23cef7=_0x3a59bf[_0x39490b];return _0x23cef7;}import a4_0x3f5b87 from'node:path';import{Flags}from'@oclif/core';import a4_0x2e9546 from'../../lib/extends/command.js';import{uploadFiles,createThread}from'../../lib/service/cloud-agent.js';function a4_0x3a59(){const _0x398a90=['stopLoading','.env','app-buddy','name','运行时地址:\x20','length','join','部署失败','readFileSync','slice','版本已创建:\x20','error','colorize','590tIMcAC','创建版本\x20','project-name','log','step','examples','发布超时时间(秒)','thread_id','3970664zlakPP','jsonEnabled','access_url','failed','18lLzJey','<%=\x20config.bin\x20%>\x20code\x20deploy\x20--file\x20./page.html\x20--thread-id\x20thread_xxx\x20--project-id\x20206\x20--json','string','enableJsonFlag','resolveTeamId','部署成功!','requireAuth','仅支持\x20HTML\x20文件\x20(.html\x20/\x20.htm)','deployed','list','spinner','now','map','文件不存在:\x20','...','deploy-','26CzoMJm','已有项目\x20ID(省略则自动创建)','deploy_error','.git','inquirer','message','existsSync','teamId','正在上传文件到沙箱...','thread-id','正在初始化项目...','text','red','735nmItmq','team-id','项目就绪\x20(project=','未知错误','1795265JhdaqR','comate.json','存在\x20','endsWith','请选择团队:','已有会话\x20ID(省略则自动创建)','.htm','.DS_Store','7777884aKVGTI','toLowerCase','status','4SWPHGb','createProjectIfNeeded','project-id','run','一键部署本地\x20HTML\x20文件到云端(上传\x20→\x20生成配置\x20→\x20发布)','447535kgFuaN','description','resolveSession','2546466ZdCcUH','flags','node_modules','2WEgfOd','index.html','70532OfcCvy','.html','project_name','createLoading','25548cCZFxQ','\x20个团队,请通过\x20--team-id\x20指定:\x20','toISOString','team_name','toString','parse','integer','原因:\x20'];a4_0x3a59=function(){return _0x398a90;};return a4_0x3a59();}import{createVersion,getMyTeams,createTeam,createProject,listProjects,upsertProjectThread}from'../../lib/service/manage.js';import{runFullPublish}from'../../lib/service/cloud-publish.js';export default class CodeDeploy extends a4_0x2e9546{static [a4_0x117a52(0xa5)]=a4_0x117a52(0xa3);static [a4_0x117a52(0xd4)]=!![];static [a4_0x117a52(0xca)]=['<%=\x20config.bin\x20%>\x20code\x20deploy\x20--file\x20./page.html\x20--json','<%=\x20config.bin\x20%>\x20code\x20deploy\x20--file\x20./index.html\x20--project-name\x20my-site\x20--json',a4_0x117a52(0xd2)];static [a4_0x117a52(0xa8)]={'file':Flags[a4_0x117a52(0xd3)]({'char':'f','description':'本地\x20HTML\x20文件路径','required':!![]}),'thread-id':Flags[a4_0x117a52(0xd3)]({'description':a4_0x117a52(0xf7)}),'project-id':Flags[a4_0x117a52(0xb6)]({'description':a4_0x117a52(0xe2)}),'project-name':Flags[a4_0x117a52(0xd3)]({'description':'项目名称(新建项目时使用)'}),'team-id':Flags[a4_0x117a52(0xb6)]({'description':'团队\x20ID(多团队时必填)'}),'timeout':Flags[a4_0x117a52(0xb6)]({'description':a4_0x117a52(0xcb),'default':0x258})};async[a4_0x117a52(0xa2)](){const _0x523e74=a4_0x117a52;await this[_0x523e74(0xd7)]();const {flags:_0x23d176}=await this[_0x523e74(0xb5)](CodeDeploy),_0xf284e9=this[_0x523e74(0xce)](),_0xdcac94=a4_0x3f5b87['resolve'](_0x23d176['file']);!a4_0x577a89[_0x523e74(0xe7)](_0xdcac94)&&this['error'](_0x523e74(0xde)+_0xdcac94);!_0xdcac94['toLowerCase']()['endsWith'](_0x523e74(0xad))&&!_0xdcac94[_0x523e74(0x9d)]()[_0x523e74(0xf5)](_0x523e74(0x9a))&&this[_0x523e74(0xc3)](_0x523e74(0xd8));try{const {threadId:_0x27c2e7,projectId:_0x52ee0a}=await this[_0x523e74(0xa6)](_0x23d176,_0xf284e9);if(!_0xf284e9)await this[_0x523e74(0xaf)](_0x523e74(0xe9));const _0x412843=a4_0x577a89[_0x523e74(0xc0)](_0xdcac94),_0xe713da=new Date()[_0x523e74(0xb2)](),_0x2aff76=JSON['stringify']({'publish':{'base':'.','include':['index.html'],'exclude':[],'ignore':[_0x523e74(0xa9),_0x523e74(0xe4),_0x523e74(0xb9),'.env.local',_0x523e74(0x9b),'**/*.map']},'project':{'id':_0x52ee0a,'createdAt':_0xe713da,'updatedAt':_0xe713da}},null,0x4),_0x506335=[{'name':_0x523e74(0xab),'content':_0x412843},{'name':_0x523e74(0xf3),'content':_0x2aff76}];await uploadFiles(_0x27c2e7,_0x506335);const _0x4b7061=_0x506335[_0x523e74(0xdd)](_0x5cbdc6=>_0x5cbdc6[_0x523e74(0xbb)]);!_0xf284e9&&this[_0x523e74(0xb8)]('上传完成:\x20'+_0x4b7061[_0x523e74(0xbe)](',\x20'));const _0x59fab7='v'+Date[_0x523e74(0xdc)]()[_0x523e74(0xb4)](0x24);if(!_0xf284e9)await this[_0x523e74(0xaf)](_0x523e74(0xc6)+_0x59fab7+_0x523e74(0xdf));const _0x50800a=await createVersion(_0x52ee0a,_0x59fab7);if(!_0xf284e9)this[_0x523e74(0xb8)](_0x523e74(0xc2)+_0x50800a['id']);if(!_0xf284e9)await this[_0x523e74(0xaf)]('正在发布...');const _0x294cc8=_0xf284e9?undefined:_0x3b8730=>{const _0x5272e3=_0x523e74;this['spinner']&&(this[_0x5272e3(0xdb)][_0x5272e3(0xec)]='['+_0x3b8730[_0x5272e3(0xc9)]+']\x20'+_0x3b8730[_0x5272e3(0xe6)]);},_0x2ae2a2=await runFullPublish({'threadId':_0x27c2e7,'projectId':_0x52ee0a,'versionId':_0x50800a['id'],'skipBuild':!![]},_0x294cc8,_0x23d176['timeout']*0x3e8);this[_0x523e74(0xb8)]();if(_0x2ae2a2[_0x523e74(0x9e)]===_0x523e74(0xd9))return!_0xf284e9&&(this[_0x523e74(0xc8)](this[_0x523e74(0xc4)](_0x523e74(0xd6),'green')),this[_0x523e74(0xc8)](_0x523e74(0xbc)+_0x2ae2a2[_0x523e74(0xcf)])),{'status':_0x523e74(0xd9),'thread_id':_0x27c2e7,'project_id':_0x52ee0a,'version_id':_0x50800a['id'],'access_url':_0x2ae2a2[_0x523e74(0xcf)],'uploaded_files':_0x4b7061};const _0x320bbb=_0x2ae2a2[_0x523e74(0xe3)]??_0x523e74(0xf1);return!_0xf284e9&&(this[_0x523e74(0xc8)](this['colorize'](_0x523e74(0xbf),_0x523e74(0xed))),this['log'](_0x523e74(0xb7)+_0x320bbb)),{'status':_0x523e74(0xd0),'thread_id':_0x27c2e7,'project_id':_0x52ee0a,'version_id':_0x50800a['id'],'error':_0x320bbb,'uploaded_files':_0x4b7061};}catch(_0x46c95d){this[_0x523e74(0xb8)]();const _0x38506b=_0x46c95d instanceof Error?_0x46c95d[_0x523e74(0xe6)]:String(_0x46c95d);if(_0xf284e9)return{'status':_0x523e74(0xd0),'thread_id':_0x23d176[_0x523e74(0xea)]??'','project_id':_0x23d176[_0x523e74(0xa1)]??0x0,'version_id':0x0,'error':_0x38506b};this[_0x523e74(0xc3)](_0x38506b);}}async[a4_0x117a52(0xa6)](_0x1848fa,_0x364c56){const _0x1e90f0=a4_0x117a52;if(_0x1848fa[_0x1e90f0(0xea)]&&_0x1848fa[_0x1e90f0(0xa1)])return{'threadId':_0x1848fa[_0x1e90f0(0xea)],'projectId':_0x1848fa[_0x1e90f0(0xa1)]};if(!_0x364c56)await this[_0x1e90f0(0xaf)](_0x1e90f0(0xeb));const _0x15841f=_0x1848fa[_0x1e90f0(0xa1)]??await this[_0x1e90f0(0xa0)](_0x1848fa,_0x364c56);let _0x3214d3=_0x1848fa[_0x1e90f0(0xea)];if(!_0x3214d3){const _0x368b40=await createThread(_0x1e90f0(0xba));_0x3214d3=_0x368b40[_0x1e90f0(0xcc)],await upsertProjectThread(_0x15841f,_0x3214d3);}if(!_0x364c56)this[_0x1e90f0(0xb8)](_0x1e90f0(0xf0)+_0x15841f+',\x20thread='+_0x3214d3[_0x1e90f0(0xc1)](0x0,0xc)+'...)');return{'threadId':_0x3214d3,'projectId':_0x15841f};}async[a4_0x117a52(0xa0)](_0x520377,_0x128e75){const _0x392a01=a4_0x117a52,_0x5b746a=await this[_0x392a01(0xd5)](_0x520377[_0x392a01(0xef)],_0x128e75),_0x394ff3=_0x520377[_0x392a01(0xc7)]??_0x392a01(0xe0)+Date[_0x392a01(0xdc)]()[_0x392a01(0xb4)](0x24)[_0x392a01(0xc1)](-0x6),_0x12ce43=await listProjects(_0x5b746a),_0x5adb92=_0x12ce43['find'](_0x39464f=>_0x39464f[_0x392a01(0xae)]===_0x394ff3);if(_0x5adb92)return _0x5adb92['id'];const _0x305ce2=await createProject({'teamId':_0x5b746a,'projectName':_0x394ff3});return _0x305ce2['id'];}async[a4_0x117a52(0xd5)](_0x47685f,_0x281165){const _0x46ff40=a4_0x117a52;if(_0x47685f)return _0x47685f;const _0x24b04e=await getMyTeams();if(_0x24b04e['length']===0x0){const _0x1b0411=await createTeam('我的团队');return _0x1b0411['id'];}if(_0x24b04e['length']===0x1)return _0x24b04e[0x0]['id'];if(_0x281165)throw new Error(_0x46ff40(0xf4)+_0x24b04e[_0x46ff40(0xbd)]+_0x46ff40(0xb1)+_0x24b04e[_0x46ff40(0xdd)](_0x1d26d4=>_0x1d26d4[_0x46ff40(0xb3)]+'('+_0x1d26d4['id']+')')[_0x46ff40(0xbe)](',\x20'));const {default:_0x2542bd}=await import(_0x46ff40(0xe5)),{teamId:_0x4344a2}=await _0x2542bd['prompt']([{'type':_0x46ff40(0xda),'name':_0x46ff40(0xe8),'message':_0x46ff40(0xf6),'choices':_0x24b04e[_0x46ff40(0xdd)](_0x12498a=>({'name':_0x12498a[_0x46ff40(0xb3)]+'\x20('+_0x12498a['id']+')','value':_0x12498a['id']}))}]);return _0x4344a2;}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a5_0xc9e3cb=a5_0xe8c0;(function(_0x29776f,_0x52f399){const _0x245578=a5_0xe8c0,_0x41b4e1=_0x29776f();while(!![]){try{const _0x1e24f1=-parseInt(_0x245578(0x1f0))/0x1*(parseInt(_0x245578(0x1ef))/0x2)+-parseInt(_0x245578(0x1d0))/0x3*(-parseInt(_0x245578(0x1e7))/0x4)+parseInt(_0x245578(0x1d4))/0x5+parseInt(_0x245578(0x1f1))/0x6*(parseInt(_0x245578(0x1ea))/0x7)+-parseInt(_0x245578(0x1d8))/0x8+parseInt(_0x245578(0x1ce))/0x9*(-parseInt(_0x245578(0x1dd))/0xa)+-parseInt(_0x245578(0x1dc))/0xb*(-parseInt(_0x245578(0x1f4))/0xc);if(_0x1e24f1===_0x52f399)break;else _0x41b4e1['push'](_0x41b4e1['shift']());}catch(_0x3ecea6){_0x41b4e1['push'](_0x41b4e1['shift']());}}}(a5_0x27b3,0xc4092));function a5_0xe8c0(_0x441e5b,_0x2b61d1){_0x441e5b=_0x441e5b-0x1ce;const _0x27b38f=a5_0x27b3();let _0xe8c04a=_0x27b38f[_0x441e5b];return _0xe8c04a;}import{Flags}from'@oclif/core';import a5_0x462141 from'../../lib/extends/command.js';import{getThreadState,downloadFiles}from'../../lib/service/cloud-agent.js';function a5_0x27b3(){const _0x45c4ef=['length','会话\x20ID','2SaXbVR','1009487PTVzgO','3192TvCgPh','downloadMode','正在下载\x20','84tzbeSO','9HdiSly','description','3873ZsbYPb','run','查看或下载云端\x20Agent\x20会话中的文件','enableJsonFlag','6823430PIzbnM','createLoading','string','<%=\x20config.bin\x20%>\x20code\x20files\x20--thread-id\x20thread_xxx\x20--download\x20src/App.tsx\x20--json','10191744hjuBpC','requireAuth','path','error','1838947RApaID','6974370BFJnOs','download','message','flags','要下载的文件路径(可指定多个)','listMode','\x20个文件:','parse','获取完成','thread-id','3868SzQEKQ','stopLoading','examples','7RhgHOI','log','正在获取文件列表...'];a5_0x27b3=function(){return _0x45c4ef;};return a5_0x27b3();}export default class CodeFiles extends a5_0x462141{static [a5_0xc9e3cb(0x1cf)]=a5_0xc9e3cb(0x1d2);static [a5_0xc9e3cb(0x1d3)]=!![];static [a5_0xc9e3cb(0x1e9)]=['<%=\x20config.bin\x20%>\x20code\x20files\x20--thread-id\x20thread_xxx\x20--json',a5_0xc9e3cb(0x1d7)];static [a5_0xc9e3cb(0x1e0)]={'thread-id':Flags[a5_0xc9e3cb(0x1d6)]({'description':a5_0xc9e3cb(0x1ee),'required':!![]}),'download':Flags[a5_0xc9e3cb(0x1d6)]({'description':a5_0xc9e3cb(0x1e1),'multiple':!![]})};async[a5_0xc9e3cb(0x1d1)](){const _0x7eca1f=a5_0xc9e3cb;await this[_0x7eca1f(0x1d9)]();const {flags:_0x51fe65}=await this[_0x7eca1f(0x1e4)](CodeFiles),_0xeb8bbc=this['jsonEnabled']();if(_0x51fe65[_0x7eca1f(0x1de)]&&_0x51fe65[_0x7eca1f(0x1de)][_0x7eca1f(0x1ed)]>0x0)return this[_0x7eca1f(0x1f2)](_0x51fe65[_0x7eca1f(0x1e6)],_0x51fe65[_0x7eca1f(0x1de)],_0xeb8bbc);return this[_0x7eca1f(0x1e2)](_0x51fe65[_0x7eca1f(0x1e6)],_0xeb8bbc);}async[a5_0xc9e3cb(0x1e2)](_0x2ecd8b,_0x789cfa){const _0x4219ab=a5_0xc9e3cb;!_0x789cfa&&await this['createLoading'](_0x4219ab(0x1ec));try{const _0x430971=await getThreadState(_0x2ecd8b),_0x357461=_0x430971['values']?.['files']??{};this[_0x4219ab(0x1e8)](_0x4219ab(0x1e5));if(!_0x789cfa){const _0x338642=Object['keys'](_0x357461);if(_0x338642[_0x4219ab(0x1ed)]===0x0)this[_0x4219ab(0x1eb)]('(暂无文件)');else{this['log']('共\x20'+_0x338642[_0x4219ab(0x1ed)]+_0x4219ab(0x1e3));for(const _0x56af74 of _0x338642){this[_0x4219ab(0x1eb)]('\x20\x20'+_0x56af74);}}}return{'thread_id':_0x2ecd8b,'files':_0x357461};}catch(_0x19aa4e){this[_0x4219ab(0x1e8)](),this['error'](_0x19aa4e instanceof Error?_0x19aa4e[_0x4219ab(0x1df)]:String(_0x19aa4e));}}async[a5_0xc9e3cb(0x1f2)](_0x57dfa6,_0x291fa1,_0x226b74){const _0x5d0bc3=a5_0xc9e3cb;!_0x226b74&&await this[_0x5d0bc3(0x1d5)](_0x5d0bc3(0x1f3)+_0x291fa1['length']+'\x20个文件...');try{const _0x2635b4=await downloadFiles(_0x57dfa6,_0x291fa1);this['stopLoading']('下载完成');if(!_0x226b74)for(const _0x112f45 of _0x2635b4){_0x112f45[_0x5d0bc3(0x1db)]?this['log']('❌\x20'+_0x112f45[_0x5d0bc3(0x1da)]+':\x20'+_0x112f45['error']):this[_0x5d0bc3(0x1eb)]('✅\x20'+_0x112f45[_0x5d0bc3(0x1da)]+'\x20('+(_0x112f45['content']?.[_0x5d0bc3(0x1ed)]??0x0)+'\x20bytes)');}return{'thread_id':_0x57dfa6,'results':_0x2635b4};}catch(_0xce3493){this[_0x5d0bc3(0x1e8)](),this['error'](_0xce3493 instanceof Error?_0xce3493['message']:String(_0xce3493));}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a6_0x1ca262=a6_0xc57a;function a6_0xc57a(_0x1564d1,_0x122360){_0x1564d1=_0x1564d1-0x1ec;const _0x1a3740=a6_0x1a37();let _0xc57a8d=_0x1a3740[_0x1564d1];return _0xc57a8d;}(function(_0x17eaa5,_0x331e2d){const _0x1fefbe=a6_0xc57a,_0x4fec4d=_0x17eaa5();while(!![]){try{const _0x9e8104=-parseInt(_0x1fefbe(0x21c))/0x1+parseInt(_0x1fefbe(0x204))/0x2*(-parseInt(_0x1fefbe(0x20c))/0x3)+parseInt(_0x1fefbe(0x228))/0x4+parseInt(_0x1fefbe(0x200))/0x5+-parseInt(_0x1fefbe(0x20a))/0x6*(-parseInt(_0x1fefbe(0x1f2))/0x7)+parseInt(_0x1fefbe(0x227))/0x8+-parseInt(_0x1fefbe(0x219))/0x9*(-parseInt(_0x1fefbe(0x209))/0xa);if(_0x9e8104===_0x331e2d)break;else _0x4fec4d['push'](_0x4fec4d['shift']());}catch(_0x206bd0){_0x4fec4d['push'](_0x4fec4d['shift']());}}}(a6_0x1a37,0x6f7c9));import{Flags}from'@oclif/core';import a6_0x59ae9a from'../../lib/extends/command.js';import{createVersion}from'../../lib/service/manage.js';function a6_0x1a37(){const _0x59399b=['发布成功!','。请先处理确认后再发布。','3061904AAZWJx','1975100XdGDxk','spinner','<%=\x20config.bin\x20%>\x20code\x20publish\x20--project-id\x20206\x20--thread-id\x20thread_xxx\x20--version\x201.0.0','云端\x20Agent\x20仍在生成代码,请稍后再试。','step','版本已创建:\x20','agent_running','access_url','版本号(默认自动生成)','integer','超时时间(秒)','running','agent_waiting','version','flags','build_logs','150311FepIIV','发布云端项目(构建\x20→\x20部署\x20→\x20返回运行时地址)','...','status','<%=\x20config.bin\x20%>\x20code\x20publish\x20--project-id\x20206\x20--thread-id\x20thread_xxx\x20--json','agent','会话\x20ID','now','description','deploy_error','log','跳过构建,直接发布','自定义构建命令','发布失败','667980ICUFrj','slice','createLoading','开始发布...','6wzbeuj','build_result','failed','skip-build','run','210470YfvCCB','54DIKErS','length','54927uJQXLt','云端\x20Agent\x20正在等待用户确认:','toString','error','原因:\x20','resolveVersion','thread-id','deployed','colorize','未知错误','message','interrupt','构建日志\x20(最近\x2020\x20条):','27ANrIrP','project-id','yellow','754931mtkEyN','build-command','string','jsonEnabled','parse','requireAuth','运行时地址:\x20','enableJsonFlag','stopLoading'];a6_0x1a37=function(){return _0x59399b;};return a6_0x1a37();}import{runFullPublish}from'../../lib/service/cloud-publish.js';import{getProjectContext}from'../../lib/service/project-context.js';export default class CodePublish extends a6_0x59ae9a{static ['description']=a6_0x1ca262(0x1f3);static [a6_0x1ca262(0x223)]=!![];static ['examples']=[a6_0x1ca262(0x1f6),a6_0x1ca262(0x22a)];static [a6_0x1ca262(0x1f0)]={'project-id':Flags[a6_0x1ca262(0x231)]({'description':'项目\x20ID','required':!![]}),'thread-id':Flags[a6_0x1ca262(0x21e)]({'description':a6_0x1ca262(0x1f8),'required':!![]}),'version':Flags[a6_0x1ca262(0x21e)]({'description':a6_0x1ca262(0x230)}),'build-command':Flags[a6_0x1ca262(0x21e)]({'description':a6_0x1ca262(0x1fe)}),'skip-build':Flags['boolean']({'description':a6_0x1ca262(0x1fd),'default':![]}),'timeout':Flags[a6_0x1ca262(0x231)]({'description':a6_0x1ca262(0x1ec),'default':0x258})};async[a6_0x1ca262(0x208)](){const _0x4b71fc=a6_0x1ca262;await this[_0x4b71fc(0x221)]();const {flags:_0x8c231b}=await this[_0x4b71fc(0x220)](CodePublish),_0x5dc2a6=this[_0x4b71fc(0x21f)](),_0x22038f=_0x8c231b[_0x4b71fc(0x21a)],_0x43d69b=_0x8c231b[_0x4b71fc(0x212)],_0x1d6143=_0x8c231b['timeout']*0x3e8;try{const _0x447836=await getProjectContext(_0x43d69b,_0x22038f);if(_0x447836[_0x4b71fc(0x217)]['waiting']){const _0x83ee29=_0x447836[_0x4b71fc(0x217)][_0x4b71fc(0x1fa)]??'',_0x540054=_0x4b71fc(0x20d)+_0x83ee29+_0x4b71fc(0x226);if(_0x5dc2a6)return{'status':_0x4b71fc(0x206),'project_id':_0x22038f,'version_id':0x0,'error':_0x540054,'reason':_0x4b71fc(0x1ee)};this[_0x4b71fc(0x20f)](_0x540054);}if(_0x447836[_0x4b71fc(0x1f7)][_0x4b71fc(0x1ed)]){const _0x2a8d89=_0x4b71fc(0x22b);if(_0x5dc2a6)return{'status':_0x4b71fc(0x206),'project_id':_0x22038f,'version_id':0x0,'error':_0x2a8d89,'reason':_0x4b71fc(0x22e)};this[_0x4b71fc(0x20f)](_0x2a8d89);}const _0x202698=await this['resolveVersion'](_0x22038f,_0x8c231b[_0x4b71fc(0x1ef)],_0x5dc2a6);!_0x5dc2a6&&await this['createLoading'](_0x4b71fc(0x203));const _0x30b7d3=_0x5dc2a6?undefined:_0x1866aa=>{const _0x29b793=_0x4b71fc;this[_0x29b793(0x229)]&&(this[_0x29b793(0x229)]['text']='['+_0x1866aa[_0x29b793(0x22c)]+']\x20'+_0x1866aa[_0x29b793(0x216)]);},_0x321ff9=await runFullPublish({'threadId':_0x43d69b,'projectId':_0x22038f,'versionId':_0x202698,'buildCommand':_0x8c231b[_0x4b71fc(0x21d)],'skipBuild':_0x8c231b[_0x4b71fc(0x207)]},_0x30b7d3,_0x1d6143);this[_0x4b71fc(0x224)]();if(_0x321ff9[_0x4b71fc(0x1f5)]===_0x4b71fc(0x213))return!_0x5dc2a6&&(this[_0x4b71fc(0x1fc)](this['colorize'](_0x4b71fc(0x225),'green')),this[_0x4b71fc(0x1fc)](_0x4b71fc(0x222)+_0x321ff9[_0x4b71fc(0x22f)])),{'status':_0x4b71fc(0x213),'project_id':_0x22038f,'version_id':_0x202698,'access_url':_0x321ff9[_0x4b71fc(0x22f)]};const _0x4b3e46=_0x321ff9[_0x4b71fc(0x1fb)]??_0x4b71fc(0x215);if(!_0x5dc2a6){this['log'](this[_0x4b71fc(0x214)](_0x4b71fc(0x1ff),'red')),this[_0x4b71fc(0x1fc)](_0x4b71fc(0x210)+_0x4b3e46);if(_0x321ff9[_0x4b71fc(0x1f1)]?.[_0x4b71fc(0x20b)]){this[_0x4b71fc(0x1fc)](this[_0x4b71fc(0x214)](_0x4b71fc(0x218),_0x4b71fc(0x21b)));for(const _0x58bcb5 of _0x321ff9[_0x4b71fc(0x1f1)][_0x4b71fc(0x201)](-0x14)){this[_0x4b71fc(0x1fc)]('\x20\x20'+_0x58bcb5);}}}return{'status':_0x4b71fc(0x206),'project_id':_0x22038f,'version_id':_0x202698,'error':_0x4b3e46,'build_logs':_0x321ff9[_0x4b71fc(0x1f1)]?.['slice'](-0x1e),'build_result':_0x321ff9[_0x4b71fc(0x205)]};}catch(_0x2d7bce){this[_0x4b71fc(0x224)]();const _0x572111=_0x2d7bce instanceof Error?_0x2d7bce['message']:String(_0x2d7bce);if(_0x5dc2a6)return{'status':_0x4b71fc(0x206),'project_id':_0x22038f,'version_id':0x0,'error':_0x572111};this[_0x4b71fc(0x20f)](_0x572111);}}async[a6_0x1ca262(0x211)](_0x2dfcc4,_0x22f4ef,_0x5a93a7){const _0x1aa135=a6_0x1ca262,_0x5c3f65=_0x22f4ef??'v'+Date[_0x1aa135(0x1f9)]()[_0x1aa135(0x20e)](0x24);!_0x5a93a7&&await this[_0x1aa135(0x202)]('创建版本\x20'+_0x5c3f65+_0x1aa135(0x1f4));const _0x2d27af=await createVersion(_0x2dfcc4,_0x5c3f65);return!_0x5a93a7&&this[_0x1aa135(0x224)](_0x1aa135(0x22d)+_0x2d27af['id']+'\x20('+_0x5c3f65+')'),_0x2d27af['id'];}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a7_0x166e(_0xd52c1f,_0x41b087){_0xd52c1f=_0xd52c1f-0x1a1;const _0x310830=a7_0x3108();let _0x166ea0=_0x310830[_0xd52c1f];return _0x166ea0;}const a7_0x1d425e=a7_0x166e;(function(_0x1730e1,_0x1b08d0){const _0xfd5f6f=a7_0x166e,_0x44ca2b=_0x1730e1();while(!![]){try{const _0x1d9802=parseInt(_0xfd5f6f(0x1b0))/0x1*(parseInt(_0xfd5f6f(0x1ae))/0x2)+parseInt(_0xfd5f6f(0x1a3))/0x3*(parseInt(_0xfd5f6f(0x1a5))/0x4)+parseInt(_0xfd5f6f(0x1ad))/0x5*(parseInt(_0xfd5f6f(0x1ab))/0x6)+-parseInt(_0xfd5f6f(0x1b5))/0x7+parseInt(_0xfd5f6f(0x1ba))/0x8*(-parseInt(_0xfd5f6f(0x1ac))/0x9)+parseInt(_0xfd5f6f(0x1a6))/0xa+-parseInt(_0xfd5f6f(0x1a9))/0xb;if(_0x1d9802===_0x1b08d0)break;else _0x44ca2b['push'](_0x44ca2b['shift']());}catch(_0x4d5149){_0x44ca2b['push'](_0x44ca2b['shift']());}}}(a7_0x3108,0xd2700));function a7_0x3108(){const _0x2406e3=['会话\x20ID','<%=\x20config.bin\x20%>\x20code\x20resume\x20--thread-id\x20thread_xxx\x20--reject\x20--message\x20\x22换个方案\x22\x20--json','reject','message','8056643yZokil','flags','requireAuth','批准当前方案(默认)','并恢复\x20Agent...','199280giXASr','拒绝当前方案','run','log','boolean','jsonEnabled','87sQPEGv','parse','232072MYfrVb','8264120bjnLXw','string','examples','22198638xCnNOD','description','1314jzsEKg','27nvNiEJ','17420JkEhzX','2YRWyvt','approve','833759HKGpkh'];a7_0x3108=function(){return _0x2406e3;};return a7_0x3108();}import{Flags}from'@oclif/core';import a7_0x59a306 from'../../lib/extends/command.js';import{resumeRun}from'../../lib/service/cloud-agent.js';export default class CodeResume extends a7_0x59a306{static [a7_0x1d425e(0x1aa)]='恢复被中断的云端\x20Agent(HITL\x20确认/拒绝)';static ['enableJsonFlag']=!![];static [a7_0x1d425e(0x1a8)]=['<%=\x20config.bin\x20%>\x20code\x20resume\x20--thread-id\x20thread_xxx\x20--approve\x20--json',a7_0x1d425e(0x1b2)];static [a7_0x1d425e(0x1b6)]={'thread-id':Flags['string']({'description':a7_0x1d425e(0x1b1),'required':!![]}),'approve':Flags[a7_0x1d425e(0x1a1)]({'description':a7_0x1d425e(0x1b8),'exclusive':[a7_0x1d425e(0x1b3)]}),'reject':Flags['boolean']({'description':a7_0x1d425e(0x1bb),'exclusive':[a7_0x1d425e(0x1af)]}),'message':Flags[a7_0x1d425e(0x1a7)]({'description':'附加说明(拒绝时建议提供)'}),'assistant-id':Flags[a7_0x1d425e(0x1a7)]({'description':'云端\x20Agent\x20ID','default':'app-buddy'})};async[a7_0x1d425e(0x1bc)](){const _0x400eee=a7_0x1d425e;await this[_0x400eee(0x1b7)]();const {flags:_0x55ccbb}=await this[_0x400eee(0x1a4)](CodeResume),_0x24e6a5=this[_0x400eee(0x1a2)](),_0x344e44=_0x55ccbb['thread-id'],_0x5e4a56=_0x55ccbb[_0x400eee(0x1b3)]===!![],_0xe47a5c=_0x5e4a56?_0x400eee(0x1b3):'approve',_0x29eba3={'type':_0xe47a5c};_0x55ccbb['message']&&(_0x29eba3[_0x400eee(0x1b4)]=_0x55ccbb['message']);const _0x368411={'decisions':[_0x29eba3]};if(!_0x24e6a5)this[_0x400eee(0x1bd)]('正在'+(_0x5e4a56?'拒绝':'批准')+_0x400eee(0x1b9));return await resumeRun({'threadId':_0x344e44,'resumeValue':_0x368411,'assistantId':_0x55ccbb['assistant-id']}),!_0x24e6a5&&this[_0x400eee(0x1bd)]('Agent\x20已恢复\x20('+_0xe47a5c+'),云端正在继续处理'),{'status':'resumed','thread_id':_0x344e44,'action':_0xe47a5c};}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a8_0x3e4aa=a8_0x14de;(function(_0x484dc7,_0x1b9570){const _0x4b585f=a8_0x14de,_0x54a543=_0x484dc7();while(!![]){try{const _0x3bee4e=-parseInt(_0x4b585f(0xa7))/0x1*(parseInt(_0x4b585f(0xab))/0x2)+parseInt(_0x4b585f(0xa1))/0x3*(-parseInt(_0x4b585f(0xa0))/0x4)+-parseInt(_0x4b585f(0x97))/0x5+parseInt(_0x4b585f(0x98))/0x6+-parseInt(_0x4b585f(0x9f))/0x7*(-parseInt(_0x4b585f(0xa8))/0x8)+parseInt(_0x4b585f(0x9d))/0x9*(parseInt(_0x4b585f(0x93))/0xa)+parseInt(_0x4b585f(0xb2))/0xb;if(_0x3bee4e===_0x1b9570)break;else _0x54a543['push'](_0x54a543['shift']());}catch(_0x178905){_0x54a543['push'](_0x54a543['shift']());}}}(a8_0x152f,0x7ec30));function a8_0x14de(_0x14fdd6,_0x4dfb8b){_0x14fdd6=_0x14fdd6-0x93;const _0x152f79=a8_0x152f();let _0x14dec0=_0x152f79[_0x14fdd6];return _0x14dec0;}import{Args,Flags}from'@oclif/core';import a8_0x29c461 from'../../lib/extends/command.js';function a8_0x152f(){const _0x25c1e0=['会话\x20ID(从\x20code\x20create\x20获取)','parse','log','22523523NYNoNm','发送给云端\x20Agent\x20的消息','76290ZGxRGs','jsonEnabled','submitted','向云端\x20Agent\x20发送消息(提交后立即返回)','3292255VRRkdk','855366xtWLEC','requireAuth','消息已提交,云端\x20Agent\x20正在处理','integer','assistant-id','9rGdulu','project-id','7kbgWxV','4nQmUnj','821553LkYHRU','提交消息到云端\x20Agent...','<%=\x20config.bin\x20%>\x20code\x20send\x20--thread-id\x20thread_xxx\x20--project-id\x20206\x20\x22做一个待办应用\x22\x20--json','user','args','项目\x20ID(从\x20code\x20create\x20获取,用于生成访问地址)','859582RhyzNb','906536liDYvE','run','flags','2xmMWuj','string','description','云端\x20Agent\x20ID'];a8_0x152f=function(){return _0x25c1e0;};return a8_0x152f();}import{submitRun}from'../../lib/service/cloud-agent.js';export default class CodeSend extends a8_0x29c461{static [a8_0x3e4aa(0xad)]=a8_0x3e4aa(0x96);static ['enableJsonFlag']=!![];static ['examples']=[a8_0x3e4aa(0xa3)];static [a8_0x3e4aa(0xa5)]={'message':Args[a8_0x3e4aa(0xac)]({'description':a8_0x3e4aa(0xb3),'required':!![]})};static [a8_0x3e4aa(0xaa)]={'thread-id':Flags[a8_0x3e4aa(0xac)]({'description':a8_0x3e4aa(0xaf),'required':!![]}),'project-id':Flags[a8_0x3e4aa(0x9b)]({'description':a8_0x3e4aa(0xa6)}),'assistant-id':Flags[a8_0x3e4aa(0xac)]({'description':a8_0x3e4aa(0xae),'default':'app-buddy'})};async[a8_0x3e4aa(0xa9)](){const _0x1340fc=a8_0x3e4aa;await this[_0x1340fc(0x99)]();const {args:_0x5c5a68,flags:_0x56af9a}=await this[_0x1340fc(0xb0)](CodeSend),_0x18a962=this[_0x1340fc(0x94)](),_0x53a9bf=_0x56af9a['thread-id'],_0x33a496=_0x56af9a[_0x1340fc(0x9e)];if(!_0x18a962)this[_0x1340fc(0xb1)](_0x1340fc(0xa2));return await submitRun({'threadId':_0x53a9bf,'messages':[{'role':_0x1340fc(0xa4),'content':_0x5c5a68['message']}],'assistantId':_0x56af9a[_0x1340fc(0x9c)]}),!_0x18a962&&this[_0x1340fc(0xb1)](_0x1340fc(0x9a)),{'status':_0x1340fc(0x95),'thread_id':_0x53a9bf,'project_id':_0x33a496};}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a9_0x19e0c3=a9_0x5c15;(function(_0x577b19,_0x1330b9){const _0x2342a8=a9_0x5c15,_0x342f63=_0x577b19();while(!![]){try{const _0x54b487=parseInt(_0x2342a8(0x198))/0x1*(parseInt(_0x2342a8(0x178))/0x2)+parseInt(_0x2342a8(0x1a0))/0x3+parseInt(_0x2342a8(0x180))/0x4*(-parseInt(_0x2342a8(0x190))/0x5)+-parseInt(_0x2342a8(0x17f))/0x6*(parseInt(_0x2342a8(0x19a))/0x7)+-parseInt(_0x2342a8(0x182))/0x8*(-parseInt(_0x2342a8(0x1a9))/0x9)+parseInt(_0x2342a8(0x192))/0xa+-parseInt(_0x2342a8(0x17a))/0xb;if(_0x54b487===_0x1330b9)break;else _0x342f63['push'](_0x342f63['shift']());}catch(_0x4b1398){_0x342f63['push'](_0x342f63['shift']());}}}(a9_0x2f9d,0x6cc2a));import{Flags}from'@oclif/core';function a9_0x5c15(_0x4ba0db,_0x595bfb){_0x4ba0db=_0x4ba0db-0x175;const _0x2f9da4=a9_0x2f9d();let _0x5c15b3=_0x2f9da4[_0x4ba0db];return _0x5c15b3;}import a9_0x5f26cc from'../../lib/extends/command.js';import{getProjectContext}from'../../lib/service/project-context.js';function a9_0x2f9d(){const _0x444d27=['requireAuth','project-id','string','printHuman','description','5spOyzq','deploy','3105510XNsKBz','integer','查看云端项目综合状态(Agent\x20/\x20构建\x20/\x20部署\x20/\x20HITL\x20中断)','会话\x20ID','waiting','runtime','32067BOACte','log','98hXuuFN','未知原因','enableJsonFlag','正在查询项目状态...','urls','Deploy:\x20\x20\x20\x20','633450CHLVJJ','access_url','createLoading','run','\x20files,\x20','agent','\x20tasks','stopLoading','tasks_count','1026KMwRiP','项目\x20ID(可选,传入后返回版本和部署信息)','thread_id','file_count','30lHVarw','build','4362193yuRpDh','message','parse','flags','<%=\x20config.bin\x20%>\x20code\x20status\x20--thread-id\x20thread_xxx\x20--json','179958zajNyU','2281348hPZsmF','interrupt','58216qMmMzW','messages_count','Build:\x20\x20\x20\x20\x20','\x20→\x20','jsonEnabled','\x20—\x20','phase','examples','查询完成'];a9_0x2f9d=function(){return _0x444d27;};return a9_0x2f9d();}export default class CodeStatus extends a9_0x5f26cc{static [a9_0x19e0c3(0x18f)]=a9_0x19e0c3(0x194);static [a9_0x19e0c3(0x19c)]=!![];static [a9_0x19e0c3(0x189)]=[a9_0x19e0c3(0x17e),'<%=\x20config.bin\x20%>\x20code\x20status\x20--thread-id\x20thread_xxx\x20--project-id\x20206\x20--json'];static [a9_0x19e0c3(0x17d)]={'thread-id':Flags[a9_0x19e0c3(0x18d)]({'description':a9_0x19e0c3(0x195),'required':!![]}),'project-id':Flags[a9_0x19e0c3(0x193)]({'description':a9_0x19e0c3(0x175)})};async[a9_0x19e0c3(0x1a3)](){const _0x1e2645=a9_0x19e0c3;await this[_0x1e2645(0x18b)]();const {flags:_0x19b02a}=await this[_0x1e2645(0x17c)](CodeStatus);!this['jsonEnabled']()&&await this[_0x1e2645(0x1a2)](_0x1e2645(0x19d));try{const _0x49879c=await getProjectContext(_0x19b02a['thread-id'],_0x19b02a[_0x1e2645(0x18c)]);return this[_0x1e2645(0x1a7)](_0x1e2645(0x18a)),!this[_0x1e2645(0x186)]()&&this[_0x1e2645(0x18e)](_0x49879c),_0x49879c;}catch(_0x1abfde){this[_0x1e2645(0x1a7)](),this['error'](_0x1abfde instanceof Error?_0x1abfde[_0x1e2645(0x17b)]:String(_0x1abfde));}}[a9_0x19e0c3(0x18e)](_0x527b30){const _0x3a1ad2=a9_0x19e0c3;this[_0x3a1ad2(0x199)]('Thread:\x20\x20\x20\x20'+_0x527b30[_0x3a1ad2(0x176)]),this[_0x3a1ad2(0x199)]('Agent:\x20\x20\x20\x20\x20'+_0x527b30[_0x3a1ad2(0x1a5)][_0x3a1ad2(0x183)]+'\x20messages,\x20'+_0x527b30[_0x3a1ad2(0x1a5)][_0x3a1ad2(0x177)]+_0x3a1ad2(0x1a4)+_0x527b30[_0x3a1ad2(0x1a5)][_0x3a1ad2(0x1a8)]+_0x3a1ad2(0x1a6));if(_0x527b30[_0x3a1ad2(0x181)][_0x3a1ad2(0x196)]){const _0x2fbe4b=_0x527b30[_0x3a1ad2(0x181)][_0x3a1ad2(0x18f)]??_0x3a1ad2(0x19b);this[_0x3a1ad2(0x199)](this['colorize']('⚠\x20WAITING:\x20Agent\x20等待确认\x20—\x20\x22'+_0x2fbe4b+'\x22','yellow'));}this[_0x3a1ad2(0x199)](_0x3a1ad2(0x184)+_0x527b30[_0x3a1ad2(0x179)][_0x3a1ad2(0x188)]+(_0x527b30[_0x3a1ad2(0x179)]['message']?_0x3a1ad2(0x187)+_0x527b30['build'][_0x3a1ad2(0x17b)]:'')),this['log'](_0x3a1ad2(0x19f)+_0x527b30[_0x3a1ad2(0x191)]['status']+(_0x527b30[_0x3a1ad2(0x191)]['access_url']?_0x3a1ad2(0x185)+_0x527b30[_0x3a1ad2(0x191)][_0x3a1ad2(0x1a1)]:'')),_0x527b30[_0x3a1ad2(0x19e)][_0x3a1ad2(0x197)]&&this[_0x3a1ad2(0x199)]('Runtime:\x20\x20\x20'+_0x527b30[_0x3a1ad2(0x19e)][_0x3a1ad2(0x197)]);}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a10_0x31939e=a10_0x560e;(function(_0xc9d03e,_0x13faa9){const _0x10610e=a10_0x560e,_0x260d3f=_0xc9d03e();while(!![]){try{const _0x2471ae=parseInt(_0x10610e(0x110))/0x1*(-parseInt(_0x10610e(0x123))/0x2)+parseInt(_0x10610e(0x122))/0x3+parseInt(_0x10610e(0x126))/0x4*(-parseInt(_0x10610e(0xf7))/0x5)+-parseInt(_0x10610e(0x10e))/0x6+parseInt(_0x10610e(0x130))/0x7*(parseInt(_0x10610e(0x125))/0x8)+-parseInt(_0x10610e(0xf3))/0x9*(parseInt(_0x10610e(0xff))/0xa)+-parseInt(_0x10610e(0x13b))/0xb*(-parseInt(_0x10610e(0x124))/0xc);if(_0x2471ae===_0x13faa9)break;else _0x260d3f['push'](_0x260d3f['shift']());}catch(_0x3f3374){_0x260d3f['push'](_0x260d3f['shift']());}}}(a10_0x97d9,0xd26d7));import a10_0x4bf6a8 from'node:fs';function a10_0x97d9(){const _0x263990=['31820800SlvaId','enableJsonFlag','push','957114gdGesc','replace','length','\x20个文件','5bNBlVI','has','run','split','isFile','code','description','路径不存在:\x20','100tThmhh','name','<%=\x20config.bin\x20%>\x20code\x20upload\x20--thread-id\x20thread_xxx\x20-d\x20./my-site\x20--json','relative','收集到\x20','\x20KB','node_modules','/index.html','string','不支持的文件类型:\x20','byteLength','thread-id','startsWith','sep','isBuffer','7803048YcEgJN','.html','4Kheogs','map','会话\x20ID','<%=\x20config.bin\x20%>\x20code\x20upload\x20--thread-id\x20thread_xxx\x20-d\x20./index.html\x20--json','content','join','readFileSync','createLoading','coverage','本地文件或目录路径','.hg','<%=\x20config.bin\x20%>\x20code\x20upload\x20--thread-id\x20thread_xxx\x20-d\x20./dist\x20--prefix\x20code\x20--json','jsonEnabled','上传完成:\x20','resolve','readdirSync','existsSync','flags','2383482ESFJqr','110246UZvBce','12fcGcaQ','191672tOsDts','4892968hzjZjv','error','basename','prefix','collectDirectory','log','dir','examples','\x20个文件\x20(','reduce','287PYQEXD','isDirectory','index.html','collectLocalFiles','endsWith','没有可上传的文件','message','collectSingleFile','stopLoading','.cache','\x20MB'];a10_0x97d9=function(){return _0x263990;};return a10_0x97d9();}function a10_0x560e(_0x54f349,_0x18384b){_0x54f349=_0x54f349-0xf3;const _0x97d956=a10_0x97d9();let _0x560ecf=_0x97d956[_0x54f349];return _0x560ecf;}import a10_0x5f52f2 from'node:path';import{Flags}from'@oclif/core';import a10_0x23d920 from'../../lib/extends/command.js';import{uploadFiles}from'../../lib/service/cloud-agent.js';const EXCLUDE_DIRS=new Set(['.git','.svn',a10_0x31939e(0x11a),a10_0x31939e(0x105),a10_0x31939e(0x139),a10_0x31939e(0x118),'skills']);export default class CodeUpload extends a10_0x23d920{static [a10_0x31939e(0xfd)]='上传本地文件或目录到云端\x20Agent\x20会话的\x20sandbox';static [a10_0x31939e(0x13c)]=!![];static [a10_0x31939e(0x12d)]=[a10_0x31939e(0x101),a10_0x31939e(0x113),a10_0x31939e(0x11b)];static [a10_0x31939e(0x121)]={'thread-id':Flags['string']({'description':a10_0x31939e(0x112),'required':!![]}),'dir':Flags[a10_0x31939e(0x107)]({'char':'d','description':a10_0x31939e(0x119),'required':!![]}),'prefix':Flags[a10_0x31939e(0x107)]({'description':'sandbox\x20中的目标目录前缀','default':a10_0x31939e(0xfc)})};async[a10_0x31939e(0xf9)](){const _0x16cb22=a10_0x31939e;await this['requireAuth']();const {flags:_0x1f091d}=await this['parse'](CodeUpload),_0x16dd9c=this[_0x16cb22(0x11c)](),_0x1d3508=a10_0x5f52f2[_0x16cb22(0x11e)](_0x1f091d[_0x16cb22(0x12c)]);!a10_0x4bf6a8[_0x16cb22(0x120)](_0x1d3508)&&this[_0x16cb22(0x127)](_0x16cb22(0xfe)+_0x1d3508);const _0x18adce=_0x1f091d[_0x16cb22(0x129)][_0x16cb22(0xf4)](/\/+$/,'');!_0x16dd9c&&await this[_0x16cb22(0x117)]('正在收集文件...');const _0x42bfec=this[_0x16cb22(0x133)](_0x1d3508,_0x18adce);_0x42bfec['length']===0x0&&(this[_0x16cb22(0x138)](),this[_0x16cb22(0x127)](_0x16cb22(0x135)));const _0x37018a=_0x42bfec[_0x16cb22(0x12f)]((_0x59373c,_0x4df483)=>{const _0x4361fe=_0x16cb22,_0x2168aa=_0x4df483[_0x4361fe(0x114)];return _0x59373c+(Buffer[_0x4361fe(0x10d)](_0x2168aa)?_0x2168aa[_0x4361fe(0xf5)]:Buffer[_0x4361fe(0x109)](_0x2168aa));},0x0);!_0x16dd9c&&(this[_0x16cb22(0x138)](_0x16cb22(0x103)+_0x42bfec[_0x16cb22(0xf5)]+_0x16cb22(0x12e)+formatBytes(_0x37018a)+')'),await this['createLoading']('正在上传...'));try{await uploadFiles(_0x1f091d[_0x16cb22(0x10a)],_0x42bfec);const _0x42f4be=_0x42bfec[_0x16cb22(0x111)](_0x40d29f=>_0x40d29f[_0x16cb22(0x100)]);this[_0x16cb22(0x138)](_0x16cb22(0x11d)+_0x42bfec['length']+_0x16cb22(0xf6));if(!_0x16dd9c)for(const _0x3908f0 of _0x42f4be){this[_0x16cb22(0x12b)]('\x20\x20'+_0x3908f0);}return{'thread_id':_0x1f091d[_0x16cb22(0x10a)],'uploaded':_0x42bfec[_0x16cb22(0xf5)],'total_bytes':_0x37018a,'files':_0x42f4be,'prefix':_0x18adce};}catch(_0x238cab){this['stopLoading'](),this[_0x16cb22(0x127)](_0x238cab instanceof Error?_0x238cab[_0x16cb22(0x136)]:String(_0x238cab));}}[a10_0x31939e(0x133)](_0x1a4efa,_0x1d2ffd){const _0x5a4284=a10_0x31939e,_0x4394fd=a10_0x4bf6a8['statSync'](_0x1a4efa);if(_0x4394fd['isFile']())return this[_0x5a4284(0x137)](_0x1a4efa,_0x1d2ffd);if(_0x4394fd[_0x5a4284(0x131)]())return this[_0x5a4284(0x12a)](_0x1a4efa,_0x1d2ffd);throw new Error(_0x5a4284(0x108)+_0x1a4efa);}['collectSingleFile'](_0x3eb2ff,_0x1bc195){const _0x1c8177=a10_0x31939e,_0x14655a=a10_0x5f52f2[_0x1c8177(0x128)](_0x3eb2ff),_0x1cebad=a10_0x4bf6a8[_0x1c8177(0x116)](_0x3eb2ff),_0x467fa5=[{'name':_0x1bc195+'/'+_0x14655a,'content':_0x1cebad}];return _0x14655a!==_0x1c8177(0x132)&&_0x14655a[_0x1c8177(0x134)](_0x1c8177(0x10f))&&_0x467fa5[_0x1c8177(0x13d)]({'name':_0x1bc195+_0x1c8177(0x106),'content':_0x1cebad}),_0x467fa5;}[a10_0x31939e(0x12a)](_0x3ba496,_0x384d7f){const _0x40fa4a=[],_0x19964a=_0x2543f2=>{const _0x1231ae=a10_0x560e;for(const _0x11abfe of a10_0x4bf6a8[_0x1231ae(0x11f)](_0x2543f2,{'withFileTypes':!![]})){if(_0x11abfe[_0x1231ae(0x100)][_0x1231ae(0x10b)]('.')&&EXCLUDE_DIRS[_0x1231ae(0xf8)](_0x11abfe[_0x1231ae(0x100)]))continue;const _0x53b101=a10_0x5f52f2[_0x1231ae(0x115)](_0x2543f2,_0x11abfe[_0x1231ae(0x100)]);if(_0x11abfe[_0x1231ae(0x131)]()){if(EXCLUDE_DIRS['has'](_0x11abfe[_0x1231ae(0x100)]))continue;_0x19964a(_0x53b101);}else{if(_0x11abfe[_0x1231ae(0xfb)]()){const _0x1d4b5a=a10_0x5f52f2[_0x1231ae(0x102)](_0x3ba496,_0x53b101)[_0x1231ae(0xfa)](a10_0x5f52f2[_0x1231ae(0x10c)])[_0x1231ae(0x115)]('/');_0x40fa4a[_0x1231ae(0x13d)]({'name':_0x384d7f+'/'+_0x1d4b5a,'content':a10_0x4bf6a8[_0x1231ae(0x116)](_0x53b101)});}}}};return _0x19964a(_0x3ba496),_0x40fa4a;}}function formatBytes(_0x3a75d8){const _0xfbbc73=a10_0x31939e;if(_0x3a75d8<0x400)return _0x3a75d8+'\x20B';if(_0x3a75d8<0x400*0x400)return(_0x3a75d8/0x400)['toFixed'](0x1)+_0xfbbc73(0x104);return(_0x3a75d8/(0x400*0x400))['toFixed'](0x1)+_0xfbbc73(0x13a);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a11_0x40ebee=a11_0x23c8;function a11_0x23c8(_0x2eb11f,_0x21597c){_0x2eb11f=_0x2eb11f-0x9a;const _0x21634b=a11_0x2163();let _0x23c8e3=_0x21634b[_0x2eb11f];return _0x23c8e3;}(function(_0x4e27fa,_0x14244b){const _0x1e06a0=a11_0x23c8,_0x4e04d2=_0x4e27fa();while(!![]){try{const _0x36d127=parseInt(_0x1e06a0(0x9f))/0x1*(-parseInt(_0x1e06a0(0xaa))/0x2)+-parseInt(_0x1e06a0(0xbe))/0x3+parseInt(_0x1e06a0(0xb6))/0x4+parseInt(_0x1e06a0(0xb3))/0x5+parseInt(_0x1e06a0(0xab))/0x6+parseInt(_0x1e06a0(0x9e))/0x7*(-parseInt(_0x1e06a0(0xa4))/0x8)+parseInt(_0x1e06a0(0xa7))/0x9;if(_0x36d127===_0x14244b)break;else _0x4e04d2['push'](_0x4e04d2['shift']());}catch(_0x469115){_0x4e04d2['push'](_0x4e04d2['shift']());}}}(a11_0x2163,0x1894f));import{execSync}from'node:child_process';import a11_0x49cfdc from'../lib/extends/command.js';export default class Update extends a11_0x49cfdc{static [a11_0x40ebee(0xb4)]='更新\x20comate-cli\x20到最新版本';static ['enableJsonFlag']=!![];async[a11_0x40ebee(0xa0)](){const _0x45dc59=a11_0x40ebee;await this[_0x45dc59(0x9b)](Update);const {createRequire:_0x517a1f}=await import(_0x45dc59(0xae)),_0x1e7ba9=_0x517a1f(import.meta.url),_0x2faa50=_0x1e7ba9(_0x45dc59(0xb9)),_0x54bf8d=_0x2faa50[_0x45dc59(0xa9)];!this['jsonEnabled']()&&(this[_0x45dc59(0x9a)](_0x45dc59(0xb2)+this[_0x45dc59(0xa3)]('v'+_0x54bf8d,_0x45dc59(0xaf))),await this[_0x45dc59(0xb5)](_0x45dc59(0xb1)));let _0x3aa9f4;try{_0x3aa9f4=execSync(_0x45dc59(0xa5),{'encoding':_0x45dc59(0xb0),'timeout':0x3a98})[_0x45dc59(0xb8)]();}catch{this[_0x45dc59(0xac)](),this[_0x45dc59(0xba)](_0x45dc59(0x9c));}if(_0x3aa9f4===_0x54bf8d)return this[_0x45dc59(0xac)](_0x45dc59(0xa2)+_0x54bf8d),{'previousVersion':_0x54bf8d,'currentVersion':_0x54bf8d,'updated':![]};!this['jsonEnabled']()&&(this['stopLoading'](_0x45dc59(0xbc)+_0x3aa9f4),await this[_0x45dc59(0xb5)](_0x45dc59(0xbd)+_0x54bf8d+_0x45dc59(0x9d)+_0x3aa9f4+_0x45dc59(0xbb)));try{return execSync(_0x45dc59(0xad),{'encoding':_0x45dc59(0xb0),'timeout':0xea60,'stdio':_0x45dc59(0xb7)}),this['stopLoading'](_0x45dc59(0xa1)+_0x54bf8d+_0x45dc59(0x9d)+_0x3aa9f4),{'previousVersion':_0x54bf8d,'currentVersion':_0x3aa9f4,'updated':!![]};}catch(_0x285f45){this[_0x45dc59(0xac)](),this['error'](_0x45dc59(0xa6)+(_0x285f45 instanceof Error?_0x285f45[_0x45dc59(0xa8)]:String(_0x285f45))+'\x0a手动更新:\x20npm\x20install\x20-g\x20@ks-open/comate-cli@latest');}}}function a11_0x2163(){const _0x422fd9=['pipe','trim','../../package.json','error','\x20...','发现新版本:\x20v','正在更新\x20v','511056kXQmhd','log','parse','无法获取最新版本信息,请检查网络连接','\x20→\x20v','14JdJTWi','113XHvDuR','run','更新成功:\x20v','已是最新版本\x20v','colorize','384616PkFDlK','npm\x20view\x20@ks-open/comate-cli\x20version\x20--registry=https://registry.npmjs.org/','更新失败:\x20','1031742WTOmDd','message','version','1546TDAwde','571038qkJcXt','stopLoading','npm\x20install\x20-g\x20@ks-open/comate-cli@latest\x20--registry=https://registry.npmjs.org/','node:module','cyan','utf-8','正在检查最新版本...','当前版本:\x20','981000nrkdOw','description','createLoading','194124BGZybk'];a11_0x2163=function(){return _0x422fd9;};return a11_0x2163();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x4c7919,_0x3315f4){const _0x568359=a12_0x43c5,_0x2f008c=_0x4c7919();while(!![]){try{const _0x2e402b=-parseInt(_0x568359(0xe0))/0x1+parseInt(_0x568359(0xdb))/0x2+-parseInt(_0x568359(0xdd))/0x3*(-parseInt(_0x568359(0xda))/0x4)+-parseInt(_0x568359(0xde))/0x5+parseInt(_0x568359(0xe3))/0x6+-parseInt(_0x568359(0xe4))/0x7+-parseInt(_0x568359(0xdf))/0x8;if(_0x2e402b===_0x3315f4)break;else _0x2f008c['push'](_0x2f008c['shift']());}catch(_0x4cfdad){_0x2f008c['push'](_0x2f008c['shift']());}}}(a12_0x4a7b,0x36651));import{randomUUID}from'node:crypto';import{join}from'node:path';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='.log',hook=async function(){const _0x555030=a12_0x43c5,_0x4e886f=0x3,_0x15bc2a=process[_0x555030(0xdc)][ENV_VERBOSE],_0x18a08d=_0x15bc2a?Math[_0x555030(0xe5)](0x5,Math['max'](0x1,Number[_0x555030(0xd9)](_0x15bc2a,0xa)||_0x4e886f)):_0x4e886f,_0x511cfc=randomUUID(),_0x1822c2=join(homedir(),COMATE_DIR_NAME,'log',''+_0x511cfc+LOG_SUFFIX);NewLoggerWithLevel(_0x18a08d,_0x1822c2);const _0x35fe73=()=>{CleanLogFile();};process['on'](_0x555030(0xe1),_0x35fe73),process['on']('SIGINT',()=>{const _0x1f139f=_0x555030;_0x35fe73(),process[_0x1f139f(0xe1)](0x82);}),process['on'](_0x555030(0xe2),()=>{_0x35fe73(),process['exit'](0x8f);});};function a12_0x43c5(_0x364773,_0x919c7){_0x364773=_0x364773-0xd9;const _0x4a7b2f=a12_0x4a7b();let _0x43c5e5=_0x4a7b2f[_0x364773];return _0x43c5e5;}function a12_0x4a7b(){const _0x283195=['1402818QZmpwF','1522829NZPAgn','min','parseInt','4ndxvfH','305798GNsIJW','env','605580vsHGQV','372050BrrVAS','559880wHRXQy','3819jleVtZ','exit','SIGTERM'];a12_0x4a7b=function(){return _0x283195;};return a12_0x4a7b();}export default hook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x9ef0d1,_0x354fcf){const _0x2b1c28=a13_0xd3ee,_0x4e6e2f=_0x9ef0d1();while(!![]){try{const _0x10d5a5=parseInt(_0x2b1c28(0x1b3))/0x1+parseInt(_0x2b1c28(0x1c1))/0x2*(-parseInt(_0x2b1c28(0x1bb))/0x3)+-parseInt(_0x2b1c28(0x1ba))/0x4*(-parseInt(_0x2b1c28(0x1c6))/0x5)+-parseInt(_0x2b1c28(0x1b4))/0x6*(parseInt(_0x2b1c28(0x1c0))/0x7)+-parseInt(_0x2b1c28(0x1c8))/0x8+parseInt(_0x2b1c28(0x1bd))/0x9*(-parseInt(_0x2b1c28(0x1c2))/0xa)+parseInt(_0x2b1c28(0x1c5))/0xb;if(_0x10d5a5===_0x354fcf)break;else _0x4e6e2f['push'](_0x4e6e2f['shift']());}catch(_0x1c9c24){_0x4e6e2f['push'](_0x4e6e2f['shift']());}}}(a13_0x4e62,0x9cf23));function a13_0xd3ee(_0xb515a2,_0x530697){_0xb515a2=_0xb515a2-0x1b1;const _0x4e62bf=a13_0x4e62();let _0xd3ee1d=_0x4e62bf[_0xb515a2];return _0xd3ee1d;}async function checkForUpdates(_0x31ec5e){const _0x4159ef=a13_0xd3ee;try{const _0xcda354=await fetch(_0x4159ef(0x1b7),{'signal':AbortSignal[_0x4159ef(0x1bc)](0x7d0)});if(!_0xcda354['ok'])return{'hasUpdate':![],'currentVersion':_0x31ec5e,'latestVersion':_0x31ec5e};const _0x3f21ca=await _0xcda354[_0x4159ef(0x1b2)](),_0x360e45=_0x3f21ca['version'];return{'hasUpdate':_0x360e45!==_0x31ec5e,'currentVersion':_0x31ec5e,'latestVersion':_0x360e45};}catch{return{'hasUpdate':![],'currentVersion':_0x31ec5e,'latestVersion':_0x31ec5e};}}const hook=async function(_0xb43de){const _0x423b22=a13_0xd3ee,_0xcbd508=_0xb43de[_0x423b22(0x1b5)][_0x423b22(0x1b8)],_0x19534c={'hasUpdate':![],'currentVersion':_0xcbd508,'latestVersion':_0xcbd508},_0x305af3=await Promise[_0x423b22(0x1b6)]([checkForUpdates(_0xcbd508),new Promise(_0x1584a6=>setTimeout(()=>_0x1584a6(_0x19534c),0x7d0))]);_0x305af3[_0x423b22(0x1be)]&&(this[_0x423b22(0x1b1)](_0x423b22(0x1b9)+_0x305af3[_0x423b22(0x1c7)]+_0x423b22(0x1bf)+_0x305af3[_0x423b22(0x1c3)]),this['log'](_0x423b22(0x1c4)));};export default hook;function a13_0x4e62(){const _0x3aaa95=['\x20→\x20','14uqptoy','62OQFcYs','1460jQLZvA','latestVersion','\x20\x20运行\x20npm\x20install\x20-g\x20@ks-open/comate-cli\x20进行更新\x0a','29567857ZwvWAs','20mAddwa','currentVersion','4935328AWhVlO','log','json','557823whzWYg','1924998UuaOWz','config','race','https://registry.npmjs.org/@ks-open/comate-cli/latest','version','\x0a\x20\x20更新可用:\x20','504148dHkVjC','97803ymLZzF','timeout','51651MqVFla','hasUpdate'];a13_0x4e62=function(){return _0x3aaa95;};return a13_0x4e62();}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0xcc07ac,_0x4a3529){var _0x98d591=a14_0x3ca3,_0x56af6c=_0xcc07ac();while(!![]){try{var _0x32e8b5=-parseInt(_0x98d591(0xd2))/0x1+-parseInt(_0x98d591(0xce))/0x2*(-parseInt(_0x98d591(0xcd))/0x3)+-parseInt(_0x98d591(0xd6))/0x4*(parseInt(_0x98d591(0xcf))/0x5)+parseInt(_0x98d591(0xd3))/0x6+-parseInt(_0x98d591(0xd0))/0x7+parseInt(_0x98d591(0xd4))/0x8*(parseInt(_0x98d591(0xd5))/0x9)+parseInt(_0x98d591(0xd1))/0xa;if(_0x32e8b5===_0x4a3529)break;else _0x56af6c['push'](_0x56af6c['shift']());}catch(_0x2dbfcf){_0x56af6c['push'](_0x56af6c['shift']());}}}(a14_0x83f2,0xd9acd));function a14_0x83f2(){var _0x5b1488=['116cowdky','33582YvnGuk','242wmDgpG','208645qQYirh','1239462fhOPTf','11655870gkkgcO','1076438gNZxqU','2994252ptwfJQ','232QuJzFU','104319UHLPsN'];a14_0x83f2=function(){return _0x5b1488;};return a14_0x83f2();}function a14_0x3ca3(_0x11fe0e,_0x18ef20){_0x11fe0e=_0x11fe0e-0xcd;var _0x83f2a7=a14_0x83f2();var _0x3ca323=_0x83f2a7[_0x11fe0e];return _0x3ca323;}export{run}from'@oclif/core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x33ec69,_0x49ae1){const _0x218f36=a15_0x52f6,_0x187802=_0x33ec69();while(!![]){try{const _0x2f8774=parseInt(_0x218f36(0x1d7))/0x1+-parseInt(_0x218f36(0x1d3))/0x2*(-parseInt(_0x218f36(0x1e9))/0x3)+-parseInt(_0x218f36(0x1d6))/0x4*(-parseInt(_0x218f36(0x1cd))/0x5)+parseInt(_0x218f36(0x1df))/0x6*(-parseInt(_0x218f36(0x1e8))/0x7)+parseInt(_0x218f36(0x1e0))/0x8+parseInt(_0x218f36(0x1d9))/0x9*(-parseInt(_0x218f36(0x1e7))/0xa)+-parseInt(_0x218f36(0x1dd))/0xb*(parseInt(_0x218f36(0x1e4))/0xc);if(_0x2f8774===_0x49ae1)break;else _0x187802['push'](_0x187802['shift']());}catch(_0x4171dc){_0x187802['push'](_0x187802['shift']());}}}(a15_0x5986,0x24ea3));import a15_0x28763f from'node:http';function a15_0x5986(){const _0x10ab3a=['createServer','code','searchParams','登录超时(60\x20秒),请重试','text/html;\x20charset=utf-8','2YaZvUL','get','回调参数不完整,请重试','8NCJtZX','116474Jhlsfn','无法打开浏览器:\x20','198DeoxSD','close','writeHead','url','462PZbFVF','&state=','20886tlVHqr','53328GCHOGv','state','登录状态校验失败,请重试','/?cb=','13116qsZBIq','EADDRINUSE','floor','57430VbJCSY','63qgGNjz','353166zRGCCG','/v7/devhub/users/login_callback','random','end','saveSid','pathname','http://localhost:','/oauth-callback','message','app_id','error','?cb=','284805tTpVNM'];a15_0x5986=function(){return _0x10ab3a;};return a15_0x5986();}import{randomUUID}from'node:crypto';import a15_0x4d0825 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 a15_0x52f6(_0x2238f2,_0x4c8fc9){_0x2238f2=_0x2238f2-0x1ca;const _0x598689=a15_0x5986();let _0x52f624=_0x598689[_0x2238f2];return _0x52f624;}function pickPort(){const _0x543110=a15_0x52f6;return OAUTH_PORT_MIN+Math[_0x543110(0x1e6)](Math[_0x543110(0x1eb)]()*(OAUTH_PORT_MAX-OAUTH_PORT_MIN+0x1));}function buildLoginUrl(_0x45fc11,_0x2b08e7){const _0x2d6138=a15_0x52f6,_0x4186fb=AGENTSPACE_BASE+_0x2d6138(0x1ea)+(_0x2d6138(0x1cc)+encodeURIComponent(_0x2b08e7)+_0x2d6138(0x1de)+_0x45fc11);return WPS_ACCOUNT_BASE+_0x2d6138(0x1e3)+encodeURIComponent(_0x4186fb);}export async function loginWithBrowser(){const _0x519001=a15_0x52f6,_0x2b2e05=pickPort(),_0x255f2f=randomUUID(),_0x3ac795=_0x519001(0x1ef)+_0x2b2e05+_0x519001(0x1f0),_0x2a28d0=await new Promise((_0xf6516a,_0x2e0007)=>{const _0x31b5ef=_0x519001,_0x45389f=setTimeout(()=>{const _0x1ef8f=a15_0x52f6;_0x47e963['close'](),_0x2e0007(new Error(_0x1ef8f(0x1d1)));},OAUTH_TIMEOUT_MS),_0x47e963=a15_0x28763f[_0x31b5ef(0x1ce)]((_0x2d35fc,_0x39e73d)=>{const _0x76b5dc=_0x31b5ef,_0x46efc3=new URL(_0x2d35fc[_0x76b5dc(0x1dc)],'http://localhost:'+_0x2b2e05);if(_0x46efc3[_0x76b5dc(0x1ee)]!==_0x76b5dc(0x1f0)){_0x39e73d[_0x76b5dc(0x1db)](0x194),_0x39e73d[_0x76b5dc(0x1ec)]();return;}const _0x2e0931=_0x46efc3[_0x76b5dc(0x1d0)][_0x76b5dc(0x1d4)](_0x76b5dc(0x1cf)),_0x2736fd=_0x46efc3[_0x76b5dc(0x1d0)][_0x76b5dc(0x1d4)](_0x76b5dc(0x1e1)),_0x3a7c1d=_0x46efc3[_0x76b5dc(0x1d0)]['get'](_0x76b5dc(0x1ca));_0x39e73d[_0x76b5dc(0x1db)](0xc8,{'Content-Type':_0x76b5dc(0x1d2)}),_0x39e73d[_0x76b5dc(0x1ec)]('<html><body><h2>登录成功,请返回终端继续操作</h2><script>setTimeout(()=>window.close(),1000)</script></body></html>'),clearTimeout(_0x45389f),_0x47e963[_0x76b5dc(0x1da)](),!_0x2e0931||!_0x2736fd||!_0x3a7c1d?_0x2e0007(new Error(_0x76b5dc(0x1d5))):_0xf6516a({'code':_0x2e0931,'state':_0x2736fd,'app_id':_0x3a7c1d});});_0x47e963['listen'](_0x2b2e05,'127.0.0.1',async()=>{const _0xa715a=_0x31b5ef;try{const _0x4853d7=buildLoginUrl(_0x255f2f,_0x3ac795);await a15_0x4d0825(_0x4853d7);}catch(_0x11b343){clearTimeout(_0x45389f),_0x47e963[_0xa715a(0x1da)](),_0x2e0007(new Error(_0xa715a(0x1d8)+(_0x11b343 instanceof Error?_0x11b343[_0xa715a(0x1f1)]:String(_0x11b343))));}}),_0x47e963['on'](_0x31b5ef(0x1cb),_0xc4a5d3=>{const _0x5e115f=_0x31b5ef;clearTimeout(_0x45389f),_0xc4a5d3[_0x5e115f(0x1cf)]===_0x5e115f(0x1e5)?_0x2e0007(new Error('端口\x20'+_0x2b2e05+'\x20被占用,请重试')):_0x2e0007(new Error('启动本地服务器失败:\x20'+_0xc4a5d3[_0x5e115f(0x1f1)]));});});if(_0x2a28d0['state']!==_0x255f2f)throw new Error(_0x519001(0x1e2));const _0x19b3eb=await getUserToken(_0x2a28d0[_0x519001(0x1ca)],_0x2a28d0[_0x519001(0x1cf)],_0x2a28d0[_0x519001(0x1e1)]);configManager[_0x519001(0x1ed)](_0x19b3eb);const _0x99c5de=await getCurrentUser();return configManager['saveUserInfo'](_0x99c5de),{'sid':_0x19b3eb,'nickname':_0x99c5de['nickname']};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a16_0x3e30(_0x11f6b3,_0x1660a3){_0x11f6b3=_0x11f6b3-0x1c1;const _0x15fe6e=a16_0x15fe();let _0x3e3092=_0x15fe6e[_0x11f6b3];return _0x3e3092;}const a16_0x11fa59=a16_0x3e30;(function(_0x31444e,_0x5d54ad){const _0x4ff720=a16_0x3e30,_0x4b6502=_0x31444e();while(!![]){try{const _0x5c5de5=-parseInt(_0x4ff720(0x1cd))/0x1*(parseInt(_0x4ff720(0x1d4))/0x2)+parseInt(_0x4ff720(0x1d3))/0x3*(-parseInt(_0x4ff720(0x1cb))/0x4)+parseInt(_0x4ff720(0x1c6))/0x5*(-parseInt(_0x4ff720(0x1cf))/0x6)+-parseInt(_0x4ff720(0x1cc))/0x7+parseInt(_0x4ff720(0x1c2))/0x8+parseInt(_0x4ff720(0x1c8))/0x9+parseInt(_0x4ff720(0x1d2))/0xa*(parseInt(_0x4ff720(0x1c4))/0xb);if(_0x5c5de5===_0x5d54ad)break;else _0x4b6502['push'](_0x4b6502['shift']());}catch(_0x469cbe){_0x4b6502['push'](_0x4b6502['shift']());}}}(a16_0x15fe,0x68e0a));import a16_0x40d893 from'node:path';import{homedir}from'node:os';export const COMATE_DIR_NAME=a16_0x11fa59(0x1c5);export const COMATE_HOME=a16_0x40d893[a16_0x11fa59(0x1c9)](homedir(),COMATE_DIR_NAME);function a16_0x15fe(){const _0x25dd97=['15XKbckU','config.json','1459197DLjUDA','join','COMATE_VERBOSE','24DYFwJH','4613924uFjtIi','12tZYFSu','log','1481574zfezhk','https://365.kdocs.cn/3rd/open','https://agentspace.wps.cn','900TTasLS','300363BMRork','106728LUDwpP','https://open.wps.cn/app-studio','5109984fLzZgB','https://o.wpsgo.com/app-studio/runtime','277409OsuoZS','.comate-cli'];a16_0x15fe=function(){return _0x25dd97;};return a16_0x15fe();}export const CONFIG_FILE=a16_0x40d893[a16_0x11fa59(0x1c9)](COMATE_HOME,a16_0x11fa59(0x1c7));export const LOG_DIR=a16_0x40d893['join'](COMATE_HOME,a16_0x11fa59(0x1ce));export const ENV_VERBOSE=a16_0x11fa59(0x1ca);export const AGENTSPACE_BASE=a16_0x11fa59(0x1d1);export const APP_STUDIO_BASE=a16_0x11fa59(0x1c1);export const WPS_ACCOUNT_BASE='https://account.wps.cn';export const OPEN_PLATFORM_BASE=a16_0x11fa59(0x1d0);export const RUNTIME_BASE=a16_0x11fa59(0x1c3);export const OAUTH_PORT_MIN=0x2e0f;export const OAUTH_PORT_MAX=0x2e22;export const OAUTH_TIMEOUT_MS=0xea60;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a17_0x224cd8=a17_0x2e80;(function(_0x2c5ae6,_0xf9fa49){const _0x31d188=a17_0x2e80,_0x312005=_0x2c5ae6();while(!![]){try{const _0x1c0113=-parseInt(_0x31d188(0x1d6))/0x1*(parseInt(_0x31d188(0x1de))/0x2)+parseInt(_0x31d188(0x1ec))/0x3*(-parseInt(_0x31d188(0x1ea))/0x4)+-parseInt(_0x31d188(0x1e8))/0x5*(-parseInt(_0x31d188(0x1d4))/0x6)+parseInt(_0x31d188(0x1d9))/0x7*(-parseInt(_0x31d188(0x1dc))/0x8)+parseInt(_0x31d188(0x1d0))/0x9+parseInt(_0x31d188(0x1c6))/0xa+-parseInt(_0x31d188(0x1da))/0xb;if(_0x1c0113===_0xf9fa49)break;else _0x312005['push'](_0x312005['shift']());}catch(_0x3a758a){_0x312005['push'](_0x312005['shift']());}}}(a17_0xb6ac,0xa1d50));import a17_0x2dc442 from'node:crypto';import a17_0x542f82 from'node:fs';import{homedir}from'node:os';import a17_0x36cedf from'node:path';import{CONFIG_FILE}from'./constants.js';const PI_CLIENT_AUTH_PATH=a17_0x36cedf[a17_0x224cd8(0x1ce)](homedir(),a17_0x224cd8(0x1ed),a17_0x224cd8(0x1e1),a17_0x224cd8(0x1e0),a17_0x224cd8(0x1ee)),PI_CLIENT_KEY=Buffer[a17_0x224cd8(0x1d2)]('WpsCom@te#2024!Secur3K3y_Agent!!',a17_0x224cd8(0x1d1)),GCM_NONCE_LEN=0xc,GCM_TAG_LEN=0x10;function decryptPiClientToken(_0x4d03cf){const _0x245e8f=a17_0x224cd8,_0x13cbce=Buffer[_0x245e8f(0x1d2)](_0x4d03cf[_0x245e8f(0x1df)](),_0x245e8f(0x1e4));if(_0x13cbce[_0x245e8f(0x1c9)]<=GCM_NONCE_LEN+GCM_TAG_LEN)throw new Error(_0x245e8f(0x1d5));const _0x36d471=_0x13cbce[_0x245e8f(0x1e5)](0x0,GCM_NONCE_LEN),_0x20fb3b=_0x13cbce['subarray'](GCM_NONCE_LEN,_0x13cbce['length']-GCM_TAG_LEN),_0x69918a=_0x13cbce[_0x245e8f(0x1e5)](_0x13cbce[_0x245e8f(0x1c9)]-GCM_TAG_LEN),_0x5c4dca=a17_0x2dc442[_0x245e8f(0x1db)](_0x245e8f(0x1cb),PI_CLIENT_KEY,_0x36d471);return _0x5c4dca[_0x245e8f(0x1e3)](_0x69918a),Buffer[_0x245e8f(0x1d8)]([_0x5c4dca[_0x245e8f(0x1cc)](_0x20fb3b),_0x5c4dca[_0x245e8f(0x1c7)]()])['toString'](_0x245e8f(0x1d1));}function a17_0xb6ac(){const _0x213069=['49282ecqSpS','configPath','concat','85701ieQTmU','8620172hSSWvZ','createDecipheriv','8diYZca','wps_sid','12rMATQZ','trim','auth','agent','token','setAuthTag','base64','subarray','parse','readFileSync','46220yirAhC','string','4uxmrAT','save','943443wDgypJ','.wpscomate','user_auth.json','1754650oKvQbQ','final','clear','length','saveUserInfo','aes-256-gcm','update','mkdirSync','join','load','7224075CHIaqF','utf-8','from','env','708BYANfV','invalid\x20ciphertext'];a17_0xb6ac=function(){return _0x213069;};return a17_0xb6ac();}function a17_0x2e80(_0x4fe2f2,_0x3bf42b){_0x4fe2f2=_0x4fe2f2-0x1c6;const _0xb6ac8=a17_0xb6ac();let _0x2e80e5=_0xb6ac8[_0x4fe2f2];return _0x2e80e5;}function loadPiClientSid(){const _0x5bf376=a17_0x224cd8;try{const _0x11e5cc=a17_0x542f82[_0x5bf376(0x1e7)](PI_CLIENT_AUTH_PATH,_0x5bf376(0x1d1)),_0x38076b=JSON[_0x5bf376(0x1e6)](_0x11e5cc[_0x5bf376(0x1df)]());if(typeof _0x38076b[_0x5bf376(0x1e2)]==='string'&&_0x38076b['token'])return decryptPiClientToken(_0x38076b[_0x5bf376(0x1e2)]);if(typeof _0x38076b['wps_sid']===_0x5bf376(0x1e9)&&_0x38076b['wps_sid'])return _0x38076b[_0x5bf376(0x1dd)];}catch{}return null;}export class ConfigManager{[a17_0x224cd8(0x1d7)];constructor(_0x47b93b){const _0x2cc1c8=a17_0x224cd8;this[_0x2cc1c8(0x1d7)]=_0x47b93b??CONFIG_FILE;}[a17_0x224cd8(0x1cf)](){const _0x4e4d9c=a17_0x224cd8;let _0x266474=null,_0x372ae5=null;try{const _0x5171cb=a17_0x542f82[_0x4e4d9c(0x1e7)](this[_0x4e4d9c(0x1d7)],_0x4e4d9c(0x1d1)),_0x540a61=JSON[_0x4e4d9c(0x1e6)](_0x5171cb);_0x372ae5=_0x540a61[_0x4e4d9c(0x1dd)]??null,_0x266474=_0x540a61['user_info']??null;}catch{}const _0x55bdf4=loadPiClientSid()??process[_0x4e4d9c(0x1d3)]['WPS_SID']?.['trim']()??_0x372ae5;return{'wps_sid':_0x55bdf4||null,'user_info':_0x266474};}['save'](_0x4f4901){const _0x4f858f=a17_0x224cd8,_0x22e784=a17_0x36cedf['dirname'](this['configPath']);a17_0x542f82[_0x4f858f(0x1cd)](_0x22e784,{'recursive':!![]}),a17_0x542f82['writeFileSync'](this[_0x4f858f(0x1d7)],JSON['stringify'](_0x4f4901,null,0x2),_0x4f858f(0x1d1));}['saveSid'](_0x5880a1){const _0x5cb783=a17_0x224cd8,_0x437030=this[_0x5cb783(0x1cf)]();_0x437030[_0x5cb783(0x1dd)]=_0x5880a1,this['save'](_0x437030);}[a17_0x224cd8(0x1ca)](_0x315da0){const _0xf76d1=a17_0x224cd8,_0x1c1ad6=this[_0xf76d1(0x1cf)]();_0x1c1ad6['user_info']=_0x315da0,this[_0xf76d1(0x1eb)](_0x1c1ad6);}[a17_0x224cd8(0x1c8)](){this['save']({'wps_sid':null,'user_info':null});}}export const configManager=new ConfigManager();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a18_0x2b61(_0x306836,_0x3cf3b8){_0x306836=_0x306836-0x11e;const _0x398188=a18_0x3981();let _0x2b6140=_0x398188[_0x306836];return _0x2b6140;}const a18_0x570735=a18_0x2b61;(function(_0x252aa1,_0x10b619){const _0x3f901b=a18_0x2b61,_0x86c95a=_0x252aa1();while(!![]){try{const _0x1c6778=-parseInt(_0x3f901b(0x12c))/0x1+-parseInt(_0x3f901b(0x12f))/0x2+-parseInt(_0x3f901b(0x122))/0x3*(-parseInt(_0x3f901b(0x11e))/0x4)+-parseInt(_0x3f901b(0x12a))/0x5+parseInt(_0x3f901b(0x123))/0x6+parseInt(_0x3f901b(0x137))/0x7*(-parseInt(_0x3f901b(0x133))/0x8)+parseInt(_0x3f901b(0x12d))/0x9*(parseInt(_0x3f901b(0x126))/0xa);if(_0x1c6778===_0x10b619)break;else _0x86c95a['push'](_0x86c95a['shift']());}catch(_0x14715d){_0x86c95a['push'](_0x86c95a['shift']());}}}(a18_0x3981,0x96775));import{Command}from'@oclif/core';import a18_0x399939 from'chalk';import{configManager}from'../config/manager.js';import{FileOnly}from'../log/logger.js';function a18_0x3981(){const _0x46e158=['stopLoading','1196157nPmpIw','7965NxxbXX','stop','1622824zropwX','wps_sid','string','log','8KytErC','stringify','start','spinner','4735857BnAmPg','error','jsonEnabled','finally','logJson','4BmtPCX','requireAuth','_actionActive','createLoading','3662619QzTzjD','1518570OcDyTd','default','exit','21990PLMhnm','load','未登录,请先执行\x20comate-cli\x20login','ora','598270zlDzku'];a18_0x3981=function(){return _0x46e158;};return a18_0x3981();}export default class BaseCommand extends Command{['spinner'];[a18_0x570735(0x120)]=![];['colorize'](_0x33a23b,_0x4e78af){return a18_0x399939[_0x4e78af](_0x33a23b);}async[a18_0x570735(0x121)](_0x5aaf78){const _0x1d246c=a18_0x570735,_0x4f9f2e=await import(_0x1d246c(0x129));this[_0x1d246c(0x136)]=_0x4f9f2e[_0x1d246c(0x124)]({'text':_0x5aaf78})[_0x1d246c(0x135)](),this[_0x1d246c(0x120)]=!![];}[a18_0x570735(0x12b)](_0x2897dc){const _0x2937ab=a18_0x570735;if(!this[_0x2937ab(0x136)])return;if(_0x2897dc)this[_0x2937ab(0x136)]['succeed'](_0x2897dc);else this['spinner'][_0x2937ab(0x12e)]();this[_0x2937ab(0x136)]=undefined,this[_0x2937ab(0x120)]=![];}async[a18_0x570735(0x11f)](){const _0x4f0824=a18_0x570735,_0x567a58=configManager[_0x4f0824(0x127)]();return!_0x567a58[_0x4f0824(0x130)]&&(this[_0x4f0824(0x139)]()&&(this[_0x4f0824(0x13b)]({'status':_0x4f0824(0x138),'message':_0x4f0824(0x128),'code':'AUTH_REQUIRED'}),this[_0x4f0824(0x125)](0x2)),this[_0x4f0824(0x138)](_0x4f0824(0x128))),{'sid':_0x567a58[_0x4f0824(0x130)]};}[a18_0x570735(0x132)](_0x17eb18,..._0x538885){const _0x58743c=a18_0x570735,_0x47f9e3=[_0x17eb18,..._0x538885]['map'](_0x8bb5c1=>typeof _0x8bb5c1===_0x58743c(0x131)?_0x8bb5c1:JSON[_0x58743c(0x134)](_0x8bb5c1))['join']('\x20');FileOnly(_0x47f9e3);if(this[_0x58743c(0x120)])this[_0x58743c(0x12b)]();super[_0x58743c(0x132)](_0x17eb18,..._0x538885);}async[a18_0x570735(0x13a)](_0x584741){const _0x58cb49=a18_0x570735;return this[_0x58cb49(0x12b)](),super[_0x58cb49(0x13a)](_0x584741);}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x28d983,_0x4f904e){const _0x5898a2=a19_0x1655,_0x53fed4=_0x28d983();while(!![]){try{const _0x1979d8=-parseInt(_0x5898a2(0x14f))/0x1*(-parseInt(_0x5898a2(0x158))/0x2)+-parseInt(_0x5898a2(0x14e))/0x3+-parseInt(_0x5898a2(0x14a))/0x4*(-parseInt(_0x5898a2(0x153))/0x5)+-parseInt(_0x5898a2(0x15a))/0x6*(parseInt(_0x5898a2(0x152))/0x7)+-parseInt(_0x5898a2(0x151))/0x8+-parseInt(_0x5898a2(0x15c))/0x9*(-parseInt(_0x5898a2(0x159))/0xa)+-parseInt(_0x5898a2(0x14c))/0xb*(parseInt(_0x5898a2(0x15b))/0xc);if(_0x1979d8===_0x4f904e)break;else _0x53fed4['push'](_0x53fed4['shift']());}catch(_0x46a35b){_0x53fed4['push'](_0x53fed4['shift']());}}}(a19_0x2928,0x1cbb9));import a19_0x10d166 from'node:crypto';function a19_0x1655(_0x36d840,_0x4e481a){_0x36d840=_0x36d840-0x149;const _0x2928c3=a19_0x2928();let _0x16559a=_0x2928c3[_0x36d840];return _0x16559a;}import{configManager}from'../config/manager.js';function generateCsrf(){const _0x2d0f65=a19_0x1655;return a19_0x10d166[_0x2d0f65(0x155)](0x10)[_0x2d0f65(0x154)](_0x2d0f65(0x14d));}function a19_0x2928(){const _0x4667b1=[';csrf=','Cookie','2eQMjQj','70jzlSYe','48MKsaWu','36JKXShC','267210rFITQs','wps_sid','96fDoNJJ','application/json','925683aJBGFz','hex','137661qXcOhG','166822lmlwYZ','wps_sid=','419848iLRPsw','51261tyZhpE','31760AaFqLd','toString','randomBytes'];a19_0x2928=function(){return _0x4667b1;};return a19_0x2928();}export function buildAuthHeaders(){const _0x85a70e=a19_0x1655,_0x22c085=configManager['load'](),_0x1f749e=generateCsrf(),_0x4cd183={'Content-Type':_0x85a70e(0x14b),'X-CSRFToken':_0x1f749e};return _0x22c085[_0x85a70e(0x149)]&&(_0x4cd183[_0x85a70e(0x157)]=_0x85a70e(0x150)+_0x22c085['wps_sid']+_0x85a70e(0x156)+_0x1f749e),_0x4cd183;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a20_0x33b940=a20_0x23f3;(function(_0xcad464,_0x305cb1){const _0x5647d5=a20_0x23f3,_0x3ad826=_0xcad464();while(!![]){try{const _0x2f91d8=-parseInt(_0x5647d5(0xe8))/0x1*(parseInt(_0x5647d5(0xfa))/0x2)+parseInt(_0x5647d5(0xea))/0x3*(parseInt(_0x5647d5(0xef))/0x4)+-parseInt(_0x5647d5(0xeb))/0x5*(-parseInt(_0x5647d5(0xf0))/0x6)+-parseInt(_0x5647d5(0xf7))/0x7*(-parseInt(_0x5647d5(0xe1))/0x8)+parseInt(_0x5647d5(0xf5))/0x9+parseInt(_0x5647d5(0xe3))/0xa+-parseInt(_0x5647d5(0xfb))/0xb;if(_0x2f91d8===_0x305cb1)break;else _0x3ad826['push'](_0x3ad826['shift']());}catch(_0x36167e){_0x3ad826['push'](_0x3ad826['shift']());}}}(a20_0xfe09,0xc002d));import a20_0x105df2 from'axios';import{configManager}from'../config/manager.js';import{AGENTSPACE_BASE}from'../config/constants.js';import{buildAuthHeaders}from'./auth-headers.js';function a20_0xfe09(){const _0x1fcaaf=['baseUrl','10147030EynNAb','message','):\x20','ECONNABORTED','get','65531rnmUzY','网络错误:\x20','1077BdZeCb','6403265ikfhdy','ECONNREFUSED','登录已过期,请重新执行\x20comate-cli\x20login','data','8872KrerRy','6bMVWtx','config','clear','msg','getClient','13592439ahXRzE','wrapError','11613ENpvix','ENOTFOUND','post','38IkIfRd','32051096BczSQw','code','url','response','initialize','无法连接到服务器,请检查网络','axiosInstance','1656WrwOWc'];a20_0xfe09=function(){return _0x1fcaaf;};return a20_0xfe09();}function a20_0x23f3(_0x475a98,_0x4e3eca){_0x475a98=_0x475a98-0xdb;const _0xfe092f=a20_0xfe09();let _0x23f341=_0xfe092f[_0x475a98];return _0x23f341;}export class SimpleHttpClient{[a20_0x33b940(0xe0)]=null;[a20_0x33b940(0xe2)];constructor(_0x1761e5){const _0x42389a=a20_0x33b940;this[_0x42389a(0xe2)]=_0x1761e5??AGENTSPACE_BASE;}[a20_0x33b940(0xde)](){const _0x2a7f89=a20_0x33b940;this['axiosInstance']=a20_0x105df2['create']({'baseURL':this[_0x2a7f89(0xe2)],'headers':buildAuthHeaders(),'timeout':0x7530});}[a20_0x33b940(0xf4)](){const _0x23348c=a20_0x33b940;if(!this[_0x23348c(0xe0)])this[_0x23348c(0xde)]();return this[_0x23348c(0xe0)];}async['get'](_0x2731b2){const _0x6ce491=a20_0x33b940;try{const _0x5a0ef3=await this[_0x6ce491(0xf4)]()[_0x6ce491(0xe7)](_0x2731b2);return _0x5a0ef3[_0x6ce491(0xee)];}catch(_0x2e088e){throw this[_0x6ce491(0xf6)](_0x2e088e);}}async[a20_0x33b940(0xf9)](_0x98f25,_0x283298){const _0x4c27c2=a20_0x33b940;try{const _0x3a6d96=await this['getClient']()[_0x4c27c2(0xf9)](_0x98f25,_0x283298);return _0x3a6d96[_0x4c27c2(0xee)];}catch(_0x4d3308){throw this['wrapError'](_0x4d3308);}}[a20_0x33b940(0xf6)](_0x2d1bbf){const _0xaefb56=a20_0x33b940;if(_0x2d1bbf['response']){const _0x5b605b=_0x2d1bbf[_0xaefb56(0xdd)]['status'],_0x13899f=_0x2d1bbf[_0xaefb56(0xf1)]?.[_0xaefb56(0xdc)]??_0x2d1bbf[_0xaefb56(0xf1)]?.['baseURL']??'';if(_0x5b605b===0x191)return configManager[_0xaefb56(0xf2)](),new Error(_0xaefb56(0xed));const _0x499ba4=_0x2d1bbf[_0xaefb56(0xdd)]['data'],_0x28b799=_0x499ba4?.[_0xaefb56(0xf3)]??_0x499ba4?.[_0xaefb56(0xe4)]??'';return new Error('请求失败\x20('+_0x5b605b+_0xaefb56(0xe5)+(_0x28b799||_0x2d1bbf[_0xaefb56(0xe4)])+'\x20['+_0x13899f+']');}if(_0x2d1bbf[_0xaefb56(0xdb)]===_0xaefb56(0xec))return new Error(_0xaefb56(0xdf));if(_0x2d1bbf['code']===_0xaefb56(0xf8))return new Error('DNS\x20解析失败,请检查网络连接');if(_0x2d1bbf[_0xaefb56(0xdb)]===_0xaefb56(0xe6))return new Error('请求超时,请稍后重试');return new Error(_0xaefb56(0xe9)+_0x2d1bbf['message']);}}export const httpClient=new SimpleHttpClient();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a21_0x2d5e(_0x21ef1d,_0x5423d5){_0x21ef1d=_0x21ef1d-0xe6;const _0x4f0ca0=a21_0x4f0c();let _0x2d5e3f=_0x4f0ca0[_0x21ef1d];return _0x2d5e3f;}function a21_0x4f0c(){const _0x58cf67=['appendFileSync','5977405qSlPWE','dirname','max','88oasStP','[comate-cli]\x20Log\x20started\x20at\x20','7131573WfRYdI','18084iOdtrU','5028bxrwID','7025892GuFCMA','38814NeOAlN','354804DXRXGP','54ULEUZe','4nGgpAg','toISOString','env','join','465073qoBuay','write','min','10gdSMyZ'];a21_0x4f0c=function(){return _0x58cf67;};return a21_0x4f0c();}(function(_0x1006f2,_0x5a0de3){const _0x4a1f36=a21_0x2d5e,_0x1016eb=_0x1006f2();while(!![]){try{const _0x36dcd9=-parseInt(_0x4a1f36(0xea))/0x1+-parseInt(_0x4a1f36(0xeb))/0x2*(-parseInt(_0x4a1f36(0xe9))/0x3)+-parseInt(_0x4a1f36(0xec))/0x4*(-parseInt(_0x4a1f36(0xf5))/0x5)+-parseInt(_0x4a1f36(0xe8))/0x6+-parseInt(_0x4a1f36(0xf0))/0x7*(-parseInt(_0x4a1f36(0xf8))/0x8)+-parseInt(_0x4a1f36(0xfa))/0x9*(parseInt(_0x4a1f36(0xf3))/0xa)+-parseInt(_0x4a1f36(0xe6))/0xb*(-parseInt(_0x4a1f36(0xe7))/0xc);if(_0x36dcd9===_0x5a0de3)break;else _0x1016eb['push'](_0x1016eb['shift']());}catch(_0x4f175e){_0x1016eb['push'](_0x1016eb['shift']());}}}(a21_0x4f0c,0x9dc91));import a21_0x38026f from'node:fs';import a21_0x318b11 from'node:path';import{LOG_DIR,ENV_VERBOSE}from'../config/constants.js';import{randomUUID}from'node:crypto';let logFilePath=null,logLevel=0x3;const LOG_SUFFIX='.log';export function NewLoggerWithLevel(_0x571d40,_0x5b8552){const _0x427638=a21_0x2d5e;logLevel=_0x571d40,logFilePath=_0x5b8552;const _0x1234fe=a21_0x318b11[_0x427638(0xf6)](_0x5b8552);a21_0x38026f['mkdirSync'](_0x1234fe,{'recursive':!![]}),a21_0x38026f['writeFileSync'](_0x5b8552,_0x427638(0xf9)+new Date()['toISOString']()+'\x0a','utf-8');}let hasLogWriteFailed=![];export function FileOnly(_0x5c6640){const _0x4a44ca=a21_0x2d5e;if(!logFilePath)return;try{a21_0x38026f[_0x4a44ca(0xf4)](logFilePath,new Date()[_0x4a44ca(0xed)]()+'\x20'+_0x5c6640+'\x0a','utf-8');}catch(_0x5b8367){!hasLogWriteFailed&&(hasLogWriteFailed=!![],process['stderr'][_0x4a44ca(0xf1)]('[comate-cli]\x20log\x20write\x20failed:\x20'+(_0x5b8367 instanceof Error?_0x5b8367['message']:String(_0x5b8367))+'\x0a'));}}export function CleanLogFile(){logFilePath=null;}export function initLogger(){const _0x36d32c=a21_0x2d5e,_0x27fea9=0x3,_0x6ddd56=process[_0x36d32c(0xee)][ENV_VERBOSE],_0x408677=_0x6ddd56?Math[_0x36d32c(0xf2)](0x5,Math[_0x36d32c(0xf7)](0x1,Number['parseInt'](_0x6ddd56,0xa)||_0x27fea9)):_0x27fea9,_0xcb564e=randomUUID(),_0xb15ff1=a21_0x318b11[_0x36d32c(0xef)](LOG_DIR,''+_0xcb564e+LOG_SUFFIX);return NewLoggerWithLevel(_0x408677,_0xb15ff1),_0xb15ff1;}export function getLogLevel(){return logLevel;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3cb18f,_0x5034c0){const _0x2fa40a=a22_0x4bda,_0x531564=_0x3cb18f();while(!![]){try{const _0xaf500f=parseInt(_0x2fa40a(0x1c1))/0x1+parseInt(_0x2fa40a(0x1c2))/0x2+-parseInt(_0x2fa40a(0x1cc))/0x3+parseInt(_0x2fa40a(0x1be))/0x4+parseInt(_0x2fa40a(0x1c9))/0x5+-parseInt(_0x2fa40a(0x1c7))/0x6*(parseInt(_0x2fa40a(0x1c5))/0x7)+-parseInt(_0x2fa40a(0x1ce))/0x8;if(_0xaf500f===_0x5034c0)break;else _0x531564['push'](_0x531564['shift']());}catch(_0x47097c){_0x531564['push'](_0x531564['shift']());}}}(a22_0xe977,0x2302c));import{httpClient}from'../http/client.js';import{AGENTSPACE_BASE}from'../config/constants.js';import a22_0x3dc399 from'axios';export async function getUserToken(_0x247157,_0x27b9a0,_0x54fb2f){const _0x58692e=a22_0x4bda,_0x15605b=await a22_0x3dc399['post'](AGENTSPACE_BASE+_0x58692e(0x1c8),{'app_id':_0x247157,'code':_0x27b9a0,'state':_0x54fb2f});if(_0x15605b[_0x58692e(0x1cd)][_0x58692e(0x1c4)]!==0x0||!_0x15605b[_0x58692e(0x1cd)]['data']?.[_0x58692e(0x1c6)])throw new Error(_0x15605b[_0x58692e(0x1cd)][_0x58692e(0x1cb)]||'获取登录凭证失败');return _0x15605b['data'][_0x58692e(0x1cd)][_0x58692e(0x1c6)];}function a22_0x4bda(_0x32cb9b,_0x1110c7){_0x32cb9b=_0x32cb9b-0x1be;const _0xe9777e=a22_0xe977();let _0x4bdabf=_0xe9777e[_0x32cb9b];return _0x4bdabf;}export async function getCurrentUser(){const _0x3e4c20=a22_0x4bda;httpClient[_0x3e4c20(0x1c0)]();const _0x5d3bfa=await httpClient[_0x3e4c20(0x1bf)](_0x3e4c20(0x1ca));if(_0x5d3bfa[_0x3e4c20(0x1c4)]!==0x0)throw new Error(_0x5d3bfa[_0x3e4c20(0x1cb)]||_0x3e4c20(0x1c3));return _0x5d3bfa[_0x3e4c20(0x1cd)];}function a22_0xe977(){const _0x593e62=['/v7/devhub/users/current','msg','645897ZgkTUn','data','2030912eZcpYl','1038572gdtTiu','get','initialize','57346baKhWs','528662hzglnO','获取用户信息失败','code','21VUJozQ','token','125838bEIXnB','/v7/devhub/users/user_token','470830pUqEXg'];a22_0xe977=function(){return _0x593e62;};return a22_0xe977();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a23_0x642951=a23_0x2c2d;(function(_0x38b0fc,_0x18b131){const _0x4ad1e9=a23_0x2c2d,_0x1d4d16=_0x38b0fc();while(!![]){try{const _0x3102f2=parseInt(_0x4ad1e9(0x19a))/0x1*(parseInt(_0x4ad1e9(0x18d))/0x2)+parseInt(_0x4ad1e9(0x1a9))/0x3+parseInt(_0x4ad1e9(0x185))/0x4+-parseInt(_0x4ad1e9(0x197))/0x5+parseInt(_0x4ad1e9(0x190))/0x6+parseInt(_0x4ad1e9(0x198))/0x7+-parseInt(_0x4ad1e9(0x18f))/0x8*(parseInt(_0x4ad1e9(0x193))/0x9);if(_0x3102f2===_0x18b131)break;else _0x1d4d16['push'](_0x1d4d16['shift']());}catch(_0x11a89c){_0x1d4d16['push'](_0x1d4d16['shift']());}}}(a23_0x32fa,0x9050b));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['env'][a23_0x642951(0x184)]??APP_STUDIO_BASE;function getHeaders(){return buildAuthHeaders();}async function assertOk(_0xd0274c,_0x1f27a4){const _0x4dd642=a23_0x642951;if(!_0xd0274c['ok']){const _0x25c090=await _0xd0274c[_0x4dd642(0x1a2)]()[_0x4dd642(0x1a5)](()=>'');if(_0xd0274c[_0x4dd642(0x19f)]===0x191){configManager[_0x4dd642(0x194)]();throw new Error(_0x4dd642(0x196));}if(_0xd0274c[_0x4dd642(0x19f)]===0x193){let _0x247823=_0x25c090;try{_0x247823=JSON[_0x4dd642(0x1a7)](_0x25c090)['error']??_0x25c090;}catch{}throw new Error(_0x4dd642(0x1af)+_0x247823);}throw new Error(_0x1f27a4+_0x4dd642(0x1b1)+_0xd0274c[_0x4dd642(0x19f)]+'):\x20'+_0x25c090);}}function a23_0x32fa(){const _0xb8fcde=['7066878RqHJOq','/api/v3/threads','get','23146956GjvzDy','clear','/files/upload','登录已过期,请重新执行\x20comate-cli\x20auth\x20login','1902940OIDJXL','4184355stEfzG','/runs/stream','955697nmkNMF','body','text/event-stream','append','application/octet-stream','status','上传文件','app-builder','text','获取会话状态','Content-Type','catch','octet-stream','parse','stringify','32958weOBqZ','name','content','GET','timeout','恢复中断','权限不足\x20(403):\x20','json','\x20失败\x20(','length','headers','COMATE_CLOUD_API_BASE','3205304GuOlPC','includes','/state','/api/v3/runs/active','isBuffer','threadId','/api/v3/threads/','POST','2nKUSCf','提交消息','8JtgfBt'];a23_0x32fa=function(){return _0xb8fcde;};return a23_0x32fa();}export async function createThread(_0x21a6d2=a23_0x642951(0x1a1)){const _0x458d34=a23_0x642951,_0x50f4d0=await fetch(CLOUD_API_BASE+_0x458d34(0x191),{'method':_0x458d34(0x18c),'headers':getHeaders(),'body':JSON[_0x458d34(0x1a8)]({'agent_id':_0x21a6d2})});return await assertOk(_0x50f4d0,'创建会话'),_0x50f4d0['json']();}export async function submitRun(_0x5b8472){const _0x1f2c6d=a23_0x642951,{threadId:_0x317683,messages:_0x59c99e,assistantId:_0x1091ba}=_0x5b8472,_0x12da88={'input':{'messages':_0x59c99e},'stream_mode':['updates']};if(_0x1091ba)_0x12da88['assistant_id']=_0x1091ba;const _0x45f79d=await fetch(CLOUD_API_BASE+_0x1f2c6d(0x18b)+_0x317683+_0x1f2c6d(0x199),{'method':_0x1f2c6d(0x18c),'headers':{...getHeaders(),'Accept':_0x1f2c6d(0x19c)},'body':JSON['stringify'](_0x12da88)});await assertOk(_0x45f79d,_0x1f2c6d(0x18e));if(_0x45f79d[_0x1f2c6d(0x19b)]){const _0x5207b9=_0x45f79d[_0x1f2c6d(0x19b)]['getReader']();_0x5207b9['cancel']()['catch'](()=>{});}return{'thread_id':_0x317683};}export async function resumeRun(_0x1a9496){const _0x22e5ad=a23_0x642951,{threadId:_0x4e60d5,resumeValue:_0x5d7cf3,assistantId:_0x38b661}=_0x1a9496,_0x26072f={'command':{'resume':_0x5d7cf3},'stream_mode':['updates']};if(_0x38b661)_0x26072f['assistant_id']=_0x38b661;const _0x1d0dbf=await fetch(CLOUD_API_BASE+_0x22e5ad(0x18b)+_0x4e60d5+_0x22e5ad(0x199),{'method':_0x22e5ad(0x18c),'headers':{...getHeaders(),'Accept':'text/event-stream'},'body':JSON[_0x22e5ad(0x1a8)](_0x26072f)});await assertOk(_0x1d0dbf,_0x22e5ad(0x1ae));if(_0x1d0dbf[_0x22e5ad(0x19b)]){const _0x303750=_0x1d0dbf['body']['getReader']();_0x303750['cancel']()[_0x22e5ad(0x1a5)](()=>{});}return{'thread_id':_0x4e60d5};}function a23_0x2c2d(_0xb8ccea,_0x10686b){_0xb8ccea=_0xb8ccea-0x184;const _0x32fa05=a23_0x32fa();let _0x2c2d05=_0x32fa05[_0xb8ccea];return _0x2c2d05;}export async function isThreadRunning(_0x1152d1){const _0x3fa9b2=a23_0x642951;try{const _0x4c2c0a=await fetch(CLOUD_API_BASE+_0x3fa9b2(0x188),{'method':_0x3fa9b2(0x1ac),'headers':getHeaders(),'signal':AbortSignal[_0x3fa9b2(0x1ad)](0x1388)});if(!_0x4c2c0a['ok'])return![];const _0xfe14cd=await _0x4c2c0a['json']();return _0xfe14cd['activeRuns']?.['some'](_0x3d52e5=>_0x3d52e5[_0x3fa9b2(0x18a)]===_0x1152d1)??![];}catch{return![];}}export async function getThreadState(_0x5095e2){const _0xd3396e=a23_0x642951,_0x500fca=await fetch(CLOUD_API_BASE+_0xd3396e(0x18b)+_0x5095e2+_0xd3396e(0x187),{'method':_0xd3396e(0x1ac),'headers':getHeaders(),'signal':AbortSignal[_0xd3396e(0x1ad)](0x3a98)});return await assertOk(_0x500fca,_0xd3396e(0x1a3)),_0x500fca[_0xd3396e(0x1b0)]();}export async function downloadFiles(_0x32d64d,_0x1c0d27){const _0x36bf2f=a23_0x642951,_0x5c7af2=await fetch(CLOUD_API_BASE+_0x36bf2f(0x18b)+_0x32d64d+'/files/download',{'method':_0x36bf2f(0x18c),'headers':getHeaders(),'body':JSON[_0x36bf2f(0x1a8)]({'paths':_0x1c0d27})});await assertOk(_0x5c7af2,'下载文件');if(_0x1c0d27[_0x36bf2f(0x1b2)]===0x1){const _0x539db3=_0x5c7af2[_0x36bf2f(0x1b3)][_0x36bf2f(0x192)]('content-type')??'';if(_0x539db3[_0x36bf2f(0x186)](_0x36bf2f(0x1a6))){const _0x5dc7b5=await _0x5c7af2[_0x36bf2f(0x1a2)]();return[{'path':_0x1c0d27[0x0],'content':_0x5dc7b5,'error':null}];}}const _0x82f242=await _0x5c7af2['json']();return _0x82f242['results']??[];}export async function uploadFiles(_0x16697e,_0x5b7460){const _0x3fe431=a23_0x642951,_0x21bce=new FormData();for(const _0x3f3b1a of _0x5b7460){const _0x546058=Buffer[_0x3fe431(0x189)](_0x3f3b1a[_0x3fe431(0x1ab)])?new Uint8Array(_0x3f3b1a[_0x3fe431(0x1ab)]):_0x3f3b1a['content'],_0x114ed9=new Blob([_0x546058],{'type':_0x3fe431(0x19e)});_0x21bce[_0x3fe431(0x19d)](_0x3f3b1a[_0x3fe431(0x1aa)],_0x114ed9,_0x3f3b1a[_0x3fe431(0x1aa)]);}const _0x182937=getHeaders();delete _0x182937[_0x3fe431(0x1a4)];const _0xe79fb8=await fetch(CLOUD_API_BASE+_0x3fe431(0x18b)+_0x16697e+_0x3fe431(0x195),{'method':_0x3fe431(0x18c),'headers':_0x182937,'body':_0x21bce});return await assertOk(_0xe79fb8,_0x3fe431(0x1a0)),_0xe79fb8[_0x3fe431(0x1b0)]();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a24_0x80c5e5=a24_0x15ee;(function(_0x2f4820,_0x418ec0){const _0x5a98e3=a24_0x15ee,_0x5c8845=_0x2f4820();while(!![]){try{const _0x31e191=parseInt(_0x5a98e3(0xb9))/0x1+-parseInt(_0x5a98e3(0x83))/0x2*(parseInt(_0x5a98e3(0xcc))/0x3)+parseInt(_0x5a98e3(0xcd))/0x4+-parseInt(_0x5a98e3(0x8a))/0x5+parseInt(_0x5a98e3(0x96))/0x6*(-parseInt(_0x5a98e3(0x8e))/0x7)+-parseInt(_0x5a98e3(0xd3))/0x8*(parseInt(_0x5a98e3(0x86))/0x9)+parseInt(_0x5a98e3(0x99))/0xa*(parseInt(_0x5a98e3(0x98))/0xb);if(_0x31e191===_0x418ec0)break;else _0x5c8845['push'](_0x5c8845['shift']());}catch(_0x4def81){_0x5c8845['push'](_0x5c8845['shift']());}}}(a24_0x19d7,0x193f2));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';function a24_0x15ee(_0x12f1fe,_0x4266b9){_0x12f1fe=_0x12f1fe-0x82;const _0x19d79c=a24_0x19d7();let _0x15ee61=_0x19d79c[_0x12f1fe];return _0x15ee61;}const CLOUD_API_BASE=process[a24_0x80c5e5(0x87)][a24_0x80c5e5(0xac)]??APP_STUDIO_BASE;function log(_0xba33e1){const _0x512b29=a24_0x80c5e5;FileOnly(_0x512b29(0xe1)+_0xba33e1);}function getHeaders(){return buildAuthHeaders();}function a24_0x19d7(){const _0x5c6daa=[',\x20starting\x20runtime\x20poll...','match','building','parse','32adLQLN','\x20logs=','/api/v2/threads/','build\x20phase\x20changed:\x20','build_building','message','length','\x20polls','buildCommand','none','部署失败','totalZipSize','部署失败:\x20','触发部署...','[publish]\x20','部署成功:\x20','\x20body=','runFullPublish\x20start:\x20threadId=','84178OFijky','installing','deploy_status','335826sPecfb','env','GET','查询构建状态','695080oAojxy','publishing','/publish/status','access_url','343105soopWU','deploy\x20FAILED:\x20','totalFileCount','提交构建','触发部署失败:\x20','text','threadId','\x20error=','24JkjUHI','构建任务已提交','4753815XKKymh','10bYxtYO','build\x20FAILED:\x20','status','\x20(poll\x20#','pending','versionId','...)','deploy\x20TIMEOUT\x20after\x20','build_publishing','clear','\x20access_url=','\x20message=','build_installing','build_pending','deploy\x20SUCCESS:\x20','phase','FAILED:\x20no\x20deployment\x20ID\x20extracted','\x20失败\x20(','\x20error:\x20','COMATE_CLOUD_API_BASE','\x20→\x20','stringify','active','构建状态解析失败:\x20','deploying','\x20HTTP\x20','\x20polls,\x20last\x20phase:\x20','\x20timeout=','部署中\x20(','skipBuild',':\x20status=','build\x20TIMEOUT\x20after\x20','145868cpOwDW','build\x20reached\x20terminal\x20phase:\x20','json','publishVersion\x20FAILED:\x20','projectId','slice','failed','deployed','POST','登录已过期,请重新执行\x20comate-cli\x20auth\x20login','logs','result','build_done','published','\x20\x20result:\x20files=','now','deployment\x20ID\x20extracted:\x20','deploy\x20poll\x20#','未知错误','9ikHNPk','543904eLLuFZ','error'];a24_0x19d7=function(){return _0x5c6daa;};return a24_0x19d7();}async function assertOk(_0x62e96,_0x53d17f){const _0x490811=a24_0x80c5e5;if(!_0x62e96['ok']){const _0x563b83=await _0x62e96[_0x490811(0x93)]()['catch'](()=>'');log(_0x53d17f+_0x490811(0xb2)+_0x62e96[_0x490811(0x9b)]+':\x20'+_0x563b83['slice'](0x0,0x1f4));if(_0x62e96[_0x490811(0x9b)]===0x191){configManager[_0x490811(0xa2)]();throw new Error(_0x490811(0xc2));}throw new Error(_0x53d17f+_0x490811(0xaa)+_0x62e96['status']+'):\x20'+_0x563b83);}}export async function submitBuild(_0x470df2){const _0x28b21c=a24_0x80c5e5,{threadId:_0x37dc62,projectId:_0x16b50d,versionId:_0x4c983a,buildCommand:_0x294c6e,skipBuild:_0x1c8673}=_0x470df2,_0x4d48b6={'projectId':_0x16b50d,'versionId':_0x4c983a};if(_0x294c6e)_0x4d48b6[_0x28b21c(0xdb)]=_0x294c6e;if(_0x1c8673)_0x4d48b6['skipBuild']=!![];const _0x4aa708=CLOUD_API_BASE+_0x28b21c(0xd5)+_0x37dc62+'/publish';log('submitBuild\x20POST\x20'+_0x4aa708+_0x28b21c(0xe3)+JSON[_0x28b21c(0xae)](_0x4d48b6));const _0x1241e6=await fetch(_0x4aa708,{'method':_0x28b21c(0xc1),'headers':getHeaders(),'body':JSON[_0x28b21c(0xae)](_0x4d48b6)});await assertOk(_0x1241e6,_0x28b21c(0x91));const _0x359741=await _0x1241e6[_0x28b21c(0xbb)](),_0x12c922=_0x359741['data']??_0x359741;return log('submitBuild\x20response:\x20phase='+_0x12c922[_0x28b21c(0xa8)]+_0x28b21c(0xa4)+_0x12c922[_0x28b21c(0xd8)]),_0x12c922;}export async function getBuildStatus(_0x32ba2e){const _0x2b3e6e=a24_0x80c5e5,_0x5bc420=CLOUD_API_BASE+_0x2b3e6e(0xd5)+_0x32ba2e+_0x2b3e6e(0x8c),_0x504f17=await fetch(_0x5bc420,{'method':_0x2b3e6e(0x88),'headers':getHeaders()});await assertOk(_0x504f17,_0x2b3e6e(0x89));const _0x5a95ee=await _0x504f17[_0x2b3e6e(0x93)]();let _0x54abdc;try{_0x54abdc=JSON[_0x2b3e6e(0xd2)](_0x5a95ee);}catch{log('getBuildStatus\x20parse\x20error,\x20raw='+_0x5a95ee[_0x2b3e6e(0xbe)](0x0,0x1f4));throw new Error(_0x2b3e6e(0xb0)+_0x5a95ee[_0x2b3e6e(0xbe)](0x0,0xc8));}const _0x3315e2=_0x54abdc['data']??_0x54abdc;return log('getBuildStatus:\x20phase='+_0x3315e2[_0x2b3e6e(0xa8)]+_0x2b3e6e(0xa4)+_0x3315e2[_0x2b3e6e(0xd8)]+_0x2b3e6e(0xd4)+(_0x3315e2[_0x2b3e6e(0xc3)]?.[_0x2b3e6e(0xd9)]??0x0)+'\x20hasResult='+!!_0x3315e2[_0x2b3e6e(0xc4)]),_0x3315e2[_0x2b3e6e(0xc4)]&&log(_0x2b3e6e(0xc7)+_0x3315e2[_0x2b3e6e(0xc4)][_0x2b3e6e(0x90)]+'\x20zip='+_0x3315e2[_0x2b3e6e(0xc4)][_0x2b3e6e(0xde)]),_0x3315e2;}const BUILD_TERMINAL=new Set([a24_0x80c5e5(0xc6),a24_0x80c5e5(0xce)]),POLL_INTERVAL=0xbb8;export async function runFullPublish(_0x30805d,_0x3a22c4,_0x34ac2e=0x927c0){const _0x451362=a24_0x80c5e5,_0x3d11a9=Date[_0x451362(0xc8)]()+_0x34ac2e;log(_0x451362(0x82)+_0x30805d[_0x451362(0x94)]+'\x20projectId='+_0x30805d['projectId']+'\x20versionId='+_0x30805d['versionId']+'\x20skipBuild='+_0x30805d[_0x451362(0xb6)]+_0x451362(0xb4)+_0x34ac2e+'ms'),await submitBuild(_0x30805d),_0x3a22c4?.({'step':_0x451362(0xa6),'message':_0x451362(0x97)});let _0x4c6b9d,_0x455441=null,_0x702a97=0x0;while(Date[_0x451362(0xc8)]()<_0x3d11a9){const _0x161ad6=await getBuildStatus(_0x30805d[_0x451362(0x94)]);_0x4c6b9d=_0x161ad6,_0x702a97++;if(_0x161ad6['phase']!==_0x455441){log(_0x451362(0xd6)+_0x455441+_0x451362(0xad)+_0x161ad6[_0x451362(0xa8)]+_0x451362(0x9c)+_0x702a97+')'),_0x455441=_0x161ad6[_0x451362(0xa8)];const _0x364f82=mapBuildPhase(_0x161ad6['phase']);_0x3a22c4?.({'step':_0x364f82,'message':_0x161ad6[_0x451362(0xd8)]});}if(_0x161ad6[_0x451362(0xa8)]===_0x451362(0xce))return log(_0x451362(0x9a)+_0x161ad6[_0x451362(0xd8)]),_0x161ad6['logs']?.[_0x451362(0xd9)]&&log('build\x20logs\x20(last\x2010):\x0a'+_0x161ad6[_0x451362(0xc3)][_0x451362(0xbe)](-0xa)['join']('\x0a')),{'status':'failed','deploy_error':'构建失败:\x20'+_0x161ad6[_0x451362(0xd8)],'build_result':_0x161ad6['result'],'build_logs':_0x161ad6['logs']};if(BUILD_TERMINAL['has'](_0x161ad6[_0x451362(0xa8)])){log(_0x451362(0xba)+_0x161ad6['phase']+'\x20after\x20'+_0x702a97+_0x451362(0xda));break;}await sleep(POLL_INTERVAL);}if(!_0x4c6b9d||!BUILD_TERMINAL['has'](_0x4c6b9d['phase']))return log(_0x451362(0xb8)+_0x702a97+_0x451362(0xb3)+_0x4c6b9d?.[_0x451362(0xa8)]),{'status':_0x451362(0xbf),'deploy_error':'构建超时','build_logs':_0x4c6b9d?.[_0x451362(0xc3)]};_0x3a22c4?.({'step':_0x451362(0xb1),'message':_0x451362(0xe0)});let _0x22702c;try{const _0x430d73=await publishVersion(_0x30805d[_0x451362(0xbd)],_0x30805d[_0x451362(0x9e)]);log('publishVersion:\x20deploy_status='+_0x430d73[_0x451362(0x85)]+_0x451362(0xa3)+_0x430d73[_0x451362(0x8d)]),_0x22702c=extractDeploymentId(_0x430d73[_0x451362(0x8d)]);}catch(_0x313df1){const _0x41a2e0=_0x313df1 instanceof Error?_0x313df1[_0x451362(0xd8)]:String(_0x313df1);return log(_0x451362(0xbc)+_0x41a2e0),{'status':'failed','deploy_error':_0x451362(0x92)+_0x41a2e0,'build_result':_0x4c6b9d?.[_0x451362(0xc4)],'build_logs':_0x4c6b9d?.[_0x451362(0xc3)]};}if(!_0x22702c)return log(_0x451362(0xa9)),{'status':'failed','deploy_error':'未获取到\x20deployment\x20ID','build_result':_0x4c6b9d?.[_0x451362(0xc4)],'build_logs':_0x4c6b9d?.[_0x451362(0xc3)]};log(_0x451362(0xc9)+_0x22702c+_0x451362(0xcf)),_0x3a22c4?.({'step':_0x451362(0xb1),'message':_0x451362(0xb5)+_0x22702c[_0x451362(0xbe)](0x0,0x8)+_0x451362(0x9f)});let _0x2e0a82=0x0;while(Date[_0x451362(0xc8)]()<_0x3d11a9){await sleep(POLL_INTERVAL),_0x2e0a82++;let _0x36d16a;try{_0x36d16a=await getDeploymentStatus(_0x22702c),log(_0x451362(0xca)+_0x2e0a82+_0x451362(0xb7)+_0x36d16a[_0x451362(0x9b)]+_0x451362(0x95)+(_0x36d16a[_0x451362(0xce)]??_0x451362(0xdc)));}catch(_0x1ab64b){log(_0x451362(0xca)+_0x2e0a82+_0x451362(0xab)+(_0x1ab64b instanceof Error?_0x1ab64b[_0x451362(0xd8)]:String(_0x1ab64b)));continue;}if(_0x36d16a[_0x451362(0x9b)]===_0x451362(0xaf)){const _0x4e61b4=RUNTIME_BASE+'/'+_0x22702c+'/';return log(_0x451362(0xa7)+_0x4e61b4),_0x3a22c4?.({'step':_0x451362(0xc0),'message':_0x451362(0xe2)+_0x4e61b4}),{'status':_0x451362(0xc0),'access_url':_0x4e61b4,'build_result':_0x4c6b9d?.['result']};}if(_0x36d16a[_0x451362(0x9b)]===_0x451362(0xbf))return log(_0x451362(0x8f)+(_0x36d16a[_0x451362(0xce)]??_0x451362(0xcb))),_0x3a22c4?.({'step':_0x451362(0xbf),'message':_0x451362(0xdf)+(_0x36d16a[_0x451362(0xce)]??_0x451362(0xcb))}),{'status':'failed','deploy_error':_0x36d16a[_0x451362(0xce)]??_0x451362(0xdd),'build_result':_0x4c6b9d?.[_0x451362(0xc4)],'build_logs':_0x4c6b9d?.[_0x451362(0xc3)]};}return log(_0x451362(0xa0)+_0x2e0a82+_0x451362(0xda)),{'status':_0x451362(0xbf),'deploy_error':'部署超时','build_result':_0x4c6b9d?.[_0x451362(0xc4)],'build_logs':_0x4c6b9d?.[_0x451362(0xc3)]};}function mapBuildPhase(_0x6c816){const _0xf4ce83=a24_0x80c5e5;switch(_0x6c816){case _0xf4ce83(0x9d):return'build_pending';case _0xf4ce83(0x84):return _0xf4ce83(0xa5);case _0xf4ce83(0xd1):return _0xf4ce83(0xd7);case _0xf4ce83(0x8b):return _0xf4ce83(0xa1);case _0xf4ce83(0xc6):return _0xf4ce83(0xc5);case _0xf4ce83(0xce):return _0xf4ce83(0xbf);}}function extractDeploymentId(_0x4cf3){const _0x10bc3e=a24_0x80c5e5,_0x256133=_0x4cf3[_0x10bc3e(0xd0)](/\/([0-9a-f-]{36})\/?/);return _0x256133?.[0x1];}function sleep(_0xd4920a){return new Promise(_0x42fd4b=>setTimeout(_0x42fd4b,_0xd4920a));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a25_0x567af2=a25_0x1364;(function(_0x55cd50,_0x547c18){const _0x2784d4=a25_0x1364,_0x10fd3a=_0x55cd50();while(!![]){try{const _0x4e986a=parseInt(_0x2784d4(0x8a))/0x1*(parseInt(_0x2784d4(0x8e))/0x2)+-parseInt(_0x2784d4(0x87))/0x3+-parseInt(_0x2784d4(0xa4))/0x4+-parseInt(_0x2784d4(0x8f))/0x5+parseInt(_0x2784d4(0x9b))/0x6+-parseInt(_0x2784d4(0x9f))/0x7*(-parseInt(_0x2784d4(0x93))/0x8)+parseInt(_0x2784d4(0x84))/0x9*(parseInt(_0x2784d4(0x91))/0xa);if(_0x4e986a===_0x547c18)break;else _0x10fd3a['push'](_0x10fd3a['shift']());}catch(_0x425285){_0x10fd3a['push'](_0x10fd3a['shift']());}}}(a25_0x4ff1,0xb65c1));import{SimpleHttpClient}from'../http/client.js';import{APP_STUDIO_BASE}from'../config/constants.js';const manageClient=new SimpleHttpClient(APP_STUDIO_BASE),MANAGE_PREFIX=a25_0x567af2(0x88);export async function getMyTeams(){const _0x17ffe2=a25_0x567af2;manageClient[_0x17ffe2(0xa3)]();const _0x3b4565=await manageClient['get'](MANAGE_PREFIX+_0x17ffe2(0x8d));if(Array[_0x17ffe2(0x82)](_0x3b4565[_0x17ffe2(0x98)]?.[_0x17ffe2(0x97)]))return _0x3b4565[_0x17ffe2(0x98)]['items'];const _0x524fd2=_0x3b4565;return _0x524fd2[_0x17ffe2(0x97)]??[];}export async function createTeam(_0x8e6461){const _0x1f5a8e=a25_0x567af2;manageClient[_0x1f5a8e(0xa3)]();const _0x4f52d4=await manageClient[_0x1f5a8e(0xa2)](MANAGE_PREFIX+_0x1f5a8e(0x8c),{'team_name':_0x8e6461});return unwrap(_0x4f52d4);}export async function upsertProjectThread(_0x153e7b,_0x322ecb){const _0x11183f=a25_0x567af2;manageClient[_0x11183f(0xa3)]();const _0x10ae10=await manageClient[_0x11183f(0xa2)](MANAGE_PREFIX+_0x11183f(0x9a)+_0x153e7b+_0x11183f(0x96),{'thread_id':_0x322ecb});return unwrap(_0x10ae10);}export async function getProjectThread(_0x5cdb4d){const _0x259152=a25_0x567af2;manageClient[_0x259152(0xa3)]();const _0x30624b=await manageClient[_0x259152(0x95)](MANAGE_PREFIX+_0x259152(0x9a)+_0x5cdb4d+_0x259152(0x96));return unwrap(_0x30624b);}function unwrap(_0x20a80b){const _0x37b754=a25_0x567af2;if(_0x20a80b[_0x37b754(0x98)]!==undefined&&_0x20a80b[_0x37b754(0x98)]!==null)return _0x20a80b[_0x37b754(0x98)];if(typeof _0x20a80b==='object'&&!(_0x37b754(0x94)in _0x20a80b&&_0x37b754(0x99)in _0x20a80b))return _0x20a80b;throw new Error(_0x37b754(0x90)+_0x20a80b[_0x37b754(0x94)]+',\x20msg:\x20'+_0x20a80b['msg']+')');}function unwrapList(_0x116b50){const _0x35b9cb=a25_0x567af2;return _0x116b50[_0x35b9cb(0x98)]?.[_0x35b9cb(0x97)]??[];}export async function createProject(_0x1545dd){const _0x14fd3d=a25_0x567af2;manageClient[_0x14fd3d(0xa3)]();const _0x513901=await manageClient[_0x14fd3d(0xa2)](MANAGE_PREFIX+'/projects',{'team_id':_0x1545dd[_0x14fd3d(0x9d)],'project_name':_0x1545dd[_0x14fd3d(0x9c)],'description':_0x1545dd[_0x14fd3d(0x92)]??''});return unwrap(_0x513901);}export async function listProjects(_0x4381e6){const _0x139dd4=a25_0x567af2;manageClient[_0x139dd4(0xa3)]();const _0x56ade6=await manageClient['get'](MANAGE_PREFIX+_0x139dd4(0x85)+_0x4381e6+_0x139dd4(0xa1));return unwrapList(_0x56ade6);}export async function getProjectVersions(_0x253a95){const _0x42a179=a25_0x567af2;manageClient[_0x42a179(0xa3)]();const _0x4bcbf8=await manageClient['get'](MANAGE_PREFIX+'/projects/'+_0x253a95+_0x42a179(0x9e));return unwrapList(_0x4bcbf8);}export async function createVersion(_0x4898a2,_0x4a85fd){const _0x1c0f13=a25_0x567af2;manageClient[_0x1c0f13(0xa3)]();const _0x398294=await manageClient[_0x1c0f13(0xa2)](MANAGE_PREFIX+_0x1c0f13(0x9a)+_0x4898a2+_0x1c0f13(0x9e),{'version_number':_0x4a85fd,'description':_0x4a85fd+_0x1c0f13(0x86)});return unwrap(_0x398294);}export async function publishVersion(_0x406564,_0xfb9942){const _0x28a9b2=a25_0x567af2;manageClient[_0x28a9b2(0xa3)]();const _0x17ba48=await manageClient[_0x28a9b2(0xa2)](MANAGE_PREFIX+'/projects/'+_0x406564+_0x28a9b2(0x89)+_0xfb9942+'/publish');return unwrap(_0x17ba48);}function a25_0x4ff1(){const _0xd5f1d6=['get','/thread','items','data','msg','/projects/','6099888YRYQQz','projectName','teamId','/versions','406238yYURnI','/api/runtime/v1/deployments/','&page=1&page_size=100','post','initialize','3808384fDkTMw','isArray','/apps','387kphSjG','/projects?team_id=','\x20version','1500123QSmnxU','/api/manage/v1','/versions/','2391mJNiAB','/scopes/update','/teams','/teams/my','292bhrkHK','826185ogOSYq','API\x20返回数据为空\x20(code:\x20','83770jagaTc','description','88uNqeiZ','code'];a25_0x4ff1=function(){return _0xd5f1d6;};return a25_0x4ff1();}function a25_0x1364(_0x2ae570,_0x508a99){_0x2ae570=_0x2ae570-0x82;const _0x4ff1b0=a25_0x4ff1();let _0x136488=_0x4ff1b0[_0x2ae570];return _0x136488;}export async function getDeploymentStatus(_0x4c089f){const _0x3a2112=a25_0x567af2;manageClient['initialize']();const _0x3676a0=await manageClient[_0x3a2112(0x95)](_0x3a2112(0xa0)+_0x4c089f);return unwrap(_0x3676a0);}export async function bindAppToProject(_0x1a72a9,_0x5ef68d,_0x6b2e6d){const _0xac54d5=a25_0x567af2;manageClient[_0xac54d5(0xa3)]();const _0x43ec83=await manageClient['post'](MANAGE_PREFIX+'/projects/'+_0x1a72a9+_0xac54d5(0x83),{'open_app_id':_0x5ef68d,'open_ssid':_0x6b2e6d});return unwrap(_0x43ec83);}export async function updateProjectAppScopes(_0x307f25,_0x195082,_0x14ca9c){const _0x4f549e=a25_0x567af2;manageClient[_0x4f549e(0xa3)]();const _0x442745=await manageClient[_0x4f549e(0xa2)](MANAGE_PREFIX+_0x4f549e(0x9a)+_0x307f25+'/apps/'+_0x195082+_0x4f549e(0x8b),{'scopes':_0x14ca9c});return unwrap(_0x442745);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x25f4f8,_0x33aaa7){const _0x311487=a26_0x5ca7,_0x41239e=_0x25f4f8();while(!![]){try{const _0x583b3a=parseInt(_0x311487(0x1ac))/0x1*(-parseInt(_0x311487(0x1a4))/0x2)+-parseInt(_0x311487(0x19c))/0x3*(-parseInt(_0x311487(0x1a3))/0x4)+parseInt(_0x311487(0x1b4))/0x5*(parseInt(_0x311487(0x1a7))/0x6)+-parseInt(_0x311487(0x1b5))/0x7*(parseInt(_0x311487(0x194))/0x8)+parseInt(_0x311487(0x19d))/0x9+-parseInt(_0x311487(0x19b))/0xa+parseInt(_0x311487(0x195))/0xb;if(_0x583b3a===_0x33aaa7)break;else _0x41239e['push'](_0x41239e['shift']());}catch(_0x1293f3){_0x41239e['push'](_0x41239e['shift']());}}}(a26_0x4c1e,0x8e152));import{getThreadState}from'./cloud-agent.js';import{getBuildStatus}from'./cloud-publish.js';import{getProjectVersions}from'./manage.js';function a26_0x5ca7(_0x42623a,_0xc18e20){_0x42623a=_0x42623a-0x192;const _0x4c1e5f=a26_0x4c1e();let _0x5ca7ee=_0x4c1e5f[_0x42623a];return _0x5ca7ee;}function extractDescription(_0x20768c){const _0x563cf4=a26_0x5ca7;if(typeof _0x20768c===_0x563cf4(0x1b8))return _0x20768c;if(!_0x20768c||typeof _0x20768c!==_0x563cf4(0x19a))return null;const _0x203ddb=_0x20768c;return _0x203ddb[_0x563cf4(0x196)]??_0x203ddb['message']??_0x203ddb[_0x563cf4(0x1a9)]??null;}function extractInterrupt(_0x334cde){const _0x4fd3ca=a26_0x5ca7;for(const _0x5ec5e0 of _0x334cde){const _0x5afb58=_0x5ec5e0,_0xd3303=_0x5afb58[_0x4fd3ca(0x1ae)];if(_0xd3303?.[_0x4fd3ca(0x197)]){const _0x39e0fd=_0xd3303[0x0],_0x3fc3b6=_0x39e0fd[_0x4fd3ca(0x1b2)];return{'waiting':!![],'description':extractDescription(_0x3fc3b6),'value':_0x3fc3b6};}}return{'waiting':![]};}function settled(_0x143dcb){const _0x3d2271=a26_0x5ca7;return _0x143dcb[_0x3d2271(0x199)]===_0x3d2271(0x1a0)?_0x143dcb['value']:null;}function buildAgentBlock(_0x5c28d5){const _0x3da48c=a26_0x5ca7;if(!_0x5c28d5)return{'messages_count':0x0,'file_count':0x0,'has_todos':![],'tasks_count':0x0};const _0x77cc51=_0x5c28d5[_0x3da48c(0x1b0)]?.[_0x3da48c(0x1aa)],_0x1331f1=_0x5c28d5[_0x3da48c(0x1b0)]?.[_0x3da48c(0x192)],_0x577025=_0x5c28d5[_0x3da48c(0x1b0)]?.[_0x3da48c(0x1af)];let _0x59517a=0x0;return _0x1331f1&&typeof _0x1331f1===_0x3da48c(0x19a)&&(_0x59517a=Object[_0x3da48c(0x1b9)](_0x1331f1)[_0x3da48c(0x197)]),{'messages_count':Array['isArray'](_0x77cc51)?_0x77cc51[_0x3da48c(0x197)]:0x0,'file_count':_0x59517a,'has_todos':Array[_0x3da48c(0x1a2)](_0x577025)?_0x577025[_0x3da48c(0x197)]>0x0:![],'tasks_count':Array[_0x3da48c(0x1a2)](_0x5c28d5[_0x3da48c(0x19e)])?_0x5c28d5[_0x3da48c(0x19e)][_0x3da48c(0x197)]:0x0};}function buildBuildBlock(_0x5d0ca9){const _0x23d70f=a26_0x5ca7;if(!_0x5d0ca9)return{'phase':_0x23d70f(0x1a8),'message':''};return{'phase':_0x5d0ca9['phase'],'message':_0x5d0ca9[_0x23d70f(0x193)]};}function buildDeployBlock(_0x5d9536){const _0x197e61=a26_0x5ca7;if(!_0x5d9536)return{'status':'none','access_url':null};const _0x17a766=_0x5d9536[_0x197e61(0x1ad)]?.[_0x197e61(0x1ab)];if(!_0x17a766)return{'status':_0x197e61(0x1a8),'access_url':null};const _0x19984d={'deployed':_0x197e61(0x1b7),'deploying':_0x197e61(0x19f),'failed':_0x197e61(0x1b3)};return{'status':_0x19984d[_0x17a766[_0x197e61(0x1a6)]??'']??_0x197e61(0x1a8),'access_url':_0x17a766[_0x197e61(0x1a5)]||null};}function buildProjectBlock(_0x32eaf4,_0x4d83ed){const _0x20cffe=a26_0x5ca7;if(!_0x4d83ed)return{'id':_0x32eaf4,'name':null,'versions_count':0x0,'latest_version':null};const _0x140351=[..._0x4d83ed][_0x20cffe(0x198)]((_0x59354b,_0x334913)=>_0x334913[_0x20cffe(0x1b6)]-_0x59354b[_0x20cffe(0x1b6)]);return{'id':_0x32eaf4,'name':null,'versions_count':_0x4d83ed[_0x20cffe(0x197)],'latest_version':_0x140351[0x0]?.[_0x20cffe(0x1a1)]??null};}export async function getProjectContext(_0xf0ae9,_0x14dbab){const _0x3aed98=a26_0x5ca7,[_0x30f8f8,_0x5b962f,_0x134a75]=await Promise[_0x3aed98(0x1b1)]([getThreadState(_0xf0ae9),getBuildStatus(_0xf0ae9),_0x14dbab?getProjectVersions(_0x14dbab):Promise['resolve'](null)]),_0x144d4e=settled(_0x30f8f8),_0x22caf1=settled(_0x5b962f),_0x178f04=settled(_0x134a75),_0x1920d7=buildDeployBlock(_0x22caf1),_0x2138b0=buildAgentBlock(_0x144d4e),_0x1bef35=_0x144d4e?(_0x144d4e['next']?.[_0x3aed98(0x197)]??0x0)>0x0:![];return{'thread_id':_0xf0ae9,'agent':{..._0x2138b0,'running':_0x1bef35},'interrupt':extractInterrupt(_0x144d4e?.[_0x3aed98(0x19e)]??[]),'build':buildBuildBlock(_0x22caf1),'deploy':_0x1920d7,'project':_0x14dbab!=null?buildProjectBlock(_0x14dbab,_0x178f04):null,'urls':{'runtime':_0x1920d7[_0x3aed98(0x1a5)]}};}function a26_0x4c1e(){const _0x324a06=['description','length','sort','status','object','3383290EPyQoe','519JfXCbm','651699TkEAVv','tasks','deploying','fulfilled','version_number','isArray','7208oWYTrm','112rtLlIS','access_url','deploy_status','6bHUFvB','none','type','messages','publishResponse','17893EeEwdw','result','interrupts','todos','values','allSettled','value','failed','3000135bpWhxY','21dklLOY','created_at','deployed','string','keys','files','message','535416RqLdli','12527944QrDqeU'];a26_0x4c1e=function(){return _0x324a06;};return a26_0x4c1e();}
|
|
@@ -0,0 +1,642 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"update": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "更新 comate-cli 到最新版本",
|
|
7
|
+
"flags": {
|
|
8
|
+
"json": {
|
|
9
|
+
"description": "Format output as json.",
|
|
10
|
+
"helpGroup": "GLOBAL",
|
|
11
|
+
"name": "json",
|
|
12
|
+
"allowNo": false,
|
|
13
|
+
"type": "boolean"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"hasDynamicHelp": false,
|
|
17
|
+
"hiddenAliases": [],
|
|
18
|
+
"id": "update",
|
|
19
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
20
|
+
"pluginName": "@ks-open/comate-cli",
|
|
21
|
+
"pluginType": "core",
|
|
22
|
+
"strict": true,
|
|
23
|
+
"enableJsonFlag": true,
|
|
24
|
+
"isESM": true,
|
|
25
|
+
"relativePath": [
|
|
26
|
+
"dist",
|
|
27
|
+
"commands",
|
|
28
|
+
"update.js"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"auth:login": {
|
|
32
|
+
"aliases": [
|
|
33
|
+
"login"
|
|
34
|
+
],
|
|
35
|
+
"args": {},
|
|
36
|
+
"description": "登录 WPS 账号",
|
|
37
|
+
"flags": {
|
|
38
|
+
"json": {
|
|
39
|
+
"description": "Format output as json.",
|
|
40
|
+
"helpGroup": "GLOBAL",
|
|
41
|
+
"name": "json",
|
|
42
|
+
"allowNo": false,
|
|
43
|
+
"type": "boolean"
|
|
44
|
+
},
|
|
45
|
+
"force": {
|
|
46
|
+
"char": "f",
|
|
47
|
+
"description": "强制重新登录(即使当前已登录)",
|
|
48
|
+
"name": "force",
|
|
49
|
+
"allowNo": false,
|
|
50
|
+
"type": "boolean"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"hasDynamicHelp": false,
|
|
54
|
+
"hiddenAliases": [],
|
|
55
|
+
"id": "auth:login",
|
|
56
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
57
|
+
"pluginName": "@ks-open/comate-cli",
|
|
58
|
+
"pluginType": "core",
|
|
59
|
+
"strict": true,
|
|
60
|
+
"enableJsonFlag": true,
|
|
61
|
+
"isESM": true,
|
|
62
|
+
"relativePath": [
|
|
63
|
+
"dist",
|
|
64
|
+
"commands",
|
|
65
|
+
"auth",
|
|
66
|
+
"login.js"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"auth:logout": {
|
|
70
|
+
"aliases": [
|
|
71
|
+
"logout"
|
|
72
|
+
],
|
|
73
|
+
"args": {},
|
|
74
|
+
"description": "登出当前 WPS 账号",
|
|
75
|
+
"flags": {
|
|
76
|
+
"json": {
|
|
77
|
+
"description": "Format output as json.",
|
|
78
|
+
"helpGroup": "GLOBAL",
|
|
79
|
+
"name": "json",
|
|
80
|
+
"allowNo": false,
|
|
81
|
+
"type": "boolean"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"hasDynamicHelp": false,
|
|
85
|
+
"hiddenAliases": [],
|
|
86
|
+
"id": "auth:logout",
|
|
87
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
88
|
+
"pluginName": "@ks-open/comate-cli",
|
|
89
|
+
"pluginType": "core",
|
|
90
|
+
"strict": true,
|
|
91
|
+
"enableJsonFlag": true,
|
|
92
|
+
"isESM": true,
|
|
93
|
+
"relativePath": [
|
|
94
|
+
"dist",
|
|
95
|
+
"commands",
|
|
96
|
+
"auth",
|
|
97
|
+
"logout.js"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"auth:status": {
|
|
101
|
+
"aliases": [
|
|
102
|
+
"whoami"
|
|
103
|
+
],
|
|
104
|
+
"args": {},
|
|
105
|
+
"description": "显示当前登录用户信息",
|
|
106
|
+
"flags": {
|
|
107
|
+
"json": {
|
|
108
|
+
"description": "Format output as json.",
|
|
109
|
+
"helpGroup": "GLOBAL",
|
|
110
|
+
"name": "json",
|
|
111
|
+
"allowNo": false,
|
|
112
|
+
"type": "boolean"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"hasDynamicHelp": false,
|
|
116
|
+
"hiddenAliases": [],
|
|
117
|
+
"id": "auth:status",
|
|
118
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
119
|
+
"pluginName": "@ks-open/comate-cli",
|
|
120
|
+
"pluginType": "core",
|
|
121
|
+
"strict": true,
|
|
122
|
+
"enableJsonFlag": true,
|
|
123
|
+
"isESM": true,
|
|
124
|
+
"relativePath": [
|
|
125
|
+
"dist",
|
|
126
|
+
"commands",
|
|
127
|
+
"auth",
|
|
128
|
+
"status.js"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"code:create": {
|
|
132
|
+
"aliases": [],
|
|
133
|
+
"args": {},
|
|
134
|
+
"description": "创建云端 Agent 会话(自动关联 team → project → thread)",
|
|
135
|
+
"examples": [
|
|
136
|
+
"<%= config.bin %> code create --project-name my-app --json",
|
|
137
|
+
"<%= config.bin %> code create --project-id 206 --json",
|
|
138
|
+
"<%= config.bin %> code create --project-name my-app --team-id 1 --json"
|
|
139
|
+
],
|
|
140
|
+
"flags": {
|
|
141
|
+
"json": {
|
|
142
|
+
"description": "Format output as json.",
|
|
143
|
+
"helpGroup": "GLOBAL",
|
|
144
|
+
"name": "json",
|
|
145
|
+
"allowNo": false,
|
|
146
|
+
"type": "boolean"
|
|
147
|
+
},
|
|
148
|
+
"project-name": {
|
|
149
|
+
"description": "项目名称(新建或复用同名项目)",
|
|
150
|
+
"name": "project-name",
|
|
151
|
+
"hasDynamicHelp": false,
|
|
152
|
+
"multiple": false,
|
|
153
|
+
"type": "option"
|
|
154
|
+
},
|
|
155
|
+
"project-id": {
|
|
156
|
+
"description": "复用已有项目 ID(跳过项目创建)",
|
|
157
|
+
"name": "project-id",
|
|
158
|
+
"hasDynamicHelp": false,
|
|
159
|
+
"multiple": false,
|
|
160
|
+
"type": "option"
|
|
161
|
+
},
|
|
162
|
+
"team-id": {
|
|
163
|
+
"description": "团队 ID(多团队时必填)",
|
|
164
|
+
"name": "team-id",
|
|
165
|
+
"hasDynamicHelp": false,
|
|
166
|
+
"multiple": false,
|
|
167
|
+
"type": "option"
|
|
168
|
+
},
|
|
169
|
+
"agent-id": {
|
|
170
|
+
"description": "云端 Agent ID",
|
|
171
|
+
"name": "agent-id",
|
|
172
|
+
"default": "app-buddy",
|
|
173
|
+
"hasDynamicHelp": false,
|
|
174
|
+
"multiple": false,
|
|
175
|
+
"type": "option"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"hasDynamicHelp": false,
|
|
179
|
+
"hiddenAliases": [],
|
|
180
|
+
"id": "code:create",
|
|
181
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
182
|
+
"pluginName": "@ks-open/comate-cli",
|
|
183
|
+
"pluginType": "core",
|
|
184
|
+
"strict": true,
|
|
185
|
+
"enableJsonFlag": true,
|
|
186
|
+
"isESM": true,
|
|
187
|
+
"relativePath": [
|
|
188
|
+
"dist",
|
|
189
|
+
"commands",
|
|
190
|
+
"code",
|
|
191
|
+
"create.js"
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"code:deploy": {
|
|
195
|
+
"aliases": [],
|
|
196
|
+
"args": {},
|
|
197
|
+
"description": "一键部署本地 HTML 文件到云端(上传 → 生成配置 → 发布)",
|
|
198
|
+
"examples": [
|
|
199
|
+
"<%= config.bin %> code deploy --file ./page.html --json",
|
|
200
|
+
"<%= config.bin %> code deploy --file ./index.html --project-name my-site --json",
|
|
201
|
+
"<%= config.bin %> code deploy --file ./page.html --thread-id thread_xxx --project-id 206 --json"
|
|
202
|
+
],
|
|
203
|
+
"flags": {
|
|
204
|
+
"json": {
|
|
205
|
+
"description": "Format output as json.",
|
|
206
|
+
"helpGroup": "GLOBAL",
|
|
207
|
+
"name": "json",
|
|
208
|
+
"allowNo": false,
|
|
209
|
+
"type": "boolean"
|
|
210
|
+
},
|
|
211
|
+
"file": {
|
|
212
|
+
"char": "f",
|
|
213
|
+
"description": "本地 HTML 文件路径",
|
|
214
|
+
"name": "file",
|
|
215
|
+
"required": true,
|
|
216
|
+
"hasDynamicHelp": false,
|
|
217
|
+
"multiple": false,
|
|
218
|
+
"type": "option"
|
|
219
|
+
},
|
|
220
|
+
"thread-id": {
|
|
221
|
+
"description": "已有会话 ID(省略则自动创建)",
|
|
222
|
+
"name": "thread-id",
|
|
223
|
+
"hasDynamicHelp": false,
|
|
224
|
+
"multiple": false,
|
|
225
|
+
"type": "option"
|
|
226
|
+
},
|
|
227
|
+
"project-id": {
|
|
228
|
+
"description": "已有项目 ID(省略则自动创建)",
|
|
229
|
+
"name": "project-id",
|
|
230
|
+
"hasDynamicHelp": false,
|
|
231
|
+
"multiple": false,
|
|
232
|
+
"type": "option"
|
|
233
|
+
},
|
|
234
|
+
"project-name": {
|
|
235
|
+
"description": "项目名称(新建项目时使用)",
|
|
236
|
+
"name": "project-name",
|
|
237
|
+
"hasDynamicHelp": false,
|
|
238
|
+
"multiple": false,
|
|
239
|
+
"type": "option"
|
|
240
|
+
},
|
|
241
|
+
"team-id": {
|
|
242
|
+
"description": "团队 ID(多团队时必填)",
|
|
243
|
+
"name": "team-id",
|
|
244
|
+
"hasDynamicHelp": false,
|
|
245
|
+
"multiple": false,
|
|
246
|
+
"type": "option"
|
|
247
|
+
},
|
|
248
|
+
"timeout": {
|
|
249
|
+
"description": "发布超时时间(秒)",
|
|
250
|
+
"name": "timeout",
|
|
251
|
+
"default": 600,
|
|
252
|
+
"hasDynamicHelp": false,
|
|
253
|
+
"multiple": false,
|
|
254
|
+
"type": "option"
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"hasDynamicHelp": false,
|
|
258
|
+
"hiddenAliases": [],
|
|
259
|
+
"id": "code:deploy",
|
|
260
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
261
|
+
"pluginName": "@ks-open/comate-cli",
|
|
262
|
+
"pluginType": "core",
|
|
263
|
+
"strict": true,
|
|
264
|
+
"enableJsonFlag": true,
|
|
265
|
+
"isESM": true,
|
|
266
|
+
"relativePath": [
|
|
267
|
+
"dist",
|
|
268
|
+
"commands",
|
|
269
|
+
"code",
|
|
270
|
+
"deploy.js"
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
"code:files": {
|
|
274
|
+
"aliases": [],
|
|
275
|
+
"args": {},
|
|
276
|
+
"description": "查看或下载云端 Agent 会话中的文件",
|
|
277
|
+
"examples": [
|
|
278
|
+
"<%= config.bin %> code files --thread-id thread_xxx --json",
|
|
279
|
+
"<%= config.bin %> code files --thread-id thread_xxx --download src/App.tsx --json"
|
|
280
|
+
],
|
|
281
|
+
"flags": {
|
|
282
|
+
"json": {
|
|
283
|
+
"description": "Format output as json.",
|
|
284
|
+
"helpGroup": "GLOBAL",
|
|
285
|
+
"name": "json",
|
|
286
|
+
"allowNo": false,
|
|
287
|
+
"type": "boolean"
|
|
288
|
+
},
|
|
289
|
+
"thread-id": {
|
|
290
|
+
"description": "会话 ID",
|
|
291
|
+
"name": "thread-id",
|
|
292
|
+
"required": true,
|
|
293
|
+
"hasDynamicHelp": false,
|
|
294
|
+
"multiple": false,
|
|
295
|
+
"type": "option"
|
|
296
|
+
},
|
|
297
|
+
"download": {
|
|
298
|
+
"description": "要下载的文件路径(可指定多个)",
|
|
299
|
+
"name": "download",
|
|
300
|
+
"hasDynamicHelp": false,
|
|
301
|
+
"multiple": true,
|
|
302
|
+
"type": "option"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"hasDynamicHelp": false,
|
|
306
|
+
"hiddenAliases": [],
|
|
307
|
+
"id": "code:files",
|
|
308
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
309
|
+
"pluginName": "@ks-open/comate-cli",
|
|
310
|
+
"pluginType": "core",
|
|
311
|
+
"strict": true,
|
|
312
|
+
"enableJsonFlag": true,
|
|
313
|
+
"isESM": true,
|
|
314
|
+
"relativePath": [
|
|
315
|
+
"dist",
|
|
316
|
+
"commands",
|
|
317
|
+
"code",
|
|
318
|
+
"files.js"
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
"code:publish": {
|
|
322
|
+
"aliases": [],
|
|
323
|
+
"args": {},
|
|
324
|
+
"description": "发布云端项目(构建 → 部署 → 返回运行时地址)",
|
|
325
|
+
"examples": [
|
|
326
|
+
"<%= config.bin %> code publish --project-id 206 --thread-id thread_xxx --json",
|
|
327
|
+
"<%= config.bin %> code publish --project-id 206 --thread-id thread_xxx --version 1.0.0"
|
|
328
|
+
],
|
|
329
|
+
"flags": {
|
|
330
|
+
"json": {
|
|
331
|
+
"description": "Format output as json.",
|
|
332
|
+
"helpGroup": "GLOBAL",
|
|
333
|
+
"name": "json",
|
|
334
|
+
"allowNo": false,
|
|
335
|
+
"type": "boolean"
|
|
336
|
+
},
|
|
337
|
+
"project-id": {
|
|
338
|
+
"description": "项目 ID",
|
|
339
|
+
"name": "project-id",
|
|
340
|
+
"required": true,
|
|
341
|
+
"hasDynamicHelp": false,
|
|
342
|
+
"multiple": false,
|
|
343
|
+
"type": "option"
|
|
344
|
+
},
|
|
345
|
+
"thread-id": {
|
|
346
|
+
"description": "会话 ID",
|
|
347
|
+
"name": "thread-id",
|
|
348
|
+
"required": true,
|
|
349
|
+
"hasDynamicHelp": false,
|
|
350
|
+
"multiple": false,
|
|
351
|
+
"type": "option"
|
|
352
|
+
},
|
|
353
|
+
"version": {
|
|
354
|
+
"description": "版本号(默认自动生成)",
|
|
355
|
+
"name": "version",
|
|
356
|
+
"hasDynamicHelp": false,
|
|
357
|
+
"multiple": false,
|
|
358
|
+
"type": "option"
|
|
359
|
+
},
|
|
360
|
+
"build-command": {
|
|
361
|
+
"description": "自定义构建命令",
|
|
362
|
+
"name": "build-command",
|
|
363
|
+
"hasDynamicHelp": false,
|
|
364
|
+
"multiple": false,
|
|
365
|
+
"type": "option"
|
|
366
|
+
},
|
|
367
|
+
"skip-build": {
|
|
368
|
+
"description": "跳过构建,直接发布",
|
|
369
|
+
"name": "skip-build",
|
|
370
|
+
"allowNo": false,
|
|
371
|
+
"type": "boolean"
|
|
372
|
+
},
|
|
373
|
+
"timeout": {
|
|
374
|
+
"description": "超时时间(秒)",
|
|
375
|
+
"name": "timeout",
|
|
376
|
+
"default": 600,
|
|
377
|
+
"hasDynamicHelp": false,
|
|
378
|
+
"multiple": false,
|
|
379
|
+
"type": "option"
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
"hasDynamicHelp": false,
|
|
383
|
+
"hiddenAliases": [],
|
|
384
|
+
"id": "code:publish",
|
|
385
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
386
|
+
"pluginName": "@ks-open/comate-cli",
|
|
387
|
+
"pluginType": "core",
|
|
388
|
+
"strict": true,
|
|
389
|
+
"enableJsonFlag": true,
|
|
390
|
+
"isESM": true,
|
|
391
|
+
"relativePath": [
|
|
392
|
+
"dist",
|
|
393
|
+
"commands",
|
|
394
|
+
"code",
|
|
395
|
+
"publish.js"
|
|
396
|
+
]
|
|
397
|
+
},
|
|
398
|
+
"code:resume": {
|
|
399
|
+
"aliases": [],
|
|
400
|
+
"args": {},
|
|
401
|
+
"description": "恢复被中断的云端 Agent(HITL 确认/拒绝)",
|
|
402
|
+
"examples": [
|
|
403
|
+
"<%= config.bin %> code resume --thread-id thread_xxx --approve --json",
|
|
404
|
+
"<%= config.bin %> code resume --thread-id thread_xxx --reject --message \"换个方案\" --json"
|
|
405
|
+
],
|
|
406
|
+
"flags": {
|
|
407
|
+
"json": {
|
|
408
|
+
"description": "Format output as json.",
|
|
409
|
+
"helpGroup": "GLOBAL",
|
|
410
|
+
"name": "json",
|
|
411
|
+
"allowNo": false,
|
|
412
|
+
"type": "boolean"
|
|
413
|
+
},
|
|
414
|
+
"thread-id": {
|
|
415
|
+
"description": "会话 ID",
|
|
416
|
+
"name": "thread-id",
|
|
417
|
+
"required": true,
|
|
418
|
+
"hasDynamicHelp": false,
|
|
419
|
+
"multiple": false,
|
|
420
|
+
"type": "option"
|
|
421
|
+
},
|
|
422
|
+
"approve": {
|
|
423
|
+
"description": "批准当前方案(默认)",
|
|
424
|
+
"exclusive": [
|
|
425
|
+
"reject"
|
|
426
|
+
],
|
|
427
|
+
"name": "approve",
|
|
428
|
+
"allowNo": false,
|
|
429
|
+
"type": "boolean"
|
|
430
|
+
},
|
|
431
|
+
"reject": {
|
|
432
|
+
"description": "拒绝当前方案",
|
|
433
|
+
"exclusive": [
|
|
434
|
+
"approve"
|
|
435
|
+
],
|
|
436
|
+
"name": "reject",
|
|
437
|
+
"allowNo": false,
|
|
438
|
+
"type": "boolean"
|
|
439
|
+
},
|
|
440
|
+
"message": {
|
|
441
|
+
"description": "附加说明(拒绝时建议提供)",
|
|
442
|
+
"name": "message",
|
|
443
|
+
"hasDynamicHelp": false,
|
|
444
|
+
"multiple": false,
|
|
445
|
+
"type": "option"
|
|
446
|
+
},
|
|
447
|
+
"assistant-id": {
|
|
448
|
+
"description": "云端 Agent ID",
|
|
449
|
+
"name": "assistant-id",
|
|
450
|
+
"default": "app-buddy",
|
|
451
|
+
"hasDynamicHelp": false,
|
|
452
|
+
"multiple": false,
|
|
453
|
+
"type": "option"
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"hasDynamicHelp": false,
|
|
457
|
+
"hiddenAliases": [],
|
|
458
|
+
"id": "code:resume",
|
|
459
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
460
|
+
"pluginName": "@ks-open/comate-cli",
|
|
461
|
+
"pluginType": "core",
|
|
462
|
+
"strict": true,
|
|
463
|
+
"enableJsonFlag": true,
|
|
464
|
+
"isESM": true,
|
|
465
|
+
"relativePath": [
|
|
466
|
+
"dist",
|
|
467
|
+
"commands",
|
|
468
|
+
"code",
|
|
469
|
+
"resume.js"
|
|
470
|
+
]
|
|
471
|
+
},
|
|
472
|
+
"code:send": {
|
|
473
|
+
"aliases": [],
|
|
474
|
+
"args": {
|
|
475
|
+
"message": {
|
|
476
|
+
"description": "发送给云端 Agent 的消息",
|
|
477
|
+
"name": "message",
|
|
478
|
+
"required": true
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
"description": "向云端 Agent 发送消息(提交后立即返回)",
|
|
482
|
+
"examples": [
|
|
483
|
+
"<%= config.bin %> code send --thread-id thread_xxx --project-id 206 \"做一个待办应用\" --json"
|
|
484
|
+
],
|
|
485
|
+
"flags": {
|
|
486
|
+
"json": {
|
|
487
|
+
"description": "Format output as json.",
|
|
488
|
+
"helpGroup": "GLOBAL",
|
|
489
|
+
"name": "json",
|
|
490
|
+
"allowNo": false,
|
|
491
|
+
"type": "boolean"
|
|
492
|
+
},
|
|
493
|
+
"thread-id": {
|
|
494
|
+
"description": "会话 ID(从 code create 获取)",
|
|
495
|
+
"name": "thread-id",
|
|
496
|
+
"required": true,
|
|
497
|
+
"hasDynamicHelp": false,
|
|
498
|
+
"multiple": false,
|
|
499
|
+
"type": "option"
|
|
500
|
+
},
|
|
501
|
+
"project-id": {
|
|
502
|
+
"description": "项目 ID(从 code create 获取,用于生成访问地址)",
|
|
503
|
+
"name": "project-id",
|
|
504
|
+
"hasDynamicHelp": false,
|
|
505
|
+
"multiple": false,
|
|
506
|
+
"type": "option"
|
|
507
|
+
},
|
|
508
|
+
"assistant-id": {
|
|
509
|
+
"description": "云端 Agent ID",
|
|
510
|
+
"name": "assistant-id",
|
|
511
|
+
"default": "app-buddy",
|
|
512
|
+
"hasDynamicHelp": false,
|
|
513
|
+
"multiple": false,
|
|
514
|
+
"type": "option"
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
"hasDynamicHelp": false,
|
|
518
|
+
"hiddenAliases": [],
|
|
519
|
+
"id": "code:send",
|
|
520
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
521
|
+
"pluginName": "@ks-open/comate-cli",
|
|
522
|
+
"pluginType": "core",
|
|
523
|
+
"strict": true,
|
|
524
|
+
"enableJsonFlag": true,
|
|
525
|
+
"isESM": true,
|
|
526
|
+
"relativePath": [
|
|
527
|
+
"dist",
|
|
528
|
+
"commands",
|
|
529
|
+
"code",
|
|
530
|
+
"send.js"
|
|
531
|
+
]
|
|
532
|
+
},
|
|
533
|
+
"code:status": {
|
|
534
|
+
"aliases": [],
|
|
535
|
+
"args": {},
|
|
536
|
+
"description": "查看云端项目综合状态(Agent / 构建 / 部署 / HITL 中断)",
|
|
537
|
+
"examples": [
|
|
538
|
+
"<%= config.bin %> code status --thread-id thread_xxx --json",
|
|
539
|
+
"<%= config.bin %> code status --thread-id thread_xxx --project-id 206 --json"
|
|
540
|
+
],
|
|
541
|
+
"flags": {
|
|
542
|
+
"json": {
|
|
543
|
+
"description": "Format output as json.",
|
|
544
|
+
"helpGroup": "GLOBAL",
|
|
545
|
+
"name": "json",
|
|
546
|
+
"allowNo": false,
|
|
547
|
+
"type": "boolean"
|
|
548
|
+
},
|
|
549
|
+
"thread-id": {
|
|
550
|
+
"description": "会话 ID",
|
|
551
|
+
"name": "thread-id",
|
|
552
|
+
"required": true,
|
|
553
|
+
"hasDynamicHelp": false,
|
|
554
|
+
"multiple": false,
|
|
555
|
+
"type": "option"
|
|
556
|
+
},
|
|
557
|
+
"project-id": {
|
|
558
|
+
"description": "项目 ID(可选,传入后返回版本和部署信息)",
|
|
559
|
+
"name": "project-id",
|
|
560
|
+
"hasDynamicHelp": false,
|
|
561
|
+
"multiple": false,
|
|
562
|
+
"type": "option"
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
"hasDynamicHelp": false,
|
|
566
|
+
"hiddenAliases": [],
|
|
567
|
+
"id": "code:status",
|
|
568
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
569
|
+
"pluginName": "@ks-open/comate-cli",
|
|
570
|
+
"pluginType": "core",
|
|
571
|
+
"strict": true,
|
|
572
|
+
"enableJsonFlag": true,
|
|
573
|
+
"isESM": true,
|
|
574
|
+
"relativePath": [
|
|
575
|
+
"dist",
|
|
576
|
+
"commands",
|
|
577
|
+
"code",
|
|
578
|
+
"status.js"
|
|
579
|
+
]
|
|
580
|
+
},
|
|
581
|
+
"code:upload": {
|
|
582
|
+
"aliases": [],
|
|
583
|
+
"args": {},
|
|
584
|
+
"description": "上传本地文件或目录到云端 Agent 会话的 sandbox",
|
|
585
|
+
"examples": [
|
|
586
|
+
"<%= config.bin %> code upload --thread-id thread_xxx -d ./my-site --json",
|
|
587
|
+
"<%= config.bin %> code upload --thread-id thread_xxx -d ./index.html --json",
|
|
588
|
+
"<%= config.bin %> code upload --thread-id thread_xxx -d ./dist --prefix code --json"
|
|
589
|
+
],
|
|
590
|
+
"flags": {
|
|
591
|
+
"json": {
|
|
592
|
+
"description": "Format output as json.",
|
|
593
|
+
"helpGroup": "GLOBAL",
|
|
594
|
+
"name": "json",
|
|
595
|
+
"allowNo": false,
|
|
596
|
+
"type": "boolean"
|
|
597
|
+
},
|
|
598
|
+
"thread-id": {
|
|
599
|
+
"description": "会话 ID",
|
|
600
|
+
"name": "thread-id",
|
|
601
|
+
"required": true,
|
|
602
|
+
"hasDynamicHelp": false,
|
|
603
|
+
"multiple": false,
|
|
604
|
+
"type": "option"
|
|
605
|
+
},
|
|
606
|
+
"dir": {
|
|
607
|
+
"char": "d",
|
|
608
|
+
"description": "本地文件或目录路径",
|
|
609
|
+
"name": "dir",
|
|
610
|
+
"required": true,
|
|
611
|
+
"hasDynamicHelp": false,
|
|
612
|
+
"multiple": false,
|
|
613
|
+
"type": "option"
|
|
614
|
+
},
|
|
615
|
+
"prefix": {
|
|
616
|
+
"description": "sandbox 中的目标目录前缀",
|
|
617
|
+
"name": "prefix",
|
|
618
|
+
"default": "code",
|
|
619
|
+
"hasDynamicHelp": false,
|
|
620
|
+
"multiple": false,
|
|
621
|
+
"type": "option"
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
"hasDynamicHelp": false,
|
|
625
|
+
"hiddenAliases": [],
|
|
626
|
+
"id": "code:upload",
|
|
627
|
+
"pluginAlias": "@ks-open/comate-cli",
|
|
628
|
+
"pluginName": "@ks-open/comate-cli",
|
|
629
|
+
"pluginType": "core",
|
|
630
|
+
"strict": true,
|
|
631
|
+
"enableJsonFlag": true,
|
|
632
|
+
"isESM": true,
|
|
633
|
+
"relativePath": [
|
|
634
|
+
"dist",
|
|
635
|
+
"commands",
|
|
636
|
+
"code",
|
|
637
|
+
"upload.js"
|
|
638
|
+
]
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
"version": "0.0.13"
|
|
642
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wps365-open/comate-cli",
|
|
3
|
+
"description": "comate-cli: A CLI for WpsCode application development",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"author": "xiaoyefang",
|
|
6
|
+
"bin": {
|
|
7
|
+
"comate-cli": "./bin/run.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20.0.0"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/",
|
|
18
|
+
"dist/",
|
|
19
|
+
"oclif.manifest.json"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@oclif/core": "^4",
|
|
23
|
+
"@oclif/plugin-help": "^6",
|
|
24
|
+
"@oclif/plugin-version": "^2",
|
|
25
|
+
"archiver": "^7.0.1",
|
|
26
|
+
"axios": "^1.11.0",
|
|
27
|
+
"chalk": "^5.4.1",
|
|
28
|
+
"form-data": "^4.0.5",
|
|
29
|
+
"inquirer": "^12.9.0",
|
|
30
|
+
"open": "^10.1.0",
|
|
31
|
+
"ora": "^8.2.0",
|
|
32
|
+
"shx": "^0.4.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@eslint/js": "^10.0.1",
|
|
36
|
+
"@oclif/test": "^4",
|
|
37
|
+
"@types/archiver": "^7.0.0",
|
|
38
|
+
"@types/node": "^22",
|
|
39
|
+
"chai": "^4",
|
|
40
|
+
"esbuild": "^0.25.0",
|
|
41
|
+
"eslint": "^9",
|
|
42
|
+
"javascript-obfuscator": "^4",
|
|
43
|
+
"mocha": "^10",
|
|
44
|
+
"oclif": "^4",
|
|
45
|
+
"tsc-alias": "^1.8.16",
|
|
46
|
+
"tsx": "^4.20.3",
|
|
47
|
+
"typescript": "^5"
|
|
48
|
+
},
|
|
49
|
+
"oclif": {
|
|
50
|
+
"bin": "comate-cli",
|
|
51
|
+
"dirname": "comate-cli",
|
|
52
|
+
"commands": "./dist/commands",
|
|
53
|
+
"topicSeparator": " ",
|
|
54
|
+
"plugins": [
|
|
55
|
+
"@oclif/plugin-help",
|
|
56
|
+
"@oclif/plugin-version"
|
|
57
|
+
],
|
|
58
|
+
"hooks": {
|
|
59
|
+
"init": "./dist/hooks/init/logger",
|
|
60
|
+
"prerun": "./dist/hooks/prerun/update-checker"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"dev": "tsc -b --watch",
|
|
65
|
+
"clean": "shx rm -rf dist dist.bundled dist.obf",
|
|
66
|
+
"bundle": "node bundle.config.js",
|
|
67
|
+
"build": "pnpm run clean && tsc -b && tsc-alias && pnpm run bundle && pnpm run obfuscate && pnpm run finalize && pnpm run build:manifest",
|
|
68
|
+
"obfuscate": "javascript-obfuscator dist.bundled --config=obfuscator.config.json --output dist.obf",
|
|
69
|
+
"finalize": "shx rm -rf dist && shx mv dist.obf dist",
|
|
70
|
+
"build:manifest": "oclif manifest",
|
|
71
|
+
"lint": "eslint",
|
|
72
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\""
|
|
73
|
+
}
|
|
74
|
+
}
|