@lovrabet/lovrabet-cli 2.1.23-beta.1 → 2.1.23-beta.3

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 (142) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.d.ts +4 -8
  5. package/lib/commands/app/definitions.js +1 -1
  6. package/lib/commands/app/eligibility.js +1 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +1 -1
  9. package/lib/commands/app/shared.d.ts +1 -16
  10. package/lib/commands/app/shared.js +1 -1
  11. package/lib/commands/app-config/get.js +1 -1
  12. package/lib/commands/app-config/index.js +1 -1
  13. package/lib/commands/artifact/index.js +1 -1
  14. package/lib/commands/auth/device.js +1 -1
  15. package/lib/commands/auth/index.d.ts +2 -2
  16. package/lib/commands/auth/index.js +1 -1
  17. package/lib/commands/auth/prompt.js +1 -1
  18. package/lib/commands/bff/detail.js +1 -1
  19. package/lib/commands/bff/exec.js +1 -1
  20. package/lib/commands/bff/index.js +1 -1
  21. package/lib/commands/cli-skill/index.js +1 -1
  22. package/lib/commands/common/config-policy.d.ts +4 -8
  23. package/lib/commands/common/config-policy.js +1 -1
  24. package/lib/commands/common/constraints.js +1 -1
  25. package/lib/commands/common/flags.js +1 -1
  26. package/lib/commands/common/local-file.js +1 -1
  27. package/lib/commands/config/definitions.js +1 -1
  28. package/lib/commands/config/shared.js +1 -1
  29. package/lib/commands/data/index.js +1 -1
  30. package/lib/commands/dataset/detail.js +1 -1
  31. package/lib/commands/dataset/index.js +1 -1
  32. package/lib/commands/dataset/list.js +1 -1
  33. package/lib/commands/dataset/sdk-doc.js +1 -1
  34. package/lib/commands/doctor.js +1 -1
  35. package/lib/commands/file/index.js +1 -1
  36. package/lib/commands/init.d.ts +6 -24
  37. package/lib/commands/init.js +1 -1
  38. package/lib/commands/kb/index.js +1 -1
  39. package/lib/commands/logs/index.js +1 -1
  40. package/lib/commands/ocr/index.js +1 -1
  41. package/lib/commands/personal-bff/index.js +1 -1
  42. package/lib/commands/registry.d.ts +7 -0
  43. package/lib/commands/registry.js +1 -1
  44. package/lib/commands/schedule/index.js +1 -1
  45. package/lib/commands/schema.js +1 -1
  46. package/lib/commands/service/dynamic.js +1 -1
  47. package/lib/commands/service/function-name-adapter.js +1 -1
  48. package/lib/commands/service/index.js +1 -1
  49. package/lib/commands/service/registry.js +1 -1
  50. package/lib/commands/skill/commands/create.js +1 -1
  51. package/lib/commands/skill/commands/diagram.js +1 -1
  52. package/lib/commands/skill/commands/install.js +1 -1
  53. package/lib/commands/skill/commands/list.js +1 -1
  54. package/lib/commands/skill/commands/push.js +1 -1
  55. package/lib/commands/skill/commands/validate.js +1 -1
  56. package/lib/commands/skill/diagram.js +1 -1
  57. package/lib/commands/skill/flags.js +1 -1
  58. package/lib/commands/skill/index.js +1 -1
  59. package/lib/commands/skill/manifest-helpers.js +1 -1
  60. package/lib/commands/skill/push-execute.js +1 -1
  61. package/lib/commands/skill/push-flow-helpers.js +1 -1
  62. package/lib/commands/skill/push-retarget.js +1 -1
  63. package/lib/commands/skill/scopes.js +1 -1
  64. package/lib/commands/skill/summary.js +1 -1
  65. package/lib/commands/skill/templates.js +1 -1
  66. package/lib/commands/skill/validate.js +1 -1
  67. package/lib/commands/sql/detail.js +1 -1
  68. package/lib/commands/sql/exec.js +1 -1
  69. package/lib/commands/sql/index.js +1 -1
  70. package/lib/commands/update.js +1 -1
  71. package/lib/commands/workspace/index.js +1 -1
  72. package/lib/config/schema.js +1 -1
  73. package/lib/constant/app.js +1 -1
  74. package/lib/constant/auth-mode.js +1 -1
  75. package/lib/constant/cli.js +1 -1
  76. package/lib/constant/defaults.js +1 -1
  77. package/lib/constant/distribution.js +1 -1
  78. package/lib/constant/domain.js +1 -1
  79. package/lib/constant/env.js +1 -1
  80. package/lib/constant/output.js +1 -1
  81. package/lib/constant/product.d.ts +14 -0
  82. package/lib/constant/product.js +1 -1
  83. package/lib/constant/risk.js +1 -1
  84. package/lib/constant/url.js +1 -1
  85. package/lib/context.d.ts +5 -5
  86. package/lib/context.js +1 -1
  87. package/lib/core/api-client.js +1 -1
  88. package/lib/core/db-resolver.js +1 -1
  89. package/lib/core/sdk-client.js +1 -1
  90. package/lib/errors.js +1 -1
  91. package/lib/framework/build-all-flags.js +1 -1
  92. package/lib/framework/dryrun.js +1 -1
  93. package/lib/framework/flags.js +1 -1
  94. package/lib/framework/help.js +1 -1
  95. package/lib/framework/index.js +1 -1
  96. package/lib/framework/output.js +1 -1
  97. package/lib/framework/preparse.js +1 -1
  98. package/lib/framework/rate-limit.js +1 -1
  99. package/lib/framework/raw-flags.js +1 -1
  100. package/lib/framework/response.js +1 -1
  101. package/lib/framework/runner-confirmation.js +1 -1
  102. package/lib/framework/runner-error.js +1 -1
  103. package/lib/framework/runner.js +1 -1
  104. package/lib/framework/schema-export.js +1 -1
  105. package/lib/framework/service-order.js +1 -1
  106. package/lib/framework/types.js +1 -1
  107. package/lib/generated/build-info.d.ts +4 -4
  108. package/lib/generated/build-info.js +1 -1
  109. package/lib/help.js +1 -1
  110. package/lib/runtime/confirmation.js +1 -1
  111. package/lib/runtime/event.js +1 -1
  112. package/lib/runtime/index.js +1 -1
  113. package/lib/runtime/queue.js +1 -1
  114. package/lib/runtime/resolve.js +1 -1
  115. package/lib/skills/npx-skills-add.d.ts +30 -0
  116. package/lib/skills/npx-skills-add.js +1 -1
  117. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  118. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  119. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  120. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  121. package/lib/skills/runtime-skill-sync/links.js +1 -1
  122. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  123. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  124. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  125. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  126. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  127. package/lib/skills/runtime-skill-sync/push.js +1 -1
  128. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  129. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  130. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  131. package/lib/skills/runtime-skill-sync.js +1 -1
  132. package/lib/skills/skill-presence.d.ts +48 -0
  133. package/lib/skills/skill-presence.js +1 -0
  134. package/lib/utils/apply-jq-filter.js +1 -1
  135. package/lib/utils/logger.js +1 -1
  136. package/lib/utils/lossless-json.js +1 -1
  137. package/lib/utils/params.js +1 -1
  138. package/lib/utils/platform.js +1 -1
  139. package/lib/utils/update-notice.js +1 -1
  140. package/lib/utils/version.js +1 -1
  141. package/lib/utils/write-cli-side-channel.js +1 -1
  142. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- (function(_0x2b838c,_0x270b66){const _0x3029a2=a0_0x1af9,_0x342d24=_0x2b838c();while(!![]){try{const _0x49edd3=-parseInt(_0x3029a2(0x11d))/0x1*(parseInt(_0x3029a2(0x119))/0x2)+-parseInt(_0x3029a2(0x11e))/0x3+parseInt(_0x3029a2(0x123))/0x4*(-parseInt(_0x3029a2(0x12b))/0x5)+parseInt(_0x3029a2(0x10f))/0x6+parseInt(_0x3029a2(0x115))/0x7*(parseInt(_0x3029a2(0x105))/0x8)+-parseInt(_0x3029a2(0x117))/0x9+parseInt(_0x3029a2(0x106))/0xa*(parseInt(_0x3029a2(0x116))/0xb);if(_0x49edd3===_0x270b66)break;else _0x342d24['push'](_0x342d24['shift']());}catch(_0x5071d0){_0x342d24['push'](_0x342d24['shift']());}}}(a0_0xc236,0x94aeb));import{jsx as a0_0x133ef1}from'react/jsx-runtime';import a0_0x43c480 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';const helpText=generateFullHelp(),cli=a0_0x43c480(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()['catch'](handleError);function a0_0x1af9(_0x1714bc,_0x19776b){_0x1714bc=_0x1714bc-0x105;const _0xc2361e=a0_0xc236();let _0x1af93f=_0xc2361e[_0x1714bc];return _0x1af93f;}async function main(){try{await run();}catch(_0x68ea44){handleError(_0x68ea44);}}async function run(){const _0x1ceee2=a0_0x1af9;let _0x42641b=cli[_0x1ceee2(0x122)][0x0],_0x5d4f75=cli[_0x1ceee2(0x122)][0x1];const _0x21f39a=cli['flags'];try{const {correctFlags:_0x29e382}=await import(_0x1ceee2(0x128)),_0x2b50dd=getAllDefinitions()[_0x1ceee2(0x109)](_0x25495a=>_0x25495a[_0x1ceee2(0x11b)]??[]),{flags:_0x582978,corrections:_0x391c4e}=_0x29e382(_0x21f39a,_0x2b50dd);if(_0x391c4e[_0x1ceee2(0x124)]>0x0){for(const _0x43d521 of _0x391c4e){process[_0x1ceee2(0x118)][_0x1ceee2(0x125)]('[preparse]\x20'+_0x43d521['handler']+_0x1ceee2(0x107)+_0x43d521[_0x1ceee2(0x108)]+'\x20->\x20--'+_0x43d521['corrected']+'\x0a');}Object[_0x1ceee2(0x12e)](_0x21f39a,_0x582978);}}catch{}if(!_0x42641b){const {waitUntilExit:_0x11270f}=render(a0_0x133ef1(Help,{}));await _0x11270f();return;}if(!isKnownService(_0x42641b)){const _0x446048=resolveDynamicServiceCommand(cli[_0x1ceee2(0x122)],_0x21f39a);if(_0x446048){if(_0x21f39a[_0x1ceee2(0x114)]){console[_0x1ceee2(0x10b)](generateCommandHelp(_0x446048[_0x1ceee2(0x113)]));return;}Object[_0x1ceee2(0x12e)](_0x21f39a,_0x446048[_0x1ceee2(0x11b)]);const _0x4bc08c=buildConfigFromFlags(_0x21f39a);await initGlobalEnvironment(_0x4bc08c);const _0x19ac24=createPipelineEnv(_0x4bc08c,_0x21f39a);_0x19ac24[_0x1ceee2(0x10d)]=_0x446048['args'],await runCommand(_0x446048['definition'],_0x19ac24);return;}if(_0x21f39a['help']){const _0x32be26=generateDynamicServiceHelp(_0x42641b);if(_0x32be26){console['log'](_0x32be26);return;}}const {waitUntilExit:_0x1132d4}=render(a0_0x133ef1(Help,{}));await _0x1132d4();return;}const _0x28b22b=getServiceEntry(_0x42641b);if(!_0x5d4f75){if(_0x21f39a[_0x1ceee2(0x114)]){console[_0x1ceee2(0x10b)](generateServiceHelp(_0x42641b));return;}if(_0x28b22b[_0x1ceee2(0x120)])_0x5d4f75=_0x28b22b[_0x1ceee2(0x120)];else{console['log'](generateServiceHelp(_0x42641b));return;}}const _0x1eddca=findDefinition(_0x42641b,_0x5d4f75);!_0x1eddca&&(console[_0x1ceee2(0x10b)](generateServiceHelp(_0x42641b)),handleError(CliErrors[_0x1ceee2(0x129)](_0x42641b+'\x20'+_0x5d4f75)));if(_0x21f39a[_0x1ceee2(0x114)]){console[_0x1ceee2(0x10b)](generateCommandHelp(_0x1eddca));return;}const _0x5c80c7=buildConfigFromFlags(_0x21f39a);await initGlobalEnvironment(_0x5c80c7);const _0x166bc9=createPipelineEnv(_0x5c80c7,_0x21f39a);_0x166bc9[_0x1ceee2(0x10d)]=cli['input'][_0x1ceee2(0x11a)](0x2),await runCommand(_0x1eddca,_0x166bc9);}function handleError(_0x45d4aa){const _0x386efd=a0_0x1af9;if(_0x45d4aa instanceof CliError){_0x45d4aa[_0x386efd(0x10a)]===_0x386efd(0x12d)&&(process[_0x386efd(0x118)][_0x386efd(0x125)](_0x386efd(0x127)),process[_0x386efd(0x111)](0x0));console[_0x386efd(0x110)](_0x386efd(0x10e)+_0x45d4aa[_0x386efd(0x126)]);if(_0x45d4aa['hint'])console['error'](_0x386efd(0x112)+_0x45d4aa[_0x386efd(0x11c)]);process[_0x386efd(0x111)](_0x45d4aa[_0x386efd(0x11f)]);}isUserCancellation(_0x45d4aa)&&(process[_0x386efd(0x118)][_0x386efd(0x125)](_0x386efd(0x127)),process[_0x386efd(0x111)](0x0)),console[_0x386efd(0x110)](_0x386efd(0x10c),_0x45d4aa),process['exit'](0x1);}function isUserCancellation(_0x46fac3){const _0x2d3b84=a0_0x1af9;if(!(_0x46fac3 instanceof Error))return![];if(_0x46fac3[_0x2d3b84(0x121)]===_0x2d3b84(0x12a))return!![];if(_0x46fac3[_0x2d3b84(0x10a)]===_0x2d3b84(0x12c))return!![];if(_0x46fac3[_0x2d3b84(0x10a)]==='ERR_STREAM_DESTROYED')return!![];return![];}function a0_0xc236(){const _0x3fb336=['definition','help','7KphKqi','451fRVqsv','5698242UTcNES','stderr','257016hZqJbC','slice','flags','hint','5IRvDtI','1107447QNFwuA','exitCode','defaultCommand','name','input','211884Zamfch','length','write','message','\x0aCancelled.\x0a','./framework/preparse.js','unknownCommand','ExitPromptError','65oXTPSV','ERR_USE_AFTER_CLOSE','cancelled','assign','7091832cqAfoU','451740YiEOgJ',':\x20--','original','flatMap','code','log','Unexpected\x20error:','args','Error:\x20','1223040rijlNu','error','exit','Hint:\x20'];a0_0xc236=function(){return _0x3fb336;};return a0_0xc236();}
2
+ const a0_0x3bd57a=a0_0xff0b;(function(_0x135239,_0xe5516f){const _0x8095e6=a0_0xff0b,_0xd7f94c=_0x135239();while(!![]){try{const _0x279843=-parseInt(_0x8095e6(0x167))/0x1*(-parseInt(_0x8095e6(0x14f))/0x2)+parseInt(_0x8095e6(0x157))/0x3+parseInt(_0x8095e6(0x152))/0x4+-parseInt(_0x8095e6(0x168))/0x5*(-parseInt(_0x8095e6(0x15c))/0x6)+parseInt(_0x8095e6(0x161))/0x7+parseInt(_0x8095e6(0x162))/0x8+-parseInt(_0x8095e6(0x14b))/0x9;if(_0x279843===_0xe5516f)break;else _0xd7f94c['push'](_0xd7f94c['shift']());}catch(_0x1cf4b0){_0xd7f94c['push'](_0xd7f94c['shift']());}}}(a0_0x2c90,0x68eca));import{jsx as a0_0x3ae2ce}from'react/jsx-runtime';function a0_0xff0b(_0x4d6c3f,_0x295592){_0x4d6c3f=_0x4d6c3f-0x141;const _0x2c906f=a0_0x2c90();let _0xff0b39=_0x2c906f[_0x4d6c3f];return _0xff0b39;}import a0_0x4466b0 from'meow';import{render}from'ink';import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';function a0_0x2c90(){const _0x1f601f=['\x0aCancelled.\x0a','cancelled','input','./framework/preparse.js','194538FiZlPi','corrected','exitCode','exit','help','4664079UezNgN','4397296eMzTVv','hint','Hint:\x20','error','stderr','2thGdxo','85jzCrnT','log','validation','args','message','flatMap','ERR_USE_AFTER_CLOSE','ExitPromptError','catch','\x20->\x20--','flags','25059033mNKwvI','[preparse]\x20','slice','write','363186GvcFDA','defaultCommand','definition','959364DxxEvK',':\x20--','code','original','Unexpected\x20error:','2531790jujvLQ'];a0_0x2c90=function(){return _0x1f601f;};return a0_0x2c90();}import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions,resolveRemovedCommand}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_0x4466b0(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x3bd57a(0x148)](handleError);async function main(){try{await run();}catch(_0x23099f){handleError(_0x23099f);}}async function run(){const _0x561f78=a0_0x3bd57a;let _0x4d8ac1=cli[_0x561f78(0x15a)][0x0],_0x5c21d8=cli[_0x561f78(0x15a)][0x1];const _0x433537=cli[_0x561f78(0x14a)];try{const {correctFlags:_0x772fed}=await import(_0x561f78(0x15b)),_0x1adbb7=getAllDefinitions()[_0x561f78(0x145)](_0x4d6153=>_0x4d6153[_0x561f78(0x14a)]??[]),{flags:_0x41cdf3,corrections:_0x36ad63}=_0x772fed(_0x433537,_0x1adbb7);if(_0x36ad63['length']>0x0){for(const _0x268d04 of _0x36ad63){process[_0x561f78(0x166)][_0x561f78(0x14e)](_0x561f78(0x14c)+_0x268d04['handler']+_0x561f78(0x153)+_0x268d04[_0x561f78(0x155)]+_0x561f78(0x149)+_0x268d04[_0x561f78(0x15d)]+'\x0a');}Object['assign'](_0x433537,_0x41cdf3);}}catch{}if(!_0x4d8ac1){const {waitUntilExit:_0x53364c}=render(a0_0x3ae2ce(Help,{}));await _0x53364c();return;}const _0x55e615=resolveRemovedCommand(_0x4d8ac1,_0x5c21d8);if(_0x55e615)throw CliErrors[_0x561f78(0x142)](_0x55e615[_0x561f78(0x144)],_0x55e615['hint']);if(!isKnownService(_0x4d8ac1)){const _0x419217=resolveDynamicServiceCommand(cli[_0x561f78(0x15a)],_0x433537);if(_0x419217){if(_0x433537[_0x561f78(0x160)]){console[_0x561f78(0x141)](generateCommandHelp(_0x419217[_0x561f78(0x151)]));return;}Object['assign'](_0x433537,_0x419217[_0x561f78(0x14a)]);const _0x1363be=buildConfigFromFlags(_0x433537);await initGlobalEnvironment(_0x1363be);const _0x141ed5=createPipelineEnv(_0x1363be,_0x433537);_0x141ed5[_0x561f78(0x143)]=_0x419217[_0x561f78(0x143)],await runCommand(_0x419217[_0x561f78(0x151)],_0x141ed5);return;}if(_0x433537[_0x561f78(0x160)]){const _0x17f57b=generateDynamicServiceHelp(_0x4d8ac1);if(_0x17f57b){console['log'](_0x17f57b);return;}}const {waitUntilExit:_0x5284ad}=render(a0_0x3ae2ce(Help,{}));await _0x5284ad();return;}const _0x3de909=getServiceEntry(_0x4d8ac1);if(!_0x5c21d8){if(_0x433537[_0x561f78(0x160)]){console[_0x561f78(0x141)](generateServiceHelp(_0x4d8ac1));return;}if(_0x3de909[_0x561f78(0x150)])_0x5c21d8=_0x3de909[_0x561f78(0x150)];else{console[_0x561f78(0x141)](generateServiceHelp(_0x4d8ac1));return;}}const _0x3ac529=findDefinition(_0x4d8ac1,_0x5c21d8);!_0x3ac529&&(console[_0x561f78(0x141)](generateServiceHelp(_0x4d8ac1)),handleError(CliErrors['unknownCommand'](_0x4d8ac1+'\x20'+_0x5c21d8)));if(_0x433537[_0x561f78(0x160)]){console['log'](generateCommandHelp(_0x3ac529));return;}const _0xfa9319=buildConfigFromFlags(_0x433537);await initGlobalEnvironment(_0xfa9319);const _0x3b217c=createPipelineEnv(_0xfa9319,_0x433537);_0x3b217c[_0x561f78(0x143)]=cli[_0x561f78(0x15a)][_0x561f78(0x14d)](0x2),await runCommand(_0x3ac529,_0x3b217c);}function handleError(_0xca40a2){const _0x35ff1a=a0_0x3bd57a;if(_0xca40a2 instanceof CliError){_0xca40a2['code']===_0x35ff1a(0x159)&&(process[_0x35ff1a(0x166)]['write'](_0x35ff1a(0x158)),process[_0x35ff1a(0x15f)](0x0));console['error']('Error:\x20'+_0xca40a2[_0x35ff1a(0x144)]);if(_0xca40a2[_0x35ff1a(0x163)])console[_0x35ff1a(0x165)](_0x35ff1a(0x164)+_0xca40a2['hint']);process[_0x35ff1a(0x15f)](_0xca40a2[_0x35ff1a(0x15e)]);}isUserCancellation(_0xca40a2)&&(process[_0x35ff1a(0x166)][_0x35ff1a(0x14e)](_0x35ff1a(0x158)),process['exit'](0x0)),console['error'](_0x35ff1a(0x156),_0xca40a2),process[_0x35ff1a(0x15f)](0x1);}function isUserCancellation(_0x263310){const _0x4d5d81=a0_0x3bd57a;if(!(_0x263310 instanceof Error))return![];if(_0x263310['name']===_0x4d5d81(0x147))return!![];if(_0x263310[_0x4d5d81(0x154)]===_0x4d5d81(0x146))return!![];if(_0x263310[_0x4d5d81(0x154)]==='ERR_STREAM_DESTROYED')return!![];return![];}
@@ -1 +1 @@
1
- function a1_0x571c(){const _0x30bf15=['4oTQVdl','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','api-doc','Returns\x20SQL\x20execution\x20payload','datasetCode','paging.totalCount\x20gives\x20total\x20rows','/api/{appCode}/{datasetCode}/getOne','获取数据集详情','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','dataset_list','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','{\x22fieldName\x22:\x22value\x22}','length','custom_sql_execute','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','23317NaOMdw','read','POST','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','Dataset\x20detail','trim','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','dataset_detail','string','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','3401985hKqTnc','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','functionName','List\x20datasets','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','str','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','dataset_data_aggregate','/api/{appCode}/{datasetCode}/filter','title','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','dataset_data_filter','lovrabet\x20bff\x20detail\x20--name\x20<functionName>','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','Current\x20app\x20code','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','执行自定义\x20SQL','28710370ksYmPZ','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','按应用和函数名精确获取\x20BF\x20运行契约','/api/dataset/get-dataset-list-by-app-code','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','##\x20Filter\x20dataset\x20data','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','custom_sql','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','1640zCKFPR','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.','API\x20doc\x20code,\x20for\x20example\x20dataset_list','/api/{appCode}/{datasetCode}/aggregate','32-character\x20dataset\x20code','{\x22id\x22:123}','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20BFF\x20functions\x20or\x20expose\x20platform-only\x20fields.','bf_execute','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','path','##\x20List\x20datasets','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','1840737eAPMJv','list','Aggregate\x20dataset\x20data','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','keyword','Get\x20one\x20dataset\x20record','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','summary','toLowerCase','whenToUse','845340pRGEAZ','tableData\x20contains\x20dataset\x20id/code/name','4480344lVGIUv','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','Execute\x20BF\x20endpoint\x20function','filter','9ExQgas','聚合查询数据集数据','None','appCode','operations\x20describes\x20runtime\x20APIs','/client/bff/endpoint/{appCode}/{functionName}','map','/api/dataset/getOneByCode?code={datasetCode}','dataset','join','##\x20Dataset\x20detail','GET','List\x20available\x20runtime\x20API\x20documentation\x20entries','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.','code','Returns\x20one\x20matching\x20business\x20record','已经确认目标\x20BF\x20的\x20functionName,且需要实际调用该\x20ENDPOINT\x20函数完成业务操作时使用','Returns\x20script\x20business\x20payload','API\x20doc\x20code\x20not\x20found:\x20','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','需要向指定数据集新增一条业务数据时使用','/api/custom/executeSql','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','创建数据','Exact\x20endpoint\x20function\x20name','执行指定\x20BF\x20函数','category','143981yXJKGo','/api/{appCode}/{datasetCode}/create','detail'];a1_0x571c=function(){return _0x30bf15;};return a1_0x571c();}const a1_0x554151=a1_0x15f7;(function(_0x101cc5,_0x50d467){const _0x182308=a1_0x15f7,_0xcb03ea=_0x101cc5();while(!![]){try{const _0x10a3c4=parseInt(_0x182308(0x172))/0x1+parseInt(_0x182308(0x14b))/0x2+-parseInt(_0x182308(0x140))/0x3*(-parseInt(_0x182308(0x175))/0x4)+parseInt(_0x182308(0x18e))/0x5+parseInt(_0x182308(0x14d))/0x6+parseInt(_0x182308(0x184))/0x7*(parseInt(_0x182308(0x1a9))/0x8)+-parseInt(_0x182308(0x153))/0x9*(parseInt(_0x182308(0x1a0))/0xa);if(_0x10a3c4===_0x50d467)break;else _0xcb03ea['push'](_0xcb03ea['shift']());}catch(_0xb1a639){_0xcb03ea['push'](_0xcb03ea['shift']());}}}(a1_0x571c,0x66561));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':'category','type':a1_0x554151(0x18c),'description':a1_0x554151(0x17f)},KEYWORD_FLAG={'name':'keyword','type':a1_0x554151(0x18c),'description':a1_0x554151(0x13f)},DOC_CODE_FLAG={'name':a1_0x554151(0x162),'type':a1_0x554151(0x18c),'required':!![],'description':a1_0x554151(0x1ac)},DOCS=[{'code':a1_0x554151(0x17e),'category':'dataset','title':a1_0x554151(0x191),'method':a1_0x554151(0x186),'path':a1_0x554151(0x1a3),'summary':'分页获取数据集列表','whenToUse':a1_0x554151(0x19e),'pathParams':[],'queryParams':[],'bodySchema':a1_0x554151(0x16a),'responseHighlights':[a1_0x554151(0x14c),a1_0x554151(0x17a)],'examples':['lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress'],'notes':[a1_0x554151(0x18a)],'markdown':[a1_0x554151(0x13e),'',a1_0x554151(0x144)][a1_0x554151(0x15c)]('\x0a')},{'code':a1_0x554151(0x18b),'category':'dataset','title':a1_0x554151(0x188),'method':a1_0x554151(0x15e),'path':a1_0x554151(0x15a),'summary':a1_0x554151(0x17c),'whenToUse':'需要按数据集\x20code\x20获取字段、表信息、关联关系(relations)或操作定义时使用','pathParams':[],'queryParams':[{'name':a1_0x554151(0x162),'description':a1_0x554151(0x1ae)}],'bodySchema':a1_0x554151(0x155),'responseHighlights':['fields/properties\x20describe\x20data\x20shape',a1_0x554151(0x176),a1_0x554151(0x157)],'examples':[a1_0x554151(0x183)],'notes':[a1_0x554151(0x13c)],'markdown':[a1_0x554151(0x15d),'','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.'][a1_0x554151(0x15c)]('\x0a')},{'code':a1_0x554151(0x19a),'category':a1_0x554151(0x15b),'title':'Filter\x20dataset\x20data','method':'POST','path':a1_0x554151(0x196),'summary':'条件过滤查询数据','whenToUse':a1_0x554151(0x1b0),'pathParams':[{'name':a1_0x554151(0x156),'description':'Current\x20app\x20code'},{'name':a1_0x554151(0x179),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x554151(0x187),'responseHighlights':['tableData\x20contains\x20records','paging\x20contains\x20pagination'],'examples':[a1_0x554151(0x160),'lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27'],'notes':[a1_0x554151(0x14f),a1_0x554151(0x161),a1_0x554151(0x199),a1_0x554151(0x18d)],'markdown':[a1_0x554151(0x1a5),'',a1_0x554151(0x1a6)][a1_0x554151(0x15c)]('\x0a')},{'code':a1_0x554151(0x195),'category':'dataset','title':a1_0x554151(0x142),'method':a1_0x554151(0x186),'path':a1_0x554151(0x1ad),'summary':a1_0x554151(0x154),'whenToUse':'需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','pathParams':[{'name':a1_0x554151(0x156),'description':'Current\x20app\x20code'},{'name':a1_0x554151(0x179),'description':a1_0x554151(0x1ae)}],'queryParams':[],'bodySchema':a1_0x554151(0x1a8),'responseHighlights':['result\x20rows\x20contain\x20aggregate\x20aliases','where\x20filters\x20before\x20aggregation'],'examples':[a1_0x554151(0x167)],'notes':[a1_0x554151(0x143),a1_0x554151(0x1aa)],'markdown':['##\x20Aggregate\x20dataset\x20data','',a1_0x554151(0x1a1)]['join']('\x0a')},{'code':'dataset_data_get_one','category':a1_0x554151(0x15b),'title':a1_0x554151(0x146),'method':a1_0x554151(0x186),'path':a1_0x554151(0x17b),'summary':'查询单条数据','whenToUse':'已经知道记录\x20id,需要按数据集读取单条业务数据时使用','pathParams':[{'name':a1_0x554151(0x156),'description':'Current\x20app\x20code'},{'name':a1_0x554151(0x179),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x554151(0x1af),'responseHighlights':[a1_0x554151(0x163)],'examples':[a1_0x554151(0x1a4)],'notes':['Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.'],'markdown':a1_0x554151(0x147)},{'code':'dataset_data_create','category':'dataset','title':'Create\x20dataset\x20record','method':a1_0x554151(0x186),'path':a1_0x554151(0x173),'summary':a1_0x554151(0x16e),'whenToUse':a1_0x554151(0x168),'pathParams':[{'name':'appCode','description':a1_0x554151(0x19d)},{'name':a1_0x554151(0x179),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x554151(0x180),'responseHighlights':['Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result'],'examples':[a1_0x554151(0x16b)],'notes':[a1_0x554151(0x150)],'markdown':a1_0x554151(0x19c)},{'code':'bf_detail','category':'bf','title':'Get\x20BF\x20endpoint\x20function\x20contract','method':a1_0x554151(0x15e),'path':a1_0x554151(0x158),'summary':a1_0x554151(0x1a2),'whenToUse':'已经从用户、平台\x20UI\x20或前序上下文确认函数名,需要查看该\x20ENDPOINT\x20的运行态元信息时使用','pathParams':[{'name':a1_0x554151(0x156),'description':a1_0x554151(0x19d)},{'name':a1_0x554151(0x190),'description':a1_0x554151(0x16f)}],'queryParams':[],'bodySchema':a1_0x554151(0x155),'responseHighlights':[a1_0x554151(0x18f)],'examples':[a1_0x554151(0x19b)],'notes':[a1_0x554151(0x13a)],'markdown':a1_0x554151(0x1ab)},{'code':a1_0x554151(0x13b),'category':'bf','title':a1_0x554151(0x151),'method':a1_0x554151(0x186),'path':'/api/endpoint/{appCode}/{functionName}','summary':a1_0x554151(0x170),'whenToUse':a1_0x554151(0x164),'pathParams':[{'name':'appCode','description':a1_0x554151(0x19d)},{'name':'functionName','description':'Endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':'{\x22param\x22:\x22value\x22}','responseHighlights':[a1_0x554151(0x165)],'examples':[a1_0x554151(0x198)],'notes':[a1_0x554151(0x194)],'markdown':a1_0x554151(0x16d)},{'code':a1_0x554151(0x182),'category':a1_0x554151(0x1a7),'title':'Execute\x20custom\x20SQL','method':a1_0x554151(0x186),'path':a1_0x554151(0x169),'summary':a1_0x554151(0x19f),'whenToUse':a1_0x554151(0x16c),'pathParams':[],'queryParams':[],'bodySchema':a1_0x554151(0x17d),'responseHighlights':[a1_0x554151(0x178)],'examples':[a1_0x554151(0x192)],'notes':['Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.'],'markdown':a1_0x554151(0x14e)}];function a1_0x15f7(_0x451114,_0x44e55a){_0x451114=_0x451114-0x13a;const _0x571cd5=a1_0x571c();let _0x15f784=_0x571cd5[_0x451114];return _0x15f784;}function entrySummary(_0x3a91dc){const _0xf55033=a1_0x554151;return{'code':_0x3a91dc[_0xf55033(0x162)],'category':_0x3a91dc['category'],'method':_0x3a91dc['method'],'path':_0x3a91dc[_0xf55033(0x13d)],'summary':_0x3a91dc['summary'],'whenToUse':_0x3a91dc[_0xf55033(0x14a)]};}export function listApiDocEntries(_0x4d385f={}){const _0x205151=a1_0x554151,_0x1a46f0=String(_0x4d385f[_0x205151(0x171)]||'')[_0x205151(0x189)](),_0x50f503=String(_0x4d385f[_0x205151(0x145)]||'')[_0x205151(0x189)]()[_0x205151(0x149)]();return DOCS[_0x205151(0x152)](_0x51ad92=>{const _0x4ffd37=_0x205151;if(_0x1a46f0&&_0x51ad92['category']!==_0x1a46f0)return![];if(!_0x50f503)return!![];return[_0x51ad92['code'],_0x51ad92['category'],_0x51ad92['method'],_0x51ad92[_0x4ffd37(0x13d)],_0x51ad92[_0x4ffd37(0x148)],_0x51ad92[_0x4ffd37(0x14a)],_0x51ad92[_0x4ffd37(0x197)]][_0x4ffd37(0x15c)]('\x20')[_0x4ffd37(0x149)]()['includes'](_0x50f503);})[_0x205151(0x159)](entrySummary);}export function getApiDocDetail(_0x135fc3){const _0x333391=a1_0x554151,_0x2033f7=DOCS['find'](_0x40c0b7=>_0x40c0b7['code']===_0x135fc3);if(!_0x2033f7)throw CliErrors['validation'](_0x333391(0x166)+_0x135fc3);return{..._0x2033f7};}const apiDocList={'service':a1_0x554151(0x177),'command':a1_0x554151(0x141),'description':a1_0x554151(0x15f),'risk':a1_0x554151(0x185),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x1dcede){const _0x291e69=a1_0x554151,_0x204c76=listApiDocEntries({'category':_0x1dcede[_0x291e69(0x193)]('category'),'keyword':_0x1dcede[_0x291e69(0x193)](_0x291e69(0x145))});return{'ok':!![],'data':{'total':_0x204c76[_0x291e69(0x181)],'items':_0x204c76}};}},apiDocDetail={'service':a1_0x554151(0x177),'command':a1_0x554151(0x174),'description':'Show\x20runtime\x20API\x20documentation\x20by\x20code','risk':a1_0x554151(0x185),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x41afbf){const _0x44b1a2=a1_0x554151;return{'ok':!![],'data':getApiDocDetail(_0x41afbf[_0x44b1a2(0x193)](_0x44b1a2(0x162)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
1
+ const a1_0x1fd973=a1_0xaf0a;(function(_0x577451,_0x2f579d){const _0x1e295c=a1_0xaf0a,_0x2c3db0=_0x577451();while(!![]){try{const _0x365ad7=-parseInt(_0x1e295c(0xaa))/0x1*(-parseInt(_0x1e295c(0xa0))/0x2)+-parseInt(_0x1e295c(0x74))/0x3*(parseInt(_0x1e295c(0xcb))/0x4)+parseInt(_0x1e295c(0x92))/0x5+-parseInt(_0x1e295c(0xe3))/0x6*(parseInt(_0x1e295c(0xac))/0x7)+-parseInt(_0x1e295c(0xcc))/0x8+-parseInt(_0x1e295c(0xb0))/0x9+parseInt(_0x1e295c(0xce))/0xa*(parseInt(_0x1e295c(0xca))/0xb);if(_0x365ad7===_0x2f579d)break;else _0x2c3db0['push'](_0x2c3db0['shift']());}catch(_0x21a215){_0x2c3db0['push'](_0x2c3db0['shift']());}}}(a1_0x4eba,0x45423));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':'category','type':a1_0x1fd973(0xb6),'description':a1_0x1fd973(0x82)},KEYWORD_FLAG={'name':a1_0x1fd973(0xe8),'type':a1_0x1fd973(0xb6),'description':a1_0x1fd973(0xd5)},DOC_CODE_FLAG={'name':a1_0x1fd973(0xa8),'type':'string','required':!![],'description':a1_0x1fd973(0x8a)},DOCS=[{'code':a1_0x1fd973(0xc9),'category':a1_0x1fd973(0xc5),'title':a1_0x1fd973(0xb8),'method':a1_0x1fd973(0x83),'path':a1_0x1fd973(0x7b),'summary':a1_0x1fd973(0x75),'whenToUse':'需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','pathParams':[],'queryParams':[],'bodySchema':a1_0x1fd973(0x80),'responseHighlights':[a1_0x1fd973(0x9a),a1_0x1fd973(0x98)],'examples':['lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress'],'notes':['CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.'],'markdown':[a1_0x1fd973(0xe0),'',a1_0x1fd973(0xe2)]['join']('\x0a')},{'code':a1_0x1fd973(0x76),'category':a1_0x1fd973(0xc5),'title':a1_0x1fd973(0xbc),'method':'GET','path':'/api/dataset/getOneByCode?code={datasetCode}','summary':a1_0x1fd973(0xa6),'whenToUse':a1_0x1fd973(0xd3),'pathParams':[],'queryParams':[{'name':a1_0x1fd973(0xa8),'description':a1_0x1fd973(0x7d)}],'bodySchema':a1_0x1fd973(0xa3),'responseHighlights':[a1_0x1fd973(0xe7),a1_0x1fd973(0x71),a1_0x1fd973(0x8e)],'examples':[a1_0x1fd973(0x8b)],'notes':['If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.'],'markdown':[a1_0x1fd973(0xd6),'',a1_0x1fd973(0xb3)]['join']('\x0a')},{'code':'dataset_data_filter','category':'dataset','title':a1_0x1fd973(0xc3),'method':'POST','path':a1_0x1fd973(0x7c),'summary':a1_0x1fd973(0xb7),'whenToUse':a1_0x1fd973(0xdb),'pathParams':[{'name':a1_0x1fd973(0xb9),'description':a1_0x1fd973(0x9f)},{'name':a1_0x1fd973(0xd9),'description':a1_0x1fd973(0x7d)}],'queryParams':[],'bodySchema':a1_0x1fd973(0xbd),'responseHighlights':[a1_0x1fd973(0xa9),'paging\x20contains\x20pagination'],'examples':[a1_0x1fd973(0x78),a1_0x1fd973(0xaf)],'notes':['where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.',a1_0x1fd973(0xab),a1_0x1fd973(0x8c)],'markdown':[a1_0x1fd973(0xd0),'','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.']['join']('\x0a')},{'code':a1_0x1fd973(0x7a),'category':a1_0x1fd973(0xc5),'title':a1_0x1fd973(0xd1),'method':'POST','path':a1_0x1fd973(0x91),'summary':a1_0x1fd973(0xba),'whenToUse':'需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','pathParams':[{'name':a1_0x1fd973(0xb9),'description':a1_0x1fd973(0x9f)},{'name':a1_0x1fd973(0xd9),'description':a1_0x1fd973(0x7d)}],'queryParams':[],'bodySchema':a1_0x1fd973(0xa5),'responseHighlights':[a1_0x1fd973(0xd8),'where\x20filters\x20before\x20aggregation'],'examples':[a1_0x1fd973(0x97)],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.',a1_0x1fd973(0x9b)],'markdown':['##\x20Aggregate\x20dataset\x20data','',a1_0x1fd973(0xbe)][a1_0x1fd973(0xcf)]('\x0a')},{'code':'dataset_data_get_one','category':a1_0x1fd973(0xc5),'title':a1_0x1fd973(0xd2),'method':'POST','path':'/api/{appCode}/{datasetCode}/getOne','summary':a1_0x1fd973(0xe9),'whenToUse':a1_0x1fd973(0xdc),'pathParams':[{'name':a1_0x1fd973(0xb9),'description':'Current\x20app\x20code'},{'name':a1_0x1fd973(0xd9),'description':a1_0x1fd973(0x7d)}],'queryParams':[],'bodySchema':a1_0x1fd973(0x9e),'responseHighlights':[a1_0x1fd973(0xc6)],'examples':[a1_0x1fd973(0x72)],'notes':[a1_0x1fd973(0xc0)],'markdown':a1_0x1fd973(0x86)},{'code':a1_0x1fd973(0x7f),'category':a1_0x1fd973(0xc5),'title':a1_0x1fd973(0xb5),'method':a1_0x1fd973(0x83),'path':a1_0x1fd973(0xc8),'summary':'创建数据','whenToUse':a1_0x1fd973(0xc2),'pathParams':[{'name':a1_0x1fd973(0xb9),'description':a1_0x1fd973(0x9f)},{'name':a1_0x1fd973(0xd9),'description':a1_0x1fd973(0x7d)}],'queryParams':[],'bodySchema':a1_0x1fd973(0xb2),'responseHighlights':[a1_0x1fd973(0x84)],'examples':[a1_0x1fd973(0x87)],'notes':[a1_0x1fd973(0xe5)],'markdown':a1_0x1fd973(0xc1)},{'code':'bf_detail','category':'bf','title':a1_0x1fd973(0xad),'method':a1_0x1fd973(0xda),'path':a1_0x1fd973(0x85),'summary':a1_0x1fd973(0x89),'whenToUse':a1_0x1fd973(0xa1),'pathParams':[{'name':a1_0x1fd973(0xb9),'description':'Current\x20app\x20code'},{'name':a1_0x1fd973(0xdf),'description':'Exact\x20endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':'None','responseHighlights':[a1_0x1fd973(0xa4)],'examples':['lovrabet\x20bff\x20detail\x20--name\x20<functionName>'],'notes':[a1_0x1fd973(0x79)],'markdown':a1_0x1fd973(0x93)},{'code':a1_0x1fd973(0xc7),'category':'bf','title':a1_0x1fd973(0x96),'method':'POST','path':'/api/endpoint/{appCode}/{functionName}','summary':a1_0x1fd973(0x95),'whenToUse':a1_0x1fd973(0x88),'pathParams':[{'name':'appCode','description':a1_0x1fd973(0x9f)},{'name':a1_0x1fd973(0xdf),'description':a1_0x1fd973(0xb4)}],'queryParams':[],'bodySchema':a1_0x1fd973(0xde),'responseHighlights':[a1_0x1fd973(0xea)],'examples':[a1_0x1fd973(0xd7)],'notes':[a1_0x1fd973(0xa7)],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':a1_0x1fd973(0xc4),'category':a1_0x1fd973(0xa2),'title':a1_0x1fd973(0xec),'method':'POST','path':'/api/custom/executeSql','summary':a1_0x1fd973(0x9c),'whenToUse':a1_0x1fd973(0xe4),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':[a1_0x1fd973(0xcd)],'notes':[a1_0x1fd973(0x90)],'markdown':a1_0x1fd973(0x99)}];function entrySummary(_0x103bb7){const _0x48530e=a1_0x1fd973;return{'code':_0x103bb7[_0x48530e(0xa8)],'category':_0x103bb7[_0x48530e(0xd4)],'method':_0x103bb7[_0x48530e(0x9d)],'path':_0x103bb7[_0x48530e(0x8f)],'summary':_0x103bb7[_0x48530e(0x94)],'whenToUse':_0x103bb7[_0x48530e(0x77)]};}export function listApiDocEntries(_0x3dd0a0={}){const _0xea0cb6=a1_0x1fd973,_0x2ef536=String(_0x3dd0a0[_0xea0cb6(0xd4)]||'')[_0xea0cb6(0xae)](),_0x38abc4=String(_0x3dd0a0[_0xea0cb6(0xe8)]||'')['trim']()[_0xea0cb6(0xbb)]();return DOCS[_0xea0cb6(0x81)](_0x30f207=>{const _0x530662=_0xea0cb6;if(_0x2ef536&&_0x30f207[_0x530662(0xd4)]!==_0x2ef536)return![];if(!_0x38abc4)return!![];return[_0x30f207[_0x530662(0xa8)],_0x30f207['category'],_0x30f207[_0x530662(0x9d)],_0x30f207['path'],_0x30f207[_0x530662(0x94)],_0x30f207[_0x530662(0x77)],_0x30f207['title']]['join']('\x20')[_0x530662(0xbb)]()[_0x530662(0xbf)](_0x38abc4);})[_0xea0cb6(0x8d)](entrySummary);}export function getApiDocDetail(_0x32ee33){const _0x466bfc=a1_0x1fd973,_0x1de11e=DOCS['find'](_0x29e31b=>_0x29e31b['code']===_0x32ee33);if(!_0x1de11e)throw CliErrors[_0x466bfc(0xe1)]('API\x20doc\x20code\x20not\x20found:\x20'+_0x32ee33);return{..._0x1de11e};}const apiDocList={'service':a1_0x1fd973(0xb1),'command':a1_0x1fd973(0x7e),'description':a1_0x1fd973(0xe6),'risk':'read','requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x9496a4){const _0x52b9b5=a1_0x1fd973,_0x1ad01a=listApiDocEntries({'category':_0x9496a4[_0x52b9b5(0x73)](_0x52b9b5(0xd4)),'keyword':_0x9496a4[_0x52b9b5(0x73)](_0x52b9b5(0xe8))});return{'ok':!![],'data':{'total':_0x1ad01a[_0x52b9b5(0xdd)],'items':_0x1ad01a}};}},apiDocDetail={'service':a1_0x1fd973(0xb1),'command':'detail','description':'Show\x20runtime\x20API\x20documentation\x20by\x20code','risk':a1_0x1fd973(0xeb),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x41041a){const _0x535f7a=a1_0x1fd973;return{'ok':!![],'data':getApiDocDetail(_0x41041a[_0x535f7a(0x73)]('code'))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];function a1_0xaf0a(_0x4de3cc,_0x1ff620){_0x4de3cc=_0x4de3cc-0x71;const _0x4eba6a=a1_0x4eba();let _0xaf0a3c=_0x4eba6a[_0x4de3cc];return _0xaf0a3c;}function a1_0x4eba(){const _0x3b3158=['lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','map','operations\x20describes\x20runtime\x20APIs','path','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','/api/{appCode}/{datasetCode}/aggregate','1421940oMUdtJ','##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.','summary','执行指定\x20BF\x20函数','Execute\x20BF\x20endpoint\x20function','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','paging.totalCount\x20gives\x20total\x20rows','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','tableData\x20contains\x20dataset\x20id/code/name','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','执行自定义\x20SQL','method','{\x22id\x22:123}','Current\x20app\x20code','7108WNsewB','已经从用户、平台\x20UI\x20或前序上下文确认函数名,需要查看该\x20ENDPOINT\x20的运行态元信息时使用','custom_sql','None','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','获取数据集详情','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','code','tableData\x20contains\x20records','59gDakLi','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','2051UnRSav','Get\x20BF\x20endpoint\x20function\x20contract','trim','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','4575267rqCKUH','api-doc','{\x22fieldName\x22:\x22value\x22}','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','Endpoint\x20function\x20name','Create\x20dataset\x20record','string','条件过滤查询数据','List\x20datasets','appCode','聚合查询数据集数据','toLowerCase','Dataset\x20detail','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','includes','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','需要向指定数据集新增一条业务数据时使用','Filter\x20dataset\x20data','custom_sql_execute','dataset','Returns\x20one\x20matching\x20business\x20record','bf_execute','/api/{appCode}/{datasetCode}/create','dataset_list','2101PfAynk','232whntKD','4380960vCPXWZ','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','85450orSyEL','join','##\x20Filter\x20dataset\x20data','Aggregate\x20dataset\x20data','Get\x20one\x20dataset\x20record','需要按数据集\x20code\x20获取字段、表信息、关联关系(relations)或操作定义时使用','category','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','##\x20Dataset\x20detail','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','result\x20rows\x20contain\x20aggregate\x20aliases','datasetCode','GET','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','length','{\x22param\x22:\x22value\x22}','functionName','##\x20List\x20datasets','validation','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','11298NSDthC','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','List\x20available\x20runtime\x20API\x20documentation\x20entries','fields/properties\x20describe\x20data\x20shape','keyword','查询单条数据','Returns\x20script\x20business\x20payload','read','Execute\x20custom\x20SQL','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','str','12144umUoCO','分页获取数据集列表','dataset_detail','whenToUse','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20BFF\x20functions\x20or\x20expose\x20platform-only\x20fields.','dataset_data_aggregate','/api/dataset/get-dataset-list-by-app-code','/api/{appCode}/{datasetCode}/filter','32-character\x20dataset\x20code','list','dataset_data_create','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','filter','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','POST','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','/client/bff/endpoint/{appCode}/{functionName}','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','已经确认目标\x20BF\x20的\x20functionName,且需要实际调用该\x20ENDPOINT\x20函数完成业务操作时使用','按应用和函数名精确获取\x20BF\x20运行契约','API\x20doc\x20code,\x20for\x20example\x20dataset_list'];a1_0x4eba=function(){return _0x3b3158;};return a1_0x4eba();}
@@ -1 +1 @@
1
- (function(_0x4290dd,_0x139a02){const _0x1c547f=a2_0x10f9,_0x2e592d=_0x4290dd();while(!![]){try{const _0x56be7b=parseInt(_0x1c547f(0xce))/0x1*(-parseInt(_0x1c547f(0xbd))/0x2)+-parseInt(_0x1c547f(0xb7))/0x3*(parseInt(_0x1c547f(0xbc))/0x4)+-parseInt(_0x1c547f(0xc2))/0x5*(-parseInt(_0x1c547f(0xc6))/0x6)+parseInt(_0x1c547f(0xb6))/0x7+-parseInt(_0x1c547f(0xc3))/0x8+-parseInt(_0x1c547f(0xbe))/0x9+parseInt(_0x1c547f(0xb9))/0xa*(parseInt(_0x1c547f(0xba))/0xb);if(_0x56be7b===_0x139a02)break;else _0x2e592d['push'](_0x2e592d['shift']());}catch(_0x24262e){_0x2e592d['push'](_0x2e592d['shift']());}}}(a2_0x1dcd,0xc12dd));import{createHash}from'node:crypto';function a2_0x1dcd(){const _0x460aad=['slice','.tmp','299202BpoGSa','appCode','isArray','EACCES','stringify','code','3195598DLdXwW','9sUBhLC','hex','60RNuxLx','2091386FIYeTO','cache','1534408WgdPnK','2hmGCjV','2909214VvzPPI','utf8','sha256','items','107050znwXwB','140920ZFFCBG','parse','appName','276QAgCEG','digest','unknown','trim','ak_','EPERM'];a2_0x1dcd=function(){return _0x460aad;};return a2_0x1dcd();}import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';function a2_0x10f9(_0x5ca3c3,_0x314ab3){_0x5ca3c3=_0x5ca3c3-0xb6;const _0x1dcd60=a2_0x1dcd();let _0x10f9c2=_0x1dcd60[_0x5ca3c3];return _0x10f9c2;}import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0xe17bcb){const _0x22620c=a2_0x10f9,_0x57755b=_0xe17bcb['trim'](),_0x558c38=_0x57755b['slice'](-0x6)||_0x22620c(0xc8),_0x1142ea=createHash(_0x22620c(0xc0))['update'](_0x57755b)[_0x22620c(0xc7)](_0x22620c(0xb8))[_0x22620c(0xcc)](0x0,0xc);return _0x22620c(0xca)+_0x558c38+'_'+_0x1142ea;}export function getAppCacheFilePath(_0x46ae13,_0x59d0bc){const _0x58dc7a=a2_0x10f9;return resolve(homedir(),PRODUCT_CONFIG['homeDirName'],_0x58dc7a(0xbb),_0x46ae13,fingerprintAccessKey(_0x59d0bc),'my-apps.json');}export function readCachedAppList(_0x103f1c,_0x5a0f49){const _0x29794d=a2_0x10f9;if(!_0x5a0f49?.[_0x29794d(0xc9)]())return null;const _0x21f74b=getAppCacheFilePath(_0x103f1c,_0x5a0f49);if(!existsSync(_0x21f74b))return null;try{const _0xebe780=readFileSync(_0x21f74b,_0x29794d(0xbf));if(!_0xebe780[_0x29794d(0xc9)]())return null;const _0x2ba7a5=JSON[_0x29794d(0xc4)](_0xebe780);if(!Array[_0x29794d(0xd0)](_0x2ba7a5[_0x29794d(0xc1)]))return null;return _0x2ba7a5;}catch{return null;}}export function writeCachedAppList(_0x11876c,_0x415b66,_0x2b755d){const _0x1cf3e6=a2_0x10f9,_0x3155b6=getAppCacheFilePath(_0x11876c,_0x415b66),_0xfda1b2=dirname(_0x3155b6);!existsSync(_0xfda1b2)&&mkdirSync(_0xfda1b2,{'recursive':!![]});const _0x27feb0=_0x3155b6+_0x1cf3e6(0xcd);try{writeFileSync(_0x27feb0,JSON[_0x1cf3e6(0xd2)](_0x2b755d,null,0x2)+'\x0a',{'encoding':_0x1cf3e6(0xbf),'mode':0x180});try{renameSync(_0x27feb0,_0x3155b6);}catch(_0x4093f2){if(_0x4093f2[_0x1cf3e6(0xd3)]===_0x1cf3e6(0xcb)||_0x4093f2['code']==='EXDEV'||_0x4093f2[_0x1cf3e6(0xd3)]===_0x1cf3e6(0xd1)){writeFileSync(_0x3155b6,JSON[_0x1cf3e6(0xd2)](_0x2b755d,null,0x2)+'\x0a',{'encoding':_0x1cf3e6(0xbf)});try{unlinkSync(_0x27feb0);}catch{}}else throw _0x4093f2;}}catch(_0x245d79){try{unlinkSync(_0x27feb0);}catch{}throw _0x245d79;}return _0x3155b6;}export function resolveCachedAppCode(_0x1e0b8f,_0x40e33a,_0xebb234){const _0x7387d3=a2_0x10f9;if(!_0x1e0b8f)return undefined;const _0x103f48=readCachedAppList(_0x40e33a,_0xebb234),_0x574f77=_0x103f48?.['items']['find'](_0x5a9553=>_0x5a9553[_0x7387d3(0xc5)]===_0x1e0b8f&&isRuntimeAccessibleApp(_0x5a9553));return _0x574f77?.[_0x7387d3(0xcf)]?.[_0x7387d3(0xc9)]()||undefined;}
1
+ function a2_0x3847(_0x125092,_0x2366ac){_0x125092=_0x125092-0xe7;const _0x29237f=a2_0x2923();let _0x3847d4=_0x29237f[_0x125092];return _0x3847d4;}(function(_0x1f22f7,_0x4cb0f4){const _0x1ecbdd=a2_0x3847,_0x3f3370=_0x1f22f7();while(!![]){try{const _0xcf2a7b=parseInt(_0x1ecbdd(0xff))/0x1*(-parseInt(_0x1ecbdd(0xfe))/0x2)+parseInt(_0x1ecbdd(0xee))/0x3*(parseInt(_0x1ecbdd(0xe9))/0x4)+-parseInt(_0x1ecbdd(0x104))/0x5*(parseInt(_0x1ecbdd(0xf2))/0x6)+-parseInt(_0x1ecbdd(0xe7))/0x7+-parseInt(_0x1ecbdd(0xeb))/0x8+-parseInt(_0x1ecbdd(0xfc))/0x9+parseInt(_0x1ecbdd(0xe8))/0xa*(parseInt(_0x1ecbdd(0xf9))/0xb);if(_0xcf2a7b===_0x4cb0f4)break;else _0x3f3370['push'](_0x3f3370['shift']());}catch(_0x340fce){_0x3f3370['push'](_0x3f3370['shift']());}}}(a2_0x2923,0x84d83));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(_0x240fd6){const _0x2ce238=a2_0x3847,_0x18a086=_0x240fd6['trim'](),_0x261a25=_0x18a086[_0x2ce238(0xf6)](-0x6)||_0x2ce238(0xea),_0x4ae7c8=createHash('sha256')[_0x2ce238(0xf7)](_0x18a086)[_0x2ce238(0x100)](_0x2ce238(0xf0))[_0x2ce238(0xf6)](0x0,0xc);return _0x2ce238(0xf8)+_0x261a25+'_'+_0x4ae7c8;}export function getAppCacheFilePath(_0x49ffc6,_0x26a0e7){const _0x269ad1=a2_0x3847;return resolve(homedir(),PRODUCT_CONFIG[_0x269ad1(0xfa)],_0x269ad1(0xf1),_0x49ffc6,fingerprintAccessKey(_0x26a0e7),_0x269ad1(0x102));}export function readCachedAppList(_0x40d3f3,_0x5949fd){const _0x189f71=a2_0x3847;if(!_0x5949fd?.['trim']())return null;const _0x6884f4=getAppCacheFilePath(_0x40d3f3,_0x5949fd);if(!existsSync(_0x6884f4))return null;try{const _0x3e1901=readFileSync(_0x6884f4,_0x189f71(0xfb));if(!_0x3e1901[_0x189f71(0xf3)]())return null;const _0x4b17a3=JSON['parse'](_0x3e1901);if(!Array[_0x189f71(0x106)](_0x4b17a3['items']))return null;return _0x4b17a3;}catch{return null;}}export function writeCachedAppList(_0xcff89e,_0x282c47,_0x51223e){const _0x4663f1=a2_0x3847,_0x1f94ff=getAppCacheFilePath(_0xcff89e,_0x282c47),_0x26ec39=dirname(_0x1f94ff);!existsSync(_0x26ec39)&&mkdirSync(_0x26ec39,{'recursive':!![]});const _0x590755=_0x1f94ff+_0x4663f1(0x103);try{writeFileSync(_0x590755,JSON['stringify'](_0x51223e,null,0x2)+'\x0a',{'encoding':_0x4663f1(0xfb),'mode':0x180});try{renameSync(_0x590755,_0x1f94ff);}catch(_0x69ba21){if(_0x69ba21[_0x4663f1(0xf5)]===_0x4663f1(0xed)||_0x69ba21[_0x4663f1(0xf5)]===_0x4663f1(0x101)||_0x69ba21[_0x4663f1(0xf5)]===_0x4663f1(0xef)){writeFileSync(_0x1f94ff,JSON[_0x4663f1(0xfd)](_0x51223e,null,0x2)+'\x0a',{'encoding':_0x4663f1(0xfb)});try{unlinkSync(_0x590755);}catch{}}else throw _0x69ba21;}}catch(_0x14acb9){try{unlinkSync(_0x590755);}catch{}throw _0x14acb9;}return _0x1f94ff;}function a2_0x2923(){const _0x55b31e=['572eyIRwT','homeDirName','utf8','1358181BHZLcF','stringify','68pasRSL','31601qnVUoI','digest','EXDEV','my-apps.json','.tmp','731110UyTVjE','items','isArray','3762724zDqfuZ','646090reOJqz','60020IJtxMp','unknown','7282144skeeiY','find','EPERM','30ogoIgX','EACCES','hex','cache','12IYGZgs','trim','appCode','code','slice','update','ak_'];a2_0x2923=function(){return _0x55b31e;};return a2_0x2923();}export function resolveCachedAppCode(_0x567cfa,_0x4e3359,_0x46f3c3){const _0x3bcd0f=a2_0x3847;if(!_0x567cfa)return undefined;const _0x37ae47=readCachedAppList(_0x4e3359,_0x46f3c3),_0x214b5c=_0x37ae47?.[_0x3bcd0f(0x105)][_0x3bcd0f(0xec)](_0x3745ec=>_0x3745ec['appName']===_0x567cfa&&isRuntimeAccessibleApp(_0x3745ec));return _0x214b5c?.[_0x3bcd0f(0xf4)]?.[_0x3bcd0f(0xf3)]()||undefined;}
@@ -1,14 +1,12 @@
1
1
  /**
2
- * @fileoverview `app` subcommand definitions — init, list, pull, use, import.
2
+ * @fileoverview `app` subcommand definitions — list, pull, import.
3
3
  *
4
4
  * Why a flat array of command objects: Lovrabet Runtime CLI uses the declarative
5
5
  * `CommandDefinition[]` registry pattern (not a switch-based handler). Each command
6
6
  * is a self-contained `CommandDefinition` that the framework runner dispatches.
7
7
  *
8
8
  * Commands:
9
- * - init: initialize a `.lovrabet.json` config file for the current scope
10
9
  * - list/pull: discover remote apps (cached) — read operations
11
- * - use: set fallback app candidate — write operation
12
10
  * - import: migrate from `.rabetbase.json` — write operation
13
11
  *
14
12
  * Why there is no `app add` / `app remove`: the runtime CLI does not manage
@@ -16,11 +14,9 @@
16
14
  * truth for platform apps, while `.lovrabet.json` may define local aliases under
17
15
  * `apps.<alias>.appcode` for operator-friendly names.
18
16
  *
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
17
+ * Workspace binding is intentionally owned by `workspace init/use`, not this
18
+ * service. Keeping one owner prevents duplicate command semantics in help and
19
+ * machine-readable schema output.
24
20
  */
25
21
  import type { CommandDefinition } from "../../framework/types.js";
26
22
  export declare const appDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- const a3_0x20c375=a3_0x3b4f;(function(_0x321f67,_0x541dd5){const _0x46cf2a=a3_0x3b4f,_0x1ce7cb=_0x321f67();while(!![]){try{const _0x5726fd=-parseInt(_0x46cf2a(0xd6))/0x1+-parseInt(_0x46cf2a(0x8b))/0x2+parseInt(_0x46cf2a(0xca))/0x3+-parseInt(_0x46cf2a(0xc3))/0x4+parseInt(_0x46cf2a(0x97))/0x5*(parseInt(_0x46cf2a(0xb3))/0x6)+-parseInt(_0x46cf2a(0xd4))/0x7+parseInt(_0x46cf2a(0xdc))/0x8;if(_0x5726fd===_0x541dd5)break;else _0x1ce7cb['push'](_0x1ce7cb['shift']());}catch(_0x1bba69){_0x1ce7cb['push'](_0x1ce7cb['shift']());}}}(a3_0x4d3e,0xd619c));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';function a3_0x3b4f(_0x237c79,_0x2bad00){_0x237c79=_0x237c79-0x8a;const _0x4d3e68=a3_0x4d3e();let _0x3b4f03=_0x4d3e68[_0x237c79];return _0x3b4f03;}import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';const GLOBAL_FLAG={'name':a3_0x20c375(0x9a),'type':a3_0x20c375(0x93),'description':'Use\x20global\x20config\x20scope','default':![]};function a3_0x4d3e(){const _0x5995d1=['.appcode\x20to\x20.lovrabet.json.','\x20is\x20deprecated.\x20Use\x20`','globalPath','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','read','Include\x20unpublished\x20apps\x20for\x20diagnostics','Usage:\x20','name','\x20app\x20use\x20<name>\x20[--global]','envName','project-default','isCurrent','Read\x20app\x20list\x20from\x20local\x20cache\x20only','no-cache','map','find','Read\x20from\x20local\x20cache\x20only','Default\x20app\x20candidate\x20set\x20to\x20\x22','fetchedAt','126eWCdjK','trim','local','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','validation','appOwnerName','cachePath','defaultApp','accessKey','已废弃:请使用\x20workspace\x20use\x20为当前目录绑定应用','Filter\x20by\x20environment\x20(default:\x20current\x20env)','appCode','use','\x20workspace\x20use\x20--app\x20<name>\x20[--env\x20daily]','env','../../commands/app/remote-source.js','1399692NNqSBA','langs','appPublishStatus','App\x20\x22','\x22\x20not\x20found.','Loaded\x20','Target\x20environment\x20(default:\x20current\x20env)','4775028eJELWo','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','remote','args','从平台刷新本地应用缓存','string','mergedCli','cache','appName','entries','1721797iLnOwi','source','1290141QONGjY','import','已废弃:请使用\x20workspace\x20init\x20为当前目录绑定应用','production','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','i18nInfo','281928PWeoaa','app','str','items','\x20app(s)\x20for\x20env=\x22','filter','Missing\x20app\x20name.','warn','pull','config','write','878524GjItOm','将从平台读取当前账号可用的应用列表,并覆盖对应环境的本地应用缓存;不会修改平台应用。','Remote\x20app\x20name\x20to\x20activate','将读取指定的\x20.rabetbase.json,并把其中可用的默认应用设置导入本地\x20.lovrabet.json;同名配置可能被更新。','将通过已废弃的\x20app\x20use\x20流程更新本地默认应用;建议改用\x20workspace\x20use。','Refreshed\x20app\x20cache\x20with\x20','nonInteractive','projectPath','boolean','length','../../context.js','appcode','375080DAnCFp','include-unpublished','init','global','join','Available\x20remote\x20apps:\x20','bool','../../commands/app/cache.js','enableI18n'];a3_0x4d3e=function(){return _0x5995d1;};return a3_0x4d3e();}function collectFlags(_0xaed0d5,_0x511dcd){const _0x3e23d3=a3_0x20c375,_0x52ee3b={};for(const _0x588231 of _0x511dcd){const _0x50dc06=_0x588231['type']===_0x3e23d3(0x93)?_0xaed0d5[_0x3e23d3(0x9d)](_0x588231[_0x3e23d3(0xa7)]):_0xaed0d5[_0x3e23d3(0xde)](_0x588231['name']);if(_0x50dc06!==''&&_0x50dc06!==![])_0x52ee3b[_0x588231[_0x3e23d3(0xa7)]]=_0x50dc06;}if(_0xaed0d5[_0x3e23d3(0x91)])_0x52ee3b[_0x3e23d3(0x91)]=!![];return _0x52ee3b;}function normalizeLanguages(_0x5f399a){const _0x453ae8=a3_0x20c375;if(!Array['isArray'](_0x5f399a))return[];return _0x5f399a[_0x453ae8(0xe1)](_0x5665e5=>typeof _0x5665e5==='string')[_0x453ae8(0xae)](_0x580642=>_0x580642[_0x453ae8(0xb4)]())[_0x453ae8(0xe1)](Boolean);}function buildRemoteAppI18nFields(_0x19893f){const _0x57deec=a3_0x20c375,_0x89fefc=normalizeLanguages(_0x19893f[_0x57deec(0xdb)]?.[_0x57deec(0xc4)]);return{'enableI18n':typeof _0x19893f[_0x57deec(0x9f)]===_0x57deec(0x93)?_0x19893f[_0x57deec(0x9f)]:null,'languages':_0x89fefc,'i18nInfo':_0x19893f[_0x57deec(0xdb)]?{..._0x19893f[_0x57deec(0xdb)],'langs':_0x89fefc[_0x57deec(0x94)]?_0x89fefc:null}:null};}const initDef={'service':a3_0x20c375(0xdd),'command':a3_0x20c375(0x99),'description':a3_0x20c375(0xd8),'risk':a3_0x20c375(0x8a),'confirmationDescription':'将通过已废弃的\x20app\x20init\x20流程写入本地\x20Lovrabet\x20应用配置;建议改用\x20workspace\x20init。','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x34c88d){const _0x513cbe=a3_0x20c375;return warnDeprecatedAppCommand(_0x513cbe(0x99),CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>\x20[--env\x20daily]'),await runInit(collectFlags(_0x34c88d,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x20c375(0xdd),'command':'list','description':a3_0x20c375(0xcb),'risk':a3_0x20c375(0xa4),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x20c375(0xc1),'type':'string','description':a3_0x20c375(0xbd),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a3_0x20c375(0x93),'description':a3_0x20c375(0xac),'default':![]},{'name':a3_0x20c375(0xad),'type':a3_0x20c375(0x93),'description':a3_0x20c375(0xda),'default':![]},{'name':a3_0x20c375(0x98),'type':'boolean','description':a3_0x20c375(0xa5),'default':![]}],async 'execute'(_0x3b6f21){const _0x1d8341=a3_0x20c375,_0x28cf8f=_0x3b6f21[_0x1d8341(0xde)](_0x1d8341(0xc1))||_0x3b6f21[_0x1d8341(0xa9)]||getEnv()||_0x1d8341(0xd9),_0x413af1=_0x3b6f21['bool'](_0x1d8341(0xb5)),_0x59d459=_0x3b6f21['bool']('no-cache'),_0x248407=_0x3b6f21[_0x1d8341(0x9d)](_0x1d8341(0x98)),{readRawConfigWithLayers:_0x3a0915,resolveDefaultAppSource:_0x4a1146,getLocalAppAliases:_0x472843}=await import(_0x1d8341(0x95)),{getRemoteAppList:_0x59d877}=await import(_0x1d8341(0xc2)),{config:_0x1dcbdf,layers:_0x126be7}=_0x3a0915(),_0x5c5399=_0x4a1146(_0x126be7),{defaultApp:_0x49f2d9}=_0x1dcbdf,_0x1cd4c6=await _0x59d877({'env':_0x28cf8f,'accessKey':_0x3b6f21['accessKey'],'localOnly':_0x413af1,'noCache':_0x59d459}),_0x154a98=_0x248407?_0x1cd4c6[_0x1d8341(0xdf)]:filterRuntimeAccessibleApps(_0x1cd4c6[_0x1d8341(0xdf)]),_0x50c3c0=_0x1cd4c6[_0x1d8341(0xdf)][_0x1d8341(0x94)]-_0x154a98['length'],_0x431304=_0x154a98[_0x1d8341(0xae)](_0x235e84=>{const _0x244f23=_0x1d8341;return{'name':_0x235e84['appName'],'appcode':_0x235e84['appCode'],'named':!![],'definedIn':_0x244f23(0xcc),'isDefault':_0x235e84[_0x244f23(0xd2)]===_0x49f2d9,...buildAppProfileListFields(_0x28cf8f),...buildRemoteAppI18nFields(_0x235e84),'source':_0x1cd4c6[_0x244f23(0xd5)],'owner':_0x235e84[_0x244f23(0xb8)]??null,'status':_0x235e84[_0x244f23(0xc5)]??null,'cachedAt':_0x1cd4c6[_0x244f23(0xb2)]};}),_0x457e7a=_0x472843(_0x1dcbdf);let _0x15d377=0x0;for(const [_0x379503,_0x252b50]of Object[_0x1d8341(0xd3)](_0x457e7a)){const _0x2675e9=typeof _0x252b50[_0x1d8341(0x96)]===_0x1d8341(0xcf)?_0x252b50[_0x1d8341(0x96)]['trim']():'';if(!_0x2675e9)continue;const _0x745c9=findAppByCode(_0x1cd4c6['items'],_0x2675e9);if(!_0x248407&&_0x745c9&&!isRuntimeAccessibleApp(_0x745c9))continue;_0x15d377+=0x1,_0x431304['push']({'name':_0x379503,'appcode':_0x2675e9,'named':!![],'definedIn':_0x1d8341(0xb5),'isDefault':_0x379503===_0x49f2d9,...buildAppProfileListFields(_0x28cf8f),'source':_0x1d8341(0xe5),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x431304,_0x3b6f21[_0x1d8341(0xd0)]);const _0x54da9c=_0x431304[_0x1d8341(0xaf)](_0x8a59a=>_0x8a59a[_0x1d8341(0xab)]===!![]),_0x3093a1=_0x49f2d9??_0x54da9c?.[_0x1d8341(0xa7)]??null,_0x5a27d6={'env':_0x28cf8f,'source':_0x1cd4c6[_0x1d8341(0xd5)],'fetchedAt':_0x1cd4c6[_0x1d8341(0xb2)],'cachePath':_0x1cd4c6[_0x1d8341(0xb9)],'globalPath':_0x126be7[_0x1d8341(0xa2)]??null,'projectPath':_0x126be7[_0x1d8341(0x92)]??null,'defaultApp':_0x3093a1,'defaultAppSource':_0x49f2d9!=null?_0x5c5399:null,'localAliasCount':_0x15d377,'remoteTotal':_0x1cd4c6[_0x1d8341(0xdf)][_0x1d8341(0x94)],'hiddenUnpublishedCount':_0x50c3c0,'includeUnpublished':_0x248407};if(_0x431304[_0x1d8341(0x94)]===0x0)return{'ok':!![],'data':{'items':_0x431304,'meta':_0x5a27d6},'message':_0x1cd4c6['source']===_0x1d8341(0xd1)?'No\x20cached\x20apps\x20found.':'No\x20apps\x20found\x20on\x20the\x20platform.'};return{'ok':!![],'data':{'items':_0x431304,'meta':_0x5a27d6}};}},pullDef={'service':a3_0x20c375(0xdd),'command':a3_0x20c375(0xe4),'description':a3_0x20c375(0xce),'risk':a3_0x20c375(0x8a),'confirmationDescription':a3_0x20c375(0x8c),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x20c375(0xc1),'type':a3_0x20c375(0xcf),'description':a3_0x20c375(0xc9),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x20c375(0xb5),'type':'boolean','description':a3_0x20c375(0xb0),'default':![]},{'name':a3_0x20c375(0xad),'type':a3_0x20c375(0x93),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x1cbe55){const _0x4f3848=a3_0x20c375,_0x528c7b=_0x1cbe55[_0x4f3848(0xde)](_0x4f3848(0xc1))||_0x1cbe55[_0x4f3848(0xa9)]||getEnv()||'production',_0x44597a=_0x1cbe55[_0x4f3848(0x9d)](_0x4f3848(0xb5)),_0x2dfb8e=_0x1cbe55[_0x4f3848(0x9d)](_0x4f3848(0xad)),{getRemoteAppList:_0x339f7c}=await import('../../commands/app/remote-source.js'),_0x199020=await _0x339f7c({'env':_0x528c7b,'accessKey':_0x1cbe55[_0x4f3848(0xbb)],'localOnly':_0x44597a,'noCache':_0x2dfb8e});return{'ok':!![],'data':{'total':_0x199020[_0x4f3848(0xdf)]['length'],'env':_0x528c7b,'source':_0x199020['source'],'fetchedAt':_0x199020[_0x4f3848(0xb2)],'cachePath':_0x199020[_0x4f3848(0xb9)]},'message':_0x199020[_0x4f3848(0xd5)]===_0x4f3848(0xd1)?_0x4f3848(0xc8)+_0x199020[_0x4f3848(0xdf)][_0x4f3848(0x94)]+'\x20cached\x20app(s)\x20for\x20env=\x22'+_0x528c7b+'\x22.':_0x4f3848(0x90)+_0x199020['items'][_0x4f3848(0x94)]+_0x4f3848(0xe0)+_0x528c7b+'\x22.'};}},useDef={'service':a3_0x20c375(0xdd),'command':a3_0x20c375(0xbf),'description':a3_0x20c375(0xbc),'risk':a3_0x20c375(0x8a),'confirmationDescription':a3_0x20c375(0x8f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'name','description':a3_0x20c375(0x8d),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x5d8add){const _0x4a8c7b=a3_0x20c375;if(!_0x5d8add['args'][0x0])throw CliErrors[_0x4a8c7b(0xb7)](_0x4a8c7b(0xe2),_0x4a8c7b(0xa6)+CLI_BIN_NAME+_0x4a8c7b(0xa8));},async 'execute'(_0x44155a){const _0x122950=a3_0x20c375;warnDeprecatedAppCommand(_0x122950(0xbf),CLI_BIN_NAME+_0x122950(0xc0));const _0x53a3a4=_0x44155a[_0x122950(0xcd)][0x0];if(!_0x53a3a4)throw CliErrors[_0x122950(0xb7)](_0x122950(0xe2),_0x122950(0xa6)+CLI_BIN_NAME+_0x122950(0xa8));const {buildConfigFromFlags:_0x4614e8,resolveLocalAppAliasCode:_0x285060}=await import('../../context.js'),{readCachedAppList:_0x18f8c6}=await import(_0x122950(0x9e)),_0x331af6=_0x44155a['str'](_0x122950(0xc1)),_0x27be16=_0x4614e8(_0x331af6?{'env':_0x331af6}:{}),_0x1029ad=_0x18f8c6(_0x27be16[_0x122950(0xc1)],_0x27be16[_0x122950(0xbb)]),_0x580f7a=_0x1029ad?.[_0x122950(0xdf)][_0x122950(0xaf)](_0x42c3cd=>_0x42c3cd['appName']===_0x53a3a4),_0x3d3898=_0x285060(_0x27be16['raw']??{},_0x53a3a4);if(_0x580f7a&&!isRuntimeAccessibleApp(_0x580f7a))throw runtimeInaccessibleAppError(_0x580f7a,'\x22'+_0x53a3a4+'\x22');if(_0x3d3898){const _0x20ab4f=_0x1029ad?.['items'][_0x122950(0xaf)](_0x3b25b6=>_0x3b25b6[_0x122950(0xbe)]?.[_0x122950(0xb4)]()===_0x3d3898);if(_0x20ab4f&&!isRuntimeAccessibleApp(_0x20ab4f))throw runtimeInaccessibleAppError(_0x20ab4f,'\x22'+_0x53a3a4+'\x22');}if(!_0x580f7a&&!_0x3d3898&&_0x27be16[_0x122950(0xba)]!==_0x53a3a4){const _0x2a7871=[..._0x1029ad?.[_0x122950(0xdf)][_0x122950(0xae)](_0x5636ce=>_0x5636ce['appName'])??[]],_0x4156bd=_0x2a7871['length']===0x0?'Use\x20`'+CLI_BIN_NAME+_0x122950(0xb6)+_0x53a3a4+_0x122950(0xa0):_0x122950(0x9c)+Array['from'](new Set(_0x2a7871))[_0x122950(0x9b)](',\x20')+_0x122950(0xa3);throw CliErrors['validation'](_0x122950(0xc6)+_0x53a3a4+_0x122950(0xc7),_0x4156bd);}const _0x297530=_0x44155a[_0x122950(0x9d)](_0x122950(0x9a));let _0x4bacea;if(_0x297530)_0x4bacea={'global':!![]};else{const {isInProject:_0x2d7d43}=await import(_0x122950(0x95)),_0x1cca5a=_0x2d7d43();_0x4bacea=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x122950(0xaa),'inProject':_0x1cca5a}));}const _0x36417b=readConfig(_0x4bacea);return _0x36417b['defaultApp']=_0x53a3a4,writeConfig(_0x36417b,_0x4bacea),{'ok':!![],'message':_0x122950(0xb1)+_0x53a3a4+'\x22'+scopeLabel(_0x4bacea)+'.'};}};function warnDeprecatedAppCommand(_0x352c01,_0x2a48f3){const _0x18bec3=a3_0x20c375;console[_0x18bec3(0xe3)](CLI_BIN_NAME+'\x20app\x20'+_0x352c01+_0x18bec3(0xa1)+_0x2a48f3+'`\x20instead.');}const importDef={'service':a3_0x20c375(0xdd),'command':a3_0x20c375(0xd7),'description':'从\x20.rabetbase.json\x20文件导入默认应用选择','risk':a3_0x20c375(0x8a),'confirmationDescription':a3_0x20c375(0x8e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x13a254){return await runInitImport(collectFlags(_0x13a254,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
1
+ const a3_0x1ff8f2=a3_0xb45b;(function(_0xde36c1,_0x197273){const _0x52aa45=a3_0xb45b,_0x365638=_0xde36c1();while(!![]){try{const _0x2b7692=parseInt(_0x52aa45(0xc5))/0x1*(parseInt(_0x52aa45(0xa7))/0x2)+parseInt(_0x52aa45(0xa4))/0x3+parseInt(_0x52aa45(0x8f))/0x4+-parseInt(_0x52aa45(0xc1))/0x5+-parseInt(_0x52aa45(0xbc))/0x6+-parseInt(_0x52aa45(0xb8))/0x7+parseInt(_0x52aa45(0x9d))/0x8;if(_0x2b7692===_0x197273)break;else _0x365638['push'](_0x365638['shift']());}catch(_0x3efa23){_0x365638['push'](_0x365638['shift']());}}}(a3_0x2861,0x8dfc1));import{appImportFlagDefs,runAppImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function collectFlags(_0x49a52b,_0x4a1c6a){const _0x50f2bd=a3_0xb45b,_0x10aa80={};for(const _0x38e08f of _0x4a1c6a){const _0x4700a6=_0x38e08f['type']===_0x50f2bd(0x92)?_0x49a52b[_0x50f2bd(0xb3)](_0x38e08f['name']):_0x49a52b[_0x50f2bd(0xb2)](_0x38e08f[_0x50f2bd(0xa0)]);if(_0x4700a6!==''&&_0x4700a6!==![])_0x10aa80[_0x38e08f[_0x50f2bd(0xa0)]]=_0x4700a6;}if(_0x49a52b['nonInteractive'])_0x10aa80[_0x50f2bd(0xb7)]=!![];return _0x10aa80;}function a3_0x2861(){const _0x4c3993=['isArray','envName','production','将读取指定的\x20.rabetbase.json,并把其中可用的默认应用设置导入本地\x20.lovrabet.json;同名配置可能被更新。','str','bool','source','Read\x20from\x20local\x20cache\x20only','从\x20.rabetbase.json\x20文件导入默认应用选择','nonInteractive','7249725EgxtmG','map','../../commands/app/remote-source.js','Filter\x20by\x20environment\x20(default:\x20current\x20env)','1408272thsUwX','fetchedAt','env','import','\x20cached\x20app(s)\x20for\x20env=\x22','4433595UKMOqD','从平台刷新本地应用缓存','isCurrent','remote','1WoCXvK','globalPath','filter','pull','appcode','entries','items','cachePath','trim','app','config','list','278936TjBJqf','local','Read\x20app\x20list\x20from\x20local\x20cache\x20only','boolean','cache','read','../../context.js','appOwnerName','push','length','\x20app(s)\x20for\x20env=\x22','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','No\x20cached\x20apps\x20found.','write','17232968gKmwOE','no-cache','将从平台读取当前账号可用的应用列表,并覆盖对应环境的本地应用缓存;不会修改平台应用。','name','i18nInfo','enableI18n','string','311112USsXmp','accessKey','appName','822232FqjbxB','mergedCli','find','appPublishStatus','Refreshed\x20app\x20cache\x20with\x20','No\x20apps\x20found\x20on\x20the\x20platform.','Include\x20unpublished\x20apps\x20for\x20diagnostics'];a3_0x2861=function(){return _0x4c3993;};return a3_0x2861();}function normalizeLanguages(_0x591c21){const _0xb7faf4=a3_0xb45b;if(!Array[_0xb7faf4(0xae)](_0x591c21))return[];return _0x591c21[_0xb7faf4(0xc7)](_0x41398d=>typeof _0x41398d===_0xb7faf4(0xa3))[_0xb7faf4(0xb9)](_0x499759=>_0x499759[_0xb7faf4(0x8b)]())[_0xb7faf4(0xc7)](Boolean);}function buildRemoteAppI18nFields(_0x4ca47b){const _0xe16b0a=a3_0xb45b,_0xef5508=normalizeLanguages(_0x4ca47b[_0xe16b0a(0xa1)]?.['langs']);return{'enableI18n':typeof _0x4ca47b[_0xe16b0a(0xa2)]===_0xe16b0a(0x92)?_0x4ca47b[_0xe16b0a(0xa2)]:null,'languages':_0xef5508,'i18nInfo':_0x4ca47b[_0xe16b0a(0xa1)]?{..._0x4ca47b[_0xe16b0a(0xa1)],'langs':_0xef5508[_0xe16b0a(0x98)]?_0xef5508:null}:null};}const listDef={'service':a3_0x1ff8f2(0x8c),'command':a3_0x1ff8f2(0x8e),'description':'List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','risk':a3_0x1ff8f2(0x94),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':'env','type':'string','description':a3_0x1ff8f2(0xbb),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a3_0x1ff8f2(0x92),'description':a3_0x1ff8f2(0x91),'default':![]},{'name':a3_0x1ff8f2(0x9e),'type':a3_0x1ff8f2(0x92),'description':a3_0x1ff8f2(0x9a),'default':![]},{'name':'include-unpublished','type':'boolean','description':a3_0x1ff8f2(0xad),'default':![]}],async 'execute'(_0x4069e4){const _0x463445=a3_0x1ff8f2,_0x3e6bed=_0x4069e4[_0x463445(0xb2)]('env')||_0x4069e4[_0x463445(0xaf)]||getEnv()||_0x463445(0xb0),_0x412117=_0x4069e4[_0x463445(0xb3)](_0x463445(0x90)),_0x37d60f=_0x4069e4[_0x463445(0xb3)](_0x463445(0x9e)),_0x10cf68=_0x4069e4[_0x463445(0xb3)]('include-unpublished'),{readRawConfigWithLayers:_0x3844cc,resolveDefaultAppSource:_0x3816ab,getLocalAppAliases:_0x2afc65}=await import(_0x463445(0x95)),{getRemoteAppList:_0x364d99}=await import(_0x463445(0xba)),{config:_0x594a6d,layers:_0xfd0226}=_0x3844cc(),_0x1231f4=_0x3816ab(_0xfd0226),{defaultApp:_0x512c23}=_0x594a6d,_0x34d070=await _0x364d99({'env':_0x3e6bed,'accessKey':_0x4069e4[_0x463445(0xa5)],'localOnly':_0x412117,'noCache':_0x37d60f}),_0x4a28b6=_0x10cf68?_0x34d070[_0x463445(0x89)]:filterRuntimeAccessibleApps(_0x34d070[_0x463445(0x89)]),_0x55f9f5=_0x34d070[_0x463445(0x89)][_0x463445(0x98)]-_0x4a28b6['length'],_0x3875c7=_0x4a28b6[_0x463445(0xb9)](_0x43a0b6=>{const _0x4723df=_0x463445;return{'name':_0x43a0b6[_0x4723df(0xa6)],'appcode':_0x43a0b6['appCode'],'named':!![],'definedIn':_0x4723df(0xc4),'isDefault':_0x43a0b6[_0x4723df(0xa6)]===_0x512c23,...buildAppProfileListFields(_0x3e6bed),...buildRemoteAppI18nFields(_0x43a0b6),'source':_0x34d070[_0x4723df(0xb4)],'owner':_0x43a0b6[_0x4723df(0x96)]??null,'status':_0x43a0b6[_0x4723df(0xaa)]??null,'cachedAt':_0x34d070['fetchedAt']};}),_0x3c6c87=_0x2afc65(_0x594a6d);let _0x1ac82d=0x0;for(const [_0x5b3cc4,_0x2570d9]of Object[_0x463445(0xca)](_0x3c6c87)){const _0x2a40ef=typeof _0x2570d9[_0x463445(0xc9)]==='string'?_0x2570d9[_0x463445(0xc9)][_0x463445(0x8b)]():'';if(!_0x2a40ef)continue;const _0x4a76b7=findAppByCode(_0x34d070[_0x463445(0x89)],_0x2a40ef);if(!_0x10cf68&&_0x4a76b7&&!isRuntimeAccessibleApp(_0x4a76b7))continue;_0x1ac82d+=0x1,_0x3875c7[_0x463445(0x97)]({'name':_0x5b3cc4,'appcode':_0x2a40ef,'named':!![],'definedIn':'local','isDefault':_0x5b3cc4===_0x512c23,...buildAppProfileListFields(_0x3e6bed),'source':_0x463445(0x8d),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x3875c7,_0x4069e4[_0x463445(0xa8)]);const _0xafa2c5=_0x3875c7[_0x463445(0xa9)](_0x14392c=>_0x14392c[_0x463445(0xc3)]===!![]),_0x4c7459=_0x512c23??_0xafa2c5?.[_0x463445(0xa0)]??null,_0x367014={'env':_0x3e6bed,'source':_0x34d070[_0x463445(0xb4)],'fetchedAt':_0x34d070[_0x463445(0xbd)],'cachePath':_0x34d070['cachePath'],'globalPath':_0xfd0226[_0x463445(0xc6)]??null,'projectPath':_0xfd0226['projectPath']??null,'defaultApp':_0x4c7459,'defaultAppSource':_0x512c23!=null?_0x1231f4:null,'localAliasCount':_0x1ac82d,'remoteTotal':_0x34d070[_0x463445(0x89)][_0x463445(0x98)],'hiddenUnpublishedCount':_0x55f9f5,'includeUnpublished':_0x10cf68};if(_0x3875c7[_0x463445(0x98)]===0x0)return{'ok':!![],'data':{'items':_0x3875c7,'meta':_0x367014},'message':_0x34d070[_0x463445(0xb4)]===_0x463445(0x93)?_0x463445(0x9b):_0x463445(0xac)};return{'ok':!![],'data':{'items':_0x3875c7,'meta':_0x367014}};}},pullDef={'service':a3_0x1ff8f2(0x8c),'command':a3_0x1ff8f2(0xc8),'description':a3_0x1ff8f2(0xc2),'risk':a3_0x1ff8f2(0x9c),'confirmationDescription':a3_0x1ff8f2(0x9f),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x1ff8f2(0xbe),'type':'string','description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x1ff8f2(0x90),'type':'boolean','description':a3_0x1ff8f2(0xb5),'default':![]},{'name':a3_0x1ff8f2(0x9e),'type':a3_0x1ff8f2(0x92),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x55800b){const _0x3fc4c0=a3_0x1ff8f2,_0x29b93b=_0x55800b[_0x3fc4c0(0xb2)]('env')||_0x55800b['envName']||getEnv()||_0x3fc4c0(0xb0),_0x1d13d3=_0x55800b[_0x3fc4c0(0xb3)](_0x3fc4c0(0x90)),_0x12c179=_0x55800b['bool']('no-cache'),{getRemoteAppList:_0x223310}=await import(_0x3fc4c0(0xba)),_0x6afba4=await _0x223310({'env':_0x29b93b,'accessKey':_0x55800b[_0x3fc4c0(0xa5)],'localOnly':_0x1d13d3,'noCache':_0x12c179});return{'ok':!![],'data':{'total':_0x6afba4[_0x3fc4c0(0x89)][_0x3fc4c0(0x98)],'env':_0x29b93b,'source':_0x6afba4[_0x3fc4c0(0xb4)],'fetchedAt':_0x6afba4[_0x3fc4c0(0xbd)],'cachePath':_0x6afba4[_0x3fc4c0(0x8a)]},'message':_0x6afba4[_0x3fc4c0(0xb4)]===_0x3fc4c0(0x93)?'Loaded\x20'+_0x6afba4['items']['length']+_0x3fc4c0(0xc0)+_0x29b93b+'\x22.':_0x3fc4c0(0xab)+_0x6afba4['items'][_0x3fc4c0(0x98)]+_0x3fc4c0(0x99)+_0x29b93b+'\x22.'};}},importDef={'service':a3_0x1ff8f2(0x8c),'command':a3_0x1ff8f2(0xbf),'description':a3_0x1ff8f2(0xb6),'risk':a3_0x1ff8f2(0x9c),'confirmationDescription':a3_0x1ff8f2(0xb1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x2a971e){return await runAppImport(collectFlags(_0x2a971e,appImportFlagDefs)),{'ok':!![]};}};function a3_0xb45b(_0x692285,_0x4c44e5){_0x692285=_0x692285-0x89;const _0x2861d2=a3_0x2861();let _0xb45b17=_0x2861d2[_0x692285];return _0xb45b17;}export const appDefinitions=[listDef,pullDef,importDef];
@@ -1 +1 @@
1
- (function(_0xb4ac9a,_0x943914){const _0xc6da71=a4_0x3cf9,_0x125afe=_0xb4ac9a();while(!![]){try{const _0x4d6f1e=parseInt(_0xc6da71(0x133))/0x1*(parseInt(_0xc6da71(0x12f))/0x2)+parseInt(_0xc6da71(0x134))/0x3*(-parseInt(_0xc6da71(0x12e))/0x4)+parseInt(_0xc6da71(0x137))/0x5+parseInt(_0xc6da71(0x126))/0x6+-parseInt(_0xc6da71(0x138))/0x7+-parseInt(_0xc6da71(0x129))/0x8+-parseInt(_0xc6da71(0x12a))/0x9*(-parseInt(_0xc6da71(0x130))/0xa);if(_0x4d6f1e===_0x943914)break;else _0x125afe['push'](_0x125afe['shift']());}catch(_0x3533da){_0x125afe['push'](_0x125afe['shift']());}}}(a4_0x35d6,0x663eb));import{CLI_BIN_NAME}from'../../constant/cli.js';function a4_0x3cf9(_0x5605bb,_0x5591ba){_0x5605bb=_0x5605bb-0x124;const _0x35d60a=a4_0x35d6();let _0x3cf920=_0x35d60a[_0x5605bb];return _0x3cf920;}import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';function a4_0x35d6(){const _0x240425=['16vuObgk','2030JKXJNe','3615860obBIYz','string','appCode','277FntkoV','516399jrqSuM','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','.\x20Publish\x20the\x20app\x20before\x20using\x20','433760ilHrzR','1963094NxOIUY','appPublishStatus','validation','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','3047982bIVUpU','Current\x20status:\x20','UNKNOWN','1690456LmuOsv','18bukQER','trim','appName','filter'];a4_0x35d6=function(){return _0x240425;};return a4_0x35d6();}import{CliErrors}from'../../errors.js';export function normalizeAppPublishStatus(_0x33de72){const _0x591fa1=a4_0x3cf9;if(typeof _0x33de72!==_0x591fa1(0x131))return null;const _0x2b42c7=_0x33de72[_0x591fa1(0x12b)]();return _0x2b42c7?_0x2b42c7['toUpperCase']():null;}export function isRuntimeAccessibleApp(_0x4ed307){const _0x5deead=a4_0x3cf9;return normalizeAppPublishStatus(_0x4ed307[_0x5deead(0x139)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x1709ce){const _0x4fc839=a4_0x3cf9;return _0x1709ce[_0x4fc839(0x12d)](isRuntimeAccessibleApp);}export function findAppByName(_0x4b33c3,_0x444fe3){const _0x1ff0b2=a4_0x3cf9;return _0x4b33c3['find'](_0x4b65dd=>_0x4b65dd[_0x1ff0b2(0x12c)]===_0x444fe3);}export function findAppByCode(_0x493fea,_0xba40f2){const _0x398249=a4_0x3cf9,_0x1f1d37=_0xba40f2[_0x398249(0x12b)]();if(!_0x1f1d37)return undefined;return _0x493fea['find'](_0x578882=>_0x578882[_0x398249(0x132)]?.[_0x398249(0x12b)]()===_0x1f1d37);}export function runtimeInaccessibleAppError(_0x5b2744,_0x372e39){const _0x1bcc6b=a4_0x3cf9,_0x3b1b70=normalizeAppPublishStatus(_0x5b2744[_0x1bcc6b(0x139)])??_0x1bcc6b(0x128);return CliErrors[_0x1bcc6b(0x124)]('App\x20'+_0x372e39+_0x1bcc6b(0x135),_0x1bcc6b(0x127)+_0x3b1b70+_0x1bcc6b(0x136)+CLI_BIN_NAME+_0x1bcc6b(0x125));}
1
+ function a4_0x1a2c(_0x10f705,_0x1b565c){_0x10f705=_0x10f705-0x197;const _0x49dc9a=a4_0x49dc();let _0x1a2c18=_0x49dc9a[_0x10f705];return _0x1a2c18;}(function(_0x39a397,_0x2e5af4){const _0x160d03=a4_0x1a2c,_0x32f815=_0x39a397();while(!![]){try{const _0x4922a3=-parseInt(_0x160d03(0x19b))/0x1*(-parseInt(_0x160d03(0x1a5))/0x2)+-parseInt(_0x160d03(0x19f))/0x3+parseInt(_0x160d03(0x1a7))/0x4+-parseInt(_0x160d03(0x1a8))/0x5*(-parseInt(_0x160d03(0x1a3))/0x6)+parseInt(_0x160d03(0x19e))/0x7*(-parseInt(_0x160d03(0x19d))/0x8)+parseInt(_0x160d03(0x1a6))/0x9+parseInt(_0x160d03(0x1a2))/0xa;if(_0x4922a3===_0x2e5af4)break;else _0x32f815['push'](_0x32f815['shift']());}catch(_0xd76b60){_0x32f815['push'](_0x32f815['shift']());}}}(a4_0x49dc,0xea0ce));import{CLI_BIN_NAME}from'../../constant/cli.js';import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';import{CliErrors}from'../../errors.js';function a4_0x49dc(){const _0x27f158=['appCode','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','.\x20Publish\x20the\x20app\x20before\x20using\x20','find','App\x20','327IjKlhz','filter','8nOsiOZ','9085685WvKtKw','4629900LJTdRJ','validation','trim','7391460dVCyAw','1519140bgOYeF','toUpperCase','11512zSTMNM','166518jDOXDE','3627500Olrbmx','5BsVHzf','appName','UNKNOWN'];a4_0x49dc=function(){return _0x27f158;};return a4_0x49dc();}export function normalizeAppPublishStatus(_0x5110d7){const _0x435d9b=a4_0x1a2c;if(typeof _0x5110d7!=='string')return null;const _0x5daded=_0x5110d7['trim']();return _0x5daded?_0x5daded[_0x435d9b(0x1a4)]():null;}export function isRuntimeAccessibleApp(_0x21b34c){return normalizeAppPublishStatus(_0x21b34c['appPublishStatus'])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x3bfb21){const _0x2c6c50=a4_0x1a2c;return _0x3bfb21[_0x2c6c50(0x19c)](isRuntimeAccessibleApp);}export function findAppByName(_0x285054,_0x4131c3){const _0x27ab09=a4_0x1a2c;return _0x285054[_0x27ab09(0x199)](_0x55c382=>_0x55c382[_0x27ab09(0x1a9)]===_0x4131c3);}export function findAppByCode(_0x5ac6d4,_0x3e6f5d){const _0xb851fd=a4_0x1a2c,_0x4003ac=_0x3e6f5d['trim']();if(!_0x4003ac)return undefined;return _0x5ac6d4[_0xb851fd(0x199)](_0x23207e=>_0x23207e[_0xb851fd(0x1ab)]?.[_0xb851fd(0x1a1)]()===_0x4003ac);}export function runtimeInaccessibleAppError(_0x1b42c2,_0x8fa7b0){const _0x2e26b8=a4_0x1a2c,_0x356a5d=normalizeAppPublishStatus(_0x1b42c2['appPublishStatus'])??_0x2e26b8(0x1aa);return CliErrors[_0x2e26b8(0x1a0)](_0x2e26b8(0x19a)+_0x8fa7b0+'\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','Current\x20status:\x20'+_0x356a5d+_0x2e26b8(0x198)+CLI_BIN_NAME+_0x2e26b8(0x197));}
@@ -1 +1 @@
1
- function a5_0x5198(){const _0x3ebbbc=['success','434508bSiYwu','55wePtyz','parse','errorCode','utf-8','tableData','4nMxlyg','786DsyFsQ','data','3316734sOHRom','24PLXQQT','288qOwfEj','../../../mock/app-list.json','1406163vSRmmo','2693TJDWBo','1311723OZKPsW','2711901BzOykW','7963880Kwrdan'];a5_0x5198=function(){return _0x3ebbbc;};return a5_0x5198();}(function(_0x27b86b,_0x2d94aa){const _0x2ec90a=a5_0x42a3,_0x4ea18e=_0x27b86b();while(!![]){try{const _0x3d90fa=-parseInt(_0x2ec90a(0x162))/0x1*(-parseInt(_0x2ec90a(0x16e))/0x2)+-parseInt(_0x2ec90a(0x164))/0x3*(parseInt(_0x2ec90a(0x16d))/0x4)+-parseInt(_0x2ec90a(0x168))/0x5*(parseInt(_0x2ec90a(0x167))/0x6)+parseInt(_0x2ec90a(0x163))/0x7+parseInt(_0x2ec90a(0x15e))/0x8*(-parseInt(_0x2ec90a(0x170))/0x9)+-parseInt(_0x2ec90a(0x165))/0xa+-parseInt(_0x2ec90a(0x161))/0xb*(-parseInt(_0x2ec90a(0x15f))/0xc);if(_0x3d90fa===_0x2d94aa)break;else _0x4ea18e['push'](_0x4ea18e['shift']());}catch(_0x32a8ff){_0x4ea18e['push'](_0x4ea18e['shift']());}}}(a5_0x5198,0xada1f));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 _0x8041b2=a5_0x42a3,_0x26ffb1=join(__dirname,_0x8041b2(0x160)),_0x2757ba=readFileSync(_0x26ffb1,_0x8041b2(0x16b));return JSON[_0x8041b2(0x169)](_0x2757ba);}let _cached=null;function a5_0x42a3(_0x20fa1c,_0x4d9a15){_0x20fa1c=_0x20fa1c-0x15e;const _0x519878=a5_0x5198();let _0x42a3d5=_0x519878[_0x20fa1c];return _0x42a3d5;}export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x324ca5=a5_0x42a3,_0x1d6f95=getMockAppList();if(!_0x1d6f95[_0x324ca5(0x166)])throw new Error('Mock\x20API\x20error:\x20'+_0x1d6f95['errorMsg']+'\x20('+_0x1d6f95[_0x324ca5(0x16a)]+')');return _0x1d6f95[_0x324ca5(0x16f)][_0x324ca5(0x16c)];}
1
+ (function(_0x5f1668,_0x592343){const _0x255d7f=a5_0x1dcf,_0x246f04=_0x5f1668();while(!![]){try{const _0x521920=-parseInt(_0x255d7f(0xd4))/0x1+-parseInt(_0x255d7f(0xd9))/0x2+-parseInt(_0x255d7f(0xd0))/0x3*(-parseInt(_0x255d7f(0xca))/0x4)+-parseInt(_0x255d7f(0xcd))/0x5*(-parseInt(_0x255d7f(0xcb))/0x6)+parseInt(_0x255d7f(0xda))/0x7+parseInt(_0x255d7f(0xd5))/0x8+-parseInt(_0x255d7f(0xd6))/0x9;if(_0x521920===_0x592343)break;else _0x246f04['push'](_0x246f04['shift']());}catch(_0x56d76a){_0x246f04['push'](_0x246f04['shift']());}}}(a5_0x1cdb,0x5a5f8));import{fileURLToPath}from'url';import{dirname,join}from'path';function a5_0x1dcf(_0x193086,_0x156da6){_0x193086=_0x193086-0xca;const _0x1cdb8b=a5_0x1cdb();let _0x1dcfc4=_0x1cdb8b[_0x193086];return _0x1dcfc4;}import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x478c68=a5_0x1dcf,_0x58595f=join(__dirname,_0x478c68(0xd3)),_0x5b3403=readFileSync(_0x58595f,_0x478c68(0xcf));return JSON['parse'](_0x5b3403);}let _cached=null;function a5_0x1cdb(){const _0x2c0366=['5113724uYFoPT','154568WFIcAE','112494KzPhvz','tableData','155TsNJAs','errorMsg','utf-8','6rMCwgj','Mock\x20API\x20error:\x20','success','../../../mock/app-list.json','292351XVtvGM','262144XVuMUq','2328048olMOgK','data','errorCode','1001224tzdgyB'];a5_0x1cdb=function(){return _0x2c0366;};return a5_0x1cdb();}export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x45a4a4=a5_0x1dcf,_0x589dfd=getMockAppList();if(!_0x589dfd[_0x45a4a4(0xd2)])throw new Error(_0x45a4a4(0xd1)+_0x589dfd[_0x45a4a4(0xce)]+'\x20('+_0x589dfd[_0x45a4a4(0xd8)]+')');return _0x589dfd[_0x45a4a4(0xd7)][_0x45a4a4(0xcc)];}
@@ -1 +1 @@
1
- (function(_0x3a7242,_0x33e9a1){const _0x17043b=a6_0x1912,_0x4b8c91=_0x3a7242();while(!![]){try{const _0x50facd=-parseInt(_0x17043b(0x9d))/0x1+-parseInt(_0x17043b(0x9e))/0x2+-parseInt(_0x17043b(0x9b))/0x3+parseInt(_0x17043b(0xa3))/0x4+parseInt(_0x17043b(0xa0))/0x5*(parseInt(_0x17043b(0xa4))/0x6)+parseInt(_0x17043b(0xa6))/0x7*(parseInt(_0x17043b(0xa8))/0x8)+-parseInt(_0x17043b(0x9f))/0x9;if(_0x50facd===_0x33e9a1)break;else _0x4b8c91['push'](_0x4b8c91['shift']());}catch(_0xd5aa06){_0x4b8c91['push'](_0x4b8c91['shift']());}}}(a6_0x1de5,0x56704));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 _0x599c6c=a6_0x1912,_0x40c232=(productEnv(_0x599c6c(0x9c))||'')[_0x599c6c(0x9a)]()[_0x599c6c(0xa1)]();return _0x40c232===_0x599c6c(0xa9);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}function a6_0x1de5(){const _0x15d742=['mock','remote','trim','1068633uzgHhZ','APP_LIST_SOURCE','549893HgDbqg','788508IEQlQl','2862522TGIUNV','15fRrDcj','toLowerCase','cache','2551780TnAzjl','1280148hhZYeE','items','3171DrnoTw','fetchedAt','12264MwvNLi'];a6_0x1de5=function(){return _0x15d742;};return a6_0x1de5();}function a6_0x1912(_0x5b2700,_0x3deca8){_0x5b2700=_0x5b2700-0x9a;const _0x1de560=a6_0x1de5();let _0x19129a=_0x1de560[_0x5b2700];return _0x19129a;}export async function getRemoteAppList(_0x324ad2){const _0x4f4011=a6_0x1912,{env:_0x145ff8,accessKey:_0x16921c,localOnly:localOnly=![],noCache:noCache=![]}=_0x324ad2,_0x239779=readCachedAppList(_0x145ff8,_0x16921c),_0xf3535=_0x16921c?.['trim']()?getAppCacheFilePath(_0x145ff8,_0x16921c):null;if(localOnly)return{'items':_0x239779?.[_0x4f4011(0xa5)]??[],'source':_0x4f4011(0xa2),'fetchedAt':_0x239779?.['fetchedAt']??null,'cachePath':_0xf3535};try{const _0x5cc930=await getRemoteAppItems(),_0xf62883=shouldUseMockRemoteApps()?_0x4f4011(0xa9):_0x4f4011(0xaa),_0x94cce1=new Date()['toISOString'](),_0x31a243=_0x16921c?.[_0x4f4011(0x9a)]()?writeCachedAppList(_0x145ff8,_0x16921c,{'env':_0x145ff8,'fetchedAt':_0x94cce1,'source':_0xf62883,'items':_0x5cc930}):null;return{'items':_0x5cc930,'source':_0xf62883,'fetchedAt':_0x94cce1,'cachePath':_0x31a243};}catch(_0x4ca84f){if(!noCache&&_0x239779)return{'items':_0x239779[_0x4f4011(0xa5)],'source':_0x4f4011(0xa2),'fetchedAt':_0x239779[_0x4f4011(0xa7)],'cachePath':_0xf3535};throw _0x4ca84f;}}
1
+ (function(_0x3e1e36,_0x5dce5b){const _0x5814f1=a6_0x2bb1,_0x5896ef=_0x3e1e36();while(!![]){try{const _0x13f54b=-parseInt(_0x5814f1(0x1e5))/0x1*(parseInt(_0x5814f1(0x1f4))/0x2)+parseInt(_0x5814f1(0x1f3))/0x3*(parseInt(_0x5814f1(0x1e3))/0x4)+parseInt(_0x5814f1(0x1f6))/0x5+parseInt(_0x5814f1(0x1f1))/0x6*(-parseInt(_0x5814f1(0x1f7))/0x7)+parseInt(_0x5814f1(0x1eb))/0x8+-parseInt(_0x5814f1(0x1e6))/0x9*(parseInt(_0x5814f1(0x1f0))/0xa)+parseInt(_0x5814f1(0x1f5))/0xb*(-parseInt(_0x5814f1(0x1e8))/0xc);if(_0x13f54b===_0x5dce5b)break;else _0x5896ef['push'](_0x5896ef['shift']());}catch(_0x94ae8){_0x5896ef['push'](_0x5896ef['shift']());}}}(a6_0x45d7,0x42f0f));import{getMyApps}from'../../core/api-client.js';function a6_0x2bb1(_0x17405f,_0x1cb031){_0x17405f=_0x17405f-0x1e3;const _0x45d7cf=a6_0x45d7();let _0x2bb13c=_0x45d7cf[_0x17405f];return _0x2bb13c;}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 _0x17441a=a6_0x2bb1,_0x15d507=(productEnv(_0x17441a(0x1ee))||'')[_0x17441a(0x1ec)]()[_0x17441a(0x1ed)]();return _0x15d507==='mock';}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}function a6_0x45d7(){const _0x3dfd92=['7WjyazU','40ceKEVz','cache','10161uTTqkA','28071uszbkz','mock','2532soxWAC','toISOString','items','1096168TGpGSd','trim','toLowerCase','APP_LIST_SOURCE','remote','250vXHINg','1353720drTQxH','fetchedAt','47409HWjZpY','26cFuSPV','4422SCTuaD','2498250ABSSAu'];a6_0x45d7=function(){return _0x3dfd92;};return a6_0x45d7();}export async function getRemoteAppList(_0x120cb0){const _0x4ba259=a6_0x2bb1,{env:_0x1e6dc7,accessKey:_0x13ecb0,localOnly:localOnly=![],noCache:noCache=![]}=_0x120cb0,_0x3ea5f5=readCachedAppList(_0x1e6dc7,_0x13ecb0),_0x426cc1=_0x13ecb0?.['trim']()?getAppCacheFilePath(_0x1e6dc7,_0x13ecb0):null;if(localOnly)return{'items':_0x3ea5f5?.['items']??[],'source':'cache','fetchedAt':_0x3ea5f5?.[_0x4ba259(0x1f2)]??null,'cachePath':_0x426cc1};try{const _0x15aecd=await getRemoteAppItems(),_0x4e9556=shouldUseMockRemoteApps()?_0x4ba259(0x1e7):_0x4ba259(0x1ef),_0x55d90e=new Date()[_0x4ba259(0x1e9)](),_0x3d7e63=_0x13ecb0?.['trim']()?writeCachedAppList(_0x1e6dc7,_0x13ecb0,{'env':_0x1e6dc7,'fetchedAt':_0x55d90e,'source':_0x4e9556,'items':_0x15aecd}):null;return{'items':_0x15aecd,'source':_0x4e9556,'fetchedAt':_0x55d90e,'cachePath':_0x3d7e63};}catch(_0x588eb5){if(!noCache&&_0x3ea5f5)return{'items':_0x3ea5f5[_0x4ba259(0x1ea)],'source':_0x4ba259(0x1e4),'fetchedAt':_0x3ea5f5[_0x4ba259(0x1f2)],'cachePath':_0x426cc1};throw _0x588eb5;}}
@@ -1,18 +1,11 @@
1
1
  /**
2
- * @fileoverview `app` subcommand shared utilities — re-exports and helpers.
3
- *
4
- * Why this module exists: several `app/` commands need the same helpers
5
- * (`readConfig`, `writeConfig`, `scopeLabel`, `enrichAppListItemsWithMergedSelection`).
6
- * Rather than each command importing from `context.ts` directly (which creates
7
- * coupling to the global env module), this module provides a stable re-export surface.
2
+ * @fileoverview Shared projection helper for `app list`.
8
3
  *
9
4
  * Design decision: `enrichAppListItemsWithMergedSelection` is placed here rather
10
5
  * than in `cache.ts` because it operates on the merged CLI snapshot from the
11
6
  * pipeline, not on the raw cache. This keeps cache.ts focused on cache I/O only.
12
7
  */
13
- import { CLI_BIN_NAME } from "../../constant/cli.js";
14
8
  import type { MergedCliSnapshot } from "../../framework/types.js";
15
- export { CLI_BIN_NAME };
16
9
  /**
17
10
  * Marks which app in the list is "current" based on the merged CLI snapshot.
18
11
  *
@@ -28,11 +21,3 @@ export { CLI_BIN_NAME };
28
21
  * @param merged - Merged CLI snapshot from the pipeline context
29
22
  */
30
23
  export declare function enrichAppListItemsWithMergedSelection(items: Record<string, unknown>[], merged: MergedCliSnapshot | undefined): void;
31
- export { readScopedConfig as readConfig, writeScopedConfig as writeConfig, isInProject } from "../../context.js";
32
- /**
33
- * Formats a human-readable scope label for console output.
34
- *
35
- * @param flags - Must contain a `global` boolean key
36
- * @returns Human label like " [global]" or "" (empty for project)
37
- */
38
- export declare function scopeLabel(flags: Record<string, any>): string;
@@ -1 +1 @@
1
- (function(_0x4927d6,_0x477ffb){const _0x2f619f=a7_0x221c,_0x54aacb=_0x4927d6();while(!![]){try{const _0x4199eb=parseInt(_0x2f619f(0x141))/0x1+-parseInt(_0x2f619f(0x14c))/0x2+parseInt(_0x2f619f(0x140))/0x3*(-parseInt(_0x2f619f(0x13b))/0x4)+parseInt(_0x2f619f(0x148))/0x5+-parseInt(_0x2f619f(0x151))/0x6*(parseInt(_0x2f619f(0x13f))/0x7)+parseInt(_0x2f619f(0x14f))/0x8*(parseInt(_0x2f619f(0x13c))/0x9)+-parseInt(_0x2f619f(0x143))/0xa*(parseInt(_0x2f619f(0x14d))/0xb);if(_0x4199eb===_0x477ffb)break;else _0x54aacb['push'](_0x54aacb['shift']());}catch(_0x46797d){_0x54aacb['push'](_0x54aacb['shift']());}}}(a7_0x4be8,0x855d6));import{CLI_BIN_NAME}from'../../constant/cli.js';function a7_0x221c(_0x327674,_0x4af551){_0x327674=_0x327674-0x13b;const _0x4be8cd=a7_0x4be8();let _0x221ce8=_0x4be8cd[_0x327674];return _0x221ce8;}import{formatScopeLabel}from'../../commands/common/config-policy.js';export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x349548,_0x29535d){const _0x446567=a7_0x221c;if(!_0x29535d)return;const _0x3e18cd=!!(_0x29535d['currentApp']??_0x29535d[_0x446567(0x145)]);for(const _0x5944a4 of _0x349548){_0x5944a4['isCurrent']=![];}const _0x4d754e=_0x29535d[_0x446567(0x13e)]!=null?String(_0x29535d[_0x446567(0x13e)])[_0x446567(0x142)]():'';if(_0x3e18cd){const _0x2fb623=_0x29535d[_0x446567(0x13d)]??_0x29535d[_0x446567(0x145)];if(_0x2fb623){const _0x2c4e94=_0x349548[_0x446567(0x150)](_0x591df5=>_0x591df5[_0x446567(0x144)]===!![]&&_0x591df5[_0x446567(0x14e)]===_0x2fb623&&_0x591df5[_0x446567(0x14b)]===_0x446567(0x147)),_0x3d0f7c=_0x2c4e94??_0x349548[_0x446567(0x150)](_0x1eb7ae=>_0x1eb7ae[_0x446567(0x144)]===!![]&&_0x1eb7ae['name']===_0x2fb623);if(_0x3d0f7c){const _0x33cf1e=String(_0x3d0f7c[_0x446567(0x14a)]??'')['trim']();if(!_0x4d754e||_0x33cf1e===_0x4d754e){_0x3d0f7c['isCurrent']=!![];return;}}}if(_0x4d754e){const _0x17552d=_0x349548[_0x446567(0x150)](_0xe1a264=>String(_0xe1a264[_0x446567(0x14a)]??'')[_0x446567(0x142)]()===_0x4d754e);_0x17552d&&(_0x17552d[_0x446567(0x146)]=!![]);}return;}if(!_0x4d754e)return;for(const _0x350091 of _0x349548){String(_0x350091[_0x446567(0x14a)]??'')['trim']()===_0x4d754e&&(_0x350091['isCurrent']=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';function a7_0x4be8(){const _0x467dfd=['find','12JTOfjK','61392CSKJZa','8253BLfXwl','currentApp','appCode','2231250wPlDiP','81PsWrtK','510346UgwKBj','trim','10SoqdPf','named','defaultApp','isCurrent','local','5123405zpcEka','global','appcode','definedIn','1243934HuTAzo','382217vzRvjW','name','6280hIkawd'];a7_0x4be8=function(){return _0x467dfd;};return a7_0x4be8();}export function scopeLabel(_0x46a74f){const _0x118bfd=a7_0x221c;return formatScopeLabel(_0x46a74f[_0x118bfd(0x149)]?_0x118bfd(0x149):'project');}
1
+ function a7_0x5847(_0x4e1b26,_0x3928c0){_0x4e1b26=_0x4e1b26-0x11f;const _0x366b20=a7_0x366b();let _0x584799=_0x366b20[_0x4e1b26];return _0x584799;}(function(_0x5eea77,_0x1aa10f){const _0x250eb4=a7_0x5847,_0x3d4498=_0x5eea77();while(!![]){try{const _0xa7da50=-parseInt(_0x250eb4(0x132))/0x1+parseInt(_0x250eb4(0x121))/0x2*(parseInt(_0x250eb4(0x133))/0x3)+-parseInt(_0x250eb4(0x12d))/0x4*(-parseInt(_0x250eb4(0x122))/0x5)+parseInt(_0x250eb4(0x124))/0x6+parseInt(_0x250eb4(0x131))/0x7*(-parseInt(_0x250eb4(0x127))/0x8)+parseInt(_0x250eb4(0x12b))/0x9*(-parseInt(_0x250eb4(0x12a))/0xa)+-parseInt(_0x250eb4(0x128))/0xb;if(_0xa7da50===_0x1aa10f)break;else _0x3d4498['push'](_0x3d4498['shift']());}catch(_0x3ecbc9){_0x3d4498['push'](_0x3d4498['shift']());}}}(a7_0x366b,0x43b01));function a7_0x366b(){const _0x5eefd8=['49701uJORFj','32169xwZuip','currentApp','isCurrent','88aiduSQ','2515uHcNNu','definedIn','2564112SNqxJy','appcode','find','161528tVQPKA','770022qDwzad','named','2070RJpHKp','20439RngZmF','name','708FSlMso','appCode','defaultApp','trim','42YjVoPu'];a7_0x366b=function(){return _0x5eefd8;};return a7_0x366b();}export function enrichAppListItemsWithMergedSelection(_0x4b0376,_0x56ab6f){const _0x276909=a7_0x5847;if(!_0x56ab6f)return;const _0x59da90=!!(_0x56ab6f[_0x276909(0x11f)]??_0x56ab6f[_0x276909(0x12f)]);for(const _0x44e151 of _0x4b0376){_0x44e151[_0x276909(0x120)]=![];}const _0x5f5345=_0x56ab6f[_0x276909(0x12e)]!=null?String(_0x56ab6f[_0x276909(0x12e)])[_0x276909(0x130)]():'';if(_0x59da90){const _0x4bc4ff=_0x56ab6f[_0x276909(0x11f)]??_0x56ab6f[_0x276909(0x12f)];if(_0x4bc4ff){const _0xd674dc=_0x4b0376[_0x276909(0x126)](_0xd0f60=>_0xd0f60[_0x276909(0x129)]===!![]&&_0xd0f60[_0x276909(0x12c)]===_0x4bc4ff&&_0xd0f60[_0x276909(0x123)]==='local'),_0x163bd7=_0xd674dc??_0x4b0376[_0x276909(0x126)](_0x99a57f=>_0x99a57f[_0x276909(0x129)]===!![]&&_0x99a57f[_0x276909(0x12c)]===_0x4bc4ff);if(_0x163bd7){const _0x372c36=String(_0x163bd7[_0x276909(0x125)]??'')[_0x276909(0x130)]();if(!_0x5f5345||_0x372c36===_0x5f5345){_0x163bd7[_0x276909(0x120)]=!![];return;}}}if(_0x5f5345){const _0x32f103=_0x4b0376[_0x276909(0x126)](_0x36fe85=>String(_0x36fe85[_0x276909(0x125)]??'')[_0x276909(0x130)]()===_0x5f5345);_0x32f103&&(_0x32f103[_0x276909(0x120)]=!![]);}return;}if(!_0x5f5345)return;for(const _0x3f84e4 of _0x4b0376){String(_0x3f84e4[_0x276909(0x125)]??'')[_0x276909(0x130)]()===_0x5f5345&&(_0x3f84e4[_0x276909(0x120)]=!![]);}}
@@ -1 +1 @@
1
- const a8_0x25668a=a8_0x764e;function a8_0x764e(_0x7af30f,_0x28a9ec){_0x7af30f=_0x7af30f-0x192;const _0x5bce3a=a8_0x5bce();let _0x764eac=_0x5bce3a[_0x7af30f];return _0x764eac;}(function(_0x355c1e,_0x281baf){const _0x498de9=a8_0x764e,_0x2e83a3=_0x355c1e();while(!![]){try{const _0x17cb5c=-parseInt(_0x498de9(0x1a3))/0x1*(parseInt(_0x498de9(0x1a7))/0x2)+-parseInt(_0x498de9(0x194))/0x3+-parseInt(_0x498de9(0x192))/0x4*(parseInt(_0x498de9(0x197))/0x5)+-parseInt(_0x498de9(0x1a8))/0x6+-parseInt(_0x498de9(0x193))/0x7*(-parseInt(_0x498de9(0x196))/0x8)+parseInt(_0x498de9(0x1a5))/0x9*(parseInt(_0x498de9(0x198))/0xa)+parseInt(_0x498de9(0x19c))/0xb;if(_0x17cb5c===_0x281baf)break;else _0x2e83a3['push'](_0x2e83a3['shift']());}catch(_0x3c1c96){_0x2e83a3['push'](_0x2e83a3['shift']());}}}(a8_0x5bce,0x4c120));function a8_0x5bce(){const _0x3ab0bc=['54459VZVbdG','App\x20config\x20key','4bSUMkp','1495674JiVIxp','\x20app-config\x20get\x20<key>','apiError','4QbvGec','3328577dtXIuD','321924YxlAsi','get','8UsZhOP','2364225prDWbP','70XpyVzK','appCode','trim',',\x20appCode=','13556378YmhsDU','app-config','validation','Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','Missing\x20app-config\x20key.','read','args','304625nLtNFu','key'];a8_0x5bce=function(){return _0x3ab0bc;};return a8_0x5bce();}import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':a8_0x25668a(0x19d),'command':a8_0x25668a(0x195),'description':a8_0x25668a(0x19f),'risk':a8_0x25668a(0x1a1),'args':[{'name':a8_0x25668a(0x1a4),'description':a8_0x25668a(0x1a6),'required':!![]}],'flags':[],async 'execute'(_0x38d960){const _0x22c063=a8_0x25668a,_0x526c3c=_0x38d960[_0x22c063(0x1a2)][0x0]?.[_0x22c063(0x19a)]();if(!_0x526c3c)throw CliErrors[_0x22c063(0x19e)](_0x22c063(0x1a0),'Usage:\x20'+CLI_BIN_NAME+_0x22c063(0x1a9));try{const _0x5bcdc7=await getRuntimeAppConfigByKey(_0x38d960[_0x22c063(0x199)],_0x526c3c);return{'ok':!![],'data':_0x5bcdc7};}catch{throw CliErrors[_0x22c063(0x1aa)]('Unable\x20to\x20get\x20app-config\x20value:\x20key='+_0x526c3c+_0x22c063(0x19b)+_0x38d960['appCode'],'Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.');}}};
1
+ const a8_0x59e470=a8_0x662c;(function(_0x28f848,_0x31c09f){const _0x5dbb27=a8_0x662c,_0x2f59be=_0x28f848();while(!![]){try{const _0x381e7a=parseInt(_0x5dbb27(0x207))/0x1+-parseInt(_0x5dbb27(0x209))/0x2*(parseInt(_0x5dbb27(0x1f1))/0x3)+-parseInt(_0x5dbb27(0x1fb))/0x4+parseInt(_0x5dbb27(0x204))/0x5*(parseInt(_0x5dbb27(0x1fa))/0x6)+parseInt(_0x5dbb27(0x1f2))/0x7*(parseInt(_0x5dbb27(0x1f4))/0x8)+parseInt(_0x5dbb27(0x1fc))/0x9*(-parseInt(_0x5dbb27(0x1fe))/0xa)+parseInt(_0x5dbb27(0x1f3))/0xb*(-parseInt(_0x5dbb27(0x1f6))/0xc);if(_0x381e7a===_0x31c09f)break;else _0x2f59be['push'](_0x2f59be['shift']());}catch(_0x474a6a){_0x2f59be['push'](_0x2f59be['shift']());}}}(a8_0x5348,0xc09fd));import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a8_0x5348(){const _0x5abf26=['args','validation','1299658CBykhj','apiError','1521334seZVqL','trim','3fxdBEf','9799657KRSQKa','671RNrJyz','8itCpDg','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','207804VQrJUY','Missing\x20app-config\x20key.','read','app-config','47262ApSteT','862368HFWGYj','1242trFDmm','Usage:\x20','61940xaXLUf','key',',\x20appCode=','Unable\x20to\x20get\x20app-config\x20value:\x20key=','App\x20config\x20key','Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','620ZxysCW'];a8_0x5348=function(){return _0x5abf26;};return a8_0x5348();}import{CLI_BIN_NAME}from'../../constant/cli.js';function a8_0x662c(_0x268de3,_0x4f309d){_0x268de3=_0x268de3-0x1f1;const _0x5348e8=a8_0x5348();let _0x662c1f=_0x5348e8[_0x268de3];return _0x662c1f;}export const appConfigGet={'service':a8_0x59e470(0x1f9),'command':'get','description':a8_0x59e470(0x203),'risk':a8_0x59e470(0x1f8),'args':[{'name':a8_0x59e470(0x1ff),'description':a8_0x59e470(0x202),'required':!![]}],'flags':[],async 'execute'(_0x18618b){const _0x4b63b9=a8_0x59e470,_0x4f5156=_0x18618b[_0x4b63b9(0x205)][0x0]?.[_0x4b63b9(0x20a)]();if(!_0x4f5156)throw CliErrors[_0x4b63b9(0x206)](_0x4b63b9(0x1f7),_0x4b63b9(0x1fd)+CLI_BIN_NAME+'\x20app-config\x20get\x20<key>');try{const _0x56e5ed=await getRuntimeAppConfigByKey(_0x18618b['appCode'],_0x4f5156);return{'ok':!![],'data':_0x56e5ed};}catch{throw CliErrors[_0x4b63b9(0x208)](_0x4b63b9(0x201)+_0x4f5156+_0x4b63b9(0x200)+_0x18618b['appCode'],_0x4b63b9(0x1f5));}}};
@@ -1 +1 @@
1
- function a9_0xfb63(_0x13c650,_0xe1c88){_0x13c650=_0x13c650-0x142;const _0x2bd931=a9_0x2bd9();let _0xfb6301=_0x2bd931[_0x13c650];return _0xfb6301;}(function(_0xe6768f,_0x1b6af2){const _0x16189b=a9_0xfb63,_0x4b6de9=_0xe6768f();while(!![]){try{const _0x460007=parseInt(_0x16189b(0x147))/0x1*(parseInt(_0x16189b(0x145))/0x2)+parseInt(_0x16189b(0x14b))/0x3+parseInt(_0x16189b(0x142))/0x4*(-parseInt(_0x16189b(0x146))/0x5)+parseInt(_0x16189b(0x149))/0x6*(-parseInt(_0x16189b(0x144))/0x7)+parseInt(_0x16189b(0x148))/0x8+parseInt(_0x16189b(0x14a))/0x9+-parseInt(_0x16189b(0x143))/0xa*(parseInt(_0x16189b(0x14c))/0xb);if(_0x460007===_0x1b6af2)break;else _0x4b6de9['push'](_0x4b6de9['shift']());}catch(_0x5e437e){_0x4b6de9['push'](_0x4b6de9['shift']());}}}(a9_0x2bd9,0x54bc5));import{appConfigGet}from'../../commands/app-config/get.js';export const appConfigDefinitions=[appConfigGet];function a9_0x2bd9(){const _0x35108e=['13605yDcTmg','17068fyycAn','4370784HfYpsH','6ipfTqP','3875967yCCxoj','578556jPkpPy','68739zRdxNg','1000RdeGPs','500wIkqiG','1558550RKLjAK','46YfJgCH'];a9_0x2bd9=function(){return _0x35108e;};return a9_0x2bd9();}
1
+ (function(_0x5987ce,_0x464924){const _0x231ec3=a9_0x3c12,_0x19ad2d=_0x5987ce();while(!![]){try{const _0x5927c9=parseInt(_0x231ec3(0x141))/0x1+parseInt(_0x231ec3(0x148))/0x2*(-parseInt(_0x231ec3(0x147))/0x3)+parseInt(_0x231ec3(0x143))/0x4+-parseInt(_0x231ec3(0x144))/0x5+-parseInt(_0x231ec3(0x146))/0x6+-parseInt(_0x231ec3(0x142))/0x7+parseInt(_0x231ec3(0x145))/0x8;if(_0x5927c9===_0x464924)break;else _0x19ad2d['push'](_0x19ad2d['shift']());}catch(_0x432164){_0x19ad2d['push'](_0x19ad2d['shift']());}}}(a9_0x1d87,0xe0a8c));function a9_0x3c12(_0x313431,_0x23e7dc){_0x313431=_0x313431-0x141;const _0x1d87c0=a9_0x1d87();let _0x3c12e4=_0x1d87c0[_0x313431];return _0x3c12e4;}function a9_0x1d87(){const _0x53fe35=['2868411pmNrgO','1216588NISelE','1642650iLdVFN','15908192eJpxzW','5104962pUbpMd','309LGSxhk','19498WnsXFA','1220810fhbcVy'];a9_0x1d87=function(){return _0x53fe35;};return a9_0x1d87();}import{appConfigGet}from'../../commands/app-config/get.js';export const appConfigDefinitions=[appConfigGet];
@@ -1 +1 @@
1
- const a10_0x59d29f=a10_0x1483;(function(_0x162723,_0xf66ce4){const _0x1e872=a10_0x1483,_0x420cb6=_0x162723();while(!![]){try{const _0x10330f=parseInt(_0x1e872(0xf2))/0x1*(-parseInt(_0x1e872(0xd6))/0x2)+parseInt(_0x1e872(0xd8))/0x3*(-parseInt(_0x1e872(0xff))/0x4)+parseInt(_0x1e872(0xd9))/0x5*(parseInt(_0x1e872(0xcf))/0x6)+-parseInt(_0x1e872(0xd3))/0x7+parseInt(_0x1e872(0xf7))/0x8*(parseInt(_0x1e872(0xce))/0x9)+-parseInt(_0x1e872(0xdf))/0xa+parseInt(_0x1e872(0x116))/0xb*(parseInt(_0x1e872(0xe7))/0xc);if(_0x10330f===_0xf66ce4)break;else _0x420cb6['push'](_0x420cb6['shift']());}catch(_0x3a41c3){_0x420cb6['push'](_0x420cb6['shift']());}}}(a10_0x1afb,0x55b9b));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a10_0x1afb(){const _0x3ebcbc=['appCode','length','AGENT','react-dom','boolean','number','保存新的\x20Artifact\x20源码并重新编译;应用中的内嵌模块展示和交互可能立即发生变化。','dayjs','Artifact\x20ID','2250189ImJakm','1604634fIvGGK','artifactType','create','Show\x20one\x20Artifact\x20by\x20id','3363255PCwhPG','name','test','10QDBVCM','Optional\x20favorite-state\x20filter','8349kiooGb','5GellOU','Artifact\x20source\x20file\x20is\x20blank.','compiledContent','favorite','--metadata\x20must\x20be\x20a\x20JSON\x20object.','.\x20Unsupported:\x20','642650mWFecd','/client/artifact/create','metadata','num','artifact','antd','根据本地源码文件更新\x20react_module\x20类型的\x20Artifact','startsWith','29556IuhHVF','react','source','Created\x20Artifact\x20','object','/update','utf8','body','parse','保存新的\x20Artifact\x20源码并进行编译;成功后将在当前应用中新增可展示的内嵌模块。','react_module','12757piizJS','detail','build','join','flag','8EXFsoA','some','write','file','str','includes','validation','File\x20not\x20found:\x20','76ERXPEQ','lodash','trim','isFile','createTime','updateTime','lastIndex','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','string','POST','Preview:\x20create\x20react_module\x20Artifact','bool','description','map','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','split','@ant-design/icons','data','isArray','add','/client/artifact/','exec','deleted','2211okHAYk','update','File\x20path\x20is\x20required.'];a10_0x1afb=function(){return _0x3ebcbc;};return a10_0x1afb();}const ARTIFACT_TYPE_REACT_MODULE=a10_0x59d29f(0xf1),ARTIFACT_SOURCE_AGENT=a10_0x59d29f(0x11b),ALLOWED_REACT_MODULE_IMPORTS=[a10_0x59d29f(0xe8),a10_0x59d29f(0x11c),a10_0x59d29f(0x100),a10_0x59d29f(0xcc),a10_0x59d29f(0xe4),a10_0x59d29f(0x10f)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a10_0x59d29f(0xf5)](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a10_0x59d29f(0xfa),'type':a10_0x59d29f(0x107),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file'},ARTIFACT_NAME_FLAG={'name':'name','type':a10_0x59d29f(0x107),'description':'Artifact\x20display\x20name'},METADATA_FLAG={'name':a10_0x59d29f(0xe1),'type':'string','description':a10_0x59d29f(0x106)};function isPlainObject(_0x1e0071){const _0x4ea60f=a10_0x59d29f;return typeof _0x1e0071===_0x4ea60f(0xeb)&&_0x1e0071!==null&&!Array[_0x4ea60f(0x111)](_0x1e0071);}function a10_0x1483(_0x247070,_0x4615b4){_0x247070=_0x247070-0xcc;const _0x1afb8b=a10_0x1afb();let _0x1483b9=_0x1afb8b[_0x247070];return _0x1483b9;}function readSourceFile(_0x573618){const _0xce5d53=a10_0x59d29f;if(!_0x573618)throw CliErrors[_0xce5d53(0xfd)](_0xce5d53(0x118));if(!existsSync(_0x573618))throw CliErrors[_0xce5d53(0xfd)](_0xce5d53(0xfe)+_0x573618);if(!statSync(_0x573618)[_0xce5d53(0x102)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x573618);const _0x22df48=readFileSync(_0x573618,_0xce5d53(0xed));return validateReactModuleSource(_0x22df48),_0x22df48;}function parseMetadata(_0x9d5b8a){const _0x46beec=a10_0x59d29f;if(!_0x9d5b8a)return undefined;let _0x474b4e;try{_0x474b4e=JSON[_0x46beec(0xef)](_0x9d5b8a);}catch{throw CliErrors[_0x46beec(0xfd)]('Invalid\x20JSON\x20for\x20--metadata:\x20'+_0x9d5b8a);}if(!isPlainObject(_0x474b4e))throw CliErrors[_0x46beec(0xfd)](_0x46beec(0xdd));const _0x176bb7={..._0x474b4e};return delete _0x176bb7['compiledContent'],_0x176bb7;}function getPackageName(_0x417922){const _0x14f0ff=a10_0x59d29f;if(_0x417922[_0x14f0ff(0xe6)]('@')){const [_0x2162fb,_0x40ec18]=_0x417922['split']('/');return _0x2162fb&&_0x40ec18?_0x2162fb+'/'+_0x40ec18:_0x417922;}return _0x417922[_0x14f0ff(0x10e)]('/')[0x0]||_0x417922;}function validateAllowedImports(_0x192c48){const _0x3c58e8=a10_0x59d29f,_0x9ee496=new Set();for(const _0x26cedb of IMPORT_SOURCE_PATTERNS){_0x26cedb[_0x3c58e8(0x105)]=0x0;let _0x4844fc;while((_0x4844fc=_0x26cedb[_0x3c58e8(0x114)](_0x192c48))!==null){const _0x24ecfe=_0x4844fc[0x1]?.[_0x3c58e8(0x101)]();_0x24ecfe&&_0x9ee496[_0x3c58e8(0x112)](_0x24ecfe);}}const _0x30f340=[..._0x9ee496][_0x3c58e8(0x10c)](getPackageName)['filter'](_0x2a9335=>!ALLOWED_REACT_MODULE_IMPORTS[_0x3c58e8(0xfc)](_0x2a9335));if(_0x30f340['length']>0x0)throw CliErrors[_0x3c58e8(0xfd)]('react_module\x20imports\x20are\x20limited\x20to:\x20'+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x3c58e8(0xde)+[...new Set(_0x30f340)][_0x3c58e8(0xf5)](',\x20'));}export function validateReactModuleSource(_0x1b8798){const _0x1e21f5=a10_0x59d29f;if(!_0x1b8798[_0x1e21f5(0x101)]())throw CliErrors[_0x1e21f5(0xfd)](_0x1e21f5(0xda));if(PAGE_LEVEL_PATTERNS[_0x1e21f5(0xf8)](_0x52d946=>_0x52d946[_0x1e21f5(0xd5)](_0x1b8798)))throw CliErrors['validation']('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x1b8798);}function buildArtifactInput(_0x4a4430){const _0x516018=a10_0x59d29f,_0x4d5ea7=readSourceFile(_0x4a4430['str'](_0x516018(0xfa))),_0x579560=_0x4a4430['str'](_0x516018(0xd4))[_0x516018(0x101)](),_0x37611c=parseMetadata(_0x4a4430[_0x516018(0xfb)](_0x516018(0xe1)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x579560?{'name':_0x579560}:{},'content':_0x4d5ea7,..._0x37611c?{'metadata':_0x37611c}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x56a130){const _0x292b24=a10_0x59d29f;return{'id':_0x56a130['id'],'name':_0x56a130['name'],'artifactType':_0x56a130[_0x292b24(0xd0)],'source':_0x56a130[_0x292b24(0xe9)],'favorite':_0x56a130[_0x292b24(0xdc)],'deleted':_0x56a130[_0x292b24(0x115)],'createTime':_0x56a130[_0x292b24(0x103)],'updateTime':_0x56a130[_0x292b24(0x104)]};}function detailArtifact(_0x46a51b){const _0x53e38a=a10_0x59d29f;return{'id':_0x46a51b['id'],'appCode':_0x46a51b[_0x53e38a(0x119)],'name':_0x46a51b['name'],'artifactType':_0x46a51b[_0x53e38a(0xd0)],'source':_0x46a51b[_0x53e38a(0xe9)],'favorite':_0x46a51b['favorite'],'deleted':_0x46a51b[_0x53e38a(0x115)],'content':_0x46a51b['content']??'','compiledContent':_0x46a51b[_0x53e38a(0xdb)],'metadata':_0x46a51b[_0x53e38a(0xe1)]??{},'createTime':_0x46a51b[_0x53e38a(0x103)],'updateTime':_0x46a51b[_0x53e38a(0x104)]};}function readFavoriteFlag(_0x13035b){const _0x5287be=a10_0x59d29f,_0x378155=_0x13035b[_0x5287be(0xf6)]('favorite');return _0x378155===undefined||_0x378155===null||_0x378155===''?undefined:_0x13035b[_0x5287be(0x10a)](_0x5287be(0xdc));}const artifactList={'service':a10_0x59d29f(0xe3),'command':'list','description':'List\x20current-app\x20react_module\x20Artifacts','risk':'read','flags':[{'name':a10_0x59d29f(0xe9),'type':a10_0x59d29f(0x107),'description':a10_0x59d29f(0x10d)},{'name':a10_0x59d29f(0xdc),'type':a10_0x59d29f(0x11d),'description':a10_0x59d29f(0xd7)},VERBOSE_FLAG],async 'execute'(_0x544439){const _0x3e8a23=a10_0x59d29f,_0x123d70=await listRuntimeArtifacts(_0x544439['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x544439[_0x3e8a23(0xfb)](_0x3e8a23(0xe9))?{'source':_0x544439[_0x3e8a23(0xfb)](_0x3e8a23(0xe9))}:{},...readFavoriteFlag(_0x544439)!==undefined?{'favorite':readFavoriteFlag(_0x544439)}:{}});return{'ok':!![],'data':{'total':_0x123d70[_0x3e8a23(0x11a)],'items':_0x544439[_0x3e8a23(0x10a)]('verbose')?_0x123d70:_0x123d70[_0x3e8a23(0x10c)](summarizeArtifact)}};}},artifactDetail={'service':a10_0x59d29f(0xe3),'command':a10_0x59d29f(0xf3),'description':a10_0x59d29f(0xd2),'risk':'read','flags':[{...ID_FLAG,'description':'Artifact\x20ID'}],async 'execute'(_0x134333){const _0x388bf1=a10_0x59d29f,_0x6df7c=await getRuntimeArtifact(_0x134333['num']('id'),_0x134333[_0x388bf1(0x119)]);return{'ok':!![],'data':detailArtifact(_0x6df7c)};}},artifactCreate={'service':'artifact','command':a10_0x59d29f(0xd1),'description':'根据本地源码文件创建\x20react_module\x20类型的\x20Artifact','risk':a10_0x59d29f(0xf9),'confirmationDescription':a10_0x59d29f(0xf0),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x4a5e15){const _0x248b70=a10_0x59d29f,_0x79cc7e=buildArtifactInput(_0x4a5e15),_0x1fbb0f=await createRuntimeArtifact(_0x4a5e15[_0x248b70(0x119)],_0x79cc7e);return{'ok':!![],'data':detailArtifact(_0x1fbb0f),'message':_0x248b70(0xea)+_0x1fbb0f['id']+(_0x1fbb0f[_0x248b70(0xd4)]?'\x20('+_0x1fbb0f[_0x248b70(0xd4)]+')':'')};},async 'dryRun'(_0x10cc9d){const _0x17508d=a10_0x59d29f,_0x3489df=buildArtifactInput(_0x10cc9d);return dryRun(_0x17508d(0x108),_0x17508d(0xe0))['body']({'appCode':_0x10cc9d[_0x17508d(0x119)],..._0x3489df})[_0x17508d(0x10b)](_0x17508d(0x109))[_0x17508d(0xf4)]();},'writeEventSubject'(_0x58c6d1){const _0x3763b1=a10_0x59d29f,_0x5cfbc1=_0x58c6d1[_0x3763b1(0x110)]?.['id'];if(typeof _0x5cfbc1!==_0x3763b1(0x107)&&typeof _0x5cfbc1!=='number')return undefined;return{'kind':_0x3763b1(0xe3),'id':String(_0x5cfbc1),'action':_0x3763b1(0xd1)};}},artifactUpdate={'service':a10_0x59d29f(0xe3),'command':a10_0x59d29f(0x117),'description':a10_0x59d29f(0xe5),'risk':'write','confirmationDescription':a10_0x59d29f(0x11f),'flags':[{...ID_FLAG,'description':a10_0x59d29f(0xcd)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0xf01e62){const _0x45d99c=a10_0x59d29f,_0x4f0f4a=_0xf01e62[_0x45d99c(0xe2)]('id'),_0x20f0e6=buildArtifactInput(_0xf01e62),_0x9fdb2d=await updateRuntimeArtifact(_0x4f0f4a,_0xf01e62[_0x45d99c(0x119)],_0x20f0e6);return{'ok':!![],'data':detailArtifact(_0x9fdb2d),'message':'Updated\x20Artifact\x20'+_0x9fdb2d['id']+(_0x9fdb2d[_0x45d99c(0xd4)]?'\x20('+_0x9fdb2d[_0x45d99c(0xd4)]+')':'')};},async 'dryRun'(_0x151e38){const _0x5dee3e=a10_0x59d29f,_0xf3b344=_0x151e38[_0x5dee3e(0xe2)]('id'),_0x58f959=buildArtifactInput(_0x151e38);return dryRun(_0x5dee3e(0x108),_0x5dee3e(0x113)+_0xf3b344+_0x5dee3e(0xec))[_0x5dee3e(0xee)]({'appCode':_0x151e38[_0x5dee3e(0x119)],..._0x58f959})[_0x5dee3e(0x10b)]('Preview:\x20update\x20react_module\x20Artifact\x20'+_0xf3b344)[_0x5dee3e(0xf4)]();},'writeEventSubject'(_0x5307a6){const _0x438e77=a10_0x59d29f,_0x3554c4=_0x5307a6[_0x438e77(0x110)]?.['id'];if(typeof _0x3554c4!==_0x438e77(0x107)&&typeof _0x3554c4!==_0x438e77(0x11e))return undefined;return{'kind':_0x438e77(0xe3),'id':String(_0x3554c4),'action':'update'};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
1
+ const a10_0x22321e=a10_0x2379;(function(_0x2929f3,_0x243e2d){const _0x2f53a0=a10_0x2379,_0x39ffc9=_0x2929f3();while(!![]){try{const _0x1b0719=-parseInt(_0x2f53a0(0x176))/0x1*(-parseInt(_0x2f53a0(0x14f))/0x2)+-parseInt(_0x2f53a0(0x143))/0x3+-parseInt(_0x2f53a0(0x177))/0x4+parseInt(_0x2f53a0(0x15e))/0x5+parseInt(_0x2f53a0(0x130))/0x6*(-parseInt(_0x2f53a0(0x13f))/0x7)+parseInt(_0x2f53a0(0x14c))/0x8*(-parseInt(_0x2f53a0(0x137))/0x9)+parseInt(_0x2f53a0(0x168))/0xa*(parseInt(_0x2f53a0(0x155))/0xb);if(_0x1b0719===_0x243e2d)break;else _0x39ffc9['push'](_0x39ffc9['shift']());}catch(_0x24657d){_0x39ffc9['push'](_0x39ffc9['shift']());}}}(a10_0x42a8,0x4df9e));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a10_0x22321e(0x178),ARTIFACT_SOURCE_AGENT='AGENT',ALLOWED_REACT_MODULE_IMPORTS=[a10_0x22321e(0x170),'react-dom','lodash',a10_0x22321e(0x12f),a10_0x22321e(0x163),a10_0x22321e(0x162)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a10_0x22321e(0x159)](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a10_0x22321e(0x131),'type':a10_0x22321e(0x16f),'required':!![],'description':a10_0x22321e(0x16a)},ARTIFACT_NAME_FLAG={'name':a10_0x22321e(0x126),'type':a10_0x22321e(0x16f),'description':a10_0x22321e(0x15c)},METADATA_FLAG={'name':'metadata','type':a10_0x22321e(0x16f),'description':a10_0x22321e(0x13e)};function isPlainObject(_0x274db6){const _0xf63863=a10_0x22321e;return typeof _0x274db6===_0xf63863(0x160)&&_0x274db6!==null&&!Array[_0xf63863(0x14e)](_0x274db6);}function readSourceFile(_0x2016a6){const _0x321539=a10_0x22321e;if(!_0x2016a6)throw CliErrors['validation'](_0x321539(0x13c));if(!existsSync(_0x2016a6))throw CliErrors['validation'](_0x321539(0x167)+_0x2016a6);if(!statSync(_0x2016a6)['isFile']())throw CliErrors['validation'](_0x321539(0x13b)+_0x2016a6);const _0x53bf74=readFileSync(_0x2016a6,_0x321539(0x169));return validateReactModuleSource(_0x53bf74),_0x53bf74;}function parseMetadata(_0x55f5a1){const _0x226c8e=a10_0x22321e;if(!_0x55f5a1)return undefined;let _0x3f54c8;try{_0x3f54c8=JSON[_0x226c8e(0x152)](_0x55f5a1);}catch{throw CliErrors[_0x226c8e(0x16c)](_0x226c8e(0x139)+_0x55f5a1);}if(!isPlainObject(_0x3f54c8))throw CliErrors['validation'](_0x226c8e(0x173));const _0xa29b13={..._0x3f54c8};return delete _0xa29b13[_0x226c8e(0x16b)],_0xa29b13;}function getPackageName(_0x8a68fa){const _0x33468f=a10_0x22321e;if(_0x8a68fa[_0x33468f(0x15a)]('@')){const [_0x207ba2,_0x59b623]=_0x8a68fa[_0x33468f(0x136)]('/');return _0x207ba2&&_0x59b623?_0x207ba2+'/'+_0x59b623:_0x8a68fa;}return _0x8a68fa[_0x33468f(0x136)]('/')[0x0]||_0x8a68fa;}function validateAllowedImports(_0x4a554c){const _0x1c558f=a10_0x22321e,_0x476cfc=new Set();for(const _0x22d89e of IMPORT_SOURCE_PATTERNS){_0x22d89e[_0x1c558f(0x127)]=0x0;let _0x1914bc;while((_0x1914bc=_0x22d89e['exec'](_0x4a554c))!==null){const _0x49da17=_0x1914bc[0x1]?.[_0x1c558f(0x12c)]();_0x49da17&&_0x476cfc[_0x1c558f(0x14d)](_0x49da17);}}const _0x5e9fc3=[..._0x476cfc]['map'](getPackageName)[_0x1c558f(0x149)](_0x3a7eab=>!ALLOWED_REACT_MODULE_IMPORTS[_0x1c558f(0x12e)](_0x3a7eab));if(_0x5e9fc3['length']>0x0)throw CliErrors[_0x1c558f(0x16c)]('react_module\x20imports\x20are\x20limited\x20to:\x20'+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x1c558f(0x161)+[...new Set(_0x5e9fc3)][_0x1c558f(0x159)](',\x20'));}export function validateReactModuleSource(_0x52ca4d){const _0x41845a=a10_0x22321e;if(!_0x52ca4d[_0x41845a(0x12c)]())throw CliErrors[_0x41845a(0x16c)]('Artifact\x20source\x20file\x20is\x20blank.');if(PAGE_LEVEL_PATTERNS[_0x41845a(0x16d)](_0x38ac0c=>_0x38ac0c['test'](_0x52ca4d)))throw CliErrors[_0x41845a(0x16c)](_0x41845a(0x171));validateAllowedImports(_0x52ca4d);}function buildArtifactInput(_0x546337){const _0x5aa8af=a10_0x22321e,_0x2f3154=readSourceFile(_0x546337['str']('file')),_0x2e888b=_0x546337[_0x5aa8af(0x14b)](_0x5aa8af(0x126))[_0x5aa8af(0x12c)](),_0x45984d=parseMetadata(_0x546337[_0x5aa8af(0x14b)](_0x5aa8af(0x128)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x2e888b?{'name':_0x2e888b}:{},'content':_0x2f3154,..._0x45984d?{'metadata':_0x45984d}:{},'source':ARTIFACT_SOURCE_AGENT};}function a10_0x2379(_0x354fbe,_0x50d5c5){_0x354fbe=_0x354fbe-0x126;const _0x42a8b7=a10_0x42a8();let _0x2379f7=_0x42a8b7[_0x354fbe];return _0x2379f7;}function summarizeArtifact(_0x4de8d3){const _0x388e9a=a10_0x22321e;return{'id':_0x4de8d3['id'],'name':_0x4de8d3[_0x388e9a(0x126)],'artifactType':_0x4de8d3[_0x388e9a(0x132)],'source':_0x4de8d3[_0x388e9a(0x141)],'favorite':_0x4de8d3['favorite'],'deleted':_0x4de8d3['deleted'],'createTime':_0x4de8d3[_0x388e9a(0x172)],'updateTime':_0x4de8d3[_0x388e9a(0x153)]};}function detailArtifact(_0x1508fe){const _0x3e6cf8=a10_0x22321e;return{'id':_0x1508fe['id'],'appCode':_0x1508fe[_0x3e6cf8(0x12a)],'name':_0x1508fe['name'],'artifactType':_0x1508fe[_0x3e6cf8(0x132)],'source':_0x1508fe['source'],'favorite':_0x1508fe['favorite'],'deleted':_0x1508fe[_0x3e6cf8(0x15d)],'content':_0x1508fe[_0x3e6cf8(0x129)]??'','compiledContent':_0x1508fe[_0x3e6cf8(0x16b)],'metadata':_0x1508fe[_0x3e6cf8(0x128)]??{},'createTime':_0x1508fe[_0x3e6cf8(0x172)],'updateTime':_0x1508fe[_0x3e6cf8(0x153)]};}function a10_0x42a8(){const _0x48b784=['648880nfWXDE','/update','object','.\x20Unsupported:\x20','@ant-design/icons','antd','根据本地源码文件创建\x20react_module\x20类型的\x20Artifact','num','Updated\x20Artifact\x20','File\x20not\x20found:\x20','30ucZBEH','utf8','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','compiledContent','validation','some','list','string','react','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','createTime','--metadata\x20must\x20be\x20a\x20JSON\x20object.','number','description','6ShSOgP','2506516KKMMft','react_module','name','lastIndex','metadata','content','appCode','Optional\x20favorite-state\x20filter','trim','create','includes','dayjs','6CYuaFc','file','artifactType','保存新的\x20Artifact\x20源码并重新编译;应用中的内嵌模块展示和交互可能立即发生变化。','update','build','split','333549HcVEoc','map','Invalid\x20JSON\x20for\x20--metadata:\x20','read','File\x20is\x20not\x20a\x20regular\x20file:\x20','File\x20path\x20is\x20required.','artifact','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','1955471gVQaQr','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','source','Artifact\x20ID','1366479SHFHAi','根据本地源码文件更新\x20react_module\x20类型的\x20Artifact','boolean','Show\x20one\x20Artifact\x20by\x20id','bool','body','filter','flag','str','112qKMpwE','add','isArray','101130gFBuJJ','data','detail','parse','updateTime','保存新的\x20Artifact\x20源码并进行编译;成功后将在当前应用中新增可展示的内嵌模块。','6477361lLCHUc','write','Created\x20Artifact\x20','favorite','join','startsWith','verbose','Artifact\x20display\x20name','deleted'];a10_0x42a8=function(){return _0x48b784;};return a10_0x42a8();}function readFavoriteFlag(_0xc86e48){const _0xbbccef=a10_0x22321e,_0x20663a=_0xc86e48[_0xbbccef(0x14a)](_0xbbccef(0x158));return _0x20663a===undefined||_0x20663a===null||_0x20663a===''?undefined:_0xc86e48[_0xbbccef(0x147)](_0xbbccef(0x158));}const artifactList={'service':'artifact','command':a10_0x22321e(0x16e),'description':'List\x20current-app\x20react_module\x20Artifacts','risk':a10_0x22321e(0x13a),'flags':[{'name':a10_0x22321e(0x141),'type':a10_0x22321e(0x16f),'description':a10_0x22321e(0x140)},{'name':a10_0x22321e(0x158),'type':a10_0x22321e(0x145),'description':a10_0x22321e(0x12b)},VERBOSE_FLAG],async 'execute'(_0x2e93d5){const _0x1855cc=a10_0x22321e,_0x364c0e=await listRuntimeArtifacts(_0x2e93d5['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x2e93d5[_0x1855cc(0x14b)](_0x1855cc(0x141))?{'source':_0x2e93d5['str']('source')}:{},...readFavoriteFlag(_0x2e93d5)!==undefined?{'favorite':readFavoriteFlag(_0x2e93d5)}:{}});return{'ok':!![],'data':{'total':_0x364c0e['length'],'items':_0x2e93d5[_0x1855cc(0x147)](_0x1855cc(0x15b))?_0x364c0e:_0x364c0e[_0x1855cc(0x138)](summarizeArtifact)}};}},artifactDetail={'service':a10_0x22321e(0x13d),'command':a10_0x22321e(0x151),'description':a10_0x22321e(0x146),'risk':a10_0x22321e(0x13a),'flags':[{...ID_FLAG,'description':a10_0x22321e(0x142)}],async 'execute'(_0x412b0e){const _0xd0187c=a10_0x22321e,_0x311db6=await getRuntimeArtifact(_0x412b0e[_0xd0187c(0x165)]('id'),_0x412b0e[_0xd0187c(0x12a)]);return{'ok':!![],'data':detailArtifact(_0x311db6)};}},artifactCreate={'service':a10_0x22321e(0x13d),'command':a10_0x22321e(0x12d),'description':a10_0x22321e(0x164),'risk':a10_0x22321e(0x156),'confirmationDescription':a10_0x22321e(0x154),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0xc76d97){const _0x48bd0a=a10_0x22321e,_0xdc03d4=buildArtifactInput(_0xc76d97),_0x30a1ff=await createRuntimeArtifact(_0xc76d97['appCode'],_0xdc03d4);return{'ok':!![],'data':detailArtifact(_0x30a1ff),'message':_0x48bd0a(0x157)+_0x30a1ff['id']+(_0x30a1ff[_0x48bd0a(0x126)]?'\x20('+_0x30a1ff['name']+')':'')};},async 'dryRun'(_0x24a460){const _0x6fa4e8=a10_0x22321e,_0x1cd890=buildArtifactInput(_0x24a460);return dryRun('POST','/client/artifact/create')[_0x6fa4e8(0x148)]({'appCode':_0x24a460['appCode'],..._0x1cd890})[_0x6fa4e8(0x175)]('Preview:\x20create\x20react_module\x20Artifact')['build']();},'writeEventSubject'(_0x36f13f){const _0x285e35=a10_0x22321e,_0x285157=_0x36f13f[_0x285e35(0x150)]?.['id'];if(typeof _0x285157!==_0x285e35(0x16f)&&typeof _0x285157!==_0x285e35(0x174))return undefined;return{'kind':_0x285e35(0x13d),'id':String(_0x285157),'action':_0x285e35(0x12d)};}},artifactUpdate={'service':a10_0x22321e(0x13d),'command':a10_0x22321e(0x134),'description':a10_0x22321e(0x144),'risk':a10_0x22321e(0x156),'confirmationDescription':a10_0x22321e(0x133),'flags':[{...ID_FLAG,'description':'Artifact\x20ID'},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x2054b9){const _0x28f584=a10_0x22321e,_0x5f57fc=_0x2054b9[_0x28f584(0x165)]('id'),_0x2e3acf=buildArtifactInput(_0x2054b9),_0x2299dc=await updateRuntimeArtifact(_0x5f57fc,_0x2054b9['appCode'],_0x2e3acf);return{'ok':!![],'data':detailArtifact(_0x2299dc),'message':_0x28f584(0x166)+_0x2299dc['id']+(_0x2299dc[_0x28f584(0x126)]?'\x20('+_0x2299dc['name']+')':'')};},async 'dryRun'(_0x5a0678){const _0x45fc9d=a10_0x22321e,_0x52961e=_0x5a0678[_0x45fc9d(0x165)]('id'),_0x1acca7=buildArtifactInput(_0x5a0678);return dryRun('POST','/client/artifact/'+_0x52961e+_0x45fc9d(0x15f))[_0x45fc9d(0x148)]({'appCode':_0x5a0678[_0x45fc9d(0x12a)],..._0x1acca7})['description']('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x52961e)[_0x45fc9d(0x135)]();},'writeEventSubject'(_0xacaace){const _0x3b4b4a=a10_0x22321e,_0x3dda2f=_0xacaace[_0x3b4b4a(0x150)]?.['id'];if(typeof _0x3dda2f!==_0x3b4b4a(0x16f)&&typeof _0x3dda2f!==_0x3b4b4a(0x174))return undefined;return{'kind':'artifact','id':String(_0x3dda2f),'action':_0x3b4b4a(0x134)};}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
@@ -1 +1 @@
1
- const a11_0x5eb9bb=a11_0x4b21;(function(_0x25e139,_0x556130){const _0x45a6c1=a11_0x4b21,_0x58347a=_0x25e139();while(!![]){try{const _0xbee202=parseInt(_0x45a6c1(0x9d))/0x1+-parseInt(_0x45a6c1(0xc6))/0x2*(parseInt(_0x45a6c1(0xab))/0x3)+-parseInt(_0x45a6c1(0xcf))/0x4*(parseInt(_0x45a6c1(0xd1))/0x5)+parseInt(_0x45a6c1(0xb6))/0x6+-parseInt(_0x45a6c1(0xbc))/0x7+parseInt(_0x45a6c1(0x9c))/0x8*(-parseInt(_0x45a6c1(0x93))/0x9)+-parseInt(_0x45a6c1(0xca))/0xa*(-parseInt(_0x45a6c1(0x82))/0xb);if(_0xbee202===_0x556130)break;else _0x58347a['push'](_0x58347a['shift']());}catch(_0x3ad4fe){_0x58347a['push'](_0x58347a['shift']());}}}(a11_0xe891,0x6885b));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x3f7135){const _0x6e36cd=a11_0x4b21;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x3f7135[_0x6e36cd(0x9b)](_0x6e36cd(0x85)),'explicitProject':_0x3f7135['bool'](_0x6e36cd(0xa4)),'policy':_0x6e36cd(0x84)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){return crypto['randomUUID']();}function a11_0x4b21(_0x4fb7a5,_0x13f6e5){_0x4fb7a5=_0x4fb7a5-0x82;const _0xe89109=a11_0xe891();let _0x4b21c6=_0xe89109[_0x4fb7a5];return _0x4b21c6;}export function buildDeviceAuthUrl(_0x40bc03,_0x192243,_0x424395='lovrabet-cli'){return _0x40bc03+'/device-auth?code='+encodeURIComponent(_0x192243)+'&source='+encodeURIComponent(_0x424395);}export function getDeviceCodePath(){const _0x53c989=a11_0x4b21;return homedir()+'/'+PRODUCT_CONFIG[_0x53c989(0xc9)]+_0x53c989(0x86);}export function readStoredDeviceCode(){const _0x3daa3a=a11_0x4b21,_0x127ecb=getDeviceCodePath();if(!existsSync(_0x127ecb))return null;try{const _0x42680f=readFileSync(_0x127ecb,{'encoding':_0x3daa3a(0xad)}),_0x54991a=JSON[_0x3daa3a(0xb4)](_0x42680f);if(_0x54991a&&typeof _0x54991a[_0x3daa3a(0xa7)]===_0x3daa3a(0xce)&&typeof _0x54991a[_0x3daa3a(0x94)]===_0x3daa3a(0xce)&&(_0x54991a[_0x3daa3a(0xbe)]===_0x3daa3a(0x85)||_0x54991a[_0x3daa3a(0xbe)]===_0x3daa3a(0xa4)))return _0x54991a;}catch{}return null;}export function writeStoredDeviceCode(_0x2828e0,_0x534388){const _0x297fca=a11_0x4b21,_0x460026=getDeviceCodePath(),_0x2fa9b1=dirname(_0x460026);!existsSync(_0x2fa9b1)&&mkdirSync(_0x2fa9b1,{'recursive':!![]});const _0x444d96={'code':_0x2828e0,'createdAt':new Date()[_0x297fca(0x83)](),'scope':_0x534388};writeFileSync(_0x460026,JSON[_0x297fca(0xae)](_0x444d96),{'encoding':_0x297fca(0xad),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x191d6d=getDeviceCodePath();try{unlinkSync(_0x191d6d);}catch{}}export function isStoredDeviceCodeExpired(_0x1f53b6){const _0x3e2318=a11_0x4b21;return Date[_0x3e2318(0x97)]()-new Date(_0x1f53b6[_0x3e2318(0x94)])[_0x3e2318(0xaf)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x40e5ea,_0x44db2e){const _0x1f756b=a11_0x4b21,_0x4332d9=_0x40e5ea+_0x1f756b(0xa6),_0x2ba007=new AbortController(),_0x6e135b=setTimeout(()=>_0x2ba007[_0x1f756b(0x8e)](),0x2710),_0x9b4476=await fetch(_0x4332d9,{'method':_0x1f756b(0xd3),'headers':{'Content-Type':_0x1f756b(0xc3)},'body':JSON[_0x1f756b(0xae)]({'code':_0x44db2e}),'signal':_0x2ba007[_0x1f756b(0xaa)]});clearTimeout(_0x6e135b);if(!_0x9b4476['ok'])throw CliErrors['networkError'](_0x1f756b(0xd2)+_0x9b4476[_0x1f756b(0x98)]);const _0x507cf1=await _0x9b4476[_0x1f756b(0x90)](),_0x504373=_0x507cf1['data']&&typeof _0x507cf1['data']===_0x1f756b(0x87)?_0x507cf1[_0x1f756b(0xcd)]:_0x507cf1;if(!_0x504373||typeof _0x504373['status']!==_0x1f756b(0xce))throw CliErrors[_0x1f756b(0xc7)](_0x1f756b(0xc0));return{'status':_0x504373['status'],'access_key':typeof _0x504373[_0x1f756b(0xb2)]===_0x1f756b(0xce)?_0x504373[_0x1f756b(0xb2)]:undefined};}export async function pollDeviceToken(_0x1d9fa9,_0x128bd1,_0x53a908){const _0x28cb15=a11_0x4b21;let _0x4c284d=0x0;for(let _0x3b10ef=0x0;_0x3b10ef<MAX_POLLS;_0x3b10ef++){if(_0x53a908[_0x28cb15(0xc5)])throw CliErrors['cancelled'](_0x28cb15(0x95));let _0x2cba52;try{_0x2cba52=await fetchDeviceToken(_0x1d9fa9,_0x128bd1);}catch(_0x596d02){if(_0x596d02 instanceof Error&&_0x596d02[_0x28cb15(0xb9)]==='AbortError')throw CliErrors[_0x28cb15(0xb3)](_0x28cb15(0x95));_0x4c284d++;if(_0x4c284d>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors['networkError'](_0x28cb15(0x8a));writeCliSideChannelLine(_0x28cb15(0x8c)+_0x4c284d+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x28cb15(0xa2)),await sleep(POLL_INTERVAL_MS);continue;}_0x4c284d=0x0;if(_0x2cba52[_0x28cb15(0x98)]===_0x28cb15(0xb5)){if(!_0x2cba52[_0x28cb15(0xb2)])throw CliErrors['apiError'](_0x28cb15(0x9a));return _0x2cba52[_0x28cb15(0xb2)];}if(_0x2cba52[_0x28cb15(0x98)]===_0x28cb15(0x9e)){deleteStoredDeviceCode();throw CliErrors[_0x28cb15(0x89)](_0x28cb15(0xa1));}const _0x51bb0c=(_0x3b10ef+0x1)*POLL_INTERVAL_MS,_0x48782f=DEVICE_CODE_TTL_MS-_0x51bb0c,_0x3946f4=Math[_0x28cb15(0xc2)](_0x48782f/0xea60),_0x266033=Math['floor'](_0x48782f%0xea60/0x3e8);process['stderr'][_0x28cb15(0xcb)]('\x0dWaiting\x20for\x20authorization...\x20'+_0x3946f4+':'+String(_0x266033)[_0x28cb15(0x96)](0x2,'0')+_0x28cb15(0xd4)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x28cb15(0x89)](_0x28cb15(0xcc));}function a11_0xe891(){const _0x1ed972=['\x20auth\x20status','scope','auth','Invalid\x20device\x20auth\x20response','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','floor','application/json','boolean','aborted','1028002vDCUjH','apiError','once','homeDirName','302060OPaYTi','write','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','data','string','28TvUmdO','log','448675IhMDOe','Device\x20auth\x20API\x20returned\x20HTTP\x20','POST','\x20remaining','Write\x20to\x20project\x20config','nonInteractive','319gHLeKc','toISOString','global-default','global','/.device-auth','object','通过设备码流程完成授权(在浏览器中操作,无需复制粘贴)','validation','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','removeListener','Device\x20auth\x20API\x20error\x20(','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','abort','accessKey','json','AccessKey\x20saved\x20to\x20','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','660753gaTcjD','createdAt','Device\x20authorization\x20cancelled.','padStart','now','status','device','Invalid\x20access_key\x20returned\x20by\x20server.','bool','24MIaZoA','855938gTdiDB','expired','After\x20authorizing,\x20re-run:\x20','str','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','),\x20retrying...','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','project','trim','/api/device-auth/token','code','source','SIGINT','signal','3skkuYl','Device\x20authorization\x20successful.','utf8','stringify','getTime','stderr','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','access_key','cancelled','parse','success','2167578bfDLrD','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','\x20auth\x20device','name','url-only','lovrabet-cli','2118585OoZqHa'];a11_0xe891=function(){return _0x1ed972;};return a11_0xe891();}function sleep(_0x58875b){return new Promise(_0x2dc3c2=>setTimeout(_0x2dc3c2,_0x58875b));}export const authDeviceDefinition={'service':a11_0x5eb9bb(0xbf),'command':a11_0x5eb9bb(0x99),'description':a11_0x5eb9bb(0x88),'risk':a11_0x5eb9bb(0xcb),'confirmationDescription':'将启动设备码授权流程;授权成功后会把获取到的\x20AccessKey\x20保存到所选\x20Lovrabet\x20配置。确认界面不会显示设备码或密钥。','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x5eb9bb(0x85),'type':'boolean','description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a11_0x5eb9bb(0xa4),'type':a11_0x5eb9bb(0xc4),'description':a11_0x5eb9bb(0xd5),'default':![]},{'name':a11_0x5eb9bb(0xa8),'type':'string','description':'App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','default':a11_0x5eb9bb(0xbb)},{'name':'url-only','type':a11_0x5eb9bb(0xc4),'description':a11_0x5eb9bb(0xc1),'default':![]}],async 'execute'(_0x1f4ce0){const _0x5c79ae=a11_0x5eb9bb,_0xaec4b7=resolveAuthScopeFlags(_0x1f4ce0),_0x365349=_0xaec4b7['global']?_0x5c79ae(0x85):_0x5c79ae(0xa4),_0x499770=readScopedConfig(_0xaec4b7);if(_0x499770['accessKey'])return{'ok':!![],'message':_0x5c79ae(0xa3)};const _0x39ca36=(_0x1f4ce0[_0x5c79ae(0xa0)](_0x5c79ae(0xa8))||_0x5c79ae(0xbb))[_0x5c79ae(0xa5)](),_0x4bd83b=getUserDomain(),_0xbe63f1=readStoredDeviceCode(),_0x1d4ec3=_0xbe63f1&&!isStoredDeviceCodeExpired(_0xbe63f1)?_0xbe63f1[_0x5c79ae(0xa7)]:((()=>{const _0x442333=generateDeviceCode();return writeStoredDeviceCode(_0x442333,_0x365349),_0x442333;})()),_0x2345e8=buildDeviceAuthUrl(_0x4bd83b,_0x1d4ec3,_0x39ca36);if(_0x1f4ce0[_0x5c79ae(0x9b)](_0x5c79ae(0xba)))return console[_0x5c79ae(0xd0)](_0x2345e8),{'ok':!![]};writeCliSideChannelLine(_0x5c79ae(0x8d)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x2345e8),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x5c79ae(0x92));if(_0x1f4ce0[_0x5c79ae(0xd6)])return writeCliSideChannelLine(_0x5c79ae(0x9f)+CLI_BIN_NAME+_0x5c79ae(0xb8)),{'ok':!![],'message':_0x5c79ae(0xb7)};writeCliSideChannelLine(_0x5c79ae(0xb1));const _0x5c6907=new AbortController(),_0x48cac4=()=>{const _0x31c69e=_0x5c79ae;_0x5c6907[_0x31c69e(0x8e)](),process['removeListener'](_0x31c69e(0xa9),_0x48cac4);};process[_0x5c79ae(0xc8)](_0x5c79ae(0xa9),_0x48cac4);let _0x4d8a3b;try{_0x4d8a3b=await pollDeviceToken(_0x4bd83b,_0x1d4ec3,_0x5c6907['signal']);}finally{process[_0x5c79ae(0x8b)]('SIGINT',_0x48cac4);}if(!ACCESS_KEY_PATTERN['test'](_0x4d8a3b))throw CliErrors[_0x5c79ae(0xc7)]('Invalid\x20access_key\x20returned\x20by\x20server.');const _0x519fd2=readScopedConfig(_0xaec4b7);return _0x519fd2[_0x5c79ae(0x8f)]=_0x4d8a3b,writeScopedConfig(_0x519fd2,_0xaec4b7),deleteStoredDeviceCode(),process[_0x5c79ae(0xb0)]['write']('\x0a'),writeCliSideChannelLine(_0x5c79ae(0x91)+_0x365349+'\x20config.'),writeCliSideChannelLine('Verify:\x20'+CLI_BIN_NAME+_0x5c79ae(0xbd)),{'ok':!![],'message':_0x5c79ae(0xac)};}};
1
+ const a11_0x98e480=a11_0xd2f6;(function(_0xfcab9b,_0x153158){const _0x2fa53b=a11_0xd2f6,_0x466376=_0xfcab9b();while(!![]){try{const _0x37b165=parseInt(_0x2fa53b(0x19d))/0x1+parseInt(_0x2fa53b(0x196))/0x2+-parseInt(_0x2fa53b(0x185))/0x3+parseInt(_0x2fa53b(0x199))/0x4+-parseInt(_0x2fa53b(0x1a5))/0x5+parseInt(_0x2fa53b(0x161))/0x6*(-parseInt(_0x2fa53b(0x169))/0x7)+-parseInt(_0x2fa53b(0x160))/0x8*(-parseInt(_0x2fa53b(0x177))/0x9);if(_0x37b165===_0x153158)break;else _0x466376['push'](_0x466376['shift']());}catch(_0x3d13c0){_0x466376['push'](_0x466376['shift']());}}}(a11_0x4806,0xe1aa8));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x2a2adf){const _0x286632=a11_0xd2f6;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x2a2adf[_0x286632(0x1a3)](_0x286632(0x184)),'explicitProject':_0x2a2adf['bool'](_0x286632(0x170)),'policy':_0x286632(0x16b)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){const _0x5f3a56=a11_0xd2f6;return crypto[_0x5f3a56(0x166)]();}export function buildDeviceAuthUrl(_0x522d55,_0x3d6a89,_0x1dc170=a11_0x98e480(0x16c)){const _0x847783=a11_0x98e480;return _0x522d55+_0x847783(0x16a)+encodeURIComponent(_0x3d6a89)+_0x847783(0x195)+encodeURIComponent(_0x1dc170);}export function getDeviceCodePath(){const _0x154c5a=a11_0x98e480;return homedir()+'/'+PRODUCT_CONFIG['homeDirName']+_0x154c5a(0x183);}export function readStoredDeviceCode(){const _0x409d1b=a11_0x98e480,_0x5c58f2=getDeviceCodePath();if(!existsSync(_0x5c58f2))return null;try{const _0x412d75=readFileSync(_0x5c58f2,{'encoding':_0x409d1b(0x175)}),_0x24c58b=JSON['parse'](_0x412d75);if(_0x24c58b&&typeof _0x24c58b[_0x409d1b(0x168)]==='string'&&typeof _0x24c58b['createdAt']==='string'&&(_0x24c58b[_0x409d1b(0x19a)]===_0x409d1b(0x184)||_0x24c58b[_0x409d1b(0x19a)]==='project'))return _0x24c58b;}catch{}return null;}export function writeStoredDeviceCode(_0x31a2b8,_0x3deb82){const _0x4798f5=a11_0x98e480,_0x7539ac=getDeviceCodePath(),_0x1800dd=dirname(_0x7539ac);!existsSync(_0x1800dd)&&mkdirSync(_0x1800dd,{'recursive':!![]});const _0xa1a36d={'code':_0x31a2b8,'createdAt':new Date()['toISOString'](),'scope':_0x3deb82};writeFileSync(_0x7539ac,JSON[_0x4798f5(0x1a8)](_0xa1a36d),{'encoding':_0x4798f5(0x175),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x1d49e1=getDeviceCodePath();try{unlinkSync(_0x1d49e1);}catch{}}export function isStoredDeviceCodeExpired(_0x58698a){const _0x1c436d=a11_0x98e480;return Date['now']()-new Date(_0x58698a[_0x1c436d(0x182)])[_0x1c436d(0x194)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x29c053,_0x25afca){const _0xdfdeaa=a11_0x98e480,_0xcdf667=_0x29c053+'/api/device-auth/token',_0x24699c=new AbortController(),_0x597e5e=setTimeout(()=>_0x24699c['abort'](),0x2710),_0x21b37c=await fetch(_0xcdf667,{'method':_0xdfdeaa(0x16d),'headers':{'Content-Type':_0xdfdeaa(0x173)},'body':JSON['stringify']({'code':_0x25afca}),'signal':_0x24699c['signal']});clearTimeout(_0x597e5e);if(!_0x21b37c['ok'])throw CliErrors[_0xdfdeaa(0x1a6)](_0xdfdeaa(0x19b)+_0x21b37c[_0xdfdeaa(0x18e)]);const _0x73ca5b=await _0x21b37c[_0xdfdeaa(0x188)](),_0x4b1a76=_0x73ca5b['data']&&typeof _0x73ca5b[_0xdfdeaa(0x1a1)]===_0xdfdeaa(0x19f)?_0x73ca5b[_0xdfdeaa(0x1a1)]:_0x73ca5b;if(!_0x4b1a76||typeof _0x4b1a76[_0xdfdeaa(0x18e)]!==_0xdfdeaa(0x198))throw CliErrors[_0xdfdeaa(0x1a0)]('Invalid\x20device\x20auth\x20response');return{'status':_0x4b1a76[_0xdfdeaa(0x18e)],'access_key':typeof _0x4b1a76[_0xdfdeaa(0x1ae)]===_0xdfdeaa(0x198)?_0x4b1a76[_0xdfdeaa(0x1ae)]:undefined};}export async function pollDeviceToken(_0x1e60b9,_0x4df977,_0x8fadcc){const _0x4d1f9f=a11_0x98e480;let _0x450af1=0x0;for(let _0x1615cc=0x0;_0x1615cc<MAX_POLLS;_0x1615cc++){if(_0x8fadcc[_0x4d1f9f(0x1ad)])throw CliErrors[_0x4d1f9f(0x187)](_0x4d1f9f(0x178));let _0xde84c1;try{_0xde84c1=await fetchDeviceToken(_0x1e60b9,_0x4df977);}catch(_0x421798){if(_0x421798 instanceof Error&&_0x421798[_0x4d1f9f(0x1aa)]===_0x4d1f9f(0x176))throw CliErrors[_0x4d1f9f(0x187)](_0x4d1f9f(0x178));_0x450af1++;if(_0x450af1>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x4d1f9f(0x1a6)](_0x4d1f9f(0x17c));writeCliSideChannelLine('Device\x20auth\x20API\x20error\x20('+_0x450af1+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x4d1f9f(0x174)),await sleep(POLL_INTERVAL_MS);continue;}_0x450af1=0x0;if(_0xde84c1[_0x4d1f9f(0x18e)]===_0x4d1f9f(0x197)){if(!_0xde84c1[_0x4d1f9f(0x1ae)])throw CliErrors[_0x4d1f9f(0x1a0)](_0x4d1f9f(0x18a));return _0xde84c1[_0x4d1f9f(0x1ae)];}if(_0xde84c1[_0x4d1f9f(0x18e)]===_0x4d1f9f(0x189)){deleteStoredDeviceCode();throw CliErrors['validation'](_0x4d1f9f(0x17b));}const _0x5bb7b8=(_0x1615cc+0x1)*POLL_INTERVAL_MS,_0xcd940b=DEVICE_CODE_TTL_MS-_0x5bb7b8,_0x1f9323=Math['floor'](_0xcd940b/0xea60),_0x1ef334=Math[_0x4d1f9f(0x1ac)](_0xcd940b%0xea60/0x3e8);process['stderr'][_0x4d1f9f(0x17d)](_0x4d1f9f(0x171)+_0x1f9323+':'+String(_0x1ef334)[_0x4d1f9f(0x179)](0x2,'0')+'\x20remaining'),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors['validation']('Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}function a11_0x4806(){const _0x140d3e=['getTime','&source=','3380158nglwPm','success','string','4220648MtGpwd','scope','Device\x20auth\x20API\x20returned\x20HTTP\x20','log','239333YWYDpF','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','object','apiError','data','After\x20authorizing,\x20re-run:\x20','bool','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','5492130zPVfZB','networkError','removeListener','stringify','auth','name','AccessKey\x20saved\x20to\x20','floor','aborted','access_key','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','device','402552EuBVmt','12564DMybSA','Write\x20to\x20project\x20config','boolean','\x20config.','通过设备码流程完成授权(在浏览器中操作,无需复制粘贴)','randomUUID','once','code','1743lmASGj','/device-auth?code=','global-default','lovrabet-cli','POST','abort','SIGINT','project','\x0dWaiting\x20for\x20authorization...\x20','将启动设备码授权流程;授权成功后会把获取到的\x20AccessKey\x20保存到所选\x20Lovrabet\x20配置。确认界面不会显示设备码或密钥。','application/json','),\x20retrying...','utf8','AbortError','180XJnWCj','Device\x20authorization\x20cancelled.','padStart','str','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','write','url-only','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','\x20auth\x20status','stderr','createdAt','/.device-auth','global','4340382xJuWxz','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','cancelled','json','expired','Invalid\x20access_key\x20returned\x20by\x20server.','Device\x20authorization\x20successful.','Write\x20to\x20global\x20config\x20(default)','Verify:\x20','status','accessKey','test','source','nonInteractive','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.'];a11_0x4806=function(){return _0x140d3e;};return a11_0x4806();}function sleep(_0xfba326){return new Promise(_0x39138f=>setTimeout(_0x39138f,_0xfba326));}function a11_0xd2f6(_0x4319a6,_0x1f4269){_0x4319a6=_0x4319a6-0x15f;const _0x48068f=a11_0x4806();let _0xd2f658=_0x48068f[_0x4319a6];return _0xd2f658;}export const authDeviceDefinition={'service':a11_0x98e480(0x1a9),'command':a11_0x98e480(0x15f),'description':a11_0x98e480(0x165),'risk':a11_0x98e480(0x17d),'confirmationDescription':a11_0x98e480(0x172),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x98e480(0x184),'type':a11_0x98e480(0x163),'description':a11_0x98e480(0x18c),'default':!![]},{'name':a11_0x98e480(0x170),'type':a11_0x98e480(0x163),'description':a11_0x98e480(0x162),'default':![]},{'name':'source','type':a11_0x98e480(0x198),'description':a11_0x98e480(0x1af),'default':a11_0x98e480(0x16c)},{'name':a11_0x98e480(0x17e),'type':'boolean','description':a11_0x98e480(0x19e),'default':![]}],async 'execute'(_0x5261b3){const _0x572a31=a11_0x98e480,_0x4789a5=resolveAuthScopeFlags(_0x5261b3),_0x15f43f=_0x4789a5[_0x572a31(0x184)]?_0x572a31(0x184):_0x572a31(0x170),_0x2179bb=readScopedConfig(_0x4789a5);if(_0x2179bb[_0x572a31(0x18f)])return{'ok':!![],'message':_0x572a31(0x186)};const _0x1aa1bf=(_0x5261b3[_0x572a31(0x17a)](_0x572a31(0x191))||_0x572a31(0x16c))['trim'](),_0x13d180=getUserDomain(),_0x1c3266=readStoredDeviceCode(),_0x227314=_0x1c3266&&!isStoredDeviceCodeExpired(_0x1c3266)?_0x1c3266[_0x572a31(0x168)]:((()=>{const _0x51d91a=generateDeviceCode();return writeStoredDeviceCode(_0x51d91a,_0x15f43f),_0x51d91a;})()),_0x295ac6=buildDeviceAuthUrl(_0x13d180,_0x227314,_0x1aa1bf);if(_0x5261b3['bool']('url-only'))return console[_0x572a31(0x19c)](_0x295ac6),{'ok':!![]};writeCliSideChannelLine(_0x572a31(0x17f)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x295ac6),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x572a31(0x193));if(_0x5261b3[_0x572a31(0x192)])return writeCliSideChannelLine(_0x572a31(0x1a2)+CLI_BIN_NAME+'\x20auth\x20device'),{'ok':!![],'message':'Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.'};writeCliSideChannelLine(_0x572a31(0x1a4));const _0x4b3426=new AbortController(),_0x40bdfa=()=>{const _0x42a823=_0x572a31;_0x4b3426[_0x42a823(0x16e)](),process['removeListener'](_0x42a823(0x16f),_0x40bdfa);};process[_0x572a31(0x167)](_0x572a31(0x16f),_0x40bdfa);let _0x46da84;try{_0x46da84=await pollDeviceToken(_0x13d180,_0x227314,_0x4b3426['signal']);}finally{process[_0x572a31(0x1a7)](_0x572a31(0x16f),_0x40bdfa);}if(!ACCESS_KEY_PATTERN[_0x572a31(0x190)](_0x46da84))throw CliErrors['apiError']('Invalid\x20access_key\x20returned\x20by\x20server.');const _0x5ac6ae=readScopedConfig(_0x4789a5);return _0x5ac6ae[_0x572a31(0x18f)]=_0x46da84,writeScopedConfig(_0x5ac6ae,_0x4789a5),deleteStoredDeviceCode(),process[_0x572a31(0x181)][_0x572a31(0x17d)]('\x0a'),writeCliSideChannelLine(_0x572a31(0x1ab)+_0x15f43f+_0x572a31(0x164)),writeCliSideChannelLine(_0x572a31(0x18d)+CLI_BIN_NAME+_0x572a31(0x180)),{'ok':!![],'message':_0x572a31(0x18b)};}};
@@ -11,8 +11,8 @@
11
11
  * on multiple projects). Writing to global by default means one `auth login`
12
12
  * suffices for all projects. `--project` is opt-in for project-isolated creds.
13
13
  *
14
- * Why `resolveAuthScopeFlags` uses `policy: "global-default"`: unlike `app use`
15
- * (which prefers the project layer), auth credentials should default to global.
14
+ * Why `resolveAuthScopeFlags` uses `policy: "global-default"`: auth credentials
15
+ * should default to global, while workspace binding always targets the current directory.
16
16
  * Project-specific auth is an edge case handled by `--project`.
17
17
  *
18
18
  * Design decision: `auth status` reads the product-scoped access key env var