@treasuredata/tdx 0.22.0 → 0.23.1

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 (174) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/mcp-command.js +1 -1
  26. package/dist/commands/parent-segment-command.d.ts +11 -2
  27. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/parent-segment-command.js.map +1 -1
  30. package/dist/commands/profile-command.js +1 -1
  31. package/dist/commands/profiles-command.js +1 -1
  32. package/dist/commands/query-command.js +1 -1
  33. package/dist/commands/schedule-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segment-validate-command.js +1 -1
  42. package/dist/commands/segments.js +1 -1
  43. package/dist/commands/show.js +1 -1
  44. package/dist/commands/status-command.js +1 -1
  45. package/dist/commands/tables.js +1 -1
  46. package/dist/commands/unset-command.js +1 -1
  47. package/dist/commands/use-command.js +1 -1
  48. package/dist/commands/user-command.js +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/command-output.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/constants.js +1 -1
  55. package/dist/core/credential-cache.js +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/keychain.js +1 -1
  58. package/dist/core/profile.d.ts +1 -0
  59. package/dist/core/profile.d.ts.map +1 -1
  60. package/dist/core/profile.js +1 -1
  61. package/dist/core/profile.js.map +1 -1
  62. package/dist/core/project-config.js +1 -1
  63. package/dist/core/session.js +1 -1
  64. package/dist/core/user-cache.js +1 -1
  65. package/dist/core/version.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/mcp/server.js +1 -1
  68. package/dist/mcp/tools/index.js +1 -1
  69. package/dist/mcp/tools/tdx-run.js +1 -1
  70. package/dist/mcp/tools/tdx-search.js +1 -1
  71. package/dist/mcp/utils.js +1 -1
  72. package/dist/proxy/claude-usage-tracker.js +1 -1
  73. package/dist/proxy/passthrough-server.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.js +1 -1
  76. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  77. package/dist/sdk/agent/agent-yaml.js +1 -1
  78. package/dist/sdk/agent/test/evaluator.js +1 -1
  79. package/dist/sdk/agent/test/executor.js +1 -1
  80. package/dist/sdk/agent/test/index.js +1 -1
  81. package/dist/sdk/agent/test/output.js +1 -1
  82. package/dist/sdk/agent/test/parser.js +1 -1
  83. package/dist/sdk/api.js +1 -1
  84. package/dist/sdk/client/cdp-api-client.js +1 -1
  85. package/dist/sdk/client/endpoints.js +1 -1
  86. package/dist/sdk/client/engage-api-client.js +1 -1
  87. package/dist/sdk/client/http-client.js +1 -1
  88. package/dist/sdk/client/llm-api-client.js +1 -1
  89. package/dist/sdk/client/rate-limiter.js +1 -1
  90. package/dist/sdk/client/td-api-client.js +1 -1
  91. package/dist/sdk/client/trino-api-client.js +1 -1
  92. package/dist/sdk/client/workflow-client.js +1 -1
  93. package/dist/sdk/connection-validator.js +1 -1
  94. package/dist/sdk/connection.js +1 -1
  95. package/dist/sdk/engage.js +1 -1
  96. package/dist/sdk/errors.js +1 -1
  97. package/dist/sdk/index.js +1 -1
  98. package/dist/sdk/io/index.js +1 -1
  99. package/dist/sdk/io/node-filesystem.js +1 -1
  100. package/dist/sdk/job.js +1 -1
  101. package/dist/sdk/journey.js +1 -1
  102. package/dist/sdk/llm/chat-cache.js +1 -1
  103. package/dist/sdk/llm/index.js +1 -1
  104. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  105. package/dist/sdk/llm/model-factors.js +1 -1
  106. package/dist/sdk/query/index.js +1 -1
  107. package/dist/sdk/query/sql-parser.js +1 -1
  108. package/dist/sdk/schedule.js +1 -1
  109. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  110. package/dist/sdk/segment/fields-display.js +1 -1
  111. package/dist/sdk/segment/file-discovery.js +1 -1
  112. package/dist/sdk/segment/journey-utils.js +1 -1
  113. package/dist/sdk/segment/journey-yaml.js +1 -1
  114. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  115. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  116. package/dist/sdk/segment/pull-workflow.js +1 -1
  117. package/dist/sdk/segment/push-workflow.js +1 -1
  118. package/dist/sdk/segment/resolution-context.js +1 -1
  119. package/dist/sdk/segment/segment-path-parser.js +1 -1
  120. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  121. package/dist/sdk/segment/target-resolution.js +1 -1
  122. package/dist/sdk/segment/tdx-config.js +1 -1
  123. package/dist/sdk/segment/validate-files.js +1 -1
  124. package/dist/sdk/segment/yaml-validator.js +1 -1
  125. package/dist/sdk/segment.d.ts +24 -0
  126. package/dist/sdk/segment.d.ts.map +1 -1
  127. package/dist/sdk/segment.js +1 -1
  128. package/dist/sdk/segment.js.map +1 -1
  129. package/dist/sdk/types/index.js +1 -1
  130. package/dist/sdk/types/progress.js +1 -1
  131. package/dist/sdk/user.js +1 -1
  132. package/dist/sdk/util/format-detector.js +1 -1
  133. package/dist/sdk/util/formatters.js +1 -1
  134. package/dist/sdk/util/index.js +1 -1
  135. package/dist/sdk/util/tree-formatter.js +1 -1
  136. package/dist/sdk/workflow/archive-validation.js +1 -1
  137. package/dist/sdk/workflow/clone-workflow.js +1 -1
  138. package/dist/sdk/workflow/index.js +1 -1
  139. package/dist/sdk/workflow/pull-workflow.js +1 -1
  140. package/dist/sdk/workflow/push-workflow.js +1 -1
  141. package/dist/sdk/workflow/tdx-config.js +1 -1
  142. package/dist/sdk/workflow/workflow-utils.js +1 -1
  143. package/dist/test-utils/command-runner.js +1 -1
  144. package/dist/test-utils/factories.js +1 -1
  145. package/dist/test-utils/fixtures.js +1 -1
  146. package/dist/test-utils/http-mock.js +1 -1
  147. package/dist/test-utils/index.js +1 -1
  148. package/dist/utils/async.js +1 -1
  149. package/dist/utils/colors.js +1 -1
  150. package/dist/utils/diff.js +1 -1
  151. package/dist/utils/file-permissions.js +1 -1
  152. package/dist/utils/global-cache.js +1 -1
  153. package/dist/utils/json-loader.js +1 -1
  154. package/dist/utils/local-cache.js +1 -1
  155. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  156. package/dist/utils/logger/formatters/index.js +1 -1
  157. package/dist/utils/logger/handlers/console-handler.js +1 -1
  158. package/dist/utils/logger/handlers/file-handler.js +1 -1
  159. package/dist/utils/logger/handlers/index.js +1 -1
  160. package/dist/utils/logger/handlers/null-handler.js +1 -1
  161. package/dist/utils/logger/index.js +1 -1
  162. package/dist/utils/logger/logger.js +1 -1
  163. package/dist/utils/logger/types.js +1 -1
  164. package/dist/utils/option-validation.js +1 -1
  165. package/dist/utils/port.js +1 -1
  166. package/dist/utils/process.js +1 -1
  167. package/dist/utils/prompt.js +1 -1
  168. package/dist/utils/spinner.js +1 -1
  169. package/dist/utils/sse-parser.js +1 -1
  170. package/dist/utils/string-utils.js +1 -1
  171. package/dist/utils/table-ref-parser.js +1 -1
  172. package/dist/utils/tdx-logger.js +1 -1
  173. package/dist/utils/version-check.js +1 -1
  174. package/package.json +1 -1
@@ -1 +1 @@
1
- const a9_0x3d871d=a9_0x36c7;(function(_0x5c5039,_0x2a0ad1){const _0x2c0efc=a9_0x36c7,_0x277338=_0x5c5039();while(!![]){try{const _0x225f94=-parseInt(_0x2c0efc(0x180))/0x1*(parseInt(_0x2c0efc(0x1d8))/0x2)+parseInt(_0x2c0efc(0x165))/0x3*(parseInt(_0x2c0efc(0x15f))/0x4)+parseInt(_0x2c0efc(0x1cc))/0x5+parseInt(_0x2c0efc(0x1ad))/0x6+parseInt(_0x2c0efc(0x14e))/0x7+parseInt(_0x2c0efc(0x15b))/0x8+-parseInt(_0x2c0efc(0x176))/0x9;if(_0x225f94===_0x2a0ad1)break;else _0x277338['push'](_0x277338['shift']());}catch(_0x2e62f0){_0x277338['push'](_0x277338['shift']());}}}(a9_0x53f1,0x3ee4c));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0xa076bf from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findAvailablePort}from'../utils/port.js';import{findExecutable,crossSpawn}from'../utils/process.js';function a9_0x53f1(){const _0x464a88=['Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','✓\x20Settings\x20restored:\x20.claude/settings.local.json','4VnlTCY','inherit','✓\x20Logging\x20to\x20','\x27:\x20','CLAUDE_CODE_USE_BEDROCK','major','303783ziLysX','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','exit','unshift','https://docs.treasuredata.com/mcp','hostname','utf-8','TD\x20Docs\x20MCP\x20Server','CLAUDE_CODE_USE_VERTEX','Restored\x20default\x20td-skills\x20marketplace','\x20configuration\x20failed','red','Claude\x20Code\x20version\x20','\x20is\x20too\x20old\x20(minimum:\x20','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','tdx\x20--profile\x20','port','5642946SNwKMZ','description','\x20claude\x20statusline','Configuring\x20marketplace\x20\x27','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','cause','command','update','Initializing...','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','3457cDRyUl','\x27...','logLevel','Command\x20output:\x20','parse','stop','stringify','warn','text','list','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','site','\x20already\x20configured','remove','Claude\x20Code\x20version\x20check\x20failed','✓\x20Settings\x20configured:\x20.claude/settings.local.json','CLAUDE_CODE_NOT_FOUND','data','Failed\x20to\x20remove\x20marketplace\x20\x27','✓\x20Marketplace\x20\x27','patch','already\x20exists','info','getCurrent','add','account_id','\x27\x20installed','\x27\x20removed','tdx\x20claude\x20statusline','profile','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','toString','error','✓\x20Claude\x20Code\x20version\x20OK','INVALID_ARGUMENT','context','log','ANTHROPIC_MODEL','getLogPath','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','127.0.0.1','tdx','tdx-skills','Command\x20spawn\x20error:\x20','continue','284550NxcWjO','Initializing\x20proxy\x20logger...','td-skills','install','fail','ENOENT','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','passThroughServer','--transport','green','message','join','Warning:\x20Failed\x20to\x20configure\x20','includes','trim','✓\x20Plugin\x20\x27','logger','close','Creating\x20.claude/settings.local.json...','Finding\x20available\x20port...','http://127.0.0.1:','Executing:\x20claude\x20','name','code','apiKey','init','claude','\x20meets\x20minimum\x20requirement','cwd','localhost','workflow-skills','1869405IAPaOD','start','settings.local.json','originalSettings','marketplace','tdx-managed-proxy','minor','):\x20claude\x20','string','.claude','td-docs','Failed\x20to\x20list\x20marketplaces','142HJtTrf','td-skills\x20Plugins','match','\x20or\x20later.','2.0.20','proxy','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','\x27\x20configured','✓\x20Logs\x20saved\x20to\x20','✓\x20Found\x20available\x20port:\x20','llm-proxy','ANTHROPIC_BASE_URL','Failed\x20to\x20launch\x20Claude\x20Code:\x20','ANTHROPIC_AUTH_TOKEN','object','Claude\x20Code\x20CLI\x20not\x20found','env','1178555bQdEpB','plugin','user','✓\x20MCP\x20server\x20\x27','statusLine','mcp','Updating\x20marketplace\x20\x27','Marketplace\x20\x27','Failed\x20to\x20configure\x20marketplace\x20\x27','false','--version','Invalid\x20minimum\x20version\x20format:\x20','Failed\x20to\x20install\x20plugin\x20\x27','3512968sBLDPO','debug'];a9_0x53f1=function(){return _0x464a88;};return a9_0x53f1();}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_0x3d871d(0x1dc);function handleInstallationError(_0x506396,_0x2bd57b,_0x4b758f,_0x26dcc3){const _0x2b1187=a9_0x3d871d;errorContains(_0x506396,_0x2b1187(0x195),'already\x20installed','already\x20configured')?(_0x4b758f[_0x2b1187(0x188)]='✓\x20'+_0x2bd57b+_0x2b1187(0x18c),_0x26dcc3?.[_0x2b1187(0x196)](_0x2bd57b+_0x2b1187(0x18c)),_0x506396 instanceof SDKError&&_0x506396['cause']&&_0x26dcc3?.['debug'](_0x2b1187(0x183)+_0x506396[_0x2b1187(0x17b)]['message'])):(_0x4b758f['warn'](_0x2b1187(0x1b9)+_0x2bd57b),_0x26dcc3?.[_0x2b1187(0x1a0)](_0x2bd57b+_0x2b1187(0x16f),_0x506396));}export function parseVersion(_0x2bdcde){const _0x28f2be=a9_0x3d871d,_0xfbe9e3=_0x2bdcde[_0x28f2be(0x1bb)]()[_0x28f2be(0x1da)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0xfbe9e3)return null;return{'major':parseInt(_0xfbe9e3[0x1],0xa),'minor':parseInt(_0xfbe9e3[0x2],0xa),'patch':parseInt(_0xfbe9e3[0x3],0xa)};}export function compareVersions(_0x3d6bb8,_0x1de271){const _0x5e3bf6=a9_0x3d871d;if(_0x3d6bb8[_0x5e3bf6(0x164)]!==_0x1de271[_0x5e3bf6(0x164)])return _0x3d6bb8[_0x5e3bf6(0x164)]-_0x1de271[_0x5e3bf6(0x164)];if(_0x3d6bb8[_0x5e3bf6(0x1d2)]!==_0x1de271[_0x5e3bf6(0x1d2)])return _0x3d6bb8[_0x5e3bf6(0x1d2)]-_0x1de271['minor'];return _0x3d6bb8['patch']-_0x1de271[_0x5e3bf6(0x194)];}function a9_0x36c7(_0x4829dd,_0x348874){_0x4829dd=_0x4829dd-0x14a;const _0x53f19e=a9_0x53f1();let _0x36c7f5=_0x53f19e[_0x4829dd];return _0x36c7f5;}async function checkClaudeVersion(_0x41e366,_0x47082e){const _0x3985b0=a9_0x3d871d;_0x47082e?.[_0x3985b0(0x15c)](_0x3985b0(0x1b3)+_0x41e366+')');const _0x19c746=await executeClaudeCommand([_0x3985b0(0x158)],undefined,_0x47082e),_0x3c0d06=parseVersion(_0x19c746);if(!_0x3c0d06){_0x47082e?.['warn'](_0x3985b0(0x173)+_0x19c746);return;}const _0xa02bd4=_0x3c0d06[_0x3985b0(0x164)]+'.'+_0x3c0d06[_0x3985b0(0x1d2)]+'.'+_0x3c0d06[_0x3985b0(0x194)],_0x1205c3=parseVersion(_0x41e366);if(!_0x1205c3){_0x47082e?.[_0x3985b0(0x187)](_0x3985b0(0x159)+_0x41e366);return;}if(compareVersions(_0x3c0d06,_0x1205c3)<0x0){_0x47082e?.['error']('Claude\x20Code\x20version\x20'+_0xa02bd4+_0x3985b0(0x172)+_0x41e366+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],_0x3985b0(0x171)+_0xa02bd4+_0x3985b0(0x1de)+_0x41e366+_0x3985b0(0x1db),undefined,{'helpText':_0x3985b0(0x17a)});}_0x47082e?.[_0x3985b0(0x15c)]('Claude\x20Code\x20version\x20'+_0xa02bd4+_0x3985b0(0x1c8));}async function executeClaudeCommand(_0x1010a9,_0x5b021b,_0x3d4516){const _0x348c90=a9_0x3d871d;return _0x3d4516?.[_0x348c90(0x196)](_0x348c90(0x1c2)+_0x1010a9[_0x348c90(0x1b8)]('\x20')),new Promise((_0xe5d311,_0x190871)=>{const _0x1244f0=_0x348c90,_0x1d26f1=crossSpawn(_0x1244f0(0x1c7),_0x1010a9,{'stdio':'pipe'});let _0x5565a9='',_0x2334f1='';_0x1d26f1['stdout']?.['on'](_0x1244f0(0x191),_0x70c262=>{const _0xfd25df=_0x1244f0;_0x5565a9+=_0x70c262[_0xfd25df(0x19f)]();}),_0x1d26f1['stderr']?.['on'](_0x1244f0(0x191),_0x473da8=>{const _0x14f7b9=_0x1244f0;_0x2334f1+=_0x473da8[_0x14f7b9(0x19f)]();}),_0x1d26f1['on'](_0x1244f0(0x1a0),_0x3e5076=>{const _0x29c65b=_0x1244f0;_0x3e5076[_0x29c65b(0x1c4)]===_0x29c65b(0x1b2)?(_0x3d4516?.[_0x29c65b(0x1a0)]('Claude\x20Code\x20CLI\x20not\x20found'),_0x190871(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x29c65b(0x14c),_0x3e5076,{'helpText':_0x29c65b(0x18a)}))):(_0x3d4516?.['error'](_0x29c65b(0x1ab)+_0x3e5076[_0x29c65b(0x1b7)]),_0x190871(new SDKError(ErrorCode['INTERNAL'],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x3e5076['message'],_0x3e5076)));}),_0x1d26f1['on'](_0x1244f0(0x167),_0xe1e94b=>{const _0x5896d1=_0x1244f0;if(_0xe1e94b===0x0)_0xe5d311(_0x5565a9);else _0x5b021b?(_0x3d4516?.[_0x5896d1(0x1a0)]('Command\x20failed\x20(exit\x20'+_0xe1e94b+_0x5896d1(0x1d3)+_0x1010a9[_0x5896d1(0x1b8)]('\x20')),_0x190871(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x5b021b,new Error(_0x2334f1)))):_0xe5d311('');});});}async function ensureMcpServer(_0x5709d1,_0x448aa3,_0x429cb2,_0x1ac97e,_0x4d804e){const _0x2ac29d=a9_0x3d871d;_0x1ac97e['text']='Configuring\x20MCP\x20server\x20\x27'+_0x5709d1+_0x2ac29d(0x181),await executeClaudeCommand([_0x2ac29d(0x153),_0x2ac29d(0x198),_0x5709d1,_0x448aa3,_0x2ac29d(0x1b5),_0x429cb2],_0x2ac29d(0x19e)+_0x5709d1+'\x27',_0x4d804e),_0x1ac97e[_0x2ac29d(0x188)]=_0x2ac29d(0x151)+_0x5709d1+_0x2ac29d(0x1df);}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x4a6efd=process.env.TDX_TD_SKILLS_REPO;if(_0x4a6efd)return _0x4a6efd;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x27fd1c,_0x2719a1){const _0x202c47=a9_0x3d871d;try{const _0x56fe1f=await executeClaudeCommand([_0x202c47(0x14f),_0x202c47(0x1d0),_0x202c47(0x189)],_0x202c47(0x1d7),_0x2719a1);if(!_0x56fe1f[_0x202c47(0x1ba)](_0x27fd1c)){_0x2719a1?.[_0x202c47(0x15c)](_0x202c47(0x155)+_0x27fd1c+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand(['plugin',_0x202c47(0x1d0),_0x202c47(0x18d),_0x27fd1c],_0x202c47(0x192)+_0x27fd1c+'\x27',_0x2719a1),_0x2719a1?.[_0x202c47(0x196)](_0x202c47(0x155)+_0x27fd1c+_0x202c47(0x19b));}catch(_0xeae95d){_0x2719a1?.['warn'](_0x202c47(0x192)+_0x27fd1c+_0x202c47(0x162)+_0xeae95d);}}async function restoreDefaultTdSkillsMarketplace(_0x1cb1db){const _0x29f5a7=a9_0x3d871d;try{await removeMarketplace(_0x29f5a7(0x1af),_0x1cb1db),await executeClaudeCommand([_0x29f5a7(0x14f),_0x29f5a7(0x1d0),_0x29f5a7(0x198),DEFAULT_TD_SKILLS_URL],undefined,_0x1cb1db),_0x1cb1db?.[_0x29f5a7(0x196)](_0x29f5a7(0x16e));}catch{}}async function ensureMarketplace(_0x2f1c16,_0x58806e,_0x2fe4eb,_0x19a55a){const _0x346e7d=a9_0x3d871d;_0x2fe4eb[_0x346e7d(0x188)]=_0x346e7d(0x179)+_0x2f1c16+_0x346e7d(0x181),await executeClaudeCommand([_0x346e7d(0x14f),_0x346e7d(0x1d0),'add',_0x58806e],_0x346e7d(0x156)+_0x2f1c16+'\x27',_0x19a55a),_0x2fe4eb[_0x346e7d(0x188)]=_0x346e7d(0x193)+_0x2f1c16+_0x346e7d(0x1df);}async function updateMarketplace(_0x3f117f,_0x2c3395,_0x22aaa8){const _0x3e5539=a9_0x3d871d;_0x2c3395[_0x3e5539(0x188)]=_0x3e5539(0x154)+_0x3f117f+'\x27...',await executeClaudeCommand([_0x3e5539(0x14f),_0x3e5539(0x1d0),_0x3e5539(0x17d)],'Failed\x20to\x20update\x20marketplace\x20\x27'+_0x3f117f+'\x27',_0x22aaa8),_0x2c3395[_0x3e5539(0x188)]=_0x3e5539(0x193)+_0x3f117f+'\x27\x20updated';}async function ensurePlugin(_0x2b91b6,_0x3f0cda,_0x4cd47e,_0x2dc6da){const _0x29c82f=a9_0x3d871d;_0x4cd47e[_0x29c82f(0x188)]='Installing\x20plugin\x20\x27'+_0x2b91b6+_0x29c82f(0x181),await executeClaudeCommand([_0x29c82f(0x14f),_0x29c82f(0x1b0),_0x2b91b6+'@'+_0x3f0cda],_0x29c82f(0x15a)+_0x2b91b6+'\x27',_0x2dc6da),_0x4cd47e['text']=_0x29c82f(0x1bc)+_0x2b91b6+_0x29c82f(0x19a);}async function createClaudeSettings(_0x356067,_0x26db67,_0x61ca9b){const _0x108ef4=a9_0x3d871d,_0x4a65b5=join(process[_0x108ef4(0x1c9)](),'.claude'),_0x1bff1a=join(_0x4a65b5,_0x108ef4(0x1ce));await mkdir(_0x4a65b5,{'recursive':!![]});let _0x2ef471={};if(existsSync(_0x1bff1a))try{const _0x57ff22=await readFile(_0x1bff1a,'utf-8');_0x2ef471=JSON[_0x108ef4(0x184)](_0x57ff22);}catch{_0x2ef471={};}const _0x3d0098=_0x2ef471[_0x108ef4(0x14d)]||{},_0x5d656f={'ANTHROPIC_BASE_URL':_0x3d0098['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x3d0098[_0x108ef4(0x1a5)],'ANTHROPIC_AUTH_TOKEN':_0x3d0098[_0x108ef4(0x14a)],'CLAUDE_CODE_USE_BEDROCK':_0x3d0098[_0x108ef4(0x163)],'CLAUDE_CODE_USE_VERTEX':_0x3d0098[_0x108ef4(0x16d)],'statusLine':_0x2ef471['statusLine']},_0x100468={..._0x2ef471,'env':{..._0x3d0098,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x356067,..._0x26db67&&{'ANTHROPIC_MODEL':_0x26db67},'ANTHROPIC_AUTH_TOKEN':_0x108ef4(0x1d1),'CLAUDE_CODE_USE_BEDROCK':_0x108ef4(0x157),'CLAUDE_CODE_USE_VERTEX':_0x108ef4(0x157)},'statusLine':{'type':_0x108ef4(0x17c),'command':_0x61ca9b?_0x108ef4(0x174)+_0x61ca9b+_0x108ef4(0x178):_0x108ef4(0x19c)}};return await writeFile(_0x1bff1a,JSON['stringify'](_0x100468,null,0x2)+'\x0a'),_0x5d656f;}async function restoreClaudeSettings(_0x25156c){const _0x21a24f=a9_0x3d871d,_0x30cc8c=join(process['cwd'](),_0x21a24f(0x1d5)),_0x5d4bc8=join(_0x30cc8c,_0x21a24f(0x1ce));if(!existsSync(_0x5d4bc8))return;try{const _0x41819d=await readFile(_0x5d4bc8,_0x21a24f(0x16b)),_0x1d2da7=JSON[_0x21a24f(0x184)](_0x41819d),_0x58d2f6=_0x1d2da7[_0x21a24f(0x14d)]||{},_0x7dfebc=_0x58d2f6[_0x21a24f(0x1e3)],_0x10f0a8=((()=>{const _0x5d83b1=_0x21a24f;if(typeof _0x7dfebc!==_0x5d83b1(0x1d4))return![];try{const _0x1aa5f5=new URL(_0x7dfebc);return _0x1aa5f5[_0x5d83b1(0x16a)]===_0x5d83b1(0x1ca)||_0x1aa5f5[_0x5d83b1(0x16a)]===_0x5d83b1(0x1a8);}catch{return![];}})());_0x10f0a8?(delete _0x58d2f6[_0x21a24f(0x1e3)],delete _0x58d2f6[_0x21a24f(0x1a5)],delete _0x58d2f6['ANTHROPIC_AUTH_TOKEN'],delete _0x58d2f6[_0x21a24f(0x163)],delete _0x58d2f6[_0x21a24f(0x16d)]):(_0x25156c[_0x21a24f(0x1e3)]!==undefined?_0x58d2f6[_0x21a24f(0x1e3)]=_0x25156c[_0x21a24f(0x1e3)]:delete _0x58d2f6['ANTHROPIC_BASE_URL'],_0x25156c[_0x21a24f(0x1a5)]!==undefined?_0x58d2f6['ANTHROPIC_MODEL']=_0x25156c[_0x21a24f(0x1a5)]:delete _0x58d2f6['ANTHROPIC_MODEL'],_0x25156c[_0x21a24f(0x14a)]!==undefined?_0x58d2f6[_0x21a24f(0x14a)]=_0x25156c[_0x21a24f(0x14a)]:delete _0x58d2f6['ANTHROPIC_AUTH_TOKEN'],_0x25156c[_0x21a24f(0x163)]!==undefined?_0x58d2f6[_0x21a24f(0x163)]=_0x25156c[_0x21a24f(0x163)]:delete _0x58d2f6[_0x21a24f(0x163)],_0x25156c[_0x21a24f(0x16d)]!==undefined?_0x58d2f6[_0x21a24f(0x16d)]=_0x25156c['CLAUDE_CODE_USE_VERTEX']:delete _0x58d2f6[_0x21a24f(0x16d)]);const _0x48d6b0=_0x1d2da7[_0x21a24f(0x152)],_0xd45fd0=((()=>{const _0x1e1a86=_0x21a24f;if(!_0x48d6b0||typeof _0x48d6b0!==_0x1e1a86(0x14b))return![];if(_0x48d6b0['type']!==_0x1e1a86(0x17c))return![];if(typeof _0x48d6b0[_0x1e1a86(0x17c)]!=='string')return![];return _0x48d6b0[_0x1e1a86(0x17c)][_0x1e1a86(0x1ba)](_0x1e1a86(0x1a9))&&_0x48d6b0[_0x1e1a86(0x17c)][_0x1e1a86(0x1ba)]('statusline');})());if(_0xd45fd0)delete _0x1d2da7[_0x21a24f(0x152)];else _0x25156c[_0x21a24f(0x152)]!==undefined?_0x1d2da7[_0x21a24f(0x152)]=_0x25156c[_0x21a24f(0x152)]:delete _0x1d2da7[_0x21a24f(0x152)];_0x1d2da7[_0x21a24f(0x14d)]=_0x58d2f6,await writeFile(_0x5d4bc8,JSON[_0x21a24f(0x186)](_0x1d2da7,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x3d871d(0x1c3)]=a9_0x3d871d(0x1c7);[a9_0x3d871d(0x177)]=a9_0x3d871d(0x15d);[a9_0x3d871d(0x1b4)];[a9_0x3d871d(0x1cf)];[a9_0x3d871d(0x1bd)];[a9_0x3d871d(0x175)];async['execute'](_0x165493){const _0x3249bd=a9_0x3d871d,{tdx:_0x15d6f4,options:_0x59cddb,args:_0x4d9d14}=_0x165493;let _0x155c7b=![];try{const _0xfc28e7=_0x59cddb,_0x3d5ab9=_0xfc28e7[_0x3249bd(0x1dd)]===![],_0x153de8=_0xfc28e7[_0x3249bd(0x1ac)]===!![],_0x190f5d=_0xfc28e7['resume']===!![],_0x2db097=[..._0x4d9d14];if(_0x153de8)_0x2db097[_0x3249bd(0x168)]('-c');else _0x190f5d&&_0x2db097['unshift']('-r');const _0x38f9fc=createCommandSpinner(_0x3249bd(0x17e),{'verbose':_0x59cddb['verbose']});_0x38f9fc[_0x3249bd(0x1cd)]();try{if(!_0x3d5ab9){_0x38f9fc[_0x3249bd(0x188)]=_0x3249bd(0x1c0),this[_0x3249bd(0x175)]=await findAvailablePort(0xfa0),_0x38f9fc[_0x3249bd(0x188)]=_0x3249bd(0x1e1)+this[_0x3249bd(0x175)];const _0x328fa2=_0x59cddb[_0x3249bd(0x19d)];try{const _0x18afba=await _0x15d6f4[_0x3249bd(0x150)][_0x3249bd(0x197)]();_0x18afba[_0x3249bd(0x199)]&&writeCachedAccountInfo(_0x59cddb['site'],_0x18afba[_0x3249bd(0x199)],_0x328fa2);}catch{}_0x38f9fc[_0x3249bd(0x188)]=_0x3249bd(0x1ae),this[_0x3249bd(0x1bd)]=new TDXLogger(_0x59cddb[_0x3249bd(0x182)],!![]),await this[_0x3249bd(0x1bd)][_0x3249bd(0x1c6)]();const _0x39ebf6=this['logger']['getLogPath']();_0x38f9fc[_0x3249bd(0x188)]=_0x3249bd(0x161)+_0x39ebf6;const _0x47c30f=getEndpoint(_0x59cddb[_0x3249bd(0x18b)],_0x3249bd(0x1e2));_0x38f9fc[_0x3249bd(0x188)]='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';if(!_0x15d6f4['context']['apiKey'])throw new SDKError(ErrorCode[_0x3249bd(0x1a2)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x3249bd(0x1b4)]=new PassThroughProxyServer({'port':this[_0x3249bd(0x175)],'llmProxyUrl':_0x47c30f,'apiKey':_0x15d6f4[_0x3249bd(0x1a3)][_0x3249bd(0x1c5)],'logger':this['logger'],'site':_0x59cddb[_0x3249bd(0x18b)],'profile':_0x328fa2}),await this['passThroughServer'][_0x3249bd(0x1cd)](),_0x38f9fc[_0x3249bd(0x188)]=_0x3249bd(0x1a7)+this['port']+'\x20→\x20'+_0x47c30f,_0x38f9fc[_0x3249bd(0x188)]=_0x3249bd(0x1bf),this[_0x3249bd(0x1cf)]=await createClaudeSettings(this[_0x3249bd(0x175)],undefined,_0x328fa2),_0x38f9fc[_0x3249bd(0x188)]=_0x3249bd(0x18f);}else _0x38f9fc['text']=_0x3249bd(0x17f);try{_0x38f9fc[_0x3249bd(0x188)]='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x3249bd(0x1bd)]),_0x38f9fc['text']=_0x3249bd(0x1a1);}catch(_0x3f8249){_0x38f9fc[_0x3249bd(0x1b1)](_0x3249bd(0x18e));throw _0x3f8249;}try{await ensureMcpServer(_0x3249bd(0x1d6),_0x3249bd(0x169),'http',_0x38f9fc,this['logger']);}catch(_0x5ab752){handleInstallationError(_0x5ab752,_0x3249bd(0x16c),_0x38f9fc,this['logger']);}try{const _0x2f7dba=getTdSkillsRepoUrl();_0x155c7b=_0x2f7dba!==DEFAULT_TD_SKILLS_URL,_0x155c7b&&await removeMarketplace('td-skills',this[_0x3249bd(0x1bd)]),await ensureMarketplace(_0x3249bd(0x1af),_0x2f7dba,_0x38f9fc,this['logger']),await updateMarketplace('td-skills',_0x38f9fc,this['logger']),await ensurePlugin('sql-skills',_0x3249bd(0x1af),_0x38f9fc,this['logger']),await ensurePlugin(_0x3249bd(0x1cb),_0x3249bd(0x1af),_0x38f9fc,this[_0x3249bd(0x1bd)]),await ensurePlugin(_0x3249bd(0x1aa),'td-skills',_0x38f9fc,this[_0x3249bd(0x1bd)]);}catch(_0x4143d3){handleInstallationError(_0x4143d3,_0x3249bd(0x1d9),_0x38f9fc,this[_0x3249bd(0x1bd)]);}_0x38f9fc[_0x3249bd(0x185)]();}catch(_0x56f786){_0x38f9fc['fail']('Setup\x20failed');throw _0x56f786;}const _0x2a3e4f=await findExecutable(_0x3249bd(0x1c7));if(!_0x2a3e4f)throw new SDKError(ErrorCode[_0x3249bd(0x190)],_0x3249bd(0x14c),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x364529={...process.env};!_0x3d5ab9&&(_0x364529[_0x3249bd(0x1e3)]=_0x3249bd(0x1c1)+this[_0x3249bd(0x175)],_0x364529['ANTHROPIC_AUTH_TOKEN']=_0x3249bd(0x1d1),_0x364529[_0x3249bd(0x163)]=_0x3249bd(0x157),_0x364529[_0x3249bd(0x16d)]=_0x3249bd(0x157));const _0x42cfce=crossSpawn(_0x2a3e4f,_0x2db097,{'stdio':_0x3249bd(0x160),'env':_0x364529}),_0x2a41ab=await new Promise(_0x174e5a=>{const _0x85fd1f=_0x3249bd;_0x42cfce['on'](_0x85fd1f(0x167),_0x16f137=>{_0x174e5a(_0x16f137||0x0);}),_0x42cfce['on']('error',_0x442dd1=>{const _0x4a2264=_0x85fd1f;console[_0x4a2264(0x1a0)](a9_0xa076bf[_0x4a2264(0x170)](_0x4a2264(0x1e4)+_0x442dd1['message'])),_0x174e5a(0x1);});});_0x155c7b&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0x3249bd(0x1b4)]&&(await this[_0x3249bd(0x1b4)][_0x3249bd(0x185)](),console[_0x3249bd(0x1a4)](a9_0xa076bf[_0x3249bd(0x1b6)](_0x3249bd(0x166))));if(this[_0x3249bd(0x1bd)]){await this[_0x3249bd(0x1bd)][_0x3249bd(0x1be)]();const _0x52a542=this[_0x3249bd(0x1bd)][_0x3249bd(0x1a6)]();console['log'](a9_0xa076bf['green'](_0x3249bd(0x1e0)+_0x52a542));}return this[_0x3249bd(0x1cf)]&&(await restoreClaudeSettings(this[_0x3249bd(0x1cf)]),console[_0x3249bd(0x1a4)](a9_0xa076bf[_0x3249bd(0x1b6)](_0x3249bd(0x15e)))),_0x2a41ab;}catch(_0x13d7b0){_0x155c7b&&await restoreDefaultTdSkillsMarketplace(this[_0x3249bd(0x1bd)]);this[_0x3249bd(0x1b4)]&&await this[_0x3249bd(0x1b4)][_0x3249bd(0x185)]();this['logger']&&await this[_0x3249bd(0x1bd)][_0x3249bd(0x1be)]();this[_0x3249bd(0x1cf)]&&await restoreClaudeSettings(this[_0x3249bd(0x1cf)]);throw _0x13d7b0;}}}
1
+ const a9_0x15a2b0=a9_0x3364;(function(_0x5cb3d8,_0x290aad){const _0x2e3de9=a9_0x3364,_0x5511bb=_0x5cb3d8();while(!![]){try{const _0x1688ac=-parseInt(_0x2e3de9(0x148))/0x1+parseInt(_0x2e3de9(0x142))/0x2+parseInt(_0x2e3de9(0x16c))/0x3*(parseInt(_0x2e3de9(0x117))/0x4)+parseInt(_0x2e3de9(0x116))/0x5+-parseInt(_0x2e3de9(0x17b))/0x6+-parseInt(_0x2e3de9(0x15a))/0x7+parseInt(_0x2e3de9(0xfb))/0x8;if(_0x1688ac===_0x290aad)break;else _0x5511bb['push'](_0x5511bb['shift']());}catch(_0x5286d5){_0x5511bb['push'](_0x5511bb['shift']());}}}(a9_0x23eb,0xf10da));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x514734 from'chalk';function a9_0x23eb(){const _0x2d4994=['\x20claude\x20statusline','ENOENT','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','Checking\x20Claude\x20Code\x20version...','object','info','data','3113764SHRtxh','\x27...','profile','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','\x27\x20configured','llm-proxy','1702625jkmzSS','debug','td-skills','Configuring\x20MCP\x20server\x20\x27','Updating\x20marketplace\x20\x27','Finding\x20available\x20port...','apiKey','CLAUDE_CODE_NOT_FOUND','Executing:\x20claude\x20','stdout','already\x20exists','http','Initializing\x20proxy\x20logger...','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','sql-skills','settings.local.json','marketplace','td-skills\x20Plugins','5096448nxLStL','INVALID_ARGUMENT','major','INTERNAL','✓\x20Found\x20available\x20port:\x20','Command\x20output:\x20','Warning:\x20Failed\x20to\x20configure\x20','originalSettings','hostname','--transport','--version','2.0.20','unshift','\x27\x20updated','already\x20configured','✓\x20Marketplace\x20\x27','✓\x20Logging\x20to\x20','description','2715522pXtYyi','parse','match','Failed\x20to\x20configure\x20marketplace\x20\x27','Invalid\x20minimum\x20version\x20format:\x20','tdx','Initializing...','workflow-skills','\x27\x20removed','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','ANTHROPIC_MODEL','Restored\x20default\x20td-skills\x20marketplace','Marketplace\x20\x27','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','site','3825576NTegZu','Command\x20failed\x20(exit\x20','account_id','join','false','getLogPath','plugin','\x20is\x20too\x20old\x20(minimum:\x20','green','Creating\x20.claude/settings.local.json...','.claude','tdx\x20claude\x20statusline','message','Failed\x20to\x20list\x20marketplaces','):\x20claude\x20','Failed\x20to\x20install\x20plugin\x20\x27','minor','127.0.0.1','\x27\x20installed','stringify','4538864nhCknn','pipe','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','td-docs','cwd','statusLine','ANTHROPIC_AUTH_TOKEN','context','✓\x20Claude\x20Code\x20version\x20OK','Installing\x20plugin\x20\x27','claude','resume','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','update','CLAUDE_CODE_USE_BEDROCK','command','text','warn','add','CLAUDE_CODE_USE_VERTEX','logLevel','Failed\x20to\x20update\x20marketplace\x20\x27','env','already\x20installed','init','log','Claude\x20Code\x20version\x20','5131125SmLOKy','4yzvnKX','\x20→\x20','patch','INSTALLATION_FAILED','start','stop','user','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','ANTHROPIC_BASE_URL','string','continue','utf-8','port','Failed\x20to\x20remove\x20marketplace\x20\x27','tdx-skills','TD\x20Docs\x20MCP\x20Server','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','Claude\x20Code\x20version\x20check\x20failed','cause','exit','name','close','http://127.0.0.1:','Setup\x20failed','passThroughServer','Claude\x20Code\x20CLI\x20not\x20found','https://docs.treasuredata.com/mcp','\x20already\x20configured','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','✓\x20MCP\x20server\x20\x27','statusline','logger','execute','install','error'];a9_0x23eb=function(){return _0x2d4994;};return a9_0x23eb();}import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{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=a9_0x15a2b0(0x165);function handleInstallationError(_0x3bfe6a,_0x4168d5,_0x389ebe,_0x15047a){const _0x15fc07=a9_0x15a2b0;errorContains(_0x3bfe6a,_0x15fc07(0x152),_0x15fc07(0x112),_0x15fc07(0x168))?(_0x389ebe[_0x15fc07(0x10b)]='✓\x20'+_0x4168d5+'\x20already\x20configured',_0x15047a?.[_0x15fc07(0x140)](_0x4168d5+_0x15fc07(0x132)),_0x3bfe6a instanceof SDKError&&_0x3bfe6a['cause']&&_0x15047a?.[_0x15fc07(0x149)](_0x15fc07(0x15f)+_0x3bfe6a[_0x15fc07(0x129)][_0x15fc07(0xf3)])):(_0x389ebe[_0x15fc07(0x10c)](_0x15fc07(0x160)+_0x4168d5),_0x15047a?.['error'](_0x4168d5+'\x20configuration\x20failed',_0x3bfe6a));}export function parseVersion(_0x434a98){const _0x2dbd33=a9_0x15a2b0,_0x439055=_0x434a98['trim']()[_0x2dbd33(0x16e)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x439055)return null;return{'major':parseInt(_0x439055[0x1],0xa),'minor':parseInt(_0x439055[0x2],0xa),'patch':parseInt(_0x439055[0x3],0xa)};}export function compareVersions(_0x537515,_0x17aef2){const _0x4ccc6a=a9_0x15a2b0;if(_0x537515[_0x4ccc6a(0x15c)]!==_0x17aef2[_0x4ccc6a(0x15c)])return _0x537515[_0x4ccc6a(0x15c)]-_0x17aef2['major'];if(_0x537515[_0x4ccc6a(0xf7)]!==_0x17aef2[_0x4ccc6a(0xf7)])return _0x537515[_0x4ccc6a(0xf7)]-_0x17aef2[_0x4ccc6a(0xf7)];return _0x537515[_0x4ccc6a(0x119)]-_0x17aef2['patch'];}async function checkClaudeVersion(_0x41fe35,_0x48a65f){const _0x4f1602=a9_0x15a2b0;_0x48a65f?.[_0x4f1602(0x149)](_0x4f1602(0x133)+_0x41fe35+')');const _0x548a0e=await executeClaudeCommand([_0x4f1602(0x164)],undefined,_0x48a65f),_0x290c3f=parseVersion(_0x548a0e);if(!_0x290c3f){_0x48a65f?.[_0x4f1602(0x10c)]('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x548a0e);return;}const _0x335eec=_0x290c3f[_0x4f1602(0x15c)]+'.'+_0x290c3f['minor']+'.'+_0x290c3f['patch'],_0x35b43b=parseVersion(_0x41fe35);if(!_0x35b43b){_0x48a65f?.[_0x4f1602(0x10c)](_0x4f1602(0x170)+_0x41fe35);return;}if(compareVersions(_0x290c3f,_0x35b43b)<0x0){_0x48a65f?.['error']('Claude\x20Code\x20version\x20'+_0x335eec+_0x4f1602(0xee)+_0x41fe35+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],_0x4f1602(0x115)+_0x335eec+_0x4f1602(0x11e)+_0x41fe35+'\x20or\x20later.',undefined,{'helpText':_0x4f1602(0x127)});}_0x48a65f?.[_0x4f1602(0x149)](_0x4f1602(0x115)+_0x335eec+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x3f444f,_0x352e09,_0x5418c5){const _0x19e930=a9_0x15a2b0;return _0x5418c5?.['info'](_0x19e930(0x150)+_0x3f444f[_0x19e930(0x17e)]('\x20')),new Promise((_0x299784,_0x1743cc)=>{const _0x13c803=_0x19e930,_0x2110c4=crossSpawn(_0x13c803(0x105),_0x3f444f,{'stdio':_0x13c803(0xfc)});let _0x5a0db8='',_0x59b5e1='';_0x2110c4[_0x13c803(0x151)]?.['on']('data',_0x151b2f=>{_0x5a0db8+=_0x151b2f['toString']();}),_0x2110c4['stderr']?.['on'](_0x13c803(0x141),_0x3f2562=>{_0x59b5e1+=_0x3f2562['toString']();}),_0x2110c4['on']('error',_0x36f297=>{const _0x36f313=_0x13c803;_0x36f297['code']===_0x36f313(0x13b)?(_0x5418c5?.[_0x36f313(0x139)](_0x36f313(0x130)),_0x1743cc(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],'Claude\x20Code\x20CLI\x20not\x20found',_0x36f297,{'helpText':_0x36f313(0x13c)}))):(_0x5418c5?.[_0x36f313(0x139)]('Command\x20spawn\x20error:\x20'+_0x36f297[_0x36f313(0xf3)]),_0x1743cc(new SDKError(ErrorCode[_0x36f313(0x15d)],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x36f297[_0x36f313(0xf3)],_0x36f297)));}),_0x2110c4['on'](_0x13c803(0x12a),_0x22f2e7=>{const _0x34432f=_0x13c803;if(_0x22f2e7===0x0)_0x299784(_0x5a0db8);else _0x352e09?(_0x5418c5?.[_0x34432f(0x139)](_0x34432f(0x17c)+_0x22f2e7+_0x34432f(0xf5)+_0x3f444f['join']('\x20')),_0x1743cc(new SDKError(ErrorCode[_0x34432f(0x11a)],_0x352e09,new Error(_0x59b5e1)))):_0x299784('');});});}async function ensureMcpServer(_0x15c79d,_0x2949cc,_0x39ac11,_0x478766,_0x39c1ff){const _0x2549b9=a9_0x15a2b0;_0x478766['text']=_0x2549b9(0x14b)+_0x15c79d+_0x2549b9(0x143),await executeClaudeCommand(['mcp','add',_0x15c79d,_0x2949cc,_0x2549b9(0x163),_0x39ac11],_0x2549b9(0x179)+_0x15c79d+'\x27',_0x39c1ff),_0x478766[_0x2549b9(0x10b)]=_0x2549b9(0x134)+_0x15c79d+_0x2549b9(0x146);}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x25a011=process.env.TDX_TD_SKILLS_REPO;if(_0x25a011)return _0x25a011;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x1944c4,_0x2f4a84){const _0x449c93=a9_0x15a2b0;try{const _0x1e7010=await executeClaudeCommand(['plugin','marketplace','list'],_0x449c93(0xf4),_0x2f4a84);if(!_0x1e7010['includes'](_0x1944c4)){_0x2f4a84?.['debug'](_0x449c93(0x178)+_0x1944c4+_0x449c93(0xfd));return;}await executeClaudeCommand(['plugin',_0x449c93(0x158),'remove',_0x1944c4],_0x449c93(0x124)+_0x1944c4+'\x27',_0x2f4a84),_0x2f4a84?.['info'](_0x449c93(0x178)+_0x1944c4+_0x449c93(0x174));}catch(_0x1db503){_0x2f4a84?.[_0x449c93(0x10c)](_0x449c93(0x124)+_0x1944c4+'\x27:\x20'+_0x1db503);}}async function restoreDefaultTdSkillsMarketplace(_0x1ceb1f){const _0x1a98b0=a9_0x15a2b0;try{await removeMarketplace(_0x1a98b0(0x14a),_0x1ceb1f),await executeClaudeCommand([_0x1a98b0(0x181),_0x1a98b0(0x158),'add',DEFAULT_TD_SKILLS_URL],undefined,_0x1ceb1f),_0x1ceb1f?.[_0x1a98b0(0x140)](_0x1a98b0(0x177));}catch{}}async function ensureMarketplace(_0x59c99f,_0x4b26c0,_0x2c1aa4,_0x145295){const _0x358a53=a9_0x15a2b0;_0x2c1aa4[_0x358a53(0x10b)]='Configuring\x20marketplace\x20\x27'+_0x59c99f+'\x27...',await executeClaudeCommand([_0x358a53(0x181),_0x358a53(0x158),_0x358a53(0x10d),_0x4b26c0],_0x358a53(0x16f)+_0x59c99f+'\x27',_0x145295),_0x2c1aa4[_0x358a53(0x10b)]=_0x358a53(0x169)+_0x59c99f+_0x358a53(0x146);}async function updateMarketplace(_0x13bb39,_0x2da4ad,_0x55f598){const _0x52306b=a9_0x15a2b0;_0x2da4ad[_0x52306b(0x10b)]=_0x52306b(0x14c)+_0x13bb39+_0x52306b(0x143),await executeClaudeCommand([_0x52306b(0x181),_0x52306b(0x158),_0x52306b(0x108)],_0x52306b(0x110)+_0x13bb39+'\x27',_0x55f598),_0x2da4ad['text']=_0x52306b(0x169)+_0x13bb39+_0x52306b(0x167);}function a9_0x3364(_0x54d7f5,_0x2eb683){_0x54d7f5=_0x54d7f5-0xee;const _0x23eb14=a9_0x23eb();let _0x3364d4=_0x23eb14[_0x54d7f5];return _0x3364d4;}async function ensurePlugin(_0x4a509c,_0x1f468a,_0x2afa73,_0x5ccdcd){const _0x125421=a9_0x15a2b0;_0x2afa73['text']=_0x125421(0x104)+_0x4a509c+_0x125421(0x143),await executeClaudeCommand([_0x125421(0x181),_0x125421(0x138),_0x4a509c+'@'+_0x1f468a],_0x125421(0xf6)+_0x4a509c+'\x27',_0x5ccdcd),_0x2afa73[_0x125421(0x10b)]='✓\x20Plugin\x20\x27'+_0x4a509c+_0x125421(0xf9);}async function createClaudeSettings(_0x5d42b5,_0x46010d,_0x240f7f){const _0x37628f=a9_0x15a2b0,_0x357172=join(process[_0x37628f(0xff)](),_0x37628f(0xf1)),_0x106463=join(_0x357172,_0x37628f(0x157));await mkdir(_0x357172,{'recursive':!![]});let _0x478082={};if(existsSync(_0x106463))try{const _0x427182=await readFile(_0x106463,_0x37628f(0x122));_0x478082=JSON['parse'](_0x427182);}catch{_0x478082={};}const _0x174bcc=_0x478082[_0x37628f(0x111)]||{},_0x48fee0={'ANTHROPIC_BASE_URL':_0x174bcc[_0x37628f(0x11f)],'ANTHROPIC_MODEL':_0x174bcc[_0x37628f(0x176)],'ANTHROPIC_AUTH_TOKEN':_0x174bcc[_0x37628f(0x101)],'CLAUDE_CODE_USE_BEDROCK':_0x174bcc['CLAUDE_CODE_USE_BEDROCK'],'CLAUDE_CODE_USE_VERTEX':_0x174bcc['CLAUDE_CODE_USE_VERTEX'],'statusLine':_0x478082[_0x37628f(0x100)]},_0x18e679={..._0x478082,'env':{..._0x174bcc,'ANTHROPIC_BASE_URL':_0x37628f(0x12d)+_0x5d42b5,..._0x46010d&&{'ANTHROPIC_MODEL':_0x46010d},'ANTHROPIC_AUTH_TOKEN':'tdx-managed-proxy','CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0x37628f(0x17f)},'statusLine':{'type':'command','command':_0x240f7f?'tdx\x20--profile\x20'+_0x240f7f+_0x37628f(0x13a):_0x37628f(0xf2)}};return await writeFile(_0x106463,JSON[_0x37628f(0xfa)](_0x18e679,null,0x2)+'\x0a'),_0x48fee0;}async function restoreClaudeSettings(_0xde46b8){const _0x359f75=a9_0x15a2b0,_0x21632a=join(process[_0x359f75(0xff)](),'.claude'),_0x427f7b=join(_0x21632a,_0x359f75(0x157));if(!existsSync(_0x427f7b))return;try{const _0x5ed418=await readFile(_0x427f7b,_0x359f75(0x122)),_0x24f80c=JSON[_0x359f75(0x16d)](_0x5ed418),_0x1ff01a=_0x24f80c[_0x359f75(0x111)]||{},_0xd6b053=_0x1ff01a[_0x359f75(0x11f)],_0x110fad=((()=>{const _0x389e51=_0x359f75;if(typeof _0xd6b053!=='string')return![];try{const _0x499cdb=new URL(_0xd6b053);return _0x499cdb[_0x389e51(0x162)]==='localhost'||_0x499cdb[_0x389e51(0x162)]===_0x389e51(0xf8);}catch{return![];}})());_0x110fad?(delete _0x1ff01a[_0x359f75(0x11f)],delete _0x1ff01a[_0x359f75(0x176)],delete _0x1ff01a[_0x359f75(0x101)],delete _0x1ff01a[_0x359f75(0x109)],delete _0x1ff01a[_0x359f75(0x10e)]):(_0xde46b8['ANTHROPIC_BASE_URL']!==undefined?_0x1ff01a[_0x359f75(0x11f)]=_0xde46b8['ANTHROPIC_BASE_URL']:delete _0x1ff01a['ANTHROPIC_BASE_URL'],_0xde46b8[_0x359f75(0x176)]!==undefined?_0x1ff01a[_0x359f75(0x176)]=_0xde46b8[_0x359f75(0x176)]:delete _0x1ff01a[_0x359f75(0x176)],_0xde46b8[_0x359f75(0x101)]!==undefined?_0x1ff01a[_0x359f75(0x101)]=_0xde46b8[_0x359f75(0x101)]:delete _0x1ff01a['ANTHROPIC_AUTH_TOKEN'],_0xde46b8[_0x359f75(0x109)]!==undefined?_0x1ff01a[_0x359f75(0x109)]=_0xde46b8[_0x359f75(0x109)]:delete _0x1ff01a['CLAUDE_CODE_USE_BEDROCK'],_0xde46b8[_0x359f75(0x10e)]!==undefined?_0x1ff01a[_0x359f75(0x10e)]=_0xde46b8[_0x359f75(0x10e)]:delete _0x1ff01a[_0x359f75(0x10e)]);const _0x5bd29c=_0x24f80c[_0x359f75(0x100)],_0x365130=((()=>{const _0xffed4=_0x359f75;if(!_0x5bd29c||typeof _0x5bd29c!==_0xffed4(0x13f))return![];if(_0x5bd29c['type']!=='command')return![];if(typeof _0x5bd29c[_0xffed4(0x10a)]!==_0xffed4(0x120))return![];return _0x5bd29c['command']['includes'](_0xffed4(0x171))&&_0x5bd29c[_0xffed4(0x10a)]['includes'](_0xffed4(0x135));})());if(_0x365130)delete _0x24f80c['statusLine'];else _0xde46b8[_0x359f75(0x100)]!==undefined?_0x24f80c[_0x359f75(0x100)]=_0xde46b8[_0x359f75(0x100)]:delete _0x24f80c['statusLine'];_0x24f80c[_0x359f75(0x111)]=_0x1ff01a,await writeFile(_0x427f7b,JSON['stringify'](_0x24f80c,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x15a2b0(0x12b)]=a9_0x15a2b0(0x105);[a9_0x15a2b0(0x16b)]=a9_0x15a2b0(0x175);[a9_0x15a2b0(0x12f)];[a9_0x15a2b0(0x161)];[a9_0x15a2b0(0x136)];[a9_0x15a2b0(0x123)];async[a9_0x15a2b0(0x137)](_0x22007e){const _0x376488=a9_0x15a2b0,{tdx:_0x13a271,options:_0x232d3d,args:_0x1f90dc}=_0x22007e;let _0x41d73c=![];try{const _0x300eca=_0x232d3d,_0x390fc7=_0x300eca['proxy']===![],_0x1fa9bd=_0x300eca[_0x376488(0x121)]===!![],_0x1bdaf9=_0x300eca[_0x376488(0x106)]===!![],_0x101e0c=[..._0x1f90dc];if(_0x1fa9bd)_0x101e0c['unshift']('-c');else _0x1bdaf9&&_0x101e0c[_0x376488(0x166)]('-r');const _0x3e5417=createCommandSpinner(_0x376488(0x172),{'verbose':_0x232d3d['verbose']});_0x3e5417['start']();try{if(!_0x390fc7){_0x3e5417[_0x376488(0x10b)]=_0x376488(0x14d),this[_0x376488(0x123)]=await findAvailablePort(0xfa0),_0x3e5417[_0x376488(0x10b)]=_0x376488(0x15e)+this[_0x376488(0x123)];const _0x29635e=_0x232d3d[_0x376488(0x144)];try{const _0x5bc0b5=await _0x13a271[_0x376488(0x11d)]['getCurrent']();_0x5bc0b5[_0x376488(0x17d)]&&writeCachedAccountInfo(_0x232d3d[_0x376488(0x17a)],_0x5bc0b5[_0x376488(0x17d)],_0x29635e);}catch{}_0x3e5417['text']=_0x376488(0x154),this[_0x376488(0x136)]=new TDXLogger(_0x232d3d[_0x376488(0x10f)],!![]),await this['logger'][_0x376488(0x113)]();const _0x1def31=this[_0x376488(0x136)][_0x376488(0x180)]();_0x3e5417[_0x376488(0x10b)]=_0x376488(0x16a)+_0x1def31;const _0x38f9f7=getEndpoint(_0x232d3d[_0x376488(0x17a)],_0x376488(0x147));_0x3e5417['text']=_0x376488(0x13d);if(!_0x13a271[_0x376488(0x102)][_0x376488(0x14e)])throw new SDKError(ErrorCode[_0x376488(0x15b)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x376488(0x12f)]=new PassThroughProxyServer({'port':this[_0x376488(0x123)],'llmProxyUrl':_0x38f9f7,'apiKey':_0x13a271[_0x376488(0x102)]['apiKey'],'logger':this[_0x376488(0x136)],'site':_0x232d3d[_0x376488(0x17a)],'profile':_0x29635e}),await this[_0x376488(0x12f)][_0x376488(0x11b)](),_0x3e5417['text']=_0x376488(0x155)+this[_0x376488(0x123)]+_0x376488(0x118)+_0x38f9f7,_0x3e5417[_0x376488(0x10b)]=_0x376488(0xf0),this[_0x376488(0x161)]=await createClaudeSettings(this[_0x376488(0x123)],undefined,_0x29635e),_0x3e5417[_0x376488(0x10b)]='✓\x20Settings\x20configured:\x20.claude/settings.local.json';}else _0x3e5417[_0x376488(0x10b)]=_0x376488(0x107);try{_0x3e5417[_0x376488(0x10b)]=_0x376488(0x13e),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x376488(0x136)]),_0x3e5417[_0x376488(0x10b)]=_0x376488(0x103);}catch(_0x276be1){_0x3e5417['fail'](_0x376488(0x128));throw _0x276be1;}try{await ensureMcpServer(_0x376488(0xfe),_0x376488(0x131),_0x376488(0x153),_0x3e5417,this['logger']);}catch(_0x503249){handleInstallationError(_0x503249,_0x376488(0x126),_0x3e5417,this[_0x376488(0x136)]);}try{const _0xeccd92=getTdSkillsRepoUrl();_0x41d73c=_0xeccd92!==DEFAULT_TD_SKILLS_URL,_0x41d73c&&await removeMarketplace(_0x376488(0x14a),this['logger']),await ensureMarketplace(_0x376488(0x14a),_0xeccd92,_0x3e5417,this[_0x376488(0x136)]),await updateMarketplace(_0x376488(0x14a),_0x3e5417,this[_0x376488(0x136)]),await ensurePlugin(_0x376488(0x156),_0x376488(0x14a),_0x3e5417,this[_0x376488(0x136)]),await ensurePlugin(_0x376488(0x173),_0x376488(0x14a),_0x3e5417,this['logger']),await ensurePlugin(_0x376488(0x125),_0x376488(0x14a),_0x3e5417,this[_0x376488(0x136)]);}catch(_0x2e324e){handleInstallationError(_0x2e324e,_0x376488(0x159),_0x3e5417,this['logger']);}_0x3e5417['stop']();}catch(_0x3649f8){_0x3e5417['fail'](_0x376488(0x12e));throw _0x3649f8;}const _0x570d62=await findExecutable(_0x376488(0x105));if(!_0x570d62)throw new SDKError(ErrorCode[_0x376488(0x14f)],_0x376488(0x130),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x3d6685={...process.env};!_0x390fc7&&(_0x3d6685[_0x376488(0x11f)]='http://127.0.0.1:'+this[_0x376488(0x123)],_0x3d6685[_0x376488(0x101)]='tdx-managed-proxy',_0x3d6685[_0x376488(0x109)]=_0x376488(0x17f),_0x3d6685['CLAUDE_CODE_USE_VERTEX']='false');const _0x143af3=crossSpawn(_0x570d62,_0x101e0c,{'stdio':'inherit','env':_0x3d6685}),_0x29989f=await new Promise(_0x195655=>{_0x143af3['on']('exit',_0x53b6b2=>{_0x195655(_0x53b6b2||0x0);}),_0x143af3['on']('error',_0x39d98e=>{const _0x4405dc=a9_0x3364;console[_0x4405dc(0x139)](a9_0x514734['red']('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x39d98e['message'])),_0x195655(0x1);});});_0x41d73c&&await restoreDefaultTdSkillsMarketplace(this[_0x376488(0x136)]);this[_0x376488(0x12f)]&&(await this[_0x376488(0x12f)]['stop'](),console['log'](a9_0x514734[_0x376488(0xef)](_0x376488(0x145))));if(this[_0x376488(0x136)]){await this[_0x376488(0x136)]['close']();const _0x3491c2=this['logger']['getLogPath']();console['log'](a9_0x514734[_0x376488(0xef)]('✓\x20Logs\x20saved\x20to\x20'+_0x3491c2));}return this[_0x376488(0x161)]&&(await restoreClaudeSettings(this['originalSettings']),console[_0x376488(0x114)](a9_0x514734[_0x376488(0xef)]('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x29989f;}catch(_0x10c38e){_0x41d73c&&await restoreDefaultTdSkillsMarketplace(this[_0x376488(0x136)]);this[_0x376488(0x12f)]&&await this[_0x376488(0x12f)][_0x376488(0x11c)]();this[_0x376488(0x136)]&&await this['logger'][_0x376488(0x12c)]();this[_0x376488(0x161)]&&await restoreClaudeSettings(this[_0x376488(0x161)]);throw _0x10c38e;}}}
@@ -1 +1 @@
1
- function a10_0x3256(){const _0x47c756=['Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','profile','execute','4957360LYKvnu','tdx\x20','\x20-\x20','\x20session\x20/\x20','join','stdin','latestInputTokens','15227608amhUHT','10321766iOZJtf','statusline','monthCredits','2594136FLXpzg','close','288655TEqLel','push','9450942BBwDGC','parse','\x20today\x20/\x20','description','27BYcUiL','log','💎\x20tdx\x20-\x20Claude','21TbuSWu','🪙\x20credit:\x20','session_id','859988hkrYmN','\x20|\x20','name','sessionCredits'];a10_0x3256=function(){return _0x47c756;};return a10_0x3256();}const a10_0x531f2a=a10_0x5e03;(function(_0x220611,_0x4b2aaf){const _0x8a3fa=a10_0x5e03,_0x2a3c74=_0x220611();while(!![]){try{const _0x3fb696=-parseInt(_0x8a3fa(0xa6))/0x1+parseInt(_0x8a3fa(0xa4))/0x2+-parseInt(_0x8a3fa(0xaf))/0x3*(-parseInt(_0x8a3fa(0x92))/0x4)+parseInt(_0x8a3fa(0x99))/0x5+parseInt(_0x8a3fa(0xa8))/0x6+parseInt(_0x8a3fa(0xa1))/0x7+parseInt(_0x8a3fa(0xa0))/0x8*(-parseInt(_0x8a3fa(0xac))/0x9);if(_0x3fb696===_0x4b2aaf)break;else _0x2a3c74['push'](_0x2a3c74['shift']());}catch(_0xb97030){_0x2a3c74['push'](_0x2a3c74['shift']());}}}(a10_0x3256,0xce1ae));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a10_0x5e03(_0x2adaf3,_0x1a0ca6){_0x2adaf3=_0x2adaf3-0x91;const _0x3256b6=a10_0x3256();let _0x5e0313=_0x3256b6[_0x2adaf3];return _0x5e0313;}import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x2f0d64=0x64){return new Promise(_0x4ff154=>{const _0x3f8c20=a10_0x5e03;let _0x58ae50='',_0x3cd90f=![];const _0x2fb38a=createInterface({'input':process[_0x3f8c20(0x9e)],'terminal':![]}),_0x4641f6=_0x5ed3f1=>{if(_0x3cd90f)return;_0x3cd90f=!![],clearTimeout(_0x5d384b),_0x2fb38a['close'](),_0x4ff154(_0x5ed3f1);},_0x5d384b=setTimeout(()=>{_0x4641f6(null);},_0x2f0d64);_0x2fb38a['on']('line',_0x452891=>{_0x58ae50+=_0x452891;}),_0x2fb38a['on'](_0x3f8c20(0xa5),()=>{const _0x3f8213=_0x3f8c20;if(_0x3cd90f)return;try{const _0x19f17=JSON[_0x3f8213(0xa9)](_0x58ae50);_0x4641f6(_0x19f17);}catch{_0x4641f6(null);}});});}function formatCredits(_0x47537c){return _0x47537c['toFixed'](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x531f2a(0x94)]=a10_0x531f2a(0xa2);[a10_0x531f2a(0xab)]=a10_0x531f2a(0x96);async[a10_0x531f2a(0x98)](_0x2c5cca){const _0x2a70c3=a10_0x531f2a;try{const _0x4d7a5f=await readStdinJson();if(!_0x4d7a5f?.[_0x2a70c3(0x91)])return console[_0x2a70c3(0xad)](_0x2a70c3(0xae)),0x0;const _0x4e882b=_0x4d7a5f[_0x2a70c3(0x91)],_0x104e3e=_0x4d7a5f['model']?.['id']||'',_0x127510=_0x4d7a5f[_0x2a70c3(0x97)]||_0x2c5cca['options'][_0x2a70c3(0x97)],_0x4986fa=await getUsageStats(_0x4e882b,_0x127510),_0x5e7ee0=[],_0x4d53fa=readCachedAccountInfo(_0x127510),_0x1da8a7=_0x4d53fa?_0x2a70c3(0x9a)+_0x4d53fa['site']+':'+_0x4d53fa['accountId']:'tdx',_0x45164b=_0x104e3e?getModelDisplayName(_0x104e3e):'Claude';_0x5e7ee0['push']('💎\x20'+_0x1da8a7+_0x2a70c3(0x9b)+_0x45164b);const _0x21513f=formatCredits(_0x4986fa[_0x2a70c3(0x95)]),_0x40712d=formatCredits(_0x4986fa['todayCredits']),_0x2b2e8a=formatCredits(_0x4986fa[_0x2a70c3(0xa3)]);_0x5e7ee0['push'](_0x2a70c3(0xb0)+_0x21513f+_0x2a70c3(0x9c)+_0x40712d+_0x2a70c3(0xaa)+_0x2b2e8a+'\x20month');if(_0x4986fa[_0x2a70c3(0x9f)]>0x0&&_0x104e3e){const _0x1a807c=formatTokenCount(_0x4986fa[_0x2a70c3(0x9f)]),_0xba2fe6=calculateContextPercentage(_0x4986fa[_0x2a70c3(0x9f)],_0x104e3e);_0x5e7ee0[_0x2a70c3(0xa7)]('🧠\x20'+_0x1a807c+'\x20('+_0xba2fe6+'%)');}return console['log'](_0x5e7ee0[_0x2a70c3(0x9d)](_0x2a70c3(0x93))),0x0;}catch{return console['log'](_0x2a70c3(0xae)),0x0;}}}
1
+ const a10_0xe5eba7=a10_0x1fb7;(function(_0x4f2639,_0x20f8c0){const _0x26169e=a10_0x1fb7,_0x4f6a36=_0x4f2639();while(!![]){try{const _0x3cae0d=-parseInt(_0x26169e(0x16d))/0x1+parseInt(_0x26169e(0x155))/0x2*(-parseInt(_0x26169e(0x158))/0x3)+parseInt(_0x26169e(0x15d))/0x4*(-parseInt(_0x26169e(0x16c))/0x5)+-parseInt(_0x26169e(0x15c))/0x6+-parseInt(_0x26169e(0x164))/0x7*(parseInt(_0x26169e(0x16a))/0x8)+parseInt(_0x26169e(0x160))/0x9*(-parseInt(_0x26169e(0x15e))/0xa)+parseInt(_0x26169e(0x172))/0xb;if(_0x3cae0d===_0x20f8c0)break;else _0x4f6a36['push'](_0x4f6a36['shift']());}catch(_0x599541){_0x4f6a36['push'](_0x4f6a36['shift']());}}}(a10_0x23d1,0x755e1));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';function a10_0x23d1(){const _0x5e62a0=['Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','latestInputTokens','profile','2563392uPWTpA','60xvTRBG','80ovyUlD','tdx','179298oOxWRK','💎\x20tdx\x20-\x20Claude','parse','session_id','222481vPXoDS','description','site','\x20|\x20','\x20-\x20','join','96YyQfLh','model','53950MsymOl','457406mToMiY','accountId','💎\x20','execute','line','27168823QfUnTq','monthCredits','log','\x20session\x20/\x20','push','🧠\x20','4oiJrxv','toFixed','stdin','602844RkNrYH'];a10_0x23d1=function(){return _0x5e62a0;};return a10_0x23d1();}import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x4f2a5f=0x64){return new Promise(_0x88d807=>{const _0x5a19bc=a10_0x1fb7;let _0x26a9ce='',_0x536c5c=![];const _0x4db931=createInterface({'input':process[_0x5a19bc(0x157)],'terminal':![]}),_0x491256=_0x5533c8=>{if(_0x536c5c)return;_0x536c5c=!![],clearTimeout(_0x11056e),_0x4db931['close'](),_0x88d807(_0x5533c8);},_0x11056e=setTimeout(()=>{_0x491256(null);},_0x4f2a5f);_0x4db931['on'](_0x5a19bc(0x171),_0x2b347b=>{_0x26a9ce+=_0x2b347b;}),_0x4db931['on']('close',()=>{const _0x3ff870=_0x5a19bc;if(_0x536c5c)return;try{const _0x44dc8a=JSON[_0x3ff870(0x162)](_0x26a9ce);_0x491256(_0x44dc8a);}catch{_0x491256(null);}});});}function formatCredits(_0x193884){const _0xa84295=a10_0x1fb7;return _0x193884[_0xa84295(0x156)](0x2);}function a10_0x1fb7(_0x3e92e3,_0x10acf9){_0x3e92e3=_0x3e92e3-0x153;const _0x23d146=a10_0x23d1();let _0x1fb78a=_0x23d146[_0x3e92e3];return _0x1fb78a;}export class ClaudeStatuslineCommand extends BaseCommand{['name']='statusline';[a10_0xe5eba7(0x165)]=a10_0xe5eba7(0x159);async[a10_0xe5eba7(0x170)](_0x53acdb){const _0x38a16e=a10_0xe5eba7;try{const _0x50b995=await readStdinJson();if(!_0x50b995?.[_0x38a16e(0x163)])return console[_0x38a16e(0x174)](_0x38a16e(0x161)),0x0;const _0x46791e=_0x50b995[_0x38a16e(0x163)],_0x510dd6=_0x50b995[_0x38a16e(0x16b)]?.['id']||'',_0x43305b=_0x50b995[_0x38a16e(0x15b)]||_0x53acdb['options'][_0x38a16e(0x15b)],_0x5b97e8=await getUsageStats(_0x46791e,_0x43305b),_0x149b4b=[],_0x2e46a0=readCachedAccountInfo(_0x43305b),_0x28a0b7=_0x2e46a0?'tdx\x20'+_0x2e46a0[_0x38a16e(0x166)]+':'+_0x2e46a0[_0x38a16e(0x16e)]:_0x38a16e(0x15f),_0x4ee390=_0x510dd6?getModelDisplayName(_0x510dd6):'Claude';_0x149b4b[_0x38a16e(0x153)](_0x38a16e(0x16f)+_0x28a0b7+_0x38a16e(0x168)+_0x4ee390);const _0x7976cc=formatCredits(_0x5b97e8['sessionCredits']),_0x1ee145=formatCredits(_0x5b97e8['todayCredits']),_0x3af7a6=formatCredits(_0x5b97e8[_0x38a16e(0x173)]);_0x149b4b[_0x38a16e(0x153)]('🪙\x20credit:\x20'+_0x7976cc+_0x38a16e(0x175)+_0x1ee145+'\x20today\x20/\x20'+_0x3af7a6+'\x20month');if(_0x5b97e8['latestInputTokens']>0x0&&_0x510dd6){const _0x5c6608=formatTokenCount(_0x5b97e8[_0x38a16e(0x15a)]),_0x39acef=calculateContextPercentage(_0x5b97e8[_0x38a16e(0x15a)],_0x510dd6);_0x149b4b['push'](_0x38a16e(0x154)+_0x5c6608+'\x20('+_0x39acef+'%)');}return console['log'](_0x149b4b[_0x38a16e(0x169)](_0x38a16e(0x167))),0x0;}catch{return console[_0x38a16e(0x174)](_0x38a16e(0x161)),0x0;}}}
@@ -1 +1 @@
1
- const a11_0x1492a6=a11_0x3e38;function a11_0x3e38(_0x3169b7,_0x112ef7){_0x3169b7=_0x3169b7-0xd3;const _0x3216fb=a11_0x3216();let _0x3e3847=_0x3216fb[_0x3169b7];return _0x3e3847;}(function(_0x5d194a,_0x3dcd16){const _0x277557=a11_0x3e38,_0x500770=_0x5d194a();while(!![]){try{const _0x237f4a=-parseInt(_0x277557(0x108))/0x1+-parseInt(_0x277557(0xfe))/0x2*(parseInt(_0x277557(0xfa))/0x3)+-parseInt(_0x277557(0xfb))/0x4+parseInt(_0x277557(0x113))/0x5*(parseInt(_0x277557(0xd8))/0x6)+parseInt(_0x277557(0xf4))/0x7*(-parseInt(_0x277557(0xeb))/0x8)+-parseInt(_0x277557(0x110))/0x9*(-parseInt(_0x277557(0xd5))/0xa)+parseInt(_0x277557(0xf5))/0xb;if(_0x237f4a===_0x3dcd16)break;else _0x500770['push'](_0x500770['shift']());}catch(_0x3c6c27){_0x500770['push'](_0x500770['shift']());}}}(a11_0x3216,0x5da3b));function a11_0x3216(){const _0x137d2a=['default','name','(default)','repeat','2-digit','format','63890FJwrPm','log','source','2736WwnzCe','max','length','Usage\x20by\x20Source','execute','bold','\x20\x20Today:\x20\x20\x20','Credits','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','todayCredits','Last\x20Used','dim','monthCredits','cyan','json','\x20days\x20ago','\x20\x20Total:\x20\x20\x20','entryCount','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','1706840hqLvZm','outputStructured','message','jsonl','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','lastUsedAt','Month','usage','error','7NucnQN','20456832KecqvK','toLocaleDateString','toFixed','profile','padStart','532830RxMfJj','2217504aUNOTe','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','round','8QYRYcz','outputTable','padEnd','\x20credits','Requests','description','Unknown\x20error','Source','map','credits','296789bKBgNR','en-CA','yesterday','getTime','Error:\x20','short','Total','\x20\x20Month:\x20\x20\x20','207KgoDcy','toLocaleTimeString','totalCredits','1665OzsjwB','Today','en-US','never'];a11_0x3216=function(){return _0x137d2a;};return a11_0x3216();}import a11_0x4f8398 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(_0x4ba7e8){const _0x319047=a11_0x3e38;return _0x4ba7e8[_0x319047(0xf7)](0x2);}function formatLastUsed(_0x3ca27e){const _0x2d1d90=a11_0x3e38;if(!_0x3ca27e)return _0x2d1d90(0x116);const _0x63424e=new Date(_0x3ca27e),_0x2e3e14=new Date(),_0x5453da=_0x63424e[_0x2d1d90(0xf6)](_0x2d1d90(0x109)),_0x41b69f=_0x2e3e14['toLocaleDateString']('en-CA');if(_0x5453da===_0x41b69f)return'today\x20'+_0x63424e[_0x2d1d90(0x111)](_0x2d1d90(0x115),{'hour':_0x2d1d90(0xd3),'minute':_0x2d1d90(0xd3)});const _0x5a61b0=new Date(_0x5453da),_0x362358=new Date(_0x41b69f),_0x1a264b=Math[_0x2d1d90(0xfd)]((_0x362358['getTime']()-_0x5a61b0[_0x2d1d90(0x10b)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x1a264b===0x1)return _0x2d1d90(0x10a);else return _0x1a264b>0x1&&_0x1a264b<0x7?_0x1a264b+_0x2d1d90(0xe7):_0x63424e[_0x2d1d90(0xf6)]('en-US',{'month':_0x2d1d90(0x10d),'day':'numeric'});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x1492a6(0x118)]=a11_0x1492a6(0xf2);[a11_0x1492a6(0x103)]=a11_0x1492a6(0xfc);async[a11_0x1492a6(0xdc)](_0x1fdae0){const _0x3019b1=a11_0x1492a6,{options:_0x4396d8}=_0x1fdae0,_0x2964a2=_0x4396d8[_0x3019b1(0xd4)]===_0x3019b1(0xe6)||_0x4396d8[_0x3019b1(0xd4)]===_0x3019b1(0xee)||_0x4396d8[_0x3019b1(0xe6)];try{const [_0x2d6e39,_0x45980c,_0xab6a47]=await Promise['all']([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x2964a2?await this['outputStructured'](_0x2d6e39,_0x45980c,_0xab6a47,_0x4396d8):this['outputTable'](_0x2d6e39,_0x45980c,_0xab6a47),0x0;}catch(_0x428c0a){const _0x199b92=_0x428c0a instanceof Error?_0x428c0a[_0x3019b1(0xed)]:_0x3019b1(0x104);return console[_0x3019b1(0xf3)](a11_0x4f8398['red'](_0x3019b1(0x10c)+_0x199b92)),0x1;}}async[a11_0x1492a6(0xec)](_0x32bf1e,_0x28c2c2,_0x1a6c15,_0x57e72c){const _0x345545=a11_0x1492a6,_0x44045e={'summary':{'todayCredits':_0x1a6c15[_0x345545(0xe1)],'monthCredits':_0x1a6c15[_0x345545(0xe4)],'totalCredits':_0x1a6c15[_0x345545(0x112)],'profileCount':_0x1a6c15['profileCount']},'profiles':_0x32bf1e['map'](_0x46f3a3=>({'profile':_0x46f3a3[_0x345545(0xf8)],'credits':_0x46f3a3['credits'],'requests':_0x46f3a3[_0x345545(0xe9)],'lastUsedAt':_0x46f3a3[_0x345545(0xf0)]})),'sources':_0x28c2c2['map'](_0x3a63ba=>({'source':_0x3a63ba[_0x345545(0xd7)],'credits':_0x3a63ba['credits'],'todayCredits':_0x3a63ba[_0x345545(0xe1)],'monthCredits':_0x3a63ba[_0x345545(0xe4)],'requests':_0x3a63ba[_0x345545(0xe9)]}))};await handleSDKOutput([_0x44045e],_0x57e72c);}[a11_0x1492a6(0xff)](_0x529e85,_0x1f2864,_0x4a0be3){const _0x14c3ca=a11_0x1492a6;console[_0x14c3ca(0xd6)](a11_0x4f8398['bold']('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console['log'](a11_0x4f8398[_0x14c3ca(0xe3)]('─'[_0x14c3ca(0x11a)](0x32))),console[_0x14c3ca(0xd6)](_0x14c3ca(0xde)+a11_0x4f8398[_0x14c3ca(0xe5)](formatCredits(_0x4a0be3[_0x14c3ca(0xe1)]))+_0x14c3ca(0x101)),console['log'](_0x14c3ca(0x10f)+a11_0x4f8398[_0x14c3ca(0xe5)](formatCredits(_0x4a0be3['monthCredits']))+'\x20credits'),console['log'](_0x14c3ca(0xe8)+a11_0x4f8398[_0x14c3ca(0xe5)](formatCredits(_0x4a0be3[_0x14c3ca(0x112)]))+_0x14c3ca(0x101)),console['log']();if(_0x1f2864[_0x14c3ca(0xda)]>0x0){console[_0x14c3ca(0xd6)](a11_0x4f8398[_0x14c3ca(0xdd)](_0x14c3ca(0xdb))),console[_0x14c3ca(0xd6)](a11_0x4f8398[_0x14c3ca(0xe3)]('─'[_0x14c3ca(0x11a)](0x3c)));const _0x72826f=0xc,_0x5e7be0=0xa,_0x2b601f=0xa,_0x14d13a=0xa;console[_0x14c3ca(0xd6)]('\x20\x20'+_0x14c3ca(0x105)[_0x14c3ca(0x100)](_0x72826f)+'\x20\x20'+_0x14c3ca(0x10e)['padStart'](_0x5e7be0)+'\x20\x20'+_0x14c3ca(0x114)[_0x14c3ca(0xf9)](_0x2b601f)+'\x20\x20'+_0x14c3ca(0xf1)[_0x14c3ca(0xf9)](_0x14d13a));for(const _0x576317 of _0x1f2864){console[_0x14c3ca(0xd6)]('\x20\x20'+_0x576317[_0x14c3ca(0xd7)][_0x14c3ca(0x100)](_0x72826f)+'\x20\x20'+a11_0x4f8398[_0x14c3ca(0xe5)](formatCredits(_0x576317[_0x14c3ca(0x107)])[_0x14c3ca(0xf9)](_0x5e7be0))+'\x20\x20'+formatCredits(_0x576317['todayCredits'])[_0x14c3ca(0xf9)](_0x2b601f)+'\x20\x20'+formatCredits(_0x576317[_0x14c3ca(0xe4)])[_0x14c3ca(0xf9)](_0x14d13a));}console[_0x14c3ca(0xd6)]();}if(_0x529e85[_0x14c3ca(0xda)]===0x0){console[_0x14c3ca(0xd6)](a11_0x4f8398['dim'](_0x14c3ca(0xef))),console[_0x14c3ca(0xd6)](a11_0x4f8398[_0x14c3ca(0xe3)](_0x14c3ca(0xe0)));return;}console[_0x14c3ca(0xd6)](a11_0x4f8398[_0x14c3ca(0xdd)]('Usage\x20by\x20Profile')),console[_0x14c3ca(0xd6)](a11_0x4f8398[_0x14c3ca(0xe3)]('─'[_0x14c3ca(0x11a)](0x3c)));const _0x3a17ff=Math[_0x14c3ca(0xd9)](0xc,..._0x529e85[_0x14c3ca(0x106)](_0x2e962c=>_0x2e962c['profile']===_0x14c3ca(0x117)?'(default)'[_0x14c3ca(0xda)]:_0x2e962c[_0x14c3ca(0xf8)][_0x14c3ca(0xda)])),_0x345465=0xa,_0x39758a=0xa;console[_0x14c3ca(0xd6)]('\x20\x20'+'Profile'['padEnd'](_0x3a17ff)+'\x20\x20'+_0x14c3ca(0xdf)['padStart'](_0x345465)+'\x20\x20'+_0x14c3ca(0x102)[_0x14c3ca(0xf9)](_0x39758a)+'\x20\x20'+_0x14c3ca(0xe2));for(const _0x4a8468 of _0x529e85){const _0x45ef57=_0x4a8468['profile']===_0x14c3ca(0x117)?_0x14c3ca(0x119):_0x4a8468[_0x14c3ca(0xf8)],_0x385e10=_0x45ef57['padEnd'](_0x3a17ff),_0x386e85=_0x4a8468[_0x14c3ca(0xf8)]==='default'?a11_0x4f8398[_0x14c3ca(0xe3)](_0x385e10):_0x385e10;console[_0x14c3ca(0xd6)]('\x20\x20'+_0x386e85+'\x20\x20'+a11_0x4f8398[_0x14c3ca(0xe5)](formatCredits(_0x4a8468[_0x14c3ca(0x107)])[_0x14c3ca(0xf9)](_0x345465))+'\x20\x20'+String(_0x4a8468[_0x14c3ca(0xe9)])[_0x14c3ca(0xf9)](_0x39758a)+'\x20\x20'+a11_0x4f8398[_0x14c3ca(0xe3)](formatLastUsed(_0x4a8468['lastUsedAt'])));}console[_0x14c3ca(0xd6)](),console[_0x14c3ca(0xd6)](a11_0x4f8398[_0x14c3ca(0xe3)](_0x14c3ca(0xea))),console[_0x14c3ca(0xd6)]();}}
1
+ function a11_0x4281(){const _0x55e839=['bold','Error:\x20','outputStructured','getTime','\x20\x20Today:\x20\x20\x20','8098734rIntzH','toFixed','Source','(default)','map','Usage\x20by\x20Source','10334984HhJidp','34HLGJrv','toLocaleDateString','\x20credits','message','error','todayCredits','Total','padStart','en-CA','never','\x20\x20Month:\x20\x20\x20','padEnd','Month','4006864GIcoEi','profile','19102fZaqir','length','yesterday','en-US','dim','\x20days\x20ago','format','4966850vfhUFJ','\x20\x20Total:\x20\x20\x20','name','usage','2-digit','description','repeat','today\x20','Usage\x20by\x20Profile','outputTable','cyan','monthCredits','Today','Credits','Requests','round','short','lastUsedAt','Last\x20Used','source','entryCount','json','default','log','toLocaleTimeString','red','2873676ciMpmn','jsonl','totalCredits','credits','3410166RFltBg','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','Profile','profileCount'];a11_0x4281=function(){return _0x55e839;};return a11_0x4281();}function a11_0x2597(_0x152e63,_0x5c727a){_0x152e63=_0x152e63-0x19c;const _0x42813f=a11_0x4281();let _0x25977b=_0x42813f[_0x152e63];return _0x25977b;}const a11_0x568a03=a11_0x2597;(function(_0x18ba96,_0x102d88){const _0x3a9fca=a11_0x2597,_0x21acaa=_0x18ba96();while(!![]){try{const _0x26b3bd=-parseInt(_0x3a9fca(0x1a3))/0x1*(-parseInt(_0x3a9fca(0x1d8))/0x2)+parseInt(_0x3a9fca(0x1c8))/0x3+parseInt(_0x3a9fca(0x1a1))/0x4+-parseInt(_0x3a9fca(0x1aa))/0x5+-parseInt(_0x3a9fca(0x1c4))/0x6+parseInt(_0x3a9fca(0x1d1))/0x7+-parseInt(_0x3a9fca(0x1d7))/0x8;if(_0x26b3bd===_0x102d88)break;else _0x21acaa['push'](_0x21acaa['shift']());}catch(_0xb96ff){_0x21acaa['push'](_0x21acaa['shift']());}}}(a11_0x4281,0xd0f89));import a11_0x2d50eb 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(_0x1f96bf){const _0x20efad=a11_0x2597;return _0x1f96bf[_0x20efad(0x1d2)](0x2);}function formatLastUsed(_0x1d793c){const _0x335d95=a11_0x2597;if(!_0x1d793c)return _0x335d95(0x19d);const _0x2bb841=new Date(_0x1d793c),_0x53d5b7=new Date(),_0x636c54=_0x2bb841[_0x335d95(0x1d9)]('en-CA'),_0x4331f4=_0x53d5b7[_0x335d95(0x1d9)](_0x335d95(0x19c));if(_0x636c54===_0x4331f4)return _0x335d95(0x1b1)+_0x2bb841[_0x335d95(0x1c2)](_0x335d95(0x1a6),{'hour':_0x335d95(0x1ae),'minute':_0x335d95(0x1ae)});const _0x1a40e6=new Date(_0x636c54),_0x49820a=new Date(_0x4331f4),_0x3708ea=Math[_0x335d95(0x1b9)]((_0x49820a['getTime']()-_0x1a40e6[_0x335d95(0x1cf)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x3708ea===0x1)return _0x335d95(0x1a5);else return _0x3708ea>0x1&&_0x3708ea<0x7?_0x3708ea+_0x335d95(0x1a8):_0x2bb841[_0x335d95(0x1d9)](_0x335d95(0x1a6),{'month':_0x335d95(0x1ba),'day':'numeric'});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x568a03(0x1ac)]=a11_0x568a03(0x1ad);[a11_0x568a03(0x1af)]='Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile';async['execute'](_0x456c49){const _0x3c5a1f=a11_0x568a03,{options:_0x44ad0f}=_0x456c49,_0x2a1b29=_0x44ad0f['format']===_0x3c5a1f(0x1bf)||_0x44ad0f[_0x3c5a1f(0x1a9)]===_0x3c5a1f(0x1c5)||_0x44ad0f['json'];try{const [_0x38be8d,_0x4aa456,_0x1d6ca1]=await Promise['all']([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x2a1b29?await this[_0x3c5a1f(0x1ce)](_0x38be8d,_0x4aa456,_0x1d6ca1,_0x44ad0f):this['outputTable'](_0x38be8d,_0x4aa456,_0x1d6ca1),0x0;}catch(_0x22c3db){const _0x5494c4=_0x22c3db instanceof Error?_0x22c3db[_0x3c5a1f(0x1db)]:'Unknown\x20error';return console[_0x3c5a1f(0x1dc)](a11_0x2d50eb[_0x3c5a1f(0x1c3)](_0x3c5a1f(0x1cd)+_0x5494c4)),0x1;}}async['outputStructured'](_0x481145,_0x5f353a,_0x1d6657,_0x335024){const _0x2bb47c=a11_0x568a03,_0x462dc1={'summary':{'todayCredits':_0x1d6657[_0x2bb47c(0x1dd)],'monthCredits':_0x1d6657[_0x2bb47c(0x1b5)],'totalCredits':_0x1d6657[_0x2bb47c(0x1c6)],'profileCount':_0x1d6657[_0x2bb47c(0x1cb)]},'profiles':_0x481145[_0x2bb47c(0x1d5)](_0x566a37=>({'profile':_0x566a37[_0x2bb47c(0x1a2)],'credits':_0x566a37['credits'],'requests':_0x566a37[_0x2bb47c(0x1be)],'lastUsedAt':_0x566a37[_0x2bb47c(0x1bb)]})),'sources':_0x5f353a[_0x2bb47c(0x1d5)](_0x2a76af=>({'source':_0x2a76af[_0x2bb47c(0x1bd)],'credits':_0x2a76af[_0x2bb47c(0x1c7)],'todayCredits':_0x2a76af[_0x2bb47c(0x1dd)],'monthCredits':_0x2a76af['monthCredits'],'requests':_0x2a76af['entryCount']}))};await handleSDKOutput([_0x462dc1],_0x335024);}[a11_0x568a03(0x1b3)](_0x2bbd1e,_0x4c8226,_0x2b5b30){const _0x358990=a11_0x568a03;console[_0x358990(0x1c1)](a11_0x2d50eb['bold']('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console[_0x358990(0x1c1)](a11_0x2d50eb[_0x358990(0x1a7)]('─'[_0x358990(0x1b0)](0x32))),console['log'](_0x358990(0x1d0)+a11_0x2d50eb[_0x358990(0x1b4)](formatCredits(_0x2b5b30[_0x358990(0x1dd)]))+_0x358990(0x1da)),console[_0x358990(0x1c1)](_0x358990(0x19e)+a11_0x2d50eb[_0x358990(0x1b4)](formatCredits(_0x2b5b30[_0x358990(0x1b5)]))+'\x20credits'),console[_0x358990(0x1c1)](_0x358990(0x1ab)+a11_0x2d50eb[_0x358990(0x1b4)](formatCredits(_0x2b5b30[_0x358990(0x1c6)]))+_0x358990(0x1da)),console[_0x358990(0x1c1)]();if(_0x4c8226[_0x358990(0x1a4)]>0x0){console[_0x358990(0x1c1)](a11_0x2d50eb[_0x358990(0x1cc)](_0x358990(0x1d6))),console[_0x358990(0x1c1)](a11_0x2d50eb[_0x358990(0x1a7)]('─'[_0x358990(0x1b0)](0x3c)));const _0x17e50d=0xc,_0x28fa67=0xa,_0x2c12be=0xa,_0x3571f7=0xa;console[_0x358990(0x1c1)]('\x20\x20'+_0x358990(0x1d3)[_0x358990(0x19f)](_0x17e50d)+'\x20\x20'+_0x358990(0x1de)[_0x358990(0x1df)](_0x28fa67)+'\x20\x20'+_0x358990(0x1b6)['padStart'](_0x2c12be)+'\x20\x20'+_0x358990(0x1a0)[_0x358990(0x1df)](_0x3571f7));for(const _0xbefbd3 of _0x4c8226){console[_0x358990(0x1c1)]('\x20\x20'+_0xbefbd3[_0x358990(0x1bd)][_0x358990(0x19f)](_0x17e50d)+'\x20\x20'+a11_0x2d50eb[_0x358990(0x1b4)](formatCredits(_0xbefbd3['credits'])['padStart'](_0x28fa67))+'\x20\x20'+formatCredits(_0xbefbd3[_0x358990(0x1dd)])[_0x358990(0x1df)](_0x2c12be)+'\x20\x20'+formatCredits(_0xbefbd3[_0x358990(0x1b5)])['padStart'](_0x3571f7));}console[_0x358990(0x1c1)]();}if(_0x2bbd1e[_0x358990(0x1a4)]===0x0){console['log'](a11_0x2d50eb[_0x358990(0x1a7)]('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console['log'](a11_0x2d50eb[_0x358990(0x1a7)](_0x358990(0x1c9)));return;}console[_0x358990(0x1c1)](a11_0x2d50eb[_0x358990(0x1cc)](_0x358990(0x1b2))),console[_0x358990(0x1c1)](a11_0x2d50eb[_0x358990(0x1a7)]('─'['repeat'](0x3c)));const _0x43879d=Math['max'](0xc,..._0x2bbd1e[_0x358990(0x1d5)](_0x3e2e19=>_0x3e2e19['profile']===_0x358990(0x1c0)?'(default)'[_0x358990(0x1a4)]:_0x3e2e19[_0x358990(0x1a2)][_0x358990(0x1a4)])),_0x365938=0xa,_0x4f5900=0xa;console['log']('\x20\x20'+_0x358990(0x1ca)[_0x358990(0x19f)](_0x43879d)+'\x20\x20'+_0x358990(0x1b7)[_0x358990(0x1df)](_0x365938)+'\x20\x20'+_0x358990(0x1b8)[_0x358990(0x1df)](_0x4f5900)+'\x20\x20'+_0x358990(0x1bc));for(const _0x4dd996 of _0x2bbd1e){const _0x4e2ae3=_0x4dd996[_0x358990(0x1a2)]==='default'?_0x358990(0x1d4):_0x4dd996[_0x358990(0x1a2)],_0x587c91=_0x4e2ae3[_0x358990(0x19f)](_0x43879d),_0x5921d1=_0x4dd996[_0x358990(0x1a2)]===_0x358990(0x1c0)?a11_0x2d50eb['dim'](_0x587c91):_0x587c91;console[_0x358990(0x1c1)]('\x20\x20'+_0x5921d1+'\x20\x20'+a11_0x2d50eb['cyan'](formatCredits(_0x4dd996[_0x358990(0x1c7)])['padStart'](_0x365938))+'\x20\x20'+String(_0x4dd996[_0x358990(0x1be)])[_0x358990(0x1df)](_0x4f5900)+'\x20\x20'+a11_0x2d50eb[_0x358990(0x1a7)](formatLastUsed(_0x4dd996['lastUsedAt'])));}console[_0x358990(0x1c1)](),console[_0x358990(0x1c1)](a11_0x2d50eb['dim']('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x358990(0x1c1)]();}}
@@ -1 +1 @@
1
- const a12_0x431635=a12_0x2005;(function(_0x149b84,_0x18d65c){const _0x1d3143=a12_0x2005,_0x2fa168=_0x149b84();while(!![]){try{const _0x4f61c9=-parseInt(_0x1d3143(0x172))/0x1+-parseInt(_0x1d3143(0x181))/0x2+parseInt(_0x1d3143(0x18c))/0x3+-parseInt(_0x1d3143(0x171))/0x4*(-parseInt(_0x1d3143(0x173))/0x5)+-parseInt(_0x1d3143(0x16b))/0x6*(-parseInt(_0x1d3143(0x16c))/0x7)+parseInt(_0x1d3143(0x18d))/0x8*(-parseInt(_0x1d3143(0x174))/0x9)+parseInt(_0x1d3143(0x185))/0xa*(parseInt(_0x1d3143(0x18f))/0xb);if(_0x4f61c9===_0x18d65c)break;else _0x2fa168['push'](_0x2fa168['shift']());}catch(_0x3945a0){_0x2fa168['push'](_0x2fa168['shift']());}}}(a12_0x8e5e,0xcdd4e));import{validateLimitOption}from'../utils/option-validation.js';function a12_0x2005(_0x2cca56,_0x28bde5){_0x2cca56=_0x2cca56-0x166;const _0x8e5e96=a12_0x8e5e();let _0x200537=_0x8e5e96[_0x2cca56];return _0x200537;}function a12_0x8e5e(){const _0x2385f0=['1110293mmpCdc','384290ikjCKW','9fzifES','has','tdx\x20auth\x20setup','\x27\x20is\x20already\x20registered','validate','cyan','tdx\x20auth','Authentication\x20failed','test','message','value','To\x20check\x20your\x20current\x20auth\x20status:','Reason:\x20','569140NhpaTA','Authentication\x20error\x20stack\x20trace:','Invalid\x20limit\x20value:\x20','red','710OFEfcI','isValid','\x0aStack\x20trace:\x0a','command','limit','from','\x20--profile\x20','2566458AZgMjg','9665664bzOTjy','category','341022dnztGL','get','USER_ERROR','validateGlobalOptions','number','commands','set','name','run','profile','values','Error:\x20','dim','.\x20Must\x20be\x20a\x20number.','stack','register','16602LRtQty','791YevLME','error','helpText','options','debug','4ICglCz'];a12_0x8e5e=function(){return _0x2385f0;};return a12_0x8e5e();}import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a12_0x37fe95 from'chalk';export function printAuthError(_0x200d8a,_0x2d2947=![],_0x3362f1){const _0x5e4c64=a12_0x2005,_0x6c7552=_0x200d8a['problemDetails']?.['detail']||_0x200d8a[_0x5e4c64(0x17d)];console[_0x5e4c64(0x16d)](a12_0x37fe95[_0x5e4c64(0x184)](_0x5e4c64(0x17b))),console[_0x5e4c64(0x16d)](a12_0x37fe95[_0x5e4c64(0x184)](_0x5e4c64(0x180)+_0x6c7552));if(_0x2d2947){const _0x22391c=_0x3362f1?_0x5e4c64(0x18b)+_0x3362f1:'';console[_0x5e4c64(0x16d)]('\x0a'+a12_0x37fe95[_0x5e4c64(0x167)]('To\x20set\x20up\x20authentication:')),console[_0x5e4c64(0x16d)]('\x20\x20'+a12_0x37fe95['cyan'](_0x5e4c64(0x176)+_0x22391c)+'\x0a'),console[_0x5e4c64(0x16d)](''+a12_0x37fe95[_0x5e4c64(0x167)](_0x5e4c64(0x17f))),console['error']('\x20\x20'+a12_0x37fe95[_0x5e4c64(0x179)](_0x5e4c64(0x17a)+_0x22391c));}}export class BaseCommand{[a12_0x431635(0x192)](_0x3db6a1){const _0x5399f9=a12_0x431635,{options:_0x5cd9e7}=_0x3db6a1,_0x83735e=_0x5cd9e7[_0x5399f9(0x189)];if(_0x83735e!==undefined){const _0x470d50=typeof _0x83735e===_0x5399f9(0x193)?_0x83735e:parseInt(_0x83735e,0xa);if(isNaN(_0x470d50))return _0x5399f9(0x183)+_0x83735e+_0x5399f9(0x168);const _0x4f51ca=validateLimitOption(_0x470d50);if(!_0x4f51ca[_0x5399f9(0x186)])return _0x4f51ca[_0x5399f9(0x16d)];_0x3db6a1[_0x5399f9(0x16f)]['limit']=_0x4f51ca[_0x5399f9(0x17e)];}return undefined;}['validate'](_0x5dccf0){return undefined;}async[a12_0x431635(0x197)](_0x37a2bf){const _0x513f3b=a12_0x431635;try{const _0x5effec=this[_0x513f3b(0x192)](_0x37a2bf);if(_0x5effec)return console[_0x513f3b(0x16d)](_0x513f3b(0x166)+_0x5effec),0x1;const _0x39ea2a=this[_0x513f3b(0x178)](_0x37a2bf);if(_0x39ea2a){const _0x439038=/^\s*(Usage|Note|Warning|Error):/i[_0x513f3b(0x17c)](_0x39ea2a);return _0x439038?console[_0x513f3b(0x16d)](_0x39ea2a):console[_0x513f3b(0x16d)](_0x513f3b(0x166)+_0x39ea2a),0x1;}const _0x5b95d0=await this['execute'](_0x37a2bf);return _0x5b95d0??0x0;}catch(_0x353898){if(_0x353898 instanceof Error){if(_0x353898 instanceof HTTPClientError&&_0x353898['status']===0x191){const _0x8fb01b=_0x37a2bf[_0x513f3b(0x16f)][_0x513f3b(0x198)];printAuthError(_0x353898,!![],_0x8fb01b);if(_0x353898[_0x513f3b(0x169)]){const _0x15363a=Logger['of'](_0x513f3b(0x188));_0x15363a[_0x513f3b(0x170)](_0x513f3b(0x182)),_0x15363a[_0x513f3b(0x170)](_0x353898['stack']);}return 0x1;}console[_0x513f3b(0x16d)](a12_0x37fe95[_0x513f3b(0x184)]('Error:\x20'+_0x353898[_0x513f3b(0x17d)]));_0x353898 instanceof SDKError&&_0x353898[_0x513f3b(0x16e)]&&console[_0x513f3b(0x16d)](a12_0x37fe95['yellow'](_0x353898[_0x513f3b(0x16e)]));const _0x2e8f97=_0x353898 instanceof SDKError&&_0x353898[_0x513f3b(0x18e)]===ErrorCategory[_0x513f3b(0x191)];_0x353898[_0x513f3b(0x169)]&&!_0x2e8f97&&console[_0x513f3b(0x16d)](_0x513f3b(0x187)+_0x353898[_0x513f3b(0x169)]);}else console[_0x513f3b(0x16d)](_0x513f3b(0x166)+String(_0x353898));return 0x1;}}}export class CommandRegistry{[a12_0x431635(0x194)]=new Map();[a12_0x431635(0x16a)](_0x4bfacd){const _0x26404d=a12_0x431635;if(this['commands']['has'](_0x4bfacd[_0x26404d(0x196)]))throw new Error('Command\x20\x27'+_0x4bfacd['name']+_0x26404d(0x177));this[_0x26404d(0x194)][_0x26404d(0x195)](_0x4bfacd[_0x26404d(0x196)],_0x4bfacd);}['get'](_0x459bf3){const _0xd0894f=a12_0x431635;return this[_0xd0894f(0x194)][_0xd0894f(0x190)](_0x459bf3);}['getAll'](){const _0x56aa94=a12_0x431635;return Array[_0x56aa94(0x18a)](this[_0x56aa94(0x194)][_0x56aa94(0x199)]());}[a12_0x431635(0x175)](_0x15c6ce){const _0xe844b6=a12_0x431635;return this[_0xe844b6(0x194)][_0xe844b6(0x175)](_0x15c6ce);}}export const registry=new CommandRegistry();
1
+ const a12_0x161863=a12_0x3044;(function(_0x13e906,_0x6c705f){const _0x35ac68=a12_0x3044,_0x46f7e3=_0x13e906();while(!![]){try{const _0x3ca2e7=-parseInt(_0x35ac68(0x84))/0x1*(parseInt(_0x35ac68(0x7a))/0x2)+-parseInt(_0x35ac68(0x8c))/0x3+parseInt(_0x35ac68(0xa0))/0x4+parseInt(_0x35ac68(0x75))/0x5+-parseInt(_0x35ac68(0x83))/0x6*(parseInt(_0x35ac68(0x7e))/0x7)+parseInt(_0x35ac68(0xa6))/0x8+-parseInt(_0x35ac68(0x9a))/0x9;if(_0x3ca2e7===_0x6c705f)break;else _0x46f7e3['push'](_0x46f7e3['shift']());}catch(_0xad4825){_0x46f7e3['push'](_0x46f7e3['shift']());}}}(a12_0xa562,0xb5050));function a12_0xa562(){const _0x3bfe55=['dim','from','10454752fZfbSc','\x0aStack\x20trace:\x0a','7403200CsbWyk','set','number','stack','Reason:\x20','2FXCcWe','\x27\x20is\x20already\x20registered','red','Invalid\x20limit\x20value:\x20','134428YVUubh','Error:\x20','name','helpText','limit','144szSMCn','1436793uEddvL','.\x20Must\x20be\x20a\x20number.','problemDetails','Authentication\x20failed','has','execute','Authentication\x20error\x20stack\x20trace:','message','1816542FfYlvR','command','profile','status','values','cyan','debug','validate','register','detail','isValid','To\x20set\x20up\x20authentication:','options','commands','3311064fqMLlT','USER_ERROR','get','error','validateGlobalOptions','value','3300284kttoKd','tdx\x20auth\x20setup','tdx\x20auth','\x20--profile\x20'];a12_0xa562=function(){return _0x3bfe55;};return a12_0xa562();}import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';function a12_0x3044(_0x3001ab,_0x25c0f5){_0x3001ab=_0x3001ab-0x75;const _0xa562d9=a12_0xa562();let _0x3044f1=_0xa562d9[_0x3001ab];return _0x3044f1;}import{Logger}from'../utils/logger/index.js';import a12_0x358c03 from'chalk';export function printAuthError(_0x47a362,_0x1f9f53=![],_0x2a5607){const _0x31d076=a12_0x3044,_0x405783=_0x47a362[_0x31d076(0x86)]?.[_0x31d076(0x95)]||_0x47a362[_0x31d076(0x8b)];console[_0x31d076(0x9d)](a12_0x358c03[_0x31d076(0x7c)](_0x31d076(0x87))),console['error'](a12_0x358c03[_0x31d076(0x7c)](_0x31d076(0x79)+_0x405783));if(_0x1f9f53){const _0x2a563b=_0x2a5607?_0x31d076(0xa3)+_0x2a5607:'';console[_0x31d076(0x9d)]('\x0a'+a12_0x358c03[_0x31d076(0xa4)](_0x31d076(0x97))),console[_0x31d076(0x9d)]('\x20\x20'+a12_0x358c03['cyan'](_0x31d076(0xa1)+_0x2a563b)+'\x0a'),console['error'](''+a12_0x358c03[_0x31d076(0xa4)]('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x31d076(0x9d)]('\x20\x20'+a12_0x358c03[_0x31d076(0x91)](_0x31d076(0xa2)+_0x2a563b));}}export class BaseCommand{[a12_0x161863(0x9e)](_0x286358){const _0x41199b=a12_0x161863,{options:_0x312122}=_0x286358,_0x26f639=_0x312122[_0x41199b(0x82)];if(_0x26f639!==undefined){const _0x5b183d=typeof _0x26f639===_0x41199b(0x77)?_0x26f639:parseInt(_0x26f639,0xa);if(isNaN(_0x5b183d))return _0x41199b(0x7d)+_0x26f639+_0x41199b(0x85);const _0x1c0bca=validateLimitOption(_0x5b183d);if(!_0x1c0bca[_0x41199b(0x96)])return _0x1c0bca[_0x41199b(0x9d)];_0x286358[_0x41199b(0x98)][_0x41199b(0x82)]=_0x1c0bca[_0x41199b(0x9f)];}return undefined;}[a12_0x161863(0x93)](_0x48f863){return undefined;}async['run'](_0x343dc9){const _0x3333c5=a12_0x161863;try{const _0x135f76=this['validateGlobalOptions'](_0x343dc9);if(_0x135f76)return console[_0x3333c5(0x9d)](_0x3333c5(0x7f)+_0x135f76),0x1;const _0xd78574=this['validate'](_0x343dc9);if(_0xd78574){const _0x199ada=/^\s*(Usage|Note|Warning|Error):/i['test'](_0xd78574);return _0x199ada?console[_0x3333c5(0x9d)](_0xd78574):console[_0x3333c5(0x9d)](_0x3333c5(0x7f)+_0xd78574),0x1;}const _0x1b1247=await this[_0x3333c5(0x89)](_0x343dc9);return _0x1b1247??0x0;}catch(_0x249ad5){if(_0x249ad5 instanceof Error){if(_0x249ad5 instanceof HTTPClientError&&_0x249ad5[_0x3333c5(0x8f)]===0x191){const _0x246562=_0x343dc9[_0x3333c5(0x98)][_0x3333c5(0x8e)];printAuthError(_0x249ad5,!![],_0x246562);if(_0x249ad5[_0x3333c5(0x78)]){const _0x3e27b7=Logger['of'](_0x3333c5(0x8d));_0x3e27b7['debug'](_0x3333c5(0x8a)),_0x3e27b7[_0x3333c5(0x92)](_0x249ad5[_0x3333c5(0x78)]);}return 0x1;}console[_0x3333c5(0x9d)](a12_0x358c03[_0x3333c5(0x7c)](_0x3333c5(0x7f)+_0x249ad5[_0x3333c5(0x8b)]));_0x249ad5 instanceof SDKError&&_0x249ad5[_0x3333c5(0x81)]&&console['error'](a12_0x358c03['yellow'](_0x249ad5[_0x3333c5(0x81)]));const _0x15e090=_0x249ad5 instanceof SDKError&&_0x249ad5['category']===ErrorCategory[_0x3333c5(0x9b)];_0x249ad5['stack']&&!_0x15e090&&console[_0x3333c5(0x9d)](_0x3333c5(0xa7)+_0x249ad5[_0x3333c5(0x78)]);}else console[_0x3333c5(0x9d)](_0x3333c5(0x7f)+String(_0x249ad5));return 0x1;}}}export class CommandRegistry{[a12_0x161863(0x99)]=new Map();[a12_0x161863(0x94)](_0x34e8f7){const _0x337e05=a12_0x161863;if(this[_0x337e05(0x99)][_0x337e05(0x88)](_0x34e8f7[_0x337e05(0x80)]))throw new Error('Command\x20\x27'+_0x34e8f7[_0x337e05(0x80)]+_0x337e05(0x7b));this['commands'][_0x337e05(0x76)](_0x34e8f7[_0x337e05(0x80)],_0x34e8f7);}[a12_0x161863(0x9c)](_0x3d4641){const _0x9833db=a12_0x161863;return this[_0x9833db(0x99)][_0x9833db(0x9c)](_0x3d4641);}['getAll'](){const _0x751180=a12_0x161863;return Array[_0x751180(0xa5)](this['commands'][_0x751180(0x90)]());}[a12_0x161863(0x88)](_0x477f2e){const _0x55405a=a12_0x161863;return this[_0x55405a(0x99)][_0x55405a(0x88)](_0x477f2e);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a13_0x2edf0a=a13_0x12e7;(function(_0x439302,_0x668394){const _0x1713cb=a13_0x12e7,_0x406775=_0x439302();while(!![]){try{const _0x37b352=parseInt(_0x1713cb(0x244))/0x1*(-parseInt(_0x1713cb(0x200))/0x2)+-parseInt(_0x1713cb(0x20e))/0x3+parseInt(_0x1713cb(0x1ec))/0x4*(-parseInt(_0x1713cb(0x24b))/0x5)+parseInt(_0x1713cb(0x1f7))/0x6*(-parseInt(_0x1713cb(0x21f))/0x7)+-parseInt(_0x1713cb(0x238))/0x8+-parseInt(_0x1713cb(0x20f))/0x9*(-parseInt(_0x1713cb(0x236))/0xa)+parseInt(_0x1713cb(0x1f3))/0xb;if(_0x37b352===_0x668394)break;else _0x406775['push'](_0x406775['shift']());}catch(_0x2344ae){_0x406775['push'](_0x406775['shift']());}}}(a13_0x2bf2,0x3665d));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';import a13_0x501dc2 from'chalk';function a13_0x2bf2(){const _0xc4293d=['>=\x20','value','record','Listing\x20connector\x20types...','Type:\x20','\x20connection','options','filter','padStart','label','\x20\x20\x20\x20Default:\x20','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','Show\x20when:\x20','site','data','map','legacy','connection:types','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.','✔\x20Found\x20schema\x20for\x20connection\x20\x27','find','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','30LHKIWk','\x20-\x20','1468008HLZLbh','name','push','Fetching\x20settings\x20for\x20\x27','Resolving\x20connector\x20type\x20or\x20name:\x20','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.','maximum','title','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','join','connection','Fetching\x20connection\x20\x27','14fKnkGa','cyan','\x0aConnector:\x20','connection:settings','\x27\x20(type:\x20','verbose','max','330RVbQaj','blue','No\x20available\x20fields\x20for\x20this\x20connector','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','✔\x20Found\x20','log','\x0aAvailable\x20fields:','credential','listTypes','21096OXDkIT','object','stringify','default_value','green','Listing\x20connections...','Options:\x20','15959768pzoQOl','Looking\x20up\x20connection:\x20','minimum','length','473862ZcSrgr','enumeration','yellow','Show\x20connection\x20details','criteria','entries','Site:\x20','bold','validate','39106twtGvL','\x20[record]','table','input','\x0aNo\x20fields\x20defined\x20in\x20schema','output','description','✔\x20Resolved\x20\x27','type','connection:show','\x27...','repeat','\x20connector\x20type','connection:schema','1035591KNNsSk','952002GfRqFB','localeCompare','limit','legacy_settings','properties','Fetching\x20settings\x20for\x20connector\x20type:\x20','hint','error','dim','<=\x20','execute','sort','owner','getOutputSchema','Range:\x20','\x0aCredential\x20settings:','35xIBHEO'];a13_0x2bf2=function(){return _0xc4293d;};return a13_0x2bf2();}function normalizeSchemaForDisplay(_0x4a3e27){const _0x42a577=a13_0x12e7,_0x3d481f=_0x4a3e27[_0x42a577(0x213)]||[],_0x3ad001=_0x3d481f[_0x42a577(0x234)](_0x31e966=>_0x31e966[_0x42a577(0x239)]===_0x42a577(0x212)&&_0x31e966[_0x42a577(0x208)]===_0x42a577(0x222)&&_0x31e966['properties']);if(_0x3ad001?.[_0x42a577(0x213)]){const _0x51e668=_0x3d481f[_0x42a577(0x227)](_0x2a5881=>_0x2a5881[_0x42a577(0x239)]!==_0x42a577(0x230)&&_0x2a5881[_0x42a577(0x239)]!==_0x42a577(0x212));return[..._0x51e668,..._0x3ad001[_0x42a577(0x213)]];}return _0x3d481f[_0x42a577(0x227)](_0x4240f5=>_0x4240f5[_0x42a577(0x239)]!==_0x42a577(0x230));}function printSchemaFields(_0x2d2efc,_0x10714c){const _0x4bc201=a13_0x12e7,_0x392624='\x20\x20'['repeat'](_0x10714c+0x1),_0x16a228='\x20\x20'[_0x4bc201(0x20b)](_0x10714c+0x2);for(const _0x42c522 of _0x2d2efc){if(!_0x42c522[_0x4bc201(0x239)])continue;const _0x424005=_0x42c522['type']===_0x4bc201(0x222)&&_0x42c522['properties']&&_0x42c522[_0x4bc201(0x213)][_0x4bc201(0x1f6)]>0x0&&_0x42c522[_0x4bc201(0x239)]!==_0x4bc201(0x212);let _0x4be3d7=''+_0x392624+a13_0x501dc2[_0x4bc201(0x1f0)](_0x42c522[_0x4bc201(0x239)]);_0x42c522[_0x4bc201(0x23f)]&&(_0x4be3d7+=':\x20'+_0x42c522['title']);if(_0x42c522[_0x4bc201(0x203)])_0x4be3d7+=a13_0x501dc2[_0x4bc201(0x217)]('\x20['+_0x42c522[_0x4bc201(0x203)]+']');else _0x424005&&(_0x4be3d7+=a13_0x501dc2['dim'](_0x4bc201(0x201)));console[_0x4bc201(0x1e8)](_0x4be3d7);_0x42c522[_0x4bc201(0x206)]&&console['log'](''+_0x16a228+a13_0x501dc2['dim'](_0x42c522['description']));if(_0x42c522[_0x4bc201(0x1f8)]){const _0x3ab533=_0x42c522['enumeration'][_0x4bc201(0x22f)](_0x184a28=>typeof _0x184a28===_0x4bc201(0x1ed)&&'value'in _0x184a28?_0x184a28['value']:_0x184a28)[_0x4bc201(0x241)](',\x20');console[_0x4bc201(0x1e8)](_0x16a228+_0x4bc201(0x1f2)+a13_0x501dc2[_0x4bc201(0x1f9)](_0x3ab533));}_0x42c522[_0x4bc201(0x1ef)]!==undefined&&console['log'](_0x16a228+'Default:\x20'+a13_0x501dc2[_0x4bc201(0x24c)](String(_0x42c522['default_value'])));if(_0x42c522[_0x4bc201(0x1f5)]!==undefined||_0x42c522[_0x4bc201(0x23e)]!==undefined){const _0x6954fc=_0x42c522[_0x4bc201(0x1f5)]!==undefined&&_0x42c522[_0x4bc201(0x23e)]!==undefined?_0x42c522[_0x4bc201(0x1f5)]+_0x4bc201(0x237)+_0x42c522[_0x4bc201(0x23e)]:_0x42c522[_0x4bc201(0x1f5)]!==undefined?_0x4bc201(0x220)+_0x42c522[_0x4bc201(0x1f5)]:_0x4bc201(0x218)+_0x42c522[_0x4bc201(0x23e)];console['log'](_0x16a228+_0x4bc201(0x21d)+a13_0x501dc2['blue'](_0x6954fc));}if(_0x42c522[_0x4bc201(0x1fb)]){const _0x20e368=Object[_0x4bc201(0x1fc)](_0x42c522['criteria'])[_0x4bc201(0x22f)](([_0x30537b,_0xf093cd])=>_0x30537b+'='+JSON[_0x4bc201(0x1ee)](_0xf093cd))[_0x4bc201(0x241)](',\x20');console[_0x4bc201(0x1e8)](''+_0x16a228+a13_0x501dc2['dim'](_0x4bc201(0x22c)+_0x20e368));}_0x424005&&_0x42c522[_0x4bc201(0x213)]&&printSchemaFields(_0x42c522[_0x4bc201(0x213)],_0x10714c+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x2edf0a(0x239)]='connection:list';[a13_0x2edf0a(0x206)]='List\x20all\x20result\x20output\x20connections';async['execute'](_0x500453){const _0x1618a5=a13_0x2edf0a,{options:_0x1c0600,tdx:_0x5868fc}=_0x500453;_0x1c0600[_0x1618a5(0x249)]&&console['error'](_0x1618a5(0x1fd)+_0x1c0600['site']);const _0x1579c8=resolveLimit(_0x1c0600[_0x1618a5(0x211)],DEFAULT_LISTING_LIMIT),_0x4e8312=await withSpinner(_0x1618a5(0x1f1),()=>_0x5868fc[_0x1618a5(0x242)]['list'](),{'verbose':_0x1c0600[_0x1618a5(0x249)]}),_0x62e3aa=_0x4e8312[_0x1618a5(0x22e)];console[_0x1618a5(0x216)](_0x1618a5(0x24f)+_0x62e3aa[_0x1618a5(0x1f6)]+_0x1618a5(0x225)+(_0x62e3aa[_0x1618a5(0x1f6)]!==0x1?'s':''));if(isStructuredFormat(_0x1c0600)){const _0x269821=_0x62e3aa['slice'](0x0,_0x1579c8);await handleSDKOutput(_0x269821,{..._0x1c0600,'limit':_0x1579c8});}else{const _0x2c2238=_0x62e3aa[_0x1618a5(0x1f6)]>0x0?Math[_0x1618a5(0x24a)](..._0x62e3aa[_0x1618a5(0x22f)](_0x8cf4f1=>_0x8cf4f1[_0x1618a5(0x208)]['length'])):0x0,_0x5c3614=[];for(const _0x27ea73 of _0x62e3aa){const _0x1d9b5f=a13_0x501dc2['cyan'](_0x27ea73[_0x1618a5(0x208)]['padStart'](_0x2c2238)),_0x41ef18=_0x27ea73['owner']?.['name']?_0x1618a5(0x237)+a13_0x501dc2[_0x1618a5(0x217)](_0x27ea73[_0x1618a5(0x21b)]['name']):'';_0x5c3614['push'](_0x1d9b5f+'\x20\x20'+_0x27ea73[_0x1618a5(0x239)]+_0x41ef18);}await writeOutput(_0x5c3614[_0x1618a5(0x241)]('\x0a'),_0x1c0600[_0x1618a5(0x205)],_0x1618a5(0x202));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x2edf0a(0x239)]=a13_0x2edf0a(0x209);['description']=a13_0x2edf0a(0x1fa);['validate'](_0x141059){const _0x12346d=a13_0x2edf0a,{args:_0x1f2329}=_0x141059;if(!_0x1f2329[0x0])return _0x12346d(0x24e);return undefined;}async[a13_0x2edf0a(0x219)](_0x5c7fe0){const _0x3030ef=a13_0x2edf0a,{options:_0x10e2bf,args:_0x47421e,tdx:_0x33e1dd}=_0x5c7fe0,_0x27d7b4=_0x47421e[0x0];_0x10e2bf['verbose']&&(console['error'](_0x3030ef(0x1fd)+_0x10e2bf[_0x3030ef(0x22d)]),console[_0x3030ef(0x216)](_0x3030ef(0x1f4)+_0x27d7b4));const _0xe3aeca=await withSpinner(_0x3030ef(0x243)+_0x27d7b4+_0x3030ef(0x20a),()=>_0x33e1dd[_0x3030ef(0x242)]['resolve'](_0x27d7b4),{'verbose':_0x10e2bf[_0x3030ef(0x249)]}),_0x2acfc9=_0xe3aeca[_0x3030ef(0x22e)];return console[_0x3030ef(0x216)]('✔\x20Found\x20connection:\x20'+_0x2acfc9['name']),await handleSingleObjectOutput(_0x2acfc9,_0x10e2bf),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x2edf0a(0x239)]=a13_0x2edf0a(0x20d);[a13_0x2edf0a(0x206)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';['validate'](_0xe6e769){const _0x124b94=a13_0x2edf0a,{args:_0x3f182b}=_0xe6e769;if(!_0x3f182b[0x0])return _0x124b94(0x232);return undefined;}async[a13_0x2edf0a(0x219)](_0x219f98){const _0x59dacc=a13_0x2edf0a,{options:_0xb8073a,args:_0x494bab,tdx:_0x52ca36}=_0x219f98,_0xb90ab5=_0x494bab[0x0];_0xb8073a[_0x59dacc(0x249)]&&(console['error']('Site:\x20'+_0xb8073a[_0x59dacc(0x22d)]),console[_0x59dacc(0x216)](_0x59dacc(0x23c)+_0xb90ab5));let _0x479409=_0xb90ab5,_0x17c0bb;try{const _0x7ae2e1=await _0x52ca36['connection']['findByName'](_0xb90ab5);_0x7ae2e1&&(_0x479409=_0x7ae2e1[_0x59dacc(0x208)],_0x17c0bb=_0x7ae2e1[_0x59dacc(0x239)],_0xb8073a[_0x59dacc(0x249)]&&console['error'](_0x59dacc(0x207)+_0xb90ab5+_0x59dacc(0x22b)+_0x479409));}catch{_0xb8073a[_0x59dacc(0x249)]&&console['error']('Treating\x20\x27'+_0xb90ab5+'\x27\x20as\x20connector\x20type');}const _0x50c200=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x479409+'\x27...',()=>_0x52ca36[_0x59dacc(0x242)][_0x59dacc(0x21c)](_0x479409),{'verbose':_0xb8073a['verbose']}),_0x468974=_0x50c200[_0x59dacc(0x22e)];_0x17c0bb?console[_0x59dacc(0x216)](_0x59dacc(0x233)+_0x17c0bb+_0x59dacc(0x248)+_0x479409+')'):console[_0x59dacc(0x216)](_0x59dacc(0x240)+_0x479409);if(isStructuredFormat(_0xb8073a))await handleSingleObjectOutput(_0x468974,_0xb8073a);else{const _0x5050af=normalizeSchemaForDisplay(_0x468974);_0x17c0bb?(console[_0x59dacc(0x1e8)]('\x0aConnection:\x20'+a13_0x501dc2[_0x59dacc(0x245)](_0x17c0bb)),console[_0x59dacc(0x1e8)](_0x59dacc(0x224)+a13_0x501dc2[_0x59dacc(0x217)](_0x479409))):console[_0x59dacc(0x1e8)]('\x0aConnector:\x20'+a13_0x501dc2['cyan'](_0x479409)),_0x5050af[_0x59dacc(0x1f6)]>0x0?(console[_0x59dacc(0x1e8)](a13_0x501dc2[_0x59dacc(0x1fe)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x5050af,0x0)):console[_0x59dacc(0x1e8)](a13_0x501dc2[_0x59dacc(0x217)](_0x59dacc(0x204)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x2edf0a(0x239)]=a13_0x2edf0a(0x231);[a13_0x2edf0a(0x206)]='List\x20available\x20connector\x20types';async['execute'](_0x3cfb91){const _0x4628c0=a13_0x2edf0a,{options:_0x132e68,tdx:_0x5546}=_0x3cfb91;_0x132e68[_0x4628c0(0x249)]&&console[_0x4628c0(0x216)](_0x4628c0(0x1fd)+_0x132e68['site']);const _0x5cf17e=await withSpinner(_0x4628c0(0x223),()=>_0x5546[_0x4628c0(0x242)][_0x4628c0(0x1eb)](),{'verbose':_0x132e68[_0x4628c0(0x249)]}),_0x459067=_0x5cf17e[_0x4628c0(0x22e)][_0x4628c0(0x21a)]((_0x54291d,_0x405a2d)=>_0x54291d[_0x4628c0(0x208)][_0x4628c0(0x210)](_0x405a2d[_0x4628c0(0x208)]));console[_0x4628c0(0x216)]('✔\x20Found\x20'+_0x459067[_0x4628c0(0x1f6)]+_0x4628c0(0x20c)+(_0x459067['length']!==0x1?'s':''));if(isStructuredFormat(_0x132e68))await handleSDKOutput(_0x459067,_0x132e68);else{const _0x86bdc7=_0x459067[_0x4628c0(0x1f6)]>0x0?Math[_0x4628c0(0x24a)](..._0x459067['map'](_0x4e4f5c=>_0x4e4f5c['type']['length'])):0x0,_0x17fabe=[];for(const _0x70064d of _0x459067){const _0x21ee23=a13_0x501dc2[_0x4628c0(0x245)](_0x70064d['type'][_0x4628c0(0x228)](_0x86bdc7));_0x17fabe[_0x4628c0(0x23a)](_0x21ee23+'\x20\x20'+_0x70064d[_0x4628c0(0x239)]);}await writeOutput(_0x17fabe[_0x4628c0(0x241)]('\x0a'),_0x132e68[_0x4628c0(0x205)],_0x4628c0(0x202));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x2edf0a(0x239)]=a13_0x2edf0a(0x247);[a13_0x2edf0a(0x206)]=a13_0x2edf0a(0x235);[a13_0x2edf0a(0x1ff)](_0xf26a04){const _0x3bfc31=a13_0x2edf0a,{args:_0x269ee5}=_0xf26a04;if(!_0x269ee5[0x0])return _0x3bfc31(0x23d);return undefined;}async[a13_0x2edf0a(0x219)](_0x12d8ca){const _0x87cca0=a13_0x2edf0a,{options:_0x472caa,args:_0x6ebfc0,tdx:_0x3476ef}=_0x12d8ca,_0x2e92ac=_0x6ebfc0[0x0];_0x472caa['verbose']&&(console[_0x87cca0(0x216)](_0x87cca0(0x1fd)+_0x472caa[_0x87cca0(0x22d)]),console[_0x87cca0(0x216)](_0x87cca0(0x214)+_0x2e92ac));const _0x869dd7=await withSpinner(_0x87cca0(0x23b)+_0x2e92ac+_0x87cca0(0x20a),()=>_0x3476ef[_0x87cca0(0x242)]['getMetadata'](_0x2e92ac),{'verbose':_0x472caa[_0x87cca0(0x249)]}),_0x301b77=_0x869dd7[_0x87cca0(0x22e)];console[_0x87cca0(0x216)]('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x2e92ac);if(isStructuredFormat(_0x472caa))await handleSingleObjectOutput(_0x301b77,_0x472caa);else{console[_0x87cca0(0x1e8)](_0x87cca0(0x246)+a13_0x501dc2[_0x87cca0(0x245)](_0x2e92ac)),console[_0x87cca0(0x1e8)]('Name:\x20'+_0x301b77[_0x87cca0(0x239)]);const _0x8e737=_0x301b77['settings']||[],_0x34e853=_0x8e737[_0x87cca0(0x227)](_0x3333ff=>_0x3333ff[_0x87cca0(0x1ea)]);_0x34e853['length']>0x0&&(console[_0x87cca0(0x1e8)](a13_0x501dc2[_0x87cca0(0x1fe)](_0x87cca0(0x21e))),printMetadataSettings(_0x34e853));let _0x4a2497=![];try{const _0xa6dc55=await _0x3476ef['connection'][_0x87cca0(0x21c)](_0x2e92ac),_0x1e9aef=normalizeSchemaForDisplay(_0xa6dc55);_0x1e9aef[_0x87cca0(0x1f6)]>0x0&&(console[_0x87cca0(0x1e8)](a13_0x501dc2[_0x87cca0(0x1fe)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x1e9aef,0x0),_0x4a2497=!![]);}catch{const _0x3bd724=_0x8e737['filter'](_0x3cbf7a=>!_0x3cbf7a['credential']);_0x3bd724['length']>0x0&&(console['log'](a13_0x501dc2['bold'](_0x87cca0(0x1e9))),printMetadataSettings(_0x3bd724),_0x4a2497=!![]);}!_0x4a2497&&_0x472caa['verbose']&&console[_0x87cca0(0x216)](a13_0x501dc2[_0x87cca0(0x217)](_0x87cca0(0x24d))),_0x34e853[_0x87cca0(0x1f6)]===0x0&&console['log'](a13_0x501dc2[_0x87cca0(0x217)]('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function a13_0x12e7(_0x5024a0,_0x38ad69){_0x5024a0=_0x5024a0-0x1e8;const _0x2bf2e5=a13_0x2bf2();let _0x12e77e=_0x2bf2e5[_0x5024a0];return _0x12e77e;}function printMetadataSettings(_0x327752){const _0x209aa5=a13_0x2edf0a;for(const _0x13f9b3 of _0x327752){if(!_0x13f9b3['name'])continue;if(_0x13f9b3['hidden'])continue;let _0x20ebd4='\x20\x20'+a13_0x501dc2[_0x209aa5(0x1f0)](_0x13f9b3[_0x209aa5(0x239)]);_0x13f9b3[_0x209aa5(0x229)]&&(_0x20ebd4+=':\x20'+_0x13f9b3[_0x209aa5(0x229)]);_0x13f9b3[_0x209aa5(0x208)]&&(_0x20ebd4+=a13_0x501dc2['dim']('\x20['+_0x13f9b3['type']+']'));console[_0x209aa5(0x1e8)](_0x20ebd4);_0x13f9b3['hint']&&console['log']('\x20\x20\x20\x20'+a13_0x501dc2[_0x209aa5(0x217)](_0x13f9b3[_0x209aa5(0x215)]));if(_0x13f9b3['options']){const _0x23e1be=_0x13f9b3[_0x209aa5(0x226)][_0x209aa5(0x22f)](_0x21ac15=>_0x21ac15[_0x209aa5(0x221)])['join'](',\x20');console['log']('\x20\x20\x20\x20Options:\x20'+a13_0x501dc2['yellow'](_0x23e1be));}_0x13f9b3[_0x209aa5(0x1ef)]!==undefined&&_0x13f9b3[_0x209aa5(0x1ef)]!==null&&console['log'](_0x209aa5(0x22a)+a13_0x501dc2[_0x209aa5(0x24c)](String(_0x13f9b3[_0x209aa5(0x1ef)])));if(_0x13f9b3['criteria']){const _0x5e9f8d=Object[_0x209aa5(0x1fc)](_0x13f9b3[_0x209aa5(0x1fb)])['map'](([_0x110957,_0x2f4965])=>_0x110957+'='+JSON[_0x209aa5(0x1ee)](_0x2f4965))['join'](',\x20');console[_0x209aa5(0x1e8)]('\x20\x20\x20\x20'+a13_0x501dc2['dim'](_0x209aa5(0x22c)+_0x5e9f8d));}}}
1
+ const a13_0x3e7eca=a13_0x49ab;function a13_0x1cbf(){const _0x1541b1=['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','legacy_settings','dim','Show\x20connection\x20details','\x20-\x20','map','\x20[record]','list','enumeration','\x27\x20as\x20connector\x20type','blue','bold','green','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.','resolve','No\x20available\x20fields\x20for\x20this\x20connector','type','✔\x20Found\x20connection:\x20','3076WljhFh','data','verbose','default_value','<=\x20','>=\x20','title','533574kekrBn','Resolving\x20connector\x20type\x20or\x20name:\x20','352365IAagah','push','legacy','List\x20all\x20result\x20output\x20connections','table','✔\x20Found\x20schema\x20for\x20connection\x20\x27','Fetching\x20settings\x20for\x20\x27','1226834MzCCiI','4sIXsXl','cyan','Treating\x20\x27','connection:list','1240728jqPOYf','execute','5pKKQVQ','label','length','\x20connector\x20type','\x20\x20\x20\x20','173vWvQGP','criteria','7958401ilxfCQ','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','stringify','minimum','options','\x0aConnector:\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.','✔\x20Found\x20','Listing\x20connections...','localeCompare','maximum','object','732609TLnnlJ','✔\x20Resolved\x20\x27','\x0aNo\x20credential\x20settings\x20defined','owner','connection','description','\x27\x20(type:\x20','error','padStart','Show\x20when:\x20','find','\x0aAvailable\x20fields:','Fetching\x20connection\x20\x27','\x27...','log','hint','properties','connection:show','connection:types','entries','Looking\x20up\x20connection:\x20','getOutputSchema','value','connection:schema','connection:settings','sort','max','record','getMetadata','\x20\x20\x20\x20Default:\x20','validate','Fetching\x20settings\x20for\x20connector\x20type:\x20','repeat','\x20connection','credential','\x0aNo\x20fields\x20defined\x20in\x20schema','\x20\x20\x20\x20Options:\x20','\x0aConnection:\x20','filter','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','10UvPKyA','yellow','name','Listing\x20connector\x20types...','Site:\x20','join','site','Options:\x20','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','output','Fetching\x20schema\x20for\x20\x27','List\x20available\x20connector\x20types','input'];a13_0x1cbf=function(){return _0x1541b1;};return a13_0x1cbf();}(function(_0x1d2474,_0x32745f){const _0x189408=a13_0x49ab,_0x428cd7=_0x1d2474();while(!![]){try{const _0x570377=-parseInt(_0x189408(0x1f5))/0x1*(parseInt(_0x189408(0x1d9))/0x2)+parseInt(_0x189408(0x1e2))/0x3*(-parseInt(_0x189408(0x1ea))/0x4)+-parseInt(_0x189408(0x1f0))/0x5*(parseInt(_0x189408(0x1e0))/0x6)+-parseInt(_0x189408(0x1e9))/0x7+parseInt(_0x189408(0x1ee))/0x8+-parseInt(_0x189408(0x203))/0x9*(parseInt(_0x189408(0x1b9))/0xa)+parseInt(_0x189408(0x1f7))/0xb;if(_0x570377===_0x32745f)break;else _0x428cd7['push'](_0x428cd7['shift']());}catch(_0x327769){_0x428cd7['push'](_0x428cd7['shift']());}}}(a13_0x1cbf,0x247d5));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';import a13_0x1921f2 from'chalk';function a13_0x49ab(_0x34f661,_0x19ac08){_0x34f661=_0x34f661-0x1b5;const _0x1cbfb3=a13_0x1cbf();let _0x49ab2d=_0x1cbfb3[_0x34f661];return _0x49ab2d;}function normalizeSchemaForDisplay(_0x56bb0b){const _0x229f22=a13_0x49ab,_0x83e210=_0x56bb0b[_0x229f22(0x213)]||[],_0x4f203a=_0x83e210[_0x229f22(0x20d)](_0x5f3cd9=>_0x5f3cd9[_0x229f22(0x1bb)]===_0x229f22(0x1c8)&&_0x5f3cd9[_0x229f22(0x1d7)]===_0x229f22(0x21e)&&_0x5f3cd9[_0x229f22(0x213)]);if(_0x4f203a?.['properties']){const _0x2859ce=_0x83e210[_0x229f22(0x1b7)](_0x335940=>_0x335940['name']!==_0x229f22(0x1e4)&&_0x335940[_0x229f22(0x1bb)]!=='legacy_settings');return[..._0x2859ce,..._0x4f203a[_0x229f22(0x213)]];}return _0x83e210['filter'](_0x25c866=>_0x25c866[_0x229f22(0x1bb)]!==_0x229f22(0x1e4));}function printSchemaFields(_0x484957,_0x37bfc5){const _0x49c37b=a13_0x49ab,_0xb2f9e='\x20\x20'[_0x49c37b(0x223)](_0x37bfc5+0x1),_0x5eeb21='\x20\x20'[_0x49c37b(0x223)](_0x37bfc5+0x2);for(const _0x3d5563 of _0x484957){if(!_0x3d5563[_0x49c37b(0x1bb)])continue;const _0x101882=_0x3d5563[_0x49c37b(0x1d7)]===_0x49c37b(0x21e)&&_0x3d5563['properties']&&_0x3d5563['properties'][_0x49c37b(0x1f2)]>0x0&&_0x3d5563[_0x49c37b(0x1bb)]!==_0x49c37b(0x1c8);let _0x573981=''+_0xb2f9e+a13_0x1921f2[_0x49c37b(0x1d3)](_0x3d5563[_0x49c37b(0x1bb)]);_0x3d5563[_0x49c37b(0x1df)]&&(_0x573981+=':\x20'+_0x3d5563[_0x49c37b(0x1df)]);if(_0x3d5563[_0x49c37b(0x1c6)])_0x573981+=a13_0x1921f2[_0x49c37b(0x1c9)]('\x20['+_0x3d5563['input']+']');else _0x101882&&(_0x573981+=a13_0x1921f2['dim'](_0x49c37b(0x1cd)));console['log'](_0x573981);_0x3d5563[_0x49c37b(0x208)]&&console[_0x49c37b(0x211)](''+_0x5eeb21+a13_0x1921f2[_0x49c37b(0x1c9)](_0x3d5563[_0x49c37b(0x208)]));if(_0x3d5563['enumeration']){const _0x2592bc=_0x3d5563[_0x49c37b(0x1cf)][_0x49c37b(0x1cc)](_0x537dcb=>typeof _0x537dcb===_0x49c37b(0x202)&&'value'in _0x537dcb?_0x537dcb[_0x49c37b(0x219)]:_0x537dcb)['join'](',\x20');console['log'](_0x5eeb21+_0x49c37b(0x1c0)+a13_0x1921f2['yellow'](_0x2592bc));}_0x3d5563[_0x49c37b(0x1dc)]!==undefined&&console[_0x49c37b(0x211)](_0x5eeb21+'Default:\x20'+a13_0x1921f2[_0x49c37b(0x1d1)](String(_0x3d5563[_0x49c37b(0x1dc)])));if(_0x3d5563[_0x49c37b(0x1fa)]!==undefined||_0x3d5563[_0x49c37b(0x201)]!==undefined){const _0x434f5c=_0x3d5563['minimum']!==undefined&&_0x3d5563[_0x49c37b(0x201)]!==undefined?_0x3d5563[_0x49c37b(0x1fa)]+'\x20-\x20'+_0x3d5563[_0x49c37b(0x201)]:_0x3d5563['minimum']!==undefined?_0x49c37b(0x1de)+_0x3d5563[_0x49c37b(0x1fa)]:_0x49c37b(0x1dd)+_0x3d5563[_0x49c37b(0x201)];console['log'](_0x5eeb21+'Range:\x20'+a13_0x1921f2[_0x49c37b(0x1d1)](_0x434f5c));}if(_0x3d5563[_0x49c37b(0x1f6)]){const _0x5d4073=Object[_0x49c37b(0x216)](_0x3d5563['criteria'])[_0x49c37b(0x1cc)](([_0x3e3809,_0x378490])=>_0x3e3809+'='+JSON[_0x49c37b(0x1f9)](_0x378490))[_0x49c37b(0x1be)](',\x20');console['log'](''+_0x5eeb21+a13_0x1921f2[_0x49c37b(0x1c9)](_0x49c37b(0x20c)+_0x5d4073));}_0x101882&&_0x3d5563[_0x49c37b(0x213)]&&printSchemaFields(_0x3d5563['properties'],_0x37bfc5+0x1);}}export class ConnectionListCommand extends BaseCommand{['name']=a13_0x3e7eca(0x1ed);['description']=a13_0x3e7eca(0x1e5);async[a13_0x3e7eca(0x1ef)](_0x138170){const _0x25e3ad=a13_0x3e7eca,{options:_0x341d69,tdx:_0x1624af}=_0x138170;_0x341d69[_0x25e3ad(0x1db)]&&console[_0x25e3ad(0x20a)](_0x25e3ad(0x1bd)+_0x341d69[_0x25e3ad(0x1bf)]);const _0x277ccd=resolveLimit(_0x341d69['limit'],DEFAULT_LISTING_LIMIT),_0x52f327=await withSpinner(_0x25e3ad(0x1ff),()=>_0x1624af['connection'][_0x25e3ad(0x1ce)](),{'verbose':_0x341d69[_0x25e3ad(0x1db)]}),_0x106f10=_0x52f327[_0x25e3ad(0x1da)];console[_0x25e3ad(0x20a)](_0x25e3ad(0x1fe)+_0x106f10[_0x25e3ad(0x1f2)]+_0x25e3ad(0x224)+(_0x106f10['length']!==0x1?'s':''));if(isStructuredFormat(_0x341d69)){const _0x401c0a=_0x106f10['slice'](0x0,_0x277ccd);await handleSDKOutput(_0x401c0a,{..._0x341d69,'limit':_0x277ccd});}else{const _0xb5626b=_0x106f10[_0x25e3ad(0x1f2)]>0x0?Math[_0x25e3ad(0x21d)](..._0x106f10[_0x25e3ad(0x1cc)](_0x44b5ca=>_0x44b5ca[_0x25e3ad(0x1d7)][_0x25e3ad(0x1f2)])):0x0,_0xf687c0=[];for(const _0x194073 of _0x106f10){const _0x3ede88=a13_0x1921f2[_0x25e3ad(0x1eb)](_0x194073['type'][_0x25e3ad(0x20b)](_0xb5626b)),_0x35d024=_0x194073[_0x25e3ad(0x206)]?.['name']?_0x25e3ad(0x1cb)+a13_0x1921f2[_0x25e3ad(0x1c9)](_0x194073[_0x25e3ad(0x206)][_0x25e3ad(0x1bb)]):'';_0xf687c0[_0x25e3ad(0x1e3)](_0x3ede88+'\x20\x20'+_0x194073['name']+_0x35d024);}await writeOutput(_0xf687c0[_0x25e3ad(0x1be)]('\x0a'),_0x341d69[_0x25e3ad(0x1c3)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x3e7eca(0x1bb)]=a13_0x3e7eca(0x214);[a13_0x3e7eca(0x208)]=a13_0x3e7eca(0x1ca);[a13_0x3e7eca(0x221)](_0x4d1ab0){const _0x45a766=a13_0x3e7eca,{args:_0x4408d7}=_0x4d1ab0;if(!_0x4408d7[0x0])return _0x45a766(0x1c7);return undefined;}async[a13_0x3e7eca(0x1ef)](_0x3755f8){const _0x257ce5=a13_0x3e7eca,{options:_0x149d8c,args:_0x50e249,tdx:_0x3c38ca}=_0x3755f8,_0x54d636=_0x50e249[0x0];_0x149d8c['verbose']&&(console[_0x257ce5(0x20a)](_0x257ce5(0x1bd)+_0x149d8c[_0x257ce5(0x1bf)]),console[_0x257ce5(0x20a)](_0x257ce5(0x217)+_0x54d636));const _0x52dfaf=await withSpinner(_0x257ce5(0x20f)+_0x54d636+_0x257ce5(0x210),()=>_0x3c38ca[_0x257ce5(0x207)][_0x257ce5(0x1d5)](_0x54d636),{'verbose':_0x149d8c[_0x257ce5(0x1db)]}),_0x3a14b0=_0x52dfaf[_0x257ce5(0x1da)];return console[_0x257ce5(0x20a)](_0x257ce5(0x1d8)+_0x3a14b0[_0x257ce5(0x1bb)]),await handleSingleObjectOutput(_0x3a14b0,_0x149d8c),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a13_0x3e7eca(0x21a);[a13_0x3e7eca(0x208)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';[a13_0x3e7eca(0x221)](_0xf92582){const _0x106fb1=a13_0x3e7eca,{args:_0x247ace}=_0xf92582;if(!_0x247ace[0x0])return _0x106fb1(0x1fd);return undefined;}async[a13_0x3e7eca(0x1ef)](_0x18e2df){const _0x50985b=a13_0x3e7eca,{options:_0x557cf2,args:_0x4460d5,tdx:_0x1aae9a}=_0x18e2df,_0x2f83cf=_0x4460d5[0x0];_0x557cf2[_0x50985b(0x1db)]&&(console[_0x50985b(0x20a)](_0x50985b(0x1bd)+_0x557cf2['site']),console[_0x50985b(0x20a)](_0x50985b(0x1e1)+_0x2f83cf));let _0x38dfe1=_0x2f83cf,_0x37486c;try{const _0x3b49b0=await _0x1aae9a[_0x50985b(0x207)]['findByName'](_0x2f83cf);_0x3b49b0&&(_0x38dfe1=_0x3b49b0['type'],_0x37486c=_0x3b49b0[_0x50985b(0x1bb)],_0x557cf2[_0x50985b(0x1db)]&&console[_0x50985b(0x20a)](_0x50985b(0x204)+_0x2f83cf+_0x50985b(0x1c2)+_0x38dfe1));}catch{_0x557cf2[_0x50985b(0x1db)]&&console[_0x50985b(0x20a)](_0x50985b(0x1ec)+_0x2f83cf+_0x50985b(0x1d0));}const _0x26032d=await withSpinner(_0x50985b(0x1c4)+_0x38dfe1+'\x27...',()=>_0x1aae9a['connection'][_0x50985b(0x218)](_0x38dfe1),{'verbose':_0x557cf2[_0x50985b(0x1db)]}),_0x27442c=_0x26032d[_0x50985b(0x1da)];_0x37486c?console[_0x50985b(0x20a)](_0x50985b(0x1e7)+_0x37486c+_0x50985b(0x209)+_0x38dfe1+')'):console[_0x50985b(0x20a)](_0x50985b(0x1c1)+_0x38dfe1);if(isStructuredFormat(_0x557cf2))await handleSingleObjectOutput(_0x27442c,_0x557cf2);else{const _0x3bd33a=normalizeSchemaForDisplay(_0x27442c);_0x37486c?(console['log'](_0x50985b(0x1b6)+a13_0x1921f2[_0x50985b(0x1eb)](_0x37486c)),console[_0x50985b(0x211)]('Type:\x20'+a13_0x1921f2['dim'](_0x38dfe1))):console[_0x50985b(0x211)](_0x50985b(0x1fc)+a13_0x1921f2[_0x50985b(0x1eb)](_0x38dfe1)),_0x3bd33a[_0x50985b(0x1f2)]>0x0?(console[_0x50985b(0x211)](a13_0x1921f2['bold'](_0x50985b(0x20e))),printSchemaFields(_0x3bd33a,0x0)):console[_0x50985b(0x211)](a13_0x1921f2[_0x50985b(0x1c9)](_0x50985b(0x226)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x3e7eca(0x1bb)]=a13_0x3e7eca(0x215);[a13_0x3e7eca(0x208)]=a13_0x3e7eca(0x1c5);async['execute'](_0x2eccf0){const _0x50b58a=a13_0x3e7eca,{options:_0x2a4b97,tdx:_0x399a70}=_0x2eccf0;_0x2a4b97[_0x50b58a(0x1db)]&&console['error'](_0x50b58a(0x1bd)+_0x2a4b97[_0x50b58a(0x1bf)]);const _0x503875=await withSpinner(_0x50b58a(0x1bc),()=>_0x399a70['connection']['listTypes'](),{'verbose':_0x2a4b97[_0x50b58a(0x1db)]}),_0x4f9603=_0x503875[_0x50b58a(0x1da)][_0x50b58a(0x21c)]((_0x1a0b1f,_0x5aa43d)=>_0x1a0b1f[_0x50b58a(0x1d7)][_0x50b58a(0x200)](_0x5aa43d[_0x50b58a(0x1d7)]));console['error'](_0x50b58a(0x1fe)+_0x4f9603[_0x50b58a(0x1f2)]+_0x50b58a(0x1f3)+(_0x4f9603[_0x50b58a(0x1f2)]!==0x1?'s':''));if(isStructuredFormat(_0x2a4b97))await handleSDKOutput(_0x4f9603,_0x2a4b97);else{const _0x48bc1b=_0x4f9603['length']>0x0?Math['max'](..._0x4f9603['map'](_0x1d8f93=>_0x1d8f93[_0x50b58a(0x1d7)][_0x50b58a(0x1f2)])):0x0,_0x288ab1=[];for(const _0x61e50a of _0x4f9603){const _0x1b395b=a13_0x1921f2['cyan'](_0x61e50a['type'][_0x50b58a(0x20b)](_0x48bc1b));_0x288ab1[_0x50b58a(0x1e3)](_0x1b395b+'\x20\x20'+_0x61e50a[_0x50b58a(0x1bb)]);}await writeOutput(_0x288ab1[_0x50b58a(0x1be)]('\x0a'),_0x2a4b97[_0x50b58a(0x1c3)],_0x50b58a(0x1e6));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x3e7eca(0x1bb)]=a13_0x3e7eca(0x21b);[a13_0x3e7eca(0x208)]=a13_0x3e7eca(0x1b8);[a13_0x3e7eca(0x221)](_0x267ff9){const _0x201077=a13_0x3e7eca,{args:_0x5e5151}=_0x267ff9;if(!_0x5e5151[0x0])return _0x201077(0x1d4);return undefined;}async['execute'](_0x292b7c){const _0x1c5f74=a13_0x3e7eca,{options:_0x28a30a,args:_0x2e7daa,tdx:_0x36a7f2}=_0x292b7c,_0x5ee2c4=_0x2e7daa[0x0];_0x28a30a[_0x1c5f74(0x1db)]&&(console[_0x1c5f74(0x20a)]('Site:\x20'+_0x28a30a[_0x1c5f74(0x1bf)]),console[_0x1c5f74(0x20a)](_0x1c5f74(0x222)+_0x5ee2c4));const _0x31622f=await withSpinner(_0x1c5f74(0x1e8)+_0x5ee2c4+_0x1c5f74(0x210),()=>_0x36a7f2[_0x1c5f74(0x207)][_0x1c5f74(0x21f)](_0x5ee2c4),{'verbose':_0x28a30a['verbose']}),_0x34a177=_0x31622f[_0x1c5f74(0x1da)];console[_0x1c5f74(0x20a)](_0x1c5f74(0x1f8)+_0x5ee2c4);if(isStructuredFormat(_0x28a30a))await handleSingleObjectOutput(_0x34a177,_0x28a30a);else{console[_0x1c5f74(0x211)]('\x0aConnector:\x20'+a13_0x1921f2[_0x1c5f74(0x1eb)](_0x5ee2c4)),console[_0x1c5f74(0x211)]('Name:\x20'+_0x34a177['name']);const _0x29bf35=_0x34a177['settings']||[],_0x1f382e=_0x29bf35[_0x1c5f74(0x1b7)](_0x3846da=>_0x3846da[_0x1c5f74(0x225)]);_0x1f382e[_0x1c5f74(0x1f2)]>0x0&&(console[_0x1c5f74(0x211)](a13_0x1921f2[_0x1c5f74(0x1d2)]('\x0aCredential\x20settings:')),printMetadataSettings(_0x1f382e));let _0x7d0538=![];try{const _0x1ff497=await _0x36a7f2['connection'][_0x1c5f74(0x218)](_0x5ee2c4),_0x5723a8=normalizeSchemaForDisplay(_0x1ff497);_0x5723a8[_0x1c5f74(0x1f2)]>0x0&&(console[_0x1c5f74(0x211)](a13_0x1921f2[_0x1c5f74(0x1d2)](_0x1c5f74(0x20e))),printSchemaFields(_0x5723a8,0x0),_0x7d0538=!![]);}catch{const _0x21e600=_0x29bf35['filter'](_0x3162eb=>!_0x3162eb['credential']);_0x21e600[_0x1c5f74(0x1f2)]>0x0&&(console['log'](a13_0x1921f2['bold'](_0x1c5f74(0x20e))),printMetadataSettings(_0x21e600),_0x7d0538=!![]);}!_0x7d0538&&_0x28a30a['verbose']&&console['error'](a13_0x1921f2['dim'](_0x1c5f74(0x1d6))),_0x1f382e[_0x1c5f74(0x1f2)]===0x0&&console[_0x1c5f74(0x211)](a13_0x1921f2[_0x1c5f74(0x1c9)](_0x1c5f74(0x205)));}return 0x0;}}function printMetadataSettings(_0x1e93d9){const _0x4df11e=a13_0x3e7eca;for(const _0x27fd74 of _0x1e93d9){if(!_0x27fd74[_0x4df11e(0x1bb)])continue;if(_0x27fd74['hidden'])continue;let _0x259d8f='\x20\x20'+a13_0x1921f2[_0x4df11e(0x1d3)](_0x27fd74[_0x4df11e(0x1bb)]);_0x27fd74[_0x4df11e(0x1f1)]&&(_0x259d8f+=':\x20'+_0x27fd74[_0x4df11e(0x1f1)]);_0x27fd74[_0x4df11e(0x1d7)]&&(_0x259d8f+=a13_0x1921f2['dim']('\x20['+_0x27fd74[_0x4df11e(0x1d7)]+']'));console['log'](_0x259d8f);_0x27fd74[_0x4df11e(0x212)]&&console[_0x4df11e(0x211)](_0x4df11e(0x1f4)+a13_0x1921f2[_0x4df11e(0x1c9)](_0x27fd74['hint']));if(_0x27fd74[_0x4df11e(0x1fb)]){const _0x3ed081=_0x27fd74[_0x4df11e(0x1fb)][_0x4df11e(0x1cc)](_0x298451=>_0x298451['value'])[_0x4df11e(0x1be)](',\x20');console[_0x4df11e(0x211)](_0x4df11e(0x1b5)+a13_0x1921f2[_0x4df11e(0x1ba)](_0x3ed081));}_0x27fd74[_0x4df11e(0x1dc)]!==undefined&&_0x27fd74['default_value']!==null&&console[_0x4df11e(0x211)](_0x4df11e(0x220)+a13_0x1921f2[_0x4df11e(0x1d1)](String(_0x27fd74[_0x4df11e(0x1dc)])));if(_0x27fd74['criteria']){const _0x2457eb=Object['entries'](_0x27fd74[_0x4df11e(0x1f6)])[_0x4df11e(0x1cc)](([_0x404ecb,_0x4f8456])=>_0x404ecb+'='+JSON[_0x4df11e(0x1f9)](_0x4f8456))['join'](',\x20');console[_0x4df11e(0x211)](_0x4df11e(0x1f4)+a13_0x1921f2[_0x4df11e(0x1c9)](_0x4df11e(0x20c)+_0x2457eb));}}}
@@ -1 +1 @@
1
- const a14_0xf7263f=a14_0x54f2;function a14_0x4f91(){const _0x5c7687=['listDatabases','verbose','\x20database','Error:\x20','databases','13941zoQycM','description','4802130HsovRE','message','site','Site:\x20','query','execute','3HkqPdW','945215TltbBi','1514944sivEpw','1501208XZKBli','error','length','2892196foGobk','Pattern:\x20','\x20\x20Cause:\x20','2507175TGsAtg','limit','name','7dAgQxA','data','10890YQNSAo','List\x20all\x20databases','Listing\x20databases...'];a14_0x4f91=function(){return _0x5c7687;};return a14_0x4f91();}(function(_0x3cae2a,_0x279e24){const _0x21b42f=a14_0x54f2,_0x1867f0=_0x3cae2a();while(!![]){try{const _0x422ef0=-parseInt(_0x21b42f(0x167))/0x1+-parseInt(_0x21b42f(0x16c))/0x2+-parseInt(_0x21b42f(0x166))/0x3*(-parseInt(_0x21b42f(0x169))/0x4)+parseInt(_0x21b42f(0x16f))/0x5+parseInt(_0x21b42f(0x160))/0x6+parseInt(_0x21b42f(0x172))/0x7*(-parseInt(_0x21b42f(0x168))/0x8)+-parseInt(_0x21b42f(0x17c))/0x9*(-parseInt(_0x21b42f(0x174))/0xa);if(_0x422ef0===_0x279e24)break;else _0x1867f0['push'](_0x1867f0['shift']());}catch(_0x437a73){_0x1867f0['push'](_0x1867f0['shift']());}}}(a14_0x4f91,0xbf3a8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a14_0x54f2(_0x378484,_0x3c21c2){_0x378484=_0x378484-0x15f;const _0x4f91ce=a14_0x4f91();let _0x54f2d4=_0x4f91ce[_0x378484];return _0x54f2d4;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0xf7263f(0x171)]=a14_0xf7263f(0x17b);[a14_0xf7263f(0x15f)]=a14_0xf7263f(0x175);async[a14_0xf7263f(0x165)](_0x145be3){const _0xafeaed=a14_0xf7263f,{options:_0x5bbfa1,args:_0x3ae7d4,tdx:_0x1b194d}=_0x145be3,_0xeec63c=_0x3ae7d4[0x0];try{_0x5bbfa1[_0xafeaed(0x178)]&&(console[_0xafeaed(0x16a)](_0xafeaed(0x163)+_0x5bbfa1[_0xafeaed(0x162)]),_0xeec63c&&console[_0xafeaed(0x16a)](_0xafeaed(0x16d)+_0xeec63c));const _0x110dbe=resolveLimit(_0x5bbfa1[_0xafeaed(0x170)],DEFAULT_LISTING_LIMIT),_0x35491a=await withSpinner(_0xafeaed(0x176),()=>_0x1b194d[_0xafeaed(0x164)][_0xafeaed(0x177)](_0xeec63c,_0x110dbe),{'verbose':_0x5bbfa1[_0xafeaed(0x178)]}),_0x564f89=_0x35491a[_0xafeaed(0x173)];return console['error']('✔\x20Found\x20'+_0x564f89[_0xafeaed(0x16b)]+_0xafeaed(0x179)+(_0x564f89[_0xafeaed(0x16b)]!==0x1?'s':'')),await handleSDKOutput(_0x564f89,{..._0x5bbfa1,'limit':_0x110dbe}),0x0;}catch(_0x3d9289){if(_0x3d9289 instanceof SDKError)return console[_0xafeaed(0x16a)](_0xafeaed(0x17a)+_0x3d9289[_0xafeaed(0x161)]),_0x3d9289['cause']&&console['error'](_0xafeaed(0x16e)+_0x3d9289['cause']),0x1;throw _0x3d9289;}}}
1
+ function a14_0x31ae(){const _0x71caa3=['listDatabases','296iXXXlD','29724GyTDGZ','4428501InEpov','execute','site','Listing\x20databases...','limit','message','78rogPUi','14634OJfaJn','verbose','\x20\x20Cause:\x20','48FXYFVK','126401OXJVpA','792zLGeGl','query','Site:\x20','8vMFFTN','1180MsjTzp','List\x20all\x20databases','41450goHhch','description','1868cdSdKx','error','✔\x20Found\x20','name','1521MlAgIJ','databases','781466lxYhuF','length','cause','Error:\x20','\x20database'];a14_0x31ae=function(){return _0x71caa3;};return a14_0x31ae();}const a14_0x523e4d=a14_0x5f92;(function(_0x206ade,_0xfc6a8c){const _0x12a342=a14_0x5f92,_0x3c0752=_0x206ade();while(!![]){try{const _0x28bbfa=parseInt(_0x12a342(0xe6))/0x1*(-parseInt(_0x12a342(0xee))/0x2)+-parseInt(_0x12a342(0xd9))/0x3*(-parseInt(_0x12a342(0xd8))/0x4)+parseInt(_0x12a342(0xea))/0x5*(-parseInt(_0x12a342(0xe1))/0x6)+-parseInt(_0x12a342(0xda))/0x7*(-parseInt(_0x12a342(0xe9))/0x8)+-parseInt(_0x12a342(0xf2))/0x9*(-parseInt(_0x12a342(0xec))/0xa)+-parseInt(_0x12a342(0xe5))/0xb*(parseInt(_0x12a342(0xe4))/0xc)+parseInt(_0x12a342(0xe0))/0xd*(-parseInt(_0x12a342(0xd2))/0xe);if(_0x28bbfa===_0xfc6a8c)break;else _0x3c0752['push'](_0x3c0752['shift']());}catch(_0x5d2788){_0x3c0752['push'](_0x3c0752['shift']());}}}(a14_0x31ae,0x5a5d2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a14_0x5f92(_0x392997,_0x29922b){_0x392997=_0x392997-0xd2;const _0x31ae31=a14_0x31ae();let _0x5f9265=_0x31ae31[_0x392997];return _0x5f9265;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0x523e4d(0xf1)]=a14_0x523e4d(0xf3);[a14_0x523e4d(0xed)]=a14_0x523e4d(0xeb);async[a14_0x523e4d(0xdb)](_0xe88587){const _0x53b1da=a14_0x523e4d,{options:_0x8536d8,args:_0x400efc,tdx:_0x5e0f6c}=_0xe88587,_0x272a37=_0x400efc[0x0];try{_0x8536d8[_0x53b1da(0xe2)]&&(console[_0x53b1da(0xef)](_0x53b1da(0xe8)+_0x8536d8[_0x53b1da(0xdc)]),_0x272a37&&console[_0x53b1da(0xef)]('Pattern:\x20'+_0x272a37));const _0x5c41a0=resolveLimit(_0x8536d8[_0x53b1da(0xde)],DEFAULT_LISTING_LIMIT),_0x22c448=await withSpinner(_0x53b1da(0xdd),()=>_0x5e0f6c[_0x53b1da(0xe7)][_0x53b1da(0xd7)](_0x272a37,_0x5c41a0),{'verbose':_0x8536d8['verbose']}),_0x3de2c2=_0x22c448['data'];return console['error'](_0x53b1da(0xf0)+_0x3de2c2[_0x53b1da(0xd3)]+_0x53b1da(0xd6)+(_0x3de2c2['length']!==0x1?'s':'')),await handleSDKOutput(_0x3de2c2,{..._0x8536d8,'limit':_0x5c41a0}),0x0;}catch(_0xc7dd69){if(_0xc7dd69 instanceof SDKError)return console[_0x53b1da(0xef)](_0x53b1da(0xd5)+_0xc7dd69[_0x53b1da(0xdf)]),_0xc7dd69[_0x53b1da(0xd4)]&&console[_0x53b1da(0xef)](_0x53b1da(0xe3)+_0xc7dd69[_0x53b1da(0xd4)]),0x1;throw _0xc7dd69;}}}
@@ -1 +1 @@
1
- const a15_0x38893b=a15_0x3302;(function(_0x1b6038,_0x12b87c){const _0xf3b36b=a15_0x3302,_0x113a25=_0x1b6038();while(!![]){try{const _0x190ff3=-parseInt(_0xf3b36b(0x79))/0x1*(-parseInt(_0xf3b36b(0x83))/0x2)+-parseInt(_0xf3b36b(0x89))/0x3+-parseInt(_0xf3b36b(0x8c))/0x4+-parseInt(_0xf3b36b(0x71))/0x5+-parseInt(_0xf3b36b(0x70))/0x6*(-parseInt(_0xf3b36b(0x78))/0x7)+-parseInt(_0xf3b36b(0x94))/0x8*(parseInt(_0xf3b36b(0x74))/0x9)+-parseInt(_0xf3b36b(0x6e))/0xa*(-parseInt(_0xf3b36b(0x72))/0xb);if(_0x190ff3===_0x12b87c)break;else _0x113a25['push'](_0x113a25['shift']());}catch(_0x3428d4){_0x113a25['push'](_0x113a25['shift']());}}}(a15_0x7744,0xc4353));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a15_0x7744(){const _0xb41500=['validate','table','Table\x20\x27','execute','272YGpirv','Table:\x20','37880eXQDtW','database','24bFPmvc','5788795sEpOab','11099juQWuV','Describe\x20table\x20schema','165024auxxIR','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','data','...','758170LtfloX','26269IVIIQU','Database:\x20','Error:\x20','Describing\x20table\x20','message','args','✔\x20Found\x20','describe','length','verbose','2WRPgCr','description','error','✖\x20Table\x20not\x20found','\x27\x20does\x20not\x20exist','\x20\x20Cause:\x20','3864732OItVcf','\x20column','\x20in\x20','1634028QlvByd','cause','site','describeTable'];a15_0x7744=function(){return _0xb41500;};return a15_0x7744();}function a15_0x3302(_0x4679c7,_0xd50a65){_0x4679c7=_0x4679c7-0x6d;const _0x774416=a15_0x7744();let _0x330224=_0x774416[_0x4679c7];return _0x330224;}export class DescribeCommand extends BaseCommand{['name']=a15_0x38893b(0x80);[a15_0x38893b(0x84)]=a15_0x38893b(0x73);async[a15_0x38893b(0x93)](_0x231f76){const _0x10939d=a15_0x38893b;return this[_0x10939d(0x8f)](_0x231f76);}async['describeTable'](_0x4963a1){const _0x11ae64=a15_0x38893b,{options:_0x20b54f,args:_0x2bf8b0,tdx:_0x42f33d}=_0x4963a1;let _0x5a2070;try{_0x5a2070=parseTableReference(_0x2bf8b0[0x0]);const _0x5b257d=_0x20b54f[_0x11ae64(0x6f)];!_0x5a2070[_0x11ae64(0x6f)]&&_0x5b257d&&(_0x5a2070[_0x11ae64(0x6f)]=_0x5b257d);const _0x498b80=validateTableDescribeReference(_0x5a2070);if(_0x498b80)return console[_0x11ae64(0x85)](_0x11ae64(0x7b)+_0x498b80),0x1;}catch(_0x55a20b){return console['error'](_0x11ae64(0x7b)+_0x55a20b['message']),0x1;}const _0x180e3c=_0x5a2070[_0x11ae64(0x6f)],_0x150465=_0x5a2070[_0x11ae64(0x91)];try{_0x20b54f['verbose']&&(console['error']('Site:\x20'+_0x20b54f[_0x11ae64(0x8e)]),console['error'](_0x11ae64(0x7a)+_0x180e3c),console['error'](_0x11ae64(0x6d)+_0x150465));const _0x137172=await withSpinner(_0x11ae64(0x7c)+_0x180e3c+'.'+_0x150465+_0x11ae64(0x77),()=>_0x42f33d['query'][_0x11ae64(0x8f)](_0x180e3c,_0x150465),{'verbose':_0x20b54f[_0x11ae64(0x82)]}),_0x5c0cd3=_0x137172[_0x11ae64(0x76)];if(_0x5c0cd3[_0x11ae64(0x81)]===0x0)return console[_0x11ae64(0x85)](_0x11ae64(0x86)),console[_0x11ae64(0x85)](_0x11ae64(0x92)+_0x180e3c+'.'+_0x150465+_0x11ae64(0x87)),0x1;return console[_0x11ae64(0x85)](_0x11ae64(0x7f)+_0x5c0cd3[_0x11ae64(0x81)]+_0x11ae64(0x8a)+(_0x5c0cd3[_0x11ae64(0x81)]!==0x1?'s':'')+_0x11ae64(0x8b)+_0x180e3c+'.'+_0x150465),await handleSDKOutput(_0x5c0cd3,_0x20b54f),0x0;}catch(_0x3fa2d7){if(_0x3fa2d7 instanceof SDKError)return console[_0x11ae64(0x85)](_0x11ae64(0x7b)+_0x3fa2d7[_0x11ae64(0x7d)]),_0x3fa2d7[_0x11ae64(0x8d)]&&console['error'](_0x11ae64(0x88)+_0x3fa2d7[_0x11ae64(0x8d)]),0x1;throw _0x3fa2d7;}}[a15_0x38893b(0x90)](_0x51f12e){const _0x2fc47d=a15_0x38893b;if(_0x51f12e[_0x2fc47d(0x7e)]['length']===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(_0x51f12e[_0x2fc47d(0x7e)][_0x2fc47d(0x81)]>0x1)return _0x2fc47d(0x75);return undefined;}}
1
+ const a15_0x41cb04=a15_0x2a66;(function(_0x49369d,_0x3c20ef){const _0x546cdc=a15_0x2a66,_0x22e59f=_0x49369d();while(!![]){try{const _0x5b2ff2=-parseInt(_0x546cdc(0x10c))/0x1*(-parseInt(_0x546cdc(0x10a))/0x2)+-parseInt(_0x546cdc(0xe9))/0x3*(-parseInt(_0x546cdc(0x10e))/0x4)+-parseInt(_0x546cdc(0x106))/0x5+-parseInt(_0x546cdc(0xe6))/0x6*(parseInt(_0x546cdc(0xf9))/0x7)+parseInt(_0x546cdc(0xf2))/0x8*(parseInt(_0x546cdc(0x10b))/0x9)+-parseInt(_0x546cdc(0x10d))/0xa*(parseInt(_0x546cdc(0x102))/0xb)+parseInt(_0x546cdc(0x107))/0xc*(parseInt(_0x546cdc(0xfa))/0xd);if(_0x5b2ff2===_0x3c20ef)break;else _0x22e59f['push'](_0x22e59f['shift']());}catch(_0x54f92){_0x22e59f['push'](_0x22e59f['shift']());}}}(a15_0x572f,0xc2f84));import{BaseCommand}from'./command.js';function a15_0x572f(){const _0x23d9fb=['database','query','args','verbose','cause','description','14472paILln','\x20in\x20','table','message','Database:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','validate','7zPOFxs','34385bbRVFl','✖\x20Table\x20not\x20found','Site:\x20','\x20\x20Cause:\x20','name','describe','...','error','8273122YlFFYi','length','describeTable','✔\x20Found\x20','4397710ZgSXdY','7308cJpvOZ','\x20column','Describe\x20table\x20schema','3022762QUIsNt','729iRyrxY','1qVLZyF','20WCscIh','340GDqCCx','execute','Error:\x20','1904928ZdJRZh','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','\x27\x20does\x20not\x20exist','8157geyIhX','Describing\x20table\x20','Table:\x20'];a15_0x572f=function(){return _0x23d9fb;};return a15_0x572f();}function a15_0x2a66(_0x217be3,_0x519c7f){_0x217be3=_0x217be3-0xe6;const _0x572f50=a15_0x572f();let _0x2a6617=_0x572f50[_0x217be3];return _0x2a6617;}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{[a15_0x41cb04(0xfe)]=a15_0x41cb04(0xff);[a15_0x41cb04(0xf1)]=a15_0x41cb04(0x109);async[a15_0x41cb04(0x10f)](_0xc4deba){const _0x2499e9=a15_0x41cb04;return this[_0x2499e9(0x104)](_0xc4deba);}async[a15_0x41cb04(0x104)](_0x498055){const _0x36d228=a15_0x41cb04,{options:_0x34ba59,args:_0x2d41f8,tdx:_0x2a7e64}=_0x498055;let _0xd812fc;try{_0xd812fc=parseTableReference(_0x2d41f8[0x0]);const _0xa06507=_0x34ba59[_0x36d228(0xec)];!_0xd812fc[_0x36d228(0xec)]&&_0xa06507&&(_0xd812fc[_0x36d228(0xec)]=_0xa06507);const _0x5ea651=validateTableDescribeReference(_0xd812fc);if(_0x5ea651)return console[_0x36d228(0x101)](_0x36d228(0x110)+_0x5ea651),0x1;}catch(_0x32e487){return console[_0x36d228(0x101)](_0x36d228(0x110)+_0x32e487[_0x36d228(0xf5)]),0x1;}const _0x479bac=_0xd812fc[_0x36d228(0xec)],_0x1746d3=_0xd812fc[_0x36d228(0xf4)];try{_0x34ba59[_0x36d228(0xef)]&&(console[_0x36d228(0x101)](_0x36d228(0xfc)+_0x34ba59['site']),console[_0x36d228(0x101)](_0x36d228(0xf6)+_0x479bac),console[_0x36d228(0x101)](_0x36d228(0xeb)+_0x1746d3));const _0x4985fc=await withSpinner(_0x36d228(0xea)+_0x479bac+'.'+_0x1746d3+_0x36d228(0x100),()=>_0x2a7e64[_0x36d228(0xed)][_0x36d228(0x104)](_0x479bac,_0x1746d3),{'verbose':_0x34ba59[_0x36d228(0xef)]}),_0x492411=_0x4985fc['data'];if(_0x492411[_0x36d228(0x103)]===0x0)return console[_0x36d228(0x101)](_0x36d228(0xfb)),console[_0x36d228(0x101)]('Table\x20\x27'+_0x479bac+'.'+_0x1746d3+_0x36d228(0xe8)),0x1;return console[_0x36d228(0x101)](_0x36d228(0x105)+_0x492411['length']+_0x36d228(0x108)+(_0x492411[_0x36d228(0x103)]!==0x1?'s':'')+_0x36d228(0xf3)+_0x479bac+'.'+_0x1746d3),await handleSDKOutput(_0x492411,_0x34ba59),0x0;}catch(_0x1b5812){if(_0x1b5812 instanceof SDKError)return console[_0x36d228(0x101)](_0x36d228(0x110)+_0x1b5812[_0x36d228(0xf5)]),_0x1b5812[_0x36d228(0xf0)]&&console[_0x36d228(0x101)](_0x36d228(0xfd)+_0x1b5812[_0x36d228(0xf0)]),0x1;throw _0x1b5812;}}[a15_0x41cb04(0xf8)](_0x55edd8){const _0x358641=a15_0x41cb04;if(_0x55edd8['args'][_0x358641(0x103)]===0x0)return _0x358641(0xe7);if(_0x55edd8[_0x358641(0xee)]['length']>0x1)return _0x358641(0xf7);return undefined;}}
@@ -1 +1 @@
1
- const a16_0x159aef=a16_0x5dbe;(function(_0xb627b7,_0x232422){const _0x121af4=a16_0x5dbe,_0x2445d3=_0xb627b7();while(!![]){try{const _0x4d30e1=-parseInt(_0x121af4(0x1c3))/0x1*(parseInt(_0x121af4(0x202))/0x2)+parseInt(_0x121af4(0x238))/0x3+parseInt(_0x121af4(0x1fa))/0x4+-parseInt(_0x121af4(0x1d0))/0x5+-parseInt(_0x121af4(0x1b1))/0x6*(parseInt(_0x121af4(0x220))/0x7)+-parseInt(_0x121af4(0x1ea))/0x8*(-parseInt(_0x121af4(0x200))/0x9)+parseInt(_0x121af4(0x1e6))/0xa*(parseInt(_0x121af4(0x1fb))/0xb);if(_0x4d30e1===_0x232422)break;else _0x2445d3['push'](_0x2445d3['shift']());}catch(_0x1efd40){_0x2445d3['push'](_0x2445d3['shift']());}}}(a16_0x3edc,0x8bb38));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a16_0x3edc(){const _0xddcdb=['Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Campaign\x20\x27','Resume\x20a\x20paused\x20campaign','segmentId','filter','engage:workspaces','getCampaignFull','createTemplate','updateWorkspace','getTemplate','updateTemplate','name','Pause\x20a\x20campaign','html','engage:campaign:show','Creating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','yes','\x27\x20resumed\x20successfully','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','1465677aOxHBa','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','engage','deleteWorkspace','Launch\x20a\x20campaign','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','6IWqiqC','Template\x20\x27','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:campaign:duplicate','listCampaigns','subject','resumeCampaign','entries','Show\x20campaign\x20details','session','Update\x20a\x20workspace','timezone','execute','MISSING_ARGUMENT','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','updateCampaign','Launching\x20campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','169926KDlbcf','getWorkspace','verbose','error','getTemplateFull','workspace','Updating\x20workspace\x20\x27','log','Deleting\x20campaign\x20\x27','segmentName','Error:\x20--subject\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','3350155LFpvvt','limit','segment','Workspace\x20\x27','type','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','engage:campaign:resume','listTemplates','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Create\x20a\x20new\x20campaign','engage:workspace:use','Error:\x20--name\x20is\x20required','editorType','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Delete\x20a\x20workspace','List\x20campaigns','\x27\x20launched\x20successfully','length','Fetching\x20template\x20\x27','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Operation\x20cancelled','description','13276840FaeorO','getWorkspaceFull','engage:campaign:pause','\x27?\x20This\x20cannot\x20be\x20undone.','1359112hvlFGx','engage:template:update','deleteTemplate','Fetching\x20templates...','engage:campaign:update','Options:\x20--name,\x20--description','data','Duplicate\x20a\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','resolveWorkspaceId','\x27...','launchCampaign','engage:workspace:delete','engage:campaigns','Set\x20workspace\x20context\x20for\x20Engage\x20commands','engage:template:delete','3641776PZCHyM','11cDPrXx','startAt','\x27\x20deleted\x20successfully','Delete\x20an\x20email\x20template','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','27RNgYrl','plaintext','12oBkldX','Create\x20a\x20workspace','Delete\x20a\x20campaign','\x27\x20paused\x20successfully','jsonColumns','createWorkspace','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Fetching\x20campaigns...','Duplicating\x20campaign\x20\x27','Fetching\x20workspace\x20\x27','listWorkspaces','Creating\x20workspace\x20\x27','createCampaign','List\x20workspaces','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Updating\x20campaign\x20\x27','Update\x20an\x20email\x20template','status','Workspace\x20is\x20required\x20for\x20this\x20operation','keys','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','engage:template:create','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Creating\x20campaign\x20\x27','full','engage:workspace:show','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage_workspace','fromEntries','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','6821857XqGJZd','Show\x20email\x20template\x20details'];a16_0x3edc=function(){return _0xddcdb;};return a16_0x3edc();}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(_0x132478,_0x2655b8,_0x33fa9c=![]){const _0x30302c=a16_0x5dbe;if(_0x132478['workspace'])return await _0x2655b8[_0x30302c(0x1ad)]['resolveWorkspaceId'](_0x132478[_0x30302c(0x1c8)]);const _0x4620b2=loadSessionContext(_0x132478[_0x30302c(0x1ba)]);if(_0x4620b2?.[_0x30302c(0x21d)])return await _0x2655b8[_0x30302c(0x1ad)][_0x30302c(0x1f3)](_0x4620b2['engage_workspace']);if(_0x33fa9c)throw new SDKError(ErrorCode[_0x30302c(0x1be)],_0x30302c(0x214),undefined,{'helpText':_0x30302c(0x237)});return undefined;}async function resolveSegmentFromOptions(_0x59f501,_0x767faa){const _0x43250c=a16_0x5dbe;if(!_0x59f501[_0x43250c(0x1d2)])return{};const _0x36f42f=_0x59f501[_0x43250c(0x1d2)],_0x349326=await _0x767faa[_0x43250c(0x1d2)]['resolvePathToResource'](_0x36f42f);return{'audienceId':_0x349326['parentId'],'audienceName':_0x349326['parentName'],..._0x349326['segmentId']&&{'segmentId':_0x349326[_0x43250c(0x225)],'segmentName':_0x349326[_0x43250c(0x1cc)]}};}function buildConnectorConfig(_0x32b383){const _0x518018=a16_0x5dbe,_0x4799f2=_0x32b383['emailSenderId'],_0x10ef1b=_0x32b383[_0x518018(0x206)];if(!_0x4799f2&&!_0x10ef1b)return undefined;return{..._0x4799f2&&{'emailSenderId':_0x4799f2},..._0x10ef1b&&{'jsonColumns':_0x10ef1b}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x1f7);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1df);async['execute'](_0x277ee6){const _0x4edc75=a16_0x159aef,{options:_0x12cacd,args:_0x52e39a,tdx:_0x4ce411}=_0x277ee6,_0x194c11=_0x52e39a[0x0],_0x13e194=resolveLimit(_0x12cacd[_0x4edc75(0x1d1)],DEFAULT_LLM_LIMIT),_0x5126d0=_0x12cacd,_0x2ee795=_0x5126d0['type'],_0x26dd38=_0x5126d0[_0x4edc75(0x213)],_0xd4fa01=await resolveWorkspaceIdFromOptions(_0x5126d0,_0x4ce411),_0x1385fd=await withSpinner(_0x4edc75(0x209),()=>_0x4ce411[_0x4edc75(0x1ad)][_0x4edc75(0x1b5)]({'type':_0x2ee795,'status':_0x26dd38,'workspaceId':_0xd4fa01,'limit':_0x13e194}),{'verbose':_0x12cacd[_0x4edc75(0x1c5)]});let _0x1dc8ca=_0x1385fd[_0x4edc75(0x1f0)];return _0x194c11&&(_0x1dc8ca=_0x1385fd[_0x4edc75(0x1f0)]['filter'](_0x2d8dc2=>matchGlobPattern(_0x2d8dc2[_0x4edc75(0x22d)],_0x194c11))),await handleSDKOutput(_0x1dc8ca,_0x12cacd),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x230);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1b9);async[a16_0x159aef(0x1bd)](_0x241a6e){const _0x27d5be=a16_0x159aef,{options:_0x1b2e28,args:_0x3a33ed,tdx:_0x2c9e86}=_0x241a6e;if(_0x3a33ed[_0x27d5be(0x1e1)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x27d5be(0x1c6)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x9fa55a=_0x3a33ed[0x0],_0x51357e=_0x1b2e28,_0x11b003=await resolveWorkspaceIdFromOptions(_0x51357e,_0x2c9e86),_0x2fee22=_0x51357e[_0x27d5be(0x21a)];if(_0x2fee22){const _0x22e77d=await withSpinner('Fetching\x20campaign\x20\x27'+_0x9fa55a+_0x27d5be(0x1f4),()=>_0x2c9e86['engage'][_0x27d5be(0x228)](_0x9fa55a,_0x11b003),{'verbose':_0x1b2e28[_0x27d5be(0x1c5)]});await handleSDKOutput([_0x22e77d],_0x1b2e28);}else{const _0x1c348a=await withSpinner('Fetching\x20campaign\x20\x27'+_0x9fa55a+'\x27...',()=>_0x2c9e86[_0x27d5be(0x1ad)]['getCampaign'](_0x9fa55a,_0x11b003),{'verbose':_0x1b2e28[_0x27d5be(0x1c5)]});await handleSDKOutput([_0x1c348a],_0x1b2e28);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']='engage:campaign:create';['description']=a16_0x159aef(0x1d9);async['execute'](_0x478f35){const _0x59dd98=a16_0x159aef,{options:_0x587153,tdx:_0x1b9f31}=_0x478f35,_0x48719e=_0x587153,_0xb2aa30=_0x48719e[_0x59dd98(0x22d)],_0x37a94d=_0x48719e[_0x59dd98(0x1d4)];if(!_0xb2aa30)return console[_0x59dd98(0x1c6)](_0x59dd98(0x1db)),console['error'](_0x59dd98(0x1f2)),0x1;if(!_0x37a94d)return console['error'](_0x59dd98(0x1b3)),console[_0x59dd98(0x1c6)](_0x59dd98(0x1f2)),0x1;const _0x23faa9=await resolveWorkspaceIdFromOptions(_0x48719e,_0x1b9f31,!![]),_0x1f4d5b=await resolveSegmentFromOptions(_0x48719e,_0x1b9f31),_0x4b11de=buildConnectorConfig(_0x48719e),_0x4a9aee={'name':_0xb2aa30,'campaignType':_0x37a94d,'workspaceId':_0x23faa9,'description':_0x48719e[_0x59dd98(0x1e5)],..._0x1f4d5b,'connectorConfig':_0x4b11de,'startAt':_0x48719e[_0x59dd98(0x1fc)],'timezone':_0x48719e[_0x59dd98(0x1bc)]},_0x2ae82d=await withSpinner(_0x59dd98(0x219)+_0xb2aa30+_0x59dd98(0x1f4),()=>_0x1b9f31[_0x59dd98(0x1ad)][_0x59dd98(0x20e)](_0x4a9aee));return await handleSDKOutput([_0x2ae82d[_0x59dd98(0x1f0)]],_0x587153),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a16_0x159aef(0x1ee);[a16_0x159aef(0x1e5)]='Update\x20a\x20campaign';async['execute'](_0x4b0018){const _0x4411d1=a16_0x159aef,{options:_0x4677b4,args:_0x1c52d1,tdx:_0x3e0b75}=_0x4b0018;if(_0x1c52d1[_0x4411d1(0x1e1)]===0x0)return console['error'](_0x4411d1(0x1bf)),console[_0x4411d1(0x1c6)](_0x4411d1(0x233)),0x1;const _0x48d57d=_0x1c52d1[0x0],_0x8e5099=_0x4677b4,_0x4fc043=await resolveWorkspaceIdFromOptions(_0x8e5099,_0x3e0b75),_0x418f78=await resolveSegmentFromOptions(_0x8e5099,_0x3e0b75),_0x2cd38d=buildConnectorConfig(_0x8e5099),_0x286dfd={'name':_0x8e5099[_0x4411d1(0x22d)],'description':_0x8e5099[_0x4411d1(0x1e5)],..._0x418f78,'connectorConfig':_0x2cd38d,'startAt':_0x8e5099[_0x4411d1(0x1fc)],'timezone':_0x8e5099[_0x4411d1(0x1bc)]},_0x330303=Object[_0x4411d1(0x21e)](Object[_0x4411d1(0x1b8)](_0x286dfd)['filter'](([,_0x263399])=>_0x263399!==undefined));if(Object[_0x4411d1(0x215)](_0x330303)['length']===0x0)return console[_0x4411d1(0x1c6)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x4411d1(0x1c6)](_0x4411d1(0x1ac)),0x1;const _0x4cd751=await withSpinner(_0x4411d1(0x211)+_0x48d57d+_0x4411d1(0x1f4),()=>_0x3e0b75[_0x4411d1(0x1ad)][_0x4411d1(0x1c0)](_0x48d57d,_0x330303,_0x4fc043),{'verbose':_0x4677b4[_0x4411d1(0x1c5)]});return await handleSDKOutput([_0x4cd751[_0x4411d1(0x1f0)]],_0x4677b4),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:campaign:delete';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x204);async[a16_0x159aef(0x1bd)](_0x575fdb){const _0x426de0=a16_0x159aef,{options:_0x5a5cb9,args:_0x103995,tdx:_0x2430c5}=_0x575fdb;if(_0x103995[_0x426de0(0x1e1)]===0x0)return console[_0x426de0(0x1c6)](_0x426de0(0x1bf)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x145450=_0x103995[0x0],_0x1ba05d=_0x5a5cb9,_0x4a4f96=await resolveWorkspaceIdFromOptions(_0x1ba05d,_0x2430c5);if(!_0x5a5cb9['yes']){const _0x2c0ebc=await confirm(_0x426de0(0x1c2)+_0x145450+_0x426de0(0x1e9));if(!_0x2c0ebc)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner(_0x426de0(0x1cb)+_0x145450+_0x426de0(0x1f4),()=>_0x2430c5['engage']['deleteCampaign'](_0x145450,_0x4a4f96),{'verbose':_0x5a5cb9[_0x426de0(0x1c5)]}),console[_0x426de0(0x1ca)](_0x426de0(0x223)+_0x145450+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']='engage:campaign:launch';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1af);async[a16_0x159aef(0x1bd)](_0x35c4ec){const _0x51cb9c=a16_0x159aef,{options:_0x46f769,args:_0x1dbbab,tdx:_0x3dcb44}=_0x35c4ec;if(_0x1dbbab['length']===0x0)return console[_0x51cb9c(0x1c6)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x51cb9c(0x1ce)),0x1;const _0x3f98c6=_0x1dbbab[0x0],_0x4ebcea=_0x46f769,_0x5217b8=await resolveWorkspaceIdFromOptions(_0x4ebcea,_0x3dcb44);return await withSpinner(_0x51cb9c(0x1c1)+_0x3f98c6+_0x51cb9c(0x1f4),()=>_0x3dcb44[_0x51cb9c(0x1ad)][_0x51cb9c(0x1f5)](_0x3f98c6,_0x5217b8),{'verbose':_0x46f769[_0x51cb9c(0x1c5)]}),console[_0x51cb9c(0x1ca)]('Campaign\x20\x27'+_0x3f98c6+_0x51cb9c(0x1e0)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x1e8);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x22e);async[a16_0x159aef(0x1bd)](_0x5aaaa5){const _0x20b8ad=a16_0x159aef,{options:_0xe6fe8a,args:_0x12decf,tdx:_0x564592}=_0x5aaaa5;if(_0x12decf[_0x20b8ad(0x1e1)]===0x0)return console[_0x20b8ad(0x1c6)](_0x20b8ad(0x1bf)),console[_0x20b8ad(0x1c6)](_0x20b8ad(0x1cf)),0x1;const _0x8fe282=_0x12decf[0x0],_0x170b56=_0xe6fe8a,_0x34e079=await resolveWorkspaceIdFromOptions(_0x170b56,_0x564592);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x8fe282+_0x20b8ad(0x1f4),()=>_0x564592[_0x20b8ad(0x1ad)]['pauseCampaign'](_0x8fe282,_0x34e079),{'verbose':_0xe6fe8a['verbose']}),console[_0x20b8ad(0x1ca)](_0x20b8ad(0x223)+_0x8fe282+_0x20b8ad(0x205)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x1d6);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x224);async['execute'](_0x28caeb){const _0x587bfb=a16_0x159aef,{options:_0x57c220,args:_0x4042ee,tdx:_0x1336d0}=_0x28caeb;if(_0x4042ee['length']===0x0)return console['error'](_0x587bfb(0x1bf)),console[_0x587bfb(0x1c6)](_0x587bfb(0x218)),0x1;const _0x1a970d=_0x4042ee[0x0],_0x17f768=_0x57c220,_0x43fdfc=await resolveWorkspaceIdFromOptions(_0x17f768,_0x1336d0);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x1a970d+_0x587bfb(0x1f4),()=>_0x1336d0[_0x587bfb(0x1ad)][_0x587bfb(0x1b7)](_0x1a970d,_0x43fdfc),{'verbose':_0x57c220[_0x587bfb(0x1c5)]}),console[_0x587bfb(0x1ca)](_0x587bfb(0x223)+_0x1a970d+_0x587bfb(0x236)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x1b4);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1f1);async[a16_0x159aef(0x1bd)](_0x136453){const _0x38fcb9=a16_0x159aef,{options:_0x527df9,args:_0x2aa3eb,tdx:_0x181e91}=_0x136453;if(_0x2aa3eb[_0x38fcb9(0x1e1)]===0x0)return console[_0x38fcb9(0x1c6)](_0x38fcb9(0x1bf)),console[_0x38fcb9(0x1c6)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x1ad03f=_0x2aa3eb[0x0],_0x1098b0=_0x527df9,_0x3b2a3c=await resolveWorkspaceIdFromOptions(_0x1098b0,_0x181e91),_0x3a7e60=await withSpinner(_0x38fcb9(0x20a)+_0x1ad03f+_0x38fcb9(0x1f4),()=>_0x181e91[_0x38fcb9(0x1ad)]['duplicateCampaign'](_0x1ad03f,_0x3b2a3c),{'verbose':_0x527df9['verbose']});return await handleSDKOutput([_0x3a7e60[_0x38fcb9(0x1f0)]],_0x527df9),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:templates';['description']='List\x20email\x20templates';async[a16_0x159aef(0x1bd)](_0x3b0155){const _0x5ce173=a16_0x159aef,{options:_0x47b6b6,args:_0x5263e7,tdx:_0x1e4a43}=_0x3b0155,_0x3984fe=_0x5263e7[0x0],_0x482aa2=resolveLimit(_0x47b6b6[_0x5ce173(0x1d1)],DEFAULT_LLM_LIMIT),_0x15c384=_0x47b6b6,_0xe1c62d=await resolveWorkspaceIdFromOptions(_0x15c384,_0x1e4a43),_0x2449e6=await withSpinner(_0x5ce173(0x1ed),()=>_0x1e4a43[_0x5ce173(0x1ad)][_0x5ce173(0x1d7)]({'workspaceId':_0xe1c62d,'limit':_0x482aa2}),{'verbose':_0x47b6b6['verbose']});let _0x190acc=_0x2449e6[_0x5ce173(0x1f0)];return _0x3984fe&&(_0x190acc=_0x2449e6['data'][_0x5ce173(0x226)](_0x568e9b=>matchGlobPattern(_0x568e9b[_0x5ce173(0x22d)],_0x3984fe))),await handleSDKOutput(_0x190acc,_0x47b6b6),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:template:show';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x221);async['execute'](_0x7ab16){const _0x2503c6=a16_0x159aef,{options:_0x4f09b3,args:_0x1bb185,tdx:_0xbb6063}=_0x7ab16;if(_0x1bb185[_0x2503c6(0x1e1)]===0x0)return console[_0x2503c6(0x1c6)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x2503c6(0x1c6)](_0x2503c6(0x232)),0x1;const _0x2f3395=_0x1bb185[0x0],_0x9ee8bc=_0x4f09b3,_0x383919=await resolveWorkspaceIdFromOptions(_0x9ee8bc,_0xbb6063),_0x29de90=_0x9ee8bc[_0x2503c6(0x21a)];if(_0x29de90){const _0x5b1618=await withSpinner(_0x2503c6(0x1e2)+_0x2f3395+_0x2503c6(0x1f4),()=>_0xbb6063[_0x2503c6(0x1ad)][_0x2503c6(0x1c7)](_0x2f3395,_0x383919),{'verbose':_0x4f09b3['verbose']});await handleSDKOutput([_0x5b1618],_0x4f09b3);}else{const _0x12a1e2=await withSpinner(_0x2503c6(0x1e2)+_0x2f3395+_0x2503c6(0x1f4),()=>_0xbb6063[_0x2503c6(0x1ad)][_0x2503c6(0x22b)](_0x2f3395,_0x383919),{'verbose':_0x4f09b3['verbose']});await handleSDKOutput([_0x12a1e2],_0x4f09b3);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x217);[a16_0x159aef(0x1e5)]='Create\x20an\x20email\x20template';async[a16_0x159aef(0x1bd)](_0x10273a){const _0x49c9e5=a16_0x159aef,{options:_0x5142df,tdx:_0x5e329b}=_0x10273a,_0xf9e8cf=_0x5142df,_0x4c3dac=_0xf9e8cf['name'],_0x5bd774=_0xf9e8cf[_0x49c9e5(0x1b6)],_0x52c5cf=_0xf9e8cf['html'];if(!_0x4c3dac)return console[_0x49c9e5(0x1c6)](_0x49c9e5(0x1db)),console[_0x49c9e5(0x1c6)](_0x49c9e5(0x1d5)),0x1;if(!_0x5bd774)return console[_0x49c9e5(0x1c6)](_0x49c9e5(0x1cd)),0x1;if(!_0x52c5cf)return console[_0x49c9e5(0x1c6)]('Error:\x20--html\x20is\x20required'),0x1;const _0x1eb392=await resolveWorkspaceIdFromOptions(_0xf9e8cf,_0x5e329b,!![]),_0x5cb3ee={'name':_0x4c3dac,'subjectTemplate':_0x5bd774,'htmlTemplate':_0x52c5cf,'workspaceId':_0x1eb392,'plaintextTemplate':_0xf9e8cf[_0x49c9e5(0x201)],'editorType':_0xf9e8cf[_0x49c9e5(0x1dc)]},_0x130cd0=await withSpinner(_0x49c9e5(0x231)+_0x4c3dac+'\x27...',()=>_0x5e329b[_0x49c9e5(0x1ad)][_0x49c9e5(0x229)](_0x5cb3ee));return await handleSDKOutput([_0x130cd0[_0x49c9e5(0x1f0)]],_0x5142df),0x0;}}function a16_0x5dbe(_0x3c2e0a,_0x34aea5){_0x3c2e0a=_0x3c2e0a-0x1ac;const _0x3edc5b=a16_0x3edc();let _0x5dbe7a=_0x3edc5b[_0x3c2e0a];return _0x5dbe7a;}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0x159aef(0x1eb);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x212);async[a16_0x159aef(0x1bd)](_0x467534){const _0x391d6b=a16_0x159aef,{options:_0x51b1cc,args:_0xea67da,tdx:_0x586eb2}=_0x467534;if(_0xea67da[_0x391d6b(0x1e1)]===0x0)return console[_0x391d6b(0x1c6)](_0x391d6b(0x1d8)),console[_0x391d6b(0x1c6)](_0x391d6b(0x222)),0x1;const _0x214dfc=_0xea67da[0x0],_0x4b64a1=_0x51b1cc,_0x56ea3e=await resolveWorkspaceIdFromOptions(_0x4b64a1,_0x586eb2),_0x2d60cc={'name':_0x4b64a1[_0x391d6b(0x22d)],'subjectTemplate':_0x4b64a1['subject'],'htmlTemplate':_0x4b64a1[_0x391d6b(0x22f)],'plaintextTemplate':_0x4b64a1[_0x391d6b(0x201)]},_0x5b8445=Object[_0x391d6b(0x21e)](Object['entries'](_0x2d60cc)[_0x391d6b(0x226)](([,_0x25c6b5])=>_0x25c6b5!==undefined));if(Object[_0x391d6b(0x215)](_0x5b8445)['length']===0x0)return console[_0x391d6b(0x1c6)](_0x391d6b(0x1b0)),console[_0x391d6b(0x1c6)](_0x391d6b(0x1dd)),0x1;const _0x552a56=await withSpinner('Updating\x20template\x20\x27'+_0x214dfc+_0x391d6b(0x1f4),()=>_0x586eb2[_0x391d6b(0x1ad)][_0x391d6b(0x22c)](_0x214dfc,_0x5b8445,_0x56ea3e),{'verbose':_0x51b1cc[_0x391d6b(0x1c5)]});return await handleSDKOutput([_0x552a56['data']],_0x51b1cc),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a16_0x159aef(0x1f9);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1fe);async[a16_0x159aef(0x1bd)](_0x23d641){const _0x4fe36f=a16_0x159aef,{options:_0x16a7c6,args:_0xfbecab,tdx:_0x250d46}=_0x23d641;if(_0xfbecab[_0x4fe36f(0x1e1)]===0x0)return console[_0x4fe36f(0x1c6)](_0x4fe36f(0x1d8)),console[_0x4fe36f(0x1c6)](_0x4fe36f(0x21f)),0x1;const _0x57a3fb=_0xfbecab[0x0],_0x29ad62=_0x16a7c6,_0xd46629=await resolveWorkspaceIdFromOptions(_0x29ad62,_0x250d46);if(!_0x16a7c6[_0x4fe36f(0x235)]){const _0xc9db97=await confirm(_0x4fe36f(0x1ff)+_0x57a3fb+_0x4fe36f(0x1e9));if(!_0xc9db97)return console['log'](_0x4fe36f(0x1e4)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x57a3fb+_0x4fe36f(0x1f4),()=>_0x250d46[_0x4fe36f(0x1ad)][_0x4fe36f(0x1ec)](_0x57a3fb,_0xd46629),{'verbose':_0x16a7c6[_0x4fe36f(0x1c5)]}),console[_0x4fe36f(0x1ca)](_0x4fe36f(0x1b2)+_0x57a3fb+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x227);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x20f);async[a16_0x159aef(0x1bd)](_0x4d00e4){const _0x31bd15=a16_0x159aef,{options:_0x3f56d1,args:_0x187510,tdx:_0x32b024}=_0x4d00e4,_0x58d8f7=_0x187510[0x0],_0xe17540=resolveLimit(_0x3f56d1[_0x31bd15(0x1d1)],DEFAULT_LLM_LIMIT),_0x27e8ec=await withSpinner('Fetching\x20workspaces...',()=>_0x32b024[_0x31bd15(0x1ad)][_0x31bd15(0x20c)]({'limit':_0xe17540}),{'verbose':_0x3f56d1['verbose']});let _0x181880=_0x27e8ec[_0x31bd15(0x1f0)];return _0x58d8f7&&(_0x181880=_0x27e8ec[_0x31bd15(0x1f0)][_0x31bd15(0x226)](_0x35299a=>matchGlobPattern(_0x35299a[_0x31bd15(0x22d)],_0x58d8f7))),await handleSDKOutput(_0x181880,_0x3f56d1),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x21b);[a16_0x159aef(0x1e5)]='Show\x20workspace\x20details';async['execute'](_0x54ff38){const _0x20597d=a16_0x159aef,{options:_0x160258,args:_0x29e951,tdx:_0x1ff4f9}=_0x54ff38;if(_0x29e951[_0x20597d(0x1e1)]===0x0)return console[_0x20597d(0x1c6)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x20597d(0x1c6)](_0x20597d(0x208)),0x1;const _0x37eaaa=_0x29e951[0x0],_0x42d5e6=_0x160258,_0xa69a8a=_0x42d5e6['full'];if(_0xa69a8a){const _0x4700e3=await withSpinner('Fetching\x20workspace\x20\x27'+_0x37eaaa+_0x20597d(0x1f4),()=>_0x1ff4f9[_0x20597d(0x1ad)][_0x20597d(0x1e7)](_0x37eaaa),{'verbose':_0x160258['verbose']});await handleSDKOutput([_0x4700e3],_0x160258);}else{const _0x23eaac=await withSpinner(_0x20597d(0x20b)+_0x37eaaa+_0x20597d(0x1f4),()=>_0x1ff4f9[_0x20597d(0x1ad)][_0x20597d(0x1c4)](_0x37eaaa),{'verbose':_0x160258['verbose']});await handleSDKOutput([_0x23eaac],_0x160258);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:workspace:create';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x203);async[a16_0x159aef(0x1bd)](_0x402d2b){const _0x23df08=a16_0x159aef,{options:_0x201ce8,tdx:_0x992f40}=_0x402d2b,_0x32d95d=_0x201ce8,_0x142f89=_0x32d95d['name'];if(!_0x142f89)return console[_0x23df08(0x1c6)](_0x23df08(0x1db)),console[_0x23df08(0x1c6)](_0x23df08(0x216)),0x1;const _0x50ff1b={'name':_0x142f89,'description':_0x32d95d[_0x23df08(0x1e5)]},_0x33810f=await withSpinner(_0x23df08(0x20d)+_0x142f89+'\x27...',()=>_0x992f40['engage'][_0x23df08(0x207)](_0x50ff1b));return await handleSDKOutput([_0x33810f[_0x23df08(0x1f0)]],_0x201ce8),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:workspace:update';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1bb);async['execute'](_0x5219f0){const _0x17e693=a16_0x159aef,{options:_0xd51ccb,args:_0x186624,tdx:_0x3b1d97}=_0x5219f0;if(_0x186624[_0x17e693(0x1e1)]===0x0)return console[_0x17e693(0x1c6)](_0x17e693(0x210)),console[_0x17e693(0x1c6)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x257ec8=_0x186624[0x0],_0x17d3d1=_0xd51ccb,_0x2fa1c8={'name':_0x17d3d1[_0x17e693(0x22d)],'description':_0x17d3d1['description']},_0xfe2185=Object[_0x17e693(0x21e)](Object[_0x17e693(0x1b8)](_0x2fa1c8)['filter'](([,_0xe764f3])=>_0xe764f3!==undefined));if(Object['keys'](_0xfe2185)['length']===0x0)return console[_0x17e693(0x1c6)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x17e693(0x1ef)),0x1;const _0x41075b=await withSpinner(_0x17e693(0x1c9)+_0x257ec8+_0x17e693(0x1f4),()=>_0x3b1d97['engage'][_0x17e693(0x22a)](_0x257ec8,_0xfe2185),{'verbose':_0xd51ccb[_0x17e693(0x1c5)]});return await handleSDKOutput([_0x41075b[_0x17e693(0x1f0)]],_0xd51ccb),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']=a16_0x159aef(0x1f6);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1de);async['execute'](_0x2c0a3c){const _0x32b40b=a16_0x159aef,{options:_0x11eae3,args:_0x56dfc2,tdx:_0x12b00b}=_0x2c0a3c;if(_0x56dfc2['length']===0x0)return console['error'](_0x32b40b(0x210)),console['error'](_0x32b40b(0x234)),0x1;const _0x563ef6=_0x56dfc2[0x0];if(!_0x11eae3[_0x32b40b(0x235)]){const _0x5eb3dc=await confirm(_0x32b40b(0x21c)+_0x563ef6+_0x32b40b(0x1e9));if(!_0x5eb3dc)return console['log'](_0x32b40b(0x1e4)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x563ef6+'\x27...',()=>_0x12b00b[_0x32b40b(0x1ad)][_0x32b40b(0x1ae)](_0x563ef6),{'verbose':_0x11eae3[_0x32b40b(0x1c5)]}),console[_0x32b40b(0x1ca)](_0x32b40b(0x1d3)+_0x563ef6+_0x32b40b(0x1fd)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x159aef(0x1da);['description']=a16_0x159aef(0x1f8);async[a16_0x159aef(0x1bd)](_0x32b06a){const _0x580c45=a16_0x159aef,{options:_0x1d79dc,args:_0x239633,tdx:_0x5e8335}=_0x32b06a;if(_0x239633[_0x580c45(0x1e1)]===0x0)return console[_0x580c45(0x1c6)]('Error:\x20Workspace\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x7d35a7=_0x239633[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x7d35a7+'\x27...',()=>_0x5e8335['engage'][_0x580c45(0x1f3)](_0x7d35a7));const _0x4ae6de=_0x1d79dc[_0x580c45(0x1ba)]||undefined;return saveSessionContext({'engage_workspace':_0x7d35a7},_0x4ae6de),console[_0x580c45(0x1ca)]('Engage\x20workspace\x20set\x20to:\x20'+_0x7d35a7),console['log'](_0x580c45(0x1e3)),0x0;}}
1
+ const a16_0x34af8f=a16_0x5cfc;(function(_0x4c1567,_0x2cf65f){const _0x72397a=a16_0x5cfc,_0x545348=_0x4c1567();while(!![]){try{const _0x58816e=parseInt(_0x72397a(0x202))/0x1*(parseInt(_0x72397a(0x23d))/0x2)+parseInt(_0x72397a(0x210))/0x3+parseInt(_0x72397a(0x204))/0x4+parseInt(_0x72397a(0x222))/0x5+parseInt(_0x72397a(0x237))/0x6+-parseInt(_0x72397a(0x219))/0x7+-parseInt(_0x72397a(0x1fe))/0x8;if(_0x58816e===_0x2cf65f)break;else _0x545348['push'](_0x545348['shift']());}catch(_0x727ec4){_0x545348['push'](_0x545348['shift']());}}}(a16_0x3cde,0xc1c46));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(_0x5b5a81,_0x88ce4e,_0x2f27d3=![]){const _0x53bf72=a16_0x5cfc;if(_0x5b5a81[_0x53bf72(0x240)])return await _0x88ce4e['engage']['resolveWorkspaceId'](_0x5b5a81[_0x53bf72(0x240)]);const _0x3d3c43=loadSessionContext(_0x5b5a81[_0x53bf72(0x21d)]);if(_0x3d3c43?.['engage_workspace'])return await _0x88ce4e['engage'][_0x53bf72(0x224)](_0x3d3c43[_0x53bf72(0x1e7)]);if(_0x2f27d3)throw new SDKError(ErrorCode[_0x53bf72(0x225)],_0x53bf72(0x235),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x2537ec,_0x5a6629){const _0x5ed4d4=a16_0x5cfc;if(!_0x2537ec[_0x5ed4d4(0x25c)])return{};const _0x909d45=_0x2537ec[_0x5ed4d4(0x25c)],_0x19f249=await _0x5a6629[_0x5ed4d4(0x25c)][_0x5ed4d4(0x1f4)](_0x909d45);return{'audienceId':_0x19f249[_0x5ed4d4(0x214)],'audienceName':_0x19f249[_0x5ed4d4(0x1ec)],..._0x19f249[_0x5ed4d4(0x200)]&&{'segmentId':_0x19f249['segmentId'],'segmentName':_0x19f249[_0x5ed4d4(0x1df)]}};}function buildConnectorConfig(_0x3e4a4c){const _0xc3edf8=a16_0x5cfc,_0x11afd9=_0x3e4a4c[_0xc3edf8(0x242)],_0x2750ac=_0x3e4a4c[_0xc3edf8(0x220)];if(!_0x11afd9&&!_0x2750ac)return undefined;return{..._0x11afd9&&{'emailSenderId':_0x11afd9},..._0x2750ac&&{'jsonColumns':_0x2750ac}};}function a16_0x5cfc(_0x4b7c0b,_0x4797a5){_0x4b7c0b=_0x4b7c0b-0x1d4;const _0x3cdef1=a16_0x3cde();let _0x5cfc37=_0x3cdef1[_0x4b7c0b];return _0x5cfc37;}export class EngageCampaignsCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x20c);[a16_0x34af8f(0x1fc)]=a16_0x34af8f(0x249);async['execute'](_0x1d80e7){const _0x2b2174=a16_0x34af8f,{options:_0x33a8f3,args:_0x1d15d4,tdx:_0x2109a2}=_0x1d80e7,_0x57c9b3=_0x1d15d4[0x0],_0x325e9a=resolveLimit(_0x33a8f3[_0x2b2174(0x1f6)],DEFAULT_LLM_LIMIT),_0x46a7cb=_0x33a8f3,_0x2921e6=_0x46a7cb[_0x2b2174(0x20b)],_0x40b47c=_0x46a7cb[_0x2b2174(0x23c)],_0x560b90=await resolveWorkspaceIdFromOptions(_0x46a7cb,_0x2109a2),_0x2ac6a7=await withSpinner(_0x2b2174(0x20d),()=>_0x2109a2['engage']['listCampaigns']({'type':_0x2921e6,'status':_0x40b47c,'workspaceId':_0x560b90,'limit':_0x325e9a}),{'verbose':_0x33a8f3['verbose']});let _0x1abb8d=_0x2ac6a7[_0x2b2174(0x24b)];return _0x57c9b3&&(_0x1abb8d=_0x2ac6a7[_0x2b2174(0x24b)][_0x2b2174(0x226)](_0x551482=>matchGlobPattern(_0x551482[_0x2b2174(0x1d4)],_0x57c9b3))),await handleSDKOutput(_0x1abb8d,_0x33a8f3),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x22a);[a16_0x34af8f(0x1fc)]='Show\x20campaign\x20details';async['execute'](_0x28ec62){const _0x1f0b85=a16_0x34af8f,{options:_0x5f3c30,args:_0x31f1c3,tdx:_0x3f2841}=_0x28ec62;if(_0x31f1c3[_0x1f0b85(0x221)]===0x0)return console[_0x1f0b85(0x234)](_0x1f0b85(0x1e8)),console[_0x1f0b85(0x234)](_0x1f0b85(0x1f8)),0x1;const _0xd31719=_0x31f1c3[0x0],_0xd0b32d=_0x5f3c30,_0x572d34=await resolveWorkspaceIdFromOptions(_0xd0b32d,_0x3f2841),_0x39d1fc=_0xd0b32d[_0x1f0b85(0x233)];if(_0x39d1fc){const _0x334870=await withSpinner('Fetching\x20campaign\x20\x27'+_0xd31719+_0x1f0b85(0x1da),()=>_0x3f2841[_0x1f0b85(0x211)][_0x1f0b85(0x239)](_0xd31719,_0x572d34),{'verbose':_0x5f3c30[_0x1f0b85(0x1dc)]});await handleSDKOutput([_0x334870],_0x5f3c30);}else{const _0x2329fb=await withSpinner(_0x1f0b85(0x22e)+_0xd31719+_0x1f0b85(0x1da),()=>_0x3f2841[_0x1f0b85(0x211)][_0x1f0b85(0x1e6)](_0xd31719,_0x572d34),{'verbose':_0x5f3c30['verbose']});await handleSDKOutput([_0x2329fb],_0x5f3c30);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x1fa);[a16_0x34af8f(0x1fc)]=a16_0x34af8f(0x258);async[a16_0x34af8f(0x1db)](_0x3ed2af){const _0x3b3272=a16_0x34af8f,{options:_0x476af6,tdx:_0x342fbc}=_0x3ed2af,_0xc7d56b=_0x476af6,_0x42e5cb=_0xc7d56b[_0x3b3272(0x1d4)],_0x23a9c9=_0xc7d56b[_0x3b3272(0x20b)];if(!_0x42e5cb)return console[_0x3b3272(0x234)](_0x3b3272(0x1d7)),console['error'](_0x3b3272(0x230)),0x1;if(!_0x23a9c9)return console[_0x3b3272(0x234)](_0x3b3272(0x1f9)),console[_0x3b3272(0x234)](_0x3b3272(0x230)),0x1;const _0x30137b=await resolveWorkspaceIdFromOptions(_0xc7d56b,_0x342fbc,!![]),_0x2d4b8f=await resolveSegmentFromOptions(_0xc7d56b,_0x342fbc),_0x1300d7=buildConnectorConfig(_0xc7d56b),_0x4001ab={'name':_0x42e5cb,'campaignType':_0x23a9c9,'workspaceId':_0x30137b,'description':_0xc7d56b['description'],..._0x2d4b8f,'connectorConfig':_0x1300d7,'startAt':_0xc7d56b[_0x3b3272(0x25f)],'timezone':_0xc7d56b['timezone']},_0x4d7edc=await withSpinner(_0x3b3272(0x23a)+_0x42e5cb+_0x3b3272(0x1da),()=>_0x342fbc['engage'][_0x3b3272(0x207)](_0x4001ab));return await handleSDKOutput([_0x4d7edc[_0x3b3272(0x24b)]],_0x476af6),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a16_0x34af8f(0x218);['description']=a16_0x34af8f(0x25a);async[a16_0x34af8f(0x1db)](_0x776468){const _0x3bd6a6=a16_0x34af8f,{options:_0x3762ab,args:_0x3455e4,tdx:_0x4144a8}=_0x776468;if(_0x3455e4[_0x3bd6a6(0x221)]===0x0)return console[_0x3bd6a6(0x234)](_0x3bd6a6(0x1e8)),console['error'](_0x3bd6a6(0x22d)),0x1;const _0x437301=_0x3455e4[0x0],_0x525954=_0x3762ab,_0x5e2976=await resolveWorkspaceIdFromOptions(_0x525954,_0x4144a8),_0x42af79=await resolveSegmentFromOptions(_0x525954,_0x4144a8),_0x39e849=buildConnectorConfig(_0x525954),_0x3ebb5c={'name':_0x525954[_0x3bd6a6(0x1d4)],'description':_0x525954[_0x3bd6a6(0x1fc)],..._0x42af79,'connectorConfig':_0x39e849,'startAt':_0x525954[_0x3bd6a6(0x25f)],'timezone':_0x525954[_0x3bd6a6(0x203)]},_0x59f700=Object[_0x3bd6a6(0x216)](Object[_0x3bd6a6(0x252)](_0x3ebb5c)['filter'](([,_0x5f2bd7])=>_0x5f2bd7!==undefined));if(Object[_0x3bd6a6(0x1f5)](_0x59f700)['length']===0x0)return console[_0x3bd6a6(0x234)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x3bd6a6(0x234)](_0x3bd6a6(0x1e4)),0x1;const _0x152f4a=await withSpinner(_0x3bd6a6(0x23e)+_0x437301+'\x27...',()=>_0x4144a8['engage'][_0x3bd6a6(0x247)](_0x437301,_0x59f700,_0x5e2976),{'verbose':_0x3762ab[_0x3bd6a6(0x1dc)]});return await handleSDKOutput([_0x152f4a['data']],_0x3762ab),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']='engage:campaign:delete';[a16_0x34af8f(0x1fc)]='Delete\x20a\x20campaign';async[a16_0x34af8f(0x1db)](_0x30a060){const _0x2a23da=a16_0x34af8f,{options:_0x273cef,args:_0x15e5b9,tdx:_0x311799}=_0x30a060;if(_0x15e5b9['length']===0x0)return console[_0x2a23da(0x234)](_0x2a23da(0x1e8)),console[_0x2a23da(0x234)](_0x2a23da(0x201)),0x1;const _0x404f02=_0x15e5b9[0x0],_0x4a69ab=_0x273cef,_0x1c9545=await resolveWorkspaceIdFromOptions(_0x4a69ab,_0x311799);if(!_0x273cef['yes']){const _0x239929=await confirm(_0x2a23da(0x1de)+_0x404f02+_0x2a23da(0x25d));if(!_0x239929)return console[_0x2a23da(0x24e)](_0x2a23da(0x20e)),0x0;}return await withSpinner(_0x2a23da(0x232)+_0x404f02+'\x27...',()=>_0x311799['engage'][_0x2a23da(0x21a)](_0x404f02,_0x1c9545),{'verbose':_0x273cef[_0x2a23da(0x1dc)]}),console[_0x2a23da(0x24e)](_0x2a23da(0x263)+_0x404f02+_0x2a23da(0x24c)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x1e3);['description']=a16_0x34af8f(0x253);async[a16_0x34af8f(0x1db)](_0x1d8f82){const _0x57f4be=a16_0x34af8f,{options:_0x5c23f3,args:_0x11e8f3,tdx:_0xc3924}=_0x1d8f82;if(_0x11e8f3[_0x57f4be(0x221)]===0x0)return console['error'](_0x57f4be(0x1e8)),console[_0x57f4be(0x234)]('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0x5af61e=_0x11e8f3[0x0],_0x58e700=_0x5c23f3,_0x46d07f=await resolveWorkspaceIdFromOptions(_0x58e700,_0xc3924);return await withSpinner('Launching\x20campaign\x20\x27'+_0x5af61e+_0x57f4be(0x1da),()=>_0xc3924[_0x57f4be(0x211)][_0x57f4be(0x20a)](_0x5af61e,_0x46d07f),{'verbose':_0x5c23f3[_0x57f4be(0x1dc)]}),console[_0x57f4be(0x24e)](_0x57f4be(0x263)+_0x5af61e+_0x57f4be(0x1fd)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x209);['description']=a16_0x34af8f(0x231);async[a16_0x34af8f(0x1db)](_0x3044a5){const _0x4cbd23=a16_0x34af8f,{options:_0x31752f,args:_0x335031,tdx:_0x3ed6f7}=_0x3044a5;if(_0x335031[_0x4cbd23(0x221)]===0x0)return console[_0x4cbd23(0x234)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x4cbd23(0x234)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x3faca8=_0x335031[0x0],_0x5d6e45=_0x31752f,_0x25ba8a=await resolveWorkspaceIdFromOptions(_0x5d6e45,_0x3ed6f7);return await withSpinner(_0x4cbd23(0x257)+_0x3faca8+'\x27...',()=>_0x3ed6f7[_0x4cbd23(0x211)][_0x4cbd23(0x262)](_0x3faca8,_0x25ba8a),{'verbose':_0x31752f[_0x4cbd23(0x1dc)]}),console[_0x4cbd23(0x24e)](_0x4cbd23(0x263)+_0x3faca8+_0x4cbd23(0x22f)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x244);[a16_0x34af8f(0x1fc)]=a16_0x34af8f(0x1d9);async[a16_0x34af8f(0x1db)](_0x430a19){const _0x2f7823=a16_0x34af8f,{options:_0x5c37c5,args:_0x476a52,tdx:_0x47b564}=_0x430a19;if(_0x476a52['length']===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x2f7823(0x234)](_0x2f7823(0x206)),0x1;const _0x355c0b=_0x476a52[0x0],_0x2dc379=_0x5c37c5,_0x2693f3=await resolveWorkspaceIdFromOptions(_0x2dc379,_0x47b564);return await withSpinner(_0x2f7823(0x1d5)+_0x355c0b+'\x27...',()=>_0x47b564['engage'][_0x2f7823(0x236)](_0x355c0b,_0x2693f3),{'verbose':_0x5c37c5[_0x2f7823(0x1dc)]}),console[_0x2f7823(0x24e)](_0x2f7823(0x263)+_0x355c0b+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]='engage:campaign:duplicate';['description']=a16_0x34af8f(0x260);async[a16_0x34af8f(0x1db)](_0xc46287){const _0x4f581a=a16_0x34af8f,{options:_0x55a884,args:_0x2fb762,tdx:_0x12c3b4}=_0xc46287;if(_0x2fb762['length']===0x0)return console[_0x4f581a(0x234)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x4f581a(0x234)](_0x4f581a(0x246)),0x1;const _0x50ec64=_0x2fb762[0x0],_0x102745=_0x55a884,_0xbe2bd8=await resolveWorkspaceIdFromOptions(_0x102745,_0x12c3b4),_0x4a50f9=await withSpinner(_0x4f581a(0x1f2)+_0x50ec64+_0x4f581a(0x1da),()=>_0x12c3b4['engage']['duplicateCampaign'](_0x50ec64,_0xbe2bd8),{'verbose':_0x55a884[_0x4f581a(0x1dc)]});return await handleSDKOutput([_0x4a50f9[_0x4f581a(0x24b)]],_0x55a884),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x1ee);['description']='List\x20email\x20templates';async[a16_0x34af8f(0x1db)](_0x128352){const _0x2dbc69=a16_0x34af8f,{options:_0x4b5847,args:_0x41880d,tdx:_0x4b2d07}=_0x128352,_0x4f3bdd=_0x41880d[0x0],_0x5ca922=resolveLimit(_0x4b5847[_0x2dbc69(0x1f6)],DEFAULT_LLM_LIMIT),_0x466f3f=_0x4b5847,_0x3bccb2=await resolveWorkspaceIdFromOptions(_0x466f3f,_0x4b2d07),_0xd2cb13=await withSpinner('Fetching\x20templates...',()=>_0x4b2d07[_0x2dbc69(0x211)][_0x2dbc69(0x243)]({'workspaceId':_0x3bccb2,'limit':_0x5ca922}),{'verbose':_0x4b5847[_0x2dbc69(0x1dc)]});let _0x1ac222=_0xd2cb13['data'];return _0x4f3bdd&&(_0x1ac222=_0xd2cb13[_0x2dbc69(0x24b)][_0x2dbc69(0x226)](_0x29c2cd=>matchGlobPattern(_0x29c2cd[_0x2dbc69(0x1d4)],_0x4f3bdd))),await handleSDKOutput(_0x1ac222,_0x4b5847),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x228);[a16_0x34af8f(0x1fc)]=a16_0x34af8f(0x21b);async[a16_0x34af8f(0x1db)](_0x4fc5a0){const _0x558486=a16_0x34af8f,{options:_0x23ceaf,args:_0x47a945,tdx:_0x32e825}=_0x4fc5a0;if(_0x47a945[_0x558486(0x221)]===0x0)return console[_0x558486(0x234)](_0x558486(0x251)),console[_0x558486(0x234)](_0x558486(0x24d)),0x1;const _0x3addc7=_0x47a945[0x0],_0x23ce26=_0x23ceaf,_0x240382=await resolveWorkspaceIdFromOptions(_0x23ce26,_0x32e825),_0x2a3ffa=_0x23ce26['full'];if(_0x2a3ffa){const _0x160dd6=await withSpinner(_0x558486(0x21c)+_0x3addc7+_0x558486(0x1da),()=>_0x32e825['engage']['getTemplateFull'](_0x3addc7,_0x240382),{'verbose':_0x23ceaf[_0x558486(0x1dc)]});await handleSDKOutput([_0x160dd6],_0x23ceaf);}else{const _0x1ae161=await withSpinner(_0x558486(0x21c)+_0x3addc7+'\x27...',()=>_0x32e825[_0x558486(0x211)][_0x558486(0x1f7)](_0x3addc7,_0x240382),{'verbose':_0x23ceaf[_0x558486(0x1dc)]});await handleSDKOutput([_0x1ae161],_0x23ceaf);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x1e0);[a16_0x34af8f(0x1fc)]=a16_0x34af8f(0x1ea);async[a16_0x34af8f(0x1db)](_0x55351e){const _0x5581a2=a16_0x34af8f,{options:_0x42f8cb,tdx:_0x3b90c4}=_0x55351e,_0x5574c9=_0x42f8cb,_0x3bd2e0=_0x5574c9[_0x5581a2(0x1d4)],_0x33f4df=_0x5574c9['subject'],_0x119899=_0x5574c9['html'];if(!_0x3bd2e0)return console[_0x5581a2(0x234)]('Error:\x20--name\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x33f4df)return console[_0x5581a2(0x234)](_0x5581a2(0x212)),0x1;if(!_0x119899)return console[_0x5581a2(0x234)](_0x5581a2(0x20f)),0x1;const _0x58c71b=await resolveWorkspaceIdFromOptions(_0x5574c9,_0x3b90c4,!![]),_0x5e66b9={'name':_0x3bd2e0,'subjectTemplate':_0x33f4df,'htmlTemplate':_0x119899,'workspaceId':_0x58c71b,'plaintextTemplate':_0x5574c9[_0x5581a2(0x255)],'editorType':_0x5574c9[_0x5581a2(0x23b)]},_0x21ff9a=await withSpinner(_0x5581a2(0x213)+_0x3bd2e0+'\x27...',()=>_0x3b90c4[_0x5581a2(0x211)]['createTemplate'](_0x5e66b9));return await handleSDKOutput([_0x21ff9a[_0x5581a2(0x24b)]],_0x42f8cb),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x23f);[a16_0x34af8f(0x1fc)]=a16_0x34af8f(0x1e1);async[a16_0x34af8f(0x1db)](_0xa30221){const _0x47ddbb=a16_0x34af8f,{options:_0x52142f,args:_0x2e5f89,tdx:_0x4efdc4}=_0xa30221;if(_0x2e5f89[_0x47ddbb(0x221)]===0x0)return console['error'](_0x47ddbb(0x251)),console[_0x47ddbb(0x234)](_0x47ddbb(0x245)),0x1;const _0x111bc7=_0x2e5f89[0x0],_0x1be787=_0x52142f,_0x537d0d=await resolveWorkspaceIdFromOptions(_0x1be787,_0x4efdc4),_0x2a5b42={'name':_0x1be787[_0x47ddbb(0x1d4)],'subjectTemplate':_0x1be787[_0x47ddbb(0x215)],'htmlTemplate':_0x1be787[_0x47ddbb(0x1f3)],'plaintextTemplate':_0x1be787[_0x47ddbb(0x255)]},_0x4b4b40=Object[_0x47ddbb(0x216)](Object[_0x47ddbb(0x252)](_0x2a5b42)['filter'](([,_0x190c46])=>_0x190c46!==undefined));if(Object[_0x47ddbb(0x1f5)](_0x4b4b40)[_0x47ddbb(0x221)]===0x0)return console['error'](_0x47ddbb(0x229)),console['error']('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x1e0946=await withSpinner('Updating\x20template\x20\x27'+_0x111bc7+_0x47ddbb(0x1da),()=>_0x4efdc4['engage'][_0x47ddbb(0x1e2)](_0x111bc7,_0x4b4b40,_0x537d0d),{'verbose':_0x52142f[_0x47ddbb(0x1dc)]});return await handleSDKOutput([_0x1e0946[_0x47ddbb(0x24b)]],_0x52142f),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x238);[a16_0x34af8f(0x1fc)]=a16_0x34af8f(0x217);async[a16_0x34af8f(0x1db)](_0x48aad7){const _0x58fb02=a16_0x34af8f,{options:_0x11c707,args:_0x1e9ade,tdx:_0x31ae22}=_0x48aad7;if(_0x1e9ade[_0x58fb02(0x221)]===0x0)return console[_0x58fb02(0x234)](_0x58fb02(0x251)),console[_0x58fb02(0x234)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x4af858=_0x1e9ade[0x0],_0x36bc88=_0x11c707,_0x4050f7=await resolveWorkspaceIdFromOptions(_0x36bc88,_0x31ae22);if(!_0x11c707['yes']){const _0x3ed809=await confirm(_0x58fb02(0x1f0)+_0x4af858+_0x58fb02(0x25d));if(!_0x3ed809)return console[_0x58fb02(0x24e)](_0x58fb02(0x20e)),0x0;}return await withSpinner(_0x58fb02(0x1ed)+_0x4af858+'\x27...',()=>_0x31ae22['engage']['deleteTemplate'](_0x4af858,_0x4050f7),{'verbose':_0x11c707[_0x58fb02(0x1dc)]}),console[_0x58fb02(0x24e)](_0x58fb02(0x1e5)+_0x4af858+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']=a16_0x34af8f(0x24a);[a16_0x34af8f(0x1fc)]='List\x20workspaces';async[a16_0x34af8f(0x1db)](_0x132f39){const _0x4691b8=a16_0x34af8f,{options:_0x656a70,args:_0x85253c,tdx:_0x5895c6}=_0x132f39,_0xe82ba4=_0x85253c[0x0],_0x340f13=resolveLimit(_0x656a70[_0x4691b8(0x1f6)],DEFAULT_LLM_LIMIT),_0xa3d7e7=await withSpinner(_0x4691b8(0x259),()=>_0x5895c6[_0x4691b8(0x211)][_0x4691b8(0x21e)]({'limit':_0x340f13}),{'verbose':_0x656a70[_0x4691b8(0x1dc)]});let _0x410afe=_0xa3d7e7[_0x4691b8(0x24b)];return _0xe82ba4&&(_0x410afe=_0xa3d7e7[_0x4691b8(0x24b)]['filter'](_0x262a96=>matchGlobPattern(_0x262a96['name'],_0xe82ba4))),await handleSDKOutput(_0x410afe,_0x656a70),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a16_0x34af8f(0x25e);[a16_0x34af8f(0x1fc)]='Show\x20workspace\x20details';async['execute'](_0x41db4c){const _0xffdda7=a16_0x34af8f,{options:_0x335b03,args:_0x5b3b1e,tdx:_0x43b6e9}=_0x41db4c;if(_0x5b3b1e['length']===0x0)return console['error'](_0xffdda7(0x1d8)),console[_0xffdda7(0x234)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x2af0f6=_0x5b3b1e[0x0],_0x10eb96=_0x335b03,_0x104d10=_0x10eb96['full'];if(_0x104d10){const _0x5b5581=await withSpinner(_0xffdda7(0x205)+_0x2af0f6+_0xffdda7(0x1da),()=>_0x43b6e9['engage'][_0xffdda7(0x223)](_0x2af0f6),{'verbose':_0x335b03[_0xffdda7(0x1dc)]});await handleSDKOutput([_0x5b5581],_0x335b03);}else{const _0x30c47e=await withSpinner(_0xffdda7(0x205)+_0x2af0f6+_0xffdda7(0x1da),()=>_0x43b6e9[_0xffdda7(0x211)][_0xffdda7(0x256)](_0x2af0f6),{'verbose':_0x335b03[_0xffdda7(0x1dc)]});await handleSDKOutput([_0x30c47e],_0x335b03);}return 0x0;}}function a16_0x3cde(){const _0x34bc94=['getWorkspace','Pausing\x20campaign\x20\x27','Create\x20a\x20new\x20campaign','Fetching\x20workspaces...','Update\x20a\x20campaign','engage:workspace:use','segment','\x27?\x20This\x20cannot\x20be\x20undone.','engage:workspace:show','startAt','Duplicate\x20a\x20campaign','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','pauseCampaign','Campaign\x20\x27','name','Resuming\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Error:\x20--name\x20is\x20required','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Resume\x20a\x20paused\x20campaign','\x27...','execute','verbose','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','segmentName','engage:template:create','Update\x20an\x20email\x20template','updateTemplate','engage:campaign:launch','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Template\x20\x27','getCampaign','engage_workspace','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:workspace:delete','Create\x20an\x20email\x20template','updateWorkspace','parentName','Deleting\x20template\x20\x27','engage:templates','createWorkspace','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Workspace\x20\x27','Duplicating\x20campaign\x20\x27','html','resolvePathToResource','keys','limit','getTemplate','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:campaign:create','Creating\x20workspace\x20\x27','description','\x27\x20launched\x20successfully','15476480SUkihS','Deleting\x20workspace\x20\x27','segmentId','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','486GbAsHY','timezone','1960268RGlNVC','Fetching\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','createCampaign','engage:workspace:update','engage:campaign:pause','launchCampaign','type','engage:campaigns','Fetching\x20campaigns...','Operation\x20cancelled','Error:\x20--html\x20is\x20required','2613261hLadVL','engage','Error:\x20--subject\x20is\x20required','Creating\x20template\x20\x27','parentId','subject','fromEntries','Delete\x20an\x20email\x20template','engage:campaign:update','2628514UDwMfI','deleteCampaign','Show\x20email\x20template\x20details','Fetching\x20template\x20\x27','session','listWorkspaces','Update\x20a\x20workspace','jsonColumns','length','6747365NFQhAC','getWorkspaceFull','resolveWorkspaceId','MISSING_ARGUMENT','filter','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:template:show','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','engage:campaign:show','engage:workspace:create','Delete\x20a\x20workspace','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Fetching\x20campaign\x20\x27','\x27\x20paused\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Pause\x20a\x20campaign','Deleting\x20campaign\x20\x27','full','error','Workspace\x20is\x20required\x20for\x20this\x20operation','resumeCampaign','1090170oDiyBK','engage:template:delete','getCampaignFull','Creating\x20campaign\x20\x27','editorType','status','870QBmyKk','Updating\x20campaign\x20\x27','engage:template:update','workspace','Create\x20a\x20workspace','emailSenderId','listTemplates','engage:campaign:resume','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','updateCampaign','yes','List\x20campaigns','engage:workspaces','data','\x27\x20deleted\x20successfully','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','log','Verifying\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','entries','Launch\x20a\x20campaign','Error:\x20Workspace\x20name\x20is\x20required','plaintext'];a16_0x3cde=function(){return _0x34bc94;};return a16_0x3cde();}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a16_0x34af8f(0x22b);[a16_0x34af8f(0x1fc)]=a16_0x34af8f(0x241);async['execute'](_0x15462f){const _0x275e87=a16_0x34af8f,{options:_0x17ff58,tdx:_0x39c5d0}=_0x15462f,_0x3157fb=_0x17ff58,_0x592ed0=_0x3157fb[_0x275e87(0x1d4)];if(!_0x592ed0)return console[_0x275e87(0x234)](_0x275e87(0x1d7)),console[_0x275e87(0x234)](_0x275e87(0x1dd)),0x1;const _0x39ff3a={'name':_0x592ed0,'description':_0x3157fb[_0x275e87(0x1fc)]},_0x135fa3=await withSpinner(_0x275e87(0x1fb)+_0x592ed0+_0x275e87(0x1da),()=>_0x39c5d0[_0x275e87(0x211)][_0x275e87(0x1ef)](_0x39ff3a));return await handleSDKOutput([_0x135fa3[_0x275e87(0x24b)]],_0x17ff58),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x208);[a16_0x34af8f(0x1fc)]=a16_0x34af8f(0x21f);async[a16_0x34af8f(0x1db)](_0x4a8e0d){const _0x30a58d=a16_0x34af8f,{options:_0x4f40f8,args:_0x436a06,tdx:_0x4b53dd}=_0x4a8e0d;if(_0x436a06['length']===0x0)return console['error'](_0x30a58d(0x1d8)),console[_0x30a58d(0x234)](_0x30a58d(0x227)),0x1;const _0x2406dd=_0x436a06[0x0],_0xd4f01=_0x4f40f8,_0x12d858={'name':_0xd4f01[_0x30a58d(0x1d4)],'description':_0xd4f01[_0x30a58d(0x1fc)]},_0x15c9a1=Object[_0x30a58d(0x216)](Object[_0x30a58d(0x252)](_0x12d858)[_0x30a58d(0x226)](([,_0x3c1611])=>_0x3c1611!==undefined));if(Object[_0x30a58d(0x1f5)](_0x15c9a1)['length']===0x0)return console[_0x30a58d(0x234)](_0x30a58d(0x229)),console[_0x30a58d(0x234)]('Options:\x20--name,\x20--description'),0x1;const _0x235972=await withSpinner('Updating\x20workspace\x20\x27'+_0x2406dd+_0x30a58d(0x1da),()=>_0x4b53dd[_0x30a58d(0x211)][_0x30a58d(0x1eb)](_0x2406dd,_0x15c9a1),{'verbose':_0x4f40f8[_0x30a58d(0x1dc)]});return await handleSDKOutput([_0x235972[_0x30a58d(0x24b)]],_0x4f40f8),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x1e9);['description']=a16_0x34af8f(0x22c);async[a16_0x34af8f(0x1db)](_0x462d0){const _0xf054f9=a16_0x34af8f,{options:_0x347002,args:_0x239804,tdx:_0x32c82d}=_0x462d0;if(_0x239804[_0xf054f9(0x221)]===0x0)return console[_0xf054f9(0x234)](_0xf054f9(0x1d8)),console[_0xf054f9(0x234)](_0xf054f9(0x1d6)),0x1;const _0x497793=_0x239804[0x0];if(!_0x347002[_0xf054f9(0x248)]){const _0x3d506b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x497793+_0xf054f9(0x25d));if(!_0x3d506b)return console[_0xf054f9(0x24e)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0xf054f9(0x1ff)+_0x497793+_0xf054f9(0x1da),()=>_0x32c82d[_0xf054f9(0x211)]['deleteWorkspace'](_0x497793),{'verbose':_0x347002[_0xf054f9(0x1dc)]}),console[_0xf054f9(0x24e)](_0xf054f9(0x1f1)+_0x497793+_0xf054f9(0x24c)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0x34af8f(0x1d4)]=a16_0x34af8f(0x25b);[a16_0x34af8f(0x1fc)]='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async[a16_0x34af8f(0x1db)](_0x4fe2a1){const _0x46e549=a16_0x34af8f,{options:_0x226dba,args:_0x508097,tdx:_0x474183}=_0x4fe2a1;if(_0x508097[_0x46e549(0x221)]===0x0)return console[_0x46e549(0x234)](_0x46e549(0x254)),console['error'](_0x46e549(0x250)),0x1;const _0x18d2e0=_0x508097[0x0];await withSpinner(_0x46e549(0x24f)+_0x18d2e0+_0x46e549(0x1da),()=>_0x474183['engage']['resolveWorkspaceId'](_0x18d2e0));const _0x1379a2=_0x226dba[_0x46e549(0x21d)]||undefined;return saveSessionContext({'engage_workspace':_0x18d2e0},_0x1379a2),console[_0x46e549(0x24e)]('Engage\x20workspace\x20set\x20to:\x20'+_0x18d2e0),console[_0x46e549(0x24e)](_0x46e549(0x261)),0x0;}}