@lovrabet/lovrabet-cli 2.1.17 → 2.1.18-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/lib/cli.d.ts +21 -0
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.d.ts +38 -0
  4. package/lib/commands/api-doc/index.js +1 -1
  5. package/lib/commands/app/cache.d.ts +61 -0
  6. package/lib/commands/app/cache.js +1 -1
  7. package/lib/commands/app/definitions.d.ts +26 -0
  8. package/lib/commands/app/definitions.js +1 -1
  9. package/lib/commands/app/eligibility.d.ts +16 -0
  10. package/lib/commands/app/eligibility.js +1 -1
  11. package/lib/commands/app/mock-loader.d.ts +41 -0
  12. package/lib/commands/app/mock-loader.js +1 -1
  13. package/lib/commands/app/remote-source.d.ts +66 -0
  14. package/lib/commands/app/remote-source.js +1 -1
  15. package/lib/commands/app/shared.d.ts +38 -0
  16. package/lib/commands/app/shared.js +1 -1
  17. package/lib/commands/app-config/get.d.ts +2 -0
  18. package/lib/commands/app-config/get.js +1 -1
  19. package/lib/commands/app-config/index.d.ts +2 -0
  20. package/lib/commands/app-config/index.js +1 -1
  21. package/lib/commands/artifact/index.d.ts +9 -0
  22. package/lib/commands/artifact/index.js +1 -1
  23. package/lib/commands/auth/device.d.ts +31 -0
  24. package/lib/commands/auth/device.js +1 -1
  25. package/lib/commands/auth/index.d.ts +23 -0
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/auth/prompt.d.ts +33 -0
  28. package/lib/commands/auth/prompt.js +1 -1
  29. package/lib/commands/bff/detail.d.ts +8 -0
  30. package/lib/commands/bff/detail.js +1 -1
  31. package/lib/commands/bff/exec.d.ts +19 -0
  32. package/lib/commands/bff/exec.js +1 -1
  33. package/lib/commands/bff/index.d.ts +15 -0
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/cli-skill/index.d.ts +9 -0
  36. package/lib/commands/cli-skill/index.js +1 -1
  37. package/lib/commands/common/config-policy.d.ts +80 -0
  38. package/lib/commands/common/config-policy.js +1 -1
  39. package/lib/commands/common/constraints.d.ts +67 -0
  40. package/lib/commands/common/constraints.js +1 -1
  41. package/lib/commands/common/flags.d.ts +41 -0
  42. package/lib/commands/common/flags.js +1 -1
  43. package/lib/commands/common/local-file.d.ts +6 -0
  44. package/lib/commands/common/local-file.js +1 -1
  45. package/lib/commands/config/definitions.d.ts +21 -0
  46. package/lib/commands/config/definitions.js +1 -1
  47. package/lib/commands/config/shared.d.ts +17 -0
  48. package/lib/commands/config/shared.js +1 -1
  49. package/lib/commands/data/index.d.ts +27 -0
  50. package/lib/commands/data/index.js +1 -1
  51. package/lib/commands/dataset/detail.d.ts +26 -0
  52. package/lib/commands/dataset/detail.js +1 -1
  53. package/lib/commands/dataset/index.d.ts +10 -0
  54. package/lib/commands/dataset/index.js +1 -1
  55. package/lib/commands/dataset/list.d.ts +18 -0
  56. package/lib/commands/dataset/list.js +1 -1
  57. package/lib/commands/dataset/sdk-doc.d.ts +6 -0
  58. package/lib/commands/dataset/sdk-doc.js +1 -1
  59. package/lib/commands/doctor.d.ts +23 -0
  60. package/lib/commands/doctor.js +1 -1
  61. package/lib/commands/file/index.d.ts +2 -0
  62. package/lib/commands/file/index.js +1 -1
  63. package/lib/commands/init.d.ts +32 -0
  64. package/lib/commands/init.js +1 -1
  65. package/lib/commands/kb/index.d.ts +8 -0
  66. package/lib/commands/kb/index.js +1 -1
  67. package/lib/commands/logs/index.d.ts +20 -0
  68. package/lib/commands/logs/index.js +1 -1
  69. package/lib/commands/ocr/index.d.ts +2 -0
  70. package/lib/commands/ocr/index.js +1 -1
  71. package/lib/commands/personal-bff/index.d.ts +5 -0
  72. package/lib/commands/personal-bff/index.js +1 -1
  73. package/lib/commands/registry.d.ts +56 -0
  74. package/lib/commands/registry.js +1 -1
  75. package/lib/commands/schedule/index.d.ts +2 -0
  76. package/lib/commands/schedule/index.js +1 -0
  77. package/lib/commands/schema.d.ts +18 -0
  78. package/lib/commands/schema.js +1 -1
  79. package/lib/commands/service/dynamic.d.ts +18 -0
  80. package/lib/commands/service/dynamic.js +1 -1
  81. package/lib/commands/service/function-name-adapter.d.ts +13 -0
  82. package/lib/commands/service/function-name-adapter.js +1 -1
  83. package/lib/commands/service/index.d.ts +2 -0
  84. package/lib/commands/service/index.js +1 -1
  85. package/lib/commands/service/registry.d.ts +102 -0
  86. package/lib/commands/service/registry.js +1 -1
  87. package/lib/commands/skill/commands/create.d.ts +2 -0
  88. package/lib/commands/skill/commands/create.js +1 -1
  89. package/lib/commands/skill/commands/install.d.ts +2 -0
  90. package/lib/commands/skill/commands/install.js +1 -1
  91. package/lib/commands/skill/commands/list.d.ts +2 -0
  92. package/lib/commands/skill/commands/list.js +1 -1
  93. package/lib/commands/skill/commands/push.d.ts +2 -0
  94. package/lib/commands/skill/commands/push.js +1 -1
  95. package/lib/commands/skill/commands/validate.d.ts +2 -0
  96. package/lib/commands/skill/commands/validate.js +1 -1
  97. package/lib/commands/skill/flags.d.ts +13 -0
  98. package/lib/commands/skill/flags.js +1 -1
  99. package/lib/commands/skill/index.d.ts +9 -0
  100. package/lib/commands/skill/index.js +1 -1
  101. package/lib/commands/skill/manifest-helpers.d.ts +5 -0
  102. package/lib/commands/skill/manifest-helpers.js +1 -1
  103. package/lib/commands/skill/push-execute.d.ts +49 -0
  104. package/lib/commands/skill/push-execute.js +1 -1
  105. package/lib/commands/skill/push-flow-helpers.d.ts +80 -0
  106. package/lib/commands/skill/push-flow-helpers.js +1 -1
  107. package/lib/commands/skill/push-retarget.d.ts +9 -0
  108. package/lib/commands/skill/push-retarget.js +1 -1
  109. package/lib/commands/skill/scopes.d.ts +13 -0
  110. package/lib/commands/skill/scopes.js +1 -1
  111. package/lib/commands/skill/summary.d.ts +6 -0
  112. package/lib/commands/skill/summary.js +1 -1
  113. package/lib/commands/skill/templates.d.ts +23 -0
  114. package/lib/commands/skill/templates.js +1 -1
  115. package/lib/commands/skill/validate.d.ts +20 -0
  116. package/lib/commands/skill/validate.js +1 -1
  117. package/lib/commands/sql/detail.d.ts +13 -0
  118. package/lib/commands/sql/detail.js +1 -1
  119. package/lib/commands/sql/exec.d.ts +21 -0
  120. package/lib/commands/sql/exec.js +1 -1
  121. package/lib/commands/sql/index.d.ts +9 -0
  122. package/lib/commands/sql/index.js +1 -1
  123. package/lib/commands/update.d.ts +10 -0
  124. package/lib/commands/update.js +1 -1
  125. package/lib/commands/workspace/index.d.ts +10 -0
  126. package/lib/commands/workspace/index.js +1 -1
  127. package/lib/config/schema.d.ts +108 -0
  128. package/lib/config/schema.js +1 -1
  129. package/lib/constant/app.d.ts +13 -0
  130. package/lib/constant/app.js +1 -1
  131. package/lib/constant/auth-mode.d.ts +28 -0
  132. package/lib/constant/auth-mode.js +1 -1
  133. package/lib/constant/cli.d.ts +86 -0
  134. package/lib/constant/cli.js +1 -1
  135. package/lib/constant/defaults.d.ts +45 -0
  136. package/lib/constant/defaults.js +1 -1
  137. package/lib/constant/distribution.d.ts +12 -0
  138. package/lib/constant/distribution.js +1 -1
  139. package/lib/constant/domain.d.ts +57 -0
  140. package/lib/constant/domain.js +1 -1
  141. package/lib/constant/env.d.ts +56 -0
  142. package/lib/constant/env.js +1 -1
  143. package/lib/constant/output.d.ts +13 -0
  144. package/lib/constant/output.js +1 -1
  145. package/lib/constant/product.d.ts +79 -0
  146. package/lib/constant/product.js +1 -1
  147. package/lib/constant/risk.d.ts +14 -0
  148. package/lib/constant/risk.js +1 -1
  149. package/lib/constant/url.d.ts +14 -0
  150. package/lib/constant/url.js +1 -1
  151. package/lib/context.d.ts +287 -0
  152. package/lib/context.js +1 -1
  153. package/lib/core/api-client.d.ts +451 -0
  154. package/lib/core/api-client.js +1 -1
  155. package/lib/core/db-resolver.d.ts +39 -0
  156. package/lib/core/db-resolver.js +1 -1
  157. package/lib/core/sdk-client.d.ts +62 -0
  158. package/lib/core/sdk-client.js +1 -1
  159. package/lib/errors.d.ts +25 -0
  160. package/lib/errors.js +1 -1
  161. package/lib/framework/build-all-flags.d.ts +24 -0
  162. package/lib/framework/build-all-flags.js +1 -1
  163. package/lib/framework/dryrun.d.ts +64 -0
  164. package/lib/framework/dryrun.js +1 -1
  165. package/lib/framework/flags.d.ts +19 -0
  166. package/lib/framework/flags.js +1 -1
  167. package/lib/framework/help.d.ts +21 -0
  168. package/lib/framework/help.js +1 -1
  169. package/lib/framework/index.d.ts +10 -0
  170. package/lib/framework/index.js +1 -1
  171. package/lib/framework/output.d.ts +10 -0
  172. package/lib/framework/output.js +1 -1
  173. package/lib/framework/preparse.d.ts +64 -0
  174. package/lib/framework/preparse.js +1 -1
  175. package/lib/framework/rate-limit.d.ts +10 -0
  176. package/lib/framework/rate-limit.js +1 -1
  177. package/lib/framework/response.d.ts +10 -0
  178. package/lib/framework/response.js +1 -1
  179. package/lib/framework/runner-confirmation.d.ts +46 -0
  180. package/lib/framework/runner-confirmation.js +1 -1
  181. package/lib/framework/runner-error.d.ts +28 -0
  182. package/lib/framework/runner-error.js +1 -1
  183. package/lib/framework/runner.d.ts +102 -0
  184. package/lib/framework/runner.js +1 -1
  185. package/lib/framework/schema-export.d.ts +29 -0
  186. package/lib/framework/schema-export.js +1 -1
  187. package/lib/framework/service-order.d.ts +4 -0
  188. package/lib/framework/service-order.js +1 -1
  189. package/lib/framework/types.d.ts +108 -0
  190. package/lib/framework/types.js +1 -1
  191. package/lib/generated/build-info.d.ts +4 -0
  192. package/lib/generated/build-info.js +1 -1
  193. package/lib/help.d.ts +25 -0
  194. package/lib/help.js +1 -1
  195. package/lib/runtime/event.d.ts +16 -0
  196. package/lib/runtime/event.js +1 -0
  197. package/lib/runtime/index.d.ts +13 -0
  198. package/lib/runtime/index.js +1 -0
  199. package/lib/runtime/queue.d.ts +6 -0
  200. package/lib/runtime/queue.js +1 -0
  201. package/lib/runtime/resolve.d.ts +14 -0
  202. package/lib/runtime/resolve.js +1 -0
  203. package/lib/runtime/types.d.ts +59 -0
  204. package/lib/runtime/types.js +1 -0
  205. package/lib/skills/npx-skills-add.d.ts +42 -0
  206. package/lib/skills/npx-skills-add.js +1 -1
  207. package/lib/skills/runtime-skill-sync/constants.d.ts +4 -0
  208. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  209. package/lib/skills/runtime-skill-sync/fs-utils.d.ts +21 -0
  210. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  211. package/lib/skills/runtime-skill-sync/hashing.d.ts +9 -0
  212. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  213. package/lib/skills/runtime-skill-sync/links.d.ts +18 -0
  214. package/lib/skills/runtime-skill-sync/links.js +1 -1
  215. package/lib/skills/runtime-skill-sync/list-local.d.ts +3 -0
  216. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  217. package/lib/skills/runtime-skill-sync/local-files.d.ts +25 -0
  218. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  219. package/lib/skills/runtime-skill-sync/materialize.d.ts +11 -0
  220. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  221. package/lib/skills/runtime-skill-sync/metadata.d.ts +7 -0
  222. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  223. package/lib/skills/runtime-skill-sync/paths.d.ts +11 -0
  224. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  225. package/lib/skills/runtime-skill-sync/push.d.ts +33 -0
  226. package/lib/skills/runtime-skill-sync/push.js +1 -1
  227. package/lib/skills/runtime-skill-sync/scopes.d.ts +5 -0
  228. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  229. package/lib/skills/runtime-skill-sync/types.d.ts +105 -0
  230. package/lib/skills/runtime-skill-sync/zip-codec.d.ts +9 -0
  231. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  232. package/lib/skills/runtime-skill-sync/zip-package.d.ts +15 -0
  233. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  234. package/lib/skills/runtime-skill-sync.d.ts +15 -0
  235. package/lib/skills/runtime-skill-sync.js +1 -1
  236. package/lib/utils/apply-jq-filter.d.ts +25 -0
  237. package/lib/utils/apply-jq-filter.js +1 -1
  238. package/lib/utils/logger.d.ts +73 -0
  239. package/lib/utils/logger.js +1 -1
  240. package/lib/utils/lossless-json.d.ts +21 -0
  241. package/lib/utils/lossless-json.js +1 -1
  242. package/lib/utils/params.d.ts +65 -0
  243. package/lib/utils/params.js +1 -1
  244. package/lib/utils/platform.d.ts +17 -0
  245. package/lib/utils/platform.js +1 -1
  246. package/lib/utils/update-notice.d.ts +10 -0
  247. package/lib/utils/update-notice.js +1 -1
  248. package/lib/utils/version.d.ts +18 -0
  249. package/lib/utils/version.js +1 -1
  250. package/lib/utils/write-cli-side-channel.d.ts +6 -0
  251. package/lib/utils/write-cli-side-channel.js +1 -1
  252. package/package.json +9 -1
@@ -0,0 +1,80 @@
1
+ import type { RuntimeSkillFilesManifest, RuntimeSkillItem, RuntimeSkillUpsertInput } from "../../core/api-client.js";
2
+ import type { RuntimeContext } from "../../framework/types.js";
3
+ import type { SkillValidationIssue } from "./validate.js";
4
+ /** Resolves the requested push scope while keeping personal as the default. */
5
+ export declare function resolvePushScope(ctx: RuntimeContext): "personal" | "company";
6
+ /** Returns an optional argument tuple for explicit appCode retarget calls. */
7
+ export declare function allowRetargetArgs(allowRetarget: boolean): [] | [{
8
+ allowAppCodeRetarget: true;
9
+ }];
10
+ /** Lets push consult the remote Skill before treating local metadata cache as authoritative. */
11
+ export declare function remoteFirstMetadataOptions(): {
12
+ ignoreInvalidMetadata: true;
13
+ ignoreMetadataAppCodeMismatch: true;
14
+ ignoreMetadataSkillCode: true;
15
+ };
16
+ /** Treats missing remote metadata as a new Skill publish, ignoring stale local cache fields. */
17
+ export declare function remoteMissingPayloadOptions(): {
18
+ ignoreMetadataForPayload: true;
19
+ ignoreMetadataScope: true;
20
+ ignoreMetadataSkillCode: true;
21
+ };
22
+ /** Builds read options for a missing remote company Skill. */
23
+ export declare function remoteMissingCompanyReadOptions(): {
24
+ ignoreMetadataForPayload: true;
25
+ ignoreMetadataScope: true;
26
+ ignoreMetadataSkillCode: true;
27
+ ignoreInvalidMetadata: true;
28
+ ignoreMetadataAppCodeMismatch: true;
29
+ targetScope: "company";
30
+ };
31
+ /** Builds read options for a missing remote personal Skill. */
32
+ export declare function remoteMissingPersonalReadOptions(extra?: object): {
33
+ ignoreMetadataForPayload: true;
34
+ ignoreMetadataScope: true;
35
+ ignoreMetadataSkillCode: true;
36
+ ignoreInvalidMetadata: true;
37
+ ignoreMetadataAppCodeMismatch: true;
38
+ };
39
+ /** Builds read options for an existing remote personal Skill. */
40
+ export declare function remotePersonalReadOptions(allowLocalScopeRecovery: boolean, extra?: object): {
41
+ ignoreMetadataAppCodeMismatch?: true | undefined;
42
+ ignoreMetadataScope?: true | undefined;
43
+ ignoreInvalidMetadata: true;
44
+ };
45
+ /** Rejects push attempts that target immutable builtin Skills. */
46
+ export declare function throwIfBuiltinPushTarget(remote: {
47
+ skillCode?: string;
48
+ scope?: string;
49
+ } | undefined): void;
50
+ /** Converts a failed SkillHub push validation response into a CLI validation error. */
51
+ export declare function throwIfPublishValidationFailed(scope: RuntimeSkillContentScope, skillCode: string, validation: {
52
+ valid: boolean;
53
+ errors: string[];
54
+ warnings: string[];
55
+ }): void;
56
+ /** Blocks unconfirmed publish warnings for either Skill scope. */
57
+ export declare function throwIfUnconfirmedPublishWarnings(scope: RuntimeSkillContentScope, skillCode: string, warnings: string[], confirmWarnings: boolean): void;
58
+ /** Builds a user-facing warning after an explicit appCode retarget succeeds. */
59
+ export declare function buildRetargetWarning(metadata: {
60
+ appCode?: string;
61
+ } | undefined, targetAppCode: string): SkillValidationIssue[];
62
+ export type RuntimeSkillContentScope = "personal" | "company";
63
+ export type DownloadRuntimeSkillPackage = (scope: RuntimeSkillContentScope, skillCode: string, appCode: string, version?: string) => Promise<Buffer>;
64
+ export type VerifyRuntimeSkillBundle = (manifest: RuntimeSkillFilesManifest, packageBytes: Buffer) => unknown;
65
+ export type RemoteContentPreflightResult = {
66
+ status: "identical";
67
+ savedSkill: RuntimeSkillItem;
68
+ } | {
69
+ status: "different" | "not-applicable";
70
+ };
71
+ /** Checks whether the current remote package exactly matches the local push package. */
72
+ export declare function runRemoteContentPreflight(input: {
73
+ scope: RuntimeSkillContentScope;
74
+ remote: RuntimeSkillItem | undefined;
75
+ publishInput: Pick<RuntimeSkillUpsertInput, "content" | "files">;
76
+ skillCode: string;
77
+ appCode: string;
78
+ downloadRuntimeSkillPackage: DownloadRuntimeSkillPackage;
79
+ verifyRuntimeSkillBundle: VerifyRuntimeSkillBundle;
80
+ }): Promise<RemoteContentPreflightResult>;
@@ -1 +1 @@
1
- (function(_0x412fa3,_0x514133){const _0x2ab593=a51_0x4347,_0x1a9009=_0x412fa3();while(!![]){try{const _0x19555b=parseInt(_0x2ab593(0x14e))/0x1*(-parseInt(_0x2ab593(0x157))/0x2)+-parseInt(_0x2ab593(0x159))/0x3+parseInt(_0x2ab593(0x13f))/0x4*(parseInt(_0x2ab593(0x16c))/0x5)+-parseInt(_0x2ab593(0x15c))/0x6*(-parseInt(_0x2ab593(0x14b))/0x7)+parseInt(_0x2ab593(0x161))/0x8*(parseInt(_0x2ab593(0x158))/0x9)+parseInt(_0x2ab593(0x149))/0xa+-parseInt(_0x2ab593(0x14a))/0xb;if(_0x19555b===_0x514133)break;else _0x1a9009['push'](_0x1a9009['shift']());}catch(_0x367b0f){_0x1a9009['push'](_0x1a9009['shift']());}}}(a51_0xd2f6,0x9b043));import{CliErrors}from'../../errors.js';export function resolvePushScope(_0x4a8887){const _0x36030d=a51_0x4347,_0x426dc5=_0x4a8887[_0x36030d(0x16a)]('scope')||'personal';if(_0x426dc5===_0x36030d(0x14d)||_0x426dc5===_0x36030d(0x15a))return _0x426dc5;throw CliErrors['validation'](_0x36030d(0x160)+_0x426dc5+'\x22.');}export function allowRetargetArgs(_0x188fc6){return _0x188fc6?[{'allowAppCodeRetarget':!![]}]:[];}export function remoteFirstMetadataOptions(){return{'ignoreInvalidMetadata':!![],'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataSkillCode':!![]};}function a51_0x4347(_0x20e4c0,_0x1f745c){_0x20e4c0=_0x20e4c0-0x13c;const _0xd2f601=a51_0xd2f6();let _0x434772=_0xd2f601[_0x20e4c0];return _0x434772;}export function remoteMissingPayloadOptions(){return{'ignoreMetadataForPayload':!![],'ignoreMetadataScope':!![],'ignoreMetadataSkillCode':!![]};}export function remoteMissingCompanyReadOptions(){const _0x4edd42=a51_0x4347;return{'targetScope':_0x4edd42(0x15a),...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions()};}export function remoteMissingPersonalReadOptions(_0x450d0b={}){return{...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions(),..._0x450d0b};}export function remotePersonalReadOptions(_0x5747b5,_0x348730={}){return{'ignoreInvalidMetadata':!![],..._0x5747b5?{'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataScope':!![]}:{},..._0x348730};}export function throwIfBuiltinPushTarget(_0x5cd959){const _0x4402e1=a51_0x4347;if(_0x5cd959?.[_0x4402e1(0x153)]!==_0x4402e1(0x168))return;throw CliErrors[_0x4402e1(0x166)](_0x4402e1(0x169)+(_0x5cd959[_0x4402e1(0x15e)]??_0x4402e1(0x16b))+_0x4402e1(0x145),_0x4402e1(0x155));}export function throwIfPublishValidationFailed(_0x38ffbc,_0x3e80e5,_0x2c8471){const _0x5a9b88=a51_0x4347;if(_0x2c8471[_0x5a9b88(0x14f)]['length']===0x0&&(_0x2c8471[_0x5a9b88(0x142)]||_0x2c8471[_0x5a9b88(0x154)]['length']>0x0))return;const _0x35aa2c=_0x2c8471[_0x5a9b88(0x14f)][_0x5a9b88(0x167)]>0x0?_0x2c8471[_0x5a9b88(0x14f)][_0x5a9b88(0x15d)](';\x20'):_0x5a9b88(0x148),_0x26319f=_0x38ffbc===_0x5a9b88(0x15a)?_0x5a9b88(0x140):'Personal';throw CliErrors[_0x5a9b88(0x166)](_0x26319f+'\x20Skill\x20push\x20validation\x20failed\x20for\x20'+_0x3e80e5+'.',_0x35aa2c);}export function throwIfUnconfirmedPublishWarnings(_0x534083,_0x82bc6d,_0x4318fb,_0x4af2dd){const _0x3659ce=a51_0x4347;if(_0x4318fb['length']===0x0||_0x4af2dd)return;const _0x3e4853=_0x534083===_0x3659ce(0x15a)?'Company':'Personal';throw CliErrors[_0x3659ce(0x166)](_0x3e4853+_0x3659ce(0x164)+_0x82bc6d+'.',[_0x3659ce(0x163),_0x3659ce(0x152),_0x3659ce(0x15b),_0x3659ce(0x14c)+_0x4318fb[_0x3659ce(0x15d)](';\x20')][_0x3659ce(0x15d)]('\x20'));}function a51_0xd2f6(){const _0x4c05b1=['company','Fix\x20real\x20issues.\x20If\x20the\x20remaining\x20warnings\x20are\x20reviewed\x20false\x20positives,\x20rerun\x20with\x20--confirm-warnings\x20to\x20submit\x20the\x20unchanged\x20package.','2562252UPRClY','join','skillCode','\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20','skill\x20push\x20supports\x20--scope\x20personal\x20or\x20--scope\x20company;\x20received\x20\x22','848VcPDsL','not-applicable','Review\x20each\x20warning\x20before\x20continuing.','\x20Skill\x20push\x20validation\x20reported\x20warning(s)\x20for\x20','downloadRuntimeSkillPackage','validation','length','builtin','Builtin\x20Skill\x20','str','(unknown)','81560kPlqoh','files','\x20after\x20successful\x20push.','Local\x20Skill\x20metadata\x20appCode\x20','28tDHteb','Company','publishInput','valid','remote','appCode','\x20cannot\x20be\x20pushed.','warning','identical','SkillHub\x20validation\x20returned\x20invalid.','10812210XBqFiq','6509360wHShXe','7mtLhgh','Warnings:\x20','personal','38990jJTQkY','errors','different','content','Do\x20not\x20modify\x20the\x20source\x20Skill\x20merely\x20to\x20satisfy\x20publishing.','scope','warnings','Use\x20a\x20different\x20skillCode\x20when\x20submitting\x20a\x20personal\x20or\x20company\x20Skill.','Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.','22YwUbBM','87039BDlpGA','2975928ePNeny'];a51_0xd2f6=function(){return _0x4c05b1;};return a51_0xd2f6();}export function buildRetargetWarning(_0x43c8e6,_0x359b0f){const _0xe07d24=a51_0x4347;if(!_0x43c8e6?.[_0xe07d24(0x144)]||_0x43c8e6[_0xe07d24(0x144)]===_0x359b0f)return[];return[{'level':_0xe07d24(0x146),'ruleId':'skill-metadata-appcode-retargeted','file':'lovrabet.skill.json','message':_0xe07d24(0x13e)+_0x43c8e6['appCode']+_0xe07d24(0x15f)+_0x359b0f+_0xe07d24(0x13d),'suggestion':_0xe07d24(0x156)}];}export async function runRemoteContentPreflight(_0x469d9f){const _0x2962db=a51_0x4347;if(!_0x469d9f[_0x2962db(0x143)]||_0x469d9f[_0x2962db(0x143)][_0x2962db(0x153)]!==_0x469d9f['scope']||!_0x469d9f[_0x2962db(0x141)][_0x2962db(0x13c)])return{'status':_0x2962db(0x162)};const _0x1077be=_0x469d9f[_0x2962db(0x143)][_0x2962db(0x15e)]||_0x469d9f[_0x2962db(0x15e)];if(!_0x1077be)return{'status':_0x2962db(0x162)};const _0x3f7ab7=await _0x469d9f[_0x2962db(0x165)](_0x469d9f[_0x2962db(0x153)],_0x1077be,_0x469d9f[_0x2962db(0x144)],_0x469d9f[_0x2962db(0x143)]['version']);try{_0x469d9f['verifyRuntimeSkillBundle'](_0x469d9f[_0x2962db(0x141)][_0x2962db(0x13c)],_0x3f7ab7);}catch{return{'status':_0x2962db(0x150)};}return{'status':_0x2962db(0x147),'savedSkill':{..._0x469d9f[_0x2962db(0x143)],'content':_0x469d9f[_0x2962db(0x141)][_0x2962db(0x151)],'files':_0x469d9f['publishInput'][_0x2962db(0x13c)]}};}
1
+ (function(_0x3e8477,_0x146fbd){const _0x2b9bf6=a52_0x13ab,_0x52633b=_0x3e8477();while(!![]){try{const _0x11cb05=-parseInt(_0x2b9bf6(0x121))/0x1+-parseInt(_0x2b9bf6(0x142))/0x2*(-parseInt(_0x2b9bf6(0x141))/0x3)+-parseInt(_0x2b9bf6(0x139))/0x4*(-parseInt(_0x2b9bf6(0x12b))/0x5)+-parseInt(_0x2b9bf6(0x147))/0x6*(-parseInt(_0x2b9bf6(0x13b))/0x7)+parseInt(_0x2b9bf6(0x146))/0x8+-parseInt(_0x2b9bf6(0x125))/0x9+-parseInt(_0x2b9bf6(0x149))/0xa*(parseInt(_0x2b9bf6(0x138))/0xb);if(_0x11cb05===_0x146fbd)break;else _0x52633b['push'](_0x52633b['shift']());}catch(_0x535b5e){_0x52633b['push'](_0x52633b['shift']());}}}(a52_0x2ebd,0x45f85));import{CliErrors}from'../../errors.js';function a52_0x13ab(_0x4f27d1,_0xf03be0){_0x4f27d1=_0x4f27d1-0x11c;const _0x2ebd85=a52_0x2ebd();let _0x13aba2=_0x2ebd85[_0x4f27d1];return _0x13aba2;}export function resolvePushScope(_0x3aaaa1){const _0x1444ec=a52_0x13ab,_0x1ebf9d=_0x3aaaa1[_0x1444ec(0x11c)](_0x1444ec(0x12e))||_0x1444ec(0x12c);if(_0x1ebf9d===_0x1444ec(0x12c)||_0x1ebf9d===_0x1444ec(0x129))return _0x1ebf9d;throw CliErrors[_0x1444ec(0x14a)]('skill\x20push\x20supports\x20--scope\x20personal\x20or\x20--scope\x20company;\x20received\x20\x22'+_0x1ebf9d+'\x22.');}export function allowRetargetArgs(_0x59e401){return _0x59e401?[{'allowAppCodeRetarget':!![]}]:[];}export function remoteFirstMetadataOptions(){return{'ignoreInvalidMetadata':!![],'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataSkillCode':!![]};}export function remoteMissingPayloadOptions(){return{'ignoreMetadataForPayload':!![],'ignoreMetadataScope':!![],'ignoreMetadataSkillCode':!![]};}function a52_0x2ebd(){const _0x29819f=['262054XJJXoV','remote','SkillHub\x20validation\x20returned\x20invalid.','content','2096280zdKNHL','Do\x20not\x20modify\x20the\x20source\x20Skill\x20merely\x20to\x20satisfy\x20publishing.','(unknown)','publishInput','company','Local\x20Skill\x20metadata\x20appCode\x20','5OhznDc','personal','appCode','scope','join','not-applicable','\x20Skill\x20push\x20validation\x20failed\x20for\x20','valid','Use\x20a\x20different\x20skillCode\x20when\x20submitting\x20a\x20personal\x20or\x20company\x20Skill.','Builtin\x20Skill\x20','warning','warnings','length','55bXgTRU','430288AYSlRa','Fix\x20real\x20issues.\x20If\x20the\x20remaining\x20warnings\x20are\x20reviewed\x20false\x20positives,\x20rerun\x20with\x20--confirm-warnings\x20to\x20submit\x20the\x20unchanged\x20package.','4006247XqEBiN','Personal','\x20after\x20successful\x20push.','verifyRuntimeSkillBundle','Warnings:\x20','\x20cannot\x20be\x20pushed.','3OvKdMM','484390PMAaFc','identical','downloadRuntimeSkillPackage','Company','2710624YvkaBi','6rXYJVw','different','958690yZkOAj','validation','errors','str','version','lovrabet.skill.json','skillCode','files'];a52_0x2ebd=function(){return _0x29819f;};return a52_0x2ebd();}export function remoteMissingCompanyReadOptions(){const _0x5e08ee=a52_0x13ab;return{'targetScope':_0x5e08ee(0x129),...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions()};}export function remoteMissingPersonalReadOptions(_0x24372c={}){return{...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions(),..._0x24372c};}export function remotePersonalReadOptions(_0x212c30,_0x56ff84={}){return{'ignoreInvalidMetadata':!![],..._0x212c30?{'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataScope':!![]}:{},..._0x56ff84};}export function throwIfBuiltinPushTarget(_0x4fb16d){const _0x43d315=a52_0x13ab;if(_0x4fb16d?.[_0x43d315(0x12e)]!=='builtin')return;throw CliErrors[_0x43d315(0x14a)](_0x43d315(0x134)+(_0x4fb16d['skillCode']??_0x43d315(0x127))+_0x43d315(0x140),_0x43d315(0x133));}export function throwIfPublishValidationFailed(_0x292057,_0x2df303,_0x543d2d){const _0x2551fe=a52_0x13ab;if(_0x543d2d[_0x2551fe(0x14b)][_0x2551fe(0x137)]===0x0&&(_0x543d2d[_0x2551fe(0x132)]||_0x543d2d[_0x2551fe(0x136)][_0x2551fe(0x137)]>0x0))return;const _0x2d31ec=_0x543d2d[_0x2551fe(0x14b)][_0x2551fe(0x137)]>0x0?_0x543d2d[_0x2551fe(0x14b)][_0x2551fe(0x12f)](';\x20'):_0x2551fe(0x123),_0x35dbbb=_0x292057===_0x2551fe(0x129)?'Company':_0x2551fe(0x13c);throw CliErrors[_0x2551fe(0x14a)](_0x35dbbb+_0x2551fe(0x131)+_0x2df303+'.',_0x2d31ec);}export function throwIfUnconfirmedPublishWarnings(_0x17d2c0,_0x52f7ea,_0x520df1,_0x539109){const _0x179a37=a52_0x13ab;if(_0x520df1['length']===0x0||_0x539109)return;const _0x3c9122=_0x17d2c0==='company'?_0x179a37(0x145):'Personal';throw CliErrors['validation'](_0x3c9122+'\x20Skill\x20push\x20validation\x20reported\x20warning(s)\x20for\x20'+_0x52f7ea+'.',['Review\x20each\x20warning\x20before\x20continuing.',_0x179a37(0x126),_0x179a37(0x13a),_0x179a37(0x13f)+_0x520df1['join'](';\x20')][_0x179a37(0x12f)]('\x20'));}export function buildRetargetWarning(_0x1c47a6,_0xc4d5f9){const _0x106738=a52_0x13ab;if(!_0x1c47a6?.[_0x106738(0x12d)]||_0x1c47a6[_0x106738(0x12d)]===_0xc4d5f9)return[];return[{'level':_0x106738(0x135),'ruleId':'skill-metadata-appcode-retargeted','file':_0x106738(0x11e),'message':_0x106738(0x12a)+_0x1c47a6['appCode']+'\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20'+_0xc4d5f9+_0x106738(0x13d),'suggestion':'Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.'}];}export async function runRemoteContentPreflight(_0x5c5a46){const _0x5ea9ef=a52_0x13ab;if(!_0x5c5a46['remote']||_0x5c5a46[_0x5ea9ef(0x122)][_0x5ea9ef(0x12e)]!==_0x5c5a46[_0x5ea9ef(0x12e)]||!_0x5c5a46[_0x5ea9ef(0x128)][_0x5ea9ef(0x120)])return{'status':_0x5ea9ef(0x130)};const _0x379a56=_0x5c5a46[_0x5ea9ef(0x122)][_0x5ea9ef(0x11f)]||_0x5c5a46[_0x5ea9ef(0x11f)];if(!_0x379a56)return{'status':'not-applicable'};const _0xbf37dc=await _0x5c5a46[_0x5ea9ef(0x144)](_0x5c5a46[_0x5ea9ef(0x12e)],_0x379a56,_0x5c5a46[_0x5ea9ef(0x12d)],_0x5c5a46[_0x5ea9ef(0x122)][_0x5ea9ef(0x11d)]);try{_0x5c5a46[_0x5ea9ef(0x13e)](_0x5c5a46[_0x5ea9ef(0x128)][_0x5ea9ef(0x120)],_0xbf37dc);}catch{return{'status':_0x5ea9ef(0x148)};}return{'status':_0x5ea9ef(0x143),'savedSkill':{..._0x5c5a46[_0x5ea9ef(0x122)],'content':_0x5c5a46[_0x5ea9ef(0x128)][_0x5ea9ef(0x124)],'files':_0x5c5a46[_0x5ea9ef(0x128)]['files']}};}
@@ -0,0 +1,9 @@
1
+ import type { RuntimeSkillItem, RuntimeSkillUpsertInput } from "../../core/api-client.js";
2
+ import type { RuntimeSkillMetadata } from "../../skills/runtime-skill-sync.js";
3
+ import type { SkillValidationIssue } from "./validate.js";
4
+ /** Keeps target-app remote metadata as the baseline when explicit appCode retarget updates an existing Skill. */
5
+ export declare function withRetargetExistingMetadata(input: RuntimeSkillUpsertInput, existing: RuntimeSkillItem, options?: {
6
+ preferInputSkillName?: boolean;
7
+ }): RuntimeSkillUpsertInput;
8
+ /** Builds the user-facing warning emitted after an explicit appCode retarget succeeds. */
9
+ export declare function buildRetargetWarning(metadata: RuntimeSkillMetadata | undefined, targetAppCode: string): SkillValidationIssue[];
@@ -1 +1 @@
1
- (function(_0x4a2405,_0x5a382b){const _0xe8cba=a52_0x38d5,_0x4e825a=_0x4a2405();while(!![]){try{const _0x514897=parseInt(_0xe8cba(0x97))/0x1*(parseInt(_0xe8cba(0x9b))/0x2)+-parseInt(_0xe8cba(0x8e))/0x3*(-parseInt(_0xe8cba(0x98))/0x4)+parseInt(_0xe8cba(0x96))/0x5*(-parseInt(_0xe8cba(0x99))/0x6)+-parseInt(_0xe8cba(0x9e))/0x7*(-parseInt(_0xe8cba(0x9f))/0x8)+parseInt(_0xe8cba(0x92))/0x9+parseInt(_0xe8cba(0xa1))/0xa+-parseInt(_0xe8cba(0x9d))/0xb*(parseInt(_0xe8cba(0xa3))/0xc);if(_0x514897===_0x5a382b)break;else _0x4e825a['push'](_0x4e825a['shift']());}catch(_0x457973){_0x4e825a['push'](_0x4e825a['shift']());}}}(a52_0x1b97,0xc161c));export function withRetargetExistingMetadata(_0x4af638,_0x4e3083,_0x508cdc={}){const _0x3f7b41=a52_0x38d5,_0x1ed76b=_0x508cdc[_0x3f7b41(0xa4)]?_0x4af638[_0x3f7b41(0x93)]??_0x4e3083['skillName']:_0x4e3083[_0x3f7b41(0x93)]??_0x4af638[_0x3f7b41(0x93)];return{..._0x4af638,'skillName':_0x1ed76b,'description':_0x4e3083[_0x3f7b41(0x9a)]??_0x4af638[_0x3f7b41(0x9a)],'tags':Array[_0x3f7b41(0x8d)](_0x4e3083[_0x3f7b41(0xa0)])?_0x4e3083['tags']:_0x4af638['tags'],'version':_0x4e3083[_0x3f7b41(0x94)]??_0x4af638[_0x3f7b41(0x94)],'sourceSessionId':_0x4e3083[_0x3f7b41(0x8f)]??_0x4af638[_0x3f7b41(0x8f)]};}function a52_0x38d5(_0x37e9d9,_0x216b4b){_0x37e9d9=_0x37e9d9-0x8c;const _0x1b9745=a52_0x1b97();let _0x38d50a=_0x1b9745[_0x37e9d9];return _0x38d50a;}function a52_0x1b97(){const _0x339cab=['1345npKRIa','169583HqzzcD','12lReFCC','24834pUeAjh','description','2iDyFgj','appCode','17402YjbxFF','119IAKHFM','344920CzpfEQ','tags','8107740zVXIvv','skill-metadata-appcode-retargeted','14004tvCvUM','preferInputSkillName','Local\x20Skill\x20metadata\x20appCode\x20','isArray','1274826roFPlG','sourceSessionId','\x20after\x20successful\x20push.','\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20','6871851hdTgkC','skillName','version','Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.'];a52_0x1b97=function(){return _0x339cab;};return a52_0x1b97();}export function buildRetargetWarning(_0x425fb6,_0x2e3185){const _0x50782b=a52_0x38d5;if(!_0x425fb6?.[_0x50782b(0x9c)]||_0x425fb6[_0x50782b(0x9c)]===_0x2e3185)return[];return[{'level':'warning','ruleId':_0x50782b(0xa2),'file':'lovrabet.skill.json','message':_0x50782b(0x8c)+_0x425fb6[_0x50782b(0x9c)]+_0x50782b(0x91)+_0x2e3185+_0x50782b(0x90),'suggestion':_0x50782b(0x95)}];}
1
+ (function(_0x2c0364,_0x2ae567){const _0xdb552a=a53_0x59b4,_0x3e01c5=_0x2c0364();while(!![]){try{const _0x270bc2=parseInt(_0xdb552a(0x13e))/0x1+-parseInt(_0xdb552a(0x12c))/0x2*(parseInt(_0xdb552a(0x12a))/0x3)+-parseInt(_0xdb552a(0x137))/0x4+-parseInt(_0xdb552a(0x128))/0x5*(parseInt(_0xdb552a(0x133))/0x6)+parseInt(_0xdb552a(0x129))/0x7+-parseInt(_0xdb552a(0x130))/0x8*(-parseInt(_0xdb552a(0x134))/0x9)+parseInt(_0xdb552a(0x13b))/0xa*(parseInt(_0xdb552a(0x13c))/0xb);if(_0x270bc2===_0x2ae567)break;else _0x3e01c5['push'](_0x3e01c5['shift']());}catch(_0x2e8d85){_0x3e01c5['push'](_0x3e01c5['shift']());}}}(a53_0x43cb,0xd15d1));function a53_0x59b4(_0x2924f0,_0x1da412){_0x2924f0=_0x2924f0-0x127;const _0x43cba9=a53_0x43cb();let _0x59b4cb=_0x43cba9[_0x2924f0];return _0x59b4cb;}export function withRetargetExistingMetadata(_0x3ac61f,_0x7c03b3,_0x51336f={}){const _0x24e2d6=a53_0x59b4,_0x24368f=_0x51336f['preferInputSkillName']?_0x3ac61f[_0x24e2d6(0x12d)]??_0x7c03b3[_0x24e2d6(0x12d)]:_0x7c03b3['skillName']??_0x3ac61f['skillName'];return{..._0x3ac61f,'skillName':_0x24368f,'description':_0x7c03b3[_0x24e2d6(0x12f)]??_0x3ac61f[_0x24e2d6(0x12f)],'tags':Array[_0x24e2d6(0x12b)](_0x7c03b3['tags'])?_0x7c03b3[_0x24e2d6(0x127)]:_0x3ac61f['tags'],'version':_0x7c03b3[_0x24e2d6(0x131)]??_0x3ac61f[_0x24e2d6(0x131)],'sourceSessionId':_0x7c03b3[_0x24e2d6(0x135)]??_0x3ac61f[_0x24e2d6(0x135)]};}export function buildRetargetWarning(_0x11388f,_0x2abb8e){const _0x3c7460=a53_0x59b4;if(!_0x11388f?.[_0x3c7460(0x139)]||_0x11388f[_0x3c7460(0x139)]===_0x2abb8e)return[];return[{'level':_0x3c7460(0x13a),'ruleId':_0x3c7460(0x132),'file':_0x3c7460(0x138),'message':_0x3c7460(0x136)+_0x11388f[_0x3c7460(0x139)]+_0x3c7460(0x12e)+_0x2abb8e+_0x3c7460(0x13d),'suggestion':_0x3c7460(0x13f)}];}function a53_0x43cb(){const _0x3c67d9=['3MmaxrB','isArray','3132938RbxPFU','skillName','\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20','description','136myuUKd','version','skill-metadata-appcode-retargeted','12zMotgu','707013HlEeiO','sourceSessionId','Local\x20Skill\x20metadata\x20appCode\x20','5800004yjpJxD','lovrabet.skill.json','appCode','warning','346900lPomIy','638JoTuiM','\x20after\x20successful\x20push.','812489BgxLKk','Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.','tags','3956945nZxcFv','9077761lwiava'];a53_0x43cb=function(){return _0x3c67d9;};return a53_0x43cb();}
@@ -0,0 +1,13 @@
1
+ import type { RuntimeSkillScope } from "../../skills/runtime-skill-sync.js";
2
+ export type SyncRuntimeScope = Extract<RuntimeSkillScope, "personal" | "company">;
3
+ export type SkillListScope = "all" | "personal" | "company";
4
+ /** Normalizes the install scope flag into the runtime scopes to sync. */
5
+ export declare function normalizeSyncScopes(value: string): SyncRuntimeScope[];
6
+ /** Normalizes the list scope flag into a supported list scope. */
7
+ export declare function normalizeListScope(value: string): SkillListScope;
8
+ /** Checks whether a list response should include one target scope. */
9
+ export declare function shouldListScope(scope: SkillListScope, target: "personal" | "company"): boolean;
10
+ /** Converts a local list scope into runtime Skill cache scopes. */
11
+ export declare function listScopeToRuntimeScopes(scope: SkillListScope): RuntimeSkillScope[];
12
+ /** Converts the list scope into the API scope parameter. */
13
+ export declare function listScopeToRemoteScope(scope: SkillListScope): "personal" | "company" | "all";
@@ -1 +1 @@
1
- function a53_0x2f64(_0x20ab4f,_0x98ac61){_0x20ab4f=_0x20ab4f-0x14c;const _0x21110d=a53_0x2111();let _0x2f6417=_0x21110d[_0x20ab4f];return _0x2f6417;}(function(_0x44eeff,_0x986417){const _0x516536=a53_0x2f64,_0x17a85f=_0x44eeff();while(!![]){try{const _0x40b7b5=-parseInt(_0x516536(0x158))/0x1*(parseInt(_0x516536(0x15c))/0x2)+parseInt(_0x516536(0x157))/0x3*(parseInt(_0x516536(0x14c))/0x4)+-parseInt(_0x516536(0x15e))/0x5*(parseInt(_0x516536(0x156))/0x6)+parseInt(_0x516536(0x15b))/0x7*(parseInt(_0x516536(0x15a))/0x8)+parseInt(_0x516536(0x151))/0x9+parseInt(_0x516536(0x14d))/0xa+parseInt(_0x516536(0x152))/0xb*(-parseInt(_0x516536(0x155))/0xc);if(_0x40b7b5===_0x986417)break;else _0x17a85f['push'](_0x17a85f['shift']());}catch(_0x4f01f9){_0x17a85f['push'](_0x17a85f['shift']());}}}(a53_0x2111,0xdfa2c));import{CliErrors}from'../../errors.js';export function normalizeSyncScopes(_0x1164fa){const _0x50c68a=a53_0x2f64,_0x549bc7=_0x1164fa[_0x50c68a(0x153)]();if(!_0x549bc7||_0x549bc7===_0x50c68a(0x15d))return[_0x50c68a(0x150),'company'];if(_0x549bc7===_0x50c68a(0x150)||_0x549bc7===_0x50c68a(0x14f))return[_0x549bc7];throw CliErrors[_0x50c68a(0x159)](_0x50c68a(0x154)+_0x1164fa);}export function normalizeListScope(_0x2a5b95){const _0x2b9b68=a53_0x2f64,_0x30fd5c=_0x2a5b95[_0x2b9b68(0x153)]();if(!_0x30fd5c)return'all';if(_0x30fd5c==='personal'||_0x30fd5c===_0x2b9b68(0x14f)||_0x30fd5c===_0x2b9b68(0x15d))return _0x30fd5c;throw CliErrors[_0x2b9b68(0x159)](_0x2b9b68(0x14e)+_0x2a5b95);}export function shouldListScope(_0x592af0,_0x43c1e3){const _0x113773=a53_0x2f64;if(_0x592af0===_0x113773(0x15d))return!![];return _0x592af0===_0x43c1e3;}export function listScopeToRuntimeScopes(_0x8981f4){const _0x2f023b=a53_0x2f64;if(_0x8981f4===_0x2f023b(0x15d))return[_0x2f023b(0x150),_0x2f023b(0x14f)];return[_0x8981f4===_0x2f023b(0x14f)?'company':_0x8981f4];}function a53_0x2111(){const _0x3112ae=['Unsupported\x20Skill\x20list\x20scope:\x20','company','personal','2325276IuvgMD','10302897aHHXrS','trim','Unsupported\x20Skill\x20sync\x20scope:\x20','24gxwcOa','6081618BcyLfG','165327BSXLgf','158342dafPur','validation','424rAodeM','225729ZDBNfy','6KTErad','all','5JcLnDp','96mgxtSi','9878240WxDGHo'];a53_0x2111=function(){return _0x3112ae;};return a53_0x2111();}export function listScopeToRemoteScope(_0x395fa0){return _0x395fa0;}
1
+ (function(_0x3f0479,_0x3ddbc2){const _0x138d55=a54_0x4431,_0x3be69a=_0x3f0479();while(!![]){try{const _0x232d7c=-parseInt(_0x138d55(0x156))/0x1+parseInt(_0x138d55(0x161))/0x2+-parseInt(_0x138d55(0x15d))/0x3*(-parseInt(_0x138d55(0x163))/0x4)+-parseInt(_0x138d55(0x162))/0x5*(-parseInt(_0x138d55(0x155))/0x6)+-parseInt(_0x138d55(0x15a))/0x7+-parseInt(_0x138d55(0x15e))/0x8*(-parseInt(_0x138d55(0x153))/0x9)+parseInt(_0x138d55(0x15b))/0xa*(-parseInt(_0x138d55(0x15c))/0xb);if(_0x232d7c===_0x3ddbc2)break;else _0x3be69a['push'](_0x3be69a['shift']());}catch(_0x2b7fb4){_0x3be69a['push'](_0x3be69a['shift']());}}}(a54_0x4701,0xa44a8));import{CliErrors}from'../../errors.js';export function normalizeSyncScopes(_0x428f46){const _0x449005=a54_0x4431,_0x185e5c=_0x428f46[_0x449005(0x157)]();if(!_0x185e5c||_0x185e5c===_0x449005(0x164))return[_0x449005(0x160),_0x449005(0x15f)];if(_0x185e5c===_0x449005(0x160)||_0x185e5c==='company')return[_0x185e5c];throw CliErrors[_0x449005(0x154)](_0x449005(0x158)+_0x428f46);}export function normalizeListScope(_0x926e04){const _0x2aa0eb=a54_0x4431,_0x11cd5b=_0x926e04[_0x2aa0eb(0x157)]();if(!_0x11cd5b)return _0x2aa0eb(0x164);if(_0x11cd5b===_0x2aa0eb(0x160)||_0x11cd5b===_0x2aa0eb(0x15f)||_0x11cd5b==='all')return _0x11cd5b;throw CliErrors['validation'](_0x2aa0eb(0x159)+_0x926e04);}function a54_0x4431(_0x20aa67,_0x1dc338){_0x20aa67=_0x20aa67-0x153;const _0x47010d=a54_0x4701();let _0x44311e=_0x47010d[_0x20aa67];return _0x44311e;}export function shouldListScope(_0x4e75c4,_0x2d35b6){const _0x488e9f=a54_0x4431;if(_0x4e75c4===_0x488e9f(0x164))return!![];return _0x4e75c4===_0x2d35b6;}export function listScopeToRuntimeScopes(_0x5474f1){const _0x1f13f2=a54_0x4431;if(_0x5474f1===_0x1f13f2(0x164))return[_0x1f13f2(0x160),_0x1f13f2(0x15f)];return[_0x5474f1===_0x1f13f2(0x15f)?'company':_0x5474f1];}export function listScopeToRemoteScope(_0xa593bb){return _0xa593bb;}function a54_0x4701(){const _0x4f54ac=['1817538OARmrJ','1332601zDtqsQ','trim','Unsupported\x20Skill\x20sync\x20scope:\x20','Unsupported\x20Skill\x20list\x20scope:\x20','5016221fsBeJO','410jjKQhF','291797xBswZK','644439feFgqa','8sbclFG','company','personal','2610730LuzOov','15STXnjr','16puomfe','all','6627249jQJNcd','validation'];a54_0x4701=function(){return _0x4f54ac;};return a54_0x4701();}
@@ -0,0 +1,6 @@
1
+ import type { RuntimeSkillItem } from "../../core/api-client.js";
2
+ import type { LocalRuntimeSkillItem } from "../../skills/runtime-skill-sync.js";
3
+ /** Converts a remote runtime Skill item into command output shape. */
4
+ export declare function summarizeRuntimeSkill(item: RuntimeSkillItem): Record<string, unknown>;
5
+ /** Converts a locally managed runtime Skill item into command output shape. */
6
+ export declare function summarizeLocalRuntimeSkill(item: LocalRuntimeSkillItem): Record<string, unknown>;
@@ -1 +1 @@
1
- function a54_0x6b8b(_0x53be80,_0x46556c){_0x53be80=_0x53be80-0x1b8;var _0x5efc44=a54_0x5efc();var _0x6b8b7c=_0x5efc44[_0x53be80];return _0x6b8b7c;}(function(_0x46a7f6,_0x301ec7){var _0x524e29=a54_0x6b8b,_0x252d2a=_0x46a7f6();while(!![]){try{var _0x58f8e4=parseInt(_0x524e29(0x1b9))/0x1*(-parseInt(_0x524e29(0x1cb))/0x2)+parseInt(_0x524e29(0x1ce))/0x3*(-parseInt(_0x524e29(0x1c3))/0x4)+parseInt(_0x524e29(0x1cd))/0x5+parseInt(_0x524e29(0x1bf))/0x6*(-parseInt(_0x524e29(0x1bb))/0x7)+parseInt(_0x524e29(0x1cc))/0x8*(-parseInt(_0x524e29(0x1c0))/0x9)+-parseInt(_0x524e29(0x1cf))/0xa*(parseInt(_0x524e29(0x1c6))/0xb)+-parseInt(_0x524e29(0x1bc))/0xc*(-parseInt(_0x524e29(0x1bd))/0xd);if(_0x58f8e4===_0x301ec7)break;else _0x252d2a['push'](_0x252d2a['shift']());}catch(_0x2cb1d6){_0x252d2a['push'](_0x252d2a['shift']());}}}(a54_0x5efc,0x5a353));function a54_0x5efc(){var _0x43c18c=['71487VDvXdB','linkedPaths','skillMdPath','2217572rZlprL','status','readonly','7458VeoWNm','scope','tags','appCode','dir','6LucVLe','592jsVRSX','682910FhyZxv','3VWdqys','180vkRNpU','skillName','157259pzmmid','pulledAt','4894316bWpvba','10233012ltqRnU','39ucxowH','metadataPath','6AhLEEQ'];a54_0x5efc=function(){return _0x43c18c;};return a54_0x5efc();}export function summarizeRuntimeSkill(_0x436c81){var _0x8e5008=a54_0x6b8b;return{'id':_0x436c81['id'],'skillCode':_0x436c81['skillCode'],'skillName':_0x436c81[_0x8e5008(0x1b8)],'scope':_0x436c81[_0x8e5008(0x1c7)],'version':_0x436c81['version'],'readonly':_0x436c81['readonly']};}export function summarizeLocalRuntimeSkill(_0x5f0e13){var _0x516b53=a54_0x6b8b;return{'id':_0x5f0e13['id'],'skillCode':_0x5f0e13['skillCode'],'skillName':_0x5f0e13['skillName'],'scope':_0x5f0e13[_0x516b53(0x1c7)],'appCode':_0x5f0e13[_0x516b53(0x1c9)],'version':_0x5f0e13['version'],'status':_0x5f0e13[_0x516b53(0x1c4)],'readonly':_0x5f0e13[_0x516b53(0x1c5)],'tags':_0x5f0e13[_0x516b53(0x1c8)],'dir':_0x5f0e13[_0x516b53(0x1ca)],'cacheDir':_0x5f0e13['cacheDir'],'skillMdPath':_0x5f0e13[_0x516b53(0x1c2)],'metadataPath':_0x5f0e13[_0x516b53(0x1be)],'linkedPaths':_0x5f0e13[_0x516b53(0x1c1)],'contentHash':_0x5f0e13['contentHash'],'treeHash':_0x5f0e13['treeHash'],'pulledAt':_0x5f0e13[_0x516b53(0x1ba)]};}
1
+ (function(_0x38780b,_0x171c29){var _0x1f9428=a55_0x46c3,_0x26468a=_0x38780b();while(!![]){try{var _0x1b29e1=-parseInt(_0x1f9428(0x1e3))/0x1+parseInt(_0x1f9428(0x1d8))/0x2*(parseInt(_0x1f9428(0x1e4))/0x3)+-parseInt(_0x1f9428(0x1dd))/0x4*(-parseInt(_0x1f9428(0x1d3))/0x5)+parseInt(_0x1f9428(0x1df))/0x6+-parseInt(_0x1f9428(0x1e5))/0x7+-parseInt(_0x1f9428(0x1d6))/0x8+-parseInt(_0x1f9428(0x1da))/0x9;if(_0x1b29e1===_0x171c29)break;else _0x26468a['push'](_0x26468a['shift']());}catch(_0x2614e8){_0x26468a['push'](_0x26468a['shift']());}}}(a55_0x2bc7,0x49439));function a55_0x2bc7(){var _0x1eae74=['366864lduWiV','linkedPaths','1139414UvuNsu','tags','5702472SjCbuM','pulledAt','contentHash','820bFPVQe','skillName','1888278pBMmBy','status','skillMdPath','readonly','23048cBdCtX','3XIQFzJ','2417254lDmWoz','appCode','version','treeHash','11305krhTXi','scope','cacheDir'];a55_0x2bc7=function(){return _0x1eae74;};return a55_0x2bc7();}export function summarizeRuntimeSkill(_0x4ab94a){var _0x173975=a55_0x46c3;return{'id':_0x4ab94a['id'],'skillCode':_0x4ab94a['skillCode'],'skillName':_0x4ab94a['skillName'],'scope':_0x4ab94a['scope'],'version':_0x4ab94a[_0x173975(0x1d1)],'readonly':_0x4ab94a[_0x173975(0x1e2)]};}function a55_0x46c3(_0x205296,_0x5b3549){_0x205296=_0x205296-0x1d0;var _0x2bc73b=a55_0x2bc7();var _0x46c349=_0x2bc73b[_0x205296];return _0x46c349;}export function summarizeLocalRuntimeSkill(_0x23d08c){var _0x5beba2=a55_0x46c3;return{'id':_0x23d08c['id'],'skillCode':_0x23d08c['skillCode'],'skillName':_0x23d08c[_0x5beba2(0x1de)],'scope':_0x23d08c[_0x5beba2(0x1d4)],'appCode':_0x23d08c[_0x5beba2(0x1d0)],'version':_0x23d08c[_0x5beba2(0x1d1)],'status':_0x23d08c[_0x5beba2(0x1e0)],'readonly':_0x23d08c[_0x5beba2(0x1e2)],'tags':_0x23d08c[_0x5beba2(0x1d9)],'dir':_0x23d08c['dir'],'cacheDir':_0x23d08c[_0x5beba2(0x1d5)],'skillMdPath':_0x23d08c[_0x5beba2(0x1e1)],'metadataPath':_0x23d08c['metadataPath'],'linkedPaths':_0x23d08c[_0x5beba2(0x1d7)],'contentHash':_0x23d08c[_0x5beba2(0x1dc)],'treeHash':_0x23d08c[_0x5beba2(0x1d2)],'pulledAt':_0x23d08c[_0x5beba2(0x1db)]};}
@@ -0,0 +1,23 @@
1
+ export declare const SKILL_TYPES: readonly ["write", "read"];
2
+ export type SkillTemplateType = typeof SKILL_TYPES[number];
3
+ export interface RenderSkillTemplateOptions {
4
+ skillName: string;
5
+ type: string;
6
+ timestamp?: string;
7
+ }
8
+ export interface RenderedSkillFile {
9
+ path: string;
10
+ content: string;
11
+ }
12
+ export interface RenderedSkillTemplate {
13
+ skillName: string;
14
+ type: SkillTemplateType;
15
+ files: RenderedSkillFile[];
16
+ }
17
+ export declare const DEFAULT_SKILL_TARGET = ".agents/skills";
18
+ export declare const SKILL_NAME_PATTERN: RegExp;
19
+ export declare const RUNTIME_CONTRACT_FILE = "references/runtime-contract.md";
20
+ export declare const OUTPUT_CONTRACT_FILE = "references/output-contract.md";
21
+ export declare function validateSkillName(name: string): string;
22
+ export declare function normalizeSkillTemplateType(type: string | undefined): SkillTemplateType;
23
+ export declare function renderSkillTemplate(options: RenderSkillTemplateOptions): RenderedSkillTemplate;
@@ -1 +1 @@
1
- const a55_0x1a166f=a55_0x13c4;(function(_0x1e4e5b,_0x16319d){const _0x58c081=a55_0x13c4,_0x15d15e=_0x1e4e5b();while(!![]){try{const _0x930800=parseInt(_0x58c081(0x16d))/0x1+-parseInt(_0x58c081(0x186))/0x2+parseInt(_0x58c081(0x17e))/0x3*(-parseInt(_0x58c081(0x185))/0x4)+parseInt(_0x58c081(0x179))/0x5+parseInt(_0x58c081(0x172))/0x6+parseInt(_0x58c081(0x187))/0x7*(parseInt(_0x58c081(0x18e))/0x8)+parseInt(_0x58c081(0x175))/0x9*(parseInt(_0x58c081(0x16b))/0xa);if(_0x930800===_0x16319d)break;else _0x15d15e['push'](_0x15d15e['shift']());}catch(_0x566363){_0x15d15e['push'](_0x15d15e['shift']());}}}(a55_0x312f,0x88fc1));import{CliErrors}from'../../errors.js';function a55_0x13c4(_0x1826a7,_0x4e2cfd){_0x1826a7=_0x1826a7-0x16b;const _0x312f51=a55_0x312f();let _0x13c43e=_0x312f51[_0x1826a7];return _0x13c43e;}export const SKILL_TYPES=[a55_0x1a166f(0x18b),a55_0x1a166f(0x16c),a55_0x1a166f(0x171)];export const DEFAULT_SKILL_TARGET=a55_0x1a166f(0x181);export const SKILL_NAME_PATTERN=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;export const RUNTIME_CONTRACT_FILE='references/runtime-contract.md';export const OUTPUT_CONTRACT_FILE=a55_0x1a166f(0x18d);export function validateSkillName(_0x54fc1b){const _0x4d9506=a55_0x1a166f,_0x3f6a78=_0x54fc1b[_0x4d9506(0x17d)]();if(!SKILL_NAME_PATTERN[_0x4d9506(0x192)](_0x3f6a78))throw CliErrors[_0x4d9506(0x174)](_0x4d9506(0x18f)+_0x54fc1b+_0x4d9506(0x17a),'Use\x20lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens,\x20for\x20example\x20invoice-export.');return _0x3f6a78;}export function normalizeSkillTemplateType(_0x3502f5){const _0x3dcd8a=a55_0x1a166f,_0x56e474=(_0x3502f5||_0x3dcd8a(0x18b))[_0x3dcd8a(0x17d)]()||_0x3dcd8a(0x18b);if(SKILL_TYPES[_0x3dcd8a(0x193)](_0x56e474))return _0x56e474;throw CliErrors['validation']('Unsupported\x20Skill\x20type:\x20'+_0x3502f5,_0x3dcd8a(0x188)+SKILL_TYPES[_0x3dcd8a(0x18a)](',\x20')+'.');}export function renderSkillTemplate(_0x8620d2){const _0x4b62ee=a55_0x1a166f,_0x150f76=validateSkillName(_0x8620d2[_0x4b62ee(0x178)]),_0x5c0a1b=normalizeSkillTemplateType(_0x8620d2[_0x4b62ee(0x18c)]),_0x146095=_0x8620d2[_0x4b62ee(0x176)]??new Date()[_0x4b62ee(0x16f)]();return{'skillName':_0x150f76,'type':_0x5c0a1b,'files':[{'path':_0x4b62ee(0x190),'content':renderSkillMd(_0x150f76,_0x5c0a1b,_0x146095)},{'path':RUNTIME_CONTRACT_FILE,'content':renderRuntimeContract(_0x150f76,_0x5c0a1b)},{'path':OUTPUT_CONTRACT_FILE,'content':renderOutputContract(_0x150f76,_0x5c0a1b)}]};}function renderSkillMd(_0x9ff651,_0x21ffd2,_0x5e382f){const _0x213040=a55_0x1a166f,_0x2f9c81=typeWorkflow(_0x21ffd2);return'---\x0aname:\x20'+_0x9ff651+'\x0adescription:\x20\x22【填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词】\x22\x0a#\x20example:\x20\x22<填写一句用户可以直接说出的最简触发话术>\x22\x0ametadata:\x0a\x20\x20type:\x20'+_0x21ffd2+'\x0a\x20\x20created:\x20\x22'+_0x5e382f+'\x22\x0a\x20\x20generator:\x20\x22lovrabet\x20skill\x20create\x22\x0a---\x0a\x0a#\x20'+_0x9ff651+_0x213040(0x183)+_0x2f9c81+'\x0a\x0a'+businessStateSection(_0x21ffd2)+_0x213040(0x189);}function renderRuntimeContract(_0x10ed45,_0xcbee01){const _0x1f6aee=a55_0x1a166f,_0x2ec1d0=_0xcbee01===_0x1f6aee(0x18b)?'##\x20状态读回与未知状态处理\x0a\x0a【填写业务状态事实源、fromStatus\x20->\x20toStatus\x20预览、写入后读回核对方式,以及\x20unknown\x20/\x20needs_manual_check\x20的处理边界】\x0a\x0a':'';return _0x1f6aee(0x16e)+_0x10ed45+'\x20的所有必读规则必须位于\x20SKILL.md\x20或\x20references/\x20内。\x0a\x0a##\x20必读文档\x0a\x0a-\x20[SKILL.md](../SKILL.md)\x0a-\x20[runtime-contract.md](runtime-contract.md)\x0a-\x20[output-contract.md](output-contract.md)\x0a\x0a##\x20主边界\x0a\x0a-\x20不得依赖\x20Skill\x20目录外的仓库文件、绝对路径、file\x20URL\x20或本机专属配置。\x0a-\x20文档中的缓存路径、安装路径、示例路径或排障路径不等于运行时包外依赖;只有明确要求读取、链接或执行包外内容时才属于自包含风险。\x0a-\x20如需承接仓库规范,必须把必要规则内化到本\x20Skill\x20包内的\x20references/\x20文件中。\x0a-\x20type='+_0xcbee01+'\x20只作为模板选择器,不替代业务权限、风险等级和用户确认。\x0a\x0a##\x20运行态入口\x0a\x0a【填写包内说明的运行态入口、可调用脚本或人工执行边界】\x0a\x0a##\x20凭证与登录态\x0a\x0a【填写本\x20Skill\x20依赖的第三方服务凭证和登录态治理方式。强烈建议通过\x20Lovrabet\x20应用后台或平台服务端适配器做平台托管配置;开发先行阶段如存在临时明文凭证,应标注后续治理计划、适用环境和额度边界,并避免进入长期交付内容。】\x0a\x0a##\x20第三方候选资产\x0a\x0a【填写第三方生成类结果的消费边界。生成类结果仅作为候选素材;涉及商品图、客户资料、Excel\x20或业务文件上传时,必须声明授权、额度、审计、失败降级和人工审核/业务\x20BFF\x20校验后的发布边界。】\x0a\x0a##\x20预览\x20/\x20写入\x20/\x20核对差异\x0a\x0a【填写预览、确认、正式执行和只读核对的顺序】\x0a\x0a'+_0x2ec1d0+_0x1f6aee(0x17b);}function a55_0x312f(){const _0xb797b4=['298606nTpcug','#\x20Runtime\x20Contract\x0a\x0aSkill\x20push\x20后的\x20zip\x20包就是完整交付产物。','toISOString','1.\x20只读查询:【填写查询入口、过滤条件和权限边界】\x0a2.\x20业务汇总:【填写统计口径、字段解释和异常提示】\x0a3.\x20查看链接:【填写可供运营人员复核的记录、页面或报告链接】\x0a4.\x20禁止写入:不得创建、更新、删除或触发会改变业务状态的动作。','trainer','159528qyVLgx','#\x20Output\x20Contract\x0a\x0a','validation','543654mnSnYD','timestamp','\x0a\x0a##\x20错误与人工接管\x0a\x0aerrors\x20必须包含失败阶段、错误原因和可复核对象。\x0anextActions\x20必须给出重试、补充输入、人工接管或停止处理的动作。\x0a','skillName','2112820pZXtOy','.\x20Use\x20lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens.','\x0a##\x20返回契约\x0a\x0a最终输出必须遵守\x20[output-contract.md](output-contract.md)。本文件只补充运行态安全约束;展示字段、状态枚举、失败暴露和人工处理项以\x20output-contract.md\x20为准。\x0a\x0a##\x20失败恢复\x0a\x0a【填写失败状态识别、checkpoint、重试和人工接管方式】\x0a\x0a##\x20禁止事项\x0a\x0a-\x20禁止链接或读取\x20Skill\x20目录外的\x20AGENTS.md、wiki、docs、脚本或个人路径作为运行时必读依赖。\x0a-\x20禁止把说明性的缓存路径、安装路径、示例路径或排障路径包装成运行时必读依赖。\x0a-\x20禁止在未确认影响范围时执行写入。\x0a-\x20禁止隐藏失败或把未知状态描述为成功。\x0a','1.\x20受控模板预览:【填写待维护内容、影响范围和预览方式】\x0a2.\x20用户确认:【填写确认信息和不可省略的人工判断点】\x0a3.\x20受控维护:【填写确认后的维护步骤和记录方式】\x0a4.\x20只读核对:【填写维护后的核对入口、差异和回滚/修正方式】','trim','6pmqCSl','write\x20类型在\x20dry_run\x20下只展示预览、影响范围和差异,不写入业务数据。\x0aconfirmed\x20写入后必须执行读回核对,并把核对结果写入\x20verification。\x0a读回异常、业务状态未知或结果不一致时,status\x20必须为\x20partial_success、failed\x20或\x20needs_manual_check。','1.\x20dry-run:【填写预览入口、影响范围和差异摘要;不得写入业务数据】\x0a2.\x20用户确认:【填写确认语义、目标对象、数量、风险和操作者责任】\x0a3.\x20confirmed\x20写入:【填写确认后的写入入口和幂等/防重复要求】\x0a4.\x20只读核对:【填写写入后的查询核对、差异展示和结果链接】\x0a5.\x20checkpoint:【填写失败恢复、重试条件和人工接管方式】','.agents/skills','\x20类型默认不执行业务写入;如流程包含受控维护或人工确认,也必须用\x20mode\x20标明执行阶段并暴露核对结果。','\x0a\x0a##\x20内部要求\x0a\x0a执行前必须读取并遵守\x20[runtime-contract.md](references/runtime-contract.md)\x20和\x20[output-contract.md](references/output-contract.md)。\x0a\x0a##\x20使用边界\x0a\x0a【填写该\x20Skill\x20能做什么、不能做什么、适用业务范围和禁止扩大执行范围】\x0a\x0a##\x20输入门禁\x0a\x0a【填写必须具备的输入;缺失业务对象、执行范围、确认信息或权限上下文时必须停止】\x0a\x0a##\x20与现有能力集成\x0a\x0a【填写本\x20Skill\x20使用的\x20lovrabet\x20data、lovrabet\x20sql、lovrabet\x20bff\x20或\x20lovrabet\x20personal-bff\x20命令,以及包内\x20references/\x20中沉淀的运行态入口、脚本对接方式或人工操作边界。不得依赖\x20Skill\x20目录外文件、绝对路径或本机专属配置。】\x0a\x0a##\x20平台能力优先\x0a\x0a【填写本\x20Skill\x20优先使用的\x20Lovrabet\x20平台命令:lovrabet\x20data\x20/\x20lovrabet\x20sql\x20/\x20lovrabet\x20bff\x20/\x20lovrabet\x20personal-bff。本地脚本仅用于平台明确不覆盖的文件格式转换、静态校验、展示整理或第三方薄适配;不得用本地脚本替代平台命令承载业务写入、权限判断、状态机、审批提交或回滚。】\x0a\x0a##\x20第三方服务边界\x0a\x0a【填写是否调用第三方识别、生成、上传或行业服务;如涉及\x20API\x20Key、OAuth、Cookie、登录态或业务数据上传,必须说明由\x20Lovrabet\x20应用后台、BFF\x20或平台适配器统一配置。目标治理口径是\x20Skill\x20不读取、不分发、不保存明文凭证。详细凭证、额度、审计和审核发布规则写入\x20references/runtime-contract.md。】\x0a\x0a##\x20SOP\x20工作流\x0a\x0a','\x20的最终回复必须让运营人员能判断:是否执行、影响了什么、如何复核、失败后下一步做什么。\x0a\x0a##\x20状态枚举\x0a\x0astatus:\x20success\x20|\x20no_op\x20|\x20partial_success\x20|\x20blocked\x20|\x20failed\x20|\x20needs_manual_check\x0a\x0a-\x20success:动作已完成,且关键结果已核对。\x0a-\x20no_op:没有符合条件的对象或无需变更。\x0a-\x20partial_success:部分对象完成,未完成对象必须进入\x20errors\x20和\x20nextActions。\x0a-\x20blocked:缺少输入、权限、确认或平台能力,无法继续。\x0a-\x20failed:执行失败,必须说明失败阶段、错误和恢复方式。\x0a-\x20needs_manual_check:读回异常、状态未知或人工判断缺失。\x0a\x0aunknown、partial_success、failed、needs_manual_check\x20不能包装为\x20success。\x0a\x0a##\x20输出模式\x0a\x0amode:\x20dry_run\x20|\x20confirmed\x20|\x20read_only\x0a\x0a-\x20dry_run:只展示预览、影响范围和差异,不写入业务数据。\x0a-\x20confirmed:用户明确确认后的执行模式;写入后必须读回核对。\x0a-\x20read_only:只查询、汇总或核对,不触发写入。\x0a\x0a##\x20必填字段\x0a\x0a-\x20status\x0a-\x20mode\x0a-\x20summary\x0a-\x20scope\x0a-\x20changes\x0a-\x20verification\x0a-\x20warnings\x0a-\x20errors\x0a-\x20nextActions\x0a\x0a##\x20写入结果\x0a\x0a','522884XqpVlW','1931476GkLIwa','7JJrdQy','Use\x20one\x20of:\x20','\x0a\x0a##\x20展示规范\x0a\x0a【填写面向运营人员的展示字段、差异摘要、成功/失败状态和人工处理项;最终输出必须按\x20references/output-contract.md\x20的\x20status\x20/\x20mode\x20/\x20summary\x20/\x20errors\x20/\x20nextActions\x20返回,不能把\x20unknown、partial_success、failed\x20或\x20needs_manual_check\x20包装为\x20success。】\x0a\x0a##\x20失败恢复\x0a\x0a【填写失败后的\x20checkpoint、重试条件、人工接管方式和避免重复写入的核对步骤】\x0a','join','write','type','references/output-contract.md','6874344IACmLv','Invalid\x20Skill\x20name:\x20','SKILL.md','##\x20业务状态流转\x0a\x0a【填写本\x20Skill\x20的前置业务状态、允许动作、目标业务状态、fromStatus\x20->\x20toStatus\x20预览、写入后读回核对,以及\x20unknown\x20/\x20needs_manual_check\x20处理。状态迁移合法性必须由业务\x20BFF、Lovrabet\x20平台命令或服务端接口判断,Skill\x20不作为状态事实源。】','test','includes','30wZtgOO','read'];a55_0x312f=function(){return _0xb797b4;};return a55_0x312f();}function renderOutputContract(_0x3f6286,_0x3d9dac){const _0x561be8=a55_0x1a166f,_0xa71191=_0x3d9dac===_0x561be8(0x18b)?_0x561be8(0x17f):_0x3d9dac+_0x561be8(0x182);return _0x561be8(0x173)+_0x3f6286+_0x561be8(0x184)+_0xa71191+_0x561be8(0x177);}function typeWorkflow(_0x45b6d7){const _0x8343d5=a55_0x1a166f;if(_0x45b6d7==='read')return _0x8343d5(0x170);if(_0x45b6d7===_0x8343d5(0x171))return _0x8343d5(0x17c);return _0x8343d5(0x180);}function businessStateSection(_0x4ae056){const _0x340cea=a55_0x1a166f;if(_0x4ae056!==_0x340cea(0x18b))return'';return _0x340cea(0x191);}
1
+ const a56_0x29d34e=a56_0x1171;(function(_0x2190ee,_0x4e62a3){const _0x2e65f9=a56_0x1171,_0x57d911=_0x2190ee();while(!![]){try{const _0x776867=parseInt(_0x2e65f9(0x1de))/0x1*(-parseInt(_0x2e65f9(0x1d9))/0x2)+parseInt(_0x2e65f9(0x1ea))/0x3+parseInt(_0x2e65f9(0x1e2))/0x4+-parseInt(_0x2e65f9(0x1e1))/0x5*(-parseInt(_0x2e65f9(0x1d7))/0x6)+parseInt(_0x2e65f9(0x1e8))/0x7+parseInt(_0x2e65f9(0x1e3))/0x8+parseInt(_0x2e65f9(0x1f7))/0x9*(-parseInt(_0x2e65f9(0x1ec))/0xa);if(_0x776867===_0x4e62a3)break;else _0x57d911['push'](_0x57d911['shift']());}catch(_0x401b4d){_0x57d911['push'](_0x57d911['shift']());}}}(a56_0x38a3,0xc4be0));import{CliErrors}from'../../errors.js';export const SKILL_TYPES=['write',a56_0x29d34e(0x1e6)];export const DEFAULT_SKILL_TARGET=a56_0x29d34e(0x1f0);export const SKILL_NAME_PATTERN=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;export const RUNTIME_CONTRACT_FILE=a56_0x29d34e(0x1ee);export const OUTPUT_CONTRACT_FILE=a56_0x29d34e(0x1f1);export function validateSkillName(_0x64b33f){const _0xa1cde1=a56_0x29d34e,_0x395bce=_0x64b33f[_0xa1cde1(0x1f3)]();if(!SKILL_NAME_PATTERN['test'](_0x395bce))throw CliErrors['validation'](_0xa1cde1(0x1db)+_0x64b33f+_0xa1cde1(0x1e7),'Use\x20lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens,\x20for\x20example\x20invoice-export.');return _0x395bce;}function a56_0x38a3(){const _0x5db83d=['##\x20业务状态流转\x0a\x0a【填写本\x20Skill\x20的前置业务状态、允许动作、目标业务状态、fromStatus\x20->\x20toStatus\x20预览、写入后读回核对,以及\x20unknown\x20/\x20needs_manual_check\x20处理。状态迁移合法性必须由业务\x20BFF、Lovrabet\x20平台命令或服务端接口判断,Skill\x20不作为状态事实源。】','9gLMYDL','write','type','#\x20Output\x20Contract\x0a\x0a','\x0a\x0a##\x20错误与人工接管\x0a\x0aerrors\x20必须包含失败阶段、错误原因和可复核对象。\x0anextActions\x20必须给出重试、补充输入、人工接管或停止处理的动作。\x0a','includes','66XOJPHQ','timestamp','1618NETWGi','join','Invalid\x20Skill\x20name:\x20','\x22\x0a\x20\x20generator:\x20\x22lovrabet\x20skill\x20create\x22\x0a---\x0a\x0a#\x20','write\x20类型在\x20dry_run\x20下只展示预览、影响范围和差异,不写入业务数据。\x0aconfirmed\x20写入后必须执行读回核对,并把核对结果写入\x20verification。\x0a读回异常、业务状态未知或结果不一致时,status\x20必须为\x20partial_success、failed\x20或\x20needs_manual_check。','76JUKnXW','\x0a\x0a##\x20展示规范\x0a\x0a【填写面向运营人员的展示字段、差异摘要、成功/失败状态和人工处理项;最终输出必须按\x20references/output-contract.md\x20的\x20status\x20/\x20mode\x20/\x20summary\x20/\x20errors\x20/\x20nextActions\x20返回,不能把\x20unknown、partial_success、failed\x20或\x20needs_manual_check\x20包装为\x20success。】\x0a\x0a##\x20失败恢复\x0a\x0a【填写失败后的\x20checkpoint、重试条件、人工接管方式和避免重复写入的核对步骤】\x0a','skillName','126410ANMFCK','5284824AyTQQU','2658904VXEAWs','\x20的最终回复必须让运营人员能判断:是否执行、影响了什么、如何复核、失败后下一步做什么。\x0a\x0a##\x20状态枚举\x0a\x0astatus:\x20success\x20|\x20no_op\x20|\x20partial_success\x20|\x20blocked\x20|\x20failed\x20|\x20needs_manual_check\x0a\x0a-\x20success:动作已完成,且关键结果已核对。\x0a-\x20no_op:没有符合条件的对象或无需变更。\x0a-\x20partial_success:部分对象完成,未完成对象必须进入\x20errors\x20和\x20nextActions。\x0a-\x20blocked:缺少输入、权限、确认或平台能力,无法继续。\x0a-\x20failed:执行失败,必须说明失败阶段、错误和恢复方式。\x0a-\x20needs_manual_check:读回异常、状态未知或人工判断缺失。\x0a\x0aunknown、partial_success、failed、needs_manual_check\x20不能包装为\x20success。\x0a\x0a##\x20输出模式\x0a\x0amode:\x20dry_run\x20|\x20confirmed\x20|\x20read_only\x0a\x0a-\x20dry_run:只展示预览、影响范围和差异,不写入业务数据。\x0a-\x20confirmed:用户明确确认后的执行模式;写入后必须读回核对。\x0a-\x20read_only:只查询、汇总或核对,不触发写入。\x0a\x0a##\x20必填字段\x0a\x0a-\x20status\x0a-\x20mode\x0a-\x20summary\x0a-\x20scope\x0a-\x20changes\x0a-\x20verification\x0a-\x20warnings\x0a-\x20errors\x0a-\x20nextActions\x0a\x0a##\x20写入结果\x0a\x0a','\x20只作为模板选择器,不替代业务权限、风险等级和用户确认。\x0a\x0a##\x20运行态入口\x0a\x0a【填写包内说明的运行态入口、可调用脚本或人工执行边界】\x0a\x0a##\x20凭证与登录态\x0a\x0a【填写本\x20Skill\x20依赖的第三方服务凭证和登录态治理方式。强烈建议通过\x20Lovrabet\x20应用后台或平台服务端适配器做平台托管配置;开发先行阶段如存在临时明文凭证,应标注后续治理计划、适用环境和额度边界,并避免进入长期交付内容。】\x0a\x0a##\x20第三方候选资产\x0a\x0a【填写第三方生成类结果的消费边界。生成类结果仅作为候选素材;涉及商品图、客户资料、Excel\x20或业务文件上传时,必须声明授权、额度、审计、失败降级和人工审核/业务\x20BFF\x20校验后的发布边界。】\x0a\x0a##\x20预览\x20/\x20写入\x20/\x20核对差异\x0a\x0a【填写预览、确认、正式执行和只读核对的顺序】\x0a\x0a','read','.\x20Use\x20lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens.','6564054EJKCCH','toISOString','1099110DOnzcM','\x0a##\x20返回契约\x0a\x0a最终输出必须遵守\x20[output-contract.md](output-contract.md)。本文件只补充运行态安全约束;展示字段、状态枚举、失败暴露和人工处理项以\x20output-contract.md\x20为准。\x0a\x0a##\x20失败恢复\x0a\x0a【填写失败状态识别、checkpoint、重试和人工接管方式】\x0a\x0a##\x20禁止事项\x0a\x0a-\x20禁止链接或读取\x20Skill\x20目录外的\x20AGENTS.md、wiki、docs、脚本或个人路径作为运行时必读依赖。\x0a-\x20禁止把说明性的缓存路径、安装路径、示例路径或排障路径包装成运行时必读依赖。\x0a-\x20禁止在未确认影响范围时执行写入。\x0a-\x20禁止隐藏失败或把未知状态描述为成功。\x0a','23684230kpIfNc','\x0a\x0a##\x20内部要求\x0a\x0a执行前必须读取并遵守\x20[runtime-contract.md](references/runtime-contract.md)\x20和\x20[output-contract.md](references/output-contract.md)。\x0a\x0a##\x20使用边界\x0a\x0a【填写该\x20Skill\x20能做什么、不能做什么、适用业务范围和禁止扩大执行范围】\x0a\x0a##\x20输入门禁\x0a\x0a【填写必须具备的输入;缺失业务对象、执行范围、确认信息或权限上下文时必须停止】\x0a\x0a##\x20与现有能力集成\x0a\x0a【填写本\x20Skill\x20使用的\x20lovrabet\x20data、lovrabet\x20sql、lovrabet\x20bff\x20或\x20lovrabet\x20personal-bff\x20命令,以及包内\x20references/\x20中沉淀的运行态入口、脚本对接方式或人工操作边界。不得依赖\x20Skill\x20目录外文件、绝对路径或本机专属配置。】\x0a\x0a##\x20平台能力优先\x0a\x0a【填写本\x20Skill\x20优先使用的\x20Lovrabet\x20平台命令:lovrabet\x20data\x20/\x20lovrabet\x20sql\x20/\x20lovrabet\x20bff\x20/\x20lovrabet\x20personal-bff。本地脚本仅用于平台明确不覆盖的文件格式转换、静态校验、展示整理或第三方薄适配;不得用本地脚本替代平台命令承载业务写入、权限判断、状态机、审批提交或回滚。】\x0a\x0a##\x20第三方服务边界\x0a\x0a【填写是否调用第三方识别、生成、上传或行业服务;如涉及\x20API\x20Key、OAuth、Cookie、登录态或业务数据上传,必须说明由\x20Lovrabet\x20应用后台、BFF\x20或平台适配器统一配置。目标治理口径是\x20Skill\x20不读取、不分发、不保存明文凭证。详细凭证、额度、审计和审核发布规则写入\x20references/runtime-contract.md。】\x0a\x0a##\x20SOP\x20工作流\x0a\x0a','references/runtime-contract.md','\x20的所有必读规则必须位于\x20SKILL.md\x20或\x20references/\x20内。\x0a\x0a##\x20必读文档\x0a\x0a-\x20[SKILL.md](../SKILL.md)\x0a-\x20[runtime-contract.md](runtime-contract.md)\x0a-\x20[output-contract.md](output-contract.md)\x0a\x0a##\x20主边界\x0a\x0a-\x20不得依赖\x20Skill\x20目录外的仓库文件、绝对路径、file\x20URL\x20或本机专属配置。\x0a-\x20文档中的缓存路径、安装路径、示例路径或排障路径不等于运行时包外依赖;只有明确要求读取、链接或执行包外内容时才属于自包含风险。\x0a-\x20如需承接仓库规范,必须把必要规则内化到本\x20Skill\x20包内的\x20references/\x20文件中。\x0a-\x20type=','.agents/skills','references/output-contract.md','\x0a\x20\x20created:\x20\x22','trim','1.\x20dry-run:【填写预览入口、影响范围和差异摘要;不得写入业务数据】\x0a2.\x20用户确认:【填写确认语义、目标对象、数量、风险和操作者责任】\x0a3.\x20confirmed\x20写入:【填写确认后的写入入口和幂等/防重复要求】\x0a4.\x20只读核对:【填写写入后的查询核对、差异展示和结果链接】\x0a5.\x20checkpoint:【填写失败恢复、重试条件和人工接管方式】','\x0adescription:\x20\x22【填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词】\x22\x0a#\x20example:\x20\x22<填写一句用户可以直接说出的最简触发话术>\x22\x0ametadata:\x0a\x20\x20type:\x20'];a56_0x38a3=function(){return _0x5db83d;};return a56_0x38a3();}export function normalizeSkillTemplateType(_0x35c050){const _0x537dd9=a56_0x29d34e,_0x1aa15f=(_0x35c050||'write')[_0x537dd9(0x1f3)]()||_0x537dd9(0x1f8);if(SKILL_TYPES[_0x537dd9(0x1fc)](_0x1aa15f))return _0x1aa15f;throw CliErrors['validation']('Unsupported\x20Skill\x20type:\x20'+_0x35c050,'Use\x20one\x20of:\x20'+SKILL_TYPES[_0x537dd9(0x1da)](',\x20')+'.');}export function renderSkillTemplate(_0x2e6292){const _0x32cbca=a56_0x29d34e,_0x13d62c=validateSkillName(_0x2e6292[_0x32cbca(0x1e0)]),_0x4a8f64=normalizeSkillTemplateType(_0x2e6292[_0x32cbca(0x1f9)]),_0x177ca8=_0x2e6292[_0x32cbca(0x1d8)]??new Date()[_0x32cbca(0x1e9)]();return{'skillName':_0x13d62c,'type':_0x4a8f64,'files':[{'path':'SKILL.md','content':renderSkillMd(_0x13d62c,_0x4a8f64,_0x177ca8)},{'path':RUNTIME_CONTRACT_FILE,'content':renderRuntimeContract(_0x13d62c,_0x4a8f64)},{'path':OUTPUT_CONTRACT_FILE,'content':renderOutputContract(_0x13d62c,_0x4a8f64)}]};}function renderSkillMd(_0x52a6fd,_0x360cb7,_0x2b5eb8){const _0x3ba2d5=a56_0x29d34e,_0x2d4da0=typeWorkflow(_0x360cb7);return'---\x0aname:\x20'+_0x52a6fd+_0x3ba2d5(0x1f5)+_0x360cb7+_0x3ba2d5(0x1f2)+_0x2b5eb8+_0x3ba2d5(0x1dc)+_0x52a6fd+_0x3ba2d5(0x1ed)+_0x2d4da0+'\x0a\x0a'+businessStateSection(_0x360cb7)+_0x3ba2d5(0x1df);}function renderRuntimeContract(_0x21ff99,_0x113bdc){const _0x113f20=a56_0x29d34e,_0x46481a=_0x113bdc===_0x113f20(0x1f8)?'##\x20状态读回与未知状态处理\x0a\x0a【填写业务状态事实源、fromStatus\x20->\x20toStatus\x20预览、写入后读回核对方式,以及\x20unknown\x20/\x20needs_manual_check\x20的处理边界】\x0a\x0a':'';return'#\x20Runtime\x20Contract\x0a\x0aSkill\x20push\x20后的\x20zip\x20包就是完整交付产物。'+_0x21ff99+_0x113f20(0x1ef)+_0x113bdc+_0x113f20(0x1e5)+_0x46481a+_0x113f20(0x1eb);}function a56_0x1171(_0x2a7958,_0x5be0e2){_0x2a7958=_0x2a7958-0x1d7;const _0x38a34f=a56_0x38a3();let _0x11713c=_0x38a34f[_0x2a7958];return _0x11713c;}function renderOutputContract(_0x18012e,_0x41b316){const _0x4df2dd=a56_0x29d34e,_0x403096=_0x41b316===_0x4df2dd(0x1f8)?_0x4df2dd(0x1dd):_0x41b316+'\x20类型默认不执行业务写入;如流程包含受控维护或人工确认,也必须用\x20mode\x20标明执行阶段并暴露核对结果。';return _0x4df2dd(0x1fa)+_0x18012e+_0x4df2dd(0x1e4)+_0x403096+_0x4df2dd(0x1fb);}function typeWorkflow(_0x3b7447){const _0x2eef79=a56_0x29d34e;if(_0x3b7447===_0x2eef79(0x1e6))return'1.\x20只读查询:【填写查询入口、过滤条件和权限边界】\x0a2.\x20业务汇总:【填写统计口径、字段解释和异常提示】\x0a3.\x20查看链接:【填写可供运营人员复核的记录、页面或报告链接】\x0a4.\x20禁止写入:不得创建、更新、删除或触发会改变业务状态的动作。';return _0x2eef79(0x1f4);}function businessStateSection(_0x4f52de){const _0x4d358d=a56_0x29d34e;if(_0x4f52de!=='write')return'';return _0x4d358d(0x1f6);}
@@ -0,0 +1,20 @@
1
+ export interface SkillValidationIssue {
2
+ level: "error" | "warning";
3
+ ruleId: string;
4
+ file: string;
5
+ section?: string;
6
+ message: string;
7
+ suggestion: string;
8
+ }
9
+ export interface SkillValidationReport {
10
+ ok: boolean;
11
+ dir: string;
12
+ type?: string;
13
+ errors: SkillValidationIssue[];
14
+ warnings: SkillValidationIssue[];
15
+ }
16
+ export declare function validateSkillDirectory(dir: string, _options?: {
17
+ strict?: boolean;
18
+ profile?: "push";
19
+ }): SkillValidationReport;
20
+ export declare function throwIfSkillValidationFailed(report: SkillValidationReport, _strict?: boolean): void;
@@ -1 +1 @@
1
- const a56_0x173660=a56_0x15bc;function a56_0x15bc(_0x3b0f05,_0x530631){_0x3b0f05=_0x3b0f05-0x147;const _0x47e314=a56_0x47e3();let _0x15bcd3=_0x47e314[_0x3b0f05];return _0x15bcd3;}(function(_0x397e18,_0x31c486){const _0x363e3f=a56_0x15bc,_0x312d4b=_0x397e18();while(!![]){try{const _0xfe48c6=parseInt(_0x363e3f(0x18e))/0x1*(-parseInt(_0x363e3f(0x18a))/0x2)+-parseInt(_0x363e3f(0x151))/0x3+parseInt(_0x363e3f(0x18d))/0x4+-parseInt(_0x363e3f(0x148))/0x5*(-parseInt(_0x363e3f(0x19c))/0x6)+-parseInt(_0x363e3f(0x149))/0x7+-parseInt(_0x363e3f(0x19a))/0x8*(-parseInt(_0x363e3f(0x190))/0x9)+parseInt(_0x363e3f(0x15c))/0xa;if(_0xfe48c6===_0x31c486)break;else _0x312d4b['push'](_0x312d4b['shift']());}catch(_0x29c8c7){_0x312d4b['push'](_0x312d4b['shift']());}}}(a56_0x47e3,0xd0c7b));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{resolve}from'node:path';import{parse as a56_0x314b63}from'yaml';import{CliErrors}from'../../errors.js';import{fileText,scanSkillDirectory}from'../../skills/runtime-skill-sync/local-files.js';const SKILL_FILE='SKILL.md',SUPPORTED_SKILL_TYPES=new Set([a56_0x173660(0x191),a56_0x173660(0x166),a56_0x173660(0x196)]),TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;export function validateSkillDirectory(_0x29fbc1,_0x1931fb={}){const _0x53eee0=a56_0x173660,_0x392ea4=resolveSkillDirectoryRoot(_0x29fbc1),_0x293996=[],_0xdee490=loadRequiredSkillFile(_0x392ea4,_0x293996),_0x2ffb3=_0xdee490?parseFrontmatter(_0xdee490['content']):{'hasFrontmatter':![]};_0xdee490&&validateFrontmatter(_0xdee490[_0x53eee0(0x192)],_0x2ffb3,_0x293996);validateRuntimeCliReferences(_0x392ea4,_0x293996);const _0x108b55=_0x293996[_0x53eee0(0x194)](_0x74051e=>_0x74051e[_0x53eee0(0x17d)]===_0x53eee0(0x168)),_0x53cc9d=_0x293996['filter'](_0x523105=>_0x523105['level']===_0x53eee0(0x176));return{'ok':_0x108b55[_0x53eee0(0x15d)]===0x0,'dir':_0x392ea4,'type':_0x2ffb3['type'],'errors':_0x108b55,'warnings':_0x53cc9d};}function resolveSkillDirectoryRoot(_0x2c6245){const _0x4f095c=a56_0x173660,_0x44ea7f=resolve(_0x2c6245);if(!existsSync(_0x44ea7f))throw CliErrors['validation'](_0x4f095c(0x17e)+_0x2c6245);const _0x341447=lstatSync(_0x44ea7f);if(_0x341447[_0x4f095c(0x153)]())return _0x44ea7f;if(_0x341447['isSymbolicLink']()){const _0x39957c=realpathSync(_0x44ea7f);if(lstatSync(_0x39957c)['isDirectory']())return _0x39957c;}throw CliErrors[_0x4f095c(0x17f)](_0x4f095c(0x17e)+_0x2c6245);}export function throwIfSkillValidationFailed(_0xa8f71f,_0x15813b=![]){const _0x2bdb62=a56_0x173660;if(_0xa8f71f['ok'])return;const _0x2bd617=_0xa8f71f[_0x2bdb62(0x164)][_0x2bdb62(0x162)](_0x558dda=>{const _0x26194d=_0x2bdb62,_0x3e31c0=_0x558dda['section']?'#'+_0x558dda[_0x26194d(0x1a0)]:'';return _0x558dda[_0x26194d(0x17d)][_0x26194d(0x178)]()+'\x20'+_0x558dda[_0x26194d(0x1a1)]+'\x20'+_0x558dda[_0x26194d(0x193)]+_0x3e31c0+':\x20'+_0x558dda['message']+_0x26194d(0x147)+_0x558dda[_0x26194d(0x158)];});throw CliErrors[_0x2bdb62(0x17f)](_0x2bdb62(0x14f)+_0x2bd617[_0x2bdb62(0x155)]('\x0a'),_0x2bdb62(0x184));}function loadRequiredSkillFile(_0x4695cf,_0x1920e7){const _0x33b072=a56_0x173660,_0x4cb246=resolve(_0x4695cf,SKILL_FILE);if(!existsSync(_0x4cb246))return _0x1920e7[_0x33b072(0x16e)](issue('error',_0x33b072(0x183),SKILL_FILE,_0x33b072(0x165),_0x33b072(0x186))),undefined;const _0x31bb86=lstatSync(_0x4cb246);if(_0x31bb86[_0x33b072(0x17a)]())return _0x1920e7[_0x33b072(0x16e)](issue(_0x33b072(0x168),_0x33b072(0x183),SKILL_FILE,_0x33b072(0x154),'Replace\x20the\x20symlink\x20with\x20a\x20regular\x20SKILL.md\x20file\x20inside\x20the\x20Skill\x20directory.')),undefined;if(!_0x31bb86[_0x33b072(0x19d)]())return _0x1920e7[_0x33b072(0x16e)](issue(_0x33b072(0x168),_0x33b072(0x183),SKILL_FILE,_0x33b072(0x174),_0x33b072(0x16f))),undefined;return{'path':SKILL_FILE,'content':readFileSync(_0x4cb246,_0x33b072(0x159))};}function validateFrontmatter(_0xcaafa8,_0x4d333e,_0x48c4a5){const _0x48333a=a56_0x173660;if(!_0x4d333e[_0x48333a(0x16c)]){_0x48c4a5[_0x48333a(0x16e)](issue(_0x48333a(0x168),_0x48333a(0x161),_0xcaafa8,'SKILL.md\x20must\x20start\x20with\x20frontmatter.','Add\x20frontmatter\x20with\x20name\x20and\x20description.'));return;}!_0x4d333e['name']?.[_0x48333a(0x182)]()&&_0x48c4a5[_0x48333a(0x16e)](issue(_0x48333a(0x168),'frontmatter-required',_0xcaafa8,_0x48333a(0x156),_0x48333a(0x14a))),!_0x4d333e[_0x48333a(0x14b)]?.[_0x48333a(0x182)]()&&_0x48c4a5[_0x48333a(0x16e)](issue(_0x48333a(0x176),_0x48333a(0x18b),_0xcaafa8,'Frontmatter\x20displayName\x20is\x20missing.',_0x48333a(0x19b))),!_0x4d333e[_0x48333a(0x19e)]?.[_0x48333a(0x182)]()&&_0x48c4a5['push'](issue(_0x48333a(0x176),'example-recommended',_0xcaafa8,_0x48333a(0x169),_0x48333a(0x175))),!_0x4d333e[_0x48333a(0x150)]?.['trim']()&&_0x48c4a5[_0x48333a(0x16e)](issue(_0x48333a(0x168),'description-required',_0xcaafa8,_0x48333a(0x16b),_0x48333a(0x179))),_0x4d333e[_0x48333a(0x19f)]===!![]&&_0x48c4a5[_0x48333a(0x16e)](issue('error','internal-skill',_0xcaafa8,_0x48333a(0x187),_0x48333a(0x15e))),_0x4d333e['type']?.['trim']()&&!SUPPORTED_SKILL_TYPES[_0x48333a(0x16a)](_0x4d333e[_0x48333a(0x172)])&&_0x48c4a5[_0x48333a(0x16e)](issue('error',_0x48333a(0x161),_0xcaafa8,'metadata.type\x20must\x20be\x20one\x20of\x20write,\x20read,\x20or\x20trainer.','Set\x20metadata.type\x20to\x20write,\x20read,\x20or\x20trainer.'));}function validateRuntimeCliReferences(_0x32c6c1,_0x431fd4){const _0x262f1c=a56_0x173660;for(const _0x593d14 of findRabetbaseCliInvocations(_0x32c6c1)){_0x431fd4[_0x262f1c(0x16e)](issue('warning',_0x262f1c(0x157),_0x593d14[_0x262f1c(0x193)],_0x262f1c(0x197),_0x262f1c(0x1a2),'L'+_0x593d14[_0x262f1c(0x195)]));}}function findRabetbaseCliInvocations(_0x263d12){const _0x15827e=a56_0x173660;return scanSkillDirectory(_0x263d12)[_0x15827e(0x194)](_0x11839d=>TEXT_SKILL_FILE_PATTERN[_0x15827e(0x188)](_0x11839d['path']))[_0x15827e(0x170)](_0x1dfdbd=>{const _0x381ba0=_0x15827e,_0x127014=fileText(_0x1dfdbd);return _0x127014['split'](/\r?\n/)[_0x381ba0(0x162)]((_0x3ef493,_0xbd4da4)=>({'file':_0x1dfdbd[_0x381ba0(0x192)],'line':_0xbd4da4+0x1,'text':_0x3ef493}))[_0x381ba0(0x194)](({text:_0x19d4dd})=>isRabetbaseCliInvocation(_0x19d4dd))['map'](({file:_0x4117af,line:_0x6d60d7})=>({'file':_0x4117af,'line':_0x6d60d7}));});}const RABETBASE_SUBCOMMANDS=['dataset',a56_0x173660(0x14c),a56_0x173660(0x18f),a56_0x173660(0x189),a56_0x173660(0x15b),a56_0x173660(0x181),a56_0x173660(0x177),a56_0x173660(0x152),a56_0x173660(0x163),'kb','config',a56_0x173660(0x198),'data',a56_0x173660(0x185),a56_0x173660(0x167),a56_0x173660(0x15f)],RABETBASE_INVOCATION=new RegExp(String[a56_0x173660(0x16d)]`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS[a56_0x173660(0x155)]('|')})\b`+String[a56_0x173660(0x16d)]`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,'i');function isRabetbaseCliInvocation(_0x4d3af9){const _0x2c6d52=a56_0x173660,_0x5e9133=_0x4d3af9[_0x2c6d52(0x173)](/\brabetbase\b/i);if(_0x5e9133<0x0)return![];const _0x4051c6=_0x4d3af9[_0x2c6d52(0x160)](_0x5e9133)['split'](/\blovrabet\b/i)[0x0]??'';return RABETBASE_INVOCATION['test'](_0x4051c6);}function parseFrontmatter(_0x495d92){const _0x48f9a3=a56_0x173660,_0xca21b4=_0x495d92[_0x48f9a3(0x199)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xca21b4)return{'hasFrontmatter':![]};const _0x385ab1=_0xca21b4[0x1]??'',_0x11dadb={'hasFrontmatter':!![]};let _0x2c2f7d;try{_0x2c2f7d=a56_0x314b63(_0x385ab1);}catch{return _0x11dadb;}const _0x5b918e=asRecord(_0x2c2f7d);if(!_0x5b918e)return _0x11dadb;_0x11dadb[_0x48f9a3(0x18c)]=scalarToString(_0x5b918e[_0x48f9a3(0x18c)]),_0x11dadb[_0x48f9a3(0x14b)]=scalarToString(_0x5b918e[_0x48f9a3(0x14b)]),_0x11dadb[_0x48f9a3(0x150)]=scalarToString(_0x5b918e[_0x48f9a3(0x150)]),_0x11dadb[_0x48f9a3(0x19e)]=scalarToString(_0x5b918e[_0x48f9a3(0x19e)]);const _0x16d489=asRecord(_0x5b918e['metadata']);return _0x16d489&&(_0x11dadb[_0x48f9a3(0x172)]=scalarToString(_0x16d489[_0x48f9a3(0x172)]),_0x11dadb['internal']=scalarToBoolean(_0x16d489['internal'])),_0x11dadb;}function asRecord(_0x3205f5){const _0x2c8602=a56_0x173660;if(_0x3205f5&&typeof _0x3205f5===_0x2c8602(0x17c)&&!Array['isArray'](_0x3205f5))return _0x3205f5;return undefined;}function scalarToString(_0x1c7e7e){const _0x1c0fe4=a56_0x173660;if(typeof _0x1c7e7e==='string')return _0x1c7e7e[_0x1c0fe4(0x182)]();if(typeof _0x1c7e7e===_0x1c0fe4(0x180)||typeof _0x1c7e7e==='boolean')return String(_0x1c7e7e);return undefined;}function a56_0x47e3(){const _0x4ad38d=['string','true','Skill\x20validation\x20failed:\x0a','description','4946904ELjtmf','service','isDirectory','SKILL.md\x20must\x20be\x20a\x20regular\x20file.','join','Frontmatter\x20name\x20is\x20missing.','rabetbase-cli-reference','suggestion','utf8','false','project','34297490omWAhd','length','Remove\x20metadata.internal\x20or\x20set\x20it\x20to\x20false\x20before\x20running\x20skill\x20push.','registry','slice','frontmatter-required','map','artifact','errors','Missing\x20SKILL.md.','read','logs','error','Frontmatter\x20example\x20is\x20missing.','has','Frontmatter\x20description\x20is\x20empty.','hasFrontmatter','raw','push','Add\x20SKILL.md\x20as\x20a\x20regular\x20file\x20at\x20the\x20Skill\x20directory\x20root.','flatMap','toLowerCase','type','search','SKILL.md\x20is\x20not\x20a\x20file.','Set\x20example\x20to\x20one\x20short\x20user\x20message\x20that\x20can\x20directly\x20trigger\x20this\x20Skill.','warning','schema','toUpperCase','填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词。','isSymbolicLink','boolean','object','level','Skill\x20directory\x20not\x20found:\x20','validation','number','app','trim','structure-complete','Fix\x20the\x20Skill\x20metadata\x20before\x20running\x20skill\x20push.','auth','Add\x20SKILL.md\x20at\x20the\x20Skill\x20directory\x20root.','metadata.internal=true\x20Skills\x20cannot\x20be\x20uploaded.','test','page','111460bwdHgz','display-name-recommended','name','1871220rVXiTv','29nelGPo','bff','4530105YpeVXr','write','path','file','filter','line','trainer','This\x20line\x20invokes\x20the\x20rabetbase\x20CLI.\x20rabetbase\x20is\x20a\x20dev-time\x20tool;\x20runtime\x20Skills\x20should\x20drive\x20runtime\x20work\x20through\x20lovrabet\x20commands.','workspace','match','8VZfQXj','Set\x20displayName\x20to\x20the\x20human-readable\x20Skill\x20name\x20shown\x20in\x20SkillHub.','6ZyGrBk','isFile','example','internal','section','ruleId','If\x20this\x20is\x20a\x20runtime\x20step,\x20replace\x20it\x20with\x20the\x20equivalent\x20lovrabet\x20command.\x20Dev-time\x20discovery\x20or\x20handoff\x20notes\x20can\x20stay.','\x20Fix:\x20','5638285FLJzQQ','9857785UCLRmU','Set\x20name\x20to\x20the\x20Skill\x20directory\x20code.','displayName','sql'];a56_0x47e3=function(){return _0x4ad38d;};return a56_0x47e3();}function scalarToBoolean(_0x24f1f3){const _0x4bca6f=a56_0x173660;if(typeof _0x24f1f3===_0x4bca6f(0x17b))return _0x24f1f3;if(typeof _0x24f1f3===_0x4bca6f(0x14d))return cleanBoolean(_0x24f1f3);return undefined;}function cleanBoolean(_0x6dab7b){const _0x2d5f50=a56_0x173660,_0x246047=_0x6dab7b['trim']()[_0x2d5f50(0x171)]();if(_0x246047===_0x2d5f50(0x14e))return!![];if(_0x246047===_0x2d5f50(0x15a))return![];return undefined;}function issue(_0x4768e4,_0x2af43d,_0x1c5ee5,_0x2d6a05,_0x31e7eb,_0x133b26){return{'level':_0x4768e4,'ruleId':_0x2af43d,'file':_0x1c5ee5,'section':_0x133b26,'message':_0x2d6a05,'suggestion':_0x31e7eb};}
1
+ const a57_0x1864fb=a57_0x2228;(function(_0x2e4bac,_0xe58a8d){const _0x1753f5=a57_0x2228,_0x37e965=_0x2e4bac();while(!![]){try{const _0x3b1f1e=parseInt(_0x1753f5(0x224))/0x1*(parseInt(_0x1753f5(0x1f5))/0x2)+parseInt(_0x1753f5(0x211))/0x3*(-parseInt(_0x1753f5(0x203))/0x4)+-parseInt(_0x1753f5(0x22b))/0x5*(parseInt(_0x1753f5(0x237))/0x6)+parseInt(_0x1753f5(0x1f7))/0x7*(-parseInt(_0x1753f5(0x22c))/0x8)+parseInt(_0x1753f5(0x226))/0x9*(-parseInt(_0x1753f5(0x1ee))/0xa)+-parseInt(_0x1753f5(0x1fc))/0xb*(parseInt(_0x1753f5(0x1f8))/0xc)+parseInt(_0x1753f5(0x21c))/0xd;if(_0x3b1f1e===_0xe58a8d)break;else _0x37e965['push'](_0x37e965['shift']());}catch(_0x8f3259){_0x37e965['push'](_0x37e965['shift']());}}}(a57_0x28a1,0xf377f));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{resolve}from'node:path';import{parse as a57_0x507c61}from'yaml';import{CliErrors}from'../../errors.js';import{fileText,scanSkillDirectory}from'../../skills/runtime-skill-sync/local-files.js';const SKILL_FILE='SKILL.md',SUPPORTED_SKILL_TYPES=new Set(['write','read']),TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;export function validateSkillDirectory(_0x5e79ad,_0x79975a={}){const _0x410322=a57_0x2228,_0x50cd19=resolveSkillDirectoryRoot(_0x5e79ad),_0x3aae4f=[],_0x330bff=loadRequiredSkillFile(_0x50cd19,_0x3aae4f),_0x38f35d=_0x330bff?parseFrontmatter(_0x330bff[_0x410322(0x217)]):{'hasFrontmatter':![]};_0x330bff&&validateFrontmatter(_0x330bff['path'],_0x38f35d,_0x3aae4f);validateRuntimeCliReferences(_0x50cd19,_0x3aae4f);const _0x3c530e=_0x3aae4f[_0x410322(0x209)](_0xeabb11=>_0xeabb11[_0x410322(0x21b)]===_0x410322(0x1ff)),_0x2ffffa=_0x3aae4f['filter'](_0xa09a77=>_0xa09a77['level']===_0x410322(0x202));return{'ok':_0x3c530e[_0x410322(0x223)]===0x0,'dir':_0x50cd19,'type':_0x38f35d[_0x410322(0x230)],'errors':_0x3c530e,'warnings':_0x2ffffa};}function a57_0x28a1(){const _0x5936e9=['number','trim','suggestion','metadata','false','isDirectory','split','Frontmatter\x20example\x20is\x20missing.','14810eCLezd','Add\x20SKILL.md\x20at\x20the\x20Skill\x20directory\x20root.','name','toUpperCase','Skill\x20validation\x20failed:\x0a','填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词。','Frontmatter\x20name\x20is\x20missing.','14KxpyPX','metadata.internal=true\x20Skills\x20cannot\x20be\x20uploaded.','7OCsFtJ','1968cdxRRn','Set\x20example\x20to\x20one\x20short\x20user\x20message\x20that\x20can\x20directly\x20trigger\x20this\x20Skill.','example','Frontmatter\x20description\x20is\x20empty.','85327HmOyQr','validation','SKILL.md\x20must\x20start\x20with\x20frontmatter.','error','rabetbase-cli-reference','displayName','warning','2303712aBsTTG','config','section','SKILL.md\x20must\x20be\x20a\x20regular\x20file.','internal-skill','raw','filter','join','object','line','Set\x20displayName\x20to\x20the\x20human-readable\x20Skill\x20name\x20shown\x20in\x20SkillHub.','map','search','auth','3DQSWka','frontmatter-required','dataset','Fix\x20the\x20Skill\x20metadata\x20before\x20running\x20skill\x20push.','SKILL.md\x20is\x20not\x20a\x20file.','test','content','data','push','flatMap','level','62167391DXqLMh','ruleId','isFile','display-name-recommended','registry','Add\x20frontmatter\x20with\x20name\x20and\x20description.','app','length','149323hRNTCI','\x20Fix:\x20','9054WQIcAi','Add\x20SKILL.md\x20as\x20a\x20regular\x20file\x20at\x20the\x20Skill\x20directory\x20root.','Set\x20metadata.type\x20to\x20write\x20or\x20read.','message','Frontmatter\x20displayName\x20is\x20missing.','45OPiNTz','456224JJCFOo','Remove\x20metadata.internal\x20or\x20set\x20it\x20to\x20false\x20before\x20running\x20skill\x20push.','errors','project','type','toLowerCase','If\x20this\x20is\x20a\x20runtime\x20step,\x20replace\x20it\x20with\x20the\x20equivalent\x20lovrabet\x20command.\x20Dev-time\x20discovery\x20or\x20handoff\x20notes\x20can\x20stay.','structure-complete','internal','Set\x20name\x20to\x20the\x20Skill\x20directory\x20code.','path','956754lWDiwx','true','Skill\x20directory\x20not\x20found:\x20','service','isSymbolicLink','isArray','file','string','match','logs','description','boolean'];a57_0x28a1=function(){return _0x5936e9;};return a57_0x28a1();}function resolveSkillDirectoryRoot(_0x30398d){const _0x388514=a57_0x2228,_0x427385=resolve(_0x30398d);if(!existsSync(_0x427385))throw CliErrors[_0x388514(0x1fd)](_0x388514(0x1dc)+_0x30398d);const _0x53a3ca=lstatSync(_0x427385);if(_0x53a3ca[_0x388514(0x1eb)]())return _0x427385;if(_0x53a3ca['isSymbolicLink']()){const _0x15516c=realpathSync(_0x427385);if(lstatSync(_0x15516c)[_0x388514(0x1eb)]())return _0x15516c;}throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0x30398d);}export function throwIfSkillValidationFailed(_0x200ecd,_0x2e4d62=![]){const _0x1c0770=a57_0x2228;if(_0x200ecd['ok'])return;const _0x1069f2=_0x200ecd[_0x1c0770(0x22e)]['map'](_0x50e78b=>{const _0x2db521=_0x1c0770,_0x4d584e=_0x50e78b[_0x2db521(0x205)]?'#'+_0x50e78b[_0x2db521(0x205)]:'';return _0x50e78b[_0x2db521(0x21b)][_0x2db521(0x1f1)]()+'\x20'+_0x50e78b[_0x2db521(0x21d)]+'\x20'+_0x50e78b[_0x2db521(0x1e0)]+_0x4d584e+':\x20'+_0x50e78b[_0x2db521(0x229)]+_0x2db521(0x225)+_0x50e78b[_0x2db521(0x1e8)];});throw CliErrors[_0x1c0770(0x1fd)](_0x1c0770(0x1f2)+_0x1069f2[_0x1c0770(0x20a)]('\x0a'),_0x1c0770(0x214));}function loadRequiredSkillFile(_0x578672,_0x44d0e7){const _0x136c14=a57_0x2228,_0x2341fd=resolve(_0x578672,SKILL_FILE);if(!existsSync(_0x2341fd))return _0x44d0e7[_0x136c14(0x219)](issue(_0x136c14(0x1ff),_0x136c14(0x233),SKILL_FILE,'Missing\x20SKILL.md.',_0x136c14(0x1ef))),undefined;const _0x59cba7=lstatSync(_0x2341fd);if(_0x59cba7[_0x136c14(0x1de)]())return _0x44d0e7[_0x136c14(0x219)](issue('error',_0x136c14(0x233),SKILL_FILE,_0x136c14(0x206),'Replace\x20the\x20symlink\x20with\x20a\x20regular\x20SKILL.md\x20file\x20inside\x20the\x20Skill\x20directory.')),undefined;if(!_0x59cba7[_0x136c14(0x21e)]())return _0x44d0e7[_0x136c14(0x219)](issue(_0x136c14(0x1ff),_0x136c14(0x233),SKILL_FILE,_0x136c14(0x215),_0x136c14(0x227))),undefined;return{'path':SKILL_FILE,'content':readFileSync(_0x2341fd,'utf8')};}function validateFrontmatter(_0x12a310,_0x3e50e7,_0x551e56){const _0x3bc6de=a57_0x2228;if(!_0x3e50e7['hasFrontmatter']){_0x551e56[_0x3bc6de(0x219)](issue(_0x3bc6de(0x1ff),_0x3bc6de(0x212),_0x12a310,_0x3bc6de(0x1fe),_0x3bc6de(0x221)));return;}!_0x3e50e7['name']?.[_0x3bc6de(0x1e7)]()&&_0x551e56['push'](issue(_0x3bc6de(0x1ff),_0x3bc6de(0x212),_0x12a310,_0x3bc6de(0x1f4),_0x3bc6de(0x235))),!_0x3e50e7['displayName']?.['trim']()&&_0x551e56['push'](issue(_0x3bc6de(0x202),_0x3bc6de(0x21f),_0x12a310,_0x3bc6de(0x22a),_0x3bc6de(0x20d))),!_0x3e50e7[_0x3bc6de(0x1fa)]?.['trim']()&&_0x551e56[_0x3bc6de(0x219)](issue(_0x3bc6de(0x202),'example-recommended',_0x12a310,_0x3bc6de(0x1ed),_0x3bc6de(0x1f9))),!_0x3e50e7[_0x3bc6de(0x1e4)]?.[_0x3bc6de(0x1e7)]()&&_0x551e56[_0x3bc6de(0x219)](issue('error','description-required',_0x12a310,_0x3bc6de(0x1fb),_0x3bc6de(0x1f3))),_0x3e50e7[_0x3bc6de(0x234)]===!![]&&_0x551e56['push'](issue('error',_0x3bc6de(0x207),_0x12a310,_0x3bc6de(0x1f6),_0x3bc6de(0x22d))),_0x3e50e7[_0x3bc6de(0x230)]?.[_0x3bc6de(0x1e7)]()&&!SUPPORTED_SKILL_TYPES['has'](_0x3e50e7['type'])&&_0x551e56['push'](issue(_0x3bc6de(0x1ff),_0x3bc6de(0x212),_0x12a310,'metadata.type\x20must\x20be\x20one\x20of\x20write\x20or\x20read.',_0x3bc6de(0x228)));}function validateRuntimeCliReferences(_0x18fa7d,_0x5a67ce){const _0x17888f=a57_0x2228;for(const _0x30c8e5 of findRabetbaseCliInvocations(_0x18fa7d)){_0x5a67ce[_0x17888f(0x219)](issue(_0x17888f(0x202),_0x17888f(0x200),_0x30c8e5[_0x17888f(0x1e0)],'This\x20line\x20invokes\x20the\x20rabetbase\x20CLI.\x20rabetbase\x20is\x20a\x20dev-time\x20tool;\x20runtime\x20Skills\x20should\x20drive\x20runtime\x20work\x20through\x20lovrabet\x20commands.',_0x17888f(0x232),'L'+_0x30c8e5[_0x17888f(0x20c)]));}}function findRabetbaseCliInvocations(_0x2b2b3b){const _0x5535ca=a57_0x2228;return scanSkillDirectory(_0x2b2b3b)[_0x5535ca(0x209)](_0x23e9bc=>TEXT_SKILL_FILE_PATTERN['test'](_0x23e9bc[_0x5535ca(0x236)]))[_0x5535ca(0x21a)](_0x3c2f18=>{const _0x86fcd9=_0x5535ca,_0x5e249e=fileText(_0x3c2f18);return _0x5e249e[_0x86fcd9(0x1ec)](/\r?\n/)[_0x86fcd9(0x20e)]((_0x160126,_0xc78de2)=>({'file':_0x3c2f18['path'],'line':_0xc78de2+0x1,'text':_0x160126}))[_0x86fcd9(0x209)](({text:_0x1d5e1f})=>isRabetbaseCliInvocation(_0x1d5e1f))['map'](({file:_0x148973,line:_0x7eea7a})=>({'file':_0x148973,'line':_0x7eea7a}));});}const RABETBASE_SUBCOMMANDS=[a57_0x1864fb(0x213),'sql','bff','page',a57_0x1864fb(0x22f),a57_0x1864fb(0x222),'schema',a57_0x1864fb(0x1dd),'artifact','kb',a57_0x1864fb(0x204),'workspace',a57_0x1864fb(0x218),a57_0x1864fb(0x210),a57_0x1864fb(0x1e3),a57_0x1864fb(0x220)],RABETBASE_INVOCATION=new RegExp(String['raw']`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS['join']('|')})\b`+String[a57_0x1864fb(0x208)]`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,'i');function isRabetbaseCliInvocation(_0x139035){const _0x3ac1e5=a57_0x1864fb,_0x2fc24b=_0x139035[_0x3ac1e5(0x20f)](/\brabetbase\b/i);if(_0x2fc24b<0x0)return![];const _0x46ff2a=_0x139035['slice'](_0x2fc24b)[_0x3ac1e5(0x1ec)](/\blovrabet\b/i)[0x0]??'';return RABETBASE_INVOCATION[_0x3ac1e5(0x216)](_0x46ff2a);}function a57_0x2228(_0x377169,_0x3bf5f8){_0x377169=_0x377169-0x1dc;const _0x28a192=a57_0x28a1();let _0x222806=_0x28a192[_0x377169];return _0x222806;}function parseFrontmatter(_0x14e284){const _0x2f1206=a57_0x1864fb,_0x2c6c14=_0x14e284[_0x2f1206(0x1e2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2c6c14)return{'hasFrontmatter':![]};const _0x581575=_0x2c6c14[0x1]??'',_0x22b16e={'hasFrontmatter':!![]};let _0x5d1def;try{_0x5d1def=a57_0x507c61(_0x581575);}catch{return _0x22b16e;}const _0x37abe1=asRecord(_0x5d1def);if(!_0x37abe1)return _0x22b16e;_0x22b16e[_0x2f1206(0x1f0)]=scalarToString(_0x37abe1[_0x2f1206(0x1f0)]),_0x22b16e[_0x2f1206(0x201)]=scalarToString(_0x37abe1[_0x2f1206(0x201)]),_0x22b16e[_0x2f1206(0x1e4)]=scalarToString(_0x37abe1[_0x2f1206(0x1e4)]),_0x22b16e[_0x2f1206(0x1fa)]=scalarToString(_0x37abe1['example']);const _0x6b3dd6=asRecord(_0x37abe1[_0x2f1206(0x1e9)]);return _0x6b3dd6&&(_0x22b16e[_0x2f1206(0x230)]=scalarToString(_0x6b3dd6[_0x2f1206(0x230)]),_0x22b16e[_0x2f1206(0x234)]=scalarToBoolean(_0x6b3dd6[_0x2f1206(0x234)])),_0x22b16e;}function asRecord(_0x1af999){const _0x3ca6d3=a57_0x1864fb;if(_0x1af999&&typeof _0x1af999===_0x3ca6d3(0x20b)&&!Array[_0x3ca6d3(0x1df)](_0x1af999))return _0x1af999;return undefined;}function scalarToString(_0x29346d){const _0x4963a6=a57_0x1864fb;if(typeof _0x29346d===_0x4963a6(0x1e1))return _0x29346d['trim']();if(typeof _0x29346d===_0x4963a6(0x1e6)||typeof _0x29346d===_0x4963a6(0x1e5))return String(_0x29346d);return undefined;}function scalarToBoolean(_0x753065){if(typeof _0x753065==='boolean')return _0x753065;if(typeof _0x753065==='string')return cleanBoolean(_0x753065);return undefined;}function cleanBoolean(_0xe57d1f){const _0x14a864=a57_0x1864fb,_0x348f86=_0xe57d1f[_0x14a864(0x1e7)]()[_0x14a864(0x231)]();if(_0x348f86===_0x14a864(0x238))return!![];if(_0x348f86===_0x14a864(0x1ea))return![];return undefined;}function issue(_0x116e76,_0x3fd128,_0x1e85b7,_0x5a8b03,_0x1d52c8,_0x5b827d){return{'level':_0x116e76,'ruleId':_0x3fd128,'file':_0x1e85b7,'section':_0x5b827d,'message':_0x5a8b03,'suggestion':_0x1d52c8};}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview `sql detail` command — inspects a custom SQL query by sqlCode.
3
+ *
4
+ * Why `SQLCODE_FLAG` (not `CODE_FLAG`): SQL query codes use the format
5
+ * `xxxxxxxx-xxxxxxxx` (with a hyphen), distinct from dataset 32-char hex codes.
6
+ * `SQLCODE_FLAG` provides the correct regex pattern.
7
+ *
8
+ * Why `getDbName()` is called even when `dbId` is absent: `sql.dbId` may be
9
+ * null for queries that don't target a specific database. We only call
10
+ * `getDbName()` when `dbId` is present to avoid unnecessary API calls.
11
+ */
12
+ import type { CommandDefinition } from "../../framework/types.js";
13
+ export declare const sqlDetail: CommandDefinition;
@@ -1 +1 @@
1
- const a57_0x3b463b=a57_0x3139;(function(_0x56b5e8,_0x2e2700){const _0x2fe0e7=a57_0x3139,_0x345574=_0x56b5e8();while(!![]){try{const _0x375aab=-parseInt(_0x2fe0e7(0x1a3))/0x1+-parseInt(_0x2fe0e7(0x1b1))/0x2*(parseInt(_0x2fe0e7(0x1a9))/0x3)+-parseInt(_0x2fe0e7(0x1ae))/0x4+-parseInt(_0x2fe0e7(0x1a5))/0x5*(-parseInt(_0x2fe0e7(0x1ac))/0x6)+parseInt(_0x2fe0e7(0x1aa))/0x7+-parseInt(_0x2fe0e7(0x1b4))/0x8*(-parseInt(_0x2fe0e7(0x1b2))/0x9)+parseInt(_0x2fe0e7(0x1a7))/0xa*(parseInt(_0x2fe0e7(0x1b0))/0xb);if(_0x375aab===_0x2e2700)break;else _0x345574['push'](_0x345574['shift']());}catch(_0xccca6b){_0x345574['push'](_0x345574['shift']());}}}(a57_0x24e5,0x3604f));import{getSqlQueryInfo}from'../../core/api-client.js';function a57_0x3139(_0x4aaed4,_0x278df0){_0x4aaed4=_0x4aaed4-0x1a3;const _0x24e5b0=a57_0x24e5();let _0x313929=_0x24e5b0[_0x4aaed4];return _0x313929;}function a57_0x24e5(){const _0x3971dd=['45oSSAOQ','2467416bmSYGy','sqlName','6fWXkms','read','623680kjXkES','description','553586BKtERf','30570UbhZkx','2439rFTcLw','verbose','4024BssHgG','sqlcode','str','300174RFikXg','dbId','1082635Bxgahz','detail','40dOtxbk','sqlContent'];a57_0x24e5=function(){return _0x3971dd;};return a57_0x24e5();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a57_0x3b463b(0x1a6),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a57_0x3b463b(0x1ad),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x163913){const _0x585c9d=a57_0x3b463b,_0x2fcb54=await getSqlQueryInfo(_0x163913['appCode'],_0x163913[_0x585c9d(0x1b6)](_0x585c9d(0x1b5))),_0x168ada=_0x163913['bool'](_0x585c9d(0x1b3));if(_0x168ada)return{'ok':!![],'data':_0x2fcb54};const _0x2544a9=_0x2fcb54['dbId']?await getDbName(_0x163913['appCode'],_0x2fcb54[_0x585c9d(0x1a4)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x2fcb54['sqlCode'],'sqlName':_0x2fcb54[_0x585c9d(0x1ab)],'db':_0x2544a9?_0x2544a9+'\x20('+_0x2fcb54[_0x585c9d(0x1a4)]+')':_0x2fcb54[_0x585c9d(0x1a4)]??'','description':_0x2fcb54[_0x585c9d(0x1af)]??'','sqlContent':_0x2fcb54[_0x585c9d(0x1a8)]??''}};}};
1
+ const a58_0x12230e=a58_0x5d3b;(function(_0x3e96be,_0x4abab9){const _0x5888d8=a58_0x5d3b,_0x29c937=_0x3e96be();while(!![]){try{const _0x3f35e2=parseInt(_0x5888d8(0x102))/0x1+-parseInt(_0x5888d8(0x10f))/0x2+parseInt(_0x5888d8(0x10c))/0x3*(-parseInt(_0x5888d8(0x111))/0x4)+parseInt(_0x5888d8(0x10a))/0x5*(parseInt(_0x5888d8(0x110))/0x6)+-parseInt(_0x5888d8(0x112))/0x7*(parseInt(_0x5888d8(0x105))/0x8)+parseInt(_0x5888d8(0x107))/0x9+parseInt(_0x5888d8(0x106))/0xa;if(_0x3f35e2===_0x4abab9)break;else _0x29c937['push'](_0x29c937['shift']());}catch(_0x1d2faa){_0x29c937['push'](_0x29c937['shift']());}}}(a58_0x1916,0xcfb72));import{getSqlQueryInfo}from'../../core/api-client.js';function a58_0x1916(){const _0x233d6a=['1184298mDqQPO','1953402dNuCmX','372VgDPMS','84pYYGrz','sqlName','243485lpPXAW','sqlCode','str','651544YyqrgV','21094020MKfGtc','4085091UdIPFV','bool','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','20JtGuCe','sqlcode','54477buERWd','dbId','appCode'];a58_0x1916=function(){return _0x233d6a;};return a58_0x1916();}function a58_0x5d3b(_0x2e0bea,_0x3a7167){_0x2e0bea=_0x2e0bea-0x101;const _0x1916fb=a58_0x1916();let _0x5d3b9d=_0x1916fb[_0x2e0bea];return _0x5d3b9d;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':'detail','description':a58_0x12230e(0x109),'risk':'read','flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x466e7b){const _0x2b4612=a58_0x12230e,_0x372741=await getSqlQueryInfo(_0x466e7b[_0x2b4612(0x10e)],_0x466e7b[_0x2b4612(0x104)](_0x2b4612(0x10b))),_0xcbc8b9=_0x466e7b[_0x2b4612(0x108)]('verbose');if(_0xcbc8b9)return{'ok':!![],'data':_0x372741};const _0x20cbaa=_0x372741[_0x2b4612(0x10d)]?await getDbName(_0x466e7b[_0x2b4612(0x10e)],_0x372741[_0x2b4612(0x10d)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x372741[_0x2b4612(0x103)],'sqlName':_0x372741[_0x2b4612(0x101)],'db':_0x20cbaa?_0x20cbaa+'\x20('+_0x372741[_0x2b4612(0x10d)]+')':_0x372741[_0x2b4612(0x10d)]??'','sqlContent':_0x372741['sqlContent']??''}};}};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @fileoverview `sql exec` command — executes a custom SQL query by sqlCode.
3
+ *
4
+ * Why `risk: "read"`: custom SQL queries can be destructive (DROP, TRUNCATE),
5
+ * but the runtime CLI cannot statically determine what a query does from its
6
+ * `sqlCode`. Using `"read"` avoids `--yes` prompts while the Studio-level
7
+ * permissions govern actual write access. Scripts that perform writes are
8
+ * expected to be permission-controlled at the platform level.
9
+ *
10
+ * Why `execSuccess` check: the Lovrabet SQL API returns `execSuccess: false`
11
+ * on query failure even when the HTTP status is 200. We surface this as an
12
+ * `ok: false` response so callers can distinguish success from failure in
13
+ * scripts without inspecting the data shape.
14
+ *
15
+ * Why returning `execResult` directly when it's not an array: the Lovrabet
16
+ * SQL API can return a single object (e.g. `SELECT 1` returns `{ "": 1 }`).
17
+ * We normalize this to always return a `rows` array, falling back to `[]`
18
+ * when the response is neither.
19
+ */
20
+ import type { CommandDefinition } from "../../framework/types.js";
21
+ export declare const sqlExec: CommandDefinition;
@@ -1 +1 @@
1
- const a58_0x35d1da=a58_0x10e2;(function(_0x2673d9,_0x56102e){const _0x586d27=a58_0x10e2,_0x1cb5a1=_0x2673d9();while(!![]){try{const _0x295023=-parseInt(_0x586d27(0x106))/0x1*(-parseInt(_0x586d27(0x110))/0x2)+-parseInt(_0x586d27(0x10e))/0x3+-parseInt(_0x586d27(0x10b))/0x4*(parseInt(_0x586d27(0x107))/0x5)+-parseInt(_0x586d27(0x118))/0x6*(-parseInt(_0x586d27(0x104))/0x7)+parseInt(_0x586d27(0x111))/0x8+-parseInt(_0x586d27(0x10a))/0x9+parseInt(_0x586d27(0x114))/0xa*(parseInt(_0x586d27(0x119))/0xb);if(_0x295023===_0x56102e)break;else _0x1cb5a1['push'](_0x1cb5a1['shift']());}catch(_0xf96a4c){_0x1cb5a1['push'](_0x1cb5a1['shift']());}}}(a58_0x50f3,0x796e3));import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a58_0x35d1da(0x112),'command':a58_0x35d1da(0x105),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a58_0x35d1da(0x10f),'flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x4a8667){const _0x264d88=a58_0x35d1da,_0x149a25=parseJsonParams(_0x4a8667['str'](_0x264d88(0x10d))),_0x5da7ed=Date[_0x264d88(0x103)](),_0x1d8a7c=await executeSdkSql(_0x4a8667[_0x264d88(0x102)](_0x264d88(0x115)),_0x149a25),_0x1b823d=Date['now']()-_0x5da7ed,_0x471f00=_0x1d8a7c?.['execResult']??_0x1d8a7c,_0x19fde0=_0x1d8a7c?.[_0x264d88(0x10c)]??!![];if(!_0x19fde0)return{'ok':![],'data':{'error':_0x1d8a7c?.['execError']||'SQL\x20execution\x20failed','elapsed':_0x1b823d},'message':_0x264d88(0x117)};const _0x59ca4a=Array[_0x264d88(0x113)](_0x471f00)?_0x471f00:[];return{'ok':!![],'data':{'rows':_0x59ca4a,'rowCount':_0x59ca4a[_0x264d88(0x108)],'elapsed':_0x1b823d},'message':_0x264d88(0x116)+_0x59ca4a[_0x264d88(0x108)]+_0x264d88(0x109)+_0x1b823d+'ms'};}};function a58_0x10e2(_0x2c0aed,_0x9e81be){_0x2c0aed=_0x2c0aed-0x102;const _0x50f3dc=a58_0x50f3();let _0x10e222=_0x50f3dc[_0x2c0aed];return _0x10e222;}function a58_0x50f3(){const _0x372f20=['288972fjijuf','execSuccess','params','1523319mdwTQQ','read','618622syCYmD','3752712VzRcud','sql','isArray','970JOoQeY','sqlcode','Returned\x20','SQL\x20execution\x20failed','72VqTbdR','130999Qaokzg','str','now','213507iImCwY','exec','1HsVlnh','45qcbOJy','length','\x20row(s)\x20in\x20','5798214KpRiMQ'];a58_0x50f3=function(){return _0x372f20;};return a58_0x50f3();}
1
+ function a59_0x39fc(_0x265a4d,_0x6ef457){_0x265a4d=_0x265a4d-0xd6;const _0x3d3624=a59_0x3d36();let _0x39fcc3=_0x3d3624[_0x265a4d];return _0x39fcc3;}const a59_0x12a3f4=a59_0x39fc;(function(_0x4aca04,_0x3ea234){const _0x4671a3=a59_0x39fc,_0x462a3c=_0x4aca04();while(!![]){try{const _0x399d3d=-parseInt(_0x4671a3(0xe5))/0x1+parseInt(_0x4671a3(0xda))/0x2+-parseInt(_0x4671a3(0xdb))/0x3+parseInt(_0x4671a3(0xe4))/0x4*(parseInt(_0x4671a3(0xea))/0x5)+-parseInt(_0x4671a3(0xe0))/0x6*(-parseInt(_0x4671a3(0xd6))/0x7)+-parseInt(_0x4671a3(0xd8))/0x8+-parseInt(_0x4671a3(0xd7))/0x9*(-parseInt(_0x4671a3(0xdd))/0xa);if(_0x399d3d===_0x3ea234)break;else _0x462a3c['push'](_0x462a3c['shift']());}catch(_0xa58baa){_0x462a3c['push'](_0x462a3c['shift']());}}}(a59_0x3d36,0x5b34c));import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a59_0x3d36(){const _0x1410b5=['str','sql','execSuccess','execResult','5UgVHEG','52262HUvDfk','5787jyQblg','3034376AkwfqP','exec','397924kpYyjO','2137956LbKIVS','params','16790vpAROt','sqlcode','SQL\x20execution\x20failed','384BqZJCT','now','read','length','799108ARyYEc','490631IcQxdh'];a59_0x3d36=function(){return _0x1410b5;};return a59_0x3d36();}export const sqlExec={'service':a59_0x12a3f4(0xe7),'command':a59_0x12a3f4(0xd9),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a59_0x12a3f4(0xe2),'flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x1b41fd){const _0x43bc6f=a59_0x12a3f4,_0x13c7b3=parseJsonParams(_0x1b41fd['str'](_0x43bc6f(0xdc))),_0x26e98b=Date[_0x43bc6f(0xe1)](),_0x946659=await executeSdkSql(_0x1b41fd[_0x43bc6f(0xe6)](_0x43bc6f(0xde)),_0x13c7b3),_0x3dd3fd=Date[_0x43bc6f(0xe1)]()-_0x26e98b,_0x543c88=_0x946659?.[_0x43bc6f(0xe9)]??_0x946659,_0x2e79f7=_0x946659?.[_0x43bc6f(0xe8)]??!![];if(!_0x2e79f7)return{'ok':![],'data':{'error':_0x946659?.['execError']||_0x43bc6f(0xdf),'elapsed':_0x3dd3fd},'message':_0x43bc6f(0xdf)};const _0x1a82dc=Array['isArray'](_0x543c88)?_0x543c88:[];return{'ok':!![],'data':{'rows':_0x1a82dc,'rowCount':_0x1a82dc[_0x43bc6f(0xe3)],'elapsed':_0x3dd3fd},'message':'Returned\x20'+_0x1a82dc[_0x43bc6f(0xe3)]+'\x20row(s)\x20in\x20'+_0x3dd3fd+'ms'};}};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @fileoverview `sql` command group — exports the declarative definition list.
3
+ *
4
+ * Mirrors the `bff/` pattern: runtime CLI provides SQL execution and inspection
5
+ * (not list/save, which belong to the development CLI). See `bff/index.ts`
6
+ * for the rationale.
7
+ */
8
+ import type { CommandDefinition } from "../../framework/types.js";
9
+ export declare const sqlDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- (function(_0x2d68c4,_0x1347c2){const _0x9b15e0=a59_0x1c63,_0xdea9fa=_0x2d68c4();while(!![]){try{const _0x275ba9=parseInt(_0x9b15e0(0x1b9))/0x1+-parseInt(_0x9b15e0(0x1be))/0x2*(parseInt(_0x9b15e0(0x1ba))/0x3)+parseInt(_0x9b15e0(0x1bc))/0x4+-parseInt(_0x9b15e0(0x1b7))/0x5+-parseInt(_0x9b15e0(0x1b8))/0x6+parseInt(_0x9b15e0(0x1bd))/0x7*(-parseInt(_0x9b15e0(0x1b6))/0x8)+-parseInt(_0x9b15e0(0x1bb))/0x9;if(_0x275ba9===_0x1347c2)break;else _0xdea9fa['push'](_0xdea9fa['shift']());}catch(_0x3e7bcf){_0xdea9fa['push'](_0xdea9fa['shift']());}}}(a59_0x599b,0xe0aaa));import{sqlDetail}from'../../commands/sql/detail.js';import{sqlExec}from'../../commands/sql/exec.js';function a59_0x1c63(_0x48a407,_0x152682){_0x48a407=_0x48a407-0x1b6;const _0x599b8f=a59_0x599b();let _0x1c635c=_0x599b8f[_0x48a407];return _0x1c635c;}function a59_0x599b(){const _0x13a293=['1595376qPmfVH','1043599ZtHMjl','81YeFzlC','3104055miEIqz','6918512aCXxQY','1507639gHjlxy','42622NBIwZi','8epsESE','2257140ZTEWJx'];a59_0x599b=function(){return _0x13a293;};return a59_0x599b();}export const sqlDefinitions=[sqlDetail,sqlExec];
1
+ (function(_0x34be56,_0x149b6b){const _0x3fed7a=a60_0x10e9,_0x3d4b71=_0x34be56();while(!![]){try{const _0x13ee6a=-parseInt(_0x3fed7a(0xbe))/0x1*(parseInt(_0x3fed7a(0xbc))/0x2)+-parseInt(_0x3fed7a(0xc0))/0x3*(parseInt(_0x3fed7a(0xbf))/0x4)+parseInt(_0x3fed7a(0xc4))/0x5+-parseInt(_0x3fed7a(0xc7))/0x6*(parseInt(_0x3fed7a(0xc3))/0x7)+-parseInt(_0x3fed7a(0xbd))/0x8+-parseInt(_0x3fed7a(0xc1))/0x9*(parseInt(_0x3fed7a(0xc6))/0xa)+-parseInt(_0x3fed7a(0xc2))/0xb*(-parseInt(_0x3fed7a(0xc5))/0xc);if(_0x13ee6a===_0x149b6b)break;else _0x3d4b71['push'](_0x3d4b71['shift']());}catch(_0x4e90ed){_0x3d4b71['push'](_0x3d4b71['shift']());}}}(a60_0x33ef,0xdf925));function a60_0x33ef(){const _0x376c92=['2114055eIRxhy','19692fFzfpw','9487160vEJPJu','6VfmTvc','10SPvSKn','8461336TFrusB','45711jUfHmM','8YwgjQb','631977LLiLhr','9RtjNPg','30327WUAOHV','9625301VbrNaB'];a60_0x33ef=function(){return _0x376c92;};return a60_0x33ef();}function a60_0x10e9(_0x1409b0,_0x1753f0){_0x1409b0=_0x1409b0-0xbc;const _0x33efce=a60_0x33ef();let _0x10e974=_0x33efce[_0x1409b0];return _0x10e974;}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlDetail,sqlExec];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @fileoverview `lovrabet update` self-update command.
3
+ *
4
+ * The runtime CLI intentionally checks npm dist-tags directly and does not use
5
+ * a CDN policy file. After the CLI package is checked or updated, the CLI
6
+ * Built-in Skill is refreshed best-effort so local agents stay aligned.
7
+ */
8
+ import type { CommandDefinition } from "../framework/types.js";
9
+ /** Self-update command definition. */
10
+ export declare const updateDefinition: CommandDefinition;
@@ -1 +1 @@
1
- const a60_0x33f42f=a60_0x1dd6;(function(_0x50ff95,_0x158b25){const _0x3a0c0b=a60_0x1dd6,_0x1cf114=_0x50ff95();while(!![]){try{const _0x30fb78=parseInt(_0x3a0c0b(0x1fb))/0x1+parseInt(_0x3a0c0b(0x1c3))/0x2+-parseInt(_0x3a0c0b(0x1cd))/0x3*(parseInt(_0x3a0c0b(0x1dd))/0x4)+-parseInt(_0x3a0c0b(0x1ba))/0x5*(parseInt(_0x3a0c0b(0x1bb))/0x6)+-parseInt(_0x3a0c0b(0x1be))/0x7+parseInt(_0x3a0c0b(0x1b6))/0x8*(parseInt(_0x3a0c0b(0x1c1))/0x9)+parseInt(_0x3a0c0b(0x1ff))/0xa*(parseInt(_0x3a0c0b(0x1c2))/0xb);if(_0x30fb78===_0x158b25)break;else _0x1cf114['push'](_0x1cf114['shift']());}catch(_0x195856){_0x1cf114['push'](_0x1cf114['shift']());}}}(a60_0xf2a2,0xa52df));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';function a60_0x1dd6(_0x463373,_0x8718a){_0x463373=_0x463373-0x1b5;const _0xf2a26d=a60_0xf2a2();let _0x1dd6d6=_0xf2a26d[_0x463373];return _0x1dd6d6;}function a60_0xf2a2(){const _0x460247=['Update\x20','warn','no-skills','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','skipped','Update\x20failed:\x20','cwd','inherit','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Already\x20up\x20to\x20date\x20(v','prerelease','update','fromEntries','run','string','filter','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','boolean','match','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','913670AULqOk','nonInteractive','toString','timeout','3142690lQtWed','trim','beta','Already\x20on\x20requested\x20version\x20(v','Install\x20a\x20specific\x20CLI\x20version','=1).','source','validation','exit\x20','48jktPvl','join','Version\x20comparison\x20failed.','error','20TnIfEV','1491216ZgYGGO','length','status','3209010gUJhED','minor','flag','1305117ymkveK','11nABbQz','1960224fZqGRW','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','Invalid\x20version:\x20','\x20CLI\x20from\x20npm','write','\x20->\x20','skills','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Updated\x20to\x20v','log','284694xPvyyD','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','stdout','str','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','args','version','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','map','Checking\x20CLI\x20Built-in\x20Skill...','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','Current\x20version:\x20','latest','patch','Unable\x20to\x20resolve\x20','40Urdgjw','stderr','install','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','bool','Checking\x20npm\x20dist-tags...','message','/-/package/','unknown','\x20\x20Run\x20manually:\x20lovrabet\x20cli-skill\x20install'];a60_0xf2a2=function(){return _0x460247;};return a60_0xf2a2();}import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a60_0x33f42f(0x1da),'type':a60_0x33f42f(0x1f8),'description':a60_0x33f42f(0x1d8),'default':![]},{'name':a60_0x33f42f(0x201),'type':a60_0x33f42f(0x1f8),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a60_0x33f42f(0x1d3),'type':a60_0x33f42f(0x1f5),'description':a60_0x33f42f(0x203)},{'name':'no-skills','type':a60_0x33f42f(0x1f8),'description':'Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','default':![]},{'name':a60_0x33f42f(0x1c9),'type':a60_0x33f42f(0x1f8),'description':a60_0x33f42f(0x1fa),'default':!![],'hidden':!![]}];function parseSemver(_0x32d523){const _0x35d98c=a60_0x33f42f,_0x2c11bb=_0x32d523['trim']()[_0x35d98c(0x1f9)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x2c11bb)return null;return{'major':Number(_0x2c11bb[0x1]),'minor':Number(_0x2c11bb[0x2]),'patch':Number(_0x2c11bb[0x3]),'prerelease':_0x2c11bb[0x4]};}function compareSemver(_0x580359,_0x5b0b1f){const _0x42fe6d=a60_0x33f42f,_0xaf9a8b=parseSemver(_0x580359),_0x502a27=parseSemver(_0x5b0b1f);if(!_0xaf9a8b||!_0x502a27)throw CliErrors[_0x42fe6d(0x206)](_0x42fe6d(0x1b8),_0x42fe6d(0x1ef));for(const _0x59ad2c of['major',_0x42fe6d(0x1bf),_0x42fe6d(0x1db)]){if(_0xaf9a8b[_0x59ad2c]<_0x502a27[_0x59ad2c])return-0x1;if(_0xaf9a8b[_0x59ad2c]>_0x502a27[_0x59ad2c])return 0x1;}if(!_0xaf9a8b[_0x42fe6d(0x1f1)]&&!_0x502a27[_0x42fe6d(0x1f1)])return 0x0;if(!_0xaf9a8b[_0x42fe6d(0x1f1)])return 0x1;if(!_0x502a27['prerelease'])return-0x1;if(_0xaf9a8b[_0x42fe6d(0x1f1)]===_0x502a27[_0x42fe6d(0x1f1)])return 0x0;return _0xaf9a8b[_0x42fe6d(0x1f1)]<_0x502a27['prerelease']?-0x1:0x1;}function getRequestedVersion(_0x131048){const _0x50eb16=a60_0x33f42f,_0x12dd3d=_0x131048[_0x50eb16(0x1d0)](_0x50eb16(0x1d3))[_0x50eb16(0x200)]();if(_0x12dd3d)return _0x12dd3d;return String(_0x131048[_0x50eb16(0x1d2)]?.[0x0]??'')[_0x50eb16(0x200)]();}function shouldSkipCliBuiltInSkill(_0x1afd80){const _0x34a46f=a60_0x33f42f;return _0x1afd80['bool'](_0x34a46f(0x1e9))||_0x1afd80[_0x34a46f(0x1c0)](_0x34a46f(0x1c9))===![];}async function validateUpdateFlags(_0x5b0517){const _0x114319=a60_0x33f42f,_0x335dda=getRequestedVersion(_0x5b0517),_0xb2f7bf=[_0x5b0517['bool'](_0x114319(0x1da))?_0x114319(0x1da):'',_0x5b0517['bool']('beta')?'beta':'',_0x335dda?_0x114319(0x1d3):''][_0x114319(0x1f6)](Boolean);if(_0xb2f7bf[_0x114319(0x1bc)]>0x1)throw CliErrors['validation'](_0x114319(0x1ea),_0x114319(0x1d7));if(_0x335dda&&!parseSemver(_0x335dda))throw CliErrors[_0x114319(0x206)](_0x114319(0x1c5)+_0x335dda,_0x114319(0x1f7));}async function fetchNpmDistTags(){const _0x27c985=a60_0x33f42f;try{const _0x1d0ea2=NPM_REGISTRY_BASE_URL+_0x27c985(0x1e4)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+'/dist-tags',_0x3b967d=await fetch(_0x1d0ea2,{'signal':AbortSignal[_0x27c985(0x1fe)](0x2710)});if(!_0x3b967d['ok'])return null;const _0x9a6cec=await _0x3b967d['json']();if(!_0x9a6cec||typeof _0x9a6cec!=='object')return null;return Object[_0x27c985(0x1f3)](Object['entries'](_0x9a6cec)['filter'](([,_0x3e0679])=>typeof _0x3e0679===_0x27c985(0x1f5)&&_0x3e0679['trim']())[_0x27c985(0x1d5)](([_0xd3cc7a,_0x5c7cbd])=>[_0xd3cc7a,String(_0x5c7cbd)[_0x27c985(0x200)]()]));}catch{return null;}}async function resolveTargetVersion(_0x16e8c5){const _0x3fdda8=a60_0x33f42f,_0x4dcd12=getRequestedVersion(_0x16e8c5);if(_0x4dcd12)return{'version':_0x4dcd12,'source':'version'};const _0x2d33af=_0x16e8c5[_0x3fdda8(0x1e1)]('beta')?_0x3fdda8(0x201):'latest',_0x1034cf=await fetchNpmDistTags(),_0x8c95e=_0x1034cf?.[_0x2d33af];if(!_0x8c95e)return null;return{'version':_0x8c95e,'source':_0x2d33af};}function shouldInstallTarget(_0x300d3b,_0xf5d2b1){const _0x517018=a60_0x33f42f,_0x181788=compareSemver(_0x300d3b,_0xf5d2b1['version']);if(_0xf5d2b1[_0x517018(0x205)]===_0x517018(0x1d3))return _0x181788!==0x0;return _0x181788<0x0;}function installCliPackage(_0x2e39bd,_0x4967f9){const _0x370c1b=a60_0x33f42f,_0x5417d8=resolveNpmBin('npm'),_0x54a437=[_0x370c1b(0x1df),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x2e39bd];console[_0x370c1b(0x1cc)]('*\x20'+[_0x5417d8,..._0x54a437][_0x370c1b(0x1b7)]('\x20'));const _0x544b37=spawnSync(_0x5417d8,_0x54a437,{'cwd':process[_0x370c1b(0x1ed)](),'stdio':_0x4967f9?'pipe':_0x370c1b(0x1ee),'env':process.env,'shell':![]});if(_0x544b37[_0x370c1b(0x1bd)]===0x0)return{'ok':!![]};let _0x440fde=_0x544b37['error']?.[_0x370c1b(0x1e3)]||_0x370c1b(0x1b5)+(_0x544b37[_0x370c1b(0x1bd)]??'unknown');if(_0x4967f9){const _0x12f9d9=_0x544b37[_0x370c1b(0x1de)]?_0x544b37[_0x370c1b(0x1de)][_0x370c1b(0x1fd)]()[_0x370c1b(0x200)]():'',_0x843684=_0x544b37[_0x370c1b(0x1cf)]?_0x544b37[_0x370c1b(0x1cf)]['toString']()[_0x370c1b(0x200)]():'';if(_0x12f9d9)_0x440fde=_0x12f9d9;else{if(_0x843684)_0x440fde=_0x843684;}}return{'ok':![],'error':_0x440fde};}async function installCliBuiltInSkill(_0x547918){const _0x32a726=a60_0x33f42f;console[_0x32a726(0x1cc)](_0x32a726(0x1d6));const _0xfd2ab=runNpxSkillsAddGlobal(process[_0x32a726(0x1ed)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x547918?'pipe':'inherit'});if(_0xfd2ab[_0x32a726(0x1eb)]){console['log']('\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20('+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x32a726(0x204));return;}if(_0xfd2ab['ok']){console[_0x32a726(0x1cc)](_0x32a726(0x1c4));return;}console[_0x32a726(0x1e8)](_0x32a726(0x1d1)+(_0xfd2ab[_0x32a726(0x1b9)]||'unknown')),console['log'](_0x32a726(0x1e6));}async function execute(_0x467e9f){const _0x231881=a60_0x33f42f;await validateUpdateFlags(_0x467e9f);const _0x1ad919=getCliVersion();console[_0x231881(0x1cc)](_0x231881(0x1d9)+_0x1ad919),console['log'](_0x231881(0x1e2));const _0x29e02b=await resolveTargetVersion(_0x467e9f);if(!_0x29e02b){const _0x10fca1=_0x467e9f[_0x231881(0x1e1)](_0x231881(0x201))?_0x231881(0x201):_0x231881(0x1da),_0xdc480b=_0x231881(0x1dc)+_0x10fca1+'\x20version\x20from\x20npm.';return console[_0x231881(0x1e8)](_0xdc480b),console['log'](_0x231881(0x1ce)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x10fca1),{'ok':![]};}if(!shouldInstallTarget(_0x1ad919,_0x29e02b)){const _0x4f34de=_0x29e02b[_0x231881(0x205)]===_0x231881(0x1d3)?_0x231881(0x202)+_0x29e02b[_0x231881(0x1d3)]+').':_0x231881(0x1f0)+_0x29e02b[_0x231881(0x1d3)]+').';return console[_0x231881(0x1cc)](_0x4f34de),shouldSkipCliBuiltInSkill(_0x467e9f)?console[_0x231881(0x1cc)](_0x231881(0x1e0)):await installCliBuiltInSkill(_0x467e9f['nonInteractive']),{'ok':!![]};}console[_0x231881(0x1cc)]('Updating\x20'+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x1ad919+_0x231881(0x1c8)+_0x29e02b[_0x231881(0x1d3)]);const _0x3c928d=installCliPackage(_0x29e02b['version'],_0x467e9f['nonInteractive']);if(!_0x3c928d['ok']){const _0x454700=_0x231881(0x1ec)+(_0x3c928d[_0x231881(0x1b9)]||_0x231881(0x1e5));return console[_0x231881(0x1b9)](_0x454700),console[_0x231881(0x1cc)](_0x231881(0x1d4)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x29e02b[_0x231881(0x1d3)]),{'ok':![]};}return console['log'](_0x231881(0x1cb)+_0x29e02b[_0x231881(0x1d3)]+'.'),console[_0x231881(0x1cc)](_0x231881(0x1ca)),shouldSkipCliBuiltInSkill(_0x467e9f)?console['log']('Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).'):await installCliBuiltInSkill(_0x467e9f[_0x231881(0x1fc)]),{'ok':!![]};}export const updateDefinition={'service':a60_0x33f42f(0x1f2),'command':a60_0x33f42f(0x1f4),'description':a60_0x33f42f(0x1e7)+CLI_BIN_NAME+a60_0x33f42f(0x1c6),'risk':a60_0x33f42f(0x1c7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
1
+ const a61_0x2173f4=a61_0x5e17;(function(_0x18d7f3,_0x3e37af){const _0x5c375c=a61_0x5e17,_0x464bc7=_0x18d7f3();while(!![]){try{const _0xd50ff9=parseInt(_0x5c375c(0x166))/0x1+parseInt(_0x5c375c(0x188))/0x2+parseInt(_0x5c375c(0x172))/0x3*(-parseInt(_0x5c375c(0x15d))/0x4)+-parseInt(_0x5c375c(0x17a))/0x5+-parseInt(_0x5c375c(0x15e))/0x6+parseInt(_0x5c375c(0x169))/0x7*(-parseInt(_0x5c375c(0x170))/0x8)+-parseInt(_0x5c375c(0x197))/0x9*(-parseInt(_0x5c375c(0x18c))/0xa);if(_0xd50ff9===_0x3e37af)break;else _0x464bc7['push'](_0x464bc7['shift']());}catch(_0x10d0f7){_0x464bc7['push'](_0x464bc7['shift']());}}}(a61_0x3d3f,0x89e85));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';function a61_0x3d3f(){const _0x5c8b3d=['Already\x20on\x20requested\x20version\x20(v','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Updated\x20to\x20v','4218435HDNtck','Version\x20comparison\x20failed.','exit\x20','Install\x20a\x20specific\x20CLI\x20version','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','entries','bool','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','validation','source','Checking\x20npm\x20dist-tags...','message','match','trim','366112rFOKYV','json','Current\x20version:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','54410HbkzhO','nonInteractive','stdout','major','Invalid\x20version:\x20','status','Already\x20up\x20to\x20date\x20(v','skills','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','pipe','filter','3330DFEEXJ','latest','\x20version\x20from\x20npm.','stderr','write','Update\x20failed:\x20','toString','str','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','Updating\x20','prerelease','=1).','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','inherit','string','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','boolean','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','minor','unknown','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','\x20->\x20','1667396KaAIJa','2569254TKQhPA','timeout','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','version','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','skipped','Checking\x20CLI\x20Built-in\x20Skill...','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','681002omftBR','object','npm','1447355REJgEA','warn','fromEntries','log','error','args','\x20\x20Run\x20manually:\x20lovrabet\x20cli-skill\x20install','8uUmJmj','join','6GcYLfj','patch','beta','cwd','no-skills'];a61_0x3d3f=function(){return _0x5c8b3d;};return a61_0x3d3f();}const updateFlags=[{'name':'latest','type':'boolean','description':a61_0x2173f4(0x181),'default':![]},{'name':a61_0x2173f4(0x174),'type':a61_0x2173f4(0x157),'description':a61_0x2173f4(0x158),'default':![]},{'name':a61_0x2173f4(0x161),'type':a61_0x2173f4(0x155),'description':a61_0x2173f4(0x17d)},{'name':'no-skills','type':a61_0x2173f4(0x157),'description':a61_0x2173f4(0x153),'default':![]},{'name':a61_0x2173f4(0x193),'type':a61_0x2173f4(0x157),'description':a61_0x2173f4(0x162),'default':!![],'hidden':!![]}];function parseSemver(_0x545656){const _0x50747a=a61_0x2173f4,_0x2cbe38=_0x545656[_0x50747a(0x187)]()[_0x50747a(0x186)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x2cbe38)return null;return{'major':Number(_0x2cbe38[0x1]),'minor':Number(_0x2cbe38[0x2]),'patch':Number(_0x2cbe38[0x3]),'prerelease':_0x2cbe38[0x4]};}function compareSemver(_0x93263f,_0x5e4f81){const _0x2048c2=a61_0x2173f4,_0x2a994b=parseSemver(_0x93263f),_0x40a98d=parseSemver(_0x5e4f81);if(!_0x2a994b||!_0x40a98d)throw CliErrors[_0x2048c2(0x182)](_0x2048c2(0x17b),_0x2048c2(0x156));for(const _0x27e002 of[_0x2048c2(0x18f),_0x2048c2(0x159),_0x2048c2(0x173)]){if(_0x2a994b[_0x27e002]<_0x40a98d[_0x27e002])return-0x1;if(_0x2a994b[_0x27e002]>_0x40a98d[_0x27e002])return 0x1;}if(!_0x2a994b[_0x2048c2(0x151)]&&!_0x40a98d[_0x2048c2(0x151)])return 0x0;if(!_0x2a994b[_0x2048c2(0x151)])return 0x1;if(!_0x40a98d[_0x2048c2(0x151)])return-0x1;if(_0x2a994b[_0x2048c2(0x151)]===_0x40a98d[_0x2048c2(0x151)])return 0x0;return _0x2a994b['prerelease']<_0x40a98d[_0x2048c2(0x151)]?-0x1:0x1;}function getRequestedVersion(_0xa3b906){const _0x547e2e=a61_0x2173f4,_0x992d7b=_0xa3b906[_0x547e2e(0x14e)](_0x547e2e(0x161))[_0x547e2e(0x187)]();if(_0x992d7b)return _0x992d7b;return String(_0xa3b906[_0x547e2e(0x16e)]?.[0x0]??'')[_0x547e2e(0x187)]();}function shouldSkipCliBuiltInSkill(_0x562340){const _0x406600=a61_0x2173f4;return _0x562340[_0x406600(0x180)](_0x406600(0x176))||_0x562340['flag'](_0x406600(0x193))===![];}async function validateUpdateFlags(_0x4c6cd5){const _0x3f2884=a61_0x2173f4,_0x39276e=getRequestedVersion(_0x4c6cd5),_0x1bf5fd=[_0x4c6cd5[_0x3f2884(0x180)](_0x3f2884(0x198))?_0x3f2884(0x198):'',_0x4c6cd5[_0x3f2884(0x180)](_0x3f2884(0x174))?_0x3f2884(0x174):'',_0x39276e?_0x3f2884(0x161):'']['filter'](Boolean);if(_0x1bf5fd['length']>0x1)throw CliErrors[_0x3f2884(0x182)](_0x3f2884(0x15b),_0x3f2884(0x17e));if(_0x39276e&&!parseSemver(_0x39276e))throw CliErrors[_0x3f2884(0x182)](_0x3f2884(0x190)+_0x39276e,_0x3f2884(0x178));}async function fetchNpmDistTags(){const _0x1cd043=a61_0x2173f4;try{const _0x479b0d=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+'/dist-tags',_0x171ac0=await fetch(_0x479b0d,{'signal':AbortSignal[_0x1cd043(0x15f)](0x2710)});if(!_0x171ac0['ok'])return null;const _0x13138d=await _0x171ac0[_0x1cd043(0x189)]();if(!_0x13138d||typeof _0x13138d!==_0x1cd043(0x167))return null;return Object[_0x1cd043(0x16b)](Object[_0x1cd043(0x17f)](_0x13138d)[_0x1cd043(0x196)](([,_0x56866b])=>typeof _0x56866b===_0x1cd043(0x155)&&_0x56866b[_0x1cd043(0x187)]())['map'](([_0x1b0707,_0x3e8575])=>[_0x1b0707,String(_0x3e8575)[_0x1cd043(0x187)]()]));}catch{return null;}}async function resolveTargetVersion(_0x3fc0c3){const _0x3ccba3=a61_0x2173f4,_0x30a9f4=getRequestedVersion(_0x3fc0c3);if(_0x30a9f4)return{'version':_0x30a9f4,'source':_0x3ccba3(0x161)};const _0x5985d0=_0x3fc0c3[_0x3ccba3(0x180)](_0x3ccba3(0x174))?_0x3ccba3(0x174):_0x3ccba3(0x198),_0x35a951=await fetchNpmDistTags(),_0x1e147a=_0x35a951?.[_0x5985d0];if(!_0x1e147a)return null;return{'version':_0x1e147a,'source':_0x5985d0};}function shouldInstallTarget(_0x240eaa,_0x447a0a){const _0x4fc316=a61_0x2173f4,_0x12c58c=compareSemver(_0x240eaa,_0x447a0a[_0x4fc316(0x161)]);if(_0x447a0a[_0x4fc316(0x183)]==='version')return _0x12c58c!==0x0;return _0x12c58c<0x0;}function installCliPackage(_0x527a30,_0x43c7ea){const _0x2a2b17=a61_0x2173f4,_0x481bed=resolveNpmBin(_0x2a2b17(0x168)),_0x38ec30=['install','-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x527a30];console[_0x2a2b17(0x16c)]('*\x20'+[_0x481bed,..._0x38ec30][_0x2a2b17(0x171)]('\x20'));const _0x4c75a5=spawnSync(_0x481bed,_0x38ec30,{'cwd':process['cwd'](),'stdio':_0x43c7ea?_0x2a2b17(0x195):_0x2a2b17(0x154),'env':process.env,'shell':![]});if(_0x4c75a5[_0x2a2b17(0x191)]===0x0)return{'ok':!![]};let _0x1c6823=_0x4c75a5[_0x2a2b17(0x16d)]?.[_0x2a2b17(0x185)]||_0x2a2b17(0x17c)+(_0x4c75a5[_0x2a2b17(0x191)]??_0x2a2b17(0x15a));if(_0x43c7ea){const _0x270302=_0x4c75a5[_0x2a2b17(0x19a)]?_0x4c75a5[_0x2a2b17(0x19a)][_0x2a2b17(0x14d)]()[_0x2a2b17(0x187)]():'',_0x33e228=_0x4c75a5[_0x2a2b17(0x18e)]?_0x4c75a5['stdout'][_0x2a2b17(0x14d)]()[_0x2a2b17(0x187)]():'';if(_0x270302)_0x1c6823=_0x270302;else{if(_0x33e228)_0x1c6823=_0x33e228;}}return{'ok':![],'error':_0x1c6823};}function a61_0x5e17(_0x3d8f73,_0x472699){_0x3d8f73=_0x3d8f73-0x14d;const _0x3d3f0f=a61_0x3d3f();let _0x5e1701=_0x3d3f0f[_0x3d8f73];return _0x5e1701;}async function installCliBuiltInSkill(_0x4cdafe){const _0x2aa87e=a61_0x2173f4;console[_0x2aa87e(0x16c)](_0x2aa87e(0x164));const _0x23f464=runNpxSkillsAddGlobal(process[_0x2aa87e(0x175)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x4cdafe?'pipe':_0x2aa87e(0x154)});if(_0x23f464[_0x2aa87e(0x163)]){console[_0x2aa87e(0x16c)]('\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20('+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x2aa87e(0x152));return;}if(_0x23f464['ok']){console['log'](_0x2aa87e(0x18b));return;}console[_0x2aa87e(0x16a)](_0x2aa87e(0x165)+(_0x23f464['error']||_0x2aa87e(0x15a))),console[_0x2aa87e(0x16c)](_0x2aa87e(0x16f));}async function execute(_0x54ea6c){const _0x2408d2=a61_0x2173f4;await validateUpdateFlags(_0x54ea6c);const _0x1fe137=getCliVersion();console[_0x2408d2(0x16c)](_0x2408d2(0x18a)+_0x1fe137),console['log'](_0x2408d2(0x184));const _0x288969=await resolveTargetVersion(_0x54ea6c);if(!_0x288969){const _0x4164a3=_0x54ea6c['bool']('beta')?_0x2408d2(0x174):_0x2408d2(0x198),_0x22537f='Unable\x20to\x20resolve\x20'+_0x4164a3+_0x2408d2(0x199);return console[_0x2408d2(0x16a)](_0x22537f),console['log'](_0x2408d2(0x160)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x4164a3),{'ok':![]};}if(!shouldInstallTarget(_0x1fe137,_0x288969)){const _0x2eb4ba=_0x288969[_0x2408d2(0x183)]==='version'?_0x2408d2(0x177)+_0x288969[_0x2408d2(0x161)]+').':_0x2408d2(0x192)+_0x288969[_0x2408d2(0x161)]+').';return console['log'](_0x2eb4ba),shouldSkipCliBuiltInSkill(_0x54ea6c)?console['log'](_0x2408d2(0x14f)):await installCliBuiltInSkill(_0x54ea6c[_0x2408d2(0x18d)]),{'ok':!![]};}console['log'](_0x2408d2(0x150)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x1fe137+_0x2408d2(0x15c)+_0x288969[_0x2408d2(0x161)]);const _0x358ac2=installCliPackage(_0x288969['version'],_0x54ea6c['nonInteractive']);if(!_0x358ac2['ok']){const _0x31d140=_0x2408d2(0x19c)+(_0x358ac2[_0x2408d2(0x16d)]||_0x2408d2(0x15a));return console[_0x2408d2(0x16d)](_0x31d140),console[_0x2408d2(0x16c)]('\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20'+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x288969['version']),{'ok':![]};}return console[_0x2408d2(0x16c)](_0x2408d2(0x179)+_0x288969[_0x2408d2(0x161)]+'.'),console[_0x2408d2(0x16c)](_0x2408d2(0x194)),shouldSkipCliBuiltInSkill(_0x54ea6c)?console[_0x2408d2(0x16c)]('Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).'):await installCliBuiltInSkill(_0x54ea6c[_0x2408d2(0x18d)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':'run','description':'Update\x20'+CLI_BIN_NAME+'\x20CLI\x20from\x20npm','risk':a61_0x2173f4(0x19b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};