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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/lib/cli.d.ts +21 -0
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.d.ts +38 -0
  4. package/lib/commands/api-doc/index.js +1 -1
  5. package/lib/commands/app/cache.d.ts +61 -0
  6. package/lib/commands/app/cache.js +1 -1
  7. package/lib/commands/app/definitions.d.ts +26 -0
  8. package/lib/commands/app/definitions.js +1 -1
  9. package/lib/commands/app/eligibility.d.ts +16 -0
  10. package/lib/commands/app/eligibility.js +1 -1
  11. package/lib/commands/app/mock-loader.d.ts +41 -0
  12. package/lib/commands/app/mock-loader.js +1 -1
  13. package/lib/commands/app/remote-source.d.ts +66 -0
  14. package/lib/commands/app/remote-source.js +1 -1
  15. package/lib/commands/app/shared.d.ts +38 -0
  16. package/lib/commands/app/shared.js +1 -1
  17. package/lib/commands/app-config/get.d.ts +2 -0
  18. package/lib/commands/app-config/get.js +1 -1
  19. package/lib/commands/app-config/index.d.ts +2 -0
  20. package/lib/commands/app-config/index.js +1 -1
  21. package/lib/commands/artifact/index.d.ts +9 -0
  22. package/lib/commands/artifact/index.js +1 -1
  23. package/lib/commands/auth/device.d.ts +31 -0
  24. package/lib/commands/auth/device.js +1 -1
  25. package/lib/commands/auth/index.d.ts +23 -0
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/auth/prompt.d.ts +33 -0
  28. package/lib/commands/auth/prompt.js +1 -1
  29. package/lib/commands/bff/detail.d.ts +8 -0
  30. package/lib/commands/bff/detail.js +1 -1
  31. package/lib/commands/bff/exec.d.ts +19 -0
  32. package/lib/commands/bff/exec.js +1 -1
  33. package/lib/commands/bff/index.d.ts +15 -0
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/cli-skill/index.d.ts +9 -0
  36. package/lib/commands/cli-skill/index.js +1 -1
  37. package/lib/commands/common/config-policy.d.ts +80 -0
  38. package/lib/commands/common/config-policy.js +1 -1
  39. package/lib/commands/common/constraints.d.ts +67 -0
  40. package/lib/commands/common/constraints.js +1 -1
  41. package/lib/commands/common/flags.d.ts +41 -0
  42. package/lib/commands/common/flags.js +1 -1
  43. package/lib/commands/common/local-file.d.ts +6 -0
  44. package/lib/commands/common/local-file.js +1 -1
  45. package/lib/commands/config/definitions.d.ts +21 -0
  46. package/lib/commands/config/definitions.js +1 -1
  47. package/lib/commands/config/shared.d.ts +17 -0
  48. package/lib/commands/config/shared.js +1 -1
  49. package/lib/commands/data/index.d.ts +27 -0
  50. package/lib/commands/data/index.js +1 -1
  51. package/lib/commands/dataset/detail.d.ts +26 -0
  52. package/lib/commands/dataset/detail.js +1 -1
  53. package/lib/commands/dataset/index.d.ts +10 -0
  54. package/lib/commands/dataset/index.js +1 -1
  55. package/lib/commands/dataset/list.d.ts +18 -0
  56. package/lib/commands/dataset/list.js +1 -1
  57. package/lib/commands/dataset/sdk-doc.d.ts +6 -0
  58. package/lib/commands/dataset/sdk-doc.js +1 -1
  59. package/lib/commands/doctor.d.ts +23 -0
  60. package/lib/commands/doctor.js +1 -1
  61. package/lib/commands/file/index.d.ts +2 -0
  62. package/lib/commands/file/index.js +1 -1
  63. package/lib/commands/init.d.ts +32 -0
  64. package/lib/commands/init.js +1 -1
  65. package/lib/commands/kb/index.d.ts +8 -0
  66. package/lib/commands/kb/index.js +1 -1
  67. package/lib/commands/logs/index.d.ts +20 -0
  68. package/lib/commands/logs/index.js +1 -1
  69. package/lib/commands/ocr/index.d.ts +2 -0
  70. package/lib/commands/ocr/index.js +1 -1
  71. package/lib/commands/personal-bff/index.d.ts +5 -0
  72. package/lib/commands/personal-bff/index.js +1 -1
  73. package/lib/commands/registry.d.ts +56 -0
  74. package/lib/commands/registry.js +1 -1
  75. package/lib/commands/schedule/index.d.ts +2 -0
  76. package/lib/commands/schedule/index.js +1 -0
  77. package/lib/commands/schema.d.ts +18 -0
  78. package/lib/commands/schema.js +1 -1
  79. package/lib/commands/service/dynamic.d.ts +18 -0
  80. package/lib/commands/service/dynamic.js +1 -1
  81. package/lib/commands/service/function-name-adapter.d.ts +13 -0
  82. package/lib/commands/service/function-name-adapter.js +1 -1
  83. package/lib/commands/service/index.d.ts +2 -0
  84. package/lib/commands/service/index.js +1 -1
  85. package/lib/commands/service/registry.d.ts +102 -0
  86. package/lib/commands/service/registry.js +1 -1
  87. package/lib/commands/skill/commands/create.d.ts +2 -0
  88. package/lib/commands/skill/commands/create.js +1 -1
  89. package/lib/commands/skill/commands/install.d.ts +2 -0
  90. package/lib/commands/skill/commands/install.js +1 -1
  91. package/lib/commands/skill/commands/list.d.ts +2 -0
  92. package/lib/commands/skill/commands/list.js +1 -1
  93. package/lib/commands/skill/commands/push.d.ts +2 -0
  94. package/lib/commands/skill/commands/push.js +1 -1
  95. package/lib/commands/skill/commands/validate.d.ts +2 -0
  96. package/lib/commands/skill/commands/validate.js +1 -1
  97. package/lib/commands/skill/flags.d.ts +13 -0
  98. package/lib/commands/skill/flags.js +1 -1
  99. package/lib/commands/skill/index.d.ts +9 -0
  100. package/lib/commands/skill/index.js +1 -1
  101. package/lib/commands/skill/manifest-helpers.d.ts +5 -0
  102. package/lib/commands/skill/manifest-helpers.js +1 -1
  103. package/lib/commands/skill/push-execute.d.ts +49 -0
  104. package/lib/commands/skill/push-execute.js +1 -1
  105. package/lib/commands/skill/push-flow-helpers.d.ts +80 -0
  106. package/lib/commands/skill/push-flow-helpers.js +1 -1
  107. package/lib/commands/skill/push-retarget.d.ts +9 -0
  108. package/lib/commands/skill/push-retarget.js +1 -1
  109. package/lib/commands/skill/scopes.d.ts +13 -0
  110. package/lib/commands/skill/scopes.js +1 -1
  111. package/lib/commands/skill/summary.d.ts +6 -0
  112. package/lib/commands/skill/summary.js +1 -1
  113. package/lib/commands/skill/templates.d.ts +23 -0
  114. package/lib/commands/skill/templates.js +1 -1
  115. package/lib/commands/skill/validate.d.ts +20 -0
  116. package/lib/commands/skill/validate.js +1 -1
  117. package/lib/commands/sql/detail.d.ts +13 -0
  118. package/lib/commands/sql/detail.js +1 -1
  119. package/lib/commands/sql/exec.d.ts +21 -0
  120. package/lib/commands/sql/exec.js +1 -1
  121. package/lib/commands/sql/index.d.ts +9 -0
  122. package/lib/commands/sql/index.js +1 -1
  123. package/lib/commands/update.d.ts +10 -0
  124. package/lib/commands/update.js +1 -1
  125. package/lib/commands/workspace/index.d.ts +10 -0
  126. package/lib/commands/workspace/index.js +1 -1
  127. package/lib/config/schema.d.ts +108 -0
  128. package/lib/config/schema.js +1 -1
  129. package/lib/constant/app.d.ts +13 -0
  130. package/lib/constant/app.js +1 -1
  131. package/lib/constant/auth-mode.d.ts +28 -0
  132. package/lib/constant/auth-mode.js +1 -1
  133. package/lib/constant/cli.d.ts +86 -0
  134. package/lib/constant/cli.js +1 -1
  135. package/lib/constant/defaults.d.ts +45 -0
  136. package/lib/constant/defaults.js +1 -1
  137. package/lib/constant/distribution.d.ts +12 -0
  138. package/lib/constant/distribution.js +1 -1
  139. package/lib/constant/domain.d.ts +57 -0
  140. package/lib/constant/domain.js +1 -1
  141. package/lib/constant/env.d.ts +56 -0
  142. package/lib/constant/env.js +1 -1
  143. package/lib/constant/output.d.ts +13 -0
  144. package/lib/constant/output.js +1 -1
  145. package/lib/constant/product.d.ts +79 -0
  146. package/lib/constant/product.js +1 -1
  147. package/lib/constant/risk.d.ts +14 -0
  148. package/lib/constant/risk.js +1 -1
  149. package/lib/constant/url.d.ts +14 -0
  150. package/lib/constant/url.js +1 -1
  151. package/lib/context.d.ts +287 -0
  152. package/lib/context.js +1 -1
  153. package/lib/core/api-client.d.ts +451 -0
  154. package/lib/core/api-client.js +1 -1
  155. package/lib/core/db-resolver.d.ts +39 -0
  156. package/lib/core/db-resolver.js +1 -1
  157. package/lib/core/sdk-client.d.ts +62 -0
  158. package/lib/core/sdk-client.js +1 -1
  159. package/lib/errors.d.ts +25 -0
  160. package/lib/errors.js +1 -1
  161. package/lib/framework/build-all-flags.d.ts +24 -0
  162. package/lib/framework/build-all-flags.js +1 -1
  163. package/lib/framework/dryrun.d.ts +64 -0
  164. package/lib/framework/dryrun.js +1 -1
  165. package/lib/framework/flags.d.ts +19 -0
  166. package/lib/framework/flags.js +1 -1
  167. package/lib/framework/help.d.ts +21 -0
  168. package/lib/framework/help.js +1 -1
  169. package/lib/framework/index.d.ts +10 -0
  170. package/lib/framework/index.js +1 -1
  171. package/lib/framework/output.d.ts +10 -0
  172. package/lib/framework/output.js +1 -1
  173. package/lib/framework/preparse.d.ts +64 -0
  174. package/lib/framework/preparse.js +1 -1
  175. package/lib/framework/rate-limit.d.ts +10 -0
  176. package/lib/framework/rate-limit.js +1 -1
  177. package/lib/framework/response.d.ts +10 -0
  178. package/lib/framework/response.js +1 -1
  179. package/lib/framework/runner-confirmation.d.ts +46 -0
  180. package/lib/framework/runner-confirmation.js +1 -1
  181. package/lib/framework/runner-error.d.ts +28 -0
  182. package/lib/framework/runner-error.js +1 -1
  183. package/lib/framework/runner.d.ts +102 -0
  184. package/lib/framework/runner.js +1 -1
  185. package/lib/framework/schema-export.d.ts +29 -0
  186. package/lib/framework/schema-export.js +1 -1
  187. package/lib/framework/service-order.d.ts +4 -0
  188. package/lib/framework/service-order.js +1 -1
  189. package/lib/framework/types.d.ts +108 -0
  190. package/lib/framework/types.js +1 -1
  191. package/lib/generated/build-info.d.ts +4 -0
  192. package/lib/generated/build-info.js +1 -1
  193. package/lib/help.d.ts +25 -0
  194. package/lib/help.js +1 -1
  195. package/lib/runtime/event.d.ts +16 -0
  196. package/lib/runtime/event.js +1 -0
  197. package/lib/runtime/index.d.ts +13 -0
  198. package/lib/runtime/index.js +1 -0
  199. package/lib/runtime/queue.d.ts +6 -0
  200. package/lib/runtime/queue.js +1 -0
  201. package/lib/runtime/resolve.d.ts +14 -0
  202. package/lib/runtime/resolve.js +1 -0
  203. package/lib/runtime/types.d.ts +59 -0
  204. package/lib/runtime/types.js +1 -0
  205. package/lib/skills/npx-skills-add.d.ts +42 -0
  206. package/lib/skills/npx-skills-add.js +1 -1
  207. package/lib/skills/runtime-skill-sync/constants.d.ts +4 -0
  208. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  209. package/lib/skills/runtime-skill-sync/fs-utils.d.ts +21 -0
  210. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  211. package/lib/skills/runtime-skill-sync/hashing.d.ts +9 -0
  212. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  213. package/lib/skills/runtime-skill-sync/links.d.ts +18 -0
  214. package/lib/skills/runtime-skill-sync/links.js +1 -1
  215. package/lib/skills/runtime-skill-sync/list-local.d.ts +3 -0
  216. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  217. package/lib/skills/runtime-skill-sync/local-files.d.ts +25 -0
  218. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  219. package/lib/skills/runtime-skill-sync/materialize.d.ts +11 -0
  220. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  221. package/lib/skills/runtime-skill-sync/metadata.d.ts +7 -0
  222. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  223. package/lib/skills/runtime-skill-sync/paths.d.ts +11 -0
  224. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  225. package/lib/skills/runtime-skill-sync/push.d.ts +33 -0
  226. package/lib/skills/runtime-skill-sync/push.js +1 -1
  227. package/lib/skills/runtime-skill-sync/scopes.d.ts +5 -0
  228. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  229. package/lib/skills/runtime-skill-sync/types.d.ts +105 -0
  230. package/lib/skills/runtime-skill-sync/zip-codec.d.ts +9 -0
  231. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  232. package/lib/skills/runtime-skill-sync/zip-package.d.ts +15 -0
  233. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  234. package/lib/skills/runtime-skill-sync.d.ts +15 -0
  235. package/lib/skills/runtime-skill-sync.js +1 -1
  236. package/lib/utils/apply-jq-filter.d.ts +25 -0
  237. package/lib/utils/apply-jq-filter.js +1 -1
  238. package/lib/utils/logger.d.ts +73 -0
  239. package/lib/utils/logger.js +1 -1
  240. package/lib/utils/lossless-json.d.ts +21 -0
  241. package/lib/utils/lossless-json.js +1 -1
  242. package/lib/utils/params.d.ts +65 -0
  243. package/lib/utils/params.js +1 -1
  244. package/lib/utils/platform.d.ts +17 -0
  245. package/lib/utils/platform.js +1 -1
  246. package/lib/utils/update-notice.d.ts +10 -0
  247. package/lib/utils/update-notice.js +1 -1
  248. package/lib/utils/version.d.ts +18 -0
  249. package/lib/utils/version.js +1 -1
  250. package/lib/utils/write-cli-side-channel.d.ts +6 -0
  251. package/lib/utils/write-cli-side-channel.js +1 -1
  252. package/package.json +9 -1
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @fileoverview Database resolver for SQL detail display.
3
+ *
4
+ * Why a separate module: `sql detail` shows the database name alongside the SQL
5
+ * metadata, but the database name is only available from the dataset list API
6
+ * (which includes `dbtableConfig.dbName`). Rather than importing `listDatasets`
7
+ * into `sql/exec.ts`, we centralize the dbName resolution here so both
8
+ * `sql detail` and any future command that needs dbName can use it.
9
+ *
10
+ * Design decision: `getDbName` silently returns `undefined` on error.
11
+ * Why: the AK that gives access to SQL queries may not have permission to
12
+ * list datasets. In that case, `sql detail` should still show the dbId
13
+ * number rather than crashing. The caller (`sql detail`) handles the
14
+ * `undefined` case by falling back to showing the raw dbId.
15
+ *
16
+ * The cache is keyed by `appCode` because different apps have different
17
+ * datasets and thus different database names.
18
+ */
19
+ /** A resolved database entry from the dataset list. */
20
+ export interface DbEntry {
21
+ dbId: number;
22
+ dbName: string;
23
+ }
24
+ /**
25
+ * Lists all databases accessible to an app (from dataset metadata).
26
+ * Results are cached per app to avoid repeated API calls.
27
+ */
28
+ export declare function listDatabases(appCode: string): Promise<DbEntry[]>;
29
+ /**
30
+ * Resolves a database ID to its display name.
31
+ *
32
+ * @returns The dbName if found; `undefined` if not found (e.g. permission denied).
33
+ *
34
+ * Why return undefined instead of throwing: callers (like `sql detail`) should
35
+ * degrade gracefully and show the dbId number when the name can't be resolved.
36
+ * This matches the principle that permission errors on auxiliary data should
37
+ * not block the primary operation.
38
+ */
39
+ export declare function getDbName(appCode: string, dbId: number): Promise<string | undefined>;
@@ -1 +1 @@
1
- function a76_0x1cb5(){const _0x112d9e=['8079211jIRXZA','set','1598349dCApiH','db-','entries','1891368vOvkdZ','dbtableConfig','1316680GAenfV','get','dbId','8MnBTJU','has','2huMftR','877710BUakML','5MZvOno','41172370UxosuG','1247517dQSTde'];a76_0x1cb5=function(){return _0x112d9e;};return a76_0x1cb5();}(function(_0xdbf9d9,_0x329b09){const _0x41d457=a76_0x35b5,_0x1dc409=_0xdbf9d9();while(!![]){try{const _0x3fc386=parseInt(_0x41d457(0x180))/0x1*(-parseInt(_0x41d457(0x17b))/0x2)+-parseInt(_0x41d457(0x187))/0x3+-parseInt(_0x41d457(0x179))/0x4+parseInt(_0x41d457(0x182))/0x5*(parseInt(_0x41d457(0x181))/0x6)+-parseInt(_0x41d457(0x185))/0x7+-parseInt(_0x41d457(0x17e))/0x8*(-parseInt(_0x41d457(0x184))/0x9)+parseInt(_0x41d457(0x183))/0xa;if(_0x3fc386===_0x329b09)break;else _0x1dc409['push'](_0x1dc409['shift']());}catch(_0x18c013){_0x1dc409['push'](_0x1dc409['shift']());}}}(a76_0x1cb5,0xe1fd9));import{listDatasets}from'../core/api-client.js';function a76_0x35b5(_0x3bb8ce,_0x4877bc){_0x3bb8ce=_0x3bb8ce-0x178;const _0x1cb565=a76_0x1cb5();let _0x35b563=_0x1cb565[_0x3bb8ce];return _0x35b563;}const cache=new Map();export async function listDatabases(_0x2dcadc){const _0x11f064=a76_0x35b5;if(cache[_0x11f064(0x17f)](_0x2dcadc))return cache[_0x11f064(0x17c)](_0x2dcadc);const _0x2aa471=await listDatasets(_0x2dcadc),_0x2a78f6=new Map();for(const _0x5cdefb of _0x2aa471){const _0x349fbe=_0x5cdefb[_0x11f064(0x17a)];_0x349fbe?.[_0x11f064(0x17d)]!=null&&_0x2a78f6[_0x11f064(0x186)](_0x349fbe[_0x11f064(0x17d)],_0x349fbe['dbName']??_0x11f064(0x188)+_0x349fbe[_0x11f064(0x17d)]);}const _0x1df12d=[..._0x2a78f6[_0x11f064(0x178)]()]['map'](([_0x408a37,_0x2d7be2])=>({'dbId':_0x408a37,'dbName':_0x2d7be2}));return cache['set'](_0x2dcadc,_0x1df12d),_0x1df12d;}export async function getDbName(_0x23fd3f,_0x448b40){const _0x11fa45=a76_0x35b5;try{const _0x22d508=await listDatabases(_0x23fd3f);return _0x22d508['find'](_0x341f28=>_0x341f28[_0x11fa45(0x17d)]===_0x448b40)?.['dbName'];}catch{return undefined;}}
1
+ (function(_0x4ce971,_0x560930){const _0x54ca53=a77_0x4fb7,_0x19398e=_0x4ce971();while(!![]){try{const _0x373ed7=-parseInt(_0x54ca53(0x93))/0x1+parseInt(_0x54ca53(0x9a))/0x2+parseInt(_0x54ca53(0x95))/0x3+parseInt(_0x54ca53(0x92))/0x4*(-parseInt(_0x54ca53(0xa3))/0x5)+parseInt(_0x54ca53(0x9c))/0x6*(parseInt(_0x54ca53(0x94))/0x7)+parseInt(_0x54ca53(0x97))/0x8*(parseInt(_0x54ca53(0x99))/0x9)+parseInt(_0x54ca53(0x9e))/0xa*(-parseInt(_0x54ca53(0x9b))/0xb);if(_0x373ed7===_0x560930)break;else _0x19398e['push'](_0x19398e['shift']());}catch(_0x2f8df6){_0x19398e['push'](_0x19398e['shift']());}}}(a77_0x538e,0x99862));import{listDatasets}from'../core/api-client.js';function a77_0x4fb7(_0x2193a0,_0x5e004b){_0x2193a0=_0x2193a0-0x91;const _0x538e28=a77_0x538e();let _0x4fb7c9=_0x538e28[_0x2193a0];return _0x4fb7c9;}function a77_0x538e(){const _0x2c9585=['dbName','60AwHrzw','set','275764FstSYQ','396663vOZkGR','294uaXuqd','2634426NTLFEZ','map','3136gjJPWh','dbtableConfig','26046JjWvan','576758yvRZju','9426164SMBilH','58392QhjHqe','get','10BhRBMi','entries','find','dbId'];a77_0x538e=function(){return _0x2c9585;};return a77_0x538e();}const cache=new Map();export async function listDatabases(_0x34bb19){const _0x2ec1ec=a77_0x4fb7;if(cache['has'](_0x34bb19))return cache[_0x2ec1ec(0x9d)](_0x34bb19);const _0x12c923=await listDatasets(_0x34bb19),_0x4d7a9f=new Map();for(const _0x4479ad of _0x12c923){const _0x5892eb=_0x4479ad[_0x2ec1ec(0x98)];_0x5892eb?.[_0x2ec1ec(0xa1)]!=null&&_0x4d7a9f['set'](_0x5892eb[_0x2ec1ec(0xa1)],_0x5892eb[_0x2ec1ec(0xa2)]??'db-'+_0x5892eb[_0x2ec1ec(0xa1)]);}const _0x44bf2b=[..._0x4d7a9f[_0x2ec1ec(0x9f)]()][_0x2ec1ec(0x96)](([_0x29a413,_0xac6039])=>({'dbId':_0x29a413,'dbName':_0xac6039}));return cache[_0x2ec1ec(0x91)](_0x34bb19,_0x44bf2b),_0x44bf2b;}export async function getDbName(_0x31740a,_0x2a6a84){const _0x57756a=a77_0x4fb7;try{const _0x288eda=await listDatabases(_0x31740a);return _0x288eda[_0x57756a(0xa0)](_0x122e9c=>_0x122e9c[_0x57756a(0xa1)]===_0x2a6a84)?.[_0x57756a(0xa2)];}catch{return undefined;}}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @fileoverview SDK client for runtime operations (data, SQL, BFF execution).
3
+ *
4
+ * Why a separate SDK client: the `@lovrabet/sdk` encapsulates the runtime engine's
5
+ * API surface. Unlike the raw `fetch`-based management API (`api-client.ts`),
6
+ * the SDK handles:
7
+ * - Client lifecycle (creation, initialization)
8
+ * - Per-operation routing (data operations vs. SQL vs. BFF)
9
+ * - SDK-specific conventions (model keys, parameter extraction)
10
+ *
11
+ * Why the SDK is initialized in `prepare` and stored as a module-level variable:
12
+ * creating the SDK client involves network setup and type registration. Storing
13
+ * it globally avoids passing it through every function call. The `finalize` hook
14
+ * clears it to prevent cross-command contamination.
15
+ *
16
+ * Design decision: `executeData` uses dynamic model key lookup
17
+ * (`dataset_${code}`) rather than requiring pre-registered models. This matches
18
+ * the Lovrabet SDK's dynamic model convention and avoids a registration step
19
+ * in `prepare`.
20
+ */
21
+ import type { AuthMode } from "../constant/auth-mode.js";
22
+ /** Options for initializing the SDK client. */
23
+ export interface SdkClientOptions {
24
+ appCode: string;
25
+ env: "production" | "development" | "daily";
26
+ accessKey?: string;
27
+ authMode?: AuthMode;
28
+ }
29
+ /**
30
+ * Initializes the global SDK client for subsequent runtime operations.
31
+ *
32
+ * Why `initSdkClient` is idempotent: `prepare` is called for every command, and
33
+ * commands may share the same app/env/AK combination. Calling `createClient`
34
+ * multiple times with the same params is wasteful. The module-level `_client`
35
+ * variable ensures only one client instance exists at a time.
36
+ */
37
+ export declare function initSdkClient(opts: SdkClientOptions): void;
38
+ /** Clears the SDK client and restores process-wide patches installed for it. */
39
+ export declare function clearSdkClient(): void;
40
+ /**
41
+ * Executes a data operation on a dataset via the SDK.
42
+ *
43
+ * Why model access by key (`dataset_${datasetCode}`): Lovrabet's SDK uses
44
+ * a dynamic model registry where each dataset is accessible as `models.dataset_<code>`.
45
+ * This avoids requiring the SDK to know all dataset codes upfront.
46
+ *
47
+ * Parameter extraction conventions:
48
+ * - `filter(params)` — params passed directly
49
+ * - `getOne(id | {id})` — extract `id` from params
50
+ * - `update(id, data)` — extract `id`, pass rest as data
51
+ * - `delete(id)` — extract `id` from params
52
+ * - `batchCreate(items[])` — normalize params (array or `{ items: [...] }`)
53
+ * - `aggregate(params)` — params passed after normalizing deprecated `aggregate[].field` to `column`
54
+ *
55
+ * These conventions match the Lovrabet API's request body structure and
56
+ * were derived from the SDK's internal expectations.
57
+ */
58
+ export declare function executeData(datasetCode: string, operation: string, params?: Record<string, any> | unknown[]): Promise<any>;
59
+ /** Executes a stored SQL query via the SDK. */
60
+ export declare function executeSdkSql(sqlCode: string, params?: Record<string, string | number>): Promise<any>;
61
+ /** Executes a BFF script via the SDK. */
62
+ export declare function executeSdkBff(functionName: string, params?: Record<string, any>): Promise<any>;
@@ -1 +1 @@
1
- (function(_0xf7264c,_0x370ee){const _0x1ccf6a=a77_0x478d,_0x5c9099=_0xf7264c();while(!![]){try{const _0x350447=parseInt(_0x1ccf6a(0x19f))/0x1*(-parseInt(_0x1ccf6a(0x18d))/0x2)+-parseInt(_0x1ccf6a(0x184))/0x3+parseInt(_0x1ccf6a(0x193))/0x4*(-parseInt(_0x1ccf6a(0x1a5))/0x5)+parseInt(_0x1ccf6a(0x185))/0x6*(-parseInt(_0x1ccf6a(0x180))/0x7)+-parseInt(_0x1ccf6a(0x19e))/0x8+parseInt(_0x1ccf6a(0x18b))/0x9+parseInt(_0x1ccf6a(0x195))/0xa;if(_0x350447===_0x370ee)break;else _0x5c9099['push'](_0x5c9099['shift']());}catch(_0x40d392){_0x5c9099['push'](_0x5c9099['shift']());}}}(a77_0x2b59,0x2cf3e));import{createClient}from'@lovrabet/sdk';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{parseBatchCreateItemsFromParams}from'../utils/params.js';function a77_0x478d(_0x472bc6,_0x5f0f79){_0x472bc6=_0x472bc6-0x180;const _0x2b59b0=a77_0x2b59();let _0x478d9=_0x2b59b0[_0x472bc6];return _0x478d9;}import{installLosslessJsonResponseParser}from'../utils/lossless-json.js';let _client,restoreResponseJsonParser;export function initSdkClient(_0x2d9e02){const _0x5d32b9=a77_0x478d;restoreResponseJsonParser??=installLosslessJsonResponseParser();try{_client=createClient({'appCode':_0x2d9e02[_0x5d32b9(0x191)],'env':_0x2d9e02[_0x5d32b9(0x1a4)],'authMode':_0x2d9e02[_0x5d32b9(0x182)],..._0x2d9e02['accessKey']?{'accessKey':_0x2d9e02[_0x5d32b9(0x190)]}:{},'options':{'timeout':0x7530,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x5d32b9(0x183)]}}});}catch(_0x2dd0cc){clearSdkClient();throw _0x2dd0cc;}}export function clearSdkClient(){_client=undefined,restoreResponseJsonParser?.(),restoreResponseJsonParser=undefined;}function ensureClient(){if(!_client)throw new Error('SDK\x20client\x20not\x20initialized.\x20Call\x20initSdkClient()\x20first.');return _client;}function a77_0x2b59(){const _0x56e2fb=['appCode','map','1185244kyyODg','delete','7604410WgfwSw','getOne\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','isArray','function','string','Available:\x20filter,\x20getOne,\x20create,\x20batchCreate,\x20update,\x20delete,\x20aggregate.','execute','data\x20aggregate\x20--params.aggregate[','aggregate','453144jYLoMn','1MQPbjh','\x22.\x20','field','batchCreate','object','env','5fxCmFt',']\x20must\x20be\x20an\x20object.','1127rdgLpH','delete\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','authMode','invokeSource','66306XwWauv','10998IHLcXY','update\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123,\x22name\x22:\x22new\x22}\x27\x20or\x20\x27{\x22id\x22:[1,2,3],\x22name\x22:\x22new\x22}\x27','sql','getOne','models','validation','1663335QytZDw','data\x20aggregate\x20--params.aggregate\x20must\x20be\x20an\x20array.','181922ukwTJO','column','bff','accessKey'];a77_0x2b59=function(){return _0x56e2fb;};return a77_0x2b59();}function normalizeAggregateParams(_0x4b7567){const _0x44be07=a77_0x478d,_0x561716=_0x4b7567[_0x44be07(0x19d)];if(_0x561716===undefined)return _0x4b7567;if(!Array[_0x44be07(0x197)](_0x561716))throw CliErrors['validation'](_0x44be07(0x18c));return{..._0x4b7567,'aggregate':_0x561716[_0x44be07(0x192)]((_0x52621b,_0xabc4f9)=>{const _0x2fb6c2=_0x44be07;if(!_0x52621b||typeof _0x52621b!==_0x2fb6c2(0x1a3)||Array['isArray'](_0x52621b))throw CliErrors[_0x2fb6c2(0x18a)](_0x2fb6c2(0x19c)+_0xabc4f9+_0x2fb6c2(0x1a6));const _0x2e2f16=_0x52621b[_0x2fb6c2(0x18e)]??_0x52621b[_0x2fb6c2(0x1a1)];if(typeof _0x2e2f16!==_0x2fb6c2(0x199)||_0x2e2f16['trim']()==='')throw CliErrors[_0x2fb6c2(0x18a)](_0x2fb6c2(0x19c)+_0xabc4f9+']\x20requires\x20\x22column\x22;\x20\x22field\x22\x20is\x20accepted\x20only\x20as\x20a\x20deprecated\x20alias.');const _0x1bd676={..._0x52621b,'column':_0x2e2f16};return delete _0x1bd676[_0x2fb6c2(0x1a1)],_0x1bd676;})};}export async function executeData(_0x1d5eac,_0x476f86,_0x3adcb8){const _0x1fc951=a77_0x478d,_0xe62e21=ensureClient(),_0xc617f2='dataset_'+_0x1d5eac,_0x2e907f=_0xe62e21[_0x1fc951(0x189)][_0xc617f2];if(!_0x2e907f||typeof _0x2e907f[_0x476f86]!==_0x1fc951(0x198))throw new Error('SDK\x20model\x20does\x20not\x20support\x20operation\x20\x22'+_0x476f86+_0x1fc951(0x1a0)+_0x1fc951(0x19a));if(_0x476f86==='batchCreate')return _0x2e907f[_0x1fc951(0x1a2)](parseBatchCreateItemsFromParams(_0x3adcb8));const _0x295724=_0x3adcb8!==undefined&&_0x3adcb8!==null&&!Array[_0x1fc951(0x197)](_0x3adcb8)?_0x3adcb8:{};switch(_0x476f86){case _0x1fc951(0x188):{const _0x231134=_0x295724['id'];if(_0x231134===undefined||_0x231134===null)throw new Error(_0x1fc951(0x196));return _0x2e907f[_0x1fc951(0x188)](_0x231134);}case'update':{const {id:_0x303d04,..._0x4b7407}=_0x295724;if(_0x303d04===undefined||_0x303d04===null)throw new Error(_0x1fc951(0x186));return _0x2e907f['update'](_0x303d04,_0x4b7407);}case _0x1fc951(0x194):{const _0x49a0df=_0x295724['id'];if(_0x49a0df===undefined||_0x49a0df===null)throw new Error(_0x1fc951(0x181));return _0x2e907f[_0x1fc951(0x194)](_0x49a0df);}case'aggregate':return _0x2e907f['aggregate'](normalizeAggregateParams(_0x295724));default:return _0x2e907f[_0x476f86](_0x295724);}}export async function executeSdkSql(_0x4ecbdc,_0x1ef249){const _0x4e2cf5=a77_0x478d,_0x576cc3=ensureClient();return _0x576cc3[_0x4e2cf5(0x187)][_0x4e2cf5(0x19b)]({'sqlCode':_0x4ecbdc,'params':_0x1ef249});}export async function executeSdkBff(_0x5917a9,_0x193ca2){const _0x268c0e=a77_0x478d,_0x446b4c=ensureClient();return _0x446b4c[_0x268c0e(0x18f)][_0x268c0e(0x19b)]({'scriptName':_0x5917a9,'params':_0x193ca2});}
1
+ (function(_0x3d7dd4,_0x1498c1){const _0x4dfa0b=a78_0x318b,_0x244a0b=_0x3d7dd4();while(!![]){try{const _0xed829=parseInt(_0x4dfa0b(0xdc))/0x1*(parseInt(_0x4dfa0b(0xdf))/0x2)+parseInt(_0x4dfa0b(0xd8))/0x3*(parseInt(_0x4dfa0b(0xd9))/0x4)+-parseInt(_0x4dfa0b(0xe4))/0x5*(-parseInt(_0x4dfa0b(0xce))/0x6)+-parseInt(_0x4dfa0b(0xed))/0x7+parseInt(_0x4dfa0b(0xe0))/0x8*(-parseInt(_0x4dfa0b(0xc9))/0x9)+parseInt(_0x4dfa0b(0xde))/0xa+-parseInt(_0x4dfa0b(0xd1))/0xb*(-parseInt(_0x4dfa0b(0xee))/0xc);if(_0xed829===_0x1498c1)break;else _0x244a0b['push'](_0x244a0b['shift']());}catch(_0x57b3b0){_0x244a0b['push'](_0x244a0b['shift']());}}}(a78_0x4360,0x38f25));import{createClient}from'@lovrabet/sdk';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{parseBatchCreateItemsFromParams}from'../utils/params.js';import{installLosslessJsonResponseParser}from'../utils/lossless-json.js';let _client,restoreResponseJsonParser;export function initSdkClient(_0x16289e){const _0x254c20=a78_0x318b;restoreResponseJsonParser??=installLosslessJsonResponseParser();try{_client=createClient({'appCode':_0x16289e[_0x254c20(0xc8)],'env':_0x16289e[_0x254c20(0xd5)],'authMode':_0x16289e[_0x254c20(0xeb)],..._0x16289e[_0x254c20(0xd4)]?{'accessKey':_0x16289e[_0x254c20(0xd4)]}:{},'options':{'timeout':0x7530,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x254c20(0xe5)]}}});}catch(_0x470f73){clearSdkClient();throw _0x470f73;}}export function clearSdkClient(){_client=undefined,restoreResponseJsonParser?.(),restoreResponseJsonParser=undefined;}function ensureClient(){if(!_client)throw new Error('SDK\x20client\x20not\x20initialized.\x20Call\x20initSdkClient()\x20first.');return _client;}function normalizeAggregateParams(_0x173cc0){const _0x54f6b9=a78_0x318b,_0x4fa34b=_0x173cc0[_0x54f6b9(0xcc)];if(_0x4fa34b===undefined)return _0x173cc0;if(!Array[_0x54f6b9(0xdb)](_0x4fa34b))throw CliErrors[_0x54f6b9(0xe2)](_0x54f6b9(0xe3));return{..._0x173cc0,'aggregate':_0x4fa34b[_0x54f6b9(0xcb)]((_0x3fbbb6,_0x4592f1)=>{const _0x21025e=_0x54f6b9;if(!_0x3fbbb6||typeof _0x3fbbb6!==_0x21025e(0xe9)||Array[_0x21025e(0xdb)](_0x3fbbb6))throw CliErrors[_0x21025e(0xe2)](_0x21025e(0xcd)+_0x4592f1+_0x21025e(0xd0));const _0x62b2cd=_0x3fbbb6[_0x21025e(0xc7)]??_0x3fbbb6[_0x21025e(0xca)];if(typeof _0x62b2cd!==_0x21025e(0xec)||_0x62b2cd[_0x21025e(0xea)]()==='')throw CliErrors['validation'](_0x21025e(0xcd)+_0x4592f1+_0x21025e(0xdd));const _0x452a0a={..._0x3fbbb6,'column':_0x62b2cd};return delete _0x452a0a[_0x21025e(0xca)],_0x452a0a;})};}function a78_0x318b(_0x50e7ec,_0x57f6eb){_0x50e7ec=_0x50e7ec-0xc7;const _0x4360f6=a78_0x4360();let _0x318b94=_0x4360f6[_0x50e7ec];return _0x318b94;}export async function executeData(_0x4e79d9,_0x49e1be,_0x30e3a3){const _0x426583=a78_0x318b,_0x230a7f=ensureClient(),_0x53e956='dataset_'+_0x4e79d9,_0x7f3300=_0x230a7f['models'][_0x53e956];if(!_0x7f3300||typeof _0x7f3300[_0x49e1be]!==_0x426583(0xda))throw new Error('SDK\x20model\x20does\x20not\x20support\x20operation\x20\x22'+_0x49e1be+_0x426583(0xe7)+'Available:\x20filter,\x20getOne,\x20create,\x20batchCreate,\x20update,\x20delete,\x20aggregate.');if(_0x49e1be===_0x426583(0xd3))return _0x7f3300[_0x426583(0xd3)](parseBatchCreateItemsFromParams(_0x30e3a3));const _0x4733c0=_0x30e3a3!==undefined&&_0x30e3a3!==null&&!Array['isArray'](_0x30e3a3)?_0x30e3a3:{};switch(_0x49e1be){case _0x426583(0xef):{const _0x39804f=_0x4733c0['id'];if(_0x39804f===undefined||_0x39804f===null)throw new Error(_0x426583(0xd6));return _0x7f3300['getOne'](_0x39804f);}case _0x426583(0xe8):{const {id:_0x4a098b,..._0x3d8456}=_0x4733c0;if(_0x4a098b===undefined||_0x4a098b===null)throw new Error(_0x426583(0xd7));return _0x7f3300['update'](_0x4a098b,_0x3d8456);}case _0x426583(0xcf):{const _0x38dee9=_0x4733c0['id'];if(_0x38dee9===undefined||_0x38dee9===null)throw new Error(_0x426583(0xe6));return _0x7f3300['delete'](_0x38dee9);}case'aggregate':return _0x7f3300[_0x426583(0xcc)](normalizeAggregateParams(_0x4733c0));default:return _0x7f3300[_0x49e1be](_0x4733c0);}}function a78_0x4360(){const _0x5ea105=['execute','batchCreate','accessKey','env','getOne\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','update\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123,\x22name\x22:\x22new\x22}\x27\x20or\x20\x27{\x22id\x22:[1,2,3],\x22name\x22:\x22new\x22}\x27','68844YzDFvx','4XZqDxv','function','isArray','22870kfdeed',']\x20requires\x20\x22column\x22;\x20\x22field\x22\x20is\x20accepted\x20only\x20as\x20a\x20deprecated\x20alias.','576210qBYdIr','32juzJzc','11960GLwFZB','sql','validation','data\x20aggregate\x20--params.aggregate\x20must\x20be\x20an\x20array.','15ufErYi','invokeSource','delete\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','\x22.\x20','update','object','trim','authMode','string','1806455jJLsNG','15132putXcl','getOne','column','appCode','2547zaUMpw','field','map','aggregate','data\x20aggregate\x20--params.aggregate[','146442WBYChE','delete',']\x20must\x20be\x20an\x20object.','3443WtaMxV'];a78_0x4360=function(){return _0x5ea105;};return a78_0x4360();}export async function executeSdkSql(_0x579b32,_0xa647e3){const _0x52c9a4=a78_0x318b,_0x38bde0=ensureClient();return _0x38bde0[_0x52c9a4(0xe1)][_0x52c9a4(0xd2)]({'sqlCode':_0x579b32,'params':_0xa647e3});}export async function executeSdkBff(_0x3440e0,_0x375db7){const _0x5d568a=a78_0x318b,_0x40c3a5=ensureClient();return _0x40c3a5['bff'][_0x5d568a(0xd2)]({'scriptName':_0x3440e0,'params':_0x375db7});}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @fileoverview Error factory singleton for Lovrabet Runtime CLI.
3
+ *
4
+ * Wraps the framework error factory with CLI-specific hint messages.
5
+ * All errors thrown by command implementations must go through this factory
6
+ * so the top-level handler can format them consistently.
7
+ *
8
+ * Why: Throwing raw `new CliError` scattered across commands makes it impossible
9
+ * to change hint messages or error codes without a global search. Centralizing
10
+ * through `CliErrors` keeps the contract in one place.
11
+ */
12
+ import { CliError } from "@lovrabet/cli-framework";
13
+ export { CliError };
14
+ export declare const CliErrors: {
15
+ rateLimited: (message: string, hint?: string) => CliError;
16
+ authRequired(hint?: string): CliError;
17
+ configMissing(hint?: string): CliError;
18
+ notInProject(): CliError;
19
+ apiError(message: string, hint?: string): CliError;
20
+ networkError(message: string): CliError;
21
+ unknownCommand(cmd: string): CliError;
22
+ flagMissing(flagName: string, hint?: string): CliError;
23
+ validation(message: string, hint?: string): CliError;
24
+ cancelled(message?: string): CliError;
25
+ };
package/lib/errors.js CHANGED
@@ -1 +1 @@
1
- function a78_0x2f24(){const _0x3c3574=['215868pdmCZU','newConfigFileName','283808BlqHkJ','Run\x20this\x20command\x20inside\x20a\x20directory\x20with\x20a\x20','1856qmMOcw','1240syGUzR','1134095yOKoti','1103352kCuNsJ','\x20auth\x20login`.','656579hCqQzW','6XglZtG','rate_limited','283063RqAzcw','\x20or\x20run\x20`','75qfGSBM','22257zoNVxJ','Configure\x20accessKey\x20in\x20'];a78_0x2f24=function(){return _0x3c3574;};return a78_0x2f24();}const a78_0x51a71c=a78_0x2f34;(function(_0xa19862,_0x1b6631){const _0x3db7aa=a78_0x2f34,_0x1eaac7=_0xa19862();while(!![]){try{const _0x19d15a=-parseInt(_0x3db7aa(0xad))/0x1+parseInt(_0x3db7aa(0xa9))/0x2+parseInt(_0x3db7aa(0xb1))/0x3*(-parseInt(_0x3db7aa(0xae))/0x4)+parseInt(_0x3db7aa(0xb5))/0x5*(-parseInt(_0x3db7aa(0xa7))/0x6)+parseInt(_0x3db7aa(0xb0))/0x7+-parseInt(_0x3db7aa(0xab))/0x8*(parseInt(_0x3db7aa(0xb6))/0x9)+parseInt(_0x3db7aa(0xac))/0xa*(parseInt(_0x3db7aa(0xb3))/0xb);if(_0x19d15a===_0x1b6631)break;else _0x1eaac7['push'](_0x1eaac7['shift']());}catch(_0x4327ef){_0x1eaac7['push'](_0x1eaac7['shift']());}}}(a78_0x2f24,0x992d8));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG}from'./constant/product.js';function a78_0x2f34(_0x71ef27,_0x11f348){_0x71ef27=_0x71ef27-0xa6;const _0x2f2446=a78_0x2f24();let _0x2f346b=_0x2f2446[_0x71ef27];return _0x2f346b;}export{CliError};const baseCliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a78_0x51a71c(0xa6)+PRODUCT_CONFIG[a78_0x51a71c(0xa8)]+a78_0x51a71c(0xb4)+CLI_BIN_NAME+a78_0x51a71c(0xaf),'configMissingHint':'Set\x20appcode\x20via\x20--appcode\x20or\x20'+PRODUCT_CONFIG[a78_0x51a71c(0xa8)]+'.','notInProjectHint':a78_0x51a71c(0xaa)+PRODUCT_CONFIG[a78_0x51a71c(0xa8)]+'\x20file.'});export const CliErrors={...baseCliErrors,'rateLimited':(_0x3e0368,_0x42ebf6)=>new CliError(a78_0x51a71c(0xb2),0x2,_0x3e0368,_0x42ebf6)};
1
+ const a79_0x527f66=a79_0x53d1;(function(_0xd54dd2,_0x9304cd){const _0x4b18f0=a79_0x53d1,_0x2263d6=_0xd54dd2();while(!![]){try{const _0x3447f3=parseInt(_0x4b18f0(0x126))/0x1+-parseInt(_0x4b18f0(0x12e))/0x2+parseInt(_0x4b18f0(0x129))/0x3*(-parseInt(_0x4b18f0(0x12b))/0x4)+-parseInt(_0x4b18f0(0x132))/0x5*(-parseInt(_0x4b18f0(0x12a))/0x6)+parseInt(_0x4b18f0(0x131))/0x7+parseInt(_0x4b18f0(0x130))/0x8+parseInt(_0x4b18f0(0x124))/0x9*(-parseInt(_0x4b18f0(0x128))/0xa);if(_0x3447f3===_0x9304cd)break;else _0x2263d6['push'](_0x2263d6['shift']());}catch(_0x13c12e){_0x2263d6['push'](_0x2263d6['shift']());}}}(a79_0x148a,0xebe12));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG}from'./constant/product.js';export{CliError};function a79_0x53d1(_0x452fec,_0x3133e6){_0x452fec=_0x452fec-0x124;const _0x148ae3=a79_0x148a();let _0x53d154=_0x148ae3[_0x452fec];return _0x53d154;}const baseCliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a79_0x527f66(0x134)+PRODUCT_CONFIG[a79_0x527f66(0x125)]+'\x20or\x20run\x20`'+CLI_BIN_NAME+a79_0x527f66(0x127),'configMissingHint':a79_0x527f66(0x12c)+PRODUCT_CONFIG[a79_0x527f66(0x125)]+'.','notInProjectHint':a79_0x527f66(0x12d)+PRODUCT_CONFIG[a79_0x527f66(0x125)]+a79_0x527f66(0x12f)});export const CliErrors={...baseCliErrors,'rateLimited':(_0x5001a1,_0x4f1264)=>new CliError(a79_0x527f66(0x133),0x2,_0x5001a1,_0x4f1264)};function a79_0x148a(){const _0xc8bc28=['80862MoZRiH','78004dHGrIe','Set\x20appcode\x20via\x20--appcode\x20or\x20','Run\x20this\x20command\x20inside\x20a\x20directory\x20with\x20a\x20','647226LiVhGn','\x20file.','10203008eJqjIw','1003702MeGRjm','715tSqqpk','rate_limited','Configure\x20accessKey\x20in\x20','423QDzslN','newConfigFileName','22318ZIEZzl','\x20auth\x20login`.','429790zDrGIJ','9PddyZD'];a79_0x148a=function(){return _0xc8bc28;};return a79_0x148a();}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @fileoverview Builds the effective flag list for a command with runtime defaults.
3
+ *
4
+ * Delegates to the framework's `buildAllFlagsBase`, injecting `DEFAULT_COMMAND_OUTPUT_FORMAT`
5
+ * ("compress") as the default `--format` value. This is the only runtime-specific
6
+ * customization needed — the framework handles the rest.
7
+ *
8
+ * Why not re-implement here: the built-in flag injection logic (dry-run, format, yes)
9
+ * is framework-owned. We only configure the format default so the framework uses
10
+ * compress instead of json for commands that don't declare their own default.
11
+ */
12
+ import type { CommandDefinition, FlagDef } from "../framework/types.js";
13
+ /**
14
+ * Builds the complete flag list for a command definition.
15
+ *
16
+ * Injects:
17
+ * - `--dry-run` (if `def.dryRun` is defined)
18
+ * - `--format` (unless `def.hasFormat === false`) with default `"compress"`
19
+ * - `--yes` (if `def.risk === "high-risk-write"`)
20
+ *
21
+ * @param def - The command definition.
22
+ * @returns Complete flag array (command flags + framework-injected flags).
23
+ */
24
+ export declare function buildAllFlags(def: CommandDefinition): FlagDef[];
@@ -1 +1 @@
1
- (function(_0x555609,_0x21380b){var _0x59e7e1=a79_0x4c73,_0x29048a=_0x555609();while(!![]){try{var _0x324238=parseInt(_0x59e7e1(0x7d))/0x1*(-parseInt(_0x59e7e1(0x84))/0x2)+-parseInt(_0x59e7e1(0x7f))/0x3+parseInt(_0x59e7e1(0x86))/0x4*(parseInt(_0x59e7e1(0x7c))/0x5)+-parseInt(_0x59e7e1(0x85))/0x6*(parseInt(_0x59e7e1(0x83))/0x7)+parseInt(_0x59e7e1(0x80))/0x8+parseInt(_0x59e7e1(0x82))/0x9+parseInt(_0x59e7e1(0x81))/0xa*(parseInt(_0x59e7e1(0x7e))/0xb);if(_0x324238===_0x21380b)break;else _0x29048a['push'](_0x29048a['shift']());}catch(_0x19843f){_0x29048a['push'](_0x29048a['shift']());}}}(a79_0x2715,0xdf010));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a79_0x450db5}from'@lovrabet/cli-framework';export function buildAllFlags(_0x223a4){return a79_0x450db5(_0x223a4,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});}function a79_0x4c73(_0x7669e,_0x2d73b9){_0x7669e=_0x7669e-0x7c;var _0x2715ab=a79_0x2715();var _0x4c7342=_0x2715ab[_0x7669e];return _0x4c7342;}function a79_0x2715(){var _0x293bed=['205976XrFPIx','25alDhwp','899yIMnNt','121cIfWMt','526593KVhyUa','6679584USiaUb','1063380dKQRKg','8491077LWBvGT','7636125DaDCTs','2282qerOvM','6yFJSXy'];a79_0x2715=function(){return _0x293bed;};return a79_0x2715();}
1
+ (function(_0x5b5f67,_0x2630f0){var _0x397988=a80_0x3660,_0x23cb48=_0x5b5f67();while(!![]){try{var _0x513b86=-parseInt(_0x397988(0x149))/0x1*(parseInt(_0x397988(0x146))/0x2)+parseInt(_0x397988(0x14c))/0x3+-parseInt(_0x397988(0x143))/0x4*(-parseInt(_0x397988(0x145))/0x5)+parseInt(_0x397988(0x147))/0x6+-parseInt(_0x397988(0x148))/0x7*(-parseInt(_0x397988(0x141))/0x8)+-parseInt(_0x397988(0x14a))/0x9*(-parseInt(_0x397988(0x142))/0xa)+-parseInt(_0x397988(0x144))/0xb*(parseInt(_0x397988(0x14b))/0xc);if(_0x513b86===_0x2630f0)break;else _0x23cb48['push'](_0x23cb48['shift']());}catch(_0x670789){_0x23cb48['push'](_0x23cb48['shift']());}}}(a80_0x178a,0x222aa));function a80_0x3660(_0x412721,_0x2f4d1c){_0x412721=_0x412721-0x141;var _0x178a97=a80_0x178a();var _0x366096=_0x178a97[_0x412721];return _0x366096;}function a80_0x178a(){var _0x50996c=['4158864bFModu','347949CKhAay','1544tnfsOr','810230CoCRAr','1928zEHWoP','11GMAbVT','1895bAAesU','1014kipGUH','1238316eFrppt','497CIOEpk','543jzORzs','27sjhfZs'];a80_0x178a=function(){return _0x50996c;};return a80_0x178a();}import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a80_0x4e3a00}from'@lovrabet/cli-framework';export function buildAllFlags(_0x1840eb){return a80_0x4e3a00(_0x1840eb,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @fileoverview Declarative dry-run preview builder.
3
+ *
4
+ * Why a builder instead of returning an object: dry-run implementations vary
5
+ * significantly — some commands need to show a request body, others only need
6
+ * a description. A fluent builder lets command authors write:
7
+ *
8
+ * return dryRun("POST", url).body({ name }).description("Create item").build();
9
+ *
10
+ * instead of manually constructing `{ method, url, body, description }` with
11
+ * optional fields. The `build()` call also creates an immutable snapshot, so
12
+ * accidental mutations after returning from `dryRun()` don't affect the result.
13
+ *
14
+ * Why `build()` returns a copy: `DryRunResult` is passed through the framework's
15
+ * `formatOutput` pipeline. If the same builder object were reused across calls,
16
+ * mutating it would corrupt earlier results. Returning a shallow copy is cheap
17
+ * and guarantees isolation.
18
+ *
19
+ * Design decision: `body()` and `description()` are optional. Commands that
20
+ * can't determine a body or description before execution simply omit these calls.
21
+ * The framework's `formatOutput` handles undefined fields gracefully.
22
+ */
23
+ import type { DryRunResult } from "../framework/types.js";
24
+ /**
25
+ * A fluent builder for constructing a dry-run preview.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * return dryRun("POST", `/api/data/${code}/create`)
30
+ * .body({ name: "test", amount: 100 })
31
+ * .description("Create a new record in dataset")
32
+ * .build();
33
+ * ```
34
+ */
35
+ export interface DryRunBuilder {
36
+ /**
37
+ * Attaches the HTTP request body that would be sent.
38
+ * @param data - Request payload (object or array).
39
+ */
40
+ body(data: Record<string, any> | unknown[]): DryRunBuilder;
41
+ /**
42
+ * Attaches a human-readable description of what the operation will do.
43
+ * This is shown in the `pretty` output format.
44
+ * @param desc - Description string.
45
+ */
46
+ description(desc: string): DryRunBuilder;
47
+ /**
48
+ * Freezes the builder state into an immutable `DryRunResult`.
49
+ * Subsequent calls to `body()` or `description()` do not affect the returned object.
50
+ */
51
+ build(): DryRunResult;
52
+ }
53
+ /**
54
+ * Creates a new dry-run preview builder.
55
+ *
56
+ * @param method - HTTP method (e.g. `"POST"`, `"DELETE"`).
57
+ * @param url - Full URL that would be requested.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const result = dryRun("POST", "https://api.example.com/items").build();
62
+ * ```
63
+ */
64
+ export declare function dryRun(method: string, url: string): DryRunBuilder;
@@ -1 +1 @@
1
- function a80_0x52c3(){const _0x3193a8=['4928665nCahnP','173480hbsQwL','3070SpPnqJ','1744305ouKZip','209118TqTBhX','2epSgnF','description','31310tBiSTu','81jpOHQU','14lDWLFG','2205144xVFJNH','body','43868EQfreV'];a80_0x52c3=function(){return _0x3193a8;};return a80_0x52c3();}function a80_0x4c5c(_0x13b145,_0x486a11){_0x13b145=_0x13b145-0x107;const _0x52c37b=a80_0x52c3();let _0x4c5c78=_0x52c37b[_0x13b145];return _0x4c5c78;}(function(_0x3328f5,_0x32b67d){const _0x353b57=a80_0x4c5c,_0x580b33=_0x3328f5();while(!![]){try{const _0x44078d=-parseInt(_0x353b57(0x110))/0x1*(-parseInt(_0x353b57(0x112))/0x2)+-parseInt(_0x353b57(0x10e))/0x3+parseInt(_0x353b57(0x108))/0x4+-parseInt(_0x353b57(0x10b))/0x5+-parseInt(_0x353b57(0x10f))/0x6*(-parseInt(_0x353b57(0x107))/0x7)+-parseInt(_0x353b57(0x10c))/0x8*(-parseInt(_0x353b57(0x113))/0x9)+parseInt(_0x353b57(0x10d))/0xa*(parseInt(_0x353b57(0x10a))/0xb);if(_0x44078d===_0x32b67d)break;else _0x580b33['push'](_0x580b33['shift']());}catch(_0x2cff99){_0x580b33['push'](_0x580b33['shift']());}}}(a80_0x52c3,0x7b327));export function dryRun(_0x3abc8c,_0x49dfc3){const _0x44c6c3={'method':_0x3abc8c,'url':_0x49dfc3},_0xb70024={'body'(_0x26f204){const _0x1b2285=a80_0x4c5c;return _0x44c6c3[_0x1b2285(0x109)]=_0x26f204,_0xb70024;},'description'(_0x157e72){const _0x58380f=a80_0x4c5c;return _0x44c6c3[_0x58380f(0x111)]=_0x157e72,_0xb70024;},'build'(){return{..._0x44c6c3};}};return _0xb70024;}
1
+ (function(_0xe8c53d,_0x49fa27){const _0x4d905e=a81_0x2b9c,_0x5c117c=_0xe8c53d();while(!![]){try{const _0x11148c=-parseInt(_0x4d905e(0x98))/0x1+parseInt(_0x4d905e(0x8f))/0x2+-parseInt(_0x4d905e(0x92))/0x3+-parseInt(_0x4d905e(0x94))/0x4*(-parseInt(_0x4d905e(0x95))/0x5)+parseInt(_0x4d905e(0x97))/0x6+-parseInt(_0x4d905e(0x93))/0x7*(-parseInt(_0x4d905e(0x90))/0x8)+-parseInt(_0x4d905e(0x96))/0x9;if(_0x11148c===_0x49fa27)break;else _0x5c117c['push'](_0x5c117c['shift']());}catch(_0x1753ca){_0x5c117c['push'](_0x5c117c['shift']());}}}(a81_0x592c,0xb9484));export function dryRun(_0x38cfdf,_0x4e9465){const _0x5a034e={'method':_0x38cfdf,'url':_0x4e9465},_0x1346f7={'body'(_0x5372a7){const _0x4da76c=a81_0x2b9c;return _0x5a034e[_0x4da76c(0x91)]=_0x5372a7,_0x1346f7;},'description'(_0x151fd4){return _0x5a034e['description']=_0x151fd4,_0x1346f7;},'build'(){return{..._0x5a034e};}};return _0x1346f7;}function a81_0x2b9c(_0x4b9933,_0x3fba6f){_0x4b9933=_0x4b9933-0x8f;const _0x592c54=a81_0x592c();let _0x2b9c31=_0x592c54[_0x4b9933];return _0x2b9c31;}function a81_0x592c(){const _0x43770f=['8390640FEYkyL','25971FTtAHf','2776214WzbbEX','40zastQF','body','1599726hrgEgd','1969156jikrdn','8qHkRQh','1518365YvEITO','31340736HCvzgf'];a81_0x592c=function(){return _0x43770f;};return a81_0x592c();}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @fileoverview Re-exports of the framework flag parsing helpers.
3
+ *
4
+ * Why re-export rather than re-implementing: `createFlagHelpers` from the framework
5
+ * already implements the full two-phase pipeline (parse → validate). The runtime
6
+ * CLI only needs to wire it to `CliErrors` once here; individual commands import
7
+ * `parseFlags` / `validateFlags` from this file rather than each building their own.
8
+ */
9
+ export type { ParsedFlags } from "@lovrabet/cli-framework";
10
+ /**
11
+ * Phase 1 — converts raw meow flags to typed values according to FlagDef metadata.
12
+ * @see createFlagHelpers in `@lovrabet/cli-framework`
13
+ */
14
+ export declare const parseFlags: (defs: import("@lovrabet/cli-framework").FlagDef[], rawFlags: Record<string, any>) => import("@lovrabet/cli-framework").ParsedFlags;
15
+ /**
16
+ * Phase 2 — validates typed flags against their definitions, throwing on violation.
17
+ * @see createFlagHelpers in `@lovrabet/cli-framework`
18
+ */
19
+ export declare const validateFlags: (defs: import("@lovrabet/cli-framework").FlagDef[], parsed: import("@lovrabet/cli-framework").ParsedFlags, commandLabel: string) => void;
@@ -1 +1 @@
1
- const a81_0x3f7e4c=a81_0xa55f;(function(_0x164784,_0x65aea7){const _0x51d90a=a81_0xa55f,_0x26ea9d=_0x164784();while(!![]){try{const _0xf46338=parseInt(_0x51d90a(0x1f6))/0x1*(-parseInt(_0x51d90a(0x1f2))/0x2)+parseInt(_0x51d90a(0x1f8))/0x3*(parseInt(_0x51d90a(0x1f0))/0x4)+-parseInt(_0x51d90a(0x1f5))/0x5*(parseInt(_0x51d90a(0x1f1))/0x6)+parseInt(_0x51d90a(0x1f4))/0x7+-parseInt(_0x51d90a(0x1f9))/0x8*(-parseInt(_0x51d90a(0x1ed))/0x9)+-parseInt(_0x51d90a(0x1f3))/0xa*(parseInt(_0x51d90a(0x1f7))/0xb)+-parseInt(_0x51d90a(0x1ef))/0xc*(-parseInt(_0x51d90a(0x1ec))/0xd);if(_0xf46338===_0x65aea7)break;else _0x26ea9d['push'](_0x26ea9d['shift']());}catch(_0x341788){_0x26ea9d['push'](_0x26ea9d['shift']());}}}(a81_0x2a52,0xb0d61));import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers['parseFlags'];export const validateFlags=helpers[a81_0x3f7e4c(0x1ee)];function a81_0xa55f(_0x513228,_0x563227){_0x513228=_0x513228-0x1ec;const _0x2a5291=a81_0x2a52();let _0xa55fc8=_0x2a5291[_0x513228];return _0xa55fc8;}function a81_0x2a52(){const _0x1812d8=['8GQIGEq','13119288LpWtJf','382221PQaGlg','validateFlags','12jRqIDh','949444atRuNO','747606LDBPwB','1966454FnyPXp','110hZbnoK','7204827tVtqYt','20lrzgFi','1uQsJPl','587037obZqYB','9kyuwIp'];a81_0x2a52=function(){return _0x1812d8;};return a81_0x2a52();}
1
+ function a82_0x5397(_0x193f6f,_0x4ef735){_0x193f6f=_0x193f6f-0xcd;const _0x575019=a82_0x5750();let _0x5397f5=_0x575019[_0x193f6f];return _0x5397f5;}const a82_0x3e695b=a82_0x5397;(function(_0x3cbff8,_0x144528){const _0x454868=a82_0x5397,_0x5ca837=_0x3cbff8();while(!![]){try{const _0x3ee12f=-parseInt(_0x454868(0xd0))/0x1+parseInt(_0x454868(0xd8))/0x2*(-parseInt(_0x454868(0xd1))/0x3)+-parseInt(_0x454868(0xd5))/0x4*(parseInt(_0x454868(0xd3))/0x5)+parseInt(_0x454868(0xd6))/0x6+-parseInt(_0x454868(0xcd))/0x7*(parseInt(_0x454868(0xce))/0x8)+parseInt(_0x454868(0xcf))/0x9+parseInt(_0x454868(0xd2))/0xa;if(_0x3ee12f===_0x144528)break;else _0x5ca837['push'](_0x5ca837['shift']());}catch(_0x1486af){_0x5ca837['push'](_0x5ca837['shift']());}}}(a82_0x5750,0xa739a));import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers[a82_0x3e695b(0xd4)];function a82_0x5750(){const _0x593995=['6945888sqWkPi','validateFlags','2EYouZd','107933vopBPp','80zDBNXr','1655343sXKEuy','598122FoqphZ','1286043ADCdaC','14832910nEAmDb','5nxdtFZ','parseFlags','3835676mynTmH'];a82_0x5750=function(){return _0x593995;};return a82_0x5750();}export const validateFlags=helpers[a82_0x3e695b(0xd7)];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @fileoverview Help text generators backed by the framework's help engine.
3
+ *
4
+ * Why this module: the framework's `createHelpGenerators` needs resolver functions
5
+ * (`getServiceEntry`, `getServiceDefinitions`, `buildAllFlags`) and CLI metadata
6
+ * (`cliBinName`, `cliDisplayName`, `globalFlags`). Rather than calling the factory
7
+ * in `cli.tsx` and passing these dependencies around, we wire everything up once
8
+ * here and export the ready-to-use generators. Callers (registry commands, schema)
9
+ * import from this module without needing to know the wiring details.
10
+ *
11
+ * Design decision: `appPrerequisiteText` is set here as a constant rather than
12
+ * being derived from config. This keeps help text stable regardless of the user's
13
+ * current configuration and avoids edge cases (e.g. no app selected).
14
+ */
15
+ import type { CommandDefinition } from "../framework/types.js";
16
+ /** Generates help for a single command. */
17
+ export declare function generateCommandHelp(def: CommandDefinition): string;
18
+ /** Generates help for all commands within a service. */
19
+ export declare function generateServiceHelp(service: string): string;
20
+ /** Generates the top-level `--help` output. */
21
+ export declare function generateFullHelp(): string;
@@ -1 +1 @@
1
- (function(_0xcf00ac,_0x514fec){const _0x1618f0=a82_0x2e91,_0x1e2ae5=_0xcf00ac();while(!![]){try{const _0x5950b3=-parseInt(_0x1618f0(0x147))/0x1*(parseInt(_0x1618f0(0x144))/0x2)+parseInt(_0x1618f0(0x143))/0x3+parseInt(_0x1618f0(0x14b))/0x4*(parseInt(_0x1618f0(0x148))/0x5)+-parseInt(_0x1618f0(0x156))/0x6*(parseInt(_0x1618f0(0x146))/0x7)+parseInt(_0x1618f0(0x14d))/0x8*(-parseInt(_0x1618f0(0x14a))/0x9)+-parseInt(_0x1618f0(0x152))/0xa+parseInt(_0x1618f0(0x14e))/0xb;if(_0x5950b3===_0x514fec)break;else _0x1e2ae5['push'](_0x1e2ae5['shift']());}catch(_0x328431){_0x1e2ae5['push'](_0x1e2ae5['shift']());}}}(a82_0x4516,0xd2042));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{insertDynamicServicesAfterServiceTree}from'../framework/service-order.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{getDynamicServiceDefinitions,getDynamicServiceEntry,listDynamicServiceEntries}from'../commands/service/dynamic.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';function a82_0x4516(){const _0x4b445e=['filter','15141340IpmAgX','generateFullHelp','Requires\x20appcode\x20(set\x20via\x20','generateServiceHelp','18zKkcfv','1986855LHchCC','200NnjusG','has','3945543qgPekP','3013GHuXJy','15vfPEHh','\x20or\x20--appcode).','1818225MddYKN','1936736trFNxL','service','32vZthBi','33658570AhkTKl','map','get'];a82_0x4516=function(){return _0x4b445e;};return a82_0x4516();}import{PRODUCT_CONFIG}from'../constant/product.js';function createGenerators(){const _0x1ea1c4=a82_0x2e91;return createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':insertDynamicServicesAfterServiceTree(serviceRegistry,safeListDynamicServiceEntries()),'getServiceEntry':getAnyServiceEntry,'getServiceDefinitions':getAnyServiceDefinitions,'buildAllFlags':buildAllFlags,'appPrerequisiteText':_0x1ea1c4(0x154)+PRODUCT_CONFIG['newConfigFileName']+_0x1ea1c4(0x149)});}export function generateCommandHelp(_0x127de4){return createGenerators()['generateCommandHelp'](_0x127de4);}export function generateServiceHelp(_0x3783c4){const _0x4f03b2=a82_0x2e91;return createGenerators()[_0x4f03b2(0x155)](_0x3783c4);}export function generateFullHelp(){const _0x4ff20a=a82_0x2e91;return createGenerators()[_0x4ff20a(0x153)]();}function a82_0x2e91(_0x5cac32,_0x32f7f8){_0x5cac32=_0x5cac32-0x143;const _0x451689=a82_0x4516();let _0x2e9103=_0x451689[_0x5cac32];return _0x2e9103;}function getAnyServiceEntry(_0x5ed1e5){const _0x798c16=getServiceEntry(_0x5ed1e5);if(_0x798c16)return _0x798c16;try{return getDynamicServiceEntry(_0x5ed1e5);}catch{return undefined;}}function getAnyServiceDefinitions(_0x43fd34){const _0x337b9c=a82_0x2e91,_0x5c8ad1=serviceGroups[_0x337b9c(0x150)](_0x43fd34);if(_0x5c8ad1)return _0x5c8ad1;try{return getDynamicServiceDefinitions(_0x43fd34);}catch{return undefined;}}function safeListDynamicServiceEntries(){const _0x48a226=a82_0x2e91,_0x2d7c8a=new Set(serviceRegistry[_0x48a226(0x14f)](_0x153d3b=>_0x153d3b['service']));try{return listDynamicServiceEntries()[_0x48a226(0x151)](_0x2903a7=>!_0x2d7c8a[_0x48a226(0x145)](_0x2903a7[_0x48a226(0x14c)]));}catch{return[];}}
1
+ (function(_0x38e7bb,_0x16686c){const _0xcd00b2=a83_0x1d01,_0x4e4d1e=_0x38e7bb();while(!![]){try{const _0x3c3cbf=-parseInt(_0xcd00b2(0x1ce))/0x1*(-parseInt(_0xcd00b2(0x1d1))/0x2)+-parseInt(_0xcd00b2(0x1cc))/0x3*(parseInt(_0xcd00b2(0x1c9))/0x4)+parseInt(_0xcd00b2(0x1d5))/0x5+-parseInt(_0xcd00b2(0x1c8))/0x6*(-parseInt(_0xcd00b2(0x1d9))/0x7)+-parseInt(_0xcd00b2(0x1ca))/0x8*(parseInt(_0xcd00b2(0x1d3))/0x9)+-parseInt(_0xcd00b2(0x1d7))/0xa*(-parseInt(_0xcd00b2(0x1cf))/0xb)+-parseInt(_0xcd00b2(0x1d4))/0xc;if(_0x3c3cbf===_0x16686c)break;else _0x4e4d1e['push'](_0x4e4d1e['shift']());}catch(_0x1d7e85){_0x4e4d1e['push'](_0x4e4d1e['shift']());}}}(a83_0xb786,0x58e76));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';function a83_0x1d01(_0xe4f412,_0x3d78e7){_0xe4f412=_0xe4f412-0x1c7;const _0xb7860e=a83_0xb786();let _0x1d01fb=_0xb7860e[_0xe4f412];return _0x1d01fb;}import{insertDynamicServicesAfterServiceTree}from'../framework/service-order.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{getDynamicServiceDefinitions,getDynamicServiceEntry,listDynamicServiceEntries}from'../commands/service/dynamic.js';function a83_0xb786(){const _0x40f750=['816342vzUcuE','4wkUxdW','4244104cZgVPF','generateFullHelp','727029XtuWWS','filter','485lcbhCL','22hUISyY','get','2472TKPOQP','Requires\x20appcode\x20(set\x20via\x20','9YzPrDh','16890924sMoVJm','3431240lLYijJ','service','2892950Difczy','newConfigFileName','35nnQHEZ','has'];a83_0xb786=function(){return _0x40f750;};return a83_0xb786();}import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';function createGenerators(){const _0x2c52c0=a83_0x1d01;return createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':insertDynamicServicesAfterServiceTree(serviceRegistry,safeListDynamicServiceEntries()),'getServiceEntry':getAnyServiceEntry,'getServiceDefinitions':getAnyServiceDefinitions,'buildAllFlags':buildAllFlags,'appPrerequisiteText':_0x2c52c0(0x1d2)+PRODUCT_CONFIG[_0x2c52c0(0x1d8)]+'\x20or\x20--appcode).'});}export function generateCommandHelp(_0x539c02){return createGenerators()['generateCommandHelp'](_0x539c02);}export function generateServiceHelp(_0x3b1f95){return createGenerators()['generateServiceHelp'](_0x3b1f95);}export function generateFullHelp(){const _0x21c549=a83_0x1d01;return createGenerators()[_0x21c549(0x1cb)]();}function getAnyServiceEntry(_0x45dce9){const _0xc0c6e0=getServiceEntry(_0x45dce9);if(_0xc0c6e0)return _0xc0c6e0;try{return getDynamicServiceEntry(_0x45dce9);}catch{return undefined;}}function getAnyServiceDefinitions(_0x3eb4eb){const _0x53cc26=a83_0x1d01,_0x471cfe=serviceGroups[_0x53cc26(0x1d0)](_0x3eb4eb);if(_0x471cfe)return _0x471cfe;try{return getDynamicServiceDefinitions(_0x3eb4eb);}catch{return undefined;}}function safeListDynamicServiceEntries(){const _0x4221fb=a83_0x1d01,_0x939dc0=new Set(serviceRegistry['map'](_0x50784e=>_0x50784e[_0x4221fb(0x1d6)]));try{return listDynamicServiceEntries()[_0x4221fb(0x1cd)](_0xac308d=>!_0x939dc0[_0x4221fb(0x1c7)](_0xac308d[_0x4221fb(0x1d6)]));}catch{return[];}}
@@ -0,0 +1,10 @@
1
+ export type { Risk, FlagDef, CommandDefinition, CommandResult, DryRunResult, RuntimeContext, OutputFormat, OutputEnvelope, } from "../framework/types.js";
2
+ export { runCommand } from "../framework/runner.js";
3
+ export { parseFlags, validateFlags } from "../framework/flags.js";
4
+ export { formatOutput } from "../framework/output.js";
5
+ export { generateCommandHelp, generateServiceHelp, generateFullHelp, } from "../framework/help.js";
6
+ export { extractList, extractPaging } from "../framework/response.js";
7
+ export type { Paging, ListResponse } from "../framework/response.js";
8
+ export { dryRun } from "../framework/dryrun.js";
9
+ export type { DryRunBuilder } from "../framework/dryrun.js";
10
+ export { riskLevelOrder, isValidFormat } from "../framework/types.js";
@@ -1 +1 @@
1
- function a83_0x1a6b(){var _0x33d864=['968132feMbJb','1Rkbprn','97008yEbuhp','1482465jUmEFt','610mUiCFi','3595209utyEAR','24bMpBor','894176RtitOV','12346614SiPPPa','8qrqIEb','3064467laFSuX'];a83_0x1a6b=function(){return _0x33d864;};return a83_0x1a6b();}(function(_0x7f5e5d,_0x7fd36b){var _0x1f91de=a83_0x33e2,_0x495836=_0x7f5e5d();while(!![]){try{var _0x50d244=parseInt(_0x1f91de(0x1f3))/0x1*(-parseInt(_0x1f91de(0x1ee))/0x2)+-parseInt(_0x1f91de(0x1f7))/0x3+-parseInt(_0x1f91de(0x1f4))/0x4+parseInt(_0x1f91de(0x1f5))/0x5*(-parseInt(_0x1f91de(0x1ed))/0x6)+parseInt(_0x1f91de(0x1f1))/0x7*(-parseInt(_0x1f91de(0x1f0))/0x8)+-parseInt(_0x1f91de(0x1ef))/0x9+-parseInt(_0x1f91de(0x1f6))/0xa*(-parseInt(_0x1f91de(0x1f2))/0xb);if(_0x50d244===_0x7fd36b)break;else _0x495836['push'](_0x495836['shift']());}catch(_0x3e32cb){_0x495836['push'](_0x495836['shift']());}}}(a83_0x1a6b,0xabb9e));export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';function a83_0x33e2(_0x52cdaf,_0x20c706){_0x52cdaf=_0x52cdaf-0x1ed;var _0x1a6bbe=a83_0x1a6b();var _0x33e211=_0x1a6bbe[_0x52cdaf];return _0x33e211;}export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';export{extractList,extractPaging}from'../framework/response.js';export{dryRun}from'../framework/dryrun.js';export{riskLevelOrder,isValidFormat}from'../framework/types.js';
1
+ function a84_0xeda2(){var _0x1762d4=['22176204EjSTJe','1WeNhCS','11JbPSwb','4060815PpBNnX','413970tgxnZD','1293800NlHQsZ','3234016PLsZgR','263815mqDHvt','97839obGtJT','100sliXyG','324ScqlQo','126ucpFTc'];a84_0xeda2=function(){return _0x1762d4;};return a84_0xeda2();}(function(_0x33143c,_0x403a72){var _0x5a75d0=a84_0xf73e,_0x529edd=_0x33143c();while(!![]){try{var _0x1673a2=parseInt(_0x5a75d0(0xee))/0x1*(-parseInt(_0x5a75d0(0xe7))/0x2)+parseInt(_0x5a75d0(0xe4))/0x3+parseInt(_0x5a75d0(0xea))/0x4*(parseInt(_0x5a75d0(0xe8))/0x5)+-parseInt(_0x5a75d0(0xec))/0x6*(-parseInt(_0x5a75d0(0xe9))/0x7)+-parseInt(_0x5a75d0(0xe6))/0x8+-parseInt(_0x5a75d0(0xeb))/0x9*(-parseInt(_0x5a75d0(0xe5))/0xa)+-parseInt(_0x5a75d0(0xe3))/0xb*(parseInt(_0x5a75d0(0xed))/0xc);if(_0x1673a2===_0x403a72)break;else _0x529edd['push'](_0x529edd['shift']());}catch(_0x240e64){_0x529edd['push'](_0x529edd['shift']());}}}(a84_0xeda2,0xca92b));export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';function a84_0xf73e(_0x2f2c7a,_0x552511){_0x2f2c7a=_0x2f2c7a-0xe3;var _0xeda29a=a84_0xeda2();var _0xf73e67=_0xeda29a[_0x2f2c7a];return _0xf73e67;}export{extractList,extractPaging}from'../framework/response.js';export{dryRun}from'../framework/dryrun.js';export{riskLevelOrder,isValidFormat}from'../framework/types.js';
@@ -0,0 +1,10 @@
1
+ import type { CommandResultWithNotice, OutputFormat, Risk } from "../framework/types.js";
2
+ interface OutputOptions {
3
+ command: string;
4
+ risk: Risk;
5
+ format: OutputFormat;
6
+ dryRun?: boolean;
7
+ jqFilter?: string;
8
+ }
9
+ export declare function formatOutput<T>(result: CommandResultWithNotice<T>, options: OutputOptions): void;
10
+ export {};
@@ -1 +1 @@
1
- (function(_0x46ac53,_0x2b6959){const _0x592143=a84_0x1e69,_0x3d8dfd=_0x46ac53();while(!![]){try{const _0x333b2a=-parseInt(_0x592143(0x11a))/0x1+-parseInt(_0x592143(0x114))/0x2+-parseInt(_0x592143(0x113))/0x3*(parseInt(_0x592143(0x118))/0x4)+-parseInt(_0x592143(0x111))/0x5*(-parseInt(_0x592143(0x110))/0x6)+-parseInt(_0x592143(0x112))/0x7+parseInt(_0x592143(0x117))/0x8+parseInt(_0x592143(0x116))/0x9;if(_0x333b2a===_0x2b6959)break;else _0x3d8dfd['push'](_0x3d8dfd['shift']());}catch(_0x562e3b){_0x3d8dfd['push'](_0x3d8dfd['shift']());}}}(a84_0x8921,0x857b7));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});function a84_0x1e69(_0x40a5b7,_0x491576){_0x40a5b7=_0x40a5b7-0x10e;const _0x89212f=a84_0x8921();let _0x1e694d=_0x89212f[_0x40a5b7];return _0x1e694d;}function a84_0x8921(){const _0x56f725=['9089847jtzXzJ','994208WfcUGb','356VUfSqQ','error','524419HhPrTK','update','format','pretty','2066202uRHmpe','15LCTptj','956739rohOIK','27609QeqViL','280908mHbHwR','_notice'];a84_0x8921=function(){return _0x56f725;};return a84_0x8921();}export function formatOutput(_0x53171d,_0xea6f35){const _0x572f9f=a84_0x1e69,_0x3dfdea=_0x53171d[_0x572f9f(0x115)],{_notice:_0xbe0dd0,..._0x2a2c68}=_0x53171d;void _0xbe0dd0,baseFormatOutput(_0x2a2c68,_0xea6f35),_0xea6f35[_0x572f9f(0x10e)]===_0x572f9f(0x10f)&&printPrettyNotice(_0x3dfdea);}function printPrettyNotice(_0x365bc2){const _0x11f63c=a84_0x1e69;if(!_0x365bc2?.[_0x11f63c(0x11b)])return;console[_0x11f63c(0x119)](_0x365bc2[_0x11f63c(0x11b)]['message']+'\x20('+_0x365bc2['update']['url']+')');}
1
+ (function(_0x1f3b3e,_0x4d69ed){const _0x5434a7=a85_0x4818,_0x12b6d9=_0x1f3b3e();while(!![]){try{const _0x22acc4=-parseInt(_0x5434a7(0x13e))/0x1+parseInt(_0x5434a7(0x13f))/0x2+parseInt(_0x5434a7(0x146))/0x3+-parseInt(_0x5434a7(0x143))/0x4*(parseInt(_0x5434a7(0x142))/0x5)+-parseInt(_0x5434a7(0x14d))/0x6*(parseInt(_0x5434a7(0x144))/0x7)+parseInt(_0x5434a7(0x14b))/0x8+parseInt(_0x5434a7(0x148))/0x9;if(_0x22acc4===_0x4d69ed)break;else _0x12b6d9['push'](_0x12b6d9['shift']());}catch(_0x1639f1){_0x12b6d9['push'](_0x12b6d9['shift']());}}}(a85_0x5326,0x36a32));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a85_0x4818(_0xe3857e,_0x20f30e){_0xe3857e=_0xe3857e-0x13e;const _0x5326db=a85_0x5326();let _0x481854=_0x5326db[_0xe3857e];return _0x481854;}import{CliErrors}from'../errors.js';function a85_0x5326(){const _0x2b79b3=['pretty','error','3503952nzBVbw','_notice','89196dfFYMh','9958JECmPm','187340etubOE','message','format','131060XAiQtG','52jrQIEM','63ErStCj','url','279510NnFBxt','update','751212MqFcWO'];a85_0x5326=function(){return _0x2b79b3;};return a85_0x5326();}const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});export function formatOutput(_0x7a9379,_0x3c4bd5){const _0x41eeb0=a85_0x4818,_0x2e6326=_0x7a9379[_0x41eeb0(0x14c)],{_notice:_0x4ef289,..._0x2342c9}=_0x7a9379;void _0x4ef289,baseFormatOutput(_0x2342c9,_0x3c4bd5),_0x3c4bd5[_0x41eeb0(0x141)]===_0x41eeb0(0x149)&&printPrettyNotice(_0x2e6326);}function printPrettyNotice(_0x2cf018){const _0x34d035=a85_0x4818;if(!_0x2cf018?.[_0x34d035(0x147)])return;console[_0x34d035(0x14a)](_0x2cf018[_0x34d035(0x147)][_0x34d035(0x140)]+'\x20('+_0x2cf018[_0x34d035(0x147)][_0x34d035(0x145)]+')');}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @fileoverview PreParse flag correction pipeline — fixes common AI-generated input mistakes.
3
+ *
4
+ * Why this exists: AI agents and LLM-based code generation often produce CLI invocations
5
+ * that don't exactly match the expected flag syntax. Common patterns include:
6
+ *
7
+ * - camelCase flag names (`--userId`) instead of kebab-case (`--user-id`)
8
+ * - snake_case (`--page_size`) instead of kebab-case (`--page-size`)
9
+ * - UPPER_CASE (`--CODE`) instead of lowercase (`--code`)
10
+ * - Sticky values (`--limit100`) where meow parses them as boolean flags
11
+ *
12
+ * Without correction, these inputs silently fail. With correction, the CLI
13
+ * "just works" for AI agents, improving the developer experience significantly.
14
+ *
15
+ * Why corrections go to stderr: corrected input is not what the user explicitly
16
+ * typed. Logging them to stderr (not stdout) ensures they don't corrupt JSON
17
+ * output pipes while still being visible in terminal sessions.
18
+ *
19
+ * Design: two independent handlers, applied in order:
20
+ * 1. `aliasHandler` — normalizes flag names to kebab-case
21
+ * 2. `stickyHandler` — splits glued flag-value tokens
22
+ *
23
+ * Adding a new handler requires only inserting it into the `allCorrections` array;
24
+ * the rest of the pipeline (building the corrected object, logging) is handler-agnostic.
25
+ */
26
+ import type { FlagDef } from "../framework/types.js";
27
+ /**
28
+ * A single flag name correction applied during PreParse.
29
+ *
30
+ * `handler` identifies which correction rule fired, helping AI agents
31
+ * understand the specific mistake they made and self-correct in future calls.
32
+ */
33
+ export interface FlagCorrection {
34
+ /** Original flag name as received from meow (before any corrections). */
35
+ original: string;
36
+ /** Corrected flag name in canonical kebab-case form. */
37
+ corrected: string;
38
+ /** Which handler produced this correction: `"alias"` or `"sticky"`. */
39
+ handler: string;
40
+ }
41
+ /**
42
+ * Result of running `correctFlags`.
43
+ * Returns a new flags object (input is never mutated) and a list of
44
+ * all corrections applied.
45
+ */
46
+ export interface CorrectionResult {
47
+ /** Corrected flags object — safe to pass to `parseFlags()`. */
48
+ flags: Record<string, any>;
49
+ /** All individual corrections applied, in order. */
50
+ corrections: FlagCorrection[];
51
+ }
52
+ /**
53
+ * Corrects raw meow flags before they reach `parseFlags()`.
54
+ *
55
+ * Why this returns a new object rather than mutating input: mutating the
56
+ * `flags` object passed from meow could interfere with meow's internal state.
57
+ * Returning a new object is safer and makes it clear which flags are
58
+ * user-supplied vs. auto-corrected.
59
+ *
60
+ * @param raw - Raw flags from meow (may contain alias or sticky errors).
61
+ * @param defs - All known flag definitions (used to determine which keys are legitimate).
62
+ * @returns Corrected flags and the list of corrections applied.
63
+ */
64
+ export declare function correctFlags(raw: Record<string, any>, defs: FlagDef[]): CorrectionResult;
@@ -1 +1 @@
1
- (function(_0x31374b,_0x1231bb){const _0x46427c=a85_0xfb8c,_0x293266=_0x31374b();while(!![]){try{const _0x3bf92b=-parseInt(_0x46427c(0x176))/0x1*(-parseInt(_0x46427c(0x153))/0x2)+parseInt(_0x46427c(0x166))/0x3+-parseInt(_0x46427c(0x15d))/0x4+-parseInt(_0x46427c(0x15c))/0x5+-parseInt(_0x46427c(0x173))/0x6*(-parseInt(_0x46427c(0x172))/0x7)+-parseInt(_0x46427c(0x175))/0x8+parseInt(_0x46427c(0x15b))/0x9;if(_0x3bf92b===_0x1231bb)break;else _0x293266['push'](_0x293266['shift']());}catch(_0x52046a){_0x293266['push'](_0x293266['shift']());}}}(a85_0x3792,0xbfde7));function toKebab(_0x49627b){const _0x397948=a85_0xfb8c;return _0x49627b[_0x397948(0x158)](/_/g,'-')['replace'](/-([A-Z]+)/g,(_0x5e45d8,_0x3b3194)=>'-'+_0x3b3194[_0x397948(0x157)]())[_0x397948(0x158)](/([a-z0-9])([A-Z])/g,(_0x5c14d5,_0x58eb8f,_0x30ab74)=>_0x58eb8f+'-'+_0x30ab74)[_0x397948(0x157)]();}function a85_0xfb8c(_0xbfbed4,_0x1fcd41){_0xbfbed4=_0xbfbed4-0x151;const _0x37924c=a85_0x3792();let _0xfb8cbc=_0x37924c[_0xbfbed4];return _0xfb8cbc;}function buildKnownFlags(_0x55370a){const _0x3f08fe=a85_0xfb8c,_0x1fd043=new Set();for(const _0x2b7abe of _0x55370a){_0x1fd043[_0x3f08fe(0x168)](_0x2b7abe[_0x3f08fe(0x156)]),_0x1fd043[_0x3f08fe(0x168)](toCamelCase(_0x2b7abe[_0x3f08fe(0x156)]));}for(const _0x253a42 of['dry-run',_0x3f08fe(0x16e),'yes','format']){_0x1fd043[_0x3f08fe(0x168)](_0x253a42);}for(const _0x11b738 of[_0x3f08fe(0x171),_0x3f08fe(0x15e),_0x3f08fe(0x177),_0x3f08fe(0x169),_0x3f08fe(0x155),_0x3f08fe(0x15a),'ci',_0x3f08fe(0x164),_0x3f08fe(0x16a)]){_0x1fd043['add'](_0x11b738);}return _0x1fd043;}function buildFlagTypeMap(_0x5e6483){const _0x4eff77=a85_0xfb8c,_0x4d2c87=new Map();for(const _0x43d2a8 of _0x5e6483){_0x4d2c87[_0x4eff77(0x162)](_0x43d2a8[_0x4eff77(0x156)],_0x43d2a8[_0x4eff77(0x151)]),_0x4d2c87[_0x4eff77(0x162)](toCamelCase(_0x43d2a8['name']),_0x43d2a8['type']);}return _0x4d2c87;}function toCamelCase(_0x25df23){const _0x2ce939=a85_0xfb8c;return _0x25df23[_0x2ce939(0x158)](/-([a-z])/g,(_0x5f9e67,_0x31cc71)=>_0x31cc71[_0x2ce939(0x174)]());}function aliasHandler(_0x5dc417,_0x23ea14){const _0x921fe=a85_0xfb8c,_0x33605f=[];for(const _0xf8762f of Object[_0x921fe(0x160)](_0x5dc417)){if(_0x23ea14[_0x921fe(0x167)](_0xf8762f))continue;const _0x5677a1=toKebab(_0xf8762f);_0x5677a1!==_0xf8762f&&_0x23ea14['has'](_0x5677a1)&&_0x33605f['push']({'original':_0xf8762f,'corrected':_0x5677a1,'handler':_0x921fe(0x163)});}return _0x33605f;}function stickyHandler(_0xa474b6,_0x4e08b8,_0x388d5d){const _0x1e7da3=a85_0xfb8c,_0x14d6a8=[];for(const [_0x1b5351,_0x246083]of Object[_0x1e7da3(0x152)](_0xa474b6)){if(_0x246083!==!![])continue;for(let _0x23f2cd=_0x1b5351[_0x1e7da3(0x16f)]-0x1;_0x23f2cd>0x0;_0x23f2cd--){const _0x238abc=_0x1b5351[_0x1e7da3(0x161)](0x0,_0x23f2cd),_0x8a170d=_0x1b5351[_0x1e7da3(0x161)](_0x23f2cd),_0x1b4a6b=toKebab(_0x238abc),_0x41ce60=toCamelCase(_0x238abc),_0x148c13=_0x4e08b8[_0x1e7da3(0x167)](_0x238abc)?_0x238abc:_0x4e08b8[_0x1e7da3(0x167)](_0x1b4a6b)?_0x1b4a6b:_0x4e08b8[_0x1e7da3(0x167)](_0x41ce60)?_0x41ce60:null;if(!_0x148c13)continue;const _0x2f401d=_0x388d5d[_0x1e7da3(0x16b)](_0x148c13)??_0x1e7da3(0x159);let _0x4a7244;if(_0x2f401d===_0x1e7da3(0x170)){const _0x51179f=Number(_0x8a170d);if(isNaN(_0x51179f)||_0x8a170d==='')continue;_0x4a7244=_0x51179f;}else{if(_0x2f401d===_0x1e7da3(0x165))continue;else{if(_0x8a170d==='')continue;_0x4a7244=_0x8a170d;}}_0x14d6a8[_0x1e7da3(0x15f)]({'original':_0x1b5351,'corrected':_0x148c13+'='+_0x4a7244,'handler':_0x1e7da3(0x16d)});break;}}return _0x14d6a8;}function a85_0x3792(){const _0x2ad614=['nonInteractive','name','toLowerCase','replace','string','non-interactive','7573770DJIapr','5210525axNNUf','5604556vjvhak','env','push','keys','slice','set','alias','global','boolean','4636695BhOQpw','has','add','app','version','get','original','sticky','dryRun','length','number','help','7Ipzyyk','707976YNSkeV','toUpperCase','5797456xkaplD','90BAzrsN','appcode','type','entries','32194pMGFbi','corrected'];a85_0x3792=function(){return _0x2ad614;};return a85_0x3792();}export function correctFlags(_0x30803b,_0x589809){const _0x42b8df=a85_0xfb8c,_0x35a48d=buildKnownFlags(_0x589809),_0x53f33a=buildFlagTypeMap(_0x589809),_0xa49def=aliasHandler(_0x30803b,_0x35a48d),_0x16ff75=stickyHandler(_0x30803b,_0x35a48d,_0x53f33a),_0x4c720e=[..._0xa49def,..._0x16ff75];if(_0x4c720e[_0x42b8df(0x16f)]===0x0)return{'flags':_0x30803b,'corrections':[]};const _0x31f3d2={..._0x30803b},_0x20633e=new Set();for(const _0x563e62 of _0xa49def){_0x31f3d2[_0x563e62[_0x42b8df(0x154)]]=_0x30803b[_0x563e62[_0x42b8df(0x16c)]],_0x20633e[_0x42b8df(0x168)](_0x563e62[_0x42b8df(0x16c)]);}for(const _0x54f2a5 of _0x16ff75){const _0x328658=_0x54f2a5[_0x42b8df(0x154)]['indexOf']('='),_0x5871a0=_0x54f2a5[_0x42b8df(0x154)][_0x42b8df(0x161)](0x0,_0x328658),_0x15a25c=_0x54f2a5[_0x42b8df(0x154)][_0x42b8df(0x161)](_0x328658+0x1),_0x231cd0=_0x53f33a[_0x42b8df(0x16b)](_0x5871a0)??_0x42b8df(0x159);_0x231cd0===_0x42b8df(0x170)?_0x31f3d2[_0x5871a0]=Number(_0x15a25c):_0x31f3d2[_0x5871a0]=_0x15a25c,_0x20633e['add'](_0x54f2a5[_0x42b8df(0x16c)]);}for(const _0x77d6de of _0x20633e){delete _0x31f3d2[_0x77d6de];}return{'flags':_0x31f3d2,'corrections':_0x4c720e};}
1
+ (function(_0x3beed4,_0x41bf6a){const _0x47efd7=a86_0x3fac,_0x3dd3a0=_0x3beed4();while(!![]){try{const _0x4d3608=-parseInt(_0x47efd7(0x194))/0x1*(-parseInt(_0x47efd7(0x1ac))/0x2)+parseInt(_0x47efd7(0x1a6))/0x3*(parseInt(_0x47efd7(0x19d))/0x4)+parseInt(_0x47efd7(0x19e))/0x5+parseInt(_0x47efd7(0x191))/0x6*(-parseInt(_0x47efd7(0x1a3))/0x7)+parseInt(_0x47efd7(0x1b2))/0x8+parseInt(_0x47efd7(0x1a5))/0x9+-parseInt(_0x47efd7(0x1ae))/0xa;if(_0x4d3608===_0x41bf6a)break;else _0x3dd3a0['push'](_0x3dd3a0['shift']());}catch(_0x219a12){_0x3dd3a0['push'](_0x3dd3a0['shift']());}}}(a86_0x3e48,0xd7e54));function toKebab(_0x3eea38){const _0x17e104=a86_0x3fac;return _0x3eea38[_0x17e104(0x1a2)](/_/g,'-')[_0x17e104(0x1a2)](/-([A-Z]+)/g,(_0x26341b,_0x432400)=>'-'+_0x432400[_0x17e104(0x196)]())[_0x17e104(0x1a2)](/([a-z0-9])([A-Z])/g,(_0x5a4f9b,_0x3eba09,_0x189012)=>_0x3eba09+'-'+_0x189012)[_0x17e104(0x196)]();}function buildKnownFlags(_0x4d2327){const _0xccfa05=a86_0x3fac,_0x20f8f1=new Set();for(const _0x54c6c3 of _0x4d2327){_0x20f8f1['add'](_0x54c6c3[_0xccfa05(0x190)]),_0x20f8f1[_0xccfa05(0x1b0)](toCamelCase(_0x54c6c3[_0xccfa05(0x190)]));}for(const _0x245f57 of['dry-run',_0xccfa05(0x1a9),'yes','format']){_0x20f8f1[_0xccfa05(0x1b0)](_0x245f57);}for(const _0x335d47 of[_0xccfa05(0x193),_0xccfa05(0x1ab),_0xccfa05(0x1a7),'app',_0xccfa05(0x195),_0xccfa05(0x192),'ci',_0xccfa05(0x19f),'version']){_0x20f8f1[_0xccfa05(0x1b0)](_0x335d47);}return _0x20f8f1;}function buildFlagTypeMap(_0x1eed19){const _0x45951d=a86_0x3fac,_0x5affbb=new Map();for(const _0x46f06b of _0x1eed19){_0x5affbb[_0x45951d(0x1b1)](_0x46f06b[_0x45951d(0x190)],_0x46f06b[_0x45951d(0x18f)]),_0x5affbb['set'](toCamelCase(_0x46f06b[_0x45951d(0x190)]),_0x46f06b[_0x45951d(0x18f)]);}return _0x5affbb;}function toCamelCase(_0x3875cd){const _0x1b69e9=a86_0x3fac;return _0x3875cd[_0x1b69e9(0x1a2)](/-([a-z])/g,(_0x36f4a1,_0x4d23d5)=>_0x4d23d5[_0x1b69e9(0x1ad)]());}function aliasHandler(_0x1e7435,_0x260560){const _0x461345=a86_0x3fac,_0x187d26=[];for(const _0x520c46 of Object[_0x461345(0x18e)](_0x1e7435)){if(_0x260560[_0x461345(0x19c)](_0x520c46))continue;const _0x67b713=toKebab(_0x520c46);_0x67b713!==_0x520c46&&_0x260560['has'](_0x67b713)&&_0x187d26['push']({'original':_0x520c46,'corrected':_0x67b713,'handler':_0x461345(0x199)});}return _0x187d26;}function a86_0x3fac(_0x5a4a7c,_0x3fcb5a){_0x5a4a7c=_0x5a4a7c-0x18d;const _0x3e48c7=a86_0x3e48();let _0x3facc7=_0x3e48c7[_0x5a4a7c];return _0x3facc7;}function a86_0x3e48(){const _0xce0f8d=['dryRun','length','env','217072SYLpnC','toUpperCase','10836110jIthww','boolean','add','set','10468936BagZqR','sticky','slice','keys','type','name','18YVWAhj','non-interactive','help','1uPfBkg','nonInteractive','toLowerCase','corrected','original','alias','string','get','has','420wkddbm','409255pFKuod','global','indexOf','entries','replace','1010527kgfWCP','number','5826357HyiSzL','7275QMRPDs','appcode','push'];a86_0x3e48=function(){return _0xce0f8d;};return a86_0x3e48();}function stickyHandler(_0x2e57e,_0x564e85,_0xc37389){const _0x5ce799=a86_0x3fac,_0x445c35=[];for(const [_0x31dee0,_0x5cf9c3]of Object[_0x5ce799(0x1a1)](_0x2e57e)){if(_0x5cf9c3!==!![])continue;for(let _0x4d926f=_0x31dee0[_0x5ce799(0x1aa)]-0x1;_0x4d926f>0x0;_0x4d926f--){const _0x1b00ca=_0x31dee0[_0x5ce799(0x18d)](0x0,_0x4d926f),_0x2caefd=_0x31dee0[_0x5ce799(0x18d)](_0x4d926f),_0x5074c6=toKebab(_0x1b00ca),_0x2f45ae=toCamelCase(_0x1b00ca),_0x39399d=_0x564e85[_0x5ce799(0x19c)](_0x1b00ca)?_0x1b00ca:_0x564e85[_0x5ce799(0x19c)](_0x5074c6)?_0x5074c6:_0x564e85['has'](_0x2f45ae)?_0x2f45ae:null;if(!_0x39399d)continue;const _0x1da140=_0xc37389['get'](_0x39399d)??_0x5ce799(0x19a);let _0x427419;if(_0x1da140===_0x5ce799(0x1a4)){const _0x5c71a2=Number(_0x2caefd);if(isNaN(_0x5c71a2)||_0x2caefd==='')continue;_0x427419=_0x5c71a2;}else{if(_0x1da140===_0x5ce799(0x1af))continue;else{if(_0x2caefd==='')continue;_0x427419=_0x2caefd;}}_0x445c35[_0x5ce799(0x1a8)]({'original':_0x31dee0,'corrected':_0x39399d+'='+_0x427419,'handler':_0x5ce799(0x1b3)});break;}}return _0x445c35;}export function correctFlags(_0x2f0cb4,_0x4f80d2){const _0x5c3f62=a86_0x3fac,_0x4c065b=buildKnownFlags(_0x4f80d2),_0x2ce74d=buildFlagTypeMap(_0x4f80d2),_0x3317c1=aliasHandler(_0x2f0cb4,_0x4c065b),_0x153c97=stickyHandler(_0x2f0cb4,_0x4c065b,_0x2ce74d),_0x127b1a=[..._0x3317c1,..._0x153c97];if(_0x127b1a[_0x5c3f62(0x1aa)]===0x0)return{'flags':_0x2f0cb4,'corrections':[]};const _0x1b3466={..._0x2f0cb4},_0x57c62f=new Set();for(const _0x2f1a16 of _0x3317c1){_0x1b3466[_0x2f1a16['corrected']]=_0x2f0cb4[_0x2f1a16[_0x5c3f62(0x198)]],_0x57c62f[_0x5c3f62(0x1b0)](_0x2f1a16[_0x5c3f62(0x198)]);}for(const _0x444022 of _0x153c97){const _0x1d28ba=_0x444022[_0x5c3f62(0x197)][_0x5c3f62(0x1a0)]('='),_0x3db0ba=_0x444022[_0x5c3f62(0x197)][_0x5c3f62(0x18d)](0x0,_0x1d28ba),_0xc6e754=_0x444022[_0x5c3f62(0x197)][_0x5c3f62(0x18d)](_0x1d28ba+0x1),_0x120f33=_0x2ce74d[_0x5c3f62(0x19b)](_0x3db0ba)??_0x5c3f62(0x19a);_0x120f33===_0x5c3f62(0x1a4)?_0x1b3466[_0x3db0ba]=Number(_0xc6e754):_0x1b3466[_0x3db0ba]=_0xc6e754,_0x57c62f['add'](_0x444022[_0x5c3f62(0x198)]);}for(const _0x1a8b6d of _0x57c62f){delete _0x1b3466[_0x1a8b6d];}return{'flags':_0x1b3466,'corrections':_0x127b1a};}
@@ -0,0 +1,10 @@
1
+ import { type CliError } from "../errors.js";
2
+ export interface RateLimitInput {
3
+ status?: unknown;
4
+ errorCode?: unknown;
5
+ message?: unknown;
6
+ retryAfter?: unknown;
7
+ }
8
+ export declare function createRateLimitError(input: RateLimitInput): CliError | undefined;
9
+ export declare function readRetryAfter(headers: unknown): string | undefined;
10
+ export declare function readRetryAfterSeconds(body: unknown): string | undefined;