@lovrabet/lovrabet-cli 2.1.18-beta.1 → 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 -1
  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(_0x162059,_0x2c4355){const _0x483033=a7_0x1851,_0x4e1250=_0x162059();while(!![]){try{const _0x5f248c=-parseInt(_0x483033(0x1c1))/0x1+-parseInt(_0x483033(0x1c5))/0x2*(parseInt(_0x483033(0x1bc))/0x3)+parseInt(_0x483033(0x1ce))/0x4*(-parseInt(_0x483033(0x1c9))/0x5)+-parseInt(_0x483033(0x1bb))/0x6+parseInt(_0x483033(0x1ba))/0x7*(parseInt(_0x483033(0x1bf))/0x8)+-parseInt(_0x483033(0x1cb))/0x9+parseInt(_0x483033(0x1c3))/0xa;if(_0x5f248c===_0x2c4355)break;else _0x4e1250['push'](_0x4e1250['shift']());}catch(_0x5533cd){_0x4e1250['push'](_0x4e1250['shift']());}}}(a7_0x163e,0xcee69));import{CLI_BIN_NAME}from'../../constant/cli.js';import{formatScopeLabel}from'../../commands/common/config-policy.js';function a7_0x1851(_0x5f1253,_0x3413e3){_0x5f1253=_0x5f1253-0x1b8;const _0x163e2a=a7_0x163e();let _0x1851ea=_0x163e2a[_0x5f1253];return _0x1851ea;}function a7_0x163e(){const _0xe65bc4=['3556479AXWxzI','name','appCode','46320BNGBrB','trim','1187421bwhAAq','isCurrent','36290910ZljwYe','currentApp','2DeWTaa','appcode','named','defaultApp','40GeuMEo','project','791352OcqeqD','find','global','321716RGotEG','definedIn','local','1148iQkaxZ','3761472iLJUie'];a7_0x163e=function(){return _0xe65bc4;};return a7_0x163e();}export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x49a1ba,_0x4981a1){const _0x2bb935=a7_0x1851;if(!_0x4981a1)return;const _0x52c38d=!!(_0x4981a1['currentApp']??_0x4981a1[_0x2bb935(0x1c8)]);for(const _0x58f922 of _0x49a1ba){_0x58f922[_0x2bb935(0x1c2)]=![];}const _0x334d74=_0x4981a1[_0x2bb935(0x1be)]!=null?String(_0x4981a1[_0x2bb935(0x1be)])[_0x2bb935(0x1c0)]():'';if(_0x52c38d){const _0x3d2af8=_0x4981a1[_0x2bb935(0x1c4)]??_0x4981a1[_0x2bb935(0x1c8)];if(_0x3d2af8){const _0x22587b=_0x49a1ba[_0x2bb935(0x1cc)](_0x35a761=>_0x35a761[_0x2bb935(0x1c7)]===!![]&&_0x35a761[_0x2bb935(0x1bd)]===_0x3d2af8&&_0x35a761[_0x2bb935(0x1b8)]===_0x2bb935(0x1b9)),_0x60ed43=_0x22587b??_0x49a1ba[_0x2bb935(0x1cc)](_0x53206a=>_0x53206a[_0x2bb935(0x1c7)]===!![]&&_0x53206a[_0x2bb935(0x1bd)]===_0x3d2af8);if(_0x60ed43){const _0x511b6d=String(_0x60ed43['appcode']??'')['trim']();if(!_0x334d74||_0x511b6d===_0x334d74){_0x60ed43['isCurrent']=!![];return;}}}if(_0x334d74){const _0x2ee7fe=_0x49a1ba[_0x2bb935(0x1cc)](_0x379d4a=>String(_0x379d4a[_0x2bb935(0x1c6)]??'')[_0x2bb935(0x1c0)]()===_0x334d74);_0x2ee7fe&&(_0x2ee7fe[_0x2bb935(0x1c2)]=!![]);}return;}if(!_0x334d74)return;for(const _0x24afe6 of _0x49a1ba){String(_0x24afe6[_0x2bb935(0x1c6)]??'')['trim']()===_0x334d74&&(_0x24afe6['isCurrent']=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x318ff1){const _0x50658d=a7_0x1851;return formatScopeLabel(_0x318ff1[_0x50658d(0x1cd)]?_0x50658d(0x1cd):_0x50658d(0x1ca));}
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
- const a8_0x3a3d6d=a8_0x4999;(function(_0x166cf7,_0x48c134){const _0xe27181=a8_0x4999,_0x5bbcd3=_0x166cf7();while(!![]){try{const _0x39199d=-parseInt(_0xe27181(0x83))/0x1*(-parseInt(_0xe27181(0x9a))/0x2)+parseInt(_0xe27181(0x92))/0x3+-parseInt(_0xe27181(0x93))/0x4*(parseInt(_0xe27181(0x8a))/0x5)+-parseInt(_0xe27181(0x8d))/0x6*(-parseInt(_0xe27181(0x87))/0x7)+-parseInt(_0xe27181(0x85))/0x8+-parseInt(_0xe27181(0x95))/0x9+-parseInt(_0xe27181(0x8e))/0xa*(-parseInt(_0xe27181(0x94))/0xb);if(_0x39199d===_0x48c134)break;else _0x5bbcd3['push'](_0x5bbcd3['shift']());}catch(_0x4205a1){_0x5bbcd3['push'](_0x5bbcd3['shift']());}}}(a8_0xd87e,0x929be));import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a8_0x4999(_0x4ca41a,_0x42882e){_0x4ca41a=_0x4ca41a-0x83;const _0xd87e8f=a8_0xd87e();let _0x4999d2=_0xd87e8f[_0x4ca41a];return _0x4999d2;}function a8_0xd87e(){const _0x49b7af=['apiError','338vFwkxS','get','2799864cbCZLA','\x20app-config\x20get\x20<key>','12866cvtYoY','validation','Usage:\x20','145335vtELkn','appCode','Missing\x20app-config\x20key.','162vwplEc','703070rDKntW','Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','trim','Unable\x20to\x20get\x20app-config\x20value:\x20key=','487785fMwkNI','8ZdHvMU','110HtDPzV','4729878lrwkDF','args',',\x20appCode=','read','app-config','3662QsCoBb','key'];a8_0xd87e=function(){return _0x49b7af;};return a8_0xd87e();}import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':a8_0x3a3d6d(0x99),'command':a8_0x3a3d6d(0x84),'description':a8_0x3a3d6d(0x8f),'risk':a8_0x3a3d6d(0x98),'args':[{'name':a8_0x3a3d6d(0x9b),'description':'App\x20config\x20key','required':!![]}],'flags':[],async 'execute'(_0x298621){const _0x15704c=a8_0x3a3d6d,_0x214a08=_0x298621[_0x15704c(0x96)][0x0]?.[_0x15704c(0x90)]();if(!_0x214a08)throw CliErrors[_0x15704c(0x88)](_0x15704c(0x8c),_0x15704c(0x89)+CLI_BIN_NAME+_0x15704c(0x86));try{const _0x560e0a=await getRuntimeAppConfigByKey(_0x298621[_0x15704c(0x8b)],_0x214a08);return{'ok':!![],'data':_0x560e0a};}catch{throw CliErrors[_0x15704c(0x9c)](_0x15704c(0x91)+_0x214a08+_0x15704c(0x97)+_0x298621[_0x15704c(0x8b)],'Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.');}}};
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_0x2fd6(_0x2babd1,_0x8744e){_0x2babd1=_0x2babd1-0x112;const _0x34a3d6=a9_0x34a3();let _0x2fd66d=_0x34a3d6[_0x2babd1];return _0x2fd66d;}function a9_0x34a3(){const _0x58e697=['2fJQLFN','1520052STcswf','35kIYbVJ','4917172geThOm','3477355clkJxL','3798219SDAirm','917880DgBXSY','15868413tqmdyR','1192866HmnCZR'];a9_0x34a3=function(){return _0x58e697;};return a9_0x34a3();}(function(_0x3ad853,_0x2607ab){const _0x215bdd=a9_0x2fd6,_0x4b7af4=_0x3ad853();while(!![]){try{const _0x53bae2=-parseInt(_0x215bdd(0x114))/0x1+parseInt(_0x215bdd(0x113))/0x2*(parseInt(_0x215bdd(0x118))/0x3)+parseInt(_0x215bdd(0x116))/0x4+-parseInt(_0x215bdd(0x115))/0x5*(parseInt(_0x215bdd(0x112))/0x6)+-parseInt(_0x215bdd(0x117))/0x7+parseInt(_0x215bdd(0x119))/0x8+parseInt(_0x215bdd(0x11a))/0x9;if(_0x53bae2===_0x2607ab)break;else _0x4b7af4['push'](_0x4b7af4['shift']());}catch(_0x5be534){_0x4b7af4['push'](_0x4b7af4['shift']());}}}(a9_0x34a3,0xeb89c));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_0x5ed6d5=a10_0x25f0;(function(_0x2a1ec8,_0x5f47ff){const _0x946e91=a10_0x25f0,_0x5414d0=_0x2a1ec8();while(!![]){try{const _0x1b8d04=parseInt(_0x946e91(0x1fa))/0x1+-parseInt(_0x946e91(0x235))/0x2+-parseInt(_0x946e91(0x22e))/0x3+-parseInt(_0x946e91(0x223))/0x4*(parseInt(_0x946e91(0x21c))/0x5)+parseInt(_0x946e91(0x234))/0x6+-parseInt(_0x946e91(0x208))/0x7+parseInt(_0x946e91(0x219))/0x8;if(_0x1b8d04===_0x5f47ff)break;else _0x5414d0['push'](_0x5414d0['shift']());}catch(_0x388a9c){_0x5414d0['push'](_0x5414d0['shift']());}}}(a10_0x41c5,0x844ee));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='react_module',ARTIFACT_SOURCE_AGENT=a10_0x5ed6d5(0x20f),ALLOWED_REACT_MODULE_IMPORTS=['react',a10_0x5ed6d5(0x201),a10_0x5ed6d5(0x221),'dayjs',a10_0x5ed6d5(0x227),a10_0x5ed6d5(0x218)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a10_0x5ed6d5(0x22f)](',\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_0x5ed6d5(0x200),'type':a10_0x5ed6d5(0x217),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file'},ARTIFACT_NAME_FLAG={'name':a10_0x5ed6d5(0x1f5),'type':a10_0x5ed6d5(0x217),'description':'Artifact\x20display\x20name'},METADATA_FLAG={'name':a10_0x5ed6d5(0x229),'type':a10_0x5ed6d5(0x217),'description':a10_0x5ed6d5(0x205)};function isPlainObject(_0x4d8efc){const _0x2ab1d5=a10_0x5ed6d5;return typeof _0x4d8efc===_0x2ab1d5(0x207)&&_0x4d8efc!==null&&!Array[_0x2ab1d5(0x222)](_0x4d8efc);}function a10_0x41c5(){const _0x3ca246=['2796717bsrNBd','description','list','create','List\x20current-app\x20react_module\x20Artifacts','read','source','AGENT','update','map','exec','validation','flag','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','Artifact\x20ID','string','@ant-design/icons','17743136grHPEv','.\x20Unsupported:\x20','parse','60WdjHOp','split','length','content','build','lodash','isArray','274132HKgQPc','/client/artifact/create','Show\x20one\x20Artifact\x20by\x20id','deleted','antd','createTime','metadata','isFile','body','startsWith','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','2663364yEfRJT','join','react_module\x20imports\x20are\x20limited\x20to:\x20','Created\x20Artifact\x20','appCode','includes','268014jWBLwB','271772AwnRLL','bool','filter','write','artifact','updateTime','num','detail','name','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','str','/update','Updated\x20Artifact\x20','524974iKyNlt','POST','test','utf8','artifactType','verbose','file','react-dom','trim','File\x20path\x20is\x20required.','boolean','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','favorite','object'];a10_0x41c5=function(){return _0x3ca246;};return a10_0x41c5();}function readSourceFile(_0x5e78e1){const _0x2bc8e5=a10_0x5ed6d5;if(!_0x5e78e1)throw CliErrors[_0x2bc8e5(0x213)](_0x2bc8e5(0x203));if(!existsSync(_0x5e78e1))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x5e78e1);if(!statSync(_0x5e78e1)[_0x2bc8e5(0x22a)]())throw CliErrors[_0x2bc8e5(0x213)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x5e78e1);const _0x13dacc=readFileSync(_0x5e78e1,_0x2bc8e5(0x1fd));return validateReactModuleSource(_0x13dacc),_0x13dacc;}function a10_0x25f0(_0x5ed8e5,_0x3788d1){_0x5ed8e5=_0x5ed8e5-0x1f0;const _0x41c57f=a10_0x41c5();let _0x25f056=_0x41c57f[_0x5ed8e5];return _0x25f056;}function parseMetadata(_0x29d136){const _0x508bfa=a10_0x5ed6d5;if(!_0x29d136)return undefined;let _0x1c238b;try{_0x1c238b=JSON[_0x508bfa(0x21b)](_0x29d136);}catch{throw CliErrors[_0x508bfa(0x213)]('Invalid\x20JSON\x20for\x20--metadata:\x20'+_0x29d136);}if(!isPlainObject(_0x1c238b))throw CliErrors[_0x508bfa(0x213)]('--metadata\x20must\x20be\x20a\x20JSON\x20object.');const _0xf44ac0={..._0x1c238b};return delete _0xf44ac0['compiledContent'],_0xf44ac0;}function getPackageName(_0x36644a){const _0x4fe451=a10_0x5ed6d5;if(_0x36644a[_0x4fe451(0x22c)]('@')){const [_0x290fc5,_0x1ab531]=_0x36644a[_0x4fe451(0x21d)]('/');return _0x290fc5&&_0x1ab531?_0x290fc5+'/'+_0x1ab531:_0x36644a;}return _0x36644a[_0x4fe451(0x21d)]('/')[0x0]||_0x36644a;}function validateAllowedImports(_0x71e079){const _0x26860f=a10_0x5ed6d5,_0x5037a5=new Set();for(const _0x16cd6a of IMPORT_SOURCE_PATTERNS){_0x16cd6a['lastIndex']=0x0;let _0x136c4c;while((_0x136c4c=_0x16cd6a[_0x26860f(0x212)](_0x71e079))!==null){const _0x1f8c17=_0x136c4c[0x1]?.[_0x26860f(0x202)]();_0x1f8c17&&_0x5037a5['add'](_0x1f8c17);}}const _0x58bd92=[..._0x5037a5][_0x26860f(0x211)](getPackageName)[_0x26860f(0x237)](_0x33ed61=>!ALLOWED_REACT_MODULE_IMPORTS[_0x26860f(0x233)](_0x33ed61));if(_0x58bd92[_0x26860f(0x21e)]>0x0)throw CliErrors['validation'](_0x26860f(0x230)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x26860f(0x21a)+[...new Set(_0x58bd92)][_0x26860f(0x22f)](',\x20'));}export function validateReactModuleSource(_0x4590ae){const _0x1aa2d6=a10_0x5ed6d5;if(!_0x4590ae[_0x1aa2d6(0x202)]())throw CliErrors['validation']('Artifact\x20source\x20file\x20is\x20blank.');if(PAGE_LEVEL_PATTERNS['some'](_0x35c6a1=>_0x35c6a1[_0x1aa2d6(0x1fc)](_0x4590ae)))throw CliErrors[_0x1aa2d6(0x213)]('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x4590ae);}function buildArtifactInput(_0x7bc14a){const _0x23b2c4=a10_0x5ed6d5,_0x321c44=readSourceFile(_0x7bc14a['str'](_0x23b2c4(0x200))),_0x14ee8a=_0x7bc14a[_0x23b2c4(0x1f7)](_0x23b2c4(0x1f5))[_0x23b2c4(0x202)](),_0x2f550d=parseMetadata(_0x7bc14a[_0x23b2c4(0x1f7)]('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x14ee8a?{'name':_0x14ee8a}:{},'content':_0x321c44,..._0x2f550d?{'metadata':_0x2f550d}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x92137f){const _0xcc890a=a10_0x5ed6d5;return{'id':_0x92137f['id'],'name':_0x92137f[_0xcc890a(0x1f5)],'artifactType':_0x92137f['artifactType'],'source':_0x92137f['source'],'favorite':_0x92137f[_0xcc890a(0x206)],'deleted':_0x92137f[_0xcc890a(0x226)],'createTime':_0x92137f['createTime'],'updateTime':_0x92137f[_0xcc890a(0x1f2)]};}function detailArtifact(_0x477260){const _0x3b72a9=a10_0x5ed6d5;return{'id':_0x477260['id'],'appCode':_0x477260['appCode'],'name':_0x477260[_0x3b72a9(0x1f5)],'artifactType':_0x477260[_0x3b72a9(0x1fe)],'source':_0x477260[_0x3b72a9(0x20e)],'favorite':_0x477260['favorite'],'deleted':_0x477260[_0x3b72a9(0x226)],'content':_0x477260[_0x3b72a9(0x21f)]??'','compiledContent':_0x477260['compiledContent'],'metadata':_0x477260['metadata']??{},'createTime':_0x477260[_0x3b72a9(0x228)],'updateTime':_0x477260['updateTime']};}function readFavoriteFlag(_0x4cf535){const _0x3eb54a=a10_0x5ed6d5,_0x3acf6d=_0x4cf535[_0x3eb54a(0x214)](_0x3eb54a(0x206));return _0x3acf6d===undefined||_0x3acf6d===null||_0x3acf6d===''?undefined:_0x4cf535[_0x3eb54a(0x236)](_0x3eb54a(0x206));}const artifactList={'service':a10_0x5ed6d5(0x1f1),'command':a10_0x5ed6d5(0x20a),'description':a10_0x5ed6d5(0x20c),'risk':a10_0x5ed6d5(0x20d),'flags':[{'name':a10_0x5ed6d5(0x20e),'type':a10_0x5ed6d5(0x217),'description':a10_0x5ed6d5(0x215)},{'name':a10_0x5ed6d5(0x206),'type':a10_0x5ed6d5(0x204),'description':'Optional\x20favorite-state\x20filter'},VERBOSE_FLAG],async 'execute'(_0x3f2d2f){const _0xb7fd44=a10_0x5ed6d5,_0x1abf1c=await listRuntimeArtifacts(_0x3f2d2f[_0xb7fd44(0x232)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x3f2d2f[_0xb7fd44(0x1f7)]('source')?{'source':_0x3f2d2f['str'](_0xb7fd44(0x20e))}:{},...readFavoriteFlag(_0x3f2d2f)!==undefined?{'favorite':readFavoriteFlag(_0x3f2d2f)}:{}});return{'ok':!![],'data':{'total':_0x1abf1c[_0xb7fd44(0x21e)],'items':_0x3f2d2f['bool'](_0xb7fd44(0x1ff))?_0x1abf1c:_0x1abf1c[_0xb7fd44(0x211)](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':a10_0x5ed6d5(0x1f4),'description':a10_0x5ed6d5(0x225),'risk':a10_0x5ed6d5(0x20d),'flags':[{...ID_FLAG,'description':a10_0x5ed6d5(0x216)}],async 'execute'(_0x5368a9){const _0x186bbf=a10_0x5ed6d5,_0x23a3d2=await getRuntimeArtifact(_0x5368a9['num']('id'),_0x5368a9[_0x186bbf(0x232)]);return{'ok':!![],'data':detailArtifact(_0x23a3d2)};}},artifactCreate={'service':a10_0x5ed6d5(0x1f1),'command':a10_0x5ed6d5(0x20b),'description':a10_0x5ed6d5(0x1f6),'risk':a10_0x5ed6d5(0x1f0),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x54db5f){const _0x13583f=a10_0x5ed6d5,_0x1f630c=buildArtifactInput(_0x54db5f),_0x515578=await createRuntimeArtifact(_0x54db5f[_0x13583f(0x232)],_0x1f630c);return{'ok':!![],'data':detailArtifact(_0x515578),'message':_0x13583f(0x231)+_0x515578['id']+(_0x515578[_0x13583f(0x1f5)]?'\x20('+_0x515578[_0x13583f(0x1f5)]+')':'')};},async 'dryRun'(_0x45f27f){const _0x3ec245=a10_0x5ed6d5,_0x53cd42=buildArtifactInput(_0x45f27f);return dryRun(_0x3ec245(0x1fb),_0x3ec245(0x224))[_0x3ec245(0x22b)]({'appCode':_0x45f27f[_0x3ec245(0x232)],..._0x53cd42})[_0x3ec245(0x209)]('Preview:\x20create\x20react_module\x20Artifact')[_0x3ec245(0x220)]();}},artifactUpdate={'service':a10_0x5ed6d5(0x1f1),'command':a10_0x5ed6d5(0x210),'description':a10_0x5ed6d5(0x22d),'risk':a10_0x5ed6d5(0x1f0),'flags':[{...ID_FLAG,'description':a10_0x5ed6d5(0x216)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x4a1027){const _0x53d22f=a10_0x5ed6d5,_0x2703b7=_0x4a1027['num']('id'),_0x1f6d13=buildArtifactInput(_0x4a1027),_0x434464=await updateRuntimeArtifact(_0x2703b7,_0x4a1027[_0x53d22f(0x232)],_0x1f6d13);return{'ok':!![],'data':detailArtifact(_0x434464),'message':_0x53d22f(0x1f9)+_0x434464['id']+(_0x434464[_0x53d22f(0x1f5)]?'\x20('+_0x434464[_0x53d22f(0x1f5)]+')':'')};},async 'dryRun'(_0x4aed12){const _0x2470b0=a10_0x5ed6d5,_0xb8e90b=_0x4aed12[_0x2470b0(0x1f3)]('id'),_0x7b5394=buildArtifactInput(_0x4aed12);return dryRun(_0x2470b0(0x1fb),'/client/artifact/'+_0xb8e90b+_0x2470b0(0x1f8))['body']({'appCode':_0x4aed12[_0x2470b0(0x232)],..._0x7b5394})['description']('Preview:\x20update\x20react_module\x20Artifact\x20'+_0xb8e90b)[_0x2470b0(0x220)]();}};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_0x4dea68=a11_0x49c5;(function(_0x526b50,_0x219690){const _0x1c0e4b=a11_0x49c5,_0x431a62=_0x526b50();while(!![]){try{const _0x578b16=-parseInt(_0x1c0e4b(0x1db))/0x1*(-parseInt(_0x1c0e4b(0x1d8))/0x2)+parseInt(_0x1c0e4b(0x1fc))/0x3*(parseInt(_0x1c0e4b(0x1eb))/0x4)+-parseInt(_0x1c0e4b(0x1af))/0x5*(-parseInt(_0x1c0e4b(0x1fb))/0x6)+parseInt(_0x1c0e4b(0x1e6))/0x7*(parseInt(_0x1c0e4b(0x1da))/0x8)+parseInt(_0x1c0e4b(0x1bf))/0x9*(-parseInt(_0x1c0e4b(0x1ca))/0xa)+parseInt(_0x1c0e4b(0x1cb))/0xb+-parseInt(_0x1c0e4b(0x1f3))/0xc;if(_0x578b16===_0x219690)break;else _0x431a62['push'](_0x431a62['shift']());}catch(_0x111e6e){_0x431a62['push'](_0x431a62['shift']());}}}(a11_0x1a34,0xd814c));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';function a11_0x1a34(){const _0x123563=['aborted','\x20auth\x20device','status','project','\x20config.','expired','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','name','7432341ScURpX','global-default','auth','json','code','6544bUesrI','\x0dWaiting\x20for\x20authorization...\x20','),\x20retrying...','&source=','string','AccessKey\x20saved\x20to\x20','Write\x20to\x20project\x20config','cancelled','14369244RHqzBV','application/json','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','Device\x20authorization\x20cancelled.','homeDirName','str','padStart','7170hakQVW','1356WEyUkB','networkError','getTime','log','After\x20authorizing,\x20re-run:\x20','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','access_key','50RxcUlx','scope','write','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','Device\x20authorization\x20successful.','SIGINT','/.device-auth','Device\x20auth\x20API\x20returned\x20HTTP\x20','stderr','test','/api/device-auth/token','Authorize\x20via\x20device\x20code\x20flow\x20(open\x20browser,\x20no\x20copy-paste)','lovrabet-cli','removeListener','Invalid\x20device\x20auth\x20response','global','909JTybeH','url-only','Device\x20auth\x20API\x20error\x20(','accessKey','floor','utf8','Invalid\x20access_key\x20returned\x20by\x20server.','stringify','validation','abort','POST','154040GZoPxl','5554483QxwJJo','source','object','createdAt','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','signal','success','bool','boolean','apiError','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','toISOString','AbortError','26142QoneSa','data','8oNQfSa','101KONxBP','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','once'];a11_0x1a34=function(){return _0x123563;};return a11_0x1a34();}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(_0x3d17be){const _0x153443=a11_0x49c5;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x3d17be[_0x153443(0x1d2)]('global'),'explicitProject':_0x3d17be[_0x153443(0x1d2)]('project'),'policy':_0x153443(0x1e7)}));}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(){return crypto['randomUUID']();}export function buildDeviceAuthUrl(_0x50406b,_0x85892f,_0x3dd58d=a11_0x4dea68(0x1bb)){const _0x59171c=a11_0x4dea68;return _0x50406b+'/device-auth?code='+encodeURIComponent(_0x85892f)+_0x59171c(0x1ee)+encodeURIComponent(_0x3dd58d);}export function getDeviceCodePath(){const _0x5ab852=a11_0x4dea68;return homedir()+'/'+PRODUCT_CONFIG[_0x5ab852(0x1f8)]+_0x5ab852(0x1b5);}export function readStoredDeviceCode(){const _0xf44f5b=a11_0x4dea68,_0x1f321c=getDeviceCodePath();if(!existsSync(_0x1f321c))return null;try{const _0x1a5683=readFileSync(_0x1f321c,{'encoding':_0xf44f5b(0x1c4)}),_0x201c15=JSON['parse'](_0x1a5683);if(_0x201c15&&typeof _0x201c15[_0xf44f5b(0x1ea)]===_0xf44f5b(0x1ef)&&typeof _0x201c15[_0xf44f5b(0x1ce)]===_0xf44f5b(0x1ef)&&(_0x201c15[_0xf44f5b(0x1b0)]==='global'||_0x201c15[_0xf44f5b(0x1b0)]==='project'))return _0x201c15;}catch{}return null;}function a11_0x49c5(_0x108e3b,_0xa94e01){_0x108e3b=_0x108e3b-0x1ad;const _0x1a34fd=a11_0x1a34();let _0x49c59=_0x1a34fd[_0x108e3b];return _0x49c59;}export function writeStoredDeviceCode(_0x430dc1,_0x13c84e){const _0x442817=a11_0x4dea68,_0x47bdec=getDeviceCodePath(),_0x5d2c0b=dirname(_0x47bdec);!existsSync(_0x5d2c0b)&&mkdirSync(_0x5d2c0b,{'recursive':!![]});const _0x5ce2a6={'code':_0x430dc1,'createdAt':new Date()[_0x442817(0x1d6)](),'scope':_0x13c84e};writeFileSync(_0x47bdec,JSON['stringify'](_0x5ce2a6),{'encoding':_0x442817(0x1c4),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x41fb04=getDeviceCodePath();try{unlinkSync(_0x41fb04);}catch{}}export function isStoredDeviceCodeExpired(_0x378793){const _0x14ae17=a11_0x4dea68;return Date['now']()-new Date(_0x378793[_0x14ae17(0x1ce)])[_0x14ae17(0x1fe)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0xd71526,_0x10dad5){const _0x942892=a11_0x4dea68,_0x28cc4e=_0xd71526+_0x942892(0x1b9),_0x11998b=new AbortController(),_0x3d4454=setTimeout(()=>_0x11998b[_0x942892(0x1c8)](),0x2710),_0x23ad35=await fetch(_0x28cc4e,{'method':_0x942892(0x1c9),'headers':{'Content-Type':_0x942892(0x1f4)},'body':JSON[_0x942892(0x1c6)]({'code':_0x10dad5}),'signal':_0x11998b[_0x942892(0x1d0)]});clearTimeout(_0x3d4454);if(!_0x23ad35['ok'])throw CliErrors[_0x942892(0x1fd)](_0x942892(0x1b6)+_0x23ad35[_0x942892(0x1e0)]);const _0x2dcd92=await _0x23ad35[_0x942892(0x1e9)](),_0x4da4ed=_0x2dcd92[_0x942892(0x1d9)]&&typeof _0x2dcd92['data']===_0x942892(0x1cd)?_0x2dcd92[_0x942892(0x1d9)]:_0x2dcd92;if(!_0x4da4ed||typeof _0x4da4ed['status']!==_0x942892(0x1ef))throw CliErrors['apiError'](_0x942892(0x1bd));return{'status':_0x4da4ed[_0x942892(0x1e0)],'access_key':typeof _0x4da4ed[_0x942892(0x1ae)]===_0x942892(0x1ef)?_0x4da4ed['access_key']:undefined};}export async function pollDeviceToken(_0x5d6c55,_0x164f74,_0x29ec65){const _0x17db3b=a11_0x4dea68;let _0x39b82a=0x0;for(let _0x2bd422=0x0;_0x2bd422<MAX_POLLS;_0x2bd422++){if(_0x29ec65[_0x17db3b(0x1de)])throw CliErrors[_0x17db3b(0x1f2)](_0x17db3b(0x1f7));let _0x100611;try{_0x100611=await fetchDeviceToken(_0x5d6c55,_0x164f74);}catch(_0x4fa960){if(_0x4fa960 instanceof Error&&_0x4fa960[_0x17db3b(0x1e5)]===_0x17db3b(0x1d7))throw CliErrors[_0x17db3b(0x1f2)](_0x17db3b(0x1f7));_0x39b82a++;if(_0x39b82a>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x17db3b(0x1fd)](_0x17db3b(0x1f5));writeCliSideChannelLine(_0x17db3b(0x1c1)+_0x39b82a+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x17db3b(0x1ed)),await sleep(POLL_INTERVAL_MS);continue;}_0x39b82a=0x0;if(_0x100611[_0x17db3b(0x1e0)]===_0x17db3b(0x1d1)){if(!_0x100611[_0x17db3b(0x1ae)])throw CliErrors[_0x17db3b(0x1d4)](_0x17db3b(0x1c5));return _0x100611['access_key'];}if(_0x100611[_0x17db3b(0x1e0)]===_0x17db3b(0x1e3)){deleteStoredDeviceCode();throw CliErrors['validation'](_0x17db3b(0x1d5));}const _0x2c8238=(_0x2bd422+0x1)*POLL_INTERVAL_MS,_0x5723f7=DEVICE_CODE_TTL_MS-_0x2c8238,_0x292cad=Math[_0x17db3b(0x1c3)](_0x5723f7/0xea60),_0x33d145=Math['floor'](_0x5723f7%0xea60/0x3e8);process[_0x17db3b(0x1b7)]['write'](_0x17db3b(0x1ec)+_0x292cad+':'+String(_0x33d145)[_0x17db3b(0x1fa)](0x2,'0')+'\x20remaining'),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x17db3b(0x1c7)]('Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}function sleep(_0x7b6861){return new Promise(_0x3503dc=>setTimeout(_0x3503dc,_0x7b6861));}export const authDeviceDefinition={'service':a11_0x4dea68(0x1e8),'command':'device','description':a11_0x4dea68(0x1ba),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x4dea68(0x1be),'type':a11_0x4dea68(0x1d3),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a11_0x4dea68(0x1e1),'type':a11_0x4dea68(0x1d3),'description':a11_0x4dea68(0x1f1),'default':![]},{'name':'source','type':'string','description':a11_0x4dea68(0x1dc),'default':a11_0x4dea68(0x1bb)},{'name':a11_0x4dea68(0x1c0),'type':a11_0x4dea68(0x1d3),'description':'Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','default':![]}],async 'execute'(_0x1ce3dd){const _0xf30fd6=a11_0x4dea68,_0x1f8c5a=resolveAuthScopeFlags(_0x1ce3dd),_0x170e61=_0x1f8c5a[_0xf30fd6(0x1be)]?_0xf30fd6(0x1be):_0xf30fd6(0x1e1),_0x3ee4bd=readScopedConfig(_0x1f8c5a);if(_0x3ee4bd[_0xf30fd6(0x1c2)])return{'ok':!![],'message':_0xf30fd6(0x1ad)};const _0x5d2e1d=(_0x1ce3dd[_0xf30fd6(0x1f9)](_0xf30fd6(0x1cc))||'lovrabet-cli')['trim'](),_0x316b98=getUserDomain(),_0x535d9e=readStoredDeviceCode(),_0x3a70b9=_0x535d9e&&!isStoredDeviceCodeExpired(_0x535d9e)?_0x535d9e[_0xf30fd6(0x1ea)]:((()=>{const _0x4af520=generateDeviceCode();return writeStoredDeviceCode(_0x4af520,_0x170e61),_0x4af520;})()),_0x2060f3=buildDeviceAuthUrl(_0x316b98,_0x3a70b9,_0x5d2e1d);if(_0x1ce3dd[_0xf30fd6(0x1d2)](_0xf30fd6(0x1c0)))return console[_0xf30fd6(0x1ff)](_0x2060f3),{'ok':!![]};writeCliSideChannelLine(_0xf30fd6(0x1b2)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x2060f3),writeCliSideChannelLine(''),writeCliSideChannelLine(_0xf30fd6(0x1f6));if(_0x1ce3dd['nonInteractive'])return writeCliSideChannelLine(_0xf30fd6(0x200)+CLI_BIN_NAME+_0xf30fd6(0x1df)),{'ok':!![],'message':_0xf30fd6(0x1cf)};writeCliSideChannelLine(_0xf30fd6(0x1e4));const _0x40bc6d=new AbortController(),_0x2a33ec=()=>{const _0x597c49=_0xf30fd6;_0x40bc6d[_0x597c49(0x1c8)](),process['removeListener'](_0x597c49(0x1b4),_0x2a33ec);};process[_0xf30fd6(0x1dd)](_0xf30fd6(0x1b4),_0x2a33ec);let _0x5ce8bc;try{_0x5ce8bc=await pollDeviceToken(_0x316b98,_0x3a70b9,_0x40bc6d[_0xf30fd6(0x1d0)]);}finally{process[_0xf30fd6(0x1bc)]('SIGINT',_0x2a33ec);}if(!ACCESS_KEY_PATTERN[_0xf30fd6(0x1b8)](_0x5ce8bc))throw CliErrors[_0xf30fd6(0x1d4)](_0xf30fd6(0x1c5));const _0x398c17=readScopedConfig(_0x1f8c5a);return _0x398c17['accessKey']=_0x5ce8bc,writeScopedConfig(_0x398c17,_0x1f8c5a),deleteStoredDeviceCode(),process[_0xf30fd6(0x1b7)][_0xf30fd6(0x1b1)]('\x0a'),writeCliSideChannelLine(_0xf30fd6(0x1f0)+_0x170e61+_0xf30fd6(0x1e2)),writeCliSideChannelLine('Verify:\x20'+CLI_BIN_NAME+'\x20auth\x20status'),{'ok':!![],'message':_0xf30fd6(0x1b3)};}};
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_0x442dcb=a12_0x5a10;(function(_0xb553b6,_0x49c7eb){const _0x5bb079=a12_0x5a10,_0xc40c63=_0xb553b6();while(!![]){try{const _0x1d2d20=parseInt(_0x5bb079(0xd6))/0x1*(-parseInt(_0x5bb079(0xb2))/0x2)+-parseInt(_0x5bb079(0xd1))/0x3+-parseInt(_0x5bb079(0xb8))/0x4+-parseInt(_0x5bb079(0xca))/0x5+parseInt(_0x5bb079(0x9b))/0x6+-parseInt(_0x5bb079(0xc3))/0x7+-parseInt(_0x5bb079(0x99))/0x8*(-parseInt(_0x5bb079(0x87))/0x9);if(_0x1d2d20===_0x49c7eb)break;else _0xc40c63['push'](_0xc40c63['shift']());}catch(_0x240655){_0xc40c63['push'](_0xc40c63['shift']());}}}(a12_0x589c,0x3f8f9));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';function a12_0x589c(){const _0x3716a7=['string','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','daily','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','Auth\x20mode:\x20','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','validation','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','envName','check','\x20Current\x20env:\x20','AccessKey:\x20','Show\x20current\x20authentication\x20status','\x20scope.','\x20config','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Tip:\x20you\x20can\x20also\x20run:','Write\x20to\x20global\x20config\x20(default)','106RJrHzx','auth','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','success','test','1924432tatNBw','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','cancelled','push','trim','login','global-default','AccessKey\x20(ak_xxx...)','write','Then\x20verify\x20with:\x20','\x20Verify:\x20','1246441clpXJt','AccessKey\x20saved\x20to\x20','newConfigFileName','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','slice','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','978865cVLrwQ','ACCESS_KEY','Auth\x20config\x20reinitialized\x20in\x20','=ak_xxx','access_key','boolean','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','1549383jmZqch','Clear\x20accessKey\x20from\x20config','str','expired','\x20config.','8209vBtBEe','\x20\x20export\x20','Use\x20`','stdin','isTTY','Invalid\x20accessKey\x20format:\x20\x22','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','bool','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','join','project\x20config','Shorthand\x20for\x20--access-key','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Status:\x20valid','stdout','\x20auth\x20login\x20--access-key\x20<ak_xxx>','AccessKey\x20cleared\x20from\x20','504eWkApy','scope','repeat','env','read','Clear\x20from\x20global\x20config\x20(default)','yes','status','development','userCenterDisplayName','access-key','project','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','authRequired','\x20(via\x20','`auth\x20login`\x20does\x20not\x20support\x20--yes.','Option\x20C:\x20environment\x20variable','info','288944DijpOC','accessKey','265314PZqnVO','production','global','length','\x20auth\x20status'];a12_0x589c=function(){return _0x3716a7;};return a12_0x589c();}import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';function a12_0x5a10(_0x1ef96a,_0x587055){_0x1ef96a=_0x1ef96a-0x7b;const _0x589c0b=a12_0x589c();let _0x5a100c=_0x589c0b[_0x1ef96a];return _0x5a100c;}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 _0x3863fb=a12_0x5a10;writeCliSideChannelLine('AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x3863fb(0x90)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x3863fb(0xb0)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x3863fb(0x85));}function buildAccessKeySetupGuide(){const _0x5a39ff=a12_0x5a10;return[_0x5a39ff(0xb4)+PRODUCT_CONFIG[_0x5a39ff(0x90)]+':',USER_ACCESS_KEY_CREATE_URL,_0x5a39ff(0xaf)+CLI_BIN_NAME+_0x5a39ff(0xa1)][_0x5a39ff(0x7f)]('\x0a');}function canPromptForAccessKey(_0x413a67){const _0x103da2=a12_0x5a10;return!_0x413a67['nonInteractive']&&process[_0x103da2(0xd9)][_0x103da2(0xda)]!==![]&&process[_0x103da2(0x84)][_0x103da2(0xda)]!==![];}function resolveAuthScopeFlags(_0x1525a5){const _0x5e2d56=a12_0x5a10;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x1525a5['bool'](_0x5e2d56(0x9d)),'explicitProject':_0x1525a5['bool'](_0x5e2d56(0x92)),'policy':_0x5e2d56(0xbe)}));}async function resolveAuthWriteInput(_0x30b640){const _0x163944=a12_0x5a10;let _0x1fc627=(_0x30b640[_0x163944(0xd3)](_0x163944(0x91))||_0x30b640[_0x163944(0xd3)]('ak')||'')['trim']();const _0x434082=(_0x30b640[_0x163944(0xd3)](_0x163944(0x8a))||'')[_0x163944(0xbc)]();if(!_0x1fc627&&canPromptForAccessKey(_0x30b640))try{showAccessKeyCreateHint(),_0x1fc627=await promptAccessKey('');}catch(_0x286516){if(isAbortPrompt(_0x286516))throw CliErrors[_0x163944(0xba)]();throw _0x286516;}if(!_0x1fc627)throw CliErrors[_0x163944(0xa6)]('Missing\x20accessKey.',buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x163944(0xb7)](_0x1fc627))throw CliErrors[_0x163944(0xa6)](_0x163944(0x7b)+_0x1fc627+'\x22','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0x434082)return{'accessKey':_0x1fc627};const _0x12d2f6=normalizeEnv(_0x434082);return{'accessKey':_0x1fc627,'env':isDaily(_0x12d2f6)?_0x163944(0xa2):isDev(_0x12d2f6)?_0x163944(0x8f):_0x163944(0x9c)};}export const authDefinitions=[{'service':'auth','command':a12_0x442dcb(0xbd),'description':a12_0x442dcb(0xb5),'risk':a12_0x442dcb(0xc0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x442dcb(0x91),'type':a12_0x442dcb(0xa0),'description':a12_0x442dcb(0xbf)},{'name':'ak','type':'string','description':'Shorthand\x20for\x20--access-key'},{'name':'global','type':'boolean','description':a12_0x442dcb(0xb1),'default':!![]},{'name':'project','type':a12_0x442dcb(0xcf),'description':a12_0x442dcb(0x82),'default':![]}],async 'execute'(_0x5376e5){const _0x2a4da9=a12_0x442dcb;if(_0x5376e5[_0x2a4da9(0x7d)](_0x2a4da9(0x8d)))throw CliErrors[_0x2a4da9(0xa6)](_0x2a4da9(0x96),_0x2a4da9(0xd8)+CLI_BIN_NAME+_0x2a4da9(0xc6)+CLI_BIN_NAME+_0x2a4da9(0x7c));const _0xe28970=(_0x5376e5[_0x2a4da9(0xd3)](_0x2a4da9(0x91))||_0x5376e5['str']('ak')||'')[_0x2a4da9(0xbc)]();if(!_0xe28970&&_0x5376e5['nonInteractive'])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x5cfa5b=await resolveAuthWriteInput(_0x5376e5),_0x298e98=resolveAuthScopeFlags(_0x5376e5),_0x22ee36=readScopedConfig(_0x298e98);_0x22ee36[_0x2a4da9(0x9a)]=_0x5cfa5b[_0x2a4da9(0x9a)];_0x5cfa5b[_0x2a4da9(0x8a)]&&(_0x22ee36[_0x2a4da9(0x8a)]=_0x5cfa5b['env']);writeScopedConfig(_0x22ee36,_0x298e98);const _0x2cfc3f=_0x298e98[_0x2a4da9(0x9d)]?_0x2a4da9(0x9d):_0x2a4da9(0x92),_0x254c42=_0x22ee36['env']?_0x2a4da9(0xaa)+_0x22ee36[_0x2a4da9(0x8a)]+'.':'';return{'ok':!![],'message':_0x2a4da9(0xc4)+_0x2cfc3f+_0x2a4da9(0xd5)+_0x254c42+_0x2a4da9(0xc2)+CLI_BIN_NAME+_0x2a4da9(0x9f)};}},{'service':a12_0x442dcb(0xb3),'command':'init','description':a12_0x442dcb(0xa5),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x442dcb(0x91),'type':'string','description':a12_0x442dcb(0xbf)},{'name':'ak','type':a12_0x442dcb(0xa0),'description':a12_0x442dcb(0x81)},{'name':'env','type':'string','description':a12_0x442dcb(0xc8)},{'name':a12_0x442dcb(0x9d),'type':'boolean','description':a12_0x442dcb(0xb1),'default':!![]},{'name':a12_0x442dcb(0x92),'type':'boolean','description':a12_0x442dcb(0x82),'default':![]}],async 'execute'(_0x4c41f7){const _0x5a6ed1=a12_0x442dcb,_0x2376ea=await resolveAuthWriteInput(_0x4c41f7),_0x5d93d4=resolveAuthScopeFlags(_0x4c41f7),_0x4b4666={'accessKey':_0x2376ea['accessKey']};_0x2376ea[_0x5a6ed1(0x8a)]&&(_0x4b4666[_0x5a6ed1(0x8a)]=_0x2376ea[_0x5a6ed1(0x8a)]);writeScopedConfig(_0x4b4666,_0x5d93d4);const _0x4bfb4e=_0x5d93d4[_0x5a6ed1(0x9d)]?_0x5a6ed1(0x9d):_0x5a6ed1(0x92),_0x402ebf=_0x4b4666[_0x5a6ed1(0x8a)]?_0x5a6ed1(0xaa)+_0x4b4666[_0x5a6ed1(0x8a)]+'.':'';return{'ok':!![],'message':_0x5a6ed1(0xcc)+_0x4bfb4e+_0x5a6ed1(0xad)+_0x402ebf+'\x20Verify:\x20'+CLI_BIN_NAME+_0x5a6ed1(0x9f)};}},{'service':a12_0x442dcb(0xb3),'command':'logout','description':a12_0x442dcb(0xd2),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x442dcb(0x9d),'type':a12_0x442dcb(0xcf),'description':a12_0x442dcb(0x8c),'default':!![]},{'name':a12_0x442dcb(0x92),'type':a12_0x442dcb(0xcf),'description':a12_0x442dcb(0xc9),'default':![]}],async 'execute'(_0x380a7f){const _0x113d9b=a12_0x442dcb,_0x196bec=resolveAuthScopeFlags(_0x380a7f),_0x3fb2de=readScopedConfig(_0x196bec),_0x25167c=!!_0x3fb2de['accessKey'];delete _0x3fb2de[_0x113d9b(0x9a)],writeScopedConfig(_0x3fb2de,_0x196bec);const _0x9d80e2=_0x196bec['global']?'global':_0x113d9b(0x92);if(_0x25167c)return{'ok':!![],'message':_0x113d9b(0x86)+_0x9d80e2+'\x20config.'};return{'ok':!![],'message':'No\x20AccessKey\x20found\x20in\x20'+_0x9d80e2+'\x20config.\x20Nothing\x20to\x20clear.'};}},{'service':a12_0x442dcb(0xb3),'command':a12_0x442dcb(0x8e),'description':a12_0x442dcb(0xac),'risk':a12_0x442dcb(0x8b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x442dcb(0x9d),'type':a12_0x442dcb(0xcf),'description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':a12_0x442dcb(0x92),'type':'boolean','description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]},{'name':a12_0x442dcb(0xa9),'type':a12_0x442dcb(0xcf),'description':a12_0x442dcb(0x93),'default':![]}],async 'execute'(_0x55a631){const _0x18cb5d=a12_0x442dcb,_0x373bd5=resolveAuthScopeFlags(_0x55a631),_0x55214a=readScopedConfig(_0x373bd5),_0x210d36=productEnvName(_0x18cb5d(0xcb)),_0x48e2bd=productEnv(_0x18cb5d(0xcb))||undefined,_0x3346db=_0x55214a[_0x18cb5d(0x9a)]||undefined,_0x48c6a0=_0x48e2bd||_0x3346db,_0x19eabe=_0x48e2bd?_0x210d36+'\x20env\x20var':_0x3346db?(_0x373bd5[_0x18cb5d(0x9d)]?_0x18cb5d(0x9d):_0x18cb5d(0x92))+_0x18cb5d(0xae):null,_0x2401e0=[_0x18cb5d(0xa4)+AUTH_MODE['ClientAk']];if(_0x48c6a0){const _0x4a53e4=_0x48c6a0[_0x18cb5d(0x9e)]>0x8?''+_0x48c6a0[_0x18cb5d(0xc7)](0x0,0x8)+'*'[_0x18cb5d(0x89)](_0x48c6a0['length']-0x8):_0x48c6a0;_0x2401e0[_0x18cb5d(0xbb)](_0x18cb5d(0xab)+_0x4a53e4+(_0x19eabe?_0x18cb5d(0x95)+_0x19eabe+')':'')),_0x2401e0['push']('Status:\x20valid');}if(!_0x48c6a0){_0x2401e0[_0x18cb5d(0xbb)](''),_0x2401e0['push'](_0x18cb5d(0x7e)),_0x2401e0[_0x18cb5d(0xbb)](''),_0x2401e0[_0x18cb5d(0xbb)]('Option\x20A:\x20'+CLI_BIN_NAME+_0x18cb5d(0xa3)),_0x2401e0['push'](''),_0x2401e0[_0x18cb5d(0xbb)]('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x18cb5d(0xc5)]+')'),_0x2401e0[_0x18cb5d(0xbb)](_0x18cb5d(0xd0)),_0x2401e0['push'](''),_0x2401e0[_0x18cb5d(0xbb)](_0x18cb5d(0x97)),_0x2401e0['push'](_0x18cb5d(0xd7)+_0x210d36+_0x18cb5d(0xcd)),_0x2401e0[_0x18cb5d(0xbb)](''),_0x2401e0[_0x18cb5d(0xbb)](_0x18cb5d(0xc1)+CLI_BIN_NAME+_0x18cb5d(0x9f)),_0x2401e0['push'](_0x18cb5d(0xb9)+CLI_BIN_NAME+'\x20doctor');if(_0x55a631[_0x18cb5d(0x7d)](_0x18cb5d(0xa9))){const _0x426f99=readStoredDeviceCode();if(_0x426f99&&!isStoredDeviceCodeExpired(_0x426f99)){const _0x4cfe8a=getUserDomain(),_0xaeedb5=await fetchDeviceToken(_0x4cfe8a,_0x426f99['code']);if(_0xaeedb5[_0x18cb5d(0x8e)]===_0x18cb5d(0xb6)&&_0xaeedb5[_0x18cb5d(0xce)]){const _0x3c6cf9={'global':_0x426f99[_0x18cb5d(0x88)]===_0x18cb5d(0x9d)},_0x8da8c1=readScopedConfig(_0x3c6cf9);_0x8da8c1['accessKey']=_0xaeedb5['access_key'],writeScopedConfig(_0x8da8c1,_0x3c6cf9),deleteStoredDeviceCode();const _0x52345d=_0xaeedb5[_0x18cb5d(0xce)],_0x3b7d5d=_0x52345d[_0x18cb5d(0x9e)]>0x8?''+_0x52345d['slice'](0x0,0x8)+'*'[_0x18cb5d(0x89)](_0x52345d[_0x18cb5d(0x9e)]-0x8):_0x52345d,_0x4b7baa=_0x426f99[_0x18cb5d(0x88)]===_0x18cb5d(0x9d)?'global\x20config':_0x18cb5d(0x80);return{'ok':!![],'message':['Auth\x20mode:\x20'+AUTH_MODE['ClientAk'],'AccessKey:\x20'+_0x3b7d5d+_0x18cb5d(0x95)+_0x4b7baa+')',_0x18cb5d(0x83)]['join']('\x0a')};}_0xaeedb5['status']===_0x18cb5d(0xd4)&&deleteStoredDeviceCode();throw CliErrors[_0x18cb5d(0x94)](_0x18cb5d(0xa7));}throw CliErrors[_0x18cb5d(0x94)](_0x2401e0[_0x18cb5d(0x7f)]('\x0a'));}}return{'ok':!![],'message':_0x2401e0[_0x18cb5d(0x7f)]('\x0a')};}},{'service':'auth','command':a12_0x442dcb(0x98),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':a12_0x442dcb(0x8b),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x336a8b){const _0x4f70f2=a12_0x442dcb,_0x2c0e2c=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x2c0e2c,'meta':{'env':_0x336a8b[_0x4f70f2(0xa8)]??'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(_0x54485c,_0x3f55bb){const _0x2bfdaa=a13_0x1780,_0x4ca3b9=_0x54485c();while(!![]){try{const _0x5c200e=parseInt(_0x2bfdaa(0x6f))/0x1*(-parseInt(_0x2bfdaa(0x78))/0x2)+-parseInt(_0x2bfdaa(0x7a))/0x3*(-parseInt(_0x2bfdaa(0x71))/0x4)+parseInt(_0x2bfdaa(0x7b))/0x5+-parseInt(_0x2bfdaa(0x6c))/0x6+parseInt(_0x2bfdaa(0x6e))/0x7+parseInt(_0x2bfdaa(0x72))/0x8*(parseInt(_0x2bfdaa(0x6a))/0x9)+-parseInt(_0x2bfdaa(0x6d))/0xa*(parseInt(_0x2bfdaa(0x79))/0xb);if(_0x5c200e===_0x3f55bb)break;else _0x4ca3b9['push'](_0x4ca3b9['shift']());}catch(_0x51f6e3){_0x4ca3b9['push'](_0x4ca3b9['shift']());}}}(a13_0x4eab,0xba6cf));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x164c64=a13_0x1780;super(_0x164c64(0x74)),this['name']=_0x164c64(0x68);}}function a13_0x1780(_0xe64a56,_0x25fa36){_0xe64a56=_0xe64a56-0x68;const _0x4eab66=a13_0x4eab();let _0x1780bf=_0x4eab66[_0xe64a56];return _0x1780bf;}function createSafeRl(){const _0x48eb93=a13_0x1780,_0x428827=createInterface({'input':process[_0x48eb93(0x69)],'output':process[_0x48eb93(0x7e)]});let _0x192278;const _0x6b0d55=new Promise((_0x2f5c53,_0x4c1c69)=>{const _0x5063e7=_0x48eb93;_0x192278=()=>{const _0x5a04e5=a13_0x1780;_0x192278&&(_0x428827[_0x5a04e5(0x76)]('SIGINT',_0x192278),_0x192278=undefined);try{_0x428827[_0x5a04e5(0x75)]();}catch{}_0x4c1c69(new AbortPrompt());},_0x428827[_0x5063e7(0x7d)]('SIGINT',_0x192278);}),_0x47b8d2=()=>{const _0x1b18bc=_0x48eb93;_0x192278&&(_0x428827[_0x1b18bc(0x76)](_0x1b18bc(0x77),_0x192278),_0x192278=undefined);try{_0x428827[_0x1b18bc(0x75)]();}catch{}};return{'rl':_0x428827,'abortPromise':_0x6b0d55,'disposeSuccess':_0x47b8d2};}function a13_0x4eab(){const _0x1f1b6b=['682RqqNxf','8526793qFeJNy','36OahNDM','4908470PmUqtE','name','once','stdout','AbortPrompt','stdin','284283lCCpck','AccessKey\x20(','1947678UkRpzg','10DuCjQZ','3698611redCiA','4336qMVLAQ','trim','442164zUsFDl','128bBrnjz','AccessKey\x20(paste\x20ak_...):\x20','User\x20aborted\x20prompt','close','removeListener','SIGINT'];a13_0x4eab=function(){return _0x1f1b6b;};return a13_0x4eab();}export async function promptAccessKey(_0x4ffa2d=''){const {rl:_0xd5def5,abortPromise:_0x361912,disposeSuccess:_0x6b815d}=createSafeRl(),_0x2434db=new Promise(_0x334e36=>{const _0x1cfb94=a13_0x1780,_0x51dab3=_0x4ffa2d?_0x1cfb94(0x6b)+_0x4ffa2d+'):\x20':_0x1cfb94(0x73);_0xd5def5['question'](_0x51dab3,_0xc7a768=>{const _0x148760=_0x1cfb94;_0x6b815d(),_0x334e36(_0xc7a768[_0x148760(0x70)]()||_0x4ffa2d);});});return Promise['race']([_0x2434db,_0x361912]);}export function isAbortPrompt(_0x52fca1){const _0x375bee=a13_0x1780;return _0x52fca1 instanceof Error&&_0x52fca1[_0x375bee(0x7c)]===_0x375bee(0x68);}
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
- const a14_0x2f082f=a14_0x549f;(function(_0x425975,_0x17c57e){const _0x5b85be=a14_0x549f,_0x710af0=_0x425975();while(!![]){try{const _0x2c8764=-parseInt(_0x5b85be(0x1e0))/0x1+-parseInt(_0x5b85be(0x1e1))/0x2+-parseInt(_0x5b85be(0x1e9))/0x3+parseInt(_0x5b85be(0x1ec))/0x4+parseInt(_0x5b85be(0x1e8))/0x5*(-parseInt(_0x5b85be(0x1f2))/0x6)+parseInt(_0x5b85be(0x1e7))/0x7*(parseInt(_0x5b85be(0x1ea))/0x8)+-parseInt(_0x5b85be(0x1e6))/0x9*(-parseInt(_0x5b85be(0x1e5))/0xa);if(_0x2c8764===_0x17c57e)break;else _0x710af0['push'](_0x710af0['shift']());}catch(_0x1ac5a0){_0x710af0['push'](_0x710af0['shift']());}}}(a14_0x2a8a,0xb82c0));function a14_0x2a8a(){const _0x1d6e9f=['4065aVfhsj','3558456vlsfOv','529624IgnPIy','(none)','1066284ftCqyk','functionName','version','detail','str','gmtModified','6018RZsCSo','name','108031tZtkoX','1193260LMgVJS','read','description','appCode','2030uRGjZN','112257adaDnD','70uxrzdi'];a14_0x2a8a=function(){return _0x1d6e9f;};return a14_0x2a8a();}function a14_0x549f(_0x69fddf,_0x430ded){_0x69fddf=_0x69fddf-0x1df;const _0x2a8a03=a14_0x2a8a();let _0x549f3f=_0x2a8a03[_0x69fddf];return _0x549f3f;}import{getBffEndpointContract}from'../../core/api-client.js';import{NAME_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':'bff','command':a14_0x2f082f(0x1ef),'description':'Get\x20a\x20BFF\x20endpoint\x20contract\x20by\x20function\x20name','risk':a14_0x2f082f(0x1e2),'flags':[{...NAME_FLAG,'required':!![],'description':'BFF\x20function\x20name'}],async 'execute'(_0x34cfb7){const _0x188b76=a14_0x2f082f,_0x5b4643=await getBffEndpointContract(_0x34cfb7['appCode'],_0x34cfb7[_0x188b76(0x1f0)](_0x188b76(0x1df)));return{'ok':!![],'data':{'appCode':_0x5b4643[_0x188b76(0x1e4)],'functionName':_0x5b4643[_0x188b76(0x1ed)],'description':_0x5b4643[_0x188b76(0x1e3)]||_0x188b76(0x1eb),'version':_0x5b4643[_0x188b76(0x1ee)],'gmtModified':_0x5b4643[_0x188b76(0x1f1)]}};}};
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
- function a15_0x1a0a(_0x214cf9,_0x1f67b1){_0x214cf9=_0x214cf9-0x148;const _0x4998a6=a15_0x4998();let _0x1a0a59=_0x4998a6[_0x214cf9];return _0x1a0a59;}function a15_0x4998(){const _0x109d81=['3BFCOSY','params','33338061aKQDyK','bff','2464096QbbPWD','17516gPmXzU','80636PxfTas','49serkWP','str','read','4396212GYGIxq','name','exec','Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','3510680ixzQjq','BFF\x20function\x20name\x20to\x20execute','now','724578CqYjFF'];a15_0x4998=function(){return _0x109d81;};return a15_0x4998();}const a15_0x2e7e45=a15_0x1a0a;(function(_0x2f22aa,_0x273629){const _0xe14d41=a15_0x1a0a,_0x4fa241=_0x2f22aa();while(!![]){try{const _0x109ddb=-parseInt(_0xe14d41(0x157))/0x1+-parseInt(_0xe14d41(0x158))/0x2*(parseInt(_0xe14d41(0x152))/0x3)+-parseInt(_0xe14d41(0x14a))/0x4+-parseInt(_0xe14d41(0x14e))/0x5+-parseInt(_0xe14d41(0x151))/0x6*(parseInt(_0xe14d41(0x159))/0x7)+-parseInt(_0xe14d41(0x156))/0x8+parseInt(_0xe14d41(0x154))/0x9;if(_0x109ddb===_0x273629)break;else _0x4fa241['push'](_0x4fa241['shift']());}catch(_0x45dca2){_0x4fa241['push'](_0x4fa241['shift']());}}}(a15_0x4998,0xa8e8d));import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a15_0x2e7e45(0x155),'command':a15_0x2e7e45(0x14c),'description':a15_0x2e7e45(0x14d),'risk':a15_0x2e7e45(0x149),'flags':[{...NAME_FLAG,'required':!![],'description':a15_0x2e7e45(0x14f)},PARAMS_FLAG],async 'execute'(_0x2ae001){const _0x450a73=a15_0x2e7e45,_0x48ada9=parseJsonParams(_0x2ae001[_0x450a73(0x148)](_0x450a73(0x153))),_0x34c4fe=Date[_0x450a73(0x150)](),_0xe4c25=await executeSdkBff(_0x2ae001['str'](_0x450a73(0x14b)),_0x48ada9),_0x38cfcb=Date[_0x450a73(0x150)]()-_0x34c4fe;return{'ok':!![],'data':{'result':_0xe4c25,'elapsed':_0x38cfcb},'message':'BFF\x20executed\x20in\x20'+_0x38cfcb+'ms'};}};
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 a16_0x3ff5(_0xf3af12,_0x22e2cb){_0xf3af12=_0xf3af12-0x1c8;const _0x455c97=a16_0x455c();let _0x3ff57b=_0x455c97[_0xf3af12];return _0x3ff57b;}(function(_0x441dd0,_0x50aba8){const _0x1c0752=a16_0x3ff5,_0x1a80c6=_0x441dd0();while(!![]){try{const _0x12eed2=-parseInt(_0x1c0752(0x1ce))/0x1+parseInt(_0x1c0752(0x1d0))/0x2*(-parseInt(_0x1c0752(0x1ca))/0x3)+parseInt(_0x1c0752(0x1cf))/0x4+parseInt(_0x1c0752(0x1cb))/0x5*(-parseInt(_0x1c0752(0x1c8))/0x6)+-parseInt(_0x1c0752(0x1cc))/0x7+parseInt(_0x1c0752(0x1cd))/0x8+parseInt(_0x1c0752(0x1c9))/0x9;if(_0x12eed2===_0x50aba8)break;else _0x1a80c6['push'](_0x1a80c6['shift']());}catch(_0x49023f){_0x1a80c6['push'](_0x1a80c6['shift']());}}}(a16_0x455c,0xb3cf0));import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';function a16_0x455c(){const _0x5b8587=['4189593pggpUw','30sTnnve','5796217MzphGo','5118480RImLJw','649752soSROU','371864KqxQLN','2vbPiPm','716736dDXAnb','32352930rDbGgC'];a16_0x455c=function(){return _0x5b8587;};return a16_0x455c();}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
- const a17_0x11f926=a17_0x1c3e;function a17_0x3791(){const _0x49dee2=['\x20-g\x20-y)...','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.','4950555NYZYNn','log','4YkjJuA','270pAPJNL','\x20-g\x20-y','setLogPath','../../skills/npx-skills-add.js','3511056juIoEb','info','Install\x20the\x20CLI\x20Built-in\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','apiError','13614535rDQuZV','write','2KnWIwK','cli-skill-install','skipped','141580ZUjoni','CLI\x20Built-in\x20Skill\x20installed','nonInteractive','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','inherit','cwd','2817032ezOXKZ','unknown','error','14wdGTcc','3741225fQVMqM','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20npx\x20skills\x20add\x20','357001HVLJql','=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','Skipped\x20npx\x20('];a17_0x3791=function(){return _0x49dee2;};return a17_0x3791();}(function(_0x1b7a49,_0x21e40d){const _0x513215=a17_0x1c3e,_0x150f74=_0x1b7a49();while(!![]){try{const _0x133e2a=parseInt(_0x513215(0x193))/0x1*(parseInt(_0x513215(0x1a5))/0x2)+-parseInt(_0x513215(0x198))/0x3*(-parseInt(_0x513215(0x19a))/0x4)+parseInt(_0x513215(0x191))/0x5+parseInt(_0x513215(0x19f))/0x6+-parseInt(_0x513215(0x190))/0x7*(parseInt(_0x513215(0x18d))/0x8)+-parseInt(_0x513215(0x19b))/0x9*(parseInt(_0x513215(0x1a8))/0xa)+-parseInt(_0x513215(0x1a3))/0xb;if(_0x133e2a===_0x21e40d)break;else _0x150f74['push'](_0x150f74['shift']());}catch(_0x1b3096){_0x150f74['push'](_0x150f74['shift']());}}}(a17_0x3791,0xedc64));import{CliErrors}from'../../errors.js';function a17_0x1c3e(_0x3c948b,_0x2bc233){_0x3c948b=_0x3c948b-0x18c;const _0x3791a0=a17_0x3791();let _0x1c3eb2=_0x3791a0[_0x3c948b];return _0x1c3eb2;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':'install','description':a17_0x11f926(0x1a1),'risk':a17_0x11f926(0x1a4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5a4e0c){const _0x304053=a17_0x11f926;logger[_0x304053(0x19d)](process[_0x304053(0x18c)]()),logger[_0x304053(0x1a0)](_0x304053(0x1a6),_0x304053(0x197));const {LOVRABET_SKILL_SOURCE:_0x3b475f,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x157950,runNpxSkillsAddGlobal:_0x3fdc6b}=await import(_0x304053(0x19e)),_0x45d8fa=_0x5a4e0c[_0x304053(0x1aa)]?'pipe':_0x304053(0x1ac);console['log'](_0x304053(0x1ab)+_0x3b475f+_0x304053(0x196));const _0x430c02=_0x3fdc6b(process[_0x304053(0x18c)](),_0x3b475f,{'stdio':_0x45d8fa});if(_0x430c02[_0x304053(0x1a7)])console[_0x304053(0x199)](_0x304053(0x195)+_0x157950+_0x304053(0x194));else{if(_0x430c02['ok'])console[_0x304053(0x199)](_0x304053(0x1a9));else throw CliErrors[_0x304053(0x1a2)]('npx\x20skills\x20add\x20failed:\x20'+(_0x430c02[_0x304053(0x18f)]||_0x304053(0x18e)),_0x304053(0x192)+_0x3b475f+_0x304053(0x19c));}return{'ok':!![]};}}];
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':!![]};}}];