@treasuredata/tdx 0.25.5 → 0.25.7

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 (190) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/mcp-command.js +1 -1
  26. package/dist/commands/parent-segment-command.d.ts +40 -0
  27. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/parent-segment-command.js.map +1 -1
  30. package/dist/commands/profile-command.js +1 -1
  31. package/dist/commands/profiles-command.js +1 -1
  32. package/dist/commands/query-command.js +1 -1
  33. package/dist/commands/schedule-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segment-validate-command.js +1 -1
  42. package/dist/commands/segments.js +1 -1
  43. package/dist/commands/show.js +1 -1
  44. package/dist/commands/status-command.js +1 -1
  45. package/dist/commands/tables.js +1 -1
  46. package/dist/commands/unset-command.js +1 -1
  47. package/dist/commands/use-command.js +1 -1
  48. package/dist/commands/user-command.js +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/command-output.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/constants.js +1 -1
  55. package/dist/core/credential-cache.js +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/keychain.js +1 -1
  58. package/dist/core/profile.js +1 -1
  59. package/dist/core/project-config.js +1 -1
  60. package/dist/core/session.js +1 -1
  61. package/dist/core/user-cache.js +1 -1
  62. package/dist/core/version.js +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/mcp/server.js +1 -1
  65. package/dist/mcp/tools/index.js +1 -1
  66. package/dist/mcp/tools/tdx-run.js +1 -1
  67. package/dist/mcp/tools/tdx-search.js +1 -1
  68. package/dist/mcp/utils.js +1 -1
  69. package/dist/proxy/claude-usage-tracker.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/sse-usage-parser.js +1 -1
  72. package/dist/sdk/agent/agent-config.js +1 -1
  73. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  74. package/dist/sdk/agent/agent-yaml.js +1 -1
  75. package/dist/sdk/agent/test/evaluator.js +1 -1
  76. package/dist/sdk/agent/test/executor.js +1 -1
  77. package/dist/sdk/agent/test/index.js +1 -1
  78. package/dist/sdk/agent/test/output.js +1 -1
  79. package/dist/sdk/agent/test/parser.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/endpoints.js +1 -1
  83. package/dist/sdk/client/engage-api-client.js +1 -1
  84. package/dist/sdk/client/http-client.js +1 -1
  85. package/dist/sdk/client/llm-api-client.js +1 -1
  86. package/dist/sdk/client/rate-limiter.js +1 -1
  87. package/dist/sdk/client/td-api-client.js +1 -1
  88. package/dist/sdk/client/trino-api-client.js +1 -1
  89. package/dist/sdk/client/workflow-client.js +1 -1
  90. package/dist/sdk/connection-validator.js +1 -1
  91. package/dist/sdk/connection.js +1 -1
  92. package/dist/sdk/engage.js +1 -1
  93. package/dist/sdk/errors.js +1 -1
  94. package/dist/sdk/index.d.ts +12 -0
  95. package/dist/sdk/index.d.ts.map +1 -1
  96. package/dist/sdk/index.js +1 -1
  97. package/dist/sdk/index.js.map +1 -1
  98. package/dist/sdk/io/index.js +1 -1
  99. package/dist/sdk/io/node-filesystem.js +1 -1
  100. package/dist/sdk/job.js +1 -1
  101. package/dist/sdk/journey.js +1 -1
  102. package/dist/sdk/llm/chat-cache.js +1 -1
  103. package/dist/sdk/llm/index.js +1 -1
  104. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  105. package/dist/sdk/llm/model-factors.js +1 -1
  106. package/dist/sdk/personalization.d.ts +105 -0
  107. package/dist/sdk/personalization.d.ts.map +1 -0
  108. package/dist/sdk/personalization.js +1 -0
  109. package/dist/sdk/personalization.js.map +1 -0
  110. package/dist/sdk/query/index.js +1 -1
  111. package/dist/sdk/query/sql-parser.js +1 -1
  112. package/dist/sdk/realtime.d.ts +113 -0
  113. package/dist/sdk/realtime.d.ts.map +1 -0
  114. package/dist/sdk/realtime.js +1 -0
  115. package/dist/sdk/realtime.js.map +1 -0
  116. package/dist/sdk/schedule.js +1 -1
  117. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/fields-display.js +1 -1
  119. package/dist/sdk/segment/file-discovery.js +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-yaml.js +1 -1
  122. package/dist/sdk/segment/parent-segment-preview.d.ts +42 -0
  123. package/dist/sdk/segment/parent-segment-preview.d.ts.map +1 -1
  124. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  125. package/dist/sdk/segment/parent-segment-preview.js.map +1 -1
  126. package/dist/sdk/segment/parent-segment-yaml.d.ts +2 -2
  127. package/dist/sdk/segment/parent-segment-yaml.d.ts.map +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/parent-segment-yaml.js.map +1 -1
  130. package/dist/sdk/segment/pull-workflow.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/types/parent-segment-def.d.ts +84 -0
  138. package/dist/sdk/segment/types/parent-segment-def.d.ts.map +1 -1
  139. package/dist/sdk/segment/validate-files.js +1 -1
  140. package/dist/sdk/segment/yaml-validator.js +1 -1
  141. package/dist/sdk/segment.d.ts +22 -0
  142. package/dist/sdk/segment.d.ts.map +1 -1
  143. package/dist/sdk/segment.js +1 -1
  144. package/dist/sdk/segment.js.map +1 -1
  145. package/dist/sdk/types/index.js +1 -1
  146. package/dist/sdk/types/progress.js +1 -1
  147. package/dist/sdk/user.js +1 -1
  148. package/dist/sdk/util/format-detector.js +1 -1
  149. package/dist/sdk/util/formatters.js +1 -1
  150. package/dist/sdk/util/index.js +1 -1
  151. package/dist/sdk/util/tree-formatter.js +1 -1
  152. package/dist/sdk/workflow/archive-validation.js +1 -1
  153. package/dist/sdk/workflow/clone-workflow.js +1 -1
  154. package/dist/sdk/workflow/index.js +1 -1
  155. package/dist/sdk/workflow/pull-workflow.js +1 -1
  156. package/dist/sdk/workflow/push-workflow.js +1 -1
  157. package/dist/sdk/workflow/tdx-config.js +1 -1
  158. package/dist/sdk/workflow/workflow-utils.js +1 -1
  159. package/dist/test-utils/command-runner.js +1 -1
  160. package/dist/test-utils/factories.js +1 -1
  161. package/dist/test-utils/fixtures.js +1 -1
  162. package/dist/test-utils/http-mock.js +1 -1
  163. package/dist/test-utils/index.js +1 -1
  164. package/dist/utils/async.js +1 -1
  165. package/dist/utils/colors.js +1 -1
  166. package/dist/utils/diff.js +1 -1
  167. package/dist/utils/file-permissions.js +1 -1
  168. package/dist/utils/global-cache.js +1 -1
  169. package/dist/utils/json-loader.js +1 -1
  170. package/dist/utils/local-cache.js +1 -1
  171. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  172. package/dist/utils/logger/formatters/index.js +1 -1
  173. package/dist/utils/logger/handlers/console-handler.js +1 -1
  174. package/dist/utils/logger/handlers/file-handler.js +1 -1
  175. package/dist/utils/logger/handlers/index.js +1 -1
  176. package/dist/utils/logger/handlers/null-handler.js +1 -1
  177. package/dist/utils/logger/index.js +1 -1
  178. package/dist/utils/logger/logger.js +1 -1
  179. package/dist/utils/logger/types.js +1 -1
  180. package/dist/utils/option-validation.js +1 -1
  181. package/dist/utils/port.js +1 -1
  182. package/dist/utils/process.js +1 -1
  183. package/dist/utils/prompt.js +1 -1
  184. package/dist/utils/spinner.js +1 -1
  185. package/dist/utils/sse-parser.js +1 -1
  186. package/dist/utils/string-utils.js +1 -1
  187. package/dist/utils/table-ref-parser.js +1 -1
  188. package/dist/utils/tdx-logger.js +1 -1
  189. package/dist/utils/version-check.js +1 -1
  190. package/package.json +1 -1
@@ -1 +1 @@
1
- const a9_0x350536=a9_0x1d80;(function(_0x37c5df,_0x17498a){const _0x556050=a9_0x1d80,_0x4459a0=_0x37c5df();while(!![]){try{const _0x1f8e91=-parseInt(_0x556050(0x23c))/0x1*(parseInt(_0x556050(0x223))/0x2)+-parseInt(_0x556050(0x21c))/0x3*(-parseInt(_0x556050(0x258))/0x4)+parseInt(_0x556050(0x252))/0x5+parseInt(_0x556050(0x24c))/0x6+parseInt(_0x556050(0x20b))/0x7+parseInt(_0x556050(0x1ea))/0x8+-parseInt(_0x556050(0x276))/0x9*(parseInt(_0x556050(0x242))/0xa);if(_0x1f8e91===_0x17498a)break;else _0x4459a0['push'](_0x4459a0['shift']());}catch(_0xed3f05){_0x4459a0['push'](_0x4459a0['shift']());}}}(a9_0x229f,0xe370e));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x2afdce 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_0x350536(0x21d);function handleInstallationError(_0x56deb4,_0x4910d1,_0x265cd1,_0x2d8d2e){const _0xae969a=a9_0x350536;errorContains(_0x56deb4,_0xae969a(0x203),_0xae969a(0x26a),_0xae969a(0x202))?(_0x265cd1[_0xae969a(0x1f9)]='✓\x20'+_0x4910d1+'\x20already\x20configured',_0x2d8d2e?.[_0xae969a(0x26c)](_0x4910d1+_0xae969a(0x244)),_0x56deb4 instanceof SDKError&&_0x56deb4[_0xae969a(0x1f4)]&&_0x2d8d2e?.[_0xae969a(0x281)](_0xae969a(0x24f)+_0x56deb4['cause'][_0xae969a(0x207)])):(_0x265cd1[_0xae969a(0x20e)](_0xae969a(0x277)+_0x4910d1),_0x2d8d2e?.[_0xae969a(0x264)](_0x4910d1+_0xae969a(0x248),_0x56deb4));}export function parseVersion(_0x432889){const _0x21c319=a9_0x350536,_0x5a8df2=_0x432889[_0x21c319(0x1ff)]()[_0x21c319(0x237)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x5a8df2)return null;return{'major':parseInt(_0x5a8df2[0x1],0xa),'minor':parseInt(_0x5a8df2[0x2],0xa),'patch':parseInt(_0x5a8df2[0x3],0xa)};}export function compareVersions(_0x275a5c,_0x3ec4ad){const _0x1103a4=a9_0x350536;if(_0x275a5c[_0x1103a4(0x201)]!==_0x3ec4ad[_0x1103a4(0x201)])return _0x275a5c[_0x1103a4(0x201)]-_0x3ec4ad[_0x1103a4(0x201)];if(_0x275a5c[_0x1103a4(0x1f5)]!==_0x3ec4ad[_0x1103a4(0x1f5)])return _0x275a5c[_0x1103a4(0x1f5)]-_0x3ec4ad[_0x1103a4(0x1f5)];return _0x275a5c[_0x1103a4(0x21e)]-_0x3ec4ad[_0x1103a4(0x21e)];}function a9_0x229f(){const _0x333007=['cause','minor','CLAUDE_CODE_NOT_FOUND','✓\x20Settings\x20restored:\x20.claude/settings.local.json','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','text','stringify','green','Installing\x20plugin\x20\x27','stop','workflow-skills','trim','statusline','major','already\x20configured','already\x20exists','td-skills\x20Plugins','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','message','start','Restored\x20default\x20td-skills\x20marketplace','ANTHROPIC_MODEL','3335157SOyoXs','init','tdx-managed-proxy','warn','CLAUDE_CODE_UNSUPPORTED_VERSION','tdx','http://127.0.0.1:','getCurrent','Creating\x20.claude/settings.local.json...','Failed\x20to\x20configure\x20marketplace\x20\x27','Finding\x20available\x20port...','join','Checking\x20Claude\x20Code\x20version...','includes','https://docs.treasuredata.com/mcp','plugin','install','38976jolLsA','2.0.20','patch','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','\x20meets\x20minimum\x20requirement','TD\x20Docs\x20MCP\x20Server','Executing:\x20claude\x20','2TMPoyg','red','originalSettings','https://github.com/treasure-data/td-skills','object','account_id','\x20or\x20later.','string','Updating\x20marketplace\x20\x27','command','close','Claude\x20Code\x20CLI\x20not\x20found','tdx-skills','log','ANTHROPIC_AUTH_TOKEN','INTERNAL','CLAUDE_CODE_USE_BEDROCK','tdx\x20--profile\x20','user','site','match','✓\x20Logs\x20saved\x20to\x20','✓\x20Settings\x20configured:\x20.claude/settings.local.json','ANTHROPIC_BASE_URL','unshift','180097JJvxrj','\x27\x20removed','Marketplace\x20\x27','\x20→\x20','parse','llm-proxy','111330OyDrsu','✓\x20Marketplace\x20\x27','\x20already\x20configured','\x27:\x20','\x27...','fail','\x20configuration\x20failed','\x20is\x20too\x20old\x20(minimum:\x20','stdout','Failed\x20to\x20launch\x20Claude\x20Code:\x20','871668PHgCLB','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Failed\x20to\x20install\x20plugin\x20\x27','Command\x20output:\x20','\x27\x20installed','port','7815360WODZWY','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','logger','sql-skills','exit','Failed\x20to\x20list\x20marketplaces','72obuXKH','env','name','--version','.claude','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','Claude\x20Code\x20version\x20','data','✓\x20MCP\x20server\x20\x27','logLevel','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','localhost','error','passThroughServer','\x27\x20configured','INSTALLATION_FAILED','getLogPath','pipe','already\x20installed','marketplace','info','):\x20claude\x20','toString','CLAUDE_CODE_USE_VERTEX','td-skills','utf-8','--transport','cwd','ENOENT','claude','2151IpmnZD','Warning:\x20Failed\x20to\x20configure\x20','hostname','Setup\x20failed','profile','list','apiKey','continue','Failed\x20to\x20update\x20marketplace\x20\x27','tdx\x20claude\x20statusline','add','debug','execute','\x27\x20updated','inherit','false','Command\x20failed\x20(exit\x20','10830600laWvZj','Invalid\x20minimum\x20version\x20format:\x20','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','✓\x20Plugin\x20\x27','td-docs','code','Command\x20spawn\x20error:\x20','statusLine','Failed\x20to\x20spawn\x20claude\x20command:\x20','✓\x20Logging\x20to\x20'];a9_0x229f=function(){return _0x333007;};return a9_0x229f();}async function checkClaudeVersion(_0x4dfcf2,_0x20672e){const _0x466370=a9_0x350536;_0x20672e?.[_0x466370(0x281)](_0x466370(0x253)+_0x4dfcf2+')');const _0xef4ec1=await executeClaudeCommand([_0x466370(0x25b)],undefined,_0x20672e),_0x2c96b7=parseVersion(_0xef4ec1);if(!_0x2c96b7){_0x20672e?.[_0x466370(0x20e)](_0x466370(0x1f8)+_0xef4ec1);return;}const _0x1173a8=_0x2c96b7[_0x466370(0x201)]+'.'+_0x2c96b7['minor']+'.'+_0x2c96b7[_0x466370(0x21e)],_0x417f44=parseVersion(_0x4dfcf2);if(!_0x417f44){_0x20672e?.[_0x466370(0x20e)](_0x466370(0x1eb)+_0x4dfcf2);return;}if(compareVersions(_0x2c96b7,_0x417f44)<0x0){_0x20672e?.['error'](_0x466370(0x25e)+_0x1173a8+_0x466370(0x249)+_0x4dfcf2+')');throw new SDKError(ErrorCode[_0x466370(0x20f)],_0x466370(0x25e)+_0x1173a8+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x4dfcf2+_0x466370(0x229),undefined,{'helpText':_0x466370(0x1ec)});}_0x20672e?.[_0x466370(0x281)](_0x466370(0x25e)+_0x1173a8+_0x466370(0x220));}async function executeClaudeCommand(_0x12e444,_0x3fc057,_0x53c2b2){const _0x4a3ef7=a9_0x350536;return _0x53c2b2?.['info'](_0x4a3ef7(0x222)+_0x12e444[_0x4a3ef7(0x216)]('\x20')),new Promise((_0x40d190,_0x3720e2)=>{const _0x58013e=_0x4a3ef7,_0x4206e0=crossSpawn(_0x58013e(0x275),_0x12e444,{'stdio':_0x58013e(0x269)});let _0x13ad84='',_0x117eef='';_0x4206e0[_0x58013e(0x24a)]?.['on'](_0x58013e(0x25f),_0x3028ec=>{const _0x3350a1=_0x58013e;_0x13ad84+=_0x3028ec[_0x3350a1(0x26e)]();}),_0x4206e0['stderr']?.['on'](_0x58013e(0x25f),_0x5bacad=>{const _0x4de1ad=_0x58013e;_0x117eef+=_0x5bacad[_0x4de1ad(0x26e)]();}),_0x4206e0['on'](_0x58013e(0x264),_0x194d4f=>{const _0x7cdcd6=_0x58013e;_0x194d4f[_0x7cdcd6(0x1ef)]===_0x7cdcd6(0x274)?(_0x53c2b2?.[_0x7cdcd6(0x264)]('Claude\x20Code\x20CLI\x20not\x20found'),_0x3720e2(new SDKError(ErrorCode[_0x7cdcd6(0x1f6)],_0x7cdcd6(0x22e),_0x194d4f,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x53c2b2?.[_0x7cdcd6(0x264)](_0x7cdcd6(0x1f0)+_0x194d4f['message']),_0x3720e2(new SDKError(ErrorCode[_0x7cdcd6(0x232)],_0x7cdcd6(0x1f2)+_0x194d4f[_0x7cdcd6(0x207)],_0x194d4f)));}),_0x4206e0['on'](_0x58013e(0x256),_0x3d15aa=>{const _0x5bc9b8=_0x58013e;if(_0x3d15aa===0x0)_0x40d190(_0x13ad84);else _0x3fc057?(_0x53c2b2?.['error'](_0x5bc9b8(0x1e9)+_0x3d15aa+_0x5bc9b8(0x26d)+_0x12e444[_0x5bc9b8(0x216)]('\x20')),_0x3720e2(new SDKError(ErrorCode[_0x5bc9b8(0x267)],_0x3fc057,new Error(_0x117eef)))):_0x40d190('');});});}async function ensureMcpServer(_0x2052f5,_0x445127,_0xd8b7fb,_0x2fea4c,_0x10e25a){const _0x346758=a9_0x350536;_0x2fea4c['text']='Configuring\x20MCP\x20server\x20\x27'+_0x2052f5+'\x27...',await executeClaudeCommand(['mcp',_0x346758(0x280),_0x2052f5,_0x445127,_0x346758(0x272),_0xd8b7fb],_0x346758(0x25d)+_0x2052f5+'\x27',_0x10e25a),_0x2fea4c[_0x346758(0x1f9)]=_0x346758(0x260)+_0x2052f5+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL=a9_0x350536(0x226);export function getTdSkillsRepoUrl(){const _0x1db12b=process.env.TDX_TD_SKILLS_REPO;if(_0x1db12b)return _0x1db12b;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x2259ee,_0x37a5be){const _0x33ecff=a9_0x350536;try{const _0x304dd9=await executeClaudeCommand([_0x33ecff(0x21a),_0x33ecff(0x26b),_0x33ecff(0x27b)],_0x33ecff(0x257),_0x37a5be);if(!_0x304dd9[_0x33ecff(0x218)](_0x2259ee)){_0x37a5be?.[_0x33ecff(0x281)](_0x33ecff(0x23e)+_0x2259ee+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand([_0x33ecff(0x21a),_0x33ecff(0x26b),'remove',_0x2259ee],'Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x2259ee+'\x27',_0x37a5be),_0x37a5be?.['info']('Marketplace\x20\x27'+_0x2259ee+_0x33ecff(0x23d));}catch(_0x3c97e6){_0x37a5be?.[_0x33ecff(0x20e)]('Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x2259ee+_0x33ecff(0x245)+_0x3c97e6);}}async function restoreDefaultTdSkillsMarketplace(_0x5521f4){const _0x447cb8=a9_0x350536;try{await removeMarketplace(_0x447cb8(0x270),_0x5521f4),await executeClaudeCommand([_0x447cb8(0x21a),_0x447cb8(0x26b),_0x447cb8(0x280),DEFAULT_TD_SKILLS_URL],undefined,_0x5521f4),_0x5521f4?.[_0x447cb8(0x26c)](_0x447cb8(0x209));}catch{}}async function ensureMarketplace(_0xb82b4,_0x16ccc7,_0x27bc10,_0x4185b1){const _0x57f5b6=a9_0x350536;_0x27bc10[_0x57f5b6(0x1f9)]='Configuring\x20marketplace\x20\x27'+_0xb82b4+_0x57f5b6(0x246),await executeClaudeCommand([_0x57f5b6(0x21a),_0x57f5b6(0x26b),_0x57f5b6(0x280),_0x16ccc7],_0x57f5b6(0x214)+_0xb82b4+'\x27',_0x4185b1),_0x27bc10[_0x57f5b6(0x1f9)]=_0x57f5b6(0x243)+_0xb82b4+_0x57f5b6(0x266);}async function updateMarketplace(_0x2c6470,_0x2d1455,_0x2a2566){const _0x19a267=a9_0x350536;_0x2d1455['text']=_0x19a267(0x22b)+_0x2c6470+'\x27...',await executeClaudeCommand([_0x19a267(0x21a),_0x19a267(0x26b),'update'],_0x19a267(0x27e)+_0x2c6470+'\x27',_0x2a2566),_0x2d1455[_0x19a267(0x1f9)]=_0x19a267(0x243)+_0x2c6470+_0x19a267(0x1e6);}function a9_0x1d80(_0x4ce3c8,_0x3dbce0){_0x4ce3c8=_0x4ce3c8-0x1e5;const _0x229fd5=a9_0x229f();let _0x1d80a5=_0x229fd5[_0x4ce3c8];return _0x1d80a5;}async function ensurePlugin(_0x503982,_0x30b667,_0x5ddb8d,_0x1223fa){const _0x2c25d2=a9_0x350536;_0x5ddb8d[_0x2c25d2(0x1f9)]=_0x2c25d2(0x1fc)+_0x503982+_0x2c25d2(0x246),await executeClaudeCommand([_0x2c25d2(0x21a),_0x2c25d2(0x21b),_0x503982+'@'+_0x30b667],_0x2c25d2(0x24e)+_0x503982+'\x27',_0x1223fa),_0x5ddb8d['text']=_0x2c25d2(0x1ed)+_0x503982+_0x2c25d2(0x250);}async function createClaudeSettings(_0x221d37,_0x2cd9ba,_0x24252a){const _0x1d0276=a9_0x350536,_0x183c99=join(process[_0x1d0276(0x273)](),_0x1d0276(0x25c)),_0x1005e3=join(_0x183c99,'settings.local.json');await mkdir(_0x183c99,{'recursive':!![]});let _0x1220b3={};if(existsSync(_0x1005e3))try{const _0x106077=await readFile(_0x1005e3,_0x1d0276(0x271));_0x1220b3=JSON[_0x1d0276(0x240)](_0x106077);}catch{_0x1220b3={};}const _0x541484=_0x1220b3['env']||{},_0x18b5fd={'ANTHROPIC_BASE_URL':_0x541484[_0x1d0276(0x23a)],'ANTHROPIC_MODEL':_0x541484[_0x1d0276(0x20a)],'ANTHROPIC_AUTH_TOKEN':_0x541484[_0x1d0276(0x231)],'CLAUDE_CODE_USE_BEDROCK':_0x541484['CLAUDE_CODE_USE_BEDROCK'],'CLAUDE_CODE_USE_VERTEX':_0x541484[_0x1d0276(0x26f)],'statusLine':_0x1220b3['statusLine']},_0x1dd45e={..._0x1220b3,'env':{..._0x541484,'ANTHROPIC_BASE_URL':_0x1d0276(0x211)+_0x221d37,..._0x2cd9ba&&{'ANTHROPIC_MODEL':_0x2cd9ba},'ANTHROPIC_AUTH_TOKEN':_0x1d0276(0x20d),'CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0x1d0276(0x1e8)},'statusLine':{'type':_0x1d0276(0x22c),'command':_0x24252a?_0x1d0276(0x234)+_0x24252a+'\x20claude\x20statusline':_0x1d0276(0x27f)}};return await writeFile(_0x1005e3,JSON[_0x1d0276(0x1fa)](_0x1dd45e,null,0x2)+'\x0a'),_0x18b5fd;}async function restoreClaudeSettings(_0x630f67){const _0xebd3a4=a9_0x350536,_0x14dd3c=join(process[_0xebd3a4(0x273)](),'.claude'),_0x268a8b=join(_0x14dd3c,'settings.local.json');if(!existsSync(_0x268a8b))return;try{const _0x2793c6=await readFile(_0x268a8b,'utf-8'),_0x48be67=JSON[_0xebd3a4(0x240)](_0x2793c6),_0x540ad0=_0x48be67[_0xebd3a4(0x259)]||{},_0x1a99e1=_0x540ad0[_0xebd3a4(0x23a)],_0x5c4f9e=((()=>{const _0x44cd3d=_0xebd3a4;if(typeof _0x1a99e1!==_0x44cd3d(0x22a))return![];try{const _0x3b02ed=new URL(_0x1a99e1);return _0x3b02ed[_0x44cd3d(0x278)]===_0x44cd3d(0x263)||_0x3b02ed['hostname']==='127.0.0.1';}catch{return![];}})());_0x5c4f9e?(delete _0x540ad0['ANTHROPIC_BASE_URL'],delete _0x540ad0[_0xebd3a4(0x20a)],delete _0x540ad0['ANTHROPIC_AUTH_TOKEN'],delete _0x540ad0[_0xebd3a4(0x233)],delete _0x540ad0[_0xebd3a4(0x26f)]):(_0x630f67[_0xebd3a4(0x23a)]!==undefined?_0x540ad0[_0xebd3a4(0x23a)]=_0x630f67[_0xebd3a4(0x23a)]:delete _0x540ad0[_0xebd3a4(0x23a)],_0x630f67[_0xebd3a4(0x20a)]!==undefined?_0x540ad0[_0xebd3a4(0x20a)]=_0x630f67[_0xebd3a4(0x20a)]:delete _0x540ad0[_0xebd3a4(0x20a)],_0x630f67[_0xebd3a4(0x231)]!==undefined?_0x540ad0[_0xebd3a4(0x231)]=_0x630f67[_0xebd3a4(0x231)]:delete _0x540ad0['ANTHROPIC_AUTH_TOKEN'],_0x630f67[_0xebd3a4(0x233)]!==undefined?_0x540ad0[_0xebd3a4(0x233)]=_0x630f67['CLAUDE_CODE_USE_BEDROCK']:delete _0x540ad0[_0xebd3a4(0x233)],_0x630f67[_0xebd3a4(0x26f)]!==undefined?_0x540ad0[_0xebd3a4(0x26f)]=_0x630f67[_0xebd3a4(0x26f)]:delete _0x540ad0[_0xebd3a4(0x26f)]);const _0x2949d1=_0x48be67[_0xebd3a4(0x1f1)],_0x3a3e4e=((()=>{const _0x4d74a4=_0xebd3a4;if(!_0x2949d1||typeof _0x2949d1!==_0x4d74a4(0x227))return![];if(_0x2949d1['type']!==_0x4d74a4(0x22c))return![];if(typeof _0x2949d1[_0x4d74a4(0x22c)]!==_0x4d74a4(0x22a))return![];return _0x2949d1[_0x4d74a4(0x22c)]['includes'](_0x4d74a4(0x210))&&_0x2949d1['command'][_0x4d74a4(0x218)](_0x4d74a4(0x200));})());if(_0x3a3e4e)delete _0x48be67['statusLine'];else _0x630f67[_0xebd3a4(0x1f1)]!==undefined?_0x48be67[_0xebd3a4(0x1f1)]=_0x630f67[_0xebd3a4(0x1f1)]:delete _0x48be67['statusLine'];_0x48be67[_0xebd3a4(0x259)]=_0x540ad0,await writeFile(_0x268a8b,JSON[_0xebd3a4(0x1fa)](_0x48be67,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x350536(0x25a)]=a9_0x350536(0x275);['description']=a9_0x350536(0x262);[a9_0x350536(0x265)];['originalSettings'];[a9_0x350536(0x254)];['port'];async[a9_0x350536(0x1e5)](_0xabcc5a){const _0x483973=a9_0x350536,{tdx:_0x3eba93,options:_0x350caa,args:_0x9556a3}=_0xabcc5a;let _0x147f15=![];try{const _0x1e94a3=_0x350caa,_0x5d175e=_0x1e94a3['proxy']===![],_0x35b2ea=_0x1e94a3[_0x483973(0x27d)]===!![],_0x9bdf6d=_0x1e94a3['resume']===!![],_0x8b1141=[..._0x9556a3];if(_0x35b2ea)_0x8b1141[_0x483973(0x23b)]('-c');else _0x9bdf6d&&_0x8b1141[_0x483973(0x23b)]('-r');const _0x52ca9a=createCommandSpinner('Initializing...',{'verbose':_0x350caa['verbose']});_0x52ca9a[_0x483973(0x208)]();try{if(!_0x5d175e){_0x52ca9a[_0x483973(0x1f9)]=_0x483973(0x215),this[_0x483973(0x251)]=await findAvailablePort(0xfa0),_0x52ca9a[_0x483973(0x1f9)]='✓\x20Found\x20available\x20port:\x20'+this[_0x483973(0x251)];const _0x4eccef=_0x350caa[_0x483973(0x27a)];try{const _0x118481=await _0x3eba93[_0x483973(0x235)][_0x483973(0x212)]();_0x118481[_0x483973(0x228)]&&writeCachedAccountInfo(_0x350caa['site'],_0x118481[_0x483973(0x228)],_0x4eccef);}catch{}_0x52ca9a[_0x483973(0x1f9)]='Initializing\x20proxy\x20logger...',this[_0x483973(0x254)]=new TDXLogger(_0x350caa[_0x483973(0x261)],!![]),await this[_0x483973(0x254)][_0x483973(0x20c)]();const _0x363991=this[_0x483973(0x254)][_0x483973(0x268)]();_0x52ca9a[_0x483973(0x1f9)]=_0x483973(0x1f3)+_0x363991;const _0x139483=getEndpoint(_0x350caa['site'],_0x483973(0x241));_0x52ca9a[_0x483973(0x1f9)]=_0x483973(0x21f);if(!_0x3eba93['context']['apiKey'])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x483973(0x205));this['passThroughServer']=new PassThroughProxyServer({'port':this[_0x483973(0x251)],'llmProxyUrl':_0x139483,'apiKey':_0x3eba93['context'][_0x483973(0x27c)],'logger':this[_0x483973(0x254)],'site':_0x350caa[_0x483973(0x236)],'profile':_0x4eccef}),await this[_0x483973(0x265)][_0x483973(0x208)](),_0x52ca9a[_0x483973(0x1f9)]='✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20'+this[_0x483973(0x251)]+_0x483973(0x23f)+_0x139483,_0x52ca9a[_0x483973(0x1f9)]=_0x483973(0x213),this[_0x483973(0x225)]=await createClaudeSettings(this[_0x483973(0x251)],undefined,_0x4eccef),_0x52ca9a[_0x483973(0x1f9)]=_0x483973(0x239);}else _0x52ca9a['text']=_0x483973(0x24d);try{_0x52ca9a[_0x483973(0x1f9)]=_0x483973(0x217),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x483973(0x254)]),_0x52ca9a[_0x483973(0x1f9)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x4685ed){_0x52ca9a[_0x483973(0x247)]('Claude\x20Code\x20version\x20check\x20failed');throw _0x4685ed;}try{await ensureMcpServer(_0x483973(0x1ee),_0x483973(0x219),'http',_0x52ca9a,this['logger']);}catch(_0xdd5815){handleInstallationError(_0xdd5815,_0x483973(0x221),_0x52ca9a,this['logger']);}try{const _0x151f0b=getTdSkillsRepoUrl();_0x147f15=_0x151f0b!==DEFAULT_TD_SKILLS_URL,_0x147f15&&await removeMarketplace(_0x483973(0x270),this[_0x483973(0x254)]),await ensureMarketplace(_0x483973(0x270),_0x151f0b,_0x52ca9a,this[_0x483973(0x254)]),await updateMarketplace('td-skills',_0x52ca9a,this[_0x483973(0x254)]),await ensurePlugin(_0x483973(0x255),'td-skills',_0x52ca9a,this['logger']),await ensurePlugin(_0x483973(0x1fe),_0x483973(0x270),_0x52ca9a,this[_0x483973(0x254)]),await ensurePlugin(_0x483973(0x22f),_0x483973(0x270),_0x52ca9a,this[_0x483973(0x254)]);}catch(_0x42464e){handleInstallationError(_0x42464e,_0x483973(0x204),_0x52ca9a,this[_0x483973(0x254)]);}_0x52ca9a['stop']();}catch(_0x5e36dc){_0x52ca9a['fail'](_0x483973(0x279));throw _0x5e36dc;}const _0x57da47=await findExecutable(_0x483973(0x275));if(!_0x57da47)throw new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x483973(0x22e),undefined,{'helpText':_0x483973(0x206)});const _0x375631={...process.env};!_0x5d175e&&(_0x375631[_0x483973(0x23a)]=_0x483973(0x211)+this[_0x483973(0x251)],_0x375631[_0x483973(0x231)]=_0x483973(0x20d),_0x375631[_0x483973(0x233)]=_0x483973(0x1e8),_0x375631[_0x483973(0x26f)]=_0x483973(0x1e8));const _0x14122d=crossSpawn(_0x57da47,_0x8b1141,{'stdio':_0x483973(0x1e7),'env':_0x375631}),_0x18087f=await new Promise(_0x524f6a=>{const _0xc4db7a=_0x483973;_0x14122d['on'](_0xc4db7a(0x256),_0x540b61=>{_0x524f6a(_0x540b61||0x0);}),_0x14122d['on']('error',_0x4979a5=>{const _0x4f0c9f=_0xc4db7a;console[_0x4f0c9f(0x264)](a9_0x2afdce[_0x4f0c9f(0x224)](_0x4f0c9f(0x24b)+_0x4979a5[_0x4f0c9f(0x207)])),_0x524f6a(0x1);});});_0x147f15&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&(await this[_0x483973(0x265)][_0x483973(0x1fd)](),console[_0x483973(0x230)](a9_0x2afdce[_0x483973(0x1fb)]('✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped')));if(this['logger']){await this[_0x483973(0x254)][_0x483973(0x22d)]();const _0x98950c=this[_0x483973(0x254)]['getLogPath']();console[_0x483973(0x230)](a9_0x2afdce[_0x483973(0x1fb)](_0x483973(0x238)+_0x98950c));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x483973(0x225)]),console[_0x483973(0x230)](a9_0x2afdce[_0x483973(0x1fb)](_0x483973(0x1f7)))),_0x18087f;}catch(_0xa7a65a){_0x147f15&&await restoreDefaultTdSkillsMarketplace(this[_0x483973(0x254)]);this[_0x483973(0x265)]&&await this[_0x483973(0x265)][_0x483973(0x1fd)]();this['logger']&&await this[_0x483973(0x254)][_0x483973(0x22d)]();this[_0x483973(0x225)]&&await restoreClaudeSettings(this['originalSettings']);throw _0xa7a65a;}}}
1
+ const a9_0x170387=a9_0x3573;(function(_0x12a1c6,_0x2f9138){const _0x10e2c7=a9_0x3573,_0x5b4e94=_0x12a1c6();while(!![]){try{const _0x337f7d=parseInt(_0x10e2c7(0x157))/0x1*(parseInt(_0x10e2c7(0x111))/0x2)+parseInt(_0x10e2c7(0x136))/0x3*(parseInt(_0x10e2c7(0x120))/0x4)+parseInt(_0x10e2c7(0x140))/0x5*(-parseInt(_0x10e2c7(0x16e))/0x6)+-parseInt(_0x10e2c7(0x176))/0x7+parseInt(_0x10e2c7(0x10a))/0x8+parseInt(_0x10e2c7(0x10b))/0x9+-parseInt(_0x10e2c7(0x169))/0xa*(parseInt(_0x10e2c7(0x14a))/0xb);if(_0x337f7d===_0x2f9138)break;else _0x5b4e94['push'](_0x5b4e94['shift']());}catch(_0x3bb26f){_0x5b4e94['push'](_0x5b4e94['shift']());}}}(a9_0x3625,0x7a3b5));function a9_0x3625(){const _0x9d7587=['text','minor','CLAUDE_CODE_USE_BEDROCK','Restored\x20default\x20td-skills\x20marketplace','marketplace','Marketplace\x20\x27','✓\x20Settings\x20restored:\x20.claude/settings.local.json','406638CKaKry','http','tdx','inherit','log','ANTHROPIC_MODEL','http://127.0.0.1:','exit','plugin','Command\x20failed\x20(exit\x20','1730jzLyEc','red','major','join','close','Failed\x20to\x20update\x20marketplace\x20\x27','127.0.0.1','hostname','tdx\x20--profile\x20','cause','6721nnuEao','passThroughServer','proxy','env','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','Creating\x20.claude/settings.local.json...','CLAUDE_CODE_USE_VERTEX','Executing:\x20claude\x20','fail','Configuring\x20marketplace\x20\x27','description','apiKey','getLogPath','92733wGYvjy','✓\x20Logging\x20to\x20','stderr','Failed\x20to\x20spawn\x20claude\x20command:\x20','Finding\x20available\x20port...','Claude\x20Code\x20CLI\x20not\x20found','message','llm-proxy','CLAUDE_CODE_NOT_FOUND','--transport','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','Claude\x20Code\x20version\x20','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','cwd','.claude','tdx-managed-proxy','match','Failed\x20to\x20configure\x20marketplace\x20\x27','390SUcSpN','green','claude','tdx-skills','Warning:\x20Failed\x20to\x20configure\x20','1194lVPWlK','stringify','Failed\x20to\x20install\x20plugin\x20\x27','start','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','data','already\x20exists','Invalid\x20minimum\x20version\x20format:\x20','5039412KKwNSG','INSTALLATION_FAILED','✓\x20Settings\x20configured:\x20.claude/settings.local.json','td-docs','Failed\x20to\x20remove\x20marketplace\x20\x27','context','list','ANTHROPIC_BASE_URL','INVALID_ARGUMENT','tdx\x20claude\x20statusline','account_id','utf-8','td-skills','Installing\x20plugin\x20\x27','unshift','\x27\x20installed','originalSettings','includes','statusLine','false','error','Updating\x20marketplace\x20\x27','getCurrent','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','resume','command','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Failed\x20to\x20launch\x20Claude\x20Code:\x20','update','settings.local.json','--version','type','\x27\x20configured','Setup\x20failed','port','profile','TD\x20Docs\x20MCP\x20Server','):\x20claude\x20','\x27:\x20','\x20configuration\x20failed','2.0.20','add','Failed\x20to\x20list\x20marketplaces','site','user','\x20claude\x20statusline','1171248eZuPqU','5172750TCCmMW','Configuring\x20MCP\x20server\x20\x27','sql-skills','INTERNAL','install','warn','4tMJTUE','patch','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','Command\x20spawn\x20error:\x20','logger','\x27...','stop','toString','ANTHROPIC_AUTH_TOKEN','debug','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','trim','\x20→\x20','already\x20configured','\x20already\x20configured','12eJLdMH','https://docs.treasuredata.com/mcp','Command\x20output:\x20','continue','info','Claude\x20Code\x20version\x20check\x20failed','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','✓\x20Marketplace\x20\x27','td-skills\x20Plugins','parse','✓\x20Claude\x20Code\x20version\x20OK','\x20or\x20later.','string'];a9_0x3625=function(){return _0x9d7587;};return a9_0x3625();}import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x17e2e4 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_0x170387(0x104);function handleInstallationError(_0x12b3e9,_0x372741,_0x14ffff,_0x5a6f34){const _0x214bfb=a9_0x170387;errorContains(_0x12b3e9,_0x214bfb(0x174),'already\x20installed',_0x214bfb(0x11e))?(_0x14ffff[_0x214bfb(0x12f)]='✓\x20'+_0x372741+_0x214bfb(0x11f),_0x5a6f34?.[_0x214bfb(0x124)](_0x372741+_0x214bfb(0x11f)),_0x12b3e9 instanceof SDKError&&_0x12b3e9[_0x214bfb(0x149)]&&_0x5a6f34?.['debug'](_0x214bfb(0x122)+_0x12b3e9[_0x214bfb(0x149)][_0x214bfb(0x15d)])):(_0x14ffff['warn'](_0x214bfb(0x16d)+_0x372741),_0x5a6f34?.[_0x214bfb(0xf0)](_0x372741+_0x214bfb(0x103),_0x12b3e9));}export function parseVersion(_0xcc65c5){const _0xe964e8=a9_0x170387,_0x9dd7ce=_0xcc65c5[_0xe964e8(0x11c)]()[_0xe964e8(0x167)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x9dd7ce)return null;return{'major':parseInt(_0x9dd7ce[0x1],0xa),'minor':parseInt(_0x9dd7ce[0x2],0xa),'patch':parseInt(_0x9dd7ce[0x3],0xa)};}export function compareVersions(_0x2a59d7,_0x1ccadd){const _0x12e49c=a9_0x170387;if(_0x2a59d7[_0x12e49c(0x142)]!==_0x1ccadd[_0x12e49c(0x142)])return _0x2a59d7[_0x12e49c(0x142)]-_0x1ccadd[_0x12e49c(0x142)];if(_0x2a59d7[_0x12e49c(0x130)]!==_0x1ccadd[_0x12e49c(0x130)])return _0x2a59d7[_0x12e49c(0x130)]-_0x1ccadd[_0x12e49c(0x130)];return _0x2a59d7[_0x12e49c(0x112)]-_0x1ccadd['patch'];}async function checkClaudeVersion(_0x556ea4,_0x1f68e1){const _0x3e3393=a9_0x170387;_0x1f68e1?.['debug'](_0x3e3393(0xf3)+_0x556ea4+')');const _0x5eeedf=await executeClaudeCommand([_0x3e3393(0xfa)],undefined,_0x1f68e1),_0x33a337=parseVersion(_0x5eeedf);if(!_0x33a337){_0x1f68e1?.[_0x3e3393(0x110)](_0x3e3393(0x14e)+_0x5eeedf);return;}const _0x28c166=_0x33a337[_0x3e3393(0x142)]+'.'+_0x33a337['minor']+'.'+_0x33a337['patch'],_0x3437ab=parseVersion(_0x556ea4);if(!_0x3437ab){_0x1f68e1?.[_0x3e3393(0x110)](_0x3e3393(0x175)+_0x556ea4);return;}if(compareVersions(_0x33a337,_0x3437ab)<0x0){_0x1f68e1?.[_0x3e3393(0xf0)](_0x3e3393(0x162)+_0x28c166+'\x20is\x20too\x20old\x20(minimum:\x20'+_0x556ea4+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],_0x3e3393(0x162)+_0x28c166+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x556ea4+_0x3e3393(0x12d),undefined,{'helpText':_0x3e3393(0x163)});}_0x1f68e1?.[_0x3e3393(0x11a)](_0x3e3393(0x162)+_0x28c166+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x81eaf2,_0x3e69d0,_0x188aa7){const _0x5c7bfa=a9_0x170387;return _0x188aa7?.[_0x5c7bfa(0x124)](_0x5c7bfa(0x151)+_0x81eaf2[_0x5c7bfa(0x143)]('\x20')),new Promise((_0xdafa87,_0x5b48cc)=>{const _0x545e84=_0x5c7bfa,_0x978af9=crossSpawn(_0x545e84(0x16b),_0x81eaf2,{'stdio':'pipe'});let _0x440c42='',_0x3fd27a='';_0x978af9['stdout']?.['on'](_0x545e84(0x173),_0x5a424d=>{const _0x17d186=_0x545e84;_0x440c42+=_0x5a424d[_0x17d186(0x118)]();}),_0x978af9[_0x545e84(0x159)]?.['on'](_0x545e84(0x173),_0x3ebfe6=>{const _0x5b2791=_0x545e84;_0x3fd27a+=_0x3ebfe6[_0x5b2791(0x118)]();}),_0x978af9['on']('error',_0x3359fd=>{const _0xbd8323=_0x545e84;_0x3359fd['code']==='ENOENT'?(_0x188aa7?.[_0xbd8323(0xf0)](_0xbd8323(0x15c)),_0x5b48cc(new SDKError(ErrorCode[_0xbd8323(0x15f)],'Claude\x20Code\x20CLI\x20not\x20found',_0x3359fd,{'helpText':_0xbd8323(0xf6)}))):(_0x188aa7?.[_0xbd8323(0xf0)](_0xbd8323(0x114)+_0x3359fd[_0xbd8323(0x15d)]),_0x5b48cc(new SDKError(ErrorCode[_0xbd8323(0x10e)],_0xbd8323(0x15a)+_0x3359fd[_0xbd8323(0x15d)],_0x3359fd)));}),_0x978af9['on'](_0x545e84(0x13d),_0x1f955c=>{const _0x1ea24d=_0x545e84;if(_0x1f955c===0x0)_0xdafa87(_0x440c42);else _0x3e69d0?(_0x188aa7?.[_0x1ea24d(0xf0)](_0x1ea24d(0x13f)+_0x1f955c+_0x1ea24d(0x101)+_0x81eaf2[_0x1ea24d(0x143)]('\x20')),_0x5b48cc(new SDKError(ErrorCode[_0x1ea24d(0x177)],_0x3e69d0,new Error(_0x3fd27a)))):_0xdafa87('');});});}async function ensureMcpServer(_0x4319fe,_0x20fd18,_0x48243b,_0x8221e9,_0x240e65){const _0x52ef66=a9_0x170387;_0x8221e9[_0x52ef66(0x12f)]=_0x52ef66(0x10c)+_0x4319fe+_0x52ef66(0x116),await executeClaudeCommand(['mcp',_0x52ef66(0x105),_0x4319fe,_0x20fd18,_0x52ef66(0x160),_0x48243b],_0x52ef66(0x172)+_0x4319fe+'\x27',_0x240e65),_0x8221e9[_0x52ef66(0x12f)]='✓\x20MCP\x20server\x20\x27'+_0x4319fe+_0x52ef66(0xfc);}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x509f38=process.env.TDX_TD_SKILLS_REPO;if(_0x509f38)return _0x509f38;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x730b8c,_0x5ec8c7){const _0x10f43f=a9_0x170387;try{const _0x55c3c4=await executeClaudeCommand([_0x10f43f(0x13e),_0x10f43f(0x133),_0x10f43f(0x17c)],_0x10f43f(0x106),_0x5ec8c7);if(!_0x55c3c4['includes'](_0x730b8c)){_0x5ec8c7?.[_0x10f43f(0x11a)](_0x10f43f(0x134)+_0x730b8c+_0x10f43f(0x126));return;}await executeClaudeCommand([_0x10f43f(0x13e),_0x10f43f(0x133),'remove',_0x730b8c],_0x10f43f(0x17a)+_0x730b8c+'\x27',_0x5ec8c7),_0x5ec8c7?.[_0x10f43f(0x124)](_0x10f43f(0x134)+_0x730b8c+'\x27\x20removed');}catch(_0x1a9bc2){_0x5ec8c7?.[_0x10f43f(0x110)](_0x10f43f(0x17a)+_0x730b8c+_0x10f43f(0x102)+_0x1a9bc2);}}async function restoreDefaultTdSkillsMarketplace(_0x2bdf23){const _0x2dac2f=a9_0x170387;try{await removeMarketplace('td-skills',_0x2bdf23),await executeClaudeCommand([_0x2dac2f(0x13e),_0x2dac2f(0x133),_0x2dac2f(0x105),DEFAULT_TD_SKILLS_URL],undefined,_0x2bdf23),_0x2bdf23?.[_0x2dac2f(0x124)](_0x2dac2f(0x132));}catch{}}async function ensureMarketplace(_0x31a42d,_0x5425c9,_0x342811,_0x57d2c5){const _0x66f5c4=a9_0x170387;_0x342811[_0x66f5c4(0x12f)]=_0x66f5c4(0x153)+_0x31a42d+'\x27...',await executeClaudeCommand([_0x66f5c4(0x13e),_0x66f5c4(0x133),_0x66f5c4(0x105),_0x5425c9],_0x66f5c4(0x168)+_0x31a42d+'\x27',_0x57d2c5),_0x342811[_0x66f5c4(0x12f)]=_0x66f5c4(0x129)+_0x31a42d+_0x66f5c4(0xfc);}function a9_0x3573(_0x2b716a,_0x50be35){_0x2b716a=_0x2b716a-0xe5;const _0x362550=a9_0x3625();let _0x357361=_0x362550[_0x2b716a];return _0x357361;}async function updateMarketplace(_0x4210d5,_0x311792,_0x2bfb78){const _0x1e6d62=a9_0x170387;_0x311792[_0x1e6d62(0x12f)]=_0x1e6d62(0xf1)+_0x4210d5+_0x1e6d62(0x116),await executeClaudeCommand([_0x1e6d62(0x13e),_0x1e6d62(0x133),_0x1e6d62(0xf8)],_0x1e6d62(0x145)+_0x4210d5+'\x27',_0x2bfb78),_0x311792[_0x1e6d62(0x12f)]=_0x1e6d62(0x129)+_0x4210d5+'\x27\x20updated';}async function ensurePlugin(_0x4c0774,_0x43b787,_0x1879d1,_0x4c9ead){const _0x26ae0a=a9_0x170387;_0x1879d1[_0x26ae0a(0x12f)]=_0x26ae0a(0xe9)+_0x4c0774+_0x26ae0a(0x116),await executeClaudeCommand([_0x26ae0a(0x13e),_0x26ae0a(0x10f),_0x4c0774+'@'+_0x43b787],_0x26ae0a(0x170)+_0x4c0774+'\x27',_0x4c9ead),_0x1879d1[_0x26ae0a(0x12f)]='✓\x20Plugin\x20\x27'+_0x4c0774+_0x26ae0a(0xeb);}async function createClaudeSettings(_0xb653d3,_0x41fedf,_0x42b381){const _0x38dedd=a9_0x170387,_0x11ffdd=join(process[_0x38dedd(0x164)](),'.claude'),_0x116fd9=join(_0x11ffdd,_0x38dedd(0xf9));await mkdir(_0x11ffdd,{'recursive':!![]});let _0x4f13e0={};if(existsSync(_0x116fd9))try{const _0x3953f0=await readFile(_0x116fd9,_0x38dedd(0xe7));_0x4f13e0=JSON[_0x38dedd(0x12b)](_0x3953f0);}catch{_0x4f13e0={};}const _0x3862f7=_0x4f13e0[_0x38dedd(0x14d)]||{},_0x168812={'ANTHROPIC_BASE_URL':_0x3862f7[_0x38dedd(0x17d)],'ANTHROPIC_MODEL':_0x3862f7['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x3862f7[_0x38dedd(0x119)],'CLAUDE_CODE_USE_BEDROCK':_0x3862f7[_0x38dedd(0x131)],'CLAUDE_CODE_USE_VERTEX':_0x3862f7[_0x38dedd(0x150)],'statusLine':_0x4f13e0[_0x38dedd(0xee)]},_0x82a09a={..._0x4f13e0,'env':{..._0x3862f7,'ANTHROPIC_BASE_URL':_0x38dedd(0x13c)+_0xb653d3,..._0x41fedf&&{'ANTHROPIC_MODEL':_0x41fedf},'ANTHROPIC_AUTH_TOKEN':'tdx-managed-proxy','CLAUDE_CODE_USE_BEDROCK':_0x38dedd(0xef),'CLAUDE_CODE_USE_VERTEX':_0x38dedd(0xef)},'statusLine':{'type':_0x38dedd(0xf5),'command':_0x42b381?_0x38dedd(0x148)+_0x42b381+_0x38dedd(0x109):_0x38dedd(0xe5)}};return await writeFile(_0x116fd9,JSON['stringify'](_0x82a09a,null,0x2)+'\x0a'),_0x168812;}async function restoreClaudeSettings(_0x561946){const _0x52fcb9=a9_0x170387,_0x5bf07e=join(process[_0x52fcb9(0x164)](),_0x52fcb9(0x165)),_0x57f558=join(_0x5bf07e,_0x52fcb9(0xf9));if(!existsSync(_0x57f558))return;try{const _0x580c2e=await readFile(_0x57f558,_0x52fcb9(0xe7)),_0x48df82=JSON[_0x52fcb9(0x12b)](_0x580c2e),_0x2247c7=_0x48df82['env']||{},_0xb13716=_0x2247c7['ANTHROPIC_BASE_URL'],_0x4cad9a=((()=>{const _0x253908=_0x52fcb9;if(typeof _0xb13716!==_0x253908(0x12e))return![];try{const _0x382191=new URL(_0xb13716);return _0x382191[_0x253908(0x147)]==='localhost'||_0x382191[_0x253908(0x147)]===_0x253908(0x146);}catch{return![];}})());_0x4cad9a?(delete _0x2247c7[_0x52fcb9(0x17d)],delete _0x2247c7['ANTHROPIC_MODEL'],delete _0x2247c7[_0x52fcb9(0x119)],delete _0x2247c7['CLAUDE_CODE_USE_BEDROCK'],delete _0x2247c7[_0x52fcb9(0x150)]):(_0x561946[_0x52fcb9(0x17d)]!==undefined?_0x2247c7[_0x52fcb9(0x17d)]=_0x561946[_0x52fcb9(0x17d)]:delete _0x2247c7[_0x52fcb9(0x17d)],_0x561946[_0x52fcb9(0x13b)]!==undefined?_0x2247c7['ANTHROPIC_MODEL']=_0x561946[_0x52fcb9(0x13b)]:delete _0x2247c7[_0x52fcb9(0x13b)],_0x561946[_0x52fcb9(0x119)]!==undefined?_0x2247c7[_0x52fcb9(0x119)]=_0x561946[_0x52fcb9(0x119)]:delete _0x2247c7[_0x52fcb9(0x119)],_0x561946[_0x52fcb9(0x131)]!==undefined?_0x2247c7[_0x52fcb9(0x131)]=_0x561946[_0x52fcb9(0x131)]:delete _0x2247c7[_0x52fcb9(0x131)],_0x561946[_0x52fcb9(0x150)]!==undefined?_0x2247c7[_0x52fcb9(0x150)]=_0x561946['CLAUDE_CODE_USE_VERTEX']:delete _0x2247c7[_0x52fcb9(0x150)]);const _0x356811=_0x48df82['statusLine'],_0x36d606=((()=>{const _0x357d47=_0x52fcb9;if(!_0x356811||typeof _0x356811!=='object')return![];if(_0x356811[_0x357d47(0xfb)]!==_0x357d47(0xf5))return![];if(typeof _0x356811[_0x357d47(0xf5)]!==_0x357d47(0x12e))return![];return _0x356811['command'][_0x357d47(0xed)](_0x357d47(0x138))&&_0x356811[_0x357d47(0xf5)][_0x357d47(0xed)]('statusline');})());if(_0x36d606)delete _0x48df82[_0x52fcb9(0xee)];else _0x561946[_0x52fcb9(0xee)]!==undefined?_0x48df82[_0x52fcb9(0xee)]=_0x561946[_0x52fcb9(0xee)]:delete _0x48df82[_0x52fcb9(0xee)];_0x48df82[_0x52fcb9(0x14d)]=_0x2247c7,await writeFile(_0x57f558,JSON[_0x52fcb9(0x16f)](_0x48df82,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a9_0x170387(0x16b);[a9_0x170387(0x154)]=a9_0x170387(0x128);['passThroughServer'];[a9_0x170387(0xec)];[a9_0x170387(0x115)];[a9_0x170387(0xfe)];async['execute'](_0x5ed6a0){const _0x54de8c=a9_0x170387,{tdx:_0x5bbf34,options:_0x5e52ef,args:_0x45f639}=_0x5ed6a0;let _0x55841b=![];try{const _0x294b72=_0x5e52ef,_0x2a13a1=_0x294b72[_0x54de8c(0x14c)]===![],_0x3e7d55=_0x294b72[_0x54de8c(0x123)]===!![],_0x3b93c0=_0x294b72[_0x54de8c(0xf4)]===!![],_0x39cf68=[..._0x45f639];if(_0x3e7d55)_0x39cf68[_0x54de8c(0xea)]('-c');else _0x3b93c0&&_0x39cf68['unshift']('-r');const _0x4cb61e=createCommandSpinner('Initializing...',{'verbose':_0x5e52ef['verbose']});_0x4cb61e[_0x54de8c(0x171)]();try{if(!_0x2a13a1){_0x4cb61e[_0x54de8c(0x12f)]=_0x54de8c(0x15b),this[_0x54de8c(0xfe)]=await findAvailablePort(0xfa0),_0x4cb61e['text']='✓\x20Found\x20available\x20port:\x20'+this[_0x54de8c(0xfe)];const _0x3e7fa4=_0x5e52ef[_0x54de8c(0xff)];try{const _0x23ee21=await _0x5bbf34[_0x54de8c(0x108)][_0x54de8c(0xf2)]();_0x23ee21[_0x54de8c(0xe6)]&&writeCachedAccountInfo(_0x5e52ef[_0x54de8c(0x107)],_0x23ee21[_0x54de8c(0xe6)],_0x3e7fa4);}catch{}_0x4cb61e[_0x54de8c(0x12f)]='Initializing\x20proxy\x20logger...',this['logger']=new TDXLogger(_0x5e52ef['logLevel'],!![]),await this['logger']['init']();const _0x11603b=this[_0x54de8c(0x115)][_0x54de8c(0x156)]();_0x4cb61e[_0x54de8c(0x12f)]=_0x54de8c(0x158)+_0x11603b;const _0x2fcc81=getEndpoint(_0x5e52ef['site'],_0x54de8c(0x15e));_0x4cb61e['text']=_0x54de8c(0x127);if(!_0x5bbf34[_0x54de8c(0x17b)][_0x54de8c(0x155)])throw new SDKError(ErrorCode[_0x54de8c(0x17e)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x54de8c(0x14b)]=new PassThroughProxyServer({'port':this[_0x54de8c(0xfe)],'llmProxyUrl':_0x2fcc81,'apiKey':_0x5bbf34['context']['apiKey'],'logger':this[_0x54de8c(0x115)],'site':_0x5e52ef[_0x54de8c(0x107)],'profile':_0x3e7fa4}),await this['passThroughServer'][_0x54de8c(0x171)](),_0x4cb61e[_0x54de8c(0x12f)]=_0x54de8c(0x161)+this['port']+_0x54de8c(0x11d)+_0x2fcc81,_0x4cb61e[_0x54de8c(0x12f)]=_0x54de8c(0x14f),this['originalSettings']=await createClaudeSettings(this['port'],undefined,_0x3e7fa4),_0x4cb61e['text']=_0x54de8c(0x178);}else _0x4cb61e[_0x54de8c(0x12f)]=_0x54de8c(0x11b);try{_0x4cb61e[_0x54de8c(0x12f)]='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x54de8c(0x115)]),_0x4cb61e[_0x54de8c(0x12f)]=_0x54de8c(0x12c);}catch(_0x2c2c0){_0x4cb61e[_0x54de8c(0x152)](_0x54de8c(0x125));throw _0x2c2c0;}try{await ensureMcpServer(_0x54de8c(0x179),_0x54de8c(0x121),_0x54de8c(0x137),_0x4cb61e,this[_0x54de8c(0x115)]);}catch(_0x1dfee2){handleInstallationError(_0x1dfee2,_0x54de8c(0x100),_0x4cb61e,this[_0x54de8c(0x115)]);}try{const _0xe637a9=getTdSkillsRepoUrl();_0x55841b=_0xe637a9!==DEFAULT_TD_SKILLS_URL,_0x55841b&&await removeMarketplace(_0x54de8c(0xe8),this[_0x54de8c(0x115)]),await ensureMarketplace(_0x54de8c(0xe8),_0xe637a9,_0x4cb61e,this['logger']),await updateMarketplace(_0x54de8c(0xe8),_0x4cb61e,this[_0x54de8c(0x115)]),await ensurePlugin(_0x54de8c(0x10d),_0x54de8c(0xe8),_0x4cb61e,this[_0x54de8c(0x115)]),await ensurePlugin('workflow-skills',_0x54de8c(0xe8),_0x4cb61e,this['logger']),await ensurePlugin(_0x54de8c(0x16c),_0x54de8c(0xe8),_0x4cb61e,this[_0x54de8c(0x115)]);}catch(_0x59b313){handleInstallationError(_0x59b313,_0x54de8c(0x12a),_0x4cb61e,this[_0x54de8c(0x115)]);}_0x4cb61e[_0x54de8c(0x117)]();}catch(_0x5dbfb9){_0x4cb61e[_0x54de8c(0x152)](_0x54de8c(0xfd));throw _0x5dbfb9;}const _0x1a03a1=await findExecutable('claude');if(!_0x1a03a1)throw new SDKError(ErrorCode[_0x54de8c(0x15f)],_0x54de8c(0x15c),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x3bfaf1={...process.env};!_0x2a13a1&&(_0x3bfaf1[_0x54de8c(0x17d)]='http://127.0.0.1:'+this[_0x54de8c(0xfe)],_0x3bfaf1[_0x54de8c(0x119)]=_0x54de8c(0x166),_0x3bfaf1[_0x54de8c(0x131)]=_0x54de8c(0xef),_0x3bfaf1[_0x54de8c(0x150)]=_0x54de8c(0xef));const _0x902950=crossSpawn(_0x1a03a1,_0x39cf68,{'stdio':_0x54de8c(0x139),'env':_0x3bfaf1}),_0x583bad=await new Promise(_0x5b1056=>{const _0x294d6f=_0x54de8c;_0x902950['on'](_0x294d6f(0x13d),_0x49b1ca=>{_0x5b1056(_0x49b1ca||0x0);}),_0x902950['on'](_0x294d6f(0xf0),_0x4a42c6=>{const _0x476c73=_0x294d6f;console[_0x476c73(0xf0)](a9_0x17e2e4[_0x476c73(0x141)](_0x476c73(0xf7)+_0x4a42c6[_0x476c73(0x15d)])),_0x5b1056(0x1);});});_0x55841b&&await restoreDefaultTdSkillsMarketplace(this[_0x54de8c(0x115)]);this[_0x54de8c(0x14b)]&&(await this['passThroughServer'][_0x54de8c(0x117)](),console[_0x54de8c(0x13a)](a9_0x17e2e4[_0x54de8c(0x16a)](_0x54de8c(0x113))));if(this[_0x54de8c(0x115)]){await this['logger']['close']();const _0x11ef48=this[_0x54de8c(0x115)][_0x54de8c(0x156)]();console[_0x54de8c(0x13a)](a9_0x17e2e4[_0x54de8c(0x16a)]('✓\x20Logs\x20saved\x20to\x20'+_0x11ef48));}return this[_0x54de8c(0xec)]&&(await restoreClaudeSettings(this['originalSettings']),console[_0x54de8c(0x13a)](a9_0x17e2e4['green'](_0x54de8c(0x135)))),_0x583bad;}catch(_0xe350c9){_0x55841b&&await restoreDefaultTdSkillsMarketplace(this[_0x54de8c(0x115)]);this[_0x54de8c(0x14b)]&&await this[_0x54de8c(0x14b)]['stop']();this[_0x54de8c(0x115)]&&await this[_0x54de8c(0x115)][_0x54de8c(0x144)]();this[_0x54de8c(0xec)]&&await restoreClaudeSettings(this[_0x54de8c(0xec)]);throw _0xe350c9;}}}
@@ -1 +1 @@
1
- const a10_0x41c7d8=a10_0x3506;function a10_0x745b(){const _0x47694d=['close','options','name','push','parse','session_id','84238BeLEOs','\x20month','tdx','stdin','latestInputTokens','\x20session\x20/\x20','💎\x20','4881460QCEEXc','99fJILDy','join','\x20|\x20','statusline','9179850mapdlg','accountId','6510580tUDyme','sessionCredits','\x20-\x20','site','56289ciOIUv','line','🧠\x20','💎\x20tdx\x20-\x20Claude','execute','log','🪙\x20credit:\x20','monthCredits','3433216BoVaTP','profile','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','todayCredits','6igPulV','Claude','toFixed','6226626uvsYSp','model','tdx\x20','8MQRzUa','description'];a10_0x745b=function(){return _0x47694d;};return a10_0x745b();}(function(_0x739810,_0x15986c){const _0x14a918=a10_0x3506,_0x1b10f8=_0x739810();while(!![]){try{const _0x3eeebc=parseInt(_0x14a918(0x211))/0x1+-parseInt(_0x14a918(0x203))/0x2*(parseInt(_0x14a918(0x1f7))/0x3)+-parseInt(_0x14a918(0x1ff))/0x4+-parseInt(_0x14a918(0x1f3))/0x5+-parseInt(_0x14a918(0x1f1))/0x6+-parseInt(_0x14a918(0x206))/0x7*(parseInt(_0x14a918(0x209))/0x8)+-parseInt(_0x14a918(0x1ed))/0x9*(-parseInt(_0x14a918(0x1ec))/0xa);if(_0x3eeebc===_0x15986c)break;else _0x1b10f8['push'](_0x1b10f8['shift']());}catch(_0x7fd75b){_0x1b10f8['push'](_0x1b10f8['shift']());}}}(a10_0x745b,0xc79ea));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a10_0x3506(_0xea4090,_0x362c73){_0xea4090=_0xea4090-0x1e9;const _0x745b75=a10_0x745b();let _0x35063e=_0x745b75[_0xea4090];return _0x35063e;}import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x9ad348=0x64){return new Promise(_0xf601a2=>{const _0x55b93f=a10_0x3506;let _0x5dccb0='',_0x4154bf=![];const _0x27be76=createInterface({'input':process[_0x55b93f(0x214)],'terminal':![]}),_0x5da859=_0x3d8d8b=>{const _0x203016=_0x55b93f;if(_0x4154bf)return;_0x4154bf=!![],clearTimeout(_0x4ad807),_0x27be76[_0x203016(0x20b)](),_0xf601a2(_0x3d8d8b);},_0x4ad807=setTimeout(()=>{_0x5da859(null);},_0x9ad348);_0x27be76['on'](_0x55b93f(0x1f8),_0x3d9d07=>{_0x5dccb0+=_0x3d9d07;}),_0x27be76['on'](_0x55b93f(0x20b),()=>{const _0x28eebc=_0x55b93f;if(_0x4154bf)return;try{const _0x347e87=JSON[_0x28eebc(0x20f)](_0x5dccb0);_0x5da859(_0x347e87);}catch{_0x5da859(null);}});});}function formatCredits(_0x147f14){const _0x305fc1=a10_0x3506;return _0x147f14[_0x305fc1(0x205)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x41c7d8(0x20d)]=a10_0x41c7d8(0x1f0);[a10_0x41c7d8(0x20a)]=a10_0x41c7d8(0x201);async[a10_0x41c7d8(0x1fb)](_0x4bf0d1){const _0x5636fa=a10_0x41c7d8;try{const _0x476f0f=await readStdinJson();if(!_0x476f0f?.[_0x5636fa(0x210)])return console[_0x5636fa(0x1fc)]('💎\x20tdx\x20-\x20Claude'),0x0;const _0x3c5f7b=_0x476f0f[_0x5636fa(0x210)],_0x4ad4ea=_0x476f0f[_0x5636fa(0x207)]?.['id']||'',_0x1c530b=_0x476f0f[_0x5636fa(0x200)]||_0x4bf0d1[_0x5636fa(0x20c)][_0x5636fa(0x200)],_0x156e98=await getUsageStats(_0x3c5f7b,_0x1c530b),_0x479d71=[],_0x559c3c=readCachedAccountInfo(_0x1c530b),_0x19bdbe=_0x559c3c?_0x5636fa(0x208)+_0x559c3c[_0x5636fa(0x1f6)]+':'+_0x559c3c[_0x5636fa(0x1f2)]:_0x5636fa(0x213),_0x57a7bf=_0x4ad4ea?getModelDisplayName(_0x4ad4ea):_0x5636fa(0x204);_0x479d71[_0x5636fa(0x20e)](_0x5636fa(0x1eb)+_0x19bdbe+_0x5636fa(0x1f5)+_0x57a7bf);const _0x4cb431=formatCredits(_0x156e98[_0x5636fa(0x1f4)]),_0x52d991=formatCredits(_0x156e98[_0x5636fa(0x202)]),_0x3e4531=formatCredits(_0x156e98[_0x5636fa(0x1fe)]);_0x479d71['push'](_0x5636fa(0x1fd)+_0x4cb431+_0x5636fa(0x1ea)+_0x52d991+'\x20today\x20/\x20'+_0x3e4531+_0x5636fa(0x212));if(_0x156e98[_0x5636fa(0x1e9)]>0x0&&_0x4ad4ea){const _0x77f58a=formatTokenCount(_0x156e98[_0x5636fa(0x1e9)]),_0xed8f41=calculateContextPercentage(_0x156e98[_0x5636fa(0x1e9)],_0x4ad4ea);_0x479d71[_0x5636fa(0x20e)](_0x5636fa(0x1f9)+_0x77f58a+'\x20('+_0xed8f41+'%)');}return console[_0x5636fa(0x1fc)](_0x479d71[_0x5636fa(0x1ee)](_0x5636fa(0x1ef))),0x0;}catch{return console[_0x5636fa(0x1fc)](_0x5636fa(0x1fa)),0x0;}}}
1
+ function a10_0x5a97(){const _0x52b341=['parse','name','8209712IEzZco','Claude','9TfvYNW','accountId','24057foHqTr','24997310FSbzTv','💎\x20tdx\x20-\x20Claude','sessionCredits','2731312tktbcL','tdx','latestInputTokens','session_id','1429864TuhltB','🧠\x20','statusline','\x20-\x20','push','join','close','toFixed','monthCredits','stdin','\x20month','\x20session\x20/\x20','profile','execute','2512720CZQPLi','160pduUdm','🪙\x20credit:\x20','todayCredits','tdx\x20','169116MLJmtt','364ztNeZX','site','log','\x20|\x20'];a10_0x5a97=function(){return _0x52b341;};return a10_0x5a97();}const a10_0x4c73bd=a10_0x2fcc;function a10_0x2fcc(_0xcd3362,_0x54448a){_0xcd3362=_0xcd3362-0xb9;const _0x5a972f=a10_0x5a97();let _0x2fcc6f=_0x5a972f[_0xcd3362];return _0x2fcc6f;}(function(_0x2ac1fe,_0x25de9e){const _0x514e7c=a10_0x2fcc,_0x45f668=_0x2ac1fe();while(!![]){try{const _0x46cbc9=-parseInt(_0x514e7c(0xd0))/0x1+-parseInt(_0x514e7c(0xcc))/0x2+parseInt(_0x514e7c(0xc8))/0x3*(-parseInt(_0x514e7c(0xbe))/0x4)+-parseInt(_0x514e7c(0xb9))/0x5*(-parseInt(_0x514e7c(0xbd))/0x6)+parseInt(_0x514e7c(0xc4))/0x7+-parseInt(_0x514e7c(0xde))/0x8+-parseInt(_0x514e7c(0xc6))/0x9*(-parseInt(_0x514e7c(0xc9))/0xa);if(_0x46cbc9===_0x25de9e)break;else _0x45f668['push'](_0x45f668['shift']());}catch(_0xcc2d1d){_0x45f668['push'](_0x45f668['shift']());}}}(a10_0x5a97,0xb37b8));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x156bc1=0x64){return new Promise(_0x2e121e=>{const _0x357886=a10_0x2fcc;let _0x172220='',_0x2f4c4e=![];const _0x570759=createInterface({'input':process[_0x357886(0xd9)],'terminal':![]}),_0x354151=_0x30b814=>{if(_0x2f4c4e)return;_0x2f4c4e=!![],clearTimeout(_0x1fac88),_0x570759['close'](),_0x2e121e(_0x30b814);},_0x1fac88=setTimeout(()=>{_0x354151(null);},_0x156bc1);_0x570759['on']('line',_0x2195c5=>{_0x172220+=_0x2195c5;}),_0x570759['on'](_0x357886(0xd6),()=>{const _0x163690=_0x357886;if(_0x2f4c4e)return;try{const _0x3a1acd=JSON[_0x163690(0xc2)](_0x172220);_0x354151(_0x3a1acd);}catch{_0x354151(null);}});});}function formatCredits(_0x28f0ac){const _0x5be1e9=a10_0x2fcc;return _0x28f0ac[_0x5be1e9(0xd7)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x4c73bd(0xc3)]=a10_0x4c73bd(0xd2);['description']='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async[a10_0x4c73bd(0xdd)](_0x4d3ab0){const _0x56e393=a10_0x4c73bd;try{const _0x3f8126=await readStdinJson();if(!_0x3f8126?.[_0x56e393(0xcf)])return console[_0x56e393(0xc0)]('💎\x20tdx\x20-\x20Claude'),0x0;const _0x41d5e1=_0x3f8126['session_id'],_0x13ecfb=_0x3f8126['model']?.['id']||'',_0x657130=_0x3f8126['profile']||_0x4d3ab0['options'][_0x56e393(0xdc)],_0x16dc4a=await getUsageStats(_0x41d5e1,_0x657130),_0x34a75d=[],_0x36be64=readCachedAccountInfo(_0x657130),_0x4b866b=_0x36be64?_0x56e393(0xbc)+_0x36be64[_0x56e393(0xbf)]+':'+_0x36be64[_0x56e393(0xc7)]:_0x56e393(0xcd),_0x409ad5=_0x13ecfb?getModelDisplayName(_0x13ecfb):_0x56e393(0xc5);_0x34a75d[_0x56e393(0xd4)]('💎\x20'+_0x4b866b+_0x56e393(0xd3)+_0x409ad5);const _0x4e357e=formatCredits(_0x16dc4a[_0x56e393(0xcb)]),_0x2e9009=formatCredits(_0x16dc4a[_0x56e393(0xbb)]),_0xce9ba7=formatCredits(_0x16dc4a[_0x56e393(0xd8)]);_0x34a75d[_0x56e393(0xd4)](_0x56e393(0xba)+_0x4e357e+_0x56e393(0xdb)+_0x2e9009+'\x20today\x20/\x20'+_0xce9ba7+_0x56e393(0xda));if(_0x16dc4a['latestInputTokens']>0x0&&_0x13ecfb){const _0x1a4c8a=formatTokenCount(_0x16dc4a['latestInputTokens']),_0x492fe9=calculateContextPercentage(_0x16dc4a[_0x56e393(0xce)],_0x13ecfb);_0x34a75d['push'](_0x56e393(0xd1)+_0x1a4c8a+'\x20('+_0x492fe9+'%)');}return console[_0x56e393(0xc0)](_0x34a75d[_0x56e393(0xd5)](_0x56e393(0xc1))),0x0;}catch{return console[_0x56e393(0xc0)](_0x56e393(0xca)),0x0;}}}
@@ -1 +1 @@
1
- function a11_0x15ea(){const _0x5585cb=['credits','round','2880824FrKdde','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','toFixed','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','today\x20','Error:\x20','source','toLocaleTimeString','format','getTime','Total','\x20\x20Today:\x20\x20\x20','2-digit','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','usage','entryCount','execute','padStart','jsonl','numeric','padEnd','short','todayCredits','all','toLocaleDateString','cyan','\x20\x20Total:\x20\x20\x20','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','Requests','default','log','length','profileCount','6119944COyCNy','7XuREGA','repeat','bold','13691208qNJdCg','\x20days\x20ago','2172MjSWVW','Source','message','Last\x20Used','monthCredits','description','\x20credits','en-CA','Today','lastUsedAt','red','Credits','\x20\x20Month:\x20\x20\x20','dim','name','Usage\x20by\x20Profile','map','totalCredits','10765WLRZvY','en-US','32726169YNQtyJ','max','never','profile','(default)','597612qyMWyB','outputTable','outputStructured','yesterday','1101408QHyFlQ','json'];a11_0x15ea=function(){return _0x5585cb;};return a11_0x15ea();}const a11_0x401d60=a11_0x221c;(function(_0x107e51,_0x4eee0b){const _0x46c13b=a11_0x221c,_0x5c8021=_0x107e51();while(!![]){try{const _0x54b60b=-parseInt(_0x46c13b(0xc9))/0x1+parseInt(_0x46c13b(0xcd))/0x2+parseInt(_0x46c13b(0xc5))/0x3+parseInt(_0x46c13b(0xee))/0x4+parseInt(_0x46c13b(0x106))/0x5*(parseInt(_0x46c13b(0xf4))/0x6)+parseInt(_0x46c13b(0xef))/0x7*(parseInt(_0x46c13b(0xf2))/0x8)+-parseInt(_0x46c13b(0xc0))/0x9;if(_0x54b60b===_0x4eee0b)break;else _0x5c8021['push'](_0x5c8021['shift']());}catch(_0x2f1341){_0x5c8021['push'](_0x5c8021['shift']());}}}(a11_0x15ea,0xe1474));import a11_0x247452 from'chalk';import{BaseCommand}from'./command.js';function a11_0x221c(_0x228c75,_0x39cdb2){_0x228c75=_0x228c75-0xc0;const _0x15ea61=a11_0x15ea();let _0x221c1e=_0x15ea61[_0x228c75];return _0x221c1e;}import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x5dccb0){const _0x30f4e7=a11_0x221c;return _0x5dccb0[_0x30f4e7(0xcf)](0x2);}function formatLastUsed(_0x2ffd7f){const _0x4139d4=a11_0x221c;if(!_0x2ffd7f)return _0x4139d4(0xc2);const _0x126098=new Date(_0x2ffd7f),_0x2be51a=new Date(),_0x14a9fa=_0x126098['toLocaleDateString']('en-CA'),_0x3b4608=_0x2be51a[_0x4139d4(0xe5)](_0x4139d4(0xfb));if(_0x14a9fa===_0x3b4608)return _0x4139d4(0xd1)+_0x126098[_0x4139d4(0xd4)](_0x4139d4(0x107),{'hour':_0x4139d4(0xd9),'minute':_0x4139d4(0xd9)});const _0xdfce22=new Date(_0x14a9fa),_0x8d584e=new Date(_0x3b4608),_0x426683=Math[_0x4139d4(0xcc)]((_0x8d584e[_0x4139d4(0xd6)]()-_0xdfce22[_0x4139d4(0xd6)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x426683===0x1)return _0x4139d4(0xc8);else return _0x426683>0x1&&_0x426683<0x7?_0x426683+_0x4139d4(0xf3):_0x126098[_0x4139d4(0xe5)](_0x4139d4(0x107),{'month':_0x4139d4(0xe2),'day':_0x4139d4(0xe0)});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x401d60(0x102)]=a11_0x401d60(0xdb);[a11_0x401d60(0xf9)]=a11_0x401d60(0xce);async[a11_0x401d60(0xdd)](_0x5d4540){const _0x47768c=a11_0x401d60,{options:_0x208d36}=_0x5d4540,_0x4fdf5c=_0x208d36[_0x47768c(0xd5)]===_0x47768c(0xca)||_0x208d36['format']===_0x47768c(0xdf)||_0x208d36[_0x47768c(0xca)];try{const [_0x955be8,_0x18b403,_0x15e277]=await Promise[_0x47768c(0xe4)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x4fdf5c?await this[_0x47768c(0xc7)](_0x955be8,_0x18b403,_0x15e277,_0x208d36):this[_0x47768c(0xc6)](_0x955be8,_0x18b403,_0x15e277),0x0;}catch(_0x4763fc){const _0x5052f=_0x4763fc instanceof Error?_0x4763fc[_0x47768c(0xf6)]:'Unknown\x20error';return console['error'](a11_0x247452[_0x47768c(0xfe)](_0x47768c(0xd2)+_0x5052f)),0x1;}}async[a11_0x401d60(0xc7)](_0x153031,_0x1dd62e,_0x5dfb5e,_0x2f5e61){const _0x3127e3=a11_0x401d60,_0x113b08={'summary':{'todayCredits':_0x5dfb5e[_0x3127e3(0xe3)],'monthCredits':_0x5dfb5e[_0x3127e3(0xf8)],'totalCredits':_0x5dfb5e[_0x3127e3(0x105)],'profileCount':_0x5dfb5e[_0x3127e3(0xed)]},'profiles':_0x153031['map'](_0x38e865=>({'profile':_0x38e865['profile'],'credits':_0x38e865[_0x3127e3(0xcb)],'requests':_0x38e865[_0x3127e3(0xdc)],'lastUsedAt':_0x38e865['lastUsedAt']})),'sources':_0x1dd62e[_0x3127e3(0x104)](_0x20b298=>({'source':_0x20b298[_0x3127e3(0xd3)],'credits':_0x20b298[_0x3127e3(0xcb)],'todayCredits':_0x20b298[_0x3127e3(0xe3)],'monthCredits':_0x20b298[_0x3127e3(0xf8)],'requests':_0x20b298[_0x3127e3(0xdc)]}))};await handleSDKOutput([_0x113b08],_0x2f5e61);}[a11_0x401d60(0xc6)](_0x293187,_0x4b8806,_0x31c711){const _0x54f294=a11_0x401d60;console[_0x54f294(0xeb)](a11_0x247452[_0x54f294(0xf1)](_0x54f294(0xda))),console[_0x54f294(0xeb)](a11_0x247452[_0x54f294(0x101)]('─'[_0x54f294(0xf0)](0x32))),console[_0x54f294(0xeb)](_0x54f294(0xd8)+a11_0x247452[_0x54f294(0xe6)](formatCredits(_0x31c711['todayCredits']))+_0x54f294(0xfa)),console[_0x54f294(0xeb)](_0x54f294(0x100)+a11_0x247452[_0x54f294(0xe6)](formatCredits(_0x31c711[_0x54f294(0xf8)]))+_0x54f294(0xfa)),console[_0x54f294(0xeb)](_0x54f294(0xe7)+a11_0x247452['cyan'](formatCredits(_0x31c711['totalCredits']))+_0x54f294(0xfa)),console[_0x54f294(0xeb)]();if(_0x4b8806['length']>0x0){console[_0x54f294(0xeb)](a11_0x247452[_0x54f294(0xf1)]('Usage\x20by\x20Source')),console['log'](a11_0x247452[_0x54f294(0x101)]('─'['repeat'](0x3c)));const _0x56dde0=0xc,_0x14a7dc=0xa,_0x4079f3=0xa,_0x586e46=0xa;console[_0x54f294(0xeb)]('\x20\x20'+_0x54f294(0xf5)[_0x54f294(0xe1)](_0x56dde0)+'\x20\x20'+_0x54f294(0xd7)[_0x54f294(0xde)](_0x14a7dc)+'\x20\x20'+_0x54f294(0xfc)[_0x54f294(0xde)](_0x4079f3)+'\x20\x20'+'Month'['padStart'](_0x586e46));for(const _0x58930f of _0x4b8806){console['log']('\x20\x20'+_0x58930f[_0x54f294(0xd3)][_0x54f294(0xe1)](_0x56dde0)+'\x20\x20'+a11_0x247452[_0x54f294(0xe6)](formatCredits(_0x58930f['credits'])[_0x54f294(0xde)](_0x14a7dc))+'\x20\x20'+formatCredits(_0x58930f[_0x54f294(0xe3)])[_0x54f294(0xde)](_0x4079f3)+'\x20\x20'+formatCredits(_0x58930f[_0x54f294(0xf8)])[_0x54f294(0xde)](_0x586e46));}console[_0x54f294(0xeb)]();}if(_0x293187[_0x54f294(0xec)]===0x0){console['log'](a11_0x247452['dim'](_0x54f294(0xd0))),console[_0x54f294(0xeb)](a11_0x247452['dim'](_0x54f294(0xe8)));return;}console[_0x54f294(0xeb)](a11_0x247452['bold'](_0x54f294(0x103))),console['log'](a11_0x247452[_0x54f294(0x101)]('─'[_0x54f294(0xf0)](0x3c)));const _0x13b0f4=Math[_0x54f294(0xc1)](0xc,..._0x293187['map'](_0x191e01=>_0x191e01[_0x54f294(0xc3)]===_0x54f294(0xea)?_0x54f294(0xc4)[_0x54f294(0xec)]:_0x191e01['profile']['length'])),_0x166a76=0xa,_0x55966b=0xa;console[_0x54f294(0xeb)]('\x20\x20'+'Profile'['padEnd'](_0x13b0f4)+'\x20\x20'+_0x54f294(0xff)[_0x54f294(0xde)](_0x166a76)+'\x20\x20'+_0x54f294(0xe9)['padStart'](_0x55966b)+'\x20\x20'+_0x54f294(0xf7));for(const _0x56d2fe of _0x293187){const _0x112c5c=_0x56d2fe[_0x54f294(0xc3)]===_0x54f294(0xea)?_0x54f294(0xc4):_0x56d2fe['profile'],_0x3977cb=_0x112c5c['padEnd'](_0x13b0f4),_0x5d21a3=_0x56d2fe[_0x54f294(0xc3)]===_0x54f294(0xea)?a11_0x247452[_0x54f294(0x101)](_0x3977cb):_0x3977cb;console[_0x54f294(0xeb)]('\x20\x20'+_0x5d21a3+'\x20\x20'+a11_0x247452['cyan'](formatCredits(_0x56d2fe[_0x54f294(0xcb)])[_0x54f294(0xde)](_0x166a76))+'\x20\x20'+String(_0x56d2fe[_0x54f294(0xdc)])['padStart'](_0x55966b)+'\x20\x20'+a11_0x247452[_0x54f294(0x101)](formatLastUsed(_0x56d2fe[_0x54f294(0xfd)])));}console[_0x54f294(0xeb)](),console[_0x54f294(0xeb)](a11_0x247452[_0x54f294(0x101)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console['log']();}}
1
+ function a11_0x3d0d(_0x4beedd,_0x5e7fa1){_0x4beedd=_0x4beedd-0xe5;const _0x4beb15=a11_0x4beb();let _0x3d0d63=_0x4beb15[_0x4beedd];return _0x3d0d63;}function a11_0x4beb(){const _0x1691de=['\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','81910xuohsK','bold','credits','max','profile','Requests','480387UtJyvU','1471215CdeuUR','3642800bRJHFI','usage','Source','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','format','toLocaleTimeString','en-CA','jsonl','lastUsedAt','toLocaleDateString','source','1419wcGuqn','description','Today','monthCredits','log','Usage\x20by\x20Profile','default','(default)','profileCount','error','repeat','\x20\x20Today:\x20\x20\x20','map','\x20days\x20ago','733054MCuWsW','length','padStart','execute','outputStructured','8baVstw','24TvwfsZ','all','Unknown\x20error','today\x20','outputTable','\x20\x20Month:\x20\x20\x20','5555025ejoBRl','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','Month','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','todayCredits','cyan','\x20credits','en-US','2-digit','yesterday','totalCredits','padEnd','entryCount','Credits','short','712652rbMntH','dim','\x20\x20Total:\x20\x20\x20','2cLpjoI','getTime'];a11_0x4beb=function(){return _0x1691de;};return a11_0x4beb();}const a11_0x4bc53b=a11_0x3d0d;(function(_0xbf47b6,_0x24cba5){const _0x5591c1=a11_0x3d0d,_0x142cab=_0xbf47b6();while(!![]){try{const _0x34ff44=-parseInt(_0x5591c1(0xf5))/0x1*(parseInt(_0x5591c1(0xf2))/0x2)+-parseInt(_0x5591c1(0xfe))/0x3+parseInt(_0x5591c1(0x100))/0x4+-parseInt(_0x5591c1(0xff))/0x5+parseInt(_0x5591c1(0x11f))/0x6*(parseInt(_0x5591c1(0x119))/0x7)+-parseInt(_0x5591c1(0x11e))/0x8*(parseInt(_0x5591c1(0x125))/0x9)+parseInt(_0x5591c1(0xf8))/0xa*(parseInt(_0x5591c1(0x10b))/0xb);if(_0x34ff44===_0x24cba5)break;else _0x142cab['push'](_0x142cab['shift']());}catch(_0x1ab32f){_0x142cab['push'](_0x142cab['shift']());}}}(a11_0x4beb,0x92f7a));import a11_0x1cbfdc from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x1214ab){return _0x1214ab['toFixed'](0x2);}function formatLastUsed(_0x27a354){const _0xc7a184=a11_0x3d0d;if(!_0x27a354)return'never';const _0x1124cb=new Date(_0x27a354),_0x38521a=new Date(),_0x4755cf=_0x1124cb[_0xc7a184(0x109)](_0xc7a184(0x106)),_0x4ece5c=_0x38521a[_0xc7a184(0x109)](_0xc7a184(0x106));if(_0x4755cf===_0x4ece5c)return _0xc7a184(0x122)+_0x1124cb[_0xc7a184(0x105)](_0xc7a184(0xea),{'hour':_0xc7a184(0xeb),'minute':_0xc7a184(0xeb)});const _0x59aaa7=new Date(_0x4755cf),_0x5c93de=new Date(_0x4ece5c),_0x5027b2=Math['round']((_0x5c93de[_0xc7a184(0xf6)]()-_0x59aaa7[_0xc7a184(0xf6)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5027b2===0x1)return _0xc7a184(0xec);else return _0x5027b2>0x1&&_0x5027b2<0x7?_0x5027b2+_0xc7a184(0x118):_0x1124cb[_0xc7a184(0x109)](_0xc7a184(0xea),{'month':_0xc7a184(0xf1),'day':'numeric'});}export class ClaudeUsageCommand extends BaseCommand{['name']=a11_0x4bc53b(0x101);[a11_0x4bc53b(0x10c)]=a11_0x4bc53b(0x126);async[a11_0x4bc53b(0x11c)](_0x105cbf){const _0x1b0a4d=a11_0x4bc53b,{options:_0x80cb68}=_0x105cbf,_0x37f2fa=_0x80cb68['format']==='json'||_0x80cb68[_0x1b0a4d(0x104)]===_0x1b0a4d(0x107)||_0x80cb68['json'];try{const [_0x3d1466,_0x161f09,_0x53af62]=await Promise[_0x1b0a4d(0x120)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x37f2fa?await this['outputStructured'](_0x3d1466,_0x161f09,_0x53af62,_0x80cb68):this[_0x1b0a4d(0x123)](_0x3d1466,_0x161f09,_0x53af62),0x0;}catch(_0x1f90a1){const _0x188651=_0x1f90a1 instanceof Error?_0x1f90a1['message']:_0x1b0a4d(0x121);return console[_0x1b0a4d(0x114)](a11_0x1cbfdc['red']('Error:\x20'+_0x188651)),0x1;}}async[a11_0x4bc53b(0x11d)](_0x23e9ea,_0x4b42a0,_0x2f308d,_0xa486e6){const _0x2feaf8=a11_0x4bc53b,_0x553e43={'summary':{'todayCredits':_0x2f308d[_0x2feaf8(0xe7)],'monthCredits':_0x2f308d[_0x2feaf8(0x10e)],'totalCredits':_0x2f308d['totalCredits'],'profileCount':_0x2f308d[_0x2feaf8(0x113)]},'profiles':_0x23e9ea['map'](_0x20d0b7=>({'profile':_0x20d0b7[_0x2feaf8(0xfc)],'credits':_0x20d0b7[_0x2feaf8(0xfa)],'requests':_0x20d0b7['entryCount'],'lastUsedAt':_0x20d0b7[_0x2feaf8(0x108)]})),'sources':_0x4b42a0[_0x2feaf8(0x117)](_0x11c5b5=>({'source':_0x11c5b5[_0x2feaf8(0x10a)],'credits':_0x11c5b5[_0x2feaf8(0xfa)],'todayCredits':_0x11c5b5[_0x2feaf8(0xe7)],'monthCredits':_0x11c5b5[_0x2feaf8(0x10e)],'requests':_0x11c5b5[_0x2feaf8(0xef)]}))};await handleSDKOutput([_0x553e43],_0xa486e6);}[a11_0x4bc53b(0x123)](_0x295317,_0x46a591,_0x7bd9b5){const _0x54b751=a11_0x4bc53b;console[_0x54b751(0x10f)](a11_0x1cbfdc[_0x54b751(0xf9)](_0x54b751(0xf7))),console['log'](a11_0x1cbfdc[_0x54b751(0xf3)]('─'['repeat'](0x32))),console['log'](_0x54b751(0x116)+a11_0x1cbfdc['cyan'](formatCredits(_0x7bd9b5[_0x54b751(0xe7)]))+_0x54b751(0xe9)),console['log'](_0x54b751(0x124)+a11_0x1cbfdc[_0x54b751(0xe8)](formatCredits(_0x7bd9b5[_0x54b751(0x10e)]))+'\x20credits'),console[_0x54b751(0x10f)](_0x54b751(0xf4)+a11_0x1cbfdc[_0x54b751(0xe8)](formatCredits(_0x7bd9b5[_0x54b751(0xed)]))+_0x54b751(0xe9)),console[_0x54b751(0x10f)]();if(_0x46a591[_0x54b751(0x11a)]>0x0){console[_0x54b751(0x10f)](a11_0x1cbfdc[_0x54b751(0xf9)]('Usage\x20by\x20Source')),console[_0x54b751(0x10f)](a11_0x1cbfdc['dim']('─'['repeat'](0x3c)));const _0x2c99be=0xc,_0x5aecf4=0xa,_0x20a754=0xa,_0x10e116=0xa;console['log']('\x20\x20'+_0x54b751(0x102)[_0x54b751(0xee)](_0x2c99be)+'\x20\x20'+'Total'['padStart'](_0x5aecf4)+'\x20\x20'+_0x54b751(0x10d)[_0x54b751(0x11b)](_0x20a754)+'\x20\x20'+_0x54b751(0xe5)[_0x54b751(0x11b)](_0x10e116));for(const _0xec152f of _0x46a591){console['log']('\x20\x20'+_0xec152f['source'][_0x54b751(0xee)](_0x2c99be)+'\x20\x20'+a11_0x1cbfdc[_0x54b751(0xe8)](formatCredits(_0xec152f['credits'])[_0x54b751(0x11b)](_0x5aecf4))+'\x20\x20'+formatCredits(_0xec152f[_0x54b751(0xe7)])[_0x54b751(0x11b)](_0x20a754)+'\x20\x20'+formatCredits(_0xec152f[_0x54b751(0x10e)])[_0x54b751(0x11b)](_0x10e116));}console[_0x54b751(0x10f)]();}if(_0x295317['length']===0x0){console[_0x54b751(0x10f)](a11_0x1cbfdc[_0x54b751(0xf3)]('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console[_0x54b751(0x10f)](a11_0x1cbfdc[_0x54b751(0xf3)](_0x54b751(0x103)));return;}console[_0x54b751(0x10f)](a11_0x1cbfdc[_0x54b751(0xf9)](_0x54b751(0x110))),console['log'](a11_0x1cbfdc[_0x54b751(0xf3)]('─'[_0x54b751(0x115)](0x3c)));const _0x2b51e0=Math[_0x54b751(0xfb)](0xc,..._0x295317[_0x54b751(0x117)](_0x44acda=>_0x44acda[_0x54b751(0xfc)]==='default'?_0x54b751(0x112)['length']:_0x44acda[_0x54b751(0xfc)][_0x54b751(0x11a)])),_0x14e59b=0xa,_0x218515=0xa;console[_0x54b751(0x10f)]('\x20\x20'+'Profile'[_0x54b751(0xee)](_0x2b51e0)+'\x20\x20'+_0x54b751(0xf0)[_0x54b751(0x11b)](_0x14e59b)+'\x20\x20'+_0x54b751(0xfd)[_0x54b751(0x11b)](_0x218515)+'\x20\x20'+'Last\x20Used');for(const _0x4c70b6 of _0x295317){const _0x31fa3d=_0x4c70b6[_0x54b751(0xfc)]===_0x54b751(0x111)?_0x54b751(0x112):_0x4c70b6[_0x54b751(0xfc)],_0x59a472=_0x31fa3d['padEnd'](_0x2b51e0),_0x461adc=_0x4c70b6[_0x54b751(0xfc)]===_0x54b751(0x111)?a11_0x1cbfdc['dim'](_0x59a472):_0x59a472;console[_0x54b751(0x10f)]('\x20\x20'+_0x461adc+'\x20\x20'+a11_0x1cbfdc[_0x54b751(0xe8)](formatCredits(_0x4c70b6[_0x54b751(0xfa)])[_0x54b751(0x11b)](_0x14e59b))+'\x20\x20'+String(_0x4c70b6[_0x54b751(0xef)])[_0x54b751(0x11b)](_0x218515)+'\x20\x20'+a11_0x1cbfdc[_0x54b751(0xf3)](formatLastUsed(_0x4c70b6[_0x54b751(0x108)])));}console[_0x54b751(0x10f)](),console[_0x54b751(0x10f)](a11_0x1cbfdc[_0x54b751(0xf3)](_0x54b751(0xe6))),console['log']();}}
@@ -1 +1 @@
1
- const a12_0x4b8e03=a12_0x2477;(function(_0x21981b,_0x11c7ab){const _0xd224e5=a12_0x2477,_0x1f76d8=_0x21981b();while(!![]){try{const _0x53d556=parseInt(_0xd224e5(0x1ba))/0x1+-parseInt(_0xd224e5(0x19f))/0x2*(-parseInt(_0xd224e5(0x1c0))/0x3)+parseInt(_0xd224e5(0x1b3))/0x4+parseInt(_0xd224e5(0x1aa))/0x5*(-parseInt(_0xd224e5(0x1b2))/0x6)+-parseInt(_0xd224e5(0x194))/0x7+-parseInt(_0xd224e5(0x1a2))/0x8*(parseInt(_0xd224e5(0x1bd))/0x9)+parseInt(_0xd224e5(0x19d))/0xa*(parseInt(_0xd224e5(0x199))/0xb);if(_0x53d556===_0x11c7ab)break;else _0x1f76d8['push'](_0x1f76d8['shift']());}catch(_0x5afa67){_0x1f76d8['push'](_0x1f76d8['shift']());}}}(a12_0xe1a1,0x4df76));function a12_0x2477(_0x49dede,_0xd36f4e){_0x49dede=_0x49dede-0x193;const _0xe1a128=a12_0xe1a1();let _0x247761=_0xe1a128[_0x49dede];return _0x247761;}import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a12_0x467e96 from'chalk';function a12_0xe1a1(){const _0x2ccb32=['message','problemDetails','cyan','Reason:\x20','tdx\x20auth\x20setup','2434971qKOtiw','values','\x0aStack\x20trace:\x0a','run','Authentication\x20failed','11TQgzHv','Error:\x20','commands','getAll','7985470zxegKa','Command\x20\x27','484sHSqQQ','error','tdx\x20auth','8Hnfpqx','has','\x27\x20is\x20already\x20registered','stack','command','name','set','value','1771785JdYqUW','profile','isValid','limit','\x20--profile\x20','debug','USER_ERROR','options','6pdbMyf','445684GfHnPV','from','validate','yellow','helpText','status','number','3631tQzANf','red','dim','136953UlkOLe','get','To\x20check\x20your\x20current\x20auth\x20status:','1527cSSPBL','validateGlobalOptions','execute','To\x20set\x20up\x20authentication:'];a12_0xe1a1=function(){return _0x2ccb32;};return a12_0xe1a1();}export function printAuthError(_0xb11445,_0x2b563c=![],_0x24ceed){const _0x1eff30=a12_0x2477,_0x508778=_0xb11445[_0x1eff30(0x1c5)]?.['detail']||_0xb11445['message'];console[_0x1eff30(0x1a0)](a12_0x467e96['red'](_0x1eff30(0x198))),console[_0x1eff30(0x1a0)](a12_0x467e96[_0x1eff30(0x1bb)](_0x1eff30(0x1c7)+_0x508778));if(_0x2b563c){const _0x2c63ea=_0x24ceed?_0x1eff30(0x1ae)+_0x24ceed:'';console['error']('\x0a'+a12_0x467e96[_0x1eff30(0x1bc)](_0x1eff30(0x1c3))),console['error']('\x20\x20'+a12_0x467e96[_0x1eff30(0x1c6)](_0x1eff30(0x193)+_0x2c63ea)+'\x0a'),console[_0x1eff30(0x1a0)](''+a12_0x467e96[_0x1eff30(0x1bc)](_0x1eff30(0x1bf))),console[_0x1eff30(0x1a0)]('\x20\x20'+a12_0x467e96[_0x1eff30(0x1c6)](_0x1eff30(0x1a1)+_0x2c63ea));}}export class BaseCommand{[a12_0x4b8e03(0x1c1)](_0x2d2d78){const _0x5543a2=a12_0x4b8e03,{options:_0x3d6bef}=_0x2d2d78,_0x2490f2=_0x3d6bef[_0x5543a2(0x1ad)];if(_0x2490f2!==undefined){const _0x1e45e2=typeof _0x2490f2===_0x5543a2(0x1b9)?_0x2490f2:parseInt(_0x2490f2,0xa);if(isNaN(_0x1e45e2))return'Invalid\x20limit\x20value:\x20'+_0x2490f2+'.\x20Must\x20be\x20a\x20number.';const _0x3c1e86=validateLimitOption(_0x1e45e2);if(!_0x3c1e86[_0x5543a2(0x1ac)])return _0x3c1e86[_0x5543a2(0x1a0)];_0x2d2d78[_0x5543a2(0x1b1)][_0x5543a2(0x1ad)]=_0x3c1e86[_0x5543a2(0x1a9)];}return undefined;}[a12_0x4b8e03(0x1b5)](_0x5d9777){return undefined;}async[a12_0x4b8e03(0x197)](_0x904e29){const _0x30bf8c=a12_0x4b8e03;try{const _0x127653=this[_0x30bf8c(0x1c1)](_0x904e29);if(_0x127653)return console[_0x30bf8c(0x1a0)](_0x30bf8c(0x19a)+_0x127653),0x1;const _0x478fe7=this['validate'](_0x904e29);if(_0x478fe7){const _0x319f25=/^\s*(Usage|Note|Warning|Error):/i['test'](_0x478fe7);return _0x319f25?console[_0x30bf8c(0x1a0)](_0x478fe7):console[_0x30bf8c(0x1a0)](_0x30bf8c(0x19a)+_0x478fe7),0x1;}const _0x49ef15=await this[_0x30bf8c(0x1c2)](_0x904e29);return _0x49ef15??0x0;}catch(_0x5a1063){if(_0x5a1063 instanceof Error){if(_0x5a1063 instanceof HTTPClientError&&_0x5a1063[_0x30bf8c(0x1b8)]===0x191){const _0x3eaa83=_0x904e29[_0x30bf8c(0x1b1)][_0x30bf8c(0x1ab)];printAuthError(_0x5a1063,!![],_0x3eaa83);if(_0x5a1063[_0x30bf8c(0x1a5)]){const _0x4fc84e=Logger['of'](_0x30bf8c(0x1a6));_0x4fc84e[_0x30bf8c(0x1af)]('Authentication\x20error\x20stack\x20trace:'),_0x4fc84e[_0x30bf8c(0x1af)](_0x5a1063[_0x30bf8c(0x1a5)]);}return 0x1;}console[_0x30bf8c(0x1a0)](a12_0x467e96[_0x30bf8c(0x1bb)](_0x30bf8c(0x19a)+_0x5a1063[_0x30bf8c(0x1c4)]));_0x5a1063 instanceof SDKError&&_0x5a1063[_0x30bf8c(0x1b7)]&&console[_0x30bf8c(0x1a0)](a12_0x467e96[_0x30bf8c(0x1b6)](_0x5a1063[_0x30bf8c(0x1b7)]));const _0x112116=_0x5a1063 instanceof SDKError&&_0x5a1063['category']===ErrorCategory[_0x30bf8c(0x1b0)];_0x5a1063['stack']&&!_0x112116&&console['error'](_0x30bf8c(0x196)+_0x5a1063[_0x30bf8c(0x1a5)]);}else console[_0x30bf8c(0x1a0)](_0x30bf8c(0x19a)+String(_0x5a1063));return 0x1;}}}export class CommandRegistry{[a12_0x4b8e03(0x19b)]=new Map();['register'](_0x503022){const _0x21c9a7=a12_0x4b8e03;if(this[_0x21c9a7(0x19b)][_0x21c9a7(0x1a3)](_0x503022[_0x21c9a7(0x1a7)]))throw new Error(_0x21c9a7(0x19e)+_0x503022[_0x21c9a7(0x1a7)]+_0x21c9a7(0x1a4));this[_0x21c9a7(0x19b)][_0x21c9a7(0x1a8)](_0x503022['name'],_0x503022);}[a12_0x4b8e03(0x1be)](_0x472634){return this['commands']['get'](_0x472634);}[a12_0x4b8e03(0x19c)](){const _0x47724c=a12_0x4b8e03;return Array[_0x47724c(0x1b4)](this[_0x47724c(0x19b)][_0x47724c(0x195)]());}[a12_0x4b8e03(0x1a3)](_0x216f6a){const _0xe3388f=a12_0x4b8e03;return this['commands'][_0xe3388f(0x1a3)](_0x216f6a);}}export const registry=new CommandRegistry();
1
+ const a12_0x342d75=a12_0x2a8e;(function(_0x2ad19,_0x9d9ab4){const _0x21ac38=a12_0x2a8e,_0x4c6dcb=_0x2ad19();while(!![]){try{const _0x44826a=parseInt(_0x21ac38(0x1c5))/0x1+parseInt(_0x21ac38(0x1cd))/0x2+-parseInt(_0x21ac38(0x1be))/0x3*(parseInt(_0x21ac38(0x1b8))/0x4)+parseInt(_0x21ac38(0x1aa))/0x5*(-parseInt(_0x21ac38(0x1d1))/0x6)+-parseInt(_0x21ac38(0x1bd))/0x7+-parseInt(_0x21ac38(0x1a5))/0x8*(parseInt(_0x21ac38(0x1a9))/0x9)+parseInt(_0x21ac38(0x1c4))/0xa*(parseInt(_0x21ac38(0x1b6))/0xb);if(_0x44826a===_0x9d9ab4)break;else _0x4c6dcb['push'](_0x4c6dcb['shift']());}catch(_0x1e3516){_0x4c6dcb['push'](_0x4c6dcb['shift']());}}}(a12_0x3db4,0x68b16));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a12_0x2fe33e from'chalk';function a12_0x2a8e(_0x17cb39,_0x24bcf6){_0x17cb39=_0x17cb39-0x1a4;const _0x3db4ff=a12_0x3db4();let _0x2a8e5d=_0x3db4ff[_0x17cb39];return _0x2a8e5d;}function a12_0x3db4(){const _0x5b52b6=['from','tdx\x20auth\x20setup','register','run','profile','32lwMBnQ','Invalid\x20limit\x20value:\x20','options','category','815436sNOibU','550RFnDkj','commands','helpText','\x27\x20is\x20already\x20registered','yellow','To\x20set\x20up\x20authentication:','value','Error:\x20','error','validate','stack','USER_ERROR','11EBivsa','status','2691188WarkeS','limit','problemDetails','name','get','2533251NJtAuI','3XvkPMe','\x0aStack\x20trace:\x0a','Reason:\x20','cyan','.\x20Must\x20be\x20a\x20number.','dim','9323000mxOzec','187116NefckK','debug','red','Authentication\x20error\x20stack\x20trace:','\x20--profile\x20','message','test','has','1590124nnbVeR','number','command','execute','4830DRVIpY'];a12_0x3db4=function(){return _0x5b52b6;};return a12_0x3db4();}export function printAuthError(_0x164145,_0x4b89c5=![],_0x5b33d1){const _0x2819b1=a12_0x2a8e,_0x1997f4=_0x164145[_0x2819b1(0x1ba)]?.['detail']||_0x164145['message'];console[_0x2819b1(0x1b2)](a12_0x2fe33e[_0x2819b1(0x1c7)]('Authentication\x20failed')),console[_0x2819b1(0x1b2)](a12_0x2fe33e[_0x2819b1(0x1c7)](_0x2819b1(0x1c0)+_0x1997f4));if(_0x4b89c5){const _0x536cd8=_0x5b33d1?_0x2819b1(0x1c9)+_0x5b33d1:'';console['error']('\x0a'+a12_0x2fe33e[_0x2819b1(0x1c3)](_0x2819b1(0x1af))),console['error']('\x20\x20'+a12_0x2fe33e[_0x2819b1(0x1c1)](_0x2819b1(0x1d3)+_0x536cd8)+'\x0a'),console[_0x2819b1(0x1b2)](''+a12_0x2fe33e[_0x2819b1(0x1c3)]('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x2819b1(0x1b2)]('\x20\x20'+a12_0x2fe33e['cyan']('tdx\x20auth'+_0x536cd8));}}export class BaseCommand{['validateGlobalOptions'](_0x1fddd9){const _0x48b860=a12_0x2a8e,{options:_0x4b007e}=_0x1fddd9,_0x3eb45c=_0x4b007e[_0x48b860(0x1b9)];if(_0x3eb45c!==undefined){const _0x6c2886=typeof _0x3eb45c===_0x48b860(0x1ce)?_0x3eb45c:parseInt(_0x3eb45c,0xa);if(isNaN(_0x6c2886))return _0x48b860(0x1a6)+_0x3eb45c+_0x48b860(0x1c2);const _0x5de034=validateLimitOption(_0x6c2886);if(!_0x5de034['isValid'])return _0x5de034[_0x48b860(0x1b2)];_0x1fddd9[_0x48b860(0x1a7)]['limit']=_0x5de034[_0x48b860(0x1b0)];}return undefined;}[a12_0x342d75(0x1b3)](_0x2d9f3f){return undefined;}async[a12_0x342d75(0x1d5)](_0x471fa3){const _0x465690=a12_0x342d75;try{const _0x47dea6=this['validateGlobalOptions'](_0x471fa3);if(_0x47dea6)return console[_0x465690(0x1b2)](_0x465690(0x1b1)+_0x47dea6),0x1;const _0x67f63e=this[_0x465690(0x1b3)](_0x471fa3);if(_0x67f63e){const _0x13ce3c=/^\s*(Usage|Note|Warning|Error):/i[_0x465690(0x1cb)](_0x67f63e);return _0x13ce3c?console[_0x465690(0x1b2)](_0x67f63e):console[_0x465690(0x1b2)]('Error:\x20'+_0x67f63e),0x1;}const _0x540f6f=await this[_0x465690(0x1d0)](_0x471fa3);return _0x540f6f??0x0;}catch(_0x1cd82b){if(_0x1cd82b instanceof Error){if(_0x1cd82b instanceof HTTPClientError&&_0x1cd82b[_0x465690(0x1b7)]===0x191){const _0xa3310c=_0x471fa3['options'][_0x465690(0x1a4)];printAuthError(_0x1cd82b,!![],_0xa3310c);if(_0x1cd82b[_0x465690(0x1b4)]){const _0x152f25=Logger['of'](_0x465690(0x1cf));_0x152f25[_0x465690(0x1c6)](_0x465690(0x1c8)),_0x152f25[_0x465690(0x1c6)](_0x1cd82b['stack']);}return 0x1;}console[_0x465690(0x1b2)](a12_0x2fe33e[_0x465690(0x1c7)](_0x465690(0x1b1)+_0x1cd82b[_0x465690(0x1ca)]));_0x1cd82b instanceof SDKError&&_0x1cd82b[_0x465690(0x1ac)]&&console[_0x465690(0x1b2)](a12_0x2fe33e[_0x465690(0x1ae)](_0x1cd82b['helpText']));const _0x4f3b34=_0x1cd82b instanceof SDKError&&_0x1cd82b[_0x465690(0x1a8)]===ErrorCategory[_0x465690(0x1b5)];_0x1cd82b[_0x465690(0x1b4)]&&!_0x4f3b34&&console[_0x465690(0x1b2)](_0x465690(0x1bf)+_0x1cd82b[_0x465690(0x1b4)]);}else console[_0x465690(0x1b2)](_0x465690(0x1b1)+String(_0x1cd82b));return 0x1;}}}export class CommandRegistry{[a12_0x342d75(0x1ab)]=new Map();[a12_0x342d75(0x1d4)](_0x219397){const _0x1b9735=a12_0x342d75;if(this[_0x1b9735(0x1ab)][_0x1b9735(0x1cc)](_0x219397['name']))throw new Error('Command\x20\x27'+_0x219397[_0x1b9735(0x1bb)]+_0x1b9735(0x1ad));this[_0x1b9735(0x1ab)]['set'](_0x219397['name'],_0x219397);}['get'](_0x4638b){const _0x1562c1=a12_0x342d75;return this[_0x1562c1(0x1ab)][_0x1562c1(0x1bc)](_0x4638b);}['getAll'](){const _0x599201=a12_0x342d75;return Array[_0x599201(0x1d2)](this[_0x599201(0x1ab)]['values']());}[a12_0x342d75(0x1cc)](_0x368e5e){const _0x12ec16=a12_0x342d75;return this['commands'][_0x12ec16(0x1cc)](_0x368e5e);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a13_0x5af8de=a13_0x43e1;(function(_0x3c8965,_0x2bf7ad){const _0x39b41b=a13_0x43e1,_0x4c0abe=_0x3c8965();while(!![]){try{const _0x4f5654=parseInt(_0x39b41b(0x144))/0x1+parseInt(_0x39b41b(0x125))/0x2+-parseInt(_0x39b41b(0x100))/0x3*(parseInt(_0x39b41b(0x13e))/0x4)+parseInt(_0x39b41b(0x103))/0x5*(-parseInt(_0x39b41b(0x107))/0x6)+parseInt(_0x39b41b(0x120))/0x7+-parseInt(_0x39b41b(0xe4))/0x8+-parseInt(_0x39b41b(0x115))/0x9*(-parseInt(_0x39b41b(0x10d))/0xa);if(_0x4f5654===_0x2bf7ad)break;else _0x4c0abe['push'](_0x4c0abe['shift']());}catch(_0x369d6a){_0x4c0abe['push'](_0x4c0abe['shift']());}}}(a13_0x43d3,0x5cf4b));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_0x41449f from'chalk';function normalizeSchemaForDisplay(_0x4bfa64){const _0x29cbac=a13_0x43e1,_0x93bef5=_0x4bfa64[_0x29cbac(0xee)]||[],_0x5635c0=_0x93bef5[_0x29cbac(0x145)](_0x4296a3=>_0x4296a3[_0x29cbac(0xec)]==='legacy_settings'&&_0x4296a3[_0x29cbac(0x102)]===_0x29cbac(0x132)&&_0x4296a3[_0x29cbac(0xee)]);if(_0x5635c0?.[_0x29cbac(0xee)]){const _0x4560af=_0x93bef5[_0x29cbac(0xdc)](_0x380042=>_0x380042[_0x29cbac(0xec)]!==_0x29cbac(0x113)&&_0x380042[_0x29cbac(0xec)]!==_0x29cbac(0x143));return[..._0x4560af,..._0x5635c0[_0x29cbac(0xee)]];}return _0x93bef5[_0x29cbac(0xdc)](_0x63d03e=>_0x63d03e[_0x29cbac(0xec)]!==_0x29cbac(0x113));}function a13_0x43d3(){const _0x4c8a5d=['572171DhwrSM','find','✔\x20Found\x20connection:\x20','repeat','\x0aCredential\x20settings:','label','filter','input','resolve','Show\x20connection\x20details','credential','\x20\x20\x20\x20','\x20[record]','value','3410416lseczh','connection:list','enumeration','Default:\x20','Name:\x20','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','bold','Fetching\x20schema\x20for\x20\x27','name','Site:\x20','properties','map','connection:types','options','Show\x20when:\x20','List\x20all\x20result\x20output\x20connections','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.','green','sort','stringify','limit','maximum','minimum','entries','Fetching\x20settings\x20for\x20\x27','✔\x20Found\x20','execute','connection:show','17328ItOsPr','\x27\x20(type:\x20','type','45jZxRwi','findByName','yellow','hidden','261726rfzQSM','\x20\x20\x20\x20Options:\x20','dim','list','Fetching\x20settings\x20for\x20connector\x20type:\x20','default_value','751940HzkFGO','push','Resolving\x20connector\x20type\x20or\x20name:\x20','site','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','output','legacy','cyan','9WbYURD','title','\x0aConnector:\x20','table','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','getOutputSchema','owner','Listing\x20connections...','>=\x20','\x20-\x20','length','4100404WrHTgr','Listing\x20connector\x20types...','Type:\x20','max','description','1053546NJCdVf','hint','validate','verbose','connection:settings','blue','\x20connection','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','\x0aNo\x20fields\x20defined\x20in\x20schema','No\x20available\x20fields\x20for\x20this\x20connector','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.','data','record','Range:\x20','connection','log','Options:\x20','\x0aAvailable\x20fields:','slice','join','Fetching\x20connection\x20\x27','error','criteria','\x20\x20\x20\x20Default:\x20','388NfsmOV','padStart','\x27...','Treating\x20\x27','getMetadata','legacy_settings'];a13_0x43d3=function(){return _0x4c8a5d;};return a13_0x43d3();}function printSchemaFields(_0x1cc64e,_0xae7b87){const _0x165890=a13_0x43e1,_0x350379='\x20\x20'[_0x165890(0xd9)](_0xae7b87+0x1),_0x579a9a='\x20\x20'[_0x165890(0xd9)](_0xae7b87+0x2);for(const _0x32fe26 of _0x1cc64e){if(!_0x32fe26['name'])continue;const _0x1be9a9=_0x32fe26[_0x165890(0x102)]===_0x165890(0x132)&&_0x32fe26[_0x165890(0xee)]&&_0x32fe26[_0x165890(0xee)][_0x165890(0x11f)]>0x0&&_0x32fe26[_0x165890(0xec)]!==_0x165890(0x143);let _0x2516bd=''+_0x350379+a13_0x41449f[_0x165890(0xf5)](_0x32fe26[_0x165890(0xec)]);_0x32fe26[_0x165890(0x116)]&&(_0x2516bd+=':\x20'+_0x32fe26[_0x165890(0x116)]);if(_0x32fe26[_0x165890(0xdd)])_0x2516bd+=a13_0x41449f[_0x165890(0x109)]('\x20['+_0x32fe26[_0x165890(0xdd)]+']');else _0x1be9a9&&(_0x2516bd+=a13_0x41449f['dim'](_0x165890(0xe2)));console[_0x165890(0x135)](_0x2516bd);_0x32fe26[_0x165890(0x124)]&&console[_0x165890(0x135)](''+_0x579a9a+a13_0x41449f[_0x165890(0x109)](_0x32fe26[_0x165890(0x124)]));if(_0x32fe26['enumeration']){const _0x478d52=_0x32fe26[_0x165890(0xe6)][_0x165890(0xef)](_0xfa7db7=>typeof _0xfa7db7==='object'&&_0x165890(0xe3)in _0xfa7db7?_0xfa7db7[_0x165890(0xe3)]:_0xfa7db7)[_0x165890(0x139)](',\x20');console[_0x165890(0x135)](_0x579a9a+_0x165890(0x136)+a13_0x41449f[_0x165890(0x105)](_0x478d52));}_0x32fe26[_0x165890(0x10c)]!==undefined&&console[_0x165890(0x135)](_0x579a9a+_0x165890(0xe7)+a13_0x41449f[_0x165890(0x12a)](String(_0x32fe26['default_value'])));if(_0x32fe26['minimum']!==undefined||_0x32fe26[_0x165890(0xf9)]!==undefined){const _0x1149c6=_0x32fe26[_0x165890(0xfa)]!==undefined&&_0x32fe26[_0x165890(0xf9)]!==undefined?_0x32fe26[_0x165890(0xfa)]+_0x165890(0x11e)+_0x32fe26[_0x165890(0xf9)]:_0x32fe26[_0x165890(0xfa)]!==undefined?_0x165890(0x11d)+_0x32fe26['minimum']:'<=\x20'+_0x32fe26['maximum'];console['log'](_0x579a9a+_0x165890(0x133)+a13_0x41449f['blue'](_0x1149c6));}if(_0x32fe26[_0x165890(0x13c)]){const _0x2abc9a=Object[_0x165890(0xfb)](_0x32fe26[_0x165890(0x13c)])['map'](([_0x47a1f8,_0x2e11cc])=>_0x47a1f8+'='+JSON['stringify'](_0x2e11cc))[_0x165890(0x139)](',\x20');console[_0x165890(0x135)](''+_0x579a9a+a13_0x41449f[_0x165890(0x109)](_0x165890(0xf2)+_0x2abc9a));}_0x1be9a9&&_0x32fe26['properties']&&printSchemaFields(_0x32fe26[_0x165890(0xee)],_0xae7b87+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x5af8de(0xec)]=a13_0x5af8de(0xe5);[a13_0x5af8de(0x124)]=a13_0x5af8de(0xf3);async['execute'](_0x2a2365){const _0xa21547=a13_0x5af8de,{options:_0x5d01c5,tdx:_0x46f1da}=_0x2a2365;_0x5d01c5['verbose']&&console['error'](_0xa21547(0xed)+_0x5d01c5[_0xa21547(0x110)]);const _0x385d28=resolveLimit(_0x5d01c5[_0xa21547(0xf8)],DEFAULT_LISTING_LIMIT),_0x1a0678=await withSpinner(_0xa21547(0x11c),()=>_0x46f1da[_0xa21547(0x134)][_0xa21547(0x10a)](),{'verbose':_0x5d01c5[_0xa21547(0x128)]}),_0x2768a2=_0x1a0678[_0xa21547(0x131)];console[_0xa21547(0x13b)]('✔\x20Found\x20'+_0x2768a2[_0xa21547(0x11f)]+_0xa21547(0x12b)+(_0x2768a2['length']!==0x1?'s':''));if(isStructuredFormat(_0x5d01c5)){const _0x3bee44=_0x2768a2[_0xa21547(0x138)](0x0,_0x385d28);await handleSDKOutput(_0x3bee44,{..._0x5d01c5,'limit':_0x385d28});}else{const _0x5a6c72=_0x2768a2[_0xa21547(0x11f)]>0x0?Math['max'](..._0x2768a2['map'](_0x45b375=>_0x45b375[_0xa21547(0x102)][_0xa21547(0x11f)])):0x0,_0x29f0c8=[];for(const _0x3d523f of _0x2768a2){const _0x446299=a13_0x41449f[_0xa21547(0x114)](_0x3d523f[_0xa21547(0x102)][_0xa21547(0x13f)](_0x5a6c72)),_0x1871d0=_0x3d523f[_0xa21547(0x11b)]?.[_0xa21547(0xec)]?_0xa21547(0x11e)+a13_0x41449f[_0xa21547(0x109)](_0x3d523f[_0xa21547(0x11b)][_0xa21547(0xec)]):'';_0x29f0c8[_0xa21547(0x10e)](_0x446299+'\x20\x20'+_0x3d523f[_0xa21547(0xec)]+_0x1871d0);}await writeOutput(_0x29f0c8[_0xa21547(0x139)]('\x0a'),_0x5d01c5[_0xa21547(0x112)],_0xa21547(0x118));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x5af8de(0xec)]=a13_0x5af8de(0xff);[a13_0x5af8de(0x124)]=a13_0x5af8de(0xdf);[a13_0x5af8de(0x127)](_0x14aab9){const _0x1f57d0=a13_0x5af8de,{args:_0x56c9a3}=_0x14aab9;if(!_0x56c9a3[0x0])return _0x1f57d0(0x111);return undefined;}async[a13_0x5af8de(0xfe)](_0x19d886){const _0x28d49f=a13_0x5af8de,{options:_0x1fcb3a,args:_0x27eff3,tdx:_0x5632f8}=_0x19d886,_0x4ab92f=_0x27eff3[0x0];_0x1fcb3a[_0x28d49f(0x128)]&&(console['error'](_0x28d49f(0xed)+_0x1fcb3a[_0x28d49f(0x110)]),console[_0x28d49f(0x13b)]('Looking\x20up\x20connection:\x20'+_0x4ab92f));const _0x5c12b0=await withSpinner(_0x28d49f(0x13a)+_0x4ab92f+'\x27...',()=>_0x5632f8[_0x28d49f(0x134)][_0x28d49f(0xde)](_0x4ab92f),{'verbose':_0x1fcb3a['verbose']}),_0x36cec3=_0x5c12b0[_0x28d49f(0x131)];return console[_0x28d49f(0x13b)](_0x28d49f(0x146)+_0x36cec3[_0x28d49f(0xec)]),await handleSingleObjectOutput(_0x36cec3,_0x1fcb3a),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']='connection:schema';['description']=a13_0x5af8de(0xe9);[a13_0x5af8de(0x127)](_0x295295){const _0x23c512=a13_0x5af8de,{args:_0x2d8f58}=_0x295295;if(!_0x2d8f58[0x0])return _0x23c512(0xf4);return undefined;}async[a13_0x5af8de(0xfe)](_0xdc99aa){const _0x545db6=a13_0x5af8de,{options:_0x4f8ec4,args:_0x3bcbc9,tdx:_0x156bf1}=_0xdc99aa,_0x32ed02=_0x3bcbc9[0x0];_0x4f8ec4['verbose']&&(console[_0x545db6(0x13b)](_0x545db6(0xed)+_0x4f8ec4[_0x545db6(0x110)]),console[_0x545db6(0x13b)](_0x545db6(0x10f)+_0x32ed02));let _0x3fe10f=_0x32ed02,_0x2c559c;try{const _0x2dfef8=await _0x156bf1[_0x545db6(0x134)][_0x545db6(0x104)](_0x32ed02);_0x2dfef8&&(_0x3fe10f=_0x2dfef8[_0x545db6(0x102)],_0x2c559c=_0x2dfef8[_0x545db6(0xec)],_0x4f8ec4[_0x545db6(0x128)]&&console[_0x545db6(0x13b)]('✔\x20Resolved\x20\x27'+_0x32ed02+_0x545db6(0x12f)+_0x3fe10f));}catch{_0x4f8ec4[_0x545db6(0x128)]&&console['error'](_0x545db6(0x141)+_0x32ed02+'\x27\x20as\x20connector\x20type');}const _0x4da9aa=await withSpinner(_0x545db6(0xeb)+_0x3fe10f+_0x545db6(0x140),()=>_0x156bf1[_0x545db6(0x134)][_0x545db6(0x11a)](_0x3fe10f),{'verbose':_0x4f8ec4[_0x545db6(0x128)]}),_0x5ea17b=_0x4da9aa[_0x545db6(0x131)];_0x2c559c?console[_0x545db6(0x13b)]('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x2c559c+_0x545db6(0x101)+_0x3fe10f+')'):console[_0x545db6(0x13b)](_0x545db6(0x12c)+_0x3fe10f);if(isStructuredFormat(_0x4f8ec4))await handleSingleObjectOutput(_0x5ea17b,_0x4f8ec4);else{const _0x2e187d=normalizeSchemaForDisplay(_0x5ea17b);_0x2c559c?(console[_0x545db6(0x135)]('\x0aConnection:\x20'+a13_0x41449f[_0x545db6(0x114)](_0x2c559c)),console[_0x545db6(0x135)](_0x545db6(0x122)+a13_0x41449f[_0x545db6(0x109)](_0x3fe10f))):console[_0x545db6(0x135)](_0x545db6(0x117)+a13_0x41449f[_0x545db6(0x114)](_0x3fe10f)),_0x2e187d[_0x545db6(0x11f)]>0x0?(console[_0x545db6(0x135)](a13_0x41449f[_0x545db6(0xea)](_0x545db6(0x137))),printSchemaFields(_0x2e187d,0x0)):console[_0x545db6(0x135)](a13_0x41449f[_0x545db6(0x109)](_0x545db6(0x12d)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x5af8de(0xec)]=a13_0x5af8de(0xf0);['description']='List\x20available\x20connector\x20types';async[a13_0x5af8de(0xfe)](_0xf0434f){const _0x2da12a=a13_0x5af8de,{options:_0x2dce42,tdx:_0x1f986f}=_0xf0434f;_0x2dce42['verbose']&&console['error'](_0x2da12a(0xed)+_0x2dce42[_0x2da12a(0x110)]);const _0x25b790=await withSpinner(_0x2da12a(0x121),()=>_0x1f986f[_0x2da12a(0x134)]['listTypes'](),{'verbose':_0x2dce42[_0x2da12a(0x128)]}),_0xbb7486=_0x25b790['data'][_0x2da12a(0xf6)]((_0x18b43a,_0x4b2519)=>_0x18b43a[_0x2da12a(0x102)]['localeCompare'](_0x4b2519[_0x2da12a(0x102)]));console[_0x2da12a(0x13b)](_0x2da12a(0xfd)+_0xbb7486[_0x2da12a(0x11f)]+'\x20connector\x20type'+(_0xbb7486['length']!==0x1?'s':''));if(isStructuredFormat(_0x2dce42))await handleSDKOutput(_0xbb7486,_0x2dce42);else{const _0x4f719a=_0xbb7486[_0x2da12a(0x11f)]>0x0?Math[_0x2da12a(0x123)](..._0xbb7486[_0x2da12a(0xef)](_0x38a620=>_0x38a620[_0x2da12a(0x102)]['length'])):0x0,_0x3a97c5=[];for(const _0x199cd6 of _0xbb7486){const _0x3e36f9=a13_0x41449f[_0x2da12a(0x114)](_0x199cd6[_0x2da12a(0x102)][_0x2da12a(0x13f)](_0x4f719a));_0x3a97c5['push'](_0x3e36f9+'\x20\x20'+_0x199cd6[_0x2da12a(0xec)]);}await writeOutput(_0x3a97c5[_0x2da12a(0x139)]('\x0a'),_0x2dce42['output'],'table');}return 0x0;}}function a13_0x43e1(_0x4eb92b,_0x157cee){_0x4eb92b=_0x4eb92b-0xd9;const _0x43d30a=a13_0x43d3();let _0x43e18e=_0x43d30a[_0x4eb92b];return _0x43e18e;}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x5af8de(0xec)]=a13_0x5af8de(0x129);['description']='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';[a13_0x5af8de(0x127)](_0x4391db){const _0x58480f=a13_0x5af8de,{args:_0x2179f1}=_0x4391db;if(!_0x2179f1[0x0])return _0x58480f(0x130);return undefined;}async['execute'](_0x28c337){const _0x3e5d60=a13_0x5af8de,{options:_0x439d47,args:_0xa9b954,tdx:_0x136a34}=_0x28c337,_0x4aa13c=_0xa9b954[0x0];_0x439d47['verbose']&&(console[_0x3e5d60(0x13b)](_0x3e5d60(0xed)+_0x439d47[_0x3e5d60(0x110)]),console[_0x3e5d60(0x13b)](_0x3e5d60(0x10b)+_0x4aa13c));const _0x5e6e38=await withSpinner(_0x3e5d60(0xfc)+_0x4aa13c+_0x3e5d60(0x140),()=>_0x136a34[_0x3e5d60(0x134)][_0x3e5d60(0x142)](_0x4aa13c),{'verbose':_0x439d47[_0x3e5d60(0x128)]}),_0x3b3306=_0x5e6e38[_0x3e5d60(0x131)];console[_0x3e5d60(0x13b)](_0x3e5d60(0x119)+_0x4aa13c);if(isStructuredFormat(_0x439d47))await handleSingleObjectOutput(_0x3b3306,_0x439d47);else{console[_0x3e5d60(0x135)](_0x3e5d60(0x117)+a13_0x41449f[_0x3e5d60(0x114)](_0x4aa13c)),console['log'](_0x3e5d60(0xe8)+_0x3b3306[_0x3e5d60(0xec)]);const _0x1a3e40=_0x3b3306['settings']||[],_0x7a3315=_0x1a3e40[_0x3e5d60(0xdc)](_0x4f0d23=>_0x4f0d23[_0x3e5d60(0xe0)]);_0x7a3315[_0x3e5d60(0x11f)]>0x0&&(console[_0x3e5d60(0x135)](a13_0x41449f[_0x3e5d60(0xea)](_0x3e5d60(0xda))),printMetadataSettings(_0x7a3315));let _0x59926f=![];try{const _0x5bf117=await _0x136a34[_0x3e5d60(0x134)][_0x3e5d60(0x11a)](_0x4aa13c),_0x33b97b=normalizeSchemaForDisplay(_0x5bf117);_0x33b97b[_0x3e5d60(0x11f)]>0x0&&(console[_0x3e5d60(0x135)](a13_0x41449f[_0x3e5d60(0xea)](_0x3e5d60(0x137))),printSchemaFields(_0x33b97b,0x0),_0x59926f=!![]);}catch{const _0x491b86=_0x1a3e40['filter'](_0x355d08=>!_0x355d08['credential']);_0x491b86[_0x3e5d60(0x11f)]>0x0&&(console[_0x3e5d60(0x135)](a13_0x41449f[_0x3e5d60(0xea)]('\x0aAvailable\x20fields:')),printMetadataSettings(_0x491b86),_0x59926f=!![]);}!_0x59926f&&_0x439d47[_0x3e5d60(0x128)]&&console[_0x3e5d60(0x13b)](a13_0x41449f['dim'](_0x3e5d60(0x12e))),_0x7a3315['length']===0x0&&console[_0x3e5d60(0x135)](a13_0x41449f[_0x3e5d60(0x109)]('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function printMetadataSettings(_0x5b8f7e){const _0x5bb233=a13_0x5af8de;for(const _0x20beb1 of _0x5b8f7e){if(!_0x20beb1['name'])continue;if(_0x20beb1[_0x5bb233(0x106)])continue;let _0x3a0feb='\x20\x20'+a13_0x41449f['green'](_0x20beb1[_0x5bb233(0xec)]);_0x20beb1['label']&&(_0x3a0feb+=':\x20'+_0x20beb1[_0x5bb233(0xdb)]);_0x20beb1[_0x5bb233(0x102)]&&(_0x3a0feb+=a13_0x41449f[_0x5bb233(0x109)]('\x20['+_0x20beb1[_0x5bb233(0x102)]+']'));console[_0x5bb233(0x135)](_0x3a0feb);_0x20beb1[_0x5bb233(0x126)]&&console[_0x5bb233(0x135)](_0x5bb233(0xe1)+a13_0x41449f[_0x5bb233(0x109)](_0x20beb1[_0x5bb233(0x126)]));if(_0x20beb1[_0x5bb233(0xf1)]){const _0x31cbd4=_0x20beb1[_0x5bb233(0xf1)][_0x5bb233(0xef)](_0x14fe53=>_0x14fe53['value'])[_0x5bb233(0x139)](',\x20');console[_0x5bb233(0x135)](_0x5bb233(0x108)+a13_0x41449f[_0x5bb233(0x105)](_0x31cbd4));}_0x20beb1[_0x5bb233(0x10c)]!==undefined&&_0x20beb1[_0x5bb233(0x10c)]!==null&&console[_0x5bb233(0x135)](_0x5bb233(0x13d)+a13_0x41449f[_0x5bb233(0x12a)](String(_0x20beb1['default_value'])));if(_0x20beb1[_0x5bb233(0x13c)]){const _0x3863e1=Object[_0x5bb233(0xfb)](_0x20beb1[_0x5bb233(0x13c)])[_0x5bb233(0xef)](([_0x35df6b,_0xbccdbb])=>_0x35df6b+'='+JSON[_0x5bb233(0xf7)](_0xbccdbb))[_0x5bb233(0x139)](',\x20');console['log'](_0x5bb233(0xe1)+a13_0x41449f['dim'](_0x5bb233(0xf2)+_0x3863e1));}}}
1
+ const a13_0xed6071=a13_0x38a4;(function(_0x2c05c0,_0x9cd52e){const _0x4e94a9=a13_0x38a4,_0x17f13e=_0x2c05c0();while(!![]){try{const _0x345e9b=-parseInt(_0x4e94a9(0x13e))/0x1+-parseInt(_0x4e94a9(0x10f))/0x2+-parseInt(_0x4e94a9(0x172))/0x3+-parseInt(_0x4e94a9(0x13c))/0x4+parseInt(_0x4e94a9(0x13d))/0x5*(-parseInt(_0x4e94a9(0x158))/0x6)+parseInt(_0x4e94a9(0x115))/0x7+parseInt(_0x4e94a9(0x144))/0x8*(parseInt(_0x4e94a9(0x162))/0x9);if(_0x345e9b===_0x9cd52e)break;else _0x17f13e['push'](_0x17f13e['shift']());}catch(_0x39548e){_0x17f13e['push'](_0x17f13e['shift']());}}}(a13_0x38f5,0xc0b19));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_0x424540 from'chalk';function normalizeSchemaForDisplay(_0x17fc3f){const _0x239013=a13_0x38a4,_0x8236b5=_0x17fc3f['properties']||[],_0x3b4492=_0x8236b5[_0x239013(0x118)](_0x3da5c2=>_0x3da5c2['name']==='legacy_settings'&&_0x3da5c2[_0x239013(0x159)]===_0x239013(0x134)&&_0x3da5c2[_0x239013(0x14f)]);if(_0x3b4492?.[_0x239013(0x14f)]){const _0x460307=_0x8236b5[_0x239013(0x145)](_0x35cce0=>_0x35cce0[_0x239013(0x166)]!==_0x239013(0x148)&&_0x35cce0['name']!==_0x239013(0x132));return[..._0x460307,..._0x3b4492[_0x239013(0x14f)]];}return _0x8236b5['filter'](_0x434777=>_0x434777['name']!==_0x239013(0x148));}function printSchemaFields(_0x1ab83c,_0x2e7bdd){const _0x46c90e=a13_0x38a4,_0xfdd010='\x20\x20'[_0x46c90e(0x137)](_0x2e7bdd+0x1),_0x1ab674='\x20\x20'[_0x46c90e(0x137)](_0x2e7bdd+0x2);for(const _0x1fe5d8 of _0x1ab83c){if(!_0x1fe5d8[_0x46c90e(0x166)])continue;const _0x8273b5=_0x1fe5d8[_0x46c90e(0x159)]==='record'&&_0x1fe5d8[_0x46c90e(0x14f)]&&_0x1fe5d8[_0x46c90e(0x14f)][_0x46c90e(0x16c)]>0x0&&_0x1fe5d8[_0x46c90e(0x166)]!==_0x46c90e(0x132);let _0xf3fd7f=''+_0xfdd010+a13_0x424540[_0x46c90e(0x156)](_0x1fe5d8['name']);_0x1fe5d8[_0x46c90e(0x16f)]&&(_0xf3fd7f+=':\x20'+_0x1fe5d8[_0x46c90e(0x16f)]);if(_0x1fe5d8[_0x46c90e(0x165)])_0xf3fd7f+=a13_0x424540[_0x46c90e(0x170)]('\x20['+_0x1fe5d8['input']+']');else _0x8273b5&&(_0xf3fd7f+=a13_0x424540[_0x46c90e(0x170)](_0x46c90e(0x15d)));console[_0x46c90e(0x116)](_0xf3fd7f);_0x1fe5d8['description']&&console[_0x46c90e(0x116)](''+_0x1ab674+a13_0x424540[_0x46c90e(0x170)](_0x1fe5d8[_0x46c90e(0x11f)]));if(_0x1fe5d8['enumeration']){const _0x12d17b=_0x1fe5d8[_0x46c90e(0x110)][_0x46c90e(0x15e)](_0x57c957=>typeof _0x57c957==='object'&&'value'in _0x57c957?_0x57c957[_0x46c90e(0x14b)]:_0x57c957)[_0x46c90e(0x119)](',\x20');console[_0x46c90e(0x116)](_0x1ab674+_0x46c90e(0x131)+a13_0x424540[_0x46c90e(0x176)](_0x12d17b));}_0x1fe5d8[_0x46c90e(0x16b)]!==undefined&&console[_0x46c90e(0x116)](_0x1ab674+'Default:\x20'+a13_0x424540['blue'](String(_0x1fe5d8[_0x46c90e(0x16b)])));if(_0x1fe5d8[_0x46c90e(0x16e)]!==undefined||_0x1fe5d8['maximum']!==undefined){const _0x5457c1=_0x1fe5d8['minimum']!==undefined&&_0x1fe5d8[_0x46c90e(0x161)]!==undefined?_0x1fe5d8[_0x46c90e(0x16e)]+_0x46c90e(0x163)+_0x1fe5d8['maximum']:_0x1fe5d8[_0x46c90e(0x16e)]!==undefined?_0x46c90e(0x125)+_0x1fe5d8[_0x46c90e(0x16e)]:_0x46c90e(0x139)+_0x1fe5d8[_0x46c90e(0x161)];console['log'](_0x1ab674+_0x46c90e(0x12b)+a13_0x424540[_0x46c90e(0x120)](_0x5457c1));}if(_0x1fe5d8['criteria']){const _0x10319c=Object[_0x46c90e(0x142)](_0x1fe5d8[_0x46c90e(0x114)])[_0x46c90e(0x15e)](([_0x298d63,_0x247ca3])=>_0x298d63+'='+JSON[_0x46c90e(0x16d)](_0x247ca3))['join'](',\x20');console[_0x46c90e(0x116)](''+_0x1ab674+a13_0x424540['dim'](_0x46c90e(0x13a)+_0x10319c));}_0x8273b5&&_0x1fe5d8[_0x46c90e(0x14f)]&&printSchemaFields(_0x1fe5d8[_0x46c90e(0x14f)],_0x2e7bdd+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0xed6071(0x166)]='connection:list';[a13_0xed6071(0x11f)]='List\x20all\x20result\x20output\x20connections';async[a13_0xed6071(0x117)](_0x2da6c2){const _0x1c22a7=a13_0xed6071,{options:_0x12f7ed,tdx:_0x569c6b}=_0x2da6c2;_0x12f7ed[_0x1c22a7(0x138)]&&console[_0x1c22a7(0x122)]('Site:\x20'+_0x12f7ed['site']);const _0x248728=resolveLimit(_0x12f7ed['limit'],DEFAULT_LISTING_LIMIT),_0x38e933=await withSpinner(_0x1c22a7(0x155),()=>_0x569c6b[_0x1c22a7(0x14a)][_0x1c22a7(0x12d)](),{'verbose':_0x12f7ed[_0x1c22a7(0x138)]}),_0x1f3869=_0x38e933[_0x1c22a7(0x169)];console[_0x1c22a7(0x122)](_0x1c22a7(0x129)+_0x1f3869[_0x1c22a7(0x16c)]+_0x1c22a7(0x11a)+(_0x1f3869['length']!==0x1?'s':''));if(isStructuredFormat(_0x12f7ed)){const _0x226e15=_0x1f3869[_0x1c22a7(0x146)](0x0,_0x248728);await handleSDKOutput(_0x226e15,{..._0x12f7ed,'limit':_0x248728});}else{const _0xb81335=_0x1f3869[_0x1c22a7(0x16c)]>0x0?Math['max'](..._0x1f3869['map'](_0x331c14=>_0x331c14['type'][_0x1c22a7(0x16c)])):0x0,_0x2daf10=[];for(const _0x2dcf08 of _0x1f3869){const _0x26d269=a13_0x424540[_0x1c22a7(0x15f)](_0x2dcf08[_0x1c22a7(0x159)]['padStart'](_0xb81335)),_0x389e40=_0x2dcf08[_0x1c22a7(0x127)]?.['name']?_0x1c22a7(0x163)+a13_0x424540[_0x1c22a7(0x170)](_0x2dcf08[_0x1c22a7(0x127)][_0x1c22a7(0x166)]):'';_0x2daf10[_0x1c22a7(0x15c)](_0x26d269+'\x20\x20'+_0x2dcf08[_0x1c22a7(0x166)]+_0x389e40);}await writeOutput(_0x2daf10[_0x1c22a7(0x119)]('\x0a'),_0x12f7ed[_0x1c22a7(0x171)],_0x1c22a7(0x11d));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0xed6071(0x166)]='connection:show';[a13_0xed6071(0x11f)]='Show\x20connection\x20details';[a13_0xed6071(0x15b)](_0x3928e3){const {args:_0x52d69d}=_0x3928e3;if(!_0x52d69d[0x0])return'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';return undefined;}async['execute'](_0x262104){const _0xc26c19=a13_0xed6071,{options:_0x495b20,args:_0x59ed11,tdx:_0x13ce40}=_0x262104,_0x2d05d4=_0x59ed11[0x0];_0x495b20['verbose']&&(console[_0xc26c19(0x122)]('Site:\x20'+_0x495b20['site']),console['error'](_0xc26c19(0x14e)+_0x2d05d4));const _0x410820=await withSpinner(_0xc26c19(0x112)+_0x2d05d4+_0xc26c19(0x136),()=>_0x13ce40[_0xc26c19(0x14a)]['resolve'](_0x2d05d4),{'verbose':_0x495b20['verbose']}),_0x431643=_0x410820['data'];return console[_0xc26c19(0x122)](_0xc26c19(0x111)+_0x431643[_0xc26c19(0x166)]),await handleSingleObjectOutput(_0x431643,_0x495b20),0x0;}}function a13_0x38a4(_0x31a2e9,_0x5194c5){_0x31a2e9=_0x31a2e9-0x10f;const _0x38f571=a13_0x38f5();let _0x38a451=_0x38f571[_0x31a2e9];return _0x38a451;}function a13_0x38f5(){const _0x34c22e=['\x20[record]','map','cyan','\x27\x20(type:\x20','maximum','9vdRNFZ','\x20-\x20','Type:\x20','input','name','\x0aConnection:\x20','sort','data','\x27\x20as\x20connector\x20type','default_value','length','stringify','minimum','title','dim','output','4387935XuBKZg','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','settings','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','yellow','399076bozyAU','enumeration','✔\x20Found\x20connection:\x20','Fetching\x20connection\x20\x27','✔\x20Resolved\x20\x27','criteria','2029797ndWwsc','log','execute','find','join','\x20connection','✔\x20Found\x20schema\x20for\x20connection\x20\x27','findByName','table','\x0aAvailable\x20fields:','description','blue','connection:types','error','Treating\x20\x27','hint','>=\x20','getOutputSchema','owner','\x0aConnector:\x20','✔\x20Found\x20','List\x20available\x20connector\x20types','Range:\x20','\x20\x20\x20\x20','list','Fetching\x20settings\x20for\x20connector\x20type:\x20','max','\x20\x20\x20\x20Default:\x20','Options:\x20','legacy_settings','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.','record','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','\x27...','repeat','verbose','<=\x20','Show\x20when:\x20','Resolving\x20connector\x20type\x20or\x20name:\x20','730548gJolgO','5YnCFwh','905616ftntNb','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.','No\x20available\x20fields\x20for\x20this\x20connector','listTypes','entries','\x0aNo\x20credential\x20settings\x20defined','26042696JlsJjY','filter','slice','site','legacy','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','connection','value','credential','Site:\x20','Looking\x20up\x20connection:\x20','properties','options','\x0aNo\x20fields\x20defined\x20in\x20schema','\x20\x20\x20\x20Options:\x20','label','Name:\x20','Listing\x20connections...','green','connection:schema','33594uthpVa','type','bold','validate','push'];a13_0x38f5=function(){return _0x34c22e;};return a13_0x38f5();}export class ConnectionSchemaCommand extends BaseCommand{[a13_0xed6071(0x166)]=a13_0xed6071(0x157);[a13_0xed6071(0x11f)]=a13_0xed6071(0x149);['validate'](_0x56ba55){const _0x2297f8=a13_0xed6071,{args:_0x5004b3}=_0x56ba55;if(!_0x5004b3[0x0])return _0x2297f8(0x133);return undefined;}async[a13_0xed6071(0x117)](_0x1c8280){const _0x300d9e=a13_0xed6071,{options:_0x379401,args:_0xdab07c,tdx:_0x3f445e}=_0x1c8280,_0x208d5d=_0xdab07c[0x0];_0x379401[_0x300d9e(0x138)]&&(console[_0x300d9e(0x122)](_0x300d9e(0x14d)+_0x379401['site']),console['error'](_0x300d9e(0x13b)+_0x208d5d));let _0x3fafae=_0x208d5d,_0x29f32c;try{const _0x55569f=await _0x3f445e[_0x300d9e(0x14a)][_0x300d9e(0x11c)](_0x208d5d);_0x55569f&&(_0x3fafae=_0x55569f[_0x300d9e(0x159)],_0x29f32c=_0x55569f[_0x300d9e(0x166)],_0x379401['verbose']&&console[_0x300d9e(0x122)](_0x300d9e(0x113)+_0x208d5d+_0x300d9e(0x175)+_0x3fafae));}catch{_0x379401['verbose']&&console[_0x300d9e(0x122)](_0x300d9e(0x123)+_0x208d5d+_0x300d9e(0x16a));}const _0x55fa59=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x3fafae+_0x300d9e(0x136),()=>_0x3f445e[_0x300d9e(0x14a)]['getOutputSchema'](_0x3fafae),{'verbose':_0x379401[_0x300d9e(0x138)]}),_0x2e0db5=_0x55fa59[_0x300d9e(0x169)];_0x29f32c?console[_0x300d9e(0x122)](_0x300d9e(0x11b)+_0x29f32c+_0x300d9e(0x160)+_0x3fafae+')'):console[_0x300d9e(0x122)](_0x300d9e(0x135)+_0x3fafae);if(isStructuredFormat(_0x379401))await handleSingleObjectOutput(_0x2e0db5,_0x379401);else{const _0x12c275=normalizeSchemaForDisplay(_0x2e0db5);_0x29f32c?(console[_0x300d9e(0x116)](_0x300d9e(0x167)+a13_0x424540[_0x300d9e(0x15f)](_0x29f32c)),console[_0x300d9e(0x116)](_0x300d9e(0x164)+a13_0x424540[_0x300d9e(0x170)](_0x3fafae))):console[_0x300d9e(0x116)](_0x300d9e(0x128)+a13_0x424540[_0x300d9e(0x15f)](_0x3fafae)),_0x12c275[_0x300d9e(0x16c)]>0x0?(console[_0x300d9e(0x116)](a13_0x424540[_0x300d9e(0x15a)](_0x300d9e(0x11e))),printSchemaFields(_0x12c275,0x0)):console['log'](a13_0x424540[_0x300d9e(0x170)](_0x300d9e(0x151)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a13_0xed6071(0x121);['description']=a13_0xed6071(0x12a);async[a13_0xed6071(0x117)](_0x5dd160){const _0x23b458=a13_0xed6071,{options:_0x2c7649,tdx:_0x122153}=_0x5dd160;_0x2c7649[_0x23b458(0x138)]&&console[_0x23b458(0x122)](_0x23b458(0x14d)+_0x2c7649[_0x23b458(0x147)]);const _0x59d713=await withSpinner('Listing\x20connector\x20types...',()=>_0x122153[_0x23b458(0x14a)][_0x23b458(0x141)](),{'verbose':_0x2c7649[_0x23b458(0x138)]}),_0x5a76c2=_0x59d713['data'][_0x23b458(0x168)]((_0x2b4e8b,_0x10d237)=>_0x2b4e8b[_0x23b458(0x159)]['localeCompare'](_0x10d237[_0x23b458(0x159)]));console[_0x23b458(0x122)]('✔\x20Found\x20'+_0x5a76c2[_0x23b458(0x16c)]+'\x20connector\x20type'+(_0x5a76c2[_0x23b458(0x16c)]!==0x1?'s':''));if(isStructuredFormat(_0x2c7649))await handleSDKOutput(_0x5a76c2,_0x2c7649);else{const _0x2ce2d2=_0x5a76c2[_0x23b458(0x16c)]>0x0?Math[_0x23b458(0x12f)](..._0x5a76c2['map'](_0x109948=>_0x109948[_0x23b458(0x159)][_0x23b458(0x16c)])):0x0,_0x49a39a=[];for(const _0x51a0be of _0x5a76c2){const _0x533fb3=a13_0x424540[_0x23b458(0x15f)](_0x51a0be[_0x23b458(0x159)]['padStart'](_0x2ce2d2));_0x49a39a[_0x23b458(0x15c)](_0x533fb3+'\x20\x20'+_0x51a0be[_0x23b458(0x166)]);}await writeOutput(_0x49a39a[_0x23b458(0x119)]('\x0a'),_0x2c7649['output'],_0x23b458(0x11d));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0xed6071(0x166)]='connection:settings';[a13_0xed6071(0x11f)]='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';[a13_0xed6071(0x15b)](_0x374041){const _0x5e2fce=a13_0xed6071,{args:_0x571fbf}=_0x374041;if(!_0x571fbf[0x0])return _0x5e2fce(0x13f);return undefined;}async[a13_0xed6071(0x117)](_0x104281){const _0x189b59=a13_0xed6071,{options:_0x524ca6,args:_0x40ff00,tdx:_0x471d2c}=_0x104281,_0x21f21f=_0x40ff00[0x0];_0x524ca6[_0x189b59(0x138)]&&(console[_0x189b59(0x122)](_0x189b59(0x14d)+_0x524ca6[_0x189b59(0x147)]),console['error'](_0x189b59(0x12e)+_0x21f21f));const _0x3bdc37=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x21f21f+'\x27...',()=>_0x471d2c[_0x189b59(0x14a)]['getMetadata'](_0x21f21f),{'verbose':_0x524ca6[_0x189b59(0x138)]}),_0x735a80=_0x3bdc37[_0x189b59(0x169)];console['error'](_0x189b59(0x173)+_0x21f21f);if(isStructuredFormat(_0x524ca6))await handleSingleObjectOutput(_0x735a80,_0x524ca6);else{console[_0x189b59(0x116)](_0x189b59(0x128)+a13_0x424540['cyan'](_0x21f21f)),console[_0x189b59(0x116)](_0x189b59(0x154)+_0x735a80[_0x189b59(0x166)]);const _0x394b9e=_0x735a80[_0x189b59(0x174)]||[],_0xd1ba64=_0x394b9e[_0x189b59(0x145)](_0x3e9ecd=>_0x3e9ecd[_0x189b59(0x14c)]);_0xd1ba64[_0x189b59(0x16c)]>0x0&&(console[_0x189b59(0x116)](a13_0x424540[_0x189b59(0x15a)]('\x0aCredential\x20settings:')),printMetadataSettings(_0xd1ba64));let _0x551927=![];try{const _0x13b4cc=await _0x471d2c[_0x189b59(0x14a)][_0x189b59(0x126)](_0x21f21f),_0x2781a3=normalizeSchemaForDisplay(_0x13b4cc);_0x2781a3['length']>0x0&&(console[_0x189b59(0x116)](a13_0x424540[_0x189b59(0x15a)](_0x189b59(0x11e))),printSchemaFields(_0x2781a3,0x0),_0x551927=!![]);}catch{const _0x1c7f5c=_0x394b9e[_0x189b59(0x145)](_0x43406b=>!_0x43406b[_0x189b59(0x14c)]);_0x1c7f5c[_0x189b59(0x16c)]>0x0&&(console[_0x189b59(0x116)](a13_0x424540[_0x189b59(0x15a)]('\x0aAvailable\x20fields:')),printMetadataSettings(_0x1c7f5c),_0x551927=!![]);}!_0x551927&&_0x524ca6[_0x189b59(0x138)]&&console[_0x189b59(0x122)](a13_0x424540[_0x189b59(0x170)](_0x189b59(0x140))),_0xd1ba64[_0x189b59(0x16c)]===0x0&&console[_0x189b59(0x116)](a13_0x424540['dim'](_0x189b59(0x143)));}return 0x0;}}function printMetadataSettings(_0x2440d2){const _0x296bd8=a13_0xed6071;for(const _0x352fa1 of _0x2440d2){if(!_0x352fa1['name'])continue;if(_0x352fa1['hidden'])continue;let _0x192d88='\x20\x20'+a13_0x424540[_0x296bd8(0x156)](_0x352fa1[_0x296bd8(0x166)]);_0x352fa1[_0x296bd8(0x153)]&&(_0x192d88+=':\x20'+_0x352fa1['label']);_0x352fa1[_0x296bd8(0x159)]&&(_0x192d88+=a13_0x424540[_0x296bd8(0x170)]('\x20['+_0x352fa1[_0x296bd8(0x159)]+']'));console[_0x296bd8(0x116)](_0x192d88);_0x352fa1[_0x296bd8(0x124)]&&console['log'](_0x296bd8(0x12c)+a13_0x424540[_0x296bd8(0x170)](_0x352fa1['hint']));if(_0x352fa1[_0x296bd8(0x150)]){const _0x5b9237=_0x352fa1[_0x296bd8(0x150)][_0x296bd8(0x15e)](_0xb0ef51=>_0xb0ef51['value'])[_0x296bd8(0x119)](',\x20');console['log'](_0x296bd8(0x152)+a13_0x424540[_0x296bd8(0x176)](_0x5b9237));}_0x352fa1[_0x296bd8(0x16b)]!==undefined&&_0x352fa1[_0x296bd8(0x16b)]!==null&&console[_0x296bd8(0x116)](_0x296bd8(0x130)+a13_0x424540['blue'](String(_0x352fa1[_0x296bd8(0x16b)])));if(_0x352fa1[_0x296bd8(0x114)]){const _0x591e04=Object[_0x296bd8(0x142)](_0x352fa1[_0x296bd8(0x114)])[_0x296bd8(0x15e)](([_0x4825c3,_0x3ede3d])=>_0x4825c3+'='+JSON[_0x296bd8(0x16d)](_0x3ede3d))[_0x296bd8(0x119)](',\x20');console[_0x296bd8(0x116)](_0x296bd8(0x12c)+a13_0x424540[_0x296bd8(0x170)](_0x296bd8(0x13a)+_0x591e04));}}}
@@ -1 +1 @@
1
- const a14_0x706368=a14_0x368f;function a14_0x368f(_0x2add1f,_0x52d3aa){_0x2add1f=_0x2add1f-0x1e4;const _0x23645d=a14_0x2364();let _0x368f08=_0x23645d[_0x2add1f];return _0x368f08;}function a14_0x2364(){const _0x3ba335=['6996832VcBHKK','2538877CZdARj','name','databases','cause','limit','\x20\x20Cause:\x20','5037264ivhYVo','length','description','message','Error:\x20','listDatabases','\x20database','925813CNxetH','66PqSLBF','✔\x20Found\x20','50BXQRAa','List\x20all\x20databases','76116XlKEBI','Listing\x20databases...','919213eHiGHu','execute','Pattern:\x20','6ObNeZQ','555215TJIBPB','52NawHUd','error','verbose'];a14_0x2364=function(){return _0x3ba335;};return a14_0x2364();}(function(_0x108e3e,_0x588a74){const _0x3c5b34=a14_0x368f,_0x25b98d=_0x108e3e();while(!![]){try{const _0x15b27d=parseInt(_0x3c5b34(0x1fb))/0x1+-parseInt(_0x3c5b34(0x1f5))/0x2*(-parseInt(_0x3c5b34(0x1f9))/0x3)+-parseInt(_0x3c5b34(0x200))/0x4*(parseInt(_0x3c5b34(0x1ff))/0x5)+parseInt(_0x3c5b34(0x1fe))/0x6*(parseInt(_0x3c5b34(0x1f4))/0x7)+parseInt(_0x3c5b34(0x1e6))/0x8+parseInt(_0x3c5b34(0x1ed))/0x9+-parseInt(_0x3c5b34(0x1f7))/0xa*(parseInt(_0x3c5b34(0x1e7))/0xb);if(_0x15b27d===_0x588a74)break;else _0x25b98d['push'](_0x25b98d['shift']());}catch(_0x1692b4){_0x25b98d['push'](_0x25b98d['shift']());}}}(a14_0x2364,0xb11ce));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';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_0x706368(0x1e8)]=a14_0x706368(0x1e9);[a14_0x706368(0x1ef)]=a14_0x706368(0x1f8);async[a14_0x706368(0x1fc)](_0x11d745){const _0x1b370c=a14_0x706368,{options:_0x1e683d,args:_0x265d9d,tdx:_0x6756a1}=_0x11d745,_0x47debe=_0x265d9d[0x0];try{_0x1e683d[_0x1b370c(0x1e5)]&&(console[_0x1b370c(0x1e4)]('Site:\x20'+_0x1e683d['site']),_0x47debe&&console[_0x1b370c(0x1e4)](_0x1b370c(0x1fd)+_0x47debe));const _0x5b06db=resolveLimit(_0x1e683d[_0x1b370c(0x1eb)],DEFAULT_LISTING_LIMIT),_0x5012fd=await withSpinner(_0x1b370c(0x1fa),()=>_0x6756a1['query'][_0x1b370c(0x1f2)](_0x47debe,_0x5b06db),{'verbose':_0x1e683d[_0x1b370c(0x1e5)]}),_0x5632b4=_0x5012fd['data'];return console[_0x1b370c(0x1e4)](_0x1b370c(0x1f6)+_0x5632b4[_0x1b370c(0x1ee)]+_0x1b370c(0x1f3)+(_0x5632b4[_0x1b370c(0x1ee)]!==0x1?'s':'')),await handleSDKOutput(_0x5632b4,{..._0x1e683d,'limit':_0x5b06db}),0x0;}catch(_0x49060f){if(_0x49060f instanceof SDKError)return console[_0x1b370c(0x1e4)](_0x1b370c(0x1f1)+_0x49060f[_0x1b370c(0x1f0)]),_0x49060f[_0x1b370c(0x1ea)]&&console[_0x1b370c(0x1e4)](_0x1b370c(0x1ec)+_0x49060f['cause']),0x1;throw _0x49060f;}}}
1
+ const a14_0x52b67c=a14_0x416d;function a14_0x416d(_0x1aa35c,_0x36de93){_0x1aa35c=_0x1aa35c-0x140;const _0x5c5f70=a14_0x5c5f();let _0x416d8e=_0x5c5f70[_0x1aa35c];return _0x416d8e;}function a14_0x5c5f(){const _0x53a929=['20vefgIs','Listing\x20databases...','15637039lcWNrf','listDatabases','12qfDqsf','query','databases','40xEEqin','Error:\x20','limit','68367usLrEt','✔\x20Found\x20','55797FFfoEw','1765950WpeqLf','222248oSVGLC','verbose','140NOwVou','1466045UYCLDd','error','message','execute','Site:\x20','334971RmkGSS','length','\x20database'];a14_0x5c5f=function(){return _0x53a929;};return a14_0x5c5f();}(function(_0x349506,_0x55168f){const _0x380e3c=a14_0x416d,_0x209205=_0x349506();while(!![]){try{const _0xe013d2=-parseInt(_0x380e3c(0x141))/0x1*(-parseInt(_0x380e3c(0x150))/0x2)+-parseInt(_0x380e3c(0x143))/0x3*(-parseInt(_0x380e3c(0x157))/0x4)+-parseInt(_0x380e3c(0x148))/0x5*(-parseInt(_0x380e3c(0x154))/0x6)+parseInt(_0x380e3c(0x147))/0x7*(parseInt(_0x380e3c(0x145))/0x8)+-parseInt(_0x380e3c(0x14d))/0x9+-parseInt(_0x380e3c(0x144))/0xa+-parseInt(_0x380e3c(0x152))/0xb;if(_0xe013d2===_0x55168f)break;else _0x209205['push'](_0x209205['shift']());}catch(_0x255b87){_0x209205['push'](_0x209205['shift']());}}}(a14_0x5c5f,0x5be0f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';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{['name']=a14_0x52b67c(0x156);['description']='List\x20all\x20databases';async[a14_0x52b67c(0x14b)](_0x5ba33d){const _0x392df7=a14_0x52b67c,{options:_0x2da182,args:_0x4e9c2c,tdx:_0x19b73d}=_0x5ba33d,_0x36cdd6=_0x4e9c2c[0x0];try{_0x2da182['verbose']&&(console[_0x392df7(0x149)](_0x392df7(0x14c)+_0x2da182['site']),_0x36cdd6&&console[_0x392df7(0x149)]('Pattern:\x20'+_0x36cdd6));const _0x57115a=resolveLimit(_0x2da182[_0x392df7(0x140)],DEFAULT_LISTING_LIMIT),_0x374257=await withSpinner(_0x392df7(0x151),()=>_0x19b73d[_0x392df7(0x155)][_0x392df7(0x153)](_0x36cdd6,_0x57115a),{'verbose':_0x2da182[_0x392df7(0x146)]}),_0x2c5dd0=_0x374257['data'];return console[_0x392df7(0x149)](_0x392df7(0x142)+_0x2c5dd0[_0x392df7(0x14e)]+_0x392df7(0x14f)+(_0x2c5dd0[_0x392df7(0x14e)]!==0x1?'s':'')),await handleSDKOutput(_0x2c5dd0,{..._0x2da182,'limit':_0x57115a}),0x0;}catch(_0x3ed345){if(_0x3ed345 instanceof SDKError)return console[_0x392df7(0x149)](_0x392df7(0x158)+_0x3ed345[_0x392df7(0x14a)]),_0x3ed345['cause']&&console['error']('\x20\x20Cause:\x20'+_0x3ed345['cause']),0x1;throw _0x3ed345;}}}
@@ -1 +1 @@
1
- const a15_0x3e1de1=a15_0x2af1;(function(_0x2860f5,_0x435232){const _0x46b97d=a15_0x2af1,_0x1ed1e1=_0x2860f5();while(!![]){try{const _0x326ae7=-parseInt(_0x46b97d(0x1ba))/0x1*(-parseInt(_0x46b97d(0x1b9))/0x2)+parseInt(_0x46b97d(0x1bc))/0x3*(parseInt(_0x46b97d(0x1b2))/0x4)+-parseInt(_0x46b97d(0x1b8))/0x5+-parseInt(_0x46b97d(0x1a9))/0x6+-parseInt(_0x46b97d(0x1b7))/0x7*(-parseInt(_0x46b97d(0x1b0))/0x8)+-parseInt(_0x46b97d(0x1a8))/0x9*(parseInt(_0x46b97d(0x19e))/0xa)+parseInt(_0x46b97d(0x1be))/0xb;if(_0x326ae7===_0x435232)break;else _0x1ed1e1['push'](_0x1ed1e1['shift']());}catch(_0x389fa9){_0x1ed1e1['push'](_0x1ed1e1['shift']());}}}(a15_0x1aa1,0xe6f68));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a15_0x1aa1(){const _0xaad107=['48zSQqBJ','length','3cIVXNt','error','2372392pWCkIW','32510xkAzro','✔\x20Found\x20','Describing\x20table\x20','describeTable','args','validate','...','table','site','database','2007caxCQD','3789918bZbLIb','description','Table\x20\x27','✖\x20Table\x20not\x20found','Error:\x20','\x20\x20Cause:\x20','Site:\x20','11328616yAzRyw','name','2967964oDkiIa','cause','describe','message','\x27\x20does\x20not\x20exist','7WqyeWh','7736410IWHSIq','61508aGqvMI'];a15_0x1aa1=function(){return _0xaad107;};return a15_0x1aa1();}function a15_0x2af1(_0x515b72,_0x514c2d){_0x515b72=_0x515b72-0x19e;const _0x1aa1b0=a15_0x1aa1();let _0x2af178=_0x1aa1b0[_0x515b72];return _0x2af178;}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x3e1de1(0x1b1)]=a15_0x3e1de1(0x1b4);[a15_0x3e1de1(0x1aa)]='Describe\x20table\x20schema';async['execute'](_0x5a480b){return this['describeTable'](_0x5a480b);}async[a15_0x3e1de1(0x1a1)](_0x2ee81e){const _0x528b4e=a15_0x3e1de1,{options:_0x4d8e03,args:_0x5bec91,tdx:_0x3aecd1}=_0x2ee81e;let _0x254951;try{_0x254951=parseTableReference(_0x5bec91[0x0]);const _0x1cffbc=_0x4d8e03[_0x528b4e(0x1a7)];!_0x254951[_0x528b4e(0x1a7)]&&_0x1cffbc&&(_0x254951[_0x528b4e(0x1a7)]=_0x1cffbc);const _0x3c900c=validateTableDescribeReference(_0x254951);if(_0x3c900c)return console[_0x528b4e(0x1bd)](_0x528b4e(0x1ad)+_0x3c900c),0x1;}catch(_0x5c17eb){return console[_0x528b4e(0x1bd)](_0x528b4e(0x1ad)+_0x5c17eb['message']),0x1;}const _0x547659=_0x254951['database'],_0xe00e6e=_0x254951[_0x528b4e(0x1a5)];try{_0x4d8e03['verbose']&&(console[_0x528b4e(0x1bd)](_0x528b4e(0x1af)+_0x4d8e03[_0x528b4e(0x1a6)]),console['error']('Database:\x20'+_0x547659),console[_0x528b4e(0x1bd)]('Table:\x20'+_0xe00e6e));const _0x58e6a5=await withSpinner(_0x528b4e(0x1a0)+_0x547659+'.'+_0xe00e6e+_0x528b4e(0x1a4),()=>_0x3aecd1['query'][_0x528b4e(0x1a1)](_0x547659,_0xe00e6e),{'verbose':_0x4d8e03['verbose']}),_0x1b88cc=_0x58e6a5['data'];if(_0x1b88cc[_0x528b4e(0x1bb)]===0x0)return console[_0x528b4e(0x1bd)](_0x528b4e(0x1ac)),console[_0x528b4e(0x1bd)](_0x528b4e(0x1ab)+_0x547659+'.'+_0xe00e6e+_0x528b4e(0x1b6)),0x1;return console[_0x528b4e(0x1bd)](_0x528b4e(0x19f)+_0x1b88cc['length']+'\x20column'+(_0x1b88cc[_0x528b4e(0x1bb)]!==0x1?'s':'')+'\x20in\x20'+_0x547659+'.'+_0xe00e6e),await handleSDKOutput(_0x1b88cc,_0x4d8e03),0x0;}catch(_0x54c0f0){if(_0x54c0f0 instanceof SDKError)return console[_0x528b4e(0x1bd)](_0x528b4e(0x1ad)+_0x54c0f0[_0x528b4e(0x1b5)]),_0x54c0f0['cause']&&console['error'](_0x528b4e(0x1ae)+_0x54c0f0[_0x528b4e(0x1b3)]),0x1;throw _0x54c0f0;}}[a15_0x3e1de1(0x1a3)](_0x3e7e45){const _0x35ab20=a15_0x3e1de1;if(_0x3e7e45[_0x35ab20(0x1a2)]['length']===0x0)return'Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';if(_0x3e7e45[_0x35ab20(0x1a2)][_0x35ab20(0x1bb)]>0x1)return'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';return undefined;}}
1
+ const a15_0x29d2d6=a15_0x57cc;(function(_0x5de456,_0x57ce55){const _0x2fc045=a15_0x57cc,_0x5102fb=_0x5de456();while(!![]){try{const _0x3fda89=parseInt(_0x2fc045(0x1a8))/0x1*(parseInt(_0x2fc045(0x1a0))/0x2)+parseInt(_0x2fc045(0x1ab))/0x3+parseInt(_0x2fc045(0x1b1))/0x4+parseInt(_0x2fc045(0x1a2))/0x5*(parseInt(_0x2fc045(0x1b2))/0x6)+-parseInt(_0x2fc045(0x1b0))/0x7+parseInt(_0x2fc045(0x1a4))/0x8*(parseInt(_0x2fc045(0x1b9))/0x9)+-parseInt(_0x2fc045(0x1b4))/0xa;if(_0x3fda89===_0x57ce55)break;else _0x5102fb['push'](_0x5102fb['shift']());}catch(_0xdf296b){_0x5102fb['push'](_0x5102fb['shift']());}}}(a15_0x306b,0x561b9));function a15_0x57cc(_0x239c5c,_0x5351f3){_0x239c5c=_0x239c5c-0x19a;const _0x306b9b=a15_0x306b();let _0x57ccee=_0x306b9b[_0x239c5c];return _0x57ccee;}function a15_0x306b(){const _0x1911bf=['error','2nrRPOf','Error:\x20','10820lTsbFJ','describe','79672OkOuum','\x20column','Describing\x20table\x20','query','491882uJhSxw','verbose','database','1134405QbwSgY','Table\x20\x27','\x20in\x20','execute','site','284991xOGdfl','2800624jKQnAD','354jSUrJs','Describe\x20table\x20schema','14936600uPMblB','...','\x27\x20does\x20not\x20exist','validate','length','171SexoYR','✔\x20Found\x20','data','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','Site:\x20','Database:\x20','Table:\x20','description','message','table','describeTable','cause'];a15_0x306b=function(){return _0x1911bf;};return a15_0x306b();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{['name']=a15_0x29d2d6(0x1a3);[a15_0x29d2d6(0x19a)]=a15_0x29d2d6(0x1b3);async[a15_0x29d2d6(0x1ae)](_0x5af204){const _0x54f09f=a15_0x29d2d6;return this[_0x54f09f(0x19d)](_0x5af204);}async['describeTable'](_0xab8280){const _0x5e1b4c=a15_0x29d2d6,{options:_0x5db43c,args:_0x4470f6,tdx:_0x55b87c}=_0xab8280;let _0x4d00af;try{_0x4d00af=parseTableReference(_0x4470f6[0x0]);const _0xb5fb3b=_0x5db43c[_0x5e1b4c(0x1aa)];!_0x4d00af[_0x5e1b4c(0x1aa)]&&_0xb5fb3b&&(_0x4d00af[_0x5e1b4c(0x1aa)]=_0xb5fb3b);const _0x402a22=validateTableDescribeReference(_0x4d00af);if(_0x402a22)return console['error'](_0x5e1b4c(0x1a1)+_0x402a22),0x1;}catch(_0x53c910){return console[_0x5e1b4c(0x19f)]('Error:\x20'+_0x53c910[_0x5e1b4c(0x19b)]),0x1;}const _0x15a91a=_0x4d00af[_0x5e1b4c(0x1aa)],_0x3c45e6=_0x4d00af[_0x5e1b4c(0x19c)];try{_0x5db43c[_0x5e1b4c(0x1a9)]&&(console[_0x5e1b4c(0x19f)](_0x5e1b4c(0x1bd)+_0x5db43c[_0x5e1b4c(0x1af)]),console[_0x5e1b4c(0x19f)](_0x5e1b4c(0x1be)+_0x15a91a),console[_0x5e1b4c(0x19f)](_0x5e1b4c(0x1bf)+_0x3c45e6));const _0x4824c3=await withSpinner(_0x5e1b4c(0x1a6)+_0x15a91a+'.'+_0x3c45e6+_0x5e1b4c(0x1b5),()=>_0x55b87c[_0x5e1b4c(0x1a7)][_0x5e1b4c(0x19d)](_0x15a91a,_0x3c45e6),{'verbose':_0x5db43c[_0x5e1b4c(0x1a9)]}),_0x514d1c=_0x4824c3[_0x5e1b4c(0x1bb)];if(_0x514d1c[_0x5e1b4c(0x1b8)]===0x0)return console[_0x5e1b4c(0x19f)]('✖\x20Table\x20not\x20found'),console[_0x5e1b4c(0x19f)](_0x5e1b4c(0x1ac)+_0x15a91a+'.'+_0x3c45e6+_0x5e1b4c(0x1b6)),0x1;return console['error'](_0x5e1b4c(0x1ba)+_0x514d1c[_0x5e1b4c(0x1b8)]+_0x5e1b4c(0x1a5)+(_0x514d1c['length']!==0x1?'s':'')+_0x5e1b4c(0x1ad)+_0x15a91a+'.'+_0x3c45e6),await handleSDKOutput(_0x514d1c,_0x5db43c),0x0;}catch(_0x3bba38){if(_0x3bba38 instanceof SDKError)return console[_0x5e1b4c(0x19f)](_0x5e1b4c(0x1a1)+_0x3bba38[_0x5e1b4c(0x19b)]),_0x3bba38[_0x5e1b4c(0x19e)]&&console[_0x5e1b4c(0x19f)]('\x20\x20Cause:\x20'+_0x3bba38['cause']),0x1;throw _0x3bba38;}}[a15_0x29d2d6(0x1b7)](_0x149c81){const _0x4bbdb5=a15_0x29d2d6;if(_0x149c81['args'][_0x4bbdb5(0x1b8)]===0x0)return _0x4bbdb5(0x1bc);if(_0x149c81['args']['length']>0x1)return'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';return undefined;}}
@@ -1 +1 @@
1
- const a16_0x5e736d=a16_0x2907;(function(_0xbf4ac7,_0x5d1fee){const _0x4e3180=a16_0x2907,_0x52bf02=_0xbf4ac7();while(!![]){try{const _0x57480a=-parseInt(_0x4e3180(0x146))/0x1*(parseInt(_0x4e3180(0xfa))/0x2)+-parseInt(_0x4e3180(0x17a))/0x3+parseInt(_0x4e3180(0x171))/0x4+-parseInt(_0x4e3180(0x150))/0x5*(-parseInt(_0x4e3180(0x144))/0x6)+parseInt(_0x4e3180(0x116))/0x7+-parseInt(_0x4e3180(0x12b))/0x8+parseInt(_0x4e3180(0x16d))/0x9;if(_0x57480a===_0x5d1fee)break;else _0x52bf02['push'](_0x52bf02['shift']());}catch(_0x34ebe1){_0x52bf02['push'](_0x52bf02['shift']());}}}(a16_0x1492,0xde53b));import{BaseCommand}from'./command.js';function a16_0x1492(){const _0x33fe47=['Resume\x20a\x20paused\x20campaign','Workspace\x20is\x20required\x20for\x20this\x20operation','Fetching\x20campaigns...','Operation\x20cancelled','Error:\x20--html\x20is\x20required','deleteCampaign','startAt','Fetching\x20workspaces...','keys','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','Resuming\x20campaign\x20\x27','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','html','getWorkspaceFull','Creating\x20campaign\x20\x27','4484816hHTuZO','Workspace\x20\x27','description','engage:template:show','Create\x20an\x20email\x20template','getWorkspace','yes','engage:campaign:create','Duplicate\x20a\x20campaign','Creating\x20workspace\x20\x27','\x27...','Options:\x20--name,\x20--description','limit','session','name','Delete\x20a\x20campaign','List\x20campaigns','execute','engage:workspaces','Error:\x20Workspace\x20name\x20is\x20required','engage:campaign:update','11563472BwCahX','engage:workspace:update','subject','error','log','emailSenderId','resolveWorkspaceId','\x27\x20launched\x20successfully','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Creating\x20template\x20\x27','plaintext','entries','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Deleting\x20workspace\x20\x27','updateTemplate','Template\x20\x27','engage:templates','verbose','Update\x20a\x20campaign','getCampaignFull','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Create\x20a\x20workspace','Show\x20workspace\x20details','engage:campaign:duplicate','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','17634aVyroB','List\x20workspaces','71nsGard','type','Delete\x20a\x20workspace','updateCampaign','Update\x20a\x20workspace','Fetching\x20template\x20\x27','engage:workspace:create','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','workspace','Verifying\x20workspace\x20\x27','390kSxKVa','filter','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27\x20deleted\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','updateWorkspace','Engage\x20workspace\x20set\x20to:\x20','engage:workspace:use','status','resumeCampaign','Show\x20campaign\x20details','engage:workspace:show','length','launchCampaign','createWorkspace','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','engage:campaign:launch','engage:template:update','engage_workspace','createCampaign','engage','engage:campaign:delete','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','\x27?\x20This\x20cannot\x20be\x20undone.','Fetching\x20campaign\x20\x27','segmentName','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','21357144KRSMek','Delete\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','segment','4222808NJsnUs','engage:campaign:show','Campaign\x20\x27','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Update\x20an\x20email\x20template','data','engage:workspace:delete','Error:\x20--subject\x20is\x20required','3478512rtDZvx','Launching\x20campaign\x20\x27','full','engage:template:delete','parentName','engage:template:create','engage:campaign:resume','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Error:\x20--name\x20is\x20required','Create\x20a\x20new\x20campaign','listCampaigns','Fetching\x20templates...','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','22058IwValS','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','getTemplateFull','timezone','Duplicating\x20campaign\x20\x27','Fetching\x20workspace\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Show\x20email\x20template\x20details','fromEntries','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','jsonColumns','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'];a16_0x1492=function(){return _0x33fe47;};return a16_0x1492();}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(_0x540013,_0x3b2c76,_0x3d8338=![]){const _0x53effb=a16_0x2907;if(_0x540013[_0x53effb(0x14e)])return await _0x3b2c76[_0x53effb(0x165)][_0x53effb(0x131)](_0x540013[_0x53effb(0x14e)]);const _0x4330f1=loadSessionContext(_0x540013['session']);if(_0x4330f1?.['engage_workspace'])return await _0x3b2c76[_0x53effb(0x165)][_0x53effb(0x131)](_0x4330f1[_0x53effb(0x163)]);if(_0x3d8338)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x53effb(0x108),undefined,{'helpText':_0x53effb(0x174)});return undefined;}async function resolveSegmentFromOptions(_0x2a67a5,_0x27618b){const _0x56e8ef=a16_0x2907;if(!_0x2a67a5['segment'])return{};const _0x422dae=_0x2a67a5[_0x56e8ef(0x170)],_0x129011=await _0x27618b['segment']['resolvePathToResource'](_0x422dae);return{'audienceId':_0x129011['parentId'],'audienceName':_0x129011[_0x56e8ef(0x17e)],..._0x129011['segmentId']&&{'segmentId':_0x129011['segmentId'],'segmentName':_0x129011[_0x56e8ef(0x16a)]}};}function buildConnectorConfig(_0x536ce3){const _0x5ebe55=a16_0x2907,_0x45c440=_0x536ce3[_0x5ebe55(0x130)],_0x1e4957=_0x536ce3[_0x5ebe55(0x105)];if(!_0x45c440&&!_0x1e4957)return undefined;return{..._0x45c440&&{'emailSenderId':_0x45c440},..._0x1e4957&&{'jsonColumns':_0x1e4957}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x5e736d(0x124)]='engage:campaigns';[a16_0x5e736d(0x118)]=a16_0x5e736d(0x126);async[a16_0x5e736d(0x127)](_0x12ef8b){const _0x14e157=a16_0x5e736d,{options:_0x43db33,args:_0x59d0b3,tdx:_0x303e5d}=_0x12ef8b,_0x5619bb=_0x59d0b3[0x0],_0x47ff1d=resolveLimit(_0x43db33[_0x14e157(0x122)],DEFAULT_LLM_LIMIT),_0xaca6b2=_0x43db33,_0x106993=_0xaca6b2[_0x14e157(0x147)],_0x2ac5f8=_0xaca6b2[_0x14e157(0x159)],_0x1ce1b5=await resolveWorkspaceIdFromOptions(_0xaca6b2,_0x303e5d),_0x1ed280=await withSpinner(_0x14e157(0x109),()=>_0x303e5d[_0x14e157(0x165)][_0x14e157(0x184)]({'type':_0x106993,'status':_0x2ac5f8,'workspaceId':_0x1ce1b5,'limit':_0x47ff1d}),{'verbose':_0x43db33[_0x14e157(0x13c)]});let _0x42a456=_0x1ed280[_0x14e157(0x177)];return _0x5619bb&&(_0x42a456=_0x1ed280[_0x14e157(0x177)][_0x14e157(0x151)](_0x5b208d=>matchGlobPattern(_0x5b208d[_0x14e157(0x124)],_0x5619bb))),await handleSDKOutput(_0x42a456,_0x43db33),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x172);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x15b);async[a16_0x5e736d(0x127)](_0x435b4d){const _0x462e9b=a16_0x5e736d,{options:_0x2aeb9f,args:_0x2da79a,tdx:_0x2a1ca0}=_0x435b4d;if(_0x2da79a[_0x462e9b(0x15d)]===0x0)return console[_0x462e9b(0x12e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x462e9b(0x12e)](_0x462e9b(0x16f)),0x1;const _0x1e3d22=_0x2da79a[0x0],_0x457761=_0x2aeb9f,_0x41033e=await resolveWorkspaceIdFromOptions(_0x457761,_0x2a1ca0),_0x3bc55f=_0x457761[_0x462e9b(0x17c)];if(_0x3bc55f){const _0x1d07b3=await withSpinner('Fetching\x20campaign\x20\x27'+_0x1e3d22+_0x462e9b(0x120),()=>_0x2a1ca0[_0x462e9b(0x165)][_0x462e9b(0x13e)](_0x1e3d22,_0x41033e),{'verbose':_0x2aeb9f[_0x462e9b(0x13c)]});await handleSDKOutput([_0x1d07b3],_0x2aeb9f);}else{const _0x170158=await withSpinner(_0x462e9b(0x169)+_0x1e3d22+_0x462e9b(0x120),()=>_0x2a1ca0['engage']['getCampaign'](_0x1e3d22,_0x41033e),{'verbose':_0x2aeb9f[_0x462e9b(0x13c)]});await handleSDKOutput([_0x170158],_0x2aeb9f);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x11d);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x183);async[a16_0x5e736d(0x127)](_0x50b099){const _0x25f7e1=a16_0x5e736d,{options:_0x3a33e4,tdx:_0x1faa4f}=_0x50b099,_0x2d3045=_0x3a33e4,_0x349c1a=_0x2d3045[_0x25f7e1(0x124)],_0x1ed891=_0x2d3045[_0x25f7e1(0x147)];if(!_0x349c1a)return console['error'](_0x25f7e1(0x182)),console[_0x25f7e1(0x12e)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x1ed891)return console['error'](_0x25f7e1(0x16c)),console[_0x25f7e1(0x12e)](_0x25f7e1(0x154)),0x1;const _0x1b1a66=await resolveWorkspaceIdFromOptions(_0x2d3045,_0x1faa4f,!![]),_0x301ed4=await resolveSegmentFromOptions(_0x2d3045,_0x1faa4f),_0x1b5e6f=buildConnectorConfig(_0x2d3045),_0x33663b={'name':_0x349c1a,'campaignType':_0x1ed891,'workspaceId':_0x1b1a66,'description':_0x2d3045[_0x25f7e1(0x118)],..._0x301ed4,'connectorConfig':_0x1b5e6f,'startAt':_0x2d3045[_0x25f7e1(0x10d)],'timezone':_0x2d3045['timezone']},_0x233177=await withSpinner(_0x25f7e1(0x115)+_0x349c1a+_0x25f7e1(0x120),()=>_0x1faa4f[_0x25f7e1(0x165)][_0x25f7e1(0x164)](_0x33663b));return await handleSDKOutput([_0x233177['data']],_0x3a33e4),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x12a);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x13d);async[a16_0x5e736d(0x127)](_0x36c1d7){const _0x786f1f=a16_0x5e736d,{options:_0x4b0530,args:_0x26ce99,tdx:_0x559932}=_0x36c1d7;if(_0x26ce99[_0x786f1f(0x15d)]===0x0)return console[_0x786f1f(0x12e)](_0x786f1f(0x13f)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x11ff21=_0x26ce99[0x0],_0x1643b3=_0x4b0530,_0x3895db=await resolveWorkspaceIdFromOptions(_0x1643b3,_0x559932),_0x254225=await resolveSegmentFromOptions(_0x1643b3,_0x559932),_0x3ac9dc=buildConnectorConfig(_0x1643b3),_0x49b098={'name':_0x1643b3[_0x786f1f(0x124)],'description':_0x1643b3[_0x786f1f(0x118)],..._0x254225,'connectorConfig':_0x3ac9dc,'startAt':_0x1643b3[_0x786f1f(0x10d)],'timezone':_0x1643b3[_0x786f1f(0xfd)]},_0x32f6ba=Object[_0x786f1f(0x102)](Object['entries'](_0x49b098)[_0x786f1f(0x151)](([,_0x4355f7])=>_0x4355f7!==undefined));if(Object[_0x786f1f(0x10f)](_0x32f6ba)[_0x786f1f(0x15d)]===0x0)return console[_0x786f1f(0x12e)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x786f1f(0x12e)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x28819d=await withSpinner('Updating\x20campaign\x20\x27'+_0x11ff21+_0x786f1f(0x120),()=>_0x559932[_0x786f1f(0x165)][_0x786f1f(0x149)](_0x11ff21,_0x32f6ba,_0x3895db),{'verbose':_0x4b0530['verbose']});return await handleSDKOutput([_0x28819d[_0x786f1f(0x177)]],_0x4b0530),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a16_0x5e736d(0x166);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x125);async['execute'](_0x276a55){const _0x45d643=a16_0x5e736d,{options:_0x575e10,args:_0x374767,tdx:_0x51cc9f}=_0x276a55;if(_0x374767[_0x45d643(0x15d)]===0x0)return console[_0x45d643(0x12e)](_0x45d643(0x13f)),console[_0x45d643(0x12e)](_0x45d643(0x137)),0x1;const _0x37e232=_0x374767[0x0],_0x55286b=_0x575e10,_0x3a0968=await resolveWorkspaceIdFromOptions(_0x55286b,_0x51cc9f);if(!_0x575e10[_0x45d643(0x11c)]){const _0xe000a8=await confirm(_0x45d643(0x143)+_0x37e232+_0x45d643(0x168));if(!_0xe000a8)return console[_0x45d643(0x12f)](_0x45d643(0x10a)),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x37e232+'\x27...',()=>_0x51cc9f['engage'][_0x45d643(0x10c)](_0x37e232,_0x3a0968),{'verbose':_0x575e10[_0x45d643(0x13c)]}),console[_0x45d643(0x12f)](_0x45d643(0x173)+_0x37e232+_0x45d643(0x153)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']=a16_0x5e736d(0x161);['description']='Launch\x20a\x20campaign';async[a16_0x5e736d(0x127)](_0x1364f1){const _0x2d57dc=a16_0x5e736d,{options:_0x5ce386,args:_0x5a510f,tdx:_0x34e752}=_0x1364f1;if(_0x5a510f['length']===0x0)return console[_0x2d57dc(0x12e)](_0x2d57dc(0x13f)),console[_0x2d57dc(0x12e)]('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0x3e5c74=_0x5a510f[0x0],_0x553cf2=_0x5ce386,_0x12642b=await resolveWorkspaceIdFromOptions(_0x553cf2,_0x34e752);return await withSpinner(_0x2d57dc(0x17b)+_0x3e5c74+_0x2d57dc(0x120),()=>_0x34e752[_0x2d57dc(0x165)][_0x2d57dc(0x15e)](_0x3e5c74,_0x12642b),{'verbose':_0x5ce386[_0x2d57dc(0x13c)]}),console[_0x2d57dc(0x12f)]('Campaign\x20\x27'+_0x3e5c74+_0x2d57dc(0x132)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']='engage:campaign:pause';[a16_0x5e736d(0x118)]='Pause\x20a\x20campaign';async[a16_0x5e736d(0x127)](_0x31fa18){const _0x2416a7=a16_0x5e736d,{options:_0x2cd5cf,args:_0x4b7c4a,tdx:_0x316e33}=_0x31fa18;if(_0x4b7c4a[_0x2416a7(0x15d)]===0x0)return console[_0x2416a7(0x12e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x2416a7(0x12e)](_0x2416a7(0x155)),0x1;const _0x482ebb=_0x4b7c4a[0x0],_0x32c201=_0x2cd5cf,_0x40709e=await resolveWorkspaceIdFromOptions(_0x32c201,_0x316e33);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x482ebb+_0x2416a7(0x120),()=>_0x316e33[_0x2416a7(0x165)]['pauseCampaign'](_0x482ebb,_0x40709e),{'verbose':_0x2cd5cf['verbose']}),console[_0x2416a7(0x12f)](_0x2416a7(0x173)+_0x482ebb+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x180);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x107);async[a16_0x5e736d(0x127)](_0x4516ce){const _0x2966f5=a16_0x5e736d,{options:_0x5f2f38,args:_0x55a236,tdx:_0x1c16a2}=_0x4516ce;if(_0x55a236[_0x2966f5(0x15d)]===0x0)return console['error'](_0x2966f5(0x13f)),console[_0x2966f5(0x12e)](_0x2966f5(0x103)),0x1;const _0x8e1e83=_0x55a236[0x0],_0x8ac29b=_0x5f2f38,_0x27ca2d=await resolveWorkspaceIdFromOptions(_0x8ac29b,_0x1c16a2);return await withSpinner(_0x2966f5(0x111)+_0x8e1e83+_0x2966f5(0x120),()=>_0x1c16a2['engage'][_0x2966f5(0x15a)](_0x8e1e83,_0x27ca2d),{'verbose':_0x5f2f38['verbose']}),console['log']('Campaign\x20\x27'+_0x8e1e83+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x142);['description']=a16_0x5e736d(0x11e);async['execute'](_0xabd057){const _0x427656=a16_0x5e736d,{options:_0x491033,args:_0x3db721,tdx:_0x4e7fe4}=_0xabd057;if(_0x3db721['length']===0x0)return console[_0x427656(0x12e)](_0x427656(0x13f)),console[_0x427656(0x12e)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x5b7a4f=_0x3db721[0x0],_0x51f70d=_0x491033,_0x41ddad=await resolveWorkspaceIdFromOptions(_0x51f70d,_0x4e7fe4),_0x3148c6=await withSpinner(_0x427656(0xfe)+_0x5b7a4f+_0x427656(0x120),()=>_0x4e7fe4[_0x427656(0x165)]['duplicateCampaign'](_0x5b7a4f,_0x41ddad),{'verbose':_0x491033[_0x427656(0x13c)]});return await handleSDKOutput([_0x3148c6[_0x427656(0x177)]],_0x491033),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a16_0x5e736d(0x13b);['description']='List\x20email\x20templates';async[a16_0x5e736d(0x127)](_0x49b81f){const _0xecca9=a16_0x5e736d,{options:_0x581cdd,args:_0x43e2b5,tdx:_0x4204ae}=_0x49b81f,_0x3f5afd=_0x43e2b5[0x0],_0x22a4b3=resolveLimit(_0x581cdd[_0xecca9(0x122)],DEFAULT_LLM_LIMIT),_0x576986=_0x581cdd,_0x2cb004=await resolveWorkspaceIdFromOptions(_0x576986,_0x4204ae),_0x16b85a=await withSpinner(_0xecca9(0x185),()=>_0x4204ae[_0xecca9(0x165)]['listTemplates']({'workspaceId':_0x2cb004,'limit':_0x22a4b3}),{'verbose':_0x581cdd[_0xecca9(0x13c)]});let _0x9aec67=_0x16b85a[_0xecca9(0x177)];return _0x3f5afd&&(_0x9aec67=_0x16b85a[_0xecca9(0x177)][_0xecca9(0x151)](_0x1c62bb=>matchGlobPattern(_0x1c62bb['name'],_0x3f5afd))),await handleSDKOutput(_0x9aec67,_0x581cdd),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x119);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x101);async[a16_0x5e736d(0x127)](_0x2b6264){const _0x35f569=a16_0x5e736d,{options:_0x1ddc38,args:_0x37f4dd,tdx:_0x3e814c}=_0x2b6264;if(_0x37f4dd[_0x35f569(0x15d)]===0x0)return console[_0x35f569(0x12e)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x35f569(0x12e)](_0x35f569(0x186)),0x1;const _0x20ee86=_0x37f4dd[0x0],_0x5558d6=_0x1ddc38,_0x57a418=await resolveWorkspaceIdFromOptions(_0x5558d6,_0x3e814c),_0x4f1abe=_0x5558d6[_0x35f569(0x17c)];if(_0x4f1abe){const _0x1b57ef=await withSpinner(_0x35f569(0x14b)+_0x20ee86+_0x35f569(0x120),()=>_0x3e814c[_0x35f569(0x165)][_0x35f569(0xfc)](_0x20ee86,_0x57a418),{'verbose':_0x1ddc38[_0x35f569(0x13c)]});await handleSDKOutput([_0x1b57ef],_0x1ddc38);}else{const _0x30b5d3=await withSpinner(_0x35f569(0x14b)+_0x20ee86+_0x35f569(0x120),()=>_0x3e814c[_0x35f569(0x165)]['getTemplate'](_0x20ee86,_0x57a418),{'verbose':_0x1ddc38[_0x35f569(0x13c)]});await handleSDKOutput([_0x30b5d3],_0x1ddc38);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x17f);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x11a);async[a16_0x5e736d(0x127)](_0xa15130){const _0x16904e=a16_0x5e736d,{options:_0x2c782b,tdx:_0x439487}=_0xa15130,_0x27b46c=_0x2c782b,_0x1c6c98=_0x27b46c[_0x16904e(0x124)],_0x7a5272=_0x27b46c[_0x16904e(0x12d)],_0x58d8cf=_0x27b46c[_0x16904e(0x113)];if(!_0x1c6c98)return console[_0x16904e(0x12e)](_0x16904e(0x182)),console['error']('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x7a5272)return console['error'](_0x16904e(0x179)),0x1;if(!_0x58d8cf)return console['error'](_0x16904e(0x10b)),0x1;const _0x25283=await resolveWorkspaceIdFromOptions(_0x27b46c,_0x439487,!![]),_0x378c8d={'name':_0x1c6c98,'subjectTemplate':_0x7a5272,'htmlTemplate':_0x58d8cf,'workspaceId':_0x25283,'plaintextTemplate':_0x27b46c['plaintext'],'editorType':_0x27b46c['editorType']},_0x1f1b0e=await withSpinner(_0x16904e(0x134)+_0x1c6c98+_0x16904e(0x120),()=>_0x439487['engage']['createTemplate'](_0x378c8d));return await handleSDKOutput([_0x1f1b0e[_0x16904e(0x177)]],_0x2c782b),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x162);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x176);async[a16_0x5e736d(0x127)](_0xf93ff){const _0x17afef=a16_0x5e736d,{options:_0x416f91,args:_0x281348,tdx:_0x3e1e04}=_0xf93ff;if(_0x281348['length']===0x0)return console[_0x17afef(0x12e)](_0x17afef(0x14d)),console[_0x17afef(0x12e)](_0x17afef(0x152)),0x1;const _0x176176=_0x281348[0x0],_0x4a00eb=_0x416f91,_0x364897=await resolveWorkspaceIdFromOptions(_0x4a00eb,_0x3e1e04),_0x5e1d96={'name':_0x4a00eb[_0x17afef(0x124)],'subjectTemplate':_0x4a00eb['subject'],'htmlTemplate':_0x4a00eb[_0x17afef(0x113)],'plaintextTemplate':_0x4a00eb[_0x17afef(0x135)]},_0x30d023=Object[_0x17afef(0x102)](Object['entries'](_0x5e1d96)[_0x17afef(0x151)](([,_0x5e04f5])=>_0x5e04f5!==undefined));if(Object[_0x17afef(0x10f)](_0x30d023)[_0x17afef(0x15d)]===0x0)return console[_0x17afef(0x12e)](_0x17afef(0x175)),console['error'](_0x17afef(0x112)),0x1;const _0x2d59e0=await withSpinner('Updating\x20template\x20\x27'+_0x176176+_0x17afef(0x120),()=>_0x3e1e04[_0x17afef(0x165)][_0x17afef(0x139)](_0x176176,_0x30d023,_0x364897),{'verbose':_0x416f91['verbose']});return await handleSDKOutput([_0x2d59e0['data']],_0x416f91),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x17d);['description']=a16_0x5e736d(0x16e);async[a16_0x5e736d(0x127)](_0x8fb6fa){const _0x5a1e61=a16_0x5e736d,{options:_0xdcd353,args:_0x52ff26,tdx:_0x4508f6}=_0x8fb6fa;if(_0x52ff26['length']===0x0)return console[_0x5a1e61(0x12e)](_0x5a1e61(0x14d)),console[_0x5a1e61(0x12e)](_0x5a1e61(0x167)),0x1;const _0x4488f6=_0x52ff26[0x0],_0xb9187f=_0xdcd353,_0x24a4da=await resolveWorkspaceIdFromOptions(_0xb9187f,_0x4508f6);if(!_0xdcd353[_0x5a1e61(0x11c)]){const _0x3131c9=await confirm(_0x5a1e61(0x100)+_0x4488f6+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x3131c9)return console[_0x5a1e61(0x12f)](_0x5a1e61(0x10a)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x4488f6+_0x5a1e61(0x120),()=>_0x4508f6[_0x5a1e61(0x165)]['deleteTemplate'](_0x4488f6,_0x24a4da),{'verbose':_0xdcd353[_0x5a1e61(0x13c)]}),console[_0x5a1e61(0x12f)](_0x5a1e61(0x13a)+_0x4488f6+_0x5a1e61(0x153)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']=a16_0x5e736d(0x128);['description']=a16_0x5e736d(0x145);async['execute'](_0x2dea34){const _0x18eda=a16_0x5e736d,{options:_0x2eaa75,args:_0x376a6e,tdx:_0x9b5409}=_0x2dea34,_0x5ef169=_0x376a6e[0x0],_0x24857a=resolveLimit(_0x2eaa75[_0x18eda(0x122)],DEFAULT_LLM_LIMIT),_0x310fab=await withSpinner(_0x18eda(0x10e),()=>_0x9b5409[_0x18eda(0x165)]['listWorkspaces']({'limit':_0x24857a}),{'verbose':_0x2eaa75['verbose']});let _0x10b0c4=_0x310fab['data'];return _0x5ef169&&(_0x10b0c4=_0x310fab[_0x18eda(0x177)][_0x18eda(0x151)](_0x325e9e=>matchGlobPattern(_0x325e9e[_0x18eda(0x124)],_0x5ef169))),await handleSDKOutput(_0x10b0c4,_0x2eaa75),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x15c);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x141);async[a16_0x5e736d(0x127)](_0x36cdea){const _0x3083f9=a16_0x5e736d,{options:_0x1a34b1,args:_0x3e9827,tdx:_0x373aa1}=_0x36cdea;if(_0x3e9827['length']===0x0)return console[_0x3083f9(0x12e)](_0x3083f9(0xfb)),console['error'](_0x3083f9(0x160)),0x1;const _0x17ce1f=_0x3e9827[0x0],_0x422b2f=_0x1a34b1,_0x518dfd=_0x422b2f[_0x3083f9(0x17c)];if(_0x518dfd){const _0xf44bc8=await withSpinner(_0x3083f9(0xff)+_0x17ce1f+_0x3083f9(0x120),()=>_0x373aa1['engage'][_0x3083f9(0x114)](_0x17ce1f),{'verbose':_0x1a34b1[_0x3083f9(0x13c)]});await handleSDKOutput([_0xf44bc8],_0x1a34b1);}else{const _0x42e001=await withSpinner(_0x3083f9(0xff)+_0x17ce1f+_0x3083f9(0x120),()=>_0x373aa1[_0x3083f9(0x165)][_0x3083f9(0x11b)](_0x17ce1f),{'verbose':_0x1a34b1[_0x3083f9(0x13c)]});await handleSDKOutput([_0x42e001],_0x1a34b1);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a16_0x5e736d(0x14c);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x140);async[a16_0x5e736d(0x127)](_0x152d5e){const _0x1230ea=a16_0x5e736d,{options:_0x846cf3,tdx:_0x2d4b9c}=_0x152d5e,_0x3c0277=_0x846cf3,_0x1070d1=_0x3c0277[_0x1230ea(0x124)];if(!_0x1070d1)return console['error'](_0x1230ea(0x182)),console[_0x1230ea(0x12e)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x53f16b={'name':_0x1070d1,'description':_0x3c0277['description']},_0x2930db=await withSpinner(_0x1230ea(0x11f)+_0x1070d1+_0x1230ea(0x120),()=>_0x2d4b9c[_0x1230ea(0x165)][_0x1230ea(0x15f)](_0x53f16b));return await handleSDKOutput([_0x2930db[_0x1230ea(0x177)]],_0x846cf3),0x0;}}function a16_0x2907(_0x6f9a0b,_0x520ef4){_0x6f9a0b=_0x6f9a0b-0xfa;const _0x14922a=a16_0x1492();let _0x290779=_0x14922a[_0x6f9a0b];return _0x290779;}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x12c);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x14a);async[a16_0x5e736d(0x127)](_0x4f566e){const _0x1ba3de=a16_0x5e736d,{options:_0x4f98d,args:_0x2f7e73,tdx:_0x2b0a2b}=_0x4f566e;if(_0x2f7e73[_0x1ba3de(0x15d)]===0x0)return console['error'](_0x1ba3de(0xfb)),console[_0x1ba3de(0x12e)](_0x1ba3de(0x106)),0x1;const _0x530cce=_0x2f7e73[0x0],_0x13b6a6=_0x4f98d,_0x5713d4={'name':_0x13b6a6[_0x1ba3de(0x124)],'description':_0x13b6a6[_0x1ba3de(0x118)]},_0x1aefd2=Object['fromEntries'](Object[_0x1ba3de(0x136)](_0x5713d4)[_0x1ba3de(0x151)](([,_0x292623])=>_0x292623!==undefined));if(Object[_0x1ba3de(0x10f)](_0x1aefd2)[_0x1ba3de(0x15d)]===0x0)return console[_0x1ba3de(0x12e)](_0x1ba3de(0x175)),console['error'](_0x1ba3de(0x121)),0x1;const _0x26ee99=await withSpinner('Updating\x20workspace\x20\x27'+_0x530cce+_0x1ba3de(0x120),()=>_0x2b0a2b[_0x1ba3de(0x165)][_0x1ba3de(0x156)](_0x530cce,_0x1aefd2),{'verbose':_0x4f98d[_0x1ba3de(0x13c)]});return await handleSDKOutput([_0x26ee99[_0x1ba3de(0x177)]],_0x4f98d),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']=a16_0x5e736d(0x178);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x148);async[a16_0x5e736d(0x127)](_0x36c3db){const _0x20e19b=a16_0x5e736d,{options:_0x16d9f5,args:_0x3f1b50,tdx:_0xc3572a}=_0x36c3db;if(_0x3f1b50[_0x20e19b(0x15d)]===0x0)return console['error'](_0x20e19b(0xfb)),console[_0x20e19b(0x12e)](_0x20e19b(0x104)),0x1;const _0x48c2af=_0x3f1b50[0x0];if(!_0x16d9f5[_0x20e19b(0x11c)]){const _0x32e6d1=await confirm(_0x20e19b(0x181)+_0x48c2af+_0x20e19b(0x168));if(!_0x32e6d1)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner(_0x20e19b(0x138)+_0x48c2af+_0x20e19b(0x120),()=>_0xc3572a[_0x20e19b(0x165)]['deleteWorkspace'](_0x48c2af),{'verbose':_0x16d9f5['verbose']}),console['log'](_0x20e19b(0x117)+_0x48c2af+_0x20e19b(0x153)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0x5e736d(0x124)]=a16_0x5e736d(0x158);[a16_0x5e736d(0x118)]=a16_0x5e736d(0x16b);async[a16_0x5e736d(0x127)](_0x45e44c){const _0x2dce97=a16_0x5e736d,{options:_0x20abf9,args:_0x4aa414,tdx:_0x1c6c31}=_0x45e44c;if(_0x4aa414[_0x2dce97(0x15d)]===0x0)return console[_0x2dce97(0x12e)](_0x2dce97(0x129)),console['error'](_0x2dce97(0x110)),0x1;const _0x1c38dc=_0x4aa414[0x0];await withSpinner(_0x2dce97(0x14f)+_0x1c38dc+_0x2dce97(0x120),()=>_0x1c6c31[_0x2dce97(0x165)][_0x2dce97(0x131)](_0x1c38dc));const _0x17efa5=_0x20abf9[_0x2dce97(0x123)]||undefined;return saveSessionContext({'engage_workspace':_0x1c38dc},_0x17efa5),console[_0x2dce97(0x12f)](_0x2dce97(0x157)+_0x1c38dc),console['log'](_0x2dce97(0x133)),0x0;}}
1
+ const a16_0xbd0ff6=a16_0x1c53;(function(_0xb23aff,_0xadc1a0){const _0x23d672=a16_0x1c53,_0x1ac45a=_0xb23aff();while(!![]){try{const _0x181d42=-parseInt(_0x23d672(0xc8))/0x1+parseInt(_0x23d672(0xc2))/0x2+parseInt(_0x23d672(0xa0))/0x3+-parseInt(_0x23d672(0xb9))/0x4+parseInt(_0x23d672(0xc7))/0x5+-parseInt(_0x23d672(0xe1))/0x6*(-parseInt(_0x23d672(0x10d))/0x7)+-parseInt(_0x23d672(0xf8))/0x8*(parseInt(_0x23d672(0xa7))/0x9);if(_0x181d42===_0xadc1a0)break;else _0x1ac45a['push'](_0x1ac45a['shift']());}catch(_0x5ba275){_0x1ac45a['push'](_0x1ac45a['shift']());}}}(a16_0x5031,0x76bfc));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(_0x4717d6,_0x5f59d1,_0x142b12=![]){const _0x373d3c=a16_0x1c53;if(_0x4717d6[_0x373d3c(0xcf)])return await _0x5f59d1['engage'][_0x373d3c(0x93)](_0x4717d6['workspace']);const _0x221b9d=loadSessionContext(_0x4717d6[_0x373d3c(0x8c)]);if(_0x221b9d?.['engage_workspace'])return await _0x5f59d1[_0x373d3c(0xe7)][_0x373d3c(0x93)](_0x221b9d[_0x373d3c(0x102)]);if(_0x142b12)throw new SDKError(ErrorCode[_0x373d3c(0x8d)],_0x373d3c(0xa1),undefined,{'helpText':_0x373d3c(0xb0)});return undefined;}async function resolveSegmentFromOptions(_0x4dff29,_0x5838eb){const _0x1bd226=a16_0x1c53;if(!_0x4dff29[_0x1bd226(0x8a)])return{};const _0x25be90=_0x4dff29[_0x1bd226(0x8a)],_0x4138aa=await _0x5838eb['segment'][_0x1bd226(0x8f)](_0x25be90);return{'audienceId':_0x4138aa['parentId'],'audienceName':_0x4138aa[_0x1bd226(0xf1)],..._0x4138aa[_0x1bd226(0x103)]&&{'segmentId':_0x4138aa[_0x1bd226(0x103)],'segmentName':_0x4138aa[_0x1bd226(0x99)]}};}function a16_0x1c53(_0xabba9e,_0x213d1c){_0xabba9e=_0xabba9e-0x7d;const _0x50319c=a16_0x5031();let _0x1c5328=_0x50319c[_0xabba9e];return _0x1c5328;}function buildConnectorConfig(_0x365e1e){const _0x39dea5=a16_0x1c53,_0x38cdf5=_0x365e1e[_0x39dea5(0xa2)],_0x2184f9=_0x365e1e['jsonColumns'];if(!_0x38cdf5&&!_0x2184f9)return undefined;return{..._0x38cdf5&&{'emailSenderId':_0x38cdf5},..._0x2184f9&&{'jsonColumns':_0x2184f9}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a16_0xbd0ff6(0xb5);['description']=a16_0xbd0ff6(0x8b);async[a16_0xbd0ff6(0xa9)](_0x3754c5){const _0x329243=a16_0xbd0ff6,{options:_0x256613,args:_0x1bffc3,tdx:_0x1edbce}=_0x3754c5,_0x46e4e5=_0x1bffc3[0x0],_0x447cc1=resolveLimit(_0x256613['limit'],DEFAULT_LLM_LIMIT),_0x579f53=_0x256613,_0x21a731=_0x579f53[_0x329243(0xc3)],_0xf2a78=_0x579f53['status'],_0x14466a=await resolveWorkspaceIdFromOptions(_0x579f53,_0x1edbce),_0x39c96f=await withSpinner(_0x329243(0xcc),()=>_0x1edbce[_0x329243(0xe7)]['listCampaigns']({'type':_0x21a731,'status':_0xf2a78,'workspaceId':_0x14466a,'limit':_0x447cc1}),{'verbose':_0x256613['verbose']});let _0x475e25=_0x39c96f[_0x329243(0xbd)];return _0x46e4e5&&(_0x475e25=_0x39c96f[_0x329243(0xbd)]['filter'](_0x15c4d2=>matchGlobPattern(_0x15c4d2[_0x329243(0xb3)],_0x46e4e5))),await handleSDKOutput(_0x475e25,_0x256613),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0x84);[a16_0xbd0ff6(0x7f)]=a16_0xbd0ff6(0x107);async[a16_0xbd0ff6(0xa9)](_0x2aef6f){const _0x18f6ef=a16_0xbd0ff6,{options:_0x4e0533,args:_0x417704,tdx:_0x2351f8}=_0x2aef6f;if(_0x417704[_0x18f6ef(0xae)]===0x0)return console[_0x18f6ef(0xec)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x2806b9=_0x417704[0x0],_0x2f775d=_0x4e0533,_0x45d791=await resolveWorkspaceIdFromOptions(_0x2f775d,_0x2351f8),_0x375a1a=_0x2f775d[_0x18f6ef(0xc6)];if(_0x375a1a){const _0x2dc6c1=await withSpinner(_0x18f6ef(0x109)+_0x2806b9+_0x18f6ef(0x105),()=>_0x2351f8[_0x18f6ef(0xe7)][_0x18f6ef(0xb6)](_0x2806b9,_0x45d791),{'verbose':_0x4e0533[_0x18f6ef(0xca)]});await handleSDKOutput([_0x2dc6c1],_0x4e0533);}else{const _0x5a5d4c=await withSpinner(_0x18f6ef(0x109)+_0x2806b9+_0x18f6ef(0x105),()=>_0x2351f8[_0x18f6ef(0xe7)][_0x18f6ef(0x88)](_0x2806b9,_0x45d791),{'verbose':_0x4e0533[_0x18f6ef(0xca)]});await handleSDKOutput([_0x5a5d4c],_0x4e0533);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0xbf);['description']=a16_0xbd0ff6(0x10c);async['execute'](_0x47b23e){const _0x2521af=a16_0xbd0ff6,{options:_0xc82ee4,tdx:_0x2bc44e}=_0x47b23e,_0x47d8dd=_0xc82ee4,_0x12d076=_0x47d8dd[_0x2521af(0xb3)],_0x15b9da=_0x47d8dd[_0x2521af(0xc3)];if(!_0x12d076)return console[_0x2521af(0xec)](_0x2521af(0xd5)),console[_0x2521af(0xec)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x15b9da)return console[_0x2521af(0xec)]('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0x2521af(0xec)](_0x2521af(0xbb)),0x1;const _0x43b295=await resolveWorkspaceIdFromOptions(_0x47d8dd,_0x2bc44e,!![]),_0x2db90c=await resolveSegmentFromOptions(_0x47d8dd,_0x2bc44e),_0x10a3b7=buildConnectorConfig(_0x47d8dd),_0x5b1cd1={'name':_0x12d076,'campaignType':_0x15b9da,'workspaceId':_0x43b295,'description':_0x47d8dd[_0x2521af(0x7f)],..._0x2db90c,'connectorConfig':_0x10a3b7,'startAt':_0x47d8dd[_0x2521af(0xc4)],'timezone':_0x47d8dd['timezone']},_0x3be834=await withSpinner(_0x2521af(0x97)+_0x12d076+_0x2521af(0x105),()=>_0x2bc44e[_0x2521af(0xe7)]['createCampaign'](_0x5b1cd1));return await handleSDKOutput([_0x3be834[_0x2521af(0xbd)]],_0xc82ee4),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0x10a);['description']=a16_0xbd0ff6(0x101);async['execute'](_0x496eef){const _0x3f8108=a16_0xbd0ff6,{options:_0x3bc265,args:_0x41d185,tdx:_0x4be97d}=_0x496eef;if(_0x41d185[_0x3f8108(0xae)]===0x0)return console[_0x3f8108(0xec)](_0x3f8108(0x96)),console[_0x3f8108(0xec)](_0x3f8108(0xe3)),0x1;const _0x201c0a=_0x41d185[0x0],_0x5e60bf=_0x3bc265,_0x22d385=await resolveWorkspaceIdFromOptions(_0x5e60bf,_0x4be97d),_0x328a6c=await resolveSegmentFromOptions(_0x5e60bf,_0x4be97d),_0xa279c4=buildConnectorConfig(_0x5e60bf),_0x3ffb25={'name':_0x5e60bf[_0x3f8108(0xb3)],'description':_0x5e60bf[_0x3f8108(0x7f)],..._0x328a6c,'connectorConfig':_0xa279c4,'startAt':_0x5e60bf[_0x3f8108(0xc4)],'timezone':_0x5e60bf[_0x3f8108(0xc1)]},_0x598e83=Object[_0x3f8108(0xb7)](Object['entries'](_0x3ffb25)['filter'](([,_0x1862b4])=>_0x1862b4!==undefined));if(Object['keys'](_0x598e83)['length']===0x0)return console[_0x3f8108(0xec)](_0x3f8108(0xbc)),console[_0x3f8108(0xec)](_0x3f8108(0xdf)),0x1;const _0x59476f=await withSpinner('Updating\x20campaign\x20\x27'+_0x201c0a+_0x3f8108(0x105),()=>_0x4be97d['engage'][_0x3f8108(0x92)](_0x201c0a,_0x598e83,_0x22d385),{'verbose':_0x3bc265['verbose']});return await handleSDKOutput([_0x59476f[_0x3f8108(0xbd)]],_0x3bc265),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a16_0xbd0ff6(0xd1);[a16_0xbd0ff6(0x7f)]=a16_0xbd0ff6(0xa6);async[a16_0xbd0ff6(0xa9)](_0xe96bcb){const _0x45c53=a16_0xbd0ff6,{options:_0x3fab63,args:_0x547f91,tdx:_0x47ff0b}=_0xe96bcb;if(_0x547f91[_0x45c53(0xae)]===0x0)return console[_0x45c53(0xec)](_0x45c53(0x96)),console['error'](_0x45c53(0xed)),0x1;const _0x5c1bf9=_0x547f91[0x0],_0x5b5c21=_0x3fab63,_0x322485=await resolveWorkspaceIdFromOptions(_0x5b5c21,_0x47ff0b);if(!_0x3fab63[_0x45c53(0xb2)]){const _0x2734c8=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x5c1bf9+_0x45c53(0x90));if(!_0x2734c8)return console[_0x45c53(0xd6)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x45c53(0xef)+_0x5c1bf9+_0x45c53(0x105),()=>_0x47ff0b[_0x45c53(0xe7)][_0x45c53(0xaa)](_0x5c1bf9,_0x322485),{'verbose':_0x3fab63[_0x45c53(0xca)]}),console[_0x45c53(0xd6)]('Campaign\x20\x27'+_0x5c1bf9+_0x45c53(0xba)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0x104);['description']=a16_0xbd0ff6(0xa3);async['execute'](_0x12df5f){const _0x18af5c=a16_0xbd0ff6,{options:_0x5e1bae,args:_0x255911,tdx:_0xc2f77c}=_0x12df5f;if(_0x255911['length']===0x0)return console[_0x18af5c(0xec)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x18af5c(0xec)](_0x18af5c(0xe2)),0x1;const _0x228996=_0x255911[0x0],_0x1d38d3=_0x5e1bae,_0xee1b42=await resolveWorkspaceIdFromOptions(_0x1d38d3,_0xc2f77c);return await withSpinner('Launching\x20campaign\x20\x27'+_0x228996+'\x27...',()=>_0xc2f77c[_0x18af5c(0xe7)][_0x18af5c(0xd7)](_0x228996,_0xee1b42),{'verbose':_0x5e1bae[_0x18af5c(0xca)]}),console[_0x18af5c(0xd6)](_0x18af5c(0x98)+_0x228996+_0x18af5c(0xeb)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0xa4);[a16_0xbd0ff6(0x7f)]='Pause\x20a\x20campaign';async[a16_0xbd0ff6(0xa9)](_0xdf80e3){const _0x24760c=a16_0xbd0ff6,{options:_0x1f5b21,args:_0x7f5ad0,tdx:_0x286b3c}=_0xdf80e3;if(_0x7f5ad0[_0x24760c(0xae)]===0x0)return console[_0x24760c(0xec)](_0x24760c(0x96)),console[_0x24760c(0xec)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x341910=_0x7f5ad0[0x0],_0x29c7d8=_0x1f5b21,_0xcca988=await resolveWorkspaceIdFromOptions(_0x29c7d8,_0x286b3c);return await withSpinner(_0x24760c(0xc9)+_0x341910+_0x24760c(0x105),()=>_0x286b3c[_0x24760c(0xe7)][_0x24760c(0x94)](_0x341910,_0xcca988),{'verbose':_0x1f5b21[_0x24760c(0xca)]}),console[_0x24760c(0xd6)](_0x24760c(0x98)+_0x341910+_0x24760c(0xdc)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0x9b);[a16_0xbd0ff6(0x7f)]=a16_0xbd0ff6(0xfe);async['execute'](_0x20fcd6){const _0x2192e8=a16_0xbd0ff6,{options:_0x4746b3,args:_0x50f789,tdx:_0x417ac6}=_0x20fcd6;if(_0x50f789[_0x2192e8(0xae)]===0x0)return console['error'](_0x2192e8(0x96)),console['error'](_0x2192e8(0xad)),0x1;const _0x5420c0=_0x50f789[0x0],_0x357df0=_0x4746b3,_0x1b57d2=await resolveWorkspaceIdFromOptions(_0x357df0,_0x417ac6);return await withSpinner(_0x2192e8(0x91)+_0x5420c0+'\x27...',()=>_0x417ac6[_0x2192e8(0xe7)][_0x2192e8(0xf7)](_0x5420c0,_0x1b57d2),{'verbose':_0x4746b3['verbose']}),console[_0x2192e8(0xd6)](_0x2192e8(0x98)+_0x5420c0+_0x2192e8(0x9d)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0xc5);['description']='Duplicate\x20a\x20campaign';async[a16_0xbd0ff6(0xa9)](_0x5e0754){const _0x53b358=a16_0xbd0ff6,{options:_0x38e4d3,args:_0x14c97d,tdx:_0x381e33}=_0x5e0754;if(_0x14c97d[_0x53b358(0xae)]===0x0)return console['error'](_0x53b358(0x96)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0xa63da6=_0x14c97d[0x0],_0x27af0d=_0x38e4d3,_0x31802c=await resolveWorkspaceIdFromOptions(_0x27af0d,_0x381e33),_0x4f5c75=await withSpinner(_0x53b358(0x106)+_0xa63da6+_0x53b358(0x105),()=>_0x381e33['engage']['duplicateCampaign'](_0xa63da6,_0x31802c),{'verbose':_0x38e4d3[_0x53b358(0xca)]});return await handleSDKOutput([_0x4f5c75[_0x53b358(0xbd)]],_0x38e4d3),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0xfd);['description']=a16_0xbd0ff6(0xd2);async[a16_0xbd0ff6(0xa9)](_0x1843a1){const _0x5e8dd0=a16_0xbd0ff6,{options:_0x39cf8a,args:_0x3dbfec,tdx:_0x4cc051}=_0x1843a1,_0x5551ee=_0x3dbfec[0x0],_0x383f85=resolveLimit(_0x39cf8a[_0x5e8dd0(0xa8)],DEFAULT_LLM_LIMIT),_0x11ed7d=_0x39cf8a,_0x5ace9f=await resolveWorkspaceIdFromOptions(_0x11ed7d,_0x4cc051),_0x50be76=await withSpinner(_0x5e8dd0(0x82),()=>_0x4cc051[_0x5e8dd0(0xe7)][_0x5e8dd0(0xd0)]({'workspaceId':_0x5ace9f,'limit':_0x383f85}),{'verbose':_0x39cf8a[_0x5e8dd0(0xca)]});let _0x1dff7e=_0x50be76[_0x5e8dd0(0xbd)];return _0x5551ee&&(_0x1dff7e=_0x50be76[_0x5e8dd0(0xbd)][_0x5e8dd0(0x10b)](_0x4e6a60=>matchGlobPattern(_0x4e6a60['name'],_0x5551ee))),await handleSDKOutput(_0x1dff7e,_0x39cf8a),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]='engage:template:show';[a16_0xbd0ff6(0x7f)]=a16_0xbd0ff6(0xf9);async[a16_0xbd0ff6(0xa9)](_0x2f1558){const _0x417804=a16_0xbd0ff6,{options:_0x40c6ef,args:_0x4cde3d,tdx:_0x8ae48a}=_0x2f1558;if(_0x4cde3d[_0x417804(0xae)]===0x0)return console[_0x417804(0xec)](_0x417804(0xe8)),console[_0x417804(0xec)]('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0x5de862=_0x4cde3d[0x0],_0x46fad2=_0x40c6ef,_0x5600f8=await resolveWorkspaceIdFromOptions(_0x46fad2,_0x8ae48a),_0x481377=_0x46fad2[_0x417804(0xc6)];if(_0x481377){const _0xc0a746=await withSpinner(_0x417804(0xf3)+_0x5de862+_0x417804(0x105),()=>_0x8ae48a[_0x417804(0xe7)][_0x417804(0xe6)](_0x5de862,_0x5600f8),{'verbose':_0x40c6ef[_0x417804(0xca)]});await handleSDKOutput([_0xc0a746],_0x40c6ef);}else{const _0x18f3a4=await withSpinner('Fetching\x20template\x20\x27'+_0x5de862+_0x417804(0x105),()=>_0x8ae48a['engage'][_0x417804(0x9c)](_0x5de862,_0x5600f8),{'verbose':_0x40c6ef[_0x417804(0xca)]});await handleSDKOutput([_0x18f3a4],_0x40c6ef);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]='engage:template:create';[a16_0xbd0ff6(0x7f)]=a16_0xbd0ff6(0xff);async[a16_0xbd0ff6(0xa9)](_0x4b7f72){const _0x1b76bb=a16_0xbd0ff6,{options:_0x5b4275,tdx:_0xf16a2e}=_0x4b7f72,_0x5144c9=_0x5b4275,_0x3b315d=_0x5144c9['name'],_0x1b80e7=_0x5144c9[_0x1b76bb(0xe0)],_0x5e3416=_0x5144c9[_0x1b76bb(0x87)];if(!_0x3b315d)return console[_0x1b76bb(0xec)](_0x1b76bb(0xd5)),console['error']('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x1b80e7)return console[_0x1b76bb(0xec)](_0x1b76bb(0xd3)),0x1;if(!_0x5e3416)return console[_0x1b76bb(0xec)]('Error:\x20--html\x20is\x20required'),0x1;const _0x3805b3=await resolveWorkspaceIdFromOptions(_0x5144c9,_0xf16a2e,!![]),_0x240322={'name':_0x3b315d,'subjectTemplate':_0x1b80e7,'htmlTemplate':_0x5e3416,'workspaceId':_0x3805b3,'plaintextTemplate':_0x5144c9[_0x1b76bb(0xc0)],'editorType':_0x5144c9[_0x1b76bb(0xd9)]},_0x4af637=await withSpinner(_0x1b76bb(0xea)+_0x3b315d+_0x1b76bb(0x105),()=>_0xf16a2e[_0x1b76bb(0xe7)]['createTemplate'](_0x240322));return await handleSDKOutput([_0x4af637[_0x1b76bb(0xbd)]],_0x5b4275),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0xbd0ff6(0xbe);['description']=a16_0xbd0ff6(0x85);async['execute'](_0xf3bb39){const _0xfcfb9d=a16_0xbd0ff6,{options:_0x581a18,args:_0x4a1068,tdx:_0x103934}=_0xf3bb39;if(_0x4a1068[_0xfcfb9d(0xae)]===0x0)return console[_0xfcfb9d(0xec)](_0xfcfb9d(0xe8)),console[_0xfcfb9d(0xec)](_0xfcfb9d(0xe4)),0x1;const _0x3fffa5=_0x4a1068[0x0],_0x3f3c68=_0x581a18,_0xe587c3=await resolveWorkspaceIdFromOptions(_0x3f3c68,_0x103934),_0xd04577={'name':_0x3f3c68[_0xfcfb9d(0xb3)],'subjectTemplate':_0x3f3c68[_0xfcfb9d(0xe0)],'htmlTemplate':_0x3f3c68[_0xfcfb9d(0x87)],'plaintextTemplate':_0x3f3c68[_0xfcfb9d(0xc0)]},_0xae176=Object[_0xfcfb9d(0xb7)](Object[_0xfcfb9d(0xd4)](_0xd04577)[_0xfcfb9d(0x10b)](([,_0x309417])=>_0x309417!==undefined));if(Object[_0xfcfb9d(0xf0)](_0xae176)['length']===0x0)return console[_0xfcfb9d(0xec)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0xfcfb9d(0xec)](_0xfcfb9d(0xe5)),0x1;const _0x4afac9=await withSpinner(_0xfcfb9d(0x86)+_0x3fffa5+'\x27...',()=>_0x103934['engage'][_0xfcfb9d(0xf4)](_0x3fffa5,_0xae176,_0xe587c3),{'verbose':_0x581a18[_0xfcfb9d(0xca)]});return await handleSDKOutput([_0x4afac9['data']],_0x581a18),0x0;}}function a16_0x5031(){const _0x527af8=['log','launchCampaign','Fetching\x20workspace\x20\x27','editorType','engage:workspaces','Operation\x20cancelled','\x27\x20paused\x20successfully','Options:\x20--name,\x20--description','Fetching\x20workspaces...','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','subject','24yevIjW','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','getTemplateFull','engage','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Workspace\x20\x27','Creating\x20template\x20\x27','\x27\x20launched\x20successfully','error','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Engage\x20workspace\x20set\x20to:\x20','Deleting\x20campaign\x20\x27','keys','parentName','Creating\x20workspace\x20\x27','Fetching\x20template\x20\x27','updateTemplate','Updating\x20workspace\x20\x27','getWorkspace','resumeCampaign','3867032ztLiWc','Show\x20email\x20template\x20details','engage:workspace:delete','Verifying\x20workspace\x20\x27','Deleting\x20template\x20\x27','engage:templates','Resume\x20a\x20paused\x20campaign','Create\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Update\x20a\x20campaign','engage_workspace','segmentId','engage:campaign:launch','\x27...','Duplicating\x20campaign\x20\x27','Show\x20campaign\x20details','engage:workspace:create','Fetching\x20campaign\x20\x27','engage:campaign:update','filter','Create\x20a\x20new\x20campaign','194656WsEQZA','getWorkspaceFull','engage:template:delete','description','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','deleteWorkspace','Fetching\x20templates...','List\x20workspaces','engage:campaign:show','Update\x20an\x20email\x20template','Updating\x20template\x20\x27','html','getCampaign','Delete\x20a\x20workspace','segment','List\x20campaigns','session','MISSING_ARGUMENT','Create\x20a\x20workspace','resolvePathToResource','\x27?\x20This\x20cannot\x20be\x20undone.','Resuming\x20campaign\x20\x27','updateCampaign','resolveWorkspaceId','pauseCampaign','Template\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Creating\x20campaign\x20\x27','Campaign\x20\x27','segmentName','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','engage:campaign:resume','getTemplate','\x27\x20resumed\x20successfully','Show\x20workspace\x20details','Deleting\x20workspace\x20\x27','1314237eTpMgn','Workspace\x20is\x20required\x20for\x20this\x20operation','emailSenderId','Launch\x20a\x20campaign','engage:campaign:pause','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Delete\x20a\x20campaign','9owDWVx','limit','execute','deleteCampaign','Update\x20a\x20workspace','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','length','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','createWorkspace','yes','name','Error:\x20Workspace\x20name\x20is\x20required','engage:campaigns','getCampaignFull','fromEntries','engage:workspace:use','3842312SuRofc','\x27\x20deleted\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','data','engage:template:update','engage:campaign:create','plaintext','timezone','1389376Rlknub','type','startAt','engage:campaign:duplicate','full','3548595ClIFnD','23365uBoVEZ','Pausing\x20campaign\x20\x27','verbose','engage:workspace:show','Fetching\x20campaigns...','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','workspace','listTemplates','engage:campaign:delete','List\x20email\x20templates','Error:\x20--subject\x20is\x20required','entries','Error:\x20--name\x20is\x20required'];a16_0x5031=function(){return _0x527af8;};return a16_0x5031();}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a16_0xbd0ff6(0x7e);[a16_0xbd0ff6(0x7f)]='Delete\x20an\x20email\x20template';async[a16_0xbd0ff6(0xa9)](_0xc48c1d){const _0xc60cc3=a16_0xbd0ff6,{options:_0x2c336a,args:_0x3218ea,tdx:_0x3b68bc}=_0xc48c1d;if(_0x3218ea[_0xc60cc3(0xae)]===0x0)return console[_0xc60cc3(0xec)](_0xc60cc3(0xe8)),console[_0xc60cc3(0xec)](_0xc60cc3(0x80)),0x1;const _0x168002=_0x3218ea[0x0],_0x2aac29=_0x2c336a,_0x1e4d4f=await resolveWorkspaceIdFromOptions(_0x2aac29,_0x3b68bc);if(!_0x2c336a['yes']){const _0x4cc45b=await confirm(_0xc60cc3(0xac)+_0x168002+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x4cc45b)return console[_0xc60cc3(0xd6)](_0xc60cc3(0xdb)),0x0;}return await withSpinner(_0xc60cc3(0xfc)+_0x168002+_0xc60cc3(0x105),()=>_0x3b68bc['engage']['deleteTemplate'](_0x168002,_0x1e4d4f),{'verbose':_0x2c336a[_0xc60cc3(0xca)]}),console[_0xc60cc3(0xd6)](_0xc60cc3(0x95)+_0x168002+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0xda);['description']=a16_0xbd0ff6(0x83);async['execute'](_0xf8256b){const _0x25c984=a16_0xbd0ff6,{options:_0x2ccc01,args:_0x343c6d,tdx:_0x20b45f}=_0xf8256b,_0x441033=_0x343c6d[0x0],_0x4741ab=resolveLimit(_0x2ccc01[_0x25c984(0xa8)],DEFAULT_LLM_LIMIT),_0x4b0527=await withSpinner(_0x25c984(0xde),()=>_0x20b45f[_0x25c984(0xe7)]['listWorkspaces']({'limit':_0x4741ab}),{'verbose':_0x2ccc01[_0x25c984(0xca)]});let _0x38db14=_0x4b0527[_0x25c984(0xbd)];return _0x441033&&(_0x38db14=_0x4b0527[_0x25c984(0xbd)][_0x25c984(0x10b)](_0x250c0c=>matchGlobPattern(_0x250c0c[_0x25c984(0xb3)],_0x441033))),await handleSDKOutput(_0x38db14,_0x2ccc01),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0xcb);[a16_0xbd0ff6(0x7f)]=a16_0xbd0ff6(0x9e);async[a16_0xbd0ff6(0xa9)](_0x3fde28){const _0x2774b4=a16_0xbd0ff6,{options:_0x83fb2a,args:_0x6e1672,tdx:_0xfbf811}=_0x3fde28;if(_0x6e1672[_0x2774b4(0xae)]===0x0)return console[_0x2774b4(0xec)](_0x2774b4(0xce)),console[_0x2774b4(0xec)](_0x2774b4(0x9a)),0x1;const _0xc2d7e5=_0x6e1672[0x0],_0x431f66=_0x83fb2a,_0x311b40=_0x431f66['full'];if(_0x311b40){const _0xecc0e3=await withSpinner(_0x2774b4(0xd8)+_0xc2d7e5+_0x2774b4(0x105),()=>_0xfbf811[_0x2774b4(0xe7)][_0x2774b4(0x7d)](_0xc2d7e5),{'verbose':_0x83fb2a[_0x2774b4(0xca)]});await handleSDKOutput([_0xecc0e3],_0x83fb2a);}else{const _0x2fa79f=await withSpinner(_0x2774b4(0xd8)+_0xc2d7e5+'\x27...',()=>_0xfbf811[_0x2774b4(0xe7)][_0x2774b4(0xf6)](_0xc2d7e5),{'verbose':_0x83fb2a['verbose']});await handleSDKOutput([_0x2fa79f],_0x83fb2a);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0x108);['description']=a16_0xbd0ff6(0x8e);async[a16_0xbd0ff6(0xa9)](_0x4c5b59){const _0x5c7414=a16_0xbd0ff6,{options:_0x300111,tdx:_0x3b0fe8}=_0x4c5b59,_0x4a588e=_0x300111,_0x273649=_0x4a588e['name'];if(!_0x273649)return console[_0x5c7414(0xec)](_0x5c7414(0xd5)),console[_0x5c7414(0xec)](_0x5c7414(0x100)),0x1;const _0x51813f={'name':_0x273649,'description':_0x4a588e[_0x5c7414(0x7f)]},_0x39cb6e=await withSpinner(_0x5c7414(0xf2)+_0x273649+_0x5c7414(0x105),()=>_0x3b0fe8[_0x5c7414(0xe7)][_0x5c7414(0xb1)](_0x51813f));return await handleSDKOutput([_0x39cb6e[_0x5c7414(0xbd)]],_0x300111),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]='engage:workspace:update';[a16_0xbd0ff6(0x7f)]=a16_0xbd0ff6(0xab);async[a16_0xbd0ff6(0xa9)](_0x37a5ce){const _0x1314ab=a16_0xbd0ff6,{options:_0x1d4c21,args:_0x2a678c,tdx:_0x351d32}=_0x37a5ce;if(_0x2a678c[_0x1314ab(0xae)]===0x0)return console[_0x1314ab(0xec)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x1314ab(0xec)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x225282=_0x2a678c[0x0],_0x58552e=_0x1d4c21,_0x1f7efa={'name':_0x58552e[_0x1314ab(0xb3)],'description':_0x58552e['description']},_0x250f7c=Object[_0x1314ab(0xb7)](Object[_0x1314ab(0xd4)](_0x1f7efa)[_0x1314ab(0x10b)](([,_0x251e4a])=>_0x251e4a!==undefined));if(Object[_0x1314ab(0xf0)](_0x250f7c)[_0x1314ab(0xae)]===0x0)return console[_0x1314ab(0xec)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x1314ab(0xdd)),0x1;const _0x16437d=await withSpinner(_0x1314ab(0xf5)+_0x225282+_0x1314ab(0x105),()=>_0x351d32[_0x1314ab(0xe7)]['updateWorkspace'](_0x225282,_0x250f7c),{'verbose':_0x1d4c21[_0x1314ab(0xca)]});return await handleSDKOutput([_0x16437d['data']],_0x1d4c21),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0xfa);[a16_0xbd0ff6(0x7f)]=a16_0xbd0ff6(0x89);async[a16_0xbd0ff6(0xa9)](_0xb279ff){const _0x51a627=a16_0xbd0ff6,{options:_0x261b10,args:_0x3dfef4,tdx:_0x1645b8}=_0xb279ff;if(_0x3dfef4['length']===0x0)return console[_0x51a627(0xec)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x51a627(0xec)](_0x51a627(0xa5)),0x1;const _0x2923dc=_0x3dfef4[0x0];if(!_0x261b10[_0x51a627(0xb2)]){const _0x340595=await confirm(_0x51a627(0xaf)+_0x2923dc+_0x51a627(0x90));if(!_0x340595)return console[_0x51a627(0xd6)](_0x51a627(0xdb)),0x0;}return await withSpinner(_0x51a627(0x9f)+_0x2923dc+_0x51a627(0x105),()=>_0x1645b8[_0x51a627(0xe7)][_0x51a627(0x81)](_0x2923dc),{'verbose':_0x261b10[_0x51a627(0xca)]}),console[_0x51a627(0xd6)](_0x51a627(0xe9)+_0x2923dc+_0x51a627(0xba)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0xbd0ff6(0xb3)]=a16_0xbd0ff6(0xb8);[a16_0xbd0ff6(0x7f)]=a16_0xbd0ff6(0xcd);async[a16_0xbd0ff6(0xa9)](_0x56e4d6){const _0x292261=a16_0xbd0ff6,{options:_0x549380,args:_0x28955f,tdx:_0x457bf0}=_0x56e4d6;if(_0x28955f[_0x292261(0xae)]===0x0)return console[_0x292261(0xec)](_0x292261(0xb4)),console[_0x292261(0xec)]('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x21b0fb=_0x28955f[0x0];await withSpinner(_0x292261(0xfb)+_0x21b0fb+_0x292261(0x105),()=>_0x457bf0[_0x292261(0xe7)][_0x292261(0x93)](_0x21b0fb));const _0x379404=_0x549380[_0x292261(0x8c)]||undefined;return saveSessionContext({'engage_workspace':_0x21b0fb},_0x379404),console[_0x292261(0xd6)](_0x292261(0xee)+_0x21b0fb),console[_0x292261(0xd6)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}