@treasuredata/tdx 0.25.8 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.js +1 -1
  121. package/dist/sdk/segment.js +1 -1
  122. package/dist/sdk/types/index.js +1 -1
  123. package/dist/sdk/types/progress.js +1 -1
  124. package/dist/sdk/user.js +1 -1
  125. package/dist/sdk/util/format-detector.js +1 -1
  126. package/dist/sdk/util/formatters.js +1 -1
  127. package/dist/sdk/util/index.js +1 -1
  128. package/dist/sdk/util/tree-formatter.js +1 -1
  129. package/dist/sdk/workflow/archive-validation.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.d.ts +2 -1
  148. package/dist/utils/local-cache.d.ts.map +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/local-cache.js.map +1 -1
  151. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  152. package/dist/utils/logger/formatters/index.js +1 -1
  153. package/dist/utils/logger/handlers/console-handler.js +1 -1
  154. package/dist/utils/logger/handlers/file-handler.js +1 -1
  155. package/dist/utils/logger/handlers/index.js +1 -1
  156. package/dist/utils/logger/handlers/null-handler.js +1 -1
  157. package/dist/utils/logger/index.js +1 -1
  158. package/dist/utils/logger/logger.js +1 -1
  159. package/dist/utils/logger/types.js +1 -1
  160. package/dist/utils/option-validation.js +1 -1
  161. package/dist/utils/port.js +1 -1
  162. package/dist/utils/process.js +1 -1
  163. package/dist/utils/prompt.js +1 -1
  164. package/dist/utils/spinner.js +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.js +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- const a9_0x13827d=a9_0x4f87;(function(_0x52b3c6,_0x4c67de){const _0x13fecb=a9_0x4f87,_0x39f89b=_0x52b3c6();while(!![]){try{const _0x39003f=parseInt(_0x13fecb(0x1c4))/0x1*(-parseInt(_0x13fecb(0x1f3))/0x2)+parseInt(_0x13fecb(0x19c))/0x3*(-parseInt(_0x13fecb(0x18a))/0x4)+parseInt(_0x13fecb(0x1c2))/0x5*(-parseInt(_0x13fecb(0x1bb))/0x6)+-parseInt(_0x13fecb(0x1d8))/0x7+-parseInt(_0x13fecb(0x174))/0x8+-parseInt(_0x13fecb(0x178))/0x9*(-parseInt(_0x13fecb(0x204))/0xa)+parseInt(_0x13fecb(0x1a9))/0xb;if(_0x39003f===_0x4c67de)break;else _0x39f89b['push'](_0x39f89b['shift']());}catch(_0x4205fd){_0x39f89b['push'](_0x39f89b['shift']());}}}(a9_0x291f,0x4be12));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';function a9_0x291f(){const _0x4b4b23=['\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','tdx','\x20meets\x20minimum\x20requirement','Claude\x20Code\x20version\x20','✓\x20Plugin\x20\x27','type','✓\x20Marketplace\x20\x27','site','Marketplace\x20\x27','CLAUDE_CODE_NOT_FOUND','Configuring\x20MCP\x20server\x20\x27','continue','parse','info','✓\x20Found\x20available\x20port:\x20','6RXGVcN','tdx-skills','sql-skills','minor','ANTHROPIC_MODEL','td-skills\x20Plugins','Command\x20failed\x20(exit\x20','Failed\x20to\x20list\x20marketplaces','workflow-skills','settings.local.json','llm-proxy','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','hostname','19865472pskvRj','resume','includes','https://docs.treasuredata.com/mcp','\x27\x20configured','already\x20installed','add','getCurrent','message','✓\x20Settings\x20configured:\x20.claude/settings.local.json','\x20already\x20configured','CLAUDE_CODE_USE_BEDROCK','warn','stdout','td-skills','account_id','tdx\x20--profile\x20','Invalid\x20minimum\x20version\x20format:\x20','3103158huHtJM','remove','unshift','green','trim','--transport','start','5rJATQB','\x20claude\x20statusline','234518YhTvUq','Finding\x20available\x20port...','port','command','ENOENT','INTERNAL','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','--version','Warning:\x20Failed\x20to\x20configure\x20','Failed\x20to\x20spawn\x20claude\x20command:\x20','utf-8','stop','false','Setup\x20failed','fail','cwd','env','CLAUDE_CODE_USE_VERTEX','verbose','plugin','1406846qcuKsF','INVALID_ARGUMENT','logger','red','inherit','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','passThroughServer','major','error','apiKey','Configuring\x20marketplace\x20\x27','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','✓\x20Claude\x20Code\x20version\x20OK','\x20is\x20too\x20old\x20(minimum:\x20','ANTHROPIC_BASE_URL','Installing\x20plugin\x20\x27','close','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','\x27...','Failed\x20to\x20remove\x20marketplace\x20\x27','list','stderr','td-docs','debug','Failed\x20to\x20configure\x20marketplace\x20\x27','✓\x20MCP\x20server\x20\x27','4xdGPIA','mcp','join','Claude\x20Code\x20CLI\x20not\x20found','Restored\x20default\x20td-skills\x20marketplace','toString','context','Failed\x20to\x20install\x20plugin\x20\x27','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','claude','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','pipe','\x20→\x20','marketplace','getLogPath','✓\x20Logging\x20to\x20','stringify','40hrTJqO','\x27\x20updated','ANTHROPIC_AUTH_TOKEN','http','Initializing...','originalSettings','user','execute','install','https://github.com/treasure-data/td-skills','tdx-managed-proxy','string','Executing:\x20claude\x20','cause','1370760cwbMtf','code','localhost','\x20configuration\x20failed','382158mKAKlW','Failed\x20to\x20update\x20marketplace\x20\x27','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','text','match','http://127.0.0.1:','.claude','):\x20claude\x20','\x27\x20installed','statusLine','description','Checking\x20Claude\x20Code\x20version...','log','already\x20configured','INSTALLATION_FAILED','\x27:\x20','patch','exit','612892jwBJbg','profile','Initializing\x20proxy\x20logger...'];a9_0x291f=function(){return _0x4b4b23;};return a9_0x291f();}import a9_0x242c93 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';function a9_0x4f87(_0x99b436,_0x1c9e78){_0x99b436=_0x99b436-0x16d;const _0x291fb6=a9_0x291f();let _0x4f87a9=_0x291fb6[_0x99b436];return _0x4f87a9;}const MIN_CLAUDE_VERSION='2.0.20';function handleInstallationError(_0x46a233,_0x2dcc7c,_0x54ccc8,_0x1e2626){const _0x3d84f4=a9_0x4f87;errorContains(_0x46a233,'already\x20exists',_0x3d84f4(0x1ae),_0x3d84f4(0x185))?(_0x54ccc8['text']='✓\x20'+_0x2dcc7c+_0x3d84f4(0x1b3),_0x1e2626?.[_0x3d84f4(0x19a)](_0x2dcc7c+_0x3d84f4(0x1b3)),_0x46a233 instanceof SDKError&&_0x46a233[_0x3d84f4(0x173)]&&_0x1e2626?.[_0x3d84f4(0x1f0)]('Command\x20output:\x20'+_0x46a233[_0x3d84f4(0x173)][_0x3d84f4(0x1b1)])):(_0x54ccc8['warn'](_0x3d84f4(0x1cc)+_0x2dcc7c),_0x1e2626?.['error'](_0x2dcc7c+_0x3d84f4(0x177),_0x46a233));}export function parseVersion(_0x440d04){const _0x1f5ea3=a9_0x4f87,_0xddfbc9=_0x440d04[_0x1f5ea3(0x1bf)]()[_0x1f5ea3(0x17c)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0xddfbc9)return null;return{'major':parseInt(_0xddfbc9[0x1],0xa),'minor':parseInt(_0xddfbc9[0x2],0xa),'patch':parseInt(_0xddfbc9[0x3],0xa)};}export function compareVersions(_0x113a64,_0x1e3e42){const _0x41982b=a9_0x4f87;if(_0x113a64[_0x41982b(0x1df)]!==_0x1e3e42[_0x41982b(0x1df)])return _0x113a64[_0x41982b(0x1df)]-_0x1e3e42['major'];if(_0x113a64[_0x41982b(0x19f)]!==_0x1e3e42[_0x41982b(0x19f)])return _0x113a64[_0x41982b(0x19f)]-_0x1e3e42[_0x41982b(0x19f)];return _0x113a64['patch']-_0x1e3e42['patch'];}async function checkClaudeVersion(_0x3458af,_0x14f381){const _0x4bb982=a9_0x4f87;_0x14f381?.[_0x4bb982(0x1f0)](_0x4bb982(0x1e3)+_0x3458af+')');const _0x26da16=await executeClaudeCommand([_0x4bb982(0x1cb)],undefined,_0x14f381),_0x3a798d=parseVersion(_0x26da16);if(!_0x3a798d){_0x14f381?.['warn']('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x26da16);return;}const _0x3d749b=_0x3a798d[_0x4bb982(0x1df)]+'.'+_0x3a798d[_0x4bb982(0x19f)]+'.'+_0x3a798d[_0x4bb982(0x188)],_0xa40494=parseVersion(_0x3458af);if(!_0xa40494){_0x14f381?.[_0x4bb982(0x1b5)](_0x4bb982(0x1ba)+_0x3458af);return;}if(compareVersions(_0x3a798d,_0xa40494)<0x0){_0x14f381?.['error'](_0x4bb982(0x190)+_0x3d749b+_0x4bb982(0x1e5)+_0x3458af+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],'Claude\x20Code\x20version\x20'+_0x3d749b+_0x4bb982(0x18d)+_0x3458af+'\x20or\x20later.',undefined,{'helpText':_0x4bb982(0x1a7)});}_0x14f381?.['debug'](_0x4bb982(0x190)+_0x3d749b+_0x4bb982(0x18f));}async function executeClaudeCommand(_0x588115,_0x332dcd,_0x5968e0){const _0x36f0d3=a9_0x4f87;return _0x5968e0?.[_0x36f0d3(0x19a)](_0x36f0d3(0x172)+_0x588115[_0x36f0d3(0x1f5)]('\x20')),new Promise((_0x2a0b51,_0x5308cf)=>{const _0x256ef4=_0x36f0d3,_0x1e16e0=crossSpawn(_0x256ef4(0x1fc),_0x588115,{'stdio':_0x256ef4(0x1fe)});let _0x814f18='',_0x2fa6fa='';_0x1e16e0[_0x256ef4(0x1b6)]?.['on']('data',_0x24ca5d=>{const _0x478df7=_0x256ef4;_0x814f18+=_0x24ca5d[_0x478df7(0x1f8)]();}),_0x1e16e0[_0x256ef4(0x1ee)]?.['on']('data',_0x9ab561=>{const _0x32d16b=_0x256ef4;_0x2fa6fa+=_0x9ab561[_0x32d16b(0x1f8)]();}),_0x1e16e0['on'](_0x256ef4(0x1e0),_0x5af529=>{const _0x511d22=_0x256ef4;_0x5af529[_0x511d22(0x175)]===_0x511d22(0x1c8)?(_0x5968e0?.[_0x511d22(0x1e0)](_0x511d22(0x1f6)),_0x5308cf(new SDKError(ErrorCode[_0x511d22(0x196)],_0x511d22(0x1f6),_0x5af529,{'helpText':_0x511d22(0x1ea)}))):(_0x5968e0?.['error']('Command\x20spawn\x20error:\x20'+_0x5af529[_0x511d22(0x1b1)]),_0x5308cf(new SDKError(ErrorCode[_0x511d22(0x1c9)],_0x511d22(0x1cd)+_0x5af529[_0x511d22(0x1b1)],_0x5af529)));}),_0x1e16e0['on'](_0x256ef4(0x189),_0x27ed0c=>{const _0x593691=_0x256ef4;if(_0x27ed0c===0x0)_0x2a0b51(_0x814f18);else _0x332dcd?(_0x5968e0?.[_0x593691(0x1e0)](_0x593691(0x1a2)+_0x27ed0c+_0x593691(0x17f)+_0x588115['join']('\x20')),_0x5308cf(new SDKError(ErrorCode[_0x593691(0x186)],_0x332dcd,new Error(_0x2fa6fa)))):_0x2a0b51('');});});}async function ensureMcpServer(_0xbbc8fc,_0x4e14af,_0x14ab2a,_0x3686ea,_0x540b0d){const _0x23d71d=a9_0x4f87;_0x3686ea[_0x23d71d(0x17b)]=_0x23d71d(0x197)+_0xbbc8fc+_0x23d71d(0x1eb),await executeClaudeCommand([_0x23d71d(0x1f4),_0x23d71d(0x1af),_0xbbc8fc,_0x4e14af,_0x23d71d(0x1c0),_0x14ab2a],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0xbbc8fc+'\x27',_0x540b0d),_0x3686ea[_0x23d71d(0x17b)]=_0x23d71d(0x1f2)+_0xbbc8fc+_0x23d71d(0x1ad);}export const DEFAULT_TD_SKILLS_URL=a9_0x13827d(0x16f);export function getTdSkillsRepoUrl(){const _0x15d944=process.env.TDX_TD_SKILLS_REPO;if(_0x15d944)return _0x15d944;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x319620,_0x4103ea){const _0x3d5dfc=a9_0x13827d;try{const _0x1ae4ed=await executeClaudeCommand([_0x3d5dfc(0x1d7),_0x3d5dfc(0x200),_0x3d5dfc(0x1ed)],_0x3d5dfc(0x1a3),_0x4103ea);if(!_0x1ae4ed['includes'](_0x319620)){_0x4103ea?.[_0x3d5dfc(0x1f0)](_0x3d5dfc(0x195)+_0x319620+_0x3d5dfc(0x1dd));return;}await executeClaudeCommand([_0x3d5dfc(0x1d7),_0x3d5dfc(0x200),_0x3d5dfc(0x1bc),_0x319620],_0x3d5dfc(0x1ec)+_0x319620+'\x27',_0x4103ea),_0x4103ea?.['info'](_0x3d5dfc(0x195)+_0x319620+'\x27\x20removed');}catch(_0x2ec2da){_0x4103ea?.[_0x3d5dfc(0x1b5)](_0x3d5dfc(0x1ec)+_0x319620+_0x3d5dfc(0x187)+_0x2ec2da);}}async function restoreDefaultTdSkillsMarketplace(_0x5ab4b2){const _0x22173d=a9_0x13827d;try{await removeMarketplace(_0x22173d(0x1b7),_0x5ab4b2),await executeClaudeCommand(['plugin',_0x22173d(0x200),_0x22173d(0x1af),DEFAULT_TD_SKILLS_URL],undefined,_0x5ab4b2),_0x5ab4b2?.['info'](_0x22173d(0x1f7));}catch{}}async function ensureMarketplace(_0x339967,_0x5d5927,_0x1aa627,_0x3abbf8){const _0x329c22=a9_0x13827d;_0x1aa627[_0x329c22(0x17b)]=_0x329c22(0x1e2)+_0x339967+_0x329c22(0x1eb),await executeClaudeCommand(['plugin',_0x329c22(0x200),'add',_0x5d5927],_0x329c22(0x1f1)+_0x339967+'\x27',_0x3abbf8),_0x1aa627['text']=_0x329c22(0x193)+_0x339967+_0x329c22(0x1ad);}async function updateMarketplace(_0x1af403,_0x5e0ec7,_0x124ab1){const _0x41b8cd=a9_0x13827d;_0x5e0ec7[_0x41b8cd(0x17b)]='Updating\x20marketplace\x20\x27'+_0x1af403+_0x41b8cd(0x1eb),await executeClaudeCommand([_0x41b8cd(0x1d7),_0x41b8cd(0x200),'update'],_0x41b8cd(0x179)+_0x1af403+'\x27',_0x124ab1),_0x5e0ec7[_0x41b8cd(0x17b)]=_0x41b8cd(0x193)+_0x1af403+_0x41b8cd(0x205);}async function ensurePlugin(_0x469655,_0x468aec,_0x111d83,_0x1e1679){const _0x215539=a9_0x13827d;_0x111d83['text']=_0x215539(0x1e7)+_0x469655+'\x27...',await executeClaudeCommand([_0x215539(0x1d7),_0x215539(0x16e),_0x469655+'@'+_0x468aec],_0x215539(0x1fa)+_0x469655+'\x27',_0x1e1679),_0x111d83[_0x215539(0x17b)]=_0x215539(0x191)+_0x469655+_0x215539(0x180);}async function createClaudeSettings(_0x287b1b,_0x2f0e32,_0x3bd2aa){const _0x35cc44=a9_0x13827d,_0x3ff77e=join(process[_0x35cc44(0x1d3)](),_0x35cc44(0x17e)),_0x2fb72a=join(_0x3ff77e,'settings.local.json');await mkdir(_0x3ff77e,{'recursive':!![]});let _0x1685e6={};if(existsSync(_0x2fb72a))try{const _0x41c759=await readFile(_0x2fb72a,_0x35cc44(0x1ce));_0x1685e6=JSON[_0x35cc44(0x199)](_0x41c759);}catch{_0x1685e6={};}const _0x307712=_0x1685e6[_0x35cc44(0x1d4)]||{},_0x592bd3={'ANTHROPIC_BASE_URL':_0x307712[_0x35cc44(0x1e6)],'ANTHROPIC_MODEL':_0x307712[_0x35cc44(0x1a0)],'ANTHROPIC_AUTH_TOKEN':_0x307712['ANTHROPIC_AUTH_TOKEN'],'CLAUDE_CODE_USE_BEDROCK':_0x307712[_0x35cc44(0x1b4)],'CLAUDE_CODE_USE_VERTEX':_0x307712[_0x35cc44(0x1d5)],'statusLine':_0x1685e6[_0x35cc44(0x181)]},_0x1516c5={..._0x1685e6,'env':{..._0x307712,'ANTHROPIC_BASE_URL':_0x35cc44(0x17d)+_0x287b1b,..._0x2f0e32&&{'ANTHROPIC_MODEL':_0x2f0e32},'ANTHROPIC_AUTH_TOKEN':_0x35cc44(0x170),'CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':'false'},'statusLine':{'type':_0x35cc44(0x1c7),'command':_0x3bd2aa?_0x35cc44(0x1b9)+_0x3bd2aa+_0x35cc44(0x1c3):'tdx\x20claude\x20statusline'}};return await writeFile(_0x2fb72a,JSON[_0x35cc44(0x203)](_0x1516c5,null,0x2)+'\x0a'),_0x592bd3;}async function restoreClaudeSettings(_0x48b9d9){const _0x5c54f6=a9_0x13827d,_0x3768e2=join(process[_0x5c54f6(0x1d3)](),_0x5c54f6(0x17e)),_0x9c163b=join(_0x3768e2,_0x5c54f6(0x1a5));if(!existsSync(_0x9c163b))return;try{const _0x10d28a=await readFile(_0x9c163b,_0x5c54f6(0x1ce)),_0x51ffed=JSON[_0x5c54f6(0x199)](_0x10d28a),_0x2d6854=_0x51ffed[_0x5c54f6(0x1d4)]||{},_0x2db50a=_0x2d6854[_0x5c54f6(0x1e6)],_0x160e3a=((()=>{const _0x18beb8=_0x5c54f6;if(typeof _0x2db50a!==_0x18beb8(0x171))return![];try{const _0x4d5045=new URL(_0x2db50a);return _0x4d5045[_0x18beb8(0x1a8)]===_0x18beb8(0x176)||_0x4d5045[_0x18beb8(0x1a8)]==='127.0.0.1';}catch{return![];}})());_0x160e3a?(delete _0x2d6854[_0x5c54f6(0x1e6)],delete _0x2d6854[_0x5c54f6(0x1a0)],delete _0x2d6854[_0x5c54f6(0x206)],delete _0x2d6854[_0x5c54f6(0x1b4)],delete _0x2d6854[_0x5c54f6(0x1d5)]):(_0x48b9d9[_0x5c54f6(0x1e6)]!==undefined?_0x2d6854[_0x5c54f6(0x1e6)]=_0x48b9d9['ANTHROPIC_BASE_URL']:delete _0x2d6854[_0x5c54f6(0x1e6)],_0x48b9d9['ANTHROPIC_MODEL']!==undefined?_0x2d6854[_0x5c54f6(0x1a0)]=_0x48b9d9[_0x5c54f6(0x1a0)]:delete _0x2d6854['ANTHROPIC_MODEL'],_0x48b9d9[_0x5c54f6(0x206)]!==undefined?_0x2d6854['ANTHROPIC_AUTH_TOKEN']=_0x48b9d9[_0x5c54f6(0x206)]:delete _0x2d6854[_0x5c54f6(0x206)],_0x48b9d9[_0x5c54f6(0x1b4)]!==undefined?_0x2d6854[_0x5c54f6(0x1b4)]=_0x48b9d9[_0x5c54f6(0x1b4)]:delete _0x2d6854[_0x5c54f6(0x1b4)],_0x48b9d9[_0x5c54f6(0x1d5)]!==undefined?_0x2d6854['CLAUDE_CODE_USE_VERTEX']=_0x48b9d9[_0x5c54f6(0x1d5)]:delete _0x2d6854[_0x5c54f6(0x1d5)]);const _0x153e45=_0x51ffed[_0x5c54f6(0x181)],_0x37eee1=((()=>{const _0x13ee44=_0x5c54f6;if(!_0x153e45||typeof _0x153e45!=='object')return![];if(_0x153e45[_0x13ee44(0x192)]!==_0x13ee44(0x1c7))return![];if(typeof _0x153e45['command']!==_0x13ee44(0x171))return![];return _0x153e45[_0x13ee44(0x1c7)][_0x13ee44(0x1ab)](_0x13ee44(0x18e))&&_0x153e45[_0x13ee44(0x1c7)][_0x13ee44(0x1ab)]('statusline');})());if(_0x37eee1)delete _0x51ffed[_0x5c54f6(0x181)];else _0x48b9d9['statusLine']!==undefined?_0x51ffed['statusLine']=_0x48b9d9[_0x5c54f6(0x181)]:delete _0x51ffed[_0x5c54f6(0x181)];_0x51ffed['env']=_0x2d6854,await writeFile(_0x9c163b,JSON['stringify'](_0x51ffed,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a9_0x13827d(0x1fc);[a9_0x13827d(0x182)]=a9_0x13827d(0x1ca);[a9_0x13827d(0x1de)];[a9_0x13827d(0x209)];[a9_0x13827d(0x1da)];['port'];async[a9_0x13827d(0x16d)](_0x1311f5){const _0x543e02=a9_0x13827d,{tdx:_0x3dae7f,options:_0x1afb05,args:_0x3ffeb1}=_0x1311f5;let _0x55aadf=![];try{const _0x326bf6=_0x1afb05,_0x11ebbc=_0x326bf6['proxy']===![],_0x5b4998=_0x326bf6[_0x543e02(0x198)]===!![],_0x11992c=_0x326bf6[_0x543e02(0x1aa)]===!![],_0x167a63=[..._0x3ffeb1];if(_0x5b4998)_0x167a63[_0x543e02(0x1bd)]('-c');else _0x11992c&&_0x167a63[_0x543e02(0x1bd)]('-r');const _0x5d2eb2=createCommandSpinner(_0x543e02(0x208),{'verbose':_0x1afb05[_0x543e02(0x1d6)]});_0x5d2eb2[_0x543e02(0x1c1)]();try{if(!_0x11ebbc){_0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x1c5),this['port']=await findAvailablePort(0xfa0),_0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x19b)+this[_0x543e02(0x1c6)];const _0x1e4930=_0x1afb05[_0x543e02(0x18b)];try{const _0x119a28=await _0x3dae7f[_0x543e02(0x20a)][_0x543e02(0x1b0)]();_0x119a28['account_id']&&writeCachedAccountInfo(_0x1afb05['site'],_0x119a28[_0x543e02(0x1b8)],_0x1e4930);}catch{}_0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x18c),this[_0x543e02(0x1da)]=new TDXLogger(_0x1afb05['logLevel'],!![]),await this[_0x543e02(0x1da)]['init']();const _0x55a986=this[_0x543e02(0x1da)][_0x543e02(0x201)]();_0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x202)+_0x55a986;const _0x379bbe=getEndpoint(_0x1afb05[_0x543e02(0x194)],_0x543e02(0x1a6));_0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x1fb);if(!_0x3dae7f[_0x543e02(0x1f9)]['apiKey'])throw new SDKError(ErrorCode[_0x543e02(0x1d9)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x543e02(0x1de)]=new PassThroughProxyServer({'port':this['port'],'llmProxyUrl':_0x379bbe,'apiKey':_0x3dae7f['context'][_0x543e02(0x1e1)],'logger':this['logger'],'site':_0x1afb05[_0x543e02(0x194)],'profile':_0x1e4930}),await this['passThroughServer'][_0x543e02(0x1c1)](),_0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x17a)+this[_0x543e02(0x1c6)]+_0x543e02(0x1ff)+_0x379bbe,_0x5d2eb2['text']='Creating\x20.claude/settings.local.json...',this[_0x543e02(0x209)]=await createClaudeSettings(this[_0x543e02(0x1c6)],undefined,_0x1e4930),_0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x1b2);}else _0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x1e9);try{_0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x183),await checkClaudeVersion(MIN_CLAUDE_VERSION,this['logger']),_0x5d2eb2[_0x543e02(0x17b)]=_0x543e02(0x1e4);}catch(_0x1e9374){_0x5d2eb2[_0x543e02(0x1d2)]('Claude\x20Code\x20version\x20check\x20failed');throw _0x1e9374;}try{await ensureMcpServer(_0x543e02(0x1ef),_0x543e02(0x1ac),_0x543e02(0x207),_0x5d2eb2,this[_0x543e02(0x1da)]);}catch(_0x245977){handleInstallationError(_0x245977,'TD\x20Docs\x20MCP\x20Server',_0x5d2eb2,this['logger']);}try{const _0x7940d6=getTdSkillsRepoUrl();_0x55aadf=_0x7940d6!==DEFAULT_TD_SKILLS_URL,_0x55aadf&&await removeMarketplace(_0x543e02(0x1b7),this[_0x543e02(0x1da)]),await ensureMarketplace('td-skills',_0x7940d6,_0x5d2eb2,this[_0x543e02(0x1da)]),await updateMarketplace(_0x543e02(0x1b7),_0x5d2eb2,this[_0x543e02(0x1da)]),await ensurePlugin(_0x543e02(0x19e),_0x543e02(0x1b7),_0x5d2eb2,this[_0x543e02(0x1da)]),await ensurePlugin(_0x543e02(0x1a4),_0x543e02(0x1b7),_0x5d2eb2,this[_0x543e02(0x1da)]),await ensurePlugin(_0x543e02(0x19d),'td-skills',_0x5d2eb2,this[_0x543e02(0x1da)]);}catch(_0x57a466){handleInstallationError(_0x57a466,_0x543e02(0x1a1),_0x5d2eb2,this[_0x543e02(0x1da)]);}_0x5d2eb2['stop']();}catch(_0x4d7c8c){_0x5d2eb2[_0x543e02(0x1d2)](_0x543e02(0x1d1));throw _0x4d7c8c;}const _0xb6d560=await findExecutable(_0x543e02(0x1fc));if(!_0xb6d560)throw new SDKError(ErrorCode[_0x543e02(0x196)],_0x543e02(0x1f6),undefined,{'helpText':_0x543e02(0x1ea)});const _0x2bf2b0={...process.env};!_0x11ebbc&&(_0x2bf2b0['ANTHROPIC_BASE_URL']=_0x543e02(0x17d)+this[_0x543e02(0x1c6)],_0x2bf2b0[_0x543e02(0x206)]='tdx-managed-proxy',_0x2bf2b0[_0x543e02(0x1b4)]=_0x543e02(0x1d0),_0x2bf2b0['CLAUDE_CODE_USE_VERTEX']=_0x543e02(0x1d0));const _0x4f9a95=crossSpawn(_0xb6d560,_0x167a63,{'stdio':_0x543e02(0x1dc),'env':_0x2bf2b0}),_0x471b4c=await new Promise(_0x4c48c2=>{const _0x45f785=_0x543e02;_0x4f9a95['on'](_0x45f785(0x189),_0x27555a=>{_0x4c48c2(_0x27555a||0x0);}),_0x4f9a95['on'](_0x45f785(0x1e0),_0x1a39fa=>{const _0x5e9573=_0x45f785;console[_0x5e9573(0x1e0)](a9_0x242c93[_0x5e9573(0x1db)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x1a39fa[_0x5e9573(0x1b1)])),_0x4c48c2(0x1);});});_0x55aadf&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0x543e02(0x1de)]&&(await this[_0x543e02(0x1de)][_0x543e02(0x1cf)](),console[_0x543e02(0x184)](a9_0x242c93[_0x543e02(0x1be)](_0x543e02(0x1fd))));if(this[_0x543e02(0x1da)]){await this[_0x543e02(0x1da)][_0x543e02(0x1e8)]();const _0x22b9f7=this[_0x543e02(0x1da)][_0x543e02(0x201)]();console[_0x543e02(0x184)](a9_0x242c93[_0x543e02(0x1be)]('✓\x20Logs\x20saved\x20to\x20'+_0x22b9f7));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x543e02(0x209)]),console['log'](a9_0x242c93[_0x543e02(0x1be)]('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x471b4c;}catch(_0x3423cf){_0x55aadf&&await restoreDefaultTdSkillsMarketplace(this[_0x543e02(0x1da)]);this['passThroughServer']&&await this[_0x543e02(0x1de)][_0x543e02(0x1cf)]();this['logger']&&await this[_0x543e02(0x1da)]['close']();this[_0x543e02(0x209)]&&await restoreClaudeSettings(this[_0x543e02(0x209)]);throw _0x3423cf;}}}
1
+ const a9_0x20c67e=a9_0x39c0;(function(_0x1b946f,_0xc5bd21){const _0x35800f=a9_0x39c0,_0x13270e=_0x1b946f();while(!![]){try{const _0x458596=-parseInt(_0x35800f(0x181))/0x1*(-parseInt(_0x35800f(0x124))/0x2)+-parseInt(_0x35800f(0x18a))/0x3+parseInt(_0x35800f(0x184))/0x4*(-parseInt(_0x35800f(0x13d))/0x5)+-parseInt(_0x35800f(0xff))/0x6*(-parseInt(_0x35800f(0x178))/0x7)+parseInt(_0x35800f(0x168))/0x8*(parseInt(_0x35800f(0x132))/0x9)+-parseInt(_0x35800f(0x16e))/0xa*(-parseInt(_0x35800f(0x164))/0xb)+parseInt(_0x35800f(0x159))/0xc;if(_0x458596===_0xc5bd21)break;else _0x13270e['push'](_0x13270e['shift']());}catch(_0x59cee1){_0x13270e['push'](_0x13270e['shift']());}}}(a9_0x15f6,0xc90a6));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x54a3dc 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_0x20c67e(0x179);function handleInstallationError(_0x569736,_0x5303ef,_0x2ec31d,_0x4b7181){const _0x1f400d=a9_0x20c67e;errorContains(_0x569736,_0x1f400d(0x154),_0x1f400d(0x144),_0x1f400d(0x17e))?(_0x2ec31d[_0x1f400d(0xfd)]='✓\x20'+_0x5303ef+_0x1f400d(0x122),_0x4b7181?.[_0x1f400d(0x146)](_0x5303ef+'\x20already\x20configured'),_0x569736 instanceof SDKError&&_0x569736[_0x1f400d(0x163)]&&_0x4b7181?.['debug'](_0x1f400d(0x14f)+_0x569736[_0x1f400d(0x163)][_0x1f400d(0x153)])):(_0x2ec31d[_0x1f400d(0x155)](_0x1f400d(0x141)+_0x5303ef),_0x4b7181?.[_0x1f400d(0x133)](_0x5303ef+_0x1f400d(0x192),_0x569736));}function a9_0x39c0(_0x5c87e3,_0xe0f76c){_0x5c87e3=_0x5c87e3-0xfd;const _0x15f6bb=a9_0x15f6();let _0x39c000=_0x15f6bb[_0x5c87e3];return _0x39c000;}export function parseVersion(_0x3f4819){const _0x3cf0c1=a9_0x20c67e,_0x6c019b=_0x3f4819[_0x3cf0c1(0x15c)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x6c019b)return null;return{'major':parseInt(_0x6c019b[0x1],0xa),'minor':parseInt(_0x6c019b[0x2],0xa),'patch':parseInt(_0x6c019b[0x3],0xa)};}export function compareVersions(_0x53580b,_0x32d682){const _0x33ee59=a9_0x20c67e;if(_0x53580b[_0x33ee59(0x109)]!==_0x32d682[_0x33ee59(0x109)])return _0x53580b[_0x33ee59(0x109)]-_0x32d682[_0x33ee59(0x109)];if(_0x53580b[_0x33ee59(0x158)]!==_0x32d682[_0x33ee59(0x158)])return _0x53580b[_0x33ee59(0x158)]-_0x32d682[_0x33ee59(0x158)];return _0x53580b[_0x33ee59(0x190)]-_0x32d682['patch'];}async function checkClaudeVersion(_0x26f2fb,_0x5a20b5){const _0x5cfece=a9_0x20c67e;_0x5a20b5?.[_0x5cfece(0x191)]('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x26f2fb+')');const _0x2181ac=await executeClaudeCommand(['--version'],undefined,_0x5a20b5),_0x31832f=parseVersion(_0x2181ac);if(!_0x31832f){_0x5a20b5?.[_0x5cfece(0x155)](_0x5cfece(0x14a)+_0x2181ac);return;}const _0x5efda3=_0x31832f[_0x5cfece(0x109)]+'.'+_0x31832f[_0x5cfece(0x158)]+'.'+_0x31832f[_0x5cfece(0x190)],_0x5135eb=parseVersion(_0x26f2fb);if(!_0x5135eb){_0x5a20b5?.[_0x5cfece(0x155)](_0x5cfece(0x10f)+_0x26f2fb);return;}if(compareVersions(_0x31832f,_0x5135eb)<0x0){_0x5a20b5?.['error'](_0x5cfece(0x10c)+_0x5efda3+_0x5cfece(0x166)+_0x26f2fb+')');throw new SDKError(ErrorCode[_0x5cfece(0x16c)],'Claude\x20Code\x20version\x20'+_0x5efda3+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x26f2fb+_0x5cfece(0x18d),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x5a20b5?.[_0x5cfece(0x191)]('Claude\x20Code\x20version\x20'+_0x5efda3+_0x5cfece(0x134));}async function executeClaudeCommand(_0x5efa39,_0x6d8319,_0x15a84b){const _0x248c7c=a9_0x20c67e;return _0x15a84b?.['info'](_0x248c7c(0x12c)+_0x5efa39['join']('\x20')),new Promise((_0x1d7be7,_0x469d1c)=>{const _0x4d4340=_0x248c7c,_0x29ae7c=crossSpawn(_0x4d4340(0x149),_0x5efa39,{'stdio':_0x4d4340(0x126)});let _0x3cb057='',_0x2a1e4a='';_0x29ae7c[_0x4d4340(0x177)]?.['on']('data',_0x403848=>{const _0x335ca4=_0x4d4340;_0x3cb057+=_0x403848[_0x335ca4(0x119)]();}),_0x29ae7c[_0x4d4340(0x142)]?.['on']('data',_0x924d05=>{_0x2a1e4a+=_0x924d05['toString']();}),_0x29ae7c['on'](_0x4d4340(0x133),_0x1b84c9=>{const _0x586975=_0x4d4340;_0x1b84c9['code']==='ENOENT'?(_0x15a84b?.[_0x586975(0x133)](_0x586975(0x17b)),_0x469d1c(new SDKError(ErrorCode[_0x586975(0x120)],_0x586975(0x17b),_0x1b84c9,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x15a84b?.['error'](_0x586975(0x11e)+_0x1b84c9[_0x586975(0x153)]),_0x469d1c(new SDKError(ErrorCode[_0x586975(0x100)],_0x586975(0x14d)+_0x1b84c9['message'],_0x1b84c9)));}),_0x29ae7c['on'](_0x4d4340(0x183),_0x278d99=>{const _0x46aebe=_0x4d4340;if(_0x278d99===0x0)_0x1d7be7(_0x3cb057);else _0x6d8319?(_0x15a84b?.[_0x46aebe(0x133)](_0x46aebe(0x12d)+_0x278d99+'):\x20claude\x20'+_0x5efa39[_0x46aebe(0x180)]('\x20')),_0x469d1c(new SDKError(ErrorCode[_0x46aebe(0x15f)],_0x6d8319,new Error(_0x2a1e4a)))):_0x1d7be7('');});});}async function ensureMcpServer(_0x4d22d6,_0x4d462f,_0x275395,_0x2daf4a,_0x4d940b){const _0x3c7004=a9_0x20c67e;_0x2daf4a[_0x3c7004(0xfd)]=_0x3c7004(0x103)+_0x4d22d6+'\x27...',await executeClaudeCommand([_0x3c7004(0x165),_0x3c7004(0x12a),_0x4d22d6,_0x4d462f,_0x3c7004(0x125),_0x275395],_0x3c7004(0x18c)+_0x4d22d6+'\x27',_0x4d940b),_0x2daf4a[_0x3c7004(0xfd)]=_0x3c7004(0x107)+_0x4d22d6+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL=a9_0x20c67e(0x102);export function getTdSkillsRepoUrl(){const _0x535560=process.env.TDX_TD_SKILLS_REPO;if(_0x535560)return _0x535560;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0xdedab2,_0x136067){const _0x51153e=a9_0x20c67e;try{const _0x439f92=await executeClaudeCommand([_0x51153e(0x105),_0x51153e(0x15d),_0x51153e(0x174)],'Failed\x20to\x20list\x20marketplaces',_0x136067);if(!_0x439f92[_0x51153e(0x18b)](_0xdedab2)){_0x136067?.['debug'](_0x51153e(0x10d)+_0xdedab2+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand(['plugin',_0x51153e(0x15d),'remove',_0xdedab2],_0x51153e(0x108)+_0xdedab2+'\x27',_0x136067),_0x136067?.['info']('Marketplace\x20\x27'+_0xdedab2+_0x51153e(0x11f));}catch(_0x3dbc78){_0x136067?.[_0x51153e(0x155)](_0x51153e(0x108)+_0xdedab2+_0x51153e(0xfe)+_0x3dbc78);}}async function restoreDefaultTdSkillsMarketplace(_0x1907b6){const _0x4eae1d=a9_0x20c67e;try{await removeMarketplace(_0x4eae1d(0x113),_0x1907b6),await executeClaudeCommand([_0x4eae1d(0x105),_0x4eae1d(0x15d),_0x4eae1d(0x12a),DEFAULT_TD_SKILLS_URL],undefined,_0x1907b6),_0x1907b6?.['info'](_0x4eae1d(0x136));}catch{}}async function ensureMarketplace(_0x530bfe,_0x209ad5,_0x37ba48,_0x518484){const _0x3abdbf=a9_0x20c67e;_0x37ba48['text']=_0x3abdbf(0x114)+_0x530bfe+_0x3abdbf(0x112),await executeClaudeCommand(['plugin',_0x3abdbf(0x15d),'add',_0x209ad5],_0x3abdbf(0x162)+_0x530bfe+'\x27',_0x518484),_0x37ba48['text']='✓\x20Marketplace\x20\x27'+_0x530bfe+_0x3abdbf(0x117);}async function updateMarketplace(_0x559e36,_0x248fd4,_0x2b8a9d){const _0x35a438=a9_0x20c67e;_0x248fd4[_0x35a438(0xfd)]='Updating\x20marketplace\x20\x27'+_0x559e36+_0x35a438(0x112),await executeClaudeCommand(['plugin',_0x35a438(0x15d),_0x35a438(0x13b)],_0x35a438(0x111)+_0x559e36+'\x27',_0x2b8a9d),_0x248fd4[_0x35a438(0xfd)]='✓\x20Marketplace\x20\x27'+_0x559e36+_0x35a438(0x185);}async function ensurePlugin(_0x3335ec,_0x5009a2,_0x45f9a1,_0x590467){const _0x19428a=a9_0x20c67e;_0x45f9a1['text']=_0x19428a(0x128)+_0x3335ec+_0x19428a(0x112),await executeClaudeCommand([_0x19428a(0x105),'install',_0x3335ec+'@'+_0x5009a2],_0x19428a(0x110)+_0x3335ec+'\x27',_0x590467),_0x45f9a1[_0x19428a(0xfd)]=_0x19428a(0x170)+_0x3335ec+_0x19428a(0x115);}function a9_0x15f6(){const _0x33cce7=['Failed\x20to\x20update\x20marketplace\x20\x27','\x27...','td-skills','Configuring\x20marketplace\x20\x27','\x27\x20installed','resume','\x27\x20configured','getCurrent','toString','description','command','TD\x20Docs\x20MCP\x20Server','tdx-managed-proxy','Command\x20spawn\x20error:\x20','\x27\x20removed','CLAUDE_CODE_NOT_FOUND','sql-skills','\x20already\x20configured','parse','14LgYMFW','--transport','pipe','INVALID_ARGUMENT','Installing\x20plugin\x20\x27','cwd','add','originalSettings','Executing:\x20claude\x20','Command\x20failed\x20(exit\x20','127.0.0.1','logger','logLevel','inherit','144819RHBNwT','error','\x20meets\x20minimum\x20requirement','http://127.0.0.1:','Restored\x20default\x20td-skills\x20marketplace','type','green','account_id','log','update','port','45SkwBlS','name','✓\x20Logging\x20to\x20','tdx\x20--profile\x20','Warning:\x20Failed\x20to\x20configure\x20','stderr','https://docs.treasuredata.com/mcp','already\x20installed','.claude','info','red','http','claude','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','ANTHROPIC_MODEL','ANTHROPIC_AUTH_TOKEN','Failed\x20to\x20spawn\x20claude\x20command:\x20','getLogPath','Command\x20output:\x20','close','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','CLAUDE_CODE_USE_VERTEX','message','already\x20exists','warn','tdx','Creating\x20.claude/settings.local.json...','minor','8387496gHpYHE','statusLine','profile','trim','marketplace','✓\x20Settings\x20restored:\x20.claude/settings.local.json','INSTALLATION_FAILED','false','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','Failed\x20to\x20configure\x20marketplace\x20\x27','cause','11ZarpgI','mcp','\x20is\x20too\x20old\x20(minimum:\x20','env','144kmfTBg','ANTHROPIC_BASE_URL','utf-8','tdx-skills','CLAUDE_CODE_UNSUPPORTED_VERSION','start','6519140loELDr','proxy','✓\x20Plugin\x20\x27','unshift','llm-proxy','execute','list','settings.local.json','Claude\x20Code\x20version\x20check\x20failed','stdout','948304gYODzc','2.0.20','workflow-skills','Claude\x20Code\x20CLI\x20not\x20found','Checking\x20Claude\x20Code\x20version...','site','already\x20configured','Finding\x20available\x20port...','join','93257AmEKZZ','td-docs','exit','400336vkkmbq','\x27\x20updated','passThroughServer','hostname','stringify','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','3332937hYTPzJ','includes','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','\x20or\x20later.','✓\x20Found\x20available\x20port:\x20','Setup\x20failed','patch','debug','\x20configuration\x20failed','CLAUDE_CODE_USE_BEDROCK','fail','text','\x27:\x20','24wIAsWC','INTERNAL','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','https://github.com/treasure-data/td-skills','Configuring\x20MCP\x20server\x20\x27','✓\x20Settings\x20configured:\x20.claude/settings.local.json','plugin','tdx\x20claude\x20statusline','✓\x20MCP\x20server\x20\x27','Failed\x20to\x20remove\x20marketplace\x20\x27','major','✓\x20Logs\x20saved\x20to\x20','string','Claude\x20Code\x20version\x20','Marketplace\x20\x27','stop','Invalid\x20minimum\x20version\x20format:\x20','Failed\x20to\x20install\x20plugin\x20\x27'];a9_0x15f6=function(){return _0x33cce7;};return a9_0x15f6();}async function createClaudeSettings(_0x5930b6,_0x421a2c,_0x43d739){const _0x46fd12=a9_0x20c67e,_0x4271ca=join(process[_0x46fd12(0x129)](),'.claude'),_0x564c9b=join(_0x4271ca,_0x46fd12(0x175));await mkdir(_0x4271ca,{'recursive':!![]});let _0x56f278={};if(existsSync(_0x564c9b))try{const _0x3ad198=await readFile(_0x564c9b,_0x46fd12(0x16a));_0x56f278=JSON[_0x46fd12(0x123)](_0x3ad198);}catch{_0x56f278={};}const _0x1063fa=_0x56f278['env']||{},_0x3098d3={'ANTHROPIC_BASE_URL':_0x1063fa['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x1063fa[_0x46fd12(0x14b)],'ANTHROPIC_AUTH_TOKEN':_0x1063fa[_0x46fd12(0x14c)],'CLAUDE_CODE_USE_BEDROCK':_0x1063fa[_0x46fd12(0x193)],'CLAUDE_CODE_USE_VERTEX':_0x1063fa[_0x46fd12(0x152)],'statusLine':_0x56f278['statusLine']},_0x39d6cb={..._0x56f278,'env':{..._0x1063fa,'ANTHROPIC_BASE_URL':_0x46fd12(0x135)+_0x5930b6,..._0x421a2c&&{'ANTHROPIC_MODEL':_0x421a2c},'ANTHROPIC_AUTH_TOKEN':_0x46fd12(0x11d),'CLAUDE_CODE_USE_BEDROCK':_0x46fd12(0x160),'CLAUDE_CODE_USE_VERTEX':_0x46fd12(0x160)},'statusLine':{'type':_0x46fd12(0x11b),'command':_0x43d739?_0x46fd12(0x140)+_0x43d739+'\x20claude\x20statusline':_0x46fd12(0x106)}};return await writeFile(_0x564c9b,JSON[_0x46fd12(0x188)](_0x39d6cb,null,0x2)+'\x0a'),_0x3098d3;}async function restoreClaudeSettings(_0x23b3e4){const _0x1f0c8d=a9_0x20c67e,_0x1c2f0e=join(process[_0x1f0c8d(0x129)](),_0x1f0c8d(0x145)),_0x16de86=join(_0x1c2f0e,_0x1f0c8d(0x175));if(!existsSync(_0x16de86))return;try{const _0x10785d=await readFile(_0x16de86,_0x1f0c8d(0x16a)),_0x12ccd6=JSON['parse'](_0x10785d),_0x2070cd=_0x12ccd6['env']||{},_0x4a856a=_0x2070cd[_0x1f0c8d(0x169)],_0xd20561=((()=>{const _0x321380=_0x1f0c8d;if(typeof _0x4a856a!==_0x321380(0x10b))return![];try{const _0x259f76=new URL(_0x4a856a);return _0x259f76[_0x321380(0x187)]==='localhost'||_0x259f76['hostname']===_0x321380(0x12e);}catch{return![];}})());_0xd20561?(delete _0x2070cd[_0x1f0c8d(0x169)],delete _0x2070cd['ANTHROPIC_MODEL'],delete _0x2070cd['ANTHROPIC_AUTH_TOKEN'],delete _0x2070cd[_0x1f0c8d(0x193)],delete _0x2070cd[_0x1f0c8d(0x152)]):(_0x23b3e4['ANTHROPIC_BASE_URL']!==undefined?_0x2070cd[_0x1f0c8d(0x169)]=_0x23b3e4[_0x1f0c8d(0x169)]:delete _0x2070cd['ANTHROPIC_BASE_URL'],_0x23b3e4[_0x1f0c8d(0x14b)]!==undefined?_0x2070cd[_0x1f0c8d(0x14b)]=_0x23b3e4[_0x1f0c8d(0x14b)]:delete _0x2070cd['ANTHROPIC_MODEL'],_0x23b3e4[_0x1f0c8d(0x14c)]!==undefined?_0x2070cd[_0x1f0c8d(0x14c)]=_0x23b3e4['ANTHROPIC_AUTH_TOKEN']:delete _0x2070cd[_0x1f0c8d(0x14c)],_0x23b3e4[_0x1f0c8d(0x193)]!==undefined?_0x2070cd[_0x1f0c8d(0x193)]=_0x23b3e4[_0x1f0c8d(0x193)]:delete _0x2070cd[_0x1f0c8d(0x193)],_0x23b3e4['CLAUDE_CODE_USE_VERTEX']!==undefined?_0x2070cd[_0x1f0c8d(0x152)]=_0x23b3e4[_0x1f0c8d(0x152)]:delete _0x2070cd['CLAUDE_CODE_USE_VERTEX']);const _0x4200ee=_0x12ccd6[_0x1f0c8d(0x15a)],_0x226dcf=((()=>{const _0x449928=_0x1f0c8d;if(!_0x4200ee||typeof _0x4200ee!=='object')return![];if(_0x4200ee[_0x449928(0x137)]!==_0x449928(0x11b))return![];if(typeof _0x4200ee[_0x449928(0x11b)]!==_0x449928(0x10b))return![];return _0x4200ee[_0x449928(0x11b)][_0x449928(0x18b)](_0x449928(0x156))&&_0x4200ee['command'][_0x449928(0x18b)]('statusline');})());if(_0x226dcf)delete _0x12ccd6['statusLine'];else _0x23b3e4[_0x1f0c8d(0x15a)]!==undefined?_0x12ccd6['statusLine']=_0x23b3e4[_0x1f0c8d(0x15a)]:delete _0x12ccd6[_0x1f0c8d(0x15a)];_0x12ccd6[_0x1f0c8d(0x167)]=_0x2070cd,await writeFile(_0x16de86,JSON[_0x1f0c8d(0x188)](_0x12ccd6,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x20c67e(0x13e)]=a9_0x20c67e(0x149);[a9_0x20c67e(0x11a)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';[a9_0x20c67e(0x186)];[a9_0x20c67e(0x12b)];[a9_0x20c67e(0x12f)];[a9_0x20c67e(0x13c)];async[a9_0x20c67e(0x173)](_0x102330){const _0x49d33f=a9_0x20c67e,{tdx:_0x40ba02,options:_0x1fb83b,args:_0x4de870}=_0x102330;let _0x2d8157=![];try{const _0x48e725=_0x1fb83b,_0x1e5d80=_0x48e725[_0x49d33f(0x16f)]===![],_0x174eac=_0x48e725['continue']===!![],_0x581742=_0x48e725[_0x49d33f(0x116)]===!![],_0x390098=[..._0x4de870];if(_0x174eac)_0x390098[_0x49d33f(0x171)]('-c');else _0x581742&&_0x390098[_0x49d33f(0x171)]('-r');const _0x89bd7d=createCommandSpinner('Initializing...',{'verbose':_0x1fb83b['verbose']});_0x89bd7d['start']();try{if(!_0x1e5d80){_0x89bd7d['text']=_0x49d33f(0x17f),this[_0x49d33f(0x13c)]=await findAvailablePort(0xfa0),_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x18e)+this[_0x49d33f(0x13c)];const _0x3d440d=_0x1fb83b[_0x49d33f(0x15b)];try{const _0x2dc3d1=await _0x40ba02['user'][_0x49d33f(0x118)]();_0x2dc3d1[_0x49d33f(0x139)]&&writeCachedAccountInfo(_0x1fb83b['site'],_0x2dc3d1['account_id'],_0x3d440d);}catch{}_0x89bd7d[_0x49d33f(0xfd)]='Initializing\x20proxy\x20logger...',this[_0x49d33f(0x12f)]=new TDXLogger(_0x1fb83b[_0x49d33f(0x130)],!![]),await this['logger']['init']();const _0x491388=this[_0x49d33f(0x12f)][_0x49d33f(0x14e)]();_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x13f)+_0x491388;const _0x40c3b5=getEndpoint(_0x1fb83b[_0x49d33f(0x17d)],_0x49d33f(0x172));_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x161);if(!_0x40ba02['context']['apiKey'])throw new SDKError(ErrorCode[_0x49d33f(0x127)],_0x49d33f(0x151));this[_0x49d33f(0x186)]=new PassThroughProxyServer({'port':this['port'],'llmProxyUrl':_0x40c3b5,'apiKey':_0x40ba02['context']['apiKey'],'logger':this[_0x49d33f(0x12f)],'site':_0x1fb83b[_0x49d33f(0x17d)],'profile':_0x3d440d}),await this[_0x49d33f(0x186)][_0x49d33f(0x16d)](),_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x101)+this['port']+'\x20→\x20'+_0x40c3b5,_0x89bd7d['text']=_0x49d33f(0x157),this[_0x49d33f(0x12b)]=await createClaudeSettings(this[_0x49d33f(0x13c)],undefined,_0x3d440d),_0x89bd7d['text']=_0x49d33f(0x104);}else _0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x189);try{_0x89bd7d[_0x49d33f(0xfd)]=_0x49d33f(0x17c),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x49d33f(0x12f)]),_0x89bd7d[_0x49d33f(0xfd)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x32e726){_0x89bd7d[_0x49d33f(0x194)](_0x49d33f(0x176));throw _0x32e726;}try{await ensureMcpServer(_0x49d33f(0x182),_0x49d33f(0x143),_0x49d33f(0x148),_0x89bd7d,this[_0x49d33f(0x12f)]);}catch(_0x264554){handleInstallationError(_0x264554,_0x49d33f(0x11c),_0x89bd7d,this[_0x49d33f(0x12f)]);}try{const _0x81abc5=getTdSkillsRepoUrl();_0x2d8157=_0x81abc5!==DEFAULT_TD_SKILLS_URL,_0x2d8157&&await removeMarketplace(_0x49d33f(0x113),this[_0x49d33f(0x12f)]),await ensureMarketplace('td-skills',_0x81abc5,_0x89bd7d,this[_0x49d33f(0x12f)]),await updateMarketplace('td-skills',_0x89bd7d,this[_0x49d33f(0x12f)]),await ensurePlugin(_0x49d33f(0x121),_0x49d33f(0x113),_0x89bd7d,this['logger']),await ensurePlugin(_0x49d33f(0x17a),_0x49d33f(0x113),_0x89bd7d,this[_0x49d33f(0x12f)]),await ensurePlugin(_0x49d33f(0x16b),_0x49d33f(0x113),_0x89bd7d,this['logger']);}catch(_0x3cc067){handleInstallationError(_0x3cc067,'td-skills\x20Plugins',_0x89bd7d,this[_0x49d33f(0x12f)]);}_0x89bd7d[_0x49d33f(0x10e)]();}catch(_0x8ec9f2){_0x89bd7d[_0x49d33f(0x194)](_0x49d33f(0x18f));throw _0x8ec9f2;}const _0x32b372=await findExecutable(_0x49d33f(0x149));if(!_0x32b372)throw new SDKError(ErrorCode[_0x49d33f(0x120)],_0x49d33f(0x17b),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x653f97={...process.env};!_0x1e5d80&&(_0x653f97[_0x49d33f(0x169)]=_0x49d33f(0x135)+this[_0x49d33f(0x13c)],_0x653f97[_0x49d33f(0x14c)]='tdx-managed-proxy',_0x653f97[_0x49d33f(0x193)]=_0x49d33f(0x160),_0x653f97[_0x49d33f(0x152)]=_0x49d33f(0x160));const _0x12f4b2=crossSpawn(_0x32b372,_0x390098,{'stdio':_0x49d33f(0x131),'env':_0x653f97}),_0xf16bef=await new Promise(_0x508b6c=>{const _0x4ee63b=_0x49d33f;_0x12f4b2['on'](_0x4ee63b(0x183),_0x470ba4=>{_0x508b6c(_0x470ba4||0x0);}),_0x12f4b2['on'](_0x4ee63b(0x133),_0x2a177d=>{const _0x14b456=_0x4ee63b;console[_0x14b456(0x133)](a9_0x54a3dc[_0x14b456(0x147)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x2a177d[_0x14b456(0x153)])),_0x508b6c(0x1);});});_0x2d8157&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&(await this[_0x49d33f(0x186)][_0x49d33f(0x10e)](),console[_0x49d33f(0x13a)](a9_0x54a3dc[_0x49d33f(0x138)]('✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped')));if(this[_0x49d33f(0x12f)]){await this[_0x49d33f(0x12f)][_0x49d33f(0x150)]();const _0x681342=this[_0x49d33f(0x12f)][_0x49d33f(0x14e)]();console[_0x49d33f(0x13a)](a9_0x54a3dc[_0x49d33f(0x138)](_0x49d33f(0x10a)+_0x681342));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x49d33f(0x12b)]),console[_0x49d33f(0x13a)](a9_0x54a3dc[_0x49d33f(0x138)](_0x49d33f(0x15e)))),_0xf16bef;}catch(_0x5ca058){_0x2d8157&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&await this[_0x49d33f(0x186)][_0x49d33f(0x10e)]();this[_0x49d33f(0x12f)]&&await this['logger']['close']();this[_0x49d33f(0x12b)]&&await restoreClaudeSettings(this[_0x49d33f(0x12b)]);throw _0x5ca058;}}}
@@ -1 +1 @@
1
- function a10_0x8feb(_0xe9968,_0x2ce250){_0xe9968=_0xe9968-0x131;const _0x3f13fb=a10_0x3f13();let _0x8feba6=_0x3f13fb[_0xe9968];return _0x8feba6;}const a10_0x252adc=a10_0x8feb;(function(_0x2463a0,_0x5beff9){const _0x3ed2aa=a10_0x8feb,_0x53ac90=_0x2463a0();while(!![]){try{const _0x4f143d=parseInt(_0x3ed2aa(0x135))/0x1*(parseInt(_0x3ed2aa(0x148))/0x2)+parseInt(_0x3ed2aa(0x156))/0x3*(parseInt(_0x3ed2aa(0x13f))/0x4)+-parseInt(_0x3ed2aa(0x138))/0x5*(parseInt(_0x3ed2aa(0x14b))/0x6)+parseInt(_0x3ed2aa(0x150))/0x7*(parseInt(_0x3ed2aa(0x154))/0x8)+parseInt(_0x3ed2aa(0x14c))/0x9+-parseInt(_0x3ed2aa(0x141))/0xa*(-parseInt(_0x3ed2aa(0x155))/0xb)+parseInt(_0x3ed2aa(0x14d))/0xc*(-parseInt(_0x3ed2aa(0x13b))/0xd);if(_0x4f143d===_0x5beff9)break;else _0x53ac90['push'](_0x53ac90['shift']());}catch(_0x1a552c){_0x53ac90['push'](_0x53ac90['shift']());}}}(a10_0x3f13,0x66b61));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';function a10_0x3f13(){const _0x1908b8=['parse','\x20|\x20','16718cSIVOB','🧠\x20','sessionCredits','profile','27788wgeJdZ','💎\x20tdx\x20-\x20Claude','7202860KWGQeF','statusline','accountId','description','site','session_id','Claude','2pPsGRo','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','🪙\x20credit:\x20','1071090bQzemq','811107TBxyzE','8016UzWTgR','latestInputTokens','options','28lrENgm','tdx','tdx\x20','toFixed','207112DnfUjK','11bGGAaz','363XnqdAh','model','join','monthCredits','name','log','push','60746KXVRLv','line','stdin','15WocVdw'];a10_0x3f13=function(){return _0x1908b8;};return a10_0x3f13();}import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0xc40cb2=0x64){return new Promise(_0x534a8c=>{const _0x472623=a10_0x8feb;let _0x12b8c9='',_0x58dd9a=![];const _0x1c9759=createInterface({'input':process[_0x472623(0x137)],'terminal':![]}),_0x52464b=_0xc0fe8c=>{if(_0x58dd9a)return;_0x58dd9a=!![],clearTimeout(_0x5ad07a),_0x1c9759['close'](),_0x534a8c(_0xc0fe8c);},_0x5ad07a=setTimeout(()=>{_0x52464b(null);},_0xc40cb2);_0x1c9759['on'](_0x472623(0x136),_0x10dfad=>{_0x12b8c9+=_0x10dfad;}),_0x1c9759['on']('close',()=>{const _0x577eec=_0x472623;if(_0x58dd9a)return;try{const _0x2c39cf=JSON[_0x577eec(0x139)](_0x12b8c9);_0x52464b(_0x2c39cf);}catch{_0x52464b(null);}});});}function formatCredits(_0x580d8e){const _0x5daa01=a10_0x8feb;return _0x580d8e[_0x5daa01(0x153)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x252adc(0x132)]=a10_0x252adc(0x142);[a10_0x252adc(0x144)]=a10_0x252adc(0x149);async['execute'](_0xc3963b){const _0x3ee6d8=a10_0x252adc;try{const _0x2aa838=await readStdinJson();if(!_0x2aa838?.[_0x3ee6d8(0x146)])return console[_0x3ee6d8(0x133)](_0x3ee6d8(0x140)),0x0;const _0x1364f4=_0x2aa838[_0x3ee6d8(0x146)],_0x1df734=_0x2aa838[_0x3ee6d8(0x157)]?.['id']||'',_0x1812df=_0x2aa838[_0x3ee6d8(0x13e)]||_0xc3963b[_0x3ee6d8(0x14f)]['profile'],_0x4df87e=await getUsageStats(_0x1364f4,_0x1812df),_0x1ede2b=[],_0x1c15e3=readCachedAccountInfo(_0x1812df),_0x3e8403=_0x1c15e3?_0x3ee6d8(0x152)+_0x1c15e3[_0x3ee6d8(0x145)]+':'+_0x1c15e3[_0x3ee6d8(0x143)]:_0x3ee6d8(0x151),_0x35e96e=_0x1df734?getModelDisplayName(_0x1df734):_0x3ee6d8(0x147);_0x1ede2b[_0x3ee6d8(0x134)]('💎\x20'+_0x3e8403+'\x20-\x20'+_0x35e96e);const _0x4fa2a1=formatCredits(_0x4df87e[_0x3ee6d8(0x13d)]),_0x560049=formatCredits(_0x4df87e['todayCredits']),_0x311358=formatCredits(_0x4df87e[_0x3ee6d8(0x131)]);_0x1ede2b['push'](_0x3ee6d8(0x14a)+_0x4fa2a1+'\x20session\x20/\x20'+_0x560049+'\x20today\x20/\x20'+_0x311358+'\x20month');if(_0x4df87e['latestInputTokens']>0x0&&_0x1df734){const _0x114d17=formatTokenCount(_0x4df87e[_0x3ee6d8(0x14e)]),_0x37cb8f=calculateContextPercentage(_0x4df87e[_0x3ee6d8(0x14e)],_0x1df734);_0x1ede2b[_0x3ee6d8(0x134)](_0x3ee6d8(0x13c)+_0x114d17+'\x20('+_0x37cb8f+'%)');}return console['log'](_0x1ede2b[_0x3ee6d8(0x158)](_0x3ee6d8(0x13a))),0x0;}catch{return console[_0x3ee6d8(0x133)](_0x3ee6d8(0x140)),0x0;}}}
1
+ const a10_0x543cdb=a10_0x35bf;(function(_0x432247,_0x372e3a){const _0x5404e3=a10_0x35bf,_0x50a540=_0x432247();while(!![]){try{const _0x1f8bd8=parseInt(_0x5404e3(0x13a))/0x1+parseInt(_0x5404e3(0x13f))/0x2*(-parseInt(_0x5404e3(0x15c))/0x3)+-parseInt(_0x5404e3(0x154))/0x4+parseInt(_0x5404e3(0x152))/0x5+parseInt(_0x5404e3(0x159))/0x6*(parseInt(_0x5404e3(0x145))/0x7)+-parseInt(_0x5404e3(0x153))/0x8+parseInt(_0x5404e3(0x146))/0x9*(parseInt(_0x5404e3(0x141))/0xa);if(_0x1f8bd8===_0x372e3a)break;else _0x50a540['push'](_0x50a540['shift']());}catch(_0x274b49){_0x50a540['push'](_0x50a540['shift']());}}}(a10_0x3b8d,0x4adc5));import{createInterface}from'node:readline';function a10_0x35bf(_0x109811,_0x25e28a){_0x109811=_0x109811-0x137;const _0x3b8d26=a10_0x3b8d();let _0x35bf15=_0x3b8d26[_0x109811];return _0x35bf15;}function a10_0x3b8d(){const _0x504123=['profile','push','1371mRLBWm','latestInputTokens','\x20session\x20/\x20','💎\x20tdx\x20-\x20Claude','join','179594bYwErU','monthCredits','stdin','todayCredits','site','802HmgTzP','statusline','130QBNSNg','toFixed','sessionCredits','options','7qCtonP','721467wAUzka','🧠\x20','tdx','accountId','name','\x20-\x20','description','tdx\x20','🪙\x20credit:\x20','parse','\x20today\x20/\x20','Claude','1072260GqtoZK','4575360XlNszf','2129272rGxuxC','session_id','log','execute','💎\x20','947754EiIiFb'];a10_0x3b8d=function(){return _0x504123;};return a10_0x3b8d();}import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x37273b=0x64){return new Promise(_0x49797b=>{const _0x9cb462=a10_0x35bf;let _0x32f6d3='',_0x3dc2cf=![];const _0x55958f=createInterface({'input':process[_0x9cb462(0x13c)],'terminal':![]}),_0x1ecf9b=_0x2e6d1b=>{if(_0x3dc2cf)return;_0x3dc2cf=!![],clearTimeout(_0x5738de),_0x55958f['close'](),_0x49797b(_0x2e6d1b);},_0x5738de=setTimeout(()=>{_0x1ecf9b(null);},_0x37273b);_0x55958f['on']('line',_0x3f11d1=>{_0x32f6d3+=_0x3f11d1;}),_0x55958f['on']('close',()=>{const _0x178e32=_0x9cb462;if(_0x3dc2cf)return;try{const _0x4cd1e9=JSON[_0x178e32(0x14f)](_0x32f6d3);_0x1ecf9b(_0x4cd1e9);}catch{_0x1ecf9b(null);}});});}function formatCredits(_0x230d9c){const _0xa6ff3b=a10_0x35bf;return _0x230d9c[_0xa6ff3b(0x142)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x543cdb(0x14a)]=a10_0x543cdb(0x140);[a10_0x543cdb(0x14c)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async[a10_0x543cdb(0x157)](_0x432372){const _0x13027e=a10_0x543cdb;try{const _0x55a2ce=await readStdinJson();if(!_0x55a2ce?.[_0x13027e(0x155)])return console[_0x13027e(0x156)]('💎\x20tdx\x20-\x20Claude'),0x0;const _0x3d47ba=_0x55a2ce[_0x13027e(0x155)],_0x2b58e9=_0x55a2ce['model']?.['id']||'',_0x5c5890=_0x55a2ce[_0x13027e(0x15a)]||_0x432372[_0x13027e(0x144)][_0x13027e(0x15a)],_0x364133=await getUsageStats(_0x3d47ba,_0x5c5890),_0x2c5de9=[],_0x216dc7=readCachedAccountInfo(_0x5c5890),_0x34c8d7=_0x216dc7?_0x13027e(0x14d)+_0x216dc7[_0x13027e(0x13e)]+':'+_0x216dc7[_0x13027e(0x149)]:_0x13027e(0x148),_0x4eddeb=_0x2b58e9?getModelDisplayName(_0x2b58e9):_0x13027e(0x151);_0x2c5de9[_0x13027e(0x15b)](_0x13027e(0x158)+_0x34c8d7+_0x13027e(0x14b)+_0x4eddeb);const _0x27b544=formatCredits(_0x364133[_0x13027e(0x143)]),_0x544bb7=formatCredits(_0x364133[_0x13027e(0x13d)]),_0x1fecb3=formatCredits(_0x364133[_0x13027e(0x13b)]);_0x2c5de9[_0x13027e(0x15b)](_0x13027e(0x14e)+_0x27b544+_0x13027e(0x137)+_0x544bb7+_0x13027e(0x150)+_0x1fecb3+'\x20month');if(_0x364133[_0x13027e(0x15d)]>0x0&&_0x2b58e9){const _0x1e3aa6=formatTokenCount(_0x364133[_0x13027e(0x15d)]),_0x569970=calculateContextPercentage(_0x364133[_0x13027e(0x15d)],_0x2b58e9);_0x2c5de9[_0x13027e(0x15b)](_0x13027e(0x147)+_0x1e3aa6+'\x20('+_0x569970+'%)');}return console[_0x13027e(0x156)](_0x2c5de9[_0x13027e(0x139)]('\x20|\x20')),0x0;}catch{return console['log'](_0x13027e(0x138)),0x0;}}}
@@ -1 +1 @@
1
- const a11_0x337e99=a11_0x9a3a;(function(_0x168308,_0x504d49){const _0x1a1221=a11_0x9a3a,_0x18add9=_0x168308();while(!![]){try{const _0x2b5887=-parseInt(_0x1a1221(0x113))/0x1+parseInt(_0x1a1221(0x124))/0x2*(parseInt(_0x1a1221(0x111))/0x3)+parseInt(_0x1a1221(0x130))/0x4+-parseInt(_0x1a1221(0x134))/0x5+parseInt(_0x1a1221(0x120))/0x6+parseInt(_0x1a1221(0x119))/0x7+-parseInt(_0x1a1221(0x122))/0x8;if(_0x2b5887===_0x504d49)break;else _0x18add9['push'](_0x18add9['shift']());}catch(_0x29f0f0){_0x18add9['push'](_0x18add9['shift']());}}}(a11_0x2137,0xaede1));import a11_0x3c3ee1 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 a11_0x2137(){const _0x3de63f=['outputTable','numeric','Usage\x20by\x20Profile','short','1643016Hhxhgh','en-CA','json','Unknown\x20error','1992905MXoFRx','bold','Last\x20Used','todayCredits','format','monthCredits','entryCount','Usage\x20by\x20Source','round','repeat','all','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','jsonl','Total','\x20days\x20ago','never','\x20credits','error','today\x20','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','default','profile','en-US','profileCount','(default)','source','description','\x20\x20Total:\x20\x20\x20','\x20\x20Month:\x20\x20\x20','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','15hvntFM','name','353374KnZzTm','yesterday','cyan','toLocaleTimeString','Credits','message','1524488NvSwDC','length','usage','credits','Source','toLocaleDateString','padEnd','6757290NNnxpn','2-digit','5920608HaWPxj','\x20\x20Today:\x20\x20\x20','181414ewHOrX','dim','getTime','lastUsedAt','Requests','padStart','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','log'];a11_0x2137=function(){return _0x3de63f;};return a11_0x2137();}function formatCredits(_0x54414b){return _0x54414b['toFixed'](0x2);}function a11_0x9a3a(_0x58595f,_0x18bae2){_0x58595f=_0x58595f-0x10b;const _0x213725=a11_0x2137();let _0x9a3abf=_0x213725[_0x58595f];return _0x9a3abf;}function formatLastUsed(_0x9723f2){const _0x1cda2d=a11_0x9a3a;if(!_0x9723f2)return _0x1cda2d(0x143);const _0x41fb04=new Date(_0x9723f2),_0x421842=new Date(),_0x324c22=_0x41fb04[_0x1cda2d(0x11e)](_0x1cda2d(0x131)),_0xf3b06e=_0x421842[_0x1cda2d(0x11e)]('en-CA');if(_0x324c22===_0xf3b06e)return _0x1cda2d(0x146)+_0x41fb04[_0x1cda2d(0x116)](_0x1cda2d(0x14a),{'hour':_0x1cda2d(0x121),'minute':'2-digit'});const _0x8fa73=new Date(_0x324c22),_0x10222d=new Date(_0xf3b06e),_0x260b72=Math[_0x1cda2d(0x13c)]((_0x10222d[_0x1cda2d(0x126)]()-_0x8fa73[_0x1cda2d(0x126)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x260b72===0x1)return _0x1cda2d(0x114);else return _0x260b72>0x1&&_0x260b72<0x7?_0x260b72+_0x1cda2d(0x142):_0x41fb04[_0x1cda2d(0x11e)](_0x1cda2d(0x14a),{'month':_0x1cda2d(0x12f),'day':_0x1cda2d(0x12d)});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x337e99(0x112)]=a11_0x337e99(0x11b);[a11_0x337e99(0x10d)]=a11_0x337e99(0x147);async['execute'](_0x125514){const _0x2812c2=a11_0x337e99,{options:_0x481a24}=_0x125514,_0x2e7205=_0x481a24['format']===_0x2812c2(0x132)||_0x481a24[_0x2812c2(0x138)]===_0x2812c2(0x140)||_0x481a24[_0x2812c2(0x132)];try{const [_0x5abb40,_0x10a3ff,_0x93997e]=await Promise[_0x2812c2(0x13e)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x2e7205?await this['outputStructured'](_0x5abb40,_0x10a3ff,_0x93997e,_0x481a24):this[_0x2812c2(0x12c)](_0x5abb40,_0x10a3ff,_0x93997e),0x0;}catch(_0x50845e){const _0x7afe5d=_0x50845e instanceof Error?_0x50845e[_0x2812c2(0x118)]:_0x2812c2(0x133);return console[_0x2812c2(0x145)](a11_0x3c3ee1['red']('Error:\x20'+_0x7afe5d)),0x1;}}async['outputStructured'](_0x45ac53,_0x374fab,_0x4f16bf,_0x558c42){const _0x598669=a11_0x337e99,_0x358806={'summary':{'todayCredits':_0x4f16bf[_0x598669(0x137)],'monthCredits':_0x4f16bf[_0x598669(0x139)],'totalCredits':_0x4f16bf['totalCredits'],'profileCount':_0x4f16bf[_0x598669(0x14b)]},'profiles':_0x45ac53['map'](_0x49c0d7=>({'profile':_0x49c0d7['profile'],'credits':_0x49c0d7['credits'],'requests':_0x49c0d7['entryCount'],'lastUsedAt':_0x49c0d7['lastUsedAt']})),'sources':_0x374fab['map'](_0x761c81=>({'source':_0x761c81[_0x598669(0x10c)],'credits':_0x761c81['credits'],'todayCredits':_0x761c81['todayCredits'],'monthCredits':_0x761c81['monthCredits'],'requests':_0x761c81[_0x598669(0x13a)]}))};await handleSDKOutput([_0x358806],_0x558c42);}[a11_0x337e99(0x12c)](_0x51a051,_0x251d94,_0x58f259){const _0x5ed92f=a11_0x337e99;console['log'](a11_0x3c3ee1['bold'](_0x5ed92f(0x12a))),console[_0x5ed92f(0x12b)](a11_0x3c3ee1[_0x5ed92f(0x125)]('─'[_0x5ed92f(0x13d)](0x32))),console['log'](_0x5ed92f(0x123)+a11_0x3c3ee1[_0x5ed92f(0x115)](formatCredits(_0x58f259[_0x5ed92f(0x137)]))+_0x5ed92f(0x144)),console['log'](_0x5ed92f(0x10f)+a11_0x3c3ee1[_0x5ed92f(0x115)](formatCredits(_0x58f259['monthCredits']))+'\x20credits'),console['log'](_0x5ed92f(0x10e)+a11_0x3c3ee1['cyan'](formatCredits(_0x58f259['totalCredits']))+'\x20credits'),console['log']();if(_0x251d94[_0x5ed92f(0x11a)]>0x0){console[_0x5ed92f(0x12b)](a11_0x3c3ee1[_0x5ed92f(0x135)](_0x5ed92f(0x13b))),console['log'](a11_0x3c3ee1[_0x5ed92f(0x125)]('─'[_0x5ed92f(0x13d)](0x3c)));const _0x2f365a=0xc,_0x6f7ec7=0xa,_0x1ad61c=0xa,_0x49ec02=0xa;console[_0x5ed92f(0x12b)]('\x20\x20'+_0x5ed92f(0x11d)['padEnd'](_0x2f365a)+'\x20\x20'+_0x5ed92f(0x141)[_0x5ed92f(0x129)](_0x6f7ec7)+'\x20\x20'+'Today'[_0x5ed92f(0x129)](_0x1ad61c)+'\x20\x20'+'Month'[_0x5ed92f(0x129)](_0x49ec02));for(const _0x4d781c of _0x251d94){console[_0x5ed92f(0x12b)]('\x20\x20'+_0x4d781c['source'][_0x5ed92f(0x11f)](_0x2f365a)+'\x20\x20'+a11_0x3c3ee1['cyan'](formatCredits(_0x4d781c[_0x5ed92f(0x11c)])[_0x5ed92f(0x129)](_0x6f7ec7))+'\x20\x20'+formatCredits(_0x4d781c[_0x5ed92f(0x137)])[_0x5ed92f(0x129)](_0x1ad61c)+'\x20\x20'+formatCredits(_0x4d781c[_0x5ed92f(0x139)])[_0x5ed92f(0x129)](_0x49ec02));}console[_0x5ed92f(0x12b)]();}if(_0x51a051['length']===0x0){console[_0x5ed92f(0x12b)](a11_0x3c3ee1['dim']('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console[_0x5ed92f(0x12b)](a11_0x3c3ee1[_0x5ed92f(0x125)](_0x5ed92f(0x110)));return;}console[_0x5ed92f(0x12b)](a11_0x3c3ee1[_0x5ed92f(0x135)](_0x5ed92f(0x12e))),console[_0x5ed92f(0x12b)](a11_0x3c3ee1['dim']('─'[_0x5ed92f(0x13d)](0x3c)));const _0x5ca22a=Math['max'](0xc,..._0x51a051['map'](_0x12d4df=>_0x12d4df[_0x5ed92f(0x149)]===_0x5ed92f(0x148)?_0x5ed92f(0x10b)[_0x5ed92f(0x11a)]:_0x12d4df[_0x5ed92f(0x149)][_0x5ed92f(0x11a)])),_0x54f0ae=0xa,_0xf1e7dd=0xa;console[_0x5ed92f(0x12b)]('\x20\x20'+'Profile'[_0x5ed92f(0x11f)](_0x5ca22a)+'\x20\x20'+_0x5ed92f(0x117)[_0x5ed92f(0x129)](_0x54f0ae)+'\x20\x20'+_0x5ed92f(0x128)[_0x5ed92f(0x129)](_0xf1e7dd)+'\x20\x20'+_0x5ed92f(0x136));for(const _0x84c399 of _0x51a051){const _0x4b2f85=_0x84c399['profile']==='default'?_0x5ed92f(0x10b):_0x84c399[_0x5ed92f(0x149)],_0x21d71e=_0x4b2f85[_0x5ed92f(0x11f)](_0x5ca22a),_0x4b204a=_0x84c399['profile']===_0x5ed92f(0x148)?a11_0x3c3ee1['dim'](_0x21d71e):_0x21d71e;console[_0x5ed92f(0x12b)]('\x20\x20'+_0x4b204a+'\x20\x20'+a11_0x3c3ee1['cyan'](formatCredits(_0x84c399['credits'])[_0x5ed92f(0x129)](_0x54f0ae))+'\x20\x20'+String(_0x84c399[_0x5ed92f(0x13a)])[_0x5ed92f(0x129)](_0xf1e7dd)+'\x20\x20'+a11_0x3c3ee1[_0x5ed92f(0x125)](formatLastUsed(_0x84c399[_0x5ed92f(0x127)])));}console[_0x5ed92f(0x12b)](),console['log'](a11_0x3c3ee1['dim'](_0x5ed92f(0x13f))),console['log']();}}
1
+ const a11_0x5c9516=a11_0x2bfb;(function(_0x5675f4,_0x54fabf){const _0xf15460=a11_0x2bfb,_0x825fa5=_0x5675f4();while(!![]){try{const _0x5e12ba=parseInt(_0xf15460(0x159))/0x1+parseInt(_0xf15460(0x140))/0x2*(parseInt(_0xf15460(0x14c))/0x3)+parseInt(_0xf15460(0x15c))/0x4+parseInt(_0xf15460(0x130))/0x5*(-parseInt(_0xf15460(0x134))/0x6)+parseInt(_0xf15460(0x13f))/0x7*(-parseInt(_0xf15460(0x157))/0x8)+-parseInt(_0xf15460(0x125))/0x9+-parseInt(_0xf15460(0x145))/0xa;if(_0x5e12ba===_0x54fabf)break;else _0x825fa5['push'](_0x825fa5['shift']());}catch(_0x2eb41a){_0x825fa5['push'](_0x825fa5['shift']());}}}(a11_0x4916,0x95d62));import a11_0x5b46bf from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a11_0x4916(){const _0x428500=['\x20days\x20ago','bold','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','en-US','todayCredits','Month','numeric','Last\x20Used','default','execute','173790PgvjfA','getTime','dim','entryCount','toLocaleTimeString','yesterday','format','today\x20','credits','never','\x20\x20Month:\x20\x20\x20','285qXwRYZ','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','padStart','message','88638CRdLYm','jsonl','Total','Source','\x20credits','Usage\x20by\x20Profile','monthCredits','source','log','outputStructured','totalCredits','14QUNOro','2RMDdap','repeat','error','cyan','(default)','4449730mSlGxj','length','toLocaleDateString','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Unknown\x20error','en-CA','all','1071249ZMtjqg','description','map','\x20\x20Total:\x20\x20\x20','2-digit','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','Today','Credits','max','usage','Profile','1373536XCEBAO','json','740690PfnugX','toFixed','padEnd','4662740jmjiPx','profile','name'];a11_0x4916=function(){return _0x428500;};return a11_0x4916();}import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function a11_0x2bfb(_0x3fec92,_0x5098df){_0x3fec92=_0x3fec92-0x123;const _0x4916f0=a11_0x4916();let _0x2bfb8a=_0x4916f0[_0x3fec92];return _0x2bfb8a;}function formatCredits(_0x4c0a88){const _0x4bb563=a11_0x2bfb;return _0x4c0a88[_0x4bb563(0x15a)](0x2);}function formatLastUsed(_0x167c63){const _0xec10dd=a11_0x2bfb;if(!_0x167c63)return _0xec10dd(0x12e);const _0x35da5b=new Date(_0x167c63),_0x4cfa9d=new Date(),_0x91b0d7=_0x35da5b[_0xec10dd(0x147)](_0xec10dd(0x14a)),_0x5aee37=_0x4cfa9d[_0xec10dd(0x147)](_0xec10dd(0x14a));if(_0x91b0d7===_0x5aee37)return _0xec10dd(0x12c)+_0x35da5b[_0xec10dd(0x129)]('en-US',{'hour':_0xec10dd(0x150),'minute':_0xec10dd(0x150)});const _0x2a146d=new Date(_0x91b0d7),_0x449738=new Date(_0x5aee37),_0x5741a0=Math['round']((_0x449738['getTime']()-_0x2a146d[_0xec10dd(0x126)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5741a0===0x1)return _0xec10dd(0x12a);else return _0x5741a0>0x1&&_0x5741a0<0x7?_0x5741a0+_0xec10dd(0x15f):_0x35da5b[_0xec10dd(0x147)](_0xec10dd(0x162),{'month':'short','day':_0xec10dd(0x165)});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x5c9516(0x15e)]=a11_0x5c9516(0x155);[a11_0x5c9516(0x14d)]=a11_0x5c9516(0x131);async[a11_0x5c9516(0x124)](_0xbb101e){const _0x1a3a2d=a11_0x5c9516,{options:_0x3ff9fe}=_0xbb101e,_0x4fdb55=_0x3ff9fe[_0x1a3a2d(0x12b)]===_0x1a3a2d(0x158)||_0x3ff9fe['format']===_0x1a3a2d(0x135)||_0x3ff9fe[_0x1a3a2d(0x158)];try{const [_0x6220cd,_0x3368ba,_0xb2ea22]=await Promise[_0x1a3a2d(0x14b)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x4fdb55?await this[_0x1a3a2d(0x13d)](_0x6220cd,_0x3368ba,_0xb2ea22,_0x3ff9fe):this['outputTable'](_0x6220cd,_0x3368ba,_0xb2ea22),0x0;}catch(_0x122773){const _0x4e7339=_0x122773 instanceof Error?_0x122773[_0x1a3a2d(0x133)]:_0x1a3a2d(0x149);return console[_0x1a3a2d(0x142)](a11_0x5b46bf['red']('Error:\x20'+_0x4e7339)),0x1;}}async[a11_0x5c9516(0x13d)](_0x1877da,_0x31353c,_0x3b7511,_0x32cd00){const _0x31bd39=a11_0x5c9516,_0x7f2d62={'summary':{'todayCredits':_0x3b7511['todayCredits'],'monthCredits':_0x3b7511['monthCredits'],'totalCredits':_0x3b7511[_0x31bd39(0x13e)],'profileCount':_0x3b7511['profileCount']},'profiles':_0x1877da[_0x31bd39(0x14e)](_0x411d4f=>({'profile':_0x411d4f[_0x31bd39(0x15d)],'credits':_0x411d4f[_0x31bd39(0x12d)],'requests':_0x411d4f[_0x31bd39(0x128)],'lastUsedAt':_0x411d4f['lastUsedAt']})),'sources':_0x31353c['map'](_0x3bfeec=>({'source':_0x3bfeec[_0x31bd39(0x13b)],'credits':_0x3bfeec[_0x31bd39(0x12d)],'todayCredits':_0x3bfeec[_0x31bd39(0x163)],'monthCredits':_0x3bfeec['monthCredits'],'requests':_0x3bfeec[_0x31bd39(0x128)]}))};await handleSDKOutput([_0x7f2d62],_0x32cd00);}['outputTable'](_0x25cb5a,_0x1fc9ae,_0x3c0041){const _0xfaf935=a11_0x5c9516;console[_0xfaf935(0x13c)](a11_0x5b46bf[_0xfaf935(0x160)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console[_0xfaf935(0x13c)](a11_0x5b46bf[_0xfaf935(0x127)]('─'[_0xfaf935(0x141)](0x32))),console[_0xfaf935(0x13c)]('\x20\x20Today:\x20\x20\x20'+a11_0x5b46bf['cyan'](formatCredits(_0x3c0041[_0xfaf935(0x163)]))+_0xfaf935(0x138)),console[_0xfaf935(0x13c)](_0xfaf935(0x12f)+a11_0x5b46bf[_0xfaf935(0x143)](formatCredits(_0x3c0041['monthCredits']))+_0xfaf935(0x138)),console[_0xfaf935(0x13c)](_0xfaf935(0x14f)+a11_0x5b46bf[_0xfaf935(0x143)](formatCredits(_0x3c0041[_0xfaf935(0x13e)]))+_0xfaf935(0x138)),console[_0xfaf935(0x13c)]();if(_0x1fc9ae['length']>0x0){console[_0xfaf935(0x13c)](a11_0x5b46bf[_0xfaf935(0x160)]('Usage\x20by\x20Source')),console['log'](a11_0x5b46bf['dim']('─'[_0xfaf935(0x141)](0x3c)));const _0x3db708=0xc,_0x1947d1=0xa,_0x4dd35c=0xa,_0x4dcff3=0xa;console[_0xfaf935(0x13c)]('\x20\x20'+_0xfaf935(0x137)[_0xfaf935(0x15b)](_0x3db708)+'\x20\x20'+_0xfaf935(0x136)[_0xfaf935(0x132)](_0x1947d1)+'\x20\x20'+_0xfaf935(0x152)[_0xfaf935(0x132)](_0x4dd35c)+'\x20\x20'+_0xfaf935(0x164)['padStart'](_0x4dcff3));for(const _0x223d5d of _0x1fc9ae){console['log']('\x20\x20'+_0x223d5d[_0xfaf935(0x13b)][_0xfaf935(0x15b)](_0x3db708)+'\x20\x20'+a11_0x5b46bf['cyan'](formatCredits(_0x223d5d['credits'])[_0xfaf935(0x132)](_0x1947d1))+'\x20\x20'+formatCredits(_0x223d5d[_0xfaf935(0x163)])[_0xfaf935(0x132)](_0x4dd35c)+'\x20\x20'+formatCredits(_0x223d5d[_0xfaf935(0x13a)])[_0xfaf935(0x132)](_0x4dcff3));}console[_0xfaf935(0x13c)]();}if(_0x25cb5a[_0xfaf935(0x146)]===0x0){console[_0xfaf935(0x13c)](a11_0x5b46bf[_0xfaf935(0x127)](_0xfaf935(0x148))),console[_0xfaf935(0x13c)](a11_0x5b46bf[_0xfaf935(0x127)](_0xfaf935(0x161)));return;}console[_0xfaf935(0x13c)](a11_0x5b46bf[_0xfaf935(0x160)](_0xfaf935(0x139))),console[_0xfaf935(0x13c)](a11_0x5b46bf['dim']('─'[_0xfaf935(0x141)](0x3c)));const _0x382778=Math[_0xfaf935(0x154)](0xc,..._0x25cb5a['map'](_0x15bfb6=>_0x15bfb6['profile']===_0xfaf935(0x123)?_0xfaf935(0x144)[_0xfaf935(0x146)]:_0x15bfb6[_0xfaf935(0x15d)][_0xfaf935(0x146)])),_0x4d57f8=0xa,_0x582d35=0xa;console['log']('\x20\x20'+_0xfaf935(0x156)[_0xfaf935(0x15b)](_0x382778)+'\x20\x20'+_0xfaf935(0x153)['padStart'](_0x4d57f8)+'\x20\x20'+'Requests'['padStart'](_0x582d35)+'\x20\x20'+_0xfaf935(0x166));for(const _0x8f9943 of _0x25cb5a){const _0x5a269b=_0x8f9943[_0xfaf935(0x15d)]===_0xfaf935(0x123)?'(default)':_0x8f9943['profile'],_0x1d3aff=_0x5a269b[_0xfaf935(0x15b)](_0x382778),_0x4465e1=_0x8f9943[_0xfaf935(0x15d)]===_0xfaf935(0x123)?a11_0x5b46bf['dim'](_0x1d3aff):_0x1d3aff;console[_0xfaf935(0x13c)]('\x20\x20'+_0x4465e1+'\x20\x20'+a11_0x5b46bf[_0xfaf935(0x143)](formatCredits(_0x8f9943[_0xfaf935(0x12d)])[_0xfaf935(0x132)](_0x4d57f8))+'\x20\x20'+String(_0x8f9943[_0xfaf935(0x128)])[_0xfaf935(0x132)](_0x582d35)+'\x20\x20'+a11_0x5b46bf['dim'](formatLastUsed(_0x8f9943['lastUsedAt'])));}console[_0xfaf935(0x13c)](),console[_0xfaf935(0x13c)](a11_0x5b46bf[_0xfaf935(0x127)](_0xfaf935(0x151))),console['log']();}}
@@ -1 +1 @@
1
- const a12_0xb0f015=a12_0x201f;(function(_0x454134,_0x57ff0d){const _0x95818c=a12_0x201f,_0x3014ca=_0x454134();while(!![]){try{const _0x2c400a=parseInt(_0x95818c(0xb5))/0x1*(-parseInt(_0x95818c(0xc0))/0x2)+parseInt(_0x95818c(0xc9))/0x3*(-parseInt(_0x95818c(0xbe))/0x4)+parseInt(_0x95818c(0xcc))/0x5+parseInt(_0x95818c(0xaa))/0x6*(parseInt(_0x95818c(0xb6))/0x7)+-parseInt(_0x95818c(0xc7))/0x8+parseInt(_0x95818c(0xa9))/0x9+parseInt(_0x95818c(0xc2))/0xa*(parseInt(_0x95818c(0xcf))/0xb);if(_0x2c400a===_0x57ff0d)break;else _0x3014ca['push'](_0x3014ca['shift']());}catch(_0xcc11d0){_0x3014ca['push'](_0x3014ca['shift']());}}}(a12_0x29d3,0xb0c4f));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a12_0x29d3(){const _0x3079b7=['60ZFrzwl','stack','3014gfSEgj','Authentication\x20failed','20nYkKER','.\x20Must\x20be\x20a\x20number.','validateGlobalOptions','run','validate','7972664qXawZj','Invalid\x20limit\x20value:\x20','15519tekGYG','problemDetails','cyan','5295385kIXzBT','detail','tdx\x20auth','122518egRNGh','name','error','isValid','helpText','command','debug','yellow','value','test','red','Error:\x20','number','has','6182181eIOHtI','6loxwKd','get','tdx\x20auth\x20setup','\x20--profile\x20','message','\x27\x20is\x20already\x20registered','commands','To\x20check\x20your\x20current\x20auth\x20status:','dim','register','Reason:\x20','158IoyPCx','1876483VMnAuS','status','Authentication\x20error\x20stack\x20trace:','\x0aStack\x20trace:\x0a','To\x20set\x20up\x20authentication:','limit','Command\x20\x27','category'];a12_0x29d3=function(){return _0x3079b7;};return a12_0x29d3();}import{SDKError,ErrorCategory}from'../sdk/errors.js';function a12_0x201f(_0x1461b3,_0x2630c0){_0x1461b3=_0x1461b3-0x9d;const _0x29d358=a12_0x29d3();let _0x201f37=_0x29d358[_0x1461b3];return _0x201f37;}import{Logger}from'../utils/logger/index.js';import a12_0x5f335a from'chalk';export function printAuthError(_0x4b5c9c,_0x2437fd=![],_0x4a3020){const _0x1dfc4a=a12_0x201f,_0x416b0a=_0x4b5c9c[_0x1dfc4a(0xca)]?.[_0x1dfc4a(0xcd)]||_0x4b5c9c[_0x1dfc4a(0xae)];console[_0x1dfc4a(0x9d)](a12_0x5f335a[_0x1dfc4a(0xa5)](_0x1dfc4a(0xc1))),console[_0x1dfc4a(0x9d)](a12_0x5f335a['red'](_0x1dfc4a(0xb4)+_0x416b0a));if(_0x2437fd){const _0x43e33c=_0x4a3020?_0x1dfc4a(0xad)+_0x4a3020:'';console[_0x1dfc4a(0x9d)]('\x0a'+a12_0x5f335a[_0x1dfc4a(0xb2)](_0x1dfc4a(0xba))),console[_0x1dfc4a(0x9d)]('\x20\x20'+a12_0x5f335a[_0x1dfc4a(0xcb)](_0x1dfc4a(0xac)+_0x43e33c)+'\x0a'),console['error'](''+a12_0x5f335a[_0x1dfc4a(0xb2)](_0x1dfc4a(0xb1))),console[_0x1dfc4a(0x9d)]('\x20\x20'+a12_0x5f335a[_0x1dfc4a(0xcb)](_0x1dfc4a(0xce)+_0x43e33c));}}export class BaseCommand{[a12_0xb0f015(0xc4)](_0x3b632b){const _0x435d37=a12_0xb0f015,{options:_0x341086}=_0x3b632b,_0x55e764=_0x341086[_0x435d37(0xbb)];if(_0x55e764!==undefined){const _0x15c07e=typeof _0x55e764===_0x435d37(0xa7)?_0x55e764:parseInt(_0x55e764,0xa);if(isNaN(_0x15c07e))return _0x435d37(0xc8)+_0x55e764+_0x435d37(0xc3);const _0x4ff44f=validateLimitOption(_0x15c07e);if(!_0x4ff44f[_0x435d37(0x9e)])return _0x4ff44f[_0x435d37(0x9d)];_0x3b632b['options'][_0x435d37(0xbb)]=_0x4ff44f[_0x435d37(0xa3)];}return undefined;}[a12_0xb0f015(0xc6)](_0x2dee48){return undefined;}async[a12_0xb0f015(0xc5)](_0x696bac){const _0x123ce1=a12_0xb0f015;try{const _0x36b2ce=this['validateGlobalOptions'](_0x696bac);if(_0x36b2ce)return console[_0x123ce1(0x9d)](_0x123ce1(0xa6)+_0x36b2ce),0x1;const _0xf7b9f7=this[_0x123ce1(0xc6)](_0x696bac);if(_0xf7b9f7){const _0x52637d=/^\s*(Usage|Note|Warning|Error):/i[_0x123ce1(0xa4)](_0xf7b9f7);return _0x52637d?console[_0x123ce1(0x9d)](_0xf7b9f7):console[_0x123ce1(0x9d)]('Error:\x20'+_0xf7b9f7),0x1;}const _0x1a994e=await this['execute'](_0x696bac);return _0x1a994e??0x0;}catch(_0xfa9693){if(_0xfa9693 instanceof Error){if(_0xfa9693 instanceof HTTPClientError&&_0xfa9693[_0x123ce1(0xb7)]===0x191){const _0x2dfe65=_0x696bac['options']['profile'];printAuthError(_0xfa9693,!![],_0x2dfe65);if(_0xfa9693[_0x123ce1(0xbf)]){const _0xcb1ab7=Logger['of'](_0x123ce1(0xa0));_0xcb1ab7[_0x123ce1(0xa1)](_0x123ce1(0xb8)),_0xcb1ab7['debug'](_0xfa9693[_0x123ce1(0xbf)]);}return 0x1;}console[_0x123ce1(0x9d)](a12_0x5f335a['red'](_0x123ce1(0xa6)+_0xfa9693[_0x123ce1(0xae)]));_0xfa9693 instanceof SDKError&&_0xfa9693['helpText']&&console[_0x123ce1(0x9d)](a12_0x5f335a[_0x123ce1(0xa2)](_0xfa9693[_0x123ce1(0x9f)]));const _0x3960f7=_0xfa9693 instanceof SDKError&&_0xfa9693[_0x123ce1(0xbd)]===ErrorCategory['USER_ERROR'];_0xfa9693[_0x123ce1(0xbf)]&&!_0x3960f7&&console[_0x123ce1(0x9d)](_0x123ce1(0xb9)+_0xfa9693[_0x123ce1(0xbf)]);}else console[_0x123ce1(0x9d)](_0x123ce1(0xa6)+String(_0xfa9693));return 0x1;}}}export class CommandRegistry{['commands']=new Map();[a12_0xb0f015(0xb3)](_0x2601ba){const _0x338881=a12_0xb0f015;if(this[_0x338881(0xb0)][_0x338881(0xa8)](_0x2601ba['name']))throw new Error(_0x338881(0xbc)+_0x2601ba[_0x338881(0xd0)]+_0x338881(0xaf));this[_0x338881(0xb0)]['set'](_0x2601ba[_0x338881(0xd0)],_0x2601ba);}[a12_0xb0f015(0xab)](_0x5e8298){const _0x594dcc=a12_0xb0f015;return this[_0x594dcc(0xb0)][_0x594dcc(0xab)](_0x5e8298);}['getAll'](){const _0x54d6b0=a12_0xb0f015;return Array['from'](this[_0x54d6b0(0xb0)]['values']());}[a12_0xb0f015(0xa8)](_0x204600){const _0x3c42f7=a12_0xb0f015;return this[_0x3c42f7(0xb0)]['has'](_0x204600);}}export const registry=new CommandRegistry();
1
+ const a12_0x4dbc70=a12_0x3ede;(function(_0x52e38b,_0x55846d){const _0x2aab79=a12_0x3ede,_0x2a8452=_0x52e38b();while(!![]){try{const _0x27f628=parseInt(_0x2aab79(0x124))/0x1*(-parseInt(_0x2aab79(0x115))/0x2)+parseInt(_0x2aab79(0x117))/0x3*(parseInt(_0x2aab79(0x109))/0x4)+-parseInt(_0x2aab79(0x11c))/0x5*(-parseInt(_0x2aab79(0x12b))/0x6)+-parseInt(_0x2aab79(0x103))/0x7*(-parseInt(_0x2aab79(0x121))/0x8)+-parseInt(_0x2aab79(0x108))/0x9+parseInt(_0x2aab79(0x125))/0xa*(parseInt(_0x2aab79(0x123))/0xb)+parseInt(_0x2aab79(0x122))/0xc;if(_0x27f628===_0x55846d)break;else _0x2a8452['push'](_0x2a8452['shift']());}catch(_0x57e531){_0x2a8452['push'](_0x2a8452['shift']());}}}(a12_0x2b3d,0x85704));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_0x3ede(_0x47ac4a,_0x2d1ae8){_0x47ac4a=_0x47ac4a-0xfb;const _0x2b3d7e=a12_0x2b3d();let _0x3ede2f=_0x2b3d7e[_0x47ac4a];return _0x3ede2f;}import a12_0x13dbc9 from'chalk';export function printAuthError(_0x232c0c,_0x45be0c=![],_0x411392){const _0x5621e3=a12_0x3ede,_0x29682d=_0x232c0c[_0x5621e3(0x120)]?.['detail']||_0x232c0c[_0x5621e3(0x100)];console['error'](a12_0x13dbc9['red'](_0x5621e3(0x12a))),console[_0x5621e3(0x128)](a12_0x13dbc9['red'](_0x5621e3(0x11d)+_0x29682d));if(_0x45be0c){const _0x480741=_0x411392?'\x20--profile\x20'+_0x411392:'';console[_0x5621e3(0x128)]('\x0a'+a12_0x13dbc9['dim']('To\x20set\x20up\x20authentication:')),console[_0x5621e3(0x128)]('\x20\x20'+a12_0x13dbc9[_0x5621e3(0x10f)](_0x5621e3(0xfc)+_0x480741)+'\x0a'),console[_0x5621e3(0x128)](''+a12_0x13dbc9['dim'](_0x5621e3(0x119))),console['error']('\x20\x20'+a12_0x13dbc9['cyan'](_0x5621e3(0x11e)+_0x480741));}}export class BaseCommand{['validateGlobalOptions'](_0x2ebf97){const _0x542b19=a12_0x3ede,{options:_0x1a2f45}=_0x2ebf97,_0x50cd09=_0x1a2f45['limit'];if(_0x50cd09!==undefined){const _0x4a3c0d=typeof _0x50cd09===_0x542b19(0xff)?_0x50cd09:parseInt(_0x50cd09,0xa);if(isNaN(_0x4a3c0d))return _0x542b19(0x112)+_0x50cd09+_0x542b19(0x105);const _0x462d66=validateLimitOption(_0x4a3c0d);if(!_0x462d66['isValid'])return _0x462d66['error'];_0x2ebf97[_0x542b19(0x12d)][_0x542b19(0x116)]=_0x462d66[_0x542b19(0x113)];}return undefined;}[a12_0x4dbc70(0x11f)](_0x3b08f1){return undefined;}async[a12_0x4dbc70(0x111)](_0x4263e3){const _0x1e6ff6=a12_0x4dbc70;try{const _0x1831e3=this[_0x1e6ff6(0xfe)](_0x4263e3);if(_0x1831e3)return console[_0x1e6ff6(0x128)](_0x1e6ff6(0x10e)+_0x1831e3),0x1;const _0x58df6e=this['validate'](_0x4263e3);if(_0x58df6e){const _0x1ed5c0=/^\s*(Usage|Note|Warning|Error):/i['test'](_0x58df6e);return _0x1ed5c0?console['error'](_0x58df6e):console[_0x1e6ff6(0x128)](_0x1e6ff6(0x10e)+_0x58df6e),0x1;}const _0x57b612=await this[_0x1e6ff6(0x104)](_0x4263e3);return _0x57b612??0x0;}catch(_0x5dc361){if(_0x5dc361 instanceof Error){if(_0x5dc361 instanceof HTTPClientError&&_0x5dc361[_0x1e6ff6(0x102)]===0x191){const _0x2cec58=_0x4263e3[_0x1e6ff6(0x12d)][_0x1e6ff6(0x114)];printAuthError(_0x5dc361,!![],_0x2cec58);if(_0x5dc361[_0x1e6ff6(0x106)]){const _0x55f2f7=Logger['of'](_0x1e6ff6(0x11a));_0x55f2f7['debug'](_0x1e6ff6(0x11b)),_0x55f2f7[_0x1e6ff6(0x10b)](_0x5dc361['stack']);}return 0x1;}console[_0x1e6ff6(0x128)](a12_0x13dbc9[_0x1e6ff6(0xfd)](_0x1e6ff6(0x10e)+_0x5dc361[_0x1e6ff6(0x100)]));_0x5dc361 instanceof SDKError&&_0x5dc361['helpText']&&console[_0x1e6ff6(0x128)](a12_0x13dbc9[_0x1e6ff6(0x10c)](_0x5dc361[_0x1e6ff6(0x107)]));const _0x124442=_0x5dc361 instanceof SDKError&&_0x5dc361[_0x1e6ff6(0x110)]===ErrorCategory['USER_ERROR'];_0x5dc361[_0x1e6ff6(0x106)]&&!_0x124442&&console[_0x1e6ff6(0x128)](_0x1e6ff6(0x129)+_0x5dc361['stack']);}else console[_0x1e6ff6(0x128)](_0x1e6ff6(0x10e)+String(_0x5dc361));return 0x1;}}}export class CommandRegistry{[a12_0x4dbc70(0x126)]=new Map();[a12_0x4dbc70(0x12c)](_0x3faed3){const _0x480518=a12_0x4dbc70;if(this[_0x480518(0x126)][_0x480518(0x118)](_0x3faed3['name']))throw new Error('Command\x20\x27'+_0x3faed3['name']+_0x480518(0x127));this[_0x480518(0x126)][_0x480518(0x101)](_0x3faed3['name'],_0x3faed3);}[a12_0x4dbc70(0x10a)](_0x155fb1){return this['commands']['get'](_0x155fb1);}['getAll'](){const _0x381cdc=a12_0x4dbc70;return Array[_0x381cdc(0x10d)](this['commands'][_0x381cdc(0xfb)]());}['has'](_0x351523){const _0x456578=a12_0x4dbc70;return this[_0x456578(0x126)][_0x456578(0x118)](_0x351523);}}export const registry=new CommandRegistry();function a12_0x2b3d(){const _0xa41c3a=['debug','yellow','from','Error:\x20','cyan','category','run','Invalid\x20limit\x20value:\x20','value','profile','121916zNFkUX','limit','9123Gpklps','has','To\x20check\x20your\x20current\x20auth\x20status:','command','Authentication\x20error\x20stack\x20trace:','5ikunfc','Reason:\x20','tdx\x20auth','validate','problemDetails','8WCwAZy','16080372MKvPtc','11UNFVBN','9fpTzMp','2118860IagBXW','commands','\x27\x20is\x20already\x20registered','error','\x0aStack\x20trace:\x0a','Authentication\x20failed','2474886vYXdie','register','options','values','tdx\x20auth\x20setup','red','validateGlobalOptions','number','message','set','status','464429UaWdqH','execute','.\x20Must\x20be\x20a\x20number.','stack','helpText','8721090OBGBAH','44UkIkMG','get'];a12_0x2b3d=function(){return _0xa41c3a;};return a12_0x2b3d();}
@@ -1 +1 @@
1
- const a13_0x481831=a13_0x16a5;function a13_0x16a5(_0x15dfe0,_0x434a26){_0x15dfe0=_0x15dfe0-0x195;const _0xb5144f=a13_0xb514();let _0x16a554=_0xb5144f[_0x15dfe0];return _0x16a554;}(function(_0x5735f6,_0x263b18){const _0x3f129a=a13_0x16a5,_0x591695=_0x5735f6();while(!![]){try{const _0x31303a=-parseInt(_0x3f129a(0x1f1))/0x1+parseInt(_0x3f129a(0x1ef))/0x2+parseInt(_0x3f129a(0x1ed))/0x3+-parseInt(_0x3f129a(0x1dd))/0x4+parseInt(_0x3f129a(0x1d9))/0x5+-parseInt(_0x3f129a(0x1c2))/0x6*(parseInt(_0x3f129a(0x19c))/0x7)+parseInt(_0x3f129a(0x1dc))/0x8;if(_0x31303a===_0x263b18)break;else _0x591695['push'](_0x591695['shift']());}catch(_0x118d24){_0x591695['push'](_0x591695['shift']());}}}(a13_0xb514,0xbd9e6));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0x3dafce from'chalk';function normalizeSchemaForDisplay(_0x42545d){const _0x1626cf=a13_0x16a5,_0x56ede9=_0x42545d[_0x1626cf(0x1d7)]||[],_0xea6999=_0x56ede9['find'](_0x1dd50e=>_0x1dd50e['name']==='legacy_settings'&&_0x1dd50e[_0x1626cf(0x1ff)]===_0x1626cf(0x1c5)&&_0x1dd50e['properties']);if(_0xea6999?.[_0x1626cf(0x1d7)]){const _0x2ee4bf=_0x56ede9[_0x1626cf(0x1e6)](_0x3eb64d=>_0x3eb64d[_0x1626cf(0x1b3)]!==_0x1626cf(0x1e1)&&_0x3eb64d[_0x1626cf(0x1b3)]!==_0x1626cf(0x204));return[..._0x2ee4bf,..._0xea6999[_0x1626cf(0x1d7)]];}return _0x56ede9['filter'](_0x35416b=>_0x35416b[_0x1626cf(0x1b3)]!==_0x1626cf(0x1e1));}function printSchemaFields(_0x1416df,_0x449a9b){const _0x22a0c3=a13_0x16a5,_0x299a96='\x20\x20'['repeat'](_0x449a9b+0x1),_0x4213aa='\x20\x20'[_0x22a0c3(0x1da)](_0x449a9b+0x2);for(const _0x52a247 of _0x1416df){if(!_0x52a247[_0x22a0c3(0x1b3)])continue;const _0x4dc014=_0x52a247['type']===_0x22a0c3(0x1c5)&&_0x52a247[_0x22a0c3(0x1d7)]&&_0x52a247['properties'][_0x22a0c3(0x1a7)]>0x0&&_0x52a247[_0x22a0c3(0x1b3)]!==_0x22a0c3(0x204);let _0x5b589f=''+_0x299a96+a13_0x3dafce['green'](_0x52a247[_0x22a0c3(0x1b3)]);_0x52a247['title']&&(_0x5b589f+=':\x20'+_0x52a247[_0x22a0c3(0x1b2)]);if(_0x52a247['input'])_0x5b589f+=a13_0x3dafce[_0x22a0c3(0x1db)]('\x20['+_0x52a247['input']+']');else _0x4dc014&&(_0x5b589f+=a13_0x3dafce[_0x22a0c3(0x1db)](_0x22a0c3(0x1ce)));console[_0x22a0c3(0x1a4)](_0x5b589f);_0x52a247[_0x22a0c3(0x1a9)]&&console[_0x22a0c3(0x1a4)](''+_0x4213aa+a13_0x3dafce['dim'](_0x52a247[_0x22a0c3(0x1a9)]));if(_0x52a247['enumeration']){const _0x5d20ae=_0x52a247[_0x22a0c3(0x1de)][_0x22a0c3(0x1a8)](_0x476718=>typeof _0x476718===_0x22a0c3(0x206)&&'value'in _0x476718?_0x476718[_0x22a0c3(0x1a3)]:_0x476718)['join'](',\x20');console[_0x22a0c3(0x1a4)](_0x4213aa+_0x22a0c3(0x1d4)+a13_0x3dafce[_0x22a0c3(0x1ec)](_0x5d20ae));}_0x52a247['default_value']!==undefined&&console['log'](_0x4213aa+_0x22a0c3(0x1be)+a13_0x3dafce[_0x22a0c3(0x1f9)](String(_0x52a247[_0x22a0c3(0x1b6)])));if(_0x52a247[_0x22a0c3(0x1a2)]!==undefined||_0x52a247[_0x22a0c3(0x1f0)]!==undefined){const _0x14ecfa=_0x52a247[_0x22a0c3(0x1a2)]!==undefined&&_0x52a247[_0x22a0c3(0x1f0)]!==undefined?_0x52a247[_0x22a0c3(0x1a2)]+_0x22a0c3(0x199)+_0x52a247[_0x22a0c3(0x1f0)]:_0x52a247['minimum']!==undefined?_0x22a0c3(0x1b1)+_0x52a247[_0x22a0c3(0x1a2)]:_0x22a0c3(0x1c3)+_0x52a247['maximum'];console[_0x22a0c3(0x1a4)](_0x4213aa+_0x22a0c3(0x1ba)+a13_0x3dafce['blue'](_0x14ecfa));}if(_0x52a247[_0x22a0c3(0x19f)]){const _0xaba74e=Object[_0x22a0c3(0x1fd)](_0x52a247[_0x22a0c3(0x19f)])[_0x22a0c3(0x1a8)](([_0x3dbf5b,_0x3798b1])=>_0x3dbf5b+'='+JSON[_0x22a0c3(0x1f4)](_0x3798b1))[_0x22a0c3(0x1f7)](',\x20');console[_0x22a0c3(0x1a4)](''+_0x4213aa+a13_0x3dafce[_0x22a0c3(0x1db)](_0x22a0c3(0x1bd)+_0xaba74e));}_0x4dc014&&_0x52a247[_0x22a0c3(0x1d7)]&&printSchemaFields(_0x52a247['properties'],_0x449a9b+0x1);}}export class ConnectionListCommand extends BaseCommand{['name']=a13_0x481831(0x1f8);[a13_0x481831(0x1a9)]=a13_0x481831(0x1fa);async[a13_0x481831(0x1d1)](_0x535d6e){const _0x3f2620=a13_0x481831,{options:_0xd45446,tdx:_0x16db5f}=_0x535d6e;_0xd45446[_0x3f2620(0x1b5)]&&console['error']('Site:\x20'+_0xd45446[_0x3f2620(0x1b0)]);const _0x40c5f3=resolveLimit(_0xd45446[_0x3f2620(0x1ea)],DEFAULT_LISTING_LIMIT),_0x48ef7a=await withSpinner(_0x3f2620(0x19b),()=>_0x16db5f['connection'][_0x3f2620(0x19e)](),{'verbose':_0xd45446[_0x3f2620(0x1b5)]}),_0x4070bc=_0x48ef7a[_0x3f2620(0x19a)];console['error'](_0x3f2620(0x1fe)+_0x4070bc[_0x3f2620(0x1a7)]+_0x3f2620(0x1a1)+(_0x4070bc[_0x3f2620(0x1a7)]!==0x1?'s':''));if(isStructuredFormat(_0xd45446)){const _0x137da9=_0x4070bc[_0x3f2620(0x1a5)](0x0,_0x40c5f3);await handleSDKOutput(_0x137da9,{..._0xd45446,'limit':_0x40c5f3});}else{const _0x249bcd=_0x4070bc[_0x3f2620(0x1a7)]>0x0?Math[_0x3f2620(0x1af)](..._0x4070bc['map'](_0x4982a8=>_0x4982a8[_0x3f2620(0x1ff)][_0x3f2620(0x1a7)])):0x0,_0x40770b=[];for(const _0x127a18 of _0x4070bc){const _0x116e94=a13_0x3dafce['cyan'](_0x127a18[_0x3f2620(0x1ff)]['padStart'](_0x249bcd)),_0xc9920=_0x127a18[_0x3f2620(0x1d2)]?.[_0x3f2620(0x1b3)]?_0x3f2620(0x199)+a13_0x3dafce[_0x3f2620(0x1db)](_0x127a18[_0x3f2620(0x1d2)][_0x3f2620(0x1b3)]):'';_0x40770b[_0x3f2620(0x1a0)](_0x116e94+'\x20\x20'+_0x127a18['name']+_0xc9920);}await writeOutput(_0x40770b[_0x3f2620(0x1f7)]('\x0a'),_0xd45446[_0x3f2620(0x1e3)],_0x3f2620(0x200));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x481831(0x1b3)]=a13_0x481831(0x1cd);['description']=a13_0x481831(0x1b7);[a13_0x481831(0x1c4)](_0x4d46c9){const _0x19b266=a13_0x481831,{args:_0x762883}=_0x4d46c9;if(!_0x762883[0x0])return _0x19b266(0x201);return undefined;}async[a13_0x481831(0x1d1)](_0x3ba208){const _0x2905a1=a13_0x481831,{options:_0x351868,args:_0x2bb275,tdx:_0x4b1f1a}=_0x3ba208,_0xd10053=_0x2bb275[0x0];_0x351868[_0x2905a1(0x1b5)]&&(console[_0x2905a1(0x1e4)](_0x2905a1(0x1e0)+_0x351868[_0x2905a1(0x1b0)]),console[_0x2905a1(0x1e4)](_0x2905a1(0x1fb)+_0xd10053));const _0x4bdab8=await withSpinner('Fetching\x20connection\x20\x27'+_0xd10053+'\x27...',()=>_0x4b1f1a[_0x2905a1(0x1d3)][_0x2905a1(0x1a6)](_0xd10053),{'verbose':_0x351868[_0x2905a1(0x1b5)]}),_0x14ca71=_0x4bdab8['data'];return console[_0x2905a1(0x1e4)](_0x2905a1(0x1bf)+_0x14ca71[_0x2905a1(0x1b3)]),await handleSingleObjectOutput(_0x14ca71,_0x351868),0x0;}}function a13_0xb514(){const _0x35fe33=['sort','connection:types','stringify','Type:\x20','List\x20available\x20connector\x20types','join','connection:list','blue','List\x20all\x20result\x20output\x20connections','Looking\x20up\x20connection:\x20','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','entries','✔\x20Found\x20','type','table','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','getOutputSchema','\x20connector\x20type','legacy_settings','\x27\x20(type:\x20','object','\x20\x20\x20\x20Default:\x20','label','No\x20available\x20fields\x20for\x20this\x20connector','hint','\x20-\x20','data','Listing\x20connections...','43729sbiINM','listTypes','list','criteria','push','\x20connection','minimum','value','log','slice','resolve','length','map','description','credential','✔\x20Found\x20schema\x20for\x20connection\x20\x27','connection:schema','cyan','Name:\x20','max','site','>=\x20','title','name','\x0aConnection:\x20','verbose','default_value','Show\x20connection\x20details','\x27...','Treating\x20\x27','Range:\x20','bold','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','Show\x20when:\x20','Default:\x20','✔\x20Found\x20connection:\x20','Fetching\x20settings\x20for\x20\x27','Fetching\x20settings\x20for\x20connector\x20type:\x20','1014RmAatL','<=\x20','validate','record','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','\x20\x20\x20\x20','\x0aAvailable\x20fields:','\x0aCredential\x20settings:','hidden','connection:settings','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.','connection:show','\x20[record]','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','getMetadata','execute','owner','connection','Options:\x20','settings','Fetching\x20schema\x20for\x20\x27','properties','\x27\x20as\x20connector\x20type','3933560QnqvCF','repeat','dim','16382248COdLan','3666252aRHLTg','enumeration','Listing\x20connector\x20types...','Site:\x20','legacy','✔\x20Resolved\x20\x27','output','error','\x20\x20\x20\x20Options:\x20','filter','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.','padStart','options','limit','\x0aConnector:\x20','yellow','2525274KsriHs','Resolving\x20connector\x20type\x20or\x20name:\x20','982142MMKWHb','maximum','1418338uUOoiX'];a13_0xb514=function(){return _0x35fe33;};return a13_0xb514();}export class ConnectionSchemaCommand extends BaseCommand{['name']=a13_0x481831(0x1ac);[a13_0x481831(0x1a9)]=a13_0x481831(0x1fc);[a13_0x481831(0x1c4)](_0x15108d){const _0x49c55b=a13_0x481831,{args:_0x58739a}=_0x15108d;if(!_0x58739a[0x0])return _0x49c55b(0x1e7);return undefined;}async[a13_0x481831(0x1d1)](_0x2b28e1){const _0x5e540e=a13_0x481831,{options:_0x4af49f,args:_0x566801,tdx:_0x3cf87c}=_0x2b28e1,_0x28e619=_0x566801[0x0];_0x4af49f[_0x5e540e(0x1b5)]&&(console[_0x5e540e(0x1e4)](_0x5e540e(0x1e0)+_0x4af49f[_0x5e540e(0x1b0)]),console[_0x5e540e(0x1e4)](_0x5e540e(0x1ee)+_0x28e619));let _0x3377a0=_0x28e619,_0x52af95;try{const _0x52d444=await _0x3cf87c['connection']['findByName'](_0x28e619);_0x52d444&&(_0x3377a0=_0x52d444[_0x5e540e(0x1ff)],_0x52af95=_0x52d444['name'],_0x4af49f['verbose']&&console[_0x5e540e(0x1e4)](_0x5e540e(0x1e2)+_0x28e619+_0x5e540e(0x1c6)+_0x3377a0));}catch{_0x4af49f[_0x5e540e(0x1b5)]&&console[_0x5e540e(0x1e4)](_0x5e540e(0x1b9)+_0x28e619+_0x5e540e(0x1d8));}const _0x331564=await withSpinner(_0x5e540e(0x1d6)+_0x3377a0+_0x5e540e(0x1b8),()=>_0x3cf87c[_0x5e540e(0x1d3)]['getOutputSchema'](_0x3377a0),{'verbose':_0x4af49f['verbose']}),_0x4087e3=_0x331564[_0x5e540e(0x19a)];_0x52af95?console[_0x5e540e(0x1e4)](_0x5e540e(0x1ab)+_0x52af95+_0x5e540e(0x205)+_0x3377a0+')'):console[_0x5e540e(0x1e4)]('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x3377a0);if(isStructuredFormat(_0x4af49f))await handleSingleObjectOutput(_0x4087e3,_0x4af49f);else{const _0x524cee=normalizeSchemaForDisplay(_0x4087e3);_0x52af95?(console[_0x5e540e(0x1a4)](_0x5e540e(0x1b4)+a13_0x3dafce[_0x5e540e(0x1ad)](_0x52af95)),console[_0x5e540e(0x1a4)](_0x5e540e(0x1f5)+a13_0x3dafce[_0x5e540e(0x1db)](_0x3377a0))):console[_0x5e540e(0x1a4)](_0x5e540e(0x1eb)+a13_0x3dafce['cyan'](_0x3377a0)),_0x524cee[_0x5e540e(0x1a7)]>0x0?(console[_0x5e540e(0x1a4)](a13_0x3dafce[_0x5e540e(0x1bb)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x524cee,0x0)):console[_0x5e540e(0x1a4)](a13_0x3dafce[_0x5e540e(0x1db)]('\x0aNo\x20fields\x20defined\x20in\x20schema'));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x481831(0x1b3)]=a13_0x481831(0x1f3);[a13_0x481831(0x1a9)]=a13_0x481831(0x1f6);async[a13_0x481831(0x1d1)](_0x4f3072){const _0x2e33ce=a13_0x481831,{options:_0x151b90,tdx:_0x194dfd}=_0x4f3072;_0x151b90[_0x2e33ce(0x1b5)]&&console[_0x2e33ce(0x1e4)](_0x2e33ce(0x1e0)+_0x151b90['site']);const _0x129e9c=await withSpinner(_0x2e33ce(0x1df),()=>_0x194dfd[_0x2e33ce(0x1d3)][_0x2e33ce(0x19d)](),{'verbose':_0x151b90['verbose']}),_0xf0a2fd=_0x129e9c['data'][_0x2e33ce(0x1f2)]((_0x13c80c,_0x51b742)=>_0x13c80c[_0x2e33ce(0x1ff)]['localeCompare'](_0x51b742['type']));console[_0x2e33ce(0x1e4)]('✔\x20Found\x20'+_0xf0a2fd['length']+_0x2e33ce(0x203)+(_0xf0a2fd[_0x2e33ce(0x1a7)]!==0x1?'s':''));if(isStructuredFormat(_0x151b90))await handleSDKOutput(_0xf0a2fd,_0x151b90);else{const _0x2673be=_0xf0a2fd[_0x2e33ce(0x1a7)]>0x0?Math[_0x2e33ce(0x1af)](..._0xf0a2fd[_0x2e33ce(0x1a8)](_0x3e66ab=>_0x3e66ab[_0x2e33ce(0x1ff)][_0x2e33ce(0x1a7)])):0x0,_0x4a394c=[];for(const _0x3f0a49 of _0xf0a2fd){const _0x59286e=a13_0x3dafce[_0x2e33ce(0x1ad)](_0x3f0a49[_0x2e33ce(0x1ff)][_0x2e33ce(0x1e8)](_0x2673be));_0x4a394c[_0x2e33ce(0x1a0)](_0x59286e+'\x20\x20'+_0x3f0a49['name']);}await writeOutput(_0x4a394c[_0x2e33ce(0x1f7)]('\x0a'),_0x151b90[_0x2e33ce(0x1e3)],_0x2e33ce(0x200));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x481831(0x1b3)]=a13_0x481831(0x1cb);['description']=a13_0x481831(0x1bc);[a13_0x481831(0x1c4)](_0x2de29b){const _0x1cdb7d=a13_0x481831,{args:_0x185f0c}=_0x2de29b;if(!_0x185f0c[0x0])return _0x1cdb7d(0x1cc);return undefined;}async[a13_0x481831(0x1d1)](_0x4538aa){const _0x4f74bd=a13_0x481831,{options:_0x4e29d6,args:_0x1ae7d8,tdx:_0x29f3d5}=_0x4538aa,_0x538b08=_0x1ae7d8[0x0];_0x4e29d6['verbose']&&(console['error']('Site:\x20'+_0x4e29d6[_0x4f74bd(0x1b0)]),console[_0x4f74bd(0x1e4)](_0x4f74bd(0x1c1)+_0x538b08));const _0x1704d1=await withSpinner(_0x4f74bd(0x1c0)+_0x538b08+_0x4f74bd(0x1b8),()=>_0x29f3d5[_0x4f74bd(0x1d3)][_0x4f74bd(0x1d0)](_0x538b08),{'verbose':_0x4e29d6['verbose']}),_0x14df7d=_0x1704d1[_0x4f74bd(0x19a)];console[_0x4f74bd(0x1e4)](_0x4f74bd(0x1cf)+_0x538b08);if(isStructuredFormat(_0x4e29d6))await handleSingleObjectOutput(_0x14df7d,_0x4e29d6);else{console[_0x4f74bd(0x1a4)]('\x0aConnector:\x20'+a13_0x3dafce[_0x4f74bd(0x1ad)](_0x538b08)),console[_0x4f74bd(0x1a4)](_0x4f74bd(0x1ae)+_0x14df7d[_0x4f74bd(0x1b3)]);const _0x5432ea=_0x14df7d[_0x4f74bd(0x1d5)]||[],_0x599b41=_0x5432ea[_0x4f74bd(0x1e6)](_0x10d680=>_0x10d680['credential']);_0x599b41['length']>0x0&&(console[_0x4f74bd(0x1a4)](a13_0x3dafce[_0x4f74bd(0x1bb)](_0x4f74bd(0x1c9))),printMetadataSettings(_0x599b41));let _0x434343=![];try{const _0x5d4017=await _0x29f3d5[_0x4f74bd(0x1d3)][_0x4f74bd(0x202)](_0x538b08),_0x7d5463=normalizeSchemaForDisplay(_0x5d4017);_0x7d5463[_0x4f74bd(0x1a7)]>0x0&&(console[_0x4f74bd(0x1a4)](a13_0x3dafce['bold'](_0x4f74bd(0x1c8))),printSchemaFields(_0x7d5463,0x0),_0x434343=!![]);}catch{const _0x3c06d5=_0x5432ea[_0x4f74bd(0x1e6)](_0x37ab7d=>!_0x37ab7d[_0x4f74bd(0x1aa)]);_0x3c06d5[_0x4f74bd(0x1a7)]>0x0&&(console[_0x4f74bd(0x1a4)](a13_0x3dafce[_0x4f74bd(0x1bb)](_0x4f74bd(0x1c8))),printMetadataSettings(_0x3c06d5),_0x434343=!![]);}!_0x434343&&_0x4e29d6['verbose']&&console['error'](a13_0x3dafce[_0x4f74bd(0x1db)](_0x4f74bd(0x197))),_0x599b41['length']===0x0&&console[_0x4f74bd(0x1a4)](a13_0x3dafce[_0x4f74bd(0x1db)]('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function printMetadataSettings(_0x18bfdd){const _0x19be4d=a13_0x481831;for(const _0x2da2b4 of _0x18bfdd){if(!_0x2da2b4['name'])continue;if(_0x2da2b4[_0x19be4d(0x1ca)])continue;let _0x5c71f0='\x20\x20'+a13_0x3dafce['green'](_0x2da2b4['name']);_0x2da2b4[_0x19be4d(0x196)]&&(_0x5c71f0+=':\x20'+_0x2da2b4[_0x19be4d(0x196)]);_0x2da2b4['type']&&(_0x5c71f0+=a13_0x3dafce[_0x19be4d(0x1db)]('\x20['+_0x2da2b4['type']+']'));console[_0x19be4d(0x1a4)](_0x5c71f0);_0x2da2b4['hint']&&console['log'](_0x19be4d(0x1c7)+a13_0x3dafce[_0x19be4d(0x1db)](_0x2da2b4[_0x19be4d(0x198)]));if(_0x2da2b4[_0x19be4d(0x1e9)]){const _0x2571d6=_0x2da2b4[_0x19be4d(0x1e9)][_0x19be4d(0x1a8)](_0x4df205=>_0x4df205[_0x19be4d(0x1a3)])[_0x19be4d(0x1f7)](',\x20');console[_0x19be4d(0x1a4)](_0x19be4d(0x1e5)+a13_0x3dafce[_0x19be4d(0x1ec)](_0x2571d6));}_0x2da2b4[_0x19be4d(0x1b6)]!==undefined&&_0x2da2b4[_0x19be4d(0x1b6)]!==null&&console['log'](_0x19be4d(0x195)+a13_0x3dafce[_0x19be4d(0x1f9)](String(_0x2da2b4[_0x19be4d(0x1b6)])));if(_0x2da2b4[_0x19be4d(0x19f)]){const _0x5848de=Object['entries'](_0x2da2b4['criteria'])[_0x19be4d(0x1a8)](([_0x13065b,_0x137d63])=>_0x13065b+'='+JSON[_0x19be4d(0x1f4)](_0x137d63))[_0x19be4d(0x1f7)](',\x20');console['log'](_0x19be4d(0x1c7)+a13_0x3dafce[_0x19be4d(0x1db)](_0x19be4d(0x1bd)+_0x5848de));}}}
1
+ const a13_0x327349=a13_0x133a;(function(_0x395ae0,_0x3dab17){const _0x941dc=a13_0x133a,_0x1988d3=_0x395ae0();while(!![]){try{const _0x27995f=parseInt(_0x941dc(0x19b))/0x1+parseInt(_0x941dc(0x1c8))/0x2+-parseInt(_0x941dc(0x193))/0x3+parseInt(_0x941dc(0x1b7))/0x4*(parseInt(_0x941dc(0x198))/0x5)+parseInt(_0x941dc(0x1df))/0x6*(parseInt(_0x941dc(0x19c))/0x7)+parseInt(_0x941dc(0x197))/0x8*(-parseInt(_0x941dc(0x1bf))/0x9)+-parseInt(_0x941dc(0x1bb))/0xa;if(_0x27995f===_0x3dab17)break;else _0x1988d3['push'](_0x1988d3['shift']());}catch(_0x7bb201){_0x1988d3['push'](_0x1988d3['shift']());}}}(a13_0x3c0e,0x1d468));function a13_0x3c0e(){const _0x576f7a=['\x0aConnection:\x20','credential','find','verbose','✔\x20Resolved\x20\x27','\x0aConnector:\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','\x20\x20\x20\x20Default:\x20','repeat','hidden','Fetching\x20settings\x20for\x20connector\x20type:\x20','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','Listing\x20connector\x20types...','object','findByName','join','connection:settings','criteria','Show\x20when:\x20','label','hint','entries','\x20\x20\x20\x20Options:\x20','Show\x20connection\x20details','cyan','filter','7228daNwFT','Range:\x20','\x27...','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','1576310KogYux','connection','enumeration','execute','35577FoYqyk','options','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.','validate','Default:\x20','blue','name','limit','type','225420ilTEuU','getOutputSchema','input','legacy','log','>=\x20','data','Treating\x20\x27','<=\x20','\x20[record]','max','\x0aNo\x20credential\x20settings\x20defined','length','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.','connection:list','site','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','yellow','\x20-\x20','record','No\x20available\x20fields\x20for\x20this\x20connector','owner','connection:types','90ECWXzo','\x27\x20as\x20connector\x20type','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','list','description','Fetching\x20schema\x20for\x20\x27','\x27\x20(type:\x20','output','\x20connection','legacy_settings','\x20\x20\x20\x20','dim','✔\x20Found\x20schema\x20for\x20connection\x20\x27','Site:\x20','Fetching\x20settings\x20for\x20\x27','minimum','error','\x20connector\x20type','push','stringify','\x0aAvailable\x20fields:','Type:\x20','slice','listTypes','title','Looking\x20up\x20connection:\x20','default_value','✔\x20Found\x20','✔\x20Found\x20connection:\x20','properties','padStart','bold','108789PIIoHz','Listing\x20connections...','Fetching\x20connection\x20\x27','value','440XaoSjC','610giEoIl','map','\x0aCredential\x20settings:','162807fMtiHt','16450BkYaDs'];a13_0x3c0e=function(){return _0x576f7a;};return a13_0x3c0e();}import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0x15753f from'chalk';function normalizeSchemaForDisplay(_0x59b417){const _0x350eaa=a13_0x133a,_0x41c34b=_0x59b417[_0x350eaa(0x1fc)]||[],_0x22878c=_0x41c34b[_0x350eaa(0x19f)](_0x4506eb=>_0x4506eb[_0x350eaa(0x1c5)]===_0x350eaa(0x1e8)&&_0x4506eb['type']===_0x350eaa(0x1db)&&_0x4506eb[_0x350eaa(0x1fc)]);if(_0x22878c?.[_0x350eaa(0x1fc)]){const _0x42b146=_0x41c34b[_0x350eaa(0x1b6)](_0x1fd229=>_0x1fd229[_0x350eaa(0x1c5)]!=='legacy'&&_0x1fd229['name']!==_0x350eaa(0x1e8));return[..._0x42b146,..._0x22878c[_0x350eaa(0x1fc)]];}return _0x41c34b['filter'](_0x540f5d=>_0x540f5d[_0x350eaa(0x1c5)]!==_0x350eaa(0x1cb));}function a13_0x133a(_0xdc52ed,_0x5de44b){_0xdc52ed=_0xdc52ed-0x192;const _0x3c0e=a13_0x3c0e();let _0x133ac0=_0x3c0e[_0xdc52ed];return _0x133ac0;}function printSchemaFields(_0x5af433,_0x3c40ee){const _0x1b96a8=a13_0x133a,_0x249d52='\x20\x20'['repeat'](_0x3c40ee+0x1),_0x3b7bdb='\x20\x20'[_0x1b96a8(0x1a5)](_0x3c40ee+0x2);for(const _0x21df57 of _0x5af433){if(!_0x21df57[_0x1b96a8(0x1c5)])continue;const _0x481a63=_0x21df57[_0x1b96a8(0x1c7)]===_0x1b96a8(0x1db)&&_0x21df57[_0x1b96a8(0x1fc)]&&_0x21df57[_0x1b96a8(0x1fc)][_0x1b96a8(0x1d4)]>0x0&&_0x21df57[_0x1b96a8(0x1c5)]!==_0x1b96a8(0x1e8);let _0x560511=''+_0x249d52+a13_0x15753f['green'](_0x21df57[_0x1b96a8(0x1c5)]);_0x21df57[_0x1b96a8(0x1f7)]&&(_0x560511+=':\x20'+_0x21df57[_0x1b96a8(0x1f7)]);if(_0x21df57['input'])_0x560511+=a13_0x15753f[_0x1b96a8(0x1ea)]('\x20['+_0x21df57[_0x1b96a8(0x1ca)]+']');else _0x481a63&&(_0x560511+=a13_0x15753f[_0x1b96a8(0x1ea)](_0x1b96a8(0x1d1)));console[_0x1b96a8(0x1cc)](_0x560511);_0x21df57['description']&&console[_0x1b96a8(0x1cc)](''+_0x3b7bdb+a13_0x15753f[_0x1b96a8(0x1ea)](_0x21df57[_0x1b96a8(0x1e3)]));if(_0x21df57[_0x1b96a8(0x1bd)]){const _0x23bd5a=_0x21df57[_0x1b96a8(0x1bd)]['map'](_0x46f807=>typeof _0x46f807===_0x1b96a8(0x1aa)&&_0x1b96a8(0x196)in _0x46f807?_0x46f807[_0x1b96a8(0x196)]:_0x46f807)['join'](',\x20');console[_0x1b96a8(0x1cc)](_0x3b7bdb+'Options:\x20'+a13_0x15753f[_0x1b96a8(0x1d9)](_0x23bd5a));}_0x21df57['default_value']!==undefined&&console['log'](_0x3b7bdb+_0x1b96a8(0x1c3)+a13_0x15753f[_0x1b96a8(0x1c4)](String(_0x21df57[_0x1b96a8(0x1f9)])));if(_0x21df57[_0x1b96a8(0x1ee)]!==undefined||_0x21df57['maximum']!==undefined){const _0x4f10c0=_0x21df57[_0x1b96a8(0x1ee)]!==undefined&&_0x21df57['maximum']!==undefined?_0x21df57[_0x1b96a8(0x1ee)]+_0x1b96a8(0x1da)+_0x21df57['maximum']:_0x21df57['minimum']!==undefined?_0x1b96a8(0x1cd)+_0x21df57[_0x1b96a8(0x1ee)]:_0x1b96a8(0x1d0)+_0x21df57['maximum'];console[_0x1b96a8(0x1cc)](_0x3b7bdb+_0x1b96a8(0x1b8)+a13_0x15753f[_0x1b96a8(0x1c4)](_0x4f10c0));}if(_0x21df57['criteria']){const _0x1dca92=Object[_0x1b96a8(0x1b2)](_0x21df57[_0x1b96a8(0x1ae)])[_0x1b96a8(0x199)](([_0x5ab36a,_0x130ad4])=>_0x5ab36a+'='+JSON[_0x1b96a8(0x1f2)](_0x130ad4))[_0x1b96a8(0x1ac)](',\x20');console['log'](''+_0x3b7bdb+a13_0x15753f['dim']('Show\x20when:\x20'+_0x1dca92));}_0x481a63&&_0x21df57[_0x1b96a8(0x1fc)]&&printSchemaFields(_0x21df57[_0x1b96a8(0x1fc)],_0x3c40ee+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x327349(0x1c5)]=a13_0x327349(0x1d6);['description']='List\x20all\x20result\x20output\x20connections';async[a13_0x327349(0x1be)](_0x381eb){const _0x59b6b7=a13_0x327349,{options:_0x5b8bcf,tdx:_0x23a230}=_0x381eb;_0x5b8bcf['verbose']&&console[_0x59b6b7(0x1ef)](_0x59b6b7(0x1ec)+_0x5b8bcf[_0x59b6b7(0x1d7)]);const _0x1afd7e=resolveLimit(_0x5b8bcf[_0x59b6b7(0x1c6)],DEFAULT_LISTING_LIMIT),_0x42dc39=await withSpinner(_0x59b6b7(0x194),()=>_0x23a230['connection'][_0x59b6b7(0x1e2)](),{'verbose':_0x5b8bcf[_0x59b6b7(0x1a0)]}),_0x28f5e5=_0x42dc39['data'];console[_0x59b6b7(0x1ef)](_0x59b6b7(0x1fa)+_0x28f5e5['length']+_0x59b6b7(0x1e7)+(_0x28f5e5[_0x59b6b7(0x1d4)]!==0x1?'s':''));if(isStructuredFormat(_0x5b8bcf)){const _0x4f17ad=_0x28f5e5[_0x59b6b7(0x1f5)](0x0,_0x1afd7e);await handleSDKOutput(_0x4f17ad,{..._0x5b8bcf,'limit':_0x1afd7e});}else{const _0x19de88=_0x28f5e5[_0x59b6b7(0x1d4)]>0x0?Math[_0x59b6b7(0x1d2)](..._0x28f5e5[_0x59b6b7(0x199)](_0x2dbfe3=>_0x2dbfe3[_0x59b6b7(0x1c7)][_0x59b6b7(0x1d4)])):0x0,_0x34de8f=[];for(const _0x4970b8 of _0x28f5e5){const _0x407c16=a13_0x15753f[_0x59b6b7(0x1b5)](_0x4970b8[_0x59b6b7(0x1c7)][_0x59b6b7(0x1fd)](_0x19de88)),_0x3082c3=_0x4970b8[_0x59b6b7(0x1dd)]?.[_0x59b6b7(0x1c5)]?_0x59b6b7(0x1da)+a13_0x15753f[_0x59b6b7(0x1ea)](_0x4970b8[_0x59b6b7(0x1dd)][_0x59b6b7(0x1c5)]):'';_0x34de8f[_0x59b6b7(0x1f1)](_0x407c16+'\x20\x20'+_0x4970b8[_0x59b6b7(0x1c5)]+_0x3082c3);}await writeOutput(_0x34de8f[_0x59b6b7(0x1ac)]('\x0a'),_0x5b8bcf[_0x59b6b7(0x1e6)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x327349(0x1c5)]='connection:show';['description']=a13_0x327349(0x1b4);[a13_0x327349(0x1c2)](_0x3123db){const _0x82ac3b=a13_0x327349,{args:_0x1643da}=_0x3123db;if(!_0x1643da[0x0])return _0x82ac3b(0x1a3);return undefined;}async[a13_0x327349(0x1be)](_0xb32138){const _0x2e87ca=a13_0x327349,{options:_0x4e790c,args:_0x3579f8,tdx:_0x224ca2}=_0xb32138,_0x212ee6=_0x3579f8[0x0];_0x4e790c[_0x2e87ca(0x1a0)]&&(console['error'](_0x2e87ca(0x1ec)+_0x4e790c[_0x2e87ca(0x1d7)]),console['error'](_0x2e87ca(0x1f8)+_0x212ee6));const _0x551a7d=await withSpinner(_0x2e87ca(0x195)+_0x212ee6+_0x2e87ca(0x1b9),()=>_0x224ca2[_0x2e87ca(0x1bc)]['resolve'](_0x212ee6),{'verbose':_0x4e790c[_0x2e87ca(0x1a0)]}),_0x37e7d6=_0x551a7d[_0x2e87ca(0x1ce)];return console[_0x2e87ca(0x1ef)](_0x2e87ca(0x1fb)+_0x37e7d6[_0x2e87ca(0x1c5)]),await handleSingleObjectOutput(_0x37e7d6,_0x4e790c),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x327349(0x1c5)]='connection:schema';['description']=a13_0x327349(0x1e1);['validate'](_0x41f3ee){const _0x5ec250=a13_0x327349,{args:_0x1bb97d}=_0x41f3ee;if(!_0x1bb97d[0x0])return _0x5ec250(0x1d5);return undefined;}async[a13_0x327349(0x1be)](_0x413ff7){const _0x51d81c=a13_0x327349,{options:_0x2827ab,args:_0x3e991f,tdx:_0x17e3b0}=_0x413ff7,_0x297f38=_0x3e991f[0x0];_0x2827ab[_0x51d81c(0x1a0)]&&(console['error'](_0x51d81c(0x1ec)+_0x2827ab['site']),console['error']('Resolving\x20connector\x20type\x20or\x20name:\x20'+_0x297f38));let _0x162a80=_0x297f38,_0x12b65c;try{const _0x42407c=await _0x17e3b0[_0x51d81c(0x1bc)][_0x51d81c(0x1ab)](_0x297f38);_0x42407c&&(_0x162a80=_0x42407c['type'],_0x12b65c=_0x42407c['name'],_0x2827ab[_0x51d81c(0x1a0)]&&console[_0x51d81c(0x1ef)](_0x51d81c(0x1a1)+_0x297f38+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x162a80));}catch{_0x2827ab['verbose']&&console[_0x51d81c(0x1ef)](_0x51d81c(0x1cf)+_0x297f38+_0x51d81c(0x1e0));}const _0xf311f7=await withSpinner(_0x51d81c(0x1e4)+_0x162a80+_0x51d81c(0x1b9),()=>_0x17e3b0['connection'][_0x51d81c(0x1c9)](_0x162a80),{'verbose':_0x2827ab['verbose']}),_0x48bb04=_0xf311f7[_0x51d81c(0x1ce)];_0x12b65c?console['error'](_0x51d81c(0x1eb)+_0x12b65c+_0x51d81c(0x1e5)+_0x162a80+')'):console[_0x51d81c(0x1ef)](_0x51d81c(0x1ba)+_0x162a80);if(isStructuredFormat(_0x2827ab))await handleSingleObjectOutput(_0x48bb04,_0x2827ab);else{const _0x12472e=normalizeSchemaForDisplay(_0x48bb04);_0x12b65c?(console[_0x51d81c(0x1cc)](_0x51d81c(0x19d)+a13_0x15753f[_0x51d81c(0x1b5)](_0x12b65c)),console[_0x51d81c(0x1cc)](_0x51d81c(0x1f4)+a13_0x15753f[_0x51d81c(0x1ea)](_0x162a80))):console[_0x51d81c(0x1cc)](_0x51d81c(0x1a2)+a13_0x15753f[_0x51d81c(0x1b5)](_0x162a80)),_0x12472e[_0x51d81c(0x1d4)]>0x0?(console[_0x51d81c(0x1cc)](a13_0x15753f[_0x51d81c(0x192)](_0x51d81c(0x1f3))),printSchemaFields(_0x12472e,0x0)):console[_0x51d81c(0x1cc)](a13_0x15753f['dim']('\x0aNo\x20fields\x20defined\x20in\x20schema'));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x327349(0x1c5)]=a13_0x327349(0x1de);[a13_0x327349(0x1e3)]='List\x20available\x20connector\x20types';async[a13_0x327349(0x1be)](_0x4b8c8d){const _0x4b693d=a13_0x327349,{options:_0x228390,tdx:_0x1a7ab1}=_0x4b8c8d;_0x228390[_0x4b693d(0x1a0)]&&console[_0x4b693d(0x1ef)](_0x4b693d(0x1ec)+_0x228390['site']);const _0x45caad=await withSpinner(_0x4b693d(0x1a9),()=>_0x1a7ab1[_0x4b693d(0x1bc)][_0x4b693d(0x1f6)](),{'verbose':_0x228390[_0x4b693d(0x1a0)]}),_0x1c1b0e=_0x45caad[_0x4b693d(0x1ce)]['sort']((_0x5571f1,_0x46780b)=>_0x5571f1[_0x4b693d(0x1c7)]['localeCompare'](_0x46780b['type']));console[_0x4b693d(0x1ef)](_0x4b693d(0x1fa)+_0x1c1b0e[_0x4b693d(0x1d4)]+_0x4b693d(0x1f0)+(_0x1c1b0e[_0x4b693d(0x1d4)]!==0x1?'s':''));if(isStructuredFormat(_0x228390))await handleSDKOutput(_0x1c1b0e,_0x228390);else{const _0xf7dd06=_0x1c1b0e[_0x4b693d(0x1d4)]>0x0?Math[_0x4b693d(0x1d2)](..._0x1c1b0e[_0x4b693d(0x199)](_0x4b0b24=>_0x4b0b24[_0x4b693d(0x1c7)][_0x4b693d(0x1d4)])):0x0,_0x54362c=[];for(const _0x1f7143 of _0x1c1b0e){const _0x541283=a13_0x15753f['cyan'](_0x1f7143['type'][_0x4b693d(0x1fd)](_0xf7dd06));_0x54362c[_0x4b693d(0x1f1)](_0x541283+'\x20\x20'+_0x1f7143[_0x4b693d(0x1c5)]);}await writeOutput(_0x54362c[_0x4b693d(0x1ac)]('\x0a'),_0x228390[_0x4b693d(0x1e6)],'table');}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x327349(0x1c5)]=a13_0x327349(0x1ad);[a13_0x327349(0x1e3)]=a13_0x327349(0x1a8);[a13_0x327349(0x1c2)](_0x18c3b5){const _0x4abd6d=a13_0x327349,{args:_0x579a6c}=_0x18c3b5;if(!_0x579a6c[0x0])return _0x4abd6d(0x1c1);return undefined;}async[a13_0x327349(0x1be)](_0x1d4312){const _0xb4590c=a13_0x327349,{options:_0x5f49d7,args:_0x5e4e44,tdx:_0x567854}=_0x1d4312,_0x3eb6dc=_0x5e4e44[0x0];_0x5f49d7[_0xb4590c(0x1a0)]&&(console[_0xb4590c(0x1ef)](_0xb4590c(0x1ec)+_0x5f49d7['site']),console[_0xb4590c(0x1ef)](_0xb4590c(0x1a7)+_0x3eb6dc));const _0x5dcf18=await withSpinner(_0xb4590c(0x1ed)+_0x3eb6dc+_0xb4590c(0x1b9),()=>_0x567854[_0xb4590c(0x1bc)]['getMetadata'](_0x3eb6dc),{'verbose':_0x5f49d7[_0xb4590c(0x1a0)]}),_0x4b0b46=_0x5dcf18['data'];console[_0xb4590c(0x1ef)](_0xb4590c(0x1d8)+_0x3eb6dc);if(isStructuredFormat(_0x5f49d7))await handleSingleObjectOutput(_0x4b0b46,_0x5f49d7);else{console['log'](_0xb4590c(0x1a2)+a13_0x15753f['cyan'](_0x3eb6dc)),console[_0xb4590c(0x1cc)]('Name:\x20'+_0x4b0b46[_0xb4590c(0x1c5)]);const _0x34b420=_0x4b0b46['settings']||[],_0xe418d6=_0x34b420[_0xb4590c(0x1b6)](_0x3d6668=>_0x3d6668['credential']);_0xe418d6[_0xb4590c(0x1d4)]>0x0&&(console[_0xb4590c(0x1cc)](a13_0x15753f[_0xb4590c(0x192)](_0xb4590c(0x19a))),printMetadataSettings(_0xe418d6));let _0x55ab0b=![];try{const _0x514db6=await _0x567854['connection'][_0xb4590c(0x1c9)](_0x3eb6dc),_0x17e1aa=normalizeSchemaForDisplay(_0x514db6);_0x17e1aa['length']>0x0&&(console[_0xb4590c(0x1cc)](a13_0x15753f[_0xb4590c(0x192)](_0xb4590c(0x1f3))),printSchemaFields(_0x17e1aa,0x0),_0x55ab0b=!![]);}catch{const _0x20b0d9=_0x34b420['filter'](_0x1495cc=>!_0x1495cc[_0xb4590c(0x19e)]);_0x20b0d9[_0xb4590c(0x1d4)]>0x0&&(console['log'](a13_0x15753f['bold'](_0xb4590c(0x1f3))),printMetadataSettings(_0x20b0d9),_0x55ab0b=!![]);}!_0x55ab0b&&_0x5f49d7[_0xb4590c(0x1a0)]&&console['error'](a13_0x15753f[_0xb4590c(0x1ea)](_0xb4590c(0x1dc))),_0xe418d6[_0xb4590c(0x1d4)]===0x0&&console['log'](a13_0x15753f[_0xb4590c(0x1ea)](_0xb4590c(0x1d3)));}return 0x0;}}function printMetadataSettings(_0x8c623){const _0x40ec7e=a13_0x327349;for(const _0x5388c0 of _0x8c623){if(!_0x5388c0[_0x40ec7e(0x1c5)])continue;if(_0x5388c0[_0x40ec7e(0x1a6)])continue;let _0x4c7fc6='\x20\x20'+a13_0x15753f['green'](_0x5388c0[_0x40ec7e(0x1c5)]);_0x5388c0[_0x40ec7e(0x1b0)]&&(_0x4c7fc6+=':\x20'+_0x5388c0[_0x40ec7e(0x1b0)]);_0x5388c0[_0x40ec7e(0x1c7)]&&(_0x4c7fc6+=a13_0x15753f[_0x40ec7e(0x1ea)]('\x20['+_0x5388c0[_0x40ec7e(0x1c7)]+']'));console['log'](_0x4c7fc6);_0x5388c0[_0x40ec7e(0x1b1)]&&console[_0x40ec7e(0x1cc)](_0x40ec7e(0x1e9)+a13_0x15753f[_0x40ec7e(0x1ea)](_0x5388c0[_0x40ec7e(0x1b1)]));if(_0x5388c0[_0x40ec7e(0x1c0)]){const _0x3f862c=_0x5388c0[_0x40ec7e(0x1c0)][_0x40ec7e(0x199)](_0x1be29e=>_0x1be29e[_0x40ec7e(0x196)])['join'](',\x20');console['log'](_0x40ec7e(0x1b3)+a13_0x15753f[_0x40ec7e(0x1d9)](_0x3f862c));}_0x5388c0[_0x40ec7e(0x1f9)]!==undefined&&_0x5388c0[_0x40ec7e(0x1f9)]!==null&&console[_0x40ec7e(0x1cc)](_0x40ec7e(0x1a4)+a13_0x15753f[_0x40ec7e(0x1c4)](String(_0x5388c0[_0x40ec7e(0x1f9)])));if(_0x5388c0[_0x40ec7e(0x1ae)]){const _0x51f27b=Object[_0x40ec7e(0x1b2)](_0x5388c0[_0x40ec7e(0x1ae)])[_0x40ec7e(0x199)](([_0x31bc53,_0xa2c1f1])=>_0x31bc53+'='+JSON[_0x40ec7e(0x1f2)](_0xa2c1f1))[_0x40ec7e(0x1ac)](',\x20');console['log'](_0x40ec7e(0x1e9)+a13_0x15753f[_0x40ec7e(0x1ea)](_0x40ec7e(0x1af)+_0x51f27b));}}}
@@ -1 +1 @@
1
- const a14_0x91f328=a14_0x57b6;(function(_0x46e248,_0x37bc29){const _0x11cee9=a14_0x57b6,_0x1e6577=_0x46e248();while(!![]){try{const _0x1aec84=-parseInt(_0x11cee9(0x141))/0x1*(parseInt(_0x11cee9(0x151))/0x2)+-parseInt(_0x11cee9(0x150))/0x3*(-parseInt(_0x11cee9(0x13f))/0x4)+-parseInt(_0x11cee9(0x155))/0x5*(-parseInt(_0x11cee9(0x13c))/0x6)+-parseInt(_0x11cee9(0x14e))/0x7*(-parseInt(_0x11cee9(0x14a))/0x8)+parseInt(_0x11cee9(0x149))/0x9*(parseInt(_0x11cee9(0x13a))/0xa)+parseInt(_0x11cee9(0x14f))/0xb+-parseInt(_0x11cee9(0x147))/0xc*(parseInt(_0x11cee9(0x153))/0xd);if(_0x1aec84===_0x37bc29)break;else _0x1e6577['push'](_0x1e6577['shift']());}catch(_0x196478){_0x1e6577['push'](_0x1e6577['shift']());}}}(a14_0x5e5d,0x674c4));function a14_0x57b6(_0x4c394f,_0x5024cb){_0x4c394f=_0x4c394f-0x13a;const _0x5e5d17=a14_0x5e5d();let _0x57b670=_0x5e5d17[_0x4c394f];return _0x57b670;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a14_0x5e5d(){const _0x9bb11e=['Site:\x20','185pcPYAN','Pattern:\x20','Listing\x20databases...','15640rZMpcs','cause','18534tenwFX','query','\x20\x20Cause:\x20','4vghASX','✔\x20Found\x20','7253vZvokL','execute','List\x20all\x20databases','error','databases','name','252DjiYUw','\x20database','963XmULod','1304FaRXtv','site','limit','listDatabases','32179ErXVfK','7997990jFzqaU','2218290FTRqKM','206xKqtbu','length','821665ELzGeG'];a14_0x5e5d=function(){return _0x9bb11e;};return a14_0x5e5d();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0x91f328(0x146)]=a14_0x91f328(0x145);['description']=a14_0x91f328(0x143);async[a14_0x91f328(0x142)](_0x479ab5){const _0x2872cf=a14_0x91f328,{options:_0x5b9128,args:_0x16dc8c,tdx:_0x15a599}=_0x479ab5,_0x4e645a=_0x16dc8c[0x0];try{_0x5b9128['verbose']&&(console[_0x2872cf(0x144)](_0x2872cf(0x154)+_0x5b9128[_0x2872cf(0x14b)]),_0x4e645a&&console[_0x2872cf(0x144)](_0x2872cf(0x156)+_0x4e645a));const _0x4556df=resolveLimit(_0x5b9128[_0x2872cf(0x14c)],DEFAULT_LISTING_LIMIT),_0x54e704=await withSpinner(_0x2872cf(0x157),()=>_0x15a599[_0x2872cf(0x13d)][_0x2872cf(0x14d)](_0x4e645a,_0x4556df),{'verbose':_0x5b9128['verbose']}),_0x40c994=_0x54e704['data'];return console['error'](_0x2872cf(0x140)+_0x40c994['length']+_0x2872cf(0x148)+(_0x40c994[_0x2872cf(0x152)]!==0x1?'s':'')),await handleSDKOutput(_0x40c994,{..._0x5b9128,'limit':_0x4556df}),0x0;}catch(_0xf60f7d){if(_0xf60f7d instanceof SDKError)return console[_0x2872cf(0x144)]('Error:\x20'+_0xf60f7d['message']),_0xf60f7d['cause']&&console['error'](_0x2872cf(0x13e)+_0xf60f7d[_0x2872cf(0x13b)]),0x1;throw _0xf60f7d;}}}
1
+ const a14_0x41756b=a14_0x1e19;function a14_0x2a60(){const _0x18b7d5=['message','241YnHofC','verbose','3350459jdZePd','4344225lEZmDS','length','error','10612740DqWAid','List\x20all\x20databases','description','11MjrLtB','site','Pattern:\x20','data','Listing\x20databases...','execute','cause','16YeTDfp','databases','712CRcNED','listDatabases','5038njabEL','5632497kUCVVk','6157992dYdZuG','12036wmOzYY','12pKPUZU','name'];a14_0x2a60=function(){return _0x18b7d5;};return a14_0x2a60();}(function(_0x2991c6,_0x3a30f4){const _0x2d369f=a14_0x1e19,_0x15722a=_0x2991c6();while(!![]){try{const _0x5efb2e=-parseInt(_0x2d369f(0xc1))/0x1*(parseInt(_0x2d369f(0xba))/0x2)+parseInt(_0x2d369f(0xbd))/0x3*(parseInt(_0x2d369f(0xb8))/0x4)+parseInt(_0x2d369f(0xc4))/0x5+parseInt(_0x2d369f(0xbe))/0x6*(-parseInt(_0x2d369f(0xc3))/0x7)+-parseInt(_0x2d369f(0xb6))/0x8*(-parseInt(_0x2d369f(0xbb))/0x9)+parseInt(_0x2d369f(0xc7))/0xa*(-parseInt(_0x2d369f(0xca))/0xb)+parseInt(_0x2d369f(0xbc))/0xc;if(_0x5efb2e===_0x3a30f4)break;else _0x15722a['push'](_0x15722a['shift']());}catch(_0x10cb31){_0x15722a['push'](_0x15722a['shift']());}}}(a14_0x2a60,0xb050a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a14_0x1e19(_0x3a5a83,_0x50efb1){_0x3a5a83=_0x3a5a83-0xb3;const _0x2a6024=a14_0x2a60();let _0x1e1906=_0x2a6024[_0x3a5a83];return _0x1e1906;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a14_0x41756b(0xbf)]=a14_0x41756b(0xb7);[a14_0x41756b(0xc9)]=a14_0x41756b(0xc8);async[a14_0x41756b(0xb4)](_0x349259){const _0x93318=a14_0x41756b,{options:_0x21e343,args:_0x30e83f,tdx:_0xee5791}=_0x349259,_0x1e4429=_0x30e83f[0x0];try{_0x21e343['verbose']&&(console[_0x93318(0xc6)]('Site:\x20'+_0x21e343[_0x93318(0xcb)]),_0x1e4429&&console[_0x93318(0xc6)](_0x93318(0xcc)+_0x1e4429));const _0x3c7cc7=resolveLimit(_0x21e343['limit'],DEFAULT_LISTING_LIMIT),_0x4a29eb=await withSpinner(_0x93318(0xb3),()=>_0xee5791['query'][_0x93318(0xb9)](_0x1e4429,_0x3c7cc7),{'verbose':_0x21e343[_0x93318(0xc2)]}),_0x244930=_0x4a29eb[_0x93318(0xcd)];return console['error']('✔\x20Found\x20'+_0x244930[_0x93318(0xc5)]+'\x20database'+(_0x244930[_0x93318(0xc5)]!==0x1?'s':'')),await handleSDKOutput(_0x244930,{..._0x21e343,'limit':_0x3c7cc7}),0x0;}catch(_0x3885dd){if(_0x3885dd instanceof SDKError)return console[_0x93318(0xc6)]('Error:\x20'+_0x3885dd[_0x93318(0xc0)]),_0x3885dd[_0x93318(0xb5)]&&console[_0x93318(0xc6)]('\x20\x20Cause:\x20'+_0x3885dd['cause']),0x1;throw _0x3885dd;}}}
@@ -1 +1 @@
1
- const a15_0x32a808=a15_0x144e;(function(_0x38fbe7,_0x5af80e){const _0x135866=a15_0x144e,_0x2e9c56=_0x38fbe7();while(!![]){try{const _0x567397=parseInt(_0x135866(0xdd))/0x1*(parseInt(_0x135866(0xf9))/0x2)+parseInt(_0x135866(0xec))/0x3+-parseInt(_0x135866(0xe7))/0x4*(-parseInt(_0x135866(0xf0))/0x5)+-parseInt(_0x135866(0xe4))/0x6*(-parseInt(_0x135866(0xef))/0x7)+-parseInt(_0x135866(0xea))/0x8+parseInt(_0x135866(0xfb))/0x9*(-parseInt(_0x135866(0xda))/0xa)+-parseInt(_0x135866(0x100))/0xb;if(_0x567397===_0x5af80e)break;else _0x2e9c56['push'](_0x2e9c56['shift']());}catch(_0x5c2e8f){_0x2e9c56['push'](_0x2e9c56['shift']());}}}(a15_0x5993,0x86d40));function a15_0x144e(_0x3070ef,_0x7a4620){_0x3070ef=_0x3070ef-0xd9;const _0x59933b=a15_0x5993();let _0x144e41=_0x59933b[_0x3070ef];return _0x144e41;}import{BaseCommand}from'./command.js';function a15_0x5993(){const _0x22e500=['Table:\x20','length','Database:\x20','\x27\x20does\x20not\x20exist','describe','Describing\x20table\x20','describeTable','1856416kufsMJ','table','707580XoQumQ','\x20\x20Cause:\x20','Describe\x20table\x20schema','\x20column','args','24097964rBXbfr','✔\x20Found\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','10lEkNPB','execute','name','1rnUyFj','...','cause','error','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','description','\x20in\x20','15894iESdCk','site','database','6980QqMvDq','message','✖\x20Table\x20not\x20found','4927704zxsSxK','data','3267246zmHXiZ','Error:\x20','validate','1904cUpXRi','2005qAmcTh','verbose'];a15_0x5993=function(){return _0x22e500;};return a15_0x5993();}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_0x32a808(0xdc)]=a15_0x32a808(0xf6);[a15_0x32a808(0xe2)]=a15_0x32a808(0xfd);async[a15_0x32a808(0xdb)](_0x56271b){const _0x520fdb=a15_0x32a808;return this[_0x520fdb(0xf8)](_0x56271b);}async[a15_0x32a808(0xf8)](_0x2ece7f){const _0x25d372=a15_0x32a808,{options:_0x51c9af,args:_0x1e538a,tdx:_0x3becdc}=_0x2ece7f;let _0x45c9b1;try{_0x45c9b1=parseTableReference(_0x1e538a[0x0]);const _0x3a20ca=_0x51c9af[_0x25d372(0xe6)];!_0x45c9b1[_0x25d372(0xe6)]&&_0x3a20ca&&(_0x45c9b1[_0x25d372(0xe6)]=_0x3a20ca);const _0xa8a979=validateTableDescribeReference(_0x45c9b1);if(_0xa8a979)return console['error'](_0x25d372(0xed)+_0xa8a979),0x1;}catch(_0x7eb5fa){return console[_0x25d372(0xe0)](_0x25d372(0xed)+_0x7eb5fa['message']),0x1;}const _0x543e4d=_0x45c9b1[_0x25d372(0xe6)],_0x2c75d3=_0x45c9b1[_0x25d372(0xfa)];try{_0x51c9af[_0x25d372(0xf1)]&&(console[_0x25d372(0xe0)]('Site:\x20'+_0x51c9af[_0x25d372(0xe5)]),console['error'](_0x25d372(0xf4)+_0x543e4d),console[_0x25d372(0xe0)](_0x25d372(0xf2)+_0x2c75d3));const _0x395c7e=await withSpinner(_0x25d372(0xf7)+_0x543e4d+'.'+_0x2c75d3+_0x25d372(0xde),()=>_0x3becdc['query'][_0x25d372(0xf8)](_0x543e4d,_0x2c75d3),{'verbose':_0x51c9af[_0x25d372(0xf1)]}),_0x17d59e=_0x395c7e[_0x25d372(0xeb)];if(_0x17d59e['length']===0x0)return console[_0x25d372(0xe0)](_0x25d372(0xe9)),console[_0x25d372(0xe0)]('Table\x20\x27'+_0x543e4d+'.'+_0x2c75d3+_0x25d372(0xf5)),0x1;return console['error'](_0x25d372(0x101)+_0x17d59e[_0x25d372(0xf3)]+_0x25d372(0xfe)+(_0x17d59e['length']!==0x1?'s':'')+_0x25d372(0xe3)+_0x543e4d+'.'+_0x2c75d3),await handleSDKOutput(_0x17d59e,_0x51c9af),0x0;}catch(_0x35ffc5){if(_0x35ffc5 instanceof SDKError)return console[_0x25d372(0xe0)](_0x25d372(0xed)+_0x35ffc5[_0x25d372(0xe8)]),_0x35ffc5[_0x25d372(0xdf)]&&console[_0x25d372(0xe0)](_0x25d372(0xfc)+_0x35ffc5[_0x25d372(0xdf)]),0x1;throw _0x35ffc5;}}[a15_0x32a808(0xee)](_0x4c43c1){const _0x3345f0=a15_0x32a808;if(_0x4c43c1['args']['length']===0x0)return _0x3345f0(0xe1);if(_0x4c43c1[_0x3345f0(0xff)][_0x3345f0(0xf3)]>0x1)return _0x3345f0(0xd9);return undefined;}}
1
+ const a15_0x559af0=a15_0x3398;function a15_0x3398(_0x2c9b40,_0x308665){_0x2c9b40=_0x2c9b40-0xf7;const _0x20ab0a=a15_0x20ab();let _0x339893=_0x20ab0a[_0x2c9b40];return _0x339893;}(function(_0x593ec,_0xbbed41){const _0x5e7740=a15_0x3398,_0x243292=_0x593ec();while(!![]){try{const _0x56a91d=parseInt(_0x5e7740(0x104))/0x1*(-parseInt(_0x5e7740(0xfd))/0x2)+parseInt(_0x5e7740(0xfc))/0x3*(parseInt(_0x5e7740(0x117))/0x4)+parseInt(_0x5e7740(0x110))/0x5+parseInt(_0x5e7740(0xfb))/0x6+-parseInt(_0x5e7740(0x115))/0x7+parseInt(_0x5e7740(0x113))/0x8*(-parseInt(_0x5e7740(0xfa))/0x9)+-parseInt(_0x5e7740(0xf9))/0xa*(-parseInt(_0x5e7740(0x112))/0xb);if(_0x56a91d===_0xbbed41)break;else _0x243292['push'](_0x243292['shift']());}catch(_0x3154d0){_0x243292['push'](_0x243292['shift']());}}}(a15_0x20ab,0x49853));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a15_0x20ab(){const _0x637e79=['Error:\x20','Table\x20\x27','message','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','execute','error','Site:\x20','\x20\x20Cause:\x20','Database:\x20','1894675rSwbgm','verbose','479743GApyhH','1592KvTabE','database','1818390TCgQyI','length','4NjePZz','query','\x20in\x20','\x20column','description','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','✔\x20Found\x20','20hiCaHX','2799vuxpqd','1741650hPDtlp','771774pMoelP','17768MnCtZf','validate','name','describeTable','✖\x20Table\x20not\x20found','Describe\x20table\x20schema','cause','44TiBeFU','args','describe'];a15_0x20ab=function(){return _0x637e79;};return a15_0x20ab();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x559af0(0xff)]=a15_0x559af0(0x106);[a15_0x559af0(0x11b)]=a15_0x559af0(0x102);async[a15_0x559af0(0x10b)](_0x4dcc35){const _0x357273=a15_0x559af0;return this[_0x357273(0x100)](_0x4dcc35);}async[a15_0x559af0(0x100)](_0x1194b1){const _0x4618d8=a15_0x559af0,{options:_0x5b7742,args:_0x5e8017,tdx:_0x382dd5}=_0x1194b1;let _0x14970a;try{_0x14970a=parseTableReference(_0x5e8017[0x0]);const _0x1e02c0=_0x5b7742[_0x4618d8(0x114)];!_0x14970a[_0x4618d8(0x114)]&&_0x1e02c0&&(_0x14970a['database']=_0x1e02c0);const _0x3d4787=validateTableDescribeReference(_0x14970a);if(_0x3d4787)return console[_0x4618d8(0x10c)](_0x4618d8(0x107)+_0x3d4787),0x1;}catch(_0x36d6ff){return console[_0x4618d8(0x10c)](_0x4618d8(0x107)+_0x36d6ff[_0x4618d8(0x109)]),0x1;}const _0x13b5df=_0x14970a[_0x4618d8(0x114)],_0x371cb1=_0x14970a['table'];try{_0x5b7742[_0x4618d8(0x111)]&&(console[_0x4618d8(0x10c)](_0x4618d8(0x10d)+_0x5b7742['site']),console[_0x4618d8(0x10c)](_0x4618d8(0x10f)+_0x13b5df),console[_0x4618d8(0x10c)]('Table:\x20'+_0x371cb1));const _0x50009c=await withSpinner('Describing\x20table\x20'+_0x13b5df+'.'+_0x371cb1+'...',()=>_0x382dd5[_0x4618d8(0x118)][_0x4618d8(0x100)](_0x13b5df,_0x371cb1),{'verbose':_0x5b7742['verbose']}),_0x3a9634=_0x50009c['data'];if(_0x3a9634['length']===0x0)return console[_0x4618d8(0x10c)](_0x4618d8(0x101)),console[_0x4618d8(0x10c)](_0x4618d8(0x108)+_0x13b5df+'.'+_0x371cb1+'\x27\x20does\x20not\x20exist'),0x1;return console[_0x4618d8(0x10c)](_0x4618d8(0xf8)+_0x3a9634[_0x4618d8(0x116)]+_0x4618d8(0x11a)+(_0x3a9634['length']!==0x1?'s':'')+_0x4618d8(0x119)+_0x13b5df+'.'+_0x371cb1),await handleSDKOutput(_0x3a9634,_0x5b7742),0x0;}catch(_0x13535c){if(_0x13535c instanceof SDKError)return console[_0x4618d8(0x10c)](_0x4618d8(0x107)+_0x13535c[_0x4618d8(0x109)]),_0x13535c[_0x4618d8(0x103)]&&console[_0x4618d8(0x10c)](_0x4618d8(0x10e)+_0x13535c[_0x4618d8(0x103)]),0x1;throw _0x13535c;}}[a15_0x559af0(0xfe)](_0xd571bc){const _0x295af8=a15_0x559af0;if(_0xd571bc[_0x295af8(0x105)]['length']===0x0)return _0x295af8(0x10a);if(_0xd571bc[_0x295af8(0x105)][_0x295af8(0x116)]>0x1)return _0x295af8(0xf7);return undefined;}}
@@ -1 +1 @@
1
- function a16_0x13d0(){const _0x4c4735=['engage:workspace:delete','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','List\x20campaigns','getTemplateFull','Error:\x20Workspace\x20name\x20is\x20required','Fetching\x20workspaces...','segmentId','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','subject','entries','Engage\x20workspace\x20set\x20to:\x20','Delete\x20an\x20email\x20template','limit','jsonColumns','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','data','type','Launching\x20campaign\x20\x27','\x27\x20deleted\x20successfully','\x27...','engage:templates','engage:template:show','5moiJWp','timezone','resolveWorkspaceId','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','duplicateCampaign','updateWorkspace','Creating\x20campaign\x20\x27','editorType','engage:workspace:create','Resume\x20a\x20paused\x20campaign','launchCampaign','deleteCampaign','Create\x20an\x20email\x20template','html','Duplicating\x20campaign\x20\x27','session','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','listWorkspaces','Delete\x20a\x20campaign','Operation\x20cancelled','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','description','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','resumeCampaign','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Update\x20an\x20email\x20template','88983vTkYGc','\x27\x20launched\x20successfully','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','engage:template:update','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Error:\x20--subject\x20is\x20required','Pause\x20a\x20campaign','log','engage:campaign:duplicate','Creating\x20template\x20\x27','Resuming\x20campaign\x20\x27','Campaign\x20\x27','updateCampaign','engage','engage:workspace:use','getCampaignFull','engage_workspace','Pausing\x20campaign\x20\x27','startAt','Set\x20workspace\x20context\x20for\x20Engage\x20commands','createWorkspace','472310eeZFTR','length','engage:campaign:pause','Fetching\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','getTemplate','5648769dbRMUz','workspace','filter','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','segment','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','List\x20workspaces','Error:\x20--html\x20is\x20required','status','Show\x20campaign\x20details','fromEntries','Fetching\x20templates...','createCampaign','567840SjjFIx','Workspace\x20\x27','parentId','plaintext','engage:campaign:delete','7EqLdIa','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','keys','verbose','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','parentName','MISSING_ARGUMENT','1168264YVQBBk','deleteTemplate','Updating\x20campaign\x20\x27','pauseCampaign','name','Create\x20a\x20workspace','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','listTemplates','Launch\x20a\x20campaign','Show\x20email\x20template\x20details','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','\x27\x20paused\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','engage:template:create','\x27?\x20This\x20cannot\x20be\x20undone.','111390MxjoFI','Error:\x20--name\x20is\x20required','Fetching\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','getCampaign','Fetching\x20campaigns...','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Template\x20\x27','engage:campaign:show','Deleting\x20workspace\x20\x27','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','List\x20email\x20templates','error','yes','listCampaigns','\x27\x20resumed\x20successfully','Delete\x20a\x20workspace','1105305hWtajR','full','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','execute','Updating\x20workspace\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Fetching\x20workspace\x20\x27'];a16_0x13d0=function(){return _0x4c4735;};return a16_0x13d0();}const a16_0xae4b1f=a16_0x261d;(function(_0x57c336,_0x140311){const _0x3c5f48=a16_0x261d,_0x266cc8=_0x57c336();while(!![]){try{const _0x56546e=-parseInt(_0x3c5f48(0x20c))/0x1+-parseInt(_0x3c5f48(0x221))/0x2+-parseInt(_0x3c5f48(0x1d4))/0x3+parseInt(_0x3c5f48(0x235))/0x4+parseInt(_0x3c5f48(0x1f1))/0x5*(parseInt(_0x3c5f48(0x1c3))/0x6)+parseInt(_0x3c5f48(0x23a))/0x7*(parseInt(_0x3c5f48(0x241))/0x8)+parseInt(_0x3c5f48(0x227))/0x9;if(_0x56546e===_0x140311)break;else _0x266cc8['push'](_0x266cc8['shift']());}catch(_0x1b8f13){_0x266cc8['push'](_0x266cc8['shift']());}}}(a16_0x13d0,0x3abf2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x1d1d1d,_0x433574,_0x3290bf=![]){const _0x1ab389=a16_0x261d;if(_0x1d1d1d[_0x1ab389(0x228)])return await _0x433574[_0x1ab389(0x219)][_0x1ab389(0x1f3)](_0x1d1d1d['workspace']);const _0x5c3966=loadSessionContext(_0x1d1d1d[_0x1ab389(0x200)]);if(_0x5c3966?.['engage_workspace'])return await _0x433574[_0x1ab389(0x219)][_0x1ab389(0x1f3)](_0x5c3966[_0x1ab389(0x21c)]);if(_0x3290bf)throw new SDKError(ErrorCode[_0x1ab389(0x240)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':_0x1ab389(0x22d)});return undefined;}async function resolveSegmentFromOptions(_0x35c9ea,_0x12540a){const _0x1e9281=a16_0x261d;if(!_0x35c9ea[_0x1e9281(0x22b)])return{};const _0x45312f=_0x35c9ea[_0x1e9281(0x22b)],_0x1b1967=await _0x12540a[_0x1e9281(0x22b)]['resolvePathToResource'](_0x45312f);return{'audienceId':_0x1b1967[_0x1e9281(0x237)],'audienceName':_0x1b1967[_0x1e9281(0x23f)],..._0x1b1967[_0x1e9281(0x1e1)]&&{'segmentId':_0x1b1967[_0x1e9281(0x1e1)],'segmentName':_0x1b1967['segmentName']}};}function buildConnectorConfig(_0x2870d2){const _0x13b65d=a16_0x261d,_0x80a142=_0x2870d2['emailSenderId'],_0x20c1bc=_0x2870d2[_0x13b65d(0x1e8)];if(!_0x80a142&&!_0x20c1bc)return undefined;return{..._0x80a142&&{'emailSenderId':_0x80a142},..._0x20c1bc&&{'jsonColumns':_0x20c1bc}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]='engage:campaigns';[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x1dd);async[a16_0xae4b1f(0x1d7)](_0xf34db3){const _0x5f18e4=a16_0xae4b1f,{options:_0x231217,args:_0x142813,tdx:_0x3b2f34}=_0xf34db3,_0x13cf3b=_0x142813[0x0],_0x54f0db=resolveLimit(_0x231217[_0x5f18e4(0x1e7)],DEFAULT_LLM_LIMIT),_0x59ea84=_0x231217,_0x43c78d=_0x59ea84[_0x5f18e4(0x1eb)],_0x544d5c=_0x59ea84[_0x5f18e4(0x230)],_0x1d3488=await resolveWorkspaceIdFromOptions(_0x59ea84,_0x3b2f34),_0x144f78=await withSpinner(_0x5f18e4(0x1c8),()=>_0x3b2f34[_0x5f18e4(0x219)][_0x5f18e4(0x1d1)]({'type':_0x43c78d,'status':_0x544d5c,'workspaceId':_0x1d3488,'limit':_0x54f0db}),{'verbose':_0x231217[_0x5f18e4(0x23d)]});let _0xd781e3=_0x144f78[_0x5f18e4(0x1ea)];return _0x13cf3b&&(_0xd781e3=_0x144f78[_0x5f18e4(0x1ea)][_0x5f18e4(0x229)](_0x130f50=>matchGlobPattern(_0x130f50[_0x5f18e4(0x1b6)],_0x13cf3b))),await handleSDKOutput(_0xd781e3,_0x231217),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{['name']=a16_0xae4b1f(0x1cb);[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x231);async['execute'](_0x1d8354){const _0x549cf9=a16_0xae4b1f,{options:_0x43df96,args:_0x1b5d1b,tdx:_0x40935e}=_0x1d8354;if(_0x1b5d1b[_0x549cf9(0x222)]===0x0)return console['error'](_0x549cf9(0x207)),console[_0x549cf9(0x1cf)](_0x549cf9(0x1be)),0x1;const _0x54a93e=_0x1b5d1b[0x0],_0x58f226=_0x43df96,_0x54c3bc=await resolveWorkspaceIdFromOptions(_0x58f226,_0x40935e),_0x4aea78=_0x58f226['full'];if(_0x4aea78){const _0x1cf441=await withSpinner(_0x549cf9(0x224)+_0x54a93e+_0x549cf9(0x1ee),()=>_0x40935e[_0x549cf9(0x219)][_0x549cf9(0x21b)](_0x54a93e,_0x54c3bc),{'verbose':_0x43df96[_0x549cf9(0x23d)]});await handleSDKOutput([_0x1cf441],_0x43df96);}else{const _0x14197f=await withSpinner('Fetching\x20campaign\x20\x27'+_0x54a93e+_0x549cf9(0x1ee),()=>_0x40935e[_0x549cf9(0x219)][_0x549cf9(0x1c7)](_0x54a93e,_0x54c3bc),{'verbose':_0x43df96[_0x549cf9(0x23d)]});await handleSDKOutput([_0x14197f],_0x43df96);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]='engage:campaign:create';[a16_0xae4b1f(0x206)]='Create\x20a\x20new\x20campaign';async['execute'](_0x4b30a6){const _0x477bd5=a16_0xae4b1f,{options:_0x11bad9,tdx:_0x2de3ed}=_0x4b30a6,_0x4e1079=_0x11bad9,_0x1cfe9b=_0x4e1079[_0x477bd5(0x1b6)],_0xdfc1e9=_0x4e1079['type'];if(!_0x1cfe9b)return console[_0x477bd5(0x1cf)](_0x477bd5(0x1c4)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0xdfc1e9)return console['error'](_0x477bd5(0x1cd)),console[_0x477bd5(0x1cf)](_0x477bd5(0x208)),0x1;const _0x9910e2=await resolveWorkspaceIdFromOptions(_0x4e1079,_0x2de3ed,!![]),_0x258f99=await resolveSegmentFromOptions(_0x4e1079,_0x2de3ed),_0x2eac9e=buildConnectorConfig(_0x4e1079),_0x2d9b11={'name':_0x1cfe9b,'campaignType':_0xdfc1e9,'workspaceId':_0x9910e2,'description':_0x4e1079[_0x477bd5(0x206)],..._0x258f99,'connectorConfig':_0x2eac9e,'startAt':_0x4e1079[_0x477bd5(0x21e)],'timezone':_0x4e1079[_0x477bd5(0x1f2)]},_0x5d416a=await withSpinner(_0x477bd5(0x1f7)+_0x1cfe9b+'\x27...',()=>_0x2de3ed[_0x477bd5(0x219)][_0x477bd5(0x234)](_0x2d9b11));return await handleSDKOutput([_0x5d416a['data']],_0x11bad9),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]='engage:campaign:update';[a16_0xae4b1f(0x206)]='Update\x20a\x20campaign';async[a16_0xae4b1f(0x1d7)](_0x593587){const _0x597cb4=a16_0xae4b1f,{options:_0x2e788c,args:_0x207db5,tdx:_0x42bf31}=_0x593587;if(_0x207db5[_0x597cb4(0x222)]===0x0)return console[_0x597cb4(0x1cf)](_0x597cb4(0x207)),console[_0x597cb4(0x1cf)](_0x597cb4(0x1f4)),0x1;const _0x19a10c=_0x207db5[0x0],_0x3e5838=_0x2e788c,_0x4198d1=await resolveWorkspaceIdFromOptions(_0x3e5838,_0x42bf31),_0x10681a=await resolveSegmentFromOptions(_0x3e5838,_0x42bf31),_0x341e74=buildConnectorConfig(_0x3e5838),_0x518101={'name':_0x3e5838[_0x597cb4(0x1b6)],'description':_0x3e5838[_0x597cb4(0x206)],..._0x10681a,'connectorConfig':_0x341e74,'startAt':_0x3e5838[_0x597cb4(0x21e)],'timezone':_0x3e5838[_0x597cb4(0x1f2)]},_0x194c41=Object[_0x597cb4(0x232)](Object[_0x597cb4(0x1e4)](_0x518101)[_0x597cb4(0x229)](([,_0x5431a8])=>_0x5431a8!==undefined));if(Object[_0x597cb4(0x23c)](_0x194c41)[_0x597cb4(0x222)]===0x0)return console[_0x597cb4(0x1cf)](_0x597cb4(0x1dc)),console['error'](_0x597cb4(0x20e)),0x1;const _0x311d8e=await withSpinner(_0x597cb4(0x243)+_0x19a10c+_0x597cb4(0x1ee),()=>_0x42bf31[_0x597cb4(0x219)][_0x597cb4(0x218)](_0x19a10c,_0x194c41,_0x4198d1),{'verbose':_0x2e788c[_0x597cb4(0x23d)]});return await handleSDKOutput([_0x311d8e['data']],_0x2e788c),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]=a16_0xae4b1f(0x239);[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x203);async[a16_0xae4b1f(0x1d7)](_0x29aa96){const _0x4cb47d=a16_0xae4b1f,{options:_0x5cf049,args:_0x42c524,tdx:_0x35bc9e}=_0x29aa96;if(_0x42c524[_0x4cb47d(0x222)]===0x0)return console[_0x4cb47d(0x1cf)](_0x4cb47d(0x207)),console[_0x4cb47d(0x1cf)](_0x4cb47d(0x1c6)),0x1;const _0x4414ab=_0x42c524[0x0],_0x23078f=_0x5cf049,_0x3b0c16=await resolveWorkspaceIdFromOptions(_0x23078f,_0x35bc9e);if(!_0x5cf049[_0x4cb47d(0x1d0)]){const _0x5809db=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x4414ab+_0x4cb47d(0x1c2));if(!_0x5809db)return console[_0x4cb47d(0x213)]('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x4414ab+_0x4cb47d(0x1ee),()=>_0x35bc9e[_0x4cb47d(0x219)][_0x4cb47d(0x1fc)](_0x4414ab,_0x3b0c16),{'verbose':_0x5cf049[_0x4cb47d(0x23d)]}),console[_0x4cb47d(0x213)](_0x4cb47d(0x217)+_0x4414ab+_0x4cb47d(0x1ed)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']='engage:campaign:launch';[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x1ba);async['execute'](_0x3037e9){const _0x209eea=a16_0xae4b1f,{options:_0x2e4047,args:_0x2b7804,tdx:_0x1684c1}=_0x3037e9;if(_0x2b7804[_0x209eea(0x222)]===0x0)return console[_0x209eea(0x1cf)](_0x209eea(0x207)),console[_0x209eea(0x1cf)](_0x209eea(0x1d6)),0x1;const _0x566c8d=_0x2b7804[0x0],_0x1f7413=_0x2e4047,_0x1c1e5c=await resolveWorkspaceIdFromOptions(_0x1f7413,_0x1684c1);return await withSpinner(_0x209eea(0x1ec)+_0x566c8d+'\x27...',()=>_0x1684c1[_0x209eea(0x219)][_0x209eea(0x1fb)](_0x566c8d,_0x1c1e5c),{'verbose':_0x2e4047[_0x209eea(0x23d)]}),console[_0x209eea(0x213)](_0x209eea(0x217)+_0x566c8d+_0x209eea(0x20d)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a16_0xae4b1f(0x223);[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x212);async[a16_0xae4b1f(0x1d7)](_0x447afd){const _0x202608=a16_0xae4b1f,{options:_0x2cf425,args:_0x5c4904,tdx:_0x21f38b}=_0x447afd;if(_0x5c4904['length']===0x0)return console[_0x202608(0x1cf)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x202608(0x1cf)](_0x202608(0x1bc)),0x1;const _0x4c5dce=_0x5c4904[0x0],_0x687d18=_0x2cf425,_0x14e4f9=await resolveWorkspaceIdFromOptions(_0x687d18,_0x21f38b);return await withSpinner(_0x202608(0x21d)+_0x4c5dce+'\x27...',()=>_0x21f38b[_0x202608(0x219)][_0x202608(0x1b5)](_0x4c5dce,_0x14e4f9),{'verbose':_0x2cf425[_0x202608(0x23d)]}),console[_0x202608(0x213)](_0x202608(0x217)+_0x4c5dce+_0x202608(0x1bd)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]='engage:campaign:resume';[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x1fa);async[a16_0xae4b1f(0x1d7)](_0x481956){const _0x42def6=a16_0xae4b1f,{options:_0x154887,args:_0x35e061,tdx:_0x87c9f0}=_0x481956;if(_0x35e061['length']===0x0)return console['error'](_0x42def6(0x207)),console[_0x42def6(0x1cf)](_0x42def6(0x210)),0x1;const _0x5b7c17=_0x35e061[0x0],_0x41db5d=_0x154887,_0x2d0f33=await resolveWorkspaceIdFromOptions(_0x41db5d,_0x87c9f0);return await withSpinner(_0x42def6(0x216)+_0x5b7c17+_0x42def6(0x1ee),()=>_0x87c9f0[_0x42def6(0x219)][_0x42def6(0x209)](_0x5b7c17,_0x2d0f33),{'verbose':_0x154887[_0x42def6(0x23d)]}),console[_0x42def6(0x213)](_0x42def6(0x217)+_0x5b7c17+_0x42def6(0x1d2)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]=a16_0xae4b1f(0x214);[a16_0xae4b1f(0x206)]='Duplicate\x20a\x20campaign';async[a16_0xae4b1f(0x1d7)](_0x56c993){const _0x5619b0=a16_0xae4b1f,{options:_0x243875,args:_0x12be77,tdx:_0x256353}=_0x56c993;if(_0x12be77[_0x5619b0(0x222)]===0x0)return console['error'](_0x5619b0(0x207)),console[_0x5619b0(0x1cf)](_0x5619b0(0x1c9)),0x1;const _0x117db6=_0x12be77[0x0],_0x15dd32=_0x243875,_0x266b10=await resolveWorkspaceIdFromOptions(_0x15dd32,_0x256353),_0x3ded83=await withSpinner(_0x5619b0(0x1ff)+_0x117db6+_0x5619b0(0x1ee),()=>_0x256353['engage'][_0x5619b0(0x1f5)](_0x117db6,_0x266b10),{'verbose':_0x243875[_0x5619b0(0x23d)]});return await handleSDKOutput([_0x3ded83[_0x5619b0(0x1ea)]],_0x243875),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]=a16_0xae4b1f(0x1ef);[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x1ce);async[a16_0xae4b1f(0x1d7)](_0xfb9b8c){const _0x145e22=a16_0xae4b1f,{options:_0x2c97ee,args:_0xcfdf21,tdx:_0x36dc16}=_0xfb9b8c,_0x4f8cba=_0xcfdf21[0x0],_0x3d1dfd=resolveLimit(_0x2c97ee[_0x145e22(0x1e7)],DEFAULT_LLM_LIMIT),_0x19856c=_0x2c97ee,_0x418478=await resolveWorkspaceIdFromOptions(_0x19856c,_0x36dc16),_0x278f00=await withSpinner(_0x145e22(0x233),()=>_0x36dc16['engage'][_0x145e22(0x1b9)]({'workspaceId':_0x418478,'limit':_0x3d1dfd}),{'verbose':_0x2c97ee[_0x145e22(0x23d)]});let _0x3f19e7=_0x278f00[_0x145e22(0x1ea)];return _0x4f8cba&&(_0x3f19e7=_0x278f00[_0x145e22(0x1ea)][_0x145e22(0x229)](_0x369258=>matchGlobPattern(_0x369258[_0x145e22(0x1b6)],_0x4f8cba))),await handleSDKOutput(_0x3f19e7,_0x2c97ee),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]=a16_0xae4b1f(0x1f0);[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x1bb);async[a16_0xae4b1f(0x1d7)](_0x4562ef){const _0x47433c=a16_0xae4b1f,{options:_0x49c50c,args:_0x456189,tdx:_0x94bb02}=_0x4562ef;if(_0x456189[_0x47433c(0x222)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x47433c(0x1cf)](_0x47433c(0x1c0)),0x1;const _0x3a3d62=_0x456189[0x0],_0x56dd40=_0x49c50c,_0x3737b0=await resolveWorkspaceIdFromOptions(_0x56dd40,_0x94bb02),_0x330a79=_0x56dd40[_0x47433c(0x1d5)];if(_0x330a79){const _0x4b916c=await withSpinner(_0x47433c(0x1c5)+_0x3a3d62+'\x27...',()=>_0x94bb02[_0x47433c(0x219)][_0x47433c(0x1de)](_0x3a3d62,_0x3737b0),{'verbose':_0x49c50c[_0x47433c(0x23d)]});await handleSDKOutput([_0x4b916c],_0x49c50c);}else{const _0x2f1c87=await withSpinner(_0x47433c(0x1c5)+_0x3a3d62+_0x47433c(0x1ee),()=>_0x94bb02[_0x47433c(0x219)][_0x47433c(0x226)](_0x3a3d62,_0x3737b0),{'verbose':_0x49c50c[_0x47433c(0x23d)]});await handleSDKOutput([_0x2f1c87],_0x49c50c);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]=a16_0xae4b1f(0x1c1);[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x1fd);async[a16_0xae4b1f(0x1d7)](_0xc53a91){const _0x4768af=a16_0xae4b1f,{options:_0x59cf66,tdx:_0x1e49bb}=_0xc53a91,_0x18d1f8=_0x59cf66,_0x105bdc=_0x18d1f8[_0x4768af(0x1b6)],_0x327928=_0x18d1f8[_0x4768af(0x1e3)],_0x14043d=_0x18d1f8['html'];if(!_0x105bdc)return console['error'](_0x4768af(0x1c4)),console[_0x4768af(0x1cf)](_0x4768af(0x1e9)),0x1;if(!_0x327928)return console[_0x4768af(0x1cf)](_0x4768af(0x211)),0x1;if(!_0x14043d)return console[_0x4768af(0x1cf)](_0x4768af(0x22f)),0x1;const _0x291e36=await resolveWorkspaceIdFromOptions(_0x18d1f8,_0x1e49bb,!![]),_0x2b5409={'name':_0x105bdc,'subjectTemplate':_0x327928,'htmlTemplate':_0x14043d,'workspaceId':_0x291e36,'plaintextTemplate':_0x18d1f8[_0x4768af(0x238)],'editorType':_0x18d1f8[_0x4768af(0x1f8)]},_0x18f12f=await withSpinner(_0x4768af(0x215)+_0x105bdc+'\x27...',()=>_0x1e49bb[_0x4768af(0x219)]['createTemplate'](_0x2b5409));return await handleSDKOutput([_0x18f12f[_0x4768af(0x1ea)]],_0x59cf66),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]=a16_0xae4b1f(0x20f);['description']=a16_0xae4b1f(0x20b);async[a16_0xae4b1f(0x1d7)](_0x2f71a0){const _0x5ab92e=a16_0xae4b1f,{options:_0x4d6b33,args:_0x32d9af,tdx:_0x3e5868}=_0x2f71a0;if(_0x32d9af[_0x5ab92e(0x222)]===0x0)return console[_0x5ab92e(0x1cf)](_0x5ab92e(0x23b)),console[_0x5ab92e(0x1cf)](_0x5ab92e(0x22c)),0x1;const _0x59a0d2=_0x32d9af[0x0],_0x1f7910=_0x4d6b33,_0x259bc9=await resolveWorkspaceIdFromOptions(_0x1f7910,_0x3e5868),_0x1d884e={'name':_0x1f7910[_0x5ab92e(0x1b6)],'subjectTemplate':_0x1f7910[_0x5ab92e(0x1e3)],'htmlTemplate':_0x1f7910[_0x5ab92e(0x1fe)],'plaintextTemplate':_0x1f7910['plaintext']},_0x464afe=Object['fromEntries'](Object[_0x5ab92e(0x1e4)](_0x1d884e)[_0x5ab92e(0x229)](([,_0xe5324e])=>_0xe5324e!==undefined));if(Object[_0x5ab92e(0x23c)](_0x464afe)['length']===0x0)return console[_0x5ab92e(0x1cf)](_0x5ab92e(0x1dc)),console[_0x5ab92e(0x1cf)](_0x5ab92e(0x23e)),0x1;const _0x1023d4=await withSpinner('Updating\x20template\x20\x27'+_0x59a0d2+_0x5ab92e(0x1ee),()=>_0x3e5868['engage']['updateTemplate'](_0x59a0d2,_0x464afe,_0x259bc9),{'verbose':_0x4d6b33[_0x5ab92e(0x23d)]});return await handleSDKOutput([_0x1023d4[_0x5ab92e(0x1ea)]],_0x4d6b33),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']='engage:template:delete';[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x1e6);async[a16_0xae4b1f(0x1d7)](_0x67c6e7){const _0x44b0e3=a16_0xae4b1f,{options:_0x14475d,args:_0x5ba9dd,tdx:_0x5edf59}=_0x67c6e7;if(_0x5ba9dd[_0x44b0e3(0x222)]===0x0)return console[_0x44b0e3(0x1cf)](_0x44b0e3(0x23b)),console[_0x44b0e3(0x1cf)](_0x44b0e3(0x22a)),0x1;const _0x2a6fff=_0x5ba9dd[0x0],_0x374360=_0x14475d,_0x215d07=await resolveWorkspaceIdFromOptions(_0x374360,_0x5edf59);if(!_0x14475d['yes']){const _0x186c29=await confirm(_0x44b0e3(0x1d9)+_0x2a6fff+_0x44b0e3(0x1c2));if(!_0x186c29)return console['log'](_0x44b0e3(0x204)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x2a6fff+_0x44b0e3(0x1ee),()=>_0x5edf59[_0x44b0e3(0x219)][_0x44b0e3(0x242)](_0x2a6fff,_0x215d07),{'verbose':_0x14475d[_0x44b0e3(0x23d)]}),console[_0x44b0e3(0x213)](_0x44b0e3(0x1ca)+_0x2a6fff+_0x44b0e3(0x1ed)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]='engage:workspaces';[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x22e);async[a16_0xae4b1f(0x1d7)](_0x5a75a9){const _0xfa581a=a16_0xae4b1f,{options:_0x3d8a59,args:_0x8e0024,tdx:_0x3af233}=_0x5a75a9,_0x54fccf=_0x8e0024[0x0],_0x1bda1c=resolveLimit(_0x3d8a59[_0xfa581a(0x1e7)],DEFAULT_LLM_LIMIT),_0xa36135=await withSpinner(_0xfa581a(0x1e0),()=>_0x3af233[_0xfa581a(0x219)][_0xfa581a(0x202)]({'limit':_0x1bda1c}),{'verbose':_0x3d8a59[_0xfa581a(0x23d)]});let _0x4fd55a=_0xa36135['data'];return _0x54fccf&&(_0x4fd55a=_0xa36135[_0xfa581a(0x1ea)][_0xfa581a(0x229)](_0x4e2e31=>matchGlobPattern(_0x4e2e31[_0xfa581a(0x1b6)],_0x54fccf))),await handleSDKOutput(_0x4fd55a,_0x3d8a59),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]='engage:workspace:show';[a16_0xae4b1f(0x206)]='Show\x20workspace\x20details';async[a16_0xae4b1f(0x1d7)](_0x5cb731){const _0x25efba=a16_0xae4b1f,{options:_0x3d76bb,args:_0x4bf6c9,tdx:_0x29f19e}=_0x5cb731;if(_0x4bf6c9[_0x25efba(0x222)]===0x0)return console[_0x25efba(0x1cf)](_0x25efba(0x1b8)),console[_0x25efba(0x1cf)](_0x25efba(0x225)),0x1;const _0x3f986b=_0x4bf6c9[0x0],_0x147638=_0x3d76bb,_0x5dbd34=_0x147638[_0x25efba(0x1d5)];if(_0x5dbd34){const _0x47a837=await withSpinner(_0x25efba(0x1da)+_0x3f986b+'\x27...',()=>_0x29f19e[_0x25efba(0x219)]['getWorkspaceFull'](_0x3f986b),{'verbose':_0x3d76bb['verbose']});await handleSDKOutput([_0x47a837],_0x3d76bb);}else{const _0xa4c21d=await withSpinner(_0x25efba(0x1da)+_0x3f986b+_0x25efba(0x1ee),()=>_0x29f19e['engage']['getWorkspace'](_0x3f986b),{'verbose':_0x3d76bb[_0x25efba(0x23d)]});await handleSDKOutput([_0xa4c21d],_0x3d76bb);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]=a16_0xae4b1f(0x1f9);[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x1b7);async['execute'](_0x4cea01){const _0x1851d2=a16_0xae4b1f,{options:_0x279b25,tdx:_0x12c33b}=_0x4cea01,_0x36bf8f=_0x279b25,_0x42b0cc=_0x36bf8f[_0x1851d2(0x1b6)];if(!_0x42b0cc)return console[_0x1851d2(0x1cf)](_0x1851d2(0x1c4)),console[_0x1851d2(0x1cf)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x8fc2d0={'name':_0x42b0cc,'description':_0x36bf8f[_0x1851d2(0x206)]},_0x126fd4=await withSpinner('Creating\x20workspace\x20\x27'+_0x42b0cc+'\x27...',()=>_0x12c33b[_0x1851d2(0x219)][_0x1851d2(0x220)](_0x8fc2d0));return await handleSDKOutput([_0x126fd4[_0x1851d2(0x1ea)]],_0x279b25),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]='engage:workspace:update';[a16_0xae4b1f(0x206)]='Update\x20a\x20workspace';async['execute'](_0x5a0caa){const _0xda842f=a16_0xae4b1f,{options:_0x386e6a,args:_0x5817b2,tdx:_0x572ca9}=_0x5a0caa;if(_0x5817b2[_0xda842f(0x222)]===0x0)return console[_0xda842f(0x1cf)](_0xda842f(0x1b8)),console[_0xda842f(0x1cf)](_0xda842f(0x20a)),0x1;const _0xb7256a=_0x5817b2[0x0],_0x4fcaf3=_0x386e6a,_0x5a985f={'name':_0x4fcaf3[_0xda842f(0x1b6)],'description':_0x4fcaf3[_0xda842f(0x206)]},_0x53c2e9=Object[_0xda842f(0x232)](Object['entries'](_0x5a985f)[_0xda842f(0x229)](([,_0x4673a2])=>_0x4673a2!==undefined));if(Object['keys'](_0x53c2e9)['length']===0x0)return console[_0xda842f(0x1cf)](_0xda842f(0x1dc)),console[_0xda842f(0x1cf)]('Options:\x20--name,\x20--description'),0x1;const _0x3c8c84=await withSpinner(_0xda842f(0x1d8)+_0xb7256a+_0xda842f(0x1ee),()=>_0x572ca9[_0xda842f(0x219)][_0xda842f(0x1f6)](_0xb7256a,_0x53c2e9),{'verbose':_0x386e6a[_0xda842f(0x23d)]});return await handleSDKOutput([_0x3c8c84[_0xda842f(0x1ea)]],_0x386e6a),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']=a16_0xae4b1f(0x1db);[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x1d3);async[a16_0xae4b1f(0x1d7)](_0x3bf723){const _0x52a9d6=a16_0xae4b1f,{options:_0x30ca09,args:_0x491769,tdx:_0x203772}=_0x3bf723;if(_0x491769['length']===0x0)return console['error'](_0x52a9d6(0x1b8)),console['error'](_0x52a9d6(0x201)),0x1;const _0x45c08d=_0x491769[0x0];if(!_0x30ca09[_0x52a9d6(0x1d0)]){const _0x2ee5d3=await confirm(_0x52a9d6(0x1e2)+_0x45c08d+_0x52a9d6(0x1c2));if(!_0x2ee5d3)return console[_0x52a9d6(0x213)](_0x52a9d6(0x204)),0x0;}return await withSpinner(_0x52a9d6(0x1cc)+_0x45c08d+_0x52a9d6(0x1ee),()=>_0x203772[_0x52a9d6(0x219)]['deleteWorkspace'](_0x45c08d),{'verbose':_0x30ca09[_0x52a9d6(0x23d)]}),console[_0x52a9d6(0x213)](_0x52a9d6(0x236)+_0x45c08d+_0x52a9d6(0x1ed)),0x0;}}function a16_0x261d(_0x263de7,_0x1d123d){_0x263de7=_0x263de7-0x1b5;const _0x13d0d4=a16_0x13d0();let _0x261d65=_0x13d0d4[_0x263de7];return _0x261d65;}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0xae4b1f(0x1b6)]=a16_0xae4b1f(0x21a);[a16_0xae4b1f(0x206)]=a16_0xae4b1f(0x21f);async[a16_0xae4b1f(0x1d7)](_0x34238b){const _0x3ef702=a16_0xae4b1f,{options:_0x1e6e52,args:_0x1ebcc4,tdx:_0x559976}=_0x34238b;if(_0x1ebcc4[_0x3ef702(0x222)]===0x0)return console['error'](_0x3ef702(0x1df)),console[_0x3ef702(0x1cf)](_0x3ef702(0x205)),0x1;const _0xea8807=_0x1ebcc4[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0xea8807+_0x3ef702(0x1ee),()=>_0x559976[_0x3ef702(0x219)][_0x3ef702(0x1f3)](_0xea8807));const _0x1d8743=_0x1e6e52[_0x3ef702(0x200)]||undefined;return saveSessionContext({'engage_workspace':_0xea8807},_0x1d8743),console[_0x3ef702(0x213)](_0x3ef702(0x1e5)+_0xea8807),console[_0x3ef702(0x213)](_0x3ef702(0x1bf)),0x0;}}
1
+ const a16_0x48275b=a16_0x2981;(function(_0x4324cc,_0x347115){const _0x383e08=a16_0x2981,_0x2c442d=_0x4324cc();while(!![]){try{const _0x508940=parseInt(_0x383e08(0x138))/0x1*(parseInt(_0x383e08(0x181))/0x2)+-parseInt(_0x383e08(0x17c))/0x3*(-parseInt(_0x383e08(0x123))/0x4)+parseInt(_0x383e08(0x13e))/0x5*(-parseInt(_0x383e08(0x12c))/0x6)+parseInt(_0x383e08(0x119))/0x7*(parseInt(_0x383e08(0x12b))/0x8)+-parseInt(_0x383e08(0x128))/0x9+-parseInt(_0x383e08(0x15f))/0xa*(parseInt(_0x383e08(0x193))/0xb)+parseInt(_0x383e08(0x16f))/0xc;if(_0x508940===_0x347115)break;else _0x2c442d['push'](_0x2c442d['shift']());}catch(_0x1d8dfb){_0x2c442d['push'](_0x2c442d['shift']());}}}(a16_0x219a,0x24d89));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x2bd6d2,_0x114f7c,_0x5bf1f2=![]){const _0x4bae04=a16_0x2981;if(_0x2bd6d2[_0x4bae04(0x184)])return await _0x114f7c['engage']['resolveWorkspaceId'](_0x2bd6d2['workspace']);const _0x5b304e=loadSessionContext(_0x2bd6d2[_0x4bae04(0x140)]);if(_0x5b304e?.[_0x4bae04(0x17d)])return await _0x114f7c[_0x4bae04(0x164)][_0x4bae04(0x148)](_0x5b304e['engage_workspace']);if(_0x5bf1f2)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x4bae04(0x168),undefined,{'helpText':_0x4bae04(0x167)});return undefined;}async function resolveSegmentFromOptions(_0x2b4b15,_0xdb2811){const _0x185dca=a16_0x2981;if(!_0x2b4b15[_0x185dca(0x18f)])return{};const _0x3962b7=_0x2b4b15[_0x185dca(0x18f)],_0x148507=await _0xdb2811[_0x185dca(0x18f)]['resolvePathToResource'](_0x3962b7);return{'audienceId':_0x148507['parentId'],'audienceName':_0x148507[_0x185dca(0x13a)],..._0x148507[_0x185dca(0x12f)]&&{'segmentId':_0x148507[_0x185dca(0x12f)],'segmentName':_0x148507[_0x185dca(0x127)]}};}function buildConnectorConfig(_0x38b8c6){const _0x2749bd=a16_0x2981,_0x16de2b=_0x38b8c6[_0x2749bd(0x110)],_0x4af754=_0x38b8c6[_0x2749bd(0x198)];if(!_0x16de2b&&!_0x4af754)return undefined;return{..._0x16de2b&&{'emailSenderId':_0x16de2b},..._0x4af754&&{'jsonColumns':_0x4af754}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a16_0x48275b(0x162);['description']=a16_0x48275b(0x178);async[a16_0x48275b(0x187)](_0x199e20){const _0x10888b=a16_0x48275b,{options:_0x59261e,args:_0x3f8033,tdx:_0x5be8d3}=_0x199e20,_0x3a34e3=_0x3f8033[0x0],_0x578369=resolveLimit(_0x59261e[_0x10888b(0x14a)],DEFAULT_LLM_LIMIT),_0x19cbef=_0x59261e,_0x55675c=_0x19cbef[_0x10888b(0x196)],_0x37a63b=_0x19cbef[_0x10888b(0x171)],_0x37c8e9=await resolveWorkspaceIdFromOptions(_0x19cbef,_0x5be8d3),_0x1b56d8=await withSpinner(_0x10888b(0x163),()=>_0x5be8d3[_0x10888b(0x164)][_0x10888b(0x14b)]({'type':_0x55675c,'status':_0x37a63b,'workspaceId':_0x37c8e9,'limit':_0x578369}),{'verbose':_0x59261e[_0x10888b(0x126)]});let _0x2c2bae=_0x1b56d8[_0x10888b(0x125)];return _0x3a34e3&&(_0x2c2bae=_0x1b56d8[_0x10888b(0x125)][_0x10888b(0x180)](_0x248b45=>matchGlobPattern(_0x248b45['name'],_0x3a34e3))),await handleSDKOutput(_0x2c2bae,_0x59261e),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x18a);[a16_0x48275b(0x147)]=a16_0x48275b(0x11d);async[a16_0x48275b(0x187)](_0x411608){const _0x51fa2b=a16_0x48275b,{options:_0x41eb52,args:_0x43572f,tdx:_0x230c2}=_0x411608;if(_0x43572f[_0x51fa2b(0x137)]===0x0)return console[_0x51fa2b(0x131)](_0x51fa2b(0x158)),console[_0x51fa2b(0x131)](_0x51fa2b(0x115)),0x1;const _0x513237=_0x43572f[0x0],_0x2f3a87=_0x41eb52,_0x3f3541=await resolveWorkspaceIdFromOptions(_0x2f3a87,_0x230c2),_0x23e19c=_0x2f3a87[_0x51fa2b(0x174)];if(_0x23e19c){const _0x16a984=await withSpinner(_0x51fa2b(0x159)+_0x513237+_0x51fa2b(0x135),()=>_0x230c2[_0x51fa2b(0x164)][_0x51fa2b(0x189)](_0x513237,_0x3f3541),{'verbose':_0x41eb52[_0x51fa2b(0x126)]});await handleSDKOutput([_0x16a984],_0x41eb52);}else{const _0x48e7a7=await withSpinner('Fetching\x20campaign\x20\x27'+_0x513237+_0x51fa2b(0x135),()=>_0x230c2[_0x51fa2b(0x164)]['getCampaign'](_0x513237,_0x3f3541),{'verbose':_0x41eb52[_0x51fa2b(0x126)]});await handleSDKOutput([_0x48e7a7],_0x41eb52);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x186);[a16_0x48275b(0x147)]='Create\x20a\x20new\x20campaign';async['execute'](_0x5b43ec){const _0xb047ad=a16_0x48275b,{options:_0x305205,tdx:_0x3b5834}=_0x5b43ec,_0x14ba4b=_0x305205,_0x27c313=_0x14ba4b[_0xb047ad(0x116)],_0x396553=_0x14ba4b[_0xb047ad(0x196)];if(!_0x27c313)return console[_0xb047ad(0x131)](_0xb047ad(0x134)),console[_0xb047ad(0x131)](_0xb047ad(0x18b)),0x1;if(!_0x396553)return console[_0xb047ad(0x131)]('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0xb047ad(0x131)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x51101d=await resolveWorkspaceIdFromOptions(_0x14ba4b,_0x3b5834,!![]),_0x2e479f=await resolveSegmentFromOptions(_0x14ba4b,_0x3b5834),_0x54dacd=buildConnectorConfig(_0x14ba4b),_0x23feb2={'name':_0x27c313,'campaignType':_0x396553,'workspaceId':_0x51101d,'description':_0x14ba4b[_0xb047ad(0x147)],..._0x2e479f,'connectorConfig':_0x54dacd,'startAt':_0x14ba4b[_0xb047ad(0x155)],'timezone':_0x14ba4b['timezone']},_0x12e135=await withSpinner(_0xb047ad(0x16e)+_0x27c313+_0xb047ad(0x135),()=>_0x3b5834['engage']['createCampaign'](_0x23feb2));return await handleSDKOutput([_0x12e135[_0xb047ad(0x125)]],_0x305205),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x48275b(0x116)]='engage:campaign:update';[a16_0x48275b(0x147)]=a16_0x48275b(0x157);async[a16_0x48275b(0x187)](_0x594e02){const _0x5298de=a16_0x48275b,{options:_0x2152d8,args:_0x1f242b,tdx:_0x1be0e6}=_0x594e02;if(_0x1f242b[_0x5298de(0x137)]===0x0)return console[_0x5298de(0x131)](_0x5298de(0x158)),console[_0x5298de(0x131)](_0x5298de(0x16a)),0x1;const _0x24b870=_0x1f242b[0x0],_0x2f255d=_0x2152d8,_0x50d8be=await resolveWorkspaceIdFromOptions(_0x2f255d,_0x1be0e6),_0x23809b=await resolveSegmentFromOptions(_0x2f255d,_0x1be0e6),_0x1aa9e2=buildConnectorConfig(_0x2f255d),_0x3c21d6={'name':_0x2f255d[_0x5298de(0x116)],'description':_0x2f255d['description'],..._0x23809b,'connectorConfig':_0x1aa9e2,'startAt':_0x2f255d[_0x5298de(0x155)],'timezone':_0x2f255d[_0x5298de(0x185)]},_0x43647c=Object['fromEntries'](Object[_0x5298de(0x114)](_0x3c21d6)[_0x5298de(0x180)](([,_0x1421a0])=>_0x1421a0!==undefined));if(Object[_0x5298de(0x18e)](_0x43647c)[_0x5298de(0x137)]===0x0)return console[_0x5298de(0x131)](_0x5298de(0x11c)),console[_0x5298de(0x131)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x17cdc1=await withSpinner(_0x5298de(0x12d)+_0x24b870+_0x5298de(0x135),()=>_0x1be0e6['engage']['updateCampaign'](_0x24b870,_0x43647c,_0x50d8be),{'verbose':_0x2152d8[_0x5298de(0x126)]});return await handleSDKOutput([_0x17cdc1[_0x5298de(0x125)]],_0x2152d8),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x48275b(0x116)]='engage:campaign:delete';[a16_0x48275b(0x147)]=a16_0x48275b(0x10e);async[a16_0x48275b(0x187)](_0x55d57c){const _0xb4988e=a16_0x48275b,{options:_0xc53b49,args:_0x5dcc63,tdx:_0x2c2554}=_0x55d57c;if(_0x5dcc63[_0xb4988e(0x137)]===0x0)return console[_0xb4988e(0x131)](_0xb4988e(0x158)),console[_0xb4988e(0x131)]('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x2389d5=_0x5dcc63[0x0],_0x377063=_0xc53b49,_0x5b0f86=await resolveWorkspaceIdFromOptions(_0x377063,_0x2c2554);if(!_0xc53b49[_0xb4988e(0x146)]){const _0x53a05d=await confirm(_0xb4988e(0x195)+_0x2389d5+_0xb4988e(0x191));if(!_0x53a05d)return console[_0xb4988e(0x151)](_0xb4988e(0x15d)),0x0;}return await withSpinner(_0xb4988e(0x170)+_0x2389d5+_0xb4988e(0x135),()=>_0x2c2554[_0xb4988e(0x164)][_0xb4988e(0x17f)](_0x2389d5,_0x5b0f86),{'verbose':_0xc53b49[_0xb4988e(0x126)]}),console[_0xb4988e(0x151)](_0xb4988e(0x17b)+_0x2389d5+_0xb4988e(0x14e)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x144);[a16_0x48275b(0x147)]=a16_0x48275b(0x179);async['execute'](_0x14f25b){const _0x1f7fd6=a16_0x48275b,{options:_0x233d58,args:_0x4e1cd2,tdx:_0x36a284}=_0x14f25b;if(_0x4e1cd2['length']===0x0)return console[_0x1f7fd6(0x131)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0x1f0778=_0x4e1cd2[0x0],_0x450d5b=_0x233d58,_0x1f0d2c=await resolveWorkspaceIdFromOptions(_0x450d5b,_0x36a284);return await withSpinner(_0x1f7fd6(0x117)+_0x1f0778+_0x1f7fd6(0x135),()=>_0x36a284['engage']['launchCampaign'](_0x1f0778,_0x1f0d2c),{'verbose':_0x233d58['verbose']}),console[_0x1f7fd6(0x151)](_0x1f7fd6(0x17b)+_0x1f0778+_0x1f7fd6(0x188)),0x0;}}function a16_0x219a(){const _0x435102=['Fetching\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','28pqBCUn','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','data','verbose','segmentName','2403693xyhNPl','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Resume\x20a\x20paused\x20campaign','5912BxFrif','888LjzglV','Updating\x20campaign\x20\x27','plaintext','segmentId','deleteTemplate','error','getWorkspaceFull','engage:campaign:pause','Error:\x20--name\x20is\x20required','\x27...','editorType','length','487YCUcrL','Fetching\x20templates...','parentName','Update\x20an\x20email\x20template','listWorkspaces','engage:workspace:use','3135nFFHPq','Delete\x20a\x20workspace','session','Verifying\x20workspace\x20\x27','html','createTemplate','engage:campaign:launch','Duplicating\x20campaign\x20\x27','yes','description','resolveWorkspaceId','getTemplate','limit','listCampaigns','engage:campaign:resume','Template\x20\x27','\x27\x20deleted\x20successfully','Fetching\x20workspaces...','pauseCampaign','log','duplicateCampaign','Updating\x20template\x20\x27','Resuming\x20campaign\x20\x27','startAt','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Update\x20a\x20campaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Fetching\x20campaign\x20\x27','Create\x20a\x20workspace','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Operation\x20cancelled','Creating\x20workspace\x20\x27','380Ighvbz','Pause\x20a\x20campaign','\x27\x20resumed\x20successfully','engage:campaigns','Fetching\x20campaigns...','engage','engage:workspace:update','engage:templates','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Workspace\x20is\x20required\x20for\x20this\x20operation','engage:workspace:show','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Show\x20workspace\x20details','Updating\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Creating\x20campaign\x20\x27','3385152aaEMbK','Deleting\x20campaign\x20\x27','status','Duplicate\x20a\x20campaign','engage:workspace:delete','full','engage:template:update','Error:\x20Workspace\x20name\x20is\x20required','Create\x20an\x20email\x20template','List\x20campaigns','Launch\x20a\x20campaign','Error:\x20--html\x20is\x20required','Campaign\x20\x27','48801yKkpXW','engage_workspace','engage:template:create','deleteCampaign','filter','328wIYSna','List\x20workspaces','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','workspace','timezone','engage:campaign:create','execute','\x27\x20launched\x20successfully','getCampaignFull','engage:campaign:show','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','engage:campaign:duplicate','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','keys','segment','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27?\x20This\x20cannot\x20be\x20undone.','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','64966biwFOW','Deleting\x20template\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','type','List\x20email\x20templates','jsonColumns','createWorkspace','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Delete\x20an\x20email\x20template','resumeCampaign','Delete\x20a\x20campaign','listTemplates','emailSenderId','getWorkspace','Options:\x20--name,\x20--description','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','entries','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','name','Launching\x20campaign\x20\x27','Fetching\x20template\x20\x27','2457oQVKin','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','updateWorkspace','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Show\x20campaign\x20details','engage:template:delete','subject','engage:workspace:create'];a16_0x219a=function(){return _0x435102;};return a16_0x219a();}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x133);[a16_0x48275b(0x147)]=a16_0x48275b(0x160);async[a16_0x48275b(0x187)](_0x94b299){const _0x4b3c6b=a16_0x48275b,{options:_0x5580fb,args:_0x1268ee,tdx:_0x342fe0}=_0x94b299;if(_0x1268ee[_0x4b3c6b(0x137)]===0x0)return console[_0x4b3c6b(0x131)](_0x4b3c6b(0x158)),console[_0x4b3c6b(0x131)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x46af7e=_0x1268ee[0x0],_0x1bee3c=_0x5580fb,_0x41c55e=await resolveWorkspaceIdFromOptions(_0x1bee3c,_0x342fe0);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x46af7e+'\x27...',()=>_0x342fe0['engage'][_0x4b3c6b(0x150)](_0x46af7e,_0x41c55e),{'verbose':_0x5580fb[_0x4b3c6b(0x126)]}),console['log'](_0x4b3c6b(0x17b)+_0x46af7e+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a16_0x48275b(0x14c);[a16_0x48275b(0x147)]=a16_0x48275b(0x12a);async['execute'](_0x38f157){const _0xf3f5be=a16_0x48275b,{options:_0x256c69,args:_0x5ddb1f,tdx:_0x2e3f3e}=_0x38f157;if(_0x5ddb1f[_0xf3f5be(0x137)]===0x0)return console[_0xf3f5be(0x131)](_0xf3f5be(0x158)),console[_0xf3f5be(0x131)](_0xf3f5be(0x192)),0x1;const _0x4b06d6=_0x5ddb1f[0x0],_0xe27281=_0x256c69,_0xbc7f7c=await resolveWorkspaceIdFromOptions(_0xe27281,_0x2e3f3e);return await withSpinner(_0xf3f5be(0x154)+_0x4b06d6+_0xf3f5be(0x135),()=>_0x2e3f3e['engage'][_0xf3f5be(0x10d)](_0x4b06d6,_0xbc7f7c),{'verbose':_0x256c69['verbose']}),console[_0xf3f5be(0x151)](_0xf3f5be(0x17b)+_0x4b06d6+_0xf3f5be(0x161)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x18c);[a16_0x48275b(0x147)]=a16_0x48275b(0x172);async[a16_0x48275b(0x187)](_0x4827d5){const _0x5b5e2e=a16_0x48275b,{options:_0x215640,args:_0x48d7c3,tdx:_0x146d35}=_0x4827d5;if(_0x48d7c3[_0x5b5e2e(0x137)]===0x0)return console[_0x5b5e2e(0x131)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x5b5e2e(0x124)),0x1;const _0x5a56c7=_0x48d7c3[0x0],_0x56add0=_0x215640,_0x2c066f=await resolveWorkspaceIdFromOptions(_0x56add0,_0x146d35),_0x586bc3=await withSpinner(_0x5b5e2e(0x145)+_0x5a56c7+_0x5b5e2e(0x135),()=>_0x146d35[_0x5b5e2e(0x164)][_0x5b5e2e(0x152)](_0x5a56c7,_0x2c066f),{'verbose':_0x215640[_0x5b5e2e(0x126)]});return await handleSDKOutput([_0x586bc3[_0x5b5e2e(0x125)]],_0x215640),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a16_0x48275b(0x166);[a16_0x48275b(0x147)]=a16_0x48275b(0x197);async[a16_0x48275b(0x187)](_0x3310c6){const _0x3f22f4=a16_0x48275b,{options:_0x2f8d8d,args:_0x3f089b,tdx:_0x82963b}=_0x3310c6,_0x376532=_0x3f089b[0x0],_0x447681=resolveLimit(_0x2f8d8d[_0x3f22f4(0x14a)],DEFAULT_LLM_LIMIT),_0x11a263=_0x2f8d8d,_0x13d151=await resolveWorkspaceIdFromOptions(_0x11a263,_0x82963b),_0x16b55c=await withSpinner(_0x3f22f4(0x139),()=>_0x82963b['engage'][_0x3f22f4(0x10f)]({'workspaceId':_0x13d151,'limit':_0x447681}),{'verbose':_0x2f8d8d['verbose']});let _0x1033a0=_0x16b55c[_0x3f22f4(0x125)];return _0x376532&&(_0x1033a0=_0x16b55c['data'][_0x3f22f4(0x180)](_0x5189ee=>matchGlobPattern(_0x5189ee[_0x3f22f4(0x116)],_0x376532))),await handleSDKOutput(_0x1033a0,_0x2f8d8d),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']='engage:template:show';[a16_0x48275b(0x147)]='Show\x20email\x20template\x20details';async[a16_0x48275b(0x187)](_0x5ecec6){const _0x3a4646=a16_0x48275b,{options:_0x4da69e,args:_0x4c8ef7,tdx:_0xf4cf42}=_0x5ecec6;if(_0x4c8ef7[_0x3a4646(0x137)]===0x0)return console[_0x3a4646(0x131)](_0x3a4646(0x156)),console[_0x3a4646(0x131)](_0x3a4646(0x19a)),0x1;const _0x39e046=_0x4c8ef7[0x0],_0x191d87=_0x4da69e,_0x524d2b=await resolveWorkspaceIdFromOptions(_0x191d87,_0xf4cf42),_0x38b419=_0x191d87['full'];if(_0x38b419){const _0x2f8e85=await withSpinner(_0x3a4646(0x118)+_0x39e046+'\x27...',()=>_0xf4cf42[_0x3a4646(0x164)]['getTemplateFull'](_0x39e046,_0x524d2b),{'verbose':_0x4da69e[_0x3a4646(0x126)]});await handleSDKOutput([_0x2f8e85],_0x4da69e);}else{const _0x2657e6=await withSpinner(_0x3a4646(0x118)+_0x39e046+_0x3a4646(0x135),()=>_0xf4cf42[_0x3a4646(0x164)][_0x3a4646(0x149)](_0x39e046,_0x524d2b),{'verbose':_0x4da69e['verbose']});await handleSDKOutput([_0x2657e6],_0x4da69e);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x17e);[a16_0x48275b(0x147)]=a16_0x48275b(0x177);async[a16_0x48275b(0x187)](_0x12f2f5){const _0x2a9255=a16_0x48275b,{options:_0x2a2fe5,tdx:_0x48f3f1}=_0x12f2f5,_0x34ede1=_0x2a2fe5,_0x1e0f18=_0x34ede1['name'],_0x396543=_0x34ede1[_0x2a9255(0x11f)],_0x5e9309=_0x34ede1[_0x2a9255(0x142)];if(!_0x1e0f18)return console[_0x2a9255(0x131)]('Error:\x20--name\x20is\x20required'),console[_0x2a9255(0x131)](_0x2a9255(0x113)),0x1;if(!_0x396543)return console[_0x2a9255(0x131)]('Error:\x20--subject\x20is\x20required'),0x1;if(!_0x5e9309)return console[_0x2a9255(0x131)](_0x2a9255(0x17a)),0x1;const _0x21ea6e=await resolveWorkspaceIdFromOptions(_0x34ede1,_0x48f3f1,!![]),_0x11395f={'name':_0x1e0f18,'subjectTemplate':_0x396543,'htmlTemplate':_0x5e9309,'workspaceId':_0x21ea6e,'plaintextTemplate':_0x34ede1['plaintext'],'editorType':_0x34ede1[_0x2a9255(0x136)]},_0x7c25e=await withSpinner('Creating\x20template\x20\x27'+_0x1e0f18+_0x2a9255(0x135),()=>_0x48f3f1['engage'][_0x2a9255(0x143)](_0x11395f));return await handleSDKOutput([_0x7c25e[_0x2a9255(0x125)]],_0x2a2fe5),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x175);[a16_0x48275b(0x147)]=a16_0x48275b(0x13b);async[a16_0x48275b(0x187)](_0x594189){const _0x48f3dd=a16_0x48275b,{options:_0x3d3665,args:_0x10f1e6,tdx:_0x36a009}=_0x594189;if(_0x10f1e6[_0x48f3dd(0x137)]===0x0)return console[_0x48f3dd(0x131)](_0x48f3dd(0x156)),console[_0x48f3dd(0x131)](_0x48f3dd(0x190)),0x1;const _0x43fcaa=_0x10f1e6[0x0],_0x1cf452=_0x3d3665,_0x405c64=await resolveWorkspaceIdFromOptions(_0x1cf452,_0x36a009),_0x183c7d={'name':_0x1cf452['name'],'subjectTemplate':_0x1cf452[_0x48f3dd(0x11f)],'htmlTemplate':_0x1cf452[_0x48f3dd(0x142)],'plaintextTemplate':_0x1cf452[_0x48f3dd(0x12e)]},_0x53d1ef=Object['fromEntries'](Object['entries'](_0x183c7d)['filter'](([,_0x1618f8])=>_0x1618f8!==undefined));if(Object['keys'](_0x53d1ef)[_0x48f3dd(0x137)]===0x0)return console['error'](_0x48f3dd(0x11c)),console['error'](_0x48f3dd(0x129)),0x1;const _0x124283=await withSpinner(_0x48f3dd(0x153)+_0x43fcaa+_0x48f3dd(0x135),()=>_0x36a009[_0x48f3dd(0x164)]['updateTemplate'](_0x43fcaa,_0x53d1ef,_0x405c64),{'verbose':_0x3d3665[_0x48f3dd(0x126)]});return await handleSDKOutput([_0x124283[_0x48f3dd(0x125)]],_0x3d3665),0x0;}}function a16_0x2981(_0x1ab191,_0x337db0){_0x1ab191=_0x1ab191-0x10d;const _0x219a59=a16_0x219a();let _0x298181=_0x219a59[_0x1ab191];return _0x298181;}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x11e);[a16_0x48275b(0x147)]=a16_0x48275b(0x19b);async[a16_0x48275b(0x187)](_0x1399a2){const _0x20bfae=a16_0x48275b,{options:_0x1cd276,args:_0x533201,tdx:_0x5df7a9}=_0x1399a2;if(_0x533201[_0x20bfae(0x137)]===0x0)return console[_0x20bfae(0x131)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x20bfae(0x131)](_0x20bfae(0x15c)),0x1;const _0x2457bb=_0x533201[0x0],_0x2c9c88=_0x1cd276,_0x5a78aa=await resolveWorkspaceIdFromOptions(_0x2c9c88,_0x5df7a9);if(!_0x1cd276[_0x20bfae(0x146)]){const _0x42f327=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x2457bb+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x42f327)return console[_0x20bfae(0x151)](_0x20bfae(0x15d)),0x0;}return await withSpinner(_0x20bfae(0x194)+_0x2457bb+_0x20bfae(0x135),()=>_0x5df7a9[_0x20bfae(0x164)][_0x20bfae(0x130)](_0x2457bb,_0x5a78aa),{'verbose':_0x1cd276[_0x20bfae(0x126)]}),console[_0x20bfae(0x151)](_0x20bfae(0x14d)+_0x2457bb+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']='engage:workspaces';[a16_0x48275b(0x147)]=a16_0x48275b(0x182);async['execute'](_0xff136d){const _0x26c6ee=a16_0x48275b,{options:_0x169372,args:_0x103527,tdx:_0x297f3e}=_0xff136d,_0x50ef6d=_0x103527[0x0],_0x1987a4=resolveLimit(_0x169372[_0x26c6ee(0x14a)],DEFAULT_LLM_LIMIT),_0x411a97=await withSpinner(_0x26c6ee(0x14f),()=>_0x297f3e[_0x26c6ee(0x164)][_0x26c6ee(0x13c)]({'limit':_0x1987a4}),{'verbose':_0x169372[_0x26c6ee(0x126)]});let _0x2e9286=_0x411a97[_0x26c6ee(0x125)];return _0x50ef6d&&(_0x2e9286=_0x411a97[_0x26c6ee(0x125)][_0x26c6ee(0x180)](_0xcc000f=>matchGlobPattern(_0xcc000f[_0x26c6ee(0x116)],_0x50ef6d))),await handleSDKOutput(_0x2e9286,_0x169372),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x169);[a16_0x48275b(0x147)]=a16_0x48275b(0x16b);async[a16_0x48275b(0x187)](_0x2f525c){const _0x27e96d=a16_0x48275b,{options:_0x376a27,args:_0xe723c5,tdx:_0x2d1147}=_0x2f525c;if(_0xe723c5[_0x27e96d(0x137)]===0x0)return console[_0x27e96d(0x131)](_0x27e96d(0x183)),console[_0x27e96d(0x131)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x4c13ba=_0xe723c5[0x0],_0x33a3e0=_0x376a27,_0x49180f=_0x33a3e0[_0x27e96d(0x174)];if(_0x49180f){const _0x20011c=await withSpinner(_0x27e96d(0x121)+_0x4c13ba+'\x27...',()=>_0x2d1147['engage'][_0x27e96d(0x132)](_0x4c13ba),{'verbose':_0x376a27['verbose']});await handleSDKOutput([_0x20011c],_0x376a27);}else{const _0x37478c=await withSpinner('Fetching\x20workspace\x20\x27'+_0x4c13ba+'\x27...',()=>_0x2d1147[_0x27e96d(0x164)][_0x27e96d(0x111)](_0x4c13ba),{'verbose':_0x376a27['verbose']});await handleSDKOutput([_0x37478c],_0x376a27);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x120);['description']=a16_0x48275b(0x15a);async[a16_0x48275b(0x187)](_0x23503f){const _0x8afceb=a16_0x48275b,{options:_0x452436,tdx:_0x4a5368}=_0x23503f,_0x1777df=_0x452436,_0x598dd6=_0x1777df['name'];if(!_0x598dd6)return console[_0x8afceb(0x131)]('Error:\x20--name\x20is\x20required'),console[_0x8afceb(0x131)](_0x8afceb(0x122)),0x1;const _0x55d817={'name':_0x598dd6,'description':_0x1777df[_0x8afceb(0x147)]},_0x30673d=await withSpinner(_0x8afceb(0x15e)+_0x598dd6+_0x8afceb(0x135),()=>_0x4a5368[_0x8afceb(0x164)][_0x8afceb(0x199)](_0x55d817));return await handleSDKOutput([_0x30673d[_0x8afceb(0x125)]],_0x452436),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x165);[a16_0x48275b(0x147)]='Update\x20a\x20workspace';async['execute'](_0x4d6ce9){const _0x568b8b=a16_0x48275b,{options:_0x158a55,args:_0x1ef5eb,tdx:_0x9585e8}=_0x4d6ce9;if(_0x1ef5eb[_0x568b8b(0x137)]===0x0)return console['error'](_0x568b8b(0x183)),console[_0x568b8b(0x131)](_0x568b8b(0x16d)),0x1;const _0x1b875b=_0x1ef5eb[0x0],_0x2110d6=_0x158a55,_0x1dab11={'name':_0x2110d6[_0x568b8b(0x116)],'description':_0x2110d6[_0x568b8b(0x147)]},_0x18b945=Object['fromEntries'](Object['entries'](_0x1dab11)['filter'](([,_0xae1264])=>_0xae1264!==undefined));if(Object['keys'](_0x18b945)['length']===0x0)return console['error'](_0x568b8b(0x11c)),console[_0x568b8b(0x131)](_0x568b8b(0x112)),0x1;const _0x16ef75=await withSpinner(_0x568b8b(0x16c)+_0x1b875b+_0x568b8b(0x135),()=>_0x9585e8['engage'][_0x568b8b(0x11b)](_0x1b875b,_0x18b945),{'verbose':_0x158a55['verbose']});return await handleSDKOutput([_0x16ef75[_0x568b8b(0x125)]],_0x158a55),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x48275b(0x116)]=a16_0x48275b(0x173);[a16_0x48275b(0x147)]=a16_0x48275b(0x13f);async[a16_0x48275b(0x187)](_0x16a2ab){const _0x498cd9=a16_0x48275b,{options:_0x3ae714,args:_0x1176eb,tdx:_0x396272}=_0x16a2ab;if(_0x1176eb[_0x498cd9(0x137)]===0x0)return console[_0x498cd9(0x131)](_0x498cd9(0x183)),console[_0x498cd9(0x131)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x30d12b=_0x1176eb[0x0];if(!_0x3ae714[_0x498cd9(0x146)]){const _0x4bb7a4=await confirm(_0x498cd9(0x11a)+_0x30d12b+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x4bb7a4)return console['log'](_0x498cd9(0x15d)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x30d12b+_0x498cd9(0x135),()=>_0x396272[_0x498cd9(0x164)]['deleteWorkspace'](_0x30d12b),{'verbose':_0x3ae714[_0x498cd9(0x126)]}),console[_0x498cd9(0x151)]('Workspace\x20\x27'+_0x30d12b+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x48275b(0x13d);[a16_0x48275b(0x147)]=a16_0x48275b(0x15b);async['execute'](_0x4f5d69){const _0x14677d=a16_0x48275b,{options:_0x5f91a9,args:_0x2ea0d5,tdx:_0xbf7ef8}=_0x4f5d69;if(_0x2ea0d5['length']===0x0)return console['error'](_0x14677d(0x176)),console[_0x14677d(0x131)](_0x14677d(0x18d)),0x1;const _0x1a5cfe=_0x2ea0d5[0x0];await withSpinner(_0x14677d(0x141)+_0x1a5cfe+_0x14677d(0x135),()=>_0xbf7ef8[_0x14677d(0x164)]['resolveWorkspaceId'](_0x1a5cfe));const _0x5c4c85=_0x5f91a9[_0x14677d(0x140)]||undefined;return saveSessionContext({'engage_workspace':_0x1a5cfe},_0x5c4c85),console[_0x14677d(0x151)]('Engage\x20workspace\x20set\x20to:\x20'+_0x1a5cfe),console[_0x14677d(0x151)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}