@treasuredata/tdx 0.15.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) 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.d.ts.map +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-command.js.map +1 -1
  9. package/dist/commands/agent-test-command.d.ts.map +1 -1
  10. package/dist/commands/agent-test-command.js +1 -1
  11. package/dist/commands/agent-test-command.js.map +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/llm-proxy.js +1 -1
  28. package/dist/commands/mcp-command.js +1 -1
  29. package/dist/commands/parent-segment-command.js +1 -1
  30. package/dist/commands/profile-command.js +1 -1
  31. package/dist/commands/profiles-command.js +1 -1
  32. package/dist/commands/query-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/unset-command.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/user-command.js +1 -1
  47. package/dist/commands/workflow-command.js +1 -1
  48. package/dist/core/auth.js +1 -1
  49. package/dist/core/command-output.js +1 -1
  50. package/dist/core/config.js +1 -1
  51. package/dist/core/connection-cache.js +1 -1
  52. package/dist/core/constants.js +1 -1
  53. package/dist/core/credential-cache.js +1 -1
  54. package/dist/core/global-context.js +1 -1
  55. package/dist/core/keychain.js +1 -1
  56. package/dist/core/profile.js +1 -1
  57. package/dist/core/project-config.js +1 -1
  58. package/dist/core/session.js +1 -1
  59. package/dist/core/user-cache.js +1 -1
  60. package/dist/core/version.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/mcp/server.js +1 -1
  63. package/dist/mcp/tools/index.js +1 -1
  64. package/dist/mcp/tools/tdx-run.js +1 -1
  65. package/dist/mcp/tools/tdx-search.js +1 -1
  66. package/dist/mcp/utils.js +1 -1
  67. package/dist/proxy/anthropic-adapter.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/context-signature.js +1 -1
  70. package/dist/proxy/conversation-utils.js +1 -1
  71. package/dist/proxy/passthrough-server.js +1 -1
  72. package/dist/proxy/server.js +1 -1
  73. package/dist/proxy/session-cache.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.d.ts.map +1 -1
  76. package/dist/sdk/agent/agent-config.js +1 -1
  77. package/dist/sdk/agent/agent-config.js.map +1 -1
  78. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  79. package/dist/sdk/agent/agent-yaml.d.ts +44 -0
  80. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  83. package/dist/sdk/agent/test/evaluator.js +1 -1
  84. package/dist/sdk/agent/test/executor.js +1 -1
  85. package/dist/sdk/agent/test/index.js +1 -1
  86. package/dist/sdk/agent/test/output.js +1 -1
  87. package/dist/sdk/agent/test/parser.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  90. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  91. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  92. package/dist/sdk/claude-agent/environment.js +1 -1
  93. package/dist/sdk/claude-agent/index.d.ts +2 -1
  94. package/dist/sdk/claude-agent/index.d.ts.map +1 -1
  95. package/dist/sdk/claude-agent/index.js +1 -1
  96. package/dist/sdk/claude-agent/index.js.map +1 -1
  97. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  98. package/dist/sdk/claude-agent/types.d.ts +4 -1
  99. package/dist/sdk/claude-agent/types.d.ts.map +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/endpoints.js +1 -1
  102. package/dist/sdk/client/engage-api-client.js +1 -1
  103. package/dist/sdk/client/http-client.js +1 -1
  104. package/dist/sdk/client/llm-api-client.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/engage.js +1 -1
  112. package/dist/sdk/errors.js +1 -1
  113. package/dist/sdk/index.js +1 -1
  114. package/dist/sdk/io/index.js +1 -1
  115. package/dist/sdk/io/node-filesystem.js +1 -1
  116. package/dist/sdk/job.js +1 -1
  117. package/dist/sdk/journey.js +1 -1
  118. package/dist/sdk/llm/chat-cache.js +1 -1
  119. package/dist/sdk/llm/index.d.ts.map +1 -1
  120. package/dist/sdk/llm/index.js +1 -1
  121. package/dist/sdk/llm/index.js.map +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-aliases.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  128. package/dist/sdk/segment/fields-display.js +1 -1
  129. package/dist/sdk/segment/file-discovery.js +1 -1
  130. package/dist/sdk/segment/journey-utils.js +1 -1
  131. package/dist/sdk/segment/journey-yaml.js +1 -1
  132. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  133. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/pull-workflow.js +1 -1
  135. package/dist/sdk/segment/push-workflow.js +1 -1
  136. package/dist/sdk/segment/resolution-context.js +1 -1
  137. package/dist/sdk/segment/segment-path-parser.js +1 -1
  138. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  139. package/dist/sdk/segment/target-resolution.js +1 -1
  140. package/dist/sdk/segment/tdx-config.js +1 -1
  141. package/dist/sdk/segment/validate-files.js +1 -1
  142. package/dist/sdk/segment/yaml-validator.js +1 -1
  143. package/dist/sdk/segment.js +1 -1
  144. package/dist/sdk/types/index.js +1 -1
  145. package/dist/sdk/types/progress.js +1 -1
  146. package/dist/sdk/user.js +1 -1
  147. package/dist/sdk/util/format-detector.js +1 -1
  148. package/dist/sdk/util/formatters.js +1 -1
  149. package/dist/sdk/util/index.js +1 -1
  150. package/dist/sdk/util/tree-formatter.js +1 -1
  151. package/dist/sdk/workflow/clone-workflow.js +1 -1
  152. package/dist/sdk/workflow/index.js +1 -1
  153. package/dist/sdk/workflow/pull-workflow.js +1 -1
  154. package/dist/sdk/workflow/push-workflow.js +1 -1
  155. package/dist/sdk/workflow/tdx-config.js +1 -1
  156. package/dist/sdk/workflow/workflow-utils.js +1 -1
  157. package/dist/utils/async.js +1 -1
  158. package/dist/utils/colors.js +1 -1
  159. package/dist/utils/diff.js +1 -1
  160. package/dist/utils/file-permissions.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/option-validation.js +1 -1
  163. package/dist/utils/port.js +1 -1
  164. package/dist/utils/process.js +1 -1
  165. package/dist/utils/prompt.js +1 -1
  166. package/dist/utils/spinner.js +1 -1
  167. package/dist/utils/sse-parser.js +1 -1
  168. package/dist/utils/string-utils.js +1 -1
  169. package/dist/utils/table-ref-parser.js +1 -1
  170. package/dist/utils/tdx-logger.js +1 -1
  171. package/dist/utils/version-check.js +1 -1
  172. package/package.json +1 -1
@@ -1 +1 @@
1
- function a8_0x1bca(){const _0x4c7569=['--agent\x20flag','\x0aError:\x20','404','chatId','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','2175648fxAMHR','code','error','\x0aStack\x20trace:','96FnFSXm','38czLcuT','Error:\x20','join','type','3692bmSRvR','Continuing\x20chat:\x20','getAgentId','2789941aQvkfK','metadata','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','validate','1308440AgwSZx','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','\x20\x20Cause:\x20','Getting\x20default\x20agent...','llm','log','3134010tukGeD','stdout','verbose','message','getOrCreateDefaultAgent','event','execute','resolveAgentId','claude-4.5-haiku','includes','data','chat','new','578574JDXpNx','description','3595BnbwZh','30YuLvIO','CHAT_NOT_FOUND','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','streamChat','25873YciAkv','content','agent','Using\x20cached\x20default\x20agent:\x20','stack','Resolving\x20agent\x20\x27','cause','write','name'];a8_0x1bca=function(){return _0x4c7569;};return a8_0x1bca();}const a8_0x34a0b6=a8_0x3e68;(function(_0x265d06,_0x5340ab){const _0x49e354=a8_0x3e68,_0x317727=_0x265d06();while(!![]){try{const _0x548c05=parseInt(_0x49e354(0xc8))/0x1*(-parseInt(_0x49e354(0xa3))/0x2)+parseInt(_0x49e354(0x9e))/0x3+-parseInt(_0x49e354(0xa7))/0x4*(parseInt(_0x49e354(0xc3))/0x5)+-parseInt(_0x49e354(0xb4))/0x6+-parseInt(_0x49e354(0xae))/0x7+-parseInt(_0x49e354(0xa2))/0x8*(-parseInt(_0x49e354(0xc1))/0x9)+-parseInt(_0x49e354(0xc4))/0xa*(-parseInt(_0x49e354(0xaa))/0xb);if(_0x548c05===_0x5340ab)break;else _0x317727['push'](_0x317727['shift']());}catch(_0x478d90){_0x317727['push'](_0x317727['shift']());}}}(a8_0x1bca,0x5ff66));import{BaseCommand}from'./command.js';function a8_0x3e68(_0x132e7b,_0x3104ed){_0x132e7b=_0x132e7b-0x9e;const _0x1bcaa0=a8_0x1bca();let _0x3e6851=_0x1bcaa0[_0x132e7b];return _0x3e6851;}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';function handleSDKError(_0xd86cb5,_0x369e44){const _0x43daac=a8_0x3e68;if(_0xd86cb5 instanceof SDKError)console['error'](_0x43daac(0xa4)+_0xd86cb5[_0x43daac(0xb7)]),_0x369e44['verbose']&&(_0xd86cb5[_0x43daac(0xce)]&&console[_0x43daac(0xa0)](_0x43daac(0xb0)+_0xd86cb5[_0x43daac(0xce)]),_0xd86cb5[_0x43daac(0xcc)]&&(console[_0x43daac(0xa0)](_0x43daac(0xa1)),console[_0x43daac(0xa0)](_0xd86cb5['stack'])));else throw _0xd86cb5;}export class ChatCommand extends BaseCommand{[a8_0x34a0b6(0xd0)]=a8_0x34a0b6(0xbf);[a8_0x34a0b6(0xc2)]=a8_0x34a0b6(0xac);[a8_0x34a0b6(0xad)](_0x258b56){const _0x285197=a8_0x34a0b6,_0x2e2653=_0x258b56['args'][_0x285197(0xa5)]('\x20');if(!_0x2e2653)return _0x285197(0xc6);return undefined;}async['streamChat'](_0x1a0b59,_0x5dcd66,_0x308400,_0x760ae6,_0x5499e9){const _0x5c8b0e=a8_0x34a0b6;for await(const _0xa67360 of _0x1a0b59['llm'][_0x5c8b0e(0xbf)](_0x5dcd66,{'agentId':_0x308400,'chatId':_0x760ae6})){if(_0xa67360[_0x5c8b0e(0xa6)]===_0x5c8b0e(0xab)){const _0x45db2e=_0xa67360['data'][_0x5c8b0e(0xd4)];saveLastChatId(_0x45db2e),_0x5499e9&&console[_0x5c8b0e(0xa0)]('Chat\x20session:\x20'+_0x45db2e);}else _0xa67360[_0x5c8b0e(0xa6)]===_0x5c8b0e(0xb9)&&this['handleChatEvent'](_0xa67360[_0x5c8b0e(0xbe)]);}}async[a8_0x34a0b6(0xa9)](_0x1da9b6,_0x3510f3,_0x5a02f6,_0x9e695f,_0x1d8cd0){const _0x3b1a99=a8_0x34a0b6,_0x22d628=_0x3510f3||_0x5a02f6;if(_0x22d628){const {projectName:_0xa4e771,agentName:_0x531575}=parseAgentRef(_0x22d628),_0x560d1e=_0x531575||_0x22d628,_0x212401=_0x531575?_0xa4e771:_0x9e695f;if(!_0x212401)throw new Error(_0x3b1a99(0xaf));if(_0x1d8cd0){const _0x5df51a=_0x3510f3?_0x3b1a99(0xd1):'session\x20context';console[_0x3b1a99(0xa0)]('Using\x20agent\x20from\x20'+_0x5df51a+':\x20'+_0x212401+'/'+_0x560d1e);}const _0x11cca8=await withSpinner('Resolving\x20project\x20\x27'+_0x212401+'\x27...',()=>_0x1da9b6[_0x3b1a99(0xb2)]['resolveProjectId'](_0x212401),{'verbose':_0x1d8cd0}),_0x2f5b63=await withSpinner(_0x3b1a99(0xcd)+_0x560d1e+'\x27...',()=>_0x1da9b6[_0x3b1a99(0xb2)][_0x3b1a99(0xbb)](_0x560d1e,_0x11cca8[_0x3b1a99(0xbe)]),{'verbose':_0x1d8cd0});return _0x2f5b63[_0x3b1a99(0xbe)];}else{const _0x12081b=_0x1da9b6[_0x3b1a99(0xb2)]['getDefaultAgent']();if(_0x12081b)return _0x1d8cd0&&console[_0x3b1a99(0xa0)](_0x3b1a99(0xcb)+_0x12081b[_0x3b1a99(0xd0)]),_0x12081b['id'];const _0x325eab=await withSpinner(_0x3b1a99(0xb1),()=>_0x1da9b6[_0x3b1a99(0xb2)][_0x3b1a99(0xb8)](_0x3b1a99(0xbc),0x0),{'verbose':_0x1d8cd0});return _0x325eab[_0x3b1a99(0xbe)]['id'];}}async[a8_0x34a0b6(0xba)](_0xb72342){const _0x10df04=a8_0x34a0b6,{options:_0x111edc,args:_0x11bcf0,tdx:_0x4e0f57}=_0xb72342,_0x1a9829=_0x11bcf0['join']('\x20'),_0x46d5c6=_0x111edc,_0x2d9da8=_0x46d5c6[_0x10df04(0xca)],_0x388531=_0x46d5c6['llmAgent'],_0xcca587=_0x46d5c6['llmProject'],_0x3195d1=_0x46d5c6[_0x10df04(0xc0)];try{let _0x2b6eb7,_0x43a0ef;!_0x3195d1&&(_0x43a0ef=loadLastChatId(),_0x43a0ef&&_0x111edc[_0x10df04(0xb6)]&&console[_0x10df04(0xa0)](_0x10df04(0xa8)+_0x43a0ef));(_0x3195d1||!_0x43a0ef)&&(_0x2b6eb7=await this[_0x10df04(0xa9)](_0x4e0f57,_0x2d9da8,_0x388531,_0xcca587,_0x111edc['verbose']));try{await this[_0x10df04(0xc7)](_0x4e0f57,_0x1a9829,_0x2b6eb7,_0x43a0ef,_0x111edc['verbose']);}catch(_0x4695da){const _0xcea4bd=_0x4695da instanceof SDKError&&_0x4695da[_0x10df04(0x9f)]===ErrorCode[_0x10df04(0xc5)]||_0x4695da instanceof Error&&_0x4695da['message'][_0x10df04(0xbd)](_0x10df04(0xd3));if(_0xcea4bd)_0x111edc['verbose']&&console['error'](_0x10df04(0xd5)),!_0x2b6eb7&&(_0x2b6eb7=await this[_0x10df04(0xa9)](_0x4e0f57,_0x2d9da8,_0x388531,_0xcca587,_0x111edc['verbose'])),await this[_0x10df04(0xc7)](_0x4e0f57,_0x1a9829,_0x2b6eb7,undefined,_0x111edc[_0x10df04(0xb6)]);else throw _0x4695da;}return console[_0x10df04(0xb3)](),0x0;}catch(_0x243285){return console[_0x10df04(0xa0)](),handleSDKError(_0x243285,_0x111edc),0x1;}}['handleChatEvent'](_0x1436f6){const _0x501cd8=a8_0x34a0b6;if('content'in _0x1436f6)process[_0x501cd8(0xb5)][_0x501cd8(0xcf)](_0x1436f6[_0x501cd8(0xc9)]);else _0x501cd8(0xa0)in _0x1436f6&&console['error'](_0x501cd8(0xd2)+_0x1436f6[_0x501cd8(0xa0)]);}}
1
+ const a8_0x5c6d1b=a8_0x15f9;(function(_0x32a745,_0x29707f){const _0x31b920=a8_0x15f9,_0x3ea98c=_0x32a745();while(!![]){try{const _0x49f983=parseInt(_0x31b920(0xcc))/0x1+parseInt(_0x31b920(0xc6))/0x2+parseInt(_0x31b920(0xc3))/0x3*(-parseInt(_0x31b920(0xab))/0x4)+-parseInt(_0x31b920(0xb7))/0x5*(parseInt(_0x31b920(0xd7))/0x6)+parseInt(_0x31b920(0xb2))/0x7*(-parseInt(_0x31b920(0xce))/0x8)+-parseInt(_0x31b920(0xbc))/0x9+parseInt(_0x31b920(0xaf))/0xa;if(_0x49f983===_0x29707f)break;else _0x3ea98c['push'](_0x3ea98c['shift']());}catch(_0x4770e2){_0x3ea98c['push'](_0x3ea98c['shift']());}}}(a8_0x4217,0x9d195));function a8_0x4217(){const _0x5ba97b=['metadata','257264tuXwVR','chatId','cause','Continuing\x20chat:\x20','getDefaultAgent','code','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','getOrCreateDefaultAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','4605420hGQTid','\x20\x20Cause:\x20','message','CHAT_NOT_FOUND','event','llmProject','--agent\x20flag','4BgTPNt','\x0aStack\x20trace:','name','agent','21942900zBcagy','Resolving\x20project\x20\x27','handleChatEvent','49sMUKsA','llm','llmAgent','data','resolveProjectId','5uXzcQD','description','Chat\x20session:\x20','validate','content','1985058hgNTOo','join','Using\x20cached\x20default\x20agent:\x20','error','streamChat','new','Getting\x20default\x20agent...','3281139BtlzCC','chat','log','277052xUnOMW','\x27...','type','includes','verbose','stack','617612aOsziK'];a8_0x4217=function(){return _0x5ba97b;};return a8_0x4217();}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';function handleSDKError(_0x1c476c,_0x12cdc2){const _0x36bcb3=a8_0x15f9;if(_0x1c476c instanceof SDKError)console[_0x36bcb3(0xbf)]('Error:\x20'+_0x1c476c[_0x36bcb3(0xd9)]),_0x12cdc2[_0x36bcb3(0xca)]&&(_0x1c476c[_0x36bcb3(0xd0)]&&console[_0x36bcb3(0xbf)](_0x36bcb3(0xd8)+_0x1c476c[_0x36bcb3(0xd0)]),_0x1c476c[_0x36bcb3(0xcb)]&&(console['error'](_0x36bcb3(0xac)),console[_0x36bcb3(0xbf)](_0x1c476c[_0x36bcb3(0xcb)])));else throw _0x1c476c;}function a8_0x15f9(_0x3ae5f6,_0x5b5128){_0x3ae5f6=_0x3ae5f6-0xa7;const _0x421765=a8_0x4217();let _0x15f94e=_0x421765[_0x3ae5f6];return _0x15f94e;}export class ChatCommand extends BaseCommand{[a8_0x5c6d1b(0xad)]=a8_0x5c6d1b(0xc4);[a8_0x5c6d1b(0xb8)]=a8_0x5c6d1b(0xd6);[a8_0x5c6d1b(0xba)](_0x146075){const _0x5b39cc=a8_0x5c6d1b,_0x104816=_0x146075['args'][_0x5b39cc(0xbd)]('\x20');if(!_0x104816)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x3e56a1,_0x160b60,_0x3b023f,_0x4794af,_0x112657){const _0x53f413=a8_0x5c6d1b;for await(const _0x44481a of _0x3e56a1[_0x53f413(0xb3)][_0x53f413(0xc4)](_0x160b60,{'agentId':_0x3b023f,'chatId':_0x4794af})){if(_0x44481a[_0x53f413(0xc8)]===_0x53f413(0xcd)){const _0x3191b2=_0x44481a[_0x53f413(0xb5)][_0x53f413(0xcf)];saveLastChatId(_0x3191b2),_0x112657&&console['error'](_0x53f413(0xb9)+_0x3191b2);}else _0x44481a['type']===_0x53f413(0xa8)&&this[_0x53f413(0xb1)](_0x44481a[_0x53f413(0xb5)]);}}async['getAgentId'](_0x410dea,_0x4670d0,_0x5b9370,_0x35ff52,_0x297b0f){const _0x541dba=a8_0x5c6d1b,_0x146b0e=_0x4670d0||_0x5b9370;if(_0x146b0e){const {projectName:_0x4db759,agentName:_0x4a1b55}=parseAgentRef(_0x146b0e),_0x24001f=_0x4a1b55||_0x146b0e,_0x3135dc=_0x4a1b55?_0x4db759:_0x35ff52;if(!_0x3135dc)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x297b0f){const _0xbacc7e=_0x4670d0?_0x541dba(0xaa):'session\x20context';console[_0x541dba(0xbf)]('Using\x20agent\x20from\x20'+_0xbacc7e+':\x20'+_0x3135dc+'/'+_0x24001f);}const _0x6b84a7=await withSpinner(_0x541dba(0xb0)+_0x3135dc+_0x541dba(0xc7),()=>_0x410dea[_0x541dba(0xb3)][_0x541dba(0xb6)](_0x3135dc),{'verbose':_0x297b0f}),_0xf8e337=await withSpinner('Resolving\x20agent\x20\x27'+_0x24001f+_0x541dba(0xc7),()=>_0x410dea['llm']['resolveAgentId'](_0x24001f,_0x6b84a7[_0x541dba(0xb5)]),{'verbose':_0x297b0f});return _0xf8e337[_0x541dba(0xb5)];}else{const _0x38d02e=_0x410dea[_0x541dba(0xb3)][_0x541dba(0xd2)]();if(_0x38d02e)return _0x297b0f&&console[_0x541dba(0xbf)](_0x541dba(0xbe)+_0x38d02e[_0x541dba(0xad)]),_0x38d02e['id'];const _0x2dfb26=await withSpinner(_0x541dba(0xc2),()=>_0x410dea[_0x541dba(0xb3)][_0x541dba(0xd5)]('claude-4.5-haiku',0x0),{'verbose':_0x297b0f});return _0x2dfb26[_0x541dba(0xb5)]['id'];}}async['execute'](_0x44bf37){const _0x1be05c=a8_0x5c6d1b,{options:_0x19d37a,args:_0x4913b1,tdx:_0xd7afc}=_0x44bf37,_0x3bee9f=_0x4913b1['join']('\x20'),_0x4ff5e0=_0x19d37a,_0x516c19=_0x4ff5e0[_0x1be05c(0xae)],_0x22c6b2=_0x4ff5e0[_0x1be05c(0xb4)],_0x15d5c7=_0x4ff5e0[_0x1be05c(0xa9)],_0x56502e=_0x4ff5e0[_0x1be05c(0xc1)];try{let _0x51df0b,_0x1d9849;!_0x56502e&&(_0x1d9849=loadLastChatId(),_0x1d9849&&_0x19d37a[_0x1be05c(0xca)]&&console[_0x1be05c(0xbf)](_0x1be05c(0xd1)+_0x1d9849));(_0x56502e||!_0x1d9849)&&(_0x51df0b=await this['getAgentId'](_0xd7afc,_0x516c19,_0x22c6b2,_0x15d5c7,_0x19d37a['verbose']));try{await this[_0x1be05c(0xc0)](_0xd7afc,_0x3bee9f,_0x51df0b,_0x1d9849,_0x19d37a[_0x1be05c(0xca)]);}catch(_0x2e10bf){const _0x5be2fe=_0x2e10bf instanceof SDKError&&_0x2e10bf[_0x1be05c(0xd3)]===ErrorCode[_0x1be05c(0xa7)]||_0x2e10bf instanceof Error&&_0x2e10bf['message'][_0x1be05c(0xc9)]('404');if(_0x5be2fe)_0x19d37a['verbose']&&console[_0x1be05c(0xbf)](_0x1be05c(0xd4)),!_0x51df0b&&(_0x51df0b=await this['getAgentId'](_0xd7afc,_0x516c19,_0x22c6b2,_0x15d5c7,_0x19d37a[_0x1be05c(0xca)])),await this['streamChat'](_0xd7afc,_0x3bee9f,_0x51df0b,undefined,_0x19d37a['verbose']);else throw _0x2e10bf;}return console[_0x1be05c(0xc5)](),0x0;}catch(_0x270ea8){return console[_0x1be05c(0xbf)](),handleSDKError(_0x270ea8,_0x19d37a),0x1;}}[a8_0x5c6d1b(0xb1)](_0x1a551a){const _0x587b9e=a8_0x5c6d1b;if(_0x587b9e(0xbb)in _0x1a551a)process['stdout']['write'](_0x1a551a[_0x587b9e(0xbb)]);else _0x587b9e(0xbf)in _0x1a551a&&console[_0x587b9e(0xbf)]('\x0aError:\x20'+_0x1a551a['error']);}}
@@ -1 +1 @@
1
- const a9_0x536812=a9_0x5136;(function(_0x44a394,_0x598232){const _0x3b796b=a9_0x5136,_0x12bbf5=_0x44a394();while(!![]){try{const _0x4f55e6=-parseInt(_0x3b796b(0x102))/0x1*(-parseInt(_0x3b796b(0xa3))/0x2)+-parseInt(_0x3b796b(0x94))/0x3+parseInt(_0x3b796b(0xd8))/0x4+parseInt(_0x3b796b(0x100))/0x5*(-parseInt(_0x3b796b(0xc9))/0x6)+parseInt(_0x3b796b(0xdc))/0x7*(-parseInt(_0x3b796b(0xe0))/0x8)+-parseInt(_0x3b796b(0xd5))/0x9*(-parseInt(_0x3b796b(0xba))/0xa)+parseInt(_0x3b796b(0xad))/0xb;if(_0x4f55e6===_0x598232)break;else _0x12bbf5['push'](_0x12bbf5['shift']());}catch(_0x2573dd){_0x12bbf5['push'](_0x12bbf5['shift']());}}}(a9_0x9760,0xbfde2));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x5a3bd1 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findAvailablePort}from'../utils/port.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';function a9_0x9760(){const _0xd38aa2=['2114JvEdPx','exit','✓\x20Plugin\x20\x27','Creating\x20.claude/settings.local.json...','Initializing...','server','getOrCreateDefaultProject','stringify','127.0.0.1','warn','14899775skaGcr','✓\x20Logging\x20to\x20','parse','already\x20configured','\x27\x20configured','llmProxy','env','http://127.0.0.1:','info','marketplace','execute','td-skills','Claude\x20Code\x20CLI\x20not\x20found','272440hzXUef','\x27...','CLAUDE_CODE_USE_BEDROCK','green','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','\x27\x20installed','start','minor','\x27\x20updated','):\x20claude\x20','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','Installing\x20plugin\x20\x27','Finding\x20available\x20port...','Configuring\x20MCP\x20server\x20\x27','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','306gfIoQJ','port','✓\x20Using\x20project:\x20','https://github.com/treasure-data/td-skills','logLevel','Starting\x20TD\x20LLM\x20proxy\x20server...','.claude','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','trim','getCurrent','CLAUDE_CODE_USE_VERTEX','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','342ZEyotA','add','✓\x20Claude\x20Code\x20version\x20OK','1713060ELKvAA','text','Setting\x20up\x20project...','\x20is\x20too\x20old\x20(minimum:\x20','98cVZwGW','user','statusline','tdx\x20claude\x20statusline','329392iFbZsv','close','false','✓\x20Logs\x20saved\x20to\x20','description','inherit','major','settings.local.json','message','join','ANTHROPIC_MODEL','mcp','logger','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','passThroughServer','profile','Warning:\x20Failed\x20to\x20configure\x20','resume','string','\x20claude\x20statusline','Failed\x20to\x20install\x20plugin\x20\x27','red','llm','http','tdx-skills','error','hostname','pipe','stop','debug','Command\x20failed\x20(exit\x20','originalSettings','39145bVhQkc','\x20configuration\x20failed','197xBSRqe','Claude\x20Code\x20version\x20','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','INSTALLATION_FAILED','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Initializing\x20proxy\x20logger...','2.0.20','includes','Setup\x20failed','Command\x20output:\x20','plugin','Failed\x20to\x20update\x20marketplace\x20\x27','stdout','toString','tdx','fail','Checking\x20Claude\x20Code\x20version...','model','Configuring\x20marketplace\x20\x27','✓\x20Found\x20available\x20port:\x20','log','\x20→\x20','https://docs.treasuredata.com/mcp','update','site','match','Failed\x20to\x20spawn\x20claude\x20command:\x20','init','context','stderr','tdx-managed-proxy','tdx\x20--profile\x20','account_id','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','cause','CLAUDE_CODE_UNSUPPORTED_VERSION','statusLine','utf-8','claude','getLogPath','command','ANTHROPIC_BASE_URL','Updating\x20marketplace\x20\x27','unshift','\x20already\x20configured','install','object','td-skills\x20Plugins','\x20meets\x20minimum\x20requirement','Claude\x20Code\x20version\x20check\x20failed','code','apiKey','3794058avXTnd','ANTHROPIC_AUTH_TOKEN','INTERNAL','patch','proxy','TD\x20Docs\x20MCP\x20Server','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','data','INVALID_ARGUMENT','cwd','✓\x20Marketplace\x20\x27','✓\x20Settings\x20restored:\x20.claude/settings.local.json','already\x20exists','CLAUDE_CODE_NOT_FOUND','✓\x20Settings\x20configured:\x20.claude/settings.local.json'];a9_0x9760=function(){return _0xd38aa2;};return a9_0x9760();}const MIN_CLAUDE_VERSION=a9_0x536812(0x108);function handleInstallationError(_0x40c5b2,_0x50b80d,_0x2c1bad,_0x2b90b4){const _0x1cf16e=a9_0x536812;errorContains(_0x40c5b2,_0x1cf16e(0xa0),'already\x20installed',_0x1cf16e(0xb0))?(_0x2c1bad[_0x1cf16e(0xd9)]='✓\x20'+_0x50b80d+_0x1cf16e(0x8c),_0x2b90b4?.[_0x1cf16e(0xb5)](_0x50b80d+_0x1cf16e(0x8c)),_0x40c5b2 instanceof SDKError&&_0x40c5b2['cause']&&_0x2b90b4?.['debug'](_0x1cf16e(0x10b)+_0x40c5b2[_0x1cf16e(0x82)]['message'])):(_0x2c1bad['warn'](_0x1cf16e(0xf0)+_0x50b80d),_0x2b90b4?.[_0x1cf16e(0xf9)](_0x50b80d+_0x1cf16e(0x101),_0x40c5b2));}export function parseVersion(_0xd02820){const _0x7a83db=a9_0x536812,_0x23cf5f=_0xd02820[_0x7a83db(0xd1)]()[_0x7a83db(0x79)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x23cf5f)return null;return{'major':parseInt(_0x23cf5f[0x1],0xa),'minor':parseInt(_0x23cf5f[0x2],0xa),'patch':parseInt(_0x23cf5f[0x3],0xa)};}export function compareVersions(_0x385104,_0x2f0f4b){const _0x2a5867=a9_0x536812;if(_0x385104[_0x2a5867(0xe6)]!==_0x2f0f4b['major'])return _0x385104[_0x2a5867(0xe6)]-_0x2f0f4b[_0x2a5867(0xe6)];if(_0x385104['minor']!==_0x2f0f4b[_0x2a5867(0xc1)])return _0x385104[_0x2a5867(0xc1)]-_0x2f0f4b[_0x2a5867(0xc1)];return _0x385104[_0x2a5867(0x97)]-_0x2f0f4b[_0x2a5867(0x97)];}async function checkClaudeVersion(_0x1b1e3a,_0x2b9258){const _0x3b4d4d=a9_0x536812;_0x2b9258?.[_0x3b4d4d(0xfd)]('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x1b1e3a+')');const _0x276e8d=await executeClaudeCommand(['--version'],undefined,_0x2b9258),_0xa77c33=parseVersion(_0x276e8d);if(!_0xa77c33){_0x2b9258?.[_0x3b4d4d(0xac)](_0x3b4d4d(0xc8)+_0x276e8d);return;}const _0x5099cf=_0xa77c33[_0x3b4d4d(0xe6)]+'.'+_0xa77c33[_0x3b4d4d(0xc1)]+'.'+_0xa77c33[_0x3b4d4d(0x97)],_0x1123e5=parseVersion(_0x1b1e3a);if(!_0x1123e5){_0x2b9258?.[_0x3b4d4d(0xac)]('Invalid\x20minimum\x20version\x20format:\x20'+_0x1b1e3a);return;}if(compareVersions(_0xa77c33,_0x1123e5)<0x0){_0x2b9258?.[_0x3b4d4d(0xf9)](_0x3b4d4d(0x103)+_0x5099cf+_0x3b4d4d(0xdb)+_0x1b1e3a+')');throw new SDKError(ErrorCode[_0x3b4d4d(0x83)],_0x3b4d4d(0x103)+_0x5099cf+_0x3b4d4d(0x9a)+_0x1b1e3a+'\x20or\x20later.',undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x2b9258?.[_0x3b4d4d(0xfd)]('Claude\x20Code\x20version\x20'+_0x5099cf+_0x3b4d4d(0x90));}async function executeClaudeCommand(_0x2fe336,_0x29e56d,_0x425a97){const _0x315fb2=a9_0x536812;return _0x425a97?.[_0x315fb2(0xb5)]('Executing:\x20claude\x20'+_0x2fe336['join']('\x20')),new Promise((_0x2a7143,_0xa303d7)=>{const _0x243681=_0x315fb2,_0x58b6e1=crossSpawn(_0x243681(0x86),_0x2fe336,{'stdio':_0x243681(0xfb)});let _0x560504='',_0x31206f='';_0x58b6e1[_0x243681(0x10e)]?.['on'](_0x243681(0x9b),_0x4140f2=>{const _0x458937=_0x243681;_0x560504+=_0x4140f2[_0x458937(0x6d)]();}),_0x58b6e1[_0x243681(0x7d)]?.['on'](_0x243681(0x9b),_0x536e38=>{const _0x4d77b5=_0x243681;_0x31206f+=_0x536e38[_0x4d77b5(0x6d)]();}),_0x58b6e1['on'](_0x243681(0xf9),_0x4e61f3=>{const _0x360fd2=_0x243681;_0x4e61f3[_0x360fd2(0x92)]==='ENOENT'?(_0x425a97?.[_0x360fd2(0xf9)](_0x360fd2(0xb9)),_0xa303d7(new SDKError(ErrorCode[_0x360fd2(0xa1)],'Claude\x20Code\x20CLI\x20not\x20found',_0x4e61f3,{'helpText':_0x360fd2(0x106)}))):(_0x425a97?.[_0x360fd2(0xf9)]('Command\x20spawn\x20error:\x20'+_0x4e61f3[_0x360fd2(0xe8)]),_0xa303d7(new SDKError(ErrorCode[_0x360fd2(0x96)],_0x360fd2(0x7a)+_0x4e61f3[_0x360fd2(0xe8)],_0x4e61f3)));}),_0x58b6e1['on'](_0x243681(0xa4),_0x1400a6=>{const _0x37d751=_0x243681;if(_0x1400a6===0x0)_0x2a7143(_0x560504);else _0x29e56d?(_0x425a97?.['error'](_0x37d751(0xfe)+_0x1400a6+_0x37d751(0xc3)+_0x2fe336[_0x37d751(0xe9)]('\x20')),_0xa303d7(new SDKError(ErrorCode[_0x37d751(0x105)],_0x29e56d,new Error(_0x31206f)))):_0x2a7143('');});});}async function ensureMcpServer(_0x3f3db3,_0x3dbc72,_0x8ac7c4,_0x428676,_0x581d7b){const _0x590018=a9_0x536812;_0x428676[_0x590018(0xd9)]=_0x590018(0xc7)+_0x3f3db3+_0x590018(0xbb),await executeClaudeCommand([_0x590018(0xeb),_0x590018(0xd6),_0x3f3db3,_0x3dbc72,'--transport',_0x8ac7c4],_0x590018(0xbe)+_0x3f3db3+'\x27',_0x581d7b),_0x428676[_0x590018(0xd9)]='✓\x20MCP\x20server\x20\x27'+_0x3f3db3+_0x590018(0xb1);}async function ensureMarketplace(_0x4728bc,_0x2022fa,_0x3d0231,_0x3058a7){const _0x51843d=a9_0x536812;_0x3d0231[_0x51843d(0xd9)]=_0x51843d(0x72)+_0x4728bc+_0x51843d(0xbb),await executeClaudeCommand([_0x51843d(0x10c),'marketplace',_0x51843d(0xd6),_0x2022fa],'Failed\x20to\x20configure\x20marketplace\x20\x27'+_0x4728bc+'\x27',_0x3058a7),_0x3d0231['text']=_0x51843d(0x9e)+_0x4728bc+_0x51843d(0xb1);}async function updateMarketplace(_0x26592d,_0x497b4a,_0x2c9fa6){const _0x25ece7=a9_0x536812;_0x497b4a[_0x25ece7(0xd9)]=_0x25ece7(0x8a)+_0x26592d+_0x25ece7(0xbb),await executeClaudeCommand(['plugin',_0x25ece7(0xb6),_0x25ece7(0x77)],_0x25ece7(0x10d)+_0x26592d+'\x27',_0x2c9fa6),_0x497b4a[_0x25ece7(0xd9)]=_0x25ece7(0x9e)+_0x26592d+_0x25ece7(0xc2);}function a9_0x5136(_0x462747,_0x33e605){_0x462747=_0x462747-0x6d;const _0x976048=a9_0x9760();let _0x51361f=_0x976048[_0x462747];return _0x51361f;}async function ensurePlugin(_0x40af17,_0x1427b0,_0x4ea9de,_0x494628){const _0x24bd78=a9_0x536812;_0x4ea9de['text']=_0x24bd78(0xc5)+_0x40af17+_0x24bd78(0xbb),await executeClaudeCommand([_0x24bd78(0x10c),_0x24bd78(0x8d),_0x40af17+'@'+_0x1427b0],_0x24bd78(0xf4)+_0x40af17+'\x27',_0x494628),_0x4ea9de[_0x24bd78(0xd9)]=_0x24bd78(0xa5)+_0x40af17+_0x24bd78(0xbf);}async function createClaudeSettings(_0x33fbcb,_0x376868,_0x20093e){const _0x5b5752=a9_0x536812,_0x51f795=join(process[_0x5b5752(0x9d)](),_0x5b5752(0xcf)),_0x5b1e45=join(_0x51f795,_0x5b5752(0xe7));await mkdir(_0x51f795,{'recursive':!![]});let _0x205baf={};if(existsSync(_0x5b1e45))try{const _0x1da692=await readFile(_0x5b1e45,_0x5b5752(0x85));_0x205baf=JSON[_0x5b5752(0xaf)](_0x1da692);}catch{_0x205baf={};}const _0x415786=_0x205baf['env']||{},_0x3321ac={'ANTHROPIC_BASE_URL':_0x415786['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x415786[_0x5b5752(0xea)],'ANTHROPIC_AUTH_TOKEN':_0x415786[_0x5b5752(0x95)],'CLAUDE_CODE_USE_BEDROCK':_0x415786[_0x5b5752(0xbc)],'CLAUDE_CODE_USE_VERTEX':_0x415786[_0x5b5752(0xd3)],'statusLine':_0x205baf['statusLine']},_0x4e53d3={..._0x205baf,'env':{..._0x415786,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x33fbcb,..._0x376868&&{'ANTHROPIC_MODEL':_0x376868},'ANTHROPIC_AUTH_TOKEN':_0x5b5752(0x7e),'CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0x5b5752(0xe2)},'statusLine':{'type':_0x5b5752(0x88),'command':_0x20093e?_0x5b5752(0x7f)+_0x20093e+_0x5b5752(0xf3):_0x5b5752(0xdf)}};return await writeFile(_0x5b1e45,JSON['stringify'](_0x4e53d3,null,0x2)+'\x0a'),_0x3321ac;}async function restoreClaudeSettings(_0x163616){const _0x488218=a9_0x536812,_0x5bc9b6=join(process[_0x488218(0x9d)](),_0x488218(0xcf)),_0x293500=join(_0x5bc9b6,'settings.local.json');if(!existsSync(_0x293500))return;try{const _0x1eaaf6=await readFile(_0x293500,_0x488218(0x85)),_0x558c30=JSON[_0x488218(0xaf)](_0x1eaaf6),_0x1d1fd2=_0x558c30[_0x488218(0xb3)]||{},_0x3f9360=_0x1d1fd2['ANTHROPIC_BASE_URL'],_0x2c9966=((()=>{const _0x262855=_0x488218;if(typeof _0x3f9360!==_0x262855(0xf2))return![];try{const _0x5a21be=new URL(_0x3f9360);return _0x5a21be[_0x262855(0xfa)]==='localhost'||_0x5a21be[_0x262855(0xfa)]===_0x262855(0xab);}catch{return![];}})());_0x2c9966?(delete _0x1d1fd2[_0x488218(0x89)],delete _0x1d1fd2[_0x488218(0xea)],delete _0x1d1fd2[_0x488218(0x95)],delete _0x1d1fd2[_0x488218(0xbc)],delete _0x1d1fd2[_0x488218(0xd3)]):(_0x163616[_0x488218(0x89)]!==undefined?_0x1d1fd2[_0x488218(0x89)]=_0x163616[_0x488218(0x89)]:delete _0x1d1fd2[_0x488218(0x89)],_0x163616[_0x488218(0xea)]!==undefined?_0x1d1fd2[_0x488218(0xea)]=_0x163616[_0x488218(0xea)]:delete _0x1d1fd2[_0x488218(0xea)],_0x163616['ANTHROPIC_AUTH_TOKEN']!==undefined?_0x1d1fd2[_0x488218(0x95)]=_0x163616[_0x488218(0x95)]:delete _0x1d1fd2[_0x488218(0x95)],_0x163616[_0x488218(0xbc)]!==undefined?_0x1d1fd2[_0x488218(0xbc)]=_0x163616[_0x488218(0xbc)]:delete _0x1d1fd2[_0x488218(0xbc)],_0x163616[_0x488218(0xd3)]!==undefined?_0x1d1fd2[_0x488218(0xd3)]=_0x163616[_0x488218(0xd3)]:delete _0x1d1fd2[_0x488218(0xd3)]);const _0x25682b=_0x558c30[_0x488218(0x84)],_0x2c6de5=((()=>{const _0x22fb30=_0x488218;if(!_0x25682b||typeof _0x25682b!==_0x22fb30(0x8e))return![];if(_0x25682b['type']!==_0x22fb30(0x88))return![];if(typeof _0x25682b['command']!==_0x22fb30(0xf2))return![];return _0x25682b[_0x22fb30(0x88)][_0x22fb30(0x109)](_0x22fb30(0x6e))&&_0x25682b[_0x22fb30(0x88)][_0x22fb30(0x109)](_0x22fb30(0xde));})());if(_0x2c6de5)delete _0x558c30[_0x488218(0x84)];else _0x163616[_0x488218(0x84)]!==undefined?_0x558c30[_0x488218(0x84)]=_0x163616[_0x488218(0x84)]:delete _0x558c30[_0x488218(0x84)];_0x558c30[_0x488218(0xb3)]=_0x1d1fd2,await writeFile(_0x293500,JSON[_0x488218(0xaa)](_0x558c30,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a9_0x536812(0x86);[a9_0x536812(0xe4)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';['server'];['passThroughServer'];[a9_0x536812(0xff)];[a9_0x536812(0xec)];[a9_0x536812(0xca)];async[a9_0x536812(0xb7)](_0x455310){const _0x5f39c2=a9_0x536812,{tdx:_0x526cad,options:_0x175f5a,args:_0x45bc72}=_0x455310;try{const _0x1ba4ae=_0x175f5a,_0x51636c=_0x1ba4ae[_0x5f39c2(0x98)]===![],_0x16a6d8=_0x1ba4ae['continue']===!![],_0x38e4f7=_0x1ba4ae[_0x5f39c2(0xf1)]===!![],_0x1331fe=_0x1ba4ae[_0x5f39c2(0xb2)],_0x43fa05=_0x1331fe!==undefined&&_0x1331fe!==![],_0x331b3c=typeof _0x1331fe===_0x5f39c2(0xf2)?_0x1331fe:undefined,_0x23ae57=_0x43fa05?undefined:_0x1ba4ae[_0x5f39c2(0x71)],_0x1cedcf=[..._0x45bc72];if(_0x16a6d8)_0x1cedcf['unshift']('-c');else _0x38e4f7&&_0x1cedcf[_0x5f39c2(0x8b)]('-r');const _0x3b214c=createCommandSpinner(_0x5f39c2(0xa7),{'verbose':_0x175f5a['verbose']});_0x3b214c[_0x5f39c2(0xc0)]();try{if(!_0x51636c){_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0xc6),this[_0x5f39c2(0xca)]=await findAvailablePort(0xfa0),_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0x73)+this[_0x5f39c2(0xca)];const _0x57518a=_0x175f5a[_0x5f39c2(0xef)];try{const _0x5b58b0=await _0x526cad[_0x5f39c2(0xdd)][_0x5f39c2(0xd2)]();_0x5b58b0['account_id']&&writeCachedAccountInfo(_0x175f5a[_0x5f39c2(0x78)],_0x5b58b0[_0x5f39c2(0x80)],_0x57518a);}catch{}_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0x107),this['logger']=new TDXLogger(_0x175f5a[_0x5f39c2(0xcd)],!![]),await this[_0x5f39c2(0xec)][_0x5f39c2(0x7b)]();const _0x531293=this[_0x5f39c2(0xec)][_0x5f39c2(0x87)]();_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0xae)+_0x531293;if(_0x43fa05){if(_0x331b3c&&!URL['canParse'](_0x331b3c))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20LLM\x20proxy\x20URL:\x20'+_0x331b3c);const _0x5e1b6a=_0x331b3c||getEndpoint(_0x175f5a['site'],'llm-proxy');_0x3b214c[_0x5f39c2(0xd9)]='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';if(!_0x526cad['context']['apiKey'])throw new SDKError(ErrorCode[_0x5f39c2(0x9c)],_0x5f39c2(0x104));this[_0x5f39c2(0xee)]=new PassThroughProxyServer({'port':this[_0x5f39c2(0xca)],'llmProxyUrl':_0x5e1b6a,'apiKey':_0x526cad[_0x5f39c2(0x7c)][_0x5f39c2(0x93)],'logger':this[_0x5f39c2(0xec)],'site':_0x175f5a['site'],'profile':_0x57518a}),await this[_0x5f39c2(0xee)][_0x5f39c2(0xc0)](),_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0xc4)+this[_0x5f39c2(0xca)]+_0x5f39c2(0x75)+_0x5e1b6a;}else{_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0xda);const _0x352c2f=await _0x526cad[_0x5f39c2(0xf6)][_0x5f39c2(0xa9)](),_0x2c1969=_0x352c2f['id'];_0x3b214c['text']=_0x5f39c2(0xcb)+_0x352c2f['attributes']['name'],_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0xce),this['server']=new ProxyServer({'port':this['port'],'projectId':_0x2c1969,'tdx':_0x526cad,'logger':this[_0x5f39c2(0xec)],'site':_0x175f5a[_0x5f39c2(0x78)]}),await this[_0x5f39c2(0xa8)][_0x5f39c2(0xc0)](),_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0x81)+this[_0x5f39c2(0xca)];}_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0xa6),this[_0x5f39c2(0xff)]=await createClaudeSettings(this['port'],_0x23ae57,_0x57518a),_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0xa2);}else _0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0xed);try{_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0x70),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x5f39c2(0xec)]),_0x3b214c[_0x5f39c2(0xd9)]=_0x5f39c2(0xd7);}catch(_0x3bca83){_0x3b214c[_0x5f39c2(0x6f)](_0x5f39c2(0x91));throw _0x3bca83;}try{await ensureMcpServer('td-docs',_0x5f39c2(0x76),_0x5f39c2(0xf7),_0x3b214c,this[_0x5f39c2(0xec)]);}catch(_0x515936){handleInstallationError(_0x515936,_0x5f39c2(0x99),_0x3b214c,this[_0x5f39c2(0xec)]);}try{await ensureMarketplace(_0x5f39c2(0xb8),_0x5f39c2(0xcc),_0x3b214c,this[_0x5f39c2(0xec)]),await updateMarketplace('td-skills',_0x3b214c,this[_0x5f39c2(0xec)]),await ensurePlugin('sql-skills','td-skills',_0x3b214c,this[_0x5f39c2(0xec)]),await ensurePlugin('workflow-skills',_0x5f39c2(0xb8),_0x3b214c,this[_0x5f39c2(0xec)]),await ensurePlugin(_0x5f39c2(0xf8),'td-skills',_0x3b214c,this[_0x5f39c2(0xec)]);}catch(_0x9c8ac3){handleInstallationError(_0x9c8ac3,_0x5f39c2(0x8f),_0x3b214c,this[_0x5f39c2(0xec)]);}_0x3b214c[_0x5f39c2(0xfc)]();}catch(_0x183146){_0x3b214c[_0x5f39c2(0x6f)](_0x5f39c2(0x10a));throw _0x183146;}const _0x3415e3=await findExecutable(_0x5f39c2(0x86));if(!_0x3415e3)throw new SDKError(ErrorCode[_0x5f39c2(0xa1)],_0x5f39c2(0xb9),undefined,{'helpText':_0x5f39c2(0x106)});const _0x3a0df1={...process['env']};!_0x51636c&&(_0x3a0df1[_0x5f39c2(0x89)]=_0x5f39c2(0xb4)+this[_0x5f39c2(0xca)],_0x23ae57&&(_0x3a0df1[_0x5f39c2(0xea)]=_0x23ae57),_0x3a0df1['ANTHROPIC_AUTH_TOKEN']=_0x5f39c2(0x7e),_0x3a0df1[_0x5f39c2(0xbc)]=_0x5f39c2(0xe2),_0x3a0df1[_0x5f39c2(0xd3)]=_0x5f39c2(0xe2));const _0x505095=crossSpawn(_0x3415e3,_0x1cedcf,{'stdio':_0x5f39c2(0xe5),'env':_0x3a0df1}),_0x120840=await new Promise(_0x443cf0=>{const _0x1e9ad5=_0x5f39c2;_0x505095['on']('exit',_0x4956fb=>{_0x443cf0(_0x4956fb||0x0);}),_0x505095['on'](_0x1e9ad5(0xf9),_0xcb1cd6=>{const _0x14d7b7=_0x1e9ad5;console[_0x14d7b7(0xf9)](a9_0x5a3bd1[_0x14d7b7(0xf5)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0xcb1cd6[_0x14d7b7(0xe8)])),_0x443cf0(0x1);});});this[_0x5f39c2(0xa8)]&&(await this[_0x5f39c2(0xa8)]['stop'](),console[_0x5f39c2(0x74)](a9_0x5a3bd1[_0x5f39c2(0xbd)](_0x5f39c2(0xd4))));this['passThroughServer']&&(await this[_0x5f39c2(0xee)][_0x5f39c2(0xfc)](),console[_0x5f39c2(0x74)](a9_0x5a3bd1['green'](_0x5f39c2(0xd0))));if(this['logger']){await this[_0x5f39c2(0xec)]['close']();const _0x1b301d=this[_0x5f39c2(0xec)][_0x5f39c2(0x87)]();console[_0x5f39c2(0x74)](a9_0x5a3bd1[_0x5f39c2(0xbd)](_0x5f39c2(0xe3)+_0x1b301d));}return this[_0x5f39c2(0xff)]&&(await restoreClaudeSettings(this[_0x5f39c2(0xff)]),console['log'](a9_0x5a3bd1[_0x5f39c2(0xbd)](_0x5f39c2(0x9f)))),_0x120840;}catch(_0x44af13){this[_0x5f39c2(0xa8)]&&await this[_0x5f39c2(0xa8)][_0x5f39c2(0xfc)]();this[_0x5f39c2(0xee)]&&await this['passThroughServer'][_0x5f39c2(0xfc)]();this['logger']&&await this['logger'][_0x5f39c2(0xe1)]();this[_0x5f39c2(0xff)]&&await restoreClaudeSettings(this[_0x5f39c2(0xff)]);throw _0x44af13;}}}
1
+ const a9_0x47737c=a9_0x6147;(function(_0x59b453,_0x5c62bf){const _0x16d5f2=a9_0x6147,_0x405507=_0x59b453();while(!![]){try{const _0x29d16a=parseInt(_0x16d5f2(0x138))/0x1+parseInt(_0x16d5f2(0x1cc))/0x2*(-parseInt(_0x16d5f2(0x198))/0x3)+parseInt(_0x16d5f2(0x1bd))/0x4*(-parseInt(_0x16d5f2(0x150))/0x5)+-parseInt(_0x16d5f2(0x1be))/0x6+-parseInt(_0x16d5f2(0x183))/0x7*(-parseInt(_0x16d5f2(0x15b))/0x8)+parseInt(_0x16d5f2(0x189))/0x9+-parseInt(_0x16d5f2(0x13a))/0xa*(parseInt(_0x16d5f2(0x176))/0xb);if(_0x29d16a===_0x5c62bf)break;else _0x405507['push'](_0x405507['shift']());}catch(_0x416d93){_0x405507['push'](_0x405507['shift']());}}}(a9_0x44a7,0x8d796));import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a9_0x131591 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findAvailablePort}from'../utils/port.js';import{findExecutable,crossSpawn}from'../utils/process.js';function a9_0x6147(_0x1c4b96,_0x447675){_0x1c4b96=_0x1c4b96-0x136;const _0x44a7e8=a9_0x44a7();let _0x614715=_0x44a7e8[_0x1c4b96];return _0x614715;}import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';function a9_0x44a7(){const _0x5e69fe=['object','server','Failed\x20to\x20configure\x20marketplace\x20\x27','pipe','resume','2856952RdasFf','Initializing\x20proxy\x20logger...','CLAUDE_CODE_USE_VERTEX','https://github.com/treasure-data/td-skills','Claude\x20Code\x20CLI\x20not\x20found','parse','workflow-skills','✓\x20Logging\x20to\x20','tdx\x20claude\x20statusline','2.0.20','INVALID_ARGUMENT','update','ANTHROPIC_AUTH_TOKEN','site','error','Setup\x20failed','debug','Initializing...','ANTHROPIC_BASE_URL','\x27\x20installed','statusline','port','CLAUDE_CODE_USE_BEDROCK','canParse','warn','apiKey','✓\x20Settings\x20configured:\x20.claude/settings.local.json','77RzZbmR','false','Configuring\x20marketplace\x20\x27','Setting\x20up\x20project...','✓\x20MCP\x20server\x20\x27','profile','passThroughServer','✓\x20Logs\x20saved\x20to\x20','.claude','minor','logLevel','\x20configuration\x20failed','env','7pfmoIv','originalSettings','user','CLAUDE_CODE_UNSUPPORTED_VERSION','start','command','7964244ZAlgun','ENOENT','stringify','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','Failed\x20to\x20launch\x20Claude\x20Code:\x20','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','attributes','\x27\x20configured','match','context','mcp','cwd','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','td-skills','663FcggXs','log','Checking\x20Claude\x20Code\x20version...','\x20is\x20too\x20old\x20(minimum:\x20','tdx-skills','\x20→\x20','--transport','continue','proxy','red','✓\x20Settings\x20restored:\x20.claude/settings.local.json','type','tdx','inherit','init','info','account_id','already\x20configured','TD\x20Docs\x20MCP\x20Server','http://127.0.0.1:','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','INSTALLATION_FAILED','Invalid\x20LLM\x20proxy\x20URL:\x20','hostname','patch','Configuring\x20MCP\x20server\x20\x27','getOrCreateDefaultProject','llm','Creating\x20.claude/settings.local.json...','message','plugin','claude','getLogPath','✓\x20Marketplace\x20\x27','green','\x20claude\x20statusline','verbose','41588PpmoOV','2898498suPXhX','Claude\x20Code\x20version\x20','CLAUDE_CODE_NOT_FOUND','Invalid\x20minimum\x20version\x20format:\x20','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','code','description','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','add','includes','close','tdx-managed-proxy','\x27\x20updated','Command\x20spawn\x20error:\x20','1354wQQuEu','marketplace','stop','execute','llm-proxy','ANTHROPIC_MODEL','\x20already\x20configured','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','Warning:\x20Failed\x20to\x20configure\x20','755624lPwKnz','string','156680IMqntQ','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','utf-8','http','\x27...','name','logger','settings.local.json','stderr','toString','\x20meets\x20minimum\x20requirement','tdx\x20--profile\x20','td-skills\x20Plugins','already\x20installed','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','fail','exit','data','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','\x20or\x20later.','✓\x20Claude\x20Code\x20version\x20OK','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','325fhwLJs','text','statusLine','cause','major','unshift'];a9_0x44a7=function(){return _0x5e69fe;};return a9_0x44a7();}import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';const MIN_CLAUDE_VERSION=a9_0x47737c(0x164);function handleInstallationError(_0x5c711f,_0x27b7a3,_0x30e20e,_0x29601d){const _0x53f916=a9_0x47737c;errorContains(_0x5c711f,'already\x20exists',_0x53f916(0x147),_0x53f916(0x1a9))?(_0x30e20e['text']='✓\x20'+_0x27b7a3+_0x53f916(0x1d2),_0x29601d?.['info'](_0x27b7a3+_0x53f916(0x1d2)),_0x5c711f instanceof SDKError&&_0x5c711f['cause']&&_0x29601d?.['debug']('Command\x20output:\x20'+_0x5c711f[_0x53f916(0x153)]['message'])):(_0x30e20e[_0x53f916(0x173)](_0x53f916(0x137)+_0x27b7a3),_0x29601d?.[_0x53f916(0x169)](_0x27b7a3+_0x53f916(0x181),_0x5c711f));}export function parseVersion(_0x52486e){const _0x4fe542=a9_0x47737c,_0x14c90a=_0x52486e['trim']()[_0x4fe542(0x191)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x14c90a)return null;return{'major':parseInt(_0x14c90a[0x1],0xa),'minor':parseInt(_0x14c90a[0x2],0xa),'patch':parseInt(_0x14c90a[0x3],0xa)};}export function compareVersions(_0x5e5682,_0x349fa3){const _0x50ed36=a9_0x47737c;if(_0x5e5682[_0x50ed36(0x154)]!==_0x349fa3[_0x50ed36(0x154)])return _0x5e5682[_0x50ed36(0x154)]-_0x349fa3[_0x50ed36(0x154)];if(_0x5e5682['minor']!==_0x349fa3[_0x50ed36(0x17f)])return _0x5e5682['minor']-_0x349fa3[_0x50ed36(0x17f)];return _0x5e5682[_0x50ed36(0x1b0)]-_0x349fa3[_0x50ed36(0x1b0)];}async function checkClaudeVersion(_0x183ef6,_0x52ce4e){const _0x1599a6=a9_0x47737c;_0x52ce4e?.[_0x1599a6(0x16b)](_0x1599a6(0x1c5)+_0x183ef6+')');const _0x5b45fd=await executeClaudeCommand(['--version'],undefined,_0x52ce4e),_0xbf14e6=parseVersion(_0x5b45fd);if(!_0xbf14e6){_0x52ce4e?.[_0x1599a6(0x173)](_0x1599a6(0x195)+_0x5b45fd);return;}const _0x56ab9b=_0xbf14e6[_0x1599a6(0x154)]+'.'+_0xbf14e6['minor']+'.'+_0xbf14e6[_0x1599a6(0x1b0)],_0x5a2664=parseVersion(_0x183ef6);if(!_0x5a2664){_0x52ce4e?.[_0x1599a6(0x173)](_0x1599a6(0x1c1)+_0x183ef6);return;}if(compareVersions(_0xbf14e6,_0x5a2664)<0x0){_0x52ce4e?.[_0x1599a6(0x169)](_0x1599a6(0x1bf)+_0x56ab9b+_0x1599a6(0x19b)+_0x183ef6+')');throw new SDKError(ErrorCode[_0x1599a6(0x186)],_0x1599a6(0x1bf)+_0x56ab9b+_0x1599a6(0x13b)+_0x183ef6+_0x1599a6(0x14d),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x52ce4e?.[_0x1599a6(0x16b)](_0x1599a6(0x1bf)+_0x56ab9b+_0x1599a6(0x144));}async function executeClaudeCommand(_0x32fa00,_0x9fc22d,_0x1a4fa7){const _0x395f0e=a9_0x47737c;return _0x1a4fa7?.[_0x395f0e(0x1a7)]('Executing:\x20claude\x20'+_0x32fa00['join']('\x20')),new Promise((_0x25eb87,_0x253f19)=>{const _0x2f4e5e=_0x395f0e,_0x58f4cc=crossSpawn('claude',_0x32fa00,{'stdio':_0x2f4e5e(0x159)});let _0xc0f814='',_0x59b365='';_0x58f4cc['stdout']?.['on'](_0x2f4e5e(0x14b),_0x56c889=>{const _0x242bb5=_0x2f4e5e;_0xc0f814+=_0x56c889[_0x242bb5(0x143)]();}),_0x58f4cc[_0x2f4e5e(0x142)]?.['on'](_0x2f4e5e(0x14b),_0x34534e=>{const _0xdd6b19=_0x2f4e5e;_0x59b365+=_0x34534e[_0xdd6b19(0x143)]();}),_0x58f4cc['on'](_0x2f4e5e(0x169),_0x2ff8c6=>{const _0x45bd0d=_0x2f4e5e;_0x2ff8c6[_0x45bd0d(0x1c3)]===_0x45bd0d(0x18a)?(_0x1a4fa7?.['error'](_0x45bd0d(0x15f)),_0x253f19(new SDKError(ErrorCode[_0x45bd0d(0x1c0)],_0x45bd0d(0x15f),_0x2ff8c6,{'helpText':_0x45bd0d(0x14c)}))):(_0x1a4fa7?.[_0x45bd0d(0x169)](_0x45bd0d(0x1cb)+_0x2ff8c6[_0x45bd0d(0x1b5)]),_0x253f19(new SDKError(ErrorCode['INTERNAL'],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x2ff8c6[_0x45bd0d(0x1b5)],_0x2ff8c6)));}),_0x58f4cc['on'](_0x2f4e5e(0x14a),_0x4d88e2=>{const _0xcabd9e=_0x2f4e5e;if(_0x4d88e2===0x0)_0x25eb87(_0xc0f814);else _0x9fc22d?(_0x1a4fa7?.[_0xcabd9e(0x169)]('Command\x20failed\x20(exit\x20'+_0x4d88e2+'):\x20claude\x20'+_0x32fa00['join']('\x20')),_0x253f19(new SDKError(ErrorCode[_0xcabd9e(0x1ad)],_0x9fc22d,new Error(_0x59b365)))):_0x25eb87('');});});}async function ensureMcpServer(_0x84d5be,_0x5bf252,_0x2f0512,_0x539e3b,_0x26b774){const _0x432427=a9_0x47737c;_0x539e3b[_0x432427(0x151)]=_0x432427(0x1b1)+_0x84d5be+_0x432427(0x13e),await executeClaudeCommand([_0x432427(0x193),_0x432427(0x1c6),_0x84d5be,_0x5bf252,_0x432427(0x19e),_0x2f0512],_0x432427(0x18c)+_0x84d5be+'\x27',_0x26b774),_0x539e3b[_0x432427(0x151)]=_0x432427(0x17a)+_0x84d5be+_0x432427(0x190);}async function ensureMarketplace(_0x31ffe7,_0x14aa42,_0x22e5d8,_0x25aa96){const _0x4fa134=a9_0x47737c;_0x22e5d8[_0x4fa134(0x151)]=_0x4fa134(0x178)+_0x31ffe7+_0x4fa134(0x13e),await executeClaudeCommand([_0x4fa134(0x1b6),'marketplace',_0x4fa134(0x1c6),_0x14aa42],_0x4fa134(0x158)+_0x31ffe7+'\x27',_0x25aa96),_0x22e5d8[_0x4fa134(0x151)]=_0x4fa134(0x1b9)+_0x31ffe7+'\x27\x20configured';}async function updateMarketplace(_0x43d369,_0x59e9f7,_0x9c0fbc){const _0x41935f=a9_0x47737c;_0x59e9f7[_0x41935f(0x151)]='Updating\x20marketplace\x20\x27'+_0x43d369+_0x41935f(0x13e),await executeClaudeCommand([_0x41935f(0x1b6),_0x41935f(0x1cd),_0x41935f(0x166)],'Failed\x20to\x20update\x20marketplace\x20\x27'+_0x43d369+'\x27',_0x9c0fbc),_0x59e9f7[_0x41935f(0x151)]='✓\x20Marketplace\x20\x27'+_0x43d369+_0x41935f(0x1ca);}async function ensurePlugin(_0x652ad6,_0x16e200,_0x598cac,_0x535cb4){const _0x22ed59=a9_0x47737c;_0x598cac[_0x22ed59(0x151)]='Installing\x20plugin\x20\x27'+_0x652ad6+_0x22ed59(0x13e),await executeClaudeCommand([_0x22ed59(0x1b6),'install',_0x652ad6+'@'+_0x16e200],'Failed\x20to\x20install\x20plugin\x20\x27'+_0x652ad6+'\x27',_0x535cb4),_0x598cac[_0x22ed59(0x151)]='✓\x20Plugin\x20\x27'+_0x652ad6+_0x22ed59(0x16e);}async function createClaudeSettings(_0x16895e,_0x195069,_0x23c07d){const _0xdf9a1=a9_0x47737c,_0x10cc9c=join(process[_0xdf9a1(0x194)](),_0xdf9a1(0x17e)),_0x275fd5=join(_0x10cc9c,_0xdf9a1(0x141));await mkdir(_0x10cc9c,{'recursive':!![]});let _0xae4c56={};if(existsSync(_0x275fd5))try{const _0x568f38=await readFile(_0x275fd5,_0xdf9a1(0x13c));_0xae4c56=JSON[_0xdf9a1(0x160)](_0x568f38);}catch{_0xae4c56={};}const _0x1ca225=_0xae4c56[_0xdf9a1(0x182)]||{},_0x8c01e={'ANTHROPIC_BASE_URL':_0x1ca225['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x1ca225[_0xdf9a1(0x1d1)],'ANTHROPIC_AUTH_TOKEN':_0x1ca225[_0xdf9a1(0x167)],'CLAUDE_CODE_USE_BEDROCK':_0x1ca225[_0xdf9a1(0x171)],'CLAUDE_CODE_USE_VERTEX':_0x1ca225[_0xdf9a1(0x15d)],'statusLine':_0xae4c56[_0xdf9a1(0x152)]},_0x3a7761={..._0xae4c56,'env':{..._0x1ca225,'ANTHROPIC_BASE_URL':_0xdf9a1(0x1ab)+_0x16895e,..._0x195069&&{'ANTHROPIC_MODEL':_0x195069},'ANTHROPIC_AUTH_TOKEN':'tdx-managed-proxy','CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0xdf9a1(0x177)},'statusLine':{'type':'command','command':_0x23c07d?_0xdf9a1(0x145)+_0x23c07d+_0xdf9a1(0x1bb):_0xdf9a1(0x163)}};return await writeFile(_0x275fd5,JSON[_0xdf9a1(0x18b)](_0x3a7761,null,0x2)+'\x0a'),_0x8c01e;}async function restoreClaudeSettings(_0x713192){const _0x1dd6e0=a9_0x47737c,_0x2a9706=join(process[_0x1dd6e0(0x194)](),_0x1dd6e0(0x17e)),_0x1ce1e8=join(_0x2a9706,_0x1dd6e0(0x141));if(!existsSync(_0x1ce1e8))return;try{const _0x380c65=await readFile(_0x1ce1e8,_0x1dd6e0(0x13c)),_0x28b628=JSON[_0x1dd6e0(0x160)](_0x380c65),_0x381a04=_0x28b628[_0x1dd6e0(0x182)]||{},_0x13a089=_0x381a04[_0x1dd6e0(0x16d)],_0x615b56=((()=>{const _0x2eab8a=_0x1dd6e0;if(typeof _0x13a089!==_0x2eab8a(0x139))return![];try{const _0x15d0e9=new URL(_0x13a089);return _0x15d0e9[_0x2eab8a(0x1af)]==='localhost'||_0x15d0e9['hostname']==='127.0.0.1';}catch{return![];}})());_0x615b56?(delete _0x381a04[_0x1dd6e0(0x16d)],delete _0x381a04[_0x1dd6e0(0x1d1)],delete _0x381a04[_0x1dd6e0(0x167)],delete _0x381a04['CLAUDE_CODE_USE_BEDROCK'],delete _0x381a04[_0x1dd6e0(0x15d)]):(_0x713192['ANTHROPIC_BASE_URL']!==undefined?_0x381a04[_0x1dd6e0(0x16d)]=_0x713192['ANTHROPIC_BASE_URL']:delete _0x381a04[_0x1dd6e0(0x16d)],_0x713192[_0x1dd6e0(0x1d1)]!==undefined?_0x381a04[_0x1dd6e0(0x1d1)]=_0x713192['ANTHROPIC_MODEL']:delete _0x381a04[_0x1dd6e0(0x1d1)],_0x713192['ANTHROPIC_AUTH_TOKEN']!==undefined?_0x381a04[_0x1dd6e0(0x167)]=_0x713192[_0x1dd6e0(0x167)]:delete _0x381a04[_0x1dd6e0(0x167)],_0x713192[_0x1dd6e0(0x171)]!==undefined?_0x381a04['CLAUDE_CODE_USE_BEDROCK']=_0x713192[_0x1dd6e0(0x171)]:delete _0x381a04[_0x1dd6e0(0x171)],_0x713192['CLAUDE_CODE_USE_VERTEX']!==undefined?_0x381a04[_0x1dd6e0(0x15d)]=_0x713192[_0x1dd6e0(0x15d)]:delete _0x381a04['CLAUDE_CODE_USE_VERTEX']);const _0x45f5d1=_0x28b628[_0x1dd6e0(0x152)],_0x508962=((()=>{const _0x1f22cc=_0x1dd6e0;if(!_0x45f5d1||typeof _0x45f5d1!==_0x1f22cc(0x156))return![];if(_0x45f5d1[_0x1f22cc(0x1a3)]!==_0x1f22cc(0x188))return![];if(typeof _0x45f5d1[_0x1f22cc(0x188)]!==_0x1f22cc(0x139))return![];return _0x45f5d1[_0x1f22cc(0x188)][_0x1f22cc(0x1c7)](_0x1f22cc(0x1a4))&&_0x45f5d1['command'][_0x1f22cc(0x1c7)](_0x1f22cc(0x16f));})());if(_0x508962)delete _0x28b628[_0x1dd6e0(0x152)];else _0x713192[_0x1dd6e0(0x152)]!==undefined?_0x28b628['statusLine']=_0x713192[_0x1dd6e0(0x152)]:delete _0x28b628['statusLine'];_0x28b628[_0x1dd6e0(0x182)]=_0x381a04,await writeFile(_0x1ce1e8,JSON['stringify'](_0x28b628,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a9_0x47737c(0x1b7);[a9_0x47737c(0x1c4)]=a9_0x47737c(0x136);[a9_0x47737c(0x157)];[a9_0x47737c(0x17c)];[a9_0x47737c(0x184)];[a9_0x47737c(0x140)];[a9_0x47737c(0x170)];async[a9_0x47737c(0x1cf)](_0x1dc858){const _0x2b2b67=a9_0x47737c,{tdx:_0x1a37a0,options:_0x360acc,args:_0x226f02}=_0x1dc858;try{const _0xa51b8=_0x360acc,_0x49bb2e=_0xa51b8[_0x2b2b67(0x1a0)]===![],_0x2a4bf8=_0xa51b8[_0x2b2b67(0x19f)]===!![],_0x8514d6=_0xa51b8[_0x2b2b67(0x15a)]===!![],_0x4168d9=_0xa51b8['llmProxy'],_0x401f60=_0x4168d9!==undefined&&_0x4168d9!==![],_0x2574be=typeof _0x4168d9===_0x2b2b67(0x139)?_0x4168d9:undefined,_0x51198e=_0x401f60?undefined:_0xa51b8['model'],_0x321d4b=[..._0x226f02];if(_0x2a4bf8)_0x321d4b[_0x2b2b67(0x155)]('-c');else _0x8514d6&&_0x321d4b[_0x2b2b67(0x155)]('-r');const _0x13ff02=createCommandSpinner(_0x2b2b67(0x16c),{'verbose':_0x360acc[_0x2b2b67(0x1bc)]});_0x13ff02[_0x2b2b67(0x187)]();try{if(!_0x49bb2e){_0x13ff02[_0x2b2b67(0x151)]='Finding\x20available\x20port...',this[_0x2b2b67(0x170)]=await findAvailablePort(0xfa0),_0x13ff02['text']='✓\x20Found\x20available\x20port:\x20'+this['port'];const _0x31caa2=_0x360acc[_0x2b2b67(0x17b)];try{const _0x405cad=await _0x1a37a0[_0x2b2b67(0x185)]['getCurrent']();_0x405cad[_0x2b2b67(0x1a8)]&&writeCachedAccountInfo(_0x360acc['site'],_0x405cad[_0x2b2b67(0x1a8)],_0x31caa2);}catch{}_0x13ff02[_0x2b2b67(0x151)]=_0x2b2b67(0x15c),this[_0x2b2b67(0x140)]=new TDXLogger(_0x360acc[_0x2b2b67(0x180)],!![]),await this['logger'][_0x2b2b67(0x1a6)]();const _0x9ec86d=this[_0x2b2b67(0x140)][_0x2b2b67(0x1b8)]();_0x13ff02[_0x2b2b67(0x151)]=_0x2b2b67(0x162)+_0x9ec86d;if(_0x401f60){if(_0x2574be&&!URL[_0x2b2b67(0x172)](_0x2574be))throw new SDKError(ErrorCode[_0x2b2b67(0x165)],_0x2b2b67(0x1ae)+_0x2574be);const _0x388762=_0x2574be||getEndpoint(_0x360acc[_0x2b2b67(0x168)],_0x2b2b67(0x1d0));_0x13ff02[_0x2b2b67(0x151)]=_0x2b2b67(0x18e);if(!_0x1a37a0['context'][_0x2b2b67(0x174)])throw new SDKError(ErrorCode[_0x2b2b67(0x165)],_0x2b2b67(0x1ac));this[_0x2b2b67(0x17c)]=new PassThroughProxyServer({'port':this[_0x2b2b67(0x170)],'llmProxyUrl':_0x388762,'apiKey':_0x1a37a0[_0x2b2b67(0x192)][_0x2b2b67(0x174)],'logger':this['logger'],'site':_0x360acc[_0x2b2b67(0x168)],'profile':_0x31caa2}),await this[_0x2b2b67(0x17c)]['start'](),_0x13ff02[_0x2b2b67(0x151)]='✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20'+this[_0x2b2b67(0x170)]+_0x2b2b67(0x19d)+_0x388762;}else{_0x13ff02[_0x2b2b67(0x151)]=_0x2b2b67(0x179);const _0x33ace8=await _0x1a37a0[_0x2b2b67(0x1b3)][_0x2b2b67(0x1b2)](),_0x593d79=_0x33ace8['id'];_0x13ff02[_0x2b2b67(0x151)]='✓\x20Using\x20project:\x20'+_0x33ace8[_0x2b2b67(0x18f)][_0x2b2b67(0x13f)],_0x13ff02[_0x2b2b67(0x151)]='Starting\x20TD\x20LLM\x20proxy\x20server...',this[_0x2b2b67(0x157)]=new ProxyServer({'port':this[_0x2b2b67(0x170)],'projectId':_0x593d79,'tdx':_0x1a37a0,'logger':this[_0x2b2b67(0x140)],'site':_0x360acc[_0x2b2b67(0x168)]}),await this[_0x2b2b67(0x157)][_0x2b2b67(0x187)](),_0x13ff02[_0x2b2b67(0x151)]=_0x2b2b67(0x196)+this[_0x2b2b67(0x170)];}_0x13ff02[_0x2b2b67(0x151)]=_0x2b2b67(0x1b4),this['originalSettings']=await createClaudeSettings(this['port'],_0x51198e,_0x31caa2),_0x13ff02[_0x2b2b67(0x151)]=_0x2b2b67(0x175);}else _0x13ff02[_0x2b2b67(0x151)]=_0x2b2b67(0x1c2);try{_0x13ff02['text']=_0x2b2b67(0x19a),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x2b2b67(0x140)]),_0x13ff02[_0x2b2b67(0x151)]=_0x2b2b67(0x14e);}catch(_0x19875e){_0x13ff02[_0x2b2b67(0x149)]('Claude\x20Code\x20version\x20check\x20failed');throw _0x19875e;}try{await ensureMcpServer('td-docs','https://docs.treasuredata.com/mcp',_0x2b2b67(0x13d),_0x13ff02,this[_0x2b2b67(0x140)]);}catch(_0x402455){handleInstallationError(_0x402455,_0x2b2b67(0x1aa),_0x13ff02,this['logger']);}try{await ensureMarketplace(_0x2b2b67(0x197),_0x2b2b67(0x15e),_0x13ff02,this[_0x2b2b67(0x140)]),await updateMarketplace('td-skills',_0x13ff02,this[_0x2b2b67(0x140)]),await ensurePlugin('sql-skills',_0x2b2b67(0x197),_0x13ff02,this[_0x2b2b67(0x140)]),await ensurePlugin(_0x2b2b67(0x161),'td-skills',_0x13ff02,this[_0x2b2b67(0x140)]),await ensurePlugin(_0x2b2b67(0x19c),_0x2b2b67(0x197),_0x13ff02,this[_0x2b2b67(0x140)]);}catch(_0x16c0a0){handleInstallationError(_0x16c0a0,_0x2b2b67(0x146),_0x13ff02,this['logger']);}_0x13ff02[_0x2b2b67(0x1ce)]();}catch(_0x54e879){_0x13ff02[_0x2b2b67(0x149)](_0x2b2b67(0x16a));throw _0x54e879;}const _0x24eafa=await findExecutable(_0x2b2b67(0x1b7));if(!_0x24eafa)throw new SDKError(ErrorCode[_0x2b2b67(0x1c0)],_0x2b2b67(0x15f),undefined,{'helpText':_0x2b2b67(0x14c)});const _0x133380={...process[_0x2b2b67(0x182)]};!_0x49bb2e&&(_0x133380[_0x2b2b67(0x16d)]='http://127.0.0.1:'+this[_0x2b2b67(0x170)],_0x51198e&&(_0x133380[_0x2b2b67(0x1d1)]=_0x51198e),_0x133380[_0x2b2b67(0x167)]=_0x2b2b67(0x1c9),_0x133380['CLAUDE_CODE_USE_BEDROCK']=_0x2b2b67(0x177),_0x133380[_0x2b2b67(0x15d)]=_0x2b2b67(0x177));const _0x13d61e=crossSpawn(_0x24eafa,_0x321d4b,{'stdio':_0x2b2b67(0x1a5),'env':_0x133380}),_0x193f02=await new Promise(_0x554bce=>{const _0x206b8d=_0x2b2b67;_0x13d61e['on'](_0x206b8d(0x14a),_0x2bc3af=>{_0x554bce(_0x2bc3af||0x0);}),_0x13d61e['on'](_0x206b8d(0x169),_0x5e7977=>{const _0x4be15e=_0x206b8d;console[_0x4be15e(0x169)](a9_0x131591[_0x4be15e(0x1a1)](_0x4be15e(0x18d)+_0x5e7977['message'])),_0x554bce(0x1);});});this[_0x2b2b67(0x157)]&&(await this[_0x2b2b67(0x157)][_0x2b2b67(0x1ce)](),console['log'](a9_0x131591[_0x2b2b67(0x1ba)](_0x2b2b67(0x14f))));this[_0x2b2b67(0x17c)]&&(await this['passThroughServer'][_0x2b2b67(0x1ce)](),console[_0x2b2b67(0x199)](a9_0x131591['green'](_0x2b2b67(0x148))));if(this[_0x2b2b67(0x140)]){await this['logger'][_0x2b2b67(0x1c8)]();const _0x3854a4=this[_0x2b2b67(0x140)][_0x2b2b67(0x1b8)]();console[_0x2b2b67(0x199)](a9_0x131591['green'](_0x2b2b67(0x17d)+_0x3854a4));}return this[_0x2b2b67(0x184)]&&(await restoreClaudeSettings(this['originalSettings']),console[_0x2b2b67(0x199)](a9_0x131591[_0x2b2b67(0x1ba)](_0x2b2b67(0x1a2)))),_0x193f02;}catch(_0x22a3ed){this[_0x2b2b67(0x157)]&&await this['server'][_0x2b2b67(0x1ce)]();this[_0x2b2b67(0x17c)]&&await this['passThroughServer']['stop']();this['logger']&&await this[_0x2b2b67(0x140)][_0x2b2b67(0x1c8)]();this[_0x2b2b67(0x184)]&&await restoreClaudeSettings(this[_0x2b2b67(0x184)]);throw _0x22a3ed;}}}
@@ -1 +1 @@
1
- const a10_0x28cf25=a10_0x4953;(function(_0x3eeead,_0x1040cd){const _0x596a74=a10_0x4953,_0xb80080=_0x3eeead();while(!![]){try{const _0x59d896=parseInt(_0x596a74(0x1a6))/0x1+parseInt(_0x596a74(0x195))/0x2*(parseInt(_0x596a74(0x1ab))/0x3)+-parseInt(_0x596a74(0x1a1))/0x4+-parseInt(_0x596a74(0x194))/0x5+-parseInt(_0x596a74(0x1b1))/0x6*(parseInt(_0x596a74(0x1ae))/0x7)+parseInt(_0x596a74(0x19c))/0x8*(-parseInt(_0x596a74(0x1b6))/0x9)+parseInt(_0x596a74(0x1a7))/0xa*(parseInt(_0x596a74(0x1a4))/0xb);if(_0x59d896===_0x1040cd)break;else _0xb80080['push'](_0xb80080['shift']());}catch(_0x2ad520){_0xb80080['push'](_0xb80080['shift']());}}}(a10_0xb00c,0x5a452));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a10_0xb00c(){const _0x640de8=['12MAxMEk','name','\x20session\x20/\x20','join','log','549dMANDR','\x20|\x20','🧠\x20','1006725rZBdXe','25834XBcjxJ','line','site','stdin','Claude','profile','push','12392biwHMH','model','latestInputTokens','description','\x20today\x20/\x20','1220556RrCgwn','toFixed','\x20-\x20','2409kOXKfL','close','189682nBdjSP','50180tIIfTX','monthCredits','options','session_id','51hAbOqh','statusline','💎\x20','1881229ZRoSwh','💎\x20tdx\x20-\x20Claude','todayCredits'];a10_0xb00c=function(){return _0x640de8;};return a10_0xb00c();}import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x5c84bc=0x64){return new Promise(_0x2cdbd7=>{const _0x981ce2=a10_0x4953;let _0x254a1a='',_0x4c13e5=![];const _0x28663e=createInterface({'input':process[_0x981ce2(0x198)],'terminal':![]}),_0x1df436=_0x427d03=>{const _0x5a4210=_0x981ce2;if(_0x4c13e5)return;_0x4c13e5=!![],clearTimeout(_0x1d8c01),_0x28663e[_0x5a4210(0x1a5)](),_0x2cdbd7(_0x427d03);},_0x1d8c01=setTimeout(()=>{_0x1df436(null);},_0x5c84bc);_0x28663e['on'](_0x981ce2(0x196),_0xa29b9f=>{_0x254a1a+=_0xa29b9f;}),_0x28663e['on'](_0x981ce2(0x1a5),()=>{if(_0x4c13e5)return;try{const _0x3c90e3=JSON['parse'](_0x254a1a);_0x1df436(_0x3c90e3);}catch{_0x1df436(null);}});});}function a10_0x4953(_0x38f7ad,_0x5ebda5){_0x38f7ad=_0x38f7ad-0x194;const _0xb00c25=a10_0xb00c();let _0x49539c=_0xb00c25[_0x38f7ad];return _0x49539c;}function formatCredits(_0x3888f2){const _0x3ccc2c=a10_0x4953;return _0x3888f2[_0x3ccc2c(0x1a2)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a10_0x28cf25(0x1b2)]=a10_0x28cf25(0x1ac);[a10_0x28cf25(0x19f)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async['execute'](_0x13f9d1){const _0x2e81be=a10_0x28cf25;try{const _0x8d035=await readStdinJson();if(!_0x8d035?.[_0x2e81be(0x1aa)])return console['log'](_0x2e81be(0x1af)),0x0;const _0x45c255=_0x8d035[_0x2e81be(0x1aa)],_0x265f21=_0x8d035[_0x2e81be(0x19d)]?.['id']||'',_0x28684e=_0x8d035['profile']||_0x13f9d1[_0x2e81be(0x1a9)][_0x2e81be(0x19a)],_0x1b24f5=await getUsageStats(_0x45c255,_0x28684e),_0x498001=[],_0x55719d=readCachedAccountInfo(_0x28684e),_0x16caef=_0x55719d?'tdx\x20'+_0x55719d[_0x2e81be(0x197)]+':'+_0x55719d['accountId']:'tdx',_0x5c106f=_0x265f21?getModelDisplayName(_0x265f21):_0x2e81be(0x199);_0x498001[_0x2e81be(0x19b)](_0x2e81be(0x1ad)+_0x16caef+_0x2e81be(0x1a3)+_0x5c106f);const _0x2c1540=formatCredits(_0x1b24f5['sessionCredits']),_0x5ef326=formatCredits(_0x1b24f5[_0x2e81be(0x1b0)]),_0x34ead0=formatCredits(_0x1b24f5[_0x2e81be(0x1a8)]);_0x498001[_0x2e81be(0x19b)]('🪙\x20credit:\x20'+_0x2c1540+_0x2e81be(0x1b3)+_0x5ef326+_0x2e81be(0x1a0)+_0x34ead0+'\x20month');if(_0x1b24f5['latestInputTokens']>0x0&&_0x265f21){const _0x119b19=formatTokenCount(_0x1b24f5[_0x2e81be(0x19e)]),_0x3b1ea4=calculateContextPercentage(_0x1b24f5['latestInputTokens'],_0x265f21);_0x498001[_0x2e81be(0x19b)](_0x2e81be(0x1b8)+_0x119b19+'\x20('+_0x3b1ea4+'%)');}return console[_0x2e81be(0x1b5)](_0x498001[_0x2e81be(0x1b4)](_0x2e81be(0x1b7))),0x0;}catch{return console[_0x2e81be(0x1b5)](_0x2e81be(0x1af)),0x0;}}}
1
+ const a10_0x4059bd=a10_0x3670;(function(_0x485dbd,_0x25a997){const _0x338a3b=a10_0x3670,_0x3f6f59=_0x485dbd();while(!![]){try{const _0x5029eb=-parseInt(_0x338a3b(0x115))/0x1*(-parseInt(_0x338a3b(0xfc))/0x2)+-parseInt(_0x338a3b(0x113))/0x3+parseInt(_0x338a3b(0x10f))/0x4*(-parseInt(_0x338a3b(0x107))/0x5)+-parseInt(_0x338a3b(0x117))/0x6+-parseInt(_0x338a3b(0x100))/0x7+parseInt(_0x338a3b(0x10c))/0x8*(-parseInt(_0x338a3b(0x102))/0x9)+parseInt(_0x338a3b(0xfa))/0xa;if(_0x5029eb===_0x25a997)break;else _0x3f6f59['push'](_0x3f6f59['shift']());}catch(_0x512a0e){_0x3f6f59['push'](_0x3f6f59['shift']());}}}(a10_0x354a,0x5b4f5));import{createInterface}from'node:readline';function a10_0x354a(){const _0x187a7e=['47728rSKfKy','monthCredits','\x20session\x20/\x20','1013692kbTnIr','close','💎\x20tdx\x20-\x20Claude','session_id','931467JozipW','latestInputTokens','5PJYQnk','toFixed','171702nEIvQj','model','statusline','💎\x20','5827920OZXmQa','\x20today\x20/\x20','181822KGNNJM','tdx\x20','🧠\x20','log','453929RzjBot','\x20|\x20','9zzNzKC','profile','options','push','\x20-\x20','5eNAUiQ','parse','sessionCredits','line','execute'];a10_0x354a=function(){return _0x187a7e;};return a10_0x354a();}import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x4b6690=0x64){return new Promise(_0x48642c=>{const _0x54499b=a10_0x3670;let _0x50a271='',_0x4ddede=![];const _0x32f52b=createInterface({'input':process['stdin'],'terminal':![]}),_0x5aa8f5=_0x362778=>{const _0x1ad588=a10_0x3670;if(_0x4ddede)return;_0x4ddede=!![],clearTimeout(_0x2a115d),_0x32f52b[_0x1ad588(0x110)](),_0x48642c(_0x362778);},_0x2a115d=setTimeout(()=>{_0x5aa8f5(null);},_0x4b6690);_0x32f52b['on'](_0x54499b(0x10a),_0xc87b9b=>{_0x50a271+=_0xc87b9b;}),_0x32f52b['on']('close',()=>{const _0x27b4c4=_0x54499b;if(_0x4ddede)return;try{const _0x3a61e5=JSON[_0x27b4c4(0x108)](_0x50a271);_0x5aa8f5(_0x3a61e5);}catch{_0x5aa8f5(null);}});});}function formatCredits(_0x161774){const _0x4c52ab=a10_0x3670;return _0x161774[_0x4c52ab(0x116)](0x2);}function a10_0x3670(_0x538ea8,_0x440c0e){_0x538ea8=_0x538ea8-0xf8;const _0x354ae6=a10_0x354a();let _0x367099=_0x354ae6[_0x538ea8];return _0x367099;}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a10_0x4059bd(0xf8);['description']='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async[a10_0x4059bd(0x10b)](_0x321abc){const _0x45a8b9=a10_0x4059bd;try{const _0x1bea4c=await readStdinJson();if(!_0x1bea4c?.['session_id'])return console[_0x45a8b9(0xff)](_0x45a8b9(0x111)),0x0;const _0x356347=_0x1bea4c[_0x45a8b9(0x112)],_0x41bc5a=_0x1bea4c[_0x45a8b9(0x118)]?.['id']||'',_0x2bf8da=_0x1bea4c['profile']||_0x321abc[_0x45a8b9(0x104)][_0x45a8b9(0x103)],_0x18ca58=await getUsageStats(_0x356347,_0x2bf8da),_0x3c10ce=[],_0x22844c=readCachedAccountInfo(_0x2bf8da),_0x1a0f95=_0x22844c?_0x45a8b9(0xfd)+_0x22844c['site']+':'+_0x22844c['accountId']:'tdx',_0x179908=_0x41bc5a?getModelDisplayName(_0x41bc5a):'Claude';_0x3c10ce[_0x45a8b9(0x105)](_0x45a8b9(0xf9)+_0x1a0f95+_0x45a8b9(0x106)+_0x179908);const _0x19b530=formatCredits(_0x18ca58[_0x45a8b9(0x109)]),_0x43149f=formatCredits(_0x18ca58['todayCredits']),_0x26a7a8=formatCredits(_0x18ca58[_0x45a8b9(0x10d)]);_0x3c10ce['push']('🪙\x20credit:\x20'+_0x19b530+_0x45a8b9(0x10e)+_0x43149f+_0x45a8b9(0xfb)+_0x26a7a8+'\x20month');if(_0x18ca58[_0x45a8b9(0x114)]>0x0&&_0x41bc5a){const _0x2108a4=formatTokenCount(_0x18ca58['latestInputTokens']),_0x12cc39=calculateContextPercentage(_0x18ca58[_0x45a8b9(0x114)],_0x41bc5a);_0x3c10ce[_0x45a8b9(0x105)](_0x45a8b9(0xfe)+_0x2108a4+'\x20('+_0x12cc39+'%)');}return console[_0x45a8b9(0xff)](_0x3c10ce['join'](_0x45a8b9(0x101))),0x0;}catch{return console[_0x45a8b9(0xff)](_0x45a8b9(0x111)),0x0;}}}
@@ -1 +1 @@
1
- const a11_0x30f046=a11_0x2bb7;(function(_0x1d8384,_0x5cc7eb){const _0x103aef=a11_0x2bb7,_0x87b27b=_0x1d8384();while(!![]){try{const _0x550d91=-parseInt(_0x103aef(0x16a))/0x1+parseInt(_0x103aef(0x15b))/0x2+-parseInt(_0x103aef(0x169))/0x3*(parseInt(_0x103aef(0x147))/0x4)+parseInt(_0x103aef(0x177))/0x5+parseInt(_0x103aef(0x15a))/0x6+-parseInt(_0x103aef(0x14c))/0x7*(-parseInt(_0x103aef(0x167))/0x8)+-parseInt(_0x103aef(0x172))/0x9;if(_0x550d91===_0x5cc7eb)break;else _0x87b27b['push'](_0x87b27b['shift']());}catch(_0x1515b0){_0x87b27b['push'](_0x87b27b['shift']());}}}(a11_0x211c,0xc52ee));import a11_0x552ab5 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a11_0x2bb7(_0x73313e,_0x59731f){_0x73313e=_0x73313e-0x144;const _0x211c55=a11_0x211c();let _0x2bb756=_0x211c55[_0x73313e];return _0x2bb756;}import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x2c7cb2){return _0x2c7cb2['toFixed'](0x2);}function formatLastUsed(_0x27f35b){const _0x406aed=a11_0x2bb7;if(!_0x27f35b)return _0x406aed(0x16b);const _0x101433=new Date(_0x27f35b),_0x2538bf=new Date(),_0x415901=_0x101433['toLocaleDateString'](_0x406aed(0x146)),_0x4192d3=_0x2538bf[_0x406aed(0x170)]('en-CA');if(_0x415901===_0x4192d3)return _0x406aed(0x14d)+_0x101433[_0x406aed(0x152)](_0x406aed(0x145),{'hour':_0x406aed(0x158),'minute':_0x406aed(0x158)});const _0x46b7a6=new Date(_0x415901),_0x4dbdb1=new Date(_0x4192d3),_0x660509=Math['round']((_0x4dbdb1[_0x406aed(0x144)]()-_0x46b7a6[_0x406aed(0x144)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x660509===0x1)return'yesterday';else return _0x660509>0x1&&_0x660509<0x7?_0x660509+_0x406aed(0x149):_0x101433['toLocaleDateString']('en-US',{'month':_0x406aed(0x150),'day':_0x406aed(0x17a)});}export class ClaudeUsageCommand extends BaseCommand{['name']=a11_0x30f046(0x175);[a11_0x30f046(0x15e)]='Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile';async[a11_0x30f046(0x15c)](_0x30489a){const _0x360dc0=a11_0x30f046,{options:_0x30ec99}=_0x30489a,_0x502906=_0x30ec99[_0x360dc0(0x168)]==='json'||_0x30ec99[_0x360dc0(0x168)]===_0x360dc0(0x14a)||_0x30ec99[_0x360dc0(0x161)];try{const [_0x236908,_0x47e9ec]=await Promise[_0x360dc0(0x14f)]([getAllProfileStats(),getUsageSummary()]);return _0x502906?await this[_0x360dc0(0x151)](_0x236908,_0x47e9ec,_0x30ec99):this[_0x360dc0(0x159)](_0x236908,_0x47e9ec),0x0;}catch(_0x4ca776){const _0x264bc1=_0x4ca776 instanceof Error?_0x4ca776[_0x360dc0(0x14b)]:_0x360dc0(0x17b);return console[_0x360dc0(0x155)](a11_0x552ab5[_0x360dc0(0x171)](_0x360dc0(0x17c)+_0x264bc1)),0x1;}}async['outputStructured'](_0x367e5f,_0x3921fb,_0x566225){const _0x3337d0=a11_0x30f046,_0x4a6452={'summary':{'todayCredits':_0x3921fb[_0x3337d0(0x16d)],'monthCredits':_0x3921fb[_0x3337d0(0x17e)],'totalCredits':_0x3921fb[_0x3337d0(0x14e)],'profileCount':_0x3921fb[_0x3337d0(0x174)]},'profiles':_0x367e5f['map'](_0x92e585=>({'profile':_0x92e585[_0x3337d0(0x165)],'credits':_0x92e585[_0x3337d0(0x173)],'requests':_0x92e585['entryCount'],'lastUsedAt':_0x92e585[_0x3337d0(0x15f)]}))};await handleSDKOutput([_0x4a6452],_0x566225);}[a11_0x30f046(0x159)](_0x1694ff,_0x2e79aa){const _0x2775b7=a11_0x30f046;console['log'](a11_0x552ab5[_0x2775b7(0x160)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console['log'](a11_0x552ab5[_0x2775b7(0x164)]('─'[_0x2775b7(0x16e)](0x32))),console[_0x2775b7(0x153)](_0x2775b7(0x16c)+a11_0x552ab5['cyan'](formatCredits(_0x2e79aa[_0x2775b7(0x16d)]))+'\x20credits'),console[_0x2775b7(0x153)](_0x2775b7(0x162)+a11_0x552ab5[_0x2775b7(0x157)](formatCredits(_0x2e79aa[_0x2775b7(0x17e)]))+'\x20credits'),console[_0x2775b7(0x153)](_0x2775b7(0x166)+a11_0x552ab5[_0x2775b7(0x157)](formatCredits(_0x2e79aa[_0x2775b7(0x14e)]))+_0x2775b7(0x15d)),console[_0x2775b7(0x153)]();if(_0x1694ff[_0x2775b7(0x154)]===0x0){console[_0x2775b7(0x153)](a11_0x552ab5[_0x2775b7(0x164)]('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console[_0x2775b7(0x153)](a11_0x552ab5['dim'](_0x2775b7(0x163)));return;}console[_0x2775b7(0x153)](a11_0x552ab5[_0x2775b7(0x160)](_0x2775b7(0x17d))),console['log'](a11_0x552ab5[_0x2775b7(0x164)]('─'[_0x2775b7(0x16e)](0x3c)));const _0x5de241=Math['max'](0xc,..._0x1694ff['map'](_0x147e73=>_0x147e73['profile']==='default'?'(default)'[_0x2775b7(0x154)]:_0x147e73[_0x2775b7(0x165)][_0x2775b7(0x154)])),_0x390aa9=0xa,_0x33bc7f=0xa;console['log']('\x20\x20'+_0x2775b7(0x176)['padEnd'](_0x5de241)+'\x20\x20'+_0x2775b7(0x179)[_0x2775b7(0x148)](_0x390aa9)+'\x20\x20'+_0x2775b7(0x16f)['padStart'](_0x33bc7f)+'\x20\x20'+'Last\x20Used');for(const _0x21482d of _0x1694ff){const _0x368581=_0x21482d['profile']==='default'?'(default)':_0x21482d[_0x2775b7(0x165)],_0x3d1a1d=_0x368581[_0x2775b7(0x17f)](_0x5de241),_0x3b436e=_0x21482d['profile']==='default'?a11_0x552ab5[_0x2775b7(0x164)](_0x3d1a1d):_0x3d1a1d;console[_0x2775b7(0x153)]('\x20\x20'+_0x3b436e+'\x20\x20'+a11_0x552ab5['cyan'](formatCredits(_0x21482d['credits'])[_0x2775b7(0x148)](_0x390aa9))+'\x20\x20'+String(_0x21482d[_0x2775b7(0x156)])[_0x2775b7(0x148)](_0x33bc7f)+'\x20\x20'+a11_0x552ab5[_0x2775b7(0x164)](formatLastUsed(_0x21482d[_0x2775b7(0x15f)])));}console['log'](),console['log'](a11_0x552ab5[_0x2775b7(0x164)](_0x2775b7(0x178))),console[_0x2775b7(0x153)]();}}function a11_0x211c(){const _0x1fd3a8=['numeric','Unknown\x20error','Error:\x20','Usage\x20by\x20Profile','monthCredits','padEnd','getTime','en-US','en-CA','8vjqFHt','padStart','\x20days\x20ago','jsonl','message','1511314XJoIKB','today\x20','totalCredits','all','short','outputStructured','toLocaleTimeString','log','length','error','entryCount','cyan','2-digit','outputTable','6530094Mzslwl','2854044jYyasI','execute','\x20credits','description','lastUsedAt','bold','json','\x20\x20Month:\x20\x20\x20','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','dim','profile','\x20\x20Total:\x20\x20\x20','32OSdFXr','format','1371543xKNMrQ','821708dHfOdm','never','\x20\x20Today:\x20\x20\x20','todayCredits','repeat','Requests','toLocaleDateString','red','20152629kdYmqw','credits','profileCount','usage','Profile','7019670DOgvyd','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','Credits'];a11_0x211c=function(){return _0x1fd3a8;};return a11_0x211c();}
1
+ function a11_0x5310(_0x36a6e4,_0x25755a){_0x36a6e4=_0x36a6e4-0x196;const _0x2d4e2b=a11_0x2d4e();let _0x531083=_0x2d4e2b[_0x36a6e4];return _0x531083;}const a11_0x1d02c1=a11_0x5310;(function(_0x459b00,_0x5820f8){const _0x2f6b2b=a11_0x5310,_0x1776b4=_0x459b00();while(!![]){try{const _0x98692c=parseInt(_0x2f6b2b(0x1c8))/0x1+parseInt(_0x2f6b2b(0x1b3))/0x2*(parseInt(_0x2f6b2b(0x1b7))/0x3)+-parseInt(_0x2f6b2b(0x1aa))/0x4*(parseInt(_0x2f6b2b(0x1ca))/0x5)+-parseInt(_0x2f6b2b(0x1ce))/0x6+parseInt(_0x2f6b2b(0x1cd))/0x7+-parseInt(_0x2f6b2b(0x19c))/0x8*(parseInt(_0x2f6b2b(0x1b8))/0x9)+parseInt(_0x2f6b2b(0x1d9))/0xa*(parseInt(_0x2f6b2b(0x1b5))/0xb);if(_0x98692c===_0x5820f8)break;else _0x1776b4['push'](_0x1776b4['shift']());}catch(_0x20d076){_0x1776b4['push'](_0x1776b4['shift']());}}}(a11_0x2d4e,0xe484f));import a11_0x40ad16 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x4985a3){const _0x53311b=a11_0x5310;return _0x4985a3[_0x53311b(0x1d8)](0x2);}function formatLastUsed(_0x72ecf8){const _0x51ceb3=a11_0x5310;if(!_0x72ecf8)return _0x51ceb3(0x199);const _0x56bee8=new Date(_0x72ecf8),_0x288284=new Date(),_0x330c08=_0x56bee8[_0x51ceb3(0x1a9)](_0x51ceb3(0x1cc)),_0x23a5a4=_0x288284[_0x51ceb3(0x1a9)]('en-CA');if(_0x330c08===_0x23a5a4)return _0x51ceb3(0x1c5)+_0x56bee8[_0x51ceb3(0x1b9)](_0x51ceb3(0x19b),{'hour':'2-digit','minute':_0x51ceb3(0x1cb)});const _0x580a93=new Date(_0x330c08),_0xe0ef30=new Date(_0x23a5a4),_0x22291e=Math['round']((_0xe0ef30[_0x51ceb3(0x1bb)]()-_0x580a93[_0x51ceb3(0x1bb)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x22291e===0x1)return _0x51ceb3(0x1be);else return _0x22291e>0x1&&_0x22291e<0x7?_0x22291e+_0x51ceb3(0x1b6):_0x56bee8[_0x51ceb3(0x1a9)](_0x51ceb3(0x19b),{'month':_0x51ceb3(0x1ad),'day':'numeric'});}function a11_0x2d4e(){const _0x1c5057=['Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','yesterday','monthCredits','entryCount','outputStructured','Error:\x20','repeat','max','today\x20','error','\x20\x20Today:\x20\x20\x20','1603958wplBkG','outputTable','5911930vvqwwm','2-digit','en-CA','2744399cHXgQt','10393512RraJqf','\x20\x20Total:\x20\x20\x20','json','credits','length','map','jsonl','Profile','cyan','name','toFixed','2652380rtneIb','log','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','format','never','(default)','en-US','8VwMXgG','bold','default','padEnd','red','all','padStart','Unknown\x20error','Requests','usage','Last\x20Used','profile','todayCredits','toLocaleDateString','4PbFuOF','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','lastUsedAt','short','\x20credits','Usage\x20by\x20Profile','profileCount','dim','execute','1416724uAXxjt','totalCredits','22xRtkxQ','\x20days\x20ago','6gYnVTD','833058ORfwrc','toLocaleTimeString','\x20\x20Month:\x20\x20\x20','getTime','message'];a11_0x2d4e=function(){return _0x1c5057;};return a11_0x2d4e();}export class ClaudeUsageCommand extends BaseCommand{[a11_0x1d02c1(0x1d7)]=a11_0x1d02c1(0x1a5);['description']=a11_0x1d02c1(0x1bd);async[a11_0x1d02c1(0x1b2)](_0x377a15){const _0x481126=a11_0x1d02c1,{options:_0x33438f}=_0x377a15,_0x1b0f9f=_0x33438f[_0x481126(0x198)]===_0x481126(0x1d0)||_0x33438f[_0x481126(0x198)]===_0x481126(0x1d4)||_0x33438f[_0x481126(0x1d0)];try{const [_0x308fc8,_0x17a78f]=await Promise[_0x481126(0x1a1)]([getAllProfileStats(),getUsageSummary()]);return _0x1b0f9f?await this[_0x481126(0x1c1)](_0x308fc8,_0x17a78f,_0x33438f):this['outputTable'](_0x308fc8,_0x17a78f),0x0;}catch(_0xe708e1){const _0x3a0a33=_0xe708e1 instanceof Error?_0xe708e1[_0x481126(0x1bc)]:_0x481126(0x1a3);return console[_0x481126(0x1c6)](a11_0x40ad16[_0x481126(0x1a0)](_0x481126(0x1c2)+_0x3a0a33)),0x1;}}async[a11_0x1d02c1(0x1c1)](_0x452c73,_0xe92ec5,_0x102baa){const _0x59271e=a11_0x1d02c1,_0x440af7={'summary':{'todayCredits':_0xe92ec5[_0x59271e(0x1a8)],'monthCredits':_0xe92ec5['monthCredits'],'totalCredits':_0xe92ec5[_0x59271e(0x1b4)],'profileCount':_0xe92ec5[_0x59271e(0x1b0)]},'profiles':_0x452c73[_0x59271e(0x1d3)](_0x3ba3c6=>({'profile':_0x3ba3c6[_0x59271e(0x1a7)],'credits':_0x3ba3c6[_0x59271e(0x1d1)],'requests':_0x3ba3c6[_0x59271e(0x1c0)],'lastUsedAt':_0x3ba3c6[_0x59271e(0x1ac)]}))};await handleSDKOutput([_0x440af7],_0x102baa);}[a11_0x1d02c1(0x1c9)](_0x3cf31e,_0x520b4d){const _0x5a34bb=a11_0x1d02c1;console[_0x5a34bb(0x196)](a11_0x40ad16[_0x5a34bb(0x19d)](_0x5a34bb(0x197))),console['log'](a11_0x40ad16['dim']('─'[_0x5a34bb(0x1c3)](0x32))),console[_0x5a34bb(0x196)](_0x5a34bb(0x1c7)+a11_0x40ad16[_0x5a34bb(0x1d6)](formatCredits(_0x520b4d[_0x5a34bb(0x1a8)]))+_0x5a34bb(0x1ae)),console[_0x5a34bb(0x196)](_0x5a34bb(0x1ba)+a11_0x40ad16['cyan'](formatCredits(_0x520b4d[_0x5a34bb(0x1bf)]))+'\x20credits'),console[_0x5a34bb(0x196)](_0x5a34bb(0x1cf)+a11_0x40ad16[_0x5a34bb(0x1d6)](formatCredits(_0x520b4d['totalCredits']))+_0x5a34bb(0x1ae)),console['log']();if(_0x3cf31e[_0x5a34bb(0x1d2)]===0x0){console[_0x5a34bb(0x196)](a11_0x40ad16['dim'](_0x5a34bb(0x1ab))),console[_0x5a34bb(0x196)](a11_0x40ad16[_0x5a34bb(0x1b1)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console['log'](a11_0x40ad16[_0x5a34bb(0x19d)](_0x5a34bb(0x1af))),console['log'](a11_0x40ad16[_0x5a34bb(0x1b1)]('─'[_0x5a34bb(0x1c3)](0x3c)));const _0x57a683=Math[_0x5a34bb(0x1c4)](0xc,..._0x3cf31e[_0x5a34bb(0x1d3)](_0x3296f6=>_0x3296f6[_0x5a34bb(0x1a7)]===_0x5a34bb(0x19e)?'(default)'[_0x5a34bb(0x1d2)]:_0x3296f6[_0x5a34bb(0x1a7)][_0x5a34bb(0x1d2)])),_0x424da5=0xa,_0x116635=0xa;console[_0x5a34bb(0x196)]('\x20\x20'+_0x5a34bb(0x1d5)[_0x5a34bb(0x19f)](_0x57a683)+'\x20\x20'+'Credits'[_0x5a34bb(0x1a2)](_0x424da5)+'\x20\x20'+_0x5a34bb(0x1a4)['padStart'](_0x116635)+'\x20\x20'+_0x5a34bb(0x1a6));for(const _0x42ee67 of _0x3cf31e){const _0x314967=_0x42ee67['profile']===_0x5a34bb(0x19e)?_0x5a34bb(0x19a):_0x42ee67['profile'],_0x44d5fd=_0x314967[_0x5a34bb(0x19f)](_0x57a683),_0x2a591d=_0x42ee67[_0x5a34bb(0x1a7)]===_0x5a34bb(0x19e)?a11_0x40ad16[_0x5a34bb(0x1b1)](_0x44d5fd):_0x44d5fd;console['log']('\x20\x20'+_0x2a591d+'\x20\x20'+a11_0x40ad16[_0x5a34bb(0x1d6)](formatCredits(_0x42ee67['credits'])[_0x5a34bb(0x1a2)](_0x424da5))+'\x20\x20'+String(_0x42ee67['entryCount'])['padStart'](_0x116635)+'\x20\x20'+a11_0x40ad16[_0x5a34bb(0x1b1)](formatLastUsed(_0x42ee67['lastUsedAt'])));}console[_0x5a34bb(0x196)](),console['log'](a11_0x40ad16['dim']('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console['log']();}}
@@ -1 +1 @@
1
- const a12_0x2d6e7e=a12_0x5e72;(function(_0x185a7b,_0x19c76f){const _0x5add44=a12_0x5e72,_0x46e58e=_0x185a7b();while(!![]){try{const _0x1592dd=-parseInt(_0x5add44(0x105))/0x1+-parseInt(_0x5add44(0x10e))/0x2+parseInt(_0x5add44(0x125))/0x3*(-parseInt(_0x5add44(0x12b))/0x4)+-parseInt(_0x5add44(0x12e))/0x5+-parseInt(_0x5add44(0x100))/0x6+-parseInt(_0x5add44(0x106))/0x7*(parseInt(_0x5add44(0x12f))/0x8)+-parseInt(_0x5add44(0x101))/0x9*(-parseInt(_0x5add44(0x121))/0xa);if(_0x1592dd===_0x19c76f)break;else _0x46e58e['push'](_0x46e58e['shift']());}catch(_0x59e8ea){_0x46e58e['push'](_0x46e58e['shift']());}}}(a12_0x74f7,0x2a35e));function a12_0x74f7(){const _0x24dcf4=['223272huPesw','name','2055858kmHBXT','5667903UCEMKZ','stack','set','isValid','152950YnpqRe','21tEzslk','Invalid\x20limit\x20value:\x20','USER_ERROR','Authentication\x20failed','message','profile','execute','get','235260ljCwBJ','\x20\x20tdx\x20auth\x20setup','validate','Authentication\x20error\x20stack\x20trace:','run','logger','has','getAll','values','status','\x0aTo\x20set\x20up\x20authentication:','Reason:\x20','options','.\x20Must\x20be\x20a\x20number.','Command\x20\x27','category','debug','\x27\x20is\x20already\x20registered','limit','20bcKzyn','validateGlobalOptions','Error:\x20','red','42822chnRjn','error','number','commands','tdx','\x20\x20tdx\x20auth','24qwzZmk','from','value','1520230tEPNkt'];a12_0x74f7=function(){return _0x24dcf4;};return a12_0x74f7();}import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a12_0x2d2d3b from'chalk';function a12_0x5e72(_0x30ccef,_0x2ef7f1){_0x30ccef=_0x30ccef-0x100;const _0x74f73e=a12_0x74f7();let _0x5e7284=_0x74f73e[_0x30ccef];return _0x5e7284;}export function printAuthError(_0xc4437e,_0x4889b5=![],_0x186181){const _0x3742c2=a12_0x5e72,_0x1459e1=_0xc4437e['problemDetails']?.['detail']||_0xc4437e[_0x3742c2(0x10a)];console['error'](a12_0x2d2d3b['red'](_0x3742c2(0x109))),console[_0x3742c2(0x126)](a12_0x2d2d3b[_0x3742c2(0x124)](_0x3742c2(0x119)+_0x1459e1));if(_0x4889b5){const _0x373aca=_0x186181?'\x20--profile\x20'+_0x186181:'';console[_0x3742c2(0x126)](_0x3742c2(0x118)),console[_0x3742c2(0x126)](_0x3742c2(0x10f)+_0x373aca+'\x0a'),console[_0x3742c2(0x126)]('To\x20check\x20your\x20current\x20auth\x20status:'),console[_0x3742c2(0x126)](_0x3742c2(0x12a)+_0x373aca);}}export class BaseCommand{[a12_0x2d6e7e(0x122)](_0x1214a3){const _0x39c19c=a12_0x2d6e7e,{options:_0x3e7615}=_0x1214a3,_0x482cdb=_0x3e7615[_0x39c19c(0x120)];if(_0x482cdb!==undefined){const _0x59e502=typeof _0x482cdb===_0x39c19c(0x127)?_0x482cdb:parseInt(_0x482cdb,0xa);if(isNaN(_0x59e502))return _0x39c19c(0x107)+_0x482cdb+_0x39c19c(0x11b);const _0x5551a9=validateLimitOption(_0x59e502);if(!_0x5551a9[_0x39c19c(0x104)])return _0x5551a9[_0x39c19c(0x126)];_0x1214a3[_0x39c19c(0x11a)][_0x39c19c(0x120)]=_0x5551a9[_0x39c19c(0x12d)];}return undefined;}[a12_0x2d6e7e(0x110)](_0x319709){return undefined;}async[a12_0x2d6e7e(0x112)](_0x270da1){const _0x56d78f=a12_0x2d6e7e;try{const _0xbc06bc=this['validateGlobalOptions'](_0x270da1);if(_0xbc06bc)return console[_0x56d78f(0x126)](_0x56d78f(0x123)+_0xbc06bc),0x1;const _0x106bf4=this['validate'](_0x270da1);if(_0x106bf4){const _0xb382c5=/^\s*(Usage|Note|Warning|Error):/i['test'](_0x106bf4);return _0xb382c5?console[_0x56d78f(0x126)](_0x106bf4):console['error'](_0x56d78f(0x123)+_0x106bf4),0x1;}const _0x6afbba=await this[_0x56d78f(0x10c)](_0x270da1);return _0x6afbba??0x0;}catch(_0x14251e){if(_0x14251e instanceof Error){if(_0x14251e instanceof HTTPClientError&&_0x14251e[_0x56d78f(0x117)]===0x191){const _0xc32116=_0x270da1[_0x56d78f(0x11a)][_0x56d78f(0x10b)];return printAuthError(_0x14251e,!![],_0xc32116),_0x14251e[_0x56d78f(0x102)]&&_0x270da1[_0x56d78f(0x129)]&&(_0x270da1[_0x56d78f(0x129)][_0x56d78f(0x113)][_0x56d78f(0x11e)](_0x56d78f(0x111)),_0x270da1[_0x56d78f(0x129)]['logger'][_0x56d78f(0x11e)](_0x14251e[_0x56d78f(0x102)])),0x1;}console[_0x56d78f(0x126)](a12_0x2d2d3b['red']('Error:\x20'+_0x14251e['message']));_0x14251e instanceof SDKError&&_0x14251e['helpText']&&console[_0x56d78f(0x126)](a12_0x2d2d3b['yellow'](_0x14251e['helpText']));const _0x1aee6c=_0x14251e instanceof SDKError&&_0x14251e[_0x56d78f(0x11d)]===ErrorCategory[_0x56d78f(0x108)];_0x14251e[_0x56d78f(0x102)]&&!_0x1aee6c&&console['error']('\x0aStack\x20trace:\x0a'+_0x14251e[_0x56d78f(0x102)]);}else console['error'](_0x56d78f(0x123)+String(_0x14251e));return 0x1;}}}export class CommandRegistry{[a12_0x2d6e7e(0x128)]=new Map();['register'](_0x21172c){const _0x261447=a12_0x2d6e7e;if(this['commands'][_0x261447(0x114)](_0x21172c[_0x261447(0x130)]))throw new Error(_0x261447(0x11c)+_0x21172c[_0x261447(0x130)]+_0x261447(0x11f));this['commands'][_0x261447(0x103)](_0x21172c[_0x261447(0x130)],_0x21172c);}[a12_0x2d6e7e(0x10d)](_0x9ed7cb){const _0x335497=a12_0x2d6e7e;return this[_0x335497(0x128)][_0x335497(0x10d)](_0x9ed7cb);}[a12_0x2d6e7e(0x115)](){const _0x45d895=a12_0x2d6e7e;return Array[_0x45d895(0x12c)](this[_0x45d895(0x128)][_0x45d895(0x116)]());}[a12_0x2d6e7e(0x114)](_0x5b5b58){const _0x4b28fa=a12_0x2d6e7e;return this[_0x4b28fa(0x128)][_0x4b28fa(0x114)](_0x5b5b58);}}export const registry=new CommandRegistry();
1
+ const a12_0x16f98f=a12_0x5d7b;(function(_0x30cf80,_0x3a89a9){const _0x5eff9b=a12_0x5d7b,_0x110b3e=_0x30cf80();while(!![]){try{const _0x472ba3=parseInt(_0x5eff9b(0xd5))/0x1*(-parseInt(_0x5eff9b(0xb6))/0x2)+parseInt(_0x5eff9b(0xe4))/0x3+parseInt(_0x5eff9b(0xc1))/0x4+-parseInt(_0x5eff9b(0xd1))/0x5*(-parseInt(_0x5eff9b(0xe0))/0x6)+-parseInt(_0x5eff9b(0xd8))/0x7*(parseInt(_0x5eff9b(0xc2))/0x8)+parseInt(_0x5eff9b(0xb7))/0x9+parseInt(_0x5eff9b(0xb4))/0xa*(parseInt(_0x5eff9b(0xd6))/0xb);if(_0x472ba3===_0x3a89a9)break;else _0x110b3e['push'](_0x110b3e['shift']());}catch(_0x25f61a){_0x110b3e['push'](_0x110b3e['shift']());}}}(a12_0x5847,0x6f388));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a12_0x14111f from'chalk';export function printAuthError(_0x1b3b14,_0x249140=![],_0x2aa65d){const _0xc70b7a=a12_0x5d7b,_0x3452d1=_0x1b3b14[_0xc70b7a(0xd4)]?.[_0xc70b7a(0xc0)]||_0x1b3b14[_0xc70b7a(0xc4)];console[_0xc70b7a(0xbc)](a12_0x14111f[_0xc70b7a(0xbb)](_0xc70b7a(0xb0))),console[_0xc70b7a(0xbc)](a12_0x14111f[_0xc70b7a(0xbb)](_0xc70b7a(0xb1)+_0x3452d1));if(_0x249140){const _0x1477fe=_0x2aa65d?_0xc70b7a(0xcc)+_0x2aa65d:'';console[_0xc70b7a(0xbc)](_0xc70b7a(0xd0)),console['error'](_0xc70b7a(0xb2)+_0x1477fe+'\x0a'),console[_0xc70b7a(0xbc)]('To\x20check\x20your\x20current\x20auth\x20status:'),console['error'](_0xc70b7a(0xc7)+_0x1477fe);}}function a12_0x5d7b(_0x11a73f,_0x47ec00){_0x11a73f=_0x11a73f-0xb0;const _0x584781=a12_0x5847();let _0x5d7b7b=_0x584781[_0x11a73f];return _0x5d7b7b;}export class BaseCommand{[a12_0x16f98f(0xc6)](_0xdf8e2c){const _0x17b987=a12_0x16f98f,{options:_0x582595}=_0xdf8e2c,_0x4acf0e=_0x582595[_0x17b987(0xdd)];if(_0x4acf0e!==undefined){const _0x14b0b0=typeof _0x4acf0e===_0x17b987(0xdf)?_0x4acf0e:parseInt(_0x4acf0e,0xa);if(isNaN(_0x14b0b0))return _0x17b987(0xbd)+_0x4acf0e+'.\x20Must\x20be\x20a\x20number.';const _0x1e51a4=validateLimitOption(_0x14b0b0);if(!_0x1e51a4[_0x17b987(0xb5)])return _0x1e51a4['error'];_0xdf8e2c[_0x17b987(0xcf)][_0x17b987(0xdd)]=_0x1e51a4['value'];}return undefined;}['validate'](_0x433892){return undefined;}async[a12_0x16f98f(0xb9)](_0x2eee18){const _0x1f2b2e=a12_0x16f98f;try{const _0x31fc16=this[_0x1f2b2e(0xc6)](_0x2eee18);if(_0x31fc16)return console[_0x1f2b2e(0xbc)](_0x1f2b2e(0xcd)+_0x31fc16),0x1;const _0x58942e=this[_0x1f2b2e(0xca)](_0x2eee18);if(_0x58942e){const _0x255dab=/^\s*(Usage|Note|Warning|Error):/i[_0x1f2b2e(0xbf)](_0x58942e);return _0x255dab?console[_0x1f2b2e(0xbc)](_0x58942e):console[_0x1f2b2e(0xbc)](_0x1f2b2e(0xcd)+_0x58942e),0x1;}const _0x5aacdc=await this['execute'](_0x2eee18);return _0x5aacdc??0x0;}catch(_0x4fd453){if(_0x4fd453 instanceof Error){if(_0x4fd453 instanceof HTTPClientError&&_0x4fd453['status']===0x191){const _0x2b1e24=_0x2eee18[_0x1f2b2e(0xcf)][_0x1f2b2e(0xc9)];return printAuthError(_0x4fd453,!![],_0x2b1e24),_0x4fd453[_0x1f2b2e(0xc5)]&&_0x2eee18[_0x1f2b2e(0xd9)]&&(_0x2eee18[_0x1f2b2e(0xd9)][_0x1f2b2e(0xdc)]['debug'](_0x1f2b2e(0xc8)),_0x2eee18[_0x1f2b2e(0xd9)][_0x1f2b2e(0xdc)][_0x1f2b2e(0xc3)](_0x4fd453[_0x1f2b2e(0xc5)])),0x1;}console[_0x1f2b2e(0xbc)](a12_0x14111f[_0x1f2b2e(0xbb)]('Error:\x20'+_0x4fd453[_0x1f2b2e(0xc4)]));_0x4fd453 instanceof SDKError&&_0x4fd453['helpText']&&console[_0x1f2b2e(0xbc)](a12_0x14111f[_0x1f2b2e(0xcb)](_0x4fd453[_0x1f2b2e(0xd3)]));const _0x498370=_0x4fd453 instanceof SDKError&&_0x4fd453['category']===ErrorCategory[_0x1f2b2e(0xde)];_0x4fd453[_0x1f2b2e(0xc5)]&&!_0x498370&&console[_0x1f2b2e(0xbc)](_0x1f2b2e(0xb8)+_0x4fd453[_0x1f2b2e(0xc5)]);}else console[_0x1f2b2e(0xbc)]('Error:\x20'+String(_0x4fd453));return 0x1;}}}export class CommandRegistry{['commands']=new Map();[a12_0x16f98f(0xce)](_0xb3d7d2){const _0x43bb06=a12_0x16f98f;if(this['commands'][_0x43bb06(0xe3)](_0xb3d7d2[_0x43bb06(0xdb)]))throw new Error(_0x43bb06(0xe2)+_0xb3d7d2[_0x43bb06(0xdb)]+_0x43bb06(0xd7));this[_0x43bb06(0xe1)][_0x43bb06(0xbe)](_0xb3d7d2[_0x43bb06(0xdb)],_0xb3d7d2);}[a12_0x16f98f(0xb3)](_0x586ccb){const _0x6554fc=a12_0x16f98f;return this[_0x6554fc(0xe1)][_0x6554fc(0xb3)](_0x586ccb);}[a12_0x16f98f(0xd2)](){const _0xb49f4a=a12_0x16f98f;return Array[_0xb49f4a(0xda)](this[_0xb49f4a(0xe1)][_0xb49f4a(0xba)]());}['has'](_0x22079b){const _0x1b1d40=a12_0x16f98f;return this[_0x1b1d40(0xe1)][_0x1b1d40(0xe3)](_0x22079b);}}function a12_0x5847(){const _0x2a12a3=['413661neUkgU','Authentication\x20failed','Reason:\x20','\x20\x20tdx\x20auth\x20setup','get','5409260FpvnwU','isValid','1293694lOxEUz','6044850rijRBx','\x0aStack\x20trace:\x0a','run','values','red','error','Invalid\x20limit\x20value:\x20','set','test','detail','470824imPBsf','165712vrHSvs','debug','message','stack','validateGlobalOptions','\x20\x20tdx\x20auth','Authentication\x20error\x20stack\x20trace:','profile','validate','yellow','\x20--profile\x20','Error:\x20','register','options','\x0aTo\x20set\x20up\x20authentication:','24985WHNNcq','getAll','helpText','problemDetails','1vxkaNE','11rvHRRq','\x27\x20is\x20already\x20registered','154uJRbFz','tdx','from','name','logger','limit','USER_ERROR','number','108plTsJa','commands','Command\x20\x27','has'];a12_0x5847=function(){return _0x2a12a3;};return a12_0x5847();}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a13_0x39deb2=a13_0x2971;(function(_0x44804a,_0x50f2b1){const _0x4dee3e=a13_0x2971,_0x5b647e=_0x44804a();while(!![]){try{const _0x1485e7=-parseInt(_0x4dee3e(0xf2))/0x1*(-parseInt(_0x4dee3e(0xc7))/0x2)+parseInt(_0x4dee3e(0xe3))/0x3+-parseInt(_0x4dee3e(0x102))/0x4*(-parseInt(_0x4dee3e(0xef))/0x5)+parseInt(_0x4dee3e(0xc6))/0x6*(parseInt(_0x4dee3e(0xad))/0x7)+parseInt(_0x4dee3e(0x103))/0x8*(parseInt(_0x4dee3e(0xdd))/0x9)+parseInt(_0x4dee3e(0xb1))/0xa*(-parseInt(_0x4dee3e(0x10d))/0xb)+-parseInt(_0x4dee3e(0xd9))/0xc;if(_0x1485e7===_0x50f2b1)break;else _0x5b647e['push'](_0x5b647e['shift']());}catch(_0x5cfb14){_0x5b647e['push'](_0x5b647e['shift']());}}}(a13_0x14bc,0x60490));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0x3441c2 from'chalk';function normalizeSchemaForDisplay(_0x5cf0ae){const _0x47273d=a13_0x2971,_0x3eb18e=_0x5cf0ae[_0x47273d(0xbc)]||[],_0x397fe0=_0x3eb18e[_0x47273d(0xba)](_0x196e97=>_0x196e97[_0x47273d(0xaa)]==='legacy_settings'&&_0x196e97[_0x47273d(0xab)]==='record'&&_0x196e97[_0x47273d(0xbc)]);if(_0x397fe0?.[_0x47273d(0xbc)]){const _0x45d0f4=_0x3eb18e[_0x47273d(0xcb)](_0x154d82=>_0x154d82[_0x47273d(0xaa)]!==_0x47273d(0xf3)&&_0x154d82[_0x47273d(0xaa)]!=='legacy_settings');return[..._0x45d0f4,..._0x397fe0[_0x47273d(0xbc)]];}return _0x3eb18e[_0x47273d(0xcb)](_0x3ccf93=>_0x3ccf93['name']!==_0x47273d(0xf3));}function printSchemaFields(_0xcf665d,_0x58837a){const _0x59e594=a13_0x2971,_0x4c1354='\x20\x20'[_0x59e594(0xcd)](_0x58837a+0x1),_0x3e4760='\x20\x20'[_0x59e594(0xcd)](_0x58837a+0x2);for(const _0x745963 of _0xcf665d){if(!_0x745963[_0x59e594(0xaa)])continue;const _0xda251=_0x745963[_0x59e594(0xab)]==='record'&&_0x745963[_0x59e594(0xbc)]&&_0x745963['properties'][_0x59e594(0xeb)]>0x0&&_0x745963[_0x59e594(0xaa)]!==_0x59e594(0xf7);let _0x7f9cf0=''+_0x4c1354+a13_0x3441c2[_0x59e594(0x116)](_0x745963['name']);_0x745963[_0x59e594(0xe6)]&&(_0x7f9cf0+=':\x20'+_0x745963[_0x59e594(0xe6)]);if(_0x745963[_0x59e594(0x105)])_0x7f9cf0+=a13_0x3441c2[_0x59e594(0xbe)]('\x20['+_0x745963['input']+']');else _0xda251&&(_0x7f9cf0+=a13_0x3441c2[_0x59e594(0xbe)](_0x59e594(0xe4)));console['log'](_0x7f9cf0);_0x745963[_0x59e594(0xed)]&&console[_0x59e594(0x11a)](''+_0x3e4760+a13_0x3441c2[_0x59e594(0xbe)](_0x745963[_0x59e594(0xed)]));if(_0x745963['enumeration']){const _0x5a90a7=_0x745963[_0x59e594(0xdb)][_0x59e594(0xbd)](_0x18f034=>typeof _0x18f034==='object'&&'value'in _0x18f034?_0x18f034[_0x59e594(0xbf)]:_0x18f034)['join'](',\x20');console[_0x59e594(0x11a)](_0x3e4760+_0x59e594(0x10c)+a13_0x3441c2['yellow'](_0x5a90a7));}_0x745963['default_value']!==undefined&&console['log'](_0x3e4760+_0x59e594(0x10f)+a13_0x3441c2[_0x59e594(0xc4)](String(_0x745963['default_value'])));if(_0x745963[_0x59e594(0xf5)]!==undefined||_0x745963[_0x59e594(0xcc)]!==undefined){const _0x2699d5=_0x745963['minimum']!==undefined&&_0x745963[_0x59e594(0xcc)]!==undefined?_0x745963['minimum']+_0x59e594(0xde)+_0x745963[_0x59e594(0xcc)]:_0x745963[_0x59e594(0xf5)]!==undefined?_0x59e594(0xf0)+_0x745963['minimum']:_0x59e594(0xc5)+_0x745963['maximum'];console[_0x59e594(0x11a)](_0x3e4760+_0x59e594(0xd6)+a13_0x3441c2['blue'](_0x2699d5));}if(_0x745963[_0x59e594(0xfd)]){const _0x2199d9=Object[_0x59e594(0xd7)](_0x745963[_0x59e594(0xfd)])[_0x59e594(0xbd)](([_0x464a02,_0x2c8273])=>_0x464a02+'='+JSON['stringify'](_0x2c8273))['join'](',\x20');console[_0x59e594(0x11a)](''+_0x3e4760+a13_0x3441c2[_0x59e594(0xbe)]('Show\x20when:\x20'+_0x2199d9));}_0xda251&&_0x745963['properties']&&printSchemaFields(_0x745963[_0x59e594(0xbc)],_0x58837a+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0x39deb2(0xaa)]=a13_0x39deb2(0xdf);['description']=a13_0x39deb2(0x108);async[a13_0x39deb2(0xc1)](_0x4590b4){const _0x554fe4=a13_0x39deb2,{options:_0x434ee6,tdx:_0xb50487}=_0x4590b4;_0x434ee6[_0x554fe4(0xf9)]&&console[_0x554fe4(0xa8)]('Site:\x20'+_0x434ee6['site']);const _0x1c2168=resolveLimit(_0x434ee6[_0x554fe4(0xda)],DEFAULT_LISTING_LIMIT),_0x25fde5=await withSpinner(_0x554fe4(0xa7),()=>_0xb50487['connection'][_0x554fe4(0x109)](),{'verbose':_0x434ee6[_0x554fe4(0xf9)]}),_0x20fece=_0x25fde5[_0x554fe4(0xb3)];console[_0x554fe4(0xa8)](_0x554fe4(0x115)+_0x20fece[_0x554fe4(0xeb)]+_0x554fe4(0xec)+(_0x20fece['length']!==0x1?'s':''));if(isStructuredFormat(_0x434ee6)){const _0x49a427=_0x20fece['slice'](0x0,_0x1c2168);await handleSDKOutput(_0x49a427,{..._0x434ee6,'limit':_0x1c2168});}else{const _0x29f7dd=_0x20fece[_0x554fe4(0xeb)]>0x0?Math[_0x554fe4(0xb5)](..._0x20fece[_0x554fe4(0xbd)](_0x2e6fdc=>_0x2e6fdc[_0x554fe4(0xab)][_0x554fe4(0xeb)])):0x0,_0x1e0792=[];for(const _0x312557 of _0x20fece){const _0x115981=a13_0x3441c2[_0x554fe4(0xa6)](_0x312557[_0x554fe4(0xab)][_0x554fe4(0x110)](_0x29f7dd)),_0x3b802e=_0x312557['owner']?.[_0x554fe4(0xaa)]?'\x20-\x20'+a13_0x3441c2[_0x554fe4(0xbe)](_0x312557[_0x554fe4(0xb4)][_0x554fe4(0xaa)]):'';_0x1e0792[_0x554fe4(0xc9)](_0x115981+'\x20\x20'+_0x312557['name']+_0x3b802e);}await writeOutput(_0x1e0792[_0x554fe4(0x111)]('\x0a'),_0x434ee6[_0x554fe4(0x10b)],_0x554fe4(0xc0));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']=a13_0x39deb2(0x113);['description']=a13_0x39deb2(0xfe);['validate'](_0x1a0669){const _0x114fac=a13_0x39deb2,{args:_0x601907}=_0x1a0669;if(!_0x601907[0x0])return _0x114fac(0xd0);return undefined;}async[a13_0x39deb2(0xc1)](_0x414027){const _0x5c4922=a13_0x39deb2,{options:_0x5bc054,args:_0x48b72,tdx:_0x31a0f0}=_0x414027,_0x359846=_0x48b72[0x0];_0x5bc054[_0x5c4922(0xf9)]&&(console[_0x5c4922(0xa8)](_0x5c4922(0xc3)+_0x5bc054['site']),console[_0x5c4922(0xa8)](_0x5c4922(0xf6)+_0x359846));const _0x2a78eb=await withSpinner(_0x5c4922(0xd5)+_0x359846+_0x5c4922(0xe8),()=>_0x31a0f0['connection'][_0x5c4922(0x118)](_0x359846),{'verbose':_0x5bc054[_0x5c4922(0xf9)]}),_0x400677=_0x2a78eb['data'];return console['error'](_0x5c4922(0xbb)+_0x400677[_0x5c4922(0xaa)]),await handleSingleObjectOutput(_0x400677,_0x5bc054),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a13_0x39deb2(0xaa)]='connection:schema';[a13_0x39deb2(0xed)]=a13_0x39deb2(0xd2);[a13_0x39deb2(0xaf)](_0x9f8ff4){const _0x21e188=a13_0x39deb2,{args:_0xb69b3d}=_0x9f8ff4;if(!_0xb69b3d[0x0])return _0x21e188(0xb7);return undefined;}async[a13_0x39deb2(0xc1)](_0x361b8d){const _0x3d4bd0=a13_0x39deb2,{options:_0x553949,args:_0xbb25b2,tdx:_0x400b6f}=_0x361b8d,_0x2d5d8f=_0xbb25b2[0x0];_0x553949['verbose']&&(console[_0x3d4bd0(0xa8)]('Site:\x20'+_0x553949['site']),console[_0x3d4bd0(0xa8)](_0x3d4bd0(0xee)+_0x2d5d8f));let _0x1ea3a4=_0x2d5d8f,_0x4e4952;try{const _0x69ed15=await _0x400b6f[_0x3d4bd0(0xb2)][_0x3d4bd0(0xc8)](_0x2d5d8f);_0x69ed15&&(_0x1ea3a4=_0x69ed15['type'],_0x4e4952=_0x69ed15[_0x3d4bd0(0xaa)],_0x553949['verbose']&&console[_0x3d4bd0(0xa8)](_0x3d4bd0(0xb9)+_0x2d5d8f+_0x3d4bd0(0xfb)+_0x1ea3a4));}catch{_0x553949[_0x3d4bd0(0xf9)]&&console[_0x3d4bd0(0xa8)](_0x3d4bd0(0xae)+_0x2d5d8f+_0x3d4bd0(0xd3));}const _0x3ab9ff=await withSpinner(_0x3d4bd0(0xe5)+_0x1ea3a4+_0x3d4bd0(0xe8),()=>_0x400b6f['connection']['getOutputSchema'](_0x1ea3a4),{'verbose':_0x553949[_0x3d4bd0(0xf9)]}),_0x2b16ff=_0x3ab9ff[_0x3d4bd0(0xb3)];_0x4e4952?console[_0x3d4bd0(0xa8)](_0x3d4bd0(0x114)+_0x4e4952+_0x3d4bd0(0xf1)+_0x1ea3a4+')'):console[_0x3d4bd0(0xa8)](_0x3d4bd0(0xd8)+_0x1ea3a4);if(isStructuredFormat(_0x553949))await handleSingleObjectOutput(_0x2b16ff,_0x553949);else{const _0x4ec3ab=normalizeSchemaForDisplay(_0x2b16ff);_0x4e4952?(console['log'](_0x3d4bd0(0xdc)+a13_0x3441c2['cyan'](_0x4e4952)),console[_0x3d4bd0(0x11a)](_0x3d4bd0(0x10e)+a13_0x3441c2[_0x3d4bd0(0xbe)](_0x1ea3a4))):console['log'](_0x3d4bd0(0xf8)+a13_0x3441c2[_0x3d4bd0(0xa6)](_0x1ea3a4)),_0x4ec3ab[_0x3d4bd0(0xeb)]>0x0?(console[_0x3d4bd0(0x11a)](a13_0x3441c2[_0x3d4bd0(0xea)](_0x3d4bd0(0xc2))),printSchemaFields(_0x4ec3ab,0x0)):console[_0x3d4bd0(0x11a)](a13_0x3441c2[_0x3d4bd0(0xbe)](_0x3d4bd0(0xac)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0x39deb2(0xaa)]=a13_0x39deb2(0xfa);[a13_0x39deb2(0xed)]=a13_0x39deb2(0x100);async[a13_0x39deb2(0xc1)](_0x4937bd){const _0x2407ba=a13_0x39deb2,{options:_0x10d2dc,tdx:_0x2b731c}=_0x4937bd;_0x10d2dc[_0x2407ba(0xf9)]&&console[_0x2407ba(0xa8)](_0x2407ba(0xc3)+_0x10d2dc[_0x2407ba(0xe2)]);const _0x1ef7d3=await withSpinner(_0x2407ba(0x117),()=>_0x2b731c[_0x2407ba(0xb2)][_0x2407ba(0x106)](),{'verbose':_0x10d2dc['verbose']}),_0x3662ec=_0x1ef7d3[_0x2407ba(0xb3)][_0x2407ba(0xfc)]((_0x1aa885,_0x51f83d)=>_0x1aa885[_0x2407ba(0xab)][_0x2407ba(0xb0)](_0x51f83d[_0x2407ba(0xab)]));console[_0x2407ba(0xa8)](_0x2407ba(0x115)+_0x3662ec[_0x2407ba(0xeb)]+'\x20connector\x20type'+(_0x3662ec[_0x2407ba(0xeb)]!==0x1?'s':''));if(isStructuredFormat(_0x10d2dc))await handleSDKOutput(_0x3662ec,_0x10d2dc);else{const _0x4b4900=_0x3662ec[_0x2407ba(0xeb)]>0x0?Math['max'](..._0x3662ec[_0x2407ba(0xbd)](_0x2e3475=>_0x2e3475['type'][_0x2407ba(0xeb)])):0x0,_0x4b3ae8=[];for(const _0x5801dc of _0x3662ec){const _0x2e9280=a13_0x3441c2[_0x2407ba(0xa6)](_0x5801dc[_0x2407ba(0xab)]['padStart'](_0x4b4900));_0x4b3ae8[_0x2407ba(0xc9)](_0x2e9280+'\x20\x20'+_0x5801dc[_0x2407ba(0xaa)]);}await writeOutput(_0x4b3ae8['join']('\x0a'),_0x10d2dc[_0x2407ba(0x10b)],_0x2407ba(0xc0));}return 0x0;}}function a13_0x2971(_0x2ba4d1,_0xf50ea6){_0x2ba4d1=_0x2ba4d1-0xa6;const _0x14bcad=a13_0x14bc();let _0x2971b4=_0x14bcad[_0x2ba4d1];return _0x2971b4;}function a13_0x14bc(){const _0x4ff6fa=['Looking\x20up\x20connection:\x20','legacy_settings','\x0aConnector:\x20','verbose','connection:types','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','sort','criteria','Show\x20connection\x20details','options','List\x20available\x20connector\x20types','settings','1410112ZEZCNf','551944QBAQRV','\x20\x20\x20\x20Default:\x20','input','listTypes','connection:settings','List\x20all\x20result\x20output\x20connections','list','\x20\x20\x20\x20','output','Options:\x20','66YspJqi','Type:\x20','Default:\x20','padStart','join','default_value','connection:show','✔\x20Found\x20schema\x20for\x20connection\x20\x27','✔\x20Found\x20','green','Listing\x20connector\x20types...','resolve','stringify','log','cyan','Listing\x20connections...','error','Fetching\x20settings\x20for\x20\x27','name','type','\x0aNo\x20fields\x20defined\x20in\x20schema','31199aAKlXV','Treating\x20\x27','validate','localeCompare','739870kezphb','connection','data','owner','max','\x0aCredential\x20settings:','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.','label','✔\x20Resolved\x20\x27','find','✔\x20Found\x20connection:\x20','properties','map','dim','value','table','execute','\x0aAvailable\x20fields:','Site:\x20','blue','<=\x20','126OndiCo','2XBdeRx','findByName','push','Name:\x20','filter','maximum','repeat','Show\x20when:\x20','\x0aNo\x20credential\x20settings\x20defined','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','No\x20available\x20fields\x20for\x20this\x20connector','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','\x27\x20as\x20connector\x20type','hint','Fetching\x20connection\x20\x27','Range:\x20','entries','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','2806776rrMhHz','limit','enumeration','\x0aConnection:\x20','9ctCzvi','\x20-\x20','connection:list','Fetching\x20settings\x20for\x20connector\x20type:\x20','getOutputSchema','site','679986ghpjpe','\x20[record]','Fetching\x20schema\x20for\x20\x27','title','hidden','\x27...','yellow','bold','length','\x20connection','description','Resolving\x20connector\x20type\x20or\x20name:\x20','5ePHJby','>=\x20','\x27\x20(type:\x20','330424IEnTYS','legacy','credential','minimum'];a13_0x14bc=function(){return _0x4ff6fa;};return a13_0x14bc();}export class ConnectionSettingsCommand extends BaseCommand{['name']=a13_0x39deb2(0x107);[a13_0x39deb2(0xed)]='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';['validate'](_0x826950){const {args:_0x3d593d}=_0x826950;if(!_0x3d593d[0x0])return'Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.';return undefined;}async[a13_0x39deb2(0xc1)](_0x5a64e4){const _0x2aa5f5=a13_0x39deb2,{options:_0x436b37,args:_0xac875b,tdx:_0x271ed2}=_0x5a64e4,_0x5fd635=_0xac875b[0x0];_0x436b37[_0x2aa5f5(0xf9)]&&(console[_0x2aa5f5(0xa8)](_0x2aa5f5(0xc3)+_0x436b37[_0x2aa5f5(0xe2)]),console[_0x2aa5f5(0xa8)](_0x2aa5f5(0xe0)+_0x5fd635));const _0x1abb51=await withSpinner(_0x2aa5f5(0xa9)+_0x5fd635+_0x2aa5f5(0xe8),()=>_0x271ed2[_0x2aa5f5(0xb2)]['getMetadata'](_0x5fd635),{'verbose':_0x436b37[_0x2aa5f5(0xf9)]}),_0x473b1a=_0x1abb51[_0x2aa5f5(0xb3)];console[_0x2aa5f5(0xa8)]('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x5fd635);if(isStructuredFormat(_0x436b37))await handleSingleObjectOutput(_0x473b1a,_0x436b37);else{console[_0x2aa5f5(0x11a)](_0x2aa5f5(0xf8)+a13_0x3441c2[_0x2aa5f5(0xa6)](_0x5fd635)),console[_0x2aa5f5(0x11a)](_0x2aa5f5(0xca)+_0x473b1a[_0x2aa5f5(0xaa)]);const _0x3806f8=_0x473b1a[_0x2aa5f5(0x101)]||[],_0x387581=_0x3806f8[_0x2aa5f5(0xcb)](_0x328af0=>_0x328af0[_0x2aa5f5(0xf4)]);_0x387581[_0x2aa5f5(0xeb)]>0x0&&(console[_0x2aa5f5(0x11a)](a13_0x3441c2[_0x2aa5f5(0xea)](_0x2aa5f5(0xb6))),printMetadataSettings(_0x387581));let _0x59d0eb=![];try{const _0x181041=await _0x271ed2[_0x2aa5f5(0xb2)][_0x2aa5f5(0xe1)](_0x5fd635),_0x5a85c1=normalizeSchemaForDisplay(_0x181041);_0x5a85c1[_0x2aa5f5(0xeb)]>0x0&&(console['log'](a13_0x3441c2['bold'](_0x2aa5f5(0xc2))),printSchemaFields(_0x5a85c1,0x0),_0x59d0eb=!![]);}catch{const _0x3532d8=_0x3806f8[_0x2aa5f5(0xcb)](_0x392bfd=>!_0x392bfd[_0x2aa5f5(0xf4)]);_0x3532d8['length']>0x0&&(console['log'](a13_0x3441c2[_0x2aa5f5(0xea)](_0x2aa5f5(0xc2))),printMetadataSettings(_0x3532d8),_0x59d0eb=!![]);}!_0x59d0eb&&_0x436b37[_0x2aa5f5(0xf9)]&&console[_0x2aa5f5(0xa8)](a13_0x3441c2['dim'](_0x2aa5f5(0xd1))),_0x387581['length']===0x0&&console[_0x2aa5f5(0x11a)](a13_0x3441c2[_0x2aa5f5(0xbe)](_0x2aa5f5(0xcf)));}return 0x0;}}function printMetadataSettings(_0x5eea53){const _0x151614=a13_0x39deb2;for(const _0x57c56d of _0x5eea53){if(!_0x57c56d[_0x151614(0xaa)])continue;if(_0x57c56d[_0x151614(0xe7)])continue;let _0x287366='\x20\x20'+a13_0x3441c2['green'](_0x57c56d[_0x151614(0xaa)]);_0x57c56d[_0x151614(0xb8)]&&(_0x287366+=':\x20'+_0x57c56d['label']);_0x57c56d['type']&&(_0x287366+=a13_0x3441c2[_0x151614(0xbe)]('\x20['+_0x57c56d[_0x151614(0xab)]+']'));console[_0x151614(0x11a)](_0x287366);_0x57c56d[_0x151614(0xd4)]&&console['log'](_0x151614(0x10a)+a13_0x3441c2['dim'](_0x57c56d['hint']));if(_0x57c56d[_0x151614(0xff)]){const _0x2dc642=_0x57c56d[_0x151614(0xff)][_0x151614(0xbd)](_0x472545=>_0x472545[_0x151614(0xbf)])[_0x151614(0x111)](',\x20');console[_0x151614(0x11a)]('\x20\x20\x20\x20Options:\x20'+a13_0x3441c2[_0x151614(0xe9)](_0x2dc642));}_0x57c56d[_0x151614(0x112)]!==undefined&&_0x57c56d[_0x151614(0x112)]!==null&&console['log'](_0x151614(0x104)+a13_0x3441c2['blue'](String(_0x57c56d[_0x151614(0x112)])));if(_0x57c56d[_0x151614(0xfd)]){const _0x51e54d=Object[_0x151614(0xd7)](_0x57c56d[_0x151614(0xfd)])[_0x151614(0xbd)](([_0x57dcb6,_0x1f18d3])=>_0x57dcb6+'='+JSON[_0x151614(0x119)](_0x1f18d3))[_0x151614(0x111)](',\x20');console[_0x151614(0x11a)](_0x151614(0x10a)+a13_0x3441c2[_0x151614(0xbe)](_0x151614(0xce)+_0x51e54d));}}}
1
+ const a13_0xd9b9aa=a13_0x3495;(function(_0x5618d4,_0x1015f3){const _0x7670d4=a13_0x3495,_0x2b60ff=_0x5618d4();while(!![]){try{const _0x40f83b=-parseInt(_0x7670d4(0x159))/0x1+parseInt(_0x7670d4(0x194))/0x2+-parseInt(_0x7670d4(0x149))/0x3+-parseInt(_0x7670d4(0x176))/0x4+parseInt(_0x7670d4(0x13a))/0x5*(-parseInt(_0x7670d4(0x15b))/0x6)+-parseInt(_0x7670d4(0x16d))/0x7+parseInt(_0x7670d4(0x139))/0x8;if(_0x40f83b===_0x1015f3)break;else _0x2b60ff['push'](_0x2b60ff['shift']());}catch(_0x43f29e){_0x2b60ff['push'](_0x2b60ff['shift']());}}}(a13_0x5f2a,0xf180d));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a13_0xd998b8 from'chalk';function normalizeSchemaForDisplay(_0x2fe0b0){const _0x459bce=a13_0x3495,_0x208444=_0x2fe0b0['properties']||[],_0x120243=_0x208444[_0x459bce(0x163)](_0x2ffa0c=>_0x2ffa0c[_0x459bce(0x191)]===_0x459bce(0x17e)&&_0x2ffa0c[_0x459bce(0x15a)]===_0x459bce(0x140)&&_0x2ffa0c['properties']);if(_0x120243?.[_0x459bce(0x18f)]){const _0x222230=_0x208444['filter'](_0x17c765=>_0x17c765['name']!==_0x459bce(0x14b)&&_0x17c765[_0x459bce(0x191)]!==_0x459bce(0x17e));return[..._0x222230,..._0x120243[_0x459bce(0x18f)]];}return _0x208444['filter'](_0x455afb=>_0x455afb[_0x459bce(0x191)]!=='legacy');}function printSchemaFields(_0x2eb5d2,_0x240b3c){const _0x42b372=a13_0x3495,_0x588c16='\x20\x20'[_0x42b372(0x18b)](_0x240b3c+0x1),_0xc2c697='\x20\x20'[_0x42b372(0x18b)](_0x240b3c+0x2);for(const _0x5d1785 of _0x2eb5d2){if(!_0x5d1785[_0x42b372(0x191)])continue;const _0x1b5663=_0x5d1785['type']===_0x42b372(0x140)&&_0x5d1785[_0x42b372(0x18f)]&&_0x5d1785[_0x42b372(0x18f)][_0x42b372(0x14c)]>0x0&&_0x5d1785[_0x42b372(0x191)]!==_0x42b372(0x17e);let _0x41de79=''+_0x588c16+a13_0xd998b8[_0x42b372(0x19b)](_0x5d1785[_0x42b372(0x191)]);_0x5d1785[_0x42b372(0x184)]&&(_0x41de79+=':\x20'+_0x5d1785['title']);if(_0x5d1785['input'])_0x41de79+=a13_0xd998b8[_0x42b372(0x178)]('\x20['+_0x5d1785[_0x42b372(0x195)]+']');else _0x1b5663&&(_0x41de79+=a13_0xd998b8['dim']('\x20[record]'));console[_0x42b372(0x171)](_0x41de79);_0x5d1785['description']&&console[_0x42b372(0x171)](''+_0xc2c697+a13_0xd998b8[_0x42b372(0x178)](_0x5d1785['description']));if(_0x5d1785[_0x42b372(0x141)]){const _0x2e151a=_0x5d1785[_0x42b372(0x141)][_0x42b372(0x19c)](_0x44df2e=>typeof _0x44df2e===_0x42b372(0x19e)&&_0x42b372(0x18a)in _0x44df2e?_0x44df2e[_0x42b372(0x18a)]:_0x44df2e)[_0x42b372(0x144)](',\x20');console[_0x42b372(0x171)](_0xc2c697+_0x42b372(0x16a)+a13_0xd998b8[_0x42b372(0x175)](_0x2e151a));}_0x5d1785[_0x42b372(0x17d)]!==undefined&&console[_0x42b372(0x171)](_0xc2c697+_0x42b372(0x15f)+a13_0xd998b8[_0x42b372(0x188)](String(_0x5d1785['default_value'])));if(_0x5d1785[_0x42b372(0x169)]!==undefined||_0x5d1785[_0x42b372(0x142)]!==undefined){const _0x97883d=_0x5d1785[_0x42b372(0x169)]!==undefined&&_0x5d1785[_0x42b372(0x142)]!==undefined?_0x5d1785[_0x42b372(0x169)]+'\x20-\x20'+_0x5d1785[_0x42b372(0x142)]:_0x5d1785[_0x42b372(0x169)]!==undefined?'>=\x20'+_0x5d1785[_0x42b372(0x169)]:_0x42b372(0x14a)+_0x5d1785[_0x42b372(0x142)];console[_0x42b372(0x171)](_0xc2c697+_0x42b372(0x161)+a13_0xd998b8[_0x42b372(0x188)](_0x97883d));}if(_0x5d1785[_0x42b372(0x151)]){const _0x5ed6af=Object[_0x42b372(0x173)](_0x5d1785['criteria'])[_0x42b372(0x19c)](([_0x3749bc,_0x1f6050])=>_0x3749bc+'='+JSON['stringify'](_0x1f6050))[_0x42b372(0x144)](',\x20');console[_0x42b372(0x171)](''+_0xc2c697+a13_0xd998b8['dim'](_0x42b372(0x17a)+_0x5ed6af));}_0x1b5663&&_0x5d1785['properties']&&printSchemaFields(_0x5d1785[_0x42b372(0x18f)],_0x240b3c+0x1);}}export class ConnectionListCommand extends BaseCommand{[a13_0xd9b9aa(0x191)]=a13_0xd9b9aa(0x153);[a13_0xd9b9aa(0x15c)]=a13_0xd9b9aa(0x14d);async[a13_0xd9b9aa(0x146)](_0x2fca9c){const _0xac8795=a13_0xd9b9aa,{options:_0x314d4a,tdx:_0x58a734}=_0x2fca9c;_0x314d4a[_0xac8795(0x157)]&&console[_0xac8795(0x183)]('Site:\x20'+_0x314d4a['site']);const _0x37f2c9=resolveLimit(_0x314d4a[_0xac8795(0x18d)],DEFAULT_LISTING_LIMIT),_0x3c3330=await withSpinner('Listing\x20connections...',()=>_0x58a734['connection']['list'](),{'verbose':_0x314d4a[_0xac8795(0x157)]}),_0x4630e4=_0x3c3330['data'];console[_0xac8795(0x183)](_0xac8795(0x16f)+_0x4630e4['length']+_0xac8795(0x152)+(_0x4630e4['length']!==0x1?'s':''));if(isStructuredFormat(_0x314d4a)){const _0x118301=_0x4630e4[_0xac8795(0x17c)](0x0,_0x37f2c9);await handleSDKOutput(_0x118301,{..._0x314d4a,'limit':_0x37f2c9});}else{const _0x13abc9=_0x4630e4[_0xac8795(0x14c)]>0x0?Math[_0xac8795(0x172)](..._0x4630e4[_0xac8795(0x19c)](_0x2d7fa4=>_0x2d7fa4[_0xac8795(0x15a)]['length'])):0x0,_0x2659d2=[];for(const _0x219f1e of _0x4630e4){const _0x25d795=a13_0xd998b8[_0xac8795(0x190)](_0x219f1e[_0xac8795(0x15a)][_0xac8795(0x145)](_0x13abc9)),_0xce62e5=_0x219f1e[_0xac8795(0x15d)]?.[_0xac8795(0x191)]?'\x20-\x20'+a13_0xd998b8[_0xac8795(0x178)](_0x219f1e[_0xac8795(0x15d)]['name']):'';_0x2659d2[_0xac8795(0x162)](_0x25d795+'\x20\x20'+_0x219f1e[_0xac8795(0x191)]+_0xce62e5);}await writeOutput(_0x2659d2[_0xac8795(0x144)]('\x0a'),_0x314d4a[_0xac8795(0x170)],_0xac8795(0x19a));}return 0x0;}}function a13_0x5f2a(){const _0x2627df=['hint','minimum','Options:\x20','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','\x0aConnector:\x20','13122487vcguxY','\x0aAvailable\x20fields:','✔\x20Found\x20','output','log','max','entries','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.','yellow','5862936fREElH','✔\x20Resolved\x20\x27','dim','localeCompare','Show\x20when:\x20','bold','slice','default_value','legacy_settings','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','\x20connector\x20type','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.','Site:\x20','error','title','\x20\x20\x20\x20Options:\x20','Resolving\x20connector\x20type\x20or\x20name:\x20','Type:\x20','blue','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','value','repeat','\x20\x20\x20\x20','limit','resolve','properties','cyan','name','\x0aCredential\x20settings:','✔\x20Found\x20schema\x20for\x20connection\x20\x27','1927482GPjWqh','input','settings','Fetching\x20settings\x20for\x20\x27','data','connection:show','table','green','map','\x27\x20as\x20connector\x20type','object','sort','64863080ClnRwz','354495BEnIuU','hidden','listTypes','\x20\x20\x20\x20Default:\x20','List\x20available\x20connector\x20types','connection:settings','record','enumeration','maximum','site','join','padStart','execute','label','filter','4332636ZOuqqu','<=\x20','legacy','length','List\x20all\x20result\x20output\x20connections','validate','Looking\x20up\x20connection:\x20','\x0aNo\x20fields\x20defined\x20in\x20schema','criteria','\x20connection','connection:list','getOutputSchema','\x0aNo\x20credential\x20settings\x20defined','\x27...','verbose','Name:\x20','1879862mggyuP','type','120SChFTb','description','owner','Treating\x20\x27','Default:\x20','stringify','Range:\x20','push','find','getMetadata','Fetching\x20connection\x20\x27','credential','connection'];a13_0x5f2a=function(){return _0x2627df;};return a13_0x5f2a();}export class ConnectionShowCommand extends BaseCommand{['name']=a13_0xd9b9aa(0x199);['description']='Show\x20connection\x20details';[a13_0xd9b9aa(0x14e)](_0x516e13){const _0x257eec=a13_0xd9b9aa,{args:_0x53802b}=_0x516e13;if(!_0x53802b[0x0])return _0x257eec(0x17f);return undefined;}async[a13_0xd9b9aa(0x146)](_0x37a5a9){const _0x30f846=a13_0xd9b9aa,{options:_0x5e8972,args:_0x464935,tdx:_0xde4f1c}=_0x37a5a9,_0x28c031=_0x464935[0x0];_0x5e8972[_0x30f846(0x157)]&&(console[_0x30f846(0x183)]('Site:\x20'+_0x5e8972[_0x30f846(0x143)]),console[_0x30f846(0x183)](_0x30f846(0x14f)+_0x28c031));const _0x2c74f4=await withSpinner(_0x30f846(0x165)+_0x28c031+_0x30f846(0x156),()=>_0xde4f1c[_0x30f846(0x167)][_0x30f846(0x18e)](_0x28c031),{'verbose':_0x5e8972[_0x30f846(0x157)]}),_0x495258=_0x2c74f4[_0x30f846(0x198)];return console[_0x30f846(0x183)]('✔\x20Found\x20connection:\x20'+_0x495258[_0x30f846(0x191)]),await handleSingleObjectOutput(_0x495258,_0x5e8972),0x0;}}function a13_0x3495(_0x1cc983,_0x2a9d01){_0x1cc983=_0x1cc983-0x139;const _0x5f2a37=a13_0x5f2a();let _0x34952e=_0x5f2a37[_0x1cc983];return _0x34952e;}export class ConnectionSchemaCommand extends BaseCommand{['name']='connection:schema';[a13_0xd9b9aa(0x15c)]=a13_0xd9b9aa(0x189);[a13_0xd9b9aa(0x14e)](_0x379222){const _0x7cffa7=a13_0xd9b9aa,{args:_0x4848ee}=_0x379222;if(!_0x4848ee[0x0])return _0x7cffa7(0x174);return undefined;}async[a13_0xd9b9aa(0x146)](_0x47ad0c){const _0x4542b9=a13_0xd9b9aa,{options:_0x684b71,args:_0x549265,tdx:_0x1b4589}=_0x47ad0c,_0x73ab20=_0x549265[0x0];_0x684b71[_0x4542b9(0x157)]&&(console['error']('Site:\x20'+_0x684b71[_0x4542b9(0x143)]),console['error'](_0x4542b9(0x186)+_0x73ab20));let _0x461e2b=_0x73ab20,_0x3ae802;try{const _0x40982b=await _0x1b4589[_0x4542b9(0x167)]['findByName'](_0x73ab20);_0x40982b&&(_0x461e2b=_0x40982b[_0x4542b9(0x15a)],_0x3ae802=_0x40982b[_0x4542b9(0x191)],_0x684b71['verbose']&&console[_0x4542b9(0x183)](_0x4542b9(0x177)+_0x73ab20+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x461e2b));}catch{_0x684b71[_0x4542b9(0x157)]&&console[_0x4542b9(0x183)](_0x4542b9(0x15e)+_0x73ab20+_0x4542b9(0x19d));}const _0x53125b=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x461e2b+_0x4542b9(0x156),()=>_0x1b4589[_0x4542b9(0x167)][_0x4542b9(0x154)](_0x461e2b),{'verbose':_0x684b71[_0x4542b9(0x157)]}),_0x201653=_0x53125b['data'];_0x3ae802?console['error'](_0x4542b9(0x193)+_0x3ae802+'\x27\x20(type:\x20'+_0x461e2b+')'):console['error'](_0x4542b9(0x16b)+_0x461e2b);if(isStructuredFormat(_0x684b71))await handleSingleObjectOutput(_0x201653,_0x684b71);else{const _0x5d7ba3=normalizeSchemaForDisplay(_0x201653);_0x3ae802?(console[_0x4542b9(0x171)]('\x0aConnection:\x20'+a13_0xd998b8[_0x4542b9(0x190)](_0x3ae802)),console[_0x4542b9(0x171)](_0x4542b9(0x187)+a13_0xd998b8[_0x4542b9(0x178)](_0x461e2b))):console[_0x4542b9(0x171)](_0x4542b9(0x16c)+a13_0xd998b8['cyan'](_0x461e2b)),_0x5d7ba3[_0x4542b9(0x14c)]>0x0?(console['log'](a13_0xd998b8[_0x4542b9(0x17b)](_0x4542b9(0x16e))),printSchemaFields(_0x5d7ba3,0x0)):console[_0x4542b9(0x171)](a13_0xd998b8[_0x4542b9(0x178)](_0x4542b9(0x150)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a13_0xd9b9aa(0x191)]='connection:types';[a13_0xd9b9aa(0x15c)]=a13_0xd9b9aa(0x13e);async[a13_0xd9b9aa(0x146)](_0x1a6906){const _0x14bcfc=a13_0xd9b9aa,{options:_0x481372,tdx:_0x4fb536}=_0x1a6906;_0x481372['verbose']&&console['error'](_0x14bcfc(0x182)+_0x481372[_0x14bcfc(0x143)]);const _0xe71392=await withSpinner('Listing\x20connector\x20types...',()=>_0x4fb536[_0x14bcfc(0x167)][_0x14bcfc(0x13c)](),{'verbose':_0x481372[_0x14bcfc(0x157)]}),_0x5e5af5=_0xe71392[_0x14bcfc(0x198)][_0x14bcfc(0x19f)]((_0x5eaa22,_0x565640)=>_0x5eaa22[_0x14bcfc(0x15a)][_0x14bcfc(0x179)](_0x565640[_0x14bcfc(0x15a)]));console[_0x14bcfc(0x183)](_0x14bcfc(0x16f)+_0x5e5af5[_0x14bcfc(0x14c)]+_0x14bcfc(0x180)+(_0x5e5af5[_0x14bcfc(0x14c)]!==0x1?'s':''));if(isStructuredFormat(_0x481372))await handleSDKOutput(_0x5e5af5,_0x481372);else{const _0x2dd532=_0x5e5af5['length']>0x0?Math[_0x14bcfc(0x172)](..._0x5e5af5[_0x14bcfc(0x19c)](_0x6a8ba3=>_0x6a8ba3[_0x14bcfc(0x15a)]['length'])):0x0,_0x9c966b=[];for(const _0x5100c2 of _0x5e5af5){const _0x355e96=a13_0xd998b8[_0x14bcfc(0x190)](_0x5100c2['type']['padStart'](_0x2dd532));_0x9c966b[_0x14bcfc(0x162)](_0x355e96+'\x20\x20'+_0x5100c2[_0x14bcfc(0x191)]);}await writeOutput(_0x9c966b['join']('\x0a'),_0x481372[_0x14bcfc(0x170)],_0x14bcfc(0x19a));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a13_0xd9b9aa(0x191)]=a13_0xd9b9aa(0x13f);[a13_0xd9b9aa(0x15c)]='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';[a13_0xd9b9aa(0x14e)](_0x497840){const _0x1ac805=a13_0xd9b9aa,{args:_0x4ffd73}=_0x497840;if(!_0x4ffd73[0x0])return _0x1ac805(0x181);return undefined;}async[a13_0xd9b9aa(0x146)](_0x3798ea){const _0x4fc102=a13_0xd9b9aa,{options:_0x4c695a,args:_0x12f579,tdx:_0x499a8a}=_0x3798ea,_0x163d15=_0x12f579[0x0];_0x4c695a[_0x4fc102(0x157)]&&(console[_0x4fc102(0x183)](_0x4fc102(0x182)+_0x4c695a[_0x4fc102(0x143)]),console['error']('Fetching\x20settings\x20for\x20connector\x20type:\x20'+_0x163d15));const _0x5ea225=await withSpinner(_0x4fc102(0x197)+_0x163d15+_0x4fc102(0x156),()=>_0x499a8a['connection'][_0x4fc102(0x164)](_0x163d15),{'verbose':_0x4c695a[_0x4fc102(0x157)]}),_0x5a1ba1=_0x5ea225[_0x4fc102(0x198)];console[_0x4fc102(0x183)]('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x163d15);if(isStructuredFormat(_0x4c695a))await handleSingleObjectOutput(_0x5a1ba1,_0x4c695a);else{console[_0x4fc102(0x171)](_0x4fc102(0x16c)+a13_0xd998b8[_0x4fc102(0x190)](_0x163d15)),console[_0x4fc102(0x171)](_0x4fc102(0x158)+_0x5a1ba1[_0x4fc102(0x191)]);const _0x5793c3=_0x5a1ba1[_0x4fc102(0x196)]||[],_0x1bdf37=_0x5793c3[_0x4fc102(0x148)](_0x32f2a3=>_0x32f2a3[_0x4fc102(0x166)]);_0x1bdf37[_0x4fc102(0x14c)]>0x0&&(console[_0x4fc102(0x171)](a13_0xd998b8[_0x4fc102(0x17b)](_0x4fc102(0x192))),printMetadataSettings(_0x1bdf37));let _0x31b319=![];try{const _0x591da3=await _0x499a8a[_0x4fc102(0x167)][_0x4fc102(0x154)](_0x163d15),_0x126302=normalizeSchemaForDisplay(_0x591da3);_0x126302['length']>0x0&&(console['log'](a13_0xd998b8[_0x4fc102(0x17b)](_0x4fc102(0x16e))),printSchemaFields(_0x126302,0x0),_0x31b319=!![]);}catch{const _0x2701c0=_0x5793c3['filter'](_0x140bd7=>!_0x140bd7[_0x4fc102(0x166)]);_0x2701c0['length']>0x0&&(console['log'](a13_0xd998b8[_0x4fc102(0x17b)](_0x4fc102(0x16e))),printMetadataSettings(_0x2701c0),_0x31b319=!![]);}!_0x31b319&&_0x4c695a[_0x4fc102(0x157)]&&console['error'](a13_0xd998b8['dim']('No\x20available\x20fields\x20for\x20this\x20connector')),_0x1bdf37[_0x4fc102(0x14c)]===0x0&&console[_0x4fc102(0x171)](a13_0xd998b8[_0x4fc102(0x178)](_0x4fc102(0x155)));}return 0x0;}}function printMetadataSettings(_0x1dc867){const _0x73e37d=a13_0xd9b9aa;for(const _0x56f83f of _0x1dc867){if(!_0x56f83f[_0x73e37d(0x191)])continue;if(_0x56f83f[_0x73e37d(0x13b)])continue;let _0x1b3157='\x20\x20'+a13_0xd998b8[_0x73e37d(0x19b)](_0x56f83f[_0x73e37d(0x191)]);_0x56f83f[_0x73e37d(0x147)]&&(_0x1b3157+=':\x20'+_0x56f83f['label']);_0x56f83f['type']&&(_0x1b3157+=a13_0xd998b8[_0x73e37d(0x178)]('\x20['+_0x56f83f[_0x73e37d(0x15a)]+']'));console[_0x73e37d(0x171)](_0x1b3157);_0x56f83f[_0x73e37d(0x168)]&&console[_0x73e37d(0x171)](_0x73e37d(0x18c)+a13_0xd998b8[_0x73e37d(0x178)](_0x56f83f[_0x73e37d(0x168)]));if(_0x56f83f['options']){const _0xcda3e5=_0x56f83f['options'][_0x73e37d(0x19c)](_0x210795=>_0x210795[_0x73e37d(0x18a)])[_0x73e37d(0x144)](',\x20');console[_0x73e37d(0x171)](_0x73e37d(0x185)+a13_0xd998b8[_0x73e37d(0x175)](_0xcda3e5));}_0x56f83f[_0x73e37d(0x17d)]!==undefined&&_0x56f83f[_0x73e37d(0x17d)]!==null&&console['log'](_0x73e37d(0x13d)+a13_0xd998b8['blue'](String(_0x56f83f[_0x73e37d(0x17d)])));if(_0x56f83f[_0x73e37d(0x151)]){const _0x5776f8=Object['entries'](_0x56f83f[_0x73e37d(0x151)])[_0x73e37d(0x19c)](([_0x15aebd,_0x3111e7])=>_0x15aebd+'='+JSON[_0x73e37d(0x160)](_0x3111e7))['join'](',\x20');console[_0x73e37d(0x171)](_0x73e37d(0x18c)+a13_0xd998b8[_0x73e37d(0x178)](_0x73e37d(0x17a)+_0x5776f8));}}}
@@ -1 +1 @@
1
- function a14_0x363b(){const _0x1e6e89=['length','1079133rptlce','\x20\x20Cause:\x20','execute','✔\x20Found\x20','listDatabases','\x20database','site','cause','1264833cMvTkg','622084kkTTzM','132808vDHTAg','Listing\x20databases...','261JLUGMp','databases','query','2MSMluN','Site:\x20','description','Pattern:\x20','2424288Ijoxrp','verbose','message','1578685ZlmGtD','4709334UsloGB','error'];a14_0x363b=function(){return _0x1e6e89;};return a14_0x363b();}const a14_0x5024c7=a14_0x19c6;(function(_0x39f9b1,_0x32f05a){const _0x8733ae=a14_0x19c6,_0x551b88=_0x39f9b1();while(!![]){try{const _0x5e0e87=parseInt(_0x8733ae(0x1c3))/0x1*(parseInt(_0x8733ae(0x1d2))/0x2)+parseInt(_0x8733ae(0x1cb))/0x3+-parseInt(_0x8733ae(0x1cc))/0x4+-parseInt(_0x8733ae(0x1bf))/0x5+-parseInt(_0x8733ae(0x1bc))/0x6+parseInt(_0x8733ae(0x1c0))/0x7+-parseInt(_0x8733ae(0x1cd))/0x8*(parseInt(_0x8733ae(0x1cf))/0x9);if(_0x5e0e87===_0x32f05a)break;else _0x551b88['push'](_0x551b88['shift']());}catch(_0x4312ab){_0x551b88['push'](_0x551b88['shift']());}}}(a14_0x363b,0xc7683));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a14_0x19c6(_0x33b7c8,_0x10f2c3){_0x33b7c8=_0x33b7c8-0x1ba;const _0x363b0a=a14_0x363b();let _0x19c6f1=_0x363b0a[_0x33b7c8];return _0x19c6f1;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{['name']=a14_0x5024c7(0x1d0);[a14_0x5024c7(0x1ba)]='List\x20all\x20databases';async[a14_0x5024c7(0x1c5)](_0x3cdfdf){const _0x4eb50d=a14_0x5024c7,{options:_0x5089a3,args:_0x36c127,tdx:_0x148b36}=_0x3cdfdf,_0x523402=_0x36c127[0x0];try{_0x5089a3[_0x4eb50d(0x1bd)]&&(console['error'](_0x4eb50d(0x1d3)+_0x5089a3[_0x4eb50d(0x1c9)]),_0x523402&&console[_0x4eb50d(0x1c1)](_0x4eb50d(0x1bb)+_0x523402));const _0x16f1f2=resolveLimit(_0x5089a3['limit'],DEFAULT_LISTING_LIMIT),_0x345d75=await withSpinner(_0x4eb50d(0x1ce),()=>_0x148b36[_0x4eb50d(0x1d1)][_0x4eb50d(0x1c7)](_0x523402,_0x16f1f2),{'verbose':_0x5089a3[_0x4eb50d(0x1bd)]}),_0x228135=_0x345d75['data'];return console['error'](_0x4eb50d(0x1c6)+_0x228135[_0x4eb50d(0x1c2)]+_0x4eb50d(0x1c8)+(_0x228135[_0x4eb50d(0x1c2)]!==0x1?'s':'')),await handleSDKOutput(_0x228135,{..._0x5089a3,'limit':_0x16f1f2}),0x0;}catch(_0x18c5b5){if(_0x18c5b5 instanceof SDKError)return console[_0x4eb50d(0x1c1)]('Error:\x20'+_0x18c5b5[_0x4eb50d(0x1be)]),_0x18c5b5[_0x4eb50d(0x1ca)]&&console[_0x4eb50d(0x1c1)](_0x4eb50d(0x1c4)+_0x18c5b5[_0x4eb50d(0x1ca)]),0x1;throw _0x18c5b5;}}}
1
+ const a14_0x5b00f6=a14_0x56dd;function a14_0x56dd(_0x3a99c8,_0xce1e9a){_0x3a99c8=_0x3a99c8-0xe8;const _0x5aa961=a14_0x5aa9();let _0x56dd83=_0x5aa961[_0x3a99c8];return _0x56dd83;}(function(_0x3c55c7,_0xe1a9b6){const _0x560c82=a14_0x56dd,_0x286d7b=_0x3c55c7();while(!![]){try{const _0x35ab1e=parseInt(_0x560c82(0xfd))/0x1*(-parseInt(_0x560c82(0xea))/0x2)+parseInt(_0x560c82(0xf9))/0x3*(-parseInt(_0x560c82(0xed))/0x4)+parseInt(_0x560c82(0xf2))/0x5*(parseInt(_0x560c82(0xe8))/0x6)+parseInt(_0x560c82(0xf1))/0x7+parseInt(_0x560c82(0x106))/0x8*(-parseInt(_0x560c82(0xec))/0x9)+parseInt(_0x560c82(0xfc))/0xa*(-parseInt(_0x560c82(0xfe))/0xb)+parseInt(_0x560c82(0xf3))/0xc;if(_0x35ab1e===_0xe1a9b6)break;else _0x286d7b['push'](_0x286d7b['shift']());}catch(_0x4e086e){_0x286d7b['push'](_0x286d7b['shift']());}}}(a14_0x5aa9,0xd8bfa));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a14_0x5aa9(){const _0x4a9418=['length','listDatabases','5025090hpZUgD','1515vKHWCp','32523060yeECNq','\x20\x20Cause:\x20','execute','cause','limit','query','3EcVNas','site','name','1010340zvqeAS','394187VUmQmE','99rDYRRz','error','Error:\x20','description','✔\x20Found\x20','Listing\x20databases...','data','Site:\x20','64pCroun','31908cytUwm','\x20database','6ogFZhz','List\x20all\x20databases','826857Bzeioy','5299304XXiNop','verbose'];a14_0x5aa9=function(){return _0x4a9418;};return a14_0x5aa9();}export class DatabasesCommand extends BaseCommand{[a14_0x5b00f6(0xfb)]='databases';[a14_0x5b00f6(0x101)]=a14_0x5b00f6(0xeb);async[a14_0x5b00f6(0xf5)](_0x51aabb){const _0x2f8aa5=a14_0x5b00f6,{options:_0x12b0ce,args:_0x4a9374,tdx:_0x4b2806}=_0x51aabb,_0x50a15a=_0x4a9374[0x0];try{_0x12b0ce['verbose']&&(console['error'](_0x2f8aa5(0x105)+_0x12b0ce[_0x2f8aa5(0xfa)]),_0x50a15a&&console['error']('Pattern:\x20'+_0x50a15a));const _0x4018c7=resolveLimit(_0x12b0ce[_0x2f8aa5(0xf7)],DEFAULT_LISTING_LIMIT),_0x541122=await withSpinner(_0x2f8aa5(0x103),()=>_0x4b2806[_0x2f8aa5(0xf8)][_0x2f8aa5(0xf0)](_0x50a15a,_0x4018c7),{'verbose':_0x12b0ce[_0x2f8aa5(0xee)]}),_0x1f2fea=_0x541122[_0x2f8aa5(0x104)];return console[_0x2f8aa5(0xff)](_0x2f8aa5(0x102)+_0x1f2fea[_0x2f8aa5(0xef)]+_0x2f8aa5(0xe9)+(_0x1f2fea['length']!==0x1?'s':'')),await handleSDKOutput(_0x1f2fea,{..._0x12b0ce,'limit':_0x4018c7}),0x0;}catch(_0x37cede){if(_0x37cede instanceof SDKError)return console[_0x2f8aa5(0xff)](_0x2f8aa5(0x100)+_0x37cede['message']),_0x37cede[_0x2f8aa5(0xf6)]&&console[_0x2f8aa5(0xff)](_0x2f8aa5(0xf4)+_0x37cede[_0x2f8aa5(0xf6)]),0x1;throw _0x37cede;}}}
@@ -1 +1 @@
1
- const a15_0x317e3e=a15_0x3505;(function(_0x194258,_0x58f857){const _0x55f479=a15_0x3505,_0x3acc9d=_0x194258();while(!![]){try{const _0x2bc3dd=-parseInt(_0x55f479(0x1b6))/0x1*(-parseInt(_0x55f479(0x1b4))/0x2)+parseInt(_0x55f479(0x1b3))/0x3*(-parseInt(_0x55f479(0x1a7))/0x4)+parseInt(_0x55f479(0x195))/0x5+-parseInt(_0x55f479(0x19b))/0x6*(-parseInt(_0x55f479(0x196))/0x7)+parseInt(_0x55f479(0x1bb))/0x8+parseInt(_0x55f479(0x1b7))/0x9+-parseInt(_0x55f479(0x1ae))/0xa*(parseInt(_0x55f479(0x1a1))/0xb);if(_0x2bc3dd===_0x58f857)break;else _0x3acc9d['push'](_0x3acc9d['shift']());}catch(_0x4bef95){_0x3acc9d['push'](_0x3acc9d['shift']());}}}(a15_0x3802,0xb3f59));function a15_0x3505(_0x1bcaf1,_0x38fc15){_0x1bcaf1=_0x1bcaf1-0x195;const _0x38021e=a15_0x3802();let _0x350523=_0x38021e[_0x1bcaf1];return _0x350523;}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 a15_0x3802(){const _0x2c1e9a=['Error:\x20','351150BjbfDX','error','\x20in\x20','describeTable','Table\x20\x27','3tTKNyW','2EzOGRg','data','102488ybQJiu','697392MfBmIX','table','length','database','5380000EkVHWc','Describing\x20table\x20','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','4019005yrnkqg','7830074fVtIzs','validate','Describe\x20table\x20schema','✖\x20Table\x20not\x20found','name','6DEduZO','cause','verbose','\x20column','query','Site:\x20','627KFMiwo','\x27\x20does\x20not\x20exist','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','\x20\x20Cause:\x20','site','✔\x20Found\x20','144764eXgTTT','...','Table:\x20','args','describe','message'];a15_0x3802=function(){return _0x2c1e9a;};return a15_0x3802();}import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x317e3e(0x19a)]=a15_0x317e3e(0x1ab);['description']=a15_0x317e3e(0x198);async['execute'](_0x98a92e){const _0x58c660=a15_0x317e3e;return this[_0x58c660(0x1b1)](_0x98a92e);}async['describeTable'](_0xa73d1a){const _0x217445=a15_0x317e3e,{options:_0xcd602d,args:_0x29bb16,tdx:_0x10b545}=_0xa73d1a;let _0x5cb2df;try{_0x5cb2df=parseTableReference(_0x29bb16[0x0]);const _0x4e974b=_0xcd602d['database'];!_0x5cb2df[_0x217445(0x1ba)]&&_0x4e974b&&(_0x5cb2df[_0x217445(0x1ba)]=_0x4e974b);const _0x3d6f6d=validateTableDescribeReference(_0x5cb2df);if(_0x3d6f6d)return console[_0x217445(0x1af)](_0x217445(0x1ad)+_0x3d6f6d),0x1;}catch(_0xdd9637){return console[_0x217445(0x1af)](_0x217445(0x1ad)+_0xdd9637[_0x217445(0x1ac)]),0x1;}const _0x4a8dee=_0x5cb2df[_0x217445(0x1ba)],_0x377a55=_0x5cb2df[_0x217445(0x1b8)];try{_0xcd602d[_0x217445(0x19d)]&&(console[_0x217445(0x1af)](_0x217445(0x1a0)+_0xcd602d[_0x217445(0x1a5)]),console[_0x217445(0x1af)]('Database:\x20'+_0x4a8dee),console[_0x217445(0x1af)](_0x217445(0x1a9)+_0x377a55));const _0x58dc0d=await withSpinner(_0x217445(0x1bc)+_0x4a8dee+'.'+_0x377a55+_0x217445(0x1a8),()=>_0x10b545[_0x217445(0x19f)]['describeTable'](_0x4a8dee,_0x377a55),{'verbose':_0xcd602d['verbose']}),_0x395062=_0x58dc0d[_0x217445(0x1b5)];if(_0x395062['length']===0x0)return console[_0x217445(0x1af)](_0x217445(0x199)),console[_0x217445(0x1af)](_0x217445(0x1b2)+_0x4a8dee+'.'+_0x377a55+_0x217445(0x1a2)),0x1;return console['error'](_0x217445(0x1a6)+_0x395062[_0x217445(0x1b9)]+_0x217445(0x19e)+(_0x395062['length']!==0x1?'s':'')+_0x217445(0x1b0)+_0x4a8dee+'.'+_0x377a55),await handleSDKOutput(_0x395062,_0xcd602d),0x0;}catch(_0x3aefb8){if(_0x3aefb8 instanceof SDKError)return console[_0x217445(0x1af)](_0x217445(0x1ad)+_0x3aefb8[_0x217445(0x1ac)]),_0x3aefb8[_0x217445(0x19c)]&&console[_0x217445(0x1af)](_0x217445(0x1a4)+_0x3aefb8[_0x217445(0x19c)]),0x1;throw _0x3aefb8;}}[a15_0x317e3e(0x197)](_0x239fe3){const _0x484339=a15_0x317e3e;if(_0x239fe3[_0x484339(0x1aa)][_0x484339(0x1b9)]===0x0)return _0x484339(0x1bd);if(_0x239fe3[_0x484339(0x1aa)][_0x484339(0x1b9)]>0x1)return _0x484339(0x1a3);return undefined;}}
1
+ const a15_0x4e39c9=a15_0x4fd5;function a15_0x4fd5(_0x57711b,_0x350544){_0x57711b=_0x57711b-0x95;const _0x440ade=a15_0x440a();let _0x4fd52d=_0x440ade[_0x57711b];return _0x4fd52d;}(function(_0x5f2111,_0x506e16){const _0x40e242=a15_0x4fd5,_0x6e8144=_0x5f2111();while(!![]){try{const _0x4eddf0=-parseInt(_0x40e242(0xb4))/0x1+-parseInt(_0x40e242(0xa6))/0x2*(-parseInt(_0x40e242(0xb2))/0x3)+parseInt(_0x40e242(0xac))/0x4*(-parseInt(_0x40e242(0xb0))/0x5)+-parseInt(_0x40e242(0x9f))/0x6*(-parseInt(_0x40e242(0x9a))/0x7)+parseInt(_0x40e242(0x98))/0x8+parseInt(_0x40e242(0xb5))/0x9+-parseInt(_0x40e242(0xb3))/0xa*(-parseInt(_0x40e242(0x97))/0xb);if(_0x4eddf0===_0x506e16)break;else _0x6e8144['push'](_0x6e8144['shift']());}catch(_0x3cb455){_0x6e8144['push'](_0x6e8144['shift']());}}}(a15_0x440a,0x789ed));function a15_0x440a(){const _0x56500c=['validate','Error:\x20','args','...','6inhvLs','Database:\x20','describeTable','\x20\x20Cause:\x20','Describe\x20table\x20schema','site','\x20column','468190JLOZlN','Table:\x20','✖\x20Table\x20not\x20found','cause','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','32sqsFvR','description','verbose','data','89270XxcMOE','Site:\x20','3zbXnzW','191810wVtjVQ','972774NkXeGO','3686490qQaZau','database','name','✔\x20Found\x20','\x27\x20does\x20not\x20exist','error','165mBZkuj','2841696YVlGAx','\x20in\x20','2261245UnRIcs'];a15_0x440a=function(){return _0x56500c;};return a15_0x440a();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x4e39c9(0xb7)]='describe';[a15_0x4e39c9(0xad)]=a15_0x4e39c9(0xa3);async['execute'](_0x299c2f){const _0xa9e03=a15_0x4e39c9;return this[_0xa9e03(0xa1)](_0x299c2f);}async[a15_0x4e39c9(0xa1)](_0x2248a4){const _0x2b3bfe=a15_0x4e39c9,{options:_0x5bc9f3,args:_0x10c286,tdx:_0x1d1296}=_0x2248a4;let _0x16af60;try{_0x16af60=parseTableReference(_0x10c286[0x0]);const _0x350064=_0x5bc9f3[_0x2b3bfe(0xb6)];!_0x16af60[_0x2b3bfe(0xb6)]&&_0x350064&&(_0x16af60['database']=_0x350064);const _0x2d45a9=validateTableDescribeReference(_0x16af60);if(_0x2d45a9)return console[_0x2b3bfe(0x96)](_0x2b3bfe(0x9c)+_0x2d45a9),0x1;}catch(_0x4e2502){return console[_0x2b3bfe(0x96)](_0x2b3bfe(0x9c)+_0x4e2502['message']),0x1;}const _0x4f778d=_0x16af60[_0x2b3bfe(0xb6)],_0x47fc2d=_0x16af60['table'];try{_0x5bc9f3[_0x2b3bfe(0xae)]&&(console[_0x2b3bfe(0x96)](_0x2b3bfe(0xb1)+_0x5bc9f3[_0x2b3bfe(0xa4)]),console['error'](_0x2b3bfe(0xa0)+_0x4f778d),console['error'](_0x2b3bfe(0xa7)+_0x47fc2d));const _0x23e2b8=await withSpinner('Describing\x20table\x20'+_0x4f778d+'.'+_0x47fc2d+_0x2b3bfe(0x9e),()=>_0x1d1296['query']['describeTable'](_0x4f778d,_0x47fc2d),{'verbose':_0x5bc9f3[_0x2b3bfe(0xae)]}),_0xe2a161=_0x23e2b8[_0x2b3bfe(0xaf)];if(_0xe2a161[_0x2b3bfe(0xaa)]===0x0)return console[_0x2b3bfe(0x96)](_0x2b3bfe(0xa8)),console[_0x2b3bfe(0x96)]('Table\x20\x27'+_0x4f778d+'.'+_0x47fc2d+_0x2b3bfe(0x95)),0x1;return console['error'](_0x2b3bfe(0xb8)+_0xe2a161['length']+_0x2b3bfe(0xa5)+(_0xe2a161[_0x2b3bfe(0xaa)]!==0x1?'s':'')+_0x2b3bfe(0x99)+_0x4f778d+'.'+_0x47fc2d),await handleSDKOutput(_0xe2a161,_0x5bc9f3),0x0;}catch(_0x42e358){if(_0x42e358 instanceof SDKError)return console[_0x2b3bfe(0x96)](_0x2b3bfe(0x9c)+_0x42e358['message']),_0x42e358[_0x2b3bfe(0xa9)]&&console[_0x2b3bfe(0x96)](_0x2b3bfe(0xa2)+_0x42e358['cause']),0x1;throw _0x42e358;}}[a15_0x4e39c9(0x9b)](_0x1e008a){const _0x4d513f=a15_0x4e39c9;if(_0x1e008a[_0x4d513f(0x9d)][_0x4d513f(0xaa)]===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(_0x1e008a[_0x4d513f(0x9d)][_0x4d513f(0xaa)]>0x1)return _0x4d513f(0xab);return undefined;}}