@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
package/lib/cli.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview CLI entry point — parses input and dispatches to the framework runner.
4
+ *
5
+ * Why a top-level IIFE is avoided: `async function main()` is called via
6
+ * `void main().catch(handleError)`. This pattern is equivalent to a top-level
7
+ * `await` but avoids Node's "unhandled promise rejection in top-level await"
8
+ * behavior when the process is long-lived (interactive prompts).
9
+ *
10
+ * Why `isUserCancellation` checks `ExitPromptError` by name (not import):
11
+ * `@inquirer/prompts` throws `ExitPromptError` during Ctrl+C. Checking by
12
+ * `err.name` avoids a hard import-time dependency on the inquirer package
13
+ * version in this file. The error boundary handles it generically.
14
+ *
15
+ * PreParse phase: `correctFlags` is called before command dispatch to fix
16
+ * common AI-agent input mistakes (kebab-case flags, sticky values like
17
+ * `--limit100`). Corrections are printed to stderr so they don't pollute
18
+ * structured output. PreParse failures are silent (best-effort).
19
+ *
20
+ */
21
+ export {};
package/lib/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0x1fd810=a0_0x4901;(function(_0x4e9bae,_0x2dabe5){const _0xcf2166=a0_0x4901,_0x589c23=_0x4e9bae();while(!![]){try{const _0x5424b1=parseInt(_0xcf2166(0x15c))/0x1*(-parseInt(_0xcf2166(0x163))/0x2)+parseInt(_0xcf2166(0x152))/0x3*(-parseInt(_0xcf2166(0x156))/0x4)+parseInt(_0xcf2166(0x16e))/0x5*(-parseInt(_0xcf2166(0x16b))/0x6)+parseInt(_0xcf2166(0x14a))/0x7*(parseInt(_0xcf2166(0x149))/0x8)+parseInt(_0xcf2166(0x148))/0x9+parseInt(_0xcf2166(0x14d))/0xa*(parseInt(_0xcf2166(0x151))/0xb)+parseInt(_0xcf2166(0x147))/0xc*(parseInt(_0xcf2166(0x16f))/0xd);if(_0x5424b1===_0x2dabe5)break;else _0x589c23['push'](_0x589c23['shift']());}catch(_0x3016ef){_0x589c23['push'](_0x589c23['shift']());}}}(a0_0x9606,0x39249));import{jsx as a0_0x49d902}from'react/jsx-runtime';import a0_0x420ccc from'meow';import{render}from'ink';import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions}from'./commands/registry.js';import{generateDynamicServiceHelp,resolveDynamicServiceCommand}from'./commands/service/dynamic.js';import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{buildMeowFlags}from'./constant/cli.js';import{getCliVersionDisplay}from'./utils/version.js';function a0_0x9606(){const _0x409a61=['slice','1727FfUeiO','18WWosyR','message','exit','Unexpected\x20error:','288644RlyKIh','exitCode','write','./framework/preparse.js','hint','log','1DTaHHv','flags','\x0aCancelled.\x0a','input','code','Error:\x20','stderr','104446UstoZZ','unknownCommand','error','definition','defaultCommand','ERR_STREAM_DESTROYED','handler','assign','6ybofsE','args','[preparse]\x20','1879730aPamJG','467935sXrOwh','ExitPromptError','help','ERR_USE_AFTER_CLOSE','flatMap','60NOzGmP','3749391DrsaEK','8HiuoHl','1242871zdjKOG','original','length','20450Ldhzdo',':\x20--','catch'];a0_0x9606=function(){return _0x409a61;};return a0_0x9606();}const helpText=generateFullHelp(),cli=a0_0x420ccc(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x1fd810(0x14f)](handleError);async function main(){try{await run();}catch(_0x30a4b5){handleError(_0x30a4b5);}}function a0_0x4901(_0x12ff6b,_0x58077f){_0x12ff6b=_0x12ff6b-0x143;const _0x9606da=a0_0x9606();let _0x490112=_0x9606da[_0x12ff6b];return _0x490112;}async function run(){const _0x49200=a0_0x1fd810;let _0x3ad06e=cli[_0x49200(0x15f)][0x0],_0x3928f1=cli[_0x49200(0x15f)][0x1];const _0x12a694=cli[_0x49200(0x15d)];try{const {correctFlags:_0x533138}=await import(_0x49200(0x159)),_0x5d61e0=getAllDefinitions()[_0x49200(0x146)](_0x414d22=>_0x414d22[_0x49200(0x15d)]??[]),{flags:_0x4aeb43,corrections:_0x3a5313}=_0x533138(_0x12a694,_0x5d61e0);if(_0x3a5313[_0x49200(0x14c)]>0x0){for(const _0x302384 of _0x3a5313){process[_0x49200(0x162)][_0x49200(0x158)](_0x49200(0x16d)+_0x302384[_0x49200(0x169)]+_0x49200(0x14e)+_0x302384[_0x49200(0x14b)]+'\x20->\x20--'+_0x302384['corrected']+'\x0a');}Object['assign'](_0x12a694,_0x4aeb43);}}catch{}if(!_0x3ad06e){const {waitUntilExit:_0x1f4030}=render(a0_0x49d902(Help,{}));await _0x1f4030();return;}if(!isKnownService(_0x3ad06e)){const _0x3c117c=resolveDynamicServiceCommand(cli['input'],_0x12a694);if(_0x3c117c){if(_0x12a694['help']){console[_0x49200(0x15b)](generateCommandHelp(_0x3c117c[_0x49200(0x166)]));return;}Object[_0x49200(0x16a)](_0x12a694,_0x3c117c['flags']);const _0x1b00a0=buildConfigFromFlags(_0x12a694);await initGlobalEnvironment(_0x1b00a0);const _0x364536=createPipelineEnv(_0x1b00a0,_0x12a694);_0x364536[_0x49200(0x16c)]=_0x3c117c['args'],await runCommand(_0x3c117c['definition'],_0x364536);return;}if(_0x12a694[_0x49200(0x144)]){const _0x59dab2=generateDynamicServiceHelp(_0x3ad06e);if(_0x59dab2){console['log'](_0x59dab2);return;}}const {waitUntilExit:_0x13f5f5}=render(a0_0x49d902(Help,{}));await _0x13f5f5();return;}const _0x410795=getServiceEntry(_0x3ad06e);if(!_0x3928f1){if(_0x12a694[_0x49200(0x144)]){console[_0x49200(0x15b)](generateServiceHelp(_0x3ad06e));return;}if(_0x410795[_0x49200(0x167)])_0x3928f1=_0x410795['defaultCommand'];else{console[_0x49200(0x15b)](generateServiceHelp(_0x3ad06e));return;}}const _0xb098dc=findDefinition(_0x3ad06e,_0x3928f1);!_0xb098dc&&(console[_0x49200(0x15b)](generateServiceHelp(_0x3ad06e)),handleError(CliErrors[_0x49200(0x164)](_0x3ad06e+'\x20'+_0x3928f1)));if(_0x12a694['help']){console[_0x49200(0x15b)](generateCommandHelp(_0xb098dc));return;}const _0x543e24=buildConfigFromFlags(_0x12a694);await initGlobalEnvironment(_0x543e24);const _0x12dfa6=createPipelineEnv(_0x543e24,_0x12a694);_0x12dfa6[_0x49200(0x16c)]=cli[_0x49200(0x15f)][_0x49200(0x150)](0x2),await runCommand(_0xb098dc,_0x12dfa6);}function handleError(_0x133430){const _0x22ca9c=a0_0x1fd810;if(_0x133430 instanceof CliError){_0x133430['code']==='cancelled'&&(process['stderr']['write'](_0x22ca9c(0x15e)),process[_0x22ca9c(0x154)](0x0));console[_0x22ca9c(0x165)](_0x22ca9c(0x161)+_0x133430[_0x22ca9c(0x153)]);if(_0x133430[_0x22ca9c(0x15a)])console[_0x22ca9c(0x165)]('Hint:\x20'+_0x133430[_0x22ca9c(0x15a)]);process[_0x22ca9c(0x154)](_0x133430[_0x22ca9c(0x157)]);}isUserCancellation(_0x133430)&&(process[_0x22ca9c(0x162)][_0x22ca9c(0x158)](_0x22ca9c(0x15e)),process[_0x22ca9c(0x154)](0x0)),console['error'](_0x22ca9c(0x155),_0x133430),process[_0x22ca9c(0x154)](0x1);}function isUserCancellation(_0x39c4ca){const _0x37986b=a0_0x1fd810;if(!(_0x39c4ca instanceof Error))return![];if(_0x39c4ca['name']===_0x37986b(0x143))return!![];if(_0x39c4ca[_0x37986b(0x160)]===_0x37986b(0x145))return!![];if(_0x39c4ca[_0x37986b(0x160)]===_0x37986b(0x168))return!![];return![];}
2
+ const a0_0xab09be=a0_0x2994;(function(_0x241183,_0x183356){const _0x1c0f47=a0_0x2994,_0x11a668=_0x241183();while(!![]){try{const _0xb71adc=-parseInt(_0x1c0f47(0x19f))/0x1*(parseInt(_0x1c0f47(0x1c9))/0x2)+parseInt(_0x1c0f47(0x1c5))/0x3+parseInt(_0x1c0f47(0x1ad))/0x4*(-parseInt(_0x1c0f47(0x1a2))/0x5)+parseInt(_0x1c0f47(0x1c8))/0x6+parseInt(_0x1c0f47(0x1c3))/0x7*(parseInt(_0x1c0f47(0x1b1))/0x8)+parseInt(_0x1c0f47(0x1b4))/0x9*(-parseInt(_0x1c0f47(0x1a1))/0xa)+parseInt(_0x1c0f47(0x1b6))/0xb*(parseInt(_0x1c0f47(0x1a9))/0xc);if(_0xb71adc===_0x183356)break;else _0x11a668['push'](_0x11a668['shift']());}catch(_0x4a4b68){_0x11a668['push'](_0x11a668['shift']());}}}(a0_0x2e52,0xf0b90));import{jsx as a0_0x205829}from'react/jsx-runtime';import a0_0x5dc169 from'meow';import{render}from'ink';function a0_0x2994(_0x2ae71d,_0x295353){_0x2ae71d=_0x2ae71d-0x19e;const _0x2e52a9=a0_0x2e52();let _0x29945c=_0x2e52a9[_0x2ae71d];return _0x29945c;}import{Help}from'./help.js';function a0_0x2e52(){const _0x47338a=['catch',':\x20--','exit','name','70973dDuUoA','ERR_USE_AFTER_CLOSE','3248877BQMWLH','./framework/preparse.js','stderr','7556556MsCaCQ','18262tuVNKb','error','code','117lIDQyh','handler','1820210gcLrAx','10frtKYF','input','\x0aCancelled.\x0a','flatMap','cancelled','slice','definition','20511936qPemhl','help','exitCode','Error:\x20','3894344LeDQOu','Hint:\x20','length','ERR_STREAM_DESTROYED','104gMmbxZ','args','message','9Azowmv','ExitPromptError','11FCTvZX','defaultCommand','[preparse]\x20','log','original','assign','write','hint','flags'];a0_0x2e52=function(){return _0x47338a;};return a0_0x2e52();}import{CliError,CliErrors}from'./errors.js';import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions}from'./commands/registry.js';import{generateDynamicServiceHelp,resolveDynamicServiceCommand}from'./commands/service/dynamic.js';import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{buildMeowFlags}from'./constant/cli.js';import{getCliVersionDisplay}from'./utils/version.js';const helpText=generateFullHelp(),cli=a0_0x5dc169(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0xab09be(0x1bf)](handleError);async function main(){try{await run();}catch(_0x299d13){handleError(_0x299d13);}}async function run(){const _0x111f51=a0_0xab09be;let _0x228a8f=cli[_0x111f51(0x1a3)][0x0],_0x47cfb0=cli['input'][0x1];const _0x3d070a=cli[_0x111f51(0x1be)];try{const {correctFlags:_0x1812b5}=await import(_0x111f51(0x1c6)),_0x353e60=getAllDefinitions()[_0x111f51(0x1a5)](_0x240e0b=>_0x240e0b['flags']??[]),{flags:_0x9b0fd8,corrections:_0x188a11}=_0x1812b5(_0x3d070a,_0x353e60);if(_0x188a11[_0x111f51(0x1af)]>0x0){for(const _0x5851be of _0x188a11){process[_0x111f51(0x1c7)]['write'](_0x111f51(0x1b8)+_0x5851be[_0x111f51(0x1a0)]+_0x111f51(0x1c0)+_0x5851be[_0x111f51(0x1ba)]+'\x20->\x20--'+_0x5851be['corrected']+'\x0a');}Object[_0x111f51(0x1bb)](_0x3d070a,_0x9b0fd8);}}catch{}if(!_0x228a8f){const {waitUntilExit:_0x1aa05a}=render(a0_0x205829(Help,{}));await _0x1aa05a();return;}if(!isKnownService(_0x228a8f)){const _0x589a7c=resolveDynamicServiceCommand(cli[_0x111f51(0x1a3)],_0x3d070a);if(_0x589a7c){if(_0x3d070a[_0x111f51(0x1aa)]){console[_0x111f51(0x1b9)](generateCommandHelp(_0x589a7c[_0x111f51(0x1a8)]));return;}Object[_0x111f51(0x1bb)](_0x3d070a,_0x589a7c['flags']);const _0x306923=buildConfigFromFlags(_0x3d070a);await initGlobalEnvironment(_0x306923);const _0x5c71e4=createPipelineEnv(_0x306923,_0x3d070a);_0x5c71e4[_0x111f51(0x1b2)]=_0x589a7c[_0x111f51(0x1b2)],await runCommand(_0x589a7c[_0x111f51(0x1a8)],_0x5c71e4);return;}if(_0x3d070a[_0x111f51(0x1aa)]){const _0x35603c=generateDynamicServiceHelp(_0x228a8f);if(_0x35603c){console[_0x111f51(0x1b9)](_0x35603c);return;}}const {waitUntilExit:_0x4b7794}=render(a0_0x205829(Help,{}));await _0x4b7794();return;}const _0x4701ba=getServiceEntry(_0x228a8f);if(!_0x47cfb0){if(_0x3d070a['help']){console[_0x111f51(0x1b9)](generateServiceHelp(_0x228a8f));return;}if(_0x4701ba[_0x111f51(0x1b7)])_0x47cfb0=_0x4701ba[_0x111f51(0x1b7)];else{console[_0x111f51(0x1b9)](generateServiceHelp(_0x228a8f));return;}}const _0x314876=findDefinition(_0x228a8f,_0x47cfb0);!_0x314876&&(console['log'](generateServiceHelp(_0x228a8f)),handleError(CliErrors['unknownCommand'](_0x228a8f+'\x20'+_0x47cfb0)));if(_0x3d070a[_0x111f51(0x1aa)]){console['log'](generateCommandHelp(_0x314876));return;}const _0x11fe69=buildConfigFromFlags(_0x3d070a);await initGlobalEnvironment(_0x11fe69);const _0x525c85=createPipelineEnv(_0x11fe69,_0x3d070a);_0x525c85[_0x111f51(0x1b2)]=cli[_0x111f51(0x1a3)][_0x111f51(0x1a7)](0x2),await runCommand(_0x314876,_0x525c85);}function handleError(_0xf55a68){const _0x32a7dd=a0_0xab09be;if(_0xf55a68 instanceof CliError){_0xf55a68[_0x32a7dd(0x19e)]===_0x32a7dd(0x1a6)&&(process[_0x32a7dd(0x1c7)][_0x32a7dd(0x1bc)](_0x32a7dd(0x1a4)),process[_0x32a7dd(0x1c1)](0x0));console[_0x32a7dd(0x1ca)](_0x32a7dd(0x1ac)+_0xf55a68[_0x32a7dd(0x1b3)]);if(_0xf55a68['hint'])console[_0x32a7dd(0x1ca)](_0x32a7dd(0x1ae)+_0xf55a68[_0x32a7dd(0x1bd)]);process['exit'](_0xf55a68[_0x32a7dd(0x1ab)]);}isUserCancellation(_0xf55a68)&&(process['stderr'][_0x32a7dd(0x1bc)]('\x0aCancelled.\x0a'),process[_0x32a7dd(0x1c1)](0x0)),console[_0x32a7dd(0x1ca)]('Unexpected\x20error:',_0xf55a68),process[_0x32a7dd(0x1c1)](0x1);}function isUserCancellation(_0xd5dff){const _0x4cc0ad=a0_0xab09be;if(!(_0xd5dff instanceof Error))return![];if(_0xd5dff[_0x4cc0ad(0x1c2)]===_0x4cc0ad(0x1b5))return!![];if(_0xd5dff[_0x4cc0ad(0x19e)]===_0x4cc0ad(0x1c4))return!![];if(_0xd5dff[_0x4cc0ad(0x19e)]===_0x4cc0ad(0x1b0))return!![];return![];}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @fileoverview `api-doc` command group — stable runtime API discovery docs.
3
+ *
4
+ * Ownership note: this is a compact CLI mirror of RuntimeAgent's
5
+ * capability-owned `src/runtime-agent/api-doc` registry. Keep the command
6
+ * surface typed and read-only; do not add a generic fetch command here.
7
+ */
8
+ import type { CommandDefinition } from "../../framework/types.js";
9
+ export interface RuntimeApiDocEntry {
10
+ code: string;
11
+ category: string;
12
+ method: "GET" | "POST" | "PUT" | "DELETE";
13
+ path: string;
14
+ summary: string;
15
+ whenToUse: string;
16
+ }
17
+ export interface RuntimeApiDocDetail extends RuntimeApiDocEntry {
18
+ title: string;
19
+ pathParams: Array<{
20
+ name: string;
21
+ description: string;
22
+ }>;
23
+ queryParams: Array<{
24
+ name: string;
25
+ description: string;
26
+ }>;
27
+ bodySchema: string;
28
+ responseHighlights: string[];
29
+ examples: string[];
30
+ notes: string[];
31
+ markdown: string;
32
+ }
33
+ export declare function listApiDocEntries(filters?: {
34
+ category?: string;
35
+ keyword?: string;
36
+ }): RuntimeApiDocEntry[];
37
+ export declare function getApiDocDetail(code: string): RuntimeApiDocDetail;
38
+ export declare const apiDocDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- function a1_0x4335(_0x21ab76,_0x1af063){_0x21ab76=_0x21ab76-0xcb;const _0x3dd868=a1_0x3dd8();let _0x43359f=_0x3dd868[_0x21ab76];return _0x43359f;}const a1_0x55cee5=a1_0x4335;(function(_0x24f051,_0x521af9){const _0x5d9329=a1_0x4335,_0x55a9c2=_0x24f051();while(!![]){try{const _0x33c837=parseInt(_0x5d9329(0x133))/0x1+parseInt(_0x5d9329(0x13d))/0x2+-parseInt(_0x5d9329(0xdd))/0x3*(parseInt(_0x5d9329(0x125))/0x4)+-parseInt(_0x5d9329(0xcf))/0x5*(parseInt(_0x5d9329(0x102))/0x6)+-parseInt(_0x5d9329(0x100))/0x7+parseInt(_0x5d9329(0xf9))/0x8+parseInt(_0x5d9329(0x122))/0x9;if(_0x33c837===_0x521af9)break;else _0x55a9c2['push'](_0x55a9c2['shift']());}catch(_0x51510c){_0x55a9c2['push'](_0x55a9c2['shift']());}}}(a1_0x3dd8,0x6a252));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x55cee5(0x10a),'type':a1_0x55cee5(0xee),'description':a1_0x55cee5(0xd0)},KEYWORD_FLAG={'name':a1_0x55cee5(0x118),'type':a1_0x55cee5(0xee),'description':a1_0x55cee5(0xf8)},DOC_CODE_FLAG={'name':'code','type':a1_0x55cee5(0xee),'required':!![],'description':a1_0x55cee5(0x129)},DOCS=[{'code':a1_0x55cee5(0xe7),'category':a1_0x55cee5(0xff),'title':a1_0x55cee5(0xd7),'method':a1_0x55cee5(0xf1),'path':a1_0x55cee5(0x106),'summary':a1_0x55cee5(0xdf),'whenToUse':a1_0x55cee5(0xfd),'pathParams':[],'queryParams':[],'bodySchema':a1_0x55cee5(0xcd),'responseHighlights':['tableData\x20contains\x20dataset\x20id/code/name',a1_0x55cee5(0xe9)],'examples':[a1_0x55cee5(0x134)],'notes':[a1_0x55cee5(0x105)],'markdown':[a1_0x55cee5(0x108),'',a1_0x55cee5(0xda)][a1_0x55cee5(0x127)]('\x0a')},{'code':'dataset_detail','category':'dataset','title':a1_0x55cee5(0x114),'method':a1_0x55cee5(0x123),'path':a1_0x55cee5(0xd9),'summary':a1_0x55cee5(0x135),'whenToUse':a1_0x55cee5(0xde),'pathParams':[],'queryParams':[{'name':'code','description':a1_0x55cee5(0x12a)}],'bodySchema':a1_0x55cee5(0xd5),'responseHighlights':[a1_0x55cee5(0xd3),a1_0x55cee5(0x112),a1_0x55cee5(0xf4)],'examples':['lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>'],'notes':['If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.'],'markdown':[a1_0x55cee5(0x119),'',a1_0x55cee5(0x104)][a1_0x55cee5(0x127)]('\x0a')},{'code':a1_0x55cee5(0xef),'category':'dataset','title':'Filter\x20dataset\x20data','method':'POST','path':'/api/{appCode}/{datasetCode}/filter','summary':a1_0x55cee5(0xd1),'whenToUse':a1_0x55cee5(0x130),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x55cee5(0x113),'description':a1_0x55cee5(0x12a)}],'queryParams':[],'bodySchema':a1_0x55cee5(0x12f),'responseHighlights':['tableData\x20contains\x20records','paging\x20contains\x20pagination'],'examples':['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27'],'notes':[a1_0x55cee5(0x117)],'markdown':[a1_0x55cee5(0xd6),'',a1_0x55cee5(0xf5)][a1_0x55cee5(0x127)]('\x0a')},{'code':a1_0x55cee5(0xec),'category':'dataset','title':a1_0x55cee5(0x136),'method':'POST','path':a1_0x55cee5(0xe0),'summary':a1_0x55cee5(0xf3),'whenToUse':a1_0x55cee5(0x10b),'pathParams':[{'name':a1_0x55cee5(0x120),'description':a1_0x55cee5(0xcb)},{'name':a1_0x55cee5(0x113),'description':a1_0x55cee5(0x12a)}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':[a1_0x55cee5(0x11e),a1_0x55cee5(0x101)],'examples':[a1_0x55cee5(0xeb)],'notes':[a1_0x55cee5(0x10d),a1_0x55cee5(0xe2)],'markdown':[a1_0x55cee5(0xf6),'',a1_0x55cee5(0xfb)][a1_0x55cee5(0x127)]('\x0a')},{'code':a1_0x55cee5(0x13b),'category':a1_0x55cee5(0xff),'title':'Get\x20one\x20dataset\x20record','method':a1_0x55cee5(0xf1),'path':a1_0x55cee5(0xd8),'summary':a1_0x55cee5(0xdc),'whenToUse':a1_0x55cee5(0x131),'pathParams':[{'name':'appCode','description':a1_0x55cee5(0xcb)},{'name':a1_0x55cee5(0x113),'description':a1_0x55cee5(0x12a)}],'queryParams':[],'bodySchema':'{\x22id\x22:123}','responseHighlights':['Returns\x20one\x20matching\x20business\x20record'],'examples':[a1_0x55cee5(0x103)],'notes':[a1_0x55cee5(0xd4)],'markdown':'##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.'},{'code':a1_0x55cee5(0x107),'category':a1_0x55cee5(0xff),'title':'Create\x20dataset\x20record','method':a1_0x55cee5(0xf1),'path':a1_0x55cee5(0x12e),'summary':'创建数据','whenToUse':a1_0x55cee5(0xfe),'pathParams':[{'name':a1_0x55cee5(0x120),'description':a1_0x55cee5(0xcb)},{'name':'datasetCode','description':a1_0x55cee5(0x12a)}],'queryParams':[],'bodySchema':a1_0x55cee5(0x10e),'responseHighlights':['Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result'],'examples':[a1_0x55cee5(0x128)],'notes':[a1_0x55cee5(0x132)],'markdown':a1_0x55cee5(0xcc)},{'code':'bf_detail','category':'bf','title':'Get\x20BF\x20endpoint\x20function\x20contract','method':a1_0x55cee5(0x123),'path':a1_0x55cee5(0xe3),'summary':a1_0x55cee5(0xf2),'whenToUse':'已经从用户、平台\x20UI\x20或前序上下文确认函数名,需要查看该\x20ENDPOINT\x20的运行态元信息时使用','pathParams':[{'name':'appCode','description':a1_0x55cee5(0xcb)},{'name':a1_0x55cee5(0x111),'description':'Exact\x20endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':a1_0x55cee5(0xd5),'responseHighlights':['CLI\x20returns\x20appCode/functionName/description/version/gmtModified'],'examples':[a1_0x55cee5(0xd2)],'notes':[a1_0x55cee5(0xfa)],'markdown':a1_0x55cee5(0xfc)},{'code':a1_0x55cee5(0x11d),'category':'bf','title':a1_0x55cee5(0x126),'method':'POST','path':a1_0x55cee5(0x11b),'summary':'执行指定\x20BF\x20函数','whenToUse':'已经确认目标\x20BF\x20的\x20functionName,且需要实际调用该\x20ENDPOINT\x20函数完成业务操作时使用','pathParams':[{'name':'appCode','description':a1_0x55cee5(0xcb)},{'name':a1_0x55cee5(0x111),'description':'Endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':a1_0x55cee5(0x137),'responseHighlights':[a1_0x55cee5(0xf7)],'examples':[a1_0x55cee5(0x12d)],'notes':[a1_0x55cee5(0x13a)],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':a1_0x55cee5(0xe4),'category':a1_0x55cee5(0x12b),'title':'Execute\x20custom\x20SQL','method':a1_0x55cee5(0xf1),'path':a1_0x55cee5(0x10c),'summary':a1_0x55cee5(0x11f),'whenToUse':a1_0x55cee5(0x121),'pathParams':[],'queryParams':[],'bodySchema':a1_0x55cee5(0xe8),'responseHighlights':[a1_0x55cee5(0xe1)],'examples':[a1_0x55cee5(0x11c)],'notes':[a1_0x55cee5(0xed)],'markdown':a1_0x55cee5(0x138)}];function entrySummary(_0x576251){const _0x172621=a1_0x55cee5;return{'code':_0x576251[_0x172621(0x11a)],'category':_0x576251['category'],'method':_0x576251[_0x172621(0xea)],'path':_0x576251['path'],'summary':_0x576251[_0x172621(0x12c)],'whenToUse':_0x576251[_0x172621(0x139)]};}export function listApiDocEntries(_0x553fd1={}){const _0xca3e72=a1_0x55cee5,_0x30cd7d=String(_0x553fd1['category']||'')[_0xca3e72(0xf0)](),_0x2cf030=String(_0x553fd1['keyword']||'')[_0xca3e72(0xf0)]()[_0xca3e72(0x13e)]();return DOCS[_0xca3e72(0xdb)](_0x508d1a=>{const _0x15dfb8=_0xca3e72;if(_0x30cd7d&&_0x508d1a[_0x15dfb8(0x10a)]!==_0x30cd7d)return![];if(!_0x2cf030)return!![];return[_0x508d1a[_0x15dfb8(0x11a)],_0x508d1a['category'],_0x508d1a[_0x15dfb8(0xea)],_0x508d1a[_0x15dfb8(0x13c)],_0x508d1a['summary'],_0x508d1a[_0x15dfb8(0x139)],_0x508d1a[_0x15dfb8(0x10f)]][_0x15dfb8(0x127)]('\x20')['toLowerCase']()['includes'](_0x2cf030);})['map'](entrySummary);}export function getApiDocDetail(_0x196dce){const _0x2d97c0=a1_0x55cee5,_0x584825=DOCS[_0x2d97c0(0x116)](_0x73cc94=>_0x73cc94['code']===_0x196dce);if(!_0x584825)throw CliErrors['validation']('API\x20doc\x20code\x20not\x20found:\x20'+_0x196dce);return{..._0x584825};}const apiDocList={'service':a1_0x55cee5(0xe5),'command':a1_0x55cee5(0xe6),'description':a1_0x55cee5(0x110),'risk':a1_0x55cee5(0x115),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x30609c){const _0x5f165c=a1_0x55cee5,_0x4e3a43=listApiDocEntries({'category':_0x30609c[_0x5f165c(0xce)]('category'),'keyword':_0x30609c[_0x5f165c(0xce)](_0x5f165c(0x118))});return{'ok':!![],'data':{'total':_0x4e3a43[_0x5f165c(0x124)],'items':_0x4e3a43}};}},apiDocDetail={'service':'api-doc','command':a1_0x55cee5(0x109),'description':'Show\x20runtime\x20API\x20documentation\x20by\x20code','risk':a1_0x55cee5(0x115),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x1da7f5){const _0x436d56=a1_0x55cee5;return{'ok':!![],'data':getApiDocDetail(_0x1da7f5[_0x436d56(0xce)](_0x436d56(0x11a)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];function a1_0x3dd8(){const _0x1a6510=['detail','category','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','/api/custom/executeSql','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','{\x22fieldName\x22:\x22value\x22}','title','List\x20available\x20runtime\x20API\x20documentation\x20entries','functionName','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','datasetCode','Dataset\x20detail','read','find','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','keyword','##\x20Dataset\x20detail','code','/api/endpoint/{appCode}/{functionName}','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','bf_execute','result\x20rows\x20contain\x20aggregate\x20aliases','执行自定义\x20SQL','appCode','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','9867960dbrQQO','GET','length','68jjVFZM','Execute\x20BF\x20endpoint\x20function','join','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','API\x20doc\x20code,\x20for\x20example\x20dataset_list','32-character\x20dataset\x20code','custom_sql','summary','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','/api/{appCode}/{datasetCode}/create','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','517323EPwDMa','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','获取数据集详情','Aggregate\x20dataset\x20data','{\x22param\x22:\x22value\x22}','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','whenToUse','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','dataset_data_get_one','path','1395816frFlov','toLowerCase','Current\x20app\x20code','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','str','1967345yAmvMZ','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','条件过滤查询数据','lovrabet\x20bff\x20detail\x20--name\x20<functionName>','fields/properties\x20describe\x20data\x20shape','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','None','##\x20Filter\x20dataset\x20data','List\x20datasets','/api/{appCode}/{datasetCode}/getOne','/api/dataset/getOneByCode?code={datasetCode}','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','filter','查询单条数据','54633pydcpt','需要按数据集\x20code\x20获取字段、表信息、关联关系(relations)或操作定义时使用','分页获取数据集列表','/api/{appCode}/{datasetCode}/aggregate','Returns\x20SQL\x20execution\x20payload','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','/client/bff/endpoint/{appCode}/{functionName}','custom_sql_execute','api-doc','list','dataset_list','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','paging.totalCount\x20gives\x20total\x20rows','method','lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27','dataset_data_aggregate','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','string','dataset_data_filter','trim','POST','按应用和函数名精确获取\x20BF\x20运行契约','聚合查询数据集数据','operations\x20describes\x20runtime\x20APIs','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','##\x20Aggregate\x20dataset\x20data','Returns\x20script\x20business\x20payload','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','26624bRGGvN','This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20BFF\x20functions\x20or\x20expose\x20platform-only\x20fields.','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','需要向指定数据集新增一条业务数据时使用','dataset','5485928plfGuk','where\x20filters\x20before\x20aggregation','12BXpEcd','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','/api/dataset/get-dataset-list-by-app-code','dataset_data_create','##\x20List\x20datasets'];a1_0x3dd8=function(){return _0x1a6510;};return a1_0x3dd8();}
1
+ const a1_0x2e89bf=a1_0x9316;(function(_0x2c285a,_0x4ca34c){const _0x3e9450=a1_0x9316,_0x5bea37=_0x2c285a();while(!![]){try{const _0x4e9632=parseInt(_0x3e9450(0x226))/0x1*(-parseInt(_0x3e9450(0x20c))/0x2)+-parseInt(_0x3e9450(0x237))/0x3*(parseInt(_0x3e9450(0x23a))/0x4)+-parseInt(_0x3e9450(0x1e5))/0x5*(-parseInt(_0x3e9450(0x207))/0x6)+parseInt(_0x3e9450(0x218))/0x7*(-parseInt(_0x3e9450(0x215))/0x8)+-parseInt(_0x3e9450(0x202))/0x9*(parseInt(_0x3e9450(0x23e))/0xa)+-parseInt(_0x3e9450(0x1df))/0xb+-parseInt(_0x3e9450(0x1e7))/0xc*(-parseInt(_0x3e9450(0x1f2))/0xd);if(_0x4e9632===_0x4ca34c)break;else _0x5bea37['push'](_0x5bea37['shift']());}catch(_0x2d0d8b){_0x5bea37['push'](_0x5bea37['shift']());}}}(a1_0x36de,0x4448c));function a1_0x36de(){const _0x2f4592=['Returns\x20SQL\x20execution\x20payload','API\x20doc\x20code\x20not\x20found:\x20','21951iGpNPY','string','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','228GYXikD','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','API\x20doc\x20code,\x20for\x20example\x20dataset_list','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','230heCQgU','dataset_data_create','tableData\x20contains\x20records','method','length','custom_sql_execute','##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.','/api/{appCode}/{datasetCode}/getOne','##\x20Dataset\x20detail','includes','Create\x20dataset\x20record','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','POST','Dataset\x20detail','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','Filter\x20dataset\x20data','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','validation','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','List\x20available\x20runtime\x20API\x20documentation\x20entries','需要向指定数据集新增一条业务数据时使用','path','Returns\x20script\x20business\x20payload','查询单条数据','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','result\x20rows\x20contain\x20aggregate\x20aliases','join','4517007KKCYxz','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','tableData\x20contains\x20dataset\x20id/code/name','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','{\x22fieldName\x22:\x22value\x22}','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','37190gBdQDk','summary','23772KtYfrp','获取数据集详情','创建数据','##\x20List\x20datasets','map','filter','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','read','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','appCode','11180dvPdLi','Aggregate\x20dataset\x20data','list','{\x22param\x22:\x22value\x22}','dataset_data_aggregate','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','32-character\x20dataset\x20code','keyword','str','/api/{appCode}/{datasetCode}/filter','/client/bff/endpoint/{appCode}/{functionName}','detail','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20BFF\x20functions\x20or\x20expose\x20platform-only\x20fields.','Returns\x20one\x20matching\x20business\x20record','Show\x20runtime\x20API\x20documentation\x20by\x20code','77094Dizacb','GET','title','已经从用户、平台\x20UI\x20或前序上下文确认函数名,需要查看该\x20ENDPOINT\x20的运行态元信息时使用','##\x20Aggregate\x20dataset\x20data','372SgtTYa','dataset_data_filter','category','需要按数据集\x20code\x20获取字段、表信息、关联关系(relations)或操作定义时使用','/api/endpoint/{appCode}/{functionName}','2cQZsWs','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','dataset_detail','datasetCode','operations\x20describes\x20runtime\x20APIs','code','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','trim','dataset','857312CoWSXJ','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','35ygSUXx','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','functionName','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','Execute\x20custom\x20SQL','whenToUse','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','已经确认目标\x20BF\x20的\x20functionName,且需要实际调用该\x20ENDPOINT\x20函数完成业务操作时使用','List\x20datasets','None','条件过滤查询数据','执行自定义\x20SQL','toLowerCase','324580zqGYtA','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','Get\x20BF\x20endpoint\x20function\x20contract','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','/api/dataset/get-dataset-list-by-app-code','Current\x20app\x20code','dataset_list','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','api-doc','bf_detail','Exact\x20endpoint\x20function\x20name','聚合查询数据集数据','分页获取数据集列表'];a1_0x36de=function(){return _0x2f4592;};return a1_0x36de();}import{CliErrors}from'../../errors.js';function a1_0x9316(_0x305494,_0x21345f){_0x305494=_0x305494-0x1cb;const _0x36de5c=a1_0x36de();let _0x9316f0=_0x36de5c[_0x305494];return _0x9316f0;}const CATEGORY_FLAG={'name':a1_0x2e89bf(0x209),'type':'string','description':'Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset'},KEYWORD_FLAG={'name':a1_0x2e89bf(0x1f9),'type':a1_0x2e89bf(0x238),'description':a1_0x2e89bf(0x239)},DOC_CODE_FLAG={'name':a1_0x2e89bf(0x211),'type':a1_0x2e89bf(0x238),'required':!![],'description':a1_0x2e89bf(0x23c)},DOCS=[{'code':a1_0x2e89bf(0x22e),'category':a1_0x2e89bf(0x214),'title':a1_0x2e89bf(0x221),'method':a1_0x2e89bf(0x1d0),'path':a1_0x2e89bf(0x22c),'summary':a1_0x2e89bf(0x234),'whenToUse':a1_0x2e89bf(0x1e0),'pathParams':[],'queryParams':[],'bodySchema':a1_0x2e89bf(0x212),'responseHighlights':[a1_0x2e89bf(0x1e1),'paging.totalCount\x20gives\x20total\x20rows'],'examples':['lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress'],'notes':[a1_0x2e89bf(0x1f7)],'markdown':[a1_0x2e89bf(0x1ea),'',a1_0x2e89bf(0x227)]['join']('\x0a')},{'code':a1_0x2e89bf(0x20e),'category':a1_0x2e89bf(0x214),'title':a1_0x2e89bf(0x1d1),'method':a1_0x2e89bf(0x203),'path':'/api/dataset/getOneByCode?code={datasetCode}','summary':a1_0x2e89bf(0x1e8),'whenToUse':a1_0x2e89bf(0x20a),'pathParams':[],'queryParams':[{'name':a1_0x2e89bf(0x211),'description':a1_0x2e89bf(0x1f8)}],'bodySchema':a1_0x2e89bf(0x222),'responseHighlights':['fields/properties\x20describe\x20data\x20shape',a1_0x2e89bf(0x219),a1_0x2e89bf(0x210)],'examples':[a1_0x2e89bf(0x1f0)],'notes':[a1_0x2e89bf(0x21f)],'markdown':[a1_0x2e89bf(0x1cc),'','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.'][a1_0x2e89bf(0x1de)]('\x0a')},{'code':a1_0x2e89bf(0x208),'category':a1_0x2e89bf(0x214),'title':a1_0x2e89bf(0x1d3),'method':a1_0x2e89bf(0x1d0),'path':a1_0x2e89bf(0x1fb),'summary':a1_0x2e89bf(0x223),'whenToUse':a1_0x2e89bf(0x22f),'pathParams':[{'name':'appCode','description':a1_0x2e89bf(0x22d)},{'name':'datasetCode','description':a1_0x2e89bf(0x1f8)}],'queryParams':[],'bodySchema':'{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','responseHighlights':[a1_0x2e89bf(0x240),'paging\x20contains\x20pagination'],'examples':['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27'],'notes':[a1_0x2e89bf(0x23d)],'markdown':['##\x20Filter\x20dataset\x20data','',a1_0x2e89bf(0x1ee)][a1_0x2e89bf(0x1de)]('\x0a')},{'code':a1_0x2e89bf(0x1f6),'category':a1_0x2e89bf(0x214),'title':a1_0x2e89bf(0x1f3),'method':a1_0x2e89bf(0x1d0),'path':'/api/{appCode}/{datasetCode}/aggregate','summary':a1_0x2e89bf(0x233),'whenToUse':'需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','pathParams':[{'name':a1_0x2e89bf(0x1f1),'description':a1_0x2e89bf(0x22d)},{'name':a1_0x2e89bf(0x20f),'description':a1_0x2e89bf(0x1f8)}],'queryParams':[],'bodySchema':a1_0x2e89bf(0x1cf),'responseHighlights':[a1_0x2e89bf(0x1dd),'where\x20filters\x20before\x20aggregation'],'examples':[a1_0x2e89bf(0x22a)],'notes':[a1_0x2e89bf(0x23b),a1_0x2e89bf(0x1fe)],'markdown':[a1_0x2e89bf(0x206),'',a1_0x2e89bf(0x1dc)][a1_0x2e89bf(0x1de)]('\x0a')},{'code':'dataset_data_get_one','category':'dataset','title':'Get\x20one\x20dataset\x20record','method':'POST','path':a1_0x2e89bf(0x1cb),'summary':a1_0x2e89bf(0x1db),'whenToUse':a1_0x2e89bf(0x217),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x2e89bf(0x20f),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':'{\x22id\x22:123}','responseHighlights':[a1_0x2e89bf(0x200)],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':[a1_0x2e89bf(0x1d4)],'markdown':'##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.'},{'code':a1_0x2e89bf(0x23f),'category':a1_0x2e89bf(0x214),'title':a1_0x2e89bf(0x1ce),'method':'POST','path':'/api/{appCode}/{datasetCode}/create','summary':a1_0x2e89bf(0x1e9),'whenToUse':a1_0x2e89bf(0x1d8),'pathParams':[{'name':a1_0x2e89bf(0x1f1),'description':a1_0x2e89bf(0x22d)},{'name':'datasetCode','description':a1_0x2e89bf(0x1f8)}],'queryParams':[],'bodySchema':a1_0x2e89bf(0x1e3),'responseHighlights':['Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result'],'examples':[a1_0x2e89bf(0x1e2)],'notes':[a1_0x2e89bf(0x1d6)],'markdown':a1_0x2e89bf(0x21c)},{'code':a1_0x2e89bf(0x231),'category':'bf','title':a1_0x2e89bf(0x228),'method':'GET','path':a1_0x2e89bf(0x1fc),'summary':'按应用和函数名精确获取\x20BF\x20运行契约','whenToUse':a1_0x2e89bf(0x205),'pathParams':[{'name':a1_0x2e89bf(0x1f1),'description':a1_0x2e89bf(0x22d)},{'name':a1_0x2e89bf(0x21a),'description':a1_0x2e89bf(0x232)}],'queryParams':[],'bodySchema':a1_0x2e89bf(0x222),'responseHighlights':[a1_0x2e89bf(0x1ed)],'examples':['lovrabet\x20bff\x20detail\x20--name\x20<functionName>'],'notes':[a1_0x2e89bf(0x1ff)],'markdown':a1_0x2e89bf(0x244)},{'code':'bf_execute','category':'bf','title':'Execute\x20BF\x20endpoint\x20function','method':a1_0x2e89bf(0x1d0),'path':a1_0x2e89bf(0x20b),'summary':'执行指定\x20BF\x20函数','whenToUse':a1_0x2e89bf(0x220),'pathParams':[{'name':a1_0x2e89bf(0x1f1),'description':a1_0x2e89bf(0x22d)},{'name':a1_0x2e89bf(0x21a),'description':'Endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':a1_0x2e89bf(0x1f5),'responseHighlights':[a1_0x2e89bf(0x1da)],'examples':[a1_0x2e89bf(0x229)],'notes':[a1_0x2e89bf(0x1d2)],'markdown':a1_0x2e89bf(0x1e4)},{'code':a1_0x2e89bf(0x243),'category':'custom_sql','title':a1_0x2e89bf(0x21d),'method':a1_0x2e89bf(0x1d0),'path':'/api/custom/executeSql','summary':a1_0x2e89bf(0x224),'whenToUse':a1_0x2e89bf(0x216),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':[a1_0x2e89bf(0x235)],'examples':[a1_0x2e89bf(0x21b)],'notes':[a1_0x2e89bf(0x20d)],'markdown':a1_0x2e89bf(0x22b)}];function entrySummary(_0x4b03ab){const _0x2d38cf=a1_0x2e89bf;return{'code':_0x4b03ab[_0x2d38cf(0x211)],'category':_0x4b03ab['category'],'method':_0x4b03ab['method'],'path':_0x4b03ab[_0x2d38cf(0x1d9)],'summary':_0x4b03ab[_0x2d38cf(0x1e6)],'whenToUse':_0x4b03ab[_0x2d38cf(0x21e)]};}export function listApiDocEntries(_0x37eb9d={}){const _0x3e8759=a1_0x2e89bf,_0x552c73=String(_0x37eb9d['category']||'')[_0x3e8759(0x213)](),_0x24a136=String(_0x37eb9d[_0x3e8759(0x1f9)]||'')[_0x3e8759(0x213)]()[_0x3e8759(0x225)]();return DOCS[_0x3e8759(0x1ec)](_0x467b46=>{const _0x5e4f03=_0x3e8759;if(_0x552c73&&_0x467b46[_0x5e4f03(0x209)]!==_0x552c73)return![];if(!_0x24a136)return!![];return[_0x467b46[_0x5e4f03(0x211)],_0x467b46[_0x5e4f03(0x209)],_0x467b46[_0x5e4f03(0x241)],_0x467b46['path'],_0x467b46[_0x5e4f03(0x1e6)],_0x467b46[_0x5e4f03(0x21e)],_0x467b46[_0x5e4f03(0x204)]][_0x5e4f03(0x1de)]('\x20')['toLowerCase']()[_0x5e4f03(0x1cd)](_0x24a136);})[_0x3e8759(0x1eb)](entrySummary);}export function getApiDocDetail(_0x1ede4c){const _0x36a810=a1_0x2e89bf,_0x1ad2cc=DOCS['find'](_0x2f816f=>_0x2f816f[_0x36a810(0x211)]===_0x1ede4c);if(!_0x1ad2cc)throw CliErrors[_0x36a810(0x1d5)](_0x36a810(0x236)+_0x1ede4c);return{..._0x1ad2cc};}const apiDocList={'service':a1_0x2e89bf(0x230),'command':a1_0x2e89bf(0x1f4),'description':a1_0x2e89bf(0x1d7),'risk':a1_0x2e89bf(0x1ef),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x41040f){const _0x55644f=a1_0x2e89bf,_0xc5d790=listApiDocEntries({'category':_0x41040f[_0x55644f(0x1fa)](_0x55644f(0x209)),'keyword':_0x41040f[_0x55644f(0x1fa)](_0x55644f(0x1f9))});return{'ok':!![],'data':{'total':_0xc5d790[_0x55644f(0x242)],'items':_0xc5d790}};}},apiDocDetail={'service':a1_0x2e89bf(0x230),'command':a1_0x2e89bf(0x1fd),'description':a1_0x2e89bf(0x201),'risk':'read','requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x366c28){const _0x452538=a1_0x2e89bf;return{'ok':!![],'data':getApiDocDetail(_0x366c28[_0x452538(0x1fa)]('code'))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @fileoverview Application list cache management.
3
+ *
4
+ * Why a cache: `app list` fetches the remote app list from the API, which
5
+ * requires an extra HTTP call. For commands that need to resolve an app name
6
+ * to an appCode (e.g. `dataset list --app mystagingapp`), we cache the
7
+ * `/client/app/my-apps` response so subsequent calls don't hit the API again.
8
+ *
9
+ * Why keyed by accessKey fingerprint: different accessKeys may return different
10
+ * app lists (tenant isolation). Caching by AK ensures each AK's app list is
11
+ * stored separately and invalidated when the AK changes.
12
+ *
13
+ * Why 600 file permissions: config files contain access keys and should not
14
+ * be readable by other users on the system.
15
+ */
16
+ import type { RemoteAppItem } from "../../commands/app/remote-source.js";
17
+ /**
18
+ * Cached app list stored in `~/.lovrabet/cache/<env>/<ak_fingerprint>/my-apps.json`.
19
+ */
20
+ export interface CachedAppList {
21
+ env: "production" | "development" | "daily";
22
+ fetchedAt: string;
23
+ source: "remote" | "mock";
24
+ items: RemoteAppItem[];
25
+ }
26
+ /**
27
+ * Creates a cache key from an accessKey.
28
+ *
29
+ * Why hash the AK: the cache path is stored in a world-readable directory (~).
30
+ * Putting the raw AK in the path would expose it. Using a SHA-256 digest (first
31
+ * 12 chars) provides anonymity while still distinguishing between AKs.
32
+ * The last 6 chars of the raw AK are appended as a human-readable suffix so
33
+ * operators can identify which cache entry belongs to which AK during debugging.
34
+ */
35
+ export declare function fingerprintAccessKey(accessKey: string): string;
36
+ /** Returns the absolute cache file path for a given env and accessKey. */
37
+ export declare function getAppCacheFilePath(env: "production" | "development" | "daily", accessKey: string): string;
38
+ /**
39
+ * Reads the cached app list for an accessKey, or `null` if absent / invalid.
40
+ *
41
+ * Why check for empty files and parse errors: a previous write might have
42
+ * failed mid-flight, leaving a truncated file. We treat all read/parse errors
43
+ * as cache miss and fall through to an API fetch rather than crashing.
44
+ */
45
+ export declare function readCachedAppList(env: "production" | "development" | "daily", accessKey: string | undefined): CachedAppList | null;
46
+ /**
47
+ * Writes the app list to the cache file atomically (temp + rename).
48
+ * Returns the cache file path on success.
49
+ */
50
+ export declare function writeCachedAppList(env: "production" | "development" | "daily", accessKey: string, payload: CachedAppList): string;
51
+ /**
52
+ * Resolves an appName to an appCode using the cached remote app list.
53
+ *
54
+ * Why `name` is optional: callers may not have a name to resolve (already
55
+ * have an appCode or using a different resolution path). Returning `undefined`
56
+ * lets the caller fall through to other resolution strategies.
57
+ *
58
+ * Runtime safety: unpublished apps are intentionally ignored here so a
59
+ * `defaultApp` cannot silently route data commands into an unpublished app.
60
+ */
61
+ export declare function resolveCachedAppCode(name: string | undefined, env: "production" | "development" | "daily", accessKey: string | undefined): string | undefined;
@@ -1 +1 @@
1
- function a2_0x2acf(){const _0x38745a=['EACCES','940990TMUiWE','5394xOaSNb','homeDirName','unknown','appName','3077130cRgMMI','cache','appCode','20133234jOBrmy','325640lVEzKR','32DfnQql','100aITgqn','code','items','trim','slice','897rwLlte','isArray','.tmp','utf8','parse','4301118EAezDU','my-apps.json','hex','update','digest','ak_','10WPHyGR'];a2_0x2acf=function(){return _0x38745a;};return a2_0x2acf();}(function(_0x1f3285,_0x15ac91){const _0x5d685f=a2_0x5768,_0x27f25a=_0x1f3285();while(!![]){try{const _0x3da91c=-parseInt(_0x5d685f(0x156))/0x1+-parseInt(_0x5d685f(0x160))/0x2*(-parseInt(_0x5d685f(0x148))/0x3)+-parseInt(_0x5d685f(0x15e))/0x4+-parseInt(_0x5d685f(0x155))/0x5+parseInt(_0x5d685f(0x14d))/0x6+parseInt(_0x5d685f(0x15a))/0x7*(-parseInt(_0x5d685f(0x15f))/0x8)+-parseInt(_0x5d685f(0x15d))/0x9*(-parseInt(_0x5d685f(0x153))/0xa);if(_0x3da91c===_0x15ac91)break;else _0x27f25a['push'](_0x27f25a['shift']());}catch(_0x2de9da){_0x27f25a['push'](_0x27f25a['shift']());}}}(a2_0x2acf,0xe462b));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0x58bb8c){const _0x10adf4=a2_0x5768,_0x5caa6e=_0x58bb8c[_0x10adf4(0x146)](),_0x294c00=_0x5caa6e[_0x10adf4(0x147)](-0x6)||_0x10adf4(0x158),_0x3d82f=createHash('sha256')[_0x10adf4(0x150)](_0x5caa6e)[_0x10adf4(0x151)](_0x10adf4(0x14f))['slice'](0x0,0xc);return _0x10adf4(0x152)+_0x294c00+'_'+_0x3d82f;}export function getAppCacheFilePath(_0x20a562,_0x2e03b0){const _0x5e14e2=a2_0x5768;return resolve(homedir(),PRODUCT_CONFIG[_0x5e14e2(0x157)],_0x5e14e2(0x15b),_0x20a562,fingerprintAccessKey(_0x2e03b0),_0x5e14e2(0x14e));}export function readCachedAppList(_0x40a9ab,_0x2e4c1c){const _0x37019c=a2_0x5768;if(!_0x2e4c1c?.['trim']())return null;const _0xa38e25=getAppCacheFilePath(_0x40a9ab,_0x2e4c1c);if(!existsSync(_0xa38e25))return null;try{const _0x284ff5=readFileSync(_0xa38e25,_0x37019c(0x14b));if(!_0x284ff5['trim']())return null;const _0x327973=JSON[_0x37019c(0x14c)](_0x284ff5);if(!Array[_0x37019c(0x149)](_0x327973[_0x37019c(0x145)]))return null;return _0x327973;}catch{return null;}}function a2_0x5768(_0x2793de,_0x58eec2){_0x2793de=_0x2793de-0x144;const _0x2acfe9=a2_0x2acf();let _0x5768fb=_0x2acfe9[_0x2793de];return _0x5768fb;}export function writeCachedAppList(_0x2198a2,_0x5407b8,_0x3e0821){const _0x4fc679=a2_0x5768,_0x441196=getAppCacheFilePath(_0x2198a2,_0x5407b8),_0x30b6f7=dirname(_0x441196);!existsSync(_0x30b6f7)&&mkdirSync(_0x30b6f7,{'recursive':!![]});const _0x5ea936=_0x441196+_0x4fc679(0x14a);try{writeFileSync(_0x5ea936,JSON['stringify'](_0x3e0821,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180});try{renameSync(_0x5ea936,_0x441196);}catch(_0x2cc215){if(_0x2cc215[_0x4fc679(0x144)]==='EPERM'||_0x2cc215[_0x4fc679(0x144)]==='EXDEV'||_0x2cc215['code']===_0x4fc679(0x154)){writeFileSync(_0x441196,JSON['stringify'](_0x3e0821,null,0x2)+'\x0a',{'encoding':_0x4fc679(0x14b)});try{unlinkSync(_0x5ea936);}catch{}}else throw _0x2cc215;}}catch(_0x4b01ac){try{unlinkSync(_0x5ea936);}catch{}throw _0x4b01ac;}return _0x441196;}export function resolveCachedAppCode(_0x14ad77,_0x3ee2eb,_0xe0a10c){const _0x1e77c0=a2_0x5768;if(!_0x14ad77)return undefined;const _0x52704c=readCachedAppList(_0x3ee2eb,_0xe0a10c),_0x43430d=_0x52704c?.['items']['find'](_0x1d3573=>_0x1d3573[_0x1e77c0(0x159)]===_0x14ad77&&isRuntimeAccessibleApp(_0x1d3573));return _0x43430d?.[_0x1e77c0(0x15c)]?.['trim']()||undefined;}
1
+ (function(_0xb0197f,_0x105bca){const _0x1b3abd=a2_0x4725,_0x4310bf=_0xb0197f();while(!![]){try{const _0x5e34d0=parseInt(_0x1b3abd(0x131))/0x1+-parseInt(_0x1b3abd(0x133))/0x2+parseInt(_0x1b3abd(0x123))/0x3*(parseInt(_0x1b3abd(0x11e))/0x4)+parseInt(_0x1b3abd(0x12c))/0x5*(parseInt(_0x1b3abd(0x11d))/0x6)+-parseInt(_0x1b3abd(0x125))/0x7+parseInt(_0x1b3abd(0x139))/0x8*(-parseInt(_0x1b3abd(0x129))/0x9)+-parseInt(_0x1b3abd(0x128))/0xa*(-parseInt(_0x1b3abd(0x130))/0xb);if(_0x5e34d0===_0x105bca)break;else _0x4310bf['push'](_0x4310bf['shift']());}catch(_0x516ea8){_0x4310bf['push'](_0x4310bf['shift']());}}}(a2_0xaca3,0xd3300));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';function a2_0x4725(_0x44f15a,_0x3a7356){_0x44f15a=_0x44f15a-0x11d;const _0xaca3da=a2_0xaca3();let _0x472569=_0xaca3da[_0x44f15a];return _0x472569;}import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0x3acc81){const _0x56b12d=a2_0x4725,_0x154651=_0x3acc81[_0x56b12d(0x13a)](),_0x17896e=_0x154651[_0x56b12d(0x122)](-0x6)||_0x56b12d(0x12f),_0x47f71b=createHash(_0x56b12d(0x120))[_0x56b12d(0x136)](_0x154651)[_0x56b12d(0x124)]('hex')[_0x56b12d(0x122)](0x0,0xc);return _0x56b12d(0x137)+_0x17896e+'_'+_0x47f71b;}export function getAppCacheFilePath(_0x496bf5,_0x48b5d4){const _0x4b3acf=a2_0x4725;return resolve(homedir(),PRODUCT_CONFIG['homeDirName'],_0x4b3acf(0x12b),_0x496bf5,fingerprintAccessKey(_0x48b5d4),'my-apps.json');}export function readCachedAppList(_0x38c660,_0x39a978){const _0x231250=a2_0x4725;if(!_0x39a978?.[_0x231250(0x13a)]())return null;const _0x24c1b2=getAppCacheFilePath(_0x38c660,_0x39a978);if(!existsSync(_0x24c1b2))return null;try{const _0x1f7f87=readFileSync(_0x24c1b2,'utf8');if(!_0x1f7f87[_0x231250(0x13a)]())return null;const _0x48472b=JSON[_0x231250(0x134)](_0x1f7f87);if(!Array[_0x231250(0x126)](_0x48472b[_0x231250(0x11f)]))return null;return _0x48472b;}catch{return null;}}function a2_0xaca3(){const _0x22fdb8=['sha256','utf8','slice','3nCIQEW','digest','7403319gFBbVj','isArray','find','7061100qvdkcW','585YBjgHF','appCode','cache','1421650sizqtN','EPERM','EXDEV','unknown','11HuTshl','1277795rxoYYw','.tmp','1696892lkMZJW','parse','EACCES','update','ak_','stringify','33712DuhyLE','trim','code','6xNnIgp','3107048dngYhX','items'];a2_0xaca3=function(){return _0x22fdb8;};return a2_0xaca3();}export function writeCachedAppList(_0x2821eb,_0x5c76e0,_0xef4f6){const _0xbf0be3=a2_0x4725,_0x1cb656=getAppCacheFilePath(_0x2821eb,_0x5c76e0),_0x33cabb=dirname(_0x1cb656);!existsSync(_0x33cabb)&&mkdirSync(_0x33cabb,{'recursive':!![]});const _0xf0a615=_0x1cb656+_0xbf0be3(0x132);try{writeFileSync(_0xf0a615,JSON[_0xbf0be3(0x138)](_0xef4f6,null,0x2)+'\x0a',{'encoding':_0xbf0be3(0x121),'mode':0x180});try{renameSync(_0xf0a615,_0x1cb656);}catch(_0x23da6d){if(_0x23da6d[_0xbf0be3(0x13b)]===_0xbf0be3(0x12d)||_0x23da6d['code']===_0xbf0be3(0x12e)||_0x23da6d[_0xbf0be3(0x13b)]===_0xbf0be3(0x135)){writeFileSync(_0x1cb656,JSON[_0xbf0be3(0x138)](_0xef4f6,null,0x2)+'\x0a',{'encoding':_0xbf0be3(0x121)});try{unlinkSync(_0xf0a615);}catch{}}else throw _0x23da6d;}}catch(_0x555e72){try{unlinkSync(_0xf0a615);}catch{}throw _0x555e72;}return _0x1cb656;}export function resolveCachedAppCode(_0x496b6c,_0x6890,_0x885695){const _0x2dbbf0=a2_0x4725;if(!_0x496b6c)return undefined;const _0x121c4f=readCachedAppList(_0x6890,_0x885695),_0x3af67b=_0x121c4f?.[_0x2dbbf0(0x11f)][_0x2dbbf0(0x127)](_0x5b5188=>_0x5b5188['appName']===_0x496b6c&&isRuntimeAccessibleApp(_0x5b5188));return _0x3af67b?.[_0x2dbbf0(0x12a)]?.[_0x2dbbf0(0x13a)]()||undefined;}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @fileoverview `app` subcommand definitions — init, list, pull, use, import.
3
+ *
4
+ * Why a flat array of command objects: Lovrabet Runtime CLI uses the declarative
5
+ * `CommandDefinition[]` registry pattern (not a switch-based handler). Each command
6
+ * is a self-contained `CommandDefinition` that the framework runner dispatches.
7
+ *
8
+ * Commands:
9
+ * - init: initialize a `.lovrabet.json` config file for the current scope
10
+ * - list/pull: discover remote apps (cached) — read operations
11
+ * - use: set fallback app candidate — write operation
12
+ * - import: migrate from `.rabetbase.json` — write operation
13
+ *
14
+ * Why there is no `app add` / `app remove`: the runtime CLI does not manage
15
+ * platform app records locally. The remote app directory remains the source of
16
+ * truth for platform apps, while `.lovrabet.json` may define local aliases under
17
+ * `apps.<alias>.appcode` for operator-friendly names.
18
+ *
19
+ * Scope policy: `use` and `import` delegate to
20
+ * `resolveConfigScope({ policy: "project-default" })`, meaning:
21
+ * - `--global` → write to global
22
+ * - no flag + in project → write to project (takes precedence over global on merge)
23
+ * - no flag + outside project → write to global
24
+ */
25
+ import type { CommandDefinition } from "../../framework/types.js";
26
+ export declare const appDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- const a3_0x165c8c=a3_0x9a7e;(function(_0x303b41,_0x3119f2){const _0x206a70=a3_0x9a7e,_0x403b23=_0x303b41();while(!![]){try{const _0xe30769=parseInt(_0x206a70(0x159))/0x1*(parseInt(_0x206a70(0x125))/0x2)+-parseInt(_0x206a70(0x13b))/0x3+-parseInt(_0x206a70(0x12a))/0x4+parseInt(_0x206a70(0x10a))/0x5*(parseInt(_0x206a70(0x149))/0x6)+-parseInt(_0x206a70(0x137))/0x7+parseInt(_0x206a70(0x147))/0x8*(parseInt(_0x206a70(0x112))/0x9)+-parseInt(_0x206a70(0x142))/0xa*(parseInt(_0x206a70(0x13f))/0xb);if(_0xe30769===_0x3119f2)break;else _0x403b23['push'](_0x403b23['shift']());}catch(_0x4e8e72){_0x403b23['push'](_0x403b23['shift']());}}}(a3_0x2984,0xa95a4));import{CliErrors}from'../../errors.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';const GLOBAL_FLAG={'name':'global','type':a3_0x165c8c(0x11a),'description':a3_0x165c8c(0x11c),'default':![]};function collectFlags(_0x43fbea,_0x4d0701){const _0x31946d=a3_0x165c8c,_0x374101={};for(const _0x5c3ffd of _0x4d0701){const _0x4e5540=_0x5c3ffd[_0x31946d(0x124)]===_0x31946d(0x11a)?_0x43fbea[_0x31946d(0x10b)](_0x5c3ffd[_0x31946d(0x15e)]):_0x43fbea[_0x31946d(0x133)](_0x5c3ffd[_0x31946d(0x15e)]);if(_0x4e5540!==''&&_0x4e5540!==![])_0x374101[_0x5c3ffd[_0x31946d(0x15e)]]=_0x4e5540;}if(_0x43fbea['nonInteractive'])_0x374101[_0x31946d(0x129)]=!![];return _0x374101;}function a3_0x2984(){const _0x130b32=['length','fetchedAt','493710igayxQ','Refreshed\x20app\x20cache\x20with\x20','appOwnerName','local','2875383cezNAG','Read\x20app\x20list\x20from\x20local\x20cache\x20only','\x20app\x20use\x20<name>\x20[--global]','read','2233LOeZVp','pull','entries','80390jPwOWN','app','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','map','appCode','10372616fEnzCt','enableI18n','6ujinqY','projectPath','../../context.js','list','Target\x20environment\x20(default:\x20current\x20env)','Remote\x20app\x20name\x20to\x20activate','Include\x20unpublished\x20apps\x20for\x20diagnostics','\x20app(s)\x20for\x20env=\x22','isCurrent','init','global','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','use','i18nInfo','production','envName','15153WjZNeL','appPublishStatus','source','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','find','name','isArray','include-unpublished','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','trim','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','cachePath','6569945wAAfsw','bool','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','Usage:\x20','appName','args','globalPath','project-default','9FETiFQ','no-cache','validation','Available\x20remote\x20apps:\x20','accessKey','join','filter','write','boolean','langs','Use\x20global\x20config\x20scope','env','\x20app\x20','appcode','\x20cached\x20app(s)\x20for\x20env=\x22','../../commands/app/remote-source.js','Loaded\x20','string','type','100AeUgJE','Deprecated:\x20use\x20workspace\x20use\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','items','from','nonInteractive','54560vKOkuI','defaultApp','App\x20\x22','warn','\x20is\x20deprecated.\x20Use\x20`','No\x20cached\x20apps\x20found.','import','remote','No\x20apps\x20found\x20on\x20the\x20platform.','str','Missing\x20app\x20name.'];a3_0x2984=function(){return _0x130b32;};return a3_0x2984();}function normalizeLanguages(_0x1131d9){const _0x3ccabc=a3_0x165c8c;if(!Array[_0x3ccabc(0x15f)](_0x1131d9))return[];return _0x1131d9[_0x3ccabc(0x118)](_0x10fc06=>typeof _0x10fc06===_0x3ccabc(0x123))[_0x3ccabc(0x145)](_0x1ba764=>_0x1ba764[_0x3ccabc(0x162)]())[_0x3ccabc(0x118)](Boolean);}function buildRemoteAppI18nFields(_0x10b7e7){const _0x370971=a3_0x165c8c,_0x1e09b5=normalizeLanguages(_0x10b7e7[_0x370971(0x156)]?.[_0x370971(0x11b)]);return{'enableI18n':typeof _0x10b7e7[_0x370971(0x148)]===_0x370971(0x11a)?_0x10b7e7[_0x370971(0x148)]:null,'languages':_0x1e09b5,'i18nInfo':_0x10b7e7[_0x370971(0x156)]?{..._0x10b7e7[_0x370971(0x156)],'langs':_0x1e09b5[_0x370971(0x135)]?_0x1e09b5:null}:null};}const initDef={'service':a3_0x165c8c(0x143),'command':a3_0x165c8c(0x152),'description':a3_0x165c8c(0x10c),'risk':a3_0x165c8c(0x119),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x516356){const _0x3215f3=a3_0x165c8c;return warnDeprecatedAppCommand(_0x3215f3(0x152),CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>\x20[--env\x20daily]'),await runInit(collectFlags(_0x516356,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x165c8c(0x143),'command':a3_0x165c8c(0x14c),'description':a3_0x165c8c(0x154),'risk':a3_0x165c8c(0x13e),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x165c8c(0x11d),'type':'string','description':'Filter\x20by\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x165c8c(0x13a),'type':a3_0x165c8c(0x11a),'description':a3_0x165c8c(0x13c),'default':![]},{'name':'no-cache','type':'boolean','description':a3_0x165c8c(0x15c),'default':![]},{'name':a3_0x165c8c(0x160),'type':'boolean','description':a3_0x165c8c(0x14f),'default':![]}],async 'execute'(_0x3d147d){const _0x125ee4=a3_0x165c8c,_0x36d4b8=_0x3d147d[_0x125ee4(0x133)](_0x125ee4(0x11d))||_0x3d147d[_0x125ee4(0x158)]||getEnv()||'production',_0x97244e=_0x3d147d['bool'](_0x125ee4(0x13a)),_0x10bffe=_0x3d147d[_0x125ee4(0x10b)]('no-cache'),_0x4a82c8=_0x3d147d[_0x125ee4(0x10b)]('include-unpublished'),{readRawConfigWithLayers:_0x4c9bdd,resolveDefaultAppSource:_0x9e5b09,getLocalAppAliases:_0x276093}=await import(_0x125ee4(0x14b)),{getRemoteAppList:_0x5f44f7}=await import(_0x125ee4(0x121)),{config:_0x32c301,layers:_0x1b1a6b}=_0x4c9bdd(),_0x41bb15=_0x9e5b09(_0x1b1a6b),{defaultApp:_0x71b186}=_0x32c301,_0x344ef3=await _0x5f44f7({'env':_0x36d4b8,'accessKey':_0x3d147d['accessKey'],'localOnly':_0x97244e,'noCache':_0x10bffe}),_0x2ac7a8=_0x4a82c8?_0x344ef3[_0x125ee4(0x127)]:filterRuntimeAccessibleApps(_0x344ef3[_0x125ee4(0x127)]),_0x38ae95=_0x344ef3[_0x125ee4(0x127)][_0x125ee4(0x135)]-_0x2ac7a8[_0x125ee4(0x135)],_0x4e4deb=_0x2ac7a8[_0x125ee4(0x145)](_0x5f3621=>{const _0x3fb10d=_0x125ee4;return{'name':_0x5f3621[_0x3fb10d(0x10e)],'appcode':_0x5f3621[_0x3fb10d(0x146)],'named':!![],'definedIn':_0x3fb10d(0x131),'isDefault':_0x5f3621[_0x3fb10d(0x10e)]===_0x71b186,...buildAppProfileListFields(_0x36d4b8),...buildRemoteAppI18nFields(_0x5f3621),'source':_0x344ef3[_0x3fb10d(0x15b)],'owner':_0x5f3621[_0x3fb10d(0x139)]??null,'status':_0x5f3621[_0x3fb10d(0x15a)]??null,'cachedAt':_0x344ef3[_0x3fb10d(0x136)]};}),_0x2bbd9e=_0x276093(_0x32c301);let _0x4f8618=0x0;for(const [_0x15b0f6,_0x1cd8e6]of Object[_0x125ee4(0x141)](_0x2bbd9e)){const _0x74403b=typeof _0x1cd8e6[_0x125ee4(0x11f)]===_0x125ee4(0x123)?_0x1cd8e6[_0x125ee4(0x11f)][_0x125ee4(0x162)]():'';if(!_0x74403b)continue;const _0x22b361=findAppByCode(_0x344ef3[_0x125ee4(0x127)],_0x74403b);if(!_0x4a82c8&&_0x22b361&&!isRuntimeAccessibleApp(_0x22b361))continue;_0x4f8618+=0x1,_0x4e4deb['push']({'name':_0x15b0f6,'appcode':_0x74403b,'named':!![],'definedIn':'local','isDefault':_0x15b0f6===_0x71b186,...buildAppProfileListFields(_0x36d4b8),'source':'config','owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x4e4deb,_0x3d147d['mergedCli']);const _0x9ef4df=_0x4e4deb['find'](_0x26d221=>_0x26d221[_0x125ee4(0x151)]===!![]),_0x1bd44b=_0x71b186??_0x9ef4df?.['name']??null,_0x25952e={'env':_0x36d4b8,'source':_0x344ef3['source'],'fetchedAt':_0x344ef3[_0x125ee4(0x136)],'cachePath':_0x344ef3['cachePath'],'globalPath':_0x1b1a6b[_0x125ee4(0x110)]??null,'projectPath':_0x1b1a6b[_0x125ee4(0x14a)]??null,'defaultApp':_0x1bd44b,'defaultAppSource':_0x71b186!=null?_0x41bb15:null,'localAliasCount':_0x4f8618,'remoteTotal':_0x344ef3[_0x125ee4(0x127)][_0x125ee4(0x135)],'hiddenUnpublishedCount':_0x38ae95,'includeUnpublished':_0x4a82c8};if(_0x4e4deb[_0x125ee4(0x135)]===0x0)return{'ok':!![],'data':{'items':_0x4e4deb,'meta':_0x25952e},'message':_0x344ef3[_0x125ee4(0x15b)]==='cache'?_0x125ee4(0x12f):_0x125ee4(0x132)};return{'ok':!![],'data':{'items':_0x4e4deb,'meta':_0x25952e}};}},pullDef={'service':'app','command':a3_0x165c8c(0x140),'description':a3_0x165c8c(0x144),'risk':a3_0x165c8c(0x119),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x165c8c(0x11d),'type':a3_0x165c8c(0x123),'description':a3_0x165c8c(0x14d),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x165c8c(0x13a),'type':a3_0x165c8c(0x11a),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x165c8c(0x113),'type':'boolean','description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x3e7e6a){const _0x22dead=a3_0x165c8c,_0x3461e4=_0x3e7e6a[_0x22dead(0x133)]('env')||_0x3e7e6a[_0x22dead(0x158)]||getEnv()||_0x22dead(0x157),_0xc49dc3=_0x3e7e6a[_0x22dead(0x10b)]('local'),_0x36d540=_0x3e7e6a['bool']('no-cache'),{getRemoteAppList:_0x2850c7}=await import(_0x22dead(0x121)),_0x430161=await _0x2850c7({'env':_0x3461e4,'accessKey':_0x3e7e6a[_0x22dead(0x116)],'localOnly':_0xc49dc3,'noCache':_0x36d540});return{'ok':!![],'data':{'total':_0x430161[_0x22dead(0x127)]['length'],'env':_0x3461e4,'source':_0x430161[_0x22dead(0x15b)],'fetchedAt':_0x430161['fetchedAt'],'cachePath':_0x430161[_0x22dead(0x109)]},'message':_0x430161[_0x22dead(0x15b)]==='cache'?_0x22dead(0x122)+_0x430161[_0x22dead(0x127)][_0x22dead(0x135)]+_0x22dead(0x120)+_0x3461e4+'\x22.':_0x22dead(0x138)+_0x430161[_0x22dead(0x127)]['length']+_0x22dead(0x150)+_0x3461e4+'\x22.'};}},useDef={'service':a3_0x165c8c(0x143),'command':a3_0x165c8c(0x155),'description':a3_0x165c8c(0x126),'risk':a3_0x165c8c(0x119),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'name','description':a3_0x165c8c(0x14e),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x4c6aa0){const _0x1f542c=a3_0x165c8c;if(!_0x4c6aa0[_0x1f542c(0x10f)][0x0])throw CliErrors[_0x1f542c(0x114)](_0x1f542c(0x134),_0x1f542c(0x10d)+CLI_BIN_NAME+_0x1f542c(0x13d));},async 'execute'(_0x4a661b){const _0x40f21d=a3_0x165c8c;warnDeprecatedAppCommand(_0x40f21d(0x155),CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>\x20[--env\x20daily]');const _0x4b29d2=_0x4a661b[_0x40f21d(0x10f)][0x0];if(!_0x4b29d2)throw CliErrors['validation'](_0x40f21d(0x134),'Usage:\x20'+CLI_BIN_NAME+_0x40f21d(0x13d));const {buildConfigFromFlags:_0x2fceaa,resolveLocalAppAliasCode:_0x13acad}=await import(_0x40f21d(0x14b)),{readCachedAppList:_0x1bf025}=await import('../../commands/app/cache.js'),_0x71c984=_0x4a661b[_0x40f21d(0x133)]('env'),_0x5a8caf=_0x2fceaa(_0x71c984?{'env':_0x71c984}:{}),_0x17e845=_0x1bf025(_0x5a8caf[_0x40f21d(0x11d)],_0x5a8caf[_0x40f21d(0x116)]),_0x4cf61d=_0x17e845?.[_0x40f21d(0x127)][_0x40f21d(0x15d)](_0x125924=>_0x125924[_0x40f21d(0x10e)]===_0x4b29d2),_0x21c2f9=_0x13acad(_0x5a8caf['raw']??{},_0x4b29d2);if(_0x4cf61d&&!isRuntimeAccessibleApp(_0x4cf61d))throw runtimeInaccessibleAppError(_0x4cf61d,'\x22'+_0x4b29d2+'\x22');if(_0x21c2f9){const _0x16411d=_0x17e845?.['items']['find'](_0x3b4910=>_0x3b4910[_0x40f21d(0x146)]?.['trim']()===_0x21c2f9);if(_0x16411d&&!isRuntimeAccessibleApp(_0x16411d))throw runtimeInaccessibleAppError(_0x16411d,'\x22'+_0x4b29d2+'\x22');}if(!_0x4cf61d&&!_0x21c2f9&&_0x5a8caf[_0x40f21d(0x12b)]!==_0x4b29d2){const _0x10add4=[..._0x17e845?.['items']['map'](_0x528eb5=>_0x528eb5[_0x40f21d(0x10e)])??[]],_0x1695aa=_0x10add4[_0x40f21d(0x135)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x40f21d(0x161)+_0x4b29d2+'.appcode\x20to\x20.lovrabet.json.':_0x40f21d(0x115)+Array[_0x40f21d(0x128)](new Set(_0x10add4))[_0x40f21d(0x117)](',\x20')+_0x40f21d(0x108);throw CliErrors[_0x40f21d(0x114)](_0x40f21d(0x12c)+_0x4b29d2+'\x22\x20not\x20found.',_0x1695aa);}const _0x1c7eb8=_0x4a661b[_0x40f21d(0x10b)](_0x40f21d(0x153));let _0x1a4971;if(_0x1c7eb8)_0x1a4971={'global':!![]};else{const {isInProject:_0x15ce89}=await import(_0x40f21d(0x14b)),_0x39f80b=_0x15ce89();_0x1a4971=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x40f21d(0x111),'inProject':_0x39f80b}));}const _0x351eea=readConfig(_0x1a4971);return _0x351eea[_0x40f21d(0x12b)]=_0x4b29d2,writeConfig(_0x351eea,_0x1a4971),{'ok':!![],'message':'Default\x20app\x20candidate\x20set\x20to\x20\x22'+_0x4b29d2+'\x22'+scopeLabel(_0x1a4971)+'.'};}};function warnDeprecatedAppCommand(_0x133b07,_0x4aa93f){const _0x55dacc=a3_0x165c8c;console[_0x55dacc(0x12d)](CLI_BIN_NAME+_0x55dacc(0x11e)+_0x133b07+_0x55dacc(0x12e)+_0x4aa93f+'`\x20instead.');}function a3_0x9a7e(_0x2b8925,_0x104d43){_0x2b8925=_0x2b8925-0x108;const _0x298499=a3_0x2984();let _0x9a7eac=_0x298499[_0x2b8925];return _0x9a7eac;}const importDef={'service':a3_0x165c8c(0x143),'command':a3_0x165c8c(0x130),'description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a3_0x165c8c(0x119),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x35ddf2){return await runInitImport(collectFlags(_0x35ddf2,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
1
+ const a3_0x521e79=a3_0x2997;(function(_0x5bc5fb,_0x2f5896){const _0x225b51=a3_0x2997,_0x269cc1=_0x5bc5fb();while(!![]){try{const _0x5612d5=parseInt(_0x225b51(0x193))/0x1+parseInt(_0x225b51(0x1c8))/0x2+parseInt(_0x225b51(0x190))/0x3+parseInt(_0x225b51(0x1a9))/0x4*(-parseInt(_0x225b51(0x1bc))/0x5)+parseInt(_0x225b51(0x1c4))/0x6+-parseInt(_0x225b51(0x1c9))/0x7*(-parseInt(_0x225b51(0x1cc))/0x8)+-parseInt(_0x225b51(0x1c6))/0x9*(parseInt(_0x225b51(0x1be))/0xa);if(_0x5612d5===_0x2f5896)break;else _0x269cc1['push'](_0x269cc1['shift']());}catch(_0x5297a5){_0x269cc1['push'](_0x269cc1['shift']());}}}(a3_0x4731,0x26267));import{CliErrors}from'../../errors.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';function a3_0x4731(){const _0x271898=['Default\x20app\x20candidate\x20set\x20to\x20\x22','filter','join','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','appcode','Read\x20app\x20list\x20from\x20local\x20cache\x20only','nonInteractive','production','str','\x20app\x20','\x20workspace\x20use\x20--app\x20<name>\x20[--env\x20daily]','no-cache','Usage:\x20','appName','config','620772BfOeIv','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','source','288374alEBCd','Available\x20remote\x20apps:\x20','items','../../context.js','fetchedAt','../../commands/app/cache.js','envName','appPublishStatus','Deprecated:\x20use\x20workspace\x20use\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','global','No\x20apps\x20found\x20on\x20the\x20platform.','boolean','push','Missing\x20app\x20name.','../../commands/app/remote-source.js','import','entries','local','app','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','name','pull','7116sukMzR','include-unpublished','string','cache','trim','\x20app(s)\x20for\x20env=\x22','Use\x20`','map','\x20is\x20deprecated.\x20Use\x20`','isCurrent','env','enableI18n','list','langs','mergedCli','App\x20\x22','appCode','project-default','cachePath','765mExDSF','use','1870nkiOVk','No\x20cached\x20apps\x20found.','init','.appcode\x20to\x20.lovrabet.json.','read','Loaded\x20','1097256TniWIy','\x20app\x20use\x20<name>\x20[--global]','15849EnGayU','length','94092CCoJPD','7OMfPnN','accessKey','defaultApp','260296GoDtus','bool','write','projectPath','appOwnerName'];a3_0x4731=function(){return _0x271898;};return a3_0x4731();}import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';const GLOBAL_FLAG={'name':a3_0x521e79(0x19c),'type':a3_0x521e79(0x19e),'description':'Use\x20global\x20config\x20scope','default':![]};function collectFlags(_0x427f5f,_0x3c0382){const _0x16f87d=a3_0x521e79,_0x12e9d2={};for(const _0xc0fede of _0x3c0382){const _0x480b99=_0xc0fede['type']===_0x16f87d(0x19e)?_0x427f5f[_0x16f87d(0x1cd)](_0xc0fede[_0x16f87d(0x1a7)]):_0x427f5f[_0x16f87d(0x189)](_0xc0fede[_0x16f87d(0x1a7)]);if(_0x480b99!==''&&_0x480b99!==![])_0x12e9d2[_0xc0fede[_0x16f87d(0x1a7)]]=_0x480b99;}if(_0x427f5f[_0x16f87d(0x187)])_0x12e9d2[_0x16f87d(0x187)]=!![];return _0x12e9d2;}function a3_0x2997(_0x1e3564,_0x5e78d9){_0x1e3564=_0x1e3564-0x17e;const _0x4731ae=a3_0x4731();let _0x299761=_0x4731ae[_0x1e3564];return _0x299761;}function normalizeLanguages(_0x116ad9){const _0x4dae1c=a3_0x521e79;if(!Array['isArray'](_0x116ad9))return[];return _0x116ad9[_0x4dae1c(0x182)](_0x9b7b84=>typeof _0x9b7b84==='string')['map'](_0x3b986a=>_0x3b986a[_0x4dae1c(0x1ad)]())[_0x4dae1c(0x182)](Boolean);}function buildRemoteAppI18nFields(_0x2648e2){const _0x57c71a=a3_0x521e79,_0x563897=normalizeLanguages(_0x2648e2['i18nInfo']?.[_0x57c71a(0x1b6)]);return{'enableI18n':typeof _0x2648e2[_0x57c71a(0x1b4)]===_0x57c71a(0x19e)?_0x2648e2[_0x57c71a(0x1b4)]:null,'languages':_0x563897,'i18nInfo':_0x2648e2['i18nInfo']?{..._0x2648e2['i18nInfo'],'langs':_0x563897[_0x57c71a(0x1c7)]?_0x563897:null}:null};}const initDef={'service':a3_0x521e79(0x1a5),'command':'init','description':'Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','risk':a3_0x521e79(0x17e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x88857c){const _0xf3c2df=a3_0x521e79;return warnDeprecatedAppCommand(_0xf3c2df(0x1c0),CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>\x20[--env\x20daily]'),await runInit(collectFlags(_0x88857c,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x521e79(0x1a5),'command':a3_0x521e79(0x1b5),'description':a3_0x521e79(0x184),'risk':a3_0x521e79(0x1c2),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x521e79(0x1b3),'type':a3_0x521e79(0x1ab),'description':'Filter\x20by\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x521e79(0x1a4),'type':a3_0x521e79(0x19e),'description':a3_0x521e79(0x186),'default':![]},{'name':a3_0x521e79(0x18c),'type':a3_0x521e79(0x19e),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]},{'name':a3_0x521e79(0x1aa),'type':a3_0x521e79(0x19e),'description':'Include\x20unpublished\x20apps\x20for\x20diagnostics','default':![]}],async 'execute'(_0x3dd16c){const _0x980c21=a3_0x521e79,_0x52e716=_0x3dd16c[_0x980c21(0x189)](_0x980c21(0x1b3))||_0x3dd16c[_0x980c21(0x199)]||getEnv()||_0x980c21(0x188),_0x13112c=_0x3dd16c[_0x980c21(0x1cd)](_0x980c21(0x1a4)),_0x1e4e7b=_0x3dd16c[_0x980c21(0x1cd)](_0x980c21(0x18c)),_0xcc00e4=_0x3dd16c[_0x980c21(0x1cd)]('include-unpublished'),{readRawConfigWithLayers:_0x503bd1,resolveDefaultAppSource:_0x3a8e85,getLocalAppAliases:_0x5d2142}=await import(_0x980c21(0x196)),{getRemoteAppList:_0x4068e1}=await import(_0x980c21(0x1a1)),{config:_0x4546fc,layers:_0x210140}=_0x503bd1(),_0x4a81ba=_0x3a8e85(_0x210140),{defaultApp:_0x2d22f9}=_0x4546fc,_0x11a476=await _0x4068e1({'env':_0x52e716,'accessKey':_0x3dd16c[_0x980c21(0x1ca)],'localOnly':_0x13112c,'noCache':_0x1e4e7b}),_0x1bb663=_0xcc00e4?_0x11a476[_0x980c21(0x195)]:filterRuntimeAccessibleApps(_0x11a476[_0x980c21(0x195)]),_0x40dd3b=_0x11a476[_0x980c21(0x195)][_0x980c21(0x1c7)]-_0x1bb663['length'],_0x2bc9ad=_0x1bb663[_0x980c21(0x1b0)](_0x5abeb5=>{const _0x4be365=_0x980c21;return{'name':_0x5abeb5[_0x4be365(0x18e)],'appcode':_0x5abeb5[_0x4be365(0x1b9)],'named':!![],'definedIn':'remote','isDefault':_0x5abeb5[_0x4be365(0x18e)]===_0x2d22f9,...buildAppProfileListFields(_0x52e716),...buildRemoteAppI18nFields(_0x5abeb5),'source':_0x11a476['source'],'owner':_0x5abeb5[_0x4be365(0x180)]??null,'status':_0x5abeb5[_0x4be365(0x19a)]??null,'cachedAt':_0x11a476[_0x4be365(0x197)]};}),_0x1bfeb6=_0x5d2142(_0x4546fc);let _0x282cfc=0x0;for(const [_0x1ccdfa,_0x37a55f]of Object[_0x980c21(0x1a3)](_0x1bfeb6)){const _0x5579e6=typeof _0x37a55f[_0x980c21(0x185)]===_0x980c21(0x1ab)?_0x37a55f[_0x980c21(0x185)][_0x980c21(0x1ad)]():'';if(!_0x5579e6)continue;const _0x5311f1=findAppByCode(_0x11a476[_0x980c21(0x195)],_0x5579e6);if(!_0xcc00e4&&_0x5311f1&&!isRuntimeAccessibleApp(_0x5311f1))continue;_0x282cfc+=0x1,_0x2bc9ad[_0x980c21(0x19f)]({'name':_0x1ccdfa,'appcode':_0x5579e6,'named':!![],'definedIn':_0x980c21(0x1a4),'isDefault':_0x1ccdfa===_0x2d22f9,...buildAppProfileListFields(_0x52e716),'source':_0x980c21(0x18f),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x2bc9ad,_0x3dd16c[_0x980c21(0x1b7)]);const _0x110a8b=_0x2bc9ad['find'](_0x1b83e1=>_0x1b83e1[_0x980c21(0x1b2)]===!![]),_0x4a03f7=_0x2d22f9??_0x110a8b?.[_0x980c21(0x1a7)]??null,_0xfd3981={'env':_0x52e716,'source':_0x11a476[_0x980c21(0x192)],'fetchedAt':_0x11a476[_0x980c21(0x197)],'cachePath':_0x11a476[_0x980c21(0x1bb)],'globalPath':_0x210140['globalPath']??null,'projectPath':_0x210140[_0x980c21(0x17f)]??null,'defaultApp':_0x4a03f7,'defaultAppSource':_0x2d22f9!=null?_0x4a81ba:null,'localAliasCount':_0x282cfc,'remoteTotal':_0x11a476[_0x980c21(0x195)][_0x980c21(0x1c7)],'hiddenUnpublishedCount':_0x40dd3b,'includeUnpublished':_0xcc00e4};if(_0x2bc9ad[_0x980c21(0x1c7)]===0x0)return{'ok':!![],'data':{'items':_0x2bc9ad,'meta':_0xfd3981},'message':_0x11a476[_0x980c21(0x192)]===_0x980c21(0x1ac)?_0x980c21(0x1bf):_0x980c21(0x19d)};return{'ok':!![],'data':{'items':_0x2bc9ad,'meta':_0xfd3981}};}},pullDef={'service':'app','command':a3_0x521e79(0x1a8),'description':a3_0x521e79(0x1a6),'risk':a3_0x521e79(0x17e),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'env','type':a3_0x521e79(0x1ab),'description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a3_0x521e79(0x19e),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x521e79(0x18c),'type':a3_0x521e79(0x19e),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x15567d){const _0x31a218=a3_0x521e79,_0xca2739=_0x15567d['str'](_0x31a218(0x1b3))||_0x15567d[_0x31a218(0x199)]||getEnv()||_0x31a218(0x188),_0x4e3044=_0x15567d['bool'](_0x31a218(0x1a4)),_0x4d4cb8=_0x15567d['bool'](_0x31a218(0x18c)),{getRemoteAppList:_0x259137}=await import(_0x31a218(0x1a1)),_0xdf0b3=await _0x259137({'env':_0xca2739,'accessKey':_0x15567d[_0x31a218(0x1ca)],'localOnly':_0x4e3044,'noCache':_0x4d4cb8});return{'ok':!![],'data':{'total':_0xdf0b3[_0x31a218(0x195)][_0x31a218(0x1c7)],'env':_0xca2739,'source':_0xdf0b3[_0x31a218(0x192)],'fetchedAt':_0xdf0b3[_0x31a218(0x197)],'cachePath':_0xdf0b3[_0x31a218(0x1bb)]},'message':_0xdf0b3[_0x31a218(0x192)]===_0x31a218(0x1ac)?_0x31a218(0x1c3)+_0xdf0b3[_0x31a218(0x195)][_0x31a218(0x1c7)]+'\x20cached\x20app(s)\x20for\x20env=\x22'+_0xca2739+'\x22.':'Refreshed\x20app\x20cache\x20with\x20'+_0xdf0b3[_0x31a218(0x195)]['length']+_0x31a218(0x1ae)+_0xca2739+'\x22.'};}},useDef={'service':'app','command':a3_0x521e79(0x1bd),'description':a3_0x521e79(0x19b),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'name','description':'Remote\x20app\x20name\x20to\x20activate','required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x251f39){const _0x56db65=a3_0x521e79;if(!_0x251f39['args'][0x0])throw CliErrors['validation']('Missing\x20app\x20name.','Usage:\x20'+CLI_BIN_NAME+_0x56db65(0x1c5));},async 'execute'(_0x4c2e9f){const _0x12e1b0=a3_0x521e79;warnDeprecatedAppCommand(_0x12e1b0(0x1bd),CLI_BIN_NAME+_0x12e1b0(0x18b));const _0x9cd599=_0x4c2e9f['args'][0x0];if(!_0x9cd599)throw CliErrors['validation'](_0x12e1b0(0x1a0),_0x12e1b0(0x18d)+CLI_BIN_NAME+_0x12e1b0(0x1c5));const {buildConfigFromFlags:_0x1eb728,resolveLocalAppAliasCode:_0x34ebe1}=await import(_0x12e1b0(0x196)),{readCachedAppList:_0x27c328}=await import(_0x12e1b0(0x198)),_0x238213=_0x4c2e9f[_0x12e1b0(0x189)](_0x12e1b0(0x1b3)),_0x3b1cd3=_0x1eb728(_0x238213?{'env':_0x238213}:{}),_0x2b942e=_0x27c328(_0x3b1cd3['env'],_0x3b1cd3[_0x12e1b0(0x1ca)]),_0x124dab=_0x2b942e?.[_0x12e1b0(0x195)]['find'](_0x1698f7=>_0x1698f7[_0x12e1b0(0x18e)]===_0x9cd599),_0x546229=_0x34ebe1(_0x3b1cd3['raw']??{},_0x9cd599);if(_0x124dab&&!isRuntimeAccessibleApp(_0x124dab))throw runtimeInaccessibleAppError(_0x124dab,'\x22'+_0x9cd599+'\x22');if(_0x546229){const _0x270993=_0x2b942e?.[_0x12e1b0(0x195)]['find'](_0xef3bb9=>_0xef3bb9[_0x12e1b0(0x1b9)]?.[_0x12e1b0(0x1ad)]()===_0x546229);if(_0x270993&&!isRuntimeAccessibleApp(_0x270993))throw runtimeInaccessibleAppError(_0x270993,'\x22'+_0x9cd599+'\x22');}if(!_0x124dab&&!_0x546229&&_0x3b1cd3[_0x12e1b0(0x1cb)]!==_0x9cd599){const _0x1a72a=[..._0x2b942e?.[_0x12e1b0(0x195)]['map'](_0x349f9e=>_0x349f9e[_0x12e1b0(0x18e)])??[]],_0x222f3c=_0x1a72a[_0x12e1b0(0x1c7)]===0x0?_0x12e1b0(0x1af)+CLI_BIN_NAME+_0x12e1b0(0x191)+_0x9cd599+_0x12e1b0(0x1c1):_0x12e1b0(0x194)+Array['from'](new Set(_0x1a72a))[_0x12e1b0(0x183)](',\x20')+'.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.';throw CliErrors['validation'](_0x12e1b0(0x1b8)+_0x9cd599+'\x22\x20not\x20found.',_0x222f3c);}const _0x5f0975=_0x4c2e9f['bool'](_0x12e1b0(0x19c));let _0x412622;if(_0x5f0975)_0x412622={'global':!![]};else{const {isInProject:_0x3f1a47}=await import(_0x12e1b0(0x196)),_0x4e4843=_0x3f1a47();_0x412622=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x12e1b0(0x1ba),'inProject':_0x4e4843}));}const _0x259c96=readConfig(_0x412622);return _0x259c96['defaultApp']=_0x9cd599,writeConfig(_0x259c96,_0x412622),{'ok':!![],'message':_0x12e1b0(0x181)+_0x9cd599+'\x22'+scopeLabel(_0x412622)+'.'};}};function warnDeprecatedAppCommand(_0x1e4857,_0x426f6b){const _0x20a694=a3_0x521e79;console['warn'](CLI_BIN_NAME+_0x20a694(0x18a)+_0x1e4857+_0x20a694(0x1b1)+_0x426f6b+'`\x20instead.');}const importDef={'service':a3_0x521e79(0x1a5),'command':a3_0x521e79(0x1a2),'description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a3_0x521e79(0x17e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x3a7d9f){return await runInitImport(collectFlags(_0x3a7d9f,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @fileoverview Runtime app eligibility helpers.
3
+ *
4
+ * The platform app directory can return apps that are visible to the current AK
5
+ * but not published yet. Runtime CLI commands must only treat published apps as
6
+ * AI-accessible business data targets.
7
+ */
8
+ import type { RemoteAppItem } from "../../commands/app/remote-source.js";
9
+ type AppPublishStatusLike = Pick<RemoteAppItem, "appPublishStatus">;
10
+ export declare function normalizeAppPublishStatus(status: unknown): string | null;
11
+ export declare function isRuntimeAccessibleApp(item: AppPublishStatusLike): boolean;
12
+ export declare function filterRuntimeAccessibleApps<T extends AppPublishStatusLike>(items: T[]): T[];
13
+ export declare function findAppByName(items: RemoteAppItem[], name: string): RemoteAppItem | undefined;
14
+ export declare function findAppByCode(items: RemoteAppItem[], appCode: string): RemoteAppItem | undefined;
15
+ export declare function runtimeInaccessibleAppError(item: RemoteAppItem, selector: string): import("../../errors.js").CliError;
16
+ export {};
@@ -1 +1 @@
1
- (function(_0x2db2a6,_0x459736){const _0x4b1beb=a4_0x3f13,_0x3e7e20=_0x2db2a6();while(!![]){try{const _0x2619ee=-parseInt(_0x4b1beb(0x140))/0x1*(-parseInt(_0x4b1beb(0x13d))/0x2)+-parseInt(_0x4b1beb(0x145))/0x3*(parseInt(_0x4b1beb(0x144))/0x4)+parseInt(_0x4b1beb(0x138))/0x5+parseInt(_0x4b1beb(0x142))/0x6*(parseInt(_0x4b1beb(0x13f))/0x7)+parseInt(_0x4b1beb(0x13c))/0x8+-parseInt(_0x4b1beb(0x147))/0x9+parseInt(_0x4b1beb(0x13e))/0xa*(-parseInt(_0x4b1beb(0x135))/0xb);if(_0x2619ee===_0x459736)break;else _0x3e7e20['push'](_0x3e7e20['shift']());}catch(_0x34f836){_0x3e7e20['push'](_0x3e7e20['shift']());}}}(a4_0x1c1e,0x978b3));import{CLI_BIN_NAME}from'../../constant/cli.js';import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';import{CliErrors}from'../../errors.js';export function normalizeAppPublishStatus(_0x22b470){const _0x27ac18=a4_0x3f13;if(typeof _0x22b470!==_0x27ac18(0x143))return null;const _0x2280dd=_0x22b470[_0x27ac18(0x141)]();return _0x2280dd?_0x2280dd['toUpperCase']():null;}export function isRuntimeAccessibleApp(_0x1a33e9){const _0x22c58a=a4_0x3f13;return normalizeAppPublishStatus(_0x1a33e9[_0x22c58a(0x146)])===RUNTIME_ACCESSIBLE_APP_STATUS;}function a4_0x3f13(_0x57878a,_0x3f4d79){_0x57878a=_0x57878a-0x135;const _0x1c1ea5=a4_0x1c1e();let _0x3f13ee=_0x1c1ea5[_0x57878a];return _0x3f13ee;}function a4_0x1c1e(){const _0x50ff9b=['Current\x20status:\x20','3568250aWRYrJ','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','UNKNOWN','find','1563472uVDZME','9842qvVfEn','10PwtgQX','361627oAhSzC','156sUSeQN','trim','30uNzrXq','string','959452zbUCFJ','3HRbjdc','appPublishStatus','5710158aIezPQ','4840187mFDeDL','filter'];a4_0x1c1e=function(){return _0x50ff9b;};return a4_0x1c1e();}export function filterRuntimeAccessibleApps(_0x58fa97){const _0x5ebdde=a4_0x3f13;return _0x58fa97[_0x5ebdde(0x136)](isRuntimeAccessibleApp);}export function findAppByName(_0xe4025,_0x216346){const _0x45ef12=a4_0x3f13;return _0xe4025[_0x45ef12(0x13b)](_0x218048=>_0x218048['appName']===_0x216346);}export function findAppByCode(_0x3a5def,_0x31781d){const _0x3d8387=a4_0x3f13,_0x5c90de=_0x31781d['trim']();if(!_0x5c90de)return undefined;return _0x3a5def[_0x3d8387(0x13b)](_0x23537a=>_0x23537a['appCode']?.[_0x3d8387(0x141)]()===_0x5c90de);}export function runtimeInaccessibleAppError(_0x3f16a7,_0x1749dd){const _0x1b3a50=a4_0x3f13,_0x1c87e6=normalizeAppPublishStatus(_0x3f16a7['appPublishStatus'])??_0x1b3a50(0x13a);return CliErrors['validation']('App\x20'+_0x1749dd+_0x1b3a50(0x139),_0x1b3a50(0x137)+_0x1c87e6+'.\x20Publish\x20the\x20app\x20before\x20using\x20'+CLI_BIN_NAME+'\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.');}
1
+ (function(_0x36d799,_0x33764d){const _0x19f475=a4_0x2aaf,_0x3bc334=_0x36d799();while(!![]){try{const _0x2b97ef=-parseInt(_0x19f475(0x1d3))/0x1+-parseInt(_0x19f475(0x1da))/0x2+parseInt(_0x19f475(0x1d0))/0x3+parseInt(_0x19f475(0x1d8))/0x4+-parseInt(_0x19f475(0x1d4))/0x5*(-parseInt(_0x19f475(0x1de))/0x6)+-parseInt(_0x19f475(0x1d6))/0x7*(parseInt(_0x19f475(0x1cd))/0x8)+-parseInt(_0x19f475(0x1dc))/0x9;if(_0x2b97ef===_0x33764d)break;else _0x3bc334['push'](_0x3bc334['shift']());}catch(_0x39eac2){_0x3bc334['push'](_0x3bc334['shift']());}}}(a4_0x2cb6,0x79854));import{CLI_BIN_NAME}from'../../constant/cli.js';import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';import{CliErrors}from'../../errors.js';function a4_0x2cb6(){const _0x774992=['14021vFmtOj','Current\x20status:\x20','3793836vLBWfE','App\x20','454202iXeGWN','trim','3585051rRRMxs','find','180822lWCcxH','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','3176fEhBmQ','.\x20Publish\x20the\x20app\x20before\x20using\x20','string','1528845cKNFkP','appPublishStatus','appCode','353394bXrFNS','135mzkZzm','UNKNOWN'];a4_0x2cb6=function(){return _0x774992;};return a4_0x2cb6();}function a4_0x2aaf(_0x453805,_0x276ce5){_0x453805=_0x453805-0x1cd;const _0x2cb656=a4_0x2cb6();let _0x2aaf7e=_0x2cb656[_0x453805];return _0x2aaf7e;}export function normalizeAppPublishStatus(_0x3b11fa){const _0x38aa55=a4_0x2aaf;if(typeof _0x3b11fa!==_0x38aa55(0x1cf))return null;const _0x33cef5=_0x3b11fa[_0x38aa55(0x1db)]();return _0x33cef5?_0x33cef5['toUpperCase']():null;}export function isRuntimeAccessibleApp(_0x34ae98){const _0xad0ecf=a4_0x2aaf;return normalizeAppPublishStatus(_0x34ae98[_0xad0ecf(0x1d1)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x158406){return _0x158406['filter'](isRuntimeAccessibleApp);}export function findAppByName(_0x148bd6,_0x5a5663){const _0x13547f=a4_0x2aaf;return _0x148bd6[_0x13547f(0x1dd)](_0x32c2a8=>_0x32c2a8['appName']===_0x5a5663);}export function findAppByCode(_0x109119,_0x52b1e9){const _0x22da1b=a4_0x2aaf,_0xf8293d=_0x52b1e9['trim']();if(!_0xf8293d)return undefined;return _0x109119[_0x22da1b(0x1dd)](_0x5d8bda=>_0x5d8bda[_0x22da1b(0x1d2)]?.['trim']()===_0xf8293d);}export function runtimeInaccessibleAppError(_0x33adfd,_0x2c99d9){const _0x36008e=a4_0x2aaf,_0x1ac236=normalizeAppPublishStatus(_0x33adfd[_0x36008e(0x1d1)])??_0x36008e(0x1d5);return CliErrors['validation'](_0x36008e(0x1d9)+_0x2c99d9+_0x36008e(0x1df),_0x36008e(0x1d7)+_0x1ac236+_0x36008e(0x1ce)+CLI_BIN_NAME+'\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.');}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @fileoverview Mock data loader for app list — reads fixtures for offline development.
3
+ *
4
+ * Why a separate module: mock data is loaded in `remote-source.ts` when
5
+ * the product-scoped `APP_LIST_SOURCE=mock` env var is set. Isolating this to its own module
6
+ * makes it easy to verify which data sources are in play and to add new
7
+ * fixture files without touching the real API client.
8
+ *
9
+ * Design decision: module-level caching (`_cached`) — once a mock file is
10
+ * loaded, it stays in memory for the lifetime of the process. This avoids
11
+ * repeated filesystem reads during rapid command invocations.
12
+ */
13
+ import type { RemoteAppItem } from "../../core/api-client.js";
14
+ /**
15
+ * The full API response shape returned by the app-list endpoint.
16
+ * Mirrors `getMyApps()` response structure so callers see identical types.
17
+ */
18
+ export interface AppListResponse {
19
+ success: boolean;
20
+ msg: string;
21
+ errorMsg: string;
22
+ errorCode: string;
23
+ data: {
24
+ tableData: RemoteAppItem[];
25
+ tableColumns: unknown[];
26
+ };
27
+ params: unknown;
28
+ }
29
+ /**
30
+ * Returns the cached mock app list response (lazy-loaded once per process).
31
+ *
32
+ * @returns The full `AppListResponse` from the fixture file.
33
+ */
34
+ export declare function getMockAppList(): AppListResponse;
35
+ /**
36
+ * Returns just the app items from the mock fixture, matching `getMyApps()` return type.
37
+ *
38
+ * @returns `RemoteAppItem[]` from the mock fixture.
39
+ * @throws Error with `Mock API error:` prefix if the fixture indicates a failure.
40
+ */
41
+ export declare function getMockRemoteAppItems(): RemoteAppItem[];
@@ -1 +1 @@
1
- (function(_0x37c18f,_0x324b58){const _0x5b2577=a5_0x44aa,_0x34bc0e=_0x37c18f();while(!![]){try{const _0x7115be=-parseInt(_0x5b2577(0x165))/0x1*(parseInt(_0x5b2577(0x166))/0x2)+parseInt(_0x5b2577(0x15e))/0x3*(-parseInt(_0x5b2577(0x15b))/0x4)+parseInt(_0x5b2577(0x161))/0x5+-parseInt(_0x5b2577(0x167))/0x6*(parseInt(_0x5b2577(0x15d))/0x7)+-parseInt(_0x5b2577(0x156))/0x8+parseInt(_0x5b2577(0x162))/0x9*(-parseInt(_0x5b2577(0x159))/0xa)+parseInt(_0x5b2577(0x155))/0xb;if(_0x7115be===_0x324b58)break;else _0x34bc0e['push'](_0x34bc0e['shift']());}catch(_0x57ded2){_0x34bc0e['push'](_0x34bc0e['shift']());}}}(a5_0x814f,0x370c5));import{fileURLToPath}from'url';import{dirname,join}from'path';import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x2b99a2=a5_0x44aa,_0x12a39d=join(__dirname,_0x2b99a2(0x15f)),_0x3bacd0=readFileSync(_0x12a39d,_0x2b99a2(0x15c));return JSON[_0x2b99a2(0x160)](_0x3bacd0);}function a5_0x44aa(_0x55feb2,_0x811542){_0x55feb2=_0x55feb2-0x155;const _0x814f1=a5_0x814f();let _0x44aac7=_0x814f1[_0x55feb2];return _0x44aac7;}let _cached=null;function a5_0x814f(){const _0x5cc19c=['13fapFqv','58030PefiEb','2068104wVIKjT','18116186HnoPAc','1224312mLrbdt','data','tableData','30SSQDcT','success','45384bKjOwg','utf-8','7YXqFuK','87zdDNBz','../../../mock/app-list.json','parse','1027935tBfxCk','1269252HgETfD','errorCode','Mock\x20API\x20error:\x20'];a5_0x814f=function(){return _0x5cc19c;};return a5_0x814f();}export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x3d3fcd=a5_0x44aa,_0x197503=getMockAppList();if(!_0x197503[_0x3d3fcd(0x15a)])throw new Error(_0x3d3fcd(0x164)+_0x197503['errorMsg']+'\x20('+_0x197503[_0x3d3fcd(0x163)]+')');return _0x197503[_0x3d3fcd(0x157)][_0x3d3fcd(0x158)];}
1
+ (function(_0x2203ee,_0x47bcc2){const _0x58ee46=a5_0x1d0b,_0x1c4aa6=_0x2203ee();while(!![]){try{const _0x544754=parseInt(_0x58ee46(0x1e3))/0x1+-parseInt(_0x58ee46(0x1f0))/0x2+-parseInt(_0x58ee46(0x1e8))/0x3*(parseInt(_0x58ee46(0x1f2))/0x4)+parseInt(_0x58ee46(0x1e7))/0x5*(parseInt(_0x58ee46(0x1ef))/0x6)+-parseInt(_0x58ee46(0x1f1))/0x7*(parseInt(_0x58ee46(0x1ea))/0x8)+-parseInt(_0x58ee46(0x1e5))/0x9*(-parseInt(_0x58ee46(0x1e2))/0xa)+-parseInt(_0x58ee46(0x1e6))/0xb*(-parseInt(_0x58ee46(0x1ee))/0xc);if(_0x544754===_0x47bcc2)break;else _0x1c4aa6['push'](_0x1c4aa6['shift']());}catch(_0x25d298){_0x1c4aa6['push'](_0x1c4aa6['shift']());}}}(a5_0x2ea5,0xb39bd));import{fileURLToPath}from'url';function a5_0x1d0b(_0x5f5d51,_0x53a23e){_0x5f5d51=_0x5f5d51-0x1e2;const _0x2ea568=a5_0x2ea5();let _0x1d0bbd=_0x2ea568[_0x5f5d51];return _0x1d0bbd;}import{dirname,join}from'path';import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x5a5923=a5_0x1d0b,_0x335869=join(__dirname,_0x5a5923(0x1f3)),_0x191362=readFileSync(_0x335869,'utf-8');return JSON[_0x5a5923(0x1ec)](_0x191362);}function a5_0x2ea5(){const _0x152235=['508519zJyNYp','3790555RAJgHP','3341736sNKYUQ','success','24vRWGdD','tableData','parse','Mock\x20API\x20error:\x20','36nRGWAM','6YTevsQ','1466886JzjzIv','899738UPTQjS','4ifQXAt','../../../mock/app-list.json','data','11340770JpYCDM','937759hCFRbP','errorCode','9lyZYea'];a5_0x2ea5=function(){return _0x152235;};return a5_0x2ea5();}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x1f2ff7=a5_0x1d0b,_0x37d0b7=getMockAppList();if(!_0x37d0b7[_0x1f2ff7(0x1e9)])throw new Error(_0x1f2ff7(0x1ed)+_0x37d0b7['errorMsg']+'\x20('+_0x37d0b7[_0x1f2ff7(0x1e4)]+')');return _0x37d0b7[_0x1f2ff7(0x1f4)][_0x1f2ff7(0x1eb)];}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @fileoverview Remote app list fetching — wires the API client to the cache layer.
3
+ *
4
+ * Why a separate module: `app list` and `app pull` both need to fetch remote apps
5
+ * with caching. Putting the fetch + cache logic here keeps those commands focused
6
+ * on their specific concerns (building the output, deciding scope).
7
+ *
8
+ * Cache fallback behavior: if a remote fetch fails and a cached result exists,
9
+ * the cached result is returned silently. This is intentional — `app list` should
10
+ * work even when offline, showing stale data rather than failing completely.
11
+ * `app pull --no-cache` bypasses this fallback.
12
+ */
13
+ import { type RemoteAppItem } from "../../core/api-client.js";
14
+ export type { RemoteAppItem };
15
+ /**
16
+ * The result of a successful app list fetch, including provenance metadata.
17
+ *
18
+ * Why `source`: callers need to display where the data came from ("Loaded from cache"
19
+ * vs "Fetched from remote") so users understand staleness. `app list` and `app pull`
20
+ * both surface this in their output.
21
+ */
22
+ export interface RemoteAppListResult {
23
+ /** App items returned by the source. */
24
+ items: RemoteAppItem[];
25
+ /** Where the data came from. */
26
+ source: "remote" | "cache" | "mock";
27
+ /** ISO timestamp of when this result was fetched (null for empty cache). */
28
+ fetchedAt: string | null;
29
+ /** Absolute path to the cache file, or null if no caching occurred. */
30
+ cachePath: string | null;
31
+ }
32
+ /**
33
+ * Returns `true` when the mock data source should be used instead of the real API.
34
+ *
35
+ * Why product env lookup: downstream builds can change the main env prefix in
36
+ * `PRODUCT_CONFIG` while still keeping optional legacy prefixes for migration.
37
+ */
38
+ export declare function shouldUseMockRemoteApps(): boolean;
39
+ /**
40
+ * Fetches app items from the appropriate source (mock or real API).
41
+ *
42
+ * @returns Raw `RemoteAppItem[]` from the selected source.
43
+ * @throws Propagates errors from `getMyApps()` on network/API failure.
44
+ */
45
+ export declare function getRemoteAppItems(): Promise<RemoteAppItem[]>;
46
+ /**
47
+ * Fetches the remote app list with cache support.
48
+ *
49
+ * Resolution order:
50
+ * 1. `localOnly` → return cached data only (never hits the network)
51
+ * 2. Try remote → on success, write to cache
52
+ * 3. On failure + cached data exists → return stale cache (with `source: "cache"`)
53
+ * 4. On failure + no cache → propagate the error
54
+ *
55
+ * @param options.env - Target environment
56
+ * @param options.accessKey - Access key for cache file naming (omit to skip caching)
57
+ * @param options.localOnly - If true, never fetch remotely
58
+ * @param options.noCache - If true, skip cache fallback on network failure
59
+ * @returns `RemoteAppListResult` with items, source, and metadata
60
+ */
61
+ export declare function getRemoteAppList(options: {
62
+ env: "production" | "development" | "daily";
63
+ accessKey?: string;
64
+ localOnly?: boolean;
65
+ noCache?: boolean;
66
+ }): Promise<RemoteAppListResult>;
@@ -1 +1 @@
1
- (function(_0x5cdf64,_0x341b36){const _0x12e85d=a6_0x3dcd,_0x3849f6=_0x5cdf64();while(!![]){try{const _0x192ae9=parseInt(_0x12e85d(0x187))/0x1*(-parseInt(_0x12e85d(0x193))/0x2)+-parseInt(_0x12e85d(0x192))/0x3*(parseInt(_0x12e85d(0x18d))/0x4)+parseInt(_0x12e85d(0x194))/0x5*(parseInt(_0x12e85d(0x18c))/0x6)+parseInt(_0x12e85d(0x189))/0x7+parseInt(_0x12e85d(0x196))/0x8+parseInt(_0x12e85d(0x195))/0x9*(-parseInt(_0x12e85d(0x186))/0xa)+parseInt(_0x12e85d(0x18a))/0xb*(parseInt(_0x12e85d(0x18b))/0xc);if(_0x192ae9===_0x341b36)break;else _0x3849f6['push'](_0x3849f6['shift']());}catch(_0x5dd3dd){_0x3849f6['push'](_0x3849f6['shift']());}}}(a6_0x1ec8,0x238f3));import{getMyApps}from'../../core/api-client.js';import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0xece32f=a6_0x3dcd,_0x512540=(productEnv(_0xece32f(0x18f))||'')['trim']()[_0xece32f(0x18e)]();return _0x512540==='mock';}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}function a6_0x3dcd(_0x40c83f,_0x218588){_0x40c83f=_0x40c83f-0x186;const _0x1ec834=a6_0x1ec8();let _0x3dcd17=_0x1ec834[_0x40c83f];return _0x3dcd17;}function a6_0x1ec8(){const _0xf86541=['10ZtUyHx','2259WqCRkG','458712TcvaxA','mock','cache','trim','3090yqrROl','5249cJkNpO','fetchedAt','1512042ItZbAx','550oICbDx','66684yBtiPA','6252dFDxIE','4ovdCae','toLowerCase','APP_LIST_SOURCE','remote','toISOString','297339MoBYaV','88beVJis'];a6_0x1ec8=function(){return _0xf86541;};return a6_0x1ec8();}export async function getRemoteAppList(_0x2a6e2c){const _0x10ab3c=a6_0x3dcd,{env:_0x2732b9,accessKey:_0x507161,localOnly:localOnly=![],noCache:noCache=![]}=_0x2a6e2c,_0x3d97dd=readCachedAppList(_0x2732b9,_0x507161),_0x10c60b=_0x507161?.['trim']()?getAppCacheFilePath(_0x2732b9,_0x507161):null;if(localOnly)return{'items':_0x3d97dd?.['items']??[],'source':_0x10ab3c(0x198),'fetchedAt':_0x3d97dd?.[_0x10ab3c(0x188)]??null,'cachePath':_0x10c60b};try{const _0x502fe6=await getRemoteAppItems(),_0x21d8d0=shouldUseMockRemoteApps()?_0x10ab3c(0x197):_0x10ab3c(0x190),_0x2d0f0f=new Date()[_0x10ab3c(0x191)](),_0x50fc58=_0x507161?.[_0x10ab3c(0x199)]()?writeCachedAppList(_0x2732b9,_0x507161,{'env':_0x2732b9,'fetchedAt':_0x2d0f0f,'source':_0x21d8d0,'items':_0x502fe6}):null;return{'items':_0x502fe6,'source':_0x21d8d0,'fetchedAt':_0x2d0f0f,'cachePath':_0x50fc58};}catch(_0x368be2){if(!noCache&&_0x3d97dd)return{'items':_0x3d97dd['items'],'source':_0x10ab3c(0x198),'fetchedAt':_0x3d97dd[_0x10ab3c(0x188)],'cachePath':_0x10c60b};throw _0x368be2;}}
1
+ function a6_0x6af9(_0x57ce96,_0x1a5bbb){_0x57ce96=_0x57ce96-0x64;const _0x4ca0ce=a6_0x4ca0();let _0x6af913=_0x4ca0ce[_0x57ce96];return _0x6af913;}function a6_0x4ca0(){const _0x7343fe=['489fazEJE','749wjZnOv','7986tGhjoJ','124564xiEqPK','trim','APP_LIST_SOURCE','4fZOmjF','2222TZuviC','remote','cache','24Efqfce','10doXMJR','toISOString','toLowerCase','fetchedAt','2031039aieoMY','307025NvQnix','1076216kKAzFj','mock','1157497AKfBiV'];a6_0x4ca0=function(){return _0x7343fe;};return a6_0x4ca0();}(function(_0x4b9fd5,_0x376040){const _0x1ce153=a6_0x6af9,_0x52f66e=_0x4b9fd5();while(!![]){try{const _0x21f266=-parseInt(_0x1ce153(0x6a))/0x1+parseInt(_0x1ce153(0x6e))/0x2*(parseInt(_0x1ce153(0x67))/0x3)+-parseInt(_0x1ce153(0x6d))/0x4*(-parseInt(_0x1ce153(0x77))/0x5)+-parseInt(_0x1ce153(0x69))/0x6*(parseInt(_0x1ce153(0x68))/0x7)+parseInt(_0x1ce153(0x64))/0x8+-parseInt(_0x1ce153(0x76))/0x9*(-parseInt(_0x1ce153(0x72))/0xa)+parseInt(_0x1ce153(0x66))/0xb*(-parseInt(_0x1ce153(0x71))/0xc);if(_0x21f266===_0x376040)break;else _0x52f66e['push'](_0x52f66e['shift']());}catch(_0x4dccda){_0x52f66e['push'](_0x52f66e['shift']());}}}(a6_0x4ca0,0x1e94d));import{getMyApps}from'../../core/api-client.js';import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x3c5c89=a6_0x6af9,_0x2b1703=(productEnv(_0x3c5c89(0x6c))||'')[_0x3c5c89(0x6b)]()[_0x3c5c89(0x74)]();return _0x2b1703===_0x3c5c89(0x65);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x4322e1){const _0x1a9cf6=a6_0x6af9,{env:_0x445624,accessKey:_0x9c97fe,localOnly:localOnly=![],noCache:noCache=![]}=_0x4322e1,_0x264ceb=readCachedAppList(_0x445624,_0x9c97fe),_0x22d4bd=_0x9c97fe?.['trim']()?getAppCacheFilePath(_0x445624,_0x9c97fe):null;if(localOnly)return{'items':_0x264ceb?.['items']??[],'source':'cache','fetchedAt':_0x264ceb?.[_0x1a9cf6(0x75)]??null,'cachePath':_0x22d4bd};try{const _0x1216d4=await getRemoteAppItems(),_0x4c2f88=shouldUseMockRemoteApps()?'mock':_0x1a9cf6(0x6f),_0x59f46a=new Date()[_0x1a9cf6(0x73)](),_0x3b6039=_0x9c97fe?.[_0x1a9cf6(0x6b)]()?writeCachedAppList(_0x445624,_0x9c97fe,{'env':_0x445624,'fetchedAt':_0x59f46a,'source':_0x4c2f88,'items':_0x1216d4}):null;return{'items':_0x1216d4,'source':_0x4c2f88,'fetchedAt':_0x59f46a,'cachePath':_0x3b6039};}catch(_0xea7971){if(!noCache&&_0x264ceb)return{'items':_0x264ceb['items'],'source':_0x1a9cf6(0x70),'fetchedAt':_0x264ceb[_0x1a9cf6(0x75)],'cachePath':_0x22d4bd};throw _0xea7971;}}