@lovrabet/lovrabet-cli 2.1.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
- const a27_0x24ea57=a27_0x5459;function a27_0x34e7(){const _0x550aec=['7604200BwRhIP','detail','trim','build','list','verbose','4661836RoWZJF','File\x20not\x20found:\x20','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','6081348bqnjPP','topk','content','create','string','number','updateTime','utf8','isFinite','/client/knowledge-base/personal/','write','file','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','length','22859efQQBg','scope','7229349GocQPV','query','update','File\x20is\x20not\x20a\x20regular\x20file:\x20','str','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','version','POST','userId','Personal\x20knowledge-base\x20entry\x20ID','8tHJKxL','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','num','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','map','ragStatus','ragErrorMessage','title','description','score','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','validation','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','328362nOKAcc','weightedScore','flag','docId','appCode','read','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','metadata','search','58erSAHE','5iIZFEw','658668ocUorz','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'];a27_0x34e7=function(){return _0x550aec;};return a27_0x34e7();}(function(_0x346f61,_0x131225){const _0x1b8a46=a27_0x5459,_0x1c71d4=_0x346f61();while(!![]){try{const _0x3fc1c9=parseInt(_0x1b8a46(0x1c1))/0x1*(parseInt(_0x1b8a46(0x1a5))/0x2)+parseInt(_0x1b8a46(0x1a7))/0x3+-parseInt(_0x1b8a46(0x1af))/0x4+-parseInt(_0x1b8a46(0x1a6))/0x5*(-parseInt(_0x1b8a46(0x1da))/0x6)+-parseInt(_0x1b8a46(0x1b3))/0x7*(-parseInt(_0x1b8a46(0x1cd))/0x8)+-parseInt(_0x1b8a46(0x1c3))/0x9+parseInt(_0x1b8a46(0x1a9))/0xa;if(_0x3fc1c9===_0x131225)break;else _0x1c71d4['push'](_0x1c71d4['shift']());}catch(_0x1ace28){_0x1c71d4['push'](_0x1c71d4['shift']());}}}(a27_0x34e7,0x91e9a));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';function a27_0x5459(_0x14114b,_0x351aab){_0x14114b=_0x14114b-0x1a3;const _0x34e771=a27_0x34e7();let _0x545927=_0x34e771[_0x14114b];return _0x545927;}const TITLE_FLAG={'name':'title','type':a27_0x24ea57(0x1b7),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a27_0x24ea57(0x1be),'type':a27_0x24ea57(0x1b7),'required':!![],'description':a27_0x24ea57(0x1d9)},QUERY_FLAG={'name':'query','type':a27_0x24ea57(0x1b7),'required':!![],'description':a27_0x24ea57(0x1c8)},TOPK_FLAG={'name':a27_0x24ea57(0x1b4),'type':a27_0x24ea57(0x1b8),'description':a27_0x24ea57(0x1bf)};function readKnowledgeFile(_0x5cd896){const _0x3ef2e9=a27_0x24ea57;if(!_0x5cd896)throw CliErrors[_0x3ef2e9(0x1d8)]('File\x20path\x20is\x20required.');if(!existsSync(_0x5cd896))throw CliErrors['validation'](_0x3ef2e9(0x1b0)+_0x5cd896);if(!statSync(_0x5cd896)['isFile']())throw CliErrors[_0x3ef2e9(0x1d8)](_0x3ef2e9(0x1c6)+_0x5cd896);return readFileSync(_0x5cd896,_0x3ef2e9(0x1ba));}function summarizePersonalItem(_0x539cc9){const _0x335993=a27_0x24ea57;return{'id':_0x539cc9['id'],'title':_0x539cc9[_0x335993(0x1d4)],'version':_0x539cc9[_0x335993(0x1c9)],'ragStatus':_0x539cc9[_0x335993(0x1d2)],'ragErrorMessage':_0x539cc9[_0x335993(0x1d3)],'updateTime':_0x539cc9[_0x335993(0x1b9)]};}function detailPersonalItem(_0x2a7c72){const _0x274a28=a27_0x24ea57;return{'id':_0x2a7c72['id'],'appCode':_0x2a7c72['appCode'],'scope':_0x2a7c72['scope'],'userId':_0x2a7c72[_0x274a28(0x1cb)],'title':_0x2a7c72['title'],'content':_0x2a7c72[_0x274a28(0x1b5)]??'','version':_0x2a7c72[_0x274a28(0x1c9)],'ragStatus':_0x2a7c72[_0x274a28(0x1d2)],'ragErrorMessage':_0x2a7c72[_0x274a28(0x1d3)],'createTime':_0x2a7c72['createTime'],'updateTime':_0x2a7c72[_0x274a28(0x1b9)]};}function summarizeSearchHit(_0x24174a){const _0x4d1e8e=a27_0x24ea57;return{'scope':_0x24174a[_0x4d1e8e(0x1c2)],'docId':_0x24174a[_0x4d1e8e(0x1dd)],'score':_0x24174a[_0x4d1e8e(0x1d6)],'weightedScore':_0x24174a[_0x4d1e8e(0x1db)],'content':_0x24174a['content'],'metadata':_0x24174a[_0x4d1e8e(0x1a3)]};}function readTopK(_0x3ef4bc){const _0x24f8d2=a27_0x24ea57,_0x3461ba=_0x3ef4bc[_0x24f8d2(0x1dc)]('topk');if(_0x3461ba===undefined||_0x3461ba===null||_0x3461ba==='')return undefined;const _0x4ddb11=_0x3ef4bc['num'](_0x24f8d2(0x1b4));if(!Number[_0x24f8d2(0x1bb)](_0x4ddb11)||_0x4ddb11<0x1)throw CliErrors[_0x24f8d2(0x1d8)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x4ddb11;}const kbList={'service':'kb','command':a27_0x24ea57(0x1ad),'description':a27_0x24ea57(0x1d7),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x4f5466){const _0x1e5291=a27_0x24ea57,_0x9d1eda=await listPersonalKnowledgeBaseItems(_0x4f5466['appCode']);if(_0x4f5466['bool'](_0x1e5291(0x1ae)))return{'ok':!![],'data':{'total':_0x9d1eda[_0x1e5291(0x1c0)],'items':_0x9d1eda}};return{'ok':!![],'data':{'total':_0x9d1eda[_0x1e5291(0x1c0)],'items':_0x9d1eda[_0x1e5291(0x1d1)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a27_0x24ea57(0x1aa),'description':a27_0x24ea57(0x1d0),'risk':a27_0x24ea57(0x1df),'flags':[{...ID_FLAG,'description':a27_0x24ea57(0x1cc)}],async 'execute'(_0xbca40d){const _0xb9ce14=a27_0x24ea57,_0x178caf=await getPersonalKnowledgeBaseItem(_0xbca40d['num']('id'),_0xbca40d[_0xb9ce14(0x1de)]);return{'ok':!![],'data':detailPersonalItem(_0x178caf)};}},kbCreate={'service':'kb','command':a27_0x24ea57(0x1b6),'description':a27_0x24ea57(0x1b1),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x4bf8a9){const _0x57f0ed=a27_0x24ea57,_0x1803ef=_0x4bf8a9[_0x57f0ed(0x1c7)]('title'),_0x16e863=readKnowledgeFile(_0x4bf8a9[_0x57f0ed(0x1c7)](_0x57f0ed(0x1be))),_0x5471e0=await createPersonalKnowledgeBaseItem(_0x4bf8a9[_0x57f0ed(0x1de)],{'title':_0x1803ef,'content':_0x16e863});return{'ok':!![],'data':summarizePersonalItem(_0x5471e0),'message':'Created\x20KB\x20entry\x20'+_0x5471e0['id']+'\x20('+_0x5471e0[_0x57f0ed(0x1d4)]+')'};},async 'dryRun'(_0x45d5e9){const _0xfaba62=a27_0x24ea57,_0x34ed17=_0x45d5e9['str']('title'),_0x15746d=readKnowledgeFile(_0x45d5e9[_0xfaba62(0x1c7)](_0xfaba62(0x1be)));return dryRun(_0xfaba62(0x1ca),'/client/knowledge-base/personal/create')['body']({'appCode':_0x45d5e9['appCode'],'title':_0x34ed17,'content':_0x15746d})[_0xfaba62(0x1d5)](_0xfaba62(0x1b2)+_0x34ed17+'\x22')[_0xfaba62(0x1ac)]();}},kbUpdate={'service':'kb','command':a27_0x24ea57(0x1c5),'description':a27_0x24ea57(0x1e0),'risk':a27_0x24ea57(0x1bd),'flags':[{...ID_FLAG,'description':a27_0x24ea57(0x1cc)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x5149d3){const _0x28866e=a27_0x24ea57,_0x2f512b=_0x5149d3[_0x28866e(0x1cf)]('id'),_0x185987=readKnowledgeFile(_0x5149d3[_0x28866e(0x1c7)](_0x28866e(0x1be))),_0xc22633=_0x5149d3[_0x28866e(0x1c7)](_0x28866e(0x1d4))||(await getPersonalKnowledgeBaseItem(_0x2f512b,_0x5149d3[_0x28866e(0x1de)]))[_0x28866e(0x1d4)],_0x32df33=await updatePersonalKnowledgeBaseItem(_0x2f512b,_0x5149d3[_0x28866e(0x1de)],{'title':_0xc22633,'content':_0x185987});return{'ok':!![],'data':summarizePersonalItem(_0x32df33),'message':'Updated\x20KB\x20entry\x20'+_0x32df33['id']+'\x20('+_0x32df33['title']+')'};},async 'dryRun'(_0x3427c4){const _0x489b80=a27_0x24ea57,_0x2ed0c7=_0x3427c4[_0x489b80(0x1cf)]('id'),_0x3c2e67=readKnowledgeFile(_0x3427c4[_0x489b80(0x1c7)](_0x489b80(0x1be))),_0x489cbb=_0x3427c4[_0x489b80(0x1c7)]('title')||(await getPersonalKnowledgeBaseItem(_0x2ed0c7,_0x3427c4[_0x489b80(0x1de)]))[_0x489b80(0x1d4)];return dryRun(_0x489b80(0x1ca),_0x489b80(0x1bc)+_0x2ed0c7+'/update')['body']({'appCode':_0x3427c4[_0x489b80(0x1de)],'title':_0x489cbb,'content':_0x3c2e67})[_0x489b80(0x1d5)](_0x489b80(0x1a8)+_0x2ed0c7)[_0x489b80(0x1ac)]();}},kbSearch={'service':'kb','command':a27_0x24ea57(0x1a4),'description':a27_0x24ea57(0x1ce),'risk':a27_0x24ea57(0x1df),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x275e53){const _0x40fe0d=a27_0x24ea57;if(!_0x275e53['str'](_0x40fe0d(0x1c4))['trim']())throw CliErrors[_0x40fe0d(0x1d8)]('Search\x20query\x20is\x20required.');readTopK(_0x275e53);},async 'execute'(_0x24826b){const _0x49e2ad=a27_0x24ea57,_0x488ff1=_0x24826b[_0x49e2ad(0x1c7)](_0x49e2ad(0x1c4))[_0x49e2ad(0x1ab)](),_0x11d229=readTopK(_0x24826b),_0x552745=await searchKnowledgeBase(_0x24826b[_0x49e2ad(0x1de)],{'query':_0x488ff1,'topK':_0x11d229});return{'ok':!![],'data':{'total':_0x552745[_0x49e2ad(0x1c0)],'hits':_0x552745[_0x49e2ad(0x1d1)](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
- const a28_0x55e48f=a28_0x1f6b;(function(_0x563926,_0x5ab082){const _0x2059db=a28_0x1f6b,_0x4a6f4b=_0x563926();while(!![]){try{const _0x862d14=parseInt(_0x2059db(0x1ef))/0x1+-parseInt(_0x2059db(0x1e3))/0x2+parseInt(_0x2059db(0x1ed))/0x3+-parseInt(_0x2059db(0x1f1))/0x4*(-parseInt(_0x2059db(0x1fc))/0x5)+parseInt(_0x2059db(0x1fe))/0x6+-parseInt(_0x2059db(0x1fd))/0x7*(parseInt(_0x2059db(0x1f9))/0x8)+parseInt(_0x2059db(0x1eb))/0x9;if(_0x862d14===_0x5ab082)break;else _0x4a6f4b['push'](_0x4a6f4b['shift']());}catch(_0x3384ca){_0x4a6f4b['push'](_0x4a6f4b['shift']());}}}(a28_0x2009,0xd4904));function a28_0x1f6b(_0x5b1dcd,_0x40d32d){_0x5b1dcd=_0x5b1dcd-0x1e2;const _0x2009f5=a28_0x2009();let _0x1f6b32=_0x2009f5[_0x5b1dcd];return _0x1f6b32;}function a28_0x2009(){const _0x58f9eb=['length','24tciqbV','logs','\x20\x20\x20Duration:\x20','en-US','details','log','success','View\x20command\x20history\x20logs','6851528cHGKFb','*\x20Logs\x20cleared','duration','194355LVDIHP','14uOZwHC','8542956gZHuhL','write','toLocaleString','warn','1858538YqDSMh','message','\x20\x20\x20Time:\x20','readLogs','level','timestamp','stringify','show','6895341uefvYC','read','2898999xAmpvt','keys','123277iUYdZv'];a28_0x2009=function(){return _0x58f9eb;};return a28_0x2009();}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x47ff7a){const _0x4fa2fc=a28_0x1f6b;if(_0x47ff7a[_0x4fa2fc(0x1f0)]===0x0){console['log']('*\x20No\x20logs\x20found');return;}console[_0x4fa2fc(0x1f6)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x47ff7a['forEach']((_0x565e73,_0x1cadb4)=>{const _0x2e6240=_0x4fa2fc,_0x430411=new Date(_0x565e73[_0x2e6240(0x1e8)])[_0x2e6240(0x200)](_0x2e6240(0x1f4)),_0x1b0433=_0x565e73[_0x2e6240(0x1e7)]===_0x2e6240(0x1f7)?'√':_0x565e73[_0x2e6240(0x1e7)]==='error'?'×':_0x565e73['level']===_0x2e6240(0x1e2)?'!':'i';console[_0x2e6240(0x1f6)](_0x1cadb4+0x1+'.\x20'+_0x1b0433+'\x20['+_0x565e73['command']+']\x20'+_0x565e73[_0x2e6240(0x1e4)]),console[_0x2e6240(0x1f6)](_0x2e6240(0x1e5)+_0x430411),_0x565e73[_0x2e6240(0x1fb)]&&console[_0x2e6240(0x1f6)](_0x2e6240(0x1f3)+_0x565e73['duration']+'ms'),_0x565e73[_0x2e6240(0x1f5)]&&Object[_0x2e6240(0x1ee)](_0x565e73['details'])[_0x2e6240(0x1f0)]>0x0&&console[_0x2e6240(0x1f6)]('\x20\x20\x20Details:\x20'+JSON[_0x2e6240(0x1e9)](_0x565e73[_0x2e6240(0x1f5)],null,0x2)),console[_0x2e6240(0x1f6)]('');});}export const logsDefinitions=[{'service':a28_0x55e48f(0x1f2),'command':a28_0x55e48f(0x1ea),'description':a28_0x55e48f(0x1f8),'risk':a28_0x55e48f(0x1ec),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5cb2ca){const _0x454f94=a28_0x55e48f;return printLogs(logger[_0x454f94(0x1e6)]()),{'ok':!![]};}},{'service':a28_0x55e48f(0x1f2),'command':'clear','description':'Clear\x20command\x20history\x20logs','risk':a28_0x55e48f(0x1ff),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x439582){const _0x4fcbd9=a28_0x55e48f;return logger['clearLogs'](),console[_0x4fcbd9(0x1f6)](_0x4fcbd9(0x1fa)),{'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_0x3c9db5=a29_0x4c60;(function(_0x93dae,_0x186879){const _0x209de9=a29_0x4c60,_0x10522a=_0x93dae();while(!![]){try{const _0x299657=parseInt(_0x209de9(0x187))/0x1+-parseInt(_0x209de9(0x193))/0x2*(parseInt(_0x209de9(0x192))/0x3)+parseInt(_0x209de9(0x16d))/0x4+parseInt(_0x209de9(0x17b))/0x5+-parseInt(_0x209de9(0x166))/0x6+parseInt(_0x209de9(0x169))/0x7*(-parseInt(_0x209de9(0x176))/0x8)+parseInt(_0x209de9(0x189))/0x9;if(_0x299657===_0x186879)break;else _0x10522a['push'](_0x10522a['shift']());}catch(_0x154f0c){_0x10522a['push'](_0x10522a['shift']());}}}(a29_0x225c,0xe1b88));function a29_0x4c60(_0x3bfedf,_0x5ebb9e){_0x3bfedf=_0x3bfedf-0x15a;const _0x225cec=a29_0x225c();let _0x4c6018=_0x225cec[_0x3bfedf];return _0x4c6018;}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_0x3c9db5(0x18a),'type':a29_0x3c9db5(0x16b),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a29_0x3c9db5(0x16e),'type':a29_0x3c9db5(0x16b),'required':!![],'description':a29_0x3c9db5(0x185)},DESCRIPTION_FLAG={'name':a29_0x3c9db5(0x16c),'type':'string','description':a29_0x3c9db5(0x194)},SOURCE_SESSION_FLAG={'name':a29_0x3c9db5(0x197),'type':a29_0x3c9db5(0x16b),'description':a29_0x3c9db5(0x180)};function normalizeFunctionName(_0x583f22){const _0x537e24=a29_0x3c9db5,_0x1f0444=String(_0x583f22||'')[_0x537e24(0x160)]();if(!_0x1f0444||!FUNCTION_NAME_PATTERN[_0x537e24(0x168)](_0x1f0444))throw CliErrors[_0x537e24(0x186)](_0x537e24(0x183));return _0x1f0444;}function readScriptFile(_0x3c7cd8){const _0x2faf2f=a29_0x3c9db5;if(!_0x3c7cd8)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x3c7cd8))throw CliErrors[_0x2faf2f(0x186)](_0x2faf2f(0x165)+_0x3c7cd8);if(!statSync(_0x3c7cd8)['isFile']())throw CliErrors[_0x2faf2f(0x186)](_0x2faf2f(0x15f)+_0x3c7cd8);const _0x15317a=readFileSync(_0x3c7cd8,_0x2faf2f(0x18f));if(!_0x15317a[_0x2faf2f(0x160)]())throw CliErrors['validation'](_0x2faf2f(0x17f));return _0x15317a;}function optionalTrimmed(_0x36e198){const _0x530c56=a29_0x3c9db5,_0x174157=String(_0x36e198||'')[_0x530c56(0x160)]();return _0x174157||undefined;}function a29_0x225c(){const _0x374f58=['read','Preview:\x20create\x20personal\x20BFF\x20','13009272WjHXZl','Personal\x20BFF\x20script\x20ID','/client/runtime-bff/personal/','gmtModified','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','7261600XQojcE','params','Updated\x20personal\x20BFF\x20','scriptType','Personal\x20BFF\x20script\x20file\x20is\x20blank.','Optional\x20source\x20RuntimeAgent\x20session\x20id','create','isArray','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','map','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','validation','1848584npyPQo','bool','232785WqxWxq','file','/update','exec','write','personal-bff','utf8','sourceSessionId','createTime','3NUzWYR','2514982TlvCTK','Personal\x20BFF\x20description','body','num','source-session-id','/client/runtime-bff/personal/create','appCode','Preview:\x20update\x20personal\x20BFF\x20','POST','Show\x20one\x20personal\x20BFF\x20by\x20id','scriptContent','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','--params\x20must\x20be\x20a\x20JSON\x20object.','version','File\x20is\x20not\x20a\x20regular\x20file:\x20','trim','functionName','Executed\x20personal\x20BFF\x20','detail','updateTime','File\x20not\x20found:\x20','1311270VsztAb','Update\x20a\x20personal\x20BFF\x20by\x20id','test','7QlzcFR','flag','string','description','2799912wopOnB','name','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','build','config','high-risk-write','str'];a29_0x225c=function(){return _0x374f58;};return a29_0x225c();}function summarizeBff(_0x42d4f8){const _0x12d1c=a29_0x3c9db5;return{'id':_0x42d4f8['id'],'appCode':_0x42d4f8[_0x12d1c(0x199)],'functionName':_0x42d4f8['functionName'],'description':_0x42d4f8['description'],'scriptType':_0x42d4f8[_0x12d1c(0x17e)],'version':_0x42d4f8[_0x12d1c(0x15e)],'gmtModified':_0x42d4f8[_0x12d1c(0x179)],'updateTime':_0x42d4f8[_0x12d1c(0x164)]};}function detailBff(_0x4359b3){const _0x5cb146=a29_0x3c9db5;return{'id':_0x4359b3['id'],'appCode':_0x4359b3[_0x5cb146(0x199)],'functionName':_0x4359b3[_0x5cb146(0x161)],'description':_0x4359b3[_0x5cb146(0x16c)],'scriptType':_0x4359b3['scriptType'],'scriptContent':_0x4359b3[_0x5cb146(0x15b)]??'','config':_0x4359b3[_0x5cb146(0x171)],'version':_0x4359b3['version'],'createUserId':_0x4359b3['createUserId'],'gmtCreate':_0x4359b3['gmtCreate'],'gmtModified':_0x4359b3['gmtModified'],'createTime':_0x4359b3[_0x5cb146(0x191)],'updateTime':_0x4359b3[_0x5cb146(0x164)]};}function buildCreateInput(_0x464ffa){const _0x2cb9cb=a29_0x3c9db5;return{'functionName':normalizeFunctionName(_0x464ffa[_0x2cb9cb(0x173)](_0x2cb9cb(0x16e))),...optionalTrimmed(_0x464ffa[_0x2cb9cb(0x173)](_0x2cb9cb(0x16c)))?{'description':optionalTrimmed(_0x464ffa['str']('description'))}:{},'scriptContent':readScriptFile(_0x464ffa[_0x2cb9cb(0x173)](_0x2cb9cb(0x18a))),...optionalTrimmed(_0x464ffa[_0x2cb9cb(0x173)](_0x2cb9cb(0x197)))?{'sourceSessionId':optionalTrimmed(_0x464ffa[_0x2cb9cb(0x173)](_0x2cb9cb(0x197)))}:{}};}function buildUpdateInput(_0x14539b){const _0x36ab1f=a29_0x3c9db5,_0x4e2c74={};optionalTrimmed(_0x14539b[_0x36ab1f(0x173)](_0x36ab1f(0x16e)))&&(_0x4e2c74[_0x36ab1f(0x161)]=normalizeFunctionName(_0x14539b[_0x36ab1f(0x173)](_0x36ab1f(0x16e))));_0x14539b['flag'](_0x36ab1f(0x16c))!==undefined&&(_0x4e2c74[_0x36ab1f(0x16c)]=_0x14539b[_0x36ab1f(0x173)](_0x36ab1f(0x16c)));optionalTrimmed(_0x14539b['str'](_0x36ab1f(0x18a)))&&(_0x4e2c74[_0x36ab1f(0x15b)]=readScriptFile(_0x14539b[_0x36ab1f(0x173)]('file')));_0x14539b[_0x36ab1f(0x16a)](_0x36ab1f(0x197))!==undefined&&(_0x4e2c74[_0x36ab1f(0x190)]=_0x14539b[_0x36ab1f(0x173)](_0x36ab1f(0x197)));if(Object['keys'](_0x4e2c74)['length']===0x0)throw CliErrors[_0x36ab1f(0x186)](_0x36ab1f(0x15c));return _0x4e2c74;}function parseExecParams(_0x169bda){const _0xb1239c=a29_0x3c9db5,_0x1d7784=parseJsonParams(_0x169bda)??{};if(Array[_0xb1239c(0x182)](_0x1d7784))throw CliErrors['validation'](_0xb1239c(0x15d));return _0x1d7784;}const personalBffList={'service':a29_0x3c9db5(0x18e),'command':'list','description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a29_0x3c9db5(0x174),'flags':[VERBOSE_FLAG],async 'execute'(_0x18cb08){const _0x2f48a4=a29_0x3c9db5,_0x4a42a1=await listPersonalBffs(_0x18cb08['appCode']);return{'ok':!![],'data':{'total':_0x4a42a1['length'],'items':_0x18cb08[_0x2f48a4(0x188)]('verbose')?_0x4a42a1:_0x4a42a1[_0x2f48a4(0x184)](summarizeBff)}};}},personalBffDetail={'service':a29_0x3c9db5(0x18e),'command':a29_0x3c9db5(0x163),'description':a29_0x3c9db5(0x15a),'risk':'read','flags':[{...ID_FLAG,'description':a29_0x3c9db5(0x177)}],async 'execute'(_0x46b118){const _0x505b1a=a29_0x3c9db5,_0x4b2429=await getPersonalBff(_0x46b118[_0x505b1a(0x196)]('id'),_0x46b118[_0x505b1a(0x199)]);return{'ok':!![],'data':detailBff(_0x4b2429)};}},personalBffCreate={'service':a29_0x3c9db5(0x18e),'command':a29_0x3c9db5(0x181),'description':a29_0x3c9db5(0x17a),'risk':a29_0x3c9db5(0x18d),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x2aac2f){const _0x4dd73d=a29_0x3c9db5,_0x460654=buildCreateInput(_0x2aac2f),_0x385e0c=await createPersonalBff(_0x2aac2f[_0x4dd73d(0x199)],_0x460654);return{'ok':!![],'data':detailBff(_0x385e0c),'message':'Created\x20personal\x20BFF\x20'+_0x385e0c['id']+(_0x385e0c[_0x4dd73d(0x161)]?'\x20('+_0x385e0c['functionName']+')':'')};},async 'dryRun'(_0x21e979){const _0x26d4a0=a29_0x3c9db5,_0x297a72=buildCreateInput(_0x21e979);return dryRun(_0x26d4a0(0x19b),_0x26d4a0(0x198))[_0x26d4a0(0x195)]({'appCode':_0x21e979[_0x26d4a0(0x199)],..._0x297a72})[_0x26d4a0(0x16c)](_0x26d4a0(0x175)+_0x297a72['functionName'])[_0x26d4a0(0x170)]();}},personalBffUpdate={'service':a29_0x3c9db5(0x18e),'command':'update','description':a29_0x3c9db5(0x167),'risk':a29_0x3c9db5(0x18d),'flags':[{...ID_FLAG,'description':a29_0x3c9db5(0x177)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x33baa3){const _0x424315=a29_0x3c9db5,_0x3859f2=_0x33baa3[_0x424315(0x196)]('id'),_0x22fbe6=buildUpdateInput(_0x33baa3),_0x2e47ea=await updatePersonalBff(_0x3859f2,_0x33baa3[_0x424315(0x199)],_0x22fbe6);return{'ok':!![],'data':detailBff(_0x2e47ea),'message':_0x424315(0x17d)+_0x2e47ea['id']+(_0x2e47ea[_0x424315(0x161)]?'\x20('+_0x2e47ea[_0x424315(0x161)]+')':'')};},async 'dryRun'(_0x5e0a84){const _0x4ca917=a29_0x3c9db5,_0x1f12d9=_0x5e0a84[_0x4ca917(0x196)]('id'),_0x4c63bd=buildUpdateInput(_0x5e0a84);return dryRun(_0x4ca917(0x19b),_0x4ca917(0x178)+_0x1f12d9+_0x4ca917(0x18b))[_0x4ca917(0x195)]({'appCode':_0x5e0a84['appCode'],..._0x4c63bd})[_0x4ca917(0x16c)](_0x4ca917(0x19a)+_0x1f12d9)[_0x4ca917(0x170)]();}},personalBffExec={'service':'personal-bff','command':a29_0x3c9db5(0x18c),'description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':a29_0x3c9db5(0x172),'flags':[{...ID_FLAG,'description':a29_0x3c9db5(0x177)},{...PARAMS_FLAG,'description':a29_0x3c9db5(0x16f)}],async 'validate'(_0x56a34f){const _0x3a3de2=a29_0x3c9db5;parseExecParams(_0x56a34f[_0x3a3de2(0x173)]('params'));},async 'execute'(_0x468bd0){const _0x2d9ca9=a29_0x3c9db5,_0x37ffbc=_0x468bd0[_0x2d9ca9(0x196)]('id'),_0x219778=parseExecParams(_0x468bd0['str'](_0x2d9ca9(0x17c))),_0x41ffb9=await executePersonalBff(_0x37ffbc,_0x468bd0[_0x2d9ca9(0x199)],_0x219778);return{'ok':!![],'data':{'result':_0x41ffb9},'message':_0x2d9ca9(0x162)+_0x37ffbc};}};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_0x5370c2=a30_0x3895;(function(_0x262422,_0x3eabbc){const _0x4d7a6b=a30_0x3895,_0x373425=_0x262422();while(!![]){try{const _0x5c32d0=-parseInt(_0x4d7a6b(0x9a))/0x1*(-parseInt(_0x4d7a6b(0x8b))/0x2)+-parseInt(_0x4d7a6b(0x8a))/0x3+-parseInt(_0x4d7a6b(0x99))/0x4*(-parseInt(_0x4d7a6b(0x94))/0x5)+parseInt(_0x4d7a6b(0x89))/0x6+parseInt(_0x4d7a6b(0x7e))/0x7*(-parseInt(_0x4d7a6b(0x7c))/0x8)+parseInt(_0x4d7a6b(0x80))/0x9+parseInt(_0x4d7a6b(0x8c))/0xa*(-parseInt(_0x4d7a6b(0x8d))/0xb);if(_0x5c32d0===_0x3eabbc)break;else _0x373425['push'](_0x373425['shift']());}catch(_0x1cdd5c){_0x373425['push'](_0x373425['shift']());}}}(a30_0x3021,0xcaa9a));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';function a30_0x3021(){const _0x4af137=['Logs','1842224ekBNyQ','1fkyYwX','Authentication','write','isSingleCommand','list','Knowledge\x20Base','command','Schema','set','Configuration','service','600UdWPsa','has','47110LsKjdS','\x20\x20[write]','2784186hfTShe','run','Artifacts','values','BFF\x20Scripts','SQL\x20Queries','risk','\x20\x20[high-risk-write]','map','4257102gPIREV','3062652TkQiPA','2607178vUvRxs','13483880DVWpeo','11POtTBi','get','defaultCommand','push','Instant\x20API','install','CLI\x20Built-in\x20Skill','15qtSfDk','Diagnostics','from','Personal\x20BFF'];a30_0x3021=function(){return _0x4af137;};return a30_0x3021();}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';function a30_0x3895(_0x5748ae,_0x3950ee){_0x5748ae=_0x5748ae-0x7b;const _0x302108=a30_0x3021();let _0x389511=_0x302108[_0x5748ae];return _0x389511;}import{personalBffDefinitions}from'../commands/personal-bff/index.js';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(_0x226d27){const _0x714620=a30_0x3895;for(const _0x384768 of _0x226d27){definitions[_0x714620(0xa2)](_0x384768[_0x714620(0x7b)]+':'+_0x384768[_0x714620(0xa0)],_0x384768);let _0x1c968b=serviceGroups[_0x714620(0x8e)](_0x384768[_0x714620(0x7b)]);!_0x1c968b&&(_0x1c968b=[],serviceGroups[_0x714620(0xa2)](_0x384768['service'],_0x1c968b)),_0x1c968b[_0x714620(0x90)](_0x384768);}}function registerService(_0x27c8dd,_0x2a1daa,_0x14ba86){const _0xfeedc6=a30_0x3895;registerDefinitions(_0x2a1daa);const _0x22ba72=_0x8f1893=>_0x8f1893==='read'?'':_0x8f1893===_0xfeedc6(0x9c)?_0xfeedc6(0x7f):_0xfeedc6(0x87),_0x488310={'service':_0x2a1daa[0x0][_0xfeedc6(0x7b)],'label':_0x27c8dd,'commands':_0x2a1daa[_0xfeedc6(0x88)](_0x5a5677=>({'command':_0x5a5677['command'],'description':_0x5a5677['description'],'tag':_0x22ba72(_0x5a5677[_0xfeedc6(0x86)])})),'defaultCommand':_0x14ba86?.[_0xfeedc6(0x8f)]??(_0x14ba86?.['isSingleCommand']?_0x2a1daa[0x0][_0xfeedc6(0xa0)]:undefined),'isSingleCommand':_0x14ba86?.[_0xfeedc6(0x9d)]};serviceRegistry[_0xfeedc6(0x90)](_0x488310),serviceByName[_0xfeedc6(0xa2)](_0x488310['service'],_0x488310);}registerService(a30_0x5370c2(0x9b),authDefinitions,{'defaultCommand':'login'}),registerService('API\x20Documentation',apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a30_0x5370c2(0x91),dataDefinitions),registerService(a30_0x5370c2(0x85),sqlDefinitions),registerService(a30_0x5370c2(0x84),bffDefinitions),registerService(a30_0x5370c2(0x97),personalBffDefinitions),registerService(a30_0x5370c2(0x82),artifactDefinitions),registerService(a30_0x5370c2(0x9f),kbDefinitions),registerService('App\x20Management',appDefinitions,{'defaultCommand':a30_0x5370c2(0x9e)}),registerService('Workspace',workspaceDefinitions),registerService(a30_0x5370c2(0xa3),configDefinitions,{'defaultCommand':a30_0x5370c2(0x9e)}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':'list'}),registerService('Skills',skillDefinitions,{'defaultCommand':a30_0x5370c2(0x92)}),registerService(a30_0x5370c2(0x93),cliSkillDefinitions,{'defaultCommand':a30_0x5370c2(0x92)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a30_0x5370c2(0x81),'isSingleCommand':!![]}),registerService(a30_0x5370c2(0x95),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a30_0x5370c2(0xa1),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a30_0x5370c2(0x98),logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x24b2ca,_0x263d9b){const _0x3bcb84=a30_0x5370c2;return definitions[_0x3bcb84(0x8e)](_0x24b2ca+':'+_0x263d9b);}export function isKnownService(_0x16898f){const _0x5313dd=a30_0x5370c2;return serviceByName[_0x5313dd(0x7d)](_0x16898f);}export function getServiceEntry(_0x27c754){const _0x4851bd=a30_0x5370c2;return serviceByName[_0x4851bd(0x8e)](_0x27c754);}export function getAllDefinitions(){const _0x9f72ff=a30_0x5370c2;return Array[_0x9f72ff(0x96)](definitions[_0x9f72ff(0x83)]());}
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_0x42ae1d=a31_0xe7dc;(function(_0x49cefd,_0x88781a){const _0xdcf813=a31_0xe7dc,_0x3a9b46=_0x49cefd();while(!![]){try{const _0x3a99cd=-parseInt(_0xdcf813(0x187))/0x1*(parseInt(_0xdcf813(0x184))/0x2)+parseInt(_0xdcf813(0x18a))/0x3+-parseInt(_0xdcf813(0x17d))/0x4*(-parseInt(_0xdcf813(0x17f))/0x5)+-parseInt(_0xdcf813(0x180))/0x6*(parseInt(_0xdcf813(0x185))/0x7)+parseInt(_0xdcf813(0x182))/0x8+-parseInt(_0xdcf813(0x186))/0x9*(-parseInt(_0xdcf813(0x188))/0xa)+parseInt(_0xdcf813(0x181))/0xb*(-parseInt(_0xdcf813(0x17e))/0xc);if(_0x3a99cd===_0x88781a)break;else _0x3a9b46['push'](_0x3a9b46['shift']());}catch(_0x3f802){_0x3a9b46['push'](_0x3a9b46['shift']());}}}(a31_0x56c6,0xd6a8e));function a31_0x56c6(){const _0x3ec022=['1INaqUL','10KqlAKx','read','4084167XyFiHX','180876FfKBxT','12WgXFYF','175vApVKa','1272036XFGbOz','20626012ZhrdoQ','13157232EDYMyp','export','2405782FVNlPQ','42YMqGOk','5765013gtdSvi'];a31_0x56c6=function(){return _0x3ec022;};return a31_0x56c6();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x551918){const _0x373b24=await buildSchemaPayload();return{'ok':!![],'data':_0x373b24};}function a31_0xe7dc(_0x16ed3b,_0x2df7cf){_0x16ed3b=_0x16ed3b-0x17d;const _0x56c6cd=a31_0x56c6();let _0xe7dc6=_0x56c6cd[_0x16ed3b];return _0xe7dc6;}export const schemaDefinition={'service':'schema','command':a31_0x42ae1d(0x183),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a31_0x42ae1d(0x189),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
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(_0x3ac765,_0x3f0787){const _0x31f9f0=a32_0x24fb,_0x4029bf=_0x3ac765();while(!![]){try{const _0x3b159b=-parseInt(_0x31f9f0(0x1cc))/0x1*(parseInt(_0x31f9f0(0x18b))/0x2)+parseInt(_0x31f9f0(0x1e3))/0x3*(parseInt(_0x31f9f0(0x190))/0x4)+parseInt(_0x31f9f0(0x1b7))/0x5*(-parseInt(_0x31f9f0(0x187))/0x6)+-parseInt(_0x31f9f0(0x1c5))/0x7*(parseInt(_0x31f9f0(0x1a6))/0x8)+parseInt(_0x31f9f0(0x1ba))/0x9*(parseInt(_0x31f9f0(0x1e1))/0xa)+-parseInt(_0x31f9f0(0x194))/0xb+parseInt(_0x31f9f0(0x181))/0xc;if(_0x3b159b===_0x3f0787)break;else _0x4029bf['push'](_0x4029bf['shift']());}catch(_0x201df3){_0x4029bf['push'](_0x4029bf['shift']());}}}(a32_0x1425,0xc06d3));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(_0x2254b7,_0x15e0b1){const _0x1b8e00=a32_0x24fb,_0x480765=listLocalServiceTrees();let _0x595596;for(const _0x3ae4c6 of _0x480765){const _0x150d04=matchServiceTreeCommand(_0x3ae4c6,_0x2254b7);if(!_0x150d04)continue;(!_0x595596||_0x150d04[_0x1b8e00(0x1db)][_0x1b8e00(0x185)][_0x1b8e00(0x17a)]>_0x595596[_0x1b8e00(0x1db)][_0x1b8e00(0x185)][_0x1b8e00(0x17a)])&&(_0x595596={'tree':_0x3ae4c6,'command':_0x150d04['command'],'remainingArgs':_0x150d04['remainingArgs']});}if(!_0x595596)return undefined;const _0x423a3e={..._0x15e0b1};return applyAppBinding(_0x595596[_0x1b8e00(0x17b)],_0x595596[_0x1b8e00(0x1db)],_0x423a3e),{'definition':buildDynamicCommandDefinition(_0x595596['tree'],_0x595596[_0x1b8e00(0x1db)]),'args':_0x595596['remainingArgs'],'flags':_0x423a3e,'tree':_0x595596[_0x1b8e00(0x17b)],'command':_0x595596[_0x1b8e00(0x1db)]};}export function generateDynamicServiceHelp(_0x4ca05c){const _0x176d09=a32_0x24fb,_0x4a94c2=listLocalServiceTrees()['find'](_0x545dc3=>_0x545dc3['service'][_0x176d09(0x191)]===_0x4ca05c);if(!_0x4a94c2)return undefined;const _0x3e9481=[CLI_BIN_NAME+'\x20'+_0x4ca05c+_0x176d09(0x1b9),'',_0x4a94c2[_0x176d09(0x1dd)][_0x176d09(0x1be)]||_0x4ca05c,_0x4a94c2[_0x176d09(0x1dd)][_0x176d09(0x19f)]?'\x20\x20'+_0x4a94c2[_0x176d09(0x1dd)][_0x176d09(0x19f)]:'','',_0x176d09(0x17d),..._0x4a94c2['commands']['map'](_0x509fa1=>{const _0x39e9f5=_0x176d09,_0x1055a7=_0x509fa1[_0x39e9f5(0x185)][_0x39e9f5(0x19b)](0x1)[_0x39e9f5(0x1de)]('\x20'),_0x20e06e=_0x509fa1[_0x39e9f5(0x192)]==='read'?'':'\x20['+_0x509fa1['risk']+']';return'\x20\x20'+_0x1055a7[_0x39e9f5(0x182)](0x18)+'\x20'+(_0x509fa1[_0x39e9f5(0x19f)]||'')+_0x20e06e;}),'',_0x176d09(0x1c0)+CLI_BIN_NAME+_0x176d09(0x1ce)+_0x4ca05c+_0x176d09(0x1ab)][_0x176d09(0x1c8)](Boolean);return _0x3e9481[_0x176d09(0x1de)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x165809=>{const _0x1fcb03=a32_0x24fb,_0x33a6c3=_0x165809[_0x1fcb03(0x1c9)];return{'service':_0x33a6c3[_0x1fcb03(0x1dd)]['code'],'label':_0x33a6c3[_0x1fcb03(0x1dd)][_0x1fcb03(0x1be)]||_0x33a6c3[_0x1fcb03(0x1dd)][_0x1fcb03(0x191)],'commands':_0x33a6c3['commands'][_0x1fcb03(0x1a3)](_0x1a5bda=>({'command':dynamicCommandName(_0x1a5bda),'description':_0x1a5bda[_0x1fcb03(0x19f)]||_0x1fcb03(0x1b0)+_0x1a5bda['cliPath'],'tag':riskTag(_0x1a5bda[_0x1fcb03(0x192)])}))};});}export function getDynamicServiceEntry(_0x180516){const _0x4491ee=a32_0x24fb;return listDynamicServiceEntries()[_0x4491ee(0x18a)](_0x3dc13f=>_0x3dc13f['service']===_0x180516);}export function listDynamicServiceDefinitions(_0x26110b){const _0x1ae8a9=a32_0x24fb;return listLocalServiceTrees()['filter'](_0x28837c=>!_0x26110b||_0x28837c[_0x1ae8a9(0x1dd)][_0x1ae8a9(0x191)]===_0x26110b)[_0x1ae8a9(0x1d0)](_0x1cabcc=>_0x1cabcc[_0x1ae8a9(0x1cd)][_0x1ae8a9(0x1a3)](_0x37f640=>buildDynamicCommandDefinition(_0x1cabcc,_0x37f640)));}export function getDynamicServiceDefinitions(_0x3b52c4){const _0x4bc10e=a32_0x24fb,_0x2c5dd1=listDynamicServiceDefinitions(_0x3b52c4);return _0x2c5dd1[_0x4bc10e(0x17a)]>0x0?_0x2c5dd1:undefined;}export function findDynamicServiceDefinition(_0x7506eb,_0x5be0b0){const _0xc8bbcf=a32_0x24fb;return listDynamicServiceDefinitions(_0x7506eb)[_0xc8bbcf(0x18a)](_0x3ca36f=>_0x3ca36f[_0xc8bbcf(0x1db)]===_0x5be0b0);}export function buildDynamicCommandDefinition(_0x1aeb80,_0x18f505){const _0x17502c=a32_0x24fb;return{'service':_0x1aeb80[_0x17502c(0x1dd)][_0x17502c(0x191)],'command':dynamicCommandName(_0x18f505),'description':_0x18f505[_0x17502c(0x19f)]||_0x17502c(0x1b0)+_0x18f505[_0x17502c(0x1a7)],'risk':_0x18f505[_0x17502c(0x192)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x18f505['args'][_0x17502c(0x1a3)](_0x27e12d=>({'name':_0x27e12d[_0x17502c(0x1be)],'description':_0x27e12d[_0x17502c(0x19f)]||_0x27e12d['name'],'required':_0x27e12d[_0x17502c(0x1e4)]})),'flags':_0x18f505[_0x17502c(0x1c2)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x18f505),async 'dryRun'(_0x21a67a){const _0x316cd4=_0x17502c,_0x36a000=await compilePlan(_0x18f505,_0x21a67a);return{'method':_0x316cd4(0x1a0),'url':_0x18f505[_0x316cd4(0x1a7)],'body':{'target':targetPreview(_0x36a000),'params':_0x36a000[_0x316cd4(0x1d7)]},'description':_0x316cd4(0x1ae)+_0x18f505[_0x316cd4(0x1a7)]};},async 'execute'(_0x3a8158){const _0x3e5999=_0x17502c,_0x50324c=await compilePlan(_0x18f505,_0x3a8158),_0x3f63fd=Date[_0x3e5999(0x193)](),_0x3753a6=await executePlan(_0x50324c,_0x18f505,_0x3a8158),_0x448b72=Date[_0x3e5999(0x193)]()-_0x3f63fd;return{'ok':!![],'data':{'service':_0x1aeb80[_0x3e5999(0x1dd)],'command':_0x18f505['cliPath'],'target':targetPreview(_0x50324c),'result':_0x3753a6,'elapsed':_0x448b72},'message':_0x3e5999(0x1d2)+_0x18f505[_0x3e5999(0x1a7)]+_0x3e5999(0x1d5)+_0x448b72+'ms'};}};}function a32_0x24fb(_0x1a2b1f,_0x57689f){_0x1a2b1f=_0x1a2b1f-0x17a;const _0x142592=a32_0x1425();let _0x24fb6b=_0x142592[_0x1a2b1f];return _0x24fb6b;}function dynamicCommandName(_0x4283bf){const _0x42eee0=a32_0x24fb;return _0x4283bf[_0x42eee0(0x185)][_0x42eee0(0x19b)](0x1)[_0x42eee0(0x1de)]('\x20');}function riskTag(_0x3364ec){const _0x7770b2=a32_0x24fb;return _0x3364ec===_0x7770b2(0x1bd)?'':_0x7770b2(0x19a)+_0x3364ec+']';}function flagToCommandFlag(_0x540408){const _0x49e8e7=a32_0x24fb;return{'name':_0x540408['cliName'],'type':_0x540408[_0x49e8e7(0x1a1)]===_0x49e8e7(0x18e)?'string':_0x540408['type'],'description':_0x540408[_0x49e8e7(0x19f)]||_0x540408['name'],'required':_0x540408['required'],'default':isPrimitiveFlagDefault(_0x540408[_0x49e8e7(0x1e0)])?_0x540408[_0x49e8e7(0x1e0)]:undefined,'enum':_0x540408[_0x49e8e7(0x1d3)]};}async function compilePlan(_0x3bc1ed,_0x12b2f5){const _0x913ebd=a32_0x24fb;return compileServiceTreeCommand(_0x3bc1ed,{'flags':_0x12b2f5[_0x913ebd(0x18c)],'args':_0x12b2f5[_0x913ebd(0x1a8)],'context':await buildServiceContext(_0x3bc1ed,_0x12b2f5)});}async function buildServiceContext(_0x27a5e1,_0x40830f){const _0xadf375=a32_0x24fb,_0x34c7a8={'appCode':_0x40830f['appCode'],'env':_0x40830f['envName'],'envName':_0x40830f['envName']};if(!usesRuntimeContext(_0x27a5e1))return _0x34c7a8;const _0x4b14d0=await getLoginUserInfo(),_0x482198=pickFirst(_0x4b14d0[_0xadf375(0x17c)],_0x4b14d0['id']);return{..._0x34c7a8,'user':_0x4b14d0,'userId':_0x482198,'id':_0x4b14d0['id'],'username':pickFirst(_0x4b14d0['username'],_0x4b14d0[_0xadf375(0x1bc)],_0x4b14d0[_0xadf375(0x196)]),'userName':_0x4b14d0[_0xadf375(0x1bc)],'nickname':pickFirst(_0x4b14d0['nickname'],_0x4b14d0[_0xadf375(0x18d)]),'nickName':_0x4b14d0[_0xadf375(0x18d)],'tenantCode':_0x4b14d0['tenantCode'],'employeeId':_0x4b14d0[_0xadf375(0x1c3)]};}function usesRuntimeContext(_0x293e21){const _0xff30d2=a32_0x24fb;return _0x293e21[_0xff30d2(0x17f)][_0xff30d2(0x198)](_0x2b2b7e=>typeof _0x2b2b7e[_0xff30d2(0x1b1)]===_0xff30d2(0x19c)&&(_0x2b2b7e[_0xff30d2(0x1b1)][_0xff30d2(0x1d6)](_0xff30d2(0x1b5))||_0x2b2b7e[_0xff30d2(0x1b1)]['startsWith'](_0xff30d2(0x1b4))));}function a32_0x1425(){const _0x45278e=['flags','employeeId','env','5481266DOeLRT','\x22\x20in\x20service\x20command\x20','\x20\x20SERVICE\x20TREE\x20TARGET','filter','normalizedManifest','\x20\x20\x20\x20datasetCode:\x20','kind','192968SRVztw','commands','\x20service\x20detail\x20--service\x20','dbtableConfig','flatMap','\x20\x20\x20\x20command:\x20','Service\x20command\x20','enum','Unsupported\x20service\x20target\x20kind:\x20','\x20completed\x20in\x20','startsWith','params','datasetCode','\x20\x20\x20\x20datatable:\x20','tableName','command','\x20requires\x20target.scriptName.','service','join','sql','default','20GMOXPp','target','6saBVtK','required','length','tree','userId','Commands:','bff','mapTo','number','25440504hSgYyn','padEnd','\x20\x20MAP\x20TO','push','fullPath','fromEntries','8226690ahQLPy','trim','validation','find','2WgtsJL','rawFlags','nickName','json','bffId','2075228Rkkpwg','code','risk','now','15898784eBROFd','Cannot\x20resolve\x20datatable\x20\x22','loginName','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','some','\x20->\x20','\x20\x20[','slice','string','\x20\x20\x20\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','description','SERVICE_TREE','type','appRef','map','bffCode','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','8bLnYIU','cliPath','args','appcode','appCode','`\x20to\x20inspect\x20the\x20manifest.','data','sqlCode','Preview\x20dynamic\x20service\x20command:\x20','\x20\x20\x20\x20scriptName:\x20','Run\x20service\x20command\x20','source','scriptName','app','ctx.','context.','operator','5KBpGRe','Unknown\x20appRef\x20\x22','\x20<command>\x20[flags]','6403446LvxtBh','datatable','userName','read','name','const','Use\x20`','boolean'];a32_0x1425=function(){return _0x45278e;};return a32_0x1425();}function pickFirst(..._0x57116e){const _0x512036=a32_0x24fb;return _0x57116e[_0x512036(0x18a)](_0x1cfa95=>_0x1cfa95!==undefined&&_0x1cfa95!==null);}async function executePlan(_0x1172df,_0x422803,_0x1e0358){const _0x52af72=a32_0x24fb;if(_0x1172df[_0x52af72(0x1cb)]===_0x52af72(0x1ac)){const _0x52ebd7=await resolveDatasetCode(_0x1172df,_0x422803,_0x1e0358);return executeData(_0x52ebd7,_0x1172df[_0x52af72(0x1db)],_0x1172df['params']);}if(_0x1172df[_0x52af72(0x1cb)]===_0x52af72(0x1df)){if(!_0x1172df[_0x52af72(0x1ad)])throw CliErrors[_0x52af72(0x189)](_0x52af72(0x1d2)+_0x422803[_0x52af72(0x1a7)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x1172df[_0x52af72(0x1ad)],normalizeScalarParams(_0x1172df[_0x52af72(0x1d7)]));}if(_0x1172df[_0x52af72(0x1cb)]===_0x52af72(0x17e)){const _0x2a383=_0x1172df['scriptName']||_0x1172df[_0x52af72(0x1a4)]||(_0x1172df[_0x52af72(0x18f)]==null?'':String(_0x1172df[_0x52af72(0x18f)]));if(!_0x2a383)throw CliErrors[_0x52af72(0x189)](_0x52af72(0x1d2)+_0x422803[_0x52af72(0x1a7)]+_0x52af72(0x1dc));return executeSdkBff(_0x2a383,_0x1172df[_0x52af72(0x1d7)]);}throw CliErrors[_0x52af72(0x189)](_0x52af72(0x1d4)+_0x1172df['kind']);}async function resolveDatasetCode(_0xedbde6,_0x5afde,_0x3cb2df){const _0x1aa248=a32_0x24fb;if(_0xedbde6[_0x1aa248(0x1d8)])return _0xedbde6[_0x1aa248(0x1d8)];if(!_0xedbde6[_0x1aa248(0x1bb)])throw CliErrors[_0x1aa248(0x189)]('Service\x20command\x20'+_0x5afde['cliPath']+_0x1aa248(0x197));const _0x109b31=await listDatasets(_0x3cb2df[_0x1aa248(0x1aa)]),_0x37be5f=_0x109b31[_0x1aa248(0x18a)](_0x414b20=>_0x414b20[_0x1aa248(0x1cf)]?.[_0x1aa248(0x1da)]===_0xedbde6['datatable']);if(!_0x37be5f?.[_0x1aa248(0x191)])throw CliErrors[_0x1aa248(0x189)](_0x1aa248(0x195)+_0xedbde6[_0x1aa248(0x1bb)]+_0x1aa248(0x1a5)+_0x3cb2df[_0x1aa248(0x1aa)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x37be5f[_0x1aa248(0x191)];}function applyAppBinding(_0x5464ef,_0x408ca8,_0x47dabf){const _0x52e1ee=a32_0x24fb,_0x1cf5d3=_0x408ca8[_0x52e1ee(0x1e2)]['appRef'];if(!_0x1cf5d3)return;const _0x4e759d=_0x5464ef['appBindings'][_0x1cf5d3];if(!_0x4e759d)throw CliErrors['validation'](_0x52e1ee(0x1b8)+_0x1cf5d3+_0x52e1ee(0x1c6)+_0x408ca8[_0x52e1ee(0x1a7)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x4b2413=_0x4e759d[_0x52e1ee(0x1a9)]||_0x4e759d['appCode'];_0x4b2413&&!hasText(_0x47dabf[_0x52e1ee(0x1a9)])&&(_0x47dabf[_0x52e1ee(0x1a9)]=_0x4b2413),_0x4e759d[_0x52e1ee(0x1b3)]&&!hasText(_0x47dabf[_0x52e1ee(0x1b3)])&&!hasText(_0x47dabf[_0x52e1ee(0x1a9)])&&(_0x47dabf['app']=_0x4e759d[_0x52e1ee(0x1b3)]),_0x4e759d[_0x52e1ee(0x1c4)]&&!hasText(_0x47dabf[_0x52e1ee(0x1c4)])&&(_0x47dabf[_0x52e1ee(0x1c4)]=_0x4e759d[_0x52e1ee(0x1c4)]);}function renderDynamicCommandHelp(_0x224372){const _0x343dd8=a32_0x24fb,_0x181b32=[_0x343dd8(0x1c7),_0x343dd8(0x19e)+_0x224372['target']['kind'],_0x343dd8(0x1d1)+_0x224372[_0x343dd8(0x1e2)]['command']];if(_0x224372['target'][_0x343dd8(0x1d8)])_0x181b32[_0x343dd8(0x184)](_0x343dd8(0x1ca)+_0x224372[_0x343dd8(0x1e2)]['datasetCode']);if(_0x224372[_0x343dd8(0x1e2)][_0x343dd8(0x1bb)])_0x181b32[_0x343dd8(0x184)](_0x343dd8(0x1d9)+_0x224372[_0x343dd8(0x1e2)][_0x343dd8(0x1bb)]);if(_0x224372['target'][_0x343dd8(0x1ad)])_0x181b32[_0x343dd8(0x184)]('\x20\x20\x20\x20sqlCode:\x20'+_0x224372[_0x343dd8(0x1e2)][_0x343dd8(0x1ad)]);if(_0x224372[_0x343dd8(0x1e2)]['scriptName'])_0x181b32['push'](_0x343dd8(0x1af)+_0x224372[_0x343dd8(0x1e2)][_0x343dd8(0x1b2)]);if(_0x224372[_0x343dd8(0x17f)][_0x343dd8(0x17a)]>0x0){_0x181b32[_0x343dd8(0x184)]('',_0x343dd8(0x183));for(const _0x3e89f0 of _0x224372['mapTo']){_0x181b32[_0x343dd8(0x184)](_0x343dd8(0x19d)+(_0x3e89f0['source']||_0x343dd8(0x1bf))+_0x343dd8(0x199)+_0x3e89f0[_0x343dd8(0x1e2)]+(_0x3e89f0[_0x343dd8(0x1b6)]?'.'+_0x3e89f0[_0x343dd8(0x1b6)]:''));}}return _0x181b32['join']('\x0a');}function targetPreview(_0x3c92d4){const _0x1f0f13=a32_0x24fb;return{'kind':_0x3c92d4[_0x1f0f13(0x1cb)],'command':_0x3c92d4[_0x1f0f13(0x1db)],'appRef':_0x3c92d4[_0x1f0f13(0x1a2)],'datasetCode':_0x3c92d4[_0x1f0f13(0x1d8)],'datatable':_0x3c92d4[_0x1f0f13(0x1bb)],'sqlCode':_0x3c92d4[_0x1f0f13(0x1ad)],'bffCode':_0x3c92d4[_0x1f0f13(0x1a4)],'bffId':_0x3c92d4[_0x1f0f13(0x18f)],'scriptName':_0x3c92d4['scriptName']};}function normalizeScalarParams(_0x17995c){const _0x193961=a32_0x24fb;return Object[_0x193961(0x186)](Object['entries'](_0x17995c)[_0x193961(0x1c8)](([,_0x28fbe4])=>typeof _0x28fbe4==='string'||typeof _0x28fbe4===_0x193961(0x180)));}function hasText(_0x232d00){const _0x47f9ed=a32_0x24fb;return typeof _0x232d00===_0x47f9ed(0x19c)&&_0x232d00[_0x47f9ed(0x188)]()[_0x47f9ed(0x17a)]>0x0;}function isPrimitiveFlagDefault(_0x5d56a7){const _0x2857ab=a32_0x24fb;return _0x5d56a7===undefined||typeof _0x5d56a7===_0x2857ab(0x19c)||typeof _0x5d56a7===_0x2857ab(0x180)||typeof _0x5d56a7===_0x2857ab(0x1c1);}
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
- function a33_0x23c4(_0x456856,_0xabbfbd){_0x456856=_0x456856-0x1d0;const _0x4c5f54=a33_0x4c5f();let _0x23c439=_0x4c5f54[_0x456856];return _0x23c439;}function a33_0x4c5f(){const _0xf884a0=['validate','37165320kPgwBa','manifest','write','risk','entry','registryPath','Service\x20registry\x20validation\x20passed.','Exported\x20service\x20','Local\x20service\x20not\x20found:\x20','4iMgbbA','Removed\x20service\x20','str','registryServiceCode','Imported\x20','errors','file','Service\x20Tree\x20manifest\x20file\x20path','version','normalizedManifest','length','service','manifests','export','reduce','cliPath','map','\x20service\x20','type','read','importedAt','12133010botuiV','updated','lower\x20kebab-case\x20service\x20code','flags','registry','9dyQXpo','string','imported','name','serviceCode','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','445832YBbghQ','report','serviceCount','list','source','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','\x20service(s).','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','4131471OzFgkR','2359UduhCE','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','commands','hash','replaced','required','11bIcOSD','\x20service(s),\x20updated\x20','603814HLnxKF','1424816mJoyKH','entries','warnings','description','kind','WRITE','filePath','30FGSlGA','target','registryIndex','Updated','16158keHEUi'];a33_0x4c5f=function(){return _0xf884a0;};return a33_0x4c5f();}const a33_0x5ae0b0=a33_0x23c4;(function(_0x384193,_0x15864f){const _0x5f5c1a=a33_0x23c4,_0x5012f2=_0x384193();while(!![]){try{const _0x527187=-parseInt(_0x5f5c1a(0x1d7))/0x1*(parseInt(_0x5f5c1a(0x1ee))/0x2)+-parseInt(_0x5f5c1a(0x217))/0x3+parseInt(_0x5f5c1a(0x20e))/0x4*(parseInt(_0x5f5c1a(0x1df))/0x5)+parseInt(_0x5f5c1a(0x1e3))/0x6*(parseInt(_0x5f5c1a(0x218))/0x7)+-parseInt(_0x5f5c1a(0x1d8))/0x8+parseInt(_0x5f5c1a(0x208))/0x9*(-parseInt(_0x5f5c1a(0x203))/0xa)+parseInt(_0x5f5c1a(0x1d5))/0xb*(parseInt(_0x5f5c1a(0x1e5))/0xc);if(_0x527187===_0x15864f)break;else _0x5012f2['push'](_0x5012f2['shift']());}catch(_0x49a0a6){_0x5012f2['push'](_0x5012f2['shift']());}}}(a33_0x4c5f,0xaa37b));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a33_0x5ae0b0(0x1f4),'type':a33_0x5ae0b0(0x209),'required':!![],'description':a33_0x5ae0b0(0x1f5)},SERVICE_FLAG={'name':'service','type':a33_0x5ae0b0(0x209),'required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a33_0x5ae0b0(0x205)}};function summarizeService(_0x51c30a){const _0x2b2891=a33_0x5ae0b0;return{'serviceCode':_0x51c30a[_0x2b2891(0x20c)],'name':_0x51c30a['normalizedManifest'][_0x2b2891(0x1f9)]['name'],'version':_0x51c30a[_0x2b2891(0x1f6)],'importedAt':_0x51c30a[_0x2b2891(0x202)],'source':_0x51c30a[_0x2b2891(0x212)],'commandCount':_0x51c30a[_0x2b2891(0x1f7)][_0x2b2891(0x1d1)][_0x2b2891(0x1f8)],'commands':_0x51c30a[_0x2b2891(0x1f7)]['commands'][_0x2b2891(0x1fe)](_0x6e8497=>({'path':_0x6e8497[_0x2b2891(0x1fd)],'description':_0x6e8497[_0x2b2891(0x1db)],'risk':_0x6e8497[_0x2b2891(0x1e8)],'target':_0x6e8497['target'],'flags':_0x6e8497[_0x2b2891(0x206)]['map'](_0x3f37c8=>({'name':_0x3f37c8[_0x2b2891(0x20b)],'cliName':_0x3f37c8['cliName'],'type':_0x3f37c8[_0x2b2891(0x200)],'required':_0x3f37c8[_0x2b2891(0x1d4)]===!![]}))}))};}function summarizeLoadedManifest(_0x37fc55){const _0x35b6aa=a33_0x5ae0b0;return{'service':_0x37fc55[_0x35b6aa(0x1f7)]?.[_0x35b6aa(0x1f9)],'version':_0x37fc55['normalizedManifest']?.[_0x35b6aa(0x1f6)],'commandCount':_0x37fc55[_0x35b6aa(0x1f7)]?.[_0x35b6aa(0x1d1)][_0x35b6aa(0x1f8)]??0x0,'commands':_0x37fc55['normalizedManifest']?.[_0x35b6aa(0x1d1)]['map'](_0x5b9d23=>({'path':_0x5b9d23[_0x35b6aa(0x1fd)],'risk':_0x5b9d23[_0x35b6aa(0x1e8)],'target':_0x5b9d23[_0x35b6aa(0x1e0)]}))??[],'registryIndex':_0x37fc55[_0x35b6aa(0x1e1)],'registryServiceCode':_0x37fc55[_0x35b6aa(0x1f1)],'errors':_0x37fc55[_0x35b6aa(0x20f)][_0x35b6aa(0x1f3)],'warnings':_0x37fc55[_0x35b6aa(0x20f)]['warnings']};}export const serviceDefinitions=[{'service':a33_0x5ae0b0(0x1f9),'command':a33_0x5ae0b0(0x1e4),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4b5774){const _0x263193=a33_0x5ae0b0,_0x138403=loadServiceManifestFromFile(_0x4b5774[_0x263193(0x1f0)](_0x263193(0x1f4)));if(!_0x138403[_0x263193(0x20f)]['ok'])return{'ok':![],'data':{'file':_0x138403[_0x263193(0x1de)],'hash':_0x138403['hash'],'kind':_0x138403['kind'],'serviceCount':_0x138403['manifests'][_0x263193(0x1f8)],'services':_0x138403[_0x263193(0x1fa)][_0x263193(0x1fe)](summarizeLoadedManifest),'errors':_0x138403['report'][_0x263193(0x1f3)],'warnings':_0x138403[_0x263193(0x20f)][_0x263193(0x1da)]},'message':formatValidationFailure(_0x138403[_0x263193(0x20f)])};if(_0x138403[_0x263193(0x1dc)]===_0x263193(0x207)||_0x138403[_0x263193(0x1fa)][_0x263193(0x1f8)]!==0x1)return{'ok':!![],'data':{'file':_0x138403[_0x263193(0x1de)],'hash':_0x138403['hash'],'kind':_0x138403[_0x263193(0x1dc)],'serviceCount':_0x138403['manifests'][_0x263193(0x1f8)],'commandCount':_0x138403[_0x263193(0x1fa)][_0x263193(0x1fc)]((_0x50614f,_0xdfd4f7)=>_0x50614f+(_0xdfd4f7[_0x263193(0x1f7)]?.[_0x263193(0x1d1)][_0x263193(0x1f8)]??0x0),0x0),'services':_0x138403[_0x263193(0x1fa)][_0x263193(0x1fe)](summarizeLoadedManifest),'warnings':_0x138403[_0x263193(0x20f)][_0x263193(0x1da)]},'message':_0x263193(0x1eb)};return{'ok':!![],'data':{'file':_0x138403[_0x263193(0x1de)],'hash':_0x138403['hash'],'kind':_0x138403[_0x263193(0x1dc)],'service':_0x138403[_0x263193(0x1f7)]?.[_0x263193(0x1f9)],'version':_0x138403[_0x263193(0x1f7)]?.[_0x263193(0x1f6)],'commandCount':_0x138403[_0x263193(0x1f7)]?.[_0x263193(0x1d1)][_0x263193(0x1f8)]??0x0,'commands':_0x138403[_0x263193(0x1f7)]?.[_0x263193(0x1d1)][_0x263193(0x1fe)](_0x2e8f97=>({'path':_0x2e8f97['cliPath'],'risk':_0x2e8f97[_0x263193(0x1e8)],'target':_0x2e8f97[_0x263193(0x1e0)]})),'warnings':_0x138403[_0x263193(0x20f)][_0x263193(0x1da)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a33_0x5ae0b0(0x1f9),'command':'import','description':a33_0x5ae0b0(0x1d0),'risk':a33_0x5ae0b0(0x1e7),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x5e5470){const _0x132a47=a33_0x5ae0b0,_0x2b2a2b=loadServiceManifestFromFile(_0x5e5470[_0x132a47(0x1f0)](_0x132a47(0x1f4)));return{'method':_0x132a47(0x1dd),'url':getServiceRegistryPath(),'body':{'file':_0x2b2a2b[_0x132a47(0x1de)],'hash':_0x2b2a2b[_0x132a47(0x1d2)],'kind':_0x2b2a2b[_0x132a47(0x1dc)],'ok':_0x2b2a2b[_0x132a47(0x20f)]['ok'],'service':_0x2b2a2b[_0x132a47(0x1f7)]?.['service'],'version':_0x2b2a2b[_0x132a47(0x1f7)]?.[_0x132a47(0x1f6)],'serviceCount':_0x2b2a2b[_0x132a47(0x1fa)][_0x132a47(0x1f8)],'services':_0x2b2a2b['manifests'][_0x132a47(0x1fe)](_0x630af3=>({'service':_0x630af3['normalizedManifest']?.['service'],'version':_0x630af3[_0x132a47(0x1f7)]?.[_0x132a47(0x1f6)],'commandCount':_0x630af3[_0x132a47(0x1f7)]?.[_0x132a47(0x1d1)][_0x132a47(0x1f8)]??0x0,'errors':_0x630af3[_0x132a47(0x20f)][_0x132a47(0x1f3)]})),'errors':_0x2b2a2b['report']['errors'],'commandCount':_0x2b2a2b[_0x132a47(0x1f7)]?.[_0x132a47(0x1d1)][_0x132a47(0x1f8)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x2da8eb){const _0x5c8a45=a33_0x5ae0b0,_0x243117=importServiceManifest(_0x2da8eb[_0x5c8a45(0x1f0)](_0x5c8a45(0x1f4)));if(_0x243117[_0x5c8a45(0x1d9)][_0x5c8a45(0x1f8)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x243117[_0x5c8a45(0x1ea)],'imported':_0x243117[_0x5c8a45(0x20a)],'updated':_0x243117[_0x5c8a45(0x204)],'serviceCount':_0x243117[_0x5c8a45(0x210)],'services':_0x243117[_0x5c8a45(0x1d9)][_0x5c8a45(0x1fe)](summarizeService)},'message':_0x5c8a45(0x1f2)+_0x243117[_0x5c8a45(0x20a)]+_0x5c8a45(0x1d6)+_0x243117[_0x5c8a45(0x204)]+_0x5c8a45(0x215)};return{'ok':!![],'data':{'registryPath':_0x243117[_0x5c8a45(0x1ea)],'replaced':_0x243117['replaced'],'imported':_0x243117[_0x5c8a45(0x20a)],'updated':_0x243117[_0x5c8a45(0x204)],'serviceCount':_0x243117[_0x5c8a45(0x210)],'service':summarizeService(_0x243117['entry'])},'message':(_0x243117[_0x5c8a45(0x1d3)]?_0x5c8a45(0x1e2):'Imported')+_0x5c8a45(0x1ff)+_0x243117[_0x5c8a45(0x1e9)]['serviceCode']+'.'};}},{'service':a33_0x5ae0b0(0x1f9),'command':a33_0x5ae0b0(0x1fb),'description':a33_0x5ae0b0(0x213),'risk':a33_0x5ae0b0(0x1e7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x401b4c){const _0x441a4c=a33_0x5ae0b0,_0x49fda7=getLocalServiceEntry(_0x401b4c[_0x441a4c(0x1f0)]('service'));return{'method':_0x441a4c(0x1dd),'url':_0x401b4c[_0x441a4c(0x1f0)]('file'),'body':{'service':_0x401b4c['str']('service'),'found':Boolean(_0x49fda7),'version':_0x49fda7?.[_0x441a4c(0x1f6)],'source':_0x49fda7?.[_0x441a4c(0x212)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x59767f){const _0x2a81ed=a33_0x5ae0b0,_0xe0dd37=exportServiceManifest(_0x59767f[_0x2a81ed(0x1f0)](_0x2a81ed(0x1f9)),_0x59767f[_0x2a81ed(0x1f0)](_0x2a81ed(0x1f4)));return{'ok':!![],'data':{'registryPath':_0xe0dd37[_0x2a81ed(0x1ea)],'file':_0xe0dd37[_0x2a81ed(0x1de)],'service':summarizeService(_0xe0dd37['entry'])},'message':_0x2a81ed(0x1ec)+_0xe0dd37[_0x2a81ed(0x1e9)][_0x2a81ed(0x20c)]+'.'};}},{'service':a33_0x5ae0b0(0x1f9),'command':a33_0x5ae0b0(0x211),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x182a0e=a33_0x5ae0b0,_0x1137dd=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1137dd[_0x182a0e(0x1f8)],'services':_0x1137dd[_0x182a0e(0x1fe)](summarizeService)}};}},{'service':a33_0x5ae0b0(0x1f9),'command':'remove','description':a33_0x5ae0b0(0x214),'risk':a33_0x5ae0b0(0x1e7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0xac0c4a){const _0x4d8174=a33_0x5ae0b0,_0x34aa07=getLocalServiceEntry(_0xac0c4a['str']('service'));return{'method':_0x4d8174(0x1dd),'url':getServiceRegistryPath(),'body':{'service':_0xac0c4a[_0x4d8174(0x1f0)](_0x4d8174(0x1f9)),'found':Boolean(_0x34aa07),'version':_0x34aa07?.[_0x4d8174(0x1f6)],'source':_0x34aa07?.[_0x4d8174(0x212)]},'description':_0x4d8174(0x20d)};},async 'execute'(_0x41c995){const _0x4b06db=a33_0x5ae0b0,_0x3b538c=removeServiceManifest(_0x41c995[_0x4b06db(0x1f0)](_0x4b06db(0x1f9)));return{'ok':!![],'data':{'registryPath':_0x3b538c['registryPath'],'serviceCount':_0x3b538c['serviceCount'],'service':summarizeService(_0x3b538c['entry'])},'message':_0x4b06db(0x1ef)+_0x3b538c[_0x4b06db(0x1e9)][_0x4b06db(0x20c)]+'.'};}},{'service':a33_0x5ae0b0(0x1f9),'command':'detail','description':a33_0x5ae0b0(0x216),'risk':a33_0x5ae0b0(0x201),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0xc245a2){const _0x1f572f=a33_0x5ae0b0,_0x536012=getLocalServiceEntry(_0xc245a2['str']('service'));if(!_0x536012)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0xc245a2['str'](_0x1f572f(0x1f9))},'message':_0x1f572f(0x1ed)+_0xc245a2[_0x1f572f(0x1f0)](_0x1f572f(0x1f9))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x536012),'manifest':_0x536012[_0x1f572f(0x1e6)],'normalizedManifest':_0x536012[_0x1f572f(0x1f7)]}};}}];
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_0x2cf5c5=a34_0x5488;(function(_0x3f81e1,_0x3e067c){const _0x4c55bb=a34_0x5488,_0x4df2c1=_0x3f81e1();while(!![]){try{const _0x2929f1=-parseInt(_0x4c55bb(0x10d))/0x1+-parseInt(_0x4c55bb(0x109))/0x2+parseInt(_0x4c55bb(0x137))/0x3*(-parseInt(_0x4c55bb(0x138))/0x4)+parseInt(_0x4c55bb(0x128))/0x5*(parseInt(_0x4c55bb(0x130))/0x6)+parseInt(_0x4c55bb(0x116))/0x7+-parseInt(_0x4c55bb(0x129))/0x8+parseInt(_0x4c55bb(0x147))/0x9;if(_0x2929f1===_0x3e067c)break;else _0x4df2c1['push'](_0x4df2c1['shift']());}catch(_0x50da5f){_0x4df2c1['push'](_0x4df2c1['shift']());}}}(a34_0x1d23,0xf053a));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_0x2cf5c5(0x123);export function getServiceRegistryPath(_0x2fc8d3={}){const _0x226931=a34_0x2cf5c5;return resolve(_0x2fc8d3[_0x226931(0x124)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x3f5d39={}){const _0xf2efdf=a34_0x2cf5c5,_0x49be63=getServiceRegistryPath(_0x3f5d39);if(!existsSync(_0x49be63))return emptyServiceRegistry();try{const _0x5abc2c=readFileSync(_0x49be63,_0xf2efdf(0x11a));if(!_0x5abc2c[_0xf2efdf(0xfc)]())return emptyServiceRegistry();const _0x497b10=JSON[_0xf2efdf(0x11b)](_0x5abc2c);if(_0x497b10[_0xf2efdf(0x118)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0xf2efdf(0xff)]('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x497b10[_0xf2efdf(0x118)]),_0xf2efdf(0x141)+_0x49be63+'.');if(!Array[_0xf2efdf(0x13e)](_0x497b10[_0xf2efdf(0x115)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x497b10[_0xf2efdf(0x11e)],'services':_0x497b10['services']};}catch(_0x336f89){if(_0x336f89 instanceof Error&&_0x336f89['name']===_0xf2efdf(0x100))throw _0x336f89;throw CliErrors[_0xf2efdf(0xff)](_0xf2efdf(0x134)+_0x49be63,_0xf2efdf(0x10f));}}export function writeServiceRegistry(_0x4f909d,_0x3f2f18={}){const _0x24810a=a34_0x2cf5c5,_0x6ffc70=getServiceRegistryPath(_0x3f2f18),_0x28f25a=dirname(_0x6ffc70);!existsSync(_0x28f25a)&&mkdirSync(_0x28f25a,{'recursive':!![]});const _0x4d16d7=_0x6ffc70+_0x24810a(0x13b);try{writeFileSync(_0x4d16d7,JSON['stringify'](_0x4f909d,null,0x2)+'\x0a',{'encoding':_0x24810a(0x11a),'mode':0x180}),renameSync(_0x4d16d7,_0x6ffc70);}catch(_0x41322b){try{unlinkSync(_0x4d16d7);}catch{}if(_0x41322b?.['code']===_0x24810a(0x13f))throw CliErrors[_0x24810a(0xff)](_0x24810a(0x110)+_0x6ffc70);throw _0x41322b;}return _0x6ffc70;}export function loadServiceManifestFromFile(_0x3fd7a0){const _0x21eef5=a34_0x2cf5c5,_0x25960f=resolve(_0x3fd7a0);if(!existsSync(_0x25960f))throw CliErrors[_0x21eef5(0xff)]('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x3fd7a0);let _0x1890b1;const _0x1ae3d4=readFileSync(_0x25960f,_0x21eef5(0x11a));try{_0x1890b1=JSON[_0x21eef5(0x11b)](_0x1ae3d4);}catch{throw CliErrors[_0x21eef5(0xff)](_0x21eef5(0x145)+_0x3fd7a0,_0x21eef5(0x12c));}const _0x434f7f=sha256(_0x1ae3d4),_0x4d0cd6=extractLoadedServiceManifests(_0x1890b1,_0x434f7f),_0x197522=aggregateValidationReports(_0x4d0cd6),_0x30b5d8=_0x4d0cd6[0x0];return{'filePath':_0x25960f,'hash':_0x434f7f,'kind':isServiceRegistryLike(_0x1890b1)?'registry':_0x21eef5(0x13d),'manifest':_0x30b5d8?.[_0x21eef5(0x13d)]??_0x1890b1,'report':_0x197522,'normalizedManifest':_0x4d0cd6['length']===0x1?_0x30b5d8?.[_0x21eef5(0x13c)]:undefined,'manifests':_0x4d0cd6};}export function importServiceManifest(_0x1c89cf,_0x56d102={}){const _0x49a5b7=a34_0x2cf5c5,_0x1c8087=loadServiceManifestFromFile(_0x1c89cf);if(!_0x1c8087[_0x49a5b7(0x10e)]['ok'])throw CliErrors[_0x49a5b7(0xff)](formatValidationFailure(_0x1c8087[_0x49a5b7(0x10e)]),_0x49a5b7(0x12e));if(_0x1c8087['manifests']['length']===0x0)throw CliErrors[_0x49a5b7(0xff)]('Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x192124=readServiceRegistry(_0x56d102),_0x2a8144=(_0x56d102[_0x49a5b7(0x117)]??(()=>new Date()))()[_0x49a5b7(0x114)](),_0x269fc5=[];let _0x59f3b5=0x0,_0x5d197a=0x0;for(const _0x162265 of _0x1c8087['manifests']){if(!_0x162265[_0x49a5b7(0x13c)])continue;const _0x5736ac=_0x162265['normalizedManifest'][_0x49a5b7(0x104)][_0x49a5b7(0x13a)],_0x18a46e={'serviceCode':_0x5736ac,'version':_0x162265['normalizedManifest']['version'],'importedAt':_0x2a8144,'source':{'type':'file','path':_0x1c8087['filePath'],'hash':_0x162265[_0x49a5b7(0x143)]},'manifest':_0x162265[_0x49a5b7(0x13d)],'normalizedManifest':_0x162265['normalizedManifest']},_0x5baa50=_0x192124[_0x49a5b7(0x115)]['findIndex'](_0x1981fe=>_0x1981fe[_0x49a5b7(0x127)]===_0x5736ac);_0x5baa50>=0x0?(_0x192124['services'][_0x5baa50]=_0x18a46e,_0x5d197a++):(_0x192124[_0x49a5b7(0x115)][_0x49a5b7(0x11d)](_0x18a46e),_0x59f3b5++),_0x269fc5[_0x49a5b7(0x11d)](_0x18a46e);}_0x192124[_0x49a5b7(0x115)]['sort']((_0x582d4e,_0x4d4a16)=>_0x582d4e[_0x49a5b7(0x127)][_0x49a5b7(0x126)](_0x4d4a16[_0x49a5b7(0x127)])),_0x192124[_0x49a5b7(0x11e)]=_0x2a8144;const _0x5520ba=writeServiceRegistry(_0x192124,_0x56d102);return{'registryPath':_0x5520ba,'entry':_0x269fc5[0x0],'replaced':_0x269fc5[_0x49a5b7(0x106)]===0x1?_0x5d197a===0x1:_0x5d197a>0x0,'entries':_0x269fc5,'imported':_0x59f3b5,'updated':_0x5d197a,'serviceCount':_0x192124[_0x49a5b7(0x115)][_0x49a5b7(0x106)]};}export function exportServiceManifest(_0x1a644c,_0x1d265c,_0x83ce0c={}){const _0x43ffee=a34_0x2cf5c5,_0x8e4d8b=getServiceRegistryPath(_0x83ce0c),_0x509fed=getLocalServiceEntry(_0x1a644c,_0x83ce0c);if(!_0x509fed)throw CliErrors[_0x43ffee(0xff)](_0x43ffee(0x10b)+_0x1a644c,_0x43ffee(0x125));const _0x286ab9=resolve(_0x1d265c),_0x59d35b=dirname(_0x286ab9);return!existsSync(_0x59d35b)&&mkdirSync(_0x59d35b,{'recursive':!![]}),writeFileSync(_0x286ab9,JSON[_0x43ffee(0x146)](_0x509fed[_0x43ffee(0x13d)],null,0x2)+'\x0a',{'encoding':_0x43ffee(0x11a),'mode':0x180}),{'registryPath':_0x8e4d8b,'filePath':_0x286ab9,'entry':_0x509fed};}export function removeServiceManifest(_0x19e2e4,_0x109d5d={}){const _0x2ac928=a34_0x2cf5c5,_0x5b8c90=readServiceRegistry(_0x109d5d),_0x19a00c=_0x19e2e4[_0x2ac928(0xfc)](),_0xf7ee6e=_0x5b8c90['services']['findIndex'](_0x588e54=>_0x588e54[_0x2ac928(0x127)]===_0x19a00c);if(_0xf7ee6e<0x0)throw CliErrors['validation'](_0x2ac928(0x10b)+_0x19a00c,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x336da8]=_0x5b8c90['services'][_0x2ac928(0x108)](_0xf7ee6e,0x1),_0x1e2098=(_0x109d5d[_0x2ac928(0x117)]??(()=>new Date()))()[_0x2ac928(0x114)]();_0x5b8c90['updatedAt']=_0x1e2098;const _0x2d34e9=writeServiceRegistry(_0x5b8c90,_0x109d5d);return{'registryPath':_0x2d34e9,'entry':_0x336da8,'serviceCount':_0x5b8c90[_0x2ac928(0x115)][_0x2ac928(0x106)]};}export function listLocalServices(_0xbd3505={}){const _0x2671a3=a34_0x2cf5c5;return readServiceRegistry(_0xbd3505)[_0x2671a3(0x115)];}export function getLocalServiceEntry(_0x2436d1,_0x5a5717={}){const _0x4197fc=a34_0x2cf5c5;return readServiceRegistry(_0x5a5717)[_0x4197fc(0x115)][_0x4197fc(0x107)](_0x1fec9e=>_0x1fec9e['serviceCode']===_0x2436d1[_0x4197fc(0xfc)]());}export function listLocalServiceTrees(_0x7f3180={}){const _0x12f5cc=a34_0x2cf5c5;return readServiceRegistry(_0x7f3180)['services'][_0x12f5cc(0x11f)](_0x4827d6=>_0x4827d6[_0x12f5cc(0x13c)]);}export function inspectServiceRegistry(_0x14a709={}){const _0x375011=a34_0x2cf5c5,_0x933b7c=getServiceRegistryPath(_0x14a709);if(!existsSync(_0x933b7c))return emptyServiceRegistryInspection(_0x933b7c,_0x375011(0x121),![]);try{const _0x3940c5=readFileSync(_0x933b7c,'utf8');if(!_0x3940c5[_0x375011(0xfc)]())return emptyServiceRegistryInspection(_0x933b7c,_0x375011(0x12d),!![]);const _0x2f8e94=JSON['parse'](_0x3940c5);if(_0x2f8e94['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x933b7c,_0x375011(0x140),!![]),'schemaVersion':_0x2f8e94['schemaVersion'],'message':_0x375011(0x144)+String(_0x2f8e94[_0x375011(0x118)])};if(!Array[_0x375011(0x13e)](_0x2f8e94[_0x375011(0x115)]))return{...emptyServiceRegistryInspection(_0x933b7c,_0x375011(0x140),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2f8e94[_0x375011(0x11e)],'message':_0x375011(0x105)};const _0x3891ab=_0x2f8e94[_0x375011(0x115)][_0x375011(0x11f)](summarizeLocalServiceEntry);return{'registryPath':_0x933b7c,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2f8e94[_0x375011(0x11e)],'serviceCount':_0x3891ab['length'],'commandCount':_0x3891ab['reduce']((_0x4111a2,_0x1f1a18)=>_0x4111a2+_0x1f1a18['commandCount'],0x0),'services':_0x3891ab};}catch(_0x1513f6){return{...emptyServiceRegistryInspection(_0x933b7c,'invalid',!![]),'message':_0x1513f6 instanceof Error?_0x1513f6[_0x375011(0x10a)]:String(_0x1513f6)};}}export function formatValidationFailure(_0x57e7b8){const _0x31e79a=a34_0x2cf5c5,_0x4a5475=_0x57e7b8[_0x31e79a(0x136)][_0x31e79a(0x11f)](_0x40210c=>_0x40210c['path']+':\x20'+_0x40210c[_0x31e79a(0x10a)]);return _0x31e79a(0x111)+_0x4a5475[_0x31e79a(0x133)]('\x0a');}function extractLoadedServiceManifests(_0x22bd4a,_0x4c171a){if(!isServiceRegistryLike(_0x22bd4a)){const _0x2a804f=_0x22bd4a,_0x216ade=validateServiceTreeManifest(_0x2a804f);return[{'manifest':_0x2a804f,'report':_0x216ade,'normalizedManifest':_0x216ade['ok']?normalizeServiceTreeManifest(_0x2a804f):undefined,'sourceHash':_0x4c171a}];}return _0x22bd4a['services']['map']((_0x2b8dba,_0x342b52)=>{const _0x149780=a34_0x5488,_0x105185=isObjectRecord(_0x2b8dba)?_0x2b8dba[_0x149780(0x13d)]:undefined,_0x5d6287=validateServiceTreeManifest(_0x105185),_0x156ad2=isObjectRecord(_0x2b8dba)&&typeof _0x2b8dba[_0x149780(0x127)]===_0x149780(0x101)?_0x2b8dba[_0x149780(0x127)]:undefined;return{'manifest':_0x105185,'report':_0x5d6287,'normalizedManifest':_0x5d6287['ok']?normalizeServiceTreeManifest(_0x105185):undefined,'sourceHash':sha256(JSON[_0x149780(0x146)](_0x105185,null,0x2)+'\x0a'),'registryIndex':_0x342b52,'registryServiceCode':_0x156ad2};});}function aggregateValidationReports(_0x1730bf){const _0x36e777=a34_0x2cf5c5,_0x568fa3=_0x1730bf[_0x36e777(0x131)](_0x579599=>_0x579599['registryIndex']===undefined?_0x579599[_0x36e777(0x10e)]['errors']:_0x579599[_0x36e777(0x10e)][_0x36e777(0x136)][_0x36e777(0x11f)](_0x3ee379=>({..._0x3ee379,'path':prefixRegistryIssuePath(_0x579599['registryIndex'],_0x3ee379[_0x36e777(0x119)])}))),_0x413938=_0x1730bf['flatMap'](_0x29009b=>_0x29009b[_0x36e777(0x10c)]===undefined?_0x29009b[_0x36e777(0x10e)][_0x36e777(0x12b)]:_0x29009b[_0x36e777(0x10e)][_0x36e777(0x12b)]['map'](_0x68e13d=>({..._0x68e13d,'path':prefixRegistryIssuePath(_0x29009b[_0x36e777(0x10c)],_0x68e13d['path'])})));return{'ok':_0x568fa3[_0x36e777(0x106)]===0x0,'errors':_0x568fa3,'warnings':_0x413938};}function prefixRegistryIssuePath(_0x341c5d,_0xc1fe86){const _0x436c9e=a34_0x2cf5c5;if(_0xc1fe86==='$')return _0x436c9e(0xfe)+_0x341c5d+'].manifest';if(_0xc1fe86[_0x436c9e(0x112)]('$.'))return _0x436c9e(0xfe)+_0x341c5d+'].manifest'+_0xc1fe86[_0x436c9e(0xfd)](0x1);if(_0xc1fe86[_0x436c9e(0x112)]('$['))return _0x436c9e(0xfe)+_0x341c5d+'].manifest'+_0xc1fe86[_0x436c9e(0xfd)](0x1);return _0x436c9e(0xfe)+_0x341c5d+'].manifest.'+_0xc1fe86;}function a34_0x5488(_0x847316,_0x419c75){_0x847316=_0x847316-0xfb;const _0x1d23f5=a34_0x1d23();let _0x548848=_0x1d23f5[_0x847316];return _0x548848;}function isServiceRegistryLike(_0x38ab94){const _0xb325d9=a34_0x2cf5c5;return isObjectRecord(_0x38ab94)&&_0x38ab94[_0xb325d9(0x118)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0xb325d9(0x13e)](_0x38ab94[_0xb325d9(0x115)]);}function isObjectRecord(_0x3c5637){const _0x4a8a9f=a34_0x2cf5c5;return Boolean(_0x3c5637)&&typeof _0x3c5637===_0x4a8a9f(0x135)&&!Array[_0x4a8a9f(0x13e)](_0x3c5637);}function emptyServiceRegistryInspection(_0x27da1d,_0x4c4804,_0x29608b){return{'registryPath':_0x27da1d,'exists':_0x29608b,'status':_0x4c4804,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x26f95f){const _0x1dd35e=a34_0x2cf5c5,_0x1b3343=_0x26f95f[_0x1dd35e(0x13c)],_0x4e6840=_0x1b3343['commands'][_0x1dd35e(0x11f)](_0x3f5079=>({'path':_0x3f5079[_0x1dd35e(0x142)],'description':_0x3f5079[_0x1dd35e(0x12a)],'risk':_0x3f5079['risk'],'targetKind':_0x3f5079['target'][_0x1dd35e(0x132)],'targetCommand':_0x3f5079[_0x1dd35e(0x11c)][_0x1dd35e(0x103)]}));return{'serviceCode':_0x26f95f['serviceCode'],'name':_0x1b3343[_0x1dd35e(0x104)][_0x1dd35e(0x102)],'description':_0x1b3343[_0x1dd35e(0x104)]['description'],'version':_0x26f95f['version'],'importedAt':_0x26f95f[_0x1dd35e(0xfb)],'source':_0x26f95f[_0x1dd35e(0x139)],'commandCount':_0x4e6840[_0x1dd35e(0x106)],'commands':_0x4e6840};}function a34_0x1d23(){const _0x5464f0=['now','schemaVersion','path','utf8','parse','target','push','updatedAt','map','update','missing','digest','service.json','homeDir','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','localeCompare','serviceCode','446465ZfqbuL','7756680gmWyfm','description','warnings','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','empty','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','sha256','36vUKeNe','flatMap','kind','join','Invalid\x20service\x20registry\x20JSON:\x20','object','errors','441dLACPj','24380wrTUyF','source','code','.tmp','normalizedManifest','manifest','isArray','ENOENT','invalid','Remove\x20or\x20migrate\x20','cliPath','sourceHash','Unsupported\x20schemaVersion:\x20','Invalid\x20service\x20manifest\x20JSON:\x20','stringify','25825131EPpAqI','importedAt','trim','slice','$.services[','validation','CliError','string','name','command','service','services\x20must\x20be\x20an\x20array','length','find','splice','3536194DhZFzi','message','Local\x20service\x20not\x20found:\x20','registryIndex','540947HCtnEM','report','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','Cannot\x20write\x20service\x20registry:\x20','Service\x20manifest\x20validation\x20failed:\x0a','startsWith','hex','toISOString','services','12276285kxlFvB'];a34_0x1d23=function(){return _0x5464f0;};return a34_0x1d23();}function sha256(_0x2dadec){const _0xb57512=a34_0x2cf5c5;return createHash(_0xb57512(0x12f))[_0xb57512(0x120)](_0x2dadec)[_0xb57512(0x122)](_0xb57512(0x113));}
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));}
@@ -1 +1 @@
1
- const a35_0x2ccec4=a35_0x53bd;(function(_0xf33cc0,_0x4415fe){const _0x205bfe=a35_0x53bd,_0x45b98d=_0xf33cc0();while(!![]){try{const _0x2e154c=parseInt(_0x205bfe(0x1a4))/0x1*(parseInt(_0x205bfe(0x18a))/0x2)+parseInt(_0x205bfe(0x187))/0x3*(parseInt(_0x205bfe(0x179))/0x4)+-parseInt(_0x205bfe(0x14b))/0x5+parseInt(_0x205bfe(0x19b))/0x6+parseInt(_0x205bfe(0x14c))/0x7*(parseInt(_0x205bfe(0x15d))/0x8)+parseInt(_0x205bfe(0x14d))/0x9+parseInt(_0x205bfe(0x163))/0xa*(-parseInt(_0x205bfe(0x193))/0xb);if(_0x2e154c===_0x4415fe)break;else _0x45b98d['push'](_0x45b98d['shift']());}catch(_0x885627){_0x45b98d['push'](_0x45b98d['shift']());}}}(a35_0x9446,0xab647));import{CliErrors}from'../../errors.js';import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{DEFAULT_SKILL_TARGET,renderSkillTemplate,SKILL_NAME_PATTERN,SKILL_TYPES}from'../../commands/skill/templates.js';function a35_0x9446(){const _0x4039b6=['path','appCode','pulledAt','find','create','1970140HNYkOY','7PWAxXw','10541646wCxMax','Created\x20local\x20Skill\x20draft\x20','envName','code','Pulled\x20','version','skillCode','installToAgent','Installed\x20','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','validation','errors','linkedPaths','../../skills/runtime-skill-sync.js','string','WRITE','274888NYGBOT','updated','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','map','user','Skill\x20pull\x20scope:\x20user\x20(personal/company)','26159030xmYRQF','strict','Read\x20CLI-managed\x20local\x20Skill\x20cache\x20and\x20links\x20instead\x20of\x20remote\x20lists','warnings','company','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','effective','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','skill','length','contentHash','\x20remote\x20Skill(s).','Skill\x20directory\x20already\x20exists:\x20','write','authRequired','Unsupported\x20Skill\x20list\x20scope:\x20','install','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','files','\x20personal\x20and\x20','skillDir','tags','40FGmolk','Skill\x20list\x20scope:\x20user,\x20personal,\x20company,\x20public,\x20or\x20all','type','trim','public','metadataPath','readonly','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','personal','push','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','Unsupported\x20Skill\x20pull\x20scope:\x20','accessKey','scope','104439aScAmh','remote','skipped','2ttWlMH','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','Skill\x20template\x20type','status','all','bool','Directory\x20that\x20will\x20contain\x20the\x20generated\x20Skill\x20directory','name','Created\x20personal\x20Skill\x20','11dUjtTT','\x20local\x20Skill(s).','unchanged','production','Compatibility\x20flag;\x20no\x20extra\x20checks\x20are\x20enabled','content','read','ossPath','4666320kLuowB','../../core/api-client.js','skillMdPath','target','isArray','force','Updated\x20personal\x20Skill\x20','Skill\x20name\x20using\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','local','1380449yLIeGW','rendered','created','Pull\x20runtime\x20Skills\x20into\x20the\x20local\x20development\x20cache','boolean','Skill\x20validation\x20passed.','str','filter','removed','Local\x20Skill\x20directory\x20containing\x20SKILL.md','treeHash','Listed\x20','action','skillName','dir','reduce','isSymbolicLink','\x20company\x20Skill(s).','cacheDir','input','pull'];a35_0x9446=function(){return _0x4039b6;};return a35_0x9446();}function a35_0x53bd(_0x4ee51f,_0x4a9654){_0x4ee51f=_0x4ee51f-0x139;const _0x94466a=a35_0x9446();let _0x53bda0=_0x94466a[_0x4ee51f];return _0x53bda0;}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../../commands/skill/validate.js';const CODE_FLAG={'name':'code','type':a35_0x2ccec4(0x15b),'description':'Only\x20target\x20a\x20specific\x20runtime\x20Skill\x20code'},SCOPE_FLAG={'name':a35_0x2ccec4(0x186),'type':a35_0x2ccec4(0x15b),'description':a35_0x2ccec4(0x162)},LIST_SCOPE_FLAG={'name':'scope','type':a35_0x2ccec4(0x15b),'description':a35_0x2ccec4(0x17a),'enum':[a35_0x2ccec4(0x161),'personal','company',a35_0x2ccec4(0x17d),a35_0x2ccec4(0x18e)]},LOCAL_FLAG={'name':a35_0x2ccec4(0x1a3),'type':'boolean','description':a35_0x2ccec4(0x165)},DIR_FLAG={'name':a35_0x2ccec4(0x13f),'type':a35_0x2ccec4(0x15b),'required':!![],'description':a35_0x2ccec4(0x13a)},CREATE_NAME_FLAG={'name':'name','type':a35_0x2ccec4(0x15b),'required':!![],'description':a35_0x2ccec4(0x1a2),'pattern':{'regex':SKILL_NAME_PATTERN,'description':'lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens'}},TYPE_FLAG={'name':a35_0x2ccec4(0x17b),'type':a35_0x2ccec4(0x15b),'description':a35_0x2ccec4(0x18c),'default':a35_0x2ccec4(0x170),'enum':[...SKILL_TYPES]},TARGET_FLAG={'name':a35_0x2ccec4(0x19e),'type':'string','description':a35_0x2ccec4(0x190),'default':DEFAULT_SKILL_TARGET},FORCE_FLAG={'name':a35_0x2ccec4(0x1a0),'type':a35_0x2ccec4(0x1a8),'description':'Overwrite\x20generated\x20files\x20when\x20the\x20Skill\x20directory\x20already\x20exists'},STRICT_FLAG={'name':a35_0x2ccec4(0x164),'type':'boolean','description':a35_0x2ccec4(0x197)};function summarizeRuntimeSkill(_0x3c0cd0){const _0x4667de=a35_0x2ccec4;return{'id':_0x3c0cd0['id'],'skillCode':_0x3c0cd0[_0x4667de(0x153)],'skillName':_0x3c0cd0[_0x4667de(0x13e)],'scope':_0x3c0cd0[_0x4667de(0x186)],'version':_0x3c0cd0['version'],'readonly':_0x3c0cd0['readonly']};}function summarizeLocalRuntimeSkill(_0x25eb4b){const _0x1e1bb4=a35_0x2ccec4;return{'id':_0x25eb4b['id'],'skillCode':_0x25eb4b[_0x1e1bb4(0x153)],'skillName':_0x25eb4b[_0x1e1bb4(0x13e)],'scope':_0x25eb4b[_0x1e1bb4(0x186)],'appCode':_0x25eb4b[_0x1e1bb4(0x147)],'version':_0x25eb4b[_0x1e1bb4(0x152)],'status':_0x25eb4b[_0x1e1bb4(0x18d)],'readonly':_0x25eb4b[_0x1e1bb4(0x17f)],'tags':_0x25eb4b[_0x1e1bb4(0x178)],'dir':_0x25eb4b['dir'],'cacheDir':_0x25eb4b[_0x1e1bb4(0x143)],'skillMdPath':_0x25eb4b[_0x1e1bb4(0x19d)],'metadataPath':_0x25eb4b[_0x1e1bb4(0x17e)],'linkedPaths':_0x25eb4b[_0x1e1bb4(0x159)],'contentHash':_0x25eb4b[_0x1e1bb4(0x16d)],'treeHash':_0x25eb4b[_0x1e1bb4(0x13b)],'pulledAt':_0x25eb4b[_0x1e1bb4(0x148)]};}export const skillDefinitions=[{'service':a35_0x2ccec4(0x16b),'command':a35_0x2ccec4(0x173),'description':a35_0x2ccec4(0x18b),'risk':a35_0x2ccec4(0x170),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG],async 'execute'(_0x321055){return syncRuntimeSkills(_0x321055,{'installToAgent':!![]});}},{'service':'skill','command':a35_0x2ccec4(0x14a),'description':a35_0x2ccec4(0x15f),'risk':a35_0x2ccec4(0x170),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x27152a){const _0x2a7662=a35_0x2ccec4,_0xfdaa7a=buildSkillCreatePlan(_0x27152a['str'](_0x2a7662(0x191)),_0x27152a['str'](_0x2a7662(0x17b)),_0x27152a['str'](_0x2a7662(0x19e)));return{'method':_0x2a7662(0x15c),'url':_0xfdaa7a[_0x2a7662(0x177)],'body':{'skillName':_0xfdaa7a[_0x2a7662(0x1a5)][_0x2a7662(0x13e)],'type':_0xfdaa7a[_0x2a7662(0x1a5)]['type'],'selfContained':!![],'files':_0xfdaa7a[_0x2a7662(0x1a5)][_0x2a7662(0x175)][_0x2a7662(0x160)](_0x17a5e4=>_0x17a5e4[_0x2a7662(0x146)])},'description':_0x2a7662(0x174)};},async 'execute'(_0xa00a2a){const _0x31549b=a35_0x2ccec4,_0x20a99f=buildSkillCreatePlan(_0xa00a2a[_0x31549b(0x1aa)](_0x31549b(0x191)),_0xa00a2a[_0x31549b(0x1aa)]('type'),_0xa00a2a[_0x31549b(0x1aa)]('target'));return writeSkillDraft(_0x20a99f,_0xa00a2a[_0x31549b(0x18f)](_0x31549b(0x1a0))),{'ok':!![],'data':{'skillName':_0x20a99f[_0x31549b(0x1a5)][_0x31549b(0x13e)],'type':_0x20a99f[_0x31549b(0x1a5)][_0x31549b(0x17b)],'dir':_0x20a99f['skillDir'],'files':_0x20a99f[_0x31549b(0x1a5)][_0x31549b(0x175)][_0x31549b(0x160)](_0x3e0df0=>_0x3e0df0['path'])},'message':_0x31549b(0x14e)+_0x20a99f[_0x31549b(0x1a5)][_0x31549b(0x13e)]};}},{'service':a35_0x2ccec4(0x16b),'command':'validate','description':a35_0x2ccec4(0x168),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x4c6e43){const _0x24c4eb=a35_0x2ccec4,_0x3d4a87=_0x4c6e43[_0x24c4eb(0x18f)](_0x24c4eb(0x164)),_0x46ceff=validateSkillDirectory(_0x4c6e43[_0x24c4eb(0x1aa)](_0x24c4eb(0x13f)),{'strict':_0x3d4a87});return throwIfSkillValidationFailed(_0x46ceff,_0x3d4a87),{'ok':!![],'data':{'dir':_0x46ceff['dir'],'type':_0x46ceff[_0x24c4eb(0x17b)],'errors':_0x46ceff[_0x24c4eb(0x158)],'warnings':_0x46ceff[_0x24c4eb(0x166)]},'message':_0x24c4eb(0x1a9)};}},{'service':a35_0x2ccec4(0x16b),'command':'list','description':a35_0x2ccec4(0x180),'risk':a35_0x2ccec4(0x199),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG],async 'execute'(_0xf0a1b5){const _0x3b285f=a35_0x2ccec4,_0xc115d2=_0xf0a1b5[_0x3b285f(0x1aa)](_0x3b285f(0x150)),_0xdcf482=normalizeListScope(_0xf0a1b5[_0x3b285f(0x1aa)]('scope'));if(_0xf0a1b5[_0x3b285f(0x18f)](_0x3b285f(0x1a3))){const _0x12e21e=_0xf0a1b5[_0x3b285f(0x185)];if(!_0x12e21e)throw CliErrors[_0x3b285f(0x171)]();const _0x32cb74=_0xdcf482===_0x3b285f(0x17d)?[]:await((async()=>{const _0x457ae9=_0x3b285f,{listLocalRuntimeSkills:_0x341fc2}=await import(_0x457ae9(0x15a));return _0x341fc2({'env':_0xf0a1b5[_0x457ae9(0x14f)]??'production','accessKey':_0x12e21e,'appCode':_0xf0a1b5[_0x457ae9(0x147)],'scopes':listScopeToRuntimeScopes(_0xdcf482),'code':_0xc115d2[_0x457ae9(0x17c)]()||undefined});})()),_0x289e6d=groupLocalRuntimeSkills(_0x32cb74);return{'ok':!![],'data':{'appCode':_0xf0a1b5[_0x3b285f(0x147)],'source':_0x3b285f(0x1a3),'scope':_0xdcf482,'total':_0x32cb74[_0x3b285f(0x16c)],'personal':_0x289e6d[_0x3b285f(0x181)][_0x3b285f(0x16c)],'company':_0x289e6d['company'][_0x3b285f(0x16c)],'public':0x0,'items':_0x32cb74[_0x3b285f(0x160)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x289e6d[_0x3b285f(0x181)][_0x3b285f(0x160)](summarizeLocalRuntimeSkill),'company':_0x289e6d['company'][_0x3b285f(0x160)](summarizeLocalRuntimeSkill),'public':[]}},'message':_0x3b285f(0x13c)+_0x32cb74['length']+_0x3b285f(0x194)};}const {listRuntimeSkills:_0xb1f668}=await import(_0x3b285f(0x19c)),_0x4a98df=await _0xb1f668({'appCode':_0xf0a1b5[_0x3b285f(0x147)],'scope':listScopeToRemoteScope(_0xdcf482),'code':_0xc115d2[_0x3b285f(0x17c)]()||undefined}),_0x3cec28=shouldListScope(_0xdcf482,_0x3b285f(0x181))?_0x4a98df['personal']:[],_0x15efda=shouldListScope(_0xdcf482,_0x3b285f(0x167))?_0x4a98df['company']:[],_0x34ac68=shouldListScope(_0xdcf482,_0x3b285f(0x17d))?_0x4a98df[_0x3b285f(0x17d)]:[],_0x1ab4f1=_0xdcf482===_0x3b285f(0x161)?_0x4a98df[_0x3b285f(0x169)]:[..._0x3cec28,..._0x15efda,..._0x34ac68];return{'ok':!![],'data':{'appCode':_0xf0a1b5[_0x3b285f(0x147)],'source':_0x3b285f(0x188),'scope':_0xdcf482,'total':_0x1ab4f1[_0x3b285f(0x16c)],'personal':_0x3cec28['length'],'company':_0x15efda['length'],'public':_0x34ac68['length'],'items':_0x1ab4f1[_0x3b285f(0x160)](summarizeRuntimeSkill),'skills':{'personal':_0x3cec28[_0x3b285f(0x160)](summarizeRuntimeSkill),'company':_0x15efda['map'](summarizeRuntimeSkill),'public':_0x34ac68[_0x3b285f(0x160)](summarizeRuntimeSkill)}},'message':'Listed\x20'+_0x1ab4f1[_0x3b285f(0x16c)]+_0x3b285f(0x16e)};}},{'service':a35_0x2ccec4(0x16b),'command':a35_0x2ccec4(0x145),'description':a35_0x2ccec4(0x1a7),'risk':a35_0x2ccec4(0x170),'flags':[CODE_FLAG,SCOPE_FLAG],async 'execute'(_0x824f97){return syncRuntimeSkills(_0x824f97,{'installToAgent':![]});}},{'service':'skill','command':'push','description':a35_0x2ccec4(0x16a),'risk':a35_0x2ccec4(0x170),'flags':[DIR_FLAG],async 'execute'(_0x1595f2){const _0x377d5e=a35_0x2ccec4,{createPersonalRuntimeSkill:_0x4371c5,downloadRuntimeSkillPackage:_0x33d529,listRuntimeSkills:_0x430b5e,updatePersonalRuntimeSkill:_0x5df572}=await import(_0x377d5e(0x19c)),{verifyRuntimeSkillPackage:_0x506152,verifyRuntimeSkillBundle:_0x337a7c,readPushDirectory:_0x17a0e8,recordPushedRuntimeSkill:_0x22ac16}=await import('../../skills/runtime-skill-sync.js');if(!_0x1595f2[_0x377d5e(0x185)])throw CliErrors[_0x377d5e(0x171)]();const _0x428a8e=_0x1595f2[_0x377d5e(0x1aa)](_0x377d5e(0x13f)),_0x8abb69=validateSkillDirectory(_0x428a8e);throwIfSkillValidationFailed(_0x8abb69);const _0x55374c=_0x8abb69[_0x377d5e(0x13f)],_0x286e19=_0x17a0e8(_0x55374c,_0x1595f2['appCode']),_0x162b3a=(await _0x430b5e({'appCode':_0x1595f2[_0x377d5e(0x147)],'scope':_0x377d5e(0x181)}))[_0x377d5e(0x181)][_0x377d5e(0x149)](_0x1b02d8=>_0x1b02d8['skillCode']===_0x286e19['skillCode']),_0x4d628f=_0x162b3a?await _0x5df572(_0x286e19['skillCode'],_0x1595f2[_0x377d5e(0x147)],_0x286e19[_0x377d5e(0x144)]):await _0x4371c5(_0x1595f2['appCode'],_0x286e19[_0x377d5e(0x144)]);let _0x201024=_0x4d628f;if(isMultiFileManifest(_0x286e19[_0x377d5e(0x144)]['files'])){const _0x1ac926=await _0x33d529(_0x377d5e(0x181),_0x4d628f['skillCode']||_0x286e19[_0x377d5e(0x153)],_0x1595f2[_0x377d5e(0x147)]);_0x337a7c(_0x286e19[_0x377d5e(0x144)][_0x377d5e(0x175)],_0x1ac926),_0x201024={..._0x4d628f,'files':_0x286e19[_0x377d5e(0x144)][_0x377d5e(0x175)]};}else{if(isPackageBackedManifest(_0x4d628f[_0x377d5e(0x175)])){const _0x5472eb=await _0x33d529('personal',_0x4d628f[_0x377d5e(0x153)]||_0x286e19[_0x377d5e(0x153)],_0x1595f2[_0x377d5e(0x147)]);_0x506152(_0x4d628f[_0x377d5e(0x175)],_0x5472eb);}}return _0x22ac16(_0x55374c,_0x201024,_0x1595f2['appCode']),{'ok':!![],'data':summarizeRuntimeSkill(_0x4d628f),'message':_0x162b3a?_0x377d5e(0x1a1)+_0x286e19[_0x377d5e(0x153)]:_0x377d5e(0x192)+_0x286e19['skillCode']};}}];async function syncRuntimeSkills(_0x331665,_0x2d943e){const _0x2b7217=a35_0x2ccec4,{downloadRuntimeSkillPackage:_0x5cc3d6,listRuntimeSkills:_0x35c1f8}=await import(_0x2b7217(0x19c)),{linkEffectiveRuntimeSkills:_0x12e3af,materializeRuntimeSkill:_0x3b4c69,pruneStaleRuntimeSkillCache:_0xb9dcee,pruneStaleRuntimeSkillLinks:_0x5c7763}=await import('../../skills/runtime-skill-sync.js'),_0x4dda84=_0x331665[_0x2b7217(0x1aa)](_0x2b7217(0x150));normalizePullScope(_0x331665['str']('scope'));const _0x242e70=_0x331665['envName']??_0x2b7217(0x196),_0x237847=_0x331665['accessKey'];if(!_0x237847){if(_0x2d943e['installToAgent'])throw CliErrors[_0x2b7217(0x171)]('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');throw CliErrors[_0x2b7217(0x171)]();}const _0x167c20=await _0x35c1f8({'appCode':_0x331665['appCode'],'scope':_0x2b7217(0x161),'code':_0x4dda84[_0x2b7217(0x17c)]()||undefined}),_0x1e0071=_0x167c20[_0x2b7217(0x181)],_0xd12c73=_0x167c20[_0x2b7217(0x167)],_0x2bd60a=new Set([..._0x1e0071[_0x2b7217(0x160)](_0x2777c1=>_0x2777c1['skillCode']?.[_0x2b7217(0x17c)]())[_0x2b7217(0x1ab)](_0x481c87=>Boolean(_0x481c87)),..._0xd12c73[_0x2b7217(0x160)](_0x1c1e34=>_0x1c1e34[_0x2b7217(0x153)]?.[_0x2b7217(0x17c)]())[_0x2b7217(0x1ab)](_0x18ac35=>Boolean(_0x18ac35))]),_0x401395=_0x4dda84['trim']()?[_0x4dda84[_0x2b7217(0x17c)]()]:undefined,_0x32c7d5=_0x2d943e[_0x2b7217(0x154)]?_0x5c7763(_0x331665[_0x2b7217(0x147)],_0x2bd60a,{},_0x401395):[],_0x5b19d5=_0xb9dcee({'env':_0x242e70,'accessKey':_0x237847,'appCode':_0x331665[_0x2b7217(0x147)],'activeSkillCodes':_0x2bd60a,'pruneSkillCodes':_0x401395}),_0x427d80=[];for(const _0x2e2a55 of _0x1e0071){_0x427d80['push'](_0x3b4c69(_0x2e2a55,_0x2b7217(0x181),{'env':_0x242e70,'accessKey':_0x237847,'appCode':_0x331665['appCode'],'packageBytes':await downloadPackageIfNeeded(_0x2e2a55,_0x2b7217(0x181),_0x331665[_0x2b7217(0x147)],_0x5cc3d6)}));}for(const _0x3855cf of _0xd12c73){_0x427d80[_0x2b7217(0x182)](_0x3b4c69(_0x3855cf,'company',{'env':_0x242e70,'accessKey':_0x237847,'appCode':_0x331665[_0x2b7217(0x147)],'packageBytes':await downloadPackageIfNeeded(_0x3855cf,'company',_0x331665[_0x2b7217(0x147)],_0x5cc3d6)}));}const _0x16bd40=_0x2d943e['installToAgent']?_0x12e3af(_0x427d80,_0x331665[_0x2b7217(0x147)]):[],_0x3ce834=countLinkActions(_0x16bd40);return{'ok':!![],'data':{'appCode':_0x331665[_0x2b7217(0x147)],'personal':_0x1e0071[_0x2b7217(0x16c)],'company':_0xd12c73['length'],'materialized':_0x427d80[_0x2b7217(0x16c)],'links':{'total':_0x16bd40['length'],'created':_0x3ce834[_0x2b7217(0x1a6)]??0x0,'updated':_0x3ce834[_0x2b7217(0x15e)]??0x0,'unchanged':_0x3ce834[_0x2b7217(0x195)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x32c7d5['filter'](_0x5275ae=>_0x5275ae['action']===_0x2b7217(0x139))['length'],'cacheDirs':_0x5b19d5[_0x2b7217(0x1ab)](_0x29783a=>_0x29783a['action']===_0x2b7217(0x139))['length'],'skipped':[..._0x32c7d5,..._0x5b19d5][_0x2b7217(0x1ab)](_0x5a3aa0=>_0x5a3aa0[_0x2b7217(0x13d)]===_0x2b7217(0x189))[_0x2b7217(0x16c)]},'skills':{'personal':_0x1e0071[_0x2b7217(0x160)](summarizeRuntimeSkill),'company':_0xd12c73[_0x2b7217(0x160)](summarizeRuntimeSkill)}},'message':_0x2d943e[_0x2b7217(0x154)]?_0x2b7217(0x155)+_0x1e0071[_0x2b7217(0x16c)]+_0x2b7217(0x176)+_0xd12c73[_0x2b7217(0x16c)]+_0x2b7217(0x142):_0x2b7217(0x151)+_0x1e0071[_0x2b7217(0x16c)]+_0x2b7217(0x176)+_0xd12c73[_0x2b7217(0x16c)]+_0x2b7217(0x142)};}function buildSkillCreatePlan(_0xe2c0d9,_0x28a1c5,_0x2a61ea){const _0x2be426=renderSkillTemplate({'skillName':_0xe2c0d9,'type':_0x28a1c5}),_0x4dd1f2=resolve(normalizeSkillTarget(_0x2a61ea));return{'rendered':_0x2be426,'targetRoot':_0x4dd1f2,'skillDir':resolve(_0x4dd1f2,_0x2be426['skillName'])};}function normalizeSkillTarget(_0x35d06a){const _0xff0b12=a35_0x2ccec4;return(_0x35d06a||DEFAULT_SKILL_TARGET)[_0xff0b12(0x17c)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x225556,_0x565a37){const _0x36e7f6=a35_0x2ccec4;if(existsSync(_0x225556[_0x36e7f6(0x177)])){const _0x2ce273=lstatSync(_0x225556[_0x36e7f6(0x177)]);if(!_0x2ce273['isDirectory']()||_0x2ce273[_0x36e7f6(0x141)]())throw CliErrors[_0x36e7f6(0x157)](_0x36e7f6(0x156)+_0x225556[_0x36e7f6(0x177)]);if(!_0x565a37)throw CliErrors['validation'](_0x36e7f6(0x16f)+_0x225556[_0x36e7f6(0x177)],_0x36e7f6(0x183));}for(const _0x3386ad of _0x225556[_0x36e7f6(0x1a5)][_0x36e7f6(0x175)]){const _0xfc2e15=resolve(_0x225556[_0x36e7f6(0x177)],_0x3386ad[_0x36e7f6(0x146)]),_0x489839=dirname(_0xfc2e15);mkdirSync(_0x489839,{'recursive':!![]});if(existsSync(_0xfc2e15)&&lstatSync(_0xfc2e15)[_0x36e7f6(0x141)]())throw CliErrors[_0x36e7f6(0x157)]('Refusing\x20to\x20overwrite\x20symlink:\x20'+_0xfc2e15);writeFileSync(_0xfc2e15,_0x3386ad[_0x36e7f6(0x198)],'utf8');}}async function downloadPackageIfNeeded(_0x1f2616,_0x185ebc,_0x3dc5bc,_0x342ca7){const _0x141ee2=a35_0x2ccec4;if(!isPackageBackedManifest(_0x1f2616[_0x141ee2(0x175)]))return undefined;return _0x342ca7(_0x185ebc,_0x1f2616['skillCode'],_0x3dc5bc);}function normalizePullScope(_0x4ecb18){const _0x2f96d3=a35_0x2ccec4,_0x234b39=_0x4ecb18[_0x2f96d3(0x17c)]();if(!_0x234b39)return _0x2f96d3(0x161);if(_0x234b39===_0x2f96d3(0x161))return _0x234b39;throw CliErrors[_0x2f96d3(0x157)](_0x2f96d3(0x184)+_0x4ecb18);}function normalizeListScope(_0x14f648){const _0xfc2002=a35_0x2ccec4,_0x422021=_0x14f648[_0xfc2002(0x17c)]();if(!_0x422021)return _0xfc2002(0x161);if(_0x422021==='user'||_0x422021===_0xfc2002(0x181)||_0x422021===_0xfc2002(0x167)||_0x422021===_0xfc2002(0x17d)||_0x422021==='all')return _0x422021;throw CliErrors['validation'](_0xfc2002(0x172)+_0x14f648);}function shouldListScope(_0x1adef8,_0xff33cd){const _0x309302=a35_0x2ccec4;if(_0x1adef8===_0x309302(0x18e))return!![];if(_0x1adef8===_0x309302(0x161))return _0xff33cd===_0x309302(0x181)||_0xff33cd===_0x309302(0x167)||_0xff33cd===_0x309302(0x17d);return _0x1adef8===_0xff33cd;}function listScopeToRuntimeScopes(_0xcfedc9){const _0x2a574b=a35_0x2ccec4;if(_0xcfedc9===_0x2a574b(0x18e))return[_0x2a574b(0x181),_0x2a574b(0x167)];if(_0xcfedc9===_0x2a574b(0x161))return[_0x2a574b(0x181),_0x2a574b(0x167)];if(_0xcfedc9===_0x2a574b(0x17d))return[];return[_0xcfedc9===_0x2a574b(0x167)?_0x2a574b(0x167):_0xcfedc9];}function listScopeToRemoteScope(_0xc76459){return _0xc76459;}function groupLocalRuntimeSkills(_0x3a1417){const _0x28c8f3=a35_0x2ccec4;return{'personal':_0x3a1417[_0x28c8f3(0x1ab)](_0x52d3ea=>_0x52d3ea[_0x28c8f3(0x186)]===_0x28c8f3(0x181)),'company':_0x3a1417[_0x28c8f3(0x1ab)](_0x3a5f54=>_0x3a5f54[_0x28c8f3(0x186)]===_0x28c8f3(0x167)),'builtin':_0x3a1417[_0x28c8f3(0x1ab)](_0x43b320=>_0x43b320[_0x28c8f3(0x186)]==='builtin')};}function countLinkActions(_0x1ca755){const _0x62bef1=a35_0x2ccec4;return _0x1ca755[_0x62bef1(0x140)]((_0x58214d,_0x5653f8)=>{const _0x27f21a=_0x62bef1;return _0x58214d[_0x5653f8['action']]=(_0x58214d[_0x5653f8[_0x27f21a(0x13d)]]??0x0)+0x1,_0x58214d;},{});}function isPackageBackedManifest(_0x387731){const _0x290b26=a35_0x2ccec4;return!!_0x387731&&typeof _0x387731==='object'&&!Array[_0x290b26(0x19f)](_0x387731)&&typeof _0x387731['ossPath']==='string'&&_0x387731[_0x290b26(0x19a)]['length']>0x0&&Array[_0x290b26(0x19f)](_0x387731[_0x290b26(0x175)]);}function isMultiFileManifest(_0x28c2d1){const _0x2f6895=a35_0x2ccec4;return!!_0x28c2d1&&typeof _0x28c2d1==='object'&&!Array[_0x2f6895(0x19f)](_0x28c2d1)&&Array[_0x2f6895(0x19f)](_0x28c2d1[_0x2f6895(0x175)])&&_0x28c2d1[_0x2f6895(0x175)]['some'](_0x3fd388=>_0x3fd388[_0x2f6895(0x146)]!=='SKILL.md');}
1
+ const a35_0x59df79=a35_0x587b;(function(_0x37bbd8,_0xc5e956){const _0xcb759c=a35_0x587b,_0x3f595d=_0x37bbd8();while(!![]){try{const _0x5b7e7d=parseInt(_0xcb759c(0x209))/0x1+-parseInt(_0xcb759c(0x21d))/0x2*(parseInt(_0xcb759c(0x1d6))/0x3)+-parseInt(_0xcb759c(0x20b))/0x4+-parseInt(_0xcb759c(0x1ef))/0x5+parseInt(_0xcb759c(0x1e3))/0x6*(-parseInt(_0xcb759c(0x1d2))/0x7)+-parseInt(_0xcb759c(0x20e))/0x8+parseInt(_0xcb759c(0x1cb))/0x9*(parseInt(_0xcb759c(0x227))/0xa);if(_0x5b7e7d===_0xc5e956)break;else _0x3f595d['push'](_0x3f595d['shift']());}catch(_0x3b27a3){_0x3f595d['push'](_0x3f595d['shift']());}}}(a35_0x2b3b,0xdd3f3));import{CliErrors}from'../../errors.js';function a35_0x587b(_0x326c75,_0x5d5778){_0x326c75=_0x326c75-0x1c9;const _0x2b3b47=a35_0x2b3b();let _0x587b02=_0x2b3b47[_0x326c75];return _0x587b02;}import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{DEFAULT_SKILL_TARGET,renderSkillTemplate,SKILL_NAME_PATTERN,SKILL_TYPES}from'../../commands/skill/templates.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../../commands/skill/validate.js';const CODE_FLAG={'name':a35_0x59df79(0x1e4),'type':a35_0x59df79(0x1ce),'description':a35_0x59df79(0x21e)},SCOPE_FLAG={'name':'scope','type':'string','description':a35_0x59df79(0x20a),'enum':[a35_0x59df79(0x228),a35_0x59df79(0x232),a35_0x59df79(0x1d7)]},LIST_SCOPE_FLAG={'name':a35_0x59df79(0x1d8),'type':'string','description':a35_0x59df79(0x233),'enum':[a35_0x59df79(0x228),a35_0x59df79(0x232),a35_0x59df79(0x1d7)]},LOCAL_FLAG={'name':a35_0x59df79(0x1f4),'type':'boolean','description':'Read\x20CLI-managed\x20local\x20Skill\x20cache\x20and\x20links\x20instead\x20of\x20remote\x20lists'},DIR_FLAG={'name':a35_0x59df79(0x208),'type':a35_0x59df79(0x1ce),'required':!![],'description':a35_0x59df79(0x221)},CREATE_NAME_FLAG={'name':a35_0x59df79(0x216),'type':a35_0x59df79(0x1ce),'required':!![],'description':'Skill\x20name\x20using\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','pattern':{'regex':SKILL_NAME_PATTERN,'description':a35_0x59df79(0x1d0)}},TYPE_FLAG={'name':a35_0x59df79(0x21a),'type':'string','description':a35_0x59df79(0x220),'default':a35_0x59df79(0x1d3),'enum':[...SKILL_TYPES]},TARGET_FLAG={'name':'target','type':a35_0x59df79(0x1ce),'description':'Directory\x20that\x20will\x20contain\x20the\x20generated\x20Skill\x20directory','default':DEFAULT_SKILL_TARGET},FORCE_FLAG={'name':a35_0x59df79(0x1ca),'type':a35_0x59df79(0x22b),'description':a35_0x59df79(0x1e0)},STRICT_FLAG={'name':a35_0x59df79(0x1f7),'type':a35_0x59df79(0x22b),'description':a35_0x59df79(0x212)};function summarizeRuntimeSkill(_0x17e0c9){const _0x111ff3=a35_0x59df79;return{'id':_0x17e0c9['id'],'skillCode':_0x17e0c9[_0x111ff3(0x1f8)],'skillName':_0x17e0c9[_0x111ff3(0x201)],'scope':_0x17e0c9[_0x111ff3(0x1d8)],'version':_0x17e0c9[_0x111ff3(0x200)],'readonly':_0x17e0c9[_0x111ff3(0x203)]};}function summarizeLocalRuntimeSkill(_0x3d666e){const _0x1cc8d5=a35_0x59df79;return{'id':_0x3d666e['id'],'skillCode':_0x3d666e[_0x1cc8d5(0x1f8)],'skillName':_0x3d666e[_0x1cc8d5(0x201)],'scope':_0x3d666e[_0x1cc8d5(0x1d8)],'appCode':_0x3d666e[_0x1cc8d5(0x204)],'version':_0x3d666e[_0x1cc8d5(0x200)],'status':_0x3d666e[_0x1cc8d5(0x1d1)],'readonly':_0x3d666e[_0x1cc8d5(0x203)],'tags':_0x3d666e['tags'],'dir':_0x3d666e[_0x1cc8d5(0x208)],'cacheDir':_0x3d666e[_0x1cc8d5(0x22e)],'skillMdPath':_0x3d666e[_0x1cc8d5(0x1de)],'metadataPath':_0x3d666e[_0x1cc8d5(0x219)],'linkedPaths':_0x3d666e[_0x1cc8d5(0x21b)],'contentHash':_0x3d666e['contentHash'],'treeHash':_0x3d666e[_0x1cc8d5(0x1e2)],'pulledAt':_0x3d666e[_0x1cc8d5(0x20d)]};}export const skillDefinitions=[{'service':a35_0x59df79(0x22d),'command':a35_0x59df79(0x1fa),'description':a35_0x59df79(0x234),'risk':a35_0x59df79(0x1d3),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG],async 'execute'(_0x4042e4){return syncRuntimeSkills(_0x4042e4);}},{'service':a35_0x59df79(0x22d),'command':a35_0x59df79(0x207),'description':a35_0x59df79(0x1fd),'risk':a35_0x59df79(0x1d3),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x82038e){const _0x16b3b5=a35_0x59df79,_0x1ddda3=buildSkillCreatePlan(_0x82038e[_0x16b3b5(0x215)]('name'),_0x82038e['str'](_0x16b3b5(0x21a)),_0x82038e[_0x16b3b5(0x215)](_0x16b3b5(0x230)));return{'method':_0x16b3b5(0x210),'url':_0x1ddda3[_0x16b3b5(0x229)],'body':{'skillName':_0x1ddda3[_0x16b3b5(0x1c9)][_0x16b3b5(0x201)],'type':_0x1ddda3[_0x16b3b5(0x1c9)][_0x16b3b5(0x21a)],'selfContained':!![],'files':_0x1ddda3[_0x16b3b5(0x1c9)][_0x16b3b5(0x217)][_0x16b3b5(0x1da)](_0x571afa=>_0x571afa[_0x16b3b5(0x20c)])},'description':_0x16b3b5(0x1db)};},async 'execute'(_0x36c1bc){const _0x4997dd=a35_0x59df79,_0x52f308=buildSkillCreatePlan(_0x36c1bc[_0x4997dd(0x215)](_0x4997dd(0x216)),_0x36c1bc[_0x4997dd(0x215)](_0x4997dd(0x21a)),_0x36c1bc[_0x4997dd(0x215)](_0x4997dd(0x230)));return writeSkillDraft(_0x52f308,_0x36c1bc[_0x4997dd(0x1df)](_0x4997dd(0x1ca))),{'ok':!![],'data':{'skillName':_0x52f308[_0x4997dd(0x1c9)][_0x4997dd(0x201)],'type':_0x52f308['rendered'][_0x4997dd(0x21a)],'dir':_0x52f308['skillDir'],'files':_0x52f308['rendered'][_0x4997dd(0x217)][_0x4997dd(0x1da)](_0x4fb952=>_0x4fb952['path'])},'message':_0x4997dd(0x1ec)+_0x52f308[_0x4997dd(0x1c9)][_0x4997dd(0x201)]};}},{'service':a35_0x59df79(0x22d),'command':a35_0x59df79(0x1f9),'description':a35_0x59df79(0x236),'risk':a35_0x59df79(0x1fb),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x304384){const _0x4d61be=a35_0x59df79,_0x37a01e=_0x304384[_0x4d61be(0x1df)](_0x4d61be(0x1f7)),_0x137e1c=validateSkillDirectory(_0x304384[_0x4d61be(0x215)](_0x4d61be(0x208)),{'strict':_0x37a01e});return throwIfSkillValidationFailed(_0x137e1c,_0x37a01e),{'ok':!![],'data':{'dir':_0x137e1c[_0x4d61be(0x208)],'type':_0x137e1c[_0x4d61be(0x21a)],'errors':_0x137e1c[_0x4d61be(0x22a)],'warnings':_0x137e1c[_0x4d61be(0x1ee)]},'message':'Skill\x20validation\x20passed.'};}},{'service':a35_0x59df79(0x22d),'command':a35_0x59df79(0x205),'description':a35_0x59df79(0x237),'risk':'read','flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG],async 'execute'(_0x20dadc){const _0xee19ec=a35_0x59df79,_0x24c43f=_0x20dadc['str'](_0xee19ec(0x1e4)),_0x2429fa=normalizeListScope(_0x20dadc[_0xee19ec(0x215)]('scope'));if(_0x20dadc['bool'](_0xee19ec(0x1f4))){const _0x3bc4b5=_0x20dadc[_0xee19ec(0x1f3)];if(!_0x3bc4b5)throw CliErrors[_0xee19ec(0x1e1)]();const {listLocalRuntimeSkills:_0x7156fb}=await import(_0xee19ec(0x223)),_0x277793=_0x7156fb({'env':_0x20dadc[_0xee19ec(0x1f2)]??_0xee19ec(0x1fe),'accessKey':_0x3bc4b5,'appCode':_0x20dadc[_0xee19ec(0x204)],'scopes':listScopeToRuntimeScopes(_0x2429fa),'code':_0x24c43f[_0xee19ec(0x1dc)]()||undefined}),_0x3ac23a=groupLocalRuntimeSkills(_0x277793);return{'ok':!![],'data':{'appCode':_0x20dadc[_0xee19ec(0x204)],'source':_0xee19ec(0x1f4),'scope':_0x2429fa,'total':_0x277793[_0xee19ec(0x1eb)],'personal':_0x3ac23a[_0xee19ec(0x232)][_0xee19ec(0x1eb)],'company':_0x3ac23a[_0xee19ec(0x1d7)][_0xee19ec(0x1eb)],'items':_0x277793[_0xee19ec(0x1da)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x3ac23a['personal'][_0xee19ec(0x1da)](summarizeLocalRuntimeSkill),'company':_0x3ac23a[_0xee19ec(0x1d7)][_0xee19ec(0x1da)](summarizeLocalRuntimeSkill)}},'message':_0xee19ec(0x22c)+_0x277793[_0xee19ec(0x1eb)]+_0xee19ec(0x1ed)};}const {listRuntimeSkills:_0x2e7020}=await import('../../core/api-client.js'),_0x534f16=await _0x2e7020({'appCode':_0x20dadc['appCode'],'scope':listScopeToRemoteScope(_0x2429fa),'code':_0x24c43f[_0xee19ec(0x1dc)]()||undefined}),_0x563e85=shouldListScope(_0x2429fa,'personal')?_0x534f16['personal']??[]:[],_0x133e62=shouldListScope(_0x2429fa,_0xee19ec(0x1d7))?_0x534f16[_0xee19ec(0x1d7)]??[]:[],_0x576953=[..._0x563e85,..._0x133e62];return{'ok':!![],'data':{'appCode':_0x20dadc[_0xee19ec(0x204)],'source':_0xee19ec(0x1e7),'scope':_0x2429fa,'total':_0x576953[_0xee19ec(0x1eb)],'personal':_0x563e85[_0xee19ec(0x1eb)],'company':_0x133e62[_0xee19ec(0x1eb)],'items':_0x576953[_0xee19ec(0x1da)](summarizeRuntimeSkill),'skills':{'personal':_0x563e85['map'](summarizeRuntimeSkill),'company':_0x133e62['map'](summarizeRuntimeSkill)}},'message':_0xee19ec(0x22c)+_0x576953['length']+_0xee19ec(0x21c)};}},{'service':a35_0x59df79(0x22d),'command':'push','description':a35_0x59df79(0x235),'risk':a35_0x59df79(0x1d3),'flags':[DIR_FLAG],async 'execute'(_0x3d46db){const _0x3b35fb=a35_0x59df79,{createPersonalRuntimeSkill:_0x3e209a,downloadRuntimeSkillPackage:_0x2631a5,listRuntimeSkills:_0x2bbb96,updatePersonalRuntimeSkill:_0x4a3ff7}=await import(_0x3b35fb(0x22f)),{verifyRuntimeSkillPackage:_0xa3285c,verifyRuntimeSkillBundle:_0x78d67c,readPushDirectory:_0x4057e0,recordPushedRuntimeSkill:_0x159d5f}=await import('../../skills/runtime-skill-sync.js');if(!_0x3d46db[_0x3b35fb(0x1f3)])throw CliErrors[_0x3b35fb(0x1e1)]();const _0x50be8c=_0x3d46db[_0x3b35fb(0x215)](_0x3b35fb(0x208)),_0x393a9c=validateSkillDirectory(_0x50be8c);throwIfSkillValidationFailed(_0x393a9c);const _0x338255=_0x393a9c[_0x3b35fb(0x208)],_0x16dd6c=_0x4057e0(_0x338255,_0x3d46db[_0x3b35fb(0x204)]),_0x4a812d=(await _0x2bbb96({'appCode':_0x3d46db['appCode'],'scope':_0x3b35fb(0x232)}))[_0x3b35fb(0x232)][_0x3b35fb(0x1f6)](_0x420d1c=>_0x420d1c[_0x3b35fb(0x1f8)]===_0x16dd6c[_0x3b35fb(0x1f8)]),_0x2d9df8=_0x4a812d?await _0x4a3ff7(_0x16dd6c[_0x3b35fb(0x1f8)],_0x3d46db[_0x3b35fb(0x204)],_0x16dd6c[_0x3b35fb(0x213)]):await _0x3e209a(_0x3d46db['appCode'],_0x16dd6c['input']);let _0x3554c8=_0x2d9df8;if(isMultiFileManifest(_0x16dd6c['input'][_0x3b35fb(0x217)])){const _0x56b7a0=await _0x2631a5('personal',_0x2d9df8['skillCode']||_0x16dd6c[_0x3b35fb(0x1f8)],_0x3d46db['appCode']);_0x78d67c(_0x16dd6c[_0x3b35fb(0x213)][_0x3b35fb(0x217)],_0x56b7a0),_0x3554c8={..._0x2d9df8,'files':_0x16dd6c[_0x3b35fb(0x213)][_0x3b35fb(0x217)]};}else{if(isPackageBackedManifest(_0x2d9df8[_0x3b35fb(0x217)])){const _0x4a6cd8=await _0x2631a5(_0x3b35fb(0x232),_0x2d9df8[_0x3b35fb(0x1f8)]||_0x16dd6c[_0x3b35fb(0x1f8)],_0x3d46db[_0x3b35fb(0x204)]);_0xa3285c(_0x2d9df8[_0x3b35fb(0x217)],_0x4a6cd8);}}return _0x159d5f(_0x338255,_0x3554c8,_0x3d46db[_0x3b35fb(0x204)]),{'ok':!![],'data':summarizeRuntimeSkill(_0x2d9df8),'message':_0x4a812d?_0x3b35fb(0x211)+_0x16dd6c[_0x3b35fb(0x1f8)]:_0x3b35fb(0x231)+_0x16dd6c[_0x3b35fb(0x1f8)]};}}];async function syncRuntimeSkills(_0x8cec97){const _0x307d2f=a35_0x59df79,{downloadRuntimeSkillPackage:_0x4a3661,listRuntimeSkills:_0x150186}=await import(_0x307d2f(0x22f)),{linkEffectiveRuntimeSkills:_0x41c199,materializeRuntimeSkill:_0x4a97cf,pruneStaleRuntimeSkillCache:_0xb0cbad,pruneStaleRuntimeSkillLinks:_0x56490a}=await import(_0x307d2f(0x223)),_0x15645d=_0x8cec97[_0x307d2f(0x215)](_0x307d2f(0x1e4)),_0x112b15=normalizeSyncScopes(_0x8cec97['str'](_0x307d2f(0x1d8))),_0x31a69d=_0x8cec97[_0x307d2f(0x1f2)]??_0x307d2f(0x1fe),_0x20f57a=_0x8cec97[_0x307d2f(0x1f3)];if(!_0x20f57a)throw CliErrors[_0x307d2f(0x1e1)](_0x307d2f(0x21f));const _0x584b13=await Promise[_0x307d2f(0x228)](_0x112b15[_0x307d2f(0x1da)](_0x1adb81=>_0x150186({'appCode':_0x8cec97[_0x307d2f(0x204)],'scope':_0x1adb81,'code':_0x15645d['trim']()||undefined}))),_0x9f0cb=_0x112b15['includes'](_0x307d2f(0x232))?_0x584b13[_0x307d2f(0x1cc)]((_0x5a8fa5,_0x281a98)=>_0x112b15[_0x281a98]===_0x307d2f(0x232)?_0x5a8fa5['personal']:[]):[],_0x1b145d=_0x112b15[_0x307d2f(0x214)]('company')?_0x584b13[_0x307d2f(0x1cc)]((_0xa01a9,_0x1461c2)=>_0x112b15[_0x1461c2]===_0x307d2f(0x1d7)?_0xa01a9['company']:[]):[],_0x17bfbf=new Set([..._0x9f0cb['map'](_0x53cdb4=>_0x53cdb4[_0x307d2f(0x1f8)]?.['trim']())[_0x307d2f(0x1ea)](_0x29fdcb=>Boolean(_0x29fdcb)),..._0x1b145d[_0x307d2f(0x1da)](_0x5afc54=>_0x5afc54[_0x307d2f(0x1f8)]?.['trim']())[_0x307d2f(0x1ea)](_0x52a880=>Boolean(_0x52a880))]),_0x3f30c7=_0x15645d[_0x307d2f(0x1dc)]()?[_0x15645d[_0x307d2f(0x1dc)]()]:undefined,_0xefef52=_0x112b15[_0x307d2f(0x1eb)]===0x2&&_0x112b15[_0x307d2f(0x214)]('personal')&&_0x112b15[_0x307d2f(0x214)]('company'),_0x39aef0=_0xefef52?_0x56490a(_0x8cec97[_0x307d2f(0x204)],_0x17bfbf,{},_0x3f30c7):[],_0x1e2440=_0xb0cbad({'env':_0x31a69d,'accessKey':_0x20f57a,'appCode':_0x8cec97['appCode'],'activeSkillCodes':_0x17bfbf,'pruneSkillCodes':_0x3f30c7,'scopes':_0x112b15}),_0x587b64=[];for(const _0x271e0b of _0x9f0cb){_0x587b64[_0x307d2f(0x1e5)](_0x4a97cf(_0x271e0b,_0x307d2f(0x232),{'env':_0x31a69d,'accessKey':_0x20f57a,'appCode':_0x8cec97['appCode'],'packageBytes':await downloadPackageIfNeeded(_0x271e0b,_0x307d2f(0x232),_0x8cec97[_0x307d2f(0x204)],_0x4a3661)}));}for(const _0x1b6506 of _0x1b145d){_0x587b64[_0x307d2f(0x1e5)](_0x4a97cf(_0x1b6506,_0x307d2f(0x1d7),{'env':_0x31a69d,'accessKey':_0x20f57a,'appCode':_0x8cec97[_0x307d2f(0x204)],'packageBytes':await downloadPackageIfNeeded(_0x1b6506,_0x307d2f(0x1d7),_0x8cec97[_0x307d2f(0x204)],_0x4a3661)}));}const _0x281526=_0x41c199(_0x587b64,_0x8cec97[_0x307d2f(0x204)]),_0xc025f4=countLinkActions(_0x281526);return{'ok':!![],'data':{'appCode':_0x8cec97[_0x307d2f(0x204)],'personal':_0x9f0cb[_0x307d2f(0x1eb)],'company':_0x1b145d[_0x307d2f(0x1eb)],'materialized':_0x587b64['length'],'links':{'total':_0x281526[_0x307d2f(0x1eb)],'created':_0xc025f4[_0x307d2f(0x1f0)]??0x0,'updated':_0xc025f4[_0x307d2f(0x1fc)]??0x0,'unchanged':_0xc025f4[_0x307d2f(0x1e9)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x39aef0[_0x307d2f(0x1ea)](_0x5e0e43=>_0x5e0e43[_0x307d2f(0x1e6)]===_0x307d2f(0x1cd))['length'],'cacheDirs':_0x1e2440[_0x307d2f(0x1ea)](_0x541dcc=>_0x541dcc[_0x307d2f(0x1e6)]==='removed')[_0x307d2f(0x1eb)],'skipped':[..._0x39aef0,..._0x1e2440]['filter'](_0x4676ac=>_0x4676ac[_0x307d2f(0x1e6)]===_0x307d2f(0x218))[_0x307d2f(0x1eb)]},'skills':{'personal':_0x9f0cb[_0x307d2f(0x1da)](summarizeRuntimeSkill),'company':_0x1b145d['map'](summarizeRuntimeSkill)}},'message':_0x307d2f(0x1dd)+_0x9f0cb['length']+'\x20personal\x20and\x20'+_0x1b145d[_0x307d2f(0x1eb)]+_0x307d2f(0x1d4)};}function buildSkillCreatePlan(_0x22cf3d,_0x28a77b,_0x2c8259){const _0xb063ee=a35_0x59df79,_0x499247=renderSkillTemplate({'skillName':_0x22cf3d,'type':_0x28a77b}),_0x39f45a=resolve(normalizeSkillTarget(_0x2c8259));return{'rendered':_0x499247,'targetRoot':_0x39f45a,'skillDir':resolve(_0x39f45a,_0x499247[_0xb063ee(0x201)])};}function normalizeSkillTarget(_0x13cd24){return(_0x13cd24||DEFAULT_SKILL_TARGET)['trim']()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x4e6d18,_0x91a0b3){const _0x322c5f=a35_0x59df79;if(existsSync(_0x4e6d18['skillDir'])){const _0x2073b8=lstatSync(_0x4e6d18['skillDir']);if(!_0x2073b8[_0x322c5f(0x1f1)]()||_0x2073b8[_0x322c5f(0x1cf)]())throw CliErrors[_0x322c5f(0x1e8)](_0x322c5f(0x226)+_0x4e6d18['skillDir']);if(!_0x91a0b3)throw CliErrors['validation']('Skill\x20directory\x20already\x20exists:\x20'+_0x4e6d18[_0x322c5f(0x229)],_0x322c5f(0x20f));}for(const _0x13b580 of _0x4e6d18['rendered'][_0x322c5f(0x217)]){const _0x4d71ca=resolve(_0x4e6d18['skillDir'],_0x13b580[_0x322c5f(0x20c)]),_0x52a77f=dirname(_0x4d71ca);mkdirSync(_0x52a77f,{'recursive':!![]});if(existsSync(_0x4d71ca)&&lstatSync(_0x4d71ca)[_0x322c5f(0x1cf)]())throw CliErrors['validation'](_0x322c5f(0x1d5)+_0x4d71ca);writeFileSync(_0x4d71ca,_0x13b580['content'],'utf8');}}function a35_0x2b3b(){const _0x32639a=['object','create','dir','340674WGIIXz','Skill\x20sync\x20scope:\x20all\x20(personal/company),\x20personal,\x20or\x20company','4652892VUKNQp','path','pulledAt','709704Cmexct','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','WRITE','Updated\x20personal\x20Skill\x20','Compatibility\x20flag;\x20no\x20extra\x20checks\x20are\x20enabled','input','includes','str','name','files','skipped','metadataPath','type','linkedPaths','\x20remote\x20Skill(s).','26zuyzNq','Only\x20target\x20a\x20specific\x20runtime\x20Skill\x20code','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','Skill\x20template\x20type','Local\x20Skill\x20directory\x20containing\x20SKILL.md','some','../../skills/runtime-skill-sync.js','isArray','reduce','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','41009230pBHMdI','all','skillDir','errors','boolean','Listed\x20','skill','cacheDir','../../core/api-client.js','target','Created\x20personal\x20Skill\x20','personal','Skill\x20list\x20scope:\x20all,\x20personal,\x20or\x20company','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','rendered','force','9fFKarx','flatMap','removed','string','isSymbolicLink','lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens','status','63pMLLzl','write','\x20company\x20Skill(s).','Refusing\x20to\x20overwrite\x20symlink:\x20','153345bxxHOD','company','scope','Unsupported\x20Skill\x20sync\x20scope:\x20','map','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','trim','Installed\x20','skillMdPath','bool','Overwrite\x20generated\x20files\x20when\x20the\x20Skill\x20directory\x20already\x20exists','authRequired','treeHash','840564vZkCnJ','code','push','action','remote','validation','unchanged','filter','length','Created\x20local\x20Skill\x20draft\x20','\x20local\x20Skill(s).','warnings','1790465kZuvPO','created','isDirectory','envName','accessKey','local','Unsupported\x20Skill\x20list\x20scope:\x20','find','strict','skillCode','validate','install','read','updated','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','production','ossPath','version','skillName','SKILL.md','readonly','appCode','list'];a35_0x2b3b=function(){return _0x32639a;};return a35_0x2b3b();}async function downloadPackageIfNeeded(_0x2d0f6d,_0x28a23a,_0x737980,_0x89e19d){const _0x110e84=a35_0x59df79;if(!isPackageBackedManifest(_0x2d0f6d[_0x110e84(0x217)]))return undefined;return _0x89e19d(_0x28a23a,_0x2d0f6d[_0x110e84(0x1f8)],_0x737980);}function normalizeSyncScopes(_0x43fb75){const _0x3f4e3a=a35_0x59df79,_0x30983f=_0x43fb75[_0x3f4e3a(0x1dc)]();if(!_0x30983f||_0x30983f===_0x3f4e3a(0x228))return[_0x3f4e3a(0x232),_0x3f4e3a(0x1d7)];if(_0x30983f===_0x3f4e3a(0x232)||_0x30983f==='company')return[_0x30983f];throw CliErrors[_0x3f4e3a(0x1e8)](_0x3f4e3a(0x1d9)+_0x43fb75);}function normalizeListScope(_0x2097fe){const _0x22b406=a35_0x59df79,_0x4874fb=_0x2097fe[_0x22b406(0x1dc)]();if(!_0x4874fb)return _0x22b406(0x228);if(_0x4874fb===_0x22b406(0x232)||_0x4874fb===_0x22b406(0x1d7)||_0x4874fb===_0x22b406(0x228))return _0x4874fb;throw CliErrors[_0x22b406(0x1e8)](_0x22b406(0x1f5)+_0x2097fe);}function shouldListScope(_0x52dbd0,_0x571773){const _0x25a124=a35_0x59df79;if(_0x52dbd0===_0x25a124(0x228))return!![];return _0x52dbd0===_0x571773;}function listScopeToRuntimeScopes(_0x2e54b6){const _0x19de12=a35_0x59df79;if(_0x2e54b6==='all')return['personal',_0x19de12(0x1d7)];return[_0x2e54b6===_0x19de12(0x1d7)?_0x19de12(0x1d7):_0x2e54b6];}function listScopeToRemoteScope(_0x440972){return _0x440972;}function groupLocalRuntimeSkills(_0x9307a7){const _0x255eb8=a35_0x59df79;return{'personal':_0x9307a7['filter'](_0x52fc16=>_0x52fc16[_0x255eb8(0x1d8)]==='personal'),'company':_0x9307a7['filter'](_0x8d91f7=>_0x8d91f7['scope']===_0x255eb8(0x1d7)),'builtin':_0x9307a7['filter'](_0x36e983=>_0x36e983['scope']==='builtin')};}function countLinkActions(_0xec783e){const _0x2b2836=a35_0x59df79;return _0xec783e[_0x2b2836(0x225)]((_0x2e44a1,_0x3acbd7)=>{return _0x2e44a1[_0x3acbd7['action']]=(_0x2e44a1[_0x3acbd7['action']]??0x0)+0x1,_0x2e44a1;},{});}function isPackageBackedManifest(_0x3fe02a){const _0x2b0f13=a35_0x59df79;return!!_0x3fe02a&&typeof _0x3fe02a===_0x2b0f13(0x206)&&!Array[_0x2b0f13(0x224)](_0x3fe02a)&&typeof _0x3fe02a['ossPath']===_0x2b0f13(0x1ce)&&_0x3fe02a[_0x2b0f13(0x1ff)]['length']>0x0&&Array[_0x2b0f13(0x224)](_0x3fe02a[_0x2b0f13(0x217)]);}function isMultiFileManifest(_0x285a61){const _0x19672e=a35_0x59df79;return!!_0x285a61&&typeof _0x285a61===_0x19672e(0x206)&&!Array['isArray'](_0x285a61)&&Array['isArray'](_0x285a61[_0x19672e(0x217)])&&_0x285a61[_0x19672e(0x217)][_0x19672e(0x222)](_0x417823=>_0x417823['path']!==_0x19672e(0x202));}