@treasuredata/tdx 2026.3.26 → 2026.3.28

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 (224) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/auth-login-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.d.ts +141 -2
  35. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/parent-segment-command.js.map +1 -1
  38. package/dist/commands/policy-command.js +1 -1
  39. package/dist/commands/profile-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/schedule-command.js +1 -1
  43. package/dist/commands/segment-command.js +1 -1
  44. package/dist/commands/segment-create-command.js +1 -1
  45. package/dist/commands/segment-fields-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/workflow-command.js +1 -1
  60. package/dist/core/auth.js +1 -1
  61. package/dist/core/command-output.js +1 -1
  62. package/dist/core/config.js +1 -1
  63. package/dist/core/connection-cache.js +1 -1
  64. package/dist/core/constants.js +1 -1
  65. package/dist/core/credential-cache.js +1 -1
  66. package/dist/core/global-context.js +1 -1
  67. package/dist/core/keychain.js +1 -1
  68. package/dist/core/oauth-keychain.js +1 -1
  69. package/dist/core/oauth.d.ts.map +1 -1
  70. package/dist/core/oauth.js +1 -1
  71. package/dist/core/oauth.js.map +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/user-cache.js +1 -1
  76. package/dist/core/version.js +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/mcp/server.js +1 -1
  79. package/dist/mcp/tools/index.js +1 -1
  80. package/dist/mcp/tools/tdx-run.js +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/utils.js +1 -1
  83. package/dist/proxy/claude-usage-tracker.js +1 -1
  84. package/dist/proxy/passthrough-server.js +1 -1
  85. package/dist/proxy/sse-usage-parser.js +1 -1
  86. package/dist/sdk/agent/agent-config.js +1 -1
  87. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  88. package/dist/sdk/agent/agent-yaml.js +1 -1
  89. package/dist/sdk/agent/test/evaluator.js +1 -1
  90. package/dist/sdk/agent/test/executor.js +1 -1
  91. package/dist/sdk/agent/test/index.js +1 -1
  92. package/dist/sdk/agent/test/output.js +1 -1
  93. package/dist/sdk/agent/test/parser.js +1 -1
  94. package/dist/sdk/agent/tool-target-registry.js +1 -1
  95. package/dist/sdk/api.js +1 -1
  96. package/dist/sdk/client/cdp-api-client.d.ts +29 -1
  97. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  100. package/dist/sdk/client/delivery-api-client.js +1 -1
  101. package/dist/sdk/client/endpoints.js +1 -1
  102. package/dist/sdk/client/engage-api-client.js +1 -1
  103. package/dist/sdk/client/http-client.js +1 -1
  104. package/dist/sdk/client/llm-api-client.js +1 -1
  105. package/dist/sdk/client/oauth-refresh.js +1 -1
  106. package/dist/sdk/client/rate-limiter.js +1 -1
  107. package/dist/sdk/client/td-api-client.js +1 -1
  108. package/dist/sdk/client/trino-api-client.js +1 -1
  109. package/dist/sdk/client/workflow-client.js +1 -1
  110. package/dist/sdk/connection-validator.js +1 -1
  111. package/dist/sdk/connection.js +1 -1
  112. package/dist/sdk/delivery.js +1 -1
  113. package/dist/sdk/engage/campaign-pull.js +1 -1
  114. package/dist/sdk/engage/campaign-push.js +1 -1
  115. package/dist/sdk/engage/campaign-validator.js +1 -1
  116. package/dist/sdk/engage/campaign-yaml.js +1 -1
  117. package/dist/sdk/engage/template-pull.js +1 -1
  118. package/dist/sdk/engage/template-push.js +1 -1
  119. package/dist/sdk/engage/template-validator.js +1 -1
  120. package/dist/sdk/engage/template-yaml.js +1 -1
  121. package/dist/sdk/engage/types/campaign-def.js +1 -1
  122. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  123. package/dist/sdk/engage/types/template-schema.js +1 -1
  124. package/dist/sdk/engage.js +1 -1
  125. package/dist/sdk/errors.js +1 -1
  126. package/dist/sdk/index.js +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/personalization.d.ts +228 -0
  136. package/dist/sdk/personalization.d.ts.map +1 -1
  137. package/dist/sdk/personalization.js +1 -1
  138. package/dist/sdk/personalization.js.map +1 -1
  139. package/dist/sdk/policy.js +1 -1
  140. package/dist/sdk/query/index.js +1 -1
  141. package/dist/sdk/query/sql-parser.js +1 -1
  142. package/dist/sdk/realtime.d.ts +57 -0
  143. package/dist/sdk/realtime.d.ts.map +1 -1
  144. package/dist/sdk/realtime.js +1 -1
  145. package/dist/sdk/realtime.js.map +1 -1
  146. package/dist/sdk/schedule.js +1 -1
  147. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/fields-display.js +1 -1
  149. package/dist/sdk/segment/file-discovery.js +1 -1
  150. package/dist/sdk/segment/journey-utils.js +1 -1
  151. package/dist/sdk/segment/journey-validator.js +1 -1
  152. package/dist/sdk/segment/journey-yaml.js +1 -1
  153. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  154. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  155. package/dist/sdk/segment/pull-workflow.js +1 -1
  156. package/dist/sdk/segment/push-recovery.js +1 -1
  157. package/dist/sdk/segment/push-workflow.js +1 -1
  158. package/dist/sdk/segment/resolution-context.js +1 -1
  159. package/dist/sdk/segment/segment-path-parser.js +1 -1
  160. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  161. package/dist/sdk/segment/segment-validator.js +1 -1
  162. package/dist/sdk/segment/target-resolution.js +1 -1
  163. package/dist/sdk/segment/tdx-config.js +1 -1
  164. package/dist/sdk/segment/types/activation-schema.js +1 -1
  165. package/dist/sdk/segment/types/journey-def.js +1 -1
  166. package/dist/sdk/segment/types/journey-schema.js +1 -1
  167. package/dist/sdk/segment/types/segment-def.js +1 -1
  168. package/dist/sdk/segment/types/segment-schema.js +1 -1
  169. package/dist/sdk/segment/validate-files.js +1 -1
  170. package/dist/sdk/segment/yaml-validator.js +1 -1
  171. package/dist/sdk/segment.js +1 -1
  172. package/dist/sdk/types/cdp.d.ts +76 -0
  173. package/dist/sdk/types/cdp.d.ts.map +1 -1
  174. package/dist/sdk/types/index.d.ts +1 -1
  175. package/dist/sdk/types/index.d.ts.map +1 -1
  176. package/dist/sdk/types/index.js +1 -1
  177. package/dist/sdk/types/index.js.map +1 -1
  178. package/dist/sdk/types/progress.js +1 -1
  179. package/dist/sdk/user.js +1 -1
  180. package/dist/sdk/util/format-detector.js +1 -1
  181. package/dist/sdk/util/formatters.js +1 -1
  182. package/dist/sdk/util/index.js +1 -1
  183. package/dist/sdk/util/paginate.js +1 -1
  184. package/dist/sdk/util/tree-formatter.js +1 -1
  185. package/dist/sdk/workflow/archive-validation.js +1 -1
  186. package/dist/sdk/workflow/clone-workflow.js +1 -1
  187. package/dist/sdk/workflow/index.js +1 -1
  188. package/dist/sdk/workflow/pull-workflow.js +1 -1
  189. package/dist/sdk/workflow/push-workflow.js +1 -1
  190. package/dist/sdk/workflow/tdx-config.js +1 -1
  191. package/dist/sdk/workflow/workflow-utils.js +1 -1
  192. package/dist/test-utils/command-runner.js +1 -1
  193. package/dist/test-utils/factories.js +1 -1
  194. package/dist/test-utils/fixtures.js +1 -1
  195. package/dist/test-utils/http-mock.js +1 -1
  196. package/dist/test-utils/index.js +1 -1
  197. package/dist/utils/async.js +1 -1
  198. package/dist/utils/colors.js +1 -1
  199. package/dist/utils/diff.js +1 -1
  200. package/dist/utils/file-permissions.js +1 -1
  201. package/dist/utils/file-reader.js +1 -1
  202. package/dist/utils/github-releases.js +1 -1
  203. package/dist/utils/global-cache.js +1 -1
  204. package/dist/utils/json-loader.js +1 -1
  205. package/dist/utils/local-cache.js +1 -1
  206. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  207. package/dist/utils/logger/formatters/index.js +1 -1
  208. package/dist/utils/logger/handlers/console-handler.js +1 -1
  209. package/dist/utils/logger/handlers/file-handler.js +1 -1
  210. package/dist/utils/logger/handlers/index.js +1 -1
  211. package/dist/utils/logger/handlers/null-handler.js +1 -1
  212. package/dist/utils/logger/index.js +1 -1
  213. package/dist/utils/logger/logger.js +1 -1
  214. package/dist/utils/logger/types.js +1 -1
  215. package/dist/utils/option-validation.js +1 -1
  216. package/dist/utils/process.js +1 -1
  217. package/dist/utils/prompt.js +1 -1
  218. package/dist/utils/spinner.js +1 -1
  219. package/dist/utils/sse-parser.js +1 -1
  220. package/dist/utils/string-utils.js +1 -1
  221. package/dist/utils/table-ref-parser.js +1 -1
  222. package/dist/utils/tdx-logger.js +1 -1
  223. package/dist/utils/version-check.js +1 -1
  224. package/package.json +1 -1
@@ -1 +1 @@
1
- const a10_0x5def4e=a10_0x584d;(function(_0xd4fbc7,_0xfbfbc2){const _0x4321f7=a10_0x584d,_0x5764e9=_0xd4fbc7();while(!![]){try{const _0x3278fb=parseInt(_0x4321f7(0xf0))/0x1*(-parseInt(_0x4321f7(0x12b))/0x2)+-parseInt(_0x4321f7(0x145))/0x3+parseInt(_0x4321f7(0x11b))/0x4*(-parseInt(_0x4321f7(0x184))/0x5)+parseInt(_0x4321f7(0x165))/0x6*(parseInt(_0x4321f7(0x100))/0x7)+-parseInt(_0x4321f7(0x13f))/0x8+parseInt(_0x4321f7(0x176))/0x9*(-parseInt(_0x4321f7(0x147))/0xa)+-parseInt(_0x4321f7(0x120))/0xb*(-parseInt(_0x4321f7(0x15a))/0xc);if(_0x3278fb===_0xfbfbc2)break;else _0x5764e9['push'](_0x5764e9['shift']());}catch(_0x36ed26){_0x5764e9['push'](_0x5764e9['shift']());}}}(a10_0x52b3,0xc2e5a));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{execFile}from'node:child_process';import{existsSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';import{promisify}from'node:util';import a10_0x2df8ac 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,loadReleaseChannel}from'../core/config.js';import{resolveReleaseTag}from'../utils/github-releases.js';function a10_0x52b3(){const _0x24cd2d=['add','patch','llm-proxy','\x27\x20configured','Configuring\x20marketplace\x20\x27','Restored\x20default\x20td-skills\x20marketplace','statusLine','update','INVALID_ARGUMENT','12hxblfE','continue','apiKey','port','.claude','Updating\x20marketplace\x20\x27','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','join','fail','error','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','--tags','http://127.0.0.1:','Failed\x20to\x20update\x20marketplace\x20\x27','logLevel','sql-skills','6374493xntKSc','Failed\x20to\x20configure\x20marketplace\x20\x27','Command\x20failed\x20(exit\x20','claude','info','):\x20claude\x20','\x27:\x20','Initializing\x20proxy\x20logger...','main','text','TD\x20Docs\x20MCP\x20Server','debug','✓\x20Logging\x20to\x20','✓\x20Logs\x20saved\x20to\x20','5YVWDoV','false','stringify','getLogPath','Creating\x20.claude/settings.local.json...','ANTHROPIC_AUTH_TOKEN','\x27\x20updated','CLAUDE_CODE_UNSUPPORTED_VERSION','\x20→\x20','already\x20exists','✓\x20MCP\x20server\x20\x27','\x27\x20installed','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','mcp','settings.local.json','1opPWyo','major','origin','name','workflow-skills','INTERNAL','context','Checking\x20out\x20td-skills\x20','red','stderr','user','message','toString','\x20or\x20later.','close','✓\x20Settings\x20restored:\x20.claude/settings.local.json','1735629RhngrE','originalSettings','plugins','tdx-skills','pid','ANTHROPIC_MODEL','CLAUDE_CODE_USE_BEDROCK','Installing\x20plugin\x20\x27','...','plugin','verbose','Failed\x20to\x20install\x20plugin\x20\x27','\x20configuration\x20failed','Command\x20output:\x20','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','warn','--transport','Failed\x20to\x20remove\x20marketplace\x20\x27','exit','stop','toISOString','Initializing...','tdx\x20claude\x20statusline','.tdx-settings-backup.json','✓\x20Settings\x20configured:\x20.claude/settings.local.json','site','5380412DTvxPm','http','\x27...','\x20already\x20configured','Failed\x20to\x20launch\x20Claude\x20Code:\x20','61443019wplpPa','https://github.com/treasure-data/td-skills','origin/main','logger','Warning:\x20Failed\x20to\x20configure\x20','minor','ENOENT','Marketplace\x20\x27','command','list','Claude\x20Code\x20version\x20check\x20failed','1368182rQYXij','cause','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','utf-8','CLAUDE_CODE_NOT_FOUND','git','code','includes','env','checkout','2.0.20','\x20is\x20too\x20old\x20(minimum:\x20','tdx-managed-proxy','marketplaces','https://docs.treasuredata.com/mcp','--force','inherit','account_id','Claude\x20Code\x20version\x20','✓\x20Plugin\x20\x27','9807432LyPHYg','init','already\x20installed','marketplace','trim','Claude\x20Code\x20CLI\x20not\x20found','3959775CcwVrR','ANTHROPIC_BASE_URL','10iRSBri','data','td-skills','treasure-data','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Configuring\x20MCP\x20server\x20\x27','cwd','parse','remove','log','pipe','CLAUDE_CODE_USE_VERTEX','\x20claude\x20statusline','execute','green','start','passThroughServer','Invalid\x20minimum\x20version\x20format:\x20','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','12gPsJGr','\x27\x20removed'];a10_0x52b3=function(){return _0x24cd2d;};return a10_0x52b3();}function a10_0x584d(_0x3455f8,_0x1afc13){_0x3455f8=_0x3455f8-0xec;const _0x52b351=a10_0x52b3();let _0x584de5=_0x52b351[_0x3455f8];return _0x584de5;}const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION=a10_0x5def4e(0x135),SETTINGS_BACKUP_FILENAME=a10_0x5def4e(0x118);function isProcessRunning(_0x5bc201){try{return process['kill'](_0x5bc201,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x40fb2d,_0x4bd639){const _0x28ee7e=a10_0x5def4e;if(!existsSync(_0x40fb2d))return;try{const _0x24d120=await readFile(_0x40fb2d,_0x28ee7e(0x12e)),_0x2ddd01=JSON[_0x28ee7e(0x14e)](_0x24d120),_0x3c6fed=_0x2ddd01['env']||{};for(const _0x587e3d of['ANTHROPIC_BASE_URL',_0x28ee7e(0x105),_0x28ee7e(0x189),'CLAUDE_CODE_USE_BEDROCK',_0x28ee7e(0x152)]){_0x4bd639[_0x587e3d]!==undefined?_0x3c6fed[_0x587e3d]=_0x4bd639[_0x587e3d]:delete _0x3c6fed[_0x587e3d];}_0x4bd639[_0x28ee7e(0x162)]!==undefined?_0x2ddd01[_0x28ee7e(0x162)]=_0x4bd639['statusLine']:delete _0x2ddd01[_0x28ee7e(0x162)],_0x2ddd01[_0x28ee7e(0x133)]=_0x3c6fed,await writeFile(_0x40fb2d,JSON[_0x28ee7e(0x186)](_0x2ddd01,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x51041f){try{await unlink(_0x51041f);}catch{}}async function recoverFromStaleBackup(_0x1ce4a4,_0xb8d408){const _0x4e1492=a10_0x5def4e;if(!existsSync(_0xb8d408))return undefined;try{const _0x148351=await readFile(_0xb8d408,_0x4e1492(0x12e)),_0x29b897=JSON[_0x4e1492(0x14e)](_0x148351);if(isProcessRunning(_0x29b897[_0x4e1492(0x104)]))return{'liveSessionOriginals':_0x29b897[_0x4e1492(0x101)]};return await applyOriginalSettings(_0x1ce4a4,_0x29b897[_0x4e1492(0x101)]),await safeUnlink(_0xb8d408),undefined;}catch{return await safeUnlink(_0xb8d408),undefined;}}function handleInstallationError(_0x4eae25,_0x1034ab,_0x42a5f5,_0x282927){const _0xcce9c=a10_0x5def4e;errorContains(_0x4eae25,_0xcce9c(0x18d),_0xcce9c(0x141),'already\x20configured')?(_0x42a5f5['text']='✓\x20'+_0x1034ab+_0xcce9c(0x11e),_0x282927?.[_0xcce9c(0x17a)](_0x1034ab+'\x20already\x20configured'),_0x4eae25 instanceof SDKError&&_0x4eae25[_0xcce9c(0x12c)]&&_0x282927?.[_0xcce9c(0x181)](_0xcce9c(0x10d)+_0x4eae25[_0xcce9c(0x12c)][_0xcce9c(0xfb)])):(_0x42a5f5[_0xcce9c(0x110)](_0xcce9c(0x124)+_0x1034ab),_0x282927?.['error'](_0x1034ab+_0xcce9c(0x10c),_0x4eae25));}export function parseVersion(_0x53685e){const _0x329892=a10_0x5def4e,_0x36856c=_0x53685e[_0x329892(0x143)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x36856c)return null;return{'major':parseInt(_0x36856c[0x1],0xa),'minor':parseInt(_0x36856c[0x2],0xa),'patch':parseInt(_0x36856c[0x3],0xa)};}export function compareVersions(_0x67deb5,_0x483b55){const _0x4048b9=a10_0x5def4e;if(_0x67deb5[_0x4048b9(0xf1)]!==_0x483b55['major'])return _0x67deb5[_0x4048b9(0xf1)]-_0x483b55['major'];if(_0x67deb5[_0x4048b9(0x125)]!==_0x483b55['minor'])return _0x67deb5['minor']-_0x483b55[_0x4048b9(0x125)];return _0x67deb5[_0x4048b9(0x15d)]-_0x483b55[_0x4048b9(0x15d)];}async function checkClaudeVersion(_0x1b925f,_0x5a508a){const _0x267f55=a10_0x5def4e;_0x5a508a?.[_0x267f55(0x181)]('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x1b925f+')');const _0x21481e=await executeClaudeCommand(['--version'],undefined,_0x5a508a),_0x346529=parseVersion(_0x21481e);if(!_0x346529){_0x5a508a?.[_0x267f55(0x110)]('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x21481e);return;}const _0x1ca5bd=_0x346529[_0x267f55(0xf1)]+'.'+_0x346529[_0x267f55(0x125)]+'.'+_0x346529['patch'],_0x150be7=parseVersion(_0x1b925f);if(!_0x150be7){_0x5a508a?.['warn'](_0x267f55(0x158)+_0x1b925f);return;}if(compareVersions(_0x346529,_0x150be7)<0x0){_0x5a508a?.[_0x267f55(0x16f)](_0x267f55(0x13d)+_0x1ca5bd+_0x267f55(0x136)+_0x1b925f+')');throw new SDKError(ErrorCode[_0x267f55(0x18b)],_0x267f55(0x13d)+_0x1ca5bd+_0x267f55(0x170)+_0x1b925f+_0x267f55(0xfd),undefined,{'helpText':_0x267f55(0x10e)});}_0x5a508a?.[_0x267f55(0x181)]('Claude\x20Code\x20version\x20'+_0x1ca5bd+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x48caeb,_0x1e8235,_0x30a705){const _0x3b01da=a10_0x5def4e;return _0x30a705?.[_0x3b01da(0x17a)]('Executing:\x20claude\x20'+_0x48caeb[_0x3b01da(0x16d)]('\x20')),new Promise((_0x16fb4e,_0x122bb0)=>{const _0x571d85=_0x3b01da,_0x33e136=crossSpawn(_0x571d85(0x179),_0x48caeb,{'stdio':_0x571d85(0x151)});let _0x204378='',_0x6fe959='';_0x33e136['stdout']?.['on'](_0x571d85(0x148),_0x15d6d0=>{const _0x5f7b9a=_0x571d85;_0x204378+=_0x15d6d0[_0x5f7b9a(0xfc)]();}),_0x33e136[_0x571d85(0xf9)]?.['on'](_0x571d85(0x148),_0x5044be=>{const _0x4af873=_0x571d85;_0x6fe959+=_0x5044be[_0x4af873(0xfc)]();}),_0x33e136['on'](_0x571d85(0x16f),_0x27d5e5=>{const _0x273830=_0x571d85;_0x27d5e5[_0x273830(0x131)]===_0x273830(0x126)?(_0x30a705?.[_0x273830(0x16f)](_0x273830(0x144)),_0x122bb0(new SDKError(ErrorCode[_0x273830(0x12f)],_0x273830(0x144),_0x27d5e5,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x30a705?.['error']('Command\x20spawn\x20error:\x20'+_0x27d5e5[_0x273830(0xfb)]),_0x122bb0(new SDKError(ErrorCode[_0x273830(0xf5)],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x27d5e5[_0x273830(0xfb)],_0x27d5e5)));}),_0x33e136['on'](_0x571d85(0x113),_0x31c393=>{const _0x23de5f=_0x571d85;if(_0x31c393===0x0)_0x16fb4e(_0x204378);else _0x1e8235?(_0x30a705?.['error'](_0x23de5f(0x178)+_0x31c393+_0x23de5f(0x17b)+_0x48caeb[_0x23de5f(0x16d)]('\x20')),_0x122bb0(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x1e8235,new Error(_0x6fe959)))):_0x16fb4e('');});});}async function ensureMcpServer(_0x5d425f,_0x4ceef1,_0x16c395,_0x1e9575,_0x523a8f){const _0x3d9af3=a10_0x5def4e;_0x1e9575[_0x3d9af3(0x17f)]=_0x3d9af3(0x14c)+_0x5d425f+'\x27...',await executeClaudeCommand([_0x3d9af3(0xee),_0x3d9af3(0x15c),_0x5d425f,_0x4ceef1,_0x3d9af3(0x111),_0x16c395],_0x3d9af3(0x12d)+_0x5d425f+'\x27',_0x523a8f),_0x1e9575[_0x3d9af3(0x17f)]=_0x3d9af3(0x18e)+_0x5d425f+_0x3d9af3(0x15f);}export const DEFAULT_TD_SKILLS_URL=a10_0x5def4e(0x121);export function getTdSkillsRepoUrl(){const _0x301952=process.env.TDX_TD_SKILLS_REPO;if(_0x301952)return _0x301952;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x3a4cc7,_0x5834d6){const _0x608f5b=a10_0x5def4e;try{const _0x40c3e5=await executeClaudeCommand([_0x608f5b(0x109),_0x608f5b(0x142),_0x608f5b(0x129)],'Failed\x20to\x20list\x20marketplaces',_0x5834d6);if(!_0x40c3e5[_0x608f5b(0x132)](_0x3a4cc7)){_0x5834d6?.[_0x608f5b(0x181)](_0x608f5b(0x127)+_0x3a4cc7+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand(['plugin',_0x608f5b(0x142),_0x608f5b(0x14f),_0x3a4cc7],'Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x3a4cc7+'\x27',_0x5834d6),_0x5834d6?.[_0x608f5b(0x17a)]('Marketplace\x20\x27'+_0x3a4cc7+_0x608f5b(0x15b));}catch(_0x33e842){_0x5834d6?.[_0x608f5b(0x110)](_0x608f5b(0x112)+_0x3a4cc7+_0x608f5b(0x17c)+_0x33e842);}}async function restoreDefaultTdSkillsMarketplace(_0x43c44c){const _0x3fa6d8=a10_0x5def4e;try{await removeMarketplace(_0x3fa6d8(0x149),_0x43c44c),await executeClaudeCommand(['plugin','marketplace',_0x3fa6d8(0x15c),DEFAULT_TD_SKILLS_URL],undefined,_0x43c44c),_0x43c44c?.['info'](_0x3fa6d8(0x161));}catch{}}async function ensureMarketplace(_0x52780a,_0x21672a,_0xbae792,_0x43ba6e){const _0x38ca94=a10_0x5def4e;_0xbae792[_0x38ca94(0x17f)]=_0x38ca94(0x160)+_0x52780a+_0x38ca94(0x11d),await executeClaudeCommand([_0x38ca94(0x109),_0x38ca94(0x142),_0x38ca94(0x15c),_0x21672a],_0x38ca94(0x177)+_0x52780a+'\x27',_0x43ba6e),_0xbae792['text']='✓\x20Marketplace\x20\x27'+_0x52780a+_0x38ca94(0x15f);}async function updateMarketplace(_0x232ed2,_0x4acd63,_0x2cf342){const _0x531007=a10_0x5def4e;_0x4acd63[_0x531007(0x17f)]=_0x531007(0x16a)+_0x232ed2+_0x531007(0x11d),await executeClaudeCommand([_0x531007(0x109),'marketplace',_0x531007(0x163)],_0x531007(0x173)+_0x232ed2+'\x27',_0x2cf342),_0x4acd63['text']='✓\x20Marketplace\x20\x27'+_0x232ed2+_0x531007(0x18a);}async function ensurePlugin(_0x5a7052,_0x2a59bf,_0xfb4e8e,_0x4a00d8){const _0x3a93c9=a10_0x5def4e;_0xfb4e8e[_0x3a93c9(0x17f)]=_0x3a93c9(0x107)+_0x5a7052+_0x3a93c9(0x11d),await executeClaudeCommand([_0x3a93c9(0x109),'install',_0x5a7052+'@'+_0x2a59bf],_0x3a93c9(0x10b)+_0x5a7052+'\x27',_0x4a00d8),_0xfb4e8e[_0x3a93c9(0x17f)]=_0x3a93c9(0x13e)+_0x5a7052+_0x3a93c9(0xec);}function getClaudeConfigDir(){return process.env.CLAUDE_CONFIG_DIR||join(homedir(),'.claude');}async function checkoutReleaseTag(_0x2ab059,_0x491749,_0x4ec5de){const _0x4a7e37=a10_0x5def4e,_0x2a5966=join(getClaudeConfigDir(),_0x4a7e37(0x102),_0x4a7e37(0x138),_0x4a7e37(0x149));if(!existsSync(_0x2a5966)){_0x4ec5de?.[_0x4a7e37(0x181)](_0x4a7e37(0xed));return;}_0x491749['text']=_0x4a7e37(0xf7)+_0x2ab059+_0x4a7e37(0x108),await execFileAsync(_0x4a7e37(0x130),['fetch',_0x4a7e37(0xf2),_0x4a7e37(0x171),_0x4a7e37(0x13a)],{'cwd':_0x2a5966});try{await execFileAsync(_0x4a7e37(0x130),['checkout',_0x4a7e37(0x17e)],{'cwd':_0x2a5966});}catch{await execFileAsync('git',[_0x4a7e37(0x134),'-b',_0x4a7e37(0x17e),_0x4a7e37(0x122)],{'cwd':_0x2a5966});}await execFileAsync('git',['reset','--hard',_0x2ab059],{'cwd':_0x2a5966}),_0x491749[_0x4a7e37(0x17f)]='✓\x20td-skills\x20checked\x20out\x20at\x20'+_0x2ab059,_0x4ec5de?.[_0x4a7e37(0x17a)]('td-skills\x20checked\x20out\x20at\x20tag\x20'+_0x2ab059);}async function createClaudeSettings(_0x3635b4,_0x141527,_0x1b04ff){const _0x24217e=a10_0x5def4e,_0xaa7a90=join(process[_0x24217e(0x14d)](),_0x24217e(0x169)),_0x5f5d1f=join(_0xaa7a90,_0x24217e(0xef)),_0x156b19=join(_0xaa7a90,SETTINGS_BACKUP_FILENAME);await mkdir(_0xaa7a90,{'recursive':!![]});const _0x478b23=await recoverFromStaleBackup(_0x5f5d1f,_0x156b19);let _0x2bc0dd;if(_0x478b23)_0x2bc0dd=_0x478b23['liveSessionOriginals'];else{let _0x299fd4={};if(existsSync(_0x5f5d1f))try{const _0x5239a2=await readFile(_0x5f5d1f,_0x24217e(0x12e));_0x299fd4=JSON[_0x24217e(0x14e)](_0x5239a2);}catch{_0x299fd4={};}const _0x3afc14=_0x299fd4['env']||{};_0x2bc0dd={'ANTHROPIC_BASE_URL':_0x3afc14[_0x24217e(0x146)],'ANTHROPIC_MODEL':_0x3afc14[_0x24217e(0x105)],'ANTHROPIC_AUTH_TOKEN':_0x3afc14[_0x24217e(0x189)],'CLAUDE_CODE_USE_BEDROCK':_0x3afc14[_0x24217e(0x106)],'CLAUDE_CODE_USE_VERTEX':_0x3afc14['CLAUDE_CODE_USE_VERTEX'],'statusLine':_0x299fd4[_0x24217e(0x162)]};const _0x5d1567={'createdAt':new Date()[_0x24217e(0x115)](),'pid':process[_0x24217e(0x104)],'originalSettings':_0x2bc0dd};await writeFile(_0x156b19,JSON[_0x24217e(0x186)](_0x5d1567,null,0x2)+'\x0a');}let _0x4e600b={};if(existsSync(_0x5f5d1f))try{const _0x1f38d9=await readFile(_0x5f5d1f,_0x24217e(0x12e));_0x4e600b=JSON[_0x24217e(0x14e)](_0x1f38d9);}catch{_0x4e600b={};}const _0x1afcd4=_0x4e600b['env']||{},_0x52c48b={..._0x4e600b,'env':{..._0x1afcd4,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x3635b4,..._0x141527&&{'ANTHROPIC_MODEL':_0x141527},'ANTHROPIC_AUTH_TOKEN':_0x24217e(0x137),'CLAUDE_CODE_USE_BEDROCK':_0x24217e(0x185),'CLAUDE_CODE_USE_VERTEX':_0x24217e(0x185)},'statusLine':{'type':_0x24217e(0x128),'command':_0x1b04ff?'tdx\x20--profile\x20'+_0x1b04ff+_0x24217e(0x153):_0x24217e(0x117)}};return await writeFile(_0x5f5d1f,JSON[_0x24217e(0x186)](_0x52c48b,null,0x2)+'\x0a'),_0x2bc0dd;}async function restoreClaudeSettings(_0x467c1d){const _0x4d36d6=a10_0x5def4e,_0x2e4bbf=join(process[_0x4d36d6(0x14d)](),_0x4d36d6(0x169)),_0x3f2673=join(_0x2e4bbf,'settings.local.json'),_0x57ceff=join(_0x2e4bbf,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x3f2673,_0x467c1d);try{if(existsSync(_0x57ceff)){const _0x222282=await readFile(_0x57ceff,_0x4d36d6(0x12e)),_0x590dc5=JSON[_0x4d36d6(0x14e)](_0x222282);_0x590dc5['pid']===process[_0x4d36d6(0x104)]&&await safeUnlink(_0x57ceff);}}catch{}}export class ClaudeCommand extends BaseCommand{[a10_0x5def4e(0xf3)]=a10_0x5def4e(0x179);['description']=a10_0x5def4e(0x16c);[a10_0x5def4e(0x157)];[a10_0x5def4e(0x101)];[a10_0x5def4e(0x123)];[a10_0x5def4e(0x168)];async[a10_0x5def4e(0x154)](_0x459555){const _0x2f9277=a10_0x5def4e,{tdx:_0x3274bf,options:_0x3f4b30,args:_0x53eb9c}=_0x459555;let _0x197dae=![];try{const _0x488d66=_0x3f4b30,_0x16aca1=_0x488d66['proxy']===![],_0x3a7beb=_0x488d66[_0x2f9277(0x166)]===!![],_0xd90f9=_0x488d66['resume']===!![],_0x2c865f=[..._0x53eb9c];if(_0x3a7beb)_0x2c865f['unshift']('-c');else _0xd90f9&&_0x2c865f['unshift']('-r');const _0x1751cc=createCommandSpinner(_0x2f9277(0x116),{'verbose':_0x3f4b30[_0x2f9277(0x10a)]});_0x1751cc[_0x2f9277(0x156)]();try{if(!_0x16aca1){const _0x259ca0=_0x3f4b30['profile'];try{const _0x53b9a4=await _0x3274bf[_0x2f9277(0xfa)]['getCurrent']();_0x53b9a4[_0x2f9277(0x13c)]&&writeCachedAccountInfo(_0x3f4b30[_0x2f9277(0x11a)],_0x53b9a4[_0x2f9277(0x13c)],_0x259ca0);}catch{}_0x1751cc[_0x2f9277(0x17f)]=_0x2f9277(0x17d),this[_0x2f9277(0x123)]=new TDXLogger(_0x3f4b30[_0x2f9277(0x174)],!![]),await this['logger'][_0x2f9277(0x140)]();const _0x321f4f=this[_0x2f9277(0x123)][_0x2f9277(0x187)]();_0x1751cc['text']=_0x2f9277(0x182)+_0x321f4f;const _0xedf4a=getEndpoint(_0x3f4b30['site'],_0x2f9277(0x15e));_0x1751cc[_0x2f9277(0x17f)]=_0x2f9277(0x159);if(!_0x3274bf[_0x2f9277(0xf6)][_0x2f9277(0x167)])throw new SDKError(ErrorCode[_0x2f9277(0x164)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x2f9277(0x157)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0xedf4a,'apiKey':_0x3274bf[_0x2f9277(0xf6)][_0x2f9277(0x167)],'logger':this[_0x2f9277(0x123)],'site':_0x3f4b30[_0x2f9277(0x11a)],'profile':_0x259ca0}),await this[_0x2f9277(0x157)][_0x2f9277(0x156)](),this[_0x2f9277(0x168)]=this[_0x2f9277(0x157)][_0x2f9277(0x168)],_0x1751cc['text']=_0x2f9277(0x16b)+this[_0x2f9277(0x168)]+_0x2f9277(0x18c)+_0xedf4a,_0x1751cc['text']=_0x2f9277(0x188),this['originalSettings']=await createClaudeSettings(this[_0x2f9277(0x168)],undefined,_0x259ca0),_0x1751cc[_0x2f9277(0x17f)]=_0x2f9277(0x119);}else _0x1751cc['text']=_0x2f9277(0x10f);try{_0x1751cc[_0x2f9277(0x17f)]='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x2f9277(0x123)]),_0x1751cc['text']='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x35be98){_0x1751cc['fail'](_0x2f9277(0x12a));throw _0x35be98;}try{await ensureMcpServer('td-docs',_0x2f9277(0x139),_0x2f9277(0x11c),_0x1751cc,this[_0x2f9277(0x123)]);}catch(_0x514657){handleInstallationError(_0x514657,_0x2f9277(0x180),_0x1751cc,this['logger']);}try{const _0x1a17d0=getTdSkillsRepoUrl();_0x197dae=_0x1a17d0!==DEFAULT_TD_SKILLS_URL;_0x197dae&&await removeMarketplace(_0x2f9277(0x149),this['logger']);await ensureMarketplace(_0x2f9277(0x149),_0x1a17d0,_0x1751cc,this[_0x2f9277(0x123)]),await updateMarketplace(_0x2f9277(0x149),_0x1751cc,this[_0x2f9277(0x123)]),await ensurePlugin(_0x2f9277(0x175),_0x2f9277(0x149),_0x1751cc,this[_0x2f9277(0x123)]),await ensurePlugin(_0x2f9277(0xf4),'td-skills',_0x1751cc,this[_0x2f9277(0x123)]),await ensurePlugin(_0x2f9277(0x103),_0x2f9277(0x149),_0x1751cc,this[_0x2f9277(0x123)]);try{const _0x191784=loadReleaseChannel(),_0x2026cb=await resolveReleaseTag(_0x191784,_0x2f9277(0x14a),'td-skills','tdx-cli');_0x2026cb&&await checkoutReleaseTag(_0x2026cb,_0x1751cc,this[_0x2f9277(0x123)]);}catch(_0x1426f4){this[_0x2f9277(0x123)]?.[_0x2f9277(0x110)]('Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20'+_0x1426f4);}}catch(_0x554c98){handleInstallationError(_0x554c98,'td-skills\x20Plugins',_0x1751cc,this[_0x2f9277(0x123)]);}_0x1751cc['stop']();}catch(_0x3cbe6a){_0x1751cc[_0x2f9277(0x16e)]('Setup\x20failed');throw _0x3cbe6a;}const _0x380788=await findExecutable(_0x2f9277(0x179));if(!_0x380788)throw new SDKError(ErrorCode[_0x2f9277(0x12f)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x2f9277(0x14b)});const _0x1d2bcf={...process.env};!_0x16aca1&&(_0x1d2bcf[_0x2f9277(0x146)]=_0x2f9277(0x172)+this['port'],_0x1d2bcf['ANTHROPIC_AUTH_TOKEN']=_0x2f9277(0x137),_0x1d2bcf[_0x2f9277(0x106)]='false',_0x1d2bcf[_0x2f9277(0x152)]=_0x2f9277(0x185));const _0x9fad0c=crossSpawn(_0x380788,_0x2c865f,{'stdio':_0x2f9277(0x13b),'env':_0x1d2bcf}),_0x24de6c=await new Promise(_0x42f19f=>{const _0x122739=_0x2f9277;_0x9fad0c['on'](_0x122739(0x113),_0x53ad14=>{_0x42f19f(_0x53ad14||0x0);}),_0x9fad0c['on'](_0x122739(0x16f),_0x173093=>{const _0x2b0e63=_0x122739;console[_0x2b0e63(0x16f)](a10_0x2df8ac[_0x2b0e63(0xf8)](_0x2b0e63(0x11f)+_0x173093[_0x2b0e63(0xfb)])),_0x42f19f(0x1);});});_0x197dae&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&(await this[_0x2f9277(0x157)][_0x2f9277(0x114)](),console[_0x2f9277(0x150)](a10_0x2df8ac[_0x2f9277(0x155)]('✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped')));if(this['logger']){await this[_0x2f9277(0x123)][_0x2f9277(0xfe)]();const _0x227356=this[_0x2f9277(0x123)][_0x2f9277(0x187)]();console[_0x2f9277(0x150)](a10_0x2df8ac[_0x2f9277(0x155)](_0x2f9277(0x183)+_0x227356));}return this[_0x2f9277(0x101)]&&(await restoreClaudeSettings(this['originalSettings']),console[_0x2f9277(0x150)](a10_0x2df8ac[_0x2f9277(0x155)](_0x2f9277(0xff)))),_0x24de6c;}catch(_0x2f0d05){_0x197dae&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0x2f9277(0x157)]&&await this[_0x2f9277(0x157)]['stop']();this[_0x2f9277(0x123)]&&await this['logger'][_0x2f9277(0xfe)]();this[_0x2f9277(0x101)]&&await restoreClaudeSettings(this[_0x2f9277(0x101)]);throw _0x2f0d05;}}}
1
+ const a10_0x5b3bbd=a10_0x1633;(function(_0x5026ae,_0x31c7ca){const _0x520879=a10_0x1633,_0x280a7c=_0x5026ae();while(!![]){try{const _0x533f6d=parseInt(_0x520879(0x1be))/0x1+-parseInt(_0x520879(0x24c))/0x2*(parseInt(_0x520879(0x247))/0x3)+parseInt(_0x520879(0x214))/0x4*(-parseInt(_0x520879(0x1bf))/0x5)+-parseInt(_0x520879(0x21e))/0x6+-parseInt(_0x520879(0x1dd))/0x7*(-parseInt(_0x520879(0x234))/0x8)+parseInt(_0x520879(0x243))/0x9*(-parseInt(_0x520879(0x1e1))/0xa)+parseInt(_0x520879(0x203))/0xb;if(_0x533f6d===_0x31c7ca)break;else _0x280a7c['push'](_0x280a7c['shift']());}catch(_0x426d7e){_0x280a7c['push'](_0x280a7c['shift']());}}}(a10_0x1304,0xc5ca2));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{execFile}from'node:child_process';import{existsSync}from'node:fs';function a10_0x1304(){const _0x296264=['stderr','env','Failed\x20to\x20remove\x20marketplace\x20\x27','Failed\x20to\x20spawn\x20claude\x20command:\x20','main','list','td-skills\x20Plugins','data','verbose','✓\x20Claude\x20Code\x20version\x20OK','toString','patch','\x27...','Marketplace\x20\x27','2072399gWQwLN','--transport','tdx\x20--profile\x20','init','7040iFNoDv','add','origin','git','\x20or\x20later.','.claude','Executing:\x20claude\x20','...','Installing\x20plugin\x20\x27','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','logger','false','INVALID_ARGUMENT','\x20configuration\x20failed','fetch','\x20already\x20configured','context','major','workflow-skills','close','Claude\x20Code\x20CLI\x20not\x20found','ENOENT','error','Restored\x20default\x20td-skills\x20marketplace','getLogPath','Setup\x20failed','message','account_id','resume','Command\x20spawn\x20error:\x20','Warning:\x20Failed\x20to\x20configure\x20','debug','sql-skills','22941270ltkWfR','stop','https://github.com/treasure-data/td-skills','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','reset','minor','tdx\x20claude\x20statusline','http','http://127.0.0.1:','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','TD\x20Docs\x20MCP\x20Server','Failed\x20to\x20configure\x20marketplace\x20\x27','utf-8','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','✓\x20Logs\x20saved\x20to\x20','log','20tnfjiV','plugin','Failed\x20to\x20launch\x20Claude\x20Code:\x20','mcp','--tags','tdx-skills','Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20','liveSessionOriginals','checkout','install','5673798gjjcTU','\x27\x20updated','✓\x20Marketplace\x20\x27','inherit','user','\x27:\x20','Updating\x20marketplace\x20\x27','✓\x20Settings\x20restored:\x20.claude/settings.local.json','td-skills\x20checked\x20out\x20at\x20tag\x20','warn','stringify','ANTHROPIC_AUTH_TOKEN','tdx-managed-proxy','update','already\x20exists','red','includes','\x27\x20configured','marketplace','unshift','\x27\x20removed','continue','16OgUtSP','INSTALLATION_FAILED','port','passThroughServer','Claude\x20Code\x20version\x20check\x20failed','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Checking\x20Claude\x20Code\x20version...','command','ANTHROPIC_MODEL','Command\x20output:\x20','--force','tdx-cli','settings.local.json','\x20→\x20','already\x20installed','16839NBLwPZ','cause','Claude\x20Code\x20version\x20','claude','4380lLGbXh','name','statusLine','Failed\x20to\x20update\x20marketplace\x20\x27','Initializing\x20proxy\x20logger...','926xddDDl','originalSettings','\x20claude\x20statusline','remove','CLAUDE_CODE_NOT_FOUND','CLAUDE_CODE_USE_BEDROCK','Initializing...','cwd','--version','td-skills','\x20is\x20too\x20old\x20(minimum:\x20','Creating\x20.claude/settings.local.json...','Command\x20failed\x20(exit\x20','trim','ANTHROPIC_BASE_URL','text','apiKey','kill','fail','stdout','logLevel','start','CLAUDE_CODE_USE_VERTEX','CLAUDE_CODE_UNSUPPORTED_VERSION','treasure-data','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','green','1382494FdudMf','311235FOUZow','parse','join','plugins','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','site','getCurrent','Failed\x20to\x20list\x20marketplaces','pid','marketplaces','.tdx-settings-backup.json','\x27\x20installed','info','Failed\x20to\x20install\x20plugin\x20\x27','proxy','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)'];a10_0x1304=function(){return _0x296264;};return a10_0x1304();}import{homedir}from'node:os';function a10_0x1633(_0x157d14,_0x43be66){_0x157d14=_0x157d14-0x1b2;const _0x130401=a10_0x1304();let _0x1633cd=_0x130401[_0x157d14];return _0x1633cd;}import{join}from'node:path';import{promisify}from'node:util';import a10_0x5cfbc2 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,loadReleaseChannel}from'../core/config.js';import{resolveReleaseTag}from'../utils/github-releases.js';const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION='2.0.20',SETTINGS_BACKUP_FILENAME=a10_0x5b3bbd(0x1c9);function isProcessRunning(_0x3b91ea){const _0x3e3574=a10_0x5b3bbd;try{return process[_0x3e3574(0x1b4)](_0x3b91ea,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x570b43,_0x509a4b){const _0xfc3641=a10_0x5b3bbd;if(!existsSync(_0x570b43))return;try{const _0x474c85=await readFile(_0x570b43,'utf-8'),_0x2a0fb7=JSON[_0xfc3641(0x1c0)](_0x474c85),_0x8fd210=_0x2a0fb7[_0xfc3641(0x1d0)]||{};for(const _0x599fc4 of['ANTHROPIC_BASE_URL',_0xfc3641(0x23c),_0xfc3641(0x229),_0xfc3641(0x251),_0xfc3641(0x1b9)]){_0x509a4b[_0x599fc4]!==undefined?_0x8fd210[_0x599fc4]=_0x509a4b[_0x599fc4]:delete _0x8fd210[_0x599fc4];}_0x509a4b[_0xfc3641(0x249)]!==undefined?_0x2a0fb7[_0xfc3641(0x249)]=_0x509a4b['statusLine']:delete _0x2a0fb7[_0xfc3641(0x249)],_0x2a0fb7[_0xfc3641(0x1d0)]=_0x8fd210,await writeFile(_0x570b43,JSON[_0xfc3641(0x228)](_0x2a0fb7,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x4695ce){try{await unlink(_0x4695ce);}catch{}}async function recoverFromStaleBackup(_0x189ca3,_0x3aee1c){const _0xeec8de=a10_0x5b3bbd;if(!existsSync(_0x3aee1c))return undefined;try{const _0x183cf3=await readFile(_0x3aee1c,_0xeec8de(0x210)),_0x259b43=JSON[_0xeec8de(0x1c0)](_0x183cf3);if(isProcessRunning(_0x259b43['pid']))return{'liveSessionOriginals':_0x259b43[_0xeec8de(0x24d)]};return await applyOriginalSettings(_0x189ca3,_0x259b43[_0xeec8de(0x24d)]),await safeUnlink(_0x3aee1c),undefined;}catch{return await safeUnlink(_0x3aee1c),undefined;}}function handleInstallationError(_0xd51dcb,_0x456cb8,_0x54b35d,_0x3b97f){const _0x506658=a10_0x5b3bbd;errorContains(_0xd51dcb,_0x506658(0x22c),_0x506658(0x242),'already\x20configured')?(_0x54b35d['text']='✓\x20'+_0x456cb8+_0x506658(0x1f1),_0x3b97f?.['info'](_0x456cb8+_0x506658(0x1f1)),_0xd51dcb instanceof SDKError&&_0xd51dcb['cause']&&_0x3b97f?.[_0x506658(0x201)](_0x506658(0x23d)+_0xd51dcb[_0x506658(0x244)][_0x506658(0x1fc)])):(_0x54b35d[_0x506658(0x227)](_0x506658(0x200)+_0x456cb8),_0x3b97f?.[_0x506658(0x1f8)](_0x456cb8+_0x506658(0x1ef),_0xd51dcb));}export function parseVersion(_0x5133ef){const _0x418389=a10_0x5b3bbd,_0x32ba85=_0x5133ef[_0x418389(0x259)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x32ba85)return null;return{'major':parseInt(_0x32ba85[0x1],0xa),'minor':parseInt(_0x32ba85[0x2],0xa),'patch':parseInt(_0x32ba85[0x3],0xa)};}export function compareVersions(_0x696640,_0x35c100){const _0x45153a=a10_0x5b3bbd;if(_0x696640[_0x45153a(0x1f3)]!==_0x35c100[_0x45153a(0x1f3)])return _0x696640[_0x45153a(0x1f3)]-_0x35c100[_0x45153a(0x1f3)];if(_0x696640[_0x45153a(0x209)]!==_0x35c100[_0x45153a(0x209)])return _0x696640['minor']-_0x35c100[_0x45153a(0x209)];return _0x696640['patch']-_0x35c100[_0x45153a(0x1da)];}async function checkClaudeVersion(_0x11efb5,_0x33e3cc){const _0x44cd9b=a10_0x5b3bbd;_0x33e3cc?.[_0x44cd9b(0x201)]('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x11efb5+')');const _0x5de22f=await executeClaudeCommand([_0x44cd9b(0x254)],undefined,_0x33e3cc),_0x1e7168=parseVersion(_0x5de22f);if(!_0x1e7168){_0x33e3cc?.['warn'](_0x44cd9b(0x1bc)+_0x5de22f);return;}const _0x4dcb25=_0x1e7168[_0x44cd9b(0x1f3)]+'.'+_0x1e7168[_0x44cd9b(0x209)]+'.'+_0x1e7168[_0x44cd9b(0x1da)],_0x543764=parseVersion(_0x11efb5);if(!_0x543764){_0x33e3cc?.['warn']('Invalid\x20minimum\x20version\x20format:\x20'+_0x11efb5);return;}if(compareVersions(_0x1e7168,_0x543764)<0x0){_0x33e3cc?.[_0x44cd9b(0x1f8)](_0x44cd9b(0x245)+_0x4dcb25+_0x44cd9b(0x256)+_0x11efb5+')');throw new SDKError(ErrorCode[_0x44cd9b(0x1ba)],'Claude\x20Code\x20version\x20'+_0x4dcb25+_0x44cd9b(0x1eb)+_0x11efb5+_0x44cd9b(0x1e5),undefined,{'helpText':_0x44cd9b(0x207)});}_0x33e3cc?.['debug'](_0x44cd9b(0x245)+_0x4dcb25+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x3c96a0,_0x2480cd,_0x4e430c){const _0x34b210=a10_0x5b3bbd;return _0x4e430c?.[_0x34b210(0x1cb)](_0x34b210(0x1e7)+_0x3c96a0['join']('\x20')),new Promise((_0x295e63,_0x2a0f6a)=>{const _0x50ea63=_0x34b210,_0x17acbd=crossSpawn(_0x50ea63(0x246),_0x3c96a0,{'stdio':'pipe'});let _0x202a83='',_0x35a290='';_0x17acbd[_0x50ea63(0x1b6)]?.['on'](_0x50ea63(0x1d6),_0x4343c9=>{const _0x58abbd=_0x50ea63;_0x202a83+=_0x4343c9[_0x58abbd(0x1d9)]();}),_0x17acbd[_0x50ea63(0x1cf)]?.['on'](_0x50ea63(0x1d6),_0x3b51b5=>{_0x35a290+=_0x3b51b5['toString']();}),_0x17acbd['on'](_0x50ea63(0x1f8),_0x1c6f78=>{const _0x4c42e6=_0x50ea63;_0x1c6f78['code']===_0x4c42e6(0x1f7)?(_0x4e430c?.[_0x4c42e6(0x1f8)]('Claude\x20Code\x20CLI\x20not\x20found'),_0x2a0f6a(new SDKError(ErrorCode[_0x4c42e6(0x250)],_0x4c42e6(0x1f6),_0x1c6f78,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x4e430c?.[_0x4c42e6(0x1f8)](_0x4c42e6(0x1ff)+_0x1c6f78[_0x4c42e6(0x1fc)]),_0x2a0f6a(new SDKError(ErrorCode['INTERNAL'],_0x4c42e6(0x1d2)+_0x1c6f78[_0x4c42e6(0x1fc)],_0x1c6f78)));}),_0x17acbd['on']('exit',_0x3e3f3a=>{const _0x5dc17e=_0x50ea63;if(_0x3e3f3a===0x0)_0x295e63(_0x202a83);else _0x2480cd?(_0x4e430c?.[_0x5dc17e(0x1f8)](_0x5dc17e(0x258)+_0x3e3f3a+'):\x20claude\x20'+_0x3c96a0[_0x5dc17e(0x1c1)]('\x20')),_0x2a0f6a(new SDKError(ErrorCode[_0x5dc17e(0x235)],_0x2480cd,new Error(_0x35a290)))):_0x295e63('');});});}async function ensureMcpServer(_0x2c71dc,_0x4ad14b,_0x45eea8,_0x32e632,_0x4af1df){const _0x3555e9=a10_0x5b3bbd;_0x32e632[_0x3555e9(0x1b2)]='Configuring\x20MCP\x20server\x20\x27'+_0x2c71dc+_0x3555e9(0x1db),await executeClaudeCommand([_0x3555e9(0x217),_0x3555e9(0x1e2),_0x2c71dc,_0x4ad14b,_0x3555e9(0x1de),_0x45eea8],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x2c71dc+'\x27',_0x4af1df),_0x32e632['text']='✓\x20MCP\x20server\x20\x27'+_0x2c71dc+_0x3555e9(0x22f);}export const DEFAULT_TD_SKILLS_URL=a10_0x5b3bbd(0x205);export function getTdSkillsRepoUrl(){const _0x464c74=process.env.TDX_TD_SKILLS_REPO;if(_0x464c74)return _0x464c74;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x241f6a,_0x23570b){const _0x229892=a10_0x5b3bbd;try{const _0x1a6e8e=await executeClaudeCommand([_0x229892(0x215),_0x229892(0x230),_0x229892(0x1d4)],_0x229892(0x1c6),_0x23570b);if(!_0x1a6e8e[_0x229892(0x22e)](_0x241f6a)){_0x23570b?.['debug'](_0x229892(0x1dc)+_0x241f6a+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand(['plugin',_0x229892(0x230),_0x229892(0x24f),_0x241f6a],_0x229892(0x1d1)+_0x241f6a+'\x27',_0x23570b),_0x23570b?.[_0x229892(0x1cb)](_0x229892(0x1dc)+_0x241f6a+_0x229892(0x232));}catch(_0x4ce252){_0x23570b?.['warn'](_0x229892(0x1d1)+_0x241f6a+_0x229892(0x223)+_0x4ce252);}}async function restoreDefaultTdSkillsMarketplace(_0x23b1f1){const _0x39c86a=a10_0x5b3bbd;try{await removeMarketplace('td-skills',_0x23b1f1),await executeClaudeCommand(['plugin',_0x39c86a(0x230),_0x39c86a(0x1e2),DEFAULT_TD_SKILLS_URL],undefined,_0x23b1f1),_0x23b1f1?.[_0x39c86a(0x1cb)](_0x39c86a(0x1f9));}catch{}}async function ensureMarketplace(_0x4416fb,_0x24072d,_0x119c0f,_0x5d210b){const _0x48c741=a10_0x5b3bbd;_0x119c0f[_0x48c741(0x1b2)]='Configuring\x20marketplace\x20\x27'+_0x4416fb+_0x48c741(0x1db),await executeClaudeCommand(['plugin',_0x48c741(0x230),_0x48c741(0x1e2),_0x24072d],_0x48c741(0x20f)+_0x4416fb+'\x27',_0x5d210b),_0x119c0f[_0x48c741(0x1b2)]=_0x48c741(0x220)+_0x4416fb+'\x27\x20configured';}async function updateMarketplace(_0x24861c,_0x4e899f,_0x10ee2d){const _0x11f1ca=a10_0x5b3bbd;_0x4e899f['text']=_0x11f1ca(0x224)+_0x24861c+_0x11f1ca(0x1db),await executeClaudeCommand([_0x11f1ca(0x215),_0x11f1ca(0x230),_0x11f1ca(0x22b)],_0x11f1ca(0x24a)+_0x24861c+'\x27',_0x10ee2d),_0x4e899f['text']=_0x11f1ca(0x220)+_0x24861c+_0x11f1ca(0x21f);}async function ensurePlugin(_0x35762c,_0x401d50,_0xa0a8e3,_0x363b6e){const _0x3ace28=a10_0x5b3bbd;_0xa0a8e3['text']=_0x3ace28(0x1e9)+_0x35762c+_0x3ace28(0x1db),await executeClaudeCommand([_0x3ace28(0x215),_0x3ace28(0x21d),_0x35762c+'@'+_0x401d50],_0x3ace28(0x1cc)+_0x35762c+'\x27',_0x363b6e),_0xa0a8e3[_0x3ace28(0x1b2)]='✓\x20Plugin\x20\x27'+_0x35762c+_0x3ace28(0x1ca);}function getClaudeConfigDir(){return process.env.CLAUDE_CONFIG_DIR||join(homedir(),'.claude');}async function checkoutReleaseTag(_0x5ed6c9,_0x43cddd,_0x256525){const _0x16ca41=a10_0x5b3bbd,_0x195f36=join(getClaudeConfigDir(),_0x16ca41(0x1c2),_0x16ca41(0x1c8),_0x16ca41(0x255));if(!existsSync(_0x195f36)){_0x256525?.[_0x16ca41(0x201)](_0x16ca41(0x211));return;}_0x43cddd[_0x16ca41(0x1b2)]='Checking\x20out\x20td-skills\x20'+_0x5ed6c9+_0x16ca41(0x1e8),await execFileAsync(_0x16ca41(0x1e4),[_0x16ca41(0x1f0),_0x16ca41(0x1e3),_0x16ca41(0x218),_0x16ca41(0x23e)],{'cwd':_0x195f36});try{await execFileAsync(_0x16ca41(0x1e4),[_0x16ca41(0x21c),'main'],{'cwd':_0x195f36});}catch{await execFileAsync('git',[_0x16ca41(0x21c),'-b',_0x16ca41(0x1d3),'origin/main'],{'cwd':_0x195f36});}await execFileAsync(_0x16ca41(0x1e4),[_0x16ca41(0x208),'--hard',_0x5ed6c9],{'cwd':_0x195f36}),_0x43cddd[_0x16ca41(0x1b2)]='✓\x20td-skills\x20checked\x20out\x20at\x20'+_0x5ed6c9,_0x256525?.[_0x16ca41(0x1cb)](_0x16ca41(0x226)+_0x5ed6c9);}async function createClaudeSettings(_0x114a6e,_0x2bc03a,_0x3050f1){const _0x3ee91a=a10_0x5b3bbd,_0x11fccf=join(process[_0x3ee91a(0x253)](),_0x3ee91a(0x1e6)),_0x2f2649=join(_0x11fccf,_0x3ee91a(0x240)),_0x27b2c6=join(_0x11fccf,SETTINGS_BACKUP_FILENAME);await mkdir(_0x11fccf,{'recursive':!![]});const _0x41389d=await recoverFromStaleBackup(_0x2f2649,_0x27b2c6);let _0x5ec6a3;if(_0x41389d)_0x5ec6a3=_0x41389d[_0x3ee91a(0x21b)];else{let _0x25320b={};if(existsSync(_0x2f2649))try{const _0x4e65aa=await readFile(_0x2f2649,_0x3ee91a(0x210));_0x25320b=JSON['parse'](_0x4e65aa);}catch{_0x25320b={};}const _0x44067a=_0x25320b[_0x3ee91a(0x1d0)]||{};_0x5ec6a3={'ANTHROPIC_BASE_URL':_0x44067a[_0x3ee91a(0x25a)],'ANTHROPIC_MODEL':_0x44067a[_0x3ee91a(0x23c)],'ANTHROPIC_AUTH_TOKEN':_0x44067a[_0x3ee91a(0x229)],'CLAUDE_CODE_USE_BEDROCK':_0x44067a[_0x3ee91a(0x251)],'CLAUDE_CODE_USE_VERTEX':_0x44067a[_0x3ee91a(0x1b9)],'statusLine':_0x25320b['statusLine']};const _0x51d48c={'createdAt':new Date()['toISOString'](),'pid':process[_0x3ee91a(0x1c7)],'originalSettings':_0x5ec6a3};await writeFile(_0x27b2c6,JSON[_0x3ee91a(0x228)](_0x51d48c,null,0x2)+'\x0a');}let _0x47ade0={};if(existsSync(_0x2f2649))try{const _0x272764=await readFile(_0x2f2649,'utf-8');_0x47ade0=JSON['parse'](_0x272764);}catch{_0x47ade0={};}const _0x37370e=_0x47ade0[_0x3ee91a(0x1d0)]||{},_0x8a4db1={..._0x47ade0,'env':{..._0x37370e,'ANTHROPIC_BASE_URL':_0x3ee91a(0x20c)+_0x114a6e,..._0x2bc03a&&{'ANTHROPIC_MODEL':_0x2bc03a},'ANTHROPIC_AUTH_TOKEN':_0x3ee91a(0x22a),'CLAUDE_CODE_USE_BEDROCK':_0x3ee91a(0x1ed),'CLAUDE_CODE_USE_VERTEX':_0x3ee91a(0x1ed)},'statusLine':{'type':_0x3ee91a(0x23b),'command':_0x3050f1?_0x3ee91a(0x1df)+_0x3050f1+_0x3ee91a(0x24e):_0x3ee91a(0x20a)}};return await writeFile(_0x2f2649,JSON['stringify'](_0x8a4db1,null,0x2)+'\x0a'),_0x5ec6a3;}async function restoreClaudeSettings(_0x117a92){const _0xdeaff4=a10_0x5b3bbd,_0x4c4859=join(process[_0xdeaff4(0x253)](),'.claude'),_0x4acdff=join(_0x4c4859,_0xdeaff4(0x240)),_0x2492d9=join(_0x4c4859,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x4acdff,_0x117a92);try{if(existsSync(_0x2492d9)){const _0x50a4fb=await readFile(_0x2492d9,_0xdeaff4(0x210)),_0x1af19b=JSON[_0xdeaff4(0x1c0)](_0x50a4fb);_0x1af19b[_0xdeaff4(0x1c7)]===process['pid']&&await safeUnlink(_0x2492d9);}}catch{}}export class ClaudeCommand extends BaseCommand{[a10_0x5b3bbd(0x248)]=a10_0x5b3bbd(0x246);['description']=a10_0x5b3bbd(0x1ea);[a10_0x5b3bbd(0x237)];[a10_0x5b3bbd(0x24d)];[a10_0x5b3bbd(0x1ec)];[a10_0x5b3bbd(0x236)];async['execute'](_0x74e081){const _0x56a1df=a10_0x5b3bbd,{tdx:_0x42c2a9,options:_0xd54d55,args:_0x3e5e12}=_0x74e081;let _0x405d64=![];try{const _0x5398ac=_0xd54d55,_0x40f334=_0x5398ac[_0x56a1df(0x1cd)]===![],_0xdb0dcd=_0x5398ac[_0x56a1df(0x233)]===!![],_0x4e3f38=_0x5398ac[_0x56a1df(0x1fe)]===!![],_0x513f3d=[..._0x3e5e12];if(_0xdb0dcd)_0x513f3d[_0x56a1df(0x231)]('-c');else _0x4e3f38&&_0x513f3d[_0x56a1df(0x231)]('-r');const _0x4f0072=createCommandSpinner(_0x56a1df(0x252),{'verbose':_0xd54d55[_0x56a1df(0x1d7)]});_0x4f0072['start']();try{if(!_0x40f334){const _0x57d746=_0xd54d55['profile'];try{const _0x580ec6=await _0x42c2a9[_0x56a1df(0x222)][_0x56a1df(0x1c5)]();_0x580ec6[_0x56a1df(0x1fd)]&&writeCachedAccountInfo(_0xd54d55[_0x56a1df(0x1c4)],_0x580ec6['account_id'],_0x57d746);}catch{}_0x4f0072[_0x56a1df(0x1b2)]=_0x56a1df(0x24b),this[_0x56a1df(0x1ec)]=new TDXLogger(_0xd54d55[_0x56a1df(0x1b7)],!![]),await this[_0x56a1df(0x1ec)][_0x56a1df(0x1e0)]();const _0xccfc53=this[_0x56a1df(0x1ec)][_0x56a1df(0x1fa)]();_0x4f0072['text']='✓\x20Logging\x20to\x20'+_0xccfc53;const _0x32cfff=getEndpoint(_0xd54d55[_0x56a1df(0x1c4)],'llm-proxy');_0x4f0072[_0x56a1df(0x1b2)]=_0x56a1df(0x20d);if(!_0x42c2a9[_0x56a1df(0x1f2)][_0x56a1df(0x1b3)])throw new SDKError(ErrorCode[_0x56a1df(0x1ee)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x56a1df(0x237)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x32cfff,'apiKey':_0x42c2a9[_0x56a1df(0x1f2)][_0x56a1df(0x1b3)],'logger':this[_0x56a1df(0x1ec)],'site':_0xd54d55[_0x56a1df(0x1c4)],'profile':_0x57d746}),await this['passThroughServer'][_0x56a1df(0x1b8)](),this[_0x56a1df(0x236)]=this[_0x56a1df(0x237)][_0x56a1df(0x236)],_0x4f0072['text']=_0x56a1df(0x1c3)+this[_0x56a1df(0x236)]+_0x56a1df(0x241)+_0x32cfff,_0x4f0072[_0x56a1df(0x1b2)]=_0x56a1df(0x257),this[_0x56a1df(0x24d)]=await createClaudeSettings(this['port'],undefined,_0x57d746),_0x4f0072[_0x56a1df(0x1b2)]=_0x56a1df(0x239);}else _0x4f0072['text']=_0x56a1df(0x1ce);try{_0x4f0072[_0x56a1df(0x1b2)]=_0x56a1df(0x23a),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x56a1df(0x1ec)]),_0x4f0072[_0x56a1df(0x1b2)]=_0x56a1df(0x1d8);}catch(_0x30b59c){_0x4f0072['fail'](_0x56a1df(0x238));throw _0x30b59c;}try{await ensureMcpServer('td-docs','https://docs.treasuredata.com/mcp',_0x56a1df(0x20b),_0x4f0072,this[_0x56a1df(0x1ec)]);}catch(_0x2be430){handleInstallationError(_0x2be430,_0x56a1df(0x20e),_0x4f0072,this[_0x56a1df(0x1ec)]);}try{const _0x425068=getTdSkillsRepoUrl();_0x405d64=_0x425068!==DEFAULT_TD_SKILLS_URL;_0x405d64&&await removeMarketplace(_0x56a1df(0x255),this['logger']);await ensureMarketplace(_0x56a1df(0x255),_0x425068,_0x4f0072,this[_0x56a1df(0x1ec)]),await updateMarketplace(_0x56a1df(0x255),_0x4f0072,this[_0x56a1df(0x1ec)]),await ensurePlugin(_0x56a1df(0x202),_0x56a1df(0x255),_0x4f0072,this[_0x56a1df(0x1ec)]),await ensurePlugin(_0x56a1df(0x1f4),_0x56a1df(0x255),_0x4f0072,this[_0x56a1df(0x1ec)]),await ensurePlugin(_0x56a1df(0x219),_0x56a1df(0x255),_0x4f0072,this[_0x56a1df(0x1ec)]);try{const _0x6ef19a=loadReleaseChannel(),_0x1f3813=await resolveReleaseTag(_0x6ef19a,_0x56a1df(0x1bb),_0x56a1df(0x255),_0x56a1df(0x23f));_0x1f3813&&await checkoutReleaseTag(_0x1f3813,_0x4f0072,this[_0x56a1df(0x1ec)]);}catch(_0x267a2b){this[_0x56a1df(0x1ec)]?.[_0x56a1df(0x227)](_0x56a1df(0x21a)+_0x267a2b);}}catch(_0x4e1e64){handleInstallationError(_0x4e1e64,_0x56a1df(0x1d5),_0x4f0072,this[_0x56a1df(0x1ec)]);}_0x4f0072[_0x56a1df(0x204)]();}catch(_0x2df4d3){_0x4f0072[_0x56a1df(0x1b5)](_0x56a1df(0x1fb));throw _0x2df4d3;}const _0x106c6c=await findExecutable(_0x56a1df(0x246));if(!_0x106c6c)throw new SDKError(ErrorCode[_0x56a1df(0x250)],_0x56a1df(0x1f6),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0xfa434b={...process.env};!_0x40f334&&(_0xfa434b[_0x56a1df(0x25a)]='http://127.0.0.1:'+this['port'],_0xfa434b[_0x56a1df(0x229)]=_0x56a1df(0x22a),_0xfa434b[_0x56a1df(0x251)]=_0x56a1df(0x1ed),_0xfa434b[_0x56a1df(0x1b9)]=_0x56a1df(0x1ed));const _0x1bb149=crossSpawn(_0x106c6c,_0x513f3d,{'stdio':_0x56a1df(0x221),'env':_0xfa434b}),_0x44e3a6=await new Promise(_0x3d9800=>{const _0x48b95d=_0x56a1df;_0x1bb149['on']('exit',_0x57f3d7=>{_0x3d9800(_0x57f3d7||0x0);}),_0x1bb149['on'](_0x48b95d(0x1f8),_0x4ee774=>{const _0x1655a0=_0x48b95d;console[_0x1655a0(0x1f8)](a10_0x5cfbc2[_0x1655a0(0x22d)](_0x1655a0(0x216)+_0x4ee774[_0x1655a0(0x1fc)])),_0x3d9800(0x1);});});_0x405d64&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0x56a1df(0x237)]&&(await this[_0x56a1df(0x237)][_0x56a1df(0x204)](),console[_0x56a1df(0x213)](a10_0x5cfbc2[_0x56a1df(0x1bd)](_0x56a1df(0x206))));if(this['logger']){await this['logger']['close']();const _0xbc0e9e=this[_0x56a1df(0x1ec)][_0x56a1df(0x1fa)]();console[_0x56a1df(0x213)](a10_0x5cfbc2[_0x56a1df(0x1bd)](_0x56a1df(0x212)+_0xbc0e9e));}return this[_0x56a1df(0x24d)]&&(await restoreClaudeSettings(this[_0x56a1df(0x24d)]),console['log'](a10_0x5cfbc2['green'](_0x56a1df(0x225)))),_0x44e3a6;}catch(_0x9f8ed1){_0x405d64&&await restoreDefaultTdSkillsMarketplace(this[_0x56a1df(0x1ec)]);this['passThroughServer']&&await this[_0x56a1df(0x237)][_0x56a1df(0x204)]();this[_0x56a1df(0x1ec)]&&await this['logger'][_0x56a1df(0x1f5)]();this[_0x56a1df(0x24d)]&&await restoreClaudeSettings(this[_0x56a1df(0x24d)]);throw _0x9f8ed1;}}}
@@ -1 +1 @@
1
- function a11_0x4eba(_0x4778f3,_0x461f70){_0x4778f3=_0x4778f3-0x1b4;const _0x25741a=a11_0x2574();let _0x4ebad4=_0x25741a[_0x4778f3];return _0x4ebad4;}const a11_0x1d5f47=a11_0x4eba;(function(_0x509fbd,_0x15b557){const _0xbf39a7=a11_0x4eba,_0x7deb3b=_0x509fbd();while(!![]){try{const _0x4c85ed=parseInt(_0xbf39a7(0x1e0))/0x1*(-parseInt(_0xbf39a7(0x1c1))/0x2)+-parseInt(_0xbf39a7(0x1db))/0x3+parseInt(_0xbf39a7(0x1b6))/0x4*(-parseInt(_0xbf39a7(0x1c8))/0x5)+-parseInt(_0xbf39a7(0x1d7))/0x6*(parseInt(_0xbf39a7(0x1c4))/0x7)+-parseInt(_0xbf39a7(0x1d5))/0x8+parseInt(_0xbf39a7(0x1c5))/0x9*(-parseInt(_0xbf39a7(0x1cb))/0xa)+parseInt(_0xbf39a7(0x1da))/0xb;if(_0x4c85ed===_0x15b557)break;else _0x7deb3b['push'](_0x7deb3b['shift']());}catch(_0x54f2a6){_0x7deb3b['push'](_0x7deb3b['shift']());}}}(a11_0x2574,0x2cd68));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a11_0x2574(){const _0x4cd1cb=['\x20month','input_tokens','1571952EOHldM','log','312GmVSwP','accountId','tdx\x20','13685386iIjioL','437133svsTlN','name','join','cache_creation_input_tokens','💎\x20tdx\x20-\x20Claude','2COgnMF','todayCredits','\x20-\x20','execute','site','511676iZiwrg','context_window','cache_read_input_tokens','used_percentage','parse','sessionCredits','\x20today\x20/\x20','tdx','🪙\x20credit:\x20','\x20|\x20','close','183304dQEYzg','stdin','toFixed','36680ZTJlzu','4923pXxpRa','monthCredits','\x20session\x20/\x20','5kivmIG','session_id','profile','2460ozhLUw','line','model','statusline','round','push','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','💎\x20'];a11_0x2574=function(){return _0x4cd1cb;};return a11_0x2574();}import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x41fa3c=0x64){return new Promise(_0x571612=>{const _0x149890=a11_0x4eba;let _0x1d0e21='',_0x28e080=![];const _0x54fd3e=createInterface({'input':process[_0x149890(0x1c2)],'terminal':![]}),_0x21f775=_0xb3ce17=>{const _0x138b62=_0x149890;if(_0x28e080)return;_0x28e080=!![],clearTimeout(_0x12d518),_0x54fd3e[_0x138b62(0x1c0)](),_0x571612(_0xb3ce17);},_0x12d518=setTimeout(()=>{_0x21f775(null);},_0x41fa3c);_0x54fd3e['on'](_0x149890(0x1cc),_0x2c1646=>{_0x1d0e21+=_0x2c1646;}),_0x54fd3e['on'](_0x149890(0x1c0),()=>{const _0x21c360=_0x149890;if(_0x28e080)return;try{const _0x302eed=JSON[_0x21c360(0x1ba)](_0x1d0e21);_0x21f775(_0x302eed);}catch{_0x21f775(null);}});});}function formatCredits(_0x1cf71e){const _0xe2d4bc=a11_0x4eba;return _0x1cf71e[_0xe2d4bc(0x1c3)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a11_0x1d5f47(0x1dc)]=a11_0x1d5f47(0x1ce);['description']=a11_0x1d5f47(0x1d1);async[a11_0x1d5f47(0x1b4)](_0x51a8aa){const _0x517cb7=a11_0x1d5f47;try{const _0x30b0a1=await readStdinJson();if(!_0x30b0a1?.[_0x517cb7(0x1c9)])return console[_0x517cb7(0x1d6)](_0x517cb7(0x1df)),0x0;const _0x3a72f2=_0x30b0a1[_0x517cb7(0x1c9)],_0x246fa2=_0x30b0a1[_0x517cb7(0x1cd)]?.['id']||'',_0x29e8ed=_0x30b0a1[_0x517cb7(0x1ca)]||_0x51a8aa['options'][_0x517cb7(0x1ca)],_0x3941bb=await getUsageStats(_0x3a72f2,_0x29e8ed),_0x5d5a73=[],_0x221413=readCachedAccountInfo(_0x29e8ed),_0x19da0c=_0x221413?_0x517cb7(0x1d9)+_0x221413[_0x517cb7(0x1b5)]+':'+_0x221413[_0x517cb7(0x1d8)]:_0x517cb7(0x1bd),_0x49f1f0=_0x246fa2?getModelDisplayName(_0x246fa2):'Claude';_0x5d5a73[_0x517cb7(0x1d0)](_0x517cb7(0x1d2)+_0x19da0c+_0x517cb7(0x1e2)+_0x49f1f0);const _0x1cf94b=formatCredits(_0x3941bb[_0x517cb7(0x1bb)]),_0x5a720f=formatCredits(_0x3941bb[_0x517cb7(0x1e1)]),_0x9a8886=formatCredits(_0x3941bb[_0x517cb7(0x1c6)]);_0x5d5a73[_0x517cb7(0x1d0)](_0x517cb7(0x1be)+_0x1cf94b+_0x517cb7(0x1c7)+_0x5a720f+_0x517cb7(0x1bc)+_0x9a8886+_0x517cb7(0x1d3));const _0x2acd6a=_0x30b0a1[_0x517cb7(0x1b7)],_0xc0e43c=_0x2acd6a?.['current_usage'];if(_0xc0e43c&&_0x2acd6a?.[_0x517cb7(0x1b9)]!=null){const _0x417fd2=_0xc0e43c[_0x517cb7(0x1d4)]+_0xc0e43c[_0x517cb7(0x1de)]+_0xc0e43c[_0x517cb7(0x1b8)],_0x1ba541=formatTokenCount(_0x417fd2),_0x45247a=Math[_0x517cb7(0x1cf)](_0x2acd6a[_0x517cb7(0x1b9)]);_0x5d5a73[_0x517cb7(0x1d0)]('🧠\x20'+_0x1ba541+'\x20('+_0x45247a+'%)');}return console[_0x517cb7(0x1d6)](_0x5d5a73[_0x517cb7(0x1dd)](_0x517cb7(0x1bf))),0x0;}catch{return console['log']('💎\x20tdx\x20-\x20Claude'),0x0;}}}
1
+ const a11_0x32044a=a11_0x1274;(function(_0x5bd071,_0x2f531c){const _0x183f60=a11_0x1274,_0x380b5b=_0x5bd071();while(!![]){try{const _0x40573e=-parseInt(_0x183f60(0xdc))/0x1+-parseInt(_0x183f60(0xcc))/0x2*(parseInt(_0x183f60(0xc2))/0x3)+parseInt(_0x183f60(0xc9))/0x4+-parseInt(_0x183f60(0xc5))/0x5+parseInt(_0x183f60(0xce))/0x6+parseInt(_0x183f60(0xc4))/0x7*(-parseInt(_0x183f60(0xc0))/0x8)+-parseInt(_0x183f60(0xde))/0x9*(-parseInt(_0x183f60(0xd5))/0xa);if(_0x40573e===_0x2f531c)break;else _0x380b5b['push'](_0x380b5b['shift']());}catch(_0x345eb9){_0x380b5b['push'](_0x380b5b['shift']());}}}(a11_0xc139,0x537f3));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a11_0x1274(_0x3e3b01,_0x10425a){_0x3e3b01=_0x3e3b01-0xb9;const _0xc139d1=a11_0xc139();let _0x1274f7=_0xc139d1[_0x3e3b01];return _0x1274f7;}import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x243b3a=0x64){return new Promise(_0x5827c4=>{const _0x27dd21=a11_0x1274;let _0x41910f='',_0x213ddb=![];const _0x28e73a=createInterface({'input':process[_0x27dd21(0xcd)],'terminal':![]}),_0x2f4c56=_0x48690f=>{if(_0x213ddb)return;_0x213ddb=!![],clearTimeout(_0x351d47),_0x28e73a['close'](),_0x5827c4(_0x48690f);},_0x351d47=setTimeout(()=>{_0x2f4c56(null);},_0x243b3a);_0x28e73a['on'](_0x27dd21(0xca),_0x1d167e=>{_0x41910f+=_0x1d167e;}),_0x28e73a['on']('close',()=>{const _0x7f2c2e=_0x27dd21;if(_0x213ddb)return;try{const _0x55a9b7=JSON[_0x7f2c2e(0xbc)](_0x41910f);_0x2f4c56(_0x55a9b7);}catch{_0x2f4c56(null);}});});}function formatCredits(_0x14e285){return _0x14e285['toFixed'](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{['name']='statusline';['description']=a11_0x32044a(0xbe);async[a11_0x32044a(0xbf)](_0x3a9099){const _0x1d948f=a11_0x32044a;try{const _0x13defd=await readStdinJson();if(!_0x13defd?.[_0x1d948f(0xdd)])return console['log']('💎\x20tdx\x20-\x20Claude'),0x0;const _0x116c89=_0x13defd[_0x1d948f(0xdd)],_0x130d81=_0x13defd[_0x1d948f(0xc8)]?.['id']||'',_0x53e9cd=_0x13defd['profile']||_0x3a9099['options'][_0x1d948f(0xd0)],_0x22f311=await getUsageStats(_0x116c89,_0x53e9cd),_0x3e85b4=[],_0x61045e=readCachedAccountInfo(_0x53e9cd),_0x75532a=_0x61045e?_0x1d948f(0xc1)+_0x61045e['site']+':'+_0x61045e[_0x1d948f(0xd3)]:_0x1d948f(0xd6),_0x5edc56=_0x130d81?getModelDisplayName(_0x130d81):_0x1d948f(0xd7);_0x3e85b4[_0x1d948f(0xd9)]('💎\x20'+_0x75532a+_0x1d948f(0xc7)+_0x5edc56);const _0x1e22a6=formatCredits(_0x22f311[_0x1d948f(0xc3)]),_0x1a2297=formatCredits(_0x22f311[_0x1d948f(0xcf)]),_0xd3f2cb=formatCredits(_0x22f311['monthCredits']);_0x3e85b4[_0x1d948f(0xd9)]('🪙\x20credit:\x20'+_0x1e22a6+_0x1d948f(0xd4)+_0x1a2297+_0x1d948f(0xda)+_0xd3f2cb+'\x20month');const _0x10ea54=_0x13defd[_0x1d948f(0xbb)],_0x15a443=_0x10ea54?.[_0x1d948f(0xb9)];if(_0x15a443&&_0x10ea54?.[_0x1d948f(0xc6)]!=null){const _0x395f32=_0x15a443[_0x1d948f(0xd1)]+_0x15a443[_0x1d948f(0xcb)]+_0x15a443[_0x1d948f(0xbd)],_0x4bbcd1=formatTokenCount(_0x395f32),_0x424bd6=Math['round'](_0x10ea54[_0x1d948f(0xc6)]);_0x3e85b4[_0x1d948f(0xd9)](_0x1d948f(0xdb)+_0x4bbcd1+'\x20('+_0x424bd6+'%)');}return console[_0x1d948f(0xd2)](_0x3e85b4[_0x1d948f(0xba)](_0x1d948f(0xd8))),0x0;}catch{return console['log']('💎\x20tdx\x20-\x20Claude'),0x0;}}}function a11_0xc139(){const _0x12ce5e=['execute','40WcXXlw','tdx\x20','3uAkFEX','sessionCredits','745388OFbxQF','2210200DrhXTr','used_percentage','\x20-\x20','model','1311960bHQjrk','line','cache_creation_input_tokens','947106JHZNCD','stdin','1168938VwpVRk','todayCredits','profile','input_tokens','log','accountId','\x20session\x20/\x20','215310jEVmex','tdx','Claude','\x20|\x20','push','\x20today\x20/\x20','🧠\x20','175374CYHXVP','session_id','603cKpPqq','current_usage','join','context_window','parse','cache_read_input_tokens','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)'];a11_0xc139=function(){return _0x12ce5e;};return a11_0xc139();}
@@ -1 +1 @@
1
- const a12_0x59b1bd=a12_0x32e7;(function(_0x433aec,_0x69e7f4){const _0x19f799=a12_0x32e7,_0xbd3cf0=_0x433aec();while(!![]){try{const _0x50ef44=parseInt(_0x19f799(0xe4))/0x1+parseInt(_0x19f799(0xf9))/0x2+-parseInt(_0x19f799(0xef))/0x3*(-parseInt(_0x19f799(0x10e))/0x4)+parseInt(_0x19f799(0xf4))/0x5*(parseInt(_0x19f799(0xf3))/0x6)+parseInt(_0x19f799(0x113))/0x7*(-parseInt(_0x19f799(0xe3))/0x8)+parseInt(_0x19f799(0xfb))/0x9*(parseInt(_0x19f799(0xed))/0xa)+-parseInt(_0x19f799(0xdc))/0xb;if(_0x50ef44===_0x69e7f4)break;else _0xbd3cf0['push'](_0xbd3cf0['shift']());}catch(_0x2cf681){_0xbd3cf0['push'](_0xbd3cf0['shift']());}}}(a12_0x54ae,0x3c821));function a12_0x54ae(){const _0x1a4dbe=['508350oSfHOs','name','222966nndMIb','cyan','profile','lastUsedAt','round','Error:\x20','en-CA','\x20\x20Month:\x20\x20\x20','message','yesterday','toLocaleDateString','default','toFixed','getTime','\x20\x20Today:\x20\x20\x20','length','Last\x20Used','outputTable','todayCredits','148FvmNxc','source','today\x20','credits','numeric','168SJyhhq','toLocaleTimeString','Usage\x20by\x20Profile','jsonl','Usage\x20by\x20Source','\x20\x20Total:\x20\x20\x20','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','14441108rmUbZC','map','(default)','max','bold','Credits','json','32992akcxHM','284333PsvJUg','all','padStart','en-US','padEnd','monthCredits','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','Today','Profile','90dNECoZ','Unknown\x20error','33801aROfgy','execute','totalCredits','dim','42PPLaAG','343780EHbPaG','repeat','outputStructured','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','log'];a12_0x54ae=function(){return _0x1a4dbe;};return a12_0x54ae();}import a12_0x86ee56 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function a12_0x32e7(_0x2a5e54,_0x42496f){_0x2a5e54=_0x2a5e54-0xdb;const _0x54ae58=a12_0x54ae();let _0x32e767=_0x54ae58[_0x2a5e54];return _0x32e767;}function formatCredits(_0x25cb60){const _0x47655f=a12_0x32e7;return _0x25cb60[_0x47655f(0x107)](0x2);}function formatLastUsed(_0x1c21f2){const _0x44e765=a12_0x32e7;if(!_0x1c21f2)return'never';const _0x403d4e=new Date(_0x1c21f2),_0x4014a0=new Date(),_0x34e5cb=_0x403d4e[_0x44e765(0x105)](_0x44e765(0x101)),_0x162c5d=_0x4014a0[_0x44e765(0x105)](_0x44e765(0x101));if(_0x34e5cb===_0x162c5d)return _0x44e765(0x110)+_0x403d4e[_0x44e765(0x114)](_0x44e765(0xe7),{'hour':'2-digit','minute':'2-digit'});const _0x1d96fb=new Date(_0x34e5cb),_0x4324f4=new Date(_0x162c5d),_0x4b8789=Math[_0x44e765(0xff)]((_0x4324f4['getTime']()-_0x1d96fb[_0x44e765(0x108)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x4b8789===0x1)return _0x44e765(0x104);else return _0x4b8789>0x1&&_0x4b8789<0x7?_0x4b8789+'\x20days\x20ago':_0x403d4e[_0x44e765(0x105)](_0x44e765(0xe7),{'month':'short','day':_0x44e765(0x112)});}export class ClaudeUsageCommand extends BaseCommand{[a12_0x59b1bd(0xfa)]='usage';['description']=a12_0x59b1bd(0x119);async[a12_0x59b1bd(0xf0)](_0x43c683){const _0x552727=a12_0x59b1bd,{options:_0x1e0656}=_0x43c683,_0x503593=_0x1e0656['format']===_0x552727(0xe2)||_0x1e0656['format']===_0x552727(0x116)||_0x1e0656['json'];try{const [_0x1c9fa6,_0x59a04e,_0x3ed3e1]=await Promise[_0x552727(0xe5)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x503593?await this[_0x552727(0xf6)](_0x1c9fa6,_0x59a04e,_0x3ed3e1,_0x1e0656):this[_0x552727(0x10c)](_0x1c9fa6,_0x59a04e,_0x3ed3e1),0x0;}catch(_0x36c417){const _0x54fb5c=_0x36c417 instanceof Error?_0x36c417[_0x552727(0x103)]:_0x552727(0xee);return console['error'](a12_0x86ee56['red'](_0x552727(0x100)+_0x54fb5c)),0x1;}}async[a12_0x59b1bd(0xf6)](_0x278ed7,_0x520e93,_0x38d3ae,_0x51dfac){const _0x5a4660=a12_0x59b1bd,_0x39b0ec={'summary':{'todayCredits':_0x38d3ae['todayCredits'],'monthCredits':_0x38d3ae[_0x5a4660(0xe9)],'totalCredits':_0x38d3ae[_0x5a4660(0xf1)],'profileCount':_0x38d3ae['profileCount']},'profiles':_0x278ed7['map'](_0x44e5ff=>({'profile':_0x44e5ff[_0x5a4660(0xfd)],'credits':_0x44e5ff[_0x5a4660(0x111)],'requests':_0x44e5ff['entryCount'],'lastUsedAt':_0x44e5ff[_0x5a4660(0xfe)]})),'sources':_0x520e93[_0x5a4660(0xdd)](_0xd5c812=>({'source':_0xd5c812[_0x5a4660(0x10f)],'credits':_0xd5c812[_0x5a4660(0x111)],'todayCredits':_0xd5c812[_0x5a4660(0x10d)],'monthCredits':_0xd5c812[_0x5a4660(0xe9)],'requests':_0xd5c812['entryCount']}))};await handleSDKOutput([_0x39b0ec],_0x51dfac);}[a12_0x59b1bd(0x10c)](_0x18b637,_0x243026,_0x28bd80){const _0x1a1dff=a12_0x59b1bd;console[_0x1a1dff(0xf8)](a12_0x86ee56[_0x1a1dff(0xe0)](_0x1a1dff(0xf7))),console[_0x1a1dff(0xf8)](a12_0x86ee56[_0x1a1dff(0xf2)]('─'[_0x1a1dff(0xf5)](0x32))),console[_0x1a1dff(0xf8)](_0x1a1dff(0x109)+a12_0x86ee56[_0x1a1dff(0xfc)](formatCredits(_0x28bd80['todayCredits']))+'\x20credits'),console[_0x1a1dff(0xf8)](_0x1a1dff(0x102)+a12_0x86ee56[_0x1a1dff(0xfc)](formatCredits(_0x28bd80[_0x1a1dff(0xe9)]))+'\x20credits'),console['log'](_0x1a1dff(0x118)+a12_0x86ee56[_0x1a1dff(0xfc)](formatCredits(_0x28bd80['totalCredits']))+'\x20credits'),console[_0x1a1dff(0xf8)]();if(_0x243026[_0x1a1dff(0x10a)]>0x0){console[_0x1a1dff(0xf8)](a12_0x86ee56[_0x1a1dff(0xe0)](_0x1a1dff(0x117))),console[_0x1a1dff(0xf8)](a12_0x86ee56['dim']('─'[_0x1a1dff(0xf5)](0x3c)));const _0x5d350c=0xc,_0x4ea53e=0xa,_0x538c66=0xa,_0x5a24d9=0xa;console[_0x1a1dff(0xf8)]('\x20\x20'+'Source'[_0x1a1dff(0xe8)](_0x5d350c)+'\x20\x20'+'Total'[_0x1a1dff(0xe6)](_0x4ea53e)+'\x20\x20'+_0x1a1dff(0xeb)[_0x1a1dff(0xe6)](_0x538c66)+'\x20\x20'+'Month'[_0x1a1dff(0xe6)](_0x5a24d9));for(const _0x460df2 of _0x243026){console[_0x1a1dff(0xf8)]('\x20\x20'+_0x460df2['source'][_0x1a1dff(0xe8)](_0x5d350c)+'\x20\x20'+a12_0x86ee56[_0x1a1dff(0xfc)](formatCredits(_0x460df2['credits'])[_0x1a1dff(0xe6)](_0x4ea53e))+'\x20\x20'+formatCredits(_0x460df2[_0x1a1dff(0x10d)])[_0x1a1dff(0xe6)](_0x538c66)+'\x20\x20'+formatCredits(_0x460df2[_0x1a1dff(0xe9)])[_0x1a1dff(0xe6)](_0x5a24d9));}console[_0x1a1dff(0xf8)]();}if(_0x18b637[_0x1a1dff(0x10a)]===0x0){console[_0x1a1dff(0xf8)](a12_0x86ee56[_0x1a1dff(0xf2)]('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console[_0x1a1dff(0xf8)](a12_0x86ee56['dim'](_0x1a1dff(0xdb)));return;}console[_0x1a1dff(0xf8)](a12_0x86ee56[_0x1a1dff(0xe0)](_0x1a1dff(0x115))),console['log'](a12_0x86ee56[_0x1a1dff(0xf2)]('─'['repeat'](0x3c)));const _0x205edb=Math[_0x1a1dff(0xdf)](0xc,..._0x18b637[_0x1a1dff(0xdd)](_0x57a6bc=>_0x57a6bc[_0x1a1dff(0xfd)]===_0x1a1dff(0x106)?'(default)'[_0x1a1dff(0x10a)]:_0x57a6bc['profile'][_0x1a1dff(0x10a)])),_0x4ac8f3=0xa,_0x579f68=0xa;console['log']('\x20\x20'+_0x1a1dff(0xec)[_0x1a1dff(0xe8)](_0x205edb)+'\x20\x20'+_0x1a1dff(0xe1)[_0x1a1dff(0xe6)](_0x4ac8f3)+'\x20\x20'+'Requests'[_0x1a1dff(0xe6)](_0x579f68)+'\x20\x20'+_0x1a1dff(0x10b));for(const _0x27fd83 of _0x18b637){const _0x356ad4=_0x27fd83[_0x1a1dff(0xfd)]===_0x1a1dff(0x106)?_0x1a1dff(0xde):_0x27fd83['profile'],_0x506451=_0x356ad4[_0x1a1dff(0xe8)](_0x205edb),_0x2dcd22=_0x27fd83[_0x1a1dff(0xfd)]==='default'?a12_0x86ee56[_0x1a1dff(0xf2)](_0x506451):_0x506451;console[_0x1a1dff(0xf8)]('\x20\x20'+_0x2dcd22+'\x20\x20'+a12_0x86ee56[_0x1a1dff(0xfc)](formatCredits(_0x27fd83[_0x1a1dff(0x111)])['padStart'](_0x4ac8f3))+'\x20\x20'+String(_0x27fd83['entryCount'])[_0x1a1dff(0xe6)](_0x579f68)+'\x20\x20'+a12_0x86ee56[_0x1a1dff(0xf2)](formatLastUsed(_0x27fd83[_0x1a1dff(0xfe)])));}console[_0x1a1dff(0xf8)](),console[_0x1a1dff(0xf8)](a12_0x86ee56[_0x1a1dff(0xf2)](_0x1a1dff(0xea))),console[_0x1a1dff(0xf8)]();}}
1
+ function a12_0x5026(_0x1806a1,_0x1822e3){_0x1806a1=_0x1806a1-0xcd;const _0x493269=a12_0x4932();let _0x502636=_0x493269[_0x1806a1];return _0x502636;}const a12_0x12668b=a12_0x5026;(function(_0x2111f3,_0x2c69a7){const _0x56c5c8=a12_0x5026,_0x1406f4=_0x2111f3();while(!![]){try{const _0x573249=-parseInt(_0x56c5c8(0xff))/0x1+parseInt(_0x56c5c8(0xe4))/0x2+-parseInt(_0x56c5c8(0xf8))/0x3+-parseInt(_0x56c5c8(0xf7))/0x4+-parseInt(_0x56c5c8(0xfa))/0x5+-parseInt(_0x56c5c8(0xd8))/0x6+parseInt(_0x56c5c8(0xd7))/0x7;if(_0x573249===_0x2c69a7)break;else _0x1406f4['push'](_0x1406f4['shift']());}catch(_0x19376d){_0x1406f4['push'](_0x1406f4['shift']());}}}(a12_0x4932,0x7118a));import a12_0xe1b08 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function a12_0x4932(){const _0xde3d58=['dim','json','monthCredits','name','outputStructured','padStart','max','toFixed','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','red','Usage\x20by\x20Profile','en-US','Total','bold','padEnd','1147580DQxNuV','1293135pcMSXy','Requests','2075800tNBmwO','today\x20','execute','entryCount','\x20days\x20ago','527239DBtSqy','Profile','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','cyan','en-CA','default','profile','getTime','\x20\x20Today:\x20\x20\x20','toLocaleDateString','lastUsedAt','Month','log','short','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','Source','toLocaleTimeString','\x20\x20Month:\x20\x20\x20','outputTable','map','yesterday','message','credits','Last\x20Used','source','format','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Unknown\x20error','length','repeat','20239821czJFkZ','4612740lNNMla','error','never','(default)','description','Error:\x20','2-digit','\x20credits','todayCredits','totalCredits','numeric','profileCount','1936PNBCkS','Today','all','jsonl'];a12_0x4932=function(){return _0xde3d58;};return a12_0x4932();}function formatCredits(_0x3254bd){const _0x3a00f2=a12_0x5026;return _0x3254bd[_0x3a00f2(0xef)](0x2);}function formatLastUsed(_0x1d4875){const _0x16f9ea=a12_0x5026;if(!_0x1d4875)return _0x16f9ea(0xda);const _0x27ae38=new Date(_0x1d4875),_0x13eb92=new Date(),_0x2b307a=_0x27ae38[_0x16f9ea(0x108)](_0x16f9ea(0x103)),_0x3ff7db=_0x13eb92['toLocaleDateString'](_0x16f9ea(0x103));if(_0x2b307a===_0x3ff7db)return _0x16f9ea(0xfb)+_0x27ae38[_0x16f9ea(0x10f)]('en-US',{'hour':_0x16f9ea(0xde),'minute':_0x16f9ea(0xde)});const _0x5579c6=new Date(_0x2b307a),_0x2c026a=new Date(_0x3ff7db),_0x44c611=Math['round']((_0x2c026a[_0x16f9ea(0x106)]()-_0x5579c6[_0x16f9ea(0x106)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x44c611===0x1)return _0x16f9ea(0xcd);else return _0x44c611>0x1&&_0x44c611<0x7?_0x44c611+_0x16f9ea(0xfe):_0x27ae38[_0x16f9ea(0x108)](_0x16f9ea(0xf3),{'month':_0x16f9ea(0x10c),'day':_0x16f9ea(0xe2)});}export class ClaudeUsageCommand extends BaseCommand{[a12_0x12668b(0xeb)]='usage';[a12_0x12668b(0xdc)]='Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile';async[a12_0x12668b(0xfc)](_0x42d6df){const _0x30de07=a12_0x12668b,{options:_0x4b3e2e}=_0x42d6df,_0x5a72aa=_0x4b3e2e['format']==='json'||_0x4b3e2e[_0x30de07(0xd2)]===_0x30de07(0xe7)||_0x4b3e2e[_0x30de07(0xe9)];try{const [_0xe1b284,_0x5331cb,_0x31a3cc]=await Promise[_0x30de07(0xe6)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x5a72aa?await this[_0x30de07(0xec)](_0xe1b284,_0x5331cb,_0x31a3cc,_0x4b3e2e):this[_0x30de07(0x111)](_0xe1b284,_0x5331cb,_0x31a3cc),0x0;}catch(_0x1c08b7){const _0x21f060=_0x1c08b7 instanceof Error?_0x1c08b7[_0x30de07(0xce)]:_0x30de07(0xd4);return console[_0x30de07(0xd9)](a12_0xe1b08[_0x30de07(0xf1)](_0x30de07(0xdd)+_0x21f060)),0x1;}}async[a12_0x12668b(0xec)](_0xea69af,_0x488e71,_0x54153f,_0x4d8a98){const _0x32dc63=a12_0x12668b,_0x237323={'summary':{'todayCredits':_0x54153f[_0x32dc63(0xe0)],'monthCredits':_0x54153f['monthCredits'],'totalCredits':_0x54153f[_0x32dc63(0xe1)],'profileCount':_0x54153f[_0x32dc63(0xe3)]},'profiles':_0xea69af[_0x32dc63(0x112)](_0x484dee=>({'profile':_0x484dee[_0x32dc63(0x105)],'credits':_0x484dee[_0x32dc63(0xcf)],'requests':_0x484dee[_0x32dc63(0xfd)],'lastUsedAt':_0x484dee[_0x32dc63(0x109)]})),'sources':_0x488e71['map'](_0x3b18ee=>({'source':_0x3b18ee['source'],'credits':_0x3b18ee[_0x32dc63(0xcf)],'todayCredits':_0x3b18ee['todayCredits'],'monthCredits':_0x3b18ee['monthCredits'],'requests':_0x3b18ee[_0x32dc63(0xfd)]}))};await handleSDKOutput([_0x237323],_0x4d8a98);}['outputTable'](_0x18598d,_0x1a0c84,_0x1e8d8a){const _0x49f5a1=a12_0x12668b;console[_0x49f5a1(0x10b)](a12_0xe1b08[_0x49f5a1(0xf5)](_0x49f5a1(0x10d))),console[_0x49f5a1(0x10b)](a12_0xe1b08['dim']('─'['repeat'](0x32))),console[_0x49f5a1(0x10b)](_0x49f5a1(0x107)+a12_0xe1b08[_0x49f5a1(0x102)](formatCredits(_0x1e8d8a['todayCredits']))+_0x49f5a1(0xdf)),console[_0x49f5a1(0x10b)](_0x49f5a1(0x110)+a12_0xe1b08['cyan'](formatCredits(_0x1e8d8a[_0x49f5a1(0xea)]))+_0x49f5a1(0xdf)),console['log']('\x20\x20Total:\x20\x20\x20'+a12_0xe1b08[_0x49f5a1(0x102)](formatCredits(_0x1e8d8a[_0x49f5a1(0xe1)]))+_0x49f5a1(0xdf)),console[_0x49f5a1(0x10b)]();if(_0x1a0c84['length']>0x0){console[_0x49f5a1(0x10b)](a12_0xe1b08[_0x49f5a1(0xf5)]('Usage\x20by\x20Source')),console[_0x49f5a1(0x10b)](a12_0xe1b08['dim']('─'[_0x49f5a1(0xd6)](0x3c)));const _0x59272f=0xc,_0x458072=0xa,_0x437a9b=0xa,_0x396d42=0xa;console['log']('\x20\x20'+_0x49f5a1(0x10e)[_0x49f5a1(0xf6)](_0x59272f)+'\x20\x20'+_0x49f5a1(0xf4)[_0x49f5a1(0xed)](_0x458072)+'\x20\x20'+_0x49f5a1(0xe5)[_0x49f5a1(0xed)](_0x437a9b)+'\x20\x20'+_0x49f5a1(0x10a)[_0x49f5a1(0xed)](_0x396d42));for(const _0x20a532 of _0x1a0c84){console[_0x49f5a1(0x10b)]('\x20\x20'+_0x20a532[_0x49f5a1(0xd1)][_0x49f5a1(0xf6)](_0x59272f)+'\x20\x20'+a12_0xe1b08[_0x49f5a1(0x102)](formatCredits(_0x20a532[_0x49f5a1(0xcf)])[_0x49f5a1(0xed)](_0x458072))+'\x20\x20'+formatCredits(_0x20a532[_0x49f5a1(0xe0)])['padStart'](_0x437a9b)+'\x20\x20'+formatCredits(_0x20a532[_0x49f5a1(0xea)])[_0x49f5a1(0xed)](_0x396d42));}console['log']();}if(_0x18598d[_0x49f5a1(0xd5)]===0x0){console[_0x49f5a1(0x10b)](a12_0xe1b08['dim'](_0x49f5a1(0xd3))),console[_0x49f5a1(0x10b)](a12_0xe1b08[_0x49f5a1(0xe8)](_0x49f5a1(0x101)));return;}console[_0x49f5a1(0x10b)](a12_0xe1b08[_0x49f5a1(0xf5)](_0x49f5a1(0xf2))),console[_0x49f5a1(0x10b)](a12_0xe1b08['dim']('─'[_0x49f5a1(0xd6)](0x3c)));const _0xcf69ad=Math[_0x49f5a1(0xee)](0xc,..._0x18598d[_0x49f5a1(0x112)](_0x43203f=>_0x43203f[_0x49f5a1(0x105)]===_0x49f5a1(0x104)?_0x49f5a1(0xdb)['length']:_0x43203f[_0x49f5a1(0x105)][_0x49f5a1(0xd5)])),_0xc8963b=0xa,_0x555a42=0xa;console[_0x49f5a1(0x10b)]('\x20\x20'+_0x49f5a1(0x100)[_0x49f5a1(0xf6)](_0xcf69ad)+'\x20\x20'+'Credits'['padStart'](_0xc8963b)+'\x20\x20'+_0x49f5a1(0xf9)['padStart'](_0x555a42)+'\x20\x20'+_0x49f5a1(0xd0));for(const _0x244220 of _0x18598d){const _0x1b9833=_0x244220[_0x49f5a1(0x105)]===_0x49f5a1(0x104)?_0x49f5a1(0xdb):_0x244220['profile'],_0x31094a=_0x1b9833[_0x49f5a1(0xf6)](_0xcf69ad),_0x1fe0b3=_0x244220[_0x49f5a1(0x105)]===_0x49f5a1(0x104)?a12_0xe1b08['dim'](_0x31094a):_0x31094a;console[_0x49f5a1(0x10b)]('\x20\x20'+_0x1fe0b3+'\x20\x20'+a12_0xe1b08['cyan'](formatCredits(_0x244220['credits'])['padStart'](_0xc8963b))+'\x20\x20'+String(_0x244220[_0x49f5a1(0xfd)])[_0x49f5a1(0xed)](_0x555a42)+'\x20\x20'+a12_0xe1b08[_0x49f5a1(0xe8)](formatLastUsed(_0x244220[_0x49f5a1(0x109)])));}console[_0x49f5a1(0x10b)](),console[_0x49f5a1(0x10b)](a12_0xe1b08[_0x49f5a1(0xe8)](_0x49f5a1(0xf0))),console[_0x49f5a1(0x10b)]();}}
@@ -1 +1 @@
1
- const a13_0x45f2b2=a13_0x3cc3;(function(_0x37f6f2,_0x163c28){const _0x189139=a13_0x3cc3,_0x5129ed=_0x37f6f2();while(!![]){try{const _0x4fcea9=-parseInt(_0x189139(0x193))/0x1+parseInt(_0x189139(0x188))/0x2+-parseInt(_0x189139(0x19c))/0x3*(-parseInt(_0x189139(0x18d))/0x4)+parseInt(_0x189139(0x199))/0x5+-parseInt(_0x189139(0x190))/0x6+-parseInt(_0x189139(0x19d))/0x7+parseInt(_0x189139(0x19b))/0x8*(parseInt(_0x189139(0x1a2))/0x9);if(_0x4fcea9===_0x163c28)break;else _0x5129ed['push'](_0x5129ed['shift']());}catch(_0x44cd6c){_0x5129ed['push'](_0x5129ed['shift']());}}}(a13_0x46f9,0xe0d5d));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 a13_0x46f9(){const _0x356b49=['\x20--profile\x20','5454222QhxWNQ','test','options','553789bcIjDp','dim','error','To\x20set\x20up\x20authentication:','debug','Authentication\x20error\x20stack\x20trace:','3372925HduOJV','Command\x20\x27','9087864luhODN','213dJhOsk','10402238HkHAeB','register','name','cyan','red','9JBTkcg','\x0aStack\x20trace:\x0a','validate','To\x20check\x20your\x20current\x20auth\x20status:','number','validateGlobalOptions','has','Reason:\x20','tdx\x20auth\x20setup','helpText','\x27\x20is\x20already\x20registered','value','execute','getAll','command','Error:\x20','.\x20Must\x20be\x20a\x20number.','get','Authentication\x20failed','profile','detail','commands','status','category','2199446gljZTv','problemDetails','message','stack','tdx\x20auth','54056AIGZwv','Invalid\x20limit\x20value:\x20'];a13_0x46f9=function(){return _0x356b49;};return a13_0x46f9();}import a13_0x52593e from'chalk';export function printAuthError(_0x3929b2,_0x59c1f0=![],_0x489586){const _0x5382b4=a13_0x3cc3,_0x4a74bb=_0x3929b2[_0x5382b4(0x189)]?.[_0x5382b4(0x1b6)]||_0x3929b2[_0x5382b4(0x18a)];console[_0x5382b4(0x195)](a13_0x52593e['red'](_0x5382b4(0x1b4))),console['error'](a13_0x52593e['red'](_0x5382b4(0x1a9)+_0x4a74bb));if(_0x59c1f0){const _0x2da43e=_0x489586?_0x5382b4(0x18f)+_0x489586:'';console[_0x5382b4(0x195)]('\x0a'+a13_0x52593e[_0x5382b4(0x194)](_0x5382b4(0x196))),console[_0x5382b4(0x195)]('\x20\x20'+a13_0x52593e[_0x5382b4(0x1a0)](_0x5382b4(0x1aa)+_0x2da43e)+'\x0a'),console[_0x5382b4(0x195)](''+a13_0x52593e[_0x5382b4(0x194)](_0x5382b4(0x1a5))),console['error']('\x20\x20'+a13_0x52593e[_0x5382b4(0x1a0)](_0x5382b4(0x18c)+_0x2da43e));}}export class BaseCommand{[a13_0x45f2b2(0x1a7)](_0x53fc0d){const _0x4d0d0c=a13_0x45f2b2,{options:_0x2b50d0}=_0x53fc0d,_0x190c98=_0x2b50d0['limit'];if(_0x190c98!==undefined){const _0x24292a=typeof _0x190c98===_0x4d0d0c(0x1a6)?_0x190c98:parseInt(_0x190c98,0xa);if(isNaN(_0x24292a))return _0x4d0d0c(0x18e)+_0x190c98+_0x4d0d0c(0x1b2);const _0x43a948=validateLimitOption(_0x24292a);if(!_0x43a948['isValid'])return _0x43a948[_0x4d0d0c(0x195)];_0x53fc0d[_0x4d0d0c(0x192)]['limit']=_0x43a948[_0x4d0d0c(0x1ad)];}return undefined;}['validate'](_0x407ebd){return undefined;}async['run'](_0x25c1fe){const _0x93afc7=a13_0x45f2b2;try{const _0xbe136f=this[_0x93afc7(0x1a7)](_0x25c1fe);if(_0xbe136f)return console[_0x93afc7(0x195)](_0x93afc7(0x1b1)+_0xbe136f),0x1;const _0xa24ea4=this[_0x93afc7(0x1a4)](_0x25c1fe);if(_0xa24ea4){const _0x4c37ad=/^\s*(Usage|Note|Warning|Error):/i[_0x93afc7(0x191)](_0xa24ea4);return _0x4c37ad?console[_0x93afc7(0x195)](_0xa24ea4):console[_0x93afc7(0x195)](_0x93afc7(0x1b1)+_0xa24ea4),0x1;}const _0x50134a=await this[_0x93afc7(0x1ae)](_0x25c1fe);return _0x50134a??0x0;}catch(_0x178217){if(_0x178217 instanceof Error){if(_0x178217 instanceof HTTPClientError&&_0x178217[_0x93afc7(0x1b8)]===0x191){const _0x4173e8=_0x25c1fe[_0x93afc7(0x192)][_0x93afc7(0x1b5)];printAuthError(_0x178217,!![],_0x4173e8);if(_0x178217[_0x93afc7(0x18b)]){const _0x1bbe88=Logger['of'](_0x93afc7(0x1b0));_0x1bbe88[_0x93afc7(0x197)](_0x93afc7(0x198)),_0x1bbe88[_0x93afc7(0x197)](_0x178217['stack']);}return 0x1;}console[_0x93afc7(0x195)](a13_0x52593e[_0x93afc7(0x1a1)](_0x93afc7(0x1b1)+_0x178217[_0x93afc7(0x18a)]));_0x178217 instanceof SDKError&&_0x178217[_0x93afc7(0x1ab)]&&console[_0x93afc7(0x195)](a13_0x52593e['yellow'](_0x178217[_0x93afc7(0x1ab)]));const _0x4031c8=_0x178217 instanceof SDKError&&_0x178217[_0x93afc7(0x187)]===ErrorCategory['USER_ERROR'];_0x178217[_0x93afc7(0x18b)]&&!_0x4031c8&&console[_0x93afc7(0x195)](_0x93afc7(0x1a3)+_0x178217[_0x93afc7(0x18b)]);}else console['error'](_0x93afc7(0x1b1)+String(_0x178217));return 0x1;}}}export class CommandRegistry{[a13_0x45f2b2(0x1b7)]=new Map();[a13_0x45f2b2(0x19e)](_0xac5c8c){const _0x1849ec=a13_0x45f2b2;if(this[_0x1849ec(0x1b7)][_0x1849ec(0x1a8)](_0xac5c8c[_0x1849ec(0x19f)]))throw new Error(_0x1849ec(0x19a)+_0xac5c8c[_0x1849ec(0x19f)]+_0x1849ec(0x1ac));this[_0x1849ec(0x1b7)]['set'](_0xac5c8c[_0x1849ec(0x19f)],_0xac5c8c);}[a13_0x45f2b2(0x1b3)](_0x1063f0){const _0x10a527=a13_0x45f2b2;return this[_0x10a527(0x1b7)][_0x10a527(0x1b3)](_0x1063f0);}[a13_0x45f2b2(0x1af)](){return Array['from'](this['commands']['values']());}['has'](_0x311c3c){const _0x5ac604=a13_0x45f2b2;return this[_0x5ac604(0x1b7)][_0x5ac604(0x1a8)](_0x311c3c);}}function a13_0x3cc3(_0x4a7d63,_0x3b929d){_0x4a7d63=_0x4a7d63-0x187;const _0x46f9e6=a13_0x46f9();let _0x3cc362=_0x46f9e6[_0x4a7d63];return _0x3cc362;}export const registry=new CommandRegistry();
1
+ function a13_0x181a(_0x3ab42c,_0x1e616f){_0x3ab42c=_0x3ab42c-0xae;const _0x4f9a92=a13_0x4f9a();let _0x181a5f=_0x4f9a92[_0x3ab42c];return _0x181a5f;}const a13_0x2ec79d=a13_0x181a;(function(_0x4f5863,_0x4a4b4f){const _0x37a720=a13_0x181a,_0x454f33=_0x4f5863();while(!![]){try{const _0x5b557b=-parseInt(_0x37a720(0xd4))/0x1*(-parseInt(_0x37a720(0xdb))/0x2)+parseInt(_0x37a720(0xba))/0x3*(parseInt(_0x37a720(0xbf))/0x4)+parseInt(_0x37a720(0xd0))/0x5+parseInt(_0x37a720(0xcc))/0x6*(parseInt(_0x37a720(0xb7))/0x7)+parseInt(_0x37a720(0xbe))/0x8*(parseInt(_0x37a720(0xb5))/0x9)+-parseInt(_0x37a720(0xda))/0xa*(-parseInt(_0x37a720(0xbd))/0xb)+-parseInt(_0x37a720(0xdd))/0xc;if(_0x5b557b===_0x4a4b4f)break;else _0x454f33['push'](_0x454f33['shift']());}catch(_0x2e3e81){_0x454f33['push'](_0x454f33['shift']());}}}(a13_0x4f9a,0x2f7c5));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 a13_0x4638b9 from'chalk';function a13_0x4f9a(){const _0x165abc=['\x20--profile\x20','limit','USER_ERROR','245034zISbol','Reason:\x20','40971XuoFtJ','getAll','from','3vtXGwh','.\x20Must\x20be\x20a\x20number.','debug','33hlmMPS','104YqOaZI','958852ArMplI','validateGlobalOptions','detail','Authentication\x20failed','set','test','options','dim','commands','profile','cyan','validate','has','234uSZaeJ','error','status','number','1753910eqkerk','Command\x20\x27','run','red','10760JrjXdd','tdx\x20auth\x20setup','\x0aStack\x20trace:\x0a','Error:\x20','problemDetails','command','682820fuRYwm','72QJZxAf','name','18844860iuVzOV','Invalid\x20limit\x20value:\x20','Authentication\x20error\x20stack\x20trace:','To\x20set\x20up\x20authentication:','get','message','helpText','execute','stack','register'];a13_0x4f9a=function(){return _0x165abc;};return a13_0x4f9a();}export function printAuthError(_0x35c146,_0x4ef1d7=![],_0x5d8d2e){const _0x391549=a13_0x181a,_0x47a932=_0x35c146[_0x391549(0xd8)]?.[_0x391549(0xc1)]||_0x35c146['message'];console['error'](a13_0x4638b9['red'](_0x391549(0xc2))),console[_0x391549(0xcd)](a13_0x4638b9[_0x391549(0xd3)](_0x391549(0xb6)+_0x47a932));if(_0x4ef1d7){const _0x374a82=_0x5d8d2e?_0x391549(0xb2)+_0x5d8d2e:'';console[_0x391549(0xcd)]('\x0a'+a13_0x4638b9[_0x391549(0xc6)](_0x391549(0xe0))),console[_0x391549(0xcd)]('\x20\x20'+a13_0x4638b9[_0x391549(0xc9)](_0x391549(0xd5)+_0x374a82)+'\x0a'),console[_0x391549(0xcd)](''+a13_0x4638b9[_0x391549(0xc6)]('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x391549(0xcd)]('\x20\x20'+a13_0x4638b9[_0x391549(0xc9)]('tdx\x20auth'+_0x374a82));}}export class BaseCommand{[a13_0x2ec79d(0xc0)](_0x2c2248){const _0xf12220=a13_0x2ec79d,{options:_0x44806d}=_0x2c2248,_0x34603b=_0x44806d[_0xf12220(0xb3)];if(_0x34603b!==undefined){const _0x272aaa=typeof _0x34603b===_0xf12220(0xcf)?_0x34603b:parseInt(_0x34603b,0xa);if(isNaN(_0x272aaa))return _0xf12220(0xde)+_0x34603b+_0xf12220(0xbb);const _0x157df8=validateLimitOption(_0x272aaa);if(!_0x157df8['isValid'])return _0x157df8['error'];_0x2c2248[_0xf12220(0xc5)][_0xf12220(0xb3)]=_0x157df8['value'];}return undefined;}[a13_0x2ec79d(0xca)](_0x19df21){return undefined;}async[a13_0x2ec79d(0xd2)](_0x57db18){const _0x2b3d50=a13_0x2ec79d;try{const _0x12cd2f=this[_0x2b3d50(0xc0)](_0x57db18);if(_0x12cd2f)return console['error']('Error:\x20'+_0x12cd2f),0x1;const _0x33ad01=this[_0x2b3d50(0xca)](_0x57db18);if(_0x33ad01){const _0x5ea496=/^\s*(Usage|Note|Warning|Error):/i[_0x2b3d50(0xc4)](_0x33ad01);return _0x5ea496?console[_0x2b3d50(0xcd)](_0x33ad01):console[_0x2b3d50(0xcd)]('Error:\x20'+_0x33ad01),0x1;}const _0xf62852=await this[_0x2b3d50(0xaf)](_0x57db18);return _0xf62852??0x0;}catch(_0x310d9f){if(_0x310d9f instanceof Error){if(_0x310d9f instanceof HTTPClientError&&_0x310d9f[_0x2b3d50(0xce)]===0x191){const _0x2299e0=_0x57db18[_0x2b3d50(0xc5)][_0x2b3d50(0xc8)];printAuthError(_0x310d9f,!![],_0x2299e0);if(_0x310d9f[_0x2b3d50(0xb0)]){const _0x5a67c0=Logger['of'](_0x2b3d50(0xd9));_0x5a67c0[_0x2b3d50(0xbc)](_0x2b3d50(0xdf)),_0x5a67c0[_0x2b3d50(0xbc)](_0x310d9f[_0x2b3d50(0xb0)]);}return 0x1;}console['error'](a13_0x4638b9[_0x2b3d50(0xd3)](_0x2b3d50(0xd7)+_0x310d9f[_0x2b3d50(0xe2)]));_0x310d9f instanceof SDKError&&_0x310d9f[_0x2b3d50(0xae)]&&console[_0x2b3d50(0xcd)](a13_0x4638b9['yellow'](_0x310d9f[_0x2b3d50(0xae)]));const _0x5d5935=_0x310d9f instanceof SDKError&&_0x310d9f['category']===ErrorCategory[_0x2b3d50(0xb4)];_0x310d9f[_0x2b3d50(0xb0)]&&!_0x5d5935&&console[_0x2b3d50(0xcd)](_0x2b3d50(0xd6)+_0x310d9f[_0x2b3d50(0xb0)]);}else console[_0x2b3d50(0xcd)](_0x2b3d50(0xd7)+String(_0x310d9f));return 0x1;}}}export class CommandRegistry{['commands']=new Map();[a13_0x2ec79d(0xb1)](_0x3f1c76){const _0x57d46a=a13_0x2ec79d;if(this[_0x57d46a(0xc7)][_0x57d46a(0xcb)](_0x3f1c76[_0x57d46a(0xdc)]))throw new Error(_0x57d46a(0xd1)+_0x3f1c76['name']+'\x27\x20is\x20already\x20registered');this[_0x57d46a(0xc7)][_0x57d46a(0xc3)](_0x3f1c76['name'],_0x3f1c76);}[a13_0x2ec79d(0xe1)](_0xe88c72){const _0x5340ce=a13_0x2ec79d;return this[_0x5340ce(0xc7)][_0x5340ce(0xe1)](_0xe88c72);}[a13_0x2ec79d(0xb8)](){const _0x4b3039=a13_0x2ec79d;return Array[_0x4b3039(0xb9)](this[_0x4b3039(0xc7)]['values']());}[a13_0x2ec79d(0xcb)](_0x46ee3d){const _0xd0dab1=a13_0x2ec79d;return this[_0xd0dab1(0xc7)]['has'](_0x46ee3d);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a14_0x4deb8f=a14_0x36c6;(function(_0x54a848,_0x53f42d){const _0x4b39d5=a14_0x36c6,_0x186e38=_0x54a848();while(!![]){try{const _0x1491cb=parseInt(_0x4b39d5(0x12d))/0x1*(parseInt(_0x4b39d5(0x185))/0x2)+parseInt(_0x4b39d5(0x172))/0x3*(-parseInt(_0x4b39d5(0x132))/0x4)+parseInt(_0x4b39d5(0x16a))/0x5+parseInt(_0x4b39d5(0x153))/0x6*(parseInt(_0x4b39d5(0x198))/0x7)+parseInt(_0x4b39d5(0x14a))/0x8*(-parseInt(_0x4b39d5(0x130))/0x9)+parseInt(_0x4b39d5(0x171))/0xa*(-parseInt(_0x4b39d5(0x17b))/0xb)+-parseInt(_0x4b39d5(0x166))/0xc*(parseInt(_0x4b39d5(0x16c))/0xd);if(_0x1491cb===_0x53f42d)break;else _0x186e38['push'](_0x186e38['shift']());}catch(_0x95b282){_0x186e38['push'](_0x186e38['shift']());}}}(a14_0x3170,0x61db5));function a14_0x36c6(_0x73754d,_0x4b716a){_0x73754d=_0x73754d-0x12d;const _0x317070=a14_0x3170();let _0x36c6a7=_0x317070[_0x73754d];return _0x36c6a7;}import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a14_0x3bbf74 from'chalk';function normalizeSchemaForDisplay(_0x99119e){const _0x137236=a14_0x36c6,_0x5dc63e=_0x99119e[_0x137236(0x18f)]||[],_0x202401=_0x5dc63e['find'](_0x19a3b1=>_0x19a3b1[_0x137236(0x188)]===_0x137236(0x165)&&_0x19a3b1[_0x137236(0x199)]==='record'&&_0x19a3b1['properties']);if(_0x202401?.[_0x137236(0x18f)]){const _0x2d3e26=_0x5dc63e['filter'](_0x45b095=>_0x45b095[_0x137236(0x188)]!==_0x137236(0x136)&&_0x45b095['name']!=='legacy_settings');return[..._0x2d3e26,..._0x202401[_0x137236(0x18f)]];}return _0x5dc63e[_0x137236(0x18c)](_0x59f2e8=>_0x59f2e8[_0x137236(0x188)]!=='legacy');}function printSchemaFields(_0x5a2a2e,_0x827830){const _0x261e93=a14_0x36c6,_0x2ad898='\x20\x20'[_0x261e93(0x176)](_0x827830+0x1),_0x45e6d1='\x20\x20'['repeat'](_0x827830+0x2);for(const _0x30928b of _0x5a2a2e){if(!_0x30928b[_0x261e93(0x188)])continue;const _0x12c176=_0x30928b[_0x261e93(0x199)]===_0x261e93(0x162)&&_0x30928b['properties']&&_0x30928b[_0x261e93(0x18f)]['length']>0x0&&_0x30928b[_0x261e93(0x188)]!==_0x261e93(0x165);let _0x293add=''+_0x2ad898+a14_0x3bbf74[_0x261e93(0x140)](_0x30928b[_0x261e93(0x188)]);_0x30928b[_0x261e93(0x13a)]&&(_0x293add+=':\x20'+_0x30928b[_0x261e93(0x13a)]);if(_0x30928b[_0x261e93(0x16f)])_0x293add+=a14_0x3bbf74[_0x261e93(0x186)]('\x20['+_0x30928b['input']+']');else _0x12c176&&(_0x293add+=a14_0x3bbf74[_0x261e93(0x186)](_0x261e93(0x164)));console[_0x261e93(0x197)](_0x293add);_0x30928b[_0x261e93(0x143)]&&console[_0x261e93(0x197)](''+_0x45e6d1+a14_0x3bbf74['dim'](_0x30928b['description']));if(_0x30928b[_0x261e93(0x17c)]){const _0x125d01=_0x30928b[_0x261e93(0x17c)][_0x261e93(0x194)](_0x13cd92=>typeof _0x13cd92===_0x261e93(0x13f)&&_0x261e93(0x144)in _0x13cd92?_0x13cd92[_0x261e93(0x144)]:_0x13cd92)['join'](',\x20');console[_0x261e93(0x197)](_0x45e6d1+'Options:\x20'+a14_0x3bbf74[_0x261e93(0x175)](_0x125d01));}_0x30928b[_0x261e93(0x196)]!==undefined&&console[_0x261e93(0x197)](_0x45e6d1+_0x261e93(0x151)+a14_0x3bbf74[_0x261e93(0x18a)](String(_0x30928b[_0x261e93(0x196)])));if(_0x30928b[_0x261e93(0x12e)]!==undefined||_0x30928b[_0x261e93(0x16b)]!==undefined){const _0x1ac6fd=_0x30928b['minimum']!==undefined&&_0x30928b['maximum']!==undefined?_0x30928b['minimum']+'\x20-\x20'+_0x30928b[_0x261e93(0x16b)]:_0x30928b['minimum']!==undefined?_0x261e93(0x17e)+_0x30928b[_0x261e93(0x12e)]:_0x261e93(0x187)+_0x30928b[_0x261e93(0x16b)];console[_0x261e93(0x197)](_0x45e6d1+_0x261e93(0x195)+a14_0x3bbf74[_0x261e93(0x18a)](_0x1ac6fd));}if(_0x30928b[_0x261e93(0x18d)]){const _0x19fcc3=Object['entries'](_0x30928b[_0x261e93(0x18d)])[_0x261e93(0x194)](([_0x94654,_0x4bf319])=>_0x94654+'='+JSON[_0x261e93(0x142)](_0x4bf319))[_0x261e93(0x16d)](',\x20');console[_0x261e93(0x197)](''+_0x45e6d1+a14_0x3bbf74[_0x261e93(0x186)](_0x261e93(0x12f)+_0x19fcc3));}_0x12c176&&_0x30928b[_0x261e93(0x18f)]&&printSchemaFields(_0x30928b[_0x261e93(0x18f)],_0x827830+0x1);}}export class ConnectionListCommand extends BaseCommand{[a14_0x4deb8f(0x188)]='connection:list';[a14_0x4deb8f(0x143)]=a14_0x4deb8f(0x181);async['execute'](_0x55b2d3){const _0x3c5fb0=a14_0x4deb8f,{options:_0x5991df,tdx:_0x5ceb77}=_0x55b2d3;_0x5991df[_0x3c5fb0(0x19a)]&&console[_0x3c5fb0(0x157)](_0x3c5fb0(0x167)+_0x5991df[_0x3c5fb0(0x169)]);const _0x18a0d8=resolveLimit(_0x5991df[_0x3c5fb0(0x137)],DEFAULT_LISTING_LIMIT),_0x19191e=await withSpinner(_0x3c5fb0(0x14f),()=>_0x5ceb77[_0x3c5fb0(0x180)][_0x3c5fb0(0x14e)](),{'verbose':_0x5991df[_0x3c5fb0(0x19a)]}),_0x195c5e=_0x19191e[_0x3c5fb0(0x17f)];console['error'](_0x3c5fb0(0x179)+_0x195c5e[_0x3c5fb0(0x18b)]+_0x3c5fb0(0x177)+(_0x195c5e[_0x3c5fb0(0x18b)]!==0x1?'s':''));if(isStructuredFormat(_0x5991df)){const _0x45df1d=_0x195c5e['slice'](0x0,_0x18a0d8);await handleSDKOutput(_0x45df1d,{..._0x5991df,'limit':_0x18a0d8});}else{const _0x2d09c6=_0x195c5e[_0x3c5fb0(0x18b)]>0x0?Math[_0x3c5fb0(0x193)](..._0x195c5e[_0x3c5fb0(0x194)](_0x5bdc72=>_0x5bdc72[_0x3c5fb0(0x199)][_0x3c5fb0(0x18b)])):0x0,_0x284e15=[];for(const _0x34e154 of _0x195c5e){const _0x1f7ed7=a14_0x3bbf74[_0x3c5fb0(0x15d)](_0x34e154[_0x3c5fb0(0x199)][_0x3c5fb0(0x145)](_0x2d09c6)),_0x35cf64=_0x34e154[_0x3c5fb0(0x13c)]?.[_0x3c5fb0(0x188)]?_0x3c5fb0(0x149)+a14_0x3bbf74[_0x3c5fb0(0x186)](_0x34e154[_0x3c5fb0(0x13c)][_0x3c5fb0(0x188)]):'';_0x284e15['push'](_0x1f7ed7+'\x20\x20'+_0x34e154[_0x3c5fb0(0x188)]+_0x35cf64);}await writeOutput(_0x284e15[_0x3c5fb0(0x16d)]('\x0a'),_0x5991df[_0x3c5fb0(0x18e)],_0x3c5fb0(0x154));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a14_0x4deb8f(0x188)]='connection:show';[a14_0x4deb8f(0x143)]=a14_0x4deb8f(0x15c);[a14_0x4deb8f(0x16e)](_0x14d759){const _0x5b9693=a14_0x4deb8f,{args:_0xed60e9}=_0x14d759;if(!_0xed60e9[0x0])return _0x5b9693(0x170);return undefined;}async['execute'](_0x1ec878){const _0x5cdcaa=a14_0x4deb8f,{options:_0x22823a,args:_0x17ea1f,tdx:_0x13b5ea}=_0x1ec878,_0x5bc3ed=_0x17ea1f[0x0];_0x22823a[_0x5cdcaa(0x19a)]&&(console['error'](_0x5cdcaa(0x167)+_0x22823a['site']),console['error'](_0x5cdcaa(0x155)+_0x5bc3ed));const _0x2a6f3e=await withSpinner('Fetching\x20connection\x20\x27'+_0x5bc3ed+_0x5cdcaa(0x135),()=>_0x13b5ea['connection'][_0x5cdcaa(0x148)](_0x5bc3ed),{'verbose':_0x22823a[_0x5cdcaa(0x19a)]}),_0x27549f=_0x2a6f3e['data'];return console['error'](_0x5cdcaa(0x161)+_0x27549f[_0x5cdcaa(0x188)]),await handleSingleObjectOutput(_0x27549f,_0x22823a),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a14_0x4deb8f(0x188)]=a14_0x4deb8f(0x133);[a14_0x4deb8f(0x143)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';[a14_0x4deb8f(0x16e)](_0x1f1a2b){const _0x1d0d13=a14_0x4deb8f,{args:_0x50397c}=_0x1f1a2b;if(!_0x50397c[0x0])return _0x1d0d13(0x168);return undefined;}async[a14_0x4deb8f(0x163)](_0x399c3e){const _0x474f82=a14_0x4deb8f,{options:_0x348f27,args:_0x27bb6e,tdx:_0x2e9991}=_0x399c3e,_0xf9e380=_0x27bb6e[0x0];_0x348f27[_0x474f82(0x19a)]&&(console[_0x474f82(0x157)]('Site:\x20'+_0x348f27[_0x474f82(0x169)]),console[_0x474f82(0x157)](_0x474f82(0x141)+_0xf9e380));let _0x4aa6af=_0xf9e380,_0x409c41;try{const _0x33b1c6=await _0x2e9991[_0x474f82(0x180)][_0x474f82(0x13e)](_0xf9e380);_0x33b1c6&&(_0x4aa6af=_0x33b1c6['type'],_0x409c41=_0x33b1c6[_0x474f82(0x188)],_0x348f27[_0x474f82(0x19a)]&&console[_0x474f82(0x157)](_0x474f82(0x17d)+_0xf9e380+_0x474f82(0x131)+_0x4aa6af));}catch{_0x348f27[_0x474f82(0x19a)]&&console[_0x474f82(0x157)](_0x474f82(0x13d)+_0xf9e380+_0x474f82(0x14c));}const _0x43f8e0=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x4aa6af+_0x474f82(0x135),()=>_0x2e9991[_0x474f82(0x180)]['getOutputSchema'](_0x4aa6af),{'verbose':_0x348f27[_0x474f82(0x19a)]}),_0x1638d5=_0x43f8e0[_0x474f82(0x17f)];_0x409c41?console[_0x474f82(0x157)](_0x474f82(0x152)+_0x409c41+_0x474f82(0x15f)+_0x4aa6af+')'):console[_0x474f82(0x157)]('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x4aa6af);if(isStructuredFormat(_0x348f27))await handleSingleObjectOutput(_0x1638d5,_0x348f27);else{const _0x4cc77c=normalizeSchemaForDisplay(_0x1638d5);_0x409c41?(console['log'](_0x474f82(0x160)+a14_0x3bbf74[_0x474f82(0x15d)](_0x409c41)),console[_0x474f82(0x197)](_0x474f82(0x173)+a14_0x3bbf74[_0x474f82(0x186)](_0x4aa6af))):console['log']('\x0aConnector:\x20'+a14_0x3bbf74[_0x474f82(0x15d)](_0x4aa6af)),_0x4cc77c[_0x474f82(0x18b)]>0x0?(console[_0x474f82(0x197)](a14_0x3bbf74[_0x474f82(0x184)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x4cc77c,0x0)):console[_0x474f82(0x197)](a14_0x3bbf74[_0x474f82(0x186)](_0x474f82(0x192)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a14_0x4deb8f(0x188)]=a14_0x4deb8f(0x15b);[a14_0x4deb8f(0x143)]=a14_0x4deb8f(0x14b);async[a14_0x4deb8f(0x163)](_0x1fd79f){const _0x3cc94c=a14_0x4deb8f,{options:_0x8d79eb,tdx:_0x41ffea}=_0x1fd79f;_0x8d79eb['verbose']&&console[_0x3cc94c(0x157)](_0x3cc94c(0x167)+_0x8d79eb[_0x3cc94c(0x169)]);const _0x341f66=await withSpinner(_0x3cc94c(0x15e),()=>_0x41ffea[_0x3cc94c(0x180)][_0x3cc94c(0x19b)](),{'verbose':_0x8d79eb[_0x3cc94c(0x19a)]}),_0xff022d=_0x341f66[_0x3cc94c(0x17f)][_0x3cc94c(0x182)]((_0x143e60,_0xf91960)=>_0x143e60[_0x3cc94c(0x199)][_0x3cc94c(0x138)](_0xf91960[_0x3cc94c(0x199)]));console[_0x3cc94c(0x157)](_0x3cc94c(0x179)+_0xff022d[_0x3cc94c(0x18b)]+_0x3cc94c(0x146)+(_0xff022d[_0x3cc94c(0x18b)]!==0x1?'s':''));if(isStructuredFormat(_0x8d79eb))await handleSDKOutput(_0xff022d,_0x8d79eb);else{const _0x9764ec=_0xff022d['length']>0x0?Math[_0x3cc94c(0x193)](..._0xff022d[_0x3cc94c(0x194)](_0x33f3a8=>_0x33f3a8['type'][_0x3cc94c(0x18b)])):0x0,_0x5d3595=[];for(const _0x5e330b of _0xff022d){const _0x440562=a14_0x3bbf74[_0x3cc94c(0x15d)](_0x5e330b[_0x3cc94c(0x199)][_0x3cc94c(0x145)](_0x9764ec));_0x5d3595['push'](_0x440562+'\x20\x20'+_0x5e330b[_0x3cc94c(0x188)]);}await writeOutput(_0x5d3595[_0x3cc94c(0x16d)]('\x0a'),_0x8d79eb[_0x3cc94c(0x18e)],_0x3cc94c(0x154));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a14_0x4deb8f(0x188)]=a14_0x4deb8f(0x147);[a14_0x4deb8f(0x143)]=a14_0x4deb8f(0x13b);[a14_0x4deb8f(0x16e)](_0x2fb804){const _0x3643a1=a14_0x4deb8f,{args:_0x9adf45}=_0x2fb804;if(!_0x9adf45[0x0])return _0x3643a1(0x158);return undefined;}async[a14_0x4deb8f(0x163)](_0x1d97bb){const _0x16840a=a14_0x4deb8f,{options:_0x3ef353,args:_0x4ec42b,tdx:_0x292d96}=_0x1d97bb,_0x208e2e=_0x4ec42b[0x0];_0x3ef353[_0x16840a(0x19a)]&&(console[_0x16840a(0x157)](_0x16840a(0x167)+_0x3ef353['site']),console[_0x16840a(0x157)](_0x16840a(0x150)+_0x208e2e));const _0x52a881=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x208e2e+_0x16840a(0x135),()=>_0x292d96[_0x16840a(0x180)][_0x16840a(0x189)](_0x208e2e),{'verbose':_0x3ef353['verbose']}),_0x4162e4=_0x52a881['data'];console[_0x16840a(0x157)](_0x16840a(0x174)+_0x208e2e);if(isStructuredFormat(_0x3ef353))await handleSingleObjectOutput(_0x4162e4,_0x3ef353);else{console['log'](_0x16840a(0x14d)+a14_0x3bbf74[_0x16840a(0x15d)](_0x208e2e)),console[_0x16840a(0x197)]('Name:\x20'+_0x4162e4['name']);const _0x2e5380=_0x4162e4[_0x16840a(0x17a)]||[],_0x3a848e=_0x2e5380['filter'](_0x110eb8=>_0x110eb8['credential']);_0x3a848e['length']>0x0&&(console[_0x16840a(0x197)](a14_0x3bbf74[_0x16840a(0x184)]('\x0aCredential\x20settings:')),printMetadataSettings(_0x3a848e));let _0x57d789=![];try{const _0x3c7bc4=await _0x292d96[_0x16840a(0x180)]['getOutputSchema'](_0x208e2e),_0x26f5f=normalizeSchemaForDisplay(_0x3c7bc4);_0x26f5f[_0x16840a(0x18b)]>0x0&&(console[_0x16840a(0x197)](a14_0x3bbf74[_0x16840a(0x184)](_0x16840a(0x156))),printSchemaFields(_0x26f5f,0x0),_0x57d789=!![]);}catch{const _0x36d356=_0x2e5380[_0x16840a(0x18c)](_0x271d84=>!_0x271d84[_0x16840a(0x139)]);_0x36d356[_0x16840a(0x18b)]>0x0&&(console[_0x16840a(0x197)](a14_0x3bbf74['bold'](_0x16840a(0x156))),printMetadataSettings(_0x36d356),_0x57d789=!![]);}!_0x57d789&&_0x3ef353[_0x16840a(0x19a)]&&console[_0x16840a(0x157)](a14_0x3bbf74['dim'](_0x16840a(0x159))),_0x3a848e[_0x16840a(0x18b)]===0x0&&console[_0x16840a(0x197)](a14_0x3bbf74[_0x16840a(0x186)]('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function printMetadataSettings(_0x7f01bd){const _0x812dc4=a14_0x4deb8f;for(const _0x3cab32 of _0x7f01bd){if(!_0x3cab32[_0x812dc4(0x188)])continue;if(_0x3cab32[_0x812dc4(0x178)])continue;let _0x5a69d2='\x20\x20'+a14_0x3bbf74[_0x812dc4(0x140)](_0x3cab32['name']);_0x3cab32[_0x812dc4(0x134)]&&(_0x5a69d2+=':\x20'+_0x3cab32[_0x812dc4(0x134)]);_0x3cab32[_0x812dc4(0x199)]&&(_0x5a69d2+=a14_0x3bbf74[_0x812dc4(0x186)]('\x20['+_0x3cab32['type']+']'));console[_0x812dc4(0x197)](_0x5a69d2);_0x3cab32[_0x812dc4(0x191)]&&console[_0x812dc4(0x197)]('\x20\x20\x20\x20'+a14_0x3bbf74['dim'](_0x3cab32[_0x812dc4(0x191)]));if(_0x3cab32[_0x812dc4(0x190)]){const _0x27769e=_0x3cab32[_0x812dc4(0x190)][_0x812dc4(0x194)](_0xb83886=>_0xb83886['value'])['join'](',\x20');console[_0x812dc4(0x197)](_0x812dc4(0x15a)+a14_0x3bbf74['yellow'](_0x27769e));}_0x3cab32['default_value']!==undefined&&_0x3cab32[_0x812dc4(0x196)]!==null&&console[_0x812dc4(0x197)]('\x20\x20\x20\x20Default:\x20'+a14_0x3bbf74[_0x812dc4(0x18a)](String(_0x3cab32[_0x812dc4(0x196)])));if(_0x3cab32[_0x812dc4(0x18d)]){const _0x4b0b8f=Object[_0x812dc4(0x19c)](_0x3cab32[_0x812dc4(0x18d)])['map'](([_0x1626b4,_0x24e261])=>_0x1626b4+'='+JSON['stringify'](_0x24e261))[_0x812dc4(0x16d)](',\x20');console[_0x812dc4(0x197)](_0x812dc4(0x183)+a14_0x3bbf74[_0x812dc4(0x186)]('Show\x20when:\x20'+_0x4b0b8f));}}}function a14_0x3170(){const _0xe0bb9c=['>=\x20','data','connection','List\x20all\x20result\x20output\x20connections','sort','\x20\x20\x20\x20','bold','2kxxCOx','dim','<=\x20','name','getMetadata','blue','length','filter','criteria','output','properties','options','hint','\x0aNo\x20fields\x20defined\x20in\x20schema','max','map','Range:\x20','default_value','log','455441qLZzcf','type','verbose','listTypes','entries','280886glJhJo','minimum','Show\x20when:\x20','18eaCKFz','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','504188oQREQD','connection:schema','label','\x27...','legacy','limit','localeCompare','credential','title','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','owner','Treating\x20\x27','findByName','object','green','Resolving\x20connector\x20type\x20or\x20name:\x20','stringify','description','value','padStart','\x20connector\x20type','connection:settings','resolve','\x20-\x20','2419528jyhsJd','List\x20available\x20connector\x20types','\x27\x20as\x20connector\x20type','\x0aConnector:\x20','list','Listing\x20connections...','Fetching\x20settings\x20for\x20connector\x20type:\x20','Default:\x20','✔\x20Found\x20schema\x20for\x20connection\x20\x27','60mGXlWk','table','Looking\x20up\x20connection:\x20','\x0aAvailable\x20fields:','error','Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.','No\x20available\x20fields\x20for\x20this\x20connector','\x20\x20\x20\x20Options:\x20','connection:types','Show\x20connection\x20details','cyan','Listing\x20connector\x20types...','\x27\x20(type:\x20','\x0aConnection:\x20','✔\x20Found\x20connection:\x20','record','execute','\x20[record]','legacy_settings','1838424oIGOyC','Site:\x20','Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.','site','2470170QhoGwH','maximum','13UbAPsS','join','validate','input','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','1405980GSezUF','3XJyRCw','Type:\x20','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','yellow','repeat','\x20connection','hidden','✔\x20Found\x20','settings','11USVsMh','enumeration','✔\x20Resolved\x20\x27'];a14_0x3170=function(){return _0xe0bb9c;};return a14_0x3170();}
1
+ const a14_0x196d7a=a14_0xa49a;(function(_0x1e1cc2,_0x350c99){const _0x2e4d5a=a14_0xa49a,_0x2977b0=_0x1e1cc2();while(!![]){try{const _0x382990=parseInt(_0x2e4d5a(0x1d1))/0x1+-parseInt(_0x2e4d5a(0x1b4))/0x2*(-parseInt(_0x2e4d5a(0x19d))/0x3)+parseInt(_0x2e4d5a(0x195))/0x4+-parseInt(_0x2e4d5a(0x1c0))/0x5+parseInt(_0x2e4d5a(0x1e1))/0x6+parseInt(_0x2e4d5a(0x1ab))/0x7+parseInt(_0x2e4d5a(0x1d7))/0x8*(-parseInt(_0x2e4d5a(0x1f6))/0x9);if(_0x382990===_0x350c99)break;else _0x2977b0['push'](_0x2977b0['shift']());}catch(_0x1e2101){_0x2977b0['push'](_0x2977b0['shift']());}}}(a14_0x2c57,0x4aa1f));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a14_0x1be419 from'chalk';function normalizeSchemaForDisplay(_0x4b8d34){const _0x3324c8=a14_0xa49a,_0x51436e=_0x4b8d34[_0x3324c8(0x19c)]||[],_0x5c262d=_0x51436e['find'](_0x13ad93=>_0x13ad93['name']===_0x3324c8(0x1d5)&&_0x13ad93[_0x3324c8(0x1da)]===_0x3324c8(0x1a0)&&_0x13ad93['properties']);if(_0x5c262d?.[_0x3324c8(0x19c)]){const _0x16cffe=_0x51436e['filter'](_0x502dc6=>_0x502dc6[_0x3324c8(0x1bb)]!=='legacy'&&_0x502dc6[_0x3324c8(0x1bb)]!==_0x3324c8(0x1d5));return[..._0x16cffe,..._0x5c262d[_0x3324c8(0x19c)]];}return _0x51436e['filter'](_0x2c115c=>_0x2c115c[_0x3324c8(0x1bb)]!=='legacy');}function printSchemaFields(_0x1af121,_0x10b016){const _0x4b7da4=a14_0xa49a,_0x24a361='\x20\x20'[_0x4b7da4(0x194)](_0x10b016+0x1),_0x563cd6='\x20\x20'[_0x4b7da4(0x194)](_0x10b016+0x2);for(const _0x3e3e93 of _0x1af121){if(!_0x3e3e93[_0x4b7da4(0x1bb)])continue;const _0x271a76=_0x3e3e93[_0x4b7da4(0x1da)]===_0x4b7da4(0x1a0)&&_0x3e3e93['properties']&&_0x3e3e93[_0x4b7da4(0x19c)][_0x4b7da4(0x1b0)]>0x0&&_0x3e3e93['name']!==_0x4b7da4(0x1d5);let _0xa09806=''+_0x24a361+a14_0x1be419[_0x4b7da4(0x1bd)](_0x3e3e93[_0x4b7da4(0x1bb)]);_0x3e3e93['title']&&(_0xa09806+=':\x20'+_0x3e3e93[_0x4b7da4(0x1ef)]);if(_0x3e3e93[_0x4b7da4(0x1dc)])_0xa09806+=a14_0x1be419[_0x4b7da4(0x1f7)]('\x20['+_0x3e3e93[_0x4b7da4(0x1dc)]+']');else _0x271a76&&(_0xa09806+=a14_0x1be419['dim'](_0x4b7da4(0x1c9)));console['log'](_0xa09806);_0x3e3e93[_0x4b7da4(0x19a)]&&console[_0x4b7da4(0x1f9)](''+_0x563cd6+a14_0x1be419[_0x4b7da4(0x1f7)](_0x3e3e93['description']));if(_0x3e3e93[_0x4b7da4(0x1e5)]){const _0x8311db=_0x3e3e93[_0x4b7da4(0x1e5)][_0x4b7da4(0x1a3)](_0x18818f=>typeof _0x18818f===_0x4b7da4(0x1cd)&&_0x4b7da4(0x1e9)in _0x18818f?_0x18818f[_0x4b7da4(0x1e9)]:_0x18818f)[_0x4b7da4(0x1de)](',\x20');console[_0x4b7da4(0x1f9)](_0x563cd6+_0x4b7da4(0x1f5)+a14_0x1be419[_0x4b7da4(0x197)](_0x8311db));}_0x3e3e93[_0x4b7da4(0x1c3)]!==undefined&&console['log'](_0x563cd6+_0x4b7da4(0x1f8)+a14_0x1be419[_0x4b7da4(0x1a5)](String(_0x3e3e93[_0x4b7da4(0x1c3)])));if(_0x3e3e93[_0x4b7da4(0x1b7)]!==undefined||_0x3e3e93[_0x4b7da4(0x1c1)]!==undefined){const _0x273eef=_0x3e3e93['minimum']!==undefined&&_0x3e3e93['maximum']!==undefined?_0x3e3e93[_0x4b7da4(0x1b7)]+_0x4b7da4(0x1d4)+_0x3e3e93[_0x4b7da4(0x1c1)]:_0x3e3e93[_0x4b7da4(0x1b7)]!==undefined?'>=\x20'+_0x3e3e93[_0x4b7da4(0x1b7)]:'<=\x20'+_0x3e3e93[_0x4b7da4(0x1c1)];console[_0x4b7da4(0x1f9)](_0x563cd6+_0x4b7da4(0x1ae)+a14_0x1be419[_0x4b7da4(0x1a5)](_0x273eef));}if(_0x3e3e93['criteria']){const _0x56645e=Object[_0x4b7da4(0x1f1)](_0x3e3e93[_0x4b7da4(0x1d2)])[_0x4b7da4(0x1a3)](([_0xe986d7,_0x5dcc9d])=>_0xe986d7+'='+JSON[_0x4b7da4(0x19b)](_0x5dcc9d))[_0x4b7da4(0x1de)](',\x20');console['log'](''+_0x563cd6+a14_0x1be419[_0x4b7da4(0x1f7)](_0x4b7da4(0x1a9)+_0x56645e));}_0x271a76&&_0x3e3e93[_0x4b7da4(0x19c)]&&printSchemaFields(_0x3e3e93['properties'],_0x10b016+0x1);}}function a14_0x2c57(){const _0xf6f7c4=['1436900gGFxEA','maximum','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.','default_value','\x27\x20as\x20connector\x20type','\x27...','connection:settings','owner','\x0aConnector:\x20','\x20[record]','table','site','validate','object','list','getMetadata','Show\x20connection\x20details','173612IEfJzX','criteria','Fetching\x20settings\x20for\x20connector\x20type:\x20','\x20-\x20','legacy_settings','\x0aNo\x20credential\x20settings\x20defined','13758896IcaYJV','output','resolve','type','bold','input','\x0aNo\x20fields\x20defined\x20in\x20schema','join','\x27\x20(type:\x20','✔\x20Found\x20connection:\x20','3453210RsXwaz','connection:types','execute','✔\x20Resolved\x20\x27','enumeration','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.','options','connection:show','value','hint','settings','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','getOutputSchema','✔\x20Found\x20schema\x20for\x20connection\x20\x27','title','localeCompare','entries','connection','\x20connection','label','Options:\x20','9RmrqTC','dim','Default:\x20','log','filter','Listing\x20connections...','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','Fetching\x20settings\x20for\x20\x27','push','repeat','1644240qOWhrI','Name:\x20','yellow','data','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','description','stringify','properties','1793523YAasrM','verbose','\x20connector\x20type','record','\x0aAvailable\x20fields:','error','map','List\x20available\x20connector\x20types','blue','cyan','✔\x20Found\x20','max','Show\x20when:\x20','\x20\x20\x20\x20','3884223RbkzeO','findByName','connection:schema','Range:\x20','List\x20all\x20result\x20output\x20connections','length','Fetching\x20connection\x20\x27','slice','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','2MajzXx','Treating\x20\x27','Site:\x20','minimum','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','padStart','Resolving\x20connector\x20type\x20or\x20name:\x20','name','\x20\x20\x20\x20Default:\x20','green','credential','Listing\x20connector\x20types...'];a14_0x2c57=function(){return _0xf6f7c4;};return a14_0x2c57();}export class ConnectionListCommand extends BaseCommand{[a14_0x196d7a(0x1bb)]='connection:list';[a14_0x196d7a(0x19a)]=a14_0x196d7a(0x1af);async[a14_0x196d7a(0x1e3)](_0x366aba){const _0x411812=a14_0x196d7a,{options:_0x3e0b28,tdx:_0x3e1791}=_0x366aba;_0x3e0b28[_0x411812(0x19e)]&&console['error'](_0x411812(0x1b6)+_0x3e0b28[_0x411812(0x1cb)]);const _0x10fa3f=resolveLimit(_0x3e0b28['limit'],DEFAULT_LISTING_LIMIT),_0x140621=await withSpinner(_0x411812(0x190),()=>_0x3e1791[_0x411812(0x1f2)][_0x411812(0x1ce)](),{'verbose':_0x3e0b28[_0x411812(0x19e)]}),_0x595e75=_0x140621[_0x411812(0x198)];console[_0x411812(0x1a2)](_0x411812(0x1a7)+_0x595e75[_0x411812(0x1b0)]+_0x411812(0x1f3)+(_0x595e75[_0x411812(0x1b0)]!==0x1?'s':''));if(isStructuredFormat(_0x3e0b28)){const _0x5f03d8=_0x595e75[_0x411812(0x1b2)](0x0,_0x10fa3f);await handleSDKOutput(_0x5f03d8,{..._0x3e0b28,'limit':_0x10fa3f});}else{const _0x2d50ba=_0x595e75[_0x411812(0x1b0)]>0x0?Math[_0x411812(0x1a8)](..._0x595e75[_0x411812(0x1a3)](_0x317911=>_0x317911[_0x411812(0x1da)]['length'])):0x0,_0x493f78=[];for(const _0xad5a56 of _0x595e75){const _0x780c84=a14_0x1be419[_0x411812(0x1a6)](_0xad5a56['type'][_0x411812(0x1b9)](_0x2d50ba)),_0x3fd5de=_0xad5a56[_0x411812(0x1c7)]?.[_0x411812(0x1bb)]?_0x411812(0x1d4)+a14_0x1be419['dim'](_0xad5a56['owner'][_0x411812(0x1bb)]):'';_0x493f78['push'](_0x780c84+'\x20\x20'+_0xad5a56['name']+_0x3fd5de);}await writeOutput(_0x493f78[_0x411812(0x1de)]('\x0a'),_0x3e0b28[_0x411812(0x1d8)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']=a14_0x196d7a(0x1e8);['description']=a14_0x196d7a(0x1d0);[a14_0x196d7a(0x1cc)](_0x315e88){const {args:_0x3759d2}=_0x315e88;if(!_0x3759d2[0x0])return'Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22';return undefined;}async[a14_0x196d7a(0x1e3)](_0x58e8ad){const _0xa1009c=a14_0x196d7a,{options:_0x1692c9,args:_0x3fbfec,tdx:_0x504e91}=_0x58e8ad,_0x483ee2=_0x3fbfec[0x0];_0x1692c9[_0xa1009c(0x19e)]&&(console[_0xa1009c(0x1a2)](_0xa1009c(0x1b6)+_0x1692c9[_0xa1009c(0x1cb)]),console[_0xa1009c(0x1a2)]('Looking\x20up\x20connection:\x20'+_0x483ee2));const _0x2f5635=await withSpinner(_0xa1009c(0x1b1)+_0x483ee2+_0xa1009c(0x1c5),()=>_0x504e91[_0xa1009c(0x1f2)][_0xa1009c(0x1d9)](_0x483ee2),{'verbose':_0x1692c9[_0xa1009c(0x19e)]}),_0x1d1da0=_0x2f5635[_0xa1009c(0x198)];return console[_0xa1009c(0x1a2)](_0xa1009c(0x1e0)+_0x1d1da0[_0xa1009c(0x1bb)]),await handleSingleObjectOutput(_0x1d1da0,_0x1692c9),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a14_0x196d7a(0x1bb)]=a14_0x196d7a(0x1ad);[a14_0x196d7a(0x19a)]=a14_0x196d7a(0x1b3);['validate'](_0x1d12dd){const _0x3c335d=a14_0x196d7a,{args:_0x2a4cc5}=_0x1d12dd;if(!_0x2a4cc5[0x0])return _0x3c335d(0x1e6);return undefined;}async[a14_0x196d7a(0x1e3)](_0xd6a42a){const _0x362ff9=a14_0x196d7a,{options:_0x1e9381,args:_0x3116cc,tdx:_0x422689}=_0xd6a42a,_0x2ad414=_0x3116cc[0x0];_0x1e9381[_0x362ff9(0x19e)]&&(console[_0x362ff9(0x1a2)](_0x362ff9(0x1b6)+_0x1e9381[_0x362ff9(0x1cb)]),console[_0x362ff9(0x1a2)](_0x362ff9(0x1ba)+_0x2ad414));let _0x4b4af6=_0x2ad414,_0x21c4eb;try{const _0x11ffa1=await _0x422689[_0x362ff9(0x1f2)][_0x362ff9(0x1ac)](_0x2ad414);_0x11ffa1&&(_0x4b4af6=_0x11ffa1[_0x362ff9(0x1da)],_0x21c4eb=_0x11ffa1['name'],_0x1e9381[_0x362ff9(0x19e)]&&console[_0x362ff9(0x1a2)](_0x362ff9(0x1e4)+_0x2ad414+_0x362ff9(0x1b8)+_0x4b4af6));}catch{_0x1e9381[_0x362ff9(0x19e)]&&console[_0x362ff9(0x1a2)](_0x362ff9(0x1b5)+_0x2ad414+_0x362ff9(0x1c4));}const _0x44917e=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x4b4af6+_0x362ff9(0x1c5),()=>_0x422689[_0x362ff9(0x1f2)][_0x362ff9(0x1ed)](_0x4b4af6),{'verbose':_0x1e9381[_0x362ff9(0x19e)]}),_0x28d040=_0x44917e[_0x362ff9(0x198)];_0x21c4eb?console[_0x362ff9(0x1a2)](_0x362ff9(0x1ee)+_0x21c4eb+_0x362ff9(0x1df)+_0x4b4af6+')'):console[_0x362ff9(0x1a2)](_0x362ff9(0x199)+_0x4b4af6);if(isStructuredFormat(_0x1e9381))await handleSingleObjectOutput(_0x28d040,_0x1e9381);else{const _0x175827=normalizeSchemaForDisplay(_0x28d040);_0x21c4eb?(console[_0x362ff9(0x1f9)]('\x0aConnection:\x20'+a14_0x1be419[_0x362ff9(0x1a6)](_0x21c4eb)),console['log']('Type:\x20'+a14_0x1be419[_0x362ff9(0x1f7)](_0x4b4af6))):console[_0x362ff9(0x1f9)](_0x362ff9(0x1c8)+a14_0x1be419[_0x362ff9(0x1a6)](_0x4b4af6)),_0x175827[_0x362ff9(0x1b0)]>0x0?(console[_0x362ff9(0x1f9)](a14_0x1be419[_0x362ff9(0x1db)](_0x362ff9(0x1a1))),printSchemaFields(_0x175827,0x0)):console['log'](a14_0x1be419[_0x362ff9(0x1f7)](_0x362ff9(0x1dd)));}return 0x0;}}function a14_0xa49a(_0x4ac51e,_0x1bf3d5){_0x4ac51e=_0x4ac51e-0x18f;const _0x2c575d=a14_0x2c57();let _0xa49a12=_0x2c575d[_0x4ac51e];return _0xa49a12;}export class ConnectionTypesCommand extends BaseCommand{[a14_0x196d7a(0x1bb)]=a14_0x196d7a(0x1e2);[a14_0x196d7a(0x19a)]=a14_0x196d7a(0x1a4);async[a14_0x196d7a(0x1e3)](_0x13da89){const _0x5a32e2=a14_0x196d7a,{options:_0x18b2e1,tdx:_0x14e0e4}=_0x13da89;_0x18b2e1[_0x5a32e2(0x19e)]&&console[_0x5a32e2(0x1a2)](_0x5a32e2(0x1b6)+_0x18b2e1['site']);const _0x4be636=await withSpinner(_0x5a32e2(0x1bf),()=>_0x14e0e4['connection']['listTypes'](),{'verbose':_0x18b2e1['verbose']}),_0xb3a8a4=_0x4be636[_0x5a32e2(0x198)]['sort']((_0x12ed12,_0x7362ae)=>_0x12ed12[_0x5a32e2(0x1da)][_0x5a32e2(0x1f0)](_0x7362ae[_0x5a32e2(0x1da)]));console[_0x5a32e2(0x1a2)]('✔\x20Found\x20'+_0xb3a8a4['length']+_0x5a32e2(0x19f)+(_0xb3a8a4[_0x5a32e2(0x1b0)]!==0x1?'s':''));if(isStructuredFormat(_0x18b2e1))await handleSDKOutput(_0xb3a8a4,_0x18b2e1);else{const _0x521833=_0xb3a8a4[_0x5a32e2(0x1b0)]>0x0?Math[_0x5a32e2(0x1a8)](..._0xb3a8a4[_0x5a32e2(0x1a3)](_0x459551=>_0x459551[_0x5a32e2(0x1da)][_0x5a32e2(0x1b0)])):0x0,_0x137d05=[];for(const _0x5d0f80 of _0xb3a8a4){const _0x27d0de=a14_0x1be419[_0x5a32e2(0x1a6)](_0x5d0f80[_0x5a32e2(0x1da)][_0x5a32e2(0x1b9)](_0x521833));_0x137d05[_0x5a32e2(0x193)](_0x27d0de+'\x20\x20'+_0x5d0f80[_0x5a32e2(0x1bb)]);}await writeOutput(_0x137d05[_0x5a32e2(0x1de)]('\x0a'),_0x18b2e1['output'],_0x5a32e2(0x1ca));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a14_0x196d7a(0x1bb)]=a14_0x196d7a(0x1c6);[a14_0x196d7a(0x19a)]=a14_0x196d7a(0x191);[a14_0x196d7a(0x1cc)](_0x17da3e){const _0x5725d9=a14_0x196d7a,{args:_0x4ee3bb}=_0x17da3e;if(!_0x4ee3bb[0x0])return _0x5725d9(0x1c2);return undefined;}async[a14_0x196d7a(0x1e3)](_0x4ca113){const _0x49e256=a14_0x196d7a,{options:_0x4bfc4f,args:_0x42b3b3,tdx:_0x380423}=_0x4ca113,_0x3e0756=_0x42b3b3[0x0];_0x4bfc4f['verbose']&&(console['error'](_0x49e256(0x1b6)+_0x4bfc4f['site']),console[_0x49e256(0x1a2)](_0x49e256(0x1d3)+_0x3e0756));const _0xeffe48=await withSpinner(_0x49e256(0x192)+_0x3e0756+_0x49e256(0x1c5),()=>_0x380423[_0x49e256(0x1f2)][_0x49e256(0x1cf)](_0x3e0756),{'verbose':_0x4bfc4f[_0x49e256(0x19e)]}),_0x3f0e21=_0xeffe48['data'];console[_0x49e256(0x1a2)](_0x49e256(0x1ec)+_0x3e0756);if(isStructuredFormat(_0x4bfc4f))await handleSingleObjectOutput(_0x3f0e21,_0x4bfc4f);else{console[_0x49e256(0x1f9)](_0x49e256(0x1c8)+a14_0x1be419[_0x49e256(0x1a6)](_0x3e0756)),console['log'](_0x49e256(0x196)+_0x3f0e21[_0x49e256(0x1bb)]);const _0x35ca3a=_0x3f0e21[_0x49e256(0x1eb)]||[],_0x6ab98b=_0x35ca3a['filter'](_0x366d08=>_0x366d08[_0x49e256(0x1be)]);_0x6ab98b[_0x49e256(0x1b0)]>0x0&&(console[_0x49e256(0x1f9)](a14_0x1be419[_0x49e256(0x1db)]('\x0aCredential\x20settings:')),printMetadataSettings(_0x6ab98b));let _0x2239a0=![];try{const _0x4957cf=await _0x380423[_0x49e256(0x1f2)][_0x49e256(0x1ed)](_0x3e0756),_0x583f54=normalizeSchemaForDisplay(_0x4957cf);_0x583f54[_0x49e256(0x1b0)]>0x0&&(console[_0x49e256(0x1f9)](a14_0x1be419['bold'](_0x49e256(0x1a1))),printSchemaFields(_0x583f54,0x0),_0x2239a0=!![]);}catch{const _0x4f0af4=_0x35ca3a[_0x49e256(0x18f)](_0x104f28=>!_0x104f28[_0x49e256(0x1be)]);_0x4f0af4['length']>0x0&&(console[_0x49e256(0x1f9)](a14_0x1be419[_0x49e256(0x1db)](_0x49e256(0x1a1))),printMetadataSettings(_0x4f0af4),_0x2239a0=!![]);}!_0x2239a0&&_0x4bfc4f[_0x49e256(0x19e)]&&console[_0x49e256(0x1a2)](a14_0x1be419[_0x49e256(0x1f7)]('No\x20available\x20fields\x20for\x20this\x20connector')),_0x6ab98b[_0x49e256(0x1b0)]===0x0&&console[_0x49e256(0x1f9)](a14_0x1be419['dim'](_0x49e256(0x1d6)));}return 0x0;}}function printMetadataSettings(_0x474ff){const _0x1326c0=a14_0x196d7a;for(const _0x254007 of _0x474ff){if(!_0x254007['name'])continue;if(_0x254007['hidden'])continue;let _0x25b446='\x20\x20'+a14_0x1be419[_0x1326c0(0x1bd)](_0x254007[_0x1326c0(0x1bb)]);_0x254007[_0x1326c0(0x1f4)]&&(_0x25b446+=':\x20'+_0x254007[_0x1326c0(0x1f4)]);_0x254007[_0x1326c0(0x1da)]&&(_0x25b446+=a14_0x1be419[_0x1326c0(0x1f7)]('\x20['+_0x254007[_0x1326c0(0x1da)]+']'));console['log'](_0x25b446);_0x254007[_0x1326c0(0x1ea)]&&console[_0x1326c0(0x1f9)](_0x1326c0(0x1aa)+a14_0x1be419[_0x1326c0(0x1f7)](_0x254007[_0x1326c0(0x1ea)]));if(_0x254007[_0x1326c0(0x1e7)]){const _0x3e3f0b=_0x254007[_0x1326c0(0x1e7)][_0x1326c0(0x1a3)](_0x4b3ad1=>_0x4b3ad1[_0x1326c0(0x1e9)])[_0x1326c0(0x1de)](',\x20');console['log']('\x20\x20\x20\x20Options:\x20'+a14_0x1be419[_0x1326c0(0x197)](_0x3e3f0b));}_0x254007['default_value']!==undefined&&_0x254007[_0x1326c0(0x1c3)]!==null&&console['log'](_0x1326c0(0x1bc)+a14_0x1be419[_0x1326c0(0x1a5)](String(_0x254007['default_value'])));if(_0x254007[_0x1326c0(0x1d2)]){const _0x414d7a=Object[_0x1326c0(0x1f1)](_0x254007[_0x1326c0(0x1d2)])['map'](([_0x3f0ae4,_0x26d779])=>_0x3f0ae4+'='+JSON[_0x1326c0(0x19b)](_0x26d779))[_0x1326c0(0x1de)](',\x20');console[_0x1326c0(0x1f9)](_0x1326c0(0x1aa)+a14_0x1be419[_0x1326c0(0x1f7)](_0x1326c0(0x1a9)+_0x414d7a));}}}
@@ -1 +1 @@
1
- const a15_0x456f92=a15_0x5b5b;function a15_0x2eb0(){const _0x34e55c=['✔\x20Found\x20','Error:\x20','length','message','\x20\x20Cause:\x20','Listing\x20databases...','1010SuoNLe','6secwFK','limit','3910925YxjHoQ','description','List\x20all\x20databases','14NnbvwV','database_name','query','9ZPubuL','data','2741473yynHhX','64623Yhmrar','3513672UVLZbw','cause','3041577qrxCwc','49654jISbMA','Site:\x20','📦\x20','name','Pattern:\x20','error','site','log','verbose','listDatabases','1102804JixPdA'];a15_0x2eb0=function(){return _0x34e55c;};return a15_0x2eb0();}(function(_0x51c263,_0x1cc89d){const _0x369457=a15_0x5b5b,_0x16ff90=_0x51c263();while(!![]){try{const _0x80fef1=-parseInt(_0x369457(0x1ae))/0x1*(-parseInt(_0x369457(0x1a8))/0x2)+parseInt(_0x369457(0x1ab))/0x3*(-parseInt(_0x369457(0x19b))/0x4)+-parseInt(_0x369457(0x1a5))/0x5*(-parseInt(_0x369457(0x1a3))/0x6)+parseInt(_0x369457(0x1ad))/0x7+parseInt(_0x369457(0x1af))/0x8+-parseInt(_0x369457(0x1b1))/0x9+-parseInt(_0x369457(0x1a2))/0xa*(parseInt(_0x369457(0x1b2))/0xb);if(_0x80fef1===_0x1cc89d)break;else _0x16ff90['push'](_0x16ff90['shift']());}catch(_0x54230b){_0x16ff90['push'](_0x16ff90['shift']());}}}(a15_0x2eb0,0x6c808));function a15_0x5b5b(_0x45fca,_0x2a9f76){_0x45fca=_0x45fca-0x199;const _0x2eb097=a15_0x2eb0();let _0x5b5b4c=_0x2eb097[_0x45fca];return _0x5b5b4c;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}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{[a15_0x456f92(0x1b5)]='databases';[a15_0x456f92(0x1a6)]=a15_0x456f92(0x1a7);async['execute'](_0x406987){const _0x2f6171=a15_0x456f92,{options:_0x4ce7d4,args:_0x109f72,tdx:_0x2914fb}=_0x406987,_0xa0374a=_0x109f72[0x0];try{_0x4ce7d4[_0x2f6171(0x199)]&&(console[_0x2f6171(0x1b7)](_0x2f6171(0x1b3)+_0x4ce7d4[_0x2f6171(0x1b8)]),_0xa0374a&&console[_0x2f6171(0x1b7)](_0x2f6171(0x1b6)+_0xa0374a));const _0xd3a13a=resolveLimit(_0x4ce7d4[_0x2f6171(0x1a4)],DEFAULT_LISTING_LIMIT),_0x1acd6d=await withSpinner(_0x2f6171(0x1a1),()=>_0x2914fb[_0x2f6171(0x1aa)][_0x2f6171(0x19a)](_0xa0374a,_0xd3a13a),{'verbose':_0x4ce7d4[_0x2f6171(0x199)]}),_0x25f994=_0x1acd6d[_0x2f6171(0x1ac)];console[_0x2f6171(0x1b7)](_0x2f6171(0x19c)+_0x25f994[_0x2f6171(0x19e)]+'\x20database'+(_0x25f994[_0x2f6171(0x19e)]!==0x1?'s':''));if(isStructuredFormat(_0x4ce7d4))await handleSDKOutput(_0x25f994,{..._0x4ce7d4,'limit':_0xd3a13a});else for(const _0x770dc2 of _0x25f994){console[_0x2f6171(0x1b9)](_0x2f6171(0x1b4)+_0x770dc2[_0x2f6171(0x1a9)]);}return 0x0;}catch(_0x51e246){if(_0x51e246 instanceof SDKError)return console['error'](_0x2f6171(0x19d)+_0x51e246[_0x2f6171(0x19f)]),_0x51e246['cause']&&console[_0x2f6171(0x1b7)](_0x2f6171(0x1a0)+_0x51e246[_0x2f6171(0x1b0)]),0x1;throw _0x51e246;}}}
1
+ const a15_0x233d06=a15_0x2d5b;(function(_0x317b0f,_0x874a9){const _0x49c56f=a15_0x2d5b,_0x2a3edf=_0x317b0f();while(!![]){try{const _0x525bdd=parseInt(_0x49c56f(0x187))/0x1*(parseInt(_0x49c56f(0x19c))/0x2)+parseInt(_0x49c56f(0x1a3))/0x3+parseInt(_0x49c56f(0x190))/0x4*(-parseInt(_0x49c56f(0x19b))/0x5)+-parseInt(_0x49c56f(0x196))/0x6*(-parseInt(_0x49c56f(0x1a0))/0x7)+-parseInt(_0x49c56f(0x19f))/0x8*(parseInt(_0x49c56f(0x192))/0x9)+-parseInt(_0x49c56f(0x1a1))/0xa+parseInt(_0x49c56f(0x1a2))/0xb*(parseInt(_0x49c56f(0x18e))/0xc);if(_0x525bdd===_0x874a9)break;else _0x2a3edf['push'](_0x2a3edf['shift']());}catch(_0x144003){_0x2a3edf['push'](_0x2a3edf['shift']());}}}(a15_0x13c8,0xf0b30));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a15_0x13c8(){const _0x73414=['📦\x20','1160YjHXmk','7926FhMufF','\x20database','message','8gafsOW','9583BtsgqV','19319310XvfjYA','5264897YkWOTp','3670188BwTttz','236nSamVO','log','cause','site','databases','length','name','36FuZwjA','Error:\x20','11252mKrxzN','listDatabases','5896827Fghmyf','List\x20all\x20databases','verbose','✔\x20Found\x20','2766GiYyRx','description','error','execute'];a15_0x13c8=function(){return _0x73414;};return a15_0x13c8();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a15_0x2d5b(_0x18005c,_0x16f9fb){_0x18005c=_0x18005c-0x187;const _0x13c85b=a15_0x13c8();let _0x2d5b2a=_0x13c85b[_0x18005c];return _0x2d5b2a;}export class DatabasesCommand extends BaseCommand{[a15_0x233d06(0x18d)]=a15_0x233d06(0x18b);[a15_0x233d06(0x197)]=a15_0x233d06(0x193);async[a15_0x233d06(0x199)](_0xdff259){const _0x237be2=a15_0x233d06,{options:_0x382588,args:_0x2de71b,tdx:_0x20293c}=_0xdff259,_0x5a2211=_0x2de71b[0x0];try{_0x382588[_0x237be2(0x194)]&&(console['error']('Site:\x20'+_0x382588[_0x237be2(0x18a)]),_0x5a2211&&console[_0x237be2(0x198)]('Pattern:\x20'+_0x5a2211));const _0x4d7aba=resolveLimit(_0x382588['limit'],DEFAULT_LISTING_LIMIT),_0xe9ebd7=await withSpinner('Listing\x20databases...',()=>_0x20293c['query'][_0x237be2(0x191)](_0x5a2211,_0x4d7aba),{'verbose':_0x382588[_0x237be2(0x194)]}),_0x3820f7=_0xe9ebd7['data'];console['error'](_0x237be2(0x195)+_0x3820f7['length']+_0x237be2(0x19d)+(_0x3820f7[_0x237be2(0x18c)]!==0x1?'s':''));if(isStructuredFormat(_0x382588))await handleSDKOutput(_0x3820f7,{..._0x382588,'limit':_0x4d7aba});else for(const _0x4ca7f4 of _0x3820f7){console[_0x237be2(0x188)](_0x237be2(0x19a)+_0x4ca7f4['database_name']);}return 0x0;}catch(_0x57da83){if(_0x57da83 instanceof SDKError)return console['error'](_0x237be2(0x18f)+_0x57da83[_0x237be2(0x19e)]),_0x57da83['cause']&&console[_0x237be2(0x198)]('\x20\x20Cause:\x20'+_0x57da83[_0x237be2(0x189)]),0x1;throw _0x57da83;}}}
@@ -1 +1 @@
1
- const a16_0x199888=a16_0x99dd;function a16_0x99dd(_0x475952,_0xfd2f7f){_0x475952=_0x475952-0xc6;const _0x4b8a00=a16_0x4b8a();let _0x99dd3e=_0x4b8a00[_0x475952];return _0x99dd3e;}(function(_0x23b89f,_0x56054b){const _0x59889f=a16_0x99dd,_0x320371=_0x23b89f();while(!![]){try{const _0x2400e9=-parseInt(_0x59889f(0xcc))/0x1+-parseInt(_0x59889f(0xc6))/0x2+-parseInt(_0x59889f(0xd4))/0x3+-parseInt(_0x59889f(0xc8))/0x4+-parseInt(_0x59889f(0xd8))/0x5*(-parseInt(_0x59889f(0xd1))/0x6)+parseInt(_0x59889f(0xd3))/0x7+parseInt(_0x59889f(0xc9))/0x8*(parseInt(_0x59889f(0xca))/0x9);if(_0x2400e9===_0x56054b)break;else _0x320371['push'](_0x320371['shift']());}catch(_0x29abd3){_0x320371['push'](_0x320371['shift']());}}}(a16_0x4b8a,0x8d899));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{resolveWorkspaceIdFromOptions}from'./engage-command.js';function a16_0x4b8a(){const _0x47de64=['filter','name','334780QgpEGL','985460CdIDku','List\x20email\x20senders','2771412KmCtZz','15862480KxFKQp','9uSeHIs','description','1079126wYxzMA','Fetching\x20email\x20senders...','limit','listEmailSenders','data','96KKPKxk','verbose','1304303eJvcGd','1187967PQloTQ','delivery'];a16_0x4b8a=function(){return _0x47de64;};return a16_0x4b8a();}import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{[a16_0x199888(0xd7)]='delivery:senders';[a16_0x199888(0xcb)]=a16_0x199888(0xc7);async['execute'](_0x2f3991){const _0x1407b1=a16_0x199888,{options:_0x41d20c,args:_0x2a4d06,tdx:_0x18fc8f}=_0x2f3991,_0x4562c2=_0x2a4d06[0x0],_0x4df463=resolveLimit(_0x41d20c[_0x1407b1(0xce)],DEFAULT_LLM_LIMIT),_0x3dbe36=_0x41d20c,_0x3c2e6b=await resolveWorkspaceIdFromOptions(_0x3dbe36,_0x18fc8f),_0x851894=await withSpinner(_0x1407b1(0xcd),()=>_0x18fc8f[_0x1407b1(0xd5)][_0x1407b1(0xcf)]({'workspaceId':_0x3c2e6b,'limit':_0x4df463}),{'verbose':_0x41d20c[_0x1407b1(0xd2)]});let _0x53d3e9=_0x851894['data'];return _0x4562c2&&(_0x53d3e9=_0x851894[_0x1407b1(0xd0)][_0x1407b1(0xd6)](_0x25a37d=>matchGlobPattern(_0x25a37d[_0x1407b1(0xd7)],_0x4562c2))),await handleSDKOutput(_0x53d3e9,_0x41d20c),0x0;}}
1
+ function a16_0x49a2(_0x3edb75,_0x2a8779){_0x3edb75=_0x3edb75-0x1b7;const _0xfb5e7f=a16_0xfb5e();let _0x49a29c=_0xfb5e7f[_0x3edb75];return _0x49a29c;}const a16_0x575557=a16_0x49a2;function a16_0xfb5e(){const _0x29a142=['47865nAbbId','Fetching\x20email\x20senders...','data','limit','listEmailSenders','56Mwnyxj','description','35wkVCug','4842WwUzyv','verbose','126934VClkeU','delivery:senders','name','244404gKqOTn','1475112VwIyxM','138258SWcxce','execute','281860yfFfZJ','delivery'];a16_0xfb5e=function(){return _0x29a142;};return a16_0xfb5e();}(function(_0x117196,_0x46b827){const _0x523293=a16_0x49a2,_0x4e1740=_0x117196();while(!![]){try{const _0x477ade=parseInt(_0x523293(0x1c5))/0x1+-parseInt(_0x523293(0x1b9))/0x2+parseInt(_0x523293(0x1c8))/0x3+parseInt(_0x523293(0x1c0))/0x4*(-parseInt(_0x523293(0x1bb))/0x5)+parseInt(_0x523293(0x1c3))/0x6*(parseInt(_0x523293(0x1c2))/0x7)+parseInt(_0x523293(0x1c9))/0x8+-parseInt(_0x523293(0x1b7))/0x9;if(_0x477ade===_0x46b827)break;else _0x4e1740['push'](_0x4e1740['shift']());}catch(_0x1d7384){_0x4e1740['push'](_0x4e1740['shift']());}}}(a16_0xfb5e,0x1a010));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{[a16_0x575557(0x1c7)]=a16_0x575557(0x1c6);[a16_0x575557(0x1c1)]='List\x20email\x20senders';async[a16_0x575557(0x1b8)](_0x1ca94e){const _0x2e8e44=a16_0x575557,{options:_0x28441b,args:_0x3415d3,tdx:_0x125337}=_0x1ca94e,_0x17a7a5=_0x3415d3[0x0],_0x195b51=resolveLimit(_0x28441b[_0x2e8e44(0x1be)],DEFAULT_LLM_LIMIT),_0x2a6798=_0x28441b,_0x3d08d1=await resolveWorkspaceIdFromOptions(_0x2a6798,_0x125337),_0x5b41f0=await withSpinner(_0x2e8e44(0x1bc),()=>_0x125337[_0x2e8e44(0x1ba)][_0x2e8e44(0x1bf)]({'workspaceId':_0x3d08d1,'limit':_0x195b51}),{'verbose':_0x28441b[_0x2e8e44(0x1c4)]});let _0x50e29f=_0x5b41f0[_0x2e8e44(0x1bd)];return _0x17a7a5&&(_0x50e29f=_0x5b41f0[_0x2e8e44(0x1bd)]['filter'](_0x4a7a57=>matchGlobPattern(_0x4a7a57[_0x2e8e44(0x1c7)],_0x17a7a5))),await handleSDKOutput(_0x50e29f,_0x28441b),0x0;}}
@@ -1 +1 @@
1
- const a17_0x402eb9=a17_0x299c;(function(_0x243fd6,_0xcb8721){const _0x548891=a17_0x299c,_0x10518c=_0x243fd6();while(!![]){try{const _0x5e6830=parseInt(_0x548891(0x17c))/0x1*(parseInt(_0x548891(0x190))/0x2)+parseInt(_0x548891(0x17d))/0x3+-parseInt(_0x548891(0x17f))/0x4*(parseInt(_0x548891(0x174))/0x5)+-parseInt(_0x548891(0x180))/0x6*(parseInt(_0x548891(0x185))/0x7)+parseInt(_0x548891(0x189))/0x8*(parseInt(_0x548891(0x195))/0x9)+parseInt(_0x548891(0x194))/0xa+parseInt(_0x548891(0x199))/0xb;if(_0x5e6830===_0xcb8721)break;else _0x10518c['push'](_0x10518c['shift']());}catch(_0x6754b5){_0x10518c['push'](_0x10518c['shift']());}}}(a17_0x2ecc,0x9e7e5));import{BaseCommand}from'./command.js';function a17_0x299c(_0x1110e5,_0x2d7fff){_0x1110e5=_0x1110e5-0x173;const _0x2ecc40=a17_0x2ecc();let _0x299c14=_0x2ecc40[_0x1110e5];return _0x299c14;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a17_0x2ecc(){const _0xe482c9=['query','site','\x20in\x20','Describing\x20table\x20','21952GnAYjg','args','execute','data','2399640xnPOEp','9325863BBeSuB','\x20column','Table\x20\x27','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','2752651beUxjW','message','1095QAVETn','...','\x20\x20Cause:\x20','description','cause','✖\x20Table\x20not\x20found','✔\x20Found\x20','table','2UAUqGC','1044573pbgEKz','length','7048xtWVFg','1292232QoZJUn','Error:\x20','describe','error','database','28pRQrjD','name','validate','Site:\x20','8pFBYSh','describeTable','Database:\x20'];a17_0x2ecc=function(){return _0xe482c9;};return a17_0x2ecc();}export class DescribeCommand extends BaseCommand{[a17_0x402eb9(0x186)]=a17_0x402eb9(0x182);[a17_0x402eb9(0x177)]='Describe\x20table\x20schema';async[a17_0x402eb9(0x192)](_0x414b7b){return this['describeTable'](_0x414b7b);}async[a17_0x402eb9(0x18a)](_0x315a6c){const _0x589c74=a17_0x402eb9,{options:_0x5741c7,args:_0x5ca226,tdx:_0x16a490}=_0x315a6c;let _0x5e18df;try{_0x5e18df=parseTableReference(_0x5ca226[0x0]);const _0x672943=_0x5741c7[_0x589c74(0x184)];!_0x5e18df[_0x589c74(0x184)]&&_0x672943&&(_0x5e18df[_0x589c74(0x184)]=_0x672943);const _0x2d7ecd=validateTableDescribeReference(_0x5e18df);if(_0x2d7ecd)return console['error'](_0x589c74(0x181)+_0x2d7ecd),0x1;}catch(_0x11682b){return console[_0x589c74(0x183)](_0x589c74(0x181)+_0x11682b[_0x589c74(0x173)]),0x1;}const _0x46f4cd=_0x5e18df[_0x589c74(0x184)],_0x3ed0ac=_0x5e18df[_0x589c74(0x17b)];try{_0x5741c7['verbose']&&(console[_0x589c74(0x183)](_0x589c74(0x188)+_0x5741c7[_0x589c74(0x18d)]),console[_0x589c74(0x183)](_0x589c74(0x18b)+_0x46f4cd),console[_0x589c74(0x183)]('Table:\x20'+_0x3ed0ac));const _0x2d3bd7=await withSpinner(_0x589c74(0x18f)+_0x46f4cd+'.'+_0x3ed0ac+_0x589c74(0x175),()=>_0x16a490[_0x589c74(0x18c)]['describeTable'](_0x46f4cd,_0x3ed0ac),{'verbose':_0x5741c7['verbose']}),_0x2c69bb=_0x2d3bd7[_0x589c74(0x193)];if(_0x2c69bb[_0x589c74(0x17e)]===0x0)return console[_0x589c74(0x183)](_0x589c74(0x179)),console[_0x589c74(0x183)](_0x589c74(0x197)+_0x46f4cd+'.'+_0x3ed0ac+'\x27\x20does\x20not\x20exist'),0x1;return console['error'](_0x589c74(0x17a)+_0x2c69bb[_0x589c74(0x17e)]+_0x589c74(0x196)+(_0x2c69bb[_0x589c74(0x17e)]!==0x1?'s':'')+_0x589c74(0x18e)+_0x46f4cd+'.'+_0x3ed0ac),await handleSDKOutput(_0x2c69bb,_0x5741c7),0x0;}catch(_0x480fe){if(_0x480fe instanceof SDKError)return console[_0x589c74(0x183)](_0x589c74(0x181)+_0x480fe[_0x589c74(0x173)]),_0x480fe[_0x589c74(0x178)]&&console[_0x589c74(0x183)](_0x589c74(0x176)+_0x480fe[_0x589c74(0x178)]),0x1;throw _0x480fe;}}[a17_0x402eb9(0x187)](_0x36f5c0){const _0xda34fe=a17_0x402eb9;if(_0x36f5c0[_0xda34fe(0x191)][_0xda34fe(0x17e)]===0x0)return _0xda34fe(0x198);if(_0x36f5c0[_0xda34fe(0x191)][_0xda34fe(0x17e)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';return undefined;}}
1
+ const a17_0x18a46a=a17_0x107c;(function(_0x535c1a,_0x5b2d14){const _0x141b36=a17_0x107c,_0x876216=_0x535c1a();while(!![]){try{const _0x17264d=parseInt(_0x141b36(0x1f6))/0x1*(parseInt(_0x141b36(0x1de))/0x2)+-parseInt(_0x141b36(0x1e0))/0x3+parseInt(_0x141b36(0x1e9))/0x4+-parseInt(_0x141b36(0x1dc))/0x5*(-parseInt(_0x141b36(0x1ff))/0x6)+-parseInt(_0x141b36(0x1df))/0x7+parseInt(_0x141b36(0x1e4))/0x8+parseInt(_0x141b36(0x1eb))/0x9*(-parseInt(_0x141b36(0x1e7))/0xa);if(_0x17264d===_0x5b2d14)break;else _0x876216['push'](_0x876216['shift']());}catch(_0x42f942){_0x876216['push'](_0x876216['shift']());}}}(a17_0x27ff,0xe25f1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a17_0x27ff(){const _0x5be886=['✖\x20Table\x20not\x20found','1269801sLhLfn','Table\x20\x27','length','Table:\x20','Site:\x20','\x20in\x20','describe','\x20\x20Cause:\x20','\x27\x20does\x20not\x20exist','Describing\x20table\x20','table','1RpYnTC','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','description','error','cause','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','database','name','message','306GgWZAW','execute','72095wPcxtk','Database:\x20','2443726IAcAal','11875367rjkAzY','323523dZZBpY','verbose','✔\x20Found\x20','...','7448048DvuWWO','Error:\x20','describeTable','60IbmSGy','args','2759340fFkdtu'];a17_0x27ff=function(){return _0x5be886;};return a17_0x27ff();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a17_0x107c(_0x171438,_0x3a6f6d){_0x171438=_0x171438-0x1dc;const _0x27ffa4=a17_0x27ff();let _0x107c9c=_0x27ffa4[_0x171438];return _0x107c9c;}export class DescribeCommand extends BaseCommand{[a17_0x18a46a(0x1fd)]=a17_0x18a46a(0x1f1);[a17_0x18a46a(0x1f8)]='Describe\x20table\x20schema';async[a17_0x18a46a(0x200)](_0x1370ea){const _0x157227=a17_0x18a46a;return this[_0x157227(0x1e6)](_0x1370ea);}async['describeTable'](_0x4f365a){const _0x337e91=a17_0x18a46a,{options:_0x3dbcd1,args:_0x4bb06e,tdx:_0x3bf1a1}=_0x4f365a;let _0x478e84;try{_0x478e84=parseTableReference(_0x4bb06e[0x0]);const _0x5bdde8=_0x3dbcd1['database'];!_0x478e84[_0x337e91(0x1fc)]&&_0x5bdde8&&(_0x478e84[_0x337e91(0x1fc)]=_0x5bdde8);const _0x1bc99d=validateTableDescribeReference(_0x478e84);if(_0x1bc99d)return console[_0x337e91(0x1f9)](_0x337e91(0x1e5)+_0x1bc99d),0x1;}catch(_0x497172){return console[_0x337e91(0x1f9)](_0x337e91(0x1e5)+_0x497172[_0x337e91(0x1fe)]),0x1;}const _0x537570=_0x478e84[_0x337e91(0x1fc)],_0x30a9c0=_0x478e84[_0x337e91(0x1f5)];try{_0x3dbcd1['verbose']&&(console[_0x337e91(0x1f9)](_0x337e91(0x1ef)+_0x3dbcd1['site']),console[_0x337e91(0x1f9)](_0x337e91(0x1dd)+_0x537570),console['error'](_0x337e91(0x1ee)+_0x30a9c0));const _0x2c32e4=await withSpinner(_0x337e91(0x1f4)+_0x537570+'.'+_0x30a9c0+_0x337e91(0x1e3),()=>_0x3bf1a1['query'][_0x337e91(0x1e6)](_0x537570,_0x30a9c0),{'verbose':_0x3dbcd1[_0x337e91(0x1e1)]}),_0x271071=_0x2c32e4['data'];if(_0x271071['length']===0x0)return console[_0x337e91(0x1f9)](_0x337e91(0x1ea)),console[_0x337e91(0x1f9)](_0x337e91(0x1ec)+_0x537570+'.'+_0x30a9c0+_0x337e91(0x1f3)),0x1;return console['error'](_0x337e91(0x1e2)+_0x271071[_0x337e91(0x1ed)]+'\x20column'+(_0x271071[_0x337e91(0x1ed)]!==0x1?'s':'')+_0x337e91(0x1f0)+_0x537570+'.'+_0x30a9c0),await handleSDKOutput(_0x271071,_0x3dbcd1),0x0;}catch(_0xd317b4){if(_0xd317b4 instanceof SDKError)return console['error'](_0x337e91(0x1e5)+_0xd317b4[_0x337e91(0x1fe)]),_0xd317b4[_0x337e91(0x1fa)]&&console[_0x337e91(0x1f9)](_0x337e91(0x1f2)+_0xd317b4[_0x337e91(0x1fa)]),0x1;throw _0xd317b4;}}['validate'](_0x22199a){const _0x2cb7fa=a17_0x18a46a;if(_0x22199a[_0x2cb7fa(0x1e8)][_0x2cb7fa(0x1ed)]===0x0)return _0x2cb7fa(0x1fb);if(_0x22199a[_0x2cb7fa(0x1e8)][_0x2cb7fa(0x1ed)]>0x1)return _0x2cb7fa(0x1f7);return undefined;}}
@@ -1 +1 @@
1
- const a18_0x1c2f53=a18_0x2d03;function a18_0x434f(){const _0x4d0915=['config','98YBcmdy','\x20unchanged\x20files','\x20changed\x20files','content','length','name','workspace','140NEXcAG','verbose','red','384064kxvYEo','\x20\x20Target:\x20','\x20files?','Pull\x20campaigns\x20to\x20YAML\x20files','green','engage_workspace','63uSKdSt','engage:campaign:pull','\x20campaigns','2686293IcInIw','files','-\x20no\x20files\x20written','1468722lNKQPd','61795hPIGRc','Aborted.','description','campaigns','filter','✔\x20All\x20files\x20are\x20up\x20to\x20date','utf-8','29646419bzYdvi','data','yes','\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>','\x0aPull\x20summary\x20for\x20workspace\x20\x27','repeat','216DLDaAJ','absolutePath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','error','\x20new\x20files','cyan','diff','segment','1602830QzuvNX','\x20=\x20','\x27...','workspaceName','engage','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','counts','hasChanges','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','isNew','\x20files\x20to\x20','session','yellow','dryRun','targetDir','dim','2521TIrycN','setPhase','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'];a18_0x434f=function(){return _0x4d0915;};return a18_0x434f();}(function(_0x4ac498,_0x23b0a4){const _0x4ccd5f=a18_0x2d03,_0x472b2a=_0x4ac498();while(!![]){try{const _0x59052b=-parseInt(_0x4ccd5f(0xbd))/0x1*(-parseInt(_0x4ccd5f(0xc8))/0x2)+-parseInt(_0x4ccd5f(0xd4))/0x3+-parseInt(_0x4ccd5f(0xe5))/0x4*(-parseInt(_0x4ccd5f(0xd8))/0x5)+-parseInt(_0x4ccd5f(0xd7))/0x6+-parseInt(_0x4ccd5f(0xc1))/0x7*(parseInt(_0x4ccd5f(0xcb))/0x8)+parseInt(_0x4ccd5f(0xd1))/0x9*(-parseInt(_0x4ccd5f(0xad))/0xa)+parseInt(_0x4ccd5f(0xdf))/0xb;if(_0x59052b===_0x23b0a4)break;else _0x472b2a['push'](_0x472b2a['shift']());}catch(_0x58ee33){_0x472b2a['push'](_0x472b2a['shift']());}}}(a18_0x434f,0x93a02));function a18_0x2d03(_0x1499ef,_0x3546fb){_0x1499ef=_0x1499ef-0xaa;const _0x434f23=a18_0x434f();let _0x2d03d8=_0x434f23[_0x1499ef];return _0x2d03d8;}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 a18_0x33adef from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a18_0x5da8c6 from'path';import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{[a18_0x1c2f53(0xc6)]=a18_0x1c2f53(0xd2);[a18_0x1c2f53(0xda)]=a18_0x1c2f53(0xce);async['execute'](_0x3c3cf6){const _0x43b5f5=a18_0x1c2f53,{options:_0x1903a3,args:_0xcdd076,tdx:_0x3d4aa6}=_0x3c3cf6,_0x5628f9=_0x1903a3,_0xbb81fc=await resolveWorkspaceName(_0xcdd076[0x0],_0x5628f9);if(!_0xbb81fc)return console[_0x43b5f5(0xe8)](a18_0x33adef[_0x43b5f5(0xb9)]('Workspace\x20is\x20required.')),console[_0x43b5f5(0xe8)](_0x43b5f5(0xe2)),console[_0x43b5f5(0xe8)](_0x43b5f5(0xb2)),console[_0x43b5f5(0xe8)](_0x43b5f5(0xbf)),0x1;const _0x17470d=await withProgressSpinner('Pulling\x20campaigns\x20from\x20\x27'+_0xbb81fc+_0x43b5f5(0xaf),_0x14749b=>pullCampaigns({'engage':_0x3d4aa6[_0x43b5f5(0xb1)],'segment':_0x3d4aa6[_0x43b5f5(0xac)]},_0xbb81fc,{'campaignName':_0x5628f9[_0x43b5f5(0xc6)],'campaignType':_0x5628f9['type'],'progress':{'update':_0x20ffa1=>{const _0x467195=_0x43b5f5;_0x14749b[_0x467195(0xbe)](_0x20ffa1);}}}),{'verbose':_0x5628f9[_0x43b5f5(0xc9)]}),_0x49a4dc=_0x17470d[_0x43b5f5(0xe0)];if(_0x49a4dc[_0x43b5f5(0xb3)][_0x43b5f5(0xdb)]===0x0)return console[_0x43b5f5(0xe8)](a18_0x33adef['yellow'](_0x43b5f5(0xb5)+_0x49a4dc['workspaceName']+'\x27')),0x0;const _0x45cd55=_0x49a4dc[_0x43b5f5(0xd5)][_0x43b5f5(0xdc)](_0x52ab64=>_0x52ab64[_0x43b5f5(0xb6)]),_0x4e14d6=_0x49a4dc[_0x43b5f5(0xd5)][_0x43b5f5(0xdc)](_0xc263ee=>!_0xc263ee['isNew']&&_0xc263ee[_0x43b5f5(0xb4)]),_0x2470b3=_0x49a4dc[_0x43b5f5(0xd5)][_0x43b5f5(0xdc)](_0x2b5934=>!_0x2b5934[_0x43b5f5(0xb6)]&&!_0x2b5934['hasChanges']);console[_0x43b5f5(0xe8)](_0x43b5f5(0xe3)+_0x49a4dc[_0x43b5f5(0xb0)]+'\x27:'),console['error']('\x20\x20'+a18_0x33adef[_0x43b5f5(0xaa)](_0x49a4dc[_0x43b5f5(0xb3)][_0x43b5f5(0xdb)]+_0x43b5f5(0xd3))),console[_0x43b5f5(0xe8)]('\x20\x20'+a18_0x33adef[_0x43b5f5(0xcf)]('+\x20'+_0x45cd55['length']+_0x43b5f5(0xe9))),console['error']('\x20\x20'+a18_0x33adef[_0x43b5f5(0xb9)]('~\x20'+_0x4e14d6[_0x43b5f5(0xc5)]+_0x43b5f5(0xc3))),console['error']('\x20\x20'+a18_0x33adef[_0x43b5f5(0xbc)]('=\x20'+_0x2470b3[_0x43b5f5(0xc5)]+_0x43b5f5(0xc2))),console[_0x43b5f5(0xe8)](_0x43b5f5(0xcc)+a18_0x33adef[_0x43b5f5(0xaa)](_0x49a4dc[_0x43b5f5(0xbb)])+'\x0a');if(_0x4e14d6[_0x43b5f5(0xc5)]>0x0)for(const _0x2a9f11 of _0x4e14d6){console['error']('\x0aChanges\x20to\x20\x27'+_0x2a9f11['relativePath']+'\x27:'),console[_0x43b5f5(0xe8)]('─'[_0x43b5f5(0xe4)](0x3c)),console[_0x43b5f5(0xe8)](_0x2a9f11[_0x43b5f5(0xab)]),console[_0x43b5f5(0xe8)]('─'[_0x43b5f5(0xe4)](0x3c));}if(_0x5628f9[_0x43b5f5(0xba)])return console['error'](a18_0x33adef[_0x43b5f5(0xb9)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x45cd55[_0x43b5f5(0xc5)]===0x0&&_0x4e14d6[_0x43b5f5(0xc5)]===0x0)return console[_0x43b5f5(0xe8)](a18_0x33adef[_0x43b5f5(0xcf)](_0x43b5f5(0xdd))),saveSessionContext({'engage_workspace':_0x49a4dc[_0x43b5f5(0xb0)]},_0x5628f9[_0x43b5f5(0xb8)]),0x0;if(!_0x5628f9[_0x43b5f5(0xe1)]){if(!isInteractive())return console['error'](a18_0x33adef[_0x43b5f5(0xca)]('\x0aError:'),_0x43b5f5(0xe7)),console['error'](a18_0x33adef[_0x43b5f5(0xbc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x160242=await confirmKey('Write\x20'+(_0x45cd55['length']+_0x4e14d6[_0x43b5f5(0xc5)])+_0x43b5f5(0xcd));if(!_0x160242)return console[_0x43b5f5(0xe8)](a18_0x33adef[_0x43b5f5(0xb9)](_0x43b5f5(0xd9)),_0x43b5f5(0xd6)),0x1;}for(const _0x5e4d90 of _0x49a4dc[_0x43b5f5(0xd5)]){if(_0x5e4d90[_0x43b5f5(0xb6)]||_0x5e4d90[_0x43b5f5(0xb4)]){const _0x1ef4d6=a18_0x5da8c6['dirname'](_0x5e4d90[_0x43b5f5(0xe6)]);!existsSync(_0x1ef4d6)&&mkdirSync(_0x1ef4d6,{'recursive':!![]}),writeFileSync(_0x5e4d90[_0x43b5f5(0xe6)],_0x5e4d90[_0x43b5f5(0xc4)],_0x43b5f5(0xde));}}return console['error'](a18_0x33adef[_0x43b5f5(0xcf)]('✔\x20Pulled\x20'+(_0x45cd55[_0x43b5f5(0xc5)]+_0x4e14d6['length'])+_0x43b5f5(0xb7)+_0x49a4dc[_0x43b5f5(0xbb)])),saveSessionContext({'engage_workspace':_0x49a4dc[_0x43b5f5(0xb0)]},_0x5628f9[_0x43b5f5(0xb8)]),console['error'](a18_0x33adef[_0x43b5f5(0xcf)]('✔\x20Context\x20set:\x20'+a18_0x33adef[_0x43b5f5(0xbc)](_0x43b5f5(0xd0))+_0x43b5f5(0xae)+a18_0x33adef[_0x43b5f5(0xaa)](_0x49a4dc[_0x43b5f5(0xb0)]))),0x0;}}async function resolveWorkspaceName(_0x495c93,_0x48fd4c){const _0x4c9e58=a18_0x1c2f53;if(_0x495c93)return _0x495c93;if(_0x48fd4c[_0x4c9e58(0xc7)])return _0x48fd4c[_0x4c9e58(0xc7)];const _0x110f61=tryFindTdxConfig(process['cwd']());if(_0x110f61?.[_0x4c9e58(0xc0)][_0x4c9e58(0xd0)])return _0x110f61['config']['engage_workspace'];const _0x4779d7=loadSessionContext(_0x48fd4c[_0x4c9e58(0xb8)]);if(_0x4779d7?.[_0x4c9e58(0xd0)])return _0x4779d7[_0x4c9e58(0xd0)];return undefined;}
1
+ const a18_0x38f58b=a18_0x2286;(function(_0x1768b9,_0x190853){const _0x3f46fe=a18_0x2286,_0x43e52e=_0x1768b9();while(!![]){try{const _0x13efed=parseInt(_0x3f46fe(0xd9))/0x1+parseInt(_0x3f46fe(0x9f))/0x2*(-parseInt(_0x3f46fe(0xb1))/0x3)+parseInt(_0x3f46fe(0xab))/0x4*(-parseInt(_0x3f46fe(0xd6))/0x5)+-parseInt(_0x3f46fe(0xcd))/0x6*(-parseInt(_0x3f46fe(0xc1))/0x7)+parseInt(_0x3f46fe(0xdd))/0x8*(parseInt(_0x3f46fe(0xd5))/0x9)+-parseInt(_0x3f46fe(0xb4))/0xa+parseInt(_0x3f46fe(0xba))/0xb;if(_0x13efed===_0x190853)break;else _0x43e52e['push'](_0x43e52e['shift']());}catch(_0x32deb8){_0x43e52e['push'](_0x43e52e['shift']());}}}(a18_0x5254,0x8580b));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 a18_0x4812a6 from'chalk';function a18_0x5254(){const _0x27928c=['\x27...','red','session','setPhase','Pull\x20campaigns\x20to\x20YAML\x20files','461298oEgATH','Write\x20','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','verbose','workspace','relativePath','✔\x20Context\x20set:\x20','length','1209789mOZVPA','5KhrkXr','yellow','counts','293268PmvkxR','files','Workspace\x20is\x20required.','hasChanges','64XIARZA','Aborted.','error','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','isNew','\x20=\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','5486LlYCKn','config','-\x20no\x20files\x20written','targetDir','diff','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','repeat','absolutePath','\x20new\x20files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>','dim','1890572eygrPq','engage_workspace','\x20files?','workspaceName','engage','\x0aChanges\x20to\x20\x27','906QqPism','data','engage:campaign:pull','1853000PTgJat','segment','yes','campaigns','filter','content','4772581wUdfLv','\x20changed\x20files','utf-8','name','cyan','type','\x0aPull\x20summary\x20for\x20workspace\x20\x27','21LAJyrk','\x20files\x20to\x20','dirname','dryRun','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20unchanged\x20files','green'];a18_0x5254=function(){return _0x27928c;};return a18_0x5254();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a18_0x2f1e3 from'path';function a18_0x2286(_0x1decde,_0x21e293){_0x1decde=_0x1decde-0x9c;const _0x52547c=a18_0x5254();let _0x228622=_0x52547c[_0x1decde];return _0x228622;}import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{['name']=a18_0x38f58b(0xb3);['description']=a18_0x38f58b(0xcc);async['execute'](_0x470bd9){const _0x50f4b6=a18_0x38f58b,{options:_0x3380b7,args:_0xc04273,tdx:_0x25583f}=_0x470bd9,_0x4644f3=_0x3380b7,_0x351e3e=await resolveWorkspaceName(_0xc04273[0x0],_0x4644f3);if(!_0x351e3e)return console['error'](a18_0x4812a6[_0x50f4b6(0xd7)](_0x50f4b6(0xdb))),console[_0x50f4b6(0xdf)](_0x50f4b6(0xa9)),console[_0x50f4b6(0xdf)](_0x50f4b6(0xa4)),console[_0x50f4b6(0xdf)](_0x50f4b6(0xcf)),0x1;const _0x1c0f5b=await withProgressSpinner('Pulling\x20campaigns\x20from\x20\x27'+_0x351e3e+_0x50f4b6(0xc8),_0x1d1285=>pullCampaigns({'engage':_0x25583f[_0x50f4b6(0xaf)],'segment':_0x25583f[_0x50f4b6(0xb5)]},_0x351e3e,{'campaignName':_0x4644f3[_0x50f4b6(0xbd)],'campaignType':_0x4644f3[_0x50f4b6(0xbf)],'progress':{'update':_0x53adb9=>{const _0x5f45fa=_0x50f4b6;_0x1d1285[_0x5f45fa(0xcb)](_0x53adb9);}}}),{'verbose':_0x4644f3[_0x50f4b6(0xd0)]}),_0x405dba=_0x1c0f5b[_0x50f4b6(0xb2)];if(_0x405dba['counts'][_0x50f4b6(0xb7)]===0x0)return console[_0x50f4b6(0xdf)](a18_0x4812a6['yellow'](_0x50f4b6(0xe0)+_0x405dba['workspaceName']+'\x27')),0x0;const _0x158fce=_0x405dba[_0x50f4b6(0xda)][_0x50f4b6(0xb8)](_0x58fef5=>_0x58fef5[_0x50f4b6(0x9c)]),_0x27ee35=_0x405dba[_0x50f4b6(0xda)][_0x50f4b6(0xb8)](_0xb3a2be=>!_0xb3a2be['isNew']&&_0xb3a2be[_0x50f4b6(0xdc)]),_0x1773a0=_0x405dba['files']['filter'](_0x4f4a44=>!_0x4f4a44['isNew']&&!_0x4f4a44['hasChanges']);console['error'](_0x50f4b6(0xc0)+_0x405dba[_0x50f4b6(0xae)]+'\x27:'),console[_0x50f4b6(0xdf)]('\x20\x20'+a18_0x4812a6[_0x50f4b6(0xbe)](_0x405dba[_0x50f4b6(0xd8)]['campaigns']+'\x20campaigns')),console[_0x50f4b6(0xdf)]('\x20\x20'+a18_0x4812a6[_0x50f4b6(0xc7)]('+\x20'+_0x158fce['length']+_0x50f4b6(0xa7))),console[_0x50f4b6(0xdf)]('\x20\x20'+a18_0x4812a6[_0x50f4b6(0xd7)]('~\x20'+_0x27ee35['length']+_0x50f4b6(0xbb))),console[_0x50f4b6(0xdf)]('\x20\x20'+a18_0x4812a6[_0x50f4b6(0xaa)]('=\x20'+_0x1773a0[_0x50f4b6(0xd4)]+_0x50f4b6(0xc6))),console[_0x50f4b6(0xdf)]('\x20\x20Target:\x20'+a18_0x4812a6[_0x50f4b6(0xbe)](_0x405dba[_0x50f4b6(0xa2)])+'\x0a');if(_0x27ee35[_0x50f4b6(0xd4)]>0x0)for(const _0x269210 of _0x27ee35){console[_0x50f4b6(0xdf)](_0x50f4b6(0xb0)+_0x269210[_0x50f4b6(0xd2)]+'\x27:'),console[_0x50f4b6(0xdf)]('─'[_0x50f4b6(0xa5)](0x3c)),console['error'](_0x269210[_0x50f4b6(0xa3)]),console[_0x50f4b6(0xdf)]('─'[_0x50f4b6(0xa5)](0x3c));}if(_0x4644f3[_0x50f4b6(0xc4)])return console['error'](a18_0x4812a6[_0x50f4b6(0xd7)](_0x50f4b6(0xc5))),0x0;if(_0x158fce['length']===0x0&&_0x27ee35['length']===0x0)return console[_0x50f4b6(0xdf)](a18_0x4812a6[_0x50f4b6(0xc7)](_0x50f4b6(0x9e))),saveSessionContext({'engage_workspace':_0x405dba[_0x50f4b6(0xae)]},_0x4644f3[_0x50f4b6(0xca)]),0x0;if(!_0x4644f3[_0x50f4b6(0xb6)]){if(!isInteractive())return console[_0x50f4b6(0xdf)](a18_0x4812a6[_0x50f4b6(0xc9)]('\x0aError:'),_0x50f4b6(0xa8)),console[_0x50f4b6(0xdf)](a18_0x4812a6['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3b0150=await confirmKey(_0x50f4b6(0xce)+(_0x158fce['length']+_0x27ee35[_0x50f4b6(0xd4)])+_0x50f4b6(0xad));if(!_0x3b0150)return console[_0x50f4b6(0xdf)](a18_0x4812a6[_0x50f4b6(0xd7)](_0x50f4b6(0xde)),_0x50f4b6(0xa1)),0x1;}for(const _0x5f35d5 of _0x405dba[_0x50f4b6(0xda)]){if(_0x5f35d5[_0x50f4b6(0x9c)]||_0x5f35d5[_0x50f4b6(0xdc)]){const _0x497780=a18_0x2f1e3[_0x50f4b6(0xc3)](_0x5f35d5[_0x50f4b6(0xa6)]);!existsSync(_0x497780)&&mkdirSync(_0x497780,{'recursive':!![]}),writeFileSync(_0x5f35d5[_0x50f4b6(0xa6)],_0x5f35d5[_0x50f4b6(0xb9)],_0x50f4b6(0xbc));}}return console[_0x50f4b6(0xdf)](a18_0x4812a6[_0x50f4b6(0xc7)]('✔\x20Pulled\x20'+(_0x158fce[_0x50f4b6(0xd4)]+_0x27ee35[_0x50f4b6(0xd4)])+_0x50f4b6(0xc2)+_0x405dba[_0x50f4b6(0xa2)])),saveSessionContext({'engage_workspace':_0x405dba[_0x50f4b6(0xae)]},_0x4644f3[_0x50f4b6(0xca)]),console['error'](a18_0x4812a6['green'](_0x50f4b6(0xd3)+a18_0x4812a6['dim'](_0x50f4b6(0xac))+_0x50f4b6(0x9d)+a18_0x4812a6[_0x50f4b6(0xbe)](_0x405dba['workspaceName']))),0x0;}}async function resolveWorkspaceName(_0x4c9e6a,_0x1eccca){const _0x181207=a18_0x38f58b;if(_0x4c9e6a)return _0x4c9e6a;if(_0x1eccca[_0x181207(0xd1)])return _0x1eccca[_0x181207(0xd1)];const _0x297524=tryFindTdxConfig(process['cwd']());if(_0x297524?.[_0x181207(0xa0)][_0x181207(0xac)])return _0x297524['config'][_0x181207(0xac)];const _0x5b4c5e=loadSessionContext(_0x1eccca[_0x181207(0xca)]);if(_0x5b4c5e?.[_0x181207(0xac)])return _0x5b4c5e[_0x181207(0xac)];return undefined;}
@@ -1 +1 @@
1
- const a19_0x338cc1=a19_0x4a5d;function a19_0x4a5d(_0x5becb4,_0x17542c){_0x5becb4=_0x5becb4-0x190;const _0x3a5d4d=a19_0x3a5d();let _0x4a5d23=_0x3a5d4d[_0x5becb4];return _0x4a5d23;}(function(_0x1b52ef,_0x4e9914){const _0x3d5396=a19_0x4a5d,_0xba1e37=_0x1b52ef();while(!![]){try{const _0x236a85=-parseInt(_0x3d5396(0x1da))/0x1*(parseInt(_0x3d5396(0x1ad))/0x2)+parseInt(_0x3d5396(0x199))/0x3+-parseInt(_0x3d5396(0x1b7))/0x4*(-parseInt(_0x3d5396(0x1c3))/0x5)+parseInt(_0x3d5396(0x1ce))/0x6+-parseInt(_0x3d5396(0x1c6))/0x7*(parseInt(_0x3d5396(0x1d1))/0x8)+parseInt(_0x3d5396(0x1c2))/0x9*(-parseInt(_0x3d5396(0x191))/0xa)+parseInt(_0x3d5396(0x1c1))/0xb*(parseInt(_0x3d5396(0x1a5))/0xc);if(_0x236a85===_0x4e9914)break;else _0xba1e37['push'](_0xba1e37['shift']());}catch(_0x5796ca){_0xba1e37['push'](_0xba1e37['shift']());}}}(a19_0x3a5d,0x9ec84));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{isYamlFile}from'../sdk/segment/file-discovery.js';import a19_0x3ab19a from'chalk';import a19_0x4837f6 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';function a19_0x3a5d(){const _0x11cc44=['setPhase','valid','\x20new\x20campaigns:','121EMgqbN','1199664vAlTHk','45515sFJXHJ','Workspace\x20is\x20required.','data','1369571QwoxLl','cyan','def','length','resolve','segment','\x20errors:','relativePath','6127896SuaslD','Found\x20','dim','8NSklho','Pushing\x20campaigns...','\x27...','configDir','✔\x20Created\x20','action','✔\x20Updated\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','engage','67wHAWuw','red','yes','30gMJbdZ','updated','\x20campaigns','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','1\x20campaign\x20file:\x20','error','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\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','98766hgvZqu','filter','Resolving\x20references...','campaignId','site','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','dirname','resolveWorkspaceId','message','\x20campaign\x20files','\x0aError:','green','155676NgWHIf','\x20\x20\x20\x20','-\x20no\x20changes\x20applied','workspace','yellow','campaign_type','engage_workspace','name','37124nxJqGq','session','warnings','errors','\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','results','config','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','created','path','568NEGZlX','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20campaigns?','Preparing\x20push\x20to\x20workspace\x20\x27','verbose','engage:campaign:push','Aborted.'];a19_0x3a5d=function(){return _0x11cc44;};return a19_0x3a5d();}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{[a19_0x338cc1(0x1ac)]=a19_0x338cc1(0x1bc);['description']=a19_0x338cc1(0x1d8);async['execute'](_0x10a4bb){const _0x3c717f=a19_0x338cc1,{options:_0x3b0685,args:_0x225c2d,tdx:_0x439368}=_0x10a4bb,_0x1276b9=_0x3b0685,_0x159033=_0x225c2d[0x0],_0xbf14c4=_0x159033?a19_0x4837f6[_0x3c717f(0x1ca)](_0x159033):undefined,_0x49b927=_0xbf14c4?isYamlFile(_0xbf14c4):![];let _0x3ae478;if(_0x49b927&&_0xbf14c4)_0x3ae478=a19_0x4837f6[_0x3c717f(0x19f)](_0xbf14c4);else _0xbf14c4?_0x3ae478=_0xbf14c4:_0x3ae478=process['cwd']();let _0x153f20;const _0x4d976f=tryFindTdxConfig(_0x3ae478);_0x4d976f?.[_0x3c717f(0x1b3)][_0x3c717f(0x1ab)]&&(_0x153f20=_0x4d976f['config']['engage_workspace'],!_0x49b927&&(_0x3ae478=_0x4d976f[_0x3c717f(0x1d4)]));_0x1276b9[_0x3c717f(0x1a8)]&&(_0x153f20=_0x1276b9[_0x3c717f(0x1a8)]);if(!_0x153f20){const _0x38d93=loadSessionContext(_0x1276b9[_0x3c717f(0x1ae)]);_0x38d93?.['engage_workspace']&&(_0x153f20=_0x38d93[_0x3c717f(0x1ab)]);}if(!_0x153f20)return console[_0x3c717f(0x196)](a19_0x3ab19a[_0x3c717f(0x1a9)](_0x3c717f(0x1c4))),console[_0x3c717f(0x196)](_0x3c717f(0x1b1)),console[_0x3c717f(0x196)]('\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)'),console[_0x3c717f(0x196)](_0x3c717f(0x198)),console[_0x3c717f(0x196)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x53767a;_0x49b927&&_0xbf14c4?_0x53767a=[_0xbf14c4]:_0x53767a=discoverCampaignFiles(_0x3ae478);if(_0x53767a[_0x3c717f(0x1c9)]===0x0)return console[_0x3c717f(0x196)](a19_0x3ab19a[_0x3c717f(0x1a9)](_0x3c717f(0x1b4)+_0x3ae478)),console['error'](a19_0x3ab19a['dim']('Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.')),0x1;const _0x1bbda8=_0x53767a['map'](_0x303492=>parseCampaignFile(_0x303492,a19_0x4837f6['dirname'](_0x303492))),_0xc28a88=_0x1bbda8['length']===0x1?_0x3c717f(0x195)+_0x1bbda8[0x0][_0x3c717f(0x1c8)][_0x3c717f(0x1ac)]:_0x1bbda8[_0x3c717f(0x1c9)]+_0x3c717f(0x1a2);console[_0x3c717f(0x196)](_0x3c717f(0x1cf)+a19_0x3ab19a[_0x3c717f(0x1c7)](_0xc28a88));let _0x4e1274=![];for(const _0x31c061 of _0x1bbda8){const _0x5d9652=validateCampaignDef(_0x31c061['def']);if(!_0x5d9652[_0x3c717f(0x1bf)]){_0x4e1274=!![],console['error'](a19_0x3ab19a['red']('\x0aValidation\x20errors\x20in\x20'+_0x31c061[_0x3c717f(0x1cd)]+':'));for(const _0x4e54a9 of _0x5d9652[_0x3c717f(0x1b0)]){console[_0x3c717f(0x196)]('\x20\x20'+a19_0x3ab19a[_0x3c717f(0x1db)]('✗')+'\x20'+_0x4e54a9[_0x3c717f(0x1b6)]+':\x20'+_0x4e54a9[_0x3c717f(0x1a1)]);}}for(const _0x114442 of _0x5d9652[_0x3c717f(0x1af)]){console[_0x3c717f(0x196)]('\x20\x20'+a19_0x3ab19a['yellow']('⚠')+'\x20'+_0x114442[_0x3c717f(0x1b6)]+':\x20'+_0x114442['message']);}}if(_0x4e1274)return console['error'](a19_0x3ab19a['red'](_0x3c717f(0x197))),0x1;const _0x55bdc9=await _0x439368[_0x3c717f(0x1d9)][_0x3c717f(0x1a0)](_0x153f20),_0x4d9826=await withProgressSpinner(_0x3c717f(0x1ba)+_0x153f20+_0x3c717f(0x1d3),_0x2893f4=>preparePush({'engage':_0x439368[_0x3c717f(0x1d9)],'segment':_0x439368[_0x3c717f(0x1cb)]},_0x1bbda8,_0x55bdc9,{'progress':{'update':_0x21ef90=>_0x2893f4[_0x3c717f(0x1be)](_0x21ef90)}}),{'verbose':_0x1276b9[_0x3c717f(0x1bb)]}),_0x20b399=_0x4d9826[_0x3c717f(0x1c5)];await withProgressSpinner(_0x3c717f(0x19b),_0x1334b1=>resolveAndBuildInputs({'engage':_0x439368[_0x3c717f(0x1d9)],'segment':_0x439368['segment']},_0x20b399,_0x55bdc9,{'progress':{'update':_0x28ef2c=>_0x1334b1[_0x3c717f(0x1be)](_0x28ef2c)}}),{'verbose':_0x1276b9['verbose']});const _0x2922d9=_0x20b399[_0x3c717f(0x19a)](_0x2d900f=>_0x2d900f['action']==='create'),_0x2d180a=_0x20b399[_0x3c717f(0x19a)](_0x44e7e7=>_0x44e7e7[_0x3c717f(0x1d6)]==='update');console[_0x3c717f(0x196)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x153f20+'\x27:');if(_0x2922d9[_0x3c717f(0x1c9)]>0x0){console[_0x3c717f(0x196)]('\x20\x20'+a19_0x3ab19a['green']('+\x20'+_0x2922d9[_0x3c717f(0x1c9)]+_0x3c717f(0x1c0)));for(const _0x4bc40a of _0x2922d9){console[_0x3c717f(0x196)](_0x3c717f(0x1a6)+a19_0x3ab19a[_0x3c717f(0x1a4)]('+')+'\x20'+_0x4bc40a[_0x3c717f(0x1c8)][_0x3c717f(0x1ac)]+'\x20('+_0x4bc40a[_0x3c717f(0x1c8)][_0x3c717f(0x1aa)]+')');}}if(_0x2d180a[_0x3c717f(0x1c9)]>0x0){console[_0x3c717f(0x196)]('\x20\x20'+a19_0x3ab19a[_0x3c717f(0x1a9)]('~\x20'+_0x2d180a[_0x3c717f(0x1c9)]+'\x20campaigns\x20to\x20update:'));for(const _0x784e3 of _0x2d180a){console[_0x3c717f(0x196)]('\x20\x20\x20\x20'+a19_0x3ab19a['yellow']('~')+'\x20'+_0x784e3[_0x3c717f(0x1c8)]['name']+'\x20('+_0x784e3[_0x3c717f(0x1c8)][_0x3c717f(0x1aa)]+')');}}if(_0x2922d9[_0x3c717f(0x1c9)]===0x0&&_0x2d180a[_0x3c717f(0x1c9)]===0x0)return console[_0x3c717f(0x196)](a19_0x3ab19a['green'](_0x3c717f(0x19e))),0x0;if(_0x1276b9['dryRun'])return console['error'](a19_0x3ab19a['yellow'](_0x3c717f(0x194))),0x0;if(!_0x1276b9[_0x3c717f(0x190)]){if(!isInteractive())return console['error'](a19_0x3ab19a[_0x3c717f(0x1db)](_0x3c717f(0x1a3)),_0x3c717f(0x1b8)),console[_0x3c717f(0x196)](a19_0x3ab19a[_0x3c717f(0x1d0)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4d5c06=await confirmKey('Push\x20'+(_0x2922d9['length']+_0x2d180a['length'])+_0x3c717f(0x1b9));if(!_0x4d5c06)return console[_0x3c717f(0x196)](a19_0x3ab19a[_0x3c717f(0x1a9)](_0x3c717f(0x1bd)),_0x3c717f(0x1a7)),0x1;}const _0x1c16fa=await withProgressSpinner(_0x3c717f(0x1d2),_0x2fa425=>executePush({'engage':_0x439368[_0x3c717f(0x1d9)],'segment':_0x439368[_0x3c717f(0x1cb)]},_0x20b399,{'progress':{'update':_0x522d90=>_0x2fa425[_0x3c717f(0x1be)](_0x522d90)}}),{'verbose':_0x1276b9[_0x3c717f(0x1bb)]}),_0x29729e=_0x1c16fa[_0x3c717f(0x1c5)];for(const _0x4ffc1c of _0x29729e[_0x3c717f(0x1b2)]){if(_0x4ffc1c[_0x3c717f(0x19c)]&&(_0x4ffc1c[_0x3c717f(0x1d6)]===_0x3c717f(0x1b5)||_0x4ffc1c[_0x3c717f(0x1d6)]==='updated')){const _0xc101de=getCampaignUrl(_0x1276b9[_0x3c717f(0x19d)],_0x55bdc9,_0x4ffc1c[_0x3c717f(0x19c)]),_0x1ef372=_0x4ffc1c[_0x3c717f(0x1d6)]===_0x3c717f(0x1b5)?'+':'~',_0x8e372e=_0x4ffc1c[_0x3c717f(0x1d6)]===_0x3c717f(0x1b5)?a19_0x3ab19a[_0x3c717f(0x1a4)](_0x1ef372):a19_0x3ab19a['yellow'](_0x1ef372);console[_0x3c717f(0x196)]('\x20\x20'+_0x8e372e+'\x20'+hyperlink(_0x4ffc1c[_0x3c717f(0x1ac)],_0xc101de)+'\x20'+a19_0x3ab19a[_0x3c717f(0x1d0)](_0xc101de));}}_0x29729e[_0x3c717f(0x1b5)]>0x0&&console[_0x3c717f(0x196)](a19_0x3ab19a['green'](_0x3c717f(0x1d5)+_0x29729e['created']+_0x3c717f(0x193)));_0x29729e[_0x3c717f(0x192)]>0x0&&console[_0x3c717f(0x196)](a19_0x3ab19a[_0x3c717f(0x1a4)](_0x3c717f(0x1d7)+_0x29729e['updated']+_0x3c717f(0x193)));if(_0x29729e['errors']['length']>0x0){console[_0x3c717f(0x196)](a19_0x3ab19a[_0x3c717f(0x1db)]('✘\x20'+_0x29729e[_0x3c717f(0x1b0)]['length']+_0x3c717f(0x1cc)));for(const _0x24b348 of _0x29729e[_0x3c717f(0x1b0)]){console[_0x3c717f(0x196)]('\x20\x20'+a19_0x3ab19a[_0x3c717f(0x1db)](_0x24b348[_0x3c717f(0x1ac)])+':\x20'+_0x24b348[_0x3c717f(0x196)]);}}return saveSessionContext({'engage_workspace':_0x153f20},_0x1276b9[_0x3c717f(0x1ae)]),_0x29729e[_0x3c717f(0x1b0)]['length']>0x0?0x1:0x0;}}
1
+ const a19_0x40fbcd=a19_0x1603;(function(_0x102730,_0x4858e5){const _0x3317cc=a19_0x1603,_0x402138=_0x102730();while(!![]){try{const _0x407efa=parseInt(_0x3317cc(0x17e))/0x1*(-parseInt(_0x3317cc(0x152))/0x2)+parseInt(_0x3317cc(0x16c))/0x3*(parseInt(_0x3317cc(0x191))/0x4)+parseInt(_0x3317cc(0x158))/0x5*(parseInt(_0x3317cc(0x187))/0x6)+-parseInt(_0x3317cc(0x15e))/0x7+parseInt(_0x3317cc(0x192))/0x8+parseInt(_0x3317cc(0x160))/0x9+parseInt(_0x3317cc(0x163))/0xa*(-parseInt(_0x3317cc(0x179))/0xb);if(_0x407efa===_0x4858e5)break;else _0x402138['push'](_0x402138['shift']());}catch(_0x3a9f77){_0x402138['push'](_0x402138['shift']());}}}(a19_0x2539,0x381cb));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{isYamlFile}from'../sdk/segment/file-discovery.js';import a19_0x31dd21 from'chalk';import a19_0x2884c5 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';function a19_0x1603(_0x121cff,_0x12d4cf){_0x121cff=_0x121cff-0x14a;const _0x2539ce=a19_0x2539();let _0x16032c=_0x2539ce[_0x121cff];return _0x16032c;}import{hyperlink}from'../sdk/util/formatters.js';function a19_0x2539(){const _0x1135d2=['update','def','\x0aError:','resolve','cyan','session','119882wHxsyM','errors','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','verbose','warnings','green','33805wyMhtu','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','campaignId','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','1\x20campaign\x20file:\x20','relativePath','1605044wJcDBf','\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)','2709612rgbiOP','description','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','7995340dqOiKV','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','created','map','engage:campaign:push','error','engage_workspace','\x20campaigns\x20to\x20update:','Preparing\x20push\x20to\x20workspace\x20\x27','6744ucKUQP','\x20errors:','Aborted.','path','segment','red','name','Push\x20','cwd','workspace','results','valid','message','11EEYkcn','\x20campaigns?','configDir','length','\x20campaigns','3IdhMhZ','dim','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','dryRun','execute','\x0aValidation\x20errors\x20in\x20','updated','Found\x20','dirname','402ziZiqF','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','action','setPhase','config','engage','Pushing\x20campaigns...','resolveWorkspaceId','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','-\x20no\x20changes\x20applied','580celatB','2867752ADfAOe','\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','✔\x20Created\x20','Resolving\x20references...','yellow','✔\x20Updated\x20','campaign_type','\x20new\x20campaigns:','data','\x20\x20\x20\x20','filter'];a19_0x2539=function(){return _0x1135d2;};return a19_0x2539();}export class EngageCampaignPushCommand extends BaseCommand{['name']=a19_0x40fbcd(0x167);[a19_0x40fbcd(0x161)]=a19_0x40fbcd(0x164);async[a19_0x40fbcd(0x182)](_0x436b45){const _0x26efc1=a19_0x40fbcd,{options:_0x4f2759,args:_0x41878e,tdx:_0x5f02ed}=_0x436b45,_0x17dbd8=_0x4f2759,_0x2e021c=_0x41878e[0x0],_0xf86024=_0x2e021c?a19_0x2884c5[_0x26efc1(0x14f)](_0x2e021c):undefined,_0x2c0e79=_0xf86024?isYamlFile(_0xf86024):![];let _0x464a8c;if(_0x2c0e79&&_0xf86024)_0x464a8c=a19_0x2884c5[_0x26efc1(0x186)](_0xf86024);else _0xf86024?_0x464a8c=_0xf86024:_0x464a8c=process[_0x26efc1(0x174)]();let _0x2dbbdc;const _0x168acc=tryFindTdxConfig(_0x464a8c);_0x168acc?.[_0x26efc1(0x18b)][_0x26efc1(0x169)]&&(_0x2dbbdc=_0x168acc[_0x26efc1(0x18b)]['engage_workspace'],!_0x2c0e79&&(_0x464a8c=_0x168acc[_0x26efc1(0x17b)]));_0x17dbd8[_0x26efc1(0x175)]&&(_0x2dbbdc=_0x17dbd8['workspace']);if(!_0x2dbbdc){const _0x5c8d3f=loadSessionContext(_0x17dbd8[_0x26efc1(0x151)]);_0x5c8d3f?.['engage_workspace']&&(_0x2dbbdc=_0x5c8d3f[_0x26efc1(0x169)]);}if(!_0x2dbbdc)return console[_0x26efc1(0x168)](a19_0x31dd21[_0x26efc1(0x196)]('Workspace\x20is\x20required.')),console[_0x26efc1(0x168)](_0x26efc1(0x193)),console[_0x26efc1(0x168)](_0x26efc1(0x15f)),console[_0x26efc1(0x168)]('\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'),console[_0x26efc1(0x168)](_0x26efc1(0x180)),0x1;let _0x4fd317;_0x2c0e79&&_0xf86024?_0x4fd317=[_0xf86024]:_0x4fd317=discoverCampaignFiles(_0x464a8c);if(_0x4fd317[_0x26efc1(0x17c)]===0x0)return console[_0x26efc1(0x168)](a19_0x31dd21[_0x26efc1(0x196)](_0x26efc1(0x15b)+_0x464a8c)),console[_0x26efc1(0x168)](a19_0x31dd21['dim'](_0x26efc1(0x188))),0x1;const _0x1b71fd=_0x4fd317[_0x26efc1(0x166)](_0x4c16f8=>parseCampaignFile(_0x4c16f8,a19_0x2884c5[_0x26efc1(0x186)](_0x4c16f8))),_0x149275=_0x1b71fd['length']===0x1?_0x26efc1(0x15c)+_0x1b71fd[0x0][_0x26efc1(0x14d)][_0x26efc1(0x172)]:_0x1b71fd['length']+'\x20campaign\x20files';console['error'](_0x26efc1(0x185)+a19_0x31dd21[_0x26efc1(0x150)](_0x149275));let _0x233a8c=![];for(const _0x54123a of _0x1b71fd){const _0xd14688=validateCampaignDef(_0x54123a[_0x26efc1(0x14d)]);if(!_0xd14688[_0x26efc1(0x177)]){_0x233a8c=!![],console[_0x26efc1(0x168)](a19_0x31dd21['red'](_0x26efc1(0x183)+_0x54123a[_0x26efc1(0x15d)]+':'));for(const _0x2a5191 of _0xd14688[_0x26efc1(0x153)]){console['error']('\x20\x20'+a19_0x31dd21[_0x26efc1(0x171)]('✗')+'\x20'+_0x2a5191[_0x26efc1(0x16f)]+':\x20'+_0x2a5191['message']);}}for(const _0x4181ac of _0xd14688[_0x26efc1(0x156)]){console[_0x26efc1(0x168)]('\x20\x20'+a19_0x31dd21['yellow']('⚠')+'\x20'+_0x4181ac[_0x26efc1(0x16f)]+':\x20'+_0x4181ac[_0x26efc1(0x178)]);}}if(_0x233a8c)return console[_0x26efc1(0x168)](a19_0x31dd21['red'](_0x26efc1(0x162))),0x1;const _0x4f6f68=await _0x5f02ed[_0x26efc1(0x18c)][_0x26efc1(0x18e)](_0x2dbbdc),_0x1ded25=await withProgressSpinner(_0x26efc1(0x16b)+_0x2dbbdc+'\x27...',_0x58dc45=>preparePush({'engage':_0x5f02ed[_0x26efc1(0x18c)],'segment':_0x5f02ed[_0x26efc1(0x170)]},_0x1b71fd,_0x4f6f68,{'progress':{'update':_0x5275c6=>_0x58dc45[_0x26efc1(0x18a)](_0x5275c6)}}),{'verbose':_0x17dbd8[_0x26efc1(0x155)]}),_0x23338f=_0x1ded25['data'];await withProgressSpinner(_0x26efc1(0x195),_0x1bcbbf=>resolveAndBuildInputs({'engage':_0x5f02ed['engage'],'segment':_0x5f02ed[_0x26efc1(0x170)]},_0x23338f,_0x4f6f68,{'progress':{'update':_0x3bb53a=>_0x1bcbbf[_0x26efc1(0x18a)](_0x3bb53a)}}),{'verbose':_0x17dbd8['verbose']});const _0x5c8db6=_0x23338f[_0x26efc1(0x14b)](_0x1ff588=>_0x1ff588['action']==='create'),_0x3f1a27=_0x23338f[_0x26efc1(0x14b)](_0x327748=>_0x327748[_0x26efc1(0x189)]===_0x26efc1(0x14c));console[_0x26efc1(0x168)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x2dbbdc+'\x27:');if(_0x5c8db6[_0x26efc1(0x17c)]>0x0){console[_0x26efc1(0x168)]('\x20\x20'+a19_0x31dd21['green']('+\x20'+_0x5c8db6['length']+_0x26efc1(0x199)));for(const _0x113342 of _0x5c8db6){console['error'](_0x26efc1(0x14a)+a19_0x31dd21[_0x26efc1(0x157)]('+')+'\x20'+_0x113342['def'][_0x26efc1(0x172)]+'\x20('+_0x113342['def']['campaign_type']+')');}}if(_0x3f1a27['length']>0x0){console['error']('\x20\x20'+a19_0x31dd21[_0x26efc1(0x196)]('~\x20'+_0x3f1a27[_0x26efc1(0x17c)]+_0x26efc1(0x16a)));for(const _0x5eca99 of _0x3f1a27){console['error'](_0x26efc1(0x14a)+a19_0x31dd21['yellow']('~')+'\x20'+_0x5eca99[_0x26efc1(0x14d)][_0x26efc1(0x172)]+'\x20('+_0x5eca99[_0x26efc1(0x14d)][_0x26efc1(0x198)]+')');}}if(_0x5c8db6[_0x26efc1(0x17c)]===0x0&&_0x3f1a27[_0x26efc1(0x17c)]===0x0)return console['error'](a19_0x31dd21['green'](_0x26efc1(0x18f))),0x0;if(_0x17dbd8[_0x26efc1(0x181)])return console[_0x26efc1(0x168)](a19_0x31dd21[_0x26efc1(0x196)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x17dbd8['yes']){if(!isInteractive())return console[_0x26efc1(0x168)](a19_0x31dd21[_0x26efc1(0x171)](_0x26efc1(0x14e)),_0x26efc1(0x159)),console[_0x26efc1(0x168)](a19_0x31dd21['dim'](_0x26efc1(0x154))),0x1;const _0x40d4cb=await confirmKey(_0x26efc1(0x173)+(_0x5c8db6[_0x26efc1(0x17c)]+_0x3f1a27[_0x26efc1(0x17c)])+_0x26efc1(0x17a));if(!_0x40d4cb)return console[_0x26efc1(0x168)](a19_0x31dd21[_0x26efc1(0x196)](_0x26efc1(0x16e)),_0x26efc1(0x190)),0x1;}const _0x46f07d=await withProgressSpinner(_0x26efc1(0x18d),_0xba8362=>executePush({'engage':_0x5f02ed[_0x26efc1(0x18c)],'segment':_0x5f02ed['segment']},_0x23338f,{'progress':{'update':_0x303a19=>_0xba8362[_0x26efc1(0x18a)](_0x303a19)}}),{'verbose':_0x17dbd8['verbose']}),_0x1fad49=_0x46f07d[_0x26efc1(0x19a)];for(const _0xd9ac02 of _0x1fad49[_0x26efc1(0x176)]){if(_0xd9ac02[_0x26efc1(0x15a)]&&(_0xd9ac02[_0x26efc1(0x189)]===_0x26efc1(0x165)||_0xd9ac02[_0x26efc1(0x189)]===_0x26efc1(0x184))){const _0x9f6b46=getCampaignUrl(_0x17dbd8['site'],_0x4f6f68,_0xd9ac02['campaignId']),_0x3d18f3=_0xd9ac02[_0x26efc1(0x189)]===_0x26efc1(0x165)?'+':'~',_0x45576a=_0xd9ac02['action']===_0x26efc1(0x165)?a19_0x31dd21[_0x26efc1(0x157)](_0x3d18f3):a19_0x31dd21['yellow'](_0x3d18f3);console[_0x26efc1(0x168)]('\x20\x20'+_0x45576a+'\x20'+hyperlink(_0xd9ac02[_0x26efc1(0x172)],_0x9f6b46)+'\x20'+a19_0x31dd21[_0x26efc1(0x17f)](_0x9f6b46));}}_0x1fad49[_0x26efc1(0x165)]>0x0&&console[_0x26efc1(0x168)](a19_0x31dd21[_0x26efc1(0x157)](_0x26efc1(0x194)+_0x1fad49[_0x26efc1(0x165)]+'\x20campaigns'));_0x1fad49[_0x26efc1(0x184)]>0x0&&console[_0x26efc1(0x168)](a19_0x31dd21['green'](_0x26efc1(0x197)+_0x1fad49[_0x26efc1(0x184)]+_0x26efc1(0x17d)));if(_0x1fad49['errors'][_0x26efc1(0x17c)]>0x0){console[_0x26efc1(0x168)](a19_0x31dd21[_0x26efc1(0x171)]('✘\x20'+_0x1fad49['errors']['length']+_0x26efc1(0x16d)));for(const _0x1d79cd of _0x1fad49[_0x26efc1(0x153)]){console['error']('\x20\x20'+a19_0x31dd21[_0x26efc1(0x171)](_0x1d79cd[_0x26efc1(0x172)])+':\x20'+_0x1d79cd[_0x26efc1(0x168)]);}}return saveSessionContext({'engage_workspace':_0x2dbbdc},_0x17dbd8['session']),_0x1fad49[_0x26efc1(0x153)][_0x26efc1(0x17c)]>0x0?0x1:0x0;}}