@treasuredata/tdx 0.16.12 → 0.16.13

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 (167) 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/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/anthropic-adapter.js +1 -1
  65. package/dist/proxy/claude-usage-tracker.js +1 -1
  66. package/dist/proxy/context-signature.js +1 -1
  67. package/dist/proxy/conversation-utils.js +1 -1
  68. package/dist/proxy/passthrough-server.js +1 -1
  69. package/dist/proxy/server.js +1 -1
  70. package/dist/proxy/session-cache.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/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/endpoints.js +1 -1
  83. package/dist/sdk/client/engage-api-client.js +1 -1
  84. package/dist/sdk/client/http-client.js +1 -1
  85. package/dist/sdk/client/llm-api-client.js +1 -1
  86. package/dist/sdk/client/rate-limiter.js +1 -1
  87. package/dist/sdk/client/td-api-client.js +1 -1
  88. package/dist/sdk/client/trino-api-client.js +1 -1
  89. package/dist/sdk/client/workflow-client.js +1 -1
  90. package/dist/sdk/connection-validator.js +1 -1
  91. package/dist/sdk/connection.js +1 -1
  92. package/dist/sdk/engage.js +1 -1
  93. package/dist/sdk/errors.js +1 -1
  94. package/dist/sdk/index.js +1 -1
  95. package/dist/sdk/io/index.js +1 -1
  96. package/dist/sdk/io/node-filesystem.js +1 -1
  97. package/dist/sdk/job.js +1 -1
  98. package/dist/sdk/journey.js +1 -1
  99. package/dist/sdk/llm/chat-cache.js +1 -1
  100. package/dist/sdk/llm/index.js +1 -1
  101. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  102. package/dist/sdk/llm/model-aliases.js +1 -1
  103. package/dist/sdk/llm/model-factors.js +1 -1
  104. package/dist/sdk/query/index.js +1 -1
  105. package/dist/sdk/query/sql-parser.js +1 -1
  106. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  107. package/dist/sdk/segment/fields-display.js +1 -1
  108. package/dist/sdk/segment/file-discovery.js +1 -1
  109. package/dist/sdk/segment/journey-utils.js +1 -1
  110. package/dist/sdk/segment/journey-yaml.js +1 -1
  111. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  112. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  113. package/dist/sdk/segment/pull-workflow.js +1 -1
  114. package/dist/sdk/segment/push-workflow.js +1 -1
  115. package/dist/sdk/segment/resolution-context.js +1 -1
  116. package/dist/sdk/segment/segment-path-parser.js +1 -1
  117. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  118. package/dist/sdk/segment/target-resolution.js +1 -1
  119. package/dist/sdk/segment/tdx-config.js +1 -1
  120. package/dist/sdk/segment/validate-files.js +1 -1
  121. package/dist/sdk/segment/yaml-validator.js +1 -1
  122. package/dist/sdk/segment.js +1 -1
  123. package/dist/sdk/types/index.js +1 -1
  124. package/dist/sdk/types/progress.js +1 -1
  125. package/dist/sdk/user.js +1 -1
  126. package/dist/sdk/util/format-detector.js +1 -1
  127. package/dist/sdk/util/formatters.js +1 -1
  128. package/dist/sdk/util/index.js +1 -1
  129. package/dist/sdk/util/tree-formatter.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.js +1 -1
  148. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  149. package/dist/utils/logger/formatters/index.js +1 -1
  150. package/dist/utils/logger/handlers/console-handler.js +1 -1
  151. package/dist/utils/logger/handlers/file-handler.js +1 -1
  152. package/dist/utils/logger/handlers/index.js +1 -1
  153. package/dist/utils/logger/handlers/null-handler.js +1 -1
  154. package/dist/utils/logger/index.js +1 -1
  155. package/dist/utils/logger/logger.js +1 -1
  156. package/dist/utils/logger/types.js +1 -1
  157. package/dist/utils/option-validation.js +1 -1
  158. package/dist/utils/port.js +1 -1
  159. package/dist/utils/process.js +1 -1
  160. package/dist/utils/prompt.js +1 -1
  161. package/dist/utils/spinner.js +1 -1
  162. package/dist/utils/sse-parser.js +1 -1
  163. package/dist/utils/string-utils.js +1 -1
  164. package/dist/utils/table-ref-parser.js +1 -1
  165. package/dist/utils/tdx-logger.js +1 -1
  166. package/dist/utils/version-check.js +1 -1
  167. package/package.json +1 -1
@@ -1 +1 @@
1
- const a9_0x3ff27c=a9_0x2987;(function(_0x58fda3,_0x4e9122){const _0x3b9822=a9_0x2987,_0x39989d=_0x58fda3();while(!![]){try{const _0x469f30=-parseInt(_0x3b9822(0xad))/0x1+-parseInt(_0x3b9822(0x104))/0x2+parseInt(_0x3b9822(0xc3))/0x3+-parseInt(_0x3b9822(0x142))/0x4*(-parseInt(_0x3b9822(0x148))/0x5)+-parseInt(_0x3b9822(0xd1))/0x6+-parseInt(_0x3b9822(0x126))/0x7*(parseInt(_0x3b9822(0xed))/0x8)+parseInt(_0x3b9822(0xaf))/0x9;if(_0x469f30===_0x4e9122)break;else _0x39989d['push'](_0x39989d['shift']());}catch(_0x37d60f){_0x39989d['push'](_0x39989d['shift']());}}}(a9_0x70d4,0xef5c5));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x6fe8dd from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findAvailablePort}from'../utils/port.js';function a9_0x70d4(){const _0x535fc9=['sql-skills','string','http://127.0.0.1:','CLAUDE_CODE_USE_VERTEX','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','context','tdx-managed-proxy','Initializing...','Initializing\x20proxy\x20logger...','td-docs','CLAUDE_CODE_USE_BEDROCK','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','workflow-skills','data','3129633PvDDpH','Finding\x20available\x20port...','stop','Claude\x20Code\x20CLI\x20not\x20found','Setup\x20failed','--transport','log','message','apiKey','mcp','Executing:\x20claude\x20','Failed\x20to\x20install\x20plugin\x20\x27','verbose','install','3666168XZnlIF','false','INSTALLATION_FAILED','major','minor','start','includes','canParse','http','name','stdout','warn','exit','site','INVALID_ARGUMENT','logger','logLevel','Claude\x20Code\x20version\x20check\x20failed','utf-8','Updating\x20marketplace\x20\x27','Failed\x20to\x20launch\x20Claude\x20Code:\x20','cwd','\x27\x20configured','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','already\x20installed','inherit','\x27...','text','9032EdcqrG','Installing\x20plugin\x20\x27','cause','proxy','marketplace','✓\x20Using\x20project:\x20','✓\x20Settings\x20restored:\x20.claude/settings.local.json','add','description','Command\x20failed\x20(exit\x20','patch','info','ANTHROPIC_BASE_URL','server','Failed\x20to\x20spawn\x20claude\x20command:\x20','object','type','trim','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','statusLine','getOrCreateDefaultProject','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','passThroughServer','3450454OjOxfa','Command\x20output:\x20','ANTHROPIC_MODEL','resume','Creating\x20.claude/settings.local.json...','CLAUDE_CODE_UNSUPPORTED_VERSION','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','✓\x20Settings\x20configured:\x20.claude/settings.local.json','tdx','parse','continue','Starting\x20TD\x20LLM\x20proxy\x20server...','Invalid\x20minimum\x20version\x20format:\x20','match','command','user','tdx\x20--profile\x20','https://github.com/treasure-data/td-skills','tdx-skills','Failed\x20to\x20configure\x20marketplace\x20\x27','✓\x20Claude\x20Code\x20version\x20OK','llm-proxy','settings.local.json','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','already\x20exists','port','✓\x20Marketplace\x20\x27','✓\x20Found\x20available\x20port:\x20','hostname','\x27\x20installed','pipe','\x20→\x20','fail','ANTHROPIC_AUTH_TOKEN','8617fvNZuN','.claude','toString','\x20claude\x20statusline','localhost','unshift','llmProxy','2.0.20','td-skills','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','Claude\x20Code\x20version\x20','env','Warning:\x20Failed\x20to\x20configure\x20','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','Setting\x20up\x20project...','account_id','claude','stringify','green','code','CLAUDE_CODE_NOT_FOUND','Checking\x20Claude\x20Code\x20version...','127.0.0.1','debug','already\x20configured','attributes','stderr','llm','29144plblEj','ENOENT','originalSettings','getLogPath','td-skills\x20Plugins','plugin','1060YWfdRU','https://docs.treasuredata.com/mcp','close','error','908912sIxnSr','\x27\x20updated','27247896JvVqla','Configuring\x20MCP\x20server\x20\x27','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','model','Invalid\x20LLM\x20proxy\x20URL:\x20','INTERNAL'];a9_0x70d4=function(){return _0x535fc9;};return a9_0x70d4();}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_0x3ff27c(0x12d);function handleInstallationError(_0x30ccf1,_0x19f343,_0x2acd97,_0x361764){const _0x40a233=a9_0x3ff27c;errorContains(_0x30ccf1,_0x40a233(0x11c),_0x40a233(0xe9),_0x40a233(0x13e))?(_0x2acd97[_0x40a233(0xec)]='✓\x20'+_0x19f343+'\x20already\x20configured',_0x361764?.[_0x40a233(0xf8)](_0x19f343+'\x20already\x20configured'),_0x30ccf1 instanceof SDKError&&_0x30ccf1[_0x40a233(0xef)]&&_0x361764?.[_0x40a233(0x13d)](_0x40a233(0x105)+_0x30ccf1[_0x40a233(0xef)][_0x40a233(0xca)])):(_0x2acd97[_0x40a233(0xdc)](_0x40a233(0x132)+_0x19f343),_0x361764?.['error'](_0x19f343+'\x20configuration\x20failed',_0x30ccf1));}export function parseVersion(_0x2fb343){const _0x163a52=a9_0x3ff27c,_0x1486ed=_0x2fb343[_0x163a52(0xfe)]()[_0x163a52(0x111)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x1486ed)return null;return{'major':parseInt(_0x1486ed[0x1],0xa),'minor':parseInt(_0x1486ed[0x2],0xa),'patch':parseInt(_0x1486ed[0x3],0xa)};}export function compareVersions(_0xa42293,_0x5ca35b){const _0x4c5cdf=a9_0x3ff27c;if(_0xa42293[_0x4c5cdf(0xd4)]!==_0x5ca35b['major'])return _0xa42293[_0x4c5cdf(0xd4)]-_0x5ca35b['major'];if(_0xa42293[_0x4c5cdf(0xd5)]!==_0x5ca35b[_0x4c5cdf(0xd5)])return _0xa42293[_0x4c5cdf(0xd5)]-_0x5ca35b[_0x4c5cdf(0xd5)];return _0xa42293[_0x4c5cdf(0xf7)]-_0x5ca35b[_0x4c5cdf(0xf7)];}async function checkClaudeVersion(_0x149fc3,_0x3cda99){const _0x39606e=a9_0x3ff27c;_0x3cda99?.[_0x39606e(0x13d)](_0x39606e(0xc0)+_0x149fc3+')');const _0x3af63d=await executeClaudeCommand(['--version'],undefined,_0x3cda99),_0x18d21a=parseVersion(_0x3af63d);if(!_0x18d21a){_0x3cda99?.[_0x39606e(0xdc)](_0x39606e(0x12f)+_0x3af63d);return;}const _0x6ba461=_0x18d21a['major']+'.'+_0x18d21a['minor']+'.'+_0x18d21a[_0x39606e(0xf7)],_0x3f4c54=parseVersion(_0x149fc3);if(!_0x3f4c54){_0x3cda99?.[_0x39606e(0xdc)](_0x39606e(0x110)+_0x149fc3);return;}if(compareVersions(_0x18d21a,_0x3f4c54)<0x0){_0x3cda99?.[_0x39606e(0xac)](_0x39606e(0x130)+_0x6ba461+'\x20is\x20too\x20old\x20(minimum:\x20'+_0x149fc3+')');throw new SDKError(ErrorCode[_0x39606e(0x109)],_0x39606e(0x130)+_0x6ba461+_0x39606e(0xb1)+_0x149fc3+'\x20or\x20later.',undefined,{'helpText':_0x39606e(0xb9)});}_0x3cda99?.[_0x39606e(0x13d)](_0x39606e(0x130)+_0x6ba461+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x399150,_0x2e13a8,_0x2bd88f){const _0x22e9bd=a9_0x3ff27c;return _0x2bd88f?.[_0x22e9bd(0xf8)](_0x22e9bd(0xcd)+_0x399150['join']('\x20')),new Promise((_0x24c0fb,_0x3984c5)=>{const _0x9b72e2=_0x22e9bd,_0x44f260=crossSpawn(_0x9b72e2(0x136),_0x399150,{'stdio':_0x9b72e2(0x122)});let _0x46fb98='',_0x188df1='';_0x44f260[_0x9b72e2(0xdb)]?.['on'](_0x9b72e2(0xc2),_0x5900b4=>{const _0x956348=_0x9b72e2;_0x46fb98+=_0x5900b4[_0x956348(0x128)]();}),_0x44f260[_0x9b72e2(0x140)]?.['on'](_0x9b72e2(0xc2),_0x830fe4=>{const _0x344b48=_0x9b72e2;_0x188df1+=_0x830fe4[_0x344b48(0x128)]();}),_0x44f260['on'](_0x9b72e2(0xac),_0x4df71b=>{const _0x4a9ac8=_0x9b72e2;_0x4df71b[_0x4a9ac8(0x139)]===_0x4a9ac8(0x143)?(_0x2bd88f?.[_0x4a9ac8(0xac)](_0x4a9ac8(0xc6)),_0x3984c5(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x4a9ac8(0xc6),_0x4df71b,{'helpText':_0x4a9ac8(0x11b)}))):(_0x2bd88f?.[_0x4a9ac8(0xac)]('Command\x20spawn\x20error:\x20'+_0x4df71b[_0x4a9ac8(0xca)]),_0x3984c5(new SDKError(ErrorCode[_0x4a9ac8(0xb4)],_0x4a9ac8(0xfb)+_0x4df71b[_0x4a9ac8(0xca)],_0x4df71b)));}),_0x44f260['on'](_0x9b72e2(0xdd),_0x3975ed=>{const _0x1d2010=_0x9b72e2;if(_0x3975ed===0x0)_0x24c0fb(_0x46fb98);else _0x2e13a8?(_0x2bd88f?.[_0x1d2010(0xac)](_0x1d2010(0xf6)+_0x3975ed+'):\x20claude\x20'+_0x399150['join']('\x20')),_0x3984c5(new SDKError(ErrorCode[_0x1d2010(0xd3)],_0x2e13a8,new Error(_0x188df1)))):_0x24c0fb('');});});}async function ensureMcpServer(_0x49e4b1,_0x37b4c6,_0x183702,_0x243fab,_0x3e704e){const _0x38f02a=a9_0x3ff27c;_0x243fab['text']=_0x38f02a(0xb0)+_0x49e4b1+_0x38f02a(0xeb),await executeClaudeCommand([_0x38f02a(0xcc),_0x38f02a(0xf4),_0x49e4b1,_0x37b4c6,_0x38f02a(0xc8),_0x183702],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x49e4b1+'\x27',_0x3e704e),_0x243fab[_0x38f02a(0xec)]='✓\x20MCP\x20server\x20\x27'+_0x49e4b1+'\x27\x20configured';}async function ensureMarketplace(_0x5e6ca7,_0xe5dfe0,_0xbb4a36,_0x40d503){const _0x2a3c44=a9_0x3ff27c;_0xbb4a36['text']='Configuring\x20marketplace\x20\x27'+_0x5e6ca7+_0x2a3c44(0xeb),await executeClaudeCommand([_0x2a3c44(0x147),_0x2a3c44(0xf1),'add',_0xe5dfe0],_0x2a3c44(0x117)+_0x5e6ca7+'\x27',_0x40d503),_0xbb4a36[_0x2a3c44(0xec)]='✓\x20Marketplace\x20\x27'+_0x5e6ca7+_0x2a3c44(0xe7);}async function updateMarketplace(_0x2d28bd,_0x354f45,_0x3287ac){const _0x1accfa=a9_0x3ff27c;_0x354f45['text']=_0x1accfa(0xe4)+_0x2d28bd+_0x1accfa(0xeb),await executeClaudeCommand(['plugin',_0x1accfa(0xf1),'update'],'Failed\x20to\x20update\x20marketplace\x20\x27'+_0x2d28bd+'\x27',_0x3287ac),_0x354f45['text']=_0x1accfa(0x11e)+_0x2d28bd+_0x1accfa(0xae);}async function ensurePlugin(_0x11cbd4,_0x90b0f7,_0x1d0748,_0x3e8ba){const _0x51b3be=a9_0x3ff27c;_0x1d0748[_0x51b3be(0xec)]=_0x51b3be(0xee)+_0x11cbd4+_0x51b3be(0xeb),await executeClaudeCommand(['plugin',_0x51b3be(0xd0),_0x11cbd4+'@'+_0x90b0f7],_0x51b3be(0xce)+_0x11cbd4+'\x27',_0x3e8ba),_0x1d0748[_0x51b3be(0xec)]='✓\x20Plugin\x20\x27'+_0x11cbd4+_0x51b3be(0x121);}async function createClaudeSettings(_0x235435,_0x45d237,_0x7c14a0){const _0x238e69=a9_0x3ff27c,_0x38b65c=join(process[_0x238e69(0xe6)](),_0x238e69(0x127)),_0x58658e=join(_0x38b65c,_0x238e69(0x11a));await mkdir(_0x38b65c,{'recursive':!![]});let _0x2e0f55={};if(existsSync(_0x58658e))try{const _0x1b8baa=await readFile(_0x58658e,_0x238e69(0xe3));_0x2e0f55=JSON['parse'](_0x1b8baa);}catch{_0x2e0f55={};}const _0x1ce0d5=_0x2e0f55[_0x238e69(0x131)]||{},_0x1b5be4={'ANTHROPIC_BASE_URL':_0x1ce0d5[_0x238e69(0xf9)],'ANTHROPIC_MODEL':_0x1ce0d5[_0x238e69(0x106)],'ANTHROPIC_AUTH_TOKEN':_0x1ce0d5['ANTHROPIC_AUTH_TOKEN'],'CLAUDE_CODE_USE_BEDROCK':_0x1ce0d5[_0x238e69(0xbf)],'CLAUDE_CODE_USE_VERTEX':_0x1ce0d5[_0x238e69(0xb8)],'statusLine':_0x2e0f55[_0x238e69(0x100)]},_0x21ed09={..._0x2e0f55,'env':{..._0x1ce0d5,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x235435,..._0x45d237&&{'ANTHROPIC_MODEL':_0x45d237},'ANTHROPIC_AUTH_TOKEN':'tdx-managed-proxy','CLAUDE_CODE_USE_BEDROCK':_0x238e69(0xd2),'CLAUDE_CODE_USE_VERTEX':_0x238e69(0xd2)},'statusLine':{'type':_0x238e69(0x112),'command':_0x7c14a0?_0x238e69(0x114)+_0x7c14a0+_0x238e69(0x129):'tdx\x20claude\x20statusline'}};return await writeFile(_0x58658e,JSON[_0x238e69(0x137)](_0x21ed09,null,0x2)+'\x0a'),_0x1b5be4;}function a9_0x2987(_0x27a615,_0x15e1c3){_0x27a615=_0x27a615-0xaa;const _0x70d4c7=a9_0x70d4();let _0x29874f=_0x70d4c7[_0x27a615];return _0x29874f;}async function restoreClaudeSettings(_0x174fdd){const _0x2714e5=a9_0x3ff27c,_0xdb5f0c=join(process['cwd'](),'.claude'),_0x500390=join(_0xdb5f0c,_0x2714e5(0x11a));if(!existsSync(_0x500390))return;try{const _0x30d002=await readFile(_0x500390,_0x2714e5(0xe3)),_0x59ec8b=JSON[_0x2714e5(0x10d)](_0x30d002),_0x206c1c=_0x59ec8b[_0x2714e5(0x131)]||{},_0x2d57c3=_0x206c1c[_0x2714e5(0xf9)],_0x404e99=((()=>{const _0x29c144=_0x2714e5;if(typeof _0x2d57c3!==_0x29c144(0xb6))return![];try{const _0x34f363=new URL(_0x2d57c3);return _0x34f363[_0x29c144(0x120)]===_0x29c144(0x12a)||_0x34f363['hostname']===_0x29c144(0x13c);}catch{return![];}})());_0x404e99?(delete _0x206c1c[_0x2714e5(0xf9)],delete _0x206c1c[_0x2714e5(0x106)],delete _0x206c1c[_0x2714e5(0x125)],delete _0x206c1c[_0x2714e5(0xbf)],delete _0x206c1c[_0x2714e5(0xb8)]):(_0x174fdd[_0x2714e5(0xf9)]!==undefined?_0x206c1c[_0x2714e5(0xf9)]=_0x174fdd['ANTHROPIC_BASE_URL']:delete _0x206c1c[_0x2714e5(0xf9)],_0x174fdd[_0x2714e5(0x106)]!==undefined?_0x206c1c[_0x2714e5(0x106)]=_0x174fdd[_0x2714e5(0x106)]:delete _0x206c1c[_0x2714e5(0x106)],_0x174fdd['ANTHROPIC_AUTH_TOKEN']!==undefined?_0x206c1c[_0x2714e5(0x125)]=_0x174fdd[_0x2714e5(0x125)]:delete _0x206c1c['ANTHROPIC_AUTH_TOKEN'],_0x174fdd[_0x2714e5(0xbf)]!==undefined?_0x206c1c['CLAUDE_CODE_USE_BEDROCK']=_0x174fdd[_0x2714e5(0xbf)]:delete _0x206c1c[_0x2714e5(0xbf)],_0x174fdd[_0x2714e5(0xb8)]!==undefined?_0x206c1c['CLAUDE_CODE_USE_VERTEX']=_0x174fdd['CLAUDE_CODE_USE_VERTEX']:delete _0x206c1c['CLAUDE_CODE_USE_VERTEX']);const _0x338798=_0x59ec8b[_0x2714e5(0x100)],_0x159921=((()=>{const _0x4a4ea0=_0x2714e5;if(!_0x338798||typeof _0x338798!==_0x4a4ea0(0xfc))return![];if(_0x338798[_0x4a4ea0(0xfd)]!==_0x4a4ea0(0x112))return![];if(typeof _0x338798[_0x4a4ea0(0x112)]!==_0x4a4ea0(0xb6))return![];return _0x338798[_0x4a4ea0(0x112)][_0x4a4ea0(0xd7)](_0x4a4ea0(0x10c))&&_0x338798[_0x4a4ea0(0x112)][_0x4a4ea0(0xd7)]('statusline');})());if(_0x159921)delete _0x59ec8b[_0x2714e5(0x100)];else _0x174fdd[_0x2714e5(0x100)]!==undefined?_0x59ec8b[_0x2714e5(0x100)]=_0x174fdd[_0x2714e5(0x100)]:delete _0x59ec8b[_0x2714e5(0x100)];_0x59ec8b[_0x2714e5(0x131)]=_0x206c1c,await writeFile(_0x500390,JSON[_0x2714e5(0x137)](_0x59ec8b,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x3ff27c(0xda)]='claude';[a9_0x3ff27c(0xf5)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';['server'];['passThroughServer'];[a9_0x3ff27c(0x144)];[a9_0x3ff27c(0xe0)];[a9_0x3ff27c(0x11d)];async['execute'](_0x10cfa2){const _0x26148=a9_0x3ff27c,{tdx:_0x1f9076,options:_0x1d85b0,args:_0x515f68}=_0x10cfa2;try{const _0x362036=_0x1d85b0,_0x1e026a=_0x362036[_0x26148(0xf0)]===![],_0x23ec57=_0x362036[_0x26148(0x10e)]===!![],_0x5a00b2=_0x362036[_0x26148(0x107)]===!![],_0x548bcd=_0x362036[_0x26148(0x12c)],_0x44efaf=_0x548bcd!==undefined&&_0x548bcd!==![],_0x10d9b0=typeof _0x548bcd===_0x26148(0xb6)?_0x548bcd:undefined,_0x1169f6=_0x44efaf?undefined:_0x362036[_0x26148(0xb2)],_0x5f2a50=[..._0x515f68];if(_0x23ec57)_0x5f2a50[_0x26148(0x12b)]('-c');else _0x5a00b2&&_0x5f2a50['unshift']('-r');const _0x1411f1=createCommandSpinner(_0x26148(0xbc),{'verbose':_0x1d85b0[_0x26148(0xcf)]});_0x1411f1[_0x26148(0xd6)]();try{if(!_0x1e026a){_0x1411f1[_0x26148(0xec)]=_0x26148(0xc4),this['port']=await findAvailablePort(0xfa0),_0x1411f1[_0x26148(0xec)]=_0x26148(0x11f)+this[_0x26148(0x11d)];const _0x5c3fdb=_0x1d85b0['profile'];try{const _0x1b5682=await _0x1f9076[_0x26148(0x113)]['getCurrent']();_0x1b5682[_0x26148(0x135)]&&writeCachedAccountInfo(_0x1d85b0['site'],_0x1b5682[_0x26148(0x135)],_0x5c3fdb);}catch{}_0x1411f1[_0x26148(0xec)]=_0x26148(0xbd),this['logger']=new TDXLogger(_0x1d85b0[_0x26148(0xe1)],!![]),await this[_0x26148(0xe0)]['init']();const _0x4e6ecd=this[_0x26148(0xe0)][_0x26148(0x145)]();_0x1411f1[_0x26148(0xec)]='✓\x20Logging\x20to\x20'+_0x4e6ecd;if(_0x44efaf){if(_0x10d9b0&&!URL[_0x26148(0xd8)](_0x10d9b0))throw new SDKError(ErrorCode[_0x26148(0xdf)],_0x26148(0xb3)+_0x10d9b0);const _0x501e7c=_0x10d9b0||getEndpoint(_0x1d85b0[_0x26148(0xde)],_0x26148(0x119));_0x1411f1[_0x26148(0xec)]='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';if(!_0x1f9076['context'][_0x26148(0xcb)])throw new SDKError(ErrorCode[_0x26148(0xdf)],_0x26148(0x102));this[_0x26148(0x103)]=new PassThroughProxyServer({'port':this['port'],'llmProxyUrl':_0x501e7c,'apiKey':_0x1f9076[_0x26148(0xba)][_0x26148(0xcb)],'logger':this[_0x26148(0xe0)],'site':_0x1d85b0[_0x26148(0xde)],'profile':_0x5c3fdb}),await this[_0x26148(0x103)][_0x26148(0xd6)](),_0x1411f1[_0x26148(0xec)]=_0x26148(0xe8)+this[_0x26148(0x11d)]+_0x26148(0x123)+_0x501e7c;}else{_0x1411f1['text']=_0x26148(0x134);const _0x2f8615=await _0x1f9076[_0x26148(0x141)][_0x26148(0x101)](),_0x4a3bb1=_0x2f8615['id'];_0x1411f1[_0x26148(0xec)]=_0x26148(0xf2)+_0x2f8615[_0x26148(0x13f)][_0x26148(0xda)],_0x1411f1[_0x26148(0xec)]=_0x26148(0x10f),this['server']=new ProxyServer({'port':this[_0x26148(0x11d)],'projectId':_0x4a3bb1,'tdx':_0x1f9076,'logger':this[_0x26148(0xe0)],'site':_0x1d85b0[_0x26148(0xde)]}),await this[_0x26148(0xfa)][_0x26148(0xd6)](),_0x1411f1[_0x26148(0xec)]=_0x26148(0xff)+this[_0x26148(0x11d)];}_0x1411f1[_0x26148(0xec)]=_0x26148(0x108),this['originalSettings']=await createClaudeSettings(this['port'],_0x1169f6,_0x5c3fdb),_0x1411f1[_0x26148(0xec)]=_0x26148(0x10b);}else _0x1411f1['text']=_0x26148(0x10a);try{_0x1411f1[_0x26148(0xec)]=_0x26148(0x13b),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x26148(0xe0)]),_0x1411f1[_0x26148(0xec)]=_0x26148(0x118);}catch(_0x48324d){_0x1411f1[_0x26148(0x124)](_0x26148(0xe2));throw _0x48324d;}try{await ensureMcpServer(_0x26148(0xbe),_0x26148(0xaa),_0x26148(0xd9),_0x1411f1,this['logger']);}catch(_0x2f997e){handleInstallationError(_0x2f997e,'TD\x20Docs\x20MCP\x20Server',_0x1411f1,this[_0x26148(0xe0)]);}try{await ensureMarketplace(_0x26148(0x12e),_0x26148(0x115),_0x1411f1,this[_0x26148(0xe0)]),await updateMarketplace('td-skills',_0x1411f1,this[_0x26148(0xe0)]),await ensurePlugin(_0x26148(0xb5),_0x26148(0x12e),_0x1411f1,this['logger']),await ensurePlugin(_0x26148(0xc1),_0x26148(0x12e),_0x1411f1,this[_0x26148(0xe0)]),await ensurePlugin(_0x26148(0x116),'td-skills',_0x1411f1,this[_0x26148(0xe0)]);}catch(_0x436b6c){handleInstallationError(_0x436b6c,_0x26148(0x146),_0x1411f1,this[_0x26148(0xe0)]);}_0x1411f1[_0x26148(0xc5)]();}catch(_0x15101c){_0x1411f1[_0x26148(0x124)](_0x26148(0xc7));throw _0x15101c;}const _0xd01704=await findExecutable(_0x26148(0x136));if(!_0xd01704)throw new SDKError(ErrorCode[_0x26148(0x13a)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x26148(0x11b)});const _0xed4b94={...process[_0x26148(0x131)]};!_0x1e026a&&(_0xed4b94['ANTHROPIC_BASE_URL']=_0x26148(0xb7)+this[_0x26148(0x11d)],_0x1169f6&&(_0xed4b94[_0x26148(0x106)]=_0x1169f6),_0xed4b94['ANTHROPIC_AUTH_TOKEN']=_0x26148(0xbb),_0xed4b94[_0x26148(0xbf)]=_0x26148(0xd2),_0xed4b94['CLAUDE_CODE_USE_VERTEX']=_0x26148(0xd2));const _0x5b9120=crossSpawn(_0xd01704,_0x5f2a50,{'stdio':_0x26148(0xea),'env':_0xed4b94}),_0x3ba2bc=await new Promise(_0x569d86=>{const _0x37d21d=_0x26148;_0x5b9120['on'](_0x37d21d(0xdd),_0xd1c6f1=>{_0x569d86(_0xd1c6f1||0x0);}),_0x5b9120['on'](_0x37d21d(0xac),_0x371576=>{const _0x23430d=_0x37d21d;console[_0x23430d(0xac)](a9_0x6fe8dd['red'](_0x23430d(0xe5)+_0x371576[_0x23430d(0xca)])),_0x569d86(0x1);});});this[_0x26148(0xfa)]&&(await this[_0x26148(0xfa)][_0x26148(0xc5)](),console[_0x26148(0xc9)](a9_0x6fe8dd[_0x26148(0x138)]('✓\x20TD\x20LLM\x20proxy\x20server\x20stopped')));this[_0x26148(0x103)]&&(await this[_0x26148(0x103)][_0x26148(0xc5)](),console[_0x26148(0xc9)](a9_0x6fe8dd[_0x26148(0x138)](_0x26148(0x133))));if(this[_0x26148(0xe0)]){await this[_0x26148(0xe0)]['close']();const _0x882da2=this[_0x26148(0xe0)]['getLogPath']();console[_0x26148(0xc9)](a9_0x6fe8dd[_0x26148(0x138)]('✓\x20Logs\x20saved\x20to\x20'+_0x882da2));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x26148(0x144)]),console['log'](a9_0x6fe8dd[_0x26148(0x138)](_0x26148(0xf3)))),_0x3ba2bc;}catch(_0x43f388){this[_0x26148(0xfa)]&&await this[_0x26148(0xfa)]['stop']();this[_0x26148(0x103)]&&await this['passThroughServer'][_0x26148(0xc5)]();this[_0x26148(0xe0)]&&await this[_0x26148(0xe0)][_0x26148(0xab)]();this[_0x26148(0x144)]&&await restoreClaudeSettings(this[_0x26148(0x144)]);throw _0x43f388;}}}
1
+ const a9_0x40c8ce=a9_0x1dfe;(function(_0x2c5efa,_0xd572e3){const _0x87163=a9_0x1dfe,_0x305173=_0x2c5efa();while(!![]){try{const _0x4a0fc8=parseInt(_0x87163(0x1d7))/0x1*(parseInt(_0x87163(0x1fd))/0x2)+parseInt(_0x87163(0x20c))/0x3+-parseInt(_0x87163(0x1a8))/0x4+parseInt(_0x87163(0x208))/0x5*(parseInt(_0x87163(0x228))/0x6)+parseInt(_0x87163(0x22e))/0x7+parseInt(_0x87163(0x1e6))/0x8+parseInt(_0x87163(0x1e3))/0x9*(-parseInt(_0x87163(0x1a0))/0xa);if(_0x4a0fc8===_0xd572e3)break;else _0x305173['push'](_0x305173['shift']());}catch(_0x49b793){_0x305173['push'](_0x305173['shift']());}}}(a9_0x57dc,0x9c5c1));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';function a9_0x1dfe(_0x8da601,_0x5717e2){_0x8da601=_0x8da601-0x19e;const _0x57dcac=a9_0x57dc();let _0x1dfe92=_0x57dcac[_0x8da601];return _0x1dfe92;}import{join}from'node:path';import a9_0x3d4d7f from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findAvailablePort}from'../utils/port.js';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='2.0.20';function handleInstallationError(_0x235721,_0x494eed,_0x1c0930,_0x3dd001){const _0x38accd=a9_0x1dfe;errorContains(_0x235721,_0x38accd(0x1c2),_0x38accd(0x21b),_0x38accd(0x218))?(_0x1c0930['text']='✓\x20'+_0x494eed+_0x38accd(0x20a),_0x3dd001?.['info'](_0x494eed+_0x38accd(0x20a)),_0x235721 instanceof SDKError&&_0x235721['cause']&&_0x3dd001?.[_0x38accd(0x1e2)](_0x38accd(0x219)+_0x235721[_0x38accd(0x1fa)]['message'])):(_0x1c0930[_0x38accd(0x1df)](_0x38accd(0x1ba)+_0x494eed),_0x3dd001?.[_0x38accd(0x1c1)](_0x494eed+_0x38accd(0x1cb),_0x235721));}export function parseVersion(_0x4d6601){const _0x525c53=a9_0x1dfe,_0x2b2efd=_0x4d6601[_0x525c53(0x1d8)]()[_0x525c53(0x217)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x2b2efd)return null;return{'major':parseInt(_0x2b2efd[0x1],0xa),'minor':parseInt(_0x2b2efd[0x2],0xa),'patch':parseInt(_0x2b2efd[0x3],0xa)};}export function compareVersions(_0x8ac4f5,_0x3b5c5c){const _0x3051fa=a9_0x1dfe;if(_0x8ac4f5[_0x3051fa(0x1f5)]!==_0x3b5c5c['major'])return _0x8ac4f5[_0x3051fa(0x1f5)]-_0x3b5c5c[_0x3051fa(0x1f5)];if(_0x8ac4f5[_0x3051fa(0x203)]!==_0x3b5c5c['minor'])return _0x8ac4f5[_0x3051fa(0x203)]-_0x3b5c5c['minor'];return _0x8ac4f5[_0x3051fa(0x1d6)]-_0x3b5c5c['patch'];}async function checkClaudeVersion(_0x1627de,_0x3738c5){const _0x2b71ee=a9_0x1dfe;_0x3738c5?.[_0x2b71ee(0x1e2)]('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x1627de+')');const _0x4da787=await executeClaudeCommand([_0x2b71ee(0x1c5)],undefined,_0x3738c5),_0x564299=parseVersion(_0x4da787);if(!_0x564299){_0x3738c5?.[_0x2b71ee(0x1df)](_0x2b71ee(0x1bb)+_0x4da787);return;}const _0x3cddf4=_0x564299['major']+'.'+_0x564299[_0x2b71ee(0x203)]+'.'+_0x564299['patch'],_0x16086b=parseVersion(_0x1627de);if(!_0x16086b){_0x3738c5?.[_0x2b71ee(0x1df)](_0x2b71ee(0x1d5)+_0x1627de);return;}if(compareVersions(_0x564299,_0x16086b)<0x0){_0x3738c5?.['error'](_0x2b71ee(0x22c)+_0x3cddf4+_0x2b71ee(0x1b2)+_0x1627de+')');throw new SDKError(ErrorCode[_0x2b71ee(0x1e4)],'Claude\x20Code\x20version\x20'+_0x3cddf4+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x1627de+_0x2b71ee(0x1b0),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x3738c5?.[_0x2b71ee(0x1e2)]('Claude\x20Code\x20version\x20'+_0x3cddf4+_0x2b71ee(0x220));}async function executeClaudeCommand(_0x1597a5,_0xe94299,_0x197ce3){const _0xe3d3a=a9_0x1dfe;return _0x197ce3?.['info'](_0xe3d3a(0x1a7)+_0x1597a5[_0xe3d3a(0x22a)]('\x20')),new Promise((_0x5b5280,_0x324e89)=>{const _0x20a960=_0xe3d3a,_0x54c7a2=crossSpawn('claude',_0x1597a5,{'stdio':'pipe'});let _0x4ba9d7='',_0x5159dc='';_0x54c7a2['stdout']?.['on'](_0x20a960(0x1af),_0x40a102=>{const _0x5282e7=_0x20a960;_0x4ba9d7+=_0x40a102[_0x5282e7(0x1ee)]();}),_0x54c7a2[_0x20a960(0x1aa)]?.['on']('data',_0x3d0bea=>{const _0x53ae93=_0x20a960;_0x5159dc+=_0x3d0bea[_0x53ae93(0x1ee)]();}),_0x54c7a2['on'](_0x20a960(0x1c1),_0x1f147c=>{const _0x4c70e7=_0x20a960;_0x1f147c['code']===_0x4c70e7(0x1a2)?(_0x197ce3?.[_0x4c70e7(0x1c1)](_0x4c70e7(0x235)),_0x324e89(new SDKError(ErrorCode[_0x4c70e7(0x215)],'Claude\x20Code\x20CLI\x20not\x20found',_0x1f147c,{'helpText':_0x4c70e7(0x1e9)}))):(_0x197ce3?.[_0x4c70e7(0x1c1)](_0x4c70e7(0x19f)+_0x1f147c[_0x4c70e7(0x211)]),_0x324e89(new SDKError(ErrorCode['INTERNAL'],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x1f147c[_0x4c70e7(0x211)],_0x1f147c)));}),_0x54c7a2['on'](_0x20a960(0x1b3),_0x4a8a2f=>{const _0x365aad=_0x20a960;if(_0x4a8a2f===0x0)_0x5b5280(_0x4ba9d7);else _0xe94299?(_0x197ce3?.[_0x365aad(0x1c1)](_0x365aad(0x1fc)+_0x4a8a2f+_0x365aad(0x230)+_0x1597a5[_0x365aad(0x22a)]('\x20')),_0x324e89(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0xe94299,new Error(_0x5159dc)))):_0x5b5280('');});});}async function ensureMcpServer(_0x1f6e13,_0x161116,_0x3d5f26,_0x5a5515,_0x1f8e59){const _0x27dc2e=a9_0x1dfe;_0x5a5515['text']='Configuring\x20MCP\x20server\x20\x27'+_0x1f6e13+_0x27dc2e(0x1a4),await executeClaudeCommand(['mcp',_0x27dc2e(0x1e5),_0x1f6e13,_0x161116,_0x27dc2e(0x1bc),_0x3d5f26],_0x27dc2e(0x1ea)+_0x1f6e13+'\x27',_0x1f8e59),_0x5a5515[_0x27dc2e(0x1f8)]=_0x27dc2e(0x1cc)+_0x1f6e13+_0x27dc2e(0x1b4);}async function ensureMarketplace(_0x5e4b30,_0x258774,_0x443c05,_0x2c540c){const _0x3160d9=a9_0x1dfe;_0x443c05['text']=_0x3160d9(0x1b8)+_0x5e4b30+_0x3160d9(0x1a4),await executeClaudeCommand([_0x3160d9(0x207),_0x3160d9(0x1bd),_0x3160d9(0x1e5),_0x258774],_0x3160d9(0x1ab)+_0x5e4b30+'\x27',_0x2c540c),_0x443c05[_0x3160d9(0x1f8)]=_0x3160d9(0x1c3)+_0x5e4b30+_0x3160d9(0x1b4);}async function updateMarketplace(_0x687053,_0x160b9b,_0x742e57){const _0x4799ae=a9_0x1dfe;_0x160b9b[_0x4799ae(0x1f8)]='Updating\x20marketplace\x20\x27'+_0x687053+'\x27...',await executeClaudeCommand([_0x4799ae(0x207),_0x4799ae(0x1bd),_0x4799ae(0x236)],'Failed\x20to\x20update\x20marketplace\x20\x27'+_0x687053+'\x27',_0x742e57),_0x160b9b[_0x4799ae(0x1f8)]=_0x4799ae(0x1c3)+_0x687053+_0x4799ae(0x1cf);}async function ensurePlugin(_0x48818b,_0x352f2e,_0x5c5ec5,_0x4a1919){const _0x27f686=a9_0x1dfe;_0x5c5ec5[_0x27f686(0x1f8)]='Installing\x20plugin\x20\x27'+_0x48818b+'\x27...',await executeClaudeCommand([_0x27f686(0x207),'install',_0x48818b+'@'+_0x352f2e],_0x27f686(0x1dc)+_0x48818b+'\x27',_0x4a1919),_0x5c5ec5['text']=_0x27f686(0x1f4)+_0x48818b+'\x27\x20installed';}async function createClaudeSettings(_0x100950,_0x44defa,_0x584fb3){const _0x3e70d6=a9_0x1dfe,_0x552282=join(process[_0x3e70d6(0x1e7)](),_0x3e70d6(0x1ac)),_0x41ba47=join(_0x552282,'settings.local.json');await mkdir(_0x552282,{'recursive':!![]});let _0x434f84={};if(existsSync(_0x41ba47))try{const _0x3f760e=await readFile(_0x41ba47,'utf-8');_0x434f84=JSON[_0x3e70d6(0x1e1)](_0x3f760e);}catch{_0x434f84={};}const _0x439cce=_0x434f84[_0x3e70d6(0x1d2)]||{},_0x3d0f6a={'ANTHROPIC_BASE_URL':_0x439cce[_0x3e70d6(0x226)],'ANTHROPIC_MODEL':_0x439cce['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x439cce['ANTHROPIC_AUTH_TOKEN'],'CLAUDE_CODE_USE_BEDROCK':_0x439cce[_0x3e70d6(0x1f7)],'CLAUDE_CODE_USE_VERTEX':_0x439cce[_0x3e70d6(0x1fe)],'statusLine':_0x434f84[_0x3e70d6(0x1ef)]},_0x1a53b1={..._0x434f84,'env':{..._0x439cce,'ANTHROPIC_BASE_URL':_0x3e70d6(0x234)+_0x100950,..._0x44defa&&{'ANTHROPIC_MODEL':_0x44defa},'ANTHROPIC_AUTH_TOKEN':_0x3e70d6(0x1f0),'CLAUDE_CODE_USE_BEDROCK':_0x3e70d6(0x21d),'CLAUDE_CODE_USE_VERTEX':_0x3e70d6(0x21d)},'statusLine':{'type':_0x3e70d6(0x1d4),'command':_0x584fb3?_0x3e70d6(0x232)+_0x584fb3+_0x3e70d6(0x1b7):_0x3e70d6(0x21a)}};return await writeFile(_0x41ba47,JSON[_0x3e70d6(0x1de)](_0x1a53b1,null,0x2)+'\x0a'),_0x3d0f6a;}function a9_0x57dc(){const _0x569d3c=['✓\x20Found\x20available\x20port:\x20','join','ANTHROPIC_AUTH_TOKEN','Claude\x20Code\x20version\x20','Invalid\x20LLM\x20proxy\x20URL:\x20','4870929tDRJFA','start','):\x20claude\x20','model','tdx\x20--profile\x20','user','http://127.0.0.1:','Claude\x20Code\x20CLI\x20not\x20found','update','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','Command\x20spawn\x20error:\x20','4860OgjrjM','continue','ENOENT','port','\x27...','logLevel','logger','Executing:\x20claude\x20','1211236TveloU','fail','stderr','Failed\x20to\x20configure\x20marketplace\x20\x27','.claude','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','data','\x20or\x20later.','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','\x20is\x20too\x20old\x20(minimum:\x20','exit','\x27\x20configured','green','object','\x20claude\x20statusline','Configuring\x20marketplace\x20\x27','td-skills','Warning:\x20Failed\x20to\x20configure\x20','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','--transport','marketplace','site','ANTHROPIC_MODEL','execute','error','already\x20exists','✓\x20Marketplace\x20\x27','originalSettings','--version','server','localhost','workflow-skills','stop','tdx-skills','\x20configuration\x20failed','✓\x20MCP\x20server\x20\x27','✓\x20Using\x20project:\x20','tdx','\x27\x20updated','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','getOrCreateDefaultProject','env','127.0.0.1','command','Invalid\x20minimum\x20version\x20format:\x20','patch','8779COhYWt','trim','profile','attributes','Initializing\x20proxy\x20logger...','Failed\x20to\x20install\x20plugin\x20\x27','red','stringify','warn','✓\x20Settings\x20configured:\x20.claude/settings.local.json','parse','debug','48474wgpzNu','CLAUDE_CODE_UNSUPPORTED_VERSION','add','4879752bZjqee','cwd','account_id','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','✓\x20Claude\x20Code\x20version\x20OK','✓\x20Logging\x20to\x20','unshift','toString','statusLine','tdx-managed-proxy','context','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','https://github.com/treasure-data/td-skills','✓\x20Plugin\x20\x27','major','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','CLAUDE_CODE_USE_BEDROCK','text','init','cause','TD\x20Docs\x20MCP\x20Server','Command\x20failed\x20(exit\x20','216eVZXPy','CLAUDE_CODE_USE_VERTEX','description','name','getLogPath','passThroughServer','minor','string','Claude\x20Code\x20version\x20check\x20failed','hostname','plugin','1560aZEXCc','getCurrent','\x20already\x20configured','settings.local.json','1339230pbmLzX','Checking\x20Claude\x20Code\x20version...','close','llmProxy','✓\x20Logs\x20saved\x20to\x20','message','apiKey','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','llm','CLAUDE_CODE_NOT_FOUND','\x20→\x20','match','already\x20configured','Command\x20output:\x20','tdx\x20claude\x20statusline','already\x20installed','statusline','false','includes','log','\x20meets\x20minimum\x20requirement','https://docs.treasuredata.com/mcp','INVALID_ARGUMENT','Failed\x20to\x20launch\x20Claude\x20Code:\x20','inherit','sql-skills','ANTHROPIC_BASE_URL','claude','16548SImBDW'];a9_0x57dc=function(){return _0x569d3c;};return a9_0x57dc();}async function restoreClaudeSettings(_0x49a7e7){const _0x41e8f7=a9_0x1dfe,_0x3b7cc9=join(process[_0x41e8f7(0x1e7)](),_0x41e8f7(0x1ac)),_0x39d65b=join(_0x3b7cc9,_0x41e8f7(0x20b));if(!existsSync(_0x39d65b))return;try{const _0x45b38e=await readFile(_0x39d65b,'utf-8'),_0x4c3408=JSON[_0x41e8f7(0x1e1)](_0x45b38e),_0x514a10=_0x4c3408[_0x41e8f7(0x1d2)]||{},_0x45bb1c=_0x514a10[_0x41e8f7(0x226)],_0x65ea06=((()=>{const _0x28bc12=_0x41e8f7;if(typeof _0x45bb1c!==_0x28bc12(0x204))return![];try{const _0x50b178=new URL(_0x45bb1c);return _0x50b178['hostname']===_0x28bc12(0x1c7)||_0x50b178[_0x28bc12(0x206)]===_0x28bc12(0x1d3);}catch{return![];}})());_0x65ea06?(delete _0x514a10[_0x41e8f7(0x226)],delete _0x514a10[_0x41e8f7(0x1bf)],delete _0x514a10[_0x41e8f7(0x22b)],delete _0x514a10['CLAUDE_CODE_USE_BEDROCK'],delete _0x514a10[_0x41e8f7(0x1fe)]):(_0x49a7e7['ANTHROPIC_BASE_URL']!==undefined?_0x514a10[_0x41e8f7(0x226)]=_0x49a7e7[_0x41e8f7(0x226)]:delete _0x514a10[_0x41e8f7(0x226)],_0x49a7e7[_0x41e8f7(0x1bf)]!==undefined?_0x514a10['ANTHROPIC_MODEL']=_0x49a7e7[_0x41e8f7(0x1bf)]:delete _0x514a10['ANTHROPIC_MODEL'],_0x49a7e7[_0x41e8f7(0x22b)]!==undefined?_0x514a10['ANTHROPIC_AUTH_TOKEN']=_0x49a7e7[_0x41e8f7(0x22b)]:delete _0x514a10['ANTHROPIC_AUTH_TOKEN'],_0x49a7e7[_0x41e8f7(0x1f7)]!==undefined?_0x514a10[_0x41e8f7(0x1f7)]=_0x49a7e7['CLAUDE_CODE_USE_BEDROCK']:delete _0x514a10['CLAUDE_CODE_USE_BEDROCK'],_0x49a7e7[_0x41e8f7(0x1fe)]!==undefined?_0x514a10['CLAUDE_CODE_USE_VERTEX']=_0x49a7e7[_0x41e8f7(0x1fe)]:delete _0x514a10[_0x41e8f7(0x1fe)]);const _0xb74b1d=_0x4c3408[_0x41e8f7(0x1ef)],_0x5bf0ff=((()=>{const _0x480ceb=_0x41e8f7;if(!_0xb74b1d||typeof _0xb74b1d!==_0x480ceb(0x1b6))return![];if(_0xb74b1d['type']!==_0x480ceb(0x1d4))return![];if(typeof _0xb74b1d[_0x480ceb(0x1d4)]!==_0x480ceb(0x204))return![];return _0xb74b1d[_0x480ceb(0x1d4)]['includes'](_0x480ceb(0x1ce))&&_0xb74b1d[_0x480ceb(0x1d4)][_0x480ceb(0x21e)](_0x480ceb(0x21c));})());if(_0x5bf0ff)delete _0x4c3408[_0x41e8f7(0x1ef)];else _0x49a7e7[_0x41e8f7(0x1ef)]!==undefined?_0x4c3408['statusLine']=_0x49a7e7[_0x41e8f7(0x1ef)]:delete _0x4c3408[_0x41e8f7(0x1ef)];_0x4c3408[_0x41e8f7(0x1d2)]=_0x514a10,await writeFile(_0x39d65b,JSON[_0x41e8f7(0x1de)](_0x4c3408,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x40c8ce(0x200)]=a9_0x40c8ce(0x227);[a9_0x40c8ce(0x1ff)]=a9_0x40c8ce(0x1f2);[a9_0x40c8ce(0x1c6)];[a9_0x40c8ce(0x202)];[a9_0x40c8ce(0x1c4)];[a9_0x40c8ce(0x1a6)];[a9_0x40c8ce(0x1a3)];async[a9_0x40c8ce(0x1c0)](_0x32010c){const _0x463d83=a9_0x40c8ce,{tdx:_0xe8d4b2,options:_0x738ce4,args:_0x4cdd22}=_0x32010c;try{const _0x531018=_0x738ce4,_0x376f3c=_0x531018['proxy']===![],_0x175218=_0x531018[_0x463d83(0x1a1)]===!![],_0xc0d9a4=_0x531018['resume']===!![],_0x4c79e8=_0x531018[_0x463d83(0x20f)],_0x2f832e=_0x4c79e8!==undefined&&_0x4c79e8!==![],_0x1daf83=typeof _0x4c79e8===_0x463d83(0x204)?_0x4c79e8:undefined,_0x1ba698=_0x2f832e?undefined:_0x531018[_0x463d83(0x231)],_0x517dce=[..._0x4cdd22];if(_0x175218)_0x517dce[_0x463d83(0x1ed)]('-c');else _0xc0d9a4&&_0x517dce[_0x463d83(0x1ed)]('-r');const _0x2766a0=createCommandSpinner('Initializing...',{'verbose':_0x738ce4['verbose']});_0x2766a0[_0x463d83(0x22f)]();try{if(!_0x376f3c){_0x2766a0['text']='Finding\x20available\x20port...',this[_0x463d83(0x1a3)]=await findAvailablePort(0xfa0),_0x2766a0[_0x463d83(0x1f8)]=_0x463d83(0x229)+this[_0x463d83(0x1a3)];const _0x33876f=_0x738ce4[_0x463d83(0x1d9)];try{const _0x2e351c=await _0xe8d4b2[_0x463d83(0x233)][_0x463d83(0x209)]();_0x2e351c[_0x463d83(0x1e8)]&&writeCachedAccountInfo(_0x738ce4[_0x463d83(0x1be)],_0x2e351c[_0x463d83(0x1e8)],_0x33876f);}catch{}_0x2766a0[_0x463d83(0x1f8)]=_0x463d83(0x1db),this[_0x463d83(0x1a6)]=new TDXLogger(_0x738ce4[_0x463d83(0x1a5)],!![]),await this[_0x463d83(0x1a6)][_0x463d83(0x1f9)]();const _0x27b8c8=this[_0x463d83(0x1a6)][_0x463d83(0x201)]();_0x2766a0['text']=_0x463d83(0x1ec)+_0x27b8c8;if(_0x2f832e){if(_0x1daf83&&!URL['canParse'](_0x1daf83))throw new SDKError(ErrorCode[_0x463d83(0x222)],_0x463d83(0x22d)+_0x1daf83);const _0x5f1eaf=_0x1daf83||getEndpoint(_0x738ce4['site'],'llm-proxy');_0x2766a0[_0x463d83(0x1f8)]=_0x463d83(0x1ae);if(!_0xe8d4b2[_0x463d83(0x1f1)][_0x463d83(0x212)])throw new SDKError(ErrorCode[_0x463d83(0x222)],_0x463d83(0x1d0));this[_0x463d83(0x202)]=new PassThroughProxyServer({'port':this[_0x463d83(0x1a3)],'llmProxyUrl':_0x5f1eaf,'apiKey':_0xe8d4b2[_0x463d83(0x1f1)][_0x463d83(0x212)],'logger':this[_0x463d83(0x1a6)],'site':_0x738ce4['site'],'profile':_0x33876f}),await this[_0x463d83(0x202)][_0x463d83(0x22f)](),_0x2766a0['text']=_0x463d83(0x1b1)+this['port']+_0x463d83(0x216)+_0x5f1eaf;}else{_0x2766a0['text']='Setting\x20up\x20project...';const _0xed50=await _0xe8d4b2[_0x463d83(0x214)][_0x463d83(0x1d1)](),_0x29b6c2=_0xed50['id'];_0x2766a0[_0x463d83(0x1f8)]=_0x463d83(0x1cd)+_0xed50[_0x463d83(0x1da)][_0x463d83(0x200)],_0x2766a0[_0x463d83(0x1f8)]='Starting\x20TD\x20LLM\x20proxy\x20server...',this[_0x463d83(0x1c6)]=new ProxyServer({'port':this['port'],'projectId':_0x29b6c2,'tdx':_0xe8d4b2,'logger':this[_0x463d83(0x1a6)],'site':_0x738ce4[_0x463d83(0x1be)]}),await this['server'][_0x463d83(0x22f)](),_0x2766a0[_0x463d83(0x1f8)]=_0x463d83(0x1ad)+this[_0x463d83(0x1a3)];}_0x2766a0[_0x463d83(0x1f8)]='Creating\x20.claude/settings.local.json...',this[_0x463d83(0x1c4)]=await createClaudeSettings(this[_0x463d83(0x1a3)],_0x1ba698,_0x33876f),_0x2766a0[_0x463d83(0x1f8)]=_0x463d83(0x1e0);}else _0x2766a0['text']=_0x463d83(0x1f6);try{_0x2766a0[_0x463d83(0x1f8)]=_0x463d83(0x20d),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x463d83(0x1a6)]),_0x2766a0[_0x463d83(0x1f8)]=_0x463d83(0x1eb);}catch(_0x23e3f9){_0x2766a0[_0x463d83(0x1a9)](_0x463d83(0x205));throw _0x23e3f9;}try{await ensureMcpServer('td-docs',_0x463d83(0x221),'http',_0x2766a0,this[_0x463d83(0x1a6)]);}catch(_0x510d1a){handleInstallationError(_0x510d1a,_0x463d83(0x1fb),_0x2766a0,this[_0x463d83(0x1a6)]);}try{await ensureMarketplace('td-skills',_0x463d83(0x1f3),_0x2766a0,this[_0x463d83(0x1a6)]),await updateMarketplace('td-skills',_0x2766a0,this['logger']),await ensurePlugin(_0x463d83(0x225),_0x463d83(0x1b9),_0x2766a0,this['logger']),await ensurePlugin(_0x463d83(0x1c8),'td-skills',_0x2766a0,this['logger']),await ensurePlugin(_0x463d83(0x1ca),_0x463d83(0x1b9),_0x2766a0,this['logger']);}catch(_0x41089f){handleInstallationError(_0x41089f,'td-skills\x20Plugins',_0x2766a0,this[_0x463d83(0x1a6)]);}_0x2766a0[_0x463d83(0x1c9)]();}catch(_0x32f571){_0x2766a0[_0x463d83(0x1a9)]('Setup\x20failed');throw _0x32f571;}const _0x31e00e=await findExecutable(_0x463d83(0x227));if(!_0x31e00e)throw new SDKError(ErrorCode[_0x463d83(0x215)],_0x463d83(0x235),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x2140e2={...process[_0x463d83(0x1d2)]};!_0x376f3c&&(_0x2140e2['ANTHROPIC_BASE_URL']=_0x463d83(0x234)+this[_0x463d83(0x1a3)],_0x1ba698&&(_0x2140e2[_0x463d83(0x1bf)]=_0x1ba698),_0x2140e2[_0x463d83(0x22b)]='tdx-managed-proxy',_0x2140e2['CLAUDE_CODE_USE_BEDROCK']=_0x463d83(0x21d),_0x2140e2[_0x463d83(0x1fe)]=_0x463d83(0x21d));const _0x18a21c=crossSpawn(_0x31e00e,_0x517dce,{'stdio':_0x463d83(0x224),'env':_0x2140e2}),_0x36c4d5=await new Promise(_0x1bcebd=>{const _0x22fcc2=_0x463d83;_0x18a21c['on'](_0x22fcc2(0x1b3),_0x228017=>{_0x1bcebd(_0x228017||0x0);}),_0x18a21c['on'](_0x22fcc2(0x1c1),_0x25b5aa=>{const _0x289b6c=_0x22fcc2;console[_0x289b6c(0x1c1)](a9_0x3d4d7f[_0x289b6c(0x1dd)](_0x289b6c(0x223)+_0x25b5aa[_0x289b6c(0x211)])),_0x1bcebd(0x1);});});this['server']&&(await this[_0x463d83(0x1c6)][_0x463d83(0x1c9)](),console[_0x463d83(0x21f)](a9_0x3d4d7f['green'](_0x463d83(0x213))));this[_0x463d83(0x202)]&&(await this[_0x463d83(0x202)][_0x463d83(0x1c9)](),console[_0x463d83(0x21f)](a9_0x3d4d7f[_0x463d83(0x1b5)](_0x463d83(0x19e))));if(this[_0x463d83(0x1a6)]){await this[_0x463d83(0x1a6)]['close']();const _0x58076f=this['logger']['getLogPath']();console[_0x463d83(0x21f)](a9_0x3d4d7f[_0x463d83(0x1b5)](_0x463d83(0x210)+_0x58076f));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x463d83(0x1c4)]),console[_0x463d83(0x21f)](a9_0x3d4d7f['green']('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x36c4d5;}catch(_0x27526e){this[_0x463d83(0x1c6)]&&await this[_0x463d83(0x1c6)]['stop']();this[_0x463d83(0x202)]&&await this[_0x463d83(0x202)][_0x463d83(0x1c9)]();this[_0x463d83(0x1a6)]&&await this['logger'][_0x463d83(0x20e)]();this[_0x463d83(0x1c4)]&&await restoreClaudeSettings(this[_0x463d83(0x1c4)]);throw _0x27526e;}}}
@@ -1 +1 @@
1
- const a10_0xf73482=a10_0x4765;function a10_0x4765(_0x1a3653,_0x211a92){_0x1a3653=_0x1a3653-0x189;const _0x224afa=a10_0x224a();let _0x476528=_0x224afa[_0x1a3653];return _0x476528;}(function(_0x3f5873,_0x213b17){const _0xbd0c24=a10_0x4765,_0x287011=_0x3f5873();while(!![]){try{const _0x1816db=parseInt(_0xbd0c24(0x1a5))/0x1*(parseInt(_0xbd0c24(0x199))/0x2)+parseInt(_0xbd0c24(0x190))/0x3*(-parseInt(_0xbd0c24(0x19e))/0x4)+-parseInt(_0xbd0c24(0x19a))/0x5*(-parseInt(_0xbd0c24(0x191))/0x6)+-parseInt(_0xbd0c24(0x1ad))/0x7+parseInt(_0xbd0c24(0x1a1))/0x8+-parseInt(_0xbd0c24(0x19f))/0x9+-parseInt(_0xbd0c24(0x1a4))/0xa;if(_0x1816db===_0x213b17)break;else _0x287011['push'](_0x287011['shift']());}catch(_0x44ab92){_0x287011['push'](_0x287011['shift']());}}}(a10_0x224a,0x8e986));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x3902f2=0x64){return new Promise(_0x3a91e0=>{const _0x56d8a1=a10_0x4765;let _0x1b2fe8='',_0x3420af=![];const _0x474c51=createInterface({'input':process['stdin'],'terminal':![]}),_0x598509=_0x2f8ccc=>{const _0x87539e=a10_0x4765;if(_0x3420af)return;_0x3420af=!![],clearTimeout(_0x5696f4),_0x474c51[_0x87539e(0x1ae)](),_0x3a91e0(_0x2f8ccc);},_0x5696f4=setTimeout(()=>{_0x598509(null);},_0x3902f2);_0x474c51['on'](_0x56d8a1(0x196),_0xf130d1=>{_0x1b2fe8+=_0xf130d1;}),_0x474c51['on']('close',()=>{if(_0x3420af)return;try{const _0x403294=JSON['parse'](_0x1b2fe8);_0x598509(_0x403294);}catch{_0x598509(null);}});});}function formatCredits(_0x11f039){const _0x4c6a57=a10_0x4765;return _0x11f039[_0x4c6a57(0x18b)](0x2);}function a10_0x224a(){const _0x261dff=['push','join','\x20|\x20','session_id','statusline','1774878rQYztt','close','monthCredits','🪙\x20credit:\x20','model','toFixed','log','\x20-\x20','todayCredits','accountId','657zXYmDw','35136eDPjAb','🧠\x20','name','site','tdx\x20','line','description','Claude','626762VYSJro','970XKxxxe','\x20today\x20/\x20','profile','\x20session\x20/\x20','10328BZjnkv','6502815VUBFPp','latestInputTokens','8751568rUbgtj','sessionCredits','execute','7311550vhywHV','2hmntBr','tdx','💎\x20tdx\x20-\x20Claude'];a10_0x224a=function(){return _0x261dff;};return a10_0x224a();}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0xf73482(0x193)]=a10_0xf73482(0x1ac);[a10_0xf73482(0x197)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async[a10_0xf73482(0x1a3)](_0x52c126){const _0x2f6ca4=a10_0xf73482;try{const _0x1a8503=await readStdinJson();if(!_0x1a8503?.[_0x2f6ca4(0x1ab)])return console[_0x2f6ca4(0x18c)](_0x2f6ca4(0x1a7)),0x0;const _0x207828=_0x1a8503[_0x2f6ca4(0x1ab)],_0x4a12d0=_0x1a8503[_0x2f6ca4(0x18a)]?.['id']||'',_0x294f26=_0x1a8503[_0x2f6ca4(0x19c)]||_0x52c126['options'][_0x2f6ca4(0x19c)],_0x1d944a=await getUsageStats(_0x207828,_0x294f26),_0x1e4715=[],_0x45742b=readCachedAccountInfo(_0x294f26),_0x34b4d8=_0x45742b?_0x2f6ca4(0x195)+_0x45742b[_0x2f6ca4(0x194)]+':'+_0x45742b[_0x2f6ca4(0x18f)]:_0x2f6ca4(0x1a6),_0x2bc404=_0x4a12d0?getModelDisplayName(_0x4a12d0):_0x2f6ca4(0x198);_0x1e4715[_0x2f6ca4(0x1a8)]('💎\x20'+_0x34b4d8+_0x2f6ca4(0x18d)+_0x2bc404);const _0x49a01c=formatCredits(_0x1d944a[_0x2f6ca4(0x1a2)]),_0x1950ed=formatCredits(_0x1d944a[_0x2f6ca4(0x18e)]),_0x364fef=formatCredits(_0x1d944a[_0x2f6ca4(0x1af)]);_0x1e4715[_0x2f6ca4(0x1a8)](_0x2f6ca4(0x189)+_0x49a01c+_0x2f6ca4(0x19d)+_0x1950ed+_0x2f6ca4(0x19b)+_0x364fef+'\x20month');if(_0x1d944a['latestInputTokens']>0x0&&_0x4a12d0){const _0x4317b3=formatTokenCount(_0x1d944a[_0x2f6ca4(0x1a0)]),_0x292148=calculateContextPercentage(_0x1d944a['latestInputTokens'],_0x4a12d0);_0x1e4715['push'](_0x2f6ca4(0x192)+_0x4317b3+'\x20('+_0x292148+'%)');}return console[_0x2f6ca4(0x18c)](_0x1e4715[_0x2f6ca4(0x1a9)](_0x2f6ca4(0x1aa))),0x0;}catch{return console[_0x2f6ca4(0x18c)](_0x2f6ca4(0x1a7)),0x0;}}}
1
+ const a10_0x50e642=a10_0x3efa;(function(_0x5bf184,_0x58ee97){const _0x332666=a10_0x3efa,_0x1996da=_0x5bf184();while(!![]){try{const _0x3a820f=parseInt(_0x332666(0x127))/0x1+-parseInt(_0x332666(0x141))/0x2*(parseInt(_0x332666(0x130))/0x3)+parseInt(_0x332666(0x146))/0x4*(-parseInt(_0x332666(0x126))/0x5)+-parseInt(_0x332666(0x128))/0x6*(-parseInt(_0x332666(0x129))/0x7)+parseInt(_0x332666(0x133))/0x8+-parseInt(_0x332666(0x134))/0x9*(parseInt(_0x332666(0x13d))/0xa)+parseInt(_0x332666(0x139))/0xb;if(_0x3a820f===_0x58ee97)break;else _0x1996da['push'](_0x1996da['shift']());}catch(_0x3b68d7){_0x1996da['push'](_0x1996da['shift']());}}}(a10_0x253d,0x2a85d));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a10_0x3efa(_0x3a4898,_0x56a4b6){_0x3a4898=_0x3a4898-0x124;const _0x253d1b=a10_0x253d();let _0x3efaf5=_0x253d1b[_0x3a4898];return _0x3efaf5;}import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x225603=0x64){return new Promise(_0x240aa2=>{const _0x54c99b=a10_0x3efa;let _0x24107f='',_0x14fc57=![];const _0x24a8c9=createInterface({'input':process[_0x54c99b(0x13a)],'terminal':![]}),_0x81e1b4=_0x1ce385=>{const _0x847eae=_0x54c99b;if(_0x14fc57)return;_0x14fc57=!![],clearTimeout(_0x3462dc),_0x24a8c9[_0x847eae(0x140)](),_0x240aa2(_0x1ce385);},_0x3462dc=setTimeout(()=>{_0x81e1b4(null);},_0x225603);_0x24a8c9['on'](_0x54c99b(0x13f),_0x294fed=>{_0x24107f+=_0x294fed;}),_0x24a8c9['on'](_0x54c99b(0x140),()=>{const _0xf98d8c=_0x54c99b;if(_0x14fc57)return;try{const _0x5c7292=JSON[_0xf98d8c(0x135)](_0x24107f);_0x81e1b4(_0x5c7292);}catch{_0x81e1b4(null);}});});}function formatCredits(_0x5b8e32){const _0x7cc5c0=a10_0x3efa;return _0x5b8e32[_0x7cc5c0(0x148)](0x2);}function a10_0x253d(){const _0x1de995=['todayCredits','sessionCredits','60bwZFRf','tdx\x20','toFixed','Claude','options','113585pLdQOZ','161972KmKqOa','55362sWWxmR','189QQshUS','description','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','session_id','latestInputTokens','\x20session\x20/\x20','profile','46122DbfVEX','site','🪙\x20credit:\x20','1383464lPGlQQ','2892258ILEexF','parse','name','\x20month','monthCredits','6326210KAsNRM','stdin','push','💎\x20tdx\x20-\x20Claude','10OKIFxT','\x20today\x20/\x20','line','close','42ChwkFp','statusline','log'];a10_0x253d=function(){return _0x1de995;};return a10_0x253d();}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x50e642(0x136)]=a10_0x50e642(0x142);[a10_0x50e642(0x12a)]=a10_0x50e642(0x12b);async['execute'](_0x5c967e){const _0x5a9994=a10_0x50e642;try{const _0x272d7b=await readStdinJson();if(!_0x272d7b?.[_0x5a9994(0x12c)])return console['log']('💎\x20tdx\x20-\x20Claude'),0x0;const _0x205caf=_0x272d7b[_0x5a9994(0x12c)],_0x967986=_0x272d7b['model']?.['id']||'',_0x331dfe=_0x272d7b[_0x5a9994(0x12f)]||_0x5c967e[_0x5a9994(0x125)]['profile'],_0x1ff009=await getUsageStats(_0x205caf,_0x331dfe),_0x259355=[],_0x31defe=readCachedAccountInfo(_0x331dfe),_0x29ec88=_0x31defe?_0x5a9994(0x147)+_0x31defe[_0x5a9994(0x131)]+':'+_0x31defe['accountId']:'tdx',_0xafc1b4=_0x967986?getModelDisplayName(_0x967986):_0x5a9994(0x124);_0x259355[_0x5a9994(0x13b)]('💎\x20'+_0x29ec88+'\x20-\x20'+_0xafc1b4);const _0x8765a8=formatCredits(_0x1ff009[_0x5a9994(0x145)]),_0x1106f1=formatCredits(_0x1ff009[_0x5a9994(0x144)]),_0x5d3ee0=formatCredits(_0x1ff009[_0x5a9994(0x138)]);_0x259355[_0x5a9994(0x13b)](_0x5a9994(0x132)+_0x8765a8+_0x5a9994(0x12e)+_0x1106f1+_0x5a9994(0x13e)+_0x5d3ee0+_0x5a9994(0x137));if(_0x1ff009[_0x5a9994(0x12d)]>0x0&&_0x967986){const _0x25df72=formatTokenCount(_0x1ff009['latestInputTokens']),_0xeaefa5=calculateContextPercentage(_0x1ff009[_0x5a9994(0x12d)],_0x967986);_0x259355[_0x5a9994(0x13b)]('🧠\x20'+_0x25df72+'\x20('+_0xeaefa5+'%)');}return console[_0x5a9994(0x143)](_0x259355['join']('\x20|\x20')),0x0;}catch{return console[_0x5a9994(0x143)](_0x5a9994(0x13c)),0x0;}}}
@@ -1 +1 @@
1
- function a11_0x4234(_0x3f08d2,_0x9faa68){_0x3f08d2=_0x3f08d2-0xfa;const _0x59e2ca=a11_0x59e2();let _0x4234b4=_0x59e2ca[_0x3f08d2];return _0x4234b4;}const a11_0x457793=a11_0x4234;(function(_0x199c96,_0x6fba01){const _0x162eac=a11_0x4234,_0x5bb586=_0x199c96();while(!![]){try{const _0xcf6db1=-parseInt(_0x162eac(0xfe))/0x1+-parseInt(_0x162eac(0x13f))/0x2+-parseInt(_0x162eac(0x110))/0x3+-parseInt(_0x162eac(0x10f))/0x4*(-parseInt(_0x162eac(0x103))/0x5)+-parseInt(_0x162eac(0x13b))/0x6+-parseInt(_0x162eac(0x13c))/0x7*(parseInt(_0x162eac(0x134))/0x8)+-parseInt(_0x162eac(0x114))/0x9*(-parseInt(_0x162eac(0x11f))/0xa);if(_0xcf6db1===_0x6fba01)break;else _0x5bb586['push'](_0x5bb586['shift']());}catch(_0x4bd1c3){_0x5bb586['push'](_0x5bb586['shift']());}}}(a11_0x59e2,0x4ee0b));import a11_0x43913c 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(_0x927436){return _0x927436['toFixed'](0x2);}function a11_0x59e2(){const _0x58cd54=['numeric','log','monthCredits','2-digit','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','Source','credits','\x20\x20Month:\x20\x20\x20','entryCount','Last\x20Used','Month','lastUsedAt','\x20credits','usage','cyan','profile','execute','short','16aXMZik','toLocaleDateString','Unknown\x20error','Usage\x20by\x20Profile','Total','today\x20','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','2295768OPjXHw','2145829MKDmjW','bold','\x20days\x20ago','490152idtCzh','totalCredits','round','padEnd','json','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','Usage\x20by\x20Source','236493nbIlOr','format','name','en-US','dim','767445FcXqQS','en-CA','map','(default)','source','outputTable','description','getTime','max','\x20\x20Today:\x20\x20\x20','message','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','8SwdjOT','1181028gvUJHE','repeat','jsonl','Profile','288cBEhcf','yesterday','default','toLocaleTimeString','Error:\x20','Credits','all','padStart','never','outputStructured','todayCredits','589710vdqILw','red','length'];a11_0x59e2=function(){return _0x58cd54;};return a11_0x59e2();}function formatLastUsed(_0xf91c40){const _0x272d5d=a11_0x4234;if(!_0xf91c40)return _0x272d5d(0x11c);const _0x3ac7f0=new Date(_0xf91c40),_0x463b94=new Date(),_0x51270c=_0x3ac7f0['toLocaleDateString'](_0x272d5d(0x104)),_0x1f1f27=_0x463b94['toLocaleDateString'](_0x272d5d(0x104));if(_0x51270c===_0x1f1f27)return _0x272d5d(0x139)+_0x3ac7f0[_0x272d5d(0x117)](_0x272d5d(0x101),{'hour':_0x272d5d(0x125),'minute':'2-digit'});const _0x587fa7=new Date(_0x51270c),_0x1bc39a=new Date(_0x1f1f27),_0x2276b9=Math[_0x272d5d(0x141)]((_0x1bc39a['getTime']()-_0x587fa7[_0x272d5d(0x10a)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x2276b9===0x1)return _0x272d5d(0x115);else return _0x2276b9>0x1&&_0x2276b9<0x7?_0x2276b9+_0x272d5d(0x13e):_0x3ac7f0[_0x272d5d(0x135)]('en-US',{'month':_0x272d5d(0x133),'day':_0x272d5d(0x122)});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x457793(0x100)]=a11_0x457793(0x12f);[a11_0x457793(0x109)]=a11_0x457793(0x126);async[a11_0x457793(0x132)](_0x328280){const _0x595031=a11_0x457793,{options:_0xfbc0d1}=_0x328280,_0x145698=_0xfbc0d1[_0x595031(0xff)]===_0x595031(0xfb)||_0xfbc0d1['format']===_0x595031(0x112)||_0xfbc0d1['json'];try{const [_0x3a6899,_0x30c388,_0xfead5a]=await Promise[_0x595031(0x11a)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x145698?await this['outputStructured'](_0x3a6899,_0x30c388,_0xfead5a,_0xfbc0d1):this[_0x595031(0x108)](_0x3a6899,_0x30c388,_0xfead5a),0x0;}catch(_0x9e3049){const _0x34a751=_0x9e3049 instanceof Error?_0x9e3049[_0x595031(0x10d)]:_0x595031(0x136);return console['error'](a11_0x43913c[_0x595031(0x120)](_0x595031(0x118)+_0x34a751)),0x1;}}async[a11_0x457793(0x11d)](_0x57da5b,_0xb8862e,_0x9cf4e3,_0x25ccd5){const _0x5e7844=a11_0x457793,_0x58de9a={'summary':{'todayCredits':_0x9cf4e3[_0x5e7844(0x11e)],'monthCredits':_0x9cf4e3['monthCredits'],'totalCredits':_0x9cf4e3[_0x5e7844(0x140)],'profileCount':_0x9cf4e3['profileCount']},'profiles':_0x57da5b[_0x5e7844(0x105)](_0x5cd106=>({'profile':_0x5cd106['profile'],'credits':_0x5cd106[_0x5e7844(0x128)],'requests':_0x5cd106['entryCount'],'lastUsedAt':_0x5cd106['lastUsedAt']})),'sources':_0xb8862e['map'](_0x43f9cb=>({'source':_0x43f9cb[_0x5e7844(0x107)],'credits':_0x43f9cb[_0x5e7844(0x128)],'todayCredits':_0x43f9cb[_0x5e7844(0x11e)],'monthCredits':_0x43f9cb[_0x5e7844(0x124)],'requests':_0x43f9cb[_0x5e7844(0x12a)]}))};await handleSDKOutput([_0x58de9a],_0x25ccd5);}[a11_0x457793(0x108)](_0xbb1bf0,_0x83d214,_0x5599ab){const _0x5697a4=a11_0x457793;console['log'](a11_0x43913c['bold'](_0x5697a4(0x10e))),console[_0x5697a4(0x123)](a11_0x43913c['dim']('─'['repeat'](0x32))),console[_0x5697a4(0x123)](_0x5697a4(0x10c)+a11_0x43913c['cyan'](formatCredits(_0x5599ab[_0x5697a4(0x11e)]))+_0x5697a4(0x12e)),console[_0x5697a4(0x123)](_0x5697a4(0x129)+a11_0x43913c[_0x5697a4(0x130)](formatCredits(_0x5599ab['monthCredits']))+_0x5697a4(0x12e)),console[_0x5697a4(0x123)]('\x20\x20Total:\x20\x20\x20'+a11_0x43913c[_0x5697a4(0x130)](formatCredits(_0x5599ab[_0x5697a4(0x140)]))+_0x5697a4(0x12e)),console[_0x5697a4(0x123)]();if(_0x83d214['length']>0x0){console[_0x5697a4(0x123)](a11_0x43913c[_0x5697a4(0x13d)](_0x5697a4(0xfd))),console[_0x5697a4(0x123)](a11_0x43913c[_0x5697a4(0x102)]('─'['repeat'](0x3c)));const _0xfc261d=0xc,_0x1fd974=0xa,_0xe71635=0xa,_0x493661=0xa;console[_0x5697a4(0x123)]('\x20\x20'+_0x5697a4(0x127)[_0x5697a4(0xfa)](_0xfc261d)+'\x20\x20'+_0x5697a4(0x138)[_0x5697a4(0x11b)](_0x1fd974)+'\x20\x20'+'Today'['padStart'](_0xe71635)+'\x20\x20'+_0x5697a4(0x12c)[_0x5697a4(0x11b)](_0x493661));for(const _0x5f409 of _0x83d214){console['log']('\x20\x20'+_0x5f409[_0x5697a4(0x107)][_0x5697a4(0xfa)](_0xfc261d)+'\x20\x20'+a11_0x43913c[_0x5697a4(0x130)](formatCredits(_0x5f409[_0x5697a4(0x128)])['padStart'](_0x1fd974))+'\x20\x20'+formatCredits(_0x5f409[_0x5697a4(0x11e)])[_0x5697a4(0x11b)](_0xe71635)+'\x20\x20'+formatCredits(_0x5f409[_0x5697a4(0x124)])[_0x5697a4(0x11b)](_0x493661));}console[_0x5697a4(0x123)]();}if(_0xbb1bf0['length']===0x0){console['log'](a11_0x43913c[_0x5697a4(0x102)](_0x5697a4(0x13a))),console[_0x5697a4(0x123)](a11_0x43913c[_0x5697a4(0x102)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x5697a4(0x123)](a11_0x43913c['bold'](_0x5697a4(0x137))),console[_0x5697a4(0x123)](a11_0x43913c[_0x5697a4(0x102)]('─'[_0x5697a4(0x111)](0x3c)));const _0x4a253e=Math[_0x5697a4(0x10b)](0xc,..._0xbb1bf0[_0x5697a4(0x105)](_0x55c7fe=>_0x55c7fe['profile']===_0x5697a4(0x116)?_0x5697a4(0x106)[_0x5697a4(0x121)]:_0x55c7fe[_0x5697a4(0x131)]['length'])),_0x268a9e=0xa,_0x13df39=0xa;console['log']('\x20\x20'+_0x5697a4(0x113)[_0x5697a4(0xfa)](_0x4a253e)+'\x20\x20'+_0x5697a4(0x119)[_0x5697a4(0x11b)](_0x268a9e)+'\x20\x20'+'Requests'[_0x5697a4(0x11b)](_0x13df39)+'\x20\x20'+_0x5697a4(0x12b));for(const _0x1e405d of _0xbb1bf0){const _0x2628f9=_0x1e405d[_0x5697a4(0x131)]===_0x5697a4(0x116)?_0x5697a4(0x106):_0x1e405d[_0x5697a4(0x131)],_0x1ca720=_0x2628f9[_0x5697a4(0xfa)](_0x4a253e),_0x4e53ed=_0x1e405d[_0x5697a4(0x131)]===_0x5697a4(0x116)?a11_0x43913c[_0x5697a4(0x102)](_0x1ca720):_0x1ca720;console['log']('\x20\x20'+_0x4e53ed+'\x20\x20'+a11_0x43913c[_0x5697a4(0x130)](formatCredits(_0x1e405d[_0x5697a4(0x128)])['padStart'](_0x268a9e))+'\x20\x20'+String(_0x1e405d[_0x5697a4(0x12a)])[_0x5697a4(0x11b)](_0x13df39)+'\x20\x20'+a11_0x43913c[_0x5697a4(0x102)](formatLastUsed(_0x1e405d[_0x5697a4(0x12d)])));}console[_0x5697a4(0x123)](),console[_0x5697a4(0x123)](a11_0x43913c[_0x5697a4(0x102)](_0x5697a4(0xfc))),console[_0x5697a4(0x123)]();}}
1
+ const a11_0x4fa516=a11_0x3b06;function a11_0x5ea5(){const _0x39c0b5=['length','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Error:\x20','\x20days\x20ago','Month','\x20\x20Total:\x20\x20\x20','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','bold','Total','2Odmpyr','Usage\x20by\x20Profile','red','jsonl','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','padEnd','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','21160jRIowH','Credits','2427292ElGKXf','(default)','credits','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','214958ireppy','Last\x20Used','numeric','json','15465jqelhV','toLocaleTimeString','todayCredits','outputTable','name','Source','en-US','cyan','\x20credits','log','repeat','1278vVwWZo','2-digit','lastUsedAt','yesterday','\x20\x20Today:\x20\x20\x20','getTime','never','entryCount','outputStructured','message','totalCredits','profile','usage','monthCredits','round','3390LpeMeH','toFixed','padStart','Profile','source','en-CA','format','map','378SicAhy','Today','toLocaleDateString','dim','error','short','default','791504kdWglg','284760iCoogJ','\x20\x20Month:\x20\x20\x20','execute'];a11_0x5ea5=function(){return _0x39c0b5;};return a11_0x5ea5();}(function(_0x220fe2,_0x13f0bb){const _0x598374=a11_0x3b06,_0x5d73a2=_0x220fe2();while(!![]){try{const _0x1f058f=-parseInt(_0x598374(0x230))/0x1+parseInt(_0x598374(0x223))/0x2*(-parseInt(_0x598374(0x234))/0x3)+parseInt(_0x598374(0x22c))/0x4+-parseInt(_0x598374(0x22a))/0x5*(parseInt(_0x598374(0x20f))/0x6)+parseInt(_0x598374(0x217))/0x7+parseInt(_0x598374(0x216))/0x8+parseInt(_0x598374(0x1f8))/0x9*(parseInt(_0x598374(0x207))/0xa);if(_0x1f058f===_0x13f0bb)break;else _0x5d73a2['push'](_0x5d73a2['shift']());}catch(_0x52d1b7){_0x5d73a2['push'](_0x5d73a2['shift']());}}}(a11_0x5ea5,0x4b28a));import a11_0x2eb82f from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a11_0x3b06(_0x437e9a,_0x5b0b0b){_0x437e9a=_0x437e9a-0x1f3;const _0x5ea512=a11_0x5ea5();let _0x3b0606=_0x5ea512[_0x437e9a];return _0x3b0606;}import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x1401c8){const _0x5eca7e=a11_0x3b06;return _0x1401c8[_0x5eca7e(0x208)](0x2);}function formatLastUsed(_0x22ebac){const _0x20160d=a11_0x3b06;if(!_0x22ebac)return _0x20160d(0x1fe);const _0x4bee06=new Date(_0x22ebac),_0x3b688d=new Date(),_0x5d9cac=_0x4bee06[_0x20160d(0x211)](_0x20160d(0x20c)),_0x53d05a=_0x3b688d['toLocaleDateString'](_0x20160d(0x20c));if(_0x5d9cac===_0x53d05a)return'today\x20'+_0x4bee06[_0x20160d(0x235)](_0x20160d(0x1f3),{'hour':_0x20160d(0x1f9),'minute':_0x20160d(0x1f9)});const _0x163442=new Date(_0x5d9cac),_0x3d2b25=new Date(_0x53d05a),_0x5f4262=Math[_0x20160d(0x206)]((_0x3d2b25[_0x20160d(0x1fd)]()-_0x163442[_0x20160d(0x1fd)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5f4262===0x1)return _0x20160d(0x1fb);else return _0x5f4262>0x1&&_0x5f4262<0x7?_0x5f4262+_0x20160d(0x21d):_0x4bee06[_0x20160d(0x211)]('en-US',{'month':_0x20160d(0x214),'day':_0x20160d(0x232)});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x4fa516(0x238)]=a11_0x4fa516(0x204);['description']=a11_0x4fa516(0x220);async[a11_0x4fa516(0x219)](_0x2184de){const _0x244917=a11_0x4fa516,{options:_0x321d12}=_0x2184de,_0x1a49ae=_0x321d12[_0x244917(0x20d)]===_0x244917(0x233)||_0x321d12[_0x244917(0x20d)]===_0x244917(0x226)||_0x321d12['json'];try{const [_0x241565,_0x33841f,_0x1feb11]=await Promise['all']([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x1a49ae?await this[_0x244917(0x200)](_0x241565,_0x33841f,_0x1feb11,_0x321d12):this[_0x244917(0x237)](_0x241565,_0x33841f,_0x1feb11),0x0;}catch(_0x13f13a){const _0x467f21=_0x13f13a instanceof Error?_0x13f13a[_0x244917(0x201)]:'Unknown\x20error';return console[_0x244917(0x213)](a11_0x2eb82f[_0x244917(0x225)](_0x244917(0x21c)+_0x467f21)),0x1;}}async[a11_0x4fa516(0x200)](_0x33757f,_0x4d3987,_0x378a57,_0x14586e){const _0x6a5c84=a11_0x4fa516,_0x57293a={'summary':{'todayCredits':_0x378a57[_0x6a5c84(0x236)],'monthCredits':_0x378a57['monthCredits'],'totalCredits':_0x378a57['totalCredits'],'profileCount':_0x378a57['profileCount']},'profiles':_0x33757f[_0x6a5c84(0x20e)](_0x5cf0c5=>({'profile':_0x5cf0c5['profile'],'credits':_0x5cf0c5[_0x6a5c84(0x22e)],'requests':_0x5cf0c5[_0x6a5c84(0x1ff)],'lastUsedAt':_0x5cf0c5[_0x6a5c84(0x1fa)]})),'sources':_0x4d3987[_0x6a5c84(0x20e)](_0x28a838=>({'source':_0x28a838[_0x6a5c84(0x20b)],'credits':_0x28a838[_0x6a5c84(0x22e)],'todayCredits':_0x28a838[_0x6a5c84(0x236)],'monthCredits':_0x28a838[_0x6a5c84(0x205)],'requests':_0x28a838[_0x6a5c84(0x1ff)]}))};await handleSDKOutput([_0x57293a],_0x14586e);}[a11_0x4fa516(0x237)](_0x5939a2,_0x18c1f3,_0x32e58b){const _0x270f7c=a11_0x4fa516;console[_0x270f7c(0x1f6)](a11_0x2eb82f[_0x270f7c(0x221)](_0x270f7c(0x229))),console['log'](a11_0x2eb82f[_0x270f7c(0x212)]('─'[_0x270f7c(0x1f7)](0x32))),console['log'](_0x270f7c(0x1fc)+a11_0x2eb82f[_0x270f7c(0x1f4)](formatCredits(_0x32e58b['todayCredits']))+'\x20credits'),console[_0x270f7c(0x1f6)](_0x270f7c(0x218)+a11_0x2eb82f[_0x270f7c(0x1f4)](formatCredits(_0x32e58b['monthCredits']))+_0x270f7c(0x1f5)),console[_0x270f7c(0x1f6)](_0x270f7c(0x21f)+a11_0x2eb82f[_0x270f7c(0x1f4)](formatCredits(_0x32e58b[_0x270f7c(0x202)]))+'\x20credits'),console[_0x270f7c(0x1f6)]();if(_0x18c1f3[_0x270f7c(0x21a)]>0x0){console[_0x270f7c(0x1f6)](a11_0x2eb82f['bold']('Usage\x20by\x20Source')),console[_0x270f7c(0x1f6)](a11_0x2eb82f[_0x270f7c(0x212)]('─'[_0x270f7c(0x1f7)](0x3c)));const _0x1f9539=0xc,_0x41fde8=0xa,_0x2144d7=0xa,_0x5006da=0xa;console[_0x270f7c(0x1f6)]('\x20\x20'+_0x270f7c(0x239)[_0x270f7c(0x228)](_0x1f9539)+'\x20\x20'+_0x270f7c(0x222)[_0x270f7c(0x209)](_0x41fde8)+'\x20\x20'+_0x270f7c(0x210)['padStart'](_0x2144d7)+'\x20\x20'+_0x270f7c(0x21e)[_0x270f7c(0x209)](_0x5006da));for(const _0x12cf37 of _0x18c1f3){console[_0x270f7c(0x1f6)]('\x20\x20'+_0x12cf37[_0x270f7c(0x20b)]['padEnd'](_0x1f9539)+'\x20\x20'+a11_0x2eb82f[_0x270f7c(0x1f4)](formatCredits(_0x12cf37[_0x270f7c(0x22e)])[_0x270f7c(0x209)](_0x41fde8))+'\x20\x20'+formatCredits(_0x12cf37[_0x270f7c(0x236)])[_0x270f7c(0x209)](_0x2144d7)+'\x20\x20'+formatCredits(_0x12cf37[_0x270f7c(0x205)])[_0x270f7c(0x209)](_0x5006da));}console[_0x270f7c(0x1f6)]();}if(_0x5939a2['length']===0x0){console[_0x270f7c(0x1f6)](a11_0x2eb82f[_0x270f7c(0x212)](_0x270f7c(0x21b))),console[_0x270f7c(0x1f6)](a11_0x2eb82f[_0x270f7c(0x212)](_0x270f7c(0x227)));return;}console[_0x270f7c(0x1f6)](a11_0x2eb82f[_0x270f7c(0x221)](_0x270f7c(0x224))),console[_0x270f7c(0x1f6)](a11_0x2eb82f[_0x270f7c(0x212)]('─'[_0x270f7c(0x1f7)](0x3c)));const _0x1d340d=Math['max'](0xc,..._0x5939a2['map'](_0x4fe984=>_0x4fe984[_0x270f7c(0x203)]===_0x270f7c(0x215)?_0x270f7c(0x22d)[_0x270f7c(0x21a)]:_0x4fe984[_0x270f7c(0x203)][_0x270f7c(0x21a)])),_0x1d5ad0=0xa,_0x35c459=0xa;console[_0x270f7c(0x1f6)]('\x20\x20'+_0x270f7c(0x20a)[_0x270f7c(0x228)](_0x1d340d)+'\x20\x20'+_0x270f7c(0x22b)[_0x270f7c(0x209)](_0x1d5ad0)+'\x20\x20'+'Requests'['padStart'](_0x35c459)+'\x20\x20'+_0x270f7c(0x231));for(const _0x2b5530 of _0x5939a2){const _0x2f7b0f=_0x2b5530[_0x270f7c(0x203)]===_0x270f7c(0x215)?_0x270f7c(0x22d):_0x2b5530[_0x270f7c(0x203)],_0x767114=_0x2f7b0f[_0x270f7c(0x228)](_0x1d340d),_0x497f48=_0x2b5530[_0x270f7c(0x203)]==='default'?a11_0x2eb82f[_0x270f7c(0x212)](_0x767114):_0x767114;console[_0x270f7c(0x1f6)]('\x20\x20'+_0x497f48+'\x20\x20'+a11_0x2eb82f['cyan'](formatCredits(_0x2b5530[_0x270f7c(0x22e)])[_0x270f7c(0x209)](_0x1d5ad0))+'\x20\x20'+String(_0x2b5530[_0x270f7c(0x1ff)])[_0x270f7c(0x209)](_0x35c459)+'\x20\x20'+a11_0x2eb82f[_0x270f7c(0x212)](formatLastUsed(_0x2b5530[_0x270f7c(0x1fa)])));}console['log'](),console[_0x270f7c(0x1f6)](a11_0x2eb82f[_0x270f7c(0x212)](_0x270f7c(0x22f))),console[_0x270f7c(0x1f6)]();}}
@@ -1 +1 @@
1
- function a12_0x4238(_0x21713c,_0x52cfdf){_0x21713c=_0x21713c-0x9f;const _0x165200=a12_0x1652();let _0x423826=_0x165200[_0x21713c];return _0x423826;}const a12_0x483425=a12_0x4238;(function(_0x185d66,_0x3b71f1){const _0xb5e0f8=a12_0x4238,_0x350985=_0x185d66();while(!![]){try{const _0x365eba=-parseInt(_0xb5e0f8(0xb5))/0x1+-parseInt(_0xb5e0f8(0xc3))/0x2*(-parseInt(_0xb5e0f8(0xa1))/0x3)+-parseInt(_0xb5e0f8(0xa6))/0x4*(parseInt(_0xb5e0f8(0xb7))/0x5)+-parseInt(_0xb5e0f8(0xac))/0x6+-parseInt(_0xb5e0f8(0xc4))/0x7+-parseInt(_0xb5e0f8(0xcf))/0x8+-parseInt(_0xb5e0f8(0xbd))/0x9*(-parseInt(_0xb5e0f8(0xb0))/0xa);if(_0x365eba===_0x3b71f1)break;else _0x350985['push'](_0x350985['shift']());}catch(_0x11fb66){_0x350985['push'](_0x350985['shift']());}}}(a12_0x1652,0xbcb04));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a12_0x1652(){const _0x1c1b08=['from','debug','29726540lvHvqU','register','validate','profile','detail','614315aeAenx','Authentication\x20failed','730FckTGS','Reason:\x20','getAll','Invalid\x20limit\x20value:\x20','error','dim','9ZsNedg','isValid','Error:\x20','tdx\x20auth','cyan','Authentication\x20error\x20stack\x20trace:','36566FeSwLG','12845sUdLKj','tdx\x20auth\x20setup','set','helpText','To\x20set\x20up\x20authentication:','red','has','get','commands','test','To\x20check\x20your\x20current\x20auth\x20status:','8934088DbkqHU','stack','options','values','validateGlobalOptions','252ujGksl','name','run','yellow','message','28772XRAuQE','\x20--profile\x20','Command\x20\x27','execute','limit','USER_ERROR','5714814AsBNYE','problemDetails'];a12_0x1652=function(){return _0x1c1b08;};return a12_0x1652();}import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a12_0x32ef3a from'chalk';export function printAuthError(_0x43f6dd,_0x281acf=![],_0x251dbf){const _0x2c959d=a12_0x4238,_0x1ad97d=_0x43f6dd[_0x2c959d(0xad)]?.[_0x2c959d(0xb4)]||_0x43f6dd[_0x2c959d(0xa5)];console['error'](a12_0x32ef3a[_0x2c959d(0xc9)](_0x2c959d(0xb6))),console[_0x2c959d(0xbb)](a12_0x32ef3a['red'](_0x2c959d(0xb8)+_0x1ad97d));if(_0x281acf){const _0x556691=_0x251dbf?_0x2c959d(0xa7)+_0x251dbf:'';console[_0x2c959d(0xbb)]('\x0a'+a12_0x32ef3a[_0x2c959d(0xbc)](_0x2c959d(0xc8))),console[_0x2c959d(0xbb)]('\x20\x20'+a12_0x32ef3a['cyan'](_0x2c959d(0xc5)+_0x556691)+'\x0a'),console[_0x2c959d(0xbb)](''+a12_0x32ef3a[_0x2c959d(0xbc)](_0x2c959d(0xce))),console[_0x2c959d(0xbb)]('\x20\x20'+a12_0x32ef3a[_0x2c959d(0xc1)](_0x2c959d(0xc0)+_0x556691));}}export class BaseCommand{['validateGlobalOptions'](_0x295127){const _0x2081c8=a12_0x4238,{options:_0x5adfe4}=_0x295127,_0x4b8adb=_0x5adfe4[_0x2081c8(0xaa)];if(_0x4b8adb!==undefined){const _0x71d4de=typeof _0x4b8adb==='number'?_0x4b8adb:parseInt(_0x4b8adb,0xa);if(isNaN(_0x71d4de))return _0x2081c8(0xba)+_0x4b8adb+'.\x20Must\x20be\x20a\x20number.';const _0x21434a=validateLimitOption(_0x71d4de);if(!_0x21434a[_0x2081c8(0xbe)])return _0x21434a[_0x2081c8(0xbb)];_0x295127[_0x2081c8(0xd1)][_0x2081c8(0xaa)]=_0x21434a['value'];}return undefined;}[a12_0x483425(0xb2)](_0x4d7be0){return undefined;}async[a12_0x483425(0xa3)](_0x316b14){const _0x2a5f39=a12_0x483425;try{const _0xd4f6fb=this[_0x2a5f39(0xa0)](_0x316b14);if(_0xd4f6fb)return console[_0x2a5f39(0xbb)](_0x2a5f39(0xbf)+_0xd4f6fb),0x1;const _0x14fbe9=this['validate'](_0x316b14);if(_0x14fbe9){const _0xc0d690=/^\s*(Usage|Note|Warning|Error):/i[_0x2a5f39(0xcd)](_0x14fbe9);return _0xc0d690?console[_0x2a5f39(0xbb)](_0x14fbe9):console[_0x2a5f39(0xbb)](_0x2a5f39(0xbf)+_0x14fbe9),0x1;}const _0x1b8a47=await this[_0x2a5f39(0xa9)](_0x316b14);return _0x1b8a47??0x0;}catch(_0x343e38){if(_0x343e38 instanceof Error){if(_0x343e38 instanceof HTTPClientError&&_0x343e38['status']===0x191){const _0x31da48=_0x316b14[_0x2a5f39(0xd1)][_0x2a5f39(0xb3)];printAuthError(_0x343e38,!![],_0x31da48);if(_0x343e38[_0x2a5f39(0xd0)]){const _0xf740e4=Logger['of']('command');_0xf740e4[_0x2a5f39(0xaf)](_0x2a5f39(0xc2)),_0xf740e4[_0x2a5f39(0xaf)](_0x343e38[_0x2a5f39(0xd0)]);}return 0x1;}console['error'](a12_0x32ef3a[_0x2a5f39(0xc9)](_0x2a5f39(0xbf)+_0x343e38[_0x2a5f39(0xa5)]));_0x343e38 instanceof SDKError&&_0x343e38['helpText']&&console[_0x2a5f39(0xbb)](a12_0x32ef3a[_0x2a5f39(0xa4)](_0x343e38[_0x2a5f39(0xc7)]));const _0x116775=_0x343e38 instanceof SDKError&&_0x343e38['category']===ErrorCategory[_0x2a5f39(0xab)];_0x343e38[_0x2a5f39(0xd0)]&&!_0x116775&&console[_0x2a5f39(0xbb)]('\x0aStack\x20trace:\x0a'+_0x343e38['stack']);}else console[_0x2a5f39(0xbb)](_0x2a5f39(0xbf)+String(_0x343e38));return 0x1;}}}export class CommandRegistry{[a12_0x483425(0xcc)]=new Map();[a12_0x483425(0xb1)](_0x13612d){const _0xb8944c=a12_0x483425;if(this[_0xb8944c(0xcc)][_0xb8944c(0xca)](_0x13612d['name']))throw new Error(_0xb8944c(0xa8)+_0x13612d[_0xb8944c(0xa2)]+'\x27\x20is\x20already\x20registered');this[_0xb8944c(0xcc)][_0xb8944c(0xc6)](_0x13612d[_0xb8944c(0xa2)],_0x13612d);}[a12_0x483425(0xcb)](_0x3d765b){const _0x5e125a=a12_0x483425;return this[_0x5e125a(0xcc)][_0x5e125a(0xcb)](_0x3d765b);}[a12_0x483425(0xb9)](){const _0x5be76a=a12_0x483425;return Array[_0x5be76a(0xae)](this[_0x5be76a(0xcc)][_0x5be76a(0x9f)]());}['has'](_0x8bb873){const _0x512831=a12_0x483425;return this[_0x512831(0xcc)][_0x512831(0xca)](_0x8bb873);}}export const registry=new CommandRegistry();
1
+ const a12_0x137737=a12_0x4f47;function a12_0x4f47(_0x1dfd97,_0x3aecd2){_0x1dfd97=_0x1dfd97-0xc1;const _0x21f334=a12_0x21f3();let _0x4f47a5=_0x21f334[_0x1dfd97];return _0x4f47a5;}(function(_0x5eae08,_0x147b26){const _0x9b022e=a12_0x4f47,_0x41b315=_0x5eae08();while(!![]){try{const _0x45f2b9=-parseInt(_0x9b022e(0xd1))/0x1+parseInt(_0x9b022e(0xf2))/0x2+parseInt(_0x9b022e(0xc5))/0x3*(parseInt(_0x9b022e(0xcb))/0x4)+parseInt(_0x9b022e(0xc4))/0x5+-parseInt(_0x9b022e(0xd7))/0x6*(parseInt(_0x9b022e(0xe3))/0x7)+parseInt(_0x9b022e(0xc6))/0x8*(parseInt(_0x9b022e(0xdc))/0x9)+-parseInt(_0x9b022e(0xec))/0xa*(parseInt(_0x9b022e(0xde))/0xb);if(_0x45f2b9===_0x147b26)break;else _0x41b315['push'](_0x41b315['shift']());}catch(_0x5ab508){_0x41b315['push'](_0x41b315['shift']());}}}(a12_0x21f3,0x6648d));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_0x4a13fd from'chalk';export function printAuthError(_0xc22984,_0x1868c0=![],_0x44ecc0){const _0x29740e=a12_0x4f47,_0x3cd309=_0xc22984[_0x29740e(0xdb)]?.[_0x29740e(0xcd)]||_0xc22984[_0x29740e(0xd4)];console[_0x29740e(0xdf)](a12_0x4a13fd[_0x29740e(0xe7)](_0x29740e(0xda))),console['error'](a12_0x4a13fd[_0x29740e(0xe7)](_0x29740e(0xc2)+_0x3cd309));if(_0x1868c0){const _0xeeb01a=_0x44ecc0?_0x29740e(0xe0)+_0x44ecc0:'';console['error']('\x0a'+a12_0x4a13fd[_0x29740e(0xc1)]('To\x20set\x20up\x20authentication:')),console[_0x29740e(0xdf)]('\x20\x20'+a12_0x4a13fd[_0x29740e(0xd3)]('tdx\x20auth\x20setup'+_0xeeb01a)+'\x0a'),console[_0x29740e(0xdf)](''+a12_0x4a13fd[_0x29740e(0xc1)](_0x29740e(0xce))),console[_0x29740e(0xdf)]('\x20\x20'+a12_0x4a13fd[_0x29740e(0xd3)](_0x29740e(0xca)+_0xeeb01a));}}function a12_0x21f3(){const _0x346222=['detail','To\x20check\x20your\x20current\x20auth\x20status:','run','commands','675662InNIpE','isValid','cyan','message','set','execute','5604PsbdGE','name','options','Authentication\x20failed','problemDetails','239454QYDwui','Authentication\x20error\x20stack\x20trace:','11OAKESF','error','\x20--profile\x20','\x27\x20is\x20already\x20registered','command','3206CkUAYp','status','category','has','red','USER_ERROR','limit','number','validate','9975530czkpuF','test','get','.\x20Must\x20be\x20a\x20number.','value','profile','1327426qQoxGX','from','stack','validateGlobalOptions','dim','Reason:\x20','values','3688855wHfElL','618nTKpEE','176aOayUh','helpText','getAll','debug','tdx\x20auth','10352xrbsrg','Error:\x20'];a12_0x21f3=function(){return _0x346222;};return a12_0x21f3();}export class BaseCommand{[a12_0x137737(0xf5)](_0x46021c){const _0x4cc0f5=a12_0x137737,{options:_0x132e0b}=_0x46021c,_0x24795a=_0x132e0b[_0x4cc0f5(0xe9)];if(_0x24795a!==undefined){const _0x5adc10=typeof _0x24795a===_0x4cc0f5(0xea)?_0x24795a:parseInt(_0x24795a,0xa);if(isNaN(_0x5adc10))return'Invalid\x20limit\x20value:\x20'+_0x24795a+_0x4cc0f5(0xef);const _0x27b433=validateLimitOption(_0x5adc10);if(!_0x27b433[_0x4cc0f5(0xd2)])return _0x27b433[_0x4cc0f5(0xdf)];_0x46021c[_0x4cc0f5(0xd9)]['limit']=_0x27b433[_0x4cc0f5(0xf0)];}return undefined;}[a12_0x137737(0xeb)](_0x4e796e){return undefined;}async[a12_0x137737(0xcf)](_0x221223){const _0x40a9e7=a12_0x137737;try{const _0x4ff481=this[_0x40a9e7(0xf5)](_0x221223);if(_0x4ff481)return console[_0x40a9e7(0xdf)](_0x40a9e7(0xcc)+_0x4ff481),0x1;const _0x32df5a=this[_0x40a9e7(0xeb)](_0x221223);if(_0x32df5a){const _0x45b478=/^\s*(Usage|Note|Warning|Error):/i[_0x40a9e7(0xed)](_0x32df5a);return _0x45b478?console[_0x40a9e7(0xdf)](_0x32df5a):console[_0x40a9e7(0xdf)](_0x40a9e7(0xcc)+_0x32df5a),0x1;}const _0x2f5d9e=await this[_0x40a9e7(0xd6)](_0x221223);return _0x2f5d9e??0x0;}catch(_0x7c53a8){if(_0x7c53a8 instanceof Error){if(_0x7c53a8 instanceof HTTPClientError&&_0x7c53a8[_0x40a9e7(0xe4)]===0x191){const _0x56942c=_0x221223[_0x40a9e7(0xd9)][_0x40a9e7(0xf1)];printAuthError(_0x7c53a8,!![],_0x56942c);if(_0x7c53a8[_0x40a9e7(0xf4)]){const _0xce6576=Logger['of'](_0x40a9e7(0xe2));_0xce6576[_0x40a9e7(0xc9)](_0x40a9e7(0xdd)),_0xce6576[_0x40a9e7(0xc9)](_0x7c53a8[_0x40a9e7(0xf4)]);}return 0x1;}console['error'](a12_0x4a13fd[_0x40a9e7(0xe7)](_0x40a9e7(0xcc)+_0x7c53a8['message']));_0x7c53a8 instanceof SDKError&&_0x7c53a8[_0x40a9e7(0xc7)]&&console[_0x40a9e7(0xdf)](a12_0x4a13fd['yellow'](_0x7c53a8[_0x40a9e7(0xc7)]));const _0xb2c946=_0x7c53a8 instanceof SDKError&&_0x7c53a8[_0x40a9e7(0xe5)]===ErrorCategory[_0x40a9e7(0xe8)];_0x7c53a8[_0x40a9e7(0xf4)]&&!_0xb2c946&&console[_0x40a9e7(0xdf)]('\x0aStack\x20trace:\x0a'+_0x7c53a8[_0x40a9e7(0xf4)]);}else console[_0x40a9e7(0xdf)](_0x40a9e7(0xcc)+String(_0x7c53a8));return 0x1;}}}export class CommandRegistry{[a12_0x137737(0xd0)]=new Map();['register'](_0x40de4){const _0x1687bb=a12_0x137737;if(this[_0x1687bb(0xd0)][_0x1687bb(0xe6)](_0x40de4['name']))throw new Error('Command\x20\x27'+_0x40de4[_0x1687bb(0xd8)]+_0x1687bb(0xe1));this[_0x1687bb(0xd0)][_0x1687bb(0xd5)](_0x40de4[_0x1687bb(0xd8)],_0x40de4);}[a12_0x137737(0xee)](_0x9204b1){const _0x230738=a12_0x137737;return this[_0x230738(0xd0)]['get'](_0x9204b1);}[a12_0x137737(0xc8)](){const _0x5c1ef9=a12_0x137737;return Array[_0x5c1ef9(0xf3)](this[_0x5c1ef9(0xd0)][_0x5c1ef9(0xc3)]());}[a12_0x137737(0xe6)](_0x389f9c){const _0x420539=a12_0x137737;return this['commands'][_0x420539(0xe6)](_0x389f9c);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a13_0x4f85fe=a13_0x1bc0;function a13_0x1bc0(_0x4d3bbb,_0x49d1e6){_0x4d3bbb=_0x4d3bbb-0x1d8;const _0x152746=a13_0x1527();let _0x1bc06a=_0x152746[_0x4d3bbb];return _0x1bc06a;}(function(_0x4b695e,_0x5c8872){const _0x1a69c4=a13_0x1bc0,_0x329b13=_0x4b695e();while(!![]){try{const _0x365de5=-parseInt(_0x1a69c4(0x208))/0x1*(-parseInt(_0x1a69c4(0x1f5))/0x2)+-parseInt(_0x1a69c4(0x241))/0x3+parseInt(_0x1a69c4(0x215))/0x4+parseInt(_0x1a69c4(0x23d))/0x5*(-parseInt(_0x1a69c4(0x213))/0x6)+parseInt(_0x1a69c4(0x1e5))/0x7*(parseInt(_0x1a69c4(0x1ff))/0x8)+parseInt(_0x1a69c4(0x231))/0x9*(-parseInt(_0x1a69c4(0x1f2))/0xa)+-parseInt(_0x1a69c4(0x21c))/0xb;if(_0x365de5===_0x5c8872)break;else _0x329b13['push'](_0x329b13['shift']());}catch(_0x272565){_0x329b13['push'](_0x329b13['shift']());}}}(a13_0x1527,0x3b574));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_0x1527(){const _0x22d1d1=['object','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','yellow','✔\x20Found\x20','validate','<=\x20','\x20\x20\x20\x20','cyan','✔\x20Found\x20schema\x20for\x20connection\x20\x27','14exBAmr','\x0aConnection:\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','\x0aNo\x20fields\x20defined\x20in\x20schema','input','stringify','Fetching\x20schema\x20for\x20\x27','length','Default:\x20','\x27...','\x20connection','join','owner','560FMyYoR','Treating\x20\x27','settings','793912GcYwFy','connection','sort','title','>=\x20','connection:settings','data','\x20connector\x20type','list','\x27\x20as\x20connector\x20type','707576tptuxH','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','\x0aConnector:\x20','options','Looking\x20up\x20connection:\x20','name','Fetching\x20connection\x20\x27','connection:list','error','1EmdpYs','default_value','connection:schema','output','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','localeCompare','maximum','Name:\x20','\x20[record]','hint','dim','1346862jtsUBg','minimum','1498040iTaxLY','execute','push','findByName','credential','bold','\x20-\x20','3171355Xogjuy','\x20\x20\x20\x20Default:\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.','legacy_settings','\x0aNo\x20credential\x20settings\x20defined','log','map','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','\x0aCredential\x20settings:','List\x20available\x20connector\x20types','Options:\x20','properties','hidden','Listing\x20connector\x20types...','padStart','value','max','Show\x20when:\x20','entries','No\x20available\x20fields\x20for\x20this\x20connector','repeat','17478yTHwJZ','enumeration','record','find','Show\x20connection\x20details','criteria','\x0aAvailable\x20fields:','getMetadata','slice','List\x20all\x20result\x20output\x20connections','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.','Type:\x20','5AjgFLp','description','✔\x20Resolved\x20\x27','label','251298usVLel','blue','filter','limit','type','site','Fetching\x20settings\x20for\x20\x27','legacy','connection:types','getOutputSchema','verbose','Fetching\x20settings\x20for\x20connector\x20type:\x20','Site:\x20','\x20\x20\x20\x20Options:\x20'];a13_0x1527=function(){return _0x22d1d1;};return a13_0x1527();}import a13_0x32ddd2 from'chalk';function normalizeSchemaForDisplay(_0x4a155d){const _0x3138b0=a13_0x1bc0,_0x502342=_0x4a155d[_0x3138b0(0x227)]||[],_0x45b852=_0x502342[_0x3138b0(0x234)](_0x1a900e=>_0x1a900e[_0x3138b0(0x204)]===_0x3138b0(0x21f)&&_0x1a900e[_0x3138b0(0x245)]==='record'&&_0x1a900e[_0x3138b0(0x227)]);if(_0x45b852?.[_0x3138b0(0x227)]){const _0x4fbc08=_0x502342[_0x3138b0(0x243)](_0x2c21dc=>_0x2c21dc['name']!==_0x3138b0(0x248)&&_0x2c21dc['name']!==_0x3138b0(0x21f));return[..._0x4fbc08,..._0x45b852[_0x3138b0(0x227)]];}return _0x502342[_0x3138b0(0x243)](_0x5e58ef=>_0x5e58ef[_0x3138b0(0x204)]!=='legacy');}function printSchemaFields(_0x465c14,_0x54791a){const _0x4beb9f=a13_0x1bc0,_0x4dcab6='\x20\x20'[_0x4beb9f(0x230)](_0x54791a+0x1),_0xb32287='\x20\x20'[_0x4beb9f(0x230)](_0x54791a+0x2);for(const _0x4d2cc4 of _0x465c14){if(!_0x4d2cc4[_0x4beb9f(0x204)])continue;const _0x4d7786=_0x4d2cc4['type']===_0x4beb9f(0x233)&&_0x4d2cc4[_0x4beb9f(0x227)]&&_0x4d2cc4[_0x4beb9f(0x227)][_0x4beb9f(0x1ec)]>0x0&&_0x4d2cc4['name']!=='legacy_settings';let _0x40cbdd=''+_0x4dcab6+a13_0x32ddd2['green'](_0x4d2cc4[_0x4beb9f(0x204)]);_0x4d2cc4[_0x4beb9f(0x1f8)]&&(_0x40cbdd+=':\x20'+_0x4d2cc4[_0x4beb9f(0x1f8)]);if(_0x4d2cc4[_0x4beb9f(0x1e9)])_0x40cbdd+=a13_0x32ddd2['dim']('\x20['+_0x4d2cc4[_0x4beb9f(0x1e9)]+']');else _0x4d7786&&(_0x40cbdd+=a13_0x32ddd2[_0x4beb9f(0x212)](_0x4beb9f(0x210)));console[_0x4beb9f(0x221)](_0x40cbdd);_0x4d2cc4[_0x4beb9f(0x23e)]&&console[_0x4beb9f(0x221)](''+_0xb32287+a13_0x32ddd2[_0x4beb9f(0x212)](_0x4d2cc4[_0x4beb9f(0x23e)]));if(_0x4d2cc4['enumeration']){const _0x26d71a=_0x4d2cc4[_0x4beb9f(0x232)][_0x4beb9f(0x222)](_0x11099f=>typeof _0x11099f===_0x4beb9f(0x1dc)&&_0x4beb9f(0x22b)in _0x11099f?_0x11099f[_0x4beb9f(0x22b)]:_0x11099f)[_0x4beb9f(0x1f0)](',\x20');console['log'](_0xb32287+_0x4beb9f(0x226)+a13_0x32ddd2[_0x4beb9f(0x1de)](_0x26d71a));}_0x4d2cc4[_0x4beb9f(0x209)]!==undefined&&console['log'](_0xb32287+_0x4beb9f(0x1ed)+a13_0x32ddd2[_0x4beb9f(0x242)](String(_0x4d2cc4[_0x4beb9f(0x209)])));if(_0x4d2cc4[_0x4beb9f(0x214)]!==undefined||_0x4d2cc4[_0x4beb9f(0x20e)]!==undefined){const _0x39a4a9=_0x4d2cc4[_0x4beb9f(0x214)]!==undefined&&_0x4d2cc4[_0x4beb9f(0x20e)]!==undefined?_0x4d2cc4[_0x4beb9f(0x214)]+_0x4beb9f(0x21b)+_0x4d2cc4[_0x4beb9f(0x20e)]:_0x4d2cc4[_0x4beb9f(0x214)]!==undefined?_0x4beb9f(0x1f9)+_0x4d2cc4['minimum']:_0x4beb9f(0x1e1)+_0x4d2cc4[_0x4beb9f(0x20e)];console[_0x4beb9f(0x221)](_0xb32287+'Range:\x20'+a13_0x32ddd2[_0x4beb9f(0x242)](_0x39a4a9));}if(_0x4d2cc4[_0x4beb9f(0x236)]){const _0x5acafd=Object[_0x4beb9f(0x22e)](_0x4d2cc4[_0x4beb9f(0x236)])[_0x4beb9f(0x222)](([_0x3dec0e,_0x551d0a])=>_0x3dec0e+'='+JSON[_0x4beb9f(0x1ea)](_0x551d0a))['join'](',\x20');console[_0x4beb9f(0x221)](''+_0xb32287+a13_0x32ddd2[_0x4beb9f(0x212)](_0x4beb9f(0x22d)+_0x5acafd));}_0x4d7786&&_0x4d2cc4[_0x4beb9f(0x227)]&&printSchemaFields(_0x4d2cc4[_0x4beb9f(0x227)],_0x54791a+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x4f85fe(0x204)]=a13_0x4f85fe(0x206);[a13_0x4f85fe(0x23e)]=a13_0x4f85fe(0x23a);async[a13_0x4f85fe(0x216)](_0x3365ad){const _0x4d0c67=a13_0x4f85fe,{options:_0x32b712,tdx:_0x774427}=_0x3365ad;_0x32b712[_0x4d0c67(0x1d8)]&&console[_0x4d0c67(0x207)](_0x4d0c67(0x1da)+_0x32b712[_0x4d0c67(0x246)]);const _0x3abcf7=resolveLimit(_0x32b712[_0x4d0c67(0x244)],DEFAULT_LISTING_LIMIT),_0x2bce4f=await withSpinner('Listing\x20connections...',()=>_0x774427[_0x4d0c67(0x1f6)][_0x4d0c67(0x1fd)](),{'verbose':_0x32b712[_0x4d0c67(0x1d8)]}),_0x3126b0=_0x2bce4f[_0x4d0c67(0x1fb)];console[_0x4d0c67(0x207)](_0x4d0c67(0x1df)+_0x3126b0[_0x4d0c67(0x1ec)]+_0x4d0c67(0x1ef)+(_0x3126b0['length']!==0x1?'s':''));if(isStructuredFormat(_0x32b712)){const _0x41def7=_0x3126b0[_0x4d0c67(0x239)](0x0,_0x3abcf7);await handleSDKOutput(_0x41def7,{..._0x32b712,'limit':_0x3abcf7});}else{const _0x4af36a=_0x3126b0[_0x4d0c67(0x1ec)]>0x0?Math[_0x4d0c67(0x22c)](..._0x3126b0[_0x4d0c67(0x222)](_0x20c8c0=>_0x20c8c0[_0x4d0c67(0x245)][_0x4d0c67(0x1ec)])):0x0,_0x3ea5f3=[];for(const _0x5d2b76 of _0x3126b0){const _0x1d52d0=a13_0x32ddd2[_0x4d0c67(0x1e3)](_0x5d2b76[_0x4d0c67(0x245)]['padStart'](_0x4af36a)),_0x31426c=_0x5d2b76[_0x4d0c67(0x1f1)]?.[_0x4d0c67(0x204)]?_0x4d0c67(0x21b)+a13_0x32ddd2[_0x4d0c67(0x212)](_0x5d2b76[_0x4d0c67(0x1f1)][_0x4d0c67(0x204)]):'';_0x3ea5f3['push'](_0x1d52d0+'\x20\x20'+_0x5d2b76[_0x4d0c67(0x204)]+_0x31426c);}await writeOutput(_0x3ea5f3[_0x4d0c67(0x1f0)]('\x0a'),_0x32b712[_0x4d0c67(0x20b)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']='connection:show';[a13_0x4f85fe(0x23e)]=a13_0x4f85fe(0x235);[a13_0x4f85fe(0x1e0)](_0xa341e1){const _0x5d4fcb=a13_0x4f85fe,{args:_0x49764a}=_0xa341e1;if(!_0x49764a[0x0])return _0x5d4fcb(0x1e7);return undefined;}async['execute'](_0x3564df){const _0x1c3997=a13_0x4f85fe,{options:_0x5b86c0,args:_0x498f45,tdx:_0x182e84}=_0x3564df,_0x31cc98=_0x498f45[0x0];_0x5b86c0[_0x1c3997(0x1d8)]&&(console[_0x1c3997(0x207)](_0x1c3997(0x1da)+_0x5b86c0[_0x1c3997(0x246)]),console['error'](_0x1c3997(0x203)+_0x31cc98));const _0x1542b3=await withSpinner(_0x1c3997(0x205)+_0x31cc98+_0x1c3997(0x1ee),()=>_0x182e84['connection']['resolve'](_0x31cc98),{'verbose':_0x5b86c0[_0x1c3997(0x1d8)]}),_0x1eefb5=_0x1542b3[_0x1c3997(0x1fb)];return console[_0x1c3997(0x207)]('✔\x20Found\x20connection:\x20'+_0x1eefb5[_0x1c3997(0x204)]),await handleSingleObjectOutput(_0x1eefb5,_0x5b86c0),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x4f85fe(0x204)]=a13_0x4f85fe(0x20a);[a13_0x4f85fe(0x23e)]=a13_0x4f85fe(0x223);[a13_0x4f85fe(0x1e0)](_0x352445){const _0x2b9b0d=a13_0x4f85fe,{args:_0x56cc29}=_0x352445;if(!_0x56cc29[0x0])return _0x2b9b0d(0x21e);return undefined;}async[a13_0x4f85fe(0x216)](_0x37d89b){const _0x82f96d=a13_0x4f85fe,{options:_0x1de32b,args:_0x5985ff,tdx:_0x383988}=_0x37d89b,_0x2ed17f=_0x5985ff[0x0];_0x1de32b[_0x82f96d(0x1d8)]&&(console['error'](_0x82f96d(0x1da)+_0x1de32b['site']),console[_0x82f96d(0x207)]('Resolving\x20connector\x20type\x20or\x20name:\x20'+_0x2ed17f));let _0x1e5ae8=_0x2ed17f,_0x1be312;try{const _0x1e0c8d=await _0x383988[_0x82f96d(0x1f6)][_0x82f96d(0x218)](_0x2ed17f);_0x1e0c8d&&(_0x1e5ae8=_0x1e0c8d[_0x82f96d(0x245)],_0x1be312=_0x1e0c8d[_0x82f96d(0x204)],_0x1de32b['verbose']&&console['error'](_0x82f96d(0x23f)+_0x2ed17f+_0x82f96d(0x20c)+_0x1e5ae8));}catch{_0x1de32b['verbose']&&console[_0x82f96d(0x207)](_0x82f96d(0x1f3)+_0x2ed17f+_0x82f96d(0x1fe));}const _0x4f031c=await withSpinner(_0x82f96d(0x1eb)+_0x1e5ae8+_0x82f96d(0x1ee),()=>_0x383988['connection']['getOutputSchema'](_0x1e5ae8),{'verbose':_0x1de32b[_0x82f96d(0x1d8)]}),_0x42488a=_0x4f031c[_0x82f96d(0x1fb)];_0x1be312?console[_0x82f96d(0x207)](_0x82f96d(0x1e4)+_0x1be312+'\x27\x20(type:\x20'+_0x1e5ae8+')'):console[_0x82f96d(0x207)]('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x1e5ae8);if(isStructuredFormat(_0x1de32b))await handleSingleObjectOutput(_0x42488a,_0x1de32b);else{const _0x4de67b=normalizeSchemaForDisplay(_0x42488a);_0x1be312?(console[_0x82f96d(0x221)](_0x82f96d(0x1e6)+a13_0x32ddd2[_0x82f96d(0x1e3)](_0x1be312)),console[_0x82f96d(0x221)](_0x82f96d(0x23c)+a13_0x32ddd2[_0x82f96d(0x212)](_0x1e5ae8))):console['log'](_0x82f96d(0x201)+a13_0x32ddd2[_0x82f96d(0x1e3)](_0x1e5ae8)),_0x4de67b[_0x82f96d(0x1ec)]>0x0?(console['log'](a13_0x32ddd2[_0x82f96d(0x21a)](_0x82f96d(0x237))),printSchemaFields(_0x4de67b,0x0)):console[_0x82f96d(0x221)](a13_0x32ddd2['dim'](_0x82f96d(0x1e8)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a13_0x4f85fe(0x249);['description']=a13_0x4f85fe(0x225);async['execute'](_0x2c756b){const _0xfd5831=a13_0x4f85fe,{options:_0x524f2e,tdx:_0x1e54c7}=_0x2c756b;_0x524f2e[_0xfd5831(0x1d8)]&&console['error'](_0xfd5831(0x1da)+_0x524f2e[_0xfd5831(0x246)]);const _0x36bbed=await withSpinner(_0xfd5831(0x229),()=>_0x1e54c7[_0xfd5831(0x1f6)]['listTypes'](),{'verbose':_0x524f2e['verbose']}),_0x11f0a6=_0x36bbed['data'][_0xfd5831(0x1f7)]((_0xd2f3b7,_0x1d54e9)=>_0xd2f3b7[_0xfd5831(0x245)][_0xfd5831(0x20d)](_0x1d54e9[_0xfd5831(0x245)]));console[_0xfd5831(0x207)]('✔\x20Found\x20'+_0x11f0a6[_0xfd5831(0x1ec)]+_0xfd5831(0x1fc)+(_0x11f0a6[_0xfd5831(0x1ec)]!==0x1?'s':''));if(isStructuredFormat(_0x524f2e))await handleSDKOutput(_0x11f0a6,_0x524f2e);else{const _0x3ba7ff=_0x11f0a6[_0xfd5831(0x1ec)]>0x0?Math[_0xfd5831(0x22c)](..._0x11f0a6['map'](_0x31fc2=>_0x31fc2['type'][_0xfd5831(0x1ec)])):0x0,_0x5dd6e5=[];for(const _0x15df9a of _0x11f0a6){const _0x24116c=a13_0x32ddd2[_0xfd5831(0x1e3)](_0x15df9a['type'][_0xfd5831(0x22a)](_0x3ba7ff));_0x5dd6e5[_0xfd5831(0x217)](_0x24116c+'\x20\x20'+_0x15df9a['name']);}await writeOutput(_0x5dd6e5[_0xfd5831(0x1f0)]('\x0a'),_0x524f2e[_0xfd5831(0x20b)],'table');}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{['name']=a13_0x4f85fe(0x1fa);[a13_0x4f85fe(0x23e)]=a13_0x4f85fe(0x200);[a13_0x4f85fe(0x1e0)](_0x5e583b){const _0xec7eb8=a13_0x4f85fe,{args:_0x1ecdc0}=_0x5e583b;if(!_0x1ecdc0[0x0])return _0xec7eb8(0x23b);return undefined;}async[a13_0x4f85fe(0x216)](_0x103459){const _0x2c9fc0=a13_0x4f85fe,{options:_0x58c209,args:_0x2195e1,tdx:_0x58e696}=_0x103459,_0x4f89e9=_0x2195e1[0x0];_0x58c209['verbose']&&(console[_0x2c9fc0(0x207)]('Site:\x20'+_0x58c209['site']),console['error'](_0x2c9fc0(0x1d9)+_0x4f89e9));const _0x732065=await withSpinner(_0x2c9fc0(0x247)+_0x4f89e9+_0x2c9fc0(0x1ee),()=>_0x58e696[_0x2c9fc0(0x1f6)][_0x2c9fc0(0x238)](_0x4f89e9),{'verbose':_0x58c209[_0x2c9fc0(0x1d8)]}),_0x44fa4b=_0x732065['data'];console[_0x2c9fc0(0x207)](_0x2c9fc0(0x1dd)+_0x4f89e9);if(isStructuredFormat(_0x58c209))await handleSingleObjectOutput(_0x44fa4b,_0x58c209);else{console[_0x2c9fc0(0x221)]('\x0aConnector:\x20'+a13_0x32ddd2[_0x2c9fc0(0x1e3)](_0x4f89e9)),console['log'](_0x2c9fc0(0x20f)+_0x44fa4b[_0x2c9fc0(0x204)]);const _0x2f8009=_0x44fa4b[_0x2c9fc0(0x1f4)]||[],_0x35f9b8=_0x2f8009[_0x2c9fc0(0x243)](_0x2fa97c=>_0x2fa97c[_0x2c9fc0(0x219)]);_0x35f9b8[_0x2c9fc0(0x1ec)]>0x0&&(console[_0x2c9fc0(0x221)](a13_0x32ddd2[_0x2c9fc0(0x21a)](_0x2c9fc0(0x224))),printMetadataSettings(_0x35f9b8));let _0x193940=![];try{const _0x25695a=await _0x58e696[_0x2c9fc0(0x1f6)][_0x2c9fc0(0x24a)](_0x4f89e9),_0x14bc0c=normalizeSchemaForDisplay(_0x25695a);_0x14bc0c[_0x2c9fc0(0x1ec)]>0x0&&(console[_0x2c9fc0(0x221)](a13_0x32ddd2['bold'](_0x2c9fc0(0x237))),printSchemaFields(_0x14bc0c,0x0),_0x193940=!![]);}catch{const _0x36ffb5=_0x2f8009[_0x2c9fc0(0x243)](_0x4115f7=>!_0x4115f7['credential']);_0x36ffb5['length']>0x0&&(console[_0x2c9fc0(0x221)](a13_0x32ddd2['bold'](_0x2c9fc0(0x237))),printMetadataSettings(_0x36ffb5),_0x193940=!![]);}!_0x193940&&_0x58c209['verbose']&&console['error'](a13_0x32ddd2[_0x2c9fc0(0x212)](_0x2c9fc0(0x22f))),_0x35f9b8[_0x2c9fc0(0x1ec)]===0x0&&console[_0x2c9fc0(0x221)](a13_0x32ddd2[_0x2c9fc0(0x212)](_0x2c9fc0(0x220)));}return 0x0;}}function printMetadataSettings(_0x1d93dd){const _0x1d2347=a13_0x4f85fe;for(const _0x415cf2 of _0x1d93dd){if(!_0x415cf2['name'])continue;if(_0x415cf2[_0x1d2347(0x228)])continue;let _0x1a9561='\x20\x20'+a13_0x32ddd2['green'](_0x415cf2[_0x1d2347(0x204)]);_0x415cf2['label']&&(_0x1a9561+=':\x20'+_0x415cf2[_0x1d2347(0x240)]);_0x415cf2[_0x1d2347(0x245)]&&(_0x1a9561+=a13_0x32ddd2['dim']('\x20['+_0x415cf2[_0x1d2347(0x245)]+']'));console[_0x1d2347(0x221)](_0x1a9561);_0x415cf2['hint']&&console[_0x1d2347(0x221)](_0x1d2347(0x1e2)+a13_0x32ddd2[_0x1d2347(0x212)](_0x415cf2[_0x1d2347(0x211)]));if(_0x415cf2[_0x1d2347(0x202)]){const _0x2d105d=_0x415cf2['options']['map'](_0x3f1df8=>_0x3f1df8[_0x1d2347(0x22b)])[_0x1d2347(0x1f0)](',\x20');console[_0x1d2347(0x221)](_0x1d2347(0x1db)+a13_0x32ddd2['yellow'](_0x2d105d));}_0x415cf2[_0x1d2347(0x209)]!==undefined&&_0x415cf2[_0x1d2347(0x209)]!==null&&console['log'](_0x1d2347(0x21d)+a13_0x32ddd2[_0x1d2347(0x242)](String(_0x415cf2[_0x1d2347(0x209)])));if(_0x415cf2[_0x1d2347(0x236)]){const _0x31375f=Object[_0x1d2347(0x22e)](_0x415cf2[_0x1d2347(0x236)])[_0x1d2347(0x222)](([_0x54cf4b,_0x76b566])=>_0x54cf4b+'='+JSON[_0x1d2347(0x1ea)](_0x76b566))[_0x1d2347(0x1f0)](',\x20');console[_0x1d2347(0x221)](_0x1d2347(0x1e2)+a13_0x32ddd2[_0x1d2347(0x212)]('Show\x20when:\x20'+_0x31375f));}}}
1
+ const a13_0x653424=a13_0x5207;(function(_0x15b384,_0x407907){const _0x59c24c=a13_0x5207,_0x29b312=_0x15b384();while(!![]){try{const _0x9ad15e=parseInt(_0x59c24c(0x1a8))/0x1+parseInt(_0x59c24c(0x1b5))/0x2+-parseInt(_0x59c24c(0x15a))/0x3*(-parseInt(_0x59c24c(0x17b))/0x4)+-parseInt(_0x59c24c(0x1ac))/0x5+-parseInt(_0x59c24c(0x15b))/0x6+parseInt(_0x59c24c(0x189))/0x7*(-parseInt(_0x59c24c(0x175))/0x8)+parseInt(_0x59c24c(0x182))/0x9;if(_0x9ad15e===_0x407907)break;else _0x29b312['push'](_0x29b312['shift']());}catch(_0x404e12){_0x29b312['push'](_0x29b312['shift']());}}}(a13_0x2d31,0x80dbf));import{BaseCommand}from'./command.js';function a13_0x5207(_0x352caf,_0xd261f3){_0x352caf=_0x352caf-0x156;const _0x2d315d=a13_0x2d31();let _0x520710=_0x2d315d[_0x352caf];return _0x520710;}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';import a13_0x120d1a from'chalk';function a13_0x2d31(){const _0x5c790c=['Treating\x20\x27','Fetching\x20schema\x20for\x20\x27','map','execute','\x20\x20\x20\x20Default:\x20','legacy','Show\x20when:\x20','resolve','site','output','✔\x20Resolved\x20\x27','Range:\x20','bold','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\x20settings\x20for\x20\x27','getMetadata','type','limit','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','>=\x20','Fetching\x20settings\x20for\x20connector\x20type:\x20','criteria','Listing\x20connector\x20types...','title','\x0aAvailable\x20fields:','647232iMfDoD','Show\x20connection\x20details','stringify','repeat','338990gSmNzS','connection:types','properties','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','connection:schema','✔\x20Found\x20schema\x20for\x20connection\x20\x27','Site:\x20','✔\x20Found\x20','\x20connector\x20type','397468HaUGYy','Resolving\x20connector\x20type\x20or\x20name:\x20','Type:\x20','<=\x20','minimum','Name:\x20','validate','\x0aNo\x20credential\x20settings\x20defined','verbose','entries','hint','legacy_settings','List\x20all\x20result\x20output\x20connections','getOutputSchema','push','dim','hidden','connection:show','list','930141MegHPA','5964858XBhRvp','record','owner','default_value','\x0aNo\x20fields\x20defined\x20in\x20schema','✔\x20Found\x20connection:\x20','error','description','green','\x27...','credential','object','options','name','\x0aCredential\x20settings:','find','connection:list','cyan','\x20[record]','connection','table','localeCompare','join','Default:\x20','input','sort','62504roFMtJ','length','padStart','yellow','max','slice','12sPvDVM','value','Listing\x20connections...','filter','data','\x27\x20(type:\x20','enumeration','1346400kZQSWA','maximum','\x20\x20\x20\x20','blue','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','\x20-\x20','listTypes','301AXDhck','Looking\x20up\x20connection:\x20','log','\x0aConnector:\x20','\x0aConnection:\x20','findByName'];a13_0x2d31=function(){return _0x5c790c;};return a13_0x2d31();}function normalizeSchemaForDisplay(_0x11ce9f){const _0x449719=a13_0x5207,_0x5d4f45=_0x11ce9f[_0x449719(0x1ae)]||[],_0xb72c22=_0x5d4f45[_0x449719(0x16a)](_0x33bc9e=>_0x33bc9e[_0x449719(0x168)]===_0x449719(0x1c0)&&_0x33bc9e[_0x449719(0x19f)]===_0x449719(0x15c)&&_0x33bc9e[_0x449719(0x1ae)]);if(_0xb72c22?.[_0x449719(0x1ae)]){const _0x55f9c8=_0x5d4f45['filter'](_0x3a271f=>_0x3a271f[_0x449719(0x168)]!==_0x449719(0x194)&&_0x3a271f['name']!==_0x449719(0x1c0));return[..._0x55f9c8,..._0xb72c22[_0x449719(0x1ae)]];}return _0x5d4f45[_0x449719(0x17e)](_0x5e4066=>_0x5e4066[_0x449719(0x168)]!==_0x449719(0x194));}function printSchemaFields(_0x22881c,_0x161952){const _0x4c3abd=a13_0x5207,_0x54fffe='\x20\x20'[_0x4c3abd(0x1ab)](_0x161952+0x1),_0x1380ea='\x20\x20'['repeat'](_0x161952+0x2);for(const _0x3218e6 of _0x22881c){if(!_0x3218e6[_0x4c3abd(0x168)])continue;const _0x1a569a=_0x3218e6[_0x4c3abd(0x19f)]===_0x4c3abd(0x15c)&&_0x3218e6[_0x4c3abd(0x1ae)]&&_0x3218e6['properties'][_0x4c3abd(0x176)]>0x0&&_0x3218e6['name']!==_0x4c3abd(0x1c0);let _0x2a93e8=''+_0x54fffe+a13_0x120d1a['green'](_0x3218e6['name']);_0x3218e6[_0x4c3abd(0x1a6)]&&(_0x2a93e8+=':\x20'+_0x3218e6[_0x4c3abd(0x1a6)]);if(_0x3218e6[_0x4c3abd(0x173)])_0x2a93e8+=a13_0x120d1a['dim']('\x20['+_0x3218e6[_0x4c3abd(0x173)]+']');else _0x1a569a&&(_0x2a93e8+=a13_0x120d1a[_0x4c3abd(0x156)](_0x4c3abd(0x16d)));console['log'](_0x2a93e8);_0x3218e6[_0x4c3abd(0x162)]&&console[_0x4c3abd(0x18b)](''+_0x1380ea+a13_0x120d1a[_0x4c3abd(0x156)](_0x3218e6[_0x4c3abd(0x162)]));if(_0x3218e6[_0x4c3abd(0x181)]){const _0x2601ee=_0x3218e6['enumeration'][_0x4c3abd(0x191)](_0x2d5b88=>typeof _0x2d5b88===_0x4c3abd(0x166)&&_0x4c3abd(0x17c)in _0x2d5b88?_0x2d5b88[_0x4c3abd(0x17c)]:_0x2d5b88)[_0x4c3abd(0x171)](',\x20');console[_0x4c3abd(0x18b)](_0x1380ea+'Options:\x20'+a13_0x120d1a[_0x4c3abd(0x178)](_0x2601ee));}_0x3218e6['default_value']!==undefined&&console[_0x4c3abd(0x18b)](_0x1380ea+_0x4c3abd(0x172)+a13_0x120d1a[_0x4c3abd(0x185)](String(_0x3218e6['default_value'])));if(_0x3218e6['minimum']!==undefined||_0x3218e6[_0x4c3abd(0x183)]!==undefined){const _0x2bce3d=_0x3218e6[_0x4c3abd(0x1b9)]!==undefined&&_0x3218e6[_0x4c3abd(0x183)]!==undefined?_0x3218e6[_0x4c3abd(0x1b9)]+_0x4c3abd(0x187)+_0x3218e6[_0x4c3abd(0x183)]:_0x3218e6[_0x4c3abd(0x1b9)]!==undefined?_0x4c3abd(0x1a2)+_0x3218e6[_0x4c3abd(0x1b9)]:_0x4c3abd(0x1b8)+_0x3218e6[_0x4c3abd(0x183)];console[_0x4c3abd(0x18b)](_0x1380ea+_0x4c3abd(0x19a)+a13_0x120d1a[_0x4c3abd(0x185)](_0x2bce3d));}if(_0x3218e6[_0x4c3abd(0x1a4)]){const _0x5c194c=Object[_0x4c3abd(0x1be)](_0x3218e6[_0x4c3abd(0x1a4)])['map'](([_0xafbd72,_0x196aef])=>_0xafbd72+'='+JSON[_0x4c3abd(0x1aa)](_0x196aef))[_0x4c3abd(0x171)](',\x20');console[_0x4c3abd(0x18b)](''+_0x1380ea+a13_0x120d1a[_0x4c3abd(0x156)](_0x4c3abd(0x195)+_0x5c194c));}_0x1a569a&&_0x3218e6[_0x4c3abd(0x1ae)]&&printSchemaFields(_0x3218e6[_0x4c3abd(0x1ae)],_0x161952+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x653424(0x168)]=a13_0x653424(0x16b);['description']=a13_0x653424(0x1c1);async[a13_0x653424(0x192)](_0x475fc6){const _0x25c9dc=a13_0x653424,{options:_0x3cb429,tdx:_0xcb6abf}=_0x475fc6;_0x3cb429[_0x25c9dc(0x1bd)]&&console[_0x25c9dc(0x161)]('Site:\x20'+_0x3cb429['site']);const _0x5c7af9=resolveLimit(_0x3cb429[_0x25c9dc(0x1a0)],DEFAULT_LISTING_LIMIT),_0x47ab97=await withSpinner(_0x25c9dc(0x17d),()=>_0xcb6abf['connection'][_0x25c9dc(0x159)](),{'verbose':_0x3cb429[_0x25c9dc(0x1bd)]}),_0x1d6d2a=_0x47ab97['data'];console[_0x25c9dc(0x161)](_0x25c9dc(0x1b3)+_0x1d6d2a['length']+'\x20connection'+(_0x1d6d2a['length']!==0x1?'s':''));if(isStructuredFormat(_0x3cb429)){const _0x598d0f=_0x1d6d2a[_0x25c9dc(0x17a)](0x0,_0x5c7af9);await handleSDKOutput(_0x598d0f,{..._0x3cb429,'limit':_0x5c7af9});}else{const _0x5eb00d=_0x1d6d2a[_0x25c9dc(0x176)]>0x0?Math[_0x25c9dc(0x179)](..._0x1d6d2a[_0x25c9dc(0x191)](_0x53233f=>_0x53233f['type'][_0x25c9dc(0x176)])):0x0,_0x18f7a8=[];for(const _0x4f3970 of _0x1d6d2a){const _0x525bbd=a13_0x120d1a['cyan'](_0x4f3970[_0x25c9dc(0x19f)][_0x25c9dc(0x177)](_0x5eb00d)),_0x5ce75c=_0x4f3970[_0x25c9dc(0x15d)]?.[_0x25c9dc(0x168)]?_0x25c9dc(0x187)+a13_0x120d1a[_0x25c9dc(0x156)](_0x4f3970[_0x25c9dc(0x15d)][_0x25c9dc(0x168)]):'';_0x18f7a8[_0x25c9dc(0x1c3)](_0x525bbd+'\x20\x20'+_0x4f3970['name']+_0x5ce75c);}await writeOutput(_0x18f7a8['join']('\x0a'),_0x3cb429[_0x25c9dc(0x198)],_0x25c9dc(0x16f));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x653424(0x168)]=a13_0x653424(0x158);[a13_0x653424(0x162)]=a13_0x653424(0x1a9);[a13_0x653424(0x1bb)](_0x112984){const _0x28ff7f=a13_0x653424,{args:_0x3c46a9}=_0x112984;if(!_0x3c46a9[0x0])return _0x28ff7f(0x186);return undefined;}async[a13_0x653424(0x192)](_0xaa6aed){const _0x1c7932=a13_0x653424,{options:_0x3fa9fa,args:_0x1e0567,tdx:_0x4a9389}=_0xaa6aed,_0x49927b=_0x1e0567[0x0];_0x3fa9fa[_0x1c7932(0x1bd)]&&(console[_0x1c7932(0x161)]('Site:\x20'+_0x3fa9fa[_0x1c7932(0x197)]),console[_0x1c7932(0x161)](_0x1c7932(0x18a)+_0x49927b));const _0x93bd88=await withSpinner('Fetching\x20connection\x20\x27'+_0x49927b+_0x1c7932(0x164),()=>_0x4a9389[_0x1c7932(0x16e)][_0x1c7932(0x196)](_0x49927b),{'verbose':_0x3fa9fa[_0x1c7932(0x1bd)]}),_0x8ad681=_0x93bd88[_0x1c7932(0x17f)];return console[_0x1c7932(0x161)](_0x1c7932(0x160)+_0x8ad681[_0x1c7932(0x168)]),await handleSingleObjectOutput(_0x8ad681,_0x3fa9fa),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a13_0x653424(0x1b0);[a13_0x653424(0x162)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';[a13_0x653424(0x1bb)](_0x76aaa1){const {args:_0x595c53}=_0x76aaa1;if(!_0x595c53[0x0])return'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.';return undefined;}async[a13_0x653424(0x192)](_0x4f5605){const _0x611bcd=a13_0x653424,{options:_0x1585ff,args:_0x33c441,tdx:_0x571d25}=_0x4f5605,_0x4796b6=_0x33c441[0x0];_0x1585ff[_0x611bcd(0x1bd)]&&(console[_0x611bcd(0x161)](_0x611bcd(0x1b2)+_0x1585ff['site']),console['error'](_0x611bcd(0x1b6)+_0x4796b6));let _0x3f1fc4=_0x4796b6,_0x109ef8;try{const _0x3c5714=await _0x571d25[_0x611bcd(0x16e)][_0x611bcd(0x18e)](_0x4796b6);_0x3c5714&&(_0x3f1fc4=_0x3c5714[_0x611bcd(0x19f)],_0x109ef8=_0x3c5714[_0x611bcd(0x168)],_0x1585ff[_0x611bcd(0x1bd)]&&console[_0x611bcd(0x161)](_0x611bcd(0x199)+_0x4796b6+_0x611bcd(0x1af)+_0x3f1fc4));}catch{_0x1585ff[_0x611bcd(0x1bd)]&&console[_0x611bcd(0x161)](_0x611bcd(0x18f)+_0x4796b6+'\x27\x20as\x20connector\x20type');}const _0x262bfb=await withSpinner(_0x611bcd(0x190)+_0x3f1fc4+'\x27...',()=>_0x571d25[_0x611bcd(0x16e)][_0x611bcd(0x1c2)](_0x3f1fc4),{'verbose':_0x1585ff['verbose']}),_0x4d53ad=_0x262bfb['data'];_0x109ef8?console[_0x611bcd(0x161)](_0x611bcd(0x1b1)+_0x109ef8+_0x611bcd(0x180)+_0x3f1fc4+')'):console['error']('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x3f1fc4);if(isStructuredFormat(_0x1585ff))await handleSingleObjectOutput(_0x4d53ad,_0x1585ff);else{const _0x34c287=normalizeSchemaForDisplay(_0x4d53ad);_0x109ef8?(console[_0x611bcd(0x18b)](_0x611bcd(0x18d)+a13_0x120d1a[_0x611bcd(0x16c)](_0x109ef8)),console[_0x611bcd(0x18b)](_0x611bcd(0x1b7)+a13_0x120d1a[_0x611bcd(0x156)](_0x3f1fc4))):console[_0x611bcd(0x18b)](_0x611bcd(0x18c)+a13_0x120d1a[_0x611bcd(0x16c)](_0x3f1fc4)),_0x34c287[_0x611bcd(0x176)]>0x0?(console['log'](a13_0x120d1a['bold'](_0x611bcd(0x1a7))),printSchemaFields(_0x34c287,0x0)):console['log'](a13_0x120d1a[_0x611bcd(0x156)](_0x611bcd(0x15f)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x653424(0x168)]=a13_0x653424(0x1ad);[a13_0x653424(0x162)]='List\x20available\x20connector\x20types';async[a13_0x653424(0x192)](_0x418f15){const _0x5e9125=a13_0x653424,{options:_0x57a959,tdx:_0x3d6b6c}=_0x418f15;_0x57a959['verbose']&&console['error']('Site:\x20'+_0x57a959[_0x5e9125(0x197)]);const _0x48b387=await withSpinner(_0x5e9125(0x1a5),()=>_0x3d6b6c[_0x5e9125(0x16e)][_0x5e9125(0x188)](),{'verbose':_0x57a959[_0x5e9125(0x1bd)]}),_0x4e84ad=_0x48b387[_0x5e9125(0x17f)][_0x5e9125(0x174)]((_0x387c40,_0x16302c)=>_0x387c40['type'][_0x5e9125(0x170)](_0x16302c[_0x5e9125(0x19f)]));console[_0x5e9125(0x161)]('✔\x20Found\x20'+_0x4e84ad[_0x5e9125(0x176)]+_0x5e9125(0x1b4)+(_0x4e84ad[_0x5e9125(0x176)]!==0x1?'s':''));if(isStructuredFormat(_0x57a959))await handleSDKOutput(_0x4e84ad,_0x57a959);else{const _0x443366=_0x4e84ad[_0x5e9125(0x176)]>0x0?Math['max'](..._0x4e84ad['map'](_0x36783d=>_0x36783d[_0x5e9125(0x19f)][_0x5e9125(0x176)])):0x0,_0x24b721=[];for(const _0x758452 of _0x4e84ad){const _0x3628da=a13_0x120d1a['cyan'](_0x758452[_0x5e9125(0x19f)][_0x5e9125(0x177)](_0x443366));_0x24b721[_0x5e9125(0x1c3)](_0x3628da+'\x20\x20'+_0x758452[_0x5e9125(0x168)]);}await writeOutput(_0x24b721[_0x5e9125(0x171)]('\x0a'),_0x57a959[_0x5e9125(0x198)],'table');}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x653424(0x168)]='connection:settings';['description']=a13_0x653424(0x1a1);[a13_0x653424(0x1bb)](_0x1c58d2){const _0x106c0f=a13_0x653424,{args:_0x27e3f7}=_0x1c58d2;if(!_0x27e3f7[0x0])return _0x106c0f(0x19c);return undefined;}async[a13_0x653424(0x192)](_0x378ab6){const _0x3630b9=a13_0x653424,{options:_0x5dcfa3,args:_0x3fbae9,tdx:_0x484a6f}=_0x378ab6,_0x240a10=_0x3fbae9[0x0];_0x5dcfa3['verbose']&&(console[_0x3630b9(0x161)]('Site:\x20'+_0x5dcfa3['site']),console[_0x3630b9(0x161)](_0x3630b9(0x1a3)+_0x240a10));const _0x32aa89=await withSpinner(_0x3630b9(0x19d)+_0x240a10+_0x3630b9(0x164),()=>_0x484a6f[_0x3630b9(0x16e)][_0x3630b9(0x19e)](_0x240a10),{'verbose':_0x5dcfa3['verbose']}),_0xa2b421=_0x32aa89['data'];console[_0x3630b9(0x161)]('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x240a10);if(isStructuredFormat(_0x5dcfa3))await handleSingleObjectOutput(_0xa2b421,_0x5dcfa3);else{console['log']('\x0aConnector:\x20'+a13_0x120d1a[_0x3630b9(0x16c)](_0x240a10)),console[_0x3630b9(0x18b)](_0x3630b9(0x1ba)+_0xa2b421[_0x3630b9(0x168)]);const _0x527a76=_0xa2b421['settings']||[],_0x16cecf=_0x527a76[_0x3630b9(0x17e)](_0x4d7437=>_0x4d7437[_0x3630b9(0x165)]);_0x16cecf['length']>0x0&&(console['log'](a13_0x120d1a['bold'](_0x3630b9(0x169))),printMetadataSettings(_0x16cecf));let _0x33582c=![];try{const _0x456dc5=await _0x484a6f[_0x3630b9(0x16e)][_0x3630b9(0x1c2)](_0x240a10),_0x5eb5bb=normalizeSchemaForDisplay(_0x456dc5);_0x5eb5bb[_0x3630b9(0x176)]>0x0&&(console[_0x3630b9(0x18b)](a13_0x120d1a[_0x3630b9(0x19b)](_0x3630b9(0x1a7))),printSchemaFields(_0x5eb5bb,0x0),_0x33582c=!![]);}catch{const _0x5df902=_0x527a76[_0x3630b9(0x17e)](_0x1eb8b5=>!_0x1eb8b5[_0x3630b9(0x165)]);_0x5df902[_0x3630b9(0x176)]>0x0&&(console[_0x3630b9(0x18b)](a13_0x120d1a[_0x3630b9(0x19b)](_0x3630b9(0x1a7))),printMetadataSettings(_0x5df902),_0x33582c=!![]);}!_0x33582c&&_0x5dcfa3[_0x3630b9(0x1bd)]&&console[_0x3630b9(0x161)](a13_0x120d1a['dim']('No\x20available\x20fields\x20for\x20this\x20connector')),_0x16cecf['length']===0x0&&console[_0x3630b9(0x18b)](a13_0x120d1a[_0x3630b9(0x156)](_0x3630b9(0x1bc)));}return 0x0;}}function printMetadataSettings(_0x1a3284){const _0x16e528=a13_0x653424;for(const _0x5f31dc of _0x1a3284){if(!_0x5f31dc['name'])continue;if(_0x5f31dc[_0x16e528(0x157)])continue;let _0x4f64bf='\x20\x20'+a13_0x120d1a[_0x16e528(0x163)](_0x5f31dc[_0x16e528(0x168)]);_0x5f31dc['label']&&(_0x4f64bf+=':\x20'+_0x5f31dc['label']);_0x5f31dc[_0x16e528(0x19f)]&&(_0x4f64bf+=a13_0x120d1a['dim']('\x20['+_0x5f31dc['type']+']'));console['log'](_0x4f64bf);_0x5f31dc['hint']&&console[_0x16e528(0x18b)](_0x16e528(0x184)+a13_0x120d1a[_0x16e528(0x156)](_0x5f31dc[_0x16e528(0x1bf)]));if(_0x5f31dc['options']){const _0x52f1e7=_0x5f31dc[_0x16e528(0x167)]['map'](_0x147de9=>_0x147de9[_0x16e528(0x17c)])[_0x16e528(0x171)](',\x20');console['log']('\x20\x20\x20\x20Options:\x20'+a13_0x120d1a[_0x16e528(0x178)](_0x52f1e7));}_0x5f31dc[_0x16e528(0x15e)]!==undefined&&_0x5f31dc['default_value']!==null&&console[_0x16e528(0x18b)](_0x16e528(0x193)+a13_0x120d1a['blue'](String(_0x5f31dc[_0x16e528(0x15e)])));if(_0x5f31dc[_0x16e528(0x1a4)]){const _0x5b9745=Object[_0x16e528(0x1be)](_0x5f31dc['criteria'])[_0x16e528(0x191)](([_0x18e047,_0x139a6a])=>_0x18e047+'='+JSON[_0x16e528(0x1aa)](_0x139a6a))[_0x16e528(0x171)](',\x20');console[_0x16e528(0x18b)](_0x16e528(0x184)+a13_0x120d1a['dim'](_0x16e528(0x195)+_0x5b9745));}}}
@@ -1 +1 @@
1
- const a14_0x4d07d7=a14_0x243f;(function(_0xa8c0d5,_0x4bce9c){const _0x5edb5e=a14_0x243f,_0x546c6d=_0xa8c0d5();while(!![]){try{const _0x1a048a=parseInt(_0x5edb5e(0xbf))/0x1+-parseInt(_0x5edb5e(0xbe))/0x2*(parseInt(_0x5edb5e(0xc3))/0x3)+parseInt(_0x5edb5e(0xc0))/0x4+parseInt(_0x5edb5e(0xbb))/0x5*(parseInt(_0x5edb5e(0xba))/0x6)+-parseInt(_0x5edb5e(0xc7))/0x7+-parseInt(_0x5edb5e(0xbd))/0x8+parseInt(_0x5edb5e(0xb6))/0x9;if(_0x1a048a===_0x4bce9c)break;else _0x546c6d['push'](_0x546c6d['shift']());}catch(_0x1bf9a5){_0x546c6d['push'](_0x546c6d['shift']());}}}(a14_0x2cbe,0xa0e8f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a14_0x243f(_0x1eba24,_0x11d124){_0x1eba24=_0x1eba24-0xb0;const _0x2cbe8f=a14_0x2cbe();let _0x243f5e=_0x2cbe8f[_0x1eba24];return _0x243f5e;}import{withSpinner}from'../utils/spinner.js';function a14_0x2cbe(){const _0x50a938=['\x20\x20Cause:\x20','name','Pattern:\x20','listDatabases','error','List\x20all\x20databases','21709125KwdfTC','site','execute','Error:\x20','483078NzKbGK','5BFawvX','message','2879720YEuHBV','8GnPCOA','135306BvsPWp','160432urjKUN','query','length','846807YzSoux','databases','Listing\x20databases...','✔\x20Found\x20','3639468nECgkU','verbose'];a14_0x2cbe=function(){return _0x50a938;};return a14_0x2cbe();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0x4d07d7(0xb1)]=a14_0x4d07d7(0xc4);['description']=a14_0x4d07d7(0xb5);async[a14_0x4d07d7(0xb8)](_0x3066c2){const _0x5de28b=a14_0x4d07d7,{options:_0x1323a2,args:_0xff6033,tdx:_0xc70b45}=_0x3066c2,_0x398b60=_0xff6033[0x0];try{_0x1323a2[_0x5de28b(0xc8)]&&(console['error']('Site:\x20'+_0x1323a2[_0x5de28b(0xb7)]),_0x398b60&&console[_0x5de28b(0xb4)](_0x5de28b(0xb2)+_0x398b60));const _0x1b7b4f=resolveLimit(_0x1323a2['limit'],DEFAULT_LISTING_LIMIT),_0x21c380=await withSpinner(_0x5de28b(0xc5),()=>_0xc70b45[_0x5de28b(0xc1)][_0x5de28b(0xb3)](_0x398b60,_0x1b7b4f),{'verbose':_0x1323a2[_0x5de28b(0xc8)]}),_0xae3d1e=_0x21c380['data'];return console['error'](_0x5de28b(0xc6)+_0xae3d1e['length']+'\x20database'+(_0xae3d1e[_0x5de28b(0xc2)]!==0x1?'s':'')),await handleSDKOutput(_0xae3d1e,{..._0x1323a2,'limit':_0x1b7b4f}),0x0;}catch(_0x53cb2d){if(_0x53cb2d instanceof SDKError)return console[_0x5de28b(0xb4)](_0x5de28b(0xb9)+_0x53cb2d[_0x5de28b(0xbc)]),_0x53cb2d['cause']&&console['error'](_0x5de28b(0xb0)+_0x53cb2d['cause']),0x1;throw _0x53cb2d;}}}
1
+ const a14_0x56fa80=a14_0x3b1c;(function(_0x53819c,_0x2f8cf0){const _0x3a818b=a14_0x3b1c,_0x53edc2=_0x53819c();while(!![]){try{const _0x150705=-parseInt(_0x3a818b(0x1d1))/0x1+parseInt(_0x3a818b(0x1d8))/0x2+parseInt(_0x3a818b(0x1cb))/0x3*(parseInt(_0x3a818b(0x1d4))/0x4)+parseInt(_0x3a818b(0x1e1))/0x5+-parseInt(_0x3a818b(0x1dd))/0x6*(parseInt(_0x3a818b(0x1e2))/0x7)+parseInt(_0x3a818b(0x1e6))/0x8*(-parseInt(_0x3a818b(0x1da))/0x9)+parseInt(_0x3a818b(0x1e0))/0xa*(parseInt(_0x3a818b(0x1ce))/0xb);if(_0x150705===_0x2f8cf0)break;else _0x53edc2['push'](_0x53edc2['shift']());}catch(_0x2fe861){_0x53edc2['push'](_0x53edc2['shift']());}}}(a14_0x1f2e,0x57e39));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_0x1f2e(){const _0x21a18c=['Pattern:\x20','2260ygBQhc','217710WiAqpJ','24521ELAPbR','verbose','Error:\x20','List\x20all\x20databases','4309912ssnwHP','Listing\x20databases...','25515OUiVnO','name','length','13266yeMlDt','Site:\x20','data','165576sxJvjO','error','listDatabases','216YCibJi','limit','cause','description','795066vkHPmL','query','9FgwpEm','message','\x20database','186PJvcNF','databases'];a14_0x1f2e=function(){return _0x21a18c;};return a14_0x1f2e();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a14_0x3b1c(_0x1ff962,_0x4a83b2){_0x1ff962=_0x1ff962-0x1cb;const _0x1f2ea3=a14_0x1f2e();let _0x3b1c81=_0x1f2ea3[_0x1ff962];return _0x3b1c81;}export class DatabasesCommand extends BaseCommand{[a14_0x56fa80(0x1cc)]=a14_0x56fa80(0x1de);[a14_0x56fa80(0x1d7)]=a14_0x56fa80(0x1e5);async['execute'](_0x18a186){const _0x571663=a14_0x56fa80,{options:_0x54faa9,args:_0x5f3276,tdx:_0x3a7848}=_0x18a186,_0x45de8c=_0x5f3276[0x0];try{_0x54faa9[_0x571663(0x1e3)]&&(console['error'](_0x571663(0x1cf)+_0x54faa9['site']),_0x45de8c&&console[_0x571663(0x1d2)](_0x571663(0x1df)+_0x45de8c));const _0xb63b1=resolveLimit(_0x54faa9[_0x571663(0x1d5)],DEFAULT_LISTING_LIMIT),_0x51c2f0=await withSpinner(_0x571663(0x1e7),()=>_0x3a7848[_0x571663(0x1d9)][_0x571663(0x1d3)](_0x45de8c,_0xb63b1),{'verbose':_0x54faa9['verbose']}),_0x265e22=_0x51c2f0[_0x571663(0x1d0)];return console[_0x571663(0x1d2)]('✔\x20Found\x20'+_0x265e22['length']+_0x571663(0x1dc)+(_0x265e22[_0x571663(0x1cd)]!==0x1?'s':'')),await handleSDKOutput(_0x265e22,{..._0x54faa9,'limit':_0xb63b1}),0x0;}catch(_0x10b2a5){if(_0x10b2a5 instanceof SDKError)return console[_0x571663(0x1d2)](_0x571663(0x1e4)+_0x10b2a5[_0x571663(0x1db)]),_0x10b2a5[_0x571663(0x1d6)]&&console[_0x571663(0x1d2)]('\x20\x20Cause:\x20'+_0x10b2a5[_0x571663(0x1d6)]),0x1;throw _0x10b2a5;}}}
@@ -1 +1 @@
1
- const a15_0x3b630b=a15_0x6661;(function(_0x5dae58,_0x2f4a2f){const _0x3f9a81=a15_0x6661,_0x59ce85=_0x5dae58();while(!![]){try{const _0xdcffe5=parseInt(_0x3f9a81(0x20a))/0x1+-parseInt(_0x3f9a81(0x1f3))/0x2*(-parseInt(_0x3f9a81(0x1f1))/0x3)+parseInt(_0x3f9a81(0x203))/0x4*(-parseInt(_0x3f9a81(0x20b))/0x5)+-parseInt(_0x3f9a81(0x210))/0x6+parseInt(_0x3f9a81(0x1f5))/0x7*(-parseInt(_0x3f9a81(0x206))/0x8)+-parseInt(_0x3f9a81(0x1f2))/0x9+parseInt(_0x3f9a81(0x1eb))/0xa;if(_0xdcffe5===_0x2f4a2f)break;else _0x59ce85['push'](_0x59ce85['shift']());}catch(_0xab6736){_0x59ce85['push'](_0x59ce85['shift']());}}}(a15_0x67cf,0x5978a));import{BaseCommand}from'./command.js';function a15_0x6661(_0x4106bf,_0x8323b3){_0x4106bf=_0x4106bf-0x1ea;const _0x67cffc=a15_0x67cf();let _0x666176=_0x67cffc[_0x4106bf];return _0x666176;}import{SDKError}from'../sdk/index.js';function a15_0x67cf(){const _0x316cae=['4673944selaJA','table','data','query','330945JILIzE','415zXOwiq','Error:\x20','message','describe','Site:\x20','2245530aEDYjC','\x20column','13213860VUZjLV','\x20in\x20','\x27\x20does\x20not\x20exist','cause','database','✖\x20Table\x20not\x20found','321SmKMbU','5721156lNdNwf','7496nyVhfd','describeTable','7gaaYlN','Table:\x20','Describing\x20table\x20','name','site','error','✔\x20Found\x20','Describe\x20table\x20schema','args','Database:\x20','verbose','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','execute','length','4468sXqjci','...','\x20\x20Cause:\x20'];a15_0x67cf=function(){return _0x316cae;};return a15_0x67cf();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x3b630b(0x1f8)]=a15_0x3b630b(0x20e);['description']=a15_0x3b630b(0x1fc);async[a15_0x3b630b(0x201)](_0x280dd5){const _0x204571=a15_0x3b630b;return this[_0x204571(0x1f4)](_0x280dd5);}async[a15_0x3b630b(0x1f4)](_0x48c1d4){const _0x4da54b=a15_0x3b630b,{options:_0x1e17ea,args:_0x2dae98,tdx:_0x2a7d3a}=_0x48c1d4;let _0x33ce70;try{_0x33ce70=parseTableReference(_0x2dae98[0x0]);const _0x1e13d7=_0x1e17ea[_0x4da54b(0x1ef)];!_0x33ce70['database']&&_0x1e13d7&&(_0x33ce70[_0x4da54b(0x1ef)]=_0x1e13d7);const _0x41c3dc=validateTableDescribeReference(_0x33ce70);if(_0x41c3dc)return console[_0x4da54b(0x1fa)](_0x4da54b(0x20c)+_0x41c3dc),0x1;}catch(_0x9baab5){return console[_0x4da54b(0x1fa)](_0x4da54b(0x20c)+_0x9baab5[_0x4da54b(0x20d)]),0x1;}const _0x37fcf0=_0x33ce70[_0x4da54b(0x1ef)],_0x297331=_0x33ce70[_0x4da54b(0x207)];try{_0x1e17ea['verbose']&&(console[_0x4da54b(0x1fa)](_0x4da54b(0x20f)+_0x1e17ea[_0x4da54b(0x1f9)]),console[_0x4da54b(0x1fa)](_0x4da54b(0x1fe)+_0x37fcf0),console[_0x4da54b(0x1fa)](_0x4da54b(0x1f6)+_0x297331));const _0x2bd3d9=await withSpinner(_0x4da54b(0x1f7)+_0x37fcf0+'.'+_0x297331+_0x4da54b(0x204),()=>_0x2a7d3a[_0x4da54b(0x209)][_0x4da54b(0x1f4)](_0x37fcf0,_0x297331),{'verbose':_0x1e17ea[_0x4da54b(0x1ff)]}),_0x234e02=_0x2bd3d9[_0x4da54b(0x208)];if(_0x234e02[_0x4da54b(0x202)]===0x0)return console[_0x4da54b(0x1fa)](_0x4da54b(0x1f0)),console[_0x4da54b(0x1fa)]('Table\x20\x27'+_0x37fcf0+'.'+_0x297331+_0x4da54b(0x1ed)),0x1;return console[_0x4da54b(0x1fa)](_0x4da54b(0x1fb)+_0x234e02[_0x4da54b(0x202)]+_0x4da54b(0x1ea)+(_0x234e02['length']!==0x1?'s':'')+_0x4da54b(0x1ec)+_0x37fcf0+'.'+_0x297331),await handleSDKOutput(_0x234e02,_0x1e17ea),0x0;}catch(_0x21f28c){if(_0x21f28c instanceof SDKError)return console[_0x4da54b(0x1fa)]('Error:\x20'+_0x21f28c['message']),_0x21f28c[_0x4da54b(0x1ee)]&&console[_0x4da54b(0x1fa)](_0x4da54b(0x205)+_0x21f28c[_0x4da54b(0x1ee)]),0x1;throw _0x21f28c;}}['validate'](_0x4013d7){const _0x48e947=a15_0x3b630b;if(_0x4013d7['args'][_0x48e947(0x202)]===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(_0x4013d7[_0x48e947(0x1fd)][_0x48e947(0x202)]>0x1)return _0x48e947(0x200);return undefined;}}
1
+ const a15_0x3b9795=a15_0xdbef;function a15_0x526b(){const _0xca68ff=['Error:\x20','Site:\x20','length','error','query','527961ZVyhIn','description','execute','...','341216rfzmon','data','cause','table','✔\x20Found\x20','404856apsOPc','\x27\x20does\x20not\x20exist','Table\x20\x27','message','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','✖\x20Table\x20not\x20found','408997BGcYEz','975918IFDmen','describeTable','2254775WXFwGH','describe','4PQZKzJ','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','database','site','Table:\x20','args','validate','987819WvUvhQ','Describing\x20table\x20'];a15_0x526b=function(){return _0xca68ff;};return a15_0x526b();}(function(_0xe3c081,_0x2740ff){const _0x1675a4=a15_0xdbef,_0x591b3f=_0xe3c081();while(!![]){try{const _0x4e8c61=-parseInt(_0x1675a4(0x191))/0x1+-parseInt(_0x1675a4(0x18b))/0x2+parseInt(_0x1675a4(0x1a4))/0x3+parseInt(_0x1675a4(0x196))/0x4*(parseInt(_0x1675a4(0x194))/0x5)+parseInt(_0x1675a4(0x192))/0x6+parseInt(_0x1675a4(0x19d))/0x7+-parseInt(_0x1675a4(0x1a8))/0x8;if(_0x4e8c61===_0x2740ff)break;else _0x591b3f['push'](_0x591b3f['shift']());}catch(_0x59af21){_0x591b3f['push'](_0x591b3f['shift']());}}}(a15_0x526b,0x4389b));import{BaseCommand}from'./command.js';function a15_0xdbef(_0x41fd0d,_0x3551fa){_0x41fd0d=_0x41fd0d-0x188;const _0x526b2f=a15_0x526b();let _0xdbef94=_0x526b2f[_0x41fd0d];return _0xdbef94;}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';export class DescribeCommand extends BaseCommand{['name']=a15_0x3b9795(0x195);[a15_0x3b9795(0x1a5)]='Describe\x20table\x20schema';async[a15_0x3b9795(0x1a6)](_0x14a954){const _0x3fd0a3=a15_0x3b9795;return this[_0x3fd0a3(0x193)](_0x14a954);}async[a15_0x3b9795(0x193)](_0x2bf9b3){const _0x4abc0a=a15_0x3b9795,{options:_0x2b4a72,args:_0x405511,tdx:_0x49d79c}=_0x2bf9b3;let _0x47d8ba;try{_0x47d8ba=parseTableReference(_0x405511[0x0]);const _0x45270e=_0x2b4a72['database'];!_0x47d8ba[_0x4abc0a(0x198)]&&_0x45270e&&(_0x47d8ba[_0x4abc0a(0x198)]=_0x45270e);const _0x2fbc2f=validateTableDescribeReference(_0x47d8ba);if(_0x2fbc2f)return console['error'](_0x4abc0a(0x19f)+_0x2fbc2f),0x1;}catch(_0x150595){return console[_0x4abc0a(0x1a2)]('Error:\x20'+_0x150595[_0x4abc0a(0x18e)]),0x1;}const _0x4df492=_0x47d8ba[_0x4abc0a(0x198)],_0x5f1c77=_0x47d8ba[_0x4abc0a(0x189)];try{_0x2b4a72['verbose']&&(console[_0x4abc0a(0x1a2)](_0x4abc0a(0x1a0)+_0x2b4a72[_0x4abc0a(0x199)]),console[_0x4abc0a(0x1a2)]('Database:\x20'+_0x4df492),console[_0x4abc0a(0x1a2)](_0x4abc0a(0x19a)+_0x5f1c77));const _0x30ce5a=await withSpinner(_0x4abc0a(0x19e)+_0x4df492+'.'+_0x5f1c77+_0x4abc0a(0x1a7),()=>_0x49d79c[_0x4abc0a(0x1a3)]['describeTable'](_0x4df492,_0x5f1c77),{'verbose':_0x2b4a72['verbose']}),_0x39bbdf=_0x30ce5a[_0x4abc0a(0x1a9)];if(_0x39bbdf[_0x4abc0a(0x1a1)]===0x0)return console[_0x4abc0a(0x1a2)](_0x4abc0a(0x190)),console[_0x4abc0a(0x1a2)](_0x4abc0a(0x18d)+_0x4df492+'.'+_0x5f1c77+_0x4abc0a(0x18c)),0x1;return console[_0x4abc0a(0x1a2)](_0x4abc0a(0x18a)+_0x39bbdf['length']+'\x20column'+(_0x39bbdf['length']!==0x1?'s':'')+'\x20in\x20'+_0x4df492+'.'+_0x5f1c77),await handleSDKOutput(_0x39bbdf,_0x2b4a72),0x0;}catch(_0x3e5d6f){if(_0x3e5d6f instanceof SDKError)return console[_0x4abc0a(0x1a2)]('Error:\x20'+_0x3e5d6f['message']),_0x3e5d6f[_0x4abc0a(0x188)]&&console[_0x4abc0a(0x1a2)]('\x20\x20Cause:\x20'+_0x3e5d6f[_0x4abc0a(0x188)]),0x1;throw _0x3e5d6f;}}[a15_0x3b9795(0x19c)](_0x301e45){const _0x2e1dfa=a15_0x3b9795;if(_0x301e45[_0x2e1dfa(0x19b)][_0x2e1dfa(0x1a1)]===0x0)return _0x2e1dfa(0x18f);if(_0x301e45[_0x2e1dfa(0x19b)][_0x2e1dfa(0x1a1)]>0x1)return _0x2e1dfa(0x197);return undefined;}}
@@ -1 +1 @@
1
- const a16_0x5c7bfa=a16_0x3c14;(function(_0x409e7c,_0x3921fb){const _0x3d57e3=a16_0x3c14,_0x34939b=_0x409e7c();while(!![]){try{const _0x48f935=-parseInt(_0x3d57e3(0x10c))/0x1+parseInt(_0x3d57e3(0x12e))/0x2*(parseInt(_0x3d57e3(0x12c))/0x3)+-parseInt(_0x3d57e3(0x16e))/0x4*(parseInt(_0x3d57e3(0x123))/0x5)+parseInt(_0x3d57e3(0x127))/0x6*(parseInt(_0x3d57e3(0x132))/0x7)+parseInt(_0x3d57e3(0x124))/0x8+-parseInt(_0x3d57e3(0xfd))/0x9*(-parseInt(_0x3d57e3(0x145))/0xa)+-parseInt(_0x3d57e3(0x163))/0xb;if(_0x48f935===_0x3921fb)break;else _0x34939b['push'](_0x34939b['shift']());}catch(_0x4dab75){_0x34939b['push'](_0x34939b['shift']());}}}(a16_0x4256,0xde4f0));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{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x313f5c,_0x13a6c9,_0x50072a=![]){const _0x173ab4=a16_0x3c14;if(_0x313f5c['workspace'])return await _0x13a6c9[_0x173ab4(0x13d)][_0x173ab4(0x11b)](_0x313f5c[_0x173ab4(0x106)]);const _0x230bd4=loadSessionContext(_0x313f5c['session']);if(_0x230bd4?.[_0x173ab4(0x10e)])return await _0x13a6c9[_0x173ab4(0x13d)]['resolveWorkspaceId'](_0x230bd4[_0x173ab4(0x10e)]);if(_0x50072a)throw new SDKError(ErrorCode[_0x173ab4(0x14c)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':_0x173ab4(0x15b)});return undefined;}async function resolveSegmentFromOptions(_0x2b56f7,_0x449686){const _0x4847fd=a16_0x3c14;if(!_0x2b56f7[_0x4847fd(0x150)])return{};const _0x50c6d4=_0x2b56f7[_0x4847fd(0x150)],_0xa4ce37=await _0x449686['segment'][_0x4847fd(0x184)](_0x50c6d4);return{'audienceId':_0xa4ce37[_0x4847fd(0x13f)],'audienceName':_0xa4ce37[_0x4847fd(0x16c)],..._0xa4ce37[_0x4847fd(0x15c)]&&{'segmentId':_0xa4ce37['segmentId'],'segmentName':_0xa4ce37[_0x4847fd(0x116)]}};}function buildConnectorConfig(_0x45dcf2){const _0xfa41ba=a16_0x3c14,_0x286636=_0x45dcf2['emailSenderId'],_0x4090f9=_0x45dcf2[_0xfa41ba(0x154)];if(!_0x286636&&!_0x4090f9)return undefined;return{..._0x286636&&{'emailSenderId':_0x286636},..._0x4090f9&&{'jsonColumns':_0x4090f9}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]='engage:campaigns';[a16_0x5c7bfa(0x161)]='List\x20campaigns';async[a16_0x5c7bfa(0x115)](_0x186434){const _0x11b44f=a16_0x5c7bfa,{options:_0x3595ec,args:_0x2d04e2,tdx:_0x1387b8}=_0x186434,_0x1d58b3=_0x2d04e2[0x0],_0x1ebe7a=resolveLimit(_0x3595ec['limit'],DEFAULT_LLM_LIMIT),_0x5544d6=_0x3595ec,_0x30f0b3=_0x5544d6[_0x11b44f(0x162)],_0x1ae9b6=_0x5544d6['status'],_0x12683f=await resolveWorkspaceIdFromOptions(_0x5544d6,_0x1387b8),_0x4d99fd=await withSpinner(_0x11b44f(0x13a),()=>_0x1387b8[_0x11b44f(0x13d)][_0x11b44f(0x142)]({'type':_0x30f0b3,'status':_0x1ae9b6,'workspaceId':_0x12683f,'limit':_0x1ebe7a}),{'verbose':_0x3595ec[_0x11b44f(0x131)]});let _0xa2a99d=_0x4d99fd[_0x11b44f(0x13c)];return _0x1d58b3&&(_0xa2a99d=_0x4d99fd[_0x11b44f(0x13c)][_0x11b44f(0x155)](_0x278310=>matchGlobPattern(_0x278310['name'],_0x1d58b3))),await handleSDKOutput(_0xa2a99d,_0x3595ec),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x159);[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x14b);async[a16_0x5c7bfa(0x115)](_0x3beade){const _0x382b3a=a16_0x5c7bfa,{options:_0x171853,args:_0x38a39f,tdx:_0xe3e665}=_0x3beade;if(_0x38a39f[_0x382b3a(0x14a)]===0x0)return console[_0x382b3a(0x14e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x382b3a(0x130)),0x1;const _0x676eb2=_0x38a39f[0x0],_0x4898bd=_0x171853,_0x116c7c=await resolveWorkspaceIdFromOptions(_0x4898bd,_0xe3e665),_0x5006ab=_0x4898bd[_0x382b3a(0x187)];if(_0x5006ab){const _0x98e8ca=await withSpinner(_0x382b3a(0x168)+_0x676eb2+_0x382b3a(0x174),()=>_0xe3e665[_0x382b3a(0x13d)][_0x382b3a(0x10a)](_0x676eb2,_0x116c7c),{'verbose':_0x171853[_0x382b3a(0x131)]});await handleSDKOutput([_0x98e8ca],_0x171853);}else{const _0x23b140=await withSpinner(_0x382b3a(0x168)+_0x676eb2+_0x382b3a(0x174),()=>_0xe3e665['engage'][_0x382b3a(0x185)](_0x676eb2,_0x116c7c),{'verbose':_0x171853[_0x382b3a(0x131)]});await handleSDKOutput([_0x23b140],_0x171853);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x11d);['description']=a16_0x5c7bfa(0x146);async[a16_0x5c7bfa(0x115)](_0x149004){const _0x5dd317=a16_0x5c7bfa,{options:_0x389c78,tdx:_0x32ed62}=_0x149004,_0x7bdc51=_0x389c78,_0x579471=_0x7bdc51['name'],_0x5f2d87=_0x7bdc51[_0x5dd317(0x162)];if(!_0x579471)return console[_0x5dd317(0x14e)]('Error:\x20--name\x20is\x20required'),console[_0x5dd317(0x14e)](_0x5dd317(0x136)),0x1;if(!_0x5f2d87)return console[_0x5dd317(0x14e)]('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0x5dd317(0x14e)](_0x5dd317(0x136)),0x1;const _0x5d9e27=await resolveWorkspaceIdFromOptions(_0x7bdc51,_0x32ed62,!![]),_0xf72c7c=await resolveSegmentFromOptions(_0x7bdc51,_0x32ed62),_0x17efdd=buildConnectorConfig(_0x7bdc51),_0x3b407a={'name':_0x579471,'campaignType':_0x5f2d87,'workspaceId':_0x5d9e27,'description':_0x7bdc51[_0x5dd317(0x161)],..._0xf72c7c,'connectorConfig':_0x17efdd,'startAt':_0x7bdc51[_0x5dd317(0x167)],'timezone':_0x7bdc51['timezone']},_0x4c2989=await withSpinner('Creating\x20campaign\x20\x27'+_0x579471+_0x5dd317(0x174),()=>_0x32ed62[_0x5dd317(0x13d)][_0x5dd317(0x13b)](_0x3b407a));return await handleSDKOutput([_0x4c2989[_0x5dd317(0x13c)]],_0x389c78),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x169);['description']='Update\x20a\x20campaign';async[a16_0x5c7bfa(0x115)](_0x2d1be9){const _0xf2d20c=a16_0x5c7bfa,{options:_0x5e3538,args:_0x4117a6,tdx:_0x18fbe6}=_0x2d1be9;if(_0x4117a6[_0xf2d20c(0x14a)]===0x0)return console[_0xf2d20c(0x14e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0xf2d20c(0x14e)](_0xf2d20c(0x178)),0x1;const _0x588d84=_0x4117a6[0x0],_0x3c6336=_0x5e3538,_0x41ee72=await resolveWorkspaceIdFromOptions(_0x3c6336,_0x18fbe6),_0x19132b=await resolveSegmentFromOptions(_0x3c6336,_0x18fbe6),_0x10dee9=buildConnectorConfig(_0x3c6336),_0x1eff3a={'name':_0x3c6336[_0xf2d20c(0x104)],'description':_0x3c6336[_0xf2d20c(0x161)],..._0x19132b,'connectorConfig':_0x10dee9,'startAt':_0x3c6336[_0xf2d20c(0x167)],'timezone':_0x3c6336[_0xf2d20c(0x143)]},_0x351b4e=Object[_0xf2d20c(0x149)](Object[_0xf2d20c(0x164)](_0x1eff3a)[_0xf2d20c(0x155)](([,_0x2cca8f])=>_0x2cca8f!==undefined));if(Object[_0xf2d20c(0x189)](_0x351b4e)[_0xf2d20c(0x14a)]===0x0)return console['error'](_0xf2d20c(0x102)),console[_0xf2d20c(0x14e)](_0xf2d20c(0x17d)),0x1;const _0x537b3d=await withSpinner(_0xf2d20c(0x108)+_0x588d84+_0xf2d20c(0x174),()=>_0x18fbe6[_0xf2d20c(0x13d)][_0xf2d20c(0xff)](_0x588d84,_0x351b4e,_0x41ee72),{'verbose':_0x5e3538[_0xf2d20c(0x131)]});return await handleSDKOutput([_0x537b3d['data']],_0x5e3538),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']='engage:campaign:delete';[a16_0x5c7bfa(0x161)]='Delete\x20a\x20campaign';async['execute'](_0x56f01f){const _0x3137da=a16_0x5c7bfa,{options:_0x4bdb75,args:_0x3dcc8d,tdx:_0x49172d}=_0x56f01f;if(_0x3dcc8d[_0x3137da(0x14a)]===0x0)return console['error'](_0x3137da(0x112)),console[_0x3137da(0x14e)](_0x3137da(0x180)),0x1;const _0x49032a=_0x3dcc8d[0x0],_0x1caec8=_0x4bdb75,_0x236bd3=await resolveWorkspaceIdFromOptions(_0x1caec8,_0x49172d);if(!_0x4bdb75[_0x3137da(0x114)]){const _0x57f0f9=await confirm(_0x3137da(0xfe)+_0x49032a+_0x3137da(0x128));if(!_0x57f0f9)return console['log'](_0x3137da(0x186)),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x49032a+_0x3137da(0x174),()=>_0x49172d[_0x3137da(0x13d)][_0x3137da(0x160)](_0x49032a,_0x236bd3),{'verbose':_0x4bdb75[_0x3137da(0x131)]}),console[_0x3137da(0x14d)](_0x3137da(0x117)+_0x49032a+_0x3137da(0x15d)),0x0;}}function a16_0x4256(){const _0x3f4893=['MISSING_ARGUMENT','log','error','Options:\x20--name,\x20--description','segment','limit','Pausing\x20campaign\x20\x27','engage:workspaces','jsonColumns','filter','html','resumeCampaign','pauseCampaign','engage:campaign:show','\x27\x20paused\x20successfully','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','segmentId','\x27\x20deleted\x20successfully','engage:workspace:show','engage:template:update','deleteCampaign','description','type','7060669juHPBB','entries','createTemplate','Delete\x20an\x20email\x20template','startAt','Fetching\x20campaign\x20\x27','engage:campaign:update','Workspace\x20\x27','Fetching\x20workspace\x20\x27','parentName','subject','4CfzxWv','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','plaintext','Error:\x20--subject\x20is\x20required','List\x20workspaces','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','\x27...','Show\x20workspace\x20details','Resume\x20a\x20paused\x20campaign','engage:template:create','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','updateTemplate','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:campaign:launch','Duplicating\x20campaign\x20\x27','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','getTemplate','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','getWorkspaceFull','Creating\x20workspace\x20\x27','engage:campaign:resume','resolvePathToResource','getCampaign','Operation\x20cancelled','full','getTemplateFull','keys','engage:workspace:use','Update\x20an\x20email\x20template','54LPTKFN','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','updateCampaign','Fetching\x20templates...','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','listWorkspaces','name','engage:workspace:delete','workspace','Engage\x20workspace\x20set\x20to:\x20','Updating\x20campaign\x20\x27','Verifying\x20workspace\x20\x27','getCampaignFull','engage:workspace:update','989743pXICZl','engage:campaign:pause','engage_workspace','Show\x20email\x20template\x20details','Error:\x20Workspace\x20name\x20is\x20required','engage:workspace:create','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','yes','execute','segmentName','Campaign\x20\x27','Creating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','getWorkspace','resolveWorkspaceId','Pause\x20a\x20campaign','engage:campaign:create','Launching\x20campaign\x20\x27','listTemplates','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','createWorkspace','1882435LRplHZ','9134728EcMbBk','Deleting\x20template\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','18fXZDrD','\x27?\x20This\x20cannot\x20be\x20undone.','Resuming\x20campaign\x20\x27','Fetching\x20template\x20\x27','launchCampaign','2133093HZhaFX','Create\x20a\x20workspace','2GsYlDs','Duplicate\x20a\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','verbose','844837CGERzg','deleteWorkspace','Updating\x20workspace\x20\x27','\x27\x20resumed\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Error:\x20--name\x20is\x20required','Error:\x20--html\x20is\x20required','Delete\x20a\x20workspace','Fetching\x20campaigns...','createCampaign','data','engage','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','parentId','engage:templates','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','listCampaigns','timezone','duplicateCampaign','1172900naYHBZ','Create\x20a\x20new\x20campaign','Create\x20an\x20email\x20template','engage:template:show','fromEntries','length','Show\x20campaign\x20details'];a16_0x4256=function(){return _0x3f4893;};return a16_0x4256();}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x17b);[a16_0x5c7bfa(0x161)]='Launch\x20a\x20campaign';async[a16_0x5c7bfa(0x115)](_0x587fac){const _0x149316=a16_0x5c7bfa,{options:_0x357c5e,args:_0x205087,tdx:_0x376590}=_0x587fac;if(_0x205087[_0x149316(0x14a)]===0x0)return console[_0x149316(0x14e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x149316(0x14e)](_0x149316(0x113)),0x1;const _0x350610=_0x205087[0x0],_0x6dc7d9=_0x357c5e,_0x5c037d=await resolveWorkspaceIdFromOptions(_0x6dc7d9,_0x376590);return await withSpinner(_0x149316(0x11e)+_0x350610+_0x149316(0x174),()=>_0x376590[_0x149316(0x13d)][_0x149316(0x12b)](_0x350610,_0x5c037d),{'verbose':_0x357c5e[_0x149316(0x131)]}),console[_0x149316(0x14d)](_0x149316(0x117)+_0x350610+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x10d);[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x11c);async['execute'](_0x52aa4d){const _0x4bc28a=a16_0x5c7bfa,{options:_0x8fe3bf,args:_0x3fc518,tdx:_0x1bb182}=_0x52aa4d;if(_0x3fc518[_0x4bc28a(0x14a)]===0x0)return console['error'](_0x4bc28a(0x112)),console[_0x4bc28a(0x14e)](_0x4bc28a(0x121)),0x1;const _0x4fe483=_0x3fc518[0x0],_0x6c588d=_0x8fe3bf,_0x879892=await resolveWorkspaceIdFromOptions(_0x6c588d,_0x1bb182);return await withSpinner(_0x4bc28a(0x152)+_0x4fe483+_0x4bc28a(0x174),()=>_0x1bb182[_0x4bc28a(0x13d)][_0x4bc28a(0x158)](_0x4fe483,_0x879892),{'verbose':_0x8fe3bf[_0x4bc28a(0x131)]}),console['log'](_0x4bc28a(0x117)+_0x4fe483+_0x4bc28a(0x15a)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a16_0x5c7bfa(0x183);[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x176);async[a16_0x5c7bfa(0x115)](_0x570023){const _0x1cee38=a16_0x5c7bfa,{options:_0x267cd1,args:_0x1910a0,tdx:_0x207e96}=_0x570023;if(_0x1910a0[_0x1cee38(0x14a)]===0x0)return console[_0x1cee38(0x14e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x1cee38(0x14e)](_0x1cee38(0x13e)),0x1;const _0x851fa4=_0x1910a0[0x0],_0x132e67=_0x267cd1,_0x3c2b3e=await resolveWorkspaceIdFromOptions(_0x132e67,_0x207e96);return await withSpinner(_0x1cee38(0x129)+_0x851fa4+_0x1cee38(0x174),()=>_0x207e96['engage'][_0x1cee38(0x157)](_0x851fa4,_0x3c2b3e),{'verbose':_0x267cd1[_0x1cee38(0x131)]}),console[_0x1cee38(0x14d)](_0x1cee38(0x117)+_0x851fa4+_0x1cee38(0x135)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']='engage:campaign:duplicate';[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x12f);async[a16_0x5c7bfa(0x115)](_0x4eea44){const _0x3aa051=a16_0x5c7bfa,{options:_0xf4ae6c,args:_0x1e1dca,tdx:_0x2c0e29}=_0x4eea44;if(_0x1e1dca[_0x3aa051(0x14a)]===0x0)return console[_0x3aa051(0x14e)](_0x3aa051(0x112)),console[_0x3aa051(0x14e)](_0x3aa051(0x101)),0x1;const _0x3ef711=_0x1e1dca[0x0],_0x472a9b=_0xf4ae6c,_0x4c9f8c=await resolveWorkspaceIdFromOptions(_0x472a9b,_0x2c0e29),_0x473487=await withSpinner(_0x3aa051(0x17c)+_0x3ef711+_0x3aa051(0x174),()=>_0x2c0e29[_0x3aa051(0x13d)][_0x3aa051(0x144)](_0x3ef711,_0x4c9f8c),{'verbose':_0xf4ae6c[_0x3aa051(0x131)]});return await handleSDKOutput([_0x473487[_0x3aa051(0x13c)]],_0xf4ae6c),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a16_0x5c7bfa(0x140);[a16_0x5c7bfa(0x161)]='List\x20email\x20templates';async['execute'](_0x389f63){const _0xe82b27=a16_0x5c7bfa,{options:_0x3b1b84,args:_0x26399f,tdx:_0x439ee0}=_0x389f63,_0x4db778=_0x26399f[0x0],_0x387991=resolveLimit(_0x3b1b84[_0xe82b27(0x151)],DEFAULT_LLM_LIMIT),_0x2669a0=_0x3b1b84,_0x5d1e92=await resolveWorkspaceIdFromOptions(_0x2669a0,_0x439ee0),_0x4d49b8=await withSpinner(_0xe82b27(0x100),()=>_0x439ee0['engage'][_0xe82b27(0x11f)]({'workspaceId':_0x5d1e92,'limit':_0x387991}),{'verbose':_0x3b1b84[_0xe82b27(0x131)]});let _0x10a15c=_0x4d49b8[_0xe82b27(0x13c)];return _0x4db778&&(_0x10a15c=_0x4d49b8[_0xe82b27(0x13c)]['filter'](_0xbd6d6a=>matchGlobPattern(_0xbd6d6a[_0xe82b27(0x104)],_0x4db778))),await handleSDKOutput(_0x10a15c,_0x3b1b84),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a16_0x5c7bfa(0x148);[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x10f);async[a16_0x5c7bfa(0x115)](_0x1f5a29){const _0x4a96af=a16_0x5c7bfa,{options:_0xbf862f,args:_0x5dd56c,tdx:_0x27fb54}=_0x1f5a29;if(_0x5dd56c[_0x4a96af(0x14a)]===0x0)return console[_0x4a96af(0x14e)](_0x4a96af(0x120)),console[_0x4a96af(0x14e)](_0x4a96af(0x16f)),0x1;const _0x61e5b0=_0x5dd56c[0x0],_0x378656=_0xbf862f,_0x15891f=await resolveWorkspaceIdFromOptions(_0x378656,_0x27fb54),_0x1d64cd=_0x378656[_0x4a96af(0x187)];if(_0x1d64cd){const _0xceb60d=await withSpinner('Fetching\x20template\x20\x27'+_0x61e5b0+'\x27...',()=>_0x27fb54[_0x4a96af(0x13d)][_0x4a96af(0x188)](_0x61e5b0,_0x15891f),{'verbose':_0xbf862f[_0x4a96af(0x131)]});await handleSDKOutput([_0xceb60d],_0xbf862f);}else{const _0x17c6a7=await withSpinner(_0x4a96af(0x12a)+_0x61e5b0+_0x4a96af(0x174),()=>_0x27fb54[_0x4a96af(0x13d)][_0x4a96af(0x17f)](_0x61e5b0,_0x15891f),{'verbose':_0xbf862f['verbose']});await handleSDKOutput([_0x17c6a7],_0xbf862f);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x177);['description']=a16_0x5c7bfa(0x147);async[a16_0x5c7bfa(0x115)](_0x23f49f){const _0x2e7926=a16_0x5c7bfa,{options:_0x216e5d,tdx:_0x43da6d}=_0x23f49f,_0x55e3e1=_0x216e5d,_0x19489c=_0x55e3e1[_0x2e7926(0x104)],_0x449aae=_0x55e3e1[_0x2e7926(0x16d)],_0x289d91=_0x55e3e1[_0x2e7926(0x156)];if(!_0x19489c)return console[_0x2e7926(0x14e)](_0x2e7926(0x137)),console[_0x2e7926(0x14e)](_0x2e7926(0x173)),0x1;if(!_0x449aae)return console[_0x2e7926(0x14e)](_0x2e7926(0x171)),0x1;if(!_0x289d91)return console[_0x2e7926(0x14e)](_0x2e7926(0x138)),0x1;const _0x309902=await resolveWorkspaceIdFromOptions(_0x55e3e1,_0x43da6d,!![]),_0x21086b={'name':_0x19489c,'subjectTemplate':_0x449aae,'htmlTemplate':_0x289d91,'workspaceId':_0x309902,'plaintextTemplate':_0x55e3e1['plaintext'],'editorType':_0x55e3e1['editorType']},_0x3a18f2=await withSpinner(_0x2e7926(0x118)+_0x19489c+_0x2e7926(0x174),()=>_0x43da6d[_0x2e7926(0x13d)][_0x2e7926(0x165)](_0x21086b));return await handleSDKOutput([_0x3a18f2[_0x2e7926(0x13c)]],_0x216e5d),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x15f);[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x18b);async[a16_0x5c7bfa(0x115)](_0x9d4092){const _0x581a60=a16_0x5c7bfa,{options:_0x600e,args:_0x2d4d1d,tdx:_0x49b9bf}=_0x9d4092;if(_0x2d4d1d[_0x581a60(0x14a)]===0x0)return console[_0x581a60(0x14e)](_0x581a60(0x120)),console[_0x581a60(0x14e)](_0x581a60(0x17a)),0x1;const _0x188711=_0x2d4d1d[0x0],_0x4e5a04=_0x600e,_0x1fa066=await resolveWorkspaceIdFromOptions(_0x4e5a04,_0x49b9bf),_0x5bb714={'name':_0x4e5a04[_0x581a60(0x104)],'subjectTemplate':_0x4e5a04[_0x581a60(0x16d)],'htmlTemplate':_0x4e5a04[_0x581a60(0x156)],'plaintextTemplate':_0x4e5a04[_0x581a60(0x170)]},_0xc84887=Object[_0x581a60(0x149)](Object[_0x581a60(0x164)](_0x5bb714)[_0x581a60(0x155)](([,_0x31532c])=>_0x31532c!==undefined));if(Object[_0x581a60(0x189)](_0xc84887)[_0x581a60(0x14a)]===0x0)return console['error'](_0x581a60(0x102)),console[_0x581a60(0x14e)]('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x2be8a1=await withSpinner('Updating\x20template\x20\x27'+_0x188711+_0x581a60(0x174),()=>_0x49b9bf[_0x581a60(0x13d)][_0x581a60(0x179)](_0x188711,_0xc84887,_0x1fa066),{'verbose':_0x600e[_0x581a60(0x131)]});return await handleSDKOutput([_0x2be8a1[_0x581a60(0x13c)]],_0x600e),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']='engage:template:delete';[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x166);async[a16_0x5c7bfa(0x115)](_0x327742){const _0x14f575=a16_0x5c7bfa,{options:_0x395941,args:_0x7677b6,tdx:_0x1c86d7}=_0x327742;if(_0x7677b6[_0x14f575(0x14a)]===0x0)return console[_0x14f575(0x14e)](_0x14f575(0x120)),console[_0x14f575(0x14e)](_0x14f575(0x17e)),0x1;const _0x473c6b=_0x7677b6[0x0],_0x8323c6=_0x395941,_0x36c0f7=await resolveWorkspaceIdFromOptions(_0x8323c6,_0x1c86d7);if(!_0x395941[_0x14f575(0x114)]){const _0x18a97a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x473c6b+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x18a97a)return console[_0x14f575(0x14d)](_0x14f575(0x186)),0x0;}return await withSpinner(_0x14f575(0x125)+_0x473c6b+_0x14f575(0x174),()=>_0x1c86d7[_0x14f575(0x13d)]['deleteTemplate'](_0x473c6b,_0x36c0f7),{'verbose':_0x395941['verbose']}),console[_0x14f575(0x14d)]('Template\x20\x27'+_0x473c6b+_0x14f575(0x15d)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x153);[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x172);async['execute'](_0x229a35){const _0x1f0b48=a16_0x5c7bfa,{options:_0x9ff344,args:_0x3f199a,tdx:_0x5a83e2}=_0x229a35,_0x3e87f0=_0x3f199a[0x0],_0x30232c=resolveLimit(_0x9ff344['limit'],DEFAULT_LLM_LIMIT),_0x69e979=await withSpinner('Fetching\x20workspaces...',()=>_0x5a83e2[_0x1f0b48(0x13d)][_0x1f0b48(0x103)]({'limit':_0x30232c}),{'verbose':_0x9ff344['verbose']});let _0x46c2af=_0x69e979['data'];return _0x3e87f0&&(_0x46c2af=_0x69e979[_0x1f0b48(0x13c)]['filter'](_0x189188=>matchGlobPattern(_0x189188[_0x1f0b48(0x104)],_0x3e87f0))),await handleSDKOutput(_0x46c2af,_0x9ff344),0x0;}}function a16_0x3c14(_0x99e983,_0x52ee10){_0x99e983=_0x99e983-0xfd;const _0x4256ee=a16_0x4256();let _0x3c1432=_0x4256ee[_0x99e983];return _0x3c1432;}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a16_0x5c7bfa(0x15e);[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x175);async[a16_0x5c7bfa(0x115)](_0x55b560){const _0x1fede8=a16_0x5c7bfa,{options:_0x528e06,args:_0x3345a3,tdx:_0xbe9bc2}=_0x55b560;if(_0x3345a3['length']===0x0)return console[_0x1fede8(0x14e)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x1fede8(0x14e)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x3892d2=_0x3345a3[0x0],_0x363503=_0x528e06,_0x22b6fd=_0x363503[_0x1fede8(0x187)];if(_0x22b6fd){const _0x23530f=await withSpinner(_0x1fede8(0x16b)+_0x3892d2+_0x1fede8(0x174),()=>_0xbe9bc2[_0x1fede8(0x13d)][_0x1fede8(0x181)](_0x3892d2),{'verbose':_0x528e06[_0x1fede8(0x131)]});await handleSDKOutput([_0x23530f],_0x528e06);}else{const _0x21fc68=await withSpinner(_0x1fede8(0x16b)+_0x3892d2+'\x27...',()=>_0xbe9bc2[_0x1fede8(0x13d)][_0x1fede8(0x11a)](_0x3892d2),{'verbose':_0x528e06['verbose']});await handleSDKOutput([_0x21fc68],_0x528e06);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x111);['description']=a16_0x5c7bfa(0x12d);async['execute'](_0x591121){const _0xd6ff45=a16_0x5c7bfa,{options:_0x11a955,tdx:_0x3c027c}=_0x591121,_0xd4a455=_0x11a955,_0x3b0527=_0xd4a455['name'];if(!_0x3b0527)return console[_0xd6ff45(0x14e)](_0xd6ff45(0x137)),console[_0xd6ff45(0x14e)](_0xd6ff45(0x141)),0x1;const _0x490ed2={'name':_0x3b0527,'description':_0xd4a455['description']},_0x3b507c=await withSpinner(_0xd6ff45(0x182)+_0x3b0527+_0xd6ff45(0x174),()=>_0x3c027c[_0xd6ff45(0x13d)][_0xd6ff45(0x122)](_0x490ed2));return await handleSDKOutput([_0x3b507c[_0xd6ff45(0x13c)]],_0x11a955),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x10b);[a16_0x5c7bfa(0x161)]='Update\x20a\x20workspace';async[a16_0x5c7bfa(0x115)](_0x3c635b){const _0x1be293=a16_0x5c7bfa,{options:_0x354903,args:_0x315dce,tdx:_0x2c9478}=_0x3c635b;if(_0x315dce[_0x1be293(0x14a)]===0x0)return console[_0x1be293(0x14e)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x57cf36=_0x315dce[0x0],_0x217d0e=_0x354903,_0x1b4d7f={'name':_0x217d0e[_0x1be293(0x104)],'description':_0x217d0e[_0x1be293(0x161)]},_0x457308=Object['fromEntries'](Object[_0x1be293(0x164)](_0x1b4d7f)[_0x1be293(0x155)](([,_0x57aec2])=>_0x57aec2!==undefined));if(Object[_0x1be293(0x189)](_0x457308)['length']===0x0)return console[_0x1be293(0x14e)](_0x1be293(0x102)),console[_0x1be293(0x14e)](_0x1be293(0x14f)),0x1;const _0x2119ea=await withSpinner(_0x1be293(0x134)+_0x57cf36+'\x27...',()=>_0x2c9478[_0x1be293(0x13d)]['updateWorkspace'](_0x57cf36,_0x457308),{'verbose':_0x354903['verbose']});return await handleSDKOutput([_0x2119ea['data']],_0x354903),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x5c7bfa(0x104)]=a16_0x5c7bfa(0x105);[a16_0x5c7bfa(0x161)]=a16_0x5c7bfa(0x139);async[a16_0x5c7bfa(0x115)](_0x5f10fc){const _0x251ff0=a16_0x5c7bfa,{options:_0x6b8c0a,args:_0x38cdfe,tdx:_0x30fcad}=_0x5f10fc;if(_0x38cdfe[_0x251ff0(0x14a)]===0x0)return console[_0x251ff0(0x14e)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x251ff0(0x14e)](_0x251ff0(0x119)),0x1;const _0x38a625=_0x38cdfe[0x0];if(!_0x6b8c0a[_0x251ff0(0x114)]){const _0x4e523a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x38a625+_0x251ff0(0x128));if(!_0x4e523a)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x38a625+'\x27...',()=>_0x30fcad[_0x251ff0(0x13d)][_0x251ff0(0x133)](_0x38a625),{'verbose':_0x6b8c0a['verbose']}),console[_0x251ff0(0x14d)](_0x251ff0(0x16a)+_0x38a625+_0x251ff0(0x15d)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x5c7bfa(0x18a);['description']='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async[a16_0x5c7bfa(0x115)](_0x568de4){const _0x44dd59=a16_0x5c7bfa,{options:_0x2598df,args:_0x33265,tdx:_0x2559b9}=_0x568de4;if(_0x33265[_0x44dd59(0x14a)]===0x0)return console[_0x44dd59(0x14e)](_0x44dd59(0x110)),console['error'](_0x44dd59(0x126)),0x1;const _0x569484=_0x33265[0x0];await withSpinner(_0x44dd59(0x109)+_0x569484+_0x44dd59(0x174),()=>_0x2559b9[_0x44dd59(0x13d)][_0x44dd59(0x11b)](_0x569484));const _0xae4f4d=_0x2598df['session']||undefined;return saveSessionContext({'engage_workspace':_0x569484},_0xae4f4d),console[_0x44dd59(0x14d)](_0x44dd59(0x107)+_0x569484),console[_0x44dd59(0x14d)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
1
+ const a16_0xe77a40=a16_0x3db2;(function(_0x588a6a,_0x1ec69d){const _0x1d6736=a16_0x3db2,_0x109d16=_0x588a6a();while(!![]){try{const _0x2295c3=-parseInt(_0x1d6736(0xbd))/0x1*(-parseInt(_0x1d6736(0x7b))/0x2)+parseInt(_0x1d6736(0xb1))/0x3*(parseInt(_0x1d6736(0xa0))/0x4)+parseInt(_0x1d6736(0xa5))/0x5*(parseInt(_0x1d6736(0x71))/0x6)+parseInt(_0x1d6736(0x92))/0x7+-parseInt(_0x1d6736(0xc3))/0x8+parseInt(_0x1d6736(0xf9))/0x9*(-parseInt(_0x1d6736(0xe9))/0xa)+-parseInt(_0x1d6736(0xe3))/0xb*(parseInt(_0x1d6736(0xaa))/0xc);if(_0x2295c3===_0x1ec69d)break;else _0x109d16['push'](_0x109d16['shift']());}catch(_0x4feebb){_0x109d16['push'](_0x109d16['shift']());}}}(a16_0x215d,0xe7c1a));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{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';function a16_0x3db2(_0x569f80,_0x2d00cf){_0x569f80=_0x569f80-0x6e;const _0x215ddd=a16_0x215d();let _0x3db22f=_0x215ddd[_0x569f80];return _0x3db22f;}import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x29d7cc,_0x3f216f,_0x241837=![]){const _0x305ac6=a16_0x3db2;if(_0x29d7cc[_0x305ac6(0xa1)])return await _0x3f216f['engage'][_0x305ac6(0xf5)](_0x29d7cc[_0x305ac6(0xa1)]);const _0x1df075=loadSessionContext(_0x29d7cc[_0x305ac6(0xb9)]);if(_0x1df075?.[_0x305ac6(0xc0)])return await _0x3f216f[_0x305ac6(0xe5)][_0x305ac6(0xf5)](_0x1df075[_0x305ac6(0xc0)]);if(_0x241837)throw new SDKError(ErrorCode[_0x305ac6(0xf0)],_0x305ac6(0xba),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x5616e5,_0x5dadab){const _0x1da084=a16_0x3db2;if(!_0x5616e5[_0x1da084(0xd1)])return{};const _0x267e52=_0x5616e5[_0x1da084(0xd1)],_0x4dfb5=await _0x5dadab['segment'][_0x1da084(0xfd)](_0x267e52);return{'audienceId':_0x4dfb5[_0x1da084(0x83)],'audienceName':_0x4dfb5['parentName'],..._0x4dfb5['segmentId']&&{'segmentId':_0x4dfb5[_0x1da084(0xd7)],'segmentName':_0x4dfb5[_0x1da084(0x73)]}};}function buildConnectorConfig(_0x502e9e){const _0x4b12f0=a16_0x3db2,_0xf1ef4=_0x502e9e[_0x4b12f0(0xcc)],_0x269dcb=_0x502e9e[_0x4b12f0(0x75)];if(!_0xf1ef4&&!_0x269dcb)return undefined;return{..._0xf1ef4&&{'emailSenderId':_0xf1ef4},..._0x269dcb&&{'jsonColumns':_0x269dcb}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0xe77a40(0xae)]='engage:campaigns';['description']=a16_0xe77a40(0x98);async[a16_0xe77a40(0x7d)](_0x2f58cc){const _0x3159a2=a16_0xe77a40,{options:_0x4938d0,args:_0x293d43,tdx:_0x2b8142}=_0x2f58cc,_0x13e624=_0x293d43[0x0],_0x4f8017=resolveLimit(_0x4938d0['limit'],DEFAULT_LLM_LIMIT),_0x3facf9=_0x4938d0,_0x1ae28b=_0x3facf9[_0x3159a2(0xa4)],_0x4d3705=_0x3facf9['status'],_0x311b1d=await resolveWorkspaceIdFromOptions(_0x3facf9,_0x2b8142),_0x3dd39c=await withSpinner('Fetching\x20campaigns...',()=>_0x2b8142[_0x3159a2(0xe5)]['listCampaigns']({'type':_0x1ae28b,'status':_0x4d3705,'workspaceId':_0x311b1d,'limit':_0x4f8017}),{'verbose':_0x4938d0[_0x3159a2(0xee)]});let _0x5dc0da=_0x3dd39c['data'];return _0x13e624&&(_0x5dc0da=_0x3dd39c['data'][_0x3159a2(0xb7)](_0x341028=>matchGlobPattern(_0x341028[_0x3159a2(0xae)],_0x13e624))),await handleSDKOutput(_0x5dc0da,_0x4938d0),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0xe77a40(0xae)]='engage:campaign:show';['description']=a16_0xe77a40(0xf1);async[a16_0xe77a40(0x7d)](_0xd9a5fe){const _0x30da1f=a16_0xe77a40,{options:_0x2cfeff,args:_0x1336c5,tdx:_0x4ce7cd}=_0xd9a5fe;if(_0x1336c5['length']===0x0)return console[_0x30da1f(0xd4)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x30da1f(0xd4)](_0x30da1f(0x72)),0x1;const _0x30a4e6=_0x1336c5[0x0],_0x2ba2bd=_0x2cfeff,_0x3564e3=await resolveWorkspaceIdFromOptions(_0x2ba2bd,_0x4ce7cd),_0x40759a=_0x2ba2bd['full'];if(_0x40759a){const _0xb427d6=await withSpinner('Fetching\x20campaign\x20\x27'+_0x30a4e6+_0x30da1f(0xfe),()=>_0x4ce7cd['engage'][_0x30da1f(0xad)](_0x30a4e6,_0x3564e3),{'verbose':_0x2cfeff[_0x30da1f(0xee)]});await handleSDKOutput([_0xb427d6],_0x2cfeff);}else{const _0x994423=await withSpinner(_0x30da1f(0xf6)+_0x30a4e6+_0x30da1f(0xfe),()=>_0x4ce7cd[_0x30da1f(0xe5)]['getCampaign'](_0x30a4e6,_0x3564e3),{'verbose':_0x2cfeff[_0x30da1f(0xee)]});await handleSDKOutput([_0x994423],_0x2cfeff);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0xe77a40(0xae)]=a16_0xe77a40(0xff);['description']='Create\x20a\x20new\x20campaign';async['execute'](_0x1484d6){const _0x263de8=a16_0xe77a40,{options:_0x121648,tdx:_0x2e239f}=_0x1484d6,_0x4b65bb=_0x121648,_0x22cf7d=_0x4b65bb[_0x263de8(0xae)],_0x10ba12=_0x4b65bb['type'];if(!_0x22cf7d)return console[_0x263de8(0xd4)]('Error:\x20--name\x20is\x20required'),console[_0x263de8(0xd4)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x10ba12)return console['error'](_0x263de8(0xb3)),console['error'](_0x263de8(0x7f)),0x1;const _0x121f76=await resolveWorkspaceIdFromOptions(_0x4b65bb,_0x2e239f,!![]),_0x214780=await resolveSegmentFromOptions(_0x4b65bb,_0x2e239f),_0x46d8d7=buildConnectorConfig(_0x4b65bb),_0x29af66={'name':_0x22cf7d,'campaignType':_0x10ba12,'workspaceId':_0x121f76,'description':_0x4b65bb[_0x263de8(0xc5)],..._0x214780,'connectorConfig':_0x46d8d7,'startAt':_0x4b65bb[_0x263de8(0x99)],'timezone':_0x4b65bb[_0x263de8(0x86)]},_0xc28ce3=await withSpinner(_0x263de8(0xc8)+_0x22cf7d+'\x27...',()=>_0x2e239f[_0x263de8(0xe5)]['createCampaign'](_0x29af66));return await handleSDKOutput([_0xc28ce3[_0x263de8(0xcd)]],_0x121648),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0xe77a40(0xae)]='engage:campaign:update';['description']=a16_0xe77a40(0xe7);async[a16_0xe77a40(0x7d)](_0x5a43f0){const _0x2f8f58=a16_0xe77a40,{options:_0xaaa3b4,args:_0x337ff5,tdx:_0x258b08}=_0x5a43f0;if(_0x337ff5['length']===0x0)return console[_0x2f8f58(0xd4)](_0x2f8f58(0xdf)),console['error'](_0x2f8f58(0x80)),0x1;const _0x5bab01=_0x337ff5[0x0],_0x1f201b=_0xaaa3b4,_0x2b1c82=await resolveWorkspaceIdFromOptions(_0x1f201b,_0x258b08),_0x485e1c=await resolveSegmentFromOptions(_0x1f201b,_0x258b08),_0x168b16=buildConnectorConfig(_0x1f201b),_0x1a1aef={'name':_0x1f201b[_0x2f8f58(0xae)],'description':_0x1f201b[_0x2f8f58(0xc5)],..._0x485e1c,'connectorConfig':_0x168b16,'startAt':_0x1f201b['startAt'],'timezone':_0x1f201b[_0x2f8f58(0x86)]},_0xc7a28b=Object['fromEntries'](Object[_0x2f8f58(0x9c)](_0x1a1aef)['filter'](([,_0x9f3a93])=>_0x9f3a93!==undefined));if(Object[_0x2f8f58(0xc1)](_0xc7a28b)['length']===0x0)return console[_0x2f8f58(0xd4)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x2f8f58(0xd4)](_0x2f8f58(0xb6)),0x1;const _0x22a12e=await withSpinner(_0x2f8f58(0x9f)+_0x5bab01+'\x27...',()=>_0x258b08[_0x2f8f58(0xe5)][_0x2f8f58(0x88)](_0x5bab01,_0xc7a28b,_0x2b1c82),{'verbose':_0xaaa3b4[_0x2f8f58(0xee)]});return await handleSDKOutput([_0x22a12e[_0x2f8f58(0xcd)]],_0xaaa3b4),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a16_0xe77a40(0xb5);[a16_0xe77a40(0xc5)]=a16_0xe77a40(0xbe);async[a16_0xe77a40(0x7d)](_0x2cd9ac){const _0x1ef901=a16_0xe77a40,{options:_0x4a8eb9,args:_0x4aeff6,tdx:_0x8ecc9c}=_0x2cd9ac;if(_0x4aeff6['length']===0x0)return console[_0x1ef901(0xd4)](_0x1ef901(0xdf)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x10c6dd=_0x4aeff6[0x0],_0x5f1998=_0x4a8eb9,_0x15ee17=await resolveWorkspaceIdFromOptions(_0x5f1998,_0x8ecc9c);if(!_0x4a8eb9['yes']){const _0x47864f=await confirm(_0x1ef901(0x79)+_0x10c6dd+_0x1ef901(0xbb));if(!_0x47864f)return console['log'](_0x1ef901(0xd5)),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x10c6dd+_0x1ef901(0xfe),()=>_0x8ecc9c[_0x1ef901(0xe5)][_0x1ef901(0x84)](_0x10c6dd,_0x15ee17),{'verbose':_0x4a8eb9[_0x1ef901(0xee)]}),console['log'](_0x1ef901(0x94)+_0x10c6dd+_0x1ef901(0xbf)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0xe77a40(0xae)]=a16_0xe77a40(0x70);[a16_0xe77a40(0xc5)]='Launch\x20a\x20campaign';async[a16_0xe77a40(0x7d)](_0x448e54){const _0x34c5cf=a16_0xe77a40,{options:_0x5d928e,args:_0x5f0823,tdx:_0x10ca95}=_0x448e54;if(_0x5f0823[_0x34c5cf(0xc9)]===0x0)return console[_0x34c5cf(0xd4)](_0x34c5cf(0xdf)),console[_0x34c5cf(0xd4)](_0x34c5cf(0xea)),0x1;const _0x391258=_0x5f0823[0x0],_0xb0ca5=_0x5d928e,_0x545e77=await resolveWorkspaceIdFromOptions(_0xb0ca5,_0x10ca95);return await withSpinner(_0x34c5cf(0xa8)+_0x391258+'\x27...',()=>_0x10ca95[_0x34c5cf(0xe5)][_0x34c5cf(0xfc)](_0x391258,_0x545e77),{'verbose':_0x5d928e[_0x34c5cf(0xee)]}),console[_0x34c5cf(0xc4)](_0x34c5cf(0x94)+_0x391258+_0x34c5cf(0x8b)),0x0;}}function a16_0x215d(){const _0x3bf940=['getTemplate','Set\x20workspace\x20context\x20for\x20Engage\x20commands','type','561200yMUDhB','Pause\x20a\x20campaign','listTemplates','Launching\x20campaign\x20\x27','Fetching\x20template\x20\x27','72lDkxjl','Deleting\x20workspace\x20\x27','engage:workspace:use','getCampaignFull','name','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','41337wvKloa','Updating\x20workspace\x20\x27','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','resumeCampaign','engage:campaign:delete','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','filter','Error:\x20Workspace\x20name\x20is\x20required','session','Workspace\x20is\x20required\x20for\x20this\x20operation','\x27?\x20This\x20cannot\x20be\x20undone.','Creating\x20template\x20\x27','149oEExLX','Delete\x20a\x20campaign','\x27\x20deleted\x20successfully','engage_workspace','keys','Pausing\x20campaign\x20\x27','1232896zTnIwp','log','description','subject','Show\x20email\x20template\x20details','Creating\x20campaign\x20\x27','length','Duplicating\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','emailSenderId','data','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','yes','Creating\x20workspace\x20\x27','segment','Engage\x20workspace\x20set\x20to:\x20','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','error','Operation\x20cancelled','Workspace\x20\x27','segmentId','Resuming\x20campaign\x20\x27','editorType','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','engage:workspaces','engage:workspace:create','Resume\x20a\x20paused\x20campaign','Error:\x20--name\x20is\x20required','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:campaign:duplicate','Delete\x20a\x20workspace','Error:\x20--subject\x20is\x20required','244453QQCHYQ','Create\x20an\x20email\x20template','engage','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Update\x20a\x20campaign','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','12560IyrAXh','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','getWorkspaceFull','deleteTemplate','engage:template:show','verbose','engage:templates','MISSING_ARGUMENT','Show\x20campaign\x20details','deleteWorkspace','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','engage:workspace:delete','resolveWorkspaceId','Fetching\x20campaign\x20\x27','Create\x20a\x20workspace','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','9216jLJmFp','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Fetching\x20workspaces...','launchCampaign','resolvePathToResource','\x27...','engage:campaign:create','Fetching\x20templates...','fromEntries','\x27\x20paused\x20successfully','engage:campaign:launch','60nhQzOg','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','segmentName','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','jsonColumns','listWorkspaces','Duplicate\x20a\x20campaign','Show\x20workspace\x20details','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','limit','17092UcafRG','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','execute','Update\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','full','Deleting\x20template\x20\x27','parentId','deleteCampaign','engage:template:update','timezone','Error:\x20--html\x20is\x20required','updateCampaign','createTemplate','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x27\x20launched\x20successfully','Verifying\x20workspace\x20\x27','updateWorkspace','plaintext','html','createWorkspace','List\x20email\x20templates','503986WQHQPa','Delete\x20an\x20email\x20template','Campaign\x20\x27','Update\x20a\x20workspace','getTemplateFull','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','List\x20campaigns','startAt','engage:template:create','pauseCampaign','entries','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Options:\x20--name,\x20--description','Updating\x20campaign\x20\x27','16qWobEM','workspace'];a16_0x215d=function(){return _0x3bf940;};return a16_0x215d();}export class EngageCampaignPauseCommand extends BaseCommand{['name']='engage:campaign:pause';[a16_0xe77a40(0xc5)]=a16_0xe77a40(0xa6);async[a16_0xe77a40(0x7d)](_0x44bc6f){const _0x297c89=a16_0xe77a40,{options:_0x9fbd2a,args:_0x32343f,tdx:_0x4e3d09}=_0x44bc6f;if(_0x32343f[_0x297c89(0xc9)]===0x0)return console[_0x297c89(0xd4)](_0x297c89(0xdf)),console[_0x297c89(0xd4)](_0x297c89(0xda)),0x1;const _0x1c1720=_0x32343f[0x0],_0x5cfd2a=_0x9fbd2a,_0x85e948=await resolveWorkspaceIdFromOptions(_0x5cfd2a,_0x4e3d09);return await withSpinner(_0x297c89(0xc2)+_0x1c1720+'\x27...',()=>_0x4e3d09[_0x297c89(0xe5)][_0x297c89(0x9b)](_0x1c1720,_0x85e948),{'verbose':_0x9fbd2a[_0x297c89(0xee)]}),console['log'](_0x297c89(0x94)+_0x1c1720+_0x297c89(0x6f)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0xe77a40(0xae)]='engage:campaign:resume';[a16_0xe77a40(0xc5)]=a16_0xe77a40(0xdd);async[a16_0xe77a40(0x7d)](_0x5e450c){const _0x6e134e=a16_0xe77a40,{options:_0x39f61c,args:_0x31a172,tdx:_0x5006e5}=_0x5e450c;if(_0x31a172['length']===0x0)return console[_0x6e134e(0xd4)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x6e134e(0xd3)),0x1;const _0x4d1493=_0x31a172[0x0],_0x5d8592=_0x39f61c,_0x10e0d6=await resolveWorkspaceIdFromOptions(_0x5d8592,_0x5006e5);return await withSpinner(_0x6e134e(0xd8)+_0x4d1493+'\x27...',()=>_0x5006e5[_0x6e134e(0xe5)][_0x6e134e(0xb4)](_0x4d1493,_0x10e0d6),{'verbose':_0x39f61c[_0x6e134e(0xee)]}),console[_0x6e134e(0xc4)]('Campaign\x20\x27'+_0x4d1493+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0xe77a40(0xae)]=a16_0xe77a40(0xe0);[a16_0xe77a40(0xc5)]=a16_0xe77a40(0x77);async[a16_0xe77a40(0x7d)](_0x302722){const _0x472750=a16_0xe77a40,{options:_0x32e914,args:_0x1aa456,tdx:_0x59518f}=_0x302722;if(_0x1aa456[_0x472750(0xc9)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x472750(0xd4)](_0x472750(0x7c)),0x1;const _0x310719=_0x1aa456[0x0],_0x32e650=_0x32e914,_0x2bc847=await resolveWorkspaceIdFromOptions(_0x32e650,_0x59518f),_0x4f33bb=await withSpinner(_0x472750(0xca)+_0x310719+'\x27...',()=>_0x59518f[_0x472750(0xe5)]['duplicateCampaign'](_0x310719,_0x2bc847),{'verbose':_0x32e914[_0x472750(0xee)]});return await handleSDKOutput([_0x4f33bb['data']],_0x32e914),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a16_0xe77a40(0xef);['description']=a16_0xe77a40(0x91);async['execute'](_0x622636){const _0x461591=a16_0xe77a40,{options:_0x1c3dee,args:_0x109972,tdx:_0x4fc717}=_0x622636,_0x4ef3b2=_0x109972[0x0],_0x406894=resolveLimit(_0x1c3dee[_0x461591(0x7a)],DEFAULT_LLM_LIMIT),_0xd498f1=_0x1c3dee,_0x29e57e=await resolveWorkspaceIdFromOptions(_0xd498f1,_0x4fc717),_0x57989c=await withSpinner(_0x461591(0x100),()=>_0x4fc717['engage'][_0x461591(0xa7)]({'workspaceId':_0x29e57e,'limit':_0x406894}),{'verbose':_0x1c3dee[_0x461591(0xee)]});let _0x428460=_0x57989c['data'];return _0x4ef3b2&&(_0x428460=_0x57989c[_0x461591(0xcd)][_0x461591(0xb7)](_0x5037ef=>matchGlobPattern(_0x5037ef[_0x461591(0xae)],_0x4ef3b2))),await handleSDKOutput(_0x428460,_0x1c3dee),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0xe77a40(0xae)]=a16_0xe77a40(0xed);[a16_0xe77a40(0xc5)]=a16_0xe77a40(0xc7);async[a16_0xe77a40(0x7d)](_0x3c3716){const _0x412750=a16_0xe77a40,{options:_0x1ce8b0,args:_0x288bcd,tdx:_0xa5f693}=_0x3c3716;if(_0x288bcd['length']===0x0)return console[_0x412750(0xd4)](_0x412750(0xf3)),console[_0x412750(0xd4)](_0x412750(0xce)),0x1;const _0x318885=_0x288bcd[0x0],_0x33ec9b=_0x1ce8b0,_0x140064=await resolveWorkspaceIdFromOptions(_0x33ec9b,_0xa5f693),_0x5279f0=_0x33ec9b[_0x412750(0x81)];if(_0x5279f0){const _0x29e89e=await withSpinner('Fetching\x20template\x20\x27'+_0x318885+_0x412750(0xfe),()=>_0xa5f693[_0x412750(0xe5)][_0x412750(0x96)](_0x318885,_0x140064),{'verbose':_0x1ce8b0[_0x412750(0xee)]});await handleSDKOutput([_0x29e89e],_0x1ce8b0);}else{const _0x281216=await withSpinner(_0x412750(0xa9)+_0x318885+'\x27...',()=>_0xa5f693[_0x412750(0xe5)][_0x412750(0xa2)](_0x318885,_0x140064),{'verbose':_0x1ce8b0[_0x412750(0xee)]});await handleSDKOutput([_0x281216],_0x1ce8b0);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0xe77a40(0xae)]=a16_0xe77a40(0x9a);['description']=a16_0xe77a40(0xe4);async[a16_0xe77a40(0x7d)](_0xe15b15){const _0x22c918=a16_0xe77a40,{options:_0x2e48e8,tdx:_0x509925}=_0xe15b15,_0x2827f5=_0x2e48e8,_0x161146=_0x2827f5[_0x22c918(0xae)],_0x2789b7=_0x2827f5[_0x22c918(0xc6)],_0xa4f228=_0x2827f5[_0x22c918(0x8f)];if(!_0x161146)return console[_0x22c918(0xd4)](_0x22c918(0xde)),console['error'](_0x22c918(0x97)),0x1;if(!_0x2789b7)return console[_0x22c918(0xd4)](_0x22c918(0xe2)),0x1;if(!_0xa4f228)return console[_0x22c918(0xd4)](_0x22c918(0x87)),0x1;const _0x39c53a=await resolveWorkspaceIdFromOptions(_0x2827f5,_0x509925,!![]),_0x2d30b1={'name':_0x161146,'subjectTemplate':_0x2789b7,'htmlTemplate':_0xa4f228,'workspaceId':_0x39c53a,'plaintextTemplate':_0x2827f5['plaintext'],'editorType':_0x2827f5[_0x22c918(0xd9)]},_0x1c0438=await withSpinner(_0x22c918(0xbc)+_0x161146+_0x22c918(0xfe),()=>_0x509925[_0x22c918(0xe5)][_0x22c918(0x89)](_0x2d30b1));return await handleSDKOutput([_0x1c0438[_0x22c918(0xcd)]],_0x2e48e8),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0xe77a40(0x85);[a16_0xe77a40(0xc5)]=a16_0xe77a40(0x7e);async['execute'](_0x3efa58){const _0x560d77=a16_0xe77a40,{options:_0x25b73b,args:_0x2ff280,tdx:_0x10e29e}=_0x3efa58;if(_0x2ff280[_0x560d77(0xc9)]===0x0)return console[_0x560d77(0xd4)](_0x560d77(0xf3)),console[_0x560d77(0xd4)](_0x560d77(0xf8)),0x1;const _0x56b0b5=_0x2ff280[0x0],_0x2f709d=_0x25b73b,_0x4ccdb7=await resolveWorkspaceIdFromOptions(_0x2f709d,_0x10e29e),_0x795653={'name':_0x2f709d[_0x560d77(0xae)],'subjectTemplate':_0x2f709d[_0x560d77(0xc6)],'htmlTemplate':_0x2f709d[_0x560d77(0x8f)],'plaintextTemplate':_0x2f709d[_0x560d77(0x8e)]},_0x30c4a2=Object[_0x560d77(0x6e)](Object[_0x560d77(0x9c)](_0x795653)[_0x560d77(0xb7)](([,_0x5c2ff1])=>_0x5c2ff1!==undefined));if(Object[_0x560d77(0xc1)](_0x30c4a2)[_0x560d77(0xc9)]===0x0)return console['error'](_0x560d77(0xaf)),console['error']('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x39ea4f=await withSpinner('Updating\x20template\x20\x27'+_0x56b0b5+_0x560d77(0xfe),()=>_0x10e29e[_0x560d77(0xe5)]['updateTemplate'](_0x56b0b5,_0x30c4a2,_0x4ccdb7),{'verbose':_0x25b73b[_0x560d77(0xee)]});return await handleSDKOutput([_0x39ea4f[_0x560d77(0xcd)]],_0x25b73b),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0xe77a40(0xae)]='engage:template:delete';[a16_0xe77a40(0xc5)]=a16_0xe77a40(0x93);async[a16_0xe77a40(0x7d)](_0x8625d5){const _0x5645e=a16_0xe77a40,{options:_0x41134f,args:_0x33706d,tdx:_0xb4f102}=_0x8625d5;if(_0x33706d[_0x5645e(0xc9)]===0x0)return console['error'](_0x5645e(0xf3)),console[_0x5645e(0xd4)](_0x5645e(0xcb)),0x1;const _0x4e6436=_0x33706d[0x0],_0x11dfd2=_0x41134f,_0x5b19be=await resolveWorkspaceIdFromOptions(_0x11dfd2,_0xb4f102);if(!_0x41134f[_0x5645e(0xcf)]){const _0x564f87=await confirm(_0x5645e(0xe6)+_0x4e6436+_0x5645e(0xbb));if(!_0x564f87)return console[_0x5645e(0xc4)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x5645e(0x82)+_0x4e6436+_0x5645e(0xfe),()=>_0xb4f102[_0x5645e(0xe5)][_0x5645e(0xec)](_0x4e6436,_0x5b19be),{'verbose':_0x41134f[_0x5645e(0xee)]}),console[_0x5645e(0xc4)]('Template\x20\x27'+_0x4e6436+_0x5645e(0xbf)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0xe77a40(0xae)]=a16_0xe77a40(0xdb);[a16_0xe77a40(0xc5)]='List\x20workspaces';async['execute'](_0x348e10){const _0x31a691=a16_0xe77a40,{options:_0x3d7b7b,args:_0x562595,tdx:_0x18bf7a}=_0x348e10,_0x182ee8=_0x562595[0x0],_0x21bb4f=resolveLimit(_0x3d7b7b['limit'],DEFAULT_LLM_LIMIT),_0xb7c215=await withSpinner(_0x31a691(0xfb),()=>_0x18bf7a['engage'][_0x31a691(0x76)]({'limit':_0x21bb4f}),{'verbose':_0x3d7b7b[_0x31a691(0xee)]});let _0x502c09=_0xb7c215[_0x31a691(0xcd)];return _0x182ee8&&(_0x502c09=_0xb7c215[_0x31a691(0xcd)][_0x31a691(0xb7)](_0x23c02c=>matchGlobPattern(_0x23c02c[_0x31a691(0xae)],_0x182ee8))),await handleSDKOutput(_0x502c09,_0x3d7b7b),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']='engage:workspace:show';['description']=a16_0xe77a40(0x78);async['execute'](_0x43b2e7){const _0x45a31e=a16_0xe77a40,{options:_0x1578c3,args:_0x3348e3,tdx:_0x4b6580}=_0x43b2e7;if(_0x3348e3['length']===0x0)return console[_0x45a31e(0xd4)](_0x45a31e(0xe8)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x2c06b4=_0x3348e3[0x0],_0x2efd3b=_0x1578c3,_0x5cd1b3=_0x2efd3b[_0x45a31e(0x81)];if(_0x5cd1b3){const _0x49b1b6=await withSpinner('Fetching\x20workspace\x20\x27'+_0x2c06b4+_0x45a31e(0xfe),()=>_0x4b6580['engage'][_0x45a31e(0xeb)](_0x2c06b4),{'verbose':_0x1578c3['verbose']});await handleSDKOutput([_0x49b1b6],_0x1578c3);}else{const _0x55cae2=await withSpinner('Fetching\x20workspace\x20\x27'+_0x2c06b4+'\x27...',()=>_0x4b6580[_0x45a31e(0xe5)]['getWorkspace'](_0x2c06b4),{'verbose':_0x1578c3[_0x45a31e(0xee)]});await handleSDKOutput([_0x55cae2],_0x1578c3);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0xe77a40(0xae)]=a16_0xe77a40(0xdc);[a16_0xe77a40(0xc5)]=a16_0xe77a40(0xf7);async[a16_0xe77a40(0x7d)](_0x188587){const _0x4feeaa=a16_0xe77a40,{options:_0x3c7907,tdx:_0x37b50b}=_0x188587,_0xb9f4f9=_0x3c7907,_0x295704=_0xb9f4f9[_0x4feeaa(0xae)];if(!_0x295704)return console['error'](_0x4feeaa(0xde)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x37fde0={'name':_0x295704,'description':_0xb9f4f9[_0x4feeaa(0xc5)]},_0x2d9df=await withSpinner(_0x4feeaa(0xd0)+_0x295704+_0x4feeaa(0xfe),()=>_0x37b50b[_0x4feeaa(0xe5)][_0x4feeaa(0x90)](_0x37fde0));return await handleSDKOutput([_0x2d9df[_0x4feeaa(0xcd)]],_0x3c7907),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0xe77a40(0xae)]='engage:workspace:update';[a16_0xe77a40(0xc5)]=a16_0xe77a40(0x95);async[a16_0xe77a40(0x7d)](_0x57272b){const _0x4adbd1=a16_0xe77a40,{options:_0x555fc9,args:_0x19d977,tdx:_0x3b8b41}=_0x57272b;if(_0x19d977['length']===0x0)return console[_0x4adbd1(0xd4)](_0x4adbd1(0xe8)),console[_0x4adbd1(0xd4)](_0x4adbd1(0xb0)),0x1;const _0x148578=_0x19d977[0x0],_0x39117a=_0x555fc9,_0x5bd40c={'name':_0x39117a[_0x4adbd1(0xae)],'description':_0x39117a[_0x4adbd1(0xc5)]},_0x409a55=Object[_0x4adbd1(0x6e)](Object['entries'](_0x5bd40c)['filter'](([,_0x42ff2d])=>_0x42ff2d!==undefined));if(Object['keys'](_0x409a55)[_0x4adbd1(0xc9)]===0x0)return console[_0x4adbd1(0xd4)](_0x4adbd1(0xaf)),console[_0x4adbd1(0xd4)](_0x4adbd1(0x9e)),0x1;const _0x53def1=await withSpinner(_0x4adbd1(0xb2)+_0x148578+_0x4adbd1(0xfe),()=>_0x3b8b41[_0x4adbd1(0xe5)][_0x4adbd1(0x8d)](_0x148578,_0x409a55),{'verbose':_0x555fc9[_0x4adbd1(0xee)]});return await handleSDKOutput([_0x53def1['data']],_0x555fc9),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0xe77a40(0xae)]=a16_0xe77a40(0xf4);['description']=a16_0xe77a40(0xe1);async['execute'](_0x352e2f){const _0x41c21d=a16_0xe77a40,{options:_0x25fa27,args:_0x4cd32e,tdx:_0x59354b}=_0x352e2f;if(_0x4cd32e['length']===0x0)return console[_0x41c21d(0xd4)](_0x41c21d(0xe8)),console[_0x41c21d(0xd4)](_0x41c21d(0xfa)),0x1;const _0x8e0c74=_0x4cd32e[0x0];if(!_0x25fa27[_0x41c21d(0xcf)]){const _0x3b8a80=await confirm(_0x41c21d(0x9d)+_0x8e0c74+_0x41c21d(0xbb));if(!_0x3b8a80)return console[_0x41c21d(0xc4)](_0x41c21d(0xd5)),0x0;}return await withSpinner(_0x41c21d(0xab)+_0x8e0c74+_0x41c21d(0xfe),()=>_0x59354b[_0x41c21d(0xe5)][_0x41c21d(0xf2)](_0x8e0c74),{'verbose':_0x25fa27['verbose']}),console[_0x41c21d(0xc4)](_0x41c21d(0xd6)+_0x8e0c74+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0xe77a40(0xae)]=a16_0xe77a40(0xac);[a16_0xe77a40(0xc5)]=a16_0xe77a40(0xa3);async[a16_0xe77a40(0x7d)](_0x5e9ce7){const _0x509d24=a16_0xe77a40,{options:_0x31fd77,args:_0x2deab9,tdx:_0x199b62}=_0x5e9ce7;if(_0x2deab9[_0x509d24(0xc9)]===0x0)return console['error'](_0x509d24(0xb8)),console[_0x509d24(0xd4)](_0x509d24(0x74)),0x1;const _0x2a8986=_0x2deab9[0x0];await withSpinner(_0x509d24(0x8c)+_0x2a8986+_0x509d24(0xfe),()=>_0x199b62[_0x509d24(0xe5)][_0x509d24(0xf5)](_0x2a8986));const _0x12a38f=_0x31fd77[_0x509d24(0xb9)]||undefined;return saveSessionContext({'engage_workspace':_0x2a8986},_0x12a38f),console[_0x509d24(0xc4)](_0x509d24(0xd2)+_0x2a8986),console[_0x509d24(0xc4)](_0x509d24(0x8a)),0x0;}}