@treasuredata/tdx 0.26.4 → 0.26.5

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 (169) 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.js +1 -1
  27. package/dist/commands/profile-command.js +1 -1
  28. package/dist/commands/profiles-command.js +1 -1
  29. package/dist/commands/query-command.js +1 -1
  30. package/dist/commands/schedule-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/status-command.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/unset-command.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/command-output.js +1 -1
  49. package/dist/core/config.js +1 -1
  50. package/dist/core/connection-cache.js +1 -1
  51. package/dist/core/constants.js +1 -1
  52. package/dist/core/credential-cache.js +1 -1
  53. package/dist/core/global-context.js +1 -1
  54. package/dist/core/keychain.js +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/project-config.js +1 -1
  57. package/dist/core/session.js +1 -1
  58. package/dist/core/user-cache.js +1 -1
  59. package/dist/core/version.js +1 -1
  60. package/dist/index.js +1 -1
  61. package/dist/mcp/server.js +1 -1
  62. package/dist/mcp/tools/index.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js +1 -1
  64. package/dist/mcp/tools/tdx-search.js +1 -1
  65. package/dist/mcp/utils.js +1 -1
  66. package/dist/proxy/claude-usage-tracker.js +1 -1
  67. package/dist/proxy/passthrough-server.js +1 -1
  68. package/dist/proxy/sse-usage-parser.js +1 -1
  69. package/dist/sdk/agent/agent-config.js +1 -1
  70. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  71. package/dist/sdk/agent/agent-yaml.js +1 -1
  72. package/dist/sdk/agent/test/evaluator.js +1 -1
  73. package/dist/sdk/agent/test/executor.js +1 -1
  74. package/dist/sdk/agent/test/index.js +1 -1
  75. package/dist/sdk/agent/test/output.js +1 -1
  76. package/dist/sdk/agent/test/parser.js +1 -1
  77. package/dist/sdk/api.js +1 -1
  78. package/dist/sdk/client/cdp-api-client.js +1 -1
  79. package/dist/sdk/client/endpoints.js +1 -1
  80. package/dist/sdk/client/engage-api-client.js +1 -1
  81. package/dist/sdk/client/http-client.js +1 -1
  82. package/dist/sdk/client/llm-api-client.js +1 -1
  83. package/dist/sdk/client/rate-limiter.js +1 -1
  84. package/dist/sdk/client/td-api-client.js +1 -1
  85. package/dist/sdk/client/trino-api-client.js +1 -1
  86. package/dist/sdk/client/workflow-client.js +1 -1
  87. package/dist/sdk/connection-validator.js +1 -1
  88. package/dist/sdk/connection.js +1 -1
  89. package/dist/sdk/engage.js +1 -1
  90. package/dist/sdk/errors.js +1 -1
  91. package/dist/sdk/index.js +1 -1
  92. package/dist/sdk/io/index.js +1 -1
  93. package/dist/sdk/io/node-filesystem.js +1 -1
  94. package/dist/sdk/job.js +1 -1
  95. package/dist/sdk/journey.js +1 -1
  96. package/dist/sdk/llm/chat-cache.js +1 -1
  97. package/dist/sdk/llm/index.js +1 -1
  98. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  99. package/dist/sdk/llm/model-factors.js +1 -1
  100. package/dist/sdk/personalization.js +1 -1
  101. package/dist/sdk/query/index.js +1 -1
  102. package/dist/sdk/query/sql-parser.js +1 -1
  103. package/dist/sdk/realtime.js +1 -1
  104. package/dist/sdk/schedule.js +1 -1
  105. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  106. package/dist/sdk/segment/fields-display.js +1 -1
  107. package/dist/sdk/segment/file-discovery.js +1 -1
  108. package/dist/sdk/segment/journey-utils.js +1 -1
  109. package/dist/sdk/segment/journey-validator.js +1 -1
  110. package/dist/sdk/segment/journey-yaml.js +1 -1
  111. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  112. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  113. package/dist/sdk/segment/pull-workflow.js +1 -1
  114. package/dist/sdk/segment/push-recovery.js +1 -1
  115. package/dist/sdk/segment/push-workflow.js +1 -1
  116. package/dist/sdk/segment/resolution-context.js +1 -1
  117. package/dist/sdk/segment/segment-path-parser.js +1 -1
  118. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  119. package/dist/sdk/segment/target-resolution.js +1 -1
  120. package/dist/sdk/segment/tdx-config.js +1 -1
  121. package/dist/sdk/segment/validate-files.js +1 -1
  122. package/dist/sdk/segment/yaml-validator.js +1 -1
  123. package/dist/sdk/segment.js +1 -1
  124. package/dist/sdk/types/index.js +1 -1
  125. package/dist/sdk/types/progress.js +1 -1
  126. package/dist/sdk/user.js +1 -1
  127. package/dist/sdk/util/format-detector.js +1 -1
  128. package/dist/sdk/util/formatters.js +1 -1
  129. package/dist/sdk/util/index.js +1 -1
  130. package/dist/sdk/util/tree-formatter.js +1 -1
  131. package/dist/sdk/workflow/archive-validation.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- function a9_0x1034(){const _0x1ced56=['Failed\x20to\x20remove\x20marketplace\x20\x27','env','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','cwd','td-skills\x20Plugins','http://127.0.0.1:','fail','remove','llm-proxy','includes','ENOENT','Warning:\x20Failed\x20to\x20configure\x20','CLAUDE_CODE_USE_VERTEX','✓\x20Claude\x20Code\x20version\x20OK','.claude','command','ANTHROPIC_AUTH_TOKEN','account_id','✓\x20Plugin\x20\x27','\x20→\x20','info','originalSettings','td-skills','✓\x20Marketplace\x20\x27','Command\x20failed\x20(exit\x20','debug','unshift','1177488DDgIDP','exit','INTERNAL','tdx-managed-proxy','--version','major','stop','type','site','https://github.com/treasure-data/td-skills','Initializing...','CLAUDE_CODE_USE_BEDROCK','28rarhno','\x20already\x20configured','add','\x27\x20installed','3646899gGelab','tdx\x20--profile\x20','Initializing\x20proxy\x20logger...','228504VFotxJ','ANTHROPIC_BASE_URL','join','\x27\x20updated','inherit','string','Installing\x20plugin\x20\x27','marketplace','Checking\x20Claude\x20Code\x20version...','cause','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','http','init','\x20or\x20later.','2.0.20','CLAUDE_CODE_UNSUPPORTED_VERSION','already\x20configured','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','Failed\x20to\x20list\x20marketplaces','tdx-skills','10wyhgVB','pipe','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','Setup\x20failed','tdx\x20claude\x20statusline','green','--transport','Configuring\x20MCP\x20server\x20\x27','mcp','\x20claude\x20statusline','parse','127.0.0.1','534261fkBdPI','toString','):\x20claude\x20','Failed\x20to\x20install\x20plugin\x20\x27','verbose','port','tdx','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','1797056yDcWQv','Finding\x20available\x20port...','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','Claude\x20Code\x20CLI\x20not\x20found','list','red','INSTALLATION_FAILED','3gMoMGs','start','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Updating\x20marketplace\x20\x27','passThroughServer','Failed\x20to\x20configure\x20marketplace\x20\x27','stderr','Creating\x20.claude/settings.local.json...','profile','2328975NeuasS','\x27\x20configured','Executing:\x20claude\x20','https://docs.treasuredata.com/mcp','false','stringify','error','2VmHJFm','✓\x20Settings\x20restored:\x20.claude/settings.local.json','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','Invalid\x20minimum\x20version\x20format:\x20','\x27\x20removed','workflow-skills','✓\x20Logging\x20to\x20','Failed\x20to\x20spawn\x20claude\x20command:\x20','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','plugin','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','Failed\x20to\x20launch\x20Claude\x20Code:\x20','174527FhPRON','text','utf-8','warn','ANTHROPIC_MODEL','patch','minor','settings.local.json','✓\x20Logs\x20saved\x20to\x20','logger','\x20configuration\x20failed','Failed\x20to\x20update\x20marketplace\x20\x27','\x27:\x20','log','name','10QtaVXH','CLAUDE_CODE_NOT_FOUND','sql-skills','user','apiKey','close','Claude\x20Code\x20version\x20','localhost','hostname','install','already\x20installed','claude','already\x20exists','statusline','td-docs','continue','proxy','message','data','getLogPath','✓\x20MCP\x20server\x20\x27','288vmhrxl','trim','statusLine','Marketplace\x20\x27','\x27...','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy'];a9_0x1034=function(){return _0x1ced56;};return a9_0x1034();}const a9_0x2a44ea=a9_0x388c;(function(_0x3526de,_0x56455){const _0x52e214=a9_0x388c,_0x2e55a1=_0x3526de();while(!![]){try{const _0x33ae2d=parseInt(_0x52e214(0x1fc))/0x1*(-parseInt(_0x52e214(0x1f0))/0x2)+parseInt(_0x52e214(0x1e0))/0x3*(parseInt(_0x52e214(0x1d9))/0x4)+-parseInt(_0x52e214(0x1c5))/0x5*(parseInt(_0x52e214(0x19e))/0x6)+-parseInt(_0x52e214(0x1aa))/0x7*(-parseInt(_0x52e214(0x1b1))/0x8)+-parseInt(_0x52e214(0x1ae))/0x9*(parseInt(_0x52e214(0x168))/0xa)+-parseInt(_0x52e214(0x1e9))/0xb+parseInt(_0x52e214(0x17d))/0xc*(parseInt(_0x52e214(0x1d1))/0xd);if(_0x33ae2d===_0x56455)break;else _0x2e55a1['push'](_0x2e55a1['shift']());}catch(_0x391011){_0x2e55a1['push'](_0x2e55a1['shift']());}}}(a9_0x1034,0x5953d));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x9b06b6 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';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_0x2a44ea(0x1bf);function handleInstallationError(_0x21a5af,_0xb2bb0d,_0x5a1da3,_0x20aadf){const _0x18c57d=a9_0x2a44ea;errorContains(_0x21a5af,_0x18c57d(0x174),_0x18c57d(0x172),_0x18c57d(0x1c1))?(_0x5a1da3[_0x18c57d(0x1fd)]='✓\x20'+_0xb2bb0d+_0x18c57d(0x1ab),_0x20aadf?.[_0x18c57d(0x197)](_0xb2bb0d+_0x18c57d(0x1ab)),_0x21a5af instanceof SDKError&&_0x21a5af[_0x18c57d(0x1ba)]&&_0x20aadf?.[_0x18c57d(0x19c)]('Command\x20output:\x20'+_0x21a5af[_0x18c57d(0x1ba)][_0x18c57d(0x179)])):(_0x5a1da3[_0x18c57d(0x1ff)](_0x18c57d(0x18e)+_0xb2bb0d),_0x20aadf?.[_0x18c57d(0x1ef)](_0xb2bb0d+_0x18c57d(0x163),_0x21a5af));}export function parseVersion(_0x1da441){const _0x408e13=a9_0x2a44ea,_0x10074a=_0x1da441[_0x408e13(0x17e)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x10074a)return null;return{'major':parseInt(_0x10074a[0x1],0xa),'minor':parseInt(_0x10074a[0x2],0xa),'patch':parseInt(_0x10074a[0x3],0xa)};}export function compareVersions(_0x25a13e,_0x5e811e){const _0x402a9c=a9_0x2a44ea;if(_0x25a13e[_0x402a9c(0x1a3)]!==_0x5e811e['major'])return _0x25a13e[_0x402a9c(0x1a3)]-_0x5e811e[_0x402a9c(0x1a3)];if(_0x25a13e[_0x402a9c(0x15f)]!==_0x5e811e[_0x402a9c(0x15f)])return _0x25a13e['minor']-_0x5e811e[_0x402a9c(0x15f)];return _0x25a13e['patch']-_0x5e811e[_0x402a9c(0x201)];}async function checkClaudeVersion(_0x51fad4,_0x14a1a4){const _0x3b492f=a9_0x2a44ea;_0x14a1a4?.[_0x3b492f(0x19c)]('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x51fad4+')');const _0x3880c3=await executeClaudeCommand([_0x3b492f(0x1a2)],undefined,_0x14a1a4),_0x24b668=parseVersion(_0x3880c3);if(!_0x24b668){_0x14a1a4?.[_0x3b492f(0x1ff)](_0x3b492f(0x1fa)+_0x3880c3);return;}const _0x2e57d0=_0x24b668['major']+'.'+_0x24b668[_0x3b492f(0x15f)]+'.'+_0x24b668[_0x3b492f(0x201)],_0x1b792d=parseVersion(_0x51fad4);if(!_0x1b792d){_0x14a1a4?.[_0x3b492f(0x1ff)](_0x3b492f(0x1f3)+_0x51fad4);return;}if(compareVersions(_0x24b668,_0x1b792d)<0x0){_0x14a1a4?.[_0x3b492f(0x1ef)](_0x3b492f(0x16e)+_0x2e57d0+'\x20is\x20too\x20old\x20(minimum:\x20'+_0x51fad4+')');throw new SDKError(ErrorCode[_0x3b492f(0x1c0)],_0x3b492f(0x16e)+_0x2e57d0+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x51fad4+_0x3b492f(0x1be),undefined,{'helpText':_0x3b492f(0x185)});}_0x14a1a4?.[_0x3b492f(0x19c)](_0x3b492f(0x16e)+_0x2e57d0+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x52dc4a,_0x262fa8,_0x170c03){const _0x55f79d=a9_0x2a44ea;return _0x170c03?.[_0x55f79d(0x197)](_0x55f79d(0x1eb)+_0x52dc4a[_0x55f79d(0x1b3)]('\x20')),new Promise((_0x2d13ab,_0x3c4b8e)=>{const _0x4df6d7=_0x55f79d,_0x24a916=crossSpawn('claude',_0x52dc4a,{'stdio':_0x4df6d7(0x1c6)});let _0x5b01c8='',_0x26b97d='';_0x24a916['stdout']?.['on'](_0x4df6d7(0x17a),_0x165f14=>{const _0x439610=_0x4df6d7;_0x5b01c8+=_0x165f14[_0x439610(0x1d2)]();}),_0x24a916[_0x4df6d7(0x1e6)]?.['on'](_0x4df6d7(0x17a),_0x22c62e=>{const _0x3a8411=_0x4df6d7;_0x26b97d+=_0x22c62e[_0x3a8411(0x1d2)]();}),_0x24a916['on']('error',_0x32ebd0=>{const _0x3f4d7e=_0x4df6d7;_0x32ebd0['code']===_0x3f4d7e(0x18d)?(_0x170c03?.[_0x3f4d7e(0x1ef)](_0x3f4d7e(0x1dc)),_0x3c4b8e(new SDKError(ErrorCode[_0x3f4d7e(0x169)],_0x3f4d7e(0x1dc),_0x32ebd0,{'helpText':_0x3f4d7e(0x1e2)}))):(_0x170c03?.[_0x3f4d7e(0x1ef)]('Command\x20spawn\x20error:\x20'+_0x32ebd0[_0x3f4d7e(0x179)]),_0x3c4b8e(new SDKError(ErrorCode[_0x3f4d7e(0x1a0)],_0x3f4d7e(0x1f7)+_0x32ebd0['message'],_0x32ebd0)));}),_0x24a916['on'](_0x4df6d7(0x19f),_0x36142d=>{const _0x5f3969=_0x4df6d7;if(_0x36142d===0x0)_0x2d13ab(_0x5b01c8);else _0x262fa8?(_0x170c03?.[_0x5f3969(0x1ef)](_0x5f3969(0x19b)+_0x36142d+_0x5f3969(0x1d3)+_0x52dc4a[_0x5f3969(0x1b3)]('\x20')),_0x3c4b8e(new SDKError(ErrorCode[_0x5f3969(0x1df)],_0x262fa8,new Error(_0x26b97d)))):_0x2d13ab('');});});}async function ensureMcpServer(_0x40b2b4,_0x5ec23e,_0x3b6100,_0x382275,_0x2c3cad){const _0x49a5b8=a9_0x2a44ea;_0x382275['text']=_0x49a5b8(0x1cc)+_0x40b2b4+_0x49a5b8(0x181),await executeClaudeCommand([_0x49a5b8(0x1cd),_0x49a5b8(0x1ac),_0x40b2b4,_0x5ec23e,_0x49a5b8(0x1cb),_0x3b6100],_0x49a5b8(0x1f2)+_0x40b2b4+'\x27',_0x2c3cad),_0x382275['text']=_0x49a5b8(0x17c)+_0x40b2b4+_0x49a5b8(0x1ea);}export const DEFAULT_TD_SKILLS_URL=a9_0x2a44ea(0x1a7);export function getTdSkillsRepoUrl(){const _0x2f5751=process.env.TDX_TD_SKILLS_REPO;if(_0x2f5751)return _0x2f5751;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x46fdc9,_0x583f74){const _0x1b6fd7=a9_0x2a44ea;try{const _0x44cfb2=await executeClaudeCommand([_0x1b6fd7(0x1f9),_0x1b6fd7(0x1b8),_0x1b6fd7(0x1dd)],_0x1b6fd7(0x1c3),_0x583f74);if(!_0x44cfb2[_0x1b6fd7(0x18c)](_0x46fdc9)){_0x583f74?.[_0x1b6fd7(0x19c)](_0x1b6fd7(0x180)+_0x46fdc9+_0x1b6fd7(0x1db));return;}await executeClaudeCommand([_0x1b6fd7(0x1f9),_0x1b6fd7(0x1b8),_0x1b6fd7(0x18a),_0x46fdc9],'Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x46fdc9+'\x27',_0x583f74),_0x583f74?.[_0x1b6fd7(0x197)](_0x1b6fd7(0x180)+_0x46fdc9+_0x1b6fd7(0x1f4));}catch(_0x54cde9){_0x583f74?.[_0x1b6fd7(0x1ff)](_0x1b6fd7(0x183)+_0x46fdc9+_0x1b6fd7(0x165)+_0x54cde9);}}async function restoreDefaultTdSkillsMarketplace(_0x131cd6){const _0x56285e=a9_0x2a44ea;try{await removeMarketplace('td-skills',_0x131cd6),await executeClaudeCommand(['plugin','marketplace',_0x56285e(0x1ac),DEFAULT_TD_SKILLS_URL],undefined,_0x131cd6),_0x131cd6?.['info']('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0x16cbb3,_0x23f888,_0x55c6f4,_0x548bab){const _0x33064b=a9_0x2a44ea;_0x55c6f4['text']='Configuring\x20marketplace\x20\x27'+_0x16cbb3+_0x33064b(0x181),await executeClaudeCommand([_0x33064b(0x1f9),_0x33064b(0x1b8),_0x33064b(0x1ac),_0x23f888],_0x33064b(0x1e5)+_0x16cbb3+'\x27',_0x548bab),_0x55c6f4[_0x33064b(0x1fd)]=_0x33064b(0x19a)+_0x16cbb3+_0x33064b(0x1ea);}async function updateMarketplace(_0x46bdc5,_0x4b34c9,_0xfa597f){const _0x1f5490=a9_0x2a44ea;_0x4b34c9[_0x1f5490(0x1fd)]=_0x1f5490(0x1e3)+_0x46bdc5+'\x27...',await executeClaudeCommand(['plugin','marketplace','update'],_0x1f5490(0x164)+_0x46bdc5+'\x27',_0xfa597f),_0x4b34c9[_0x1f5490(0x1fd)]='✓\x20Marketplace\x20\x27'+_0x46bdc5+_0x1f5490(0x1b4);}async function ensurePlugin(_0x371b29,_0x4f4ed7,_0x4138c6,_0x21f164){const _0x5c8b5d=a9_0x2a44ea;_0x4138c6['text']=_0x5c8b5d(0x1b7)+_0x371b29+_0x5c8b5d(0x181),await executeClaudeCommand([_0x5c8b5d(0x1f9),_0x5c8b5d(0x171),_0x371b29+'@'+_0x4f4ed7],_0x5c8b5d(0x1d4)+_0x371b29+'\x27',_0x21f164),_0x4138c6[_0x5c8b5d(0x1fd)]=_0x5c8b5d(0x195)+_0x371b29+_0x5c8b5d(0x1ad);}async function createClaudeSettings(_0x38d875,_0x5a61bf,_0x5c5f3c){const _0x421ebe=a9_0x2a44ea,_0x444e68=join(process[_0x421ebe(0x186)](),_0x421ebe(0x191)),_0x227900=join(_0x444e68,'settings.local.json');await mkdir(_0x444e68,{'recursive':!![]});let _0xa3a0f6={};if(existsSync(_0x227900))try{const _0x4ee493=await readFile(_0x227900,_0x421ebe(0x1fe));_0xa3a0f6=JSON[_0x421ebe(0x1cf)](_0x4ee493);}catch{_0xa3a0f6={};}const _0x216749=_0xa3a0f6[_0x421ebe(0x184)]||{},_0x102b37={'ANTHROPIC_BASE_URL':_0x216749[_0x421ebe(0x1b2)],'ANTHROPIC_MODEL':_0x216749[_0x421ebe(0x200)],'ANTHROPIC_AUTH_TOKEN':_0x216749[_0x421ebe(0x193)],'CLAUDE_CODE_USE_BEDROCK':_0x216749[_0x421ebe(0x1a9)],'CLAUDE_CODE_USE_VERTEX':_0x216749[_0x421ebe(0x18f)],'statusLine':_0xa3a0f6[_0x421ebe(0x17f)]},_0x3fa1c5={..._0xa3a0f6,'env':{..._0x216749,'ANTHROPIC_BASE_URL':_0x421ebe(0x188)+_0x38d875,..._0x5a61bf&&{'ANTHROPIC_MODEL':_0x5a61bf},'ANTHROPIC_AUTH_TOKEN':_0x421ebe(0x1a1),'CLAUDE_CODE_USE_BEDROCK':_0x421ebe(0x1ed),'CLAUDE_CODE_USE_VERTEX':_0x421ebe(0x1ed)},'statusLine':{'type':_0x421ebe(0x192),'command':_0x5c5f3c?_0x421ebe(0x1af)+_0x5c5f3c+_0x421ebe(0x1ce):_0x421ebe(0x1c9)}};return await writeFile(_0x227900,JSON[_0x421ebe(0x1ee)](_0x3fa1c5,null,0x2)+'\x0a'),_0x102b37;}async function restoreClaudeSettings(_0x45a04b){const _0x4120ab=a9_0x2a44ea,_0x5a1bad=join(process[_0x4120ab(0x186)](),_0x4120ab(0x191)),_0x484381=join(_0x5a1bad,_0x4120ab(0x160));if(!existsSync(_0x484381))return;try{const _0xccc951=await readFile(_0x484381,_0x4120ab(0x1fe)),_0x2cb6c9=JSON[_0x4120ab(0x1cf)](_0xccc951),_0x4a0e1a=_0x2cb6c9['env']||{},_0x14fc49=_0x4a0e1a['ANTHROPIC_BASE_URL'],_0x3a346b=((()=>{const _0x4cf97b=_0x4120ab;if(typeof _0x14fc49!==_0x4cf97b(0x1b6))return![];try{const _0x237423=new URL(_0x14fc49);return _0x237423[_0x4cf97b(0x170)]===_0x4cf97b(0x16f)||_0x237423['hostname']===_0x4cf97b(0x1d0);}catch{return![];}})());_0x3a346b?(delete _0x4a0e1a['ANTHROPIC_BASE_URL'],delete _0x4a0e1a[_0x4120ab(0x200)],delete _0x4a0e1a['ANTHROPIC_AUTH_TOKEN'],delete _0x4a0e1a[_0x4120ab(0x1a9)],delete _0x4a0e1a[_0x4120ab(0x18f)]):(_0x45a04b[_0x4120ab(0x1b2)]!==undefined?_0x4a0e1a['ANTHROPIC_BASE_URL']=_0x45a04b['ANTHROPIC_BASE_URL']:delete _0x4a0e1a[_0x4120ab(0x1b2)],_0x45a04b[_0x4120ab(0x200)]!==undefined?_0x4a0e1a[_0x4120ab(0x200)]=_0x45a04b[_0x4120ab(0x200)]:delete _0x4a0e1a[_0x4120ab(0x200)],_0x45a04b[_0x4120ab(0x193)]!==undefined?_0x4a0e1a[_0x4120ab(0x193)]=_0x45a04b['ANTHROPIC_AUTH_TOKEN']:delete _0x4a0e1a['ANTHROPIC_AUTH_TOKEN'],_0x45a04b[_0x4120ab(0x1a9)]!==undefined?_0x4a0e1a['CLAUDE_CODE_USE_BEDROCK']=_0x45a04b['CLAUDE_CODE_USE_BEDROCK']:delete _0x4a0e1a['CLAUDE_CODE_USE_BEDROCK'],_0x45a04b[_0x4120ab(0x18f)]!==undefined?_0x4a0e1a[_0x4120ab(0x18f)]=_0x45a04b[_0x4120ab(0x18f)]:delete _0x4a0e1a[_0x4120ab(0x18f)]);const _0x7b7be3=_0x2cb6c9[_0x4120ab(0x17f)],_0x93ccff=((()=>{const _0x16a41d=_0x4120ab;if(!_0x7b7be3||typeof _0x7b7be3!=='object')return![];if(_0x7b7be3[_0x16a41d(0x1a5)]!==_0x16a41d(0x192))return![];if(typeof _0x7b7be3[_0x16a41d(0x192)]!=='string')return![];return _0x7b7be3[_0x16a41d(0x192)][_0x16a41d(0x18c)](_0x16a41d(0x1d7))&&_0x7b7be3['command'][_0x16a41d(0x18c)](_0x16a41d(0x175));})());if(_0x93ccff)delete _0x2cb6c9[_0x4120ab(0x17f)];else _0x45a04b[_0x4120ab(0x17f)]!==undefined?_0x2cb6c9[_0x4120ab(0x17f)]=_0x45a04b[_0x4120ab(0x17f)]:delete _0x2cb6c9[_0x4120ab(0x17f)];_0x2cb6c9[_0x4120ab(0x184)]=_0x4a0e1a,await writeFile(_0x484381,JSON[_0x4120ab(0x1ee)](_0x2cb6c9,null,0x2)+'\x0a');}catch{}}function a9_0x388c(_0x151f56,_0x1c893e){_0x151f56=_0x151f56-0x15f;const _0x10348e=a9_0x1034();let _0x388c2c=_0x10348e[_0x151f56];return _0x388c2c;}export class ClaudeCommand extends BaseCommand{[a9_0x2a44ea(0x167)]=a9_0x2a44ea(0x173);['description']=a9_0x2a44ea(0x182);['passThroughServer'];[a9_0x2a44ea(0x198)];[a9_0x2a44ea(0x162)];[a9_0x2a44ea(0x1d6)];async['execute'](_0x117b49){const _0x55e19c=a9_0x2a44ea,{tdx:_0x15f9e7,options:_0x186aa8,args:_0x5c8454}=_0x117b49;let _0x3655e3=![];try{const _0x39e11e=_0x186aa8,_0x392bb2=_0x39e11e[_0x55e19c(0x178)]===![],_0x270394=_0x39e11e[_0x55e19c(0x177)]===!![],_0x1f3e14=_0x39e11e['resume']===!![],_0x23c461=[..._0x5c8454];if(_0x270394)_0x23c461[_0x55e19c(0x19d)]('-c');else _0x1f3e14&&_0x23c461[_0x55e19c(0x19d)]('-r');const _0x3eb2c5=createCommandSpinner(_0x55e19c(0x1a8),{'verbose':_0x186aa8[_0x55e19c(0x1d5)]});_0x3eb2c5[_0x55e19c(0x1e1)]();try{if(!_0x392bb2){_0x3eb2c5['text']=_0x55e19c(0x1da),this[_0x55e19c(0x1d6)]=await findAvailablePort(0xfa0),_0x3eb2c5[_0x55e19c(0x1fd)]='✓\x20Found\x20available\x20port:\x20'+this[_0x55e19c(0x1d6)];const _0x29c3f6=_0x186aa8[_0x55e19c(0x1e8)];try{const _0x1c6575=await _0x15f9e7[_0x55e19c(0x16b)]['getCurrent']();_0x1c6575[_0x55e19c(0x194)]&&writeCachedAccountInfo(_0x186aa8['site'],_0x1c6575[_0x55e19c(0x194)],_0x29c3f6);}catch{}_0x3eb2c5[_0x55e19c(0x1fd)]=_0x55e19c(0x1b0),this[_0x55e19c(0x162)]=new TDXLogger(_0x186aa8['logLevel'],!![]),await this[_0x55e19c(0x162)][_0x55e19c(0x1bd)]();const _0x1a4e1f=this[_0x55e19c(0x162)][_0x55e19c(0x17b)]();_0x3eb2c5['text']=_0x55e19c(0x1f6)+_0x1a4e1f;const _0x384edf=getEndpoint(_0x186aa8[_0x55e19c(0x1a6)],_0x55e19c(0x18b));_0x3eb2c5['text']=_0x55e19c(0x1d8);if(!_0x15f9e7['context'][_0x55e19c(0x16c)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x55e19c(0x1f8));this[_0x55e19c(0x1e4)]=new PassThroughProxyServer({'port':this[_0x55e19c(0x1d6)],'llmProxyUrl':_0x384edf,'apiKey':_0x15f9e7['context']['apiKey'],'logger':this[_0x55e19c(0x162)],'site':_0x186aa8['site'],'profile':_0x29c3f6}),await this[_0x55e19c(0x1e4)][_0x55e19c(0x1e1)](),_0x3eb2c5['text']=_0x55e19c(0x1c2)+this[_0x55e19c(0x1d6)]+_0x55e19c(0x196)+_0x384edf,_0x3eb2c5[_0x55e19c(0x1fd)]=_0x55e19c(0x1e7),this['originalSettings']=await createClaudeSettings(this[_0x55e19c(0x1d6)],undefined,_0x29c3f6),_0x3eb2c5[_0x55e19c(0x1fd)]='✓\x20Settings\x20configured:\x20.claude/settings.local.json';}else _0x3eb2c5[_0x55e19c(0x1fd)]=_0x55e19c(0x1bb);try{_0x3eb2c5['text']=_0x55e19c(0x1b9),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x55e19c(0x162)]),_0x3eb2c5[_0x55e19c(0x1fd)]=_0x55e19c(0x190);}catch(_0x1ec13c){_0x3eb2c5[_0x55e19c(0x189)]('Claude\x20Code\x20version\x20check\x20failed');throw _0x1ec13c;}try{await ensureMcpServer(_0x55e19c(0x176),_0x55e19c(0x1ec),_0x55e19c(0x1bc),_0x3eb2c5,this[_0x55e19c(0x162)]);}catch(_0x2ccc7c){handleInstallationError(_0x2ccc7c,'TD\x20Docs\x20MCP\x20Server',_0x3eb2c5,this[_0x55e19c(0x162)]);}try{const _0x336016=getTdSkillsRepoUrl();_0x3655e3=_0x336016!==DEFAULT_TD_SKILLS_URL,_0x3655e3&&await removeMarketplace('td-skills',this[_0x55e19c(0x162)]),await ensureMarketplace(_0x55e19c(0x199),_0x336016,_0x3eb2c5,this[_0x55e19c(0x162)]),await updateMarketplace(_0x55e19c(0x199),_0x3eb2c5,this[_0x55e19c(0x162)]),await ensurePlugin(_0x55e19c(0x16a),'td-skills',_0x3eb2c5,this[_0x55e19c(0x162)]),await ensurePlugin(_0x55e19c(0x1f5),_0x55e19c(0x199),_0x3eb2c5,this[_0x55e19c(0x162)]),await ensurePlugin(_0x55e19c(0x1c4),'td-skills',_0x3eb2c5,this['logger']);}catch(_0x3036d9){handleInstallationError(_0x3036d9,_0x55e19c(0x187),_0x3eb2c5,this[_0x55e19c(0x162)]);}_0x3eb2c5[_0x55e19c(0x1a4)]();}catch(_0x41720f){_0x3eb2c5[_0x55e19c(0x189)](_0x55e19c(0x1c8));throw _0x41720f;}const _0x32f24f=await findExecutable('claude');if(!_0x32f24f)throw new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x55e19c(0x1dc),undefined,{'helpText':_0x55e19c(0x1e2)});const _0x141eec={...process.env};!_0x392bb2&&(_0x141eec[_0x55e19c(0x1b2)]=_0x55e19c(0x188)+this[_0x55e19c(0x1d6)],_0x141eec[_0x55e19c(0x193)]='tdx-managed-proxy',_0x141eec[_0x55e19c(0x1a9)]=_0x55e19c(0x1ed),_0x141eec['CLAUDE_CODE_USE_VERTEX']=_0x55e19c(0x1ed));const _0x1136e9=crossSpawn(_0x32f24f,_0x23c461,{'stdio':_0x55e19c(0x1b5),'env':_0x141eec}),_0x4e097b=await new Promise(_0x489bbe=>{const _0x1be73e=_0x55e19c;_0x1136e9['on'](_0x1be73e(0x19f),_0xebf348=>{_0x489bbe(_0xebf348||0x0);}),_0x1136e9['on'](_0x1be73e(0x1ef),_0x2aa157=>{const _0x35baae=_0x1be73e;console[_0x35baae(0x1ef)](a9_0x9b06b6[_0x35baae(0x1de)](_0x35baae(0x1fb)+_0x2aa157[_0x35baae(0x179)])),_0x489bbe(0x1);});});_0x3655e3&&await restoreDefaultTdSkillsMarketplace(this[_0x55e19c(0x162)]);this[_0x55e19c(0x1e4)]&&(await this['passThroughServer'][_0x55e19c(0x1a4)](),console['log'](a9_0x9b06b6[_0x55e19c(0x1ca)](_0x55e19c(0x1c7))));if(this[_0x55e19c(0x162)]){await this[_0x55e19c(0x162)][_0x55e19c(0x16d)]();const _0x47ac3a=this[_0x55e19c(0x162)][_0x55e19c(0x17b)]();console['log'](a9_0x9b06b6[_0x55e19c(0x1ca)](_0x55e19c(0x161)+_0x47ac3a));}return this[_0x55e19c(0x198)]&&(await restoreClaudeSettings(this[_0x55e19c(0x198)]),console[_0x55e19c(0x166)](a9_0x9b06b6[_0x55e19c(0x1ca)](_0x55e19c(0x1f1)))),_0x4e097b;}catch(_0x48ec65){_0x3655e3&&await restoreDefaultTdSkillsMarketplace(this[_0x55e19c(0x162)]);this[_0x55e19c(0x1e4)]&&await this[_0x55e19c(0x1e4)][_0x55e19c(0x1a4)]();this[_0x55e19c(0x162)]&&await this[_0x55e19c(0x162)][_0x55e19c(0x16d)]();this[_0x55e19c(0x198)]&&await restoreClaudeSettings(this['originalSettings']);throw _0x48ec65;}}}
1
+ function a9_0x283c(_0xa1dc9d,_0x560c5e){_0xa1dc9d=_0xa1dc9d-0x1ab;const _0x3cb841=a9_0x3cb8();let _0x283caa=_0x3cb841[_0xa1dc9d];return _0x283caa;}const a9_0x3264b9=a9_0x283c;(function(_0x41668a,_0x3fcdd2){const _0x24b6f0=a9_0x283c,_0x1003bd=_0x41668a();while(!![]){try{const _0x5f0750=parseInt(_0x24b6f0(0x1ce))/0x1*(parseInt(_0x24b6f0(0x219))/0x2)+-parseInt(_0x24b6f0(0x244))/0x3+parseInt(_0x24b6f0(0x211))/0x4+-parseInt(_0x24b6f0(0x1d0))/0x5*(-parseInt(_0x24b6f0(0x232))/0x6)+parseInt(_0x24b6f0(0x1c5))/0x7+-parseInt(_0x24b6f0(0x224))/0x8+-parseInt(_0x24b6f0(0x204))/0x9;if(_0x5f0750===_0x3fcdd2)break;else _0x1003bd['push'](_0x1003bd['shift']());}catch(_0x89016d){_0x1003bd['push'](_0x1003bd['shift']());}}}(a9_0x3cb8,0x70837));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x33d86f 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';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION='2.0.20';function handleInstallationError(_0x10cceb,_0x29ba99,_0x7d3fe1,_0x5ee7f4){const _0x3cea09=a9_0x283c;errorContains(_0x10cceb,_0x3cea09(0x225),_0x3cea09(0x1bc),_0x3cea09(0x1f9))?(_0x7d3fe1[_0x3cea09(0x217)]='✓\x20'+_0x29ba99+'\x20already\x20configured',_0x5ee7f4?.[_0x3cea09(0x1ca)](_0x29ba99+_0x3cea09(0x1e5)),_0x10cceb instanceof SDKError&&_0x10cceb['cause']&&_0x5ee7f4?.[_0x3cea09(0x1db)](_0x3cea09(0x1f0)+_0x10cceb[_0x3cea09(0x1c4)][_0x3cea09(0x1da)])):(_0x7d3fe1[_0x3cea09(0x1b2)](_0x3cea09(0x1fe)+_0x29ba99),_0x5ee7f4?.[_0x3cea09(0x1e7)](_0x29ba99+_0x3cea09(0x222),_0x10cceb));}export function parseVersion(_0x3aeef2){const _0x2f310f=a9_0x283c,_0x33302a=_0x3aeef2[_0x2f310f(0x240)]()[_0x2f310f(0x1ad)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x33302a)return null;return{'major':parseInt(_0x33302a[0x1],0xa),'minor':parseInt(_0x33302a[0x2],0xa),'patch':parseInt(_0x33302a[0x3],0xa)};}export function compareVersions(_0x4d904c,_0x2b9455){const _0x14ee78=a9_0x283c;if(_0x4d904c[_0x14ee78(0x20d)]!==_0x2b9455[_0x14ee78(0x20d)])return _0x4d904c[_0x14ee78(0x20d)]-_0x2b9455[_0x14ee78(0x20d)];if(_0x4d904c['minor']!==_0x2b9455[_0x14ee78(0x201)])return _0x4d904c[_0x14ee78(0x201)]-_0x2b9455[_0x14ee78(0x201)];return _0x4d904c[_0x14ee78(0x235)]-_0x2b9455['patch'];}async function checkClaudeVersion(_0x19590e,_0x26a0bd){const _0x13d03f=a9_0x283c;_0x26a0bd?.[_0x13d03f(0x1db)](_0x13d03f(0x1e3)+_0x19590e+')');const _0x3af2f7=await executeClaudeCommand([_0x13d03f(0x1b5)],undefined,_0x26a0bd),_0x1f4586=parseVersion(_0x3af2f7);if(!_0x1f4586){_0x26a0bd?.[_0x13d03f(0x1b2)]('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x3af2f7);return;}const _0x58ffaf=_0x1f4586[_0x13d03f(0x20d)]+'.'+_0x1f4586[_0x13d03f(0x201)]+'.'+_0x1f4586['patch'],_0x1544f0=parseVersion(_0x19590e);if(!_0x1544f0){_0x26a0bd?.[_0x13d03f(0x1b2)](_0x13d03f(0x1f5)+_0x19590e);return;}if(compareVersions(_0x1f4586,_0x1544f0)<0x0){_0x26a0bd?.[_0x13d03f(0x1e7)](_0x13d03f(0x23c)+_0x58ffaf+_0x13d03f(0x20f)+_0x19590e+')');throw new SDKError(ErrorCode[_0x13d03f(0x231)],_0x13d03f(0x23c)+_0x58ffaf+_0x13d03f(0x1b0)+_0x19590e+_0x13d03f(0x1ba),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x26a0bd?.[_0x13d03f(0x1db)](_0x13d03f(0x23c)+_0x58ffaf+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x1913ab,_0x5a1f30,_0x35a880){const _0x1f998a=a9_0x283c;return _0x35a880?.[_0x1f998a(0x1ca)](_0x1f998a(0x239)+_0x1913ab[_0x1f998a(0x1ac)]('\x20')),new Promise((_0x3fe36b,_0x17f7f2)=>{const _0x35694d=_0x1f998a,_0x14438e=crossSpawn(_0x35694d(0x1b7),_0x1913ab,{'stdio':_0x35694d(0x21d)});let _0x335504='',_0x1bd39c='';_0x14438e[_0x35694d(0x1e9)]?.['on'](_0x35694d(0x206),_0x122c09=>{const _0x570daa=_0x35694d;_0x335504+=_0x122c09[_0x570daa(0x1e8)]();}),_0x14438e['stderr']?.['on'](_0x35694d(0x206),_0x2023c7=>{const _0x1a4847=_0x35694d;_0x1bd39c+=_0x2023c7[_0x1a4847(0x1e8)]();}),_0x14438e['on'](_0x35694d(0x1e7),_0x1ea8f5=>{const _0x4b2720=_0x35694d;_0x1ea8f5['code']==='ENOENT'?(_0x35a880?.[_0x4b2720(0x1e7)](_0x4b2720(0x1c3)),_0x17f7f2(new SDKError(ErrorCode[_0x4b2720(0x237)],_0x4b2720(0x1c3),_0x1ea8f5,{'helpText':_0x4b2720(0x21c)}))):(_0x35a880?.['error']('Command\x20spawn\x20error:\x20'+_0x1ea8f5[_0x4b2720(0x1da)]),_0x17f7f2(new SDKError(ErrorCode[_0x4b2720(0x23a)],_0x4b2720(0x226)+_0x1ea8f5[_0x4b2720(0x1da)],_0x1ea8f5)));}),_0x14438e['on']('exit',_0x256ba1=>{const _0x4b19c2=_0x35694d;if(_0x256ba1===0x0)_0x3fe36b(_0x335504);else _0x5a1f30?(_0x35a880?.['error']('Command\x20failed\x20(exit\x20'+_0x256ba1+_0x4b19c2(0x234)+_0x1913ab[_0x4b19c2(0x1ac)]('\x20')),_0x17f7f2(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x5a1f30,new Error(_0x1bd39c)))):_0x3fe36b('');});});}async function ensureMcpServer(_0x26f38e,_0x345b5a,_0x9cf9f2,_0x46db8f,_0x6785db){const _0x187660=a9_0x283c;_0x46db8f[_0x187660(0x217)]=_0x187660(0x243)+_0x26f38e+_0x187660(0x21e),await executeClaudeCommand([_0x187660(0x1ea),_0x187660(0x1bb),_0x26f38e,_0x345b5a,_0x187660(0x218),_0x9cf9f2],_0x187660(0x1f2)+_0x26f38e+'\x27',_0x6785db),_0x46db8f['text']=_0x187660(0x213)+_0x26f38e+_0x187660(0x1fc);}export const DEFAULT_TD_SKILLS_URL=a9_0x3264b9(0x202);function a9_0x3cb8(){const _0x487c08=['proxy','Updating\x20marketplace\x20\x27','ANTHROPIC_AUTH_TOKEN','major','\x27:\x20','\x20is\x20too\x20old\x20(minimum:\x20','td-docs','2314412lxDLYq','\x27\x20installed','✓\x20MCP\x20server\x20\x27','Creating\x20.claude/settings.local.json...','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','✓\x20Marketplace\x20\x27','text','--transport','8vdTsDx','continue','localhost','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','pipe','\x27...','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','command','Failed\x20to\x20install\x20plugin\x20\x27','\x20configuration\x20failed','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','3760800RYvMXK','already\x20exists','Failed\x20to\x20spawn\x20claude\x20command:\x20','Installing\x20plugin\x20\x27','stop','Initializing...','name','profile','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','execute','marketplace','\x27\x20updated','init','CLAUDE_CODE_UNSUPPORTED_VERSION','42870UoNHBz','originalSettings','):\x20claude\x20','patch','http','CLAUDE_CODE_NOT_FOUND','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','Executing:\x20claude\x20','INTERNAL','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','Claude\x20Code\x20version\x20','description','✓\x20Logging\x20to\x20','TD\x20Docs\x20MCP\x20Server','trim','Failed\x20to\x20remove\x20marketplace\x20\x27','td-skills\x20Plugins','Configuring\x20MCP\x20server\x20\x27','1896036JVrQWx','log','join','match','Checking\x20Claude\x20Code\x20version...','string','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','parse','warn','passThroughServer','env','--version','Claude\x20Code\x20version\x20check\x20failed','claude','install','http://127.0.0.1:','\x20or\x20later.','add','already\x20installed','ANTHROPIC_MODEL','tdx-managed-proxy','tdx\x20--profile\x20','statusLine','remove','\x20→\x20','Claude\x20Code\x20CLI\x20not\x20found','cause','5926802EVnqYn','✓\x20Plugin\x20\x27','127.0.0.1','green','✓\x20Settings\x20restored:\x20.claude/settings.local.json','info','inherit','Configuring\x20marketplace\x20\x27','exit','159242zBQRMH','Failed\x20to\x20launch\x20Claude\x20Code:\x20','290KmiFhv','update','logger','Marketplace\x20\x27','Setup\x20failed','hostname','context','includes','CLAUDE_CODE_USE_VERTEX','CLAUDE_CODE_USE_BEDROCK','message','debug','Finding\x20available\x20port...','utf-8','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','false','Failed\x20to\x20configure\x20marketplace\x20\x27','site','INVALID_ARGUMENT','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','start','\x20already\x20configured','ANTHROPIC_BASE_URL','error','toString','stdout','mcp','plugin','Failed\x20to\x20update\x20marketplace\x20\x27','close','✓\x20Settings\x20configured:\x20.claude/settings.local.json','fail','Command\x20output:\x20','unshift','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','.claude','port','Invalid\x20minimum\x20version\x20format:\x20','apiKey','✓\x20Logs\x20saved\x20to\x20','cwd','already\x20configured','type','td-skills','\x27\x20configured','Failed\x20to\x20list\x20marketplaces','Warning:\x20Failed\x20to\x20configure\x20','account_id','workflow-skills','minor','https://github.com/treasure-data/td-skills','resume','8223300HuRaGC','stringify','data','tdx-skills','settings.local.json','red'];a9_0x3cb8=function(){return _0x487c08;};return a9_0x3cb8();}export function getTdSkillsRepoUrl(){const _0x9318ea=process.env.TDX_TD_SKILLS_REPO;if(_0x9318ea)return _0x9318ea;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x308e71,_0x29050a){const _0x5a1469=a9_0x3264b9;try{const _0x594da5=await executeClaudeCommand([_0x5a1469(0x1eb),_0x5a1469(0x22e),'list'],_0x5a1469(0x1fd),_0x29050a);if(!_0x594da5['includes'](_0x308e71)){_0x29050a?.[_0x5a1469(0x1db)](_0x5a1469(0x1d3)+_0x308e71+_0x5a1469(0x238));return;}await executeClaudeCommand([_0x5a1469(0x1eb),_0x5a1469(0x22e),_0x5a1469(0x1c1),_0x308e71],_0x5a1469(0x241)+_0x308e71+'\x27',_0x29050a),_0x29050a?.[_0x5a1469(0x1ca)](_0x5a1469(0x1d3)+_0x308e71+'\x27\x20removed');}catch(_0x30756b){_0x29050a?.[_0x5a1469(0x1b2)]('Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x308e71+_0x5a1469(0x20e)+_0x30756b);}}async function restoreDefaultTdSkillsMarketplace(_0x44b7f5){const _0x39619c=a9_0x3264b9;try{await removeMarketplace(_0x39619c(0x1fb),_0x44b7f5),await executeClaudeCommand([_0x39619c(0x1eb),_0x39619c(0x22e),_0x39619c(0x1bb),DEFAULT_TD_SKILLS_URL],undefined,_0x44b7f5),_0x44b7f5?.[_0x39619c(0x1ca)]('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0x438d80,_0xe782fa,_0x54e836,_0xb5ee6b){const _0x286dd6=a9_0x3264b9;_0x54e836['text']=_0x286dd6(0x1cc)+_0x438d80+_0x286dd6(0x21e),await executeClaudeCommand(['plugin','marketplace',_0x286dd6(0x1bb),_0xe782fa],_0x286dd6(0x1e0)+_0x438d80+'\x27',_0xb5ee6b),_0x54e836[_0x286dd6(0x217)]=_0x286dd6(0x216)+_0x438d80+_0x286dd6(0x1fc);}async function updateMarketplace(_0x137444,_0x2ffe39,_0x72a662){const _0x575bfd=a9_0x3264b9;_0x2ffe39['text']=_0x575bfd(0x20b)+_0x137444+_0x575bfd(0x21e),await executeClaudeCommand([_0x575bfd(0x1eb),'marketplace',_0x575bfd(0x1d1)],_0x575bfd(0x1ec)+_0x137444+'\x27',_0x72a662),_0x2ffe39[_0x575bfd(0x217)]='✓\x20Marketplace\x20\x27'+_0x137444+_0x575bfd(0x22f);}async function ensurePlugin(_0x8b09db,_0x4cd8f0,_0x5c4cdd,_0xd9661e){const _0x44cf2b=a9_0x3264b9;_0x5c4cdd['text']=_0x44cf2b(0x227)+_0x8b09db+_0x44cf2b(0x21e),await executeClaudeCommand(['plugin',_0x44cf2b(0x1b8),_0x8b09db+'@'+_0x4cd8f0],_0x44cf2b(0x221)+_0x8b09db+'\x27',_0xd9661e),_0x5c4cdd[_0x44cf2b(0x217)]=_0x44cf2b(0x1c6)+_0x8b09db+_0x44cf2b(0x212);}async function createClaudeSettings(_0x15dafa,_0x20a0e6,_0x52d782){const _0x5d8f45=a9_0x3264b9,_0x25e27f=join(process[_0x5d8f45(0x1f8)](),_0x5d8f45(0x1f3)),_0x54b689=join(_0x25e27f,_0x5d8f45(0x208));await mkdir(_0x25e27f,{'recursive':!![]});let _0x36bb14={};if(existsSync(_0x54b689))try{const _0x2709a6=await readFile(_0x54b689,'utf-8');_0x36bb14=JSON[_0x5d8f45(0x1b1)](_0x2709a6);}catch{_0x36bb14={};}const _0x5e85b6=_0x36bb14[_0x5d8f45(0x1b4)]||{},_0x34d867={'ANTHROPIC_BASE_URL':_0x5e85b6[_0x5d8f45(0x1e6)],'ANTHROPIC_MODEL':_0x5e85b6[_0x5d8f45(0x1bd)],'ANTHROPIC_AUTH_TOKEN':_0x5e85b6[_0x5d8f45(0x20c)],'CLAUDE_CODE_USE_BEDROCK':_0x5e85b6[_0x5d8f45(0x1d9)],'CLAUDE_CODE_USE_VERTEX':_0x5e85b6[_0x5d8f45(0x1d8)],'statusLine':_0x36bb14['statusLine']},_0x1dc9d5={..._0x36bb14,'env':{..._0x5e85b6,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x15dafa,..._0x20a0e6&&{'ANTHROPIC_MODEL':_0x20a0e6},'ANTHROPIC_AUTH_TOKEN':_0x5d8f45(0x1be),'CLAUDE_CODE_USE_BEDROCK':_0x5d8f45(0x1df),'CLAUDE_CODE_USE_VERTEX':_0x5d8f45(0x1df)},'statusLine':{'type':_0x5d8f45(0x220),'command':_0x52d782?_0x5d8f45(0x1bf)+_0x52d782+'\x20claude\x20statusline':'tdx\x20claude\x20statusline'}};return await writeFile(_0x54b689,JSON[_0x5d8f45(0x205)](_0x1dc9d5,null,0x2)+'\x0a'),_0x34d867;}async function restoreClaudeSettings(_0x43f3a0){const _0x19d7a6=a9_0x3264b9,_0x7840f7=join(process[_0x19d7a6(0x1f8)](),'.claude'),_0x54a9ce=join(_0x7840f7,_0x19d7a6(0x208));if(!existsSync(_0x54a9ce))return;try{const _0x2b6286=await readFile(_0x54a9ce,_0x19d7a6(0x1dd)),_0x2c25b2=JSON[_0x19d7a6(0x1b1)](_0x2b6286),_0x1f2eb8=_0x2c25b2[_0x19d7a6(0x1b4)]||{},_0x3f7a4c=_0x1f2eb8['ANTHROPIC_BASE_URL'],_0x4b08b1=((()=>{const _0x530212=_0x19d7a6;if(typeof _0x3f7a4c!==_0x530212(0x1af))return![];try{const _0x1446eb=new URL(_0x3f7a4c);return _0x1446eb[_0x530212(0x1d5)]===_0x530212(0x21b)||_0x1446eb[_0x530212(0x1d5)]===_0x530212(0x1c7);}catch{return![];}})());_0x4b08b1?(delete _0x1f2eb8[_0x19d7a6(0x1e6)],delete _0x1f2eb8[_0x19d7a6(0x1bd)],delete _0x1f2eb8[_0x19d7a6(0x20c)],delete _0x1f2eb8['CLAUDE_CODE_USE_BEDROCK'],delete _0x1f2eb8[_0x19d7a6(0x1d8)]):(_0x43f3a0[_0x19d7a6(0x1e6)]!==undefined?_0x1f2eb8['ANTHROPIC_BASE_URL']=_0x43f3a0[_0x19d7a6(0x1e6)]:delete _0x1f2eb8[_0x19d7a6(0x1e6)],_0x43f3a0[_0x19d7a6(0x1bd)]!==undefined?_0x1f2eb8['ANTHROPIC_MODEL']=_0x43f3a0[_0x19d7a6(0x1bd)]:delete _0x1f2eb8['ANTHROPIC_MODEL'],_0x43f3a0[_0x19d7a6(0x20c)]!==undefined?_0x1f2eb8['ANTHROPIC_AUTH_TOKEN']=_0x43f3a0[_0x19d7a6(0x20c)]:delete _0x1f2eb8[_0x19d7a6(0x20c)],_0x43f3a0[_0x19d7a6(0x1d9)]!==undefined?_0x1f2eb8['CLAUDE_CODE_USE_BEDROCK']=_0x43f3a0[_0x19d7a6(0x1d9)]:delete _0x1f2eb8['CLAUDE_CODE_USE_BEDROCK'],_0x43f3a0['CLAUDE_CODE_USE_VERTEX']!==undefined?_0x1f2eb8[_0x19d7a6(0x1d8)]=_0x43f3a0[_0x19d7a6(0x1d8)]:delete _0x1f2eb8['CLAUDE_CODE_USE_VERTEX']);const _0x32aace=_0x2c25b2[_0x19d7a6(0x1c0)],_0x28c262=((()=>{const _0x1d66a7=_0x19d7a6;if(!_0x32aace||typeof _0x32aace!=='object')return![];if(_0x32aace[_0x1d66a7(0x1fa)]!==_0x1d66a7(0x220))return![];if(typeof _0x32aace['command']!=='string')return![];return _0x32aace[_0x1d66a7(0x220)][_0x1d66a7(0x1d7)]('tdx')&&_0x32aace[_0x1d66a7(0x220)][_0x1d66a7(0x1d7)]('statusline');})());if(_0x28c262)delete _0x2c25b2['statusLine'];else _0x43f3a0[_0x19d7a6(0x1c0)]!==undefined?_0x2c25b2[_0x19d7a6(0x1c0)]=_0x43f3a0['statusLine']:delete _0x2c25b2['statusLine'];_0x2c25b2[_0x19d7a6(0x1b4)]=_0x1f2eb8,await writeFile(_0x54a9ce,JSON['stringify'](_0x2c25b2,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x3264b9(0x22a)]=a9_0x3264b9(0x1b7);[a9_0x3264b9(0x23d)]=a9_0x3264b9(0x223);['passThroughServer'];[a9_0x3264b9(0x233)];['logger'];[a9_0x3264b9(0x1f4)];async[a9_0x3264b9(0x22d)](_0x13984a){const _0x9127bf=a9_0x3264b9,{tdx:_0x48c8a7,options:_0x3a602b,args:_0x48b910}=_0x13984a;let _0x91ea4f=![];try{const _0x3d8454=_0x3a602b,_0x230478=_0x3d8454[_0x9127bf(0x20a)]===![],_0x255f17=_0x3d8454[_0x9127bf(0x21a)]===!![],_0x29cafb=_0x3d8454[_0x9127bf(0x203)]===!![],_0x1bd24b=[..._0x48b910];if(_0x255f17)_0x1bd24b[_0x9127bf(0x1f1)]('-c');else _0x29cafb&&_0x1bd24b['unshift']('-r');const _0x32149b=createCommandSpinner(_0x9127bf(0x229),{'verbose':_0x3a602b['verbose']});_0x32149b[_0x9127bf(0x1e4)]();try{if(!_0x230478){_0x32149b[_0x9127bf(0x217)]=_0x9127bf(0x1dc),this[_0x9127bf(0x1f4)]=await findAvailablePort(0xfa0),_0x32149b[_0x9127bf(0x217)]='✓\x20Found\x20available\x20port:\x20'+this[_0x9127bf(0x1f4)];const _0x164835=_0x3a602b[_0x9127bf(0x22b)];try{const _0x46cf2c=await _0x48c8a7['user']['getCurrent']();_0x46cf2c[_0x9127bf(0x1ff)]&&writeCachedAccountInfo(_0x3a602b[_0x9127bf(0x1e1)],_0x46cf2c['account_id'],_0x164835);}catch{}_0x32149b[_0x9127bf(0x217)]='Initializing\x20proxy\x20logger...',this[_0x9127bf(0x1d2)]=new TDXLogger(_0x3a602b['logLevel'],!![]),await this[_0x9127bf(0x1d2)][_0x9127bf(0x230)]();const _0x103dc6=this[_0x9127bf(0x1d2)]['getLogPath']();_0x32149b[_0x9127bf(0x217)]=_0x9127bf(0x23e)+_0x103dc6;const _0x238065=getEndpoint(_0x3a602b[_0x9127bf(0x1e1)],'llm-proxy');_0x32149b[_0x9127bf(0x217)]=_0x9127bf(0x22c);if(!_0x48c8a7[_0x9127bf(0x1d6)][_0x9127bf(0x1f6)])throw new SDKError(ErrorCode[_0x9127bf(0x1e2)],_0x9127bf(0x21f));this[_0x9127bf(0x1b3)]=new PassThroughProxyServer({'port':this[_0x9127bf(0x1f4)],'llmProxyUrl':_0x238065,'apiKey':_0x48c8a7[_0x9127bf(0x1d6)]['apiKey'],'logger':this['logger'],'site':_0x3a602b['site'],'profile':_0x164835}),await this[_0x9127bf(0x1b3)][_0x9127bf(0x1e4)](),_0x32149b[_0x9127bf(0x217)]=_0x9127bf(0x23b)+this[_0x9127bf(0x1f4)]+_0x9127bf(0x1c2)+_0x238065,_0x32149b[_0x9127bf(0x217)]=_0x9127bf(0x214),this[_0x9127bf(0x233)]=await createClaudeSettings(this[_0x9127bf(0x1f4)],undefined,_0x164835),_0x32149b[_0x9127bf(0x217)]=_0x9127bf(0x1ee);}else _0x32149b[_0x9127bf(0x217)]=_0x9127bf(0x215);try{_0x32149b[_0x9127bf(0x217)]=_0x9127bf(0x1ae),await checkClaudeVersion(MIN_CLAUDE_VERSION,this['logger']),_0x32149b['text']='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x36d02d){_0x32149b[_0x9127bf(0x1ef)](_0x9127bf(0x1b6));throw _0x36d02d;}try{await ensureMcpServer(_0x9127bf(0x210),'https://docs.treasuredata.com/mcp',_0x9127bf(0x236),_0x32149b,this['logger']);}catch(_0x493155){handleInstallationError(_0x493155,_0x9127bf(0x23f),_0x32149b,this[_0x9127bf(0x1d2)]);}try{const _0xc534c9=getTdSkillsRepoUrl();_0x91ea4f=_0xc534c9!==DEFAULT_TD_SKILLS_URL,_0x91ea4f&&await removeMarketplace(_0x9127bf(0x1fb),this[_0x9127bf(0x1d2)]),await ensureMarketplace('td-skills',_0xc534c9,_0x32149b,this[_0x9127bf(0x1d2)]),await updateMarketplace(_0x9127bf(0x1fb),_0x32149b,this[_0x9127bf(0x1d2)]),await ensurePlugin('sql-skills','td-skills',_0x32149b,this[_0x9127bf(0x1d2)]),await ensurePlugin(_0x9127bf(0x200),'td-skills',_0x32149b,this[_0x9127bf(0x1d2)]),await ensurePlugin(_0x9127bf(0x207),_0x9127bf(0x1fb),_0x32149b,this[_0x9127bf(0x1d2)]);}catch(_0x386cef){handleInstallationError(_0x386cef,_0x9127bf(0x242),_0x32149b,this['logger']);}_0x32149b['stop']();}catch(_0x354b71){_0x32149b[_0x9127bf(0x1ef)](_0x9127bf(0x1d4));throw _0x354b71;}const _0x3596b0=await findExecutable(_0x9127bf(0x1b7));if(!_0x3596b0)throw new SDKError(ErrorCode[_0x9127bf(0x237)],_0x9127bf(0x1c3),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x29723e={...process.env};!_0x230478&&(_0x29723e['ANTHROPIC_BASE_URL']=_0x9127bf(0x1b9)+this[_0x9127bf(0x1f4)],_0x29723e[_0x9127bf(0x20c)]=_0x9127bf(0x1be),_0x29723e['CLAUDE_CODE_USE_BEDROCK']=_0x9127bf(0x1df),_0x29723e['CLAUDE_CODE_USE_VERTEX']=_0x9127bf(0x1df));const _0x32550e=crossSpawn(_0x3596b0,_0x1bd24b,{'stdio':_0x9127bf(0x1cb),'env':_0x29723e}),_0x5dcb39=await new Promise(_0x466322=>{const _0x41cded=_0x9127bf;_0x32550e['on'](_0x41cded(0x1cd),_0x261b29=>{_0x466322(_0x261b29||0x0);}),_0x32550e['on'](_0x41cded(0x1e7),_0x4177aa=>{const _0x25f5c3=_0x41cded;console['error'](a9_0x33d86f[_0x25f5c3(0x209)](_0x25f5c3(0x1cf)+_0x4177aa[_0x25f5c3(0x1da)])),_0x466322(0x1);});});_0x91ea4f&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&(await this[_0x9127bf(0x1b3)][_0x9127bf(0x228)](),console[_0x9127bf(0x1ab)](a9_0x33d86f['green'](_0x9127bf(0x1de))));if(this[_0x9127bf(0x1d2)]){await this[_0x9127bf(0x1d2)][_0x9127bf(0x1ed)]();const _0x4d71c8=this[_0x9127bf(0x1d2)]['getLogPath']();console['log'](a9_0x33d86f[_0x9127bf(0x1c8)](_0x9127bf(0x1f7)+_0x4d71c8));}return this[_0x9127bf(0x233)]&&(await restoreClaudeSettings(this[_0x9127bf(0x233)]),console['log'](a9_0x33d86f['green'](_0x9127bf(0x1c9)))),_0x5dcb39;}catch(_0x98b426){_0x91ea4f&&await restoreDefaultTdSkillsMarketplace(this[_0x9127bf(0x1d2)]);this[_0x9127bf(0x1b3)]&&await this['passThroughServer']['stop']();this['logger']&&await this['logger']['close']();this[_0x9127bf(0x233)]&&await restoreClaudeSettings(this['originalSettings']);throw _0x98b426;}}}
@@ -1 +1 @@
1
- const a10_0x559de4=a10_0x5a0e;(function(_0x25baf1,_0x4eb239){const _0x4b69dd=a10_0x5a0e,_0x32fd38=_0x25baf1();while(!![]){try{const _0x479a4b=parseInt(_0x4b69dd(0x124))/0x1+parseInt(_0x4b69dd(0x11a))/0x2*(parseInt(_0x4b69dd(0x119))/0x3)+-parseInt(_0x4b69dd(0x122))/0x4*(parseInt(_0x4b69dd(0x11f))/0x5)+parseInt(_0x4b69dd(0x11b))/0x6*(parseInt(_0x4b69dd(0x114))/0x7)+parseInt(_0x4b69dd(0x130))/0x8*(-parseInt(_0x4b69dd(0x121))/0x9)+-parseInt(_0x4b69dd(0x118))/0xa*(parseInt(_0x4b69dd(0x12c))/0xb)+parseInt(_0x4b69dd(0x115))/0xc;if(_0x479a4b===_0x4eb239)break;else _0x32fd38['push'](_0x32fd38['shift']());}catch(_0x134244){_0x32fd38['push'](_0x32fd38['shift']());}}}(a10_0x345e,0x50526));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';function a10_0x345e(){const _0x50916b=['join','2305FCsGmn','execute','5031qfeRIm','4948eSrVlS','close','12132EYsvNu','toFixed','💎\x20','\x20today\x20/\x20','🪙\x20credit:\x20','model','push','profile','773751RthgVc','💎\x20tdx\x20-\x20Claude','\x20session\x20/\x20','options','6864ACkpcz','latestInputTokens','site','line','sessionCredits','parse','log','stdin','644qWjJzE','13318080DyKQRu','session_id','accountId','40gBhFXu','3XkfjCg','884074fAMzry','6276rykXTo','tdx\x20','Claude'];a10_0x345e=function(){return _0x50916b;};return a10_0x345e();}import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';function a10_0x5a0e(_0x103c69,_0x1ead2c){_0x103c69=_0x103c69-0x10f;const _0x345e76=a10_0x345e();let _0x5a0ea2=_0x345e76[_0x103c69];return _0x5a0ea2;}import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x52295e=0x64){return new Promise(_0x5c6072=>{const _0x438bc0=a10_0x5a0e;let _0x1e9819='',_0x4735d0=![];const _0x210e41=createInterface({'input':process[_0x438bc0(0x113)],'terminal':![]}),_0x57c5bb=_0x3ad017=>{const _0x347021=_0x438bc0;if(_0x4735d0)return;_0x4735d0=!![],clearTimeout(_0x3324e0),_0x210e41[_0x347021(0x123)](),_0x5c6072(_0x3ad017);},_0x3324e0=setTimeout(()=>{_0x57c5bb(null);},_0x52295e);_0x210e41['on'](_0x438bc0(0x10f),_0x11ee17=>{_0x1e9819+=_0x11ee17;}),_0x210e41['on']('close',()=>{const _0x3d259b=_0x438bc0;if(_0x4735d0)return;try{const _0x170303=JSON[_0x3d259b(0x111)](_0x1e9819);_0x57c5bb(_0x170303);}catch{_0x57c5bb(null);}});});}function formatCredits(_0x1f555e){const _0x19e39c=a10_0x5a0e;return _0x1f555e[_0x19e39c(0x125)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{['name']='statusline';['description']='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async[a10_0x559de4(0x120)](_0x216d2f){const _0x3d774f=a10_0x559de4;try{const _0xefb31d=await readStdinJson();if(!_0xefb31d?.[_0x3d774f(0x116)])return console[_0x3d774f(0x112)]('💎\x20tdx\x20-\x20Claude'),0x0;const _0x3d8a49=_0xefb31d[_0x3d774f(0x116)],_0x19d9a4=_0xefb31d[_0x3d774f(0x129)]?.['id']||'',_0x51ae26=_0xefb31d[_0x3d774f(0x12b)]||_0x216d2f[_0x3d774f(0x12f)][_0x3d774f(0x12b)],_0x4c3e76=await getUsageStats(_0x3d8a49,_0x51ae26),_0xf5dfec=[],_0x21804b=readCachedAccountInfo(_0x51ae26),_0x45ec57=_0x21804b?_0x3d774f(0x11c)+_0x21804b[_0x3d774f(0x132)]+':'+_0x21804b[_0x3d774f(0x117)]:'tdx',_0x2475bc=_0x19d9a4?getModelDisplayName(_0x19d9a4):_0x3d774f(0x11d);_0xf5dfec[_0x3d774f(0x12a)](_0x3d774f(0x126)+_0x45ec57+'\x20-\x20'+_0x2475bc);const _0x2b1329=formatCredits(_0x4c3e76[_0x3d774f(0x110)]),_0x1b9b24=formatCredits(_0x4c3e76['todayCredits']),_0x197bb3=formatCredits(_0x4c3e76['monthCredits']);_0xf5dfec[_0x3d774f(0x12a)](_0x3d774f(0x128)+_0x2b1329+_0x3d774f(0x12e)+_0x1b9b24+_0x3d774f(0x127)+_0x197bb3+'\x20month');if(_0x4c3e76[_0x3d774f(0x131)]>0x0&&_0x19d9a4){const _0x1282d6=formatTokenCount(_0x4c3e76[_0x3d774f(0x131)]),_0x1c54a6=calculateContextPercentage(_0x4c3e76['latestInputTokens'],_0x19d9a4);_0xf5dfec[_0x3d774f(0x12a)]('🧠\x20'+_0x1282d6+'\x20('+_0x1c54a6+'%)');}return console[_0x3d774f(0x112)](_0xf5dfec[_0x3d774f(0x11e)]('\x20|\x20')),0x0;}catch{return console[_0x3d774f(0x112)](_0x3d774f(0x12d)),0x0;}}}
1
+ const a10_0x2afc17=a10_0x95d8;(function(_0x164752,_0x1c7c7e){const _0x313ac6=a10_0x95d8,_0x1ef262=_0x164752();while(!![]){try{const _0x3c3774=parseInt(_0x313ac6(0x132))/0x1*(-parseInt(_0x313ac6(0x146))/0x2)+-parseInt(_0x313ac6(0x143))/0x3+parseInt(_0x313ac6(0x142))/0x4*(parseInt(_0x313ac6(0x13e))/0x5)+-parseInt(_0x313ac6(0x138))/0x6+-parseInt(_0x313ac6(0x13b))/0x7+parseInt(_0x313ac6(0x130))/0x8*(parseInt(_0x313ac6(0x12b))/0x9)+parseInt(_0x313ac6(0x145))/0xa;if(_0x3c3774===_0x1c7c7e)break;else _0x1ef262['push'](_0x1ef262['shift']());}catch(_0x39ae48){_0x1ef262['push'](_0x1ef262['shift']());}}}(a10_0x2fe8,0x1f1ac));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';function a10_0x95d8(_0xf2fd46,_0x54fee1){_0xf2fd46=_0xf2fd46-0x129;const _0x2fe888=a10_0x2fe8();let _0x95d82e=_0x2fe888[_0xf2fd46];return _0x95d82e;}async function readStdinJson(_0x2a1360=0x64){return new Promise(_0x66b4a3=>{const _0x4259e6=a10_0x95d8;let _0x11f746='',_0x2973c8=![];const _0x67a4d9=createInterface({'input':process['stdin'],'terminal':![]}),_0x52b3cc=_0xaadb16=>{if(_0x2973c8)return;_0x2973c8=!![],clearTimeout(_0x26d920),_0x67a4d9['close'](),_0x66b4a3(_0xaadb16);},_0x26d920=setTimeout(()=>{_0x52b3cc(null);},_0x2a1360);_0x67a4d9['on']('line',_0x4925e8=>{_0x11f746+=_0x4925e8;}),_0x67a4d9['on'](_0x4259e6(0x149),()=>{const _0x3f77ed=_0x4259e6;if(_0x2973c8)return;try{const _0x2d350e=JSON[_0x3f77ed(0x14a)](_0x11f746);_0x52b3cc(_0x2d350e);}catch{_0x52b3cc(null);}});});}function formatCredits(_0x277d32){const _0x54dc55=a10_0x95d8;return _0x277d32[_0x54dc55(0x137)](0x2);}function a10_0x2fe8(){const _0x271dc3=['Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','options','🪙\x20credit:\x20','push','toFixed','1381782FgTVrT','\x20today\x20/\x20','profile','1445479OpXlop','model','\x20month','792095PezpsQ','session_id','\x20-\x20','🧠\x20','4ylHCXH','331566BQDbAn','tdx','6759510MsSRoA','170yWfrTS','statusline','execute','close','parse','\x20|\x20','description','23175uBPNfZ','💎\x20','latestInputTokens','join','log','184wayDaG','💎\x20tdx\x20-\x20Claude','2575moarsr'];a10_0x2fe8=function(){return _0x271dc3;};return a10_0x2fe8();}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a10_0x2afc17(0x147);[a10_0x2afc17(0x12a)]=a10_0x2afc17(0x133);async[a10_0x2afc17(0x148)](_0x4afd2c){const _0x2d30a7=a10_0x2afc17;try{const _0x115b29=await readStdinJson();if(!_0x115b29?.[_0x2d30a7(0x13f)])return console['log'](_0x2d30a7(0x131)),0x0;const _0x4a7fb0=_0x115b29[_0x2d30a7(0x13f)],_0x2a57d5=_0x115b29[_0x2d30a7(0x13c)]?.['id']||'',_0x3b148e=_0x115b29[_0x2d30a7(0x13a)]||_0x4afd2c[_0x2d30a7(0x134)]['profile'],_0x169839=await getUsageStats(_0x4a7fb0,_0x3b148e),_0x658ca3=[],_0x2a6b3d=readCachedAccountInfo(_0x3b148e),_0x5c41d0=_0x2a6b3d?'tdx\x20'+_0x2a6b3d['site']+':'+_0x2a6b3d['accountId']:_0x2d30a7(0x144),_0x57c288=_0x2a57d5?getModelDisplayName(_0x2a57d5):'Claude';_0x658ca3[_0x2d30a7(0x136)](_0x2d30a7(0x12c)+_0x5c41d0+_0x2d30a7(0x140)+_0x57c288);const _0x564712=formatCredits(_0x169839['sessionCredits']),_0x50804d=formatCredits(_0x169839['todayCredits']),_0x5073bc=formatCredits(_0x169839['monthCredits']);_0x658ca3[_0x2d30a7(0x136)](_0x2d30a7(0x135)+_0x564712+'\x20session\x20/\x20'+_0x50804d+_0x2d30a7(0x139)+_0x5073bc+_0x2d30a7(0x13d));if(_0x169839[_0x2d30a7(0x12d)]>0x0&&_0x2a57d5){const _0x46340f=formatTokenCount(_0x169839[_0x2d30a7(0x12d)]),_0x935766=calculateContextPercentage(_0x169839[_0x2d30a7(0x12d)],_0x2a57d5);_0x658ca3[_0x2d30a7(0x136)](_0x2d30a7(0x141)+_0x46340f+'\x20('+_0x935766+'%)');}return console['log'](_0x658ca3[_0x2d30a7(0x12e)](_0x2d30a7(0x129))),0x0;}catch{return console[_0x2d30a7(0x12f)](_0x2d30a7(0x131)),0x0;}}}
@@ -1 +1 @@
1
- const a11_0x4cfb2d=a11_0x5748;(function(_0x1025f6,_0x2d001c){const _0x38277e=a11_0x5748,_0x54c70d=_0x1025f6();while(!![]){try{const _0x11a948=-parseInt(_0x38277e(0x120))/0x1*(-parseInt(_0x38277e(0x147))/0x2)+-parseInt(_0x38277e(0x128))/0x3+-parseInt(_0x38277e(0x135))/0x4*(parseInt(_0x38277e(0x153))/0x5)+parseInt(_0x38277e(0x136))/0x6*(parseInt(_0x38277e(0x163))/0x7)+-parseInt(_0x38277e(0x15a))/0x8+parseInt(_0x38277e(0x157))/0x9*(parseInt(_0x38277e(0x145))/0xa)+parseInt(_0x38277e(0x131))/0xb*(parseInt(_0x38277e(0x129))/0xc);if(_0x11a948===_0x2d001c)break;else _0x54c70d['push'](_0x54c70d['shift']());}catch(_0x4822de){_0x54c70d['push'](_0x54c70d['shift']());}}}(a11_0x26a2,0xba737));import a11_0x8d78c3 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(_0xa62fff){const _0x3edcea=a11_0x5748;return _0xa62fff[_0x3edcea(0x149)](0x2);}function a11_0x5748(_0x5afcdd,_0x4874f7){_0x5afcdd=_0x5afcdd-0x11f;const _0x26a28b=a11_0x26a2();let _0x57482b=_0x26a28b[_0x5afcdd];return _0x57482b;}function a11_0x26a2(){const _0x1961cd=['Month','monthCredits','round','Requests','92553AmDhOy','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','todayCredits','profile','repeat','padStart','Total','Usage\x20by\x20Source','719313qQAnsA','66516rCIEdQ','format','totalCredits','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','json','\x20\x20Month:\x20\x20\x20','Source','credits','1991vZCYyc','log','cyan','default','137752bHuCcg','24QXFYrT','error','profileCount','\x20days\x20ago','\x20credits','Credits','name','\x20\x20Total:\x20\x20\x20','toLocaleDateString','all','lastUsedAt','dim','padEnd','2-digit','(default)','68860EYNIuj','numeric','2MXysWJ','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','toFixed','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','source','Today','Error:\x20','getTime','outputTable','usage','bold','toLocaleTimeString','115HxHhXd','yesterday','max','outputStructured','981dBQoFT','red','short','848432mtunNX','length','Profile','today\x20','\x20\x20Today:\x20\x20\x20','map','entryCount','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','en-CA','96586cRvOTx','en-US'];a11_0x26a2=function(){return _0x1961cd;};return a11_0x26a2();}function formatLastUsed(_0x4d9a15){const _0x3fb268=a11_0x5748;if(!_0x4d9a15)return'never';const _0x23e48c=new Date(_0x4d9a15),_0x23857b=new Date(),_0x59cd5b=_0x23e48c[_0x3fb268(0x13e)]('en-CA'),_0x3a995f=_0x23857b[_0x3fb268(0x13e)](_0x3fb268(0x162));if(_0x59cd5b===_0x3a995f)return _0x3fb268(0x15d)+_0x23e48c[_0x3fb268(0x152)](_0x3fb268(0x164),{'hour':_0x3fb268(0x143),'minute':_0x3fb268(0x143)});const _0x3cb00d=new Date(_0x59cd5b),_0x445ae0=new Date(_0x3a995f),_0x59bb94=Math[_0x3fb268(0x167)]((_0x445ae0['getTime']()-_0x3cb00d[_0x3fb268(0x14e)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x59bb94===0x1)return _0x3fb268(0x154);else return _0x59bb94>0x1&&_0x59bb94<0x7?_0x59bb94+_0x3fb268(0x139):_0x23e48c[_0x3fb268(0x13e)](_0x3fb268(0x164),{'month':_0x3fb268(0x159),'day':_0x3fb268(0x146)});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x4cfb2d(0x13c)]=a11_0x4cfb2d(0x150);['description']=a11_0x4cfb2d(0x12c);async['execute'](_0x2cf5ab){const _0x383d00=a11_0x4cfb2d,{options:_0x538dcb}=_0x2cf5ab,_0x35797b=_0x538dcb[_0x383d00(0x12a)]===_0x383d00(0x12d)||_0x538dcb[_0x383d00(0x12a)]==='jsonl'||_0x538dcb[_0x383d00(0x12d)];try{const [_0xd0df64,_0x280b6b,_0x4cba1d]=await Promise[_0x383d00(0x13f)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x35797b?await this['outputStructured'](_0xd0df64,_0x280b6b,_0x4cba1d,_0x538dcb):this[_0x383d00(0x14f)](_0xd0df64,_0x280b6b,_0x4cba1d),0x0;}catch(_0x419907){const _0x311555=_0x419907 instanceof Error?_0x419907['message']:'Unknown\x20error';return console[_0x383d00(0x137)](a11_0x8d78c3[_0x383d00(0x158)](_0x383d00(0x14d)+_0x311555)),0x1;}}async[a11_0x4cfb2d(0x156)](_0x199cdf,_0x3135b4,_0x3b9dd0,_0x287bdf){const _0x5ef1aa=a11_0x4cfb2d,_0x1d4f3a={'summary':{'todayCredits':_0x3b9dd0[_0x5ef1aa(0x122)],'monthCredits':_0x3b9dd0[_0x5ef1aa(0x166)],'totalCredits':_0x3b9dd0['totalCredits'],'profileCount':_0x3b9dd0[_0x5ef1aa(0x138)]},'profiles':_0x199cdf[_0x5ef1aa(0x15f)](_0x4a3c7b=>({'profile':_0x4a3c7b['profile'],'credits':_0x4a3c7b[_0x5ef1aa(0x130)],'requests':_0x4a3c7b[_0x5ef1aa(0x160)],'lastUsedAt':_0x4a3c7b[_0x5ef1aa(0x140)]})),'sources':_0x3135b4[_0x5ef1aa(0x15f)](_0xf0a33d=>({'source':_0xf0a33d['source'],'credits':_0xf0a33d[_0x5ef1aa(0x130)],'todayCredits':_0xf0a33d['todayCredits'],'monthCredits':_0xf0a33d['monthCredits'],'requests':_0xf0a33d[_0x5ef1aa(0x160)]}))};await handleSDKOutput([_0x1d4f3a],_0x287bdf);}['outputTable'](_0x306811,_0x21377c,_0x16c556){const _0x381368=a11_0x4cfb2d;console[_0x381368(0x132)](a11_0x8d78c3[_0x381368(0x151)](_0x381368(0x161))),console['log'](a11_0x8d78c3[_0x381368(0x141)]('─'[_0x381368(0x124)](0x32))),console[_0x381368(0x132)](_0x381368(0x15e)+a11_0x8d78c3[_0x381368(0x133)](formatCredits(_0x16c556[_0x381368(0x122)]))+_0x381368(0x13a)),console[_0x381368(0x132)](_0x381368(0x12e)+a11_0x8d78c3[_0x381368(0x133)](formatCredits(_0x16c556[_0x381368(0x166)]))+_0x381368(0x13a)),console[_0x381368(0x132)](_0x381368(0x13d)+a11_0x8d78c3[_0x381368(0x133)](formatCredits(_0x16c556[_0x381368(0x12b)]))+_0x381368(0x13a)),console['log']();if(_0x21377c[_0x381368(0x15b)]>0x0){console['log'](a11_0x8d78c3[_0x381368(0x151)](_0x381368(0x127))),console[_0x381368(0x132)](a11_0x8d78c3['dim']('─'[_0x381368(0x124)](0x3c)));const _0x4bd1a3=0xc,_0x490512=0xa,_0x592544=0xa,_0x1c9667=0xa;console[_0x381368(0x132)]('\x20\x20'+_0x381368(0x12f)['padEnd'](_0x4bd1a3)+'\x20\x20'+_0x381368(0x126)['padStart'](_0x490512)+'\x20\x20'+_0x381368(0x14c)[_0x381368(0x125)](_0x592544)+'\x20\x20'+_0x381368(0x165)[_0x381368(0x125)](_0x1c9667));for(const _0xa5c654 of _0x21377c){console[_0x381368(0x132)]('\x20\x20'+_0xa5c654[_0x381368(0x14b)][_0x381368(0x142)](_0x4bd1a3)+'\x20\x20'+a11_0x8d78c3[_0x381368(0x133)](formatCredits(_0xa5c654['credits'])[_0x381368(0x125)](_0x490512))+'\x20\x20'+formatCredits(_0xa5c654['todayCredits'])[_0x381368(0x125)](_0x592544)+'\x20\x20'+formatCredits(_0xa5c654[_0x381368(0x166)])['padStart'](_0x1c9667));}console[_0x381368(0x132)]();}if(_0x306811[_0x381368(0x15b)]===0x0){console['log'](a11_0x8d78c3[_0x381368(0x141)](_0x381368(0x121))),console[_0x381368(0x132)](a11_0x8d78c3['dim'](_0x381368(0x14a)));return;}console['log'](a11_0x8d78c3[_0x381368(0x151)]('Usage\x20by\x20Profile')),console['log'](a11_0x8d78c3[_0x381368(0x141)]('─'[_0x381368(0x124)](0x3c)));const _0x1c98e5=Math[_0x381368(0x155)](0xc,..._0x306811[_0x381368(0x15f)](_0x5a10eb=>_0x5a10eb[_0x381368(0x123)]===_0x381368(0x134)?_0x381368(0x144)[_0x381368(0x15b)]:_0x5a10eb[_0x381368(0x123)][_0x381368(0x15b)])),_0x2f44f8=0xa,_0x4e0dd1=0xa;console[_0x381368(0x132)]('\x20\x20'+_0x381368(0x15c)[_0x381368(0x142)](_0x1c98e5)+'\x20\x20'+_0x381368(0x13b)['padStart'](_0x2f44f8)+'\x20\x20'+_0x381368(0x11f)[_0x381368(0x125)](_0x4e0dd1)+'\x20\x20'+'Last\x20Used');for(const _0x22c6d1 of _0x306811){const _0x194b0a=_0x22c6d1[_0x381368(0x123)]===_0x381368(0x134)?_0x381368(0x144):_0x22c6d1[_0x381368(0x123)],_0x4a5d39=_0x194b0a[_0x381368(0x142)](_0x1c98e5),_0xf0d63c=_0x22c6d1['profile']==='default'?a11_0x8d78c3[_0x381368(0x141)](_0x4a5d39):_0x4a5d39;console[_0x381368(0x132)]('\x20\x20'+_0xf0d63c+'\x20\x20'+a11_0x8d78c3['cyan'](formatCredits(_0x22c6d1[_0x381368(0x130)])[_0x381368(0x125)](_0x2f44f8))+'\x20\x20'+String(_0x22c6d1['entryCount'])[_0x381368(0x125)](_0x4e0dd1)+'\x20\x20'+a11_0x8d78c3[_0x381368(0x141)](formatLastUsed(_0x22c6d1[_0x381368(0x140)])));}console[_0x381368(0x132)](),console[_0x381368(0x132)](a11_0x8d78c3[_0x381368(0x141)](_0x381368(0x148))),console['log']();}}
1
+ const a11_0x33e547=a11_0x35d5;function a11_0x35d5(_0x6e9585,_0x52a894){_0x6e9585=_0x6e9585-0x72;const _0x12305a=a11_0x1230();let _0x35d5c4=_0x12305a[_0x6e9585];return _0x35d5c4;}(function(_0x5ab4ed,_0x527aa7){const _0x488abb=a11_0x35d5,_0x247e01=_0x5ab4ed();while(!![]){try{const _0x3b7f2b=-parseInt(_0x488abb(0x84))/0x1+-parseInt(_0x488abb(0x73))/0x2*(parseInt(_0x488abb(0x98))/0x3)+-parseInt(_0x488abb(0xb1))/0x4*(-parseInt(_0x488abb(0xb3))/0x5)+-parseInt(_0x488abb(0xac))/0x6+parseInt(_0x488abb(0xae))/0x7*(parseInt(_0x488abb(0x78))/0x8)+-parseInt(_0x488abb(0xa8))/0x9*(parseInt(_0x488abb(0xa4))/0xa)+-parseInt(_0x488abb(0xab))/0xb*(-parseInt(_0x488abb(0xa2))/0xc);if(_0x3b7f2b===_0x527aa7)break;else _0x247e01['push'](_0x247e01['shift']());}catch(_0x235946){_0x247e01['push'](_0x247e01['shift']());}}}(a11_0x1230,0xcd489));import a11_0x2ebc2c 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(_0x4e4694){const _0x7cb020=a11_0x35d5;return _0x4e4694[_0x7cb020(0x82)](0x2);}function formatLastUsed(_0x47a511){const _0x4b548c=a11_0x35d5;if(!_0x47a511)return _0x4b548c(0xb0);const _0x1b5db2=new Date(_0x47a511),_0x8045c4=new Date(),_0x2ce33c=_0x1b5db2[_0x4b548c(0x93)](_0x4b548c(0x91)),_0x267be2=_0x8045c4[_0x4b548c(0x93)](_0x4b548c(0x91));if(_0x2ce33c===_0x267be2)return _0x4b548c(0xb6)+_0x1b5db2['toLocaleTimeString']('en-US',{'hour':_0x4b548c(0x8f),'minute':_0x4b548c(0x8f)});const _0x447dde=new Date(_0x2ce33c),_0x783e00=new Date(_0x267be2),_0x259cc9=Math[_0x4b548c(0x92)]((_0x783e00[_0x4b548c(0x81)]()-_0x447dde[_0x4b548c(0x81)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x259cc9===0x1)return _0x4b548c(0xa6);else return _0x259cc9>0x1&&_0x259cc9<0x7?_0x259cc9+_0x4b548c(0x8a):_0x1b5db2[_0x4b548c(0x93)](_0x4b548c(0x94),{'month':'short','day':_0x4b548c(0x8b)});}export class ClaudeUsageCommand extends BaseCommand{['name']='usage';[a11_0x33e547(0x9a)]=a11_0x33e547(0x79);async[a11_0x33e547(0x83)](_0x2344d7){const _0x46c07a=a11_0x33e547,{options:_0x6e06a7}=_0x2344d7,_0x1d40a9=_0x6e06a7[_0x46c07a(0x77)]===_0x46c07a(0xb5)||_0x6e06a7[_0x46c07a(0x77)]===_0x46c07a(0x72)||_0x6e06a7['json'];try{const [_0x2fbcec,_0x69946c,_0x2bd33b]=await Promise[_0x46c07a(0x8e)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x1d40a9?await this[_0x46c07a(0x7f)](_0x2fbcec,_0x69946c,_0x2bd33b,_0x6e06a7):this['outputTable'](_0x2fbcec,_0x69946c,_0x2bd33b),0x0;}catch(_0x1fba43){const _0x110667=_0x1fba43 instanceof Error?_0x1fba43[_0x46c07a(0xaa)]:'Unknown\x20error';return console[_0x46c07a(0x88)](a11_0x2ebc2c['red'](_0x46c07a(0x9f)+_0x110667)),0x1;}}async[a11_0x33e547(0x7f)](_0x31b335,_0x363283,_0x3ed2d6,_0x1735c6){const _0x3bd658=a11_0x33e547,_0x246dee={'summary':{'todayCredits':_0x3ed2d6[_0x3bd658(0xa7)],'monthCredits':_0x3ed2d6[_0x3bd658(0x7d)],'totalCredits':_0x3ed2d6[_0x3bd658(0x89)],'profileCount':_0x3ed2d6['profileCount']},'profiles':_0x31b335[_0x3bd658(0xa0)](_0x4524a1=>({'profile':_0x4524a1[_0x3bd658(0xb7)],'credits':_0x4524a1[_0x3bd658(0x7a)],'requests':_0x4524a1[_0x3bd658(0x97)],'lastUsedAt':_0x4524a1[_0x3bd658(0x99)]})),'sources':_0x363283[_0x3bd658(0xa0)](_0x42f9b4=>({'source':_0x42f9b4['source'],'credits':_0x42f9b4[_0x3bd658(0x7a)],'todayCredits':_0x42f9b4[_0x3bd658(0xa7)],'monthCredits':_0x42f9b4[_0x3bd658(0x7d)],'requests':_0x42f9b4['entryCount']}))};await handleSDKOutput([_0x246dee],_0x1735c6);}[a11_0x33e547(0xa9)](_0x32390f,_0xc6b483,_0x36b92d){const _0x323968=a11_0x33e547;console['log'](a11_0x2ebc2c['bold'](_0x323968(0x8c))),console[_0x323968(0x86)](a11_0x2ebc2c['dim']('─'[_0x323968(0x8d)](0x32))),console[_0x323968(0x86)](_0x323968(0x9d)+a11_0x2ebc2c[_0x323968(0xa1)](formatCredits(_0x36b92d['todayCredits']))+_0x323968(0x9e)),console[_0x323968(0x86)](_0x323968(0x7c)+a11_0x2ebc2c['cyan'](formatCredits(_0x36b92d[_0x323968(0x7d)]))+_0x323968(0x9e)),console[_0x323968(0x86)](_0x323968(0x74)+a11_0x2ebc2c['cyan'](formatCredits(_0x36b92d[_0x323968(0x89)]))+'\x20credits'),console[_0x323968(0x86)]();if(_0xc6b483['length']>0x0){console[_0x323968(0x86)](a11_0x2ebc2c['bold'](_0x323968(0x76))),console[_0x323968(0x86)](a11_0x2ebc2c[_0x323968(0x9c)]('─'['repeat'](0x3c)));const _0x31771e=0xc,_0x56bacb=0xa,_0x1fb165=0xa,_0x4ac62e=0xa;console[_0x323968(0x86)]('\x20\x20'+_0x323968(0x95)[_0x323968(0xa3)](_0x31771e)+'\x20\x20'+_0x323968(0xad)[_0x323968(0xaf)](_0x56bacb)+'\x20\x20'+_0x323968(0x87)['padStart'](_0x1fb165)+'\x20\x20'+_0x323968(0xb8)[_0x323968(0xaf)](_0x4ac62e));for(const _0x4e9652 of _0xc6b483){console[_0x323968(0x86)]('\x20\x20'+_0x4e9652['source']['padEnd'](_0x31771e)+'\x20\x20'+a11_0x2ebc2c['cyan'](formatCredits(_0x4e9652[_0x323968(0x7a)])['padStart'](_0x56bacb))+'\x20\x20'+formatCredits(_0x4e9652[_0x323968(0xa7)])[_0x323968(0xaf)](_0x1fb165)+'\x20\x20'+formatCredits(_0x4e9652[_0x323968(0x7d)])[_0x323968(0xaf)](_0x4ac62e));}console[_0x323968(0x86)]();}if(_0x32390f['length']===0x0){console[_0x323968(0x86)](a11_0x2ebc2c[_0x323968(0x9c)](_0x323968(0x96))),console[_0x323968(0x86)](a11_0x2ebc2c[_0x323968(0x9c)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x323968(0x86)](a11_0x2ebc2c[_0x323968(0x85)]('Usage\x20by\x20Profile')),console[_0x323968(0x86)](a11_0x2ebc2c[_0x323968(0x9c)]('─'[_0x323968(0x8d)](0x3c)));const _0x304e12=Math[_0x323968(0x7e)](0xc,..._0x32390f[_0x323968(0xa0)](_0x2057f1=>_0x2057f1[_0x323968(0xb7)]===_0x323968(0x90)?_0x323968(0xa5)[_0x323968(0xb4)]:_0x2057f1['profile'][_0x323968(0xb4)])),_0x5587cf=0xa,_0xb89a94=0xa;console[_0x323968(0x86)]('\x20\x20'+_0x323968(0xb2)['padEnd'](_0x304e12)+'\x20\x20'+_0x323968(0x7b)[_0x323968(0xaf)](_0x5587cf)+'\x20\x20'+_0x323968(0x75)[_0x323968(0xaf)](_0xb89a94)+'\x20\x20'+_0x323968(0x9b));for(const _0x3baf7f of _0x32390f){const _0x3af10c=_0x3baf7f[_0x323968(0xb7)]===_0x323968(0x90)?'(default)':_0x3baf7f[_0x323968(0xb7)],_0x37d145=_0x3af10c[_0x323968(0xa3)](_0x304e12),_0x1ac5fb=_0x3baf7f['profile']==='default'?a11_0x2ebc2c['dim'](_0x37d145):_0x37d145;console[_0x323968(0x86)]('\x20\x20'+_0x1ac5fb+'\x20\x20'+a11_0x2ebc2c[_0x323968(0xa1)](formatCredits(_0x3baf7f[_0x323968(0x7a)])[_0x323968(0xaf)](_0x5587cf))+'\x20\x20'+String(_0x3baf7f[_0x323968(0x97)])[_0x323968(0xaf)](_0xb89a94)+'\x20\x20'+a11_0x2ebc2c[_0x323968(0x9c)](formatLastUsed(_0x3baf7f[_0x323968(0x99)])));}console['log'](),console[_0x323968(0x86)](a11_0x2ebc2c['dim'](_0x323968(0x80))),console[_0x323968(0x86)]();}}function a11_0x1230(){const _0x3899c3=['lastUsedAt','description','Last\x20Used','dim','\x20\x20Today:\x20\x20\x20','\x20credits','Error:\x20','map','cyan','12RRVvRM','padEnd','68520CKnVmM','(default)','yesterday','todayCredits','477BdWUAP','outputTable','message','26856357ffvewi','3830886oqIpbP','Total','7jDzxCh','padStart','never','13444idkXok','Profile','1415PsLCUy','length','json','today\x20','profile','Month','jsonl','423442bWJFYp','\x20\x20Total:\x20\x20\x20','Requests','Usage\x20by\x20Source','format','3600816KPIBLk','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','credits','Credits','\x20\x20Month:\x20\x20\x20','monthCredits','max','outputStructured','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','getTime','toFixed','execute','1576832fDDrOp','bold','log','Today','error','totalCredits','\x20days\x20ago','numeric','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','repeat','all','2-digit','default','en-CA','round','toLocaleDateString','en-US','Source','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','entryCount','6fgIWGN'];a11_0x1230=function(){return _0x3899c3;};return a11_0x1230();}
@@ -1 +1 @@
1
- const a12_0x106e1c=a12_0x2f99;function a12_0x1b71(){const _0x1e1bf9=['8FTmgvr','stack','\x0aStack\x20trace:\x0a','number','tdx\x20auth','yellow','commands','342549weSyAf','Authentication\x20failed','Invalid\x20limit\x20value:\x20','Command\x20\x27','execute','217lITGMe','validateGlobalOptions','955715pNYOfM','options','test','22whmKmL','category','profile','Authentication\x20error\x20stack\x20trace:','debug','red','23442NITVRQ','1139283NsmHNP','values','has','3099440ncGhvx','helpText','message','14338280zjOfAW','dim','get','status','run','from','Error:\x20','set','name','50WTMwBu','value','command','validate','error','USER_ERROR','\x20--profile\x20','48397UOBdnb','Reason:\x20','\x27\x20is\x20already\x20registered'];a12_0x1b71=function(){return _0x1e1bf9;};return a12_0x1b71();}(function(_0x54a50e,_0x1f7aca){const _0x165afb=a12_0x2f99,_0x554640=_0x54a50e();while(!![]){try{const _0x4e3b69=-parseInt(_0x165afb(0x13b))/0x1*(-parseInt(_0x165afb(0x14f))/0x2)+parseInt(_0x165afb(0x125))/0x3+-parseInt(_0x165afb(0x13e))/0x4*(-parseInt(_0x165afb(0x14c))/0x5)+-parseInt(_0x165afb(0x124))/0x6*(-parseInt(_0x165afb(0x14a))/0x7)+parseInt(_0x165afb(0x128))/0x8+-parseInt(_0x165afb(0x145))/0x9*(parseInt(_0x165afb(0x134))/0xa)+-parseInt(_0x165afb(0x12b))/0xb;if(_0x4e3b69===_0x1f7aca)break;else _0x554640['push'](_0x554640['shift']());}catch(_0x289138){_0x554640['push'](_0x554640['shift']());}}}(a12_0x1b71,0x4b7b8));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';function a12_0x2f99(_0x3ff5be,_0x2a8d07){_0x3ff5be=_0x3ff5be-0x122;const _0x1b7181=a12_0x1b71();let _0x2f99e9=_0x1b7181[_0x3ff5be];return _0x2f99e9;}import a12_0x5b5053 from'chalk';export function printAuthError(_0x25011e,_0x2fd609=![],_0x1eaf80){const _0x2bc3c1=a12_0x2f99,_0x14d99e=_0x25011e['problemDetails']?.['detail']||_0x25011e['message'];console['error'](a12_0x5b5053[_0x2bc3c1(0x123)](_0x2bc3c1(0x146))),console[_0x2bc3c1(0x138)](a12_0x5b5053[_0x2bc3c1(0x123)](_0x2bc3c1(0x13c)+_0x14d99e));if(_0x2fd609){const _0x4bb138=_0x1eaf80?_0x2bc3c1(0x13a)+_0x1eaf80:'';console[_0x2bc3c1(0x138)]('\x0a'+a12_0x5b5053['dim']('To\x20set\x20up\x20authentication:')),console['error']('\x20\x20'+a12_0x5b5053['cyan']('tdx\x20auth\x20setup'+_0x4bb138)+'\x0a'),console[_0x2bc3c1(0x138)](''+a12_0x5b5053[_0x2bc3c1(0x12c)]('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x2bc3c1(0x138)]('\x20\x20'+a12_0x5b5053['cyan'](_0x2bc3c1(0x142)+_0x4bb138));}}export class BaseCommand{[a12_0x106e1c(0x14b)](_0x530d53){const _0x4ea6c7=a12_0x106e1c,{options:_0x1c9cad}=_0x530d53,_0x3c4937=_0x1c9cad['limit'];if(_0x3c4937!==undefined){const _0x63c444=typeof _0x3c4937===_0x4ea6c7(0x141)?_0x3c4937:parseInt(_0x3c4937,0xa);if(isNaN(_0x63c444))return _0x4ea6c7(0x147)+_0x3c4937+'.\x20Must\x20be\x20a\x20number.';const _0x1dfe74=validateLimitOption(_0x63c444);if(!_0x1dfe74['isValid'])return _0x1dfe74[_0x4ea6c7(0x138)];_0x530d53['options']['limit']=_0x1dfe74[_0x4ea6c7(0x135)];}return undefined;}[a12_0x106e1c(0x137)](_0x4e9a1a){return undefined;}async[a12_0x106e1c(0x12f)](_0x5e8ce4){const _0x374a23=a12_0x106e1c;try{const _0xf94071=this[_0x374a23(0x14b)](_0x5e8ce4);if(_0xf94071)return console[_0x374a23(0x138)]('Error:\x20'+_0xf94071),0x1;const _0x76ee88=this[_0x374a23(0x137)](_0x5e8ce4);if(_0x76ee88){const _0x330136=/^\s*(Usage|Note|Warning|Error):/i[_0x374a23(0x14e)](_0x76ee88);return _0x330136?console[_0x374a23(0x138)](_0x76ee88):console[_0x374a23(0x138)](_0x374a23(0x131)+_0x76ee88),0x1;}const _0x29ec68=await this[_0x374a23(0x149)](_0x5e8ce4);return _0x29ec68??0x0;}catch(_0x5db014){if(_0x5db014 instanceof Error){if(_0x5db014 instanceof HTTPClientError&&_0x5db014[_0x374a23(0x12e)]===0x191){const _0x2c5013=_0x5e8ce4[_0x374a23(0x14d)][_0x374a23(0x151)];printAuthError(_0x5db014,!![],_0x2c5013);if(_0x5db014[_0x374a23(0x13f)]){const _0x2294a1=Logger['of'](_0x374a23(0x136));_0x2294a1[_0x374a23(0x122)](_0x374a23(0x152)),_0x2294a1[_0x374a23(0x122)](_0x5db014[_0x374a23(0x13f)]);}return 0x1;}console[_0x374a23(0x138)](a12_0x5b5053[_0x374a23(0x123)](_0x374a23(0x131)+_0x5db014[_0x374a23(0x12a)]));_0x5db014 instanceof SDKError&&_0x5db014[_0x374a23(0x129)]&&console[_0x374a23(0x138)](a12_0x5b5053[_0x374a23(0x143)](_0x5db014[_0x374a23(0x129)]));const _0x2d67d0=_0x5db014 instanceof SDKError&&_0x5db014[_0x374a23(0x150)]===ErrorCategory[_0x374a23(0x139)];_0x5db014['stack']&&!_0x2d67d0&&console['error'](_0x374a23(0x140)+_0x5db014[_0x374a23(0x13f)]);}else console['error']('Error:\x20'+String(_0x5db014));return 0x1;}}}export class CommandRegistry{[a12_0x106e1c(0x144)]=new Map();['register'](_0x43c146){const _0x151e05=a12_0x106e1c;if(this[_0x151e05(0x144)]['has'](_0x43c146[_0x151e05(0x133)]))throw new Error(_0x151e05(0x148)+_0x43c146['name']+_0x151e05(0x13d));this['commands'][_0x151e05(0x132)](_0x43c146[_0x151e05(0x133)],_0x43c146);}[a12_0x106e1c(0x12d)](_0x247b9c){const _0x50e460=a12_0x106e1c;return this[_0x50e460(0x144)]['get'](_0x247b9c);}['getAll'](){const _0x531984=a12_0x106e1c;return Array[_0x531984(0x130)](this[_0x531984(0x144)][_0x531984(0x126)]());}[a12_0x106e1c(0x127)](_0x217858){const _0x320077=a12_0x106e1c;return this[_0x320077(0x144)][_0x320077(0x127)](_0x217858);}}export const registry=new CommandRegistry();
1
+ const a12_0x3a6676=a12_0x3294;function a12_0x4be9(){const _0x5ab7b8=['888809SMXQUt','validate','has','1107yKfkiE','validateGlobalOptions','stack','detail','test','category','Authentication\x20error\x20stack\x20trace:','red','4139165UwuhwI','To\x20check\x20your\x20current\x20auth\x20status:','dim','91XVmfhf','Command\x20\x27','515022ZAhJpW','.\x20Must\x20be\x20a\x20number.','cyan','2239383VEInvl','4ajqSED','values','helpText','commands','from','getAll','7830996dEazZb','get','limit','42830xMFFiZ','problemDetails','profile','\x20--profile\x20','execute','name','message','Reason:\x20','\x0aStack\x20trace:\x0a','yellow','options','debug','number','Error:\x20','error','2811864zOEMEY','2pjKMyM','11olPaVR','tdx\x20auth\x20setup','isValid','value','tdx\x20auth'];a12_0x4be9=function(){return _0x5ab7b8;};return a12_0x4be9();}(function(_0x252978,_0x17c162){const _0x3ab35e=a12_0x3294,_0x3f797a=_0x252978();while(!![]){try{const _0x463342=-parseInt(_0x3ab35e(0x14c))/0x1+-parseInt(_0x3ab35e(0x146))/0x2*(parseInt(_0x3ab35e(0x15f))/0x3)+parseInt(_0x3ab35e(0x160))/0x4*(parseInt(_0x3ab35e(0x157))/0x5)+-parseInt(_0x3ab35e(0x15c))/0x6*(-parseInt(_0x3ab35e(0x15a))/0x7)+parseInt(_0x3ab35e(0x145))/0x8+parseInt(_0x3ab35e(0x14f))/0x9*(-parseInt(_0x3ab35e(0x136))/0xa)+parseInt(_0x3ab35e(0x147))/0xb*(parseInt(_0x3ab35e(0x133))/0xc);if(_0x463342===_0x17c162)break;else _0x3f797a['push'](_0x3f797a['shift']());}catch(_0x52556a){_0x3f797a['push'](_0x3f797a['shift']());}}}(a12_0x4be9,0xbfd25));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';function a12_0x3294(_0x25c187,_0x3754b7){_0x25c187=_0x25c187-0x132;const _0x4be952=a12_0x4be9();let _0x329472=_0x4be952[_0x25c187];return _0x329472;}import{Logger}from'../utils/logger/index.js';import a12_0x117f0f from'chalk';export function printAuthError(_0x307df7,_0x1413cc=![],_0x3233b){const _0x128f6f=a12_0x3294,_0x5a6f32=_0x307df7[_0x128f6f(0x137)]?.[_0x128f6f(0x152)]||_0x307df7[_0x128f6f(0x13c)];console[_0x128f6f(0x144)](a12_0x117f0f['red']('Authentication\x20failed')),console['error'](a12_0x117f0f['red'](_0x128f6f(0x13d)+_0x5a6f32));if(_0x1413cc){const _0xd0677a=_0x3233b?_0x128f6f(0x139)+_0x3233b:'';console[_0x128f6f(0x144)]('\x0a'+a12_0x117f0f[_0x128f6f(0x159)]('To\x20set\x20up\x20authentication:')),console[_0x128f6f(0x144)]('\x20\x20'+a12_0x117f0f[_0x128f6f(0x15e)](_0x128f6f(0x148)+_0xd0677a)+'\x0a'),console['error'](''+a12_0x117f0f[_0x128f6f(0x159)](_0x128f6f(0x158))),console['error']('\x20\x20'+a12_0x117f0f['cyan'](_0x128f6f(0x14b)+_0xd0677a));}}export class BaseCommand{['validateGlobalOptions'](_0x2b5079){const _0x33ab06=a12_0x3294,{options:_0x2e137d}=_0x2b5079,_0x3ce251=_0x2e137d[_0x33ab06(0x135)];if(_0x3ce251!==undefined){const _0x368137=typeof _0x3ce251===_0x33ab06(0x142)?_0x3ce251:parseInt(_0x3ce251,0xa);if(isNaN(_0x368137))return'Invalid\x20limit\x20value:\x20'+_0x3ce251+_0x33ab06(0x15d);const _0x55ca97=validateLimitOption(_0x368137);if(!_0x55ca97[_0x33ab06(0x149)])return _0x55ca97['error'];_0x2b5079['options'][_0x33ab06(0x135)]=_0x55ca97[_0x33ab06(0x14a)];}return undefined;}[a12_0x3a6676(0x14d)](_0x1ada8a){return undefined;}async['run'](_0x1fd11f){const _0x4e66f5=a12_0x3a6676;try{const _0x19a22c=this[_0x4e66f5(0x150)](_0x1fd11f);if(_0x19a22c)return console[_0x4e66f5(0x144)](_0x4e66f5(0x143)+_0x19a22c),0x1;const _0x229707=this['validate'](_0x1fd11f);if(_0x229707){const _0x56820c=/^\s*(Usage|Note|Warning|Error):/i[_0x4e66f5(0x153)](_0x229707);return _0x56820c?console[_0x4e66f5(0x144)](_0x229707):console[_0x4e66f5(0x144)]('Error:\x20'+_0x229707),0x1;}const _0x5d0b4a=await this[_0x4e66f5(0x13a)](_0x1fd11f);return _0x5d0b4a??0x0;}catch(_0x95d3f2){if(_0x95d3f2 instanceof Error){if(_0x95d3f2 instanceof HTTPClientError&&_0x95d3f2['status']===0x191){const _0x190cff=_0x1fd11f[_0x4e66f5(0x140)][_0x4e66f5(0x138)];printAuthError(_0x95d3f2,!![],_0x190cff);if(_0x95d3f2['stack']){const _0x581808=Logger['of']('command');_0x581808['debug'](_0x4e66f5(0x155)),_0x581808[_0x4e66f5(0x141)](_0x95d3f2[_0x4e66f5(0x151)]);}return 0x1;}console['error'](a12_0x117f0f[_0x4e66f5(0x156)]('Error:\x20'+_0x95d3f2['message']));_0x95d3f2 instanceof SDKError&&_0x95d3f2['helpText']&&console['error'](a12_0x117f0f[_0x4e66f5(0x13f)](_0x95d3f2[_0x4e66f5(0x162)]));const _0x591b54=_0x95d3f2 instanceof SDKError&&_0x95d3f2[_0x4e66f5(0x154)]===ErrorCategory['USER_ERROR'];_0x95d3f2[_0x4e66f5(0x151)]&&!_0x591b54&&console[_0x4e66f5(0x144)](_0x4e66f5(0x13e)+_0x95d3f2['stack']);}else console[_0x4e66f5(0x144)](_0x4e66f5(0x143)+String(_0x95d3f2));return 0x1;}}}export class CommandRegistry{[a12_0x3a6676(0x163)]=new Map();['register'](_0x3c1cd8){const _0xc78fa6=a12_0x3a6676;if(this[_0xc78fa6(0x163)][_0xc78fa6(0x14e)](_0x3c1cd8[_0xc78fa6(0x13b)]))throw new Error(_0xc78fa6(0x15b)+_0x3c1cd8[_0xc78fa6(0x13b)]+'\x27\x20is\x20already\x20registered');this[_0xc78fa6(0x163)]['set'](_0x3c1cd8[_0xc78fa6(0x13b)],_0x3c1cd8);}[a12_0x3a6676(0x134)](_0x478fdd){const _0x3d69f8=a12_0x3a6676;return this[_0x3d69f8(0x163)][_0x3d69f8(0x134)](_0x478fdd);}[a12_0x3a6676(0x132)](){const _0x4753e3=a12_0x3a6676;return Array[_0x4753e3(0x164)](this['commands'][_0x4753e3(0x161)]());}[a12_0x3a6676(0x14e)](_0x4169cf){const _0x1fe596=a12_0x3a6676;return this[_0x1fe596(0x163)][_0x1fe596(0x14e)](_0x4169cf);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a13_0x1d2032=a13_0x163d;(function(_0x2e75d8,_0xe62938){const _0x4701af=a13_0x163d,_0x3796f8=_0x2e75d8();while(!![]){try{const _0x202b48=-parseInt(_0x4701af(0x139))/0x1*(-parseInt(_0x4701af(0xd4))/0x2)+parseInt(_0x4701af(0x120))/0x3+parseInt(_0x4701af(0x118))/0x4*(-parseInt(_0x4701af(0xe3))/0x5)+parseInt(_0x4701af(0x10f))/0x6*(-parseInt(_0x4701af(0x11e))/0x7)+-parseInt(_0x4701af(0x10d))/0x8*(parseInt(_0x4701af(0xe7))/0x9)+parseInt(_0x4701af(0x13b))/0xa+parseInt(_0x4701af(0xe0))/0xb*(parseInt(_0x4701af(0x122))/0xc);if(_0x202b48===_0xe62938)break;else _0x3796f8['push'](_0x3796f8['shift']());}catch(_0x380c85){_0x3796f8['push'](_0x3796f8['shift']());}}}(a13_0x8c95,0x72bb0));import{BaseCommand}from'./command.js';function a13_0x163d(_0x3bdbab,_0x120356){_0x3bdbab=_0x3bdbab-0xd2;const _0x8c9572=a13_0x8c95();let _0x163d8b=_0x8c9572[_0x3bdbab];return _0x163d8b;}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_0x214faa from'chalk';function normalizeSchemaForDisplay(_0x4bb342){const _0x221faa=a13_0x163d,_0x5952e0=_0x4bb342['properties']||[],_0x5ac20a=_0x5952e0[_0x221faa(0xf7)](_0x190bc6=>_0x190bc6[_0x221faa(0xd2)]==='legacy_settings'&&_0x190bc6[_0x221faa(0x101)]===_0x221faa(0x115)&&_0x190bc6[_0x221faa(0xe8)]);if(_0x5ac20a?.[_0x221faa(0xe8)]){const _0xf9bb0a=_0x5952e0['filter'](_0xf30eb=>_0xf30eb[_0x221faa(0xd2)]!==_0x221faa(0x137)&&_0xf30eb['name']!==_0x221faa(0xeb));return[..._0xf9bb0a,..._0x5ac20a[_0x221faa(0xe8)]];}return _0x5952e0[_0x221faa(0xdc)](_0x17388c=>_0x17388c['name']!==_0x221faa(0x137));}function a13_0x8c95(){const _0x177e76=['\x0aConnector:\x20','resolve','sort','Site:\x20','hint','\x20\x20\x20\x20','No\x20available\x20fields\x20for\x20this\x20connector','repeat','site','\x0aAvailable\x20fields:','blue','output','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.','legacy','owner','21069JEGMse','limit','5666100WsWkXd','\x0aNo\x20credential\x20settings\x20defined','name','findByName','34NSumuk','execute','\x27...','✔\x20Found\x20','Show\x20when:\x20','Show\x20connection\x20details','List\x20all\x20result\x20output\x20connections','listTypes','filter','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','\x20\x20\x20\x20Options:\x20','error','290818dWtPGM','connection:schema','slice','791855ijhDFB','>=\x20','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','maximum','295875njiIaE','properties','data','\x27\x20as\x20connector\x20type','legacy_settings','Fetching\x20settings\x20for\x20\x27','enumeration','getOutputSchema','getMetadata','criteria','\x20connection','yellow','length','cyan','\x0aConnection:\x20','credential','find','log','validate','\x20connector\x20type','join','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','Options:\x20','Fetching\x20schema\x20for\x20\x27','Fetching\x20settings\x20for\x20connector\x20type:\x20','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','type','input','entries','options','\x20\x20\x20\x20Default:\x20','table','connection:types','connection','push','max','description','\x0aNo\x20fields\x20defined\x20in\x20schema','200pZLLou','title','126nBtvbN','value','✔\x20Found\x20schema\x20for\x20connection\x20\x27','\x20[record]','Resolving\x20connector\x20type\x20or\x20name:\x20','Range:\x20','record','map','verbose','8RRsbuZ','dim','Name:\x20','green','✔\x20Found\x20connection:\x20','padStart','155302dVMSNX','Looking\x20up\x20connection:\x20','1069608txRQyH','connection:settings','360PloOKl','\x27\x20(type:\x20','hidden','default_value','minimum','Treating\x20\x27','bold','label'];a13_0x8c95=function(){return _0x177e76;};return a13_0x8c95();}function printSchemaFields(_0x384212,_0x400f55){const _0x388397=a13_0x163d,_0x5c9da7='\x20\x20'[_0x388397(0x131)](_0x400f55+0x1),_0x368a69='\x20\x20'[_0x388397(0x131)](_0x400f55+0x2);for(const _0x59607b of _0x384212){if(!_0x59607b[_0x388397(0xd2)])continue;const _0xaa9362=_0x59607b[_0x388397(0x101)]===_0x388397(0x115)&&_0x59607b[_0x388397(0xe8)]&&_0x59607b[_0x388397(0xe8)][_0x388397(0xf3)]>0x0&&_0x59607b[_0x388397(0xd2)]!==_0x388397(0xeb);let _0x24aaa3=''+_0x5c9da7+a13_0x214faa[_0x388397(0x11b)](_0x59607b['name']);_0x59607b['title']&&(_0x24aaa3+=':\x20'+_0x59607b[_0x388397(0x10e)]);if(_0x59607b['input'])_0x24aaa3+=a13_0x214faa[_0x388397(0x119)]('\x20['+_0x59607b[_0x388397(0x102)]+']');else _0xaa9362&&(_0x24aaa3+=a13_0x214faa[_0x388397(0x119)](_0x388397(0x112)));console[_0x388397(0xf8)](_0x24aaa3);_0x59607b['description']&&console[_0x388397(0xf8)](''+_0x368a69+a13_0x214faa[_0x388397(0x119)](_0x59607b[_0x388397(0x10b)]));if(_0x59607b[_0x388397(0xed)]){const _0x1640c1=_0x59607b[_0x388397(0xed)][_0x388397(0x116)](_0x2401e0=>typeof _0x2401e0==='object'&&_0x388397(0x110)in _0x2401e0?_0x2401e0[_0x388397(0x110)]:_0x2401e0)['join'](',\x20');console[_0x388397(0xf8)](_0x368a69+_0x388397(0xfd)+a13_0x214faa[_0x388397(0xf2)](_0x1640c1));}_0x59607b[_0x388397(0x125)]!==undefined&&console[_0x388397(0xf8)](_0x368a69+'Default:\x20'+a13_0x214faa['blue'](String(_0x59607b['default_value'])));if(_0x59607b[_0x388397(0x126)]!==undefined||_0x59607b['maximum']!==undefined){const _0x29ece6=_0x59607b[_0x388397(0x126)]!==undefined&&_0x59607b[_0x388397(0xe6)]!==undefined?_0x59607b[_0x388397(0x126)]+'\x20-\x20'+_0x59607b[_0x388397(0xe6)]:_0x59607b[_0x388397(0x126)]!==undefined?_0x388397(0xe4)+_0x59607b['minimum']:'<=\x20'+_0x59607b[_0x388397(0xe6)];console[_0x388397(0xf8)](_0x368a69+_0x388397(0x114)+a13_0x214faa[_0x388397(0x134)](_0x29ece6));}if(_0x59607b[_0x388397(0xf0)]){const _0x11dad6=Object[_0x388397(0x103)](_0x59607b[_0x388397(0xf0)])[_0x388397(0x116)](([_0x3da3e3,_0x4b42d9])=>_0x3da3e3+'='+JSON['stringify'](_0x4b42d9))[_0x388397(0xfb)](',\x20');console['log'](''+_0x368a69+a13_0x214faa[_0x388397(0x119)](_0x388397(0xd8)+_0x11dad6));}_0xaa9362&&_0x59607b[_0x388397(0xe8)]&&printSchemaFields(_0x59607b[_0x388397(0xe8)],_0x400f55+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x1d2032(0xd2)]='connection:list';[a13_0x1d2032(0x10b)]=a13_0x1d2032(0xda);async['execute'](_0x50b308){const _0xadb6cf=a13_0x1d2032,{options:_0x55c8dc,tdx:_0x599f88}=_0x50b308;_0x55c8dc['verbose']&&console[_0xadb6cf(0xdf)](_0xadb6cf(0x12d)+_0x55c8dc[_0xadb6cf(0x132)]);const _0x48051b=resolveLimit(_0x55c8dc[_0xadb6cf(0x13a)],DEFAULT_LISTING_LIMIT),_0x1e0ff8=await withSpinner('Listing\x20connections...',()=>_0x599f88[_0xadb6cf(0x108)]['list'](),{'verbose':_0x55c8dc[_0xadb6cf(0x117)]}),_0x277f3b=_0x1e0ff8[_0xadb6cf(0xe9)];console[_0xadb6cf(0xdf)](_0xadb6cf(0xd7)+_0x277f3b[_0xadb6cf(0xf3)]+_0xadb6cf(0xf1)+(_0x277f3b[_0xadb6cf(0xf3)]!==0x1?'s':''));if(isStructuredFormat(_0x55c8dc)){const _0x30cbb1=_0x277f3b[_0xadb6cf(0xe2)](0x0,_0x48051b);await handleSDKOutput(_0x30cbb1,{..._0x55c8dc,'limit':_0x48051b});}else{const _0x577f48=_0x277f3b[_0xadb6cf(0xf3)]>0x0?Math[_0xadb6cf(0x10a)](..._0x277f3b[_0xadb6cf(0x116)](_0x94adc2=>_0x94adc2['type'][_0xadb6cf(0xf3)])):0x0,_0x2be570=[];for(const _0x1cade8 of _0x277f3b){const _0xbb8a13=a13_0x214faa['cyan'](_0x1cade8[_0xadb6cf(0x101)][_0xadb6cf(0x11d)](_0x577f48)),_0x39d84c=_0x1cade8[_0xadb6cf(0x138)]?.[_0xadb6cf(0xd2)]?'\x20-\x20'+a13_0x214faa['dim'](_0x1cade8[_0xadb6cf(0x138)][_0xadb6cf(0xd2)]):'';_0x2be570['push'](_0xbb8a13+'\x20\x20'+_0x1cade8[_0xadb6cf(0xd2)]+_0x39d84c);}await writeOutput(_0x2be570[_0xadb6cf(0xfb)]('\x0a'),_0x55c8dc[_0xadb6cf(0x135)],_0xadb6cf(0x106));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']='connection:show';[a13_0x1d2032(0x10b)]=a13_0x1d2032(0xd9);[a13_0x1d2032(0xf9)](_0x148a55){const _0x1db458=a13_0x1d2032,{args:_0xe88476}=_0x148a55;if(!_0xe88476[0x0])return _0x1db458(0xe5);return undefined;}async[a13_0x1d2032(0xd5)](_0x1c41c1){const _0x8d7102=a13_0x1d2032,{options:_0x58d8c0,args:_0x4e765f,tdx:_0x42104a}=_0x1c41c1,_0x14b596=_0x4e765f[0x0];_0x58d8c0[_0x8d7102(0x117)]&&(console[_0x8d7102(0xdf)](_0x8d7102(0x12d)+_0x58d8c0[_0x8d7102(0x132)]),console[_0x8d7102(0xdf)](_0x8d7102(0x11f)+_0x14b596));const _0x3d3f00=await withSpinner('Fetching\x20connection\x20\x27'+_0x14b596+'\x27...',()=>_0x42104a[_0x8d7102(0x108)][_0x8d7102(0x12b)](_0x14b596),{'verbose':_0x58d8c0[_0x8d7102(0x117)]}),_0x3986d8=_0x3d3f00[_0x8d7102(0xe9)];return console[_0x8d7102(0xdf)](_0x8d7102(0x11c)+_0x3986d8[_0x8d7102(0xd2)]),await handleSingleObjectOutput(_0x3986d8,_0x58d8c0),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x1d2032(0xd2)]=a13_0x1d2032(0xe1);[a13_0x1d2032(0x10b)]=a13_0x1d2032(0xdd);[a13_0x1d2032(0xf9)](_0x27feb9){const {args:_0x1a9010}=_0x27feb9;if(!_0x1a9010[0x0])return'Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.';return undefined;}async[a13_0x1d2032(0xd5)](_0x2c05cd){const _0x189ed6=a13_0x1d2032,{options:_0x291a7a,args:_0x15192a,tdx:_0x2dfee3}=_0x2c05cd,_0x32c430=_0x15192a[0x0];_0x291a7a[_0x189ed6(0x117)]&&(console[_0x189ed6(0xdf)](_0x189ed6(0x12d)+_0x291a7a[_0x189ed6(0x132)]),console['error'](_0x189ed6(0x113)+_0x32c430));let _0x8af9fd=_0x32c430,_0xaf5f0b;try{const _0x20295c=await _0x2dfee3[_0x189ed6(0x108)][_0x189ed6(0xd3)](_0x32c430);_0x20295c&&(_0x8af9fd=_0x20295c[_0x189ed6(0x101)],_0xaf5f0b=_0x20295c[_0x189ed6(0xd2)],_0x291a7a[_0x189ed6(0x117)]&&console['error']('✔\x20Resolved\x20\x27'+_0x32c430+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x8af9fd));}catch{_0x291a7a[_0x189ed6(0x117)]&&console[_0x189ed6(0xdf)](_0x189ed6(0x127)+_0x32c430+_0x189ed6(0xea));}const _0x5e802e=await withSpinner(_0x189ed6(0xfe)+_0x8af9fd+_0x189ed6(0xd6),()=>_0x2dfee3[_0x189ed6(0x108)][_0x189ed6(0xee)](_0x8af9fd),{'verbose':_0x291a7a[_0x189ed6(0x117)]}),_0x2aaff6=_0x5e802e[_0x189ed6(0xe9)];_0xaf5f0b?console['error'](_0x189ed6(0x111)+_0xaf5f0b+_0x189ed6(0x123)+_0x8af9fd+')'):console[_0x189ed6(0xdf)]('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x8af9fd);if(isStructuredFormat(_0x291a7a))await handleSingleObjectOutput(_0x2aaff6,_0x291a7a);else{const _0x16dd00=normalizeSchemaForDisplay(_0x2aaff6);_0xaf5f0b?(console[_0x189ed6(0xf8)](_0x189ed6(0xf5)+a13_0x214faa[_0x189ed6(0xf4)](_0xaf5f0b)),console['log']('Type:\x20'+a13_0x214faa[_0x189ed6(0x119)](_0x8af9fd))):console[_0x189ed6(0xf8)]('\x0aConnector:\x20'+a13_0x214faa['cyan'](_0x8af9fd)),_0x16dd00[_0x189ed6(0xf3)]>0x0?(console[_0x189ed6(0xf8)](a13_0x214faa[_0x189ed6(0x128)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x16dd00,0x0)):console[_0x189ed6(0xf8)](a13_0x214faa[_0x189ed6(0x119)](_0x189ed6(0x10c)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a13_0x1d2032(0x107);[a13_0x1d2032(0x10b)]='List\x20available\x20connector\x20types';async[a13_0x1d2032(0xd5)](_0xe5345d){const _0x5cd9fc=a13_0x1d2032,{options:_0x116420,tdx:_0x24ad9d}=_0xe5345d;_0x116420[_0x5cd9fc(0x117)]&&console[_0x5cd9fc(0xdf)](_0x5cd9fc(0x12d)+_0x116420[_0x5cd9fc(0x132)]);const _0x30c2c3=await withSpinner('Listing\x20connector\x20types...',()=>_0x24ad9d[_0x5cd9fc(0x108)][_0x5cd9fc(0xdb)](),{'verbose':_0x116420[_0x5cd9fc(0x117)]}),_0x4ddc0a=_0x30c2c3['data'][_0x5cd9fc(0x12c)]((_0x32db35,_0x514b51)=>_0x32db35[_0x5cd9fc(0x101)]['localeCompare'](_0x514b51['type']));console['error']('✔\x20Found\x20'+_0x4ddc0a['length']+_0x5cd9fc(0xfa)+(_0x4ddc0a[_0x5cd9fc(0xf3)]!==0x1?'s':''));if(isStructuredFormat(_0x116420))await handleSDKOutput(_0x4ddc0a,_0x116420);else{const _0x526198=_0x4ddc0a[_0x5cd9fc(0xf3)]>0x0?Math['max'](..._0x4ddc0a[_0x5cd9fc(0x116)](_0xad945c=>_0xad945c[_0x5cd9fc(0x101)][_0x5cd9fc(0xf3)])):0x0,_0x42a6a6=[];for(const _0x24daf5 of _0x4ddc0a){const _0x116380=a13_0x214faa[_0x5cd9fc(0xf4)](_0x24daf5['type'][_0x5cd9fc(0x11d)](_0x526198));_0x42a6a6[_0x5cd9fc(0x109)](_0x116380+'\x20\x20'+_0x24daf5[_0x5cd9fc(0xd2)]);}await writeOutput(_0x42a6a6[_0x5cd9fc(0xfb)]('\x0a'),_0x116420[_0x5cd9fc(0x135)],_0x5cd9fc(0x106));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x1d2032(0xd2)]=a13_0x1d2032(0x121);[a13_0x1d2032(0x10b)]=a13_0x1d2032(0xfc);[a13_0x1d2032(0xf9)](_0x367d89){const _0x5c521f=a13_0x1d2032,{args:_0x5681b1}=_0x367d89;if(!_0x5681b1[0x0])return _0x5c521f(0x136);return undefined;}async[a13_0x1d2032(0xd5)](_0x3773f4){const _0x4d607a=a13_0x1d2032,{options:_0x3013d1,args:_0xb5eab0,tdx:_0x42bb54}=_0x3773f4,_0x1b77fb=_0xb5eab0[0x0];_0x3013d1[_0x4d607a(0x117)]&&(console[_0x4d607a(0xdf)]('Site:\x20'+_0x3013d1[_0x4d607a(0x132)]),console['error'](_0x4d607a(0xff)+_0x1b77fb));const _0x4cb19a=await withSpinner(_0x4d607a(0xec)+_0x1b77fb+_0x4d607a(0xd6),()=>_0x42bb54['connection'][_0x4d607a(0xef)](_0x1b77fb),{'verbose':_0x3013d1[_0x4d607a(0x117)]}),_0x263dfa=_0x4cb19a[_0x4d607a(0xe9)];console[_0x4d607a(0xdf)](_0x4d607a(0x100)+_0x1b77fb);if(isStructuredFormat(_0x3013d1))await handleSingleObjectOutput(_0x263dfa,_0x3013d1);else{console[_0x4d607a(0xf8)](_0x4d607a(0x12a)+a13_0x214faa['cyan'](_0x1b77fb)),console[_0x4d607a(0xf8)](_0x4d607a(0x11a)+_0x263dfa[_0x4d607a(0xd2)]);const _0x495304=_0x263dfa['settings']||[],_0x36a67f=_0x495304['filter'](_0x204f6f=>_0x204f6f['credential']);_0x36a67f[_0x4d607a(0xf3)]>0x0&&(console[_0x4d607a(0xf8)](a13_0x214faa[_0x4d607a(0x128)]('\x0aCredential\x20settings:')),printMetadataSettings(_0x36a67f));let _0x29be43=![];try{const _0x274493=await _0x42bb54[_0x4d607a(0x108)][_0x4d607a(0xee)](_0x1b77fb),_0x30a09f=normalizeSchemaForDisplay(_0x274493);_0x30a09f[_0x4d607a(0xf3)]>0x0&&(console[_0x4d607a(0xf8)](a13_0x214faa[_0x4d607a(0x128)](_0x4d607a(0x133))),printSchemaFields(_0x30a09f,0x0),_0x29be43=!![]);}catch{const _0x528b42=_0x495304['filter'](_0x49ff9c=>!_0x49ff9c[_0x4d607a(0xf6)]);_0x528b42[_0x4d607a(0xf3)]>0x0&&(console['log'](a13_0x214faa[_0x4d607a(0x128)]('\x0aAvailable\x20fields:')),printMetadataSettings(_0x528b42),_0x29be43=!![]);}!_0x29be43&&_0x3013d1[_0x4d607a(0x117)]&&console[_0x4d607a(0xdf)](a13_0x214faa[_0x4d607a(0x119)](_0x4d607a(0x130))),_0x36a67f[_0x4d607a(0xf3)]===0x0&&console[_0x4d607a(0xf8)](a13_0x214faa[_0x4d607a(0x119)](_0x4d607a(0x13c)));}return 0x0;}}function printMetadataSettings(_0x5d4a82){const _0x198e78=a13_0x1d2032;for(const _0x1df86e of _0x5d4a82){if(!_0x1df86e[_0x198e78(0xd2)])continue;if(_0x1df86e[_0x198e78(0x124)])continue;let _0x39ea6d='\x20\x20'+a13_0x214faa[_0x198e78(0x11b)](_0x1df86e['name']);_0x1df86e[_0x198e78(0x129)]&&(_0x39ea6d+=':\x20'+_0x1df86e[_0x198e78(0x129)]);_0x1df86e[_0x198e78(0x101)]&&(_0x39ea6d+=a13_0x214faa[_0x198e78(0x119)]('\x20['+_0x1df86e[_0x198e78(0x101)]+']'));console[_0x198e78(0xf8)](_0x39ea6d);_0x1df86e[_0x198e78(0x12e)]&&console[_0x198e78(0xf8)]('\x20\x20\x20\x20'+a13_0x214faa['dim'](_0x1df86e[_0x198e78(0x12e)]));if(_0x1df86e[_0x198e78(0x104)]){const _0x2c9f29=_0x1df86e[_0x198e78(0x104)]['map'](_0x19f715=>_0x19f715[_0x198e78(0x110)])[_0x198e78(0xfb)](',\x20');console[_0x198e78(0xf8)](_0x198e78(0xde)+a13_0x214faa['yellow'](_0x2c9f29));}_0x1df86e[_0x198e78(0x125)]!==undefined&&_0x1df86e['default_value']!==null&&console[_0x198e78(0xf8)](_0x198e78(0x105)+a13_0x214faa[_0x198e78(0x134)](String(_0x1df86e[_0x198e78(0x125)])));if(_0x1df86e[_0x198e78(0xf0)]){const _0x69094f=Object[_0x198e78(0x103)](_0x1df86e[_0x198e78(0xf0)])['map'](([_0x1948d1,_0x2034ac])=>_0x1948d1+'='+JSON['stringify'](_0x2034ac))[_0x198e78(0xfb)](',\x20');console['log'](_0x198e78(0x12f)+a13_0x214faa[_0x198e78(0x119)](_0x198e78(0xd8)+_0x69094f));}}}
1
+ const a13_0x10c2ba=a13_0x207b;(function(_0x46cfe0,_0x4d7600){const _0x3aeae1=a13_0x207b,_0x157089=_0x46cfe0();while(!![]){try{const _0x500ff6=-parseInt(_0x3aeae1(0x20f))/0x1+-parseInt(_0x3aeae1(0x1d5))/0x2+-parseInt(_0x3aeae1(0x1cf))/0x3+-parseInt(_0x3aeae1(0x1e2))/0x4*(parseInt(_0x3aeae1(0x215))/0x5)+parseInt(_0x3aeae1(0x210))/0x6+parseInt(_0x3aeae1(0x1f6))/0x7*(parseInt(_0x3aeae1(0x1d6))/0x8)+parseInt(_0x3aeae1(0x1cc))/0x9;if(_0x500ff6===_0x4d7600)break;else _0x157089['push'](_0x157089['shift']());}catch(_0x392ba4){_0x157089['push'](_0x157089['shift']());}}}(a13_0x1719,0x614fd));import{BaseCommand}from'./command.js';function a13_0x1719(){const _0x469a74=['push','Listing\x20connector\x20types...','join','description','execute','map','padStart','input','type','hint','<=\x20','table','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.','minimum','connection:settings','blue','168CMZfeJ','limit','properties','connection:show','data','Site:\x20','legacy_settings','✔\x20Found\x20','cyan','record','hidden','listTypes','Show\x20connection\x20details','value','entries','error','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','connection','yellow','Fetching\x20settings\x20for\x20connector\x20type:\x20','Type:\x20','\x20[record]','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','505994mGLuhy','2517342vvbcxk','getOutputSchema','default_value','No\x20available\x20fields\x20for\x20this\x20connector','repeat','25DJnQNM','Fetching\x20settings\x20for\x20\x27','stringify','credential','name','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','object','green','resolve','length','\x20\x20\x20\x20Default:\x20','✔\x20Resolved\x20\x27','Looking\x20up\x20connection:\x20','\x0aAvailable\x20fields:','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','site','Treating\x20\x27','Resolving\x20connector\x20type\x20or\x20name:\x20','\x0aNo\x20fields\x20defined\x20in\x20schema','filter','options','\x27...','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','log','verbose','connection:schema','criteria','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','title','\x20\x20\x20\x20Options:\x20','list','localeCompare','connection:list','7214130YfXoNQ','Show\x20when:\x20','Default:\x20','1957683OUeNNn','Fetching\x20schema\x20for\x20\x27','bold','label','Range:\x20','List\x20available\x20connector\x20types','234156ZqvcGT','176160CLxdpK','settings','Options:\x20','\x0aConnector:\x20','Listing\x20connections...','owner','\x0aCredential\x20settings:','>=\x20','dim','findByName','validate','✔\x20Found\x20connection:\x20','60308fAyNeq','\x20-\x20','\x20\x20\x20\x20','Name:\x20'];a13_0x1719=function(){return _0x469a74;};return a13_0x1719();}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_0x5408cd from'chalk';function normalizeSchemaForDisplay(_0x5b8aa5){const _0x588380=a13_0x207b,_0x4e3ed8=_0x5b8aa5[_0x588380(0x1f8)]||[],_0x2bb6a0=_0x4e3ed8['find'](_0x395f33=>_0x395f33[_0x588380(0x219)]===_0x588380(0x1fc)&&_0x395f33[_0x588380(0x1ee)]===_0x588380(0x1ff)&&_0x395f33['properties']);if(_0x2bb6a0?.[_0x588380(0x1f8)]){const _0x5a3f13=_0x4e3ed8[_0x588380(0x228)](_0x44aeaa=>_0x44aeaa[_0x588380(0x219)]!==_0x588380(0x207)&&_0x44aeaa['name']!==_0x588380(0x1fc));return[..._0x5a3f13,..._0x2bb6a0[_0x588380(0x1f8)]];}return _0x4e3ed8[_0x588380(0x228)](_0x90b2ec=>_0x90b2ec[_0x588380(0x219)]!=='legacy');}function printSchemaFields(_0x2f9c57,_0x17f9ab){const _0x348c46=a13_0x207b,_0x639545='\x20\x20'['repeat'](_0x17f9ab+0x1),_0x4515a2='\x20\x20'[_0x348c46(0x214)](_0x17f9ab+0x2);for(const _0x14be4a of _0x2f9c57){if(!_0x14be4a[_0x348c46(0x219)])continue;const _0x1c41e1=_0x14be4a[_0x348c46(0x1ee)]===_0x348c46(0x1ff)&&_0x14be4a[_0x348c46(0x1f8)]&&_0x14be4a[_0x348c46(0x1f8)]['length']>0x0&&_0x14be4a[_0x348c46(0x219)]!==_0x348c46(0x1fc);let _0x58bf63=''+_0x639545+a13_0x5408cd[_0x348c46(0x21c)](_0x14be4a[_0x348c46(0x219)]);_0x14be4a[_0x348c46(0x231)]&&(_0x58bf63+=':\x20'+_0x14be4a[_0x348c46(0x231)]);if(_0x14be4a[_0x348c46(0x1ed)])_0x58bf63+=a13_0x5408cd[_0x348c46(0x1de)]('\x20['+_0x14be4a[_0x348c46(0x1ed)]+']');else _0x1c41e1&&(_0x58bf63+=a13_0x5408cd[_0x348c46(0x1de)](_0x348c46(0x20c)));console[_0x348c46(0x22c)](_0x58bf63);_0x14be4a[_0x348c46(0x1e9)]&&console[_0x348c46(0x22c)](''+_0x4515a2+a13_0x5408cd[_0x348c46(0x1de)](_0x14be4a['description']));if(_0x14be4a['enumeration']){const _0x447531=_0x14be4a['enumeration'][_0x348c46(0x1eb)](_0x4e4113=>typeof _0x4e4113===_0x348c46(0x21b)&&_0x348c46(0x203)in _0x4e4113?_0x4e4113[_0x348c46(0x203)]:_0x4e4113)['join'](',\x20');console[_0x348c46(0x22c)](_0x4515a2+_0x348c46(0x1d8)+a13_0x5408cd[_0x348c46(0x209)](_0x447531));}_0x14be4a[_0x348c46(0x212)]!==undefined&&console[_0x348c46(0x22c)](_0x4515a2+_0x348c46(0x1ce)+a13_0x5408cd['blue'](String(_0x14be4a[_0x348c46(0x212)])));if(_0x14be4a[_0x348c46(0x1f3)]!==undefined||_0x14be4a['maximum']!==undefined){const _0x1a5794=_0x14be4a['minimum']!==undefined&&_0x14be4a[_0x348c46(0x20e)]!==undefined?_0x14be4a[_0x348c46(0x1f3)]+_0x348c46(0x1e3)+_0x14be4a[_0x348c46(0x20e)]:_0x14be4a['minimum']!==undefined?_0x348c46(0x1dd)+_0x14be4a[_0x348c46(0x1f3)]:_0x348c46(0x1f0)+_0x14be4a['maximum'];console[_0x348c46(0x22c)](_0x4515a2+_0x348c46(0x1d3)+a13_0x5408cd[_0x348c46(0x1f5)](_0x1a5794));}if(_0x14be4a[_0x348c46(0x22f)]){const _0x10022b=Object['entries'](_0x14be4a['criteria'])[_0x348c46(0x1eb)](([_0x5656fd,_0x55004c])=>_0x5656fd+'='+JSON[_0x348c46(0x217)](_0x55004c))['join'](',\x20');console[_0x348c46(0x22c)](''+_0x4515a2+a13_0x5408cd[_0x348c46(0x1de)](_0x348c46(0x1cd)+_0x10022b));}_0x1c41e1&&_0x14be4a[_0x348c46(0x1f8)]&&printSchemaFields(_0x14be4a[_0x348c46(0x1f8)],_0x17f9ab+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x10c2ba(0x219)]=a13_0x10c2ba(0x1cb);[a13_0x10c2ba(0x1e9)]='List\x20all\x20result\x20output\x20connections';async[a13_0x10c2ba(0x1ea)](_0x119b93){const _0x4609ba=a13_0x10c2ba,{options:_0x19bc88,tdx:_0x4fa793}=_0x119b93;_0x19bc88['verbose']&&console['error'](_0x4609ba(0x1fb)+_0x19bc88[_0x4609ba(0x224)]);const _0x4bacea=resolveLimit(_0x19bc88[_0x4609ba(0x1f7)],DEFAULT_LISTING_LIMIT),_0x373aa6=await withSpinner(_0x4609ba(0x1da),()=>_0x4fa793[_0x4609ba(0x208)][_0x4609ba(0x1c9)](),{'verbose':_0x19bc88[_0x4609ba(0x22d)]}),_0x3e360c=_0x373aa6['data'];console[_0x4609ba(0x205)](_0x4609ba(0x1fd)+_0x3e360c[_0x4609ba(0x21e)]+'\x20connection'+(_0x3e360c['length']!==0x1?'s':''));if(isStructuredFormat(_0x19bc88)){const _0x29de29=_0x3e360c['slice'](0x0,_0x4bacea);await handleSDKOutput(_0x29de29,{..._0x19bc88,'limit':_0x4bacea});}else{const _0x2e8330=_0x3e360c[_0x4609ba(0x21e)]>0x0?Math['max'](..._0x3e360c[_0x4609ba(0x1eb)](_0x21535d=>_0x21535d[_0x4609ba(0x1ee)][_0x4609ba(0x21e)])):0x0,_0x4938cc=[];for(const _0x2ad908 of _0x3e360c){const _0x3ffd7e=a13_0x5408cd[_0x4609ba(0x1fe)](_0x2ad908[_0x4609ba(0x1ee)][_0x4609ba(0x1ec)](_0x2e8330)),_0x3cd10e=_0x2ad908[_0x4609ba(0x1db)]?.[_0x4609ba(0x219)]?_0x4609ba(0x1e3)+a13_0x5408cd['dim'](_0x2ad908['owner'][_0x4609ba(0x219)]):'';_0x4938cc['push'](_0x3ffd7e+'\x20\x20'+_0x2ad908[_0x4609ba(0x219)]+_0x3cd10e);}await writeOutput(_0x4938cc[_0x4609ba(0x1e8)]('\x0a'),_0x19bc88['output'],_0x4609ba(0x1f1));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x10c2ba(0x219)]=a13_0x10c2ba(0x1f9);['description']=a13_0x10c2ba(0x202);['validate'](_0x3d3be4){const _0x593f63=a13_0x10c2ba,{args:_0x5a8c71}=_0x3d3be4;if(!_0x5a8c71[0x0])return _0x593f63(0x206);return undefined;}async[a13_0x10c2ba(0x1ea)](_0x39cf39){const _0xe1206c=a13_0x10c2ba,{options:_0x21cce6,args:_0x1dcdaa,tdx:_0x3325ad}=_0x39cf39,_0x201afe=_0x1dcdaa[0x0];_0x21cce6[_0xe1206c(0x22d)]&&(console[_0xe1206c(0x205)](_0xe1206c(0x1fb)+_0x21cce6[_0xe1206c(0x224)]),console[_0xe1206c(0x205)](_0xe1206c(0x221)+_0x201afe));const _0x583db4=await withSpinner('Fetching\x20connection\x20\x27'+_0x201afe+_0xe1206c(0x22a),()=>_0x3325ad[_0xe1206c(0x208)][_0xe1206c(0x21d)](_0x201afe),{'verbose':_0x21cce6[_0xe1206c(0x22d)]}),_0x108ca8=_0x583db4['data'];return console[_0xe1206c(0x205)](_0xe1206c(0x1e1)+_0x108ca8[_0xe1206c(0x219)]),await handleSingleObjectOutput(_0x108ca8,_0x21cce6),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x10c2ba(0x219)]=a13_0x10c2ba(0x22e);['description']=a13_0x10c2ba(0x21a);[a13_0x10c2ba(0x1e0)](_0x5ae7af){const _0x5d17fd=a13_0x10c2ba,{args:_0x160c95}=_0x5ae7af;if(!_0x160c95[0x0])return _0x5d17fd(0x1f2);return undefined;}async[a13_0x10c2ba(0x1ea)](_0x4d147a){const _0x3b9ec6=a13_0x10c2ba,{options:_0x1839f1,args:_0x41d8d5,tdx:_0x41186d}=_0x4d147a,_0x5af24d=_0x41d8d5[0x0];_0x1839f1[_0x3b9ec6(0x22d)]&&(console[_0x3b9ec6(0x205)](_0x3b9ec6(0x1fb)+_0x1839f1['site']),console[_0x3b9ec6(0x205)](_0x3b9ec6(0x226)+_0x5af24d));let _0x37a8cd=_0x5af24d,_0x886bc8;try{const _0x358bb1=await _0x41186d[_0x3b9ec6(0x208)][_0x3b9ec6(0x1df)](_0x5af24d);_0x358bb1&&(_0x37a8cd=_0x358bb1[_0x3b9ec6(0x1ee)],_0x886bc8=_0x358bb1[_0x3b9ec6(0x219)],_0x1839f1[_0x3b9ec6(0x22d)]&&console[_0x3b9ec6(0x205)](_0x3b9ec6(0x220)+_0x5af24d+_0x3b9ec6(0x223)+_0x37a8cd));}catch{_0x1839f1[_0x3b9ec6(0x22d)]&&console['error'](_0x3b9ec6(0x225)+_0x5af24d+'\x27\x20as\x20connector\x20type');}const _0x4415f0=await withSpinner(_0x3b9ec6(0x1d0)+_0x37a8cd+'\x27...',()=>_0x41186d[_0x3b9ec6(0x208)][_0x3b9ec6(0x211)](_0x37a8cd),{'verbose':_0x1839f1['verbose']}),_0x545a9d=_0x4415f0['data'];_0x886bc8?console[_0x3b9ec6(0x205)]('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x886bc8+'\x27\x20(type:\x20'+_0x37a8cd+')'):console[_0x3b9ec6(0x205)](_0x3b9ec6(0x22b)+_0x37a8cd);if(isStructuredFormat(_0x1839f1))await handleSingleObjectOutput(_0x545a9d,_0x1839f1);else{const _0x3c870b=normalizeSchemaForDisplay(_0x545a9d);_0x886bc8?(console[_0x3b9ec6(0x22c)]('\x0aConnection:\x20'+a13_0x5408cd['cyan'](_0x886bc8)),console[_0x3b9ec6(0x22c)](_0x3b9ec6(0x20b)+a13_0x5408cd[_0x3b9ec6(0x1de)](_0x37a8cd))):console[_0x3b9ec6(0x22c)](_0x3b9ec6(0x1d9)+a13_0x5408cd[_0x3b9ec6(0x1fe)](_0x37a8cd)),_0x3c870b[_0x3b9ec6(0x21e)]>0x0?(console[_0x3b9ec6(0x22c)](a13_0x5408cd['bold'](_0x3b9ec6(0x222))),printSchemaFields(_0x3c870b,0x0)):console[_0x3b9ec6(0x22c)](a13_0x5408cd[_0x3b9ec6(0x1de)](_0x3b9ec6(0x227)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x10c2ba(0x219)]='connection:types';[a13_0x10c2ba(0x1e9)]=a13_0x10c2ba(0x1d4);async[a13_0x10c2ba(0x1ea)](_0x5b3793){const _0x336bde=a13_0x10c2ba,{options:_0x3031d9,tdx:_0x109fc9}=_0x5b3793;_0x3031d9['verbose']&&console['error'](_0x336bde(0x1fb)+_0x3031d9[_0x336bde(0x224)]);const _0x5870a8=await withSpinner(_0x336bde(0x1e7),()=>_0x109fc9[_0x336bde(0x208)][_0x336bde(0x201)](),{'verbose':_0x3031d9[_0x336bde(0x22d)]}),_0x48e219=_0x5870a8[_0x336bde(0x1fa)]['sort']((_0xc610e,_0xc8b2e)=>_0xc610e[_0x336bde(0x1ee)][_0x336bde(0x1ca)](_0xc8b2e[_0x336bde(0x1ee)]));console[_0x336bde(0x205)](_0x336bde(0x1fd)+_0x48e219['length']+'\x20connector\x20type'+(_0x48e219[_0x336bde(0x21e)]!==0x1?'s':''));if(isStructuredFormat(_0x3031d9))await handleSDKOutput(_0x48e219,_0x3031d9);else{const _0x4a3ff7=_0x48e219[_0x336bde(0x21e)]>0x0?Math['max'](..._0x48e219[_0x336bde(0x1eb)](_0x23f60f=>_0x23f60f['type'][_0x336bde(0x21e)])):0x0,_0x564512=[];for(const _0x2545fa of _0x48e219){const _0xca102d=a13_0x5408cd[_0x336bde(0x1fe)](_0x2545fa[_0x336bde(0x1ee)][_0x336bde(0x1ec)](_0x4a3ff7));_0x564512[_0x336bde(0x1e6)](_0xca102d+'\x20\x20'+_0x2545fa['name']);}await writeOutput(_0x564512['join']('\x0a'),_0x3031d9['output'],_0x336bde(0x1f1));}return 0x0;}}function a13_0x207b(_0x3d422f,_0x53afd1){_0x3d422f=_0x3d422f-0x1c9;const _0x1719a6=a13_0x1719();let _0x207b74=_0x1719a6[_0x3d422f];return _0x207b74;}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x10c2ba(0x219)]=a13_0x10c2ba(0x1f4);[a13_0x10c2ba(0x1e9)]=a13_0x10c2ba(0x230);[a13_0x10c2ba(0x1e0)](_0x17754a){const _0x291dcd=a13_0x10c2ba,{args:_0x8e0e29}=_0x17754a;if(!_0x8e0e29[0x0])return _0x291dcd(0x20d);return undefined;}async[a13_0x10c2ba(0x1ea)](_0x1aa541){const _0x4acbd3=a13_0x10c2ba,{options:_0x4758d1,args:_0x24a6b5,tdx:_0x16af77}=_0x1aa541,_0x409659=_0x24a6b5[0x0];_0x4758d1[_0x4acbd3(0x22d)]&&(console[_0x4acbd3(0x205)](_0x4acbd3(0x1fb)+_0x4758d1[_0x4acbd3(0x224)]),console[_0x4acbd3(0x205)](_0x4acbd3(0x20a)+_0x409659));const _0x385472=await withSpinner(_0x4acbd3(0x216)+_0x409659+_0x4acbd3(0x22a),()=>_0x16af77['connection']['getMetadata'](_0x409659),{'verbose':_0x4758d1['verbose']}),_0x233617=_0x385472['data'];console['error']('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x409659);if(isStructuredFormat(_0x4758d1))await handleSingleObjectOutput(_0x233617,_0x4758d1);else{console[_0x4acbd3(0x22c)](_0x4acbd3(0x1d9)+a13_0x5408cd[_0x4acbd3(0x1fe)](_0x409659)),console['log'](_0x4acbd3(0x1e5)+_0x233617[_0x4acbd3(0x219)]);const _0x3c6e4d=_0x233617[_0x4acbd3(0x1d7)]||[],_0x2fd6cd=_0x3c6e4d[_0x4acbd3(0x228)](_0xe001e1=>_0xe001e1[_0x4acbd3(0x218)]);_0x2fd6cd[_0x4acbd3(0x21e)]>0x0&&(console[_0x4acbd3(0x22c)](a13_0x5408cd[_0x4acbd3(0x1d1)](_0x4acbd3(0x1dc))),printMetadataSettings(_0x2fd6cd));let _0x557b68=![];try{const _0x54e50e=await _0x16af77[_0x4acbd3(0x208)][_0x4acbd3(0x211)](_0x409659),_0x5479ad=normalizeSchemaForDisplay(_0x54e50e);_0x5479ad[_0x4acbd3(0x21e)]>0x0&&(console['log'](a13_0x5408cd['bold'](_0x4acbd3(0x222))),printSchemaFields(_0x5479ad,0x0),_0x557b68=!![]);}catch{const _0x4b84c9=_0x3c6e4d['filter'](_0x3b06ba=>!_0x3b06ba['credential']);_0x4b84c9[_0x4acbd3(0x21e)]>0x0&&(console[_0x4acbd3(0x22c)](a13_0x5408cd['bold'](_0x4acbd3(0x222))),printMetadataSettings(_0x4b84c9),_0x557b68=!![]);}!_0x557b68&&_0x4758d1[_0x4acbd3(0x22d)]&&console[_0x4acbd3(0x205)](a13_0x5408cd['dim'](_0x4acbd3(0x213))),_0x2fd6cd['length']===0x0&&console['log'](a13_0x5408cd[_0x4acbd3(0x1de)]('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function printMetadataSettings(_0x30fe6b){const _0x4d4134=a13_0x10c2ba;for(const _0x541af2 of _0x30fe6b){if(!_0x541af2[_0x4d4134(0x219)])continue;if(_0x541af2[_0x4d4134(0x200)])continue;let _0x3fb3f0='\x20\x20'+a13_0x5408cd[_0x4d4134(0x21c)](_0x541af2[_0x4d4134(0x219)]);_0x541af2[_0x4d4134(0x1d2)]&&(_0x3fb3f0+=':\x20'+_0x541af2[_0x4d4134(0x1d2)]);_0x541af2[_0x4d4134(0x1ee)]&&(_0x3fb3f0+=a13_0x5408cd[_0x4d4134(0x1de)]('\x20['+_0x541af2['type']+']'));console[_0x4d4134(0x22c)](_0x3fb3f0);_0x541af2[_0x4d4134(0x1ef)]&&console['log']('\x20\x20\x20\x20'+a13_0x5408cd[_0x4d4134(0x1de)](_0x541af2[_0x4d4134(0x1ef)]));if(_0x541af2['options']){const _0x35bb4c=_0x541af2[_0x4d4134(0x229)][_0x4d4134(0x1eb)](_0x1dbda9=>_0x1dbda9[_0x4d4134(0x203)])['join'](',\x20');console[_0x4d4134(0x22c)](_0x4d4134(0x232)+a13_0x5408cd[_0x4d4134(0x209)](_0x35bb4c));}_0x541af2[_0x4d4134(0x212)]!==undefined&&_0x541af2['default_value']!==null&&console[_0x4d4134(0x22c)](_0x4d4134(0x21f)+a13_0x5408cd[_0x4d4134(0x1f5)](String(_0x541af2[_0x4d4134(0x212)])));if(_0x541af2[_0x4d4134(0x22f)]){const _0x4bb70a=Object[_0x4d4134(0x204)](_0x541af2[_0x4d4134(0x22f)])['map'](([_0x21157d,_0x2202ad])=>_0x21157d+'='+JSON[_0x4d4134(0x217)](_0x2202ad))['join'](',\x20');console[_0x4d4134(0x22c)](_0x4d4134(0x1e4)+a13_0x5408cd[_0x4d4134(0x1de)](_0x4d4134(0x1cd)+_0x4bb70a));}}}
@@ -1 +1 @@
1
- const a14_0x2a3b87=a14_0x159a;(function(_0x394430,_0x1b5727){const _0x39242d=a14_0x159a,_0x7532f2=_0x394430();while(!![]){try{const _0x21ee75=parseInt(_0x39242d(0x19f))/0x1*(parseInt(_0x39242d(0x19e))/0x2)+parseInt(_0x39242d(0x1a9))/0x3+-parseInt(_0x39242d(0x1a2))/0x4+-parseInt(_0x39242d(0x1a3))/0x5*(parseInt(_0x39242d(0x1b3))/0x6)+parseInt(_0x39242d(0x1a1))/0x7+parseInt(_0x39242d(0x1a8))/0x8+parseInt(_0x39242d(0x1af))/0x9;if(_0x21ee75===_0x1b5727)break;else _0x7532f2['push'](_0x7532f2['shift']());}catch(_0x2d1471){_0x7532f2['push'](_0x7532f2['shift']());}}}(a14_0x2e6f,0xf236e));import{BaseCommand}from'./command.js';function a14_0x2e6f(){const _0x2b81a0=['8765nDZRvP','error','verbose','Site:\x20','query','5754880GelLHM','294477sOTiTx','✔\x20Found\x20','\x20\x20Cause:\x20','listDatabases','\x20database','length','1044513erLahr','cause','name','Listing\x20databases...','4758KfjpPR','Error:\x20','description','Pattern:\x20','47602MjKeFX','2qLASkx','databases','13012699uuQlqg','1831584SfSKWR'];a14_0x2e6f=function(){return _0x2b81a0;};return a14_0x2e6f();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a14_0x159a(_0x4ab5f2,_0xc238dd){_0x4ab5f2=_0x4ab5f2-0x19d;const _0x2e6f96=a14_0x2e6f();let _0x159a92=_0x2e6f96[_0x4ab5f2];return _0x159a92;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0x2a3b87(0x1b1)]=a14_0x2a3b87(0x1a0);[a14_0x2a3b87(0x1b5)]='List\x20all\x20databases';async['execute'](_0x13e580){const _0x3e76e5=a14_0x2a3b87,{options:_0x426953,args:_0x2cea30,tdx:_0x596598}=_0x13e580,_0x392d98=_0x2cea30[0x0];try{_0x426953[_0x3e76e5(0x1a5)]&&(console[_0x3e76e5(0x1a4)](_0x3e76e5(0x1a6)+_0x426953['site']),_0x392d98&&console['error'](_0x3e76e5(0x19d)+_0x392d98));const _0x3cb347=resolveLimit(_0x426953['limit'],DEFAULT_LISTING_LIMIT),_0x16c48b=await withSpinner(_0x3e76e5(0x1b2),()=>_0x596598[_0x3e76e5(0x1a7)][_0x3e76e5(0x1ac)](_0x392d98,_0x3cb347),{'verbose':_0x426953[_0x3e76e5(0x1a5)]}),_0x56f688=_0x16c48b['data'];return console[_0x3e76e5(0x1a4)](_0x3e76e5(0x1aa)+_0x56f688['length']+_0x3e76e5(0x1ad)+(_0x56f688[_0x3e76e5(0x1ae)]!==0x1?'s':'')),await handleSDKOutput(_0x56f688,{..._0x426953,'limit':_0x3cb347}),0x0;}catch(_0x598b53){if(_0x598b53 instanceof SDKError)return console[_0x3e76e5(0x1a4)](_0x3e76e5(0x1b4)+_0x598b53['message']),_0x598b53[_0x3e76e5(0x1b0)]&&console['error'](_0x3e76e5(0x1ab)+_0x598b53[_0x3e76e5(0x1b0)]),0x1;throw _0x598b53;}}}
1
+ const a14_0x5bf343=a14_0x435a;function a14_0x435a(_0x685128,_0x1f4b20){_0x685128=_0x685128-0x1d7;const _0x4d4aa7=a14_0x4d4a();let _0x435a86=_0x4d4aa7[_0x685128];return _0x435a86;}(function(_0xc3e09f,_0x283f9b){const _0x1bf133=a14_0x435a,_0xf55ff=_0xc3e09f();while(!![]){try{const _0x390012=-parseInt(_0x1bf133(0x1d8))/0x1*(parseInt(_0x1bf133(0x1ea))/0x2)+-parseInt(_0x1bf133(0x1e9))/0x3+-parseInt(_0x1bf133(0x1ed))/0x4*(parseInt(_0x1bf133(0x1ec))/0x5)+parseInt(_0x1bf133(0x1f1))/0x6*(parseInt(_0x1bf133(0x1d7))/0x7)+-parseInt(_0x1bf133(0x1e2))/0x8+parseInt(_0x1bf133(0x1eb))/0x9*(-parseInt(_0x1bf133(0x1e1))/0xa)+parseInt(_0x1bf133(0x1e3))/0xb;if(_0x390012===_0x283f9b)break;else _0xf55ff['push'](_0xf55ff['shift']());}catch(_0xec9062){_0xf55ff['push'](_0xf55ff['shift']());}}}(a14_0x4d4a,0x9b0ab));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a14_0x4d4a(){const _0x2d15d0=['548APhnZl','Listing\x20databases...','verbose','List\x20all\x20databases','14340aCtapS','length','\x20\x20Cause:\x20','889qThzuk','1286WvIlNO','execute','✔\x20Found\x20','Error:\x20','message','name','site','listDatabases','data','10WNIIAn','1392000npWJpw','50750194uMOrvH','Site:\x20','description','error','cause','\x20database','2887857tgDsVr','1174PLfaXc','10558017FWuxWW','44435JhMhHt'];a14_0x4d4a=function(){return _0x2d15d0;};return a14_0x4d4a();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0x5bf343(0x1dd)]='databases';[a14_0x5bf343(0x1e5)]=a14_0x5bf343(0x1f0);async[a14_0x5bf343(0x1d9)](_0x5cac80){const _0x419174=a14_0x5bf343,{options:_0x111fe5,args:_0x3c0feb,tdx:_0x773391}=_0x5cac80,_0x30acc1=_0x3c0feb[0x0];try{_0x111fe5['verbose']&&(console[_0x419174(0x1e6)](_0x419174(0x1e4)+_0x111fe5[_0x419174(0x1de)]),_0x30acc1&&console[_0x419174(0x1e6)]('Pattern:\x20'+_0x30acc1));const _0x418e6f=resolveLimit(_0x111fe5['limit'],DEFAULT_LISTING_LIMIT),_0x3186d7=await withSpinner(_0x419174(0x1ee),()=>_0x773391['query'][_0x419174(0x1df)](_0x30acc1,_0x418e6f),{'verbose':_0x111fe5[_0x419174(0x1ef)]}),_0x725454=_0x3186d7[_0x419174(0x1e0)];return console['error'](_0x419174(0x1da)+_0x725454[_0x419174(0x1f2)]+_0x419174(0x1e8)+(_0x725454['length']!==0x1?'s':'')),await handleSDKOutput(_0x725454,{..._0x111fe5,'limit':_0x418e6f}),0x0;}catch(_0x4dea7f){if(_0x4dea7f instanceof SDKError)return console[_0x419174(0x1e6)](_0x419174(0x1db)+_0x4dea7f[_0x419174(0x1dc)]),_0x4dea7f['cause']&&console['error'](_0x419174(0x1f3)+_0x4dea7f[_0x419174(0x1e7)]),0x1;throw _0x4dea7f;}}}
@@ -1 +1 @@
1
- const a15_0x2be8bd=a15_0x2af5;(function(_0xb47b9f,_0x31e275){const _0x4f0083=a15_0x2af5,_0x2200eb=_0xb47b9f();while(!![]){try{const _0x5075f0=-parseInt(_0x4f0083(0x1f4))/0x1+-parseInt(_0x4f0083(0x202))/0x2+-parseInt(_0x4f0083(0x210))/0x3+-parseInt(_0x4f0083(0x209))/0x4+-parseInt(_0x4f0083(0x213))/0x5+-parseInt(_0x4f0083(0x203))/0x6*(parseInt(_0x4f0083(0x1f3))/0x7)+parseInt(_0x4f0083(0x201))/0x8*(parseInt(_0x4f0083(0x217))/0x9);if(_0x5075f0===_0x31e275)break;else _0x2200eb['push'](_0x2200eb['shift']());}catch(_0x12d675){_0x2200eb['push'](_0x2200eb['shift']());}}}(a15_0x6a0e,0x64e7c));function a15_0x2af5(_0x5312c7,_0x19b283){_0x5312c7=_0x5312c7-0x1f3;const _0x6a0eaa=a15_0x6a0e();let _0x2af596=_0x6a0eaa[_0x5312c7];return _0x2af596;}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';export class DescribeCommand extends BaseCommand{[a15_0x2be8bd(0x206)]=a15_0x2be8bd(0x1f7);[a15_0x2be8bd(0x1fb)]=a15_0x2be8bd(0x20c);async[a15_0x2be8bd(0x1fc)](_0x5e5438){return this['describeTable'](_0x5e5438);}async[a15_0x2be8bd(0x208)](_0x330190){const _0x3696a6=a15_0x2be8bd,{options:_0x45ffb1,args:_0x1a6ca6,tdx:_0x5fb6da}=_0x330190;let _0x3634fa;try{_0x3634fa=parseTableReference(_0x1a6ca6[0x0]);const _0x3251fe=_0x45ffb1[_0x3696a6(0x216)];!_0x3634fa['database']&&_0x3251fe&&(_0x3634fa[_0x3696a6(0x216)]=_0x3251fe);const _0x6020e3=validateTableDescribeReference(_0x3634fa);if(_0x6020e3)return console[_0x3696a6(0x212)](_0x3696a6(0x214)+_0x6020e3),0x1;}catch(_0x43832b){return console['error']('Error:\x20'+_0x43832b['message']),0x1;}const _0x1691bd=_0x3634fa[_0x3696a6(0x216)],_0x59817a=_0x3634fa[_0x3696a6(0x20e)];try{_0x45ffb1['verbose']&&(console['error']('Site:\x20'+_0x45ffb1[_0x3696a6(0x1f9)]),console[_0x3696a6(0x212)](_0x3696a6(0x204)+_0x1691bd),console['error'](_0x3696a6(0x218)+_0x59817a));const _0x170eeb=await withSpinner(_0x3696a6(0x1f5)+_0x1691bd+'.'+_0x59817a+'...',()=>_0x5fb6da[_0x3696a6(0x1f8)][_0x3696a6(0x208)](_0x1691bd,_0x59817a),{'verbose':_0x45ffb1[_0x3696a6(0x200)]}),_0x4adaab=_0x170eeb[_0x3696a6(0x20f)];if(_0x4adaab[_0x3696a6(0x1fd)]===0x0)return console[_0x3696a6(0x212)](_0x3696a6(0x1ff)),console[_0x3696a6(0x212)](_0x3696a6(0x1fe)+_0x1691bd+'.'+_0x59817a+_0x3696a6(0x205)),0x1;return console['error']('✔\x20Found\x20'+_0x4adaab[_0x3696a6(0x1fd)]+_0x3696a6(0x20d)+(_0x4adaab[_0x3696a6(0x1fd)]!==0x1?'s':'')+_0x3696a6(0x1f6)+_0x1691bd+'.'+_0x59817a),await handleSDKOutput(_0x4adaab,_0x45ffb1),0x0;}catch(_0x57c3ae){if(_0x57c3ae instanceof SDKError)return console['error'](_0x3696a6(0x214)+_0x57c3ae[_0x3696a6(0x207)]),_0x57c3ae[_0x3696a6(0x1fa)]&&console[_0x3696a6(0x212)]('\x20\x20Cause:\x20'+_0x57c3ae[_0x3696a6(0x1fa)]),0x1;throw _0x57c3ae;}}[a15_0x2be8bd(0x215)](_0x19538c){const _0x20e1b1=a15_0x2be8bd;if(_0x19538c['args'][_0x20e1b1(0x1fd)]===0x0)return _0x20e1b1(0x211);if(_0x19538c[_0x20e1b1(0x20b)][_0x20e1b1(0x1fd)]>0x1)return _0x20e1b1(0x20a);return undefined;}}function a15_0x6a0e(){const _0x27a4cc=['table','data','467508zBpanX','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','error','3616130vRAzVY','Error:\x20','validate','database','170451vDhpbw','Table:\x20','194201xLFLZz','767267SzhZhe','Describing\x20table\x20','\x20in\x20','describe','query','site','cause','description','execute','length','Table\x20\x27','✖\x20Table\x20not\x20found','verbose','1432JlRbWx','538172XTXucP','114rpbeMW','Database:\x20','\x27\x20does\x20not\x20exist','name','message','describeTable','2136964Fwnivh','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','args','Describe\x20table\x20schema','\x20column'];a15_0x6a0e=function(){return _0x27a4cc;};return a15_0x6a0e();}
1
+ const a15_0x312b18=a15_0x68c2;function a15_0x1c67(){const _0x64723b=['name','80gOrCaK','verbose','Error:\x20','95814sMvQbs','✖\x20Table\x20not\x20found','130JTLFuj','561038ygYxbV','length','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','Table:\x20','error','validate','cause','1579920gSydTf','Describing\x20table\x20','36152mjAvyQ','execute','Describe\x20table\x20schema','table','Table\x20\x27','database','\x20in\x20','4566723DimglS','Database:\x20','describeTable','query','description','message','98005jJUmjY','1675509SAsHZg','\x27\x20does\x20not\x20exist','348gbrmnK','describe','369CcPKHV','\x20column','args'];a15_0x1c67=function(){return _0x64723b;};return a15_0x1c67();}(function(_0x43b3f0,_0x2a3ffc){const _0x1a6b8d=a15_0x68c2,_0x3f7c22=_0x43b3f0();while(!![]){try{const _0x4c2fa4=parseInt(_0x1a6b8d(0x19b))/0x1+parseInt(_0x1a6b8d(0x1a2))/0x2+-parseInt(_0x1a6b8d(0x198))/0x3*(parseInt(_0x1a6b8d(0x195))/0x4)+parseInt(_0x1a6b8d(0x1b1))/0x5*(-parseInt(_0x1a6b8d(0x1b4))/0x6)+-parseInt(_0x1a6b8d(0x1ab))/0x7+parseInt(_0x1a6b8d(0x1a4))/0x8*(-parseInt(_0x1a6b8d(0x1b6))/0x9)+parseInt(_0x1a6b8d(0x19a))/0xa*(parseInt(_0x1a6b8d(0x1b2))/0xb);if(_0x4c2fa4===_0x2a3ffc)break;else _0x3f7c22['push'](_0x3f7c22['shift']());}catch(_0x499550){_0x3f7c22['push'](_0x3f7c22['shift']());}}}(a15_0x1c67,0xaf423));import{BaseCommand}from'./command.js';function a15_0x68c2(_0xfbdd06,_0x3a26b5){_0xfbdd06=_0xfbdd06-0x195;const _0x1c67fa=a15_0x1c67();let _0x68c256=_0x1c67fa[_0xfbdd06];return _0x68c256;}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_0x312b18(0x1b9)]=a15_0x312b18(0x1b5);[a15_0x312b18(0x1af)]=a15_0x312b18(0x1a6);async[a15_0x312b18(0x1a5)](_0x382ddb){const _0x54f047=a15_0x312b18;return this[_0x54f047(0x1ad)](_0x382ddb);}async[a15_0x312b18(0x1ad)](_0x3e30dd){const _0x4b6be5=a15_0x312b18,{options:_0x132578,args:_0x339216,tdx:_0xc0a3f6}=_0x3e30dd;let _0x3846c7;try{_0x3846c7=parseTableReference(_0x339216[0x0]);const _0xbdfab6=_0x132578[_0x4b6be5(0x1a9)];!_0x3846c7['database']&&_0xbdfab6&&(_0x3846c7[_0x4b6be5(0x1a9)]=_0xbdfab6);const _0x1c48d5=validateTableDescribeReference(_0x3846c7);if(_0x1c48d5)return console[_0x4b6be5(0x19f)](_0x4b6be5(0x197)+_0x1c48d5),0x1;}catch(_0x1a9f85){return console[_0x4b6be5(0x19f)](_0x4b6be5(0x197)+_0x1a9f85['message']),0x1;}const _0x4a0dfb=_0x3846c7[_0x4b6be5(0x1a9)],_0x5f48c9=_0x3846c7[_0x4b6be5(0x1a7)];try{_0x132578[_0x4b6be5(0x196)]&&(console[_0x4b6be5(0x19f)]('Site:\x20'+_0x132578['site']),console['error'](_0x4b6be5(0x1ac)+_0x4a0dfb),console[_0x4b6be5(0x19f)](_0x4b6be5(0x19e)+_0x5f48c9));const _0x46960f=await withSpinner(_0x4b6be5(0x1a3)+_0x4a0dfb+'.'+_0x5f48c9+'...',()=>_0xc0a3f6[_0x4b6be5(0x1ae)]['describeTable'](_0x4a0dfb,_0x5f48c9),{'verbose':_0x132578[_0x4b6be5(0x196)]}),_0x4b8a81=_0x46960f['data'];if(_0x4b8a81[_0x4b6be5(0x19c)]===0x0)return console[_0x4b6be5(0x19f)](_0x4b6be5(0x199)),console['error'](_0x4b6be5(0x1a8)+_0x4a0dfb+'.'+_0x5f48c9+_0x4b6be5(0x1b3)),0x1;return console[_0x4b6be5(0x19f)]('✔\x20Found\x20'+_0x4b8a81['length']+_0x4b6be5(0x1b7)+(_0x4b8a81[_0x4b6be5(0x19c)]!==0x1?'s':'')+_0x4b6be5(0x1aa)+_0x4a0dfb+'.'+_0x5f48c9),await handleSDKOutput(_0x4b8a81,_0x132578),0x0;}catch(_0x5dfd75){if(_0x5dfd75 instanceof SDKError)return console[_0x4b6be5(0x19f)](_0x4b6be5(0x197)+_0x5dfd75[_0x4b6be5(0x1b0)]),_0x5dfd75[_0x4b6be5(0x1a1)]&&console['error']('\x20\x20Cause:\x20'+_0x5dfd75['cause']),0x1;throw _0x5dfd75;}}[a15_0x312b18(0x1a0)](_0xe56b6a){const _0x591356=a15_0x312b18;if(_0xe56b6a['args'][_0x591356(0x19c)]===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(_0xe56b6a[_0x591356(0x1b8)][_0x591356(0x19c)]>0x1)return _0x591356(0x19d);return undefined;}}
@@ -1 +1 @@
1
- function a16_0x5697(){const _0xd828a7=['Delete\x20a\x20campaign','engage:workspace:update','fromEntries','updateCampaign','Updating\x20template\x20\x27','filter','startAt','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','listTemplates','Deleting\x20campaign\x20\x27','278951TQhElr','engage:campaign:pause','type','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Pause\x20a\x20campaign','plaintext','data','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Update\x20an\x20email\x20template','session','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','verbose','full','\x27\x20deleted\x20successfully','description','engage:templates','segmentName','keys','log','engage:workspace:create','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','segment','resolvePathToResource','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','engage:campaign:create','parentId','getCampaign','error','engage:template:update','createCampaign','resumeCampaign','Fetching\x20templates...','Creating\x20workspace\x20\x27','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','engage:campaign:delete','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','875994pNAhXj','name','Updating\x20workspace\x20\x27','parentName','Show\x20campaign\x20details','Fetching\x20workspaces...','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','status','resolveWorkspaceId','Create\x20a\x20new\x20campaign','Show\x20email\x20template\x20details','List\x20email\x20templates','14930880ZbWwLi','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','\x27\x20paused\x20successfully','launchCampaign','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','timezone','getWorkspace','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','getCampaignFull','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','engage:campaign:show','getTemplate','3981231jtkDXH','yes','Verifying\x20workspace\x20\x27','deleteCampaign','Error:\x20Workspace\x20name\x20is\x20required','\x27?\x20This\x20cannot\x20be\x20undone.','Operation\x20cancelled','Fetching\x20campaign\x20\x27','engage:campaigns','engage:campaign:update','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','\x27...','Deleting\x20template\x20\x27','Launch\x20a\x20campaign','emailSenderId','Fetching\x20template\x20\x27','engage_workspace','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Updating\x20campaign\x20\x27','Launching\x20campaign\x20\x27','2wCOBDE','pauseCampaign','14qUsWhh','workspace','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Resuming\x20campaign\x20\x27','Campaign\x20\x27','deleteWorkspace','createWorkspace','length','7108yaWHWD','MISSING_ARGUMENT','Template\x20\x27','Creating\x20template\x20\x27','engage:campaign:resume','entries','engage:workspace:delete','limit','2016056cBQPWB','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','segmentId','deleteTemplate','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','subject','updateWorkspace','Update\x20a\x20campaign','Update\x20a\x20workspace','804jscVqP','Error:\x20--name\x20is\x20required','\x27\x20launched\x20successfully','Create\x20an\x20email\x20template','getTemplateFull','engage','execute','Fetching\x20workspace\x20\x27','Engage\x20workspace\x20set\x20to:\x20','listWorkspaces','List\x20workspaces','engage:workspace:show','752335kBKhQj','Show\x20workspace\x20details','Create\x20a\x20workspace','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','List\x20campaigns'];a16_0x5697=function(){return _0xd828a7;};return a16_0x5697();}const a16_0x4eefe1=a16_0x391d;(function(_0x358f8a,_0x5856ba){const _0x760f4a=a16_0x391d,_0x217cff=_0x358f8a();while(!![]){try{const _0x12544f=parseInt(_0x760f4a(0x207))/0x1*(parseInt(_0x760f4a(0x25b))/0x2)+parseInt(_0x760f4a(0x1ec))/0x3*(parseInt(_0x760f4a(0x1da))/0x4)+parseInt(_0x760f4a(0x1f8))/0x5+-parseInt(_0x760f4a(0x22c))/0x6*(-parseInt(_0x760f4a(0x25d))/0x7)+parseInt(_0x760f4a(0x1e2))/0x8+parseInt(_0x760f4a(0x246))/0x9+-parseInt(_0x760f4a(0x238))/0xa;if(_0x12544f===_0x5856ba)break;else _0x217cff['push'](_0x217cff['shift']());}catch(_0x46ca62){_0x217cff['push'](_0x217cff['shift']());}}}(a16_0x5697,0x61652));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';function a16_0x391d(_0x3d8bcf,_0x4a5d4d){_0x3d8bcf=_0x3d8bcf-0x1d8;const _0x569771=a16_0x5697();let _0x391dd8=_0x569771[_0x3d8bcf];return _0x391dd8;}import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x43bf68,_0x2e1450,_0x2e9cd3=![]){const _0xe1bc29=a16_0x391d;if(_0x43bf68[_0xe1bc29(0x25e)])return await _0x2e1450[_0xe1bc29(0x1f1)][_0xe1bc29(0x234)](_0x43bf68[_0xe1bc29(0x25e)]);const _0x176a1e=loadSessionContext(_0x43bf68[_0xe1bc29(0x211)]);if(_0x176a1e?.[_0xe1bc29(0x257)])return await _0x2e1450[_0xe1bc29(0x1f1)][_0xe1bc29(0x234)](_0x176a1e['engage_workspace']);if(_0x2e9cd3)throw new SDKError(ErrorCode[_0xe1bc29(0x1db)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':_0xe1bc29(0x21f)});return undefined;}async function resolveSegmentFromOptions(_0x5d0c4e,_0x35c817){const _0x2db710=a16_0x391d;if(!_0x5d0c4e[_0x2db710(0x21d)])return{};const _0x109651=_0x5d0c4e['segment'],_0x403f9d=await _0x35c817['segment'][_0x2db710(0x21e)](_0x109651);return{'audienceId':_0x403f9d[_0x2db710(0x221)],'audienceName':_0x403f9d[_0x2db710(0x22f)],..._0x403f9d[_0x2db710(0x1e4)]&&{'segmentId':_0x403f9d['segmentId'],'segmentName':_0x403f9d[_0x2db710(0x218)]}};}function buildConnectorConfig(_0x9849ac){const _0x12b424=a16_0x391d,_0x15b529=_0x9849ac[_0x12b424(0x255)],_0x176bb8=_0x9849ac['jsonColumns'];if(!_0x15b529&&!_0x176bb8)return undefined;return{..._0x15b529&&{'emailSenderId':_0x15b529},..._0x176bb8&&{'jsonColumns':_0x176bb8}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]=a16_0x4eefe1(0x24e);['description']=a16_0x4eefe1(0x1fc);async['execute'](_0x24a28b){const _0x441ede=a16_0x4eefe1,{options:_0x1625e0,args:_0xa8f9a9,tdx:_0x1744a8}=_0x24a28b,_0x416df1=_0xa8f9a9[0x0],_0x5e9471=resolveLimit(_0x1625e0[_0x441ede(0x1e1)],DEFAULT_LLM_LIMIT),_0x43415b=_0x1625e0,_0x4c4347=_0x43415b[_0x441ede(0x209)],_0x3fdcad=_0x43415b[_0x441ede(0x233)],_0x1ab354=await resolveWorkspaceIdFromOptions(_0x43415b,_0x1744a8),_0x407846=await withSpinner('Fetching\x20campaigns...',()=>_0x1744a8[_0x441ede(0x1f1)]['listCampaigns']({'type':_0x4c4347,'status':_0x3fdcad,'workspaceId':_0x1ab354,'limit':_0x5e9471}),{'verbose':_0x1625e0[_0x441ede(0x213)]});let _0x9698c5=_0x407846[_0x441ede(0x20e)];return _0x416df1&&(_0x9698c5=_0x407846[_0x441ede(0x20e)]['filter'](_0x30eeea=>matchGlobPattern(_0x30eeea[_0x441ede(0x22d)],_0x416df1))),await handleSDKOutput(_0x9698c5,_0x1625e0),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]=a16_0x4eefe1(0x244);[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x230);async[a16_0x4eefe1(0x1f2)](_0x3bf379){const _0x4436ab=a16_0x4eefe1,{options:_0x16b240,args:_0x334276,tdx:_0x1dc6d0}=_0x3bf379;if(_0x334276[_0x4436ab(0x1d9)]===0x0)return console[_0x4436ab(0x223)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x4436ab(0x243)),0x1;const _0x5d4941=_0x334276[0x0],_0xd07eca=_0x16b240,_0x5863e7=await resolveWorkspaceIdFromOptions(_0xd07eca,_0x1dc6d0),_0x7a8675=_0xd07eca[_0x4436ab(0x214)];if(_0x7a8675){const _0x25f095=await withSpinner(_0x4436ab(0x24d)+_0x5d4941+_0x4436ab(0x252),()=>_0x1dc6d0[_0x4436ab(0x1f1)][_0x4436ab(0x241)](_0x5d4941,_0x5863e7),{'verbose':_0x16b240[_0x4436ab(0x213)]});await handleSDKOutput([_0x25f095],_0x16b240);}else{const _0x42fe21=await withSpinner(_0x4436ab(0x24d)+_0x5d4941+'\x27...',()=>_0x1dc6d0['engage'][_0x4436ab(0x222)](_0x5d4941,_0x5863e7),{'verbose':_0x16b240[_0x4436ab(0x213)]});await handleSDKOutput([_0x42fe21],_0x16b240);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]=a16_0x4eefe1(0x220);[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x235);async[a16_0x4eefe1(0x1f2)](_0x2e8c9d){const _0x2ba7df=a16_0x4eefe1,{options:_0x138c7d,tdx:_0x5c7ea0}=_0x2e8c9d,_0x267d80=_0x138c7d,_0x194896=_0x267d80['name'],_0x117b5e=_0x267d80[_0x2ba7df(0x209)];if(!_0x194896)return console['error'](_0x2ba7df(0x1ed)),console[_0x2ba7df(0x223)](_0x2ba7df(0x250)),0x1;if(!_0x117b5e)return console['error']('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0x2ba7df(0x223)](_0x2ba7df(0x250)),0x1;const _0x113c31=await resolveWorkspaceIdFromOptions(_0x267d80,_0x5c7ea0,!![]),_0x4596a8=await resolveSegmentFromOptions(_0x267d80,_0x5c7ea0),_0x25017e=buildConnectorConfig(_0x267d80),_0x1f18c2={'name':_0x194896,'campaignType':_0x117b5e,'workspaceId':_0x113c31,'description':_0x267d80[_0x2ba7df(0x216)],..._0x4596a8,'connectorConfig':_0x25017e,'startAt':_0x267d80[_0x2ba7df(0x203)],'timezone':_0x267d80[_0x2ba7df(0x23e)]},_0x13230a=await withSpinner('Creating\x20campaign\x20\x27'+_0x194896+_0x2ba7df(0x252),()=>_0x5c7ea0[_0x2ba7df(0x1f1)][_0x2ba7df(0x225)](_0x1f18c2));return await handleSDKOutput([_0x13230a[_0x2ba7df(0x20e)]],_0x138c7d),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a16_0x4eefe1(0x24f);['description']=a16_0x4eefe1(0x1ea);async[a16_0x4eefe1(0x1f2)](_0x4f30fe){const _0x3ffec8=a16_0x4eefe1,{options:_0x197173,args:_0x15307c,tdx:_0x1d80b5}=_0x4f30fe;if(_0x15307c[_0x3ffec8(0x1d9)]===0x0)return console[_0x3ffec8(0x223)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x3ffec8(0x223)](_0x3ffec8(0x212)),0x1;const _0x1f4f30=_0x15307c[0x0],_0x5b65b3=_0x197173,_0xdbbb1d=await resolveWorkspaceIdFromOptions(_0x5b65b3,_0x1d80b5),_0x107b2f=await resolveSegmentFromOptions(_0x5b65b3,_0x1d80b5),_0x4d37cc=buildConnectorConfig(_0x5b65b3),_0xf0d7c={'name':_0x5b65b3[_0x3ffec8(0x22d)],'description':_0x5b65b3['description'],..._0x107b2f,'connectorConfig':_0x4d37cc,'startAt':_0x5b65b3[_0x3ffec8(0x203)],'timezone':_0x5b65b3['timezone']},_0x421ab5=Object[_0x3ffec8(0x1ff)](Object['entries'](_0xf0d7c)[_0x3ffec8(0x202)](([,_0x59a128])=>_0x59a128!==undefined));if(Object[_0x3ffec8(0x219)](_0x421ab5)[_0x3ffec8(0x1d9)]===0x0)return console['error'](_0x3ffec8(0x232)),console[_0x3ffec8(0x223)](_0x3ffec8(0x21c)),0x1;const _0x415359=await withSpinner(_0x3ffec8(0x259)+_0x1f4f30+_0x3ffec8(0x252),()=>_0x1d80b5[_0x3ffec8(0x1f1)][_0x3ffec8(0x200)](_0x1f4f30,_0x421ab5,_0xdbbb1d),{'verbose':_0x197173[_0x3ffec8(0x213)]});return await handleSDKOutput([_0x415359[_0x3ffec8(0x20e)]],_0x197173),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]=a16_0x4eefe1(0x22a);[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x1fd);async[a16_0x4eefe1(0x1f2)](_0x30ea16){const _0x4abbe2=a16_0x4eefe1,{options:_0x57cccb,args:_0x1fbd0d,tdx:_0x3b0e01}=_0x30ea16;if(_0x1fbd0d[_0x4abbe2(0x1d9)]===0x0)return console[_0x4abbe2(0x223)](_0x4abbe2(0x242)),console[_0x4abbe2(0x223)](_0x4abbe2(0x258)),0x1;const _0x379916=_0x1fbd0d[0x0],_0x42b277=_0x57cccb,_0x38506b=await resolveWorkspaceIdFromOptions(_0x42b277,_0x3b0e01);if(!_0x57cccb[_0x4abbe2(0x247)]){const _0x467aa6=await confirm(_0x4abbe2(0x240)+_0x379916+_0x4abbe2(0x24b));if(!_0x467aa6)return console[_0x4abbe2(0x21a)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x4abbe2(0x206)+_0x379916+'\x27...',()=>_0x3b0e01[_0x4abbe2(0x1f1)][_0x4abbe2(0x249)](_0x379916,_0x38506b),{'verbose':_0x57cccb[_0x4abbe2(0x213)]}),console[_0x4abbe2(0x21a)](_0x4abbe2(0x261)+_0x379916+_0x4abbe2(0x215)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']='engage:campaign:launch';[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x254);async[a16_0x4eefe1(0x1f2)](_0x49b3df){const _0x4df2ec=a16_0x4eefe1,{options:_0xe99dce,args:_0x48e3ae,tdx:_0x2b6fc8}=_0x49b3df;if(_0x48e3ae['length']===0x0)return console[_0x4df2ec(0x223)](_0x4df2ec(0x242)),console[_0x4df2ec(0x223)](_0x4df2ec(0x1e3)),0x1;const _0x156589=_0x48e3ae[0x0],_0x5be224=_0xe99dce,_0x2d5b86=await resolveWorkspaceIdFromOptions(_0x5be224,_0x2b6fc8);return await withSpinner(_0x4df2ec(0x25a)+_0x156589+'\x27...',()=>_0x2b6fc8[_0x4df2ec(0x1f1)][_0x4df2ec(0x23c)](_0x156589,_0x2d5b86),{'verbose':_0xe99dce['verbose']}),console[_0x4df2ec(0x21a)](_0x4df2ec(0x261)+_0x156589+_0x4df2ec(0x1ee)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a16_0x4eefe1(0x208);['description']=a16_0x4eefe1(0x20c);async[a16_0x4eefe1(0x1f2)](_0x308b6f){const _0xca9699=a16_0x4eefe1,{options:_0x54e604,args:_0x18fc26,tdx:_0x10f482}=_0x308b6f;if(_0x18fc26[_0xca9699(0x1d9)]===0x0)return console[_0xca9699(0x223)](_0xca9699(0x242)),console[_0xca9699(0x223)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x3cab36=_0x18fc26[0x0],_0x225ff2=_0x54e604,_0xbe7b31=await resolveWorkspaceIdFromOptions(_0x225ff2,_0x10f482);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x3cab36+'\x27...',()=>_0x10f482[_0xca9699(0x1f1)][_0xca9699(0x25c)](_0x3cab36,_0xbe7b31),{'verbose':_0x54e604[_0xca9699(0x213)]}),console[_0xca9699(0x21a)](_0xca9699(0x261)+_0x3cab36+_0xca9699(0x23b)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a16_0x4eefe1(0x1de);[a16_0x4eefe1(0x216)]='Resume\x20a\x20paused\x20campaign';async[a16_0x4eefe1(0x1f2)](_0x54a505){const _0x477497=a16_0x4eefe1,{options:_0x416fc3,args:_0x33fd4d,tdx:_0x3b7cf0}=_0x54a505;if(_0x33fd4d[_0x477497(0x1d9)]===0x0)return console[_0x477497(0x223)](_0x477497(0x242)),console[_0x477497(0x223)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x4c3608=_0x33fd4d[0x0],_0xac2099=_0x416fc3,_0xb316b1=await resolveWorkspaceIdFromOptions(_0xac2099,_0x3b7cf0);return await withSpinner(_0x477497(0x260)+_0x4c3608+'\x27...',()=>_0x3b7cf0[_0x477497(0x1f1)][_0x477497(0x226)](_0x4c3608,_0xb316b1),{'verbose':_0x416fc3[_0x477497(0x213)]}),console[_0x477497(0x21a)](_0x477497(0x261)+_0x4c3608+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]='engage:campaign:duplicate';[a16_0x4eefe1(0x216)]='Duplicate\x20a\x20campaign';async[a16_0x4eefe1(0x1f2)](_0x56cf3b){const _0x52f21d=a16_0x4eefe1,{options:_0x50dcac,args:_0x251028,tdx:_0x297844}=_0x56cf3b;if(_0x251028[_0x52f21d(0x1d9)]===0x0)return console[_0x52f21d(0x223)](_0x52f21d(0x242)),console[_0x52f21d(0x223)](_0x52f21d(0x20a)),0x1;const _0x1259ac=_0x251028[0x0],_0x1dc8a9=_0x50dcac,_0x514a39=await resolveWorkspaceIdFromOptions(_0x1dc8a9,_0x297844),_0x56cd3a=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x1259ac+_0x52f21d(0x252),()=>_0x297844[_0x52f21d(0x1f1)]['duplicateCampaign'](_0x1259ac,_0x514a39),{'verbose':_0x50dcac[_0x52f21d(0x213)]});return await handleSDKOutput([_0x56cd3a[_0x52f21d(0x20e)]],_0x50dcac),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]=a16_0x4eefe1(0x217);[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x237);async[a16_0x4eefe1(0x1f2)](_0x1fa86a){const _0x7f949b=a16_0x4eefe1,{options:_0x354957,args:_0x4aa498,tdx:_0x27dfa6}=_0x1fa86a,_0x173e02=_0x4aa498[0x0],_0x2c2551=resolveLimit(_0x354957[_0x7f949b(0x1e1)],DEFAULT_LLM_LIMIT),_0x364105=_0x354957,_0x1922c7=await resolveWorkspaceIdFromOptions(_0x364105,_0x27dfa6),_0x327d5b=await withSpinner(_0x7f949b(0x227),()=>_0x27dfa6[_0x7f949b(0x1f1)][_0x7f949b(0x205)]({'workspaceId':_0x1922c7,'limit':_0x2c2551}),{'verbose':_0x354957['verbose']});let _0x32c2ea=_0x327d5b[_0x7f949b(0x20e)];return _0x173e02&&(_0x32c2ea=_0x327d5b['data'][_0x7f949b(0x202)](_0x270fef=>matchGlobPattern(_0x270fef[_0x7f949b(0x22d)],_0x173e02))),await handleSDKOutput(_0x32c2ea,_0x354957),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]='engage:template:show';[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x236);async[a16_0x4eefe1(0x1f2)](_0x44aee6){const _0x1fd403=a16_0x4eefe1,{options:_0x4b3845,args:_0x5f19c5,tdx:_0x3ff4fa}=_0x44aee6;if(_0x5f19c5[_0x1fd403(0x1d9)]===0x0)return console[_0x1fd403(0x223)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x1fd403(0x223)](_0x1fd403(0x239)),0x1;const _0x36e53f=_0x5f19c5[0x0],_0x393693=_0x4b3845,_0x5072c6=await resolveWorkspaceIdFromOptions(_0x393693,_0x3ff4fa),_0x40311d=_0x393693[_0x1fd403(0x214)];if(_0x40311d){const _0x1cb26a=await withSpinner('Fetching\x20template\x20\x27'+_0x36e53f+'\x27...',()=>_0x3ff4fa[_0x1fd403(0x1f1)][_0x1fd403(0x1f0)](_0x36e53f,_0x5072c6),{'verbose':_0x4b3845['verbose']});await handleSDKOutput([_0x1cb26a],_0x4b3845);}else{const _0x16b96a=await withSpinner(_0x1fd403(0x256)+_0x36e53f+_0x1fd403(0x252),()=>_0x3ff4fa['engage'][_0x1fd403(0x245)](_0x36e53f,_0x5072c6),{'verbose':_0x4b3845[_0x1fd403(0x213)]});await handleSDKOutput([_0x16b96a],_0x4b3845);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]='engage:template:create';[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x1ef);async[a16_0x4eefe1(0x1f2)](_0x584193){const _0x2efa4f=a16_0x4eefe1,{options:_0x2fe489,tdx:_0x45ee57}=_0x584193,_0x2bcad9=_0x2fe489,_0x331c74=_0x2bcad9[_0x2efa4f(0x22d)],_0x5bbf8a=_0x2bcad9[_0x2efa4f(0x1e8)],_0x3a19b9=_0x2bcad9['html'];if(!_0x331c74)return console['error']('Error:\x20--name\x20is\x20required'),console[_0x2efa4f(0x223)](_0x2efa4f(0x23a)),0x1;if(!_0x5bbf8a)return console['error']('Error:\x20--subject\x20is\x20required'),0x1;if(!_0x3a19b9)return console['error']('Error:\x20--html\x20is\x20required'),0x1;const _0xf5fa47=await resolveWorkspaceIdFromOptions(_0x2bcad9,_0x45ee57,!![]),_0x271f6d={'name':_0x331c74,'subjectTemplate':_0x5bbf8a,'htmlTemplate':_0x3a19b9,'workspaceId':_0xf5fa47,'plaintextTemplate':_0x2bcad9[_0x2efa4f(0x20d)],'editorType':_0x2bcad9['editorType']},_0x1e43bd=await withSpinner(_0x2efa4f(0x1dd)+_0x331c74+'\x27...',()=>_0x45ee57['engage']['createTemplate'](_0x271f6d));return await handleSDKOutput([_0x1e43bd[_0x2efa4f(0x20e)]],_0x2fe489),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0x4eefe1(0x224);['description']=a16_0x4eefe1(0x210);async[a16_0x4eefe1(0x1f2)](_0x48dca){const _0x27ba84=a16_0x4eefe1,{options:_0x8169d9,args:_0x33ec42,tdx:_0x3f07ae}=_0x48dca;if(_0x33ec42[_0x27ba84(0x1d9)]===0x0)return console[_0x27ba84(0x223)](_0x27ba84(0x20f)),console[_0x27ba84(0x223)](_0x27ba84(0x22b)),0x1;const _0x244475=_0x33ec42[0x0],_0x34fb07=_0x8169d9,_0x300250=await resolveWorkspaceIdFromOptions(_0x34fb07,_0x3f07ae),_0x2597ab={'name':_0x34fb07[_0x27ba84(0x22d)],'subjectTemplate':_0x34fb07[_0x27ba84(0x1e8)],'htmlTemplate':_0x34fb07['html'],'plaintextTemplate':_0x34fb07['plaintext']},_0x1b4493=Object[_0x27ba84(0x1ff)](Object[_0x27ba84(0x1df)](_0x2597ab)[_0x27ba84(0x202)](([,_0xad82f9])=>_0xad82f9!==undefined));if(Object['keys'](_0x1b4493)[_0x27ba84(0x1d9)]===0x0)return console[_0x27ba84(0x223)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x27ba84(0x223)](_0x27ba84(0x25f)),0x1;const _0x3d03a7=await withSpinner(_0x27ba84(0x201)+_0x244475+_0x27ba84(0x252),()=>_0x3f07ae[_0x27ba84(0x1f1)]['updateTemplate'](_0x244475,_0x1b4493,_0x300250),{'verbose':_0x8169d9[_0x27ba84(0x213)]});return await handleSDKOutput([_0x3d03a7[_0x27ba84(0x20e)]],_0x8169d9),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]='engage:template:delete';['description']='Delete\x20an\x20email\x20template';async[a16_0x4eefe1(0x1f2)](_0xd478d1){const _0x1b537d=a16_0x4eefe1,{options:_0x4596df,args:_0x1d6409,tdx:_0x24635d}=_0xd478d1;if(_0x1d6409[_0x1b537d(0x1d9)]===0x0)return console[_0x1b537d(0x223)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x1b537d(0x204)),0x1;const _0x3a7b3b=_0x1d6409[0x0],_0x7f5d1b=_0x4596df,_0x45eeb9=await resolveWorkspaceIdFromOptions(_0x7f5d1b,_0x24635d);if(!_0x4596df['yes']){const _0x244d5c=await confirm(_0x1b537d(0x23d)+_0x3a7b3b+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x244d5c)return console[_0x1b537d(0x21a)](_0x1b537d(0x24c)),0x0;}return await withSpinner(_0x1b537d(0x253)+_0x3a7b3b+_0x1b537d(0x252),()=>_0x24635d[_0x1b537d(0x1f1)][_0x1b537d(0x1e5)](_0x3a7b3b,_0x45eeb9),{'verbose':_0x4596df[_0x1b537d(0x213)]}),console[_0x1b537d(0x21a)](_0x1b537d(0x1dc)+_0x3a7b3b+_0x1b537d(0x215)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]='engage:workspaces';['description']=a16_0x4eefe1(0x1f6);async[a16_0x4eefe1(0x1f2)](_0x3ac923){const _0x3f494a=a16_0x4eefe1,{options:_0x2a0a8e,args:_0x5ca4de,tdx:_0x21af54}=_0x3ac923,_0x17f87e=_0x5ca4de[0x0],_0x494d0e=resolveLimit(_0x2a0a8e['limit'],DEFAULT_LLM_LIMIT),_0x25ceab=await withSpinner(_0x3f494a(0x231),()=>_0x21af54[_0x3f494a(0x1f1)][_0x3f494a(0x1f5)]({'limit':_0x494d0e}),{'verbose':_0x2a0a8e['verbose']});let _0x13c6b3=_0x25ceab[_0x3f494a(0x20e)];return _0x17f87e&&(_0x13c6b3=_0x25ceab[_0x3f494a(0x20e)]['filter'](_0x4b4d5d=>matchGlobPattern(_0x4b4d5d[_0x3f494a(0x22d)],_0x17f87e))),await handleSDKOutput(_0x13c6b3,_0x2a0a8e),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]=a16_0x4eefe1(0x1f7);[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x1f9);async['execute'](_0xf806c3){const _0x5b01b5=a16_0x4eefe1,{options:_0x425659,args:_0xffc0fd,tdx:_0x1536df}=_0xf806c3;if(_0xffc0fd['length']===0x0)return console[_0x5b01b5(0x223)](_0x5b01b5(0x229)),console[_0x5b01b5(0x223)](_0x5b01b5(0x251)),0x1;const _0x2e49d0=_0xffc0fd[0x0],_0x488e34=_0x425659,_0x5a9059=_0x488e34[_0x5b01b5(0x214)];if(_0x5a9059){const _0x40612b=await withSpinner('Fetching\x20workspace\x20\x27'+_0x2e49d0+'\x27...',()=>_0x1536df['engage']['getWorkspaceFull'](_0x2e49d0),{'verbose':_0x425659[_0x5b01b5(0x213)]});await handleSDKOutput([_0x40612b],_0x425659);}else{const _0x385fc8=await withSpinner(_0x5b01b5(0x1f3)+_0x2e49d0+_0x5b01b5(0x252),()=>_0x1536df['engage'][_0x5b01b5(0x23f)](_0x2e49d0),{'verbose':_0x425659[_0x5b01b5(0x213)]});await handleSDKOutput([_0x385fc8],_0x425659);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a16_0x4eefe1(0x21b);[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x1fa);async['execute'](_0x51c2ad){const _0x148d2c=a16_0x4eefe1,{options:_0x5b1817,tdx:_0xe6c7da}=_0x51c2ad,_0x46d684=_0x5b1817,_0x113a14=_0x46d684[_0x148d2c(0x22d)];if(!_0x113a14)return console[_0x148d2c(0x223)](_0x148d2c(0x1ed)),console[_0x148d2c(0x223)](_0x148d2c(0x1e6)),0x1;const _0x4acfbf={'name':_0x113a14,'description':_0x46d684[_0x148d2c(0x216)]},_0x2c7d3c=await withSpinner(_0x148d2c(0x228)+_0x113a14+_0x148d2c(0x252),()=>_0xe6c7da[_0x148d2c(0x1f1)][_0x148d2c(0x1d8)](_0x4acfbf));return await handleSDKOutput([_0x2c7d3c['data']],_0x5b1817),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]=a16_0x4eefe1(0x1fe);[a16_0x4eefe1(0x216)]=a16_0x4eefe1(0x1eb);async[a16_0x4eefe1(0x1f2)](_0xc8adc){const _0x23c86c=a16_0x4eefe1,{options:_0x298fe4,args:_0x55f43f,tdx:_0x1d140c}=_0xc8adc;if(_0x55f43f[_0x23c86c(0x1d9)]===0x0)return console[_0x23c86c(0x223)](_0x23c86c(0x229)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x1cf6de=_0x55f43f[0x0],_0x5e3c8f=_0x298fe4,_0x586523={'name':_0x5e3c8f[_0x23c86c(0x22d)],'description':_0x5e3c8f[_0x23c86c(0x216)]},_0x24d7d2=Object[_0x23c86c(0x1ff)](Object['entries'](_0x586523)[_0x23c86c(0x202)](([,_0x586a4a])=>_0x586a4a!==undefined));if(Object[_0x23c86c(0x219)](_0x24d7d2)[_0x23c86c(0x1d9)]===0x0)return console[_0x23c86c(0x223)](_0x23c86c(0x232)),console[_0x23c86c(0x223)]('Options:\x20--name,\x20--description'),0x1;const _0x474374=await withSpinner(_0x23c86c(0x22e)+_0x1cf6de+_0x23c86c(0x252),()=>_0x1d140c[_0x23c86c(0x1f1)][_0x23c86c(0x1e9)](_0x1cf6de,_0x24d7d2),{'verbose':_0x298fe4['verbose']});return await handleSDKOutput([_0x474374[_0x23c86c(0x20e)]],_0x298fe4),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x4eefe1(0x22d)]=a16_0x4eefe1(0x1e0);[a16_0x4eefe1(0x216)]='Delete\x20a\x20workspace';async[a16_0x4eefe1(0x1f2)](_0x2d4da5){const _0x3f2524=a16_0x4eefe1,{options:_0x337e00,args:_0x155bd5,tdx:_0xb34233}=_0x2d4da5;if(_0x155bd5[_0x3f2524(0x1d9)]===0x0)return console['error'](_0x3f2524(0x229)),console[_0x3f2524(0x223)](_0x3f2524(0x20b)),0x1;const _0x8d2643=_0x155bd5[0x0];if(!_0x337e00[_0x3f2524(0x247)]){const _0x4e9ac2=await confirm(_0x3f2524(0x1e7)+_0x8d2643+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x4e9ac2)return console['log'](_0x3f2524(0x24c)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x8d2643+'\x27...',()=>_0xb34233['engage'][_0x3f2524(0x262)](_0x8d2643),{'verbose':_0x337e00[_0x3f2524(0x213)]}),console[_0x3f2524(0x21a)]('Workspace\x20\x27'+_0x8d2643+_0x3f2524(0x215)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']='engage:workspace:use';[a16_0x4eefe1(0x216)]='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async[a16_0x4eefe1(0x1f2)](_0x37158e){const _0x571b40=a16_0x4eefe1,{options:_0x4cd6e1,args:_0x2825c3,tdx:_0x268b99}=_0x37158e;if(_0x2825c3[_0x571b40(0x1d9)]===0x0)return console[_0x571b40(0x223)](_0x571b40(0x24a)),console[_0x571b40(0x223)](_0x571b40(0x1fb)),0x1;const _0x29f539=_0x2825c3[0x0];await withSpinner(_0x571b40(0x248)+_0x29f539+_0x571b40(0x252),()=>_0x268b99[_0x571b40(0x1f1)][_0x571b40(0x234)](_0x29f539));const _0x35fdf6=_0x4cd6e1['session']||undefined;return saveSessionContext({'engage_workspace':_0x29f539},_0x35fdf6),console[_0x571b40(0x21a)](_0x571b40(0x1f4)+_0x29f539),console[_0x571b40(0x21a)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
1
+ const a16_0x4c1174=a16_0xcf84;(function(_0x3e1b63,_0x2c3720){const _0x43a7c5=a16_0xcf84,_0x459d10=_0x3e1b63();while(!![]){try{const _0x5e3766=-parseInt(_0x43a7c5(0x155))/0x1*(-parseInt(_0x43a7c5(0x191))/0x2)+parseInt(_0x43a7c5(0x181))/0x3+parseInt(_0x43a7c5(0x125))/0x4*(-parseInt(_0x43a7c5(0x132))/0x5)+parseInt(_0x43a7c5(0x11d))/0x6+-parseInt(_0x43a7c5(0x178))/0x7+-parseInt(_0x43a7c5(0x134))/0x8+parseInt(_0x43a7c5(0x137))/0x9;if(_0x5e3766===_0x2c3720)break;else _0x459d10['push'](_0x459d10['shift']());}catch(_0xfe9f9){_0x459d10['push'](_0x459d10['shift']());}}}(a16_0x5281,0xe3bb0));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';function a16_0xcf84(_0x25b7c4,_0xbb30f1){_0x25b7c4=_0x25b7c4-0x107;const _0x52816a=a16_0x5281();let _0xcf84f7=_0x52816a[_0x25b7c4];return _0xcf84f7;}function a16_0x5281(){const _0x562a4f=['pauseCampaign','engage:template:update','listCampaigns','Delete\x20an\x20email\x20template','Deleting\x20campaign\x20\x27','workspace','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','execute','editorType','Campaign\x20\x27','name','Error:\x20--subject\x20is\x20required','Resume\x20a\x20paused\x20campaign','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','8170608sUksyZ','Error:\x20--name\x20is\x20required','engage:template:create','resolvePathToResource','updateCampaign','Pausing\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','\x27\x20deleted\x20successfully','2172844Gyirnk','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','\x27\x20paused\x20successfully','html','createWorkspace','Verifying\x20workspace\x20\x27','log','engage','engage:workspaces','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','engage:campaign:resume','session','10itEnab','deleteCampaign','10855656xLdhfJ','parentName','Creating\x20template\x20\x27','3218355PRanIL','deleteTemplate','engage:campaign:delete','engage:template:show','startAt','jsonColumns','Fetching\x20workspace\x20\x27','Error:\x20Workspace\x20name\x20is\x20required','Duplicate\x20a\x20campaign','segmentId','Fetching\x20campaign\x20\x27','Updating\x20campaign\x20\x27','segmentName','Fetching\x20templates...','fromEntries','List\x20campaigns','segment','getTemplate','entries','Pause\x20a\x20campaign','yes','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','type','Create\x20a\x20workspace','engage_workspace','Update\x20an\x20email\x20template','timezone','Updating\x20workspace\x20\x27','parentId','Workspace\x20is\x20required\x20for\x20this\x20operation','44KZKeeo','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','getWorkspace','data','\x27?\x20This\x20cannot\x20be\x20undone.','description','keys','launchCampaign','length','resolveWorkspaceId','\x27...','engage:template:delete','duplicateCampaign','Fetching\x20template\x20\x27','emailSenderId','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','full','\x27\x20resumed\x20successfully','Workspace\x20\x27','Updating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','engage:workspace:delete','List\x20email\x20templates','Template\x20\x27','engage:campaign:launch','updateTemplate','engage:workspace:use','Launch\x20a\x20campaign','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:campaign:create','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','resumeCampaign','engage:workspace:show','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','8358098DUNDgM','Options:\x20--name,\x20--description','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','engage:campaign:duplicate','Operation\x20cancelled','Show\x20campaign\x20details','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','subject','Create\x20a\x20new\x20campaign','5385366zzTBRT','limit','getCampaign','engage:campaigns','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','verbose','Update\x20a\x20workspace','Engage\x20workspace\x20set\x20to:\x20','status','error','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Fetching\x20campaigns...','deleteWorkspace','47986CqrBFA','MISSING_ARGUMENT','engage:workspace:update','Duplicating\x20campaign\x20\x27','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','engage:workspace:create','filter','List\x20workspaces','listWorkspaces','Deleting\x20template\x20\x27','\x27\x20launched\x20successfully'];a16_0x5281=function(){return _0x562a4f;};return a16_0x5281();}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(_0x12076b,_0x36dab3,_0x252b8b=![]){const _0x1c86ba=a16_0xcf84;if(_0x12076b['workspace'])return await _0x36dab3[_0x1c86ba(0x12d)][_0x1c86ba(0x15f)](_0x12076b[_0x1c86ba(0x113)]);const _0x3f5914=loadSessionContext(_0x12076b[_0x1c86ba(0x131)]);if(_0x3f5914?.[_0x1c86ba(0x14f)])return await _0x36dab3[_0x1c86ba(0x12d)][_0x1c86ba(0x15f)](_0x3f5914[_0x1c86ba(0x14f)]);if(_0x252b8b)throw new SDKError(ErrorCode[_0x1c86ba(0x192)],_0x1c86ba(0x154),undefined,{'helpText':_0x1c86ba(0x107)});return undefined;}async function resolveSegmentFromOptions(_0x523c47,_0x170554){const _0x36c531=a16_0xcf84;if(!_0x523c47['segment'])return{};const _0x7ff33c=_0x523c47[_0x36c531(0x147)],_0x47c3e3=await _0x170554[_0x36c531(0x147)][_0x36c531(0x120)](_0x7ff33c);return{'audienceId':_0x47c3e3[_0x36c531(0x153)],'audienceName':_0x47c3e3[_0x36c531(0x135)],..._0x47c3e3[_0x36c531(0x140)]&&{'segmentId':_0x47c3e3['segmentId'],'segmentName':_0x47c3e3[_0x36c531(0x143)]}};}function buildConnectorConfig(_0x537e78){const _0x51720d=a16_0xcf84,_0x226e75=_0x537e78[_0x51720d(0x164)],_0x5d8486=_0x537e78[_0x51720d(0x13c)];if(!_0x226e75&&!_0x5d8486)return undefined;return{..._0x226e75&&{'emailSenderId':_0x226e75},..._0x5d8486&&{'jsonColumns':_0x5d8486}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a16_0x4c1174(0x184);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x146);async[a16_0x4c1174(0x116)](_0x220eb8){const _0x56e0ba=a16_0x4c1174,{options:_0x368524,args:_0x1f205a,tdx:_0xfd18c6}=_0x220eb8,_0x22753f=_0x1f205a[0x0],_0x1ff805=resolveLimit(_0x368524[_0x56e0ba(0x182)],DEFAULT_LLM_LIMIT),_0xf6ab0=_0x368524,_0x28f7eb=_0xf6ab0[_0x56e0ba(0x14d)],_0x3e4a4c=_0xf6ab0[_0x56e0ba(0x189)],_0x5f205a=await resolveWorkspaceIdFromOptions(_0xf6ab0,_0xfd18c6),_0x219bd8=await withSpinner(_0x56e0ba(0x18f),()=>_0xfd18c6[_0x56e0ba(0x12d)][_0x56e0ba(0x110)]({'type':_0x28f7eb,'status':_0x3e4a4c,'workspaceId':_0x5f205a,'limit':_0x1ff805}),{'verbose':_0x368524[_0x56e0ba(0x186)]});let _0x334820=_0x219bd8[_0x56e0ba(0x159)];return _0x22753f&&(_0x334820=_0x219bd8['data'][_0x56e0ba(0x109)](_0x3460f9=>matchGlobPattern(_0x3460f9[_0x56e0ba(0x119)],_0x22753f))),await handleSDKOutput(_0x334820,_0x368524),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x4c1174(0x119)]='engage:campaign:show';[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x17d);async[a16_0x4c1174(0x116)](_0x1703ba){const _0x569abd=a16_0x4c1174,{options:_0x453146,args:_0xacc98,tdx:_0x2ac257}=_0x1703ba;if(_0xacc98[_0x569abd(0x15e)]===0x0)return console['error'](_0x569abd(0x18b)),console[_0x569abd(0x18a)](_0x569abd(0x115)),0x1;const _0x3b3968=_0xacc98[0x0],_0xb5834d=_0x453146,_0x20ac9c=await resolveWorkspaceIdFromOptions(_0xb5834d,_0x2ac257),_0x17218d=_0xb5834d['full'];if(_0x17218d){const _0x3ac61b=await withSpinner(_0x569abd(0x141)+_0x3b3968+_0x569abd(0x160),()=>_0x2ac257[_0x569abd(0x12d)]['getCampaignFull'](_0x3b3968,_0x20ac9c),{'verbose':_0x453146[_0x569abd(0x186)]});await handleSDKOutput([_0x3ac61b],_0x453146);}else{const _0x154692=await withSpinner(_0x569abd(0x141)+_0x3b3968+_0x569abd(0x160),()=>_0x2ac257[_0x569abd(0x12d)][_0x569abd(0x183)](_0x3b3968,_0x20ac9c),{'verbose':_0x453146[_0x569abd(0x186)]});await handleSDKOutput([_0x154692],_0x453146);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a16_0x4c1174(0x173);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x180);async[a16_0x4c1174(0x116)](_0x22c6fc){const _0x5a7ea2=a16_0x4c1174,{options:_0x311c85,tdx:_0x17e35b}=_0x22c6fc,_0x672476=_0x311c85,_0x313c42=_0x672476[_0x5a7ea2(0x119)],_0x1bb877=_0x672476[_0x5a7ea2(0x14d)];if(!_0x313c42)return console[_0x5a7ea2(0x18a)](_0x5a7ea2(0x11e)),console[_0x5a7ea2(0x18a)](_0x5a7ea2(0x157)),0x1;if(!_0x1bb877)return console[_0x5a7ea2(0x18a)](_0x5a7ea2(0x18c)),console['error'](_0x5a7ea2(0x157)),0x1;const _0x2264a6=await resolveWorkspaceIdFromOptions(_0x672476,_0x17e35b,!![]),_0x182e97=await resolveSegmentFromOptions(_0x672476,_0x17e35b),_0x45f4b7=buildConnectorConfig(_0x672476),_0x2c2b2b={'name':_0x313c42,'campaignType':_0x1bb877,'workspaceId':_0x2264a6,'description':_0x672476['description'],..._0x182e97,'connectorConfig':_0x45f4b7,'startAt':_0x672476[_0x5a7ea2(0x13b)],'timezone':_0x672476[_0x5a7ea2(0x151)]},_0x433023=await withSpinner('Creating\x20campaign\x20\x27'+_0x313c42+_0x5a7ea2(0x160),()=>_0x17e35b[_0x5a7ea2(0x12d)]['createCampaign'](_0x2c2b2b));return await handleSDKOutput([_0x433023[_0x5a7ea2(0x159)]],_0x311c85),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x4c1174(0x119)]='engage:campaign:update';[a16_0x4c1174(0x15b)]='Update\x20a\x20campaign';async[a16_0x4c1174(0x116)](_0x124987){const _0x1a4b53=a16_0x4c1174,{options:_0x1d9ae2,args:_0x5f251b,tdx:_0x196973}=_0x124987;if(_0x5f251b[_0x1a4b53(0x15e)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x1a4b53(0x18a)](_0x1a4b53(0x18d)),0x1;const _0x36987b=_0x5f251b[0x0],_0x5590cd=_0x1d9ae2,_0x8393fa=await resolveWorkspaceIdFromOptions(_0x5590cd,_0x196973),_0x160b78=await resolveSegmentFromOptions(_0x5590cd,_0x196973),_0x5e441=buildConnectorConfig(_0x5590cd),_0x59ae2f={'name':_0x5590cd[_0x1a4b53(0x119)],'description':_0x5590cd[_0x1a4b53(0x15b)],..._0x160b78,'connectorConfig':_0x5e441,'startAt':_0x5590cd[_0x1a4b53(0x13b)],'timezone':_0x5590cd[_0x1a4b53(0x151)]},_0x12e9c5=Object[_0x1a4b53(0x145)](Object[_0x1a4b53(0x149)](_0x59ae2f)[_0x1a4b53(0x109)](([,_0x578128])=>_0x578128!==undefined));if(Object[_0x1a4b53(0x15c)](_0x12e9c5)[_0x1a4b53(0x15e)]===0x0)return console[_0x1a4b53(0x18a)](_0x1a4b53(0x114)),console[_0x1a4b53(0x18a)](_0x1a4b53(0x12f)),0x1;const _0x473610=await withSpinner(_0x1a4b53(0x142)+_0x36987b+'\x27...',()=>_0x196973[_0x1a4b53(0x12d)][_0x1a4b53(0x121)](_0x36987b,_0x12e9c5,_0x8393fa),{'verbose':_0x1d9ae2[_0x1a4b53(0x186)]});return await handleSDKOutput([_0x473610[_0x1a4b53(0x159)]],_0x1d9ae2),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x139);[a16_0x4c1174(0x15b)]='Delete\x20a\x20campaign';async[a16_0x4c1174(0x116)](_0x3c540f){const _0x140dc8=a16_0x4c1174,{options:_0x480806,args:_0x249644,tdx:_0x4c39cc}=_0x3c540f;if(_0x249644[_0x140dc8(0x15e)]===0x0)return console[_0x140dc8(0x18a)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x140dc8(0x18a)](_0x140dc8(0x126)),0x1;const _0x4c13e7=_0x249644[0x0],_0x49ca58=_0x480806,_0x1700bb=await resolveWorkspaceIdFromOptions(_0x49ca58,_0x4c39cc);if(!_0x480806[_0x140dc8(0x14b)]){const _0x2a6034=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x4c13e7+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x2a6034)return console[_0x140dc8(0x12c)](_0x140dc8(0x17c)),0x0;}return await withSpinner(_0x140dc8(0x112)+_0x4c13e7+_0x140dc8(0x160),()=>_0x4c39cc[_0x140dc8(0x12d)][_0x140dc8(0x133)](_0x4c13e7,_0x1700bb),{'verbose':_0x480806['verbose']}),console[_0x140dc8(0x12c)](_0x140dc8(0x118)+_0x4c13e7+_0x140dc8(0x124)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x16e);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x171);async[a16_0x4c1174(0x116)](_0xb37bae){const _0x499c70=a16_0x4c1174,{options:_0x3f0ee0,args:_0x550886,tdx:_0xbf5967}=_0xb37bae;if(_0x550886[_0x499c70(0x15e)]===0x0)return console[_0x499c70(0x18a)](_0x499c70(0x18b)),console[_0x499c70(0x18a)](_0x499c70(0x174)),0x1;const _0x1c051f=_0x550886[0x0],_0x6d108e=_0x3f0ee0,_0x42fdf5=await resolveWorkspaceIdFromOptions(_0x6d108e,_0xbf5967);return await withSpinner('Launching\x20campaign\x20\x27'+_0x1c051f+_0x499c70(0x160),()=>_0xbf5967[_0x499c70(0x12d)][_0x499c70(0x15d)](_0x1c051f,_0x42fdf5),{'verbose':_0x3f0ee0[_0x499c70(0x186)]}),console[_0x499c70(0x12c)](_0x499c70(0x118)+_0x1c051f+_0x499c70(0x10d)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x4c1174(0x119)]='engage:campaign:pause';[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x14a);async[a16_0x4c1174(0x116)](_0x3fa2dc){const _0x5ad1c4=a16_0x4c1174,{options:_0x45c47e,args:_0x5eba1e,tdx:_0x15a766}=_0x3fa2dc;if(_0x5eba1e[_0x5ad1c4(0x15e)]===0x0)return console[_0x5ad1c4(0x18a)](_0x5ad1c4(0x18b)),console[_0x5ad1c4(0x18a)](_0x5ad1c4(0x185)),0x1;const _0x89cb5f=_0x5eba1e[0x0],_0x2b3dd7=_0x45c47e,_0x105793=await resolveWorkspaceIdFromOptions(_0x2b3dd7,_0x15a766);return await withSpinner(_0x5ad1c4(0x122)+_0x89cb5f+_0x5ad1c4(0x160),()=>_0x15a766['engage'][_0x5ad1c4(0x10e)](_0x89cb5f,_0x105793),{'verbose':_0x45c47e[_0x5ad1c4(0x186)]}),console[_0x5ad1c4(0x12c)](_0x5ad1c4(0x118)+_0x89cb5f+_0x5ad1c4(0x128)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x130);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x11b);async[a16_0x4c1174(0x116)](_0x502f06){const _0xe9aa6a=a16_0x4c1174,{options:_0xe7c731,args:_0xe50141,tdx:_0x3dfc35}=_0x502f06;if(_0xe50141['length']===0x0)return console[_0xe9aa6a(0x18a)](_0xe9aa6a(0x18b)),console['error'](_0xe9aa6a(0x14c)),0x1;const _0x1f68f0=_0xe50141[0x0],_0xd5a786=_0xe7c731,_0x13602f=await resolveWorkspaceIdFromOptions(_0xd5a786,_0x3dfc35);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x1f68f0+_0xe9aa6a(0x160),()=>_0x3dfc35['engage'][_0xe9aa6a(0x175)](_0x1f68f0,_0x13602f),{'verbose':_0xe7c731[_0xe9aa6a(0x186)]}),console[_0xe9aa6a(0x12c)]('Campaign\x20\x27'+_0x1f68f0+_0xe9aa6a(0x167)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x17b);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x13f);async['execute'](_0x3ed2e9){const _0x5faac9=a16_0x4c1174,{options:_0x34de76,args:_0x437a9f,tdx:_0x545424}=_0x3ed2e9;if(_0x437a9f[_0x5faac9(0x15e)]===0x0)return console[_0x5faac9(0x18a)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x5faac9(0x18a)](_0x5faac9(0x123)),0x1;const _0x51936c=_0x437a9f[0x0],_0x546416=_0x34de76,_0x42a8a1=await resolveWorkspaceIdFromOptions(_0x546416,_0x545424),_0x3d58dd=await withSpinner(_0x5faac9(0x194)+_0x51936c+'\x27...',()=>_0x545424['engage'][_0x5faac9(0x162)](_0x51936c,_0x42a8a1),{'verbose':_0x34de76[_0x5faac9(0x186)]});return await handleSDKOutput([_0x3d58dd[_0x5faac9(0x159)]],_0x34de76),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']='engage:templates';[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x16c);async[a16_0x4c1174(0x116)](_0x1c02c8){const _0x2e7757=a16_0x4c1174,{options:_0x25bc97,args:_0x597eb8,tdx:_0x4b459b}=_0x1c02c8,_0x7e0206=_0x597eb8[0x0],_0x1f883e=resolveLimit(_0x25bc97[_0x2e7757(0x182)],DEFAULT_LLM_LIMIT),_0x120ead=_0x25bc97,_0x329104=await resolveWorkspaceIdFromOptions(_0x120ead,_0x4b459b),_0x56b452=await withSpinner(_0x2e7757(0x144),()=>_0x4b459b[_0x2e7757(0x12d)]['listTemplates']({'workspaceId':_0x329104,'limit':_0x1f883e}),{'verbose':_0x25bc97[_0x2e7757(0x186)]});let _0x27fb78=_0x56b452[_0x2e7757(0x159)];return _0x7e0206&&(_0x27fb78=_0x56b452['data'][_0x2e7757(0x109)](_0xd87f53=>matchGlobPattern(_0xd87f53[_0x2e7757(0x119)],_0x7e0206))),await handleSDKOutput(_0x27fb78,_0x25bc97),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x13a);[a16_0x4c1174(0x15b)]='Show\x20email\x20template\x20details';async[a16_0x4c1174(0x116)](_0x211015){const _0x1f31f0=a16_0x4c1174,{options:_0x4044d3,args:_0x2cb907,tdx:_0x338319}=_0x211015;if(_0x2cb907[_0x1f31f0(0x15e)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x1f31f0(0x18a)](_0x1f31f0(0x127)),0x1;const _0x27adba=_0x2cb907[0x0],_0x4357d4=_0x4044d3,_0x34071d=await resolveWorkspaceIdFromOptions(_0x4357d4,_0x338319),_0xf9c8c3=_0x4357d4[_0x1f31f0(0x166)];if(_0xf9c8c3){const _0x3bdf3a=await withSpinner(_0x1f31f0(0x163)+_0x27adba+_0x1f31f0(0x160),()=>_0x338319[_0x1f31f0(0x12d)]['getTemplateFull'](_0x27adba,_0x34071d),{'verbose':_0x4044d3['verbose']});await handleSDKOutput([_0x3bdf3a],_0x4044d3);}else{const _0x434a5c=await withSpinner(_0x1f31f0(0x163)+_0x27adba+_0x1f31f0(0x160),()=>_0x338319[_0x1f31f0(0x12d)][_0x1f31f0(0x148)](_0x27adba,_0x34071d),{'verbose':_0x4044d3[_0x1f31f0(0x186)]});await handleSDKOutput([_0x434a5c],_0x4044d3);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x11f);[a16_0x4c1174(0x15b)]='Create\x20an\x20email\x20template';async['execute'](_0x1830c8){const _0x49b53c=a16_0x4c1174,{options:_0x489835,tdx:_0x4e6fba}=_0x1830c8,_0x4c8268=_0x489835,_0x3cab31=_0x4c8268['name'],_0x5e9a8c=_0x4c8268[_0x49b53c(0x17f)],_0x1aedf5=_0x4c8268['html'];if(!_0x3cab31)return console[_0x49b53c(0x18a)]('Error:\x20--name\x20is\x20required'),console[_0x49b53c(0x18a)](_0x49b53c(0x17a)),0x1;if(!_0x5e9a8c)return console[_0x49b53c(0x18a)](_0x49b53c(0x11a)),0x1;if(!_0x1aedf5)return console[_0x49b53c(0x18a)]('Error:\x20--html\x20is\x20required'),0x1;const _0x2218ea=await resolveWorkspaceIdFromOptions(_0x4c8268,_0x4e6fba,!![]),_0x4d88ad={'name':_0x3cab31,'subjectTemplate':_0x5e9a8c,'htmlTemplate':_0x1aedf5,'workspaceId':_0x2218ea,'plaintextTemplate':_0x4c8268['plaintext'],'editorType':_0x4c8268[_0x49b53c(0x117)]},_0x514a0d=await withSpinner(_0x49b53c(0x136)+_0x3cab31+_0x49b53c(0x160),()=>_0x4e6fba[_0x49b53c(0x12d)]['createTemplate'](_0x4d88ad));return await handleSDKOutput([_0x514a0d[_0x49b53c(0x159)]],_0x489835),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0x4c1174(0x10f);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x150);async[a16_0x4c1174(0x116)](_0x45b998){const _0x515c0a=a16_0x4c1174,{options:_0x5b0b59,args:_0x54f752,tdx:_0x33f20b}=_0x45b998;if(_0x54f752['length']===0x0)return console['error'](_0x515c0a(0x11c)),console['error'](_0x515c0a(0x172)),0x1;const _0x5323b0=_0x54f752[0x0],_0x2bf5c4=_0x5b0b59,_0x4afa0e=await resolveWorkspaceIdFromOptions(_0x2bf5c4,_0x33f20b),_0x16acf9={'name':_0x2bf5c4['name'],'subjectTemplate':_0x2bf5c4[_0x515c0a(0x17f)],'htmlTemplate':_0x2bf5c4[_0x515c0a(0x129)],'plaintextTemplate':_0x2bf5c4['plaintext']},_0x28e4b3=Object[_0x515c0a(0x145)](Object[_0x515c0a(0x149)](_0x16acf9)[_0x515c0a(0x109)](([,_0x3494ae])=>_0x3494ae!==undefined));if(Object[_0x515c0a(0x15c)](_0x28e4b3)[_0x515c0a(0x15e)]===0x0)return console['error'](_0x515c0a(0x114)),console[_0x515c0a(0x18a)]('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x33f5d5=await withSpinner(_0x515c0a(0x169)+_0x5323b0+'\x27...',()=>_0x33f20b['engage'][_0x515c0a(0x16f)](_0x5323b0,_0x28e4b3,_0x4afa0e),{'verbose':_0x5b0b59[_0x515c0a(0x186)]});return await handleSDKOutput([_0x33f5d5[_0x515c0a(0x159)]],_0x5b0b59),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x161);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x111);async[a16_0x4c1174(0x116)](_0x354ba4){const _0x331553=a16_0x4c1174,{options:_0x5e8bf3,args:_0x2fdd3e,tdx:_0x43ffd2}=_0x354ba4;if(_0x2fdd3e['length']===0x0)return console['error'](_0x331553(0x11c)),console[_0x331553(0x18a)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x536873=_0x2fdd3e[0x0],_0x563c30=_0x5e8bf3,_0x4e6442=await resolveWorkspaceIdFromOptions(_0x563c30,_0x43ffd2);if(!_0x5e8bf3[_0x331553(0x14b)]){const _0x221f4a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x536873+_0x331553(0x15a));if(!_0x221f4a)return console[_0x331553(0x12c)](_0x331553(0x17c)),0x0;}return await withSpinner(_0x331553(0x10c)+_0x536873+_0x331553(0x160),()=>_0x43ffd2[_0x331553(0x12d)][_0x331553(0x138)](_0x536873,_0x4e6442),{'verbose':_0x5e8bf3[_0x331553(0x186)]}),console[_0x331553(0x12c)](_0x331553(0x16d)+_0x536873+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']=a16_0x4c1174(0x12e);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x10a);async[a16_0x4c1174(0x116)](_0x2eb3e6){const _0x2f626d=a16_0x4c1174,{options:_0x103047,args:_0x3db109,tdx:_0x2bfc5e}=_0x2eb3e6,_0x4a34a8=_0x3db109[0x0],_0x41e2f5=resolveLimit(_0x103047[_0x2f626d(0x182)],DEFAULT_LLM_LIMIT),_0x29df87=await withSpinner('Fetching\x20workspaces...',()=>_0x2bfc5e[_0x2f626d(0x12d)][_0x2f626d(0x10b)]({'limit':_0x41e2f5}),{'verbose':_0x103047[_0x2f626d(0x186)]});let _0x3b3302=_0x29df87['data'];return _0x4a34a8&&(_0x3b3302=_0x29df87['data'][_0x2f626d(0x109)](_0x294b3a=>matchGlobPattern(_0x294b3a['name'],_0x4a34a8))),await handleSDKOutput(_0x3b3302,_0x103047),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x176);[a16_0x4c1174(0x15b)]='Show\x20workspace\x20details';async[a16_0x4c1174(0x116)](_0x7595c8){const _0x97ed6a=a16_0x4c1174,{options:_0x1c8fbf,args:_0x4db970,tdx:_0x51fd88}=_0x7595c8;if(_0x4db970['length']===0x0)return console[_0x97ed6a(0x18a)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x97ed6a(0x18a)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x3c2cfc=_0x4db970[0x0],_0x2d387e=_0x1c8fbf,_0x24498a=_0x2d387e['full'];if(_0x24498a){const _0x88c537=await withSpinner('Fetching\x20workspace\x20\x27'+_0x3c2cfc+_0x97ed6a(0x160),()=>_0x51fd88[_0x97ed6a(0x12d)]['getWorkspaceFull'](_0x3c2cfc),{'verbose':_0x1c8fbf[_0x97ed6a(0x186)]});await handleSDKOutput([_0x88c537],_0x1c8fbf);}else{const _0x57bc82=await withSpinner(_0x97ed6a(0x13d)+_0x3c2cfc+_0x97ed6a(0x160),()=>_0x51fd88[_0x97ed6a(0x12d)][_0x97ed6a(0x158)](_0x3c2cfc),{'verbose':_0x1c8fbf[_0x97ed6a(0x186)]});await handleSDKOutput([_0x57bc82],_0x1c8fbf);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x108);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x14e);async['execute'](_0x3c36c7){const _0xf77111=a16_0x4c1174,{options:_0x5c7400,tdx:_0x906e3b}=_0x3c36c7,_0x422af9=_0x5c7400,_0x56d48c=_0x422af9[_0xf77111(0x119)];if(!_0x56d48c)return console[_0xf77111(0x18a)](_0xf77111(0x11e)),console[_0xf77111(0x18a)](_0xf77111(0x177)),0x1;const _0x1d009f={'name':_0x56d48c,'description':_0x422af9[_0xf77111(0x15b)]},_0x4e6216=await withSpinner('Creating\x20workspace\x20\x27'+_0x56d48c+_0xf77111(0x160),()=>_0x906e3b[_0xf77111(0x12d)][_0xf77111(0x12a)](_0x1d009f));return await handleSDKOutput([_0x4e6216[_0xf77111(0x159)]],_0x5c7400),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x193);[a16_0x4c1174(0x15b)]=a16_0x4c1174(0x187);async[a16_0x4c1174(0x116)](_0x43551f){const _0x3d9a66=a16_0x4c1174,{options:_0x40c7c9,args:_0x421821,tdx:_0x186b97}=_0x43551f;if(_0x421821[_0x3d9a66(0x15e)]===0x0)return console[_0x3d9a66(0x18a)](_0x3d9a66(0x165)),console[_0x3d9a66(0x18a)](_0x3d9a66(0x156)),0x1;const _0x123c75=_0x421821[0x0],_0x353600=_0x40c7c9,_0x316b2c={'name':_0x353600[_0x3d9a66(0x119)],'description':_0x353600[_0x3d9a66(0x15b)]},_0x2b19a3=Object[_0x3d9a66(0x145)](Object[_0x3d9a66(0x149)](_0x316b2c)[_0x3d9a66(0x109)](([,_0x4c9f57])=>_0x4c9f57!==undefined));if(Object[_0x3d9a66(0x15c)](_0x2b19a3)[_0x3d9a66(0x15e)]===0x0)return console[_0x3d9a66(0x18a)](_0x3d9a66(0x114)),console[_0x3d9a66(0x18a)](_0x3d9a66(0x179)),0x1;const _0x263230=await withSpinner(_0x3d9a66(0x152)+_0x123c75+_0x3d9a66(0x160),()=>_0x186b97['engage']['updateWorkspace'](_0x123c75,_0x2b19a3),{'verbose':_0x40c7c9[_0x3d9a66(0x186)]});return await handleSDKOutput([_0x263230[_0x3d9a66(0x159)]],_0x40c7c9),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x16b);[a16_0x4c1174(0x15b)]='Delete\x20a\x20workspace';async[a16_0x4c1174(0x116)](_0x312339){const _0x2d8f9a=a16_0x4c1174,{options:_0x138816,args:_0x440ea0,tdx:_0x572688}=_0x312339;if(_0x440ea0[_0x2d8f9a(0x15e)]===0x0)return console['error'](_0x2d8f9a(0x165)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x59d332=_0x440ea0[0x0];if(!_0x138816[_0x2d8f9a(0x14b)]){const _0x55e8ba=await confirm(_0x2d8f9a(0x17e)+_0x59d332+_0x2d8f9a(0x15a));if(!_0x55e8ba)return console[_0x2d8f9a(0x12c)](_0x2d8f9a(0x17c)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x59d332+_0x2d8f9a(0x160),()=>_0x572688[_0x2d8f9a(0x12d)][_0x2d8f9a(0x190)](_0x59d332),{'verbose':_0x138816[_0x2d8f9a(0x186)]}),console[_0x2d8f9a(0x12c)](_0x2d8f9a(0x168)+_0x59d332+_0x2d8f9a(0x124)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0x4c1174(0x119)]=a16_0x4c1174(0x170);['description']=a16_0x4c1174(0x18e);async[a16_0x4c1174(0x116)](_0x2f621c){const _0x5f3f45=a16_0x4c1174,{options:_0x13e328,args:_0x1f8390,tdx:_0x5e0df4}=_0x2f621c;if(_0x1f8390[_0x5f3f45(0x15e)]===0x0)return console['error'](_0x5f3f45(0x13e)),console[_0x5f3f45(0x18a)](_0x5f3f45(0x16a)),0x1;const _0x5630eb=_0x1f8390[0x0];await withSpinner(_0x5f3f45(0x12b)+_0x5630eb+'\x27...',()=>_0x5e0df4[_0x5f3f45(0x12d)][_0x5f3f45(0x15f)](_0x5630eb));const _0x488a78=_0x13e328[_0x5f3f45(0x131)]||undefined;return saveSessionContext({'engage_workspace':_0x5630eb},_0x488a78),console[_0x5f3f45(0x12c)](_0x5f3f45(0x188)+_0x5630eb),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}