@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,38 @@
1
+ /**
2
+ * @fileoverview `app` subcommand shared utilities — re-exports and helpers.
3
+ *
4
+ * Why this module exists: several `app/` commands need the same helpers
5
+ * (`readConfig`, `writeConfig`, `scopeLabel`, `enrichAppListItemsWithMergedSelection`).
6
+ * Rather than each command importing from `context.ts` directly (which creates
7
+ * coupling to the global env module), this module provides a stable re-export surface.
8
+ *
9
+ * Design decision: `enrichAppListItemsWithMergedSelection` is placed here rather
10
+ * than in `cache.ts` because it operates on the merged CLI snapshot from the
11
+ * pipeline, not on the raw cache. This keeps cache.ts focused on cache I/O only.
12
+ */
13
+ import { CLI_BIN_NAME } from "../../constant/cli.js";
14
+ import type { MergedCliSnapshot } from "../../framework/types.js";
15
+ export { CLI_BIN_NAME };
16
+ /**
17
+ * Marks which app in the list is "current" based on the merged CLI snapshot.
18
+ *
19
+ * Why this is a mutation: the list items are objects passed by reference from
20
+ * the caller (`app list`). Mutating them in-place is simpler and faster than
21
+ * reconstructing a new array. The caller has no use for the unmarked list anyway.
22
+ *
23
+ * Current is determined by:
24
+ * - If a named app is selected (`currentApp` or `defaultApp`), the matching named item wins
25
+ * - If only `appCode` is set (no named selection), the item with the matching code wins
26
+ *
27
+ * @param items - List items from the remote API response
28
+ * @param merged - Merged CLI snapshot from the pipeline context
29
+ */
30
+ export declare function enrichAppListItemsWithMergedSelection(items: Record<string, unknown>[], merged: MergedCliSnapshot | undefined): void;
31
+ export { readScopedConfig as readConfig, writeScopedConfig as writeConfig, isInProject } from "../../context.js";
32
+ /**
33
+ * Formats a human-readable scope label for console output.
34
+ *
35
+ * @param flags - Must contain a `global` boolean key
36
+ * @returns Human label like " [global]" or "" (empty for project)
37
+ */
38
+ export declare function scopeLabel(flags: Record<string, any>): string;
@@ -1 +1 @@
1
- function a7_0x7c5c(){const _0x275d4f=['defaultApp','local','2222670lDwfpm','4FUJLPn','7YcfJvN','named','1560210RHMWRE','23669091nAxGfc','1303056BHehAQ','name','find','1045886rWkURH','definedIn','project','appcode','6959864cvJrwo','isCurrent','global','trim','89255hpZBfY'];a7_0x7c5c=function(){return _0x275d4f;};return a7_0x7c5c();}(function(_0x256488,_0x2540be){const _0x378426=a7_0x3aa1,_0x5b7644=_0x256488();while(!![]){try{const _0x4df501=-parseInt(_0x378426(0x1bd))/0x1+-parseInt(_0x378426(0x1c0))/0x2+-parseInt(_0x378426(0x1cb))/0x3+parseInt(_0x378426(0x1b8))/0x4*(-parseInt(_0x378426(0x1c8))/0x5)+parseInt(_0x378426(0x1bb))/0x6*(-parseInt(_0x378426(0x1b9))/0x7)+parseInt(_0x378426(0x1c4))/0x8+parseInt(_0x378426(0x1bc))/0x9;if(_0x4df501===_0x2540be)break;else _0x5b7644['push'](_0x5b7644['shift']());}catch(_0x4910a6){_0x5b7644['push'](_0x5b7644['shift']());}}}(a7_0x7c5c,0x9ff03));import{CLI_BIN_NAME}from'../../constant/cli.js';import{formatScopeLabel}from'../../commands/common/config-policy.js';function a7_0x3aa1(_0x298370,_0x4bd9b3){_0x298370=_0x298370-0x1b8;const _0x7c5cb8=a7_0x7c5c();let _0x3aa1d2=_0x7c5cb8[_0x298370];return _0x3aa1d2;}export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x33545f,_0x1e61f6){const _0x18b58f=a7_0x3aa1;if(!_0x1e61f6)return;const _0x1710f2=!!(_0x1e61f6['currentApp']??_0x1e61f6['defaultApp']);for(const _0x12877f of _0x33545f){_0x12877f['isCurrent']=![];}const _0x812519=_0x1e61f6['appCode']!=null?String(_0x1e61f6['appCode'])['trim']():'';if(_0x1710f2){const _0x32f125=_0x1e61f6['currentApp']??_0x1e61f6[_0x18b58f(0x1c9)];if(_0x32f125){const _0x18a469=_0x33545f[_0x18b58f(0x1bf)](_0x306c26=>_0x306c26[_0x18b58f(0x1ba)]===!![]&&_0x306c26[_0x18b58f(0x1be)]===_0x32f125&&_0x306c26[_0x18b58f(0x1c1)]===_0x18b58f(0x1ca)),_0x3c68c7=_0x18a469??_0x33545f['find'](_0x542d79=>_0x542d79[_0x18b58f(0x1ba)]===!![]&&_0x542d79[_0x18b58f(0x1be)]===_0x32f125);if(_0x3c68c7){const _0x43200c=String(_0x3c68c7[_0x18b58f(0x1c3)]??'')[_0x18b58f(0x1c7)]();if(!_0x812519||_0x43200c===_0x812519){_0x3c68c7['isCurrent']=!![];return;}}}if(_0x812519){const _0x1ad027=_0x33545f[_0x18b58f(0x1bf)](_0x4f0e6c=>String(_0x4f0e6c[_0x18b58f(0x1c3)]??'')['trim']()===_0x812519);_0x1ad027&&(_0x1ad027[_0x18b58f(0x1c5)]=!![]);}return;}if(!_0x812519)return;for(const _0x25451a of _0x33545f){String(_0x25451a[_0x18b58f(0x1c3)]??'')['trim']()===_0x812519&&(_0x25451a['isCurrent']=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x3d49a5){const _0x2b1113=a7_0x3aa1;return formatScopeLabel(_0x3d49a5[_0x2b1113(0x1c6)]?'global':_0x2b1113(0x1c2));}
1
+ function a7_0x225b(_0x36b0f8,_0x50d049){_0x36b0f8=_0x36b0f8-0x156;const _0x2cdd2c=a7_0x2cdd();let _0x225b84=_0x2cdd2c[_0x36b0f8];return _0x225b84;}(function(_0x40aee0,_0x589512){const _0x2695af=a7_0x225b,_0x21bed4=_0x40aee0();while(!![]){try{const _0x29db3a=parseInt(_0x2695af(0x164))/0x1*(-parseInt(_0x2695af(0x166))/0x2)+-parseInt(_0x2695af(0x16a))/0x3*(-parseInt(_0x2695af(0x16d))/0x4)+parseInt(_0x2695af(0x156))/0x5*(parseInt(_0x2695af(0x160))/0x6)+parseInt(_0x2695af(0x15b))/0x7*(parseInt(_0x2695af(0x159))/0x8)+parseInt(_0x2695af(0x169))/0x9+parseInt(_0x2695af(0x158))/0xa+-parseInt(_0x2695af(0x15c))/0xb*(parseInt(_0x2695af(0x161))/0xc);if(_0x29db3a===_0x589512)break;else _0x21bed4['push'](_0x21bed4['shift']());}catch(_0x2414ef){_0x21bed4['push'](_0x21bed4['shift']());}}}(a7_0x2cdd,0xcb755));function a7_0x2cdd(){const _0xf3f2f1=['5DGQunW','name','11473480ziBMQA','560oloDmt','appcode','118566zRXggg','693LLcvWd','project','trim','currentApp','3949662qrxsxj','380172yxDfDd','appCode','find','953551WHcDRd','named','2egiRHG','local','definedIn','3463092gSHfHp','135582ODMwEA','isCurrent','global','36usNeKW'];a7_0x2cdd=function(){return _0xf3f2f1;};return a7_0x2cdd();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{formatScopeLabel}from'../../commands/common/config-policy.js';export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x5b4d3e,_0x573133){const _0x392e4c=a7_0x225b;if(!_0x573133)return;const _0x557f55=!!(_0x573133[_0x392e4c(0x15f)]??_0x573133['defaultApp']);for(const _0x4551fa of _0x5b4d3e){_0x4551fa[_0x392e4c(0x16b)]=![];}const _0x46c92f=_0x573133[_0x392e4c(0x162)]!=null?String(_0x573133[_0x392e4c(0x162)])[_0x392e4c(0x15e)]():'';if(_0x557f55){const _0x327827=_0x573133['currentApp']??_0x573133['defaultApp'];if(_0x327827){const _0x3b1527=_0x5b4d3e[_0x392e4c(0x163)](_0x62a160=>_0x62a160[_0x392e4c(0x165)]===!![]&&_0x62a160[_0x392e4c(0x157)]===_0x327827&&_0x62a160[_0x392e4c(0x168)]===_0x392e4c(0x167)),_0x5d49c7=_0x3b1527??_0x5b4d3e[_0x392e4c(0x163)](_0x233ab2=>_0x233ab2[_0x392e4c(0x165)]===!![]&&_0x233ab2[_0x392e4c(0x157)]===_0x327827);if(_0x5d49c7){const _0x5ca618=String(_0x5d49c7[_0x392e4c(0x15a)]??'')[_0x392e4c(0x15e)]();if(!_0x46c92f||_0x5ca618===_0x46c92f){_0x5d49c7[_0x392e4c(0x16b)]=!![];return;}}}if(_0x46c92f){const _0x41b376=_0x5b4d3e[_0x392e4c(0x163)](_0x131bd3=>String(_0x131bd3[_0x392e4c(0x15a)]??'')['trim']()===_0x46c92f);_0x41b376&&(_0x41b376[_0x392e4c(0x16b)]=!![]);}return;}if(!_0x46c92f)return;for(const _0x1920a8 of _0x5b4d3e){String(_0x1920a8[_0x392e4c(0x15a)]??'')['trim']()===_0x46c92f&&(_0x1920a8[_0x392e4c(0x16b)]=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x454e8a){const _0xafecaa=a7_0x225b;return formatScopeLabel(_0x454e8a[_0xafecaa(0x16c)]?_0xafecaa(0x16c):_0xafecaa(0x15d));}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const appConfigGet: CommandDefinition;
@@ -1 +1 @@
1
- function a8_0x5932(_0x2e3074,_0x598af0){_0x2e3074=_0x2e3074-0x182;const _0x490316=a8_0x4903();let _0x5932d7=_0x490316[_0x2e3074];return _0x5932d7;}function a8_0x4903(){const _0x556273=['259athacU','15497JrUQxW','348zPdzfn','trim','195032FbcoeF','18488RzZMMP','App\x20config\x20key','20HPnMWO','142mdHcMW','appCode','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','app-config','4693955FuCoTW','Usage:\x20','\x20app-config\x20get\x20<key>','Unable\x20to\x20get\x20app-config\x20value:\x20key=','6frCVIY','8340132lThQFm','11440429itgRdT','args','13uyHqzE','get','2961027QWsyix','validation','Missing\x20app-config\x20key.'];a8_0x4903=function(){return _0x556273;};return a8_0x4903();}const a8_0x46326d=a8_0x5932;(function(_0x3a2e79,_0x19f7f4){const _0x605aea=a8_0x5932,_0x66b42e=_0x3a2e79();while(!![]){try{const _0x1f80a6=parseInt(_0x605aea(0x199))/0x1*(parseInt(_0x605aea(0x187))/0x2)+parseInt(_0x605aea(0x19a))/0x3*(parseInt(_0x605aea(0x184))/0x4)+-parseInt(_0x605aea(0x18b))/0x5*(-parseInt(_0x605aea(0x18f))/0x6)+parseInt(_0x605aea(0x198))/0x7*(-parseInt(_0x605aea(0x183))/0x8)+parseInt(_0x605aea(0x195))/0x9*(parseInt(_0x605aea(0x186))/0xa)+-parseInt(_0x605aea(0x191))/0xb+parseInt(_0x605aea(0x190))/0xc*(-parseInt(_0x605aea(0x193))/0xd);if(_0x1f80a6===_0x19f7f4)break;else _0x66b42e['push'](_0x66b42e['shift']());}catch(_0xe19b53){_0x66b42e['push'](_0x66b42e['shift']());}}}(a8_0x4903,0x918c3));import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':a8_0x46326d(0x18a),'command':a8_0x46326d(0x194),'description':'Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','risk':'read','args':[{'name':'key','description':a8_0x46326d(0x185),'required':!![]}],'flags':[],async 'execute'(_0xfb444f){const _0x242004=a8_0x46326d,_0x4bde1a=_0xfb444f[_0x242004(0x192)][0x0]?.[_0x242004(0x182)]();if(!_0x4bde1a)throw CliErrors[_0x242004(0x196)](_0x242004(0x197),_0x242004(0x18c)+CLI_BIN_NAME+_0x242004(0x18d));try{const _0x229635=await getRuntimeAppConfigByKey(_0xfb444f[_0x242004(0x188)],_0x4bde1a);return{'ok':!![],'data':_0x229635};}catch{throw CliErrors['apiError'](_0x242004(0x18e)+_0x4bde1a+',\x20appCode='+_0xfb444f[_0x242004(0x188)],_0x242004(0x189));}}};
1
+ function a8_0x48bb(_0x35e18e,_0x9d2df8){_0x35e18e=_0x35e18e-0x6d;const _0x284b0e=a8_0x284b();let _0x48bbc0=_0x284b0e[_0x35e18e];return _0x48bbc0;}const a8_0x422419=a8_0x48bb;(function(_0x4a6590,_0x46c934){const _0xf380ad=a8_0x48bb,_0x287b5c=_0x4a6590();while(!![]){try{const _0x4cadb9=-parseInt(_0xf380ad(0x70))/0x1*(-parseInt(_0xf380ad(0x80))/0x2)+parseInt(_0xf380ad(0x76))/0x3*(-parseInt(_0xf380ad(0x74))/0x4)+-parseInt(_0xf380ad(0x75))/0x5+parseInt(_0xf380ad(0x72))/0x6+-parseInt(_0xf380ad(0x7c))/0x7*(-parseInt(_0xf380ad(0x71))/0x8)+-parseInt(_0xf380ad(0x7d))/0x9*(-parseInt(_0xf380ad(0x7e))/0xa)+-parseInt(_0xf380ad(0x73))/0xb;if(_0x4cadb9===_0x46c934)break;else _0x287b5c['push'](_0x287b5c['shift']());}catch(_0x9f28a9){_0x287b5c['push'](_0x287b5c['shift']());}}}(a8_0x284b,0xcf476));import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a8_0x284b(){const _0x2d4058=[',\x20appCode=','\x20app-config\x20get\x20<key>','178SbhEXE','2488UfkXZl','52206qHFrnX','8550113cbHGVg','122088rPWtRc','4831485TKOMUc','9XoqIvf','Usage:\x20','Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','Unable\x20to\x20get\x20app-config\x20value:\x20key=','get','key','27461oifpeO','993294oTTrpg','130bCmZRi','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','232fKmXlQ','Missing\x20app-config\x20key.','read','validation','appCode','App\x20config\x20key'];a8_0x284b=function(){return _0x2d4058;};return a8_0x284b();}import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':'app-config','command':a8_0x422419(0x7a),'description':a8_0x422419(0x78),'risk':a8_0x422419(0x82),'args':[{'name':a8_0x422419(0x7b),'description':a8_0x422419(0x6d),'required':!![]}],'flags':[],async 'execute'(_0xc6b805){const _0x3adc2f=a8_0x422419,_0x1e7800=_0xc6b805['args'][0x0]?.['trim']();if(!_0x1e7800)throw CliErrors[_0x3adc2f(0x83)](_0x3adc2f(0x81),_0x3adc2f(0x77)+CLI_BIN_NAME+_0x3adc2f(0x6f));try{const _0xd2ce9a=await getRuntimeAppConfigByKey(_0xc6b805[_0x3adc2f(0x84)],_0x1e7800);return{'ok':!![],'data':_0xd2ce9a};}catch{throw CliErrors['apiError'](_0x3adc2f(0x79)+_0x1e7800+_0x3adc2f(0x6e)+_0xc6b805[_0x3adc2f(0x84)],_0x3adc2f(0x7f));}}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const appConfigDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- function a9_0x44d0(){const _0x5afbc1=['277921luszHm','1986390IYfVpk','1075619JFHdJH','311464OArwuj','5ZmjzcI','126jzlLex','513896aSBVCO','3824631nExlyw','7139260pjdhIy','2fueKsN'];a9_0x44d0=function(){return _0x5afbc1;};return a9_0x44d0();}(function(_0x367571,_0x16da26){const _0x284cb9=a9_0x2a6b,_0x47946c=_0x367571();while(!![]){try{const _0x28a24d=-parseInt(_0x284cb9(0x76))/0x1*(-parseInt(_0x284cb9(0x73))/0x2)+-parseInt(_0x284cb9(0x75))/0x3+parseInt(_0x284cb9(0x7a))/0x4*(-parseInt(_0x284cb9(0x78))/0x5)+-parseInt(_0x284cb9(0x79))/0x6*(parseInt(_0x284cb9(0x74))/0x7)+-parseInt(_0x284cb9(0x77))/0x8+parseInt(_0x284cb9(0x7b))/0x9+parseInt(_0x284cb9(0x72))/0xa;if(_0x28a24d===_0x16da26)break;else _0x47946c['push'](_0x47946c['shift']());}catch(_0x5b4600){_0x47946c['push'](_0x47946c['shift']());}}}(a9_0x44d0,0x86924));function a9_0x2a6b(_0xdd8c0f,_0xe9f4e3){_0xdd8c0f=_0xdd8c0f-0x72;const _0x44d08f=a9_0x44d0();let _0x2a6be1=_0x44d08f[_0xdd8c0f];return _0x2a6be1;}import{appConfigGet}from'../../commands/app-config/get.js';export const appConfigDefinitions=[appConfigGet];
1
+ function a9_0x16fd(_0x5a8868,_0x169ef9){_0x5a8868=_0x5a8868-0xf1;const _0x525d32=a9_0x525d();let _0x16fd38=_0x525d32[_0x5a8868];return _0x16fd38;}(function(_0xdf211,_0x4df65d){const _0x4f229a=a9_0x16fd,_0x2885fe=_0xdf211();while(!![]){try{const _0x1e6109=parseInt(_0x4f229a(0xf5))/0x1+parseInt(_0x4f229a(0xf6))/0x2*(parseInt(_0x4f229a(0xf7))/0x3)+-parseInt(_0x4f229a(0xf3))/0x4+-parseInt(_0x4f229a(0xf9))/0x5+-parseInt(_0x4f229a(0xf1))/0x6*(parseInt(_0x4f229a(0xf2))/0x7)+-parseInt(_0x4f229a(0xf4))/0x8+parseInt(_0x4f229a(0xf8))/0x9;if(_0x1e6109===_0x4df65d)break;else _0x2885fe['push'](_0x2885fe['shift']());}catch(_0x1d591d){_0x2885fe['push'](_0x2885fe['shift']());}}}(a9_0x525d,0xc9092));import{appConfigGet}from'../../commands/app-config/get.js';export const appConfigDefinitions=[appConfigGet];function a9_0x525d(){const _0x84e82=['6116900wbWYPo','4696398rZHYZi','7ARuoAp','6471092CMrrIj','1061040MlJvGT','1062349tigmVT','1622FuHijo','6081gsBiGf','16863408riOoZE'];a9_0x525d=function(){return _0x84e82;};return a9_0x525d();}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 本文件定义当前应用下 react_module Artifact 的查询、创建和更新命令。
3
+ * 写入命令从本地文件读取源码,使生成内容可在 sandbox 中审阅,并避免通过命令参数泄露长文本。
4
+ */
5
+ import type { CommandDefinition } from "../../framework/types.js";
6
+ export declare const ALLOWED_REACT_MODULE_IMPORTS_TEXT: string;
7
+ /** 校验源码是非空、可嵌入且只使用允许依赖的 React 模块。 */
8
+ export declare function validateReactModuleSource(content: string): void;
9
+ export declare const artifactDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- const a10_0xeb854d=a10_0x5151;function a10_0x5151(_0x441bb6,_0x463b27){_0x441bb6=_0x441bb6-0x108;const _0x8da1d=a10_0x8da1();let _0x515141=_0x8da1d[_0x441bb6];return _0x515141;}(function(_0xefa0e,_0x478333){const _0x3382eb=a10_0x5151,_0x1b5a9d=_0xefa0e();while(!![]){try{const _0x3735c3=parseInt(_0x3382eb(0x130))/0x1+-parseInt(_0x3382eb(0x110))/0x2*(parseInt(_0x3382eb(0x13c))/0x3)+parseInt(_0x3382eb(0x11b))/0x4+parseInt(_0x3382eb(0x12e))/0x5*(-parseInt(_0x3382eb(0x125))/0x6)+parseInt(_0x3382eb(0x154))/0x7+parseInt(_0x3382eb(0x12f))/0x8+parseInt(_0x3382eb(0x127))/0x9*(-parseInt(_0x3382eb(0x126))/0xa);if(_0x3735c3===_0x478333)break;else _0x1b5a9d['push'](_0x1b5a9d['shift']());}catch(_0xa8a3e9){_0x1b5a9d['push'](_0x1b5a9d['shift']());}}}(a10_0x8da1,0xa60cb));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a10_0xeb854d(0x135),ARTIFACT_SOURCE_AGENT=a10_0xeb854d(0x128),ALLOWED_REACT_MODULE_IMPORTS=['react','react-dom',a10_0xeb854d(0x155),a10_0xeb854d(0x118),'antd',a10_0xeb854d(0x14e)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a10_0xeb854d(0x159)](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':'file','type':a10_0xeb854d(0x114),'required':!![],'description':a10_0xeb854d(0x149)},ARTIFACT_NAME_FLAG={'name':a10_0xeb854d(0x116),'type':a10_0xeb854d(0x114),'description':a10_0xeb854d(0x145)},METADATA_FLAG={'name':a10_0xeb854d(0x10d),'type':a10_0xeb854d(0x114),'description':'Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped'};function isPlainObject(_0x2060b9){const _0x55be88=a10_0xeb854d;return typeof _0x2060b9===_0x55be88(0x153)&&_0x2060b9!==null&&!Array[_0x55be88(0x124)](_0x2060b9);}function readSourceFile(_0x25fabd){const _0xc7e752=a10_0xeb854d;if(!_0x25fabd)throw CliErrors[_0xc7e752(0x129)](_0xc7e752(0x117));if(!existsSync(_0x25fabd))throw CliErrors[_0xc7e752(0x129)](_0xc7e752(0x12d)+_0x25fabd);if(!statSync(_0x25fabd)[_0xc7e752(0x14d)]())throw CliErrors[_0xc7e752(0x129)](_0xc7e752(0x157)+_0x25fabd);const _0x52383b=readFileSync(_0x25fabd,_0xc7e752(0x158));return validateReactModuleSource(_0x52383b),_0x52383b;}function parseMetadata(_0x34eda5){const _0x4f4390=a10_0xeb854d;if(!_0x34eda5)return undefined;let _0x500fdb;try{_0x500fdb=JSON[_0x4f4390(0x13a)](_0x34eda5);}catch{throw CliErrors[_0x4f4390(0x129)](_0x4f4390(0x139)+_0x34eda5);}if(!isPlainObject(_0x500fdb))throw CliErrors[_0x4f4390(0x129)](_0x4f4390(0x111));const _0x34a6d9={..._0x500fdb};return delete _0x34a6d9[_0x4f4390(0x121)],_0x34a6d9;}function getPackageName(_0x524cb9){const _0x2df77d=a10_0xeb854d;if(_0x524cb9[_0x2df77d(0x137)]('@')){const [_0x46ab15,_0xa2b16d]=_0x524cb9[_0x2df77d(0x14c)]('/');return _0x46ab15&&_0xa2b16d?_0x46ab15+'/'+_0xa2b16d:_0x524cb9;}return _0x524cb9[_0x2df77d(0x14c)]('/')[0x0]||_0x524cb9;}function a10_0x8da1(){const _0x38bef9=['Invalid\x20JSON\x20for\x20--metadata:\x20','parse','filter','48WHsIhz','Artifact\x20source\x20file\x20is\x20blank.','list','deleted','/update','write','verbose','Created\x20Artifact\x20','POST','Artifact\x20display\x20name','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','body','some','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','description','Show\x20one\x20Artifact\x20by\x20id','split','isFile','@ant-design/icons','trim','Preview:\x20create\x20react_module\x20Artifact','exec','artifact','object','6574820BAYINA','lodash','artifactType','File\x20is\x20not\x20a\x20regular\x20file:\x20','utf8','join','Artifact\x20ID','num','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','flag','str','metadata','createTime','map','114472aqWCmA','--metadata\x20must\x20be\x20a\x20JSON\x20object.','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','string','appCode','name','File\x20path\x20is\x20required.','dayjs','file','bool','2140880vZDLIl','length','react_module\x20imports\x20are\x20limited\x20to:\x20','detail','.\x20Unsupported:\x20','/client/artifact/','compiledContent','read','List\x20current-app\x20react_module\x20Artifacts','isArray','24kJOCyU','7960EaySOb','8010YpiUeV','AGENT','validation','Updated\x20Artifact\x20','favorite','/client/artifact/create','File\x20not\x20found:\x20','740865MqgMUA','2098352zSYnQP','1160273fatogb','build','create','updateTime','content','react_module','source','startsWith','Preview:\x20update\x20react_module\x20Artifact\x20'];a10_0x8da1=function(){return _0x38bef9;};return a10_0x8da1();}function validateAllowedImports(_0x7403b4){const _0x1b1448=a10_0xeb854d,_0x2834a9=new Set();for(const _0x1e1839 of IMPORT_SOURCE_PATTERNS){_0x1e1839['lastIndex']=0x0;let _0x2400a3;while((_0x2400a3=_0x1e1839[_0x1b1448(0x151)](_0x7403b4))!==null){const _0xd7eec1=_0x2400a3[0x1]?.[_0x1b1448(0x14f)]();_0xd7eec1&&_0x2834a9['add'](_0xd7eec1);}}const _0x44781d=[..._0x2834a9][_0x1b1448(0x10f)](getPackageName)[_0x1b1448(0x13b)](_0x273988=>!ALLOWED_REACT_MODULE_IMPORTS['includes'](_0x273988));if(_0x44781d['length']>0x0)throw CliErrors[_0x1b1448(0x129)](_0x1b1448(0x11d)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x1b1448(0x11f)+[...new Set(_0x44781d)][_0x1b1448(0x159)](',\x20'));}export function validateReactModuleSource(_0x3ce90a){const _0x58d372=a10_0xeb854d;if(!_0x3ce90a[_0x58d372(0x14f)]())throw CliErrors[_0x58d372(0x129)](_0x58d372(0x13d));if(PAGE_LEVEL_PATTERNS[_0x58d372(0x148)](_0x26ff33=>_0x26ff33['test'](_0x3ce90a)))throw CliErrors[_0x58d372(0x129)](_0x58d372(0x10a));validateAllowedImports(_0x3ce90a);}function buildArtifactInput(_0x13ee32){const _0x1cf365=a10_0xeb854d,_0x1f8b4a=readSourceFile(_0x13ee32['str'](_0x1cf365(0x119))),_0x5ed0ed=_0x13ee32[_0x1cf365(0x10c)]('name')[_0x1cf365(0x14f)](),_0x27470a=parseMetadata(_0x13ee32[_0x1cf365(0x10c)]('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x5ed0ed?{'name':_0x5ed0ed}:{},'content':_0x1f8b4a,..._0x27470a?{'metadata':_0x27470a}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x51d1e3){const _0x4d8ee5=a10_0xeb854d;return{'id':_0x51d1e3['id'],'name':_0x51d1e3[_0x4d8ee5(0x116)],'artifactType':_0x51d1e3[_0x4d8ee5(0x156)],'source':_0x51d1e3[_0x4d8ee5(0x136)],'favorite':_0x51d1e3[_0x4d8ee5(0x12b)],'deleted':_0x51d1e3['deleted'],'createTime':_0x51d1e3['createTime'],'updateTime':_0x51d1e3['updateTime']};}function detailArtifact(_0x206aae){const _0x3c8264=a10_0xeb854d;return{'id':_0x206aae['id'],'appCode':_0x206aae[_0x3c8264(0x115)],'name':_0x206aae[_0x3c8264(0x116)],'artifactType':_0x206aae[_0x3c8264(0x156)],'source':_0x206aae['source'],'favorite':_0x206aae['favorite'],'deleted':_0x206aae[_0x3c8264(0x13f)],'content':_0x206aae[_0x3c8264(0x134)]??'','compiledContent':_0x206aae['compiledContent'],'metadata':_0x206aae[_0x3c8264(0x10d)]??{},'createTime':_0x206aae[_0x3c8264(0x10e)],'updateTime':_0x206aae[_0x3c8264(0x133)]};}function readFavoriteFlag(_0x5992ee){const _0x3ad6b1=a10_0xeb854d,_0x2e55e0=_0x5992ee[_0x3ad6b1(0x10b)](_0x3ad6b1(0x12b));return _0x2e55e0===undefined||_0x2e55e0===null||_0x2e55e0===''?undefined:_0x5992ee[_0x3ad6b1(0x11a)]('favorite');}const artifactList={'service':'artifact','command':a10_0xeb854d(0x13e),'description':a10_0xeb854d(0x123),'risk':a10_0xeb854d(0x122),'flags':[{'name':a10_0xeb854d(0x136),'type':a10_0xeb854d(0x114),'description':a10_0xeb854d(0x113)},{'name':a10_0xeb854d(0x12b),'type':'boolean','description':'Optional\x20favorite-state\x20filter'},VERBOSE_FLAG],async 'execute'(_0x4c69ec){const _0x36fc23=a10_0xeb854d,_0x3c3156=await listRuntimeArtifacts(_0x4c69ec[_0x36fc23(0x115)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x4c69ec[_0x36fc23(0x10c)](_0x36fc23(0x136))?{'source':_0x4c69ec[_0x36fc23(0x10c)](_0x36fc23(0x136))}:{},...readFavoriteFlag(_0x4c69ec)!==undefined?{'favorite':readFavoriteFlag(_0x4c69ec)}:{}});return{'ok':!![],'data':{'total':_0x3c3156[_0x36fc23(0x11c)],'items':_0x4c69ec['bool'](_0x36fc23(0x142))?_0x3c3156:_0x3c3156[_0x36fc23(0x10f)](summarizeArtifact)}};}},artifactDetail={'service':a10_0xeb854d(0x152),'command':a10_0xeb854d(0x11e),'description':a10_0xeb854d(0x14b),'risk':'read','flags':[{...ID_FLAG,'description':a10_0xeb854d(0x108)}],async 'execute'(_0x48b1dd){const _0x260a00=a10_0xeb854d,_0x12c889=await getRuntimeArtifact(_0x48b1dd[_0x260a00(0x109)]('id'),_0x48b1dd[_0x260a00(0x115)]);return{'ok':!![],'data':detailArtifact(_0x12c889)};}},artifactCreate={'service':'artifact','command':a10_0xeb854d(0x132),'description':a10_0xeb854d(0x112),'risk':'write','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0xf60d4b){const _0x3f5cb8=a10_0xeb854d,_0xd72ab4=buildArtifactInput(_0xf60d4b),_0x5a2077=await createRuntimeArtifact(_0xf60d4b[_0x3f5cb8(0x115)],_0xd72ab4);return{'ok':!![],'data':detailArtifact(_0x5a2077),'message':_0x3f5cb8(0x143)+_0x5a2077['id']+(_0x5a2077[_0x3f5cb8(0x116)]?'\x20('+_0x5a2077[_0x3f5cb8(0x116)]+')':'')};},async 'dryRun'(_0xf06507){const _0x2efb52=a10_0xeb854d,_0x2410a0=buildArtifactInput(_0xf06507);return dryRun(_0x2efb52(0x144),_0x2efb52(0x12c))[_0x2efb52(0x147)]({'appCode':_0xf06507[_0x2efb52(0x115)],..._0x2410a0})[_0x2efb52(0x14a)](_0x2efb52(0x150))['build']();}},artifactUpdate={'service':a10_0xeb854d(0x152),'command':'update','description':a10_0xeb854d(0x146),'risk':a10_0xeb854d(0x141),'flags':[{...ID_FLAG,'description':'Artifact\x20ID'},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x250f10){const _0x2e6370=a10_0xeb854d,_0x4cd9e0=_0x250f10[_0x2e6370(0x109)]('id'),_0x658976=buildArtifactInput(_0x250f10),_0x41f1f9=await updateRuntimeArtifact(_0x4cd9e0,_0x250f10[_0x2e6370(0x115)],_0x658976);return{'ok':!![],'data':detailArtifact(_0x41f1f9),'message':_0x2e6370(0x12a)+_0x41f1f9['id']+(_0x41f1f9['name']?'\x20('+_0x41f1f9[_0x2e6370(0x116)]+')':'')};},async 'dryRun'(_0x37aa44){const _0xb7aa00=a10_0xeb854d,_0x19cb27=_0x37aa44[_0xb7aa00(0x109)]('id'),_0x1c11ed=buildArtifactInput(_0x37aa44);return dryRun(_0xb7aa00(0x144),_0xb7aa00(0x120)+_0x19cb27+_0xb7aa00(0x140))['body']({'appCode':_0x37aa44[_0xb7aa00(0x115)],..._0x1c11ed})['description'](_0xb7aa00(0x138)+_0x19cb27)[_0xb7aa00(0x131)]();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
1
+ const a10_0x11190a=a10_0x122f;(function(_0x56f88c,_0x367783){const _0x4d6663=a10_0x122f,_0x24212c=_0x56f88c();while(!![]){try{const _0x4fe5fa=-parseInt(_0x4d6663(0x1fb))/0x1+parseInt(_0x4d6663(0x201))/0x2+-parseInt(_0x4d6663(0x1be))/0x3*(-parseInt(_0x4d6663(0x1d7))/0x4)+-parseInt(_0x4d6663(0x1bb))/0x5*(-parseInt(_0x4d6663(0x1e0))/0x6)+-parseInt(_0x4d6663(0x1cb))/0x7+-parseInt(_0x4d6663(0x1ee))/0x8+parseInt(_0x4d6663(0x1ce))/0x9*(parseInt(_0x4d6663(0x1c7))/0xa);if(_0x4fe5fa===_0x367783)break;else _0x24212c['push'](_0x24212c['shift']());}catch(_0x532811){_0x24212c['push'](_0x24212c['shift']());}}}(a10_0x4e13,0xa89c4));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';function a10_0x122f(_0x4d0ce8,_0x355cf5){_0x4d0ce8=_0x4d0ce8-0x1b3;const _0x4e1326=a10_0x4e13();let _0x122f6c=_0x4e1326[_0x4d0ce8];return _0x122f6c;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a10_0x11190a(0x1de),ARTIFACT_SOURCE_AGENT=a10_0x11190a(0x1da),ALLOWED_REACT_MODULE_IMPORTS=['react',a10_0x11190a(0x1f8),a10_0x11190a(0x1f0),a10_0x11190a(0x204),a10_0x11190a(0x1d6),a10_0x11190a(0x1d1)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a10_0x11190a(0x1eb)](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a10_0x11190a(0x1df),'type':a10_0x11190a(0x1c3),'required':!![],'description':a10_0x11190a(0x1f4)},ARTIFACT_NAME_FLAG={'name':a10_0x11190a(0x1ca),'type':a10_0x11190a(0x1c3),'description':'Artifact\x20display\x20name'},METADATA_FLAG={'name':a10_0x11190a(0x1d3),'type':a10_0x11190a(0x1c3),'description':a10_0x11190a(0x1ec)};function isPlainObject(_0x3fea2e){const _0x509d28=a10_0x11190a;return typeof _0x3fea2e==='object'&&_0x3fea2e!==null&&!Array[_0x509d28(0x1ea)](_0x3fea2e);}function readSourceFile(_0x169fdd){const _0x18a7f1=a10_0x11190a;if(!_0x169fdd)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x169fdd))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x169fdd);if(!statSync(_0x169fdd)['isFile']())throw CliErrors[_0x18a7f1(0x1cc)](_0x18a7f1(0x1fe)+_0x169fdd);const _0xcd5ad7=readFileSync(_0x169fdd,_0x18a7f1(0x1c6));return validateReactModuleSource(_0xcd5ad7),_0xcd5ad7;}function a10_0x4e13(){const _0x1ee616=['lastIndex','body','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','isArray','join','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','4311568YZSvnm','artifactType','lodash','createTime','update','detail','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','map','build','data','react-dom','some','list','911900PQVANS','compiledContent','flag','File\x20is\x20not\x20a\x20regular\x20file:\x20','deleted','add','1374802mYxtju','boolean','POST','dayjs','num','source','Artifact\x20ID','/client/artifact/','Show\x20one\x20Artifact\x20by\x20id','split','/update','updateTime','5JZTLYD','filter','parse','27WqXoYH','verbose','Invalid\x20JSON\x20for\x20--metadata:\x20','description','trim','string','appCode','Preview:\x20update\x20react_module\x20Artifact\x20','utf8','5947850yuiySn','read','favorite','name','6752620dltDkX','validation','Updated\x20Artifact\x20','9twQVdO','List\x20current-app\x20react_module\x20Artifacts','str','@ant-design/icons','write','metadata','/client/artifact/create','number','antd','554188WunzkS','includes','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','AGENT','content','create','Preview:\x20create\x20react_module\x20Artifact','react_module','file','3462150oQeHYn','startsWith','artifact','Created\x20Artifact\x20','length','bool','Optional\x20favorite-state\x20filter'];a10_0x4e13=function(){return _0x1ee616;};return a10_0x4e13();}function parseMetadata(_0x5d7228){const _0x55a2d1=a10_0x11190a;if(!_0x5d7228)return undefined;let _0x28a50e;try{_0x28a50e=JSON[_0x55a2d1(0x1bd)](_0x5d7228);}catch{throw CliErrors[_0x55a2d1(0x1cc)](_0x55a2d1(0x1c0)+_0x5d7228);}if(!isPlainObject(_0x28a50e))throw CliErrors[_0x55a2d1(0x1cc)]('--metadata\x20must\x20be\x20a\x20JSON\x20object.');const _0x52d9d3={..._0x28a50e};return delete _0x52d9d3[_0x55a2d1(0x1fc)],_0x52d9d3;}function getPackageName(_0x486e7c){const _0x40d5e4=a10_0x11190a;if(_0x486e7c[_0x40d5e4(0x1e1)]('@')){const [_0x5b4d02,_0x6a23c5]=_0x486e7c[_0x40d5e4(0x1b8)]('/');return _0x5b4d02&&_0x6a23c5?_0x5b4d02+'/'+_0x6a23c5:_0x486e7c;}return _0x486e7c[_0x40d5e4(0x1b8)]('/')[0x0]||_0x486e7c;}function validateAllowedImports(_0x4cd02f){const _0x24f11c=a10_0x11190a,_0x4b6bf6=new Set();for(const _0x217f77 of IMPORT_SOURCE_PATTERNS){_0x217f77[_0x24f11c(0x1e7)]=0x0;let _0x36a51a;while((_0x36a51a=_0x217f77['exec'](_0x4cd02f))!==null){const _0x59d345=_0x36a51a[0x1]?.[_0x24f11c(0x1c2)]();_0x59d345&&_0x4b6bf6[_0x24f11c(0x200)](_0x59d345);}}const _0x373f51=[..._0x4b6bf6][_0x24f11c(0x1f5)](getPackageName)[_0x24f11c(0x1bc)](_0x5622bd=>!ALLOWED_REACT_MODULE_IMPORTS[_0x24f11c(0x1d8)](_0x5622bd));if(_0x373f51['length']>0x0)throw CliErrors[_0x24f11c(0x1cc)]('react_module\x20imports\x20are\x20limited\x20to:\x20'+ALLOWED_REACT_MODULE_IMPORTS_TEXT+'.\x20Unsupported:\x20'+[...new Set(_0x373f51)]['join'](',\x20'));}export function validateReactModuleSource(_0x313951){const _0x413a2d=a10_0x11190a;if(!_0x313951['trim']())throw CliErrors[_0x413a2d(0x1cc)]('Artifact\x20source\x20file\x20is\x20blank.');if(PAGE_LEVEL_PATTERNS[_0x413a2d(0x1f9)](_0x2c4a02=>_0x2c4a02['test'](_0x313951)))throw CliErrors['validation'](_0x413a2d(0x1ed));validateAllowedImports(_0x313951);}function buildArtifactInput(_0x2e4e81){const _0x41af83=a10_0x11190a,_0x3f1735=readSourceFile(_0x2e4e81[_0x41af83(0x1d0)]('file')),_0x8ed178=_0x2e4e81[_0x41af83(0x1d0)](_0x41af83(0x1ca))['trim'](),_0x28eb17=parseMetadata(_0x2e4e81[_0x41af83(0x1d0)](_0x41af83(0x1d3)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x8ed178?{'name':_0x8ed178}:{},'content':_0x3f1735,..._0x28eb17?{'metadata':_0x28eb17}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x239256){const _0x4c0efb=a10_0x11190a;return{'id':_0x239256['id'],'name':_0x239256[_0x4c0efb(0x1ca)],'artifactType':_0x239256['artifactType'],'source':_0x239256[_0x4c0efb(0x1b4)],'favorite':_0x239256[_0x4c0efb(0x1c9)],'deleted':_0x239256[_0x4c0efb(0x1ff)],'createTime':_0x239256[_0x4c0efb(0x1f1)],'updateTime':_0x239256['updateTime']};}function detailArtifact(_0x77791a){const _0x73e9fc=a10_0x11190a;return{'id':_0x77791a['id'],'appCode':_0x77791a[_0x73e9fc(0x1c4)],'name':_0x77791a[_0x73e9fc(0x1ca)],'artifactType':_0x77791a[_0x73e9fc(0x1ef)],'source':_0x77791a['source'],'favorite':_0x77791a[_0x73e9fc(0x1c9)],'deleted':_0x77791a[_0x73e9fc(0x1ff)],'content':_0x77791a[_0x73e9fc(0x1db)]??'','compiledContent':_0x77791a['compiledContent'],'metadata':_0x77791a['metadata']??{},'createTime':_0x77791a[_0x73e9fc(0x1f1)],'updateTime':_0x77791a[_0x73e9fc(0x1ba)]};}function readFavoriteFlag(_0x3129ab){const _0x646011=a10_0x11190a,_0x8c982=_0x3129ab[_0x646011(0x1fd)](_0x646011(0x1c9));return _0x8c982===undefined||_0x8c982===null||_0x8c982===''?undefined:_0x3129ab[_0x646011(0x1e5)]('favorite');}const artifactList={'service':a10_0x11190a(0x1e2),'command':a10_0x11190a(0x1fa),'description':a10_0x11190a(0x1cf),'risk':a10_0x11190a(0x1c8),'flags':[{'name':a10_0x11190a(0x1b4),'type':a10_0x11190a(0x1c3),'description':a10_0x11190a(0x1e9)},{'name':a10_0x11190a(0x1c9),'type':a10_0x11190a(0x202),'description':a10_0x11190a(0x1e6)},VERBOSE_FLAG],async 'execute'(_0x17ebc7){const _0x2533d7=a10_0x11190a,_0x231a5c=await listRuntimeArtifacts(_0x17ebc7['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x17ebc7[_0x2533d7(0x1d0)](_0x2533d7(0x1b4))?{'source':_0x17ebc7[_0x2533d7(0x1d0)](_0x2533d7(0x1b4))}:{},...readFavoriteFlag(_0x17ebc7)!==undefined?{'favorite':readFavoriteFlag(_0x17ebc7)}:{}});return{'ok':!![],'data':{'total':_0x231a5c[_0x2533d7(0x1e4)],'items':_0x17ebc7['bool'](_0x2533d7(0x1bf))?_0x231a5c:_0x231a5c[_0x2533d7(0x1f5)](summarizeArtifact)}};}},artifactDetail={'service':a10_0x11190a(0x1e2),'command':a10_0x11190a(0x1f3),'description':a10_0x11190a(0x1b7),'risk':a10_0x11190a(0x1c8),'flags':[{...ID_FLAG,'description':a10_0x11190a(0x1b5)}],async 'execute'(_0x1ae835){const _0x22d4e4=a10_0x11190a,_0x425e09=await getRuntimeArtifact(_0x1ae835[_0x22d4e4(0x1b3)]('id'),_0x1ae835[_0x22d4e4(0x1c4)]);return{'ok':!![],'data':detailArtifact(_0x425e09)};}},artifactCreate={'service':a10_0x11190a(0x1e2),'command':a10_0x11190a(0x1dc),'description':'Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','risk':a10_0x11190a(0x1d2),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x48de4a){const _0x227f18=a10_0x11190a,_0x4c5a7e=buildArtifactInput(_0x48de4a),_0x2f2376=await createRuntimeArtifact(_0x48de4a[_0x227f18(0x1c4)],_0x4c5a7e);return{'ok':!![],'data':detailArtifact(_0x2f2376),'message':_0x227f18(0x1e3)+_0x2f2376['id']+(_0x2f2376[_0x227f18(0x1ca)]?'\x20('+_0x2f2376['name']+')':'')};},async 'dryRun'(_0x337867){const _0x2190be=a10_0x11190a,_0x5e44f4=buildArtifactInput(_0x337867);return dryRun(_0x2190be(0x203),_0x2190be(0x1d4))[_0x2190be(0x1e8)]({'appCode':_0x337867['appCode'],..._0x5e44f4})[_0x2190be(0x1c1)](_0x2190be(0x1dd))['build']();},'writeEventSubject'(_0x4ef454){const _0x32b64c=a10_0x11190a,_0x1bc266=_0x4ef454[_0x32b64c(0x1f7)]?.['id'];if(typeof _0x1bc266!=='string'&&typeof _0x1bc266!==_0x32b64c(0x1d5))return undefined;return{'kind':_0x32b64c(0x1e2),'id':String(_0x1bc266),'action':_0x32b64c(0x1dc)};}},artifactUpdate={'service':a10_0x11190a(0x1e2),'command':a10_0x11190a(0x1f2),'description':a10_0x11190a(0x1d9),'risk':'write','flags':[{...ID_FLAG,'description':a10_0x11190a(0x1b5)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x2a2ef8){const _0x565919=a10_0x11190a,_0x9e74fb=_0x2a2ef8[_0x565919(0x1b3)]('id'),_0x35afe5=buildArtifactInput(_0x2a2ef8),_0x5ca5fc=await updateRuntimeArtifact(_0x9e74fb,_0x2a2ef8[_0x565919(0x1c4)],_0x35afe5);return{'ok':!![],'data':detailArtifact(_0x5ca5fc),'message':_0x565919(0x1cd)+_0x5ca5fc['id']+(_0x5ca5fc[_0x565919(0x1ca)]?'\x20('+_0x5ca5fc['name']+')':'')};},async 'dryRun'(_0x559fd7){const _0x30bd14=a10_0x11190a,_0x560d4f=_0x559fd7[_0x30bd14(0x1b3)]('id'),_0x76b1d3=buildArtifactInput(_0x559fd7);return dryRun(_0x30bd14(0x203),_0x30bd14(0x1b6)+_0x560d4f+_0x30bd14(0x1b9))[_0x30bd14(0x1e8)]({'appCode':_0x559fd7[_0x30bd14(0x1c4)],..._0x76b1d3})['description'](_0x30bd14(0x1c5)+_0x560d4f)[_0x30bd14(0x1f6)]();},'writeEventSubject'(_0x3f6953){const _0x28e1bf=a10_0x11190a,_0x456b30=_0x3f6953[_0x28e1bf(0x1f7)]?.['id'];if(typeof _0x456b30!==_0x28e1bf(0x1c3)&&typeof _0x456b30!==_0x28e1bf(0x1d5))return undefined;return{'kind':_0x28e1bf(0x1e2),'id':String(_0x456b30),'action':_0x28e1bf(0x1f2)};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @fileoverview Device code authorization flow.
3
+ *
4
+ * Two modes:
5
+ * - Default (V1): interactive polling with spinner, saves AK directly.
6
+ * - --url-only (V2): prints URL to stdout and exits; WorkBuddy polls via `auth status --check`.
7
+ *
8
+ * The temp file `~/.lovrabet/.device-auth` bridges the two commands:
9
+ * `auth device` writes it, `auth status --check` reads it to resolve pending auth.
10
+ */
11
+ import type { CommandDefinition } from "../../framework/types.js";
12
+ interface DeviceAuthTokenResponse {
13
+ status: "authorization_pending" | "success" | "expired";
14
+ access_key?: string;
15
+ }
16
+ interface StoredDeviceCode {
17
+ code: string;
18
+ createdAt: string;
19
+ scope: "global" | "project";
20
+ }
21
+ export declare function generateDeviceCode(): string;
22
+ export declare function buildDeviceAuthUrl(userDomain: string, code: string, source?: string): string;
23
+ export declare function getDeviceCodePath(): string;
24
+ export declare function readStoredDeviceCode(): StoredDeviceCode | null;
25
+ export declare function writeStoredDeviceCode(code: string, scope: "global" | "project"): void;
26
+ export declare function deleteStoredDeviceCode(): void;
27
+ export declare function isStoredDeviceCodeExpired(stored: StoredDeviceCode): boolean;
28
+ export declare function fetchDeviceToken(userDomain: string, code: string): Promise<DeviceAuthTokenResponse>;
29
+ export declare function pollDeviceToken(userDomain: string, code: string, signal: AbortSignal): Promise<string>;
30
+ export declare const authDeviceDefinition: CommandDefinition;
31
+ export {};
@@ -1 +1 @@
1
- const a11_0x1989dd=a11_0x5bc3;(function(_0x1c9c27,_0x1e4bc2){const _0x2f9303=a11_0x5bc3,_0x5d66db=_0x1c9c27();while(!![]){try{const _0x3f1d11=-parseInt(_0x2f9303(0xad))/0x1+parseInt(_0x2f9303(0xc7))/0x2*(-parseInt(_0x2f9303(0xbd))/0x3)+parseInt(_0x2f9303(0xc3))/0x4+parseInt(_0x2f9303(0x8c))/0x5*(-parseInt(_0x2f9303(0xcb))/0x6)+parseInt(_0x2f9303(0xb7))/0x7+parseInt(_0x2f9303(0xac))/0x8+parseInt(_0x2f9303(0xd5))/0x9*(parseInt(_0x2f9303(0x8a))/0xa);if(_0x3f1d11===_0x1e4bc2)break;else _0x5d66db['push'](_0x5d66db['shift']());}catch(_0x28a4f1){_0x5d66db['push'](_0x5d66db['shift']());}}}(a11_0x2ff2,0x8e2c7));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0xb47bbb){const _0x3ce20e=a11_0x5bc3;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0xb47bbb[_0x3ce20e(0xa5)](_0x3ce20e(0xc1)),'explicitProject':_0xb47bbb[_0x3ce20e(0xa5)]('project'),'policy':_0x3ce20e(0x9a)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){const _0x46e534=a11_0x5bc3;return crypto[_0x46e534(0xa9)]();}export function buildDeviceAuthUrl(_0x32638b,_0x12d48f,_0x2a94a4='lovrabet-cli'){const _0x4177fc=a11_0x5bc3;return _0x32638b+'/device-auth?code='+encodeURIComponent(_0x12d48f)+_0x4177fc(0x92)+encodeURIComponent(_0x2a94a4);}export function getDeviceCodePath(){const _0x3facd9=a11_0x5bc3;return homedir()+'/'+PRODUCT_CONFIG[_0x3facd9(0xab)]+_0x3facd9(0xd8);}export function readStoredDeviceCode(){const _0x2cdfdc=a11_0x5bc3,_0x2a527c=getDeviceCodePath();if(!existsSync(_0x2a527c))return null;try{const _0x288d94=readFileSync(_0x2a527c,{'encoding':_0x2cdfdc(0xb3)}),_0xc90ea9=JSON[_0x2cdfdc(0xc6)](_0x288d94);if(_0xc90ea9&&typeof _0xc90ea9[_0x2cdfdc(0x98)]==='string'&&typeof _0xc90ea9['createdAt']===_0x2cdfdc(0xb2)&&(_0xc90ea9[_0x2cdfdc(0xb4)]==='global'||_0xc90ea9[_0x2cdfdc(0xb4)]===_0x2cdfdc(0xd6)))return _0xc90ea9;}catch{}return null;}export function writeStoredDeviceCode(_0x58fd81,_0x2943bc){const _0x2ada52=a11_0x5bc3,_0x1a9bb0=getDeviceCodePath(),_0x5e0ddb=dirname(_0x1a9bb0);!existsSync(_0x5e0ddb)&&mkdirSync(_0x5e0ddb,{'recursive':!![]});const _0x534d7f={'code':_0x58fd81,'createdAt':new Date()[_0x2ada52(0xd3)](),'scope':_0x2943bc};writeFileSync(_0x1a9bb0,JSON[_0x2ada52(0x8f)](_0x534d7f),{'encoding':'utf8','mode':0x180});}export function deleteStoredDeviceCode(){const _0x35ff8d=getDeviceCodePath();try{unlinkSync(_0x35ff8d);}catch{}}export function isStoredDeviceCodeExpired(_0x5815f0){const _0x5af175=a11_0x5bc3;return Date[_0x5af175(0xb8)]()-new Date(_0x5815f0[_0x5af175(0x90)])[_0x5af175(0xc9)]()>DEVICE_CODE_TTL_MS;}function a11_0x2ff2(){const _0x5000f5=['App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','toISOString','removeListener','161685SgDXcX','project','Write\x20to\x20global\x20config\x20(default)','/.device-auth','Device\x20authorization\x20cancelled.','object','Device\x20auth\x20API\x20error\x20(','Device\x20auth\x20API\x20returned\x20HTTP\x20','10CIBijY','url-only','1341275tWIuCG','json','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','stringify','createdAt','Verify:\x20','&source=','Invalid\x20access_key\x20returned\x20by\x20server.','boolean','Write\x20to\x20project\x20config','test','auth','code','lovrabet-cli','global-default','apiError','abort','validation','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','stderr','signal','accessKey','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','AbortError','data','bool','cancelled','aborted','access_key','randomUUID','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','homeDirName','1620592PLUlKm','19004UPUFAJ','\x20remaining','networkError','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','name','string','utf8','scope','application/json','/api/device-auth/token','6933598cgQMnU','now','nonInteractive','),\x20retrying...','Invalid\x20device\x20auth\x20response','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','132426hexpBH','\x20auth\x20device','log','str','global','success','399876qKtIsw','AccessKey\x20saved\x20to\x20','SIGINT','parse','20fSbdxG','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','getTime','After\x20authorizing,\x20re-run:\x20','6qghryG','device','status','\x0dWaiting\x20for\x20authorization...\x20','write','padStart','Device\x20authorization\x20successful.'];a11_0x2ff2=function(){return _0x5000f5;};return a11_0x2ff2();}export async function fetchDeviceToken(_0x45409f,_0x50a5c4){const _0x9b1c73=a11_0x5bc3,_0x26e4d5=_0x45409f+_0x9b1c73(0xb6),_0x1feffb=new AbortController(),_0x3e247b=setTimeout(()=>_0x1feffb[_0x9b1c73(0x9c)](),0x2710),_0x2e1389=await fetch(_0x26e4d5,{'method':'POST','headers':{'Content-Type':_0x9b1c73(0xb5)},'body':JSON[_0x9b1c73(0x8f)]({'code':_0x50a5c4}),'signal':_0x1feffb[_0x9b1c73(0xa0)]});clearTimeout(_0x3e247b);if(!_0x2e1389['ok'])throw CliErrors[_0x9b1c73(0xaf)](_0x9b1c73(0x89)+_0x2e1389['status']);const _0x29cb7b=await _0x2e1389[_0x9b1c73(0x8d)](),_0x24acb6=_0x29cb7b[_0x9b1c73(0xa4)]&&typeof _0x29cb7b['data']===_0x9b1c73(0x87)?_0x29cb7b[_0x9b1c73(0xa4)]:_0x29cb7b;if(!_0x24acb6||typeof _0x24acb6[_0x9b1c73(0xcd)]!=='string')throw CliErrors[_0x9b1c73(0x9b)](_0x9b1c73(0xbb));return{'status':_0x24acb6[_0x9b1c73(0xcd)],'access_key':typeof _0x24acb6['access_key']===_0x9b1c73(0xb2)?_0x24acb6[_0x9b1c73(0xa8)]:undefined};}export async function pollDeviceToken(_0x3a5a68,_0x248497,_0x49586e){const _0xaba3e5=a11_0x5bc3;let _0x52d058=0x0;for(let _0x236dcf=0x0;_0x236dcf<MAX_POLLS;_0x236dcf++){if(_0x49586e[_0xaba3e5(0xa7)])throw CliErrors['cancelled'](_0xaba3e5(0xd9));let _0x14e793;try{_0x14e793=await fetchDeviceToken(_0x3a5a68,_0x248497);}catch(_0xab8a1d){if(_0xab8a1d instanceof Error&&_0xab8a1d[_0xaba3e5(0xb1)]===_0xaba3e5(0xa3))throw CliErrors[_0xaba3e5(0xa6)]('Device\x20authorization\x20cancelled.');_0x52d058++;if(_0x52d058>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0xaba3e5(0xaf)]('Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.');writeCliSideChannelLine(_0xaba3e5(0x88)+_0x52d058+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0xaba3e5(0xba)),await sleep(POLL_INTERVAL_MS);continue;}_0x52d058=0x0;if(_0x14e793[_0xaba3e5(0xcd)]===_0xaba3e5(0xc2)){if(!_0x14e793['access_key'])throw CliErrors['apiError'](_0xaba3e5(0x93));return _0x14e793['access_key'];}if(_0x14e793['status']==='expired'){deleteStoredDeviceCode();throw CliErrors[_0xaba3e5(0x9d)](_0xaba3e5(0x8e));}const _0x3b9f42=(_0x236dcf+0x1)*POLL_INTERVAL_MS,_0x144e2e=DEVICE_CODE_TTL_MS-_0x3b9f42,_0x243175=Math['floor'](_0x144e2e/0xea60),_0x5a26d2=Math['floor'](_0x144e2e%0xea60/0x3e8);process[_0xaba3e5(0x9f)][_0xaba3e5(0xcf)](_0xaba3e5(0xce)+_0x243175+':'+String(_0x5a26d2)[_0xaba3e5(0xd0)](0x2,'0')+_0xaba3e5(0xae)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0xaba3e5(0x9d)](_0xaba3e5(0x9e));}function a11_0x5bc3(_0xebbb70,_0x3f5678){_0xebbb70=_0xebbb70-0x87;const _0x2ff2b8=a11_0x2ff2();let _0x5bc3ea=_0x2ff2b8[_0xebbb70];return _0x5bc3ea;}function sleep(_0x3bc6ee){return new Promise(_0x528afb=>setTimeout(_0x528afb,_0x3bc6ee));}export const authDeviceDefinition={'service':a11_0x1989dd(0x97),'command':a11_0x1989dd(0xcc),'description':'Authorize\x20via\x20device\x20code\x20flow\x20(open\x20browser,\x20no\x20copy-paste)','risk':a11_0x1989dd(0xcf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x1989dd(0xc1),'type':a11_0x1989dd(0x94),'description':a11_0x1989dd(0xd7),'default':!![]},{'name':a11_0x1989dd(0xd6),'type':a11_0x1989dd(0x94),'description':a11_0x1989dd(0x95),'default':![]},{'name':'source','type':a11_0x1989dd(0xb2),'description':a11_0x1989dd(0xd2),'default':'lovrabet-cli'},{'name':a11_0x1989dd(0x8b),'type':a11_0x1989dd(0x94),'description':'Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','default':![]}],async 'execute'(_0x53ed77){const _0x579cb0=a11_0x1989dd,_0x447632=resolveAuthScopeFlags(_0x53ed77),_0x5c2a93=_0x447632[_0x579cb0(0xc1)]?'global':_0x579cb0(0xd6),_0x163019=readScopedConfig(_0x447632);if(_0x163019[_0x579cb0(0xa1)])return{'ok':!![],'message':_0x579cb0(0xaa)};const _0x16fc5b=(_0x53ed77[_0x579cb0(0xc0)]('source')||_0x579cb0(0x99))['trim'](),_0x722a96=getUserDomain(),_0x3517b7=readStoredDeviceCode(),_0x12a3ce=_0x3517b7&&!isStoredDeviceCodeExpired(_0x3517b7)?_0x3517b7[_0x579cb0(0x98)]:((()=>{const _0x57edf1=generateDeviceCode();return writeStoredDeviceCode(_0x57edf1,_0x5c2a93),_0x57edf1;})()),_0x2dacaa=buildDeviceAuthUrl(_0x722a96,_0x12a3ce,_0x16fc5b);if(_0x53ed77[_0x579cb0(0xa5)](_0x579cb0(0x8b)))return console[_0x579cb0(0xbf)](_0x2dacaa),{'ok':!![]};writeCliSideChannelLine(_0x579cb0(0xbc)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x2dacaa),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x579cb0(0xc8));if(_0x53ed77[_0x579cb0(0xb9)])return writeCliSideChannelLine(_0x579cb0(0xca)+CLI_BIN_NAME+_0x579cb0(0xbe)),{'ok':!![],'message':_0x579cb0(0xa2)};writeCliSideChannelLine(_0x579cb0(0xb0));const _0x16a7e1=new AbortController(),_0x404eb0=()=>{const _0x4dae91=_0x579cb0;_0x16a7e1['abort'](),process['removeListener'](_0x4dae91(0xc5),_0x404eb0);};process['once'](_0x579cb0(0xc5),_0x404eb0);let _0x3853bd;try{_0x3853bd=await pollDeviceToken(_0x722a96,_0x12a3ce,_0x16a7e1['signal']);}finally{process[_0x579cb0(0xd4)](_0x579cb0(0xc5),_0x404eb0);}if(!ACCESS_KEY_PATTERN[_0x579cb0(0x96)](_0x3853bd))throw CliErrors[_0x579cb0(0x9b)](_0x579cb0(0x93));const _0xe5e0fb=readScopedConfig(_0x447632);return _0xe5e0fb[_0x579cb0(0xa1)]=_0x3853bd,writeScopedConfig(_0xe5e0fb,_0x447632),deleteStoredDeviceCode(),process[_0x579cb0(0x9f)][_0x579cb0(0xcf)]('\x0a'),writeCliSideChannelLine(_0x579cb0(0xc4)+_0x5c2a93+'\x20config.'),writeCliSideChannelLine(_0x579cb0(0x91)+CLI_BIN_NAME+'\x20auth\x20status'),{'ok':!![],'message':_0x579cb0(0xd1)};}};
1
+ const a11_0x121d34=a11_0x3350;(function(_0x2fabe4,_0x497f2e){const _0x662d3c=a11_0x3350,_0x16c859=_0x2fabe4();while(!![]){try{const _0x51b1c5=parseInt(_0x662d3c(0x1cf))/0x1+-parseInt(_0x662d3c(0x1a0))/0x2*(parseInt(_0x662d3c(0x1bd))/0x3)+parseInt(_0x662d3c(0x1d1))/0x4+-parseInt(_0x662d3c(0x196))/0x5*(-parseInt(_0x662d3c(0x1c8))/0x6)+parseInt(_0x662d3c(0x199))/0x7*(-parseInt(_0x662d3c(0x194))/0x8)+parseInt(_0x662d3c(0x1bb))/0x9*(parseInt(_0x662d3c(0x1ac))/0xa)+-parseInt(_0x662d3c(0x19a))/0xb;if(_0x51b1c5===_0x497f2e)break;else _0x16c859['push'](_0x16c859['shift']());}catch(_0x2ced46){_0x16c859['push'](_0x16c859['shift']());}}}(a11_0x1902,0x2a6e2));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';function a11_0x3350(_0x45712c,_0x22eab8){_0x45712c=_0x45712c-0x187;const _0x19022c=a11_0x1902();let _0x33504f=_0x19022c[_0x45712c];return _0x33504f;}import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x99a3b7){const _0x3f35cc=a11_0x3350;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x99a3b7[_0x3f35cc(0x1b7)](_0x3f35cc(0x19d)),'explicitProject':_0x99a3b7[_0x3f35cc(0x1b7)]('project'),'policy':_0x3f35cc(0x1cb)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){const _0x37827b=a11_0x3350;return crypto[_0x37827b(0x19c)]();}export function buildDeviceAuthUrl(_0x11b4f8,_0x3459e8,_0xf8a9ec='lovrabet-cli'){return _0x11b4f8+'/device-auth?code='+encodeURIComponent(_0x3459e8)+'&source='+encodeURIComponent(_0xf8a9ec);}function a11_0x1902(){const _0x49a128=['homeDirName','/.device-auth','Authorize\x20via\x20device\x20code\x20flow\x20(open\x20browser,\x20no\x20copy-paste)','auth','apiError','once','10SdTIBD','application/json','),\x20retrying...','nonInteractive','expired','code','log','Write\x20to\x20project\x20config','parse','project','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','bool','networkError','Invalid\x20device\x20auth\x20response','access_key','2678085zauJuO','\x20auth\x20status','306KmXsZy','AbortError','/api/device-auth/token','Device\x20authorization\x20cancelled.','abort','SIGINT','stderr','stringify','boolean','status','removeListener','6MYOCHz','Device\x20authorization\x20successful.','trim','global-default','padStart','scope','now','135100wuWBwG','toISOString','817880qQZcbf','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','lovrabet-cli','Write\x20to\x20global\x20config\x20(default)','data','signal','source','Verify:\x20','Device\x20auth\x20API\x20returned\x20HTTP\x20','validation','AccessKey\x20saved\x20to\x20','success','utf8','832264daACuG','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','702460pWzooJ','accessKey','cancelled','7vgEctl','2269806BPNyic','string','randomUUID','global','getTime','\x0dWaiting\x20for\x20authorization...\x20','5754VqmTvQ','floor','Device\x20auth\x20API\x20error\x20(','Invalid\x20access_key\x20returned\x20by\x20server.','url-only','object'];a11_0x1902=function(){return _0x49a128;};return a11_0x1902();}export function getDeviceCodePath(){const _0x56c86a=a11_0x3350;return homedir()+'/'+PRODUCT_CONFIG[_0x56c86a(0x1a6)]+_0x56c86a(0x1a7);}export function readStoredDeviceCode(){const _0x1c0b5f=a11_0x3350,_0x571bf1=getDeviceCodePath();if(!existsSync(_0x571bf1))return null;try{const _0x3558c8=readFileSync(_0x571bf1,{'encoding':_0x1c0b5f(0x193)}),_0x380365=JSON[_0x1c0b5f(0x1b4)](_0x3558c8);if(_0x380365&&typeof _0x380365['code']===_0x1c0b5f(0x19b)&&typeof _0x380365['createdAt']===_0x1c0b5f(0x19b)&&(_0x380365[_0x1c0b5f(0x1cd)]==='global'||_0x380365[_0x1c0b5f(0x1cd)]===_0x1c0b5f(0x1b5)))return _0x380365;}catch{}return null;}export function writeStoredDeviceCode(_0xd4efa0,_0x13c1ec){const _0x211d46=a11_0x3350,_0x22d5aa=getDeviceCodePath(),_0x4e8575=dirname(_0x22d5aa);!existsSync(_0x4e8575)&&mkdirSync(_0x4e8575,{'recursive':!![]});const _0x465e46={'code':_0xd4efa0,'createdAt':new Date()[_0x211d46(0x1d0)](),'scope':_0x13c1ec};writeFileSync(_0x22d5aa,JSON[_0x211d46(0x1c4)](_0x465e46),{'encoding':_0x211d46(0x193),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x20f505=getDeviceCodePath();try{unlinkSync(_0x20f505);}catch{}}export function isStoredDeviceCodeExpired(_0x436a81){const _0xd6fd13=a11_0x3350;return Date[_0xd6fd13(0x1ce)]()-new Date(_0x436a81['createdAt'])[_0xd6fd13(0x19e)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x3123e3,_0x58eabb){const _0x3bd5aa=a11_0x3350,_0x27ce3e=_0x3123e3+_0x3bd5aa(0x1bf),_0x544429=new AbortController(),_0xc724f0=setTimeout(()=>_0x544429['abort'](),0x2710),_0x276220=await fetch(_0x27ce3e,{'method':'POST','headers':{'Content-Type':_0x3bd5aa(0x1ad)},'body':JSON['stringify']({'code':_0x58eabb}),'signal':_0x544429[_0x3bd5aa(0x18c)]});clearTimeout(_0xc724f0);if(!_0x276220['ok'])throw CliErrors[_0x3bd5aa(0x1b8)](_0x3bd5aa(0x18f)+_0x276220['status']);const _0x331346=await _0x276220['json'](),_0x5661e4=_0x331346[_0x3bd5aa(0x18b)]&&typeof _0x331346['data']===_0x3bd5aa(0x1a5)?_0x331346[_0x3bd5aa(0x18b)]:_0x331346;if(!_0x5661e4||typeof _0x5661e4['status']!==_0x3bd5aa(0x19b))throw CliErrors[_0x3bd5aa(0x1aa)](_0x3bd5aa(0x1b9));return{'status':_0x5661e4[_0x3bd5aa(0x1c6)],'access_key':typeof _0x5661e4[_0x3bd5aa(0x1ba)]===_0x3bd5aa(0x19b)?_0x5661e4[_0x3bd5aa(0x1ba)]:undefined};}export async function pollDeviceToken(_0x48a9b4,_0x46a524,_0x1857bc){const _0x1720ef=a11_0x3350;let _0x9acf92=0x0;for(let _0x4e2215=0x0;_0x4e2215<MAX_POLLS;_0x4e2215++){if(_0x1857bc['aborted'])throw CliErrors[_0x1720ef(0x198)](_0x1720ef(0x1c0));let _0x1338e4;try{_0x1338e4=await fetchDeviceToken(_0x48a9b4,_0x46a524);}catch(_0x2c71eb){if(_0x2c71eb instanceof Error&&_0x2c71eb['name']===_0x1720ef(0x1be))throw CliErrors['cancelled'](_0x1720ef(0x1c0));_0x9acf92++;if(_0x9acf92>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x1720ef(0x1b8)]('Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.');writeCliSideChannelLine(_0x1720ef(0x1a2)+_0x9acf92+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x1720ef(0x1ae)),await sleep(POLL_INTERVAL_MS);continue;}_0x9acf92=0x0;if(_0x1338e4[_0x1720ef(0x1c6)]===_0x1720ef(0x192)){if(!_0x1338e4[_0x1720ef(0x1ba)])throw CliErrors[_0x1720ef(0x1aa)](_0x1720ef(0x1a3));return _0x1338e4[_0x1720ef(0x1ba)];}if(_0x1338e4[_0x1720ef(0x1c6)]===_0x1720ef(0x1b0)){deleteStoredDeviceCode();throw CliErrors[_0x1720ef(0x190)](_0x1720ef(0x1b6));}const _0x318629=(_0x4e2215+0x1)*POLL_INTERVAL_MS,_0xb92865=DEVICE_CODE_TTL_MS-_0x318629,_0x33331f=Math[_0x1720ef(0x1a1)](_0xb92865/0xea60),_0x40e0f1=Math[_0x1720ef(0x1a1)](_0xb92865%0xea60/0x3e8);process[_0x1720ef(0x1c3)]['write'](_0x1720ef(0x19f)+_0x33331f+':'+String(_0x40e0f1)[_0x1720ef(0x1cc)](0x2,'0')+'\x20remaining'),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x1720ef(0x190)]('Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}function sleep(_0x378d5a){return new Promise(_0x36fec9=>setTimeout(_0x36fec9,_0x378d5a));}export const authDeviceDefinition={'service':a11_0x121d34(0x1a9),'command':'device','description':a11_0x121d34(0x1a8),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x121d34(0x19d),'type':a11_0x121d34(0x1c5),'description':a11_0x121d34(0x18a),'default':!![]},{'name':a11_0x121d34(0x1b5),'type':a11_0x121d34(0x1c5),'description':a11_0x121d34(0x1b3),'default':![]},{'name':a11_0x121d34(0x18d),'type':a11_0x121d34(0x19b),'description':a11_0x121d34(0x187),'default':'lovrabet-cli'},{'name':a11_0x121d34(0x1a4),'type':a11_0x121d34(0x1c5),'description':'Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','default':![]}],async 'execute'(_0x13da74){const _0x3632a9=a11_0x121d34,_0x5465ab=resolveAuthScopeFlags(_0x13da74),_0x405deb=_0x5465ab[_0x3632a9(0x19d)]?_0x3632a9(0x19d):'project',_0x55c28c=readScopedConfig(_0x5465ab);if(_0x55c28c[_0x3632a9(0x197)])return{'ok':!![],'message':_0x3632a9(0x195)};const _0x233338=(_0x13da74['str'](_0x3632a9(0x18d))||_0x3632a9(0x189))[_0x3632a9(0x1ca)](),_0x54e6c8=getUserDomain(),_0x47a1cb=readStoredDeviceCode(),_0x1f4e7c=_0x47a1cb&&!isStoredDeviceCodeExpired(_0x47a1cb)?_0x47a1cb[_0x3632a9(0x1b1)]:((()=>{const _0x465324=generateDeviceCode();return writeStoredDeviceCode(_0x465324,_0x405deb),_0x465324;})()),_0x4a969d=buildDeviceAuthUrl(_0x54e6c8,_0x1f4e7c,_0x233338);if(_0x13da74['bool']('url-only'))return console[_0x3632a9(0x1b2)](_0x4a969d),{'ok':!![]};writeCliSideChannelLine('Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:'),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x4a969d),writeCliSideChannelLine(''),writeCliSideChannelLine('The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.');if(_0x13da74[_0x3632a9(0x1af)])return writeCliSideChannelLine('After\x20authorizing,\x20re-run:\x20'+CLI_BIN_NAME+'\x20auth\x20device'),{'ok':!![],'message':'Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.'};writeCliSideChannelLine(_0x3632a9(0x188));const _0x315bcd=new AbortController(),_0x35bcf6=()=>{const _0x45b726=_0x3632a9;_0x315bcd[_0x45b726(0x1c1)](),process[_0x45b726(0x1c7)]('SIGINT',_0x35bcf6);};process[_0x3632a9(0x1ab)](_0x3632a9(0x1c2),_0x35bcf6);let _0x22cac5;try{_0x22cac5=await pollDeviceToken(_0x54e6c8,_0x1f4e7c,_0x315bcd['signal']);}finally{process['removeListener'](_0x3632a9(0x1c2),_0x35bcf6);}if(!ACCESS_KEY_PATTERN['test'](_0x22cac5))throw CliErrors['apiError']('Invalid\x20access_key\x20returned\x20by\x20server.');const _0x650c3e=readScopedConfig(_0x5465ab);return _0x650c3e['accessKey']=_0x22cac5,writeScopedConfig(_0x650c3e,_0x5465ab),deleteStoredDeviceCode(),process['stderr']['write']('\x0a'),writeCliSideChannelLine(_0x3632a9(0x191)+_0x405deb+'\x20config.'),writeCliSideChannelLine(_0x3632a9(0x18e)+CLI_BIN_NAME+_0x3632a9(0x1bc)),{'ok':!![],'message':_0x3632a9(0x1c9)};}};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @fileoverview `auth` subcommand definitions — login, init, logout, status.
3
+ *
4
+ * Why all three commands use `ClientAk` mode: Lovrabet Runtime CLI is a
5
+ * developer-facing tool that operates in the runtime environment (production /
6
+ * development / daily). It uses AccessKey authentication exclusively, not
7
+ * the session cookie flow used by the web-oriented `rabetbase` CLI.
8
+ *
9
+ * Why `--project` is a flag rather than the default for login/logout:
10
+ * Auth credentials are typically shared across projects (one developer works
11
+ * on multiple projects). Writing to global by default means one `auth login`
12
+ * suffices for all projects. `--project` is opt-in for project-isolated creds.
13
+ *
14
+ * Why `resolveAuthScopeFlags` uses `policy: "global-default"`: unlike `app use`
15
+ * (which prefers the project layer), auth credentials should default to global.
16
+ * Project-specific auth is an edge case handled by `--project`.
17
+ *
18
+ * Design decision: `auth status` reads the product-scoped access key env var
19
+ * (not through the config layer) to make the priority order explicit in the
20
+ * output: env var > config file. This helps users debug credential issues.
21
+ */
22
+ import type { CommandDefinition } from "../../framework/types.js";
23
+ export declare const authDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- const a12_0x4e6897=a12_0x4498;(function(_0x26b8ec,_0xcd6494){const _0x48361c=a12_0x4498,_0x93adf2=_0x26b8ec();while(!![]){try{const _0x454254=parseInt(_0x48361c(0x121))/0x1+parseInt(_0x48361c(0x112))/0x2+-parseInt(_0x48361c(0x123))/0x3*(-parseInt(_0x48361c(0xd6))/0x4)+parseInt(_0x48361c(0x122))/0x5+parseInt(_0x48361c(0xff))/0x6+parseInt(_0x48361c(0xeb))/0x7+-parseInt(_0x48361c(0xfc))/0x8*(parseInt(_0x48361c(0x103))/0x9);if(_0x454254===_0xcd6494)break;else _0x93adf2['push'](_0x93adf2['shift']());}catch(_0x307503){_0x93adf2['push'](_0x93adf2['shift']());}}}(a12_0x189c,0x9e3ad));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';function a12_0x4498(_0xd7bd2d,_0x16fa0a){_0xd7bd2d=_0xd7bd2d-0xcf;const _0x189cf3=a12_0x189c();let _0x449802=_0x189cf3[_0xd7bd2d];return _0x449802;}import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';function a12_0x189c(){const _0x3a80c4=['Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','28129608qooyhx','Auth\x20config\x20reinitialized\x20in\x20','stdout','userCenterDisplayName','nonInteractive','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','Then\x20verify\x20with:\x20','info','Clear\x20from\x20global\x20config\x20(default)','envName','status','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','\x20doctor','Read\x20from\x20global\x20config\x20(default)','authRequired','349552APPIsV','\x20config.','env','\x20env\x20var','read','trim','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','\x20auth\x20status','length','Tip:\x20you\x20can\x20also\x20run:','write','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','success','Option\x20B:\x20apps\x20config\x20(','No\x20AccessKey\x20found\x20in\x20','472477XLUzlA','5260330szGZZd','57045cTpDhx','access-key','=ak_xxx','Write\x20to\x20global\x20config\x20(default)','Status:\x20valid','ClientAk','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','Clear\x20accessKey\x20from\x20config','newConfigFileName','stdin','isTTY','join','validation','test','\x20Current\x20env:\x20','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','AccessKey:\x20','accessKey','expired','daily','Auth\x20mode:\x20','104HcFSER','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','access_key','scope','logout','Shorthand\x20for\x20--access-key','boolean','repeat','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','push','Option\x20A:\x20','ACCESS_KEY','Show\x20current\x20authentication\x20status','str','AccessKey\x20cleared\x20from\x20','AccessKey\x20(ak_xxx...)','init','slice','auth','AccessKey\x20saved\x20to\x20','\x20config.\x20Nothing\x20to\x20clear.','6693162iAthUW','check','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','project','project\x20config','Missing\x20accessKey.','string','\x20Verify:\x20','`auth\x20login`\x20does\x20not\x20support\x20--yes.','production','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','global','code','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','global\x20config','bool','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','8NCzXOK','\x20config','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','3742476yAGLvf','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','cancelled'];a12_0x189c=function(){return _0x3a80c4;};return a12_0x189c();}import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';import{authDeviceDefinition,readStoredDeviceCode,deleteStoredDeviceCode,fetchDeviceToken,isStoredDeviceCodeExpired}from'../../commands/auth/device.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x397551=a12_0x4498;writeCliSideChannelLine(_0x397551(0xf8)+PRODUCT_CONFIG[_0x397551(0x106)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x397551(0x11b)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>');}function buildAccessKeySetupGuide(){const _0x3182b9=a12_0x4498;return[_0x3182b9(0xf8)+PRODUCT_CONFIG[_0x3182b9(0x106)]+':',USER_ACCESS_KEY_CREATE_URL,_0x3182b9(0x102)+CLI_BIN_NAME+_0x3182b9(0x129)]['join']('\x0a');}function canPromptForAccessKey(_0x2f434b){const _0x490347=a12_0x4498;return!_0x2f434b['nonInteractive']&&process[_0x490347(0x12c)][_0x490347(0x12d)]!==![]&&process[_0x490347(0x105)][_0x490347(0x12d)]!==![];}function resolveAuthScopeFlags(_0x5c6c7){const _0x4b0cd1=a12_0x4498;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x5c6c7[_0x4b0cd1(0xfa)](_0x4b0cd1(0xf6)),'explicitProject':_0x5c6c7[_0x4b0cd1(0xfa)]('project'),'policy':'global-default'}));}async function resolveAuthWriteInput(_0x1aed8e){const _0x1c7dad=a12_0x4498;let _0x5a31d6=(_0x1aed8e[_0x1c7dad(0xe3)]('access-key')||_0x1aed8e[_0x1c7dad(0xe3)]('ak')||'')[_0x1c7dad(0x117)]();const _0x2b8f8f=(_0x1aed8e[_0x1c7dad(0xe3)]('env')||'')[_0x1c7dad(0x117)]();if(!_0x5a31d6&&canPromptForAccessKey(_0x1aed8e))try{showAccessKeyCreateHint(),_0x5a31d6=await promptAccessKey('');}catch(_0x11b600){if(isAbortPrompt(_0x11b600))throw CliErrors[_0x1c7dad(0x101)]();throw _0x11b600;}if(!_0x5a31d6)throw CliErrors[_0x1c7dad(0x12f)](_0x1c7dad(0xf0),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x1c7dad(0x130)](_0x5a31d6))throw CliErrors['validation']('Invalid\x20accessKey\x20format:\x20\x22'+_0x5a31d6+'\x22',_0x1c7dad(0xf5));if(!_0x2b8f8f)return{'accessKey':_0x5a31d6};const _0x14a206=normalizeEnv(_0x2b8f8f);return{'accessKey':_0x5a31d6,'env':isDaily(_0x14a206)?_0x1c7dad(0xd4):isDev(_0x14a206)?'development':_0x1c7dad(0xf4)};}export const authDefinitions=[{'service':a12_0x4e6897(0xe8),'command':'login','description':a12_0x4e6897(0x10e),'risk':a12_0x4e6897(0x11c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x4e6897(0x124),'type':'string','description':a12_0x4e6897(0xe5)},{'name':'ak','type':a12_0x4e6897(0xf1),'description':a12_0x4e6897(0xdb)},{'name':a12_0x4e6897(0xf6),'type':a12_0x4e6897(0xdc),'description':a12_0x4e6897(0x126),'default':!![]},{'name':a12_0x4e6897(0xee),'type':a12_0x4e6897(0xdc),'description':a12_0x4e6897(0xd0),'default':![]}],async 'execute'(_0x4a0cff){const _0xa8caba=a12_0x4e6897;if(_0x4a0cff[_0xa8caba(0xfa)]('yes'))throw CliErrors['validation'](_0xa8caba(0xf3),'Use\x20`'+CLI_BIN_NAME+_0xa8caba(0xde)+CLI_BIN_NAME+_0xa8caba(0xd7));const _0xd6636=(_0x4a0cff[_0xa8caba(0xe3)]('access-key')||_0x4a0cff[_0xa8caba(0xe3)]('ak')||'')[_0xa8caba(0x117)]();if(!_0xd6636&&_0x4a0cff[_0xa8caba(0x107)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x5e4aa8=await resolveAuthWriteInput(_0x4a0cff),_0x24b408=resolveAuthScopeFlags(_0x4a0cff),_0x45159a=readScopedConfig(_0x24b408);_0x45159a[_0xa8caba(0xd2)]=_0x5e4aa8[_0xa8caba(0xd2)];_0x5e4aa8[_0xa8caba(0x114)]&&(_0x45159a[_0xa8caba(0x114)]=_0x5e4aa8[_0xa8caba(0x114)]);writeScopedConfig(_0x45159a,_0x24b408);const _0x47e115=_0x24b408[_0xa8caba(0xf6)]?'global':_0xa8caba(0xee),_0x405fc3=_0x45159a[_0xa8caba(0x114)]?_0xa8caba(0xcf)+_0x45159a[_0xa8caba(0x114)]+'.':'';return{'ok':!![],'message':_0xa8caba(0xe9)+_0x47e115+_0xa8caba(0x113)+_0x405fc3+_0xa8caba(0xf2)+CLI_BIN_NAME+_0xa8caba(0x119)};}},{'service':a12_0x4e6897(0xe8),'command':a12_0x4e6897(0xe6),'description':a12_0x4e6897(0x11d),'risk':a12_0x4e6897(0x11c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x4e6897(0x124),'type':'string','description':a12_0x4e6897(0xe5)},{'name':'ak','type':a12_0x4e6897(0xf1),'description':a12_0x4e6897(0xdb)},{'name':a12_0x4e6897(0x114),'type':'string','description':a12_0x4e6897(0xed)},{'name':a12_0x4e6897(0xf6),'type':a12_0x4e6897(0xdc),'description':a12_0x4e6897(0x126),'default':!![]},{'name':a12_0x4e6897(0xee),'type':'boolean','description':a12_0x4e6897(0xd0),'default':![]}],async 'execute'(_0x36f3f2){const _0x326919=a12_0x4e6897,_0xf93258=await resolveAuthWriteInput(_0x36f3f2),_0x3c933d=resolveAuthScopeFlags(_0x36f3f2),_0x150575={'accessKey':_0xf93258[_0x326919(0xd2)]};_0xf93258[_0x326919(0x114)]&&(_0x150575[_0x326919(0x114)]=_0xf93258[_0x326919(0x114)]);writeScopedConfig(_0x150575,_0x3c933d);const _0x353bc6=_0x3c933d[_0x326919(0xf6)]?_0x326919(0xf6):_0x326919(0xee),_0x281c15=_0x150575['env']?_0x326919(0xcf)+_0x150575[_0x326919(0x114)]+'.':'';return{'ok':!![],'message':_0x326919(0x104)+_0x353bc6+'\x20scope.'+_0x281c15+_0x326919(0xf2)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':'auth','command':a12_0x4e6897(0xda),'description':a12_0x4e6897(0x12a),'risk':a12_0x4e6897(0x11c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a12_0x4e6897(0xdc),'description':a12_0x4e6897(0x10b),'default':!![]},{'name':a12_0x4e6897(0xee),'type':a12_0x4e6897(0xdc),'description':a12_0x4e6897(0x118),'default':![]}],async 'execute'(_0x35dfa6){const _0x3ee8c8=a12_0x4e6897,_0xaae1d1=resolveAuthScopeFlags(_0x35dfa6),_0x262f65=readScopedConfig(_0xaae1d1),_0xca9f9f=!!_0x262f65[_0x3ee8c8(0xd2)];delete _0x262f65[_0x3ee8c8(0xd2)],writeScopedConfig(_0x262f65,_0xaae1d1);const _0x213ca7=_0xaae1d1['global']?'global':'project';if(_0xca9f9f)return{'ok':!![],'message':_0x3ee8c8(0xe4)+_0x213ca7+_0x3ee8c8(0x113)};return{'ok':!![],'message':_0x3ee8c8(0x120)+_0x213ca7+_0x3ee8c8(0xea)};}},{'service':'auth','command':a12_0x4e6897(0x10d),'description':a12_0x4e6897(0xe2),'risk':a12_0x4e6897(0x116),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x4e6897(0xf6),'type':'boolean','description':a12_0x4e6897(0x110),'default':!![]},{'name':a12_0x4e6897(0xee),'type':a12_0x4e6897(0xdc),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]},{'name':a12_0x4e6897(0xec),'type':a12_0x4e6897(0xdc),'description':a12_0x4e6897(0x100),'default':![]}],async 'execute'(_0x50d745){const _0x36876b=a12_0x4e6897,_0x2d48c5=resolveAuthScopeFlags(_0x50d745),_0x44ce3e=readScopedConfig(_0x2d48c5),_0x150c97=productEnvName(_0x36876b(0xe1)),_0x6a0970=productEnv('ACCESS_KEY')||undefined,_0xea50a1=_0x44ce3e[_0x36876b(0xd2)]||undefined,_0x4b8388=_0x6a0970||_0xea50a1,_0x3f6fa3=_0x6a0970?_0x150c97+_0x36876b(0x115):_0xea50a1?(_0x2d48c5['global']?_0x36876b(0xf6):_0x36876b(0xee))+_0x36876b(0xfd):null,_0x312d4d=[_0x36876b(0xd5)+AUTH_MODE[_0x36876b(0x128)]];if(_0x4b8388){const _0x3b6c7e=_0x4b8388['length']>0x8?''+_0x4b8388[_0x36876b(0xe7)](0x0,0x8)+'*'[_0x36876b(0xdd)](_0x4b8388[_0x36876b(0x11a)]-0x8):_0x4b8388;_0x312d4d[_0x36876b(0xdf)](_0x36876b(0xd1)+_0x3b6c7e+(_0x3f6fa3?'\x20(via\x20'+_0x3f6fa3+')':'')),_0x312d4d[_0x36876b(0xdf)]('Status:\x20valid');}if(!_0x4b8388){_0x312d4d['push'](''),_0x312d4d[_0x36876b(0xdf)]('No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:'),_0x312d4d[_0x36876b(0xdf)](''),_0x312d4d[_0x36876b(0xdf)](_0x36876b(0xe0)+CLI_BIN_NAME+'\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'),_0x312d4d['push'](''),_0x312d4d[_0x36876b(0xdf)](_0x36876b(0x11f)+PRODUCT_CONFIG[_0x36876b(0x12b)]+')'),_0x312d4d['push'](_0x36876b(0xfe)),_0x312d4d[_0x36876b(0xdf)](''),_0x312d4d[_0x36876b(0xdf)]('Option\x20C:\x20environment\x20variable'),_0x312d4d[_0x36876b(0xdf)]('\x20\x20export\x20'+_0x150c97+_0x36876b(0x125)),_0x312d4d['push'](''),_0x312d4d[_0x36876b(0xdf)](_0x36876b(0x109)+CLI_BIN_NAME+'\x20auth\x20status'),_0x312d4d[_0x36876b(0xdf)](_0x36876b(0x108)+CLI_BIN_NAME+_0x36876b(0x10f));if(_0x50d745[_0x36876b(0xfa)](_0x36876b(0xec))){const _0x46fa5c=readStoredDeviceCode();if(_0x46fa5c&&!isStoredDeviceCodeExpired(_0x46fa5c)){const _0x4cd6e4=getUserDomain(),_0xc33792=await fetchDeviceToken(_0x4cd6e4,_0x46fa5c[_0x36876b(0xf7)]);if(_0xc33792['status']===_0x36876b(0x11e)&&_0xc33792[_0x36876b(0xd8)]){const _0x204a08={'global':_0x46fa5c[_0x36876b(0xd9)]==='global'},_0x5ae594=readScopedConfig(_0x204a08);_0x5ae594[_0x36876b(0xd2)]=_0xc33792['access_key'],writeScopedConfig(_0x5ae594,_0x204a08),deleteStoredDeviceCode();const _0x5d5ef7=_0xc33792[_0x36876b(0xd8)],_0x544e7c=_0x5d5ef7[_0x36876b(0x11a)]>0x8?''+_0x5d5ef7['slice'](0x0,0x8)+'*'['repeat'](_0x5d5ef7[_0x36876b(0x11a)]-0x8):_0x5d5ef7,_0x5c6dbd=_0x46fa5c['scope']===_0x36876b(0xf6)?_0x36876b(0xf9):_0x36876b(0xef);return{'ok':!![],'message':['Auth\x20mode:\x20'+AUTH_MODE[_0x36876b(0x128)],_0x36876b(0xd1)+_0x544e7c+'\x20(via\x20'+_0x5c6dbd+')',_0x36876b(0x127)][_0x36876b(0x12e)]('\x0a')};}_0xc33792[_0x36876b(0x10d)]===_0x36876b(0xd3)&&deleteStoredDeviceCode();throw CliErrors[_0x36876b(0x111)](_0x36876b(0xfb));}throw CliErrors[_0x36876b(0x111)](_0x312d4d['join']('\x0a'));}}return{'ok':!![],'message':_0x312d4d[_0x36876b(0x12e)]('\x0a')};}},{'service':a12_0x4e6897(0xe8),'command':a12_0x4e6897(0x10a),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':a12_0x4e6897(0x116),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0xdc9c91){const _0x59573c=a12_0x4e6897,_0x18613f=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x18613f,'meta':{'env':_0xdc9c91[_0x59573c(0x10c)]??'production'}}};}},authDeviceDefinition];
1
+ const a12_0x254002=a12_0x328a;(function(_0x37f449,_0x5a3cc5){const _0x1aa902=a12_0x328a,_0x32f43b=_0x37f449();while(!![]){try{const _0x2d7314=-parseInt(_0x1aa902(0x1d9))/0x1+-parseInt(_0x1aa902(0x1d3))/0x2*(-parseInt(_0x1aa902(0x1f2))/0x3)+-parseInt(_0x1aa902(0x1cf))/0x4+parseInt(_0x1aa902(0x1f4))/0x5+parseInt(_0x1aa902(0x1ed))/0x6*(parseInt(_0x1aa902(0x1e0))/0x7)+-parseInt(_0x1aa902(0x1a9))/0x8*(-parseInt(_0x1aa902(0x1bb))/0x9)+-parseInt(_0x1aa902(0x1c5))/0xa*(parseInt(_0x1aa902(0x1c3))/0xb);if(_0x2d7314===_0x5a3cc5)break;else _0x32f43b['push'](_0x32f43b['shift']());}catch(_0x10e80d){_0x32f43b['push'](_0x32f43b['shift']());}}}(a12_0x4eea,0xc51a1));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';import{authDeviceDefinition,readStoredDeviceCode,deleteStoredDeviceCode,fetchDeviceToken,isStoredDeviceCodeExpired}from'../../commands/auth/device.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x491ac2=a12_0x328a;writeCliSideChannelLine(_0x491ac2(0x1dc)+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x491ac2(0x1fa)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>');}function buildAccessKeySetupGuide(){const _0x521a69=a12_0x328a;return['AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x521a69(0x1ec)]+':',USER_ACCESS_KEY_CREATE_URL,_0x521a69(0x1be)+CLI_BIN_NAME+_0x521a69(0x1d5)][_0x521a69(0x1a6)]('\x0a');}function canPromptForAccessKey(_0x2758d2){const _0x43890b=a12_0x328a;return!_0x2758d2[_0x43890b(0x1b9)]&&process['stdin']['isTTY']!==![]&&process[_0x43890b(0x1ba)][_0x43890b(0x1f8)]!==![];}function resolveAuthScopeFlags(_0xd2623d){const _0xdabde9=a12_0x328a;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0xd2623d[_0xdabde9(0x1bc)](_0xdabde9(0x1eb)),'explicitProject':_0xd2623d[_0xdabde9(0x1bc)](_0xdabde9(0x1ea)),'policy':_0xdabde9(0x1ac)}));}function a12_0x328a(_0x3bc12d,_0x46b4d2){_0x3bc12d=_0x3bc12d-0x1a3;const _0x4eea46=a12_0x4eea();let _0x328aab=_0x4eea46[_0x3bc12d];return _0x328aab;}async function resolveAuthWriteInput(_0x33462d){const _0x1226c7=a12_0x328a;let _0x2bd543=(_0x33462d['str'](_0x1226c7(0x1f5))||_0x33462d['str']('ak')||'')[_0x1226c7(0x1c6)]();const _0x273964=(_0x33462d[_0x1226c7(0x1a7)](_0x1226c7(0x1c9))||'')[_0x1226c7(0x1c6)]();if(!_0x2bd543&&canPromptForAccessKey(_0x33462d))try{showAccessKeyCreateHint(),_0x2bd543=await promptAccessKey('');}catch(_0x74c145){if(isAbortPrompt(_0x74c145))throw CliErrors[_0x1226c7(0x1b7)]();throw _0x74c145;}if(!_0x2bd543)throw CliErrors['validation'](_0x1226c7(0x1e5),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x1226c7(0x1a3)](_0x2bd543))throw CliErrors[_0x1226c7(0x1a8)](_0x1226c7(0x1d7)+_0x2bd543+'\x22',_0x1226c7(0x1ef));if(!_0x273964)return{'accessKey':_0x2bd543};const _0x5e80da=normalizeEnv(_0x273964);return{'accessKey':_0x2bd543,'env':isDaily(_0x5e80da)?_0x1226c7(0x1cc):isDev(_0x5e80da)?_0x1226c7(0x1aa):'production'};}export const authDefinitions=[{'service':'auth','command':a12_0x254002(0x1b2),'description':'Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','risk':a12_0x254002(0x1f1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x254002(0x1f5),'type':'string','description':a12_0x254002(0x1a4)},{'name':'ak','type':a12_0x254002(0x1a5),'description':a12_0x254002(0x1e9)},{'name':a12_0x254002(0x1eb),'type':a12_0x254002(0x1d2),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a12_0x254002(0x1ea),'type':'boolean','description':a12_0x254002(0x1e1),'default':![]}],async 'execute'(_0x4f0260){const _0x33db1d=a12_0x254002;if(_0x4f0260['bool']('yes'))throw CliErrors[_0x33db1d(0x1a8)]('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0x33db1d(0x1e6)+CLI_BIN_NAME+_0x33db1d(0x1fd)+CLI_BIN_NAME+_0x33db1d(0x1e2));const _0x4b4642=(_0x4f0260['str'](_0x33db1d(0x1f5))||_0x4f0260[_0x33db1d(0x1a7)]('ak')||'')[_0x33db1d(0x1c6)]();if(!_0x4b4642&&_0x4f0260[_0x33db1d(0x1b9)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x44ca73=await resolveAuthWriteInput(_0x4f0260),_0xd57845=resolveAuthScopeFlags(_0x4f0260),_0x24161a=readScopedConfig(_0xd57845);_0x24161a['accessKey']=_0x44ca73[_0x33db1d(0x1c4)];_0x44ca73[_0x33db1d(0x1c9)]&&(_0x24161a['env']=_0x44ca73[_0x33db1d(0x1c9)]);writeScopedConfig(_0x24161a,_0xd57845);const _0x11f96b=_0xd57845[_0x33db1d(0x1eb)]?_0x33db1d(0x1eb):_0x33db1d(0x1ea),_0xeb27d3=_0x24161a[_0x33db1d(0x1c9)]?_0x33db1d(0x1b3)+_0x24161a[_0x33db1d(0x1c9)]+'.':'';return{'ok':!![],'message':_0x33db1d(0x1cb)+_0x11f96b+_0x33db1d(0x1ad)+_0xeb27d3+_0x33db1d(0x1fb)+CLI_BIN_NAME+_0x33db1d(0x1af)};}},{'service':a12_0x254002(0x1c0),'command':a12_0x254002(0x1f6),'description':a12_0x254002(0x1ae),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x254002(0x1f5),'type':a12_0x254002(0x1a5),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a12_0x254002(0x1a5),'description':'Shorthand\x20for\x20--access-key'},{'name':'env','type':a12_0x254002(0x1a5),'description':a12_0x254002(0x1ca)},{'name':a12_0x254002(0x1eb),'type':a12_0x254002(0x1d2),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a12_0x254002(0x1d2),'description':a12_0x254002(0x1e1),'default':![]}],async 'execute'(_0x184e94){const _0xfc253e=a12_0x254002,_0x5d9512=await resolveAuthWriteInput(_0x184e94),_0x384499=resolveAuthScopeFlags(_0x184e94),_0x28bbe9={'accessKey':_0x5d9512[_0xfc253e(0x1c4)]};_0x5d9512[_0xfc253e(0x1c9)]&&(_0x28bbe9[_0xfc253e(0x1c9)]=_0x5d9512['env']);writeScopedConfig(_0x28bbe9,_0x384499);const _0x3585ab=_0x384499[_0xfc253e(0x1eb)]?_0xfc253e(0x1eb):_0xfc253e(0x1ea),_0x4691e8=_0x28bbe9['env']?_0xfc253e(0x1b3)+_0x28bbe9[_0xfc253e(0x1c9)]+'.':'';return{'ok':!![],'message':'Auth\x20config\x20reinitialized\x20in\x20'+_0x3585ab+_0xfc253e(0x1fc)+_0x4691e8+_0xfc253e(0x1fb)+CLI_BIN_NAME+_0xfc253e(0x1af)};}},{'service':a12_0x254002(0x1c0),'command':a12_0x254002(0x1cd),'description':a12_0x254002(0x1d8),'risk':a12_0x254002(0x1f1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a12_0x254002(0x1d2),'description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a12_0x254002(0x1d2),'description':a12_0x254002(0x1f0),'default':![]}],async 'execute'(_0x314d39){const _0x40d709=a12_0x254002,_0x312abb=resolveAuthScopeFlags(_0x314d39),_0x1797c=readScopedConfig(_0x312abb),_0x1a18e6=!!_0x1797c[_0x40d709(0x1c4)];delete _0x1797c[_0x40d709(0x1c4)],writeScopedConfig(_0x1797c,_0x312abb);const _0x58c8b7=_0x312abb[_0x40d709(0x1eb)]?_0x40d709(0x1eb):_0x40d709(0x1ea);if(_0x1a18e6)return{'ok':!![],'message':'AccessKey\x20cleared\x20from\x20'+_0x58c8b7+'\x20config.'};return{'ok':!![],'message':_0x40d709(0x1ee)+_0x58c8b7+_0x40d709(0x1de)};}},{'service':'auth','command':a12_0x254002(0x1e8),'description':a12_0x254002(0x1df),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x254002(0x1eb),'type':a12_0x254002(0x1d2),'description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':a12_0x254002(0x1ea),'type':a12_0x254002(0x1d2),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]},{'name':a12_0x254002(0x1ff),'type':a12_0x254002(0x1d2),'description':a12_0x254002(0x1d1),'default':![]}],async 'execute'(_0x75e972){const _0x1b3b38=a12_0x254002,_0x1fd5cb=resolveAuthScopeFlags(_0x75e972),_0x21607c=readScopedConfig(_0x1fd5cb),_0x482a8b=productEnvName(_0x1b3b38(0x1c8)),_0x223818=productEnv(_0x1b3b38(0x1c8))||undefined,_0x98214a=_0x21607c['accessKey']||undefined,_0x5bb36b=_0x223818||_0x98214a,_0x13c076=_0x223818?_0x482a8b+'\x20env\x20var':_0x98214a?(_0x1fd5cb[_0x1b3b38(0x1eb)]?_0x1b3b38(0x1eb):_0x1b3b38(0x1ea))+'\x20config':null,_0x3d8805=[_0x1b3b38(0x1e7)+AUTH_MODE[_0x1b3b38(0x1e3)]];if(_0x5bb36b){const _0x2206a1=_0x5bb36b[_0x1b3b38(0x1d4)]>0x8?''+_0x5bb36b[_0x1b3b38(0x1c7)](0x0,0x8)+'*'[_0x1b3b38(0x1d6)](_0x5bb36b[_0x1b3b38(0x1d4)]-0x8):_0x5bb36b;_0x3d8805[_0x1b3b38(0x1c1)](_0x1b3b38(0x1b4)+_0x2206a1+(_0x13c076?_0x1b3b38(0x1f9)+_0x13c076+')':'')),_0x3d8805['push']('Status:\x20valid');}if(!_0x5bb36b){_0x3d8805[_0x1b3b38(0x1c1)](''),_0x3d8805[_0x1b3b38(0x1c1)](_0x1b3b38(0x1bf)),_0x3d8805['push'](''),_0x3d8805[_0x1b3b38(0x1c1)]('Option\x20A:\x20'+CLI_BIN_NAME+_0x1b3b38(0x1e4)),_0x3d8805[_0x1b3b38(0x1c1)](''),_0x3d8805[_0x1b3b38(0x1c1)]('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x1b3b38(0x1c2)]+')'),_0x3d8805[_0x1b3b38(0x1c1)]('{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}'),_0x3d8805[_0x1b3b38(0x1c1)](''),_0x3d8805[_0x1b3b38(0x1c1)](_0x1b3b38(0x1bd)),_0x3d8805[_0x1b3b38(0x1c1)](_0x1b3b38(0x1d0)+_0x482a8b+_0x1b3b38(0x1ab)),_0x3d8805[_0x1b3b38(0x1c1)](''),_0x3d8805[_0x1b3b38(0x1c1)](_0x1b3b38(0x1dd)+CLI_BIN_NAME+_0x1b3b38(0x1af)),_0x3d8805['push'](_0x1b3b38(0x1b5)+CLI_BIN_NAME+'\x20doctor');if(_0x75e972['bool'](_0x1b3b38(0x1ff))){const _0x4bdb01=readStoredDeviceCode();if(_0x4bdb01&&!isStoredDeviceCodeExpired(_0x4bdb01)){const _0x2008b1=getUserDomain(),_0x3c36ca=await fetchDeviceToken(_0x2008b1,_0x4bdb01[_0x1b3b38(0x1b6)]);if(_0x3c36ca[_0x1b3b38(0x1e8)]===_0x1b3b38(0x1b0)&&_0x3c36ca[_0x1b3b38(0x1da)]){const _0x17b809={'global':_0x4bdb01[_0x1b3b38(0x1fe)]===_0x1b3b38(0x1eb)},_0x2b47e1=readScopedConfig(_0x17b809);_0x2b47e1[_0x1b3b38(0x1c4)]=_0x3c36ca[_0x1b3b38(0x1da)],writeScopedConfig(_0x2b47e1,_0x17b809),deleteStoredDeviceCode();const _0x532d58=_0x3c36ca['access_key'],_0x4319a2=_0x532d58[_0x1b3b38(0x1d4)]>0x8?''+_0x532d58[_0x1b3b38(0x1c7)](0x0,0x8)+'*'['repeat'](_0x532d58[_0x1b3b38(0x1d4)]-0x8):_0x532d58,_0x12edaf=_0x4bdb01[_0x1b3b38(0x1fe)]===_0x1b3b38(0x1eb)?_0x1b3b38(0x1f7):_0x1b3b38(0x1b8);return{'ok':!![],'message':[_0x1b3b38(0x1e7)+AUTH_MODE['ClientAk'],'AccessKey:\x20'+_0x4319a2+_0x1b3b38(0x1f9)+_0x12edaf+')','Status:\x20valid'][_0x1b3b38(0x1a6)]('\x0a')};}_0x3c36ca[_0x1b3b38(0x1e8)]===_0x1b3b38(0x1b1)&&deleteStoredDeviceCode();throw CliErrors[_0x1b3b38(0x1f3)]('Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.');}throw CliErrors['authRequired'](_0x3d8805[_0x1b3b38(0x1a6)]('\x0a'));}}return{'ok':!![],'message':_0x3d8805['join']('\x0a')};}},{'service':'auth','command':a12_0x254002(0x1db),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4e32d2){const _0x2477fc=a12_0x254002,_0x1750d2=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x1750d2,'meta':{'env':_0x4e32d2[_0x2477fc(0x1ce)]??'production'}}};}},authDeviceDefinition];function a12_0x4eea(){const _0x4d7fc5=['Missing\x20accessKey.','Use\x20`','Auth\x20mode:\x20','status','Shorthand\x20for\x20--access-key','project','global','userCenterDisplayName','6gmdIba','No\x20AccessKey\x20found\x20in\x20','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','write','2807643HQEPyf','authRequired','7930690SERwxP','access-key','init','global\x20config','isTTY','\x20(via\x20','Tip:\x20you\x20can\x20also\x20run:','\x20Verify:\x20','\x20scope.','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','scope','check','test','AccessKey\x20(ak_xxx...)','string','join','str','validation','632YJZeyb','development','=ak_xxx','global-default','\x20config.','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','\x20auth\x20status','success','expired','login','\x20Current\x20env:\x20','AccessKey:\x20','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','code','cancelled','project\x20config','nonInteractive','stdout','170865pkGbVb','bool','Option\x20C:\x20environment\x20variable','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','auth','push','newConfigFileName','3355IoBTPY','accessKey','86690OwIDay','trim','slice','ACCESS_KEY','env','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','AccessKey\x20saved\x20to\x20','daily','logout','envName','5146172kgAVNy','\x20\x20export\x20','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','boolean','2ZGOJkU','length','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','repeat','Invalid\x20accessKey\x20format:\x20\x22','Clear\x20accessKey\x20from\x20config','844002lfXyib','access_key','info','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','Then\x20verify\x20with:\x20','\x20config.\x20Nothing\x20to\x20clear.','Show\x20current\x20authentication\x20status','10920595SXRTcX','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','ClientAk','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'];a12_0x4eea=function(){return _0x4d7fc5;};return a12_0x4eea();}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @fileoverview Interactive prompt helpers for `auth` commands.
3
+ *
4
+ * Why a dedicated module: `auth/login` prompts for an AccessKey when not
5
+ * provided via flag, and both Ctrl+C and empty-input need careful handling.
6
+ * Sharing the prompt infrastructure here avoids duplicating the safe rl
7
+ * boilerplate across auth commands.
8
+ *
9
+ * Why `AbortPrompt` as a named class (not just a `throw "cancelled"` string):
10
+ * `isAbortPrompt()` can distinguish a user-initiated cancel from other errors
11
+ * by checking `err.name === "AbortPrompt"`, rather than string matching on
12
+ * the error message. This is more robust against future message changes.
13
+ *
14
+ * Why `Promise.race()` with `abortPromise` in every prompt: this ensures
15
+ * Ctrl+C is always detected regardless of whether the user types input.
16
+ * Without the race, the readline interface would swallow the SIGINT and the
17
+ * process would hang.
18
+ */
19
+ /**
20
+ * Prompts the user for an AccessKey using stdin.
21
+ *
22
+ * @param defaultVal - Pre-filled value shown in the prompt (returned if input is empty)
23
+ * @returns The user's input, trimmed; or `defaultVal` if the user pressed Enter without typing
24
+ * @throws `AbortPrompt` (via `Promise.race`) if the user presses Ctrl+C
25
+ */
26
+ export declare function promptAccessKey(defaultVal?: string): Promise<string>;
27
+ /**
28
+ * Checks whether an error originated from a user-initiated prompt cancellation.
29
+ *
30
+ * @param err - Any thrown value
31
+ * @returns `true` if `err` is an `AbortPrompt` thrown by `promptAccessKey`
32
+ */
33
+ export declare function isAbortPrompt(err: unknown): boolean;
@@ -1 +1 @@
1
- function a13_0xd8d8(){const _0x3d88c0=['7294842NqEeGd','1194BrQhHH','trim','AccessKey\x20(paste\x20ak_...):\x20','1833216SVbPSg','SIGINT','close','12105970teKqdv','3765giBTUl','1330650QOjdWS','question','name','removeListener','AccessKey\x20(','4zDEQaQ','270136mYcCcn','72PPDWrc','User\x20aborted\x20prompt','once','stdout','639372iivSsh'];a13_0xd8d8=function(){return _0x3d88c0;};return a13_0xd8d8();}(function(_0x22f4ff,_0x5d86ca){const _0x938a7d=a13_0x2ee2,_0x1cfb39=_0x22f4ff();while(!![]){try{const _0x15b285=-parseInt(_0x938a7d(0xa0))/0x1+parseInt(_0x938a7d(0xa2))/0x2*(-parseInt(_0x938a7d(0xa9))/0x3)+parseInt(_0x938a7d(0xaf))/0x4*(-parseInt(_0x938a7d(0xaa))/0x5)+parseInt(_0x938a7d(0xa1))/0x6+parseInt(_0x938a7d(0xa5))/0x7+-parseInt(_0x938a7d(0xb0))/0x8*(parseInt(_0x938a7d(0x9c))/0x9)+parseInt(_0x938a7d(0xa8))/0xa;if(_0x15b285===_0x5d86ca)break;else _0x1cfb39['push'](_0x1cfb39['shift']());}catch(_0x4d68b0){_0x1cfb39['push'](_0x1cfb39['shift']());}}}(a13_0xd8d8,0xba61b));function a13_0x2ee2(_0x4847c9,_0x39d75b){_0x4847c9=_0x4847c9-0x9c;const _0xd8d8af=a13_0xd8d8();let _0x2ee22c=_0xd8d8af[_0x4847c9];return _0x2ee22c;}import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x1fad62=a13_0x2ee2;super(_0x1fad62(0x9d)),this[_0x1fad62(0xac)]='AbortPrompt';}}function createSafeRl(){const _0x52a93d=a13_0x2ee2,_0xbde5b5=createInterface({'input':process['stdin'],'output':process[_0x52a93d(0x9f)]});let _0x10d31c;const _0x51940a=new Promise((_0x1b2a9f,_0x14b7d7)=>{const _0x48a0de=_0x52a93d;_0x10d31c=()=>{const _0x4ba77e=a13_0x2ee2;_0x10d31c&&(_0xbde5b5['removeListener'](_0x4ba77e(0xa6),_0x10d31c),_0x10d31c=undefined);try{_0xbde5b5[_0x4ba77e(0xa7)]();}catch{}_0x14b7d7(new AbortPrompt());},_0xbde5b5[_0x48a0de(0x9e)](_0x48a0de(0xa6),_0x10d31c);}),_0x42c472=()=>{const _0x150b45=_0x52a93d;_0x10d31c&&(_0xbde5b5[_0x150b45(0xad)](_0x150b45(0xa6),_0x10d31c),_0x10d31c=undefined);try{_0xbde5b5[_0x150b45(0xa7)]();}catch{}};return{'rl':_0xbde5b5,'abortPromise':_0x51940a,'disposeSuccess':_0x42c472};}export async function promptAccessKey(_0x3cd63e=''){const {rl:_0x85aff0,abortPromise:_0x2f4b81,disposeSuccess:_0x4a0e17}=createSafeRl(),_0x103446=new Promise(_0x555ef3=>{const _0x10c31d=a13_0x2ee2,_0x4ea52f=_0x3cd63e?_0x10c31d(0xae)+_0x3cd63e+'):\x20':_0x10c31d(0xa4);_0x85aff0[_0x10c31d(0xab)](_0x4ea52f,_0x14caf5=>{const _0x3791fc=_0x10c31d;_0x4a0e17(),_0x555ef3(_0x14caf5[_0x3791fc(0xa3)]()||_0x3cd63e);});});return Promise['race']([_0x103446,_0x2f4b81]);}export function isAbortPrompt(_0x5f1080){return _0x5f1080 instanceof Error&&_0x5f1080['name']==='AbortPrompt';}
1
+ (function(_0x583f6f,_0x6a2e4e){const _0x3b633e=a13_0x1528,_0x2d7213=_0x583f6f();while(!![]){try{const _0x1e065d=parseInt(_0x3b633e(0x138))/0x1*(-parseInt(_0x3b633e(0x129))/0x2)+-parseInt(_0x3b633e(0x131))/0x3+parseInt(_0x3b633e(0x133))/0x4+parseInt(_0x3b633e(0x12d))/0x5*(-parseInt(_0x3b633e(0x127))/0x6)+parseInt(_0x3b633e(0x132))/0x7*(-parseInt(_0x3b633e(0x12e))/0x8)+parseInt(_0x3b633e(0x130))/0x9+parseInt(_0x3b633e(0x136))/0xa;if(_0x1e065d===_0x6a2e4e)break;else _0x2d7213['push'](_0x2d7213['shift']());}catch(_0x3a3652){_0x2d7213['push'](_0x2d7213['shift']());}}}(a13_0x2f75,0xcebf9));import{createInterface}from'node:readline';function a13_0x1528(_0xc0f3a9,_0x2820b1){_0xc0f3a9=_0xc0f3a9-0x126;const _0x2f75df=a13_0x2f75();let _0x152892=_0x2f75df[_0xc0f3a9];return _0x152892;}class AbortPrompt extends Error{constructor(){const _0x205265=a13_0x1528;super('User\x20aborted\x20prompt'),this['name']=_0x205265(0x134);}}function createSafeRl(){const _0x5a3b77=a13_0x1528,_0x227fdd=createInterface({'input':process[_0x5a3b77(0x139)],'output':process[_0x5a3b77(0x13b)]});let _0x29de66;const _0x5225c1=new Promise((_0x20f988,_0xbb51a1)=>{const _0x1d17ac=_0x5a3b77;_0x29de66=()=>{const _0x10ac60=a13_0x1528;_0x29de66&&(_0x227fdd['removeListener'](_0x10ac60(0x12a),_0x29de66),_0x29de66=undefined);try{_0x227fdd[_0x10ac60(0x126)]();}catch{}_0xbb51a1(new AbortPrompt());},_0x227fdd[_0x1d17ac(0x13a)]('SIGINT',_0x29de66);}),_0x12509f=()=>{const _0x58a459=_0x5a3b77;_0x29de66&&(_0x227fdd[_0x58a459(0x12c)](_0x58a459(0x12a),_0x29de66),_0x29de66=undefined);try{_0x227fdd[_0x58a459(0x126)]();}catch{}};return{'rl':_0x227fdd,'abortPromise':_0x5225c1,'disposeSuccess':_0x12509f};}export async function promptAccessKey(_0x2d8bf9=''){const _0x1222a=a13_0x1528,{rl:_0x120390,abortPromise:_0x27f8b3,disposeSuccess:_0x4a9d1a}=createSafeRl(),_0x29d7d=new Promise(_0x116667=>{const _0x4479ae=a13_0x1528,_0x4603d0=_0x2d8bf9?_0x4479ae(0x135)+_0x2d8bf9+_0x4479ae(0x12f):'AccessKey\x20(paste\x20ak_...):\x20';_0x120390['question'](_0x4603d0,_0x2acad2=>{const _0xeffd65=_0x4479ae;_0x4a9d1a(),_0x116667(_0x2acad2[_0xeffd65(0x128)]()||_0x2d8bf9);});});return Promise[_0x1222a(0x12b)]([_0x29d7d,_0x27f8b3]);}export function isAbortPrompt(_0x4f12c0){const _0x7e3c36=a13_0x1528;return _0x4f12c0 instanceof Error&&_0x4f12c0[_0x7e3c36(0x137)]===_0x7e3c36(0x134);}function a13_0x2f75(){const _0x1e7d9d=['AccessKey\x20(','28638040ZqDbGG','name','23kHIVqW','stdin','once','stdout','close','6JoTMUq','trim','141326CeKxuR','SIGINT','race','removeListener','3393620XieTKm','496iggOlW','):\x20','10792701FRnvMV','5080401TtWBwd','89068JFgnhF','6280704xiWLxm','AbortPrompt'];a13_0x2f75=function(){return _0x1e7d9d;};return a13_0x2f75();}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @fileoverview `bff detail` command — inspects one known endpoint by function name.
3
+ *
4
+ * Runtime callers identify BFFs by appCode + functionName. Platform IDs and raw
5
+ * source metadata are intentionally not accepted or returned by this command.
6
+ */
7
+ import type { CommandDefinition } from "../../framework/types.js";
8
+ export declare const bffDetail: CommandDefinition;
@@ -1 +1 @@
1
- function a14_0x15d3(_0x55d700,_0x204d58){_0x55d700=_0x55d700-0xe9;const _0x5e4a2a=a14_0x5e4a();let _0x15d383=_0x5e4a2a[_0x55d700];return _0x15d383;}const a14_0x443138=a14_0x15d3;function a14_0x5e4a(){const _0x4fd555=['775780qOsYSo','name','description','detail','read','bff','1793eUAKKZ','appCode','(none)','654ORdlUs','1708gmuVrA','gmtModified','231pHxHJp','BFF\x20function\x20name','Get\x20a\x20BFF\x20endpoint\x20contract\x20by\x20function\x20name','1620iLUrPt','9240mrJOhl','4685DouEKh','version','783hvrPGl','3875988BThTnP','177630nrPkWC','28670KGfXxG','functionName'];a14_0x5e4a=function(){return _0x4fd555;};return a14_0x5e4a();}(function(_0xefacb8,_0x104194){const _0x4f7b60=a14_0x15d3,_0x2842a2=_0xefacb8();while(!![]){try{const _0xb8d131=-parseInt(_0x4f7b60(0xff))/0x1+parseInt(_0x4f7b60(0xf0))/0x2*(-parseInt(_0x4f7b60(0xf6))/0x3)+-parseInt(_0x4f7b60(0xf1))/0x4*(parseInt(_0x4f7b60(0xf8))/0x5)+-parseInt(_0x4f7b60(0xfc))/0x6*(-parseInt(_0x4f7b60(0xf3))/0x7)+parseInt(_0x4f7b60(0xf7))/0x8*(parseInt(_0x4f7b60(0xfa))/0x9)+-parseInt(_0x4f7b60(0xfd))/0xa*(-parseInt(_0x4f7b60(0xed))/0xb)+parseInt(_0x4f7b60(0xfb))/0xc;if(_0xb8d131===_0x104194)break;else _0x2842a2['push'](_0x2842a2['shift']());}catch(_0x70dd8){_0x2842a2['push'](_0x2842a2['shift']());}}}(a14_0x5e4a,0x7dcef));import{getBffEndpointContract}from'../../core/api-client.js';import{NAME_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a14_0x443138(0xec),'command':a14_0x443138(0xea),'description':a14_0x443138(0xf5),'risk':a14_0x443138(0xeb),'flags':[{...NAME_FLAG,'required':!![],'description':a14_0x443138(0xf4)}],async 'execute'(_0x5492f8){const _0x3f7b94=a14_0x443138,_0x5ada37=await getBffEndpointContract(_0x5492f8[_0x3f7b94(0xee)],_0x5492f8['str'](_0x3f7b94(0x100)));return{'ok':!![],'data':{'appCode':_0x5ada37[_0x3f7b94(0xee)],'functionName':_0x5ada37[_0x3f7b94(0xfe)],'description':_0x5ada37[_0x3f7b94(0xe9)]||_0x3f7b94(0xef),'version':_0x5ada37[_0x3f7b94(0xf9)],'gmtModified':_0x5ada37[_0x3f7b94(0xf2)]}};}};
1
+ const a14_0x488733=a14_0x2950;(function(_0x295c6d,_0x3a64f8){const _0x28fa94=a14_0x2950,_0x128298=_0x295c6d();while(!![]){try{const _0x35ca0a=parseInt(_0x28fa94(0x1c9))/0x1*(parseInt(_0x28fa94(0x1c6))/0x2)+-parseInt(_0x28fa94(0x1c3))/0x3+parseInt(_0x28fa94(0x1c1))/0x4*(parseInt(_0x28fa94(0x1c2))/0x5)+parseInt(_0x28fa94(0x1bf))/0x6+-parseInt(_0x28fa94(0x1ce))/0x7*(-parseInt(_0x28fa94(0x1c7))/0x8)+-parseInt(_0x28fa94(0x1ba))/0x9*(-parseInt(_0x28fa94(0x1c4))/0xa)+-parseInt(_0x28fa94(0x1bd))/0xb*(parseInt(_0x28fa94(0x1c8))/0xc);if(_0x35ca0a===_0x3a64f8)break;else _0x128298['push'](_0x128298['shift']());}catch(_0x4f1df8){_0x128298['push'](_0x128298['shift']());}}}(a14_0x466b,0x31b25));import{getBffEndpointContract}from'../../core/api-client.js';function a14_0x2950(_0x1e9604,_0xe360b0){_0x1e9604=_0x1e9604-0x1b9;const _0x466ba7=a14_0x466b();let _0x295096=_0x466ba7[_0x1e9604];return _0x295096;}function a14_0x466b(){const _0x435001=['functionName','name','185353kxkqnV','description','335313cFrpRD','version','appCode','22ABDzRB','str','2363862Pvqjwv','Get\x20a\x20BFF\x20endpoint\x20contract\x20by\x20function\x20name','16CJawcN','450620DoLjVM','1086144breHKC','10wZWbhC','read','13922cyqNcK','16DSDbEE','2133924fvvPAB','11gaBDxP','bff','gmtModified'];a14_0x466b=function(){return _0x435001;};return a14_0x466b();}import{NAME_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a14_0x488733(0x1ca),'command':'detail','description':a14_0x488733(0x1c0),'risk':a14_0x488733(0x1c5),'flags':[{...NAME_FLAG,'required':!![],'description':'BFF\x20function\x20name'}],async 'execute'(_0x2a8568){const _0x5d61d9=a14_0x488733,_0x3509ca=await getBffEndpointContract(_0x2a8568[_0x5d61d9(0x1bc)],_0x2a8568[_0x5d61d9(0x1be)](_0x5d61d9(0x1cd)));return{'ok':!![],'data':{'appCode':_0x3509ca[_0x5d61d9(0x1bc)],'functionName':_0x3509ca[_0x5d61d9(0x1cc)],'description':_0x3509ca[_0x5d61d9(0x1b9)]||'(none)','version':_0x3509ca[_0x5d61d9(0x1bb)],'gmtModified':_0x3509ca[_0x5d61d9(0x1cb)]}};}};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @fileoverview `bff exec` command — executes a BFF script by function name.
3
+ *
4
+ * Why `risk: "read"`: BFF script execution is a runtime query. Whether the
5
+ * script reads or writes data is determined by the script itself; the CLI
6
+ * cannot know ahead of time. Using `"read"` avoids prompting for `--yes`
7
+ * on every invocation. If the script performs writes, its Studio definition
8
+ * governs those actions.
9
+ *
10
+ * Why `risk: "read"` rather than `"write"`: scripts that only read are the
11
+ * common case. Requiring `--yes` for all executions would be too intrusive.
12
+ * Scripts that perform high-risk operations are controlled at the Studio
13
+ * permission level, not at the CLI invocation level.
14
+ *
15
+ * Design decision: timing is reported back to the user (`elapsed` in ms).
16
+ * This helps developers tune performance without requiring verbose flags.
17
+ */
18
+ import type { CommandDefinition } from "../../framework/types.js";
19
+ export declare const bffExec: CommandDefinition;
@@ -1 +1 @@
1
- const a15_0x4774e3=a15_0x586c;(function(_0x52d97a,_0x1e7226){const _0x3cf176=a15_0x586c,_0x3d209c=_0x52d97a();while(!![]){try{const _0x303b25=parseInt(_0x3cf176(0xdf))/0x1+parseInt(_0x3cf176(0xe1))/0x2+-parseInt(_0x3cf176(0xe8))/0x3*(-parseInt(_0x3cf176(0xe4))/0x4)+parseInt(_0x3cf176(0xe2))/0x5+parseInt(_0x3cf176(0xe3))/0x6+parseInt(_0x3cf176(0xea))/0x7+-parseInt(_0x3cf176(0xdd))/0x8;if(_0x303b25===_0x1e7226)break;else _0x3d209c['push'](_0x3d209c['shift']());}catch(_0x3168a0){_0x3d209c['push'](_0x3d209c['shift']());}}}(a15_0x5090,0x60e8e));import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';function a15_0x586c(_0x404183,_0x1bef14){_0x404183=_0x404183-0xdb;const _0x509085=a15_0x5090();let _0x586c09=_0x509085[_0x404183];return _0x586c09;}import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a15_0x4774e3(0xdb),'command':a15_0x4774e3(0xe9),'description':'Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','risk':a15_0x4774e3(0xe5),'flags':[{...NAME_FLAG,'required':!![],'description':'BFF\x20function\x20name\x20to\x20execute'},PARAMS_FLAG],async 'execute'(_0x151437){const _0x44c46e=a15_0x4774e3,_0x259b23=parseJsonParams(_0x151437[_0x44c46e(0xe6)](_0x44c46e(0xde))),_0x4acadd=Date[_0x44c46e(0xe0)](),_0x116dc7=await executeSdkBff(_0x151437['str'](_0x44c46e(0xe7)),_0x259b23),_0x5e50d2=Date['now']()-_0x4acadd;return{'ok':!![],'data':{'result':_0x116dc7,'elapsed':_0x5e50d2},'message':_0x44c46e(0xdc)+_0x5e50d2+'ms'};}};function a15_0x5090(){const _0x2699a1=['now','144358rxeBTq','854880PgIFJW','2264094AmuZLU','160fkISEF','read','str','name','10083zmXQjj','exec','626633dpulAR','bff','BFF\x20executed\x20in\x20','5991568jxnqFw','params','301425nsIpPn'];a15_0x5090=function(){return _0x2699a1;};return a15_0x5090();}
1
+ const a15_0x22a680=a15_0x1215;(function(_0x3404a7,_0x272af3){const _0x3d5ad5=a15_0x1215,_0x18f2a6=_0x3404a7();while(!![]){try{const _0x4a0e67=parseInt(_0x3d5ad5(0x97))/0x1+-parseInt(_0x3d5ad5(0x8c))/0x2+-parseInt(_0x3d5ad5(0x9d))/0x3*(-parseInt(_0x3d5ad5(0x8e))/0x4)+parseInt(_0x3d5ad5(0x90))/0x5*(-parseInt(_0x3d5ad5(0x95))/0x6)+parseInt(_0x3d5ad5(0x9a))/0x7*(-parseInt(_0x3d5ad5(0x9b))/0x8)+-parseInt(_0x3d5ad5(0x99))/0x9+-parseInt(_0x3d5ad5(0x94))/0xa*(-parseInt(_0x3d5ad5(0x9e))/0xb);if(_0x4a0e67===_0x272af3)break;else _0x18f2a6['push'](_0x18f2a6['shift']());}catch(_0x429050){_0x18f2a6['push'](_0x18f2a6['shift']());}}}(a15_0x4bf2,0xa6b70));import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a15_0x1215(_0x2cd914,_0x272617){_0x2cd914=_0x2cd914-0x8b;const _0x4bf252=a15_0x4bf2();let _0x1215e8=_0x4bf252[_0x2cd914];return _0x1215e8;}function a15_0x4bf2(){const _0x3f1223=['str','807455AukMqa','Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','8575326NTsoxc','399XffxWj','132592nCRzMC','read','3VlyGit','88QoQoEY','name','356136IeZtOm','bff','3250844ZWAdBB','now','2035mdBTdN','BFF\x20function\x20name\x20to\x20execute','BFF\x20executed\x20in\x20','exec','2026250OmDGhV','7116uwWquS'];a15_0x4bf2=function(){return _0x3f1223;};return a15_0x4bf2();}export const bffExec={'service':a15_0x22a680(0x8d),'command':a15_0x22a680(0x93),'description':a15_0x22a680(0x98),'risk':a15_0x22a680(0x9c),'flags':[{...NAME_FLAG,'required':!![],'description':a15_0x22a680(0x91)},PARAMS_FLAG],async 'execute'(_0x11efc5){const _0x91602b=a15_0x22a680,_0x55c4bd=parseJsonParams(_0x11efc5['str']('params')),_0x315a92=Date[_0x91602b(0x8f)](),_0x46e5ed=await executeSdkBff(_0x11efc5[_0x91602b(0x96)](_0x91602b(0x8b)),_0x55c4bd),_0x28f19e=Date[_0x91602b(0x8f)]()-_0x315a92;return{'ok':!![],'data':{'result':_0x46e5ed,'elapsed':_0x28f19e},'message':_0x91602b(0x92)+_0x28f19e+'ms'};}};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @fileoverview `bff` command group — exports the declarative definition list.
3
+ *
4
+ * Why this module exists: the framework registry (`registry.ts`) imports
5
+ * `bffDefinitions` directly. The actual command definitions are split into
6
+ * `exec.ts` (run) and `detail.ts` (inspect) to keep each file focused.
7
+ * This index re-exports them as a single array for registration.
8
+ *
9
+ * Why only exec + detail (no list/save): Lovrabet Runtime CLI targets
10
+ * the runtime environment where scripts are managed in the Studio UI.
11
+ * The CLI provides execution and inspection, not script lifecycle management.
12
+ * List/save belong to the development CLI (`rabetbase`).
13
+ */
14
+ import type { CommandDefinition } from "../../framework/types.js";
15
+ export declare const bffDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- (function(_0x10e93e,_0x35af48){const _0x2f03fd=a16_0x4913,_0x5ded50=_0x10e93e();while(!![]){try{const _0x3b124a=-parseInt(_0x2f03fd(0xaa))/0x1*(-parseInt(_0x2f03fd(0xad))/0x2)+-parseInt(_0x2f03fd(0xb1))/0x3*(-parseInt(_0x2f03fd(0xb2))/0x4)+parseInt(_0x2f03fd(0xaf))/0x5+-parseInt(_0x2f03fd(0xab))/0x6*(-parseInt(_0x2f03fd(0xb0))/0x7)+parseInt(_0x2f03fd(0xae))/0x8+-parseInt(_0x2f03fd(0xac))/0x9*(-parseInt(_0x2f03fd(0xa9))/0xa)+-parseInt(_0x2f03fd(0xa8))/0xb;if(_0x3b124a===_0x35af48)break;else _0x5ded50['push'](_0x5ded50['shift']());}catch(_0x535df0){_0x5ded50['push'](_0x5ded50['shift']());}}}(a16_0x8542,0x933ff));function a16_0x4913(_0x213686,_0x2f444c){_0x213686=_0x213686-0xa8;const _0x854260=a16_0x8542();let _0x491365=_0x854260[_0x213686];return _0x491365;}import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';function a16_0x8542(){const _0x12d540=['8VxuHOs','24858152CPACBK','171140MXRcxB','14neOorg','3020382kRrUSx','18cbHatB','152094CDjCpZ','5265176lyzmeQ','1568555IKmVKD','7AhXAnD','433239oCpmMt'];a16_0x8542=function(){return _0x12d540;};return a16_0x8542();}export const bffDefinitions=[bffDetail,bffExec];
1
+ (function(_0x2fee72,_0x965f0b){const _0x5a4a25=a16_0x1b95,_0x1e5ddf=_0x2fee72();while(!![]){try{const _0x850182=parseInt(_0x5a4a25(0x1e7))/0x1+parseInt(_0x5a4a25(0x1e5))/0x2+parseInt(_0x5a4a25(0x1ea))/0x3+-parseInt(_0x5a4a25(0x1e6))/0x4*(-parseInt(_0x5a4a25(0x1ec))/0x5)+-parseInt(_0x5a4a25(0x1e9))/0x6+-parseInt(_0x5a4a25(0x1e8))/0x7+parseInt(_0x5a4a25(0x1e4))/0x8*(-parseInt(_0x5a4a25(0x1eb))/0x9);if(_0x850182===_0x965f0b)break;else _0x1e5ddf['push'](_0x1e5ddf['shift']());}catch(_0x1d64e6){_0x1e5ddf['push'](_0x1e5ddf['shift']());}}}(a16_0x3eef,0x443d4));import{bffDetail}from'../../commands/bff/detail.js';function a16_0x3eef(){const _0x558c7a=['469836gzpcgA','484460DdgLMA','2754577uVqrkW','2169510wFnrai','914250hvnvQN','5507991cjaYhF','20TAVntS','8UKhIuo','775114zPwCdN'];a16_0x3eef=function(){return _0x558c7a;};return a16_0x3eef();}function a16_0x1b95(_0x54ad08,_0x12a74c){_0x54ad08=_0x54ad08-0x1e4;const _0x3eef9b=a16_0x3eef();let _0x1b9502=_0x3eef9b[_0x54ad08];return _0x1b9502;}import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @fileoverview `cli-skill` command definitions.
3
+ *
4
+ * CLI Built-in Skill is the Skill package required by the Lovrabet CLI runtime
5
+ * itself. It is separate from business Skills managed by `lovrabet skill`.
6
+ */
7
+ import type { CommandDefinition } from "../../framework/types.js";
8
+ /** Declarative definitions for the `cli-skill` service. */
9
+ export declare const cliSkillDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- function a17_0x588c(_0xbdfe02,_0x19d763){_0xbdfe02=_0xbdfe02-0x10d;const _0x1c001c=a17_0x1c00();let _0x588c79=_0x1c001c[_0xbdfe02];return _0x588c79;}const a17_0x6e5b7f=a17_0x588c;(function(_0x1f8835,_0xeecd60){const _0x16f806=a17_0x588c,_0x46c18e=_0x1f8835();while(!![]){try{const _0x9bfe72=-parseInt(_0x16f806(0x111))/0x1*(parseInt(_0x16f806(0x124))/0x2)+-parseInt(_0x16f806(0x11f))/0x3*(-parseInt(_0x16f806(0x112))/0x4)+-parseInt(_0x16f806(0x123))/0x5*(-parseInt(_0x16f806(0x114))/0x6)+parseInt(_0x16f806(0x118))/0x7*(parseInt(_0x16f806(0x119))/0x8)+-parseInt(_0x16f806(0x11c))/0x9+parseInt(_0x16f806(0x121))/0xa+-parseInt(_0x16f806(0x10f))/0xb;if(_0x9bfe72===_0xeecd60)break;else _0x46c18e['push'](_0x46c18e['shift']());}catch(_0x3cab0e){_0x46c18e['push'](_0x46c18e['shift']());}}}(a17_0x1c00,0x38fae));import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':a17_0x6e5b7f(0x12a),'description':a17_0x6e5b7f(0x113),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3994fb){const _0x3cf48a=a17_0x6e5b7f;logger[_0x3cf48a(0x115)](process[_0x3cf48a(0x12b)]()),logger['info'](_0x3cf48a(0x128),_0x3cf48a(0x116));const {LOVRABET_SKILL_SOURCE:_0x4a8fa,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x119ef4,runNpxSkillsAddGlobal:_0x1aef18}=await import(_0x3cf48a(0x110)),_0x1cba3b=_0x3994fb[_0x3cf48a(0x129)]?_0x3cf48a(0x11d):_0x3cf48a(0x127);console[_0x3cf48a(0x125)]('Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(npx\x20skills\x20add\x20'+_0x4a8fa+'\x20-g\x20-y)...');const _0x1d655d=_0x1aef18(process[_0x3cf48a(0x12b)](),_0x4a8fa,{'stdio':_0x1cba3b});if(_0x1d655d[_0x3cf48a(0x117)])console[_0x3cf48a(0x125)](_0x3cf48a(0x12c)+_0x119ef4+_0x3cf48a(0x120));else{if(_0x1d655d['ok'])console[_0x3cf48a(0x125)](_0x3cf48a(0x126));else throw CliErrors[_0x3cf48a(0x11b)](_0x3cf48a(0x11a)+(_0x1d655d[_0x3cf48a(0x10e)]||_0x3cf48a(0x11e)),_0x3cf48a(0x122)+_0x4a8fa+_0x3cf48a(0x10d));}return{'ok':!![]};}}];function a17_0x1c00(){const _0x75e852=['skipped','210ZAlSlH','28008pdOsLL','npx\x20skills\x20add\x20failed:\x20','apiError','758754yyaRHP','pipe','unknown','9219UwHwWg','=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','2713290hBtHLo','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20npx\x20skills\x20add\x20','472830xtTtBg','2GhtcpA','log','CLI\x20Built-in\x20Skill\x20installed','inherit','cli-skill-install','nonInteractive','install','cwd','Skipped\x20npx\x20(','\x20-g\x20-y','error','1896224WpRPvx','../../skills/npx-skills-add.js','331167fIbdoe','456VIuXho','Install\x20the\x20CLI\x20Built-in\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','6SCxqkj','setLogPath','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.'];a17_0x1c00=function(){return _0x75e852;};return a17_0x1c00();}
1
+ const a17_0x16d66d=a17_0x2dee;(function(_0x3e87cc,_0x44b521){const _0x6de4a2=a17_0x2dee,_0x59815d=_0x3e87cc();while(!![]){try{const _0x2ec03d=parseInt(_0x6de4a2(0x187))/0x1+parseInt(_0x6de4a2(0x194))/0x2+parseInt(_0x6de4a2(0x18c))/0x3+-parseInt(_0x6de4a2(0x18f))/0x4+-parseInt(_0x6de4a2(0x183))/0x5*(-parseInt(_0x6de4a2(0x196))/0x6)+-parseInt(_0x6de4a2(0x191))/0x7+-parseInt(_0x6de4a2(0x18a))/0x8;if(_0x2ec03d===_0x44b521)break;else _0x59815d['push'](_0x59815d['shift']());}catch(_0x369f4e){_0x59815d['push'](_0x59815d['shift']());}}}(a17_0x3660,0x85a97));function a17_0x3660(){const _0xd099da=['cwd','skipped','=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','info','55cxoWms','Skipped\x20npx\x20(','\x20-g\x20-y)...','log','804163AoKbaq','cli-skill-install','install','8523896vhtXwQ','unknown','2093505twymNN','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20npx\x20skills\x20add\x20','write','4290416QDdgmb','inherit','805665XmzDjd','npx\x20skills\x20add\x20failed:\x20','\x20-g\x20-y','798416rJbqTh','CLI\x20Built-in\x20Skill\x20installed','490614myrBYw','../../skills/npx-skills-add.js','nonInteractive'];a17_0x3660=function(){return _0xd099da;};return a17_0x3660();}import{CliErrors}from'../../errors.js';function a17_0x2dee(_0x46e8a5,_0x1ca059){_0x46e8a5=_0x46e8a5-0x17d;const _0x36600d=a17_0x3660();let _0x2dee28=_0x36600d[_0x46e8a5];return _0x2dee28;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':a17_0x16d66d(0x189),'description':'Install\x20the\x20CLI\x20Built-in\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','risk':a17_0x16d66d(0x18e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1b92a6){const _0x30b29e=a17_0x16d66d;logger['setLogPath'](process[_0x30b29e(0x17f)]()),logger[_0x30b29e(0x182)](_0x30b29e(0x188),'Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.');const {LOVRABET_SKILL_SOURCE:_0x3184af,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x3b7ad9,runNpxSkillsAddGlobal:_0x852990}=await import(_0x30b29e(0x17d)),_0x3203f3=_0x1b92a6[_0x30b29e(0x17e)]?'pipe':_0x30b29e(0x190);console[_0x30b29e(0x186)]('Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(npx\x20skills\x20add\x20'+_0x3184af+_0x30b29e(0x185));const _0x30f274=_0x852990(process[_0x30b29e(0x17f)](),_0x3184af,{'stdio':_0x3203f3});if(_0x30f274[_0x30b29e(0x180)])console[_0x30b29e(0x186)](_0x30b29e(0x184)+_0x3b7ad9+_0x30b29e(0x181));else{if(_0x30f274['ok'])console['log'](_0x30b29e(0x195));else throw CliErrors['apiError'](_0x30b29e(0x192)+(_0x30f274['error']||_0x30b29e(0x18b)),_0x30b29e(0x18d)+_0x3184af+_0x30b29e(0x193));}return{'ok':!![]};}}];