@treasuredata/tdx 0.28.3 → 0.28.4

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 (184) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.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/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.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/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- const a9_0x543bb9=a9_0xb97c;(function(_0x2d4012,_0x8ba31b){const _0x3b27f5=a9_0xb97c,_0xe107ca=_0x2d4012();while(!![]){try{const _0x262b1e=-parseInt(_0x3b27f5(0x1ae))/0x1+parseInt(_0x3b27f5(0x194))/0x2+parseInt(_0x3b27f5(0x16c))/0x3+parseInt(_0x3b27f5(0x1a8))/0x4+parseInt(_0x3b27f5(0x1a1))/0x5+-parseInt(_0x3b27f5(0x1df))/0x6*(parseInt(_0x3b27f5(0x1d0))/0x7)+parseInt(_0x3b27f5(0x173))/0x8*(-parseInt(_0x3b27f5(0x1ec))/0x9);if(_0x262b1e===_0x8ba31b)break;else _0xe107ca['push'](_0xe107ca['shift']());}catch(_0x4536fb){_0xe107ca['push'](_0xe107ca['shift']());}}}(a9_0x3423,0x6c59c));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x4b3907 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{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_0x543bb9(0x1a6),SETTINGS_BACKUP_FILENAME=a9_0x543bb9(0x1cf);function isProcessRunning(_0x552d90){try{return process['kill'](_0x552d90,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x42067e,_0x59e9e3){const _0x2f5443=a9_0x543bb9;if(!existsSync(_0x42067e))return;try{const _0x714c18=await readFile(_0x42067e,_0x2f5443(0x18a)),_0x338fb6=JSON[_0x2f5443(0x19b)](_0x714c18),_0x3fea0a=_0x338fb6[_0x2f5443(0x1af)]||{};for(const _0x18b79b of[_0x2f5443(0x193),_0x2f5443(0x1c1),_0x2f5443(0x19c),'CLAUDE_CODE_USE_BEDROCK',_0x2f5443(0x1c4)]){_0x59e9e3[_0x18b79b]!==undefined?_0x3fea0a[_0x18b79b]=_0x59e9e3[_0x18b79b]:delete _0x3fea0a[_0x18b79b];}_0x59e9e3[_0x2f5443(0x1c3)]!==undefined?_0x338fb6[_0x2f5443(0x1c3)]=_0x59e9e3[_0x2f5443(0x1c3)]:delete _0x338fb6['statusLine'],_0x338fb6['env']=_0x3fea0a,await writeFile(_0x42067e,JSON['stringify'](_0x338fb6,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x445794){try{await unlink(_0x445794);}catch{}}async function recoverFromStaleBackup(_0x3ce9bc,_0xe30d49){const _0xc03718=a9_0x543bb9;if(!existsSync(_0xe30d49))return undefined;try{const _0x3ea3a0=await readFile(_0xe30d49,_0xc03718(0x18a)),_0x3b95e1=JSON[_0xc03718(0x19b)](_0x3ea3a0);if(isProcessRunning(_0x3b95e1[_0xc03718(0x1dd)]))return{'liveSessionOriginals':_0x3b95e1[_0xc03718(0x1be)]};return await applyOriginalSettings(_0x3ce9bc,_0x3b95e1[_0xc03718(0x1be)]),await safeUnlink(_0xe30d49),undefined;}catch{return await safeUnlink(_0xe30d49),undefined;}}function handleInstallationError(_0x413edb,_0x456420,_0x38868e,_0x256c5f){const _0x548630=a9_0x543bb9;errorContains(_0x413edb,_0x548630(0x1f7),'already\x20installed','already\x20configured')?(_0x38868e[_0x548630(0x19e)]='✓\x20'+_0x456420+_0x548630(0x16e),_0x256c5f?.[_0x548630(0x1d8)](_0x456420+_0x548630(0x16e)),_0x413edb instanceof SDKError&&_0x413edb[_0x548630(0x1c8)]&&_0x256c5f?.[_0x548630(0x178)](_0x548630(0x1f6)+_0x413edb[_0x548630(0x1c8)][_0x548630(0x1bc)])):(_0x38868e[_0x548630(0x180)](_0x548630(0x188)+_0x456420),_0x256c5f?.[_0x548630(0x1f3)](_0x456420+_0x548630(0x1bf),_0x413edb));}export function parseVersion(_0x5532d7){const _0x10c3ef=a9_0x543bb9,_0x28f437=_0x5532d7[_0x10c3ef(0x1e2)]()[_0x10c3ef(0x1c0)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x28f437)return null;return{'major':parseInt(_0x28f437[0x1],0xa),'minor':parseInt(_0x28f437[0x2],0xa),'patch':parseInt(_0x28f437[0x3],0xa)};}function a9_0x3423(){const _0xc8ac9d=['Installing\x20plugin\x20\x27','TD\x20Docs\x20MCP\x20Server','\x27\x20removed','inherit','pid','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','258ByOyox','td-skills','Initializing...','trim','CLAUDE_CODE_NOT_FOUND','resume','context','Command\x20spawn\x20error:\x20','marketplace','stringify','green','\x20meets\x20minimum\x20requirement','major','1413GwxMRh','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','log','Checking\x20Claude\x20Code\x20version...','\x20claude\x20statusline','✓\x20Logs\x20saved\x20to\x20','close','error','account_id','Configuring\x20marketplace\x20\x27','Command\x20output:\x20','already\x20exists','Failed\x20to\x20configure\x20marketplace\x20\x27','toString','✓\x20Marketplace\x20\x27','unshift','proxy','settings.local.json','Failed\x20to\x20list\x20marketplaces','td-docs','Invalid\x20minimum\x20version\x20format:\x20','Command\x20failed\x20(exit\x20','2185347HSbtqy','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','\x20already\x20configured','Setup\x20failed','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','passThroughServer','Failed\x20to\x20update\x20marketplace\x20\x27','76168ApKkWZ','tdx-managed-proxy','\x27:\x20','Executing:\x20claude\x20','minor','debug','add','continue','Failed\x20to\x20install\x20plugin\x20\x27','Claude\x20Code\x20version\x20','.claude','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','https://docs.treasuredata.com/mcp','warn','CLAUDE_CODE_USE_BEDROCK','includes','Claude\x20Code\x20version\x20check\x20failed','apiKey','\x20→\x20','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','):\x20claude\x20','Warning:\x20Failed\x20to\x20configure\x20','--version','utf-8','false','Failed\x20to\x20launch\x20Claude\x20Code:\x20','fail','cwd','tdx-skills','execute','Initializing\x20proxy\x20logger...','exit','ANTHROPIC_BASE_URL','1055710ALFcPh','toISOString','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','✓\x20MCP\x20server\x20\x27','claude','\x27...','td-skills\x20Plugins','parse','ANTHROPIC_AUTH_TOKEN','\x20is\x20too\x20old\x20(minimum:\x20','text','getLogPath','patch','1303345bZZAIs','data','http://127.0.0.1:','https://github.com/treasure-data/td-skills','http','2.0.20','logger','1882908hCrBaE','Claude\x20Code\x20CLI\x20not\x20found','ENOENT','site','profile','remove','33834OgkFzC','env','port','INTERNAL','sql-skills','\x27\x20updated','stop','✓\x20Settings\x20restored:\x20.claude/settings.local.json','stdout','verbose','INSTALLATION_FAILED','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Configuring\x20MCP\x20server\x20\x27','plugin','message','pipe','originalSettings','\x20configuration\x20failed','match','ANTHROPIC_MODEL','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','statusLine','CLAUDE_CODE_USE_VERTEX','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','name','Restored\x20default\x20td-skills\x20marketplace','cause','start','✓\x20Logging\x20to\x20','\x27\x20configured','join','--transport','red','.tdx-settings-backup.json','2485ZaTbXn','Failed\x20to\x20remove\x20marketplace\x20\x27','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','mcp','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','getCurrent','llm-proxy','user','info'];a9_0x3423=function(){return _0xc8ac9d;};return a9_0x3423();}export function compareVersions(_0x33eac7,_0x32ba5a){const _0x511836=a9_0x543bb9;if(_0x33eac7[_0x511836(0x1eb)]!==_0x32ba5a[_0x511836(0x1eb)])return _0x33eac7[_0x511836(0x1eb)]-_0x32ba5a['major'];if(_0x33eac7[_0x511836(0x177)]!==_0x32ba5a[_0x511836(0x177)])return _0x33eac7['minor']-_0x32ba5a[_0x511836(0x177)];return _0x33eac7[_0x511836(0x1a0)]-_0x32ba5a[_0x511836(0x1a0)];}async function checkClaudeVersion(_0x5134b5,_0x517554){const _0x3023d9=a9_0x543bb9;_0x517554?.[_0x3023d9(0x178)](_0x3023d9(0x196)+_0x5134b5+')');const _0x133ae6=await executeClaudeCommand([_0x3023d9(0x189)],undefined,_0x517554),_0x5dde6e=parseVersion(_0x133ae6);if(!_0x5dde6e){_0x517554?.[_0x3023d9(0x180)](_0x3023d9(0x1c5)+_0x133ae6);return;}const _0x34d31d=_0x5dde6e[_0x3023d9(0x1eb)]+'.'+_0x5dde6e[_0x3023d9(0x177)]+'.'+_0x5dde6e['patch'],_0x57dc9a=parseVersion(_0x5134b5);if(!_0x57dc9a){_0x517554?.[_0x3023d9(0x180)](_0x3023d9(0x16a)+_0x5134b5);return;}if(compareVersions(_0x5dde6e,_0x57dc9a)<0x0){_0x517554?.[_0x3023d9(0x1f3)](_0x3023d9(0x17c)+_0x34d31d+_0x3023d9(0x19d)+_0x5134b5+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],'Claude\x20Code\x20version\x20'+_0x34d31d+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x5134b5+'\x20or\x20later.',undefined,{'helpText':_0x3023d9(0x16d)});}_0x517554?.[_0x3023d9(0x178)](_0x3023d9(0x17c)+_0x34d31d+_0x3023d9(0x1ea));}async function executeClaudeCommand(_0x2b21b0,_0x1c9af3,_0xb5a9d1){const _0x23ab62=a9_0x543bb9;return _0xb5a9d1?.[_0x23ab62(0x1d8)](_0x23ab62(0x176)+_0x2b21b0[_0x23ab62(0x1cc)]('\x20')),new Promise((_0x214302,_0x3fcdc4)=>{const _0x4495ee=_0x23ab62,_0x3b0760=crossSpawn(_0x4495ee(0x198),_0x2b21b0,{'stdio':_0x4495ee(0x1bd)});let _0x5f5a98='',_0x47f001='';_0x3b0760[_0x4495ee(0x1b6)]?.['on'](_0x4495ee(0x1a2),_0x2591b4=>{const _0x2cca1f=_0x4495ee;_0x5f5a98+=_0x2591b4[_0x2cca1f(0x1f9)]();}),_0x3b0760['stderr']?.['on'](_0x4495ee(0x1a2),_0xd4ac2a=>{const _0x55b1a3=_0x4495ee;_0x47f001+=_0xd4ac2a[_0x55b1a3(0x1f9)]();}),_0x3b0760['on'](_0x4495ee(0x1f3),_0x4f8191=>{const _0x5081f5=_0x4495ee;_0x4f8191['code']===_0x5081f5(0x1aa)?(_0xb5a9d1?.[_0x5081f5(0x1f3)](_0x5081f5(0x1a9)),_0x3fcdc4(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x5081f5(0x1a9),_0x4f8191,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0xb5a9d1?.['error'](_0x5081f5(0x1e6)+_0x4f8191['message']),_0x3fcdc4(new SDKError(ErrorCode[_0x5081f5(0x1b1)],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x4f8191[_0x5081f5(0x1bc)],_0x4f8191)));}),_0x3b0760['on'](_0x4495ee(0x192),_0x57a626=>{const _0x4687b4=_0x4495ee;if(_0x57a626===0x0)_0x214302(_0x5f5a98);else _0x1c9af3?(_0xb5a9d1?.[_0x4687b4(0x1f3)](_0x4687b4(0x16b)+_0x57a626+_0x4687b4(0x187)+_0x2b21b0[_0x4687b4(0x1cc)]('\x20')),_0x3fcdc4(new SDKError(ErrorCode[_0x4687b4(0x1b8)],_0x1c9af3,new Error(_0x47f001)))):_0x214302('');});});}async function ensureMcpServer(_0x443f80,_0x27ad6c,_0x2e42ec,_0x57511e,_0x11fe70){const _0x4f2569=a9_0x543bb9;_0x57511e['text']=_0x4f2569(0x1ba)+_0x443f80+_0x4f2569(0x199),await executeClaudeCommand([_0x4f2569(0x1d3),_0x4f2569(0x179),_0x443f80,_0x27ad6c,_0x4f2569(0x1cd),_0x2e42ec],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x443f80+'\x27',_0x11fe70),_0x57511e[_0x4f2569(0x19e)]=_0x4f2569(0x197)+_0x443f80+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL=a9_0x543bb9(0x1a4);export function getTdSkillsRepoUrl(){const _0x9c3d50=process.env.TDX_TD_SKILLS_REPO;if(_0x9c3d50)return _0x9c3d50;return DEFAULT_TD_SKILLS_URL;}function a9_0xb97c(_0x22f780,_0x7edd04){_0x22f780=_0x22f780-0x168;const _0x3423fe=a9_0x3423();let _0xb97c41=_0x3423fe[_0x22f780];return _0xb97c41;}async function removeMarketplace(_0x60d5b,_0x5d7991){const _0x4e6c8a=a9_0x543bb9;try{const _0x2300b4=await executeClaudeCommand(['plugin',_0x4e6c8a(0x1e7),'list'],_0x4e6c8a(0x168),_0x5d7991);if(!_0x2300b4[_0x4e6c8a(0x182)](_0x60d5b)){_0x5d7991?.[_0x4e6c8a(0x178)]('Marketplace\x20\x27'+_0x60d5b+_0x4e6c8a(0x1ed));return;}await executeClaudeCommand([_0x4e6c8a(0x1bb),_0x4e6c8a(0x1e7),_0x4e6c8a(0x1ad),_0x60d5b],_0x4e6c8a(0x1d1)+_0x60d5b+'\x27',_0x5d7991),_0x5d7991?.['info']('Marketplace\x20\x27'+_0x60d5b+_0x4e6c8a(0x1db));}catch(_0x9d3d92){_0x5d7991?.[_0x4e6c8a(0x180)](_0x4e6c8a(0x1d1)+_0x60d5b+_0x4e6c8a(0x175)+_0x9d3d92);}}async function restoreDefaultTdSkillsMarketplace(_0x5170aa){const _0x48848e=a9_0x543bb9;try{await removeMarketplace('td-skills',_0x5170aa),await executeClaudeCommand([_0x48848e(0x1bb),_0x48848e(0x1e7),_0x48848e(0x179),DEFAULT_TD_SKILLS_URL],undefined,_0x5170aa),_0x5170aa?.[_0x48848e(0x1d8)](_0x48848e(0x1c7));}catch{}}async function ensureMarketplace(_0x587e20,_0x3bc3e4,_0x5aa66b,_0x7caca5){const _0x9636fd=a9_0x543bb9;_0x5aa66b['text']=_0x9636fd(0x1f5)+_0x587e20+_0x9636fd(0x199),await executeClaudeCommand([_0x9636fd(0x1bb),_0x9636fd(0x1e7),_0x9636fd(0x179),_0x3bc3e4],_0x9636fd(0x1f8)+_0x587e20+'\x27',_0x7caca5),_0x5aa66b[_0x9636fd(0x19e)]=_0x9636fd(0x1fa)+_0x587e20+_0x9636fd(0x1cb);}async function updateMarketplace(_0x2cb542,_0x46daf1,_0x1b9463){const _0x4a4634=a9_0x543bb9;_0x46daf1[_0x4a4634(0x19e)]='Updating\x20marketplace\x20\x27'+_0x2cb542+_0x4a4634(0x199),await executeClaudeCommand([_0x4a4634(0x1bb),_0x4a4634(0x1e7),'update'],_0x4a4634(0x172)+_0x2cb542+'\x27',_0x1b9463),_0x46daf1[_0x4a4634(0x19e)]=_0x4a4634(0x1fa)+_0x2cb542+_0x4a4634(0x1b3);}async function ensurePlugin(_0x40eed0,_0x122868,_0x5de541,_0x344521){const _0x47d45b=a9_0x543bb9;_0x5de541[_0x47d45b(0x19e)]=_0x47d45b(0x1d9)+_0x40eed0+'\x27...',await executeClaudeCommand([_0x47d45b(0x1bb),'install',_0x40eed0+'@'+_0x122868],_0x47d45b(0x17b)+_0x40eed0+'\x27',_0x344521),_0x5de541[_0x47d45b(0x19e)]='✓\x20Plugin\x20\x27'+_0x40eed0+'\x27\x20installed';}async function createClaudeSettings(_0x23f42c,_0x5a943e,_0x3f4aa9){const _0x1c3ad1=a9_0x543bb9,_0x1bc2f5=join(process[_0x1c3ad1(0x18e)](),_0x1c3ad1(0x17d)),_0x132676=join(_0x1bc2f5,_0x1c3ad1(0x1fd)),_0x568940=join(_0x1bc2f5,SETTINGS_BACKUP_FILENAME);await mkdir(_0x1bc2f5,{'recursive':!![]});const _0x14b4f0=await recoverFromStaleBackup(_0x132676,_0x568940);let _0x55a656;if(_0x14b4f0)_0x55a656=_0x14b4f0['liveSessionOriginals'];else{let _0x9e6e4f={};if(existsSync(_0x132676))try{const _0xd7700c=await readFile(_0x132676,'utf-8');_0x9e6e4f=JSON[_0x1c3ad1(0x19b)](_0xd7700c);}catch{_0x9e6e4f={};}const _0x55a0f7=_0x9e6e4f[_0x1c3ad1(0x1af)]||{};_0x55a656={'ANTHROPIC_BASE_URL':_0x55a0f7['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x55a0f7['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x55a0f7[_0x1c3ad1(0x19c)],'CLAUDE_CODE_USE_BEDROCK':_0x55a0f7['CLAUDE_CODE_USE_BEDROCK'],'CLAUDE_CODE_USE_VERTEX':_0x55a0f7[_0x1c3ad1(0x1c4)],'statusLine':_0x9e6e4f['statusLine']};const _0x5012bb={'createdAt':new Date()[_0x1c3ad1(0x195)](),'pid':process[_0x1c3ad1(0x1dd)],'originalSettings':_0x55a656};await writeFile(_0x568940,JSON[_0x1c3ad1(0x1e8)](_0x5012bb,null,0x2)+'\x0a');}let _0x30dbb6={};if(existsSync(_0x132676))try{const _0x24e5e5=await readFile(_0x132676,'utf-8');_0x30dbb6=JSON[_0x1c3ad1(0x19b)](_0x24e5e5);}catch{_0x30dbb6={};}const _0xccf4e0=_0x30dbb6[_0x1c3ad1(0x1af)]||{},_0x26077b={..._0x30dbb6,'env':{..._0xccf4e0,'ANTHROPIC_BASE_URL':_0x1c3ad1(0x1a3)+_0x23f42c,..._0x5a943e&&{'ANTHROPIC_MODEL':_0x5a943e},'ANTHROPIC_AUTH_TOKEN':_0x1c3ad1(0x174),'CLAUDE_CODE_USE_BEDROCK':_0x1c3ad1(0x18b),'CLAUDE_CODE_USE_VERTEX':_0x1c3ad1(0x18b)},'statusLine':{'type':'command','command':_0x3f4aa9?'tdx\x20--profile\x20'+_0x3f4aa9+_0x1c3ad1(0x1f0):'tdx\x20claude\x20statusline'}};return await writeFile(_0x132676,JSON['stringify'](_0x26077b,null,0x2)+'\x0a'),_0x55a656;}async function restoreClaudeSettings(_0x943005){const _0x5d2e93=a9_0x543bb9,_0x3da738=join(process[_0x5d2e93(0x18e)](),_0x5d2e93(0x17d)),_0x3ec673=join(_0x3da738,_0x5d2e93(0x1fd)),_0x31b1cf=join(_0x3da738,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x3ec673,_0x943005);try{if(existsSync(_0x31b1cf)){const _0x6b91e5=await readFile(_0x31b1cf,_0x5d2e93(0x18a)),_0x645701=JSON[_0x5d2e93(0x19b)](_0x6b91e5);_0x645701['pid']===process[_0x5d2e93(0x1dd)]&&await safeUnlink(_0x31b1cf);}}catch{}}export class ClaudeCommand extends BaseCommand{[a9_0x543bb9(0x1c6)]='claude';['description']=a9_0x543bb9(0x170);[a9_0x543bb9(0x171)];[a9_0x543bb9(0x1be)];[a9_0x543bb9(0x1a7)];[a9_0x543bb9(0x1b0)];async[a9_0x543bb9(0x190)](_0x5880d4){const _0x392bf2=a9_0x543bb9,{tdx:_0x2c2298,options:_0x3cc5f5,args:_0x2b6e9b}=_0x5880d4;let _0x1f4ed6=![];try{const _0x405a2c=_0x3cc5f5,_0x3c6142=_0x405a2c[_0x392bf2(0x1fc)]===![],_0x65ae61=_0x405a2c[_0x392bf2(0x17a)]===!![],_0x51ff46=_0x405a2c[_0x392bf2(0x1e4)]===!![],_0x7e43d6=[..._0x2b6e9b];if(_0x65ae61)_0x7e43d6['unshift']('-c');else _0x51ff46&&_0x7e43d6[_0x392bf2(0x1fb)]('-r');const _0x1db3a3=createCommandSpinner(_0x392bf2(0x1e1),{'verbose':_0x3cc5f5[_0x392bf2(0x1b7)]});_0x1db3a3['start']();try{if(!_0x3c6142){const _0x1b955d=_0x3cc5f5[_0x392bf2(0x1ac)];try{const _0x25dc19=await _0x2c2298[_0x392bf2(0x1d7)][_0x392bf2(0x1d5)]();_0x25dc19[_0x392bf2(0x1f4)]&&writeCachedAccountInfo(_0x3cc5f5[_0x392bf2(0x1ab)],_0x25dc19[_0x392bf2(0x1f4)],_0x1b955d);}catch{}_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x191),this[_0x392bf2(0x1a7)]=new TDXLogger(_0x3cc5f5['logLevel'],!![]),await this[_0x392bf2(0x1a7)]['init']();const _0x799016=this[_0x392bf2(0x1a7)][_0x392bf2(0x19f)]();_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x1ca)+_0x799016;const _0x3e7fb3=getEndpoint(_0x3cc5f5[_0x392bf2(0x1ab)],_0x392bf2(0x1d6));_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x186);if(!_0x2c2298[_0x392bf2(0x1e5)][_0x392bf2(0x184)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x392bf2(0x1de));this['passThroughServer']=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x3e7fb3,'apiKey':_0x2c2298[_0x392bf2(0x1e5)][_0x392bf2(0x184)],'logger':this[_0x392bf2(0x1a7)],'site':_0x3cc5f5[_0x392bf2(0x1ab)],'profile':_0x1b955d}),await this[_0x392bf2(0x171)][_0x392bf2(0x1c9)](),this[_0x392bf2(0x1b0)]=this[_0x392bf2(0x171)][_0x392bf2(0x1b0)],_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x1c2)+this[_0x392bf2(0x1b0)]+_0x392bf2(0x185)+_0x3e7fb3,_0x1db3a3['text']='Creating\x20.claude/settings.local.json...',this['originalSettings']=await createClaudeSettings(this[_0x392bf2(0x1b0)],undefined,_0x1b955d),_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x1b9);}else _0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x17e);try{_0x1db3a3[_0x392bf2(0x19e)]=_0x392bf2(0x1ef),await checkClaudeVersion(MIN_CLAUDE_VERSION,this['logger']),_0x1db3a3[_0x392bf2(0x19e)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x4ba35c){_0x1db3a3['fail'](_0x392bf2(0x183));throw _0x4ba35c;}try{await ensureMcpServer(_0x392bf2(0x169),_0x392bf2(0x17f),_0x392bf2(0x1a5),_0x1db3a3,this[_0x392bf2(0x1a7)]);}catch(_0x2e8fce){handleInstallationError(_0x2e8fce,_0x392bf2(0x1da),_0x1db3a3,this[_0x392bf2(0x1a7)]);}try{const _0xa946aa=getTdSkillsRepoUrl();_0x1f4ed6=_0xa946aa!==DEFAULT_TD_SKILLS_URL,_0x1f4ed6&&await removeMarketplace(_0x392bf2(0x1e0),this[_0x392bf2(0x1a7)]),await ensureMarketplace(_0x392bf2(0x1e0),_0xa946aa,_0x1db3a3,this['logger']),await updateMarketplace('td-skills',_0x1db3a3,this['logger']),await ensurePlugin(_0x392bf2(0x1b2),_0x392bf2(0x1e0),_0x1db3a3,this[_0x392bf2(0x1a7)]),await ensurePlugin('workflow-skills','td-skills',_0x1db3a3,this[_0x392bf2(0x1a7)]),await ensurePlugin(_0x392bf2(0x18f),'td-skills',_0x1db3a3,this['logger']);}catch(_0x302db6){handleInstallationError(_0x302db6,_0x392bf2(0x19a),_0x1db3a3,this[_0x392bf2(0x1a7)]);}_0x1db3a3[_0x392bf2(0x1b4)]();}catch(_0x2a7839){_0x1db3a3[_0x392bf2(0x18d)](_0x392bf2(0x16f));throw _0x2a7839;}const _0x12eea8=await findExecutable(_0x392bf2(0x198));if(!_0x12eea8)throw new SDKError(ErrorCode[_0x392bf2(0x1e3)],_0x392bf2(0x1a9),undefined,{'helpText':_0x392bf2(0x1d4)});const _0x110b65={...process.env};!_0x3c6142&&(_0x110b65[_0x392bf2(0x193)]='http://127.0.0.1:'+this[_0x392bf2(0x1b0)],_0x110b65[_0x392bf2(0x19c)]=_0x392bf2(0x174),_0x110b65[_0x392bf2(0x181)]=_0x392bf2(0x18b),_0x110b65[_0x392bf2(0x1c4)]=_0x392bf2(0x18b));const _0x24efda=crossSpawn(_0x12eea8,_0x7e43d6,{'stdio':_0x392bf2(0x1dc),'env':_0x110b65}),_0x2cfb09=await new Promise(_0x4eef7a=>{const _0x18007a=_0x392bf2;_0x24efda['on']('exit',_0x5134e1=>{_0x4eef7a(_0x5134e1||0x0);}),_0x24efda['on'](_0x18007a(0x1f3),_0x8c2f3b=>{const _0x51e6f2=_0x18007a;console['error'](a9_0x4b3907[_0x51e6f2(0x1ce)](_0x51e6f2(0x18c)+_0x8c2f3b[_0x51e6f2(0x1bc)])),_0x4eef7a(0x1);});});_0x1f4ed6&&await restoreDefaultTdSkillsMarketplace(this[_0x392bf2(0x1a7)]);this[_0x392bf2(0x171)]&&(await this[_0x392bf2(0x171)]['stop'](),console[_0x392bf2(0x1ee)](a9_0x4b3907['green'](_0x392bf2(0x1d2))));if(this[_0x392bf2(0x1a7)]){await this[_0x392bf2(0x1a7)][_0x392bf2(0x1f2)]();const _0x4a64c5=this[_0x392bf2(0x1a7)]['getLogPath']();console[_0x392bf2(0x1ee)](a9_0x4b3907[_0x392bf2(0x1e9)](_0x392bf2(0x1f1)+_0x4a64c5));}return this[_0x392bf2(0x1be)]&&(await restoreClaudeSettings(this[_0x392bf2(0x1be)]),console[_0x392bf2(0x1ee)](a9_0x4b3907[_0x392bf2(0x1e9)](_0x392bf2(0x1b5)))),_0x2cfb09;}catch(_0x3d9b83){_0x1f4ed6&&await restoreDefaultTdSkillsMarketplace(this[_0x392bf2(0x1a7)]);this[_0x392bf2(0x171)]&&await this[_0x392bf2(0x171)][_0x392bf2(0x1b4)]();this[_0x392bf2(0x1a7)]&&await this['logger'][_0x392bf2(0x1f2)]();this[_0x392bf2(0x1be)]&&await restoreClaudeSettings(this[_0x392bf2(0x1be)]);throw _0x3d9b83;}}}
1
+ const a9_0x1f421c=a9_0x3868;(function(_0xd28a7d,_0x5360b8){const _0x57823a=a9_0x3868,_0x5d2245=_0xd28a7d();while(!![]){try{const _0x298581=-parseInt(_0x57823a(0x1aa))/0x1+parseInt(_0x57823a(0x1c3))/0x2+parseInt(_0x57823a(0x158))/0x3+parseInt(_0x57823a(0x183))/0x4*(-parseInt(_0x57823a(0x191))/0x5)+-parseInt(_0x57823a(0x1c4))/0x6+parseInt(_0x57823a(0x16c))/0x7+-parseInt(_0x57823a(0x14c))/0x8*(-parseInt(_0x57823a(0x156))/0x9);if(_0x298581===_0x5360b8)break;else _0x5d2245['push'](_0x5d2245['shift']());}catch(_0x4a8f8b){_0x5d2245['push'](_0x5d2245['shift']());}}}(a9_0xd129,0x82c4e));function a9_0x3868(_0x587591,_0x2c578c){_0x587591=_0x587591-0x138;const _0xd129f1=a9_0xd129();let _0x386895=_0xd129f1[_0x587591];return _0x386895;}import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x585012 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{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_0x1f421c(0x179),SETTINGS_BACKUP_FILENAME=a9_0x1f421c(0x1ac);function isProcessRunning(_0x158361){try{return process['kill'](_0x158361,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x2a48d0,_0x58fe6a){const _0x25bb45=a9_0x1f421c;if(!existsSync(_0x2a48d0))return;try{const _0x986625=await readFile(_0x2a48d0,'utf-8'),_0x2324ea=JSON['parse'](_0x986625),_0x3307c9=_0x2324ea[_0x25bb45(0x1a8)]||{};for(const _0x315896 of[_0x25bb45(0x139),_0x25bb45(0x159),_0x25bb45(0x17f),'CLAUDE_CODE_USE_BEDROCK',_0x25bb45(0x1a1)]){_0x58fe6a[_0x315896]!==undefined?_0x3307c9[_0x315896]=_0x58fe6a[_0x315896]:delete _0x3307c9[_0x315896];}_0x58fe6a[_0x25bb45(0x196)]!==undefined?_0x2324ea['statusLine']=_0x58fe6a[_0x25bb45(0x196)]:delete _0x2324ea[_0x25bb45(0x196)],_0x2324ea[_0x25bb45(0x1a8)]=_0x3307c9,await writeFile(_0x2a48d0,JSON[_0x25bb45(0x1a9)](_0x2324ea,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x5bdf44){try{await unlink(_0x5bdf44);}catch{}}async function recoverFromStaleBackup(_0x1e1c2a,_0x2bef93){const _0x29cca5=a9_0x1f421c;if(!existsSync(_0x2bef93))return undefined;try{const _0x1a377b=await readFile(_0x2bef93,_0x29cca5(0x1bd)),_0x1d5560=JSON[_0x29cca5(0x151)](_0x1a377b);if(isProcessRunning(_0x1d5560[_0x29cca5(0x15e)]))return{'liveSessionOriginals':_0x1d5560[_0x29cca5(0x19b)]};return await applyOriginalSettings(_0x1e1c2a,_0x1d5560[_0x29cca5(0x19b)]),await safeUnlink(_0x2bef93),undefined;}catch{return await safeUnlink(_0x2bef93),undefined;}}function handleInstallationError(_0x29145d,_0x4c025f,_0x3e5bd2,_0x5b259f){const _0x3b515b=a9_0x1f421c;errorContains(_0x29145d,_0x3b515b(0x19a),_0x3b515b(0x18d),'already\x20configured')?(_0x3e5bd2[_0x3b515b(0x146)]='✓\x20'+_0x4c025f+_0x3b515b(0x181),_0x5b259f?.[_0x3b515b(0x14a)](_0x4c025f+_0x3b515b(0x181)),_0x29145d instanceof SDKError&&_0x29145d[_0x3b515b(0x13d)]&&_0x5b259f?.['debug'](_0x3b515b(0x15d)+_0x29145d['cause'][_0x3b515b(0x16d)])):(_0x3e5bd2['warn']('Warning:\x20Failed\x20to\x20configure\x20'+_0x4c025f),_0x5b259f?.[_0x3b515b(0x16f)](_0x4c025f+_0x3b515b(0x1ca),_0x29145d));}export function parseVersion(_0x3ee358){const _0x12cbbf=a9_0x1f421c,_0x4ec038=_0x3ee358[_0x12cbbf(0x1a0)]()[_0x12cbbf(0x1a2)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x4ec038)return null;return{'major':parseInt(_0x4ec038[0x1],0xa),'minor':parseInt(_0x4ec038[0x2],0xa),'patch':parseInt(_0x4ec038[0x3],0xa)};}export function compareVersions(_0x417d67,_0x4abde8){const _0x11625c=a9_0x1f421c;if(_0x417d67[_0x11625c(0x189)]!==_0x4abde8[_0x11625c(0x189)])return _0x417d67[_0x11625c(0x189)]-_0x4abde8[_0x11625c(0x189)];if(_0x417d67[_0x11625c(0x182)]!==_0x4abde8[_0x11625c(0x182)])return _0x417d67[_0x11625c(0x182)]-_0x4abde8[_0x11625c(0x182)];return _0x417d67['patch']-_0x4abde8[_0x11625c(0x1a5)];}async function checkClaudeVersion(_0x306bed,_0x14fa31){const _0x4d3a2e=a9_0x1f421c;_0x14fa31?.[_0x4d3a2e(0x16a)](_0x4d3a2e(0x165)+_0x306bed+')');const _0x178dea=await executeClaudeCommand(['--version'],undefined,_0x14fa31),_0x29de15=parseVersion(_0x178dea);if(!_0x29de15){_0x14fa31?.[_0x4d3a2e(0x143)](_0x4d3a2e(0x1c8)+_0x178dea);return;}const _0x5f4030=_0x29de15[_0x4d3a2e(0x189)]+'.'+_0x29de15[_0x4d3a2e(0x182)]+'.'+_0x29de15[_0x4d3a2e(0x1a5)],_0x280a7b=parseVersion(_0x306bed);if(!_0x280a7b){_0x14fa31?.[_0x4d3a2e(0x143)]('Invalid\x20minimum\x20version\x20format:\x20'+_0x306bed);return;}if(compareVersions(_0x29de15,_0x280a7b)<0x0){_0x14fa31?.[_0x4d3a2e(0x16f)](_0x4d3a2e(0x198)+_0x5f4030+_0x4d3a2e(0x1a7)+_0x306bed+')');throw new SDKError(ErrorCode[_0x4d3a2e(0x187)],'Claude\x20Code\x20version\x20'+_0x5f4030+_0x4d3a2e(0x13a)+_0x306bed+_0x4d3a2e(0x1b2),undefined,{'helpText':_0x4d3a2e(0x162)});}_0x14fa31?.['debug']('Claude\x20Code\x20version\x20'+_0x5f4030+_0x4d3a2e(0x14f));}async function executeClaudeCommand(_0x36d6ad,_0x4ecab3,_0x2625c1){const _0x8bb62b=a9_0x1f421c;return _0x2625c1?.['info'](_0x8bb62b(0x169)+_0x36d6ad[_0x8bb62b(0x171)]('\x20')),new Promise((_0x465dc2,_0x110159)=>{const _0x43db0e=_0x8bb62b,_0x24db6b=crossSpawn(_0x43db0e(0x160),_0x36d6ad,{'stdio':'pipe'});let _0x147bd8='',_0x49437e='';_0x24db6b['stdout']?.['on'](_0x43db0e(0x17b),_0x35aa95=>{const _0x4020c7=_0x43db0e;_0x147bd8+=_0x35aa95[_0x4020c7(0x193)]();}),_0x24db6b[_0x43db0e(0x1a4)]?.['on'](_0x43db0e(0x17b),_0x59f4d3=>{const _0x1c48c0=_0x43db0e;_0x49437e+=_0x59f4d3[_0x1c48c0(0x193)]();}),_0x24db6b['on'](_0x43db0e(0x16f),_0x14f9ee=>{const _0x399258=_0x43db0e;_0x14f9ee[_0x399258(0x1b5)]===_0x399258(0x190)?(_0x2625c1?.[_0x399258(0x16f)](_0x399258(0x180)),_0x110159(new SDKError(ErrorCode[_0x399258(0x178)],'Claude\x20Code\x20CLI\x20not\x20found',_0x14f9ee,{'helpText':_0x399258(0x13f)}))):(_0x2625c1?.[_0x399258(0x16f)](_0x399258(0x153)+_0x14f9ee['message']),_0x110159(new SDKError(ErrorCode[_0x399258(0x166)],_0x399258(0x15a)+_0x14f9ee[_0x399258(0x16d)],_0x14f9ee)));}),_0x24db6b['on']('exit',_0x2b7048=>{const _0x21f431=_0x43db0e;if(_0x2b7048===0x0)_0x465dc2(_0x147bd8);else _0x4ecab3?(_0x2625c1?.['error'](_0x21f431(0x18f)+_0x2b7048+_0x21f431(0x1b1)+_0x36d6ad[_0x21f431(0x171)]('\x20')),_0x110159(new SDKError(ErrorCode[_0x21f431(0x1bb)],_0x4ecab3,new Error(_0x49437e)))):_0x465dc2('');});});}async function ensureMcpServer(_0x227ff7,_0x1167d8,_0x173e31,_0x2cbc1d,_0x3264e8){const _0x47d61d=a9_0x1f421c;_0x2cbc1d['text']='Configuring\x20MCP\x20server\x20\x27'+_0x227ff7+_0x47d61d(0x140),await executeClaudeCommand([_0x47d61d(0x195),_0x47d61d(0x18e),_0x227ff7,_0x1167d8,_0x47d61d(0x188),_0x173e31],_0x47d61d(0x17e)+_0x227ff7+'\x27',_0x3264e8),_0x2cbc1d[_0x47d61d(0x146)]=_0x47d61d(0x149)+_0x227ff7+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x5bd756=process.env.TDX_TD_SKILLS_REPO;if(_0x5bd756)return _0x5bd756;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x438e7f,_0xfc5632){const _0x3d8e54=a9_0x1f421c;try{const _0x11b704=await executeClaudeCommand([_0x3d8e54(0x1bc),'marketplace',_0x3d8e54(0x13c)],_0x3d8e54(0x1a3),_0xfc5632);if(!_0x11b704[_0x3d8e54(0x15c)](_0x438e7f)){_0xfc5632?.['debug'](_0x3d8e54(0x155)+_0x438e7f+_0x3d8e54(0x1c7));return;}await executeClaudeCommand(['plugin',_0x3d8e54(0x152),'remove',_0x438e7f],_0x3d8e54(0x1bf)+_0x438e7f+'\x27',_0xfc5632),_0xfc5632?.[_0x3d8e54(0x14a)](_0x3d8e54(0x155)+_0x438e7f+_0x3d8e54(0x163));}catch(_0x4486f8){_0xfc5632?.[_0x3d8e54(0x143)](_0x3d8e54(0x1bf)+_0x438e7f+_0x3d8e54(0x147)+_0x4486f8);}}function a9_0xd129(){const _0x2f2e4=['\x27...','Installing\x20plugin\x20\x27','http://127.0.0.1:','warn','✓\x20Settings\x20restored:\x20.claude/settings.local.json','continue','text','\x27:\x20','✓\x20Logging\x20to\x20','✓\x20MCP\x20server\x20\x27','info','fail','3920SJzWhw','td-skills','update','\x20meets\x20minimum\x20requirement','cwd','parse','marketplace','Command\x20spawn\x20error:\x20','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Marketplace\x20\x27','13437LDdydo','profile','1675032MAmTvo','ANTHROPIC_MODEL','Failed\x20to\x20spawn\x20claude\x20command:\x20','\x20→\x20','includes','Command\x20output:\x20','pid','Checking\x20Claude\x20Code\x20version...','claude','toISOString','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','\x27\x20removed','Setup\x20failed','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','INTERNAL','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','context','Executing:\x20claude\x20','debug','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','770000LEvBob','message','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','error','.claude','join','user','tdx\x20--profile\x20','✓\x20Marketplace\x20\x27','logger','Initializing...','false','CLAUDE_CODE_NOT_FOUND','2.0.20','getCurrent','data','sql-skills','install','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','ANTHROPIC_AUTH_TOKEN','Claude\x20Code\x20CLI\x20not\x20found','\x20already\x20configured','minor','197924wQeNch','passThroughServer','site','verbose','CLAUDE_CODE_UNSUPPORTED_VERSION','--transport','major','✓\x20Logs\x20saved\x20to\x20','http','close','already\x20installed','add','Command\x20failed\x20(exit\x20','ENOENT','5MUUhBY','apiKey','toString','getLogPath','mcp','statusLine','✓\x20Claude\x20Code\x20version\x20OK','Claude\x20Code\x20version\x20','Failed\x20to\x20launch\x20Claude\x20Code:\x20','already\x20exists','originalSettings','start','Restored\x20default\x20td-skills\x20marketplace','description','unshift','trim','CLAUDE_CODE_USE_VERTEX','match','Failed\x20to\x20list\x20marketplaces','stderr','patch','\x27\x20installed','\x20is\x20too\x20old\x20(minimum:\x20','env','stringify','649240prQtBm','td-skills\x20Plugins','.tdx-settings-backup.json','Configuring\x20marketplace\x20\x27','tdx-skills','tdx-managed-proxy','✓\x20Plugin\x20\x27','):\x20claude\x20','\x20or\x20later.','INVALID_ARGUMENT','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','code','Failed\x20to\x20configure\x20marketplace\x20\x27','settings.local.json','CLAUDE_CODE_USE_BEDROCK','td-docs','\x27\x20updated','INSTALLATION_FAILED','plugin','utf-8','account_id','Failed\x20to\x20remove\x20marketplace\x20\x27','stop','log','resume','1726390lAuLiC','6172548kFbmBw','\x27\x20configured','port','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','liveSessionOriginals','\x20configuration\x20failed','green','ANTHROPIC_BASE_URL','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','red','list','cause','command','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'];a9_0xd129=function(){return _0x2f2e4;};return a9_0xd129();}async function restoreDefaultTdSkillsMarketplace(_0x8bf75b){const _0x803fd=a9_0x1f421c;try{await removeMarketplace(_0x803fd(0x14d),_0x8bf75b),await executeClaudeCommand([_0x803fd(0x1bc),_0x803fd(0x152),'add',DEFAULT_TD_SKILLS_URL],undefined,_0x8bf75b),_0x8bf75b?.[_0x803fd(0x14a)](_0x803fd(0x19d));}catch{}}async function ensureMarketplace(_0x6ae6c,_0xcb450f,_0xc0d07d,_0xde7c8f){const _0x2ee182=a9_0x1f421c;_0xc0d07d['text']=_0x2ee182(0x1ad)+_0x6ae6c+_0x2ee182(0x140),await executeClaudeCommand([_0x2ee182(0x1bc),_0x2ee182(0x152),_0x2ee182(0x18e),_0xcb450f],_0x2ee182(0x1b6)+_0x6ae6c+'\x27',_0xde7c8f),_0xc0d07d[_0x2ee182(0x146)]=_0x2ee182(0x174)+_0x6ae6c+_0x2ee182(0x1c5);}async function updateMarketplace(_0x5506b7,_0x30d18c,_0x208876){const _0x2291c7=a9_0x1f421c;_0x30d18c['text']='Updating\x20marketplace\x20\x27'+_0x5506b7+_0x2291c7(0x140),await executeClaudeCommand(['plugin',_0x2291c7(0x152),_0x2291c7(0x14e)],'Failed\x20to\x20update\x20marketplace\x20\x27'+_0x5506b7+'\x27',_0x208876),_0x30d18c['text']='✓\x20Marketplace\x20\x27'+_0x5506b7+_0x2291c7(0x1ba);}async function ensurePlugin(_0x8a2fa4,_0x51a265,_0x6bab4f,_0x1f72f0){const _0x2ab37=a9_0x1f421c;_0x6bab4f['text']=_0x2ab37(0x141)+_0x8a2fa4+_0x2ab37(0x140),await executeClaudeCommand(['plugin',_0x2ab37(0x17d),_0x8a2fa4+'@'+_0x51a265],'Failed\x20to\x20install\x20plugin\x20\x27'+_0x8a2fa4+'\x27',_0x1f72f0),_0x6bab4f[_0x2ab37(0x146)]=_0x2ab37(0x1b0)+_0x8a2fa4+_0x2ab37(0x1a6);}async function createClaudeSettings(_0x419bc6,_0x1ba248,_0x67b3eb){const _0x4b624e=a9_0x1f421c,_0x576d07=join(process[_0x4b624e(0x150)](),_0x4b624e(0x170)),_0x20f58d=join(_0x576d07,'settings.local.json'),_0x2f318b=join(_0x576d07,SETTINGS_BACKUP_FILENAME);await mkdir(_0x576d07,{'recursive':!![]});const _0x37bf90=await recoverFromStaleBackup(_0x20f58d,_0x2f318b);let _0x3a7aeb;if(_0x37bf90)_0x3a7aeb=_0x37bf90[_0x4b624e(0x1c9)];else{let _0x146553={};if(existsSync(_0x20f58d))try{const _0x244925=await readFile(_0x20f58d,_0x4b624e(0x1bd));_0x146553=JSON[_0x4b624e(0x151)](_0x244925);}catch{_0x146553={};}const _0x146d04=_0x146553[_0x4b624e(0x1a8)]||{};_0x3a7aeb={'ANTHROPIC_BASE_URL':_0x146d04['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x146d04[_0x4b624e(0x159)],'ANTHROPIC_AUTH_TOKEN':_0x146d04[_0x4b624e(0x17f)],'CLAUDE_CODE_USE_BEDROCK':_0x146d04[_0x4b624e(0x1b8)],'CLAUDE_CODE_USE_VERTEX':_0x146d04['CLAUDE_CODE_USE_VERTEX'],'statusLine':_0x146553['statusLine']};const _0x33ebce={'createdAt':new Date()[_0x4b624e(0x161)](),'pid':process[_0x4b624e(0x15e)],'originalSettings':_0x3a7aeb};await writeFile(_0x2f318b,JSON['stringify'](_0x33ebce,null,0x2)+'\x0a');}let _0x5091cc={};if(existsSync(_0x20f58d))try{const _0xe9787=await readFile(_0x20f58d,_0x4b624e(0x1bd));_0x5091cc=JSON[_0x4b624e(0x151)](_0xe9787);}catch{_0x5091cc={};}const _0x2e1d0f=_0x5091cc[_0x4b624e(0x1a8)]||{},_0x8ff387={..._0x5091cc,'env':{..._0x2e1d0f,'ANTHROPIC_BASE_URL':_0x4b624e(0x142)+_0x419bc6,..._0x1ba248&&{'ANTHROPIC_MODEL':_0x1ba248},'ANTHROPIC_AUTH_TOKEN':'tdx-managed-proxy','CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':'false'},'statusLine':{'type':_0x4b624e(0x13e),'command':_0x67b3eb?_0x4b624e(0x173)+_0x67b3eb+'\x20claude\x20statusline':'tdx\x20claude\x20statusline'}};return await writeFile(_0x20f58d,JSON[_0x4b624e(0x1a9)](_0x8ff387,null,0x2)+'\x0a'),_0x3a7aeb;}async function restoreClaudeSettings(_0x5816df){const _0x3998aa=a9_0x1f421c,_0x36e809=join(process['cwd'](),_0x3998aa(0x170)),_0x505ef4=join(_0x36e809,_0x3998aa(0x1b7)),_0xe05c9d=join(_0x36e809,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x505ef4,_0x5816df);try{if(existsSync(_0xe05c9d)){const _0x4bfdb8=await readFile(_0xe05c9d,_0x3998aa(0x1bd)),_0x3bceef=JSON[_0x3998aa(0x151)](_0x4bfdb8);_0x3bceef['pid']===process[_0x3998aa(0x15e)]&&await safeUnlink(_0xe05c9d);}}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a9_0x1f421c(0x160);[a9_0x1f421c(0x19e)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';[a9_0x1f421c(0x184)];[a9_0x1f421c(0x19b)];[a9_0x1f421c(0x175)];[a9_0x1f421c(0x1c6)];async['execute'](_0xfef856){const _0xada4b2=a9_0x1f421c,{tdx:_0x49e153,options:_0x1fe89d,args:_0x531ac6}=_0xfef856;let _0x3449fc=![];try{const _0x3af58e=_0x1fe89d,_0x2efc9b=_0x3af58e['proxy']===![],_0x4e6d36=_0x3af58e[_0xada4b2(0x145)]===!![],_0x5b3f57=_0x3af58e[_0xada4b2(0x1c2)]===!![],_0x23cb95=[..._0x531ac6];if(_0x4e6d36)_0x23cb95[_0xada4b2(0x19f)]('-c');else _0x5b3f57&&_0x23cb95[_0xada4b2(0x19f)]('-r');const _0xa3f7c6=createCommandSpinner(_0xada4b2(0x176),{'verbose':_0x1fe89d[_0xada4b2(0x186)]});_0xa3f7c6[_0xada4b2(0x19c)]();try{if(!_0x2efc9b){const _0x5ef8cb=_0x1fe89d[_0xada4b2(0x157)];try{const _0x2e1d10=await _0x49e153[_0xada4b2(0x172)][_0xada4b2(0x17a)]();_0x2e1d10[_0xada4b2(0x1be)]&&writeCachedAccountInfo(_0x1fe89d['site'],_0x2e1d10[_0xada4b2(0x1be)],_0x5ef8cb);}catch{}_0xa3f7c6[_0xada4b2(0x146)]='Initializing\x20proxy\x20logger...',this[_0xada4b2(0x175)]=new TDXLogger(_0x1fe89d['logLevel'],!![]),await this['logger']['init']();const _0xa66814=this[_0xada4b2(0x175)][_0xada4b2(0x194)]();_0xa3f7c6[_0xada4b2(0x146)]=_0xada4b2(0x148)+_0xa66814;const _0x55f8df=getEndpoint(_0x1fe89d['site'],'llm-proxy');_0xa3f7c6[_0xada4b2(0x146)]=_0xada4b2(0x1b4);if(!_0x49e153[_0xada4b2(0x168)][_0xada4b2(0x192)])throw new SDKError(ErrorCode[_0xada4b2(0x1b3)],_0xada4b2(0x16e));this['passThroughServer']=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x55f8df,'apiKey':_0x49e153[_0xada4b2(0x168)][_0xada4b2(0x192)],'logger':this[_0xada4b2(0x175)],'site':_0x1fe89d[_0xada4b2(0x185)],'profile':_0x5ef8cb}),await this[_0xada4b2(0x184)][_0xada4b2(0x19c)](),this['port']=this[_0xada4b2(0x184)]['port'],_0xa3f7c6['text']=_0xada4b2(0x167)+this[_0xada4b2(0x1c6)]+_0xada4b2(0x15b)+_0x55f8df,_0xa3f7c6['text']='Creating\x20.claude/settings.local.json...',this[_0xada4b2(0x19b)]=await createClaudeSettings(this[_0xada4b2(0x1c6)],undefined,_0x5ef8cb),_0xa3f7c6[_0xada4b2(0x146)]=_0xada4b2(0x154);}else _0xa3f7c6['text']='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';try{_0xa3f7c6[_0xada4b2(0x146)]=_0xada4b2(0x15f),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0xada4b2(0x175)]),_0xa3f7c6[_0xada4b2(0x146)]=_0xada4b2(0x197);}catch(_0x1320c5){_0xa3f7c6[_0xada4b2(0x14b)]('Claude\x20Code\x20version\x20check\x20failed');throw _0x1320c5;}try{await ensureMcpServer(_0xada4b2(0x1b9),'https://docs.treasuredata.com/mcp',_0xada4b2(0x18b),_0xa3f7c6,this['logger']);}catch(_0x1d1ea9){handleInstallationError(_0x1d1ea9,'TD\x20Docs\x20MCP\x20Server',_0xa3f7c6,this[_0xada4b2(0x175)]);}try{const _0x4b8e7b=getTdSkillsRepoUrl();_0x3449fc=_0x4b8e7b!==DEFAULT_TD_SKILLS_URL,_0x3449fc&&await removeMarketplace(_0xada4b2(0x14d),this[_0xada4b2(0x175)]),await ensureMarketplace(_0xada4b2(0x14d),_0x4b8e7b,_0xa3f7c6,this[_0xada4b2(0x175)]),await updateMarketplace(_0xada4b2(0x14d),_0xa3f7c6,this['logger']),await ensurePlugin(_0xada4b2(0x17c),'td-skills',_0xa3f7c6,this[_0xada4b2(0x175)]),await ensurePlugin('workflow-skills',_0xada4b2(0x14d),_0xa3f7c6,this['logger']),await ensurePlugin(_0xada4b2(0x1ae),'td-skills',_0xa3f7c6,this[_0xada4b2(0x175)]);}catch(_0x3c6d27){handleInstallationError(_0x3c6d27,_0xada4b2(0x1ab),_0xa3f7c6,this[_0xada4b2(0x175)]);}_0xa3f7c6[_0xada4b2(0x1c0)]();}catch(_0xafb7c4){_0xa3f7c6[_0xada4b2(0x14b)](_0xada4b2(0x164));throw _0xafb7c4;}const _0x1f52e1=await findExecutable(_0xada4b2(0x160));if(!_0x1f52e1)throw new SDKError(ErrorCode[_0xada4b2(0x178)],_0xada4b2(0x180),undefined,{'helpText':_0xada4b2(0x13f)});const _0x539b72={...process.env};!_0x2efc9b&&(_0x539b72['ANTHROPIC_BASE_URL']=_0xada4b2(0x142)+this['port'],_0x539b72['ANTHROPIC_AUTH_TOKEN']=_0xada4b2(0x1af),_0x539b72[_0xada4b2(0x1b8)]=_0xada4b2(0x177),_0x539b72[_0xada4b2(0x1a1)]=_0xada4b2(0x177));const _0x13bc34=crossSpawn(_0x1f52e1,_0x23cb95,{'stdio':'inherit','env':_0x539b72}),_0x34a015=await new Promise(_0x1d9e3b=>{const _0x4da845=_0xada4b2;_0x13bc34['on']('exit',_0x5c63f7=>{_0x1d9e3b(_0x5c63f7||0x0);}),_0x13bc34['on'](_0x4da845(0x16f),_0x26e106=>{const _0x4835b8=_0x4da845;console[_0x4835b8(0x16f)](a9_0x585012[_0x4835b8(0x13b)](_0x4835b8(0x199)+_0x26e106[_0x4835b8(0x16d)])),_0x1d9e3b(0x1);});});_0x3449fc&&await restoreDefaultTdSkillsMarketplace(this[_0xada4b2(0x175)]);this['passThroughServer']&&(await this[_0xada4b2(0x184)]['stop'](),console['log'](a9_0x585012[_0xada4b2(0x138)](_0xada4b2(0x16b))));if(this[_0xada4b2(0x175)]){await this[_0xada4b2(0x175)][_0xada4b2(0x18c)]();const _0x39f57e=this[_0xada4b2(0x175)][_0xada4b2(0x194)]();console[_0xada4b2(0x1c1)](a9_0x585012[_0xada4b2(0x138)](_0xada4b2(0x18a)+_0x39f57e));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0xada4b2(0x19b)]),console[_0xada4b2(0x1c1)](a9_0x585012['green'](_0xada4b2(0x144)))),_0x34a015;}catch(_0xa5149f){_0x3449fc&&await restoreDefaultTdSkillsMarketplace(this[_0xada4b2(0x175)]);this['passThroughServer']&&await this[_0xada4b2(0x184)]['stop']();this['logger']&&await this['logger'][_0xada4b2(0x18c)]();this[_0xada4b2(0x19b)]&&await restoreClaudeSettings(this['originalSettings']);throw _0xa5149f;}}}
@@ -1 +1 @@
1
- const a10_0x25d638=a10_0x140a;(function(_0x2c5e4a,_0x2110d6){const _0x552178=a10_0x140a,_0xf8ef86=_0x2c5e4a();while(!![]){try{const _0x585414=-parseInt(_0x552178(0x153))/0x1+-parseInt(_0x552178(0x16f))/0x2+-parseInt(_0x552178(0x168))/0x3*(-parseInt(_0x552178(0x15d))/0x4)+-parseInt(_0x552178(0x166))/0x5*(-parseInt(_0x552178(0x179))/0x6)+-parseInt(_0x552178(0x158))/0x7+-parseInt(_0x552178(0x174))/0x8+-parseInt(_0x552178(0x161))/0x9*(-parseInt(_0x552178(0x163))/0xa);if(_0x585414===_0x2110d6)break;else _0xf8ef86['push'](_0xf8ef86['shift']());}catch(_0x1f1665){_0xf8ef86['push'](_0xf8ef86['shift']());}}}(a10_0x7ddc,0xda400));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';function a10_0x7ddc(){const _0xaadddd=['todayCredits','9892449gctDmz','accountId','🧠\x20','monthCredits','stdin','1456236igvDUV','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','current_usage','toFixed','189SindqJ','\x20-\x20','1654110oWjwcf','profile','execute','6202985qdnGST','💎\x20tdx\x20-\x20Claude','3ByvjiQ','statusline','log','\x20|\x20','tdx\x20','used_percentage','tdx','264310tLMHyz','context_window','💎\x20','🪙\x20credit:\x20','cache_creation_input_tokens','7378568dZbxxV','round','input_tokens','close','push','6bxavPy','\x20session\x20/\x20','sessionCredits','name','1716652dqpdRE','cache_read_input_tokens','site','join'];a10_0x7ddc=function(){return _0xaadddd;};return a10_0x7ddc();}import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0xa5965b=0x64){return new Promise(_0x54ba6c=>{const _0x543e02=a10_0x140a;let _0x3f6cb4='',_0x587d31=![];const _0xda5c8b=createInterface({'input':process[_0x543e02(0x15c)],'terminal':![]}),_0x1706db=_0x4c2e76=>{const _0x22f83e=_0x543e02;if(_0x587d31)return;_0x587d31=!![],clearTimeout(_0x57305f),_0xda5c8b[_0x22f83e(0x177)](),_0x54ba6c(_0x4c2e76);},_0x57305f=setTimeout(()=>{_0x1706db(null);},_0xa5965b);_0xda5c8b['on']('line',_0x559ea9=>{_0x3f6cb4+=_0x559ea9;}),_0xda5c8b['on'](_0x543e02(0x177),()=>{if(_0x587d31)return;try{const _0x503dc9=JSON['parse'](_0x3f6cb4);_0x1706db(_0x503dc9);}catch{_0x1706db(null);}});});}function a10_0x140a(_0x4aadfc,_0x8926a8){_0x4aadfc=_0x4aadfc-0x151;const _0x7ddce8=a10_0x7ddc();let _0x140a36=_0x7ddce8[_0x4aadfc];return _0x140a36;}function formatCredits(_0x44f82a){const _0x41a270=a10_0x140a;return _0x44f82a[_0x41a270(0x160)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x25d638(0x152)]=a10_0x25d638(0x169);['description']=a10_0x25d638(0x15e);async[a10_0x25d638(0x165)](_0x148d00){const _0x1eb18c=a10_0x25d638;try{const _0x13a616=await readStdinJson();if(!_0x13a616?.['session_id'])return console[_0x1eb18c(0x16a)](_0x1eb18c(0x167)),0x0;const _0x409c12=_0x13a616['session_id'],_0x4c8c7d=_0x13a616['model']?.['id']||'',_0xb081f5=_0x13a616[_0x1eb18c(0x164)]||_0x148d00['options']['profile'],_0x218405=await getUsageStats(_0x409c12,_0xb081f5),_0xe5be47=[],_0x577614=readCachedAccountInfo(_0xb081f5),_0xc1209f=_0x577614?_0x1eb18c(0x16c)+_0x577614[_0x1eb18c(0x155)]+':'+_0x577614[_0x1eb18c(0x159)]:_0x1eb18c(0x16e),_0x47867a=_0x4c8c7d?getModelDisplayName(_0x4c8c7d):'Claude';_0xe5be47[_0x1eb18c(0x178)](_0x1eb18c(0x171)+_0xc1209f+_0x1eb18c(0x162)+_0x47867a);const _0x37784f=formatCredits(_0x218405[_0x1eb18c(0x151)]),_0x174f04=formatCredits(_0x218405[_0x1eb18c(0x157)]),_0x1f6a1e=formatCredits(_0x218405[_0x1eb18c(0x15b)]);_0xe5be47[_0x1eb18c(0x178)](_0x1eb18c(0x172)+_0x37784f+_0x1eb18c(0x17a)+_0x174f04+'\x20today\x20/\x20'+_0x1f6a1e+'\x20month');const _0x411d7c=_0x13a616[_0x1eb18c(0x170)],_0x413e83=_0x411d7c?.[_0x1eb18c(0x15f)];if(_0x413e83&&_0x411d7c?.[_0x1eb18c(0x16d)]!=null){const _0x3a7716=_0x413e83[_0x1eb18c(0x176)]+_0x413e83[_0x1eb18c(0x173)]+_0x413e83[_0x1eb18c(0x154)],_0x448f30=formatTokenCount(_0x3a7716),_0x46fd2e=Math[_0x1eb18c(0x175)](_0x411d7c[_0x1eb18c(0x16d)]);_0xe5be47[_0x1eb18c(0x178)](_0x1eb18c(0x15a)+_0x448f30+'\x20('+_0x46fd2e+'%)');}return console['log'](_0xe5be47[_0x1eb18c(0x156)](_0x1eb18c(0x16b))),0x0;}catch{return console[_0x1eb18c(0x16a)](_0x1eb18c(0x167)),0x0;}}}
1
+ const a10_0x213ac8=a10_0x3a20;(function(_0x386f32,_0x67d7ed){const _0x5c2e28=a10_0x3a20,_0x475fd7=_0x386f32();while(!![]){try{const _0x12eea4=parseInt(_0x5c2e28(0x1a1))/0x1+-parseInt(_0x5c2e28(0x194))/0x2*(-parseInt(_0x5c2e28(0x1b0))/0x3)+-parseInt(_0x5c2e28(0x199))/0x4*(-parseInt(_0x5c2e28(0x1ab))/0x5)+parseInt(_0x5c2e28(0x1a4))/0x6*(parseInt(_0x5c2e28(0x1a7))/0x7)+-parseInt(_0x5c2e28(0x1ae))/0x8*(parseInt(_0x5c2e28(0x19d))/0x9)+-parseInt(_0x5c2e28(0x192))/0xa+-parseInt(_0x5c2e28(0x1a0))/0xb*(-parseInt(_0x5c2e28(0x1b1))/0xc);if(_0x12eea4===_0x67d7ed)break;else _0x475fd7['push'](_0x475fd7['shift']());}catch(_0x19b26c){_0x475fd7['push'](_0x475fd7['shift']());}}}(a10_0xe375,0x4ce2b));import{createInterface}from'node:readline';function a10_0xe375(){const _0x4c757f=['\x20-\x20','195132Waqtdj','\x20|\x20','Claude','7UJmGyR','\x20today\x20/\x20','\x20month','join','9710sIzOCr','profile','push','3832UsrVXv','close','963453dQFjFZ','24coyqdi','🪙\x20credit:\x20','model','sessionCredits','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','cache_creation_input_tokens','\x20session\x20/\x20','session_id','statusline','tdx','cache_read_input_tokens','stdin','💎\x20tdx\x20-\x20Claude','🧠\x20','💎\x20','1489130ePhzfb','tdx\x20','2ZYxKup','context_window','monthCredits','toFixed','name','44HDZsPS','todayCredits','parse','used_percentage','5337adLaFa','description','input_tokens','347974OrreXQ','309580kvOmeP','log'];a10_0xe375=function(){return _0x4c757f;};return a10_0xe375();}import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';function a10_0x3a20(_0x3ebea4,_0x5cbc6b){_0x3ebea4=_0x3ebea4-0x188;const _0xe375f1=a10_0xe375();let _0x3a20ac=_0xe375f1[_0x3ebea4];return _0x3a20ac;}import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x28fdcc=0x64){return new Promise(_0x1b93ea=>{const _0x27c3ec=a10_0x3a20;let _0x445aff='',_0x133050=![];const _0x223f09=createInterface({'input':process[_0x27c3ec(0x18e)],'terminal':![]}),_0x20df24=_0x3321a2=>{const _0x569147=_0x27c3ec;if(_0x133050)return;_0x133050=!![],clearTimeout(_0x35b510),_0x223f09[_0x569147(0x1af)](),_0x1b93ea(_0x3321a2);},_0x35b510=setTimeout(()=>{_0x20df24(null);},_0x28fdcc);_0x223f09['on']('line',_0x48ee6e=>{_0x445aff+=_0x48ee6e;}),_0x223f09['on'](_0x27c3ec(0x1af),()=>{const _0xaf92c0=_0x27c3ec;if(_0x133050)return;try{const _0x7f03f2=JSON[_0xaf92c0(0x19b)](_0x445aff);_0x20df24(_0x7f03f2);}catch{_0x20df24(null);}});});}function formatCredits(_0x520ce6){const _0x3a70f9=a10_0x3a20;return _0x520ce6[_0x3a70f9(0x197)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x213ac8(0x198)]=a10_0x213ac8(0x18b);[a10_0x213ac8(0x19e)]=a10_0x213ac8(0x1b5);async['execute'](_0x594b30){const _0x28671d=a10_0x213ac8;try{const _0x56cb93=await readStdinJson();if(!_0x56cb93?.[_0x28671d(0x18a)])return console[_0x28671d(0x1a2)](_0x28671d(0x18f)),0x0;const _0x177b40=_0x56cb93[_0x28671d(0x18a)],_0x1dce31=_0x56cb93[_0x28671d(0x1b3)]?.['id']||'',_0x149495=_0x56cb93[_0x28671d(0x1ac)]||_0x594b30['options'][_0x28671d(0x1ac)],_0x423e87=await getUsageStats(_0x177b40,_0x149495),_0x318b8b=[],_0x5ef2fa=readCachedAccountInfo(_0x149495),_0x3dc070=_0x5ef2fa?_0x28671d(0x193)+_0x5ef2fa['site']+':'+_0x5ef2fa['accountId']:_0x28671d(0x18c),_0x2cd776=_0x1dce31?getModelDisplayName(_0x1dce31):_0x28671d(0x1a6);_0x318b8b[_0x28671d(0x1ad)](_0x28671d(0x191)+_0x3dc070+_0x28671d(0x1a3)+_0x2cd776);const _0x161351=formatCredits(_0x423e87[_0x28671d(0x1b4)]),_0x2542d2=formatCredits(_0x423e87[_0x28671d(0x19a)]),_0x5247fc=formatCredits(_0x423e87[_0x28671d(0x196)]);_0x318b8b[_0x28671d(0x1ad)](_0x28671d(0x1b2)+_0x161351+_0x28671d(0x189)+_0x2542d2+_0x28671d(0x1a8)+_0x5247fc+_0x28671d(0x1a9));const _0x17b585=_0x56cb93[_0x28671d(0x195)],_0x2f4ec7=_0x17b585?.['current_usage'];if(_0x2f4ec7&&_0x17b585?.[_0x28671d(0x19c)]!=null){const _0xa3f7fe=_0x2f4ec7[_0x28671d(0x19f)]+_0x2f4ec7[_0x28671d(0x188)]+_0x2f4ec7[_0x28671d(0x18d)],_0x1a078c=formatTokenCount(_0xa3f7fe),_0x15dcd8=Math['round'](_0x17b585[_0x28671d(0x19c)]);_0x318b8b['push'](_0x28671d(0x190)+_0x1a078c+'\x20('+_0x15dcd8+'%)');}return console[_0x28671d(0x1a2)](_0x318b8b[_0x28671d(0x1aa)](_0x28671d(0x1a5))),0x0;}catch{return console[_0x28671d(0x1a2)](_0x28671d(0x18f)),0x0;}}}
@@ -1 +1 @@
1
- function a11_0x5eda(_0x59d8d4,_0x278844){_0x59d8d4=_0x59d8d4-0xe1;const _0x4e2700=a11_0x4e27();let _0x5edaca=_0x4e2700[_0x59d8d4];return _0x5edaca;}const a11_0x13d905=a11_0x5eda;(function(_0x1b4622,_0x574760){const _0x32a252=a11_0x5eda,_0x25a9fe=_0x1b4622();while(!![]){try{const _0x3633f5=-parseInt(_0x32a252(0xfb))/0x1+-parseInt(_0x32a252(0x103))/0x2*(parseInt(_0x32a252(0x11c))/0x3)+parseInt(_0x32a252(0x100))/0x4*(parseInt(_0x32a252(0xe3))/0x5)+parseInt(_0x32a252(0x122))/0x6+parseInt(_0x32a252(0x101))/0x7+parseInt(_0x32a252(0x116))/0x8*(-parseInt(_0x32a252(0x107))/0x9)+parseInt(_0x32a252(0x106))/0xa;if(_0x3633f5===_0x574760)break;else _0x25a9fe['push'](_0x25a9fe['shift']());}catch(_0x5b5e80){_0x25a9fe['push'](_0x25a9fe['shift']());}}}(a11_0x4e27,0x411d6));import a11_0x2a2879 from'chalk';function a11_0x4e27(){const _0x1daa5c=['map','44dgFEzf','1292865hjzOGc','\x20\x20Today:\x20\x20\x20','2474vTMsAl','padEnd','lastUsedAt','8569670GyikLI','18kOqSSI','entryCount','dim','all','profile','toFixed','max','red','totalCredits','\x20credits','repeat','cyan','json','default','Source','1987528ZDHciI','2-digit','short','Usage\x20by\x20Profile','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','en-US','879PVdDSa','jsonl','Total','Profile','\x20days\x20ago','en-CA','142152HoZBrn','toLocaleDateString','source','(default)','140945gHWoVc','usage','profileCount','round','padStart','Today','credits','Month','monthCredits','today\x20','todayCredits','bold','Error:\x20','message','Last\x20Used','getTime','length','log','format','Unknown\x20error','outputStructured','yesterday','outputTable','\x20\x20Total:\x20\x20\x20','249400LXviex','numeric','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','Requests'];a11_0x4e27=function(){return _0x1daa5c;};return a11_0x4e27();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x57b4c1){const _0x702390=a11_0x5eda;return _0x57b4c1[_0x702390(0x10c)](0x2);}function formatLastUsed(_0x3237f4){const _0x5846cf=a11_0x5eda;if(!_0x3237f4)return'never';const _0x5756b3=new Date(_0x3237f4),_0x120a55=new Date(),_0x44c121=_0x5756b3[_0x5846cf(0x123)](_0x5846cf(0x121)),_0x800243=_0x120a55[_0x5846cf(0x123)](_0x5846cf(0x121));if(_0x44c121===_0x800243)return _0x5846cf(0xec)+_0x5756b3['toLocaleTimeString'](_0x5846cf(0x11b),{'hour':_0x5846cf(0x117),'minute':_0x5846cf(0x117)});const _0x4723c6=new Date(_0x44c121),_0x2ed8d3=new Date(_0x800243),_0x5b7da6=Math[_0x5846cf(0xe6)]((_0x2ed8d3[_0x5846cf(0xf2)]()-_0x4723c6[_0x5846cf(0xf2)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5b7da6===0x1)return _0x5846cf(0xf8);else return _0x5b7da6>0x1&&_0x5b7da6<0x7?_0x5b7da6+_0x5846cf(0x120):_0x5756b3[_0x5846cf(0x123)](_0x5846cf(0x11b),{'month':_0x5846cf(0x118),'day':_0x5846cf(0xfc)});}export class ClaudeUsageCommand extends BaseCommand{['name']=a11_0x13d905(0xe4);['description']='Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile';async['execute'](_0x3b1fc6){const _0x4ab365=a11_0x13d905,{options:_0x4da3ff}=_0x3b1fc6,_0x41e231=_0x4da3ff['format']==='json'||_0x4da3ff[_0x4ab365(0xf5)]===_0x4ab365(0x11d)||_0x4da3ff[_0x4ab365(0x113)];try{const [_0x445b7b,_0xc7881a,_0x4f1de8]=await Promise[_0x4ab365(0x10a)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x41e231?await this[_0x4ab365(0xf7)](_0x445b7b,_0xc7881a,_0x4f1de8,_0x4da3ff):this[_0x4ab365(0xf9)](_0x445b7b,_0xc7881a,_0x4f1de8),0x0;}catch(_0x2a40ac){const _0x553109=_0x2a40ac instanceof Error?_0x2a40ac[_0x4ab365(0xf0)]:_0x4ab365(0xf6);return console['error'](a11_0x2a2879[_0x4ab365(0x10e)](_0x4ab365(0xef)+_0x553109)),0x1;}}async[a11_0x13d905(0xf7)](_0x2abf6c,_0x5f12b5,_0x3407e9,_0x1e1f95){const _0x44923d=a11_0x13d905,_0x23d58d={'summary':{'todayCredits':_0x3407e9[_0x44923d(0xed)],'monthCredits':_0x3407e9[_0x44923d(0xeb)],'totalCredits':_0x3407e9[_0x44923d(0x10f)],'profileCount':_0x3407e9[_0x44923d(0xe5)]},'profiles':_0x2abf6c['map'](_0x27cbc7=>({'profile':_0x27cbc7[_0x44923d(0x10b)],'credits':_0x27cbc7['credits'],'requests':_0x27cbc7[_0x44923d(0x108)],'lastUsedAt':_0x27cbc7[_0x44923d(0x105)]})),'sources':_0x5f12b5[_0x44923d(0xff)](_0x133842=>({'source':_0x133842['source'],'credits':_0x133842['credits'],'todayCredits':_0x133842[_0x44923d(0xed)],'monthCredits':_0x133842['monthCredits'],'requests':_0x133842[_0x44923d(0x108)]}))};await handleSDKOutput([_0x23d58d],_0x1e1f95);}[a11_0x13d905(0xf9)](_0x15f572,_0x8264a1,_0x11cae5){const _0x49b50f=a11_0x13d905;console[_0x49b50f(0xf4)](a11_0x2a2879['bold'](_0x49b50f(0x11a))),console['log'](a11_0x2a2879[_0x49b50f(0x109)]('─'[_0x49b50f(0x111)](0x32))),console[_0x49b50f(0xf4)](_0x49b50f(0x102)+a11_0x2a2879[_0x49b50f(0x112)](formatCredits(_0x11cae5[_0x49b50f(0xed)]))+_0x49b50f(0x110)),console[_0x49b50f(0xf4)]('\x20\x20Month:\x20\x20\x20'+a11_0x2a2879[_0x49b50f(0x112)](formatCredits(_0x11cae5['monthCredits']))+_0x49b50f(0x110)),console[_0x49b50f(0xf4)](_0x49b50f(0xfa)+a11_0x2a2879[_0x49b50f(0x112)](formatCredits(_0x11cae5['totalCredits']))+_0x49b50f(0x110)),console['log']();if(_0x8264a1['length']>0x0){console[_0x49b50f(0xf4)](a11_0x2a2879[_0x49b50f(0xee)]('Usage\x20by\x20Source')),console[_0x49b50f(0xf4)](a11_0x2a2879[_0x49b50f(0x109)]('─'[_0x49b50f(0x111)](0x3c)));const _0x50529f=0xc,_0x3398bd=0xa,_0xadddd7=0xa,_0xdaaf2=0xa;console[_0x49b50f(0xf4)]('\x20\x20'+_0x49b50f(0x115)['padEnd'](_0x50529f)+'\x20\x20'+_0x49b50f(0x11e)[_0x49b50f(0xe7)](_0x3398bd)+'\x20\x20'+_0x49b50f(0xe8)[_0x49b50f(0xe7)](_0xadddd7)+'\x20\x20'+_0x49b50f(0xea)['padStart'](_0xdaaf2));for(const _0x5096ed of _0x8264a1){console[_0x49b50f(0xf4)]('\x20\x20'+_0x5096ed[_0x49b50f(0xe1)][_0x49b50f(0x104)](_0x50529f)+'\x20\x20'+a11_0x2a2879['cyan'](formatCredits(_0x5096ed['credits'])[_0x49b50f(0xe7)](_0x3398bd))+'\x20\x20'+formatCredits(_0x5096ed[_0x49b50f(0xed)])[_0x49b50f(0xe7)](_0xadddd7)+'\x20\x20'+formatCredits(_0x5096ed[_0x49b50f(0xeb)])[_0x49b50f(0xe7)](_0xdaaf2));}console['log']();}if(_0x15f572['length']===0x0){console['log'](a11_0x2a2879['dim']('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console[_0x49b50f(0xf4)](a11_0x2a2879['dim'](_0x49b50f(0xfd)));return;}console[_0x49b50f(0xf4)](a11_0x2a2879[_0x49b50f(0xee)](_0x49b50f(0x119))),console[_0x49b50f(0xf4)](a11_0x2a2879[_0x49b50f(0x109)]('─'[_0x49b50f(0x111)](0x3c)));const _0x261058=Math[_0x49b50f(0x10d)](0xc,..._0x15f572['map'](_0x486752=>_0x486752[_0x49b50f(0x10b)]==='default'?_0x49b50f(0xe2)['length']:_0x486752['profile'][_0x49b50f(0xf3)])),_0x1241a1=0xa,_0x191c41=0xa;console[_0x49b50f(0xf4)]('\x20\x20'+_0x49b50f(0x11f)[_0x49b50f(0x104)](_0x261058)+'\x20\x20'+'Credits'[_0x49b50f(0xe7)](_0x1241a1)+'\x20\x20'+_0x49b50f(0xfe)['padStart'](_0x191c41)+'\x20\x20'+_0x49b50f(0xf1));for(const _0x3bd3e1 of _0x15f572){const _0x408d08=_0x3bd3e1[_0x49b50f(0x10b)]===_0x49b50f(0x114)?_0x49b50f(0xe2):_0x3bd3e1[_0x49b50f(0x10b)],_0x3fcb46=_0x408d08[_0x49b50f(0x104)](_0x261058),_0x31674f=_0x3bd3e1[_0x49b50f(0x10b)]===_0x49b50f(0x114)?a11_0x2a2879[_0x49b50f(0x109)](_0x3fcb46):_0x3fcb46;console[_0x49b50f(0xf4)]('\x20\x20'+_0x31674f+'\x20\x20'+a11_0x2a2879[_0x49b50f(0x112)](formatCredits(_0x3bd3e1[_0x49b50f(0xe9)])[_0x49b50f(0xe7)](_0x1241a1))+'\x20\x20'+String(_0x3bd3e1[_0x49b50f(0x108)])[_0x49b50f(0xe7)](_0x191c41)+'\x20\x20'+a11_0x2a2879[_0x49b50f(0x109)](formatLastUsed(_0x3bd3e1['lastUsedAt'])));}console[_0x49b50f(0xf4)](),console['log'](a11_0x2a2879[_0x49b50f(0x109)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x49b50f(0xf4)]();}}
1
+ const a11_0x3fe216=a11_0x4b89;(function(_0x530d1d,_0x28d887){const _0x345a46=a11_0x4b89,_0xa2d77c=_0x530d1d();while(!![]){try{const _0x54fff1=parseInt(_0x345a46(0x105))/0x1*(-parseInt(_0x345a46(0xe9))/0x2)+-parseInt(_0x345a46(0x110))/0x3*(parseInt(_0x345a46(0x116))/0x4)+-parseInt(_0x345a46(0x111))/0x5+parseInt(_0x345a46(0x125))/0x6+-parseInt(_0x345a46(0xf8))/0x7+parseInt(_0x345a46(0xec))/0x8*(-parseInt(_0x345a46(0x126))/0x9)+parseInt(_0x345a46(0x12b))/0xa;if(_0x54fff1===_0x28d887)break;else _0xa2d77c['push'](_0xa2d77c['shift']());}catch(_0x366782){_0xa2d77c['push'](_0xa2d77c['shift']());}}}(a11_0x48f3,0xa4d42));import a11_0x176afb from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a11_0x48f3(){const _0xd990d3=['Total','\x20\x20Today:\x20\x20\x20','description','Today','en-US','375963TTwDfV','yesterday','dim','padStart','Unknown\x20error','map','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','bold','outputStructured','Profile','profile','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','profileCount','1zrjDqc','usage','2-digit','json','execute','round','getTime','outputTable','cyan','Usage\x20by\x20Profile','never','110379gVHJBY','1963550DRTUFR','en-CA','today\x20','monthCredits','Requests','28dLBQKu','toFixed','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','default','totalCredits','Month','red','\x20\x20Month:\x20\x20\x20','jsonl','log','lastUsedAt','Usage\x20by\x20Source','toLocaleTimeString','length','entryCount','2310924EqfxlX','9pVgiqz','(default)','all','short','source','19399820xzrgVO','Source','588662MLdbus','repeat','format','5213576eEWRip','\x20\x20Total:\x20\x20\x20','Credits','credits','padEnd','todayCredits','name'];a11_0x48f3=function(){return _0xd990d3;};return a11_0x48f3();}import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x7dbccc){const _0x1a8d30=a11_0x4b89;return _0x7dbccc[_0x1a8d30(0x117)](0x2);}function a11_0x4b89(_0x42f059,_0x1b4d78){_0x42f059=_0x42f059-0xe8;const _0x48f376=a11_0x48f3();let _0x4b89b1=_0x48f376[_0x42f059];return _0x4b89b1;}function formatLastUsed(_0x4ab388){const _0x2a793c=a11_0x4b89;if(!_0x4ab388)return _0x2a793c(0x10f);const _0x34e2b1=new Date(_0x4ab388),_0x103ecb=new Date(),_0x55200f=_0x34e2b1['toLocaleDateString']('en-CA'),_0x14ad73=_0x103ecb['toLocaleDateString'](_0x2a793c(0x112));if(_0x55200f===_0x14ad73)return _0x2a793c(0x113)+_0x34e2b1[_0x2a793c(0x122)]('en-US',{'hour':_0x2a793c(0x107),'minute':_0x2a793c(0x107)});const _0x79ba5=new Date(_0x55200f),_0x335029=new Date(_0x14ad73),_0x4f0713=Math[_0x2a793c(0x10a)]((_0x335029[_0x2a793c(0x10b)]()-_0x79ba5[_0x2a793c(0x10b)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x4f0713===0x1)return _0x2a793c(0xf9);else return _0x4f0713>0x1&&_0x4f0713<0x7?_0x4f0713+'\x20days\x20ago':_0x34e2b1['toLocaleDateString'](_0x2a793c(0xf7),{'month':_0x2a793c(0x129),'day':'numeric'});}export class ClaudeUsageCommand extends BaseCommand{[a11_0x3fe216(0xf2)]=a11_0x3fe216(0x106);[a11_0x3fe216(0xf5)]=a11_0x3fe216(0xfe);async[a11_0x3fe216(0x109)](_0x8eaf87){const _0x26a76d=a11_0x3fe216,{options:_0xc7e628}=_0x8eaf87,_0x4073c1=_0xc7e628[_0x26a76d(0xeb)]==='json'||_0xc7e628[_0x26a76d(0xeb)]===_0x26a76d(0x11e)||_0xc7e628[_0x26a76d(0x108)];try{const [_0xb813e2,_0x174f7d,_0x15238b]=await Promise[_0x26a76d(0x128)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x4073c1?await this[_0x26a76d(0x100)](_0xb813e2,_0x174f7d,_0x15238b,_0xc7e628):this[_0x26a76d(0x10c)](_0xb813e2,_0x174f7d,_0x15238b),0x0;}catch(_0x59a348){const _0x22ca84=_0x59a348 instanceof Error?_0x59a348['message']:_0x26a76d(0xfc);return console['error'](a11_0x176afb[_0x26a76d(0x11c)]('Error:\x20'+_0x22ca84)),0x1;}}async[a11_0x3fe216(0x100)](_0x4b9287,_0x10ff4a,_0x3a1e3f,_0x1fbb0b){const _0x526854=a11_0x3fe216,_0xff200={'summary':{'todayCredits':_0x3a1e3f[_0x526854(0xf1)],'monthCredits':_0x3a1e3f[_0x526854(0x114)],'totalCredits':_0x3a1e3f[_0x526854(0x11a)],'profileCount':_0x3a1e3f[_0x526854(0x104)]},'profiles':_0x4b9287['map'](_0x134f75=>({'profile':_0x134f75[_0x526854(0x102)],'credits':_0x134f75['credits'],'requests':_0x134f75['entryCount'],'lastUsedAt':_0x134f75['lastUsedAt']})),'sources':_0x10ff4a[_0x526854(0xfd)](_0x5b62ac=>({'source':_0x5b62ac[_0x526854(0x12a)],'credits':_0x5b62ac['credits'],'todayCredits':_0x5b62ac[_0x526854(0xf1)],'monthCredits':_0x5b62ac[_0x526854(0x114)],'requests':_0x5b62ac[_0x526854(0x124)]}))};await handleSDKOutput([_0xff200],_0x1fbb0b);}[a11_0x3fe216(0x10c)](_0x5efba7,_0x1c81da,_0x1254e7){const _0x1f271d=a11_0x3fe216;console[_0x1f271d(0x11f)](a11_0x176afb[_0x1f271d(0xff)](_0x1f271d(0x103))),console[_0x1f271d(0x11f)](a11_0x176afb[_0x1f271d(0xfa)]('─'[_0x1f271d(0xea)](0x32))),console[_0x1f271d(0x11f)](_0x1f271d(0xf4)+a11_0x176afb['cyan'](formatCredits(_0x1254e7[_0x1f271d(0xf1)]))+'\x20credits'),console[_0x1f271d(0x11f)](_0x1f271d(0x11d)+a11_0x176afb[_0x1f271d(0x10d)](formatCredits(_0x1254e7[_0x1f271d(0x114)]))+'\x20credits'),console[_0x1f271d(0x11f)](_0x1f271d(0xed)+a11_0x176afb[_0x1f271d(0x10d)](formatCredits(_0x1254e7['totalCredits']))+'\x20credits'),console[_0x1f271d(0x11f)]();if(_0x1c81da[_0x1f271d(0x123)]>0x0){console[_0x1f271d(0x11f)](a11_0x176afb[_0x1f271d(0xff)](_0x1f271d(0x121))),console[_0x1f271d(0x11f)](a11_0x176afb['dim']('─'[_0x1f271d(0xea)](0x3c)));const _0x1a88aa=0xc,_0x2458f9=0xa,_0x132b49=0xa,_0x37328f=0xa;console['log']('\x20\x20'+_0x1f271d(0xe8)[_0x1f271d(0xf0)](_0x1a88aa)+'\x20\x20'+_0x1f271d(0xf3)[_0x1f271d(0xfb)](_0x2458f9)+'\x20\x20'+_0x1f271d(0xf6)[_0x1f271d(0xfb)](_0x132b49)+'\x20\x20'+_0x1f271d(0x11b)[_0x1f271d(0xfb)](_0x37328f));for(const _0x5b6177 of _0x1c81da){console[_0x1f271d(0x11f)]('\x20\x20'+_0x5b6177[_0x1f271d(0x12a)][_0x1f271d(0xf0)](_0x1a88aa)+'\x20\x20'+a11_0x176afb[_0x1f271d(0x10d)](formatCredits(_0x5b6177[_0x1f271d(0xef)])['padStart'](_0x2458f9))+'\x20\x20'+formatCredits(_0x5b6177[_0x1f271d(0xf1)])[_0x1f271d(0xfb)](_0x132b49)+'\x20\x20'+formatCredits(_0x5b6177[_0x1f271d(0x114)])['padStart'](_0x37328f));}console[_0x1f271d(0x11f)]();}if(_0x5efba7['length']===0x0){console[_0x1f271d(0x11f)](a11_0x176afb[_0x1f271d(0xfa)](_0x1f271d(0x118))),console[_0x1f271d(0x11f)](a11_0x176afb[_0x1f271d(0xfa)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x1f271d(0x11f)](a11_0x176afb[_0x1f271d(0xff)](_0x1f271d(0x10e))),console[_0x1f271d(0x11f)](a11_0x176afb[_0x1f271d(0xfa)]('─'['repeat'](0x3c)));const _0x7121f1=Math['max'](0xc,..._0x5efba7[_0x1f271d(0xfd)](_0x34ae3b=>_0x34ae3b['profile']===_0x1f271d(0x119)?_0x1f271d(0x127)[_0x1f271d(0x123)]:_0x34ae3b[_0x1f271d(0x102)][_0x1f271d(0x123)])),_0x21f1e5=0xa,_0x2ce08e=0xa;console['log']('\x20\x20'+_0x1f271d(0x101)[_0x1f271d(0xf0)](_0x7121f1)+'\x20\x20'+_0x1f271d(0xee)[_0x1f271d(0xfb)](_0x21f1e5)+'\x20\x20'+_0x1f271d(0x115)[_0x1f271d(0xfb)](_0x2ce08e)+'\x20\x20'+'Last\x20Used');for(const _0x652221 of _0x5efba7){const _0x3e6edc=_0x652221['profile']===_0x1f271d(0x119)?_0x1f271d(0x127):_0x652221[_0x1f271d(0x102)],_0x50adcd=_0x3e6edc['padEnd'](_0x7121f1),_0x1958d8=_0x652221[_0x1f271d(0x102)]==='default'?a11_0x176afb['dim'](_0x50adcd):_0x50adcd;console[_0x1f271d(0x11f)]('\x20\x20'+_0x1958d8+'\x20\x20'+a11_0x176afb[_0x1f271d(0x10d)](formatCredits(_0x652221['credits'])['padStart'](_0x21f1e5))+'\x20\x20'+String(_0x652221[_0x1f271d(0x124)])[_0x1f271d(0xfb)](_0x2ce08e)+'\x20\x20'+a11_0x176afb['dim'](formatLastUsed(_0x652221[_0x1f271d(0x120)])));}console[_0x1f271d(0x11f)](),console['log'](a11_0x176afb['dim']('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x1f271d(0x11f)]();}}
@@ -1 +1 @@
1
- const a12_0x3da54a=a12_0x2ea1;(function(_0x57dda6,_0x568194){const _0x34d085=a12_0x2ea1,_0x3e75f3=_0x57dda6();while(!![]){try{const _0x404c99=parseInt(_0x34d085(0xa9))/0x1+-parseInt(_0x34d085(0x99))/0x2*(parseInt(_0x34d085(0xaa))/0x3)+-parseInt(_0x34d085(0xb6))/0x4*(parseInt(_0x34d085(0xaf))/0x5)+parseInt(_0x34d085(0x9f))/0x6+parseInt(_0x34d085(0xac))/0x7*(parseInt(_0x34d085(0xab))/0x8)+parseInt(_0x34d085(0xa5))/0x9*(-parseInt(_0x34d085(0x9d))/0xa)+parseInt(_0x34d085(0xa7))/0xb*(parseInt(_0x34d085(0x9b))/0xc);if(_0x404c99===_0x568194)break;else _0x3e75f3['push'](_0x3e75f3['shift']());}catch(_0x254fda){_0x3e75f3['push'](_0x3e75f3['shift']());}}}(a12_0x9564,0x554bf));function a12_0x9564(){const _0x527096=['.\x20Must\x20be\x20a\x20number.','dim','debug','limit','options','Error:\x20','\x20--profile\x20','message','isValid','validateGlobalOptions','get','red','error','5386vtIcqs','To\x20check\x20your\x20current\x20auth\x20status:','144kHOwDl','detail','15830KITnwf','yellow','1437588prwYrL','execute','cyan','status','helpText','profile','1899yyWpCD','stack','425205KgAJzn','Authentication\x20error\x20stack\x20trace:','58666nBogWD','33HKcaiR','24IXUOJv','1220639GdlvFM','name','from','10JuqzRr','\x27\x20is\x20already\x20registered','Authentication\x20failed','problemDetails','values','test','has','1144488yaldxo','command','commands','USER_ERROR'];a12_0x9564=function(){return _0x527096;};return a12_0x9564();}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_0x17c15c from'chalk';function a12_0x2ea1(_0x5e3dc4,_0xbf1a6c){_0x5e3dc4=_0x5e3dc4-0x93;const _0x95640a=a12_0x9564();let _0x2ea144=_0x95640a[_0x5e3dc4];return _0x2ea144;}export function printAuthError(_0x2ba273,_0x15c166=![],_0x178581){const _0x1980c8=a12_0x2ea1,_0x326447=_0x2ba273[_0x1980c8(0xb2)]?.[_0x1980c8(0x9c)]||_0x2ba273['message'];console['error'](a12_0x17c15c['red'](_0x1980c8(0xb1))),console['error'](a12_0x17c15c['red']('Reason:\x20'+_0x326447));if(_0x15c166){const _0x8315c3=_0x178581?_0x1980c8(0xc0)+_0x178581:'';console[_0x1980c8(0x98)]('\x0a'+a12_0x17c15c['dim']('To\x20set\x20up\x20authentication:')),console[_0x1980c8(0x98)]('\x20\x20'+a12_0x17c15c[_0x1980c8(0xa1)]('tdx\x20auth\x20setup'+_0x8315c3)+'\x0a'),console[_0x1980c8(0x98)](''+a12_0x17c15c[_0x1980c8(0xbb)](_0x1980c8(0x9a))),console['error']('\x20\x20'+a12_0x17c15c[_0x1980c8(0xa1)]('tdx\x20auth'+_0x8315c3));}}export class BaseCommand{['validateGlobalOptions'](_0x35d0de){const _0x262d55=a12_0x2ea1,{options:_0x45e43a}=_0x35d0de,_0x5883e5=_0x45e43a[_0x262d55(0xbd)];if(_0x5883e5!==undefined){const _0x487286=typeof _0x5883e5==='number'?_0x5883e5:parseInt(_0x5883e5,0xa);if(isNaN(_0x487286))return'Invalid\x20limit\x20value:\x20'+_0x5883e5+_0x262d55(0xba);const _0x4ddb2f=validateLimitOption(_0x487286);if(!_0x4ddb2f[_0x262d55(0x94)])return _0x4ddb2f['error'];_0x35d0de[_0x262d55(0xbe)][_0x262d55(0xbd)]=_0x4ddb2f['value'];}return undefined;}['validate'](_0x46b3da){return undefined;}async['run'](_0x4f916a){const _0x1f3e6b=a12_0x2ea1;try{const _0x55999d=this[_0x1f3e6b(0x95)](_0x4f916a);if(_0x55999d)return console[_0x1f3e6b(0x98)](_0x1f3e6b(0xbf)+_0x55999d),0x1;const _0x453d2a=this['validate'](_0x4f916a);if(_0x453d2a){const _0x1dfbea=/^\s*(Usage|Note|Warning|Error):/i[_0x1f3e6b(0xb4)](_0x453d2a);return _0x1dfbea?console['error'](_0x453d2a):console['error']('Error:\x20'+_0x453d2a),0x1;}const _0x546851=await this[_0x1f3e6b(0xa0)](_0x4f916a);return _0x546851??0x0;}catch(_0x394610){if(_0x394610 instanceof Error){if(_0x394610 instanceof HTTPClientError&&_0x394610[_0x1f3e6b(0xa2)]===0x191){const _0x4803e2=_0x4f916a[_0x1f3e6b(0xbe)][_0x1f3e6b(0xa4)];printAuthError(_0x394610,!![],_0x4803e2);if(_0x394610[_0x1f3e6b(0xa6)]){const _0x13e85d=Logger['of'](_0x1f3e6b(0xb7));_0x13e85d[_0x1f3e6b(0xbc)](_0x1f3e6b(0xa8)),_0x13e85d['debug'](_0x394610[_0x1f3e6b(0xa6)]);}return 0x1;}console[_0x1f3e6b(0x98)](a12_0x17c15c[_0x1f3e6b(0x97)](_0x1f3e6b(0xbf)+_0x394610[_0x1f3e6b(0x93)]));_0x394610 instanceof SDKError&&_0x394610['helpText']&&console[_0x1f3e6b(0x98)](a12_0x17c15c[_0x1f3e6b(0x9e)](_0x394610[_0x1f3e6b(0xa3)]));const _0x1f9e66=_0x394610 instanceof SDKError&&_0x394610['category']===ErrorCategory[_0x1f3e6b(0xb9)];_0x394610[_0x1f3e6b(0xa6)]&&!_0x1f9e66&&console[_0x1f3e6b(0x98)]('\x0aStack\x20trace:\x0a'+_0x394610[_0x1f3e6b(0xa6)]);}else console[_0x1f3e6b(0x98)](_0x1f3e6b(0xbf)+String(_0x394610));return 0x1;}}}export class CommandRegistry{[a12_0x3da54a(0xb8)]=new Map();['register'](_0x2b7cb7){const _0x4f1177=a12_0x3da54a;if(this[_0x4f1177(0xb8)][_0x4f1177(0xb5)](_0x2b7cb7[_0x4f1177(0xad)]))throw new Error('Command\x20\x27'+_0x2b7cb7['name']+_0x4f1177(0xb0));this[_0x4f1177(0xb8)]['set'](_0x2b7cb7[_0x4f1177(0xad)],_0x2b7cb7);}[a12_0x3da54a(0x96)](_0x2e6929){const _0xc25aaa=a12_0x3da54a;return this['commands'][_0xc25aaa(0x96)](_0x2e6929);}['getAll'](){const _0x546cc5=a12_0x3da54a;return Array[_0x546cc5(0xae)](this[_0x546cc5(0xb8)][_0x546cc5(0xb3)]());}[a12_0x3da54a(0xb5)](_0x2e67f0){const _0x3a86a8=a12_0x3da54a;return this[_0x3a86a8(0xb8)][_0x3a86a8(0xb5)](_0x2e67f0);}}export const registry=new CommandRegistry();
1
+ const a12_0x6a9601=a12_0x3a9b;(function(_0x3af7ba,_0x1e3ea2){const _0x11cbe4=a12_0x3a9b,_0x5ea8e1=_0x3af7ba();while(!![]){try{const _0x51faa2=parseInt(_0x11cbe4(0x1ec))/0x1+-parseInt(_0x11cbe4(0x212))/0x2*(-parseInt(_0x11cbe4(0x20f))/0x3)+-parseInt(_0x11cbe4(0x1fa))/0x4*(-parseInt(_0x11cbe4(0x20d))/0x5)+parseInt(_0x11cbe4(0x21c))/0x6+parseInt(_0x11cbe4(0x1f2))/0x7*(-parseInt(_0x11cbe4(0x1f1))/0x8)+parseInt(_0x11cbe4(0x20e))/0x9+-parseInt(_0x11cbe4(0x1fe))/0xa*(parseInt(_0x11cbe4(0x200))/0xb);if(_0x51faa2===_0x1e3ea2)break;else _0x5ea8e1['push'](_0x5ea8e1['shift']());}catch(_0x57ca6d){_0x5ea8e1['push'](_0x5ea8e1['shift']());}}}(a12_0x5db1,0x2fac5));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';function a12_0x3a9b(_0x4a2ed8,_0x2fc9d6){_0x4a2ed8=_0x4a2ed8-0x1ea;const _0x5db1ea=a12_0x5db1();let _0x3a9bb7=_0x5db1ea[_0x4a2ed8];return _0x3a9bb7;}import a12_0x2ff165 from'chalk';export function printAuthError(_0x41dcf5,_0x597570=![],_0x5e4348){const _0x274d35=a12_0x3a9b,_0x38bb50=_0x41dcf5[_0x274d35(0x1fc)]?.[_0x274d35(0x1fd)]||_0x41dcf5[_0x274d35(0x216)];console[_0x274d35(0x1ef)](a12_0x2ff165[_0x274d35(0x204)](_0x274d35(0x1f4))),console['error'](a12_0x2ff165[_0x274d35(0x204)](_0x274d35(0x217)+_0x38bb50));if(_0x597570){const _0x189261=_0x5e4348?_0x274d35(0x20b)+_0x5e4348:'';console[_0x274d35(0x1ef)]('\x0a'+a12_0x2ff165[_0x274d35(0x1eb)]('To\x20set\x20up\x20authentication:')),console[_0x274d35(0x1ef)]('\x20\x20'+a12_0x2ff165[_0x274d35(0x1f5)](_0x274d35(0x206)+_0x189261)+'\x0a'),console[_0x274d35(0x1ef)](''+a12_0x2ff165['dim']('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x274d35(0x1ef)]('\x20\x20'+a12_0x2ff165['cyan']('tdx\x20auth'+_0x189261));}}export class BaseCommand{[a12_0x6a9601(0x201)](_0x120776){const _0x2da1d3=a12_0x6a9601,{options:_0x29d29e}=_0x120776,_0x6c61b2=_0x29d29e[_0x2da1d3(0x203)];if(_0x6c61b2!==undefined){const _0x58fee1=typeof _0x6c61b2===_0x2da1d3(0x1f0)?_0x6c61b2:parseInt(_0x6c61b2,0xa);if(isNaN(_0x58fee1))return _0x2da1d3(0x21a)+_0x6c61b2+_0x2da1d3(0x20c);const _0x4e5c91=validateLimitOption(_0x58fee1);if(!_0x4e5c91[_0x2da1d3(0x21b)])return _0x4e5c91[_0x2da1d3(0x1ef)];_0x120776[_0x2da1d3(0x213)]['limit']=_0x4e5c91['value'];}return undefined;}[a12_0x6a9601(0x1fb)](_0x1caadb){return undefined;}async[a12_0x6a9601(0x218)](_0x12a932){const _0x4d9d6f=a12_0x6a9601;try{const _0x2e58ef=this['validateGlobalOptions'](_0x12a932);if(_0x2e58ef)return console['error']('Error:\x20'+_0x2e58ef),0x1;const _0x36646a=this[_0x4d9d6f(0x1fb)](_0x12a932);if(_0x36646a){const _0xb1870=/^\s*(Usage|Note|Warning|Error):/i[_0x4d9d6f(0x210)](_0x36646a);return _0xb1870?console['error'](_0x36646a):console[_0x4d9d6f(0x1ef)]('Error:\x20'+_0x36646a),0x1;}const _0x401e08=await this[_0x4d9d6f(0x1f3)](_0x12a932);return _0x401e08??0x0;}catch(_0x331b8d){if(_0x331b8d instanceof Error){if(_0x331b8d instanceof HTTPClientError&&_0x331b8d[_0x4d9d6f(0x208)]===0x191){const _0x17062c=_0x12a932[_0x4d9d6f(0x213)][_0x4d9d6f(0x214)];printAuthError(_0x331b8d,!![],_0x17062c);if(_0x331b8d[_0x4d9d6f(0x211)]){const _0x1cb0af=Logger['of'](_0x4d9d6f(0x1ee));_0x1cb0af[_0x4d9d6f(0x209)]('Authentication\x20error\x20stack\x20trace:'),_0x1cb0af[_0x4d9d6f(0x209)](_0x331b8d[_0x4d9d6f(0x211)]);}return 0x1;}console[_0x4d9d6f(0x1ef)](a12_0x2ff165['red']('Error:\x20'+_0x331b8d['message']));_0x331b8d instanceof SDKError&&_0x331b8d[_0x4d9d6f(0x219)]&&console[_0x4d9d6f(0x1ef)](a12_0x2ff165['yellow'](_0x331b8d[_0x4d9d6f(0x219)]));const _0x3acab5=_0x331b8d instanceof SDKError&&_0x331b8d[_0x4d9d6f(0x1f8)]===ErrorCategory[_0x4d9d6f(0x20a)];_0x331b8d[_0x4d9d6f(0x211)]&&!_0x3acab5&&console['error'](_0x4d9d6f(0x205)+_0x331b8d[_0x4d9d6f(0x211)]);}else console[_0x4d9d6f(0x1ef)](_0x4d9d6f(0x1f6)+String(_0x331b8d));return 0x1;}}}function a12_0x5db1(){const _0x49a4e2=['4958dhldVP','options','profile','from','message','Reason:\x20','run','helpText','Invalid\x20limit\x20value:\x20','isValid','1751676lidoXv','getAll','dim','331807nMtyjP','commands','command','error','number','144qonuCy','148309NGmUEV','execute','Authentication\x20failed','cyan','Error:\x20','name','category','has','45956oHtluP','validate','problemDetails','detail','2020TThCbf','values','21241UBUSzA','validateGlobalOptions','set','limit','red','\x0aStack\x20trace:\x0a','tdx\x20auth\x20setup','get','status','debug','USER_ERROR','\x20--profile\x20','.\x20Must\x20be\x20a\x20number.','115TSQhCt','217431dbvAEH','66BYtlYW','test','stack'];a12_0x5db1=function(){return _0x49a4e2;};return a12_0x5db1();}export class CommandRegistry{[a12_0x6a9601(0x1ed)]=new Map();['register'](_0x3d4873){const _0x48a88c=a12_0x6a9601;if(this['commands'][_0x48a88c(0x1f9)](_0x3d4873[_0x48a88c(0x1f7)]))throw new Error('Command\x20\x27'+_0x3d4873[_0x48a88c(0x1f7)]+'\x27\x20is\x20already\x20registered');this[_0x48a88c(0x1ed)][_0x48a88c(0x202)](_0x3d4873['name'],_0x3d4873);}[a12_0x6a9601(0x207)](_0x5e8225){const _0x1320b7=a12_0x6a9601;return this['commands'][_0x1320b7(0x207)](_0x5e8225);}[a12_0x6a9601(0x1ea)](){const _0x2fa6fd=a12_0x6a9601;return Array[_0x2fa6fd(0x215)](this[_0x2fa6fd(0x1ed)][_0x2fa6fd(0x1ff)]());}['has'](_0x19465b){const _0x256a35=a12_0x6a9601;return this[_0x256a35(0x1ed)][_0x256a35(0x1f9)](_0x19465b);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a13_0x461c8f=a13_0x164e;(function(_0x4d6309,_0x34e242){const _0xbec3ef=a13_0x164e,_0x1c819b=_0x4d6309();while(!![]){try{const _0x59b91b=parseInt(_0xbec3ef(0x200))/0x1+parseInt(_0xbec3ef(0x224))/0x2+-parseInt(_0xbec3ef(0x1fa))/0x3+-parseInt(_0xbec3ef(0x20f))/0x4+parseInt(_0xbec3ef(0x1fc))/0x5*(-parseInt(_0xbec3ef(0x22a))/0x6)+parseInt(_0xbec3ef(0x1f9))/0x7+parseInt(_0xbec3ef(0x22f))/0x8;if(_0x59b91b===_0x34e242)break;else _0x1c819b['push'](_0x1c819b['shift']());}catch(_0x334b9c){_0x1c819b['push'](_0x1c819b['shift']());}}}(a13_0x405c,0xef832));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';function a13_0x164e(_0x3f7157,_0x458cd1){_0x3f7157=_0x3f7157-0x1e8;const _0x405c53=a13_0x405c();let _0x164e69=_0x405c53[_0x3f7157];return _0x164e69;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0x10c55d from'chalk';function a13_0x405c(){const _0x2deed0=['6770554uqupQT','2115366imfTDk','legacy','311735abfFyu','execute','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','push','1556260jZUXkN','connection','\x20[record]','Resolving\x20connector\x20type\x20or\x20name:\x20','validate','\x0aNo\x20fields\x20defined\x20in\x20schema','credential','owner','\x0aNo\x20credential\x20settings\x20defined','limit','Type:\x20','default_value','connection:schema','minimum','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','1803444alSaEg','error','slice','listTypes','sort','connection:show','log','length','cyan','connection:list','max','\x0aConnection:\x20','criteria','output','legacy_settings','hint','object','settings','title','\x0aAvailable\x20fields:','Listing\x20connector\x20types...','226216lwMHiu','Fetching\x20connection\x20\x27','\x0aCredential\x20settings:','enumeration','Site:\x20','record','84wQUjYJ','verbose','filter','\x27\x20(type:\x20','\x20connector\x20type','2986344IlRViT','List\x20available\x20connector\x20types','✔\x20Found\x20connection:\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','yellow','name','Show\x20connection\x20details','entries','hidden','findByName','connection:types','repeat','options','green','✔\x20Found\x20','Show\x20when:\x20','bold','\x20-\x20','\x27...','\x27\x20as\x20connector\x20type','join','Fetching\x20settings\x20for\x20connector\x20type:\x20','dim','resolve','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','maximum','\x0aConnector:\x20','connection:settings','list','padStart','map','blue','data','properties','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','No\x20available\x20fields\x20for\x20this\x20connector','value','input','type','description','getOutputSchema','\x20\x20\x20\x20'];a13_0x405c=function(){return _0x2deed0;};return a13_0x405c();}function normalizeSchemaForDisplay(_0x5af86c){const _0xb2fe1c=a13_0x164e,_0x58653d=_0x5af86c[_0xb2fe1c(0x1f0)]||[],_0x4dd7ff=_0x58653d['find'](_0x2089d5=>_0x2089d5[_0xb2fe1c(0x235)]===_0xb2fe1c(0x21d)&&_0x2089d5[_0xb2fe1c(0x1f5)]===_0xb2fe1c(0x229)&&_0x2089d5[_0xb2fe1c(0x1f0)]);if(_0x4dd7ff?.['properties']){const _0x4fbf70=_0x58653d[_0xb2fe1c(0x22c)](_0x3e4435=>_0x3e4435[_0xb2fe1c(0x235)]!==_0xb2fe1c(0x1fb)&&_0x3e4435[_0xb2fe1c(0x235)]!==_0xb2fe1c(0x21d));return[..._0x4fbf70,..._0x4dd7ff['properties']];}return _0x58653d[_0xb2fe1c(0x22c)](_0x495d89=>_0x495d89[_0xb2fe1c(0x235)]!==_0xb2fe1c(0x1fb));}function printSchemaFields(_0x375737,_0x3fc154){const _0x11f727=a13_0x164e,_0x362eb6='\x20\x20'['repeat'](_0x3fc154+0x1),_0x2400db='\x20\x20'[_0x11f727(0x23b)](_0x3fc154+0x2);for(const _0x1ab320 of _0x375737){if(!_0x1ab320['name'])continue;const _0x4e35ad=_0x1ab320[_0x11f727(0x1f5)]===_0x11f727(0x229)&&_0x1ab320['properties']&&_0x1ab320[_0x11f727(0x1f0)][_0x11f727(0x216)]>0x0&&_0x1ab320[_0x11f727(0x235)]!==_0x11f727(0x21d);let _0x115158=''+_0x362eb6+a13_0x10c55d[_0x11f727(0x23d)](_0x1ab320[_0x11f727(0x235)]);_0x1ab320['title']&&(_0x115158+=':\x20'+_0x1ab320[_0x11f727(0x221)]);if(_0x1ab320[_0x11f727(0x1f4)])_0x115158+=a13_0x10c55d[_0x11f727(0x246)]('\x20['+_0x1ab320[_0x11f727(0x1f4)]+']');else _0x4e35ad&&(_0x115158+=a13_0x10c55d['dim'](_0x11f727(0x202)));console[_0x11f727(0x215)](_0x115158);_0x1ab320[_0x11f727(0x1f6)]&&console[_0x11f727(0x215)](''+_0x2400db+a13_0x10c55d[_0x11f727(0x246)](_0x1ab320[_0x11f727(0x1f6)]));if(_0x1ab320[_0x11f727(0x227)]){const _0x34b871=_0x1ab320['enumeration'][_0x11f727(0x1ed)](_0x382cd8=>typeof _0x382cd8===_0x11f727(0x21f)&&_0x11f727(0x1f3)in _0x382cd8?_0x382cd8[_0x11f727(0x1f3)]:_0x382cd8)[_0x11f727(0x244)](',\x20');console[_0x11f727(0x215)](_0x2400db+'Options:\x20'+a13_0x10c55d['yellow'](_0x34b871));}_0x1ab320[_0x11f727(0x20b)]!==undefined&&console[_0x11f727(0x215)](_0x2400db+'Default:\x20'+a13_0x10c55d['blue'](String(_0x1ab320[_0x11f727(0x20b)])));if(_0x1ab320['minimum']!==undefined||_0x1ab320[_0x11f727(0x1e8)]!==undefined){const _0x4385d0=_0x1ab320[_0x11f727(0x20d)]!==undefined&&_0x1ab320[_0x11f727(0x1e8)]!==undefined?_0x1ab320[_0x11f727(0x20d)]+_0x11f727(0x241)+_0x1ab320['maximum']:_0x1ab320['minimum']!==undefined?'>=\x20'+_0x1ab320[_0x11f727(0x20d)]:'<=\x20'+_0x1ab320[_0x11f727(0x1e8)];console[_0x11f727(0x215)](_0x2400db+'Range:\x20'+a13_0x10c55d[_0x11f727(0x1ee)](_0x4385d0));}if(_0x1ab320[_0x11f727(0x21b)]){const _0x33fc12=Object[_0x11f727(0x237)](_0x1ab320[_0x11f727(0x21b)])[_0x11f727(0x1ed)](([_0x2db8e8,_0x36edc7])=>_0x2db8e8+'='+JSON['stringify'](_0x36edc7))[_0x11f727(0x244)](',\x20');console[_0x11f727(0x215)](''+_0x2400db+a13_0x10c55d['dim'](_0x11f727(0x23f)+_0x33fc12));}_0x4e35ad&&_0x1ab320[_0x11f727(0x1f0)]&&printSchemaFields(_0x1ab320['properties'],_0x3fc154+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x461c8f(0x235)]=a13_0x461c8f(0x218);[a13_0x461c8f(0x1f6)]='List\x20all\x20result\x20output\x20connections';async[a13_0x461c8f(0x1fd)](_0x1ecf7c){const _0x1506e1=a13_0x461c8f,{options:_0x115b3d,tdx:_0x44c2f5}=_0x1ecf7c;_0x115b3d[_0x1506e1(0x22b)]&&console[_0x1506e1(0x210)](_0x1506e1(0x228)+_0x115b3d[_0x1506e1(0x232)]);const _0x404c96=resolveLimit(_0x115b3d[_0x1506e1(0x209)],DEFAULT_LISTING_LIMIT),_0x4dc988=await withSpinner('Listing\x20connections...',()=>_0x44c2f5['connection'][_0x1506e1(0x1eb)](),{'verbose':_0x115b3d[_0x1506e1(0x22b)]}),_0xdcc37b=_0x4dc988[_0x1506e1(0x1ef)];console[_0x1506e1(0x210)](_0x1506e1(0x23e)+_0xdcc37b[_0x1506e1(0x216)]+'\x20connection'+(_0xdcc37b[_0x1506e1(0x216)]!==0x1?'s':''));if(isStructuredFormat(_0x115b3d)){const _0x5757db=_0xdcc37b[_0x1506e1(0x211)](0x0,_0x404c96);await handleSDKOutput(_0x5757db,{..._0x115b3d,'limit':_0x404c96});}else{const _0x34169e=_0xdcc37b[_0x1506e1(0x216)]>0x0?Math[_0x1506e1(0x219)](..._0xdcc37b[_0x1506e1(0x1ed)](_0x232804=>_0x232804[_0x1506e1(0x1f5)][_0x1506e1(0x216)])):0x0,_0x1d32ed=[];for(const _0x1f0b98 of _0xdcc37b){const _0x4af971=a13_0x10c55d[_0x1506e1(0x217)](_0x1f0b98[_0x1506e1(0x1f5)]['padStart'](_0x34169e)),_0x15f025=_0x1f0b98['owner']?.[_0x1506e1(0x235)]?_0x1506e1(0x241)+a13_0x10c55d[_0x1506e1(0x246)](_0x1f0b98[_0x1506e1(0x207)][_0x1506e1(0x235)]):'';_0x1d32ed[_0x1506e1(0x1ff)](_0x4af971+'\x20\x20'+_0x1f0b98['name']+_0x15f025);}await writeOutput(_0x1d32ed[_0x1506e1(0x244)]('\x0a'),_0x115b3d[_0x1506e1(0x21c)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x461c8f(0x235)]=a13_0x461c8f(0x214);[a13_0x461c8f(0x1f6)]=a13_0x461c8f(0x236);[a13_0x461c8f(0x204)](_0x55a515){const _0x56bd5c=a13_0x461c8f,{args:_0x1bf25e}=_0x55a515;if(!_0x1bf25e[0x0])return _0x56bd5c(0x233);return undefined;}async['execute'](_0x238cab){const _0x2ca93d=a13_0x461c8f,{options:_0x4e0cc5,args:_0x448f6c,tdx:_0x3de22a}=_0x238cab,_0x26e425=_0x448f6c[0x0];_0x4e0cc5[_0x2ca93d(0x22b)]&&(console[_0x2ca93d(0x210)](_0x2ca93d(0x228)+_0x4e0cc5[_0x2ca93d(0x232)]),console[_0x2ca93d(0x210)]('Looking\x20up\x20connection:\x20'+_0x26e425));const _0x2cdf68=await withSpinner(_0x2ca93d(0x225)+_0x26e425+_0x2ca93d(0x242),()=>_0x3de22a['connection'][_0x2ca93d(0x247)](_0x26e425),{'verbose':_0x4e0cc5['verbose']}),_0x56807c=_0x2cdf68[_0x2ca93d(0x1ef)];return console[_0x2ca93d(0x210)](_0x2ca93d(0x231)+_0x56807c[_0x2ca93d(0x235)]),await handleSingleObjectOutput(_0x56807c,_0x4e0cc5),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x461c8f(0x235)]=a13_0x461c8f(0x20c);[a13_0x461c8f(0x1f6)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';[a13_0x461c8f(0x204)](_0x5c09ae){const {args:_0x2ec618}=_0x5c09ae;if(!_0x2ec618[0x0])return'Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.';return undefined;}async['execute'](_0x5b170a){const _0x30149d=a13_0x461c8f,{options:_0x118393,args:_0x4fe57a,tdx:_0x571e16}=_0x5b170a,_0x23b703=_0x4fe57a[0x0];_0x118393['verbose']&&(console[_0x30149d(0x210)](_0x30149d(0x228)+_0x118393[_0x30149d(0x232)]),console[_0x30149d(0x210)](_0x30149d(0x203)+_0x23b703));let _0x3357f3=_0x23b703,_0x39fc95;try{const _0x2f87ce=await _0x571e16['connection'][_0x30149d(0x239)](_0x23b703);_0x2f87ce&&(_0x3357f3=_0x2f87ce[_0x30149d(0x1f5)],_0x39fc95=_0x2f87ce[_0x30149d(0x235)],_0x118393[_0x30149d(0x22b)]&&console[_0x30149d(0x210)]('✔\x20Resolved\x20\x27'+_0x23b703+_0x30149d(0x20e)+_0x3357f3));}catch{_0x118393['verbose']&&console['error']('Treating\x20\x27'+_0x23b703+_0x30149d(0x243));}const _0x1c377e=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x3357f3+_0x30149d(0x242),()=>_0x571e16[_0x30149d(0x201)]['getOutputSchema'](_0x3357f3),{'verbose':_0x118393[_0x30149d(0x22b)]}),_0x323f9c=_0x1c377e['data'];_0x39fc95?console[_0x30149d(0x210)]('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x39fc95+_0x30149d(0x22d)+_0x3357f3+')'):console[_0x30149d(0x210)](_0x30149d(0x248)+_0x3357f3);if(isStructuredFormat(_0x118393))await handleSingleObjectOutput(_0x323f9c,_0x118393);else{const _0x43a4fd=normalizeSchemaForDisplay(_0x323f9c);_0x39fc95?(console['log'](_0x30149d(0x21a)+a13_0x10c55d[_0x30149d(0x217)](_0x39fc95)),console[_0x30149d(0x215)](_0x30149d(0x20a)+a13_0x10c55d['dim'](_0x3357f3))):console[_0x30149d(0x215)](_0x30149d(0x1e9)+a13_0x10c55d[_0x30149d(0x217)](_0x3357f3)),_0x43a4fd[_0x30149d(0x216)]>0x0?(console['log'](a13_0x10c55d[_0x30149d(0x240)](_0x30149d(0x222))),printSchemaFields(_0x43a4fd,0x0)):console[_0x30149d(0x215)](a13_0x10c55d[_0x30149d(0x246)](_0x30149d(0x205)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a13_0x461c8f(0x23a);[a13_0x461c8f(0x1f6)]=a13_0x461c8f(0x230);async['execute'](_0x2dbba9){const _0x206e8c=a13_0x461c8f,{options:_0x22c238,tdx:_0x34b039}=_0x2dbba9;_0x22c238[_0x206e8c(0x22b)]&&console[_0x206e8c(0x210)](_0x206e8c(0x228)+_0x22c238[_0x206e8c(0x232)]);const _0x310079=await withSpinner(_0x206e8c(0x223),()=>_0x34b039[_0x206e8c(0x201)][_0x206e8c(0x212)](),{'verbose':_0x22c238[_0x206e8c(0x22b)]}),_0x49f830=_0x310079[_0x206e8c(0x1ef)][_0x206e8c(0x213)]((_0x28bd24,_0x2dc75d)=>_0x28bd24['type']['localeCompare'](_0x2dc75d[_0x206e8c(0x1f5)]));console[_0x206e8c(0x210)]('✔\x20Found\x20'+_0x49f830[_0x206e8c(0x216)]+_0x206e8c(0x22e)+(_0x49f830['length']!==0x1?'s':''));if(isStructuredFormat(_0x22c238))await handleSDKOutput(_0x49f830,_0x22c238);else{const _0x46b8a3=_0x49f830[_0x206e8c(0x216)]>0x0?Math[_0x206e8c(0x219)](..._0x49f830[_0x206e8c(0x1ed)](_0x139453=>_0x139453['type'][_0x206e8c(0x216)])):0x0,_0x3e3928=[];for(const _0x5d6809 of _0x49f830){const _0x174a9e=a13_0x10c55d['cyan'](_0x5d6809[_0x206e8c(0x1f5)][_0x206e8c(0x1ec)](_0x46b8a3));_0x3e3928[_0x206e8c(0x1ff)](_0x174a9e+'\x20\x20'+_0x5d6809['name']);}await writeOutput(_0x3e3928[_0x206e8c(0x244)]('\x0a'),_0x22c238[_0x206e8c(0x21c)],'table');}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x461c8f(0x235)]=a13_0x461c8f(0x1ea);[a13_0x461c8f(0x1f6)]=a13_0x461c8f(0x1f1);['validate'](_0x83a8a6){const {args:_0x225419}=_0x83a8a6;if(!_0x225419[0x0])return'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.';return undefined;}async[a13_0x461c8f(0x1fd)](_0x17be75){const _0x17dba7=a13_0x461c8f,{options:_0x43b013,args:_0x49c67c,tdx:_0x3caad5}=_0x17be75,_0x259c7f=_0x49c67c[0x0];_0x43b013[_0x17dba7(0x22b)]&&(console[_0x17dba7(0x210)](_0x17dba7(0x228)+_0x43b013['site']),console[_0x17dba7(0x210)](_0x17dba7(0x245)+_0x259c7f));const _0x4ee97d=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x259c7f+'\x27...',()=>_0x3caad5[_0x17dba7(0x201)]['getMetadata'](_0x259c7f),{'verbose':_0x43b013['verbose']}),_0x3b0e41=_0x4ee97d[_0x17dba7(0x1ef)];console[_0x17dba7(0x210)](_0x17dba7(0x1fe)+_0x259c7f);if(isStructuredFormat(_0x43b013))await handleSingleObjectOutput(_0x3b0e41,_0x43b013);else{console[_0x17dba7(0x215)]('\x0aConnector:\x20'+a13_0x10c55d[_0x17dba7(0x217)](_0x259c7f)),console[_0x17dba7(0x215)]('Name:\x20'+_0x3b0e41[_0x17dba7(0x235)]);const _0x473df6=_0x3b0e41[_0x17dba7(0x220)]||[],_0x497387=_0x473df6[_0x17dba7(0x22c)](_0x5e4c32=>_0x5e4c32['credential']);_0x497387[_0x17dba7(0x216)]>0x0&&(console[_0x17dba7(0x215)](a13_0x10c55d['bold'](_0x17dba7(0x226))),printMetadataSettings(_0x497387));let _0x5dde8d=![];try{const _0x41b2a3=await _0x3caad5[_0x17dba7(0x201)][_0x17dba7(0x1f7)](_0x259c7f),_0x1241e6=normalizeSchemaForDisplay(_0x41b2a3);_0x1241e6[_0x17dba7(0x216)]>0x0&&(console[_0x17dba7(0x215)](a13_0x10c55d[_0x17dba7(0x240)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x1241e6,0x0),_0x5dde8d=!![]);}catch{const _0x208ea5=_0x473df6[_0x17dba7(0x22c)](_0x5ab688=>!_0x5ab688[_0x17dba7(0x206)]);_0x208ea5[_0x17dba7(0x216)]>0x0&&(console[_0x17dba7(0x215)](a13_0x10c55d[_0x17dba7(0x240)](_0x17dba7(0x222))),printMetadataSettings(_0x208ea5),_0x5dde8d=!![]);}!_0x5dde8d&&_0x43b013[_0x17dba7(0x22b)]&&console[_0x17dba7(0x210)](a13_0x10c55d[_0x17dba7(0x246)](_0x17dba7(0x1f2))),_0x497387[_0x17dba7(0x216)]===0x0&&console[_0x17dba7(0x215)](a13_0x10c55d[_0x17dba7(0x246)](_0x17dba7(0x208)));}return 0x0;}}function printMetadataSettings(_0x3238b2){const _0x4ec1ba=a13_0x461c8f;for(const _0x3dde6c of _0x3238b2){if(!_0x3dde6c['name'])continue;if(_0x3dde6c[_0x4ec1ba(0x238)])continue;let _0x2f7db5='\x20\x20'+a13_0x10c55d['green'](_0x3dde6c['name']);_0x3dde6c['label']&&(_0x2f7db5+=':\x20'+_0x3dde6c['label']);_0x3dde6c[_0x4ec1ba(0x1f5)]&&(_0x2f7db5+=a13_0x10c55d[_0x4ec1ba(0x246)]('\x20['+_0x3dde6c['type']+']'));console[_0x4ec1ba(0x215)](_0x2f7db5);_0x3dde6c[_0x4ec1ba(0x21e)]&&console['log'](_0x4ec1ba(0x1f8)+a13_0x10c55d[_0x4ec1ba(0x246)](_0x3dde6c[_0x4ec1ba(0x21e)]));if(_0x3dde6c['options']){const _0x301079=_0x3dde6c[_0x4ec1ba(0x23c)]['map'](_0x266073=>_0x266073[_0x4ec1ba(0x1f3)])[_0x4ec1ba(0x244)](',\x20');console[_0x4ec1ba(0x215)]('\x20\x20\x20\x20Options:\x20'+a13_0x10c55d[_0x4ec1ba(0x234)](_0x301079));}_0x3dde6c[_0x4ec1ba(0x20b)]!==undefined&&_0x3dde6c[_0x4ec1ba(0x20b)]!==null&&console[_0x4ec1ba(0x215)]('\x20\x20\x20\x20Default:\x20'+a13_0x10c55d[_0x4ec1ba(0x1ee)](String(_0x3dde6c[_0x4ec1ba(0x20b)])));if(_0x3dde6c['criteria']){const _0x5dc5a8=Object[_0x4ec1ba(0x237)](_0x3dde6c[_0x4ec1ba(0x21b)])['map'](([_0x295acf,_0x4f08cd])=>_0x295acf+'='+JSON['stringify'](_0x4f08cd))[_0x4ec1ba(0x244)](',\x20');console[_0x4ec1ba(0x215)](_0x4ec1ba(0x1f8)+a13_0x10c55d[_0x4ec1ba(0x246)](_0x4ec1ba(0x23f)+_0x5dc5a8));}}}
1
+ const a13_0x4f47d5=a13_0x43c3;function a13_0x2f75(){const _0x4ddf6f=['site','connection:schema','\x0aConnector:\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.','legacy','localeCompare','✔\x20Found\x20schema\x20for\x20connection\x20\x27','Looking\x20up\x20connection:\x20','Name:\x20','list','77hWFKlQ','object','52575xHzDxg','sort','\x0aConnection:\x20','\x27\x20as\x20connector\x20type','List\x20available\x20connector\x20types','connection:list','default_value','data','Site:\x20','Fetching\x20connection\x20\x27','error','owner','blue','135516oyODfe','Treating\x20\x27','value','9lPDbwV','>=\x20','log','hint','\x20connector\x20type','\x20[record]','validate','type','\x20\x20\x20\x20Options:\x20','✔\x20Found\x20','length','Resolving\x20connector\x20type\x20or\x20name:\x20','✔\x20Found\x20connection:\x20','Listing\x20connector\x20types...','legacy_settings','4OuBhCI','\x20\x20\x20\x20Default:\x20','find','description','minimum','\x20\x20\x20\x20','\x20connection','24auLaDB','Type:\x20','slice','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','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.','1475220bQNJGS','397502nlntiI','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','verbose','execute','output','209540LxrUvk','getMetadata','\x27...','criteria','connection:show','join','record','repeat','connection:settings','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','push','padStart','Listing\x20connections...','entries','Fetching\x20settings\x20for\x20\x27','Show\x20connection\x20details','maximum','properties','resolve','filter','findByName','\x0aAvailable\x20fields:','\x20-\x20','3977440ikdoUP','label','✔\x20Resolved\x20\x27','Fetching\x20schema\x20for\x20\x27','connection','stringify','67529WewHDv','dim','options','max','yellow','map','listTypes','\x0aNo\x20fields\x20defined\x20in\x20schema','credential','green','getOutputSchema','bold','cyan','188bZOqJR','name'];a13_0x2f75=function(){return _0x4ddf6f;};return a13_0x2f75();}(function(_0x54022c,_0x25bca8){const _0x3f6bcb=a13_0x43c3,_0x36a7b3=_0x54022c();while(!![]){try{const _0x77f83a=parseInt(_0x3f6bcb(0x194))/0x1*(parseInt(_0x3f6bcb(0x1ce))/0x2)+-parseInt(_0x3f6bcb(0x1bc))/0x3+parseInt(_0x3f6bcb(0x1a1))/0x4*(-parseInt(_0x3f6bcb(0x1af))/0x5)+parseInt(_0x3f6bcb(0x1d5))/0x6*(parseInt(_0x3f6bcb(0x171))/0x7)+parseInt(_0x3f6bcb(0x18e))/0x8*(parseInt(_0x3f6bcb(0x1bf))/0x9)+parseInt(_0x3f6bcb(0x176))/0xa*(-parseInt(_0x3f6bcb(0x1ad))/0xb)+parseInt(_0x3f6bcb(0x170))/0xc;if(_0x77f83a===_0x25bca8)break;else _0x36a7b3['push'](_0x36a7b3['shift']());}catch(_0x489aa9){_0x36a7b3['push'](_0x36a7b3['shift']());}}}(a13_0x2f75,0x48546));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a13_0x43c3(_0xb471a2,_0x3183ca){_0xb471a2=_0xb471a2-0x16f;const _0x2f7514=a13_0x2f75();let _0x43c3db=_0x2f7514[_0xb471a2];return _0x43c3db;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0x1ebbc9 from'chalk';function normalizeSchemaForDisplay(_0x57fd02){const _0x4b738c=a13_0x43c3,_0x248963=_0x57fd02['properties']||[],_0x3937c2=_0x248963[_0x4b738c(0x1d0)](_0x4673b7=>_0x4673b7[_0x4b738c(0x1a2)]===_0x4b738c(0x1cd)&&_0x4673b7[_0x4b738c(0x1c6)]==='record'&&_0x4673b7['properties']);if(_0x3937c2?.['properties']){const _0x54d3d9=_0x248963['filter'](_0x4938a2=>_0x4938a2[_0x4b738c(0x1a2)]!==_0x4b738c(0x1a7)&&_0x4938a2['name']!==_0x4b738c(0x1cd));return[..._0x54d3d9,..._0x3937c2[_0x4b738c(0x188)]];}return _0x248963['filter'](_0x5d69d1=>_0x5d69d1[_0x4b738c(0x1a2)]!=='legacy');}function printSchemaFields(_0x4c83f0,_0x30c377){const _0x49e685=a13_0x43c3,_0xab9dbe='\x20\x20'[_0x49e685(0x17d)](_0x30c377+0x1),_0x5a39b2='\x20\x20'['repeat'](_0x30c377+0x2);for(const _0x697ac0 of _0x4c83f0){if(!_0x697ac0[_0x49e685(0x1a2)])continue;const _0x57e327=_0x697ac0['type']===_0x49e685(0x17c)&&_0x697ac0[_0x49e685(0x188)]&&_0x697ac0[_0x49e685(0x188)][_0x49e685(0x1c9)]>0x0&&_0x697ac0[_0x49e685(0x1a2)]!=='legacy_settings';let _0x2a790d=''+_0xab9dbe+a13_0x1ebbc9[_0x49e685(0x19d)](_0x697ac0['name']);_0x697ac0['title']&&(_0x2a790d+=':\x20'+_0x697ac0['title']);if(_0x697ac0['input'])_0x2a790d+=a13_0x1ebbc9[_0x49e685(0x195)]('\x20['+_0x697ac0['input']+']');else _0x57e327&&(_0x2a790d+=a13_0x1ebbc9[_0x49e685(0x195)](_0x49e685(0x1c4)));console[_0x49e685(0x1c1)](_0x2a790d);_0x697ac0[_0x49e685(0x1d1)]&&console[_0x49e685(0x1c1)](''+_0x5a39b2+a13_0x1ebbc9['dim'](_0x697ac0[_0x49e685(0x1d1)]));if(_0x697ac0['enumeration']){const _0x209aac=_0x697ac0['enumeration'][_0x49e685(0x199)](_0x5c0fa2=>typeof _0x5c0fa2===_0x49e685(0x1ae)&&_0x49e685(0x1be)in _0x5c0fa2?_0x5c0fa2[_0x49e685(0x1be)]:_0x5c0fa2)['join'](',\x20');console[_0x49e685(0x1c1)](_0x5a39b2+'Options:\x20'+a13_0x1ebbc9[_0x49e685(0x198)](_0x209aac));}_0x697ac0[_0x49e685(0x1b5)]!==undefined&&console[_0x49e685(0x1c1)](_0x5a39b2+'Default:\x20'+a13_0x1ebbc9[_0x49e685(0x1bb)](String(_0x697ac0[_0x49e685(0x1b5)])));if(_0x697ac0[_0x49e685(0x1d2)]!==undefined||_0x697ac0[_0x49e685(0x187)]!==undefined){const _0x64c665=_0x697ac0[_0x49e685(0x1d2)]!==undefined&&_0x697ac0[_0x49e685(0x187)]!==undefined?_0x697ac0[_0x49e685(0x1d2)]+_0x49e685(0x18d)+_0x697ac0[_0x49e685(0x187)]:_0x697ac0[_0x49e685(0x1d2)]!==undefined?_0x49e685(0x1c0)+_0x697ac0[_0x49e685(0x1d2)]:'<=\x20'+_0x697ac0[_0x49e685(0x187)];console[_0x49e685(0x1c1)](_0x5a39b2+'Range:\x20'+a13_0x1ebbc9[_0x49e685(0x1bb)](_0x64c665));}if(_0x697ac0[_0x49e685(0x179)]){const _0x3a0ba8=Object[_0x49e685(0x184)](_0x697ac0[_0x49e685(0x179)])[_0x49e685(0x199)](([_0x235b0d,_0x4e9d37])=>_0x235b0d+'='+JSON[_0x49e685(0x193)](_0x4e9d37))[_0x49e685(0x17b)](',\x20');console['log'](''+_0x5a39b2+a13_0x1ebbc9['dim']('Show\x20when:\x20'+_0x3a0ba8));}_0x57e327&&_0x697ac0['properties']&&printSchemaFields(_0x697ac0[_0x49e685(0x188)],_0x30c377+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x4f47d5(0x1a2)]=a13_0x4f47d5(0x1b4);[a13_0x4f47d5(0x1d1)]='List\x20all\x20result\x20output\x20connections';async[a13_0x4f47d5(0x174)](_0x539db1){const _0x13b6e0=a13_0x4f47d5,{options:_0x45afe0,tdx:_0x2007bf}=_0x539db1;_0x45afe0[_0x13b6e0(0x173)]&&console[_0x13b6e0(0x1b9)](_0x13b6e0(0x1b7)+_0x45afe0[_0x13b6e0(0x1a3)]);const _0x52c96a=resolveLimit(_0x45afe0['limit'],DEFAULT_LISTING_LIMIT),_0x2bc9f8=await withSpinner(_0x13b6e0(0x183),()=>_0x2007bf['connection'][_0x13b6e0(0x1ac)](),{'verbose':_0x45afe0[_0x13b6e0(0x173)]}),_0x46bcf5=_0x2bc9f8['data'];console[_0x13b6e0(0x1b9)](_0x13b6e0(0x1c8)+_0x46bcf5[_0x13b6e0(0x1c9)]+_0x13b6e0(0x1d4)+(_0x46bcf5['length']!==0x1?'s':''));if(isStructuredFormat(_0x45afe0)){const _0x1add09=_0x46bcf5[_0x13b6e0(0x1d7)](0x0,_0x52c96a);await handleSDKOutput(_0x1add09,{..._0x45afe0,'limit':_0x52c96a});}else{const _0x56eaed=_0x46bcf5[_0x13b6e0(0x1c9)]>0x0?Math[_0x13b6e0(0x197)](..._0x46bcf5[_0x13b6e0(0x199)](_0x383709=>_0x383709[_0x13b6e0(0x1c6)][_0x13b6e0(0x1c9)])):0x0,_0x1b4274=[];for(const _0x1f4795 of _0x46bcf5){const _0x177fd3=a13_0x1ebbc9[_0x13b6e0(0x1a0)](_0x1f4795['type'][_0x13b6e0(0x182)](_0x56eaed)),_0x2e35af=_0x1f4795[_0x13b6e0(0x1ba)]?.[_0x13b6e0(0x1a2)]?'\x20-\x20'+a13_0x1ebbc9['dim'](_0x1f4795[_0x13b6e0(0x1ba)][_0x13b6e0(0x1a2)]):'';_0x1b4274['push'](_0x177fd3+'\x20\x20'+_0x1f4795[_0x13b6e0(0x1a2)]+_0x2e35af);}await writeOutput(_0x1b4274[_0x13b6e0(0x17b)]('\x0a'),_0x45afe0[_0x13b6e0(0x175)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a13_0x4f47d5(0x1a2)]=a13_0x4f47d5(0x17a);[a13_0x4f47d5(0x1d1)]=a13_0x4f47d5(0x186);[a13_0x4f47d5(0x1c5)](_0x5d4494){const _0x3b9cd0=a13_0x4f47d5,{args:_0x5131a4}=_0x5d4494;if(!_0x5131a4[0x0])return _0x3b9cd0(0x1d8);return undefined;}async[a13_0x4f47d5(0x174)](_0x4d22cb){const _0x4f44f6=a13_0x4f47d5,{options:_0x4b27af,args:_0x4d9cee,tdx:_0x48bf4a}=_0x4d22cb,_0x18140f=_0x4d9cee[0x0];_0x4b27af[_0x4f44f6(0x173)]&&(console['error'](_0x4f44f6(0x1b7)+_0x4b27af[_0x4f44f6(0x1a3)]),console[_0x4f44f6(0x1b9)](_0x4f44f6(0x1aa)+_0x18140f));const _0x57acd6=await withSpinner(_0x4f44f6(0x1b8)+_0x18140f+_0x4f44f6(0x178),()=>_0x48bf4a[_0x4f44f6(0x192)][_0x4f44f6(0x189)](_0x18140f),{'verbose':_0x4b27af[_0x4f44f6(0x173)]}),_0x5df595=_0x57acd6[_0x4f44f6(0x1b6)];return console['error'](_0x4f44f6(0x1cb)+_0x5df595[_0x4f44f6(0x1a2)]),await handleSingleObjectOutput(_0x5df595,_0x4b27af),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x4f47d5(0x1a2)]=a13_0x4f47d5(0x1a4);[a13_0x4f47d5(0x1d1)]=a13_0x4f47d5(0x17f);['validate'](_0x53da76){const _0x58624a=a13_0x4f47d5,{args:_0xb38daf}=_0x53da76;if(!_0xb38daf[0x0])return _0x58624a(0x16f);return undefined;}async['execute'](_0x3da4b2){const _0x29554d=a13_0x4f47d5,{options:_0x45e7b3,args:_0x236347,tdx:_0x339634}=_0x3da4b2,_0x40b547=_0x236347[0x0];_0x45e7b3[_0x29554d(0x173)]&&(console[_0x29554d(0x1b9)](_0x29554d(0x1b7)+_0x45e7b3[_0x29554d(0x1a3)]),console[_0x29554d(0x1b9)](_0x29554d(0x1ca)+_0x40b547));let _0x1e73e5=_0x40b547,_0x26e45f;try{const _0x4f136d=await _0x339634[_0x29554d(0x192)][_0x29554d(0x18b)](_0x40b547);_0x4f136d&&(_0x1e73e5=_0x4f136d[_0x29554d(0x1c6)],_0x26e45f=_0x4f136d[_0x29554d(0x1a2)],_0x45e7b3['verbose']&&console['error'](_0x29554d(0x190)+_0x40b547+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x1e73e5));}catch{_0x45e7b3[_0x29554d(0x173)]&&console[_0x29554d(0x1b9)](_0x29554d(0x1bd)+_0x40b547+_0x29554d(0x1b2));}const _0x2a0d83=await withSpinner(_0x29554d(0x191)+_0x1e73e5+_0x29554d(0x178),()=>_0x339634[_0x29554d(0x192)][_0x29554d(0x19e)](_0x1e73e5),{'verbose':_0x45e7b3[_0x29554d(0x173)]}),_0x9ab27c=_0x2a0d83[_0x29554d(0x1b6)];_0x26e45f?console[_0x29554d(0x1b9)](_0x29554d(0x1a9)+_0x26e45f+'\x27\x20(type:\x20'+_0x1e73e5+')'):console[_0x29554d(0x1b9)](_0x29554d(0x172)+_0x1e73e5);if(isStructuredFormat(_0x45e7b3))await handleSingleObjectOutput(_0x9ab27c,_0x45e7b3);else{const _0x3e3752=normalizeSchemaForDisplay(_0x9ab27c);_0x26e45f?(console[_0x29554d(0x1c1)](_0x29554d(0x1b1)+a13_0x1ebbc9['cyan'](_0x26e45f)),console[_0x29554d(0x1c1)](_0x29554d(0x1d6)+a13_0x1ebbc9[_0x29554d(0x195)](_0x1e73e5))):console[_0x29554d(0x1c1)](_0x29554d(0x1a5)+a13_0x1ebbc9[_0x29554d(0x1a0)](_0x1e73e5)),_0x3e3752[_0x29554d(0x1c9)]>0x0?(console[_0x29554d(0x1c1)](a13_0x1ebbc9[_0x29554d(0x19f)](_0x29554d(0x18c))),printSchemaFields(_0x3e3752,0x0)):console[_0x29554d(0x1c1)](a13_0x1ebbc9['dim'](_0x29554d(0x19b)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']='connection:types';[a13_0x4f47d5(0x1d1)]=a13_0x4f47d5(0x1b3);async[a13_0x4f47d5(0x174)](_0x5fe2c9){const _0x36cb72=a13_0x4f47d5,{options:_0x482368,tdx:_0x34fb2f}=_0x5fe2c9;_0x482368[_0x36cb72(0x173)]&&console[_0x36cb72(0x1b9)](_0x36cb72(0x1b7)+_0x482368[_0x36cb72(0x1a3)]);const _0x200461=await withSpinner(_0x36cb72(0x1cc),()=>_0x34fb2f[_0x36cb72(0x192)][_0x36cb72(0x19a)](),{'verbose':_0x482368[_0x36cb72(0x173)]}),_0x252572=_0x200461['data'][_0x36cb72(0x1b0)]((_0x480ed6,_0x4fc9de)=>_0x480ed6[_0x36cb72(0x1c6)][_0x36cb72(0x1a8)](_0x4fc9de['type']));console[_0x36cb72(0x1b9)](_0x36cb72(0x1c8)+_0x252572[_0x36cb72(0x1c9)]+_0x36cb72(0x1c3)+(_0x252572[_0x36cb72(0x1c9)]!==0x1?'s':''));if(isStructuredFormat(_0x482368))await handleSDKOutput(_0x252572,_0x482368);else{const _0x56a6e6=_0x252572[_0x36cb72(0x1c9)]>0x0?Math[_0x36cb72(0x197)](..._0x252572[_0x36cb72(0x199)](_0x110809=>_0x110809[_0x36cb72(0x1c6)][_0x36cb72(0x1c9)])):0x0,_0x265b1d=[];for(const _0x19ce87 of _0x252572){const _0x333c20=a13_0x1ebbc9['cyan'](_0x19ce87[_0x36cb72(0x1c6)][_0x36cb72(0x182)](_0x56a6e6));_0x265b1d[_0x36cb72(0x181)](_0x333c20+'\x20\x20'+_0x19ce87[_0x36cb72(0x1a2)]);}await writeOutput(_0x265b1d[_0x36cb72(0x17b)]('\x0a'),_0x482368[_0x36cb72(0x175)],'table');}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0x4f47d5(0x1a2)]=a13_0x4f47d5(0x17e);[a13_0x4f47d5(0x1d1)]=a13_0x4f47d5(0x180);[a13_0x4f47d5(0x1c5)](_0x175374){const _0x5ba4df=a13_0x4f47d5,{args:_0x1dce34}=_0x175374;if(!_0x1dce34[0x0])return _0x5ba4df(0x1a6);return undefined;}async[a13_0x4f47d5(0x174)](_0x39c794){const _0x51a4a2=a13_0x4f47d5,{options:_0x332523,args:_0x12afc6,tdx:_0x3952be}=_0x39c794,_0x3661b5=_0x12afc6[0x0];_0x332523[_0x51a4a2(0x173)]&&(console[_0x51a4a2(0x1b9)](_0x51a4a2(0x1b7)+_0x332523[_0x51a4a2(0x1a3)]),console[_0x51a4a2(0x1b9)]('Fetching\x20settings\x20for\x20connector\x20type:\x20'+_0x3661b5));const _0x27a64c=await withSpinner(_0x51a4a2(0x185)+_0x3661b5+'\x27...',()=>_0x3952be[_0x51a4a2(0x192)][_0x51a4a2(0x177)](_0x3661b5),{'verbose':_0x332523[_0x51a4a2(0x173)]}),_0x2b4e2a=_0x27a64c[_0x51a4a2(0x1b6)];console[_0x51a4a2(0x1b9)]('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x3661b5);if(isStructuredFormat(_0x332523))await handleSingleObjectOutput(_0x2b4e2a,_0x332523);else{console[_0x51a4a2(0x1c1)](_0x51a4a2(0x1a5)+a13_0x1ebbc9[_0x51a4a2(0x1a0)](_0x3661b5)),console[_0x51a4a2(0x1c1)](_0x51a4a2(0x1ab)+_0x2b4e2a['name']);const _0x4d24ad=_0x2b4e2a['settings']||[],_0x1df963=_0x4d24ad[_0x51a4a2(0x18a)](_0x3aa889=>_0x3aa889[_0x51a4a2(0x19c)]);_0x1df963[_0x51a4a2(0x1c9)]>0x0&&(console[_0x51a4a2(0x1c1)](a13_0x1ebbc9[_0x51a4a2(0x19f)]('\x0aCredential\x20settings:')),printMetadataSettings(_0x1df963));let _0x23a699=![];try{const _0x498b67=await _0x3952be[_0x51a4a2(0x192)][_0x51a4a2(0x19e)](_0x3661b5),_0x466597=normalizeSchemaForDisplay(_0x498b67);_0x466597[_0x51a4a2(0x1c9)]>0x0&&(console[_0x51a4a2(0x1c1)](a13_0x1ebbc9[_0x51a4a2(0x19f)](_0x51a4a2(0x18c))),printSchemaFields(_0x466597,0x0),_0x23a699=!![]);}catch{const _0x2e57f6=_0x4d24ad[_0x51a4a2(0x18a)](_0x51d3a3=>!_0x51d3a3[_0x51a4a2(0x19c)]);_0x2e57f6['length']>0x0&&(console[_0x51a4a2(0x1c1)](a13_0x1ebbc9[_0x51a4a2(0x19f)](_0x51a4a2(0x18c))),printMetadataSettings(_0x2e57f6),_0x23a699=!![]);}!_0x23a699&&_0x332523['verbose']&&console[_0x51a4a2(0x1b9)](a13_0x1ebbc9[_0x51a4a2(0x195)]('No\x20available\x20fields\x20for\x20this\x20connector')),_0x1df963['length']===0x0&&console[_0x51a4a2(0x1c1)](a13_0x1ebbc9[_0x51a4a2(0x195)]('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function printMetadataSettings(_0x29be78){const _0x849002=a13_0x4f47d5;for(const _0x3dcdd7 of _0x29be78){if(!_0x3dcdd7[_0x849002(0x1a2)])continue;if(_0x3dcdd7['hidden'])continue;let _0x490360='\x20\x20'+a13_0x1ebbc9[_0x849002(0x19d)](_0x3dcdd7[_0x849002(0x1a2)]);_0x3dcdd7['label']&&(_0x490360+=':\x20'+_0x3dcdd7[_0x849002(0x18f)]);_0x3dcdd7[_0x849002(0x1c6)]&&(_0x490360+=a13_0x1ebbc9[_0x849002(0x195)]('\x20['+_0x3dcdd7[_0x849002(0x1c6)]+']'));console[_0x849002(0x1c1)](_0x490360);_0x3dcdd7[_0x849002(0x1c2)]&&console['log'](_0x849002(0x1d3)+a13_0x1ebbc9[_0x849002(0x195)](_0x3dcdd7[_0x849002(0x1c2)]));if(_0x3dcdd7[_0x849002(0x196)]){const _0x492048=_0x3dcdd7[_0x849002(0x196)][_0x849002(0x199)](_0x21d129=>_0x21d129['value'])[_0x849002(0x17b)](',\x20');console[_0x849002(0x1c1)](_0x849002(0x1c7)+a13_0x1ebbc9['yellow'](_0x492048));}_0x3dcdd7[_0x849002(0x1b5)]!==undefined&&_0x3dcdd7[_0x849002(0x1b5)]!==null&&console[_0x849002(0x1c1)](_0x849002(0x1cf)+a13_0x1ebbc9[_0x849002(0x1bb)](String(_0x3dcdd7[_0x849002(0x1b5)])));if(_0x3dcdd7[_0x849002(0x179)]){const _0x43afd4=Object['entries'](_0x3dcdd7[_0x849002(0x179)])[_0x849002(0x199)](([_0x2cb3b0,_0xd075b2])=>_0x2cb3b0+'='+JSON[_0x849002(0x193)](_0xd075b2))[_0x849002(0x17b)](',\x20');console[_0x849002(0x1c1)](_0x849002(0x1d3)+a13_0x1ebbc9['dim']('Show\x20when:\x20'+_0x43afd4));}}}
@@ -1 +1 @@
1
- const a14_0x1acaa9=a14_0x4005;(function(_0x11bb4d,_0x24ee6d){const _0x1bf163=a14_0x4005,_0x4e3a0c=_0x11bb4d();while(!![]){try{const _0x108441=-parseInt(_0x1bf163(0xb4))/0x1*(parseInt(_0x1bf163(0xc2))/0x2)+parseInt(_0x1bf163(0xb0))/0x3+-parseInt(_0x1bf163(0xb8))/0x4+-parseInt(_0x1bf163(0xac))/0x5*(-parseInt(_0x1bf163(0xb3))/0x6)+parseInt(_0x1bf163(0xb5))/0x7+-parseInt(_0x1bf163(0xbc))/0x8+parseInt(_0x1bf163(0xbd))/0x9*(parseInt(_0x1bf163(0xb1))/0xa);if(_0x108441===_0x24ee6d)break;else _0x4e3a0c['push'](_0x4e3a0c['shift']());}catch(_0x2d13da){_0x4e3a0c['push'](_0x4e3a0c['shift']());}}}(a14_0x45fc,0x991d2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a14_0x4005(_0x414506,_0x33dd6c){_0x414506=_0x414506-0xab;const _0x45fc8a=a14_0x45fc();let _0x40055f=_0x45fc8a[_0x414506];return _0x40055f;}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_0x1acaa9(0xba)]=a14_0x1acaa9(0xc1);['description']=a14_0x1acaa9(0xbe);async['execute'](_0x48392e){const _0x46e90d=a14_0x1acaa9,{options:_0x3dfc4b,args:_0x58f2f2,tdx:_0xef876b}=_0x48392e,_0x5e1f15=_0x58f2f2[0x0];try{_0x3dfc4b[_0x46e90d(0xae)]&&(console[_0x46e90d(0xc0)](_0x46e90d(0xbf)+_0x3dfc4b[_0x46e90d(0xb2)]),_0x5e1f15&&console[_0x46e90d(0xc0)](_0x46e90d(0xad)+_0x5e1f15));const _0x1f9d11=resolveLimit(_0x3dfc4b[_0x46e90d(0xbb)],DEFAULT_LISTING_LIMIT),_0x593bdb=await withSpinner('Listing\x20databases...',()=>_0xef876b[_0x46e90d(0xb7)][_0x46e90d(0xb9)](_0x5e1f15,_0x1f9d11),{'verbose':_0x3dfc4b['verbose']}),_0x4cd896=_0x593bdb[_0x46e90d(0xb6)];return console['error']('✔\x20Found\x20'+_0x4cd896[_0x46e90d(0xab)]+'\x20database'+(_0x4cd896[_0x46e90d(0xab)]!==0x1?'s':'')),await handleSDKOutput(_0x4cd896,{..._0x3dfc4b,'limit':_0x1f9d11}),0x0;}catch(_0x1ccb57){if(_0x1ccb57 instanceof SDKError)return console[_0x46e90d(0xc0)](_0x46e90d(0xaf)+_0x1ccb57[_0x46e90d(0xc4)]),_0x1ccb57[_0x46e90d(0xc3)]&&console['error']('\x20\x20Cause:\x20'+_0x1ccb57[_0x46e90d(0xc3)]),0x1;throw _0x1ccb57;}}}function a14_0x45fc(){const _0x1dc9b3=['error','databases','155666YgMHVU','cause','message','length','80IOgbuI','Pattern:\x20','verbose','Error:\x20','1520415nYvQbx','682940VVzQFa','site','360228TvKHFo','1XnFHLY','105700CrntJe','data','query','57692lrwOtg','listDatabases','name','limit','7197528rbtBUU','18RpCZRV','List\x20all\x20databases','Site:\x20'];a14_0x45fc=function(){return _0x1dc9b3;};return a14_0x45fc();}
1
+ const a14_0x5f0a84=a14_0x1871;(function(_0x4b2d21,_0x108f9a){const _0x47edfa=a14_0x1871,_0x6ba4f5=_0x4b2d21();while(!![]){try{const _0x179959=parseInt(_0x47edfa(0x179))/0x1*(-parseInt(_0x47edfa(0x164))/0x2)+-parseInt(_0x47edfa(0x16e))/0x3*(-parseInt(_0x47edfa(0x176))/0x4)+parseInt(_0x47edfa(0x166))/0x5+-parseInt(_0x47edfa(0x174))/0x6+-parseInt(_0x47edfa(0x16f))/0x7*(-parseInt(_0x47edfa(0x173))/0x8)+parseInt(_0x47edfa(0x15b))/0x9+-parseInt(_0x47edfa(0x15d))/0xa;if(_0x179959===_0x108f9a)break;else _0x6ba4f5['push'](_0x6ba4f5['shift']());}catch(_0x11e9d4){_0x6ba4f5['push'](_0x6ba4f5['shift']());}}}(a14_0x1e89,0x45781));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a14_0x1e89(){const _0x594a19=['30695kjNBRu','databases','Error:\x20','verbose','744pWOJek','149934aEBaXe','limit','8cBCYZR','Site:\x20','data','17wWKlKT','3451545xEsXlS','execute','7248670OgvYLO','Listing\x20databases...','\x20\x20Cause:\x20','List\x20all\x20databases','description','listDatabases','✔\x20Found\x20','254nsEQjB','Pattern:\x20','509410meafJC','length','\x20database','cause','query','site','message','error','215052Nqlmko'];a14_0x1e89=function(){return _0x594a19;};return a14_0x1e89();}import{withSpinner}from'../utils/spinner.js';function a14_0x1871(_0x59cf96,_0x5b417d){_0x59cf96=_0x59cf96-0x15b;const _0x1e89af=a14_0x1e89();let _0x18715d=_0x1e89af[_0x59cf96];return _0x18715d;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{['name']=a14_0x5f0a84(0x170);[a14_0x5f0a84(0x161)]=a14_0x5f0a84(0x160);async[a14_0x5f0a84(0x15c)](_0x76872c){const _0x113b0f=a14_0x5f0a84,{options:_0x324193,args:_0x3c3d4e,tdx:_0x4aaef8}=_0x76872c,_0x128509=_0x3c3d4e[0x0];try{_0x324193['verbose']&&(console['error'](_0x113b0f(0x177)+_0x324193[_0x113b0f(0x16b)]),_0x128509&&console[_0x113b0f(0x16d)](_0x113b0f(0x165)+_0x128509));const _0x9e97ff=resolveLimit(_0x324193[_0x113b0f(0x175)],DEFAULT_LISTING_LIMIT),_0x28400a=await withSpinner(_0x113b0f(0x15e),()=>_0x4aaef8[_0x113b0f(0x16a)][_0x113b0f(0x162)](_0x128509,_0x9e97ff),{'verbose':_0x324193[_0x113b0f(0x172)]}),_0x5f30c2=_0x28400a[_0x113b0f(0x178)];return console['error'](_0x113b0f(0x163)+_0x5f30c2[_0x113b0f(0x167)]+_0x113b0f(0x168)+(_0x5f30c2[_0x113b0f(0x167)]!==0x1?'s':'')),await handleSDKOutput(_0x5f30c2,{..._0x324193,'limit':_0x9e97ff}),0x0;}catch(_0x9b431){if(_0x9b431 instanceof SDKError)return console[_0x113b0f(0x16d)](_0x113b0f(0x171)+_0x9b431[_0x113b0f(0x16c)]),_0x9b431[_0x113b0f(0x169)]&&console['error'](_0x113b0f(0x15f)+_0x9b431[_0x113b0f(0x169)]),0x1;throw _0x9b431;}}}
@@ -1 +1 @@
1
- const a15_0x10a476=a15_0x2546;(function(_0x5a4b4f,_0x27c97f){const _0x27817f=a15_0x2546,_0x37a609=_0x5a4b4f();while(!![]){try{const _0x4f76a7=parseInt(_0x27817f(0x1ab))/0x1*(-parseInt(_0x27817f(0x1a7))/0x2)+-parseInt(_0x27817f(0x1b3))/0x3*(-parseInt(_0x27817f(0x1a0))/0x4)+parseInt(_0x27817f(0x1a1))/0x5*(-parseInt(_0x27817f(0x1ae))/0x6)+parseInt(_0x27817f(0x1a4))/0x7*(-parseInt(_0x27817f(0x1a2))/0x8)+parseInt(_0x27817f(0x1a3))/0x9+-parseInt(_0x27817f(0x1b0))/0xa*(parseInt(_0x27817f(0x1aa))/0xb)+parseInt(_0x27817f(0x1a8))/0xc;if(_0x4f76a7===_0x27c97f)break;else _0x37a609['push'](_0x37a609['shift']());}catch(_0x339038){_0x37a609['push'](_0x37a609['shift']());}}}(a15_0x4d6d,0xe4be0));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a15_0x4d6d(){const _0x4c198f=['name','listEmailSenders','2227396NclctI','21329988bfeHwR','Fetching\x20email\x20senders...','9338362HXThka','1tIPtvR','List\x20email\x20senders','data','2946kOMhQy','filter','10yFplNh','verbose','description','3498816trfoFy','4JOoZJG','265fCbdmu','8OVWKcS','11563101WVGJxm','9120783uXwfhj'];a15_0x4d6d=function(){return _0x4c198f;};return a15_0x4d6d();}import{withSpinner}from'../utils/spinner.js';function a15_0x2546(_0x4dfe4d,_0xed5b13){_0x4dfe4d=_0x4dfe4d-0x1a0;const _0x4d6dc3=a15_0x4d6d();let _0x254636=_0x4d6dc3[_0x4dfe4d];return _0x254636;}import{matchGlobPattern}from'../utils/string-utils.js';import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{[a15_0x10a476(0x1a5)]='delivery:senders';[a15_0x10a476(0x1b2)]=a15_0x10a476(0x1ac);async['execute'](_0x220495){const _0x3f4c94=a15_0x10a476,{options:_0x16a7a0,args:_0x15e42f,tdx:_0x352d3a}=_0x220495,_0x32518b=_0x15e42f[0x0],_0x59bd8f=resolveLimit(_0x16a7a0['limit'],DEFAULT_LLM_LIMIT),_0x11d43c=_0x16a7a0,_0x5cbbff=await resolveWorkspaceIdFromOptions(_0x11d43c,_0x352d3a),_0x4d3f80=await withSpinner(_0x3f4c94(0x1a9),()=>_0x352d3a['delivery'][_0x3f4c94(0x1a6)]({'workspaceId':_0x5cbbff,'limit':_0x59bd8f}),{'verbose':_0x16a7a0[_0x3f4c94(0x1b1)]});let _0x217596=_0x4d3f80['data'];return _0x32518b&&(_0x217596=_0x4d3f80[_0x3f4c94(0x1ad)][_0x3f4c94(0x1af)](_0x2d265f=>matchGlobPattern(_0x2d265f[_0x3f4c94(0x1a5)],_0x32518b))),await handleSDKOutput(_0x217596,_0x16a7a0),0x0;}}
1
+ const a15_0xf9a0b4=a15_0x2eb9;(function(_0x40b7a5,_0xa5dbfb){const _0x1aa997=a15_0x2eb9,_0x3d04e0=_0x40b7a5();while(!![]){try{const _0x1388fc=parseInt(_0x1aa997(0x179))/0x1+-parseInt(_0x1aa997(0x16b))/0x2+-parseInt(_0x1aa997(0x17b))/0x3+-parseInt(_0x1aa997(0x16c))/0x4*(parseInt(_0x1aa997(0x170))/0x5)+-parseInt(_0x1aa997(0x174))/0x6*(parseInt(_0x1aa997(0x172))/0x7)+-parseInt(_0x1aa997(0x175))/0x8*(-parseInt(_0x1aa997(0x16f))/0x9)+parseInt(_0x1aa997(0x17d))/0xa*(parseInt(_0x1aa997(0x173))/0xb);if(_0x1388fc===_0xa5dbfb)break;else _0x3d04e0['push'](_0x3d04e0['shift']());}catch(_0x443395){_0x3d04e0['push'](_0x3d04e0['shift']());}}}(a15_0x26d0,0x5cec9));import{BaseCommand}from'./command.js';function a15_0x2eb9(_0x3aa91e,_0x4cf431){_0x3aa91e=_0x3aa91e-0x16b;const _0x26d057=a15_0x26d0();let _0x2eb9cb=_0x26d057[_0x3aa91e];return _0x2eb9cb;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';function a15_0x26d0(){const _0x227be4=['484vrkFbC','List\x20email\x20senders','Fetching\x20email\x20senders...','1070568AdGRut','11470nDQQUp','delivery','213584fTgclP','7876fbBQHf','36twHVzj','32eFBhnd','filter','name','description','166566LfQXBU','listEmailSenders','636342MKboMY','verbose','9470MNvWuw','execute','data','534098thXZNv'];a15_0x26d0=function(){return _0x227be4;};return a15_0x26d0();}import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{[a15_0xf9a0b4(0x177)]='delivery:senders';[a15_0xf9a0b4(0x178)]=a15_0xf9a0b4(0x16d);async[a15_0xf9a0b4(0x17e)](_0x41e01a){const _0x32fda7=a15_0xf9a0b4,{options:_0x19f56b,args:_0x44775e,tdx:_0x4adcd8}=_0x41e01a,_0x5cda0b=_0x44775e[0x0],_0x14c919=resolveLimit(_0x19f56b['limit'],DEFAULT_LLM_LIMIT),_0x2ded44=_0x19f56b,_0x22bb9a=await resolveWorkspaceIdFromOptions(_0x2ded44,_0x4adcd8),_0x195e83=await withSpinner(_0x32fda7(0x16e),()=>_0x4adcd8[_0x32fda7(0x171)][_0x32fda7(0x17a)]({'workspaceId':_0x22bb9a,'limit':_0x14c919}),{'verbose':_0x19f56b[_0x32fda7(0x17c)]});let _0x55d8f2=_0x195e83[_0x32fda7(0x17f)];return _0x5cda0b&&(_0x55d8f2=_0x195e83[_0x32fda7(0x17f)][_0x32fda7(0x176)](_0x521ba0=>matchGlobPattern(_0x521ba0[_0x32fda7(0x177)],_0x5cda0b))),await handleSDKOutput(_0x55d8f2,_0x19f56b),0x0;}}
@@ -1 +1 @@
1
- const a16_0xd2413=a16_0x18e9;(function(_0x4ec92a,_0x488e56){const _0x1afd3e=a16_0x18e9,_0x3f31a2=_0x4ec92a();while(!![]){try{const _0xe087ac=parseInt(_0x1afd3e(0x1b2))/0x1*(parseInt(_0x1afd3e(0x1ab))/0x2)+-parseInt(_0x1afd3e(0x1aa))/0x3+-parseInt(_0x1afd3e(0x1ad))/0x4+parseInt(_0x1afd3e(0x1b7))/0x5+-parseInt(_0x1afd3e(0x1c0))/0x6*(-parseInt(_0x1afd3e(0x1b8))/0x7)+parseInt(_0x1afd3e(0x1b3))/0x8*(-parseInt(_0x1afd3e(0x1bc))/0x9)+parseInt(_0x1afd3e(0x1a8))/0xa;if(_0xe087ac===_0x488e56)break;else _0x3f31a2['push'](_0x3f31a2['shift']());}catch(_0x27623e){_0x3f31a2['push'](_0x3f31a2['shift']());}}}(a16_0x1225,0x5bfc9));import{BaseCommand}from'./command.js';function a16_0x18e9(_0x3b0b05,_0x5a5de1){_0x3b0b05=_0x3b0b05-0x1a0;const _0x1225db=a16_0x1225();let _0x18e99f=_0x1225db[_0x3b0b05];return _0x18e99f;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a16_0x1225(){const _0x4602ba=['3292060JqxaNm','14154VlrgqB','describe','name','describeTable','36YSaVJg','Site:\x20','site','Describe\x20table\x20schema','360UKWDrj','\x27\x20does\x20not\x20exist','args','verbose','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','query','✔\x20Found\x20','Describing\x20table\x20','length','9962230dUfDTY','Table:\x20','1343682bDfQID','99350ggMWkh','Error:\x20','2219440AkVReb','cause','\x20\x20Cause:\x20','\x20in\x20','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','4jpeunw','1190248IJlvwS','message','error','database'];a16_0x1225=function(){return _0x4602ba;};return a16_0x1225();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a16_0xd2413(0x1ba)]=a16_0xd2413(0x1b9);['description']=a16_0xd2413(0x1bf);async['execute'](_0x34218e){const _0x2fcc33=a16_0xd2413;return this[_0x2fcc33(0x1bb)](_0x34218e);}async['describeTable'](_0x1a8a83){const _0x2afafb=a16_0xd2413,{options:_0x3d510d,args:_0x7fcb01,tdx:_0x1d0b40}=_0x1a8a83;let _0x2f015c;try{_0x2f015c=parseTableReference(_0x7fcb01[0x0]);const _0x33a7c4=_0x3d510d[_0x2afafb(0x1b6)];!_0x2f015c[_0x2afafb(0x1b6)]&&_0x33a7c4&&(_0x2f015c[_0x2afafb(0x1b6)]=_0x33a7c4);const _0x1956cc=validateTableDescribeReference(_0x2f015c);if(_0x1956cc)return console['error'](_0x2afafb(0x1ac)+_0x1956cc),0x1;}catch(_0x8c66d8){return console[_0x2afafb(0x1b5)](_0x2afafb(0x1ac)+_0x8c66d8[_0x2afafb(0x1b4)]),0x1;}const _0x312b88=_0x2f015c[_0x2afafb(0x1b6)],_0x426f62=_0x2f015c['table'];try{_0x3d510d[_0x2afafb(0x1a2)]&&(console[_0x2afafb(0x1b5)](_0x2afafb(0x1bd)+_0x3d510d[_0x2afafb(0x1be)]),console[_0x2afafb(0x1b5)]('Database:\x20'+_0x312b88),console[_0x2afafb(0x1b5)](_0x2afafb(0x1a9)+_0x426f62));const _0x3dd049=await withSpinner(_0x2afafb(0x1a6)+_0x312b88+'.'+_0x426f62+'...',()=>_0x1d0b40[_0x2afafb(0x1a4)]['describeTable'](_0x312b88,_0x426f62),{'verbose':_0x3d510d[_0x2afafb(0x1a2)]}),_0x3c43a6=_0x3dd049['data'];if(_0x3c43a6[_0x2afafb(0x1a7)]===0x0)return console['error']('✖\x20Table\x20not\x20found'),console[_0x2afafb(0x1b5)]('Table\x20\x27'+_0x312b88+'.'+_0x426f62+_0x2afafb(0x1a0)),0x1;return console['error'](_0x2afafb(0x1a5)+_0x3c43a6['length']+'\x20column'+(_0x3c43a6['length']!==0x1?'s':'')+_0x2afafb(0x1b0)+_0x312b88+'.'+_0x426f62),await handleSDKOutput(_0x3c43a6,_0x3d510d),0x0;}catch(_0x80c154){if(_0x80c154 instanceof SDKError)return console[_0x2afafb(0x1b5)]('Error:\x20'+_0x80c154['message']),_0x80c154[_0x2afafb(0x1ae)]&&console[_0x2afafb(0x1b5)](_0x2afafb(0x1af)+_0x80c154[_0x2afafb(0x1ae)]),0x1;throw _0x80c154;}}['validate'](_0x550e4d){const _0x5e2851=a16_0xd2413;if(_0x550e4d[_0x5e2851(0x1a1)][_0x5e2851(0x1a7)]===0x0)return _0x5e2851(0x1b1);if(_0x550e4d['args'][_0x5e2851(0x1a7)]>0x1)return _0x5e2851(0x1a3);return undefined;}}
1
+ const a16_0xdc8fe6=a16_0xe444;(function(_0x7247fe,_0x54be0c){const _0x28feb1=a16_0xe444,_0x165a7b=_0x7247fe();while(!![]){try{const _0x4aaf52=-parseInt(_0x28feb1(0x205))/0x1+parseInt(_0x28feb1(0x211))/0x2*(-parseInt(_0x28feb1(0x209))/0x3)+parseInt(_0x28feb1(0x210))/0x4*(parseInt(_0x28feb1(0x1fd))/0x5)+parseInt(_0x28feb1(0x1f2))/0x6*(parseInt(_0x28feb1(0x1f6))/0x7)+-parseInt(_0x28feb1(0x207))/0x8*(-parseInt(_0x28feb1(0x1f7))/0x9)+-parseInt(_0x28feb1(0x201))/0xa*(-parseInt(_0x28feb1(0x215))/0xb)+-parseInt(_0x28feb1(0x206))/0xc*(-parseInt(_0x28feb1(0x20c))/0xd);if(_0x4aaf52===_0x54be0c)break;else _0x165a7b['push'](_0x165a7b['shift']());}catch(_0x3ea342){_0x165a7b['push'](_0x165a7b['shift']());}}}(a16_0x2975,0xa373c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a16_0x2975(){const _0x2f4e9e=['22296tmAlUb','5654024CjidZC','Error:\x20','16359VhfNGR','length','✔\x20Found\x20','325koUObq','database','Table\x20\x27','name','21272xjejzz','140fRuPFJ','data','...','table','11NiVCuu','Site:\x20','\x20column','\x20\x20Cause:\x20','12RRhhMe','query','validate','cause','1511440GLFQUj','9uPglLt','message','✖\x20Table\x20not\x20found','description','site','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','90sGprzK','verbose','Describe\x20table\x20schema','args','6017240tORMku','error','Describing\x20table\x20','describeTable','831281sDNvYh'];a16_0x2975=function(){return _0x2f4e9e;};return a16_0x2975();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a16_0xe444(_0x205564,_0x3d17d8){_0x205564=_0x205564-0x1ef;const _0x297551=a16_0x2975();let _0xe444e7=_0x297551[_0x205564];return _0xe444e7;}import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a16_0xdc8fe6(0x20f)]='describe';[a16_0xdc8fe6(0x1fa)]=a16_0xdc8fe6(0x1ff);async['execute'](_0x3a2c00){const _0x668012=a16_0xdc8fe6;return this[_0x668012(0x204)](_0x3a2c00);}async[a16_0xdc8fe6(0x204)](_0xa32bcd){const _0x27dfe6=a16_0xdc8fe6,{options:_0x5571d4,args:_0x216b1a,tdx:_0x5b070b}=_0xa32bcd;let _0x3b83b0;try{_0x3b83b0=parseTableReference(_0x216b1a[0x0]);const _0x2bd35d=_0x5571d4[_0x27dfe6(0x20d)];!_0x3b83b0[_0x27dfe6(0x20d)]&&_0x2bd35d&&(_0x3b83b0['database']=_0x2bd35d);const _0xd06702=validateTableDescribeReference(_0x3b83b0);if(_0xd06702)return console[_0x27dfe6(0x202)](_0x27dfe6(0x208)+_0xd06702),0x1;}catch(_0x145563){return console[_0x27dfe6(0x202)](_0x27dfe6(0x208)+_0x145563[_0x27dfe6(0x1f8)]),0x1;}const _0x3533e1=_0x3b83b0[_0x27dfe6(0x20d)],_0x2a1464=_0x3b83b0[_0x27dfe6(0x214)];try{_0x5571d4[_0x27dfe6(0x1fe)]&&(console[_0x27dfe6(0x202)](_0x27dfe6(0x1ef)+_0x5571d4[_0x27dfe6(0x1fb)]),console['error']('Database:\x20'+_0x3533e1),console[_0x27dfe6(0x202)]('Table:\x20'+_0x2a1464));const _0x52c8c6=await withSpinner(_0x27dfe6(0x203)+_0x3533e1+'.'+_0x2a1464+_0x27dfe6(0x213),()=>_0x5b070b[_0x27dfe6(0x1f3)][_0x27dfe6(0x204)](_0x3533e1,_0x2a1464),{'verbose':_0x5571d4['verbose']}),_0x2c97ce=_0x52c8c6[_0x27dfe6(0x212)];if(_0x2c97ce[_0x27dfe6(0x20a)]===0x0)return console['error'](_0x27dfe6(0x1f9)),console['error'](_0x27dfe6(0x20e)+_0x3533e1+'.'+_0x2a1464+'\x27\x20does\x20not\x20exist'),0x1;return console[_0x27dfe6(0x202)](_0x27dfe6(0x20b)+_0x2c97ce[_0x27dfe6(0x20a)]+_0x27dfe6(0x1f0)+(_0x2c97ce[_0x27dfe6(0x20a)]!==0x1?'s':'')+'\x20in\x20'+_0x3533e1+'.'+_0x2a1464),await handleSDKOutput(_0x2c97ce,_0x5571d4),0x0;}catch(_0x3c8c61){if(_0x3c8c61 instanceof SDKError)return console[_0x27dfe6(0x202)](_0x27dfe6(0x208)+_0x3c8c61['message']),_0x3c8c61[_0x27dfe6(0x1f5)]&&console['error'](_0x27dfe6(0x1f1)+_0x3c8c61[_0x27dfe6(0x1f5)]),0x1;throw _0x3c8c61;}}[a16_0xdc8fe6(0x1f4)](_0x4e32e0){const _0x9b128c=a16_0xdc8fe6;if(_0x4e32e0['args'][_0x9b128c(0x20a)]===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(_0x4e32e0[_0x9b128c(0x200)][_0x9b128c(0x20a)]>0x1)return _0x9b128c(0x1fc);return undefined;}}
@@ -1 +1 @@
1
- const a17_0x3caf63=a17_0x813f;(function(_0x57854c,_0x967375){const _0x1509cc=a17_0x813f,_0x456315=_0x57854c();while(!![]){try{const _0x5d324e=parseInt(_0x1509cc(0x105))/0x1*(parseInt(_0x1509cc(0x12b))/0x2)+parseInt(_0x1509cc(0x121))/0x3+-parseInt(_0x1509cc(0x104))/0x4*(parseInt(_0x1509cc(0xff))/0x5)+parseInt(_0x1509cc(0x116))/0x6*(-parseInt(_0x1509cc(0xfe))/0x7)+parseInt(_0x1509cc(0xfa))/0x8*(parseInt(_0x1509cc(0x11b))/0x9)+-parseInt(_0x1509cc(0x12a))/0xa*(-parseInt(_0x1509cc(0x118))/0xb)+-parseInt(_0x1509cc(0x107))/0xc*(parseInt(_0x1509cc(0x12f))/0xd);if(_0x5d324e===_0x967375)break;else _0x456315['push'](_0x456315['shift']());}catch(_0x219b22){_0x456315['push'](_0x456315['shift']());}}}(a17_0x5899,0xd8ac7));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a17_0x813f(_0x2bff35,_0x405fb7){_0x2bff35=_0x2bff35-0xfa;const _0x5899af=a17_0x5899();let _0x813f9b=_0x5899af[_0x2bff35];return _0x813f9b;}function a17_0x5899(){const _0x4c1ae9=['44WBNKEn','859MeIBaX','\x20files?','13595172EYovMB','content','Workspace\x20is\x20required.','length','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','segment','Pulling\x20campaigns\x20from\x20\x27','absolutePath','hasChanges','session','isNew','dryRun','cwd','yellow','6KaoBEm','\x0aChanges\x20to\x20\x27','447766PXbCqo','\x20unchanged\x20files','\x27...','90mcoSHU','\x20\x20Target:\x20','error','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','filter','\x20new\x20files','2256063jyrZru','execute','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','engage_workspace','repeat','files','workspace','✔\x20All\x20files\x20are\x20up\x20to\x20date','workspaceName','280UdZwXC','818kdItyQ','dim','utf-8','setPhase','13OcuJre','\x20=\x20','data','verbose','\x20changed\x20files','targetDir','yes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','engage','engage:campaign:pull','✔\x20Pulled\x20','564224JOuicw','config','diff','dirname','3406501JyolIQ','200605lFYbPC','campaigns','counts','\x20campaigns','✔\x20Context\x20set:\x20'];a17_0x5899=function(){return _0x4c1ae9;};return a17_0x5899();}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a17_0xe2e276 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a17_0x2c459b from'path';import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{['name']=a17_0x3caf63(0x138);['description']='Pull\x20campaigns\x20to\x20YAML\x20files';async[a17_0x3caf63(0x122)](_0xde3a8d){const _0x58b6c6=a17_0x3caf63,{options:_0x316831,args:_0x495f42,tdx:_0x4610ac}=_0xde3a8d,_0x35f034=_0x316831,_0xd9e5b5=await resolveWorkspaceName(_0x495f42[0x0],_0x35f034);if(!_0xd9e5b5)return console['error'](a17_0xe2e276[_0x58b6c6(0x115)](_0x58b6c6(0x109))),console[_0x58b6c6(0x11d)]('\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>'),console[_0x58b6c6(0x11d)](_0x58b6c6(0x10c)),console[_0x58b6c6(0x11d)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x51ee07=await withProgressSpinner(_0x58b6c6(0x10e)+_0xd9e5b5+_0x58b6c6(0x11a),_0x188a79=>pullCampaigns({'engage':_0x4610ac[_0x58b6c6(0x137)],'segment':_0x4610ac[_0x58b6c6(0x10d)]},_0xd9e5b5,{'campaignName':_0x35f034['name'],'campaignType':_0x35f034['type'],'progress':{'update':_0x2cd91f=>{const _0x2a232b=_0x58b6c6;_0x188a79[_0x2a232b(0x12e)](_0x2cd91f);}}}),{'verbose':_0x35f034[_0x58b6c6(0x132)]}),_0x46497a=_0x51ee07[_0x58b6c6(0x131)];if(_0x46497a[_0x58b6c6(0x101)][_0x58b6c6(0x100)]===0x0)return console[_0x58b6c6(0x11d)](a17_0xe2e276[_0x58b6c6(0x115)](_0x58b6c6(0x11e)+_0x46497a[_0x58b6c6(0x129)]+'\x27')),0x0;const _0x182c03=_0x46497a[_0x58b6c6(0x126)][_0x58b6c6(0x11f)](_0x423abb=>_0x423abb[_0x58b6c6(0x112)]),_0x5e3871=_0x46497a[_0x58b6c6(0x126)][_0x58b6c6(0x11f)](_0x14a6bf=>!_0x14a6bf[_0x58b6c6(0x112)]&&_0x14a6bf[_0x58b6c6(0x110)]),_0x328375=_0x46497a[_0x58b6c6(0x126)][_0x58b6c6(0x11f)](_0x414dad=>!_0x414dad[_0x58b6c6(0x112)]&&!_0x414dad[_0x58b6c6(0x110)]);console['error']('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x46497a[_0x58b6c6(0x129)]+'\x27:'),console[_0x58b6c6(0x11d)]('\x20\x20'+a17_0xe2e276['cyan'](_0x46497a[_0x58b6c6(0x101)][_0x58b6c6(0x100)]+_0x58b6c6(0x102))),console[_0x58b6c6(0x11d)]('\x20\x20'+a17_0xe2e276['green']('+\x20'+_0x182c03[_0x58b6c6(0x10a)]+_0x58b6c6(0x120))),console[_0x58b6c6(0x11d)]('\x20\x20'+a17_0xe2e276['yellow']('~\x20'+_0x5e3871[_0x58b6c6(0x10a)]+_0x58b6c6(0x133))),console['error']('\x20\x20'+a17_0xe2e276[_0x58b6c6(0x12c)]('=\x20'+_0x328375[_0x58b6c6(0x10a)]+_0x58b6c6(0x119))),console['error'](_0x58b6c6(0x11c)+a17_0xe2e276['cyan'](_0x46497a[_0x58b6c6(0x134)])+'\x0a');if(_0x5e3871[_0x58b6c6(0x10a)]>0x0)for(const _0x3a80f8 of _0x5e3871){console[_0x58b6c6(0x11d)](_0x58b6c6(0x117)+_0x3a80f8['relativePath']+'\x27:'),console[_0x58b6c6(0x11d)]('─'['repeat'](0x3c)),console[_0x58b6c6(0x11d)](_0x3a80f8[_0x58b6c6(0xfc)]),console[_0x58b6c6(0x11d)]('─'[_0x58b6c6(0x125)](0x3c));}if(_0x35f034[_0x58b6c6(0x113)])return console['error'](a17_0xe2e276[_0x58b6c6(0x115)](_0x58b6c6(0x123))),0x0;if(_0x182c03[_0x58b6c6(0x10a)]===0x0&&_0x5e3871[_0x58b6c6(0x10a)]===0x0)return console['error'](a17_0xe2e276[_0x58b6c6(0x10b)](_0x58b6c6(0x128))),saveSessionContext({'engage_workspace':_0x46497a[_0x58b6c6(0x129)]},_0x35f034[_0x58b6c6(0x111)]),0x0;if(!_0x35f034[_0x58b6c6(0x135)]){if(!isInteractive())return console['error'](a17_0xe2e276['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x58b6c6(0x11d)](a17_0xe2e276[_0x58b6c6(0x12c)](_0x58b6c6(0x136))),0x1;const _0x47b11e=await confirmKey('Write\x20'+(_0x182c03[_0x58b6c6(0x10a)]+_0x5e3871[_0x58b6c6(0x10a)])+_0x58b6c6(0x106));if(!_0x47b11e)return console[_0x58b6c6(0x11d)](a17_0xe2e276[_0x58b6c6(0x115)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x387d2e of _0x46497a[_0x58b6c6(0x126)]){if(_0x387d2e[_0x58b6c6(0x112)]||_0x387d2e[_0x58b6c6(0x110)]){const _0x243898=a17_0x2c459b[_0x58b6c6(0xfd)](_0x387d2e[_0x58b6c6(0x10f)]);!existsSync(_0x243898)&&mkdirSync(_0x243898,{'recursive':!![]}),writeFileSync(_0x387d2e[_0x58b6c6(0x10f)],_0x387d2e[_0x58b6c6(0x108)],_0x58b6c6(0x12d));}}return console['error'](a17_0xe2e276['green'](_0x58b6c6(0x139)+(_0x182c03[_0x58b6c6(0x10a)]+_0x5e3871['length'])+'\x20files\x20to\x20'+_0x46497a[_0x58b6c6(0x134)])),saveSessionContext({'engage_workspace':_0x46497a[_0x58b6c6(0x129)]},_0x35f034[_0x58b6c6(0x111)]),console['error'](a17_0xe2e276[_0x58b6c6(0x10b)](_0x58b6c6(0x103)+a17_0xe2e276[_0x58b6c6(0x12c)](_0x58b6c6(0x124))+_0x58b6c6(0x130)+a17_0xe2e276['cyan'](_0x46497a[_0x58b6c6(0x129)]))),0x0;}}async function resolveWorkspaceName(_0x2a8e13,_0x2042d5){const _0x204c8f=a17_0x3caf63;if(_0x2a8e13)return _0x2a8e13;if(_0x2042d5[_0x204c8f(0x127)])return _0x2042d5[_0x204c8f(0x127)];const _0x930f21=tryFindTdxConfig(process[_0x204c8f(0x114)]());if(_0x930f21?.[_0x204c8f(0xfb)]['engage_workspace'])return _0x930f21[_0x204c8f(0xfb)][_0x204c8f(0x124)];const _0x324755=loadSessionContext(_0x2042d5[_0x204c8f(0x111)]);if(_0x324755?.[_0x204c8f(0x124)])return _0x324755[_0x204c8f(0x124)];return undefined;}
1
+ const a17_0x1ca05b=a17_0x5268;(function(_0x1e8e88,_0x340406){const _0x5b616e=a17_0x5268,_0x3f024d=_0x1e8e88();while(!![]){try{const _0x3a43fa=parseInt(_0x5b616e(0x1d0))/0x1+parseInt(_0x5b616e(0x200))/0x2*(-parseInt(_0x5b616e(0x202))/0x3)+-parseInt(_0x5b616e(0x1ed))/0x4+-parseInt(_0x5b616e(0x1cd))/0x5*(-parseInt(_0x5b616e(0x201))/0x6)+-parseInt(_0x5b616e(0x1da))/0x7+parseInt(_0x5b616e(0x1e9))/0x8+-parseInt(_0x5b616e(0x1cf))/0x9;if(_0x3a43fa===_0x340406)break;else _0x3f024d['push'](_0x3f024d['shift']());}catch(_0x366943){_0x3f024d['push'](_0x3f024d['shift']());}}}(a17_0x2c7d,0xe376a));function a17_0x5268(_0x359903,_0x2e0da1){_0x359903=_0x359903-0x1cb;const _0x2c7dcc=a17_0x2c7d();let _0x526884=_0x2c7dcc[_0x359903];return _0x526884;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a17_0x455442 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a17_0x58d657 from'path';function a17_0x2c7d(){const _0x1a3273=['utf-8','session','execute','hasChanges','setPhase','12111840vNEzfr','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','targetDir','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','6457144aYtDhw','relativePath','\x20=\x20','dryRun','filter','\x0aPull\x20summary\x20for\x20workspace\x20\x27','files','isNew','config','\x20files\x20to\x20','\x20new\x20files','workspace','red','✔\x20Pulled\x20','green','error','\x0aError:','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','106OuariU','16158XdHHmM','37857fFGJDC','engage_workspace','\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20unchanged\x20files','Pull\x20campaigns\x20to\x20YAML\x20files','-\x20no\x20files\x20written','cwd','\x0aChanges\x20to\x20\x27','absolutePath','2480jLwdBe','data','6540183CQrkcf','1745636WvkVuI','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','engage','\x20changed\x20files','counts','yellow','campaigns','\x20campaigns','dim','segment','4577118yHhuGX','\x20\x20Target:\x20','dirname','name','engage:campaign:pull','workspaceName','Write\x20','length','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','content'];a17_0x2c7d=function(){return _0x1a3273;};return a17_0x2c7d();}import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{[a17_0x1ca05b(0x1dd)]=a17_0x1ca05b(0x1de);['description']=a17_0x1ca05b(0x207);async[a17_0x1ca05b(0x1e6)](_0x372d0e){const _0x7ef549=a17_0x1ca05b,{options:_0x5022c6,args:_0x426b7b,tdx:_0x2f67a8}=_0x372d0e,_0xb625d0=_0x5022c6,_0x5ae2fb=await resolveWorkspaceName(_0x426b7b[0x0],_0xb625d0);if(!_0x5ae2fb)return console[_0x7ef549(0x1fc)](a17_0x455442[_0x7ef549(0x1d5)]('Workspace\x20is\x20required.')),console[_0x7ef549(0x1fc)](_0x7ef549(0x204)),console[_0x7ef549(0x1fc)](_0x7ef549(0x1d1)),console[_0x7ef549(0x1fc)](_0x7ef549(0x1ea)),0x1;const _0x230123=await withProgressSpinner('Pulling\x20campaigns\x20from\x20\x27'+_0x5ae2fb+'\x27...',_0x4682bc=>pullCampaigns({'engage':_0x2f67a8[_0x7ef549(0x1d2)],'segment':_0x2f67a8[_0x7ef549(0x1d9)]},_0x5ae2fb,{'campaignName':_0xb625d0[_0x7ef549(0x1dd)],'campaignType':_0xb625d0['type'],'progress':{'update':_0x45cb1a=>{const _0x3838b8=_0x7ef549;_0x4682bc[_0x3838b8(0x1e8)](_0x45cb1a);}}}),{'verbose':_0xb625d0['verbose']}),_0x38abe5=_0x230123[_0x7ef549(0x1ce)];if(_0x38abe5[_0x7ef549(0x1d4)][_0x7ef549(0x1d6)]===0x0)return console[_0x7ef549(0x1fc)](a17_0x455442[_0x7ef549(0x1d5)](_0x7ef549(0x1ec)+_0x38abe5[_0x7ef549(0x1df)]+'\x27')),0x0;const _0x4cef9a=_0x38abe5[_0x7ef549(0x1f3)][_0x7ef549(0x1f1)](_0x179bc5=>_0x179bc5[_0x7ef549(0x1f4)]),_0x3467da=_0x38abe5['files'][_0x7ef549(0x1f1)](_0x5df31d=>!_0x5df31d[_0x7ef549(0x1f4)]&&_0x5df31d[_0x7ef549(0x1e7)]),_0x1308cc=_0x38abe5[_0x7ef549(0x1f3)][_0x7ef549(0x1f1)](_0x163acb=>!_0x163acb[_0x7ef549(0x1f4)]&&!_0x163acb[_0x7ef549(0x1e7)]);console[_0x7ef549(0x1fc)](_0x7ef549(0x1f2)+_0x38abe5[_0x7ef549(0x1df)]+'\x27:'),console['error']('\x20\x20'+a17_0x455442['cyan'](_0x38abe5[_0x7ef549(0x1d4)][_0x7ef549(0x1d6)]+_0x7ef549(0x1d7))),console[_0x7ef549(0x1fc)]('\x20\x20'+a17_0x455442[_0x7ef549(0x1fb)]('+\x20'+_0x4cef9a[_0x7ef549(0x1e1)]+_0x7ef549(0x1f7))),console['error']('\x20\x20'+a17_0x455442['yellow']('~\x20'+_0x3467da[_0x7ef549(0x1e1)]+_0x7ef549(0x1d3))),console[_0x7ef549(0x1fc)]('\x20\x20'+a17_0x455442[_0x7ef549(0x1d8)]('=\x20'+_0x1308cc[_0x7ef549(0x1e1)]+_0x7ef549(0x206))),console[_0x7ef549(0x1fc)](_0x7ef549(0x1db)+a17_0x455442['cyan'](_0x38abe5[_0x7ef549(0x1eb)])+'\x0a');if(_0x3467da[_0x7ef549(0x1e1)]>0x0)for(const _0x43d54e of _0x3467da){console[_0x7ef549(0x1fc)](_0x7ef549(0x1cb)+_0x43d54e[_0x7ef549(0x1ee)]+'\x27:'),console[_0x7ef549(0x1fc)]('─'['repeat'](0x3c)),console[_0x7ef549(0x1fc)](_0x43d54e['diff']),console[_0x7ef549(0x1fc)]('─'['repeat'](0x3c));}if(_0xb625d0[_0x7ef549(0x1f0)])return console['error'](a17_0x455442[_0x7ef549(0x1d5)](_0x7ef549(0x1ff))),0x0;if(_0x4cef9a[_0x7ef549(0x1e1)]===0x0&&_0x3467da[_0x7ef549(0x1e1)]===0x0)return console['error'](a17_0x455442[_0x7ef549(0x1fb)](_0x7ef549(0x1fe))),saveSessionContext({'engage_workspace':_0x38abe5[_0x7ef549(0x1df)]},_0xb625d0[_0x7ef549(0x1e5)]),0x0;if(!_0xb625d0['yes']){if(!isInteractive())return console['error'](a17_0x455442[_0x7ef549(0x1f9)](_0x7ef549(0x1fd)),_0x7ef549(0x1e2)),console['error'](a17_0x455442[_0x7ef549(0x1d8)](_0x7ef549(0x205))),0x1;const _0x3a636c=await confirmKey(_0x7ef549(0x1e0)+(_0x4cef9a[_0x7ef549(0x1e1)]+_0x3467da[_0x7ef549(0x1e1)])+'\x20files?');if(!_0x3a636c)return console['error'](a17_0x455442['yellow']('Aborted.'),_0x7ef549(0x208)),0x1;}for(const _0x2efb90 of _0x38abe5[_0x7ef549(0x1f3)]){if(_0x2efb90[_0x7ef549(0x1f4)]||_0x2efb90[_0x7ef549(0x1e7)]){const _0x22e4c5=a17_0x58d657[_0x7ef549(0x1dc)](_0x2efb90[_0x7ef549(0x1cc)]);!existsSync(_0x22e4c5)&&mkdirSync(_0x22e4c5,{'recursive':!![]}),writeFileSync(_0x2efb90[_0x7ef549(0x1cc)],_0x2efb90[_0x7ef549(0x1e3)],_0x7ef549(0x1e4));}}return console[_0x7ef549(0x1fc)](a17_0x455442[_0x7ef549(0x1fb)](_0x7ef549(0x1fa)+(_0x4cef9a['length']+_0x3467da[_0x7ef549(0x1e1)])+_0x7ef549(0x1f6)+_0x38abe5[_0x7ef549(0x1eb)])),saveSessionContext({'engage_workspace':_0x38abe5[_0x7ef549(0x1df)]},_0xb625d0[_0x7ef549(0x1e5)]),console['error'](a17_0x455442[_0x7ef549(0x1fb)]('✔\x20Context\x20set:\x20'+a17_0x455442[_0x7ef549(0x1d8)](_0x7ef549(0x203))+_0x7ef549(0x1ef)+a17_0x455442['cyan'](_0x38abe5[_0x7ef549(0x1df)]))),0x0;}}async function resolveWorkspaceName(_0x2b5ff2,_0xb3dcfe){const _0xe4ceab=a17_0x1ca05b;if(_0x2b5ff2)return _0x2b5ff2;if(_0xb3dcfe[_0xe4ceab(0x1f8)])return _0xb3dcfe['workspace'];const _0x2975a2=tryFindTdxConfig(process[_0xe4ceab(0x209)]());if(_0x2975a2?.[_0xe4ceab(0x1f5)][_0xe4ceab(0x203)])return _0x2975a2['config'][_0xe4ceab(0x203)];const _0x44d1d9=loadSessionContext(_0xb3dcfe['session']);if(_0x44d1d9?.[_0xe4ceab(0x203)])return _0x44d1d9[_0xe4ceab(0x203)];return undefined;}
@@ -1 +1 @@
1
- const a18_0x4b2d31=a18_0x2251;(function(_0x51f97a,_0x440188){const _0x453bf4=a18_0x2251,_0x17fcfa=_0x51f97a();while(!![]){try{const _0x560dba=-parseInt(_0x453bf4(0x1da))/0x1*(-parseInt(_0x453bf4(0x1c8))/0x2)+-parseInt(_0x453bf4(0x1d4))/0x3*(-parseInt(_0x453bf4(0x20b))/0x4)+-parseInt(_0x453bf4(0x1cf))/0x5+-parseInt(_0x453bf4(0x1fb))/0x6+-parseInt(_0x453bf4(0x1ec))/0x7+parseInt(_0x453bf4(0x208))/0x8+-parseInt(_0x453bf4(0x20a))/0x9;if(_0x560dba===_0x440188)break;else _0x17fcfa['push'](_0x17fcfa['shift']());}catch(_0x3bd542){_0x17fcfa['push'](_0x17fcfa['shift']());}}}(a18_0x5227,0xe039e));import{BaseCommand}from'./command.js';function a18_0x5227(){const _0x5a7745=['\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','engage_workspace','1\x20campaign\x20file:\x20','756672eAsrkw','error','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','campaign_type','\x0aError:','filter','map','resolve','updated','yellow','\x20errors:','action','config','9631352lJPsWl','def','2875527Xenijj','264540QJYlYP','✔\x20Created\x20','cyan','2IPYoOu','results','segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Workspace\x20is\x20required.','\x27...','workspace','330810YkJlfB','Push\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','engage','session','24WgVhJy','\x20new\x20campaigns:','dirname','green','setPhase','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','1479014ufswKT','Pushing\x20campaigns...','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','create','verbose','configDir','cwd','-\x20no\x20changes\x20applied','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','Resolving\x20references...','created','dim','\x0aPush\x20summary\x20for\x20workspace\x20\x27','update','warnings','Aborted.','12472642VepbAT','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','errors','red','name','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','description','message','site','\x20campaigns','\x20\x20\x20\x20','\x20campaigns\x20to\x20update:'];a18_0x5227=function(){return _0x5a7745;};return a18_0x5227();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a18_0x2251(_0x243756,_0x3b842a){_0x243756=_0x243756-0x1c8;const _0x5227f5=a18_0x5227();let _0x225192=_0x5227f5[_0x243756];return _0x225192;}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a18_0x1e4c00 from'chalk';import a18_0x85e6b8 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a18_0x4b2d31(0x1f0)]='engage:campaign:push';[a18_0x4b2d31(0x1f2)]=a18_0x4b2d31(0x1ed);async[a18_0x4b2d31(0x1e2)](_0x2692b3){const _0x1face0=a18_0x4b2d31,{options:_0x226a46,args:_0x5a2e8a,tdx:_0x4f09c9}=_0x2692b3,_0x19aad4=_0x226a46,_0x14021f=_0x5a2e8a[0x0],_0x15e0ed=_0x14021f?a18_0x85e6b8[_0x1face0(0x202)](_0x14021f):undefined,_0x2067e7=_0x15e0ed?isYamlFile(_0x15e0ed):![];let _0x57f9b2;if(_0x2067e7&&_0x15e0ed)_0x57f9b2=a18_0x85e6b8[_0x1face0(0x1d6)](_0x15e0ed);else _0x15e0ed?_0x57f9b2=_0x15e0ed:_0x57f9b2=process[_0x1face0(0x1e0)]();let _0x3a2cde;const _0xec8f47=tryFindTdxConfig(_0x57f9b2);_0xec8f47?.[_0x1face0(0x207)]['engage_workspace']&&(_0x3a2cde=_0xec8f47[_0x1face0(0x207)]['engage_workspace'],!_0x2067e7&&(_0x57f9b2=_0xec8f47[_0x1face0(0x1df)]));_0x19aad4[_0x1face0(0x1ce)]&&(_0x3a2cde=_0x19aad4['workspace']);if(!_0x3a2cde){const _0x1349b8=loadSessionContext(_0x19aad4[_0x1face0(0x1d3)]);_0x1349b8?.[_0x1face0(0x1f9)]&&(_0x3a2cde=_0x1349b8[_0x1face0(0x1f9)]);}if(!_0x3a2cde)return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x204)](_0x1face0(0x1cc))),console[_0x1face0(0x1fc)](_0x1face0(0x1dc)),console[_0x1face0(0x1fc)](_0x1face0(0x1f8)),console['error'](_0x1face0(0x1d1)),console[_0x1face0(0x1fc)](_0x1face0(0x1f1)),0x1;let _0x4622f5;_0x2067e7&&_0x15e0ed?_0x4622f5=[_0x15e0ed]:_0x4622f5=discoverCampaignFiles(_0x57f9b2);if(_0x4622f5[_0x1face0(0x1e4)]===0x0)return console['error'](a18_0x1e4c00[_0x1face0(0x204)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x57f9b2)),console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1e7)]('Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.')),0x1;const _0x51336b=_0x4622f5[_0x1face0(0x201)](_0x29940e=>parseCampaignFile(_0x29940e,a18_0x85e6b8[_0x1face0(0x1d6)](_0x29940e))),_0x197c61=_0x51336b[_0x1face0(0x1e4)]===0x1?_0x1face0(0x1fa)+_0x51336b[0x0][_0x1face0(0x209)][_0x1face0(0x1f0)]:_0x51336b['length']+'\x20campaign\x20files';console[_0x1face0(0x1fc)]('Found\x20'+a18_0x1e4c00[_0x1face0(0x20d)](_0x197c61));let _0x509827=![];for(const _0x38c270 of _0x51336b){const _0x1c6e7e=validateCampaignDef(_0x38c270[_0x1face0(0x209)]);if(!_0x1c6e7e['valid']){_0x509827=!![],console[_0x1face0(0x1fc)](a18_0x1e4c00['red']('\x0aValidation\x20errors\x20in\x20'+_0x38c270['relativePath']+':'));for(const _0x14a231 of _0x1c6e7e['errors']){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00[_0x1face0(0x1ef)]('✗')+'\x20'+_0x14a231['path']+':\x20'+_0x14a231[_0x1face0(0x1f3)]);}}for(const _0xd6d766 of _0x1c6e7e[_0x1face0(0x1ea)]){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00['yellow']('⚠')+'\x20'+_0xd6d766['path']+':\x20'+_0xd6d766[_0x1face0(0x1f3)]);}}if(_0x509827)return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1ef)](_0x1face0(0x1d9))),0x1;const _0x5ccbb6=await _0x4f09c9['engage']['resolveWorkspaceId'](_0x3a2cde),_0x67f53c=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x3a2cde+_0x1face0(0x1cd),_0x404014=>preparePush({'engage':_0x4f09c9[_0x1face0(0x1d2)],'segment':_0x4f09c9['segment']},_0x51336b,_0x5ccbb6,{'progress':{'update':_0x31e7e3=>_0x404014[_0x1face0(0x1d8)](_0x31e7e3)}}),{'verbose':_0x19aad4[_0x1face0(0x1de)]}),_0x3c5d4c=_0x67f53c['data'];await withProgressSpinner(_0x1face0(0x1e5),_0x4e697c=>resolveAndBuildInputs({'engage':_0x4f09c9[_0x1face0(0x1d2)],'segment':_0x4f09c9['segment']},_0x3c5d4c,_0x5ccbb6,{'progress':{'update':_0x42f7b2=>_0x4e697c[_0x1face0(0x1d8)](_0x42f7b2)}}),{'verbose':_0x19aad4[_0x1face0(0x1de)]});const _0x369109=_0x3c5d4c[_0x1face0(0x200)](_0x27641a=>_0x27641a['action']===_0x1face0(0x1dd)),_0x16bfef=_0x3c5d4c[_0x1face0(0x200)](_0x249443=>_0x249443[_0x1face0(0x206)]===_0x1face0(0x1e9));console[_0x1face0(0x1fc)](_0x1face0(0x1e8)+_0x3a2cde+'\x27:');if(_0x369109[_0x1face0(0x1e4)]>0x0){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00[_0x1face0(0x1d7)]('+\x20'+_0x369109[_0x1face0(0x1e4)]+_0x1face0(0x1d5)));for(const _0x14a2db of _0x369109){console[_0x1face0(0x1fc)](_0x1face0(0x1f6)+a18_0x1e4c00['green']('+')+'\x20'+_0x14a2db[_0x1face0(0x209)][_0x1face0(0x1f0)]+'\x20('+_0x14a2db[_0x1face0(0x209)][_0x1face0(0x1fe)]+')');}}if(_0x16bfef['length']>0x0){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00[_0x1face0(0x204)]('~\x20'+_0x16bfef['length']+_0x1face0(0x1f7)));for(const _0x350bad of _0x16bfef){console[_0x1face0(0x1fc)](_0x1face0(0x1f6)+a18_0x1e4c00[_0x1face0(0x204)]('~')+'\x20'+_0x350bad['def'][_0x1face0(0x1f0)]+'\x20('+_0x350bad[_0x1face0(0x209)][_0x1face0(0x1fe)]+')');}}if(_0x369109[_0x1face0(0x1e4)]===0x0&&_0x16bfef['length']===0x0)return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1d7)](_0x1face0(0x1fd))),0x0;if(_0x19aad4['dryRun'])return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x204)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x19aad4['yes']){if(!isInteractive())return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1ef)](_0x1face0(0x1ff)),_0x1face0(0x1e3)),console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1e7)](_0x1face0(0x1cb))),0x1;const _0x15d5ba=await confirmKey(_0x1face0(0x1d0)+(_0x369109[_0x1face0(0x1e4)]+_0x16bfef[_0x1face0(0x1e4)])+'\x20campaigns?');if(!_0x15d5ba)return console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x204)](_0x1face0(0x1eb)),_0x1face0(0x1e1)),0x1;}const _0x4c5e83=await withProgressSpinner(_0x1face0(0x1db),_0x5bcc7d=>executePush({'engage':_0x4f09c9[_0x1face0(0x1d2)],'segment':_0x4f09c9[_0x1face0(0x1ca)]},_0x3c5d4c,{'progress':{'update':_0x2b1eab=>_0x5bcc7d['setPhase'](_0x2b1eab)}}),{'verbose':_0x19aad4[_0x1face0(0x1de)]}),_0x1ee428=_0x4c5e83['data'];for(const _0x4a3191 of _0x1ee428[_0x1face0(0x1c9)]){if(_0x4a3191['campaignId']&&(_0x4a3191[_0x1face0(0x206)]===_0x1face0(0x1e6)||_0x4a3191[_0x1face0(0x206)]==='updated')){const _0x270d75=getCampaignUrl(_0x19aad4[_0x1face0(0x1f4)],_0x5ccbb6,_0x4a3191['campaignId']),_0xe6e940=_0x4a3191[_0x1face0(0x206)]===_0x1face0(0x1e6)?'+':'~',_0x2737e6=_0x4a3191['action']===_0x1face0(0x1e6)?a18_0x1e4c00[_0x1face0(0x1d7)](_0xe6e940):a18_0x1e4c00[_0x1face0(0x204)](_0xe6e940);console['error']('\x20\x20'+_0x2737e6+'\x20'+hyperlink(_0x4a3191[_0x1face0(0x1f0)],_0x270d75)+'\x20'+a18_0x1e4c00[_0x1face0(0x1e7)](_0x270d75));}}_0x1ee428[_0x1face0(0x1e6)]>0x0&&console[_0x1face0(0x1fc)](a18_0x1e4c00[_0x1face0(0x1d7)](_0x1face0(0x20c)+_0x1ee428[_0x1face0(0x1e6)]+_0x1face0(0x1f5)));_0x1ee428[_0x1face0(0x203)]>0x0&&console[_0x1face0(0x1fc)](a18_0x1e4c00['green']('✔\x20Updated\x20'+_0x1ee428[_0x1face0(0x203)]+'\x20campaigns'));if(_0x1ee428[_0x1face0(0x1ee)][_0x1face0(0x1e4)]>0x0){console[_0x1face0(0x1fc)](a18_0x1e4c00['red']('✘\x20'+_0x1ee428['errors'][_0x1face0(0x1e4)]+_0x1face0(0x205)));for(const _0x4c39d5 of _0x1ee428[_0x1face0(0x1ee)]){console[_0x1face0(0x1fc)]('\x20\x20'+a18_0x1e4c00[_0x1face0(0x1ef)](_0x4c39d5[_0x1face0(0x1f0)])+':\x20'+_0x4c39d5[_0x1face0(0x1fc)]);}}return saveSessionContext({'engage_workspace':_0x3a2cde},_0x19aad4[_0x1face0(0x1d3)]),_0x1ee428[_0x1face0(0x1ee)]['length']>0x0?0x1:0x0;}}
1
+ const a18_0x33f365=a18_0x336c;(function(_0x466c83,_0x3935a0){const _0x1e041b=a18_0x336c,_0x34f391=_0x466c83();while(!![]){try{const _0x368cb1=-parseInt(_0x1e041b(0x179))/0x1*(-parseInt(_0x1e041b(0x1a4))/0x2)+parseInt(_0x1e041b(0x19a))/0x3*(parseInt(_0x1e041b(0x1ad))/0x4)+-parseInt(_0x1e041b(0x17b))/0x5+-parseInt(_0x1e041b(0x176))/0x6*(parseInt(_0x1e041b(0x18e))/0x7)+parseInt(_0x1e041b(0x1a6))/0x8*(parseInt(_0x1e041b(0x187))/0x9)+parseInt(_0x1e041b(0x17e))/0xa*(-parseInt(_0x1e041b(0x1ba))/0xb)+-parseInt(_0x1e041b(0x1b1))/0xc*(parseInt(_0x1e041b(0x17a))/0xd);if(_0x368cb1===_0x3935a0)break;else _0x34f391['push'](_0x34f391['shift']());}catch(_0x254921){_0x34f391['push'](_0x34f391['shift']());}}}(a18_0x3405,0x49dd3));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a18_0x336c(_0x46f3a8,_0x315efa){_0x46f3a8=_0x46f3a8-0x171;const _0x340511=a18_0x3405();let _0x336cee=_0x340511[_0x46f3a8];return _0x336cee;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a18_0x4716bb from'chalk';import a18_0x138b00 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a18_0x3405(){const _0x42c19c=['create','errors','path','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','-\x20no\x20changes\x20applied','config','Push\x20','2WIFpnI','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','13176WgHQXD','campaign_type','description','relativePath','filter','\x20campaigns','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','219836fWKoma','cwd','resolveWorkspaceId','name','36uCrcUT','results','Aborted.','def','engage','segment','Preparing\x20push\x20to\x20workspace\x20\x27','error','dim','9944oetuxq','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','✔\x20Updated\x20','Resolving\x20references...','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','cyan','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','\x20\x20\x20\x20','yellow','session','message','\x0aPush\x20summary\x20for\x20workspace\x20\x27','length','data','6zDCEgW','yes','warnings','235551VnWNNf','1219933WBOSQy','828740cjVtKi','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','\x20errors:','6100kbRKFD','\x20campaign\x20files','\x20campaigns\x20to\x20update:','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','\x20campaigns?','action','1\x20campaign\x20file:\x20','Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','3303zXijzE','\x27...','red','valid','created','updated','setPhase','1003037bopUZG','Pushing\x20campaigns...','Workspace\x20is\x20required.','campaignId','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','dirname','dryRun','verbose','green','engage_workspace','\x0aError:','\x20new\x20campaigns:','33zmvzBl','\x0aValidation\x20errors\x20in\x20','site'];a18_0x3405=function(){return _0x42c19c;};return a18_0x3405();}export class EngageCampaignPushCommand extends BaseCommand{[a18_0x33f365(0x1b0)]='engage:campaign:push';[a18_0x33f365(0x1a8)]=a18_0x33f365(0x181);async['execute'](_0x11abbe){const _0x5e4643=a18_0x33f365,{options:_0x607248,args:_0x4ff19b,tdx:_0x57a94d}=_0x11abbe,_0x572af0=_0x607248,_0x55f1aa=_0x4ff19b[0x0],_0x44fe1e=_0x55f1aa?a18_0x138b00['resolve'](_0x55f1aa):undefined,_0x290975=_0x44fe1e?isYamlFile(_0x44fe1e):![];let _0x31e055;if(_0x290975&&_0x44fe1e)_0x31e055=a18_0x138b00[_0x5e4643(0x193)](_0x44fe1e);else _0x44fe1e?_0x31e055=_0x44fe1e:_0x31e055=process[_0x5e4643(0x1ae)]();let _0x278f06;const _0x339fbd=tryFindTdxConfig(_0x31e055);_0x339fbd?.[_0x5e4643(0x1a2)][_0x5e4643(0x197)]&&(_0x278f06=_0x339fbd[_0x5e4643(0x1a2)][_0x5e4643(0x197)],!_0x290975&&(_0x31e055=_0x339fbd['configDir']));_0x572af0['workspace']&&(_0x278f06=_0x572af0['workspace']);if(!_0x278f06){const _0x19304f=loadSessionContext(_0x572af0['session']);_0x19304f?.['engage_workspace']&&(_0x278f06=_0x19304f[_0x5e4643(0x197)]);}if(!_0x278f06)return console[_0x5e4643(0x1b8)](a18_0x4716bb['yellow'](_0x5e4643(0x190))),console['error'](_0x5e4643(0x17c)),console[_0x5e4643(0x1b8)](_0x5e4643(0x1be)),console[_0x5e4643(0x1b8)](_0x5e4643(0x186)),console[_0x5e4643(0x1b8)](_0x5e4643(0x1a0)),0x1;let _0x2d7871;_0x290975&&_0x44fe1e?_0x2d7871=[_0x44fe1e]:_0x2d7871=discoverCampaignFiles(_0x31e055);if(_0x2d7871[_0x5e4643(0x174)]===0x0)return console[_0x5e4643(0x1b8)](a18_0x4716bb[_0x5e4643(0x1c2)](_0x5e4643(0x1bb)+_0x31e055)),console[_0x5e4643(0x1b8)](a18_0x4716bb[_0x5e4643(0x1b9)](_0x5e4643(0x1c0))),0x1;const _0x556145=_0x2d7871['map'](_0x23f434=>parseCampaignFile(_0x23f434,a18_0x138b00[_0x5e4643(0x193)](_0x23f434))),_0xa0e573=_0x556145['length']===0x1?_0x5e4643(0x184)+_0x556145[0x0][_0x5e4643(0x1b4)]['name']:_0x556145['length']+_0x5e4643(0x17f);console['error'](_0x5e4643(0x185)+a18_0x4716bb[_0x5e4643(0x1bf)](_0xa0e573));let _0x17548d=![];for(const _0x481460 of _0x556145){const _0x1e3b24=validateCampaignDef(_0x481460[_0x5e4643(0x1b4)]);if(!_0x1e3b24[_0x5e4643(0x18a)]){_0x17548d=!![],console[_0x5e4643(0x1b8)](a18_0x4716bb[_0x5e4643(0x189)](_0x5e4643(0x19b)+_0x481460[_0x5e4643(0x1a9)]+':'));for(const _0x348f22 of _0x1e3b24[_0x5e4643(0x19e)]){console[_0x5e4643(0x1b8)]('\x20\x20'+a18_0x4716bb[_0x5e4643(0x189)]('✗')+'\x20'+_0x348f22[_0x5e4643(0x19f)]+':\x20'+_0x348f22[_0x5e4643(0x172)]);}}for(const _0x2d8ad4 of _0x1e3b24[_0x5e4643(0x178)]){console[_0x5e4643(0x1b8)]('\x20\x20'+a18_0x4716bb[_0x5e4643(0x1c2)]('⚠')+'\x20'+_0x2d8ad4['path']+':\x20'+_0x2d8ad4['message']);}}if(_0x17548d)return console[_0x5e4643(0x1b8)](a18_0x4716bb['red'](_0x5e4643(0x192))),0x1;const _0x35c1b5=await _0x57a94d['engage'][_0x5e4643(0x1af)](_0x278f06),_0x1e5d0a=await withProgressSpinner(_0x5e4643(0x1b7)+_0x278f06+_0x5e4643(0x188),_0x4ac3ba=>preparePush({'engage':_0x57a94d[_0x5e4643(0x1b5)],'segment':_0x57a94d[_0x5e4643(0x1b6)]},_0x556145,_0x35c1b5,{'progress':{'update':_0x5f20a6=>_0x4ac3ba[_0x5e4643(0x18d)](_0x5f20a6)}}),{'verbose':_0x572af0[_0x5e4643(0x195)]}),_0x1ef812=_0x1e5d0a[_0x5e4643(0x175)];await withProgressSpinner(_0x5e4643(0x1bd),_0x4162aa=>resolveAndBuildInputs({'engage':_0x57a94d[_0x5e4643(0x1b5)],'segment':_0x57a94d[_0x5e4643(0x1b6)]},_0x1ef812,_0x35c1b5,{'progress':{'update':_0x3f0c73=>_0x4162aa[_0x5e4643(0x18d)](_0x3f0c73)}}),{'verbose':_0x572af0[_0x5e4643(0x195)]});const _0x6887e=_0x1ef812[_0x5e4643(0x1aa)](_0x30ebea=>_0x30ebea[_0x5e4643(0x183)]===_0x5e4643(0x19d)),_0x505782=_0x1ef812[_0x5e4643(0x1aa)](_0x46c82f=>_0x46c82f[_0x5e4643(0x183)]==='update');console[_0x5e4643(0x1b8)](_0x5e4643(0x173)+_0x278f06+'\x27:');if(_0x6887e[_0x5e4643(0x174)]>0x0){console[_0x5e4643(0x1b8)]('\x20\x20'+a18_0x4716bb[_0x5e4643(0x196)]('+\x20'+_0x6887e[_0x5e4643(0x174)]+_0x5e4643(0x199)));for(const _0x15de7b of _0x6887e){console[_0x5e4643(0x1b8)](_0x5e4643(0x1c1)+a18_0x4716bb[_0x5e4643(0x196)]('+')+'\x20'+_0x15de7b[_0x5e4643(0x1b4)]['name']+'\x20('+_0x15de7b[_0x5e4643(0x1b4)][_0x5e4643(0x1a7)]+')');}}if(_0x505782[_0x5e4643(0x174)]>0x0){console['error']('\x20\x20'+a18_0x4716bb[_0x5e4643(0x1c2)]('~\x20'+_0x505782[_0x5e4643(0x174)]+_0x5e4643(0x180)));for(const _0x54a8ae of _0x505782){console[_0x5e4643(0x1b8)](_0x5e4643(0x1c1)+a18_0x4716bb[_0x5e4643(0x1c2)]('~')+'\x20'+_0x54a8ae[_0x5e4643(0x1b4)][_0x5e4643(0x1b0)]+'\x20('+_0x54a8ae[_0x5e4643(0x1b4)][_0x5e4643(0x1a7)]+')');}}if(_0x6887e[_0x5e4643(0x174)]===0x0&&_0x505782[_0x5e4643(0x174)]===0x0)return console[_0x5e4643(0x1b8)](a18_0x4716bb[_0x5e4643(0x196)](_0x5e4643(0x1ac))),0x0;if(_0x572af0[_0x5e4643(0x194)])return console[_0x5e4643(0x1b8)](a18_0x4716bb[_0x5e4643(0x1c2)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x572af0[_0x5e4643(0x177)]){if(!isInteractive())return console['error'](a18_0x4716bb['red'](_0x5e4643(0x198)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a18_0x4716bb[_0x5e4643(0x1b9)](_0x5e4643(0x1a5))),0x1;const _0x2df414=await confirmKey(_0x5e4643(0x1a3)+(_0x6887e[_0x5e4643(0x174)]+_0x505782['length'])+_0x5e4643(0x182));if(!_0x2df414)return console[_0x5e4643(0x1b8)](a18_0x4716bb[_0x5e4643(0x1c2)](_0x5e4643(0x1b3)),_0x5e4643(0x1a1)),0x1;}const _0x19f9cc=await withProgressSpinner(_0x5e4643(0x18f),_0x5dc912=>executePush({'engage':_0x57a94d['engage'],'segment':_0x57a94d[_0x5e4643(0x1b6)]},_0x1ef812,{'progress':{'update':_0x49dede=>_0x5dc912[_0x5e4643(0x18d)](_0x49dede)}}),{'verbose':_0x572af0[_0x5e4643(0x195)]}),_0x30a762=_0x19f9cc[_0x5e4643(0x175)];for(const _0x59d5d4 of _0x30a762[_0x5e4643(0x1b2)]){if(_0x59d5d4[_0x5e4643(0x191)]&&(_0x59d5d4[_0x5e4643(0x183)]===_0x5e4643(0x18b)||_0x59d5d4['action']===_0x5e4643(0x18c))){const _0x368b17=getCampaignUrl(_0x572af0[_0x5e4643(0x19c)],_0x35c1b5,_0x59d5d4[_0x5e4643(0x191)]),_0x17455a=_0x59d5d4[_0x5e4643(0x183)]===_0x5e4643(0x18b)?'+':'~',_0x2be794=_0x59d5d4[_0x5e4643(0x183)]===_0x5e4643(0x18b)?a18_0x4716bb[_0x5e4643(0x196)](_0x17455a):a18_0x4716bb[_0x5e4643(0x1c2)](_0x17455a);console[_0x5e4643(0x1b8)]('\x20\x20'+_0x2be794+'\x20'+hyperlink(_0x59d5d4[_0x5e4643(0x1b0)],_0x368b17)+'\x20'+a18_0x4716bb['dim'](_0x368b17));}}_0x30a762[_0x5e4643(0x18b)]>0x0&&console[_0x5e4643(0x1b8)](a18_0x4716bb['green']('✔\x20Created\x20'+_0x30a762['created']+_0x5e4643(0x1ab)));_0x30a762[_0x5e4643(0x18c)]>0x0&&console[_0x5e4643(0x1b8)](a18_0x4716bb[_0x5e4643(0x196)](_0x5e4643(0x1bc)+_0x30a762[_0x5e4643(0x18c)]+_0x5e4643(0x1ab)));if(_0x30a762[_0x5e4643(0x19e)][_0x5e4643(0x174)]>0x0){console[_0x5e4643(0x1b8)](a18_0x4716bb[_0x5e4643(0x189)]('✘\x20'+_0x30a762[_0x5e4643(0x19e)]['length']+_0x5e4643(0x17d)));for(const _0x54aecb of _0x30a762['errors']){console[_0x5e4643(0x1b8)]('\x20\x20'+a18_0x4716bb['red'](_0x54aecb[_0x5e4643(0x1b0)])+':\x20'+_0x54aecb[_0x5e4643(0x1b8)]);}}return saveSessionContext({'engage_workspace':_0x278f06},_0x572af0[_0x5e4643(0x171)]),_0x30a762[_0x5e4643(0x19e)]['length']>0x0?0x1:0x0;}}