@treasuredata/tdx 2026.5.1 → 2026.6.0

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 (228) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/table-deleted.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/tools/work-create-item.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/cas/cas-api-client.js +1 -1
  94. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  95. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  96. package/dist/sdk/cas/index.js +1 -1
  97. package/dist/sdk/cas/pull-workflow.js +1 -1
  98. package/dist/sdk/cas/push-workflow.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js +1 -1
  100. package/dist/sdk/client/delivery-api-client.js +1 -1
  101. package/dist/sdk/client/endpoints.js +1 -1
  102. package/dist/sdk/client/engage-api-client.js +1 -1
  103. package/dist/sdk/client/http-client.js +1 -1
  104. package/dist/sdk/client/llm-api-client.js +1 -1
  105. package/dist/sdk/client/oauth-refresh.js +1 -1
  106. package/dist/sdk/client/rate-limiter.js +1 -1
  107. package/dist/sdk/client/td-api-client.js +1 -1
  108. package/dist/sdk/client/trino-api-client.js +1 -1
  109. package/dist/sdk/client/workflow-client.js +1 -1
  110. package/dist/sdk/connection-validator.js +1 -1
  111. package/dist/sdk/connection.js +1 -1
  112. package/dist/sdk/delivery.js +1 -1
  113. package/dist/sdk/engage/campaign-pull.js +1 -1
  114. package/dist/sdk/engage/campaign-push.js +1 -1
  115. package/dist/sdk/engage/campaign-validator.js +1 -1
  116. package/dist/sdk/engage/campaign-yaml.js +1 -1
  117. package/dist/sdk/engage/template-pull.js +1 -1
  118. package/dist/sdk/engage/template-push.js +1 -1
  119. package/dist/sdk/engage/template-validator.js +1 -1
  120. package/dist/sdk/engage/template-yaml.js +1 -1
  121. package/dist/sdk/engage/types/campaign-def.js +1 -1
  122. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  123. package/dist/sdk/engage/types/template-schema.js +1 -1
  124. package/dist/sdk/engage.js +1 -1
  125. package/dist/sdk/errors.js +1 -1
  126. package/dist/sdk/index.js +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/llm/user-settings.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/deleted-table-validation.js +1 -1
  139. package/dist/sdk/query/index.js +1 -1
  140. package/dist/sdk/query/sql-parser.js +1 -1
  141. package/dist/sdk/realtime.js +1 -1
  142. package/dist/sdk/schedule.js +1 -1
  143. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  144. package/dist/sdk/segment/fields-display.js +1 -1
  145. package/dist/sdk/segment/file-discovery.js +1 -1
  146. package/dist/sdk/segment/journey-utils.js +1 -1
  147. package/dist/sdk/segment/journey-validator.js +1 -1
  148. package/dist/sdk/segment/journey-yaml.js +1 -1
  149. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  150. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  151. package/dist/sdk/segment/pull-workflow.js +1 -1
  152. package/dist/sdk/segment/push-recovery.js +1 -1
  153. package/dist/sdk/segment/push-workflow.js +1 -1
  154. package/dist/sdk/segment/resolution-context.js +1 -1
  155. package/dist/sdk/segment/segment-path-parser.js +1 -1
  156. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  157. package/dist/sdk/segment/segment-validator.js +1 -1
  158. package/dist/sdk/segment/segment-validator.js.map +1 -1
  159. package/dist/sdk/segment/target-resolution.js +1 -1
  160. package/dist/sdk/segment/tdx-config.js +1 -1
  161. package/dist/sdk/segment/types/activation-schema.js +1 -1
  162. package/dist/sdk/segment/types/journey-def.js +1 -1
  163. package/dist/sdk/segment/types/journey-schema.js +1 -1
  164. package/dist/sdk/segment/types/segment-def.js +1 -1
  165. package/dist/sdk/segment/types/segment-schema.js +1 -1
  166. package/dist/sdk/segment/validate-files.js +1 -1
  167. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  168. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  169. package/dist/sdk/segment/yaml-validator.js +1 -1
  170. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  171. package/dist/sdk/segment.js +1 -1
  172. package/dist/sdk/types/index.js +1 -1
  173. package/dist/sdk/types/progress.js +1 -1
  174. package/dist/sdk/types/workspace.js +1 -1
  175. package/dist/sdk/user.js +1 -1
  176. package/dist/sdk/util/format-detector.js +1 -1
  177. package/dist/sdk/util/formatters.js +1 -1
  178. package/dist/sdk/util/index.js +1 -1
  179. package/dist/sdk/util/paginate.js +1 -1
  180. package/dist/sdk/util/tree-formatter.js +1 -1
  181. package/dist/sdk/workflow/archive-validation.js +1 -1
  182. package/dist/sdk/workflow/clone-workflow.js +1 -1
  183. package/dist/sdk/workflow/index.js +1 -1
  184. package/dist/sdk/workflow/pull-workflow.js +1 -1
  185. package/dist/sdk/workflow/push-workflow.js +1 -1
  186. package/dist/sdk/workflow/task-graph.js +1 -1
  187. package/dist/sdk/workflow/tdx-config.js +1 -1
  188. package/dist/sdk/workflow/workflow-utils.js +1 -1
  189. package/dist/sdk/workspace/access-tracker.js +1 -1
  190. package/dist/sdk/workspace/frontmatter.js +1 -1
  191. package/dist/sdk/workspace/git.js +1 -1
  192. package/dist/sdk/workspace/index.js +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +1 -1
@@ -1 +1 @@
1
- const a8_0x3721f4=a8_0x120d;(function(_0x170e57,_0x10a181){const _0x306991=a8_0x120d,_0x3ced2f=_0x170e57();while(!![]){try{const _0x29360a=parseInt(_0x306991(0xae))/0x1+-parseInt(_0x306991(0x6b))/0x2+parseInt(_0x306991(0xce))/0x3*(parseInt(_0x306991(0x90))/0x4)+parseInt(_0x306991(0x86))/0x5*(-parseInt(_0x306991(0x7b))/0x6)+-parseInt(_0x306991(0xb6))/0x7*(parseInt(_0x306991(0x94))/0x8)+parseInt(_0x306991(0x69))/0x9+-parseInt(_0x306991(0x9f))/0xa;if(_0x29360a===_0x10a181)break;else _0x3ced2f['push'](_0x3ced2f['shift']());}catch(_0x5c9622){_0x3ced2f['push'](_0x3ced2f['shift']());}}}(a8_0x2f4e,0x3ec1c));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a8_0x120d(_0x34d0d2,_0x4d11ab){_0x34d0d2=_0x34d0d2-0x68;const _0x2f4ef0=a8_0x2f4e();let _0x120d22=_0x2f4ef0[_0x34d0d2];return _0x120d22;}import a8_0x4d3368 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x25ef28 from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';import{collectYamlFiles}from'../sdk/cas/push-workflow.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{[a8_0x3721f4(0xc9)]=a8_0x3721f4(0x9b);[a8_0x3721f4(0xb5)]=a8_0x3721f4(0xc0);async[a8_0x3721f4(0xa4)](_0x4b1ce6){const _0x30123c=a8_0x3721f4,{options:_0x31a745,tdx:_0x4328d3}=_0x4b1ce6,_0xc0eac6=await withProgressSpinner(_0x30123c(0xc2),()=>_0x4328d3[_0x30123c(0x8a)][_0x30123c(0x9a)](),{'verbose':_0x31a745[_0x30123c(0xb1)]}),_0x4c4976=_0xc0eac6['data'];if(isStructuredFormat(_0x31a745))return await handleSDKOutput(_0x4c4976,_0x31a745),0x0;if(_0x4c4976[_0x30123c(0xdb)]===0x0)return console[_0x30123c(0x7c)](a8_0x4d3368['dim'](_0x30123c(0xdc))),0x0;console[_0x30123c(0x7c)](a8_0x4d3368[_0x30123c(0x97)](_0x30123c(0x98)+_0x4c4976[_0x30123c(0xdb)]+_0x30123c(0x74)));for(const _0x2786ab of _0x4c4976){const _0x31bcb8=_0x2786ab[_0x30123c(0xcf)]?a8_0x4d3368['dim']('\x20('+Number(_0x2786ab['population'])[_0x30123c(0xc1)]()+')'):'',_0x143636=a8_0x4d3368[_0x30123c(0xac)]('\x20'+_0x2786ab[_0x30123c(0x7d)]+'.'+_0x2786ab['masterTable']);console[_0x30123c(0x7c)](_0x30123c(0x73)+_0x2786ab[_0x30123c(0xc9)]+_0x31bcb8+_0x143636),_0x2786ab[_0x30123c(0xb5)]&&console[_0x30123c(0x7c)]('\x20\x20'+a8_0x4d3368[_0x30123c(0xac)](_0x2786ab[_0x30123c(0xb5)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{['name']=a8_0x3721f4(0xb9);[a8_0x3721f4(0xb5)]='Describe\x20a\x20composable\x20audience';async['execute'](_0x25067d){const _0x4c105b=a8_0x3721f4,{options:_0x14dadc,args:_0x2457ce,tdx:_0x4822d5}=_0x25067d,_0x339654=_0x2457ce[0x0]||_0x14dadc[_0x4c105b(0x91)];if(!_0x339654)return console[_0x4c105b(0xb3)](a8_0x4d3368[_0x4c105b(0xca)](_0x4c105b(0xc6))),console['error'](_0x4c105b(0xbb)+a8_0x4d3368['cyan']('tdx\x20cas\x20desc\x20<name>')+_0x4c105b(0x93)+a8_0x4d3368[_0x4c105b(0xcd)](_0x4c105b(0x8f))),0x1;const _0x3c9ee3=await withProgressSpinner(_0x4c105b(0xaf)+_0x339654+_0x4c105b(0x76),()=>_0x4822d5[_0x4c105b(0x8a)][_0x4c105b(0xb7)](_0x339654),{'verbose':_0x14dadc[_0x4c105b(0xb1)]}),_0x34c820=_0x3c9ee3[_0x4c105b(0x87)];if(isStructuredFormat(_0x14dadc))return await handleSingleObjectOutput(_0x34c820,_0x14dadc),0x0;console[_0x4c105b(0x7c)](a8_0x4d3368[_0x4c105b(0x82)](_0x34c820[_0x4c105b(0xc9)]));if(_0x34c820['description'])console[_0x4c105b(0x7c)](a8_0x4d3368['dim'](_0x34c820[_0x4c105b(0xb5)]));console[_0x4c105b(0x7c)](),console[_0x4c105b(0x7c)](a8_0x4d3368['underline'](_0x4c105b(0xb4))),console[_0x4c105b(0x7c)](_0x4c105b(0x6a)+_0x34c820[_0x4c105b(0x7d)]),console[_0x4c105b(0x7c)](_0x4c105b(0xd2)+_0x34c820['masterTable']),console[_0x4c105b(0x7c)](_0x4c105b(0x72)+_0x34c820['masterKeyColumn']),console[_0x4c105b(0x7c)]();if(_0x34c820[_0x4c105b(0x7f)]?.['length']){console['log'](a8_0x4d3368['underline'](_0x4c105b(0xd3)+_0x34c820[_0x4c105b(0x7f)][_0x4c105b(0xdb)]+')'));for(const _0x3ed410 of _0x34c820['attributes']){console['log']('\x20\x20'+a8_0x4d3368[_0x4c105b(0x82)](_0x3ed410[_0x4c105b(0xc9)])+'\x20—\x20'+_0x3ed410['schema']+'.'+_0x3ed410['table']+'.'+_0x3ed410['column']+'\x20('+a8_0x4d3368[_0x4c105b(0xac)](_0x3ed410['type'])+')');}console[_0x4c105b(0x7c)]();}if(_0x34c820[_0x4c105b(0xc4)]?.[_0x4c105b(0xdb)]){console[_0x4c105b(0x7c)](a8_0x4d3368[_0x4c105b(0x8d)]('Behaviors\x20('+_0x34c820['behaviors']['length']+')'));for(const _0x20e9d7 of _0x34c820[_0x4c105b(0xc4)]){const _0x49a0c8=_0x20e9d7['timeColumn']?_0x4c105b(0x9c)+_0x20e9d7[_0x4c105b(0xa1)]+')':'';console[_0x4c105b(0x7c)]('\x20\x20'+a8_0x4d3368[_0x4c105b(0x82)](_0x20e9d7['name'])+_0x4c105b(0x83)+_0x20e9d7[_0x4c105b(0xa0)]+'.'+_0x20e9d7[_0x4c105b(0x80)]+_0x49a0c8);}}return 0x0;}}function a8_0x2f4e(){const _0x53277a=['length','No\x20composable\x20audiences\x20found.','All\x20files\x20are\x20up\x20to\x20date.','tdx\x20cas\x20pull\x20<name>','Pull\x20composable\x20audience\x20to\x20YAML\x20files','diff','counts','4619448JOTBWx','\x20\x20Schema:\x20','72886NUnxin','Preview\x20composable\x20segment\x20query\x20on\x20CDW','cas:pull','activations','cas:push','\x20segment(s)','dirname','\x20\x20Key:\x20\x20\x20\x20','🧊\x20','\x20composable\x20audiences','dir','\x27...','--audience\x20<name>','absolutePath','\x20activations)','segments','33780dUMExQ','log','masterSchema','map','attributes','table','Analyzing\x20CAS\x20YAML\x20files...','bold','\x20—\x20','Wrote\x20','\x20file(s)\x20to\x20write\x20','285JMivDM','data','Write\x20files?','hasChanges','cas','\x0aSample\x20Rows\x20(','Directory\x20not\x20found:\x20','underline','preview','tdx\x20use\x20cas\x20<name>','4MtGSZw','composableAudience','composable_audience','\x20or\x20set\x20context\x20with\x20','8JJnExh','isNew','Cancelled.','green','Found\x20','red','list','cas:list','\x20(time:\x20','audiences','files','3264160nAHQvn','schema','timeColumn','Running\x20preview\x20for\x20\x27','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','execute','rows','Push\x20YAML\x20files\x20to\x20CAS\x20API','join','content','\x20=\x20','relativePath','Pulling\x20composable\x20audience\x20\x27','dim','count','374119bUfPRe','Fetching\x20audience\x20\x27','audienceName','verbose','push','error','Master\x20Table','description','618814maJvda','get','Would\x20push:\x20','cas:desc','names','Use\x20','relative','Audience:\x20','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','dryRun','List\x20composable\x20audiences','toLocaleString','Fetching\x20composable\x20audiences...','cwd','behaviors','yes','No\x20composable\x20audience\x20specified.','tdx\x20cas\x20push\x20<path>','cas:preview','name','yellow','\x20activation(s)','pull','cyan','425496ATQcAS','population','filter','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','\x20\x20Table:\x20\x20','Attributes\x20(','success','\x20segments,\x20','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','status','setPhase','session','basename'];a8_0x2f4e=function(){return _0x53277a;};return a8_0x2f4e();}export class CASPullCommand extends BaseCommand{[a8_0x3721f4(0xc9)]=a8_0x3721f4(0x6d);[a8_0x3721f4(0xb5)]=a8_0x3721f4(0xdf);async['execute'](_0xa43ead){const _0xc770fc=a8_0x3721f4,{options:_0x13ab7d,args:_0x210578,tdx:_0x239d1f}=_0xa43ead,_0x3aa4c9=_0x13ab7d,_0xb51baf=_0x210578[0x0]||_0x13ab7d['composableAudience'];if(!_0xb51baf)return console[_0xc770fc(0xb3)](a8_0x4d3368[_0xc770fc(0xca)](_0xc770fc(0xc6))),console[_0xc770fc(0xb3)](_0xc770fc(0xbb)+a8_0x4d3368[_0xc770fc(0xcd)](_0xc770fc(0xde))+_0xc770fc(0x93)+a8_0x4d3368[_0xc770fc(0xcd)]('tdx\x20use\x20cas\x20<name>')),0x1;const _0x2f526d=_0x3aa4c9[_0xc770fc(0x75)]||a8_0x25ef28[_0xc770fc(0xa7)](process['cwd'](),_0xc770fc(0x8a),sanitizeFileName(_0xb51baf)),_0x816b3b=await withProgressSpinner(_0xc770fc(0xab)+_0xb51baf+_0xc770fc(0x76),_0x304dc4=>_0x239d1f[_0xc770fc(0x8a)][_0xc770fc(0xcc)](_0xb51baf,{'targetDir':_0x2f526d,'verbose':_0x3aa4c9[_0xc770fc(0xb1)],'progress':{'update':_0xf6c57c=>_0x304dc4['setPhase'](_0xf6c57c)}}),{'verbose':_0x3aa4c9[_0xc770fc(0xb1)]}),_0x517364=_0x816b3b[_0xc770fc(0x87)],_0xce8d6e=_0x517364[_0xc770fc(0x9e)][_0xc770fc(0xd0)](_0x319675=>_0x319675['isNew']||_0x319675[_0xc770fc(0x89)]);saveSessionContext({'composable_audience':_0x517364[_0xc770fc(0xb0)]},_0x3aa4c9[_0xc770fc(0xd9)]),console[_0xc770fc(0x7c)](a8_0x4d3368[_0xc770fc(0x97)]('Context\x20set:\x20'+a8_0x4d3368[_0xc770fc(0xac)](_0xc770fc(0x92))+_0xc770fc(0xa9)+a8_0x4d3368[_0xc770fc(0xcd)](_0x517364[_0xc770fc(0xb0)])));if(_0xce8d6e['length']===0x0)return console['log'](a8_0x4d3368[_0xc770fc(0x97)](_0xc770fc(0xdd))),0x0;for(const _0xfd7f4c of _0xce8d6e){if(_0xfd7f4c[_0xc770fc(0x95)])console[_0xc770fc(0x7c)](a8_0x4d3368[_0xc770fc(0x97)]('+\x20'+_0xfd7f4c[_0xc770fc(0xaa)]+'\x20(new)'));else _0xfd7f4c[_0xc770fc(0xe0)]&&(console[_0xc770fc(0x7c)](a8_0x4d3368[_0xc770fc(0xca)]('~\x20'+_0xfd7f4c[_0xc770fc(0xaa)])),console['log'](_0xfd7f4c['diff']));}console[_0xc770fc(0x7c)]('\x0a'+_0xce8d6e[_0xc770fc(0xdb)]+_0xc770fc(0x85)+('('+_0x517364[_0xc770fc(0x68)][_0xc770fc(0x7a)]+_0xc770fc(0xd5)+_0x517364[_0xc770fc(0x68)]['activations']+_0xc770fc(0x79)));if(_0x3aa4c9[_0xc770fc(0xbf)])return console[_0xc770fc(0x7c)](a8_0x4d3368['dim']('(dry\x20run\x20—\x20no\x20files\x20written)')),0x0;if(!_0x3aa4c9[_0xc770fc(0xc5)]&&isInteractive()){const _0x11715f=await confirmKey(_0xc770fc(0x88));if(!_0x11715f)return console[_0xc770fc(0x7c)](a8_0x4d3368[_0xc770fc(0xac)](_0xc770fc(0x96))),0x0;}for(const _0x3ccc1c of _0xce8d6e){const _0x19b53a=a8_0x25ef28[_0xc770fc(0x71)](_0x3ccc1c[_0xc770fc(0x78)]);if(!existsSync(_0x19b53a))mkdirSync(_0x19b53a,{'recursive':!![]});writeFileSync(_0x3ccc1c[_0xc770fc(0x78)],_0x3ccc1c[_0xc770fc(0xa8)],'utf-8');}return console['log'](a8_0x4d3368[_0xc770fc(0x97)](_0xc770fc(0x84)+_0xce8d6e[_0xc770fc(0xdb)]+'\x20file(s)\x20to\x20'+_0x2f526d)),0x0;}}export class CASPushCommand extends BaseCommand{['name']=a8_0x3721f4(0x6f);[a8_0x3721f4(0xb5)]=a8_0x3721f4(0xa6);async['execute'](_0x2b5389){const _0x323ce8=a8_0x3721f4,{options:_0x2f7c04,args:_0x365ded,tdx:_0x327431}=_0x2b5389,_0x4c1262=_0x2f7c04;let _0x4aad24=_0x365ded[0x0];!_0x4aad24&&_0x2f7c04[_0x323ce8(0x91)]&&(_0x4aad24=a8_0x25ef28[_0x323ce8(0xa7)](process[_0x323ce8(0xc3)](),_0x323ce8(0x8a),sanitizeFileName(_0x2f7c04[_0x323ce8(0x91)])));if(!_0x4aad24)return console[_0x323ce8(0xb3)](a8_0x4d3368[_0x323ce8(0xca)](_0x323ce8(0xc6))),console[_0x323ce8(0xb3)](_0x323ce8(0xbb)+a8_0x4d3368['cyan'](_0x323ce8(0xc7))+_0x323ce8(0x93)+a8_0x4d3368[_0x323ce8(0xcd)]('tdx\x20use\x20cas\x20<name>')),0x1;if(!existsSync(_0x4aad24))return console[_0x323ce8(0xb3)](a8_0x4d3368[_0x323ce8(0x99)](_0x323ce8(0x8c)+_0x4aad24)),console[_0x323ce8(0xb3)](a8_0x4d3368['dim'](_0x323ce8(0xa3))),0x1;const _0x577eb0=_0x2f7c04[_0x323ce8(0x91)]||a8_0x25ef28[_0x323ce8(0xda)](_0x4aad24),_0x5dd6e0=a8_0x25ef28[_0x323ce8(0xbc)](process['cwd'](),_0x4aad24)||'.';console['log'](_0x323ce8(0xbd)+a8_0x4d3368[_0x323ce8(0xcd)](_0x577eb0)),console[_0x323ce8(0x7c)]('Source:\x20\x20\x20'+a8_0x4d3368[_0x323ce8(0xac)](_0x5dd6e0)),console[_0x323ce8(0x7c)](a8_0x4d3368[_0x323ce8(0xca)]('\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.')),console['log']();const _0x3c0b90=collectYamlFiles(_0x4aad24);if(_0x3c0b90[_0x323ce8(0xdb)]===0x0)return console[_0x323ce8(0xb3)](a8_0x4d3368[_0x323ce8(0x99)]('No\x20YAML\x20files\x20found\x20in:\x20'+_0x4aad24)),0x1;console[_0x323ce8(0x7c)](_0x323ce8(0x98)+_0x3c0b90[_0x323ce8(0xdb)]+'\x20YAML\x20file(s)');const _0x488053=await withProgressSpinner(_0x323ce8(0x81),_0x224e26=>_0x327431['cas'][_0x323ce8(0xb2)](_0x3c0b90,{'dryRun':!![],'verbose':_0x4c1262['verbose'],'progress':{'update':_0x3e4673=>_0x224e26[_0x323ce8(0xd8)](_0x3e4673)}}),{'verbose':_0x4c1262[_0x323ce8(0xb1)]}),_0x4d1368=_0x488053['data'],{created:_0x5871bc}=_0x4d1368,_0x438486=[];if(_0x5871bc[_0x323ce8(0x9d)])_0x438486[_0x323ce8(0xb2)](_0x5871bc[_0x323ce8(0x9d)]+'\x20audience(s)');if(_0x5871bc[_0x323ce8(0x7a)])_0x438486['push'](_0x5871bc['segments']+_0x323ce8(0x70));if(_0x5871bc['activations'])_0x438486['push'](_0x5871bc[_0x323ce8(0x6e)]+_0x323ce8(0xcb));return _0x438486[_0x323ce8(0xdb)]===0x0?console[_0x323ce8(0x7c)](a8_0x4d3368[_0x323ce8(0xac)](_0x323ce8(0xbe))):console['log'](_0x323ce8(0xb8)+_0x438486[_0x323ce8(0xa7)](',\x20')),console['log'](a8_0x4d3368[_0x323ce8(0xac)](_0x323ce8(0xd1))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x3721f4(0xc9)]=a8_0x3721f4(0xc8);[a8_0x3721f4(0xb5)]=a8_0x3721f4(0x6c);async[a8_0x3721f4(0xa4)](_0x13a766){const _0x520763=a8_0x3721f4,{options:_0x3a21e6,args:_0xf930fe,tdx:_0x477d2d}=_0x13a766,_0x385df8=_0xf930fe[0x0],_0x5e07e9=_0xf930fe[0x1]||_0x3a21e6[_0x520763(0x91)];if(!_0x385df8)return console['error'](a8_0x4d3368['red'](_0x520763(0xd6))),0x1;if(!_0x5e07e9)return console[_0x520763(0xb3)](a8_0x4d3368[_0x520763(0xca)]('Audience\x20name\x20required.')),console['error'](_0x520763(0xbb)+a8_0x4d3368['cyan'](_0x520763(0x77))+_0x520763(0x93)+a8_0x4d3368['cyan'](_0x520763(0x8f))),0x1;const _0x8a9af8=await withProgressSpinner(_0x520763(0xa2)+_0x385df8+_0x520763(0x76),()=>_0x477d2d[_0x520763(0x8a)][_0x520763(0x8e)](_0x5e07e9,_0x385df8),{'verbose':_0x3a21e6[_0x520763(0xb1)]}),{query:_0x1b7cac,customers:_0xf290eb}=_0x8a9af8[_0x520763(0x87)];if(isStructuredFormat(_0x3a21e6))return await handleSingleObjectOutput({'query':_0x1b7cac,'customers':_0xf290eb},_0x3a21e6),0x0;const _0x1ef811=_0x1b7cac['status']===_0x520763(0xd4)?a8_0x4d3368[_0x520763(0x97)]:a8_0x4d3368[_0x520763(0xca)];console[_0x520763(0x7c)]('Status:\x20'+_0x1ef811(_0x1b7cac[_0x520763(0xd7)])),console[_0x520763(0x7c)]('Count:\x20\x20'+a8_0x4d3368[_0x520763(0x82)](String(_0x1b7cac[_0x520763(0xad)])));_0x1b7cac['error']&&console['log']('Error:\x20\x20'+a8_0x4d3368[_0x520763(0x99)](_0x1b7cac[_0x520763(0xb3)]));if(_0xf290eb?.['names']&&_0xf290eb?.[_0x520763(0xa5)]){console['log'](a8_0x4d3368[_0x520763(0x8d)](_0x520763(0x8b)+_0xf290eb['rows'][_0x520763(0xdb)]+')'));const _0x5ccb8c=_0xf290eb['rows'][_0x520763(0x7e)](_0x596196=>{const _0xd162bb=_0x520763,_0x374bd8={};for(let _0x20f0c8=0x0;_0x20f0c8<_0xf290eb[_0xd162bb(0xba)][_0xd162bb(0xdb)];_0x20f0c8++){_0x374bd8[_0xf290eb[_0xd162bb(0xba)][_0x20f0c8]]=_0x596196[_0x20f0c8];}return _0x374bd8;});await handleSDKOutput(_0x5ccb8c,_0x3a21e6);}return 0x0;}}
1
+ const a8_0xff32e8=a8_0x44b3;function a8_0x44b3(_0x38a0d5,_0x53b106){_0x38a0d5=_0x38a0d5-0x160;const _0x3ae103=a8_0x3ae1();let _0x44b36b=_0x3ae103[_0x38a0d5];return _0x44b36b;}(function(_0x385638,_0xc3fe31){const _0x50496=a8_0x44b3,_0x308fa4=_0x385638();while(!![]){try{const _0x142d21=-parseInt(_0x50496(0x1c4))/0x1+parseInt(_0x50496(0x1af))/0x2+-parseInt(_0x50496(0x17f))/0x3*(-parseInt(_0x50496(0x1bf))/0x4)+parseInt(_0x50496(0x195))/0x5*(parseInt(_0x50496(0x19e))/0x6)+parseInt(_0x50496(0x1c1))/0x7+parseInt(_0x50496(0x16d))/0x8*(-parseInt(_0x50496(0x166))/0x9)+-parseInt(_0x50496(0x18c))/0xa;if(_0x142d21===_0xc3fe31)break;else _0x308fa4['push'](_0x308fa4['shift']());}catch(_0x4aebb6){_0x308fa4['push'](_0x308fa4['shift']());}}}(a8_0x3ae1,0x9ad7a));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x1880f6 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x16cf90 from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';import{collectYamlFiles}from'../sdk/cas/push-workflow.js';import{saveSessionContext}from'../core/session.js';function a8_0x3ae1(){const _0x45b254=['status','tdx\x20cas\x20pull\x20<name>','Attributes\x20(','list','231456DzHyfF','execute','8035769RTSMNX','masterTable','\x20file(s)\x20to\x20write\x20','925488kAQRAD','\x27...','Wrote\x20','No\x20composable\x20audience\x20specified.','basename','join','No\x20composable\x20audiences\x20found.','composable_audience','population','underline','content','audienceName','Running\x20preview\x20for\x20\x27','push','masterSchema','rows','table','\x20or\x20set\x20context\x20with\x20','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','log','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','42363iCaBZe','map','names','Directory\x20not\x20found:\x20','setPhase','\x20\x20Schema:\x20','attributes','2008GGzgtT','utf-8','Fetching\x20audience\x20\x27','Context\x20set:\x20','hasChanges','filter','preview','isNew','get','cyan','\x20(time:\x20','--audience\x20<name>','diff','\x20—\x20','error','\x20(new)','absolutePath','Preview\x20composable\x20segment\x20query\x20on\x20CDW','21fpoMAb','yellow','timeColumn','data','segments','cas:pull','Found\x20','length','Source:\x20\x20\x20','relative','audiences','Push\x20YAML\x20files\x20to\x20CAS\x20API','verbose','9166650UuQBkO','Use\x20','session','relativePath','Describe\x20a\x20composable\x20audience','Behaviors\x20(','activations','description','\x20audience(s)','671155rsIilj','Fetching\x20composable\x20audiences...','green','counts','tdx\x20use\x20cas\x20<name>','masterKeyColumn','\x20YAML\x20file(s)','schema','cas:desc','48xpPSPn','files','type','behaviors','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','\x20\x20Table:\x20\x20','count','dim','cas','red','(dry\x20run\x20—\x20no\x20files\x20written)','cwd','tdx\x20cas\x20push\x20<path>','composableAudience','toLocaleString','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','Audience\x20name\x20required.','2061962czNbCk','Would\x20push:\x20','Cancelled.','yes','List\x20composable\x20audiences','column','cas:list','tdx\x20cas\x20desc\x20<name>','\x20file(s)\x20to\x20','Status:\x20','dir','name'];a8_0x3ae1=function(){return _0x45b254;};return a8_0x3ae1();}import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{[a8_0xff32e8(0x1ba)]=a8_0xff32e8(0x1b5);[a8_0xff32e8(0x193)]=a8_0xff32e8(0x1b3);async[a8_0xff32e8(0x1c0)](_0x3400b5){const _0x700e71=a8_0xff32e8,{options:_0x5355c3,tdx:_0x3fe89a}=_0x3400b5,_0x2c36fd=await withProgressSpinner(_0x700e71(0x196),()=>_0x3fe89a[_0x700e71(0x1a6)][_0x700e71(0x1be)](),{'verbose':_0x5355c3[_0x700e71(0x18b)]}),_0x113abc=_0x2c36fd['data'];if(isStructuredFormat(_0x5355c3))return await handleSDKOutput(_0x113abc,_0x5355c3),0x0;if(_0x113abc['length']===0x0)return console[_0x700e71(0x164)](a8_0x1880f6[_0x700e71(0x1a5)](_0x700e71(0x1ca))),0x0;console[_0x700e71(0x164)](a8_0x1880f6[_0x700e71(0x197)](_0x700e71(0x185)+_0x113abc[_0x700e71(0x186)]+'\x20composable\x20audiences'));for(const _0x3221fb of _0x113abc){const _0x13a1de=_0x3221fb['population']?a8_0x1880f6['dim']('\x20('+Number(_0x3221fb[_0x700e71(0x1cc)])[_0x700e71(0x1ac)]()+')'):'',_0x1f845f=a8_0x1880f6[_0x700e71(0x1a5)]('\x20'+_0x3221fb[_0x700e71(0x1d2)]+'.'+_0x3221fb[_0x700e71(0x1c2)]);console['log']('🧊\x20'+_0x3221fb[_0x700e71(0x1ba)]+_0x13a1de+_0x1f845f),_0x3221fb[_0x700e71(0x193)]&&console[_0x700e71(0x164)]('\x20\x20'+a8_0x1880f6[_0x700e71(0x1a5)](_0x3221fb[_0x700e71(0x193)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0xff32e8(0x1ba)]=a8_0xff32e8(0x19d);[a8_0xff32e8(0x193)]=a8_0xff32e8(0x190);async['execute'](_0x17a064){const _0x8a62d8=a8_0xff32e8,{options:_0x537a4a,args:_0x17423c,tdx:_0x411002}=_0x17a064,_0x2771cc=_0x17423c[0x0]||_0x537a4a[_0x8a62d8(0x1ab)];if(!_0x2771cc)return console[_0x8a62d8(0x17b)](a8_0x1880f6[_0x8a62d8(0x180)](_0x8a62d8(0x1c7))),console[_0x8a62d8(0x17b)](_0x8a62d8(0x18d)+a8_0x1880f6[_0x8a62d8(0x176)](_0x8a62d8(0x1b6))+_0x8a62d8(0x162)+a8_0x1880f6[_0x8a62d8(0x176)]('tdx\x20use\x20cas\x20<name>')),0x1;const _0x3c12e1=await withProgressSpinner(_0x8a62d8(0x16f)+_0x2771cc+'\x27...',()=>_0x411002['cas'][_0x8a62d8(0x175)](_0x2771cc),{'verbose':_0x537a4a[_0x8a62d8(0x18b)]}),_0x7fd4d9=_0x3c12e1['data'];if(isStructuredFormat(_0x537a4a))return await handleSingleObjectOutput(_0x7fd4d9,_0x537a4a),0x0;console[_0x8a62d8(0x164)](a8_0x1880f6['bold'](_0x7fd4d9['name']));if(_0x7fd4d9[_0x8a62d8(0x193)])console['log'](a8_0x1880f6[_0x8a62d8(0x1a5)](_0x7fd4d9[_0x8a62d8(0x193)]));console[_0x8a62d8(0x164)](),console[_0x8a62d8(0x164)](a8_0x1880f6[_0x8a62d8(0x1cd)]('Master\x20Table')),console['log'](_0x8a62d8(0x16b)+_0x7fd4d9[_0x8a62d8(0x1d2)]),console[_0x8a62d8(0x164)](_0x8a62d8(0x1a3)+_0x7fd4d9['masterTable']),console[_0x8a62d8(0x164)]('\x20\x20Key:\x20\x20\x20\x20'+_0x7fd4d9[_0x8a62d8(0x19a)]),console[_0x8a62d8(0x164)]();if(_0x7fd4d9[_0x8a62d8(0x16c)]?.[_0x8a62d8(0x186)]){console[_0x8a62d8(0x164)](a8_0x1880f6[_0x8a62d8(0x1cd)](_0x8a62d8(0x1bd)+_0x7fd4d9[_0x8a62d8(0x16c)][_0x8a62d8(0x186)]+')'));for(const _0x44b98b of _0x7fd4d9[_0x8a62d8(0x16c)]){console[_0x8a62d8(0x164)]('\x20\x20'+a8_0x1880f6['bold'](_0x44b98b[_0x8a62d8(0x1ba)])+'\x20—\x20'+_0x44b98b[_0x8a62d8(0x19c)]+'.'+_0x44b98b['table']+'.'+_0x44b98b[_0x8a62d8(0x1b4)]+'\x20('+a8_0x1880f6[_0x8a62d8(0x1a5)](_0x44b98b[_0x8a62d8(0x1a0)])+')');}console[_0x8a62d8(0x164)]();}if(_0x7fd4d9[_0x8a62d8(0x1a1)]?.['length']){console['log'](a8_0x1880f6['underline'](_0x8a62d8(0x191)+_0x7fd4d9[_0x8a62d8(0x1a1)][_0x8a62d8(0x186)]+')'));for(const _0x193872 of _0x7fd4d9[_0x8a62d8(0x1a1)]){const _0x558aba=_0x193872[_0x8a62d8(0x181)]?_0x8a62d8(0x177)+_0x193872[_0x8a62d8(0x181)]+')':'';console[_0x8a62d8(0x164)]('\x20\x20'+a8_0x1880f6['bold'](_0x193872[_0x8a62d8(0x1ba)])+_0x8a62d8(0x17a)+_0x193872[_0x8a62d8(0x19c)]+'.'+_0x193872[_0x8a62d8(0x161)]+_0x558aba);}}return 0x0;}}export class CASPullCommand extends BaseCommand{['name']=a8_0xff32e8(0x184);[a8_0xff32e8(0x193)]='Pull\x20composable\x20audience\x20to\x20YAML\x20files';async[a8_0xff32e8(0x1c0)](_0x538954){const _0xd8a69a=a8_0xff32e8,{options:_0x26f6eb,args:_0xb3b269,tdx:_0x4d91be}=_0x538954,_0x3c5b2d=_0x26f6eb,_0x193ca8=_0xb3b269[0x0]||_0x26f6eb[_0xd8a69a(0x1ab)];if(!_0x193ca8)return console[_0xd8a69a(0x17b)](a8_0x1880f6[_0xd8a69a(0x180)](_0xd8a69a(0x1c7))),console[_0xd8a69a(0x17b)](_0xd8a69a(0x18d)+a8_0x1880f6['cyan'](_0xd8a69a(0x1bc))+_0xd8a69a(0x162)+a8_0x1880f6[_0xd8a69a(0x176)]('tdx\x20use\x20cas\x20<name>')),0x1;const _0x563498=_0x3c5b2d[_0xd8a69a(0x1b9)]||a8_0x16cf90[_0xd8a69a(0x1c9)](process[_0xd8a69a(0x1a9)](),_0xd8a69a(0x1a6),sanitizeFileName(_0x193ca8)),_0x155f6b=await withProgressSpinner('Pulling\x20composable\x20audience\x20\x27'+_0x193ca8+_0xd8a69a(0x1c5),_0x428a8e=>_0x4d91be[_0xd8a69a(0x1a6)]['pull'](_0x193ca8,{'targetDir':_0x563498,'verbose':_0x3c5b2d[_0xd8a69a(0x18b)],'progress':{'update':_0x3b7deb=>_0x428a8e[_0xd8a69a(0x16a)](_0x3b7deb)}}),{'verbose':_0x3c5b2d[_0xd8a69a(0x18b)]}),_0x5a2a70=_0x155f6b[_0xd8a69a(0x182)],_0x67a006=_0x5a2a70[_0xd8a69a(0x19f)][_0xd8a69a(0x172)](_0x1b5b08=>_0x1b5b08[_0xd8a69a(0x174)]||_0x1b5b08[_0xd8a69a(0x171)]);saveSessionContext({'composable_audience':_0x5a2a70[_0xd8a69a(0x1cf)]},_0x3c5b2d[_0xd8a69a(0x18e)]),console['log'](a8_0x1880f6['green'](_0xd8a69a(0x170)+a8_0x1880f6['dim'](_0xd8a69a(0x1cb))+'\x20=\x20'+a8_0x1880f6[_0xd8a69a(0x176)](_0x5a2a70[_0xd8a69a(0x1cf)])));if(_0x67a006[_0xd8a69a(0x186)]===0x0)return console[_0xd8a69a(0x164)](a8_0x1880f6[_0xd8a69a(0x197)]('All\x20files\x20are\x20up\x20to\x20date.')),0x0;for(const _0x3d733f of _0x67a006){if(_0x3d733f[_0xd8a69a(0x174)])console['log'](a8_0x1880f6[_0xd8a69a(0x197)]('+\x20'+_0x3d733f[_0xd8a69a(0x18f)]+_0xd8a69a(0x17c)));else _0x3d733f[_0xd8a69a(0x179)]&&(console[_0xd8a69a(0x164)](a8_0x1880f6[_0xd8a69a(0x180)]('~\x20'+_0x3d733f[_0xd8a69a(0x18f)])),console[_0xd8a69a(0x164)](_0x3d733f[_0xd8a69a(0x179)]));}console['log']('\x0a'+_0x67a006['length']+_0xd8a69a(0x1c3)+('('+_0x5a2a70[_0xd8a69a(0x198)][_0xd8a69a(0x183)]+'\x20segments,\x20'+_0x5a2a70[_0xd8a69a(0x198)]['activations']+'\x20activations)'));if(_0x3c5b2d['dryRun'])return console['log'](a8_0x1880f6[_0xd8a69a(0x1a5)](_0xd8a69a(0x1a8))),0x0;if(!_0x3c5b2d[_0xd8a69a(0x1b2)]&&isInteractive()){const _0x2779f4=await confirmKey('Write\x20files?');if(!_0x2779f4)return console[_0xd8a69a(0x164)](a8_0x1880f6['dim'](_0xd8a69a(0x1b1))),0x0;}for(const _0x162465 of _0x67a006){const _0x1ecd80=a8_0x16cf90['dirname'](_0x162465[_0xd8a69a(0x17d)]);if(!existsSync(_0x1ecd80))mkdirSync(_0x1ecd80,{'recursive':!![]});writeFileSync(_0x162465[_0xd8a69a(0x17d)],_0x162465[_0xd8a69a(0x1ce)],_0xd8a69a(0x16e));}return console[_0xd8a69a(0x164)](a8_0x1880f6['green'](_0xd8a69a(0x1c6)+_0x67a006[_0xd8a69a(0x186)]+_0xd8a69a(0x1b7)+_0x563498)),0x0;}}export class CASPushCommand extends BaseCommand{['name']='cas:push';[a8_0xff32e8(0x193)]=a8_0xff32e8(0x18a);async['execute'](_0xb4ae52){const _0x1729c4=a8_0xff32e8,{options:_0x34701c,args:_0x5093eb,tdx:_0x113747}=_0xb4ae52,_0x3656c4=_0x34701c;let _0xe255c1=_0x5093eb[0x0];!_0xe255c1&&_0x34701c[_0x1729c4(0x1ab)]&&(_0xe255c1=a8_0x16cf90[_0x1729c4(0x1c9)](process[_0x1729c4(0x1a9)](),_0x1729c4(0x1a6),sanitizeFileName(_0x34701c[_0x1729c4(0x1ab)])));if(!_0xe255c1)return console[_0x1729c4(0x17b)](a8_0x1880f6[_0x1729c4(0x180)](_0x1729c4(0x1c7))),console[_0x1729c4(0x17b)]('Use\x20'+a8_0x1880f6[_0x1729c4(0x176)](_0x1729c4(0x1aa))+'\x20or\x20set\x20context\x20with\x20'+a8_0x1880f6['cyan'](_0x1729c4(0x199))),0x1;if(!existsSync(_0xe255c1))return console[_0x1729c4(0x17b)](a8_0x1880f6[_0x1729c4(0x1a7)](_0x1729c4(0x169)+_0xe255c1)),console[_0x1729c4(0x17b)](a8_0x1880f6[_0x1729c4(0x1a5)]('Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x4b4837=_0x34701c[_0x1729c4(0x1ab)]||a8_0x16cf90[_0x1729c4(0x1c8)](_0xe255c1),_0x467863=a8_0x16cf90[_0x1729c4(0x188)](process[_0x1729c4(0x1a9)](),_0xe255c1)||'.';console[_0x1729c4(0x164)]('Audience:\x20'+a8_0x1880f6[_0x1729c4(0x176)](_0x4b4837)),console[_0x1729c4(0x164)](_0x1729c4(0x187)+a8_0x1880f6['dim'](_0x467863)),console[_0x1729c4(0x164)](a8_0x1880f6[_0x1729c4(0x180)](_0x1729c4(0x1a2))),console[_0x1729c4(0x164)]();const _0x53e8b1=collectYamlFiles(_0xe255c1);if(_0x53e8b1['length']===0x0)return console['error'](a8_0x1880f6[_0x1729c4(0x1a7)]('No\x20YAML\x20files\x20found\x20in:\x20'+_0xe255c1)),0x1;console[_0x1729c4(0x164)](_0x1729c4(0x185)+_0x53e8b1['length']+_0x1729c4(0x19b));const _0xe2c72=await withProgressSpinner('Analyzing\x20CAS\x20YAML\x20files...',_0x2cde44=>_0x113747['cas'][_0x1729c4(0x1d1)](_0x53e8b1,{'dryRun':!![],'verbose':_0x3656c4['verbose'],'progress':{'update':_0x7955fe=>_0x2cde44[_0x1729c4(0x16a)](_0x7955fe)}}),{'verbose':_0x3656c4[_0x1729c4(0x18b)]}),_0xd0e90c=_0xe2c72[_0x1729c4(0x182)],{created:_0x363f1f}=_0xd0e90c,_0x827204=[];if(_0x363f1f[_0x1729c4(0x189)])_0x827204[_0x1729c4(0x1d1)](_0x363f1f['audiences']+_0x1729c4(0x194));if(_0x363f1f[_0x1729c4(0x183)])_0x827204[_0x1729c4(0x1d1)](_0x363f1f[_0x1729c4(0x183)]+'\x20segment(s)');if(_0x363f1f[_0x1729c4(0x192)])_0x827204[_0x1729c4(0x1d1)](_0x363f1f[_0x1729c4(0x192)]+'\x20activation(s)');return _0x827204[_0x1729c4(0x186)]===0x0?console[_0x1729c4(0x164)](a8_0x1880f6[_0x1729c4(0x1a5)](_0x1729c4(0x165))):console[_0x1729c4(0x164)](_0x1729c4(0x1b0)+_0x827204[_0x1729c4(0x1c9)](',\x20')),console['log'](a8_0x1880f6[_0x1729c4(0x1a5)](_0x1729c4(0x163))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0xff32e8(0x1ba)]='cas:preview';[a8_0xff32e8(0x193)]=a8_0xff32e8(0x17e);async[a8_0xff32e8(0x1c0)](_0x4a521c){const _0x11e4cc=a8_0xff32e8,{options:_0x257507,args:_0x55f44e,tdx:_0x5c904c}=_0x4a521c,_0x3a9869=_0x55f44e[0x0],_0x5bb62f=_0x55f44e[0x1]||_0x257507[_0x11e4cc(0x1ab)];if(!_0x3a9869)return console[_0x11e4cc(0x17b)](a8_0x1880f6[_0x11e4cc(0x1a7)](_0x11e4cc(0x1ad))),0x1;if(!_0x5bb62f)return console['error'](a8_0x1880f6['yellow'](_0x11e4cc(0x1ae))),console[_0x11e4cc(0x17b)](_0x11e4cc(0x18d)+a8_0x1880f6['cyan'](_0x11e4cc(0x178))+_0x11e4cc(0x162)+a8_0x1880f6[_0x11e4cc(0x176)](_0x11e4cc(0x199))),0x1;const _0x3c04cf=await withProgressSpinner(_0x11e4cc(0x1d0)+_0x3a9869+_0x11e4cc(0x1c5),()=>_0x5c904c[_0x11e4cc(0x1a6)][_0x11e4cc(0x173)](_0x5bb62f,_0x3a9869),{'verbose':_0x257507[_0x11e4cc(0x18b)]}),{query:_0x216b9c,customers:_0x34928c}=_0x3c04cf[_0x11e4cc(0x182)];if(isStructuredFormat(_0x257507))return await handleSingleObjectOutput({'query':_0x216b9c,'customers':_0x34928c},_0x257507),0x0;const _0x59a9af=_0x216b9c['status']==='success'?a8_0x1880f6['green']:a8_0x1880f6[_0x11e4cc(0x180)];console[_0x11e4cc(0x164)](_0x11e4cc(0x1b8)+_0x59a9af(_0x216b9c[_0x11e4cc(0x1bb)])),console['log']('Count:\x20\x20'+a8_0x1880f6['bold'](String(_0x216b9c[_0x11e4cc(0x1a4)])));_0x216b9c[_0x11e4cc(0x17b)]&&console['log']('Error:\x20\x20'+a8_0x1880f6['red'](_0x216b9c[_0x11e4cc(0x17b)]));if(_0x34928c?.[_0x11e4cc(0x168)]&&_0x34928c?.['rows']){console['log'](a8_0x1880f6[_0x11e4cc(0x1cd)]('\x0aSample\x20Rows\x20('+_0x34928c['rows'][_0x11e4cc(0x186)]+')'));const _0x1c3435=_0x34928c[_0x11e4cc(0x160)][_0x11e4cc(0x167)](_0x22ba07=>{const _0x2eb57e=_0x11e4cc,_0x54473b={};for(let _0x564af9=0x0;_0x564af9<_0x34928c[_0x2eb57e(0x168)][_0x2eb57e(0x186)];_0x564af9++){_0x54473b[_0x34928c[_0x2eb57e(0x168)][_0x564af9]]=_0x22ba07[_0x564af9];}return _0x54473b;});await handleSDKOutput(_0x1c3435,_0x257507);}return 0x0;}}
@@ -1 +1 @@
1
- const a9_0x389532=a9_0x2dad;function a9_0xf278(){const _0xe042ba=['verbose','2449116kvhGbH','description','red','composableAudience','🎯\x20','10ulcQPc','3652460wmROkJ','population','\x20segment','50512mhUrym','Fetching\x20segments\x20for\x20\x27','log','821904YVovvk','cas','data','103215RNHyNG','error','name','length','\x27...','2xdjJxJ','Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>','469047jDlFuZ','10227042xuddOz','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','List\x20composable\x20segments\x20for\x20an\x20audience','dim','green'];a9_0xf278=function(){return _0xe042ba;};return a9_0xf278();}(function(_0xe10d0f,_0x4800fc){const _0x46f17f=a9_0x2dad,_0x40ce31=_0xe10d0f();while(!![]){try{const _0x8a61b2=-parseInt(_0x46f17f(0x1fd))/0x1+-parseInt(_0x46f17f(0x1fb))/0x2*(parseInt(_0x46f17f(0x1f6))/0x3)+-parseInt(_0x46f17f(0x1f3))/0x4*(parseInt(_0x46f17f(0x209))/0x5)+-parseInt(_0x46f17f(0x204))/0x6+parseInt(_0x46f17f(0x20a))/0x7+-parseInt(_0x46f17f(0x1f0))/0x8+parseInt(_0x46f17f(0x1fe))/0x9;if(_0x8a61b2===_0x4800fc)break;else _0x40ce31['push'](_0x40ce31['shift']());}catch(_0x8769fd){_0x40ce31['push'](_0x40ce31['shift']());}}}(a9_0xf278,0x505fe));function a9_0x2dad(_0x2fbedb,_0xf5d0fb){_0x2fbedb=_0x2fbedb-0x1ef;const _0xf2787c=a9_0xf278();let _0x2dad8f=_0xf2787c[_0x2fbedb];return _0x2dad8f;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{formatRows}from'../sdk/util/formatters.js';import a9_0x9f60e from'chalk';export class CASSegmentListCommand extends BaseCommand{[a9_0x389532(0x1f8)]='cas:sg:list';['description']=a9_0x389532(0x200);async['execute'](_0x2da71f){const _0x27a22a=a9_0x389532,{options:_0x27c832,args:_0x70399f,tdx:_0x3e1221}=_0x2da71f,_0x2d5269=_0x70399f[0x0]||_0x27c832[_0x27a22a(0x207)];if(!_0x2d5269)return console['error'](a9_0x9f60e[_0x27a22a(0x206)](_0x27a22a(0x1ff))),console[_0x27a22a(0x1f7)](a9_0x9f60e[_0x27a22a(0x201)](_0x27a22a(0x1fc))),0x1;const _0x49172f=await withProgressSpinner(_0x27a22a(0x1f1)+_0x2d5269+_0x27a22a(0x1fa),()=>_0x3e1221[_0x27a22a(0x1f4)]['listSegments'](_0x2d5269),{'verbose':_0x27c832[_0x27a22a(0x203)]}),_0x419522=_0x49172f[_0x27a22a(0x1f5)];if(isStructuredFormat(_0x27c832))return await handleSDKOutput(_0x419522,_0x27c832),0x0;console[_0x27a22a(0x1f2)](a9_0x9f60e[_0x27a22a(0x202)]('Found\x20'+_0x419522[_0x27a22a(0x1f9)]+_0x27a22a(0x1ef)+(_0x419522[_0x27a22a(0x1f9)]!==0x1?'s':'')));if(_0x419522[_0x27a22a(0x1f9)]===0x0)return 0x0;for(const _0x40e36d of _0x419522){const _0x3dceac=_0x40e36d['population']!=null?a9_0x9f60e[_0x27a22a(0x201)]('\x20('+formatRows(_0x40e36d[_0x27a22a(0x20b)])+')'):'';console[_0x27a22a(0x1f2)](_0x27a22a(0x208)+_0x40e36d[_0x27a22a(0x1f8)]+_0x3dceac),_0x40e36d[_0x27a22a(0x205)]&&console['log']('\x20\x20'+a9_0x9f60e[_0x27a22a(0x201)](_0x40e36d['description']));}return 0x0;}}
1
+ const a9_0x2f9654=a9_0x2f90;(function(_0x42fbb2,_0x1a9b55){const _0x410730=a9_0x2f90,_0x3a8565=_0x42fbb2();while(!![]){try{const _0x4ba57c=parseInt(_0x410730(0xcb))/0x1*(parseInt(_0x410730(0xd7))/0x2)+parseInt(_0x410730(0xce))/0x3+-parseInt(_0x410730(0xc0))/0x4+-parseInt(_0x410730(0xd4))/0x5*(-parseInt(_0x410730(0xcd))/0x6)+-parseInt(_0x410730(0xc2))/0x7+parseInt(_0x410730(0xca))/0x8+-parseInt(_0x410730(0xd0))/0x9;if(_0x4ba57c===_0x1a9b55)break;else _0x3a8565['push'](_0x3a8565['shift']());}catch(_0xa43ded){_0x3a8565['push'](_0x3a8565['shift']());}}}(a9_0x1183,0xe1fde));function a9_0x2f90(_0x5be3b7,_0x54c415){_0x5be3b7=_0x5be3b7-0xbe;const _0x1183cd=a9_0x1183();let _0x2f90bb=_0x1183cd[_0x5be3b7];return _0x2f90bb;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{formatRows}from'../sdk/util/formatters.js';function a9_0x1183(){const _0x579891=['log','20688039ZDeXTE','green','description','name','4541505OGiJge','execute','Found\x20','7286VbUKsf','verbose','error','listSegments','1231264gMyeLl','composableAudience','12581772GpBrGn','red','cas:sg:list','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','Fetching\x20segments\x20for\x20\x27','length','🎯\x20','cas','12252368wTOVRh','67IcZUMX','dim','12CJAgsv','5211948eAzpKl'];a9_0x1183=function(){return _0x579891;};return a9_0x1183();}import a9_0xd4107c from'chalk';export class CASSegmentListCommand extends BaseCommand{[a9_0x2f9654(0xd3)]=a9_0x2f9654(0xc4);[a9_0x2f9654(0xd2)]='List\x20composable\x20segments\x20for\x20an\x20audience';async[a9_0x2f9654(0xd5)](_0x4ea894){const _0x74b009=a9_0x2f9654,{options:_0xb42b8,args:_0x4c8e18,tdx:_0x4e0753}=_0x4ea894,_0x36126a=_0x4c8e18[0x0]||_0xb42b8[_0x74b009(0xc1)];if(!_0x36126a)return console[_0x74b009(0xbe)](a9_0xd4107c[_0x74b009(0xc3)](_0x74b009(0xc5))),console['error'](a9_0xd4107c[_0x74b009(0xcc)]('Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>')),0x1;const _0xb3b8aa=await withProgressSpinner(_0x74b009(0xc6)+_0x36126a+'\x27...',()=>_0x4e0753[_0x74b009(0xc9)][_0x74b009(0xbf)](_0x36126a),{'verbose':_0xb42b8[_0x74b009(0xd8)]}),_0x4aff8f=_0xb3b8aa['data'];if(isStructuredFormat(_0xb42b8))return await handleSDKOutput(_0x4aff8f,_0xb42b8),0x0;console['log'](a9_0xd4107c[_0x74b009(0xd1)](_0x74b009(0xd6)+_0x4aff8f[_0x74b009(0xc7)]+'\x20segment'+(_0x4aff8f[_0x74b009(0xc7)]!==0x1?'s':'')));if(_0x4aff8f[_0x74b009(0xc7)]===0x0)return 0x0;for(const _0x3ea075 of _0x4aff8f){const _0x4065dc=_0x3ea075['population']!=null?a9_0xd4107c[_0x74b009(0xcc)]('\x20('+formatRows(_0x3ea075['population'])+')'):'';console[_0x74b009(0xcf)](_0x74b009(0xc8)+_0x3ea075[_0x74b009(0xd3)]+_0x4065dc),_0x3ea075['description']&&console[_0x74b009(0xcf)]('\x20\x20'+a9_0xd4107c[_0x74b009(0xcc)](_0x3ea075[_0x74b009(0xd2)]));}return 0x0;}}
@@ -1 +1 @@
1
- const a10_0xd47da=a10_0x400c;(function(_0x4bd579,_0x4de12e){const _0xee9093=a10_0x400c,_0x9d623a=_0x4bd579();while(!![]){try{const _0x9a61fd=-parseInt(_0xee9093(0x222))/0x1+parseInt(_0xee9093(0x1dd))/0x2*(parseInt(_0xee9093(0x1fb))/0x3)+parseInt(_0xee9093(0x20f))/0x4*(-parseInt(_0xee9093(0x1e2))/0x5)+-parseInt(_0xee9093(0x1fa))/0x6+-parseInt(_0xee9093(0x20e))/0x7+parseInt(_0xee9093(0x1ee))/0x8*(-parseInt(_0xee9093(0x214))/0x9)+-parseInt(_0xee9093(0x1f0))/0xa*(-parseInt(_0xee9093(0x21a))/0xb);if(_0x9a61fd===_0x4de12e)break;else _0x9d623a['push'](_0x9d623a['shift']());}catch(_0x37b1be){_0x9d623a['push'](_0x9d623a['shift']());}}}(a10_0x1107,0xd8a27));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 a10_0x400c(_0x3cad0d,_0x56d273){_0x3cad0d=_0x3cad0d-0x1d7;const _0x11079a=a10_0x1107();let _0x400cbf=_0x11079a[_0x3cad0d];return _0x400cbf;}import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x4bb721,_0x316a4d){const _0xd0bf4b=a10_0x400c;if(_0x4bb721 instanceof SDKError)console[_0xd0bf4b(0x202)]('Error:\x20'+_0x4bb721['message']),_0x316a4d[_0xd0bf4b(0x1fc)]&&(_0x4bb721[_0xd0bf4b(0x1dc)]&&console[_0xd0bf4b(0x202)](_0xd0bf4b(0x1eb)+_0x4bb721[_0xd0bf4b(0x1dc)]),_0x4bb721['stack']&&(console[_0xd0bf4b(0x202)](_0xd0bf4b(0x211)),console[_0xd0bf4b(0x202)](_0x4bb721['stack'])));else throw _0x4bb721;}async function resolveAgentId(_0x5c3b,_0x2df925,_0x49f248,_0x5beb8f,_0x4afa95){const _0xde7d76=a10_0x400c,_0x178e0a=_0x2df925||_0x49f248;if(_0x178e0a){const {projectName:_0x41b31b,agentName:_0x359ce6}=parseAgentRef(_0x178e0a),_0x4f753e=_0x359ce6||_0x178e0a,_0x174ebc=_0x359ce6?_0x41b31b:_0x5beb8f;if(!_0x174ebc)throw new Error(_0xde7d76(0x21e));if(_0x4afa95){const _0x9c36d2=_0x2df925?_0xde7d76(0x207):_0xde7d76(0x205);console[_0xde7d76(0x202)](_0xde7d76(0x1d7)+_0x9c36d2+':\x20'+_0x174ebc+'/'+_0x4f753e);}const _0x32a616=await withSpinner(_0xde7d76(0x20c)+_0x174ebc+'\x27...',()=>_0x5c3b[_0xde7d76(0x1e1)][_0xde7d76(0x1f7)](_0x174ebc),{'verbose':_0x4afa95}),_0x21ae5f=await withSpinner(_0xde7d76(0x21f)+_0x4f753e+'\x27...',()=>_0x5c3b[_0xde7d76(0x1e1)]['resolveAgentId'](_0x4f753e,_0x32a616[_0xde7d76(0x1f8)]),{'verbose':_0x4afa95});return _0x21ae5f[_0xde7d76(0x1f8)];}else{const _0x2ccdf4=_0x5c3b[_0xde7d76(0x1e1)][_0xde7d76(0x208)]();if(_0x2ccdf4)return _0x4afa95&&console[_0xde7d76(0x202)](_0xde7d76(0x1f5)+_0x2ccdf4['name']),_0x2ccdf4['id'];const _0x4f2c78=await withSpinner(_0xde7d76(0x1e7),()=>_0x5c3b[_0xde7d76(0x1e1)][_0xde7d76(0x213)]('claude-4.5-haiku',0x0),{'verbose':_0x4afa95});return _0x4f2c78[_0xde7d76(0x1f8)]['id'];}}function a10_0x1107(){const _0x2425ea=['streamChatJsonl','description','error','validate','agentId','session\x20context','string','--agent\x20flag','getDefaultAgent','functionName','join','chat','Resolving\x20project\x20\x27','stringify','8988889UKLtaH','104mAoeDJ','targetFunction','\x0aStack\x20trace:','content','getOrCreateDefaultAgent','99mbtpYn','tool','handleChatEvent','tool_result','Error:\x20Chat\x20session\x20\x27','type','30422370yGEurH','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','chatId','Continuing\x20chat:\x20','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','Resolving\x20agent\x20\x27','\x0aError:\x20','event','1348563cWCWuE','Using\x20agent\x20from\x20','slice','chat-create','404','tool_call','cause','9482qgaQZN','execute','log','site','llm','319690jvQIEE','includes','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','\x27\x20not\x20found','write','Getting\x20default\x20agent...','startChat','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','args','\x20\x20Cause:\x20','streamChat','metadata','782728qAzZwZ','Chat\x20session:\x20','20BZFvuG','agent','llmProject','code','projectId','Using\x20cached\x20default\x20agent:\x20','llmAgent','resolveProjectId','data','targetAgent','2776002VdIRom','753TLIXkU','verbose','CHAT_NOT_FOUND','stream','name'];a10_0x1107=function(){return _0x2425ea;};return a10_0x1107();}export class ChatCommand extends BaseCommand{[a10_0xd47da(0x1ff)]=a10_0xd47da(0x20b);[a10_0xd47da(0x201)]=a10_0xd47da(0x1e4);[a10_0xd47da(0x203)](_0x3db493){const _0x1e292b=a10_0xd47da,_0x103b78=_0x3db493[_0x1e292b(0x1ea)][_0x1e292b(0x20a)]('\x20');if(!_0x103b78)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x2b0693,_0xe2cd7f,_0xbefcc9,_0xcd2f88,_0x2e396a){const _0x2fad31=a10_0xd47da;for await(const _0x6fb112 of _0x2b0693['llm']['chat'](_0xe2cd7f,{'agentId':_0xbefcc9,'chatId':_0xcd2f88})){if(_0x6fb112[_0x2fad31(0x219)]===_0x2fad31(0x1ed)){const _0x7cac99=_0x6fb112[_0x2fad31(0x1f8)]['chatId'];saveLastChatId(_0x7cac99),_0x2e396a&&console['error'](_0x2fad31(0x1ef)+_0x7cac99);}else _0x6fb112[_0x2fad31(0x219)]===_0x2fad31(0x221)&&this['handleChatEvent'](_0x6fb112[_0x2fad31(0x1f8)]);}}async[a10_0xd47da(0x200)](_0x1714e4,_0x24f6cc,_0x12cfaf,_0x1f3bb8){const _0x1bfe0e=a10_0xd47da,_0x4b4ec2=_0x1714e4['context'][_0x1bfe0e(0x1e0)];let _0x2104c2=![];for await(const _0x5b6a4d of _0x1714e4[_0x1bfe0e(0x1e1)][_0x1bfe0e(0x20b)](_0x24f6cc,{'agentId':_0x12cfaf,'chatId':_0x1f3bb8})){if(_0x5b6a4d['type']===_0x1bfe0e(0x1ed)){const _0x46ad8c=_0x5b6a4d[_0x1bfe0e(0x1f8)];saveLastChatId(_0x46ad8c[_0x1bfe0e(0x21c)]);const _0x1b0d1a=_0x46ad8c[_0x1bfe0e(0x1f4)]&&_0x46ad8c[_0x1bfe0e(0x204)]?getLLMConversationUrl(_0x4b4ec2,_0x46ad8c[_0x1bfe0e(0x1f4)],_0x46ad8c[_0x1bfe0e(0x204)],_0x46ad8c[_0x1bfe0e(0x21c)]):undefined;console[_0x1bfe0e(0x1df)](JSON['stringify']({'type':_0x1bfe0e(0x1ed),'data':{'chatId':_0x46ad8c[_0x1bfe0e(0x21c)],'agentId':_0x46ad8c['agentId'],'consoleUrl':_0x1b0d1a}})),_0x2104c2=!![];}else{if(_0x5b6a4d[_0x1bfe0e(0x219)]===_0x1bfe0e(0x221)){!_0x2104c2&&_0x1f3bb8&&(console[_0x1bfe0e(0x1df)](JSON[_0x1bfe0e(0x20d)]({'type':_0x1bfe0e(0x1ed),'data':{'chatId':_0x1f3bb8}})),_0x2104c2=!![]);const _0x200194=_0x5b6a4d[_0x1bfe0e(0x1f8)];if(_0x1bfe0e(0x212)in _0x200194)console['log'](JSON[_0x1bfe0e(0x20d)]({'type':_0x1bfe0e(0x212),'data':{'content':_0x200194[_0x1bfe0e(0x212)]}}));else{if(_0x1bfe0e(0x1db)in _0x200194){const _0x419ac5=_0x200194[_0x1bfe0e(0x1db)];console[_0x1bfe0e(0x1df)](JSON[_0x1bfe0e(0x20d)]({'type':_0x1bfe0e(0x1db),'data':{'id':_0x419ac5['id'],'name':_0x419ac5[_0x1bfe0e(0x209)],'target':_0x419ac5['targetKnowledgeBase']?.['name']||_0x419ac5[_0x1bfe0e(0x1f9)]?.[_0x1bfe0e(0x1ff)]||_0x419ac5['targetWebSearchTool']?.['name']||_0x419ac5[_0x1bfe0e(0x210)]}}));}else{if('tool'in _0x200194)console[_0x1bfe0e(0x1df)](JSON[_0x1bfe0e(0x20d)]({'type':_0x1bfe0e(0x217),'data':{'id':_0x200194['tool']['id'],'name':_0x200194[_0x1bfe0e(0x215)][_0x1bfe0e(0x209)],'result':typeof _0x200194[_0x1bfe0e(0x215)][_0x1bfe0e(0x212)]===_0x1bfe0e(0x206)?_0x200194[_0x1bfe0e(0x215)][_0x1bfe0e(0x212)][_0x1bfe0e(0x1d8)](0x0,0x1f4):''}}));else _0x1bfe0e(0x202)in _0x200194&&console[_0x1bfe0e(0x1df)](JSON['stringify']({'type':_0x1bfe0e(0x202),'data':{'error':_0x200194['error']}}));}}}}}console[_0x1bfe0e(0x1df)](JSON[_0x1bfe0e(0x20d)]({'type':'done'}));}async[a10_0xd47da(0x1de)](_0x68e720){const _0x42b3e8=a10_0xd47da,{options:_0xcf2552,args:_0x42c667,tdx:_0x1b1028}=_0x68e720,_0x3e906d=_0x42c667[_0x42b3e8(0x20a)]('\x20'),_0x1d1f7f=_0xcf2552,_0x471808=_0x1d1f7f[_0x42b3e8(0x1f1)],_0x594c39=_0x1d1f7f[_0x42b3e8(0x1f6)],_0x3c8343=_0x1d1f7f['llmProject'],_0x36a503=_0x1d1f7f['new'],_0x53f4a1=_0x1d1f7f[_0x42b3e8(0x21c)],_0x2bc789=_0x1d1f7f[_0x42b3e8(0x1fe)];if(_0x36a503&&_0x53f4a1)return console[_0x42b3e8(0x202)](_0x42b3e8(0x1e9)),0x1;try{let _0x3c03cd,_0x4fa5f4;if(_0x53f4a1)_0x4fa5f4=_0x53f4a1;else!_0x36a503&&(_0x4fa5f4=loadLastChatId(),_0x4fa5f4&&_0xcf2552[_0x42b3e8(0x1fc)]&&console[_0x42b3e8(0x202)](_0x42b3e8(0x21d)+_0x4fa5f4));!_0x53f4a1&&(_0x36a503||!_0x4fa5f4)&&(_0x3c03cd=await resolveAgentId(_0x1b1028,_0x471808,_0x594c39,_0x3c8343,_0xcf2552[_0x42b3e8(0x1fc)]));const _0x444b78=_0x2bc789?(_0x3e0c9b,_0x1b5e2e,_0xcad063)=>this[_0x42b3e8(0x200)](_0x1b1028,_0x3e0c9b,_0x1b5e2e,_0xcad063):(_0x4a5eb0,_0x34c09c,_0x1822d1)=>this[_0x42b3e8(0x1ec)](_0x1b1028,_0x4a5eb0,_0x34c09c,_0x1822d1,_0xcf2552[_0x42b3e8(0x1fc)]);try{await _0x444b78(_0x3e906d,_0x3c03cd,_0x4fa5f4);}catch(_0x74ffb8){const _0x2f7d74=_0x74ffb8 instanceof SDKError&&_0x74ffb8[_0x42b3e8(0x1f3)]===ErrorCode[_0x42b3e8(0x1fd)]||_0x74ffb8 instanceof Error&&_0x74ffb8['message'][_0x42b3e8(0x1e3)](_0x42b3e8(0x1da));if(_0x2f7d74&&_0x53f4a1)return console[_0x42b3e8(0x202)](_0x42b3e8(0x218)+_0x53f4a1+_0x42b3e8(0x1e5)),0x1;if(_0x2f7d74)_0xcf2552['verbose']&&console[_0x42b3e8(0x202)](_0x42b3e8(0x21b)),!_0x3c03cd&&(_0x3c03cd=await resolveAgentId(_0x1b1028,_0x471808,_0x594c39,_0x3c8343,_0xcf2552['verbose'])),await _0x444b78(_0x3e906d,_0x3c03cd,undefined);else throw _0x74ffb8;}return!_0x2bc789&&console[_0x42b3e8(0x1df)](),0x0;}catch(_0x28017f){return console[_0x42b3e8(0x202)](),handleSDKError(_0x28017f,_0xcf2552),0x1;}}[a10_0xd47da(0x216)](_0x3f82ae){const _0x36e053=a10_0xd47da;if(_0x36e053(0x212)in _0x3f82ae)process['stdout'][_0x36e053(0x1e6)](_0x3f82ae[_0x36e053(0x212)]);else'error'in _0x3f82ae&&console[_0x36e053(0x202)](_0x36e053(0x220)+_0x3f82ae['error']);}}export class ChatCreateCommand extends BaseCommand{['name']=a10_0xd47da(0x1d9);['description']='Create\x20a\x20new\x20chat\x20session';['validate'](_0x55fe52){const _0x43bcf1=a10_0xd47da,_0x987f9d=_0x55fe52['options'],_0x163995=_0x987f9d[_0x43bcf1(0x1f1)],_0x3f8ba2=_0x987f9d[_0x43bcf1(0x1f6)];if(!_0x163995&&!_0x3f8ba2)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a10_0xd47da(0x1de)](_0x2aaa48){const _0x490589=a10_0xd47da,{options:_0xe4e429,tdx:_0x3b63fe}=_0x2aaa48,_0x33fd4e=_0xe4e429,_0x1641a1=_0x33fd4e[_0x490589(0x1f1)],_0x4a15bf=_0x33fd4e[_0x490589(0x1f6)],_0x539a8c=_0x33fd4e[_0x490589(0x1f2)];try{const _0x9c925c=await resolveAgentId(_0x3b63fe,_0x1641a1,_0x4a15bf,_0x539a8c,_0xe4e429[_0x490589(0x1fc)]),_0x68769e=await _0x3b63fe['llm'][_0x490589(0x1e8)](_0x9c925c);return saveLastChatId(_0x68769e['id']),console[_0x490589(0x1df)](JSON[_0x490589(0x20d)]({'chatId':_0x68769e['id'],'agentId':_0x9c925c})),0x0;}catch(_0xc5de12){return handleSDKError(_0xc5de12,_0xe4e429),0x1;}}}
1
+ const a10_0x57dcf9=a10_0x329d;function a10_0x3b6a(){const _0x5431a2=['stack','projectId','join','\x20\x20Cause:\x20','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','2832907SPlKyo','data','Error:\x20Chat\x20session\x20\x27','\x27...','event','1001902AwnsNW','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','name','cause','Resolving\x20project\x20\x27','Error:\x20','error','stringify','CHAT_NOT_FOUND','done','2277860EumhYg','log','type','tool','chatId','202292aRUqZc','1754616PPPIug','session\x20context','Create\x20a\x20new\x20chat\x20session','verbose','includes','handleChatEvent','options','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Chat\x20session:\x20','content','\x27\x20not\x20found','1233291uISDLB','agent','chat','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','targetKnowledgeBase','104408UDTQTy','chat-create','\x0aError:\x20','streamChat','metadata','streamChatJsonl','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','llmAgent','execute','description','llmProject','Using\x20agent\x20from\x20','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','functionName','stream','Using\x20cached\x20default\x20agent:\x20','code','Continuing\x20chat:\x20','llm','validate','tool_result','Getting\x20default\x20agent...','tool_call','agentId','resolveAgentId'];a10_0x3b6a=function(){return _0x5431a2;};return a10_0x3b6a();}(function(_0x400c84,_0x39b1d1){const _0x3568e5=a10_0x329d,_0x37068f=_0x400c84();while(!![]){try{const _0x284a46=parseInt(_0x3568e5(0x21f))/0x1+-parseInt(_0x3568e5(0x1ff))/0x2+parseInt(_0x3568e5(0x21a))/0x3+parseInt(_0x3568e5(0x20e))/0x4+-parseInt(_0x3568e5(0x209))/0x5+parseInt(_0x3568e5(0x20f))/0x6+parseInt(_0x3568e5(0x1fa))/0x7;if(_0x284a46===_0x39b1d1)break;else _0x37068f['push'](_0x37068f['shift']());}catch(_0x112eca){_0x37068f['push'](_0x37068f['shift']());}}}(a10_0x3b6a,0x4ae04));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';function a10_0x329d(_0x248f51,_0x2596ce){_0x248f51=_0x248f51-0x1ea;const _0x3b6a74=a10_0x3b6a();let _0x329da1=_0x3b6a74[_0x248f51];return _0x329da1;}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x5e3832,_0x329862){const _0x2827c0=a10_0x329d;if(_0x5e3832 instanceof SDKError)console[_0x2827c0(0x205)](_0x2827c0(0x204)+_0x5e3832['message']),_0x329862[_0x2827c0(0x212)]&&(_0x5e3832[_0x2827c0(0x202)]&&console[_0x2827c0(0x205)](_0x2827c0(0x1f8)+_0x5e3832[_0x2827c0(0x202)]),_0x5e3832['stack']&&(console['error']('\x0aStack\x20trace:'),console[_0x2827c0(0x205)](_0x5e3832[_0x2827c0(0x1f5)])));else throw _0x5e3832;}async function resolveAgentId(_0x552c81,_0x22a83a,_0x21f386,_0x1984f2,_0x58002a){const _0x4f54e3=a10_0x329d,_0x56db5c=_0x22a83a||_0x21f386;if(_0x56db5c){const {projectName:_0x1bda7d,agentName:_0x10fa11}=parseAgentRef(_0x56db5c),_0x3c49a3=_0x10fa11||_0x56db5c,_0x1c5283=_0x10fa11?_0x1bda7d:_0x1984f2;if(!_0x1c5283)throw new Error(_0x4f54e3(0x225));if(_0x58002a){const _0x1f8df5=_0x22a83a?'--agent\x20flag':_0x4f54e3(0x210);console[_0x4f54e3(0x205)](_0x4f54e3(0x22a)+_0x1f8df5+':\x20'+_0x1c5283+'/'+_0x3c49a3);}const _0x6185a0=await withSpinner(_0x4f54e3(0x203)+_0x1c5283+_0x4f54e3(0x1fd),()=>_0x552c81[_0x4f54e3(0x1ee)]['resolveProjectId'](_0x1c5283),{'verbose':_0x58002a}),_0x502360=await withSpinner('Resolving\x20agent\x20\x27'+_0x3c49a3+_0x4f54e3(0x1fd),()=>_0x552c81[_0x4f54e3(0x1ee)][_0x4f54e3(0x1f4)](_0x3c49a3,_0x6185a0[_0x4f54e3(0x1fb)]),{'verbose':_0x58002a});return _0x502360['data'];}else{const _0x5d05ad=_0x552c81[_0x4f54e3(0x1ee)]['getDefaultAgent']();if(_0x5d05ad)return _0x58002a&&console[_0x4f54e3(0x205)](_0x4f54e3(0x1eb)+_0x5d05ad[_0x4f54e3(0x201)]),_0x5d05ad['id'];const _0x51fa91=await withSpinner(_0x4f54e3(0x1f1),()=>_0x552c81['llm']['getOrCreateDefaultAgent']('claude-4.5-haiku',0x0),{'verbose':_0x58002a});return _0x51fa91[_0x4f54e3(0x1fb)]['id'];}}export class ChatCommand extends BaseCommand{[a10_0x57dcf9(0x201)]=a10_0x57dcf9(0x21c);['description']=a10_0x57dcf9(0x216);[a10_0x57dcf9(0x1ef)](_0x41d9f3){const _0x4035ce=a10_0x57dcf9,_0xefb304=_0x41d9f3['args'][_0x4035ce(0x1f7)]('\x20');if(!_0xefb304)return _0x4035ce(0x200);return undefined;}async['streamChat'](_0xb26983,_0xeb9101,_0x3ec2e0,_0xa92481,_0x375478){const _0xa1a232=a10_0x57dcf9;for await(const _0x16b563 of _0xb26983[_0xa1a232(0x1ee)][_0xa1a232(0x21c)](_0xeb9101,{'agentId':_0x3ec2e0,'chatId':_0xa92481})){if(_0x16b563['type']===_0xa1a232(0x223)){const _0x203ba1=_0x16b563[_0xa1a232(0x1fb)]['chatId'];saveLastChatId(_0x203ba1),_0x375478&&console['error'](_0xa1a232(0x217)+_0x203ba1);}else _0x16b563[_0xa1a232(0x20b)]===_0xa1a232(0x1fe)&&this[_0xa1a232(0x214)](_0x16b563[_0xa1a232(0x1fb)]);}}async[a10_0x57dcf9(0x224)](_0x4d3b49,_0x18702e,_0x1a09ba,_0x443d0e){const _0x251170=a10_0x57dcf9,_0x17d390=_0x4d3b49['context']['site'];let _0xff62fb=![];for await(const _0x382ebb of _0x4d3b49[_0x251170(0x1ee)][_0x251170(0x21c)](_0x18702e,{'agentId':_0x1a09ba,'chatId':_0x443d0e})){if(_0x382ebb['type']==='metadata'){const _0x4fa7f3=_0x382ebb[_0x251170(0x1fb)];saveLastChatId(_0x4fa7f3[_0x251170(0x20d)]);const _0x369c0f=_0x4fa7f3[_0x251170(0x1f6)]&&_0x4fa7f3[_0x251170(0x1f3)]?getLLMConversationUrl(_0x17d390,_0x4fa7f3['projectId'],_0x4fa7f3[_0x251170(0x1f3)],_0x4fa7f3['chatId']):undefined;console['log'](JSON['stringify']({'type':_0x251170(0x223),'data':{'chatId':_0x4fa7f3[_0x251170(0x20d)],'agentId':_0x4fa7f3[_0x251170(0x1f3)],'consoleUrl':_0x369c0f}})),_0xff62fb=!![];}else{if(_0x382ebb[_0x251170(0x20b)]==='event'){!_0xff62fb&&_0x443d0e&&(console[_0x251170(0x20a)](JSON[_0x251170(0x206)]({'type':_0x251170(0x223),'data':{'chatId':_0x443d0e}})),_0xff62fb=!![]);const _0x56e115=_0x382ebb['data'];if(_0x251170(0x218)in _0x56e115)console['log'](JSON[_0x251170(0x206)]({'type':_0x251170(0x218),'data':{'content':_0x56e115[_0x251170(0x218)]}}));else{if('tool_call'in _0x56e115){const _0x1aa089=_0x56e115[_0x251170(0x1f2)];console[_0x251170(0x20a)](JSON[_0x251170(0x206)]({'type':'tool_call','data':{'id':_0x1aa089['id'],'name':_0x1aa089[_0x251170(0x22c)],'target':_0x1aa089[_0x251170(0x21e)]?.['name']||_0x1aa089['targetAgent']?.[_0x251170(0x201)]||_0x1aa089['targetWebSearchTool']?.[_0x251170(0x201)]||_0x1aa089['targetFunction']}}));}else{if(_0x251170(0x20c)in _0x56e115)console['log'](JSON['stringify']({'type':_0x251170(0x1f0),'data':{'id':_0x56e115[_0x251170(0x20c)]['id'],'name':_0x56e115[_0x251170(0x20c)][_0x251170(0x22c)],'result':typeof _0x56e115[_0x251170(0x20c)]['content']==='string'?_0x56e115[_0x251170(0x20c)][_0x251170(0x218)]['slice'](0x0,0x1f4):''}}));else _0x251170(0x205)in _0x56e115&&console[_0x251170(0x20a)](JSON['stringify']({'type':'error','data':{'error':_0x56e115[_0x251170(0x205)]}}));}}}}}console[_0x251170(0x20a)](JSON[_0x251170(0x206)]({'type':_0x251170(0x208)}));}async[a10_0x57dcf9(0x227)](_0x412bff){const _0x46c2e0=a10_0x57dcf9,{options:_0x48f888,args:_0x5af547,tdx:_0x209c7d}=_0x412bff,_0x41fd1f=_0x5af547[_0x46c2e0(0x1f7)]('\x20'),_0x1880d9=_0x48f888,_0x4eabec=_0x1880d9[_0x46c2e0(0x21b)],_0x3d963f=_0x1880d9[_0x46c2e0(0x226)],_0x5463ef=_0x1880d9[_0x46c2e0(0x229)],_0x18c5da=_0x1880d9['new'],_0x39fad5=_0x1880d9[_0x46c2e0(0x20d)],_0xcc3ab1=_0x1880d9[_0x46c2e0(0x1ea)];if(_0x18c5da&&_0x39fad5)return console[_0x46c2e0(0x205)](_0x46c2e0(0x22b)),0x1;try{let _0x20c056,_0xcbecc2;if(_0x39fad5)_0xcbecc2=_0x39fad5;else!_0x18c5da&&(_0xcbecc2=loadLastChatId(),_0xcbecc2&&_0x48f888[_0x46c2e0(0x212)]&&console[_0x46c2e0(0x205)](_0x46c2e0(0x1ed)+_0xcbecc2));!_0x39fad5&&(_0x18c5da||!_0xcbecc2)&&(_0x20c056=await resolveAgentId(_0x209c7d,_0x4eabec,_0x3d963f,_0x5463ef,_0x48f888[_0x46c2e0(0x212)]));const _0x11f911=_0xcc3ab1?(_0x1a3a74,_0x2c12f6,_0x5940ab)=>this['streamChatJsonl'](_0x209c7d,_0x1a3a74,_0x2c12f6,_0x5940ab):(_0x1f9d9e,_0xe54717,_0x1cbeb0)=>this[_0x46c2e0(0x222)](_0x209c7d,_0x1f9d9e,_0xe54717,_0x1cbeb0,_0x48f888[_0x46c2e0(0x212)]);try{await _0x11f911(_0x41fd1f,_0x20c056,_0xcbecc2);}catch(_0x41ebf8){const _0x3e6112=_0x41ebf8 instanceof SDKError&&_0x41ebf8[_0x46c2e0(0x1ec)]===ErrorCode[_0x46c2e0(0x207)]||_0x41ebf8 instanceof Error&&_0x41ebf8['message'][_0x46c2e0(0x213)]('404');if(_0x3e6112&&_0x39fad5)return console['error'](_0x46c2e0(0x1fc)+_0x39fad5+_0x46c2e0(0x219)),0x1;if(_0x3e6112)_0x48f888[_0x46c2e0(0x212)]&&console['error'](_0x46c2e0(0x21d)),!_0x20c056&&(_0x20c056=await resolveAgentId(_0x209c7d,_0x4eabec,_0x3d963f,_0x5463ef,_0x48f888['verbose'])),await _0x11f911(_0x41fd1f,_0x20c056,undefined);else throw _0x41ebf8;}return!_0xcc3ab1&&console[_0x46c2e0(0x20a)](),0x0;}catch(_0x9edd22){return console['error'](),handleSDKError(_0x9edd22,_0x48f888),0x1;}}[a10_0x57dcf9(0x214)](_0x333b47){const _0x5cac1e=a10_0x57dcf9;if(_0x5cac1e(0x218)in _0x333b47)process['stdout']['write'](_0x333b47[_0x5cac1e(0x218)]);else _0x5cac1e(0x205)in _0x333b47&&console[_0x5cac1e(0x205)](_0x5cac1e(0x221)+_0x333b47[_0x5cac1e(0x205)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a10_0x57dcf9(0x220);[a10_0x57dcf9(0x228)]=a10_0x57dcf9(0x211);[a10_0x57dcf9(0x1ef)](_0x3a745e){const _0x1f0118=a10_0x57dcf9,_0x281f5e=_0x3a745e[_0x1f0118(0x215)],_0x39fb95=_0x281f5e[_0x1f0118(0x21b)],_0xd72f3d=_0x281f5e[_0x1f0118(0x226)];if(!_0x39fb95&&!_0xd72f3d)return _0x1f0118(0x1f9);return undefined;}async[a10_0x57dcf9(0x227)](_0x252e6c){const _0x40cc13=a10_0x57dcf9,{options:_0x18902c,tdx:_0x506c01}=_0x252e6c,_0x42e052=_0x18902c,_0x4a2be1=_0x42e052[_0x40cc13(0x21b)],_0x21378e=_0x42e052['llmAgent'],_0x16a23d=_0x42e052['llmProject'];try{const _0x3371cf=await resolveAgentId(_0x506c01,_0x4a2be1,_0x21378e,_0x16a23d,_0x18902c['verbose']),_0x634a7c=await _0x506c01['llm']['startChat'](_0x3371cf);return saveLastChatId(_0x634a7c['id']),console[_0x40cc13(0x20a)](JSON[_0x40cc13(0x206)]({'chatId':_0x634a7c['id'],'agentId':_0x3371cf})),0x0;}catch(_0x432bdd){return handleSDKError(_0x432bdd,_0x18902c),0x1;}}}
@@ -1 +1 @@
1
- const a11_0xf23705=a11_0x37c3;(function(_0x262a2f,_0x13b74b){const _0x5e03c2=a11_0x37c3,_0x332eb0=_0x262a2f();while(!![]){try{const _0x5b8307=parseInt(_0x5e03c2(0x133))/0x1+parseInt(_0x5e03c2(0xe2))/0x2*(-parseInt(_0x5e03c2(0x15f))/0x3)+-parseInt(_0x5e03c2(0xe7))/0x4+-parseInt(_0x5e03c2(0x11b))/0x5+-parseInt(_0x5e03c2(0x121))/0x6+parseInt(_0x5e03c2(0x163))/0x7*(parseInt(_0x5e03c2(0xf0))/0x8)+parseInt(_0x5e03c2(0xc6))/0x9;if(_0x5b8307===_0x13b74b)break;else _0x332eb0['push'](_0x332eb0['shift']());}catch(_0x1353b7){_0x332eb0['push'](_0x332eb0['shift']());}}}(a11_0x2f94,0xdd56e));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{execFile}from'node:child_process';import{existsSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';import{promisify}from'node:util';import a11_0x163456 from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint,getConsoleUrl}from'../sdk/client/endpoints.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo,loadReleaseChannel}from'../core/config.js';import{resolveReleaseTag}from'../utils/github-releases.js';const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION=a11_0xf23705(0x12d),SETTINGS_BACKUP_FILENAME='.tdx-settings-backup.json';function isProcessRunning(_0x1ce922){try{return process['kill'](_0x1ce922,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x15b58a,_0xedf779){const _0x28a7de=a11_0xf23705;if(!existsSync(_0x15b58a))return;try{const _0x3dff83=await readFile(_0x15b58a,_0x28a7de(0xbe)),_0x2e4baa=JSON[_0x28a7de(0xc3)](_0x3dff83),_0x350d93=_0x2e4baa[_0x28a7de(0x131)]||{};for(const _0xd2ca52 of[_0x28a7de(0x13d),_0x28a7de(0x138),_0x28a7de(0x122),_0x28a7de(0x146),'CLAUDE_CODE_USE_VERTEX']){_0xedf779[_0xd2ca52]!==undefined?_0x350d93[_0xd2ca52]=_0xedf779[_0xd2ca52]:delete _0x350d93[_0xd2ca52];}_0xedf779['statusLine']!==undefined?_0x2e4baa[_0x28a7de(0xfe)]=_0xedf779[_0x28a7de(0xfe)]:delete _0x2e4baa[_0x28a7de(0xfe)],_0x2e4baa[_0x28a7de(0x131)]=_0x350d93,await writeFile(_0x15b58a,JSON['stringify'](_0x2e4baa,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x4dc62b){try{await unlink(_0x4dc62b);}catch{}}async function recoverFromStaleBackup(_0x4b2ba2,_0x48a094){const _0x34c4d6=a11_0xf23705;if(!existsSync(_0x48a094))return undefined;try{const _0x2fa7d9=await readFile(_0x48a094,_0x34c4d6(0xbe)),_0x11eaf1=JSON[_0x34c4d6(0xc3)](_0x2fa7d9);if(isProcessRunning(_0x11eaf1[_0x34c4d6(0x135)]))return{'liveSessionOriginals':_0x11eaf1[_0x34c4d6(0x160)]};return await applyOriginalSettings(_0x4b2ba2,_0x11eaf1[_0x34c4d6(0x160)]),await safeUnlink(_0x48a094),undefined;}catch{return await safeUnlink(_0x48a094),undefined;}}function handleInstallationError(_0x1219c3,_0x1c4042,_0x3e89fc,_0x221e05){const _0x35fffa=a11_0xf23705;errorContains(_0x1219c3,'already\x20exists',_0x35fffa(0x128),_0x35fffa(0xff))?(_0x3e89fc[_0x35fffa(0x12e)]='✓\x20'+_0x1c4042+'\x20already\x20configured',_0x221e05?.[_0x35fffa(0x13e)](_0x1c4042+'\x20already\x20configured'),_0x1219c3 instanceof SDKError&&_0x1219c3[_0x35fffa(0xf2)]&&_0x221e05?.[_0x35fffa(0xbf)]('Command\x20output:\x20'+_0x1219c3[_0x35fffa(0xf2)][_0x35fffa(0x132)])):(_0x3e89fc['warn']('Warning:\x20Failed\x20to\x20configure\x20'+_0x1c4042),_0x221e05?.[_0x35fffa(0x129)](_0x1c4042+_0x35fffa(0x16b),_0x1219c3));}export function parseVersion(_0x4ec8f0){const _0xcdedff=a11_0xf23705,_0x2898c7=_0x4ec8f0[_0xcdedff(0x14d)]()[_0xcdedff(0x11c)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x2898c7)return null;return{'major':parseInt(_0x2898c7[0x1],0xa),'minor':parseInt(_0x2898c7[0x2],0xa),'patch':parseInt(_0x2898c7[0x3],0xa)};}function a11_0x2f94(){const _0x2fabab=['ANTHROPIC_MODEL','Setup\x20failed','fail','--version','llm-proxy','ANTHROPIC_BASE_URL','info','\x27\x20to\x20','plugins','fetch','\x20is\x20too\x20old\x20(minimum:\x20','checkout','Treasure\x20AI\x20Docs\x20MCP\x20Server','Claude\x20Code\x20version\x20','CLAUDE_CODE_USE_BEDROCK','Configuring\x20marketplace\x20\x27','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','toISOString','Claude\x20Code\x20CLI\x20not\x20found','plugin','data','trim','reset','Checking\x20Claude\x20Code\x20version...','Failed\x20to\x20update\x20marketplace\x20\x27','td-docs','verbose','passThroughServer','\x27:\x20','Checking\x20out\x20td-skills\x20','site','user','workflow-skills','toString','\x27\x20updated','Failed\x20to\x20remove\x20outdated\x20MCP\x20server\x20\x27','Updating\x20MCP\x20server\x20\x27','✓\x20Settings\x20configured:\x20.claude/settings.local.json','https://github.com/treasure-data/td-skills','2433009qXLfbg','originalSettings','\x27\x20removed','resume','9695245wkwpZY','inherit','Initializing\x20proxy\x20logger...','stringify','stderr','td-skills\x20checked\x20out\x20at\x20tag\x20','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','remove','\x20configuration\x20failed','apiKey','utf-8','debug','cwd','description','Failed\x20to\x20add\x20new\x20URL,\x20restoring\x20previous\x20URL:\x20','parse','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','logLevel','39496248yvedty','Command\x20failed\x20(exit\x20','account_id','log','profile','stop','unshift','tdx\x20claude\x20statusline','--tags','INSTALLATION_FAILED','logger','list','access_token','command','warn','minor','http://127.0.0.1:','Creating\x20.claude/settings.local.json...','Restored\x20default\x20td-skills\x20marketplace','CLAUDE_CODE_NOT_FOUND','mcp','green','Configuring\x20MCP\x20server\x20\x27','http','https://docs.treasuredata.com/mcp','tdx-managed-proxy','tdx-cli','Failed\x20to\x20spawn\x20claude\x20command:\x20','4IZIdvu','sql-skills','red','\x20→\x20','start','1197928wBGncW','Restore\x20also\x20failed:\x20','join','Failed\x20to\x20install\x20plugin\x20\x27','install','Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20','stdout','get','marketplaces','8lKByXd','\x20meets\x20minimum\x20requirement','cause','init','port','claude','exit','\x20or\x20later.','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','close','git','major','context','name','statusLine','already\x20configured','MCP\x20server\x20\x27','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','Invalid\x20minimum\x20version\x20format:\x20','apikey','--force','Failed\x20to\x20list\x20marketplaces','INTERNAL','Failed\x20to\x20restore\x20MCP\x20server\x20\x27','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','oauth','patch','treasure-data','.claude','\x27...','marketplace','expires_at','Initializing...','update','false','CLAUDE_CODE_USE_VERTEX','liveSessionOriginals','main','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','✓\x20MCP\x20server\x20\x27','tdx-skills','\x20claude\x20statusline','✓\x20Marketplace\x20\x27','6020450plAsuf','match','Claude\x20Code\x20version\x20check\x20failed','Installing\x20plugin\x20\x27','add','Failed\x20to\x20remove\x20marketplace\x20\x27','10492788FqfTFC','ANTHROPIC_AUTH_TOKEN','origin/main','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','settings.local.json','getLogPath','--transport','already\x20installed','error','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','proxy','\x27\x20configured','2.0.20','text','Command\x20spawn\x20error:\x20','✓\x20Plugin\x20\x27','env','message','7475ZGzuTm','td-skills','pid','continue','\x27\x20URL...'];a11_0x2f94=function(){return _0x2fabab;};return a11_0x2f94();}export function compareVersions(_0x445d14,_0x2385d9){const _0x5d1d5e=a11_0xf23705;if(_0x445d14[_0x5d1d5e(0xfb)]!==_0x2385d9[_0x5d1d5e(0xfb)])return _0x445d14[_0x5d1d5e(0xfb)]-_0x2385d9[_0x5d1d5e(0xfb)];if(_0x445d14[_0x5d1d5e(0xd5)]!==_0x2385d9['minor'])return _0x445d14[_0x5d1d5e(0xd5)]-_0x2385d9[_0x5d1d5e(0xd5)];return _0x445d14['patch']-_0x2385d9[_0x5d1d5e(0x10a)];}function a11_0x37c3(_0x74864b,_0x4a20fd){_0x74864b=_0x74864b-0xbe;const _0x2f946b=a11_0x2f94();let _0x37c3fa=_0x2f946b[_0x74864b];return _0x37c3fa;}async function checkClaudeVersion(_0xf66f72,_0x584ea1){const _0x111174=a11_0xf23705;_0x584ea1?.[_0x111174(0xbf)](_0x111174(0xc4)+_0xf66f72+')');const _0x33ad4e=await executeClaudeCommand([_0x111174(0x13b)],undefined,_0x584ea1),_0x1a2bf1=parseVersion(_0x33ad4e);if(!_0x1a2bf1){_0x584ea1?.[_0x111174(0xd4)]('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x33ad4e);return;}const _0x6572ae=_0x1a2bf1['major']+'.'+_0x1a2bf1[_0x111174(0xd5)]+'.'+_0x1a2bf1[_0x111174(0x10a)],_0x2dc55c=parseVersion(_0xf66f72);if(!_0x2dc55c){_0x584ea1?.['warn'](_0x111174(0x102)+_0xf66f72);return;}if(compareVersions(_0x1a2bf1,_0x2dc55c)<0x0){_0x584ea1?.[_0x111174(0x129)](_0x111174(0x145)+_0x6572ae+_0x111174(0x142)+_0xf66f72+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],'Claude\x20Code\x20version\x20'+_0x6572ae+_0x111174(0x116)+_0xf66f72+_0x111174(0xf7),undefined,{'helpText':_0x111174(0x124)});}_0x584ea1?.[_0x111174(0xbf)](_0x111174(0x145)+_0x6572ae+_0x111174(0xf1));}async function executeClaudeCommand(_0x7dc992,_0x4efb96,_0x5d26c1){const _0x7f52e0=a11_0xf23705;return _0x5d26c1?.[_0x7f52e0(0x13e)]('Executing:\x20claude\x20'+_0x7dc992[_0x7f52e0(0xe9)]('\x20')),new Promise((_0x305095,_0x5bba43)=>{const _0x29f34e=_0x7f52e0,_0x50bdb6=crossSpawn(_0x29f34e(0xf5),_0x7dc992,{'stdio':'pipe'});let _0x53dfa0='',_0x3b9333='';_0x50bdb6[_0x29f34e(0xed)]?.['on'](_0x29f34e(0x14c),_0x53bdde=>{const _0x1dac28=_0x29f34e;_0x53dfa0+=_0x53bdde[_0x1dac28(0x159)]();}),_0x50bdb6[_0x29f34e(0x167)]?.['on'](_0x29f34e(0x14c),_0x3ba5ae=>{const _0x1d0beb=_0x29f34e;_0x3b9333+=_0x3ba5ae[_0x1d0beb(0x159)]();}),_0x50bdb6['on'](_0x29f34e(0x129),_0x5896a4=>{const _0x35f7cb=_0x29f34e;_0x5896a4['code']==='ENOENT'?(_0x5d26c1?.[_0x35f7cb(0x129)](_0x35f7cb(0x14a)),_0x5bba43(new SDKError(ErrorCode[_0x35f7cb(0xd9)],_0x35f7cb(0x14a),_0x5896a4,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x5d26c1?.[_0x35f7cb(0x129)](_0x35f7cb(0x12f)+_0x5896a4['message']),_0x5bba43(new SDKError(ErrorCode[_0x35f7cb(0x106)],_0x35f7cb(0xe1)+_0x5896a4[_0x35f7cb(0x132)],_0x5896a4)));}),_0x50bdb6['on'](_0x29f34e(0xf6),_0x5c3082=>{const _0x5360d2=_0x29f34e;if(_0x5c3082===0x0)_0x305095(_0x53dfa0);else _0x4efb96?(_0x5d26c1?.[_0x5360d2(0x129)](_0x5360d2(0xc7)+_0x5c3082+'):\x20claude\x20'+_0x7dc992[_0x5360d2(0xe9)]('\x20')),_0x5bba43(new SDKError(ErrorCode[_0x5360d2(0xcf)],_0x4efb96,new Error(_0x3b9333)))):_0x305095('');});});}async function ensureMcpServer(_0x1cf0fb,_0x37ed42,_0x480a44,_0xcaa418,_0x19b23c){const _0x191715=a11_0xf23705;_0xcaa418[_0x191715(0x12e)]=_0x191715(0xdc)+_0x1cf0fb+_0x191715(0x10d);const _0x5c1f79=await executeClaudeCommand([_0x191715(0xda),_0x191715(0xee),_0x1cf0fb],undefined,_0x19b23c);if(_0x5c1f79){const _0x156618=_0x5c1f79['match'](/URL:\s*(\S+)/);if(_0x156618&&_0x156618[0x1]===_0x37ed42){_0xcaa418['text']=_0x191715(0x117)+_0x1cf0fb+_0x191715(0x12c);return;}else{if(_0x156618){const _0x20c8af=_0x156618[0x1];_0x19b23c?.[_0x191715(0x13e)](_0x191715(0x100)+_0x1cf0fb+'\x27\x20URL\x20changed:\x20'+_0x20c8af+'\x20→\x20'+_0x37ed42),_0xcaa418['text']=_0x191715(0x15c)+_0x1cf0fb+_0x191715(0x137),await executeClaudeCommand([_0x191715(0xda),_0x191715(0x16a),_0x1cf0fb],_0x191715(0x15b)+_0x1cf0fb+'\x27',_0x19b23c);try{await executeClaudeCommand(['mcp',_0x191715(0x11f),_0x1cf0fb,_0x37ed42,'--transport',_0x480a44],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x1cf0fb+'\x27',_0x19b23c),_0xcaa418[_0x191715(0x12e)]=_0x191715(0x117)+_0x1cf0fb+_0x191715(0x15a);return;}catch(_0x2d4e3a){_0x19b23c?.[_0x191715(0x129)](_0x191715(0xc2)+_0x20c8af),await executeClaudeCommand([_0x191715(0xda),_0x191715(0x11f),_0x1cf0fb,_0x20c8af,_0x191715(0x127),_0x480a44],_0x191715(0x107)+_0x1cf0fb+_0x191715(0x13f)+_0x20c8af,_0x19b23c)['catch'](_0x28ee05=>_0x19b23c?.[_0x191715(0x129)](_0x191715(0xe8)+_0x28ee05));throw _0x2d4e3a;}}}}await executeClaudeCommand([_0x191715(0xda),'add',_0x1cf0fb,_0x37ed42,_0x191715(0x127),_0x480a44],_0x191715(0xf8)+_0x1cf0fb+'\x27',_0x19b23c),_0xcaa418[_0x191715(0x12e)]='✓\x20MCP\x20server\x20\x27'+_0x1cf0fb+'\x27\x20configured';}const TD_DOCS_MCP_URL=a11_0xf23705(0xde);export const DEFAULT_TD_SKILLS_URL=a11_0xf23705(0x15e);export function getTdSkillsRepoUrl(){const _0x4afcee=process.env.TDX_TD_SKILLS_REPO;if(_0x4afcee)return _0x4afcee;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x25d95b,_0x35ac3d){const _0xb7e857=a11_0xf23705;try{const _0x2499c5=await executeClaudeCommand(['plugin',_0xb7e857(0x10e),_0xb7e857(0xd1)],_0xb7e857(0x105),_0x35ac3d);if(!_0x2499c5['includes'](_0x25d95b)){_0x35ac3d?.[_0xb7e857(0xbf)]('Marketplace\x20\x27'+_0x25d95b+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand([_0xb7e857(0x14b),_0xb7e857(0x10e),'remove',_0x25d95b],_0xb7e857(0x120)+_0x25d95b+'\x27',_0x35ac3d),_0x35ac3d?.[_0xb7e857(0x13e)]('Marketplace\x20\x27'+_0x25d95b+_0xb7e857(0x161));}catch(_0xd44616){_0x35ac3d?.['warn']('Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x25d95b+_0xb7e857(0x154)+_0xd44616);}}async function restoreDefaultTdSkillsMarketplace(_0x255e2e){const _0x44129f=a11_0xf23705;try{await removeMarketplace('td-skills',_0x255e2e),await executeClaudeCommand([_0x44129f(0x14b),_0x44129f(0x10e),_0x44129f(0x11f),DEFAULT_TD_SKILLS_URL],undefined,_0x255e2e),_0x255e2e?.['info'](_0x44129f(0xd8));}catch{}}async function ensureMarketplace(_0x1ee117,_0x438ba4,_0x57d9aa,_0x15b9ae){const _0x251b3a=a11_0xf23705;_0x57d9aa[_0x251b3a(0x12e)]=_0x251b3a(0x147)+_0x1ee117+'\x27...',await executeClaudeCommand([_0x251b3a(0x14b),'marketplace',_0x251b3a(0x11f),_0x438ba4],'Failed\x20to\x20configure\x20marketplace\x20\x27'+_0x1ee117+'\x27',_0x15b9ae),_0x57d9aa[_0x251b3a(0x12e)]=_0x251b3a(0x11a)+_0x1ee117+_0x251b3a(0x12c);}async function updateMarketplace(_0x43dba9,_0x2f6ed4,_0x14e502){const _0x4a6b72=a11_0xf23705;_0x2f6ed4[_0x4a6b72(0x12e)]='Updating\x20marketplace\x20\x27'+_0x43dba9+_0x4a6b72(0x10d),await executeClaudeCommand([_0x4a6b72(0x14b),'marketplace',_0x4a6b72(0x111)],_0x4a6b72(0x150)+_0x43dba9+'\x27',_0x14e502),_0x2f6ed4['text']=_0x4a6b72(0x11a)+_0x43dba9+_0x4a6b72(0x15a);}async function ensurePlugin(_0xa74025,_0x52d56e,_0x167c8f,_0x157bd1){const _0x3ab113=a11_0xf23705;_0x167c8f[_0x3ab113(0x12e)]=_0x3ab113(0x11e)+_0xa74025+_0x3ab113(0x10d),await executeClaudeCommand(['plugin',_0x3ab113(0xeb),_0xa74025+'@'+_0x52d56e],_0x3ab113(0xea)+_0xa74025+'\x27',_0x157bd1),_0x167c8f[_0x3ab113(0x12e)]=_0x3ab113(0x130)+_0xa74025+'\x27\x20installed';}function getClaudeConfigDir(){const _0x1305d5=a11_0xf23705;return process.env.CLAUDE_CONFIG_DIR||join(homedir(),_0x1305d5(0x10c));}async function checkoutReleaseTag(_0x13ad6d,_0x4c9b81,_0x24acc1){const _0x39fa8a=a11_0xf23705,_0x2f0bd0=join(getClaudeConfigDir(),_0x39fa8a(0x140),_0x39fa8a(0xef),'td-skills');if(!existsSync(_0x2f0bd0)){_0x24acc1?.['debug'](_0x39fa8a(0x169));return;}_0x4c9b81[_0x39fa8a(0x12e)]=_0x39fa8a(0x155)+_0x13ad6d+'...',await execFileAsync('git',[_0x39fa8a(0x141),'origin',_0x39fa8a(0xce),_0x39fa8a(0x104)],{'cwd':_0x2f0bd0});try{await execFileAsync(_0x39fa8a(0xfa),[_0x39fa8a(0x143),_0x39fa8a(0x115)],{'cwd':_0x2f0bd0});}catch{await execFileAsync(_0x39fa8a(0xfa),[_0x39fa8a(0x143),'-b',_0x39fa8a(0x115),_0x39fa8a(0x123)],{'cwd':_0x2f0bd0});}await execFileAsync(_0x39fa8a(0xfa),[_0x39fa8a(0x14e),'--hard',_0x13ad6d],{'cwd':_0x2f0bd0}),_0x4c9b81[_0x39fa8a(0x12e)]='✓\x20td-skills\x20checked\x20out\x20at\x20'+_0x13ad6d,_0x24acc1?.['info'](_0x39fa8a(0x168)+_0x13ad6d);}async function createClaudeSettings(_0x590f68,_0x9a5dbe,_0x140cf5){const _0x582ca0=a11_0xf23705,_0x1b4b5f=join(process[_0x582ca0(0xc0)](),_0x582ca0(0x10c)),_0x2325d9=join(_0x1b4b5f,'settings.local.json'),_0x3cf50a=join(_0x1b4b5f,SETTINGS_BACKUP_FILENAME);await mkdir(_0x1b4b5f,{'recursive':!![]});const _0xc63586=await recoverFromStaleBackup(_0x2325d9,_0x3cf50a);let _0x139d17;if(_0xc63586)_0x139d17=_0xc63586[_0x582ca0(0x114)];else{let _0x4f97c3={};if(existsSync(_0x2325d9))try{const _0x45ec2d=await readFile(_0x2325d9,_0x582ca0(0xbe));_0x4f97c3=JSON[_0x582ca0(0xc3)](_0x45ec2d);}catch{_0x4f97c3={};}const _0x117fc9=_0x4f97c3[_0x582ca0(0x131)]||{};_0x139d17={'ANTHROPIC_BASE_URL':_0x117fc9[_0x582ca0(0x13d)],'ANTHROPIC_MODEL':_0x117fc9['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x117fc9[_0x582ca0(0x122)],'CLAUDE_CODE_USE_BEDROCK':_0x117fc9[_0x582ca0(0x146)],'CLAUDE_CODE_USE_VERTEX':_0x117fc9[_0x582ca0(0x113)],'statusLine':_0x4f97c3[_0x582ca0(0xfe)]};const _0x46699d={'createdAt':new Date()[_0x582ca0(0x149)](),'pid':process['pid'],'originalSettings':_0x139d17};await writeFile(_0x3cf50a,JSON['stringify'](_0x46699d,null,0x2)+'\x0a');}let _0x386fa0={};if(existsSync(_0x2325d9))try{const _0x18012d=await readFile(_0x2325d9,_0x582ca0(0xbe));_0x386fa0=JSON['parse'](_0x18012d);}catch{_0x386fa0={};}const _0x55041d=_0x386fa0[_0x582ca0(0x131)]||{},_0x4d40e0={..._0x386fa0,'env':{..._0x55041d,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x590f68,..._0x9a5dbe&&{'ANTHROPIC_MODEL':_0x9a5dbe},'ANTHROPIC_AUTH_TOKEN':_0x582ca0(0xdf),'CLAUDE_CODE_USE_BEDROCK':_0x582ca0(0x112),'CLAUDE_CODE_USE_VERTEX':_0x582ca0(0x112)},'statusLine':{'type':_0x582ca0(0xd3),'command':_0x140cf5?'tdx\x20--profile\x20'+_0x140cf5+_0x582ca0(0x119):_0x582ca0(0xcd)}};return await writeFile(_0x2325d9,JSON[_0x582ca0(0x166)](_0x4d40e0,null,0x2)+'\x0a'),_0x139d17;}async function restoreClaudeSettings(_0x59f9de){const _0x4e6668=a11_0xf23705,_0x103946=join(process[_0x4e6668(0xc0)](),'.claude'),_0x3727a3=join(_0x103946,_0x4e6668(0x125)),_0x3937d2=join(_0x103946,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x3727a3,_0x59f9de);try{if(existsSync(_0x3937d2)){const _0x12d2b1=await readFile(_0x3937d2,'utf-8'),_0x48758b=JSON[_0x4e6668(0xc3)](_0x12d2b1);_0x48758b['pid']===process[_0x4e6668(0x135)]&&await safeUnlink(_0x3937d2);}}catch{}}export class ClaudeCommand extends BaseCommand{[a11_0xf23705(0xfd)]='claude';[a11_0xf23705(0xc1)]=a11_0xf23705(0x108);[a11_0xf23705(0x153)];[a11_0xf23705(0x160)];['logger'];[a11_0xf23705(0xf4)];async['execute'](_0x2e0ba9){const _0x3d2c6d=a11_0xf23705,{tdx:_0x1c3152,options:_0xc2e6e7,args:_0x944fbd}=_0x2e0ba9;let _0x23a525=![];try{const _0x307832=_0xc2e6e7,_0x16ca46=_0x307832[_0x3d2c6d(0x12b)]===![],_0x47d75d=_0x307832[_0x3d2c6d(0x136)]===!![],_0x37370e=_0x307832[_0x3d2c6d(0x162)]===!![],_0x3bb467=[..._0x944fbd];if(_0x47d75d)_0x3bb467[_0x3d2c6d(0xcc)]('-c');else _0x37370e&&_0x3bb467[_0x3d2c6d(0xcc)]('-r');const _0x3173b1=createCommandSpinner(_0x3d2c6d(0x110),{'verbose':_0xc2e6e7[_0x3d2c6d(0x152)]});_0x3173b1[_0x3d2c6d(0xe6)]();try{if(!_0x16ca46){const _0x1932b0=_0xc2e6e7['profile'];try{const _0x20d561=await _0x1c3152[_0x3d2c6d(0x157)]['getCurrent']();_0x20d561['account_id']&&writeCachedAccountInfo(_0xc2e6e7[_0x3d2c6d(0x156)],_0x20d561[_0x3d2c6d(0xc8)],_0x1932b0);}catch{}_0x3173b1[_0x3d2c6d(0x12e)]=_0x3d2c6d(0x165),this[_0x3d2c6d(0xd0)]=new TDXLogger(_0xc2e6e7[_0x3d2c6d(0xc5)],!![]),await this[_0x3d2c6d(0xd0)][_0x3d2c6d(0xf3)]();const _0x2e8922=this[_0x3d2c6d(0xd0)][_0x3d2c6d(0x126)]();_0x3173b1[_0x3d2c6d(0x12e)]='✓\x20Logging\x20to\x20'+_0x2e8922;const _0x122505=getEndpoint(_0xc2e6e7[_0x3d2c6d(0x156)],_0x3d2c6d(0x13c));_0x3173b1['text']=_0x3d2c6d(0x101);let _0x10f976;const _0x426ea0=await getOAuthTokens(_0x1932b0);if(_0x426ea0)_0x10f976={'type':_0x3d2c6d(0x109),'accessToken':_0x426ea0[_0x3d2c6d(0xd2)],'refreshToken':_0x426ea0['refresh_token'],'expiresAt':_0x426ea0[_0x3d2c6d(0x10f)],'consoleUrl':getConsoleUrl(_0xc2e6e7['site'])};else{if(_0x1c3152['context'][_0x3d2c6d(0x16c)])_0x10f976={'type':_0x3d2c6d(0x103),'apiKey':_0x1c3152[_0x3d2c6d(0xfc)]['apiKey']};else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup');}this[_0x3d2c6d(0x153)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x122505,'auth':_0x10f976,'logger':this['logger'],'site':_0xc2e6e7[_0x3d2c6d(0x156)],'profile':_0x1932b0}),await this[_0x3d2c6d(0x153)][_0x3d2c6d(0xe6)](),this[_0x3d2c6d(0xf4)]=this[_0x3d2c6d(0x153)]['port'],_0x3173b1[_0x3d2c6d(0x12e)]='✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20'+this[_0x3d2c6d(0xf4)]+_0x3d2c6d(0xe5)+_0x122505,_0x3173b1['text']=_0x3d2c6d(0xd7),this[_0x3d2c6d(0x160)]=await createClaudeSettings(this['port'],undefined,_0x1932b0),_0x3173b1[_0x3d2c6d(0x12e)]=_0x3d2c6d(0x15d);}else _0x3173b1[_0x3d2c6d(0x12e)]=_0x3d2c6d(0x148);try{_0x3173b1['text']=_0x3d2c6d(0x14f),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x3d2c6d(0xd0)]),_0x3173b1[_0x3d2c6d(0x12e)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x58e6ac){_0x3173b1['fail'](_0x3d2c6d(0x11d));throw _0x58e6ac;}try{await ensureMcpServer(_0x3d2c6d(0x151),TD_DOCS_MCP_URL,_0x3d2c6d(0xdd),_0x3173b1,this[_0x3d2c6d(0xd0)]);}catch(_0x3584d3){handleInstallationError(_0x3584d3,_0x3d2c6d(0x144),_0x3173b1,this[_0x3d2c6d(0xd0)]);}try{const _0x1a6fd7=getTdSkillsRepoUrl();_0x23a525=_0x1a6fd7!==DEFAULT_TD_SKILLS_URL;_0x23a525&&await removeMarketplace(_0x3d2c6d(0x134),this[_0x3d2c6d(0xd0)]);await ensureMarketplace(_0x3d2c6d(0x134),_0x1a6fd7,_0x3173b1,this[_0x3d2c6d(0xd0)]),await updateMarketplace(_0x3d2c6d(0x134),_0x3173b1,this[_0x3d2c6d(0xd0)]),await ensurePlugin(_0x3d2c6d(0xe3),_0x3d2c6d(0x134),_0x3173b1,this[_0x3d2c6d(0xd0)]),await ensurePlugin(_0x3d2c6d(0x158),_0x3d2c6d(0x134),_0x3173b1,this[_0x3d2c6d(0xd0)]),await ensurePlugin(_0x3d2c6d(0x118),_0x3d2c6d(0x134),_0x3173b1,this[_0x3d2c6d(0xd0)]);try{const _0x51076b=loadReleaseChannel(),_0x1bb36a=await resolveReleaseTag(_0x51076b,_0x3d2c6d(0x10b),_0x3d2c6d(0x134),_0x3d2c6d(0xe0));_0x1bb36a&&await checkoutReleaseTag(_0x1bb36a,_0x3173b1,this[_0x3d2c6d(0xd0)]);}catch(_0xa539ad){this[_0x3d2c6d(0xd0)]?.[_0x3d2c6d(0xd4)](_0x3d2c6d(0xec)+_0xa539ad);}}catch(_0x557932){handleInstallationError(_0x557932,'td-skills\x20Plugins',_0x3173b1,this[_0x3d2c6d(0xd0)]);}_0x3173b1['stop']();}catch(_0x4267f5){_0x3173b1[_0x3d2c6d(0x13a)](_0x3d2c6d(0x139));throw _0x4267f5;}const _0x3951e5=await findExecutable(_0x3d2c6d(0xf5));if(!_0x3951e5)throw new SDKError(ErrorCode[_0x3d2c6d(0xd9)],_0x3d2c6d(0x14a),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x4e618={...process.env};!_0x16ca46&&(_0x4e618[_0x3d2c6d(0x13d)]=_0x3d2c6d(0xd6)+this[_0x3d2c6d(0xf4)],_0x4e618['ANTHROPIC_AUTH_TOKEN']=_0x3d2c6d(0xdf),_0x4e618[_0x3d2c6d(0x146)]=_0x3d2c6d(0x112),_0x4e618[_0x3d2c6d(0x113)]=_0x3d2c6d(0x112));_0x1c3152[_0x3d2c6d(0xfc)][_0x3d2c6d(0xca)]&&(_0x4e618['TDX_PROFILE']=_0x1c3152[_0x3d2c6d(0xfc)][_0x3d2c6d(0xca)]);const _0x4dbbdc=crossSpawn(_0x3951e5,_0x3bb467,{'stdio':_0x3d2c6d(0x164),'env':_0x4e618}),_0x1a9af7=await new Promise(_0x2fcb5f=>{const _0x4ca1f3=_0x3d2c6d;_0x4dbbdc['on'](_0x4ca1f3(0xf6),_0x47d39f=>{_0x2fcb5f(_0x47d39f||0x0);}),_0x4dbbdc['on'](_0x4ca1f3(0x129),_0x73e175=>{const _0x5caf69=_0x4ca1f3;console[_0x5caf69(0x129)](a11_0x163456[_0x5caf69(0xe4)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x73e175[_0x5caf69(0x132)])),_0x2fcb5f(0x1);});});_0x23a525&&await restoreDefaultTdSkillsMarketplace(this[_0x3d2c6d(0xd0)]);this[_0x3d2c6d(0x153)]&&(await this[_0x3d2c6d(0x153)]['stop'](),console['log'](a11_0x163456[_0x3d2c6d(0xdb)](_0x3d2c6d(0x12a))));if(this[_0x3d2c6d(0xd0)]){await this[_0x3d2c6d(0xd0)][_0x3d2c6d(0xf9)]();const _0x36d31b=this['logger'][_0x3d2c6d(0x126)]();console[_0x3d2c6d(0xc9)](a11_0x163456[_0x3d2c6d(0xdb)]('✓\x20Logs\x20saved\x20to\x20'+_0x36d31b));}return this[_0x3d2c6d(0x160)]&&(await restoreClaudeSettings(this[_0x3d2c6d(0x160)]),console[_0x3d2c6d(0xc9)](a11_0x163456['green']('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x1a9af7;}catch(_0x3ef69d){_0x23a525&&await restoreDefaultTdSkillsMarketplace(this[_0x3d2c6d(0xd0)]);this[_0x3d2c6d(0x153)]&&await this[_0x3d2c6d(0x153)][_0x3d2c6d(0xcb)]();this['logger']&&await this['logger'][_0x3d2c6d(0xf9)]();this[_0x3d2c6d(0x160)]&&await restoreClaudeSettings(this[_0x3d2c6d(0x160)]);throw _0x3ef69d;}}}
1
+ const a11_0x2eef39=a11_0xb2be;(function(_0x4b515e,_0x5b114e){const _0xaa4637=a11_0xb2be,_0x4987a8=_0x4b515e();while(!![]){try{const _0x504b95=parseInt(_0xaa4637(0x1eb))/0x1+-parseInt(_0xaa4637(0x229))/0x2+parseInt(_0xaa4637(0x233))/0x3+parseInt(_0xaa4637(0x1e6))/0x4*(parseInt(_0xaa4637(0x23c))/0x5)+-parseInt(_0xaa4637(0x1bc))/0x6+parseInt(_0xaa4637(0x234))/0x7*(parseInt(_0xaa4637(0x231))/0x8)+parseInt(_0xaa4637(0x1c5))/0x9*(-parseInt(_0xaa4637(0x21c))/0xa);if(_0x504b95===_0x5b114e)break;else _0x4987a8['push'](_0x4987a8['shift']());}catch(_0x49c8e1){_0x4987a8['push'](_0x4987a8['shift']());}}}(a11_0x2ca2,0xea46f));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{execFile}from'node:child_process';import{existsSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';import{promisify}from'node:util';import a11_0x44f47c from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint,getConsoleUrl}from'../sdk/client/endpoints.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';function a11_0x2ca2(){const _0x2daa39=['description','warn','tdx-skills','tdx\x20claude\x20statusline','Claude\x20Code\x20version\x20','main','Failed\x20to\x20add\x20new\x20URL,\x20restoring\x20previous\x20URL:\x20','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','CLAUDE_CODE_UNSUPPORTED_VERSION','error','\x20or\x20later.','originalSettings','2.0.20','mcp','Failed\x20to\x20spawn\x20claude\x20command:\x20','--force','continue','Failed\x20to\x20remove\x20outdated\x20MCP\x20server\x20\x27','sql-skills','Treasure\x20AI\x20Docs\x20MCP\x20Server','\x27\x20URL...','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','Updating\x20marketplace\x20\x27','join','major','git','\x27\x20configured','CLAUDE_CODE_USE_BEDROCK','red','Initializing...','72950ONXkEo','name','MCP\x20server\x20\x27','tdx-cli','\x27:\x20','workflow-skills','green','\x27\x20removed','Command\x20spawn\x20error:\x20','tdx-managed-proxy','checkout','\x20is\x20too\x20old\x20(minimum:\x20','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','814526LtyMSd','Checking\x20out\x20td-skills\x20','close','✓\x20Marketplace\x20\x27','td-skills\x20checked\x20out\x20at\x20tag\x20','http://127.0.0.1:','ANTHROPIC_AUTH_TOKEN','Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup','2533736cwcCeN','Restored\x20default\x20td-skills\x20marketplace','3889422CAsMpd','21SnrHmQ','expires_at','logger','text','liveSessionOriginals','exit','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','✓\x20Settings\x20configured:\x20.claude/settings.local.json','4236605OzDwih','Initializing\x20proxy\x20logger...','CLAUDE_CODE_NOT_FOUND','profile','cwd','claude','refresh_token','logLevel','init','debug','includes','minor','code','\x27\x20updated','toString','get','Failed\x20to\x20update\x20marketplace\x20\x27','Setup\x20failed','.claude','trim','Creating\x20.claude/settings.local.json...','ENOENT','http','list','marketplace','catch','env','message','\x20configuration\x20failed','access_token','oauth','Checking\x20Claude\x20Code\x20version...','pipe','execute','Configuring\x20marketplace\x20\x27','✓\x20Settings\x20restored:\x20.claude/settings.local.json','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','origin/main','toISOString','CLAUDE_CODE_USE_VERTEX','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','cause','Claude\x20Code\x20CLI\x20not\x20found','origin','getCurrent','reset','fail','start','...','--transport','stdout','patch','false','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','inherit','passThroughServer','Failed\x20to\x20install\x20plugin\x20\x27','remove','https://docs.treasuredata.com/mcp','4432566aBeEgZ','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','td-docs','\x20claude\x20statusline','verbose','marketplaces','INVALID_ARGUMENT','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','command','3321SAiJzM','port','stderr','\x20already\x20configured','already\x20configured','Claude\x20Code\x20version\x20check\x20failed','):\x20claude\x20','info','getLogPath','settings.local.json','fetch','\x20→\x20','INTERNAL','user','apiKey','plugin','proxy','ANTHROPIC_MODEL','data','unshift','context','Invalid\x20minimum\x20version\x20format:\x20','✓\x20Plugin\x20\x27','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','✓\x20Logs\x20saved\x20to\x20','account_id','log','match','stop','parse','llm-proxy','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','ANTHROPIC_BASE_URL','4LfVKnz','Failed\x20to\x20launch\x20Claude\x20Code:\x20','Warning:\x20Failed\x20to\x20configure\x20','✓\x20MCP\x20server\x20\x27','Configuring\x20MCP\x20server\x20\x27','1703532LrpWfI','Failed\x20to\x20remove\x20marketplace\x20\x27','✓\x20Logging\x20to\x20','✓\x20Claude\x20Code\x20version\x20OK','Failed\x20to\x20configure\x20marketplace\x20\x27','add','\x27...','✓\x20td-skills\x20checked\x20out\x20at\x20','statusLine','td-skills','td-skills\x20Plugins','utf-8','pid','stringify','site','INSTALLATION_FAILED','Failed\x20to\x20list\x20marketplaces','Command\x20output:\x20','Command\x20failed\x20(exit\x20'];a11_0x2ca2=function(){return _0x2daa39;};return a11_0x2ca2();}import{writeCachedAccountInfo,loadReleaseChannel}from'../core/config.js';import{resolveReleaseTag}from'../utils/github-releases.js';function a11_0xb2be(_0x3d8dbd,_0x48bd0b){_0x3d8dbd=_0x3d8dbd-0x1ab;const _0x2ca290=a11_0x2ca2();let _0xb2bef1=_0x2ca290[_0x3d8dbd];return _0xb2bef1;}const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION=a11_0x2eef39(0x20a),SETTINGS_BACKUP_FILENAME='.tdx-settings-backup.json';function isProcessRunning(_0x3bb5db){try{return process['kill'](_0x3bb5db,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x92be20,_0xd7e73b){const _0x19c8ad=a11_0x2eef39;if(!existsSync(_0x92be20))return;try{const _0x1b9617=await readFile(_0x92be20,_0x19c8ad(0x1f6)),_0x59046b=JSON[_0x19c8ad(0x1e2)](_0x1b9617),_0xaed099=_0x59046b[_0x19c8ad(0x256)]||{};for(const _0x5dbd5c of[_0x19c8ad(0x1e5),_0x19c8ad(0x1d6),'ANTHROPIC_AUTH_TOKEN','CLAUDE_CODE_USE_BEDROCK','CLAUDE_CODE_USE_VERTEX']){_0xd7e73b[_0x5dbd5c]!==undefined?_0xaed099[_0x5dbd5c]=_0xd7e73b[_0x5dbd5c]:delete _0xaed099[_0x5dbd5c];}_0xd7e73b['statusLine']!==undefined?_0x59046b[_0x19c8ad(0x1f3)]=_0xd7e73b[_0x19c8ad(0x1f3)]:delete _0x59046b[_0x19c8ad(0x1f3)],_0x59046b['env']=_0xaed099,await writeFile(_0x92be20,JSON[_0x19c8ad(0x1f8)](_0x59046b,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x17878b){try{await unlink(_0x17878b);}catch{}}async function recoverFromStaleBackup(_0x300503,_0x4ffb6d){const _0x5268b5=a11_0x2eef39;if(!existsSync(_0x4ffb6d))return undefined;try{const _0x58a1c0=await readFile(_0x4ffb6d,_0x5268b5(0x1f6)),_0x2cc729=JSON[_0x5268b5(0x1e2)](_0x58a1c0);if(isProcessRunning(_0x2cc729[_0x5268b5(0x1f7)]))return{'liveSessionOriginals':_0x2cc729[_0x5268b5(0x209)]};return await applyOriginalSettings(_0x300503,_0x2cc729['originalSettings']),await safeUnlink(_0x4ffb6d),undefined;}catch{return await safeUnlink(_0x4ffb6d),undefined;}}function handleInstallationError(_0x2a1ec7,_0x111d35,_0x3dbbba,_0x1cd16b){const _0x103683=a11_0x2eef39;errorContains(_0x2a1ec7,'already\x20exists','already\x20installed',_0x103683(0x1c9))?(_0x3dbbba['text']='✓\x20'+_0x111d35+_0x103683(0x1c8),_0x1cd16b?.[_0x103683(0x1cc)](_0x111d35+_0x103683(0x1c8)),_0x2a1ec7 instanceof SDKError&&_0x2a1ec7[_0x103683(0x265)]&&_0x1cd16b?.[_0x103683(0x245)](_0x103683(0x1fc)+_0x2a1ec7[_0x103683(0x265)][_0x103683(0x257)])):(_0x3dbbba[_0x103683(0x1ff)](_0x103683(0x1e8)+_0x111d35),_0x1cd16b?.['error'](_0x111d35+_0x103683(0x258),_0x2a1ec7));}export function parseVersion(_0xbddd01){const _0x4a61e5=a11_0x2eef39,_0x2c561a=_0xbddd01[_0x4a61e5(0x24f)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x2c561a)return null;return{'major':parseInt(_0x2c561a[0x1],0xa),'minor':parseInt(_0x2c561a[0x2],0xa),'patch':parseInt(_0x2c561a[0x3],0xa)};}export function compareVersions(_0x1ddb8b,_0x1993d8){const _0x3dda61=a11_0x2eef39;if(_0x1ddb8b[_0x3dda61(0x216)]!==_0x1993d8[_0x3dda61(0x216)])return _0x1ddb8b[_0x3dda61(0x216)]-_0x1993d8[_0x3dda61(0x216)];if(_0x1ddb8b['minor']!==_0x1993d8[_0x3dda61(0x247)])return _0x1ddb8b[_0x3dda61(0x247)]-_0x1993d8[_0x3dda61(0x247)];return _0x1ddb8b[_0x3dda61(0x1b4)]-_0x1993d8['patch'];}async function checkClaudeVersion(_0x44a05d,_0x1f1e85){const _0x14173c=a11_0x2eef39;_0x1f1e85?.['debug'](_0x14173c(0x260)+_0x44a05d+')');const _0x3a4c65=await executeClaudeCommand(['--version'],undefined,_0x1f1e85),_0x46ed7c=parseVersion(_0x3a4c65);if(!_0x46ed7c){_0x1f1e85?.[_0x14173c(0x1ff)](_0x14173c(0x1bd)+_0x3a4c65);return;}const _0x3f4fdb=_0x46ed7c[_0x14173c(0x216)]+'.'+_0x46ed7c[_0x14173c(0x247)]+'.'+_0x46ed7c['patch'],_0x5811d9=parseVersion(_0x44a05d);if(!_0x5811d9){_0x1f1e85?.[_0x14173c(0x1ff)](_0x14173c(0x1da)+_0x44a05d);return;}if(compareVersions(_0x46ed7c,_0x5811d9)<0x0){_0x1f1e85?.[_0x14173c(0x207)](_0x14173c(0x202)+_0x3f4fdb+_0x14173c(0x227)+_0x44a05d+')');throw new SDKError(ErrorCode[_0x14173c(0x206)],_0x14173c(0x202)+_0x3f4fdb+_0x14173c(0x1dc)+_0x44a05d+_0x14173c(0x208),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x1f1e85?.[_0x14173c(0x245)]('Claude\x20Code\x20version\x20'+_0x3f4fdb+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x154ed8,_0x1c9ff4,_0x41e373){const _0x23ea65=a11_0x2eef39;return _0x41e373?.['info']('Executing:\x20claude\x20'+_0x154ed8[_0x23ea65(0x215)]('\x20')),new Promise((_0x44f9c0,_0x74571f)=>{const _0x3d6792=_0x23ea65,_0x5e36b0=crossSpawn('claude',_0x154ed8,{'stdio':_0x3d6792(0x25c)});let _0x56e9a9='',_0x297921='';_0x5e36b0[_0x3d6792(0x1b3)]?.['on'](_0x3d6792(0x1d7),_0x46767d=>{const _0x249956=_0x3d6792;_0x56e9a9+=_0x46767d[_0x249956(0x24a)]();}),_0x5e36b0[_0x3d6792(0x1c7)]?.['on'](_0x3d6792(0x1d7),_0x207fc8=>{const _0x57f27a=_0x3d6792;_0x297921+=_0x207fc8[_0x57f27a(0x24a)]();}),_0x5e36b0['on']('error',_0xfc47b8=>{const _0x20a40f=_0x3d6792;_0xfc47b8[_0x20a40f(0x248)]===_0x20a40f(0x251)?(_0x41e373?.['error'](_0x20a40f(0x1ab)),_0x74571f(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x20a40f(0x1ab),_0xfc47b8,{'helpText':_0x20a40f(0x264)}))):(_0x41e373?.['error'](_0x20a40f(0x224)+_0xfc47b8[_0x20a40f(0x257)]),_0x74571f(new SDKError(ErrorCode[_0x20a40f(0x1d1)],_0x20a40f(0x20c)+_0xfc47b8[_0x20a40f(0x257)],_0xfc47b8)));}),_0x5e36b0['on'](_0x3d6792(0x239),_0x57ede0=>{const _0x2d1b6d=_0x3d6792;if(_0x57ede0===0x0)_0x44f9c0(_0x56e9a9);else _0x1c9ff4?(_0x41e373?.[_0x2d1b6d(0x207)](_0x2d1b6d(0x1fd)+_0x57ede0+_0x2d1b6d(0x1cb)+_0x154ed8[_0x2d1b6d(0x215)]('\x20')),_0x74571f(new SDKError(ErrorCode[_0x2d1b6d(0x1fa)],_0x1c9ff4,new Error(_0x297921)))):_0x44f9c0('');});});}async function ensureMcpServer(_0x276b21,_0x5afef6,_0x399073,_0x544ba3,_0x3d5825){const _0x55abb4=a11_0x2eef39;_0x544ba3[_0x55abb4(0x237)]=_0x55abb4(0x1ea)+_0x276b21+'\x27...';const _0x7b979=await executeClaudeCommand(['mcp',_0x55abb4(0x24b),_0x276b21],undefined,_0x3d5825);if(_0x7b979){const _0x2424ed=_0x7b979[_0x55abb4(0x1e0)](/URL:\s*(\S+)/);if(_0x2424ed&&_0x2424ed[0x1]===_0x5afef6){_0x544ba3['text']=_0x55abb4(0x1e9)+_0x276b21+_0x55abb4(0x218);return;}else{if(_0x2424ed){const _0x5643c5=_0x2424ed[0x1];_0x3d5825?.[_0x55abb4(0x1cc)](_0x55abb4(0x21e)+_0x276b21+'\x27\x20URL\x20changed:\x20'+_0x5643c5+_0x55abb4(0x1d0)+_0x5afef6),_0x544ba3[_0x55abb4(0x237)]='Updating\x20MCP\x20server\x20\x27'+_0x276b21+_0x55abb4(0x212),await executeClaudeCommand([_0x55abb4(0x20b),_0x55abb4(0x1ba),_0x276b21],_0x55abb4(0x20f)+_0x276b21+'\x27',_0x3d5825);try{await executeClaudeCommand(['mcp','add',_0x276b21,_0x5afef6,_0x55abb4(0x1b2),_0x399073],_0x55abb4(0x23a)+_0x276b21+'\x27',_0x3d5825),_0x544ba3[_0x55abb4(0x237)]=_0x55abb4(0x1e9)+_0x276b21+'\x27\x20updated';return;}catch(_0x446483){_0x3d5825?.[_0x55abb4(0x207)](_0x55abb4(0x204)+_0x5643c5),await executeClaudeCommand([_0x55abb4(0x20b),_0x55abb4(0x1f0),_0x276b21,_0x5643c5,_0x55abb4(0x1b2),_0x399073],'Failed\x20to\x20restore\x20MCP\x20server\x20\x27'+_0x276b21+'\x27\x20to\x20'+_0x5643c5,_0x3d5825)[_0x55abb4(0x255)](_0x242384=>_0x3d5825?.[_0x55abb4(0x207)]('Restore\x20also\x20failed:\x20'+_0x242384));throw _0x446483;}}}}await executeClaudeCommand([_0x55abb4(0x20b),'add',_0x276b21,_0x5afef6,_0x55abb4(0x1b2),_0x399073],_0x55abb4(0x23a)+_0x276b21+'\x27',_0x3d5825),_0x544ba3[_0x55abb4(0x237)]=_0x55abb4(0x1e9)+_0x276b21+_0x55abb4(0x218);}const TD_DOCS_MCP_URL=a11_0x2eef39(0x1bb);export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x1c6576=process.env.TDX_TD_SKILLS_REPO;if(_0x1c6576)return _0x1c6576;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x39d142,_0x55a093){const _0x2b38e2=a11_0x2eef39;try{const _0x23bc8a=await executeClaudeCommand([_0x2b38e2(0x1d4),_0x2b38e2(0x254),_0x2b38e2(0x253)],_0x2b38e2(0x1fb),_0x55a093);if(!_0x23bc8a[_0x2b38e2(0x246)](_0x39d142)){_0x55a093?.[_0x2b38e2(0x245)]('Marketplace\x20\x27'+_0x39d142+_0x2b38e2(0x205));return;}await executeClaudeCommand([_0x2b38e2(0x1d4),_0x2b38e2(0x254),_0x2b38e2(0x1ba),_0x39d142],_0x2b38e2(0x1ec)+_0x39d142+'\x27',_0x55a093),_0x55a093?.[_0x2b38e2(0x1cc)]('Marketplace\x20\x27'+_0x39d142+_0x2b38e2(0x223));}catch(_0x558146){_0x55a093?.[_0x2b38e2(0x1ff)]('Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x39d142+_0x2b38e2(0x220)+_0x558146);}}async function restoreDefaultTdSkillsMarketplace(_0x4a2c2f){const _0x1399f3=a11_0x2eef39;try{await removeMarketplace(_0x1399f3(0x1f4),_0x4a2c2f),await executeClaudeCommand([_0x1399f3(0x1d4),'marketplace',_0x1399f3(0x1f0),DEFAULT_TD_SKILLS_URL],undefined,_0x4a2c2f),_0x4a2c2f?.[_0x1399f3(0x1cc)](_0x1399f3(0x232));}catch{}}async function ensureMarketplace(_0x3e8636,_0x10dad0,_0x58b2ff,_0xeb149e){const _0x3572e3=a11_0x2eef39;_0x58b2ff[_0x3572e3(0x237)]=_0x3572e3(0x25e)+_0x3e8636+_0x3572e3(0x1f1),await executeClaudeCommand([_0x3572e3(0x1d4),_0x3572e3(0x254),'add',_0x10dad0],_0x3572e3(0x1ef)+_0x3e8636+'\x27',_0xeb149e),_0x58b2ff[_0x3572e3(0x237)]=_0x3572e3(0x22c)+_0x3e8636+_0x3572e3(0x218);}async function updateMarketplace(_0x3c0bc5,_0x24c7ec,_0xeccc9c){const _0x208626=a11_0x2eef39;_0x24c7ec[_0x208626(0x237)]=_0x208626(0x214)+_0x3c0bc5+_0x208626(0x1f1),await executeClaudeCommand(['plugin',_0x208626(0x254),'update'],_0x208626(0x24c)+_0x3c0bc5+'\x27',_0xeccc9c),_0x24c7ec[_0x208626(0x237)]=_0x208626(0x22c)+_0x3c0bc5+_0x208626(0x249);}async function ensurePlugin(_0x38c4ca,_0x55904c,_0x499da6,_0x2b695e){const _0x4bfcb6=a11_0x2eef39;_0x499da6['text']='Installing\x20plugin\x20\x27'+_0x38c4ca+_0x4bfcb6(0x1f1),await executeClaudeCommand([_0x4bfcb6(0x1d4),'install',_0x38c4ca+'@'+_0x55904c],_0x4bfcb6(0x1b9)+_0x38c4ca+'\x27',_0x2b695e),_0x499da6[_0x4bfcb6(0x237)]=_0x4bfcb6(0x1db)+_0x38c4ca+'\x27\x20installed';}function getClaudeConfigDir(){const _0x48d0d6=a11_0x2eef39;return process.env.CLAUDE_CONFIG_DIR||join(homedir(),_0x48d0d6(0x24e));}async function checkoutReleaseTag(_0x2d21f4,_0x41689e,_0x28cabf){const _0x242ec2=a11_0x2eef39,_0x47c14a=join(getClaudeConfigDir(),'plugins',_0x242ec2(0x1c1),'td-skills');if(!existsSync(_0x47c14a)){_0x28cabf?.[_0x242ec2(0x245)](_0x242ec2(0x1c3));return;}_0x41689e['text']=_0x242ec2(0x22a)+_0x2d21f4+_0x242ec2(0x1b1),await execFileAsync(_0x242ec2(0x217),[_0x242ec2(0x1cf),_0x242ec2(0x1ac),'--tags',_0x242ec2(0x20d)],{'cwd':_0x47c14a});try{await execFileAsync(_0x242ec2(0x217),['checkout','main'],{'cwd':_0x47c14a});}catch{await execFileAsync('git',[_0x242ec2(0x226),'-b',_0x242ec2(0x203),_0x242ec2(0x261)],{'cwd':_0x47c14a});}await execFileAsync(_0x242ec2(0x217),[_0x242ec2(0x1ae),'--hard',_0x2d21f4],{'cwd':_0x47c14a}),_0x41689e[_0x242ec2(0x237)]=_0x242ec2(0x1f2)+_0x2d21f4,_0x28cabf?.[_0x242ec2(0x1cc)](_0x242ec2(0x22d)+_0x2d21f4);}async function createClaudeSettings(_0x4bf0d5,_0x16b274,_0x87ecdc){const _0x2e37f4=a11_0x2eef39,_0x122fed=join(process[_0x2e37f4(0x240)](),_0x2e37f4(0x24e)),_0x49c733=join(_0x122fed,'settings.local.json'),_0x2d5cc9=join(_0x122fed,SETTINGS_BACKUP_FILENAME);await mkdir(_0x122fed,{'recursive':!![]});const _0x3e627d=await recoverFromStaleBackup(_0x49c733,_0x2d5cc9);let _0x24415a;if(_0x3e627d)_0x24415a=_0x3e627d[_0x2e37f4(0x238)];else{let _0x52007d={};if(existsSync(_0x49c733))try{const _0x44c6b2=await readFile(_0x49c733,'utf-8');_0x52007d=JSON[_0x2e37f4(0x1e2)](_0x44c6b2);}catch{_0x52007d={};}const _0x31d8df=_0x52007d[_0x2e37f4(0x256)]||{};_0x24415a={'ANTHROPIC_BASE_URL':_0x31d8df['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x31d8df[_0x2e37f4(0x1d6)],'ANTHROPIC_AUTH_TOKEN':_0x31d8df[_0x2e37f4(0x22f)],'CLAUDE_CODE_USE_BEDROCK':_0x31d8df[_0x2e37f4(0x219)],'CLAUDE_CODE_USE_VERTEX':_0x31d8df['CLAUDE_CODE_USE_VERTEX'],'statusLine':_0x52007d[_0x2e37f4(0x1f3)]};const _0x972a83={'createdAt':new Date()[_0x2e37f4(0x262)](),'pid':process['pid'],'originalSettings':_0x24415a};await writeFile(_0x2d5cc9,JSON[_0x2e37f4(0x1f8)](_0x972a83,null,0x2)+'\x0a');}let _0x586266={};if(existsSync(_0x49c733))try{const _0x49cde0=await readFile(_0x49c733,_0x2e37f4(0x1f6));_0x586266=JSON['parse'](_0x49cde0);}catch{_0x586266={};}const _0xf0b956=_0x586266[_0x2e37f4(0x256)]||{},_0x24e313={..._0x586266,'env':{..._0xf0b956,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x4bf0d5,..._0x16b274&&{'ANTHROPIC_MODEL':_0x16b274},'ANTHROPIC_AUTH_TOKEN':_0x2e37f4(0x225),'CLAUDE_CODE_USE_BEDROCK':_0x2e37f4(0x1b5),'CLAUDE_CODE_USE_VERTEX':'false'},'statusLine':{'type':_0x2e37f4(0x1c4),'command':_0x87ecdc?'tdx\x20--profile\x20'+_0x87ecdc+_0x2e37f4(0x1bf):_0x2e37f4(0x201)}};return await writeFile(_0x49c733,JSON[_0x2e37f4(0x1f8)](_0x24e313,null,0x2)+'\x0a'),_0x24415a;}async function restoreClaudeSettings(_0x23569f){const _0x27b3d4=a11_0x2eef39,_0x1d447e=join(process['cwd'](),'.claude'),_0x28f53e=join(_0x1d447e,_0x27b3d4(0x1ce)),_0x39eabd=join(_0x1d447e,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x28f53e,_0x23569f);try{if(existsSync(_0x39eabd)){const _0x5dd718=await readFile(_0x39eabd,_0x27b3d4(0x1f6)),_0x44252e=JSON[_0x27b3d4(0x1e2)](_0x5dd718);_0x44252e[_0x27b3d4(0x1f7)]===process[_0x27b3d4(0x1f7)]&&await safeUnlink(_0x39eabd);}}catch{}}export class ClaudeCommand extends BaseCommand{[a11_0x2eef39(0x21d)]=a11_0x2eef39(0x241);[a11_0x2eef39(0x1fe)]=a11_0x2eef39(0x213);['passThroughServer'];[a11_0x2eef39(0x209)];['logger'];['port'];async[a11_0x2eef39(0x25d)](_0x5d5955){const _0x2ac08a=a11_0x2eef39,{tdx:_0x46c54e,options:_0x49339e,args:_0x524c1d}=_0x5d5955;let _0x19d3df=![];try{const _0x6b11c0=_0x49339e,_0x5f3952=_0x6b11c0[_0x2ac08a(0x1d5)]===![],_0x31fa27=_0x6b11c0[_0x2ac08a(0x20e)]===!![],_0x12a0fe=_0x6b11c0['resume']===!![],_0x3a1073=[..._0x524c1d];if(_0x31fa27)_0x3a1073[_0x2ac08a(0x1d8)]('-c');else _0x12a0fe&&_0x3a1073[_0x2ac08a(0x1d8)]('-r');const _0x25caa6=createCommandSpinner(_0x2ac08a(0x21b),{'verbose':_0x49339e[_0x2ac08a(0x1c0)]});_0x25caa6[_0x2ac08a(0x1b0)]();try{if(!_0x5f3952){const _0x3be5a5=_0x49339e[_0x2ac08a(0x23f)];try{const _0x29c82a=await _0x46c54e[_0x2ac08a(0x1d2)][_0x2ac08a(0x1ad)]();_0x29c82a[_0x2ac08a(0x1de)]&&writeCachedAccountInfo(_0x49339e[_0x2ac08a(0x1f9)],_0x29c82a[_0x2ac08a(0x1de)],_0x3be5a5);}catch{}_0x25caa6[_0x2ac08a(0x237)]=_0x2ac08a(0x23d),this['logger']=new TDXLogger(_0x49339e[_0x2ac08a(0x243)],!![]),await this[_0x2ac08a(0x236)][_0x2ac08a(0x244)]();const _0x26179e=this['logger'][_0x2ac08a(0x1cd)]();_0x25caa6[_0x2ac08a(0x237)]=_0x2ac08a(0x1ed)+_0x26179e;const _0x435172=getEndpoint(_0x49339e['site'],_0x2ac08a(0x1e3));_0x25caa6['text']=_0x2ac08a(0x1e4);let _0x45b5c8;const _0x40a54f=await getOAuthTokens(_0x3be5a5);if(_0x40a54f)_0x45b5c8={'type':_0x2ac08a(0x25a),'accessToken':_0x40a54f[_0x2ac08a(0x259)],'refreshToken':_0x40a54f[_0x2ac08a(0x242)],'expiresAt':_0x40a54f[_0x2ac08a(0x235)],'consoleUrl':getConsoleUrl(_0x49339e[_0x2ac08a(0x1f9)])};else{if(_0x46c54e[_0x2ac08a(0x1d9)][_0x2ac08a(0x1d3)])_0x45b5c8={'type':'apikey','apiKey':_0x46c54e[_0x2ac08a(0x1d9)][_0x2ac08a(0x1d3)]};else throw new SDKError(ErrorCode[_0x2ac08a(0x1c2)],_0x2ac08a(0x230));}this[_0x2ac08a(0x1b8)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x435172,'auth':_0x45b5c8,'logger':this[_0x2ac08a(0x236)],'site':_0x49339e['site'],'profile':_0x3be5a5}),await this[_0x2ac08a(0x1b8)][_0x2ac08a(0x1b0)](),this[_0x2ac08a(0x1c6)]=this['passThroughServer'][_0x2ac08a(0x1c6)],_0x25caa6[_0x2ac08a(0x237)]=_0x2ac08a(0x228)+this[_0x2ac08a(0x1c6)]+'\x20→\x20'+_0x435172,_0x25caa6[_0x2ac08a(0x237)]=_0x2ac08a(0x250),this[_0x2ac08a(0x209)]=await createClaudeSettings(this['port'],undefined,_0x3be5a5),_0x25caa6[_0x2ac08a(0x237)]=_0x2ac08a(0x23b);}else _0x25caa6[_0x2ac08a(0x237)]='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';try{_0x25caa6[_0x2ac08a(0x237)]=_0x2ac08a(0x25b),await checkClaudeVersion(MIN_CLAUDE_VERSION,this['logger']),_0x25caa6['text']=_0x2ac08a(0x1ee);}catch(_0x713ee1){_0x25caa6[_0x2ac08a(0x1af)](_0x2ac08a(0x1ca));throw _0x713ee1;}try{await ensureMcpServer(_0x2ac08a(0x1be),TD_DOCS_MCP_URL,_0x2ac08a(0x252),_0x25caa6,this['logger']);}catch(_0x16aa67){handleInstallationError(_0x16aa67,_0x2ac08a(0x211),_0x25caa6,this[_0x2ac08a(0x236)]);}try{const _0x1fcd64=getTdSkillsRepoUrl();_0x19d3df=_0x1fcd64!==DEFAULT_TD_SKILLS_URL;_0x19d3df&&await removeMarketplace('td-skills',this[_0x2ac08a(0x236)]);await ensureMarketplace(_0x2ac08a(0x1f4),_0x1fcd64,_0x25caa6,this[_0x2ac08a(0x236)]),await updateMarketplace(_0x2ac08a(0x1f4),_0x25caa6,this[_0x2ac08a(0x236)]),await ensurePlugin(_0x2ac08a(0x210),'td-skills',_0x25caa6,this[_0x2ac08a(0x236)]),await ensurePlugin(_0x2ac08a(0x221),_0x2ac08a(0x1f4),_0x25caa6,this[_0x2ac08a(0x236)]),await ensurePlugin(_0x2ac08a(0x200),_0x2ac08a(0x1f4),_0x25caa6,this['logger']);try{const _0x40cdec=loadReleaseChannel(),_0x2213a3=await resolveReleaseTag(_0x40cdec,'treasure-data','td-skills',_0x2ac08a(0x21f));_0x2213a3&&await checkoutReleaseTag(_0x2213a3,_0x25caa6,this['logger']);}catch(_0x217e52){this['logger']?.[_0x2ac08a(0x1ff)]('Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20'+_0x217e52);}}catch(_0x2cebcc){handleInstallationError(_0x2cebcc,_0x2ac08a(0x1f5),_0x25caa6,this['logger']);}_0x25caa6['stop']();}catch(_0x5a49cc){_0x25caa6[_0x2ac08a(0x1af)](_0x2ac08a(0x24d));throw _0x5a49cc;}const _0x206e7c=await findExecutable(_0x2ac08a(0x241));if(!_0x206e7c)throw new SDKError(ErrorCode[_0x2ac08a(0x23e)],_0x2ac08a(0x1ab),undefined,{'helpText':_0x2ac08a(0x264)});const _0x422d95={...process.env};!_0x5f3952&&(_0x422d95[_0x2ac08a(0x1e5)]=_0x2ac08a(0x22e)+this[_0x2ac08a(0x1c6)],_0x422d95[_0x2ac08a(0x22f)]=_0x2ac08a(0x225),_0x422d95[_0x2ac08a(0x219)]=_0x2ac08a(0x1b5),_0x422d95[_0x2ac08a(0x263)]=_0x2ac08a(0x1b5));_0x46c54e['context'][_0x2ac08a(0x23f)]&&(_0x422d95['TDX_PROFILE']=_0x46c54e[_0x2ac08a(0x1d9)][_0x2ac08a(0x23f)]);const _0x26b5ea=crossSpawn(_0x206e7c,_0x3a1073,{'stdio':_0x2ac08a(0x1b7),'env':_0x422d95}),_0x29dcda=await new Promise(_0xfd5f1a=>{const _0x2a5048=_0x2ac08a;_0x26b5ea['on'](_0x2a5048(0x239),_0x1e1ee6=>{_0xfd5f1a(_0x1e1ee6||0x0);}),_0x26b5ea['on']('error',_0x4c1627=>{const _0x3e4273=_0x2a5048;console[_0x3e4273(0x207)](a11_0x44f47c[_0x3e4273(0x21a)](_0x3e4273(0x1e7)+_0x4c1627[_0x3e4273(0x257)])),_0xfd5f1a(0x1);});});_0x19d3df&&await restoreDefaultTdSkillsMarketplace(this[_0x2ac08a(0x236)]);this[_0x2ac08a(0x1b8)]&&(await this[_0x2ac08a(0x1b8)]['stop'](),console[_0x2ac08a(0x1df)](a11_0x44f47c[_0x2ac08a(0x222)](_0x2ac08a(0x1b6))));if(this[_0x2ac08a(0x236)]){await this[_0x2ac08a(0x236)][_0x2ac08a(0x22b)]();const _0x5560c7=this['logger']['getLogPath']();console[_0x2ac08a(0x1df)](a11_0x44f47c[_0x2ac08a(0x222)](_0x2ac08a(0x1dd)+_0x5560c7));}return this[_0x2ac08a(0x209)]&&(await restoreClaudeSettings(this[_0x2ac08a(0x209)]),console[_0x2ac08a(0x1df)](a11_0x44f47c[_0x2ac08a(0x222)](_0x2ac08a(0x25f)))),_0x29dcda;}catch(_0x358116){_0x19d3df&&await restoreDefaultTdSkillsMarketplace(this[_0x2ac08a(0x236)]);this[_0x2ac08a(0x1b8)]&&await this['passThroughServer'][_0x2ac08a(0x1e1)]();this[_0x2ac08a(0x236)]&&await this[_0x2ac08a(0x236)][_0x2ac08a(0x22b)]();this['originalSettings']&&await restoreClaudeSettings(this[_0x2ac08a(0x209)]);throw _0x358116;}}}
@@ -1 +1 @@
1
- const a12_0x364276=a12_0xf9e4;(function(_0x2f92d9,_0x4e2a45){const _0x43be10=a12_0xf9e4,_0x482a49=_0x2f92d9();while(!![]){try{const _0x3ac9ae=parseInt(_0x43be10(0x1a3))/0x1*(parseInt(_0x43be10(0x198))/0x2)+parseInt(_0x43be10(0x197))/0x3*(-parseInt(_0x43be10(0x1a0))/0x4)+-parseInt(_0x43be10(0x1a5))/0x5+-parseInt(_0x43be10(0x18d))/0x6*(-parseInt(_0x43be10(0x186))/0x7)+parseInt(_0x43be10(0x196))/0x8+parseInt(_0x43be10(0x1a9))/0x9+-parseInt(_0x43be10(0x185))/0xa;if(_0x3ac9ae===_0x4e2a45)break;else _0x482a49['push'](_0x482a49['shift']());}catch(_0x435e98){_0x482a49['push'](_0x482a49['shift']());}}}(a12_0x3342,0xec3b5));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';function a12_0xf9e4(_0x171ce0,_0x5c0f02){_0x171ce0=_0x171ce0-0x184;const _0x334297=a12_0x3342();let _0xf9e4ba=_0x334297[_0x171ce0];return _0xf9e4ba;}import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';function a12_0x3342(){const _0x155df9=['accountId','cache_read_input_tokens','💎\x20tdx\x20-\x20Claude','todayCredits','session_id','Claude','12001900oRXCXw','7RTzBHl','sessionCredits','push','🪙\x20credit:\x20','statusline','💎\x20','\x20month','5557734xLIoNc','\x20session\x20/\x20','cache_creation_input_tokens','tdx\x20','description','stdin','model','context_window','parse','2379536lwKsFK','1907418GlKVaM','1739226IZtBeZ','execute','close','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','tdx','profile','log','\x20today\x20/\x20','8DkzoeI','🧠\x20','\x20-\x20','2goAzgu','used_percentage','4223070VGzDsd','name','current_usage','monthCredits','11889576GyTVNh','line'];a12_0x3342=function(){return _0x155df9;};return a12_0x3342();}import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x8b781c=0x64){return new Promise(_0xd0d281=>{const _0x2e03ad=a12_0xf9e4;let _0x10f98d='',_0x5242f6=![];const _0x32d6d6=createInterface({'input':process[_0x2e03ad(0x192)],'terminal':![]}),_0x106c7d=_0x461baf=>{const _0x472db9=_0x2e03ad;if(_0x5242f6)return;_0x5242f6=!![],clearTimeout(_0x207d4e),_0x32d6d6[_0x472db9(0x19a)](),_0xd0d281(_0x461baf);},_0x207d4e=setTimeout(()=>{_0x106c7d(null);},_0x8b781c);_0x32d6d6['on'](_0x2e03ad(0x1aa),_0x5eefa1=>{_0x10f98d+=_0x5eefa1;}),_0x32d6d6['on']('close',()=>{const _0x44bd32=_0x2e03ad;if(_0x5242f6)return;try{const _0x3c5c19=JSON[_0x44bd32(0x195)](_0x10f98d);_0x106c7d(_0x3c5c19);}catch{_0x106c7d(null);}});});}function formatCredits(_0xcae860){return _0xcae860['toFixed'](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a12_0x364276(0x1a6)]=a12_0x364276(0x18a);[a12_0x364276(0x191)]=a12_0x364276(0x19b);async[a12_0x364276(0x199)](_0x119d37){const _0x4a80c8=a12_0x364276;try{const _0x36a449=await readStdinJson();if(!_0x36a449?.['session_id'])return console['log']('💎\x20tdx\x20-\x20Claude'),0x0;const _0x15830c=_0x36a449[_0x4a80c8(0x1af)],_0x2ac3d3=_0x36a449[_0x4a80c8(0x193)]?.['id']||'',_0x52464d=_0x36a449[_0x4a80c8(0x19d)]||_0x119d37['options'][_0x4a80c8(0x19d)],_0x1d907e=await getUsageStats(_0x15830c,_0x52464d),_0x426b7c=[],_0x2f0687=readCachedAccountInfo(_0x52464d),_0x2c942e=_0x2f0687?_0x4a80c8(0x190)+_0x2f0687['site']+':'+_0x2f0687[_0x4a80c8(0x1ab)]:_0x4a80c8(0x19c),_0x24170d=_0x2ac3d3?getModelDisplayName(_0x2ac3d3):_0x4a80c8(0x184);_0x426b7c['push'](_0x4a80c8(0x18b)+_0x2c942e+_0x4a80c8(0x1a2)+_0x24170d);const _0x424ecc=formatCredits(_0x1d907e[_0x4a80c8(0x187)]),_0x272340=formatCredits(_0x1d907e[_0x4a80c8(0x1ae)]),_0x3edcf8=formatCredits(_0x1d907e[_0x4a80c8(0x1a8)]);_0x426b7c[_0x4a80c8(0x188)](_0x4a80c8(0x189)+_0x424ecc+_0x4a80c8(0x18e)+_0x272340+_0x4a80c8(0x19f)+_0x3edcf8+_0x4a80c8(0x18c));const _0x49049b=_0x36a449[_0x4a80c8(0x194)],_0x3c9390=_0x49049b?.[_0x4a80c8(0x1a7)];if(_0x3c9390&&_0x49049b?.[_0x4a80c8(0x1a4)]!=null){const _0xb64560=_0x3c9390['input_tokens']+_0x3c9390[_0x4a80c8(0x18f)]+_0x3c9390[_0x4a80c8(0x1ac)],_0x463d8e=formatTokenCount(_0xb64560),_0x1a89e6=Math['round'](_0x49049b['used_percentage']);_0x426b7c[_0x4a80c8(0x188)](_0x4a80c8(0x1a1)+_0x463d8e+'\x20('+_0x1a89e6+'%)');}return console[_0x4a80c8(0x19e)](_0x426b7c['join']('\x20|\x20')),0x0;}catch{return console['log'](_0x4a80c8(0x1ad)),0x0;}}}
1
+ function a12_0x2d5a(_0x10f72c,_0x444ffa){_0x10f72c=_0x10f72c-0xed;const _0x580efb=a12_0x580e();let _0x2d5ae7=_0x580efb[_0x10f72c];return _0x2d5ae7;}const a12_0x468fcb=a12_0x2d5a;(function(_0x10a70b,_0x5b4896){const _0x583801=a12_0x2d5a,_0x5cf3d3=_0x10a70b();while(!![]){try{const _0x39e6bf=-parseInt(_0x583801(0x102))/0x1*(-parseInt(_0x583801(0x10b))/0x2)+parseInt(_0x583801(0x105))/0x3+parseInt(_0x583801(0xfc))/0x4*(-parseInt(_0x583801(0x10d))/0x5)+parseInt(_0x583801(0xf9))/0x6+-parseInt(_0x583801(0x117))/0x7*(-parseInt(_0x583801(0x103))/0x8)+parseInt(_0x583801(0x112))/0x9*(parseInt(_0x583801(0x100))/0xa)+-parseInt(_0x583801(0xf6))/0xb*(parseInt(_0x583801(0xee))/0xc);if(_0x39e6bf===_0x5b4896)break;else _0x5cf3d3['push'](_0x5cf3d3['shift']());}catch(_0x4fdfd9){_0x5cf3d3['push'](_0x5cf3d3['shift']());}}}(a12_0x580e,0xc3e19));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x9aa90d=0x64){return new Promise(_0x3f23d1=>{const _0x16c44a=a12_0x2d5a;let _0x41a742='',_0xb10576=![];const _0x40f406=createInterface({'input':process['stdin'],'terminal':![]}),_0x450ad9=_0x59bc1d=>{const _0x265f19=a12_0x2d5a;if(_0xb10576)return;_0xb10576=!![],clearTimeout(_0x40e842),_0x40f406[_0x265f19(0xf5)](),_0x3f23d1(_0x59bc1d);},_0x40e842=setTimeout(()=>{_0x450ad9(null);},_0x9aa90d);_0x40f406['on'](_0x16c44a(0xf3),_0x1b0a4a=>{_0x41a742+=_0x1b0a4a;}),_0x40f406['on'](_0x16c44a(0xf5),()=>{const _0x336897=_0x16c44a;if(_0xb10576)return;try{const _0x3b9e22=JSON[_0x336897(0x109)](_0x41a742);_0x450ad9(_0x3b9e22);}catch{_0x450ad9(null);}});});}function a12_0x580e(){const _0x340ca1=['session_id','919590SHCama','toFixed','15pXJqrU','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','push','current_usage','accountId','27xAxpHS','\x20|\x20','\x20session\x20/\x20','context_window','\x20month','2237739KzhANW','log','1104WAUtoZ','sessionCredits','🪙\x20credit:\x20','description','cache_creation_input_tokens','line','round','close','175153hkvDsd','todayCredits','💎\x20tdx\x20-\x20Claude','4045884BwXKoE','site','tdx\x20','1140340IbOdyH','profile','input_tokens','🧠\x20','1337110fBqhNt','used_percentage','1vvAyRm','8lFfgBK','monthCredits','3802743LwhePQ','tdx','💎\x20','name','parse'];a12_0x580e=function(){return _0x340ca1;};return a12_0x580e();}function formatCredits(_0x5dea35){const _0x1cf1e6=a12_0x2d5a;return _0x5dea35[_0x1cf1e6(0x10c)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a12_0x468fcb(0x108)]='statusline';[a12_0x468fcb(0xf1)]=a12_0x468fcb(0x10e);async['execute'](_0x7b95a4){const _0x5113e0=a12_0x468fcb;try{const _0x2a34e9=await readStdinJson();if(!_0x2a34e9?.[_0x5113e0(0x10a)])return console['log']('💎\x20tdx\x20-\x20Claude'),0x0;const _0x11d2b3=_0x2a34e9[_0x5113e0(0x10a)],_0x3dafa6=_0x2a34e9['model']?.['id']||'',_0x54bc7c=_0x2a34e9['profile']||_0x7b95a4['options'][_0x5113e0(0xfd)],_0x3fd244=await getUsageStats(_0x11d2b3,_0x54bc7c),_0x3e0128=[],_0x530714=readCachedAccountInfo(_0x54bc7c),_0x260168=_0x530714?_0x5113e0(0xfb)+_0x530714[_0x5113e0(0xfa)]+':'+_0x530714[_0x5113e0(0x111)]:_0x5113e0(0x106),_0x5016d1=_0x3dafa6?getModelDisplayName(_0x3dafa6):'Claude';_0x3e0128['push'](_0x5113e0(0x107)+_0x260168+'\x20-\x20'+_0x5016d1);const _0x355f23=formatCredits(_0x3fd244[_0x5113e0(0xef)]),_0x134228=formatCredits(_0x3fd244[_0x5113e0(0xf7)]),_0x3baa7a=formatCredits(_0x3fd244[_0x5113e0(0x104)]);_0x3e0128[_0x5113e0(0x10f)](_0x5113e0(0xf0)+_0x355f23+_0x5113e0(0x114)+_0x134228+'\x20today\x20/\x20'+_0x3baa7a+_0x5113e0(0x116));const _0x332e0b=_0x2a34e9[_0x5113e0(0x115)],_0x2714e1=_0x332e0b?.[_0x5113e0(0x110)];if(_0x2714e1&&_0x332e0b?.[_0x5113e0(0x101)]!=null){const _0x350a10=_0x2714e1[_0x5113e0(0xfe)]+_0x2714e1[_0x5113e0(0xf2)]+_0x2714e1['cache_read_input_tokens'],_0x401261=formatTokenCount(_0x350a10),_0x110f8d=Math[_0x5113e0(0xf4)](_0x332e0b[_0x5113e0(0x101)]);_0x3e0128[_0x5113e0(0x10f)](_0x5113e0(0xff)+_0x401261+'\x20('+_0x110f8d+'%)');}return console[_0x5113e0(0xed)](_0x3e0128['join'](_0x5113e0(0x113))),0x0;}catch{return console[_0x5113e0(0xed)](_0x5113e0(0xf8)),0x0;}}}
@@ -1 +1 @@
1
- const a13_0x31f9be=a13_0x17ae;(function(_0x1abf45,_0x35a3f6){const _0x320f3d=a13_0x17ae,_0x113460=_0x1abf45();while(!![]){try{const _0xee68ed=parseInt(_0x320f3d(0x1be))/0x1+parseInt(_0x320f3d(0x1cb))/0x2*(parseInt(_0x320f3d(0x1dd))/0x3)+-parseInt(_0x320f3d(0x1e1))/0x4*(parseInt(_0x320f3d(0x1e0))/0x5)+parseInt(_0x320f3d(0x1c0))/0x6+parseInt(_0x320f3d(0x1ea))/0x7*(-parseInt(_0x320f3d(0x1d6))/0x8)+parseInt(_0x320f3d(0x1b3))/0x9+-parseInt(_0x320f3d(0x1ae))/0xa;if(_0xee68ed===_0x35a3f6)break;else _0x113460['push'](_0x113460['shift']());}catch(_0x2b98f4){_0x113460['push'](_0x113460['shift']());}}}(a13_0x3236,0x5085d));import a13_0x1dd0eb from'chalk';import{BaseCommand}from'./command.js';function a13_0x17ae(_0x31ca00,_0x1797aa){_0x31ca00=_0x31ca00-0x1a7;const _0x323675=a13_0x3236();let _0x17ae15=_0x323675[_0x31ca00];return _0x17ae15;}import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function a13_0x3236(){const _0x11ab8a=['source','all','json','profile','repeat','description','Unknown\x20error','5400990IbMuJc','2-digit','Today','Requests','todayCredits','5288535XhdHuQ','toLocaleTimeString','toFixed','Source','format','entryCount','\x20credits','short','log','Total','red','433071JuhNrT','error','3435678bsfEbT','max','numeric','lastUsedAt','en-CA','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','yesterday','Usage\x20by\x20Source','default','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','2826zhGRHP','message','dim','round','credits','profileCount','\x20days\x20ago','outputTable','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','monthCredits','never','4176432bpxkbg','Usage\x20by\x20Profile','execute','padStart','cyan','length','(default)','501CXKXKu','padEnd','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','546620nrkfBm','16DcSbMF','Profile','Credits','\x20\x20Month:\x20\x20\x20','toLocaleDateString','\x20\x20Total:\x20\x20\x20','Last\x20Used','totalCredits','Error:\x20','7yghmcd','en-US','today\x20','outputStructured','map'];a13_0x3236=function(){return _0x11ab8a;};return a13_0x3236();}function formatCredits(_0x4a62a2){const _0x13b8a6=a13_0x17ae;return _0x4a62a2[_0x13b8a6(0x1b5)](0x2);}function formatLastUsed(_0x738fc1){const _0xf315e6=a13_0x17ae;if(!_0x738fc1)return _0xf315e6(0x1d5);const _0x4d1d4b=new Date(_0x738fc1),_0x335da8=new Date(),_0x5a4f4c=_0x4d1d4b[_0xf315e6(0x1e5)](_0xf315e6(0x1c4)),_0x9cd5b6=_0x335da8[_0xf315e6(0x1e5)](_0xf315e6(0x1c4));if(_0x5a4f4c===_0x9cd5b6)return _0xf315e6(0x1ec)+_0x4d1d4b[_0xf315e6(0x1b4)](_0xf315e6(0x1eb),{'hour':_0xf315e6(0x1af),'minute':'2-digit'});const _0x2cae76=new Date(_0x5a4f4c),_0x29ce3b=new Date(_0x9cd5b6),_0x408bb5=Math[_0xf315e6(0x1ce)]((_0x29ce3b['getTime']()-_0x2cae76['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x408bb5===0x1)return _0xf315e6(0x1c6);else return _0x408bb5>0x1&&_0x408bb5<0x7?_0x408bb5+_0xf315e6(0x1d1):_0x4d1d4b[_0xf315e6(0x1e5)](_0xf315e6(0x1eb),{'month':_0xf315e6(0x1ba),'day':_0xf315e6(0x1c2)});}export class ClaudeUsageCommand extends BaseCommand{['name']='usage';[a13_0x31f9be(0x1ac)]=a13_0x31f9be(0x1c9);async[a13_0x31f9be(0x1d8)](_0x450979){const _0x3811f3=a13_0x31f9be,{options:_0x351a4e}=_0x450979,_0x369505=_0x351a4e[_0x3811f3(0x1b7)]==='json'||_0x351a4e[_0x3811f3(0x1b7)]==='jsonl'||_0x351a4e[_0x3811f3(0x1a9)];try{const [_0x5a52b4,_0x21ac4b,_0x4648ad]=await Promise[_0x3811f3(0x1a8)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x369505?await this['outputStructured'](_0x5a52b4,_0x21ac4b,_0x4648ad,_0x351a4e):this[_0x3811f3(0x1d2)](_0x5a52b4,_0x21ac4b,_0x4648ad),0x0;}catch(_0x361b3e){const _0x7466ce=_0x361b3e instanceof Error?_0x361b3e[_0x3811f3(0x1cc)]:_0x3811f3(0x1ad);return console[_0x3811f3(0x1bf)](a13_0x1dd0eb[_0x3811f3(0x1bd)](_0x3811f3(0x1e9)+_0x7466ce)),0x1;}}async[a13_0x31f9be(0x1ed)](_0x8830cf,_0x2fb008,_0x5d1132,_0x1c2402){const _0x2adeaf=a13_0x31f9be,_0x4f8679={'summary':{'todayCredits':_0x5d1132[_0x2adeaf(0x1b2)],'monthCredits':_0x5d1132['monthCredits'],'totalCredits':_0x5d1132['totalCredits'],'profileCount':_0x5d1132[_0x2adeaf(0x1d0)]},'profiles':_0x8830cf[_0x2adeaf(0x1ee)](_0x5e45af=>({'profile':_0x5e45af[_0x2adeaf(0x1aa)],'credits':_0x5e45af[_0x2adeaf(0x1cf)],'requests':_0x5e45af[_0x2adeaf(0x1b8)],'lastUsedAt':_0x5e45af[_0x2adeaf(0x1c3)]})),'sources':_0x2fb008[_0x2adeaf(0x1ee)](_0x138a3e=>({'source':_0x138a3e[_0x2adeaf(0x1a7)],'credits':_0x138a3e[_0x2adeaf(0x1cf)],'todayCredits':_0x138a3e[_0x2adeaf(0x1b2)],'monthCredits':_0x138a3e['monthCredits'],'requests':_0x138a3e[_0x2adeaf(0x1b8)]}))};await handleSDKOutput([_0x4f8679],_0x1c2402);}[a13_0x31f9be(0x1d2)](_0x3b2f5f,_0x526749,_0x298dcd){const _0x3aebc8=a13_0x31f9be;console[_0x3aebc8(0x1bb)](a13_0x1dd0eb['bold'](_0x3aebc8(0x1c5))),console['log'](a13_0x1dd0eb[_0x3aebc8(0x1cd)]('─'[_0x3aebc8(0x1ab)](0x32))),console[_0x3aebc8(0x1bb)]('\x20\x20Today:\x20\x20\x20'+a13_0x1dd0eb[_0x3aebc8(0x1da)](formatCredits(_0x298dcd['todayCredits']))+'\x20credits'),console[_0x3aebc8(0x1bb)](_0x3aebc8(0x1e4)+a13_0x1dd0eb[_0x3aebc8(0x1da)](formatCredits(_0x298dcd[_0x3aebc8(0x1d4)]))+'\x20credits'),console[_0x3aebc8(0x1bb)](_0x3aebc8(0x1e6)+a13_0x1dd0eb[_0x3aebc8(0x1da)](formatCredits(_0x298dcd[_0x3aebc8(0x1e8)]))+_0x3aebc8(0x1b9)),console[_0x3aebc8(0x1bb)]();if(_0x526749['length']>0x0){console[_0x3aebc8(0x1bb)](a13_0x1dd0eb['bold'](_0x3aebc8(0x1c7))),console[_0x3aebc8(0x1bb)](a13_0x1dd0eb[_0x3aebc8(0x1cd)]('─'[_0x3aebc8(0x1ab)](0x3c)));const _0xbaa5a5=0xc,_0x184b4b=0xa,_0x243c4c=0xa,_0x4e3fb5=0xa;console[_0x3aebc8(0x1bb)]('\x20\x20'+_0x3aebc8(0x1b6)[_0x3aebc8(0x1de)](_0xbaa5a5)+'\x20\x20'+_0x3aebc8(0x1bc)[_0x3aebc8(0x1d9)](_0x184b4b)+'\x20\x20'+_0x3aebc8(0x1b0)[_0x3aebc8(0x1d9)](_0x243c4c)+'\x20\x20'+'Month'[_0x3aebc8(0x1d9)](_0x4e3fb5));for(const _0x456196 of _0x526749){console[_0x3aebc8(0x1bb)]('\x20\x20'+_0x456196['source'][_0x3aebc8(0x1de)](_0xbaa5a5)+'\x20\x20'+a13_0x1dd0eb[_0x3aebc8(0x1da)](formatCredits(_0x456196['credits'])[_0x3aebc8(0x1d9)](_0x184b4b))+'\x20\x20'+formatCredits(_0x456196[_0x3aebc8(0x1b2)])[_0x3aebc8(0x1d9)](_0x243c4c)+'\x20\x20'+formatCredits(_0x456196[_0x3aebc8(0x1d4)])[_0x3aebc8(0x1d9)](_0x4e3fb5));}console[_0x3aebc8(0x1bb)]();}if(_0x3b2f5f[_0x3aebc8(0x1db)]===0x0){console[_0x3aebc8(0x1bb)](a13_0x1dd0eb[_0x3aebc8(0x1cd)](_0x3aebc8(0x1ca))),console[_0x3aebc8(0x1bb)](a13_0x1dd0eb['dim'](_0x3aebc8(0x1d3)));return;}console[_0x3aebc8(0x1bb)](a13_0x1dd0eb['bold'](_0x3aebc8(0x1d7))),console[_0x3aebc8(0x1bb)](a13_0x1dd0eb[_0x3aebc8(0x1cd)]('─'[_0x3aebc8(0x1ab)](0x3c)));const _0x3ebab6=Math[_0x3aebc8(0x1c1)](0xc,..._0x3b2f5f[_0x3aebc8(0x1ee)](_0x3fb9b6=>_0x3fb9b6['profile']===_0x3aebc8(0x1c8)?_0x3aebc8(0x1dc)[_0x3aebc8(0x1db)]:_0x3fb9b6[_0x3aebc8(0x1aa)][_0x3aebc8(0x1db)])),_0x7de470=0xa,_0x344dd2=0xa;console[_0x3aebc8(0x1bb)]('\x20\x20'+_0x3aebc8(0x1e2)[_0x3aebc8(0x1de)](_0x3ebab6)+'\x20\x20'+_0x3aebc8(0x1e3)['padStart'](_0x7de470)+'\x20\x20'+_0x3aebc8(0x1b1)[_0x3aebc8(0x1d9)](_0x344dd2)+'\x20\x20'+_0x3aebc8(0x1e7));for(const _0x88ddd4 of _0x3b2f5f){const _0x2624d6=_0x88ddd4[_0x3aebc8(0x1aa)]==='default'?_0x3aebc8(0x1dc):_0x88ddd4[_0x3aebc8(0x1aa)],_0x5b73e4=_0x2624d6['padEnd'](_0x3ebab6),_0x23cb72=_0x88ddd4[_0x3aebc8(0x1aa)]===_0x3aebc8(0x1c8)?a13_0x1dd0eb['dim'](_0x5b73e4):_0x5b73e4;console[_0x3aebc8(0x1bb)]('\x20\x20'+_0x23cb72+'\x20\x20'+a13_0x1dd0eb['cyan'](formatCredits(_0x88ddd4[_0x3aebc8(0x1cf)])['padStart'](_0x7de470))+'\x20\x20'+String(_0x88ddd4[_0x3aebc8(0x1b8)])[_0x3aebc8(0x1d9)](_0x344dd2)+'\x20\x20'+a13_0x1dd0eb[_0x3aebc8(0x1cd)](formatLastUsed(_0x88ddd4['lastUsedAt'])));}console['log'](),console[_0x3aebc8(0x1bb)](a13_0x1dd0eb[_0x3aebc8(0x1cd)](_0x3aebc8(0x1df))),console['log']();}}
1
+ const a13_0x1e5679=a13_0x13c2;(function(_0x2aaa1c,_0x5f5871){const _0x55e920=a13_0x13c2,_0x3cbcf9=_0x2aaa1c();while(!![]){try{const _0x367c41=-parseInt(_0x55e920(0x167))/0x1*(-parseInt(_0x55e920(0x174))/0x2)+-parseInt(_0x55e920(0x150))/0x3*(-parseInt(_0x55e920(0x177))/0x4)+-parseInt(_0x55e920(0x14f))/0x5*(parseInt(_0x55e920(0x16e))/0x6)+-parseInt(_0x55e920(0x15b))/0x7+parseInt(_0x55e920(0x158))/0x8+parseInt(_0x55e920(0x189))/0x9+parseInt(_0x55e920(0x157))/0xa;if(_0x367c41===_0x5f5871)break;else _0x3cbcf9['push'](_0x3cbcf9['shift']());}catch(_0x30a0ff){_0x3cbcf9['push'](_0x3cbcf9['shift']());}}}(a13_0x4756,0x7be1e));import a13_0x2a27fb from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function a13_0x4756(){const _0x2a66a9=['lastUsedAt','red','json','Requests','outputStructured','en-US','5286110WytfZL','1471352wbmTbJ','toLocaleTimeString','Total','57302uzbrHV','todayCredits','name','totalCredits','\x20days\x20ago','outputTable','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','monthCredits','length','(default)','bold','usage','1dmknip','cyan','source','dim','padEnd','credits','Last\x20Used','2040oLkSQA','round','map','Source','getTime','yesterday','575660egBrrk','profile','Month','821564PPweBX','description','numeric','entryCount','Usage\x20by\x20Profile','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','toFixed','Today','\x20credits','execute','repeat','profileCount','format','message','jsonl','\x20\x20Month:\x20\x20\x20','padStart','Unknown\x20error','2127213pGoDDe','today\x20','never','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','2-digit','Credits','default','all','log','en-CA','max','toLocaleDateString','\x20\x20Today:\x20\x20\x20','13625RotJUC','3MWZOLq'];a13_0x4756=function(){return _0x2a66a9;};return a13_0x4756();}function formatCredits(_0x392ecd){const _0x5ae36d=a13_0x13c2;return _0x392ecd[_0x5ae36d(0x17d)](0x2);}function a13_0x13c2(_0x18172a,_0x164f93){_0x18172a=_0x18172a-0x145;const _0x475602=a13_0x4756();let _0x13c28d=_0x475602[_0x18172a];return _0x13c28d;}function formatLastUsed(_0x4e04bc){const _0x45755c=a13_0x13c2;if(!_0x4e04bc)return _0x45755c(0x18b);const _0x166cc4=new Date(_0x4e04bc),_0x583a08=new Date(),_0x56a37f=_0x166cc4[_0x45755c(0x14d)](_0x45755c(0x14b)),_0x3d052f=_0x583a08[_0x45755c(0x14d)](_0x45755c(0x14b));if(_0x56a37f===_0x3d052f)return _0x45755c(0x18a)+_0x166cc4[_0x45755c(0x159)]('en-US',{'hour':_0x45755c(0x146),'minute':_0x45755c(0x146)});const _0x2cc949=new Date(_0x56a37f),_0x565907=new Date(_0x3d052f),_0x54e7c4=Math[_0x45755c(0x16f)]((_0x565907[_0x45755c(0x172)]()-_0x2cc949[_0x45755c(0x172)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x54e7c4===0x1)return _0x45755c(0x173);else return _0x54e7c4>0x1&&_0x54e7c4<0x7?_0x54e7c4+_0x45755c(0x15f):_0x166cc4[_0x45755c(0x14d)](_0x45755c(0x156),{'month':'short','day':_0x45755c(0x179)});}export class ClaudeUsageCommand extends BaseCommand{[a13_0x1e5679(0x15d)]=a13_0x1e5679(0x166);[a13_0x1e5679(0x178)]=a13_0x1e5679(0x17c);async[a13_0x1e5679(0x180)](_0x27edf8){const _0x3bf7b0=a13_0x1e5679,{options:_0x2cb36e}=_0x27edf8,_0x133b46=_0x2cb36e['format']===_0x3bf7b0(0x153)||_0x2cb36e[_0x3bf7b0(0x183)]===_0x3bf7b0(0x185)||_0x2cb36e['json'];try{const [_0x354901,_0x1d0288,_0x1c7cdd]=await Promise[_0x3bf7b0(0x149)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x133b46?await this[_0x3bf7b0(0x155)](_0x354901,_0x1d0288,_0x1c7cdd,_0x2cb36e):this[_0x3bf7b0(0x160)](_0x354901,_0x1d0288,_0x1c7cdd),0x0;}catch(_0x596307){const _0x2f9535=_0x596307 instanceof Error?_0x596307[_0x3bf7b0(0x184)]:_0x3bf7b0(0x188);return console['error'](a13_0x2a27fb[_0x3bf7b0(0x152)]('Error:\x20'+_0x2f9535)),0x1;}}async[a13_0x1e5679(0x155)](_0x37705d,_0x316019,_0x2c3911,_0x28dbe3){const _0x570c50=a13_0x1e5679,_0x256b7f={'summary':{'todayCredits':_0x2c3911[_0x570c50(0x15c)],'monthCredits':_0x2c3911['monthCredits'],'totalCredits':_0x2c3911[_0x570c50(0x15e)],'profileCount':_0x2c3911[_0x570c50(0x182)]},'profiles':_0x37705d[_0x570c50(0x170)](_0x1267c0=>({'profile':_0x1267c0[_0x570c50(0x175)],'credits':_0x1267c0[_0x570c50(0x16c)],'requests':_0x1267c0['entryCount'],'lastUsedAt':_0x1267c0[_0x570c50(0x151)]})),'sources':_0x316019[_0x570c50(0x170)](_0x389655=>({'source':_0x389655[_0x570c50(0x169)],'credits':_0x389655['credits'],'todayCredits':_0x389655['todayCredits'],'monthCredits':_0x389655[_0x570c50(0x162)],'requests':_0x389655['entryCount']}))};await handleSDKOutput([_0x256b7f],_0x28dbe3);}['outputTable'](_0x379771,_0x3d13d6,_0x4e1722){const _0x562b7d=a13_0x1e5679;console['log'](a13_0x2a27fb[_0x562b7d(0x165)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console[_0x562b7d(0x14a)](a13_0x2a27fb[_0x562b7d(0x16a)]('─'[_0x562b7d(0x181)](0x32))),console[_0x562b7d(0x14a)](_0x562b7d(0x14e)+a13_0x2a27fb[_0x562b7d(0x168)](formatCredits(_0x4e1722['todayCredits']))+_0x562b7d(0x17f)),console[_0x562b7d(0x14a)](_0x562b7d(0x186)+a13_0x2a27fb[_0x562b7d(0x168)](formatCredits(_0x4e1722[_0x562b7d(0x162)]))+_0x562b7d(0x17f)),console[_0x562b7d(0x14a)]('\x20\x20Total:\x20\x20\x20'+a13_0x2a27fb[_0x562b7d(0x168)](formatCredits(_0x4e1722[_0x562b7d(0x15e)]))+_0x562b7d(0x17f)),console[_0x562b7d(0x14a)]();if(_0x3d13d6['length']>0x0){console[_0x562b7d(0x14a)](a13_0x2a27fb[_0x562b7d(0x165)]('Usage\x20by\x20Source')),console[_0x562b7d(0x14a)](a13_0x2a27fb[_0x562b7d(0x16a)]('─'[_0x562b7d(0x181)](0x3c)));const _0x7ba7cf=0xc,_0x2ee737=0xa,_0x48ca4b=0xa,_0x5b7615=0xa;console[_0x562b7d(0x14a)]('\x20\x20'+_0x562b7d(0x171)[_0x562b7d(0x16b)](_0x7ba7cf)+'\x20\x20'+_0x562b7d(0x15a)[_0x562b7d(0x187)](_0x2ee737)+'\x20\x20'+_0x562b7d(0x17e)[_0x562b7d(0x187)](_0x48ca4b)+'\x20\x20'+_0x562b7d(0x176)[_0x562b7d(0x187)](_0x5b7615));for(const _0x2fec3d of _0x3d13d6){console[_0x562b7d(0x14a)]('\x20\x20'+_0x2fec3d[_0x562b7d(0x169)][_0x562b7d(0x16b)](_0x7ba7cf)+'\x20\x20'+a13_0x2a27fb['cyan'](formatCredits(_0x2fec3d[_0x562b7d(0x16c)])[_0x562b7d(0x187)](_0x2ee737))+'\x20\x20'+formatCredits(_0x2fec3d[_0x562b7d(0x15c)])[_0x562b7d(0x187)](_0x48ca4b)+'\x20\x20'+formatCredits(_0x2fec3d[_0x562b7d(0x162)])[_0x562b7d(0x187)](_0x5b7615));}console['log']();}if(_0x379771['length']===0x0){console[_0x562b7d(0x14a)](a13_0x2a27fb[_0x562b7d(0x16a)](_0x562b7d(0x145))),console[_0x562b7d(0x14a)](a13_0x2a27fb[_0x562b7d(0x16a)](_0x562b7d(0x161)));return;}console['log'](a13_0x2a27fb[_0x562b7d(0x165)](_0x562b7d(0x17b))),console[_0x562b7d(0x14a)](a13_0x2a27fb[_0x562b7d(0x16a)]('─'[_0x562b7d(0x181)](0x3c)));const _0x260d81=Math[_0x562b7d(0x14c)](0xc,..._0x379771[_0x562b7d(0x170)](_0x2a86e8=>_0x2a86e8[_0x562b7d(0x175)]===_0x562b7d(0x148)?'(default)'[_0x562b7d(0x163)]:_0x2a86e8[_0x562b7d(0x175)]['length'])),_0x2f7a64=0xa,_0x267250=0xa;console['log']('\x20\x20'+'Profile'[_0x562b7d(0x16b)](_0x260d81)+'\x20\x20'+_0x562b7d(0x147)[_0x562b7d(0x187)](_0x2f7a64)+'\x20\x20'+_0x562b7d(0x154)[_0x562b7d(0x187)](_0x267250)+'\x20\x20'+_0x562b7d(0x16d));for(const _0x36a01e of _0x379771){const _0x4aa73b=_0x36a01e['profile']===_0x562b7d(0x148)?_0x562b7d(0x164):_0x36a01e[_0x562b7d(0x175)],_0x18705c=_0x4aa73b[_0x562b7d(0x16b)](_0x260d81),_0xed0813=_0x36a01e[_0x562b7d(0x175)]===_0x562b7d(0x148)?a13_0x2a27fb[_0x562b7d(0x16a)](_0x18705c):_0x18705c;console[_0x562b7d(0x14a)]('\x20\x20'+_0xed0813+'\x20\x20'+a13_0x2a27fb[_0x562b7d(0x168)](formatCredits(_0x36a01e[_0x562b7d(0x16c)])[_0x562b7d(0x187)](_0x2f7a64))+'\x20\x20'+String(_0x36a01e[_0x562b7d(0x17a)])[_0x562b7d(0x187)](_0x267250)+'\x20\x20'+a13_0x2a27fb[_0x562b7d(0x16a)](formatLastUsed(_0x36a01e['lastUsedAt'])));}console[_0x562b7d(0x14a)](),console[_0x562b7d(0x14a)](a13_0x2a27fb['dim']('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console['log']();}}
@@ -1 +1 @@
1
- function a14_0x5baf(_0x1467db,_0x46f8fc){_0x1467db=_0x1467db-0x95;const _0x427eb7=a14_0x427e();let _0x5baf6a=_0x427eb7[_0x1467db];return _0x5baf6a;}const a14_0x221847=a14_0x5baf;(function(_0x30891c,_0x254d9a){const _0x4f042b=a14_0x5baf,_0x4d8e5b=_0x30891c();while(!![]){try{const _0xf6f63b=-parseInt(_0x4f042b(0xbc))/0x1+parseInt(_0x4f042b(0xa5))/0x2+parseInt(_0x4f042b(0xbf))/0x3*(parseInt(_0x4f042b(0x98))/0x4)+parseInt(_0x4f042b(0xa3))/0x5*(-parseInt(_0x4f042b(0xb0))/0x6)+-parseInt(_0x4f042b(0xc3))/0x7*(parseInt(_0x4f042b(0x9f))/0x8)+-parseInt(_0x4f042b(0xbb))/0x9+-parseInt(_0x4f042b(0xc4))/0xa*(-parseInt(_0x4f042b(0xc2))/0xb);if(_0xf6f63b===_0x254d9a)break;else _0x4d8e5b['push'](_0x4d8e5b['shift']());}catch(_0x6284cc){_0x4d8e5b['push'](_0x4d8e5b['shift']());}}}(a14_0x427e,0x84ff4));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a14_0x2c064f from'chalk';export function printAuthError(_0x52faa9,_0x2a8a36=![],_0x992ecc){const _0x20ea68=a14_0x5baf,_0x45e15d=_0x52faa9[_0x20ea68(0x99)]?.['detail']||_0x52faa9['message'];console['error'](a14_0x2c064f[_0x20ea68(0xa0)](_0x20ea68(0xb4))),console[_0x20ea68(0xae)](a14_0x2c064f[_0x20ea68(0xa0)](_0x20ea68(0xa8)+_0x45e15d));if(_0x2a8a36){const _0x3f640d=_0x992ecc?_0x20ea68(0x95)+_0x992ecc:'';console['error']('\x0a'+a14_0x2c064f[_0x20ea68(0xa6)](_0x20ea68(0x9d))),console[_0x20ea68(0xae)]('\x20\x20'+a14_0x2c064f['cyan']('tdx\x20auth\x20setup'+_0x3f640d)+'\x0a'),console['error'](''+a14_0x2c064f['dim']('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x20ea68(0xae)]('\x20\x20'+a14_0x2c064f[_0x20ea68(0xc0)](_0x20ea68(0x96)+_0x3f640d));}}export class BaseCommand{['validateGlobalOptions'](_0xb74c79){const _0x326ff7=a14_0x5baf,{options:_0x126585}=_0xb74c79,_0x442103=_0x126585[_0x326ff7(0xb3)];if(_0x442103!==undefined){const _0x3bd69c=typeof _0x442103==='number'?_0x442103:parseInt(_0x442103,0xa);if(isNaN(_0x3bd69c))return _0x326ff7(0xaf)+_0x442103+_0x326ff7(0xac);const _0x137d15=validateLimitOption(_0x3bd69c);if(!_0x137d15[_0x326ff7(0xc6)])return _0x137d15[_0x326ff7(0xae)];_0xb74c79['options'][_0x326ff7(0xb3)]=_0x137d15[_0x326ff7(0xb5)];}return undefined;}[a14_0x221847(0xb9)](_0x5abdfb){return undefined;}async[a14_0x221847(0xc1)](_0x2dc7de){const _0x3cdfd7=a14_0x221847;try{const _0xb8e8fd=this[_0x3cdfd7(0xbd)](_0x2dc7de);if(_0xb8e8fd)return console[_0x3cdfd7(0xae)](_0x3cdfd7(0xc8)+_0xb8e8fd),0x1;const _0x946788=this[_0x3cdfd7(0xb9)](_0x2dc7de);if(_0x946788){const _0x17e36e=/^\s*(Usage|Note|Warning|Error):/i[_0x3cdfd7(0xb7)](_0x946788);return _0x17e36e?console[_0x3cdfd7(0xae)](_0x946788):console[_0x3cdfd7(0xae)](_0x3cdfd7(0xc8)+_0x946788),0x1;}const _0x2ec4ed=await this[_0x3cdfd7(0xa2)](_0x2dc7de);return _0x2ec4ed??0x0;}catch(_0xbc1f7f){if(_0xbc1f7f instanceof Error){if(_0xbc1f7f instanceof HTTPClientError&&_0xbc1f7f[_0x3cdfd7(0xb6)]===0x191){const _0x456c24=_0x2dc7de[_0x3cdfd7(0x9e)]['profile'];printAuthError(_0xbc1f7f,!![],_0x456c24);if(_0xbc1f7f['stack']){const _0x250cf1=Logger['of'](_0x3cdfd7(0xb2));_0x250cf1[_0x3cdfd7(0xb1)](_0x3cdfd7(0xc5)),_0x250cf1[_0x3cdfd7(0xb1)](_0xbc1f7f['stack']);}return 0x1;}console[_0x3cdfd7(0xae)](a14_0x2c064f[_0x3cdfd7(0xa0)](_0x3cdfd7(0xc8)+_0xbc1f7f['message']));_0xbc1f7f instanceof SDKError&&_0xbc1f7f[_0x3cdfd7(0x9c)]&&console[_0x3cdfd7(0xae)](a14_0x2c064f[_0x3cdfd7(0xad)](_0xbc1f7f[_0x3cdfd7(0x9c)]));const _0x3ade6d=_0xbc1f7f instanceof SDKError&&_0xbc1f7f['category']===ErrorCategory[_0x3cdfd7(0xa4)];_0xbc1f7f[_0x3cdfd7(0xbe)]&&!_0x3ade6d&&console[_0x3cdfd7(0xae)](_0x3cdfd7(0x9a)+_0xbc1f7f[_0x3cdfd7(0xbe)]);}else console[_0x3cdfd7(0xae)]('Error:\x20'+String(_0xbc1f7f));return 0x1;}}}function a14_0x427e(){const _0x21b049=['9042230DGYbDH','Authentication\x20error\x20stack\x20trace:','isValid','Command\x20\x27','Error:\x20','\x20--profile\x20','tdx\x20auth','has','564ZTuDVO','problemDetails','\x0aStack\x20trace:\x0a','set','helpText','To\x20set\x20up\x20authentication:','options','4064EixpOK','red','\x27\x20is\x20already\x20registered','execute','20dzFdrq','USER_ERROR','1999948qzRvXt','dim','get','Reason:\x20','commands','name','register','.\x20Must\x20be\x20a\x20number.','yellow','error','Invalid\x20limit\x20value:\x20','1149414sKNGkw','debug','command','limit','Authentication\x20failed','value','status','test','getAll','validate','from','248112vECJGs','174984XhvjMK','validateGlobalOptions','stack','13425WBaRVg','cyan','run','11tVNddS','14077QOCXTB'];a14_0x427e=function(){return _0x21b049;};return a14_0x427e();}export class CommandRegistry{[a14_0x221847(0xa9)]=new Map();[a14_0x221847(0xab)](_0x2f4672){const _0x155e7b=a14_0x221847;if(this[_0x155e7b(0xa9)]['has'](_0x2f4672[_0x155e7b(0xaa)]))throw new Error(_0x155e7b(0xc7)+_0x2f4672['name']+_0x155e7b(0xa1));this[_0x155e7b(0xa9)][_0x155e7b(0x9b)](_0x2f4672[_0x155e7b(0xaa)],_0x2f4672);}['get'](_0xfb7802){const _0x1e5a5a=a14_0x221847;return this[_0x1e5a5a(0xa9)][_0x1e5a5a(0xa7)](_0xfb7802);}[a14_0x221847(0xb8)](){const _0x147003=a14_0x221847;return Array[_0x147003(0xba)](this[_0x147003(0xa9)]['values']());}['has'](_0x3f7bbd){const _0x9eb368=a14_0x221847;return this[_0x9eb368(0xa9)][_0x9eb368(0x97)](_0x3f7bbd);}}export const registry=new CommandRegistry();
1
+ function a14_0x476e(_0x8f7153,_0x5a5b46){_0x8f7153=_0x8f7153-0x9a;const _0x2a5fb5=a14_0x2a5f();let _0x476eab=_0x2a5fb5[_0x8f7153];return _0x476eab;}const a14_0x4ef5b3=a14_0x476e;(function(_0x17fdaa,_0x5d6318){const _0x54ecfa=a14_0x476e,_0x51b62d=_0x17fdaa();while(!![]){try{const _0x579f76=parseInt(_0x54ecfa(0xb2))/0x1*(parseInt(_0x54ecfa(0xb3))/0x2)+parseInt(_0x54ecfa(0xc8))/0x3*(-parseInt(_0x54ecfa(0xa7))/0x4)+-parseInt(_0x54ecfa(0xb0))/0x5+parseInt(_0x54ecfa(0xbd))/0x6*(-parseInt(_0x54ecfa(0xac))/0x7)+-parseInt(_0x54ecfa(0xc3))/0x8+-parseInt(_0x54ecfa(0xa5))/0x9+parseInt(_0x54ecfa(0xae))/0xa;if(_0x579f76===_0x5d6318)break;else _0x51b62d['push'](_0x51b62d['shift']());}catch(_0x54af7a){_0x51b62d['push'](_0x51b62d['shift']());}}}(a14_0x2a5f,0xb8467));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a14_0x145ee9 from'chalk';function a14_0x2a5f(){const _0xb9aaf3=['getAll','.\x20Must\x20be\x20a\x20number.','11191160TyrTNX','name','number','execute','get','1552626JCnBVI','Authentication\x20error\x20stack\x20trace:','yellow','category','red','run','cyan','error','options','validateGlobalOptions','from','tdx\x20auth','helpText','validate','To\x20set\x20up\x20authentication:','\x27\x20is\x20already\x20registered','Authentication\x20failed','debug','tdx\x20auth\x20setup','4608252kzdTMy','commands','4KVnGVz','command','profile','Invalid\x20limit\x20value:\x20','USER_ERROR','628166nDsxrv','message','43092270PXLIjM','problemDetails','2901190UCTqnq','detail','620861OeiYXH','2jtwnZj','dim','Error:\x20','stack','\x20--profile\x20','set','status','has','isValid','To\x20check\x20your\x20current\x20auth\x20status:','78drBHfi','value','limit','register'];a14_0x2a5f=function(){return _0xb9aaf3;};return a14_0x2a5f();}export function printAuthError(_0x25ebe9,_0x5971dd=![],_0x365af8){const _0xd439d0=a14_0x476e,_0x2cbb8e=_0x25ebe9[_0xd439d0(0xaf)]?.[_0xd439d0(0xb1)]||_0x25ebe9['message'];console[_0xd439d0(0xcf)](a14_0x145ee9[_0xd439d0(0xcc)](_0xd439d0(0xa2))),console[_0xd439d0(0xcf)](a14_0x145ee9[_0xd439d0(0xcc)]('Reason:\x20'+_0x2cbb8e));if(_0x5971dd){const _0x1f4944=_0x365af8?_0xd439d0(0xb7)+_0x365af8:'';console[_0xd439d0(0xcf)]('\x0a'+a14_0x145ee9[_0xd439d0(0xb4)](_0xd439d0(0xa0))),console[_0xd439d0(0xcf)]('\x20\x20'+a14_0x145ee9[_0xd439d0(0xce)](_0xd439d0(0xa4)+_0x1f4944)+'\x0a'),console[_0xd439d0(0xcf)](''+a14_0x145ee9[_0xd439d0(0xb4)](_0xd439d0(0xbc))),console['error']('\x20\x20'+a14_0x145ee9[_0xd439d0(0xce)](_0xd439d0(0x9d)+_0x1f4944));}}export class BaseCommand{[a14_0x4ef5b3(0x9b)](_0x5e4c1c){const _0x210a77=a14_0x4ef5b3,{options:_0x4b8dd8}=_0x5e4c1c,_0x14a7f0=_0x4b8dd8[_0x210a77(0xbf)];if(_0x14a7f0!==undefined){const _0x2f4246=typeof _0x14a7f0===_0x210a77(0xc5)?_0x14a7f0:parseInt(_0x14a7f0,0xa);if(isNaN(_0x2f4246))return _0x210a77(0xaa)+_0x14a7f0+_0x210a77(0xc2);const _0x3d29c6=validateLimitOption(_0x2f4246);if(!_0x3d29c6[_0x210a77(0xbb)])return _0x3d29c6[_0x210a77(0xcf)];_0x5e4c1c[_0x210a77(0x9a)][_0x210a77(0xbf)]=_0x3d29c6[_0x210a77(0xbe)];}return undefined;}[a14_0x4ef5b3(0x9f)](_0xc1b821){return undefined;}async[a14_0x4ef5b3(0xcd)](_0x4492d7){const _0x4aa022=a14_0x4ef5b3;try{const _0x2c72ef=this[_0x4aa022(0x9b)](_0x4492d7);if(_0x2c72ef)return console[_0x4aa022(0xcf)](_0x4aa022(0xb5)+_0x2c72ef),0x1;const _0x11d1ab=this[_0x4aa022(0x9f)](_0x4492d7);if(_0x11d1ab){const _0x51dace=/^\s*(Usage|Note|Warning|Error):/i['test'](_0x11d1ab);return _0x51dace?console[_0x4aa022(0xcf)](_0x11d1ab):console[_0x4aa022(0xcf)](_0x4aa022(0xb5)+_0x11d1ab),0x1;}const _0x5f17b1=await this[_0x4aa022(0xc6)](_0x4492d7);return _0x5f17b1??0x0;}catch(_0x2b80bb){if(_0x2b80bb instanceof Error){if(_0x2b80bb instanceof HTTPClientError&&_0x2b80bb[_0x4aa022(0xb9)]===0x191){const _0x4f641e=_0x4492d7['options'][_0x4aa022(0xa9)];printAuthError(_0x2b80bb,!![],_0x4f641e);if(_0x2b80bb[_0x4aa022(0xb6)]){const _0x4ac58d=Logger['of'](_0x4aa022(0xa8));_0x4ac58d[_0x4aa022(0xa3)](_0x4aa022(0xc9)),_0x4ac58d[_0x4aa022(0xa3)](_0x2b80bb['stack']);}return 0x1;}console[_0x4aa022(0xcf)](a14_0x145ee9[_0x4aa022(0xcc)]('Error:\x20'+_0x2b80bb[_0x4aa022(0xad)]));_0x2b80bb instanceof SDKError&&_0x2b80bb[_0x4aa022(0x9e)]&&console[_0x4aa022(0xcf)](a14_0x145ee9[_0x4aa022(0xca)](_0x2b80bb[_0x4aa022(0x9e)]));const _0x3b18fe=_0x2b80bb instanceof SDKError&&_0x2b80bb[_0x4aa022(0xcb)]===ErrorCategory[_0x4aa022(0xab)];_0x2b80bb[_0x4aa022(0xb6)]&&!_0x3b18fe&&console[_0x4aa022(0xcf)]('\x0aStack\x20trace:\x0a'+_0x2b80bb[_0x4aa022(0xb6)]);}else console['error'](_0x4aa022(0xb5)+String(_0x2b80bb));return 0x1;}}}export class CommandRegistry{[a14_0x4ef5b3(0xa6)]=new Map();[a14_0x4ef5b3(0xc0)](_0x1419c8){const _0x324996=a14_0x4ef5b3;if(this['commands'][_0x324996(0xba)](_0x1419c8[_0x324996(0xc4)]))throw new Error('Command\x20\x27'+_0x1419c8[_0x324996(0xc4)]+_0x324996(0xa1));this['commands'][_0x324996(0xb8)](_0x1419c8[_0x324996(0xc4)],_0x1419c8);}[a14_0x4ef5b3(0xc7)](_0x47f6d7){const _0x5a070f=a14_0x4ef5b3;return this[_0x5a070f(0xa6)][_0x5a070f(0xc7)](_0x47f6d7);}[a14_0x4ef5b3(0xc1)](){const _0x58fec6=a14_0x4ef5b3;return Array[_0x58fec6(0x9c)](this[_0x58fec6(0xa6)]['values']());}[a14_0x4ef5b3(0xba)](_0x3b072d){const _0x2739cb=a14_0x4ef5b3;return this[_0x2739cb(0xa6)][_0x2739cb(0xba)](_0x3b072d);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a15_0x124b00=a15_0x15e1;(function(_0x20a132,_0x23cf26){const _0x965fb=a15_0x15e1,_0x4fd01b=_0x20a132();while(!![]){try{const _0x38ee1b=parseInt(_0x965fb(0x17d))/0x1+-parseInt(_0x965fb(0x164))/0x2*(parseInt(_0x965fb(0x159))/0x3)+-parseInt(_0x965fb(0x1c4))/0x4+parseInt(_0x965fb(0x1b7))/0x5+parseInt(_0x965fb(0x19e))/0x6*(parseInt(_0x965fb(0x184))/0x7)+parseInt(_0x965fb(0x1bf))/0x8+-parseInt(_0x965fb(0x179))/0x9*(parseInt(_0x965fb(0x183))/0xa);if(_0x38ee1b===_0x23cf26)break;else _0x4fd01b['push'](_0x4fd01b['shift']());}catch(_0x1b962b){_0x4fd01b['push'](_0x4fd01b['shift']());}}}(a15_0x55c0,0x93e4e));import{BaseCommand}from'./command.js';function a15_0x55c0(){const _0x1bd203=['find','output','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','List\x20available\x20connector\x20types','Resolving\x20connector\x20type\x20or\x20name:\x20','repeat','List\x20all\x20result\x20output\x20connections','description','3347005bLqPVx','Options:\x20','\x20\x20\x20\x20Options:\x20','Fetching\x20settings\x20for\x20connector\x20type:\x20','connection:show','✔\x20Found\x20connection:\x20','entries','connection','8641136jAlVrB','Default:\x20','✔\x20Found\x20','verbose','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','2207844Pfwkwf','findByName','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.','>=\x20','Range:\x20','max','1782234fpYbcg','<=\x20','push','Fetching\x20schema\x20for\x20\x27','\x0aNo\x20fields\x20defined\x20in\x20schema','criteria','\x20-\x20','value','limit','Show\x20when:\x20','title','4YVoNHY','execute','minimum','✔\x20Found\x20schema\x20for\x20connection\x20\x27','Looking\x20up\x20connection:\x20','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','log','site','blue','\x0aConnector:\x20','validate','getMetadata','connection:list','listTypes','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.','list','\x0aCredential\x20settings:','default_value','label','cyan','\x27...','399834HmrwnS','credential','Site:\x20','legacy_settings','371509agKspQ','Show\x20connection\x20details','bold','table','sort','\x0aNo\x20credential\x20settings\x20defined','220fWGCAq','217eYzrwb','object','Fetching\x20connection\x20\x27','maximum','properties','map','No\x20available\x20fields\x20for\x20this\x20connector','slice','✔\x20Resolved\x20\x27','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','\x27\x20as\x20connector\x20type','type','hint','connection:types','connection:schema','filter','stringify','length','connection:settings','dim','name','enumeration','padStart','\x0aConnection:\x20','yellow','Listing\x20connections...','232686YFzYLy','error','input','localeCompare','options','getOutputSchema','Type:\x20','\x20\x20\x20\x20','data','Treating\x20\x27','\x20connection','owner','join','legacy','Fetching\x20settings\x20for\x20\x27','record','\x0aAvailable\x20fields:'];a15_0x55c0=function(){return _0x1bd203;};return a15_0x55c0();}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';function a15_0x15e1(_0x133c72,_0x3b5471){_0x133c72=_0x133c72-0x159;const _0x55c012=a15_0x55c0();let _0x15e1af=_0x55c012[_0x133c72];return _0x15e1af;}import a15_0x5c5a26 from'chalk';function normalizeSchemaForDisplay(_0x593e28){const _0x2bf45e=a15_0x15e1,_0x30b47c=_0x593e28[_0x2bf45e(0x188)]||[],_0x5be4c1=_0x30b47c[_0x2bf45e(0x1af)](_0x218a93=>_0x218a93[_0x2bf45e(0x198)]===_0x2bf45e(0x17c)&&_0x218a93[_0x2bf45e(0x18f)]==='record'&&_0x218a93[_0x2bf45e(0x188)]);if(_0x5be4c1?.['properties']){const _0x3baec3=_0x30b47c[_0x2bf45e(0x193)](_0x33588c=>_0x33588c[_0x2bf45e(0x198)]!==_0x2bf45e(0x1ab)&&_0x33588c[_0x2bf45e(0x198)]!==_0x2bf45e(0x17c));return[..._0x3baec3,..._0x5be4c1[_0x2bf45e(0x188)]];}return _0x30b47c['filter'](_0xb3903=>_0xb3903[_0x2bf45e(0x198)]!==_0x2bf45e(0x1ab));}function printSchemaFields(_0x103069,_0x9051fb){const _0x307472=a15_0x15e1,_0x2aceff='\x20\x20'[_0x307472(0x1b4)](_0x9051fb+0x1),_0x388609='\x20\x20'[_0x307472(0x1b4)](_0x9051fb+0x2);for(const _0x5c99d3 of _0x103069){if(!_0x5c99d3[_0x307472(0x198)])continue;const _0x80b953=_0x5c99d3[_0x307472(0x18f)]===_0x307472(0x1ad)&&_0x5c99d3['properties']&&_0x5c99d3['properties'][_0x307472(0x195)]>0x0&&_0x5c99d3[_0x307472(0x198)]!==_0x307472(0x17c);let _0xa4bee8=''+_0x2aceff+a15_0x5c5a26['green'](_0x5c99d3['name']);_0x5c99d3[_0x307472(0x163)]&&(_0xa4bee8+=':\x20'+_0x5c99d3['title']);if(_0x5c99d3['input'])_0xa4bee8+=a15_0x5c5a26[_0x307472(0x197)]('\x20['+_0x5c99d3[_0x307472(0x1a0)]+']');else _0x80b953&&(_0xa4bee8+=a15_0x5c5a26[_0x307472(0x197)]('\x20[record]'));console[_0x307472(0x16a)](_0xa4bee8);_0x5c99d3[_0x307472(0x1b6)]&&console[_0x307472(0x16a)](''+_0x388609+a15_0x5c5a26['dim'](_0x5c99d3[_0x307472(0x1b6)]));if(_0x5c99d3['enumeration']){const _0xc62c41=_0x5c99d3[_0x307472(0x199)][_0x307472(0x189)](_0x24dd05=>typeof _0x24dd05===_0x307472(0x185)&&'value'in _0x24dd05?_0x24dd05[_0x307472(0x160)]:_0x24dd05)[_0x307472(0x1aa)](',\x20');console[_0x307472(0x16a)](_0x388609+_0x307472(0x1b8)+a15_0x5c5a26[_0x307472(0x19c)](_0xc62c41));}_0x5c99d3[_0x307472(0x175)]!==undefined&&console[_0x307472(0x16a)](_0x388609+_0x307472(0x1c0)+a15_0x5c5a26[_0x307472(0x16c)](String(_0x5c99d3[_0x307472(0x175)])));if(_0x5c99d3[_0x307472(0x166)]!==undefined||_0x5c99d3[_0x307472(0x187)]!==undefined){const _0x117916=_0x5c99d3[_0x307472(0x166)]!==undefined&&_0x5c99d3[_0x307472(0x187)]!==undefined?_0x5c99d3[_0x307472(0x166)]+'\x20-\x20'+_0x5c99d3[_0x307472(0x187)]:_0x5c99d3[_0x307472(0x166)]!==undefined?_0x307472(0x1c7)+_0x5c99d3['minimum']:_0x307472(0x15a)+_0x5c99d3[_0x307472(0x187)];console[_0x307472(0x16a)](_0x388609+_0x307472(0x1c8)+a15_0x5c5a26[_0x307472(0x16c)](_0x117916));}if(_0x5c99d3[_0x307472(0x15e)]){const _0x3b1175=Object[_0x307472(0x1bd)](_0x5c99d3['criteria'])[_0x307472(0x189)](([_0x8ba4ab,_0x1f2006])=>_0x8ba4ab+'='+JSON[_0x307472(0x194)](_0x1f2006))[_0x307472(0x1aa)](',\x20');console[_0x307472(0x16a)](''+_0x388609+a15_0x5c5a26[_0x307472(0x197)](_0x307472(0x162)+_0x3b1175));}_0x80b953&&_0x5c99d3[_0x307472(0x188)]&&printSchemaFields(_0x5c99d3[_0x307472(0x188)],_0x9051fb+0x1);}}export class ConnectionListCommand extends BaseCommand{['name']=a15_0x124b00(0x170);[a15_0x124b00(0x1b6)]=a15_0x124b00(0x1b5);async['execute'](_0x54f67f){const _0x1ebda9=a15_0x124b00,{options:_0x3778c9,tdx:_0x58a744}=_0x54f67f;_0x3778c9['verbose']&&console[_0x1ebda9(0x19f)](_0x1ebda9(0x17b)+_0x3778c9[_0x1ebda9(0x16b)]);const _0x2a3d8a=resolveLimit(_0x3778c9[_0x1ebda9(0x161)],DEFAULT_LISTING_LIMIT),_0x21093a=await withSpinner(_0x1ebda9(0x19d),()=>_0x58a744[_0x1ebda9(0x1be)][_0x1ebda9(0x173)](),{'verbose':_0x3778c9[_0x1ebda9(0x1c2)]}),_0x1fab7f=_0x21093a[_0x1ebda9(0x1a6)];console[_0x1ebda9(0x19f)](_0x1ebda9(0x1c1)+_0x1fab7f[_0x1ebda9(0x195)]+_0x1ebda9(0x1a8)+(_0x1fab7f[_0x1ebda9(0x195)]!==0x1?'s':''));if(isStructuredFormat(_0x3778c9)){const _0x4fd646=_0x1fab7f[_0x1ebda9(0x18b)](0x0,_0x2a3d8a);await handleSDKOutput(_0x4fd646,{..._0x3778c9,'limit':_0x2a3d8a});}else{const _0x2604fd=_0x1fab7f[_0x1ebda9(0x195)]>0x0?Math['max'](..._0x1fab7f['map'](_0x113c8e=>_0x113c8e[_0x1ebda9(0x18f)][_0x1ebda9(0x195)])):0x0,_0x2f26ef=[];for(const _0x364fbd of _0x1fab7f){const _0x29224a=a15_0x5c5a26[_0x1ebda9(0x177)](_0x364fbd['type']['padStart'](_0x2604fd)),_0xae82d=_0x364fbd[_0x1ebda9(0x1a9)]?.[_0x1ebda9(0x198)]?_0x1ebda9(0x15f)+a15_0x5c5a26['dim'](_0x364fbd[_0x1ebda9(0x1a9)][_0x1ebda9(0x198)]):'';_0x2f26ef[_0x1ebda9(0x15b)](_0x29224a+'\x20\x20'+_0x364fbd[_0x1ebda9(0x198)]+_0xae82d);}await writeOutput(_0x2f26ef[_0x1ebda9(0x1aa)]('\x0a'),_0x3778c9[_0x1ebda9(0x1b0)],_0x1ebda9(0x180));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a15_0x124b00(0x198)]=a15_0x124b00(0x1bb);['description']=a15_0x124b00(0x17e);[a15_0x124b00(0x16e)](_0x47284e){const _0x5f0970=a15_0x124b00,{args:_0x1b4c98}=_0x47284e;if(!_0x1b4c98[0x0])return _0x5f0970(0x1c3);return undefined;}async[a15_0x124b00(0x165)](_0x4db9ba){const _0x41b64a=a15_0x124b00,{options:_0x14c74d,args:_0x129e96,tdx:_0x514491}=_0x4db9ba,_0x16cca2=_0x129e96[0x0];_0x14c74d[_0x41b64a(0x1c2)]&&(console[_0x41b64a(0x19f)]('Site:\x20'+_0x14c74d['site']),console[_0x41b64a(0x19f)](_0x41b64a(0x168)+_0x16cca2));const _0x3bab7c=await withSpinner(_0x41b64a(0x186)+_0x16cca2+_0x41b64a(0x178),()=>_0x514491[_0x41b64a(0x1be)]['resolve'](_0x16cca2),{'verbose':_0x14c74d[_0x41b64a(0x1c2)]}),_0x3114f0=_0x3bab7c['data'];return console['error'](_0x41b64a(0x1bc)+_0x3114f0[_0x41b64a(0x198)]),await handleSingleObjectOutput(_0x3114f0,_0x14c74d),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a15_0x124b00(0x198)]=a15_0x124b00(0x192);[a15_0x124b00(0x1b6)]=a15_0x124b00(0x18d);[a15_0x124b00(0x16e)](_0x47be25){const _0x390af0=a15_0x124b00,{args:_0x366af8}=_0x47be25;if(!_0x366af8[0x0])return _0x390af0(0x172);return undefined;}async[a15_0x124b00(0x165)](_0x146052){const _0xf396ce=a15_0x124b00,{options:_0xd39779,args:_0x5f2e06,tdx:_0x4ff812}=_0x146052,_0x31bce6=_0x5f2e06[0x0];_0xd39779[_0xf396ce(0x1c2)]&&(console['error'](_0xf396ce(0x17b)+_0xd39779[_0xf396ce(0x16b)]),console[_0xf396ce(0x19f)](_0xf396ce(0x1b3)+_0x31bce6));let _0x3c6751=_0x31bce6,_0x37a3a0;try{const _0x7415ea=await _0x4ff812[_0xf396ce(0x1be)][_0xf396ce(0x1c5)](_0x31bce6);_0x7415ea&&(_0x3c6751=_0x7415ea['type'],_0x37a3a0=_0x7415ea[_0xf396ce(0x198)],_0xd39779['verbose']&&console[_0xf396ce(0x19f)](_0xf396ce(0x18c)+_0x31bce6+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x3c6751));}catch{_0xd39779['verbose']&&console[_0xf396ce(0x19f)](_0xf396ce(0x1a7)+_0x31bce6+_0xf396ce(0x18e));}const _0x43df6f=await withSpinner(_0xf396ce(0x15c)+_0x3c6751+_0xf396ce(0x178),()=>_0x4ff812[_0xf396ce(0x1be)][_0xf396ce(0x1a3)](_0x3c6751),{'verbose':_0xd39779[_0xf396ce(0x1c2)]}),_0x4047f=_0x43df6f[_0xf396ce(0x1a6)];_0x37a3a0?console[_0xf396ce(0x19f)](_0xf396ce(0x167)+_0x37a3a0+'\x27\x20(type:\x20'+_0x3c6751+')'):console[_0xf396ce(0x19f)](_0xf396ce(0x1b1)+_0x3c6751);if(isStructuredFormat(_0xd39779))await handleSingleObjectOutput(_0x4047f,_0xd39779);else{const _0x558be1=normalizeSchemaForDisplay(_0x4047f);_0x37a3a0?(console[_0xf396ce(0x16a)](_0xf396ce(0x19b)+a15_0x5c5a26['cyan'](_0x37a3a0)),console[_0xf396ce(0x16a)](_0xf396ce(0x1a4)+a15_0x5c5a26[_0xf396ce(0x197)](_0x3c6751))):console[_0xf396ce(0x16a)](_0xf396ce(0x16d)+a15_0x5c5a26[_0xf396ce(0x177)](_0x3c6751)),_0x558be1[_0xf396ce(0x195)]>0x0?(console[_0xf396ce(0x16a)](a15_0x5c5a26[_0xf396ce(0x17f)](_0xf396ce(0x1ae))),printSchemaFields(_0x558be1,0x0)):console[_0xf396ce(0x16a)](a15_0x5c5a26[_0xf396ce(0x197)](_0xf396ce(0x15d)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a15_0x124b00(0x191);[a15_0x124b00(0x1b6)]=a15_0x124b00(0x1b2);async[a15_0x124b00(0x165)](_0x1196ed){const _0x400759=a15_0x124b00,{options:_0x58cdda,tdx:_0x9653a4}=_0x1196ed;_0x58cdda['verbose']&&console['error'](_0x400759(0x17b)+_0x58cdda[_0x400759(0x16b)]);const _0x3e9dfa=await withSpinner('Listing\x20connector\x20types...',()=>_0x9653a4[_0x400759(0x1be)][_0x400759(0x171)](),{'verbose':_0x58cdda['verbose']}),_0x4e9565=_0x3e9dfa[_0x400759(0x1a6)][_0x400759(0x181)]((_0x5b4df6,_0x4573ed)=>_0x5b4df6[_0x400759(0x18f)][_0x400759(0x1a1)](_0x4573ed['type']));console[_0x400759(0x19f)](_0x400759(0x1c1)+_0x4e9565[_0x400759(0x195)]+'\x20connector\x20type'+(_0x4e9565[_0x400759(0x195)]!==0x1?'s':''));if(isStructuredFormat(_0x58cdda))await handleSDKOutput(_0x4e9565,_0x58cdda);else{const _0x31cd66=_0x4e9565['length']>0x0?Math[_0x400759(0x1c9)](..._0x4e9565[_0x400759(0x189)](_0x229687=>_0x229687[_0x400759(0x18f)][_0x400759(0x195)])):0x0,_0x1e8a27=[];for(const _0x33c268 of _0x4e9565){const _0x52f022=a15_0x5c5a26[_0x400759(0x177)](_0x33c268[_0x400759(0x18f)][_0x400759(0x19a)](_0x31cd66));_0x1e8a27['push'](_0x52f022+'\x20\x20'+_0x33c268['name']);}await writeOutput(_0x1e8a27['join']('\x0a'),_0x58cdda[_0x400759(0x1b0)],_0x400759(0x180));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{['name']=a15_0x124b00(0x196);[a15_0x124b00(0x1b6)]='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';[a15_0x124b00(0x16e)](_0x57a51d){const _0x30bbba=a15_0x124b00,{args:_0x63a61e}=_0x57a51d;if(!_0x63a61e[0x0])return _0x30bbba(0x1c6);return undefined;}async[a15_0x124b00(0x165)](_0x5b355f){const _0x59854f=a15_0x124b00,{options:_0x344434,args:_0x32da56,tdx:_0x2c187b}=_0x5b355f,_0x5c3dde=_0x32da56[0x0];_0x344434[_0x59854f(0x1c2)]&&(console['error']('Site:\x20'+_0x344434[_0x59854f(0x16b)]),console['error'](_0x59854f(0x1ba)+_0x5c3dde));const _0x57aa26=await withSpinner(_0x59854f(0x1ac)+_0x5c3dde+_0x59854f(0x178),()=>_0x2c187b[_0x59854f(0x1be)][_0x59854f(0x16f)](_0x5c3dde),{'verbose':_0x344434['verbose']}),_0x51633d=_0x57aa26[_0x59854f(0x1a6)];console['error'](_0x59854f(0x169)+_0x5c3dde);if(isStructuredFormat(_0x344434))await handleSingleObjectOutput(_0x51633d,_0x344434);else{console['log'](_0x59854f(0x16d)+a15_0x5c5a26['cyan'](_0x5c3dde)),console['log']('Name:\x20'+_0x51633d[_0x59854f(0x198)]);const _0x570c32=_0x51633d['settings']||[],_0x4852ea=_0x570c32[_0x59854f(0x193)](_0x5c9aa8=>_0x5c9aa8[_0x59854f(0x17a)]);_0x4852ea[_0x59854f(0x195)]>0x0&&(console[_0x59854f(0x16a)](a15_0x5c5a26[_0x59854f(0x17f)](_0x59854f(0x174))),printMetadataSettings(_0x4852ea));let _0x37c8db=![];try{const _0x5a0bbc=await _0x2c187b[_0x59854f(0x1be)][_0x59854f(0x1a3)](_0x5c3dde),_0x227d97=normalizeSchemaForDisplay(_0x5a0bbc);_0x227d97[_0x59854f(0x195)]>0x0&&(console[_0x59854f(0x16a)](a15_0x5c5a26['bold']('\x0aAvailable\x20fields:')),printSchemaFields(_0x227d97,0x0),_0x37c8db=!![]);}catch{const _0x30a602=_0x570c32[_0x59854f(0x193)](_0x3e7383=>!_0x3e7383[_0x59854f(0x17a)]);_0x30a602[_0x59854f(0x195)]>0x0&&(console[_0x59854f(0x16a)](a15_0x5c5a26['bold'](_0x59854f(0x1ae))),printMetadataSettings(_0x30a602),_0x37c8db=!![]);}!_0x37c8db&&_0x344434[_0x59854f(0x1c2)]&&console[_0x59854f(0x19f)](a15_0x5c5a26['dim'](_0x59854f(0x18a))),_0x4852ea[_0x59854f(0x195)]===0x0&&console['log'](a15_0x5c5a26['dim'](_0x59854f(0x182)));}return 0x0;}}function printMetadataSettings(_0x199b04){const _0x175f9b=a15_0x124b00;for(const _0x13704c of _0x199b04){if(!_0x13704c[_0x175f9b(0x198)])continue;if(_0x13704c['hidden'])continue;let _0x5880f1='\x20\x20'+a15_0x5c5a26['green'](_0x13704c['name']);_0x13704c[_0x175f9b(0x176)]&&(_0x5880f1+=':\x20'+_0x13704c['label']);_0x13704c[_0x175f9b(0x18f)]&&(_0x5880f1+=a15_0x5c5a26[_0x175f9b(0x197)]('\x20['+_0x13704c[_0x175f9b(0x18f)]+']'));console[_0x175f9b(0x16a)](_0x5880f1);_0x13704c[_0x175f9b(0x190)]&&console[_0x175f9b(0x16a)](_0x175f9b(0x1a5)+a15_0x5c5a26[_0x175f9b(0x197)](_0x13704c[_0x175f9b(0x190)]));if(_0x13704c['options']){const _0x47125b=_0x13704c[_0x175f9b(0x1a2)][_0x175f9b(0x189)](_0x329bcf=>_0x329bcf[_0x175f9b(0x160)])[_0x175f9b(0x1aa)](',\x20');console[_0x175f9b(0x16a)](_0x175f9b(0x1b9)+a15_0x5c5a26[_0x175f9b(0x19c)](_0x47125b));}_0x13704c[_0x175f9b(0x175)]!==undefined&&_0x13704c[_0x175f9b(0x175)]!==null&&console[_0x175f9b(0x16a)]('\x20\x20\x20\x20Default:\x20'+a15_0x5c5a26[_0x175f9b(0x16c)](String(_0x13704c[_0x175f9b(0x175)])));if(_0x13704c[_0x175f9b(0x15e)]){const _0x1d1a37=Object[_0x175f9b(0x1bd)](_0x13704c[_0x175f9b(0x15e)])[_0x175f9b(0x189)](([_0xe414a8,_0x2af4c3])=>_0xe414a8+'='+JSON[_0x175f9b(0x194)](_0x2af4c3))['join'](',\x20');console[_0x175f9b(0x16a)](_0x175f9b(0x1a5)+a15_0x5c5a26[_0x175f9b(0x197)](_0x175f9b(0x162)+_0x1d1a37));}}}
1
+ const a15_0x5d3800=a15_0x1a71;(function(_0x11abe6,_0x57607a){const _0x17650a=a15_0x1a71,_0x3c8fed=_0x11abe6();while(!![]){try{const _0x40f9f0=-parseInt(_0x17650a(0x10b))/0x1+parseInt(_0x17650a(0xe0))/0x2+parseInt(_0x17650a(0x139))/0x3*(parseInt(_0x17650a(0xfe))/0x4)+parseInt(_0x17650a(0xe5))/0x5*(parseInt(_0x17650a(0xf5))/0x6)+-parseInt(_0x17650a(0x121))/0x7*(parseInt(_0x17650a(0xef))/0x8)+parseInt(_0x17650a(0x13c))/0x9*(parseInt(_0x17650a(0x120))/0xa)+-parseInt(_0x17650a(0x142))/0xb;if(_0x40f9f0===_0x57607a)break;else _0x3c8fed['push'](_0x3c8fed['shift']());}catch(_0x2b3d4d){_0x3c8fed['push'](_0x3c8fed['shift']());}}}(a15_0x4b96,0x1f8fd));function a15_0x1a71(_0x20140a,_0x362ca4){_0x20140a=_0x20140a-0xdf;const _0x4b96af=a15_0x4b96();let _0x1a710a=_0x4b96af[_0x20140a];return _0x1a710a;}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 a15_0x30abab from'chalk';function normalizeSchemaForDisplay(_0x5aa535){const _0x28d60c=a15_0x1a71,_0x53e358=_0x5aa535['properties']||[],_0x333544=_0x53e358[_0x28d60c(0x145)](_0x1ad72b=>_0x1ad72b['name']===_0x28d60c(0x12d)&&_0x1ad72b[_0x28d60c(0x116)]==='record'&&_0x1ad72b[_0x28d60c(0x113)]);if(_0x333544?.[_0x28d60c(0x113)]){const _0x1ec7a3=_0x53e358[_0x28d60c(0x11c)](_0x43445c=>_0x43445c[_0x28d60c(0xfd)]!==_0x28d60c(0x12b)&&_0x43445c[_0x28d60c(0xfd)]!=='legacy_settings');return[..._0x1ec7a3,..._0x333544[_0x28d60c(0x113)]];}return _0x53e358[_0x28d60c(0x11c)](_0x54813b=>_0x54813b[_0x28d60c(0xfd)]!==_0x28d60c(0x12b));}function printSchemaFields(_0x3b9ef8,_0xb6c8cc){const _0x22934f=a15_0x1a71,_0x254c85='\x20\x20'[_0x22934f(0x117)](_0xb6c8cc+0x1),_0x23d5c5='\x20\x20'[_0x22934f(0x117)](_0xb6c8cc+0x2);for(const _0x485571 of _0x3b9ef8){if(!_0x485571[_0x22934f(0xfd)])continue;const _0x146b83=_0x485571[_0x22934f(0x116)]===_0x22934f(0xf6)&&_0x485571[_0x22934f(0x113)]&&_0x485571['properties']['length']>0x0&&_0x485571[_0x22934f(0xfd)]!==_0x22934f(0x12d);let _0x3b9b5f=''+_0x254c85+a15_0x30abab[_0x22934f(0xec)](_0x485571[_0x22934f(0xfd)]);_0x485571[_0x22934f(0xe4)]&&(_0x3b9b5f+=':\x20'+_0x485571[_0x22934f(0xe4)]);if(_0x485571[_0x22934f(0xe8)])_0x3b9b5f+=a15_0x30abab[_0x22934f(0x118)]('\x20['+_0x485571[_0x22934f(0xe8)]+']');else _0x146b83&&(_0x3b9b5f+=a15_0x30abab['dim'](_0x22934f(0x12c)));console[_0x22934f(0xe9)](_0x3b9b5f);_0x485571[_0x22934f(0x122)]&&console[_0x22934f(0xe9)](''+_0x23d5c5+a15_0x30abab[_0x22934f(0x118)](_0x485571[_0x22934f(0x122)]));if(_0x485571[_0x22934f(0xe2)]){const _0x4d80c4=_0x485571[_0x22934f(0xe2)]['map'](_0x40440=>typeof _0x40440==='object'&&_0x22934f(0x146)in _0x40440?_0x40440[_0x22934f(0x146)]:_0x40440)[_0x22934f(0x131)](',\x20');console['log'](_0x23d5c5+_0x22934f(0x104)+a15_0x30abab[_0x22934f(0xfb)](_0x4d80c4));}_0x485571[_0x22934f(0xee)]!==undefined&&console[_0x22934f(0xe9)](_0x23d5c5+_0x22934f(0x144)+a15_0x30abab[_0x22934f(0x11f)](String(_0x485571['default_value'])));if(_0x485571[_0x22934f(0xfc)]!==undefined||_0x485571['maximum']!==undefined){const _0x7c970c=_0x485571[_0x22934f(0xfc)]!==undefined&&_0x485571[_0x22934f(0x13d)]!==undefined?_0x485571['minimum']+_0x22934f(0x105)+_0x485571[_0x22934f(0x13d)]:_0x485571[_0x22934f(0xfc)]!==undefined?_0x22934f(0x138)+_0x485571[_0x22934f(0xfc)]:_0x22934f(0x110)+_0x485571[_0x22934f(0x13d)];console[_0x22934f(0xe9)](_0x23d5c5+'Range:\x20'+a15_0x30abab[_0x22934f(0x11f)](_0x7c970c));}if(_0x485571[_0x22934f(0x11b)]){const _0x11d5b1=Object['entries'](_0x485571[_0x22934f(0x11b)])['map'](([_0x51a4a8,_0x9dfa4f])=>_0x51a4a8+'='+JSON[_0x22934f(0x107)](_0x9dfa4f))[_0x22934f(0x131)](',\x20');console[_0x22934f(0xe9)](''+_0x23d5c5+a15_0x30abab[_0x22934f(0x118)]('Show\x20when:\x20'+_0x11d5b1));}_0x146b83&&_0x485571[_0x22934f(0x113)]&&printSchemaFields(_0x485571[_0x22934f(0x113)],_0xb6c8cc+0x1);}}export class ConnectionListCommand extends BaseCommand{[a15_0x5d3800(0xfd)]=a15_0x5d3800(0x123);[a15_0x5d3800(0x122)]='List\x20all\x20result\x20output\x20connections';async[a15_0x5d3800(0x12e)](_0x1549f4){const _0xcf02ad=a15_0x5d3800,{options:_0x306d57,tdx:_0x2bda58}=_0x1549f4;_0x306d57[_0xcf02ad(0x149)]&&console['error'](_0xcf02ad(0x11d)+_0x306d57[_0xcf02ad(0x134)]);const _0x5b03bf=resolveLimit(_0x306d57[_0xcf02ad(0x13f)],DEFAULT_LISTING_LIMIT),_0xd380e5=await withSpinner(_0xcf02ad(0xf8),()=>_0x2bda58[_0xcf02ad(0xf1)][_0xcf02ad(0x128)](),{'verbose':_0x306d57[_0xcf02ad(0x149)]}),_0x119973=_0xd380e5[_0xcf02ad(0x10c)];console['error']('✔\x20Found\x20'+_0x119973[_0xcf02ad(0x13e)]+'\x20connection'+(_0x119973[_0xcf02ad(0x13e)]!==0x1?'s':''));if(isStructuredFormat(_0x306d57)){const _0x3179b9=_0x119973[_0xcf02ad(0x127)](0x0,_0x5b03bf);await handleSDKOutput(_0x3179b9,{..._0x306d57,'limit':_0x5b03bf});}else{const _0x54c2c2=_0x119973[_0xcf02ad(0x13e)]>0x0?Math['max'](..._0x119973['map'](_0x1e0346=>_0x1e0346[_0xcf02ad(0x116)][_0xcf02ad(0x13e)])):0x0,_0x1a4333=[];for(const _0x5dc780 of _0x119973){const _0x41bea6=a15_0x30abab[_0xcf02ad(0x11e)](_0x5dc780[_0xcf02ad(0x116)][_0xcf02ad(0x108)](_0x54c2c2)),_0x48df78=_0x5dc780[_0xcf02ad(0xe3)]?.['name']?_0xcf02ad(0x105)+a15_0x30abab[_0xcf02ad(0x118)](_0x5dc780[_0xcf02ad(0xe3)][_0xcf02ad(0xfd)]):'';_0x1a4333[_0xcf02ad(0x135)](_0x41bea6+'\x20\x20'+_0x5dc780[_0xcf02ad(0xfd)]+_0x48df78);}await writeOutput(_0x1a4333[_0xcf02ad(0x131)]('\x0a'),_0x306d57[_0xcf02ad(0x103)],_0xcf02ad(0x10a));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a15_0x5d3800(0xfd)]=a15_0x5d3800(0x109);[a15_0x5d3800(0x122)]='Show\x20connection\x20details';[a15_0x5d3800(0x14a)](_0x197e92){const _0x97e4d0=a15_0x5d3800,{args:_0x444a67}=_0x197e92;if(!_0x444a67[0x0])return _0x97e4d0(0x147);return undefined;}async[a15_0x5d3800(0x12e)](_0x270db4){const _0x1b8646=a15_0x5d3800,{options:_0x2e7cf7,args:_0x2ad2f1,tdx:_0x3542c2}=_0x270db4,_0x2ffaad=_0x2ad2f1[0x0];_0x2e7cf7[_0x1b8646(0x149)]&&(console[_0x1b8646(0x106)](_0x1b8646(0x11d)+_0x2e7cf7[_0x1b8646(0x134)]),console[_0x1b8646(0x106)](_0x1b8646(0x10d)+_0x2ffaad));const _0x272e72=await withSpinner(_0x1b8646(0x12f)+_0x2ffaad+_0x1b8646(0xf9),()=>_0x3542c2[_0x1b8646(0xf1)][_0x1b8646(0xe7)](_0x2ffaad),{'verbose':_0x2e7cf7['verbose']}),_0xea0b16=_0x272e72[_0x1b8646(0x10c)];return console[_0x1b8646(0x106)](_0x1b8646(0x100)+_0xea0b16[_0x1b8646(0xfd)]),await handleSingleObjectOutput(_0xea0b16,_0x2e7cf7),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a15_0x5d3800(0xfd)]='connection:schema';[a15_0x5d3800(0x122)]=a15_0x5d3800(0x11a);[a15_0x5d3800(0x14a)](_0x2f9944){const _0x49d2ad=a15_0x5d3800,{args:_0x28a2b1}=_0x2f9944;if(!_0x28a2b1[0x0])return _0x49d2ad(0x111);return undefined;}async[a15_0x5d3800(0x12e)](_0x2367c5){const _0x6fe4d9=a15_0x5d3800,{options:_0x2fe19e,args:_0xbffe3b,tdx:_0x440887}=_0x2367c5,_0x636b86=_0xbffe3b[0x0];_0x2fe19e[_0x6fe4d9(0x149)]&&(console[_0x6fe4d9(0x106)](_0x6fe4d9(0x11d)+_0x2fe19e[_0x6fe4d9(0x134)]),console[_0x6fe4d9(0x106)]('Resolving\x20connector\x20type\x20or\x20name:\x20'+_0x636b86));let _0x2e14be=_0x636b86,_0x30938b;try{const _0x203ba8=await _0x440887['connection'][_0x6fe4d9(0x13a)](_0x636b86);_0x203ba8&&(_0x2e14be=_0x203ba8[_0x6fe4d9(0x116)],_0x30938b=_0x203ba8[_0x6fe4d9(0xfd)],_0x2fe19e[_0x6fe4d9(0x149)]&&console['error'](_0x6fe4d9(0x102)+_0x636b86+_0x6fe4d9(0x124)+_0x2e14be));}catch{_0x2fe19e[_0x6fe4d9(0x149)]&&console['error'](_0x6fe4d9(0xed)+_0x636b86+'\x27\x20as\x20connector\x20type');}const _0x1d3c01=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x2e14be+_0x6fe4d9(0xf9),()=>_0x440887['connection'][_0x6fe4d9(0xe1)](_0x2e14be),{'verbose':_0x2fe19e[_0x6fe4d9(0x149)]}),_0x3b8cba=_0x1d3c01[_0x6fe4d9(0x10c)];_0x30938b?console[_0x6fe4d9(0x106)](_0x6fe4d9(0x136)+_0x30938b+'\x27\x20(type:\x20'+_0x2e14be+')'):console['error']('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x2e14be);if(isStructuredFormat(_0x2fe19e))await handleSingleObjectOutput(_0x3b8cba,_0x2fe19e);else{const _0x30fb82=normalizeSchemaForDisplay(_0x3b8cba);_0x30938b?(console[_0x6fe4d9(0xe9)]('\x0aConnection:\x20'+a15_0x30abab['cyan'](_0x30938b)),console[_0x6fe4d9(0xe9)](_0x6fe4d9(0xf3)+a15_0x30abab[_0x6fe4d9(0x118)](_0x2e14be))):console[_0x6fe4d9(0xe9)]('\x0aConnector:\x20'+a15_0x30abab[_0x6fe4d9(0x11e)](_0x2e14be)),_0x30fb82[_0x6fe4d9(0x13e)]>0x0?(console[_0x6fe4d9(0xe9)](a15_0x30abab[_0x6fe4d9(0x129)](_0x6fe4d9(0xf0))),printSchemaFields(_0x30fb82,0x0)):console[_0x6fe4d9(0xe9)](a15_0x30abab['dim'](_0x6fe4d9(0x133)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a15_0x5d3800(0x10e);['description']=a15_0x5d3800(0x148);async[a15_0x5d3800(0x12e)](_0x1b0382){const _0x3a0f2e=a15_0x5d3800,{options:_0x5e0913,tdx:_0x571723}=_0x1b0382;_0x5e0913[_0x3a0f2e(0x149)]&&console[_0x3a0f2e(0x106)](_0x3a0f2e(0x11d)+_0x5e0913[_0x3a0f2e(0x134)]);const _0x3de315=await withSpinner(_0x3a0f2e(0x115),()=>_0x571723[_0x3a0f2e(0xf1)][_0x3a0f2e(0xf4)](),{'verbose':_0x5e0913[_0x3a0f2e(0x149)]}),_0x64684=_0x3de315[_0x3a0f2e(0x10c)]['sort']((_0x4cfde0,_0x232847)=>_0x4cfde0[_0x3a0f2e(0x116)]['localeCompare'](_0x232847['type']));console['error'](_0x3a0f2e(0x114)+_0x64684['length']+_0x3a0f2e(0x10f)+(_0x64684['length']!==0x1?'s':''));if(isStructuredFormat(_0x5e0913))await handleSDKOutput(_0x64684,_0x5e0913);else{const _0x4e60b3=_0x64684[_0x3a0f2e(0x13e)]>0x0?Math[_0x3a0f2e(0x125)](..._0x64684[_0x3a0f2e(0xf7)](_0x2b0490=>_0x2b0490[_0x3a0f2e(0x116)][_0x3a0f2e(0x13e)])):0x0,_0x51f643=[];for(const _0x38acb1 of _0x64684){const _0x392683=a15_0x30abab[_0x3a0f2e(0x11e)](_0x38acb1[_0x3a0f2e(0x116)]['padStart'](_0x4e60b3));_0x51f643[_0x3a0f2e(0x135)](_0x392683+'\x20\x20'+_0x38acb1[_0x3a0f2e(0xfd)]);}await writeOutput(_0x51f643[_0x3a0f2e(0x131)]('\x0a'),_0x5e0913[_0x3a0f2e(0x103)],_0x3a0f2e(0x10a));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a15_0x5d3800(0xfd)]=a15_0x5d3800(0x101);['description']=a15_0x5d3800(0xe6);[a15_0x5d3800(0x14a)](_0x1ab6bf){const _0x54d47d=a15_0x5d3800,{args:_0x24e19d}=_0x1ab6bf;if(!_0x24e19d[0x0])return _0x54d47d(0xdf);return undefined;}async['execute'](_0x3a62cf){const _0x4cebc5=a15_0x5d3800,{options:_0x1048fc,args:_0x385211,tdx:_0x17d77d}=_0x3a62cf,_0x2d142c=_0x385211[0x0];_0x1048fc['verbose']&&(console[_0x4cebc5(0x106)](_0x4cebc5(0x11d)+_0x1048fc[_0x4cebc5(0x134)]),console['error'](_0x4cebc5(0x143)+_0x2d142c));const _0x2d9811=await withSpinner(_0x4cebc5(0xff)+_0x2d142c+_0x4cebc5(0xf9),()=>_0x17d77d['connection']['getMetadata'](_0x2d142c),{'verbose':_0x1048fc[_0x4cebc5(0x149)]}),_0x4d4834=_0x2d9811[_0x4cebc5(0x10c)];console['error'](_0x4cebc5(0x130)+_0x2d142c);if(isStructuredFormat(_0x1048fc))await handleSingleObjectOutput(_0x4d4834,_0x1048fc);else{console[_0x4cebc5(0xe9)](_0x4cebc5(0x141)+a15_0x30abab[_0x4cebc5(0x11e)](_0x2d142c)),console[_0x4cebc5(0xe9)](_0x4cebc5(0x12a)+_0x4d4834[_0x4cebc5(0xfd)]);const _0x45a6f3=_0x4d4834[_0x4cebc5(0x126)]||[],_0x4e3541=_0x45a6f3[_0x4cebc5(0x11c)](_0x5d7360=>_0x5d7360[_0x4cebc5(0x13b)]);_0x4e3541[_0x4cebc5(0x13e)]>0x0&&(console[_0x4cebc5(0xe9)](a15_0x30abab[_0x4cebc5(0x129)](_0x4cebc5(0x119))),printMetadataSettings(_0x4e3541));let _0x5ef830=![];try{const _0x323880=await _0x17d77d[_0x4cebc5(0xf1)][_0x4cebc5(0xe1)](_0x2d142c),_0x2ac4b6=normalizeSchemaForDisplay(_0x323880);_0x2ac4b6[_0x4cebc5(0x13e)]>0x0&&(console[_0x4cebc5(0xe9)](a15_0x30abab[_0x4cebc5(0x129)](_0x4cebc5(0xf0))),printSchemaFields(_0x2ac4b6,0x0),_0x5ef830=!![]);}catch{const _0xdfcec6=_0x45a6f3[_0x4cebc5(0x11c)](_0x388457=>!_0x388457['credential']);_0xdfcec6[_0x4cebc5(0x13e)]>0x0&&(console[_0x4cebc5(0xe9)](a15_0x30abab[_0x4cebc5(0x129)](_0x4cebc5(0xf0))),printMetadataSettings(_0xdfcec6),_0x5ef830=!![]);}!_0x5ef830&&_0x1048fc['verbose']&&console[_0x4cebc5(0x106)](a15_0x30abab['dim'](_0x4cebc5(0x140))),_0x4e3541['length']===0x0&&console[_0x4cebc5(0xe9)](a15_0x30abab[_0x4cebc5(0x118)]('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function a15_0x4b96(){const _0x4393fd=['Show\x20when:\x20','options','green','Treating\x20\x27','default_value','16AJmPhD','\x0aAvailable\x20fields:','connection','hint','Type:\x20','listTypes','21156XvLgzg','record','map','Listing\x20connections...','\x27...','\x20\x20\x20\x20','yellow','minimum','name','305608jfBkEN','Fetching\x20settings\x20for\x20\x27','✔\x20Found\x20connection:\x20','connection:settings','✔\x20Resolved\x20\x27','output','Options:\x20','\x20-\x20','error','stringify','padStart','connection:show','table','16435OEwiAm','data','Looking\x20up\x20connection:\x20','connection:types','\x20connector\x20type','<=\x20','Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.','\x20\x20\x20\x20Default:\x20','properties','✔\x20Found\x20','Listing\x20connector\x20types...','type','repeat','dim','\x0aCredential\x20settings:','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','criteria','filter','Site:\x20','cyan','blue','5090YSFFoJ','473102QIhPqn','description','connection:list','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','max','settings','slice','list','bold','Name:\x20','legacy','\x20[record]','legacy_settings','execute','Fetching\x20connection\x20\x27','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','join','\x20\x20\x20\x20Options:\x20','\x0aNo\x20fields\x20defined\x20in\x20schema','site','push','✔\x20Found\x20schema\x20for\x20connection\x20\x27','label','>=\x20','9cFoNsf','findByName','credential','2727CogKqg','maximum','length','limit','No\x20available\x20fields\x20for\x20this\x20connector','\x0aConnector:\x20','4097511yGJyOt','Fetching\x20settings\x20for\x20connector\x20type:\x20','Default:\x20','find','value','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','List\x20available\x20connector\x20types','verbose','validate','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.','173200pJwkve','getOutputSchema','enumeration','owner','title','260woxjNV','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','resolve','input','log'];a15_0x4b96=function(){return _0x4393fd;};return a15_0x4b96();}function printMetadataSettings(_0x55e435){const _0x33f1f4=a15_0x5d3800;for(const _0x42586c of _0x55e435){if(!_0x42586c[_0x33f1f4(0xfd)])continue;if(_0x42586c['hidden'])continue;let _0x505621='\x20\x20'+a15_0x30abab[_0x33f1f4(0xec)](_0x42586c['name']);_0x42586c[_0x33f1f4(0x137)]&&(_0x505621+=':\x20'+_0x42586c[_0x33f1f4(0x137)]);_0x42586c[_0x33f1f4(0x116)]&&(_0x505621+=a15_0x30abab[_0x33f1f4(0x118)]('\x20['+_0x42586c[_0x33f1f4(0x116)]+']'));console[_0x33f1f4(0xe9)](_0x505621);_0x42586c[_0x33f1f4(0xf2)]&&console[_0x33f1f4(0xe9)](_0x33f1f4(0xfa)+a15_0x30abab[_0x33f1f4(0x118)](_0x42586c[_0x33f1f4(0xf2)]));if(_0x42586c[_0x33f1f4(0xeb)]){const _0x3571f3=_0x42586c[_0x33f1f4(0xeb)]['map'](_0x296685=>_0x296685['value'])[_0x33f1f4(0x131)](',\x20');console[_0x33f1f4(0xe9)](_0x33f1f4(0x132)+a15_0x30abab[_0x33f1f4(0xfb)](_0x3571f3));}_0x42586c[_0x33f1f4(0xee)]!==undefined&&_0x42586c['default_value']!==null&&console[_0x33f1f4(0xe9)](_0x33f1f4(0x112)+a15_0x30abab[_0x33f1f4(0x11f)](String(_0x42586c[_0x33f1f4(0xee)])));if(_0x42586c[_0x33f1f4(0x11b)]){const _0x230f2c=Object['entries'](_0x42586c['criteria'])['map'](([_0x415e74,_0x10d33b])=>_0x415e74+'='+JSON[_0x33f1f4(0x107)](_0x10d33b))[_0x33f1f4(0x131)](',\x20');console['log'](_0x33f1f4(0xfa)+a15_0x30abab[_0x33f1f4(0x118)](_0x33f1f4(0xea)+_0x230f2c));}}}
@@ -1 +1 @@
1
- const a16_0x2f8cb2=a16_0x2333;function a16_0x2333(_0x558303,_0x434f9d){_0x558303=_0x558303-0x7b;const _0x37412d=a16_0x3741();let _0x233390=_0x37412d[_0x558303];return _0x233390;}(function(_0x59c282,_0x45db85){const _0x2cf8c6=a16_0x2333,_0x11bab5=_0x59c282();while(!![]){try{const _0x45d78e=-parseInt(_0x2cf8c6(0x85))/0x1+-parseInt(_0x2cf8c6(0x99))/0x2*(-parseInt(_0x2cf8c6(0x93))/0x3)+parseInt(_0x2cf8c6(0x9a))/0x4+-parseInt(_0x2cf8c6(0x86))/0x5*(-parseInt(_0x2cf8c6(0x7c))/0x6)+-parseInt(_0x2cf8c6(0x8d))/0x7*(-parseInt(_0x2cf8c6(0x8f))/0x8)+-parseInt(_0x2cf8c6(0x8c))/0x9+-parseInt(_0x2cf8c6(0x82))/0xa;if(_0x45d78e===_0x45db85)break;else _0x11bab5['push'](_0x11bab5['shift']());}catch(_0x2df3c2){_0x11bab5['push'](_0x11bab5['shift']());}}}(a16_0x3741,0x1fa28));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a16_0x3741(){const _0x39b637=['database_name','📦\x20','listDatabases','log','584670FyGyxK','name','verbose','237772pNVFLw','5cHkhlz','limit','message','Error:\x20','\x20\x20Cause:\x20','length','1669815rUAtFm','1290408KaUEHY','data','8WpHhZX','✔\x20Found\x20','cause','site','81zlJcBN','databases','query','Site:\x20','error','execute','16094HKwYVL','101268YBTEHD','List\x20all\x20databases','1106520sPjgGR','description'];a16_0x3741=function(){return _0x39b637;};return a16_0x3741();}import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a16_0x2f8cb2(0x83)]=a16_0x2f8cb2(0x94);[a16_0x2f8cb2(0x7d)]=a16_0x2f8cb2(0x7b);async[a16_0x2f8cb2(0x98)](_0x1c52f7){const _0xb05c77=a16_0x2f8cb2,{options:_0x5c446e,args:_0x26a96b,tdx:_0x2c1dda}=_0x1c52f7,_0x2edfd5=_0x26a96b[0x0];try{_0x5c446e[_0xb05c77(0x84)]&&(console['error'](_0xb05c77(0x96)+_0x5c446e[_0xb05c77(0x92)]),_0x2edfd5&&console[_0xb05c77(0x97)]('Pattern:\x20'+_0x2edfd5));const _0x57a36e=resolveLimit(_0x5c446e[_0xb05c77(0x87)],DEFAULT_LISTING_LIMIT),_0x4def5d=await withSpinner('Listing\x20databases...',()=>_0x2c1dda[_0xb05c77(0x95)][_0xb05c77(0x80)](_0x2edfd5,_0x57a36e),{'verbose':_0x5c446e[_0xb05c77(0x84)]}),_0x163906=_0x4def5d[_0xb05c77(0x8e)];console[_0xb05c77(0x97)](_0xb05c77(0x90)+_0x163906[_0xb05c77(0x8b)]+'\x20database'+(_0x163906[_0xb05c77(0x8b)]!==0x1?'s':''));if(isStructuredFormat(_0x5c446e))await handleSDKOutput(_0x163906,{..._0x5c446e,'limit':_0x57a36e});else for(const _0x54aaba of _0x163906){console[_0xb05c77(0x81)](_0xb05c77(0x7f)+_0x54aaba[_0xb05c77(0x7e)]);}return 0x0;}catch(_0x1fb54c){if(_0x1fb54c instanceof SDKError)return console[_0xb05c77(0x97)](_0xb05c77(0x89)+_0x1fb54c[_0xb05c77(0x88)]),_0x1fb54c[_0xb05c77(0x91)]&&console['error'](_0xb05c77(0x8a)+_0x1fb54c['cause']),0x1;throw _0x1fb54c;}}}
1
+ const a16_0x4eb5c7=a16_0x3597;(function(_0xeef993,_0x25d3be){const _0x2b9508=a16_0x3597,_0x5f37cf=_0xeef993();while(!![]){try{const _0x7e87de=parseInt(_0x2b9508(0x1d8))/0x1+-parseInt(_0x2b9508(0x1dd))/0x2*(-parseInt(_0x2b9508(0x1f0))/0x3)+-parseInt(_0x2b9508(0x1df))/0x4+-parseInt(_0x2b9508(0x1ec))/0x5+parseInt(_0x2b9508(0x1db))/0x6+-parseInt(_0x2b9508(0x1eb))/0x7+-parseInt(_0x2b9508(0x1ef))/0x8*(-parseInt(_0x2b9508(0x1e7))/0x9);if(_0x7e87de===_0x25d3be)break;else _0x5f37cf['push'](_0x5f37cf['shift']());}catch(_0x36cd5d){_0x5f37cf['push'](_0x5f37cf['shift']());}}}(a16_0x21f9,0x44483));import{BaseCommand}from'./command.js';function a16_0x3597(_0x5777a9,_0x39e88d){_0x5777a9=_0x5777a9-0x1d7;const _0x21f984=a16_0x21f9();let _0x359747=_0x21f984[_0x5777a9];return _0x359747;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a16_0x21f9(){const _0x3adfea=['query','3057570IjeiVX','log','14NuLZQz','\x20database','1604164TVyViK','✔\x20Found\x20','cause','verbose','message','Error:\x20','name','data','192186HLDWxR','error','listDatabases','length','3300087yJYSQh','1882550AIUnGc','List\x20all\x20databases','execute','152gyNVsf','179007vZvmXA','limit','195671UBUugP','\x20\x20Cause:\x20'];a16_0x21f9=function(){return _0x3adfea;};return a16_0x21f9();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a16_0x4eb5c7(0x1e5)]='databases';['description']=a16_0x4eb5c7(0x1ed);async[a16_0x4eb5c7(0x1ee)](_0x1d7d84){const _0x13efde=a16_0x4eb5c7,{options:_0x5e4b58,args:_0xa27c1a,tdx:_0x5708bd}=_0x1d7d84,_0x156b42=_0xa27c1a[0x0];try{_0x5e4b58[_0x13efde(0x1e2)]&&(console[_0x13efde(0x1e8)]('Site:\x20'+_0x5e4b58['site']),_0x156b42&&console[_0x13efde(0x1e8)]('Pattern:\x20'+_0x156b42));const _0x4645a8=resolveLimit(_0x5e4b58[_0x13efde(0x1d7)],DEFAULT_LISTING_LIMIT),_0x3e7f0e=await withSpinner('Listing\x20databases...',()=>_0x5708bd[_0x13efde(0x1da)][_0x13efde(0x1e9)](_0x156b42,_0x4645a8),{'verbose':_0x5e4b58[_0x13efde(0x1e2)]}),_0x728c7d=_0x3e7f0e[_0x13efde(0x1e6)];console['error'](_0x13efde(0x1e0)+_0x728c7d[_0x13efde(0x1ea)]+_0x13efde(0x1de)+(_0x728c7d[_0x13efde(0x1ea)]!==0x1?'s':''));if(isStructuredFormat(_0x5e4b58))await handleSDKOutput(_0x728c7d,{..._0x5e4b58,'limit':_0x4645a8});else for(const _0x1772aa of _0x728c7d){console[_0x13efde(0x1dc)]('📦\x20'+_0x1772aa['database_name']);}return 0x0;}catch(_0x28f751){if(_0x28f751 instanceof SDKError)return console[_0x13efde(0x1e8)](_0x13efde(0x1e4)+_0x28f751[_0x13efde(0x1e3)]),_0x28f751[_0x13efde(0x1e1)]&&console['error'](_0x13efde(0x1d9)+_0x28f751[_0x13efde(0x1e1)]),0x1;throw _0x28f751;}}}