@lovrabet/lovrabet-cli 2.1.2-beta.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/artifact/index.js +1 -1
  10. package/lib/commands/auth/index.js +1 -1
  11. package/lib/commands/auth/prompt.js +1 -1
  12. package/lib/commands/bff/detail.js +1 -1
  13. package/lib/commands/bff/exec.js +1 -1
  14. package/lib/commands/bff/index.js +1 -1
  15. package/lib/commands/cli-skill/index.js +1 -1
  16. package/lib/commands/common/config-policy.js +1 -1
  17. package/lib/commands/common/constraints.js +1 -1
  18. package/lib/commands/common/flags.js +1 -1
  19. package/lib/commands/config/definitions.js +1 -1
  20. package/lib/commands/config/shared.js +1 -1
  21. package/lib/commands/data/index.js +1 -1
  22. package/lib/commands/dataset/detail.js +1 -1
  23. package/lib/commands/dataset/index.js +1 -1
  24. package/lib/commands/dataset/list.js +1 -1
  25. package/lib/commands/dataset/sdk-doc.js +1 -1
  26. package/lib/commands/doctor.js +1 -1
  27. package/lib/commands/init.js +1 -1
  28. package/lib/commands/kb/index.js +1 -1
  29. package/lib/commands/logs/index.js +1 -1
  30. package/lib/commands/personal-bff/index.js +1 -1
  31. package/lib/commands/registry.js +1 -1
  32. package/lib/commands/schema.js +1 -1
  33. package/lib/commands/service/dynamic.js +1 -1
  34. package/lib/commands/service/index.js +1 -1
  35. package/lib/commands/service/registry.js +1 -1
  36. package/lib/commands/skill/index.js +1 -1
  37. package/lib/commands/skill/templates.js +1 -1
  38. package/lib/commands/skill/validate.js +1 -1
  39. package/lib/commands/sql/detail.js +1 -1
  40. package/lib/commands/sql/exec.js +1 -1
  41. package/lib/commands/sql/index.js +1 -1
  42. package/lib/commands/update.js +1 -1
  43. package/lib/commands/workspace/index.js +1 -1
  44. package/lib/config/schema.js +1 -1
  45. package/lib/constant/app.js +1 -1
  46. package/lib/constant/auth-mode.js +1 -1
  47. package/lib/constant/cli.js +1 -1
  48. package/lib/constant/defaults.js +1 -1
  49. package/lib/constant/distribution.js +1 -1
  50. package/lib/constant/domain.js +1 -1
  51. package/lib/constant/env.js +1 -1
  52. package/lib/constant/output.js +1 -1
  53. package/lib/constant/product.js +1 -1
  54. package/lib/constant/risk.js +1 -1
  55. package/lib/constant/url.js +1 -1
  56. package/lib/context.js +1 -1
  57. package/lib/core/api-client.js +1 -1
  58. package/lib/core/db-resolver.js +1 -1
  59. package/lib/core/sdk-client.js +1 -1
  60. package/lib/errors.js +1 -1
  61. package/lib/framework/build-all-flags.js +1 -1
  62. package/lib/framework/dryrun.js +1 -1
  63. package/lib/framework/flags.js +1 -1
  64. package/lib/framework/help.js +1 -1
  65. package/lib/framework/index.js +1 -1
  66. package/lib/framework/output.js +1 -1
  67. package/lib/framework/preparse.js +1 -1
  68. package/lib/framework/response.js +1 -1
  69. package/lib/framework/runner-confirmation.js +1 -1
  70. package/lib/framework/runner-error.js +1 -1
  71. package/lib/framework/runner.js +1 -1
  72. package/lib/framework/schema-export.js +1 -1
  73. package/lib/framework/types.js +1 -1
  74. package/lib/generated/build-info.js +1 -1
  75. package/lib/help.js +1 -1
  76. package/lib/skills/npx-skills-add.js +1 -1
  77. package/lib/skills/runtime-skill-sync.js +1 -1
  78. package/lib/utils/apply-jq-filter.js +1 -1
  79. package/lib/utils/logger.js +1 -1
  80. package/lib/utils/params.js +1 -1
  81. package/lib/utils/platform.js +1 -1
  82. package/lib/utils/update-notice.js +1 -1
  83. package/lib/utils/version.js +1 -1
  84. package/lib/utils/write-cli-side-channel.js +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- function a27_0x571a(){const _0x57dff2=['build','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','Created\x20KB\x20entry\x20','21812RorCwv','125345sNstar','POST','Personal\x20knowledge-base\x20entry\x20ID','num','string','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','str','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Search\x20query\x20is\x20required.','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','ragStatus','title','updateTime','version','number','30638ajSmHE','Updated\x20KB\x20entry\x20','Override\x20the\x20existing\x20entry\x20title','metadata','length','150nSQSub','flag','docId','content','list','verbose','File\x20is\x20not\x20a\x20regular\x20file:\x20','file','utf8','/client/knowledge-base/personal/create','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','64idBDoZ','7738912bJunXs','map','/update','userId','query','read','appCode','createTime','22VnTXgK','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','1098foNhHe','Personal\x20knowledge-base\x20entry\x20title','description','validation','2966929xJxlIN','search','1827756RXGftR','74770KVFvdH','447wGpfjP','bool','trim','/client/knowledge-base/personal/','ragErrorMessage','topk','detail','create','File\x20not\x20found:\x20','--topk\x20must\x20be\x20a\x20positive\x20number.','scope','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','write','body','update','File\x20path\x20is\x20required.'];a27_0x571a=function(){return _0x57dff2;};return a27_0x571a();}const a27_0x24ccfe=a27_0x1ccb;(function(_0x66171b,_0x34b717){const _0x40a301=a27_0x1ccb,_0x28737a=_0x66171b();while(!![]){try{const _0x2cb171=-parseInt(_0x40a301(0xed))/0x1*(parseInt(_0x40a301(0xdd))/0x2)+-parseInt(_0x40a301(0x101))/0x3*(parseInt(_0x40a301(0x114))/0x4)+-parseInt(_0x40a301(0x115))/0x5*(-parseInt(_0x40a301(0xe2))/0x6)+-parseInt(_0x40a301(0xfd))/0x7+parseInt(_0x40a301(0xee))/0x8+-parseInt(_0x40a301(0xf9))/0x9*(-parseInt(_0x40a301(0x100))/0xa)+parseInt(_0x40a301(0xf6))/0xb*(parseInt(_0x40a301(0xff))/0xc);if(_0x2cb171===_0x34b717)break;else _0x28737a['push'](_0x28737a['shift']());}catch(_0x2e9dc3){_0x28737a['push'](_0x28737a['shift']());}}}(a27_0x571a,0x910e5));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a27_0x24ccfe(0x122),'type':a27_0x24ccfe(0x119),'required':!![],'description':a27_0x24ccfe(0xfa)},FILE_FLAG={'name':a27_0x24ccfe(0xe9),'type':a27_0x24ccfe(0x119),'required':!![],'description':a27_0x24ccfe(0x11d)},QUERY_FLAG={'name':a27_0x24ccfe(0xf2),'type':a27_0x24ccfe(0x119),'required':!![],'description':a27_0x24ccfe(0xf7)},TOPK_FLAG={'name':a27_0x24ccfe(0x106),'type':a27_0x24ccfe(0xdc),'description':a27_0x24ccfe(0xf8)};function readKnowledgeFile(_0x14f79e){const _0x22e055=a27_0x24ccfe;if(!_0x14f79e)throw CliErrors['validation'](_0x22e055(0x110));if(!existsSync(_0x14f79e))throw CliErrors[_0x22e055(0xfc)](_0x22e055(0x109)+_0x14f79e);if(!statSync(_0x14f79e)['isFile']())throw CliErrors[_0x22e055(0xfc)](_0x22e055(0xe8)+_0x14f79e);return readFileSync(_0x14f79e,_0x22e055(0xea));}function summarizePersonalItem(_0x2384b5){const _0x17a902=a27_0x24ccfe;return{'id':_0x2384b5['id'],'title':_0x2384b5['title'],'version':_0x2384b5[_0x17a902(0xdb)],'ragStatus':_0x2384b5[_0x17a902(0x121)],'ragErrorMessage':_0x2384b5['ragErrorMessage'],'updateTime':_0x2384b5[_0x17a902(0x123)]};}function detailPersonalItem(_0x13f657){const _0x1a8837=a27_0x24ccfe;return{'id':_0x13f657['id'],'appCode':_0x13f657[_0x1a8837(0xf4)],'scope':_0x13f657[_0x1a8837(0x10b)],'userId':_0x13f657[_0x1a8837(0xf1)],'title':_0x13f657[_0x1a8837(0x122)],'content':_0x13f657[_0x1a8837(0xe5)]??'','version':_0x13f657['version'],'ragStatus':_0x13f657[_0x1a8837(0x121)],'ragErrorMessage':_0x13f657[_0x1a8837(0x105)],'createTime':_0x13f657[_0x1a8837(0xf5)],'updateTime':_0x13f657[_0x1a8837(0x123)]};}function summarizeSearchHit(_0x47866d){const _0x5e6ada=a27_0x24ccfe;return{'scope':_0x47866d['scope'],'docId':_0x47866d[_0x5e6ada(0xe4)],'score':_0x47866d['score'],'weightedScore':_0x47866d['weightedScore'],'content':_0x47866d['content'],'metadata':_0x47866d[_0x5e6ada(0xe0)]};}function readTopK(_0x21f35b){const _0x220a94=a27_0x24ccfe,_0x29d8d3=_0x21f35b[_0x220a94(0xe3)](_0x220a94(0x106));if(_0x29d8d3===undefined||_0x29d8d3===null||_0x29d8d3==='')return undefined;const _0xde9eab=_0x21f35b[_0x220a94(0x118)](_0x220a94(0x106));if(!Number['isFinite'](_0xde9eab)||_0xde9eab<0x1)throw CliErrors[_0x220a94(0xfc)](_0x220a94(0x10a));return _0xde9eab;}function a27_0x1ccb(_0x563e80,_0x36272d){_0x563e80=_0x563e80-0xdb;const _0x571af4=a27_0x571a();let _0x1ccb4a=_0x571af4[_0x563e80];return _0x1ccb4a;}const kbList={'service':'kb','command':a27_0x24ccfe(0xe6),'description':a27_0x24ccfe(0x10c),'risk':a27_0x24ccfe(0xf3),'flags':[VERBOSE_FLAG],async 'execute'(_0x16ad15){const _0x3c27d9=a27_0x24ccfe,_0x20164e=await listPersonalKnowledgeBaseItems(_0x16ad15[_0x3c27d9(0xf4)]);if(_0x16ad15[_0x3c27d9(0x102)](_0x3c27d9(0xe7)))return{'ok':!![],'data':{'total':_0x20164e[_0x3c27d9(0xe1)],'items':_0x20164e}};return{'ok':!![],'data':{'total':_0x20164e['length'],'items':_0x20164e[_0x3c27d9(0xef)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a27_0x24ccfe(0x107),'description':a27_0x24ccfe(0x120),'risk':a27_0x24ccfe(0xf3),'flags':[{...ID_FLAG,'description':a27_0x24ccfe(0x117)}],async 'execute'(_0x5bc2c8){const _0x15da76=a27_0x24ccfe,_0x486f72=await getPersonalKnowledgeBaseItem(_0x5bc2c8[_0x15da76(0x118)]('id'),_0x5bc2c8[_0x15da76(0xf4)]);return{'ok':!![],'data':detailPersonalItem(_0x486f72)};}},kbCreate={'service':'kb','command':a27_0x24ccfe(0x108),'description':a27_0x24ccfe(0xec),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x5cba7a){const _0x1b4a29=a27_0x24ccfe,_0x2c7d48=_0x5cba7a[_0x1b4a29(0x11b)]('title'),_0x1bb27c=readKnowledgeFile(_0x5cba7a[_0x1b4a29(0x11b)](_0x1b4a29(0xe9))),_0x5e5d3f=await createPersonalKnowledgeBaseItem(_0x5cba7a[_0x1b4a29(0xf4)],{'title':_0x2c7d48,'content':_0x1bb27c});return{'ok':!![],'data':summarizePersonalItem(_0x5e5d3f),'message':_0x1b4a29(0x113)+_0x5e5d3f['id']+'\x20('+_0x5e5d3f['title']+')'};},async 'dryRun'(_0x34faec){const _0xab02cc=a27_0x24ccfe,_0x4008e3=_0x34faec[_0xab02cc(0x11b)]('title'),_0x20d347=readKnowledgeFile(_0x34faec[_0xab02cc(0x11b)]('file'));return dryRun('POST',_0xab02cc(0xeb))['body']({'appCode':_0x34faec[_0xab02cc(0xf4)],'title':_0x4008e3,'content':_0x20d347})[_0xab02cc(0xfb)](_0xab02cc(0x11a)+_0x4008e3+'\x22')[_0xab02cc(0x111)]();}},kbUpdate={'service':'kb','command':a27_0x24ccfe(0x10f),'description':a27_0x24ccfe(0x11e),'risk':a27_0x24ccfe(0x10d),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a27_0x24ccfe(0xdf)},FILE_FLAG],async 'execute'(_0x3b6bba){const _0x50c8ed=a27_0x24ccfe,_0x56f235=_0x3b6bba['num']('id'),_0x2164b9=readKnowledgeFile(_0x3b6bba[_0x50c8ed(0x11b)]('file')),_0x11a6b5=_0x3b6bba['str'](_0x50c8ed(0x122))||(await getPersonalKnowledgeBaseItem(_0x56f235,_0x3b6bba['appCode']))['title'],_0x48ece9=await updatePersonalKnowledgeBaseItem(_0x56f235,_0x3b6bba[_0x50c8ed(0xf4)],{'title':_0x11a6b5,'content':_0x2164b9});return{'ok':!![],'data':summarizePersonalItem(_0x48ece9),'message':_0x50c8ed(0xde)+_0x48ece9['id']+'\x20('+_0x48ece9[_0x50c8ed(0x122)]+')'};},async 'dryRun'(_0x2e56d1){const _0x721b80=a27_0x24ccfe,_0x474b5a=_0x2e56d1[_0x721b80(0x118)]('id'),_0x42eeb9=readKnowledgeFile(_0x2e56d1[_0x721b80(0x11b)](_0x721b80(0xe9))),_0x179b15=_0x2e56d1[_0x721b80(0x11b)](_0x721b80(0x122))||(await getPersonalKnowledgeBaseItem(_0x474b5a,_0x2e56d1['appCode']))[_0x721b80(0x122)];return dryRun(_0x721b80(0x116),_0x721b80(0x104)+_0x474b5a+_0x721b80(0xf0))[_0x721b80(0x10e)]({'appCode':_0x2e56d1[_0x721b80(0xf4)],'title':_0x179b15,'content':_0x42eeb9})[_0x721b80(0xfb)](_0x721b80(0x11c)+_0x474b5a)[_0x721b80(0x111)]();}},kbSearch={'service':'kb','command':a27_0x24ccfe(0xfe),'description':a27_0x24ccfe(0x112),'risk':a27_0x24ccfe(0xf3),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x4560c0){const _0x250023=a27_0x24ccfe;if(!_0x4560c0[_0x250023(0x11b)](_0x250023(0xf2))[_0x250023(0x103)]())throw CliErrors[_0x250023(0xfc)](_0x250023(0x11f));readTopK(_0x4560c0);},async 'execute'(_0x57f143){const _0x1766de=a27_0x24ccfe,_0x353ed2=_0x57f143[_0x1766de(0x11b)](_0x1766de(0xf2))['trim'](),_0x448258=readTopK(_0x57f143),_0x2cb3bd=await searchKnowledgeBase(_0x57f143[_0x1766de(0xf4)],{'query':_0x353ed2,'topK':_0x448258});return{'ok':!![],'data':{'total':_0x2cb3bd['length'],'hits':_0x2cb3bd['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a27_0x5e74d4=a27_0x4d8f;function a27_0x454b(){const _0x37104b=['Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','docId','/client/knowledge-base/personal/create','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','File\x20is\x20not\x20a\x20regular\x20file:\x20','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','isFinite','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','num','ragStatus','query','title','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','list','scope','bool','/update','--topk\x20must\x20be\x20a\x20positive\x20number.','Search\x20query\x20is\x20required.','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','update','description','File\x20not\x20found:\x20','File\x20path\x20is\x20required.','1653750vqdYZC','4155760oKYcBz','read','write','str','3emuRVU','Override\x20the\x20existing\x20entry\x20title','body','string','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','4268824wjEimk','score','validation','content','topk','337668yqJSdQ','972932iPpwEl','number','618171vhnqrv','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','file','POST','version','length','utf8','updateTime','appCode','ragErrorMessage','map','/client/knowledge-base/personal/','isFile','4051680tcROSb','build','createTime'];a27_0x454b=function(){return _0x37104b;};return a27_0x454b();}(function(_0x45190d,_0x7ee3b7){const _0x470d36=a27_0x4d8f,_0x3c96bc=_0x45190d();while(!![]){try{const _0x44df1d=-parseInt(_0x470d36(0x1ce))/0x1+parseInt(_0x470d36(0x1cb))/0x2+-parseInt(_0x470d36(0x1c0))/0x3*(parseInt(_0x470d36(0x1cc))/0x4)+parseInt(_0x470d36(0x1bb))/0x5+parseInt(_0x470d36(0x1db))/0x6+parseInt(_0x470d36(0x1c6))/0x7+-parseInt(_0x470d36(0x1bc))/0x8;if(_0x44df1d===_0x7ee3b7)break;else _0x3c96bc['push'](_0x3c96bc['shift']());}catch(_0x5105a3){_0x3c96bc['push'](_0x3c96bc['shift']());}}}(a27_0x454b,0x6296e));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a27_0x5e74d4(0x1ae),'type':a27_0x5e74d4(0x1c3),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a27_0x5e74d4(0x1d0),'type':a27_0x5e74d4(0x1c3),'required':!![],'description':a27_0x5e74d4(0x1af)},QUERY_FLAG={'name':a27_0x5e74d4(0x1ad),'type':'string','required':!![],'description':a27_0x5e74d4(0x1aa)},TOPK_FLAG={'name':a27_0x5e74d4(0x1ca),'type':a27_0x5e74d4(0x1cd),'description':a27_0x5e74d4(0x1a6)};function a27_0x4d8f(_0x2211fd,_0xf5149){_0x2211fd=_0x2211fd-0x1a2;const _0x454b7f=a27_0x454b();let _0x4d8f7b=_0x454b7f[_0x2211fd];return _0x4d8f7b;}function readKnowledgeFile(_0x22c737){const _0x542227=a27_0x5e74d4;if(!_0x22c737)throw CliErrors[_0x542227(0x1c8)](_0x542227(0x1ba));if(!existsSync(_0x22c737))throw CliErrors['validation'](_0x542227(0x1b9)+_0x22c737);if(!statSync(_0x22c737)[_0x542227(0x1da)]())throw CliErrors[_0x542227(0x1c8)](_0x542227(0x1a7)+_0x22c737);return readFileSync(_0x22c737,_0x542227(0x1d4));}function summarizePersonalItem(_0x1995ac){const _0x4a01b2=a27_0x5e74d4;return{'id':_0x1995ac['id'],'title':_0x1995ac[_0x4a01b2(0x1ae)],'version':_0x1995ac[_0x4a01b2(0x1d2)],'ragStatus':_0x1995ac['ragStatus'],'ragErrorMessage':_0x1995ac[_0x4a01b2(0x1d7)],'updateTime':_0x1995ac['updateTime']};}function detailPersonalItem(_0x283199){const _0x39aaff=a27_0x5e74d4;return{'id':_0x283199['id'],'appCode':_0x283199['appCode'],'scope':_0x283199[_0x39aaff(0x1b1)],'userId':_0x283199['userId'],'title':_0x283199[_0x39aaff(0x1ae)],'content':_0x283199[_0x39aaff(0x1c9)]??'','version':_0x283199[_0x39aaff(0x1d2)],'ragStatus':_0x283199[_0x39aaff(0x1ac)],'ragErrorMessage':_0x283199[_0x39aaff(0x1d7)],'createTime':_0x283199[_0x39aaff(0x1a2)],'updateTime':_0x283199[_0x39aaff(0x1d5)]};}function summarizeSearchHit(_0x37ce4f){const _0x560cc7=a27_0x5e74d4;return{'scope':_0x37ce4f[_0x560cc7(0x1b1)],'docId':_0x37ce4f[_0x560cc7(0x1a4)],'score':_0x37ce4f[_0x560cc7(0x1c7)],'weightedScore':_0x37ce4f['weightedScore'],'content':_0x37ce4f[_0x560cc7(0x1c9)],'metadata':_0x37ce4f['metadata']};}function readTopK(_0x54b2f1){const _0x3ab28b=a27_0x5e74d4,_0x465b75=_0x54b2f1['flag']('topk');if(_0x465b75===undefined||_0x465b75===null||_0x465b75==='')return undefined;const _0x32e4db=_0x54b2f1[_0x3ab28b(0x1ab)](_0x3ab28b(0x1ca));if(!Number[_0x3ab28b(0x1a9)](_0x32e4db)||_0x32e4db<0x1)throw CliErrors[_0x3ab28b(0x1c8)](_0x3ab28b(0x1b4));return _0x32e4db;}const kbList={'service':'kb','command':a27_0x5e74d4(0x1b0),'description':a27_0x5e74d4(0x1b6),'risk':a27_0x5e74d4(0x1bd),'flags':[VERBOSE_FLAG],async 'execute'(_0x18286a){const _0x1d0375=a27_0x5e74d4,_0x39c595=await listPersonalKnowledgeBaseItems(_0x18286a[_0x1d0375(0x1d6)]);if(_0x18286a[_0x1d0375(0x1b2)]('verbose'))return{'ok':!![],'data':{'total':_0x39c595[_0x1d0375(0x1d3)],'items':_0x39c595}};return{'ok':!![],'data':{'total':_0x39c595[_0x1d0375(0x1d3)],'items':_0x39c595[_0x1d0375(0x1d8)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a27_0x5e74d4(0x1c4),'risk':a27_0x5e74d4(0x1bd),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'}],async 'execute'(_0x1fe4dc){const _0x5e63f2=a27_0x5e74d4,_0x267a73=await getPersonalKnowledgeBaseItem(_0x1fe4dc[_0x5e63f2(0x1ab)]('id'),_0x1fe4dc[_0x5e63f2(0x1d6)]);return{'ok':!![],'data':detailPersonalItem(_0x267a73)};}},kbCreate={'service':'kb','command':'create','description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a27_0x5e74d4(0x1be),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x66a08f){const _0x43b9fe=a27_0x5e74d4,_0x21ca01=_0x66a08f[_0x43b9fe(0x1bf)](_0x43b9fe(0x1ae)),_0x3c1378=readKnowledgeFile(_0x66a08f[_0x43b9fe(0x1bf)](_0x43b9fe(0x1d0))),_0x98a637=await createPersonalKnowledgeBaseItem(_0x66a08f['appCode'],{'title':_0x21ca01,'content':_0x3c1378});return{'ok':!![],'data':summarizePersonalItem(_0x98a637),'message':'Created\x20KB\x20entry\x20'+_0x98a637['id']+'\x20('+_0x98a637[_0x43b9fe(0x1ae)]+')'};},async 'dryRun'(_0x55ff71){const _0x43d980=a27_0x5e74d4,_0x55f39e=_0x55ff71[_0x43d980(0x1bf)](_0x43d980(0x1ae)),_0x341a57=readKnowledgeFile(_0x55ff71[_0x43d980(0x1bf)](_0x43d980(0x1d0)));return dryRun(_0x43d980(0x1d1),_0x43d980(0x1a5))['body']({'appCode':_0x55ff71[_0x43d980(0x1d6)],'title':_0x55f39e,'content':_0x341a57})[_0x43d980(0x1b8)](_0x43d980(0x1a3)+_0x55f39e+'\x22')[_0x43d980(0x1dc)]();}},kbUpdate={'service':'kb','command':a27_0x5e74d4(0x1b7),'description':a27_0x5e74d4(0x1c5),'risk':'write','flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a27_0x5e74d4(0x1c1)},FILE_FLAG],async 'execute'(_0x38068f){const _0x3da9d2=a27_0x5e74d4,_0xaa951=_0x38068f[_0x3da9d2(0x1ab)]('id'),_0x5c1003=readKnowledgeFile(_0x38068f[_0x3da9d2(0x1bf)]('file')),_0x503b3b=_0x38068f[_0x3da9d2(0x1bf)]('title')||(await getPersonalKnowledgeBaseItem(_0xaa951,_0x38068f['appCode']))[_0x3da9d2(0x1ae)],_0x1c385b=await updatePersonalKnowledgeBaseItem(_0xaa951,_0x38068f[_0x3da9d2(0x1d6)],{'title':_0x503b3b,'content':_0x5c1003});return{'ok':!![],'data':summarizePersonalItem(_0x1c385b),'message':'Updated\x20KB\x20entry\x20'+_0x1c385b['id']+'\x20('+_0x1c385b[_0x3da9d2(0x1ae)]+')'};},async 'dryRun'(_0x1d4f5f){const _0x4f0d90=a27_0x5e74d4,_0x162563=_0x1d4f5f[_0x4f0d90(0x1ab)]('id'),_0xf120cd=readKnowledgeFile(_0x1d4f5f[_0x4f0d90(0x1bf)](_0x4f0d90(0x1d0))),_0x274334=_0x1d4f5f[_0x4f0d90(0x1bf)](_0x4f0d90(0x1ae))||(await getPersonalKnowledgeBaseItem(_0x162563,_0x1d4f5f['appCode']))[_0x4f0d90(0x1ae)];return dryRun(_0x4f0d90(0x1d1),_0x4f0d90(0x1d9)+_0x162563+_0x4f0d90(0x1b3))[_0x4f0d90(0x1c2)]({'appCode':_0x1d4f5f['appCode'],'title':_0x274334,'content':_0xf120cd})[_0x4f0d90(0x1b8)](_0x4f0d90(0x1a8)+_0x162563)[_0x4f0d90(0x1dc)]();}},kbSearch={'service':'kb','command':'search','description':a27_0x5e74d4(0x1cf),'risk':a27_0x5e74d4(0x1bd),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x57c336){const _0x4da083=a27_0x5e74d4;if(!_0x57c336[_0x4da083(0x1bf)](_0x4da083(0x1ad))['trim']())throw CliErrors[_0x4da083(0x1c8)](_0x4da083(0x1b5));readTopK(_0x57c336);},async 'execute'(_0x5cea27){const _0x151205=a27_0x5e74d4,_0x3e993b=_0x5cea27[_0x151205(0x1bf)](_0x151205(0x1ad))['trim'](),_0x594314=readTopK(_0x5cea27),_0x4581f9=await searchKnowledgeBase(_0x5cea27[_0x151205(0x1d6)],{'query':_0x3e993b,'topK':_0x594314});return{'ok':!![],'data':{'total':_0x4581f9[_0x151205(0x1d3)],'hits':_0x4581f9[_0x151205(0x1d8)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- function a28_0x1a44(_0x16930d,_0x2b6d46){_0x16930d=_0x16930d-0xaf;const _0x423c10=a28_0x423c();let _0x1a44a5=_0x423c10[_0x16930d];return _0x1a44a5;}const a28_0x4642e3=a28_0x1a44;(function(_0xd2574c,_0x13e6ff){const _0x2bec56=a28_0x1a44,_0x22e1b2=_0xd2574c();while(!![]){try{const _0x3693a7=-parseInt(_0x2bec56(0xb8))/0x1*(-parseInt(_0x2bec56(0xb5))/0x2)+parseInt(_0x2bec56(0xbc))/0x3+parseInt(_0x2bec56(0xc0))/0x4*(parseInt(_0x2bec56(0xb3))/0x5)+-parseInt(_0x2bec56(0xce))/0x6*(-parseInt(_0x2bec56(0xc5))/0x7)+parseInt(_0x2bec56(0xbe))/0x8*(parseInt(_0x2bec56(0xb6))/0x9)+parseInt(_0x2bec56(0xaf))/0xa*(-parseInt(_0x2bec56(0xb7))/0xb)+-parseInt(_0x2bec56(0xb2))/0xc;if(_0x3693a7===_0x13e6ff)break;else _0x22e1b2['push'](_0x22e1b2['shift']());}catch(_0x3834dd){_0x22e1b2['push'](_0x22e1b2['shift']());}}}(a28_0x423c,0xee3d1));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a28_0x423c(){const _0xd8acf9=['43590108ULaGUD','643285OPGrNO','readLogs','40diDZzg','65691wYqHDu','1958ndQHRR','36871lduVIZ','write','stringify','level','2848515tjXiGs','en-US','1952wbQSUM','forEach','40UPPdeg','clearLogs','details','command','\x20\x20\x20Duration:\x20','427RQNyEW','error','length','message','keys','warn','log','*\x20Logs\x20cleared','show','138702VRPjBs','87430GGqsCg','duration','timestamp'];a28_0x423c=function(){return _0xd8acf9;};return a28_0x423c();}function printLogs(_0x581c8d){const _0x3d7c29=a28_0x1a44;if(_0x581c8d['length']===0x0){console[_0x3d7c29(0xcb)]('*\x20No\x20logs\x20found');return;}console[_0x3d7c29(0xcb)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x581c8d[_0x3d7c29(0xbf)]((_0x5970ca,_0x5e97bd)=>{const _0x48a153=_0x3d7c29,_0x491519=new Date(_0x5970ca[_0x48a153(0xb1)])['toLocaleString'](_0x48a153(0xbd)),_0xc7dae7=_0x5970ca[_0x48a153(0xbb)]==='success'?'√':_0x5970ca['level']===_0x48a153(0xc6)?'×':_0x5970ca[_0x48a153(0xbb)]===_0x48a153(0xca)?'!':'i';console[_0x48a153(0xcb)](_0x5e97bd+0x1+'.\x20'+_0xc7dae7+'\x20['+_0x5970ca[_0x48a153(0xc3)]+']\x20'+_0x5970ca[_0x48a153(0xc8)]),console[_0x48a153(0xcb)]('\x20\x20\x20Time:\x20'+_0x491519),_0x5970ca[_0x48a153(0xb0)]&&console[_0x48a153(0xcb)](_0x48a153(0xc4)+_0x5970ca[_0x48a153(0xb0)]+'ms'),_0x5970ca['details']&&Object[_0x48a153(0xc9)](_0x5970ca[_0x48a153(0xc2)])[_0x48a153(0xc7)]>0x0&&console[_0x48a153(0xcb)]('\x20\x20\x20Details:\x20'+JSON[_0x48a153(0xba)](_0x5970ca[_0x48a153(0xc2)],null,0x2)),console[_0x48a153(0xcb)]('');});}export const logsDefinitions=[{'service':'logs','command':a28_0x4642e3(0xcd),'description':'View\x20command\x20history\x20logs','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3fdb6c){const _0x343b45=a28_0x4642e3;return printLogs(logger[_0x343b45(0xb4)]()),{'ok':!![]};}},{'service':'logs','command':'clear','description':'Clear\x20command\x20history\x20logs','risk':a28_0x4642e3(0xb9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3d53a0){const _0x103930=a28_0x4642e3;return logger[_0x103930(0xc1)](),console['log'](_0x103930(0xcc)),{'ok':!![]};}}];
1
+ function a28_0x1819(_0x380d27,_0x4c2cc9){_0x380d27=_0x380d27-0x12a;const _0x11948=a28_0x1194();let _0x181986=_0x11948[_0x380d27];return _0x181986;}const a28_0x905a20=a28_0x1819;(function(_0x110916,_0x4bc426){const _0x397e9b=a28_0x1819,_0x11e255=_0x110916();while(!![]){try{const _0x518fe0=parseInt(_0x397e9b(0x149))/0x1*(-parseInt(_0x397e9b(0x13e))/0x2)+-parseInt(_0x397e9b(0x143))/0x3*(-parseInt(_0x397e9b(0x12a))/0x4)+parseInt(_0x397e9b(0x12d))/0x5*(parseInt(_0x397e9b(0x12e))/0x6)+-parseInt(_0x397e9b(0x140))/0x7*(parseInt(_0x397e9b(0x12c))/0x8)+-parseInt(_0x397e9b(0x136))/0x9*(parseInt(_0x397e9b(0x135))/0xa)+parseInt(_0x397e9b(0x141))/0xb+-parseInt(_0x397e9b(0x12b))/0xc;if(_0x518fe0===_0x4bc426)break;else _0x11e255['push'](_0x11e255['shift']());}catch(_0x1dc1f3){_0x11e255['push'](_0x11e255['shift']());}}}(a28_0x1194,0xee7f4));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x41b26a){const _0x3ca899=a28_0x1819;if(_0x41b26a['length']===0x0){console[_0x3ca899(0x148)]('*\x20No\x20logs\x20found');return;}console['log']('*\x20'+CLI_DISPLAY_NAME+_0x3ca899(0x145)),_0x41b26a['forEach']((_0x30ed39,_0xc87c8b)=>{const _0x3eec55=_0x3ca899,_0x78a905=new Date(_0x30ed39[_0x3eec55(0x14a)])[_0x3eec55(0x146)](_0x3eec55(0x147)),_0x3fa321=_0x30ed39[_0x3eec55(0x13b)]===_0x3eec55(0x13d)?'√':_0x30ed39[_0x3eec55(0x13b)]===_0x3eec55(0x137)?'×':_0x30ed39['level']===_0x3eec55(0x138)?'!':'i';console[_0x3eec55(0x148)](_0xc87c8b+0x1+'.\x20'+_0x3fa321+'\x20['+_0x30ed39[_0x3eec55(0x14b)]+']\x20'+_0x30ed39[_0x3eec55(0x12f)]),console['log'](_0x3eec55(0x139)+_0x78a905),_0x30ed39[_0x3eec55(0x134)]&&console[_0x3eec55(0x148)]('\x20\x20\x20Duration:\x20'+_0x30ed39['duration']+'ms'),_0x30ed39[_0x3eec55(0x142)]&&Object['keys'](_0x30ed39[_0x3eec55(0x142)])[_0x3eec55(0x132)]>0x0&&console[_0x3eec55(0x148)](_0x3eec55(0x13a)+JSON[_0x3eec55(0x133)](_0x30ed39['details'],null,0x2)),console[_0x3eec55(0x148)]('');});}function a28_0x1194(){const _0x5aa3b1=['19163287bOUEJB','details','335319aJAABd','Clear\x20command\x20history\x20logs','\x20logs:\x0a','toLocaleString','en-US','log','118483DeYzJG','timestamp','command','*\x20Logs\x20cleared','16FrfALK','17842812UhIfjf','8LsZwIP','32005AkJsaJ','1314NPUXHd','message','write','logs','length','stringify','duration','58710eJuCfN','27twNjhq','error','warn','\x20\x20\x20Time:\x20','\x20\x20\x20Details:\x20','level','show','success','2SfdAww','read','6938029jKKQtx'];a28_0x1194=function(){return _0x5aa3b1;};return a28_0x1194();}export const logsDefinitions=[{'service':a28_0x905a20(0x131),'command':a28_0x905a20(0x13c),'description':'View\x20command\x20history\x20logs','risk':a28_0x905a20(0x13f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3dbf8b){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':'logs','command':'clear','description':a28_0x905a20(0x144),'risk':a28_0x905a20(0x130),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x30f304){const _0x43e253=a28_0x905a20;return logger['clearLogs'](),console[_0x43e253(0x148)](_0x43e253(0x14c)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a29_0x4d2786=a29_0x15f5;(function(_0x37cb66,_0x511de5){const _0x1088cb=a29_0x15f5,_0x7acfaf=_0x37cb66();while(!![]){try{const _0x53f880=parseInt(_0x1088cb(0xb4))/0x1+parseInt(_0x1088cb(0x8f))/0x2*(-parseInt(_0x1088cb(0x7c))/0x3)+parseInt(_0x1088cb(0xa7))/0x4+-parseInt(_0x1088cb(0x82))/0x5*(-parseInt(_0x1088cb(0xaa))/0x6)+-parseInt(_0x1088cb(0x97))/0x7+-parseInt(_0x1088cb(0xa2))/0x8*(parseInt(_0x1088cb(0x9d))/0x9)+parseInt(_0x1088cb(0xb5))/0xa;if(_0x53f880===_0x511de5)break;else _0x7acfaf['push'](_0x7acfaf['shift']());}catch(_0x5c47ac){_0x7acfaf['push'](_0x7acfaf['shift']());}}}(a29_0x48ec,0x58ca4));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a29_0x4d2786(0xb0),'type':a29_0x4d2786(0x96),'description':a29_0x4d2786(0x9b)},FUNCTION_NAME_FLAG={'name':a29_0x4d2786(0x85),'type':a29_0x4d2786(0x96),'required':!![],'description':a29_0x4d2786(0xa8)},DESCRIPTION_FLAG={'name':a29_0x4d2786(0x84),'type':'string','description':a29_0x4d2786(0x8d)},SOURCE_SESSION_FLAG={'name':a29_0x4d2786(0xa0),'type':a29_0x4d2786(0x96),'description':a29_0x4d2786(0xb7)};function normalizeFunctionName(_0x241f76){const _0x2cecfc=a29_0x4d2786,_0x5ca39e=String(_0x241f76||'')[_0x2cecfc(0x81)]();if(!_0x5ca39e||!FUNCTION_NAME_PATTERN[_0x2cecfc(0x98)](_0x5ca39e))throw CliErrors[_0x2cecfc(0xa3)](_0x2cecfc(0x77));return _0x5ca39e;}function readScriptFile(_0x19834d){const _0x155283=a29_0x4d2786;if(!_0x19834d)throw CliErrors['validation'](_0x155283(0x8a));if(!existsSync(_0x19834d))throw CliErrors[_0x155283(0xa3)]('File\x20not\x20found:\x20'+_0x19834d);if(!statSync(_0x19834d)[_0x155283(0xaf)]())throw CliErrors[_0x155283(0xa3)](_0x155283(0x9e)+_0x19834d);const _0x3f467a=readFileSync(_0x19834d,_0x155283(0x80));if(!_0x3f467a[_0x155283(0x81)]())throw CliErrors['validation'](_0x155283(0xb1));return _0x3f467a;}function a29_0x15f5(_0x1abe18,_0x4a6e84){_0x1abe18=_0x1abe18-0x77;const _0x48ec19=a29_0x48ec();let _0x15f59c=_0x48ec19[_0x1abe18];return _0x15f59c;}function optionalTrimmed(_0x4dc2ad){const _0x157b9d=a29_0x4d2786,_0x337f53=String(_0x4dc2ad||'')[_0x157b9d(0x81)]();return _0x337f53||undefined;}function summarizeBff(_0x1e3a96){const _0x140464=a29_0x4d2786;return{'id':_0x1e3a96['id'],'appCode':_0x1e3a96[_0x140464(0xa9)],'functionName':_0x1e3a96[_0x140464(0x79)],'description':_0x1e3a96[_0x140464(0x84)],'scriptType':_0x1e3a96[_0x140464(0xab)],'version':_0x1e3a96[_0x140464(0x8e)],'gmtModified':_0x1e3a96[_0x140464(0x83)],'updateTime':_0x1e3a96['updateTime']};}function detailBff(_0x1af4c2){const _0x4386f1=a29_0x4d2786;return{'id':_0x1af4c2['id'],'appCode':_0x1af4c2['appCode'],'functionName':_0x1af4c2[_0x4386f1(0x79)],'description':_0x1af4c2[_0x4386f1(0x84)],'scriptType':_0x1af4c2['scriptType'],'scriptContent':_0x1af4c2['scriptContent']??'','config':_0x1af4c2[_0x4386f1(0xa1)],'version':_0x1af4c2[_0x4386f1(0x8e)],'createUserId':_0x1af4c2[_0x4386f1(0x9f)],'gmtCreate':_0x1af4c2[_0x4386f1(0xb8)],'gmtModified':_0x1af4c2[_0x4386f1(0x83)],'createTime':_0x1af4c2[_0x4386f1(0x7f)],'updateTime':_0x1af4c2[_0x4386f1(0xb6)]};}function buildCreateInput(_0x5833fe){const _0x263a6e=a29_0x4d2786;return{'functionName':normalizeFunctionName(_0x5833fe[_0x263a6e(0xba)](_0x263a6e(0x85))),...optionalTrimmed(_0x5833fe[_0x263a6e(0xba)](_0x263a6e(0x84)))?{'description':optionalTrimmed(_0x5833fe['str']('description'))}:{},'scriptContent':readScriptFile(_0x5833fe[_0x263a6e(0xba)](_0x263a6e(0xb0))),...optionalTrimmed(_0x5833fe[_0x263a6e(0xba)](_0x263a6e(0xa0)))?{'sourceSessionId':optionalTrimmed(_0x5833fe[_0x263a6e(0xba)](_0x263a6e(0xa0)))}:{}};}function buildUpdateInput(_0x39c5bd){const _0x39eca1=a29_0x4d2786,_0x9ab7b6={};optionalTrimmed(_0x39c5bd['str'](_0x39eca1(0x85)))&&(_0x9ab7b6[_0x39eca1(0x79)]=normalizeFunctionName(_0x39c5bd['str']('name')));_0x39c5bd[_0x39eca1(0x9a)](_0x39eca1(0x84))!==undefined&&(_0x9ab7b6[_0x39eca1(0x84)]=_0x39c5bd[_0x39eca1(0xba)](_0x39eca1(0x84)));optionalTrimmed(_0x39c5bd[_0x39eca1(0xba)](_0x39eca1(0xb0)))&&(_0x9ab7b6['scriptContent']=readScriptFile(_0x39c5bd[_0x39eca1(0xba)](_0x39eca1(0xb0))));_0x39c5bd[_0x39eca1(0x9a)](_0x39eca1(0xa0))!==undefined&&(_0x9ab7b6['sourceSessionId']=_0x39c5bd[_0x39eca1(0xba)](_0x39eca1(0xa0)));if(Object[_0x39eca1(0xa6)](_0x9ab7b6)['length']===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x9ab7b6;}function a29_0x48ec(){const _0x3fa526=['Personal\x20BFF\x20script\x20ID','2011941QeXBaI','File\x20is\x20not\x20a\x20regular\x20file:\x20','createUserId','source-session-id','config','8KmAaKo','validation','POST','params','keys','404512uxBXBd','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','appCode','12AiBzkJ','scriptType','body','Show\x20one\x20personal\x20BFF\x20by\x20id','/update','isFile','file','Personal\x20BFF\x20script\x20file\x20is\x20blank.','map','personal-bff','699977trrnnI','4911890UpGevy','updateTime','Optional\x20source\x20RuntimeAgent\x20session\x20id','gmtCreate','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','str','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','length','functionName','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','bool','69SaOYeb','num','build','createTime','utf8','trim','96205VzpUaK','gmtModified','description','name','Created\x20personal\x20BFF\x20','isArray','update','Updated\x20personal\x20BFF\x20','File\x20path\x20is\x20required.','exec','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','Personal\x20BFF\x20description','version','9206lpcHkp','Preview:\x20update\x20personal\x20BFF\x20','Preview:\x20create\x20personal\x20BFF\x20','write','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','read','Update\x20a\x20personal\x20BFF\x20by\x20id','string','4463718kFNYFa','test','/client/runtime-bff/personal/create','flag','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'];a29_0x48ec=function(){return _0x3fa526;};return a29_0x48ec();}function parseExecParams(_0x486e48){const _0x3ac3ff=a29_0x4d2786,_0x3ebda5=parseJsonParams(_0x486e48)??{};if(Array[_0x3ac3ff(0x87)](_0x3ebda5))throw CliErrors['validation']('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x3ebda5;}const personalBffList={'service':'personal-bff','command':'list','description':a29_0x4d2786(0x7a),'risk':a29_0x4d2786(0x94),'flags':[VERBOSE_FLAG],async 'execute'(_0x406bd7){const _0x27b41f=a29_0x4d2786,_0x109cff=await listPersonalBffs(_0x406bd7[_0x27b41f(0xa9)]);return{'ok':!![],'data':{'total':_0x109cff[_0x27b41f(0x78)],'items':_0x406bd7[_0x27b41f(0x7b)]('verbose')?_0x109cff:_0x109cff[_0x27b41f(0xb2)](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':'detail','description':a29_0x4d2786(0xad),'risk':a29_0x4d2786(0x94),'flags':[{...ID_FLAG,'description':a29_0x4d2786(0x9c)}],async 'execute'(_0x26e48a){const _0x2c846b=a29_0x4d2786,_0x96afaf=await getPersonalBff(_0x26e48a[_0x2c846b(0x7d)]('id'),_0x26e48a[_0x2c846b(0xa9)]);return{'ok':!![],'data':detailBff(_0x96afaf)};}},personalBffCreate={'service':a29_0x4d2786(0xb3),'command':'create','description':a29_0x4d2786(0xb9),'risk':a29_0x4d2786(0x92),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x86eb2b){const _0x208c1f=a29_0x4d2786,_0x14321b=buildCreateInput(_0x86eb2b),_0x27b336=await createPersonalBff(_0x86eb2b[_0x208c1f(0xa9)],_0x14321b);return{'ok':!![],'data':detailBff(_0x27b336),'message':_0x208c1f(0x86)+_0x27b336['id']+(_0x27b336['functionName']?'\x20('+_0x27b336[_0x208c1f(0x79)]+')':'')};},async 'dryRun'(_0x4b8440){const _0x8ea17c=a29_0x4d2786,_0x170864=buildCreateInput(_0x4b8440);return dryRun(_0x8ea17c(0xa4),_0x8ea17c(0x99))['body']({'appCode':_0x4b8440[_0x8ea17c(0xa9)],..._0x170864})['description'](_0x8ea17c(0x91)+_0x170864[_0x8ea17c(0x79)])[_0x8ea17c(0x7e)]();}},personalBffUpdate={'service':'personal-bff','command':a29_0x4d2786(0x88),'description':a29_0x4d2786(0x95),'risk':a29_0x4d2786(0x92),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x14c8f9){const _0x447fc4=a29_0x4d2786,_0x1a1a0d=_0x14c8f9[_0x447fc4(0x7d)]('id'),_0x42f352=buildUpdateInput(_0x14c8f9),_0x1099b9=await updatePersonalBff(_0x1a1a0d,_0x14c8f9[_0x447fc4(0xa9)],_0x42f352);return{'ok':!![],'data':detailBff(_0x1099b9),'message':_0x447fc4(0x89)+_0x1099b9['id']+(_0x1099b9[_0x447fc4(0x79)]?'\x20('+_0x1099b9[_0x447fc4(0x79)]+')':'')};},async 'dryRun'(_0xc518f7){const _0x29e76d=a29_0x4d2786,_0x523b76=_0xc518f7[_0x29e76d(0x7d)]('id'),_0x17325e=buildUpdateInput(_0xc518f7);return dryRun(_0x29e76d(0xa4),'/client/runtime-bff/personal/'+_0x523b76+_0x29e76d(0xae))[_0x29e76d(0xac)]({'appCode':_0xc518f7[_0x29e76d(0xa9)],..._0x17325e})[_0x29e76d(0x84)](_0x29e76d(0x90)+_0x523b76)[_0x29e76d(0x7e)]();}},personalBffExec={'service':'personal-bff','command':a29_0x4d2786(0x8b),'description':a29_0x4d2786(0x8c),'risk':'high-risk-write','flags':[{...ID_FLAG,'description':a29_0x4d2786(0x9c)},{...PARAMS_FLAG,'description':a29_0x4d2786(0x93)}],async 'validate'(_0x5db815){const _0x13f043=a29_0x4d2786;parseExecParams(_0x5db815[_0x13f043(0xba)]('params'));},async 'execute'(_0x252681){const _0x447aaa=a29_0x4d2786,_0x3bb9ed=_0x252681[_0x447aaa(0x7d)]('id'),_0xaf6c82=parseExecParams(_0x252681[_0x447aaa(0xba)](_0x447aaa(0xa5))),_0x10b69f=await executePersonalBff(_0x3bb9ed,_0x252681['appCode'],_0xaf6c82);return{'ok':!![],'data':{'result':_0x10b69f},'message':'Executed\x20personal\x20BFF\x20'+_0x3bb9ed};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a29_0x372486=a29_0x5a25;(function(_0x50e0bc,_0x239ae6){const _0xb7db34=a29_0x5a25,_0xcedacb=_0x50e0bc();while(!![]){try{const _0x450af8=parseInt(_0xb7db34(0x19c))/0x1+-parseInt(_0xb7db34(0x1a1))/0x2*(parseInt(_0xb7db34(0x1c3))/0x3)+parseInt(_0xb7db34(0x19d))/0x4*(parseInt(_0xb7db34(0x1c4))/0x5)+parseInt(_0xb7db34(0x1cc))/0x6*(parseInt(_0xb7db34(0x187))/0x7)+-parseInt(_0xb7db34(0x1aa))/0x8+parseInt(_0xb7db34(0x192))/0x9*(-parseInt(_0xb7db34(0x194))/0xa)+parseInt(_0xb7db34(0x1b0))/0xb;if(_0x450af8===_0x239ae6)break;else _0xcedacb['push'](_0xcedacb['shift']());}catch(_0x3fc4a1){_0xcedacb['push'](_0xcedacb['shift']());}}}(a29_0x3021,0x8881b));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':'string','description':a29_0x372486(0x199)},FUNCTION_NAME_FLAG={'name':a29_0x372486(0x1a2),'type':a29_0x372486(0x195),'required':!![],'description':a29_0x372486(0x1a6)},DESCRIPTION_FLAG={'name':a29_0x372486(0x1a8),'type':a29_0x372486(0x195),'description':a29_0x372486(0x18f)},SOURCE_SESSION_FLAG={'name':a29_0x372486(0x191),'type':a29_0x372486(0x195),'description':a29_0x372486(0x18b)};function normalizeFunctionName(_0x4cdcf2){const _0x4fef4a=a29_0x372486,_0x2a5258=String(_0x4cdcf2||'')['trim']();if(!_0x2a5258||!FUNCTION_NAME_PATTERN[_0x4fef4a(0x1c9)](_0x2a5258))throw CliErrors[_0x4fef4a(0x18e)](_0x4fef4a(0x18c));return _0x2a5258;}function readScriptFile(_0x1dc0a4){const _0x3065ab=a29_0x372486;if(!_0x1dc0a4)throw CliErrors['validation'](_0x3065ab(0x1cb));if(!existsSync(_0x1dc0a4))throw CliErrors[_0x3065ab(0x18e)](_0x3065ab(0x190)+_0x1dc0a4);if(!statSync(_0x1dc0a4)[_0x3065ab(0x1c6)]())throw CliErrors[_0x3065ab(0x18e)](_0x3065ab(0x1c0)+_0x1dc0a4);const _0x12f31a=readFileSync(_0x1dc0a4,_0x3065ab(0x1b7));if(!_0x12f31a['trim']())throw CliErrors[_0x3065ab(0x18e)](_0x3065ab(0x19e));return _0x12f31a;}function optionalTrimmed(_0x12c53d){const _0x3f187c=a29_0x372486,_0x54b834=String(_0x12c53d||'')[_0x3f187c(0x196)]();return _0x54b834||undefined;}function a29_0x3021(){const _0x59c9e6=['description','POST','1705328ufKUZG','--params\x20must\x20be\x20a\x20JSON\x20object.','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','/update','Personal\x20BFF\x20script\x20ID','read','11647328ZYSBMy','params','exec','length','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','config','num','utf8','list','gmtCreate','scriptContent','file','Executed\x20personal\x20BFF\x20','scriptType','Created\x20personal\x20BFF\x20','isArray','File\x20is\x20not\x20a\x20regular\x20file:\x20','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','createTime','99543ihQfLI','2357865vJUWGl','version','isFile','bool','detail','test','Preview:\x20update\x20personal\x20BFF\x20','File\x20path\x20is\x20required.','246uxVIPO','build','Show\x20one\x20personal\x20BFF\x20by\x20id','write','create','86632xSQlyn','keys','functionName','body','Optional\x20source\x20RuntimeAgent\x20session\x20id','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','createUserId','validation','Personal\x20BFF\x20description','File\x20not\x20found:\x20','source-session-id','18WaFImD','personal-bff','4048120bZAwxF','string','trim','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','verbose','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','sourceSessionId','flag','506333CEvGtP','4RZPkOD','Personal\x20BFF\x20script\x20file\x20is\x20blank.','str','/client/runtime-bff/personal/','58rSlFqm','name','appCode','/client/runtime-bff/personal/create','gmtModified','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','updateTime'];a29_0x3021=function(){return _0x59c9e6;};return a29_0x3021();}function summarizeBff(_0x30416e){const _0x426976=a29_0x372486;return{'id':_0x30416e['id'],'appCode':_0x30416e['appCode'],'functionName':_0x30416e[_0x426976(0x189)],'description':_0x30416e[_0x426976(0x1a8)],'scriptType':_0x30416e[_0x426976(0x1bd)],'version':_0x30416e[_0x426976(0x1c5)],'gmtModified':_0x30416e[_0x426976(0x1a5)],'updateTime':_0x30416e[_0x426976(0x1a7)]};}function detailBff(_0x3db800){const _0x1e5843=a29_0x372486;return{'id':_0x3db800['id'],'appCode':_0x3db800[_0x1e5843(0x1a3)],'functionName':_0x3db800['functionName'],'description':_0x3db800[_0x1e5843(0x1a8)],'scriptType':_0x3db800[_0x1e5843(0x1bd)],'scriptContent':_0x3db800['scriptContent']??'','config':_0x3db800[_0x1e5843(0x1b5)],'version':_0x3db800[_0x1e5843(0x1c5)],'createUserId':_0x3db800[_0x1e5843(0x18d)],'gmtCreate':_0x3db800[_0x1e5843(0x1b9)],'gmtModified':_0x3db800['gmtModified'],'createTime':_0x3db800[_0x1e5843(0x1c2)],'updateTime':_0x3db800[_0x1e5843(0x1a7)]};}function buildCreateInput(_0x128d55){const _0xd66727=a29_0x372486;return{'functionName':normalizeFunctionName(_0x128d55[_0xd66727(0x19f)]('name')),...optionalTrimmed(_0x128d55[_0xd66727(0x19f)](_0xd66727(0x1a8)))?{'description':optionalTrimmed(_0x128d55[_0xd66727(0x19f)](_0xd66727(0x1a8)))}:{},'scriptContent':readScriptFile(_0x128d55[_0xd66727(0x19f)](_0xd66727(0x1bb))),...optionalTrimmed(_0x128d55['str'](_0xd66727(0x191)))?{'sourceSessionId':optionalTrimmed(_0x128d55['str'](_0xd66727(0x191)))}:{}};}function buildUpdateInput(_0x2ab4f8){const _0xae59dc=a29_0x372486,_0x5e50a2={};optionalTrimmed(_0x2ab4f8[_0xae59dc(0x19f)](_0xae59dc(0x1a2)))&&(_0x5e50a2['functionName']=normalizeFunctionName(_0x2ab4f8[_0xae59dc(0x19f)]('name')));_0x2ab4f8['flag'](_0xae59dc(0x1a8))!==undefined&&(_0x5e50a2[_0xae59dc(0x1a8)]=_0x2ab4f8[_0xae59dc(0x19f)](_0xae59dc(0x1a8)));optionalTrimmed(_0x2ab4f8[_0xae59dc(0x19f)](_0xae59dc(0x1bb)))&&(_0x5e50a2[_0xae59dc(0x1ba)]=readScriptFile(_0x2ab4f8[_0xae59dc(0x19f)](_0xae59dc(0x1bb))));_0x2ab4f8[_0xae59dc(0x19b)](_0xae59dc(0x191))!==undefined&&(_0x5e50a2[_0xae59dc(0x19a)]=_0x2ab4f8[_0xae59dc(0x19f)](_0xae59dc(0x191)));if(Object[_0xae59dc(0x188)](_0x5e50a2)[_0xae59dc(0x1b3)]===0x0)throw CliErrors[_0xae59dc(0x18e)](_0xae59dc(0x197));return _0x5e50a2;}function parseExecParams(_0x49a6ec){const _0x30901f=a29_0x372486,_0x140c9d=parseJsonParams(_0x49a6ec)??{};if(Array[_0x30901f(0x1bf)](_0x140c9d))throw CliErrors[_0x30901f(0x18e)](_0x30901f(0x1ab));return _0x140c9d;}function a29_0x5a25(_0x372f83,_0x2a02aa){_0x372f83=_0x372f83-0x187;const _0x3021c2=a29_0x3021();let _0x5a2511=_0x3021c2[_0x372f83];return _0x5a2511;}const personalBffList={'service':a29_0x372486(0x193),'command':a29_0x372486(0x1b8),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a29_0x372486(0x1af),'flags':[VERBOSE_FLAG],async 'execute'(_0x173937){const _0x5d1f79=a29_0x372486,_0x3cd384=await listPersonalBffs(_0x173937[_0x5d1f79(0x1a3)]);return{'ok':!![],'data':{'total':_0x3cd384[_0x5d1f79(0x1b3)],'items':_0x173937[_0x5d1f79(0x1c7)](_0x5d1f79(0x198))?_0x3cd384:_0x3cd384['map'](summarizeBff)}};}},personalBffDetail={'service':a29_0x372486(0x193),'command':a29_0x372486(0x1c8),'description':a29_0x372486(0x1ce),'risk':a29_0x372486(0x1af),'flags':[{...ID_FLAG,'description':a29_0x372486(0x1ae)}],async 'execute'(_0x2f122c){const _0x1385ef=await getPersonalBff(_0x2f122c['num']('id'),_0x2f122c['appCode']);return{'ok':!![],'data':detailBff(_0x1385ef)};}},personalBffCreate={'service':a29_0x372486(0x193),'command':a29_0x372486(0x1d0),'description':a29_0x372486(0x1ac),'risk':a29_0x372486(0x1cf),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x572e39){const _0x54baa2=a29_0x372486,_0x3a1986=buildCreateInput(_0x572e39),_0x3eaf3c=await createPersonalBff(_0x572e39[_0x54baa2(0x1a3)],_0x3a1986);return{'ok':!![],'data':detailBff(_0x3eaf3c),'message':_0x54baa2(0x1be)+_0x3eaf3c['id']+(_0x3eaf3c[_0x54baa2(0x189)]?'\x20('+_0x3eaf3c[_0x54baa2(0x189)]+')':'')};},async 'dryRun'(_0xdfaa15){const _0x2f3ba5=a29_0x372486,_0x26eea4=buildCreateInput(_0xdfaa15);return dryRun(_0x2f3ba5(0x1a9),_0x2f3ba5(0x1a4))[_0x2f3ba5(0x18a)]({'appCode':_0xdfaa15[_0x2f3ba5(0x1a3)],..._0x26eea4})[_0x2f3ba5(0x1a8)]('Preview:\x20create\x20personal\x20BFF\x20'+_0x26eea4[_0x2f3ba5(0x189)])[_0x2f3ba5(0x1cd)]();}},personalBffUpdate={'service':a29_0x372486(0x193),'command':'update','description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':a29_0x372486(0x1cf),'flags':[{...ID_FLAG,'description':a29_0x372486(0x1ae)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x42aa66){const _0x561277=a29_0x372486,_0x2031e0=_0x42aa66['num']('id'),_0x4277f9=buildUpdateInput(_0x42aa66),_0x861d18=await updatePersonalBff(_0x2031e0,_0x42aa66[_0x561277(0x1a3)],_0x4277f9);return{'ok':!![],'data':detailBff(_0x861d18),'message':'Updated\x20personal\x20BFF\x20'+_0x861d18['id']+(_0x861d18[_0x561277(0x189)]?'\x20('+_0x861d18['functionName']+')':'')};},async 'dryRun'(_0x2c14e9){const _0x5cb3f4=a29_0x372486,_0x44e8d1=_0x2c14e9['num']('id'),_0x221309=buildUpdateInput(_0x2c14e9);return dryRun(_0x5cb3f4(0x1a9),_0x5cb3f4(0x1a0)+_0x44e8d1+_0x5cb3f4(0x1ad))[_0x5cb3f4(0x18a)]({'appCode':_0x2c14e9[_0x5cb3f4(0x1a3)],..._0x221309})[_0x5cb3f4(0x1a8)](_0x5cb3f4(0x1ca)+_0x44e8d1)['build']();}},personalBffExec={'service':a29_0x372486(0x193),'command':a29_0x372486(0x1b2),'description':a29_0x372486(0x1c1),'risk':'high-risk-write','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a29_0x372486(0x1b4)}],async 'validate'(_0x48c74e){const _0xa87315=a29_0x372486;parseExecParams(_0x48c74e['str'](_0xa87315(0x1b1)));},async 'execute'(_0x1b6d43){const _0x1b4d1a=a29_0x372486,_0x23d98a=_0x1b6d43[_0x1b4d1a(0x1b6)]('id'),_0x2e893c=parseExecParams(_0x1b6d43[_0x1b4d1a(0x19f)](_0x1b4d1a(0x1b1))),_0x36964c=await executePersonalBff(_0x23d98a,_0x1b6d43[_0x1b4d1a(0x1a3)],_0x2e893c);return{'ok':!![],'data':{'result':_0x36964c},'message':_0x1b4d1a(0x1bc)+_0x23d98a};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a30_0x5d6417=a30_0x2107;(function(_0x3adc81,_0x4bd747){const _0x455a72=a30_0x2107,_0x421585=_0x3adc81();while(!![]){try{const _0x37957b=parseInt(_0x455a72(0x85))/0x1+parseInt(_0x455a72(0x6b))/0x2+parseInt(_0x455a72(0x71))/0x3*(-parseInt(_0x455a72(0x69))/0x4)+parseInt(_0x455a72(0x88))/0x5+parseInt(_0x455a72(0x73))/0x6+parseInt(_0x455a72(0x83))/0x7*(parseInt(_0x455a72(0x81))/0x8)+-parseInt(_0x455a72(0x84))/0x9;if(_0x37957b===_0x4bd747)break;else _0x421585['push'](_0x421585['shift']());}catch(_0x38cd42){_0x421585['push'](_0x421585['shift']());}}}(a30_0x1044,0x9adb0));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';function a30_0x1044(){const _0x363123=['API\x20Documentation','map','values','2608688kfEAlG','read','21ejUeYn','7928397yGtfVf','698400YWuPqo','Artifacts','push','2247365QyFzJv','Knowledge\x20Base','Authentication','\x20\x20[high-risk-write]','CLI\x20Built-in\x20Skill','list','Diagnostics','Logs','11796NkDFHO','BFF\x20Scripts','963860kktNbP','Workspace','Self\x20Update','service','command','Skills','1164VpjSdC','from','308232oAwTaH','write','description','Instant\x20API','show','isSingleCommand','install','get','SQL\x20Queries','set','Schema'];a30_0x1044=function(){return _0x363123;};return a30_0x1044();}import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';function a30_0x2107(_0x174d1,_0x5df6aa){_0x174d1=_0x174d1-0x64;const _0x104418=a30_0x1044();let _0x210791=_0x104418[_0x174d1];return _0x210791;}import{apiDocDefinitions}from'../commands/api-doc/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x5712c4){const _0x49366f=a30_0x2107;for(const _0x3ec237 of _0x5712c4){definitions[_0x49366f(0x7c)](_0x3ec237['service']+':'+_0x3ec237[_0x49366f(0x6f)],_0x3ec237);let _0x74b326=serviceGroups[_0x49366f(0x7a)](_0x3ec237['service']);!_0x74b326&&(_0x74b326=[],serviceGroups[_0x49366f(0x7c)](_0x3ec237[_0x49366f(0x6e)],_0x74b326)),_0x74b326['push'](_0x3ec237);}}function registerService(_0x1494de,_0x244870,_0x5cd95d){const _0x24c634=a30_0x2107;registerDefinitions(_0x244870);const _0x36b753=_0x46f520=>_0x46f520===_0x24c634(0x82)?'':_0x46f520===_0x24c634(0x74)?'\x20\x20[write]':_0x24c634(0x64),_0x1b895b={'service':_0x244870[0x0]['service'],'label':_0x1494de,'commands':_0x244870[_0x24c634(0x7f)](_0x3e06ed=>({'command':_0x3e06ed[_0x24c634(0x6f)],'description':_0x3e06ed[_0x24c634(0x75)],'tag':_0x36b753(_0x3e06ed['risk'])})),'defaultCommand':_0x5cd95d?.['defaultCommand']??(_0x5cd95d?.['isSingleCommand']?_0x244870[0x0][_0x24c634(0x6f)]:undefined),'isSingleCommand':_0x5cd95d?.[_0x24c634(0x78)]};serviceRegistry[_0x24c634(0x87)](_0x1b895b),serviceByName['set'](_0x1b895b[_0x24c634(0x6e)],_0x1b895b);}registerService(a30_0x5d6417(0x8a),authDefinitions,{'defaultCommand':'login'}),registerService(a30_0x5d6417(0x7e),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a30_0x5d6417(0x76),dataDefinitions),registerService(a30_0x5d6417(0x7b),sqlDefinitions),registerService(a30_0x5d6417(0x6a),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService(a30_0x5d6417(0x86),artifactDefinitions),registerService(a30_0x5d6417(0x89),kbDefinitions),registerService('App\x20Management',appDefinitions,{'defaultCommand':a30_0x5d6417(0x66)}),registerService(a30_0x5d6417(0x6c),workspaceDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a30_0x5d6417(0x66)}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a30_0x5d6417(0x66)}),registerService(a30_0x5d6417(0x70),skillDefinitions,{'defaultCommand':a30_0x5d6417(0x79)}),registerService(a30_0x5d6417(0x65),cliSkillDefinitions,{'defaultCommand':a30_0x5d6417(0x79)}),registerService(a30_0x5d6417(0x6d),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a30_0x5d6417(0x67),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a30_0x5d6417(0x7d),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a30_0x5d6417(0x68),logsDefinitions,{'defaultCommand':a30_0x5d6417(0x77)});export function findDefinition(_0x550cfb,_0x5c7674){const _0x25b8c2=a30_0x5d6417;return definitions[_0x25b8c2(0x7a)](_0x550cfb+':'+_0x5c7674);}export function isKnownService(_0xd3105e){return serviceByName['has'](_0xd3105e);}export function getServiceEntry(_0x46742e){const _0x48dc42=a30_0x5d6417;return serviceByName[_0x48dc42(0x7a)](_0x46742e);}export function getAllDefinitions(){const _0x1ab620=a30_0x5d6417;return Array[_0x1ab620(0x72)](definitions[_0x1ab620(0x80)]());}
1
+ const a30_0x127f45=a30_0x51eb;(function(_0x572789,_0x893773){const _0x5c8656=a30_0x51eb,_0x15e6dd=_0x572789();while(!![]){try{const _0x4f5ee9=-parseInt(_0x5c8656(0x7b))/0x1*(parseInt(_0x5c8656(0x9e))/0x2)+-parseInt(_0x5c8656(0x7f))/0x3*(-parseInt(_0x5c8656(0x8e))/0x4)+-parseInt(_0x5c8656(0x8b))/0x5*(-parseInt(_0x5c8656(0x9b))/0x6)+parseInt(_0x5c8656(0x9f))/0x7+parseInt(_0x5c8656(0x81))/0x8*(-parseInt(_0x5c8656(0x7a))/0x9)+parseInt(_0x5c8656(0x8d))/0xa*(-parseInt(_0x5c8656(0x83))/0xb)+parseInt(_0x5c8656(0x92))/0xc;if(_0x4f5ee9===_0x893773)break;else _0x15e6dd['push'](_0x15e6dd['shift']());}catch(_0x5805c2){_0x15e6dd['push'](_0x15e6dd['shift']());}}}(a30_0x1405,0x73093));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';export const serviceRegistry=[];function a30_0x1405(){const _0x283cc5=['3wcXqWf','Instant\x20API','1784EfADwy','login','528JhUNkM','Logs','has','Knowledge\x20Base','Workspace','map','install','run','5vmLBzi','Self\x20Update','195280lglQra','2749536vAwPuv','Skills','risk','get','4441212myTiMv','Configuration','isSingleCommand','show','write','Authentication','BFF\x20Scripts','API\x20Documentation','Schema','335820cYdtzM','from','read','248yEOHhr','6198563wKlJHs','list','set','CLI\x20Built-in\x20Skill','Datasets','SQL\x20Queries','push','Artifacts','command','App\x20Management','service','defaultCommand','2475RfrAHM','4267KcUHqB','\x20\x20[write]','Service\x20Tree','Diagnostics'];a30_0x1405=function(){return _0x283cc5;};return a30_0x1405();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x4d20d8){const _0x23611c=a30_0x51eb;for(const _0x284a78 of _0x4d20d8){definitions[_0x23611c(0xa1)](_0x284a78[_0x23611c(0x78)]+':'+_0x284a78[_0x23611c(0x76)],_0x284a78);let _0x1c652a=serviceGroups[_0x23611c(0x91)](_0x284a78[_0x23611c(0x78)]);!_0x1c652a&&(_0x1c652a=[],serviceGroups[_0x23611c(0xa1)](_0x284a78[_0x23611c(0x78)],_0x1c652a)),_0x1c652a[_0x23611c(0xa5)](_0x284a78);}}function a30_0x51eb(_0x455446,_0x2699d8){_0x455446=_0x455446-0x76;const _0x140591=a30_0x1405();let _0x51ebff=_0x140591[_0x455446];return _0x51ebff;}function registerService(_0x745d57,_0x119124,_0x33df1c){const _0x890ce5=a30_0x51eb;registerDefinitions(_0x119124);const _0x3e31dc=_0x102ffd=>_0x102ffd===_0x890ce5(0x9d)?'':_0x102ffd===_0x890ce5(0x96)?_0x890ce5(0x7c):'\x20\x20[high-risk-write]',_0x239db8={'service':_0x119124[0x0][_0x890ce5(0x78)],'label':_0x745d57,'commands':_0x119124[_0x890ce5(0x88)](_0x47d4b9=>({'command':_0x47d4b9[_0x890ce5(0x76)],'description':_0x47d4b9['description'],'tag':_0x3e31dc(_0x47d4b9[_0x890ce5(0x90)])})),'defaultCommand':_0x33df1c?.[_0x890ce5(0x79)]??(_0x33df1c?.[_0x890ce5(0x94)]?_0x119124[0x0][_0x890ce5(0x76)]:undefined),'isSingleCommand':_0x33df1c?.[_0x890ce5(0x94)]};serviceRegistry['push'](_0x239db8),serviceByName[_0x890ce5(0xa1)](_0x239db8['service'],_0x239db8);}registerService(a30_0x127f45(0x97),authDefinitions,{'defaultCommand':a30_0x127f45(0x82)}),registerService(a30_0x127f45(0x99),apiDocDefinitions),registerService(a30_0x127f45(0xa3),datasetDefinitions),registerService(a30_0x127f45(0x80),dataDefinitions),registerService(a30_0x127f45(0xa4),sqlDefinitions),registerService(a30_0x127f45(0x98),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService(a30_0x127f45(0xa6),artifactDefinitions),registerService(a30_0x127f45(0x86),kbDefinitions),registerService(a30_0x127f45(0x77),appDefinitions,{'defaultCommand':a30_0x127f45(0xa0)}),registerService(a30_0x127f45(0x87),workspaceDefinitions),registerService(a30_0x127f45(0x93),configDefinitions,{'defaultCommand':a30_0x127f45(0xa0)}),registerService(a30_0x127f45(0x7d),serviceDefinitions,{'defaultCommand':'list'}),registerService(a30_0x127f45(0x8f),skillDefinitions,{'defaultCommand':'install'}),registerService(a30_0x127f45(0xa2),cliSkillDefinitions,{'defaultCommand':a30_0x127f45(0x89)}),registerService(a30_0x127f45(0x8c),[updateDefinition],{'defaultCommand':a30_0x127f45(0x8a),'isSingleCommand':!![]}),registerService(a30_0x127f45(0x7e),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a30_0x127f45(0x9a),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a30_0x127f45(0x84),logsDefinitions,{'defaultCommand':a30_0x127f45(0x95)});export function findDefinition(_0x849afa,_0x1d8382){const _0x1ebd52=a30_0x127f45;return definitions[_0x1ebd52(0x91)](_0x849afa+':'+_0x1d8382);}export function isKnownService(_0x3c2387){const _0x12614a=a30_0x127f45;return serviceByName[_0x12614a(0x85)](_0x3c2387);}export function getServiceEntry(_0x13380d){const _0x1f36cc=a30_0x127f45;return serviceByName[_0x1f36cc(0x91)](_0x13380d);}export function getAllDefinitions(){const _0x452b20=a30_0x127f45;return Array[_0x452b20(0x9c)](definitions['values']());}
@@ -1 +1 @@
1
- const a31_0x5abed2=a31_0x28ce;(function(_0x13a956,_0x38c49b){const _0x38cb06=a31_0x28ce,_0x599a4a=_0x13a956();while(!![]){try{const _0x542050=parseInt(_0x38cb06(0x10c))/0x1*(-parseInt(_0x38cb06(0x110))/0x2)+-parseInt(_0x38cb06(0x10e))/0x3+-parseInt(_0x38cb06(0x10a))/0x4+-parseInt(_0x38cb06(0x111))/0x5+-parseInt(_0x38cb06(0x112))/0x6+-parseInt(_0x38cb06(0x10f))/0x7+parseInt(_0x38cb06(0x10d))/0x8*(parseInt(_0x38cb06(0x108))/0x9);if(_0x542050===_0x38c49b)break;else _0x599a4a['push'](_0x599a4a['shift']());}catch(_0x6c2ce4){_0x599a4a['push'](_0x599a4a['shift']());}}}(a31_0x2af9,0x1c154));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x33845b){const _0x4b9f17=await buildSchemaPayload();return{'ok':!![],'data':_0x4b9f17};}function a31_0x28ce(_0x3fcf43,_0x5abbe1){_0x3fcf43=_0x3fcf43-0x108;const _0x2af918=a31_0x2af9();let _0x28cec5=_0x2af918[_0x3fcf43];return _0x28cec5;}export const schemaDefinition={'service':'schema','command':a31_0x5abed2(0x109),'description':a31_0x5abed2(0x10b),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a31_0x2af9(){const _0x3295ab=['189218qbEARG','373200yzpqUy','1359882hGYemA','162MKbpPo','export','532612THcafF','Export\x20machine-readable\x20command\x20schema\x20(JSON)','2thvlZO','470416RIgkFj','675156RTloVj','662886mBVhpO'];a31_0x2af9=function(){return _0x3295ab;};return a31_0x2af9();}
1
+ function a31_0x48e3(){const _0xfecad4=['387743pNXVAV','schema','6744wEDpsG','2591451dsNwcI','12nXPZeZ','300432KuDoVW','907403FSJDPv','807EPLKje','6eHDAtB','696OmZwDx','6596968aCxHjC','891585bvgGYG','Export\x20machine-readable\x20command\x20schema\x20(JSON)','10aDoJCX','export'];a31_0x48e3=function(){return _0xfecad4;};return a31_0x48e3();}const a31_0x2a6560=a31_0x571a;function a31_0x571a(_0x1c8213,_0x5e4460){_0x1c8213=_0x1c8213-0x171;const _0x48e366=a31_0x48e3();let _0x571adf=_0x48e366[_0x1c8213];return _0x571adf;}(function(_0x4cd98a,_0x258b2f){const _0x3e43a3=a31_0x571a,_0x2f26ed=_0x4cd98a();while(!![]){try{const _0x6791b4=-parseInt(_0x3e43a3(0x17d))/0x1+parseInt(_0x3e43a3(0x17f))/0x2*(parseInt(_0x3e43a3(0x175))/0x3)+parseInt(_0x3e43a3(0x172))/0x4*(-parseInt(_0x3e43a3(0x179))/0x5)+parseInt(_0x3e43a3(0x176))/0x6*(parseInt(_0x3e43a3(0x174))/0x7)+-parseInt(_0x3e43a3(0x178))/0x8+-parseInt(_0x3e43a3(0x171))/0x9*(parseInt(_0x3e43a3(0x17b))/0xa)+-parseInt(_0x3e43a3(0x173))/0xb*(-parseInt(_0x3e43a3(0x177))/0xc);if(_0x6791b4===_0x258b2f)break;else _0x2f26ed['push'](_0x2f26ed['shift']());}catch(_0x5d2b4d){_0x2f26ed['push'](_0x2f26ed['shift']());}}}(a31_0x48e3,0x8ef43));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x56289b){const _0x58fd9e=await buildSchemaPayload();return{'ok':!![],'data':_0x58fd9e};}export const schemaDefinition={'service':a31_0x2a6560(0x17e),'command':a31_0x2a6560(0x17c),'description':a31_0x2a6560(0x17a),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- (function(_0x143b6e,_0x3a0805){const _0x51c4b8=a32_0x5eac,_0x379421=_0x143b6e();while(!![]){try{const _0x46513e=parseInt(_0x51c4b8(0x185))/0x1*(parseInt(_0x51c4b8(0x15f))/0x2)+-parseInt(_0x51c4b8(0x189))/0x3*(parseInt(_0x51c4b8(0x18d))/0x4)+parseInt(_0x51c4b8(0x1ab))/0x5+-parseInt(_0x51c4b8(0x1a2))/0x6+parseInt(_0x51c4b8(0x186))/0x7*(parseInt(_0x51c4b8(0x15b))/0x8)+-parseInt(_0x51c4b8(0x14e))/0x9+parseInt(_0x51c4b8(0x1ac))/0xa*(-parseInt(_0x51c4b8(0x1a4))/0xb);if(_0x46513e===_0x3a0805)break;else _0x379421['push'](_0x379421['shift']());}catch(_0x4ce787){_0x379421['push'](_0x379421['shift']());}}}(a32_0x9371,0xdd842));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x6289dd,_0xdadf7f){const _0x5e38f9=a32_0x5eac,_0x29d3cd=listLocalServiceTrees();let _0x5109ed;for(const _0x34ccef of _0x29d3cd){const _0x3540c6=matchServiceTreeCommand(_0x34ccef,_0x6289dd);if(!_0x3540c6)continue;(!_0x5109ed||_0x3540c6[_0x5e38f9(0x18b)][_0x5e38f9(0x181)][_0x5e38f9(0x18e)]>_0x5109ed['command'][_0x5e38f9(0x181)][_0x5e38f9(0x18e)])&&(_0x5109ed={'tree':_0x34ccef,'command':_0x3540c6[_0x5e38f9(0x18b)],'remainingArgs':_0x3540c6[_0x5e38f9(0x19b)]});}if(!_0x5109ed)return undefined;const _0x349b2f={..._0xdadf7f};return applyAppBinding(_0x5109ed[_0x5e38f9(0x172)],_0x5109ed['command'],_0x349b2f),{'definition':buildDynamicCommandDefinition(_0x5109ed['tree'],_0x5109ed[_0x5e38f9(0x18b)]),'args':_0x5109ed[_0x5e38f9(0x19b)],'flags':_0x349b2f,'tree':_0x5109ed[_0x5e38f9(0x172)],'command':_0x5109ed['command']};}export function generateDynamicServiceHelp(_0x116519){const _0x8817ee=a32_0x5eac,_0x90cd39=listLocalServiceTrees()[_0x8817ee(0x17a)](_0x2b12f1=>_0x2b12f1[_0x8817ee(0x177)][_0x8817ee(0x17f)]===_0x116519);if(!_0x90cd39)return undefined;const _0x5ef229=[CLI_BIN_NAME+'\x20'+_0x116519+'\x20<command>\x20[flags]','',_0x90cd39['service'][_0x8817ee(0x187)]||_0x116519,_0x90cd39[_0x8817ee(0x177)][_0x8817ee(0x1a0)]?'\x20\x20'+_0x90cd39['service']['description']:'','',_0x8817ee(0x18a),..._0x90cd39[_0x8817ee(0x193)][_0x8817ee(0x168)](_0x5136d6=>{const _0x2c7379=_0x8817ee,_0x3a85e3=_0x5136d6[_0x2c7379(0x181)][_0x2c7379(0x153)](0x1)['join']('\x20'),_0x21b3ae=_0x5136d6['risk']===_0x2c7379(0x19d)?'':'\x20['+_0x5136d6[_0x2c7379(0x154)]+']';return'\x20\x20'+_0x3a85e3[_0x2c7379(0x159)](0x18)+'\x20'+(_0x5136d6[_0x2c7379(0x1a0)]||'')+_0x21b3ae;}),'',_0x8817ee(0x179)+CLI_BIN_NAME+_0x8817ee(0x184)+_0x116519+_0x8817ee(0x151)][_0x8817ee(0x17e)](Boolean);return _0x5ef229[_0x8817ee(0x15c)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x6fd830=>{const _0x490d1a=a32_0x5eac,_0x335a80=_0x6fd830[_0x490d1a(0x15a)];return{'service':_0x335a80[_0x490d1a(0x177)][_0x490d1a(0x17f)],'label':_0x335a80[_0x490d1a(0x177)][_0x490d1a(0x187)]||_0x335a80['service'][_0x490d1a(0x17f)],'commands':_0x335a80[_0x490d1a(0x193)][_0x490d1a(0x168)](_0x3857a2=>({'command':dynamicCommandName(_0x3857a2),'description':_0x3857a2['description']||_0x490d1a(0x1a8)+_0x3857a2[_0x490d1a(0x14d)],'tag':riskTag(_0x3857a2[_0x490d1a(0x154)])}))};});}export function getDynamicServiceEntry(_0xfe4279){const _0x3f901f=a32_0x5eac;return listDynamicServiceEntries()[_0x3f901f(0x17a)](_0x3ce6af=>_0x3ce6af[_0x3f901f(0x177)]===_0xfe4279);}export function listDynamicServiceDefinitions(_0x37a412){const _0x40d4a6=a32_0x5eac;return listLocalServiceTrees()[_0x40d4a6(0x17e)](_0x7d17fd=>!_0x37a412||_0x7d17fd['service'][_0x40d4a6(0x17f)]===_0x37a412)[_0x40d4a6(0x14c)](_0x1e5b59=>_0x1e5b59[_0x40d4a6(0x193)]['map'](_0x1e0778=>buildDynamicCommandDefinition(_0x1e5b59,_0x1e0778)));}export function getDynamicServiceDefinitions(_0x44f5dd){const _0x379d57=listDynamicServiceDefinitions(_0x44f5dd);return _0x379d57['length']>0x0?_0x379d57:undefined;}export function findDynamicServiceDefinition(_0x38a5bf,_0x1c55ca){const _0x2c472c=a32_0x5eac;return listDynamicServiceDefinitions(_0x38a5bf)[_0x2c472c(0x17a)](_0x52fc14=>_0x52fc14[_0x2c472c(0x18b)]===_0x1c55ca);}export function buildDynamicCommandDefinition(_0x5361cc,_0x1f513c){const _0x3efc37=a32_0x5eac;return{'service':_0x5361cc[_0x3efc37(0x177)][_0x3efc37(0x17f)],'command':dynamicCommandName(_0x1f513c),'description':_0x1f513c[_0x3efc37(0x1a0)]||'Run\x20service\x20command\x20'+_0x1f513c[_0x3efc37(0x14d)],'risk':_0x1f513c[_0x3efc37(0x154)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x1f513c['args'][_0x3efc37(0x168)](_0x4e7397=>({'name':_0x4e7397[_0x3efc37(0x187)],'description':_0x4e7397[_0x3efc37(0x1a0)]||_0x4e7397['name'],'required':_0x4e7397[_0x3efc37(0x1a7)]})),'flags':_0x1f513c[_0x3efc37(0x1a5)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x1f513c),async 'dryRun'(_0x3522b3){const _0x4ca708=_0x3efc37,_0x264f7e=await compilePlan(_0x1f513c,_0x3522b3);return{'method':_0x4ca708(0x173),'url':_0x1f513c[_0x4ca708(0x14d)],'body':{'target':targetPreview(_0x264f7e),'params':_0x264f7e['params']},'description':_0x4ca708(0x14b)+_0x1f513c[_0x4ca708(0x14d)]};},async 'execute'(_0x2b68b9){const _0x4c6aa9=_0x3efc37,_0x523a06=await compilePlan(_0x1f513c,_0x2b68b9),_0xa5d3d6=Date['now'](),_0x5bcc2e=await executePlan(_0x523a06,_0x1f513c,_0x2b68b9),_0x308a2d=Date[_0x4c6aa9(0x164)]()-_0xa5d3d6;return{'ok':!![],'data':{'service':_0x5361cc['service'],'command':_0x1f513c[_0x4c6aa9(0x14d)],'target':targetPreview(_0x523a06),'result':_0x5bcc2e,'elapsed':_0x308a2d},'message':_0x4c6aa9(0x16c)+_0x1f513c[_0x4c6aa9(0x14d)]+'\x20completed\x20in\x20'+_0x308a2d+'ms'};}};}function dynamicCommandName(_0x5606e1){const _0x19b056=a32_0x5eac;return _0x5606e1[_0x19b056(0x181)]['slice'](0x1)[_0x19b056(0x15c)]('\x20');}function riskTag(_0x1f7e28){const _0x10bf52=a32_0x5eac;return _0x1f7e28===_0x10bf52(0x19d)?'':_0x10bf52(0x165)+_0x1f7e28+']';}function flagToCommandFlag(_0xf61efa){const _0x2265ba=a32_0x5eac;return{'name':_0xf61efa[_0x2265ba(0x15d)],'type':_0xf61efa[_0x2265ba(0x152)]==='json'?_0x2265ba(0x174):_0xf61efa[_0x2265ba(0x152)],'description':_0xf61efa[_0x2265ba(0x1a0)]||_0xf61efa[_0x2265ba(0x187)],'required':_0xf61efa[_0x2265ba(0x1a7)],'default':isPrimitiveFlagDefault(_0xf61efa[_0x2265ba(0x162)])?_0xf61efa[_0x2265ba(0x162)]:undefined,'enum':_0xf61efa[_0x2265ba(0x18f)]};}async function compilePlan(_0x42ca9e,_0x3345e2){return compileServiceTreeCommand(_0x42ca9e,{'flags':_0x3345e2['rawFlags'],'args':_0x3345e2['args'],'context':await buildServiceContext(_0x42ca9e,_0x3345e2)});}async function buildServiceContext(_0x3aa514,_0x32ff4e){const _0x3a151f=a32_0x5eac,_0x590094={'appCode':_0x32ff4e[_0x3a151f(0x16b)],'env':_0x32ff4e[_0x3a151f(0x160)],'envName':_0x32ff4e[_0x3a151f(0x160)]};if(!usesRuntimeContext(_0x3aa514))return _0x590094;const _0x57b5ef=await getLoginUserInfo(),_0x2f99f2=pickFirst(_0x57b5ef[_0x3a151f(0x1a1)],_0x57b5ef['id']);return{..._0x590094,'user':_0x57b5ef,'userId':_0x2f99f2,'id':_0x57b5ef['id'],'username':pickFirst(_0x57b5ef['username'],_0x57b5ef['userName'],_0x57b5ef[_0x3a151f(0x190)]),'userName':_0x57b5ef[_0x3a151f(0x175)],'nickname':pickFirst(_0x57b5ef[_0x3a151f(0x169)],_0x57b5ef[_0x3a151f(0x155)]),'nickName':_0x57b5ef['nickName'],'tenantCode':_0x57b5ef[_0x3a151f(0x17d)],'employeeId':_0x57b5ef[_0x3a151f(0x195)]};}function usesRuntimeContext(_0x105865){const _0x4c86d0=a32_0x5eac;return _0x105865[_0x4c86d0(0x19e)][_0x4c86d0(0x194)](_0x3e4338=>typeof _0x3e4338[_0x4c86d0(0x183)]===_0x4c86d0(0x174)&&(_0x3e4338[_0x4c86d0(0x183)][_0x4c86d0(0x166)](_0x4c86d0(0x17c))||_0x3e4338[_0x4c86d0(0x183)][_0x4c86d0(0x166)](_0x4c86d0(0x1aa))));}function pickFirst(..._0x35eb5d){const _0x26356e=a32_0x5eac;return _0x35eb5d[_0x26356e(0x17a)](_0x1d9456=>_0x1d9456!==undefined&&_0x1d9456!==null);}async function executePlan(_0x2a5426,_0x512db2,_0x221833){const _0xf268ff=a32_0x5eac;if(_0x2a5426[_0xf268ff(0x1a9)]==='data'){const _0x100f20=await resolveDatasetCode(_0x2a5426,_0x512db2,_0x221833);return executeData(_0x100f20,_0x2a5426[_0xf268ff(0x18b)],_0x2a5426[_0xf268ff(0x16f)]);}if(_0x2a5426['kind']===_0xf268ff(0x198)){if(!_0x2a5426[_0xf268ff(0x167)])throw CliErrors[_0xf268ff(0x188)](_0xf268ff(0x16c)+_0x512db2[_0xf268ff(0x14d)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x2a5426[_0xf268ff(0x167)],normalizeScalarParams(_0x2a5426['params']));}if(_0x2a5426[_0xf268ff(0x1a9)]==='bff'){const _0xce11aa=_0x2a5426[_0xf268ff(0x161)]||_0x2a5426[_0xf268ff(0x18c)]||(_0x2a5426['bffId']==null?'':String(_0x2a5426['bffId']));if(!_0xce11aa)throw CliErrors[_0xf268ff(0x188)]('Service\x20command\x20'+_0x512db2[_0xf268ff(0x14d)]+_0xf268ff(0x182));return executeSdkBff(_0xce11aa,_0x2a5426[_0xf268ff(0x16f)]);}throw CliErrors[_0xf268ff(0x188)](_0xf268ff(0x158)+_0x2a5426[_0xf268ff(0x1a9)]);}async function resolveDatasetCode(_0x336122,_0x43ae4f,_0x20bbba){const _0x35f30b=a32_0x5eac;if(_0x336122[_0x35f30b(0x176)])return _0x336122['datasetCode'];if(!_0x336122['datatable'])throw CliErrors[_0x35f30b(0x188)]('Service\x20command\x20'+_0x43ae4f[_0x35f30b(0x14d)]+_0x35f30b(0x1af));const _0x1f81a6=await listDatasets(_0x20bbba[_0x35f30b(0x16b)]),_0x5c0d8a=_0x1f81a6[_0x35f30b(0x17a)](_0x124fad=>_0x124fad['dbtableConfig']?.[_0x35f30b(0x17b)]===_0x336122[_0x35f30b(0x16d)]);if(!_0x5c0d8a?.[_0x35f30b(0x17f)])throw CliErrors[_0x35f30b(0x188)](_0x35f30b(0x16e)+_0x336122[_0x35f30b(0x16d)]+_0x35f30b(0x14f)+_0x20bbba[_0x35f30b(0x16b)]+'.',_0x35f30b(0x19c));return _0x5c0d8a['code'];}function applyAppBinding(_0xed8c38,_0x54d323,_0x4b36a7){const _0x27df34=a32_0x5eac,_0x4d3f37=_0x54d323[_0x27df34(0x180)]['appRef'];if(!_0x4d3f37)return;const _0x559896=_0xed8c38['appBindings'][_0x4d3f37];if(!_0x559896)throw CliErrors[_0x27df34(0x188)]('Unknown\x20appRef\x20\x22'+_0x4d3f37+'\x22\x20in\x20service\x20command\x20'+_0x54d323['cliPath']+'.',_0x27df34(0x150));const _0x3111ce=_0x559896[_0x27df34(0x196)]||_0x559896[_0x27df34(0x16b)];_0x3111ce&&!hasText(_0x4b36a7[_0x27df34(0x196)])&&(_0x4b36a7[_0x27df34(0x196)]=_0x3111ce),_0x559896[_0x27df34(0x197)]&&!hasText(_0x4b36a7[_0x27df34(0x197)])&&!hasText(_0x4b36a7[_0x27df34(0x196)])&&(_0x4b36a7['app']=_0x559896[_0x27df34(0x197)]),_0x559896['env']&&!hasText(_0x4b36a7[_0x27df34(0x19f)])&&(_0x4b36a7[_0x27df34(0x19f)]=_0x559896[_0x27df34(0x19f)]);}function a32_0x5eac(_0x326299,_0x5271f9){_0x326299=_0x326299-0x14b;const _0x9371ce=a32_0x9371();let _0x5eacd8=_0x9371ce[_0x326299];return _0x5eacd8;}function a32_0x9371(){const _0x15f9d0=['446EeFpHW','envName','scriptName','default','operator','now','\x20\x20[','startsWith','sqlCode','map','nickname','\x20\x20\x20\x20datatable:\x20','appCode','Service\x20command\x20','datatable','Cannot\x20resolve\x20datatable\x20\x22','params','\x20\x20SERVICE\x20TREE\x20TARGET','const','tree','SERVICE_TREE','string','userName','datasetCode','service','\x20\x20\x20\x20datasetCode:\x20','Use\x20`','find','tableName','context.','tenantCode','filter','code','target','fullPath','\x20requires\x20target.scriptName.','source','\x20service\x20detail\x20--service\x20','6678rmmyYs','126049xsZTBw','name','validation','445371wrmEps','Commands:','command','bffCode','16VaoEmB','length','enum','loginName','number','\x20\x20\x20\x20sqlCode:\x20','commands','some','employeeId','appcode','app','sql','push','appRef','remainingArgs','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','read','mapTo','env','description','userId','6431142QeQgwi','trim','600061AIeFzz','flags','\x20\x20\x20\x20scriptName:\x20','required','Run\x20service\x20command\x20','kind','ctx.','2292270xiWAhU','30RyQJhC','\x20\x20MAP\x20TO','fromEntries','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','Preview\x20dynamic\x20service\x20command:\x20','flatMap','cliPath','4081167JREomG','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','`\x20to\x20inspect\x20the\x20manifest.','type','slice','risk','nickName','\x20\x20\x20\x20','\x20\x20\x20\x20command:\x20','Unsupported\x20service\x20target\x20kind:\x20','padEnd','normalizedManifest','552RNjmEx','join','cliName','\x20\x20\x20\x20kind:\x20\x20\x20\x20'];a32_0x9371=function(){return _0x15f9d0;};return a32_0x9371();}function renderDynamicCommandHelp(_0x280dc6){const _0x5d9a85=a32_0x5eac,_0x50bdc4=[_0x5d9a85(0x170),_0x5d9a85(0x15e)+_0x280dc6['target'][_0x5d9a85(0x1a9)],_0x5d9a85(0x157)+_0x280dc6[_0x5d9a85(0x180)]['command']];if(_0x280dc6[_0x5d9a85(0x180)][_0x5d9a85(0x176)])_0x50bdc4[_0x5d9a85(0x199)](_0x5d9a85(0x178)+_0x280dc6['target']['datasetCode']);if(_0x280dc6[_0x5d9a85(0x180)]['datatable'])_0x50bdc4[_0x5d9a85(0x199)](_0x5d9a85(0x16a)+_0x280dc6[_0x5d9a85(0x180)][_0x5d9a85(0x16d)]);if(_0x280dc6[_0x5d9a85(0x180)][_0x5d9a85(0x167)])_0x50bdc4[_0x5d9a85(0x199)](_0x5d9a85(0x192)+_0x280dc6[_0x5d9a85(0x180)][_0x5d9a85(0x167)]);if(_0x280dc6[_0x5d9a85(0x180)][_0x5d9a85(0x161)])_0x50bdc4['push'](_0x5d9a85(0x1a6)+_0x280dc6[_0x5d9a85(0x180)][_0x5d9a85(0x161)]);if(_0x280dc6['mapTo']['length']>0x0){_0x50bdc4[_0x5d9a85(0x199)]('',_0x5d9a85(0x1ad));for(const _0x26b490 of _0x280dc6[_0x5d9a85(0x19e)]){_0x50bdc4[_0x5d9a85(0x199)](_0x5d9a85(0x156)+(_0x26b490[_0x5d9a85(0x183)]||_0x5d9a85(0x171))+'\x20->\x20'+_0x26b490['target']+(_0x26b490['operator']?'.'+_0x26b490[_0x5d9a85(0x163)]:''));}}return _0x50bdc4[_0x5d9a85(0x15c)]('\x0a');}function targetPreview(_0x318f81){const _0x18d0f5=a32_0x5eac;return{'kind':_0x318f81[_0x18d0f5(0x1a9)],'command':_0x318f81['command'],'appRef':_0x318f81[_0x18d0f5(0x19a)],'datasetCode':_0x318f81[_0x18d0f5(0x176)],'datatable':_0x318f81[_0x18d0f5(0x16d)],'sqlCode':_0x318f81['sqlCode'],'bffCode':_0x318f81[_0x18d0f5(0x18c)],'bffId':_0x318f81['bffId'],'scriptName':_0x318f81[_0x18d0f5(0x161)]};}function normalizeScalarParams(_0x5d197c){const _0x176e35=a32_0x5eac;return Object[_0x176e35(0x1ae)](Object['entries'](_0x5d197c)['filter'](([,_0x5dbac9])=>typeof _0x5dbac9===_0x176e35(0x174)||typeof _0x5dbac9===_0x176e35(0x191)));}function hasText(_0x3ccaab){const _0x29e2b8=a32_0x5eac;return typeof _0x3ccaab===_0x29e2b8(0x174)&&_0x3ccaab[_0x29e2b8(0x1a3)]()[_0x29e2b8(0x18e)]>0x0;}function isPrimitiveFlagDefault(_0xdebbdc){const _0x59c94a=a32_0x5eac;return _0xdebbdc===undefined||typeof _0xdebbdc===_0x59c94a(0x174)||typeof _0xdebbdc===_0x59c94a(0x191)||typeof _0xdebbdc==='boolean';}
1
+ (function(_0x370bdd,_0x2d624b){const _0x3641b3=a32_0x4648,_0x17fffe=_0x370bdd();while(!![]){try{const _0x4cf17a=parseInt(_0x3641b3(0x1cd))/0x1+-parseInt(_0x3641b3(0x1fe))/0x2*(parseInt(_0x3641b3(0x1d8))/0x3)+parseInt(_0x3641b3(0x1f4))/0x4*(-parseInt(_0x3641b3(0x21a))/0x5)+-parseInt(_0x3641b3(0x22d))/0x6+parseInt(_0x3641b3(0x216))/0x7+-parseInt(_0x3641b3(0x215))/0x8*(-parseInt(_0x3641b3(0x20e))/0x9)+-parseInt(_0x3641b3(0x1e9))/0xa*(-parseInt(_0x3641b3(0x212))/0xb);if(_0x4cf17a===_0x2d624b)break;else _0x17fffe['push'](_0x17fffe['shift']());}catch(_0x1e62b6){_0x17fffe['push'](_0x17fffe['shift']());}}}(a32_0x11dc,0x25c39));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x712319,_0x40b5d0){const _0x4ccada=a32_0x4648,_0x5356d2=listLocalServiceTrees();let _0x5a097f;for(const _0x1b7e2f of _0x5356d2){const _0x9aae91=matchServiceTreeCommand(_0x1b7e2f,_0x712319);if(!_0x9aae91)continue;(!_0x5a097f||_0x9aae91[_0x4ccada(0x1db)][_0x4ccada(0x220)]['length']>_0x5a097f[_0x4ccada(0x1db)]['fullPath'][_0x4ccada(0x1e1)])&&(_0x5a097f={'tree':_0x1b7e2f,'command':_0x9aae91[_0x4ccada(0x1db)],'remainingArgs':_0x9aae91[_0x4ccada(0x1e2)]});}if(!_0x5a097f)return undefined;const _0x32567f={..._0x40b5d0};return applyAppBinding(_0x5a097f[_0x4ccada(0x1dd)],_0x5a097f[_0x4ccada(0x1db)],_0x32567f),{'definition':buildDynamicCommandDefinition(_0x5a097f[_0x4ccada(0x1dd)],_0x5a097f[_0x4ccada(0x1db)]),'args':_0x5a097f[_0x4ccada(0x1e2)],'flags':_0x32567f,'tree':_0x5a097f['tree'],'command':_0x5a097f[_0x4ccada(0x1db)]};}export function generateDynamicServiceHelp(_0x35f7e9){const _0x1362eb=a32_0x4648,_0x243327=listLocalServiceTrees()[_0x1362eb(0x210)](_0x419364=>_0x419364[_0x1362eb(0x205)][_0x1362eb(0x1d6)]===_0x35f7e9);if(!_0x243327)return undefined;const _0xfbfcc1=[CLI_BIN_NAME+'\x20'+_0x35f7e9+_0x1362eb(0x1f8),'',_0x243327[_0x1362eb(0x205)][_0x1362eb(0x20f)]||_0x35f7e9,_0x243327['service']['description']?'\x20\x20'+_0x243327[_0x1362eb(0x205)][_0x1362eb(0x1f9)]:'','',_0x1362eb(0x1e4),..._0x243327[_0x1362eb(0x1e3)][_0x1362eb(0x1da)](_0x4032f9=>{const _0x20b65a=_0x1362eb,_0x6cb017=_0x4032f9[_0x20b65a(0x220)][_0x20b65a(0x22c)](0x1)[_0x20b65a(0x202)]('\x20'),_0x4f57af=_0x4032f9['risk']===_0x20b65a(0x22f)?'':'\x20['+_0x4032f9[_0x20b65a(0x22a)]+']';return'\x20\x20'+_0x6cb017[_0x20b65a(0x227)](0x18)+'\x20'+(_0x4032f9[_0x20b65a(0x1f9)]||'')+_0x4f57af;}),'',_0x1362eb(0x1d7)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x35f7e9+_0x1362eb(0x230)][_0x1362eb(0x1e0)](Boolean);return _0xfbfcc1[_0x1362eb(0x202)]('\x0a');}export function listDynamicServiceEntries(){const _0x27f93e=a32_0x4648;return listLocalServices()[_0x27f93e(0x1da)](_0x28c731=>{const _0x577b67=_0x27f93e,_0x3abab1=_0x28c731[_0x577b67(0x1ef)];return{'service':_0x3abab1['service']['code'],'label':_0x3abab1['service'][_0x577b67(0x20f)]||_0x3abab1[_0x577b67(0x205)][_0x577b67(0x1d6)],'commands':_0x3abab1[_0x577b67(0x1e3)][_0x577b67(0x1da)](_0x40cb01=>({'command':dynamicCommandName(_0x40cb01),'description':_0x40cb01[_0x577b67(0x1f9)]||_0x577b67(0x1fc)+_0x40cb01['cliPath'],'tag':riskTag(_0x40cb01[_0x577b67(0x22a)])}))};});}export function getDynamicServiceEntry(_0x28dd42){const _0x2b82c7=a32_0x4648;return listDynamicServiceEntries()[_0x2b82c7(0x210)](_0x5afe92=>_0x5afe92[_0x2b82c7(0x205)]===_0x28dd42);}export function listDynamicServiceDefinitions(_0x5f4cd1){const _0x4666b6=a32_0x4648;return listLocalServiceTrees()['filter'](_0x4cd468=>!_0x5f4cd1||_0x4cd468[_0x4666b6(0x205)][_0x4666b6(0x1d6)]===_0x5f4cd1)['flatMap'](_0x420632=>_0x420632[_0x4666b6(0x1e3)]['map'](_0x42d120=>buildDynamicCommandDefinition(_0x420632,_0x42d120)));}export function getDynamicServiceDefinitions(_0x4e1e92){const _0x18ce52=a32_0x4648,_0x5ca3ed=listDynamicServiceDefinitions(_0x4e1e92);return _0x5ca3ed[_0x18ce52(0x1e1)]>0x0?_0x5ca3ed:undefined;}export function findDynamicServiceDefinition(_0x1df837,_0x5321c7){const _0x341119=a32_0x4648;return listDynamicServiceDefinitions(_0x1df837)[_0x341119(0x210)](_0x260975=>_0x260975[_0x341119(0x1db)]===_0x5321c7);}export function buildDynamicCommandDefinition(_0x515a8b,_0x2dc32a){const _0x30b899=a32_0x4648;return{'service':_0x515a8b[_0x30b899(0x205)][_0x30b899(0x1d6)],'command':dynamicCommandName(_0x2dc32a),'description':_0x2dc32a['description']||_0x30b899(0x1fc)+_0x2dc32a[_0x30b899(0x231)],'risk':_0x2dc32a[_0x30b899(0x22a)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x2dc32a['args'][_0x30b899(0x1da)](_0x3be7d7=>({'name':_0x3be7d7[_0x30b899(0x20f)],'description':_0x3be7d7[_0x30b899(0x1f9)]||_0x3be7d7['name'],'required':_0x3be7d7[_0x30b899(0x1d3)]})),'flags':_0x2dc32a[_0x30b899(0x208)][_0x30b899(0x1da)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x2dc32a),async 'dryRun'(_0x18c9e){const _0x131830=_0x30b899,_0x49281c=await compilePlan(_0x2dc32a,_0x18c9e);return{'method':_0x131830(0x1f2),'url':_0x2dc32a[_0x131830(0x231)],'body':{'target':targetPreview(_0x49281c),'params':_0x49281c['params']},'description':_0x131830(0x20a)+_0x2dc32a[_0x131830(0x231)]};},async 'execute'(_0x50ab51){const _0x185ddd=_0x30b899,_0x2541f9=await compilePlan(_0x2dc32a,_0x50ab51),_0xa18b34=Date[_0x185ddd(0x1cc)](),_0x5a3f09=await executePlan(_0x2541f9,_0x2dc32a,_0x50ab51),_0x5b3c43=Date['now']()-_0xa18b34;return{'ok':!![],'data':{'service':_0x515a8b[_0x185ddd(0x205)],'command':_0x2dc32a[_0x185ddd(0x231)],'target':targetPreview(_0x2541f9),'result':_0x5a3f09,'elapsed':_0x5b3c43},'message':_0x185ddd(0x1eb)+_0x2dc32a[_0x185ddd(0x231)]+_0x185ddd(0x226)+_0x5b3c43+'ms'};}};}function dynamicCommandName(_0x5e24b9){const _0x5196ff=a32_0x4648;return _0x5e24b9[_0x5196ff(0x220)]['slice'](0x1)[_0x5196ff(0x202)]('\x20');}function riskTag(_0x2b1d60){return _0x2b1d60==='read'?'':'\x20\x20['+_0x2b1d60+']';}function flagToCommandFlag(_0x48f8c0){const _0x307485=a32_0x4648;return{'name':_0x48f8c0[_0x307485(0x232)],'type':_0x48f8c0['type']===_0x307485(0x203)?_0x307485(0x1de):_0x48f8c0[_0x307485(0x1f1)],'description':_0x48f8c0['description']||_0x48f8c0[_0x307485(0x20f)],'required':_0x48f8c0[_0x307485(0x1d3)],'default':isPrimitiveFlagDefault(_0x48f8c0[_0x307485(0x217)])?_0x48f8c0['default']:undefined,'enum':_0x48f8c0[_0x307485(0x214)]};}async function compilePlan(_0x814946,_0x4db15b){const _0x581caa=a32_0x4648;return compileServiceTreeCommand(_0x814946,{'flags':_0x4db15b[_0x581caa(0x21e)],'args':_0x4db15b[_0x581caa(0x1d2)],'context':await buildServiceContext(_0x814946,_0x4db15b)});}function a32_0x11dc(){const _0x32ccbb=['1030074pYvGPp','nickname','read','`\x20to\x20inspect\x20the\x20manifest.','cliPath','cliName','\x20requires\x20target.scriptName.','datasetCode','entries','now','305936YiKzUy','trim','kind','Unknown\x20appRef\x20\x22','sqlCode','args','required','\x20\x20\x20\x20kind:\x20\x20\x20\x20','startsWith','code','Use\x20`','9Ekjmbr','appRef','map','command','tableName','tree','string','dbtableConfig','filter','length','remainingArgs','commands','Commands:','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','loginName','appCode','\x20\x20\x20\x20','70640WgEjIA','scriptName','Service\x20command\x20','envName','context.','bff','normalizedManifest','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','type','SERVICE_TREE','mapTo','1544dmJxCr','Cannot\x20resolve\x20datatable\x20\x22','fromEntries','appBindings','\x20<command>\x20[flags]','description','some','operator','Run\x20service\x20command\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','154806GxCUBB','target','username','nickName','join','json','\x20\x20MAP\x20TO','service','env','userId','flags','\x20\x20\x20\x20datasetCode:\x20','Preview\x20dynamic\x20service\x20command:\x20','const','appcode','boolean','63iZfaAF','name','find','source','407oxtBhF','bffId','enum','160088RoefiT','220150jnJpYC','default','\x20\x20\x20\x20scriptName:\x20','params','2335ZHXcEk','datatable','data','userName','rawFlags','app','fullPath','bffCode','push','validation','sql','\x20\x20\x20\x20command:\x20','\x20completed\x20in\x20','padEnd','\x20\x20SERVICE\x20TREE\x20TARGET','\x20->\x20','risk','Unsupported\x20service\x20target\x20kind:\x20','slice'];a32_0x11dc=function(){return _0x32ccbb;};return a32_0x11dc();}async function buildServiceContext(_0x221d1f,_0x53f4e5){const _0x2e7102=a32_0x4648,_0x188a5c={'appCode':_0x53f4e5[_0x2e7102(0x1e7)],'env':_0x53f4e5[_0x2e7102(0x1ec)],'envName':_0x53f4e5['envName']};if(!usesRuntimeContext(_0x221d1f))return _0x188a5c;const _0x2451e0=await getLoginUserInfo(),_0x344905=pickFirst(_0x2451e0[_0x2e7102(0x207)],_0x2451e0['id']);return{..._0x188a5c,'user':_0x2451e0,'userId':_0x344905,'id':_0x2451e0['id'],'username':pickFirst(_0x2451e0[_0x2e7102(0x200)],_0x2451e0[_0x2e7102(0x21d)],_0x2451e0[_0x2e7102(0x1e6)]),'userName':_0x2451e0[_0x2e7102(0x21d)],'nickname':pickFirst(_0x2451e0[_0x2e7102(0x22e)],_0x2451e0[_0x2e7102(0x201)]),'nickName':_0x2451e0[_0x2e7102(0x201)],'tenantCode':_0x2451e0['tenantCode'],'employeeId':_0x2451e0['employeeId']};}function a32_0x4648(_0x541f69,_0x59a311){_0x541f69=_0x541f69-0x1ca;const _0x11dc2f=a32_0x11dc();let _0x4648a7=_0x11dc2f[_0x541f69];return _0x4648a7;}function usesRuntimeContext(_0x2136b0){const _0x23f9e7=a32_0x4648;return _0x2136b0['mapTo'][_0x23f9e7(0x1fa)](_0x58e778=>typeof _0x58e778[_0x23f9e7(0x211)]===_0x23f9e7(0x1de)&&(_0x58e778[_0x23f9e7(0x211)][_0x23f9e7(0x1d5)](_0x23f9e7(0x1ed))||_0x58e778['source'][_0x23f9e7(0x1d5)]('ctx.')));}function pickFirst(..._0x37eff0){const _0x4700e0=a32_0x4648;return _0x37eff0[_0x4700e0(0x210)](_0x3b7117=>_0x3b7117!==undefined&&_0x3b7117!==null);}async function executePlan(_0x49e5db,_0x56810d,_0x13ff65){const _0x473250=a32_0x4648;if(_0x49e5db['kind']===_0x473250(0x21c)){const _0x1ce601=await resolveDatasetCode(_0x49e5db,_0x56810d,_0x13ff65);return executeData(_0x1ce601,_0x49e5db[_0x473250(0x1db)],_0x49e5db['params']);}if(_0x49e5db[_0x473250(0x1cf)]===_0x473250(0x224)){if(!_0x49e5db[_0x473250(0x1d1)])throw CliErrors[_0x473250(0x223)]('Service\x20command\x20'+_0x56810d[_0x473250(0x231)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x49e5db['sqlCode'],normalizeScalarParams(_0x49e5db[_0x473250(0x219)]));}if(_0x49e5db[_0x473250(0x1cf)]===_0x473250(0x1ee)){const _0x560a02=_0x49e5db[_0x473250(0x1ea)]||_0x49e5db[_0x473250(0x221)]||(_0x49e5db['bffId']==null?'':String(_0x49e5db[_0x473250(0x213)]));if(!_0x560a02)throw CliErrors['validation'](_0x473250(0x1eb)+_0x56810d[_0x473250(0x231)]+_0x473250(0x233));return executeSdkBff(_0x560a02,_0x49e5db[_0x473250(0x219)]);}throw CliErrors[_0x473250(0x223)](_0x473250(0x22b)+_0x49e5db[_0x473250(0x1cf)]);}async function resolveDatasetCode(_0x4536fe,_0x557c9b,_0x32d10c){const _0x4650f5=a32_0x4648;if(_0x4536fe['datasetCode'])return _0x4536fe[_0x4650f5(0x1ca)];if(!_0x4536fe['datatable'])throw CliErrors[_0x4650f5(0x223)]('Service\x20command\x20'+_0x557c9b[_0x4650f5(0x231)]+_0x4650f5(0x1e5));const _0x252bad=await listDatasets(_0x32d10c[_0x4650f5(0x1e7)]),_0x1efc45=_0x252bad[_0x4650f5(0x210)](_0x5568e9=>_0x5568e9[_0x4650f5(0x1df)]?.[_0x4650f5(0x1dc)]===_0x4536fe[_0x4650f5(0x21b)]);if(!_0x1efc45?.[_0x4650f5(0x1d6)])throw CliErrors[_0x4650f5(0x223)](_0x4650f5(0x1f5)+_0x4536fe[_0x4650f5(0x21b)]+_0x4650f5(0x1fd)+_0x32d10c[_0x4650f5(0x1e7)]+'.',_0x4650f5(0x1f0));return _0x1efc45[_0x4650f5(0x1d6)];}function applyAppBinding(_0x1891b7,_0x48b147,_0x40b2a4){const _0x1ccee9=a32_0x4648,_0x4b6ee8=_0x48b147[_0x1ccee9(0x1ff)][_0x1ccee9(0x1d9)];if(!_0x4b6ee8)return;const _0x4a32da=_0x1891b7[_0x1ccee9(0x1f7)][_0x4b6ee8];if(!_0x4a32da)throw CliErrors[_0x1ccee9(0x223)](_0x1ccee9(0x1d0)+_0x4b6ee8+'\x22\x20in\x20service\x20command\x20'+_0x48b147[_0x1ccee9(0x231)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x414764=_0x4a32da[_0x1ccee9(0x20c)]||_0x4a32da['appCode'];_0x414764&&!hasText(_0x40b2a4[_0x1ccee9(0x20c)])&&(_0x40b2a4[_0x1ccee9(0x20c)]=_0x414764),_0x4a32da[_0x1ccee9(0x21f)]&&!hasText(_0x40b2a4['app'])&&!hasText(_0x40b2a4[_0x1ccee9(0x20c)])&&(_0x40b2a4['app']=_0x4a32da[_0x1ccee9(0x21f)]),_0x4a32da[_0x1ccee9(0x206)]&&!hasText(_0x40b2a4['env'])&&(_0x40b2a4[_0x1ccee9(0x206)]=_0x4a32da[_0x1ccee9(0x206)]);}function renderDynamicCommandHelp(_0x202aeb){const _0x430fca=a32_0x4648,_0x42c7e3=[_0x430fca(0x228),_0x430fca(0x1d4)+_0x202aeb[_0x430fca(0x1ff)][_0x430fca(0x1cf)],_0x430fca(0x225)+_0x202aeb[_0x430fca(0x1ff)][_0x430fca(0x1db)]];if(_0x202aeb[_0x430fca(0x1ff)][_0x430fca(0x1ca)])_0x42c7e3[_0x430fca(0x222)](_0x430fca(0x209)+_0x202aeb[_0x430fca(0x1ff)][_0x430fca(0x1ca)]);if(_0x202aeb['target'][_0x430fca(0x21b)])_0x42c7e3['push']('\x20\x20\x20\x20datatable:\x20'+_0x202aeb[_0x430fca(0x1ff)]['datatable']);if(_0x202aeb[_0x430fca(0x1ff)][_0x430fca(0x1d1)])_0x42c7e3[_0x430fca(0x222)]('\x20\x20\x20\x20sqlCode:\x20'+_0x202aeb[_0x430fca(0x1ff)][_0x430fca(0x1d1)]);if(_0x202aeb[_0x430fca(0x1ff)][_0x430fca(0x1ea)])_0x42c7e3[_0x430fca(0x222)](_0x430fca(0x218)+_0x202aeb[_0x430fca(0x1ff)][_0x430fca(0x1ea)]);if(_0x202aeb[_0x430fca(0x1f3)][_0x430fca(0x1e1)]>0x0){_0x42c7e3[_0x430fca(0x222)]('',_0x430fca(0x204));for(const _0x55b0c2 of _0x202aeb['mapTo']){_0x42c7e3['push'](_0x430fca(0x1e8)+(_0x55b0c2[_0x430fca(0x211)]||_0x430fca(0x20b))+_0x430fca(0x229)+_0x55b0c2[_0x430fca(0x1ff)]+(_0x55b0c2[_0x430fca(0x1fb)]?'.'+_0x55b0c2[_0x430fca(0x1fb)]:''));}}return _0x42c7e3[_0x430fca(0x202)]('\x0a');}function targetPreview(_0x5ca899){const _0x1e2d56=a32_0x4648;return{'kind':_0x5ca899[_0x1e2d56(0x1cf)],'command':_0x5ca899[_0x1e2d56(0x1db)],'appRef':_0x5ca899[_0x1e2d56(0x1d9)],'datasetCode':_0x5ca899['datasetCode'],'datatable':_0x5ca899[_0x1e2d56(0x21b)],'sqlCode':_0x5ca899[_0x1e2d56(0x1d1)],'bffCode':_0x5ca899['bffCode'],'bffId':_0x5ca899['bffId'],'scriptName':_0x5ca899[_0x1e2d56(0x1ea)]};}function normalizeScalarParams(_0x536366){const _0x4687b1=a32_0x4648;return Object[_0x4687b1(0x1f6)](Object[_0x4687b1(0x1cb)](_0x536366)['filter'](([,_0x5cebf7])=>typeof _0x5cebf7===_0x4687b1(0x1de)||typeof _0x5cebf7==='number'));}function hasText(_0x71a28e){const _0x55aede=a32_0x4648;return typeof _0x71a28e===_0x55aede(0x1de)&&_0x71a28e[_0x55aede(0x1ce)]()[_0x55aede(0x1e1)]>0x0;}function isPrimitiveFlagDefault(_0x1268f4){const _0xae20ad=a32_0x4648;return _0x1268f4===undefined||typeof _0x1268f4===_0xae20ad(0x1de)||typeof _0x1268f4==='number'||typeof _0x1268f4===_0xae20ad(0x20d);}
@@ -1 +1 @@
1
- const a33_0x32732f=a33_0x392c;(function(_0x6d3e8d,_0x45dc2e){const _0x5777df=a33_0x392c,_0x3a7328=_0x6d3e8d();while(!![]){try{const _0x5adb00=-parseInt(_0x5777df(0x154))/0x1*(-parseInt(_0x5777df(0x184))/0x2)+-parseInt(_0x5777df(0x160))/0x3*(parseInt(_0x5777df(0x16a))/0x4)+parseInt(_0x5777df(0x15f))/0x5+-parseInt(_0x5777df(0x168))/0x6*(parseInt(_0x5777df(0x180))/0x7)+parseInt(_0x5777df(0x182))/0x8*(parseInt(_0x5777df(0x198))/0x9)+-parseInt(_0x5777df(0x185))/0xa*(-parseInt(_0x5777df(0x15e))/0xb)+-parseInt(_0x5777df(0x176))/0xc*(-parseInt(_0x5777df(0x170))/0xd);if(_0x5adb00===_0x45dc2e)break;else _0x3a7328['push'](_0x3a7328['shift']());}catch(_0x4babc5){_0x3a7328['push'](_0x3a7328['shift']());}}}(a33_0x1c26,0x211db));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a33_0x32732f(0x163),'type':'string','required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':'service','type':a33_0x32732f(0x155),'required':!![],'description':a33_0x32732f(0x161),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a33_0x32732f(0x15c)}};function summarizeService(_0x32cfa1){const _0x2fd55b=a33_0x32732f;return{'serviceCode':_0x32cfa1['serviceCode'],'name':_0x32cfa1[_0x2fd55b(0x18a)][_0x2fd55b(0x172)][_0x2fd55b(0x19b)],'version':_0x32cfa1[_0x2fd55b(0x174)],'importedAt':_0x32cfa1['importedAt'],'source':_0x32cfa1[_0x2fd55b(0x15d)],'commandCount':_0x32cfa1['normalizedManifest']['commands'][_0x2fd55b(0x157)],'commands':_0x32cfa1['normalizedManifest']['commands'][_0x2fd55b(0x18e)](_0x1d1f74=>({'path':_0x1d1f74[_0x2fd55b(0x16e)],'description':_0x1d1f74[_0x2fd55b(0x183)],'risk':_0x1d1f74[_0x2fd55b(0x19c)],'target':_0x1d1f74['target'],'flags':_0x1d1f74[_0x2fd55b(0x18c)]['map'](_0x4935dd=>({'name':_0x4935dd['name'],'cliName':_0x4935dd[_0x2fd55b(0x16b)],'type':_0x4935dd[_0x2fd55b(0x177)],'required':_0x4935dd[_0x2fd55b(0x173)]===!![]}))}))};}function summarizeLoadedManifest(_0x4dceeb){const _0x4fcebd=a33_0x32732f;return{'service':_0x4dceeb[_0x4fcebd(0x18a)]?.[_0x4fcebd(0x172)],'version':_0x4dceeb[_0x4fcebd(0x18a)]?.['version'],'commandCount':_0x4dceeb[_0x4fcebd(0x18a)]?.[_0x4fcebd(0x17f)][_0x4fcebd(0x157)]??0x0,'commands':_0x4dceeb[_0x4fcebd(0x18a)]?.['commands'][_0x4fcebd(0x18e)](_0x150b42=>({'path':_0x150b42['cliPath'],'risk':_0x150b42['risk'],'target':_0x150b42[_0x4fcebd(0x18f)]}))??[],'registryIndex':_0x4dceeb[_0x4fcebd(0x153)],'registryServiceCode':_0x4dceeb[_0x4fcebd(0x166)],'errors':_0x4dceeb[_0x4fcebd(0x18d)][_0x4fcebd(0x190)],'warnings':_0x4dceeb[_0x4fcebd(0x18d)]['warnings']};}function a33_0x392c(_0x2a1032,_0x46bc82){_0x2a1032=_0x2a1032-0x150;const _0x1c267c=a33_0x1c26();let _0x392c1b=_0x1c267c[_0x2a1032];return _0x392c1b;}export const serviceDefinitions=[{'service':a33_0x32732f(0x172),'command':a33_0x32732f(0x175),'description':a33_0x32732f(0x150),'risk':a33_0x32732f(0x167),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x15759f){const _0x2cd1b6=a33_0x32732f,_0x574ed0=loadServiceManifestFromFile(_0x15759f[_0x2cd1b6(0x192)](_0x2cd1b6(0x163)));if(!_0x574ed0['report']['ok'])return{'ok':![],'data':{'file':_0x574ed0[_0x2cd1b6(0x186)],'hash':_0x574ed0[_0x2cd1b6(0x179)],'kind':_0x574ed0[_0x2cd1b6(0x195)],'serviceCount':_0x574ed0['manifests'][_0x2cd1b6(0x157)],'services':_0x574ed0[_0x2cd1b6(0x164)]['map'](summarizeLoadedManifest),'errors':_0x574ed0[_0x2cd1b6(0x18d)]['errors'],'warnings':_0x574ed0['report'][_0x2cd1b6(0x15a)]},'message':formatValidationFailure(_0x574ed0[_0x2cd1b6(0x18d)])};if(_0x574ed0['kind']==='registry'||_0x574ed0[_0x2cd1b6(0x164)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x574ed0[_0x2cd1b6(0x186)],'hash':_0x574ed0['hash'],'kind':_0x574ed0[_0x2cd1b6(0x195)],'serviceCount':_0x574ed0[_0x2cd1b6(0x164)][_0x2cd1b6(0x157)],'commandCount':_0x574ed0[_0x2cd1b6(0x164)]['reduce']((_0x3a8329,_0xf1badd)=>_0x3a8329+(_0xf1badd[_0x2cd1b6(0x18a)]?.[_0x2cd1b6(0x17f)][_0x2cd1b6(0x157)]??0x0),0x0),'services':_0x574ed0[_0x2cd1b6(0x164)][_0x2cd1b6(0x18e)](summarizeLoadedManifest),'warnings':_0x574ed0[_0x2cd1b6(0x18d)][_0x2cd1b6(0x15a)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x574ed0[_0x2cd1b6(0x186)],'hash':_0x574ed0[_0x2cd1b6(0x179)],'kind':_0x574ed0[_0x2cd1b6(0x195)],'service':_0x574ed0[_0x2cd1b6(0x18a)]?.[_0x2cd1b6(0x172)],'version':_0x574ed0[_0x2cd1b6(0x18a)]?.['version'],'commandCount':_0x574ed0[_0x2cd1b6(0x18a)]?.[_0x2cd1b6(0x17f)][_0x2cd1b6(0x157)]??0x0,'commands':_0x574ed0[_0x2cd1b6(0x18a)]?.[_0x2cd1b6(0x17f)][_0x2cd1b6(0x18e)](_0x1b391b=>({'path':_0x1b391b[_0x2cd1b6(0x16e)],'risk':_0x1b391b[_0x2cd1b6(0x19c)],'target':_0x1b391b[_0x2cd1b6(0x18f)]})),'warnings':_0x574ed0[_0x2cd1b6(0x18d)][_0x2cd1b6(0x15a)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a33_0x32732f(0x172),'command':a33_0x32732f(0x159),'description':a33_0x32732f(0x187),'risk':a33_0x32732f(0x17e),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x5d4cd8){const _0x4f6df3=a33_0x32732f,_0x31bc85=loadServiceManifestFromFile(_0x5d4cd8['str'](_0x4f6df3(0x163)));return{'method':_0x4f6df3(0x18b),'url':getServiceRegistryPath(),'body':{'file':_0x31bc85['filePath'],'hash':_0x31bc85['hash'],'kind':_0x31bc85[_0x4f6df3(0x195)],'ok':_0x31bc85[_0x4f6df3(0x18d)]['ok'],'service':_0x31bc85[_0x4f6df3(0x18a)]?.[_0x4f6df3(0x172)],'version':_0x31bc85['normalizedManifest']?.[_0x4f6df3(0x174)],'serviceCount':_0x31bc85[_0x4f6df3(0x164)][_0x4f6df3(0x157)],'services':_0x31bc85[_0x4f6df3(0x164)][_0x4f6df3(0x18e)](_0x35c0fd=>({'service':_0x35c0fd[_0x4f6df3(0x18a)]?.[_0x4f6df3(0x172)],'version':_0x35c0fd[_0x4f6df3(0x18a)]?.[_0x4f6df3(0x174)],'commandCount':_0x35c0fd[_0x4f6df3(0x18a)]?.[_0x4f6df3(0x17f)][_0x4f6df3(0x157)]??0x0,'errors':_0x35c0fd[_0x4f6df3(0x18d)][_0x4f6df3(0x190)]})),'errors':_0x31bc85[_0x4f6df3(0x18d)][_0x4f6df3(0x190)],'commandCount':_0x31bc85[_0x4f6df3(0x18a)]?.[_0x4f6df3(0x17f)]['length']??0x0},'description':_0x4f6df3(0x16d)};},async 'execute'(_0x50b9df){const _0x947670=a33_0x32732f,_0x3e893c=importServiceManifest(_0x50b9df[_0x947670(0x192)](_0x947670(0x163)));if(_0x3e893c[_0x947670(0x165)][_0x947670(0x157)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x3e893c[_0x947670(0x188)],'imported':_0x3e893c['imported'],'updated':_0x3e893c[_0x947670(0x19d)],'serviceCount':_0x3e893c[_0x947670(0x169)],'services':_0x3e893c['entries'][_0x947670(0x18e)](summarizeService)},'message':_0x947670(0x171)+_0x3e893c[_0x947670(0x178)]+_0x947670(0x16c)+_0x3e893c['updated']+_0x947670(0x17c)};return{'ok':!![],'data':{'registryPath':_0x3e893c[_0x947670(0x188)],'replaced':_0x3e893c[_0x947670(0x16f)],'imported':_0x3e893c[_0x947670(0x178)],'updated':_0x3e893c[_0x947670(0x19d)],'serviceCount':_0x3e893c[_0x947670(0x169)],'service':summarizeService(_0x3e893c[_0x947670(0x191)])},'message':(_0x3e893c[_0x947670(0x16f)]?_0x947670(0x158):_0x947670(0x15b))+'\x20service\x20'+_0x3e893c[_0x947670(0x191)][_0x947670(0x181)]+'.'};}},{'service':'service','command':a33_0x32732f(0x17b),'description':a33_0x32732f(0x196),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0xd65655){const _0x6e1b5d=a33_0x32732f,_0x5ecd99=getLocalServiceEntry(_0xd65655['str'](_0x6e1b5d(0x172)));return{'method':_0x6e1b5d(0x18b),'url':_0xd65655['str'](_0x6e1b5d(0x163)),'body':{'service':_0xd65655[_0x6e1b5d(0x192)](_0x6e1b5d(0x172)),'found':Boolean(_0x5ecd99),'version':_0x5ecd99?.[_0x6e1b5d(0x174)],'source':_0x5ecd99?.[_0x6e1b5d(0x15d)]},'description':_0x6e1b5d(0x151)};},async 'execute'(_0x42d906){const _0x616dc7=a33_0x32732f,_0x2fbd76=exportServiceManifest(_0x42d906[_0x616dc7(0x192)]('service'),_0x42d906[_0x616dc7(0x192)]('file'));return{'ok':!![],'data':{'registryPath':_0x2fbd76['registryPath'],'file':_0x2fbd76[_0x616dc7(0x186)],'service':summarizeService(_0x2fbd76['entry'])},'message':_0x616dc7(0x17a)+_0x2fbd76[_0x616dc7(0x191)][_0x616dc7(0x181)]+'.'};}},{'service':'service','command':a33_0x32732f(0x156),'description':a33_0x32732f(0x17d),'risk':a33_0x32732f(0x167),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x221a8d=a33_0x32732f,_0x1b0022=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1b0022[_0x221a8d(0x157)],'services':_0x1b0022[_0x221a8d(0x18e)](summarizeService)}};}},{'service':'service','command':a33_0x32732f(0x152),'description':a33_0x32732f(0x189),'risk':a33_0x32732f(0x17e),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x5b0113){const _0xe4a0d4=a33_0x32732f,_0xb867f2=getLocalServiceEntry(_0x5b0113[_0xe4a0d4(0x192)](_0xe4a0d4(0x172)));return{'method':_0xe4a0d4(0x18b),'url':getServiceRegistryPath(),'body':{'service':_0x5b0113[_0xe4a0d4(0x192)](_0xe4a0d4(0x172)),'found':Boolean(_0xb867f2),'version':_0xb867f2?.['version'],'source':_0xb867f2?.['source']},'description':_0xe4a0d4(0x193)};},async 'execute'(_0x54ecec){const _0x42d220=a33_0x32732f,_0x295811=removeServiceManifest(_0x54ecec[_0x42d220(0x192)]('service'));return{'ok':!![],'data':{'registryPath':_0x295811[_0x42d220(0x188)],'serviceCount':_0x295811['serviceCount'],'service':summarizeService(_0x295811[_0x42d220(0x191)])},'message':_0x42d220(0x194)+_0x295811[_0x42d220(0x191)]['serviceCode']+'.'};}},{'service':a33_0x32732f(0x172),'command':a33_0x32732f(0x162),'description':a33_0x32732f(0x199),'risk':a33_0x32732f(0x167),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x3ce611){const _0x417c84=a33_0x32732f,_0x584f96=getLocalServiceEntry(_0x3ce611[_0x417c84(0x192)](_0x417c84(0x172)));if(!_0x584f96)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x3ce611[_0x417c84(0x192)](_0x417c84(0x172))},'message':_0x417c84(0x19a)+_0x3ce611['str']('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x584f96),'manifest':_0x584f96[_0x417c84(0x197)],'normalizedManifest':_0x584f96[_0x417c84(0x18a)]}};}}];function a33_0x1c26(){const _0x3fbaa9=['required','version','validate','12Fniuse','type','imported','hash','Exported\x20service\x20','export','\x20service(s).','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','write','commands','716072GCEoFP','serviceCode','468016GzLjGY','description','8iGYAcl','470wwcFwp','filePath','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','registryPath','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','normalizedManifest','WRITE','flags','report','map','target','errors','entry','str','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','Removed\x20service\x20','kind','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','manifest','36GjYfQt','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Local\x20service\x20not\x20found:\x20','name','risk','updated','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','remove','registryIndex','24551UKOUsR','string','list','length','Updated','import','warnings','Imported','lower\x20kebab-case\x20service\x20code','source','517ppVJqx','714620eoavbo','3ErIIxF','Local\x20service\x20code,\x20for\x20example\x20crm','detail','file','manifests','entries','registryServiceCode','read','12LjpfEB','serviceCount','921364NZZHSp','cliName','\x20service(s),\x20updated\x20','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','cliPath','replaced','1212003DSNNyV','Imported\x20','service'];a33_0x1c26=function(){return _0x3fbaa9;};return a33_0x1c26();}
1
+ const a33_0x1560b6=a33_0x1d74;function a33_0x1d74(_0xa17710,_0x2c0b38){_0xa17710=_0xa17710-0xaa;const _0x2fbd22=a33_0x2fbd();let _0x1d74a3=_0x2fbd22[_0xa17710];return _0x1d74a3;}(function(_0x1fdd92,_0x5acb5d){const _0x2d53e0=a33_0x1d74,_0x4fad4b=_0x1fdd92();while(!![]){try{const _0x549064=parseInt(_0x2d53e0(0xbb))/0x1+parseInt(_0x2d53e0(0xe3))/0x2+-parseInt(_0x2d53e0(0xaf))/0x3+parseInt(_0x2d53e0(0xce))/0x4+parseInt(_0x2d53e0(0xd3))/0x5*(parseInt(_0x2d53e0(0xe6))/0x6)+-parseInt(_0x2d53e0(0xb3))/0x7+-parseInt(_0x2d53e0(0xc8))/0x8;if(_0x549064===_0x5acb5d)break;else _0x4fad4b['push'](_0x4fad4b['shift']());}catch(_0xaa56ee){_0x4fad4b['push'](_0x4fad4b['shift']());}}}(a33_0x2fbd,0x8747e));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':'file','type':'string','required':!![],'description':a33_0x1560b6(0xd9)},SERVICE_FLAG={'name':a33_0x1560b6(0xb7),'type':'string','required':!![],'description':a33_0x1560b6(0xc9),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x412882){const _0x6cdbdf=a33_0x1560b6;return{'serviceCode':_0x412882[_0x6cdbdf(0xd0)],'name':_0x412882['normalizedManifest'][_0x6cdbdf(0xb7)][_0x6cdbdf(0xc5)],'version':_0x412882[_0x6cdbdf(0xc7)],'importedAt':_0x412882[_0x6cdbdf(0xb6)],'source':_0x412882[_0x6cdbdf(0xd1)],'commandCount':_0x412882[_0x6cdbdf(0xb4)][_0x6cdbdf(0xcb)][_0x6cdbdf(0xc6)],'commands':_0x412882['normalizedManifest'][_0x6cdbdf(0xcb)][_0x6cdbdf(0xaa)](_0x5be88b=>({'path':_0x5be88b['cliPath'],'description':_0x5be88b[_0x6cdbdf(0xda)],'risk':_0x5be88b[_0x6cdbdf(0xb1)],'target':_0x5be88b[_0x6cdbdf(0xcd)],'flags':_0x5be88b['flags'][_0x6cdbdf(0xaa)](_0x4c1203=>({'name':_0x4c1203[_0x6cdbdf(0xc5)],'cliName':_0x4c1203['cliName'],'type':_0x4c1203[_0x6cdbdf(0xb8)],'required':_0x4c1203[_0x6cdbdf(0xb5)]===!![]}))}))};}function summarizeLoadedManifest(_0x4eba01){const _0x417801=a33_0x1560b6;return{'service':_0x4eba01[_0x417801(0xb4)]?.[_0x417801(0xb7)],'version':_0x4eba01[_0x417801(0xb4)]?.[_0x417801(0xc7)],'commandCount':_0x4eba01[_0x417801(0xb4)]?.['commands'][_0x417801(0xc6)]??0x0,'commands':_0x4eba01['normalizedManifest']?.['commands'][_0x417801(0xaa)](_0x1d03cf=>({'path':_0x1d03cf['cliPath'],'risk':_0x1d03cf[_0x417801(0xb1)],'target':_0x1d03cf[_0x417801(0xcd)]}))??[],'registryIndex':_0x4eba01['registryIndex'],'registryServiceCode':_0x4eba01[_0x417801(0xb0)],'errors':_0x4eba01['report'][_0x417801(0xd2)],'warnings':_0x4eba01[_0x417801(0xe1)][_0x417801(0xe4)]};}function a33_0x2fbd(){const _0x6b8f56=['entries','file','imported','registry','report','import','2188856ehpZlc','warnings','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','3510IPfqST','remove','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','WRITE','read','hash','map','cliPath','entry','detail','Service\x20registry\x20validation\x20passed.','2200611cAwPuW','registryServiceCode','risk','Local\x20service\x20not\x20found:\x20','5424342SjRRNx','normalizedManifest','required','importedAt','service','type','list','Service\x20manifest\x20validation\x20passed.','672607wfSNAh','filePath','Imported\x20','write','reduce','serviceCount','Exported\x20service\x20','str','updated','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','name','length','version','6984368KFeAlM','Local\x20service\x20code,\x20for\x20example\x20crm','Removed\x20service\x20','commands','replaced','target','3525316YynaKU','validate','serviceCode','source','errors','2455HIhTzY','kind','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','manifests','\x20service(s),\x20updated\x20','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Service\x20Tree\x20manifest\x20file\x20path','description','\x20service(s).','registryPath'];a33_0x2fbd=function(){return _0x6b8f56;};return a33_0x2fbd();}export const serviceDefinitions=[{'service':a33_0x1560b6(0xb7),'command':a33_0x1560b6(0xcf),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a33_0x1560b6(0xea),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x894d95){const _0x441c51=a33_0x1560b6,_0x264ddb=loadServiceManifestFromFile(_0x894d95[_0x441c51(0xc2)]('file'));if(!_0x264ddb['report']['ok'])return{'ok':![],'data':{'file':_0x264ddb[_0x441c51(0xbc)],'hash':_0x264ddb[_0x441c51(0xeb)],'kind':_0x264ddb[_0x441c51(0xd4)],'serviceCount':_0x264ddb['manifests'][_0x441c51(0xc6)],'services':_0x264ddb[_0x441c51(0xd6)][_0x441c51(0xaa)](summarizeLoadedManifest),'errors':_0x264ddb[_0x441c51(0xe1)][_0x441c51(0xd2)],'warnings':_0x264ddb[_0x441c51(0xe1)][_0x441c51(0xe4)]},'message':formatValidationFailure(_0x264ddb[_0x441c51(0xe1)])};if(_0x264ddb['kind']===_0x441c51(0xe0)||_0x264ddb['manifests']['length']!==0x1)return{'ok':!![],'data':{'file':_0x264ddb[_0x441c51(0xbc)],'hash':_0x264ddb[_0x441c51(0xeb)],'kind':_0x264ddb[_0x441c51(0xd4)],'serviceCount':_0x264ddb[_0x441c51(0xd6)][_0x441c51(0xc6)],'commandCount':_0x264ddb[_0x441c51(0xd6)][_0x441c51(0xbf)]((_0x512998,_0x16b90e)=>_0x512998+(_0x16b90e['normalizedManifest']?.[_0x441c51(0xcb)]['length']??0x0),0x0),'services':_0x264ddb[_0x441c51(0xd6)][_0x441c51(0xaa)](summarizeLoadedManifest),'warnings':_0x264ddb['report'][_0x441c51(0xe4)]},'message':_0x441c51(0xae)};return{'ok':!![],'data':{'file':_0x264ddb[_0x441c51(0xbc)],'hash':_0x264ddb[_0x441c51(0xeb)],'kind':_0x264ddb[_0x441c51(0xd4)],'service':_0x264ddb[_0x441c51(0xb4)]?.[_0x441c51(0xb7)],'version':_0x264ddb[_0x441c51(0xb4)]?.[_0x441c51(0xc7)],'commandCount':_0x264ddb[_0x441c51(0xb4)]?.[_0x441c51(0xcb)][_0x441c51(0xc6)]??0x0,'commands':_0x264ddb[_0x441c51(0xb4)]?.[_0x441c51(0xcb)][_0x441c51(0xaa)](_0x226391=>({'path':_0x226391[_0x441c51(0xab)],'risk':_0x226391['risk'],'target':_0x226391[_0x441c51(0xcd)]})),'warnings':_0x264ddb[_0x441c51(0xe1)][_0x441c51(0xe4)]},'message':_0x441c51(0xba)};}},{'service':a33_0x1560b6(0xb7),'command':a33_0x1560b6(0xe2),'description':a33_0x1560b6(0xd5),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1568fa){const _0x407f82=a33_0x1560b6,_0x45084a=loadServiceManifestFromFile(_0x1568fa['str'](_0x407f82(0xde)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x45084a[_0x407f82(0xbc)],'hash':_0x45084a[_0x407f82(0xeb)],'kind':_0x45084a['kind'],'ok':_0x45084a[_0x407f82(0xe1)]['ok'],'service':_0x45084a['normalizedManifest']?.[_0x407f82(0xb7)],'version':_0x45084a[_0x407f82(0xb4)]?.[_0x407f82(0xc7)],'serviceCount':_0x45084a['manifests']['length'],'services':_0x45084a['manifests'][_0x407f82(0xaa)](_0x37d7b6=>({'service':_0x37d7b6[_0x407f82(0xb4)]?.[_0x407f82(0xb7)],'version':_0x37d7b6['normalizedManifest']?.['version'],'commandCount':_0x37d7b6[_0x407f82(0xb4)]?.[_0x407f82(0xcb)][_0x407f82(0xc6)]??0x0,'errors':_0x37d7b6['report'][_0x407f82(0xd2)]})),'errors':_0x45084a[_0x407f82(0xe1)][_0x407f82(0xd2)],'commandCount':_0x45084a['normalizedManifest']?.[_0x407f82(0xcb)]['length']??0x0},'description':_0x407f82(0xd8)};},async 'execute'(_0x3533e2){const _0x3690a6=a33_0x1560b6,_0x43cabd=importServiceManifest(_0x3533e2[_0x3690a6(0xc2)](_0x3690a6(0xde)));if(_0x43cabd['entries']['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x43cabd[_0x3690a6(0xdc)],'imported':_0x43cabd[_0x3690a6(0xdf)],'updated':_0x43cabd[_0x3690a6(0xc3)],'serviceCount':_0x43cabd['serviceCount'],'services':_0x43cabd[_0x3690a6(0xdd)]['map'](summarizeService)},'message':_0x3690a6(0xbd)+_0x43cabd['imported']+_0x3690a6(0xd7)+_0x43cabd['updated']+_0x3690a6(0xdb)};return{'ok':!![],'data':{'registryPath':_0x43cabd[_0x3690a6(0xdc)],'replaced':_0x43cabd[_0x3690a6(0xcc)],'imported':_0x43cabd[_0x3690a6(0xdf)],'updated':_0x43cabd[_0x3690a6(0xc3)],'serviceCount':_0x43cabd[_0x3690a6(0xc0)],'service':summarizeService(_0x43cabd[_0x3690a6(0xac)])},'message':(_0x43cabd[_0x3690a6(0xcc)]?'Updated':'Imported')+'\x20service\x20'+_0x43cabd[_0x3690a6(0xac)][_0x3690a6(0xd0)]+'.'};}},{'service':a33_0x1560b6(0xb7),'command':'export','description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a33_0x1560b6(0xbe),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x51e948){const _0x17c6d1=a33_0x1560b6,_0x368370=getLocalServiceEntry(_0x51e948[_0x17c6d1(0xc2)](_0x17c6d1(0xb7)));return{'method':'WRITE','url':_0x51e948[_0x17c6d1(0xc2)]('file'),'body':{'service':_0x51e948[_0x17c6d1(0xc2)](_0x17c6d1(0xb7)),'found':Boolean(_0x368370),'version':_0x368370?.['version'],'source':_0x368370?.[_0x17c6d1(0xd1)]},'description':_0x17c6d1(0xe5)};},async 'execute'(_0x517b22){const _0x474012=a33_0x1560b6,_0x3cead3=exportServiceManifest(_0x517b22[_0x474012(0xc2)]('service'),_0x517b22[_0x474012(0xc2)](_0x474012(0xde)));return{'ok':!![],'data':{'registryPath':_0x3cead3['registryPath'],'file':_0x3cead3[_0x474012(0xbc)],'service':summarizeService(_0x3cead3['entry'])},'message':_0x474012(0xc1)+_0x3cead3[_0x474012(0xac)]['serviceCode']+'.'};}},{'service':a33_0x1560b6(0xb7),'command':a33_0x1560b6(0xb9),'description':a33_0x1560b6(0xc4),'risk':a33_0x1560b6(0xea),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x1d64e5=a33_0x1560b6,_0x24913c=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x24913c[_0x1d64e5(0xc6)],'services':_0x24913c[_0x1d64e5(0xaa)](summarizeService)}};}},{'service':a33_0x1560b6(0xb7),'command':a33_0x1560b6(0xe7),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a33_0x1560b6(0xbe),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x44f855){const _0x18846d=a33_0x1560b6,_0xdc476e=getLocalServiceEntry(_0x44f855['str'](_0x18846d(0xb7)));return{'method':_0x18846d(0xe9),'url':getServiceRegistryPath(),'body':{'service':_0x44f855['str'](_0x18846d(0xb7)),'found':Boolean(_0xdc476e),'version':_0xdc476e?.[_0x18846d(0xc7)],'source':_0xdc476e?.[_0x18846d(0xd1)]},'description':_0x18846d(0xe8)};},async 'execute'(_0x4437a4){const _0x4d13a9=a33_0x1560b6,_0x712cd4=removeServiceManifest(_0x4437a4[_0x4d13a9(0xc2)](_0x4d13a9(0xb7)));return{'ok':!![],'data':{'registryPath':_0x712cd4[_0x4d13a9(0xdc)],'serviceCount':_0x712cd4[_0x4d13a9(0xc0)],'service':summarizeService(_0x712cd4['entry'])},'message':_0x4d13a9(0xca)+_0x712cd4[_0x4d13a9(0xac)][_0x4d13a9(0xd0)]+'.'};}},{'service':'service','command':a33_0x1560b6(0xad),'description':'Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','risk':a33_0x1560b6(0xea),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x291611){const _0x4abd58=a33_0x1560b6,_0x38b5f1=getLocalServiceEntry(_0x291611[_0x4abd58(0xc2)](_0x4abd58(0xb7)));if(!_0x38b5f1)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x291611[_0x4abd58(0xc2)](_0x4abd58(0xb7))},'message':_0x4abd58(0xb2)+_0x291611[_0x4abd58(0xc2)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x38b5f1),'manifest':_0x38b5f1['manifest'],'normalizedManifest':_0x38b5f1['normalizedManifest']}};}}];
@@ -1 +1 @@
1
- const a34_0x1fae47=a34_0x433a;(function(_0x28591b,_0x425ea5){const _0x6e696=a34_0x433a,_0x5822e8=_0x28591b();while(!![]){try{const _0x2f9a9b=parseInt(_0x6e696(0x1e4))/0x1+-parseInt(_0x6e696(0x1e2))/0x2+parseInt(_0x6e696(0x1a0))/0x3+-parseInt(_0x6e696(0x1be))/0x4*(-parseInt(_0x6e696(0x1d8))/0x5)+parseInt(_0x6e696(0x1ac))/0x6+-parseInt(_0x6e696(0x1c2))/0x7+-parseInt(_0x6e696(0x19f))/0x8*(parseInt(_0x6e696(0x1cb))/0x9);if(_0x2f9a9b===_0x425ea5)break;else _0x5822e8['push'](_0x5822e8['shift']());}catch(_0x15d5c0){_0x5822e8['push'](_0x5822e8['shift']());}}}(a34_0xa907,0xe705a));function a34_0x433a(_0x52eaff,_0x1c9581){_0x52eaff=_0x52eaff-0x19a;const _0xa907c3=a34_0xa907();let _0x433abd=_0xa907c3[_0x52eaff];return _0x433abd;}import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a34_0x1fae47(0x1c5);export function getServiceRegistryPath(_0x24a88c={}){const _0x1e75b8=a34_0x1fae47;return resolve(_0x24a88c['homeDir']??homedir(),PRODUCT_CONFIG[_0x1e75b8(0x1ce)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x19e4ea={}){const _0x1fed7f=a34_0x1fae47,_0x1269bb=getServiceRegistryPath(_0x19e4ea);if(!existsSync(_0x1269bb))return emptyServiceRegistry();try{const _0x351cad=readFileSync(_0x1269bb,'utf8');if(!_0x351cad[_0x1fed7f(0x19c)]())return emptyServiceRegistry();const _0x3d7191=JSON[_0x1fed7f(0x1e3)](_0x351cad);if(_0x3d7191[_0x1fed7f(0x1d6)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x1fed7f(0x19a)]('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x3d7191[_0x1fed7f(0x1d6)]),_0x1fed7f(0x1b5)+_0x1269bb+'.');if(!Array[_0x1fed7f(0x1d4)](_0x3d7191[_0x1fed7f(0x1db)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3d7191[_0x1fed7f(0x1a5)],'services':_0x3d7191[_0x1fed7f(0x1db)]};}catch(_0xe55a95){if(_0xe55a95 instanceof Error&&_0xe55a95[_0x1fed7f(0x1c1)]===_0x1fed7f(0x1ab))throw _0xe55a95;throw CliErrors[_0x1fed7f(0x19a)](_0x1fed7f(0x1bf)+_0x1269bb,_0x1fed7f(0x1aa));}}export function writeServiceRegistry(_0x1a4f22,_0x528d9c={}){const _0x128978=a34_0x1fae47,_0x29d2a4=getServiceRegistryPath(_0x528d9c),_0x56a14f=dirname(_0x29d2a4);!existsSync(_0x56a14f)&&mkdirSync(_0x56a14f,{'recursive':!![]});const _0x488d91=_0x29d2a4+_0x128978(0x1a7);try{writeFileSync(_0x488d91,JSON['stringify'](_0x1a4f22,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x488d91,_0x29d2a4);}catch(_0x4868db){try{unlinkSync(_0x488d91);}catch{}if(_0x4868db?.[_0x128978(0x1d0)]===_0x128978(0x1ea))throw CliErrors[_0x128978(0x19a)](_0x128978(0x19d)+_0x29d2a4);throw _0x4868db;}return _0x29d2a4;}export function loadServiceManifestFromFile(_0x2448d5){const _0x210266=a34_0x1fae47,_0xe1bd99=resolve(_0x2448d5);if(!existsSync(_0xe1bd99))throw CliErrors['validation'](_0x210266(0x1c9)+_0x2448d5);let _0x434323;const _0x7bf315=readFileSync(_0xe1bd99,_0x210266(0x1a9));try{_0x434323=JSON[_0x210266(0x1e3)](_0x7bf315);}catch{throw CliErrors[_0x210266(0x19a)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x2448d5,_0x210266(0x1a1));}const _0x33bee8=sha256(_0x7bf315),_0x57bda2=extractLoadedServiceManifests(_0x434323,_0x33bee8),_0xf222e2=aggregateValidationReports(_0x57bda2),_0x108e09=_0x57bda2[0x0];return{'filePath':_0xe1bd99,'hash':_0x33bee8,'kind':isServiceRegistryLike(_0x434323)?'registry':_0x210266(0x1d5),'manifest':_0x108e09?.[_0x210266(0x1d5)]??_0x434323,'report':_0xf222e2,'normalizedManifest':_0x57bda2['length']===0x1?_0x108e09?.[_0x210266(0x1b7)]:undefined,'manifests':_0x57bda2};}export function importServiceManifest(_0x5dbc2e,_0x3d50e6={}){const _0xe4b441=a34_0x1fae47,_0xe30654=loadServiceManifestFromFile(_0x5dbc2e);if(!_0xe30654[_0xe4b441(0x1dd)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0xe30654[_0xe4b441(0x1dd)]),_0xe4b441(0x19e));if(_0xe30654[_0xe4b441(0x1cd)][_0xe4b441(0x1e5)]===0x0)throw CliErrors[_0xe4b441(0x19a)](_0xe4b441(0x1e7),_0xe4b441(0x1d2));const _0x47581b=readServiceRegistry(_0x3d50e6),_0x2bc595=(_0x3d50e6[_0xe4b441(0x1da)]??(()=>new Date()))()[_0xe4b441(0x1e6)](),_0xaff90b=[];let _0x3b4c69=0x0,_0x407016=0x0;for(const _0x5c7b6b of _0xe30654[_0xe4b441(0x1cd)]){if(!_0x5c7b6b[_0xe4b441(0x1b7)])continue;const _0x3f6143=_0x5c7b6b[_0xe4b441(0x1b7)][_0xe4b441(0x1b6)]['code'],_0x4ddfea={'serviceCode':_0x3f6143,'version':_0x5c7b6b[_0xe4b441(0x1b7)][_0xe4b441(0x1d1)],'importedAt':_0x2bc595,'source':{'type':_0xe4b441(0x1b2),'path':_0xe30654[_0xe4b441(0x1af)],'hash':_0x5c7b6b['sourceHash']},'manifest':_0x5c7b6b[_0xe4b441(0x1d5)],'normalizedManifest':_0x5c7b6b[_0xe4b441(0x1b7)]},_0x55fe65=_0x47581b[_0xe4b441(0x1db)][_0xe4b441(0x1ad)](_0x532438=>_0x532438[_0xe4b441(0x1de)]===_0x3f6143);_0x55fe65>=0x0?(_0x47581b[_0xe4b441(0x1db)][_0x55fe65]=_0x4ddfea,_0x407016++):(_0x47581b['services']['push'](_0x4ddfea),_0x3b4c69++),_0xaff90b['push'](_0x4ddfea);}_0x47581b[_0xe4b441(0x1db)][_0xe4b441(0x1bc)]((_0x59282d,_0xb4c013)=>_0x59282d[_0xe4b441(0x1de)]['localeCompare'](_0xb4c013[_0xe4b441(0x1de)])),_0x47581b[_0xe4b441(0x1a5)]=_0x2bc595;const _0x16cb33=writeServiceRegistry(_0x47581b,_0x3d50e6);return{'registryPath':_0x16cb33,'entry':_0xaff90b[0x0],'replaced':_0xaff90b[_0xe4b441(0x1e5)]===0x1?_0x407016===0x1:_0x407016>0x0,'entries':_0xaff90b,'imported':_0x3b4c69,'updated':_0x407016,'serviceCount':_0x47581b['services'][_0xe4b441(0x1e5)]};}export function exportServiceManifest(_0x1891c8,_0x9050f,_0x3ddc24={}){const _0x35635d=a34_0x1fae47,_0x1b1f6f=getServiceRegistryPath(_0x3ddc24),_0x4010b0=getLocalServiceEntry(_0x1891c8,_0x3ddc24);if(!_0x4010b0)throw CliErrors[_0x35635d(0x19a)](_0x35635d(0x1a2)+_0x1891c8,_0x35635d(0x1df));const _0x32bd07=resolve(_0x9050f),_0x26561c=dirname(_0x32bd07);return!existsSync(_0x26561c)&&mkdirSync(_0x26561c,{'recursive':!![]}),writeFileSync(_0x32bd07,JSON[_0x35635d(0x1eb)](_0x4010b0[_0x35635d(0x1d5)],null,0x2)+'\x0a',{'encoding':_0x35635d(0x1a9),'mode':0x180}),{'registryPath':_0x1b1f6f,'filePath':_0x32bd07,'entry':_0x4010b0};}export function removeServiceManifest(_0x4fbf91,_0x3c5cad={}){const _0x19577d=a34_0x1fae47,_0x5a8ed0=readServiceRegistry(_0x3c5cad),_0x304297=_0x4fbf91[_0x19577d(0x19c)](),_0x538e2b=_0x5a8ed0[_0x19577d(0x1db)][_0x19577d(0x1ad)](_0x37fa19=>_0x37fa19['serviceCode']===_0x304297);if(_0x538e2b<0x0)throw CliErrors[_0x19577d(0x19a)](_0x19577d(0x1a2)+_0x304297,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x3870ad]=_0x5a8ed0[_0x19577d(0x1db)][_0x19577d(0x1e9)](_0x538e2b,0x1),_0xf43a01=(_0x3c5cad[_0x19577d(0x1da)]??(()=>new Date()))()[_0x19577d(0x1e6)]();_0x5a8ed0[_0x19577d(0x1a5)]=_0xf43a01;const _0x2842e1=writeServiceRegistry(_0x5a8ed0,_0x3c5cad);return{'registryPath':_0x2842e1,'entry':_0x3870ad,'serviceCount':_0x5a8ed0[_0x19577d(0x1db)][_0x19577d(0x1e5)]};}export function listLocalServices(_0x4a03b9={}){const _0x5a4894=a34_0x1fae47;return readServiceRegistry(_0x4a03b9)[_0x5a4894(0x1db)];}export function getLocalServiceEntry(_0x3bdffe,_0x48fb8a={}){const _0x41d253=a34_0x1fae47;return readServiceRegistry(_0x48fb8a)[_0x41d253(0x1db)]['find'](_0x260e88=>_0x260e88[_0x41d253(0x1de)]===_0x3bdffe[_0x41d253(0x19c)]());}function a34_0xa907(){const _0x2bcd44=['message','$.services[','updatedAt','Unsupported\x20schemaVersion:\x20','.tmp','sha256','utf8','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','CliError','111552hfBiDt','findIndex','].manifest','filePath','update','warnings','file','source','description','Remove\x20or\x20migrate\x20','service','normalizedManifest','string','importedAt','map','target','sort','flatMap','28180xvuyIc','Invalid\x20service\x20registry\x20JSON:\x20','risk','name','3114692gVPwWo','command','commands','service.json','invalid','join','kind','Service\x20manifest\x20file\x20not\x20found:\x20','registryIndex','9024471CoipQZ','services\x20must\x20be\x20an\x20array','manifests','homeDirName','errors','code','version','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','hex','isArray','manifest','schemaVersion','Service\x20manifest\x20validation\x20failed:\x0a','290vfpqwj','startsWith','now','services','].manifest.','report','serviceCode','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','path','cliPath','358176Jmyhpa','parse','1771691gtoflU','length','toISOString','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','empty','splice','ENOENT','stringify','validation','slice','trim','Cannot\x20write\x20service\x20registry:\x20','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','8sFCjST','1122408RguDOy','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','Local\x20service\x20not\x20found:\x20'];a34_0xa907=function(){return _0x2bcd44;};return a34_0xa907();}export function listLocalServiceTrees(_0x4e6b97={}){const _0x2992db=a34_0x1fae47;return readServiceRegistry(_0x4e6b97)['services'][_0x2992db(0x1ba)](_0x108407=>_0x108407['normalizedManifest']);}export function inspectServiceRegistry(_0x5eb2a3={}){const _0x531855=a34_0x1fae47,_0x1d3d94=getServiceRegistryPath(_0x5eb2a3);if(!existsSync(_0x1d3d94))return emptyServiceRegistryInspection(_0x1d3d94,'missing',![]);try{const _0x116658=readFileSync(_0x1d3d94,_0x531855(0x1a9));if(!_0x116658[_0x531855(0x19c)]())return emptyServiceRegistryInspection(_0x1d3d94,_0x531855(0x1e8),!![]);const _0x5a02fc=JSON[_0x531855(0x1e3)](_0x116658);if(_0x5a02fc['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1d3d94,_0x531855(0x1c6),!![]),'schemaVersion':_0x5a02fc[_0x531855(0x1d6)],'message':_0x531855(0x1a6)+String(_0x5a02fc[_0x531855(0x1d6)])};if(!Array[_0x531855(0x1d4)](_0x5a02fc['services']))return{...emptyServiceRegistryInspection(_0x1d3d94,_0x531855(0x1c6),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5a02fc['updatedAt'],'message':_0x531855(0x1cc)};const _0x5d3939=_0x5a02fc[_0x531855(0x1db)][_0x531855(0x1ba)](summarizeLocalServiceEntry);return{'registryPath':_0x1d3d94,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5a02fc[_0x531855(0x1a5)],'serviceCount':_0x5d3939[_0x531855(0x1e5)],'commandCount':_0x5d3939['reduce']((_0x1e4fcd,_0x4d47dd)=>_0x1e4fcd+_0x4d47dd['commandCount'],0x0),'services':_0x5d3939};}catch(_0x1da14f){return{...emptyServiceRegistryInspection(_0x1d3d94,_0x531855(0x1c6),!![]),'message':_0x1da14f instanceof Error?_0x1da14f[_0x531855(0x1a3)]:String(_0x1da14f)};}}export function formatValidationFailure(_0x13e869){const _0x463a69=a34_0x1fae47,_0x1e6f83=_0x13e869[_0x463a69(0x1cf)][_0x463a69(0x1ba)](_0x1b37d5=>_0x1b37d5[_0x463a69(0x1e0)]+':\x20'+_0x1b37d5[_0x463a69(0x1a3)]);return _0x463a69(0x1d7)+_0x1e6f83[_0x463a69(0x1c7)]('\x0a');}function extractLoadedServiceManifests(_0x37154f,_0x5ac37d){const _0x4424a5=a34_0x1fae47;if(!isServiceRegistryLike(_0x37154f)){const _0x401d26=_0x37154f,_0x4023a7=validateServiceTreeManifest(_0x401d26);return[{'manifest':_0x401d26,'report':_0x4023a7,'normalizedManifest':_0x4023a7['ok']?normalizeServiceTreeManifest(_0x401d26):undefined,'sourceHash':_0x5ac37d}];}return _0x37154f['services'][_0x4424a5(0x1ba)]((_0x273b49,_0x39cc33)=>{const _0x4b7651=_0x4424a5,_0x557bc1=isObjectRecord(_0x273b49)?_0x273b49['manifest']:undefined,_0x137698=validateServiceTreeManifest(_0x557bc1),_0x1535fc=isObjectRecord(_0x273b49)&&typeof _0x273b49['serviceCode']===_0x4b7651(0x1b8)?_0x273b49[_0x4b7651(0x1de)]:undefined;return{'manifest':_0x557bc1,'report':_0x137698,'normalizedManifest':_0x137698['ok']?normalizeServiceTreeManifest(_0x557bc1):undefined,'sourceHash':sha256(JSON[_0x4b7651(0x1eb)](_0x557bc1,null,0x2)+'\x0a'),'registryIndex':_0x39cc33,'registryServiceCode':_0x1535fc};});}function aggregateValidationReports(_0x2c1885){const _0x3316ae=a34_0x1fae47,_0x585e9f=_0x2c1885[_0x3316ae(0x1bd)](_0x3a43ed=>_0x3a43ed[_0x3316ae(0x1ca)]===undefined?_0x3a43ed[_0x3316ae(0x1dd)][_0x3316ae(0x1cf)]:_0x3a43ed[_0x3316ae(0x1dd)][_0x3316ae(0x1cf)][_0x3316ae(0x1ba)](_0x29959e=>({..._0x29959e,'path':prefixRegistryIssuePath(_0x3a43ed['registryIndex'],_0x29959e[_0x3316ae(0x1e0)])}))),_0x618f21=_0x2c1885[_0x3316ae(0x1bd)](_0x1d24b6=>_0x1d24b6['registryIndex']===undefined?_0x1d24b6[_0x3316ae(0x1dd)]['warnings']:_0x1d24b6[_0x3316ae(0x1dd)][_0x3316ae(0x1b1)][_0x3316ae(0x1ba)](_0x4af1aa=>({..._0x4af1aa,'path':prefixRegistryIssuePath(_0x1d24b6[_0x3316ae(0x1ca)],_0x4af1aa[_0x3316ae(0x1e0)])})));return{'ok':_0x585e9f[_0x3316ae(0x1e5)]===0x0,'errors':_0x585e9f,'warnings':_0x618f21};}function prefixRegistryIssuePath(_0x2a15fc,_0x421c03){const _0x371d1c=a34_0x1fae47;if(_0x421c03==='$')return _0x371d1c(0x1a4)+_0x2a15fc+_0x371d1c(0x1ae);if(_0x421c03[_0x371d1c(0x1d9)]('$.'))return _0x371d1c(0x1a4)+_0x2a15fc+'].manifest'+_0x421c03[_0x371d1c(0x19b)](0x1);if(_0x421c03['startsWith']('$['))return'$.services['+_0x2a15fc+_0x371d1c(0x1ae)+_0x421c03[_0x371d1c(0x19b)](0x1);return _0x371d1c(0x1a4)+_0x2a15fc+_0x371d1c(0x1dc)+_0x421c03;}function isServiceRegistryLike(_0x187d39){const _0x22074e=a34_0x1fae47;return isObjectRecord(_0x187d39)&&_0x187d39['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x22074e(0x1d4)](_0x187d39[_0x22074e(0x1db)]);}function isObjectRecord(_0x2f8fa2){const _0x3cdd9e=a34_0x1fae47;return Boolean(_0x2f8fa2)&&typeof _0x2f8fa2==='object'&&!Array[_0x3cdd9e(0x1d4)](_0x2f8fa2);}function emptyServiceRegistryInspection(_0x8b21da,_0x2f4009,_0x5041dd){return{'registryPath':_0x8b21da,'exists':_0x5041dd,'status':_0x2f4009,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x4bf53e){const _0x3f88cc=a34_0x1fae47,_0x5e16e6=_0x4bf53e[_0x3f88cc(0x1b7)],_0x3d7287=_0x5e16e6[_0x3f88cc(0x1c4)][_0x3f88cc(0x1ba)](_0x4f884b=>({'path':_0x4f884b[_0x3f88cc(0x1e1)],'description':_0x4f884b[_0x3f88cc(0x1b4)],'risk':_0x4f884b[_0x3f88cc(0x1c0)],'targetKind':_0x4f884b[_0x3f88cc(0x1bb)][_0x3f88cc(0x1c8)],'targetCommand':_0x4f884b[_0x3f88cc(0x1bb)][_0x3f88cc(0x1c3)]}));return{'serviceCode':_0x4bf53e[_0x3f88cc(0x1de)],'name':_0x5e16e6[_0x3f88cc(0x1b6)][_0x3f88cc(0x1c1)],'description':_0x5e16e6[_0x3f88cc(0x1b6)][_0x3f88cc(0x1b4)],'version':_0x4bf53e[_0x3f88cc(0x1d1)],'importedAt':_0x4bf53e[_0x3f88cc(0x1b9)],'source':_0x4bf53e[_0x3f88cc(0x1b3)],'commandCount':_0x3d7287[_0x3f88cc(0x1e5)],'commands':_0x3d7287};}function sha256(_0x3e7935){const _0x2155c2=a34_0x1fae47;return createHash(_0x2155c2(0x1a8))[_0x2155c2(0x1b0)](_0x3e7935)['digest'](_0x2155c2(0x1d3));}
1
+ function a34_0x2954(){const _0x4a4ef6=['6722045TWYAoa','sort','8141mGVJNR','validation','localeCompare','$.services[','push','missing','report','schemaVersion','slice','path','services\x20must\x20be\x20an\x20array','command','updatedAt','1323459szqpgM','string','now','manifest','CliError','Service\x20manifest\x20validation\x20failed:\x0a','message','hex','description','importedAt','parse','430661BAoDtF','64ioZjtN','Remove\x20or\x20migrate\x20','Unsupported\x20service\x20registry\x20schemaVersion:\x20','].manifest','registryIndex','].manifest.','commands','join','digest','sha256','service.json','trim','map','isArray','invalid','services','length','manifests','filePath','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','flatMap','target','serviceCode','utf8','1265982DcluQy','object','29806ptFkSJ','4EETIOS','version','10908360MPfgoo','toISOString','reduce','name','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','commandCount','source','file','Invalid\x20service\x20registry\x20JSON:\x20','normalizedManifest','registry','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','startsWith','risk','324jkBDup','findIndex','4026KVKBXG','sourceHash','.tmp','Local\x20service\x20not\x20found:\x20','homeDirName','errors','find','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','empty','39pzGBlx','service','stringify','warnings'];a34_0x2954=function(){return _0x4a4ef6;};return a34_0x2954();}const a34_0x2622f0=a34_0x34df;(function(_0x475acd,_0x6bdfb9){const _0x3ad31c=a34_0x34df,_0x34e482=_0x475acd();while(!![]){try{const _0x4763eb=parseInt(_0x3ad31c(0x1e5))/0x1*(-parseInt(_0x3ad31c(0x1c9))/0x2)+-parseInt(_0x3ad31c(0x1c7))/0x3+-parseInt(_0x3ad31c(0x1ca))/0x4*(-parseInt(_0x3ad31c(0x1e9))/0x5)+-parseInt(_0x3ad31c(0x1dc))/0x6*(parseInt(_0x3ad31c(0x196))/0x7)+parseInt(_0x3ad31c(0x1af))/0x8*(parseInt(_0x3ad31c(0x1a3))/0x9)+-parseInt(_0x3ad31c(0x1cc))/0xa+-parseInt(_0x3ad31c(0x1ae))/0xb*(-parseInt(_0x3ad31c(0x1da))/0xc);if(_0x4763eb===_0x6bdfb9)break;else _0x34e482['push'](_0x34e482['shift']());}catch(_0x47a494){_0x34e482['push'](_0x34e482['shift']());}}}(a34_0x2954,0xabbf2));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';function a34_0x34df(_0x59fbbc,_0x952d65){_0x59fbbc=_0x59fbbc-0x196;const _0x29541a=a34_0x2954();let _0x34df02=_0x29541a[_0x59fbbc];return _0x34df02;}import{CliErrors}from'../../errors.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a34_0x2622f0(0x1b9);export function getServiceRegistryPath(_0x1fbfc4={}){const _0x500132=a34_0x2622f0;return resolve(_0x1fbfc4['homeDir']??homedir(),PRODUCT_CONFIG[_0x500132(0x1e0)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x4f7358={}){const _0x20d8e5=a34_0x2622f0,_0x1fbe53=getServiceRegistryPath(_0x4f7358);if(!existsSync(_0x1fbe53))return emptyServiceRegistry();try{const _0x50535b=readFileSync(_0x1fbe53,_0x20d8e5(0x1c6));if(!_0x50535b['trim']())return emptyServiceRegistry();const _0x1487d2=JSON[_0x20d8e5(0x1ad)](_0x50535b);if(_0x1487d2[_0x20d8e5(0x19d)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x20d8e5(0x197)](_0x20d8e5(0x1b1)+String(_0x1487d2[_0x20d8e5(0x19d)]),_0x20d8e5(0x1b0)+_0x1fbe53+'.');if(!Array[_0x20d8e5(0x1bc)](_0x1487d2['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1487d2[_0x20d8e5(0x1a2)],'services':_0x1487d2['services']};}catch(_0x2e531d){if(_0x2e531d instanceof Error&&_0x2e531d[_0x20d8e5(0x1cf)]===_0x20d8e5(0x1a7))throw _0x2e531d;throw CliErrors['validation'](_0x20d8e5(0x1d4)+_0x1fbe53,_0x20d8e5(0x1e3));}}export function writeServiceRegistry(_0x15c296,_0x3418c2={}){const _0x3aabdf=a34_0x2622f0,_0x3441a4=getServiceRegistryPath(_0x3418c2),_0xbcc5ba=dirname(_0x3441a4);!existsSync(_0xbcc5ba)&&mkdirSync(_0xbcc5ba,{'recursive':!![]});const _0x51be67=_0x3441a4+_0x3aabdf(0x1de);try{writeFileSync(_0x51be67,JSON[_0x3aabdf(0x1e7)](_0x15c296,null,0x2)+'\x0a',{'encoding':_0x3aabdf(0x1c6),'mode':0x180}),renameSync(_0x51be67,_0x3441a4);}catch(_0x3cba88){try{unlinkSync(_0x51be67);}catch{}if(_0x3cba88?.['code']==='ENOENT')throw CliErrors[_0x3aabdf(0x197)]('Cannot\x20write\x20service\x20registry:\x20'+_0x3441a4);throw _0x3cba88;}return _0x3441a4;}export function loadServiceManifestFromFile(_0x356342){const _0x4c0b9c=a34_0x2622f0,_0xfa82c0=resolve(_0x356342);if(!existsSync(_0xfa82c0))throw CliErrors[_0x4c0b9c(0x197)]('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x356342);let _0x3d3d5d;const _0x45783b=readFileSync(_0xfa82c0,_0x4c0b9c(0x1c6));try{_0x3d3d5d=JSON[_0x4c0b9c(0x1ad)](_0x45783b);}catch{throw CliErrors[_0x4c0b9c(0x197)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x356342,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x2ae053=sha256(_0x45783b),_0x59f09e=extractLoadedServiceManifests(_0x3d3d5d,_0x2ae053),_0x2f0c0a=aggregateValidationReports(_0x59f09e),_0x5b0d84=_0x59f09e[0x0];return{'filePath':_0xfa82c0,'hash':_0x2ae053,'kind':isServiceRegistryLike(_0x3d3d5d)?_0x4c0b9c(0x1d6):_0x4c0b9c(0x1a6),'manifest':_0x5b0d84?.['manifest']??_0x3d3d5d,'report':_0x2f0c0a,'normalizedManifest':_0x59f09e[_0x4c0b9c(0x1bf)]===0x1?_0x5b0d84?.[_0x4c0b9c(0x1d5)]:undefined,'manifests':_0x59f09e};}export function importServiceManifest(_0x10cb0b,_0x5c65a6={}){const _0x4bc174=a34_0x2622f0,_0xafeb0e=loadServiceManifestFromFile(_0x10cb0b);if(!_0xafeb0e[_0x4bc174(0x19c)]['ok'])throw CliErrors[_0x4bc174(0x197)](formatValidationFailure(_0xafeb0e[_0x4bc174(0x19c)]),_0x4bc174(0x1d7));if(_0xafeb0e[_0x4bc174(0x1c0)]['length']===0x0)throw CliErrors[_0x4bc174(0x197)]('Service\x20registry\x20has\x20no\x20services\x20to\x20import.',_0x4bc174(0x1c2));const _0x1ffda8=readServiceRegistry(_0x5c65a6),_0x4fe830=(_0x5c65a6['now']??(()=>new Date()))()[_0x4bc174(0x1cd)](),_0x41fe68=[];let _0x1e210b=0x0,_0xcf0d2f=0x0;for(const _0x53741e of _0xafeb0e[_0x4bc174(0x1c0)]){if(!_0x53741e[_0x4bc174(0x1d5)])continue;const _0x184f45=_0x53741e[_0x4bc174(0x1d5)][_0x4bc174(0x1e6)]['code'],_0x41c5e1={'serviceCode':_0x184f45,'version':_0x53741e[_0x4bc174(0x1d5)][_0x4bc174(0x1cb)],'importedAt':_0x4fe830,'source':{'type':_0x4bc174(0x1d3),'path':_0xafeb0e[_0x4bc174(0x1c1)],'hash':_0x53741e[_0x4bc174(0x1dd)]},'manifest':_0x53741e['manifest'],'normalizedManifest':_0x53741e[_0x4bc174(0x1d5)]},_0x5f4660=_0x1ffda8[_0x4bc174(0x1be)][_0x4bc174(0x1db)](_0xfc90b6=>_0xfc90b6['serviceCode']===_0x184f45);_0x5f4660>=0x0?(_0x1ffda8[_0x4bc174(0x1be)][_0x5f4660]=_0x41c5e1,_0xcf0d2f++):(_0x1ffda8['services'][_0x4bc174(0x19a)](_0x41c5e1),_0x1e210b++),_0x41fe68[_0x4bc174(0x19a)](_0x41c5e1);}_0x1ffda8[_0x4bc174(0x1be)][_0x4bc174(0x1ea)]((_0x3d08b5,_0x37ee99)=>_0x3d08b5['serviceCode'][_0x4bc174(0x198)](_0x37ee99[_0x4bc174(0x1c5)])),_0x1ffda8[_0x4bc174(0x1a2)]=_0x4fe830;const _0x56f363=writeServiceRegistry(_0x1ffda8,_0x5c65a6);return{'registryPath':_0x56f363,'entry':_0x41fe68[0x0],'replaced':_0x41fe68['length']===0x1?_0xcf0d2f===0x1:_0xcf0d2f>0x0,'entries':_0x41fe68,'imported':_0x1e210b,'updated':_0xcf0d2f,'serviceCount':_0x1ffda8['services'][_0x4bc174(0x1bf)]};}export function exportServiceManifest(_0x416bea,_0x1e7edd,_0x2d2da5={}){const _0x3f8699=a34_0x2622f0,_0x1b14ae=getServiceRegistryPath(_0x2d2da5),_0x2ab47f=getLocalServiceEntry(_0x416bea,_0x2d2da5);if(!_0x2ab47f)throw CliErrors['validation'](_0x3f8699(0x1df)+_0x416bea,_0x3f8699(0x1d0));const _0x1ee610=resolve(_0x1e7edd),_0x3f7cf9=dirname(_0x1ee610);return!existsSync(_0x3f7cf9)&&mkdirSync(_0x3f7cf9,{'recursive':!![]}),writeFileSync(_0x1ee610,JSON[_0x3f8699(0x1e7)](_0x2ab47f['manifest'],null,0x2)+'\x0a',{'encoding':_0x3f8699(0x1c6),'mode':0x180}),{'registryPath':_0x1b14ae,'filePath':_0x1ee610,'entry':_0x2ab47f};}export function removeServiceManifest(_0x4ae7d0,_0x1b88a5={}){const _0x267efd=a34_0x2622f0,_0x2f4015=readServiceRegistry(_0x1b88a5),_0x2f43db=_0x4ae7d0['trim'](),_0x4aeeef=_0x2f4015[_0x267efd(0x1be)][_0x267efd(0x1db)](_0x54e234=>_0x54e234['serviceCode']===_0x2f43db);if(_0x4aeeef<0x0)throw CliErrors[_0x267efd(0x197)]('Local\x20service\x20not\x20found:\x20'+_0x2f43db,_0x267efd(0x1d0));const [_0x3101fd]=_0x2f4015['services']['splice'](_0x4aeeef,0x1),_0x4fb3f9=(_0x1b88a5[_0x267efd(0x1a5)]??(()=>new Date()))()[_0x267efd(0x1cd)]();_0x2f4015[_0x267efd(0x1a2)]=_0x4fb3f9;const _0xf6adfe=writeServiceRegistry(_0x2f4015,_0x1b88a5);return{'registryPath':_0xf6adfe,'entry':_0x3101fd,'serviceCount':_0x2f4015[_0x267efd(0x1be)][_0x267efd(0x1bf)]};}export function listLocalServices(_0x3f140f={}){const _0x91499f=a34_0x2622f0;return readServiceRegistry(_0x3f140f)[_0x91499f(0x1be)];}export function getLocalServiceEntry(_0x229096,_0x1e93b5={}){const _0x50148f=a34_0x2622f0;return readServiceRegistry(_0x1e93b5)[_0x50148f(0x1be)][_0x50148f(0x1e2)](_0x5562d7=>_0x5562d7[_0x50148f(0x1c5)]===_0x229096['trim']());}export function listLocalServiceTrees(_0x16d771={}){const _0x2255ee=a34_0x2622f0;return readServiceRegistry(_0x16d771)['services'][_0x2255ee(0x1bb)](_0x177957=>_0x177957['normalizedManifest']);}export function inspectServiceRegistry(_0x49351c={}){const _0x1d219d=a34_0x2622f0,_0x5e5125=getServiceRegistryPath(_0x49351c);if(!existsSync(_0x5e5125))return emptyServiceRegistryInspection(_0x5e5125,_0x1d219d(0x19b),![]);try{const _0x3ad8d7=readFileSync(_0x5e5125,_0x1d219d(0x1c6));if(!_0x3ad8d7[_0x1d219d(0x1ba)]())return emptyServiceRegistryInspection(_0x5e5125,_0x1d219d(0x1e4),!![]);const _0x6289ed=JSON[_0x1d219d(0x1ad)](_0x3ad8d7);if(_0x6289ed[_0x1d219d(0x19d)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x5e5125,_0x1d219d(0x1bd),!![]),'schemaVersion':_0x6289ed[_0x1d219d(0x19d)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x6289ed['schemaVersion'])};if(!Array[_0x1d219d(0x1bc)](_0x6289ed[_0x1d219d(0x1be)]))return{...emptyServiceRegistryInspection(_0x5e5125,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x6289ed[_0x1d219d(0x1a2)],'message':_0x1d219d(0x1a0)};const _0x7f6d7a=_0x6289ed[_0x1d219d(0x1be)][_0x1d219d(0x1bb)](summarizeLocalServiceEntry);return{'registryPath':_0x5e5125,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x6289ed[_0x1d219d(0x1a2)],'serviceCount':_0x7f6d7a[_0x1d219d(0x1bf)],'commandCount':_0x7f6d7a[_0x1d219d(0x1ce)]((_0x1289ee,_0x4dcae9)=>_0x1289ee+_0x4dcae9[_0x1d219d(0x1d1)],0x0),'services':_0x7f6d7a};}catch(_0x3182e5){return{...emptyServiceRegistryInspection(_0x5e5125,_0x1d219d(0x1bd),!![]),'message':_0x3182e5 instanceof Error?_0x3182e5[_0x1d219d(0x1a9)]:String(_0x3182e5)};}}export function formatValidationFailure(_0x587cf2){const _0x16ae43=a34_0x2622f0,_0x33ccfd=_0x587cf2[_0x16ae43(0x1e1)][_0x16ae43(0x1bb)](_0x3bfb12=>_0x3bfb12[_0x16ae43(0x19f)]+':\x20'+_0x3bfb12[_0x16ae43(0x1a9)]);return _0x16ae43(0x1a8)+_0x33ccfd[_0x16ae43(0x1b6)]('\x0a');}function extractLoadedServiceManifests(_0x37b406,_0x435d37){const _0x3c35fd=a34_0x2622f0;if(!isServiceRegistryLike(_0x37b406)){const _0x207a68=_0x37b406,_0x3bd14f=validateServiceTreeManifest(_0x207a68);return[{'manifest':_0x207a68,'report':_0x3bd14f,'normalizedManifest':_0x3bd14f['ok']?normalizeServiceTreeManifest(_0x207a68):undefined,'sourceHash':_0x435d37}];}return _0x37b406['services'][_0x3c35fd(0x1bb)]((_0x53398d,_0x486f1d)=>{const _0x132c9e=_0x3c35fd,_0x312177=isObjectRecord(_0x53398d)?_0x53398d[_0x132c9e(0x1a6)]:undefined,_0xb51e3e=validateServiceTreeManifest(_0x312177),_0x33f505=isObjectRecord(_0x53398d)&&typeof _0x53398d[_0x132c9e(0x1c5)]===_0x132c9e(0x1a4)?_0x53398d[_0x132c9e(0x1c5)]:undefined;return{'manifest':_0x312177,'report':_0xb51e3e,'normalizedManifest':_0xb51e3e['ok']?normalizeServiceTreeManifest(_0x312177):undefined,'sourceHash':sha256(JSON[_0x132c9e(0x1e7)](_0x312177,null,0x2)+'\x0a'),'registryIndex':_0x486f1d,'registryServiceCode':_0x33f505};});}function aggregateValidationReports(_0x32af89){const _0x563b5e=a34_0x2622f0,_0x478218=_0x32af89['flatMap'](_0x66f26=>_0x66f26[_0x563b5e(0x1b3)]===undefined?_0x66f26[_0x563b5e(0x19c)][_0x563b5e(0x1e1)]:_0x66f26['report'][_0x563b5e(0x1e1)][_0x563b5e(0x1bb)](_0x44e030=>({..._0x44e030,'path':prefixRegistryIssuePath(_0x66f26[_0x563b5e(0x1b3)],_0x44e030[_0x563b5e(0x19f)])}))),_0x3524c7=_0x32af89[_0x563b5e(0x1c3)](_0x2b17d6=>_0x2b17d6['registryIndex']===undefined?_0x2b17d6['report'][_0x563b5e(0x1e8)]:_0x2b17d6[_0x563b5e(0x19c)][_0x563b5e(0x1e8)][_0x563b5e(0x1bb)](_0x281d52=>({..._0x281d52,'path':prefixRegistryIssuePath(_0x2b17d6['registryIndex'],_0x281d52[_0x563b5e(0x19f)])})));return{'ok':_0x478218[_0x563b5e(0x1bf)]===0x0,'errors':_0x478218,'warnings':_0x3524c7};}function prefixRegistryIssuePath(_0x5405b8,_0x51e9cc){const _0x49e5be=a34_0x2622f0;if(_0x51e9cc==='$')return _0x49e5be(0x199)+_0x5405b8+_0x49e5be(0x1b2);if(_0x51e9cc[_0x49e5be(0x1d8)]('$.'))return _0x49e5be(0x199)+_0x5405b8+_0x49e5be(0x1b2)+_0x51e9cc[_0x49e5be(0x19e)](0x1);if(_0x51e9cc[_0x49e5be(0x1d8)]('$['))return'$.services['+_0x5405b8+'].manifest'+_0x51e9cc['slice'](0x1);return _0x49e5be(0x199)+_0x5405b8+_0x49e5be(0x1b4)+_0x51e9cc;}function isServiceRegistryLike(_0x3db160){const _0x4fb3bd=a34_0x2622f0;return isObjectRecord(_0x3db160)&&_0x3db160[_0x4fb3bd(0x19d)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x4fb3bd(0x1bc)](_0x3db160['services']);}function isObjectRecord(_0x5c4906){const _0x414942=a34_0x2622f0;return Boolean(_0x5c4906)&&typeof _0x5c4906===_0x414942(0x1c8)&&!Array[_0x414942(0x1bc)](_0x5c4906);}function emptyServiceRegistryInspection(_0x250a06,_0x4a2099,_0xa90111){return{'registryPath':_0x250a06,'exists':_0xa90111,'status':_0x4a2099,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x52fa1b){const _0x3d7390=a34_0x2622f0,_0x578b03=_0x52fa1b[_0x3d7390(0x1d5)],_0x29a81f=_0x578b03[_0x3d7390(0x1b5)][_0x3d7390(0x1bb)](_0x251db9=>({'path':_0x251db9['cliPath'],'description':_0x251db9[_0x3d7390(0x1ab)],'risk':_0x251db9[_0x3d7390(0x1d9)],'targetKind':_0x251db9[_0x3d7390(0x1c4)]['kind'],'targetCommand':_0x251db9[_0x3d7390(0x1c4)][_0x3d7390(0x1a1)]}));return{'serviceCode':_0x52fa1b[_0x3d7390(0x1c5)],'name':_0x578b03[_0x3d7390(0x1e6)][_0x3d7390(0x1cf)],'description':_0x578b03[_0x3d7390(0x1e6)][_0x3d7390(0x1ab)],'version':_0x52fa1b[_0x3d7390(0x1cb)],'importedAt':_0x52fa1b[_0x3d7390(0x1ac)],'source':_0x52fa1b[_0x3d7390(0x1d2)],'commandCount':_0x29a81f['length'],'commands':_0x29a81f};}function sha256(_0x5b5262){const _0x2a5616=a34_0x2622f0;return createHash(_0x2a5616(0x1b8))['update'](_0x5b5262)[_0x2a5616(0x1b7)](_0x2a5616(0x1aa));}