@treasuredata/tdx 2026.3.26 → 2026.3.27

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 (205) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.d.ts.map +1 -1
  65. package/dist/core/oauth.js +1 -1
  66. package/dist/core/oauth.js.map +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/template-pull.js +1 -1
  110. package/dist/sdk/engage/template-push.js +1 -1
  111. package/dist/sdk/engage/template-validator.js +1 -1
  112. package/dist/sdk/engage/template-yaml.js +1 -1
  113. package/dist/sdk/engage/types/campaign-def.js +1 -1
  114. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  115. package/dist/sdk/engage/types/template-schema.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.js +1 -1
  118. package/dist/sdk/index.js +1 -1
  119. package/dist/sdk/io/index.js +1 -1
  120. package/dist/sdk/io/node-filesystem.js +1 -1
  121. package/dist/sdk/job.js +1 -1
  122. package/dist/sdk/journey.js +1 -1
  123. package/dist/sdk/llm/chat-cache.js +1 -1
  124. package/dist/sdk/llm/index.js +1 -1
  125. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  126. package/dist/sdk/llm/model-factors.js +1 -1
  127. package/dist/sdk/personalization.js +1 -1
  128. package/dist/sdk/policy.js +1 -1
  129. package/dist/sdk/query/index.js +1 -1
  130. package/dist/sdk/query/sql-parser.js +1 -1
  131. package/dist/sdk/realtime.js +1 -1
  132. package/dist/sdk/schedule.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.js +1 -1
  137. package/dist/sdk/segment/journey-validator.js +1 -1
  138. package/dist/sdk/segment/journey-yaml.js +1 -1
  139. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  140. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/pull-workflow.js +1 -1
  142. package/dist/sdk/segment/push-recovery.js +1 -1
  143. package/dist/sdk/segment/push-workflow.js +1 -1
  144. package/dist/sdk/segment/resolution-context.js +1 -1
  145. package/dist/sdk/segment/segment-path-parser.js +1 -1
  146. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  147. package/dist/sdk/segment/segment-validator.js +1 -1
  148. package/dist/sdk/segment/target-resolution.js +1 -1
  149. package/dist/sdk/segment/tdx-config.js +1 -1
  150. package/dist/sdk/segment/types/activation-schema.js +1 -1
  151. package/dist/sdk/segment/types/journey-def.js +1 -1
  152. package/dist/sdk/segment/types/journey-schema.js +1 -1
  153. package/dist/sdk/segment/types/segment-def.js +1 -1
  154. package/dist/sdk/segment/types/segment-schema.js +1 -1
  155. package/dist/sdk/segment/validate-files.js +1 -1
  156. package/dist/sdk/segment/yaml-validator.js +1 -1
  157. package/dist/sdk/segment.js +1 -1
  158. package/dist/sdk/types/index.js +1 -1
  159. package/dist/sdk/types/progress.js +1 -1
  160. package/dist/sdk/user.js +1 -1
  161. package/dist/sdk/util/format-detector.js +1 -1
  162. package/dist/sdk/util/formatters.js +1 -1
  163. package/dist/sdk/util/index.js +1 -1
  164. package/dist/sdk/util/paginate.js +1 -1
  165. package/dist/sdk/util/tree-formatter.js +1 -1
  166. package/dist/sdk/workflow/archive-validation.js +1 -1
  167. package/dist/sdk/workflow/clone-workflow.js +1 -1
  168. package/dist/sdk/workflow/index.js +1 -1
  169. package/dist/sdk/workflow/pull-workflow.js +1 -1
  170. package/dist/sdk/workflow/push-workflow.js +1 -1
  171. package/dist/sdk/workflow/tdx-config.js +1 -1
  172. package/dist/sdk/workflow/workflow-utils.js +1 -1
  173. package/dist/test-utils/command-runner.js +1 -1
  174. package/dist/test-utils/factories.js +1 -1
  175. package/dist/test-utils/fixtures.js +1 -1
  176. package/dist/test-utils/http-mock.js +1 -1
  177. package/dist/test-utils/index.js +1 -1
  178. package/dist/utils/async.js +1 -1
  179. package/dist/utils/colors.js +1 -1
  180. package/dist/utils/diff.js +1 -1
  181. package/dist/utils/file-permissions.js +1 -1
  182. package/dist/utils/file-reader.js +1 -1
  183. package/dist/utils/github-releases.js +1 -1
  184. package/dist/utils/global-cache.js +1 -1
  185. package/dist/utils/json-loader.js +1 -1
  186. package/dist/utils/local-cache.js +1 -1
  187. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  188. package/dist/utils/logger/formatters/index.js +1 -1
  189. package/dist/utils/logger/handlers/console-handler.js +1 -1
  190. package/dist/utils/logger/handlers/file-handler.js +1 -1
  191. package/dist/utils/logger/handlers/index.js +1 -1
  192. package/dist/utils/logger/handlers/null-handler.js +1 -1
  193. package/dist/utils/logger/index.js +1 -1
  194. package/dist/utils/logger/logger.js +1 -1
  195. package/dist/utils/logger/types.js +1 -1
  196. package/dist/utils/option-validation.js +1 -1
  197. package/dist/utils/process.js +1 -1
  198. package/dist/utils/prompt.js +1 -1
  199. package/dist/utils/spinner.js +1 -1
  200. package/dist/utils/sse-parser.js +1 -1
  201. package/dist/utils/string-utils.js +1 -1
  202. package/dist/utils/table-ref-parser.js +1 -1
  203. package/dist/utils/tdx-logger.js +1 -1
  204. package/dist/utils/version-check.js +1 -1
  205. package/package.json +1 -1
@@ -1 +1 @@
1
- const a9_0x54c225=a9_0x1ec2;(function(_0x47d91c,_0x45b485){const _0x4f301f=a9_0x1ec2,_0x22b294=_0x47d91c();while(!![]){try{const _0x4e5b24=parseInt(_0x4f301f(0x173))/0x1*(parseInt(_0x4f301f(0x177))/0x2)+-parseInt(_0x4f301f(0x13a))/0x3*(parseInt(_0x4f301f(0x16d))/0x4)+parseInt(_0x4f301f(0x16b))/0x5+-parseInt(_0x4f301f(0x169))/0x6*(-parseInt(_0x4f301f(0x17b))/0x7)+-parseInt(_0x4f301f(0x14e))/0x8*(-parseInt(_0x4f301f(0x148))/0x9)+-parseInt(_0x4f301f(0x15b))/0xa+-parseInt(_0x4f301f(0x145))/0xb*(parseInt(_0x4f301f(0x14b))/0xc);if(_0x4e5b24===_0x45b485)break;else _0x22b294['push'](_0x22b294['shift']());}catch(_0x4c7ab0){_0x22b294['push'](_0x22b294['shift']());}}}(a9_0x5ee9,0xc3eeb));function a9_0x5ee9(){const _0xc84d87=['llm','startChat','stringify','done','404','message','data','targetWebSearchTool','join','llmProject','18nUwwyL','\x0aError:\x20','1128155dtDodC','streamChat','243676WWgrwu','handleChatEvent','execute','log','includes','targetKnowledgeBase','1396491pBYlbH','targetAgent','stream','getDefaultAgent','2EdxwsM','llmAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','chatId','3026247QvLelk','verbose','type','error','args','content','code','\x20\x20Cause:\x20','Create\x20a\x20new\x20chat\x20session','agentId','name','chat','tool_result','Error:\x20','3FdxLnc','Continuing\x20chat:\x20','\x0aStack\x20trace:','streamChatJsonl','chat-create','--agent\x20flag','Chat\x20session:\x20','context','projectId','resolveProjectId','Error:\x20Chat\x20session\x20\x27','23060477YbrfZr','string','tool','387BEzSLn','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','description','12TNqOhg','Using\x20cached\x20default\x20agent:\x20','resolveAgentId','35096XxezaA','write','Resolving\x20project\x20\x27','slice','metadata','agent','functionName','cause','session\x20context','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','\x27\x20not\x20found','Using\x20agent\x20from\x20','stack','1478610xlksxz','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','tool_call','stdout'];a9_0x5ee9=function(){return _0xc84d87;};return a9_0x5ee9();}function a9_0x1ec2(_0x59d1c3,_0x488c15){_0x59d1c3=_0x59d1c3-0x137;const _0x5ee977=a9_0x5ee9();let _0x1ec23f=_0x5ee977[_0x59d1c3];return _0x1ec23f;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x276c45,_0x3baed5){const _0x1d493d=a9_0x1ec2;if(_0x276c45 instanceof SDKError)console['error'](_0x1d493d(0x139)+_0x276c45['message']),_0x3baed5[_0x1d493d(0x17c)]&&(_0x276c45[_0x1d493d(0x155)]&&console[_0x1d493d(0x17e)](_0x1d493d(0x182)+_0x276c45['cause']),_0x276c45[_0x1d493d(0x15a)]&&(console[_0x1d493d(0x17e)](_0x1d493d(0x13c)),console['error'](_0x276c45[_0x1d493d(0x15a)])));else throw _0x276c45;}async function resolveAgentId(_0x14eec3,_0x57d851,_0x52336d,_0x3ad2a4,_0x3dea70){const _0x42879b=a9_0x1ec2,_0x523ea0=_0x57d851||_0x52336d;if(_0x523ea0){const {projectName:_0xe1e25b,agentName:_0x52895b}=parseAgentRef(_0x523ea0),_0x4f95d9=_0x52895b||_0x523ea0,_0x63c232=_0x52895b?_0xe1e25b:_0x3ad2a4;if(!_0x63c232)throw new Error(_0x42879b(0x149));if(_0x3dea70){const _0x258702=_0x57d851?_0x42879b(0x13f):_0x42879b(0x156);console['error'](_0x42879b(0x159)+_0x258702+':\x20'+_0x63c232+'/'+_0x4f95d9);}const _0x57e5fd=await withSpinner(_0x42879b(0x150)+_0x63c232+'\x27...',()=>_0x14eec3[_0x42879b(0x15f)][_0x42879b(0x143)](_0x63c232),{'verbose':_0x3dea70}),_0x4ae7f5=await withSpinner('Resolving\x20agent\x20\x27'+_0x4f95d9+'\x27...',()=>_0x14eec3[_0x42879b(0x15f)][_0x42879b(0x14d)](_0x4f95d9,_0x57e5fd[_0x42879b(0x165)]),{'verbose':_0x3dea70});return _0x4ae7f5['data'];}else{const _0x4ba832=_0x14eec3[_0x42879b(0x15f)][_0x42879b(0x176)]();if(_0x4ba832)return _0x3dea70&&console[_0x42879b(0x17e)](_0x42879b(0x14c)+_0x4ba832[_0x42879b(0x185)]),_0x4ba832['id'];const _0x310082=await withSpinner('Getting\x20default\x20agent...',()=>_0x14eec3[_0x42879b(0x15f)]['getOrCreateDefaultAgent']('claude-4.5-haiku',0x0),{'verbose':_0x3dea70});return _0x310082[_0x42879b(0x165)]['id'];}}export class ChatCommand extends BaseCommand{['name']=a9_0x54c225(0x137);[a9_0x54c225(0x14a)]=a9_0x54c225(0x179);['validate'](_0x50deeb){const _0xde8a41=a9_0x54c225,_0x4f7ad7=_0x50deeb[_0xde8a41(0x17f)][_0xde8a41(0x167)]('\x20');if(!_0x4f7ad7)return _0xde8a41(0x157);return undefined;}async['streamChat'](_0x4273d2,_0x8a3a8c,_0xdac451,_0x4cea92,_0x4ef627){const _0x39c021=a9_0x54c225;for await(const _0x334fc8 of _0x4273d2[_0x39c021(0x15f)][_0x39c021(0x137)](_0x8a3a8c,{'agentId':_0xdac451,'chatId':_0x4cea92})){if(_0x334fc8['type']==='metadata'){const _0x8440d4=_0x334fc8['data'][_0x39c021(0x17a)];saveLastChatId(_0x8440d4),_0x4ef627&&console[_0x39c021(0x17e)](_0x39c021(0x140)+_0x8440d4);}else _0x334fc8[_0x39c021(0x17d)]==='event'&&this[_0x39c021(0x16e)](_0x334fc8[_0x39c021(0x165)]);}}async[a9_0x54c225(0x13d)](_0x4e3de0,_0x49156c,_0x4e86af,_0xd8db23){const _0x4f2d0e=a9_0x54c225,_0x394d19=_0x4e3de0[_0x4f2d0e(0x141)]['site'];let _0x491870=![];for await(const _0x21c014 of _0x4e3de0[_0x4f2d0e(0x15f)][_0x4f2d0e(0x137)](_0x49156c,{'agentId':_0x4e86af,'chatId':_0xd8db23})){if(_0x21c014[_0x4f2d0e(0x17d)]==='metadata'){const _0x2268f3=_0x21c014['data'];saveLastChatId(_0x2268f3['chatId']);const _0x8d3354=_0x2268f3[_0x4f2d0e(0x142)]&&_0x2268f3[_0x4f2d0e(0x184)]?getLLMConversationUrl(_0x394d19,_0x2268f3[_0x4f2d0e(0x142)],_0x2268f3[_0x4f2d0e(0x184)],_0x2268f3['chatId']):undefined;console[_0x4f2d0e(0x170)](JSON[_0x4f2d0e(0x161)]({'type':_0x4f2d0e(0x152),'data':{'chatId':_0x2268f3[_0x4f2d0e(0x17a)],'agentId':_0x2268f3[_0x4f2d0e(0x184)],'consoleUrl':_0x8d3354}})),_0x491870=!![];}else{if(_0x21c014[_0x4f2d0e(0x17d)]==='event'){!_0x491870&&_0xd8db23&&(console[_0x4f2d0e(0x170)](JSON[_0x4f2d0e(0x161)]({'type':'metadata','data':{'chatId':_0xd8db23}})),_0x491870=!![]);const _0x587c98=_0x21c014[_0x4f2d0e(0x165)];if('content'in _0x587c98)console[_0x4f2d0e(0x170)](JSON[_0x4f2d0e(0x161)]({'type':_0x4f2d0e(0x180),'data':{'content':_0x587c98[_0x4f2d0e(0x180)]}}));else{if(_0x4f2d0e(0x15d)in _0x587c98){const _0x46e160=_0x587c98[_0x4f2d0e(0x15d)];console[_0x4f2d0e(0x170)](JSON[_0x4f2d0e(0x161)]({'type':_0x4f2d0e(0x15d),'data':{'id':_0x46e160['id'],'name':_0x46e160[_0x4f2d0e(0x154)],'target':_0x46e160[_0x4f2d0e(0x172)]?.[_0x4f2d0e(0x185)]||_0x46e160[_0x4f2d0e(0x174)]?.[_0x4f2d0e(0x185)]||_0x46e160[_0x4f2d0e(0x166)]?.[_0x4f2d0e(0x185)]||_0x46e160['targetFunction']}}));}else{if(_0x4f2d0e(0x147)in _0x587c98)console[_0x4f2d0e(0x170)](JSON[_0x4f2d0e(0x161)]({'type':_0x4f2d0e(0x138),'data':{'id':_0x587c98[_0x4f2d0e(0x147)]['id'],'name':_0x587c98[_0x4f2d0e(0x147)][_0x4f2d0e(0x154)],'result':typeof _0x587c98[_0x4f2d0e(0x147)][_0x4f2d0e(0x180)]===_0x4f2d0e(0x146)?_0x587c98[_0x4f2d0e(0x147)][_0x4f2d0e(0x180)][_0x4f2d0e(0x151)](0x0,0x1f4):''}}));else _0x4f2d0e(0x17e)in _0x587c98&&console[_0x4f2d0e(0x170)](JSON['stringify']({'type':'error','data':{'error':_0x587c98[_0x4f2d0e(0x17e)]}}));}}}}}console[_0x4f2d0e(0x170)](JSON[_0x4f2d0e(0x161)]({'type':_0x4f2d0e(0x162)}));}async[a9_0x54c225(0x16f)](_0x3546b7){const _0x349709=a9_0x54c225,{options:_0x49782f,args:_0x8bd23d,tdx:_0x2d0eef}=_0x3546b7,_0x2b7962=_0x8bd23d[_0x349709(0x167)]('\x20'),_0x1241b0=_0x49782f,_0x452ea0=_0x1241b0[_0x349709(0x153)],_0x2831b0=_0x1241b0[_0x349709(0x178)],_0x57dc18=_0x1241b0[_0x349709(0x168)],_0x3b5024=_0x1241b0['new'],_0x2de55a=_0x1241b0[_0x349709(0x17a)],_0x532384=_0x1241b0[_0x349709(0x175)];if(_0x3b5024&&_0x2de55a)return console[_0x349709(0x17e)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x317df2,_0x4531f9;if(_0x2de55a)_0x4531f9=_0x2de55a;else!_0x3b5024&&(_0x4531f9=loadLastChatId(),_0x4531f9&&_0x49782f[_0x349709(0x17c)]&&console['error'](_0x349709(0x13b)+_0x4531f9));!_0x2de55a&&(_0x3b5024||!_0x4531f9)&&(_0x317df2=await resolveAgentId(_0x2d0eef,_0x452ea0,_0x2831b0,_0x57dc18,_0x49782f[_0x349709(0x17c)]));const _0x5ad1f2=_0x532384?(_0x26df19,_0x52fcf9,_0x268cda)=>this[_0x349709(0x13d)](_0x2d0eef,_0x26df19,_0x52fcf9,_0x268cda):(_0x5a3617,_0x291fca,_0x255e03)=>this[_0x349709(0x16c)](_0x2d0eef,_0x5a3617,_0x291fca,_0x255e03,_0x49782f[_0x349709(0x17c)]);try{await _0x5ad1f2(_0x2b7962,_0x317df2,_0x4531f9);}catch(_0x5ce389){const _0x435e9d=_0x5ce389 instanceof SDKError&&_0x5ce389[_0x349709(0x181)]===ErrorCode['CHAT_NOT_FOUND']||_0x5ce389 instanceof Error&&_0x5ce389[_0x349709(0x164)][_0x349709(0x171)](_0x349709(0x163));if(_0x435e9d&&_0x2de55a)return console['error'](_0x349709(0x144)+_0x2de55a+_0x349709(0x158)),0x1;if(_0x435e9d)_0x49782f[_0x349709(0x17c)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x317df2&&(_0x317df2=await resolveAgentId(_0x2d0eef,_0x452ea0,_0x2831b0,_0x57dc18,_0x49782f[_0x349709(0x17c)])),await _0x5ad1f2(_0x2b7962,_0x317df2,undefined);else throw _0x5ce389;}return!_0x532384&&console['log'](),0x0;}catch(_0x15a08c){return console['error'](),handleSDKError(_0x15a08c,_0x49782f),0x1;}}[a9_0x54c225(0x16e)](_0x230be1){const _0x16616f=a9_0x54c225;if(_0x16616f(0x180)in _0x230be1)process[_0x16616f(0x15e)][_0x16616f(0x14f)](_0x230be1[_0x16616f(0x180)]);else'error'in _0x230be1&&console['error'](_0x16616f(0x16a)+_0x230be1[_0x16616f(0x17e)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x54c225(0x185)]=a9_0x54c225(0x13e);[a9_0x54c225(0x14a)]=a9_0x54c225(0x183);['validate'](_0x1cc0d2){const _0x4793a3=a9_0x54c225,_0x1cc0b2=_0x1cc0d2['options'],_0x42684f=_0x1cc0b2[_0x4793a3(0x153)],_0x3ec941=_0x1cc0b2['llmAgent'];if(!_0x42684f&&!_0x3ec941)return _0x4793a3(0x15c);return undefined;}async[a9_0x54c225(0x16f)](_0x5d7466){const _0x230b91=a9_0x54c225,{options:_0x4be4d0,tdx:_0xedccb4}=_0x5d7466,_0x14119f=_0x4be4d0,_0x1a4d97=_0x14119f[_0x230b91(0x153)],_0x33b01c=_0x14119f[_0x230b91(0x178)],_0x2243b0=_0x14119f[_0x230b91(0x168)];try{const _0x237bda=await resolveAgentId(_0xedccb4,_0x1a4d97,_0x33b01c,_0x2243b0,_0x4be4d0['verbose']),_0x58fef5=await _0xedccb4[_0x230b91(0x15f)][_0x230b91(0x160)](_0x237bda);return saveLastChatId(_0x58fef5['id']),console[_0x230b91(0x170)](JSON[_0x230b91(0x161)]({'chatId':_0x58fef5['id'],'agentId':_0x237bda})),0x0;}catch(_0x152ecd){return handleSDKError(_0x152ecd,_0x4be4d0),0x1;}}}
1
+ const a9_0x5a827e=a9_0x5829;(function(_0x425735,_0x450670){const _0x4f06d6=a9_0x5829,_0x44e6d5=_0x425735();while(!![]){try{const _0x42a42c=parseInt(_0x4f06d6(0x1ea))/0x1*(-parseInt(_0x4f06d6(0x1e1))/0x2)+-parseInt(_0x4f06d6(0x1e3))/0x3*(-parseInt(_0x4f06d6(0x1c3))/0x4)+-parseInt(_0x4f06d6(0x1f2))/0x5*(-parseInt(_0x4f06d6(0x1f8))/0x6)+parseInt(_0x4f06d6(0x1d2))/0x7*(parseInt(_0x4f06d6(0x1df))/0x8)+parseInt(_0x4f06d6(0x1dd))/0x9*(parseInt(_0x4f06d6(0x1b1))/0xa)+parseInt(_0x4f06d6(0x1c2))/0xb+-parseInt(_0x4f06d6(0x1c7))/0xc;if(_0x42a42c===_0x450670)break;else _0x44e6d5['push'](_0x44e6d5['shift']());}catch(_0x4690d6){_0x44e6d5['push'](_0x44e6d5['shift']());}}}(a9_0x1cca,0x402dd));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x1d6a0a,_0x1f09c9){const _0x1180d6=a9_0x5829;if(_0x1d6a0a instanceof SDKError)console[_0x1180d6(0x1e5)]('Error:\x20'+_0x1d6a0a[_0x1180d6(0x1b5)]),_0x1f09c9['verbose']&&(_0x1d6a0a[_0x1180d6(0x1f6)]&&console[_0x1180d6(0x1e5)](_0x1180d6(0x1d3)+_0x1d6a0a[_0x1180d6(0x1f6)]),_0x1d6a0a[_0x1180d6(0x1c6)]&&(console[_0x1180d6(0x1e5)]('\x0aStack\x20trace:'),console[_0x1180d6(0x1e5)](_0x1d6a0a['stack'])));else throw _0x1d6a0a;}function a9_0x1cca(){const _0x258b07=['1521335mJulJI','projectId','getDefaultAgent','tool_call','cause','streamChatJsonl','6sruCXn','Resolving\x20agent\x20\x27','data','\x27...','Error:\x20Chat\x20session\x20\x27','llmAgent','26920doFsao','Continuing\x20chat:\x20','stream','\x27\x20not\x20found','message','404','write','llmProject','functionName','content','description','verbose','tool','join','stringify','done','getOrCreateDefaultAgent','3706351UaoMUe','165076NZHVio','args','options','stack','10559448SbFkFF','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','Chat\x20session:\x20','includes','handleChatEvent','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','claude-4.5-haiku','agentId','code','chat','resolveAgentId','20321BkHCsi','\x20\x20Cause:\x20','\x0aError:\x20','new','chatId','streamChat','llm','Create\x20a\x20new\x20chat\x20session','metadata','agent','resolveProjectId','882vPSiFQ','event','808vYLAtt','session\x20context','523482RojWkK','Getting\x20default\x20agent...','15gXNGHJ','type','error','slice','context','log','name','1fjWzfS','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','validate','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','execute','string','CHAT_NOT_FOUND','site'];a9_0x1cca=function(){return _0x258b07;};return a9_0x1cca();}function a9_0x5829(_0x5de84a,_0x30a25f){_0x5de84a=_0x5de84a-0x1af;const _0x1cca0e=a9_0x1cca();let _0x5829cf=_0x1cca0e[_0x5de84a];return _0x5829cf;}async function resolveAgentId(_0x34d766,_0x1c89a9,_0x21b0d5,_0x42c740,_0x5c598a){const _0xa87dc0=a9_0x5829,_0x225df3=_0x1c89a9||_0x21b0d5;if(_0x225df3){const {projectName:_0x17c3dc,agentName:_0x50e957}=parseAgentRef(_0x225df3),_0x28dcbc=_0x50e957||_0x225df3,_0x57aac0=_0x50e957?_0x17c3dc:_0x42c740;if(!_0x57aac0)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x5c598a){const _0x45cd8a=_0x1c89a9?'--agent\x20flag':_0xa87dc0(0x1e0);console[_0xa87dc0(0x1e5)]('Using\x20agent\x20from\x20'+_0x45cd8a+':\x20'+_0x57aac0+'/'+_0x28dcbc);}const _0x148da6=await withSpinner('Resolving\x20project\x20\x27'+_0x57aac0+_0xa87dc0(0x1fb),()=>_0x34d766[_0xa87dc0(0x1d8)][_0xa87dc0(0x1dc)](_0x57aac0),{'verbose':_0x5c598a}),_0x325b68=await withSpinner(_0xa87dc0(0x1f9)+_0x28dcbc+'\x27...',()=>_0x34d766[_0xa87dc0(0x1d8)][_0xa87dc0(0x1d1)](_0x28dcbc,_0x148da6[_0xa87dc0(0x1fa)]),{'verbose':_0x5c598a});return _0x325b68[_0xa87dc0(0x1fa)];}else{const _0x3b9c91=_0x34d766[_0xa87dc0(0x1d8)][_0xa87dc0(0x1f4)]();if(_0x3b9c91)return _0x5c598a&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0x3b9c91[_0xa87dc0(0x1e9)]),_0x3b9c91['id'];const _0xcc9bf1=await withSpinner(_0xa87dc0(0x1e2),()=>_0x34d766[_0xa87dc0(0x1d8)][_0xa87dc0(0x1c1)](_0xa87dc0(0x1cd),0x0),{'verbose':_0x5c598a});return _0xcc9bf1['data']['id'];}}export class ChatCommand extends BaseCommand{[a9_0x5a827e(0x1e9)]=a9_0x5a827e(0x1d0);[a9_0x5a827e(0x1bb)]=a9_0x5a827e(0x1eb);['validate'](_0x4bc50f){const _0x3f9071=a9_0x5a827e,_0x3b3e9c=_0x4bc50f[_0x3f9071(0x1c4)][_0x3f9071(0x1be)]('\x20');if(!_0x3b3e9c)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x270dea,_0x4c79ff,_0x3a7e10,_0x54b758,_0x335ac2){const _0x3202ff=a9_0x5a827e;for await(const _0x349966 of _0x270dea[_0x3202ff(0x1d8)][_0x3202ff(0x1d0)](_0x4c79ff,{'agentId':_0x3a7e10,'chatId':_0x54b758})){if(_0x349966[_0x3202ff(0x1e4)]===_0x3202ff(0x1da)){const _0x53ac17=_0x349966[_0x3202ff(0x1fa)][_0x3202ff(0x1d6)];saveLastChatId(_0x53ac17),_0x335ac2&&console['error'](_0x3202ff(0x1c9)+_0x53ac17);}else _0x349966[_0x3202ff(0x1e4)]===_0x3202ff(0x1de)&&this[_0x3202ff(0x1cb)](_0x349966[_0x3202ff(0x1fa)]);}}async[a9_0x5a827e(0x1f7)](_0x15b569,_0x3ae1bf,_0x434b6f,_0x31719d){const _0x4954a6=a9_0x5a827e,_0x2f87e4=_0x15b569[_0x4954a6(0x1e7)][_0x4954a6(0x1f1)];let _0x138027=![];for await(const _0x3b8625 of _0x15b569[_0x4954a6(0x1d8)][_0x4954a6(0x1d0)](_0x3ae1bf,{'agentId':_0x434b6f,'chatId':_0x31719d})){if(_0x3b8625[_0x4954a6(0x1e4)]===_0x4954a6(0x1da)){const _0x4e4d0b=_0x3b8625['data'];saveLastChatId(_0x4e4d0b[_0x4954a6(0x1d6)]);const _0xdc36d0=_0x4e4d0b['projectId']&&_0x4e4d0b['agentId']?getLLMConversationUrl(_0x2f87e4,_0x4e4d0b[_0x4954a6(0x1f3)],_0x4e4d0b[_0x4954a6(0x1ce)],_0x4e4d0b['chatId']):undefined;console[_0x4954a6(0x1e8)](JSON[_0x4954a6(0x1bf)]({'type':_0x4954a6(0x1da),'data':{'chatId':_0x4e4d0b[_0x4954a6(0x1d6)],'agentId':_0x4e4d0b[_0x4954a6(0x1ce)],'consoleUrl':_0xdc36d0}})),_0x138027=!![];}else{if(_0x3b8625[_0x4954a6(0x1e4)]===_0x4954a6(0x1de)){!_0x138027&&_0x31719d&&(console[_0x4954a6(0x1e8)](JSON['stringify']({'type':_0x4954a6(0x1da),'data':{'chatId':_0x31719d}})),_0x138027=!![]);const _0x1eb170=_0x3b8625['data'];if('content'in _0x1eb170)console[_0x4954a6(0x1e8)](JSON['stringify']({'type':_0x4954a6(0x1ba),'data':{'content':_0x1eb170[_0x4954a6(0x1ba)]}}));else{if('tool_call'in _0x1eb170){const _0x41d505=_0x1eb170['tool_call'];console[_0x4954a6(0x1e8)](JSON[_0x4954a6(0x1bf)]({'type':_0x4954a6(0x1f5),'data':{'id':_0x41d505['id'],'name':_0x41d505[_0x4954a6(0x1b9)],'target':_0x41d505['targetKnowledgeBase']?.[_0x4954a6(0x1e9)]||_0x41d505['targetAgent']?.[_0x4954a6(0x1e9)]||_0x41d505['targetWebSearchTool']?.[_0x4954a6(0x1e9)]||_0x41d505['targetFunction']}}));}else{if('tool'in _0x1eb170)console[_0x4954a6(0x1e8)](JSON['stringify']({'type':'tool_result','data':{'id':_0x1eb170[_0x4954a6(0x1bd)]['id'],'name':_0x1eb170[_0x4954a6(0x1bd)][_0x4954a6(0x1b9)],'result':typeof _0x1eb170['tool']['content']===_0x4954a6(0x1ef)?_0x1eb170['tool']['content'][_0x4954a6(0x1e6)](0x0,0x1f4):''}}));else _0x4954a6(0x1e5)in _0x1eb170&&console[_0x4954a6(0x1e8)](JSON[_0x4954a6(0x1bf)]({'type':_0x4954a6(0x1e5),'data':{'error':_0x1eb170[_0x4954a6(0x1e5)]}}));}}}}}console['log'](JSON[_0x4954a6(0x1bf)]({'type':_0x4954a6(0x1c0)}));}async['execute'](_0x13932a){const _0x469b13=a9_0x5a827e,{options:_0x3031fe,args:_0x354cc2,tdx:_0x18d1be}=_0x13932a,_0x3cabcd=_0x354cc2[_0x469b13(0x1be)]('\x20'),_0x51d4d5=_0x3031fe,_0x341066=_0x51d4d5[_0x469b13(0x1db)],_0x1a2b92=_0x51d4d5['llmAgent'],_0x4c9798=_0x51d4d5[_0x469b13(0x1b8)],_0x554737=_0x51d4d5[_0x469b13(0x1d5)],_0x219d39=_0x51d4d5['chatId'],_0x313ef6=_0x51d4d5[_0x469b13(0x1b3)];if(_0x554737&&_0x219d39)return console[_0x469b13(0x1e5)](_0x469b13(0x1ed)),0x1;try{let _0x1dd071,_0x240a90;if(_0x219d39)_0x240a90=_0x219d39;else!_0x554737&&(_0x240a90=loadLastChatId(),_0x240a90&&_0x3031fe[_0x469b13(0x1bc)]&&console[_0x469b13(0x1e5)](_0x469b13(0x1b2)+_0x240a90));!_0x219d39&&(_0x554737||!_0x240a90)&&(_0x1dd071=await resolveAgentId(_0x18d1be,_0x341066,_0x1a2b92,_0x4c9798,_0x3031fe[_0x469b13(0x1bc)]));const _0x35311a=_0x313ef6?(_0x1adcfb,_0x5352e1,_0xad44bf)=>this[_0x469b13(0x1f7)](_0x18d1be,_0x1adcfb,_0x5352e1,_0xad44bf):(_0x59794f,_0x16c62e,_0x384d12)=>this[_0x469b13(0x1d7)](_0x18d1be,_0x59794f,_0x16c62e,_0x384d12,_0x3031fe[_0x469b13(0x1bc)]);try{await _0x35311a(_0x3cabcd,_0x1dd071,_0x240a90);}catch(_0x53d21c){const _0x3e1146=_0x53d21c instanceof SDKError&&_0x53d21c[_0x469b13(0x1cf)]===ErrorCode[_0x469b13(0x1f0)]||_0x53d21c instanceof Error&&_0x53d21c['message'][_0x469b13(0x1ca)](_0x469b13(0x1b6));if(_0x3e1146&&_0x219d39)return console[_0x469b13(0x1e5)](_0x469b13(0x1af)+_0x219d39+_0x469b13(0x1b4)),0x1;if(_0x3e1146)_0x3031fe['verbose']&&console['error'](_0x469b13(0x1c8)),!_0x1dd071&&(_0x1dd071=await resolveAgentId(_0x18d1be,_0x341066,_0x1a2b92,_0x4c9798,_0x3031fe[_0x469b13(0x1bc)])),await _0x35311a(_0x3cabcd,_0x1dd071,undefined);else throw _0x53d21c;}return!_0x313ef6&&console['log'](),0x0;}catch(_0x57bfa5){return console[_0x469b13(0x1e5)](),handleSDKError(_0x57bfa5,_0x3031fe),0x1;}}[a9_0x5a827e(0x1cb)](_0x3173b2){const _0x4ce623=a9_0x5a827e;if(_0x4ce623(0x1ba)in _0x3173b2)process['stdout'][_0x4ce623(0x1b7)](_0x3173b2[_0x4ce623(0x1ba)]);else _0x4ce623(0x1e5)in _0x3173b2&&console['error'](_0x4ce623(0x1d4)+_0x3173b2[_0x4ce623(0x1e5)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x5a827e(0x1e9)]='chat-create';['description']=a9_0x5a827e(0x1d9);[a9_0x5a827e(0x1ec)](_0x3d10e4){const _0x1bb79a=a9_0x5a827e,_0x674121=_0x3d10e4[_0x1bb79a(0x1c5)],_0x42f310=_0x674121[_0x1bb79a(0x1db)],_0x39e59a=_0x674121['llmAgent'];if(!_0x42f310&&!_0x39e59a)return _0x1bb79a(0x1cc);return undefined;}async[a9_0x5a827e(0x1ee)](_0x3e3bb6){const _0x19d834=a9_0x5a827e,{options:_0x47f3a8,tdx:_0x464c5a}=_0x3e3bb6,_0xe61dc3=_0x47f3a8,_0x1112f0=_0xe61dc3[_0x19d834(0x1db)],_0x1ac902=_0xe61dc3[_0x19d834(0x1b0)],_0x33d386=_0xe61dc3['llmProject'];try{const _0x36e3bb=await resolveAgentId(_0x464c5a,_0x1112f0,_0x1ac902,_0x33d386,_0x47f3a8[_0x19d834(0x1bc)]),_0x339705=await _0x464c5a[_0x19d834(0x1d8)]['startChat'](_0x36e3bb);return saveLastChatId(_0x339705['id']),console['log'](JSON['stringify']({'chatId':_0x339705['id'],'agentId':_0x36e3bb})),0x0;}catch(_0x5f4daf){return handleSDKError(_0x5f4daf,_0x47f3a8),0x1;}}}
@@ -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_0x2b06c6=a10_0x36fb;(function(_0x113855,_0x31ae8a){const _0x10feaf=a10_0x36fb,_0x282eae=_0x113855();while(!![]){try{const _0x19044c=parseInt(_0x10feaf(0x116))/0x1+parseInt(_0x10feaf(0x157))/0x2*(parseInt(_0x10feaf(0x11c))/0x3)+parseInt(_0x10feaf(0x15c))/0x4+parseInt(_0x10feaf(0xfa))/0x5*(-parseInt(_0x10feaf(0xf9))/0x6)+parseInt(_0x10feaf(0x13b))/0x7+parseInt(_0x10feaf(0x145))/0x8+-parseInt(_0x10feaf(0xe0))/0x9;if(_0x19044c===_0x31ae8a)break;else _0x282eae['push'](_0x282eae['shift']());}catch(_0x3e1191){_0x282eae['push'](_0x282eae['shift']());}}}(a10_0x3580,0xebae5));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_0x1a2270 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=a10_0x2b06c6(0x174),SETTINGS_BACKUP_FILENAME='.tdx-settings-backup.json';function isProcessRunning(_0x4e1f5b){const _0x37b563=a10_0x2b06c6;try{return process[_0x37b563(0x14c)](_0x4e1f5b,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x41e5cd,_0x202e08){const _0x42cce9=a10_0x2b06c6;if(!existsSync(_0x41e5cd))return;try{const _0xad4ce6=await readFile(_0x41e5cd,_0x42cce9(0x153)),_0x2a3a23=JSON[_0x42cce9(0xd7)](_0xad4ce6),_0x326df2=_0x2a3a23['env']||{};for(const _0x354658 of[_0x42cce9(0xf7),_0x42cce9(0x16d),_0x42cce9(0x171),_0x42cce9(0x146),_0x42cce9(0x11b)]){_0x202e08[_0x354658]!==undefined?_0x326df2[_0x354658]=_0x202e08[_0x354658]:delete _0x326df2[_0x354658];}_0x202e08['statusLine']!==undefined?_0x2a3a23[_0x42cce9(0x12d)]=_0x202e08[_0x42cce9(0x12d)]:delete _0x2a3a23[_0x42cce9(0x12d)],_0x2a3a23['env']=_0x326df2,await writeFile(_0x41e5cd,JSON[_0x42cce9(0xe3)](_0x2a3a23,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x5568a3){try{await unlink(_0x5568a3);}catch{}}function a10_0x36fb(_0x322667,_0x5f289f){_0x322667=_0x322667-0xd4;const _0x358051=a10_0x3580();let _0x36fb5a=_0x358051[_0x322667];return _0x36fb5a;}async function recoverFromStaleBackup(_0x5e707b,_0x384928){const _0x45aa96=a10_0x2b06c6;if(!existsSync(_0x384928))return undefined;try{const _0x3ed9c3=await readFile(_0x384928,_0x45aa96(0x153)),_0x2d3a2d=JSON[_0x45aa96(0xd7)](_0x3ed9c3);if(isProcessRunning(_0x2d3a2d['pid']))return{'liveSessionOriginals':_0x2d3a2d[_0x45aa96(0x119)]};return await applyOriginalSettings(_0x5e707b,_0x2d3a2d[_0x45aa96(0x119)]),await safeUnlink(_0x384928),undefined;}catch{return await safeUnlink(_0x384928),undefined;}}function handleInstallationError(_0x49ac43,_0x5010bb,_0x25a1db,_0x3a4028){const _0x4b1ecc=a10_0x2b06c6;errorContains(_0x49ac43,_0x4b1ecc(0xf5),_0x4b1ecc(0x15a),_0x4b1ecc(0x16b))?(_0x25a1db['text']='✓\x20'+_0x5010bb+_0x4b1ecc(0x121),_0x3a4028?.[_0x4b1ecc(0x13f)](_0x5010bb+_0x4b1ecc(0x121)),_0x49ac43 instanceof SDKError&&_0x49ac43[_0x4b1ecc(0xe1)]&&_0x3a4028?.['debug'](_0x4b1ecc(0x16a)+_0x49ac43[_0x4b1ecc(0xe1)][_0x4b1ecc(0x16e)])):(_0x25a1db[_0x4b1ecc(0x16f)](_0x4b1ecc(0x137)+_0x5010bb),_0x3a4028?.['error'](_0x5010bb+'\x20configuration\x20failed',_0x49ac43));}export function parseVersion(_0x250260){const _0x4c6ed9=a10_0x2b06c6,_0x49cfde=_0x250260[_0x4c6ed9(0x142)]()[_0x4c6ed9(0x13d)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x49cfde)return null;return{'major':parseInt(_0x49cfde[0x1],0xa),'minor':parseInt(_0x49cfde[0x2],0xa),'patch':parseInt(_0x49cfde[0x3],0xa)};}export function compareVersions(_0x46a564,_0x7fc4cc){const _0x342ef7=a10_0x2b06c6;if(_0x46a564['major']!==_0x7fc4cc[_0x342ef7(0x101)])return _0x46a564[_0x342ef7(0x101)]-_0x7fc4cc[_0x342ef7(0x101)];if(_0x46a564[_0x342ef7(0xe6)]!==_0x7fc4cc[_0x342ef7(0xe6)])return _0x46a564[_0x342ef7(0xe6)]-_0x7fc4cc['minor'];return _0x46a564[_0x342ef7(0x138)]-_0x7fc4cc['patch'];}async function checkClaudeVersion(_0x33a599,_0x550bbb){const _0x1a471a=a10_0x2b06c6;_0x550bbb?.[_0x1a471a(0x14e)](_0x1a471a(0xf2)+_0x33a599+')');const _0x378259=await executeClaudeCommand(['--version'],undefined,_0x550bbb),_0x571f9a=parseVersion(_0x378259);if(!_0x571f9a){_0x550bbb?.['warn'](_0x1a471a(0x100)+_0x378259);return;}const _0x14d396=_0x571f9a[_0x1a471a(0x101)]+'.'+_0x571f9a[_0x1a471a(0xe6)]+'.'+_0x571f9a['patch'],_0x164471=parseVersion(_0x33a599);if(!_0x164471){_0x550bbb?.[_0x1a471a(0x16f)](_0x1a471a(0x162)+_0x33a599);return;}if(compareVersions(_0x571f9a,_0x164471)<0x0){_0x550bbb?.[_0x1a471a(0x13a)](_0x1a471a(0x13e)+_0x14d396+_0x1a471a(0x165)+_0x33a599+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],'Claude\x20Code\x20version\x20'+_0x14d396+_0x1a471a(0x14a)+_0x33a599+'\x20or\x20later.',undefined,{'helpText':_0x1a471a(0xe9)});}_0x550bbb?.[_0x1a471a(0x14e)](_0x1a471a(0x13e)+_0x14d396+_0x1a471a(0x107));}async function executeClaudeCommand(_0x3050fd,_0x5aefa8,_0x3b0a47){const _0x6eb311=a10_0x2b06c6;return _0x3b0a47?.[_0x6eb311(0x13f)]('Executing:\x20claude\x20'+_0x3050fd['join']('\x20')),new Promise((_0x38836e,_0x785887)=>{const _0x298cef=_0x6eb311,_0xe6b69=crossSpawn('claude',_0x3050fd,{'stdio':_0x298cef(0x139)});let _0x3d4476='',_0x4a9f27='';_0xe6b69['stdout']?.['on']('data',_0x392aee=>{const _0x25675c=_0x298cef;_0x3d4476+=_0x392aee[_0x25675c(0xec)]();}),_0xe6b69['stderr']?.['on'](_0x298cef(0x123),_0x191ea4=>{const _0x4226ff=_0x298cef;_0x4a9f27+=_0x191ea4[_0x4226ff(0xec)]();}),_0xe6b69['on']('error',_0x4928b2=>{const _0x41fab0=_0x298cef;_0x4928b2[_0x41fab0(0x11e)]===_0x41fab0(0xea)?(_0x3b0a47?.['error'](_0x41fab0(0x124)),_0x785887(new SDKError(ErrorCode[_0x41fab0(0x15b)],_0x41fab0(0x124),_0x4928b2,{'helpText':_0x41fab0(0x154)}))):(_0x3b0a47?.[_0x41fab0(0x13a)](_0x41fab0(0x12c)+_0x4928b2['message']),_0x785887(new SDKError(ErrorCode[_0x41fab0(0xfc)],_0x41fab0(0xed)+_0x4928b2['message'],_0x4928b2)));}),_0xe6b69['on']('exit',_0xd85749=>{const _0x48cb47=_0x298cef;if(_0xd85749===0x0)_0x38836e(_0x3d4476);else _0x5aefa8?(_0x3b0a47?.[_0x48cb47(0x13a)](_0x48cb47(0x109)+_0xd85749+_0x48cb47(0x12f)+_0x3050fd[_0x48cb47(0x15f)]('\x20')),_0x785887(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x5aefa8,new Error(_0x4a9f27)))):_0x38836e('');});});}async function ensureMcpServer(_0x43698c,_0x50cdb7,_0x5507d6,_0x151125,_0xaf29ce){const _0x946f77=a10_0x2b06c6;_0x151125['text']=_0x946f77(0x136)+_0x43698c+_0x946f77(0x14d),await executeClaudeCommand([_0x946f77(0xe4),_0x946f77(0x112),_0x43698c,_0x50cdb7,'--transport',_0x5507d6],_0x946f77(0x127)+_0x43698c+'\x27',_0xaf29ce),_0x151125[_0x946f77(0x168)]='✓\x20MCP\x20server\x20\x27'+_0x43698c+_0x946f77(0x158);}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x504e77=process.env.TDX_TD_SKILLS_REPO;if(_0x504e77)return _0x504e77;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x3176c8,_0x270f28){const _0x3e83cd=a10_0x2b06c6;try{const _0x16559a=await executeClaudeCommand([_0x3e83cd(0x159),_0x3e83cd(0xeb),_0x3e83cd(0xe5)],_0x3e83cd(0x133),_0x270f28);if(!_0x16559a['includes'](_0x3176c8)){_0x270f28?.[_0x3e83cd(0x14e)](_0x3e83cd(0x149)+_0x3176c8+_0x3e83cd(0x126));return;}await executeClaudeCommand([_0x3e83cd(0x159),_0x3e83cd(0xeb),_0x3e83cd(0x163),_0x3176c8],_0x3e83cd(0x160)+_0x3176c8+'\x27',_0x270f28),_0x270f28?.['info'](_0x3e83cd(0x149)+_0x3176c8+_0x3e83cd(0x178));}catch(_0x4b5b89){_0x270f28?.[_0x3e83cd(0x16f)](_0x3e83cd(0x160)+_0x3176c8+_0x3e83cd(0x105)+_0x4b5b89);}}async function restoreDefaultTdSkillsMarketplace(_0x2298b5){const _0x1e5da6=a10_0x2b06c6;try{await removeMarketplace(_0x1e5da6(0x155),_0x2298b5),await executeClaudeCommand(['plugin',_0x1e5da6(0xeb),_0x1e5da6(0x112),DEFAULT_TD_SKILLS_URL],undefined,_0x2298b5),_0x2298b5?.[_0x1e5da6(0x13f)](_0x1e5da6(0x108));}catch{}}async function ensureMarketplace(_0x35fe8d,_0x1d83dd,_0x3060a8,_0x2e358e){const _0x4ebf0a=a10_0x2b06c6;_0x3060a8[_0x4ebf0a(0x168)]=_0x4ebf0a(0xee)+_0x35fe8d+_0x4ebf0a(0x14d),await executeClaudeCommand([_0x4ebf0a(0x159),_0x4ebf0a(0xeb),_0x4ebf0a(0x112),_0x1d83dd],_0x4ebf0a(0x10a)+_0x35fe8d+'\x27',_0x2e358e),_0x3060a8[_0x4ebf0a(0x168)]=_0x4ebf0a(0x113)+_0x35fe8d+_0x4ebf0a(0x158);}async function updateMarketplace(_0x2227a6,_0x1e3cbb,_0x327ca7){const _0x4638b5=a10_0x2b06c6;_0x1e3cbb['text']=_0x4638b5(0x161)+_0x2227a6+'\x27...',await executeClaudeCommand([_0x4638b5(0x159),_0x4638b5(0xeb),_0x4638b5(0xfd)],_0x4638b5(0x141)+_0x2227a6+'\x27',_0x327ca7),_0x1e3cbb[_0x4638b5(0x168)]='✓\x20Marketplace\x20\x27'+_0x2227a6+_0x4638b5(0x16c);}async function ensurePlugin(_0x13e7ab,_0x289da6,_0x45afa6,_0x37bc92){const _0x14f904=a10_0x2b06c6;_0x45afa6[_0x14f904(0x168)]=_0x14f904(0xf8)+_0x13e7ab+'\x27...',await executeClaudeCommand(['plugin',_0x14f904(0x173),_0x13e7ab+'@'+_0x289da6],_0x14f904(0x129)+_0x13e7ab+'\x27',_0x37bc92),_0x45afa6[_0x14f904(0x168)]=_0x14f904(0x104)+_0x13e7ab+'\x27\x20installed';}function getClaudeConfigDir(){return process.env.CLAUDE_CONFIG_DIR||join(homedir(),'.claude');}async function checkoutReleaseTag(_0x1b5c59,_0x26921e,_0x120b86){const _0x4b5b63=a10_0x2b06c6,_0x3157fa=join(getClaudeConfigDir(),_0x4b5b63(0x148),_0x4b5b63(0xf4),_0x4b5b63(0x155));if(!existsSync(_0x3157fa)){_0x120b86?.['debug']('td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout');return;}_0x26921e['text']=_0x4b5b63(0x132)+_0x1b5c59+_0x4b5b63(0x10b),await execFileAsync(_0x4b5b63(0xd6),['fetch',_0x4b5b63(0xf1),_0x4b5b63(0xde),'--force'],{'cwd':_0x3157fa});try{await execFileAsync(_0x4b5b63(0xd6),[_0x4b5b63(0x11f),_0x4b5b63(0xdd)],{'cwd':_0x3157fa});}catch{await execFileAsync(_0x4b5b63(0xd6),[_0x4b5b63(0x11f),'-b',_0x4b5b63(0xdd),'origin/main'],{'cwd':_0x3157fa});}await execFileAsync(_0x4b5b63(0xd6),[_0x4b5b63(0x12a),_0x4b5b63(0x114),_0x1b5c59],{'cwd':_0x3157fa}),_0x26921e[_0x4b5b63(0x168)]=_0x4b5b63(0xff)+_0x1b5c59,_0x120b86?.[_0x4b5b63(0x13f)](_0x4b5b63(0xda)+_0x1b5c59);}function a10_0x3580(){const _0x20ff4b=['originalSettings','Checking\x20Claude\x20Code\x20version...','CLAUDE_CODE_USE_VERTEX','1738761xwFKmq','getLogPath','code','checkout','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','\x20already\x20configured','Failed\x20to\x20launch\x20Claude\x20Code:\x20','data','Claude\x20Code\x20CLI\x20not\x20found','https://docs.treasuredata.com/mcp','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','execute','Failed\x20to\x20install\x20plugin\x20\x27','reset','fail','Command\x20spawn\x20error:\x20','statusLine','profile','):\x20claude\x20','apiKey','llm-proxy','Checking\x20out\x20td-skills\x20','Failed\x20to\x20list\x20marketplaces','proxy','Setup\x20failed','Configuring\x20MCP\x20server\x20\x27','Warning:\x20Failed\x20to\x20configure\x20','patch','pipe','error','12163564wiVbYH','resume','match','Claude\x20Code\x20version\x20','info','command','Failed\x20to\x20update\x20marketplace\x20\x27','trim','tdx\x20claude\x20statusline','stop','3393880Esifjq','CLAUDE_CODE_USE_BEDROCK','td-docs','plugins','Marketplace\x20\x27','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','port','kill','\x27...','debug','logLevel','start','Initializing...','Claude\x20Code\x20version\x20check\x20failed','utf-8','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','td-skills','user','4kyxUFV','\x27\x20configured','plugin','already\x20installed','CLAUDE_CODE_NOT_FOUND','3287488zzigiM','account_id','✓\x20Settings\x20restored:\x20.claude/settings.local.json','join','Failed\x20to\x20remove\x20marketplace\x20\x27','Updating\x20marketplace\x20\x27','Invalid\x20minimum\x20version\x20format:\x20','remove','context','\x20is\x20too\x20old\x20(minimum:\x20','.claude','pid','text','claude','Command\x20output:\x20','already\x20configured','\x27\x20updated','ANTHROPIC_MODEL','message','warn','sql-skills','ANTHROPIC_AUTH_TOKEN','http','install','2.0.20','INVALID_ARGUMENT','workflow-skills','TD\x20Docs\x20MCP\x20Server','\x27\x20removed','tdx\x20--profile\x20','✓\x20Logs\x20saved\x20to\x20','✓\x20Claude\x20Code\x20version\x20OK','git','parse','false','exit','td-skills\x20checked\x20out\x20at\x20tag\x20','http://127.0.0.1:','green','main','--tags','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','25673517qwdwUC','cause','passThroughServer','stringify','mcp','list','minor','verbose','close','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','ENOENT','marketplace','toString','Failed\x20to\x20spawn\x20claude\x20command:\x20','Configuring\x20marketplace\x20\x27','unshift','inherit','origin','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','getCurrent','marketplaces','already\x20exists','description','ANTHROPIC_BASE_URL','Installing\x20plugin\x20\x27','379614WHXSzS','135vuDSOn','env','INTERNAL','update','logger','✓\x20td-skills\x20checked\x20out\x20at\x20','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','major','log','\x20→\x20','✓\x20Plugin\x20\x27','\x27:\x20','site','\x20meets\x20minimum\x20requirement','Restored\x20default\x20td-skills\x20marketplace','Command\x20failed\x20(exit\x20','Failed\x20to\x20configure\x20marketplace\x20\x27','...','cwd','tdx-managed-proxy','Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','init','add','✓\x20Marketplace\x20\x27','--hard','settings.local.json','1383292wWKxvC','toISOString','red'];a10_0x3580=function(){return _0x20ff4b;};return a10_0x3580();}async function createClaudeSettings(_0x30f6d7,_0x4ac23b,_0x335ffe){const _0x53f97d=a10_0x2b06c6,_0x5b635a=join(process['cwd'](),_0x53f97d(0x166)),_0x1c9154=join(_0x5b635a,_0x53f97d(0x115)),_0x3824cc=join(_0x5b635a,SETTINGS_BACKUP_FILENAME);await mkdir(_0x5b635a,{'recursive':!![]});const _0xf7bf05=await recoverFromStaleBackup(_0x1c9154,_0x3824cc);let _0x5d1109;if(_0xf7bf05)_0x5d1109=_0xf7bf05['liveSessionOriginals'];else{let _0xc725a7={};if(existsSync(_0x1c9154))try{const _0x2176a2=await readFile(_0x1c9154,_0x53f97d(0x153));_0xc725a7=JSON[_0x53f97d(0xd7)](_0x2176a2);}catch{_0xc725a7={};}const _0x36cd91=_0xc725a7[_0x53f97d(0xfb)]||{};_0x5d1109={'ANTHROPIC_BASE_URL':_0x36cd91['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x36cd91[_0x53f97d(0x16d)],'ANTHROPIC_AUTH_TOKEN':_0x36cd91[_0x53f97d(0x171)],'CLAUDE_CODE_USE_BEDROCK':_0x36cd91[_0x53f97d(0x146)],'CLAUDE_CODE_USE_VERTEX':_0x36cd91[_0x53f97d(0x11b)],'statusLine':_0xc725a7[_0x53f97d(0x12d)]};const _0x227ec9={'createdAt':new Date()[_0x53f97d(0x117)](),'pid':process['pid'],'originalSettings':_0x5d1109};await writeFile(_0x3824cc,JSON[_0x53f97d(0xe3)](_0x227ec9,null,0x2)+'\x0a');}let _0x528c37={};if(existsSync(_0x1c9154))try{const _0x24b7eb=await readFile(_0x1c9154,_0x53f97d(0x153));_0x528c37=JSON['parse'](_0x24b7eb);}catch{_0x528c37={};}const _0x4b26de=_0x528c37[_0x53f97d(0xfb)]||{},_0x51860d={..._0x528c37,'env':{..._0x4b26de,'ANTHROPIC_BASE_URL':_0x53f97d(0xdb)+_0x30f6d7,..._0x4ac23b&&{'ANTHROPIC_MODEL':_0x4ac23b},'ANTHROPIC_AUTH_TOKEN':_0x53f97d(0x10d),'CLAUDE_CODE_USE_BEDROCK':_0x53f97d(0xd8),'CLAUDE_CODE_USE_VERTEX':_0x53f97d(0xd8)},'statusLine':{'type':_0x53f97d(0x140),'command':_0x335ffe?_0x53f97d(0x179)+_0x335ffe+'\x20claude\x20statusline':_0x53f97d(0x143)}};return await writeFile(_0x1c9154,JSON['stringify'](_0x51860d,null,0x2)+'\x0a'),_0x5d1109;}async function restoreClaudeSettings(_0x1624b4){const _0x2de569=a10_0x2b06c6,_0x1a44fb=join(process[_0x2de569(0x10c)](),_0x2de569(0x166)),_0x4ae1c7=join(_0x1a44fb,_0x2de569(0x115)),_0xc159ff=join(_0x1a44fb,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x4ae1c7,_0x1624b4);try{if(existsSync(_0xc159ff)){const _0x25c536=await readFile(_0xc159ff,_0x2de569(0x153)),_0x3c3c86=JSON[_0x2de569(0xd7)](_0x25c536);_0x3c3c86['pid']===process[_0x2de569(0x167)]&&await safeUnlink(_0xc159ff);}}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a10_0x2b06c6(0x169);[a10_0x2b06c6(0xf6)]=a10_0x2b06c6(0x110);[a10_0x2b06c6(0xe2)];['originalSettings'];[a10_0x2b06c6(0xfe)];['port'];async[a10_0x2b06c6(0x128)](_0x1fcd49){const _0x192fb4=a10_0x2b06c6,{tdx:_0x341f6d,options:_0x32e88c,args:_0x29f65c}=_0x1fcd49;let _0x52d910=![];try{const _0xe84d7d=_0x32e88c,_0x7199c5=_0xe84d7d[_0x192fb4(0x134)]===![],_0x52562b=_0xe84d7d['continue']===!![],_0x25da30=_0xe84d7d[_0x192fb4(0x13c)]===!![],_0xa4e03=[..._0x29f65c];if(_0x52562b)_0xa4e03['unshift']('-c');else _0x25da30&&_0xa4e03[_0x192fb4(0xef)]('-r');const _0x6de4e6=createCommandSpinner(_0x192fb4(0x151),{'verbose':_0x32e88c[_0x192fb4(0xe7)]});_0x6de4e6[_0x192fb4(0x150)]();try{if(!_0x7199c5){const _0x4b8552=_0x32e88c[_0x192fb4(0x12e)];try{const _0x3737cf=await _0x341f6d[_0x192fb4(0x156)][_0x192fb4(0xf3)]();_0x3737cf[_0x192fb4(0x15d)]&&writeCachedAccountInfo(_0x32e88c[_0x192fb4(0x106)],_0x3737cf[_0x192fb4(0x15d)],_0x4b8552);}catch{}_0x6de4e6[_0x192fb4(0x168)]='Initializing\x20proxy\x20logger...',this['logger']=new TDXLogger(_0x32e88c[_0x192fb4(0x14f)],!![]),await this[_0x192fb4(0xfe)][_0x192fb4(0x111)]();const _0x463327=this[_0x192fb4(0xfe)][_0x192fb4(0x11d)]();_0x6de4e6[_0x192fb4(0x168)]='✓\x20Logging\x20to\x20'+_0x463327;const _0x4b127c=getEndpoint(_0x32e88c[_0x192fb4(0x106)],_0x192fb4(0x131));_0x6de4e6[_0x192fb4(0x168)]=_0x192fb4(0x120);if(!_0x341f6d[_0x192fb4(0x164)][_0x192fb4(0x130)])throw new SDKError(ErrorCode[_0x192fb4(0x175)],_0x192fb4(0x10f));this['passThroughServer']=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x4b127c,'apiKey':_0x341f6d[_0x192fb4(0x164)]['apiKey'],'logger':this[_0x192fb4(0xfe)],'site':_0x32e88c[_0x192fb4(0x106)],'profile':_0x4b8552}),await this['passThroughServer'][_0x192fb4(0x150)](),this[_0x192fb4(0x14b)]=this[_0x192fb4(0xe2)][_0x192fb4(0x14b)],_0x6de4e6['text']=_0x192fb4(0xdf)+this[_0x192fb4(0x14b)]+_0x192fb4(0x103)+_0x4b127c,_0x6de4e6['text']='Creating\x20.claude/settings.local.json...',this[_0x192fb4(0x119)]=await createClaudeSettings(this[_0x192fb4(0x14b)],undefined,_0x4b8552),_0x6de4e6['text']='✓\x20Settings\x20configured:\x20.claude/settings.local.json';}else _0x6de4e6[_0x192fb4(0x168)]='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';try{_0x6de4e6[_0x192fb4(0x168)]=_0x192fb4(0x11a),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x192fb4(0xfe)]),_0x6de4e6['text']=_0x192fb4(0xd5);}catch(_0x58c225){_0x6de4e6[_0x192fb4(0x12b)](_0x192fb4(0x152));throw _0x58c225;}try{await ensureMcpServer(_0x192fb4(0x147),_0x192fb4(0x125),_0x192fb4(0x172),_0x6de4e6,this[_0x192fb4(0xfe)]);}catch(_0x3a8b91){handleInstallationError(_0x3a8b91,_0x192fb4(0x177),_0x6de4e6,this[_0x192fb4(0xfe)]);}try{const _0x2c300b=getTdSkillsRepoUrl();_0x52d910=_0x2c300b!==DEFAULT_TD_SKILLS_URL;_0x52d910&&await removeMarketplace('td-skills',this[_0x192fb4(0xfe)]);await ensureMarketplace(_0x192fb4(0x155),_0x2c300b,_0x6de4e6,this[_0x192fb4(0xfe)]),await updateMarketplace('td-skills',_0x6de4e6,this[_0x192fb4(0xfe)]),await ensurePlugin(_0x192fb4(0x170),_0x192fb4(0x155),_0x6de4e6,this[_0x192fb4(0xfe)]),await ensurePlugin(_0x192fb4(0x176),_0x192fb4(0x155),_0x6de4e6,this[_0x192fb4(0xfe)]),await ensurePlugin('tdx-skills','td-skills',_0x6de4e6,this[_0x192fb4(0xfe)]);try{const _0x52286a=loadReleaseChannel(),_0x1a4017=await resolveReleaseTag(_0x52286a,'treasure-data',_0x192fb4(0x155),'tdx-cli');_0x1a4017&&await checkoutReleaseTag(_0x1a4017,_0x6de4e6,this[_0x192fb4(0xfe)]);}catch(_0x55b2da){this[_0x192fb4(0xfe)]?.['warn'](_0x192fb4(0x10e)+_0x55b2da);}}catch(_0xf1a8c7){handleInstallationError(_0xf1a8c7,'td-skills\x20Plugins',_0x6de4e6,this[_0x192fb4(0xfe)]);}_0x6de4e6[_0x192fb4(0x144)]();}catch(_0xcd62ec){_0x6de4e6['fail'](_0x192fb4(0x135));throw _0xcd62ec;}const _0x4c195c=await findExecutable(_0x192fb4(0x169));if(!_0x4c195c)throw new SDKError(ErrorCode[_0x192fb4(0x15b)],_0x192fb4(0x124),undefined,{'helpText':_0x192fb4(0x154)});const _0x15c461={...process.env};!_0x7199c5&&(_0x15c461[_0x192fb4(0xf7)]=_0x192fb4(0xdb)+this[_0x192fb4(0x14b)],_0x15c461[_0x192fb4(0x171)]=_0x192fb4(0x10d),_0x15c461[_0x192fb4(0x146)]=_0x192fb4(0xd8),_0x15c461[_0x192fb4(0x11b)]=_0x192fb4(0xd8));const _0x55a645=crossSpawn(_0x4c195c,_0xa4e03,{'stdio':_0x192fb4(0xf0),'env':_0x15c461}),_0x2fe123=await new Promise(_0x54c342=>{const _0x2bb460=_0x192fb4;_0x55a645['on'](_0x2bb460(0xd9),_0x1f9a97=>{_0x54c342(_0x1f9a97||0x0);}),_0x55a645['on']('error',_0x5b17d1=>{const _0x5debd8=_0x2bb460;console['error'](a10_0x1a2270[_0x5debd8(0x118)](_0x5debd8(0x122)+_0x5b17d1[_0x5debd8(0x16e)])),_0x54c342(0x1);});});_0x52d910&&await restoreDefaultTdSkillsMarketplace(this[_0x192fb4(0xfe)]);this[_0x192fb4(0xe2)]&&(await this[_0x192fb4(0xe2)][_0x192fb4(0x144)](),console[_0x192fb4(0x102)](a10_0x1a2270[_0x192fb4(0xdc)]('✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped')));if(this[_0x192fb4(0xfe)]){await this[_0x192fb4(0xfe)][_0x192fb4(0xe8)]();const _0x36fd47=this[_0x192fb4(0xfe)]['getLogPath']();console['log'](a10_0x1a2270['green'](_0x192fb4(0xd4)+_0x36fd47));}return this[_0x192fb4(0x119)]&&(await restoreClaudeSettings(this[_0x192fb4(0x119)]),console['log'](a10_0x1a2270[_0x192fb4(0xdc)](_0x192fb4(0x15e)))),_0x2fe123;}catch(_0x21ba22){_0x52d910&&await restoreDefaultTdSkillsMarketplace(this[_0x192fb4(0xfe)]);this[_0x192fb4(0xe2)]&&await this[_0x192fb4(0xe2)][_0x192fb4(0x144)]();this['logger']&&await this['logger'][_0x192fb4(0xe8)]();this[_0x192fb4(0x119)]&&await restoreClaudeSettings(this['originalSettings']);throw _0x21ba22;}}}
@@ -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_0x5bd679=a11_0x4f47;(function(_0x31f456,_0x3055e1){const _0x45dd36=a11_0x4f47,_0x336a59=_0x31f456();while(!![]){try{const _0xab73d7=parseInt(_0x45dd36(0x170))/0x1*(parseInt(_0x45dd36(0x184))/0x2)+parseInt(_0x45dd36(0x176))/0x3+parseInt(_0x45dd36(0x18a))/0x4*(parseInt(_0x45dd36(0x18c))/0x5)+-parseInt(_0x45dd36(0x179))/0x6*(-parseInt(_0x45dd36(0x17e))/0x7)+parseInt(_0x45dd36(0x165))/0x8+parseInt(_0x45dd36(0x182))/0x9+-parseInt(_0x45dd36(0x180))/0xa*(parseInt(_0x45dd36(0x175))/0xb);if(_0xab73d7===_0x3055e1)break;else _0x336a59['push'](_0x336a59['shift']());}catch(_0x1ebfaf){_0x336a59['push'](_0x336a59['shift']());}}}(a11_0x1c3f,0x6bc12));function a11_0x1c3f(){const _0x459f64=['toFixed','statusline','177077LWRcaA','tdx','profile','tdx\x20','current_usage','286MHHJdd','538479GVkRNQ','session_id','\x20session\x20/\x20','17442xcuyxg','todayCredits','line','push','🪙\x20credit:\x20','399DQYbVS','log','498700XbqhmY','parse','3718989fCLzpL','description','6XEreiX','cache_creation_input_tokens','name','input_tokens','💎\x20tdx\x20-\x20Claude','accountId','30964nYbNxf','join','50zxcdHA','sessionCredits','options','close','2967424lbxHWv','Claude','site','\x20month','execute','\x20today\x20/\x20','\x20|\x20','💎\x20','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)'];a11_0x1c3f=function(){return _0x459f64;};return a11_0x1c3f();}import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x210c73=0x64){return new Promise(_0x544069=>{const _0x507913=a11_0x4f47;let _0x3011fc='',_0x5312e6=![];const _0x4822a1=createInterface({'input':process['stdin'],'terminal':![]}),_0x5c1d05=_0x214751=>{if(_0x5312e6)return;_0x5312e6=!![],clearTimeout(_0x33e40f),_0x4822a1['close'](),_0x544069(_0x214751);},_0x33e40f=setTimeout(()=>{_0x5c1d05(null);},_0x210c73);_0x4822a1['on'](_0x507913(0x17b),_0x125c50=>{_0x3011fc+=_0x125c50;}),_0x4822a1['on'](_0x507913(0x164),()=>{const _0x424a3f=_0x507913;if(_0x5312e6)return;try{const _0x7ad7fa=JSON[_0x424a3f(0x181)](_0x3011fc);_0x5c1d05(_0x7ad7fa);}catch{_0x5c1d05(null);}});});}function formatCredits(_0x4c48a5){const _0x451f94=a11_0x4f47;return _0x4c48a5[_0x451f94(0x16e)](0x2);}function a11_0x4f47(_0x437de1,_0x3172d1){_0x437de1=_0x437de1-0x164;const _0x1c3f89=a11_0x1c3f();let _0x4f47b0=_0x1c3f89[_0x437de1];return _0x4f47b0;}export class ClaudeStatuslineCommand extends BaseCommand{[a11_0x5bd679(0x186)]=a11_0x5bd679(0x16f);[a11_0x5bd679(0x183)]=a11_0x5bd679(0x16d);async[a11_0x5bd679(0x169)](_0x1a4aeb){const _0x35302b=a11_0x5bd679;try{const _0x3dc259=await readStdinJson();if(!_0x3dc259?.[_0x35302b(0x177)])return console[_0x35302b(0x17f)](_0x35302b(0x188)),0x0;const _0x15396d=_0x3dc259['session_id'],_0x4973c7=_0x3dc259['model']?.['id']||'',_0x1859ef=_0x3dc259[_0x35302b(0x172)]||_0x1a4aeb[_0x35302b(0x18e)]['profile'],_0x5de2f7=await getUsageStats(_0x15396d,_0x1859ef),_0x55e2ef=[],_0x5c6f4e=readCachedAccountInfo(_0x1859ef),_0xf5efde=_0x5c6f4e?_0x35302b(0x173)+_0x5c6f4e[_0x35302b(0x167)]+':'+_0x5c6f4e[_0x35302b(0x189)]:_0x35302b(0x171),_0xbe017d=_0x4973c7?getModelDisplayName(_0x4973c7):_0x35302b(0x166);_0x55e2ef['push'](_0x35302b(0x16c)+_0xf5efde+'\x20-\x20'+_0xbe017d);const _0x3d8cee=formatCredits(_0x5de2f7[_0x35302b(0x18d)]),_0x3b04dc=formatCredits(_0x5de2f7[_0x35302b(0x17a)]),_0x46e5cf=formatCredits(_0x5de2f7['monthCredits']);_0x55e2ef[_0x35302b(0x17c)](_0x35302b(0x17d)+_0x3d8cee+_0x35302b(0x178)+_0x3b04dc+_0x35302b(0x16a)+_0x46e5cf+_0x35302b(0x168));const _0x2ad33a=_0x3dc259['context_window'],_0x25d534=_0x2ad33a?.[_0x35302b(0x174)];if(_0x25d534&&_0x2ad33a?.['used_percentage']!=null){const _0x2eb631=_0x25d534[_0x35302b(0x187)]+_0x25d534[_0x35302b(0x185)]+_0x25d534['cache_read_input_tokens'],_0x4b61ba=formatTokenCount(_0x2eb631),_0x55a3f7=Math['round'](_0x2ad33a['used_percentage']);_0x55e2ef['push']('🧠\x20'+_0x4b61ba+'\x20('+_0x55a3f7+'%)');}return console[_0x35302b(0x17f)](_0x55e2ef[_0x35302b(0x18b)](_0x35302b(0x16b))),0x0;}catch{return console['log']('💎\x20tdx\x20-\x20Claude'),0x0;}}}
@@ -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_0x1860(){const _0x36c92c=['\x20credits','956816xnYQaI','error','101026CgRrJF','Profile','toFixed','all','Error:\x20','1853184tNgwAD','(default)','outputStructured','Source','toLocaleDateString','cyan','description','totalCredits','Unknown\x20error','round','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','length','Today','9566472SZcKtf','Usage\x20by\x20Source','Credits','Usage\x20by\x20Profile','2-digit','monthCredits','en-CA','profileCount','toLocaleTimeString','profile','2025828DKRiZj','repeat','red','1761130DyUdYs','\x20\x20Month:\x20\x20\x20','short','numeric','json','\x20\x20Today:\x20\x20\x20','format','bold','default','en-US','max','padStart','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','dim','yesterday','outputTable','entryCount','lastUsedAt','never','todayCredits','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','message','\x20days\x20ago','4WrKmtq','log','getTime','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','source','\x20\x20Total:\x20\x20\x20','Total','padEnd','credits','map','usage','873656LUsLCQ'];a12_0x1860=function(){return _0x36c92c;};return a12_0x1860();}function a12_0x1c3d(_0x5a3b1e,_0x56b0ad){_0x5a3b1e=_0x5a3b1e-0x15a;const _0x18607c=a12_0x1860();let _0x1c3d75=_0x18607c[_0x5a3b1e];return _0x1c3d75;}const a12_0x3dc1f2=a12_0x1c3d;(function(_0x5411d4,_0x3401d4){const _0x4854e6=a12_0x1c3d,_0x1891d7=_0x5411d4();while(!![]){try{const _0x1c5c16=-parseInt(_0x4854e6(0x195))/0x1*(-parseInt(_0x4854e6(0x186))/0x2)+-parseInt(_0x4854e6(0x19a))/0x3+-parseInt(_0x4854e6(0x193))/0x4+-parseInt(_0x4854e6(0x16f))/0x5+parseInt(_0x4854e6(0x16c))/0x6+-parseInt(_0x4854e6(0x191))/0x7+parseInt(_0x4854e6(0x162))/0x8;if(_0x1c5c16===_0x3401d4)break;else _0x1891d7['push'](_0x1891d7['shift']());}catch(_0x178caa){_0x1891d7['push'](_0x1891d7['shift']());}}}(a12_0x1860,0x6207d));import a12_0x25b062 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x11b44b){const _0x3e0734=a12_0x1c3d;return _0x11b44b[_0x3e0734(0x197)](0x2);}function formatLastUsed(_0x4ce6be){const _0x8be54d=a12_0x1c3d;if(!_0x4ce6be)return _0x8be54d(0x181);const _0x5883ec=new Date(_0x4ce6be),_0x47c76f=new Date(),_0x4ac022=_0x5883ec[_0x8be54d(0x19e)](_0x8be54d(0x168)),_0x32e9d7=_0x47c76f[_0x8be54d(0x19e)](_0x8be54d(0x168));if(_0x4ac022===_0x32e9d7)return'today\x20'+_0x5883ec[_0x8be54d(0x16a)]('en-US',{'hour':_0x8be54d(0x166),'minute':_0x8be54d(0x166)});const _0x564c8c=new Date(_0x4ac022),_0x407c14=new Date(_0x32e9d7),_0x13ef31=Math[_0x8be54d(0x15e)]((_0x407c14['getTime']()-_0x564c8c[_0x8be54d(0x188)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x13ef31===0x1)return _0x8be54d(0x17d);else return _0x13ef31>0x1&&_0x13ef31<0x7?_0x13ef31+_0x8be54d(0x185):_0x5883ec[_0x8be54d(0x19e)](_0x8be54d(0x178),{'month':_0x8be54d(0x171),'day':_0x8be54d(0x172)});}export class ClaudeUsageCommand extends BaseCommand{['name']=a12_0x3dc1f2(0x190);[a12_0x3dc1f2(0x15b)]=a12_0x3dc1f2(0x15f);async['execute'](_0x46b5c2){const _0xdee9e8=a12_0x3dc1f2,{options:_0x41dabe}=_0x46b5c2,_0x1d94eb=_0x41dabe[_0xdee9e8(0x175)]==='json'||_0x41dabe[_0xdee9e8(0x175)]==='jsonl'||_0x41dabe[_0xdee9e8(0x173)];try{const [_0x416539,_0x3a4238,_0x1075ca]=await Promise[_0xdee9e8(0x198)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x1d94eb?await this[_0xdee9e8(0x19c)](_0x416539,_0x3a4238,_0x1075ca,_0x41dabe):this[_0xdee9e8(0x17e)](_0x416539,_0x3a4238,_0x1075ca),0x0;}catch(_0x2557fd){const _0x3b33eb=_0x2557fd instanceof Error?_0x2557fd[_0xdee9e8(0x184)]:_0xdee9e8(0x15d);return console[_0xdee9e8(0x194)](a12_0x25b062[_0xdee9e8(0x16e)](_0xdee9e8(0x199)+_0x3b33eb)),0x1;}}async[a12_0x3dc1f2(0x19c)](_0x4819c3,_0x58b6e6,_0x46e283,_0x307fb4){const _0x37b0e6=a12_0x3dc1f2,_0x560da5={'summary':{'todayCredits':_0x46e283['todayCredits'],'monthCredits':_0x46e283[_0x37b0e6(0x167)],'totalCredits':_0x46e283[_0x37b0e6(0x15c)],'profileCount':_0x46e283[_0x37b0e6(0x169)]},'profiles':_0x4819c3[_0x37b0e6(0x18f)](_0x2c2b70=>({'profile':_0x2c2b70['profile'],'credits':_0x2c2b70['credits'],'requests':_0x2c2b70[_0x37b0e6(0x17f)],'lastUsedAt':_0x2c2b70[_0x37b0e6(0x180)]})),'sources':_0x58b6e6[_0x37b0e6(0x18f)](_0x46dee1=>({'source':_0x46dee1['source'],'credits':_0x46dee1[_0x37b0e6(0x18e)],'todayCredits':_0x46dee1[_0x37b0e6(0x182)],'monthCredits':_0x46dee1['monthCredits'],'requests':_0x46dee1[_0x37b0e6(0x17f)]}))};await handleSDKOutput([_0x560da5],_0x307fb4);}['outputTable'](_0x16ff44,_0x115e85,_0x4deab0){const _0x4198b6=a12_0x3dc1f2;console[_0x4198b6(0x187)](a12_0x25b062[_0x4198b6(0x176)](_0x4198b6(0x189))),console['log'](a12_0x25b062['dim']('─'[_0x4198b6(0x16d)](0x32))),console[_0x4198b6(0x187)](_0x4198b6(0x174)+a12_0x25b062[_0x4198b6(0x15a)](formatCredits(_0x4deab0['todayCredits']))+_0x4198b6(0x192)),console[_0x4198b6(0x187)](_0x4198b6(0x170)+a12_0x25b062[_0x4198b6(0x15a)](formatCredits(_0x4deab0[_0x4198b6(0x167)]))+_0x4198b6(0x192)),console[_0x4198b6(0x187)](_0x4198b6(0x18b)+a12_0x25b062[_0x4198b6(0x15a)](formatCredits(_0x4deab0['totalCredits']))+_0x4198b6(0x192)),console[_0x4198b6(0x187)]();if(_0x115e85[_0x4198b6(0x160)]>0x0){console[_0x4198b6(0x187)](a12_0x25b062['bold'](_0x4198b6(0x163))),console['log'](a12_0x25b062[_0x4198b6(0x17c)]('─'[_0x4198b6(0x16d)](0x3c)));const _0x510ea3=0xc,_0x266595=0xa,_0x12b7e1=0xa,_0x53d717=0xa;console[_0x4198b6(0x187)]('\x20\x20'+_0x4198b6(0x19d)[_0x4198b6(0x18d)](_0x510ea3)+'\x20\x20'+_0x4198b6(0x18c)['padStart'](_0x266595)+'\x20\x20'+_0x4198b6(0x161)[_0x4198b6(0x17a)](_0x12b7e1)+'\x20\x20'+'Month'['padStart'](_0x53d717));for(const _0x31b983 of _0x115e85){console[_0x4198b6(0x187)]('\x20\x20'+_0x31b983[_0x4198b6(0x18a)][_0x4198b6(0x18d)](_0x510ea3)+'\x20\x20'+a12_0x25b062['cyan'](formatCredits(_0x31b983[_0x4198b6(0x18e)])[_0x4198b6(0x17a)](_0x266595))+'\x20\x20'+formatCredits(_0x31b983[_0x4198b6(0x182)])[_0x4198b6(0x17a)](_0x12b7e1)+'\x20\x20'+formatCredits(_0x31b983[_0x4198b6(0x167)])[_0x4198b6(0x17a)](_0x53d717));}console[_0x4198b6(0x187)]();}if(_0x16ff44[_0x4198b6(0x160)]===0x0){console[_0x4198b6(0x187)](a12_0x25b062[_0x4198b6(0x17c)](_0x4198b6(0x183))),console['log'](a12_0x25b062[_0x4198b6(0x17c)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x4198b6(0x187)](a12_0x25b062[_0x4198b6(0x176)](_0x4198b6(0x165))),console[_0x4198b6(0x187)](a12_0x25b062[_0x4198b6(0x17c)]('─'[_0x4198b6(0x16d)](0x3c)));const _0x193e59=Math[_0x4198b6(0x179)](0xc,..._0x16ff44[_0x4198b6(0x18f)](_0xa0a883=>_0xa0a883[_0x4198b6(0x16b)]===_0x4198b6(0x177)?_0x4198b6(0x19b)[_0x4198b6(0x160)]:_0xa0a883[_0x4198b6(0x16b)][_0x4198b6(0x160)])),_0x162db7=0xa,_0x2a4040=0xa;console[_0x4198b6(0x187)]('\x20\x20'+_0x4198b6(0x196)[_0x4198b6(0x18d)](_0x193e59)+'\x20\x20'+_0x4198b6(0x164)[_0x4198b6(0x17a)](_0x162db7)+'\x20\x20'+'Requests'[_0x4198b6(0x17a)](_0x2a4040)+'\x20\x20'+'Last\x20Used');for(const _0x4cd435 of _0x16ff44){const _0x2a5380=_0x4cd435[_0x4198b6(0x16b)]===_0x4198b6(0x177)?_0x4198b6(0x19b):_0x4cd435[_0x4198b6(0x16b)],_0x41d767=_0x2a5380[_0x4198b6(0x18d)](_0x193e59),_0x1e235b=_0x4cd435['profile']===_0x4198b6(0x177)?a12_0x25b062[_0x4198b6(0x17c)](_0x41d767):_0x41d767;console[_0x4198b6(0x187)]('\x20\x20'+_0x1e235b+'\x20\x20'+a12_0x25b062[_0x4198b6(0x15a)](formatCredits(_0x4cd435[_0x4198b6(0x18e)])[_0x4198b6(0x17a)](_0x162db7))+'\x20\x20'+String(_0x4cd435[_0x4198b6(0x17f)])[_0x4198b6(0x17a)](_0x2a4040)+'\x20\x20'+a12_0x25b062[_0x4198b6(0x17c)](formatLastUsed(_0x4cd435[_0x4198b6(0x180)])));}console[_0x4198b6(0x187)](),console[_0x4198b6(0x187)](a12_0x25b062[_0x4198b6(0x17c)](_0x4198b6(0x17b))),console[_0x4198b6(0x187)]();}}
@@ -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
+ const a13_0x3a6be7=a13_0x2de5;(function(_0x3acdb9,_0x352cb3){const _0x4f3762=a13_0x2de5,_0x2f9309=_0x3acdb9();while(!![]){try{const _0x5e8163=parseInt(_0x4f3762(0xfd))/0x1*(-parseInt(_0x4f3762(0xe6))/0x2)+parseInt(_0x4f3762(0xef))/0x3+parseInt(_0x4f3762(0x107))/0x4+parseInt(_0x4f3762(0x103))/0x5*(parseInt(_0x4f3762(0xf5))/0x6)+parseInt(_0x4f3762(0xdd))/0x7+parseInt(_0x4f3762(0x105))/0x8*(-parseInt(_0x4f3762(0xfc))/0x9)+parseInt(_0x4f3762(0xed))/0xa*(parseInt(_0x4f3762(0x10a))/0xb);if(_0x5e8163===_0x352cb3)break;else _0x2f9309['push'](_0x2f9309['shift']());}catch(_0x48cf0d){_0x2f9309['push'](_0x2f9309['shift']());}}}(a13_0x3e5f,0x2289e));function a13_0x3e5f(){const _0x49299f=['Invalid\x20limit\x20value:\x20','getAll','Reason:\x20','tdx\x20auth\x20setup','To\x20set\x20up\x20authentication:','stack','validateGlobalOptions','554222KqHEQV','values','red','error','.\x20Must\x20be\x20a\x20number.','validate','commands','60Epamzt','\x27\x20is\x20already\x20registered','190158kRFurc','problemDetails','Authentication\x20error\x20stack\x20trace:','set','yellow','Error:\x20','18xNRGoz','profile','tdx\x20auth','limit','register','cyan','Authentication\x20failed','1324782unogLO','1glwJOv','Command\x20\x27','has','from','\x20--profile\x20','debug','18210qSugjr','options','8BbqnWC','detail','743556IqKnTV','get','helpText','187539SNdDCl','dim','name','number','execute','test','To\x20check\x20your\x20current\x20auth\x20status:','1422988IFkzpv','message'];a13_0x3e5f=function(){return _0x49299f;};return a13_0x3e5f();}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_0x36c8a9 from'chalk';export function printAuthError(_0x2489b2,_0x83e7b7=![],_0x3b4c73){const _0xe88a2c=a13_0x2de5,_0x101840=_0x2489b2[_0xe88a2c(0xf0)]?.[_0xe88a2c(0x106)]||_0x2489b2[_0xe88a2c(0xde)];console[_0xe88a2c(0xe9)](a13_0x36c8a9['red'](_0xe88a2c(0xfb))),console['error'](a13_0x36c8a9[_0xe88a2c(0xe8)](_0xe88a2c(0xe1)+_0x101840));if(_0x83e7b7){const _0x110662=_0x3b4c73?_0xe88a2c(0x101)+_0x3b4c73:'';console[_0xe88a2c(0xe9)]('\x0a'+a13_0x36c8a9['dim'](_0xe88a2c(0xe3))),console[_0xe88a2c(0xe9)]('\x20\x20'+a13_0x36c8a9['cyan'](_0xe88a2c(0xe2)+_0x110662)+'\x0a'),console[_0xe88a2c(0xe9)](''+a13_0x36c8a9[_0xe88a2c(0x10b)](_0xe88a2c(0xdc))),console[_0xe88a2c(0xe9)]('\x20\x20'+a13_0x36c8a9[_0xe88a2c(0xfa)](_0xe88a2c(0xf7)+_0x110662));}}export class BaseCommand{[a13_0x3a6be7(0xe5)](_0x2fe157){const _0x1498df=a13_0x3a6be7,{options:_0x802a4a}=_0x2fe157,_0x2effe4=_0x802a4a['limit'];if(_0x2effe4!==undefined){const _0x45a5d6=typeof _0x2effe4===_0x1498df(0x10d)?_0x2effe4:parseInt(_0x2effe4,0xa);if(isNaN(_0x45a5d6))return _0x1498df(0xdf)+_0x2effe4+_0x1498df(0xea);const _0x528e9c=validateLimitOption(_0x45a5d6);if(!_0x528e9c['isValid'])return _0x528e9c['error'];_0x2fe157[_0x1498df(0x104)][_0x1498df(0xf8)]=_0x528e9c['value'];}return undefined;}[a13_0x3a6be7(0xeb)](_0xe47c8e){return undefined;}async['run'](_0x1a1667){const _0x519952=a13_0x3a6be7;try{const _0x4e2dd2=this['validateGlobalOptions'](_0x1a1667);if(_0x4e2dd2)return console[_0x519952(0xe9)](_0x519952(0xf4)+_0x4e2dd2),0x1;const _0x3d1d2c=this[_0x519952(0xeb)](_0x1a1667);if(_0x3d1d2c){const _0x1b1ce3=/^\s*(Usage|Note|Warning|Error):/i[_0x519952(0xdb)](_0x3d1d2c);return _0x1b1ce3?console['error'](_0x3d1d2c):console['error'](_0x519952(0xf4)+_0x3d1d2c),0x1;}const _0x4cfb63=await this[_0x519952(0x10e)](_0x1a1667);return _0x4cfb63??0x0;}catch(_0x578671){if(_0x578671 instanceof Error){if(_0x578671 instanceof HTTPClientError&&_0x578671['status']===0x191){const _0x2e6342=_0x1a1667[_0x519952(0x104)][_0x519952(0xf6)];printAuthError(_0x578671,!![],_0x2e6342);if(_0x578671['stack']){const _0x57a95=Logger['of']('command');_0x57a95[_0x519952(0x102)](_0x519952(0xf1)),_0x57a95[_0x519952(0x102)](_0x578671[_0x519952(0xe4)]);}return 0x1;}console[_0x519952(0xe9)](a13_0x36c8a9[_0x519952(0xe8)](_0x519952(0xf4)+_0x578671[_0x519952(0xde)]));_0x578671 instanceof SDKError&&_0x578671[_0x519952(0x109)]&&console[_0x519952(0xe9)](a13_0x36c8a9[_0x519952(0xf3)](_0x578671[_0x519952(0x109)]));const _0x4d43cd=_0x578671 instanceof SDKError&&_0x578671['category']===ErrorCategory['USER_ERROR'];_0x578671[_0x519952(0xe4)]&&!_0x4d43cd&&console[_0x519952(0xe9)]('\x0aStack\x20trace:\x0a'+_0x578671[_0x519952(0xe4)]);}else console[_0x519952(0xe9)]('Error:\x20'+String(_0x578671));return 0x1;}}}export class CommandRegistry{[a13_0x3a6be7(0xec)]=new Map();[a13_0x3a6be7(0xf9)](_0x1dbcab){const _0x37b321=a13_0x3a6be7;if(this[_0x37b321(0xec)]['has'](_0x1dbcab[_0x37b321(0x10c)]))throw new Error(_0x37b321(0xfe)+_0x1dbcab[_0x37b321(0x10c)]+_0x37b321(0xee));this['commands'][_0x37b321(0xf2)](_0x1dbcab[_0x37b321(0x10c)],_0x1dbcab);}[a13_0x3a6be7(0x108)](_0x24e621){const _0x164c5b=a13_0x3a6be7;return this[_0x164c5b(0xec)][_0x164c5b(0x108)](_0x24e621);}[a13_0x3a6be7(0xe0)](){const _0x4c6d43=a13_0x3a6be7;return Array[_0x4c6d43(0x100)](this['commands'][_0x4c6d43(0xe7)]());}[a13_0x3a6be7(0xff)](_0x35bf33){const _0x125d27=a13_0x3a6be7;return this[_0x125d27(0xec)][_0x125d27(0xff)](_0x35bf33);}}function a13_0x2de5(_0x2dba2e,_0x3c4c17){_0x2dba2e=_0x2dba2e-0xdb;const _0x3e5fc1=a13_0x3e5f();let _0x2de571=_0x3e5fc1[_0x2dba2e];return _0x2de571;}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_0x889bd=a14_0x20a7;(function(_0x580107,_0x48e946){const _0x5595f5=a14_0x20a7,_0x146d49=_0x580107();while(!![]){try{const _0x1e8754=-parseInt(_0x5595f5(0x214))/0x1+parseInt(_0x5595f5(0x21e))/0x2*(parseInt(_0x5595f5(0x21d))/0x3)+parseInt(_0x5595f5(0x22b))/0x4+parseInt(_0x5595f5(0x21f))/0x5+parseInt(_0x5595f5(0x205))/0x6+-parseInt(_0x5595f5(0x233))/0x7+-parseInt(_0x5595f5(0x202))/0x8;if(_0x1e8754===_0x48e946)break;else _0x146d49['push'](_0x146d49['shift']());}catch(_0x238cec){_0x146d49['push'](_0x146d49['shift']());}}}(a14_0x5383,0x87510));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';function a14_0x5383(){const _0x371ae3=['Fetching\x20connection\x20\x27','connection:settings','Listing\x20connector\x20types...','default_value','max','\x0aConnector:\x20','verbose','Fetching\x20schema\x20for\x20\x27','dim','\x20[record]','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','maximum','green','42827hjgTqR','name','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','push','repeat','cyan','minimum','options','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','1614VFQJZr','2632RihwhO','3342805sHLLRX','listTypes','error','Show\x20connection\x20details','enumeration','blue','resolve','\x27...','\x20connector\x20type','\x0aConnection:\x20','No\x20available\x20fields\x20for\x20this\x20connector','Site:\x20','3659840ufKFBw','\x20\x20\x20\x20Options:\x20','title','\x0aNo\x20credential\x20settings\x20defined','map','Name:\x20','bold','owner','5397056wGnPwC','table','join','Resolving\x20connector\x20type\x20or\x20name:\x20','data','✔\x20Found\x20','filter','\x0aNo\x20fields\x20defined\x20in\x20schema','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.','Looking\x20up\x20connection:\x20','slice','Options:\x20','✔\x20Resolved\x20\x27','log','getMetadata','sort','description','stringify','Show\x20when:\x20','yellow','properties','<=\x20','settings','limit','Default:\x20','output','legacy','validate','\x20-\x20','findByName','hint','hidden','Treating\x20\x27','legacy_settings','\x0aAvailable\x20fields:','length','type','localeCompare','entries','value','✔\x20Found\x20connection:\x20','record','getOutputSchema','input','Fetching\x20settings\x20for\x20connector\x20type:\x20','Range:\x20','List\x20all\x20result\x20output\x20connections','connection:schema','list','site','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.','credential','Listing\x20connections...','criteria','9905360gWSwiK','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','execute','1888392PTXVAs','connection'];a14_0x5383=function(){return _0x371ae3;};return a14_0x5383();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a14_0x26a7fc from'chalk';function normalizeSchemaForDisplay(_0x4aec4a){const _0x218c20=a14_0x20a7,_0x69fa65=_0x4aec4a[_0x218c20(0x1e0)]||[],_0x2e7351=_0x69fa65['find'](_0x34fad2=>_0x34fad2[_0x218c20(0x215)]==='legacy_settings'&&_0x34fad2[_0x218c20(0x1f0)]===_0x218c20(0x1f5)&&_0x34fad2[_0x218c20(0x1e0)]);if(_0x2e7351?.[_0x218c20(0x1e0)]){const _0x1b500d=_0x69fa65[_0x218c20(0x239)](_0x13b2ca=>_0x13b2ca[_0x218c20(0x215)]!=='legacy'&&_0x13b2ca['name']!==_0x218c20(0x1ed));return[..._0x1b500d,..._0x2e7351[_0x218c20(0x1e0)]];}return _0x69fa65[_0x218c20(0x239)](_0x45a5f5=>_0x45a5f5[_0x218c20(0x215)]!==_0x218c20(0x1e6));}function printSchemaFields(_0x574745,_0x587c3e){const _0x3e9e50=a14_0x20a7,_0x122e4d='\x20\x20'[_0x3e9e50(0x218)](_0x587c3e+0x1),_0x318435='\x20\x20'[_0x3e9e50(0x218)](_0x587c3e+0x2);for(const _0x17441e of _0x574745){if(!_0x17441e['name'])continue;const _0x374b82=_0x17441e[_0x3e9e50(0x1f0)]===_0x3e9e50(0x1f5)&&_0x17441e[_0x3e9e50(0x1e0)]&&_0x17441e[_0x3e9e50(0x1e0)]['length']>0x0&&_0x17441e[_0x3e9e50(0x215)]!==_0x3e9e50(0x1ed);let _0x482f97=''+_0x122e4d+a14_0x26a7fc[_0x3e9e50(0x213)](_0x17441e[_0x3e9e50(0x215)]);_0x17441e[_0x3e9e50(0x22d)]&&(_0x482f97+=':\x20'+_0x17441e[_0x3e9e50(0x22d)]);if(_0x17441e[_0x3e9e50(0x1f7)])_0x482f97+=a14_0x26a7fc[_0x3e9e50(0x20f)]('\x20['+_0x17441e['input']+']');else _0x374b82&&(_0x482f97+=a14_0x26a7fc[_0x3e9e50(0x20f)](_0x3e9e50(0x210)));console['log'](_0x482f97);_0x17441e[_0x3e9e50(0x1dc)]&&console[_0x3e9e50(0x1d9)](''+_0x318435+a14_0x26a7fc[_0x3e9e50(0x20f)](_0x17441e[_0x3e9e50(0x1dc)]));if(_0x17441e['enumeration']){const _0x19945e=_0x17441e[_0x3e9e50(0x223)][_0x3e9e50(0x22f)](_0x6f0856=>typeof _0x6f0856==='object'&&'value'in _0x6f0856?_0x6f0856[_0x3e9e50(0x1f3)]:_0x6f0856)[_0x3e9e50(0x235)](',\x20');console[_0x3e9e50(0x1d9)](_0x318435+_0x3e9e50(0x1d7)+a14_0x26a7fc[_0x3e9e50(0x1df)](_0x19945e));}_0x17441e[_0x3e9e50(0x20a)]!==undefined&&console['log'](_0x318435+_0x3e9e50(0x1e4)+a14_0x26a7fc[_0x3e9e50(0x224)](String(_0x17441e[_0x3e9e50(0x20a)])));if(_0x17441e[_0x3e9e50(0x21a)]!==undefined||_0x17441e['maximum']!==undefined){const _0x31daa7=_0x17441e[_0x3e9e50(0x21a)]!==undefined&&_0x17441e[_0x3e9e50(0x212)]!==undefined?_0x17441e[_0x3e9e50(0x21a)]+'\x20-\x20'+_0x17441e[_0x3e9e50(0x212)]:_0x17441e[_0x3e9e50(0x21a)]!==undefined?'>=\x20'+_0x17441e[_0x3e9e50(0x21a)]:_0x3e9e50(0x1e1)+_0x17441e[_0x3e9e50(0x212)];console[_0x3e9e50(0x1d9)](_0x318435+_0x3e9e50(0x1f9)+a14_0x26a7fc[_0x3e9e50(0x224)](_0x31daa7));}if(_0x17441e[_0x3e9e50(0x201)]){const _0x38c32d=Object[_0x3e9e50(0x1f2)](_0x17441e['criteria'])[_0x3e9e50(0x22f)](([_0x532b9f,_0x557594])=>_0x532b9f+'='+JSON[_0x3e9e50(0x1dd)](_0x557594))[_0x3e9e50(0x235)](',\x20');console[_0x3e9e50(0x1d9)](''+_0x318435+a14_0x26a7fc['dim'](_0x3e9e50(0x1de)+_0x38c32d));}_0x374b82&&_0x17441e[_0x3e9e50(0x1e0)]&&printSchemaFields(_0x17441e['properties'],_0x587c3e+0x1);}}export class ConnectionListCommand extends BaseCommand{['name']='connection:list';[a14_0x889bd(0x1dc)]=a14_0x889bd(0x1fa);async[a14_0x889bd(0x204)](_0x5ed032){const _0x569abf=a14_0x889bd,{options:_0x3d665c,tdx:_0x1045e7}=_0x5ed032;_0x3d665c[_0x569abf(0x20d)]&&console[_0x569abf(0x221)](_0x569abf(0x22a)+_0x3d665c[_0x569abf(0x1fd)]);const _0x36819b=resolveLimit(_0x3d665c[_0x569abf(0x1e3)],DEFAULT_LISTING_LIMIT),_0x3ac1bb=await withSpinner(_0x569abf(0x200),()=>_0x1045e7[_0x569abf(0x206)][_0x569abf(0x1fc)](),{'verbose':_0x3d665c[_0x569abf(0x20d)]}),_0x33c144=_0x3ac1bb[_0x569abf(0x237)];console['error'](_0x569abf(0x238)+_0x33c144[_0x569abf(0x1ef)]+'\x20connection'+(_0x33c144[_0x569abf(0x1ef)]!==0x1?'s':''));if(isStructuredFormat(_0x3d665c)){const _0x4b30f1=_0x33c144[_0x569abf(0x1d6)](0x0,_0x36819b);await handleSDKOutput(_0x4b30f1,{..._0x3d665c,'limit':_0x36819b});}else{const _0xa79185=_0x33c144[_0x569abf(0x1ef)]>0x0?Math[_0x569abf(0x20b)](..._0x33c144['map'](_0x2a5ab5=>_0x2a5ab5[_0x569abf(0x1f0)]['length'])):0x0,_0x455879=[];for(const _0x121d2d of _0x33c144){const _0x4affb6=a14_0x26a7fc['cyan'](_0x121d2d['type']['padStart'](_0xa79185)),_0x5c15d3=_0x121d2d[_0x569abf(0x232)]?.[_0x569abf(0x215)]?_0x569abf(0x1e8)+a14_0x26a7fc[_0x569abf(0x20f)](_0x121d2d[_0x569abf(0x232)][_0x569abf(0x215)]):'';_0x455879[_0x569abf(0x217)](_0x4affb6+'\x20\x20'+_0x121d2d[_0x569abf(0x215)]+_0x5c15d3);}await writeOutput(_0x455879[_0x569abf(0x235)]('\x0a'),_0x3d665c[_0x569abf(0x1e5)],_0x569abf(0x234));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']='connection:show';[a14_0x889bd(0x1dc)]=a14_0x889bd(0x222);['validate'](_0x2bd328){const {args:_0x3ed204}=_0x2bd328;if(!_0x3ed204[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_0x889bd(0x204)](_0x106615){const _0xdc0468=a14_0x889bd,{options:_0x450e80,args:_0x560bfc,tdx:_0x59108a}=_0x106615,_0x4b23b7=_0x560bfc[0x0];_0x450e80['verbose']&&(console['error'](_0xdc0468(0x22a)+_0x450e80[_0xdc0468(0x1fd)]),console[_0xdc0468(0x221)](_0xdc0468(0x23c)+_0x4b23b7));const _0x151a33=await withSpinner(_0xdc0468(0x207)+_0x4b23b7+'\x27...',()=>_0x59108a[_0xdc0468(0x206)][_0xdc0468(0x225)](_0x4b23b7),{'verbose':_0x450e80[_0xdc0468(0x20d)]}),_0x8b4382=_0x151a33[_0xdc0468(0x237)];return console[_0xdc0468(0x221)](_0xdc0468(0x1f4)+_0x8b4382[_0xdc0468(0x215)]),await handleSingleObjectOutput(_0x8b4382,_0x450e80),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a14_0x889bd(0x215)]=a14_0x889bd(0x1fb);[a14_0x889bd(0x1dc)]=a14_0x889bd(0x216);[a14_0x889bd(0x1e7)](_0x19ece8){const _0x140902=a14_0x889bd,{args:_0x20c863}=_0x19ece8;if(!_0x20c863[0x0])return _0x140902(0x1fe);return undefined;}async[a14_0x889bd(0x204)](_0x1b5afb){const _0x776dd2=a14_0x889bd,{options:_0x184357,args:_0x5d78e5,tdx:_0x559c31}=_0x1b5afb,_0x2d135e=_0x5d78e5[0x0];_0x184357[_0x776dd2(0x20d)]&&(console['error'](_0x776dd2(0x22a)+_0x184357[_0x776dd2(0x1fd)]),console[_0x776dd2(0x221)](_0x776dd2(0x236)+_0x2d135e));let _0x182a17=_0x2d135e,_0x49ccde;try{const _0x438bd6=await _0x559c31[_0x776dd2(0x206)][_0x776dd2(0x1e9)](_0x2d135e);_0x438bd6&&(_0x182a17=_0x438bd6[_0x776dd2(0x1f0)],_0x49ccde=_0x438bd6[_0x776dd2(0x215)],_0x184357['verbose']&&console[_0x776dd2(0x221)](_0x776dd2(0x1d8)+_0x2d135e+_0x776dd2(0x21c)+_0x182a17));}catch{_0x184357['verbose']&&console[_0x776dd2(0x221)](_0x776dd2(0x1ec)+_0x2d135e+'\x27\x20as\x20connector\x20type');}const _0x446f06=await withSpinner(_0x776dd2(0x20e)+_0x182a17+_0x776dd2(0x226),()=>_0x559c31[_0x776dd2(0x206)][_0x776dd2(0x1f6)](_0x182a17),{'verbose':_0x184357[_0x776dd2(0x20d)]}),_0x3acdce=_0x446f06['data'];_0x49ccde?console[_0x776dd2(0x221)]('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x49ccde+'\x27\x20(type:\x20'+_0x182a17+')'):console[_0x776dd2(0x221)](_0x776dd2(0x203)+_0x182a17);if(isStructuredFormat(_0x184357))await handleSingleObjectOutput(_0x3acdce,_0x184357);else{const _0x184049=normalizeSchemaForDisplay(_0x3acdce);_0x49ccde?(console['log'](_0x776dd2(0x228)+a14_0x26a7fc[_0x776dd2(0x219)](_0x49ccde)),console[_0x776dd2(0x1d9)]('Type:\x20'+a14_0x26a7fc[_0x776dd2(0x20f)](_0x182a17))):console[_0x776dd2(0x1d9)](_0x776dd2(0x20c)+a14_0x26a7fc[_0x776dd2(0x219)](_0x182a17)),_0x184049[_0x776dd2(0x1ef)]>0x0?(console[_0x776dd2(0x1d9)](a14_0x26a7fc['bold'](_0x776dd2(0x1ee))),printSchemaFields(_0x184049,0x0)):console[_0x776dd2(0x1d9)](a14_0x26a7fc[_0x776dd2(0x20f)](_0x776dd2(0x23a)));}return 0x0;}}function a14_0x20a7(_0x473fff,_0x56f2cc){_0x473fff=_0x473fff-0x1d6;const _0x538321=a14_0x5383();let _0x20a7a1=_0x538321[_0x473fff];return _0x20a7a1;}export class ConnectionTypesCommand extends BaseCommand{[a14_0x889bd(0x215)]='connection:types';['description']='List\x20available\x20connector\x20types';async[a14_0x889bd(0x204)](_0x245f4f){const _0x227453=a14_0x889bd,{options:_0x165918,tdx:_0x4e5f04}=_0x245f4f;_0x165918[_0x227453(0x20d)]&&console['error'](_0x227453(0x22a)+_0x165918['site']);const _0x11dc0c=await withSpinner(_0x227453(0x209),()=>_0x4e5f04[_0x227453(0x206)][_0x227453(0x220)](),{'verbose':_0x165918['verbose']}),_0x579515=_0x11dc0c[_0x227453(0x237)][_0x227453(0x1db)]((_0x5bb9f9,_0x4b1bdc)=>_0x5bb9f9[_0x227453(0x1f0)][_0x227453(0x1f1)](_0x4b1bdc['type']));console['error'](_0x227453(0x238)+_0x579515[_0x227453(0x1ef)]+_0x227453(0x227)+(_0x579515['length']!==0x1?'s':''));if(isStructuredFormat(_0x165918))await handleSDKOutput(_0x579515,_0x165918);else{const _0x8d106a=_0x579515[_0x227453(0x1ef)]>0x0?Math['max'](..._0x579515[_0x227453(0x22f)](_0x324cd0=>_0x324cd0[_0x227453(0x1f0)][_0x227453(0x1ef)])):0x0,_0x269b6d=[];for(const _0x340bdf of _0x579515){const _0x3cf7eb=a14_0x26a7fc[_0x227453(0x219)](_0x340bdf[_0x227453(0x1f0)]['padStart'](_0x8d106a));_0x269b6d[_0x227453(0x217)](_0x3cf7eb+'\x20\x20'+_0x340bdf[_0x227453(0x215)]);}await writeOutput(_0x269b6d[_0x227453(0x235)]('\x0a'),_0x165918['output'],_0x227453(0x234));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a14_0x889bd(0x215)]=a14_0x889bd(0x208);['description']=a14_0x889bd(0x211);[a14_0x889bd(0x1e7)](_0x3b9c50){const _0x349d52=a14_0x889bd,{args:_0x5c0009}=_0x3b9c50;if(!_0x5c0009[0x0])return _0x349d52(0x23b);return undefined;}async[a14_0x889bd(0x204)](_0x5ec9b7){const _0x299480=a14_0x889bd,{options:_0x4795f1,args:_0x25778c,tdx:_0x2f72be}=_0x5ec9b7,_0x5a6c6c=_0x25778c[0x0];_0x4795f1[_0x299480(0x20d)]&&(console[_0x299480(0x221)]('Site:\x20'+_0x4795f1['site']),console[_0x299480(0x221)](_0x299480(0x1f8)+_0x5a6c6c));const _0x5b8405=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x5a6c6c+_0x299480(0x226),()=>_0x2f72be[_0x299480(0x206)][_0x299480(0x1da)](_0x5a6c6c),{'verbose':_0x4795f1[_0x299480(0x20d)]}),_0x51a36a=_0x5b8405['data'];console['error']('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x5a6c6c);if(isStructuredFormat(_0x4795f1))await handleSingleObjectOutput(_0x51a36a,_0x4795f1);else{console[_0x299480(0x1d9)](_0x299480(0x20c)+a14_0x26a7fc['cyan'](_0x5a6c6c)),console[_0x299480(0x1d9)](_0x299480(0x230)+_0x51a36a[_0x299480(0x215)]);const _0x415c45=_0x51a36a[_0x299480(0x1e2)]||[],_0x2955f7=_0x415c45['filter'](_0x30f48f=>_0x30f48f[_0x299480(0x1ff)]);_0x2955f7['length']>0x0&&(console[_0x299480(0x1d9)](a14_0x26a7fc['bold']('\x0aCredential\x20settings:')),printMetadataSettings(_0x2955f7));let _0x3d0721=![];try{const _0x4c0971=await _0x2f72be[_0x299480(0x206)]['getOutputSchema'](_0x5a6c6c),_0x3e5238=normalizeSchemaForDisplay(_0x4c0971);_0x3e5238[_0x299480(0x1ef)]>0x0&&(console[_0x299480(0x1d9)](a14_0x26a7fc[_0x299480(0x231)](_0x299480(0x1ee))),printSchemaFields(_0x3e5238,0x0),_0x3d0721=!![]);}catch{const _0x20406c=_0x415c45[_0x299480(0x239)](_0x5f141c=>!_0x5f141c[_0x299480(0x1ff)]);_0x20406c['length']>0x0&&(console['log'](a14_0x26a7fc[_0x299480(0x231)](_0x299480(0x1ee))),printMetadataSettings(_0x20406c),_0x3d0721=!![]);}!_0x3d0721&&_0x4795f1[_0x299480(0x20d)]&&console[_0x299480(0x221)](a14_0x26a7fc[_0x299480(0x20f)](_0x299480(0x229))),_0x2955f7[_0x299480(0x1ef)]===0x0&&console[_0x299480(0x1d9)](a14_0x26a7fc['dim'](_0x299480(0x22e)));}return 0x0;}}function printMetadataSettings(_0x338fea){const _0x3966ba=a14_0x889bd;for(const _0x3d18be of _0x338fea){if(!_0x3d18be[_0x3966ba(0x215)])continue;if(_0x3d18be[_0x3966ba(0x1eb)])continue;let _0x619276='\x20\x20'+a14_0x26a7fc[_0x3966ba(0x213)](_0x3d18be[_0x3966ba(0x215)]);_0x3d18be['label']&&(_0x619276+=':\x20'+_0x3d18be['label']);_0x3d18be['type']&&(_0x619276+=a14_0x26a7fc[_0x3966ba(0x20f)]('\x20['+_0x3d18be[_0x3966ba(0x1f0)]+']'));console['log'](_0x619276);_0x3d18be[_0x3966ba(0x1ea)]&&console['log']('\x20\x20\x20\x20'+a14_0x26a7fc['dim'](_0x3d18be[_0x3966ba(0x1ea)]));if(_0x3d18be[_0x3966ba(0x21b)]){const _0x3ef129=_0x3d18be[_0x3966ba(0x21b)][_0x3966ba(0x22f)](_0x526aef=>_0x526aef[_0x3966ba(0x1f3)])[_0x3966ba(0x235)](',\x20');console['log'](_0x3966ba(0x22c)+a14_0x26a7fc[_0x3966ba(0x1df)](_0x3ef129));}_0x3d18be['default_value']!==undefined&&_0x3d18be[_0x3966ba(0x20a)]!==null&&console[_0x3966ba(0x1d9)]('\x20\x20\x20\x20Default:\x20'+a14_0x26a7fc[_0x3966ba(0x224)](String(_0x3d18be[_0x3966ba(0x20a)])));if(_0x3d18be[_0x3966ba(0x201)]){const _0x2fafc7=Object[_0x3966ba(0x1f2)](_0x3d18be[_0x3966ba(0x201)])[_0x3966ba(0x22f)](([_0x7b8f97,_0x17e112])=>_0x7b8f97+'='+JSON[_0x3966ba(0x1dd)](_0x17e112))[_0x3966ba(0x235)](',\x20');console[_0x3966ba(0x1d9)]('\x20\x20\x20\x20'+a14_0x26a7fc['dim']('Show\x20when:\x20'+_0x2fafc7));}}}
@@ -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_0x5ae6c4=a15_0x3f15;(function(_0xd1ce7b,_0x298113){const _0x194ce4=a15_0x3f15,_0x24bbe9=_0xd1ce7b();while(!![]){try{const _0xa9ac04=parseInt(_0x194ce4(0x1e6))/0x1+-parseInt(_0x194ce4(0x1ea))/0x2*(-parseInt(_0x194ce4(0x1e8))/0x3)+parseInt(_0x194ce4(0x1e4))/0x4*(parseInt(_0x194ce4(0x1d5))/0x5)+parseInt(_0x194ce4(0x1d8))/0x6+-parseInt(_0x194ce4(0x1d1))/0x7+parseInt(_0x194ce4(0x1d4))/0x8*(parseInt(_0x194ce4(0x1d6))/0x9)+-parseInt(_0x194ce4(0x1ec))/0xa;if(_0xa9ac04===_0x298113)break;else _0x24bbe9['push'](_0x24bbe9['shift']());}catch(_0x464433){_0x24bbe9['push'](_0x24bbe9['shift']());}}}(a15_0x51b6,0x3f63f));import{BaseCommand}from'./command.js';function a15_0x51b6(){const _0x274237=['error','name','site','listDatabases','Listing\x20databases...','verbose','execute','limit','database_name','description','data','903484WsmEJP','📦\x20','188457PEFMWY','\x20database','691149QElkIJ','length','4YCKyxa','databases','8492160iprzzN','459522QZskvT','\x20\x20Cause:\x20','query','1664472kIlcxg','5SFcPTN','9jlOBXz','✔\x20Found\x20','548136WPZBZw'];a15_0x51b6=function(){return _0x274237;};return a15_0x51b6();}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';function a15_0x3f15(_0x25be5d,_0x4a7681){_0x25be5d=_0x25be5d-0x1d1;const _0x51b6a8=a15_0x51b6();let _0x3f15db=_0x51b6a8[_0x25be5d];return _0x3f15db;}export class DatabasesCommand extends BaseCommand{[a15_0x5ae6c4(0x1da)]=a15_0x5ae6c4(0x1eb);[a15_0x5ae6c4(0x1e2)]='List\x20all\x20databases';async[a15_0x5ae6c4(0x1df)](_0x479f1e){const _0x37bfd8=a15_0x5ae6c4,{options:_0x4a7118,args:_0x432118,tdx:_0x14bb8a}=_0x479f1e,_0x3ed60a=_0x432118[0x0];try{_0x4a7118[_0x37bfd8(0x1de)]&&(console[_0x37bfd8(0x1d9)]('Site:\x20'+_0x4a7118[_0x37bfd8(0x1db)]),_0x3ed60a&&console['error']('Pattern:\x20'+_0x3ed60a));const _0x1c228e=resolveLimit(_0x4a7118[_0x37bfd8(0x1e0)],DEFAULT_LISTING_LIMIT),_0x195f3d=await withSpinner(_0x37bfd8(0x1dd),()=>_0x14bb8a[_0x37bfd8(0x1d3)][_0x37bfd8(0x1dc)](_0x3ed60a,_0x1c228e),{'verbose':_0x4a7118[_0x37bfd8(0x1de)]}),_0x4f1eb3=_0x195f3d[_0x37bfd8(0x1e3)];console[_0x37bfd8(0x1d9)](_0x37bfd8(0x1d7)+_0x4f1eb3['length']+_0x37bfd8(0x1e7)+(_0x4f1eb3[_0x37bfd8(0x1e9)]!==0x1?'s':''));if(isStructuredFormat(_0x4a7118))await handleSDKOutput(_0x4f1eb3,{..._0x4a7118,'limit':_0x1c228e});else for(const _0x5144a2 of _0x4f1eb3){console['log'](_0x37bfd8(0x1e5)+_0x5144a2[_0x37bfd8(0x1e1)]);}return 0x0;}catch(_0x5e38fb){if(_0x5e38fb instanceof SDKError)return console[_0x37bfd8(0x1d9)]('Error:\x20'+_0x5e38fb['message']),_0x5e38fb['cause']&&console['error'](_0x37bfd8(0x1d2)+_0x5e38fb['cause']),0x1;throw _0x5e38fb;}}}
@@ -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_0x1f75(){const _0x3cc7a4=['3037565vekuGR','1142840Yfodst','data','3uvVAdf','580098dYbBDs','name','Fetching\x20email\x20senders...','184905rLUQut','delivery:senders','execute','description','505115TTyMaq','List\x20email\x20senders','verbose','3587308PqoXWg','delivery','11444120ibdPYX'];a16_0x1f75=function(){return _0x3cc7a4;};return a16_0x1f75();}function a16_0x38fd(_0x4741cb,_0x236d5f){_0x4741cb=_0x4741cb-0xbf;const _0x1f75f8=a16_0x1f75();let _0x38fd34=_0x1f75f8[_0x4741cb];return _0x38fd34;}const a16_0x211dc5=a16_0x38fd;(function(_0xf62a31,_0xa59320){const _0x1c9786=a16_0x38fd,_0x43bac0=_0xf62a31();while(!![]){try{const _0x2799f3=-parseInt(_0x1c9786(0xc1))/0x1+-parseInt(_0x1c9786(0xc8))/0x2+parseInt(_0x1c9786(0xca))/0x3*(parseInt(_0x1c9786(0xc4))/0x4)+-parseInt(_0x1c9786(0xc7))/0x5+-parseInt(_0x1c9786(0xcb))/0x6+-parseInt(_0x1c9786(0xce))/0x7+parseInt(_0x1c9786(0xc6))/0x8;if(_0x2799f3===_0xa59320)break;else _0x43bac0['push'](_0x43bac0['shift']());}catch(_0x3e18e6){_0x43bac0['push'](_0x43bac0['shift']());}}}(a16_0x1f75,0x7f004));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_0x211dc5(0xcc)]=a16_0x211dc5(0xcf);[a16_0x211dc5(0xc0)]=a16_0x211dc5(0xc2);async[a16_0x211dc5(0xbf)](_0x100c6a){const _0x46bfd8=a16_0x211dc5,{options:_0x44eda6,args:_0xdcc030,tdx:_0x34ff40}=_0x100c6a,_0x3ed3bf=_0xdcc030[0x0],_0x289e23=resolveLimit(_0x44eda6['limit'],DEFAULT_LLM_LIMIT),_0x3e9892=_0x44eda6,_0x1fea25=await resolveWorkspaceIdFromOptions(_0x3e9892,_0x34ff40),_0x4009f7=await withSpinner(_0x46bfd8(0xcd),()=>_0x34ff40[_0x46bfd8(0xc5)]['listEmailSenders']({'workspaceId':_0x1fea25,'limit':_0x289e23}),{'verbose':_0x44eda6[_0x46bfd8(0xc3)]});let _0x4f4594=_0x4009f7[_0x46bfd8(0xc9)];return _0x3ed3bf&&(_0x4f4594=_0x4009f7['data']['filter'](_0x369823=>matchGlobPattern(_0x369823['name'],_0x3ed3bf))),await handleSDKOutput(_0x4f4594,_0x44eda6),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_0x2af464=a17_0x5b69;(function(_0x540a67,_0x5d11b7){const _0x40929e=a17_0x5b69,_0x1355a8=_0x540a67();while(!![]){try{const _0x15fe98=-parseInt(_0x40929e(0x1f7))/0x1+parseInt(_0x40929e(0x1de))/0x2+parseInt(_0x40929e(0x1e1))/0x3*(parseInt(_0x40929e(0x1df))/0x4)+-parseInt(_0x40929e(0x1f2))/0x5+-parseInt(_0x40929e(0x1f4))/0x6+-parseInt(_0x40929e(0x1e2))/0x7+parseInt(_0x40929e(0x1e7))/0x8;if(_0x15fe98===_0x5d11b7)break;else _0x1355a8['push'](_0x1355a8['shift']());}catch(_0x188a7f){_0x1355a8['push'](_0x1355a8['shift']());}}}(a17_0x8cc2,0xe0c22));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a17_0x5b69(_0x5da54a,_0x22b696){_0x5da54a=_0x5da54a-0x1db;const _0x8cc2e1=a17_0x8cc2();let _0x5b69e3=_0x8cc2e1[_0x5da54a];return _0x5b69e3;}import{withSpinner}from'../utils/spinner.js';function a17_0x8cc2(){const _0x6b2e79=['999902GeqsRf','4fgoxXm','\x27\x20does\x20not\x20exist','127419khssWU','6918345BeKpdQ','site','length','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','describe','46735736CCqtyz','description','error','✖\x20Table\x20not\x20found','cause','\x20\x20Cause:\x20','database','args','name','data','verbose','8332055Pevofd','...','10985388JjMUsb','\x20in\x20','Describe\x20table\x20schema','978137jmjNGi','table','describeTable','\x20column','message','query','execute'];a17_0x8cc2=function(){return _0x6b2e79;};return a17_0x8cc2();}export class DescribeCommand extends BaseCommand{[a17_0x2af464(0x1ef)]=a17_0x2af464(0x1e6);[a17_0x2af464(0x1e8)]=a17_0x2af464(0x1f6);async[a17_0x2af464(0x1dd)](_0x42fdfc){const _0x404f60=a17_0x2af464;return this[_0x404f60(0x1f9)](_0x42fdfc);}async['describeTable'](_0x5645d7){const _0x4ccdf3=a17_0x2af464,{options:_0x565340,args:_0x8eccd5,tdx:_0x2042ee}=_0x5645d7;let _0x19a410;try{_0x19a410=parseTableReference(_0x8eccd5[0x0]);const _0x3af094=_0x565340['database'];!_0x19a410['database']&&_0x3af094&&(_0x19a410[_0x4ccdf3(0x1ed)]=_0x3af094);const _0x1f8d37=validateTableDescribeReference(_0x19a410);if(_0x1f8d37)return console['error']('Error:\x20'+_0x1f8d37),0x1;}catch(_0x595aaa){return console[_0x4ccdf3(0x1e9)]('Error:\x20'+_0x595aaa[_0x4ccdf3(0x1db)]),0x1;}const _0x2b4905=_0x19a410['database'],_0x117ce5=_0x19a410[_0x4ccdf3(0x1f8)];try{_0x565340[_0x4ccdf3(0x1f1)]&&(console[_0x4ccdf3(0x1e9)]('Site:\x20'+_0x565340[_0x4ccdf3(0x1e3)]),console[_0x4ccdf3(0x1e9)]('Database:\x20'+_0x2b4905),console['error']('Table:\x20'+_0x117ce5));const _0x40dd6c=await withSpinner('Describing\x20table\x20'+_0x2b4905+'.'+_0x117ce5+_0x4ccdf3(0x1f3),()=>_0x2042ee[_0x4ccdf3(0x1dc)][_0x4ccdf3(0x1f9)](_0x2b4905,_0x117ce5),{'verbose':_0x565340['verbose']}),_0x3c3a7a=_0x40dd6c[_0x4ccdf3(0x1f0)];if(_0x3c3a7a[_0x4ccdf3(0x1e4)]===0x0)return console[_0x4ccdf3(0x1e9)](_0x4ccdf3(0x1ea)),console[_0x4ccdf3(0x1e9)]('Table\x20\x27'+_0x2b4905+'.'+_0x117ce5+_0x4ccdf3(0x1e0)),0x1;return console[_0x4ccdf3(0x1e9)]('✔\x20Found\x20'+_0x3c3a7a['length']+_0x4ccdf3(0x1fa)+(_0x3c3a7a[_0x4ccdf3(0x1e4)]!==0x1?'s':'')+_0x4ccdf3(0x1f5)+_0x2b4905+'.'+_0x117ce5),await handleSDKOutput(_0x3c3a7a,_0x565340),0x0;}catch(_0x2a5f53){if(_0x2a5f53 instanceof SDKError)return console[_0x4ccdf3(0x1e9)]('Error:\x20'+_0x2a5f53[_0x4ccdf3(0x1db)]),_0x2a5f53[_0x4ccdf3(0x1eb)]&&console[_0x4ccdf3(0x1e9)](_0x4ccdf3(0x1ec)+_0x2a5f53[_0x4ccdf3(0x1eb)]),0x1;throw _0x2a5f53;}}['validate'](_0x309515){const _0x462006=a17_0x2af464;if(_0x309515['args']['length']===0x0)return'Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';if(_0x309515[_0x462006(0x1ee)][_0x462006(0x1e4)]>0x1)return _0x462006(0x1e5);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
+ function a18_0x3470(){const _0x5e0cf3=['231830YkUmRe','Workspace\x20is\x20required.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20files?','engage_workspace','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','6712011LWEENr','hasChanges','242lHkukG','3268YseeLp','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','targetDir','engage:campaign:pull','929253xmbhAO','-\x20no\x20files\x20written','\x20campaigns','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x27...','workspaceName','537173uQKdPB','filter','1497540FQPSeF','18240tFWHhM','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cyan','session','config','yes','files','yellow','engage','\x0aChanges\x20to\x20\x27','counts','Aborted.','✔\x20Pulled\x20','relativePath','4TXVVbg','\x20\x20Target:\x20','104tgEMkv','length','\x20=\x20','isNew','5190XmwtBA','verbose','\x20files\x20to\x20','absolutePath','type','data','Pull\x20campaigns\x20to\x20YAML\x20files','cwd','segment','dim','error','\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>','✔\x20Context\x20set:\x20','dirname','utf-8','name','\x0aError:','campaigns','Pulling\x20campaigns\x20from\x20\x27','dryRun','workspace','✔\x20All\x20files\x20are\x20up\x20to\x20date','content'];a18_0x3470=function(){return _0x5e0cf3;};return a18_0x3470();}const a18_0x1def81=a18_0x5a3b;(function(_0x3d8f0f,_0x7cd1db){const _0x2626d0=a18_0x5a3b,_0x1bed99=_0x3d8f0f();while(!![]){try{const _0x312d5f=parseInt(_0x2626d0(0x13e))/0x1+-parseInt(_0x2626d0(0x121))/0x2*(-parseInt(_0x2626d0(0x14c))/0x3)+parseInt(_0x2626d0(0x147))/0x4*(-parseInt(_0x2626d0(0x127))/0x5)+parseInt(_0x2626d0(0x154))/0x6+parseInt(_0x2626d0(0x152))/0x7*(parseInt(_0x2626d0(0x123))/0x8)+-parseInt(_0x2626d0(0x144))/0x9+parseInt(_0x2626d0(0x155))/0xa*(parseInt(_0x2626d0(0x146))/0xb);if(_0x312d5f===_0x7cd1db)break;else _0x1bed99['push'](_0x1bed99['shift']());}catch(_0x306187){_0x1bed99['push'](_0x1bed99['shift']());}}}(a18_0x3470,0x85040));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a18_0x5a3b(_0x45c762,_0x2c80a9){_0x45c762=_0x45c762-0x11c;const _0x3470a9=a18_0x3470();let _0x5a3b34=_0x3470a9[_0x45c762];return _0x5a3b34;}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a18_0x6a25d8 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a18_0x2e7c9c from'path';import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{[a18_0x1def81(0x136)]=a18_0x1def81(0x14b);['description']=a18_0x1def81(0x12d);async['execute'](_0x922d9b){const _0xea9836=a18_0x1def81,{options:_0x3a6ef5,args:_0x1355aa,tdx:_0x2cbf29}=_0x922d9b,_0x3ab519=_0x3a6ef5,_0x2efe83=await resolveWorkspaceName(_0x1355aa[0x0],_0x3ab519);if(!_0x2efe83)return console[_0xea9836(0x131)](a18_0x6a25d8[_0xea9836(0x15c)](_0xea9836(0x13f))),console[_0xea9836(0x131)](_0xea9836(0x132)),console['error'](_0xea9836(0x149)),console['error'](_0xea9836(0x14f)),0x1;const _0xe338ea=await withProgressSpinner(_0xea9836(0x139)+_0x2efe83+_0xea9836(0x150),_0x469852=>pullCampaigns({'engage':_0x2cbf29[_0xea9836(0x15d)],'segment':_0x2cbf29[_0xea9836(0x12f)]},_0x2efe83,{'campaignName':_0x3ab519[_0xea9836(0x136)],'campaignType':_0x3ab519[_0xea9836(0x12b)],'progress':{'update':_0x3a1569=>{_0x469852['setPhase'](_0x3a1569);}}}),{'verbose':_0x3ab519[_0xea9836(0x128)]}),_0x2d2299=_0xe338ea[_0xea9836(0x12c)];if(_0x2d2299[_0xea9836(0x11d)][_0xea9836(0x138)]===0x0)return console[_0xea9836(0x131)](a18_0x6a25d8[_0xea9836(0x15c)]('No\x20campaigns\x20found\x20in\x20workspace\x20\x27'+_0x2d2299[_0xea9836(0x151)]+'\x27')),0x0;const _0x4b8e69=_0x2d2299[_0xea9836(0x15b)][_0xea9836(0x153)](_0x45512a=>_0x45512a['isNew']),_0x484586=_0x2d2299[_0xea9836(0x15b)][_0xea9836(0x153)](_0x24ffc0=>!_0x24ffc0[_0xea9836(0x126)]&&_0x24ffc0[_0xea9836(0x145)]),_0x3e5f8a=_0x2d2299['files'][_0xea9836(0x153)](_0x559397=>!_0x559397[_0xea9836(0x126)]&&!_0x559397[_0xea9836(0x145)]);console['error']('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x2d2299[_0xea9836(0x151)]+'\x27:'),console[_0xea9836(0x131)]('\x20\x20'+a18_0x6a25d8[_0xea9836(0x157)](_0x2d2299[_0xea9836(0x11d)][_0xea9836(0x138)]+_0xea9836(0x14e))),console[_0xea9836(0x131)]('\x20\x20'+a18_0x6a25d8[_0xea9836(0x148)]('+\x20'+_0x4b8e69[_0xea9836(0x124)]+'\x20new\x20files')),console[_0xea9836(0x131)]('\x20\x20'+a18_0x6a25d8[_0xea9836(0x15c)]('~\x20'+_0x484586[_0xea9836(0x124)]+'\x20changed\x20files')),console[_0xea9836(0x131)]('\x20\x20'+a18_0x6a25d8[_0xea9836(0x130)]('=\x20'+_0x3e5f8a[_0xea9836(0x124)]+'\x20unchanged\x20files')),console[_0xea9836(0x131)](_0xea9836(0x122)+a18_0x6a25d8[_0xea9836(0x157)](_0x2d2299[_0xea9836(0x14a)])+'\x0a');if(_0x484586[_0xea9836(0x124)]>0x0)for(const _0x58af9 of _0x484586){console[_0xea9836(0x131)](_0xea9836(0x11c)+_0x58af9[_0xea9836(0x120)]+'\x27:'),console[_0xea9836(0x131)]('─'['repeat'](0x3c)),console['error'](_0x58af9['diff']),console[_0xea9836(0x131)]('─'['repeat'](0x3c));}if(_0x3ab519[_0xea9836(0x13a)])return console[_0xea9836(0x131)](a18_0x6a25d8[_0xea9836(0x15c)](_0xea9836(0x156))),0x0;if(_0x4b8e69[_0xea9836(0x124)]===0x0&&_0x484586[_0xea9836(0x124)]===0x0)return console[_0xea9836(0x131)](a18_0x6a25d8['green'](_0xea9836(0x13c))),saveSessionContext({'engage_workspace':_0x2d2299['workspaceName']},_0x3ab519[_0xea9836(0x158)]),0x0;if(!_0x3ab519[_0xea9836(0x15a)]){if(!isInteractive())return console[_0xea9836(0x131)](a18_0x6a25d8['red'](_0xea9836(0x137)),_0xea9836(0x143)),console[_0xea9836(0x131)](a18_0x6a25d8[_0xea9836(0x130)](_0xea9836(0x140))),0x1;const _0x5a3595=await confirmKey('Write\x20'+(_0x4b8e69[_0xea9836(0x124)]+_0x484586['length'])+_0xea9836(0x141));if(!_0x5a3595)return console[_0xea9836(0x131)](a18_0x6a25d8[_0xea9836(0x15c)](_0xea9836(0x11e)),_0xea9836(0x14d)),0x1;}for(const _0x46acc7 of _0x2d2299[_0xea9836(0x15b)]){if(_0x46acc7[_0xea9836(0x126)]||_0x46acc7['hasChanges']){const _0x5ef22e=a18_0x2e7c9c[_0xea9836(0x134)](_0x46acc7[_0xea9836(0x12a)]);!existsSync(_0x5ef22e)&&mkdirSync(_0x5ef22e,{'recursive':!![]}),writeFileSync(_0x46acc7['absolutePath'],_0x46acc7[_0xea9836(0x13d)],_0xea9836(0x135));}}return console[_0xea9836(0x131)](a18_0x6a25d8['green'](_0xea9836(0x11f)+(_0x4b8e69[_0xea9836(0x124)]+_0x484586[_0xea9836(0x124)])+_0xea9836(0x129)+_0x2d2299['targetDir'])),saveSessionContext({'engage_workspace':_0x2d2299[_0xea9836(0x151)]},_0x3ab519[_0xea9836(0x158)]),console['error'](a18_0x6a25d8['green'](_0xea9836(0x133)+a18_0x6a25d8[_0xea9836(0x130)]('engage_workspace')+_0xea9836(0x125)+a18_0x6a25d8[_0xea9836(0x157)](_0x2d2299[_0xea9836(0x151)]))),0x0;}}async function resolveWorkspaceName(_0x304b9f,_0x222e1c){const _0xfefc21=a18_0x1def81;if(_0x304b9f)return _0x304b9f;if(_0x222e1c[_0xfefc21(0x13b)])return _0x222e1c[_0xfefc21(0x13b)];const _0x147872=tryFindTdxConfig(process[_0xfefc21(0x12e)]());if(_0x147872?.[_0xfefc21(0x159)][_0xfefc21(0x142)])return _0x147872[_0xfefc21(0x159)]['engage_workspace'];const _0x56eaec=loadSessionContext(_0x222e1c[_0xfefc21(0x158)]);if(_0x56eaec?.[_0xfefc21(0x142)])return _0x56eaec[_0xfefc21(0x142)];return undefined;}