@treasuredata/tdx 0.28.6 → 0.28.8

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 (181) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/upgrade-command.js +1 -1
  47. package/dist/commands/use-command.js +1 -1
  48. package/dist/commands/user-command.js +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/command-output.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/constants.js +1 -1
  55. package/dist/core/credential-cache.js +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/keychain.js +1 -1
  58. package/dist/core/profile.js +1 -1
  59. package/dist/core/project-config.js +1 -1
  60. package/dist/core/session.js +1 -1
  61. package/dist/core/user-cache.js +1 -1
  62. package/dist/core/version.js +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/mcp/server.js +1 -1
  65. package/dist/mcp/tools/index.js +1 -1
  66. package/dist/mcp/tools/tdx-run.js +1 -1
  67. package/dist/mcp/tools/tdx-search.js +1 -1
  68. package/dist/mcp/utils.js +1 -1
  69. package/dist/proxy/claude-usage-tracker.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/sse-usage-parser.js +1 -1
  72. package/dist/sdk/agent/agent-config.js +1 -1
  73. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  74. package/dist/sdk/agent/agent-yaml.js +1 -1
  75. package/dist/sdk/agent/test/evaluator.js +1 -1
  76. package/dist/sdk/agent/test/executor.js +1 -1
  77. package/dist/sdk/agent/test/index.js +1 -1
  78. package/dist/sdk/agent/test/output.js +1 -1
  79. package/dist/sdk/agent/test/parser.js +1 -1
  80. package/dist/sdk/agent/tool-target-registry.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/client/cdp-api-client.js +1 -1
  83. package/dist/sdk/client/delivery-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/delivery.js +1 -1
  95. package/dist/sdk/engage/campaign-pull.js +1 -1
  96. package/dist/sdk/engage/campaign-push.js +1 -1
  97. package/dist/sdk/engage/campaign-validator.js +1 -1
  98. package/dist/sdk/engage/campaign-yaml.js +1 -1
  99. package/dist/sdk/engage/types/campaign-def.js +1 -1
  100. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  101. package/dist/sdk/engage.js +1 -1
  102. package/dist/sdk/errors.js +1 -1
  103. package/dist/sdk/index.js +1 -1
  104. package/dist/sdk/io/index.js +1 -1
  105. package/dist/sdk/io/node-filesystem.js +1 -1
  106. package/dist/sdk/job.js +1 -1
  107. package/dist/sdk/journey.js +1 -1
  108. package/dist/sdk/llm/chat-cache.js +1 -1
  109. package/dist/sdk/llm/index.js +1 -1
  110. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  111. package/dist/sdk/llm/model-factors.js +1 -1
  112. package/dist/sdk/personalization.js +1 -1
  113. package/dist/sdk/query/index.js +1 -1
  114. package/dist/sdk/query/sql-parser.js +1 -1
  115. package/dist/sdk/realtime.js +1 -1
  116. package/dist/sdk/schedule.js +1 -1
  117. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/fields-display.js +1 -1
  119. package/dist/sdk/segment/file-discovery.js +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-validator.js +1 -1
  122. package/dist/sdk/segment/journey-yaml.js +1 -1
  123. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  124. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  125. package/dist/sdk/segment/pull-workflow.js +1 -1
  126. package/dist/sdk/segment/push-recovery.js +1 -1
  127. package/dist/sdk/segment/push-workflow.js +1 -1
  128. package/dist/sdk/segment/resolution-context.js +1 -1
  129. package/dist/sdk/segment/segment-path-parser.js +1 -1
  130. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  131. package/dist/sdk/segment/target-resolution.js +1 -1
  132. package/dist/sdk/segment/tdx-config.js +1 -1
  133. package/dist/sdk/segment/validate-files.js +1 -1
  134. package/dist/sdk/segment/yaml-validator.js +1 -1
  135. package/dist/sdk/segment.js +1 -1
  136. package/dist/sdk/types/index.js +1 -1
  137. package/dist/sdk/types/progress.js +1 -1
  138. package/dist/sdk/user.js +1 -1
  139. package/dist/sdk/util/format-detector.js +1 -1
  140. package/dist/sdk/util/formatters.js +1 -1
  141. package/dist/sdk/util/index.js +1 -1
  142. package/dist/sdk/util/tree-formatter.js +1 -1
  143. package/dist/sdk/workflow/archive-validation.js +1 -1
  144. package/dist/sdk/workflow/clone-workflow.js +1 -1
  145. package/dist/sdk/workflow/index.js +1 -1
  146. package/dist/sdk/workflow/pull-workflow.js +1 -1
  147. package/dist/sdk/workflow/push-workflow.js +1 -1
  148. package/dist/sdk/workflow/tdx-config.js +1 -1
  149. package/dist/sdk/workflow/workflow-utils.js +1 -1
  150. package/dist/test-utils/command-runner.js +1 -1
  151. package/dist/test-utils/factories.js +1 -1
  152. package/dist/test-utils/fixtures.js +1 -1
  153. package/dist/test-utils/http-mock.js +1 -1
  154. package/dist/test-utils/index.js +1 -1
  155. package/dist/utils/async.js +1 -1
  156. package/dist/utils/colors.js +1 -1
  157. package/dist/utils/diff.js +1 -1
  158. package/dist/utils/file-permissions.js +1 -1
  159. package/dist/utils/file-reader.js +1 -1
  160. package/dist/utils/global-cache.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/local-cache.js +1 -1
  163. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  164. package/dist/utils/logger/formatters/index.js +1 -1
  165. package/dist/utils/logger/handlers/console-handler.js +1 -1
  166. package/dist/utils/logger/handlers/file-handler.js +1 -1
  167. package/dist/utils/logger/handlers/index.js +1 -1
  168. package/dist/utils/logger/handlers/null-handler.js +1 -1
  169. package/dist/utils/logger/index.js +1 -1
  170. package/dist/utils/logger/logger.js +1 -1
  171. package/dist/utils/logger/types.js +1 -1
  172. package/dist/utils/option-validation.js +1 -1
  173. package/dist/utils/process.js +1 -1
  174. package/dist/utils/prompt.js +1 -1
  175. package/dist/utils/spinner.js +1 -1
  176. package/dist/utils/sse-parser.js +1 -1
  177. package/dist/utils/string-utils.js +1 -1
  178. package/dist/utils/table-ref-parser.js +1 -1
  179. package/dist/utils/tdx-logger.js +1 -1
  180. package/dist/utils/version-check.js +1 -1
  181. package/package.json +1 -1
@@ -1 +1 @@
1
- const a9_0x28ecb9=a9_0x5582;(function(_0x23fad3,_0x464aee){const _0x507277=a9_0x5582,_0x1ea8aa=_0x23fad3();while(!![]){try{const _0x1de103=-parseInt(_0x507277(0xf0))/0x1*(parseInt(_0x507277(0x16d))/0x2)+parseInt(_0x507277(0x173))/0x3+-parseInt(_0x507277(0x102))/0x4+-parseInt(_0x507277(0x121))/0x5+-parseInt(_0x507277(0x131))/0x6*(-parseInt(_0x507277(0x11d))/0x7)+-parseInt(_0x507277(0x137))/0x8+parseInt(_0x507277(0x147))/0x9;if(_0x1de103===_0x464aee)break;else _0x1ea8aa['push'](_0x1ea8aa['shift']());}catch(_0x18091f){_0x1ea8aa['push'](_0x1ea8aa['shift']());}}}(a9_0xae73,0x32744));function a9_0x5582(_0x27b383,_0x2f0625){_0x27b383=_0x27b383-0xed;const _0xae73eb=a9_0xae73();let _0x5582c3=_0xae73eb[_0x27b383];return _0x5582c3;}import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x41570f from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';function a9_0xae73(){const _0xf90b43=['proxy','CLAUDE_CODE_NOT_FOUND','Failed\x20to\x20launch\x20Claude\x20Code:\x20','Claude\x20Code\x20CLI\x20not\x20found','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','tdx-managed-proxy','2.0.20','Failed\x20to\x20spawn\x20claude\x20command:\x20','close','\x27...','inherit','✓\x20Claude\x20Code\x20version\x20OK','78SLQuqW','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','\x20configuration\x20failed','tdx-skills','originalSettings','\x20or\x20later.','699256biMmtD','INSTALLATION_FAILED','ANTHROPIC_MODEL','command','\x27\x20configured','\x20already\x20configured','Claude\x20Code\x20version\x20check\x20failed','\x27\x20removed','ANTHROPIC_BASE_URL','Command\x20output:\x20','debug','Checking\x20Claude\x20Code\x20version...','already\x20exists','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','includes','cwd','6611994ZuoAvN','minor','stop','✓\x20Logs\x20saved\x20to\x20','major','https://docs.treasuredata.com/mcp','liveSessionOriginals','parse','Command\x20failed\x20(exit\x20','cause','join','✓\x20Settings\x20restored:\x20.claude/settings.local.json','false','pid','text','env','green','passThroughServer','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','✓\x20Marketplace\x20\x27','kill','fail','update','site','data','list','port','match','name','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','TD\x20Docs\x20MCP\x20Server','getLogPath','\x27\x20updated','ANTHROPIC_AUTH_TOKEN','tdx\x20claude\x20statusline','toString','llm-proxy','account_id','691214iMxxar','install','Configuring\x20MCP\x20server\x20\x27','stringify','description','plugin','1054155EkjZbJ','Failed\x20to\x20list\x20marketplaces','Failed\x20to\x20update\x20marketplace\x20\x27','message','error','utf-8','Installing\x20plugin\x20\x27','Initializing...','1oFhkDk','http://127.0.0.1:','patch','Executing:\x20claude\x20','sql-skills','Marketplace\x20\x27','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Warning:\x20Failed\x20to\x20configure\x20','already\x20installed','\x20is\x20too\x20old\x20(minimum:\x20','resume','marketplace','claude','Claude\x20Code\x20version\x20','context','settings.local.json','start','1211764ioWghI','apiKey','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','statusLine','Failed\x20to\x20remove\x20marketplace\x20\x27','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','ENOENT','log','verbose','add','✓\x20Logging\x20to\x20','info','CLAUDE_CODE_USE_BEDROCK','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','trim','--transport','\x20claude\x20statusline','INVALID_ARGUMENT','CLAUDE_CODE_USE_VERTEX','Failed\x20to\x20configure\x20marketplace\x20\x27','\x27\x20installed','td-docs','init','exit','remove','workflow-skills','td-skills','49546izrRqW','warn','✓\x20MCP\x20server\x20\x27','toISOString','1177250TJODlR','logger','\x27:\x20','stdout'];a9_0xae73=function(){return _0xf90b43;};return a9_0xae73();}import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a9_0x28ecb9(0x12b),SETTINGS_BACKUP_FILENAME='.tdx-settings-backup.json';function isProcessRunning(_0x9d8bd9){const _0x81dfc1=a9_0x28ecb9;try{return process[_0x81dfc1(0x15b)](_0x9d8bd9,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x25ff41,_0x135596){const _0x4436aa=a9_0x28ecb9;if(!existsSync(_0x25ff41))return;try{const _0x7ed7e8=await readFile(_0x25ff41,'utf-8'),_0x29f59e=JSON[_0x4436aa(0x14e)](_0x7ed7e8),_0x47d8d6=_0x29f59e[_0x4436aa(0x156)]||{};for(const _0x3bb9a1 of[_0x4436aa(0x13f),_0x4436aa(0x139),_0x4436aa(0x168),_0x4436aa(0x10e),'CLAUDE_CODE_USE_VERTEX']){_0x135596[_0x3bb9a1]!==undefined?_0x47d8d6[_0x3bb9a1]=_0x135596[_0x3bb9a1]:delete _0x47d8d6[_0x3bb9a1];}_0x135596['statusLine']!==undefined?_0x29f59e[_0x4436aa(0x105)]=_0x135596[_0x4436aa(0x105)]:delete _0x29f59e['statusLine'],_0x29f59e[_0x4436aa(0x156)]=_0x47d8d6,await writeFile(_0x25ff41,JSON['stringify'](_0x29f59e,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x43837f){try{await unlink(_0x43837f);}catch{}}async function recoverFromStaleBackup(_0x597ca7,_0x12a3f){const _0x2c6fc6=a9_0x28ecb9;if(!existsSync(_0x12a3f))return undefined;try{const _0x21c8c0=await readFile(_0x12a3f,_0x2c6fc6(0xed)),_0x5d3b2c=JSON[_0x2c6fc6(0x14e)](_0x21c8c0);if(isProcessRunning(_0x5d3b2c[_0x2c6fc6(0x154)]))return{'liveSessionOriginals':_0x5d3b2c[_0x2c6fc6(0x135)]};return await applyOriginalSettings(_0x597ca7,_0x5d3b2c[_0x2c6fc6(0x135)]),await safeUnlink(_0x12a3f),undefined;}catch{return await safeUnlink(_0x12a3f),undefined;}}function handleInstallationError(_0x12fcfa,_0x4f99a8,_0x5a442d,_0x330f80){const _0x1637b9=a9_0x28ecb9;errorContains(_0x12fcfa,_0x1637b9(0x143),_0x1637b9(0xf9),'already\x20configured')?(_0x5a442d[_0x1637b9(0x155)]='✓\x20'+_0x4f99a8+_0x1637b9(0x13c),_0x330f80?.[_0x1637b9(0x10d)](_0x4f99a8+_0x1637b9(0x13c)),_0x12fcfa instanceof SDKError&&_0x12fcfa[_0x1637b9(0x150)]&&_0x330f80?.[_0x1637b9(0x141)](_0x1637b9(0x140)+_0x12fcfa[_0x1637b9(0x150)][_0x1637b9(0x176)])):(_0x5a442d[_0x1637b9(0x11e)](_0x1637b9(0xf8)+_0x4f99a8),_0x330f80?.[_0x1637b9(0x177)](_0x4f99a8+_0x1637b9(0x133),_0x12fcfa));}export function parseVersion(_0xaf1b68){const _0x4d63ee=a9_0x28ecb9,_0x17a56d=_0xaf1b68[_0x4d63ee(0x110)]()[_0x4d63ee(0x162)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x17a56d)return null;return{'major':parseInt(_0x17a56d[0x1],0xa),'minor':parseInt(_0x17a56d[0x2],0xa),'patch':parseInt(_0x17a56d[0x3],0xa)};}export function compareVersions(_0x399717,_0x1066b2){const _0x14c284=a9_0x28ecb9;if(_0x399717[_0x14c284(0x14b)]!==_0x1066b2[_0x14c284(0x14b)])return _0x399717[_0x14c284(0x14b)]-_0x1066b2[_0x14c284(0x14b)];if(_0x399717[_0x14c284(0x148)]!==_0x1066b2['minor'])return _0x399717[_0x14c284(0x148)]-_0x1066b2[_0x14c284(0x148)];return _0x399717[_0x14c284(0xf2)]-_0x1066b2['patch'];}async function checkClaudeVersion(_0x50b4d7,_0x1b4a68){const _0x3c9e88=a9_0x28ecb9;_0x1b4a68?.[_0x3c9e88(0x141)](_0x3c9e88(0x10f)+_0x50b4d7+')');const _0x34fa90=await executeClaudeCommand(['--version'],undefined,_0x1b4a68),_0x297824=parseVersion(_0x34fa90);if(!_0x297824){_0x1b4a68?.['warn'](_0x3c9e88(0x104)+_0x34fa90);return;}const _0x3c5694=_0x297824['major']+'.'+_0x297824['minor']+'.'+_0x297824[_0x3c9e88(0xf2)],_0x45951d=parseVersion(_0x50b4d7);if(!_0x45951d){_0x1b4a68?.[_0x3c9e88(0x11e)]('Invalid\x20minimum\x20version\x20format:\x20'+_0x50b4d7);return;}if(compareVersions(_0x297824,_0x45951d)<0x0){_0x1b4a68?.[_0x3c9e88(0x177)](_0x3c9e88(0xfe)+_0x3c5694+_0x3c9e88(0xfa)+_0x50b4d7+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],_0x3c9e88(0xfe)+_0x3c5694+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x50b4d7+_0x3c9e88(0x136),undefined,{'helpText':_0x3c9e88(0x144)});}_0x1b4a68?.[_0x3c9e88(0x141)](_0x3c9e88(0xfe)+_0x3c5694+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0xa9a553,_0x2e4fea,_0x655a81){const _0x30ef9a=a9_0x28ecb9;return _0x655a81?.[_0x30ef9a(0x10d)](_0x30ef9a(0xf3)+_0xa9a553[_0x30ef9a(0x151)]('\x20')),new Promise((_0x597aea,_0x33d744)=>{const _0x467bbb=_0x30ef9a,_0x291032=crossSpawn(_0x467bbb(0xfd),_0xa9a553,{'stdio':'pipe'});let _0x3e51c9='',_0x486494='';_0x291032[_0x467bbb(0x124)]?.['on']('data',_0x1e23af=>{const _0x32fda2=_0x467bbb;_0x3e51c9+=_0x1e23af[_0x32fda2(0x16a)]();}),_0x291032['stderr']?.['on'](_0x467bbb(0x15f),_0xcc557e=>{const _0x221293=_0x467bbb;_0x486494+=_0xcc557e[_0x221293(0x16a)]();}),_0x291032['on'](_0x467bbb(0x177),_0x4239bb=>{const _0x3d5bd1=_0x467bbb;_0x4239bb['code']===_0x3d5bd1(0x108)?(_0x655a81?.[_0x3d5bd1(0x177)](_0x3d5bd1(0x128)),_0x33d744(new SDKError(ErrorCode[_0x3d5bd1(0x126)],'Claude\x20Code\x20CLI\x20not\x20found',_0x4239bb,{'helpText':_0x3d5bd1(0x107)}))):(_0x655a81?.['error']('Command\x20spawn\x20error:\x20'+_0x4239bb[_0x3d5bd1(0x176)]),_0x33d744(new SDKError(ErrorCode['INTERNAL'],_0x3d5bd1(0x12c)+_0x4239bb[_0x3d5bd1(0x176)],_0x4239bb)));}),_0x291032['on'](_0x467bbb(0x119),_0x542b75=>{const _0x1c2c6f=_0x467bbb;if(_0x542b75===0x0)_0x597aea(_0x3e51c9);else _0x2e4fea?(_0x655a81?.[_0x1c2c6f(0x177)](_0x1c2c6f(0x14f)+_0x542b75+'):\x20claude\x20'+_0xa9a553[_0x1c2c6f(0x151)]('\x20')),_0x33d744(new SDKError(ErrorCode[_0x1c2c6f(0x138)],_0x2e4fea,new Error(_0x486494)))):_0x597aea('');});});}async function ensureMcpServer(_0x13261e,_0x19dd0c,_0x3332de,_0x426296,_0x21ee7a){const _0x8f6113=a9_0x28ecb9;_0x426296[_0x8f6113(0x155)]=_0x8f6113(0x16f)+_0x13261e+_0x8f6113(0x12e),await executeClaudeCommand(['mcp','add',_0x13261e,_0x19dd0c,_0x8f6113(0x111),_0x3332de],_0x8f6113(0x132)+_0x13261e+'\x27',_0x21ee7a),_0x426296['text']=_0x8f6113(0x11f)+_0x13261e+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x8f76bd=process.env.TDX_TD_SKILLS_REPO;if(_0x8f76bd)return _0x8f76bd;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x32c509,_0x45bd7c){const _0x1649e2=a9_0x28ecb9;try{const _0x418350=await executeClaudeCommand([_0x1649e2(0x172),_0x1649e2(0xfc),_0x1649e2(0x160)],_0x1649e2(0x174),_0x45bd7c);if(!_0x418350[_0x1649e2(0x145)](_0x32c509)){_0x45bd7c?.[_0x1649e2(0x141)](_0x1649e2(0xf5)+_0x32c509+_0x1649e2(0x159));return;}await executeClaudeCommand([_0x1649e2(0x172),_0x1649e2(0xfc),_0x1649e2(0x11a),_0x32c509],'Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x32c509+'\x27',_0x45bd7c),_0x45bd7c?.[_0x1649e2(0x10d)]('Marketplace\x20\x27'+_0x32c509+_0x1649e2(0x13e));}catch(_0x4a175d){_0x45bd7c?.[_0x1649e2(0x11e)](_0x1649e2(0x106)+_0x32c509+_0x1649e2(0x123)+_0x4a175d);}}async function restoreDefaultTdSkillsMarketplace(_0x1271f2){const _0x3c89ff=a9_0x28ecb9;try{await removeMarketplace(_0x3c89ff(0x11c),_0x1271f2),await executeClaudeCommand(['plugin','marketplace',_0x3c89ff(0x10b),DEFAULT_TD_SKILLS_URL],undefined,_0x1271f2),_0x1271f2?.[_0x3c89ff(0x10d)]('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0x184fda,_0x2482cb,_0x5435e9,_0xa6035e){const _0x4320b5=a9_0x28ecb9;_0x5435e9['text']='Configuring\x20marketplace\x20\x27'+_0x184fda+_0x4320b5(0x12e),await executeClaudeCommand([_0x4320b5(0x172),_0x4320b5(0xfc),'add',_0x2482cb],_0x4320b5(0x115)+_0x184fda+'\x27',_0xa6035e),_0x5435e9[_0x4320b5(0x155)]=_0x4320b5(0x15a)+_0x184fda+_0x4320b5(0x13b);}async function updateMarketplace(_0x49404e,_0x17a311,_0x435d88){const _0x353c6a=a9_0x28ecb9;_0x17a311[_0x353c6a(0x155)]='Updating\x20marketplace\x20\x27'+_0x49404e+_0x353c6a(0x12e),await executeClaudeCommand(['plugin',_0x353c6a(0xfc),_0x353c6a(0x15d)],_0x353c6a(0x175)+_0x49404e+'\x27',_0x435d88),_0x17a311[_0x353c6a(0x155)]='✓\x20Marketplace\x20\x27'+_0x49404e+_0x353c6a(0x167);}async function ensurePlugin(_0xedbece,_0x55b6b5,_0x371d0b,_0x3a08d8){const _0x5342f1=a9_0x28ecb9;_0x371d0b[_0x5342f1(0x155)]=_0x5342f1(0xee)+_0xedbece+'\x27...',await executeClaudeCommand([_0x5342f1(0x172),_0x5342f1(0x16e),_0xedbece+'@'+_0x55b6b5],'Failed\x20to\x20install\x20plugin\x20\x27'+_0xedbece+'\x27',_0x3a08d8),_0x371d0b[_0x5342f1(0x155)]='✓\x20Plugin\x20\x27'+_0xedbece+_0x5342f1(0x116);}async function createClaudeSettings(_0x3d5398,_0x810eb,_0x6b51d8){const _0x5ec880=a9_0x28ecb9,_0x17827a=join(process[_0x5ec880(0x146)](),'.claude'),_0x442c16=join(_0x17827a,'settings.local.json'),_0xd97d9b=join(_0x17827a,SETTINGS_BACKUP_FILENAME);await mkdir(_0x17827a,{'recursive':!![]});const _0x1fe7f6=await recoverFromStaleBackup(_0x442c16,_0xd97d9b);let _0x5b3df4;if(_0x1fe7f6)_0x5b3df4=_0x1fe7f6[_0x5ec880(0x14d)];else{let _0x58aebc={};if(existsSync(_0x442c16))try{const _0x1714d8=await readFile(_0x442c16,_0x5ec880(0xed));_0x58aebc=JSON[_0x5ec880(0x14e)](_0x1714d8);}catch{_0x58aebc={};}const _0x4c0768=_0x58aebc[_0x5ec880(0x156)]||{};_0x5b3df4={'ANTHROPIC_BASE_URL':_0x4c0768[_0x5ec880(0x13f)],'ANTHROPIC_MODEL':_0x4c0768['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x4c0768[_0x5ec880(0x168)],'CLAUDE_CODE_USE_BEDROCK':_0x4c0768['CLAUDE_CODE_USE_BEDROCK'],'CLAUDE_CODE_USE_VERTEX':_0x4c0768[_0x5ec880(0x114)],'statusLine':_0x58aebc['statusLine']};const _0xedfb3={'createdAt':new Date()[_0x5ec880(0x120)](),'pid':process[_0x5ec880(0x154)],'originalSettings':_0x5b3df4};await writeFile(_0xd97d9b,JSON[_0x5ec880(0x170)](_0xedfb3,null,0x2)+'\x0a');}let _0x198fe6={};if(existsSync(_0x442c16))try{const _0x4ccebd=await readFile(_0x442c16,'utf-8');_0x198fe6=JSON[_0x5ec880(0x14e)](_0x4ccebd);}catch{_0x198fe6={};}const _0x54b4ed=_0x198fe6['env']||{},_0x4325d3={..._0x198fe6,'env':{..._0x54b4ed,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x3d5398,..._0x810eb&&{'ANTHROPIC_MODEL':_0x810eb},'ANTHROPIC_AUTH_TOKEN':_0x5ec880(0x12a),'CLAUDE_CODE_USE_BEDROCK':_0x5ec880(0x153),'CLAUDE_CODE_USE_VERTEX':'false'},'statusLine':{'type':_0x5ec880(0x13a),'command':_0x6b51d8?'tdx\x20--profile\x20'+_0x6b51d8+_0x5ec880(0x112):_0x5ec880(0x169)}};return await writeFile(_0x442c16,JSON[_0x5ec880(0x170)](_0x4325d3,null,0x2)+'\x0a'),_0x5b3df4;}async function restoreClaudeSettings(_0x2fdd4a){const _0x31b252=a9_0x28ecb9,_0x5befa=join(process[_0x31b252(0x146)](),'.claude'),_0x7c181d=join(_0x5befa,_0x31b252(0x100)),_0x34b13f=join(_0x5befa,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x7c181d,_0x2fdd4a);try{if(existsSync(_0x34b13f)){const _0x532010=await readFile(_0x34b13f,'utf-8'),_0x27612c=JSON[_0x31b252(0x14e)](_0x532010);_0x27612c[_0x31b252(0x154)]===process[_0x31b252(0x154)]&&await safeUnlink(_0x34b13f);}}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x28ecb9(0x163)]='claude';[a9_0x28ecb9(0x171)]=a9_0x28ecb9(0xf6);[a9_0x28ecb9(0x158)];[a9_0x28ecb9(0x135)];[a9_0x28ecb9(0x122)];[a9_0x28ecb9(0x161)];async['execute'](_0x4b07a2){const _0x357fc8=a9_0x28ecb9,{tdx:_0x309f71,options:_0x3df72c,args:_0x27acb8}=_0x4b07a2;let _0x1c90f9=![];try{const _0x414f74=_0x3df72c,_0x52e2e4=_0x414f74[_0x357fc8(0x125)]===![],_0x5af4f4=_0x414f74['continue']===!![],_0x40f535=_0x414f74[_0x357fc8(0xfb)]===!![],_0x396d47=[..._0x27acb8];if(_0x5af4f4)_0x396d47['unshift']('-c');else _0x40f535&&_0x396d47['unshift']('-r');const _0x12504e=createCommandSpinner(_0x357fc8(0xef),{'verbose':_0x3df72c[_0x357fc8(0x10a)]});_0x12504e[_0x357fc8(0x101)]();try{if(!_0x52e2e4){const _0x5955a8=_0x3df72c['profile'];try{const _0x59f64e=await _0x309f71['user']['getCurrent']();_0x59f64e[_0x357fc8(0x16c)]&&writeCachedAccountInfo(_0x3df72c[_0x357fc8(0x15e)],_0x59f64e['account_id'],_0x5955a8);}catch{}_0x12504e[_0x357fc8(0x155)]='Initializing\x20proxy\x20logger...',this[_0x357fc8(0x122)]=new TDXLogger(_0x3df72c['logLevel'],!![]),await this['logger'][_0x357fc8(0x118)]();const _0x52ce4a=this[_0x357fc8(0x122)][_0x357fc8(0x166)]();_0x12504e['text']=_0x357fc8(0x10c)+_0x52ce4a;const _0x550af9=getEndpoint(_0x3df72c[_0x357fc8(0x15e)],_0x357fc8(0x16b));_0x12504e['text']='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';if(!_0x309f71[_0x357fc8(0xff)]['apiKey'])throw new SDKError(ErrorCode[_0x357fc8(0x113)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x357fc8(0x158)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x550af9,'apiKey':_0x309f71[_0x357fc8(0xff)][_0x357fc8(0x103)],'logger':this[_0x357fc8(0x122)],'site':_0x3df72c[_0x357fc8(0x15e)],'profile':_0x5955a8}),await this[_0x357fc8(0x158)]['start'](),this[_0x357fc8(0x161)]=this[_0x357fc8(0x158)][_0x357fc8(0x161)],_0x12504e[_0x357fc8(0x155)]=_0x357fc8(0x129)+this['port']+'\x20→\x20'+_0x550af9,_0x12504e['text']='Creating\x20.claude/settings.local.json...',this['originalSettings']=await createClaudeSettings(this[_0x357fc8(0x161)],undefined,_0x5955a8),_0x12504e['text']='✓\x20Settings\x20configured:\x20.claude/settings.local.json';}else _0x12504e[_0x357fc8(0x155)]=_0x357fc8(0xf7);try{_0x12504e[_0x357fc8(0x155)]=_0x357fc8(0x142),await checkClaudeVersion(MIN_CLAUDE_VERSION,this['logger']),_0x12504e['text']=_0x357fc8(0x130);}catch(_0x341276){_0x12504e[_0x357fc8(0x15c)](_0x357fc8(0x13d));throw _0x341276;}try{await ensureMcpServer(_0x357fc8(0x117),_0x357fc8(0x14c),'http',_0x12504e,this[_0x357fc8(0x122)]);}catch(_0x2f7b9e){handleInstallationError(_0x2f7b9e,_0x357fc8(0x165),_0x12504e,this[_0x357fc8(0x122)]);}try{const _0x12b7cf=getTdSkillsRepoUrl();_0x1c90f9=_0x12b7cf!==DEFAULT_TD_SKILLS_URL,_0x1c90f9&&await removeMarketplace(_0x357fc8(0x11c),this[_0x357fc8(0x122)]),await ensureMarketplace('td-skills',_0x12b7cf,_0x12504e,this[_0x357fc8(0x122)]),await updateMarketplace('td-skills',_0x12504e,this['logger']),await ensurePlugin(_0x357fc8(0xf4),_0x357fc8(0x11c),_0x12504e,this[_0x357fc8(0x122)]),await ensurePlugin(_0x357fc8(0x11b),_0x357fc8(0x11c),_0x12504e,this[_0x357fc8(0x122)]),await ensurePlugin(_0x357fc8(0x134),_0x357fc8(0x11c),_0x12504e,this[_0x357fc8(0x122)]);}catch(_0xee07cd){handleInstallationError(_0xee07cd,'td-skills\x20Plugins',_0x12504e,this['logger']);}_0x12504e[_0x357fc8(0x149)]();}catch(_0x5efa28){_0x12504e['fail']('Setup\x20failed');throw _0x5efa28;}const _0x8acc47=await findExecutable(_0x357fc8(0xfd));if(!_0x8acc47)throw new SDKError(ErrorCode[_0x357fc8(0x126)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x357fc8(0x107)});const _0x2d33b5={...process.env};!_0x52e2e4&&(_0x2d33b5[_0x357fc8(0x13f)]=_0x357fc8(0xf1)+this[_0x357fc8(0x161)],_0x2d33b5[_0x357fc8(0x168)]=_0x357fc8(0x12a),_0x2d33b5[_0x357fc8(0x10e)]=_0x357fc8(0x153),_0x2d33b5[_0x357fc8(0x114)]=_0x357fc8(0x153));const _0x1aeb43=crossSpawn(_0x8acc47,_0x396d47,{'stdio':_0x357fc8(0x12f),'env':_0x2d33b5}),_0x3e2ed4=await new Promise(_0x4e36cc=>{const _0x298e45=_0x357fc8;_0x1aeb43['on'](_0x298e45(0x119),_0x3a8cdf=>{_0x4e36cc(_0x3a8cdf||0x0);}),_0x1aeb43['on'](_0x298e45(0x177),_0x2139d7=>{const _0x2f57e7=_0x298e45;console[_0x2f57e7(0x177)](a9_0x41570f['red'](_0x2f57e7(0x127)+_0x2139d7[_0x2f57e7(0x176)])),_0x4e36cc(0x1);});});_0x1c90f9&&await restoreDefaultTdSkillsMarketplace(this[_0x357fc8(0x122)]);this[_0x357fc8(0x158)]&&(await this[_0x357fc8(0x158)]['stop'](),console[_0x357fc8(0x109)](a9_0x41570f[_0x357fc8(0x157)](_0x357fc8(0x164))));if(this[_0x357fc8(0x122)]){await this['logger'][_0x357fc8(0x12d)]();const _0x66dad8=this[_0x357fc8(0x122)]['getLogPath']();console[_0x357fc8(0x109)](a9_0x41570f[_0x357fc8(0x157)](_0x357fc8(0x14a)+_0x66dad8));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x357fc8(0x135)]),console['log'](a9_0x41570f[_0x357fc8(0x157)](_0x357fc8(0x152)))),_0x3e2ed4;}catch(_0x2baa29){_0x1c90f9&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&await this[_0x357fc8(0x158)]['stop']();this[_0x357fc8(0x122)]&&await this[_0x357fc8(0x122)][_0x357fc8(0x12d)]();this[_0x357fc8(0x135)]&&await restoreClaudeSettings(this['originalSettings']);throw _0x2baa29;}}}
1
+ const a9_0x476e8d=a9_0x2086;(function(_0x51686b,_0x19ca7d){const _0x288fe1=a9_0x2086,_0x54895f=_0x51686b();while(!![]){try{const _0x1ede06=parseInt(_0x288fe1(0x213))/0x1+-parseInt(_0x288fe1(0x1d5))/0x2*(parseInt(_0x288fe1(0x24c))/0x3)+-parseInt(_0x288fe1(0x24e))/0x4+parseInt(_0x288fe1(0x221))/0x5+-parseInt(_0x288fe1(0x1ca))/0x6*(-parseInt(_0x288fe1(0x1df))/0x7)+-parseInt(_0x288fe1(0x225))/0x8*(-parseInt(_0x288fe1(0x1ff))/0x9)+-parseInt(_0x288fe1(0x1d0))/0xa;if(_0x1ede06===_0x19ca7d)break;else _0x54895f['push'](_0x54895f['shift']());}catch(_0x311d6d){_0x54895f['push'](_0x54895f['shift']());}}}(a9_0x909b,0x5ddd2));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x14acdf from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';function a9_0x909b(){const _0x31012b=['already\x20configured','ENOENT','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','✓\x20Claude\x20Code\x20version\x20OK','logLevel','toISOString','27OwJfCN','profile','678820FzDLDv','false','logger','warn','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','INVALID_ARGUMENT','✓\x20Logging\x20to\x20','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','\x20or\x20later.','INTERNAL','passThroughServer','update','\x20→\x20','http','https://docs.treasuredata.com/mcp','trim','llm-proxy','80802PSOKDz','2.0.20','\x20already\x20configured','\x27\x20configured','claude','Failed\x20to\x20configure\x20marketplace\x20\x27','6047310JdewCZ','inherit','\x27:\x20','includes','Setup\x20failed','72578wVaTqX','✓\x20Plugin\x20\x27','toString','.claude','apiKey','already\x20exists','Claude\x20Code\x20version\x20check\x20failed','Claude\x20Code\x20CLI\x20not\x20found','execute','✓\x20Logs\x20saved\x20to\x20','203vbKxrH','utf-8','install','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','minor','Marketplace\x20\x27','description','close','resume','code','green','init','match','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','exit','error','getCurrent','CLAUDE_CODE_USE_VERTEX','ANTHROPIC_AUTH_TOKEN','Command\x20spawn\x20error:\x20','\x27...','site','ANTHROPIC_MODEL','verbose','settings.local.json','\x20claude\x20statusline','getLogPath','tdx-managed-proxy','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','add','http://127.0.0.1:','37413cgPPBc','proxy','tdx-skills','Failed\x20to\x20spawn\x20claude\x20command:\x20','plugin','sql-skills','Initializing...','text','major','Failed\x20to\x20list\x20marketplaces','kill','CLAUDE_CODE_NOT_FOUND','--transport','Initializing\x20proxy\x20logger...','stderr','Installing\x20plugin\x20\x27','CLAUDE_CODE_USE_BEDROCK','marketplace','patch','Claude\x20Code\x20version\x20','359687ULVPTz','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','https://github.com/treasure-data/td-skills','CLAUDE_CODE_UNSUPPORTED_VERSION','td-skills','list','tdx\x20claude\x20statusline','originalSettings','port','log','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','cwd','ANTHROPIC_BASE_URL','account_id','80560KSwrNW','already\x20installed','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','Failed\x20to\x20install\x20plugin\x20\x27','1384BrlQkT','join','start','\x27\x20removed','✓\x20Settings\x20restored:\x20.claude/settings.local.json','parse','Configuring\x20MCP\x20server\x20\x27','statusLine','pipe','✓\x20Marketplace\x20\x27','liveSessionOriginals','tdx\x20--profile\x20','Command\x20failed\x20(exit\x20','td-docs','✓\x20Settings\x20configured:\x20.claude/settings.local.json','env','pid','):\x20claude\x20','stop','cause','info','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','Failed\x20to\x20remove\x20marketplace\x20\x27','.tdx-settings-backup.json','message','Creating\x20.claude/settings.local.json...','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','Invalid\x20minimum\x20version\x20format:\x20','mcp','Executing:\x20claude\x20','debug','remove','Warning:\x20Failed\x20to\x20configure\x20'];a9_0x909b=function(){return _0x31012b;};return a9_0x909b();}import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a9_0x476e8d(0x1cb),SETTINGS_BACKUP_FILENAME=a9_0x476e8d(0x23c);function isProcessRunning(_0x2fd776){const _0x325c42=a9_0x476e8d;try{return process[_0x325c42(0x209)](_0x2fd776,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x2d4888,_0x21ecaf){const _0xdacdfe=a9_0x476e8d;if(!existsSync(_0x2d4888))return;try{const _0x46fc65=await readFile(_0x2d4888,_0xdacdfe(0x1e0)),_0x29419d=JSON['parse'](_0x46fc65),_0x3b6c51=_0x29419d[_0xdacdfe(0x234)]||{};for(const _0x5f458c of[_0xdacdfe(0x21f),_0xdacdfe(0x1f5),_0xdacdfe(0x1f1),_0xdacdfe(0x20f),_0xdacdfe(0x1f0)]){_0x21ecaf[_0x5f458c]!==undefined?_0x3b6c51[_0x5f458c]=_0x21ecaf[_0x5f458c]:delete _0x3b6c51[_0x5f458c];}_0x21ecaf[_0xdacdfe(0x22c)]!==undefined?_0x29419d[_0xdacdfe(0x22c)]=_0x21ecaf['statusLine']:delete _0x29419d[_0xdacdfe(0x22c)],_0x29419d[_0xdacdfe(0x234)]=_0x3b6c51,await writeFile(_0x2d4888,JSON['stringify'](_0x29419d,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x13047f){try{await unlink(_0x13047f);}catch{}}async function recoverFromStaleBackup(_0x5d0319,_0x1c7175){const _0x453886=a9_0x476e8d;if(!existsSync(_0x1c7175))return undefined;try{const _0xd5e93f=await readFile(_0x1c7175,'utf-8'),_0x5aca31=JSON[_0x453886(0x22a)](_0xd5e93f);if(isProcessRunning(_0x5aca31['pid']))return{'liveSessionOriginals':_0x5aca31['originalSettings']};return await applyOriginalSettings(_0x5d0319,_0x5aca31[_0x453886(0x21a)]),await safeUnlink(_0x1c7175),undefined;}catch{return await safeUnlink(_0x1c7175),undefined;}}function handleInstallationError(_0x4bf07e,_0x102329,_0x1983c0,_0x10c01f){const _0x4dbdf6=a9_0x476e8d;errorContains(_0x4bf07e,_0x4dbdf6(0x1da),_0x4dbdf6(0x222),_0x4dbdf6(0x246))?(_0x1983c0[_0x4dbdf6(0x206)]='✓\x20'+_0x102329+_0x4dbdf6(0x1cc),_0x10c01f?.['info'](_0x102329+_0x4dbdf6(0x1cc)),_0x4bf07e instanceof SDKError&&_0x4bf07e[_0x4dbdf6(0x238)]&&_0x10c01f?.[_0x4dbdf6(0x243)]('Command\x20output:\x20'+_0x4bf07e[_0x4dbdf6(0x238)]['message'])):(_0x1983c0[_0x4dbdf6(0x251)](_0x4dbdf6(0x245)+_0x102329),_0x10c01f?.[_0x4dbdf6(0x1ee)](_0x102329+'\x20configuration\x20failed',_0x4bf07e));}export function parseVersion(_0x3a415a){const _0x2f72f3=a9_0x476e8d,_0x432efa=_0x3a415a[_0x2f72f3(0x1c8)]()[_0x2f72f3(0x1eb)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x432efa)return null;return{'major':parseInt(_0x432efa[0x1],0xa),'minor':parseInt(_0x432efa[0x2],0xa),'patch':parseInt(_0x432efa[0x3],0xa)};}export function compareVersions(_0x59bd7f,_0x108f13){const _0x2ae515=a9_0x476e8d;if(_0x59bd7f[_0x2ae515(0x207)]!==_0x108f13[_0x2ae515(0x207)])return _0x59bd7f['major']-_0x108f13[_0x2ae515(0x207)];if(_0x59bd7f[_0x2ae515(0x1e3)]!==_0x108f13[_0x2ae515(0x1e3)])return _0x59bd7f[_0x2ae515(0x1e3)]-_0x108f13[_0x2ae515(0x1e3)];return _0x59bd7f[_0x2ae515(0x211)]-_0x108f13['patch'];}async function checkClaudeVersion(_0x48c448,_0x211a6e){const _0x29fe81=a9_0x476e8d;_0x211a6e?.[_0x29fe81(0x243)](_0x29fe81(0x214)+_0x48c448+')');const _0x3d2b48=await executeClaudeCommand(['--version'],undefined,_0x211a6e),_0x4bc0dc=parseVersion(_0x3d2b48);if(!_0x4bc0dc){_0x211a6e?.['warn']('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x3d2b48);return;}const _0x4f0aff=_0x4bc0dc[_0x29fe81(0x207)]+'.'+_0x4bc0dc[_0x29fe81(0x1e3)]+'.'+_0x4bc0dc[_0x29fe81(0x211)],_0x313934=parseVersion(_0x48c448);if(!_0x313934){_0x211a6e?.[_0x29fe81(0x251)](_0x29fe81(0x240)+_0x48c448);return;}if(compareVersions(_0x4bc0dc,_0x313934)<0x0){_0x211a6e?.[_0x29fe81(0x1ee)](_0x29fe81(0x212)+_0x4f0aff+'\x20is\x20too\x20old\x20(minimum:\x20'+_0x48c448+')');throw new SDKError(ErrorCode[_0x29fe81(0x216)],'Claude\x20Code\x20version\x20'+_0x4f0aff+_0x29fe81(0x1e2)+_0x48c448+_0x29fe81(0x1c1),undefined,{'helpText':_0x29fe81(0x223)});}_0x211a6e?.[_0x29fe81(0x243)](_0x29fe81(0x212)+_0x4f0aff+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x4c0501,_0x1c2995,_0x5b8b9d){const _0x3018af=a9_0x476e8d;return _0x5b8b9d?.['info'](_0x3018af(0x242)+_0x4c0501[_0x3018af(0x226)]('\x20')),new Promise((_0x22c688,_0x19185d)=>{const _0x12cc2d=_0x3018af,_0x5c235e=crossSpawn(_0x12cc2d(0x1ce),_0x4c0501,{'stdio':_0x12cc2d(0x22d)});let _0x189dfc='',_0x56d6a1='';_0x5c235e['stdout']?.['on']('data',_0x42e6dd=>{const _0xa8f82a=_0x12cc2d;_0x189dfc+=_0x42e6dd[_0xa8f82a(0x1d7)]();}),_0x5c235e[_0x12cc2d(0x20d)]?.['on']('data',_0x45a530=>{const _0x2d1eaf=_0x12cc2d;_0x56d6a1+=_0x45a530[_0x2d1eaf(0x1d7)]();}),_0x5c235e['on'](_0x12cc2d(0x1ee),_0x67cc3=>{const _0x5e7764=_0x12cc2d;_0x67cc3[_0x5e7764(0x1e8)]===_0x5e7764(0x247)?(_0x5b8b9d?.['error']('Claude\x20Code\x20CLI\x20not\x20found'),_0x19185d(new SDKError(ErrorCode[_0x5e7764(0x20a)],'Claude\x20Code\x20CLI\x20not\x20found',_0x67cc3,{'helpText':_0x5e7764(0x21d)}))):(_0x5b8b9d?.['error'](_0x5e7764(0x1f2)+_0x67cc3[_0x5e7764(0x23d)]),_0x19185d(new SDKError(ErrorCode[_0x5e7764(0x1c2)],_0x5e7764(0x202)+_0x67cc3[_0x5e7764(0x23d)],_0x67cc3)));}),_0x5c235e['on'](_0x12cc2d(0x1ed),_0x4fea64=>{const _0x39ddf7=_0x12cc2d;if(_0x4fea64===0x0)_0x22c688(_0x189dfc);else _0x1c2995?(_0x5b8b9d?.['error'](_0x39ddf7(0x231)+_0x4fea64+_0x39ddf7(0x236)+_0x4c0501[_0x39ddf7(0x226)]('\x20')),_0x19185d(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x1c2995,new Error(_0x56d6a1)))):_0x22c688('');});});}async function ensureMcpServer(_0x575c1f,_0x4abec3,_0x2a77c0,_0x2f02cf,_0x50f947){const _0x54217f=a9_0x476e8d;_0x2f02cf[_0x54217f(0x206)]=_0x54217f(0x22b)+_0x575c1f+'\x27...',await executeClaudeCommand([_0x54217f(0x241),_0x54217f(0x1fd),_0x575c1f,_0x4abec3,_0x54217f(0x20b),_0x2a77c0],_0x54217f(0x1fb)+_0x575c1f+'\x27',_0x50f947),_0x2f02cf[_0x54217f(0x206)]='✓\x20MCP\x20server\x20\x27'+_0x575c1f+_0x54217f(0x1cd);}export const DEFAULT_TD_SKILLS_URL=a9_0x476e8d(0x215);export function getTdSkillsRepoUrl(){const _0x5bc844=process.env.TDX_TD_SKILLS_REPO;if(_0x5bc844)return _0x5bc844;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x5b575e,_0x3e9ea5){const _0x163951=a9_0x476e8d;try{const _0x5162a8=await executeClaudeCommand([_0x163951(0x203),_0x163951(0x210),_0x163951(0x218)],_0x163951(0x208),_0x3e9ea5);if(!_0x5162a8[_0x163951(0x1d3)](_0x5b575e)){_0x3e9ea5?.[_0x163951(0x243)]('Marketplace\x20\x27'+_0x5b575e+_0x163951(0x255));return;}await executeClaudeCommand([_0x163951(0x203),_0x163951(0x210),_0x163951(0x244),_0x5b575e],_0x163951(0x23b)+_0x5b575e+'\x27',_0x3e9ea5),_0x3e9ea5?.[_0x163951(0x239)](_0x163951(0x1e4)+_0x5b575e+_0x163951(0x228));}catch(_0x18ec07){_0x3e9ea5?.[_0x163951(0x251)](_0x163951(0x23b)+_0x5b575e+_0x163951(0x1d2)+_0x18ec07);}}async function restoreDefaultTdSkillsMarketplace(_0x9ceaea){const _0x5ed1f9=a9_0x476e8d;try{await removeMarketplace(_0x5ed1f9(0x217),_0x9ceaea),await executeClaudeCommand([_0x5ed1f9(0x203),_0x5ed1f9(0x210),'add',DEFAULT_TD_SKILLS_URL],undefined,_0x9ceaea),_0x9ceaea?.[_0x5ed1f9(0x239)]('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0x297d0a,_0x138a55,_0x527f0a,_0x1c4ace){const _0x421382=a9_0x476e8d;_0x527f0a['text']='Configuring\x20marketplace\x20\x27'+_0x297d0a+_0x421382(0x1f3),await executeClaudeCommand([_0x421382(0x203),_0x421382(0x210),_0x421382(0x1fd),_0x138a55],_0x421382(0x1cf)+_0x297d0a+'\x27',_0x1c4ace),_0x527f0a[_0x421382(0x206)]='✓\x20Marketplace\x20\x27'+_0x297d0a+_0x421382(0x1cd);}async function updateMarketplace(_0x3b05e9,_0x241096,_0x48f2dd){const _0x514f44=a9_0x476e8d;_0x241096[_0x514f44(0x206)]='Updating\x20marketplace\x20\x27'+_0x3b05e9+_0x514f44(0x1f3),await executeClaudeCommand([_0x514f44(0x203),'marketplace',_0x514f44(0x1c4)],'Failed\x20to\x20update\x20marketplace\x20\x27'+_0x3b05e9+'\x27',_0x48f2dd),_0x241096[_0x514f44(0x206)]=_0x514f44(0x22e)+_0x3b05e9+'\x27\x20updated';}async function ensurePlugin(_0x561c0d,_0x5e4ba5,_0x3ffc23,_0x59e8fd){const _0x5e02f0=a9_0x476e8d;_0x3ffc23[_0x5e02f0(0x206)]=_0x5e02f0(0x20e)+_0x561c0d+_0x5e02f0(0x1f3),await executeClaudeCommand(['plugin',_0x5e02f0(0x1e1),_0x561c0d+'@'+_0x5e4ba5],_0x5e02f0(0x224)+_0x561c0d+'\x27',_0x59e8fd),_0x3ffc23['text']=_0x5e02f0(0x1d6)+_0x561c0d+'\x27\x20installed';}async function createClaudeSettings(_0x3189f4,_0x4bf370,_0x3bb597){const _0x330fe6=a9_0x476e8d,_0x4faca4=join(process['cwd'](),_0x330fe6(0x1d8)),_0x3d4436=join(_0x4faca4,_0x330fe6(0x1f7)),_0x4cfb2b=join(_0x4faca4,SETTINGS_BACKUP_FILENAME);await mkdir(_0x4faca4,{'recursive':!![]});const _0x24fc43=await recoverFromStaleBackup(_0x3d4436,_0x4cfb2b);let _0x38ed98;if(_0x24fc43)_0x38ed98=_0x24fc43[_0x330fe6(0x22f)];else{let _0x294c28={};if(existsSync(_0x3d4436))try{const _0x18edca=await readFile(_0x3d4436,_0x330fe6(0x1e0));_0x294c28=JSON[_0x330fe6(0x22a)](_0x18edca);}catch{_0x294c28={};}const _0x2bdc43=_0x294c28[_0x330fe6(0x234)]||{};_0x38ed98={'ANTHROPIC_BASE_URL':_0x2bdc43[_0x330fe6(0x21f)],'ANTHROPIC_MODEL':_0x2bdc43[_0x330fe6(0x1f5)],'ANTHROPIC_AUTH_TOKEN':_0x2bdc43['ANTHROPIC_AUTH_TOKEN'],'CLAUDE_CODE_USE_BEDROCK':_0x2bdc43[_0x330fe6(0x20f)],'CLAUDE_CODE_USE_VERTEX':_0x2bdc43[_0x330fe6(0x1f0)],'statusLine':_0x294c28[_0x330fe6(0x22c)]};const _0x3f5743={'createdAt':new Date()[_0x330fe6(0x24b)](),'pid':process[_0x330fe6(0x235)],'originalSettings':_0x38ed98};await writeFile(_0x4cfb2b,JSON['stringify'](_0x3f5743,null,0x2)+'\x0a');}let _0x3111e5={};if(existsSync(_0x3d4436))try{const _0x2989d5=await readFile(_0x3d4436,_0x330fe6(0x1e0));_0x3111e5=JSON['parse'](_0x2989d5);}catch{_0x3111e5={};}const _0x1e7376=_0x3111e5[_0x330fe6(0x234)]||{},_0x432e3a={..._0x3111e5,'env':{..._0x1e7376,'ANTHROPIC_BASE_URL':_0x330fe6(0x1fe)+_0x3189f4,..._0x4bf370&&{'ANTHROPIC_MODEL':_0x4bf370},'ANTHROPIC_AUTH_TOKEN':'tdx-managed-proxy','CLAUDE_CODE_USE_BEDROCK':_0x330fe6(0x24f),'CLAUDE_CODE_USE_VERTEX':'false'},'statusLine':{'type':'command','command':_0x3bb597?_0x330fe6(0x230)+_0x3bb597+_0x330fe6(0x1f8):_0x330fe6(0x219)}};return await writeFile(_0x3d4436,JSON['stringify'](_0x432e3a,null,0x2)+'\x0a'),_0x38ed98;}async function restoreClaudeSettings(_0x5d61cd){const _0x320f78=a9_0x476e8d,_0x44a32a=join(process[_0x320f78(0x21e)](),'.claude'),_0x524646=join(_0x44a32a,_0x320f78(0x1f7)),_0x150a8c=join(_0x44a32a,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x524646,_0x5d61cd);try{if(existsSync(_0x150a8c)){const _0xb65a11=await readFile(_0x150a8c,_0x320f78(0x1e0)),_0x378503=JSON['parse'](_0xb65a11);_0x378503[_0x320f78(0x235)]===process[_0x320f78(0x235)]&&await safeUnlink(_0x150a8c);}}catch{}}function a9_0x2086(_0x51b87d,_0x2a8385){_0x51b87d=_0x51b87d-0x1c1;const _0x909b6d=a9_0x909b();let _0x20860b=_0x909b6d[_0x51b87d];return _0x20860b;}export class ClaudeCommand extends BaseCommand{['name']=a9_0x476e8d(0x1ce);[a9_0x476e8d(0x1e5)]=a9_0x476e8d(0x252);[a9_0x476e8d(0x1c3)];['originalSettings'];['logger'];[a9_0x476e8d(0x21b)];async[a9_0x476e8d(0x1dd)](_0x335202){const _0x533851=a9_0x476e8d,{tdx:_0x3eaab8,options:_0x27bc44,args:_0x269748}=_0x335202;let _0x30a5f3=![];try{const _0x3413de=_0x27bc44,_0x2ab355=_0x3413de[_0x533851(0x200)]===![],_0xfbcf5d=_0x3413de['continue']===!![],_0x303528=_0x3413de[_0x533851(0x1e7)]===!![],_0x333a1e=[..._0x269748];if(_0xfbcf5d)_0x333a1e['unshift']('-c');else _0x303528&&_0x333a1e['unshift']('-r');const _0x25d682=createCommandSpinner(_0x533851(0x205),{'verbose':_0x27bc44[_0x533851(0x1f6)]});_0x25d682[_0x533851(0x227)]();try{if(!_0x2ab355){const _0x4c3cb7=_0x27bc44[_0x533851(0x24d)];try{const _0x17767f=await _0x3eaab8['user'][_0x533851(0x1ef)]();_0x17767f[_0x533851(0x220)]&&writeCachedAccountInfo(_0x27bc44[_0x533851(0x1f4)],_0x17767f[_0x533851(0x220)],_0x4c3cb7);}catch{}_0x25d682['text']=_0x533851(0x20c),this[_0x533851(0x250)]=new TDXLogger(_0x27bc44[_0x533851(0x24a)],!![]),await this['logger'][_0x533851(0x1ea)]();const _0x1e2100=this['logger'][_0x533851(0x1f9)]();_0x25d682[_0x533851(0x206)]=_0x533851(0x254)+_0x1e2100;const _0x6a1c15=getEndpoint(_0x27bc44['site'],_0x533851(0x1c9));_0x25d682[_0x533851(0x206)]=_0x533851(0x248);if(!_0x3eaab8['context'][_0x533851(0x1d9)])throw new SDKError(ErrorCode[_0x533851(0x253)],_0x533851(0x23a));this[_0x533851(0x1c3)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x6a1c15,'apiKey':_0x3eaab8['context'][_0x533851(0x1d9)],'logger':this['logger'],'site':_0x27bc44[_0x533851(0x1f4)],'profile':_0x4c3cb7}),await this[_0x533851(0x1c3)][_0x533851(0x227)](),this['port']=this[_0x533851(0x1c3)][_0x533851(0x21b)],_0x25d682[_0x533851(0x206)]=_0x533851(0x1fc)+this[_0x533851(0x21b)]+_0x533851(0x1c5)+_0x6a1c15,_0x25d682['text']=_0x533851(0x23e),this[_0x533851(0x21a)]=await createClaudeSettings(this[_0x533851(0x21b)],undefined,_0x4c3cb7),_0x25d682[_0x533851(0x206)]=_0x533851(0x233);}else _0x25d682[_0x533851(0x206)]=_0x533851(0x1ec);try{_0x25d682[_0x533851(0x206)]='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x533851(0x250)]),_0x25d682[_0x533851(0x206)]=_0x533851(0x249);}catch(_0xaa5b86){_0x25d682['fail'](_0x533851(0x1db));throw _0xaa5b86;}try{await ensureMcpServer(_0x533851(0x232),_0x533851(0x1c7),_0x533851(0x1c6),_0x25d682,this[_0x533851(0x250)]);}catch(_0x300c23){handleInstallationError(_0x300c23,'TD\x20Docs\x20MCP\x20Server',_0x25d682,this[_0x533851(0x250)]);}try{const _0x2af0db=getTdSkillsRepoUrl();_0x30a5f3=_0x2af0db!==DEFAULT_TD_SKILLS_URL,_0x30a5f3&&await removeMarketplace(_0x533851(0x217),this[_0x533851(0x250)]),await ensureMarketplace(_0x533851(0x217),_0x2af0db,_0x25d682,this[_0x533851(0x250)]),await updateMarketplace(_0x533851(0x217),_0x25d682,this[_0x533851(0x250)]),await ensurePlugin(_0x533851(0x204),_0x533851(0x217),_0x25d682,this['logger']),await ensurePlugin('workflow-skills','td-skills',_0x25d682,this[_0x533851(0x250)]),await ensurePlugin(_0x533851(0x201),_0x533851(0x217),_0x25d682,this[_0x533851(0x250)]);}catch(_0x32c997){handleInstallationError(_0x32c997,'td-skills\x20Plugins',_0x25d682,this['logger']);}_0x25d682[_0x533851(0x237)]();}catch(_0x4951cb){_0x25d682['fail'](_0x533851(0x1d4));throw _0x4951cb;}const _0x4b170d=await findExecutable('claude');if(!_0x4b170d)throw new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x533851(0x1dc),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0xe5b65e={...process.env};!_0x2ab355&&(_0xe5b65e[_0x533851(0x21f)]=_0x533851(0x1fe)+this[_0x533851(0x21b)],_0xe5b65e[_0x533851(0x1f1)]=_0x533851(0x1fa),_0xe5b65e[_0x533851(0x20f)]=_0x533851(0x24f),_0xe5b65e['CLAUDE_CODE_USE_VERTEX']=_0x533851(0x24f));const _0x376808=crossSpawn(_0x4b170d,_0x333a1e,{'stdio':_0x533851(0x1d1),'env':_0xe5b65e}),_0x2b39eb=await new Promise(_0x3a724f=>{const _0x2b4d61=_0x533851;_0x376808['on'](_0x2b4d61(0x1ed),_0x31502d=>{_0x3a724f(_0x31502d||0x0);}),_0x376808['on'](_0x2b4d61(0x1ee),_0x4d0e08=>{const _0x5ee062=_0x2b4d61;console[_0x5ee062(0x1ee)](a9_0x14acdf['red']('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x4d0e08[_0x5ee062(0x23d)])),_0x3a724f(0x1);});});_0x30a5f3&&await restoreDefaultTdSkillsMarketplace(this[_0x533851(0x250)]);this['passThroughServer']&&(await this[_0x533851(0x1c3)][_0x533851(0x237)](),console[_0x533851(0x21c)](a9_0x14acdf[_0x533851(0x1e9)](_0x533851(0x23f))));if(this[_0x533851(0x250)]){await this['logger'][_0x533851(0x1e6)]();const _0x46ec1f=this[_0x533851(0x250)][_0x533851(0x1f9)]();console[_0x533851(0x21c)](a9_0x14acdf[_0x533851(0x1e9)](_0x533851(0x1de)+_0x46ec1f));}return this[_0x533851(0x21a)]&&(await restoreClaudeSettings(this[_0x533851(0x21a)]),console[_0x533851(0x21c)](a9_0x14acdf['green'](_0x533851(0x229)))),_0x2b39eb;}catch(_0x1326a8){_0x30a5f3&&await restoreDefaultTdSkillsMarketplace(this[_0x533851(0x250)]);this[_0x533851(0x1c3)]&&await this[_0x533851(0x1c3)][_0x533851(0x237)]();this['logger']&&await this['logger'][_0x533851(0x1e6)]();this[_0x533851(0x21a)]&&await restoreClaudeSettings(this[_0x533851(0x21a)]);throw _0x1326a8;}}}
@@ -1 +1 @@
1
- const a10_0x213dcc=a10_0x12fa;(function(_0x3b6d5a,_0x212a98){const _0x3cb9bd=a10_0x12fa,_0x135024=_0x3b6d5a();while(!![]){try{const _0x1da028=parseInt(_0x3cb9bd(0xdf))/0x1*(parseInt(_0x3cb9bd(0xc3))/0x2)+-parseInt(_0x3cb9bd(0xe1))/0x3+parseInt(_0x3cb9bd(0xdd))/0x4*(-parseInt(_0x3cb9bd(0xd0))/0x5)+-parseInt(_0x3cb9bd(0xd1))/0x6*(parseInt(_0x3cb9bd(0xe2))/0x7)+-parseInt(_0x3cb9bd(0xe0))/0x8*(parseInt(_0x3cb9bd(0xd6))/0x9)+parseInt(_0x3cb9bd(0xc7))/0xa+parseInt(_0x3cb9bd(0xcb))/0xb;if(_0x1da028===_0x212a98)break;else _0x135024['push'](_0x135024['shift']());}catch(_0xa5dcb5){_0x135024['push'](_0x135024['shift']());}}}(a10_0x1ab1,0x21801));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';function a10_0x1ab1(){const _0x20f816=['tdx','113433xrmqmv','8JylZEr','233214vDaZqp','8890jwyVwd','\x20month','close','round','input_tokens','log','tdx\x20','accountId','2DDCwcS','\x20session\x20/\x20','context_window','toFixed','1682650NMGPAc','join','session_id','parse','4252930kdRDvJ','push','stdin','description','options','83305tQPfgB','582rUoWKG','monthCredits','💎\x20tdx\x20-\x20Claude','cache_creation_input_tokens','current_usage','1472157POLcXz','used_percentage','profile','site','name','\x20today\x20/\x20','cache_read_input_tokens','40yTQFAL'];a10_0x1ab1=function(){return _0x20f816;};return a10_0x1ab1();}import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x30db92=0x64){return new Promise(_0x35b8c1=>{const _0x202774=a10_0x12fa;let _0x4f39b3='',_0x21a4f8=![];const _0x626c43=createInterface({'input':process[_0x202774(0xcd)],'terminal':![]}),_0xd2a209=_0x2318b4=>{const _0x4e43ce=_0x202774;if(_0x21a4f8)return;_0x21a4f8=!![],clearTimeout(_0x21dfd8),_0x626c43[_0x4e43ce(0xe4)](),_0x35b8c1(_0x2318b4);},_0x21dfd8=setTimeout(()=>{_0xd2a209(null);},_0x30db92);_0x626c43['on']('line',_0x3a3c3e=>{_0x4f39b3+=_0x3a3c3e;}),_0x626c43['on'](_0x202774(0xe4),()=>{const _0x4aace0=_0x202774;if(_0x21a4f8)return;try{const _0x2a8f82=JSON[_0x4aace0(0xca)](_0x4f39b3);_0xd2a209(_0x2a8f82);}catch{_0xd2a209(null);}});});}function a10_0x12fa(_0x6cded6,_0x5759a7){_0x6cded6=_0x6cded6-0xc0;const _0x1ab17f=a10_0x1ab1();let _0x12fa6f=_0x1ab17f[_0x6cded6];return _0x12fa6f;}function formatCredits(_0x54e582){const _0x37a15d=a10_0x12fa;return _0x54e582[_0x37a15d(0xc6)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x213dcc(0xda)]='statusline';[a10_0x213dcc(0xce)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async['execute'](_0x4dd6c1){const _0x6e7572=a10_0x213dcc;try{const _0x131fb8=await readStdinJson();if(!_0x131fb8?.[_0x6e7572(0xc9)])return console[_0x6e7572(0xc0)](_0x6e7572(0xd3)),0x0;const _0x13d115=_0x131fb8[_0x6e7572(0xc9)],_0x233b1f=_0x131fb8['model']?.['id']||'',_0x189325=_0x131fb8[_0x6e7572(0xd8)]||_0x4dd6c1[_0x6e7572(0xcf)][_0x6e7572(0xd8)],_0x1faef8=await getUsageStats(_0x13d115,_0x189325),_0x55b9c4=[],_0x210a7f=readCachedAccountInfo(_0x189325),_0x41e3de=_0x210a7f?_0x6e7572(0xc1)+_0x210a7f[_0x6e7572(0xd9)]+':'+_0x210a7f[_0x6e7572(0xc2)]:_0x6e7572(0xde),_0xfa3607=_0x233b1f?getModelDisplayName(_0x233b1f):'Claude';_0x55b9c4[_0x6e7572(0xcc)]('💎\x20'+_0x41e3de+'\x20-\x20'+_0xfa3607);const _0x477dce=formatCredits(_0x1faef8['sessionCredits']),_0x24886d=formatCredits(_0x1faef8['todayCredits']),_0x1ba028=formatCredits(_0x1faef8[_0x6e7572(0xd2)]);_0x55b9c4[_0x6e7572(0xcc)]('🪙\x20credit:\x20'+_0x477dce+_0x6e7572(0xc4)+_0x24886d+_0x6e7572(0xdb)+_0x1ba028+_0x6e7572(0xe3));const _0x3261f7=_0x131fb8[_0x6e7572(0xc5)],_0x4eedc1=_0x3261f7?.[_0x6e7572(0xd5)];if(_0x4eedc1&&_0x3261f7?.[_0x6e7572(0xd7)]!=null){const _0x1841c5=_0x4eedc1[_0x6e7572(0xe6)]+_0x4eedc1[_0x6e7572(0xd4)]+_0x4eedc1[_0x6e7572(0xdc)],_0x56239a=formatTokenCount(_0x1841c5),_0x1ed74f=Math[_0x6e7572(0xe5)](_0x3261f7[_0x6e7572(0xd7)]);_0x55b9c4[_0x6e7572(0xcc)]('🧠\x20'+_0x56239a+'\x20('+_0x1ed74f+'%)');}return console[_0x6e7572(0xc0)](_0x55b9c4[_0x6e7572(0xc8)]('\x20|\x20')),0x0;}catch{return console[_0x6e7572(0xc0)](_0x6e7572(0xd3)),0x0;}}}
1
+ function a10_0x5454(){const _0x24ab11=['name','\x20month','32Lryogf','510782IMJkSW','used_percentage','log','tdx','tdx\x20','stdin','946305OoiTgP','todayCredits','\x20session\x20/\x20','input_tokens','profile','cache_read_input_tokens','description','model','\x20-\x20','close','line','sessionCredits','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','push','696699RcCINk','round','context_window','statusline','session_id','accountId','245151OnrdcY','4562160PctshM','site','\x20|\x20','join','💎\x20tdx\x20-\x20Claude','36wGKHVy','855155bxELnd','current_usage','13556916MqdOUF'];a10_0x5454=function(){return _0x24ab11;};return a10_0x5454();}const a10_0x581db7=a10_0x1a52;(function(_0x571d3a,_0x1a8e88){const _0x3e3e0f=a10_0x1a52,_0x5364ae=_0x571d3a();while(!![]){try{const _0x4e7ad8=-parseInt(_0x3e3e0f(0x15f))/0x1+parseInt(_0x3e3e0f(0x14b))/0x2+parseInt(_0x3e3e0f(0x165))/0x3*(-parseInt(_0x3e3e0f(0x144))/0x4)+-parseInt(_0x3e3e0f(0x151))/0x5+parseInt(_0x3e3e0f(0x166))/0x6+-parseInt(_0x3e3e0f(0x145))/0x7*(parseInt(_0x3e3e0f(0x14a))/0x8)+parseInt(_0x3e3e0f(0x147))/0x9;if(_0x4e7ad8===_0x1a8e88)break;else _0x5364ae['push'](_0x5364ae['shift']());}catch(_0x857fb3){_0x5364ae['push'](_0x5364ae['shift']());}}}(a10_0x5454,0x64962));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';function a10_0x1a52(_0x4f0428,_0x3fde91){_0x4f0428=_0x4f0428-0x144;const _0x5454b7=a10_0x5454();let _0x1a52d1=_0x5454b7[_0x4f0428];return _0x1a52d1;}import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x51be11=0x64){return new Promise(_0x11ca14=>{const _0x260974=a10_0x1a52;let _0x3ee75d='',_0x116c19=![];const _0x3b07ce=createInterface({'input':process[_0x260974(0x150)],'terminal':![]}),_0x323c17=_0x2f6be4=>{const _0x297b3c=_0x260974;if(_0x116c19)return;_0x116c19=!![],clearTimeout(_0x1a520c),_0x3b07ce[_0x297b3c(0x15a)](),_0x11ca14(_0x2f6be4);},_0x1a520c=setTimeout(()=>{_0x323c17(null);},_0x51be11);_0x3b07ce['on'](_0x260974(0x15b),_0x424338=>{_0x3ee75d+=_0x424338;}),_0x3b07ce['on'](_0x260974(0x15a),()=>{if(_0x116c19)return;try{const _0x5bcd08=JSON['parse'](_0x3ee75d);_0x323c17(_0x5bcd08);}catch{_0x323c17(null);}});});}function formatCredits(_0x16b9be){return _0x16b9be['toFixed'](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x581db7(0x148)]=a10_0x581db7(0x162);[a10_0x581db7(0x157)]=a10_0x581db7(0x15d);async['execute'](_0x4a06f5){const _0x12e8ce=a10_0x581db7;try{const _0x5667f4=await readStdinJson();if(!_0x5667f4?.[_0x12e8ce(0x163)])return console[_0x12e8ce(0x14d)](_0x12e8ce(0x16a)),0x0;const _0xa461fa=_0x5667f4['session_id'],_0x20af6b=_0x5667f4[_0x12e8ce(0x158)]?.['id']||'',_0x470377=_0x5667f4[_0x12e8ce(0x155)]||_0x4a06f5['options'][_0x12e8ce(0x155)],_0x584191=await getUsageStats(_0xa461fa,_0x470377),_0x28e588=[],_0x353e21=readCachedAccountInfo(_0x470377),_0x5b98ea=_0x353e21?_0x12e8ce(0x14f)+_0x353e21[_0x12e8ce(0x167)]+':'+_0x353e21[_0x12e8ce(0x164)]:_0x12e8ce(0x14e),_0x4ebfd6=_0x20af6b?getModelDisplayName(_0x20af6b):'Claude';_0x28e588[_0x12e8ce(0x15e)]('💎\x20'+_0x5b98ea+_0x12e8ce(0x159)+_0x4ebfd6);const _0x1f00d4=formatCredits(_0x584191[_0x12e8ce(0x15c)]),_0x34ea78=formatCredits(_0x584191[_0x12e8ce(0x152)]),_0x526967=formatCredits(_0x584191['monthCredits']);_0x28e588[_0x12e8ce(0x15e)]('🪙\x20credit:\x20'+_0x1f00d4+_0x12e8ce(0x153)+_0x34ea78+'\x20today\x20/\x20'+_0x526967+_0x12e8ce(0x149));const _0x1db56a=_0x5667f4[_0x12e8ce(0x161)],_0x54c4fd=_0x1db56a?.[_0x12e8ce(0x146)];if(_0x54c4fd&&_0x1db56a?.[_0x12e8ce(0x14c)]!=null){const _0x33bb3b=_0x54c4fd[_0x12e8ce(0x154)]+_0x54c4fd['cache_creation_input_tokens']+_0x54c4fd[_0x12e8ce(0x156)],_0x39f342=formatTokenCount(_0x33bb3b),_0x332405=Math[_0x12e8ce(0x160)](_0x1db56a[_0x12e8ce(0x14c)]);_0x28e588[_0x12e8ce(0x15e)]('🧠\x20'+_0x39f342+'\x20('+_0x332405+'%)');}return console['log'](_0x28e588[_0x12e8ce(0x169)](_0x12e8ce(0x168))),0x0;}catch{return console['log'](_0x12e8ce(0x16a)),0x0;}}}
@@ -1 +1 @@
1
- const a11_0x1cf786=a11_0xb0cc;(function(_0x15df2f,_0x3ab6f2){const _0x3e3f3d=a11_0xb0cc,_0x1155bd=_0x15df2f();while(!![]){try{const _0x3072d1=parseInt(_0x3e3f3d(0x181))/0x1*(-parseInt(_0x3e3f3d(0x176))/0x2)+parseInt(_0x3e3f3d(0x17c))/0x3*(parseInt(_0x3e3f3d(0x182))/0x4)+parseInt(_0x3e3f3d(0x15f))/0x5+parseInt(_0x3e3f3d(0x183))/0x6+-parseInt(_0x3e3f3d(0x161))/0x7+parseInt(_0x3e3f3d(0x15d))/0x8+parseInt(_0x3e3f3d(0x14b))/0x9*(parseInt(_0x3e3f3d(0x173))/0xa);if(_0x3072d1===_0x3ab6f2)break;else _0x1155bd['push'](_0x1155bd['shift']());}catch(_0x370aef){_0x1155bd['push'](_0x1155bd['shift']());}}}(a11_0xbadf,0x1a40f));function a11_0xbadf(){const _0x7ba830=['never','1313732gsIwdM','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','profile','max','\x20\x20Total:\x20\x20\x20','usage','totalCredits','padEnd','credits','Profile','Error:\x20','todayCredits','padStart','format','source','entryCount','today\x20','\x20\x20Month:\x20\x20\x20','229590mvVioA','en-US','execute','2ocVKYZ','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','jsonl','profileCount','Last\x20Used','short','177bPMfnH','cyan','log','toLocaleDateString','description','159569aOHjBp','10364VpTnrc','486744JSSUeV','monthCredits','\x20credits','json','map','18ZNOyRc','bold','repeat','numeric','lastUsedAt','en-CA','message','all','getTime','\x20\x20Today:\x20\x20\x20','Today','Credits','\x20days\x20ago','default','length','round','Total','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','765776ijRMLt','dim','395735uFZxCv'];a11_0xbadf=function(){return _0x7ba830;};return a11_0xbadf();}function a11_0xb0cc(_0x13392a,_0x6946e3){_0x13392a=_0x13392a-0x149;const _0xbadf9e=a11_0xbadf();let _0xb0ccb4=_0xbadf9e[_0x13392a];return _0xb0ccb4;}import a11_0x389550 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x49a067){return _0x49a067['toFixed'](0x2);}function formatLastUsed(_0x2345d0){const _0x1978de=a11_0xb0cc;if(!_0x2345d0)return _0x1978de(0x160);const _0x19aa80=new Date(_0x2345d0),_0xdaa6e2=new Date(),_0xca9921=_0x19aa80[_0x1978de(0x17f)](_0x1978de(0x150)),_0x157451=_0xdaa6e2['toLocaleDateString'](_0x1978de(0x150));if(_0xca9921===_0x157451)return _0x1978de(0x171)+_0x19aa80['toLocaleTimeString'](_0x1978de(0x174),{'hour':'2-digit','minute':'2-digit'});const _0x4ad5da=new Date(_0xca9921),_0x2b6f15=new Date(_0x157451),_0x9ae575=Math[_0x1978de(0x15a)]((_0x2b6f15[_0x1978de(0x153)]()-_0x4ad5da['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x9ae575===0x1)return'yesterday';else return _0x9ae575>0x1&&_0x9ae575<0x7?_0x9ae575+_0x1978de(0x157):_0x19aa80['toLocaleDateString'](_0x1978de(0x174),{'month':_0x1978de(0x17b),'day':_0x1978de(0x14e)});}export class ClaudeUsageCommand extends BaseCommand{['name']=a11_0x1cf786(0x166);[a11_0x1cf786(0x180)]=a11_0x1cf786(0x15c);async[a11_0x1cf786(0x175)](_0x23fb32){const _0x50c5d8=a11_0x1cf786,{options:_0x20ecec}=_0x23fb32,_0x1f0816=_0x20ecec[_0x50c5d8(0x16e)]===_0x50c5d8(0x149)||_0x20ecec['format']===_0x50c5d8(0x178)||_0x20ecec[_0x50c5d8(0x149)];try{const [_0x37a35c,_0x292327,_0x4af8f5]=await Promise[_0x50c5d8(0x152)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x1f0816?await this['outputStructured'](_0x37a35c,_0x292327,_0x4af8f5,_0x20ecec):this['outputTable'](_0x37a35c,_0x292327,_0x4af8f5),0x0;}catch(_0x11faa8){const _0x2ea493=_0x11faa8 instanceof Error?_0x11faa8[_0x50c5d8(0x151)]:'Unknown\x20error';return console['error'](a11_0x389550['red'](_0x50c5d8(0x16b)+_0x2ea493)),0x1;}}async['outputStructured'](_0x43ab84,_0x2ba96f,_0xf7cb24,_0x25c8b6){const _0x5458dc=a11_0x1cf786,_0x3a0cc0={'summary':{'todayCredits':_0xf7cb24[_0x5458dc(0x16c)],'monthCredits':_0xf7cb24[_0x5458dc(0x184)],'totalCredits':_0xf7cb24['totalCredits'],'profileCount':_0xf7cb24[_0x5458dc(0x179)]},'profiles':_0x43ab84[_0x5458dc(0x14a)](_0x434d95=>({'profile':_0x434d95[_0x5458dc(0x163)],'credits':_0x434d95[_0x5458dc(0x169)],'requests':_0x434d95['entryCount'],'lastUsedAt':_0x434d95[_0x5458dc(0x14f)]})),'sources':_0x2ba96f[_0x5458dc(0x14a)](_0x21505e=>({'source':_0x21505e[_0x5458dc(0x16f)],'credits':_0x21505e['credits'],'todayCredits':_0x21505e[_0x5458dc(0x16c)],'monthCredits':_0x21505e['monthCredits'],'requests':_0x21505e['entryCount']}))};await handleSDKOutput([_0x3a0cc0],_0x25c8b6);}['outputTable'](_0x1a349d,_0x309e2e,_0x479fdb){const _0x52071e=a11_0x1cf786;console[_0x52071e(0x17e)](a11_0x389550['bold'](_0x52071e(0x162))),console[_0x52071e(0x17e)](a11_0x389550[_0x52071e(0x15e)]('─'[_0x52071e(0x14d)](0x32))),console['log'](_0x52071e(0x154)+a11_0x389550[_0x52071e(0x17d)](formatCredits(_0x479fdb[_0x52071e(0x16c)]))+'\x20credits'),console[_0x52071e(0x17e)](_0x52071e(0x172)+a11_0x389550[_0x52071e(0x17d)](formatCredits(_0x479fdb[_0x52071e(0x184)]))+_0x52071e(0x185)),console[_0x52071e(0x17e)](_0x52071e(0x165)+a11_0x389550[_0x52071e(0x17d)](formatCredits(_0x479fdb[_0x52071e(0x167)]))+_0x52071e(0x185)),console[_0x52071e(0x17e)]();if(_0x309e2e[_0x52071e(0x159)]>0x0){console['log'](a11_0x389550[_0x52071e(0x14c)]('Usage\x20by\x20Source')),console[_0x52071e(0x17e)](a11_0x389550[_0x52071e(0x15e)]('─'[_0x52071e(0x14d)](0x3c)));const _0xf02c71=0xc,_0x39473b=0xa,_0x2a4408=0xa,_0x45f45b=0xa;console[_0x52071e(0x17e)]('\x20\x20'+'Source'[_0x52071e(0x168)](_0xf02c71)+'\x20\x20'+_0x52071e(0x15b)[_0x52071e(0x16d)](_0x39473b)+'\x20\x20'+_0x52071e(0x155)[_0x52071e(0x16d)](_0x2a4408)+'\x20\x20'+'Month'['padStart'](_0x45f45b));for(const _0x290a1a of _0x309e2e){console[_0x52071e(0x17e)]('\x20\x20'+_0x290a1a['source']['padEnd'](_0xf02c71)+'\x20\x20'+a11_0x389550['cyan'](formatCredits(_0x290a1a[_0x52071e(0x169)])[_0x52071e(0x16d)](_0x39473b))+'\x20\x20'+formatCredits(_0x290a1a[_0x52071e(0x16c)])[_0x52071e(0x16d)](_0x2a4408)+'\x20\x20'+formatCredits(_0x290a1a[_0x52071e(0x184)])[_0x52071e(0x16d)](_0x45f45b));}console[_0x52071e(0x17e)]();}if(_0x1a349d[_0x52071e(0x159)]===0x0){console[_0x52071e(0x17e)](a11_0x389550[_0x52071e(0x15e)]('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console['log'](a11_0x389550[_0x52071e(0x15e)](_0x52071e(0x177)));return;}console[_0x52071e(0x17e)](a11_0x389550['bold']('Usage\x20by\x20Profile')),console[_0x52071e(0x17e)](a11_0x389550[_0x52071e(0x15e)]('─'[_0x52071e(0x14d)](0x3c)));const _0x5dcb83=Math[_0x52071e(0x164)](0xc,..._0x1a349d[_0x52071e(0x14a)](_0x48b4ea=>_0x48b4ea['profile']===_0x52071e(0x158)?'(default)'[_0x52071e(0x159)]:_0x48b4ea[_0x52071e(0x163)]['length'])),_0x105cd1=0xa,_0x5e4f9d=0xa;console[_0x52071e(0x17e)]('\x20\x20'+_0x52071e(0x16a)[_0x52071e(0x168)](_0x5dcb83)+'\x20\x20'+_0x52071e(0x156)[_0x52071e(0x16d)](_0x105cd1)+'\x20\x20'+'Requests'[_0x52071e(0x16d)](_0x5e4f9d)+'\x20\x20'+_0x52071e(0x17a));for(const _0x5b3f3a of _0x1a349d){const _0xddb42c=_0x5b3f3a[_0x52071e(0x163)]===_0x52071e(0x158)?'(default)':_0x5b3f3a[_0x52071e(0x163)],_0x2ae003=_0xddb42c[_0x52071e(0x168)](_0x5dcb83),_0xe43d5e=_0x5b3f3a[_0x52071e(0x163)]==='default'?a11_0x389550['dim'](_0x2ae003):_0x2ae003;console[_0x52071e(0x17e)]('\x20\x20'+_0xe43d5e+'\x20\x20'+a11_0x389550[_0x52071e(0x17d)](formatCredits(_0x5b3f3a[_0x52071e(0x169)])['padStart'](_0x105cd1))+'\x20\x20'+String(_0x5b3f3a[_0x52071e(0x170)])['padStart'](_0x5e4f9d)+'\x20\x20'+a11_0x389550[_0x52071e(0x15e)](formatLastUsed(_0x5b3f3a[_0x52071e(0x14f)])));}console[_0x52071e(0x17e)](),console['log'](a11_0x389550[_0x52071e(0x15e)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console['log']();}}
1
+ function a11_0x27ec(){const _0x3ccef3=['credits','toFixed','totalCredits','\x20days\x20ago','8436474wZEVWL','padStart','Usage\x20by\x20Source','toLocaleDateString','Today','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','23296SwnqHl','en-US','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','\x20\x20Total:\x20\x20\x20','profile','3289581PfapRG','log','source','all','repeat','(default)','entryCount','today\x20','never','en-CA','2-digit','dim','json','bold','format','outputStructured','numeric','name','lastUsedAt','toLocaleTimeString','jsonl','description','10bDOMQh','Requests','Error:\x20','yesterday','2143964MpIzLS','todayCredits','execute','Credits','outputTable','57144200KMlUHK','message','Unknown\x20error','cyan','monthCredits','padEnd','max','\x20\x20Month:\x20\x20\x20','\x20credits','9RisbPi','Profile','short','getTime','usage','map','381580nxfIVF','length','default','Total','4935210auDyRD','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','1832gRVSSz'];a11_0x27ec=function(){return _0x3ccef3;};return a11_0x27ec();}function a11_0x3b26(_0x25c58e,_0x262d99){_0x25c58e=_0x25c58e-0x9f;const _0x27ec9c=a11_0x27ec();let _0x3b268b=_0x27ec9c[_0x25c58e];return _0x3b268b;}const a11_0x58120a=a11_0x3b26;(function(_0x2fabee,_0x1bc328){const _0x416b53=a11_0x3b26,_0x2d9d58=_0x2fabee();while(!![]){try{const _0x4b9fe0=parseInt(_0x416b53(0xcf))/0x1*(-parseInt(_0x416b53(0xd5))/0x2)+-parseInt(_0x416b53(0xd9))/0x3+parseInt(_0x416b53(0xc1))/0x4*(parseInt(_0x416b53(0xbd))/0x5)+-parseInt(_0x416b53(0xe2))/0x6+-parseInt(_0x416b53(0xa2))/0x7*(parseInt(_0x416b53(0xdd))/0x8)+-parseInt(_0x416b53(0xa7))/0x9+parseInt(_0x416b53(0xc6))/0xa;if(_0x4b9fe0===_0x1bc328)break;else _0x2d9d58['push'](_0x2d9d58['shift']());}catch(_0x2841cb){_0x2d9d58['push'](_0x2d9d58['shift']());}}}(a11_0x27ec,0xd969a));import a11_0x48e219 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x29e64b){const _0x717bf5=a11_0x3b26;return _0x29e64b[_0x717bf5(0xdf)](0x2);}function formatLastUsed(_0x22d040){const _0x3ac615=a11_0x3b26;if(!_0x22d040)return _0x3ac615(0xaf);const _0x4e09a7=new Date(_0x22d040),_0x521c53=new Date(),_0x521b7a=_0x4e09a7[_0x3ac615(0x9f)](_0x3ac615(0xb0)),_0x5a0308=_0x521c53[_0x3ac615(0x9f)](_0x3ac615(0xb0));if(_0x521b7a===_0x5a0308)return _0x3ac615(0xae)+_0x4e09a7[_0x3ac615(0xba)](_0x3ac615(0xa3),{'hour':_0x3ac615(0xb1),'minute':'2-digit'});const _0x156a04=new Date(_0x521b7a),_0x4587d5=new Date(_0x5a0308),_0x499d8d=Math['round']((_0x4587d5[_0x3ac615(0xd2)]()-_0x156a04[_0x3ac615(0xd2)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x499d8d===0x1)return _0x3ac615(0xc0);else return _0x499d8d>0x1&&_0x499d8d<0x7?_0x499d8d+_0x3ac615(0xe1):_0x4e09a7[_0x3ac615(0x9f)]('en-US',{'month':_0x3ac615(0xd1),'day':_0x3ac615(0xb7)});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x58120a(0xb8)]=a11_0x58120a(0xd3);[a11_0x58120a(0xbc)]=a11_0x58120a(0xdc);async[a11_0x58120a(0xc3)](_0x3f7ede){const _0x11d137=a11_0x58120a,{options:_0x31a6c3}=_0x3f7ede,_0x59bf06=_0x31a6c3[_0x11d137(0xb5)]===_0x11d137(0xb3)||_0x31a6c3['format']===_0x11d137(0xbb)||_0x31a6c3[_0x11d137(0xb3)];try{const [_0x5115ea,_0x596c99,_0x3ce466]=await Promise[_0x11d137(0xaa)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x59bf06?await this[_0x11d137(0xb6)](_0x5115ea,_0x596c99,_0x3ce466,_0x31a6c3):this[_0x11d137(0xc5)](_0x5115ea,_0x596c99,_0x3ce466),0x0;}catch(_0x50e3e4){const _0x5f50ff=_0x50e3e4 instanceof Error?_0x50e3e4[_0x11d137(0xc7)]:_0x11d137(0xc8);return console['error'](a11_0x48e219['red'](_0x11d137(0xbf)+_0x5f50ff)),0x1;}}async['outputStructured'](_0x5d7d56,_0x3407ef,_0x201039,_0x1256b4){const _0x3c0ce3=a11_0x58120a,_0x1d21cb={'summary':{'todayCredits':_0x201039[_0x3c0ce3(0xc2)],'monthCredits':_0x201039[_0x3c0ce3(0xca)],'totalCredits':_0x201039[_0x3c0ce3(0xe0)],'profileCount':_0x201039['profileCount']},'profiles':_0x5d7d56[_0x3c0ce3(0xd4)](_0x5225d2=>({'profile':_0x5225d2['profile'],'credits':_0x5225d2[_0x3c0ce3(0xde)],'requests':_0x5225d2[_0x3c0ce3(0xad)],'lastUsedAt':_0x5225d2[_0x3c0ce3(0xb9)]})),'sources':_0x3407ef[_0x3c0ce3(0xd4)](_0x4c8581=>({'source':_0x4c8581[_0x3c0ce3(0xa9)],'credits':_0x4c8581[_0x3c0ce3(0xde)],'todayCredits':_0x4c8581[_0x3c0ce3(0xc2)],'monthCredits':_0x4c8581[_0x3c0ce3(0xca)],'requests':_0x4c8581[_0x3c0ce3(0xad)]}))};await handleSDKOutput([_0x1d21cb],_0x1256b4);}['outputTable'](_0x3d1f91,_0x1cde9b,_0x2fa884){const _0x3cf348=a11_0x58120a;console[_0x3cf348(0xa8)](a11_0x48e219[_0x3cf348(0xb4)](_0x3cf348(0xa4))),console['log'](a11_0x48e219[_0x3cf348(0xb2)]('─'['repeat'](0x32))),console[_0x3cf348(0xa8)]('\x20\x20Today:\x20\x20\x20'+a11_0x48e219[_0x3cf348(0xc9)](formatCredits(_0x2fa884[_0x3cf348(0xc2)]))+_0x3cf348(0xce)),console[_0x3cf348(0xa8)](_0x3cf348(0xcd)+a11_0x48e219[_0x3cf348(0xc9)](formatCredits(_0x2fa884[_0x3cf348(0xca)]))+_0x3cf348(0xce)),console['log'](_0x3cf348(0xa5)+a11_0x48e219['cyan'](formatCredits(_0x2fa884[_0x3cf348(0xe0)]))+_0x3cf348(0xce)),console[_0x3cf348(0xa8)]();if(_0x1cde9b[_0x3cf348(0xd6)]>0x0){console[_0x3cf348(0xa8)](a11_0x48e219[_0x3cf348(0xb4)](_0x3cf348(0xe4))),console[_0x3cf348(0xa8)](a11_0x48e219['dim']('─'[_0x3cf348(0xab)](0x3c)));const _0x50b9a1=0xc,_0x1b73ed=0xa,_0x1802b4=0xa,_0x35ee8a=0xa;console[_0x3cf348(0xa8)]('\x20\x20'+'Source'['padEnd'](_0x50b9a1)+'\x20\x20'+_0x3cf348(0xd8)[_0x3cf348(0xe3)](_0x1b73ed)+'\x20\x20'+_0x3cf348(0xa0)[_0x3cf348(0xe3)](_0x1802b4)+'\x20\x20'+'Month'[_0x3cf348(0xe3)](_0x35ee8a));for(const _0x3f31f7 of _0x1cde9b){console[_0x3cf348(0xa8)]('\x20\x20'+_0x3f31f7[_0x3cf348(0xa9)]['padEnd'](_0x50b9a1)+'\x20\x20'+a11_0x48e219[_0x3cf348(0xc9)](formatCredits(_0x3f31f7['credits'])[_0x3cf348(0xe3)](_0x1b73ed))+'\x20\x20'+formatCredits(_0x3f31f7[_0x3cf348(0xc2)])[_0x3cf348(0xe3)](_0x1802b4)+'\x20\x20'+formatCredits(_0x3f31f7[_0x3cf348(0xca)])['padStart'](_0x35ee8a));}console[_0x3cf348(0xa8)]();}if(_0x3d1f91[_0x3cf348(0xd6)]===0x0){console[_0x3cf348(0xa8)](a11_0x48e219[_0x3cf348(0xb2)](_0x3cf348(0xda))),console[_0x3cf348(0xa8)](a11_0x48e219[_0x3cf348(0xb2)](_0x3cf348(0xa1)));return;}console[_0x3cf348(0xa8)](a11_0x48e219['bold']('Usage\x20by\x20Profile')),console[_0x3cf348(0xa8)](a11_0x48e219[_0x3cf348(0xb2)]('─'[_0x3cf348(0xab)](0x3c)));const _0x2559fc=Math[_0x3cf348(0xcc)](0xc,..._0x3d1f91['map'](_0x843060=>_0x843060['profile']===_0x3cf348(0xd7)?'(default)'[_0x3cf348(0xd6)]:_0x843060[_0x3cf348(0xa6)]['length'])),_0xb81a7=0xa,_0x27a108=0xa;console[_0x3cf348(0xa8)]('\x20\x20'+_0x3cf348(0xd0)['padEnd'](_0x2559fc)+'\x20\x20'+_0x3cf348(0xc4)[_0x3cf348(0xe3)](_0xb81a7)+'\x20\x20'+_0x3cf348(0xbe)[_0x3cf348(0xe3)](_0x27a108)+'\x20\x20'+'Last\x20Used');for(const _0x5a03a3 of _0x3d1f91){const _0x3d9709=_0x5a03a3['profile']==='default'?_0x3cf348(0xac):_0x5a03a3[_0x3cf348(0xa6)],_0x1e4fdc=_0x3d9709[_0x3cf348(0xcb)](_0x2559fc),_0x39bd26=_0x5a03a3[_0x3cf348(0xa6)]===_0x3cf348(0xd7)?a11_0x48e219['dim'](_0x1e4fdc):_0x1e4fdc;console[_0x3cf348(0xa8)]('\x20\x20'+_0x39bd26+'\x20\x20'+a11_0x48e219[_0x3cf348(0xc9)](formatCredits(_0x5a03a3['credits'])[_0x3cf348(0xe3)](_0xb81a7))+'\x20\x20'+String(_0x5a03a3[_0x3cf348(0xad)])[_0x3cf348(0xe3)](_0x27a108)+'\x20\x20'+a11_0x48e219[_0x3cf348(0xb2)](formatLastUsed(_0x5a03a3[_0x3cf348(0xb9)])));}console[_0x3cf348(0xa8)](),console[_0x3cf348(0xa8)](a11_0x48e219[_0x3cf348(0xb2)](_0x3cf348(0xdb))),console['log']();}}
@@ -1 +1 @@
1
- const a12_0xff0276=a12_0x11d6;function a12_0x4bb4(){const _0xa1264c=['Error:\x20','red','USER_ERROR','problemDetails','status','\x20--profile\x20','dim','.\x20Must\x20be\x20a\x20number.','4261124wCxIhN','validateGlobalOptions','getAll','16eLPyxh','24861280nXWiHM','Authentication\x20failed','yellow','message','run','value','category','858055DxIYyc','1721158dTGQcR','helpText','has','\x0aStack\x20trace:\x0a','Authentication\x20error\x20stack\x20trace:','183354xIpHwR','stack','1QiaYAO','9bKBHDl','command','profile','Reason:\x20','Command\x20\x27','tdx\x20auth','Invalid\x20limit\x20value:\x20','5488674LPgDIp','commands','4507592fFOWqp','number','detail','cyan','limit','values','test','debug','get','from','tdx\x20auth\x20setup','name','options','execute','error','To\x20set\x20up\x20authentication:'];a12_0x4bb4=function(){return _0xa1264c;};return a12_0x4bb4();}(function(_0x3958a5,_0x1d3a48){const _0x10d8c0=a12_0x11d6,_0x116883=_0x3958a5();while(!![]){try{const _0x364f8d=-parseInt(_0x10d8c0(0xc3))/0x1*(parseInt(_0x10d8c0(0xbc))/0x2)+-parseInt(_0x10d8c0(0xc1))/0x3*(parseInt(_0x10d8c0(0xb3))/0x4)+parseInt(_0x10d8c0(0xbb))/0x5+-parseInt(_0x10d8c0(0x96))/0x6+-parseInt(_0x10d8c0(0xb0))/0x7+parseInt(_0x10d8c0(0x98))/0x8+-parseInt(_0x10d8c0(0xc4))/0x9*(-parseInt(_0x10d8c0(0xb4))/0xa);if(_0x364f8d===_0x1d3a48)break;else _0x116883['push'](_0x116883['shift']());}catch(_0x2ff7b0){_0x116883['push'](_0x116883['shift']());}}}(a12_0x4bb4,0x90af2));function a12_0x11d6(_0x325614,_0x2f734f){_0x325614=_0x325614-0x92;const _0x4bb471=a12_0x4bb4();let _0x11d67f=_0x4bb471[_0x325614];return _0x11d67f;}import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a12_0xd44daf from'chalk';export function printAuthError(_0x53cf5d,_0x2786a1=![],_0x458bd4){const _0x34ca75=a12_0x11d6,_0x247a8a=_0x53cf5d[_0x34ca75(0xab)]?.[_0x34ca75(0x9a)]||_0x53cf5d[_0x34ca75(0xb7)];console[_0x34ca75(0xa6)](a12_0xd44daf[_0x34ca75(0xa9)](_0x34ca75(0xb5))),console[_0x34ca75(0xa6)](a12_0xd44daf[_0x34ca75(0xa9)](_0x34ca75(0x92)+_0x247a8a));if(_0x2786a1){const _0x3c36d7=_0x458bd4?_0x34ca75(0xad)+_0x458bd4:'';console['error']('\x0a'+a12_0xd44daf[_0x34ca75(0xae)](_0x34ca75(0xa7))),console['error']('\x20\x20'+a12_0xd44daf[_0x34ca75(0x9b)](_0x34ca75(0xa2)+_0x3c36d7)+'\x0a'),console[_0x34ca75(0xa6)](''+a12_0xd44daf[_0x34ca75(0xae)]('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x34ca75(0xa6)]('\x20\x20'+a12_0xd44daf[_0x34ca75(0x9b)](_0x34ca75(0x94)+_0x3c36d7));}}export class BaseCommand{[a12_0xff0276(0xb1)](_0xef6bf8){const _0x230619=a12_0xff0276,{options:_0x29cdf7}=_0xef6bf8,_0x372e91=_0x29cdf7[_0x230619(0x9c)];if(_0x372e91!==undefined){const _0x1f1221=typeof _0x372e91===_0x230619(0x99)?_0x372e91:parseInt(_0x372e91,0xa);if(isNaN(_0x1f1221))return _0x230619(0x95)+_0x372e91+_0x230619(0xaf);const _0x5d9d39=validateLimitOption(_0x1f1221);if(!_0x5d9d39['isValid'])return _0x5d9d39[_0x230619(0xa6)];_0xef6bf8[_0x230619(0xa4)]['limit']=_0x5d9d39[_0x230619(0xb9)];}return undefined;}['validate'](_0x563eb7){return undefined;}async[a12_0xff0276(0xb8)](_0x578486){const _0x109053=a12_0xff0276;try{const _0x25618e=this[_0x109053(0xb1)](_0x578486);if(_0x25618e)return console['error']('Error:\x20'+_0x25618e),0x1;const _0x3df3e5=this['validate'](_0x578486);if(_0x3df3e5){const _0x57e123=/^\s*(Usage|Note|Warning|Error):/i[_0x109053(0x9e)](_0x3df3e5);return _0x57e123?console['error'](_0x3df3e5):console[_0x109053(0xa6)](_0x109053(0xa8)+_0x3df3e5),0x1;}const _0x5294bf=await this[_0x109053(0xa5)](_0x578486);return _0x5294bf??0x0;}catch(_0xc448ca){if(_0xc448ca instanceof Error){if(_0xc448ca instanceof HTTPClientError&&_0xc448ca[_0x109053(0xac)]===0x191){const _0x423818=_0x578486[_0x109053(0xa4)][_0x109053(0xc6)];printAuthError(_0xc448ca,!![],_0x423818);if(_0xc448ca[_0x109053(0xc2)]){const _0x9500aa=Logger['of'](_0x109053(0xc5));_0x9500aa[_0x109053(0x9f)](_0x109053(0xc0)),_0x9500aa['debug'](_0xc448ca[_0x109053(0xc2)]);}return 0x1;}console[_0x109053(0xa6)](a12_0xd44daf['red'](_0x109053(0xa8)+_0xc448ca[_0x109053(0xb7)]));_0xc448ca instanceof SDKError&&_0xc448ca[_0x109053(0xbd)]&&console[_0x109053(0xa6)](a12_0xd44daf[_0x109053(0xb6)](_0xc448ca[_0x109053(0xbd)]));const _0x5c1f58=_0xc448ca instanceof SDKError&&_0xc448ca[_0x109053(0xba)]===ErrorCategory[_0x109053(0xaa)];_0xc448ca['stack']&&!_0x5c1f58&&console[_0x109053(0xa6)](_0x109053(0xbf)+_0xc448ca[_0x109053(0xc2)]);}else console[_0x109053(0xa6)]('Error:\x20'+String(_0xc448ca));return 0x1;}}}export class CommandRegistry{[a12_0xff0276(0x97)]=new Map();['register'](_0x107054){const _0x29e7e0=a12_0xff0276;if(this[_0x29e7e0(0x97)][_0x29e7e0(0xbe)](_0x107054[_0x29e7e0(0xa3)]))throw new Error(_0x29e7e0(0x93)+_0x107054[_0x29e7e0(0xa3)]+'\x27\x20is\x20already\x20registered');this[_0x29e7e0(0x97)]['set'](_0x107054[_0x29e7e0(0xa3)],_0x107054);}[a12_0xff0276(0xa0)](_0x5b7726){const _0xd9b930=a12_0xff0276;return this[_0xd9b930(0x97)][_0xd9b930(0xa0)](_0x5b7726);}[a12_0xff0276(0xb2)](){const _0x3c4992=a12_0xff0276;return Array[_0x3c4992(0xa1)](this['commands'][_0x3c4992(0x9d)]());}[a12_0xff0276(0xbe)](_0x30884a){const _0x423eb1=a12_0xff0276;return this[_0x423eb1(0x97)]['has'](_0x30884a);}}export const registry=new CommandRegistry();
1
+ const a12_0x4b39f9=a12_0x29de;(function(_0x2248b5,_0x1c4299){const _0x68bf15=a12_0x29de,_0x2f4934=_0x2248b5();while(!![]){try{const _0x2e6520=parseInt(_0x68bf15(0x1ef))/0x1+-parseInt(_0x68bf15(0x1f4))/0x2*(-parseInt(_0x68bf15(0x1dc))/0x3)+-parseInt(_0x68bf15(0x1d8))/0x4+-parseInt(_0x68bf15(0x1ec))/0x5+-parseInt(_0x68bf15(0x1d5))/0x6*(parseInt(_0x68bf15(0x1d1))/0x7)+-parseInt(_0x68bf15(0x1ea))/0x8+parseInt(_0x68bf15(0x1e7))/0x9*(parseInt(_0x68bf15(0x1cc))/0xa);if(_0x2e6520===_0x1c4299)break;else _0x2f4934['push'](_0x2f4934['shift']());}catch(_0x38b67d){_0x2f4934['push'](_0x2f4934['shift']());}}}(a12_0xf6c2,0xae928));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a12_0xf6c2(){const _0x1fff7f=['Reason:\x20','command','red','42906pGwwAj','register','run','3787576HlGuST','error','validate','values','3TcVKlH','detail','\x20--profile\x20','To\x20set\x20up\x20authentication:','options','Command\x20\x27','\x27\x20is\x20already\x20registered','test','\x0aStack\x20trace:\x0a','cyan','validateGlobalOptions','11595321vmADRP','execute','Error:\x20','9634960NAUjae','name','1811490REDRRN','problemDetails','message','1195961kiiYKP','get','profile','commands','Authentication\x20failed','1502862zxQVcD','stack','from','has','limit','debug','10LIXuCG','helpText','isValid','value','USER_ERROR','7XIQdTE'];a12_0xf6c2=function(){return _0x1fff7f;};return a12_0xf6c2();}import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a12_0x432e5c from'chalk';export function printAuthError(_0xdfa848,_0x583028=![],_0x385c4d){const _0x12378a=a12_0x29de,_0x43650f=_0xdfa848[_0x12378a(0x1ed)]?.[_0x12378a(0x1dd)]||_0xdfa848[_0x12378a(0x1ee)];console[_0x12378a(0x1d9)](a12_0x432e5c[_0x12378a(0x1d4)](_0x12378a(0x1f3))),console[_0x12378a(0x1d9)](a12_0x432e5c[_0x12378a(0x1d4)](_0x12378a(0x1d2)+_0x43650f));if(_0x583028){const _0x4aba55=_0x385c4d?_0x12378a(0x1de)+_0x385c4d:'';console[_0x12378a(0x1d9)]('\x0a'+a12_0x432e5c['dim'](_0x12378a(0x1df))),console[_0x12378a(0x1d9)]('\x20\x20'+a12_0x432e5c['cyan']('tdx\x20auth\x20setup'+_0x4aba55)+'\x0a'),console[_0x12378a(0x1d9)](''+a12_0x432e5c['dim']('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x12378a(0x1d9)]('\x20\x20'+a12_0x432e5c[_0x12378a(0x1e5)]('tdx\x20auth'+_0x4aba55));}}export class BaseCommand{[a12_0x4b39f9(0x1e6)](_0x42945b){const _0x5a45b2=a12_0x4b39f9,{options:_0x565d57}=_0x42945b,_0x412e1f=_0x565d57[_0x5a45b2(0x1ca)];if(_0x412e1f!==undefined){const _0x48fd2f=typeof _0x412e1f==='number'?_0x412e1f:parseInt(_0x412e1f,0xa);if(isNaN(_0x48fd2f))return'Invalid\x20limit\x20value:\x20'+_0x412e1f+'.\x20Must\x20be\x20a\x20number.';const _0x1bff15=validateLimitOption(_0x48fd2f);if(!_0x1bff15[_0x5a45b2(0x1ce)])return _0x1bff15[_0x5a45b2(0x1d9)];_0x42945b[_0x5a45b2(0x1e0)][_0x5a45b2(0x1ca)]=_0x1bff15[_0x5a45b2(0x1cf)];}return undefined;}[a12_0x4b39f9(0x1da)](_0x57fb57){return undefined;}async[a12_0x4b39f9(0x1d7)](_0x293164){const _0x16d0e9=a12_0x4b39f9;try{const _0x566f8b=this[_0x16d0e9(0x1e6)](_0x293164);if(_0x566f8b)return console['error'](_0x16d0e9(0x1e9)+_0x566f8b),0x1;const _0x210391=this[_0x16d0e9(0x1da)](_0x293164);if(_0x210391){const _0x10f9d2=/^\s*(Usage|Note|Warning|Error):/i[_0x16d0e9(0x1e3)](_0x210391);return _0x10f9d2?console[_0x16d0e9(0x1d9)](_0x210391):console['error'](_0x16d0e9(0x1e9)+_0x210391),0x1;}const _0x59536b=await this[_0x16d0e9(0x1e8)](_0x293164);return _0x59536b??0x0;}catch(_0x34d4a1){if(_0x34d4a1 instanceof Error){if(_0x34d4a1 instanceof HTTPClientError&&_0x34d4a1['status']===0x191){const _0x2597c8=_0x293164['options'][_0x16d0e9(0x1f1)];printAuthError(_0x34d4a1,!![],_0x2597c8);if(_0x34d4a1[_0x16d0e9(0x1c7)]){const _0x2837b7=Logger['of'](_0x16d0e9(0x1d3));_0x2837b7[_0x16d0e9(0x1cb)]('Authentication\x20error\x20stack\x20trace:'),_0x2837b7['debug'](_0x34d4a1[_0x16d0e9(0x1c7)]);}return 0x1;}console[_0x16d0e9(0x1d9)](a12_0x432e5c['red'](_0x16d0e9(0x1e9)+_0x34d4a1['message']));_0x34d4a1 instanceof SDKError&&_0x34d4a1[_0x16d0e9(0x1cd)]&&console[_0x16d0e9(0x1d9)](a12_0x432e5c['yellow'](_0x34d4a1[_0x16d0e9(0x1cd)]));const _0x4db67a=_0x34d4a1 instanceof SDKError&&_0x34d4a1['category']===ErrorCategory[_0x16d0e9(0x1d0)];_0x34d4a1[_0x16d0e9(0x1c7)]&&!_0x4db67a&&console[_0x16d0e9(0x1d9)](_0x16d0e9(0x1e4)+_0x34d4a1[_0x16d0e9(0x1c7)]);}else console['error'](_0x16d0e9(0x1e9)+String(_0x34d4a1));return 0x1;}}}export class CommandRegistry{[a12_0x4b39f9(0x1f2)]=new Map();[a12_0x4b39f9(0x1d6)](_0x29ac94){const _0x361630=a12_0x4b39f9;if(this[_0x361630(0x1f2)][_0x361630(0x1c9)](_0x29ac94[_0x361630(0x1eb)]))throw new Error(_0x361630(0x1e1)+_0x29ac94[_0x361630(0x1eb)]+_0x361630(0x1e2));this[_0x361630(0x1f2)]['set'](_0x29ac94['name'],_0x29ac94);}['get'](_0x49fa3f){const _0x47fb53=a12_0x4b39f9;return this['commands'][_0x47fb53(0x1f0)](_0x49fa3f);}['getAll'](){const _0xd14a8c=a12_0x4b39f9;return Array[_0xd14a8c(0x1c8)](this['commands'][_0xd14a8c(0x1db)]());}['has'](_0x489e56){return this['commands']['has'](_0x489e56);}}function a12_0x29de(_0x53e314,_0x2dedde){_0x53e314=_0x53e314-0x1c7;const _0xf6c2bd=a12_0xf6c2();let _0x29de61=_0xf6c2bd[_0x53e314];return _0x29de61;}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a13_0x295b1e=a13_0x4ffc;(function(_0x29578c,_0x1cfde1){const _0x585456=a13_0x4ffc,_0x1a32f4=_0x29578c();while(!![]){try{const _0x3ddecb=parseInt(_0x585456(0x167))/0x1*(parseInt(_0x585456(0x192))/0x2)+parseInt(_0x585456(0x162))/0x3*(parseInt(_0x585456(0x17e))/0x4)+parseInt(_0x585456(0x1aa))/0x5*(-parseInt(_0x585456(0x19e))/0x6)+-parseInt(_0x585456(0x188))/0x7+parseInt(_0x585456(0x15d))/0x8*(parseInt(_0x585456(0x14b))/0x9)+-parseInt(_0x585456(0x164))/0xa*(-parseInt(_0x585456(0x185))/0xb)+-parseInt(_0x585456(0x19f))/0xc;if(_0x3ddecb===_0x1cfde1)break;else _0x1a32f4['push'](_0x1a32f4['shift']());}catch(_0xa0bd27){_0x1a32f4['push'](_0x1a32f4['shift']());}}}(a13_0x9019,0x940cd));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a13_0x9019(){const _0x1ee2f0=['input','connection','type','getMetadata','validate','object','dim','blue','table','cyan','connection:show','legacy','Listing\x20connector\x20types...','35268qbZWCg','filter','Name:\x20','resolve','verbose','connection:types','map','77bqPxIV','minimum','site','3493329vgheGw','yellow','default_value','repeat','data','Default:\x20','✔\x20Found\x20','options','bold','list','50980sMHoQK','Site:\x20','name','Range:\x20','error','enumeration','execute','\x27\x20as\x20connector\x20type','\x20connector\x20type','title','maximum','Options:\x20','17148ewoAsY','13855884HHekyn','owner','padStart','length','value','\x27\x20(type:\x20','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','hint','\x20\x20\x20\x20Options:\x20','settings','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','1610pjglaa','✔\x20Resolved\x20\x27','Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.','Fetching\x20connection\x20\x27','\x20-\x20','List\x20available\x20connector\x20types','List\x20all\x20result\x20output\x20connections','push','\x0aConnector:\x20','join','Resolving\x20connector\x20type\x20or\x20name:\x20','\x27...','connection:list','record','entries','getOutputSchema','9JqmzrZ','Show\x20when:\x20','\x20[record]','\x20connection','connection:schema','\x0aNo\x20credential\x20settings\x20defined','sort','Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.','limit','✔\x20Found\x20schema\x20for\x20connection\x20\x27','description','green','criteria','\x0aAvailable\x20fields:','localeCompare','legacy_settings','>=\x20','stringify','4132168Jokfao','\x0aCredential\x20settings:','listTypes','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','hidden','321ROGrIm','<=\x20','1438190bzMbNd','Type:\x20','properties','28KLuhia','log','Looking\x20up\x20connection:\x20','No\x20available\x20fields\x20for\x20this\x20connector','max','output','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','Fetching\x20schema\x20for\x20\x27','label','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'];a13_0x9019=function(){return _0x1ee2f0;};return a13_0x9019();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0x52f6d0 from'chalk';function normalizeSchemaForDisplay(_0x6c69d){const _0x5fd8e8=a13_0x4ffc,_0x56b4e7=_0x6c69d[_0x5fd8e8(0x166)]||[],_0xbe5d6e=_0x56b4e7['find'](_0x42ec6d=>_0x42ec6d[_0x5fd8e8(0x194)]===_0x5fd8e8(0x15a)&&_0x42ec6d['type']===_0x5fd8e8(0x148)&&_0x42ec6d[_0x5fd8e8(0x166)]);if(_0xbe5d6e?.[_0x5fd8e8(0x166)]){const _0x2bf523=_0x56b4e7[_0x5fd8e8(0x17f)](_0x51dc9e=>_0x51dc9e[_0x5fd8e8(0x194)]!==_0x5fd8e8(0x17c)&&_0x51dc9e[_0x5fd8e8(0x194)]!==_0x5fd8e8(0x15a));return[..._0x2bf523,..._0xbe5d6e[_0x5fd8e8(0x166)]];}return _0x56b4e7[_0x5fd8e8(0x17f)](_0x51e5a0=>_0x51e5a0[_0x5fd8e8(0x194)]!==_0x5fd8e8(0x17c));}function printSchemaFields(_0x6509f8,_0x3d0177){const _0x1a9533=a13_0x4ffc,_0x304bd5='\x20\x20'[_0x1a9533(0x18b)](_0x3d0177+0x1),_0x1e62b8='\x20\x20'['repeat'](_0x3d0177+0x2);for(const _0x572b9f of _0x6509f8){if(!_0x572b9f[_0x1a9533(0x194)])continue;const _0x344a4b=_0x572b9f[_0x1a9533(0x173)]===_0x1a9533(0x148)&&_0x572b9f['properties']&&_0x572b9f[_0x1a9533(0x166)][_0x1a9533(0x1a2)]>0x0&&_0x572b9f[_0x1a9533(0x194)]!==_0x1a9533(0x15a);let _0x50bdd2=''+_0x304bd5+a13_0x52f6d0['green'](_0x572b9f[_0x1a9533(0x194)]);_0x572b9f[_0x1a9533(0x19b)]&&(_0x50bdd2+=':\x20'+_0x572b9f[_0x1a9533(0x19b)]);if(_0x572b9f[_0x1a9533(0x171)])_0x50bdd2+=a13_0x52f6d0[_0x1a9533(0x177)]('\x20['+_0x572b9f[_0x1a9533(0x171)]+']');else _0x344a4b&&(_0x50bdd2+=a13_0x52f6d0['dim'](_0x1a9533(0x14d)));console[_0x1a9533(0x168)](_0x50bdd2);_0x572b9f[_0x1a9533(0x155)]&&console[_0x1a9533(0x168)](''+_0x1e62b8+a13_0x52f6d0[_0x1a9533(0x177)](_0x572b9f[_0x1a9533(0x155)]));if(_0x572b9f['enumeration']){const _0x153396=_0x572b9f[_0x1a9533(0x197)][_0x1a9533(0x184)](_0x58bd07=>typeof _0x58bd07===_0x1a9533(0x176)&&_0x1a9533(0x1a3)in _0x58bd07?_0x58bd07[_0x1a9533(0x1a3)]:_0x58bd07)['join'](',\x20');console[_0x1a9533(0x168)](_0x1e62b8+_0x1a9533(0x19d)+a13_0x52f6d0[_0x1a9533(0x189)](_0x153396));}_0x572b9f['default_value']!==undefined&&console[_0x1a9533(0x168)](_0x1e62b8+_0x1a9533(0x18d)+a13_0x52f6d0[_0x1a9533(0x178)](String(_0x572b9f['default_value'])));if(_0x572b9f[_0x1a9533(0x186)]!==undefined||_0x572b9f['maximum']!==undefined){const _0x4d15be=_0x572b9f[_0x1a9533(0x186)]!==undefined&&_0x572b9f[_0x1a9533(0x19c)]!==undefined?_0x572b9f['minimum']+_0x1a9533(0x13f)+_0x572b9f[_0x1a9533(0x19c)]:_0x572b9f['minimum']!==undefined?_0x1a9533(0x15b)+_0x572b9f[_0x1a9533(0x186)]:_0x1a9533(0x163)+_0x572b9f[_0x1a9533(0x19c)];console['log'](_0x1e62b8+_0x1a9533(0x195)+a13_0x52f6d0['blue'](_0x4d15be));}if(_0x572b9f[_0x1a9533(0x157)]){const _0x3c540b=Object[_0x1a9533(0x149)](_0x572b9f['criteria'])[_0x1a9533(0x184)](([_0xd0fe97,_0xcd0dcf])=>_0xd0fe97+'='+JSON[_0x1a9533(0x15c)](_0xcd0dcf))['join'](',\x20');console[_0x1a9533(0x168)](''+_0x1e62b8+a13_0x52f6d0['dim'](_0x1a9533(0x14c)+_0x3c540b));}_0x344a4b&&_0x572b9f[_0x1a9533(0x166)]&&printSchemaFields(_0x572b9f[_0x1a9533(0x166)],_0x3d0177+0x1);}}function a13_0x4ffc(_0x556116,_0x1b5d45){_0x556116=_0x556116-0x13f;const _0x90191=a13_0x9019();let _0x4ffcf2=_0x90191[_0x556116];return _0x4ffcf2;}export class ConnectionListCommand extends BaseCommand{['name']=a13_0x295b1e(0x147);[a13_0x295b1e(0x155)]=a13_0x295b1e(0x141);async[a13_0x295b1e(0x198)](_0x1dadd6){const _0x16fff4=a13_0x295b1e,{options:_0x496d22,tdx:_0x4b85ce}=_0x1dadd6;_0x496d22[_0x16fff4(0x182)]&&console[_0x16fff4(0x196)]('Site:\x20'+_0x496d22[_0x16fff4(0x187)]);const _0x116402=resolveLimit(_0x496d22[_0x16fff4(0x153)],DEFAULT_LISTING_LIMIT),_0x18384a=await withSpinner('Listing\x20connections...',()=>_0x4b85ce['connection'][_0x16fff4(0x191)](),{'verbose':_0x496d22[_0x16fff4(0x182)]}),_0x4e5384=_0x18384a[_0x16fff4(0x18c)];console[_0x16fff4(0x196)](_0x16fff4(0x18e)+_0x4e5384['length']+_0x16fff4(0x14e)+(_0x4e5384[_0x16fff4(0x1a2)]!==0x1?'s':''));if(isStructuredFormat(_0x496d22)){const _0x5e1feb=_0x4e5384['slice'](0x0,_0x116402);await handleSDKOutput(_0x5e1feb,{..._0x496d22,'limit':_0x116402});}else{const _0x350f14=_0x4e5384['length']>0x0?Math[_0x16fff4(0x16b)](..._0x4e5384[_0x16fff4(0x184)](_0x3027d7=>_0x3027d7[_0x16fff4(0x173)][_0x16fff4(0x1a2)])):0x0,_0x4b58e2=[];for(const _0x4d33d0 of _0x4e5384){const _0x4fc2e9=a13_0x52f6d0['cyan'](_0x4d33d0[_0x16fff4(0x173)]['padStart'](_0x350f14)),_0x568d59=_0x4d33d0[_0x16fff4(0x1a0)]?.[_0x16fff4(0x194)]?_0x16fff4(0x13f)+a13_0x52f6d0['dim'](_0x4d33d0[_0x16fff4(0x1a0)][_0x16fff4(0x194)]):'';_0x4b58e2[_0x16fff4(0x142)](_0x4fc2e9+'\x20\x20'+_0x4d33d0[_0x16fff4(0x194)]+_0x568d59);}await writeOutput(_0x4b58e2[_0x16fff4(0x144)]('\x0a'),_0x496d22[_0x16fff4(0x16c)],_0x16fff4(0x179));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x295b1e(0x194)]=a13_0x295b1e(0x17b);[a13_0x295b1e(0x155)]='Show\x20connection\x20details';[a13_0x295b1e(0x175)](_0x220e80){const _0x4a13b1=a13_0x295b1e,{args:_0x467c4d}=_0x220e80;if(!_0x467c4d[0x0])return _0x4a13b1(0x1a5);return undefined;}async[a13_0x295b1e(0x198)](_0x58c9f4){const _0x5da956=a13_0x295b1e,{options:_0xcffbd0,args:_0x4ca805,tdx:_0x2ff697}=_0x58c9f4,_0x54ff1a=_0x4ca805[0x0];_0xcffbd0[_0x5da956(0x182)]&&(console[_0x5da956(0x196)](_0x5da956(0x193)+_0xcffbd0['site']),console[_0x5da956(0x196)](_0x5da956(0x169)+_0x54ff1a));const _0x126f46=await withSpinner(_0x5da956(0x1ad)+_0x54ff1a+_0x5da956(0x146),()=>_0x2ff697[_0x5da956(0x172)][_0x5da956(0x181)](_0x54ff1a),{'verbose':_0xcffbd0['verbose']}),_0x3419ab=_0x126f46['data'];return console['error']('✔\x20Found\x20connection:\x20'+_0x3419ab['name']),await handleSingleObjectOutput(_0x3419ab,_0xcffbd0),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a13_0x295b1e(0x14f);[a13_0x295b1e(0x155)]=a13_0x295b1e(0x16d);['validate'](_0x49f25e){const _0xb54118=a13_0x295b1e,{args:_0x419947}=_0x49f25e;if(!_0x419947[0x0])return _0xb54118(0x152);return undefined;}async[a13_0x295b1e(0x198)](_0x5dbfee){const _0x5a219c=a13_0x295b1e,{options:_0x492b10,args:_0x3b86ec,tdx:_0x45244b}=_0x5dbfee,_0xb86012=_0x3b86ec[0x0];_0x492b10[_0x5a219c(0x182)]&&(console[_0x5a219c(0x196)]('Site:\x20'+_0x492b10[_0x5a219c(0x187)]),console[_0x5a219c(0x196)](_0x5a219c(0x145)+_0xb86012));let _0x1546ce=_0xb86012,_0x587e11;try{const _0x27bc94=await _0x45244b[_0x5a219c(0x172)]['findByName'](_0xb86012);_0x27bc94&&(_0x1546ce=_0x27bc94[_0x5a219c(0x173)],_0x587e11=_0x27bc94['name'],_0x492b10[_0x5a219c(0x182)]&&console['error'](_0x5a219c(0x1ab)+_0xb86012+_0x5a219c(0x160)+_0x1546ce));}catch{_0x492b10['verbose']&&console[_0x5a219c(0x196)]('Treating\x20\x27'+_0xb86012+_0x5a219c(0x199));}const _0x21cdf5=await withSpinner(_0x5a219c(0x16e)+_0x1546ce+_0x5a219c(0x146),()=>_0x45244b['connection'][_0x5a219c(0x14a)](_0x1546ce),{'verbose':_0x492b10['verbose']}),_0x2ec1bd=_0x21cdf5[_0x5a219c(0x18c)];_0x587e11?console[_0x5a219c(0x196)](_0x5a219c(0x154)+_0x587e11+_0x5a219c(0x1a4)+_0x1546ce+')'):console[_0x5a219c(0x196)](_0x5a219c(0x170)+_0x1546ce);if(isStructuredFormat(_0x492b10))await handleSingleObjectOutput(_0x2ec1bd,_0x492b10);else{const _0x33b012=normalizeSchemaForDisplay(_0x2ec1bd);_0x587e11?(console[_0x5a219c(0x168)]('\x0aConnection:\x20'+a13_0x52f6d0[_0x5a219c(0x17a)](_0x587e11)),console[_0x5a219c(0x168)](_0x5a219c(0x165)+a13_0x52f6d0[_0x5a219c(0x177)](_0x1546ce))):console[_0x5a219c(0x168)](_0x5a219c(0x143)+a13_0x52f6d0[_0x5a219c(0x17a)](_0x1546ce)),_0x33b012['length']>0x0?(console[_0x5a219c(0x168)](a13_0x52f6d0[_0x5a219c(0x190)](_0x5a219c(0x158))),printSchemaFields(_0x33b012,0x0)):console['log'](a13_0x52f6d0[_0x5a219c(0x177)]('\x0aNo\x20fields\x20defined\x20in\x20schema'));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a13_0x295b1e(0x183);['description']=a13_0x295b1e(0x140);async[a13_0x295b1e(0x198)](_0x5be448){const _0x502217=a13_0x295b1e,{options:_0x66aaef,tdx:_0x1e2a91}=_0x5be448;_0x66aaef[_0x502217(0x182)]&&console[_0x502217(0x196)]('Site:\x20'+_0x66aaef[_0x502217(0x187)]);const _0x2c5e4c=await withSpinner(_0x502217(0x17d),()=>_0x1e2a91['connection'][_0x502217(0x15f)](),{'verbose':_0x66aaef[_0x502217(0x182)]}),_0x2cdd07=_0x2c5e4c[_0x502217(0x18c)][_0x502217(0x151)]((_0x35f710,_0x56e3ef)=>_0x35f710['type'][_0x502217(0x159)](_0x56e3ef[_0x502217(0x173)]));console['error'](_0x502217(0x18e)+_0x2cdd07[_0x502217(0x1a2)]+_0x502217(0x19a)+(_0x2cdd07[_0x502217(0x1a2)]!==0x1?'s':''));if(isStructuredFormat(_0x66aaef))await handleSDKOutput(_0x2cdd07,_0x66aaef);else{const _0x4a2626=_0x2cdd07[_0x502217(0x1a2)]>0x0?Math[_0x502217(0x16b)](..._0x2cdd07[_0x502217(0x184)](_0x381d1d=>_0x381d1d['type'][_0x502217(0x1a2)])):0x0,_0x2fead0=[];for(const _0x269a6e of _0x2cdd07){const _0xd8118d=a13_0x52f6d0[_0x502217(0x17a)](_0x269a6e[_0x502217(0x173)][_0x502217(0x1a1)](_0x4a2626));_0x2fead0[_0x502217(0x142)](_0xd8118d+'\x20\x20'+_0x269a6e[_0x502217(0x194)]);}await writeOutput(_0x2fead0[_0x502217(0x144)]('\x0a'),_0x66aaef[_0x502217(0x16c)],_0x502217(0x179));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{['name']='connection:settings';[a13_0x295b1e(0x155)]=a13_0x295b1e(0x1a9);[a13_0x295b1e(0x175)](_0x58181d){const _0x3c9453=a13_0x295b1e,{args:_0x59a1e2}=_0x58181d;if(!_0x59a1e2[0x0])return _0x3c9453(0x1ac);return undefined;}async[a13_0x295b1e(0x198)](_0x3bea3e){const _0x12daea=a13_0x295b1e,{options:_0x1591cc,args:_0x467436,tdx:_0x1534f6}=_0x3bea3e,_0x57671e=_0x467436[0x0];_0x1591cc[_0x12daea(0x182)]&&(console[_0x12daea(0x196)](_0x12daea(0x193)+_0x1591cc[_0x12daea(0x187)]),console[_0x12daea(0x196)]('Fetching\x20settings\x20for\x20connector\x20type:\x20'+_0x57671e));const _0x1bd4f2=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x57671e+'\x27...',()=>_0x1534f6[_0x12daea(0x172)][_0x12daea(0x174)](_0x57671e),{'verbose':_0x1591cc['verbose']}),_0x38b89d=_0x1bd4f2[_0x12daea(0x18c)];console['error']('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x57671e);if(isStructuredFormat(_0x1591cc))await handleSingleObjectOutput(_0x38b89d,_0x1591cc);else{console['log'](_0x12daea(0x143)+a13_0x52f6d0[_0x12daea(0x17a)](_0x57671e)),console[_0x12daea(0x168)](_0x12daea(0x180)+_0x38b89d[_0x12daea(0x194)]);const _0x702855=_0x38b89d[_0x12daea(0x1a8)]||[],_0x1689b5=_0x702855[_0x12daea(0x17f)](_0x4618e2=>_0x4618e2['credential']);_0x1689b5[_0x12daea(0x1a2)]>0x0&&(console[_0x12daea(0x168)](a13_0x52f6d0[_0x12daea(0x190)](_0x12daea(0x15e))),printMetadataSettings(_0x1689b5));let _0x8ca91c=![];try{const _0x3809dc=await _0x1534f6['connection'][_0x12daea(0x14a)](_0x57671e),_0x45ba59=normalizeSchemaForDisplay(_0x3809dc);_0x45ba59[_0x12daea(0x1a2)]>0x0&&(console[_0x12daea(0x168)](a13_0x52f6d0[_0x12daea(0x190)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x45ba59,0x0),_0x8ca91c=!![]);}catch{const _0xaac98b=_0x702855['filter'](_0x4c5fc9=>!_0x4c5fc9['credential']);_0xaac98b[_0x12daea(0x1a2)]>0x0&&(console[_0x12daea(0x168)](a13_0x52f6d0[_0x12daea(0x190)](_0x12daea(0x158))),printMetadataSettings(_0xaac98b),_0x8ca91c=!![]);}!_0x8ca91c&&_0x1591cc[_0x12daea(0x182)]&&console[_0x12daea(0x196)](a13_0x52f6d0[_0x12daea(0x177)](_0x12daea(0x16a))),_0x1689b5[_0x12daea(0x1a2)]===0x0&&console[_0x12daea(0x168)](a13_0x52f6d0['dim'](_0x12daea(0x150)));}return 0x0;}}function printMetadataSettings(_0xdf9eb8){const _0x5919a3=a13_0x295b1e;for(const _0x10597d of _0xdf9eb8){if(!_0x10597d[_0x5919a3(0x194)])continue;if(_0x10597d[_0x5919a3(0x161)])continue;let _0x35672e='\x20\x20'+a13_0x52f6d0[_0x5919a3(0x156)](_0x10597d[_0x5919a3(0x194)]);_0x10597d[_0x5919a3(0x16f)]&&(_0x35672e+=':\x20'+_0x10597d[_0x5919a3(0x16f)]);_0x10597d['type']&&(_0x35672e+=a13_0x52f6d0[_0x5919a3(0x177)]('\x20['+_0x10597d[_0x5919a3(0x173)]+']'));console[_0x5919a3(0x168)](_0x35672e);_0x10597d['hint']&&console[_0x5919a3(0x168)]('\x20\x20\x20\x20'+a13_0x52f6d0[_0x5919a3(0x177)](_0x10597d[_0x5919a3(0x1a6)]));if(_0x10597d['options']){const _0x57e2f0=_0x10597d[_0x5919a3(0x18f)][_0x5919a3(0x184)](_0x5811f=>_0x5811f[_0x5919a3(0x1a3)])[_0x5919a3(0x144)](',\x20');console[_0x5919a3(0x168)](_0x5919a3(0x1a7)+a13_0x52f6d0[_0x5919a3(0x189)](_0x57e2f0));}_0x10597d[_0x5919a3(0x18a)]!==undefined&&_0x10597d[_0x5919a3(0x18a)]!==null&&console[_0x5919a3(0x168)]('\x20\x20\x20\x20Default:\x20'+a13_0x52f6d0[_0x5919a3(0x178)](String(_0x10597d['default_value'])));if(_0x10597d[_0x5919a3(0x157)]){const _0x388972=Object[_0x5919a3(0x149)](_0x10597d[_0x5919a3(0x157)])['map'](([_0x15ef63,_0xfd3927])=>_0x15ef63+'='+JSON[_0x5919a3(0x15c)](_0xfd3927))[_0x5919a3(0x144)](',\x20');console[_0x5919a3(0x168)]('\x20\x20\x20\x20'+a13_0x52f6d0[_0x5919a3(0x177)](_0x5919a3(0x14c)+_0x388972));}}}
1
+ const a13_0x35e5a7=a13_0x2b6f;(function(_0x36e848,_0x165f76){const _0xf29424=a13_0x2b6f,_0x23edfc=_0x36e848();while(!![]){try{const _0x40eec5=parseInt(_0xf29424(0x14e))/0x1*(-parseInt(_0xf29424(0x13a))/0x2)+parseInt(_0xf29424(0x137))/0x3+-parseInt(_0xf29424(0x16d))/0x4+parseInt(_0xf29424(0x11f))/0x5*(parseInt(_0xf29424(0x126))/0x6)+parseInt(_0xf29424(0x130))/0x7+parseInt(_0xf29424(0x14f))/0x8+parseInt(_0xf29424(0x148))/0x9;if(_0x40eec5===_0x165f76)break;else _0x23edfc['push'](_0x23edfc['shift']());}catch(_0x29c994){_0x23edfc['push'](_0x23edfc['shift']());}}}(a13_0x3f67,0x22d66));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a13_0x3f67(){const _0x240807=['\x0aConnector:\x20','\x20\x20\x20\x20','push','site','cyan','settings','data','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','145430bQnqXg','getOutputSchema','legacy_settings','default_value','connection:settings','map','\x0aAvailable\x20fields:','18BiTPvM','repeat','description','type','connection:list','\x0aNo\x20fields\x20defined\x20in\x20schema','Options:\x20','maximum','error','stringify','918183lzeTDP','green','\x0aNo\x20credential\x20settings\x20defined','enumeration','input','Show\x20connection\x20details','log','318618lWawCy','Treating\x20\x27','label','10iFOlKE','filter','validate','Show\x20when:\x20','>=\x20','<=\x20','properties','hint','output','padStart','join','bold','connection:show','\x20\x20\x20\x20Options:\x20','492408VEmwKZ','No\x20available\x20fields\x20for\x20this\x20connector','verbose','minimum','hidden','listTypes','26831thVyrt','1361888tcuHti','Range:\x20','yellow','title','connection:schema','value','\x20connection','Listing\x20connector\x20types...','Site:\x20','Listing\x20connections...','\x0aConnection:\x20','Fetching\x20settings\x20for\x20\x27','table','execute','record','legacy','Fetching\x20connection\x20\x27','credential','find','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','owner','\x27...','slice','\x20-\x20','sort','\x0aCredential\x20settings:','connection:types','Type:\x20','name','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','1090928lvYHDz','Fetching\x20settings\x20for\x20connector\x20type:\x20','Name:\x20','dim','Looking\x20up\x20connection:\x20','\x20connector\x20type','length','options','criteria','List\x20available\x20connector\x20types','Resolving\x20connector\x20type\x20or\x20name:\x20','✔\x20Found\x20','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','List\x20all\x20result\x20output\x20connections','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.','blue','entries','connection'];a13_0x3f67=function(){return _0x240807;};return a13_0x3f67();}import a13_0x52b0fc from'chalk';function normalizeSchemaForDisplay(_0x54e4c4){const _0x20baf6=a13_0x2b6f,_0x233f0c=_0x54e4c4[_0x20baf6(0x140)]||[],_0x2b888c=_0x233f0c[_0x20baf6(0x161)](_0x1d73b5=>_0x1d73b5[_0x20baf6(0x16b)]===_0x20baf6(0x121)&&_0x1d73b5[_0x20baf6(0x129)]===_0x20baf6(0x15d)&&_0x1d73b5[_0x20baf6(0x140)]);if(_0x2b888c?.[_0x20baf6(0x140)]){const _0x5d9256=_0x233f0c[_0x20baf6(0x13b)](_0x6d9e21=>_0x6d9e21['name']!==_0x20baf6(0x15e)&&_0x6d9e21[_0x20baf6(0x16b)]!=='legacy_settings');return[..._0x5d9256,..._0x2b888c[_0x20baf6(0x140)]];}return _0x233f0c['filter'](_0x1dc9b1=>_0x1dc9b1['name']!==_0x20baf6(0x15e));}function printSchemaFields(_0x1a0d07,_0x32a37a){const _0x53f31d=a13_0x2b6f,_0x1f4498='\x20\x20'[_0x53f31d(0x127)](_0x32a37a+0x1),_0x555d34='\x20\x20'[_0x53f31d(0x127)](_0x32a37a+0x2);for(const _0x83fdca of _0x1a0d07){if(!_0x83fdca[_0x53f31d(0x16b)])continue;const _0x24f3e2=_0x83fdca['type']===_0x53f31d(0x15d)&&_0x83fdca[_0x53f31d(0x140)]&&_0x83fdca[_0x53f31d(0x140)][_0x53f31d(0x173)]>0x0&&_0x83fdca[_0x53f31d(0x16b)]!==_0x53f31d(0x121);let _0x14f988=''+_0x1f4498+a13_0x52b0fc[_0x53f31d(0x131)](_0x83fdca[_0x53f31d(0x16b)]);_0x83fdca[_0x53f31d(0x152)]&&(_0x14f988+=':\x20'+_0x83fdca[_0x53f31d(0x152)]);if(_0x83fdca[_0x53f31d(0x134)])_0x14f988+=a13_0x52b0fc['dim']('\x20['+_0x83fdca[_0x53f31d(0x134)]+']');else _0x24f3e2&&(_0x14f988+=a13_0x52b0fc['dim']('\x20[record]'));console[_0x53f31d(0x136)](_0x14f988);_0x83fdca[_0x53f31d(0x128)]&&console[_0x53f31d(0x136)](''+_0x555d34+a13_0x52b0fc[_0x53f31d(0x170)](_0x83fdca[_0x53f31d(0x128)]));if(_0x83fdca['enumeration']){const _0x176fa2=_0x83fdca[_0x53f31d(0x133)][_0x53f31d(0x124)](_0x1ed712=>typeof _0x1ed712==='object'&&_0x53f31d(0x154)in _0x1ed712?_0x1ed712[_0x53f31d(0x154)]:_0x1ed712)[_0x53f31d(0x144)](',\x20');console[_0x53f31d(0x136)](_0x555d34+_0x53f31d(0x12c)+a13_0x52b0fc[_0x53f31d(0x151)](_0x176fa2));}_0x83fdca[_0x53f31d(0x122)]!==undefined&&console[_0x53f31d(0x136)](_0x555d34+'Default:\x20'+a13_0x52b0fc[_0x53f31d(0x17d)](String(_0x83fdca[_0x53f31d(0x122)])));if(_0x83fdca[_0x53f31d(0x14b)]!==undefined||_0x83fdca[_0x53f31d(0x12d)]!==undefined){const _0x2439e1=_0x83fdca[_0x53f31d(0x14b)]!==undefined&&_0x83fdca[_0x53f31d(0x12d)]!==undefined?_0x83fdca[_0x53f31d(0x14b)]+'\x20-\x20'+_0x83fdca[_0x53f31d(0x12d)]:_0x83fdca[_0x53f31d(0x14b)]!==undefined?_0x53f31d(0x13e)+_0x83fdca['minimum']:_0x53f31d(0x13f)+_0x83fdca['maximum'];console[_0x53f31d(0x136)](_0x555d34+_0x53f31d(0x150)+a13_0x52b0fc[_0x53f31d(0x17d)](_0x2439e1));}if(_0x83fdca[_0x53f31d(0x175)]){const _0x471a22=Object['entries'](_0x83fdca[_0x53f31d(0x175)])[_0x53f31d(0x124)](([_0x46b312,_0x13c0fc])=>_0x46b312+'='+JSON[_0x53f31d(0x12f)](_0x13c0fc))[_0x53f31d(0x144)](',\x20');console['log'](''+_0x555d34+a13_0x52b0fc[_0x53f31d(0x170)](_0x53f31d(0x13d)+_0x471a22));}_0x24f3e2&&_0x83fdca['properties']&&printSchemaFields(_0x83fdca[_0x53f31d(0x140)],_0x32a37a+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x35e5a7(0x16b)]=a13_0x35e5a7(0x12a);[a13_0x35e5a7(0x128)]=a13_0x35e5a7(0x17a);async[a13_0x35e5a7(0x15c)](_0x287f3a){const _0xef032e=a13_0x35e5a7,{options:_0x11919b,tdx:_0x17f499}=_0x287f3a;_0x11919b['verbose']&&console[_0xef032e(0x12e)](_0xef032e(0x157)+_0x11919b[_0xef032e(0x183)]);const _0x504080=resolveLimit(_0x11919b['limit'],DEFAULT_LISTING_LIMIT),_0x3b4420=await withSpinner(_0xef032e(0x158),()=>_0x17f499[_0xef032e(0x17f)]['list'](),{'verbose':_0x11919b['verbose']}),_0x4835a0=_0x3b4420[_0xef032e(0x186)];console[_0xef032e(0x12e)](_0xef032e(0x178)+_0x4835a0[_0xef032e(0x173)]+_0xef032e(0x155)+(_0x4835a0[_0xef032e(0x173)]!==0x1?'s':''));if(isStructuredFormat(_0x11919b)){const _0x43b21e=_0x4835a0[_0xef032e(0x165)](0x0,_0x504080);await handleSDKOutput(_0x43b21e,{..._0x11919b,'limit':_0x504080});}else{const _0x1c3c9a=_0x4835a0['length']>0x0?Math['max'](..._0x4835a0[_0xef032e(0x124)](_0x1867a6=>_0x1867a6['type'][_0xef032e(0x173)])):0x0,_0x4a6d84=[];for(const _0x3f94cf of _0x4835a0){const _0x423d98=a13_0x52b0fc[_0xef032e(0x184)](_0x3f94cf[_0xef032e(0x129)]['padStart'](_0x1c3c9a)),_0x11a56f=_0x3f94cf[_0xef032e(0x163)]?.[_0xef032e(0x16b)]?_0xef032e(0x166)+a13_0x52b0fc['dim'](_0x3f94cf['owner'][_0xef032e(0x16b)]):'';_0x4a6d84[_0xef032e(0x182)](_0x423d98+'\x20\x20'+_0x3f94cf[_0xef032e(0x16b)]+_0x11a56f);}await writeOutput(_0x4a6d84[_0xef032e(0x144)]('\x0a'),_0x11919b['output'],_0xef032e(0x15b));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x35e5a7(0x16b)]=a13_0x35e5a7(0x146);[a13_0x35e5a7(0x128)]=a13_0x35e5a7(0x135);['validate'](_0x7a10a1){const _0x50d5de=a13_0x35e5a7,{args:_0x1c7720}=_0x7a10a1;if(!_0x1c7720[0x0])return _0x50d5de(0x11e);return undefined;}async[a13_0x35e5a7(0x15c)](_0x150268){const _0x1c7403=a13_0x35e5a7,{options:_0x3eaa01,args:_0x11da8f,tdx:_0x54add2}=_0x150268,_0xcbf7fd=_0x11da8f[0x0];_0x3eaa01[_0x1c7403(0x14a)]&&(console[_0x1c7403(0x12e)](_0x1c7403(0x157)+_0x3eaa01[_0x1c7403(0x183)]),console['error'](_0x1c7403(0x171)+_0xcbf7fd));const _0x1fe9f7=await withSpinner(_0x1c7403(0x15f)+_0xcbf7fd+_0x1c7403(0x164),()=>_0x54add2['connection']['resolve'](_0xcbf7fd),{'verbose':_0x3eaa01[_0x1c7403(0x14a)]}),_0x1de8c7=_0x1fe9f7[_0x1c7403(0x186)];return console[_0x1c7403(0x12e)]('✔\x20Found\x20connection:\x20'+_0x1de8c7[_0x1c7403(0x16b)]),await handleSingleObjectOutput(_0x1de8c7,_0x3eaa01),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a13_0x35e5a7(0x153);[a13_0x35e5a7(0x128)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';['validate'](_0x538fb2){const _0x4a0ad7=a13_0x35e5a7,{args:_0xadc5d}=_0x538fb2;if(!_0xadc5d[0x0])return _0x4a0ad7(0x17c);return undefined;}async[a13_0x35e5a7(0x15c)](_0x11a6da){const _0x52334b=a13_0x35e5a7,{options:_0x28b856,args:_0x3c1868,tdx:_0x23b8cd}=_0x11a6da,_0x2cd3dd=_0x3c1868[0x0];_0x28b856[_0x52334b(0x14a)]&&(console[_0x52334b(0x12e)]('Site:\x20'+_0x28b856[_0x52334b(0x183)]),console['error'](_0x52334b(0x177)+_0x2cd3dd));let _0x3cae0d=_0x2cd3dd,_0x486eb9;try{const _0x39b0cc=await _0x23b8cd['connection']['findByName'](_0x2cd3dd);_0x39b0cc&&(_0x3cae0d=_0x39b0cc[_0x52334b(0x129)],_0x486eb9=_0x39b0cc[_0x52334b(0x16b)],_0x28b856[_0x52334b(0x14a)]&&console[_0x52334b(0x12e)]('✔\x20Resolved\x20\x27'+_0x2cd3dd+_0x52334b(0x179)+_0x3cae0d));}catch{_0x28b856[_0x52334b(0x14a)]&&console['error'](_0x52334b(0x138)+_0x2cd3dd+'\x27\x20as\x20connector\x20type');}const _0x3ad5e1=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x3cae0d+_0x52334b(0x164),()=>_0x23b8cd[_0x52334b(0x17f)][_0x52334b(0x120)](_0x3cae0d),{'verbose':_0x28b856[_0x52334b(0x14a)]}),_0x26a5b3=_0x3ad5e1[_0x52334b(0x186)];_0x486eb9?console['error']('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x486eb9+'\x27\x20(type:\x20'+_0x3cae0d+')'):console[_0x52334b(0x12e)](_0x52334b(0x16c)+_0x3cae0d);if(isStructuredFormat(_0x28b856))await handleSingleObjectOutput(_0x26a5b3,_0x28b856);else{const _0x3b37fc=normalizeSchemaForDisplay(_0x26a5b3);_0x486eb9?(console[_0x52334b(0x136)](_0x52334b(0x159)+a13_0x52b0fc['cyan'](_0x486eb9)),console['log'](_0x52334b(0x16a)+a13_0x52b0fc[_0x52334b(0x170)](_0x3cae0d))):console[_0x52334b(0x136)](_0x52334b(0x180)+a13_0x52b0fc[_0x52334b(0x184)](_0x3cae0d)),_0x3b37fc['length']>0x0?(console['log'](a13_0x52b0fc['bold'](_0x52334b(0x125))),printSchemaFields(_0x3b37fc,0x0)):console[_0x52334b(0x136)](a13_0x52b0fc['dim'](_0x52334b(0x12b)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x35e5a7(0x16b)]=a13_0x35e5a7(0x169);[a13_0x35e5a7(0x128)]=a13_0x35e5a7(0x176);async[a13_0x35e5a7(0x15c)](_0x19fe22){const _0x143a9d=a13_0x35e5a7,{options:_0x133742,tdx:_0x6748df}=_0x19fe22;_0x133742[_0x143a9d(0x14a)]&&console['error'](_0x143a9d(0x157)+_0x133742[_0x143a9d(0x183)]);const _0x4f63cc=await withSpinner(_0x143a9d(0x156),()=>_0x6748df[_0x143a9d(0x17f)][_0x143a9d(0x14d)](),{'verbose':_0x133742[_0x143a9d(0x14a)]}),_0x1cdb43=_0x4f63cc[_0x143a9d(0x186)][_0x143a9d(0x167)]((_0x544e49,_0x33e3d9)=>_0x544e49[_0x143a9d(0x129)]['localeCompare'](_0x33e3d9[_0x143a9d(0x129)]));console[_0x143a9d(0x12e)]('✔\x20Found\x20'+_0x1cdb43[_0x143a9d(0x173)]+_0x143a9d(0x172)+(_0x1cdb43['length']!==0x1?'s':''));if(isStructuredFormat(_0x133742))await handleSDKOutput(_0x1cdb43,_0x133742);else{const _0x19c3f6=_0x1cdb43[_0x143a9d(0x173)]>0x0?Math['max'](..._0x1cdb43['map'](_0x3dc520=>_0x3dc520['type'][_0x143a9d(0x173)])):0x0,_0x40a75d=[];for(const _0x31634a of _0x1cdb43){const _0x312056=a13_0x52b0fc[_0x143a9d(0x184)](_0x31634a[_0x143a9d(0x129)][_0x143a9d(0x143)](_0x19c3f6));_0x40a75d[_0x143a9d(0x182)](_0x312056+'\x20\x20'+_0x31634a[_0x143a9d(0x16b)]);}await writeOutput(_0x40a75d[_0x143a9d(0x144)]('\x0a'),_0x133742[_0x143a9d(0x142)],_0x143a9d(0x15b));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x35e5a7(0x16b)]=a13_0x35e5a7(0x123);[a13_0x35e5a7(0x128)]=a13_0x35e5a7(0x162);[a13_0x35e5a7(0x13c)](_0x5ead6c){const {args:_0x3865fe}=_0x5ead6c;if(!_0x3865fe[0x0])return'Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.';return undefined;}async[a13_0x35e5a7(0x15c)](_0x4a586c){const _0xb7aaad=a13_0x35e5a7,{options:_0x132ff3,args:_0x38a2ec,tdx:_0x8a1845}=_0x4a586c,_0x3bc488=_0x38a2ec[0x0];_0x132ff3[_0xb7aaad(0x14a)]&&(console[_0xb7aaad(0x12e)](_0xb7aaad(0x157)+_0x132ff3[_0xb7aaad(0x183)]),console[_0xb7aaad(0x12e)](_0xb7aaad(0x16e)+_0x3bc488));const _0x16f57b=await withSpinner(_0xb7aaad(0x15a)+_0x3bc488+_0xb7aaad(0x164),()=>_0x8a1845[_0xb7aaad(0x17f)]['getMetadata'](_0x3bc488),{'verbose':_0x132ff3[_0xb7aaad(0x14a)]}),_0x208cae=_0x16f57b[_0xb7aaad(0x186)];console[_0xb7aaad(0x12e)](_0xb7aaad(0x17b)+_0x3bc488);if(isStructuredFormat(_0x132ff3))await handleSingleObjectOutput(_0x208cae,_0x132ff3);else{console['log'](_0xb7aaad(0x180)+a13_0x52b0fc['cyan'](_0x3bc488)),console['log'](_0xb7aaad(0x16f)+_0x208cae[_0xb7aaad(0x16b)]);const _0x2675ac=_0x208cae[_0xb7aaad(0x185)]||[],_0x53c931=_0x2675ac[_0xb7aaad(0x13b)](_0xb9a31e=>_0xb9a31e[_0xb7aaad(0x160)]);_0x53c931[_0xb7aaad(0x173)]>0x0&&(console[_0xb7aaad(0x136)](a13_0x52b0fc[_0xb7aaad(0x145)](_0xb7aaad(0x168))),printMetadataSettings(_0x53c931));let _0x2d09f9=![];try{const _0x220a9d=await _0x8a1845['connection'][_0xb7aaad(0x120)](_0x3bc488),_0x96fe06=normalizeSchemaForDisplay(_0x220a9d);_0x96fe06[_0xb7aaad(0x173)]>0x0&&(console[_0xb7aaad(0x136)](a13_0x52b0fc['bold']('\x0aAvailable\x20fields:')),printSchemaFields(_0x96fe06,0x0),_0x2d09f9=!![]);}catch{const _0x19b7f5=_0x2675ac[_0xb7aaad(0x13b)](_0x183088=>!_0x183088['credential']);_0x19b7f5[_0xb7aaad(0x173)]>0x0&&(console[_0xb7aaad(0x136)](a13_0x52b0fc[_0xb7aaad(0x145)](_0xb7aaad(0x125))),printMetadataSettings(_0x19b7f5),_0x2d09f9=!![]);}!_0x2d09f9&&_0x132ff3[_0xb7aaad(0x14a)]&&console['error'](a13_0x52b0fc['dim'](_0xb7aaad(0x149))),_0x53c931[_0xb7aaad(0x173)]===0x0&&console[_0xb7aaad(0x136)](a13_0x52b0fc[_0xb7aaad(0x170)](_0xb7aaad(0x132)));}return 0x0;}}function a13_0x2b6f(_0x2ca23e,_0x549944){_0x2ca23e=_0x2ca23e-0x11e;const _0x3f6750=a13_0x3f67();let _0x2b6f1a=_0x3f6750[_0x2ca23e];return _0x2b6f1a;}function printMetadataSettings(_0x53c31f){const _0x40713c=a13_0x35e5a7;for(const _0x51869d of _0x53c31f){if(!_0x51869d[_0x40713c(0x16b)])continue;if(_0x51869d[_0x40713c(0x14c)])continue;let _0x21e2a4='\x20\x20'+a13_0x52b0fc[_0x40713c(0x131)](_0x51869d[_0x40713c(0x16b)]);_0x51869d[_0x40713c(0x139)]&&(_0x21e2a4+=':\x20'+_0x51869d[_0x40713c(0x139)]);_0x51869d[_0x40713c(0x129)]&&(_0x21e2a4+=a13_0x52b0fc['dim']('\x20['+_0x51869d[_0x40713c(0x129)]+']'));console[_0x40713c(0x136)](_0x21e2a4);_0x51869d[_0x40713c(0x141)]&&console[_0x40713c(0x136)](_0x40713c(0x181)+a13_0x52b0fc['dim'](_0x51869d[_0x40713c(0x141)]));if(_0x51869d[_0x40713c(0x174)]){const _0xc493d0=_0x51869d[_0x40713c(0x174)][_0x40713c(0x124)](_0x1416f0=>_0x1416f0[_0x40713c(0x154)])['join'](',\x20');console[_0x40713c(0x136)](_0x40713c(0x147)+a13_0x52b0fc[_0x40713c(0x151)](_0xc493d0));}_0x51869d[_0x40713c(0x122)]!==undefined&&_0x51869d[_0x40713c(0x122)]!==null&&console[_0x40713c(0x136)]('\x20\x20\x20\x20Default:\x20'+a13_0x52b0fc[_0x40713c(0x17d)](String(_0x51869d[_0x40713c(0x122)])));if(_0x51869d[_0x40713c(0x175)]){const _0x29d46e=Object[_0x40713c(0x17e)](_0x51869d[_0x40713c(0x175)])[_0x40713c(0x124)](([_0x6e5f00,_0x2c4b7d])=>_0x6e5f00+'='+JSON[_0x40713c(0x12f)](_0x2c4b7d))[_0x40713c(0x144)](',\x20');console[_0x40713c(0x136)](_0x40713c(0x181)+a13_0x52b0fc[_0x40713c(0x170)](_0x40713c(0x13d)+_0x29d46e));}}}
@@ -1 +1 @@
1
- const a14_0x1c0521=a14_0x153e;function a14_0x5256(){const _0x6685aa=['cause','name','5115114vLYKnE','Site:\x20','listDatabases','3654295tAhjdq','verbose','Listing\x20databases...','site','databases','List\x20all\x20databases','message','4HMltHp','Error:\x20','11ZqBIpR','4533950gDnsFP','\x20database','Pattern:\x20','2330331orVzgb','143478OHPZHs','4ktRFyN','✔\x20Found\x20','query','\x20\x20Cause:\x20','176fdKOGA','3699878PINTZq','data','error','70398HbkiBu','length'];a14_0x5256=function(){return _0x6685aa;};return a14_0x5256();}(function(_0x2249a6,_0x2d6c78){const _0x24b2cc=a14_0x153e,_0x1b13b2=_0x2249a6();while(!![]){try{const _0x37f4bc=-parseInt(_0x24b2cc(0x1ce))/0x1*(parseInt(_0x24b2cc(0x1cf))/0x2)+parseInt(_0x24b2cc(0x1cd))/0x3+-parseInt(_0x24b2cc(0x1c7))/0x4*(parseInt(_0x24b2cc(0x1c0))/0x5)+parseInt(_0x24b2cc(0x1db))/0x6+parseInt(_0x24b2cc(0x1d4))/0x7+parseInt(_0x24b2cc(0x1d3))/0x8*(-parseInt(_0x24b2cc(0x1d7))/0x9)+-parseInt(_0x24b2cc(0x1ca))/0xa*(parseInt(_0x24b2cc(0x1c9))/0xb);if(_0x37f4bc===_0x2d6c78)break;else _0x1b13b2['push'](_0x1b13b2['shift']());}catch(_0x2d842a){_0x1b13b2['push'](_0x1b13b2['shift']());}}}(a14_0x5256,0x7d9fc));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a14_0x153e(_0x3d7412,_0x3ffd22){_0x3d7412=_0x3d7412-0x1be;const _0x5256cd=a14_0x5256();let _0x153eb6=_0x5256cd[_0x3d7412];return _0x153eb6;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0x1c0521(0x1da)]=a14_0x1c0521(0x1c4);['description']=a14_0x1c0521(0x1c5);async['execute'](_0x3ce26e){const _0x1e685e=a14_0x1c0521,{options:_0x2fdf92,args:_0x1f49d4,tdx:_0x1198b0}=_0x3ce26e,_0x3bd2c2=_0x1f49d4[0x0];try{_0x2fdf92[_0x1e685e(0x1c1)]&&(console[_0x1e685e(0x1d6)](_0x1e685e(0x1be)+_0x2fdf92[_0x1e685e(0x1c3)]),_0x3bd2c2&&console[_0x1e685e(0x1d6)](_0x1e685e(0x1cc)+_0x3bd2c2));const _0x2693c9=resolveLimit(_0x2fdf92['limit'],DEFAULT_LISTING_LIMIT),_0x3d0269=await withSpinner(_0x1e685e(0x1c2),()=>_0x1198b0[_0x1e685e(0x1d1)][_0x1e685e(0x1bf)](_0x3bd2c2,_0x2693c9),{'verbose':_0x2fdf92[_0x1e685e(0x1c1)]}),_0x1fb8c3=_0x3d0269[_0x1e685e(0x1d5)];return console[_0x1e685e(0x1d6)](_0x1e685e(0x1d0)+_0x1fb8c3[_0x1e685e(0x1d8)]+_0x1e685e(0x1cb)+(_0x1fb8c3[_0x1e685e(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0x1fb8c3,{..._0x2fdf92,'limit':_0x2693c9}),0x0;}catch(_0x7ccd3f){if(_0x7ccd3f instanceof SDKError)return console['error'](_0x1e685e(0x1c8)+_0x7ccd3f[_0x1e685e(0x1c6)]),_0x7ccd3f[_0x1e685e(0x1d9)]&&console[_0x1e685e(0x1d6)](_0x1e685e(0x1d2)+_0x7ccd3f[_0x1e685e(0x1d9)]),0x1;throw _0x7ccd3f;}}}
1
+ const a14_0x4cb80f=a14_0xfb7c;(function(_0x1939a6,_0xcb9f46){const _0x4bc1ff=a14_0xfb7c,_0x4f7229=_0x1939a6();while(!![]){try{const _0x4acd8e=parseInt(_0x4bc1ff(0x8a))/0x1+parseInt(_0x4bc1ff(0x8c))/0x2+parseInt(_0x4bc1ff(0x9c))/0x3+-parseInt(_0x4bc1ff(0x95))/0x4+-parseInt(_0x4bc1ff(0x97))/0x5+parseInt(_0x4bc1ff(0x98))/0x6+-parseInt(_0x4bc1ff(0x9b))/0x7;if(_0x4acd8e===_0xcb9f46)break;else _0x4f7229['push'](_0x4f7229['shift']());}catch(_0x49b28d){_0x4f7229['push'](_0x4f7229['shift']());}}}(a14_0x2acd,0x61673));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a14_0x2acd(){const _0x3875ba=['name','\x20database','✔\x20Found\x20','656679fCJKOb','listDatabases','661498AIwqbO','length','query','databases','verbose','Pattern:\x20','data','error','cause','397284HHhGlH','Listing\x20databases...','831260TCfUEc','3026358CLRjpm','\x20\x20Cause:\x20','execute','11065775oBtYps','2260620mgoNqR','List\x20all\x20databases','message'];a14_0x2acd=function(){return _0x3875ba;};return a14_0x2acd();}function a14_0xfb7c(_0x38f719,_0x56c2d2){_0x38f719=_0x38f719-0x86;const _0x2acd41=a14_0x2acd();let _0xfb7c57=_0x2acd41[_0x38f719];return _0xfb7c57;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0x4cb80f(0x87)]=a14_0x4cb80f(0x8f);['description']=a14_0x4cb80f(0x9d);async[a14_0x4cb80f(0x9a)](_0x2e2b4f){const _0x5b6b46=a14_0x4cb80f,{options:_0x5986ed,args:_0x4a060d,tdx:_0x8c5638}=_0x2e2b4f,_0x500aab=_0x4a060d[0x0];try{_0x5986ed[_0x5b6b46(0x90)]&&(console[_0x5b6b46(0x93)]('Site:\x20'+_0x5986ed['site']),_0x500aab&&console[_0x5b6b46(0x93)](_0x5b6b46(0x91)+_0x500aab));const _0x35ce5f=resolveLimit(_0x5986ed['limit'],DEFAULT_LISTING_LIMIT),_0x20edc7=await withSpinner(_0x5b6b46(0x96),()=>_0x8c5638[_0x5b6b46(0x8e)][_0x5b6b46(0x8b)](_0x500aab,_0x35ce5f),{'verbose':_0x5986ed[_0x5b6b46(0x90)]}),_0x62b33f=_0x20edc7[_0x5b6b46(0x92)];return console[_0x5b6b46(0x93)](_0x5b6b46(0x89)+_0x62b33f[_0x5b6b46(0x8d)]+_0x5b6b46(0x88)+(_0x62b33f[_0x5b6b46(0x8d)]!==0x1?'s':'')),await handleSDKOutput(_0x62b33f,{..._0x5986ed,'limit':_0x35ce5f}),0x0;}catch(_0x3f2680){if(_0x3f2680 instanceof SDKError)return console[_0x5b6b46(0x93)]('Error:\x20'+_0x3f2680[_0x5b6b46(0x86)]),_0x3f2680[_0x5b6b46(0x94)]&&console[_0x5b6b46(0x93)](_0x5b6b46(0x99)+_0x3f2680[_0x5b6b46(0x94)]),0x1;throw _0x3f2680;}}}
@@ -1 +1 @@
1
- function a15_0x4e6d(){const _0x28262c=['listEmailSenders','634008XymWmO','verbose','delivery:senders','283137LLpzWH','59126HfdhDe','179600wIYZij','delivery','2206050QIIMRM','16FHsHRK','name','1514120TvjBsz','784343mcboNk','4xWVLav','filter','585sOMOGL','execute','List\x20email\x20senders','data','limit','Fetching\x20email\x20senders...'];a15_0x4e6d=function(){return _0x28262c;};return a15_0x4e6d();}const a15_0x1d2bd3=a15_0x4fde;(function(_0x3fe748,_0x348ee4){const _0x47ccba=a15_0x4fde,_0x583e7a=_0x3fe748();while(!![]){try{const _0x5ef7f0=parseInt(_0x47ccba(0xe8))/0x1+parseInt(_0x47ccba(0xe4))/0x2+parseInt(_0x47ccba(0xe7))/0x3*(parseInt(_0x47ccba(0xdb))/0x4)+parseInt(_0x47ccba(0xd9))/0x5+parseInt(_0x47ccba(0xd6))/0x6+parseInt(_0x47ccba(0xda))/0x7*(parseInt(_0x47ccba(0xd7))/0x8)+-parseInt(_0x47ccba(0xdd))/0x9*(parseInt(_0x47ccba(0xe9))/0xa);if(_0x5ef7f0===_0x348ee4)break;else _0x583e7a['push'](_0x583e7a['shift']());}catch(_0x4de530){_0x583e7a['push'](_0x583e7a['shift']());}}}(a15_0x4e6d,0x3044a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a15_0x4fde(_0x530a85,_0x5682fc){_0x530a85=_0x530a85-0xd6;const _0x4e6daa=a15_0x4e6d();let _0x4fde63=_0x4e6daa[_0x530a85];return _0x4fde63;}import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{[a15_0x1d2bd3(0xd8)]=a15_0x1d2bd3(0xe6);['description']=a15_0x1d2bd3(0xdf);async[a15_0x1d2bd3(0xde)](_0x3b05ad){const _0x5126fe=a15_0x1d2bd3,{options:_0x37c357,args:_0x3ca672,tdx:_0x79d71b}=_0x3b05ad,_0x2be0a0=_0x3ca672[0x0],_0x50a7dd=resolveLimit(_0x37c357[_0x5126fe(0xe1)],DEFAULT_LLM_LIMIT),_0xfcf0fb=_0x37c357,_0x4c9f2b=await resolveWorkspaceIdFromOptions(_0xfcf0fb,_0x79d71b),_0x4f4382=await withSpinner(_0x5126fe(0xe2),()=>_0x79d71b[_0x5126fe(0xea)][_0x5126fe(0xe3)]({'workspaceId':_0x4c9f2b,'limit':_0x50a7dd}),{'verbose':_0x37c357[_0x5126fe(0xe5)]});let _0x3634bb=_0x4f4382[_0x5126fe(0xe0)];return _0x2be0a0&&(_0x3634bb=_0x4f4382[_0x5126fe(0xe0)][_0x5126fe(0xdc)](_0x36fa78=>matchGlobPattern(_0x36fa78[_0x5126fe(0xd8)],_0x2be0a0))),await handleSDKOutput(_0x3634bb,_0x37c357),0x0;}}
1
+ const a15_0x5a1a44=a15_0x282e;function a15_0x5edc(){const _0x340dc5=['110eKwgzn','65GVXPUr','19248wGLYiJ','delivery:senders','verbose','listEmailSenders','37374TDyOey','4316FzHOfM','830673sWTZdK','4NZGlfm','50UaGllW','List\x20email\x20senders','4975537YkYltD','delivery','8NjmrVP','name','3398197SxxFyC','3490269BWupQd','filter','46346qKOrgm'];a15_0x5edc=function(){return _0x340dc5;};return a15_0x5edc();}(function(_0x1b7ea4,_0x593311){const _0x14c2e9=a15_0x282e,_0x4a3b0c=_0x1b7ea4();while(!![]){try{const _0x1c1d55=-parseInt(_0x14c2e9(0x12b))/0x1*(-parseInt(_0x14c2e9(0x122))/0x2)+parseInt(_0x14c2e9(0x129))/0x3*(-parseInt(_0x14c2e9(0x121))/0x4)+parseInt(_0x14c2e9(0x12d))/0x5*(parseInt(_0x14c2e9(0x11e))/0x6)+parseInt(_0x14c2e9(0x124))/0x7*(-parseInt(_0x14c2e9(0x126))/0x8)+parseInt(_0x14c2e9(0x120))/0x9*(parseInt(_0x14c2e9(0x12c))/0xa)+-parseInt(_0x14c2e9(0x128))/0xb+parseInt(_0x14c2e9(0x11a))/0xc*(parseInt(_0x14c2e9(0x11f))/0xd);if(_0x1c1d55===_0x593311)break;else _0x4a3b0c['push'](_0x4a3b0c['shift']());}catch(_0x1073bd){_0x4a3b0c['push'](_0x4a3b0c['shift']());}}}(a15_0x5edc,0x93879));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';function a15_0x282e(_0x1956f9,_0x89a382){_0x1956f9=_0x1956f9-0x11a;const _0x5edcf3=a15_0x5edc();let _0x282edc=_0x5edcf3[_0x1956f9];return _0x282edc;}export class DeliveryEmailSendersCommand extends BaseCommand{[a15_0x5a1a44(0x127)]=a15_0x5a1a44(0x11b);['description']=a15_0x5a1a44(0x123);async['execute'](_0x2664cf){const _0x5dd96e=a15_0x5a1a44,{options:_0x53eedf,args:_0x28fb29,tdx:_0x4f25a6}=_0x2664cf,_0x1a823b=_0x28fb29[0x0],_0xcecd6=resolveLimit(_0x53eedf['limit'],DEFAULT_LLM_LIMIT),_0x4596b8=_0x53eedf,_0x476161=await resolveWorkspaceIdFromOptions(_0x4596b8,_0x4f25a6),_0x95df04=await withSpinner('Fetching\x20email\x20senders...',()=>_0x4f25a6[_0x5dd96e(0x125)][_0x5dd96e(0x11d)]({'workspaceId':_0x476161,'limit':_0xcecd6}),{'verbose':_0x53eedf[_0x5dd96e(0x11c)]});let _0x104f24=_0x95df04['data'];return _0x1a823b&&(_0x104f24=_0x95df04['data'][_0x5dd96e(0x12a)](_0x4670fd=>matchGlobPattern(_0x4670fd[_0x5dd96e(0x127)],_0x1a823b))),await handleSDKOutput(_0x104f24,_0x53eedf),0x0;}}
@@ -1 +1 @@
1
- const a16_0x4b9a04=a16_0x3383;(function(_0x597c4e,_0x3fadf2){const _0x4f280c=a16_0x3383,_0x5c530f=_0x597c4e();while(!![]){try{const _0x29d6a2=-parseInt(_0x4f280c(0xe9))/0x1+parseInt(_0x4f280c(0x102))/0x2*(-parseInt(_0x4f280c(0xe7))/0x3)+parseInt(_0x4f280c(0x104))/0x4+-parseInt(_0x4f280c(0xe8))/0x5*(parseInt(_0x4f280c(0xf0))/0x6)+parseInt(_0x4f280c(0xfa))/0x7*(-parseInt(_0x4f280c(0xec))/0x8)+-parseInt(_0x4f280c(0xf5))/0x9+-parseInt(_0x4f280c(0x10a))/0xa*(-parseInt(_0x4f280c(0x105))/0xb);if(_0x29d6a2===_0x3fadf2)break;else _0x5c530f['push'](_0x5c530f['shift']());}catch(_0x37f9ea){_0x5c530f['push'](_0x5c530f['shift']());}}}(a16_0x4709,0x437ed));function a16_0x3383(_0x32048d,_0x12225c){_0x32048d=_0x32048d-0xe7;const _0x470989=a16_0x4709();let _0x338323=_0x470989[_0x32048d];return _0x338323;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a16_0x4709(){const _0x2fb0be=['11hAcrnd','message','\x27\x20does\x20not\x20exist','description','execute','21692690EACxox','describeTable','Table:\x20','data','154932rvviEb','7420OMyVxT','471049ntZLxt','\x20\x20Cause:\x20','verbose','178120TxNJbM','database','length','\x20column','2094hjvyrT','error','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','Describe\x20table\x20schema','Site:\x20','1308492avyrqT','Describing\x20table\x20','\x20in\x20','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','cause','133dmLXhg','name','✖\x20Table\x20not\x20found','site','args','✔\x20Found\x20','table','Error:\x20','20cepSCU','Table\x20\x27','724080WOruRF'];a16_0x4709=function(){return _0x2fb0be;};return a16_0x4709();}export class DescribeCommand extends BaseCommand{[a16_0x4b9a04(0xfb)]='describe';[a16_0x4b9a04(0x108)]=a16_0x4b9a04(0xf3);async[a16_0x4b9a04(0x109)](_0x428b98){const _0x3004b4=a16_0x4b9a04;return this[_0x3004b4(0x10b)](_0x428b98);}async[a16_0x4b9a04(0x10b)](_0xcebcad){const _0x56c0ce=a16_0x4b9a04,{options:_0x1c7ed5,args:_0x3e8d7a,tdx:_0x27c199}=_0xcebcad;let _0x3b84fc;try{_0x3b84fc=parseTableReference(_0x3e8d7a[0x0]);const _0x32b83e=_0x1c7ed5[_0x56c0ce(0xed)];!_0x3b84fc[_0x56c0ce(0xed)]&&_0x32b83e&&(_0x3b84fc[_0x56c0ce(0xed)]=_0x32b83e);const _0x43a8e9=validateTableDescribeReference(_0x3b84fc);if(_0x43a8e9)return console[_0x56c0ce(0xf1)]('Error:\x20'+_0x43a8e9),0x1;}catch(_0x458f64){return console[_0x56c0ce(0xf1)](_0x56c0ce(0x101)+_0x458f64['message']),0x1;}const _0x24a005=_0x3b84fc[_0x56c0ce(0xed)],_0x9056cf=_0x3b84fc[_0x56c0ce(0x100)];try{_0x1c7ed5[_0x56c0ce(0xeb)]&&(console[_0x56c0ce(0xf1)](_0x56c0ce(0xf4)+_0x1c7ed5[_0x56c0ce(0xfd)]),console[_0x56c0ce(0xf1)]('Database:\x20'+_0x24a005),console[_0x56c0ce(0xf1)](_0x56c0ce(0x10c)+_0x9056cf));const _0x34ba20=await withSpinner(_0x56c0ce(0xf6)+_0x24a005+'.'+_0x9056cf+'...',()=>_0x27c199['query'][_0x56c0ce(0x10b)](_0x24a005,_0x9056cf),{'verbose':_0x1c7ed5[_0x56c0ce(0xeb)]}),_0xff8653=_0x34ba20[_0x56c0ce(0x10d)];if(_0xff8653['length']===0x0)return console[_0x56c0ce(0xf1)](_0x56c0ce(0xfc)),console[_0x56c0ce(0xf1)](_0x56c0ce(0x103)+_0x24a005+'.'+_0x9056cf+_0x56c0ce(0x107)),0x1;return console['error'](_0x56c0ce(0xff)+_0xff8653[_0x56c0ce(0xee)]+_0x56c0ce(0xef)+(_0xff8653[_0x56c0ce(0xee)]!==0x1?'s':'')+_0x56c0ce(0xf7)+_0x24a005+'.'+_0x9056cf),await handleSDKOutput(_0xff8653,_0x1c7ed5),0x0;}catch(_0x54ea9f){if(_0x54ea9f instanceof SDKError)return console[_0x56c0ce(0xf1)]('Error:\x20'+_0x54ea9f[_0x56c0ce(0x106)]),_0x54ea9f[_0x56c0ce(0xf9)]&&console['error'](_0x56c0ce(0xea)+_0x54ea9f[_0x56c0ce(0xf9)]),0x1;throw _0x54ea9f;}}['validate'](_0x1d3a61){const _0x263b77=a16_0x4b9a04;if(_0x1d3a61[_0x263b77(0xfe)][_0x263b77(0xee)]===0x0)return _0x263b77(0xf8);if(_0x1d3a61[_0x263b77(0xfe)][_0x263b77(0xee)]>0x1)return _0x263b77(0xf2);return undefined;}}
1
+ const a16_0x2392ed=a16_0x4c3c;(function(_0x445774,_0x2267cd){const _0x118f5b=a16_0x4c3c,_0x289e5e=_0x445774();while(!![]){try{const _0x48b834=parseInt(_0x118f5b(0x150))/0x1*(-parseInt(_0x118f5b(0x14c))/0x2)+parseInt(_0x118f5b(0x14d))/0x3+-parseInt(_0x118f5b(0x16b))/0x4*(parseInt(_0x118f5b(0x15a))/0x5)+parseInt(_0x118f5b(0x154))/0x6*(parseInt(_0x118f5b(0x16e))/0x7)+parseInt(_0x118f5b(0x161))/0x8+parseInt(_0x118f5b(0x166))/0x9+-parseInt(_0x118f5b(0x159))/0xa;if(_0x48b834===_0x2267cd)break;else _0x289e5e['push'](_0x289e5e['shift']());}catch(_0x5a727f){_0x289e5e['push'](_0x289e5e['shift']());}}}(a16_0x55fa,0x43890));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a16_0x4c3c(_0x3a09ad,_0x1d65a0){_0x3a09ad=_0x3a09ad-0x14c;const _0x55fa94=a16_0x55fa();let _0x4c3ca1=_0x55fa94[_0x3a09ad];return _0x4c3ca1;}import{handleSDKOutput}from'../core/command-output.js';function a16_0x55fa(){const _0x4668cf=['\x27\x20does\x20not\x20exist','Describing\x20table\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','site','2104780upMNsi','45LhiIIm','message','describeTable','describe','...','Site:\x20','length','524280lGqbTX','Table:\x20','execute','table','\x20\x20Cause:\x20','4676310dPUJwf','database','args','\x20column','cause','220172DBccxD','✖\x20Table\x20not\x20found','verbose','25606LBnluU','107794XWOkQe','716589cxhTVm','error','Error:\x20','5KvtCrw','Table\x20\x27','Describe\x20table\x20schema','Database:\x20','702UzvoFk'];a16_0x55fa=function(){return _0x4668cf;};return a16_0x55fa();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{['name']=a16_0x2392ed(0x15d);['description']=a16_0x2392ed(0x152);async[a16_0x2392ed(0x163)](_0x44b8b6){const _0x3afc98=a16_0x2392ed;return this[_0x3afc98(0x15c)](_0x44b8b6);}async[a16_0x2392ed(0x15c)](_0x2dd4e0){const _0x5d206b=a16_0x2392ed,{options:_0x3bbbc6,args:_0x45c560,tdx:_0x31e3a2}=_0x2dd4e0;let _0x33a0d6;try{_0x33a0d6=parseTableReference(_0x45c560[0x0]);const _0x37ad7a=_0x3bbbc6[_0x5d206b(0x167)];!_0x33a0d6['database']&&_0x37ad7a&&(_0x33a0d6[_0x5d206b(0x167)]=_0x37ad7a);const _0xb8ba22=validateTableDescribeReference(_0x33a0d6);if(_0xb8ba22)return console[_0x5d206b(0x14e)]('Error:\x20'+_0xb8ba22),0x1;}catch(_0x114dde){return console[_0x5d206b(0x14e)](_0x5d206b(0x14f)+_0x114dde['message']),0x1;}const _0x3f5949=_0x33a0d6['database'],_0x349fad=_0x33a0d6[_0x5d206b(0x164)];try{_0x3bbbc6[_0x5d206b(0x16d)]&&(console[_0x5d206b(0x14e)](_0x5d206b(0x15f)+_0x3bbbc6[_0x5d206b(0x158)]),console['error'](_0x5d206b(0x153)+_0x3f5949),console[_0x5d206b(0x14e)](_0x5d206b(0x162)+_0x349fad));const _0x1d0943=await withSpinner(_0x5d206b(0x156)+_0x3f5949+'.'+_0x349fad+_0x5d206b(0x15e),()=>_0x31e3a2['query']['describeTable'](_0x3f5949,_0x349fad),{'verbose':_0x3bbbc6['verbose']}),_0xca8c1a=_0x1d0943['data'];if(_0xca8c1a[_0x5d206b(0x160)]===0x0)return console[_0x5d206b(0x14e)](_0x5d206b(0x16c)),console[_0x5d206b(0x14e)](_0x5d206b(0x151)+_0x3f5949+'.'+_0x349fad+_0x5d206b(0x155)),0x1;return console[_0x5d206b(0x14e)]('✔\x20Found\x20'+_0xca8c1a[_0x5d206b(0x160)]+_0x5d206b(0x169)+(_0xca8c1a[_0x5d206b(0x160)]!==0x1?'s':'')+'\x20in\x20'+_0x3f5949+'.'+_0x349fad),await handleSDKOutput(_0xca8c1a,_0x3bbbc6),0x0;}catch(_0x2831e5){if(_0x2831e5 instanceof SDKError)return console[_0x5d206b(0x14e)](_0x5d206b(0x14f)+_0x2831e5[_0x5d206b(0x15b)]),_0x2831e5['cause']&&console[_0x5d206b(0x14e)](_0x5d206b(0x165)+_0x2831e5[_0x5d206b(0x16a)]),0x1;throw _0x2831e5;}}['validate'](_0x3670be){const _0x486601=a16_0x2392ed;if(_0x3670be['args'][_0x486601(0x160)]===0x0)return'Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';if(_0x3670be[_0x486601(0x168)][_0x486601(0x160)]>0x1)return _0x486601(0x157);return undefined;}}
@@ -1 +1 @@
1
- const a17_0x441a81=a17_0x27e9;(function(_0x1f4f97,_0x21b4f7){const _0x37ed91=a17_0x27e9,_0x42df74=_0x1f4f97();while(!![]){try{const _0x3fb1e3=-parseInt(_0x37ed91(0xb1))/0x1+parseInt(_0x37ed91(0xca))/0x2+parseInt(_0x37ed91(0xac))/0x3*(-parseInt(_0x37ed91(0xc2))/0x4)+parseInt(_0x37ed91(0xc7))/0x5+-parseInt(_0x37ed91(0xae))/0x6*(-parseInt(_0x37ed91(0xb5))/0x7)+parseInt(_0x37ed91(0xc8))/0x8+parseInt(_0x37ed91(0xb4))/0x9*(parseInt(_0x37ed91(0xb6))/0xa);if(_0x3fb1e3===_0x21b4f7)break;else _0x42df74['push'](_0x42df74['shift']());}catch(_0x18a042){_0x42df74['push'](_0x42df74['shift']());}}}(a17_0x50aa,0xdcace));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a17_0x27e9(_0x4a5e7e,_0x5ea287){_0x4a5e7e=_0x4a5e7e-0x9f;const _0x50aa8e=a17_0x50aa();let _0x27e9d7=_0x50aa8e[_0x4a5e7e];return _0x27e9d7;}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a17_0xe52a79 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a17_0x5b6805 from'path';import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{[a17_0x441a81(0xb0)]=a17_0x441a81(0xd5);['description']=a17_0x441a81(0xba);async[a17_0x441a81(0xd2)](_0x392db8){const _0x3f5eb9=a17_0x441a81,{options:_0x4356f9,args:_0x5c809c,tdx:_0x8560b1}=_0x392db8,_0x5ee6c9=_0x4356f9,_0x141324=await resolveWorkspaceName(_0x5c809c[0x0],_0x5ee6c9);if(!_0x141324)return console[_0x3f5eb9(0xad)](a17_0xe52a79[_0x3f5eb9(0xde)](_0x3f5eb9(0xdc))),console[_0x3f5eb9(0xad)](_0x3f5eb9(0xcf)),console['error'](_0x3f5eb9(0xbe)),console[_0x3f5eb9(0xad)](_0x3f5eb9(0xa4)),0x1;const _0x4cfe41=await withProgressSpinner(_0x3f5eb9(0xd0)+_0x141324+_0x3f5eb9(0xa9),_0x3113e8=>pullCampaigns({'engage':_0x8560b1[_0x3f5eb9(0xcd)],'segment':_0x8560b1[_0x3f5eb9(0xb3)]},_0x141324,{'campaignName':_0x5ee6c9[_0x3f5eb9(0xb0)],'campaignType':_0x5ee6c9[_0x3f5eb9(0xd9)],'progress':{'update':_0x28a66e=>{_0x3113e8['setPhase'](_0x28a66e);}}}),{'verbose':_0x5ee6c9[_0x3f5eb9(0xd8)]}),_0x149de3=_0x4cfe41[_0x3f5eb9(0xa7)];if(_0x149de3[_0x3f5eb9(0xbc)]['campaigns']===0x0)return console[_0x3f5eb9(0xad)](a17_0xe52a79['yellow'](_0x3f5eb9(0xbb)+_0x149de3['workspaceName']+'\x27')),0x0;const _0x181b75=_0x149de3[_0x3f5eb9(0xd6)][_0x3f5eb9(0xb9)](_0x583a17=>_0x583a17['isNew']),_0x3ddb26=_0x149de3[_0x3f5eb9(0xd6)][_0x3f5eb9(0xb9)](_0x3203fd=>!_0x3203fd[_0x3f5eb9(0xc4)]&&_0x3203fd[_0x3f5eb9(0xa8)]),_0x1a8b5b=_0x149de3[_0x3f5eb9(0xd6)][_0x3f5eb9(0xb9)](_0xf348d4=>!_0xf348d4[_0x3f5eb9(0xc4)]&&!_0xf348d4[_0x3f5eb9(0xa8)]);console[_0x3f5eb9(0xad)](_0x3f5eb9(0xc0)+_0x149de3[_0x3f5eb9(0xd1)]+'\x27:'),console[_0x3f5eb9(0xad)]('\x20\x20'+a17_0xe52a79[_0x3f5eb9(0xdd)](_0x149de3[_0x3f5eb9(0xbc)][_0x3f5eb9(0xab)]+_0x3f5eb9(0xd7))),console[_0x3f5eb9(0xad)]('\x20\x20'+a17_0xe52a79[_0x3f5eb9(0x9f)]('+\x20'+_0x181b75[_0x3f5eb9(0xbd)]+_0x3f5eb9(0xd3))),console[_0x3f5eb9(0xad)]('\x20\x20'+a17_0xe52a79['yellow']('~\x20'+_0x3ddb26['length']+_0x3f5eb9(0xe0))),console[_0x3f5eb9(0xad)]('\x20\x20'+a17_0xe52a79[_0x3f5eb9(0xda)]('=\x20'+_0x1a8b5b[_0x3f5eb9(0xbd)]+'\x20unchanged\x20files')),console[_0x3f5eb9(0xad)](_0x3f5eb9(0xb7)+a17_0xe52a79['cyan'](_0x149de3[_0x3f5eb9(0xaa)])+'\x0a');if(_0x3ddb26[_0x3f5eb9(0xbd)]>0x0)for(const _0x1eb2d6 of _0x3ddb26){console[_0x3f5eb9(0xad)]('\x0aChanges\x20to\x20\x27'+_0x1eb2d6[_0x3f5eb9(0xa2)]+'\x27:'),console[_0x3f5eb9(0xad)]('─'[_0x3f5eb9(0xcc)](0x3c)),console['error'](_0x1eb2d6[_0x3f5eb9(0xa5)]),console[_0x3f5eb9(0xad)]('─'[_0x3f5eb9(0xcc)](0x3c));}if(_0x5ee6c9[_0x3f5eb9(0xc5)])return console['error'](a17_0xe52a79[_0x3f5eb9(0xde)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x181b75[_0x3f5eb9(0xbd)]===0x0&&_0x3ddb26[_0x3f5eb9(0xbd)]===0x0)return console['error'](a17_0xe52a79[_0x3f5eb9(0x9f)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x149de3[_0x3f5eb9(0xd1)]},_0x5ee6c9[_0x3f5eb9(0xd4)]),0x0;if(!_0x5ee6c9[_0x3f5eb9(0xb2)]){if(!isInteractive())return console[_0x3f5eb9(0xad)](a17_0xe52a79[_0x3f5eb9(0xaf)]('\x0aError:'),_0x3f5eb9(0xb8)),console[_0x3f5eb9(0xad)](a17_0xe52a79[_0x3f5eb9(0xda)](_0x3f5eb9(0xce))),0x1;const _0x53b67f=await confirmKey(_0x3f5eb9(0xdf)+(_0x181b75['length']+_0x3ddb26[_0x3f5eb9(0xbd)])+_0x3f5eb9(0xc1));if(!_0x53b67f)return console[_0x3f5eb9(0xad)](a17_0xe52a79[_0x3f5eb9(0xde)](_0x3f5eb9(0xcb)),'-\x20no\x20files\x20written'),0x1;}for(const _0x4c5313 of _0x149de3[_0x3f5eb9(0xd6)]){if(_0x4c5313[_0x3f5eb9(0xc4)]||_0x4c5313['hasChanges']){const _0x21b993=a17_0x5b6805[_0x3f5eb9(0xc9)](_0x4c5313[_0x3f5eb9(0xa3)]);!existsSync(_0x21b993)&&mkdirSync(_0x21b993,{'recursive':!![]}),writeFileSync(_0x4c5313[_0x3f5eb9(0xa3)],_0x4c5313[_0x3f5eb9(0xa0)],_0x3f5eb9(0xc3));}}return console[_0x3f5eb9(0xad)](a17_0xe52a79['green'](_0x3f5eb9(0xbf)+(_0x181b75['length']+_0x3ddb26['length'])+'\x20files\x20to\x20'+_0x149de3['targetDir'])),saveSessionContext({'engage_workspace':_0x149de3[_0x3f5eb9(0xd1)]},_0x5ee6c9[_0x3f5eb9(0xd4)]),console['error'](a17_0xe52a79[_0x3f5eb9(0x9f)](_0x3f5eb9(0xdb)+a17_0xe52a79['dim']('engage_workspace')+'\x20=\x20'+a17_0xe52a79[_0x3f5eb9(0xdd)](_0x149de3[_0x3f5eb9(0xd1)]))),0x0;}}async function resolveWorkspaceName(_0x2ff311,_0x19235f){const _0x515959=a17_0x441a81;if(_0x2ff311)return _0x2ff311;if(_0x19235f[_0x515959(0xc6)])return _0x19235f[_0x515959(0xc6)];const _0x9d1910=tryFindTdxConfig(process['cwd']());if(_0x9d1910?.[_0x515959(0xa6)]['engage_workspace'])return _0x9d1910[_0x515959(0xa6)]['engage_workspace'];const _0x16c961=loadSessionContext(_0x19235f[_0x515959(0xd4)]);if(_0x16c961?.['engage_workspace'])return _0x16c961[_0x515959(0xa1)];return undefined;}function a17_0x50aa(){const _0x349466=['154Celmpq','2184310KWiyIO','\x20\x20Target:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','filter','Pull\x20campaigns\x20to\x20YAML\x20files','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','counts','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','✔\x20Pulled\x20','\x0aPull\x20summary\x20for\x20workspace\x20\x27','\x20files?','10380reJPIx','utf-8','isNew','dryRun','workspace','44385ujsFUl','130552FaeWad','dirname','338680BkzxqS','Aborted.','repeat','engage','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>','Pulling\x20campaigns\x20from\x20\x27','workspaceName','execute','\x20new\x20files','session','engage:campaign:pull','files','\x20campaigns','verbose','type','dim','✔\x20Context\x20set:\x20','Workspace\x20is\x20required.','cyan','yellow','Write\x20','\x20changed\x20files','green','content','engage_workspace','relativePath','absolutePath','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','diff','config','data','hasChanges','\x27...','targetDir','campaigns','591ZbBvXR','error','40272ksfxxL','red','name','892978gzehRt','yes','segment','81hXRFJg'];a17_0x50aa=function(){return _0x349466;};return a17_0x50aa();}
1
+ const a17_0xeccd08=a17_0x459f;(function(_0x3d4a1e,_0x184124){const _0x5c76e3=a17_0x459f,_0x4b4e7e=_0x3d4a1e();while(!![]){try{const _0x1f0abc=-parseInt(_0x5c76e3(0xa5))/0x1*(parseInt(_0x5c76e3(0x88))/0x2)+-parseInt(_0x5c76e3(0xb0))/0x3+parseInt(_0x5c76e3(0x80))/0x4*(parseInt(_0x5c76e3(0x84))/0x5)+parseInt(_0x5c76e3(0x81))/0x6+parseInt(_0x5c76e3(0xa9))/0x7*(-parseInt(_0x5c76e3(0xad))/0x8)+-parseInt(_0x5c76e3(0x7e))/0x9*(parseInt(_0x5c76e3(0x8e))/0xa)+parseInt(_0x5c76e3(0x7c))/0xb*(parseInt(_0x5c76e3(0x7d))/0xc);if(_0x1f0abc===_0x184124)break;else _0x4b4e7e['push'](_0x4b4e7e['shift']());}catch(_0x3f23c3){_0x4b4e7e['push'](_0x4b4e7e['shift']());}}}(a17_0x10da,0x69637));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';function a17_0x10da(){const _0x8bff90=['engage_workspace','2089795OcLWGq','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','✔\x20Context\x20set:\x20','yellow','554926YklVVU','verbose','diff','\x20campaigns','dirname','config','6006940NQQxAQ','hasChanges','\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>','\x27...','red','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','yes','name','error','Write\x20','campaigns','green','targetDir','counts','\x0aError:','cyan','dryRun','filter','isNew','content','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','1SvEglE','dim','Pull\x20campaigns\x20to\x20YAML\x20files','workspaceName','371LzpUQJ','\x0aChanges\x20to\x20\x27','repeat','-\x20no\x20files\x20written','37624hlpxZq','execute','\x20files?','2480601OfvSWC','Aborted.','absolutePath','\x20changed\x20files','segment','files','session','✔\x20All\x20files\x20are\x20up\x20to\x20date','utf-8','168663KqcGTq','1188WzoFzG','9sfELmi','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','8aOzOZZ','192414LeVUnQ','Workspace\x20is\x20required.'];a17_0x10da=function(){return _0x8bff90;};return a17_0x10da();}import a17_0x2b5790 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a17_0x217600 from'path';function a17_0x459f(_0x469458,_0x2920b7){_0x469458=_0x469458-0x76;const _0x10da29=a17_0x10da();let _0x459ff8=_0x10da29[_0x469458];return _0x459ff8;}import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{[a17_0xeccd08(0x96)]='engage:campaign:pull';['description']=a17_0xeccd08(0xa7);async[a17_0xeccd08(0xae)](_0x4a10f8){const _0x3a64ff=a17_0xeccd08,{options:_0x34668b,args:_0x17fa59,tdx:_0x543b89}=_0x4a10f8,_0x4279e0=_0x34668b,_0x198e56=await resolveWorkspaceName(_0x17fa59[0x0],_0x4279e0);if(!_0x198e56)return console[_0x3a64ff(0x97)](a17_0x2b5790[_0x3a64ff(0x87)](_0x3a64ff(0x82))),console[_0x3a64ff(0x97)](_0x3a64ff(0x90)),console[_0x3a64ff(0x97)](_0x3a64ff(0x7f)),console[_0x3a64ff(0x97)](_0x3a64ff(0xa4)),0x1;const _0x3680c1=await withProgressSpinner('Pulling\x20campaigns\x20from\x20\x27'+_0x198e56+_0x3a64ff(0x91),_0x3762cc=>pullCampaigns({'engage':_0x543b89['engage'],'segment':_0x543b89[_0x3a64ff(0x77)]},_0x198e56,{'campaignName':_0x4279e0[_0x3a64ff(0x96)],'campaignType':_0x4279e0['type'],'progress':{'update':_0x2dfa28=>{_0x3762cc['setPhase'](_0x2dfa28);}}}),{'verbose':_0x4279e0[_0x3a64ff(0x89)]}),_0x10b3b2=_0x3680c1['data'];if(_0x10b3b2['counts'][_0x3a64ff(0x99)]===0x0)return console[_0x3a64ff(0x97)](a17_0x2b5790[_0x3a64ff(0x87)](_0x3a64ff(0x85)+_0x10b3b2[_0x3a64ff(0xa8)]+'\x27')),0x0;const _0x150e0e=_0x10b3b2[_0x3a64ff(0x78)]['filter'](_0x39aa2b=>_0x39aa2b[_0x3a64ff(0xa1)]),_0x573709=_0x10b3b2[_0x3a64ff(0x78)][_0x3a64ff(0xa0)](_0x43b806=>!_0x43b806[_0x3a64ff(0xa1)]&&_0x43b806[_0x3a64ff(0x8f)]),_0x1069ae=_0x10b3b2[_0x3a64ff(0x78)]['filter'](_0x2c082f=>!_0x2c082f[_0x3a64ff(0xa1)]&&!_0x2c082f['hasChanges']);console[_0x3a64ff(0x97)]('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x10b3b2[_0x3a64ff(0xa8)]+'\x27:'),console[_0x3a64ff(0x97)]('\x20\x20'+a17_0x2b5790[_0x3a64ff(0x9e)](_0x10b3b2[_0x3a64ff(0x9c)][_0x3a64ff(0x99)]+_0x3a64ff(0x8b))),console['error']('\x20\x20'+a17_0x2b5790[_0x3a64ff(0x9a)]('+\x20'+_0x150e0e[_0x3a64ff(0x94)]+'\x20new\x20files')),console[_0x3a64ff(0x97)]('\x20\x20'+a17_0x2b5790[_0x3a64ff(0x87)]('~\x20'+_0x573709['length']+_0x3a64ff(0x76))),console[_0x3a64ff(0x97)]('\x20\x20'+a17_0x2b5790['dim']('=\x20'+_0x1069ae[_0x3a64ff(0x94)]+'\x20unchanged\x20files')),console['error']('\x20\x20Target:\x20'+a17_0x2b5790[_0x3a64ff(0x9e)](_0x10b3b2[_0x3a64ff(0x9b)])+'\x0a');if(_0x573709[_0x3a64ff(0x94)]>0x0)for(const _0x23152f of _0x573709){console[_0x3a64ff(0x97)](_0x3a64ff(0xaa)+_0x23152f['relativePath']+'\x27:'),console[_0x3a64ff(0x97)]('─'[_0x3a64ff(0xab)](0x3c)),console[_0x3a64ff(0x97)](_0x23152f[_0x3a64ff(0x8a)]),console[_0x3a64ff(0x97)]('─'[_0x3a64ff(0xab)](0x3c));}if(_0x4279e0[_0x3a64ff(0x9f)])return console[_0x3a64ff(0x97)](a17_0x2b5790[_0x3a64ff(0x87)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x150e0e[_0x3a64ff(0x94)]===0x0&&_0x573709[_0x3a64ff(0x94)]===0x0)return console[_0x3a64ff(0x97)](a17_0x2b5790[_0x3a64ff(0x9a)](_0x3a64ff(0x7a))),saveSessionContext({'engage_workspace':_0x10b3b2[_0x3a64ff(0xa8)]},_0x4279e0[_0x3a64ff(0x79)]),0x0;if(!_0x4279e0[_0x3a64ff(0x95)]){if(!isInteractive())return console[_0x3a64ff(0x97)](a17_0x2b5790[_0x3a64ff(0x92)](_0x3a64ff(0x9d)),_0x3a64ff(0x93)),console[_0x3a64ff(0x97)](a17_0x2b5790[_0x3a64ff(0xa6)](_0x3a64ff(0xa3))),0x1;const _0x1a7e6e=await confirmKey(_0x3a64ff(0x98)+(_0x150e0e['length']+_0x573709[_0x3a64ff(0x94)])+_0x3a64ff(0xaf));if(!_0x1a7e6e)return console[_0x3a64ff(0x97)](a17_0x2b5790[_0x3a64ff(0x87)](_0x3a64ff(0xb1)),_0x3a64ff(0xac)),0x1;}for(const _0x326d0e of _0x10b3b2['files']){if(_0x326d0e['isNew']||_0x326d0e[_0x3a64ff(0x8f)]){const _0x6129cc=a17_0x217600[_0x3a64ff(0x8c)](_0x326d0e['absolutePath']);!existsSync(_0x6129cc)&&mkdirSync(_0x6129cc,{'recursive':!![]}),writeFileSync(_0x326d0e[_0x3a64ff(0xb2)],_0x326d0e[_0x3a64ff(0xa2)],_0x3a64ff(0x7b));}}return console[_0x3a64ff(0x97)](a17_0x2b5790[_0x3a64ff(0x9a)]('✔\x20Pulled\x20'+(_0x150e0e[_0x3a64ff(0x94)]+_0x573709[_0x3a64ff(0x94)])+'\x20files\x20to\x20'+_0x10b3b2[_0x3a64ff(0x9b)])),saveSessionContext({'engage_workspace':_0x10b3b2[_0x3a64ff(0xa8)]},_0x4279e0['session']),console[_0x3a64ff(0x97)](a17_0x2b5790[_0x3a64ff(0x9a)](_0x3a64ff(0x86)+a17_0x2b5790['dim'](_0x3a64ff(0x83))+'\x20=\x20'+a17_0x2b5790['cyan'](_0x10b3b2[_0x3a64ff(0xa8)]))),0x0;}}async function resolveWorkspaceName(_0x488842,_0x2cdf78){const _0x15b1d6=a17_0xeccd08;if(_0x488842)return _0x488842;if(_0x2cdf78['workspace'])return _0x2cdf78['workspace'];const _0x554d61=tryFindTdxConfig(process['cwd']());if(_0x554d61?.[_0x15b1d6(0x8d)]['engage_workspace'])return _0x554d61[_0x15b1d6(0x8d)][_0x15b1d6(0x83)];const _0x4831f4=loadSessionContext(_0x2cdf78[_0x15b1d6(0x79)]);if(_0x4831f4?.[_0x15b1d6(0x83)])return _0x4831f4[_0x15b1d6(0x83)];return undefined;}
@@ -1 +1 @@
1
- const a18_0x4c91b8=a18_0x21a5;(function(_0x368c68,_0x1ddadc){const _0x55cf4b=a18_0x21a5,_0x218470=_0x368c68();while(!![]){try{const _0x112515=-parseInt(_0x55cf4b(0x1c1))/0x1+parseInt(_0x55cf4b(0x1be))/0x2*(parseInt(_0x55cf4b(0x1d8))/0x3)+parseInt(_0x55cf4b(0x1c3))/0x4*(-parseInt(_0x55cf4b(0x1a2))/0x5)+-parseInt(_0x55cf4b(0x1ca))/0x6*(-parseInt(_0x55cf4b(0x19d))/0x7)+-parseInt(_0x55cf4b(0x190))/0x8*(parseInt(_0x55cf4b(0x197))/0x9)+parseInt(_0x55cf4b(0x1c7))/0xa*(-parseInt(_0x55cf4b(0x1b8))/0xb)+-parseInt(_0x55cf4b(0x1b3))/0xc*(-parseInt(_0x55cf4b(0x19e))/0xd);if(_0x112515===_0x1ddadc)break;else _0x218470['push'](_0x218470['shift']());}catch(_0x677f43){_0x218470['push'](_0x218470['shift']());}}}(a18_0x3341,0x6fe88));function a18_0x3341(){const _0x3104b7=['campaignId','1\x20campaign\x20file:\x20','Preparing\x20push\x20to\x20workspace\x20\x27','\x20campaigns','results','path','dirname','\x27...','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','action','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','-\x20no\x20changes\x20applied','690nEwLjh','created','message','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','55160ZzZnIm','engage','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','warnings','updated','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','error','135XHvWXC','verbose','✔\x20Created\x20','workspace','configDir','dim','2471DIjxwP','13FnZtSf','campaign_type','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','filter','183085DISamK','create','\x20campaigns\x20to\x20update:','def','update','Workspace\x20is\x20required.','config','yellow','\x0aError:','execute','valid','green','\x20\x20\x20\x20','yes','map','session','data','6524484jZZWpN','engage_workspace','setPhase','errors','Found\x20','5294245aHPCzq','\x0aPush\x20summary\x20for\x20workspace\x20\x27','dryRun','red','segment','cwd','5658hJjXeh','✔\x20Updated\x20','resolve','72086EXqqHy','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','84cleufN','name','length','Pushing\x20campaigns...','10jrVnCm','\x0aValidation\x20errors\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','11724XiOHkK'];a18_0x3341=function(){return _0x3104b7;};return a18_0x3341();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a18_0x1bc172 from'chalk';import a18_0x2e882e from'path';function a18_0x21a5(_0x2f4f94,_0x2ddb5b){_0x2f4f94=_0x2f4f94-0x190;const _0x3341c3=a18_0x3341();let _0x21a577=_0x3341c3[_0x2f4f94];return _0x21a577;}import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a18_0x4c91b8(0x1c4)]='engage:campaign:push';['description']=a18_0x4c91b8(0x192);async[a18_0x4c91b8(0x1ab)](_0x2ecb3a){const _0x5c498f=a18_0x4c91b8,{options:_0x594656,args:_0x550147,tdx:_0x36035}=_0x2ecb3a,_0x57cab8=_0x594656,_0x3845f9=_0x550147[0x0],_0x2d44d4=_0x3845f9?a18_0x2e882e[_0x5c498f(0x1c0)](_0x3845f9):undefined,_0xc15f4a=_0x2d44d4?isYamlFile(_0x2d44d4):![];let _0xfb7dff;if(_0xc15f4a&&_0x2d44d4)_0xfb7dff=a18_0x2e882e[_0x5c498f(0x1d1)](_0x2d44d4);else _0x2d44d4?_0xfb7dff=_0x2d44d4:_0xfb7dff=process[_0x5c498f(0x1bd)]();let _0x2f4485;const _0x4bbc79=tryFindTdxConfig(_0xfb7dff);_0x4bbc79?.['config'][_0x5c498f(0x1b4)]&&(_0x2f4485=_0x4bbc79[_0x5c498f(0x1a8)][_0x5c498f(0x1b4)],!_0xc15f4a&&(_0xfb7dff=_0x4bbc79[_0x5c498f(0x19b)]));_0x57cab8[_0x5c498f(0x19a)]&&(_0x2f4485=_0x57cab8[_0x5c498f(0x19a)]);if(!_0x2f4485){const _0x2813a6=loadSessionContext(_0x57cab8[_0x5c498f(0x1b1)]);_0x2813a6?.[_0x5c498f(0x1b4)]&&(_0x2f4485=_0x2813a6[_0x5c498f(0x1b4)]);}if(!_0x2f4485)return console[_0x5c498f(0x196)](a18_0x1bc172[_0x5c498f(0x1a9)](_0x5c498f(0x1a7))),console['error'](_0x5c498f(0x1c2)),console[_0x5c498f(0x196)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console[_0x5c498f(0x196)](_0x5c498f(0x1c9)),console[_0x5c498f(0x196)](_0x5c498f(0x195)),0x1;let _0xf55704;_0xc15f4a&&_0x2d44d4?_0xf55704=[_0x2d44d4]:_0xf55704=discoverCampaignFiles(_0xfb7dff);if(_0xf55704[_0x5c498f(0x1c5)]===0x0)return console['error'](a18_0x1bc172[_0x5c498f(0x1a9)](_0x5c498f(0x1d5)+_0xfb7dff)),console[_0x5c498f(0x196)](a18_0x1bc172['dim'](_0x5c498f(0x1db))),0x1;const _0x3b760c=_0xf55704[_0x5c498f(0x1b0)](_0x59c5be=>parseCampaignFile(_0x59c5be,a18_0x2e882e[_0x5c498f(0x1d1)](_0x59c5be))),_0x1194fd=_0x3b760c[_0x5c498f(0x1c5)]===0x1?_0x5c498f(0x1cc)+_0x3b760c[0x0]['def'][_0x5c498f(0x1c4)]:_0x3b760c[_0x5c498f(0x1c5)]+'\x20campaign\x20files';console[_0x5c498f(0x196)](_0x5c498f(0x1b7)+a18_0x1bc172['cyan'](_0x1194fd));let _0x1e54fa=![];for(const _0x252b5c of _0x3b760c){const _0xb1dc11=validateCampaignDef(_0x252b5c[_0x5c498f(0x1a5)]);if(!_0xb1dc11[_0x5c498f(0x1ac)]){_0x1e54fa=!![],console[_0x5c498f(0x196)](a18_0x1bc172[_0x5c498f(0x1bb)](_0x5c498f(0x1c8)+_0x252b5c['relativePath']+':'));for(const _0x1b942d of _0xb1dc11['errors']){console[_0x5c498f(0x196)]('\x20\x20'+a18_0x1bc172['red']('✗')+'\x20'+_0x1b942d[_0x5c498f(0x1d0)]+':\x20'+_0x1b942d[_0x5c498f(0x1da)]);}}for(const _0x250a72 of _0xb1dc11[_0x5c498f(0x193)]){console['error']('\x20\x20'+a18_0x1bc172['yellow']('⚠')+'\x20'+_0x250a72['path']+':\x20'+_0x250a72['message']);}}if(_0x1e54fa)return console[_0x5c498f(0x196)](a18_0x1bc172['red'](_0x5c498f(0x1a0))),0x1;const _0x2f5eca=await _0x36035[_0x5c498f(0x191)]['resolveWorkspaceId'](_0x2f4485),_0x203b56=await withProgressSpinner(_0x5c498f(0x1cd)+_0x2f4485+_0x5c498f(0x1d2),_0x12a2a1=>preparePush({'engage':_0x36035['engage'],'segment':_0x36035[_0x5c498f(0x1bc)]},_0x3b760c,_0x2f5eca,{'progress':{'update':_0x2d9828=>_0x12a2a1[_0x5c498f(0x1b5)](_0x2d9828)}}),{'verbose':_0x57cab8[_0x5c498f(0x198)]}),_0xcc3f4=_0x203b56[_0x5c498f(0x1b2)];await withProgressSpinner('Resolving\x20references...',_0x145234=>resolveAndBuildInputs({'engage':_0x36035[_0x5c498f(0x191)],'segment':_0x36035[_0x5c498f(0x1bc)]},_0xcc3f4,_0x2f5eca,{'progress':{'update':_0x3febd5=>_0x145234[_0x5c498f(0x1b5)](_0x3febd5)}}),{'verbose':_0x57cab8['verbose']});const _0x47c9cb=_0xcc3f4[_0x5c498f(0x1a1)](_0x524118=>_0x524118[_0x5c498f(0x1d4)]===_0x5c498f(0x1a3)),_0x407695=_0xcc3f4[_0x5c498f(0x1a1)](_0x432299=>_0x432299[_0x5c498f(0x1d4)]===_0x5c498f(0x1a6));console['error'](_0x5c498f(0x1b9)+_0x2f4485+'\x27:');if(_0x47c9cb[_0x5c498f(0x1c5)]>0x0){console[_0x5c498f(0x196)]('\x20\x20'+a18_0x1bc172[_0x5c498f(0x1ad)]('+\x20'+_0x47c9cb[_0x5c498f(0x1c5)]+'\x20new\x20campaigns:'));for(const _0xcde284 of _0x47c9cb){console[_0x5c498f(0x196)](_0x5c498f(0x1ae)+a18_0x1bc172[_0x5c498f(0x1ad)]('+')+'\x20'+_0xcde284[_0x5c498f(0x1a5)]['name']+'\x20('+_0xcde284[_0x5c498f(0x1a5)][_0x5c498f(0x19f)]+')');}}if(_0x407695[_0x5c498f(0x1c5)]>0x0){console[_0x5c498f(0x196)]('\x20\x20'+a18_0x1bc172[_0x5c498f(0x1a9)]('~\x20'+_0x407695[_0x5c498f(0x1c5)]+_0x5c498f(0x1a4)));for(const _0x3cf60e of _0x407695){console[_0x5c498f(0x196)](_0x5c498f(0x1ae)+a18_0x1bc172[_0x5c498f(0x1a9)]('~')+'\x20'+_0x3cf60e[_0x5c498f(0x1a5)][_0x5c498f(0x1c4)]+'\x20('+_0x3cf60e['def'][_0x5c498f(0x19f)]+')');}}if(_0x47c9cb[_0x5c498f(0x1c5)]===0x0&&_0x407695['length']===0x0)return console[_0x5c498f(0x196)](a18_0x1bc172[_0x5c498f(0x1ad)](_0x5c498f(0x1d3))),0x0;if(_0x57cab8[_0x5c498f(0x1ba)])return console[_0x5c498f(0x196)](a18_0x1bc172[_0x5c498f(0x1a9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x57cab8[_0x5c498f(0x1af)]){if(!isInteractive())return console[_0x5c498f(0x196)](a18_0x1bc172['red'](_0x5c498f(0x1aa)),_0x5c498f(0x1d6)),console[_0x5c498f(0x196)](a18_0x1bc172[_0x5c498f(0x19c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x55bf0c=await confirmKey('Push\x20'+(_0x47c9cb[_0x5c498f(0x1c5)]+_0x407695[_0x5c498f(0x1c5)])+'\x20campaigns?');if(!_0x55bf0c)return console[_0x5c498f(0x196)](a18_0x1bc172['yellow']('Aborted.'),_0x5c498f(0x1d7)),0x1;}const _0x340322=await withProgressSpinner(_0x5c498f(0x1c6),_0x52cbc6=>executePush({'engage':_0x36035[_0x5c498f(0x191)],'segment':_0x36035['segment']},_0xcc3f4,{'progress':{'update':_0x5ae2a2=>_0x52cbc6['setPhase'](_0x5ae2a2)}}),{'verbose':_0x57cab8[_0x5c498f(0x198)]}),_0x14246c=_0x340322[_0x5c498f(0x1b2)];for(const _0x2b73e5 of _0x14246c[_0x5c498f(0x1cf)]){if(_0x2b73e5[_0x5c498f(0x1cb)]&&(_0x2b73e5['action']===_0x5c498f(0x1d9)||_0x2b73e5['action']===_0x5c498f(0x194))){const _0x58da74=getCampaignUrl(_0x57cab8['site'],_0x2f5eca,_0x2b73e5[_0x5c498f(0x1cb)]),_0x3f1855=_0x2b73e5['action']===_0x5c498f(0x1d9)?'+':'~',_0x311fe4=_0x2b73e5[_0x5c498f(0x1d4)]===_0x5c498f(0x1d9)?a18_0x1bc172['green'](_0x3f1855):a18_0x1bc172[_0x5c498f(0x1a9)](_0x3f1855);console['error']('\x20\x20'+_0x311fe4+'\x20'+hyperlink(_0x2b73e5['name'],_0x58da74)+'\x20'+a18_0x1bc172['dim'](_0x58da74));}}_0x14246c['created']>0x0&&console[_0x5c498f(0x196)](a18_0x1bc172[_0x5c498f(0x1ad)](_0x5c498f(0x199)+_0x14246c[_0x5c498f(0x1d9)]+_0x5c498f(0x1ce)));_0x14246c[_0x5c498f(0x194)]>0x0&&console[_0x5c498f(0x196)](a18_0x1bc172[_0x5c498f(0x1ad)](_0x5c498f(0x1bf)+_0x14246c[_0x5c498f(0x194)]+_0x5c498f(0x1ce)));if(_0x14246c[_0x5c498f(0x1b6)][_0x5c498f(0x1c5)]>0x0){console['error'](a18_0x1bc172[_0x5c498f(0x1bb)]('✘\x20'+_0x14246c[_0x5c498f(0x1b6)]['length']+'\x20errors:'));for(const _0x5446a6 of _0x14246c[_0x5c498f(0x1b6)]){console['error']('\x20\x20'+a18_0x1bc172['red'](_0x5446a6[_0x5c498f(0x1c4)])+':\x20'+_0x5446a6[_0x5c498f(0x196)]);}}return saveSessionContext({'engage_workspace':_0x2f4485},_0x57cab8[_0x5c498f(0x1b1)]),_0x14246c[_0x5c498f(0x1b6)][_0x5c498f(0x1c5)]>0x0?0x1:0x0;}}
1
+ const a18_0x48eb32=a18_0x5ac7;(function(_0x44564d,_0x35196f){const _0x1657ab=a18_0x5ac7,_0x84ff0f=_0x44564d();while(!![]){try{const _0xa60b95=-parseInt(_0x1657ab(0x1ad))/0x1+-parseInt(_0x1657ab(0x1af))/0x2*(-parseInt(_0x1657ab(0x1c7))/0x3)+-parseInt(_0x1657ab(0x1c8))/0x4*(parseInt(_0x1657ab(0x1bd))/0x5)+-parseInt(_0x1657ab(0x1c0))/0x6*(parseInt(_0x1657ab(0x1a4))/0x7)+-parseInt(_0x1657ab(0x1b9))/0x8+parseInt(_0x1657ab(0x19e))/0x9+parseInt(_0x1657ab(0x1b4))/0xa;if(_0xa60b95===_0x35196f)break;else _0x84ff0f['push'](_0x84ff0f['shift']());}catch(_0x33d2bb){_0x84ff0f['push'](_0x84ff0f['shift']());}}}(a18_0x250b,0x59e91));import{BaseCommand}from'./command.js';function a18_0x250b(){const _0x67bb50=['✔\x20Updated\x20','setPhase','185813oNWlfT','create','356clWNOQ','campaign_type','name','update','session','1823030HoOJiM','resolveWorkspaceId','config','Preparing\x20push\x20to\x20workspace\x20\x27','dirname','2404728GeUFOw','updated','errors','data','210WLzUBJ','warnings','segment','2370qXfDna','red','\x27...','\x20campaign\x20files','map','dim','engage_workspace','5658PjstGx','228ZcxVmS','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','length','\x20campaigns','created','engage:campaign:push','Aborted.','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','error','Push\x20','def','yellow','campaignId','\x0aError:','cwd','path','action','Resolving\x20references...','Workspace\x20is\x20required.','\x20campaigns\x20to\x20update:','\x20new\x20campaigns:','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','\x0aPush\x20summary\x20for\x20workspace\x20\x27','Found\x20','\x20\x20\x20\x20','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\x0aValidation\x20errors\x20in\x20','3830085yYWcmt','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','engage','message','workspace','execute','1533blPZBc','green','configDir','dryRun','verbose','filter','1\x20campaign\x20file:\x20'];a18_0x250b=function(){return _0x67bb50;};return a18_0x250b();}function a18_0x5ac7(_0x5e2a6b,_0x34ed6c){_0x5e2a6b=_0x5e2a6b-0x198;const _0x250ba6=a18_0x250b();let _0x5ac791=_0x250ba6[_0x5e2a6b];return _0x5ac791;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a18_0x535a84 from'chalk';import a18_0x2c56a0 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a18_0x48eb32(0x1b1)]=a18_0x48eb32(0x1d0);['description']='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns';async[a18_0x48eb32(0x1a3)](_0x2f41c9){const _0x2dbb36=a18_0x48eb32,{options:_0x3a888e,args:_0x124003,tdx:_0x1f5fdd}=_0x2f41c9,_0x16742d=_0x3a888e,_0x290a6d=_0x124003[0x0],_0x4c1b04=_0x290a6d?a18_0x2c56a0['resolve'](_0x290a6d):undefined,_0x480fd7=_0x4c1b04?isYamlFile(_0x4c1b04):![];let _0x1793e2;if(_0x480fd7&&_0x4c1b04)_0x1793e2=a18_0x2c56a0[_0x2dbb36(0x1b8)](_0x4c1b04);else _0x4c1b04?_0x1793e2=_0x4c1b04:_0x1793e2=process[_0x2dbb36(0x1d9)]();let _0x54c2e2;const _0x549489=tryFindTdxConfig(_0x1793e2);_0x549489?.[_0x2dbb36(0x1b6)]['engage_workspace']&&(_0x54c2e2=_0x549489[_0x2dbb36(0x1b6)]['engage_workspace'],!_0x480fd7&&(_0x1793e2=_0x549489[_0x2dbb36(0x1a6)]));_0x16742d[_0x2dbb36(0x1a2)]&&(_0x54c2e2=_0x16742d[_0x2dbb36(0x1a2)]);if(!_0x54c2e2){const _0xad493d=loadSessionContext(_0x16742d[_0x2dbb36(0x1b3)]);_0xad493d?.[_0x2dbb36(0x1c6)]&&(_0x54c2e2=_0xad493d[_0x2dbb36(0x1c6)]);}if(!_0x54c2e2)return console['error'](a18_0x535a84[_0x2dbb36(0x1d6)](_0x2dbb36(0x1dd))),console['error'](_0x2dbb36(0x1d2)),console[_0x2dbb36(0x1d3)](_0x2dbb36(0x1ca)),console['error'](_0x2dbb36(0x1cc)),console[_0x2dbb36(0x1d3)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x1d475c;_0x480fd7&&_0x4c1b04?_0x1d475c=[_0x4c1b04]:_0x1d475c=discoverCampaignFiles(_0x1793e2);if(_0x1d475c[_0x2dbb36(0x1cd)]===0x0)return console['error'](a18_0x535a84[_0x2dbb36(0x1d6)](_0x2dbb36(0x19f)+_0x1793e2)),console[_0x2dbb36(0x1d3)](a18_0x535a84[_0x2dbb36(0x1c5)](_0x2dbb36(0x19b))),0x1;const _0x2acbbf=_0x1d475c[_0x2dbb36(0x1c4)](_0x410c9b=>parseCampaignFile(_0x410c9b,a18_0x2c56a0[_0x2dbb36(0x1b8)](_0x410c9b))),_0x67fb03=_0x2acbbf[_0x2dbb36(0x1cd)]===0x1?_0x2dbb36(0x1aa)+_0x2acbbf[0x0][_0x2dbb36(0x1d5)]['name']:_0x2acbbf[_0x2dbb36(0x1cd)]+_0x2dbb36(0x1c3);console[_0x2dbb36(0x1d3)](_0x2dbb36(0x199)+a18_0x535a84['cyan'](_0x67fb03));let _0x5678c1=![];for(const _0x34fde9 of _0x2acbbf){const _0x41a6ce=validateCampaignDef(_0x34fde9[_0x2dbb36(0x1d5)]);if(!_0x41a6ce['valid']){_0x5678c1=!![],console[_0x2dbb36(0x1d3)](a18_0x535a84[_0x2dbb36(0x1c1)](_0x2dbb36(0x19d)+_0x34fde9['relativePath']+':'));for(const _0x5c9fd0 of _0x41a6ce[_0x2dbb36(0x1bb)]){console[_0x2dbb36(0x1d3)]('\x20\x20'+a18_0x535a84[_0x2dbb36(0x1c1)]('✗')+'\x20'+_0x5c9fd0[_0x2dbb36(0x1da)]+':\x20'+_0x5c9fd0[_0x2dbb36(0x1a1)]);}}for(const _0x599a95 of _0x41a6ce[_0x2dbb36(0x1be)]){console[_0x2dbb36(0x1d3)]('\x20\x20'+a18_0x535a84[_0x2dbb36(0x1d6)]('⚠')+'\x20'+_0x599a95[_0x2dbb36(0x1da)]+':\x20'+_0x599a95[_0x2dbb36(0x1a1)]);}}if(_0x5678c1)return console[_0x2dbb36(0x1d3)](a18_0x535a84['red']('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x14eace=await _0x1f5fdd[_0x2dbb36(0x1a0)][_0x2dbb36(0x1b5)](_0x54c2e2),_0x7bd10f=await withProgressSpinner(_0x2dbb36(0x1b7)+_0x54c2e2+_0x2dbb36(0x1c2),_0x39971b=>preparePush({'engage':_0x1f5fdd[_0x2dbb36(0x1a0)],'segment':_0x1f5fdd[_0x2dbb36(0x1bf)]},_0x2acbbf,_0x14eace,{'progress':{'update':_0x554508=>_0x39971b[_0x2dbb36(0x1ac)](_0x554508)}}),{'verbose':_0x16742d[_0x2dbb36(0x1a8)]}),_0x2da52f=_0x7bd10f[_0x2dbb36(0x1bc)];await withProgressSpinner(_0x2dbb36(0x1dc),_0x592767=>resolveAndBuildInputs({'engage':_0x1f5fdd[_0x2dbb36(0x1a0)],'segment':_0x1f5fdd[_0x2dbb36(0x1bf)]},_0x2da52f,_0x14eace,{'progress':{'update':_0x5bf3b8=>_0x592767['setPhase'](_0x5bf3b8)}}),{'verbose':_0x16742d[_0x2dbb36(0x1a8)]});const _0x2deec6=_0x2da52f[_0x2dbb36(0x1a9)](_0x76c75d=>_0x76c75d[_0x2dbb36(0x1db)]===_0x2dbb36(0x1ae)),_0x1dd51b=_0x2da52f[_0x2dbb36(0x1a9)](_0x175624=>_0x175624[_0x2dbb36(0x1db)]===_0x2dbb36(0x1b2));console[_0x2dbb36(0x1d3)](_0x2dbb36(0x198)+_0x54c2e2+'\x27:');if(_0x2deec6[_0x2dbb36(0x1cd)]>0x0){console[_0x2dbb36(0x1d3)]('\x20\x20'+a18_0x535a84[_0x2dbb36(0x1a5)]('+\x20'+_0x2deec6['length']+_0x2dbb36(0x1df)));for(const _0x2d0f88 of _0x2deec6){console[_0x2dbb36(0x1d3)](_0x2dbb36(0x19a)+a18_0x535a84[_0x2dbb36(0x1a5)]('+')+'\x20'+_0x2d0f88[_0x2dbb36(0x1d5)][_0x2dbb36(0x1b1)]+'\x20('+_0x2d0f88[_0x2dbb36(0x1d5)]['campaign_type']+')');}}if(_0x1dd51b[_0x2dbb36(0x1cd)]>0x0){console['error']('\x20\x20'+a18_0x535a84[_0x2dbb36(0x1d6)]('~\x20'+_0x1dd51b[_0x2dbb36(0x1cd)]+_0x2dbb36(0x1de)));for(const _0x4a63ed of _0x1dd51b){console[_0x2dbb36(0x1d3)]('\x20\x20\x20\x20'+a18_0x535a84['yellow']('~')+'\x20'+_0x4a63ed[_0x2dbb36(0x1d5)][_0x2dbb36(0x1b1)]+'\x20('+_0x4a63ed[_0x2dbb36(0x1d5)][_0x2dbb36(0x1b0)]+')');}}if(_0x2deec6[_0x2dbb36(0x1cd)]===0x0&&_0x1dd51b['length']===0x0)return console[_0x2dbb36(0x1d3)](a18_0x535a84['green'](_0x2dbb36(0x1e0))),0x0;if(_0x16742d[_0x2dbb36(0x1a7)])return console[_0x2dbb36(0x1d3)](a18_0x535a84[_0x2dbb36(0x1d6)](_0x2dbb36(0x19c))),0x0;if(!_0x16742d['yes']){if(!isInteractive())return console[_0x2dbb36(0x1d3)](a18_0x535a84[_0x2dbb36(0x1c1)](_0x2dbb36(0x1d8)),_0x2dbb36(0x1c9)),console[_0x2dbb36(0x1d3)](a18_0x535a84[_0x2dbb36(0x1c5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4b1713=await confirmKey(_0x2dbb36(0x1d4)+(_0x2deec6[_0x2dbb36(0x1cd)]+_0x1dd51b[_0x2dbb36(0x1cd)])+'\x20campaigns?');if(!_0x4b1713)return console['error'](a18_0x535a84['yellow'](_0x2dbb36(0x1d1)),'-\x20no\x20changes\x20applied'),0x1;}const _0x72378f=await withProgressSpinner('Pushing\x20campaigns...',_0x5c5da8=>executePush({'engage':_0x1f5fdd[_0x2dbb36(0x1a0)],'segment':_0x1f5fdd[_0x2dbb36(0x1bf)]},_0x2da52f,{'progress':{'update':_0x648f4f=>_0x5c5da8[_0x2dbb36(0x1ac)](_0x648f4f)}}),{'verbose':_0x16742d[_0x2dbb36(0x1a8)]}),_0x5148de=_0x72378f[_0x2dbb36(0x1bc)];for(const _0x36012f of _0x5148de['results']){if(_0x36012f[_0x2dbb36(0x1d7)]&&(_0x36012f[_0x2dbb36(0x1db)]===_0x2dbb36(0x1cf)||_0x36012f[_0x2dbb36(0x1db)]===_0x2dbb36(0x1ba))){const _0x4ad029=getCampaignUrl(_0x16742d[_0x2dbb36(0x1cb)],_0x14eace,_0x36012f[_0x2dbb36(0x1d7)]),_0x4ec609=_0x36012f[_0x2dbb36(0x1db)]===_0x2dbb36(0x1cf)?'+':'~',_0x163fa8=_0x36012f[_0x2dbb36(0x1db)]===_0x2dbb36(0x1cf)?a18_0x535a84[_0x2dbb36(0x1a5)](_0x4ec609):a18_0x535a84[_0x2dbb36(0x1d6)](_0x4ec609);console[_0x2dbb36(0x1d3)]('\x20\x20'+_0x163fa8+'\x20'+hyperlink(_0x36012f[_0x2dbb36(0x1b1)],_0x4ad029)+'\x20'+a18_0x535a84[_0x2dbb36(0x1c5)](_0x4ad029));}}_0x5148de[_0x2dbb36(0x1cf)]>0x0&&console[_0x2dbb36(0x1d3)](a18_0x535a84[_0x2dbb36(0x1a5)]('✔\x20Created\x20'+_0x5148de[_0x2dbb36(0x1cf)]+_0x2dbb36(0x1ce)));_0x5148de[_0x2dbb36(0x1ba)]>0x0&&console[_0x2dbb36(0x1d3)](a18_0x535a84[_0x2dbb36(0x1a5)](_0x2dbb36(0x1ab)+_0x5148de[_0x2dbb36(0x1ba)]+'\x20campaigns'));if(_0x5148de[_0x2dbb36(0x1bb)][_0x2dbb36(0x1cd)]>0x0){console[_0x2dbb36(0x1d3)](a18_0x535a84[_0x2dbb36(0x1c1)]('✘\x20'+_0x5148de[_0x2dbb36(0x1bb)][_0x2dbb36(0x1cd)]+'\x20errors:'));for(const _0x14116f of _0x5148de[_0x2dbb36(0x1bb)]){console[_0x2dbb36(0x1d3)]('\x20\x20'+a18_0x535a84['red'](_0x14116f[_0x2dbb36(0x1b1)])+':\x20'+_0x14116f['error']);}}return saveSessionContext({'engage_workspace':_0x54c2e2},_0x16742d[_0x2dbb36(0x1b3)]),_0x5148de[_0x2dbb36(0x1bb)][_0x2dbb36(0x1cd)]>0x0?0x1:0x0;}}