@lovrabet/lovrabet-cli 2.3.12 → 2.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +39 -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.d.ts +8 -0
  43. package/lib/commands/metric/contract.js +5 -0
  44. package/lib/commands/metric/definition.d.ts +35 -0
  45. package/lib/commands/metric/definition.js +4 -0
  46. package/lib/commands/metric/detail.d.ts +2 -0
  47. package/lib/commands/metric/detail.js +1 -0
  48. package/lib/commands/metric/exec.d.ts +2 -0
  49. package/lib/commands/metric/exec.js +3 -0
  50. package/lib/commands/metric/index.d.ts +1 -0
  51. package/lib/commands/metric/index.js +1 -0
  52. package/lib/commands/metric/list.d.ts +2 -0
  53. package/lib/commands/metric/list.js +2 -0
  54. package/lib/commands/metric/shared.d.ts +17 -0
  55. package/lib/commands/metric/shared.js +2 -0
  56. package/lib/commands/notification/config-list.js +1 -1
  57. package/lib/commands/notification/index.js +1 -1
  58. package/lib/commands/notification/shared.js +2 -1
  59. package/lib/commands/ocr/index.js +4 -1
  60. package/lib/commands/permit/dataset-get.js +1 -1
  61. package/lib/commands/permit/dataset-set.js +5 -1
  62. package/lib/commands/permit/index.js +1 -1
  63. package/lib/commands/permit/page-get.js +1 -1
  64. package/lib/commands/permit/page-set.js +3 -1
  65. package/lib/commands/permit/role-menus-set.js +4 -1
  66. package/lib/commands/permit/role-menus.js +1 -1
  67. package/lib/commands/permit/shared.js +7 -1
  68. package/lib/commands/personal-bff/index.js +7 -1
  69. package/lib/commands/registry.js +6 -1
  70. package/lib/commands/role/create.js +2 -1
  71. package/lib/commands/role/delete.js +2 -1
  72. package/lib/commands/role/detail.js +1 -1
  73. package/lib/commands/role/index.js +1 -1
  74. package/lib/commands/role/list.js +2 -1
  75. package/lib/commands/role/shared.js +8 -1
  76. package/lib/commands/role/update.js +3 -1
  77. package/lib/commands/role/user-add.js +2 -1
  78. package/lib/commands/role/user-remove.js +2 -1
  79. package/lib/commands/schedule/index.js +7 -1
  80. package/lib/commands/schema.js +1 -1
  81. package/lib/commands/service/dynamic.js +10 -1
  82. package/lib/commands/service/function-name-adapter.js +3 -1
  83. package/lib/commands/service/index.js +8 -1
  84. package/lib/commands/service/registry.js +12 -1
  85. package/lib/commands/skill/commands/create.js +3 -1
  86. package/lib/commands/skill/commands/diagram.js +4 -1
  87. package/lib/commands/skill/commands/install.js +6 -1
  88. package/lib/commands/skill/commands/list.js +3 -1
  89. package/lib/commands/skill/commands/push.js +1 -1
  90. package/lib/commands/skill/commands/validate.js +1 -1
  91. package/lib/commands/skill/diagram.js +3 -1
  92. package/lib/commands/skill/flags.js +4 -1
  93. package/lib/commands/skill/index.js +1 -1
  94. package/lib/commands/skill/manifest-helpers.js +1 -1
  95. package/lib/commands/skill/push-execute.js +11 -1
  96. package/lib/commands/skill/push-flow-helpers.js +4 -1
  97. package/lib/commands/skill/push-retarget.js +1 -1
  98. package/lib/commands/skill/scopes.js +1 -1
  99. package/lib/commands/skill/summary.js +1 -1
  100. package/lib/commands/skill/templates.js +8 -1
  101. package/lib/commands/skill/validate.js +8 -1
  102. package/lib/commands/sql/detail.js +1 -1
  103. package/lib/commands/sql/exec.js +2 -1
  104. package/lib/commands/sql/index.js +1 -1
  105. package/lib/commands/update.d.ts +2 -1
  106. package/lib/commands/update.js +8 -1
  107. package/lib/commands/user-account/bind.js +3 -1
  108. package/lib/commands/user-account/index.js +1 -1
  109. package/lib/commands/workspace/index.js +7 -1
  110. package/lib/config/domain-config.js +6 -1
  111. package/lib/config/schema.js +5 -1
  112. package/lib/constant/app.js +1 -1
  113. package/lib/constant/auth-mode.js +1 -1
  114. package/lib/constant/cli.js +3 -1
  115. package/lib/constant/defaults.js +1 -1
  116. package/lib/constant/distribution.js +1 -1
  117. package/lib/constant/domain.js +2 -1
  118. package/lib/constant/env.js +1 -1
  119. package/lib/constant/output.js +1 -1
  120. package/lib/constant/product.js +2 -1
  121. package/lib/constant/region.js +2 -1
  122. package/lib/constant/risk.js +1 -1
  123. package/lib/constant/url.js +1 -1
  124. package/lib/context.js +11 -1
  125. package/lib/core/api-client.d.ts +4 -0
  126. package/lib/core/api-client.js +38 -1
  127. package/lib/core/db-resolver.js +1 -1
  128. package/lib/core/kb-management-client.js +6 -1
  129. package/lib/core/kb-sdk-errors.js +2 -1
  130. package/lib/core/kb-search-client.js +2 -1
  131. package/lib/core/sdk-client.js +5 -1
  132. package/lib/errors.js +2 -1
  133. package/lib/framework/access-error.js +1 -1
  134. package/lib/framework/build-all-flags.js +1 -1
  135. package/lib/framework/dryrun.js +1 -1
  136. package/lib/framework/flags.js +1 -1
  137. package/lib/framework/help.js +2 -1
  138. package/lib/framework/index.js +1 -1
  139. package/lib/framework/output.js +1 -1
  140. package/lib/framework/preparse.js +3 -1
  141. package/lib/framework/rate-limit.js +2 -1
  142. package/lib/framework/raw-flags.js +2 -1
  143. package/lib/framework/response.js +1 -1
  144. package/lib/framework/runner-confirmation.js +2 -1
  145. package/lib/framework/runner-error.js +2 -1
  146. package/lib/framework/runner.js +9 -1
  147. package/lib/framework/schema-export.js +2 -1
  148. package/lib/framework/service-order.js +1 -1
  149. package/lib/framework/types.js +1 -1
  150. package/lib/generated/build-info.d.ts +4 -4
  151. package/lib/generated/build-info.js +1 -1
  152. package/lib/generated/official-routing.js +2 -1
  153. package/lib/generated/routing-contract.js +1 -1
  154. package/lib/help.js +1 -1
  155. package/lib/runtime/confirmation.js +1 -1
  156. package/lib/runtime/event.js +1 -1
  157. package/lib/runtime/index.js +4 -1
  158. package/lib/runtime/queue.js +1 -1
  159. package/lib/runtime/resolve.js +2 -1
  160. package/lib/runtime/types.js +1 -1
  161. package/lib/services/dataset-import/auto-id-runner.js +9 -1
  162. package/lib/services/dataset-import/excel-reader.js +25 -1
  163. package/lib/services/dataset-import/image-bytes.js +6 -1
  164. package/lib/services/dataset-import/image-ooxml.js +15 -1
  165. package/lib/services/dataset-import/image-runner.js +9 -1
  166. package/lib/services/dataset-import/metadata.js +1 -1
  167. package/lib/services/dataset-import/preview.js +1 -1
  168. package/lib/services/dataset-import/runner.js +13 -1
  169. package/lib/services/dataset-import/types.js +1 -1
  170. package/lib/skills/builtin-skill.js +8 -1
  171. package/lib/skills/install-updated-skill.d.ts +8 -0
  172. package/lib/skills/install-updated-skill.js +3 -0
  173. package/lib/skills/local-skills-installer.d.ts +2 -0
  174. package/lib/skills/local-skills-installer.js +1 -0
  175. package/lib/skills/npx-skills-add.d.ts +2 -2
  176. package/lib/skills/npx-skills-add.js +4 -1
  177. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  178. package/lib/skills/runtime-skill-sync/fs-utils.js +3 -1
  179. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  180. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  181. package/lib/skills/runtime-skill-sync/links.js +9 -1
  182. package/lib/skills/runtime-skill-sync/list-local.js +4 -1
  183. package/lib/skills/runtime-skill-sync/local-files.js +5 -1
  184. package/lib/skills/runtime-skill-sync/materialize.js +9 -1
  185. package/lib/skills/runtime-skill-sync/metadata.js +3 -1
  186. package/lib/skills/runtime-skill-sync/paths.js +2 -1
  187. package/lib/skills/runtime-skill-sync/push.js +8 -1
  188. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  189. package/lib/skills/runtime-skill-sync/types.js +1 -1
  190. package/lib/skills/runtime-skill-sync/zip-codec.js +2 -1
  191. package/lib/skills/runtime-skill-sync/zip-package.js +6 -1
  192. package/lib/skills/runtime-skill-sync.js +1 -1
  193. package/lib/skills/skill-presence.d.ts +1 -34
  194. package/lib/skills/skill-presence.js +2 -1
  195. package/lib/utils/access-key-redaction.js +2 -1
  196. package/lib/utils/apply-jq-filter.js +1 -1
  197. package/lib/utils/cli-version-check.js +2 -1
  198. package/lib/utils/cli-version-policy.js +3 -1
  199. package/lib/utils/logger.js +3 -1
  200. package/lib/utils/lossless-json.js +3 -1
  201. package/lib/utils/params.js +3 -1
  202. package/lib/utils/positive-safe-integer.js +1 -1
  203. package/lib/utils/redaction.js +2 -1
  204. package/lib/utils/runtime-user-id.js +1 -1
  205. package/lib/utils/update-notice.js +3 -1
  206. package/lib/utils/version.js +1 -1
  207. package/lib/utils/write-cli-side-channel.js +1 -1
  208. package/package.json +9 -8
  209. package/skills/lovrabet/SKILL.md +14 -6
  210. package/skills/lovrabet/guides/app-resolution.md +2 -0
  211. package/skills/lovrabet/guides/dataset-and-data-workflow.md +2 -0
  212. package/skills/lovrabet/guides/development-intent-handoff.md +19 -3
  213. package/skills/lovrabet/guides/metric-consumption.md +134 -0
  214. package/skills/lovrabet/guides/sql-and-bff-workflow.md +2 -0
  215. package/skills/lovrabet/references/lovrabet-auth.md +4 -0
  216. package/skills/lovrabet/references/lovrabet-schedule-workflow.md +16 -0
  217. package/skills/lovrabet/references/lovrabet-skill-authoring.md +27 -0
  218. package/skills/lovrabet/references/lovrabet-skill-install.md +1 -1
  219. package/skills/lovrabet/references/lovrabet-update.md +6 -4
  220. package/skills/lovrabet-report-generation/SKILL.md +28 -0
  221. package/skills/lovrabet-report-generation/references/business-skill-reuse.md +19 -0
  222. package/skills/lovrabet-report-generation/references/quality-checks.md +16 -0
  223. package/skills/lovrabet-report-generation/references/report-workflow.md +42 -0
  224. package/skills/lovrabet-report-generation/templates/report-outline.md +10 -0
  225. package/skills/lovrabet.manifest.json +4 -3
  226. package/lib/postinstall.d.ts +0 -2
  227. package/lib/postinstall.js +0 -1
  228. package/scripts/postinstall.mjs +0 -24
@@ -1 +1,3 @@
1
- (function(_0x173e35,_0x168ffc){const _0x33b9c0=a66_0x2871,_0x408e28=_0x173e35();while(!![]){try{const _0x5bc810=-parseInt(_0x33b9c0(0x1e2))/0x1*(parseInt(_0x33b9c0(0x1f4))/0x2)+-parseInt(_0x33b9c0(0x1fd))/0x3+-parseInt(_0x33b9c0(0x1e7))/0x4+parseInt(_0x33b9c0(0x1ea))/0x5*(parseInt(_0x33b9c0(0x1ec))/0x6)+parseInt(_0x33b9c0(0x1df))/0x7+-parseInt(_0x33b9c0(0x1e0))/0x8+parseInt(_0x33b9c0(0x1f7))/0x9;if(_0x5bc810===_0x168ffc)break;else _0x408e28['push'](_0x408e28['shift']());}catch(_0x28c9ce){_0x408e28['push'](_0x408e28['shift']());}}}(a66_0x5727,0x9cfb0));export function adaptServiceTreeManifestForLegacyFramework(_0x2f9381){const _0x230888=a66_0x2871,_0x564093=cloneJsonValue(_0x2f9381),_0x1c560b=[];if(!isObjectRecord(_0x564093))return{'manifest':_0x564093,'errors':_0x1c560b};return Array[_0x230888(0x1f8)](_0x564093[_0x230888(0x1e8)])&&_0x564093['commands'][_0x230888(0x1de)]((_0x19f4a3,_0x20f7d4)=>{const _0x133240=_0x230888;if(!isObjectRecord(_0x19f4a3))return;adaptBffTarget(_0x19f4a3[_0x133240(0x1e1)],_0x133240(0x1f3)+_0x20f7d4+_0x133240(0x1ee),_0x1c560b);}),adaptResources(_0x564093[_0x230888(0x1ff)],_0x230888(0x1db),_0x1c560b),{'manifest':_0x564093,'errors':_0x1c560b};}export function toPublicServiceTreeTarget(_0x26291b){const _0x9c1b=a66_0x2871,{scriptName:_0x1d8023,..._0x12f1e3}=_0x26291b;return typeof _0x1d8023==='string'&&_0x1d8023[_0x9c1b(0x1f1)]()&&(_0x12f1e3[_0x9c1b(0x1fc)]=_0x1d8023),_0x12f1e3;}export function toPublicNormalizedServiceTree(_0x2cc980){const _0x2b14fe=a66_0x2871;return{..._0x2cc980,'commands':_0x2cc980['commands'][_0x2b14fe(0x1eb)](_0x187f15=>({..._0x187f15,'target':toPublicServiceTreeTarget(_0x187f15[_0x2b14fe(0x1e1)])}))};}function adaptResources(_0x1744a2,_0x286cfc,_0x148789){const _0x284712=a66_0x2871;if(!isObjectRecord(_0x1744a2))return;for(const [_0x38edd8,_0x7fea28]of Object[_0x284712(0x1dc)](_0x1744a2)){if(!isObjectRecord(_0x7fea28))continue;const _0x5e377f=_0x286cfc+'.'+_0x38edd8;if(isObjectRecord(_0x7fea28[_0x284712(0x1f5)]))for(const [_0x298347,_0x232fab]of Object[_0x284712(0x1dc)](_0x7fea28[_0x284712(0x1f5)])){if(!isObjectRecord(_0x232fab))continue;const _0x2b4202=_0x5e377f+_0x284712(0x1f9)+_0x298347,_0x11cf03=isObjectRecord(_0x232fab[_0x284712(0x1e1)])&&_0x232fab[_0x284712(0x1e1)][_0x284712(0x1e5)]===_0x284712(0x1fe);adaptBffTarget(_0x232fab[_0x284712(0x1e1)],_0x2b4202+'.target',_0x148789),(_0x11cf03||isBffAction(_0x232fab))&&adaptFunctionNameField(_0x232fab,_0x2b4202,_0x148789);}adaptResources(_0x7fea28[_0x284712(0x1ff)],_0x5e377f+'.resources',_0x148789);}}function adaptBffTarget(_0x53a09b,_0xe6f8c2,_0x5477c8){const _0x54633c=a66_0x2871;if(!isObjectRecord(_0x53a09b)||_0x53a09b[_0x54633c(0x1e5)]!==_0x54633c(0x1fe))return;adaptFunctionNameField(_0x53a09b,_0xe6f8c2,_0x5477c8);}function adaptFunctionNameField(_0x1d1a6d,_0x5a83b2,_0x2c451f){const _0x509990=a66_0x2871;Object[_0x509990(0x1e9)][_0x509990(0x1fa)][_0x509990(0x200)](_0x1d1a6d,'scriptName')&&_0x2c451f[_0x509990(0x1f2)]({'level':_0x509990(0x1dd),'path':_0x5a83b2+_0x509990(0x1e3),'message':_0x509990(0x1ed)});if(Object[_0x509990(0x1e9)][_0x509990(0x1fa)][_0x509990(0x200)](_0x1d1a6d,_0x509990(0x1fc))){if(typeof _0x1d1a6d['functionName']!=='string'||!_0x1d1a6d[_0x509990(0x1fc)][_0x509990(0x1f1)]()){_0x2c451f['push']({'level':_0x509990(0x1dd),'path':_0x5a83b2+_0x509990(0x1f0),'message':_0x509990(0x1f6)}),delete _0x1d1a6d[_0x509990(0x1fc)];return;}_0x1d1a6d[_0x509990(0x1e4)]=_0x1d1a6d[_0x509990(0x1fc)],delete _0x1d1a6d[_0x509990(0x1fc)];}}function a66_0x5727(){const _0xd13744=['functionName\x20must\x20be\x20a\x20non-empty\x20string.','20978217IJHtoY','isArray','.actions.','hasOwnProperty','fromEntries','functionName','3200517SfKbCr','bff','resources','call','$.resources','entries','error','forEach','7238098bkmHbd','4030336hLZSwX','target','518602qauWOg','.scriptName','scriptName','kind','action','4166144lVAtqN','commands','prototype','18090Veuwej','map','678BzzoUJ','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','].target','bff.exec','.functionName','trim','push','$.commands[','2EaQADb','actions'];a66_0x5727=function(){return _0xd13744;};return a66_0x5727();}function isBffAction(_0x3e5758){const _0xb30eb9=a66_0x2871;return _0x3e5758[_0xb30eb9(0x1e5)]===_0xb30eb9(0x1fe)||_0x3e5758[_0xb30eb9(0x1e6)]==='bff.exec'||_0x3e5758[_0xb30eb9(0x1e1)]===_0xb30eb9(0x1ef);}function cloneJsonValue(_0x555868){const _0x27ce7a=a66_0x2871;if(Array['isArray'](_0x555868))return _0x555868['map'](_0x3934ff=>cloneJsonValue(_0x3934ff));if(isObjectRecord(_0x555868))return Object[_0x27ce7a(0x1fb)](Object[_0x27ce7a(0x1dc)](_0x555868)['map'](([_0x572f12,_0x58911b])=>[_0x572f12,cloneJsonValue(_0x58911b)]));return _0x555868;}function a66_0x2871(_0x144695,_0x12b03e){_0x144695=_0x144695-0x1db;const _0x57273b=a66_0x5727();let _0x28714e=_0x57273b[_0x144695];return _0x28714e;}function isObjectRecord(_0x2ad661){const _0xd25e27=a66_0x2871;return Boolean(_0x2ad661)&&typeof _0x2ad661==='object'&&!Array[_0xd25e27(0x1f8)](_0x2ad661);}
1
+ export function adaptServiceTreeManifestForLegacyFramework(input){const manifest=cloneJsonValue(input);const errors=[];if(!isObjectRecord(manifest)){return{manifest:manifest,errors:errors}}if(Array.isArray(manifest.commands)){manifest.commands.forEach((command,index)=>{if(!isObjectRecord(command))return;adaptBffTarget(command.target,`$.commands[${index}].target`,errors)})}adaptResources(manifest.resources,"$.resources",errors);return{manifest:manifest,errors:errors}}export function toPublicServiceTreeTarget(target){const{scriptName:scriptName,...publicTarget}=target;if(typeof scriptName==="string"&&scriptName.trim()){publicTarget.functionName=scriptName}return publicTarget}export function toPublicNormalizedServiceTree(tree){return{...tree,commands:tree.commands.map(command=>({...command,target:toPublicServiceTreeTarget(command.target)}))}}function adaptResources(value,path,errors){if(!isObjectRecord(value))return;for(const[resourceName,resource]of Object.entries(value)){
2
+ if(!isObjectRecord(resource))continue;const resourcePath=`${path}.${resourceName}`;if(isObjectRecord(resource.actions)){for(const[actionName,action]of Object.entries(resource.actions)){if(!isObjectRecord(action))continue;const actionPath=`${resourcePath}.actions.${actionName}`;const hasBffTarget=isObjectRecord(action.target)&&action.target.kind==="bff";adaptBffTarget(action.target,`${actionPath}.target`,errors);if(hasBffTarget||isBffAction(action)){adaptFunctionNameField(action,actionPath,errors)}}}adaptResources(resource.resources,`${resourcePath}.resources`,errors)}}function adaptBffTarget(value,path,errors){if(!isObjectRecord(value)||value.kind!=="bff")return;adaptFunctionNameField(value,path,errors)}function adaptFunctionNameField(value,path,errors){if(Object.prototype.hasOwnProperty.call(value,"scriptName")){errors.push({level:"error",path:`${path}.scriptName`,message:"Use functionName; scriptName is not part of the runtime Service Tree contract."})}
3
+ if(Object.prototype.hasOwnProperty.call(value,"functionName")){if(typeof value.functionName!=="string"||!value.functionName.trim()){errors.push({level:"error",path:`${path}.functionName`,message:"functionName must be a non-empty string."});delete value.functionName;return}value.scriptName=value.functionName;delete value.functionName}}function isBffAction(action){return action.kind==="bff"||action.action==="bff.exec"||action.target==="bff.exec"}function cloneJsonValue(value){if(Array.isArray(value)){return value.map(item=>cloneJsonValue(item))}if(isObjectRecord(value)){return Object.fromEntries(Object.entries(value).map(([key,item])=>[key,cloneJsonValue(item)]))}return value}function isObjectRecord(value){return Boolean(value)&&typeof value==="object"&&!Array.isArray(value)}
@@ -1 +1,8 @@
1
- function a67_0x3ee4(_0x68005c,_0x306f7a){_0x68005c=_0x68005c-0x1be;const _0x113a4f=a67_0x113a();let _0x3ee485=_0x113a4f[_0x68005c];return _0x3ee485;}const a67_0x27ca20=a67_0x3ee4;function a67_0x113a(){const _0x411f64=['serviceCode','length','1197ztiLqK','target','type','\x20service(s).','126IqXoMs','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','list','imported','name','file','1192261ohsbtS','validate','report','manifests','normalizedManifest','6041420mWBexZ','risk','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','errors','importedAt','Writes\x20the\x20local\x20Service\x20Tree\x20manifest\x20for\x20the\x20given\x20service\x20to\x20a\x20JSON\x20file.\x20An\x20existing\x20file\x20at\x20the\x20target\x20may\x20be\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','cliPath','version','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','5gPbDDy','registryPath','flags','Service\x20manifest\x20validation\x20passed.','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Updated','Local\x20service\x20code,\x20for\x20example\x20crm','Removed\x20service\x20','hash','service','filePath','str','read','Reads\x20the\x20given\x20manifest\x20into\x20the\x20local\x20Service\x20Tree\x20registry.\x20An\x20existing\x20manifest\x20with\x20the\x20same\x20service\x20code\x20is\x20updated.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','write','entries','1015068HsCsBt','import','warnings','source','replaced','186EyUVSz','registry','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','entry','string','kind','141064wCymiI','WRITE','updated','\x20service(s),\x20updated\x20','commands','registryIndex','description','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','manifest','778212EUPATP','map','411396pvrSjO','Service\x20Tree\x20manifest\x20file\x20path','serviceCount'];a67_0x113a=function(){return _0x411f64;};return a67_0x113a();}(function(_0x25e251,_0x18873c){const _0x46ba0e=a67_0x3ee4,_0x1a056f=_0x25e251();while(!![]){try{const _0x117ef4=parseInt(_0x46ba0e(0x1ea))/0x1*(-parseInt(_0x46ba0e(0x1d4))/0x2)+-parseInt(_0x46ba0e(0x1e3))/0x3+-parseInt(_0x46ba0e(0x1cf))/0x4*(-parseInt(_0x46ba0e(0x1bf))/0x5)+parseInt(_0x46ba0e(0x1e5))/0x6+-parseInt(_0x46ba0e(0x1f4))/0x7+-parseInt(_0x46ba0e(0x1da))/0x8*(parseInt(_0x46ba0e(0x1ee))/0x9)+parseInt(_0x46ba0e(0x1f9))/0xa;if(_0x117ef4===_0x18873c)break;else _0x1a056f['push'](_0x1a056f['shift']());}catch(_0x339471){_0x1a056f['push'](_0x1a056f['shift']());}}}(a67_0x113a,0x21d45));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a67_0x27ca20(0x1f3),'type':a67_0x27ca20(0x1d8),'required':!![],'description':a67_0x27ca20(0x1e6)},SERVICE_FLAG={'name':a67_0x27ca20(0x1c8),'type':a67_0x27ca20(0x1d8),'required':!![],'description':a67_0x27ca20(0x1c5),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x1ac6a4){const _0xe9f57e=a67_0x27ca20;return{'serviceCode':_0x1ac6a4[_0xe9f57e(0x1e8)],'name':_0x1ac6a4[_0xe9f57e(0x1f8)][_0xe9f57e(0x1c8)][_0xe9f57e(0x1f2)],'version':_0x1ac6a4[_0xe9f57e(0x201)],'importedAt':_0x1ac6a4[_0xe9f57e(0x1fd)],'source':_0x1ac6a4[_0xe9f57e(0x1d2)],'commandCount':_0x1ac6a4[_0xe9f57e(0x1f8)]['commands'][_0xe9f57e(0x1e9)],'commands':_0x1ac6a4[_0xe9f57e(0x1f8)]['commands'][_0xe9f57e(0x1e4)](_0x5e8cdb=>({'path':_0x5e8cdb[_0xe9f57e(0x200)],'description':_0x5e8cdb[_0xe9f57e(0x1e0)],'risk':_0x5e8cdb[_0xe9f57e(0x1fa)],'target':toPublicServiceTreeTarget(_0x5e8cdb['target']),'flags':_0x5e8cdb[_0xe9f57e(0x1c1)][_0xe9f57e(0x1e4)](_0x42d913=>({'name':_0x42d913[_0xe9f57e(0x1f2)],'cliName':_0x42d913['cliName'],'type':_0x42d913[_0xe9f57e(0x1ec)],'required':_0x42d913['required']===!![]}))}))};}function summarizeLoadedManifest(_0x5855b5){const _0x34e138=a67_0x27ca20;return{'service':_0x5855b5['normalizedManifest']?.[_0x34e138(0x1c8)],'version':_0x5855b5['normalizedManifest']?.[_0x34e138(0x201)],'commandCount':_0x5855b5[_0x34e138(0x1f8)]?.[_0x34e138(0x1de)][_0x34e138(0x1e9)]??0x0,'commands':_0x5855b5[_0x34e138(0x1f8)]?.[_0x34e138(0x1de)][_0x34e138(0x1e4)](_0x5630cb=>({'path':_0x5630cb[_0x34e138(0x200)],'risk':_0x5630cb[_0x34e138(0x1fa)],'target':toPublicServiceTreeTarget(_0x5630cb[_0x34e138(0x1eb)])}))??[],'registryIndex':_0x5855b5[_0x34e138(0x1df)],'registryServiceCode':_0x5855b5['registryServiceCode'],'errors':_0x5855b5[_0x34e138(0x1f6)][_0x34e138(0x1fc)],'warnings':_0x5855b5[_0x34e138(0x1f6)][_0x34e138(0x1d1)]};}export const serviceDefinitions=[{'service':a67_0x27ca20(0x1c8),'command':a67_0x27ca20(0x1f5),'description':a67_0x27ca20(0x1d6),'risk':a67_0x27ca20(0x1cb),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x10a307){const _0x205e49=a67_0x27ca20,_0x74716c=loadServiceManifestFromFile(_0x10a307[_0x205e49(0x1ca)]('file'));if(!_0x74716c['report']['ok'])return{'ok':![],'data':{'file':_0x74716c[_0x205e49(0x1c9)],'hash':_0x74716c['hash'],'kind':_0x74716c[_0x205e49(0x1d9)],'serviceCount':_0x74716c[_0x205e49(0x1f7)][_0x205e49(0x1e9)],'services':_0x74716c[_0x205e49(0x1f7)][_0x205e49(0x1e4)](summarizeLoadedManifest),'errors':_0x74716c[_0x205e49(0x1f6)]['errors'],'warnings':_0x74716c['report'][_0x205e49(0x1d1)]},'message':formatValidationFailure(_0x74716c['report'])};if(_0x74716c['kind']===_0x205e49(0x1d5)||_0x74716c['manifests'][_0x205e49(0x1e9)]!==0x1)return{'ok':!![],'data':{'file':_0x74716c[_0x205e49(0x1c9)],'hash':_0x74716c[_0x205e49(0x1c7)],'kind':_0x74716c[_0x205e49(0x1d9)],'serviceCount':_0x74716c[_0x205e49(0x1f7)]['length'],'commandCount':_0x74716c[_0x205e49(0x1f7)]['reduce']((_0x2cb4cd,_0x1101cd)=>_0x2cb4cd+(_0x1101cd[_0x205e49(0x1f8)]?.[_0x205e49(0x1de)]['length']??0x0),0x0),'services':_0x74716c[_0x205e49(0x1f7)][_0x205e49(0x1e4)](summarizeLoadedManifest),'warnings':_0x74716c['report'][_0x205e49(0x1d1)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x74716c[_0x205e49(0x1c9)],'hash':_0x74716c['hash'],'kind':_0x74716c[_0x205e49(0x1d9)],'service':_0x74716c[_0x205e49(0x1f8)]?.['service'],'version':_0x74716c[_0x205e49(0x1f8)]?.['version'],'commandCount':_0x74716c['normalizedManifest']?.[_0x205e49(0x1de)][_0x205e49(0x1e9)]??0x0,'commands':_0x74716c['normalizedManifest']?.[_0x205e49(0x1de)][_0x205e49(0x1e4)](_0x1fe4ef=>({'path':_0x1fe4ef[_0x205e49(0x200)],'risk':_0x1fe4ef['risk'],'target':toPublicServiceTreeTarget(_0x1fe4ef[_0x205e49(0x1eb)])})),'warnings':_0x74716c[_0x205e49(0x1f6)][_0x205e49(0x1d1)]},'message':_0x205e49(0x1c2)};}},{'service':a67_0x27ca20(0x1c8),'command':a67_0x27ca20(0x1d0),'description':'Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk':a67_0x27ca20(0x1cd),'confirmationDescription':a67_0x27ca20(0x1cc),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x31f1fd){const _0x17689e=a67_0x27ca20,_0x88308f=loadServiceManifestFromFile(_0x31f1fd['str'](_0x17689e(0x1f3)));return{'method':_0x17689e(0x1db),'url':getServiceRegistryPath(),'body':{'file':_0x88308f[_0x17689e(0x1c9)],'hash':_0x88308f[_0x17689e(0x1c7)],'kind':_0x88308f['kind'],'ok':_0x88308f['report']['ok'],'service':_0x88308f[_0x17689e(0x1f8)]?.[_0x17689e(0x1c8)],'version':_0x88308f[_0x17689e(0x1f8)]?.[_0x17689e(0x201)],'serviceCount':_0x88308f['manifests'][_0x17689e(0x1e9)],'services':_0x88308f[_0x17689e(0x1f7)][_0x17689e(0x1e4)](_0x3678b1=>({'service':_0x3678b1[_0x17689e(0x1f8)]?.[_0x17689e(0x1c8)],'version':_0x3678b1[_0x17689e(0x1f8)]?.[_0x17689e(0x201)],'commandCount':_0x3678b1[_0x17689e(0x1f8)]?.['commands'][_0x17689e(0x1e9)]??0x0,'errors':_0x3678b1['report'][_0x17689e(0x1fc)]})),'errors':_0x88308f[_0x17689e(0x1f6)][_0x17689e(0x1fc)],'commandCount':_0x88308f[_0x17689e(0x1f8)]?.[_0x17689e(0x1de)][_0x17689e(0x1e9)]??0x0},'description':_0x17689e(0x1c3)};},async 'execute'(_0x5b9ef8){const _0x5f1126=a67_0x27ca20,_0x3481ea=importServiceManifest(_0x5b9ef8[_0x5f1126(0x1ca)]('file'));if(_0x3481ea[_0x5f1126(0x1ce)][_0x5f1126(0x1e9)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x3481ea[_0x5f1126(0x1c0)],'imported':_0x3481ea['imported'],'updated':_0x3481ea['updated'],'serviceCount':_0x3481ea[_0x5f1126(0x1e7)],'services':_0x3481ea[_0x5f1126(0x1ce)][_0x5f1126(0x1e4)](summarizeService)},'message':'Imported\x20'+_0x3481ea['imported']+_0x5f1126(0x1dd)+_0x3481ea[_0x5f1126(0x1dc)]+_0x5f1126(0x1ed)};return{'ok':!![],'data':{'registryPath':_0x3481ea[_0x5f1126(0x1c0)],'replaced':_0x3481ea[_0x5f1126(0x1d3)],'imported':_0x3481ea[_0x5f1126(0x1f1)],'updated':_0x3481ea['updated'],'serviceCount':_0x3481ea[_0x5f1126(0x1e7)],'service':summarizeService(_0x3481ea[_0x5f1126(0x1d7)])},'message':(_0x3481ea[_0x5f1126(0x1d3)]?_0x5f1126(0x1c4):'Imported')+'\x20service\x20'+_0x3481ea[_0x5f1126(0x1d7)]['serviceCode']+'.'};}},{'service':a67_0x27ca20(0x1c8),'command':'export','description':a67_0x27ca20(0x1e1),'risk':a67_0x27ca20(0x1cd),'confirmationDescription':a67_0x27ca20(0x1fe),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x1e2ca6){const _0x4fbb44=a67_0x27ca20,_0xa41986=getLocalServiceEntry(_0x1e2ca6[_0x4fbb44(0x1ca)](_0x4fbb44(0x1c8)));return{'method':'WRITE','url':_0x1e2ca6[_0x4fbb44(0x1ca)](_0x4fbb44(0x1f3)),'body':{'service':_0x1e2ca6[_0x4fbb44(0x1ca)]('service'),'found':Boolean(_0xa41986),'version':_0xa41986?.[_0x4fbb44(0x201)],'source':_0xa41986?.[_0x4fbb44(0x1d2)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x1bc4d5){const _0x4200e3=a67_0x27ca20,_0x4f7e5a=exportServiceManifest(_0x1bc4d5[_0x4200e3(0x1ca)](_0x4200e3(0x1c8)),_0x1bc4d5[_0x4200e3(0x1ca)](_0x4200e3(0x1f3)));return{'ok':!![],'data':{'registryPath':_0x4f7e5a[_0x4200e3(0x1c0)],'file':_0x4f7e5a[_0x4200e3(0x1c9)],'service':summarizeService(_0x4f7e5a[_0x4200e3(0x1d7)])},'message':'Exported\x20service\x20'+_0x4f7e5a[_0x4200e3(0x1d7)]['serviceCode']+'.'};}},{'service':a67_0x27ca20(0x1c8),'command':a67_0x27ca20(0x1f0),'description':a67_0x27ca20(0x1be),'risk':a67_0x27ca20(0x1cb),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5f480c=a67_0x27ca20,_0x6bc78a=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x6bc78a[_0x5f480c(0x1e9)],'services':_0x6bc78a[_0x5f480c(0x1e4)](summarizeService)}};}},{'service':a67_0x27ca20(0x1c8),'command':'remove','description':a67_0x27ca20(0x1ff),'risk':a67_0x27ca20(0x1cd),'confirmationDescription':a67_0x27ca20(0x1fb),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0xf4a796){const _0x573f9a=a67_0x27ca20,_0x4e0cb1=getLocalServiceEntry(_0xf4a796[_0x573f9a(0x1ca)](_0x573f9a(0x1c8)));return{'method':_0x573f9a(0x1db),'url':getServiceRegistryPath(),'body':{'service':_0xf4a796['str'](_0x573f9a(0x1c8)),'found':Boolean(_0x4e0cb1),'version':_0x4e0cb1?.[_0x573f9a(0x201)],'source':_0x4e0cb1?.[_0x573f9a(0x1d2)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x28a892){const _0x55d274=a67_0x27ca20,_0x282733=removeServiceManifest(_0x28a892[_0x55d274(0x1ca)]('service'));return{'ok':!![],'data':{'registryPath':_0x282733['registryPath'],'serviceCount':_0x282733[_0x55d274(0x1e7)],'service':summarizeService(_0x282733[_0x55d274(0x1d7)])},'message':_0x55d274(0x1c6)+_0x282733[_0x55d274(0x1d7)]['serviceCode']+'.'};}},{'service':a67_0x27ca20(0x1c8),'command':'detail','description':a67_0x27ca20(0x1ef),'risk':a67_0x27ca20(0x1cb),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1c242e){const _0x5108a4=a67_0x27ca20,_0x30056e=getLocalServiceEntry(_0x1c242e[_0x5108a4(0x1ca)](_0x5108a4(0x1c8)));if(!_0x30056e)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1c242e[_0x5108a4(0x1ca)]('service')},'message':'Local\x20service\x20not\x20found:\x20'+_0x1c242e[_0x5108a4(0x1ca)](_0x5108a4(0x1c8))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x30056e),'manifest':_0x30056e[_0x5108a4(0x1e2)],'normalizedManifest':toPublicNormalizedServiceTree(_0x30056e[_0x5108a4(0x1f8)])}};}}];
1
+ import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from"../../commands/service/registry.js";import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from"../../commands/service/function-name-adapter.js";const FILE_FLAG={name:"file",type:"string",required:true,description:"Service Tree manifest file path"};const SERVICE_FLAG={name:"service",type:"string",required:true,description:"Local service code, for example crm",pattern:{regex:/^[a-z][a-z0-9-]*$/,description:"lower kebab-case service code"}};function summarizeService(entry){return{serviceCode:entry.serviceCode,name:entry.normalizedManifest.service.name,version:entry.version,importedAt:entry.importedAt,source:entry.source,commandCount:entry.normalizedManifest.commands.length,commands:entry.normalizedManifest.commands.map(command=>({path:command.cliPath,description:command.description,
2
+ risk:command.risk,target:toPublicServiceTreeTarget(command.target),flags:command.flags.map(flag=>({name:flag.name,cliName:flag.cliName,type:flag.type,required:flag.required===true}))}))}}function summarizeLoadedManifest(loaded){return{service:loaded.normalizedManifest?.service,version:loaded.normalizedManifest?.version,commandCount:loaded.normalizedManifest?.commands.length??0,commands:loaded.normalizedManifest?.commands.map(command=>({path:command.cliPath,risk:command.risk,target:toPublicServiceTreeTarget(command.target)}))??[],registryIndex:loaded.registryIndex,registryServiceCode:loaded.registryServiceCode,errors:loaded.report.errors,warnings:loaded.report.warnings}}export const serviceDefinitions=[{service:"service",command:"validate",description:"Validate a Service Tree JSON manifest",risk:"read",requiresAuth:false,requiresAppCode:false,flags:[FILE_FLAG],async execute(ctx){const loaded=loadServiceManifestFromFile(ctx.str("file"));if(!loaded.report.ok){return{ok:false,data:{
3
+ file:loaded.filePath,hash:loaded.hash,kind:loaded.kind,serviceCount:loaded.manifests.length,services:loaded.manifests.map(summarizeLoadedManifest),errors:loaded.report.errors,warnings:loaded.report.warnings},message:formatValidationFailure(loaded.report)}}if(loaded.kind==="registry"||loaded.manifests.length!==1){return{ok:true,data:{file:loaded.filePath,hash:loaded.hash,kind:loaded.kind,serviceCount:loaded.manifests.length,commandCount:loaded.manifests.reduce((total,manifest)=>total+(manifest.normalizedManifest?.commands.length??0),0),services:loaded.manifests.map(summarizeLoadedManifest),warnings:loaded.report.warnings},message:"Service registry validation passed."}}return{ok:true,data:{file:loaded.filePath,hash:loaded.hash,kind:loaded.kind,service:loaded.normalizedManifest?.service,version:loaded.normalizedManifest?.version,commandCount:loaded.normalizedManifest?.commands.length??0,commands:loaded.normalizedManifest?.commands.map(command=>({path:command.cliPath,risk:command.risk,
4
+ target:toPublicServiceTreeTarget(command.target)})),warnings:loaded.report.warnings},message:"Service manifest validation passed."}}},{service:"service",command:"import",description:"Import a Service Tree manifest into the local runtime registry",risk:"write",confirmationDescription:"Reads the given manifest into the local Service Tree registry. An existing manifest with the same service code is updated. The confirmation UI does not show local file paths.",requiresAuth:false,requiresAppCode:false,flags:[FILE_FLAG],async dryRun(ctx){const loaded=loadServiceManifestFromFile(ctx.str("file"));return{method:"WRITE",url:getServiceRegistryPath(),body:{file:loaded.filePath,hash:loaded.hash,kind:loaded.kind,ok:loaded.report.ok,service:loaded.normalizedManifest?.service,version:loaded.normalizedManifest?.version,serviceCount:loaded.manifests.length,services:loaded.manifests.map(manifest=>({service:manifest.normalizedManifest?.service,version:manifest.normalizedManifest?.version,
5
+ commandCount:manifest.normalizedManifest?.commands.length??0,errors:manifest.report.errors})),errors:loaded.report.errors,commandCount:loaded.normalizedManifest?.commands.length??0},description:"Preview Service Tree import into ~/.lovrabet/service.json"}},async execute(ctx){const result=importServiceManifest(ctx.str("file"));if(result.entries.length!==1){return{ok:true,data:{registryPath:result.registryPath,imported:result.imported,updated:result.updated,serviceCount:result.serviceCount,services:result.entries.map(summarizeService)},message:`Imported ${result.imported} service(s), updated ${result.updated} service(s).`}}return{ok:true,data:{registryPath:result.registryPath,replaced:result.replaced,imported:result.imported,updated:result.updated,serviceCount:result.serviceCount,service:summarizeService(result.entry)},message:`${result.replaced?"Updated":"Imported"} service ${result.entry.serviceCode}.`}}},{service:"service",command:"export",
6
+ description:"Export the local Service Tree manifest to a JSON file",risk:"write",confirmationDescription:"Writes the local Service Tree manifest for the given service to a JSON file. An existing file at the target may be overwritten. The confirmation UI does not show local file paths.",requiresAuth:false,requiresAppCode:false,flags:[SERVICE_FLAG,FILE_FLAG],async dryRun(ctx){const entry=getLocalServiceEntry(ctx.str("service"));return{method:"WRITE",url:ctx.str("file"),body:{service:ctx.str("service"),found:Boolean(entry),version:entry?.version,source:entry?.source},description:"Preview Service Tree export from ~/.lovrabet/service.json"}},async execute(ctx){const result=exportServiceManifest(ctx.str("service"),ctx.str("file"));return{ok:true,data:{registryPath:result.registryPath,file:result.filePath,service:summarizeService(result.entry)},message:`Exported service ${result.entry.serviceCode}.`}}},{service:"service",command:"list",
7
+ description:"List locally imported Service Tree manifests",risk:"read",requiresAuth:false,requiresAppCode:false,flags:[],async execute(){const services=listLocalServices();return{ok:true,data:{registryPath:getServiceRegistryPath(),total:services.length,services:services.map(summarizeService)}}}},{service:"service",command:"remove",description:"Remove a Service Tree manifest from the local runtime registry",risk:"write",confirmationDescription:"Removes the given service manifest from the local Service Tree registry. Dynamic commands from that manifest will no longer be available.",requiresAuth:false,requiresAppCode:false,flags:[SERVICE_FLAG],async dryRun(ctx){const entry=getLocalServiceEntry(ctx.str("service"));return{method:"WRITE",url:getServiceRegistryPath(),body:{service:ctx.str("service"),found:Boolean(entry),version:entry?.version,source:entry?.source},description:"Preview Service Tree removal from ~/.lovrabet/service.json"}},async execute(ctx){
8
+ const result=removeServiceManifest(ctx.str("service"));return{ok:true,data:{registryPath:result.registryPath,serviceCount:result.serviceCount,service:summarizeService(result.entry)},message:`Removed service ${result.entry.serviceCode}.`}}},{service:"service",command:"detail",description:"Show a locally imported Service Tree manifest",risk:"read",requiresAuth:false,requiresAppCode:false,flags:[SERVICE_FLAG],async execute(ctx){const entry=getLocalServiceEntry(ctx.str("service"));if(!entry){return{ok:false,data:{registryPath:getServiceRegistryPath(),service:ctx.str("service")},message:`Local service not found: ${ctx.str("service")}`}}return{ok:true,data:{registryPath:getServiceRegistryPath(),service:summarizeService(entry),manifest:entry.manifest,normalizedManifest:toPublicNormalizedServiceTree(entry.normalizedManifest)}}}}];
@@ -1 +1,12 @@
1
- (function(_0x3ee12e,_0x4bfc50){const _0x14a5c0=a68_0x59eb,_0xc476b8=_0x3ee12e();while(!![]){try{const _0x1b33f3=-parseInt(_0x14a5c0(0x1cd))/0x1+-parseInt(_0x14a5c0(0x1ee))/0x2*(-parseInt(_0x14a5c0(0x1ab))/0x3)+parseInt(_0x14a5c0(0x1bd))/0x4*(-parseInt(_0x14a5c0(0x1b7))/0x5)+parseInt(_0x14a5c0(0x1b9))/0x6+parseInt(_0x14a5c0(0x1e5))/0x7+-parseInt(_0x14a5c0(0x1c0))/0x8*(-parseInt(_0x14a5c0(0x1c3))/0x9)+parseInt(_0x14a5c0(0x1c9))/0xa*(-parseInt(_0x14a5c0(0x1d6))/0xb);if(_0x1b33f3===_0x4bfc50)break;else _0xc476b8['push'](_0xc476b8['shift']());}catch(_0x3982d5){_0xc476b8['push'](_0xc476b8['shift']());}}}(a68_0x3aae,0xd44eb));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';function a68_0x59eb(_0x376465,_0x2a37cb){_0x376465=_0x376465-0x1a6;const _0x3aaef5=a68_0x3aae();let _0x59eb45=_0x3aaef5[_0x376465];return _0x59eb45;}import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME='service.json';function a68_0x3aae(){const _0x5899da=['utf8','normalizedManifest','hex','isArray','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','Local\x20service\x20not\x20found:\x20','sort','manifests','service','empty','services\x20must\x20be\x20an\x20array','reduce','updatedAt','sha256','.tmp','6xNDVAP','trim','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','ENOENT','push','version','risk','importedAt','serviceCode','command','invalid','homeDirName','6498770eLkigh','slice','3196158HQjsCw','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Unsupported\x20schemaVersion:\x20','Unsupported\x20service\x20registry\x20schemaVersion:\x20','4JGMyLT','update','find','1264HPMTQl','map','join','35991Trivmr','length','description','].manifest','validation','source','19070DVFeGq','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','name','$.services[','1202388oiTmJK','Cannot\x20write\x20service\x20registry:\x20','homeDir','registryIndex','target','registry','schemaVersion','parse','path','6413vQeQkg','Remove\x20or\x20migrate\x20','services','message','report','stringify','Service\x20manifest\x20file\x20not\x20found:\x20','errors','manifest','digest','startsWith','flatMap','code','findIndex','commandCount','11379571ACOWgP','Service\x20manifest\x20validation\x20failed:\x0a','object','sourceHash','bff\x20target\x20requires\x20functionName.','commands','warnings','].manifest.','now','1693346kTMrDx','filePath','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','Invalid\x20service\x20registry\x20JSON:\x20','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','toISOString'];a68_0x3aae=function(){return _0x5899da;};return a68_0x3aae();}export function getServiceRegistryPath(_0x4a3fab={}){const _0x55cde9=a68_0x59eb;return resolve(_0x4a3fab[_0x55cde9(0x1cf)]??homedir(),PRODUCT_CONFIG[_0x55cde9(0x1b6)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x20b5be={}){const _0x376b33=a68_0x59eb,_0x32bbf3=getServiceRegistryPath(_0x20b5be);if(!existsSync(_0x32bbf3))return emptyServiceRegistry();try{const _0x13e763=readFileSync(_0x32bbf3,'utf8');if(!_0x13e763[_0x376b33(0x1ac)]())return emptyServiceRegistry();const _0x2ed3e2=JSON[_0x376b33(0x1d4)](_0x13e763);if(_0x2ed3e2['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x376b33(0x1bc)+String(_0x2ed3e2[_0x376b33(0x1d3)]),_0x376b33(0x1d7)+_0x32bbf3+'.');if(!Array[_0x376b33(0x1f7)](_0x2ed3e2[_0x376b33(0x1d8)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2ed3e2['updatedAt'],'services':_0x2ed3e2[_0x376b33(0x1d8)]};}catch(_0x3437e6){if(_0x3437e6 instanceof Error&&_0x3437e6[_0x376b33(0x1cb)]==='CliError')throw _0x3437e6;throw CliErrors['validation'](_0x376b33(0x1f1)+_0x32bbf3,_0x376b33(0x1f2));}}export function writeServiceRegistry(_0x18d2b2,_0x2f5d21={}){const _0x3099b3=a68_0x59eb,_0xa097b0=getServiceRegistryPath(_0x2f5d21),_0x3cd618=dirname(_0xa097b0);!existsSync(_0x3cd618)&&mkdirSync(_0x3cd618,{'recursive':!![]});const _0x38b2e7=_0xa097b0+_0x3099b3(0x1aa);try{writeFileSync(_0x38b2e7,JSON[_0x3099b3(0x1db)](_0x18d2b2,null,0x2)+'\x0a',{'encoding':_0x3099b3(0x1f4),'mode':0x180}),renameSync(_0x38b2e7,_0xa097b0);}catch(_0xd99e7b){try{unlinkSync(_0x38b2e7);}catch{}if(_0xd99e7b?.[_0x3099b3(0x1e2)]===_0x3099b3(0x1ae))throw CliErrors[_0x3099b3(0x1c7)](_0x3099b3(0x1ce)+_0xa097b0);throw _0xd99e7b;}return _0xa097b0;}export function loadServiceManifestFromFile(_0x4fefa7){const _0x26c1d0=a68_0x59eb,_0x2bac27=resolve(_0x4fefa7);if(!existsSync(_0x2bac27))throw CliErrors[_0x26c1d0(0x1c7)](_0x26c1d0(0x1dc)+_0x4fefa7);let _0x579549;const _0x47bf7d=readFileSync(_0x2bac27,_0x26c1d0(0x1f4));try{_0x579549=JSON[_0x26c1d0(0x1d4)](_0x47bf7d);}catch{throw CliErrors[_0x26c1d0(0x1c7)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x4fefa7,_0x26c1d0(0x1f0));}const _0x119454=sha256(_0x47bf7d),_0x221ca0=extractLoadedServiceManifests(_0x579549,_0x119454),_0x57bdba=aggregateValidationReports(_0x221ca0),_0x5361b5=_0x221ca0[0x0];return{'filePath':_0x2bac27,'hash':_0x119454,'kind':isServiceRegistryLike(_0x579549)?_0x26c1d0(0x1d2):_0x26c1d0(0x1de),'manifest':_0x5361b5?.[_0x26c1d0(0x1de)]??_0x579549,'report':_0x57bdba,'normalizedManifest':_0x221ca0[_0x26c1d0(0x1c4)]===0x1?_0x5361b5?.[_0x26c1d0(0x1f5)]:undefined,'manifests':_0x221ca0};}export function importServiceManifest(_0xb9707d,_0x4ba73b={}){const _0x19525a=a68_0x59eb,_0x5ba5b5=loadServiceManifestFromFile(_0xb9707d);if(!_0x5ba5b5[_0x19525a(0x1da)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x5ba5b5[_0x19525a(0x1da)]),_0x19525a(0x1ca));if(_0x5ba5b5[_0x19525a(0x1fb)]['length']===0x0)throw CliErrors[_0x19525a(0x1c7)](_0x19525a(0x1ba),_0x19525a(0x1ad));const _0xe0b660=readServiceRegistry(_0x4ba73b),_0x88cbe=(_0x4ba73b[_0x19525a(0x1ed)]??(()=>new Date()))()[_0x19525a(0x1f3)](),_0x434afa=[];let _0xf2acd8=0x0,_0x2d7bfd=0x0;for(const _0xa3c924 of _0x5ba5b5['manifests']){if(!_0xa3c924[_0x19525a(0x1f5)])continue;const _0x13040b=_0xa3c924[_0x19525a(0x1f5)][_0x19525a(0x1fc)]['code'],_0x4369c3={'serviceCode':_0x13040b,'version':_0xa3c924['normalizedManifest'][_0x19525a(0x1b0)],'importedAt':_0x88cbe,'source':{'type':'file','path':_0x5ba5b5[_0x19525a(0x1ef)],'hash':_0xa3c924[_0x19525a(0x1e8)]},'manifest':_0xa3c924[_0x19525a(0x1de)],'normalizedManifest':_0xa3c924[_0x19525a(0x1f5)]},_0x1e9135=_0xe0b660[_0x19525a(0x1d8)][_0x19525a(0x1e3)](_0x31f3a7=>_0x31f3a7[_0x19525a(0x1b3)]===_0x13040b);_0x1e9135>=0x0?(_0xe0b660[_0x19525a(0x1d8)][_0x1e9135]=_0x4369c3,_0x2d7bfd++):(_0xe0b660['services']['push'](_0x4369c3),_0xf2acd8++),_0x434afa[_0x19525a(0x1af)](_0x4369c3);}_0xe0b660['services'][_0x19525a(0x1fa)]((_0xcd2f63,_0x24bb5e)=>_0xcd2f63[_0x19525a(0x1b3)]['localeCompare'](_0x24bb5e['serviceCode'])),_0xe0b660[_0x19525a(0x1a8)]=_0x88cbe;const _0xb15aec=writeServiceRegistry(_0xe0b660,_0x4ba73b);return{'registryPath':_0xb15aec,'entry':_0x434afa[0x0],'replaced':_0x434afa['length']===0x1?_0x2d7bfd===0x1:_0x2d7bfd>0x0,'entries':_0x434afa,'imported':_0xf2acd8,'updated':_0x2d7bfd,'serviceCount':_0xe0b660[_0x19525a(0x1d8)][_0x19525a(0x1c4)]};}export function exportServiceManifest(_0x26ffa2,_0x5ddc4d,_0x80de34={}){const _0x5a411c=a68_0x59eb,_0x23e697=getServiceRegistryPath(_0x80de34),_0x589aba=getLocalServiceEntry(_0x26ffa2,_0x80de34);if(!_0x589aba)throw CliErrors[_0x5a411c(0x1c7)](_0x5a411c(0x1f9)+_0x26ffa2,_0x5a411c(0x1f8));const _0x17eae3=resolve(_0x5ddc4d),_0x12673b=dirname(_0x17eae3);return!existsSync(_0x12673b)&&mkdirSync(_0x12673b,{'recursive':!![]}),writeFileSync(_0x17eae3,JSON[_0x5a411c(0x1db)](_0x589aba[_0x5a411c(0x1de)],null,0x2)+'\x0a',{'encoding':_0x5a411c(0x1f4),'mode':0x180}),{'registryPath':_0x23e697,'filePath':_0x17eae3,'entry':_0x589aba};}export function removeServiceManifest(_0x26cb8d,_0x4dbc6b={}){const _0x5b7ebd=a68_0x59eb,_0x481a27=readServiceRegistry(_0x4dbc6b),_0x8e7275=_0x26cb8d[_0x5b7ebd(0x1ac)](),_0x9188ef=_0x481a27[_0x5b7ebd(0x1d8)][_0x5b7ebd(0x1e3)](_0xf96d8c=>_0xf96d8c[_0x5b7ebd(0x1b3)]===_0x8e7275);if(_0x9188ef<0x0)throw CliErrors['validation']('Local\x20service\x20not\x20found:\x20'+_0x8e7275,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x26c215]=_0x481a27[_0x5b7ebd(0x1d8)]['splice'](_0x9188ef,0x1),_0x25d7f6=(_0x4dbc6b[_0x5b7ebd(0x1ed)]??(()=>new Date()))()[_0x5b7ebd(0x1f3)]();_0x481a27[_0x5b7ebd(0x1a8)]=_0x25d7f6;const _0x2222c7=writeServiceRegistry(_0x481a27,_0x4dbc6b);return{'registryPath':_0x2222c7,'entry':_0x26c215,'serviceCount':_0x481a27['services'][_0x5b7ebd(0x1c4)]};}export function listLocalServices(_0x1e9b97={}){const _0x28b59e=a68_0x59eb;return readServiceRegistry(_0x1e9b97)[_0x28b59e(0x1d8)];}export function getLocalServiceEntry(_0x582b5c,_0x24a101={}){const _0x16bd30=a68_0x59eb;return readServiceRegistry(_0x24a101)[_0x16bd30(0x1d8)][_0x16bd30(0x1bf)](_0x35a925=>_0x35a925[_0x16bd30(0x1b3)]===_0x582b5c[_0x16bd30(0x1ac)]());}export function listLocalServiceTrees(_0x443be9={}){const _0x1d7aca=a68_0x59eb;return readServiceRegistry(_0x443be9)['services'][_0x1d7aca(0x1c1)](_0x33625d=>_0x33625d[_0x1d7aca(0x1f5)]);}export function inspectServiceRegistry(_0x5c8fd3={}){const _0x34d3f6=a68_0x59eb,_0x1b8b07=getServiceRegistryPath(_0x5c8fd3);if(!existsSync(_0x1b8b07))return emptyServiceRegistryInspection(_0x1b8b07,'missing',![]);try{const _0x120d91=readFileSync(_0x1b8b07,_0x34d3f6(0x1f4));if(!_0x120d91['trim']())return emptyServiceRegistryInspection(_0x1b8b07,_0x34d3f6(0x1fd),!![]);const _0x391f5d=JSON['parse'](_0x120d91);if(_0x391f5d[_0x34d3f6(0x1d3)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1b8b07,'invalid',!![]),'schemaVersion':_0x391f5d['schemaVersion'],'message':_0x34d3f6(0x1bb)+String(_0x391f5d['schemaVersion'])};if(!Array[_0x34d3f6(0x1f7)](_0x391f5d['services']))return{...emptyServiceRegistryInspection(_0x1b8b07,_0x34d3f6(0x1b5),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x391f5d[_0x34d3f6(0x1a8)],'message':_0x34d3f6(0x1a6)};const _0x486ec8=_0x391f5d[_0x34d3f6(0x1d8)][_0x34d3f6(0x1c1)](summarizeLocalServiceEntry);return{'registryPath':_0x1b8b07,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x391f5d[_0x34d3f6(0x1a8)],'serviceCount':_0x486ec8[_0x34d3f6(0x1c4)],'commandCount':_0x486ec8[_0x34d3f6(0x1a7)]((_0xb6c55c,_0x23163a)=>_0xb6c55c+_0x23163a[_0x34d3f6(0x1e4)],0x0),'services':_0x486ec8};}catch(_0x2d2a75){return{...emptyServiceRegistryInspection(_0x1b8b07,_0x34d3f6(0x1b5),!![]),'message':_0x2d2a75 instanceof Error?_0x2d2a75[_0x34d3f6(0x1d9)]:String(_0x2d2a75)};}}export function formatValidationFailure(_0x1e7b0b){const _0x4b8d8e=a68_0x59eb,_0x491a18=_0x1e7b0b[_0x4b8d8e(0x1dd)][_0x4b8d8e(0x1c1)](_0xf87f90=>_0xf87f90[_0x4b8d8e(0x1d5)]+':\x20'+_0xf87f90['message']);return _0x4b8d8e(0x1e6)+_0x491a18[_0x4b8d8e(0x1c2)]('\x0a');}function extractLoadedServiceManifests(_0x5df5e7,_0x29839b){const _0x184503=a68_0x59eb;if(!isServiceRegistryLike(_0x5df5e7)){const _0x1641ca=_0x5df5e7,{manifest:_0x191142,errors:_0x296a53}=adaptServiceTreeManifestForLegacyFramework(_0x1641ca),_0x3b5ff0=validateServiceTreeManifest(_0x191142),_0x5374a9=mergeValidationErrors(_0x3b5ff0,_0x296a53);return[{'manifest':_0x1641ca,'report':_0x5374a9,'normalizedManifest':_0x5374a9['ok']?normalizeServiceTreeManifest(_0x191142):undefined,'sourceHash':_0x29839b}];}return _0x5df5e7[_0x184503(0x1d8)][_0x184503(0x1c1)]((_0x31e7ef,_0x48f500)=>{const _0x17f059=_0x184503,_0x4268bd=isObjectRecord(_0x31e7ef)?_0x31e7ef[_0x17f059(0x1de)]:undefined,{manifest:_0x24ccad,errors:_0x55441c}=adaptServiceTreeManifestForLegacyFramework(_0x4268bd),_0x441c0d=validateServiceTreeManifest(_0x24ccad),_0x2bc884=mergeValidationErrors(_0x441c0d,_0x55441c),_0x184d32=isObjectRecord(_0x31e7ef)&&typeof _0x31e7ef[_0x17f059(0x1b3)]==='string'?_0x31e7ef['serviceCode']:undefined;return{'manifest':_0x4268bd,'report':_0x2bc884,'normalizedManifest':_0x2bc884['ok']?normalizeServiceTreeManifest(_0x24ccad):undefined,'sourceHash':sha256(JSON[_0x17f059(0x1db)](_0x4268bd,null,0x2)+'\x0a'),'registryIndex':_0x48f500,'registryServiceCode':_0x184d32};});}function mergeValidationErrors(_0x3d311a,_0x1cfc96){const _0x3f4932=a68_0x59eb,_0x5580f0=_0x3d311a[_0x3f4932(0x1dd)][_0x3f4932(0x1c1)](_0x47c153=>_0x47c153[_0x3f4932(0x1d9)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x47c153,'message':_0x3f4932(0x1e9)}:_0x47c153),_0x1b792b=[..._0x1cfc96,..._0x5580f0];return{'ok':_0x1b792b[_0x3f4932(0x1c4)]===0x0,'errors':_0x1b792b,'warnings':_0x3d311a[_0x3f4932(0x1eb)]};}function aggregateValidationReports(_0x492419){const _0x38f7a0=a68_0x59eb,_0x72fb61=_0x492419[_0x38f7a0(0x1e1)](_0x4a6fb5=>_0x4a6fb5['registryIndex']===undefined?_0x4a6fb5[_0x38f7a0(0x1da)][_0x38f7a0(0x1dd)]:_0x4a6fb5[_0x38f7a0(0x1da)][_0x38f7a0(0x1dd)][_0x38f7a0(0x1c1)](_0x3346c7=>({..._0x3346c7,'path':prefixRegistryIssuePath(_0x4a6fb5[_0x38f7a0(0x1d0)],_0x3346c7[_0x38f7a0(0x1d5)])}))),_0x44d0f3=_0x492419[_0x38f7a0(0x1e1)](_0x3db86a=>_0x3db86a['registryIndex']===undefined?_0x3db86a['report'][_0x38f7a0(0x1eb)]:_0x3db86a['report'][_0x38f7a0(0x1eb)][_0x38f7a0(0x1c1)](_0x1b7fa3=>({..._0x1b7fa3,'path':prefixRegistryIssuePath(_0x3db86a[_0x38f7a0(0x1d0)],_0x1b7fa3[_0x38f7a0(0x1d5)])})));return{'ok':_0x72fb61['length']===0x0,'errors':_0x72fb61,'warnings':_0x44d0f3};}function prefixRegistryIssuePath(_0x101455,_0x3b42a4){const _0x3a99d4=a68_0x59eb;if(_0x3b42a4==='$')return _0x3a99d4(0x1cc)+_0x101455+_0x3a99d4(0x1c6);if(_0x3b42a4[_0x3a99d4(0x1e0)]('$.'))return _0x3a99d4(0x1cc)+_0x101455+_0x3a99d4(0x1c6)+_0x3b42a4[_0x3a99d4(0x1b8)](0x1);if(_0x3b42a4[_0x3a99d4(0x1e0)]('$['))return _0x3a99d4(0x1cc)+_0x101455+_0x3a99d4(0x1c6)+_0x3b42a4[_0x3a99d4(0x1b8)](0x1);return'$.services['+_0x101455+_0x3a99d4(0x1ec)+_0x3b42a4;}function isServiceRegistryLike(_0x424399){const _0x20c291=a68_0x59eb;return isObjectRecord(_0x424399)&&_0x424399[_0x20c291(0x1d3)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x20c291(0x1f7)](_0x424399[_0x20c291(0x1d8)]);}function isObjectRecord(_0x3dd638){const _0x8e4f4e=a68_0x59eb;return Boolean(_0x3dd638)&&typeof _0x3dd638===_0x8e4f4e(0x1e7)&&!Array[_0x8e4f4e(0x1f7)](_0x3dd638);}function emptyServiceRegistryInspection(_0x44bdf1,_0x19d941,_0x3fb21b){return{'registryPath':_0x44bdf1,'exists':_0x3fb21b,'status':_0x19d941,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x383efe){const _0x403820=a68_0x59eb,_0x50be00=_0x383efe['normalizedManifest'],_0x5930a6=_0x50be00[_0x403820(0x1ea)][_0x403820(0x1c1)](_0x35cf9a=>({'path':_0x35cf9a['cliPath'],'description':_0x35cf9a[_0x403820(0x1c5)],'risk':_0x35cf9a[_0x403820(0x1b1)],'targetKind':_0x35cf9a['target']['kind'],'targetCommand':_0x35cf9a[_0x403820(0x1d1)][_0x403820(0x1b4)]}));return{'serviceCode':_0x383efe['serviceCode'],'name':_0x50be00[_0x403820(0x1fc)][_0x403820(0x1cb)],'description':_0x50be00[_0x403820(0x1fc)]['description'],'version':_0x383efe['version'],'importedAt':_0x383efe[_0x403820(0x1b2)],'source':_0x383efe[_0x403820(0x1c8)],'commandCount':_0x5930a6[_0x403820(0x1c4)],'commands':_0x5930a6};}function sha256(_0x4ca9c5){const _0x253a4e=a68_0x59eb;return createHash(_0x253a4e(0x1a9))[_0x253a4e(0x1be)](_0x4ca9c5)[_0x253a4e(0x1df)](_0x253a4e(0x1f6));}
1
+ import{createHash}from"node:crypto";import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from"node:fs";import{homedir}from"node:os";import{dirname,resolve}from"node:path";import{normalizeServiceTreeManifest,validateServiceTreeManifest}from"@lovrabet/cli-framework";import{PRODUCT_CONFIG}from"../../constant/product.js";import{CliErrors}from"../../errors.js";import{adaptServiceTreeManifestForLegacyFramework}from"../../commands/service/function-name-adapter.js";export const SERVICE_REGISTRY_SCHEMA_VERSION=1;export const SERVICE_REGISTRY_FILE_NAME="service.json";export function getServiceRegistryPath(options={}){return resolve(options.homeDir??homedir(),PRODUCT_CONFIG.homeDirName,SERVICE_REGISTRY_FILE_NAME)}export function emptyServiceRegistry(){return{schemaVersion:SERVICE_REGISTRY_SCHEMA_VERSION,services:[]}}export function readServiceRegistry(options={}){const registryPath=getServiceRegistryPath(options);if(!existsSync(registryPath))return emptyServiceRegistry()
2
+ ;try{const raw=readFileSync(registryPath,"utf8");if(!raw.trim())return emptyServiceRegistry();const parsed=JSON.parse(raw);if(parsed.schemaVersion!==SERVICE_REGISTRY_SCHEMA_VERSION){throw CliErrors.validation(`Unsupported service registry schemaVersion: ${String(parsed.schemaVersion)}`,`Remove or migrate ${registryPath}.`)}if(!Array.isArray(parsed.services))return emptyServiceRegistry();return{schemaVersion:SERVICE_REGISTRY_SCHEMA_VERSION,updatedAt:parsed.updatedAt,services:parsed.services}}catch(err){if(err instanceof Error&&err.name==="CliError")throw err;throw CliErrors.validation(`Invalid service registry JSON: ${registryPath}`,"Fix the JSON file or move it aside and import services again.")}}export function writeServiceRegistry(registry,options={}){const registryPath=getServiceRegistryPath(options);const parent=dirname(registryPath);if(!existsSync(parent)){mkdirSync(parent,{recursive:true})}const tempPath=`${registryPath}.tmp`;try{
3
+ writeFileSync(tempPath,`${JSON.stringify(registry,null,2)}\n`,{encoding:"utf8",mode:384});renameSync(tempPath,registryPath)}catch(err){try{unlinkSync(tempPath)}catch{}if(err?.code==="ENOENT"){throw CliErrors.validation(`Cannot write service registry: ${registryPath}`)}throw err}return registryPath}export function loadServiceManifestFromFile(filePath){const absolutePath=resolve(filePath);if(!existsSync(absolutePath)){throw CliErrors.validation(`Service manifest file not found: ${filePath}`)}let parsed;const raw=readFileSync(absolutePath,"utf8");try{parsed=JSON.parse(raw)}catch{throw CliErrors.validation(`Invalid service manifest JSON: ${filePath}`,"Fix the JSON syntax and run service validate again.")}const fileHash=sha256(raw);const manifests=extractLoadedServiceManifests(parsed,fileHash);const report=aggregateValidationReports(manifests);const first=manifests[0];return{filePath:absolutePath,hash:fileHash,kind:isServiceRegistryLike(parsed)?"registry":"manifest",
4
+ manifest:first?.manifest??parsed,report:report,normalizedManifest:manifests.length===1?first?.normalizedManifest:undefined,manifests:manifests}}export function importServiceManifest(filePath,options={}){const loaded=loadServiceManifestFromFile(filePath);if(!loaded.report.ok){throw CliErrors.validation(formatValidationFailure(loaded.report),"Fix the service manifest and run service validate again.")}if(loaded.manifests.length===0){throw CliErrors.validation("Service registry has no services to import.","Add at least one service manifest, then run service import again.")}const registry=readServiceRegistry(options);const now=(options.now??(()=>new Date))().toISOString();const entries=[];let imported=0;let updated=0;for(const manifest of loaded.manifests){if(!manifest.normalizedManifest)continue;const serviceCode=manifest.normalizedManifest.service.code;const entry={serviceCode:serviceCode,version:manifest.normalizedManifest.version,importedAt:now,source:{type:"file",path:loaded.filePath,
5
+ hash:manifest.sourceHash},manifest:manifest.manifest,normalizedManifest:manifest.normalizedManifest};const index=registry.services.findIndex(item=>item.serviceCode===serviceCode);if(index>=0){registry.services[index]=entry;updated++}else{registry.services.push(entry);imported++}entries.push(entry)}registry.services.sort((a,b)=>a.serviceCode.localeCompare(b.serviceCode));registry.updatedAt=now;const registryPath=writeServiceRegistry(registry,options);return{registryPath:registryPath,entry:entries[0],replaced:entries.length===1?updated===1:updated>0,entries:entries,imported:imported,updated:updated,serviceCount:registry.services.length}}export function exportServiceManifest(serviceCode,filePath,options={}){const registryPath=getServiceRegistryPath(options);const entry=getLocalServiceEntry(serviceCode,options);if(!entry){throw CliErrors.validation(`Local service not found: ${serviceCode}`,"Run lovrabet service list to see imported services.")}const absolutePath=resolve(filePath)
6
+ ;const parent=dirname(absolutePath);if(!existsSync(parent)){mkdirSync(parent,{recursive:true})}writeFileSync(absolutePath,`${JSON.stringify(entry.manifest,null,2)}\n`,{encoding:"utf8",mode:384});return{registryPath:registryPath,filePath:absolutePath,entry:entry}}export function removeServiceManifest(serviceCode,options={}){const registry=readServiceRegistry(options);const normalizedCode=serviceCode.trim();const index=registry.services.findIndex(entry=>entry.serviceCode===normalizedCode);if(index<0){throw CliErrors.validation(`Local service not found: ${normalizedCode}`,"Run lovrabet service list to see imported services.")}const[entry]=registry.services.splice(index,1);const now=(options.now??(()=>new Date))().toISOString();registry.updatedAt=now;const registryPath=writeServiceRegistry(registry,options);return{registryPath:registryPath,entry:entry,serviceCount:registry.services.length}}export function listLocalServices(options={}){return readServiceRegistry(options).services}
7
+ export function getLocalServiceEntry(serviceCode,options={}){return readServiceRegistry(options).services.find(entry=>entry.serviceCode===serviceCode.trim())}export function listLocalServiceTrees(options={}){return readServiceRegistry(options).services.map(entry=>entry.normalizedManifest)}export function inspectServiceRegistry(options={}){const registryPath=getServiceRegistryPath(options);if(!existsSync(registryPath)){return emptyServiceRegistryInspection(registryPath,"missing",false)}try{const raw=readFileSync(registryPath,"utf8");if(!raw.trim()){return emptyServiceRegistryInspection(registryPath,"empty",true)}const parsed=JSON.parse(raw);if(parsed.schemaVersion!==SERVICE_REGISTRY_SCHEMA_VERSION){return{...emptyServiceRegistryInspection(registryPath,"invalid",true),schemaVersion:parsed.schemaVersion,message:`Unsupported schemaVersion: ${String(parsed.schemaVersion)}`}}if(!Array.isArray(parsed.services)){return{...emptyServiceRegistryInspection(registryPath,"invalid",true),
8
+ schemaVersion:SERVICE_REGISTRY_SCHEMA_VERSION,updatedAt:parsed.updatedAt,message:"services must be an array"}}const services=parsed.services.map(summarizeLocalServiceEntry);return{registryPath:registryPath,exists:true,status:"ok",schemaVersion:SERVICE_REGISTRY_SCHEMA_VERSION,updatedAt:parsed.updatedAt,serviceCount:services.length,commandCount:services.reduce((total,service)=>total+service.commandCount,0),services:services}}catch(err){return{...emptyServiceRegistryInspection(registryPath,"invalid",true),message:err instanceof Error?err.message:String(err)}}}export function formatValidationFailure(report){const lines=report.errors.map(issue=>`${issue.path}: ${issue.message}`);return`Service manifest validation failed:\n${lines.join("\n")}`}function extractLoadedServiceManifests(parsed,fileHash){if(!isServiceRegistryLike(parsed)){const manifest=parsed;const{manifest:frameworkManifest,errors:errors}=adaptServiceTreeManifestForLegacyFramework(manifest)
9
+ ;const frameworkReport=validateServiceTreeManifest(frameworkManifest);const report=mergeValidationErrors(frameworkReport,errors);return[{manifest:manifest,report:report,normalizedManifest:report.ok?normalizeServiceTreeManifest(frameworkManifest):undefined,sourceHash:fileHash}]}return parsed.services.map((entry,index)=>{const manifest=isObjectRecord(entry)?entry.manifest:undefined;const{manifest:frameworkManifest,errors:errors}=adaptServiceTreeManifestForLegacyFramework(manifest);const frameworkReport=validateServiceTreeManifest(frameworkManifest);const report=mergeValidationErrors(frameworkReport,errors);const registryServiceCode=isObjectRecord(entry)&&typeof entry.serviceCode==="string"?entry.serviceCode:undefined;return{manifest:manifest,report:report,normalizedManifest:report.ok?normalizeServiceTreeManifest(frameworkManifest):undefined,sourceHash:sha256(`${JSON.stringify(manifest,null,2)}\n`),registryIndex:index,registryServiceCode:registryServiceCode}})}
10
+ function mergeValidationErrors(report,errors){const publicFrameworkErrors=report.errors.map(issue=>issue.message==="bff target requires bffCode, bffId, or scriptName."?{...issue,message:"bff target requires functionName."}:issue);const mergedErrors=[...errors,...publicFrameworkErrors];return{ok:mergedErrors.length===0,errors:mergedErrors,warnings:report.warnings}}function aggregateValidationReports(manifests){const errors=manifests.flatMap(manifest=>manifest.registryIndex===undefined?manifest.report.errors:manifest.report.errors.map(issue=>({...issue,path:prefixRegistryIssuePath(manifest.registryIndex,issue.path)})));const warnings=manifests.flatMap(manifest=>manifest.registryIndex===undefined?manifest.report.warnings:manifest.report.warnings.map(issue=>({...issue,path:prefixRegistryIssuePath(manifest.registryIndex,issue.path)})));return{ok:errors.length===0,errors:errors,warnings:warnings}}function prefixRegistryIssuePath(index,path){if(path==="$")return`$.services[${index}].manifest`
11
+ ;if(path.startsWith("$."))return`$.services[${index}].manifest${path.slice(1)}`;if(path.startsWith("$["))return`$.services[${index}].manifest${path.slice(1)}`;return`$.services[${index}].manifest.${path}`}function isServiceRegistryLike(value){return isObjectRecord(value)&&value.schemaVersion===SERVICE_REGISTRY_SCHEMA_VERSION&&Array.isArray(value.services)}function isObjectRecord(value){return Boolean(value)&&typeof value==="object"&&!Array.isArray(value)}function emptyServiceRegistryInspection(registryPath,status,exists){return{registryPath:registryPath,exists:exists,status:status,serviceCount:0,commandCount:0,services:[]}}function summarizeLocalServiceEntry(entry){const tree=entry.normalizedManifest;const commands=tree.commands.map(command=>({path:command.cliPath,description:command.description,risk:command.risk,targetKind:command.target.kind,targetCommand:command.target.command}));return{serviceCode:entry.serviceCode,name:tree.service.name,description:tree.service.description,
12
+ version:entry.version,importedAt:entry.importedAt,source:entry.source,commandCount:commands.length,commands:commands}}function sha256(value){return createHash("sha256").update(value).digest("hex")}
@@ -1 +1,3 @@
1
- const a69_0x1006e9=a69_0x5629;(function(_0x8a592f,_0x3340c9){const _0x452e71=a69_0x5629,_0x17b390=_0x8a592f();while(!![]){try{const _0x4aade6=parseInt(_0x452e71(0x1d0))/0x1+-parseInt(_0x452e71(0x1cc))/0x2*(parseInt(_0x452e71(0x1d9))/0x3)+parseInt(_0x452e71(0x1e0))/0x4*(-parseInt(_0x452e71(0x1c0))/0x5)+parseInt(_0x452e71(0x1cb))/0x6+parseInt(_0x452e71(0x1db))/0x7+parseInt(_0x452e71(0x1c1))/0x8+-parseInt(_0x452e71(0x1d3))/0x9*(parseInt(_0x452e71(0x1c5))/0xa);if(_0x4aade6===_0x3340c9)break;else _0x17b390['push'](_0x17b390['shift']());}catch(_0x58632d){_0x17b390['push'](_0x17b390['shift']());}}}(a69_0xb806,0x58aaf));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';function a69_0x5629(_0x16fdd2,_0x258ec2){_0x16fdd2=_0x16fdd2-0x1c0;const _0xb806af=a69_0xb806();let _0x562940=_0xb806af[_0x16fdd2];return _0x562940;}export const createCommand={'service':'skill','command':a69_0x1006e9(0x1cf),'description':a69_0x1006e9(0x1d2),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x367595){const _0x4b4857=a69_0x1006e9,_0x5a1aa6=buildSkillCreatePlan(_0x367595[_0x4b4857(0x1c3)]('name'),_0x367595[_0x4b4857(0x1c3)]('type'),_0x367595[_0x4b4857(0x1c3)](_0x4b4857(0x1d7)));return{'method':_0x4b4857(0x1d6),'url':_0x5a1aa6[_0x4b4857(0x1c8)],'body':{'skillName':_0x5a1aa6[_0x4b4857(0x1c2)]['skillName'],'type':_0x5a1aa6[_0x4b4857(0x1c2)][_0x4b4857(0x1c6)],'selfContained':!![],'files':_0x5a1aa6[_0x4b4857(0x1c2)][_0x4b4857(0x1de)]['map'](_0x86f1fb=>_0x86f1fb['path'])},'description':_0x4b4857(0x1d5)};},async 'execute'(_0x5f2ba6){const _0x591777=a69_0x1006e9,_0x3dbfdb=buildSkillCreatePlan(_0x5f2ba6[_0x591777(0x1c3)](_0x591777(0x1d1)),_0x5f2ba6[_0x591777(0x1c3)](_0x591777(0x1c6)),_0x5f2ba6['str'](_0x591777(0x1d7)));return writeSkillDraft(_0x3dbfdb,_0x5f2ba6[_0x591777(0x1da)](_0x591777(0x1c4))),{'ok':!![],'data':{'skillName':_0x3dbfdb[_0x591777(0x1c2)][_0x591777(0x1dc)],'type':_0x3dbfdb[_0x591777(0x1c2)]['type'],'dir':_0x3dbfdb[_0x591777(0x1c8)],'files':_0x3dbfdb['rendered'][_0x591777(0x1de)][_0x591777(0x1df)](_0x32e356=>_0x32e356[_0x591777(0x1cd)])},'message':_0x591777(0x1e1)+_0x3dbfdb['rendered'][_0x591777(0x1dc)]};}};function buildSkillCreatePlan(_0x55fd13,_0x228734,_0x386f3a){const _0x3bd78d=a69_0x1006e9,_0x7cdb71=_0x228734[_0x3bd78d(0x1ca)](),_0x3e306c=renderSkillTemplate({'skillName':_0x55fd13,'type':_0x7cdb71});!_0x7cdb71&&writeCliSideChannelLine(_0x3bd78d(0x1c9));const _0x5703fc=resolve(normalizeSkillTarget(_0x386f3a));return{'rendered':_0x3e306c,'targetRoot':_0x5703fc,'skillDir':resolve(_0x5703fc,_0x3e306c['skillName'])};}function normalizeSkillTarget(_0x1d7ce9){const _0x19027f=a69_0x1006e9;return(_0x1d7ce9||DEFAULT_SKILL_TARGET)[_0x19027f(0x1ca)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x5c77f2,_0x3a49c1){const _0x50c1a5=a69_0x1006e9;if(existsSync(_0x5c77f2[_0x50c1a5(0x1c8)])){const _0xdb747d=lstatSync(_0x5c77f2[_0x50c1a5(0x1c8)]);if(!_0xdb747d['isDirectory']()||_0xdb747d[_0x50c1a5(0x1c7)]())throw CliErrors[_0x50c1a5(0x1d4)](_0x50c1a5(0x1d8)+_0x5c77f2[_0x50c1a5(0x1c8)]);if(!_0x3a49c1)throw CliErrors[_0x50c1a5(0x1d4)]('Skill\x20directory\x20already\x20exists:\x20'+_0x5c77f2[_0x50c1a5(0x1c8)],_0x50c1a5(0x1ce));}for(const _0x9fb227 of _0x5c77f2[_0x50c1a5(0x1c2)]['files']){const _0x30b380=resolve(_0x5c77f2['skillDir'],_0x9fb227[_0x50c1a5(0x1cd)]),_0x143257=dirname(_0x30b380);mkdirSync(_0x143257,{'recursive':!![]});if(existsSync(_0x30b380)&&lstatSync(_0x30b380)[_0x50c1a5(0x1c7)]())throw CliErrors[_0x50c1a5(0x1d4)]('Refusing\x20to\x20overwrite\x20symlink:\x20'+_0x30b380);writeFileSync(_0x30b380,_0x9fb227[_0x50c1a5(0x1dd)],'utf8');}}function a69_0xb806(){const _0x4d6de1=['str','force','20qpxahT','type','isSymbolicLink','skillDir','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','trim','4162296LpvdWs','78254foCHHd','path','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','create','184689HyVYIo','name','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','1579491yVsJDq','validation','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','WRITE','target','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','51MyVyHv','bool','4418449boDotP','skillName','content','files','map','4QdcxvZ','Created\x20local\x20Skill\x20draft\x20','1051430FnbBfa','640112fARjAI','rendered'];a69_0xb806=function(){return _0x4d6de1;};return a69_0xb806();}
1
+ import{existsSync,lstatSync,mkdirSync,writeFileSync}from"node:fs";import{dirname,resolve}from"node:path";import{CliErrors}from"../../../errors.js";import{writeCliSideChannelLine}from"../../../utils/write-cli-side-channel.js";import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from"../flags.js";import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from"../templates.js";export const createCommand={service:"skill",command:"create",description:"Create a local self-contained runtime Skill draft",risk:"read",requiresAuth:false,requiresAppCode:false,flags:[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async dryRun(ctx){const plan=buildSkillCreatePlan(ctx.str("name"),ctx.str("type"),ctx.str("target"));return{method:"WRITE",url:plan.skillDir,body:{skillName:plan.rendered.skillName,type:plan.rendered.type,selfContained:true,files:plan.rendered.files.map(file=>file.path)},description:"Create a local runtime Skill draft without uploading or publishing it."}},async execute(ctx){
2
+ const plan=buildSkillCreatePlan(ctx.str("name"),ctx.str("type"),ctx.str("target"));writeSkillDraft(plan,ctx.bool("force"));return{ok:true,data:{skillName:plan.rendered.skillName,type:plan.rendered.type,dir:plan.skillDir,files:plan.rendered.files.map(file=>file.path)},message:`Created local Skill draft ${plan.rendered.skillName}`}}};function buildSkillCreatePlan(name,type,target){const explicitType=type.trim();const rendered=renderSkillTemplate({skillName:name,type:explicitType});if(!explicitType){writeCliSideChannelLine("Omitting --type is deprecated; defaulting to write for compatibility. Pass --type read or --type write explicitly.")}const targetRoot=resolve(normalizeSkillTarget(target));return{rendered:rendered,targetRoot:targetRoot,skillDir:resolve(targetRoot,rendered.skillName)}}function normalizeSkillTarget(target){return(target||DEFAULT_SKILL_TARGET).trim()||DEFAULT_SKILL_TARGET}function writeSkillDraft(plan,force){if(existsSync(plan.skillDir)){
3
+ const stat=lstatSync(plan.skillDir);if(!stat.isDirectory()||stat.isSymbolicLink()){throw CliErrors.validation(`Skill path already exists and is not a writable directory: ${plan.skillDir}`)}if(!force){throw CliErrors.validation(`Skill directory already exists: ${plan.skillDir}`,"Pass --force to overwrite generated template files.")}}for(const file of plan.rendered.files){const filePath=resolve(plan.skillDir,file.path);const parent=dirname(filePath);mkdirSync(parent,{recursive:true});if(existsSync(filePath)&&lstatSync(filePath).isSymbolicLink()){throw CliErrors.validation(`Refusing to overwrite symlink: ${filePath}`)}writeFileSync(filePath,file.content,"utf8")}}
@@ -1 +1,4 @@
1
- const a70_0x819644=a70_0x2d06;(function(_0x418c27,_0x4daf07){const _0x1d2745=a70_0x2d06,_0x4cc67d=_0x418c27();while(!![]){try{const _0x44a589=-parseInt(_0x1d2745(0xe7))/0x1*(parseInt(_0x1d2745(0xd2))/0x2)+-parseInt(_0x1d2745(0xf0))/0x3+-parseInt(_0x1d2745(0xea))/0x4*(-parseInt(_0x1d2745(0xda))/0x5)+parseInt(_0x1d2745(0xcc))/0x6*(-parseInt(_0x1d2745(0xd9))/0x7)+parseInt(_0x1d2745(0xe0))/0x8+parseInt(_0x1d2745(0xd8))/0x9+-parseInt(_0x1d2745(0xdc))/0xa*(-parseInt(_0x1d2745(0xdb))/0xb);if(_0x44a589===_0x4daf07)break;else _0x4cc67d['push'](_0x4cc67d['shift']());}catch(_0x100302){_0x4cc67d['push'](_0x4cc67d['shift']());}}}(a70_0x4e5a,0x6845e));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';function a70_0x2d06(_0x18f8e2,_0x275e44){_0x18f8e2=_0x18f8e2-0xc9;const _0x4e5a39=a70_0x4e5a();let _0x2d0695=_0x4e5a39[_0x18f8e2];return _0x2d0695;}import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x17b412){const _0x214f54=a70_0x2d06,_0x5ad40e=_0x17b412['str'](_0x214f54(0xeb))['trim'](),_0x48a23e=_0x17b412['str'](_0x214f54(0xd1))[_0x214f54(0xf1)](),_0x2a8aff=_0x17b412['str'](_0x214f54(0xca));if(!_0x5ad40e||!_0x48a23e||_0x2a8aff!=='personal'&&_0x2a8aff!==_0x214f54(0xd0))throw CliErrors['validation']('--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.');return{'skillCode':_0x5ad40e,'version':_0x48a23e,'scope':_0x2a8aff};}async function readDiagramWriteInput(_0x3c50d2){const _0x52dc6b=a70_0x2d06,_0x308155=_0x3c50d2['num'](_0x52dc6b(0xe2)),_0x16de14=_0x3c50d2[_0x52dc6b(0xce)](_0x52dc6b(0xcb))[_0x52dc6b(0xf1)]();if(!Number[_0x52dc6b(0xef)](_0x308155)||_0x308155<0x0)throw CliErrors[_0x52dc6b(0xd3)]('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/[_0x52dc6b(0xe4)](_0x16de14))throw CliErrors[_0x52dc6b(0xd3)]('--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.');return{'expectedDiagramRevision':_0x308155,'sourceFingerprint':_0x16de14,'diagram':await readRequiredSkillDiagram(_0x3c50d2[_0x52dc6b(0xce)](_0x52dc6b(0xc9)))};}export const diagramValidateCommand={'service':a70_0x819644(0xe3),'command':a70_0x819644(0xf3),'description':a70_0x819644(0xe1),'risk':a70_0x819644(0xe6),'flags':WRITE_FLAGS,async 'execute'(_0x4a2af3){const _0x552c54=a70_0x819644,_0xd2a6f4=readDiagramTarget(_0x4a2af3),_0x5dfd10=await validateRuntimeSkillVersionDiagram(_0x4a2af3[_0x552c54(0xd5)],_0xd2a6f4[_0x552c54(0xde)],_0xd2a6f4['version'],_0xd2a6f4[_0x552c54(0xca)],await readDiagramWriteInput(_0x4a2af3));return{'ok':!![],'data':_0x5dfd10,'message':_0x552c54(0xdf)+_0xd2a6f4[_0x552c54(0xde)]+'@'+_0xd2a6f4[_0x552c54(0xd1)]+'.'};}};export const diagramPushCommand={'service':'skill','command':a70_0x819644(0xe8),'description':'Create\x20or\x20replace\x20a\x20Mermaid\x20diagram\x20for\x20a\x20specific\x20Skill\x20version','risk':a70_0x819644(0xee),'confirmationDescription':'Creates\x20or\x20replaces\x20a\x20Mermaid\x20diagram\x20for\x20an\x20exact\x20Skill\x20version.\x20The\x20write\x20is\x20rejected\x20if\x20the\x20server\x20version\x20has\x20changed.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20diagram\x20body.','flags':WRITE_FLAGS,async 'execute'(_0xb8e8d6){const _0x8991f3=a70_0x819644,_0x3db334=readDiagramTarget(_0xb8e8d6),_0x4c6b9f=await putRuntimeSkillVersionDiagram(_0xb8e8d6[_0x8991f3(0xd5)],_0x3db334[_0x8991f3(0xde)],_0x3db334[_0x8991f3(0xd1)],_0x3db334[_0x8991f3(0xca)],await readDiagramWriteInput(_0xb8e8d6));return{'ok':!![],'data':_0x4c6b9f,'message':_0x4c6b9f[_0x8991f3(0xd4)]===_0x8991f3(0xe5)?_0x8991f3(0xcf)+_0x3db334['skillCode']+'@'+_0x3db334[_0x8991f3(0xd1)]+'\x20is\x20unchanged.':(_0x4c6b9f[_0x8991f3(0xd4)]===_0x8991f3(0xd6)?_0x8991f3(0xec):'Updated')+_0x8991f3(0xdd)+_0x3db334[_0x8991f3(0xde)]+'@'+_0x3db334['version']+'.'};}};function a70_0x4e5a(){const _0x1c65fb=['1909wWksYs','diagram-push','found','20aITUbn','skill-code','Created','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','write','isInteger','592128OHmtvq','trim',';\x20first\x20write\x20expects\x20revision\x20','diagram-validate','diagram-file','scope','source-fingerprint','6HzjvVY',';\x20next\x20write\x20expects\x20revision\x20','str','Skill\x20diagram\x20for\x20','company','version','274zOZXXO','validation','action','appCode','created','Found\x20Skill\x20diagram\x20for\x20','4493970jOazbT','5207951RcUFFy','615320WRMyQp','1107458EJiMUZ','50ngUtYc','\x20Skill\x20diagram\x20for\x20','skillCode','Skill\x20diagram\x20validation\x20passed\x20for\x20','95712JtCAct','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','expected-diagram-revision','skill','test','unchanged','read'];a70_0x4e5a=function(){return _0x1c65fb;};return a70_0x4e5a();}export const diagramShowCommand={'service':a70_0x819644(0xe3),'command':'diagram-show','description':a70_0x819644(0xed),'risk':a70_0x819644(0xe6),'flags':TARGET_FLAGS,async 'execute'(_0x23835a){const _0x2b8f02=a70_0x819644,_0x113fa9=readDiagramTarget(_0x23835a),_0x49a234=await getRuntimeSkillVersionDiagram(_0x23835a['appCode'],_0x113fa9[_0x2b8f02(0xde)],_0x113fa9[_0x2b8f02(0xd1)],_0x113fa9[_0x2b8f02(0xca)]);return{'ok':!![],'data':_0x49a234,'message':_0x49a234[_0x2b8f02(0xe9)]?_0x2b8f02(0xd7)+_0x113fa9[_0x2b8f02(0xde)]+'@'+_0x113fa9['version']+_0x2b8f02(0xcd)+_0x49a234['expectedDiagramRevision']+'.':'No\x20Skill\x20diagram\x20is\x20stored\x20for\x20'+_0x113fa9[_0x2b8f02(0xde)]+'@'+_0x113fa9[_0x2b8f02(0xd1)]+_0x2b8f02(0xf2)+_0x49a234['expectedDiagramRevision']+'.'};}};
1
+ import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from"../../../core/api-client.js";import{CliErrors}from"../../../errors.js";import{readRequiredSkillDiagram}from"../diagram.js";import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from"../flags.js";const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG];const WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(ctx){const skillCode=ctx.str("skill-code").trim();const version=ctx.str("version").trim();const scope=ctx.str("scope");if(!skillCode||!version||scope!=="personal"&&scope!=="company"){throw CliErrors.validation("--skill-code, --version, and --scope personal|company are required.")}return{skillCode:skillCode,version:version,scope:scope}}async function readDiagramWriteInput(ctx){
2
+ const expectedDiagramRevision=ctx.num("expected-diagram-revision");const sourceFingerprint=ctx.str("source-fingerprint").trim();if(!Number.isInteger(expectedDiagramRevision)||expectedDiagramRevision<0){throw CliErrors.validation("--expected-diagram-revision must be a non-negative integer.")}if(!/^sha256:[0-9a-f]{64}$/.test(sourceFingerprint)){throw CliErrors.validation("--source-fingerprint must be lowercase sha256:<64 hex characters>.")}return{expectedDiagramRevision:expectedDiagramRevision,sourceFingerprint:sourceFingerprint,diagram:await readRequiredSkillDiagram(ctx.str("diagram-file"))}}export const diagramValidateCommand={service:"skill",command:"diagram-validate",description:"Validate a Mermaid diagram replacement for one exact Skill version",risk:"read",flags:WRITE_FLAGS,async execute(ctx){const target=readDiagramTarget(ctx);const result=await validateRuntimeSkillVersionDiagram(ctx.appCode,target.skillCode,target.version,target.scope,await readDiagramWriteInput(ctx));return{
3
+ ok:true,data:result,message:`Skill diagram validation passed for ${target.skillCode}@${target.version}.`}}};export const diagramPushCommand={service:"skill",command:"diagram-push",description:"Create or replace a Mermaid diagram for a specific Skill version",risk:"write",confirmationDescription:"Creates or replaces a Mermaid diagram for an exact Skill version. The write is rejected if the server version has changed. The confirmation UI does not show the diagram body.",flags:WRITE_FLAGS,async execute(ctx){const target=readDiagramTarget(ctx);const result=await putRuntimeSkillVersionDiagram(ctx.appCode,target.skillCode,target.version,target.scope,await readDiagramWriteInput(ctx));return{ok:true,data:result,message:result.action==="unchanged"?`Skill diagram for ${target.skillCode}@${target.version} is unchanged.`:`${result.action==="created"?"Created":"Updated"} Skill diagram for ${target.skillCode}@${target.version}.`}}};export const diagramShowCommand={service:"skill",
4
+ command:"diagram-show",description:"Show the current Mermaid diagram for one exact Skill version",risk:"read",flags:TARGET_FLAGS,async execute(ctx){const target=readDiagramTarget(ctx);const result=await getRuntimeSkillVersionDiagram(ctx.appCode,target.skillCode,target.version,target.scope);return{ok:true,data:result,message:result.found?`Found Skill diagram for ${target.skillCode}@${target.version}; next write expects revision ${result.expectedDiagramRevision}.`:`No Skill diagram is stored for ${target.skillCode}@${target.version}; first write expects revision ${result.expectedDiagramRevision}.`}}};
@@ -1 +1,6 @@
1
- const a71_0x4f3765=a71_0x847a;(function(_0x580ce7,_0x2696bd){const _0x5bc8e0=a71_0x847a,_0x57568b=_0x580ce7();while(!![]){try{const _0x11e305=-parseInt(_0x5bc8e0(0x155))/0x1+-parseInt(_0x5bc8e0(0x148))/0x2+-parseInt(_0x5bc8e0(0x161))/0x3+parseInt(_0x5bc8e0(0x139))/0x4+-parseInt(_0x5bc8e0(0x14e))/0x5*(-parseInt(_0x5bc8e0(0x163))/0x6)+-parseInt(_0x5bc8e0(0x157))/0x7*(-parseInt(_0x5bc8e0(0x166))/0x8)+-parseInt(_0x5bc8e0(0x149))/0x9*(-parseInt(_0x5bc8e0(0x14c))/0xa);if(_0x11e305===_0x2696bd)break;else _0x57568b['push'](_0x57568b['shift']());}catch(_0x5cd1db){_0x57568b['push'](_0x57568b['shift']());}}}(a71_0x1226,0xb59a0));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';const PACKAGE_DOWNLOAD_CONCURRENCY=0x4;export const installCommand={'service':'skill','command':a71_0x4f3765(0x165),'description':a71_0x4f3765(0x160),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x4c939c){return syncRuntimeSkills(_0x4c939c);}};async function syncRuntimeSkills(_0x157494){const _0x5ccac3=a71_0x4f3765,{downloadRuntimeSkillPackage:_0x5a7d56,listRuntimeSkills:_0x479e33}=await import(_0x5ccac3(0x145)),{linkEffectiveRuntimeSkills:_0x5af7cb,materializeRuntimeSkill:_0x3501e8,pruneStaleRuntimeSkillCache:_0x35630f,pruneStaleRuntimeSkillLinks:_0x84cb10,resolveRuntimeSkillInstallTarget:_0x1c6c0b,reuseMaterializedRuntimeSkill:_0x53b9a0}=await import(_0x5ccac3(0x15d)),_0x54fbdf=_0x157494[_0x5ccac3(0x140)](_0x5ccac3(0x14f)),_0x5e49a2=normalizeSyncScopes(_0x157494[_0x5ccac3(0x140)](_0x5ccac3(0x158))),_0x3edd6c=_0x157494[_0x5ccac3(0x151)]??_0x5ccac3(0x13b),_0x1bed37=_0x157494['accessKey'],_0x94bae6=_0x157494[_0x5ccac3(0x13c)]('force');if(!_0x1bed37)throw CliErrors[_0x5ccac3(0x13d)](_0x5ccac3(0x156));const _0x3b550a=_0x1c6c0b(_0x157494['appCode'],_0x157494[_0x5ccac3(0x13c)](_0x5ccac3(0x15f))?_0x5ccac3(0x15f):_0x5ccac3(0x162)),_0x5b5096=_0x1c6c0b(_0x157494[_0x5ccac3(0x159)],_0x3b550a[_0x5ccac3(0x158)]==='project'?'global':_0x5ccac3(0x15f)),_0x5599f6=await _0x479e33({'appCode':_0x157494[_0x5ccac3(0x159)],'scope':_0x5e49a2[_0x5ccac3(0x147)]===0x1?_0x5e49a2[0x0]:_0x5ccac3(0x13a),'code':_0x54fbdf['trim']()||undefined,'installableOnly':!![]}),_0x2d76e9=_0x5e49a2[_0x5ccac3(0x13f)](_0x5ccac3(0x144))?_0x5599f6['personal']:[],_0x4735bb=_0x5e49a2[_0x5ccac3(0x13f)]('company')?_0x5599f6[_0x5ccac3(0x142)]:[],_0x5680ff=new Set([..._0x2d76e9[_0x5ccac3(0x146)](_0x58fd5e=>_0x58fd5e[_0x5ccac3(0x15a)]?.[_0x5ccac3(0x15c)]())[_0x5ccac3(0x152)](_0x276ef8=>Boolean(_0x276ef8)),..._0x4735bb[_0x5ccac3(0x146)](_0x22d289=>_0x22d289[_0x5ccac3(0x15a)]?.[_0x5ccac3(0x15c)]())[_0x5ccac3(0x152)](_0x1062ac=>Boolean(_0x1062ac))]),_0xd6a723=_0x54fbdf[_0x5ccac3(0x15c)]()?[_0x54fbdf['trim']()]:undefined,_0x5b0a76=_0x5e49a2['length']===0x2&&_0x5e49a2[_0x5ccac3(0x13f)](_0x5ccac3(0x144))&&_0x5e49a2[_0x5ccac3(0x13f)](_0x5ccac3(0x142)),_0x54a835=_0x5b0a76?_0x84cb10(_0x3b550a,_0x5680ff,_0xd6a723):[],_0x4d57e4=_0x35630f({'env':_0x3edd6c,'accessKey':_0x1bed37,'appCode':_0x157494[_0x5ccac3(0x159)],'activeSkillCodes':_0x5680ff,'pruneSkillCodes':_0xd6a723,'scopes':_0x5e49a2,'protectedLinkRoots':_0x5b5096[_0x5ccac3(0x14a)]}),_0x58504e=[..._0x2d76e9[_0x5ccac3(0x146)](_0x44be3d=>({'skill':_0x44be3d,'scope':_0x5ccac3(0x144)})),..._0x4735bb[_0x5ccac3(0x146)](_0x18b091=>({'skill':_0x18b091,'scope':_0x5ccac3(0x142)}))],_0x55ed5a=await mapConcurrent(_0x58504e,PACKAGE_DOWNLOAD_CONCURRENCY,async({skill:_0x858d24,scope:_0x4d9860})=>{const _0xee9153=_0x5ccac3,_0x5a42b4=_0x53b9a0(_0x858d24,_0x4d9860,{'env':_0x3edd6c,'accessKey':_0x1bed37,'appCode':_0x157494[_0xee9153(0x159)]});if(_0x5a42b4)return _0x5a42b4;return _0x3501e8(_0x858d24,_0x4d9860,{'env':_0x3edd6c,'accessKey':_0x1bed37,'appCode':_0x157494[_0xee9153(0x159)],'force':_0x94bae6,'packageBytes':await downloadSkillPackage(_0x858d24,_0x4d9860,_0x157494['appCode'],_0x5a7d56)});}),_0x4e9752=_0x5af7cb(_0x55ed5a,_0x3b550a),_0x2895cb=countLinkActions(_0x4e9752);return{'ok':!![],'data':{'appCode':_0x157494[_0x5ccac3(0x159)],..._0x3b550a[_0x5ccac3(0x158)]==='project'?{'installTarget':{'scope':_0x3b550a[_0x5ccac3(0x158)],'skillRoots':[..._0x3b550a[_0x5ccac3(0x14a)]]}}:{},'personal':_0x2d76e9[_0x5ccac3(0x147)],'company':_0x4735bb['length'],'materialized':_0x55ed5a[_0x5ccac3(0x147)],'links':{'total':_0x4e9752[_0x5ccac3(0x147)],'created':_0x2895cb[_0x5ccac3(0x13e)]??0x0,'updated':_0x2895cb[_0x5ccac3(0x150)]??0x0,'unchanged':_0x2895cb[_0x5ccac3(0x15b)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x54a835[_0x5ccac3(0x152)](_0x13b922=>_0x13b922[_0x5ccac3(0x14b)]==='removed')[_0x5ccac3(0x147)],'cacheDirs':_0x4d57e4[_0x5ccac3(0x152)](_0x44189d=>_0x44189d[_0x5ccac3(0x14b)]==='removed')['length'],'skipped':[..._0x54a835,..._0x4d57e4][_0x5ccac3(0x152)](_0x42639b=>_0x42639b[_0x5ccac3(0x14b)]===_0x5ccac3(0x143))['length']},'skills':{'personal':_0x2d76e9[_0x5ccac3(0x146)](summarizeRuntimeSkill),'company':_0x4735bb[_0x5ccac3(0x146)](summarizeRuntimeSkill)}},'message':_0x5ccac3(0x14d)+_0x2d76e9['length']+_0x5ccac3(0x141)+_0x4735bb[_0x5ccac3(0x147)]+_0x5ccac3(0x164)};}async function mapConcurrent(_0x47d135,_0x34f9ef,_0x24b8c8){const _0x52d2a7=a71_0x4f3765,_0x1d8a95=new Array(_0x47d135[_0x52d2a7(0x147)]);let _0x765577=0x0;const _0x35ff4d=Array[_0x52d2a7(0x153)]({'length':Math[_0x52d2a7(0x154)](_0x34f9ef,_0x47d135[_0x52d2a7(0x147)])},async()=>{const _0x244c5e=_0x52d2a7;while(_0x765577<_0x47d135[_0x244c5e(0x147)]){const _0x6ea241=_0x765577;_0x765577+=0x1,_0x1d8a95[_0x6ea241]=await _0x24b8c8(_0x47d135[_0x6ea241]);}});return await Promise[_0x52d2a7(0x13a)](_0x35ff4d),_0x1d8a95;}function a71_0x847a(_0x4f22cd,_0x19e60f){_0x4f22cd=_0x4f22cd-0x139;const _0x12265e=a71_0x1226();let _0x847acf=_0x12265e[_0x4f22cd];return _0x847acf;}async function downloadSkillPackage(_0x234ebc,_0x17ff68,_0x134747,_0x380b92){const _0x426b82=a71_0x4f3765,_0x431bc4=_0x234ebc[_0x426b82(0x15e)]?.[_0x426b82(0x15c)]();return _0x431bc4?_0x380b92(_0x17ff68,_0x234ebc[_0x426b82(0x15a)],_0x134747,_0x431bc4):_0x380b92(_0x17ff68,_0x234ebc[_0x426b82(0x15a)],_0x134747);}function a71_0x1226(){const _0x4b22b0=['1841320Qvvzmz','603nfSIcj','skillRoots','action','256770Hsoeow','Installed\x20','55hhgEHn','code','updated','envName','filter','from','min','242451UbBIcq','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','15561tHqAfV','scope','appCode','skillCode','unchanged','trim','../../../skills/runtime-skill-sync.js','version','project','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','1087053UKxRmB','global','32916UdzayU','\x20company\x20Skill(s).','install','912qaRtzE','940700AESPRu','all','production','bool','authRequired','created','includes','str','\x20personal\x20and\x20','company','skipped','personal','../../../core/api-client.js','map','length'];a71_0x1226=function(){return _0x4b22b0;};return a71_0x1226();}function countLinkActions(_0x1bf508){return _0x1bf508['reduce']((_0xd23d67,_0x56576a)=>{const _0xb3c7a5=a71_0x847a;return _0xd23d67[_0x56576a[_0xb3c7a5(0x14b)]]=(_0xd23d67[_0x56576a[_0xb3c7a5(0x14b)]]??0x0)+0x1,_0xd23d67;},{});}
1
+ import{CliErrors}from"../../../errors.js";import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from"../flags.js";import{normalizeSyncScopes}from"../scopes.js";import{summarizeRuntimeSkill}from"../summary.js";const PACKAGE_DOWNLOAD_CONCURRENCY=4;export const installCommand={service:"skill",command:"install",description:"Install current-app business Skills into user-level Agent skill directories",risk:"read",requiresAuth:true,requiresAppCode:true,hasFormat:false,flags:[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async execute(ctx){return syncRuntimeSkills(ctx)}};async function syncRuntimeSkills(ctx){const{downloadRuntimeSkillPackage:downloadRuntimeSkillPackage,listRuntimeSkills:listRuntimeSkills}=await(import("../../../core/api-client.js"))
2
+ ;const{linkEffectiveRuntimeSkills:linkEffectiveRuntimeSkills,materializeRuntimeSkill:materializeRuntimeSkill,pruneStaleRuntimeSkillCache:pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks:pruneStaleRuntimeSkillLinks,resolveRuntimeSkillInstallTarget:resolveRuntimeSkillInstallTarget,reuseMaterializedRuntimeSkill:reuseMaterializedRuntimeSkill}=await(import("../../../skills/runtime-skill-sync.js"));const code=ctx.str("code");const scopes=normalizeSyncScopes(ctx.str("scope"));const env=ctx.envName??"production";const accessKey=ctx.accessKey;const force=ctx.bool("force");if(!accessKey){throw CliErrors.authRequired("Business Skill installation requires authentication. Run `lovrabet auth login`, or use `lovrabet cli-skill install` for CLI Built-in Skill setup.")}const installTarget=resolveRuntimeSkillInstallTarget(ctx.appCode,ctx.bool("project")?"project":"global");const counterpartTarget=resolveRuntimeSkillInstallTarget(ctx.appCode,installTarget.scope==="project"?"global":"project")
3
+ ;const remote=await listRuntimeSkills({appCode:ctx.appCode,scope:scopes.length===1?scopes[0]:"all",code:code.trim()||undefined,installableOnly:true});const personal=scopes.includes("personal")?remote.personal:[];const company=scopes.includes("company")?remote.company:[];const activeSkillCodes=new Set([...personal.map(skill=>skill.skillCode?.trim()).filter(item=>Boolean(item)),...company.map(skill=>skill.skillCode?.trim()).filter(item=>Boolean(item))]);const pruneSkillCodes=code.trim()?[code.trim()]:undefined;const shouldPruneLinks=scopes.length===2&&scopes.includes("personal")&&scopes.includes("company");const prunedLinks=shouldPruneLinks?pruneStaleRuntimeSkillLinks(installTarget,activeSkillCodes,pruneSkillCodes):[];const prunedCache=pruneStaleRuntimeSkillCache({env:env,accessKey:accessKey,appCode:ctx.appCode,activeSkillCodes:activeSkillCodes,pruneSkillCodes:pruneSkillCodes,scopes:scopes,protectedLinkRoots:counterpartTarget.skillRoots});const installItems=[...personal.map(skill=>({
4
+ skill:skill,scope:"personal"})),...company.map(skill=>({skill:skill,scope:"company"}))];const materialized=await mapConcurrent(installItems,PACKAGE_DOWNLOAD_CONCURRENCY,async({skill:skill,scope:scope})=>{const reused=reuseMaterializedRuntimeSkill(skill,scope,{env:env,accessKey:accessKey,appCode:ctx.appCode});if(reused)return reused;return materializeRuntimeSkill(skill,scope,{env:env,accessKey:accessKey,appCode:ctx.appCode,force:force,packageBytes:await downloadSkillPackage(skill,scope,ctx.appCode,downloadRuntimeSkillPackage)})});const links=linkEffectiveRuntimeSkills(materialized,installTarget);const linkCounts=countLinkActions(links);return{ok:true,data:{appCode:ctx.appCode,...installTarget.scope==="project"?{installTarget:{scope:installTarget.scope,skillRoots:[...installTarget.skillRoots]}}:{},personal:personal.length,company:company.length,materialized:materialized.length,links:{total:links.length,created:linkCounts.created??0,updated:linkCounts.updated??0,
5
+ unchanged:linkCounts.unchanged??0,skipped:0,conflicted:0},pruned:{links:prunedLinks.filter(item=>item.action==="removed").length,cacheDirs:prunedCache.filter(item=>item.action==="removed").length,skipped:[...prunedLinks,...prunedCache].filter(item=>item.action==="skipped").length},skills:{personal:personal.map(summarizeRuntimeSkill),company:company.map(summarizeRuntimeSkill)}},message:`Installed ${personal.length} personal and ${company.length} company Skill(s).`}}async function mapConcurrent(items,concurrency,operation){const results=new Array(items.length);let nextIndex=0;const workers=Array.from({length:Math.min(concurrency,items.length)},async()=>{while(nextIndex<items.length){const index=nextIndex;nextIndex+=1;results[index]=await operation(items[index])}});await Promise.all(workers);return results}async function downloadSkillPackage(skill,scope,appCode,downloadPackage){const version=skill.version?.trim()
6
+ ;return version?downloadPackage(scope,skill.skillCode,appCode,version):downloadPackage(scope,skill.skillCode,appCode)}function countLinkActions(links){return links.reduce((acc,link)=>{acc[link.action]=(acc[link.action]??0)+1;return acc},{})}
@@ -1 +1,3 @@
1
- const a72_0x12031c=a72_0x3daa;(function(_0x2f3d8c,_0x42660d){const _0x330f8a=a72_0x3daa,_0x529a42=_0x2f3d8c();while(!![]){try{const _0x3e3cd7=parseInt(_0x330f8a(0xb1))/0x1+parseInt(_0x330f8a(0xa0))/0x2+-parseInt(_0x330f8a(0x99))/0x3+parseInt(_0x330f8a(0x9e))/0x4*(-parseInt(_0x330f8a(0x9b))/0x5)+parseInt(_0x330f8a(0x98))/0x6*(-parseInt(_0x330f8a(0xa7))/0x7)+parseInt(_0x330f8a(0x9d))/0x8+parseInt(_0x330f8a(0x95))/0x9*(parseInt(_0x330f8a(0xa2))/0xa);if(_0x3e3cd7===_0x42660d)break;else _0x529a42['push'](_0x529a42['shift']());}catch(_0x35fa84){_0x529a42['push'](_0x529a42['shift']());}}}(a72_0x9ac1,0x9f609));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a72_0x12031c(0xb2),'command':a72_0x12031c(0xab),'description':a72_0x12031c(0xaf),'risk':a72_0x12031c(0xaa),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x3336c3){const _0x3a90d5=a72_0x12031c,_0x12012c=_0x3336c3[_0x3a90d5(0xae)]('code'),_0x56df8e=normalizeListScope(_0x3336c3[_0x3a90d5(0xae)]('scope'));if(_0x3336c3['bool'](_0x3a90d5(0x94))){const _0x51484c=_0x3336c3['accessKey'];if(!_0x51484c)throw CliErrors[_0x3a90d5(0xb0)]();const {listLocalRuntimeSkills:_0x197825,resolveRuntimeSkillInstallTarget:_0x2d6faf}=await import(_0x3a90d5(0xa3)),_0x3987fb=_0x2d6faf(_0x3336c3[_0x3a90d5(0xb3)],_0x3336c3[_0x3a90d5(0x96)](_0x3a90d5(0xa1))?_0x3a90d5(0xa1):_0x3a90d5(0x9f)),_0x25e6b4=_0x197825({'env':_0x3336c3[_0x3a90d5(0xac)]??_0x3a90d5(0xa9),'accessKey':_0x51484c,'appCode':_0x3336c3['appCode'],'scopes':listScopeToRuntimeScopes(_0x56df8e),'code':_0x12012c[_0x3a90d5(0xa6)]()||undefined},_0x3987fb),_0xdac107=groupLocalRuntimeSkills(_0x25e6b4);return{'ok':!![],'data':{'appCode':_0x3336c3['appCode'],'source':_0x3a90d5(0x94),..._0x3987fb[_0x3a90d5(0xb4)]==='project'?{'installScope':_0x3987fb['scope']}:{},'scope':_0x56df8e,'total':_0x25e6b4[_0x3a90d5(0x9a)],'personal':_0xdac107[_0x3a90d5(0xb8)]['length'],'company':_0xdac107[_0x3a90d5(0x97)][_0x3a90d5(0x9a)],'items':_0x25e6b4[_0x3a90d5(0xb6)](summarizeLocalRuntimeSkill),'skills':{'personal':_0xdac107[_0x3a90d5(0xb8)]['map'](summarizeLocalRuntimeSkill),'company':_0xdac107[_0x3a90d5(0x97)][_0x3a90d5(0xb6)](summarizeLocalRuntimeSkill)}},'message':_0x3a90d5(0x9c)+_0x25e6b4[_0x3a90d5(0x9a)]+_0x3a90d5(0xad)};}const {listRuntimeSkills:_0x4c3184}=await import(_0x3a90d5(0xb7)),_0x38b70e=await _0x4c3184({'appCode':_0x3336c3[_0x3a90d5(0xb3)],'scope':listScopeToRemoteScope(_0x56df8e),'code':_0x12012c['trim']()||undefined}),_0x1155ad=shouldListScope(_0x56df8e,_0x3a90d5(0xb8))?_0x38b70e[_0x3a90d5(0xb8)]??[]:[],_0x5aa679=shouldListScope(_0x56df8e,'company')?_0x38b70e[_0x3a90d5(0x97)]??[]:[],_0x142b2a=[..._0x1155ad,..._0x5aa679];return{'ok':!![],'data':{'appCode':_0x3336c3[_0x3a90d5(0xb3)],'source':_0x3a90d5(0xb5),'scope':_0x56df8e,'total':_0x142b2a[_0x3a90d5(0x9a)],'personal':_0x1155ad['length'],'company':_0x5aa679[_0x3a90d5(0x9a)],'items':_0x142b2a[_0x3a90d5(0xb6)](summarizeRuntimeSkill),'skills':{'personal':_0x1155ad[_0x3a90d5(0xb6)](summarizeRuntimeSkill),'company':_0x5aa679[_0x3a90d5(0xb6)](summarizeRuntimeSkill)}},'message':_0x3a90d5(0x9c)+_0x142b2a[_0x3a90d5(0x9a)]+_0x3a90d5(0xa5)};}};function a72_0x9ac1(){const _0x2d6e71=['map','../../../core/api-client.js','personal','local','101349mwMxxe','bool','company','5720958LITJYl','856869hEmRlR','length','11240qcWDIX','Listed\x20','8999920ULgnKv','1668lzKpCr','global','72192FUZmkc','project','970cvDwYh','../../../skills/runtime-skill-sync.js','builtin','\x20remote\x20Skill(s).','trim','7MLfIOX','filter','production','read','list','envName','\x20local\x20Skill(s).','str','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','authRequired','575938WNZgQY','skill','appCode','scope','remote'];a72_0x9ac1=function(){return _0x2d6e71;};return a72_0x9ac1();}function a72_0x3daa(_0x4d969f,_0x41d742){_0x4d969f=_0x4d969f-0x94;const _0x9ac1d8=a72_0x9ac1();let _0x3daade=_0x9ac1d8[_0x4d969f];return _0x3daade;}function groupLocalRuntimeSkills(_0x8b4e3){const _0x43e546=a72_0x12031c;return{'personal':_0x8b4e3[_0x43e546(0xa8)](_0x4f3220=>_0x4f3220['scope']===_0x43e546(0xb8)),'company':_0x8b4e3[_0x43e546(0xa8)](_0xe53017=>_0xe53017[_0x43e546(0xb4)]==='company'),'builtin':_0x8b4e3[_0x43e546(0xa8)](_0x438984=>_0x438984[_0x43e546(0xb4)]===_0x43e546(0xa4))};}
1
+ import{CliErrors}from"../../../errors.js";import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from"../flags.js";import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from"../scopes.js";import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from"../summary.js";export const listCommand={service:"skill",command:"list",description:"List runtime Skills from remote or CLI-managed local cache",risk:"read",flags:[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async execute(ctx){const code=ctx.str("code");const scope=normalizeListScope(ctx.str("scope"));if(ctx.bool("local")){const accessKey=ctx.accessKey;if(!accessKey){throw CliErrors.authRequired()}const{listLocalRuntimeSkills:listLocalRuntimeSkills,resolveRuntimeSkillInstallTarget:resolveRuntimeSkillInstallTarget}=await(import("../../../skills/runtime-skill-sync.js"));const installTarget=resolveRuntimeSkillInstallTarget(ctx.appCode,ctx.bool("project")?"project":"global")
2
+ ;const localItems=listLocalRuntimeSkills({env:ctx.envName??"production",accessKey:accessKey,appCode:ctx.appCode,scopes:listScopeToRuntimeScopes(scope),code:code.trim()||undefined},installTarget);const grouped=groupLocalRuntimeSkills(localItems);return{ok:true,data:{appCode:ctx.appCode,source:"local",...installTarget.scope==="project"?{installScope:installTarget.scope}:{},scope:scope,total:localItems.length,personal:grouped.personal.length,company:grouped.company.length,items:localItems.map(summarizeLocalRuntimeSkill),skills:{personal:grouped.personal.map(summarizeLocalRuntimeSkill),company:grouped.company.map(summarizeLocalRuntimeSkill)}},message:`Listed ${localItems.length} local Skill(s).`}}const{listRuntimeSkills:listRuntimeSkills}=await(import("../../../core/api-client.js"));const response=await listRuntimeSkills({appCode:ctx.appCode,scope:listScopeToRemoteScope(scope),code:code.trim()||undefined});const personal=shouldListScope(scope,"personal")?response.personal??[]:[]
3
+ ;const company=shouldListScope(scope,"company")?response.company??[]:[];const items=[...personal,...company];return{ok:true,data:{appCode:ctx.appCode,source:"remote",scope:scope,total:items.length,personal:personal.length,company:company.length,items:items.map(summarizeRuntimeSkill),skills:{personal:personal.map(summarizeRuntimeSkill),company:company.map(summarizeRuntimeSkill)}},message:`Listed ${items.length} remote Skill(s).`}}};function groupLocalRuntimeSkills(items){return{personal:items.filter(item=>item.scope==="personal"),company:items.filter(item=>item.scope==="company"),builtin:items.filter(item=>item.scope==="builtin")}}
@@ -1 +1 @@
1
- function a73_0x54fd(){const _0x28be8c=['write','Reads\x20local\x20Skill\x20content:\x20personal\x20scope\x20is\x20saved\x20immediately;\x20company\x20scope\x20submits\x20a\x20new\x20version\x20for\x20review.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20directory\x20path\x20or\x20Skill\x20body.','6Rawwrk','11489952cYHLmH','1670vEvhhw','190244MZIgUR','2867364voEjVS','6282556NChQfq','25fjIFgc','push','1082124NdUkKA','2237966ZhZfRB','19665ANxMJd','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20scope,\x20or\x20submit\x20a\x20company-scope\x20version\x20for\x20review'];a73_0x54fd=function(){return _0x28be8c;};return a73_0x54fd();}const a73_0x5ef896=a73_0x30f9;(function(_0x393045,_0x5d4b1e){const _0x1b9211=a73_0x30f9,_0x4d56f3=_0x393045();while(!![]){try{const _0x4c5ab4=parseInt(_0x1b9211(0xe1))/0x1+parseInt(_0x1b9211(0xd9))/0x2+parseInt(_0x1b9211(0xe2))/0x3+-parseInt(_0x1b9211(0xd8))/0x4*(parseInt(_0x1b9211(0xd6))/0x5)+parseInt(_0x1b9211(0xde))/0x6*(parseInt(_0x1b9211(0xe3))/0x7)+-parseInt(_0x1b9211(0xdf))/0x8+-parseInt(_0x1b9211(0xda))/0x9*(-parseInt(_0x1b9211(0xe0))/0xa);if(_0x4c5ab4===_0x5d4b1e)break;else _0x4d56f3['push'](_0x4d56f3['shift']());}catch(_0x12004f){_0x4d56f3['push'](_0x4d56f3['shift']());}}}(a73_0x54fd,0xb44d7));function a73_0x30f9(_0x207afc,_0x2459d7){_0x207afc=_0x207afc-0xd6;const _0x54fd10=a73_0x54fd();let _0x30f901=_0x54fd10[_0x207afc];return _0x30f901;}import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';export const pushCommand={'service':'skill','command':a73_0x5ef896(0xd7),'description':a73_0x5ef896(0xdb),'risk':a73_0x5ef896(0xdc),'confirmationDescription':a73_0x5ef896(0xdd),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
1
+ import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from"../flags.js";import{skillPushDryRun,skillPushExecute}from"../push-execute.js";export const pushCommand={service:"skill",command:"push",description:"Push a local Skill directory to personal scope, or submit a company-scope version for review",risk:"write",confirmationDescription:"Reads local Skill content: personal scope is saved immediately; company scope submits a new version for review. The confirmation UI does not show the directory path or Skill body.",flags:[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],dryRun:skillPushDryRun,execute:skillPushExecute};
@@ -1 +1 @@
1
- const a74_0x171c8a=a74_0x3f33;(function(_0x3739a4,_0x5b8e7c){const _0x443926=a74_0x3f33,_0x2e0ac6=_0x3739a4();while(!![]){try{const _0x262bdc=parseInt(_0x443926(0x1ce))/0x1+-parseInt(_0x443926(0x1d6))/0x2+-parseInt(_0x443926(0x1db))/0x3+parseInt(_0x443926(0x1cc))/0x4+parseInt(_0x443926(0x1cf))/0x5+parseInt(_0x443926(0x1ca))/0x6*(parseInt(_0x443926(0x1d1))/0x7)+-parseInt(_0x443926(0x1cb))/0x8;if(_0x262bdc===_0x5b8e7c)break;else _0x2e0ac6['push'](_0x2e0ac6['shift']());}catch(_0x4dde31){_0x2e0ac6['push'](_0x2e0ac6['shift']());}}}(a74_0xc638,0x4368c));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';function a74_0xc638(){const _0x1b00d7=['709428KCJNAK','strict','errors','type','warnings','461508MJqmab','6RutPrH','4287480aLMEaL','1889544bXuWkP','bool','269872kDvtwx','592445fEzVbv','Skill\x20validation\x20passed.','3218922nnALDO','dir','validate','read','skill'];a74_0xc638=function(){return _0x1b00d7;};return a74_0xc638();}function a74_0x3f33(_0x5e2c2a,_0x193f46){_0x5e2c2a=_0x5e2c2a-0x1ca;const _0xc6380d=a74_0xc638();let _0x3f33ac=_0xc6380d[_0x5e2c2a];return _0x3f33ac;}export const validateCommand={'service':a74_0x171c8a(0x1d5),'command':a74_0x171c8a(0x1d3),'description':'Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','risk':a74_0x171c8a(0x1d4),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x21d358){const _0x11e354=a74_0x171c8a,_0x305c01=_0x21d358[_0x11e354(0x1cd)](_0x11e354(0x1d7)),_0x24b0ad=validateSkillDirectory(_0x21d358['str'](_0x11e354(0x1d2)),{'strict':_0x305c01});return throwIfSkillValidationFailed(_0x24b0ad,_0x305c01),{'ok':!![],'data':{'dir':_0x24b0ad[_0x11e354(0x1d2)],'type':_0x24b0ad[_0x11e354(0x1d9)],'errors':_0x24b0ad[_0x11e354(0x1d8)],'warnings':_0x24b0ad[_0x11e354(0x1da)]},'message':_0x11e354(0x1d0)};}};
1
+ import{DIR_FLAG,STRICT_FLAG}from"../flags.js";import{throwIfSkillValidationFailed,validateSkillDirectory}from"../validate.js";export const validateCommand={service:"skill",command:"validate",description:"Validate a local Skill directory as a self-contained delivery package",risk:"read",requiresAuth:false,requiresAppCode:false,flags:[DIR_FLAG,STRICT_FLAG],async execute(ctx){const strict=ctx.bool("strict");const report=validateSkillDirectory(ctx.str("dir"),{strict:strict});throwIfSkillValidationFailed(report,strict);return{ok:true,data:{dir:report.dir,type:report.type,errors:report.errors,warnings:report.warnings},message:"Skill validation passed."}}};
@@ -1 +1,3 @@
1
- (function(_0x458cea,_0x1ed7c9){const _0x3be73e=a75_0x3486,_0x48e255=_0x458cea();while(!![]){try{const _0x54ee2f=-parseInt(_0x3be73e(0x110))/0x1*(parseInt(_0x3be73e(0x11a))/0x2)+-parseInt(_0x3be73e(0x116))/0x3*(-parseInt(_0x3be73e(0x111))/0x4)+-parseInt(_0x3be73e(0x11d))/0x5*(parseInt(_0x3be73e(0x10c))/0x6)+parseInt(_0x3be73e(0x10d))/0x7*(parseInt(_0x3be73e(0x118))/0x8)+-parseInt(_0x3be73e(0x102))/0x9*(parseInt(_0x3be73e(0x10f))/0xa)+-parseInt(_0x3be73e(0x119))/0xb*(-parseInt(_0x3be73e(0x10b))/0xc)+parseInt(_0x3be73e(0x10e))/0xd;if(_0x54ee2f===_0x1ed7c9)break;else _0x48e255['push'](_0x48e255['shift']());}catch(_0x5b4b96){_0x48e255['push'](_0x48e255['shift']());}}}(a75_0x2113,0xe615f));function a75_0x2113(){const _0x23af55=['utf8','replace','parse','isFile','12bONHbo','42sWNAsF','7QakvXy','14087216WQRVdD','16779030YSQkzD','42ERTJod','19612BvvnQg','validation','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','579vlVUDL','defineProperties','902352uMbVoZ','12375649upKlJv','16282rDpvMB','diagram','document','218220qVKLIG','9dcCJXj','window','default','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.'];a75_0x2113=function(){return _0x23af55;};return a75_0x2113();}import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x178c3d){const _0x12e9e6=a75_0x3486;return(await readRequiredSkillDiagramInput(_0x178c3d))[_0x12e9e6(0x11b)];}export async function readRequiredSkillDiagramInput(_0x4f8bfd){const _0x1693c7=a75_0x3486,_0x37573f=_0x4f8bfd['trim']();if(!_0x37573f)throw CliErrors[_0x1693c7(0x112)]('--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.',_0x1693c7(0x114));let _0xc79de8,_0xc15b1f;if(_0x37573f==='-')try{_0xc79de8=readFileSync(0x0,_0x1693c7(0x107));}catch{throw CliErrors[_0x1693c7(0x112)](_0x1693c7(0x105));}else{const _0x1a6545=resolve(_0x37573f);if(!existsSync(_0x1a6545))throw CliErrors[_0x1693c7(0x112)](_0x1693c7(0x115)+_0x1a6545);if(!statSync(_0x1a6545)[_0x1693c7(0x10a)]())throw CliErrors[_0x1693c7(0x112)](_0x1693c7(0x113)+_0x1a6545);_0xc15b1f=realpathSync(_0x1a6545),_0xc79de8=readFileSync(_0xc15b1f,'utf8');}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0xc79de8)},'sourceFilePath':_0xc15b1f};}export async function validateAndCanonicalizeMermaid(_0x41c3fb){const _0x13789e=a75_0x3486,_0x59bf28=_0x41c3fb[_0x13789e(0x108)](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a')['replace'](/\n+$/,'')+'\x0a';try{const _0x39277e=await loadMermaidApi();await _0x39277e[_0x13789e(0x109)](_0x59bf28);}catch{throw diagramValidationError();}return _0x59bf28;}function a75_0x3486(_0x3e3361,_0xdc7cce){_0x3e3361=_0x3e3361-0x102;const _0x2113c9=a75_0x2113();let _0x348629=_0x2113c9[_0x3e3361];return _0x348629;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x4bd50d=a75_0x3486;if(!(_0x4bd50d(0x103)in globalThis)||!(_0x4bd50d(0x11c)in globalThis)){const _0x252a97=new JSDOM('');Object[_0x4bd50d(0x117)](globalThis,{'window':{'configurable':!![],'value':_0x252a97['window']},'document':{'configurable':!![],'value':_0x252a97[_0x4bd50d(0x103)][_0x4bd50d(0x11c)]}});}return(await import('mermaid'))[_0x4bd50d(0x104)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x193df7=a75_0x3486;return CliErrors['validation']('Mermaid\x20syntax\x20validation\x20failed.',_0x193df7(0x106));}
1
+ import{existsSync,readFileSync,realpathSync,statSync}from"node:fs";import{resolve}from"node:path";import{JSDOM}from"jsdom";import{CliErrors}from"../../errors.js";let mermaidApiPromise;export async function readRequiredSkillDiagram(path){return(await readRequiredSkillDiagramInput(path)).diagram}export async function readRequiredSkillDiagramInput(path){const normalizedPath=path.trim();if(!normalizedPath){throw CliErrors.validation("--diagram-file is required when publishing a Skill version.","Generate a Mermaid flowchart and pass --diagram-file <path>, or use --diagram-file - for standard input.")}let source;let sourceFilePath;if(normalizedPath==="-"){try{source=readFileSync(0,"utf8")}catch{throw CliErrors.validation("Unable to read Mermaid flowchart from standard input.")}}else{const absolutePath=resolve(normalizedPath);if(!existsSync(absolutePath)){throw CliErrors.validation(`Mermaid flowchart file not found: ${absolutePath}`)}if(!statSync(absolutePath).isFile()){
2
+ throw CliErrors.validation(`Mermaid flowchart path is not a regular file: ${absolutePath}`)}sourceFilePath=realpathSync(absolutePath);source=readFileSync(sourceFilePath,"utf8")}return{diagram:{schemaVersion:1,mermaid:await validateAndCanonicalizeMermaid(source)},sourceFilePath:sourceFilePath}}export async function validateAndCanonicalizeMermaid(source){const mermaid=`${source.replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/\n+$/,"")}\n`;try{const parser=await loadMermaidApi();await parser.parse(mermaid)}catch{throw diagramValidationError()}return mermaid}function loadMermaidApi(){mermaidApiPromise??=(async()=>{if(!("window"in globalThis)||!("document"in globalThis)){const dom=new JSDOM("");Object.defineProperties(globalThis,{window:{configurable:true,value:dom.window},document:{configurable:true,value:dom.window.document}})}return(await(import("mermaid"))).default})();return mermaidApiPromise}function diagramValidationError(){
3
+ return CliErrors.validation("Mermaid syntax validation failed.","Fix the Mermaid syntax reported by your editor or preview tool, then retry with the same file.")}
@@ -1 +1,4 @@
1
- const a76_0x28a698=a76_0x57ea;(function(_0x5c7057,_0x2862ff){const _0x46a6f8=a76_0x57ea,_0x19b761=_0x5c7057();while(!![]){try{const _0xbc2707=-parseInt(_0x46a6f8(0x11f))/0x1+-parseInt(_0x46a6f8(0x128))/0x2*(-parseInt(_0x46a6f8(0x126))/0x3)+-parseInt(_0x46a6f8(0x117))/0x4+parseInt(_0x46a6f8(0x11c))/0x5*(parseInt(_0x46a6f8(0x127))/0x6)+-parseInt(_0x46a6f8(0x123))/0x7*(parseInt(_0x46a6f8(0x119))/0x8)+parseInt(_0x46a6f8(0x118))/0x9+parseInt(_0x46a6f8(0x109))/0xa;if(_0xbc2707===_0x2862ff)break;else _0x19b761['push'](_0x19b761['shift']());}catch(_0x9f6802){_0x19b761['push'](_0x19b761['shift']());}}}(a76_0xcd79,0x4d5ed));import{DEFAULT_SKILL_TARGET,SKILL_NAME_PATTERN,SKILL_TYPES}from'./templates.js';export const CODE_FLAG={'name':'code','type':a76_0x28a698(0x108),'description':a76_0x28a698(0x10a)};export const SCOPE_FLAG={'name':a76_0x28a698(0x11a),'type':a76_0x28a698(0x108),'description':a76_0x28a698(0x125),'enum':[a76_0x28a698(0x111),a76_0x28a698(0x124),a76_0x28a698(0x113)]};export const PUSH_SCOPE_FLAG={'name':a76_0x28a698(0x11a),'type':'string','description':'Skill\x20push\x20target\x20scope:\x20personal\x20saves\x20immediately,\x20company\x20submits\x20a\x20new\x20version\x20for\x20review','default':a76_0x28a698(0x124),'enum':[a76_0x28a698(0x124),a76_0x28a698(0x113)]};export const LIST_SCOPE_FLAG={'name':'scope','type':'string','description':a76_0x28a698(0x10d),'enum':[a76_0x28a698(0x111),a76_0x28a698(0x124),a76_0x28a698(0x113)]};export const LOCAL_FLAG={'name':a76_0x28a698(0x122),'type':'boolean','description':a76_0x28a698(0x12f)};export const DIR_FLAG={'name':'dir','type':'string','required':!![],'description':a76_0x28a698(0x11e)};export const DIAGRAM_FILE_FLAG={'name':a76_0x28a698(0x112),'type':a76_0x28a698(0x108),'required':!![],'description':a76_0x28a698(0x12e)};export const DIAGRAM_SKILL_CODE_FLAG={'name':'skill-code','type':a76_0x28a698(0x108),'required':!![],'description':a76_0x28a698(0x12d)};export const DIAGRAM_VERSION_FLAG={'name':a76_0x28a698(0x10b),'type':a76_0x28a698(0x108),'required':!![],'description':'Exact\x20Skill\x20version\x20whose\x20diagram\x20is\x20being\x20managed'};export const DIAGRAM_SCOPE_FLAG={'name':a76_0x28a698(0x11a),'type':a76_0x28a698(0x108),'required':!![],'enum':[a76_0x28a698(0x124),'company'],'description':a76_0x28a698(0x129)};export const SOURCE_FINGERPRINT_FLAG={'name':a76_0x28a698(0x12b),'type':a76_0x28a698(0x108),'required':!![],'description':a76_0x28a698(0x130),'pattern':{'regex':/^sha256:[0-9a-f]{64}$/,'description':'a\x20lowercase\x20sha256:<64\x20hex\x20characters>\x20fingerprint'}};export const EXPECTED_DIAGRAM_REVISION_FLAG={'name':'expected-diagram-revision','type':a76_0x28a698(0x10c),'required':!![],'description':a76_0x28a698(0x11d)};function a76_0x57ea(_0x2de2aa,_0x7a4ca3){_0x2de2aa=_0x2de2aa-0x108;const _0xcd7957=a76_0xcd79();let _0x57eaaf=_0xcd7957[_0x2de2aa];return _0x57eaaf;}export const CREATE_NAME_FLAG={'name':'name','type':a76_0x28a698(0x108),'required':!![],'description':a76_0x28a698(0x12a),'pattern':{'regex':SKILL_NAME_PATTERN,'description':a76_0x28a698(0x120)}};export const TYPE_FLAG={'name':'type','type':a76_0x28a698(0x108),'description':a76_0x28a698(0x10f),'enum':[...SKILL_TYPES]};export const TARGET_FLAG={'name':a76_0x28a698(0x12c),'type':a76_0x28a698(0x108),'description':a76_0x28a698(0x11b),'default':DEFAULT_SKILL_TARGET};export const FORCE_FLAG={'name':a76_0x28a698(0x121),'type':a76_0x28a698(0x115),'description':a76_0x28a698(0x10e)};function a76_0xcd79(){const _0x4504df=['number','Skill\x20list\x20scope:\x20all,\x20personal,\x20or\x20company','Overwrite\x20generated\x20or\x20CLI-managed\x20Skill\x20files\x20when\x20the\x20target\x20already\x20exists','Skill\x20template\x20type:\x20pass\x20read\x20or\x20write\x20explicitly\x20(omission\x20is\x20deprecated)','Compatibility\x20flag;\x20no\x20extra\x20checks\x20are\x20enabled','all','diagram-file','company','Use\x20the\x20current\x20project\x27s\x20.agents/skills\x20instead\x20of\x20user-level\x20Agent\x20Skill\x20directories','boolean','confirm-warnings','2251844FVDXgW','665883rYByng','632DiLtCq','scope','Directory\x20that\x20will\x20contain\x20the\x20generated\x20Skill\x20directory','368415xBuixP','Expected\x20current\x20diagram\x20revision;\x20use\x200\x20for\x20the\x20first\x20diagram','Local\x20Skill\x20directory\x20containing\x20SKILL.md','24986tJAZOx','lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens','force','local','55993lEDCzU','personal','Skill\x20sync\x20scope:\x20all\x20(personal/company),\x20personal,\x20or\x20company','1492305WFovAG','12fjlBOw','2QztIQR','Exact\x20Skill\x20scope:\x20personal\x20or\x20company','Skill\x20name\x20using\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','source-fingerprint','target','Exact\x20Skill\x20code\x20whose\x20version\x20diagram\x20is\x20being\x20managed','UTF-8\x20Mermaid\x20flowchart\x20file;\x20the\x20selected\x20file\x20is\x20excluded\x20from\x20the\x20Skill\x20package;\x20use\x20-\x20for\x20stdin','Read\x20CLI-managed\x20local\x20Skill\x20cache\x20and\x20links\x20instead\x20of\x20remote\x20lists','Server-reported\x20SkillVersion\x20source\x20fingerprint','string','8179890TOZcME','Only\x20target\x20a\x20specific\x20runtime\x20Skill\x20code','version'];a76_0xcd79=function(){return _0x4504df;};return a76_0xcd79();}export const PROJECT_TARGET_FLAG={'name':'project','type':a76_0x28a698(0x115),'description':a76_0x28a698(0x114)};export const CONFIRM_WARNINGS_FLAG={'name':a76_0x28a698(0x116),'type':'boolean','description':'Confirm\x20reviewed\x20personal\x20or\x20company\x20Skill\x20publish\x20warnings'};export const STRICT_FLAG={'name':'strict','type':a76_0x28a698(0x115),'description':a76_0x28a698(0x110)};
1
+ import{DEFAULT_SKILL_TARGET,SKILL_NAME_PATTERN,SKILL_TYPES}from"./templates.js";export const CODE_FLAG={name:"code",type:"string",description:"Only target a specific runtime Skill code"};export const SCOPE_FLAG={name:"scope",type:"string",description:"Skill sync scope: all (personal/company), personal, or company",enum:["all","personal","company"]};export const PUSH_SCOPE_FLAG={name:"scope",type:"string",description:"Skill push target scope: personal saves immediately, company submits a new version for review",default:"personal",enum:["personal","company"]};export const LIST_SCOPE_FLAG={name:"scope",type:"string",description:"Skill list scope: all, personal, or company",enum:["all","personal","company"]};export const LOCAL_FLAG={name:"local",type:"boolean",description:"Read CLI-managed local Skill cache and links instead of remote lists"};export const DIR_FLAG={name:"dir",type:"string",required:true,description:"Local Skill directory containing SKILL.md"}
2
+ ;export const DIAGRAM_FILE_FLAG={name:"diagram-file",type:"string",required:true,description:"UTF-8 Mermaid flowchart file; the selected file is excluded from the Skill package; use - for stdin"};export const DIAGRAM_SKILL_CODE_FLAG={name:"skill-code",type:"string",required:true,description:"Exact Skill code whose version diagram is being managed"};export const DIAGRAM_VERSION_FLAG={name:"version",type:"string",required:true,description:"Exact Skill version whose diagram is being managed"};export const DIAGRAM_SCOPE_FLAG={name:"scope",type:"string",required:true,enum:["personal","company"],description:"Exact Skill scope: personal or company"};export const SOURCE_FINGERPRINT_FLAG={name:"source-fingerprint",type:"string",required:true,description:"Server-reported SkillVersion source fingerprint",pattern:{regex:/^sha256:[0-9a-f]{64}$/,description:"a lowercase sha256:<64 hex characters> fingerprint"}};export const EXPECTED_DIAGRAM_REVISION_FLAG={name:"expected-diagram-revision",
3
+ type:"number",required:true,description:"Expected current diagram revision; use 0 for the first diagram"};export const CREATE_NAME_FLAG={name:"name",type:"string",required:true,description:"Skill name using lowercase letters, numbers, and hyphens",pattern:{regex:SKILL_NAME_PATTERN,description:"lowercase letters, numbers, and single hyphens"}};export const TYPE_FLAG={name:"type",type:"string",description:"Skill template type: pass read or write explicitly (omission is deprecated)",enum:[...SKILL_TYPES]};export const TARGET_FLAG={name:"target",type:"string",description:"Directory that will contain the generated Skill directory",default:DEFAULT_SKILL_TARGET};export const FORCE_FLAG={name:"force",type:"boolean",description:"Overwrite generated or CLI-managed Skill files when the target already exists"};export const PROJECT_TARGET_FLAG={name:"project",type:"boolean",description:"Use the current project's .agents/skills instead of user-level Agent Skill directories"}
4
+ ;export const CONFIRM_WARNINGS_FLAG={name:"confirm-warnings",type:"boolean",description:"Confirm reviewed personal or company Skill publish warnings"};export const STRICT_FLAG={name:"strict",type:"boolean",description:"Compatibility flag; no extra checks are enabled"};
@@ -1 +1 @@
1
- (function(_0x521cbc,_0x46ed96){const _0x544096=a77_0x2c1b,_0x4be0ed=_0x521cbc();while(!![]){try{const _0x982ed3=-parseInt(_0x544096(0xba))/0x1*(-parseInt(_0x544096(0xb6))/0x2)+parseInt(_0x544096(0xb8))/0x3+parseInt(_0x544096(0xbb))/0x4*(parseInt(_0x544096(0xb3))/0x5)+-parseInt(_0x544096(0xbc))/0x6*(-parseInt(_0x544096(0xb4))/0x7)+parseInt(_0x544096(0xb7))/0x8*(-parseInt(_0x544096(0xb9))/0x9)+-parseInt(_0x544096(0xb5))/0xa+-parseInt(_0x544096(0xb2))/0xb;if(_0x982ed3===_0x46ed96)break;else _0x4be0ed['push'](_0x4be0ed['shift']());}catch(_0x554e24){_0x4be0ed['push'](_0x4be0ed['shift']());}}}(a77_0x40e9,0xd68f1));import{createCommand}from'./commands/create.js';import{diagramPushCommand,diagramShowCommand,diagramValidateCommand}from'./commands/diagram.js';import{installCommand}from'./commands/install.js';function a77_0x2c1b(_0x180638,_0x4d8873){_0x180638=_0x180638-0xb2;const _0x40e905=a77_0x40e9();let _0x2c1b5d=_0x40e905[_0x180638];return _0x2c1b5d;}import{listCommand}from'./commands/list.js';function a77_0x40e9(){const _0x2ede58=['488bWghBL','4429806COIDle','251973hayCdv','1VmMMuL','4wUfuWU','42fDpkOV','1160115bPIxOi','125210JYVFTZ','122115erzoSA','40290UEAkTF','2144770SmPtMB'];a77_0x40e9=function(){return _0x2ede58;};return a77_0x40e9();}import{pushCommand}from'./commands/push.js';import{validateCommand}from'./commands/validate.js';export const skillDefinitions=[installCommand,createCommand,validateCommand,listCommand,pushCommand,diagramValidateCommand,diagramPushCommand,diagramShowCommand];
1
+ import{createCommand}from"./commands/create.js";import{diagramPushCommand,diagramShowCommand,diagramValidateCommand}from"./commands/diagram.js";import{installCommand}from"./commands/install.js";import{listCommand}from"./commands/list.js";import{pushCommand}from"./commands/push.js";import{validateCommand}from"./commands/validate.js";export const skillDefinitions=[installCommand,createCommand,validateCommand,listCommand,pushCommand,diagramValidateCommand,diagramPushCommand,diagramShowCommand];
@@ -1 +1 @@
1
- function a78_0x1f17(){var _0x12410b=['12eeOvJQ','342qDRnKP','1230680gDrnUO','files','ossPath','3alZTyn','1016uWWjdV','object','59465qCpZmJ','string','162YXeypm','60057oGRMhw','2558aWpyKu','8834562cShKme','467352EJQxYj','isArray','path','3773645HmRETp','length','SKILL.md'];a78_0x1f17=function(){return _0x12410b;};return a78_0x1f17();}(function(_0x2d5af6,_0x371199){var _0x41157d=a78_0x4562,_0x575ba8=_0x2d5af6();while(!![]){try{var _0xeeb44=parseInt(_0x41157d(0x6c))/0x1*(-parseInt(_0x41157d(0x75))/0x2)+-parseInt(_0x41157d(0x79))/0x3*(-parseInt(_0x41157d(0x6e))/0x4)+parseInt(_0x41157d(0x71))/0x5+parseInt(_0x41157d(0x7e))/0x6*(parseInt(_0x41157d(0x7c))/0x7)+parseInt(_0x41157d(0x7a))/0x8*(-parseInt(_0x41157d(0x6b))/0x9)+-parseInt(_0x41157d(0x76))/0xa+-parseInt(_0x41157d(0x6d))/0xb*(-parseInt(_0x41157d(0x74))/0xc);if(_0xeeb44===_0x371199)break;else _0x575ba8['push'](_0x575ba8['shift']());}catch(_0x2c8e66){_0x575ba8['push'](_0x575ba8['shift']());}}}(a78_0x1f17,0x791f5));function a78_0x4562(_0x24df58,_0x5c5648){_0x24df58=_0x24df58-0x6b;var _0x1f1796=a78_0x1f17();var _0x45626f=_0x1f1796[_0x24df58];return _0x45626f;}export function isPackageBackedManifest(_0x4beeaa){var _0x435b16=a78_0x4562;return!!_0x4beeaa&&typeof _0x4beeaa==='object'&&!Array[_0x435b16(0x6f)](_0x4beeaa)&&typeof _0x4beeaa[_0x435b16(0x78)]===_0x435b16(0x7d)&&_0x4beeaa[_0x435b16(0x78)][_0x435b16(0x72)]>0x0&&Array['isArray'](_0x4beeaa[_0x435b16(0x77)]);}export function isMultiFileManifest(_0x115de1){var _0x407304=a78_0x4562;return!!_0x115de1&&typeof _0x115de1===_0x407304(0x7b)&&!Array[_0x407304(0x6f)](_0x115de1)&&Array[_0x407304(0x6f)](_0x115de1[_0x407304(0x77)])&&_0x115de1[_0x407304(0x77)]['some'](_0x2674e5=>_0x2674e5[_0x407304(0x70)]!==_0x407304(0x73));}
1
+ export function isPackageBackedManifest(files){return!!files&&typeof files==="object"&&!Array.isArray(files)&&typeof files.ossPath==="string"&&files.ossPath.length>0&&Array.isArray(files.files)}export function isMultiFileManifest(files){return!!files&&typeof files==="object"&&!Array.isArray(files)&&Array.isArray(files.files)&&files.files.some(file=>file.path!=="SKILL.md")}
@@ -1 +1,11 @@
1
- (function(_0x201346,_0x2ce91a){const _0x391340=a79_0x3009,_0x40e39d=_0x201346();while(!![]){try{const _0x1b948f=parseInt(_0x391340(0xde))/0x1+-parseInt(_0x391340(0xe9))/0x2+parseInt(_0x391340(0xc8))/0x3*(-parseInt(_0x391340(0xc7))/0x4)+parseInt(_0x391340(0xb5))/0x5*(-parseInt(_0x391340(0xe0))/0x6)+-parseInt(_0x391340(0xf1))/0x7*(-parseInt(_0x391340(0xdc))/0x8)+parseInt(_0x391340(0xd3))/0x9*(parseInt(_0x391340(0xdb))/0xa)+-parseInt(_0x391340(0xb8))/0xb*(-parseInt(_0x391340(0xcf))/0xc);if(_0x1b948f===_0x2ce91a)break;else _0x40e39d['push'](_0x40e39d['shift']());}catch(_0x5e95c2){_0x40e39d['push'](_0x40e39d['shift']());}}}(a79_0x295f,0xcd293));import{CliErrors}from'../../errors.js';import{isMultiFileManifest,isPackageBackedManifest}from'./manifest-helpers.js';function a79_0x3009(_0x45657d,_0x332c51){_0x45657d=_0x45657d-0xb5;const _0x295f24=a79_0x295f();let _0x3009ee=_0x295f24[_0x45657d];return _0x3009ee;}import{remotePersonalReadOptions,remoteMissingCompanyReadOptions,remoteMissingPersonalReadOptions}from'./push-flow-helpers.js';import{allowRetargetArgs,buildRetargetWarning,remoteFirstMetadataOptions,resolvePushScope,runRemoteContentPreflight,throwIfBuiltinPushTarget,throwIfUnconfirmedPublishWarnings,throwIfPublishValidationFailed}from'./push-flow-helpers.js';function a79_0x295f(){const _0x5e9906=['str','company','Submitted\x20company\x20Skill\x20','payload','submitted','3425848IKcKMM','3WHQaPl','diagramValidated','../../skills/runtime-skill-sync.js','trim','../../core/api-client.js','unknown','/publish/validate','49836NpBQLX','/api/cli/v1/skills/','Validate\x20a\x20personal\x20Skill\x20push\x20package\x20without\x20creating\x20or\x20updating\x20a\x20remote\x20Skill.','valid','14220NgRkdZ','appCode','diagram-file','Validate\x20a\x20company\x20Skill\x20push\x20package\x20without\x20creating\x20a\x20version\x20or\x20review\x20task.','PRIVATE','scope','savedSkill','authRequired','7210QBOCpx','904lRbnNr','\x20has\x20scope=\x22','1126413ZvCdvI','files','49974bopjkN','\x20version\x20','(unknown)','validation','skillCode','NAMESPACE_ONLY','resolvedVersion','metadata','\x20is\x20already\x20published\x20and\x20content\x20is\x20identical','833998HRMeAN','existing','personal','bool','accessKey','input','appcode','version','22001GYIFAm','965tYMhmH','errors','frontmatterDisplayName','2915OnjkTq','Created\x20personal\x20Skill\x20','Personal','confirmWarnings','publishInput','dir','\x20Skill\x20','resolvedSlug','warnings','remoteForPreflight'];a79_0x295f=function(){return _0x5e9906;};return a79_0x295f();}import{withRetargetExistingMetadata}from'./push-retarget.js';import{summarizeRuntimeSkill}from'./summary.js';import{readRequiredSkillDiagramInput}from'./diagram.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'./validate.js';export async function skillPushDryRun(_0x58099e){const _0x47654a=a79_0x3009,{getRuntimeSkillByCode:_0x48589b,validateRuntimeSkillPublish:_0x500d7d}=await import(_0x47654a(0xcc)),{readPushDirectory:_0x526ead,resolvePushDirectoryIdentity:_0xbd5e8e}=await import(_0x47654a(0xca));if(!_0x58099e[_0x47654a(0xed)])throw CliErrors[_0x47654a(0xda)]();const _0x4c76ce=resolvePushScope(_0x58099e),_0x3a736d=validateSkillDirectory(_0x58099e[_0x47654a(0xc2)](_0x47654a(0xbd)));throwIfSkillValidationFailed(_0x3a736d);const {diagram:_0xb0db28,sourceFilePath:_0x2a5f2f}=await readRequiredSkillDiagramInput(_0x58099e[_0x47654a(0xc2)]('diagram-file')),_0x1e612b=diagramPackageExclusion(_0x2a5f2f),_0x5f005b=_0xbd5e8e(_0x3a736d[_0x47654a(0xbd)],_0x58099e[_0x47654a(0xd4)],remoteFirstMetadataOptions()),_0x5aee80=await _0x48589b(_0x58099e[_0x47654a(0xd4)],_0x5f005b[_0x47654a(0xe4)]);throwIfBuiltinPushTarget(_0x5aee80);if(_0x4c76ce===_0x47654a(0xc3)){const _0x3bad12=_0x526ead(_0x3a736d[_0x47654a(0xbd)],_0x58099e['appCode'],{...remoteMissingCompanyReadOptions(),..._0x1e612b}),_0x100d0a=await _0x500d7d(_0x58099e[_0x47654a(0xd4)],withDiagram(_0x3bad12[_0x47654a(0xee)],_0xb0db28),{'visibility':'NAMESPACE_ONLY'});return{'method':'POST','url':'/api/cli/v1/skills/'+_0x58099e['appCode']+_0x47654a(0xce),'body':{'skillCode':_0x3bad12['skillCode'],'visibility':_0x47654a(0xe5),'valid':_0x100d0a[_0x47654a(0xd2)],'errors':_0x100d0a[_0x47654a(0xb6)],'warnings':_0x100d0a[_0x47654a(0xc0)],'resolvedSlug':_0x100d0a[_0x47654a(0xbf)],'resolvedVersion':_0x100d0a['resolvedVersion'],'diagramValidated':_0x100d0a['diagramValidated']},'description':_0x47654a(0xd6)};}if(_0x5aee80&&_0x5aee80[_0x47654a(0xd8)]!==_0x47654a(0xeb))throw CliErrors[_0x47654a(0xe3)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20remote\x20Skill\x20'+_0x5f005b[_0x47654a(0xe4)]+_0x47654a(0xdd)+(_0x5aee80[_0x47654a(0xd8)]??_0x47654a(0xcd))+'\x22.');const _0x4056ac=_0x526ead(_0x3a736d[_0x47654a(0xbd)],_0x58099e[_0x47654a(0xd4)],{..._0x5aee80?remotePersonalReadOptions(!![]):remoteMissingPersonalReadOptions(),..._0x1e612b}),_0x477c92=await _0x500d7d(_0x58099e[_0x47654a(0xd4)],withDiagram(_0x4056ac[_0x47654a(0xee)],_0xb0db28),{'visibility':_0x47654a(0xd7)});return{'method':'POST','url':_0x47654a(0xd0)+_0x58099e[_0x47654a(0xd4)]+_0x47654a(0xce),'body':{'skillCode':_0x4056ac[_0x47654a(0xe4)],'visibility':_0x47654a(0xd7),'valid':_0x477c92[_0x47654a(0xd2)],'errors':_0x477c92[_0x47654a(0xb6)],'warnings':_0x477c92[_0x47654a(0xc0)],'resolvedSlug':_0x477c92['resolvedSlug'],'resolvedVersion':_0x477c92[_0x47654a(0xe6)],'diagramValidated':_0x477c92[_0x47654a(0xc9)]},'description':_0x47654a(0xd1)};}export async function skillPushExecute(_0x1bdd8d){const _0x2a8449=a79_0x3009,{createPersonalRuntimeSkill:_0xbc08fc,downloadRuntimeSkillPackage:_0x5bf479,getRuntimeSkillByCode:_0x2ebdd3,publishCompanyRuntimeSkill:_0x1c9196,updatePersonalRuntimeSkill:_0x27c29a,validateRuntimeSkillPublish:_0x440c9b}=await import(_0x2a8449(0xcc)),{verifyRuntimeSkillPackage:_0x300380,verifyRuntimeSkillBundle:_0x26e71c,readPushDirectory:_0x452a20,refreshPushDirectoryMetadataFromRemote:_0x4f4106,recordPushedRuntimeSkill:_0x3986b4,resolvePushDirectoryIdentity:_0x38584d}=await import('../../skills/runtime-skill-sync.js');if(!_0x1bdd8d[_0x2a8449(0xed)])throw CliErrors['authRequired']();const _0x6fc7b4=resolvePushScope(_0x1bdd8d),_0x1faaa6=_0x1bdd8d['bool']('confirm-warnings')||_0x1bdd8d[_0x2a8449(0xec)](_0x2a8449(0xbb)),_0x262a3d=validateSkillDirectory(_0x1bdd8d[_0x2a8449(0xc2)](_0x2a8449(0xbd)));throwIfSkillValidationFailed(_0x262a3d);const {diagram:_0x5f58aa,sourceFilePath:_0x9dcc42}=await readRequiredSkillDiagramInput(_0x1bdd8d[_0x2a8449(0xc2)](_0x2a8449(0xd5))),_0x2891e9=diagramPackageExclusion(_0x9dcc42),_0x3b7ba9=_0x262a3d[_0x2a8449(0xbd)];let _0x42ee7a;if(_0x6fc7b4===_0x2a8449(0xc3)){const _0x1bdd56=_0x38584d(_0x3b7ba9,_0x1bdd8d[_0x2a8449(0xd4)],remoteFirstMetadataOptions()),_0x20fcf8=await _0x2ebdd3(_0x1bdd8d[_0x2a8449(0xd4)],_0x1bdd56[_0x2a8449(0xe4)]);throwIfBuiltinPushTarget(_0x20fcf8);if(_0x20fcf8)_0x4f4106(_0x3b7ba9,_0x20fcf8,_0x1bdd8d[_0x2a8449(0xd4)]);const _0x261c86=_0x452a20(_0x3b7ba9,_0x1bdd8d[_0x2a8449(0xd4)],{..._0x20fcf8?{'targetScope':_0x2a8449(0xc3),'ignoreInvalidMetadata':!![]}:remoteMissingCompanyReadOptions(),..._0x2891e9});_0x42ee7a={'scope':_0x2a8449(0xc3),'payload':_0x261c86,'publishInput':withDiagram(_0x261c86[_0x2a8449(0xee)],_0x5f58aa),'remoteForPreflight':_0x20fcf8,'warnings':[]};}else{const _0x274e16=_0x1bdd8d[_0x2a8449(0xc2)](_0x2a8449(0xef))[_0x2a8449(0xcb)](),_0x431236=Boolean(_0x274e16),_0x137e62=allowRetargetArgs(_0x431236),_0x158b73=_0x38584d(_0x3b7ba9,_0x1bdd8d['appCode'],{...remoteFirstMetadataOptions(),..._0x137e62[0x0]}),_0x32efd7=await _0x2ebdd3(_0x1bdd8d[_0x2a8449(0xd4)],_0x158b73[_0x2a8449(0xe4)]);throwIfBuiltinPushTarget(_0x32efd7);if(_0x32efd7){if(_0x32efd7[_0x2a8449(0xd8)]!=='personal'){if(_0x431236)throw CliErrors['validation']('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20remote\x20Skill\x20'+_0x158b73[_0x2a8449(0xe4)]+'\x20has\x20scope=\x22'+(_0x32efd7['scope']??'unknown')+'\x22.');_0x4f4106(_0x3b7ba9,_0x32efd7,_0x1bdd8d['appCode']);}else!_0x431236&&_0x4f4106(_0x3b7ba9,_0x32efd7,_0x1bdd8d[_0x2a8449(0xd4)]);}const _0x2dfa7c=_0x452a20(_0x3b7ba9,_0x1bdd8d['appCode'],{..._0x32efd7?remotePersonalReadOptions(_0x431236,_0x137e62[0x0]):remoteMissingPersonalReadOptions(_0x137e62[0x0]),..._0x2891e9}),_0x55eac5=_0x32efd7?.['scope']===_0x2a8449(0xeb)&&_0x32efd7[_0x2a8449(0xe4)]===_0x2dfa7c[_0x2a8449(0xe4)]?_0x32efd7:undefined,_0x73a318=_0x431236&&_0x55eac5?withRetargetExistingMetadata(_0x2dfa7c[_0x2a8449(0xee)],_0x55eac5,{'preferInputSkillName':Boolean(_0x2dfa7c[_0x2a8449(0xb7)])}):_0x2dfa7c[_0x2a8449(0xee)],_0x57e5d3=_0x431236?buildRetargetWarning(_0x158b73[_0x2a8449(0xe7)],_0x1bdd8d[_0x2a8449(0xd4)]):[];_0x42ee7a={'scope':_0x2a8449(0xeb),'payload':_0x2dfa7c,'publishInput':withDiagram(_0x73a318,_0x5f58aa),'remoteForPreflight':_0x55eac5,'existing':_0x55eac5,'warnings':[..._0x262a3d[_0x2a8449(0xc0)],..._0x57e5d3]};}const _0x4c1870=await runRemoteContentPreflight({'scope':_0x42ee7a[_0x2a8449(0xd8)],'remote':_0x42ee7a[_0x2a8449(0xc1)],'publishInput':_0x42ee7a[_0x2a8449(0xbc)],'skillCode':_0x42ee7a[_0x2a8449(0xc5)][_0x2a8449(0xe4)],'appCode':_0x1bdd8d['appCode'],'downloadRuntimeSkillPackage':_0x5bf479,'verifyRuntimeSkillBundle':_0x26e71c});if(_0x4c1870['status']==='identical')return _0x42ee7a[_0x2a8449(0xd8)]===_0x2a8449(0xc3)?_0x3986b4(_0x3b7ba9,_0x4c1870[_0x2a8449(0xd9)],_0x1bdd8d['appCode'],{'scope':'company'}):_0x3986b4(_0x3b7ba9,_0x4c1870[_0x2a8449(0xd9)],_0x1bdd8d[_0x2a8449(0xd4)]),{'ok':!![],'data':{...summarizeRuntimeSkill(_0x4c1870[_0x2a8449(0xd9)]),'scope':_0x42ee7a[_0x2a8449(0xd8)],..._0x42ee7a[_0x2a8449(0xd8)]===_0x2a8449(0xeb)?{'warnings':_0x42ee7a[_0x2a8449(0xc0)]}:{},'alreadyPublished':!![],'contentIdentical':!![],'diagramSubmitted':![]},'message':scopeLabel(_0x42ee7a[_0x2a8449(0xd8)])+_0x2a8449(0xbe)+_0x42ee7a[_0x2a8449(0xc5)]['skillCode']+_0x2a8449(0xe8)};if(_0x42ee7a[_0x2a8449(0xd8)]===_0x2a8449(0xc3)){const _0x5d4c1a=await _0x440c9b(_0x1bdd8d[_0x2a8449(0xd4)],_0x42ee7a[_0x2a8449(0xbc)],{'visibility':'NAMESPACE_ONLY'});throwIfPublishValidationFailed(_0x2a8449(0xc3),_0x42ee7a[_0x2a8449(0xc5)][_0x2a8449(0xe4)],_0x5d4c1a),throwIfUnconfirmedPublishWarnings(_0x2a8449(0xc3),_0x42ee7a['payload'][_0x2a8449(0xe4)],_0x5d4c1a[_0x2a8449(0xc0)],_0x1faaa6);const _0x6eb832=await _0x1c9196(_0x1bdd8d[_0x2a8449(0xd4)],_0x42ee7a[_0x2a8449(0xbc)],{'confirmWarnings':_0x1faaa6});return _0x3986b4(_0x3b7ba9,{..._0x6eb832,'files':_0x42ee7a[_0x2a8449(0xbc)][_0x2a8449(0xdf)]},_0x1bdd8d[_0x2a8449(0xd4)],{'scope':_0x2a8449(0xc3)}),{'ok':!![],'data':{...summarizeRuntimeSkill(_0x6eb832),'scope':_0x2a8449(0xc3),'reviewState':_0x2a8449(0xc6),'submittedForReview':!![],'diagramBound':!![],'validation':{'warnings':_0x5d4c1a['warnings']}},'message':_0x2a8449(0xc4)+_0x42ee7a[_0x2a8449(0xc5)][_0x2a8449(0xe4)]+_0x2a8449(0xe1)+(_0x6eb832[_0x2a8449(0xf0)]??_0x2a8449(0xe2))+'\x20for\x20review'};}const _0x2e6669=await _0x440c9b(_0x1bdd8d[_0x2a8449(0xd4)],_0x42ee7a['publishInput'],{'visibility':_0x2a8449(0xd7)});throwIfPublishValidationFailed(_0x2a8449(0xeb),_0x42ee7a['payload']['skillCode'],_0x2e6669),throwIfUnconfirmedPublishWarnings('personal',_0x42ee7a[_0x2a8449(0xc5)][_0x2a8449(0xe4)],_0x2e6669['warnings'],_0x1faaa6);const _0x39b1ae={'confirmWarnings':_0x1faaa6},_0x19a320=_0x42ee7a[_0x2a8449(0xea)]?await _0x27c29a(_0x42ee7a[_0x2a8449(0xc5)]['skillCode'],_0x1bdd8d[_0x2a8449(0xd4)],_0x42ee7a[_0x2a8449(0xbc)],_0x39b1ae):await _0xbc08fc(_0x1bdd8d[_0x2a8449(0xd4)],_0x42ee7a[_0x2a8449(0xbc)],_0x39b1ae);let _0x1e7dbb=_0x19a320;if(isMultiFileManifest(_0x42ee7a[_0x2a8449(0xbc)]['files'])){const _0x2da424=await _0x5bf479('personal',_0x19a320['skillCode']||_0x42ee7a[_0x2a8449(0xc5)][_0x2a8449(0xe4)],_0x1bdd8d['appCode']);_0x26e71c(_0x42ee7a[_0x2a8449(0xbc)][_0x2a8449(0xdf)],_0x2da424),_0x1e7dbb={..._0x19a320,'files':_0x42ee7a[_0x2a8449(0xbc)][_0x2a8449(0xdf)]};}else{if(isPackageBackedManifest(_0x19a320[_0x2a8449(0xdf)])){const _0x10da40=await _0x5bf479(_0x2a8449(0xeb),_0x19a320[_0x2a8449(0xe4)]||_0x42ee7a[_0x2a8449(0xc5)][_0x2a8449(0xe4)],_0x1bdd8d[_0x2a8449(0xd4)]);_0x300380(_0x19a320[_0x2a8449(0xdf)],_0x10da40);}}return _0x3986b4(_0x3b7ba9,_0x1e7dbb,_0x1bdd8d[_0x2a8449(0xd4)]),{'ok':!![],'data':{...summarizeRuntimeSkill(_0x19a320),'warnings':_0x42ee7a[_0x2a8449(0xc0)],'validation':{'warnings':_0x2e6669[_0x2a8449(0xc0)]},'diagramBound':!![]},'message':_0x42ee7a[_0x2a8449(0xea)]?'Updated\x20personal\x20Skill\x20'+_0x42ee7a[_0x2a8449(0xc5)][_0x2a8449(0xe4)]:_0x2a8449(0xb9)+_0x42ee7a[_0x2a8449(0xc5)][_0x2a8449(0xe4)]};}function scopeLabel(_0x79e74c){const _0x36b35c=a79_0x3009;return _0x79e74c===_0x36b35c(0xc3)?'Company':_0x36b35c(0xba);}function withDiagram(_0x5610a5,_0x2256b1){return{..._0x5610a5,'diagram':_0x2256b1};}function diagramPackageExclusion(_0x35da74){return _0x35da74?{'excludedFilePaths':[_0x35da74]}:{};}
1
+ import{CliErrors}from"../../errors.js";import{isMultiFileManifest,isPackageBackedManifest}from"./manifest-helpers.js";import{remotePersonalReadOptions,remoteMissingCompanyReadOptions,remoteMissingPersonalReadOptions}from"./push-flow-helpers.js";import{allowRetargetArgs,buildRetargetWarning,remoteFirstMetadataOptions,resolvePushScope,runRemoteContentPreflight,throwIfBuiltinPushTarget,throwIfUnconfirmedPublishWarnings,throwIfPublishValidationFailed}from"./push-flow-helpers.js";import{withRetargetExistingMetadata}from"./push-retarget.js";import{summarizeRuntimeSkill}from"./summary.js";import{readRequiredSkillDiagramInput}from"./diagram.js";import{throwIfSkillValidationFailed,validateSkillDirectory}from"./validate.js";export async function skillPushDryRun(ctx){const{getRuntimeSkillByCode:getRuntimeSkillByCode,validateRuntimeSkillPublish:validateRuntimeSkillPublish}=await(import("../../core/api-client.js"))
2
+ ;const{readPushDirectory:readPushDirectory,resolvePushDirectoryIdentity:resolvePushDirectoryIdentity}=await(import("../../skills/runtime-skill-sync.js"));if(!ctx.accessKey)throw CliErrors.authRequired();const scope=resolvePushScope(ctx);const validationReport=validateSkillDirectory(ctx.str("dir"));throwIfSkillValidationFailed(validationReport);const{diagram:diagram,sourceFilePath:diagramFilePath}=await readRequiredSkillDiagramInput(ctx.str("diagram-file"));const packageExclusion=diagramPackageExclusion(diagramFilePath);const identity=resolvePushDirectoryIdentity(validationReport.dir,ctx.appCode,remoteFirstMetadataOptions());const remote=await getRuntimeSkillByCode(ctx.appCode,identity.skillCode);throwIfBuiltinPushTarget(remote);if(scope==="company"){const payload=readPushDirectory(validationReport.dir,ctx.appCode,{...remoteMissingCompanyReadOptions(),...packageExclusion});const validation=await validateRuntimeSkillPublish(ctx.appCode,withDiagram(payload.input,diagram),{
3
+ visibility:"NAMESPACE_ONLY"});return{method:"POST",url:`/api/cli/v1/skills/${ctx.appCode}/publish/validate`,body:{skillCode:payload.skillCode,visibility:"NAMESPACE_ONLY",valid:validation.valid,errors:validation.errors,warnings:validation.warnings,resolvedSlug:validation.resolvedSlug,resolvedVersion:validation.resolvedVersion,diagramValidated:validation.diagramValidated},description:"Validate a company Skill push package without creating a version or review task."}}if(remote&&remote.scope!=="personal"){throw CliErrors.validation(`Only personal Skills can be pushed; remote Skill ${identity.skillCode} has scope="${remote.scope??"unknown"}".`)}const payload=readPushDirectory(validationReport.dir,ctx.appCode,{...remote?remotePersonalReadOptions(true):remoteMissingPersonalReadOptions(),...packageExclusion});const validation=await validateRuntimeSkillPublish(ctx.appCode,withDiagram(payload.input,diagram),{visibility:"PRIVATE"});return{method:"POST",
4
+ url:`/api/cli/v1/skills/${ctx.appCode}/publish/validate`,body:{skillCode:payload.skillCode,visibility:"PRIVATE",valid:validation.valid,errors:validation.errors,warnings:validation.warnings,resolvedSlug:validation.resolvedSlug,resolvedVersion:validation.resolvedVersion,diagramValidated:validation.diagramValidated},description:"Validate a personal Skill push package without creating or updating a remote Skill."}}export async function skillPushExecute(ctx){const{createPersonalRuntimeSkill:createPersonalRuntimeSkill,downloadRuntimeSkillPackage:downloadRuntimeSkillPackage,getRuntimeSkillByCode:getRuntimeSkillByCode,publishCompanyRuntimeSkill:publishCompanyRuntimeSkill,updatePersonalRuntimeSkill:updatePersonalRuntimeSkill,validateRuntimeSkillPublish:validateRuntimeSkillPublish}=await(import("../../core/api-client.js"))
5
+ ;const{verifyRuntimeSkillPackage:verifyRuntimeSkillPackage,verifyRuntimeSkillBundle:verifyRuntimeSkillBundle,readPushDirectory:readPushDirectory,refreshPushDirectoryMetadataFromRemote:refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill:recordPushedRuntimeSkill,resolvePushDirectoryIdentity:resolvePushDirectoryIdentity}=await(import("../../skills/runtime-skill-sync.js"));if(!ctx.accessKey)throw CliErrors.authRequired();const scope=resolvePushScope(ctx);const confirmWarnings=ctx.bool("confirm-warnings")||ctx.bool("confirmWarnings");const validationReport=validateSkillDirectory(ctx.str("dir"));throwIfSkillValidationFailed(validationReport);const{diagram:diagram,sourceFilePath:diagramFilePath}=await readRequiredSkillDiagramInput(ctx.str("diagram-file"));const packageExclusion=diagramPackageExclusion(diagramFilePath);const pushDir=validationReport.dir;let plan;if(scope==="company"){const identity=resolvePushDirectoryIdentity(pushDir,ctx.appCode,remoteFirstMetadataOptions())
6
+ ;const remote=await getRuntimeSkillByCode(ctx.appCode,identity.skillCode);throwIfBuiltinPushTarget(remote);if(remote)refreshPushDirectoryMetadataFromRemote(pushDir,remote,ctx.appCode);const payload=readPushDirectory(pushDir,ctx.appCode,{...remote?{targetScope:"company",ignoreInvalidMetadata:true}:remoteMissingCompanyReadOptions(),...packageExclusion});plan={scope:"company",payload:payload,publishInput:withDiagram(payload.input,diagram),remoteForPreflight:remote,warnings:[]}}else{const explicitAppCode=ctx.str("appcode").trim();const allowRetarget=Boolean(explicitAppCode);const retargetArgs=allowRetargetArgs(allowRetarget);const identity=resolvePushDirectoryIdentity(pushDir,ctx.appCode,{...remoteFirstMetadataOptions(),...retargetArgs[0]});const remote=await getRuntimeSkillByCode(ctx.appCode,identity.skillCode);throwIfBuiltinPushTarget(remote);if(remote){if(remote.scope!=="personal"){if(allowRetarget){
7
+ throw CliErrors.validation(`Only personal Skills can be pushed; remote Skill ${identity.skillCode} has scope="${remote.scope??"unknown"}".`)}refreshPushDirectoryMetadataFromRemote(pushDir,remote,ctx.appCode)}else if(!allowRetarget){refreshPushDirectoryMetadataFromRemote(pushDir,remote,ctx.appCode)}}const payload=readPushDirectory(pushDir,ctx.appCode,{...remote?remotePersonalReadOptions(allowRetarget,retargetArgs[0]):remoteMissingPersonalReadOptions(retargetArgs[0]),...packageExclusion});const existing=remote?.scope==="personal"&&remote.skillCode===payload.skillCode?remote:undefined;const packagePublishInput=allowRetarget&&existing?withRetargetExistingMetadata(payload.input,existing,{preferInputSkillName:Boolean(payload.frontmatterDisplayName)}):payload.input;const retargetWarning=allowRetarget?buildRetargetWarning(identity.metadata,ctx.appCode):[];plan={scope:"personal",payload:payload,publishInput:withDiagram(packagePublishInput,diagram),remoteForPreflight:existing,existing:existing,
8
+ warnings:[...validationReport.warnings,...retargetWarning]}}const contentPreflight=await runRemoteContentPreflight({scope:plan.scope,remote:plan.remoteForPreflight,publishInput:plan.publishInput,skillCode:plan.payload.skillCode,appCode:ctx.appCode,downloadRuntimeSkillPackage:downloadRuntimeSkillPackage,verifyRuntimeSkillBundle:verifyRuntimeSkillBundle});if(contentPreflight.status==="identical"){if(plan.scope==="company"){recordPushedRuntimeSkill(pushDir,contentPreflight.savedSkill,ctx.appCode,{scope:"company"})}else{recordPushedRuntimeSkill(pushDir,contentPreflight.savedSkill,ctx.appCode)}return{ok:true,data:{...summarizeRuntimeSkill(contentPreflight.savedSkill),scope:plan.scope,...plan.scope==="personal"?{warnings:plan.warnings}:{},alreadyPublished:true,contentIdentical:true,diagramSubmitted:false},message:`${scopeLabel(plan.scope)} Skill ${plan.payload.skillCode} is already published and content is identical`}}if(plan.scope==="company"){
9
+ const validation=await validateRuntimeSkillPublish(ctx.appCode,plan.publishInput,{visibility:"NAMESPACE_ONLY"});throwIfPublishValidationFailed("company",plan.payload.skillCode,validation);throwIfUnconfirmedPublishWarnings("company",plan.payload.skillCode,validation.warnings,confirmWarnings);const saved=await publishCompanyRuntimeSkill(ctx.appCode,plan.publishInput,{confirmWarnings:confirmWarnings});recordPushedRuntimeSkill(pushDir,{...saved,files:plan.publishInput.files},ctx.appCode,{scope:"company"});return{ok:true,data:{...summarizeRuntimeSkill(saved),scope:"company",reviewState:"submitted",submittedForReview:true,diagramBound:true,validation:{warnings:validation.warnings}},message:`Submitted company Skill ${plan.payload.skillCode} version ${saved.version??"(unknown)"} for review`}}const validation=await validateRuntimeSkillPublish(ctx.appCode,plan.publishInput,{visibility:"PRIVATE"});throwIfPublishValidationFailed("personal",plan.payload.skillCode,validation)
10
+ ;throwIfUnconfirmedPublishWarnings("personal",plan.payload.skillCode,validation.warnings,confirmWarnings);const personalPublishOptions={confirmWarnings:confirmWarnings};const saved=plan.existing?await updatePersonalRuntimeSkill(plan.payload.skillCode,ctx.appCode,plan.publishInput,personalPublishOptions):await createPersonalRuntimeSkill(ctx.appCode,plan.publishInput,personalPublishOptions);let savedForLocalRecord=saved;if(isMultiFileManifest(plan.publishInput.files)){const packageBytes=await downloadRuntimeSkillPackage("personal",saved.skillCode||plan.payload.skillCode,ctx.appCode);verifyRuntimeSkillBundle(plan.publishInput.files,packageBytes);savedForLocalRecord={...saved,files:plan.publishInput.files}}else if(isPackageBackedManifest(saved.files)){const packageBytes=await downloadRuntimeSkillPackage("personal",saved.skillCode||plan.payload.skillCode,ctx.appCode);verifyRuntimeSkillPackage(saved.files,packageBytes)}recordPushedRuntimeSkill(pushDir,savedForLocalRecord,ctx.appCode);return{
11
+ ok:true,data:{...summarizeRuntimeSkill(saved),warnings:plan.warnings,validation:{warnings:validation.warnings},diagramBound:true},message:plan.existing?`Updated personal Skill ${plan.payload.skillCode}`:`Created personal Skill ${plan.payload.skillCode}`}}function scopeLabel(scope){return scope==="company"?"Company":"Personal"}function withDiagram(input,diagram){return{...input,diagram:diagram}}function diagramPackageExclusion(sourceFilePath){return sourceFilePath?{excludedFilePaths:[sourceFilePath]}:{}}
@@ -1 +1,4 @@
1
- (function(_0x1d0bae,_0x12b791){const _0x57759f=a80_0x3195,_0x37e693=_0x1d0bae();while(!![]){try{const _0x35f18d=-parseInt(_0x57759f(0x1f1))/0x1*(-parseInt(_0x57759f(0x1fc))/0x2)+-parseInt(_0x57759f(0x1e0))/0x3+parseInt(_0x57759f(0x206))/0x4+parseInt(_0x57759f(0x1e2))/0x5*(parseInt(_0x57759f(0x202))/0x6)+-parseInt(_0x57759f(0x1f2))/0x7+-parseInt(_0x57759f(0x1e7))/0x8*(-parseInt(_0x57759f(0x1eb))/0x9)+-parseInt(_0x57759f(0x1fd))/0xa;if(_0x35f18d===_0x12b791)break;else _0x37e693['push'](_0x37e693['shift']());}catch(_0x342c5f){_0x37e693['push'](_0x37e693['shift']());}}}(a80_0x34a4,0x79351));import{CliErrors}from'../../errors.js';export function resolvePushScope(_0x414766){const _0x15f632=a80_0x3195,_0x72df1c=_0x414766['str']('scope')||'personal';if(_0x72df1c===_0x15f632(0x1f7)||_0x72df1c==='company')return _0x72df1c;throw CliErrors['validation']('skill\x20push\x20supports\x20--scope\x20personal\x20or\x20--scope\x20company;\x20received\x20\x22'+_0x72df1c+'\x22.');}export function allowRetargetArgs(_0x2c62d4){return _0x2c62d4?[{'allowAppCodeRetarget':!![]}]:[];}export function remoteFirstMetadataOptions(){return{'ignoreInvalidMetadata':!![],'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataSkillCode':!![]};}export function remoteMissingPayloadOptions(){return{'ignoreMetadataForPayload':!![],'ignoreMetadataScope':!![],'ignoreMetadataSkillCode':!![]};}export function remoteMissingCompanyReadOptions(){const _0x4b1f22=a80_0x3195;return{'targetScope':_0x4b1f22(0x1f6),...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions()};}export function remoteMissingPersonalReadOptions(_0x314c43={}){return{...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions(),..._0x314c43};}export function remotePersonalReadOptions(_0x2e7115,_0x235850={}){return{'ignoreInvalidMetadata':!![],..._0x2e7115?{'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataScope':!![]}:{},..._0x235850};}function a80_0x3195(_0x1fdede,_0x2d7f2c){_0x1fdede=_0x1fdede-0x1e0;const _0x34a497=a80_0x34a4();let _0x3195dc=_0x34a497[_0x1fdede];return _0x3195dc;}function a80_0x34a4(){const _0x2d1f0f=['identical','265240HOinQT','files','valid','verifyRuntimeSkillBundle','9yDrgyW','Review\x20each\x20warning\x20before\x20continuing.','Warnings:\x20','warning','not-applicable','appCode','2348JkiwMQ','3890558qJFmHz','\x20cannot\x20be\x20pushed.','validation','warnings','company','personal','downloadRuntimeSkillPackage','\x20after\x20successful\x20push.','Use\x20a\x20different\x20skillCode\x20when\x20submitting\x20a\x20personal\x20or\x20company\x20Skill.','publishInput','658LmqIWw','5288360AlWzLp','\x20Skill\x20push\x20validation\x20reported\x20warning(s)\x20for\x20','join','(unknown)','Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.','12nTuzJd','length','remote','SkillHub\x20validation\x20returned\x20invalid.','738868GRspxZ','skillCode','Personal','799185CATNgA','scope','2142815cmSmSq','errors','builtin','Company'];a80_0x34a4=function(){return _0x2d1f0f;};return a80_0x34a4();}export function throwIfBuiltinPushTarget(_0x438d85){const _0x4753a0=a80_0x3195;if(_0x438d85?.['scope']!==_0x4753a0(0x1e4))return;throw CliErrors[_0x4753a0(0x1f4)]('Builtin\x20Skill\x20'+(_0x438d85[_0x4753a0(0x207)]??_0x4753a0(0x200))+_0x4753a0(0x1f3),_0x4753a0(0x1fa));}export function throwIfPublishValidationFailed(_0x5dd5c9,_0x12eaf7,_0x4472bf){const _0x469413=a80_0x3195;if(_0x4472bf[_0x469413(0x1e3)]['length']===0x0&&(_0x4472bf[_0x469413(0x1e9)]||_0x4472bf[_0x469413(0x1f5)][_0x469413(0x203)]>0x0))return;const _0x264f3a=_0x4472bf[_0x469413(0x1e3)][_0x469413(0x203)]>0x0?_0x4472bf['errors'][_0x469413(0x1ff)](';\x20'):_0x469413(0x205),_0x4ea078=_0x5dd5c9===_0x469413(0x1f6)?_0x469413(0x1e5):_0x469413(0x208);throw CliErrors[_0x469413(0x1f4)](_0x4ea078+'\x20Skill\x20push\x20validation\x20failed\x20for\x20'+_0x12eaf7+'.',_0x264f3a);}export function throwIfUnconfirmedPublishWarnings(_0x3d84e6,_0xcf3993,_0x4217cf,_0x5e79ff){const _0x197f6d=a80_0x3195;if(_0x4217cf['length']===0x0||_0x5e79ff)return;const _0x385361=_0x3d84e6==='company'?_0x197f6d(0x1e5):_0x197f6d(0x208);throw CliErrors['validation'](_0x385361+_0x197f6d(0x1fe)+_0xcf3993+'.',[_0x197f6d(0x1ec),'Do\x20not\x20modify\x20the\x20source\x20Skill\x20merely\x20to\x20satisfy\x20publishing.','Fix\x20real\x20issues.\x20If\x20the\x20remaining\x20warnings\x20are\x20reviewed\x20false\x20positives,\x20rerun\x20with\x20--confirm-warnings\x20to\x20submit\x20the\x20unchanged\x20package.',_0x197f6d(0x1ed)+_0x4217cf['join'](';\x20')][_0x197f6d(0x1ff)]('\x20'));}export function buildRetargetWarning(_0x550a46,_0x124a07){const _0x23b307=a80_0x3195;if(!_0x550a46?.[_0x23b307(0x1f0)]||_0x550a46[_0x23b307(0x1f0)]===_0x124a07)return[];return[{'level':_0x23b307(0x1ee),'ruleId':'skill-metadata-appcode-retargeted','file':'lovrabet.skill.json','message':'Local\x20Skill\x20metadata\x20appCode\x20'+_0x550a46[_0x23b307(0x1f0)]+'\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20'+_0x124a07+_0x23b307(0x1f9),'suggestion':_0x23b307(0x201)}];}export async function runRemoteContentPreflight(_0xcce79){const _0x61c91f=a80_0x3195;if(!_0xcce79[_0x61c91f(0x204)]||_0xcce79[_0x61c91f(0x204)][_0x61c91f(0x1e1)]!==_0xcce79[_0x61c91f(0x1e1)]||!_0xcce79[_0x61c91f(0x1fb)][_0x61c91f(0x1e8)])return{'status':_0x61c91f(0x1ef)};const _0x344df0=_0xcce79[_0x61c91f(0x204)][_0x61c91f(0x207)]||_0xcce79['skillCode'];if(!_0x344df0)return{'status':_0x61c91f(0x1ef)};const _0x1de637=await _0xcce79[_0x61c91f(0x1f8)](_0xcce79['scope'],_0x344df0,_0xcce79[_0x61c91f(0x1f0)],_0xcce79[_0x61c91f(0x204)]['version']);try{_0xcce79[_0x61c91f(0x1ea)](_0xcce79[_0x61c91f(0x1fb)][_0x61c91f(0x1e8)],_0x1de637);}catch{return{'status':'different'};}return{'status':_0x61c91f(0x1e6),'savedSkill':{..._0xcce79[_0x61c91f(0x204)],'content':_0xcce79['publishInput']['content'],'files':_0xcce79['publishInput'][_0x61c91f(0x1e8)]}};}
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 a81_0x12f0(){const _0x50e5b6=['5UGBpgk','30PtwYxy','skill-metadata-appcode-retargeted','skillName','\x20after\x20successful\x20push.','Local\x20Skill\x20metadata\x20appCode\x20','245679oRGGrN','warning','1370760eTQlJF','appCode','133122szefTj','156950ikpPCA','isArray','10498338DhFsUE','preferInputSkillName','2251180bNnUbj','sourceSessionId','Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.','2964648PJpJRw','description','tags','version'];a81_0x12f0=function(){return _0x50e5b6;};return a81_0x12f0();}function a81_0x1049(_0x4e9bca,_0x198c71){_0x4e9bca=_0x4e9bca-0x80;const _0x12f0ff=a81_0x12f0();let _0x104994=_0x12f0ff[_0x4e9bca];return _0x104994;}(function(_0x5edfc0,_0x16f60e){const _0x40b2de=a81_0x1049,_0x13d5a4=_0x5edfc0();while(!![]){try{const _0x369e46=-parseInt(_0x40b2de(0x83))/0x1+-parseInt(_0x40b2de(0x82))/0x2+parseInt(_0x40b2de(0x80))/0x3+-parseInt(_0x40b2de(0x87))/0x4*(parseInt(_0x40b2de(0x8e))/0x5)+parseInt(_0x40b2de(0x8f))/0x6*(-parseInt(_0x40b2de(0x94))/0x7)+-parseInt(_0x40b2de(0x8a))/0x8+parseInt(_0x40b2de(0x85))/0x9;if(_0x369e46===_0x16f60e)break;else _0x13d5a4['push'](_0x13d5a4['shift']());}catch(_0x2818f0){_0x13d5a4['push'](_0x13d5a4['shift']());}}}(a81_0x12f0,0x470d6));export function withRetargetExistingMetadata(_0x438fd6,_0x5d5566,_0x3a6e02={}){const _0x5b1ac1=a81_0x1049,_0x46ae6e=_0x3a6e02[_0x5b1ac1(0x86)]?_0x438fd6[_0x5b1ac1(0x91)]??_0x5d5566['skillName']:_0x5d5566[_0x5b1ac1(0x91)]??_0x438fd6[_0x5b1ac1(0x91)];return{..._0x438fd6,'skillName':_0x46ae6e,'description':_0x5d5566[_0x5b1ac1(0x8b)]??_0x438fd6[_0x5b1ac1(0x8b)],'tags':Array[_0x5b1ac1(0x84)](_0x5d5566[_0x5b1ac1(0x8c)])?_0x5d5566[_0x5b1ac1(0x8c)]:_0x438fd6[_0x5b1ac1(0x8c)],'version':_0x5d5566['version']??_0x438fd6[_0x5b1ac1(0x8d)],'sourceSessionId':_0x5d5566[_0x5b1ac1(0x88)]??_0x438fd6[_0x5b1ac1(0x88)]};}export function buildRetargetWarning(_0xb1ec5,_0x26ddfd){const _0x168442=a81_0x1049;if(!_0xb1ec5?.[_0x168442(0x81)]||_0xb1ec5['appCode']===_0x26ddfd)return[];return[{'level':_0x168442(0x95),'ruleId':_0x168442(0x90),'file':'lovrabet.skill.json','message':_0x168442(0x93)+_0xb1ec5[_0x168442(0x81)]+'\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20'+_0x26ddfd+_0x168442(0x92),'suggestion':_0x168442(0x89)}];}
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(_0x4face0,_0x4c4538){const _0x46290e=a82_0x3d08,_0x56e945=_0x4face0();while(!![]){try{const _0x40d849=parseInt(_0x46290e(0xec))/0x1+parseInt(_0x46290e(0xe2))/0x2*(parseInt(_0x46290e(0xe1))/0x3)+-parseInt(_0x46290e(0xe3))/0x4*(-parseInt(_0x46290e(0xdd))/0x5)+-parseInt(_0x46290e(0xe9))/0x6*(parseInt(_0x46290e(0xeb))/0x7)+parseInt(_0x46290e(0xe5))/0x8*(-parseInt(_0x46290e(0xe0))/0x9)+-parseInt(_0x46290e(0xde))/0xa*(parseInt(_0x46290e(0xed))/0xb)+parseInt(_0x46290e(0xdb))/0xc;if(_0x40d849===_0x4c4538)break;else _0x56e945['push'](_0x56e945['shift']());}catch(_0x4a6559){_0x56e945['push'](_0x56e945['shift']());}}}(a82_0x42a7,0x4681b));function a82_0x42a7(){const _0x3f7349=['57RJtLdK','47998KnHtIp','8pGrHvI','personal','84528atmAhl','Unsupported\x20Skill\x20sync\x20scope:\x20','validation','trim','1417158NfdPHJ','Unsupported\x20Skill\x20list\x20scope:\x20','14TEdjPe','144744xHHOSj','11vVEKso','7853628PhrYQB','company','847490UEtRYv','3152750WmxLcc','all','441NYRoZK'];a82_0x42a7=function(){return _0x3f7349;};return a82_0x42a7();}import{CliErrors}from'../../errors.js';function a82_0x3d08(_0x2b2469,_0x5eab13){_0x2b2469=_0x2b2469-0xdb;const _0x42a735=a82_0x42a7();let _0x3d0879=_0x42a735[_0x2b2469];return _0x3d0879;}export function normalizeSyncScopes(_0x300639){const _0x3c785c=a82_0x3d08,_0x4ce833=_0x300639[_0x3c785c(0xe8)]();if(!_0x4ce833||_0x4ce833===_0x3c785c(0xdf))return[_0x3c785c(0xe4),_0x3c785c(0xdc)];if(_0x4ce833===_0x3c785c(0xe4)||_0x4ce833===_0x3c785c(0xdc))return[_0x4ce833];throw CliErrors['validation'](_0x3c785c(0xe6)+_0x300639);}export function normalizeListScope(_0x68811c){const _0x45ec45=a82_0x3d08,_0x5012a5=_0x68811c[_0x45ec45(0xe8)]();if(!_0x5012a5)return _0x45ec45(0xdf);if(_0x5012a5===_0x45ec45(0xe4)||_0x5012a5===_0x45ec45(0xdc)||_0x5012a5===_0x45ec45(0xdf))return _0x5012a5;throw CliErrors[_0x45ec45(0xe7)](_0x45ec45(0xea)+_0x68811c);}export function shouldListScope(_0xa4bd77,_0x1d87b3){if(_0xa4bd77==='all')return!![];return _0xa4bd77===_0x1d87b3;}export function listScopeToRuntimeScopes(_0x58598c){const _0x1b19d6=a82_0x3d08;if(_0x58598c===_0x1b19d6(0xdf))return[_0x1b19d6(0xe4),_0x1b19d6(0xdc)];return[_0x58598c==='company'?_0x1b19d6(0xdc):_0x58598c];}export function listScopeToRemoteScope(_0x1a5bee){return _0x1a5bee;}
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 a83_0x17be(_0x565c9f,_0x4bd9d3){_0x565c9f=_0x565c9f-0x150;var _0x277224=a83_0x2772();var _0x17be52=_0x277224[_0x565c9f];return _0x17be52;}(function(_0x1d891d,_0x5e5d35){var _0x31f261=a83_0x17be,_0x53b4cb=_0x1d891d();while(!![]){try{var _0xdf9ce3=parseInt(_0x31f261(0x15b))/0x1*(parseInt(_0x31f261(0x162))/0x2)+-parseInt(_0x31f261(0x153))/0x3*(-parseInt(_0x31f261(0x157))/0x4)+-parseInt(_0x31f261(0x165))/0x5+parseInt(_0x31f261(0x156))/0x6*(-parseInt(_0x31f261(0x163))/0x7)+-parseInt(_0x31f261(0x152))/0x8*(parseInt(_0x31f261(0x154))/0x9)+parseInt(_0x31f261(0x159))/0xa*(-parseInt(_0x31f261(0x151))/0xb)+parseInt(_0x31f261(0x15c))/0xc;if(_0xdf9ce3===_0x5e5d35)break;else _0x53b4cb['push'](_0x53b4cb['shift']());}catch(_0x4008e3){_0x53b4cb['push'](_0x53b4cb['shift']());}}}(a83_0x2772,0xa82b1));export function summarizeRuntimeSkill(_0x23048){var _0x1b5741=a83_0x17be;return{'id':_0x23048['id'],'skillCode':_0x23048[_0x1b5741(0x15d)],'skillName':_0x23048[_0x1b5741(0x161)],'scope':_0x23048[_0x1b5741(0x155)],'version':_0x23048[_0x1b5741(0x150)],'readonly':_0x23048[_0x1b5741(0x160)]};}function a83_0x2772(){var _0x364978=['14594460ABhHDp','skillCode','dir','cacheDir','readonly','skillName','150826CVcHQG','721iOCzog','skillMdPath','4096765DjqopE','linkedPaths','version','44KyHUEp','48fuOLRN','104949BnBOpo','475038JUNncZ','scope','57762iNPKzl','152dakIOd','contentHash','831050GEKmHH','treeHash','8DwmggB'];a83_0x2772=function(){return _0x364978;};return a83_0x2772();}export function summarizeLocalRuntimeSkill(_0x1dcb4d){var _0x7ccabc=a83_0x17be;return{'id':_0x1dcb4d['id'],'skillCode':_0x1dcb4d['skillCode'],'skillName':_0x1dcb4d['skillName'],'scope':_0x1dcb4d[_0x7ccabc(0x155)],'appCode':_0x1dcb4d['appCode'],'version':_0x1dcb4d[_0x7ccabc(0x150)],'status':_0x1dcb4d['status'],'readonly':_0x1dcb4d[_0x7ccabc(0x160)],'tags':_0x1dcb4d['tags'],'dir':_0x1dcb4d[_0x7ccabc(0x15e)],'cacheDir':_0x1dcb4d[_0x7ccabc(0x15f)],'skillMdPath':_0x1dcb4d[_0x7ccabc(0x164)],'metadataPath':_0x1dcb4d['metadataPath'],'linkedPaths':_0x1dcb4d[_0x7ccabc(0x166)],'contentHash':_0x1dcb4d[_0x7ccabc(0x158)],'treeHash':_0x1dcb4d[_0x7ccabc(0x15a)],'pulledAt':_0x1dcb4d['pulledAt']};}
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}}