@lovrabet/lovrabet-cli 2.3.13-beta.1 → 2.4.0-beta.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 (208) hide show
  1. package/README.md +22 -14
  2. package/lib/cli.js +4 -1
  3. package/lib/commands/api-doc/index.js +11 -1
  4. package/lib/commands/app/cache.js +2 -1
  5. package/lib/commands/app/definitions.js +7 -1
  6. package/lib/commands/app/eligibility.js +2 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +2 -1
  9. package/lib/commands/app/shared.js +1 -1
  10. package/lib/commands/app-config/get.js +1 -1
  11. package/lib/commands/app-config/index.js +1 -1
  12. package/lib/commands/approval/index.js +7 -1
  13. package/lib/commands/artifact/index.js +11 -1
  14. package/lib/commands/auth/device.js +8 -1
  15. package/lib/commands/auth/index.js +9 -1
  16. package/lib/commands/auth/prompt.js +2 -1
  17. package/lib/commands/bff/detail.js +1 -1
  18. package/lib/commands/bff/exec.js +1 -1
  19. package/lib/commands/bff/index.js +1 -1
  20. package/lib/commands/cli-skill/index.js +2 -1
  21. package/lib/commands/common/config-policy.js +2 -1
  22. package/lib/commands/common/constraints.js +2 -1
  23. package/lib/commands/common/flags.js +2 -1
  24. package/lib/commands/common/local-file.js +1 -1
  25. package/lib/commands/config/definitions.js +8 -1
  26. package/lib/commands/config/init.js +4 -1
  27. package/lib/commands/config/shared.js +1 -1
  28. package/lib/commands/data/import-excel.js +10 -1
  29. package/lib/commands/data/index.js +10 -1
  30. package/lib/commands/dataset/detail.js +6 -1
  31. package/lib/commands/dataset/index.js +1 -1
  32. package/lib/commands/dataset/list.js +2 -1
  33. package/lib/commands/dataset/sdk-doc.js +1 -1
  34. package/lib/commands/doctor.js +9 -1
  35. package/lib/commands/file/index.js +3 -1
  36. package/lib/commands/init.js +4 -1
  37. package/lib/commands/issue/context.js +1 -1
  38. package/lib/commands/issue/index.js +1 -1
  39. package/lib/commands/issue/report.js +5 -1
  40. package/lib/commands/kb/index.js +7 -1
  41. package/lib/commands/logs/index.js +1 -1
  42. package/lib/commands/metric/contract.js +5 -1
  43. package/lib/commands/metric/definition.js +4 -1
  44. package/lib/commands/metric/detail.js +1 -1
  45. package/lib/commands/metric/exec.js +3 -1
  46. package/lib/commands/metric/index.js +1 -1
  47. package/lib/commands/metric/list.js +2 -1
  48. package/lib/commands/metric/shared.js +2 -1
  49. package/lib/commands/notification/config-list.js +1 -1
  50. package/lib/commands/notification/index.js +1 -1
  51. package/lib/commands/notification/shared.js +2 -1
  52. package/lib/commands/ocr/index.js +4 -1
  53. package/lib/commands/permit/dataset-get.js +1 -1
  54. package/lib/commands/permit/dataset-set.js +5 -1
  55. package/lib/commands/permit/index.js +1 -1
  56. package/lib/commands/permit/page-get.js +1 -1
  57. package/lib/commands/permit/page-set.js +3 -1
  58. package/lib/commands/permit/role-menus-set.js +4 -1
  59. package/lib/commands/permit/role-menus.js +1 -1
  60. package/lib/commands/permit/shared.js +7 -1
  61. package/lib/commands/personal-bff/index.js +7 -1
  62. package/lib/commands/registry.js +6 -1
  63. package/lib/commands/role/create.js +2 -1
  64. package/lib/commands/role/delete.js +2 -1
  65. package/lib/commands/role/detail.js +1 -1
  66. package/lib/commands/role/index.js +1 -1
  67. package/lib/commands/role/list.js +2 -1
  68. package/lib/commands/role/shared.js +8 -1
  69. package/lib/commands/role/update.js +3 -1
  70. package/lib/commands/role/user-add.js +2 -1
  71. package/lib/commands/role/user-remove.js +2 -1
  72. package/lib/commands/schedule/index.js +7 -1
  73. package/lib/commands/schema.js +1 -1
  74. package/lib/commands/service/dynamic.js +10 -1
  75. package/lib/commands/service/function-name-adapter.js +3 -1
  76. package/lib/commands/service/index.js +8 -1
  77. package/lib/commands/service/registry.js +12 -1
  78. package/lib/commands/skill/commands/create.js +3 -1
  79. package/lib/commands/skill/commands/diagram.js +4 -1
  80. package/lib/commands/skill/commands/install.js +6 -1
  81. package/lib/commands/skill/commands/list.js +3 -1
  82. package/lib/commands/skill/commands/push.js +1 -1
  83. package/lib/commands/skill/commands/validate.js +1 -1
  84. package/lib/commands/skill/diagram.js +3 -1
  85. package/lib/commands/skill/flags.js +4 -1
  86. package/lib/commands/skill/index.js +1 -1
  87. package/lib/commands/skill/manifest-helpers.js +1 -1
  88. package/lib/commands/skill/push-execute.js +11 -1
  89. package/lib/commands/skill/push-flow-helpers.js +4 -1
  90. package/lib/commands/skill/push-retarget.js +1 -1
  91. package/lib/commands/skill/scopes.js +1 -1
  92. package/lib/commands/skill/summary.js +1 -1
  93. package/lib/commands/skill/templates.js +8 -1
  94. package/lib/commands/skill/validate.js +8 -1
  95. package/lib/commands/sql/detail.js +1 -1
  96. package/lib/commands/sql/exec.js +2 -1
  97. package/lib/commands/sql/index.js +1 -1
  98. package/lib/commands/update.d.ts +2 -1
  99. package/lib/commands/update.js +8 -1
  100. package/lib/commands/user-account/bind.js +3 -1
  101. package/lib/commands/user-account/index.js +1 -1
  102. package/lib/commands/workspace/index.js +7 -1
  103. package/lib/config/domain-config.js +6 -1
  104. package/lib/config/schema.js +5 -1
  105. package/lib/constant/app.js +1 -1
  106. package/lib/constant/auth-mode.js +1 -1
  107. package/lib/constant/cli.js +3 -1
  108. package/lib/constant/defaults.js +1 -1
  109. package/lib/constant/distribution.js +1 -1
  110. package/lib/constant/domain.js +2 -1
  111. package/lib/constant/env.js +1 -1
  112. package/lib/constant/output.js +1 -1
  113. package/lib/constant/product.js +2 -1
  114. package/lib/constant/region.js +2 -1
  115. package/lib/constant/risk.js +1 -1
  116. package/lib/constant/url.js +1 -1
  117. package/lib/context.js +11 -1
  118. package/lib/core/api-client.js +38 -1
  119. package/lib/core/db-resolver.js +1 -1
  120. package/lib/core/kb-management-client.js +6 -1
  121. package/lib/core/kb-sdk-errors.js +2 -1
  122. package/lib/core/kb-search-client.js +2 -1
  123. package/lib/core/sdk-client.js +5 -1
  124. package/lib/errors.js +2 -1
  125. package/lib/framework/access-error.js +1 -1
  126. package/lib/framework/build-all-flags.js +1 -1
  127. package/lib/framework/dryrun.js +1 -1
  128. package/lib/framework/flags.js +1 -1
  129. package/lib/framework/help.js +2 -1
  130. package/lib/framework/index.js +1 -1
  131. package/lib/framework/output.js +1 -1
  132. package/lib/framework/preparse.js +3 -1
  133. package/lib/framework/rate-limit.js +2 -1
  134. package/lib/framework/raw-flags.js +2 -1
  135. package/lib/framework/response.js +1 -1
  136. package/lib/framework/runner-confirmation.js +2 -1
  137. package/lib/framework/runner-error.js +2 -1
  138. package/lib/framework/runner.js +9 -1
  139. package/lib/framework/schema-export.js +2 -1
  140. package/lib/framework/service-order.js +1 -1
  141. package/lib/framework/types.js +1 -1
  142. package/lib/generated/build-info.d.ts +4 -4
  143. package/lib/generated/build-info.js +1 -1
  144. package/lib/generated/official-routing.js +2 -1
  145. package/lib/generated/routing-contract.js +1 -1
  146. package/lib/help.js +1 -1
  147. package/lib/runtime/confirmation.js +1 -1
  148. package/lib/runtime/event.js +1 -1
  149. package/lib/runtime/index.js +4 -1
  150. package/lib/runtime/queue.js +1 -1
  151. package/lib/runtime/resolve.js +2 -1
  152. package/lib/runtime/types.js +1 -1
  153. package/lib/services/dataset-import/auto-id-runner.js +9 -1
  154. package/lib/services/dataset-import/excel-reader.js +25 -1
  155. package/lib/services/dataset-import/image-bytes.js +6 -1
  156. package/lib/services/dataset-import/image-ooxml.js +15 -1
  157. package/lib/services/dataset-import/image-runner.js +9 -1
  158. package/lib/services/dataset-import/metadata.js +1 -1
  159. package/lib/services/dataset-import/preview.js +1 -1
  160. package/lib/services/dataset-import/runner.js +13 -1
  161. package/lib/services/dataset-import/types.js +1 -1
  162. package/lib/skills/builtin-skill.js +8 -1
  163. package/lib/skills/install-updated-skill.d.ts +8 -0
  164. package/lib/skills/install-updated-skill.js +3 -0
  165. package/lib/skills/local-skills-installer.d.ts +2 -0
  166. package/lib/skills/local-skills-installer.js +1 -0
  167. package/lib/skills/npx-skills-add.d.ts +2 -2
  168. package/lib/skills/npx-skills-add.js +4 -1
  169. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  170. package/lib/skills/runtime-skill-sync/fs-utils.js +3 -1
  171. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  172. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  173. package/lib/skills/runtime-skill-sync/links.js +9 -1
  174. package/lib/skills/runtime-skill-sync/list-local.js +4 -1
  175. package/lib/skills/runtime-skill-sync/local-files.js +5 -1
  176. package/lib/skills/runtime-skill-sync/materialize.js +9 -1
  177. package/lib/skills/runtime-skill-sync/metadata.js +3 -1
  178. package/lib/skills/runtime-skill-sync/paths.js +2 -1
  179. package/lib/skills/runtime-skill-sync/push.js +8 -1
  180. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  181. package/lib/skills/runtime-skill-sync/types.js +1 -1
  182. package/lib/skills/runtime-skill-sync/zip-codec.js +2 -1
  183. package/lib/skills/runtime-skill-sync/zip-package.js +6 -1
  184. package/lib/skills/runtime-skill-sync.js +1 -1
  185. package/lib/skills/skill-presence.d.ts +1 -34
  186. package/lib/skills/skill-presence.js +2 -1
  187. package/lib/utils/access-key-redaction.js +2 -1
  188. package/lib/utils/apply-jq-filter.js +1 -1
  189. package/lib/utils/cli-version-check.js +2 -1
  190. package/lib/utils/cli-version-policy.js +3 -1
  191. package/lib/utils/logger.js +3 -1
  192. package/lib/utils/lossless-json.js +3 -1
  193. package/lib/utils/params.js +3 -1
  194. package/lib/utils/positive-safe-integer.js +1 -1
  195. package/lib/utils/redaction.js +2 -1
  196. package/lib/utils/runtime-user-id.js +1 -1
  197. package/lib/utils/update-notice.js +3 -1
  198. package/lib/utils/version.js +1 -1
  199. package/lib/utils/write-cli-side-channel.js +1 -1
  200. package/package.json +5 -7
  201. package/skills/lovrabet/SKILL.md +3 -3
  202. package/skills/lovrabet/references/lovrabet-skill-install.md +1 -1
  203. package/skills/lovrabet/references/lovrabet-update.md +6 -4
  204. package/skills/lovrabet-report-generation/SKILL.md +1 -1
  205. package/skills/lovrabet.manifest.json +3 -3
  206. package/lib/postinstall.d.ts +0 -2
  207. package/lib/postinstall.js +0 -1
  208. package/scripts/postinstall.mjs +0 -24
@@ -1 +1,4 @@
1
- (function(_0x57a2eb,_0x5bce8a){const _0x15c81b=a87_0x52a7,_0x4739da=_0x57a2eb();while(!![]){try{const _0x5e521d=parseInt(_0x15c81b(0xf7))/0x1*(parseInt(_0x15c81b(0xe6))/0x2)+parseInt(_0x15c81b(0xe3))/0x3*(parseInt(_0x15c81b(0x100))/0x4)+-parseInt(_0x15c81b(0xf9))/0x5+-parseInt(_0x15c81b(0x10b))/0x6+parseInt(_0x15c81b(0xf5))/0x7+-parseInt(_0x15c81b(0x10c))/0x8+-parseInt(_0x15c81b(0xff))/0x9*(-parseInt(_0x15c81b(0xf1))/0xa);if(_0x5e521d===_0x5bce8a)break;else _0x4739da['push'](_0x4739da['shift']());}catch(_0x260076){_0x4739da['push'](_0x4739da['shift']());}}}(a87_0x29fb,0x3fb7a));function a87_0x29fb(){const _0x310133=['version','\x20after\x20successful\x20push.','315dIAKyS','4DZBKHz','Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.','different','Company','length','Use\x20a\x20different\x20skillCode\x20when\x20submitting\x20a\x20personal\x20or\x20company\x20Skill.','not-applicable','join','valid','files','\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20','1844472YQdFJA','2383408cHRJlp','skillCode','downloadRuntimeSkillPackage','publishInput','str','1328574qCipuL','Warnings:\x20','builtin','73490mAUEOU','errors','skill-metadata-appcode-retargeted','Local\x20Skill\x20metadata\x20appCode\x20','company','verifyRuntimeSkillBundle','appCode','Do\x20not\x20modify\x20the\x20source\x20Skill\x20merely\x20to\x20satisfy\x20publishing.','validation','skill\x20push\x20supports\x20--scope\x20personal\x20or\x20--scope\x20company;\x20received\x20\x22','Fix\x20real\x20issues.\x20If\x20the\x20remaining\x20warnings\x20are\x20reviewed\x20false\x20positives,\x20rerun\x20with\x20--confirm-warnings\x20to\x20submit\x20the\x20unchanged\x20package.','81790igrhTb','Personal','scope','warning','300111zqnEAU','content','8KbOJaV','SkillHub\x20validation\x20returned\x20invalid.','998160tnUtmf','personal','remote','\x20Skill\x20push\x20validation\x20reported\x20warning(s)\x20for\x20'];a87_0x29fb=function(){return _0x310133;};return a87_0x29fb();}import{CliErrors}from'../../errors.js';export function resolvePushScope(_0x3a019b){const _0x33ac5a=a87_0x52a7,_0x1bd0c1=_0x3a019b[_0x33ac5a(0xe2)]('scope')||_0x33ac5a(0xfa);if(_0x1bd0c1===_0x33ac5a(0xfa)||_0x1bd0c1==='company')return _0x1bd0c1;throw CliErrors[_0x33ac5a(0xee)](_0x33ac5a(0xef)+_0x1bd0c1+'\x22.');}export function allowRetargetArgs(_0x446e42){return _0x446e42?[{'allowAppCodeRetarget':!![]}]:[];}export function remoteFirstMetadataOptions(){return{'ignoreInvalidMetadata':!![],'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataSkillCode':!![]};}export function remoteMissingPayloadOptions(){return{'ignoreMetadataForPayload':!![],'ignoreMetadataScope':!![],'ignoreMetadataSkillCode':!![]};}function a87_0x52a7(_0x793205,_0x34b1b5){_0x793205=_0x793205-0xe2;const _0x29fbb1=a87_0x29fb();let _0x52a785=_0x29fbb1[_0x793205];return _0x52a785;}export function remoteMissingCompanyReadOptions(){const _0xbbdb7b=a87_0x52a7;return{'targetScope':_0xbbdb7b(0xea),...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions()};}export function remoteMissingPersonalReadOptions(_0x2c7bd7={}){return{...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions(),..._0x2c7bd7};}export function remotePersonalReadOptions(_0x3d69a3,_0x3c98e={}){return{'ignoreInvalidMetadata':!![],..._0x3d69a3?{'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataScope':!![]}:{},..._0x3c98e};}export function throwIfBuiltinPushTarget(_0x337189){const _0x678354=a87_0x52a7;if(_0x337189?.[_0x678354(0xf3)]!==_0x678354(0xe5))return;throw CliErrors[_0x678354(0xee)]('Builtin\x20Skill\x20'+(_0x337189['skillCode']??'(unknown)')+'\x20cannot\x20be\x20pushed.',_0x678354(0x105));}export function throwIfPublishValidationFailed(_0xd59653,_0x212fdb,_0x28d7e5){const _0x2cd0b3=a87_0x52a7;if(_0x28d7e5[_0x2cd0b3(0xe7)][_0x2cd0b3(0x104)]===0x0&&(_0x28d7e5[_0x2cd0b3(0x108)]||_0x28d7e5['warnings']['length']>0x0))return;const _0xd34430=_0x28d7e5[_0x2cd0b3(0xe7)][_0x2cd0b3(0x104)]>0x0?_0x28d7e5['errors'][_0x2cd0b3(0x107)](';\x20'):_0x2cd0b3(0xf8),_0x5ea641=_0xd59653==='company'?_0x2cd0b3(0x103):_0x2cd0b3(0xf2);throw CliErrors[_0x2cd0b3(0xee)](_0x5ea641+'\x20Skill\x20push\x20validation\x20failed\x20for\x20'+_0x212fdb+'.',_0xd34430);}export function throwIfUnconfirmedPublishWarnings(_0x125529,_0x515db6,_0x531cdb,_0x4245ad){const _0x461ec7=a87_0x52a7;if(_0x531cdb['length']===0x0||_0x4245ad)return;const _0xa7894a=_0x125529==='company'?_0x461ec7(0x103):'Personal';throw CliErrors[_0x461ec7(0xee)](_0xa7894a+_0x461ec7(0xfc)+_0x515db6+'.',['Review\x20each\x20warning\x20before\x20continuing.',_0x461ec7(0xed),_0x461ec7(0xf0),_0x461ec7(0xe4)+_0x531cdb['join'](';\x20')][_0x461ec7(0x107)]('\x20'));}export function buildRetargetWarning(_0x222aa3,_0x9adc37){const _0x5a7246=a87_0x52a7;if(!_0x222aa3?.[_0x5a7246(0xec)]||_0x222aa3[_0x5a7246(0xec)]===_0x9adc37)return[];return[{'level':_0x5a7246(0xf4),'ruleId':_0x5a7246(0xe8),'file':'lovrabet.skill.json','message':_0x5a7246(0xe9)+_0x222aa3[_0x5a7246(0xec)]+_0x5a7246(0x10a)+_0x9adc37+_0x5a7246(0xfe),'suggestion':_0x5a7246(0x101)}];}export async function runRemoteContentPreflight(_0x5da8ad){const _0xb79bf2=a87_0x52a7;if(!_0x5da8ad[_0xb79bf2(0xfb)]||_0x5da8ad[_0xb79bf2(0xfb)][_0xb79bf2(0xf3)]!==_0x5da8ad['scope']||!_0x5da8ad[_0xb79bf2(0x10f)][_0xb79bf2(0x109)])return{'status':_0xb79bf2(0x106)};const _0x4984fb=_0x5da8ad[_0xb79bf2(0xfb)][_0xb79bf2(0x10d)]||_0x5da8ad[_0xb79bf2(0x10d)];if(!_0x4984fb)return{'status':_0xb79bf2(0x106)};const _0x5bd0db=await _0x5da8ad[_0xb79bf2(0x10e)](_0x5da8ad[_0xb79bf2(0xf3)],_0x4984fb,_0x5da8ad[_0xb79bf2(0xec)],_0x5da8ad[_0xb79bf2(0xfb)][_0xb79bf2(0xfd)]);try{_0x5da8ad[_0xb79bf2(0xeb)](_0x5da8ad['publishInput'][_0xb79bf2(0x109)],_0x5bd0db);}catch{return{'status':_0xb79bf2(0x102)};}return{'status':'identical','savedSkill':{..._0x5da8ad[_0xb79bf2(0xfb)],'content':_0x5da8ad['publishInput'][_0xb79bf2(0xf6)],'files':_0x5da8ad[_0xb79bf2(0x10f)][_0xb79bf2(0x109)]}};}
1
+ import{CliErrors}from"../../errors.js";export function resolvePushScope(ctx){const scope=ctx.str("scope")||"personal";if(scope==="personal"||scope==="company"){return scope}throw CliErrors.validation(`skill push supports --scope personal or --scope company; received "${scope}".`)}export function allowRetargetArgs(allowRetarget){return allowRetarget?[{allowAppCodeRetarget:true}]:[]}export function remoteFirstMetadataOptions(){return{ignoreInvalidMetadata:true,ignoreMetadataAppCodeMismatch:true,ignoreMetadataSkillCode:true}}export function remoteMissingPayloadOptions(){return{ignoreMetadataForPayload:true,ignoreMetadataScope:true,ignoreMetadataSkillCode:true}}export function remoteMissingCompanyReadOptions(){return{targetScope:"company",...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions()}}export function remoteMissingPersonalReadOptions(extra={}){return{...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions(),...extra}}
2
+ export function remotePersonalReadOptions(allowLocalScopeRecovery,extra={}){return{ignoreInvalidMetadata:true,...allowLocalScopeRecovery?{ignoreMetadataAppCodeMismatch:true,ignoreMetadataScope:true}:{},...extra}}export function throwIfBuiltinPushTarget(remote){if(remote?.scope!=="builtin"){return}throw CliErrors.validation(`Builtin Skill ${remote.skillCode??"(unknown)"} cannot be pushed.`,"Use a different skillCode when submitting a personal or company Skill.")}export function throwIfPublishValidationFailed(scope,skillCode,validation){if(validation.errors.length===0&&(validation.valid||validation.warnings.length>0)){return}const detail=validation.errors.length>0?validation.errors.join("; "):"SkillHub validation returned invalid.";const scopeLabel=scope==="company"?"Company":"Personal";throw CliErrors.validation(`${scopeLabel} Skill push validation failed for ${skillCode}.`,detail)}export function throwIfUnconfirmedPublishWarnings(scope,skillCode,warnings,confirmWarnings){
3
+ if(warnings.length===0||confirmWarnings){return}const scopeLabel=scope==="company"?"Company":"Personal";throw CliErrors.validation(`${scopeLabel} Skill push validation reported warning(s) for ${skillCode}.`,["Review each warning before continuing.","Do not modify the source Skill merely to satisfy publishing.","Fix real issues. If the remaining warnings are reviewed false positives, rerun with --confirm-warnings to submit the unchanged package.",`Warnings: ${warnings.join("; ")}`].join(" "))}export function buildRetargetWarning(metadata,targetAppCode){if(!metadata?.appCode||metadata.appCode===targetAppCode){return[]}return[{level:"warning",ruleId:"skill-metadata-appcode-retargeted",file:"lovrabet.skill.json",message:`Local Skill metadata appCode ${metadata.appCode} was retargeted to explicit appCode ${targetAppCode} after successful push.`,suggestion:"Review the updated local Skill metadata before the next push."}]}export async function runRemoteContentPreflight(input){
4
+ if(!input.remote||input.remote.scope!==input.scope||!input.publishInput.files){return{status:"not-applicable"}}const remoteSkillCode=input.remote.skillCode||input.skillCode;if(!remoteSkillCode){return{status:"not-applicable"}}const remotePackage=await input.downloadRuntimeSkillPackage(input.scope,remoteSkillCode,input.appCode,input.remote.version);try{input.verifyRuntimeSkillBundle(input.publishInput.files,remotePackage)}catch{return{status:"different"}}return{status:"identical",savedSkill:{...input.remote,content:input.publishInput.content,files:input.publishInput.files}}}
@@ -1 +1 @@
1
- (function(_0x2174bb,_0x496423){const _0x56caf2=a88_0x1147,_0x2a3d28=_0x2174bb();while(!![]){try{const _0x4f1f12=parseInt(_0x56caf2(0x1bc))/0x1*(parseInt(_0x56caf2(0x1b5))/0x2)+-parseInt(_0x56caf2(0x1c9))/0x3*(parseInt(_0x56caf2(0x1b6))/0x4)+parseInt(_0x56caf2(0x1b7))/0x5+parseInt(_0x56caf2(0x1c3))/0x6*(-parseInt(_0x56caf2(0x1ca))/0x7)+parseInt(_0x56caf2(0x1c6))/0x8+-parseInt(_0x56caf2(0x1cb))/0x9*(parseInt(_0x56caf2(0x1be))/0xa)+parseInt(_0x56caf2(0x1ba))/0xb*(parseInt(_0x56caf2(0x1c5))/0xc);if(_0x4f1f12===_0x496423)break;else _0x2a3d28['push'](_0x2a3d28['shift']());}catch(_0x16cc61){_0x2a3d28['push'](_0x2a3d28['shift']());}}}(a88_0x5c74,0x2fe9e));export function withRetargetExistingMetadata(_0x33a0d8,_0x11ad65,_0x11c05a={}){const _0x40acef=a88_0x1147,_0x8165ec=_0x11c05a[_0x40acef(0x1cc)]?_0x33a0d8[_0x40acef(0x1c8)]??_0x11ad65['skillName']:_0x11ad65[_0x40acef(0x1c8)]??_0x33a0d8[_0x40acef(0x1c8)];return{..._0x33a0d8,'skillName':_0x8165ec,'description':_0x11ad65['description']??_0x33a0d8[_0x40acef(0x1c1)],'tags':Array[_0x40acef(0x1c7)](_0x11ad65['tags'])?_0x11ad65[_0x40acef(0x1b3)]:_0x33a0d8[_0x40acef(0x1b3)],'version':_0x11ad65[_0x40acef(0x1b4)]??_0x33a0d8[_0x40acef(0x1b4)],'sourceSessionId':_0x11ad65[_0x40acef(0x1c4)]??_0x33a0d8[_0x40acef(0x1c4)]};}function a88_0x1147(_0x3bb512,_0x492940){_0x3bb512=_0x3bb512-0x1b2;const _0x5c743b=a88_0x5c74();let _0x11473f=_0x5c743b[_0x3bb512];return _0x11473f;}function a88_0x5c74(){const _0x5f4c5c=['757256xrJexj','isArray','skillName','905781LCbupC','7MOnAUj','760437GnFgcj','preferInputSkillName','skill-metadata-appcode-retargeted','tags','version','81098KzuEJB','4oBrijU','757575yezcCO','appCode','warning','4511144BGSbyS','Local\x20Skill\x20metadata\x20appCode\x20','5xmPSuZ','Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.','10LIxpHO','lovrabet.skill.json','\x20after\x20successful\x20push.','description','\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20','1658082iWbVoe','sourceSessionId','12EVkdfB'];a88_0x5c74=function(){return _0x5f4c5c;};return a88_0x5c74();}export function buildRetargetWarning(_0x18e3a6,_0x1cf2e4){const _0x164655=a88_0x1147;if(!_0x18e3a6?.[_0x164655(0x1b8)]||_0x18e3a6[_0x164655(0x1b8)]===_0x1cf2e4)return[];return[{'level':_0x164655(0x1b9),'ruleId':_0x164655(0x1b2),'file':_0x164655(0x1bf),'message':_0x164655(0x1bb)+_0x18e3a6['appCode']+_0x164655(0x1c2)+_0x1cf2e4+_0x164655(0x1c0),'suggestion':_0x164655(0x1bd)}];}
1
+ export function withRetargetExistingMetadata(input,existing,options={}){const skillName=options.preferInputSkillName?input.skillName??existing.skillName:existing.skillName??input.skillName;return{...input,skillName:skillName,description:existing.description??input.description,tags:Array.isArray(existing.tags)?existing.tags:input.tags,version:existing.version??input.version,sourceSessionId:existing.sourceSessionId??input.sourceSessionId}}export function buildRetargetWarning(metadata,targetAppCode){if(!metadata?.appCode||metadata.appCode===targetAppCode){return[]}return[{level:"warning",ruleId:"skill-metadata-appcode-retargeted",file:"lovrabet.skill.json",message:`Local Skill metadata appCode ${metadata.appCode} was retargeted to explicit appCode ${targetAppCode} after successful push.`,suggestion:"Review the updated local Skill metadata before the next push."}]}
@@ -1 +1 @@
1
- (function(_0x260074,_0x166022){const _0x5948eb=a89_0x4bfd,_0x1e2e76=_0x260074();while(!![]){try{const _0x542fef=-parseInt(_0x5948eb(0x92))/0x1*(parseInt(_0x5948eb(0x99))/0x2)+-parseInt(_0x5948eb(0x9d))/0x3*(-parseInt(_0x5948eb(0x96))/0x4)+-parseInt(_0x5948eb(0xa0))/0x5*(parseInt(_0x5948eb(0x93))/0x6)+parseInt(_0x5948eb(0x97))/0x7+-parseInt(_0x5948eb(0xa1))/0x8+-parseInt(_0x5948eb(0x9b))/0x9+-parseInt(_0x5948eb(0x95))/0xa*(-parseInt(_0x5948eb(0x98))/0xb);if(_0x542fef===_0x166022)break;else _0x1e2e76['push'](_0x1e2e76['shift']());}catch(_0x3f9d67){_0x1e2e76['push'](_0x1e2e76['shift']());}}}(a89_0x5bb9,0xa73d8));import{CliErrors}from'../../errors.js';function a89_0x5bb9(){const _0x567acf=['all','12271842yAvCoE','Unsupported\x20Skill\x20list\x20scope:\x20','3fuDSVl','company','trim','5LqWobq','10119104PhXlqs','validation','Unsupported\x20Skill\x20sync\x20scope:\x20','169838wyoCPz','6011430lpEKZE','personal','38599490bAbMPG','1387732CgyTMu','7892451FoqBWo','11oWygHn','12McvxxG'];a89_0x5bb9=function(){return _0x567acf;};return a89_0x5bb9();}export function normalizeSyncScopes(_0x1ebcdb){const _0x4ff124=a89_0x4bfd,_0xfaae96=_0x1ebcdb[_0x4ff124(0x9f)]();if(!_0xfaae96||_0xfaae96===_0x4ff124(0x9a))return[_0x4ff124(0x94),_0x4ff124(0x9e)];if(_0xfaae96===_0x4ff124(0x94)||_0xfaae96===_0x4ff124(0x9e))return[_0xfaae96];throw CliErrors[_0x4ff124(0xa2)](_0x4ff124(0x91)+_0x1ebcdb);}export function normalizeListScope(_0x2563bb){const _0x1519a6=a89_0x4bfd,_0x20e2d7=_0x2563bb[_0x1519a6(0x9f)]();if(!_0x20e2d7)return _0x1519a6(0x9a);if(_0x20e2d7==='personal'||_0x20e2d7===_0x1519a6(0x9e)||_0x20e2d7===_0x1519a6(0x9a))return _0x20e2d7;throw CliErrors[_0x1519a6(0xa2)](_0x1519a6(0x9c)+_0x2563bb);}export function shouldListScope(_0x128cdc,_0x5a532c){const _0x1fb615=a89_0x4bfd;if(_0x128cdc===_0x1fb615(0x9a))return!![];return _0x128cdc===_0x5a532c;}function a89_0x4bfd(_0x263ff3,_0x3a09e1){_0x263ff3=_0x263ff3-0x91;const _0x5bb9ef=a89_0x5bb9();let _0x4bfd16=_0x5bb9ef[_0x263ff3];return _0x4bfd16;}export function listScopeToRuntimeScopes(_0x484431){const _0x262cd8=a89_0x4bfd;if(_0x484431==='all')return['personal',_0x262cd8(0x9e)];return[_0x484431===_0x262cd8(0x9e)?_0x262cd8(0x9e):_0x484431];}export function listScopeToRemoteScope(_0x34831a){return _0x34831a;}
1
+ import{CliErrors}from"../../errors.js";export function normalizeSyncScopes(value){const normalized=value.trim();if(!normalized||normalized==="all")return["personal","company"];if(normalized==="personal"||normalized==="company")return[normalized];throw CliErrors.validation(`Unsupported Skill sync scope: ${value}`)}export function normalizeListScope(value){const normalized=value.trim();if(!normalized)return"all";if(normalized==="personal"||normalized==="company"||normalized==="all"){return normalized}throw CliErrors.validation(`Unsupported Skill list scope: ${value}`)}export function shouldListScope(scope,target){if(scope==="all")return true;return scope===target}export function listScopeToRuntimeScopes(scope){if(scope==="all")return["personal","company"];return[scope==="company"?"company":scope]}export function listScopeToRemoteScope(scope){return scope}
@@ -1 +1 @@
1
- function a90_0x4ee8(){var _0x435e51=['4801656TgknCl','linkedPaths','dir','skillName','treeHash','appCode','4CdLrNM','2150wiVzgB','tags','version','91323LvPcRw','skillCode','readonly','720328GxmfJZ','74459PaHHCv','4549980SNURvg','pulledAt','cacheDir','104uqiifQ','2441037XkPWil','105319tiXLAM','scope','metadataPath'];a90_0x4ee8=function(){return _0x435e51;};return a90_0x4ee8();}function a90_0x3573(_0xa8e981,_0x198282){_0xa8e981=_0xa8e981-0x6a;var _0x4ee82b=a90_0x4ee8();var _0x3573dc=_0x4ee82b[_0xa8e981];return _0x3573dc;}(function(_0x22d548,_0x3e2efd){var _0x1247ff=a90_0x3573,_0x3b2718=_0x22d548();while(!![]){try{var _0x503138=-parseInt(_0x1247ff(0x6d))/0x1+parseInt(_0x1247ff(0x7d))/0x2+parseInt(_0x1247ff(0x6c))/0x3*(parseInt(_0x1247ff(0x76))/0x4)+parseInt(_0x1247ff(0x7f))/0x5+parseInt(_0x1247ff(0x70))/0x6+parseInt(_0x1247ff(0x7e))/0x7*(-parseInt(_0x1247ff(0x6b))/0x8)+parseInt(_0x1247ff(0x7a))/0x9*(-parseInt(_0x1247ff(0x77))/0xa);if(_0x503138===_0x3e2efd)break;else _0x3b2718['push'](_0x3b2718['shift']());}catch(_0x37c365){_0x3b2718['push'](_0x3b2718['shift']());}}}(a90_0x4ee8,0x7009e));export function summarizeRuntimeSkill(_0x363cc5){var _0x22b468=a90_0x3573;return{'id':_0x363cc5['id'],'skillCode':_0x363cc5['skillCode'],'skillName':_0x363cc5[_0x22b468(0x73)],'scope':_0x363cc5[_0x22b468(0x6e)],'version':_0x363cc5['version'],'readonly':_0x363cc5[_0x22b468(0x7c)]};}export function summarizeLocalRuntimeSkill(_0x19e9a5){var _0x32cde6=a90_0x3573;return{'id':_0x19e9a5['id'],'skillCode':_0x19e9a5[_0x32cde6(0x7b)],'skillName':_0x19e9a5[_0x32cde6(0x73)],'scope':_0x19e9a5[_0x32cde6(0x6e)],'appCode':_0x19e9a5[_0x32cde6(0x75)],'version':_0x19e9a5[_0x32cde6(0x79)],'status':_0x19e9a5['status'],'readonly':_0x19e9a5[_0x32cde6(0x7c)],'tags':_0x19e9a5[_0x32cde6(0x78)],'dir':_0x19e9a5[_0x32cde6(0x72)],'cacheDir':_0x19e9a5[_0x32cde6(0x6a)],'skillMdPath':_0x19e9a5['skillMdPath'],'metadataPath':_0x19e9a5[_0x32cde6(0x6f)],'linkedPaths':_0x19e9a5[_0x32cde6(0x71)],'contentHash':_0x19e9a5['contentHash'],'treeHash':_0x19e9a5[_0x32cde6(0x74)],'pulledAt':_0x19e9a5[_0x32cde6(0x80)]};}
1
+ export function summarizeRuntimeSkill(item){return{id:item.id,skillCode:item.skillCode,skillName:item.skillName,scope:item.scope,version:item.version,readonly:item.readonly}}export function summarizeLocalRuntimeSkill(item){return{id:item.id,skillCode:item.skillCode,skillName:item.skillName,scope:item.scope,appCode:item.appCode,version:item.version,status:item.status,readonly:item.readonly,tags:item.tags,dir:item.dir,cacheDir:item.cacheDir,skillMdPath:item.skillMdPath,metadataPath:item.metadataPath,linkedPaths:item.linkedPaths,contentHash:item.contentHash,treeHash:item.treeHash,pulledAt:item.pulledAt}}
@@ -1 +1,8 @@
1
- function a91_0x5ab0(_0x3c4d5c,_0x1a8360){_0x3c4d5c=_0x3c4d5c-0x116;const _0x131c97=a91_0x131c();let _0x5ab03f=_0x131c97[_0x3c4d5c];return _0x5ab03f;}const a91_0x16aa43=a91_0x5ab0;(function(_0x27a0cb,_0x3c7e1b){const _0x2b4c98=a91_0x5ab0,_0x2273cb=_0x27a0cb();while(!![]){try{const _0x53879d=-parseInt(_0x2b4c98(0x11d))/0x1*(-parseInt(_0x2b4c98(0x132))/0x2)+-parseInt(_0x2b4c98(0x121))/0x3+-parseInt(_0x2b4c98(0x119))/0x4*(-parseInt(_0x2b4c98(0x12f))/0x5)+parseInt(_0x2b4c98(0x138))/0x6+parseInt(_0x2b4c98(0x12d))/0x7*(-parseInt(_0x2b4c98(0x11e))/0x8)+parseInt(_0x2b4c98(0x13e))/0x9+-parseInt(_0x2b4c98(0x120))/0xa;if(_0x53879d===_0x3c7e1b)break;else _0x2273cb['push'](_0x2273cb['shift']());}catch(_0x36292e){_0x2273cb['push'](_0x2273cb['shift']());}}}(a91_0x131c,0x8a6a1));import{CliErrors}from'../../errors.js';function a91_0x131c(){const _0x39b016=['5biDtbT','Invalid\x20Skill\x20name:\x20','SKILL.md','814MVfDPm','.agents/skills','references/runtime-contract.md','##\x20业务状态流转\x0a\x0a【填写本\x20Skill\x20的前置业务状态、允许动作、目标业务状态、fromStatus\x20->\x20toStatus\x20预览、写入后读回核对,以及\x20unknown\x20/\x20needs_manual_check\x20处理。状态迁移合法性必须由业务\x20Backend\x20Function、Lovrabet\x20平台命令或服务端接口判断,Skill\x20不作为状态事实源。】','#\x20Output\x20Contract\x0a\x0a','validation','6273108OVWGOe','Use\x20lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens,\x20for\x20example\x20invoice-export.','includes','Unsupported\x20Skill\x20type:\x20','write\x20类型在\x20dry_run\x20下只展示预览、影响范围和差异,不写入业务数据。\x0aconfirmed\x20写入后必须执行读回核对,并把核对结果写入\x20verification。\x0a读回异常、业务状态未知或结果不一致时,status\x20必须为\x20partial_success、failed\x20或\x20needs_manual_check。','test','5861079JmlUFc','\x20的最终回复必须让运营人员能判断:是否执行、影响了什么、如何复核、失败后下一步做什么。\x0a\x0a##\x20状态枚举\x0a\x0astatus:\x20success\x20|\x20no_op\x20|\x20partial_success\x20|\x20blocked\x20|\x20failed\x20|\x20needs_manual_check\x0a\x0a-\x20success:动作已完成,且关键结果已核对。\x0a-\x20no_op:没有符合条件的对象或无需变更。\x0a-\x20partial_success:部分对象完成,未完成对象必须进入\x20errors\x20和\x20nextActions。\x0a-\x20blocked:缺少输入、权限、确认或平台能力,无法继续。\x0a-\x20failed:执行失败,必须说明失败阶段、错误和恢复方式。\x0a-\x20needs_manual_check:读回异常、状态未知或人工判断缺失。\x0a\x0aunknown、partial_success、failed、needs_manual_check\x20不能包装为\x20success。\x0a\x0a##\x20输出模式\x0a\x0amode:\x20dry_run\x20|\x20confirmed\x20|\x20read_only\x0a\x0a-\x20dry_run:只展示预览、影响范围和差异,不写入业务数据。\x0a-\x20confirmed:用户明确确认后的执行模式;写入后必须读回核对。\x0a-\x20read_only:只查询、汇总或核对,不触发写入。\x0a\x0a##\x20必填字段\x0a\x0a-\x20status\x0a-\x20mode\x0a-\x20summary\x0a-\x20scope\x0a-\x20changes\x0a-\x20verification\x0a-\x20warnings\x0a-\x20errors\x0a-\x20nextActions\x0a\x0a##\x20写入结果\x0a\x0a','1.\x20dry-run:【填写预览入口、影响范围和差异摘要;不得写入业务数据】\x0a2.\x20用户确认:【填写确认语义、目标对象、数量、风险和操作者责任】\x0a3.\x20confirmed\x20写入:【填写确认后的写入入口和幂等/防重复要求】\x0a4.\x20只读核对:【填写写入后的查询核对、差异展示和结果链接】\x0a5.\x20checkpoint:【填写失败恢复、重试条件和人工接管方式】','\x0a#\x20displayName:\x20\x22<填写符合用户实际诉求的人类可读展示名>\x22\x0adescription:\x20\x22【填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词】\x22\x0a#\x20example:\x20\x22<填写一句用户可以直接说出的最简触发话术>\x22\x0ametadata:\x0a\x20\x20type:\x20','\x0a##\x20返回契约\x0a\x0a最终输出必须遵守\x20[output-contract.md](output-contract.md)。本文件只补充运行态安全约束;展示字段、状态枚举、失败暴露和人工处理项以\x20output-contract.md\x20为准。\x0a\x0a##\x20失败恢复\x0a\x0a【填写失败状态识别、checkpoint、重试和人工接管方式】\x0a\x0a##\x20禁止事项\x0a\x0a-\x20禁止链接或读取\x20Skill\x20目录外的\x20AGENTS.md、wiki、docs、脚本或个人路径作为运行时必读依赖。\x0a-\x20禁止把说明性的缓存路径、安装路径、示例路径或排障路径包装成运行时必读依赖。\x0a-\x20禁止在未确认影响范围时执行写入。\x0a-\x20禁止隐藏失败或把未知状态描述为成功。\x0a','4248260rFlgHj','\x20只作为模板选择器,不替代业务权限、风险等级和用户确认。\x0a\x0a##\x20运行态入口\x0a\x0a【填写包内说明的运行态入口、可调用脚本或人工执行边界】\x0a\x0a##\x20凭证与登录态\x0a\x0a【填写本\x20Skill\x20依赖的第三方服务凭证和登录态治理方式。强烈建议通过\x20Lovrabet\x20应用后台或平台服务端适配器做平台托管配置;开发先行阶段如存在临时明文凭证,应标注后续治理计划、适用环境和额度边界,并避免进入长期交付内容。】\x0a\x0a##\x20第三方候选资产\x0a\x0a【填写第三方生成类结果的消费边界。生成类结果仅作为候选素材;涉及商品图、客户资料、Excel\x20或业务文件上传时,必须声明授权、额度、审计、失败降级和人工审核/业务\x20Backend\x20Function\x20校验后的发布边界。】\x0a\x0a##\x20预览\x20/\x20写入\x20/\x20核对差异\x0a\x0a【填写预览、确认、正式执行和只读核对的顺序】\x0a\x0a','references/output-contract.md','trim','97ZVnQBf','3924808JLwZmN','timestamp','8970250YgKGJe','2531166CCgokc','.\x20Use\x20lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens.','\x0a\x0a##\x20内部要求\x0a\x0a执行前必须读取并遵守\x20[runtime-contract.md](references/runtime-contract.md)\x20和\x20[output-contract.md](references/output-contract.md)。\x0a\x0a##\x20使用边界\x0a\x0a【填写该\x20Skill\x20能做什么、不能做什么、适用业务范围和禁止扩大执行范围】\x0a\x0a##\x20输入门禁\x0a\x0a【填写必须具备的输入;缺失业务对象、执行范围、确认信息或权限上下文时必须停止】\x0a\x0a##\x20与现有能力集成\x0a\x0a【填写本\x20Skill\x20使用的\x20lovrabet\x20data、lovrabet\x20sql、lovrabet\x20bff\x20或\x20lovrabet\x20personal-bff\x20命令,以及包内\x20references/\x20中沉淀的运行态入口、脚本对接方式或人工操作边界。不得依赖\x20Skill\x20目录外文件、绝对路径或本机专属配置。】\x0a\x0a##\x20平台能力优先\x0a\x0a【填写本\x20Skill\x20优先使用的\x20Lovrabet\x20平台命令:lovrabet\x20data\x20/\x20lovrabet\x20sql\x20/\x20lovrabet\x20bff\x20/\x20lovrabet\x20personal-bff。本地脚本仅用于平台明确不覆盖的文件格式转换、静态校验、展示整理或第三方薄适配;不得用本地脚本替代平台命令承载业务写入、权限判断、状态机、审批提交或回滚。】\x0a\x0a##\x20第三方服务边界\x0a\x0a【填写是否调用第三方识别、生成、上传或行业服务;如涉及\x20API\x20Key、OAuth、Cookie、登录态或业务数据上传,必须说明由\x20Lovrabet\x20应用后台、Backend\x20Function\x20或平台适配器统一配置。目标治理口径是\x20Skill\x20不读取、不分发、不保存明文凭证。详细凭证、额度、审计和审核发布规则写入\x20references/runtime-contract.md。】\x0a\x0a##\x20SOP\x20工作流\x0a\x0a','\x0a\x0a##\x20展示规范\x0a\x0a【填写面向运营人员的展示字段、差异摘要、成功/失败状态和人工处理项;最终输出必须按\x20references/output-contract.md\x20的\x20status\x20/\x20mode\x20/\x20summary\x20/\x20errors\x20/\x20nextActions\x20返回,不能把\x20unknown、partial_success、failed\x20或\x20needs_manual_check\x20包装为\x20success。】\x0a\x0a##\x20失败恢复\x0a\x0a【填写失败后的\x20checkpoint、重试条件、人工接管方式和避免重复写入的核对步骤】\x0a','read','write','skillName','Use\x20one\x20of:\x20','#\x20Runtime\x20Contract\x0a\x0aSkill\x20push\x20后的\x20zip\x20包就是完整交付产物。','type','---\x0aname:\x20','\x0a\x0a##\x20错误与人工接管\x0a\x0aerrors\x20必须包含失败阶段、错误原因和可复核对象。\x0anextActions\x20必须给出重试、补充输入、人工接管或停止处理的动作。\x0a','7txBTMI','join'];a91_0x131c=function(){return _0x39b016;};return a91_0x131c();}export const SKILL_TYPES=['write',a91_0x16aa43(0x125)];export const DEFAULT_SKILL_TARGET=a91_0x16aa43(0x133);export const SKILL_NAME_PATTERN=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;export const RUNTIME_CONTRACT_FILE=a91_0x16aa43(0x134);export const OUTPUT_CONTRACT_FILE=a91_0x16aa43(0x11b);export function validateSkillName(_0x4dd23e){const _0x2791cb=a91_0x16aa43,_0x4775e1=_0x4dd23e[_0x2791cb(0x11c)]();if(!SKILL_NAME_PATTERN[_0x2791cb(0x13d)](_0x4775e1))throw CliErrors[_0x2791cb(0x137)](_0x2791cb(0x130)+_0x4dd23e+_0x2791cb(0x122),_0x2791cb(0x139));return _0x4775e1;}export function normalizeSkillTemplateType(_0x2b0cd9){const _0x2f7a6a=a91_0x16aa43,_0x1aa6eb=(_0x2b0cd9||'write')[_0x2f7a6a(0x11c)]()||_0x2f7a6a(0x126);if(SKILL_TYPES[_0x2f7a6a(0x13a)](_0x1aa6eb))return _0x1aa6eb;throw CliErrors[_0x2f7a6a(0x137)](_0x2f7a6a(0x13b)+_0x2b0cd9,_0x2f7a6a(0x128)+SKILL_TYPES[_0x2f7a6a(0x12e)](',\x20')+'.');}export function renderSkillTemplate(_0x25780a){const _0x400026=a91_0x16aa43,_0x189d7b=validateSkillName(_0x25780a[_0x400026(0x127)]),_0x1d9a23=normalizeSkillTemplateType(_0x25780a[_0x400026(0x12a)]),_0xa3cfc4=_0x25780a[_0x400026(0x11f)]??new Date()['toISOString']();return{'skillName':_0x189d7b,'type':_0x1d9a23,'files':[{'path':_0x400026(0x131),'content':renderSkillMd(_0x189d7b,_0x1d9a23,_0xa3cfc4)},{'path':RUNTIME_CONTRACT_FILE,'content':renderRuntimeContract(_0x189d7b,_0x1d9a23)},{'path':OUTPUT_CONTRACT_FILE,'content':renderOutputContract(_0x189d7b,_0x1d9a23)}]};}function renderSkillMd(_0x586fa4,_0x12e7bf,_0x56c36f){const _0x228b68=a91_0x16aa43,_0x2c7289=typeWorkflow(_0x12e7bf);return _0x228b68(0x12b)+_0x586fa4+_0x228b68(0x117)+_0x12e7bf+'\x0a\x20\x20created:\x20\x22'+_0x56c36f+'\x22\x0a\x20\x20generator:\x20\x22lovrabet\x20skill\x20create\x22\x0a---\x0a\x0a#\x20'+_0x586fa4+_0x228b68(0x123)+_0x2c7289+'\x0a\x0a'+businessStateSection(_0x12e7bf)+_0x228b68(0x124);}function renderRuntimeContract(_0x156c20,_0xed0eaf){const _0x1767f2=a91_0x16aa43,_0x2d8a84=_0xed0eaf==='write'?'##\x20状态读回与未知状态处理\x0a\x0a【填写业务状态事实源、fromStatus\x20->\x20toStatus\x20预览、写入后读回核对方式,以及\x20unknown\x20/\x20needs_manual_check\x20的处理边界】\x0a\x0a':'';return _0x1767f2(0x129)+_0x156c20+'\x20的所有必读规则必须位于\x20SKILL.md\x20或\x20references/\x20内。\x0a\x0a##\x20必读文档\x0a\x0a-\x20[SKILL.md](../SKILL.md)\x0a-\x20[runtime-contract.md](runtime-contract.md)\x0a-\x20[output-contract.md](output-contract.md)\x0a\x0a##\x20主边界\x0a\x0a-\x20不得依赖\x20Skill\x20目录外的仓库文件、绝对路径、file\x20URL\x20或本机专属配置。\x0a-\x20文档中的缓存路径、安装路径、示例路径或排障路径不等于运行时包外依赖;只有明确要求读取、链接或执行包外内容时才属于自包含风险。\x0a-\x20如需承接仓库规范,必须把必要规则内化到本\x20Skill\x20包内的\x20references/\x20文件中。\x0a-\x20type='+_0xed0eaf+_0x1767f2(0x11a)+_0x2d8a84+_0x1767f2(0x118);}function renderOutputContract(_0x242e8e,_0x329335){const _0x106cee=a91_0x16aa43,_0x1ee741=_0x329335===_0x106cee(0x126)?_0x106cee(0x13c):_0x329335+'\x20类型默认不执行业务写入;如流程包含受控维护或人工确认,也必须用\x20mode\x20标明执行阶段并暴露核对结果。';return _0x106cee(0x136)+_0x242e8e+_0x106cee(0x13f)+_0x1ee741+_0x106cee(0x12c);}function typeWorkflow(_0x5d199b){const _0x349283=a91_0x16aa43;if(_0x5d199b==='read')return'1.\x20只读查询:【填写查询入口、过滤条件和权限边界】\x0a2.\x20业务汇总:【填写统计口径、字段解释和异常提示】\x0a3.\x20查看链接:【填写可供运营人员复核的记录、页面或报告链接】\x0a4.\x20禁止写入:不得创建、更新、删除或触发会改变业务状态的动作。';return _0x349283(0x116);}function businessStateSection(_0x3d82d9){const _0x53e248=a91_0x16aa43;if(_0x3d82d9!==_0x53e248(0x126))return'';return _0x53e248(0x135);}
1
+ import{CliErrors}from"../../errors.js";export const SKILL_TYPES=["write","read"];export const DEFAULT_SKILL_TARGET=".agents/skills";export const SKILL_NAME_PATTERN=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;export const RUNTIME_CONTRACT_FILE="references/runtime-contract.md";export const OUTPUT_CONTRACT_FILE="references/output-contract.md";export function validateSkillName(name){const normalized=name.trim();if(!SKILL_NAME_PATTERN.test(normalized)){throw CliErrors.validation(`Invalid Skill name: ${name}. Use lowercase letters, numbers, and single hyphens.`,"Use lowercase letters, numbers, and single hyphens, for example invoice-export.")}return normalized}export function normalizeSkillTemplateType(type){const normalized=(type||"write").trim()||"write";if(SKILL_TYPES.includes(normalized)){return normalized}throw CliErrors.validation(`Unsupported Skill type: ${type}`,`Use one of: ${SKILL_TYPES.join(", ")}.`)}export function renderSkillTemplate(options){
2
+ const skillName=validateSkillName(options.skillName);const type=normalizeSkillTemplateType(options.type);const timestamp=options.timestamp??(new Date).toISOString();return{skillName:skillName,type:type,files:[{path:"SKILL.md",content:renderSkillMd(skillName,type,timestamp)},{path:RUNTIME_CONTRACT_FILE,content:renderRuntimeContract(skillName,type)},{path:OUTPUT_CONTRACT_FILE,content:renderOutputContract(skillName,type)}]}}function renderSkillMd(skillName,type,timestamp){const workflow=typeWorkflow(type)
3
+ ;return`---\nname: ${skillName}\n# displayName: "<填写符合用户实际诉求的人类可读展示名>"\ndescription: "【填写模型触发语义:用户在什么场景应使用本 Skill、不要使用的边界和关键词】"\n# example: "<填写一句用户可以直接说出的最简触发话术>"\nmetadata:\n type: ${type}\n created: "${timestamp}"\n generator: "lovrabet skill create"\n---\n\n# ${skillName}\n\n## 内部要求\n\n执行前必须读取并遵守 [runtime-contract.md](references/runtime-contract.md) 和 [output-contract.md](references/output-contract.md)。\n\n## 使用边界\n\n【填写该 Skill 能做什么、不能做什么、适用业务范围和禁止扩大执行范围】\n\n## 输入门禁\n\n【填写必须具备的输入;缺失业务对象、执行范围、确认信息或权限上下文时必须停止】\n\n## 与现有能力集成\n\n【填写本 Skill 使用的 lovrabet data、lovrabet sql、lovrabet bff 或 lovrabet personal-bff 命令,以及包内 references/ 中沉淀的运行态入口、脚本对接方式或人工操作边界。不得依赖 Skill 目录外文件、绝对路径或本机专属配置。】\n\n## 平台能力优先\n\n【填写本 Skill 优先使用的 Lovrabet 平台命令:lovrabet data / lovrabet sql / lovrabet bff / lovrabet personal-bff。本地脚本仅用于平台明确不覆盖的文件格式转换、静态校验、展示整理或第三方薄适配;不得用本地脚本替代平台命令承载业务写入、权限判断、状态机、审批提交或回滚。】\n\n## 第三方服务边界\n\n【填写是否调用第三方识别、生成、上传或行业服务;如涉及 API Key、OAuth、Cookie、登录态或业务数据上传,必须说明由 Lovrabet 应用后台、Backend Function 或平台适配器统一配置。目标治理口径是 Skill 不读取、不分发、不保存明文凭证。详细凭证、额度、审计和审核发布规则写入 references/runtime-contract.md。】\n\n## SOP 工作流\n\n${workflow}\n\n${businessStateSection(type)}\n\n## 展示规范\n\n【填写面向运营人员的展示字段、差异摘要、成功/失败状态和人工处理项;最终输出必须按 references/output-contract.md 的 status / mode / summary / errors / nextActions 返回,不能把 unknown、partial_success、failed 或 needs_manual_check 包装为 success。】\n\n## 失败恢复\n\n【填写失败后的 checkpoint、重试条件、人工接管方式和避免重复写入的核对步骤】\n`
4
+ }function renderRuntimeContract(skillName,type){const stateReadback=type==="write"?`## 状态读回与未知状态处理\n\n【填写业务状态事实源、fromStatus -> toStatus 预览、写入后读回核对方式,以及 unknown / needs_manual_check 的处理边界】\n\n`:""
5
+ ;return`# Runtime Contract\n\nSkill push 后的 zip 包就是完整交付产物。${skillName} 的所有必读规则必须位于 SKILL.md 或 references/ 内。\n\n## 必读文档\n\n- [SKILL.md](../SKILL.md)\n- [runtime-contract.md](runtime-contract.md)\n- [output-contract.md](output-contract.md)\n\n## 主边界\n\n- 不得依赖 Skill 目录外的仓库文件、绝对路径、file URL 或本机专属配置。\n- 文档中的缓存路径、安装路径、示例路径或排障路径不等于运行时包外依赖;只有明确要求读取、链接或执行包外内容时才属于自包含风险。\n- 如需承接仓库规范,必须把必要规则内化到本 Skill 包内的 references/ 文件中。\n- type=${type} 只作为模板选择器,不替代业务权限、风险等级和用户确认。\n\n## 运行态入口\n\n【填写包内说明的运行态入口、可调用脚本或人工执行边界】\n\n## 凭证与登录态\n\n【填写本 Skill 依赖的第三方服务凭证和登录态治理方式。强烈建议通过 Lovrabet 应用后台或平台服务端适配器做平台托管配置;开发先行阶段如存在临时明文凭证,应标注后续治理计划、适用环境和额度边界,并避免进入长期交付内容。】\n\n## 第三方候选资产\n\n【填写第三方生成类结果的消费边界。生成类结果仅作为候选素材;涉及商品图、客户资料、Excel 或业务文件上传时,必须声明授权、额度、审计、失败降级和人工审核/业务 Backend Function 校验后的发布边界。】\n\n## 预览 / 写入 / 核对差异\n\n【填写预览、确认、正式执行和只读核对的顺序】\n\n${stateReadback}\n## 返回契约\n\n最终输出必须遵守 [output-contract.md](output-contract.md)。本文件只补充运行态安全约束;展示字段、状态枚举、失败暴露和人工处理项以 output-contract.md 为准。\n\n## 失败恢复\n\n【填写失败状态识别、checkpoint、重试和人工接管方式】\n\n## 禁止事项\n\n- 禁止链接或读取 Skill 目录外的 AGENTS.md、wiki、docs、脚本或个人路径作为运行时必读依赖。\n- 禁止把说明性的缓存路径、安装路径、示例路径或排障路径包装成运行时必读依赖。\n- 禁止在未确认影响范围时执行写入。\n- 禁止隐藏失败或把未知状态描述为成功。\n`
6
+ }function renderOutputContract(skillName,type){const writeSpecific=type==="write"?`write 类型在 dry_run 下只展示预览、影响范围和差异,不写入业务数据。\nconfirmed 写入后必须执行读回核对,并把核对结果写入 verification。\n读回异常、业务状态未知或结果不一致时,status 必须为 partial_success、failed 或 needs_manual_check。`:`${type} 类型默认不执行业务写入;如流程包含受控维护或人工确认,也必须用 mode 标明执行阶段并暴露核对结果。`
7
+ ;return`# Output Contract\n\n${skillName} 的最终回复必须让运营人员能判断:是否执行、影响了什么、如何复核、失败后下一步做什么。\n\n## 状态枚举\n\nstatus: success | no_op | partial_success | blocked | failed | needs_manual_check\n\n- success:动作已完成,且关键结果已核对。\n- no_op:没有符合条件的对象或无需变更。\n- partial_success:部分对象完成,未完成对象必须进入 errors 和 nextActions。\n- blocked:缺少输入、权限、确认或平台能力,无法继续。\n- failed:执行失败,必须说明失败阶段、错误和恢复方式。\n- needs_manual_check:读回异常、状态未知或人工判断缺失。\n\nunknown、partial_success、failed、needs_manual_check 不能包装为 success。\n\n## 输出模式\n\nmode: dry_run | confirmed | read_only\n\n- dry_run:只展示预览、影响范围和差异,不写入业务数据。\n- confirmed:用户明确确认后的执行模式;写入后必须读回核对。\n- read_only:只查询、汇总或核对,不触发写入。\n\n## 必填字段\n\n- status\n- mode\n- summary\n- scope\n- changes\n- verification\n- warnings\n- errors\n- nextActions\n\n## 写入结果\n\n${writeSpecific}\n\n## 错误与人工接管\n\nerrors 必须包含失败阶段、错误原因和可复核对象。\nnextActions 必须给出重试、补充输入、人工接管或停止处理的动作。\n`}function typeWorkflow(type){if(type==="read"){
8
+ return`1. 只读查询:【填写查询入口、过滤条件和权限边界】\n2. 业务汇总:【填写统计口径、字段解释和异常提示】\n3. 查看链接:【填写可供运营人员复核的记录、页面或报告链接】\n4. 禁止写入:不得创建、更新、删除或触发会改变业务状态的动作。`}return`1. dry-run:【填写预览入口、影响范围和差异摘要;不得写入业务数据】\n2. 用户确认:【填写确认语义、目标对象、数量、风险和操作者责任】\n3. confirmed 写入:【填写确认后的写入入口和幂等/防重复要求】\n4. 只读核对:【填写写入后的查询核对、差异展示和结果链接】\n5. checkpoint:【填写失败恢复、重试条件和人工接管方式】`}function businessStateSection(type){if(type!=="write")return"";return`## 业务状态流转\n\n【填写本 Skill 的前置业务状态、允许动作、目标业务状态、fromStatus -> toStatus 预览、写入后读回核对,以及 unknown / needs_manual_check 处理。状态迁移合法性必须由业务 Backend Function、Lovrabet 平台命令或服务端接口判断,Skill 不作为状态事实源。】`}
@@ -1 +1,8 @@
1
- const a92_0x28873f=a92_0x4049;(function(_0x3b65ac,_0x3f2485){const _0x3a6065=a92_0x4049,_0xdc097b=_0x3b65ac();while(!![]){try{const _0x50035b=-parseInt(_0x3a6065(0xb2))/0x1*(parseInt(_0x3a6065(0xbc))/0x2)+parseInt(_0x3a6065(0xa9))/0x3*(-parseInt(_0x3a6065(0xd4))/0x4)+-parseInt(_0x3a6065(0xd7))/0x5+-parseInt(_0x3a6065(0x89))/0x6*(-parseInt(_0x3a6065(0xa3))/0x7)+-parseInt(_0x3a6065(0xcf))/0x8*(-parseInt(_0x3a6065(0xbd))/0x9)+-parseInt(_0x3a6065(0xb5))/0xa+-parseInt(_0x3a6065(0x88))/0xb*(-parseInt(_0x3a6065(0xe5))/0xc);if(_0x50035b===_0x3f2485)break;else _0xdc097b['push'](_0xdc097b['shift']());}catch(_0x3d6f9a){_0xdc097b['push'](_0xdc097b['shift']());}}}(a92_0x5830,0x6da94));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{resolve}from'node:path';import{parse as a92_0xf745e1}from'yaml';function a92_0x4049(_0x1b0273,_0x15f906){_0x1b0273=_0x1b0273-0x86;const _0x583070=a92_0x5830();let _0x404973=_0x583070[_0x1b0273];return _0x404973;}import{CliErrors}from'../../errors.js';import{fileText,scanSkillDirectory}from'../../skills/runtime-skill-sync/local-files.js';const SKILL_FILE=a92_0x28873f(0xd9),SUPPORTED_SKILL_TYPES=new Set([a92_0x28873f(0xc2),a92_0x28873f(0xac)]),TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;export function validateSkillDirectory(_0x5681bf,_0x2aa046={}){const _0x35d97e=a92_0x28873f,_0x56e6bf=resolveSkillDirectoryRoot(_0x5681bf),_0xc78fde=[],_0x4fbd6b=loadRequiredSkillFile(_0x56e6bf,_0xc78fde),_0x883980=_0x4fbd6b?parseFrontmatter(_0x4fbd6b[_0x35d97e(0x91)]):{'hasFrontmatter':![]};_0x4fbd6b&&validateFrontmatter(_0x4fbd6b[_0x35d97e(0xd6)],_0x883980,_0xc78fde);validateRuntimeCliReferences(_0x56e6bf,_0xc78fde);const _0x41e32a=_0xc78fde['filter'](_0x29c3df=>_0x29c3df[_0x35d97e(0xc0)]==='error'),_0x39e26e=_0xc78fde[_0x35d97e(0xe1)](_0x9c7651=>_0x9c7651[_0x35d97e(0xc0)]==='warning');return{'ok':_0x41e32a['length']===0x0,'dir':_0x56e6bf,'type':_0x883980[_0x35d97e(0x8a)],'errors':_0x41e32a,'warnings':_0x39e26e};}function resolveSkillDirectoryRoot(_0x157cdb){const _0x4c6f22=a92_0x28873f,_0x36a170=resolve(_0x157cdb);if(!existsSync(_0x36a170))throw CliErrors[_0x4c6f22(0xe6)]('Skill\x20directory\x20not\x20found:\x20'+_0x157cdb);const _0x37c1f1=lstatSync(_0x36a170);if(_0x37c1f1[_0x4c6f22(0xa0)]())return _0x36a170;if(_0x37c1f1['isSymbolicLink']()){const _0x2778c5=realpathSync(_0x36a170);if(lstatSync(_0x2778c5)[_0x4c6f22(0xa0)]())return _0x2778c5;}throw CliErrors[_0x4c6f22(0xe6)](_0x4c6f22(0xad)+_0x157cdb);}export function throwIfSkillValidationFailed(_0x250f75,_0x712ee1=![]){const _0x3c074d=a92_0x28873f;if(_0x250f75['ok'])return;const _0x3c44df=_0x250f75[_0x3c074d(0xe8)][_0x3c074d(0xb7)](_0x155b2e=>{const _0x380b9d=_0x3c074d,_0x4fa2ac=_0x155b2e[_0x380b9d(0xbb)]?'#'+_0x155b2e['section']:'';return _0x155b2e[_0x380b9d(0xc0)]['toUpperCase']()+'\x20'+_0x155b2e[_0x380b9d(0xa7)]+'\x20'+_0x155b2e[_0x380b9d(0xa8)]+_0x4fa2ac+':\x20'+_0x155b2e['message']+_0x380b9d(0xd1)+_0x155b2e[_0x380b9d(0x93)];});throw CliErrors[_0x3c074d(0xe6)](_0x3c074d(0xab)+_0x3c44df[_0x3c074d(0x87)]('\x0a'),_0x3c074d(0x8c));}function loadRequiredSkillFile(_0x1747a1,_0x10e605){const _0x3b77ad=a92_0x28873f,_0x20e0df=resolve(_0x1747a1,SKILL_FILE);if(!existsSync(_0x20e0df))return _0x10e605[_0x3b77ad(0x86)](issue('error',_0x3b77ad(0xbf),SKILL_FILE,_0x3b77ad(0xbe),'Add\x20SKILL.md\x20at\x20the\x20Skill\x20directory\x20root.')),undefined;const _0x4fd6a4=lstatSync(_0x20e0df);if(_0x4fd6a4[_0x3b77ad(0x92)]())return _0x10e605['push'](issue(_0x3b77ad(0xa2),'structure-complete',SKILL_FILE,_0x3b77ad(0x94),_0x3b77ad(0xa6))),undefined;if(!_0x4fd6a4['isFile']())return _0x10e605[_0x3b77ad(0x86)](issue(_0x3b77ad(0xa2),_0x3b77ad(0xbf),SKILL_FILE,'SKILL.md\x20is\x20not\x20a\x20file.',_0x3b77ad(0xb6))),undefined;return{'path':SKILL_FILE,'content':readFileSync(_0x20e0df,'utf8')};}function validateFrontmatter(_0x2ed2e0,_0x82488c,_0x724bf6){const _0x10877e=a92_0x28873f;if(!_0x82488c[_0x10877e(0xe7)]){_0x724bf6[_0x10877e(0x86)](issue(_0x10877e(0xa2),_0x10877e(0xa5),_0x2ed2e0,_0x10877e(0x9f),_0x10877e(0xc1)));return;}!_0x82488c[_0x10877e(0xce)]?.[_0x10877e(0xde)]()&&_0x724bf6[_0x10877e(0x86)](issue(_0x10877e(0xa2),'frontmatter-required',_0x2ed2e0,_0x10877e(0xc3),_0x10877e(0xc5))),!_0x82488c[_0x10877e(0xb9)]?.[_0x10877e(0xde)]()&&_0x724bf6[_0x10877e(0x86)](issue(_0x10877e(0x8d),_0x10877e(0xcb),_0x2ed2e0,_0x10877e(0xcd),_0x10877e(0xb0))),!_0x82488c[_0x10877e(0x9a)]?.[_0x10877e(0xde)]()&&_0x724bf6[_0x10877e(0x86)](issue(_0x10877e(0x8d),_0x10877e(0x9b),_0x2ed2e0,_0x10877e(0x8f),_0x10877e(0xd5))),!_0x82488c['description']?.[_0x10877e(0xde)]()&&_0x724bf6[_0x10877e(0x86)](issue(_0x10877e(0xa2),_0x10877e(0x98),_0x2ed2e0,_0x10877e(0x8e),_0x10877e(0xa4))),_0x82488c[_0x10877e(0x97)]===!![]&&_0x724bf6[_0x10877e(0x86)](issue('error','internal-skill',_0x2ed2e0,_0x10877e(0xb8),_0x10877e(0xd3))),_0x82488c[_0x10877e(0x8a)]?.[_0x10877e(0xde)]()&&!SUPPORTED_SKILL_TYPES[_0x10877e(0x95)](_0x82488c[_0x10877e(0x8a)])&&_0x724bf6[_0x10877e(0x86)](issue(_0x10877e(0xa2),_0x10877e(0xa5),_0x2ed2e0,_0x10877e(0xe2),_0x10877e(0xaa)));}function validateRuntimeCliReferences(_0x37c17a,_0x53b722){const _0x4bcc0f=a92_0x28873f;for(const _0x269c9d of findRabetbaseCliInvocations(_0x37c17a)){_0x53b722[_0x4bcc0f(0x86)](issue('warning',_0x4bcc0f(0xdb),_0x269c9d[_0x4bcc0f(0xa8)],_0x4bcc0f(0xca),_0x4bcc0f(0x9e),'L'+_0x269c9d[_0x4bcc0f(0xe3)]));}}function findRabetbaseCliInvocations(_0x1cd550){const _0x80f8ff=a92_0x28873f;return scanSkillDirectory(_0x1cd550)['filter'](_0x4d74ef=>TEXT_SKILL_FILE_PATTERN[_0x80f8ff(0xb1)](_0x4d74ef[_0x80f8ff(0xd6)]))[_0x80f8ff(0xd0)](_0x16ef08=>{const _0x548681=_0x80f8ff,_0x416a5c=fileText(_0x16ef08);return _0x416a5c[_0x548681(0xe0)](/\r?\n/)[_0x548681(0xb7)]((_0x2d9076,_0x1aa71b)=>({'file':_0x16ef08[_0x548681(0xd6)],'line':_0x1aa71b+0x1,'text':_0x2d9076}))['filter'](({text:_0x8a95b7})=>isRabetbaseCliInvocation(_0x8a95b7))[_0x548681(0xb7)](({file:_0x5199aa,line:_0x392c38})=>({'file':_0x5199aa,'line':_0x392c38}));});}const RABETBASE_SUBCOMMANDS=[a92_0x28873f(0xc7),a92_0x28873f(0xd8),a92_0x28873f(0x9d),a92_0x28873f(0xdd),a92_0x28873f(0xc9),a92_0x28873f(0xaf),a92_0x28873f(0x99),a92_0x28873f(0xb3),a92_0x28873f(0xae),'kb',a92_0x28873f(0xcc),a92_0x28873f(0xd2),a92_0x28873f(0xda),a92_0x28873f(0xba),a92_0x28873f(0xa1),a92_0x28873f(0x9c)],RABETBASE_INVOCATION=new RegExp(String[a92_0x28873f(0x8b)]`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS[a92_0x28873f(0x87)]('|')})\b`+String[a92_0x28873f(0x8b)]`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,'i');function isRabetbaseCliInvocation(_0x4de787){const _0x560189=a92_0x28873f,_0x3c9588=_0x4de787['search'](/\brabetbase\b/i);if(_0x3c9588<0x0)return![];const _0x155e97=_0x4de787[_0x560189(0xc4)](_0x3c9588)[_0x560189(0xe0)](/\blovrabet\b/i)[0x0]??'';return RABETBASE_INVOCATION['test'](_0x155e97);}function parseFrontmatter(_0x262542){const _0x550e91=a92_0x28873f,_0x250453=_0x262542[_0x550e91(0xe4)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x250453)return{'hasFrontmatter':![]};const _0x34add3=_0x250453[0x1]??'',_0x307de3={'hasFrontmatter':!![]};let _0x4700c6;try{_0x4700c6=a92_0xf745e1(_0x34add3);}catch{return _0x307de3;}const _0x2f5238=asRecord(_0x4700c6);if(!_0x2f5238)return _0x307de3;_0x307de3[_0x550e91(0xce)]=scalarToString(_0x2f5238[_0x550e91(0xce)]),_0x307de3['displayName']=scalarToString(_0x2f5238[_0x550e91(0xb9)]),_0x307de3[_0x550e91(0xb4)]=scalarToString(_0x2f5238[_0x550e91(0xb4)]),_0x307de3['example']=scalarToString(_0x2f5238[_0x550e91(0x9a)]);const _0x5e966e=asRecord(_0x2f5238['metadata']);return _0x5e966e&&(_0x307de3[_0x550e91(0x8a)]=scalarToString(_0x5e966e[_0x550e91(0x8a)]),_0x307de3[_0x550e91(0x97)]=scalarToBoolean(_0x5e966e['internal'])),_0x307de3;}function asRecord(_0x2a3dcb){const _0x6d0e82=a92_0x28873f;if(_0x2a3dcb&&typeof _0x2a3dcb===_0x6d0e82(0x90)&&!Array[_0x6d0e82(0x96)](_0x2a3dcb))return _0x2a3dcb;return undefined;}function scalarToString(_0x3c866a){const _0x791acf=a92_0x28873f;if(typeof _0x3c866a===_0x791acf(0xdc))return _0x3c866a[_0x791acf(0xde)]();if(typeof _0x3c866a==='number'||typeof _0x3c866a==='boolean')return String(_0x3c866a);return undefined;}function scalarToBoolean(_0x35e507){const _0x26471f=a92_0x28873f;if(typeof _0x35e507==='boolean')return _0x35e507;if(typeof _0x35e507===_0x26471f(0xdc))return cleanBoolean(_0x35e507);return undefined;}function cleanBoolean(_0x2f0278){const _0x3a6eb6=a92_0x28873f,_0x355931=_0x2f0278[_0x3a6eb6(0xde)]()[_0x3a6eb6(0xdf)]();if(_0x355931===_0x3a6eb6(0xc8))return!![];if(_0x355931===_0x3a6eb6(0xc6))return![];return undefined;}function issue(_0x5d7817,_0x1a2306,_0x1b9c9c,_0xa43889,_0x3f734b,_0x412ccc){return{'level':_0x5d7817,'ruleId':_0x1a2306,'file':_0x1b9c9c,'section':_0x412ccc,'message':_0xa43889,'suggestion':_0x3f734b};}function a92_0x5830(){const _0x16f2c2=['11642cMFZpr','service','description','3458860EQxcif','Add\x20SKILL.md\x20as\x20a\x20regular\x20file\x20at\x20the\x20Skill\x20directory\x20root.','map','metadata.internal=true\x20Skills\x20cannot\x20be\x20uploaded.','displayName','auth','section','54AwEPPL','9gwdXIZ','Missing\x20SKILL.md.','structure-complete','level','Add\x20frontmatter\x20with\x20name\x20and\x20description.','write','Frontmatter\x20name\x20is\x20missing.','slice','Set\x20name\x20to\x20the\x20Skill\x20directory\x20code.','false','dataset','true','project','This\x20line\x20invokes\x20the\x20rabetbase\x20CLI.\x20rabetbase\x20is\x20a\x20dev-time\x20tool;\x20runtime\x20Skills\x20should\x20drive\x20runtime\x20work\x20through\x20lovrabet\x20commands.','display-name-recommended','config','Frontmatter\x20displayName\x20is\x20missing.','name','920488GBtyfq','flatMap','\x20Fix:\x20','workspace','Remove\x20metadata.internal\x20or\x20set\x20it\x20to\x20false\x20before\x20running\x20skill\x20push.','1132988sBwlYo','Set\x20example\x20to\x20one\x20short\x20user\x20message\x20that\x20can\x20directly\x20trigger\x20this\x20Skill.','path','1377505jNZJmy','sql','SKILL.md','data','rabetbase-cli-reference','string','page','trim','toLowerCase','split','filter','metadata.type\x20must\x20be\x20one\x20of\x20write\x20or\x20read.','line','match','15466524liVFjm','validation','hasFrontmatter','errors','push','join','11ojIWdn','3284694zDYTuf','type','raw','Fix\x20the\x20Skill\x20metadata\x20before\x20running\x20skill\x20push.','warning','Frontmatter\x20description\x20is\x20empty.','Frontmatter\x20example\x20is\x20missing.','object','content','isSymbolicLink','suggestion','SKILL.md\x20must\x20be\x20a\x20regular\x20file.','has','isArray','internal','description-required','schema','example','example-recommended','registry','bff','If\x20this\x20is\x20a\x20runtime\x20step,\x20replace\x20it\x20with\x20the\x20equivalent\x20lovrabet\x20command.\x20Dev-time\x20discovery\x20or\x20handoff\x20notes\x20can\x20stay.','SKILL.md\x20must\x20start\x20with\x20frontmatter.','isDirectory','logs','error','7Ckbtja','Describe\x20when\x20the\x20model\x20should\x20trigger\x20this\x20Skill,\x20plus\x20out-of-scope\x20boundaries\x20and\x20keywords.','frontmatter-required','Replace\x20the\x20symlink\x20with\x20a\x20regular\x20SKILL.md\x20file\x20inside\x20the\x20Skill\x20directory.','ruleId','file','6ZaGDZr','Set\x20metadata.type\x20to\x20write\x20or\x20read.','Skill\x20validation\x20failed:\x0a','read','Skill\x20directory\x20not\x20found:\x20','artifact','app','Set\x20displayName\x20to\x20the\x20human-readable\x20Skill\x20name\x20shown\x20in\x20SkillHub.','test'];a92_0x5830=function(){return _0x16f2c2;};return a92_0x5830();}
1
+ import{existsSync,lstatSync,readFileSync,realpathSync}from"node:fs";import{resolve}from"node:path";import{parse as parseYaml}from"yaml";import{CliErrors}from"../../errors.js";import{fileText,scanSkillDirectory}from"../../skills/runtime-skill-sync/local-files.js";const SKILL_FILE="SKILL.md";const SUPPORTED_SKILL_TYPES=new Set(["write","read"]);const TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;export function validateSkillDirectory(dir,_options={}){const root=resolveSkillDirectoryRoot(dir);const issues=[];const skillFile=loadRequiredSkillFile(root,issues);const parsed=skillFile?parseFrontmatter(skillFile.content):{hasFrontmatter:false};if(skillFile){validateFrontmatter(skillFile.path,parsed,issues)}validateRuntimeCliReferences(root,issues);const errors=issues.filter(item=>item.level==="error");const warnings=issues.filter(item=>item.level==="warning");return{ok:errors.length===0,dir:root,type:parsed.type,errors:errors,warnings:warnings
2
+ }}function resolveSkillDirectoryRoot(dir){const root=resolve(dir);if(!existsSync(root)){throw CliErrors.validation(`Skill directory not found: ${dir}`)}const stat=lstatSync(root);if(stat.isDirectory()){return root}if(stat.isSymbolicLink()){const realRoot=realpathSync(root);if(lstatSync(realRoot).isDirectory()){return realRoot}}throw CliErrors.validation(`Skill directory not found: ${dir}`)}export function throwIfSkillValidationFailed(report,_strict=false){if(report.ok)return;const lines=report.errors.map(item=>{const section=item.section?`#${item.section}`:"";return`${item.level.toUpperCase()} ${item.ruleId} ${item.file}${section}: ${item.message} Fix: ${item.suggestion}`});throw CliErrors.validation(`Skill validation failed:\n${lines.join("\n")}`,"Fix the Skill metadata before running skill push.")}function loadRequiredSkillFile(root,issues){const absolutePath=resolve(root,SKILL_FILE);if(!existsSync(absolutePath)){
3
+ issues.push(issue("error","structure-complete",SKILL_FILE,"Missing SKILL.md.","Add SKILL.md at the Skill directory root."));return undefined}const stat=lstatSync(absolutePath);if(stat.isSymbolicLink()){issues.push(issue("error","structure-complete",SKILL_FILE,"SKILL.md must be a regular file.","Replace the symlink with a regular SKILL.md file inside the Skill directory."));return undefined}if(!stat.isFile()){issues.push(issue("error","structure-complete",SKILL_FILE,"SKILL.md is not a file.","Add SKILL.md as a regular file at the Skill directory root."));return undefined}return{path:SKILL_FILE,content:readFileSync(absolutePath,"utf8")}}function validateFrontmatter(file,parsed,issues){if(!parsed.hasFrontmatter){issues.push(issue("error","frontmatter-required",file,"SKILL.md must start with frontmatter.","Add frontmatter with name and description."));return}if(!parsed.name?.trim()){
4
+ issues.push(issue("error","frontmatter-required",file,"Frontmatter name is missing.","Set name to the Skill directory code."))}if(!parsed.displayName?.trim()){issues.push(issue("warning","display-name-recommended",file,"Frontmatter displayName is missing.","Set displayName to the human-readable Skill name shown in SkillHub."))}if(!parsed.example?.trim()){issues.push(issue("warning","example-recommended",file,"Frontmatter example is missing.","Set example to one short user message that can directly trigger this Skill."))}if(!parsed.description?.trim()){issues.push(issue("error","description-required",file,"Frontmatter description is empty.","Describe when the model should trigger this Skill, plus out-of-scope boundaries and keywords."))}if(parsed.internal===true){issues.push(issue("error","internal-skill",file,"metadata.internal=true Skills cannot be uploaded.","Remove metadata.internal or set it to false before running skill push."))}
5
+ if(parsed.type?.trim()&&!SUPPORTED_SKILL_TYPES.has(parsed.type)){issues.push(issue("error","frontmatter-required",file,"metadata.type must be one of write or read.","Set metadata.type to write or read."))}}function validateRuntimeCliReferences(root,issues){for(const finding of findRabetbaseCliInvocations(root)){issues.push(issue("warning","rabetbase-cli-reference",finding.file,"This line invokes the rabetbase CLI. rabetbase is a dev-time tool; runtime Skills should drive runtime work through lovrabet commands.","If this is a runtime step, replace it with the equivalent lovrabet command. Dev-time discovery or handoff notes can stay.",`L${finding.line}`))}}function findRabetbaseCliInvocations(dir){return scanSkillDirectory(dir).filter(file=>TEXT_SKILL_FILE_PATTERN.test(file.path)).flatMap(file=>{const text=fileText(file);return text.split(/\r?\n/).map((line,index)=>({file:file.path,line:index+1,text:line
6
+ })).filter(({text:text})=>isRabetbaseCliInvocation(text)).map(({file:file,line:line})=>({file:file,line:line}))})}const RABETBASE_SUBCOMMANDS=["dataset","sql","bff","page","project","app","schema","service","artifact","kb","config","workspace","data","auth","logs","registry"];const RABETBASE_INVOCATION=new RegExp(String.raw`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS.join("|")})\b`+String.raw`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,"i");function isRabetbaseCliInvocation(line){const start=line.search(/\brabetbase\b/i);if(start<0)return false;const scoped=line.slice(start).split(/\blovrabet\b/i)[0]??"";return RABETBASE_INVOCATION.test(scoped)}function parseFrontmatter(content){const match=content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!match)return{hasFrontmatter:false};const yaml=match[1]??"";const parsed={hasFrontmatter:true};let value;try{value=parseYaml(yaml)}catch{return parsed}const frontmatter=asRecord(value);if(!frontmatter)return parsed
7
+ ;parsed.name=scalarToString(frontmatter.name);parsed.displayName=scalarToString(frontmatter.displayName);parsed.description=scalarToString(frontmatter.description);parsed.example=scalarToString(frontmatter.example);const metadata=asRecord(frontmatter.metadata);if(metadata){parsed.type=scalarToString(metadata.type);parsed.internal=scalarToBoolean(metadata.internal)}return parsed}function asRecord(value){if(value&&typeof value==="object"&&!Array.isArray(value)){return value}return undefined}function scalarToString(value){if(typeof value==="string")return value.trim();if(typeof value==="number"||typeof value==="boolean")return String(value);return undefined}function scalarToBoolean(value){if(typeof value==="boolean")return value;if(typeof value==="string")return cleanBoolean(value);return undefined}function cleanBoolean(value){const cleaned=value.trim().toLowerCase();if(cleaned==="true")return true;if(cleaned==="false")return false;return undefined}
8
+ function issue(level,ruleId,file,message,suggestion,section){return{level:level,ruleId:ruleId,file:file,section:section,message:message,suggestion:suggestion}}
@@ -1 +1 @@
1
- const a93_0x2c23e9=a93_0x13fa;(function(_0xf4326c,_0x550024){const _0x5275b2=a93_0x13fa,_0x3c2a60=_0xf4326c();while(!![]){try{const _0x160299=parseInt(_0x5275b2(0x1f7))/0x1+-parseInt(_0x5275b2(0x1f3))/0x2+parseInt(_0x5275b2(0x1f4))/0x3+-parseInt(_0x5275b2(0x1f5))/0x4+-parseInt(_0x5275b2(0x1f6))/0x5+parseInt(_0x5275b2(0x1ee))/0x6+parseInt(_0x5275b2(0x1f9))/0x7*(parseInt(_0x5275b2(0x1ed))/0x8);if(_0x160299===_0x550024)break;else _0x3c2a60['push'](_0x3c2a60['shift']());}catch(_0x17dac4){_0x3c2a60['push'](_0x3c2a60['shift']());}}}(a93_0x5724,0x7d6f5));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a93_0x13fa(_0x5363c1,_0x80206b){_0x5363c1=_0x5363c1-0x1ea;const _0x5724cf=a93_0x5724();let _0x13fa72=_0x5724cf[_0x5363c1];return _0x13fa72;}function a93_0x5724(){const _0x5da7c1=['read','bool','str','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','1365934qZZUOe','2620836HTNFHV','850660Hzcrbz','612705ZdKCJK','279840FVciWg','appCode','644BrRNXV','dbId','verbose','sqlContent','26952PisfmV','411324esvdJE'];a93_0x5724=function(){return _0x5da7c1;};return a93_0x5724();}import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':'detail','description':a93_0x2c23e9(0x1f2),'risk':a93_0x2c23e9(0x1ef),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0xbeadf7){const _0x25f4fb=a93_0x2c23e9,_0x12743e=await getSqlQueryInfo(_0xbeadf7[_0x25f4fb(0x1f8)],_0xbeadf7[_0x25f4fb(0x1f1)]('sqlcode')),_0x59c489=_0xbeadf7[_0x25f4fb(0x1f0)](_0x25f4fb(0x1eb));if(_0x59c489)return{'ok':!![],'data':_0x12743e};const _0x1d5385=_0x12743e['dbId']?await getDbName(_0xbeadf7[_0x25f4fb(0x1f8)],_0x12743e[_0x25f4fb(0x1ea)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x12743e['sqlCode'],'sqlName':_0x12743e['sqlName'],'db':_0x1d5385?_0x1d5385+'\x20('+_0x12743e[_0x25f4fb(0x1ea)]+')':_0x12743e[_0x25f4fb(0x1ea)]??'','sqlContent':_0x12743e[_0x25f4fb(0x1ec)]??''}};}};
1
+ import{getSqlQueryInfo}from"../../core/api-client.js";import{getDbName}from"../../core/db-resolver.js";import{SQLCODE_FLAG,VERBOSE_FLAG}from"../../commands/common/flags.js";export const sqlDetail={service:"sql",command:"detail",description:"Get custom SQL query details by sqlCode",risk:"read",flags:[SQLCODE_FLAG,VERBOSE_FLAG],async execute(ctx){const sql=await getSqlQueryInfo(ctx.appCode,ctx.str("sqlcode"));const verbose=ctx.bool("verbose");if(verbose){return{ok:true,data:sql}}const dbName=sql.dbId?await getDbName(ctx.appCode,sql.dbId):undefined;return{ok:true,data:{sqlCode:sql.sqlCode,sqlName:sql.sqlName,db:dbName?`${dbName} (${sql.dbId})`:sql.dbId??"",sqlContent:sql.sqlContent??""}}}};
@@ -1 +1,2 @@
1
- const a94_0x1b5618=a94_0x2733;function a94_0x2733(_0x115737,_0x20446c){_0x115737=_0x115737-0x1be;const _0xaba94d=a94_0xaba9();let _0x273378=_0xaba94d[_0x115737];return _0x273378;}(function(_0x4115f8,_0x31a842){const _0x4f0dbe=a94_0x2733,_0xe6244a=_0x4115f8();while(!![]){try{const _0x2210c7=parseInt(_0x4f0dbe(0x1d6))/0x1+-parseInt(_0x4f0dbe(0x1ce))/0x2+parseInt(_0x4f0dbe(0x1d2))/0x3*(-parseInt(_0x4f0dbe(0x1d1))/0x4)+parseInt(_0x4f0dbe(0x1cc))/0x5+parseInt(_0x4f0dbe(0x1c6))/0x6*(-parseInt(_0x4f0dbe(0x1d3))/0x7)+-parseInt(_0x4f0dbe(0x1be))/0x8+parseInt(_0x4f0dbe(0x1cd))/0x9*(parseInt(_0x4f0dbe(0x1c0))/0xa);if(_0x2210c7===_0x31a842)break;else _0xe6244a['push'](_0xe6244a['shift']());}catch(_0x2e604b){_0xe6244a['push'](_0xe6244a['shift']());}}}(a94_0xaba9,0x85608));function a94_0xaba9(){const _0x27b05f=['459200BJVKWf','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','20BPbKnj','execSuccess','exec','length','SQL\x20execution\x20failed','now','30MDhgnB','sqlcode','Invalid\x20SQL\x20execution\x20response:\x20execSuccess\x20must\x20be\x20a\x20boolean.','sql','read','params','2081990HwcCXF','2742813nUPnHb','1105712kNhZfQ','execResult','isArray','2452lbdZzn','981jTWrny','801808nHbuuJ','str','Returned\x20','903827PBvRSz'];a94_0xaba9=function(){return _0x27b05f;};return a94_0xaba9();}import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';import{CliErrors}from'../../errors.js';export const sqlExec={'service':a94_0x1b5618(0x1c9),'command':a94_0x1b5618(0x1c2),'description':a94_0x1b5618(0x1bf),'risk':a94_0x1b5618(0x1ca),'flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x6d299e){const _0x49a35d=a94_0x1b5618,_0x1dae07=parseJsonParams(_0x6d299e[_0x49a35d(0x1d4)](_0x49a35d(0x1cb))),_0x7b2179=Date['now'](),_0x5aab3c=await executeSdkSql(_0x6d299e[_0x49a35d(0x1d4)](_0x49a35d(0x1c7)),_0x1dae07),_0x12b7f5=Date[_0x49a35d(0x1c5)]()-_0x7b2179;if(!_0x5aab3c||typeof _0x5aab3c!=='object'||Array['isArray'](_0x5aab3c)||typeof _0x5aab3c[_0x49a35d(0x1c1)]!=='boolean')throw CliErrors['apiError'](_0x49a35d(0x1c8));if(!_0x5aab3c[_0x49a35d(0x1c1)])return{'ok':![],'data':{'error':_0x49a35d(0x1c4),'elapsed':_0x12b7f5},'message':'SQL\x20execution\x20failed'};const _0x5951b0=Array[_0x49a35d(0x1d0)](_0x5aab3c[_0x49a35d(0x1cf)])?_0x5aab3c[_0x49a35d(0x1cf)]:[];return{'ok':!![],'data':{'rows':_0x5951b0,'rowCount':_0x5951b0[_0x49a35d(0x1c3)],'elapsed':_0x12b7f5},'message':_0x49a35d(0x1d5)+_0x5951b0[_0x49a35d(0x1c3)]+'\x20row(s)\x20in\x20'+_0x12b7f5+'ms'};}};
1
+ import{executeSdkSql}from"../../core/sdk-client.js";import{SQLCODE_FLAG,PARAMS_FLAG}from"../../commands/common/flags.js";import{parseJsonParams}from"../../utils/params.js";import{CliErrors}from"../../errors.js";export const sqlExec={service:"sql",command:"exec",description:"Execute a custom SQL query by sqlCode",risk:"read",flags:[SQLCODE_FLAG,PARAMS_FLAG],async execute(ctx){const params=parseJsonParams(ctx.str("params"));const startTime=Date.now();const result=await executeSdkSql(ctx.str("sqlcode"),params);const elapsed=Date.now()-startTime;if(!result||typeof result!=="object"||Array.isArray(result)||typeof result.execSuccess!=="boolean"){throw CliErrors.apiError("Invalid SQL execution response: execSuccess must be a boolean.")}if(!result.execSuccess){return{ok:false,data:{error:"SQL execution failed",elapsed:elapsed},message:"SQL execution failed"}}const rows=Array.isArray(result.execResult)?result.execResult:[];return{ok:true,data:{rows:rows,rowCount:rows.length,elapsed:elapsed},
2
+ message:`Returned ${rows.length} row(s) in ${elapsed}ms`}}};
@@ -1 +1 @@
1
- function a95_0x595b(_0x35d30d,_0xdd24d4){_0x35d30d=_0x35d30d-0x15a;const _0x177727=a95_0x1777();let _0x595be0=_0x177727[_0x35d30d];return _0x595be0;}(function(_0x3e931d,_0x319e7d){const _0x1c2762=a95_0x595b,_0x306ed7=_0x3e931d();while(!![]){try{const _0x7a62ec=parseInt(_0x1c2762(0x15d))/0x1*(parseInt(_0x1c2762(0x163))/0x2)+-parseInt(_0x1c2762(0x15e))/0x3*(parseInt(_0x1c2762(0x15b))/0x4)+parseInt(_0x1c2762(0x161))/0x5*(parseInt(_0x1c2762(0x164))/0x6)+-parseInt(_0x1c2762(0x15c))/0x7*(-parseInt(_0x1c2762(0x160))/0x8)+parseInt(_0x1c2762(0x162))/0x9*(-parseInt(_0x1c2762(0x165))/0xa)+parseInt(_0x1c2762(0x15a))/0xb*(-parseInt(_0x1c2762(0x167))/0xc)+parseInt(_0x1c2762(0x15f))/0xd*(-parseInt(_0x1c2762(0x166))/0xe);if(_0x7a62ec===_0x319e7d)break;else _0x306ed7['push'](_0x306ed7['shift']());}catch(_0x5ea702){_0x306ed7['push'](_0x306ed7['shift']());}}}(a95_0x1777,0x987b5));import{sqlDetail}from'../../commands/sql/detail.js';import{sqlExec}from'../../commands/sql/exec.js';function a95_0x1777(){const _0x106d1e=['10ZRwEiJ','14ckLQDG','9378516kMrFum','11YuLIbJ','49412ilDEDk','1083145dGfNfk','5YlKFYH','66JuVjLR','770029spzWsl','40JzfSLg','4535315kcoAfr','1395729aInblz','84580FNCHKz','6xQsWNu'];a95_0x1777=function(){return _0x106d1e;};return a95_0x1777();}export const sqlDefinitions=[sqlDetail,sqlExec];
1
+ import{sqlDetail}from"../../commands/sql/detail.js";import{sqlExec}from"../../commands/sql/exec.js";export const sqlDefinitions=[sqlDetail,sqlExec];
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The runtime CLI intentionally checks npm dist-tags directly and does not use
5
5
  * a CDN policy file. The npm package owns its Built-in Skill installation;
6
- * this command repairs the current package or verifies a newly installed one.
6
+ * this command repairs the current package or explicitly installs from the new one.
7
7
  */
8
8
  import type { CommandDefinition } from "../framework/types.js";
9
9
  /**
@@ -16,6 +16,7 @@ import type { CommandDefinition } from "../framework/types.js";
16
16
  export declare function installCliPackage(version: string, nonInteractive: boolean, currentCliPrefix?: string | null): {
17
17
  ok: boolean;
18
18
  error?: string;
19
+ prefix?: string;
19
20
  };
20
21
  /**
21
22
  * Resolves the npm prefix that owns the running CLI package.
@@ -1 +1,8 @@
1
- const a96_0x1b8d00=a96_0xe3ab;(function(_0x4d7291,_0x51bda4){const _0x1ee625=a96_0xe3ab,_0xde5927=_0x4d7291();while(!![]){try{const _0x581d8d=parseInt(_0x1ee625(0x16e))/0x1+-parseInt(_0x1ee625(0x169))/0x2+-parseInt(_0x1ee625(0x15c))/0x3*(-parseInt(_0x1ee625(0x17a))/0x4)+-parseInt(_0x1ee625(0x19c))/0x5*(-parseInt(_0x1ee625(0x157))/0x6)+-parseInt(_0x1ee625(0x195))/0x7*(-parseInt(_0x1ee625(0x1ab))/0x8)+-parseInt(_0x1ee625(0x197))/0x9*(parseInt(_0x1ee625(0x1a3))/0xa)+-parseInt(_0x1ee625(0x167))/0xb*(-parseInt(_0x1ee625(0x164))/0xc);if(_0x581d8d===_0x51bda4)break;else _0xde5927['push'](_0xde5927['shift']());}catch(_0xf07263){_0xde5927['push'](_0xde5927['shift']());}}}(a96_0x5396,0x2b36e));import{fileURLToPath}from'node:url';import{basename,dirname,relative,win32}from'node:path';import{execaSync}from'execa';import a96_0x488200 from'semver';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{getCliVersion}from'../utils/version.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';const updateFlags=[{'name':'latest','type':a96_0x1b8d00(0x199),'description':a96_0x1b8d00(0x18e),'default':![]},{'name':a96_0x1b8d00(0x196),'type':'boolean','description':a96_0x1b8d00(0x1a9),'default':![]},{'name':'version','type':a96_0x1b8d00(0x19a),'description':a96_0x1b8d00(0x18b)}];function getRequestedVersion(_0x442d4c){const _0x458491=a96_0x1b8d00,_0x54fdc5=_0x442d4c['str'](_0x458491(0x180))['trim']();if(_0x54fdc5)return _0x54fdc5;return String(_0x442d4c[_0x458491(0x1a1)]?.[0x0]??'')['trim']();}function a96_0xe3ab(_0x4ea82e,_0x13c2fb){_0x4ea82e=_0x4ea82e-0x148;const _0x5396eb=a96_0x5396();let _0xe3abdb=_0x5396eb[_0x4ea82e];return _0xe3abdb;}async function validateUpdateFlags(_0x4551ca){const _0x57c8b0=a96_0x1b8d00,_0x3e7c11=getRequestedVersion(_0x4551ca),_0x475811=[_0x4551ca[_0x57c8b0(0x177)](_0x57c8b0(0x179))?_0x57c8b0(0x179):'',_0x4551ca[_0x57c8b0(0x177)](_0x57c8b0(0x196))?_0x57c8b0(0x196):'',_0x3e7c11?'version':''][_0x57c8b0(0x18d)](Boolean);if(_0x475811[_0x57c8b0(0x160)]>0x1)throw CliErrors[_0x57c8b0(0x189)]('--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.');if(_0x3e7c11&&!a96_0x488200[_0x57c8b0(0x163)](_0x3e7c11))throw CliErrors[_0x57c8b0(0x189)]('Invalid\x20version:\x20'+_0x3e7c11,'Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.');}async function fetchNpmDistTags(){const _0x1d9faa=a96_0x1b8d00;try{const _0x3426aa=NPM_REGISTRY_BASE_URL+_0x1d9faa(0x16c)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x1d9faa(0x1a0),_0xa0e082=await fetch(_0x3426aa,{'signal':AbortSignal[_0x1d9faa(0x18c)](0x2710)});if(!_0xa0e082['ok'])return null;const _0x13e781=await _0xa0e082[_0x1d9faa(0x190)]();if(!_0x13e781||typeof _0x13e781!==_0x1d9faa(0x19d))return null;return Object['fromEntries'](Object[_0x1d9faa(0x1aa)](_0x13e781)[_0x1d9faa(0x18d)](([,_0x65bbee])=>typeof _0x65bbee==='string'&&_0x65bbee[_0x1d9faa(0x166)]())[_0x1d9faa(0x16b)](([_0x170e67,_0x231919])=>[_0x170e67,String(_0x231919)[_0x1d9faa(0x166)]()]));}catch{return null;}}async function resolveTargetVersion(_0x3bba37){const _0x45a5e2=a96_0x1b8d00,_0x2984a3=getRequestedVersion(_0x3bba37);if(_0x2984a3)return{'version':_0x2984a3,'source':_0x45a5e2(0x180)};const _0xb489f5=_0x3bba37['bool'](_0x45a5e2(0x196))?_0x45a5e2(0x196):'latest',_0x43aea2=await fetchNpmDistTags(),_0x53bf50=_0x43aea2?.[_0xb489f5];if(!_0x53bf50)return null;return{'version':_0x53bf50,'source':_0xb489f5};}function shouldInstallTarget(_0x3882ab,_0x2855f5){const _0x14488c=a96_0x1b8d00;if(_0x2855f5[_0x14488c(0x176)]===_0x14488c(0x180)||_0x2855f5['source']===_0x14488c(0x196))return!a96_0x488200['eq'](_0x3882ab,_0x2855f5[_0x14488c(0x180)]);return a96_0x488200['lt'](_0x3882ab,_0x2855f5['version']);}export function installCliPackage(_0x3764e4,_0x3e5dcb,_0x202e18=resolveCurrentCliNpmPrefix()){const _0x428de9=a96_0x1b8d00,_0x1181ee=LOVRABET_NPM_PACKAGE_NAME+'@'+_0x3764e4,_0x3e81e5=['install','-g',_0x1181ee],_0x507c68=runNpmInstall(_0x3e81e5,_0x3e5dcb);if(_0x507c68['ok']||!isNpmPrefixPermissionError(_0x507c68[_0x428de9(0x15a)]))return _0x507c68;if(!_0x202e18||_0x507c68[_0x428de9(0x15a)]?.['toLowerCase']()[_0x428de9(0x15d)](_0x202e18[_0x428de9(0x16f)]()))return _0x507c68;return console[_0x428de9(0x171)](_0x428de9(0x178)+_0x202e18),runNpmInstall([..._0x3e81e5,_0x428de9(0x161),_0x202e18],_0x3e5dcb);}export function resolveCurrentCliNpmPrefix(_0x13f067=fileURLToPath(import.meta.url),_0x509852=process[a96_0x1b8d00(0x16a)]){const _0x5a2f78=a96_0x1b8d00,_0x3ce4f7=_0x509852===_0x5a2f78(0x1a2)?win32:{'basename':basename,'dirname':dirname,'relative':relative},_0x336b40=_0x3ce4f7[_0x5a2f78(0x18f)](_0x3ce4f7[_0x5a2f78(0x18f)](_0x3ce4f7[_0x5a2f78(0x18f)](_0x13f067))),_0x2f9178=_0x509852==='win32'?_0x5a2f78(0x154):_0x5a2f78(0x15b);let _0x30eaac=_0x3ce4f7[_0x5a2f78(0x18f)](_0x336b40);while(!![]){if(_0x3ce4f7[_0x5a2f78(0x15e)](_0x30eaac)===_0x5a2f78(0x1a6)&&_0x3ce4f7[_0x5a2f78(0x14c)](_0x30eaac,_0x336b40)===_0x2f9178){const _0x541697=_0x3ce4f7[_0x5a2f78(0x18f)](_0x30eaac);return _0x3ce4f7[_0x5a2f78(0x15e)](_0x541697)===_0x5a2f78(0x173)?_0x3ce4f7['dirname'](_0x541697):_0x541697;}const _0x5c7a0d=_0x3ce4f7[_0x5a2f78(0x18f)](_0x30eaac);if(_0x5c7a0d===_0x30eaac)return null;_0x30eaac=_0x5c7a0d;}}function runNpmInstall(_0x5593c2,_0x130978){const _0x126583=a96_0x1b8d00;console[_0x126583(0x151)]('*\x20'+[_0x126583(0x17d),..._0x5593c2][_0x126583(0x14e)]('\x20'));const _0xeb5928=execaSync(_0x126583(0x17d),_0x5593c2,{'cwd':process[_0x126583(0x15f)](),'stdio':_0x126583(0x1a5),'env':process.env,'extendEnv':![],'shell':![],'reject':![]}),_0x40fa09=_0xeb5928[_0x126583(0x187)]?String(_0xeb5928['stderr'])[_0x126583(0x166)]():'',_0x54ebbf=_0xeb5928[_0x126583(0x191)]?String(_0xeb5928[_0x126583(0x191)])[_0x126583(0x166)]():'';if(!_0x130978){if(_0x54ebbf)process[_0x126583(0x191)]['write'](_0x54ebbf+'\x0a');if(_0x40fa09)process[_0x126583(0x187)]['write'](_0x40fa09+'\x0a');}if(_0xeb5928[_0x126583(0x150)]===0x0)return{'ok':!![]};const _0x21664e=_0x40fa09||_0x54ebbf||_0xeb5928['shortMessage']||'exit\x20'+(_0xeb5928['exitCode']??_0x126583(0x19f));return{'ok':![],'error':_0x21664e};}function isNpmPrefixPermissionError(_0x209396){return Boolean(_0x209396&&/\b(?:EACCES|EPERM)\b/['test'](_0x209396));}function a96_0x5396(){const _0xf242ac=['INSTALL_FAILED','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Run:\x20npm\x20view\x20',',\x20state\x20','find','stderr','apiError','validation','update','Install\x20a\x20specific\x20CLI\x20version','timeout','filter','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','dirname','json','stdout','reason','\x20CLI\x20from\x20npm','Checking\x20CLI\x20Built-in\x20Skill...','65219TibowH','beta','2042559MDufTu','\x20dist-tags,\x20then\x20retry.','boolean','string','\x20is\x20current.','885815JVvYMA','object','Update\x20the\x20','unknown','/dist-tags','args','win32','10fEKaXT','Checking\x20npm\x20dist-tags...','pipe','node_modules','current','code','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','entries','120VGvAYA','skillVersion','Updating\x20','\x20version\x20from\x20npm.','Already\x20on\x20requested\x20version\x20(v','relative','Updated\x20to\x20v','join','Version\x20comparison\x20failed:\x20','exitCode','log','expected\x20','run','@lovrabet\x5clovrabet-cli','repairCommand','state','6LQPWHl','inherit','read','error','@lovrabet/lovrabet-cli','32673OeJoDm','includes','basename','cwd','length','--prefix','nonInteractive','valid','60qPRlyC',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','trim','33066feHvgO','\x20doctor','565430AEwdjF','platform','map','/-/package/','Unable\x20to\x20resolve\x20','93340fJkOMu','toLowerCase','CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','warn',']:\x20','lib','\x20\x20CLI\x20Built-in\x20Skill\x20',',\x20found\x20','source','bool','Global\x20npm\x20prefix\x20is\x20not\x20writable;\x20retrying\x20in\x20the\x20current\x20CLI\x20Node\x20environment:\x20','latest','96YQycDF','Already\x20up\x20to\x20date\x20(v','Update\x20failed:\x20','npm','Run:\x20',',\x20then\x20verify\x20with:\x20','version','Run:\x20npm\x20install\x20-g\x20'];a96_0x5396=function(){return _0xf242ac;};return a96_0x5396();}function repairCurrentBuiltinSkill(_0x3564c9){const _0x4b5215=a96_0x1b8d00;console['log'](_0x4b5215(0x194));const _0x236ca7=installBuiltinSkill({'stdio':_0x3564c9?_0x4b5215(0x1a5):_0x4b5215(0x158)});if(_0x236ca7['ok']){console[_0x4b5215(0x151)](_0x4b5215(0x174)+_0x236ca7[_0x4b5215(0x148)]+_0x4b5215(0x19b));return;}throw CliErrors[_0x4b5215(0x188)](_0x4b5215(0x170)+(_0x236ca7[_0x4b5215(0x1a8)]||_0x4b5215(0x182))+_0x4b5215(0x172)+(_0x236ca7[_0x4b5215(0x15a)]||_0x4b5215(0x19f)),_0x4b5215(0x17e)+_0x236ca7[_0x4b5215(0x155)]+',\x20then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x4b5215(0x168));}function verifyUpdatedBuiltinSkill(_0x2e29e1){const _0x6e0d22=a96_0x1b8d00;console['log'](_0x6e0d22(0x194));const _0x3fb8c6=inspectInstalledBuiltinSkillVersion(_0x2e29e1);if(_0x3fb8c6['state']===_0x6e0d22(0x1a7)){console['log'](_0x6e0d22(0x174)+_0x2e29e1+_0x6e0d22(0x19b));return;}const _0x1938a7=_0x3fb8c6[_0x6e0d22(0x148)]?_0x6e0d22(0x152)+_0x2e29e1+_0x6e0d22(0x175)+_0x3fb8c6[_0x6e0d22(0x148)]:_0x6e0d22(0x152)+_0x2e29e1+_0x6e0d22(0x185)+_0x3fb8c6[_0x6e0d22(0x156)],_0x196735=_0x3fb8c6[_0x6e0d22(0x192)]?_0x1938a7+':\x20'+_0x3fb8c6['reason']:_0x1938a7;throw CliErrors[_0x6e0d22(0x188)]('CLI\x20updated\x20to\x20v'+_0x2e29e1+_0x6e0d22(0x165)+_0x196735,_0x6e0d22(0x17e)+_0x3fb8c6[_0x6e0d22(0x155)]+_0x6e0d22(0x17f)+CLI_BIN_NAME+_0x6e0d22(0x168));}async function execute(_0x21c4b3){const _0x206e22=a96_0x1b8d00;await validateUpdateFlags(_0x21c4b3);const _0x515b54=getCliVersion();console[_0x206e22(0x151)]('Current\x20version:\x20'+_0x515b54),console['log'](_0x206e22(0x1a4));const _0x1ca0bb=await resolveTargetVersion(_0x21c4b3);if(!_0x1ca0bb){const _0x4260cd=_0x21c4b3['bool'](_0x206e22(0x196))?_0x206e22(0x196):_0x206e22(0x179),_0x2c785c=_0x206e22(0x16d)+_0x4260cd+_0x206e22(0x14a);throw CliErrors[_0x206e22(0x188)](_0x2c785c,_0x206e22(0x181)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x4260cd);}const _0x284cb0=[_0x515b54,_0x1ca0bb[_0x206e22(0x180)]][_0x206e22(0x186)](_0x3cecd2=>!a96_0x488200[_0x206e22(0x163)](_0x3cecd2));if(_0x284cb0){const _0xbf6a23=_0x206e22(0x14f)+_0x284cb0+'.';throw CliErrors['apiError'](_0xbf6a23,_0x206e22(0x184)+LOVRABET_NPM_PACKAGE_NAME+_0x206e22(0x198));}if(!shouldInstallTarget(_0x515b54,_0x1ca0bb)){const _0x174b17=_0x1ca0bb['source']===_0x206e22(0x180)?_0x206e22(0x14b)+_0x1ca0bb[_0x206e22(0x180)]+').':_0x206e22(0x17b)+_0x1ca0bb[_0x206e22(0x180)]+').';return console['log'](_0x174b17),repairCurrentBuiltinSkill(_0x21c4b3[_0x206e22(0x162)]),{'ok':!![]};}console[_0x206e22(0x151)](_0x206e22(0x149)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x515b54+'\x20->\x20'+_0x1ca0bb['version']);const _0x2b0872=installCliPackage(_0x1ca0bb[_0x206e22(0x180)],_0x21c4b3[_0x206e22(0x162)]);if(!_0x2b0872['ok']){const _0x3e5a63=_0x206e22(0x17c)+(_0x2b0872[_0x206e22(0x15a)]||_0x206e22(0x19f));throw CliErrors['apiError'](_0x3e5a63,'Run:\x20npm\x20install\x20-g\x20'+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x1ca0bb['version']);}return console[_0x206e22(0x151)](_0x206e22(0x14d)+_0x1ca0bb[_0x206e22(0x180)]+'.'),console['log'](_0x206e22(0x183)),verifyUpdatedBuiltinSkill(_0x1ca0bb['version']),{'ok':!![]};}export const updateDefinition={'service':a96_0x1b8d00(0x18a),'command':a96_0x1b8d00(0x153),'description':a96_0x1b8d00(0x19e)+CLI_BIN_NAME+a96_0x1b8d00(0x193),'risk':a96_0x1b8d00(0x159),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
1
+ import{fileURLToPath}from"node:url";import{basename,dirname,relative,win32}from"node:path";import{execa,execaSync}from"execa";import semver from"semver";import{CliErrors}from"../errors.js";import{CLI_BIN_NAME}from"../constant/cli.js";import{LOVRABET_NPM_PACKAGE_NAME}from"../constant/distribution.js";import{getCliVersion}from"../utils/version.js";import{installBuiltinSkill}from"../skills/builtin-skill.js";import{installUpdatedBuiltinSkill}from"../skills/install-updated-skill.js";const updateFlags=[{name:"latest",type:"boolean",description:"Install the version from npm latest dist-tag",default:false},{name:"beta",type:"boolean",description:"Install the version from npm beta dist-tag",default:false},{name:"version",type:"string",description:"Install a specific CLI version"}];function getRequestedVersion(ctx){const flagVersion=ctx.str("version").trim();if(flagVersion)return flagVersion;return String(ctx.args?.[0]??"").trim()}async function validateUpdateFlags(ctx){
2
+ const requestedVersion=getRequestedVersion(ctx);const enabledTargets=[ctx.bool("latest")?"latest":"",ctx.bool("beta")?"beta":"",requestedVersion?"version":""].filter(Boolean);if(enabledTargets.length>1){throw CliErrors.validation("--latest, --beta, and version cannot be used together.","Choose exactly one target: --latest, --beta, or --version <version>.")}if(requestedVersion&&!semver.valid(requestedVersion)){throw CliErrors.validation(`Invalid version: ${requestedVersion}`,"Use a full semver such as 2.0.6 or 2.0.7-beta.1.")}}async function fetchNpmDistTags(){try{const{stdout:stdout}=await execa("npm",["view",LOVRABET_NPM_PACKAGE_NAME,"dist-tags","--json","--global"],{timeout:1e4});const parsed=JSON.parse(stdout);const data=Array.isArray(parsed)&&parsed.length===1?parsed[0]:parsed;if(!data||typeof data!=="object"||Array.isArray(data))return null
3
+ ;return Object.fromEntries(Object.entries(data).filter(([,value])=>typeof value==="string"&&value.trim()).map(([key,value])=>[key,String(value).trim()]))}catch{return null}}async function resolveTargetVersion(ctx){const requestedVersion=getRequestedVersion(ctx);if(requestedVersion){return{version:requestedVersion,source:"version"}}const tag=ctx.bool("beta")?"beta":"latest";const tags=await fetchNpmDistTags();const version=tags?.[tag];if(!version)return null;return{version:version,source:tag}}function shouldInstallTarget(currentVersion,target){if(target.source==="version"||target.source==="beta"){return!semver.eq(currentVersion,target.version)}return semver.lt(currentVersion,target.version)}export function installCliPackage(version,nonInteractive,currentCliPrefix=resolveCurrentCliNpmPrefix()){const packageSpec=`${LOVRABET_NPM_PACKAGE_NAME}@${version}`;const args=["install","-g",packageSpec];const install=runNpmInstall(args,nonInteractive)
4
+ ;if(install.ok||!isNpmPrefixPermissionError(install.error))return install;if(!currentCliPrefix||install.error?.toLowerCase().includes(currentCliPrefix.toLowerCase())){return install}console.warn(`Global npm prefix is not writable; retrying in the current CLI Node environment: ${currentCliPrefix}`);return{...runNpmInstall([...args,"--prefix",currentCliPrefix],nonInteractive),prefix:currentCliPrefix}}export function resolveCurrentCliNpmPrefix(modulePath=fileURLToPath(import.meta.url),platform=process.platform){const path=platform==="win32"?win32:{basename:basename,dirname:dirname,relative:relative};const packageRoot=path.dirname(path.dirname(path.dirname(modulePath)));const packageRelativePath=platform==="win32"?"@lovrabet\\lovrabet-cli":"@lovrabet/lovrabet-cli";let directory=path.dirname(packageRoot);while(true){if(path.basename(directory)==="node_modules"&&path.relative(directory,packageRoot)===packageRelativePath){const modulesParent=path.dirname(directory)
5
+ ;return path.basename(modulesParent)==="lib"?path.dirname(modulesParent):modulesParent}const parent=path.dirname(directory);if(parent===directory)return null;directory=parent}}function runNpmInstall(args,nonInteractive){console.log(`* ${["npm",...args].join(" ")}`);const result=execaSync("npm",args,{cwd:process.cwd(),stdio:"pipe",env:process.env,extendEnv:false,shell:false,reject:false});const stderr=result.stderr?String(result.stderr).trim():"";const stdout=result.stdout?String(result.stdout).trim():"";if(!nonInteractive){if(stdout)process.stdout.write(`${stdout}\n`);if(stderr)process.stderr.write(`${stderr}\n`)}if(result.exitCode===0)return{ok:true};const error=stderr||stdout||result.shortMessage||`exit ${result.exitCode??"unknown"}`;return{ok:false,error:error}}function isNpmPrefixPermissionError(error){return Boolean(error&&/\b(?:EACCES|EPERM)\b/.test(error))}function repairCurrentBuiltinSkill(nonInteractive){console.log("Checking CLI Built-in Skill...")
6
+ ;const result=installBuiltinSkill({stdio:nonInteractive?"pipe":"inherit"});if(result.ok){console.log(` CLI Built-in Skill ${result.skillVersion} is current.`);return}throw CliErrors.apiError(`CLI Built-in Skill repair failed [${result.code||"INSTALL_FAILED"}]: ${result.error||"unknown"}`,`Run: ${result.repairCommand}, then verify with: ${CLI_BIN_NAME} doctor`)}async function execute(ctx){await validateUpdateFlags(ctx);const currentVersion=getCliVersion();console.log(`Current version: ${currentVersion}`);console.log("Checking npm dist-tags...");const target=await resolveTargetVersion(ctx);if(!target){const tag=ctx.bool("beta")?"beta":"latest";const message=`Unable to resolve ${tag} version from npm.`;throw CliErrors.apiError(message,`Run: npm install -g ${LOVRABET_NPM_PACKAGE_NAME}@${tag}`)}const invalidVersion=[currentVersion,target.version].find(version=>!semver.valid(version));if(invalidVersion){const message=`Version comparison failed: ${invalidVersion}.`
7
+ ;throw CliErrors.apiError(message,`Run: npm view ${LOVRABET_NPM_PACKAGE_NAME} dist-tags, then retry.`)}if(!shouldInstallTarget(currentVersion,target)){const message=target.source==="version"?`Already on requested version (v${target.version}).`:`Already up to date (v${target.version}).`;repairCurrentBuiltinSkill(ctx.nonInteractive);console.log(message);return{ok:true}}console.log(`Updating ${LOVRABET_NPM_PACKAGE_NAME}: ${currentVersion} -> ${target.version}`);const install=installCliPackage(target.version,ctx.nonInteractive);if(!install.ok){const message=`Update failed: ${install.error||"unknown"}`;throw CliErrors.apiError(message,`Run: npm install -g ${LOVRABET_NPM_PACKAGE_NAME}@${target.version}`)}try{installUpdatedBuiltinSkill({version:target.version,packageManager:"npm",packageManagerCommand:"npm",...install.prefix?{prefix:install.prefix}:{}})}catch(error){
8
+ throw CliErrors.apiError(`CLI updated to v${target.version}, but Built-in Skill installation failed: ${error instanceof Error?error.message:String(error)}`,`Run: ${CLI_BIN_NAME} cli-skill install, then verify with: ${CLI_BIN_NAME} doctor`)}console.log(`Updated CLI and Built-in Skill to v${target.version}.`);console.log(" Restart your terminal to use the new version.");return{ok:true}}export const updateDefinition={service:"update",command:"run",description:`Update the ${CLI_BIN_NAME} CLI from npm`,risk:"read",requiresAuth:false,requiresAppCode:false,hasFormat:false,flags:updateFlags,validate:validateUpdateFlags,execute:execute};
@@ -1 +1,3 @@
1
- const a97_0x31560e=a97_0x17e2;function a97_0x17e2(_0x1e7953,_0x37a0cf){_0x1e7953=_0x1e7953-0x14f;const _0x19cffa=a97_0x19cf();let _0x17e2a2=_0x19cffa[_0x1e7953];return _0x17e2a2;}function a97_0x19cf(){const _0x4f406a=['string','2829960zFPDvZ','6ouXMnL','account-id','990597zkeFkE','toLowerCase','External\x20account\x20ID\x20for\x20the\x20selected\x20provider','1988860kGTYVz','Retry\x20with\x20the\x20same\x20--provider\x20and\x20--account-id\x20only\x20after\x20checking\x20the\x20current\x20AccessKey\x20identity.','Binds\x20the\x20platform\x20user\x20of\x20the\x20current\x20AccessKey\x20to\x20the\x20given\x20collaboration-provider\x20account.\x20An\x20existing\x20bind\x20for\x20the\x20same\x20provider\x20may\x20be\x20replaced.','bind','user-account','--account-id\x20cannot\x20be\x20empty.','join','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','str','trim','dingtalk','Unsupported\x20provider:\x20','provider','validation','5053432NswJAs','Bind\x20the\x20current\x20platform\x20user\x20to\x20an\x20external\x20provider\x20account','Pass\x20the\x20external\x20account\x20ID\x20for\x20the\x20selected\x20provider.','2323800kJrdgL','apiError','2195844zJTRhP','51949Jpwndf'];a97_0x19cf=function(){return _0x4f406a;};return a97_0x19cf();}(function(_0x386a50,_0x5ba553){const _0x384853=a97_0x17e2,_0xf96f38=_0x386a50();while(!![]){try{const _0x247acd=parseInt(_0x384853(0x16a))/0x1*(parseInt(_0x384853(0x151))/0x2)+-parseInt(_0x384853(0x153))/0x3+-parseInt(_0x384853(0x156))/0x4+-parseInt(_0x384853(0x167))/0x5+parseInt(_0x384853(0x150))/0x6+parseInt(_0x384853(0x169))/0x7+parseInt(_0x384853(0x164))/0x8;if(_0x247acd===_0x5ba553)break;else _0xf96f38['push'](_0xf96f38['shift']());}catch(_0x35f37f){_0xf96f38['push'](_0xf96f38['shift']());}}}(a97_0x19cf,0x44880));import{bindExternalUserAccount,USER_ACCOUNT_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const CURRENT_BINDING_WARNING=a97_0x31560e(0x15d),SUPPORTED_PROVIDERS=[a97_0x31560e(0x160)];function readBindingInput(_0x2235e4){const _0x5bf220=a97_0x31560e,_0x5747f4=_0x2235e4[_0x5bf220(0x15e)](_0x5bf220(0x162))[_0x5bf220(0x15f)]()[_0x5bf220(0x154)]();if(!SUPPORTED_PROVIDERS['includes'](_0x5747f4))throw CliErrors[_0x5bf220(0x163)](_0x5bf220(0x161)+(_0x5747f4||'(empty)')+'.','Pass\x20one\x20of:\x20'+SUPPORTED_PROVIDERS[_0x5bf220(0x15c)](',\x20')+'.');const _0xc9a637=_0x2235e4['str'](_0x5bf220(0x152))[_0x5bf220(0x15f)]();if(!_0xc9a637)throw CliErrors[_0x5bf220(0x163)](_0x5bf220(0x15b),_0x5bf220(0x166));return{'provider':_0x5747f4,'accountId':_0xc9a637};}function buildBindingData(_0x97979f,_0x34c497,_0x2634d9){const _0x35ceca=a97_0x31560e;return{'operation':_0x35ceca(0x159),'selector':{'provider':_0x97979f,'accountId':_0x34c497},'before':null,'after':{'provider':_0x97979f,'accountId':_0x34c497,'bound':!![]},'dryRun':_0x2634d9,'warnings':[CURRENT_BINDING_WARNING]};}export const bindUserAccount={'service':a97_0x31560e(0x15a),'command':a97_0x31560e(0x159),'description':a97_0x31560e(0x165),'risk':'write','confirmationDescription':a97_0x31560e(0x158),'requiresAuth':!![],'requiresAppCode':![],'flags':[{'name':a97_0x31560e(0x162),'type':a97_0x31560e(0x14f),'required':!![],'enum':[...SUPPORTED_PROVIDERS],'description':'External\x20account\x20provider'},{'name':a97_0x31560e(0x152),'type':a97_0x31560e(0x14f),'required':!![],'description':a97_0x31560e(0x155)}],async 'validate'(_0x1f289f){readBindingInput(_0x1f289f);},async 'dryRun'(_0x95175d){const {provider:_0x145add,accountId:_0x2fa339}=readBindingInput(_0x95175d);return{...buildBindingData(_0x145add,_0x2fa339,!![]),'method':'POST','url':USER_ACCOUNT_BIND_PATH,'body':{'provider':_0x145add,'accountId':_0x2fa339}};},async 'execute'(_0x445831){const _0x3f10bf=a97_0x31560e,{provider:_0x5f92b3,accountId:_0x4bf194}=readBindingInput(_0x445831),_0x4c3363=await bindExternalUserAccount(_0x5f92b3,_0x4bf194);if(_0x4c3363!==!![])throw CliErrors[_0x3f10bf(0x168)]('External\x20account\x20binding\x20was\x20not\x20confirmed.',_0x3f10bf(0x157));return{'ok':!![],'data':buildBindingData(_0x5f92b3,_0x4bf194,![]),'message':'Bound\x20current\x20user\x20to\x20external\x20provider\x20account.'};}};
1
+ import{bindExternalUserAccount,USER_ACCOUNT_BIND_PATH}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";const CURRENT_BINDING_WARNING="The current binding is not exposed by the server; before is unavailable.";const SUPPORTED_PROVIDERS=["dingtalk"];function readBindingInput(ctx){const provider=ctx.str("provider").trim().toLowerCase();if(!SUPPORTED_PROVIDERS.includes(provider)){throw CliErrors.validation(`Unsupported provider: ${provider||"(empty)"}.`,`Pass one of: ${SUPPORTED_PROVIDERS.join(", ")}.`)}const accountId=ctx.str("account-id").trim();if(!accountId){throw CliErrors.validation("--account-id cannot be empty.","Pass the external account ID for the selected provider.")}return{provider:provider,accountId:accountId}}function buildBindingData(provider,accountId,dryRun){return{operation:"bind",selector:{provider:provider,accountId:accountId},before:null,after:{provider:provider,accountId:accountId,bound:true},dryRun:dryRun,warnings:[CURRENT_BINDING_WARNING]}}
2
+ export const bindUserAccount={service:"user-account",command:"bind",description:"Bind the current platform user to an external provider account",risk:"write",confirmationDescription:"Binds the platform user of the current AccessKey to the given collaboration-provider account. An existing bind for the same provider may be replaced.",requiresAuth:true,requiresAppCode:false,flags:[{name:"provider",type:"string",required:true,enum:[...SUPPORTED_PROVIDERS],description:"External account provider"},{name:"account-id",type:"string",required:true,description:"External account ID for the selected provider"}],async validate(ctx){readBindingInput(ctx)},async dryRun(ctx){const{provider:provider,accountId:accountId}=readBindingInput(ctx);return{...buildBindingData(provider,accountId,true),method:"POST",url:USER_ACCOUNT_BIND_PATH,body:{provider:provider,accountId:accountId}}},async execute(ctx){const{provider:provider,accountId:accountId}=readBindingInput(ctx)
3
+ ;const confirmed=await bindExternalUserAccount(provider,accountId);if(confirmed!==true){throw CliErrors.apiError("External account binding was not confirmed.","Retry with the same --provider and --account-id only after checking the current AccessKey identity.")}return{ok:true,data:buildBindingData(provider,accountId,false),message:"Bound current user to external provider account."}}};
@@ -1 +1 @@
1
- (function(_0x10de38,_0x131f58){const _0x2ff460=a98_0x5477,_0xab6a98=_0x10de38();while(!![]){try{const _0x142c3b=parseInt(_0x2ff460(0xe2))/0x1+-parseInt(_0x2ff460(0xea))/0x2+parseInt(_0x2ff460(0xeb))/0x3*(-parseInt(_0x2ff460(0xe5))/0x4)+-parseInt(_0x2ff460(0xe6))/0x5+parseInt(_0x2ff460(0xe7))/0x6+-parseInt(_0x2ff460(0xe8))/0x7*(parseInt(_0x2ff460(0xe3))/0x8)+-parseInt(_0x2ff460(0xe4))/0x9*(-parseInt(_0x2ff460(0xe9))/0xa);if(_0x142c3b===_0x131f58)break;else _0xab6a98['push'](_0xab6a98['shift']());}catch(_0x1fa32b){_0xab6a98['push'](_0xab6a98['shift']());}}}(a98_0x4224,0xd9dd8));import{bindUserAccount}from'../../commands/user-account/bind.js';function a98_0x5477(_0x5016a9,_0x406473){_0x5016a9=_0x5016a9-0xe2;const _0x422476=a98_0x4224();let _0x547797=_0x422476[_0x5016a9];return _0x547797;}function a98_0x4224(){const _0x4b1ed2=['173980KLVDeF','920494UmlAJj','36dpSxPv','14715KfqpNM','8kDntbk','2232JssVyp','361740xyhCPw','6695285qgmodH','34680QvqrXT','3908093lnXKlw'];a98_0x4224=function(){return _0x4b1ed2;};return a98_0x4224();}export const userAccountDefinitions=[bindUserAccount];
1
+ import{bindUserAccount}from"../../commands/user-account/bind.js";export const userAccountDefinitions=[bindUserAccount];
@@ -1 +1,7 @@
1
- const a99_0x55af42=a99_0x30d6;(function(_0x5a760b,_0x3c193a){const _0x4e85ab=a99_0x30d6,_0x1234c2=_0x5a760b();while(!![]){try{const _0x4ba61d=parseInt(_0x4e85ab(0x116))/0x1+-parseInt(_0x4e85ab(0x110))/0x2*(-parseInt(_0x4e85ab(0x108))/0x3)+-parseInt(_0x4e85ab(0x118))/0x4+parseInt(_0x4e85ab(0xec))/0x5+-parseInt(_0x4e85ab(0xe4))/0x6*(-parseInt(_0x4e85ab(0xdf))/0x7)+parseInt(_0x4e85ab(0xf9))/0x8+-parseInt(_0x4e85ab(0xdc))/0x9;if(_0x4ba61d===_0x3c193a)break;else _0x1234c2['push'](_0x1234c2['shift']());}catch(_0xeb9b0a){_0x1234c2['push'](_0x1234c2['shift']());}}}(a99_0x45f6,0x64e02));import{CLI_BIN_NAME}from'../../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../../constant/env.js';import{CliErrors}from'../../errors.js';import{readConfigFile,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';const WORKSPACE_USE_FLAGS=[{'name':'app','type':'string','description':a99_0x55af42(0x117)},{'name':a99_0x55af42(0x105),'type':a99_0x55af42(0x10f),'description':a99_0x55af42(0x11a)},{'name':a99_0x55af42(0xee),'type':'string','description':'Internal\x20development:\x20set\x20and\x20save\x20the\x20workspace\x20environment;\x20normally\x20omit','enum':[...RUNTIME_ENV_VALUES]}];async function executeWorkspaceUse(_0x4f975e,_0x547339){const _0xbe0f72=a99_0x55af42,_0x368c7d=_0x4f975e[_0xbe0f72(0xe9)](_0xbe0f72(0xde))['trim'](),_0x550109=_0x4f975e[_0xbe0f72(0xe9)](_0xbe0f72(0x105))[_0xbe0f72(0xf4)](),_0x2a67dc=_0x4f975e[_0xbe0f72(0xe9)](_0xbe0f72(0xee))[_0xbe0f72(0xf4)](),_0x3c8041=resolveWorkspaceEnv(_0x2a67dc||_0x4f975e[_0xbe0f72(0xe3)]||DEFAULT_CONFIG_VALUES[_0xbe0f72(0xee)]);if(!_0x368c7d&&!_0x550109)throw CliErrors[_0xbe0f72(0xe8)](_0xbe0f72(0x114),_0xbe0f72(0x10b)+CLI_BIN_NAME+_0xbe0f72(0xfe)+_0x547339+_0xbe0f72(0xed)+CLI_BIN_NAME+'\x20workspace\x20'+_0x547339+_0xbe0f72(0x100));if(_0x368c7d&&_0x550109)throw CliErrors[_0xbe0f72(0xe8)]('Conflicting\x20workspace\x20app\x20selectors.',_0xbe0f72(0xf5));const _0xf035d4=resolveWriteConfigPath(_0xbe0f72(0x112)),_0x219520=readConfigFile(_0xf035d4);assertWorkspaceCommandState(_0x547339,_0x219520);const _0x1406e3=_0x550109||await resolveRemoteAppCode({'command':_0x547339,'appName':_0x368c7d,'env':_0x3c8041,'accessKey':_0x4f975e[_0xbe0f72(0xf2)]});return writeWorkspaceConfig({'command':_0x547339,'appName':_0x368c7d,'appcode':_0x1406e3,'env':_0x3c8041,'shouldWriteEnv':!!_0x2a67dc,'accessKey':_0x4f975e[_0xbe0f72(0xf2)]},_0xf035d4,_0x219520),{'ok':!![],'data':{'configPath':_0xf035d4,'app':_0x368c7d||null,'appcode':_0x1406e3,'env':_0x2a67dc?_0x3c8041:null,'accessKeyWritten':![],'command':_0xbe0f72(0x119)+_0x547339},'message':buildWorkspaceMessage(_0xf035d4,_0x368c7d,_0x1406e3,_0x2a67dc?_0x3c8041:undefined)};}async function resolveRemoteAppCode(_0x23e12a){const _0x155c21=a99_0x55af42;if(!_0x23e12a['accessKey'])throw CliErrors[_0x155c21(0x10c)]('Resolving\x20--app\x20requires\x20accessKey.\x20Pass\x20--appcode\x20directly,\x20or\x20set\x20accessKey\x20before\x20running\x20'+CLI_BIN_NAME+_0x155c21(0xfe)+_0x23e12a[_0x155c21(0x115)]+'.');const {setActiveAK:_0x37c123}=await import(_0x155c21(0x113)),{getRemoteAppList:_0x45b494}=await import(_0x155c21(0xfb));_0x37c123(_0x23e12a[_0x155c21(0xf2)]);const _0x247c51=await _0x45b494({'env':_0x23e12a[_0x155c21(0xee)],'accessKey':_0x23e12a[_0x155c21(0xf2)],'noCache':![]}),_0x5201e9=findAppByName(_0x247c51[_0x155c21(0xf8)],_0x23e12a[_0x155c21(0xe7)]);if(_0x5201e9&&!isRuntimeAccessibleApp(_0x5201e9))throw runtimeInaccessibleAppError(_0x5201e9,'\x22'+_0x23e12a[_0x155c21(0xe7)]+'\x22');const _0x5c9cc6=_0x5201e9?.[_0x155c21(0xea)]?.['trim']();if(_0x5c9cc6)return _0x5c9cc6;const _0x1d7acc=_0x247c51['items'][_0x155c21(0xf1)](_0x53d175=>_0x53d175['appName'])[_0x155c21(0xe5)](Boolean),_0x45e6cf=_0x1d7acc[_0x155c21(0x103)]?_0x155c21(0x109)+Array[_0x155c21(0xfc)](new Set(_0x1d7acc))['join'](',\x20')+'.':_0x155c21(0xf3)+CLI_BIN_NAME+'\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20pass\x20--appcode\x20directly.';throw CliErrors[_0x155c21(0xe8)](_0x155c21(0xfd)+_0x23e12a[_0x155c21(0xe7)]+'\x22\x20not\x20found.',_0x45e6cf);}function writeWorkspaceConfig(_0x2190e1,_0x539e5d,_0x2d17bf){const _0x47af3a=a99_0x55af42;_0x2190e1['shouldWriteEnv']&&(_0x2d17bf[_0x47af3a(0xee)]=_0x2190e1[_0x47af3a(0xee)]);if(_0x2190e1[_0x47af3a(0xe7)]){const _0x10c666=isRecord(_0x2d17bf['apps'])?{..._0x2d17bf[_0x47af3a(0x10d)]}:{},_0x1289d0=isRecord(_0x10c666[_0x2190e1['appName']])?_0x10c666[_0x2190e1[_0x47af3a(0xe7)]]:{};return _0x10c666[_0x2190e1['appName']]={..._0x1289d0,'appcode':_0x2190e1[_0x47af3a(0x105)]},_0x2d17bf[_0x47af3a(0x10d)]=_0x10c666,_0x2d17bf[_0x47af3a(0x10a)]=_0x2190e1[_0x47af3a(0xe7)],delete _0x2d17bf['appcode'],delete _0x2d17bf[_0x47af3a(0xde)],writeAndReturn(_0x539e5d,_0x2d17bf);}return _0x2d17bf[_0x47af3a(0x105)]=_0x2190e1['appcode'],delete _0x2d17bf[_0x47af3a(0x10a)],delete _0x2d17bf['app'],writeAndReturn(_0x539e5d,_0x2d17bf);}function a99_0x30d6(_0x219b4d,_0x162198){_0x219b4d=_0x219b4d-0xdb;const _0x45f63b=a99_0x45f6();let _0x30d67c=_0x45f63b[_0x219b4d];return _0x30d67c;}function writeAndReturn(_0x3fc399,_0x2ab07a){return writeConfigFile(_0x3fc399,_0x2ab07a),_0x3fc399;}function resolveWorkspaceEnv(_0xc6453){const _0x4695b3=a99_0x55af42;if(RUNTIME_ENV_VALUES[_0x4695b3(0xdb)](_0xc6453))return _0xc6453;throw CliErrors[_0x4695b3(0xe8)](_0x4695b3(0xff)+_0xc6453+_0x4695b3(0xe0)+RUNTIME_ENV_VALUES[_0x4695b3(0xeb)](',\x20'));}function buildWorkspaceMessage(_0x4d3fe0,_0x12c681,_0x485f93,_0x16940b){const _0x1da42e=a99_0x55af42,_0x4f706f=_0x12c681?_0x12c681+'\x20('+_0x485f93+')':_0x485f93,_0x1b4a45=_0x16940b?_0x1da42e(0xfa)+_0x16940b:'';return'Workspace\x20configured.\x0aConfig\x20file:\x20'+_0x4d3fe0+_0x1da42e(0x106)+_0x4f706f+_0x1b4a45+_0x1da42e(0xe6);}function a99_0x45f6(){const _0x575a5a=['appCode','join','2904565AfyfmR','\x20--app\x20<name>\x20or\x20','env','Workspace\x20app\x20context\x20is\x20not\x20initialized.','init','map','accessKey','Run\x20`','trim','Pass\x20either\x20--app\x20<name>\x20or\x20--appcode\x20<code>,\x20not\x20both.','isArray','Use\x20`','items','1283088zNEKWI','\x0aEnv:\x20','../../commands/app/remote-source.js','from','App\x20\x22','\x20workspace\x20','Invalid\x20env\x20\x22','\x20--appcode\x20<code>','workspace','Writes\x20Lovrabet\x20project\x20config\x20in\x20the\x20current\x20working\x20directory\x20when\x20no\x20app\x20is\x20bound\x20yet,\x20and\x20sets\x20the\x20selected\x20app\x20as\x20the\x20directory\x20default.\x20AccessKey\x20is\x20not\x20written.','length','\x20workspace\x20init\x20--appcode\x20<code>`\x20first.','appcode','\x0aDefault\x20app:\x20','Initialize\x20app\x20context\x20for\x20the\x20current\x20working\x20directory\x20when\x20no\x20app\x20is\x20bound\x20yet','88581zXXbbN','Available\x20apps:\x20','defaultApp','Usage:\x20','authRequired','apps','use','string','28LSKXpX','Workspace\x20app\x20context\x20is\x20already\x20initialized.','project','../../core/api-client.js','Missing\x20workspace\x20app\x20selector.','command','812862pjUOMt','App\x20name\x20to\x20bind\x20as\x20the\x20current\x20workspace\x20default','1187864SIQdii','workspace\x20','App\x20code\x20to\x20bind\x20directly','write','includes','14880888cwwuCv','\x20workspace\x20use\x20--appcode\x20<code>`\x20to\x20change\x20it.','app','42651Yylilm','\x22.\x20Allowed:\x20','object','Change\x20the\x20app\x20context\x20already\x20bound\x20to\x20the\x20current\x20working\x20directory','envName','390QDaEul','filter','\x0aAccessKey:\x20not\x20written','appName','validation','str'];a99_0x45f6=function(){return _0x575a5a;};return a99_0x45f6();}function isRecord(_0x34ee2a){const _0x4032db=a99_0x55af42;return typeof _0x34ee2a===_0x4032db(0xe1)&&_0x34ee2a!==null&&!Array[_0x4032db(0xf6)](_0x34ee2a);}function hasWorkspaceAppBinding(_0x12b4a0){const _0x3754c7=a99_0x55af42;if(typeof _0x12b4a0[_0x3754c7(0x105)]===_0x3754c7(0x10f)&&_0x12b4a0[_0x3754c7(0x105)][_0x3754c7(0xf4)]()[_0x3754c7(0x103)]>0x0)return!![];if(typeof _0x12b4a0['defaultApp']!==_0x3754c7(0x10f)||!_0x12b4a0['defaultApp'][_0x3754c7(0xf4)]())return![];if(!isRecord(_0x12b4a0['apps']))return![];const _0x7b2f4f=_0x12b4a0[_0x3754c7(0x10d)][_0x12b4a0[_0x3754c7(0x10a)][_0x3754c7(0xf4)]()];return isRecord(_0x7b2f4f)&&typeof _0x7b2f4f[_0x3754c7(0x105)]==='string'&&_0x7b2f4f[_0x3754c7(0x105)]['trim']()[_0x3754c7(0x103)]>0x0;}function assertWorkspaceCommandState(_0x1bab36,_0x3a536a){const _0x4860d5=a99_0x55af42,_0x4097bd=hasWorkspaceAppBinding(_0x3a536a);if(_0x1bab36===_0x4860d5(0xf0)&&_0x4097bd)throw CliErrors[_0x4860d5(0xe8)](_0x4860d5(0x111),_0x4860d5(0xf7)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`\x20or\x20`'+CLI_BIN_NAME+_0x4860d5(0xdd));if(_0x1bab36===_0x4860d5(0x10e)&&!_0x4097bd)throw CliErrors[_0x4860d5(0xe8)](_0x4860d5(0xef),_0x4860d5(0xf3)+CLI_BIN_NAME+'\x20workspace\x20init\x20--app\x20<name>`\x20or\x20`'+CLI_BIN_NAME+_0x4860d5(0x104));}function makeWorkspaceCommand(_0xc1e21d){const _0x56da97=a99_0x55af42;return{'service':_0x56da97(0x101),'command':_0xc1e21d,'description':_0xc1e21d===_0x56da97(0xf0)?_0x56da97(0x107):_0x56da97(0xe2),'risk':_0x56da97(0x11b),'confirmationDescription':_0xc1e21d===_0x56da97(0xf0)?_0x56da97(0x102):'Updates\x20the\x20app\x20binding\x20already\x20present\x20in\x20the\x20current\x20working\x20directory\x20and\x20sets\x20the\x20selected\x20app\x20as\x20the\x20directory\x20default.\x20AccessKey\x20is\x20not\x20written.','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':WORKSPACE_USE_FLAGS,async 'execute'(_0x17025f){return executeWorkspaceUse(_0x17025f,_0xc1e21d);}};}export const workspaceDefinitions=[makeWorkspaceCommand(a99_0x55af42(0xf0)),makeWorkspaceCommand(a99_0x55af42(0x10e))];
1
+ import{CLI_BIN_NAME}from"../../constant/cli.js";import{DEFAULT_CONFIG_VALUES}from"../../constant/defaults.js";import{RUNTIME_ENV_VALUES}from"../../constant/env.js";import{CliErrors}from"../../errors.js";import{readConfigFile,resolveWriteConfigPath,writeConfigFile}from"../../context.js";import{findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from"../../commands/app/eligibility.js";const WORKSPACE_USE_FLAGS=[{name:"app",type:"string",description:"App name to bind as the current workspace default"},{name:"appcode",type:"string",description:"App code to bind directly"},{name:"env",type:"string",description:"Internal development: set and save the workspace environment; normally omit",enum:[...RUNTIME_ENV_VALUES]}];async function executeWorkspaceUse(ctx,command){const appName=ctx.str("app").trim();const appcode=ctx.str("appcode").trim();const envInput=ctx.str("env").trim();const env=resolveWorkspaceEnv(envInput||ctx.envName||DEFAULT_CONFIG_VALUES.env);if(!appName&&!appcode){
2
+ throw CliErrors.validation("Missing workspace app selector.",`Usage: ${CLI_BIN_NAME} workspace ${command} --app <name> or ${CLI_BIN_NAME} workspace ${command} --appcode <code>`)}if(appName&&appcode){throw CliErrors.validation("Conflicting workspace app selectors.","Pass either --app <name> or --appcode <code>, not both.")}const configPath=resolveWriteConfigPath("project");const config=readConfigFile(configPath);assertWorkspaceCommandState(command,config);const resolvedAppcode=appcode||await resolveRemoteAppCode({command:command,appName:appName,env:env,accessKey:ctx.accessKey});writeWorkspaceConfig({command:command,appName:appName,appcode:resolvedAppcode,env:env,shouldWriteEnv:!!envInput,accessKey:ctx.accessKey},configPath,config);return{ok:true,data:{configPath:configPath,app:appName||null,appcode:resolvedAppcode,env:envInput?env:null,accessKeyWritten:false,command:`workspace ${command}`},message:buildWorkspaceMessage(configPath,appName,resolvedAppcode,envInput?env:undefined)}}
3
+ async function resolveRemoteAppCode(input){if(!input.accessKey){throw CliErrors.authRequired(`Resolving --app requires accessKey. Pass --appcode directly, or set accessKey before running ${CLI_BIN_NAME} workspace ${input.command}.`)}const{setActiveAK:setActiveAK}=await(import("../../core/api-client.js"));const{getRemoteAppList:getRemoteAppList}=await(import("../../commands/app/remote-source.js"));setActiveAK(input.accessKey);const remote=await getRemoteAppList({env:input.env,accessKey:input.accessKey,noCache:false});const match=findAppByName(remote.items,input.appName);if(match&&!isRuntimeAccessibleApp(match)){throw runtimeInaccessibleAppError(match,`"${input.appName}"`)}const resolved=match?.appCode?.trim();if(resolved)return resolved;const available=remote.items.map(item=>item.appName).filter(Boolean)
4
+ ;const hint=available.length?`Available apps: ${Array.from(new Set(available)).join(", ")}.`:`Run \`${CLI_BIN_NAME} app list --no-cache\` to refresh available apps, or pass --appcode directly.`;throw CliErrors.validation(`App "${input.appName}" not found.`,hint)}function writeWorkspaceConfig(input,configPath,config){if(input.shouldWriteEnv){config.env=input.env}if(input.appName){const apps=isRecord(config.apps)?{...config.apps}:{};const existing=isRecord(apps[input.appName])?apps[input.appName]:{};apps[input.appName]={...existing,appcode:input.appcode};config.apps=apps;config.defaultApp=input.appName;delete config.appcode;delete config.app;return writeAndReturn(configPath,config)}config.appcode=input.appcode;delete config.defaultApp;delete config.app;return writeAndReturn(configPath,config)}function writeAndReturn(configPath,config){writeConfigFile(configPath,config);return configPath}function resolveWorkspaceEnv(value){if(RUNTIME_ENV_VALUES.includes(value)){return value}
5
+ throw CliErrors.validation(`Invalid env "${value}". Allowed: ${RUNTIME_ENV_VALUES.join(", ")}`)}function buildWorkspaceMessage(configPath,appName,appcode,env){const target=appName?`${appName} (${appcode})`:appcode;const envLine=env?`\nEnv: ${env}`:"";return`Workspace configured.\nConfig file: ${configPath}\nDefault app: ${target}${envLine}\nAccessKey: not written`}function isRecord(value){return typeof value==="object"&&value!==null&&!Array.isArray(value)}function hasWorkspaceAppBinding(config){if(typeof config.appcode==="string"&&config.appcode.trim().length>0){return true}if(typeof config.defaultApp!=="string"||!config.defaultApp.trim())return false;if(!isRecord(config.apps))return false;const activeProfile=config.apps[config.defaultApp.trim()];return isRecord(activeProfile)&&typeof activeProfile.appcode==="string"&&activeProfile.appcode.trim().length>0}function assertWorkspaceCommandState(command,config){const initialized=hasWorkspaceAppBinding(config)
6
+ ;if(command==="init"&&initialized){throw CliErrors.validation("Workspace app context is already initialized.",`Use \`${CLI_BIN_NAME} workspace use --app <name>\` or \`${CLI_BIN_NAME} workspace use --appcode <code>\` to change it.`)}if(command==="use"&&!initialized){throw CliErrors.validation("Workspace app context is not initialized.",`Run \`${CLI_BIN_NAME} workspace init --app <name>\` or \`${CLI_BIN_NAME} workspace init --appcode <code>\` first.`)}}function makeWorkspaceCommand(command){return{service:"workspace",command:command,description:command==="init"?"Initialize app context for the current working directory when no app is bound yet":"Change the app context already bound to the current working directory",risk:"write",
7
+ confirmationDescription:command==="init"?"Writes Lovrabet project config in the current working directory when no app is bound yet, and sets the selected app as the directory default. AccessKey is not written.":"Updates the app binding already present in the current working directory and sets the selected app as the directory default. AccessKey is not written.",requiresAuth:false,requiresAppCode:false,hasFormat:true,flags:WORKSPACE_USE_FLAGS,async execute(ctx){return executeWorkspaceUse(ctx,command)}}}export const workspaceDefinitions=[makeWorkspaceCommand("init"),makeWorkspaceCommand("use")];
@@ -1 +1,6 @@
1
- const a100_0x176055=a100_0xda19;(function(_0x5b0ab3,_0x40a58c){const _0x428f50=a100_0xda19,_0x10158e=_0x5b0ab3();while(!![]){try{const _0x4d3948=parseInt(_0x428f50(0x1e5))/0x1*(-parseInt(_0x428f50(0x1c2))/0x2)+-parseInt(_0x428f50(0x1b5))/0x3*(parseInt(_0x428f50(0x1f4))/0x4)+-parseInt(_0x428f50(0x1c7))/0x5+-parseInt(_0x428f50(0x1d9))/0x6*(parseInt(_0x428f50(0x1f3))/0x7)+-parseInt(_0x428f50(0x1d0))/0x8+parseInt(_0x428f50(0x1bb))/0x9*(parseInt(_0x428f50(0x1e0))/0xa)+parseInt(_0x428f50(0x1da))/0xb;if(_0x4d3948===_0x40a58c)break;else _0x10158e['push'](_0x10158e['shift']());}catch(_0x302a00){_0x10158e['push'](_0x10158e['shift']());}}}(a100_0x39e3,0x91206));import{existsSync,readFileSync}from'node:fs';import{isAbsolute,resolve}from'node:path';import{CliErrors}from'../errors.js';import{ENTERPRISE_ROUTING_DOMAIN_FIELDS,ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL,REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS}from'../generated/routing-contract.js';export const DOMAIN_CONFIG_FIELDS=[a100_0x176055(0x1cc),a100_0x176055(0x1b3),a100_0x176055(0x1e2),a100_0x176055(0x1e1),a100_0x176055(0x1e6),a100_0x176055(0x1ec)];const DOMAIN_FLAGS={'userDomain':a100_0x176055(0x1bd),'apiDomain':a100_0x176055(0x1db),'runtimeDomain':a100_0x176055(0x1b6),'skillDomain':'skill-domain','kbServiceDomain':'kb-service-domain','harnessDomain':a100_0x176055(0x1b8)};export const LEGACY_DOMAIN_CONFIG_FIELDS=[a100_0x176055(0x1be),a100_0x176055(0x1b4),a100_0x176055(0x1c4),a100_0x176055(0x1f5),a100_0x176055(0x1d8)];const ENTERPRISE_TO_LOCAL_FIELD={'userDomain':a100_0x176055(0x1cc),'apiDomain':a100_0x176055(0x1b3),'runtimeDomain':'runtimeDomain','skillDomain':a100_0x176055(0x1e1),'kbServiceDomain':a100_0x176055(0x1e6),'harnessDomain':a100_0x176055(0x1ec)},ROUTING_CONSUMER=a100_0x176055(0x1f7);function a100_0x39e3(){const _0x23e41e=['api-domain','mode','isArray','filter','Invalid\x20domain\x20config:\x20expected\x20a\x20JSON\x20object.','10mABdqb','skillDomain','runtimeDomain',':\x20\x22','Unsupported\x20routing\x20manifest:\x20expected\x20protocol\x20\x22','1naVfQH','kbServiceDomain',':\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','search','join','domain-config','\x20and\x20has\x20no\x20default.','harnessDomain','\x22\x20is\x20not\x20a\x20valid\x20URL.','Unsupported\x20domain\x20config\x20field(s):\x20','pathname',':\x20expected\x20an\x20HTTPS\x20origin\x20or\x20consumer\x20Domain\x20object.','str','\x22\x20and\x20kind\x20\x22','30681sjRZyu','82048WwsRrc','skillHubDomain','length','lovrabet-cli','enterprise-v1','Enterprise\x20routing\x20manifests\x20cannot\x20be\x20combined\x20with\x20individual\x20Domain\x20flags.','https:','apiDomain','agentDomain','21KDmTWv','runtime-domain','password','harness-domain','default','legacy','6994827uwiHKG','keys','user-domain','host',':\x20expected\x20a\x20non-empty\x20HTTPS\x20origin.','domains','Invalid\x20enterprise\x20routing\x20manifest:\x20domains\x20must\x20be\x20an\x20object.','1724924waEyry','validation','platformDomain','parse','Domain\x20config\x20file\x20not\x20found:\x20','2679495tVcUyk','Invalid\x20domain\x20config\x20JSON:\x20','For\x20internal\x20deployments,\x20terminate\x20TLS\x20at\x20the\x20ingress,\x20reverse\x20proxy,\x20or\x20load\x20balancer;\x20an\x20internal\x20CA\x20is\x20supported.','utf8','Invalid\x20','userDomain','kind','Enterprise\x20','includes','1318832HKyNPo','string','Update\x20the\x20manifest\x20so\x20both\x20CLIs\x20consume\x20the\x20same\x20routing\x20data.','Allowed\x20fields:\x20','object','trim','cwd','protocol','kbDomain','510BLLFfi','20862479QmMkgO'];a100_0x39e3=function(){return _0x23e41e;};return a100_0x39e3();}export function normalizeDomainOrigin(_0x3244ef,_0x4aff6c){const _0xf53260=a100_0x176055;if(typeof _0x4aff6c!=='string'||!_0x4aff6c[_0xf53260(0x1d5)]())throw CliErrors[_0xf53260(0x1c3)](_0xf53260(0x1cb)+_0x3244ef+_0xf53260(0x1bf));let _0xe92358;try{_0xe92358=new URL(_0x4aff6c[_0xf53260(0x1d5)]());}catch{throw CliErrors[_0xf53260(0x1c3)](_0xf53260(0x1cb)+_0x3244ef+_0xf53260(0x1e3)+_0x4aff6c+_0xf53260(0x1ed));}if(_0xe92358['protocol']!==_0xf53260(0x1b2)||_0xe92358['username']||_0xe92358[_0xf53260(0x1b7)]||_0xe92358[_0xf53260(0x1ef)]!=='/'&&_0xe92358['pathname']!==''||_0xe92358[_0xf53260(0x1e8)]||_0xe92358['hash'])throw CliErrors['validation'](_0xf53260(0x1cb)+_0x3244ef+_0xf53260(0x1e7),_0xf53260(0x1c9));return _0xe92358['origin'];}function a100_0xda19(_0x38b02f,_0x28c34e){_0x38b02f=_0x38b02f-0x1b2;const _0x39e3e9=a100_0x39e3();let _0xda19c9=_0x39e3e9[_0x38b02f];return _0xda19c9;}export function normalizeRoutingDomainValue(_0xfd7fb1,_0x1ae4fe){const _0x2645ac=a100_0x176055;if(typeof _0x1ae4fe===_0x2645ac(0x1d1))return normalizeDomainOrigin(_0xfd7fb1,_0x1ae4fe);if(!_0x1ae4fe||typeof _0x1ae4fe!==_0x2645ac(0x1d4)||Array['isArray'](_0x1ae4fe))throw CliErrors[_0x2645ac(0x1c3)](_0x2645ac(0x1cb)+_0xfd7fb1+_0x2645ac(0x1f0));const _0x3541bc=_0x1ae4fe,_0x391cec=_0x3541bc[ROUTING_CONSUMER]??_0x3541bc[_0x2645ac(0x1b9)];if(_0x391cec===undefined)throw CliErrors[_0x2645ac(0x1c3)](_0x2645ac(0x1ce)+_0xfd7fb1+'\x20does\x20not\x20provide\x20a\x20Domain\x20for\x20'+ROUTING_CONSUMER+_0x2645ac(0x1eb));return normalizeDomainOrigin(_0xfd7fb1,_0x391cec);}export function resolveEnterpriseRoutingConfig(_0x1cd503){const _0x14d9c8=a100_0x176055;if(_0x1cd503===undefined)return undefined;if(!_0x1cd503||typeof _0x1cd503!=='object'||Array[_0x14d9c8(0x1dd)](_0x1cd503))throw CliErrors[_0x14d9c8(0x1c3)]('Invalid\x20enterprise\x20routing\x20config:\x20expected\x20an\x20object.');return parseEnterpriseRoutingManifest(_0x1cd503)[_0x14d9c8(0x1c0)];}export function readDomainConfigInput(_0x9a1c0c){const _0x269d5a=a100_0x176055,_0x546520=isAbsolute(_0x9a1c0c)?_0x9a1c0c:resolve(process[_0x269d5a(0x1d6)](),_0x9a1c0c);if(!existsSync(_0x546520))throw CliErrors[_0x269d5a(0x1c3)](_0x269d5a(0x1c6)+_0x546520);let _0xd627f;try{_0xd627f=JSON[_0x269d5a(0x1c5)](readFileSync(_0x546520,_0x269d5a(0x1ca)));}catch{throw CliErrors[_0x269d5a(0x1c3)](_0x269d5a(0x1c8)+_0x546520);}if(!_0xd627f||typeof _0xd627f!==_0x269d5a(0x1d4)||Array[_0x269d5a(0x1dd)](_0xd627f))throw CliErrors[_0x269d5a(0x1c3)](_0x269d5a(0x1df));const _0x16e3b6=_0xd627f;if('protocol'in _0x16e3b6)return parseEnterpriseRoutingManifest(_0x16e3b6);const _0x5a1e3a=Object[_0x269d5a(0x1bc)](_0x16e3b6)[_0x269d5a(0x1de)](_0x26d93d=>!DOMAIN_CONFIG_FIELDS[_0x269d5a(0x1cf)](_0x26d93d));if(_0x5a1e3a[_0x269d5a(0x1f6)]>0x0)throw CliErrors[_0x269d5a(0x1c3)](_0x269d5a(0x1ee)+_0x5a1e3a[_0x269d5a(0x1e9)](',\x20'),_0x269d5a(0x1d3)+DOMAIN_CONFIG_FIELDS[_0x269d5a(0x1e9)](',\x20'));const _0x3a2285={};for(const _0x274fdc of DOMAIN_CONFIG_FIELDS){_0x16e3b6[_0x274fdc]!==undefined&&(_0x3a2285[_0x274fdc]=normalizeDomainOrigin(_0x274fdc,_0x16e3b6[_0x274fdc]));}if(Object['keys'](_0x3a2285)['length']===0x0)throw CliErrors[_0x269d5a(0x1c3)]('Invalid\x20domain\x20config:\x20provide\x20at\x20least\x20one\x20supported\x20Domain.');return{'mode':_0x269d5a(0x1ba),'domains':_0x3a2285};}export function readDomainConfig(_0x27f8fc){return readDomainConfigInput(_0x27f8fc)['domains'];}export function resolveDomainConfigInput(_0x20ebf2){const _0x5a4397=a100_0x176055,_0x390348=(_0x20ebf2[_0x5a4397(0x1f1)](_0x5a4397(0x1ea))||'')['trim'](),_0x224aff=_0x390348?readDomainConfigInput(_0x390348):{'mode':_0x5a4397(0x1ba),'domains':{}},_0x438f37=DOMAIN_CONFIG_FIELDS['filter'](_0x15c687=>Boolean((_0x20ebf2[_0x5a4397(0x1f1)](DOMAIN_FLAGS[_0x15c687])||'')[_0x5a4397(0x1d5)]()));if(_0x224aff[_0x5a4397(0x1dc)]==='enterprise-v1'&&_0x438f37[_0x5a4397(0x1f6)]>0x0)throw CliErrors[_0x5a4397(0x1c3)](_0x5a4397(0x1f9),_0x5a4397(0x1d2));for(const _0x42f9ee of DOMAIN_CONFIG_FIELDS){const _0x54575e=(_0x20ebf2['str'](DOMAIN_FLAGS[_0x42f9ee])||'')[_0x5a4397(0x1d5)]();if(_0x54575e)_0x224aff[_0x5a4397(0x1c0)][_0x42f9ee]=normalizeDomainOrigin(_0x42f9ee,_0x54575e);}return _0x224aff;}export function resolveDomainFlags(_0x2663ac){const _0x2dbd20=a100_0x176055;return resolveDomainConfigInput(_0x2663ac)[_0x2dbd20(0x1c0)];}export function parseEnterpriseRoutingManifest(_0xe7a12){const _0x5bc58e=a100_0x176055;if(_0xe7a12[_0x5bc58e(0x1d7)]!==ENTERPRISE_ROUTING_PROTOCOL||_0xe7a12[_0x5bc58e(0x1cd)]!==ENTERPRISE_ROUTING_KIND)throw CliErrors['validation'](_0x5bc58e(0x1e4)+ENTERPRISE_ROUTING_PROTOCOL+_0x5bc58e(0x1f2)+ENTERPRISE_ROUTING_KIND+'\x22.');if(!_0xe7a12[_0x5bc58e(0x1c0)]||typeof _0xe7a12[_0x5bc58e(0x1c0)]!==_0x5bc58e(0x1d4)||Array[_0x5bc58e(0x1dd)](_0xe7a12[_0x5bc58e(0x1c0)]))throw CliErrors[_0x5bc58e(0x1c3)](_0x5bc58e(0x1c1));const _0x24d97a=_0xe7a12[_0x5bc58e(0x1c0)],_0x1decb6=REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS[_0x5bc58e(0x1de)](_0x2915d7=>_0x24d97a[_0x2915d7]===undefined);if(_0x1decb6['length']>0x0)throw CliErrors[_0x5bc58e(0x1c3)]('Enterprise\x20routing\x20manifest\x20is\x20missing\x20required\x20Domain(s):\x20'+_0x1decb6[_0x5bc58e(0x1e9)](',\x20'));const _0xf7e2d0={},_0x294424={};for(const _0x2396a9 of ENTERPRISE_ROUTING_DOMAIN_FIELDS){const _0x9534d9=_0x24d97a[_0x2396a9];if(_0x9534d9===undefined)continue;const _0x4029e3=normalizeRoutingDomainValue(_0x2396a9,_0x9534d9);_0xf7e2d0[_0x2396a9]=_0x4029e3;const _0x5b3f6b=ENTERPRISE_TO_LOCAL_FIELD[_0x2396a9];_0x5b3f6b&&(_0x294424[_0x5b3f6b]=_0x4029e3);}return{'mode':_0x5bc58e(0x1f8),'domains':_0x294424,'manifestDomains':_0xf7e2d0};}
1
+ import{existsSync,readFileSync}from"node:fs";import{isAbsolute,resolve}from"node:path";import{CliErrors}from"../errors.js";import{ENTERPRISE_ROUTING_DOMAIN_FIELDS,ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL,REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS}from"../generated/routing-contract.js";export const DOMAIN_CONFIG_FIELDS=["userDomain","apiDomain","runtimeDomain","skillDomain","kbServiceDomain","harnessDomain"];const DOMAIN_FLAGS={userDomain:"user-domain",apiDomain:"api-domain",runtimeDomain:"runtime-domain",skillDomain:"skill-domain",kbServiceDomain:"kb-service-domain",harnessDomain:"harness-domain"};export const LEGACY_DOMAIN_CONFIG_FIELDS=["host","agentDomain","platformDomain","skillHubDomain","kbDomain"];const ENTERPRISE_TO_LOCAL_FIELD={userDomain:"userDomain",apiDomain:"apiDomain",runtimeDomain:"runtimeDomain",skillDomain:"skillDomain",kbServiceDomain:"kbServiceDomain",harnessDomain:"harnessDomain"};const ROUTING_CONSUMER="lovrabet-cli"
2
+ ;export function normalizeDomainOrigin(field,input){if(typeof input!=="string"||!input.trim()){throw CliErrors.validation(`Invalid ${field}: expected a non-empty HTTPS origin.`)}let url;try{url=new URL(input.trim())}catch{throw CliErrors.validation(`Invalid ${field}: "${input}" is not a valid URL.`)}if(url.protocol!=="https:"||url.username||url.password||url.pathname!=="/"&&url.pathname!==""||url.search||url.hash){throw CliErrors.validation(`Invalid ${field}: expected an HTTPS origin without credentials, path, query, or fragment.`,"For internal deployments, terminate TLS at the ingress, reverse proxy, or load balancer; an internal CA is supported.")}return url.origin}export function normalizeRoutingDomainValue(field,input){if(typeof input==="string")return normalizeDomainOrigin(field,input);if(!input||typeof input!=="object"||Array.isArray(input)){throw CliErrors.validation(`Invalid ${field}: expected an HTTPS origin or consumer Domain object.`)}const source=input
3
+ ;const resolved=source[ROUTING_CONSUMER]??source.default;if(resolved===undefined){throw CliErrors.validation(`Enterprise ${field} does not provide a Domain for ${ROUTING_CONSUMER} and has no default.`)}return normalizeDomainOrigin(field,resolved)}export function resolveEnterpriseRoutingConfig(input){if(input===undefined)return undefined;if(!input||typeof input!=="object"||Array.isArray(input)){throw CliErrors.validation("Invalid enterprise routing config: expected an object.")}return parseEnterpriseRoutingManifest(input).domains}export function readDomainConfigInput(filePath){const absolutePath=isAbsolute(filePath)?filePath:resolve(process.cwd(),filePath);if(!existsSync(absolutePath)){throw CliErrors.validation(`Domain config file not found: ${absolutePath}`)}let parsed;try{parsed=JSON.parse(readFileSync(absolutePath,"utf8"))}catch{throw CliErrors.validation(`Invalid domain config JSON: ${absolutePath}`)}if(!parsed||typeof parsed!=="object"||Array.isArray(parsed)){
4
+ throw CliErrors.validation("Invalid domain config: expected a JSON object.")}const source=parsed;if("protocol"in source)return parseEnterpriseRoutingManifest(source);const unknown=Object.keys(source).filter(key=>!DOMAIN_CONFIG_FIELDS.includes(key));if(unknown.length>0){throw CliErrors.validation(`Unsupported domain config field(s): ${unknown.join(", ")}`,`Allowed fields: ${DOMAIN_CONFIG_FIELDS.join(", ")}`)}const result={};for(const field of DOMAIN_CONFIG_FIELDS){if(source[field]!==undefined){result[field]=normalizeDomainOrigin(field,source[field])}}if(Object.keys(result).length===0){throw CliErrors.validation("Invalid domain config: provide at least one supported Domain.")}return{mode:"legacy",domains:result}}export function readDomainConfig(filePath){return readDomainConfigInput(filePath).domains}export function resolveDomainConfigInput(ctx){const filePath=(ctx.str("domain-config")||"").trim();const input=filePath?readDomainConfigInput(filePath):{mode:"legacy",domains:{}}
5
+ ;const explicitFields=DOMAIN_CONFIG_FIELDS.filter(field=>Boolean((ctx.str(DOMAIN_FLAGS[field])||"").trim()));if(input.mode==="enterprise-v1"&&explicitFields.length>0){throw CliErrors.validation("Enterprise routing manifests cannot be combined with individual Domain flags.","Update the manifest so both CLIs consume the same routing data.")}for(const field of DOMAIN_CONFIG_FIELDS){const value=(ctx.str(DOMAIN_FLAGS[field])||"").trim();if(value)input.domains[field]=normalizeDomainOrigin(field,value)}return input}export function resolveDomainFlags(ctx){return resolveDomainConfigInput(ctx).domains}export function parseEnterpriseRoutingManifest(source){if(source.protocol!==ENTERPRISE_ROUTING_PROTOCOL||source.kind!==ENTERPRISE_ROUTING_KIND){throw CliErrors.validation(`Unsupported routing manifest: expected protocol "${ENTERPRISE_ROUTING_PROTOCOL}" and kind "${ENTERPRISE_ROUTING_KIND}".`)}if(!source.domains||typeof source.domains!=="object"||Array.isArray(source.domains)){
6
+ throw CliErrors.validation("Invalid enterprise routing manifest: domains must be an object.")}const rawDomains=source.domains;const missing=REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS.filter(field=>rawDomains[field]===undefined);if(missing.length>0){throw CliErrors.validation(`Enterprise routing manifest is missing required Domain(s): ${missing.join(", ")}`)}const manifestDomains={};const domains={};for(const field of ENTERPRISE_ROUTING_DOMAIN_FIELDS){const value=rawDomains[field];if(value===undefined)continue;const normalized=normalizeRoutingDomainValue(field,value);manifestDomains[field]=normalized;const localField=ENTERPRISE_TO_LOCAL_FIELD[field];if(localField){domains[localField]=normalized}}return{mode:"enterprise-v1",domains:domains,manifestDomains:manifestDomains}}
@@ -1 +1,5 @@
1
- function a101_0x1589(){const _0x2c0f70=['enumValues','zh-CN','Default\x20page\x20size','toLowerCase','5nrpnzr','3180qfUfnW','160596UGMcRG','Lovrabet\x20region','21872npduTT','App\x20locale\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','2246827fTpvox','env','2637KfMtxH','141925TPwYBM','filter','join','Config\x20key.\x20Top-level:\x20','entries','Override\x20user\x20domain','Native\x20Lovrabet\x20tool\x20availability\x20in\x20the\x20current\x20execution\x20host','importable','locale','6770FMQQKE','Override\x20KB\x20Service\x20domain','en-US','90rjqJOI','fromEntries','legacyCompatOnly','riskLevel','Target\x20environment','Override\x20SkillHub\x20domain',';\x20local\x20alias:\x20apps.<alias>.appcode','defaultValue','map','has','8XGHrXc','Override\x20runtime\x20domain','nativeToolAvailable','1063434NTwEDR'];a101_0x1589=function(){return _0x2c0f70;};return a101_0x1589();}const a101_0x558c02=a101_0x44a3;(function(_0x1908f6,_0x23f410){const _0xf448f3=a101_0x44a3,_0x56050a=_0x1908f6();while(!![]){try{const _0x13d7cf=-parseInt(_0xf448f3(0x150))/0x1+-parseInt(_0xf448f3(0x160))/0x2+parseInt(_0xf448f3(0x13c))/0x3*(-parseInt(_0xf448f3(0x152))/0x4)+parseInt(_0xf448f3(0x14e))/0x5*(parseInt(_0xf448f3(0x149))/0x6)+-parseInt(_0xf448f3(0x157))/0x7*(parseInt(_0xf448f3(0x146))/0x8)+-parseInt(_0xf448f3(0x156))/0x9*(-parseInt(_0xf448f3(0x14f))/0xa)+parseInt(_0xf448f3(0x154))/0xb;if(_0x13d7cf===_0x23f410)break;else _0x56050a['push'](_0x56050a['shift']());}catch(_0x3df6c0){_0x56050a['push'](_0x56050a['shift']());}}}(a101_0x1589,0x1eda6));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES}from'../constant/region.js';function a101_0x44a3(_0x41611b,_0x4c4278){_0x41611b=_0x41611b-0x13a;const _0x158944=a101_0x1589();let _0x44a340=_0x158944[_0x41611b];return _0x44a340;}export const CONFIG_FIELD_SCHEMAS={'routing':{'description':'Versioned\x20enterprise\x20routing\x20manifest','topLevel':!![]},'region':{'description':a101_0x558c02(0x151),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':ENABLED_LOVRABET_REGION_VALUES,'defaultValue':DEFAULT_LOVRABET_REGION,'importable':!![]},'env':{'description':a101_0x558c02(0x140),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a101_0x558c02(0x155)],'importable':!![]},'format':{'description':'Default\x20output\x20format','topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES['format'],'importable':!![]},'pageSize':{'description':a101_0x558c02(0x14c),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':'Override\x20API\x20domain','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':a101_0x558c02(0x15c),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a101_0x558c02(0x147),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'skillDomain':{'description':a101_0x558c02(0x141),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'kbServiceDomain':{'description':a101_0x558c02(0x13a),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'harnessDomain':{'description':'Override\x20Harness\x20domain','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':'Access\x20key\x20(client-ak\x20auth)','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':'Risk\x20level','topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a101_0x558c02(0x13f)],'importable':!![]},'nativeToolAvailable':{'description':a101_0x558c02(0x15d),'topLevel':!![],'defaultValue':![]},'locale':{'description':a101_0x558c02(0x153),'topLevel':!![],'cliSettableTopLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a101_0x558c02(0x15f)],'importable':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object[a101_0x558c02(0x15b)](CONFIG_FIELD_SCHEMAS)[a101_0x558c02(0x158)](([,_0x52a97c])=>_0x52a97c['cliSettableTopLevel'])[a101_0x558c02(0x144)](([_0x2b1e9f])=>_0x2b1e9f));export const CLI_PROTECTED_CONFIG_KEYS=new Set([a101_0x558c02(0x13f),a101_0x558c02(0x148)]);export const CONFIG_ENUM_VALUES=Object[a101_0x558c02(0x13d)](Object[a101_0x558c02(0x15b)](CONFIG_FIELD_SCHEMAS)[a101_0x558c02(0x158)](([,_0x4185cb])=>_0x4185cb[a101_0x558c02(0x14a)])['map'](([_0x4b885c,_0x3c0876])=>[_0x4b885c,[..._0x3c0876[a101_0x558c02(0x14a)]||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object['entries'](CONFIG_FIELD_SCHEMAS)[a101_0x558c02(0x158)](([,_0x39f0dd])=>_0x39f0dd[a101_0x558c02(0x15e)])['map'](([_0x2d8532])=>_0x2d8532);export function getConfigFieldSchema(_0x34cb60){return CONFIG_FIELD_SCHEMAS[_0x34cb60];}export function getConfigEnumValues(_0x3cfa0c){const _0x1c6e6b=a101_0x558c02;return getConfigFieldSchema(_0x3cfa0c)?.[_0x1c6e6b(0x14a)];}export function getConfigDefaultValue(_0x283478){const _0x525b88=a101_0x558c02;return getConfigFieldSchema(_0x283478)?.[_0x525b88(0x143)];}export function isTopLevelConfigKey(_0x202f21){const _0x4271e6=a101_0x558c02;return TOP_LEVEL_CONFIG_KEYS[_0x4271e6(0x145)](_0x202f21);}export function isCliProtectedConfigKey(_0x2b1b5d){const _0x58c8ab=a101_0x558c02;return CLI_PROTECTED_CONFIG_KEYS[_0x58c8ab(0x145)](_0x2b1b5d);}const LOCALE_MAP={'zh':a101_0x558c02(0x14b),'zh-cn':a101_0x558c02(0x14b),'zh_cn':a101_0x558c02(0x14b),'en':'en-US','en-us':'en-US','en_us':a101_0x558c02(0x13b)};export function normalizeLocale(_0x134d4c){const _0x2d121d=a101_0x558c02;if(!_0x134d4c)return null;return LOCALE_MAP[_0x134d4c[_0x2d121d(0x14d)]()]??null;}export function isLegacyCompatConfigKey(_0x2fc1aa){const _0xd2f050=a101_0x558c02;return getConfigFieldSchema(_0x2fc1aa)?.[_0xd2f050(0x13e)]===!![];}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x3a3499){const _0x357309=a101_0x558c02;return[..._0x3a3499][_0x357309(0x159)](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x20b923=a101_0x558c02;return _0x20b923(0x15a)+getTopLevelConfigKeySummary()+_0x20b923(0x142);}export function buildAppProfileListFields(_0x3ee629){return{'env':_0x3ee629,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
1
+ import{DEFAULT_CONFIG_VALUES}from"../constant/defaults.js";import{RUNTIME_ENV_VALUES}from"../constant/env.js";import{OUTPUT_FORMAT_VALUES}from"../constant/output.js";import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES}from"../constant/region.js";export const CONFIG_FIELD_SCHEMAS={routing:{description:"Versioned enterprise routing manifest",topLevel:true},region:{description:"Lovrabet region",topLevel:true,cliSettableTopLevel:true,enumValues:ENABLED_LOVRABET_REGION_VALUES,defaultValue:DEFAULT_LOVRABET_REGION,importable:true},env:{description:"Target environment",topLevel:true,cliSettableTopLevel:true,enumValues:RUNTIME_ENV_VALUES,defaultValue:DEFAULT_CONFIG_VALUES.env,importable:true},format:{description:"Default output format",topLevel:true,cliSettableTopLevel:true,enumValues:OUTPUT_FORMAT_VALUES,defaultValue:DEFAULT_CONFIG_VALUES.format,importable:true},pageSize:{description:"Default page size",topLevel:true,cliSettableTopLevel:true,importable:true},apiDomain:{
2
+ description:"Override API domain",topLevel:true,cliSettableTopLevel:true,importable:true},userDomain:{description:"Override user domain",topLevel:true,cliSettableTopLevel:true,importable:true},runtimeDomain:{description:"Override runtime domain",topLevel:true,cliSettableTopLevel:true,importable:true},skillDomain:{description:"Override SkillHub domain",topLevel:true,cliSettableTopLevel:true,importable:true},kbServiceDomain:{description:"Override KB Service domain",topLevel:true,cliSettableTopLevel:true,importable:true},harnessDomain:{description:"Override Harness domain",topLevel:true,cliSettableTopLevel:true,importable:true},accessKey:{description:"Access key (client-ak auth)",topLevel:true,cliSettableTopLevel:true,importable:true},riskLevel:{description:"Risk level",topLevel:true,defaultValue:DEFAULT_CONFIG_VALUES.riskLevel,importable:true},nativeToolAvailable:{description:"Native Lovrabet tool availability in the current execution host",topLevel:true,defaultValue:false},locale:{
3
+ description:"App locale (not CLI language; reserved for later app use)",topLevel:true,cliSettableTopLevel:true,defaultValue:DEFAULT_CONFIG_VALUES.locale,importable:true}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object.entries(CONFIG_FIELD_SCHEMAS).filter(([,schema])=>schema.cliSettableTopLevel).map(([key])=>key));export const CLI_PROTECTED_CONFIG_KEYS=new Set(["riskLevel","nativeToolAvailable"]);export const CONFIG_ENUM_VALUES=Object.fromEntries(Object.entries(CONFIG_FIELD_SCHEMAS).filter(([,schema])=>schema.enumValues).map(([key,schema])=>[key,[...schema.enumValues||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object.entries(CONFIG_FIELD_SCHEMAS).filter(([,schema])=>schema.importable).map(([key])=>key);export function getConfigFieldSchema(key){return CONFIG_FIELD_SCHEMAS[key]}export function getConfigEnumValues(key){return getConfigFieldSchema(key)?.enumValues}export function getConfigDefaultValue(key){return getConfigFieldSchema(key)?.defaultValue}
4
+ export function isTopLevelConfigKey(key){return TOP_LEVEL_CONFIG_KEYS.has(key)}export function isCliProtectedConfigKey(key){return CLI_PROTECTED_CONFIG_KEYS.has(key)}const LOCALE_MAP={zh:"zh-CN","zh-cn":"zh-CN",zh_cn:"zh-CN",en:"en-US","en-us":"en-US",en_us:"en-US"};export function normalizeLocale(value){if(!value)return null;return LOCALE_MAP[value.toLowerCase()]??null}export function isLegacyCompatConfigKey(key){return getConfigFieldSchema(key)?.legacyCompatOnly===true}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS]}export function formatConfigKeyList(keys){return[...keys].join(", ")}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList())}export function getConfigCommandKeyDescription(){return`Config key. Top-level: ${getTopLevelConfigKeySummary()}; local alias: apps.<alias>.appcode`}export function buildAppProfileListFields(fallbackEnv){return{env:fallbackEnv,hasAccessKey:false,format:null,pageSize:null,
5
+ riskLevel:null,locale:null}}
@@ -1 +1 @@
1
- const a102_0x6867ec=a102_0x16dd;(function(_0x53f9e3,_0x1c71ce){const _0x412f90=a102_0x16dd,_0x4fb76c=_0x53f9e3();while(!![]){try{const _0x1b8666=parseInt(_0x412f90(0x18b))/0x1*(parseInt(_0x412f90(0x18d))/0x2)+parseInt(_0x412f90(0x188))/0x3*(parseInt(_0x412f90(0x182))/0x4)+-parseInt(_0x412f90(0x189))/0x5+parseInt(_0x412f90(0x187))/0x6*(-parseInt(_0x412f90(0x18a))/0x7)+-parseInt(_0x412f90(0x180))/0x8*(-parseInt(_0x412f90(0x18c))/0x9)+parseInt(_0x412f90(0x186))/0xa*(-parseInt(_0x412f90(0x184))/0xb)+parseInt(_0x412f90(0x18e))/0xc;if(_0x1b8666===_0x1c71ce)break;else _0x4fb76c['push'](_0x4fb76c['shift']());}catch(_0x292368){_0x4fb76c['push'](_0x4fb76c['shift']());}}}(a102_0x40cf,0xbb2e4));function a102_0x16dd(_0x5468f4,_0x1e3cbe){_0x5468f4=_0x5468f4-0x180;const _0x40cfc1=a102_0x40cf();let _0x16dd68=_0x40cfc1[_0x5468f4];return _0x16dd68;}export const APP_PUBLISH_STATUS={'Published':a102_0x6867ec(0x181),'Unpublished':a102_0x6867ec(0x185)};export const RUNTIME_ACCESSIBLE_APP_STATUS=APP_PUBLISH_STATUS[a102_0x6867ec(0x183)];function a102_0x40cf(){const _0x54458b=['56147KZrfJC','314721aguMGG','14wFFanH','24046356CAZuWQ','56mItPzI','PUBLISHED','28NKhasP','Published','3538865mSRgCJ','UNPUBLISH','40QeJkxg','44706ggAMDU','264741nIpLGp','3086115otmFao','553JrILJy'];a102_0x40cf=function(){return _0x54458b;};return a102_0x40cf();}
1
+ export const APP_PUBLISH_STATUS={Published:"PUBLISHED",Unpublished:"UNPUBLISH"};export const RUNTIME_ACCESSIBLE_APP_STATUS=APP_PUBLISH_STATUS.Published;
@@ -1 +1 @@
1
- const a103_0x3ccb1a=a103_0x2c31;(function(_0x25d359,_0x31aa2e){const _0x10eaf2=a103_0x2c31,_0x54009b=_0x25d359();while(!![]){try{const _0x41b260=-parseInt(_0x10eaf2(0x18c))/0x1+parseInt(_0x10eaf2(0x184))/0x2*(-parseInt(_0x10eaf2(0x18b))/0x3)+-parseInt(_0x10eaf2(0x187))/0x4*(-parseInt(_0x10eaf2(0x18a))/0x5)+parseInt(_0x10eaf2(0x182))/0x6*(parseInt(_0x10eaf2(0x188))/0x7)+-parseInt(_0x10eaf2(0x181))/0x8*(parseInt(_0x10eaf2(0x18d))/0x9)+-parseInt(_0x10eaf2(0x18e))/0xa*(-parseInt(_0x10eaf2(0x186))/0xb)+parseInt(_0x10eaf2(0x189))/0xc*(parseInt(_0x10eaf2(0x18f))/0xd);if(_0x41b260===_0x31aa2e)break;else _0x54009b['push'](_0x54009b['shift']());}catch(_0x23158d){_0x54009b['push'](_0x54009b['shift']());}}}(a103_0x38e1,0x1cf49));export const AUTH_MODE={'ClientAk':a103_0x3ccb1a(0x183)};function a103_0x2c31(_0x2f0631,_0x334503){_0x2f0631=_0x2f0631-0x181;const _0x38e17d=a103_0x38e1();let _0x2c312b=_0x38e17d[_0x2f0631];return _0x2c312b;}export function isAuthMode(_0x4f2c57){const _0x12e21b=a103_0x3ccb1a;return _0x4f2c57===AUTH_MODE[_0x12e21b(0x185)];}function a103_0x38e1(){const _0x2c7915=['client-ak','48WcJbLl','ClientAk','704858OWesSA','8BHVCoI','27398zFzWZA','132udnaik','535155JNYYAR','2784vqGsMG','236293dGWisn','27KhbfWv','30NNzLgm','12038RQLEYs','553648bjyejw','258moBVSe'];a103_0x38e1=function(){return _0x2c7915;};return a103_0x38e1();}
1
+ export const AUTH_MODE={ClientAk:"client-ak"};export function isAuthMode(v){return v===AUTH_MODE.ClientAk}
@@ -1 +1,3 @@
1
- const a104_0x59f0e4=a104_0x1e87;function a104_0x1e87(_0x312902,_0x18e8df){_0x312902=_0x312902-0x1ba;const _0x23b7d2=a104_0x23b7();let _0x1e875a=_0x23b7d2[_0x312902];return _0x1e875a;}(function(_0x312098,_0x10b72f){const _0x48cbd3=a104_0x1e87,_0x183264=_0x312098();while(!![]){try{const _0x7875ff=-parseInt(_0x48cbd3(0x1cb))/0x1*(-parseInt(_0x48cbd3(0x1ce))/0x2)+parseInt(_0x48cbd3(0x1bc))/0x3+parseInt(_0x48cbd3(0x1c4))/0x4+parseInt(_0x48cbd3(0x1c6))/0x5*(parseInt(_0x48cbd3(0x1e8))/0x6)+-parseInt(_0x48cbd3(0x1e5))/0x7*(-parseInt(_0x48cbd3(0x1d6))/0x8)+-parseInt(_0x48cbd3(0x1da))/0x9*(parseInt(_0x48cbd3(0x1d9))/0xa)+-parseInt(_0x48cbd3(0x1d7))/0xb;if(_0x7875ff===_0x10b72f)break;else _0x183264['push'](_0x183264['shift']());}catch(_0x359a8){_0x183264['push'](_0x183264['shift']());}}}(a104_0x23b7,0xa1fe0));import{PRODUCT_CONFIG}from'../constant/product.js';function a104_0x23b7(){const _0x4945f5=['4544632yGiwbI','map','5DiOoox','fromEntries','<code>','env','Preview\x20operation\x20without\x20executing','1mjjPkV','sqlcode','clear','770406MsDmVU','type','non-interactive','json\x20|\x20pretty\x20|\x20compress','cliDisplayName','Show\x20help','nonInteractive','app','8YprlxN','27101382tzNFGL','string','70GTNVQW','160713PEBhJf','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','<name>','Force\x20non-interactive\x20mode\x20(CI)','JSON\x20params\x20for\x20execute\x20commands','format','Name\x20filter','help','Clear\x20output','dry-run','params','441518VzqDxg','Override\x20appcode','name','5614386bvnkKG','Record\x20ID','SQL\x20query\x20code','Output\x20format','2196345OPeDeX','cliBinName','appcode','boolean','yes','Use\x20global\x20config\x20scope','verbose','global'];a104_0x23b7=function(){return _0x4945f5;};return a104_0x23b7();}import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';export const CLI_BIN_NAME=PRODUCT_CONFIG[a104_0x59f0e4(0x1bd)];export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a104_0x59f0e4(0x1d2)];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':a104_0x59f0e4(0x1be),'meowKey':a104_0x59f0e4(0x1be),'type':a104_0x59f0e4(0x1d8),'description':a104_0x59f0e4(0x1e6),'hint':a104_0x59f0e4(0x1c8)},{'name':a104_0x59f0e4(0x1d5),'meowKey':a104_0x59f0e4(0x1d5),'type':a104_0x59f0e4(0x1d8),'description':'Select\x20app\x20profile\x20by\x20name','hint':a104_0x59f0e4(0x1dc)},{'name':'env','meowKey':a104_0x59f0e4(0x1c9),'type':'string','description':'Environment','hint':'production\x20|\x20development\x20|\x20daily'},{'name':a104_0x59f0e4(0x1df),'meowKey':'format','type':a104_0x59f0e4(0x1d8),'description':a104_0x59f0e4(0x1bb),'hint':a104_0x59f0e4(0x1d1)},{'name':'jq','meowKey':'jq','type':a104_0x59f0e4(0x1d8),'description':a104_0x59f0e4(0x1db),'hint':'<expr>'},{'name':a104_0x59f0e4(0x1e3),'meowKey':'dryRun','type':a104_0x59f0e4(0x1bf),'description':a104_0x59f0e4(0x1ca)},{'name':a104_0x59f0e4(0x1c0),'meowKey':a104_0x59f0e4(0x1c0),'type':'boolean','description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a104_0x59f0e4(0x1d0),'meowKey':a104_0x59f0e4(0x1d4),'type':'boolean','description':a104_0x59f0e4(0x1dd)},{'name':a104_0x59f0e4(0x1c3),'meowKey':'global','type':'boolean','description':a104_0x59f0e4(0x1c1)},{'name':'ci','meowKey':'ci','type':a104_0x59f0e4(0x1bf),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':'help','meowKey':a104_0x59f0e4(0x1e1),'type':a104_0x59f0e4(0x1bf),'description':a104_0x59f0e4(0x1d3)},{'name':'id','meowKey':'id','type':a104_0x59f0e4(0x1d8),'description':a104_0x59f0e4(0x1e9),'hidden':!![]},{'name':a104_0x59f0e4(0x1e7),'meowKey':a104_0x59f0e4(0x1e7),'type':a104_0x59f0e4(0x1d8),'description':a104_0x59f0e4(0x1e0),'hidden':!![]},{'name':'sqlcode','meowKey':a104_0x59f0e4(0x1cc),'type':a104_0x59f0e4(0x1d8),'description':a104_0x59f0e4(0x1ba),'hidden':!![]},{'name':'params','meowKey':a104_0x59f0e4(0x1e4),'type':a104_0x59f0e4(0x1d8),'description':a104_0x59f0e4(0x1de),'hidden':!![]},{'name':a104_0x59f0e4(0x1c2),'meowKey':a104_0x59f0e4(0x1c2),'type':a104_0x59f0e4(0x1bf),'description':'Verbose\x20output','hidden':!![]},{'name':a104_0x59f0e4(0x1cd),'meowKey':a104_0x59f0e4(0x1cd),'type':a104_0x59f0e4(0x1bf),'description':a104_0x59f0e4(0x1e2),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a104_0x59f0e4(0x1be),a104_0x59f0e4(0x1d5),a104_0x59f0e4(0x1c9),'format','jq',a104_0x59f0e4(0x1e3),a104_0x59f0e4(0x1c0),'non-interactive','ci']);export function buildMeowFlags(){const _0x126e05=a104_0x59f0e4;return Object[_0x126e05(0x1c7)](GLOBAL_FLAGS[_0x126e05(0x1c5)](_0x23a904=>[_0x23a904['meowKey'],{'type':_0x23a904[_0x126e05(0x1cf)]}]));}
1
+ import{PRODUCT_CONFIG}from"../constant/product.js";import{LOVRABET_NPM_PACKAGE_NAME}from"../constant/distribution.js";export const CLI_BIN_NAME=PRODUCT_CONFIG.cliBinName;export const CLI_DISPLAY_NAME=PRODUCT_CONFIG.cliDisplayName;export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{name:"appcode",meowKey:"appcode",type:"string",description:"Override appcode",hint:"<code>"},{name:"app",meowKey:"app",type:"string",description:"Select app profile by name",hint:"<name>"},{name:"env",meowKey:"env",type:"string",description:"Environment",hint:"production | development | daily"},{name:"format",meowKey:"format",type:"string",description:"Output format",hint:"json | pretty | compress"},{name:"jq",meowKey:"jq",type:"string",description:"Filter JSON output (JQ_PATH > bundled jq > PATH; implies --format json when current format is pretty)",hint:"<expr>"},{name:"dry-run",meowKey:"dryRun",type:"boolean",description:"Preview operation without executing"},{name:"yes",
2
+ meowKey:"yes",type:"boolean",description:"Skip confirmation for high-risk writes"},{name:"non-interactive",meowKey:"nonInteractive",type:"boolean",description:"Force non-interactive mode (CI)"},{name:"global",meowKey:"global",type:"boolean",description:"Use global config scope"},{name:"ci",meowKey:"ci",type:"boolean",description:"Alias for --non-interactive",hidden:true},{name:"help",meowKey:"help",type:"boolean",description:"Show help"},{name:"id",meowKey:"id",type:"string",description:"Record ID",hidden:true},{name:"name",meowKey:"name",type:"string",description:"Name filter",hidden:true},{name:"sqlcode",meowKey:"sqlcode",type:"string",description:"SQL query code",hidden:true},{name:"params",meowKey:"params",type:"string",description:"JSON params for execute commands",hidden:true},{name:"verbose",meowKey:"verbose",type:"boolean",description:"Verbose output",hidden:true},{name:"clear",meowKey:"clear",type:"boolean",description:"Clear output",hidden:true}]
3
+ ;export const PIPELINE_FLAG_NAMES=new Set(["appcode","app","env","format","jq","dry-run","yes","non-interactive","ci"]);export function buildMeowFlags(){return Object.fromEntries(GLOBAL_FLAGS.map(f=>[f.meowKey,{type:f.type}]))}
@@ -1 +1 @@
1
- const a105_0x4ba1e3=a105_0x1ad2;function a105_0x1a6b(){const _0x5b6961=['compress','136916andfog','427326pDtYBH','2363368XLNhPX','824937nUNyRG','2439bvNKHw','924995NEuZhA','write','main','154yEkESI','en-US','1612394ZAZWjf'];a105_0x1a6b=function(){return _0x5b6961;};return a105_0x1a6b();}(function(_0x508455,_0x4fcbe3){const _0x2bf3c8=a105_0x1ad2,_0x2d10e3=_0x508455();while(!![]){try{const _0x419ef7=parseInt(_0x2bf3c8(0x140))/0x1*(parseInt(_0x2bf3c8(0x144))/0x2)+-parseInt(_0x2bf3c8(0x13f))/0x3+parseInt(_0x2bf3c8(0x148))/0x4+parseInt(_0x2bf3c8(0x141))/0x5+parseInt(_0x2bf3c8(0x149))/0x6+parseInt(_0x2bf3c8(0x146))/0x7+-parseInt(_0x2bf3c8(0x13e))/0x8;if(_0x419ef7===_0x4fcbe3)break;else _0x2d10e3['push'](_0x2d10e3['shift']());}catch(_0x44dee1){_0x2d10e3['push'](_0x2d10e3['shift']());}}}(a105_0x1a6b,0x21bd2));function a105_0x1ad2(_0x3936a7,_0x2d8bb4){_0x3936a7=_0x3936a7-0x13e;const _0x1a6b2f=a105_0x1a6b();let _0x1ad27a=_0x1a6b2f[_0x3936a7];return _0x1ad27a;}export const DEFAULT_APP_PROFILE_NAME=a105_0x4ba1e3(0x143);export const DEFAULT_CONFIG_VALUES={'env':'production','format':a105_0x4ba1e3(0x147),'locale':a105_0x4ba1e3(0x145),'riskLevel':a105_0x4ba1e3(0x142)};export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';
1
+ export const DEFAULT_APP_PROFILE_NAME="main";export const DEFAULT_CONFIG_VALUES={env:"production",format:"compress",locale:"en-US",riskLevel:"write"};export const DEFAULT_COMMAND_OUTPUT_FORMAT="compress";
@@ -1 +1 @@
1
- const a106_0x4dd8e4=a106_0x2572;(function(_0x16e3f8,_0x2c94a9){const _0x41e59f=a106_0x2572,_0x39383d=_0x16e3f8();while(!![]){try{const _0x341089=-parseInt(_0x41e59f(0x182))/0x1+parseInt(_0x41e59f(0x184))/0x2+-parseInt(_0x41e59f(0x180))/0x3+parseInt(_0x41e59f(0x17d))/0x4+parseInt(_0x41e59f(0x187))/0x5+parseInt(_0x41e59f(0x186))/0x6*(parseInt(_0x41e59f(0x183))/0x7)+-parseInt(_0x41e59f(0x17e))/0x8*(-parseInt(_0x41e59f(0x17f))/0x9);if(_0x341089===_0x2c94a9)break;else _0x39383d['push'](_0x39383d['shift']());}catch(_0x5d6d78){_0x39383d['push'](_0x39383d['shift']());}}}(a106_0x5f15,0x6a99b));function a106_0x2572(_0x3cae40,_0x379328){_0x3cae40=_0x3cae40-0x17c;const _0x5f156d=a106_0x5f15();let _0x25726c=_0x5f156d[_0x3cae40];return _0x25726c;}import{PRODUCT_CONFIG}from'../constant/product.js';export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a106_0x4dd8e4(0x181)];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG[a106_0x4dd8e4(0x17c)];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG[a106_0x4dd8e4(0x185)];export const LOVRABET_CLI_CDN_BASE_URL=PRODUCT_CONFIG['cliCdnBaseUrl'];function a106_0x5f15(){const _0x520d2d=['npmRegistryBaseUrl','78SjZRvW','2381480hHMquP','skillSource','3265680JYTRxM','8OjdsUB','177426IodLja','2110614OMiimX','npmPackageName','857125NKlEEQ','23786vwRlqv','1281388izZqZA'];a106_0x5f15=function(){return _0x520d2d;};return a106_0x5f15();}export const LOVRABET_CLI_VERSION_POLICY_URL=LOVRABET_CLI_CDN_BASE_URL+'/dist/lovrabet-cli/config/index.json';
1
+ import{PRODUCT_CONFIG}from"../constant/product.js";export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG.npmPackageName;export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG.skillSource;export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG.npmRegistryBaseUrl;export const LOVRABET_CLI_CDN_BASE_URL=PRODUCT_CONFIG.cliCdnBaseUrl;export const LOVRABET_CLI_VERSION_POLICY_URL=`${LOVRABET_CLI_CDN_BASE_URL}/dist/lovrabet-cli/config/index.json`;
@@ -1 +1,2 @@
1
- function a107_0x20ef(_0x1e1e32,_0x22d636){_0x1e1e32=_0x1e1e32-0xe7;const _0x4fe9cf=a107_0x4fe9();let _0x20ef44=_0x4fe9cf[_0x1e1e32];return _0x20ef44;}const a107_0x3707bd=a107_0x20ef;function a107_0x4fe9(){const _0x6e5941=['harnessDomain','api','457701uqobRa','1081920wwpjay','1687656uAHqCR','1000554fsXSPj','9aoswqp','6928030XwkdlA','validation','daily','kbService','apiDomain','3igtkAu','production','runtimeDomain','skillDomain','region','Harness\x20is\x20not\x20configured.','64118NhjLvq','1039435uVmYrD','harness','4ARhoUB','skill','runtime'];a107_0x4fe9=function(){return _0x6e5941;};return a107_0x4fe9();}(function(_0x23fdc6,_0x2daca6){const _0x17697e=a107_0x20ef,_0x8d31ff=_0x23fdc6();while(!![]){try{const _0x1d5c14=parseInt(_0x17697e(0xfe))/0x1*(-parseInt(_0x17697e(0xec))/0x2)+-parseInt(_0x17697e(0xf4))/0x3*(parseInt(_0x17697e(0xef))/0x4)+-parseInt(_0x17697e(0xed))/0x5+-parseInt(_0x17697e(0xf7))/0x6+-parseInt(_0x17697e(0xf5))/0x7+-parseInt(_0x17697e(0xf6))/0x8*(-parseInt(_0x17697e(0xf8))/0x9)+parseInt(_0x17697e(0xf9))/0xa;if(_0x1d5c14===_0x2daca6)break;else _0x8d31ff['push'](_0x8d31ff['shift']());}catch(_0x269007){_0x8d31ff['push'](_0x8d31ff['shift']());}}}(a107_0x4fe9,0x1eb72));import{CliErrors}from'../errors.js';import{getEnv,isProduction}from'../constant/env.js';import{OFFICIAL_ROUTING_PROFILES}from'../generated/official-routing.js';import{DEFAULT_LOVRABET_REGION}from'../constant/region.js';let customApiDomain,customUserDomain,customRuntimeDomain,customSkillDomain,customKbServiceDomain,customHarnessDomain,activeRegion=DEFAULT_LOVRABET_REGION;export function initDomains(_0x7c957d){const _0x50e8a1=a107_0x20ef;customApiDomain=_0x7c957d?.[_0x50e8a1(0xfd)],customUserDomain=_0x7c957d?.['userDomain'],customRuntimeDomain=_0x7c957d?.[_0x50e8a1(0xe8)],customSkillDomain=_0x7c957d?.[_0x50e8a1(0xe9)],customKbServiceDomain=_0x7c957d?.['kbServiceDomain'],customHarnessDomain=_0x7c957d?.[_0x50e8a1(0xf2)],activeRegion=_0x7c957d?.[_0x50e8a1(0xea)]??DEFAULT_LOVRABET_REGION;}const getActiveRegionDomains=()=>{const _0x5a91f6=a107_0x20ef,_0x5eee19=OFFICIAL_ROUTING_PROFILES[activeRegion]['serviceDomains'];return isProduction(getEnv())?_0x5eee19[_0x5a91f6(0xe7)]:_0x5a91f6(0xfb)in _0x5eee19?_0x5eee19['daily']:_0x5eee19[_0x5a91f6(0xe7)];};export const getUserDomain=()=>customUserDomain||getActiveRegionDomains()['user'];export const getApiDomain=()=>customApiDomain||getActiveRegionDomains()[a107_0x3707bd(0xf3)];export const getRuntimeDomain=()=>customRuntimeDomain||getActiveRegionDomains()[a107_0x3707bd(0xf1)];export const getSkillDomain=()=>customSkillDomain||getActiveRegionDomains()[a107_0x3707bd(0xf0)];export const getKbServiceDomain=()=>{const _0x470f19=a107_0x3707bd;if(customKbServiceDomain)return customKbServiceDomain;const _0xf65f4d=getActiveRegionDomains();return _0x470f19(0xfc)in _0xf65f4d?_0xf65f4d[_0x470f19(0xfc)]:undefined;};export const getHarnessDomain=()=>{const _0x55fcd7=a107_0x3707bd;if(customHarnessDomain)return customHarnessDomain;const _0x403036=getActiveRegionDomains();return _0x55fcd7(0xee)in _0x403036?_0x403036['harness']:undefined;};export function requireHarnessDomain(){const _0x40fe63=a107_0x3707bd,_0x212bb2=getHarnessDomain();if(!_0x212bb2)throw CliErrors[_0x40fe63(0xfa)](_0x40fe63(0xeb),'Configure\x20a\x20trusted\x20harnessDomain\x20HTTPS\x20origin\x20in\x20the\x20connection\x20settings.');return _0x212bb2;}
1
+ import{CliErrors}from"../errors.js";import{getEnv,isProduction}from"../constant/env.js";import{OFFICIAL_ROUTING_PROFILES}from"../generated/official-routing.js";import{DEFAULT_LOVRABET_REGION}from"../constant/region.js";let customApiDomain;let customUserDomain;let customRuntimeDomain;let customSkillDomain;let customKbServiceDomain;let customHarnessDomain;let activeRegion=DEFAULT_LOVRABET_REGION;export function initDomains(domains){customApiDomain=domains?.apiDomain;customUserDomain=domains?.userDomain;customRuntimeDomain=domains?.runtimeDomain;customSkillDomain=domains?.skillDomain;customKbServiceDomain=domains?.kbServiceDomain;customHarnessDomain=domains?.harnessDomain;activeRegion=domains?.region??DEFAULT_LOVRABET_REGION}const getActiveRegionDomains=()=>{const domains=OFFICIAL_ROUTING_PROFILES[activeRegion].serviceDomains;return isProduction(getEnv())?domains.production:"daily"in domains?domains.daily:domains.production}
2
+ ;export const getUserDomain=()=>customUserDomain||getActiveRegionDomains().user;export const getApiDomain=()=>customApiDomain||getActiveRegionDomains().api;export const getRuntimeDomain=()=>customRuntimeDomain||getActiveRegionDomains().runtime;export const getSkillDomain=()=>customSkillDomain||getActiveRegionDomains().skill;export const getKbServiceDomain=()=>{if(customKbServiceDomain)return customKbServiceDomain;const domains=getActiveRegionDomains();return"kbService"in domains?domains.kbService:undefined};export const getHarnessDomain=()=>{if(customHarnessDomain)return customHarnessDomain;const domains=getActiveRegionDomains();return"harness"in domains?domains.harness:undefined};export function requireHarnessDomain(){const domain=getHarnessDomain();if(!domain){throw CliErrors.validation("Harness is not configured.","Configure a trusted harnessDomain HTTPS origin in the connection settings.")}return domain}