@treasuredata/tdx 2026.4.2 → 2026.4.3

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 (219) 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/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a8_0x472286=a8_0x4875;(function(_0x2be727,_0x2dbfe5){const _0x56f922=a8_0x4875,_0x2ccb97=_0x2be727();while(!![]){try{const _0x26d0d6=-parseInt(_0x56f922(0x1b4))/0x1+parseInt(_0x56f922(0x1f5))/0x2+-parseInt(_0x56f922(0x1ff))/0x3*(parseInt(_0x56f922(0x1d8))/0x4)+-parseInt(_0x56f922(0x1c0))/0x5+parseInt(_0x56f922(0x1ba))/0x6+-parseInt(_0x56f922(0x1f2))/0x7+parseInt(_0x56f922(0x1aa))/0x8;if(_0x26d0d6===_0x2dbfe5)break;else _0x2ccb97['push'](_0x2ccb97['shift']());}catch(_0x48d448){_0x2ccb97['push'](_0x2ccb97['shift']());}}}(a8_0x2bf9,0x82732));function a8_0x4875(_0x161897,_0x3c42c8){_0x161897=_0x161897-0x1a1;const _0x2bf9c4=a8_0x2bf9();let _0x4875b6=_0x2bf9c4[_0x161897];return _0x4875b6;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x264d0d from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x5544b6 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_0x472286(0x1e0)]='cas:list';[a8_0x472286(0x1d6)]='List\x20composable\x20audiences';async[a8_0x472286(0x1ab)](_0x1261f3){const _0x315204=a8_0x472286,{options:_0x4d9ab6,tdx:_0x232a33}=_0x1261f3,_0x20ee0c=await withProgressSpinner('Fetching\x20composable\x20audiences...',()=>_0x232a33[_0x315204(0x1cb)]['list'](),{'verbose':_0x4d9ab6['verbose']}),_0x1309df=_0x20ee0c[_0x315204(0x205)];if(isStructuredFormat(_0x4d9ab6))return await handleSDKOutput(_0x1309df,_0x4d9ab6),0x0;if(_0x1309df[_0x315204(0x1da)]===0x0)return console[_0x315204(0x1e5)](a8_0x264d0d[_0x315204(0x203)](_0x315204(0x1c6))),0x0;console[_0x315204(0x1e5)](a8_0x264d0d[_0x315204(0x1cf)]('Found\x20'+_0x1309df[_0x315204(0x1da)]+_0x315204(0x1d5)));for(const _0x5003f5 of _0x1309df){const _0x49474e=_0x5003f5[_0x315204(0x1e6)]?a8_0x264d0d[_0x315204(0x203)]('\x20('+Number(_0x5003f5[_0x315204(0x1e6)])[_0x315204(0x1ae)]()+')'):'',_0x2379f2=a8_0x264d0d[_0x315204(0x203)]('\x20'+_0x5003f5[_0x315204(0x1f7)]+'.'+_0x5003f5[_0x315204(0x1a3)]);console['log'](_0x315204(0x1fc)+_0x5003f5[_0x315204(0x1e0)]+_0x49474e+_0x2379f2),_0x5003f5[_0x315204(0x1d6)]&&console[_0x315204(0x1e5)]('\x20\x20'+a8_0x264d0d[_0x315204(0x203)](_0x5003f5[_0x315204(0x1d6)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0x472286(0x1e0)]=a8_0x472286(0x1a5);['description']=a8_0x472286(0x1eb);async['execute'](_0x5ceed4){const _0x1a1c8e=a8_0x472286,{options:_0x201e7d,args:_0x4ad892,tdx:_0x11eefa}=_0x5ceed4,_0x13f647=_0x4ad892[0x0]||_0x201e7d[_0x1a1c8e(0x1c8)];if(!_0x13f647)return console[_0x1a1c8e(0x20b)](a8_0x264d0d['yellow'](_0x1a1c8e(0x1b1))),console[_0x1a1c8e(0x20b)](_0x1a1c8e(0x20a)+a8_0x264d0d[_0x1a1c8e(0x1c4)](_0x1a1c8e(0x1a9))+'\x20or\x20set\x20context\x20with\x20'+a8_0x264d0d[_0x1a1c8e(0x1c4)](_0x1a1c8e(0x1f0))),0x1;const _0x51998d=await withProgressSpinner('Fetching\x20audience\x20\x27'+_0x13f647+_0x1a1c8e(0x1af),()=>_0x11eefa[_0x1a1c8e(0x1cb)][_0x1a1c8e(0x1bc)](_0x13f647),{'verbose':_0x201e7d[_0x1a1c8e(0x216)]}),_0x41c8f3=_0x51998d[_0x1a1c8e(0x205)];if(isStructuredFormat(_0x201e7d))return await handleSingleObjectOutput(_0x41c8f3,_0x201e7d),0x0;console['log'](a8_0x264d0d[_0x1a1c8e(0x1b2)](_0x41c8f3[_0x1a1c8e(0x1e0)]));if(_0x41c8f3[_0x1a1c8e(0x1d6)])console[_0x1a1c8e(0x1e5)](a8_0x264d0d[_0x1a1c8e(0x203)](_0x41c8f3[_0x1a1c8e(0x1d6)]));console['log'](),console['log'](a8_0x264d0d['underline']('Master\x20Table')),console[_0x1a1c8e(0x1e5)](_0x1a1c8e(0x1c7)+_0x41c8f3['masterSchema']),console[_0x1a1c8e(0x1e5)](_0x1a1c8e(0x1e7)+_0x41c8f3[_0x1a1c8e(0x1a3)]),console[_0x1a1c8e(0x1e5)](_0x1a1c8e(0x209)+_0x41c8f3[_0x1a1c8e(0x1b7)]),console[_0x1a1c8e(0x1e5)]();if(_0x41c8f3['attributes']?.['length']){console[_0x1a1c8e(0x1e5)](a8_0x264d0d[_0x1a1c8e(0x1bb)](_0x1a1c8e(0x208)+_0x41c8f3[_0x1a1c8e(0x1e2)][_0x1a1c8e(0x1da)]+')'));for(const _0x2ce1fc of _0x41c8f3[_0x1a1c8e(0x1e2)]){console[_0x1a1c8e(0x1e5)]('\x20\x20'+a8_0x264d0d[_0x1a1c8e(0x1b2)](_0x2ce1fc['name'])+_0x1a1c8e(0x20e)+_0x2ce1fc['schema']+'.'+_0x2ce1fc[_0x1a1c8e(0x1f6)]+'.'+_0x2ce1fc[_0x1a1c8e(0x1e8)]+'\x20('+a8_0x264d0d[_0x1a1c8e(0x203)](_0x2ce1fc[_0x1a1c8e(0x1c1)])+')');}console[_0x1a1c8e(0x1e5)]();}if(_0x41c8f3['behaviors']?.[_0x1a1c8e(0x1da)]){console[_0x1a1c8e(0x1e5)](a8_0x264d0d[_0x1a1c8e(0x1bb)](_0x1a1c8e(0x1ad)+_0x41c8f3[_0x1a1c8e(0x1e4)][_0x1a1c8e(0x1da)]+')'));for(const _0x1e2dc3 of _0x41c8f3[_0x1a1c8e(0x1e4)]){const _0x1110a1=_0x1e2dc3[_0x1a1c8e(0x1fa)]?_0x1a1c8e(0x1e9)+_0x1e2dc3[_0x1a1c8e(0x1fa)]+')':'';console[_0x1a1c8e(0x1e5)]('\x20\x20'+a8_0x264d0d['bold'](_0x1e2dc3[_0x1a1c8e(0x1e0)])+'\x20—\x20'+_0x1e2dc3[_0x1a1c8e(0x1e3)]+'.'+_0x1e2dc3[_0x1a1c8e(0x1f6)]+_0x1110a1);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x472286(0x1e0)]=a8_0x472286(0x1c5);[a8_0x472286(0x1d6)]=a8_0x472286(0x1b0);async[a8_0x472286(0x1ab)](_0x394d86){const _0x5ce811=a8_0x472286,{options:_0x45aa79,args:_0x28940c,tdx:_0x1230fa}=_0x394d86,_0x4c86a4=_0x45aa79,_0x3ef5d3=_0x28940c[0x0]||_0x45aa79['composableAudience'];if(!_0x3ef5d3)return console[_0x5ce811(0x20b)](a8_0x264d0d['yellow'](_0x5ce811(0x1b1))),console[_0x5ce811(0x20b)](_0x5ce811(0x20a)+a8_0x264d0d[_0x5ce811(0x1c4)](_0x5ce811(0x1dc))+_0x5ce811(0x1d0)+a8_0x264d0d['cyan'](_0x5ce811(0x1f0))),0x1;const _0x51478a=_0x4c86a4[_0x5ce811(0x1b3)]||a8_0x5544b6[_0x5ce811(0x1bf)](process[_0x5ce811(0x1ec)](),_0x5ce811(0x1cb),sanitizeFileName(_0x3ef5d3)),_0x33c828=await withProgressSpinner(_0x5ce811(0x1dd)+_0x3ef5d3+'\x27...',_0x5d2cf0=>_0x1230fa[_0x5ce811(0x1cb)][_0x5ce811(0x1d7)](_0x3ef5d3,{'targetDir':_0x51478a,'verbose':_0x4c86a4[_0x5ce811(0x216)],'progress':{'update':_0x2ad83c=>_0x5d2cf0[_0x5ce811(0x211)](_0x2ad83c)}}),{'verbose':_0x4c86a4['verbose']}),_0x4be326=_0x33c828['data'],_0x31852d=_0x4be326[_0x5ce811(0x214)][_0x5ce811(0x1bd)](_0x427aa0=>_0x427aa0[_0x5ce811(0x1a2)]||_0x427aa0[_0x5ce811(0x212)]);saveSessionContext({'composable_audience':_0x4be326[_0x5ce811(0x1ce)]},_0x4c86a4['session']),console['log'](a8_0x264d0d[_0x5ce811(0x1cf)]('Context\x20set:\x20'+a8_0x264d0d['dim']('composable_audience')+_0x5ce811(0x1a6)+a8_0x264d0d[_0x5ce811(0x1c4)](_0x4be326[_0x5ce811(0x1ce)])));if(_0x31852d['length']===0x0)return console[_0x5ce811(0x1e5)](a8_0x264d0d[_0x5ce811(0x1cf)](_0x5ce811(0x1fd))),0x0;for(const _0x1bfd4a of _0x31852d){if(_0x1bfd4a[_0x5ce811(0x1a2)])console[_0x5ce811(0x1e5)](a8_0x264d0d[_0x5ce811(0x1cf)]('+\x20'+_0x1bfd4a[_0x5ce811(0x1d4)]+_0x5ce811(0x1c2)));else _0x1bfd4a[_0x5ce811(0x213)]&&(console['log'](a8_0x264d0d['yellow']('~\x20'+_0x1bfd4a[_0x5ce811(0x1d4)])),console[_0x5ce811(0x1e5)](_0x1bfd4a[_0x5ce811(0x213)]));}console['log']('\x0a'+_0x31852d[_0x5ce811(0x1da)]+_0x5ce811(0x1ee)+('('+_0x4be326['counts']['segments']+_0x5ce811(0x1ea)+_0x4be326[_0x5ce811(0x1d2)][_0x5ce811(0x1b8)]+_0x5ce811(0x1de)));if(_0x4c86a4[_0x5ce811(0x210)])return console[_0x5ce811(0x1e5)](a8_0x264d0d[_0x5ce811(0x203)](_0x5ce811(0x1a1))),0x0;if(!_0x4c86a4[_0x5ce811(0x1a7)]&&isInteractive()){const _0x201d5c=await confirmKey(_0x5ce811(0x1f8));if(!_0x201d5c)return console['log'](a8_0x264d0d[_0x5ce811(0x203)](_0x5ce811(0x1f3))),0x0;}for(const _0x5288fd of _0x31852d){const _0x3e6db3=a8_0x5544b6[_0x5ce811(0x202)](_0x5288fd[_0x5ce811(0x1db)]);if(!existsSync(_0x3e6db3))mkdirSync(_0x3e6db3,{'recursive':!![]});writeFileSync(_0x5288fd['absolutePath'],_0x5288fd['content'],'utf-8');}return console[_0x5ce811(0x1e5)](a8_0x264d0d[_0x5ce811(0x1cf)](_0x5ce811(0x200)+_0x31852d[_0x5ce811(0x1da)]+_0x5ce811(0x1fb)+_0x51478a)),0x0;}}export class CASPushCommand extends BaseCommand{[a8_0x472286(0x1e0)]='cas:push';[a8_0x472286(0x1d6)]=a8_0x472286(0x1a4);async[a8_0x472286(0x1ab)](_0x4146a7){const _0x2f39fd=a8_0x472286,{options:_0x5a12b1,args:_0xd47103,tdx:_0x57c20f}=_0x4146a7,_0xedde56=_0x5a12b1;let _0x35e402=_0xd47103[0x0];!_0x35e402&&_0x5a12b1[_0x2f39fd(0x1c8)]&&(_0x35e402=a8_0x5544b6[_0x2f39fd(0x1bf)](process['cwd'](),'cas',sanitizeFileName(_0x5a12b1[_0x2f39fd(0x1c8)])));if(!_0x35e402)return console['error'](a8_0x264d0d[_0x2f39fd(0x1b6)](_0x2f39fd(0x1b1))),console[_0x2f39fd(0x20b)](_0x2f39fd(0x20a)+a8_0x264d0d[_0x2f39fd(0x1c4)](_0x2f39fd(0x1df))+_0x2f39fd(0x1d0)+a8_0x264d0d['cyan'](_0x2f39fd(0x1f0))),0x1;if(!existsSync(_0x35e402))return console['error'](a8_0x264d0d[_0x2f39fd(0x1c3)](_0x2f39fd(0x1f9)+_0x35e402)),console[_0x2f39fd(0x20b)](a8_0x264d0d[_0x2f39fd(0x203)]('Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x2f8617=_0x5a12b1['composableAudience']||a8_0x5544b6[_0x2f39fd(0x1d1)](_0x35e402),_0x12f482=a8_0x5544b6[_0x2f39fd(0x20d)](process[_0x2f39fd(0x1ec)](),_0x35e402)||'.';console['log']('Audience:\x20'+a8_0x264d0d[_0x2f39fd(0x1c4)](_0x2f8617)),console[_0x2f39fd(0x1e5)](_0x2f39fd(0x206)+a8_0x264d0d[_0x2f39fd(0x203)](_0x12f482)),console[_0x2f39fd(0x1e5)](a8_0x264d0d['yellow'](_0x2f39fd(0x1ed))),console[_0x2f39fd(0x1e5)]();const _0x3c6c7c=collectYamlFiles(_0x35e402);if(_0x3c6c7c[_0x2f39fd(0x1da)]===0x0)return console[_0x2f39fd(0x20b)](a8_0x264d0d[_0x2f39fd(0x1c3)]('No\x20YAML\x20files\x20found\x20in:\x20'+_0x35e402)),0x1;console[_0x2f39fd(0x1e5)](_0x2f39fd(0x1f4)+_0x3c6c7c[_0x2f39fd(0x1da)]+'\x20YAML\x20file(s)');const _0x47e1e9=await withProgressSpinner(_0x2f39fd(0x1f1),_0x159cff=>_0x57c20f[_0x2f39fd(0x1cb)][_0x2f39fd(0x215)](_0x3c6c7c,{'dryRun':!![],'verbose':_0xedde56[_0x2f39fd(0x216)],'progress':{'update':_0x494cbc=>_0x159cff[_0x2f39fd(0x211)](_0x494cbc)}}),{'verbose':_0xedde56[_0x2f39fd(0x216)]}),_0x770f24=_0x47e1e9[_0x2f39fd(0x205)],{created:_0x1d3c5a}=_0x770f24,_0x2f1161=[];if(_0x1d3c5a['audiences'])_0x2f1161[_0x2f39fd(0x215)](_0x1d3c5a[_0x2f39fd(0x1ef)]+_0x2f39fd(0x1b9));if(_0x1d3c5a[_0x2f39fd(0x1fe)])_0x2f1161[_0x2f39fd(0x215)](_0x1d3c5a[_0x2f39fd(0x1fe)]+_0x2f39fd(0x1b5));if(_0x1d3c5a[_0x2f39fd(0x1b8)])_0x2f1161[_0x2f39fd(0x215)](_0x1d3c5a[_0x2f39fd(0x1b8)]+_0x2f39fd(0x204));return _0x2f1161[_0x2f39fd(0x1da)]===0x0?console[_0x2f39fd(0x1e5)](a8_0x264d0d[_0x2f39fd(0x203)](_0x2f39fd(0x1ca))):console[_0x2f39fd(0x1e5)](_0x2f39fd(0x1c9)+_0x2f1161[_0x2f39fd(0x1bf)](',\x20')),console['log'](a8_0x264d0d[_0x2f39fd(0x203)]('(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)')),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x472286(0x1e0)]=a8_0x472286(0x1a8);[a8_0x472286(0x1d6)]=a8_0x472286(0x207);async[a8_0x472286(0x1ab)](_0x5368b6){const _0x32152e=a8_0x472286,{options:_0x1ba1d3,args:_0x252e60,tdx:_0x107b02}=_0x5368b6,_0x4aa8b8=_0x252e60[0x0],_0x3f015b=_0x252e60[0x1]||_0x1ba1d3[_0x32152e(0x1c8)];if(!_0x4aa8b8)return console[_0x32152e(0x20b)](a8_0x264d0d[_0x32152e(0x1c3)]('Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]')),0x1;if(!_0x3f015b)return console['error'](a8_0x264d0d[_0x32152e(0x1b6)](_0x32152e(0x1d9))),console['error'](_0x32152e(0x20a)+a8_0x264d0d['cyan']('--audience\x20<name>')+_0x32152e(0x1d0)+a8_0x264d0d[_0x32152e(0x1c4)](_0x32152e(0x1f0))),0x1;const _0x41c4b5=await withProgressSpinner(_0x32152e(0x201)+_0x4aa8b8+_0x32152e(0x1af),()=>_0x107b02['cas'][_0x32152e(0x20c)](_0x3f015b,_0x4aa8b8),{'verbose':_0x1ba1d3[_0x32152e(0x216)]}),{query:_0x38e78b,customers:_0x4423ed}=_0x41c4b5[_0x32152e(0x205)];if(isStructuredFormat(_0x1ba1d3))return await handleSingleObjectOutput({'query':_0x38e78b,'customers':_0x4423ed},_0x1ba1d3),0x0;const _0x3bd9e7=_0x38e78b[_0x32152e(0x1e1)]===_0x32152e(0x1cc)?a8_0x264d0d[_0x32152e(0x1cf)]:a8_0x264d0d[_0x32152e(0x1b6)];console[_0x32152e(0x1e5)]('Status:\x20'+_0x3bd9e7(_0x38e78b[_0x32152e(0x1e1)])),console[_0x32152e(0x1e5)](_0x32152e(0x1be)+a8_0x264d0d[_0x32152e(0x1b2)](String(_0x38e78b[_0x32152e(0x1ac)])));_0x38e78b['error']&&console[_0x32152e(0x1e5)]('Error:\x20\x20'+a8_0x264d0d[_0x32152e(0x1c3)](_0x38e78b[_0x32152e(0x20b)]));if(_0x4423ed?.[_0x32152e(0x1d3)]&&_0x4423ed?.[_0x32152e(0x1cd)]){console[_0x32152e(0x1e5)](a8_0x264d0d[_0x32152e(0x1bb)](_0x32152e(0x20f)+_0x4423ed[_0x32152e(0x1cd)][_0x32152e(0x1da)]+')'));const _0x4119f6=_0x4423ed['rows']['map'](_0x1413d0=>{const _0x1356c4=_0x32152e,_0x7e377d={};for(let _0x265925=0x0;_0x265925<_0x4423ed[_0x1356c4(0x1d3)][_0x1356c4(0x1da)];_0x265925++){_0x7e377d[_0x4423ed[_0x1356c4(0x1d3)][_0x265925]]=_0x1413d0[_0x265925];}return _0x7e377d;});await handleSDKOutput(_0x4119f6,_0x1ba1d3);}return 0x0;}}function a8_0x2bf9(){const _0x4578fd=['absolutePath','tdx\x20cas\x20pull\x20<name>','Pulling\x20composable\x20audience\x20\x27','\x20activations)','tdx\x20cas\x20push\x20<path>','name','status','attributes','schema','behaviors','log','population','\x20\x20Table:\x20\x20','column','\x20(time:\x20','\x20segments,\x20','Describe\x20a\x20composable\x20audience','cwd','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','\x20file(s)\x20to\x20write\x20','audiences','tdx\x20use\x20cas\x20<name>','Analyzing\x20CAS\x20YAML\x20files...','5939234iINQEk','Cancelled.','Found\x20','197968NjIbXY','table','masterSchema','Write\x20files?','Directory\x20not\x20found:\x20','timeColumn','\x20file(s)\x20to\x20','🧊\x20','All\x20files\x20are\x20up\x20to\x20date.','segments','427830DvNrxr','Wrote\x20','Running\x20preview\x20for\x20\x27','dirname','dim','\x20activation(s)','data','Source:\x20\x20\x20','Preview\x20composable\x20segment\x20query\x20on\x20CDW','Attributes\x20(','\x20\x20Key:\x20\x20\x20\x20','Use\x20','error','preview','relative','\x20—\x20','\x0aSample\x20Rows\x20(','dryRun','setPhase','hasChanges','diff','files','push','verbose','(dry\x20run\x20—\x20no\x20files\x20written)','isNew','masterTable','Push\x20YAML\x20files\x20to\x20CAS\x20API','cas:desc','\x20=\x20','yes','cas:preview','tdx\x20cas\x20desc\x20<name>','16748344aaYdxP','execute','count','Behaviors\x20(','toLocaleString','\x27...','Pull\x20composable\x20audience\x20to\x20YAML\x20files','No\x20composable\x20audience\x20specified.','bold','dir','439964BLPfHN','\x20segment(s)','yellow','masterKeyColumn','activations','\x20audience(s)','4824468uJEGpw','underline','get','filter','Count:\x20\x20','join','1590985bfUNZv','type','\x20(new)','red','cyan','cas:pull','No\x20composable\x20audiences\x20found.','\x20\x20Schema:\x20','composableAudience','Would\x20push:\x20','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','cas','success','rows','audienceName','green','\x20or\x20set\x20context\x20with\x20','basename','counts','names','relativePath','\x20composable\x20audiences','description','pull','24pUBQyF','Audience\x20name\x20required.','length'];a8_0x2bf9=function(){return _0x4578fd;};return a8_0x2bf9();}
1
+ const a8_0x2fb3cc=a8_0x15c2;(function(_0x13196c,_0x20d589){const _0x500eaa=a8_0x15c2,_0x24ebde=_0x13196c();while(!![]){try{const _0x12333a=-parseInt(_0x500eaa(0x186))/0x1*(-parseInt(_0x500eaa(0x17f))/0x2)+-parseInt(_0x500eaa(0x199))/0x3*(-parseInt(_0x500eaa(0x1d5))/0x4)+-parseInt(_0x500eaa(0x1d2))/0x5*(parseInt(_0x500eaa(0x181))/0x6)+parseInt(_0x500eaa(0x1d9))/0x7*(parseInt(_0x500eaa(0x1ad))/0x8)+parseInt(_0x500eaa(0x19b))/0x9+parseInt(_0x500eaa(0x198))/0xa+-parseInt(_0x500eaa(0x1b6))/0xb;if(_0x12333a===_0x20d589)break;else _0x24ebde['push'](_0x24ebde['shift']());}catch(_0x386828){_0x24ebde['push'](_0x24ebde['shift']());}}}(a8_0x3102,0xd97be));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0xfb1312 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a8_0x3102(){const _0x49b833=['Master\x20Table','Fetching\x20audience\x20\x27','description','basename','No\x20composable\x20audience\x20specified.','filter','names','\x20file(s)\x20to\x20','dirname','\x20segments,\x20','8lTeKsM','push','All\x20files\x20are\x20up\x20to\x20date.','name','\x20—\x20','table','cas:pull','🧊\x20','execute','66900548quHDcY','List\x20composable\x20audiences','files','success','masterTable','audienceName','relativePath','\x20file(s)\x20to\x20write\x20','dryRun','No\x20YAML\x20files\x20found\x20in:\x20','underline','map','counts','Wrote\x20','status','\x20\x20Table:\x20\x20','absolutePath','isNew','population','dim','log','Cancelled.','cas','diff','list','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','\x20=\x20','verbose','910585kofEEL','Behaviors\x20(','attributes','488oxACCB','pull','content','Error:\x20\x20','9324119pDVtOS','yes','\x27...','type','cas:push','toLocaleString','tdx\x20cas\x20push\x20<path>','behaviors','bold','\x0aSample\x20Rows\x20(','dir','audiences','masterSchema','Pulling\x20composable\x20audience\x20\x27','Attributes\x20(','Count:\x20\x20','relative','Context\x20set:\x20','Fetching\x20composable\x20audiences...','cwd','cas:desc','Pull\x20composable\x20audience\x20to\x20YAML\x20files','timeColumn','Would\x20push:\x20','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','Use\x20','--audience\x20<name>','Status:\x20','segments','cyan','yellow','Write\x20files?','Directory\x20not\x20found:\x20','1638586QlgvmZ','length','6HJNBKo','Push\x20YAML\x20files\x20to\x20CAS\x20API','green','composableAudience','No\x20composable\x20audiences\x20found.','2qEnvNV','\x20or\x20set\x20context\x20with\x20','column','\x20(time:\x20','join','composable_audience','schema','cas:preview','get','Audience:\x20','(dry\x20run\x20—\x20no\x20files\x20written)','red','rows','\x20audience(s)','data','activations','\x20\x20Key:\x20\x20\x20\x20','Found\x20','16412660lxtrFS','22107wPOyeD','cas:list','14795208HBdfpl','count','error','tdx\x20cas\x20pull\x20<name>','tdx\x20use\x20cas\x20<name>','Audience\x20name\x20required.','setPhase','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure'];a8_0x3102=function(){return _0x49b833;};return a8_0x3102();}import a8_0x3567e1 from'path';function a8_0x15c2(_0x4bb5de,_0x334800){_0x4bb5de=_0x4bb5de-0x162;const _0x3102f2=a8_0x3102();let _0x15c2b0=_0x3102f2[_0x4bb5de];return _0x15c2b0;}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_0x2fb3cc(0x1b0)]=a8_0x2fb3cc(0x19a);['description']=a8_0x2fb3cc(0x1b7);async[a8_0x2fb3cc(0x1b5)](_0xcf0298){const _0x5d65bd=a8_0x2fb3cc,{options:_0x49ff0a,tdx:_0x3b4190}=_0xcf0298,_0x1d8187=await withProgressSpinner(_0x5d65bd(0x170),()=>_0x3b4190[_0x5d65bd(0x1cc)][_0x5d65bd(0x1ce)](),{'verbose':_0x49ff0a[_0x5d65bd(0x1d1)]}),_0x59ba71=_0x1d8187[_0x5d65bd(0x194)];if(isStructuredFormat(_0x49ff0a))return await handleSDKOutput(_0x59ba71,_0x49ff0a),0x0;if(_0x59ba71[_0x5d65bd(0x180)]===0x0)return console[_0x5d65bd(0x1ca)](a8_0xfb1312[_0x5d65bd(0x1c9)](_0x5d65bd(0x185))),0x0;console['log'](a8_0xfb1312[_0x5d65bd(0x183)](_0x5d65bd(0x197)+_0x59ba71['length']+'\x20composable\x20audiences'));for(const _0x45210d of _0x59ba71){const _0x39f715=_0x45210d[_0x5d65bd(0x1c8)]?a8_0xfb1312[_0x5d65bd(0x1c9)]('\x20('+Number(_0x45210d['population'])[_0x5d65bd(0x163)]()+')'):'',_0x33260f=a8_0xfb1312[_0x5d65bd(0x1c9)]('\x20'+_0x45210d['masterSchema']+'.'+_0x45210d[_0x5d65bd(0x1ba)]);console[_0x5d65bd(0x1ca)](_0x5d65bd(0x1b4)+_0x45210d[_0x5d65bd(0x1b0)]+_0x39f715+_0x33260f),_0x45210d['description']&&console[_0x5d65bd(0x1ca)]('\x20\x20'+a8_0xfb1312[_0x5d65bd(0x1c9)](_0x45210d['description']));}return 0x0;}}export class CASDescCommand extends BaseCommand{['name']=a8_0x2fb3cc(0x172);[a8_0x2fb3cc(0x1a5)]='Describe\x20a\x20composable\x20audience';async[a8_0x2fb3cc(0x1b5)](_0x3db07b){const _0x4c8ee2=a8_0x2fb3cc,{options:_0x40082e,args:_0x20615d,tdx:_0x559114}=_0x3db07b,_0x5dc36e=_0x20615d[0x0]||_0x40082e[_0x4c8ee2(0x184)];if(!_0x5dc36e)return console[_0x4c8ee2(0x19d)](a8_0xfb1312[_0x4c8ee2(0x17c)](_0x4c8ee2(0x1a7))),console[_0x4c8ee2(0x19d)](_0x4c8ee2(0x177)+a8_0xfb1312[_0x4c8ee2(0x17b)]('tdx\x20cas\x20desc\x20<name>')+'\x20or\x20set\x20context\x20with\x20'+a8_0xfb1312[_0x4c8ee2(0x17b)](_0x4c8ee2(0x19f))),0x1;const _0x14225d=await withProgressSpinner(_0x4c8ee2(0x1a4)+_0x5dc36e+_0x4c8ee2(0x1db),()=>_0x559114[_0x4c8ee2(0x1cc)][_0x4c8ee2(0x18e)](_0x5dc36e),{'verbose':_0x40082e[_0x4c8ee2(0x1d1)]}),_0x4f233d=_0x14225d[_0x4c8ee2(0x194)];if(isStructuredFormat(_0x40082e))return await handleSingleObjectOutput(_0x4f233d,_0x40082e),0x0;console[_0x4c8ee2(0x1ca)](a8_0xfb1312[_0x4c8ee2(0x166)](_0x4f233d[_0x4c8ee2(0x1b0)]));if(_0x4f233d['description'])console[_0x4c8ee2(0x1ca)](a8_0xfb1312['dim'](_0x4f233d[_0x4c8ee2(0x1a5)]));console[_0x4c8ee2(0x1ca)](),console[_0x4c8ee2(0x1ca)](a8_0xfb1312[_0x4c8ee2(0x1c0)](_0x4c8ee2(0x1a3))),console[_0x4c8ee2(0x1ca)]('\x20\x20Schema:\x20'+_0x4f233d[_0x4c8ee2(0x16a)]),console[_0x4c8ee2(0x1ca)](_0x4c8ee2(0x1c5)+_0x4f233d[_0x4c8ee2(0x1ba)]),console[_0x4c8ee2(0x1ca)](_0x4c8ee2(0x196)+_0x4f233d['masterKeyColumn']),console[_0x4c8ee2(0x1ca)]();if(_0x4f233d[_0x4c8ee2(0x1d4)]?.[_0x4c8ee2(0x180)]){console[_0x4c8ee2(0x1ca)](a8_0xfb1312['underline'](_0x4c8ee2(0x16c)+_0x4f233d['attributes'][_0x4c8ee2(0x180)]+')'));for(const _0x2c67d1 of _0x4f233d[_0x4c8ee2(0x1d4)]){console['log']('\x20\x20'+a8_0xfb1312['bold'](_0x2c67d1['name'])+_0x4c8ee2(0x1b1)+_0x2c67d1[_0x4c8ee2(0x18c)]+'.'+_0x2c67d1[_0x4c8ee2(0x1b2)]+'.'+_0x2c67d1[_0x4c8ee2(0x188)]+'\x20('+a8_0xfb1312[_0x4c8ee2(0x1c9)](_0x2c67d1[_0x4c8ee2(0x1dc)])+')');}console[_0x4c8ee2(0x1ca)]();}if(_0x4f233d[_0x4c8ee2(0x165)]?.[_0x4c8ee2(0x180)]){console['log'](a8_0xfb1312[_0x4c8ee2(0x1c0)](_0x4c8ee2(0x1d3)+_0x4f233d[_0x4c8ee2(0x165)][_0x4c8ee2(0x180)]+')'));for(const _0x3ed4fd of _0x4f233d[_0x4c8ee2(0x165)]){const _0x2e9b86=_0x3ed4fd[_0x4c8ee2(0x174)]?_0x4c8ee2(0x189)+_0x3ed4fd[_0x4c8ee2(0x174)]+')':'';console[_0x4c8ee2(0x1ca)]('\x20\x20'+a8_0xfb1312['bold'](_0x3ed4fd[_0x4c8ee2(0x1b0)])+_0x4c8ee2(0x1b1)+_0x3ed4fd[_0x4c8ee2(0x18c)]+'.'+_0x3ed4fd[_0x4c8ee2(0x1b2)]+_0x2e9b86);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x2fb3cc(0x1b0)]=a8_0x2fb3cc(0x1b3);[a8_0x2fb3cc(0x1a5)]=a8_0x2fb3cc(0x173);async[a8_0x2fb3cc(0x1b5)](_0x219452){const _0x4d2941=a8_0x2fb3cc,{options:_0x3b77e4,args:_0x27420e,tdx:_0x28468f}=_0x219452,_0x704232=_0x3b77e4,_0x1760b3=_0x27420e[0x0]||_0x3b77e4[_0x4d2941(0x184)];if(!_0x1760b3)return console[_0x4d2941(0x19d)](a8_0xfb1312['yellow'](_0x4d2941(0x1a7))),console[_0x4d2941(0x19d)](_0x4d2941(0x177)+a8_0xfb1312[_0x4d2941(0x17b)](_0x4d2941(0x19e))+'\x20or\x20set\x20context\x20with\x20'+a8_0xfb1312[_0x4d2941(0x17b)](_0x4d2941(0x19f))),0x1;const _0x5641fc=_0x704232[_0x4d2941(0x168)]||a8_0x3567e1[_0x4d2941(0x18a)](process[_0x4d2941(0x171)](),_0x4d2941(0x1cc),sanitizeFileName(_0x1760b3)),_0x45d45d=await withProgressSpinner(_0x4d2941(0x16b)+_0x1760b3+_0x4d2941(0x1db),_0xd8cd3e=>_0x28468f[_0x4d2941(0x1cc)][_0x4d2941(0x1d6)](_0x1760b3,{'targetDir':_0x5641fc,'verbose':_0x704232['verbose'],'progress':{'update':_0xce4e76=>_0xd8cd3e[_0x4d2941(0x1a1)](_0xce4e76)}}),{'verbose':_0x704232['verbose']}),_0x21c52d=_0x45d45d[_0x4d2941(0x194)],_0x2fe7f6=_0x21c52d[_0x4d2941(0x1b8)][_0x4d2941(0x1a8)](_0x361f0c=>_0x361f0c[_0x4d2941(0x1c7)]||_0x361f0c['hasChanges']);saveSessionContext({'composable_audience':_0x21c52d['audienceName']},_0x704232['session']),console['log'](a8_0xfb1312['green'](_0x4d2941(0x16f)+a8_0xfb1312[_0x4d2941(0x1c9)](_0x4d2941(0x18b))+_0x4d2941(0x1d0)+a8_0xfb1312['cyan'](_0x21c52d[_0x4d2941(0x1bb)])));if(_0x2fe7f6[_0x4d2941(0x180)]===0x0)return console[_0x4d2941(0x1ca)](a8_0xfb1312['green'](_0x4d2941(0x1af))),0x0;for(const _0x4de78d of _0x2fe7f6){if(_0x4de78d['isNew'])console['log'](a8_0xfb1312[_0x4d2941(0x183)]('+\x20'+_0x4de78d[_0x4d2941(0x1bc)]+'\x20(new)'));else _0x4de78d[_0x4d2941(0x1cd)]&&(console[_0x4d2941(0x1ca)](a8_0xfb1312['yellow']('~\x20'+_0x4de78d['relativePath'])),console['log'](_0x4de78d[_0x4d2941(0x1cd)]));}console['log']('\x0a'+_0x2fe7f6['length']+_0x4d2941(0x1bd)+('('+_0x21c52d[_0x4d2941(0x1c2)][_0x4d2941(0x17a)]+_0x4d2941(0x1ac)+_0x21c52d[_0x4d2941(0x1c2)][_0x4d2941(0x195)]+'\x20activations)'));if(_0x704232[_0x4d2941(0x1be)])return console[_0x4d2941(0x1ca)](a8_0xfb1312[_0x4d2941(0x1c9)](_0x4d2941(0x190))),0x0;if(!_0x704232[_0x4d2941(0x1da)]&&isInteractive()){const _0x29b335=await confirmKey(_0x4d2941(0x17d));if(!_0x29b335)return console['log'](a8_0xfb1312[_0x4d2941(0x1c9)](_0x4d2941(0x1cb))),0x0;}for(const _0x47333a of _0x2fe7f6){const _0x45a544=a8_0x3567e1[_0x4d2941(0x1ab)](_0x47333a[_0x4d2941(0x1c6)]);if(!existsSync(_0x45a544))mkdirSync(_0x45a544,{'recursive':!![]});writeFileSync(_0x47333a[_0x4d2941(0x1c6)],_0x47333a[_0x4d2941(0x1d7)],'utf-8');}return console['log'](a8_0xfb1312['green'](_0x4d2941(0x1c3)+_0x2fe7f6[_0x4d2941(0x180)]+_0x4d2941(0x1aa)+_0x5641fc)),0x0;}}export class CASPushCommand extends BaseCommand{['name']=a8_0x2fb3cc(0x162);['description']=a8_0x2fb3cc(0x182);async['execute'](_0x22fe26){const _0x279ddf=a8_0x2fb3cc,{options:_0x4cca76,args:_0x185e2a,tdx:_0x32e3e8}=_0x22fe26,_0x58b437=_0x4cca76;let _0x556949=_0x185e2a[0x0];!_0x556949&&_0x4cca76[_0x279ddf(0x184)]&&(_0x556949=a8_0x3567e1['join'](process['cwd'](),_0x279ddf(0x1cc),sanitizeFileName(_0x4cca76['composableAudience'])));if(!_0x556949)return console[_0x279ddf(0x19d)](a8_0xfb1312[_0x279ddf(0x17c)](_0x279ddf(0x1a7))),console['error'](_0x279ddf(0x177)+a8_0xfb1312[_0x279ddf(0x17b)](_0x279ddf(0x164))+_0x279ddf(0x187)+a8_0xfb1312[_0x279ddf(0x17b)](_0x279ddf(0x19f))),0x1;if(!existsSync(_0x556949))return console['error'](a8_0xfb1312[_0x279ddf(0x191)](_0x279ddf(0x17e)+_0x556949)),console[_0x279ddf(0x19d)](a8_0xfb1312[_0x279ddf(0x1c9)](_0x279ddf(0x1a2))),0x1;const _0xc6ecbe=_0x4cca76['composableAudience']||a8_0x3567e1[_0x279ddf(0x1a6)](_0x556949),_0x1dc6fb=a8_0x3567e1[_0x279ddf(0x16e)](process['cwd'](),_0x556949)||'.';console['log'](_0x279ddf(0x18f)+a8_0xfb1312[_0x279ddf(0x17b)](_0xc6ecbe)),console[_0x279ddf(0x1ca)]('Source:\x20\x20\x20'+a8_0xfb1312[_0x279ddf(0x1c9)](_0x1dc6fb)),console['log'](a8_0xfb1312[_0x279ddf(0x17c)](_0x279ddf(0x1cf))),console['log']();const _0x65439e=collectYamlFiles(_0x556949);if(_0x65439e[_0x279ddf(0x180)]===0x0)return console[_0x279ddf(0x19d)](a8_0xfb1312['red'](_0x279ddf(0x1bf)+_0x556949)),0x1;console[_0x279ddf(0x1ca)](_0x279ddf(0x197)+_0x65439e[_0x279ddf(0x180)]+'\x20YAML\x20file(s)');const _0x8d5711=await withProgressSpinner('Analyzing\x20CAS\x20YAML\x20files...',_0x43242f=>_0x32e3e8[_0x279ddf(0x1cc)][_0x279ddf(0x1ae)](_0x65439e,{'dryRun':!![],'verbose':_0x58b437['verbose'],'progress':{'update':_0x3812af=>_0x43242f[_0x279ddf(0x1a1)](_0x3812af)}}),{'verbose':_0x58b437[_0x279ddf(0x1d1)]}),_0x304977=_0x8d5711[_0x279ddf(0x194)],{created:_0x902424}=_0x304977,_0x280090=[];if(_0x902424['audiences'])_0x280090['push'](_0x902424[_0x279ddf(0x169)]+_0x279ddf(0x193));if(_0x902424[_0x279ddf(0x17a)])_0x280090[_0x279ddf(0x1ae)](_0x902424['segments']+'\x20segment(s)');if(_0x902424['activations'])_0x280090['push'](_0x902424['activations']+'\x20activation(s)');return _0x280090[_0x279ddf(0x180)]===0x0?console[_0x279ddf(0x1ca)](a8_0xfb1312[_0x279ddf(0x1c9)]('No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.')):console[_0x279ddf(0x1ca)](_0x279ddf(0x175)+_0x280090[_0x279ddf(0x18a)](',\x20')),console[_0x279ddf(0x1ca)](a8_0xfb1312[_0x279ddf(0x1c9)](_0x279ddf(0x176))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x2fb3cc(0x1b0)]=a8_0x2fb3cc(0x18d);['description']='Preview\x20composable\x20segment\x20query\x20on\x20CDW';async[a8_0x2fb3cc(0x1b5)](_0x234783){const _0x1b2762=a8_0x2fb3cc,{options:_0x34a131,args:_0xf7d142,tdx:_0x5632db}=_0x234783,_0x1486ec=_0xf7d142[0x0],_0x371602=_0xf7d142[0x1]||_0x34a131[_0x1b2762(0x184)];if(!_0x1486ec)return console[_0x1b2762(0x19d)](a8_0xfb1312[_0x1b2762(0x191)]('Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]')),0x1;if(!_0x371602)return console[_0x1b2762(0x19d)](a8_0xfb1312['yellow'](_0x1b2762(0x1a0))),console[_0x1b2762(0x19d)](_0x1b2762(0x177)+a8_0xfb1312[_0x1b2762(0x17b)](_0x1b2762(0x178))+_0x1b2762(0x187)+a8_0xfb1312[_0x1b2762(0x17b)](_0x1b2762(0x19f))),0x1;const _0x4517e5=await withProgressSpinner('Running\x20preview\x20for\x20\x27'+_0x1486ec+_0x1b2762(0x1db),()=>_0x5632db[_0x1b2762(0x1cc)]['preview'](_0x371602,_0x1486ec),{'verbose':_0x34a131[_0x1b2762(0x1d1)]}),{query:_0x409005,customers:_0x420a6d}=_0x4517e5[_0x1b2762(0x194)];if(isStructuredFormat(_0x34a131))return await handleSingleObjectOutput({'query':_0x409005,'customers':_0x420a6d},_0x34a131),0x0;const _0x3e487=_0x409005[_0x1b2762(0x1c4)]===_0x1b2762(0x1b9)?a8_0xfb1312[_0x1b2762(0x183)]:a8_0xfb1312[_0x1b2762(0x17c)];console[_0x1b2762(0x1ca)](_0x1b2762(0x179)+_0x3e487(_0x409005[_0x1b2762(0x1c4)])),console[_0x1b2762(0x1ca)](_0x1b2762(0x16d)+a8_0xfb1312['bold'](String(_0x409005[_0x1b2762(0x19c)])));_0x409005[_0x1b2762(0x19d)]&&console['log'](_0x1b2762(0x1d8)+a8_0xfb1312['red'](_0x409005['error']));if(_0x420a6d?.[_0x1b2762(0x1a9)]&&_0x420a6d?.[_0x1b2762(0x192)]){console['log'](a8_0xfb1312[_0x1b2762(0x1c0)](_0x1b2762(0x167)+_0x420a6d[_0x1b2762(0x192)][_0x1b2762(0x180)]+')'));const _0x544bdb=_0x420a6d[_0x1b2762(0x192)][_0x1b2762(0x1c1)](_0x4301cc=>{const _0x340895=_0x1b2762,_0x478a2d={};for(let _0x49fe8c=0x0;_0x49fe8c<_0x420a6d[_0x340895(0x1a9)][_0x340895(0x180)];_0x49fe8c++){_0x478a2d[_0x420a6d[_0x340895(0x1a9)][_0x49fe8c]]=_0x4301cc[_0x49fe8c];}return _0x478a2d;});await handleSDKOutput(_0x544bdb,_0x34a131);}return 0x0;}}
@@ -1 +1 @@
1
- const a9_0x1e9085=a9_0x3319;(function(_0xc0555b,_0x4e0b35){const _0x2e319f=a9_0x3319,_0x59b597=_0xc0555b();while(!![]){try{const _0x2c016b=parseInt(_0x2e319f(0x1b2))/0x1+parseInt(_0x2e319f(0x1a4))/0x2*(-parseInt(_0x2e319f(0x1a6))/0x3)+parseInt(_0x2e319f(0x198))/0x4*(-parseInt(_0x2e319f(0x1a8))/0x5)+parseInt(_0x2e319f(0x1a3))/0x6*(-parseInt(_0x2e319f(0x1ad))/0x7)+parseInt(_0x2e319f(0x1ae))/0x8+-parseInt(_0x2e319f(0x1b1))/0x9*(-parseInt(_0x2e319f(0x1ab))/0xa)+parseInt(_0x2e319f(0x1a0))/0xb;if(_0x2c016b===_0x4e0b35)break;else _0x59b597['push'](_0x59b597['shift']());}catch(_0x48db3e){_0x59b597['push'](_0x59b597['shift']());}}}(a9_0x554b,0x671f6));function a9_0x3319(_0x125d5e,_0x3122b6){_0x125d5e=_0x125d5e-0x196;const _0x554bc0=a9_0x554b();let _0x33190c=_0x554bc0[_0x125d5e];return _0x33190c;}import{BaseCommand}from'./command.js';function a9_0x554b(){const _0x440d86=['\x20segment','length','469876zGRvmE','data','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','6Gcarfd','104502rlFIzC','🎯\x20','6OMsRGE','dim','661610JVALkx','composableAudience','verbose','2170RzVZvG','Fetching\x20segments\x20for\x20\x27','2280117fHFEpM','2588864XpoJKL','description','Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>','27288hWTfwb','92999VrRyNl','green','cas:sg:list','name','population','Found\x20','8UsTeLr','error','log','cas','listSegments','List\x20composable\x20segments\x20for\x20an\x20audience'];a9_0x554b=function(){return _0x440d86;};return a9_0x554b();}import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{formatRows}from'../sdk/util/formatters.js';import a9_0x48eabd from'chalk';export class CASSegmentListCommand extends BaseCommand{[a9_0x1e9085(0x1b5)]=a9_0x1e9085(0x1b4);[a9_0x1e9085(0x1af)]=a9_0x1e9085(0x19d);async['execute'](_0x3da15b){const _0x4d900e=a9_0x1e9085,{options:_0x52b991,args:_0x1b75e5,tdx:_0x47e757}=_0x3da15b,_0x556b81=_0x1b75e5[0x0]||_0x52b991[_0x4d900e(0x1a9)];if(!_0x556b81)return console[_0x4d900e(0x199)](a9_0x48eabd['red'](_0x4d900e(0x1a2))),console[_0x4d900e(0x199)](a9_0x48eabd[_0x4d900e(0x1a7)](_0x4d900e(0x1b0))),0x1;const _0x4f589f=await withProgressSpinner(_0x4d900e(0x1ac)+_0x556b81+'\x27...',()=>_0x47e757[_0x4d900e(0x19b)][_0x4d900e(0x19c)](_0x556b81),{'verbose':_0x52b991[_0x4d900e(0x1aa)]}),_0x5c5453=_0x4f589f[_0x4d900e(0x1a1)];if(isStructuredFormat(_0x52b991))return await handleSDKOutput(_0x5c5453,_0x52b991),0x0;console['log'](a9_0x48eabd[_0x4d900e(0x1b3)](_0x4d900e(0x197)+_0x5c5453[_0x4d900e(0x19f)]+_0x4d900e(0x19e)+(_0x5c5453['length']!==0x1?'s':'')));if(_0x5c5453['length']===0x0)return 0x0;for(const _0x286ccd of _0x5c5453){const _0x2595da=_0x286ccd[_0x4d900e(0x196)]!=null?a9_0x48eabd[_0x4d900e(0x1a7)]('\x20('+formatRows(_0x286ccd[_0x4d900e(0x196)])+')'):'';console[_0x4d900e(0x19a)](_0x4d900e(0x1a5)+_0x286ccd[_0x4d900e(0x1b5)]+_0x2595da),_0x286ccd[_0x4d900e(0x1af)]&&console[_0x4d900e(0x19a)]('\x20\x20'+a9_0x48eabd[_0x4d900e(0x1a7)](_0x286ccd[_0x4d900e(0x1af)]));}return 0x0;}}
1
+ const a9_0x1a45a6=a9_0x2d68;(function(_0x48c98f,_0x1a7418){const _0x406da4=a9_0x2d68,_0x27a2e1=_0x48c98f();while(!![]){try{const _0xfca109=-parseInt(_0x406da4(0x7a))/0x1*(-parseInt(_0x406da4(0x85))/0x2)+-parseInt(_0x406da4(0x7b))/0x3*(parseInt(_0x406da4(0x72))/0x4)+-parseInt(_0x406da4(0x6d))/0x5*(-parseInt(_0x406da4(0x76))/0x6)+parseInt(_0x406da4(0x86))/0x7*(-parseInt(_0x406da4(0x7d))/0x8)+parseInt(_0x406da4(0x73))/0x9*(-parseInt(_0x406da4(0x87))/0xa)+-parseInt(_0x406da4(0x79))/0xb*(parseInt(_0x406da4(0x74))/0xc)+parseInt(_0x406da4(0x8a))/0xd;if(_0xfca109===_0x1a7418)break;else _0x27a2e1['push'](_0x27a2e1['shift']());}catch(_0x108f70){_0x27a2e1['push'](_0x27a2e1['shift']());}}}(a9_0x55c6,0x6fbed));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_0x55c6(){const _0x15e8d4=['List\x20composable\x20segments\x20for\x20an\x20audience','5tFhYoW','verbose','cas:sg:list','red','name','21352lZCzWV','10161DlOaQg','3196140hPFsHW','execute','486186rzSqkR','length','description','33CfXofB','598361YEoqma','492jRSCSF','composableAudience','1361480nSbkCQ','error','dim','cas','🎯\x20','population','\x27...','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','2sojMUU','7pKHQRp','7180bRETGZ','data','listSegments','31636683xOumxu','Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>','log','Fetching\x20segments\x20for\x20\x27','\x20segment','green'];a9_0x55c6=function(){return _0x15e8d4;};return a9_0x55c6();}import a9_0x254bfb from'chalk';function a9_0x2d68(_0x1f0758,_0x184521){_0x1f0758=_0x1f0758-0x6c;const _0x55c67d=a9_0x55c6();let _0x2d6820=_0x55c67d[_0x1f0758];return _0x2d6820;}export class CASSegmentListCommand extends BaseCommand{[a9_0x1a45a6(0x71)]=a9_0x1a45a6(0x6f);[a9_0x1a45a6(0x78)]=a9_0x1a45a6(0x6c);async[a9_0x1a45a6(0x75)](_0x12e876){const _0x21cb58=a9_0x1a45a6,{options:_0x3168c0,args:_0x28d258,tdx:_0x46dccc}=_0x12e876,_0x41015e=_0x28d258[0x0]||_0x3168c0[_0x21cb58(0x7c)];if(!_0x41015e)return console[_0x21cb58(0x7e)](a9_0x254bfb[_0x21cb58(0x70)](_0x21cb58(0x84))),console[_0x21cb58(0x7e)](a9_0x254bfb['dim'](_0x21cb58(0x8b))),0x1;const _0x1ad15b=await withProgressSpinner(_0x21cb58(0x8d)+_0x41015e+_0x21cb58(0x83),()=>_0x46dccc[_0x21cb58(0x80)][_0x21cb58(0x89)](_0x41015e),{'verbose':_0x3168c0[_0x21cb58(0x6e)]}),_0x3cb6fd=_0x1ad15b[_0x21cb58(0x88)];if(isStructuredFormat(_0x3168c0))return await handleSDKOutput(_0x3cb6fd,_0x3168c0),0x0;console[_0x21cb58(0x8c)](a9_0x254bfb[_0x21cb58(0x8f)]('Found\x20'+_0x3cb6fd[_0x21cb58(0x77)]+_0x21cb58(0x8e)+(_0x3cb6fd[_0x21cb58(0x77)]!==0x1?'s':'')));if(_0x3cb6fd[_0x21cb58(0x77)]===0x0)return 0x0;for(const _0x6e76c2 of _0x3cb6fd){const _0x19e7ea=_0x6e76c2[_0x21cb58(0x82)]!=null?a9_0x254bfb[_0x21cb58(0x7f)]('\x20('+formatRows(_0x6e76c2[_0x21cb58(0x82)])+')'):'';console[_0x21cb58(0x8c)](_0x21cb58(0x81)+_0x6e76c2[_0x21cb58(0x71)]+_0x19e7ea),_0x6e76c2[_0x21cb58(0x78)]&&console[_0x21cb58(0x8c)]('\x20\x20'+a9_0x254bfb['dim'](_0x6e76c2[_0x21cb58(0x78)]));}return 0x0;}}
@@ -1 +1 @@
1
- const a10_0x4bd81e=a10_0x32a0;(function(_0x252705,_0x29a3e7){const _0x56aa27=a10_0x32a0,_0x564693=_0x252705();while(!![]){try{const _0x5597fe=-parseInt(_0x56aa27(0xa3))/0x1*(-parseInt(_0x56aa27(0xe9))/0x2)+-parseInt(_0x56aa27(0xbf))/0x3*(parseInt(_0x56aa27(0xd4))/0x4)+parseInt(_0x56aa27(0x9e))/0x5*(parseInt(_0x56aa27(0xde))/0x6)+-parseInt(_0x56aa27(0xd1))/0x7+-parseInt(_0x56aa27(0xe5))/0x8*(-parseInt(_0x56aa27(0xc0))/0x9)+-parseInt(_0x56aa27(0xe6))/0xa+parseInt(_0x56aa27(0xa0))/0xb;if(_0x5597fe===_0x29a3e7)break;else _0x564693['push'](_0x564693['shift']());}catch(_0x3b85e7){_0x564693['push'](_0x564693['shift']());}}}(a10_0x50f4,0x8805f));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x373650,_0x4946d5){const _0x237184=a10_0x32a0;if(_0x373650 instanceof SDKError)console[_0x237184(0xa4)](_0x237184(0xcb)+_0x373650[_0x237184(0xca)]),_0x4946d5['verbose']&&(_0x373650[_0x237184(0xbc)]&&console[_0x237184(0xa4)]('\x20\x20Cause:\x20'+_0x373650['cause']),_0x373650[_0x237184(0xa7)]&&(console['error'](_0x237184(0xc2)),console['error'](_0x373650[_0x237184(0xa7)])));else throw _0x373650;}async function resolveAgentId(_0x59685d,_0x5cb0e6,_0x47b979,_0x32edba,_0xdd5ef4){const _0x32911d=a10_0x32a0,_0x7612f2=_0x5cb0e6||_0x47b979;if(_0x7612f2){const {projectName:_0x2fbd7e,agentName:_0x546511}=parseAgentRef(_0x7612f2),_0x594d15=_0x546511||_0x7612f2,_0x432f63=_0x546511?_0x2fbd7e:_0x32edba;if(!_0x432f63)throw new Error(_0x32911d(0xdb));if(_0xdd5ef4){const _0x225582=_0x5cb0e6?_0x32911d(0xe8):_0x32911d(0xec);console[_0x32911d(0xa4)](_0x32911d(0xd0)+_0x225582+':\x20'+_0x432f63+'/'+_0x594d15);}const _0x21b80f=await withSpinner('Resolving\x20project\x20\x27'+_0x432f63+_0x32911d(0xe7),()=>_0x59685d[_0x32911d(0xb9)][_0x32911d(0xc1)](_0x432f63),{'verbose':_0xdd5ef4}),_0x5978d0=await withSpinner(_0x32911d(0x9f)+_0x594d15+_0x32911d(0xe7),()=>_0x59685d['llm'][_0x32911d(0xc8)](_0x594d15,_0x21b80f[_0x32911d(0xa8)]),{'verbose':_0xdd5ef4});return _0x5978d0[_0x32911d(0xa8)];}else{const _0x5be43a=_0x59685d[_0x32911d(0xb9)][_0x32911d(0xcf)]();if(_0x5be43a)return _0xdd5ef4&&console[_0x32911d(0xa4)]('Using\x20cached\x20default\x20agent:\x20'+_0x5be43a[_0x32911d(0xaf)]),_0x5be43a['id'];const _0x5e4dc9=await withSpinner(_0x32911d(0xd9),()=>_0x59685d[_0x32911d(0xb9)][_0x32911d(0xb8)](_0x32911d(0xd8),0x0),{'verbose':_0xdd5ef4});return _0x5e4dc9['data']['id'];}}function a10_0x32a0(_0x1c8b2c,_0x77acb6){_0x1c8b2c=_0x1c8b2c-0x99;const _0x50f42f=a10_0x50f4();let _0x32a0f1=_0x50f42f[_0x1c8b2c];return _0x32a0f1;}export class ChatCommand extends BaseCommand{[a10_0x4bd81e(0xaf)]=a10_0x4bd81e(0xb5);[a10_0x4bd81e(0xb1)]=a10_0x4bd81e(0xc6);[a10_0x4bd81e(0x99)](_0xea598d){const _0x83ec81=a10_0x4bd81e,_0x41cfcb=_0xea598d[_0x83ec81(0x9c)][_0x83ec81(0xcc)]('\x20');if(!_0x41cfcb)return _0x83ec81(0xe4);return undefined;}async[a10_0x4bd81e(0xa9)](_0x1768a9,_0x28751c,_0x30a033,_0x22e0f8,_0x7a6844){const _0xd936cb=a10_0x4bd81e;for await(const _0x252b64 of _0x1768a9[_0xd936cb(0xb9)][_0xd936cb(0xb5)](_0x28751c,{'agentId':_0x30a033,'chatId':_0x22e0f8})){if(_0x252b64[_0xd936cb(0xaa)]===_0xd936cb(0xac)){const _0xb4229a=_0x252b64['data']['chatId'];saveLastChatId(_0xb4229a),_0x7a6844&&console['error']('Chat\x20session:\x20'+_0xb4229a);}else _0x252b64[_0xd936cb(0xaa)]===_0xd936cb(0xa5)&&this[_0xd936cb(0xb3)](_0x252b64[_0xd936cb(0xa8)]);}}async['streamChatJsonl'](_0x2ebe08,_0xc54beb,_0x3065fa,_0x6f51e1){const _0x3038ff=a10_0x4bd81e,_0x1010b9=_0x2ebe08[_0x3038ff(0xdf)][_0x3038ff(0xc5)];let _0x1d6c03=![];for await(const _0x285771 of _0x2ebe08[_0x3038ff(0xb9)][_0x3038ff(0xb5)](_0xc54beb,{'agentId':_0x3065fa,'chatId':_0x6f51e1})){if(_0x285771[_0x3038ff(0xaa)]===_0x3038ff(0xac)){const _0x4ce2fb=_0x285771['data'];saveLastChatId(_0x4ce2fb[_0x3038ff(0xce)]);const _0x566f1d=_0x4ce2fb[_0x3038ff(0xd7)]&&_0x4ce2fb[_0x3038ff(0xd6)]?getLLMConversationUrl(_0x1010b9,_0x4ce2fb[_0x3038ff(0xd7)],_0x4ce2fb[_0x3038ff(0xd6)],_0x4ce2fb['chatId']):undefined;console['log'](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0xac),'data':{'chatId':_0x4ce2fb['chatId'],'agentId':_0x4ce2fb[_0x3038ff(0xd6)],'consoleUrl':_0x566f1d}})),_0x1d6c03=!![];}else{if(_0x285771[_0x3038ff(0xaa)]===_0x3038ff(0xa5)){!_0x1d6c03&&_0x6f51e1&&(console[_0x3038ff(0xb0)](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0xac),'data':{'chatId':_0x6f51e1}})),_0x1d6c03=!![]);const _0xa6211f=_0x285771['data'];if('content'in _0xa6211f)console[_0x3038ff(0xb0)](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0xab),'data':{'content':_0xa6211f[_0x3038ff(0xab)]}}));else{if(_0x3038ff(0xae)in _0xa6211f){const _0x1a4848=_0xa6211f[_0x3038ff(0xae)];console['log'](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0xae),'data':{'id':_0x1a4848['id'],'name':_0x1a4848['functionName'],'target':_0x1a4848[_0x3038ff(0xe1)]?.[_0x3038ff(0xaf)]||_0x1a4848[_0x3038ff(0xdd)]?.['name']||_0x1a4848[_0x3038ff(0xba)]?.[_0x3038ff(0xaf)]||_0x1a4848[_0x3038ff(0xc9)]}}));}else{if(_0x3038ff(0xcd)in _0xa6211f)console[_0x3038ff(0xb0)](JSON['stringify']({'type':_0x3038ff(0xe0),'data':{'id':_0xa6211f[_0x3038ff(0xcd)]['id'],'name':_0xa6211f['tool'][_0x3038ff(0xc3)],'result':typeof _0xa6211f[_0x3038ff(0xcd)][_0x3038ff(0xab)]===_0x3038ff(0xc7)?_0xa6211f[_0x3038ff(0xcd)]['content'][_0x3038ff(0xbb)](0x0,0x1f4):''}}));else _0x3038ff(0xa4)in _0xa6211f&&console[_0x3038ff(0xb0)](JSON['stringify']({'type':_0x3038ff(0xa4),'data':{'error':_0xa6211f[_0x3038ff(0xa4)]}}));}}}}}console[_0x3038ff(0xb0)](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0x9d)}));}async[a10_0x4bd81e(0xa6)](_0x3239aa){const _0x1729b3=a10_0x4bd81e,{options:_0x3bf641,args:_0x24bc3f,tdx:_0x5f31e2}=_0x3239aa,_0x518293=_0x24bc3f[_0x1729b3(0xcc)]('\x20'),_0x13fe0f=_0x3bf641,_0x5d7f5f=_0x13fe0f[_0x1729b3(0xb2)],_0x1c665a=_0x13fe0f[_0x1729b3(0xe3)],_0x81bd05=_0x13fe0f[_0x1729b3(0xa2)],_0x39a163=_0x13fe0f[_0x1729b3(0xea)],_0x1cb4da=_0x13fe0f[_0x1729b3(0xce)],_0x1021db=_0x13fe0f[_0x1729b3(0xbd)];if(_0x39a163&&_0x1cb4da)return console[_0x1729b3(0xa4)](_0x1729b3(0xb6)),0x1;try{let _0x206a62,_0x21877a;if(_0x1cb4da)_0x21877a=_0x1cb4da;else!_0x39a163&&(_0x21877a=loadLastChatId(),_0x21877a&&_0x3bf641[_0x1729b3(0xeb)]&&console[_0x1729b3(0xa4)](_0x1729b3(0xb7)+_0x21877a));!_0x1cb4da&&(_0x39a163||!_0x21877a)&&(_0x206a62=await resolveAgentId(_0x5f31e2,_0x5d7f5f,_0x1c665a,_0x81bd05,_0x3bf641['verbose']));const _0x70fb44=_0x1021db?(_0x348b51,_0x49befa,_0x6a4c3b)=>this[_0x1729b3(0x9a)](_0x5f31e2,_0x348b51,_0x49befa,_0x6a4c3b):(_0x3b2ac2,_0x1b4050,_0x5f28ca)=>this[_0x1729b3(0xa9)](_0x5f31e2,_0x3b2ac2,_0x1b4050,_0x5f28ca,_0x3bf641[_0x1729b3(0xeb)]);try{await _0x70fb44(_0x518293,_0x206a62,_0x21877a);}catch(_0x4aea6d){const _0xfe323a=_0x4aea6d instanceof SDKError&&_0x4aea6d['code']===ErrorCode[_0x1729b3(0xbe)]||_0x4aea6d instanceof Error&&_0x4aea6d[_0x1729b3(0xca)][_0x1729b3(0xd5)]('404');if(_0xfe323a&&_0x1cb4da)return console[_0x1729b3(0xa4)](_0x1729b3(0xc4)+_0x1cb4da+_0x1729b3(0xe2)),0x1;if(_0xfe323a)_0x3bf641[_0x1729b3(0xeb)]&&console[_0x1729b3(0xa4)](_0x1729b3(0xd2)),!_0x206a62&&(_0x206a62=await resolveAgentId(_0x5f31e2,_0x5d7f5f,_0x1c665a,_0x81bd05,_0x3bf641[_0x1729b3(0xeb)])),await _0x70fb44(_0x518293,_0x206a62,undefined);else throw _0x4aea6d;}return!_0x1021db&&console[_0x1729b3(0xb0)](),0x0;}catch(_0x51f7b2){return console['error'](),handleSDKError(_0x51f7b2,_0x3bf641),0x1;}}[a10_0x4bd81e(0xb3)](_0x1c6573){const _0x1860b5=a10_0x4bd81e;if('content'in _0x1c6573)process[_0x1860b5(0x9b)][_0x1860b5(0xdc)](_0x1c6573[_0x1860b5(0xab)]);else _0x1860b5(0xa4)in _0x1c6573&&console[_0x1860b5(0xa4)](_0x1860b5(0xa1)+_0x1c6573['error']);}}function a10_0x50f4(){const _0x322f9e=['8784jihgtJ','includes','agentId','projectId','claude-4.5-haiku','Getting\x20default\x20agent...','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','write','targetAgent','18vWTPdw','context','tool_result','targetKnowledgeBase','\x27\x20not\x20found','llmAgent','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','8uCkmog','767800dlIwBu','\x27...','--agent\x20flag','2Ivlvrr','new','verbose','session\x20context','validate','streamChatJsonl','stdout','args','done','1187005jXKdPD','Resolving\x20agent\x20\x27','1818795lCZvHJ','\x0aError:\x20','llmProject','374326TLBwiO','error','event','execute','stack','data','streamChat','type','content','metadata','stringify','tool_call','name','log','description','agent','handleChatEvent','options','chat','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Continuing\x20chat:\x20','getOrCreateDefaultAgent','llm','targetWebSearchTool','slice','cause','stream','CHAT_NOT_FOUND','1212EXddbd','6360309neIPxU','resolveProjectId','\x0aStack\x20trace:','functionName','Error:\x20Chat\x20session\x20\x27','site','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','string','resolveAgentId','targetFunction','message','Error:\x20','join','tool','chatId','getDefaultAgent','Using\x20agent\x20from\x20','3062220EiTMmH','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','startChat'];a10_0x50f4=function(){return _0x322f9e;};return a10_0x50f4();}export class ChatCreateCommand extends BaseCommand{[a10_0x4bd81e(0xaf)]='chat-create';[a10_0x4bd81e(0xb1)]='Create\x20a\x20new\x20chat\x20session';['validate'](_0x5c9304){const _0x462958=a10_0x4bd81e,_0x4243b6=_0x5c9304[_0x462958(0xb4)],_0x5d08a5=_0x4243b6[_0x462958(0xb2)],_0x3bf338=_0x4243b6['llmAgent'];if(!_0x5d08a5&&!_0x3bf338)return _0x462958(0xda);return undefined;}async[a10_0x4bd81e(0xa6)](_0x23f5d2){const _0x4d02bf=a10_0x4bd81e,{options:_0x46554a,tdx:_0x5d04ec}=_0x23f5d2,_0x14d166=_0x46554a,_0x9f7bbe=_0x14d166[_0x4d02bf(0xb2)],_0x426fc5=_0x14d166['llmAgent'],_0x45b803=_0x14d166['llmProject'];try{const _0x5a50fb=await resolveAgentId(_0x5d04ec,_0x9f7bbe,_0x426fc5,_0x45b803,_0x46554a['verbose']),_0x383007=await _0x5d04ec['llm'][_0x4d02bf(0xd3)](_0x5a50fb);return saveLastChatId(_0x383007['id']),console[_0x4d02bf(0xb0)](JSON[_0x4d02bf(0xad)]({'chatId':_0x383007['id'],'agentId':_0x5a50fb})),0x0;}catch(_0x330f6e){return handleSDKError(_0x330f6e,_0x46554a),0x1;}}}
1
+ const a10_0x37de99=a10_0x17d2;(function(_0x5bcf85,_0x45bb2c){const _0xb477b3=a10_0x17d2,_0x26417e=_0x5bcf85();while(!![]){try{const _0x1d07b1=-parseInt(_0xb477b3(0x90))/0x1*(-parseInt(_0xb477b3(0xbd))/0x2)+parseInt(_0xb477b3(0x88))/0x3*(parseInt(_0xb477b3(0xb6))/0x4)+parseInt(_0xb477b3(0xc0))/0x5*(-parseInt(_0xb477b3(0xb8))/0x6)+parseInt(_0xb477b3(0xcb))/0x7+-parseInt(_0xb477b3(0x8e))/0x8+parseInt(_0xb477b3(0x98))/0x9*(parseInt(_0xb477b3(0xa8))/0xa)+parseInt(_0xb477b3(0x9b))/0xb*(parseInt(_0xb477b3(0xa9))/0xc);if(_0x1d07b1===_0x45bb2c)break;else _0x26417e['push'](_0x26417e['shift']());}catch(_0x1585d3){_0x26417e['push'](_0x26417e['shift']());}}}(a10_0x361c,0xc944e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a10_0x17d2(_0x5b0d12,_0x338cc3){_0x5b0d12=_0x5b0d12-0x87;const _0x361c14=a10_0x361c();let _0x17d29a=_0x361c14[_0x5b0d12];return _0x17d29a;}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0xdba940,_0x2d3d8a){const _0x22c047=a10_0x17d2;if(_0xdba940 instanceof SDKError)console['error'](_0x22c047(0xad)+_0xdba940[_0x22c047(0x9a)]),_0x2d3d8a[_0x22c047(0xa7)]&&(_0xdba940[_0x22c047(0xba)]&&console[_0x22c047(0xcf)]('\x20\x20Cause:\x20'+_0xdba940[_0x22c047(0xba)]),_0xdba940[_0x22c047(0x9d)]&&(console['error']('\x0aStack\x20trace:'),console[_0x22c047(0xcf)](_0xdba940['stack'])));else throw _0xdba940;}function a10_0x361c(){const _0xde9cb3=['214wArgGc','resolveAgentId','execute','850235XoabPm','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','404','resolveProjectId','tool_call','Chat\x20session:\x20','chat','Resolving\x20project\x20\x27','new','tool_result','tool','5418266vLyNCV','Getting\x20default\x20agent...','data','event','error','includes','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','join','targetAgent','name','chatId','llm','29166INVpHV','description','\x27...','code','stream','chat-create','6549616lurzTa','content','11414YduprJ','--agent\x20flag','Create\x20a\x20new\x20chat\x20session','stringify','type','Continuing\x20chat:\x20','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','done','9yttszO','targetKnowledgeBase','message','22lqmRQg','llmAgent','stack','session\x20context','write','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','slice','string','args','agent','Using\x20cached\x20default\x20agent:\x20','functionName','verbose','67390TpklSd','3821484cwshUs','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','getOrCreateDefaultAgent','streamChatJsonl','Error:\x20','llmProject','log','validate','Resolving\x20agent\x20\x27','Using\x20agent\x20from\x20','metadata','\x27\x20not\x20found','Error:\x20Chat\x20session\x20\x27','80iQeEOr','targetFunction','42wUIQxf','projectId','cause','agentId','claude-4.5-haiku'];a10_0x361c=function(){return _0xde9cb3;};return a10_0x361c();}async function resolveAgentId(_0x3dec00,_0x3bf2fc,_0x2feec0,_0x810985,_0x421b18){const _0x20227a=a10_0x17d2,_0x794f32=_0x3bf2fc||_0x2feec0;if(_0x794f32){const {projectName:_0x2bbf1f,agentName:_0x562a0f}=parseAgentRef(_0x794f32),_0x18bba6=_0x562a0f||_0x794f32,_0x392918=_0x562a0f?_0x2bbf1f:_0x810985;if(!_0x392918)throw new Error(_0x20227a(0xaa));if(_0x421b18){const _0x256ecd=_0x3bf2fc?_0x20227a(0x91):_0x20227a(0x9e);console['error'](_0x20227a(0xb2)+_0x256ecd+':\x20'+_0x392918+'/'+_0x18bba6);}const _0x51da95=await withSpinner(_0x20227a(0xc7)+_0x392918+'\x27...',()=>_0x3dec00[_0x20227a(0x87)][_0x20227a(0xc3)](_0x392918),{'verbose':_0x421b18}),_0xd13209=await withSpinner(_0x20227a(0xb1)+_0x18bba6+_0x20227a(0x8a),()=>_0x3dec00[_0x20227a(0x87)][_0x20227a(0xbe)](_0x18bba6,_0x51da95[_0x20227a(0xcd)]),{'verbose':_0x421b18});return _0xd13209[_0x20227a(0xcd)];}else{const _0x129f22=_0x3dec00[_0x20227a(0x87)]['getDefaultAgent']();if(_0x129f22)return _0x421b18&&console[_0x20227a(0xcf)](_0x20227a(0xa5)+_0x129f22[_0x20227a(0xd4)]),_0x129f22['id'];const _0x1a12bc=await withSpinner(_0x20227a(0xcc),()=>_0x3dec00[_0x20227a(0x87)][_0x20227a(0xab)](_0x20227a(0xbc),0x0),{'verbose':_0x421b18});return _0x1a12bc['data']['id'];}}export class ChatCommand extends BaseCommand{[a10_0x37de99(0xd4)]='chat';[a10_0x37de99(0x89)]=a10_0x37de99(0xc1);['validate'](_0x10daf1){const _0x2456ee=a10_0x37de99,_0x2ecf46=_0x10daf1[_0x2456ee(0xa3)][_0x2456ee(0xd2)]('\x20');if(!_0x2ecf46)return _0x2456ee(0xa0);return undefined;}async['streamChat'](_0x4c442e,_0x501310,_0x1a7c84,_0x98bad9,_0x19dbf5){const _0x3a9027=a10_0x37de99;for await(const _0x5ed92b of _0x4c442e[_0x3a9027(0x87)][_0x3a9027(0xc6)](_0x501310,{'agentId':_0x1a7c84,'chatId':_0x98bad9})){if(_0x5ed92b['type']===_0x3a9027(0xb3)){const _0x485ff9=_0x5ed92b[_0x3a9027(0xcd)][_0x3a9027(0xd5)];saveLastChatId(_0x485ff9),_0x19dbf5&&console['error'](_0x3a9027(0xc5)+_0x485ff9);}else _0x5ed92b['type']==='event'&&this['handleChatEvent'](_0x5ed92b[_0x3a9027(0xcd)]);}}async['streamChatJsonl'](_0x41bd45,_0x1e8123,_0x3c774e,_0x1ed654){const _0x337bb6=a10_0x37de99,_0x4663b0=_0x41bd45['context']['site'];let _0x335960=![];for await(const _0x59e0ea of _0x41bd45[_0x337bb6(0x87)][_0x337bb6(0xc6)](_0x1e8123,{'agentId':_0x3c774e,'chatId':_0x1ed654})){if(_0x59e0ea[_0x337bb6(0x94)]==='metadata'){const _0x55392f=_0x59e0ea['data'];saveLastChatId(_0x55392f[_0x337bb6(0xd5)]);const _0x5d4179=_0x55392f['projectId']&&_0x55392f[_0x337bb6(0xbb)]?getLLMConversationUrl(_0x4663b0,_0x55392f[_0x337bb6(0xb9)],_0x55392f[_0x337bb6(0xbb)],_0x55392f[_0x337bb6(0xd5)]):undefined;console['log'](JSON['stringify']({'type':'metadata','data':{'chatId':_0x55392f[_0x337bb6(0xd5)],'agentId':_0x55392f[_0x337bb6(0xbb)],'consoleUrl':_0x5d4179}})),_0x335960=!![];}else{if(_0x59e0ea[_0x337bb6(0x94)]===_0x337bb6(0xce)){!_0x335960&&_0x1ed654&&(console[_0x337bb6(0xaf)](JSON['stringify']({'type':_0x337bb6(0xb3),'data':{'chatId':_0x1ed654}})),_0x335960=!![]);const _0x22a8b3=_0x59e0ea['data'];if(_0x337bb6(0x8f)in _0x22a8b3)console[_0x337bb6(0xaf)](JSON[_0x337bb6(0x93)]({'type':_0x337bb6(0x8f),'data':{'content':_0x22a8b3['content']}}));else{if(_0x337bb6(0xc4)in _0x22a8b3){const _0x2ff3c1=_0x22a8b3[_0x337bb6(0xc4)];console[_0x337bb6(0xaf)](JSON['stringify']({'type':_0x337bb6(0xc4),'data':{'id':_0x2ff3c1['id'],'name':_0x2ff3c1[_0x337bb6(0xa6)],'target':_0x2ff3c1[_0x337bb6(0x99)]?.[_0x337bb6(0xd4)]||_0x2ff3c1[_0x337bb6(0xd3)]?.[_0x337bb6(0xd4)]||_0x2ff3c1['targetWebSearchTool']?.[_0x337bb6(0xd4)]||_0x2ff3c1[_0x337bb6(0xb7)]}}));}else{if(_0x337bb6(0xca)in _0x22a8b3)console['log'](JSON[_0x337bb6(0x93)]({'type':_0x337bb6(0xc9),'data':{'id':_0x22a8b3[_0x337bb6(0xca)]['id'],'name':_0x22a8b3[_0x337bb6(0xca)][_0x337bb6(0xa6)],'result':typeof _0x22a8b3['tool'][_0x337bb6(0x8f)]===_0x337bb6(0xa2)?_0x22a8b3[_0x337bb6(0xca)]['content'][_0x337bb6(0xa1)](0x0,0x1f4):''}}));else _0x337bb6(0xcf)in _0x22a8b3&&console[_0x337bb6(0xaf)](JSON['stringify']({'type':'error','data':{'error':_0x22a8b3[_0x337bb6(0xcf)]}}));}}}}}console['log'](JSON[_0x337bb6(0x93)]({'type':_0x337bb6(0x97)}));}async[a10_0x37de99(0xbf)](_0x296185){const _0x412e56=a10_0x37de99,{options:_0xa184d,args:_0x2383d2,tdx:_0x4870b4}=_0x296185,_0x1feaae=_0x2383d2[_0x412e56(0xd2)]('\x20'),_0xf05e5c=_0xa184d,_0x308614=_0xf05e5c[_0x412e56(0xa4)],_0x47bb0c=_0xf05e5c['llmAgent'],_0x504523=_0xf05e5c[_0x412e56(0xae)],_0x39cdc7=_0xf05e5c[_0x412e56(0xc8)],_0x2a9341=_0xf05e5c['chatId'],_0x1f3c1b=_0xf05e5c[_0x412e56(0x8c)];if(_0x39cdc7&&_0x2a9341)return console[_0x412e56(0xcf)](_0x412e56(0x96)),0x1;try{let _0x23e3e4,_0x18b7e4;if(_0x2a9341)_0x18b7e4=_0x2a9341;else!_0x39cdc7&&(_0x18b7e4=loadLastChatId(),_0x18b7e4&&_0xa184d[_0x412e56(0xa7)]&&console[_0x412e56(0xcf)](_0x412e56(0x95)+_0x18b7e4));!_0x2a9341&&(_0x39cdc7||!_0x18b7e4)&&(_0x23e3e4=await resolveAgentId(_0x4870b4,_0x308614,_0x47bb0c,_0x504523,_0xa184d[_0x412e56(0xa7)]));const _0x377849=_0x1f3c1b?(_0x363d2f,_0x71dc6a,_0x304fef)=>this[_0x412e56(0xac)](_0x4870b4,_0x363d2f,_0x71dc6a,_0x304fef):(_0x4041f8,_0xb33e41,_0x1cc0c5)=>this['streamChat'](_0x4870b4,_0x4041f8,_0xb33e41,_0x1cc0c5,_0xa184d[_0x412e56(0xa7)]);try{await _0x377849(_0x1feaae,_0x23e3e4,_0x18b7e4);}catch(_0x5c7777){const _0x416dc9=_0x5c7777 instanceof SDKError&&_0x5c7777[_0x412e56(0x8b)]===ErrorCode['CHAT_NOT_FOUND']||_0x5c7777 instanceof Error&&_0x5c7777[_0x412e56(0x9a)][_0x412e56(0xd0)](_0x412e56(0xc2));if(_0x416dc9&&_0x2a9341)return console['error'](_0x412e56(0xb5)+_0x2a9341+_0x412e56(0xb4)),0x1;if(_0x416dc9)_0xa184d[_0x412e56(0xa7)]&&console[_0x412e56(0xcf)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x23e3e4&&(_0x23e3e4=await resolveAgentId(_0x4870b4,_0x308614,_0x47bb0c,_0x504523,_0xa184d[_0x412e56(0xa7)])),await _0x377849(_0x1feaae,_0x23e3e4,undefined);else throw _0x5c7777;}return!_0x1f3c1b&&console[_0x412e56(0xaf)](),0x0;}catch(_0x45fe19){return console[_0x412e56(0xcf)](),handleSDKError(_0x45fe19,_0xa184d),0x1;}}['handleChatEvent'](_0x591f87){const _0x1ba4c=a10_0x37de99;if(_0x1ba4c(0x8f)in _0x591f87)process['stdout'][_0x1ba4c(0x9f)](_0x591f87[_0x1ba4c(0x8f)]);else _0x1ba4c(0xcf)in _0x591f87&&console[_0x1ba4c(0xcf)]('\x0aError:\x20'+_0x591f87['error']);}}export class ChatCreateCommand extends BaseCommand{[a10_0x37de99(0xd4)]=a10_0x37de99(0x8d);[a10_0x37de99(0x89)]=a10_0x37de99(0x92);[a10_0x37de99(0xb0)](_0x11a593){const _0xe3ed33=a10_0x37de99,_0x1715d2=_0x11a593['options'],_0x3688e4=_0x1715d2[_0xe3ed33(0xa4)],_0x2fbf13=_0x1715d2[_0xe3ed33(0x9c)];if(!_0x3688e4&&!_0x2fbf13)return _0xe3ed33(0xd1);return undefined;}async[a10_0x37de99(0xbf)](_0x5c509d){const _0x468b61=a10_0x37de99,{options:_0x2b71e1,tdx:_0xfca44}=_0x5c509d,_0x4abf51=_0x2b71e1,_0x45b853=_0x4abf51[_0x468b61(0xa4)],_0x3ced12=_0x4abf51['llmAgent'],_0x27593d=_0x4abf51[_0x468b61(0xae)];try{const _0x14af12=await resolveAgentId(_0xfca44,_0x45b853,_0x3ced12,_0x27593d,_0x2b71e1[_0x468b61(0xa7)]),_0x2178e5=await _0xfca44[_0x468b61(0x87)]['startChat'](_0x14af12);return saveLastChatId(_0x2178e5['id']),console[_0x468b61(0xaf)](JSON[_0x468b61(0x93)]({'chatId':_0x2178e5['id'],'agentId':_0x14af12})),0x0;}catch(_0x30d216){return handleSDKError(_0x30d216,_0x2b71e1),0x1;}}}
@@ -1 +1 @@
1
- const a11_0x9ce262=a11_0x1f6d;(function(_0x562d26,_0x141d93){const _0x30ac56=a11_0x1f6d,_0x48c3e7=_0x562d26();while(!![]){try{const _0x9212b3=parseInt(_0x30ac56(0x135))/0x1*(parseInt(_0x30ac56(0x134))/0x2)+-parseInt(_0x30ac56(0x147))/0x3*(-parseInt(_0x30ac56(0x132))/0x4)+parseInt(_0x30ac56(0x13d))/0x5*(-parseInt(_0x30ac56(0x139))/0x6)+-parseInt(_0x30ac56(0x11d))/0x7*(-parseInt(_0x30ac56(0xe2))/0x8)+parseInt(_0x30ac56(0x133))/0x9+-parseInt(_0x30ac56(0xff))/0xa+-parseInt(_0x30ac56(0x14a))/0xb;if(_0x9212b3===_0x141d93)break;else _0x48c3e7['push'](_0x48c3e7['shift']());}catch(_0x15d606){_0x48c3e7['push'](_0x48c3e7['shift']());}}}(a11_0x41de,0xe8248));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_0x15e99e 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_0x9ce262(0xb9),SETTINGS_BACKUP_FILENAME=a11_0x9ce262(0xe3);function a11_0x41de(){const _0x442d21=['td-skills\x20checked\x20out\x20at\x20tag\x20','Initializing...','Checking\x20Claude\x20Code\x20version...','verbose','install','context','marketplaces','major','6402CKorRT','http://127.0.0.1:','✓\x20td-skills\x20checked\x20out\x20at\x20','11854436jqOcJI','cwd','access_token','oauth','patch','INTERNAL','utf-8','treasure-data','refresh_token','Failed\x20to\x20install\x20plugin\x20\x27','logger','workflow-skills','.claude','already\x20installed','Failed\x20to\x20configure\x20marketplace\x20\x27','plugin','proxy','\x27\x20configured','td-docs','CLAUDE_CODE_USE_VERTEX','log','Failed\x20to\x20spawn\x20claude\x20command:\x20','✓\x20Plugin\x20\x27','2.0.20','fail','--hard','Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20','Configuring\x20MCP\x20server\x20\x27','td-skills','toString','minor','statusLine','pipe','main','toISOString','Command\x20output:\x20','getCurrent','CLAUDE_CODE_USE_BEDROCK','ANTHROPIC_MODEL','apikey','port','sql-skills','already\x20exists','originalSettings','name','user','CLAUDE_CODE_UNSUPPORTED_VERSION','execute','includes','logLevel','Claude\x20Code\x20CLI\x20not\x20found','stop','Installing\x20plugin\x20\x27','Restored\x20default\x20td-skills\x20marketplace','add','site','Failed\x20to\x20remove\x20marketplace\x20\x27','Claude\x20Code\x20version\x20','start','getLogPath','remove','✓\x20Logging\x20to\x20','false','...','899816QHRZWA','.tdx-settings-backup.json','td-skills\x20Plugins','unshift','ANTHROPIC_AUTH_TOKEN','data','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','settings.local.json','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','info','profile','stringify','inherit','✓\x20Settings\x20configured:\x20.claude/settings.local.json','✓\x20MCP\x20server\x20\x27','join','parse','Failed\x20to\x20update\x20marketplace\x20\x27','update','Executing:\x20claude\x20','claude','tdx-skills','apiKey','tdx\x20--profile\x20','text','already\x20configured','Configuring\x20marketplace\x20\x27','message','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','7339140NcXZBL','marketplace','✓\x20Marketplace\x20\x27','llm-proxy','CLAUDE_CODE_NOT_FOUND','Invalid\x20minimum\x20version\x20format:\x20','\x20claude\x20statusline','Warning:\x20Failed\x20to\x20configure\x20','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','\x20is\x20too\x20old\x20(minimum:\x20','error','Marketplace\x20\x27','https://github.com/treasure-data/td-skills','ENOENT','cause','Checking\x20out\x20td-skills\x20','exit','green','https://docs.treasuredata.com/mcp','fetch','command','warn','close','plugins','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','--force','Updating\x20marketplace\x20\x27','checkout','Setup\x20failed','\x27\x20removed','21DxDpXV','trim','debug','origin/main','\x20already\x20configured','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','account_id','git','Claude\x20Code\x20version\x20check\x20failed','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','\x20→\x20','tdx\x20claude\x20statusline','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','\x20or\x20later.','Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup','✓\x20Logs\x20saved\x20to\x20','tdx-managed-proxy','tdx-cli','\x27\x20updated','\x27...','resume','1884QpDHIU','6977547vMfPrB','946394MFHyFk','2TbDHUx','passThroughServer','pid','reset','6LsMOVK','description','\x27:\x20','--version','1508880LjcVzp','env'];a11_0x41de=function(){return _0x442d21;};return a11_0x41de();}function isProcessRunning(_0x575b98){try{return process['kill'](_0x575b98,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x18f91c,_0x202cc8){const _0x4c7af1=a11_0x9ce262;if(!existsSync(_0x18f91c))return;try{const _0x2b8edb=await readFile(_0x18f91c,_0x4c7af1(0x150)),_0x535191=JSON[_0x4c7af1(0xf2)](_0x2b8edb),_0x5a7255=_0x535191['env']||{};for(const _0x19ad52 of['ANTHROPIC_BASE_URL','ANTHROPIC_MODEL',_0x4c7af1(0xe6),_0x4c7af1(0xc7),_0x4c7af1(0xb5)]){_0x202cc8[_0x19ad52]!==undefined?_0x5a7255[_0x19ad52]=_0x202cc8[_0x19ad52]:delete _0x5a7255[_0x19ad52];}_0x202cc8[_0x4c7af1(0xc1)]!==undefined?_0x535191['statusLine']=_0x202cc8[_0x4c7af1(0xc1)]:delete _0x535191[_0x4c7af1(0xc1)],_0x535191[_0x4c7af1(0x13e)]=_0x5a7255,await writeFile(_0x18f91c,JSON[_0x4c7af1(0xed)](_0x535191,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x2288b4){try{await unlink(_0x2288b4);}catch{}}async function recoverFromStaleBackup(_0x22c2b2,_0x129a7c){const _0x109c66=a11_0x9ce262;if(!existsSync(_0x129a7c))return undefined;try{const _0x404d27=await readFile(_0x129a7c,_0x109c66(0x150)),_0x10c7a5=JSON[_0x109c66(0xf2)](_0x404d27);if(isProcessRunning(_0x10c7a5['pid']))return{'liveSessionOriginals':_0x10c7a5[_0x109c66(0xcd)]};return await applyOriginalSettings(_0x22c2b2,_0x10c7a5[_0x109c66(0xcd)]),await safeUnlink(_0x129a7c),undefined;}catch{return await safeUnlink(_0x129a7c),undefined;}}function handleInstallationError(_0x58ccd8,_0x5457b5,_0x3a05c4,_0x2d6683){const _0x491c5c=a11_0x9ce262;errorContains(_0x58ccd8,_0x491c5c(0xcc),_0x491c5c(0x157),_0x491c5c(0xfb))?(_0x3a05c4[_0x491c5c(0xfa)]='✓\x20'+_0x5457b5+_0x491c5c(0x121),_0x2d6683?.[_0x491c5c(0xeb)](_0x5457b5+_0x491c5c(0x121)),_0x58ccd8 instanceof SDKError&&_0x58ccd8[_0x491c5c(0x10d)]&&_0x2d6683?.[_0x491c5c(0x11f)](_0x491c5c(0xc5)+_0x58ccd8['cause']['message'])):(_0x3a05c4[_0x491c5c(0x114)](_0x491c5c(0x106)+_0x5457b5),_0x2d6683?.[_0x491c5c(0x109)](_0x5457b5+'\x20configuration\x20failed',_0x58ccd8));}export function parseVersion(_0x395e1f){const _0x496f5e=a11_0x9ce262,_0x4582a0=_0x395e1f[_0x496f5e(0x11e)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x4582a0)return null;return{'major':parseInt(_0x4582a0[0x1],0xa),'minor':parseInt(_0x4582a0[0x2],0xa),'patch':parseInt(_0x4582a0[0x3],0xa)};}export function compareVersions(_0x1eede4,_0x566e32){const _0x19d16f=a11_0x9ce262;if(_0x1eede4[_0x19d16f(0x146)]!==_0x566e32['major'])return _0x1eede4[_0x19d16f(0x146)]-_0x566e32[_0x19d16f(0x146)];if(_0x1eede4[_0x19d16f(0xc0)]!==_0x566e32[_0x19d16f(0xc0)])return _0x1eede4[_0x19d16f(0xc0)]-_0x566e32['minor'];return _0x1eede4[_0x19d16f(0x14e)]-_0x566e32[_0x19d16f(0x14e)];}async function checkClaudeVersion(_0x56d66f,_0x142d12){const _0x5a642b=a11_0x9ce262;_0x142d12?.['debug']('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x56d66f+')');const _0x13a87d=await executeClaudeCommand([_0x5a642b(0x13c)],undefined,_0x142d12),_0x5b212e=parseVersion(_0x13a87d);if(!_0x5b212e){_0x142d12?.[_0x5a642b(0x114)](_0x5a642b(0x126)+_0x13a87d);return;}const _0x1ac23b=_0x5b212e['major']+'.'+_0x5b212e[_0x5a642b(0xc0)]+'.'+_0x5b212e['patch'],_0x26d9e2=parseVersion(_0x56d66f);if(!_0x26d9e2){_0x142d12?.['warn'](_0x5a642b(0x104)+_0x56d66f);return;}if(compareVersions(_0x5b212e,_0x26d9e2)<0x0){_0x142d12?.[_0x5a642b(0x109)](_0x5a642b(0xdb)+_0x1ac23b+_0x5a642b(0x108)+_0x56d66f+')');throw new SDKError(ErrorCode[_0x5a642b(0xd0)],'Claude\x20Code\x20version\x20'+_0x1ac23b+_0x5a642b(0x117)+_0x56d66f+_0x5a642b(0x12a),undefined,{'helpText':_0x5a642b(0x107)});}_0x142d12?.[_0x5a642b(0x11f)](_0x5a642b(0xdb)+_0x1ac23b+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x4b86fd,_0x5e2486,_0x37ad09){const _0x2a9844=a11_0x9ce262;return _0x37ad09?.[_0x2a9844(0xeb)](_0x2a9844(0xf5)+_0x4b86fd[_0x2a9844(0xf1)]('\x20')),new Promise((_0x4d0254,_0x43eb7b)=>{const _0x20e437=_0x2a9844,_0x357da1=crossSpawn(_0x20e437(0xf6),_0x4b86fd,{'stdio':_0x20e437(0xc2)});let _0x44d1a8='',_0x4401a0='';_0x357da1['stdout']?.['on'](_0x20e437(0xe7),_0x4f18fb=>{const _0x307d20=_0x20e437;_0x44d1a8+=_0x4f18fb[_0x307d20(0xbf)]();}),_0x357da1['stderr']?.['on'](_0x20e437(0xe7),_0x14e759=>{const _0x1cb9b3=_0x20e437;_0x4401a0+=_0x14e759[_0x1cb9b3(0xbf)]();}),_0x357da1['on']('error',_0x3023ed=>{const _0x39fca2=_0x20e437;_0x3023ed['code']===_0x39fca2(0x10c)?(_0x37ad09?.[_0x39fca2(0x109)]('Claude\x20Code\x20CLI\x20not\x20found'),_0x43eb7b(new SDKError(ErrorCode[_0x39fca2(0x103)],_0x39fca2(0xd4),_0x3023ed,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x37ad09?.[_0x39fca2(0x109)]('Command\x20spawn\x20error:\x20'+_0x3023ed[_0x39fca2(0xfd)]),_0x43eb7b(new SDKError(ErrorCode[_0x39fca2(0x14f)],_0x39fca2(0xb7)+_0x3023ed[_0x39fca2(0xfd)],_0x3023ed)));}),_0x357da1['on'](_0x20e437(0x10f),_0x54ed59=>{const _0x490ec1=_0x20e437;if(_0x54ed59===0x0)_0x4d0254(_0x44d1a8);else _0x5e2486?(_0x37ad09?.[_0x490ec1(0x109)]('Command\x20failed\x20(exit\x20'+_0x54ed59+'):\x20claude\x20'+_0x4b86fd[_0x490ec1(0xf1)]('\x20')),_0x43eb7b(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x5e2486,new Error(_0x4401a0)))):_0x4d0254('');});});}async function ensureMcpServer(_0x2a7364,_0x220c84,_0x2429b9,_0x9adbbb,_0x369eac){const _0x2ab530=a11_0x9ce262;_0x9adbbb[_0x2ab530(0xfa)]=_0x2ab530(0xbd)+_0x2a7364+_0x2ab530(0x130),await executeClaudeCommand(['mcp','add',_0x2a7364,_0x220c84,'--transport',_0x2429b9],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x2a7364+'\x27',_0x369eac),_0x9adbbb[_0x2ab530(0xfa)]=_0x2ab530(0xf0)+_0x2a7364+_0x2ab530(0xb3);}export const DEFAULT_TD_SKILLS_URL=a11_0x9ce262(0x10b);export function getTdSkillsRepoUrl(){const _0x2232d1=process.env.TDX_TD_SKILLS_REPO;if(_0x2232d1)return _0x2232d1;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x3039b8,_0x1fabec){const _0x1bdbe2=a11_0x9ce262;try{const _0x435f7a=await executeClaudeCommand([_0x1bdbe2(0xb1),_0x1bdbe2(0x100),'list'],'Failed\x20to\x20list\x20marketplaces',_0x1fabec);if(!_0x435f7a[_0x1bdbe2(0xd2)](_0x3039b8)){_0x1fabec?.[_0x1bdbe2(0x11f)](_0x1bdbe2(0x10a)+_0x3039b8+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand([_0x1bdbe2(0xb1),_0x1bdbe2(0x100),_0x1bdbe2(0xde),_0x3039b8],_0x1bdbe2(0xda)+_0x3039b8+'\x27',_0x1fabec),_0x1fabec?.['info'](_0x1bdbe2(0x10a)+_0x3039b8+_0x1bdbe2(0x11c));}catch(_0x756856){_0x1fabec?.[_0x1bdbe2(0x114)](_0x1bdbe2(0xda)+_0x3039b8+_0x1bdbe2(0x13b)+_0x756856);}}async function restoreDefaultTdSkillsMarketplace(_0x1dbac1){const _0x58f2f4=a11_0x9ce262;try{await removeMarketplace(_0x58f2f4(0xbe),_0x1dbac1),await executeClaudeCommand([_0x58f2f4(0xb1),_0x58f2f4(0x100),_0x58f2f4(0xd8),DEFAULT_TD_SKILLS_URL],undefined,_0x1dbac1),_0x1dbac1?.[_0x58f2f4(0xeb)](_0x58f2f4(0xd7));}catch{}}async function ensureMarketplace(_0x37b6c5,_0x3c4915,_0x3af2e1,_0x1126f5){const _0x561277=a11_0x9ce262;_0x3af2e1[_0x561277(0xfa)]=_0x561277(0xfc)+_0x37b6c5+_0x561277(0x130),await executeClaudeCommand([_0x561277(0xb1),'marketplace',_0x561277(0xd8),_0x3c4915],_0x561277(0xb0)+_0x37b6c5+'\x27',_0x1126f5),_0x3af2e1[_0x561277(0xfa)]='✓\x20Marketplace\x20\x27'+_0x37b6c5+_0x561277(0xb3);}function a11_0x1f6d(_0x2971c6,_0xd21c9c){_0x2971c6=_0x2971c6-0xb0;const _0x41de1e=a11_0x41de();let _0x1f6dba=_0x41de1e[_0x2971c6];return _0x1f6dba;}async function updateMarketplace(_0x19376c,_0x3e5421,_0xdded07){const _0x324a5e=a11_0x9ce262;_0x3e5421['text']=_0x324a5e(0x119)+_0x19376c+_0x324a5e(0x130),await executeClaudeCommand(['plugin',_0x324a5e(0x100),_0x324a5e(0xf4)],_0x324a5e(0xf3)+_0x19376c+'\x27',_0xdded07),_0x3e5421['text']=_0x324a5e(0x101)+_0x19376c+_0x324a5e(0x12f);}async function ensurePlugin(_0x47d406,_0x32d4e4,_0x581179,_0x2c273a){const _0x3ad4bd=a11_0x9ce262;_0x581179['text']=_0x3ad4bd(0xd6)+_0x47d406+_0x3ad4bd(0x130),await executeClaudeCommand(['plugin',_0x3ad4bd(0x143),_0x47d406+'@'+_0x32d4e4],_0x3ad4bd(0x153)+_0x47d406+'\x27',_0x2c273a),_0x581179['text']=_0x3ad4bd(0xb8)+_0x47d406+'\x27\x20installed';}function getClaudeConfigDir(){const _0x3ec88d=a11_0x9ce262;return process.env.CLAUDE_CONFIG_DIR||join(homedir(),_0x3ec88d(0x156));}async function checkoutReleaseTag(_0xfd76d8,_0x48935d,_0x4b1853){const _0x509eb6=a11_0x9ce262,_0x17ac18=join(getClaudeConfigDir(),_0x509eb6(0x116),_0x509eb6(0x145),'td-skills');if(!existsSync(_0x17ac18)){_0x4b1853?.[_0x509eb6(0x11f)](_0x509eb6(0xea));return;}_0x48935d[_0x509eb6(0xfa)]=_0x509eb6(0x10e)+_0xfd76d8+_0x509eb6(0xe1),await execFileAsync(_0x509eb6(0x124),[_0x509eb6(0x112),'origin','--tags',_0x509eb6(0x118)],{'cwd':_0x17ac18});try{await execFileAsync('git',['checkout',_0x509eb6(0xc3)],{'cwd':_0x17ac18});}catch{await execFileAsync(_0x509eb6(0x124),[_0x509eb6(0x11a),'-b','main',_0x509eb6(0x120)],{'cwd':_0x17ac18});}await execFileAsync(_0x509eb6(0x124),[_0x509eb6(0x138),_0x509eb6(0xbb),_0xfd76d8],{'cwd':_0x17ac18}),_0x48935d['text']=_0x509eb6(0x149)+_0xfd76d8,_0x4b1853?.[_0x509eb6(0xeb)](_0x509eb6(0x13f)+_0xfd76d8);}async function createClaudeSettings(_0x12e429,_0x284edb,_0x2efb78){const _0x35c581=a11_0x9ce262,_0x3b78de=join(process[_0x35c581(0x14b)](),_0x35c581(0x156)),_0x5a2ea5=join(_0x3b78de,'settings.local.json'),_0x2415c9=join(_0x3b78de,SETTINGS_BACKUP_FILENAME);await mkdir(_0x3b78de,{'recursive':!![]});const _0x52968c=await recoverFromStaleBackup(_0x5a2ea5,_0x2415c9);let _0x24e45e;if(_0x52968c)_0x24e45e=_0x52968c['liveSessionOriginals'];else{let _0x912a5a={};if(existsSync(_0x5a2ea5))try{const _0x1c40a3=await readFile(_0x5a2ea5,_0x35c581(0x150));_0x912a5a=JSON[_0x35c581(0xf2)](_0x1c40a3);}catch{_0x912a5a={};}const _0x5918de=_0x912a5a[_0x35c581(0x13e)]||{};_0x24e45e={'ANTHROPIC_BASE_URL':_0x5918de['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x5918de[_0x35c581(0xc8)],'ANTHROPIC_AUTH_TOKEN':_0x5918de[_0x35c581(0xe6)],'CLAUDE_CODE_USE_BEDROCK':_0x5918de['CLAUDE_CODE_USE_BEDROCK'],'CLAUDE_CODE_USE_VERTEX':_0x5918de[_0x35c581(0xb5)],'statusLine':_0x912a5a[_0x35c581(0xc1)]};const _0x223c77={'createdAt':new Date()[_0x35c581(0xc4)](),'pid':process[_0x35c581(0x137)],'originalSettings':_0x24e45e};await writeFile(_0x2415c9,JSON[_0x35c581(0xed)](_0x223c77,null,0x2)+'\x0a');}let _0x29f1d9={};if(existsSync(_0x5a2ea5))try{const _0x257a53=await readFile(_0x5a2ea5,_0x35c581(0x150));_0x29f1d9=JSON['parse'](_0x257a53);}catch{_0x29f1d9={};}const _0x303653=_0x29f1d9[_0x35c581(0x13e)]||{},_0x5c6f65={..._0x29f1d9,'env':{..._0x303653,'ANTHROPIC_BASE_URL':_0x35c581(0x148)+_0x12e429,..._0x284edb&&{'ANTHROPIC_MODEL':_0x284edb},'ANTHROPIC_AUTH_TOKEN':_0x35c581(0x12d),'CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0x35c581(0xe0)},'statusLine':{'type':_0x35c581(0x113),'command':_0x2efb78?_0x35c581(0xf9)+_0x2efb78+_0x35c581(0x105):_0x35c581(0x128)}};return await writeFile(_0x5a2ea5,JSON[_0x35c581(0xed)](_0x5c6f65,null,0x2)+'\x0a'),_0x24e45e;}async function restoreClaudeSettings(_0x5404dc){const _0x20b69c=a11_0x9ce262,_0x4946c2=join(process[_0x20b69c(0x14b)](),_0x20b69c(0x156)),_0x5e34b0=join(_0x4946c2,_0x20b69c(0xe9)),_0x547f10=join(_0x4946c2,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x5e34b0,_0x5404dc);try{if(existsSync(_0x547f10)){const _0x4d902c=await readFile(_0x547f10,_0x20b69c(0x150)),_0x5c9855=JSON[_0x20b69c(0xf2)](_0x4d902c);_0x5c9855[_0x20b69c(0x137)]===process[_0x20b69c(0x137)]&&await safeUnlink(_0x547f10);}}catch{}}export class ClaudeCommand extends BaseCommand{[a11_0x9ce262(0xce)]=a11_0x9ce262(0xf6);[a11_0x9ce262(0x13a)]=a11_0x9ce262(0xe8);['passThroughServer'];['originalSettings'];['logger'];[a11_0x9ce262(0xca)];async[a11_0x9ce262(0xd1)](_0x331d0d){const _0x4343d2=a11_0x9ce262,{tdx:_0x581de0,options:_0x11cfdb,args:_0x41f87c}=_0x331d0d;let _0x2248f2=![];try{const _0x589170=_0x11cfdb,_0xf2749c=_0x589170[_0x4343d2(0xb2)]===![],_0x5c296a=_0x589170['continue']===!![],_0xc4117d=_0x589170[_0x4343d2(0x131)]===!![],_0x27732d=[..._0x41f87c];if(_0x5c296a)_0x27732d[_0x4343d2(0xe5)]('-c');else _0xc4117d&&_0x27732d[_0x4343d2(0xe5)]('-r');const _0x16c757=createCommandSpinner(_0x4343d2(0x140),{'verbose':_0x11cfdb[_0x4343d2(0x142)]});_0x16c757[_0x4343d2(0xdc)]();try{if(!_0xf2749c){const _0x5b5be5=_0x11cfdb[_0x4343d2(0xec)];try{const _0x30035a=await _0x581de0[_0x4343d2(0xcf)][_0x4343d2(0xc6)]();_0x30035a['account_id']&&writeCachedAccountInfo(_0x11cfdb[_0x4343d2(0xd9)],_0x30035a[_0x4343d2(0x123)],_0x5b5be5);}catch{}_0x16c757[_0x4343d2(0xfa)]='Initializing\x20proxy\x20logger...',this[_0x4343d2(0x154)]=new TDXLogger(_0x11cfdb[_0x4343d2(0xd3)],!![]),await this[_0x4343d2(0x154)]['init']();const _0x572f07=this[_0x4343d2(0x154)][_0x4343d2(0xdd)]();_0x16c757[_0x4343d2(0xfa)]=_0x4343d2(0xdf)+_0x572f07;const _0x4be543=getEndpoint(_0x11cfdb['site'],_0x4343d2(0x102));_0x16c757[_0x4343d2(0xfa)]='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';let _0x43543d;const _0x312499=await getOAuthTokens(_0x5b5be5);if(_0x312499)_0x43543d={'type':_0x4343d2(0x14d),'accessToken':_0x312499[_0x4343d2(0x14c)],'refreshToken':_0x312499[_0x4343d2(0x152)],'expiresAt':_0x312499['expires_at'],'consoleUrl':getConsoleUrl(_0x11cfdb['site'])};else{if(_0x581de0['context']['apiKey'])_0x43543d={'type':_0x4343d2(0xc9),'apiKey':_0x581de0[_0x4343d2(0x144)][_0x4343d2(0xf8)]};else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4343d2(0x12b));}this[_0x4343d2(0x136)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x4be543,'auth':_0x43543d,'logger':this[_0x4343d2(0x154)],'site':_0x11cfdb[_0x4343d2(0xd9)],'profile':_0x5b5be5}),await this['passThroughServer']['start'](),this[_0x4343d2(0xca)]=this[_0x4343d2(0x136)][_0x4343d2(0xca)],_0x16c757[_0x4343d2(0xfa)]=_0x4343d2(0xfe)+this[_0x4343d2(0xca)]+_0x4343d2(0x127)+_0x4be543,_0x16c757['text']='Creating\x20.claude/settings.local.json...',this[_0x4343d2(0xcd)]=await createClaudeSettings(this[_0x4343d2(0xca)],undefined,_0x5b5be5),_0x16c757['text']=_0x4343d2(0xef);}else _0x16c757[_0x4343d2(0xfa)]=_0x4343d2(0x129);try{_0x16c757[_0x4343d2(0xfa)]=_0x4343d2(0x141),await checkClaudeVersion(MIN_CLAUDE_VERSION,this['logger']),_0x16c757[_0x4343d2(0xfa)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x5d497e){_0x16c757[_0x4343d2(0xba)](_0x4343d2(0x125));throw _0x5d497e;}try{await ensureMcpServer(_0x4343d2(0xb4),_0x4343d2(0x111),'http',_0x16c757,this[_0x4343d2(0x154)]);}catch(_0x276abe){handleInstallationError(_0x276abe,'TD\x20Docs\x20MCP\x20Server',_0x16c757,this['logger']);}try{const _0x4fe5c0=getTdSkillsRepoUrl();_0x2248f2=_0x4fe5c0!==DEFAULT_TD_SKILLS_URL;_0x2248f2&&await removeMarketplace(_0x4343d2(0xbe),this[_0x4343d2(0x154)]);await ensureMarketplace('td-skills',_0x4fe5c0,_0x16c757,this['logger']),await updateMarketplace(_0x4343d2(0xbe),_0x16c757,this[_0x4343d2(0x154)]),await ensurePlugin(_0x4343d2(0xcb),_0x4343d2(0xbe),_0x16c757,this[_0x4343d2(0x154)]),await ensurePlugin(_0x4343d2(0x155),_0x4343d2(0xbe),_0x16c757,this['logger']),await ensurePlugin(_0x4343d2(0xf7),'td-skills',_0x16c757,this['logger']);try{const _0x4c7622=loadReleaseChannel(),_0x59b6a1=await resolveReleaseTag(_0x4c7622,_0x4343d2(0x151),_0x4343d2(0xbe),_0x4343d2(0x12e));_0x59b6a1&&await checkoutReleaseTag(_0x59b6a1,_0x16c757,this[_0x4343d2(0x154)]);}catch(_0x5875bf){this['logger']?.[_0x4343d2(0x114)](_0x4343d2(0xbc)+_0x5875bf);}}catch(_0x591047){handleInstallationError(_0x591047,_0x4343d2(0xe4),_0x16c757,this[_0x4343d2(0x154)]);}_0x16c757[_0x4343d2(0xd5)]();}catch(_0x71008f){_0x16c757[_0x4343d2(0xba)](_0x4343d2(0x11b));throw _0x71008f;}const _0x5854af=await findExecutable('claude');if(!_0x5854af)throw new SDKError(ErrorCode[_0x4343d2(0x103)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x4343d2(0x122)});const _0x10c525={...process.env};!_0xf2749c&&(_0x10c525['ANTHROPIC_BASE_URL']='http://127.0.0.1:'+this[_0x4343d2(0xca)],_0x10c525[_0x4343d2(0xe6)]='tdx-managed-proxy',_0x10c525[_0x4343d2(0xc7)]=_0x4343d2(0xe0),_0x10c525['CLAUDE_CODE_USE_VERTEX']=_0x4343d2(0xe0));const _0x4170db=crossSpawn(_0x5854af,_0x27732d,{'stdio':_0x4343d2(0xee),'env':_0x10c525}),_0x34823d=await new Promise(_0x1d22fa=>{const _0x7d76c9=_0x4343d2;_0x4170db['on'](_0x7d76c9(0x10f),_0x417eb8=>{_0x1d22fa(_0x417eb8||0x0);}),_0x4170db['on'](_0x7d76c9(0x109),_0x4f4f58=>{const _0x10209c=_0x7d76c9;console['error'](a11_0x15e99e['red']('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x4f4f58[_0x10209c(0xfd)])),_0x1d22fa(0x1);});});_0x2248f2&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&(await this[_0x4343d2(0x136)]['stop'](),console[_0x4343d2(0xb6)](a11_0x15e99e[_0x4343d2(0x110)]('✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped')));if(this['logger']){await this[_0x4343d2(0x154)]['close']();const _0x3ee6af=this['logger'][_0x4343d2(0xdd)]();console['log'](a11_0x15e99e[_0x4343d2(0x110)](_0x4343d2(0x12c)+_0x3ee6af));}return this[_0x4343d2(0xcd)]&&(await restoreClaudeSettings(this[_0x4343d2(0xcd)]),console['log'](a11_0x15e99e[_0x4343d2(0x110)]('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x34823d;}catch(_0x17e484){_0x2248f2&&await restoreDefaultTdSkillsMarketplace(this[_0x4343d2(0x154)]);this[_0x4343d2(0x136)]&&await this[_0x4343d2(0x136)][_0x4343d2(0xd5)]();this[_0x4343d2(0x154)]&&await this[_0x4343d2(0x154)][_0x4343d2(0x115)]();this[_0x4343d2(0xcd)]&&await restoreClaudeSettings(this[_0x4343d2(0xcd)]);throw _0x17e484;}}}
1
+ const a11_0x47d108=a11_0x297a;(function(_0x1928ff,_0x2c3cf8){const _0x3d30af=a11_0x297a,_0x51bfc4=_0x1928ff();while(!![]){try{const _0x5a1f32=parseInt(_0x3d30af(0x214))/0x1*(parseInt(_0x3d30af(0x1f8))/0x2)+-parseInt(_0x3d30af(0x218))/0x3+-parseInt(_0x3d30af(0x1ee))/0x4+parseInt(_0x3d30af(0x1fd))/0x5*(-parseInt(_0x3d30af(0x230))/0x6)+parseInt(_0x3d30af(0x257))/0x7+parseInt(_0x3d30af(0x22e))/0x8*(parseInt(_0x3d30af(0x1cf))/0x9)+parseInt(_0x3d30af(0x232))/0xa*(parseInt(_0x3d30af(0x1d5))/0xb);if(_0x5a1f32===_0x2c3cf8)break;else _0x51bfc4['push'](_0x51bfc4['shift']());}catch(_0x1fa313){_0x51bfc4['push'](_0x51bfc4['shift']());}}}(a11_0x27cb,0x50fc5));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_0x1f52ba 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_0x47d108(0x1c7),SETTINGS_BACKUP_FILENAME='.tdx-settings-backup.json';function isProcessRunning(_0x5a072e){const _0x459307=a11_0x47d108;try{return process[_0x459307(0x25a)](_0x5a072e,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x47d2b5,_0x3dc9a0){const _0x2a786b=a11_0x47d108;if(!existsSync(_0x47d2b5))return;try{const _0x1058cc=await readFile(_0x47d2b5,_0x2a786b(0x1f2)),_0x1bae35=JSON[_0x2a786b(0x1e4)](_0x1058cc),_0x5497b9=_0x1bae35[_0x2a786b(0x247)]||{};for(const _0x170108 of['ANTHROPIC_BASE_URL',_0x2a786b(0x1cc),_0x2a786b(0x1e0),_0x2a786b(0x222),_0x2a786b(0x239)]){_0x3dc9a0[_0x170108]!==undefined?_0x5497b9[_0x170108]=_0x3dc9a0[_0x170108]:delete _0x5497b9[_0x170108];}_0x3dc9a0[_0x2a786b(0x24e)]!==undefined?_0x1bae35['statusLine']=_0x3dc9a0[_0x2a786b(0x24e)]:delete _0x1bae35[_0x2a786b(0x24e)],_0x1bae35['env']=_0x5497b9,await writeFile(_0x47d2b5,JSON[_0x2a786b(0x1c4)](_0x1bae35,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x17cbc1){try{await unlink(_0x17cbc1);}catch{}}async function recoverFromStaleBackup(_0x36c79d,_0x38f319){const _0x3a2cc6=a11_0x47d108;if(!existsSync(_0x38f319))return undefined;try{const _0x3f81d9=await readFile(_0x38f319,'utf-8'),_0x559dc6=JSON[_0x3a2cc6(0x1e4)](_0x3f81d9);if(isProcessRunning(_0x559dc6[_0x3a2cc6(0x1f3)]))return{'liveSessionOriginals':_0x559dc6[_0x3a2cc6(0x1ff)]};return await applyOriginalSettings(_0x36c79d,_0x559dc6[_0x3a2cc6(0x1ff)]),await safeUnlink(_0x38f319),undefined;}catch{return await safeUnlink(_0x38f319),undefined;}}function handleInstallationError(_0x4d3f24,_0x4110d2,_0x35cd25,_0x1c2d74){const _0x587190=a11_0x47d108;errorContains(_0x4d3f24,_0x587190(0x20d),_0x587190(0x220),_0x587190(0x235))?(_0x35cd25[_0x587190(0x22d)]='✓\x20'+_0x4110d2+'\x20already\x20configured',_0x1c2d74?.[_0x587190(0x20c)](_0x4110d2+_0x587190(0x204)),_0x4d3f24 instanceof SDKError&&_0x4d3f24[_0x587190(0x22f)]&&_0x1c2d74?.[_0x587190(0x266)]('Command\x20output:\x20'+_0x4d3f24['cause'][_0x587190(0x24c)])):(_0x35cd25['warn'](_0x587190(0x1f1)+_0x4110d2),_0x1c2d74?.[_0x587190(0x1dd)](_0x4110d2+'\x20configuration\x20failed',_0x4d3f24));}export function parseVersion(_0x2cf6b4){const _0x4f9593=a11_0x47d108,_0x5f4d25=_0x2cf6b4[_0x4f9593(0x1da)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x5f4d25)return null;return{'major':parseInt(_0x5f4d25[0x1],0xa),'minor':parseInt(_0x5f4d25[0x2],0xa),'patch':parseInt(_0x5f4d25[0x3],0xa)};}export function compareVersions(_0x82bf68,_0x152519){const _0x14c0ef=a11_0x47d108;if(_0x82bf68[_0x14c0ef(0x21f)]!==_0x152519[_0x14c0ef(0x21f)])return _0x82bf68[_0x14c0ef(0x21f)]-_0x152519[_0x14c0ef(0x21f)];if(_0x82bf68[_0x14c0ef(0x1f5)]!==_0x152519['minor'])return _0x82bf68['minor']-_0x152519[_0x14c0ef(0x1f5)];return _0x82bf68['patch']-_0x152519[_0x14c0ef(0x22b)];}function a11_0x27cb(){const _0x221056=['apiKey','Restored\x20default\x20td-skills\x20marketplace','kill','apikey','logger','Creating\x20.claude/settings.local.json...','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','expires_at','close','join','workflow-skills','update','add','Failed\x20to\x20update\x20marketplace\x20\x27','debug','resume','Configuring\x20MCP\x20server\x20\x27','✓\x20Logs\x20saved\x20to\x20','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Claude\x20Code\x20version\x20','port','fetch','marketplace','stringify','Checking\x20out\x20td-skills\x20','\x27...','2.0.20','tdx\x20--profile\x20','continue','✓\x20Logging\x20to\x20','settings.local.json','ANTHROPIC_MODEL','td-skills\x20checked\x20out\x20at\x20tag\x20','Initializing...','513mrCmtQ','includes','plugin','Installing\x20plugin\x20\x27','install','oauth','44hLeLRI','inherit','site','http','init','trim','Setup\x20failed','sql-skills','error','checkout','...','ANTHROPIC_AUTH_TOKEN','td-skills','Failed\x20to\x20install\x20plugin\x20\x27','Command\x20spawn\x20error:\x20','parse','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','red','--hard','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','INSTALLATION_FAILED','Checking\x20Claude\x20Code\x20version...','refresh_token','log','✓\x20MCP\x20server\x20\x27','2366520LlpFeD','✓\x20Claude\x20Code\x20version\x20OK','code','Warning:\x20Failed\x20to\x20configure\x20','utf-8','pid','\x27\x20configured','minor','claude','INVALID_ARGUMENT','2daEhdb','list','✓\x20Marketplace\x20\x27','td-docs','Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup','110OPLHSJ','tdx-skills','originalSettings','description','marketplaces','context','✓\x20Plugin\x20\x27','\x20already\x20configured','Claude\x20Code\x20version\x20check\x20failed','TD\x20Docs\x20MCP\x20Server','\x27\x20installed','td-skills\x20Plugins','toISOString','http://127.0.0.1:','Configuring\x20marketplace\x20\x27','info','already\x20exists','profile','\x20meets\x20minimum\x20requirement','plugins','access_token','warn','Claude\x20Code\x20CLI\x20not\x20found','233593buYFTZ','getCurrent','--version','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','1686855povqLa','verbose','cwd','data','toString','stop','Updating\x20marketplace\x20\x27','major','already\x20installed','\x20→\x20','CLAUDE_CODE_USE_BEDROCK','command','Failed\x20to\x20list\x20marketplaces','.claude','git','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','passThroughServer','getLogPath','treasure-data','patch','logLevel','text','2648fMHuSX','cause','46014bdENVX','\x27\x20updated','3189020NuWbIR','Failed\x20to\x20remove\x20marketplace\x20\x27','fail','already\x20configured','\x20claude\x20statusline','Failed\x20to\x20launch\x20Claude\x20Code:\x20','✓\x20td-skills\x20checked\x20out\x20at\x20','CLAUDE_CODE_USE_VERTEX','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','stderr','ENOENT','stdout','--force','green','CLAUDE_CODE_NOT_FOUND','Marketplace\x20\x27','origin','Initializing\x20proxy\x20logger...','):\x20claude\x20','ANTHROPIC_BASE_URL','--tags','env','exit','unshift','false','main','message','\x27:\x20','statusLine','tdx-cli','tdx\x20claude\x20statusline','start','✓\x20Settings\x20restored:\x20.claude/settings.local.json','llm-proxy','account_id','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','tdx-managed-proxy','883974xZhNuz'];a11_0x27cb=function(){return _0x221056;};return a11_0x27cb();}async function checkClaudeVersion(_0x5a26a8,_0x9aca08){const _0x479496=a11_0x47d108;_0x9aca08?.[_0x479496(0x266)]('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x5a26a8+')');const _0x7728c4=await executeClaudeCommand([_0x479496(0x216)],undefined,_0x9aca08),_0x392f50=parseVersion(_0x7728c4);if(!_0x392f50){_0x9aca08?.['warn'](_0x479496(0x227)+_0x7728c4);return;}const _0x4503e3=_0x392f50['major']+'.'+_0x392f50[_0x479496(0x1f5)]+'.'+_0x392f50[_0x479496(0x22b)],_0x18871f=parseVersion(_0x5a26a8);if(!_0x18871f){_0x9aca08?.['warn']('Invalid\x20minimum\x20version\x20format:\x20'+_0x5a26a8);return;}if(compareVersions(_0x392f50,_0x18871f)<0x0){_0x9aca08?.[_0x479496(0x1dd)](_0x479496(0x26b)+_0x4503e3+'\x20is\x20too\x20old\x20(minimum:\x20'+_0x5a26a8+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],'Claude\x20Code\x20version\x20'+_0x4503e3+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x5a26a8+'\x20or\x20later.',undefined,{'helpText':_0x479496(0x217)});}_0x9aca08?.[_0x479496(0x266)]('Claude\x20Code\x20version\x20'+_0x4503e3+_0x479496(0x20f));}async function executeClaudeCommand(_0x1aa5b0,_0x27d81c,_0x1979e3){const _0x2f64a0=a11_0x47d108;return _0x1979e3?.[_0x2f64a0(0x20c)]('Executing:\x20claude\x20'+_0x1aa5b0[_0x2f64a0(0x261)]('\x20')),new Promise((_0x18305b,_0x3bfdb8)=>{const _0x32405d=_0x2f64a0,_0x5e527f=crossSpawn(_0x32405d(0x1f6),_0x1aa5b0,{'stdio':'pipe'});let _0x59a526='',_0x4df8a9='';_0x5e527f[_0x32405d(0x23d)]?.['on'](_0x32405d(0x21b),_0x494940=>{const _0x526957=_0x32405d;_0x59a526+=_0x494940[_0x526957(0x21c)]();}),_0x5e527f[_0x32405d(0x23b)]?.['on']('data',_0x237cef=>{const _0x542aab=_0x32405d;_0x4df8a9+=_0x237cef[_0x542aab(0x21c)]();}),_0x5e527f['on']('error',_0x4080f2=>{const _0x43d9d1=_0x32405d;_0x4080f2[_0x43d9d1(0x1f0)]===_0x43d9d1(0x23c)?(_0x1979e3?.['error']('Claude\x20Code\x20CLI\x20not\x20found'),_0x3bfdb8(new SDKError(ErrorCode[_0x43d9d1(0x240)],_0x43d9d1(0x213),_0x4080f2,{'helpText':_0x43d9d1(0x23a)}))):(_0x1979e3?.[_0x43d9d1(0x1dd)](_0x43d9d1(0x1e3)+_0x4080f2[_0x43d9d1(0x24c)]),_0x3bfdb8(new SDKError(ErrorCode['INTERNAL'],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x4080f2[_0x43d9d1(0x24c)],_0x4080f2)));}),_0x5e527f['on'](_0x32405d(0x248),_0x47642a=>{const _0x2378dd=_0x32405d;if(_0x47642a===0x0)_0x18305b(_0x59a526);else _0x27d81c?(_0x1979e3?.['error']('Command\x20failed\x20(exit\x20'+_0x47642a+_0x2378dd(0x244)+_0x1aa5b0[_0x2378dd(0x261)]('\x20')),_0x3bfdb8(new SDKError(ErrorCode[_0x2378dd(0x1e9)],_0x27d81c,new Error(_0x4df8a9)))):_0x18305b('');});});}async function ensureMcpServer(_0xd382b7,_0x4cfbb3,_0xbb796c,_0x14a372,_0x1cddf1){const _0x20179e=a11_0x47d108;_0x14a372[_0x20179e(0x22d)]=_0x20179e(0x268)+_0xd382b7+_0x20179e(0x1c6),await executeClaudeCommand(['mcp','add',_0xd382b7,_0x4cfbb3,'--transport',_0xbb796c],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0xd382b7+'\x27',_0x1cddf1),_0x14a372[_0x20179e(0x22d)]=_0x20179e(0x1ed)+_0xd382b7+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x1e0d03=process.env.TDX_TD_SKILLS_REPO;if(_0x1e0d03)return _0x1e0d03;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x14a2c5,_0x1dc227){const _0x547043=a11_0x47d108;try{const _0x56d6aa=await executeClaudeCommand([_0x547043(0x1d1),_0x547043(0x1c3),_0x547043(0x1f9)],_0x547043(0x224),_0x1dc227);if(!_0x56d6aa[_0x547043(0x1d0)](_0x14a2c5)){_0x1dc227?.[_0x547043(0x266)](_0x547043(0x241)+_0x14a2c5+_0x547043(0x255));return;}await executeClaudeCommand(['plugin',_0x547043(0x1c3),'remove',_0x14a2c5],_0x547043(0x233)+_0x14a2c5+'\x27',_0x1dc227),_0x1dc227?.[_0x547043(0x20c)]('Marketplace\x20\x27'+_0x14a2c5+'\x27\x20removed');}catch(_0x1b8077){_0x1dc227?.[_0x547043(0x212)](_0x547043(0x233)+_0x14a2c5+_0x547043(0x24d)+_0x1b8077);}}async function restoreDefaultTdSkillsMarketplace(_0x1c3f56){const _0x187fc4=a11_0x47d108;try{await removeMarketplace(_0x187fc4(0x1e1),_0x1c3f56),await executeClaudeCommand(['plugin','marketplace',_0x187fc4(0x264),DEFAULT_TD_SKILLS_URL],undefined,_0x1c3f56),_0x1c3f56?.['info'](_0x187fc4(0x259));}catch{}}async function ensureMarketplace(_0x59aa9c,_0x5d3e2c,_0xa6d10c,_0x39c87c){const _0x1acc57=a11_0x47d108;_0xa6d10c[_0x1acc57(0x22d)]=_0x1acc57(0x20b)+_0x59aa9c+_0x1acc57(0x1c6),await executeClaudeCommand([_0x1acc57(0x1d1),_0x1acc57(0x1c3),'add',_0x5d3e2c],'Failed\x20to\x20configure\x20marketplace\x20\x27'+_0x59aa9c+'\x27',_0x39c87c),_0xa6d10c[_0x1acc57(0x22d)]=_0x1acc57(0x1fa)+_0x59aa9c+_0x1acc57(0x1f4);}async function updateMarketplace(_0x500172,_0x5234fe,_0x54f4ea){const _0x5749c8=a11_0x47d108;_0x5234fe[_0x5749c8(0x22d)]=_0x5749c8(0x21e)+_0x500172+'\x27...',await executeClaudeCommand([_0x5749c8(0x1d1),_0x5749c8(0x1c3),_0x5749c8(0x263)],_0x5749c8(0x265)+_0x500172+'\x27',_0x54f4ea),_0x5234fe['text']=_0x5749c8(0x1fa)+_0x500172+_0x5749c8(0x231);}async function ensurePlugin(_0x5411b1,_0x372ec3,_0x1cc72c,_0x376cdb){const _0x52b308=a11_0x47d108;_0x1cc72c[_0x52b308(0x22d)]=_0x52b308(0x1d2)+_0x5411b1+_0x52b308(0x1c6),await executeClaudeCommand([_0x52b308(0x1d1),_0x52b308(0x1d3),_0x5411b1+'@'+_0x372ec3],_0x52b308(0x1e2)+_0x5411b1+'\x27',_0x376cdb),_0x1cc72c['text']=_0x52b308(0x203)+_0x5411b1+_0x52b308(0x207);}function getClaudeConfigDir(){const _0xaeb43d=a11_0x47d108;return process.env.CLAUDE_CONFIG_DIR||join(homedir(),_0xaeb43d(0x225));}async function checkoutReleaseTag(_0x3590c0,_0x1a2a91,_0x4fcbd7){const _0x44e463=a11_0x47d108,_0x117cce=join(getClaudeConfigDir(),_0x44e463(0x210),_0x44e463(0x201),_0x44e463(0x1e1));if(!existsSync(_0x117cce)){_0x4fcbd7?.[_0x44e463(0x266)]('td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout');return;}_0x1a2a91['text']=_0x44e463(0x1c5)+_0x3590c0+_0x44e463(0x1df),await execFileAsync(_0x44e463(0x226),[_0x44e463(0x26d),_0x44e463(0x242),_0x44e463(0x246),_0x44e463(0x23e)],{'cwd':_0x117cce});try{await execFileAsync(_0x44e463(0x226),[_0x44e463(0x1de),_0x44e463(0x24b)],{'cwd':_0x117cce});}catch{await execFileAsync(_0x44e463(0x226),[_0x44e463(0x1de),'-b','main','origin/main'],{'cwd':_0x117cce});}await execFileAsync(_0x44e463(0x226),['reset',_0x44e463(0x1e7),_0x3590c0],{'cwd':_0x117cce}),_0x1a2a91[_0x44e463(0x22d)]=_0x44e463(0x238)+_0x3590c0,_0x4fcbd7?.[_0x44e463(0x20c)](_0x44e463(0x1cd)+_0x3590c0);}function a11_0x297a(_0x4adabf,_0xfc3e4a){_0x4adabf=_0x4adabf-0x1c3;const _0x27cb88=a11_0x27cb();let _0x297a34=_0x27cb88[_0x4adabf];return _0x297a34;}async function createClaudeSettings(_0xa3f339,_0x5d92e0,_0x150b76){const _0x1568c9=a11_0x47d108,_0x403d85=join(process[_0x1568c9(0x21a)](),_0x1568c9(0x225)),_0x4caccd=join(_0x403d85,_0x1568c9(0x1cb)),_0x40eb02=join(_0x403d85,SETTINGS_BACKUP_FILENAME);await mkdir(_0x403d85,{'recursive':!![]});const _0x660d33=await recoverFromStaleBackup(_0x4caccd,_0x40eb02);let _0x593682;if(_0x660d33)_0x593682=_0x660d33['liveSessionOriginals'];else{let _0x48d364={};if(existsSync(_0x4caccd))try{const _0x11aa46=await readFile(_0x4caccd,'utf-8');_0x48d364=JSON[_0x1568c9(0x1e4)](_0x11aa46);}catch{_0x48d364={};}const _0x1c3385=_0x48d364['env']||{};_0x593682={'ANTHROPIC_BASE_URL':_0x1c3385[_0x1568c9(0x245)],'ANTHROPIC_MODEL':_0x1c3385[_0x1568c9(0x1cc)],'ANTHROPIC_AUTH_TOKEN':_0x1c3385[_0x1568c9(0x1e0)],'CLAUDE_CODE_USE_BEDROCK':_0x1c3385[_0x1568c9(0x222)],'CLAUDE_CODE_USE_VERTEX':_0x1c3385[_0x1568c9(0x239)],'statusLine':_0x48d364[_0x1568c9(0x24e)]};const _0x33b053={'createdAt':new Date()[_0x1568c9(0x209)](),'pid':process['pid'],'originalSettings':_0x593682};await writeFile(_0x40eb02,JSON[_0x1568c9(0x1c4)](_0x33b053,null,0x2)+'\x0a');}let _0x262bd3={};if(existsSync(_0x4caccd))try{const _0x275a64=await readFile(_0x4caccd,_0x1568c9(0x1f2));_0x262bd3=JSON[_0x1568c9(0x1e4)](_0x275a64);}catch{_0x262bd3={};}const _0x2afae0=_0x262bd3[_0x1568c9(0x247)]||{},_0x2e3e92={..._0x262bd3,'env':{..._0x2afae0,'ANTHROPIC_BASE_URL':_0x1568c9(0x20a)+_0xa3f339,..._0x5d92e0&&{'ANTHROPIC_MODEL':_0x5d92e0},'ANTHROPIC_AUTH_TOKEN':_0x1568c9(0x256),'CLAUDE_CODE_USE_BEDROCK':_0x1568c9(0x24a),'CLAUDE_CODE_USE_VERTEX':'false'},'statusLine':{'type':_0x1568c9(0x223),'command':_0x150b76?_0x1568c9(0x1c8)+_0x150b76+_0x1568c9(0x236):_0x1568c9(0x250)}};return await writeFile(_0x4caccd,JSON[_0x1568c9(0x1c4)](_0x2e3e92,null,0x2)+'\x0a'),_0x593682;}async function restoreClaudeSettings(_0xda5bdd){const _0x275cdc=a11_0x47d108,_0x992da1=join(process[_0x275cdc(0x21a)](),'.claude'),_0x4d9c77=join(_0x992da1,_0x275cdc(0x1cb)),_0x325bf7=join(_0x992da1,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x4d9c77,_0xda5bdd);try{if(existsSync(_0x325bf7)){const _0x47bdee=await readFile(_0x325bf7,_0x275cdc(0x1f2)),_0x3be444=JSON[_0x275cdc(0x1e4)](_0x47bdee);_0x3be444[_0x275cdc(0x1f3)]===process[_0x275cdc(0x1f3)]&&await safeUnlink(_0x325bf7);}}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a11_0x47d108(0x1f6);[a11_0x47d108(0x200)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';[a11_0x47d108(0x228)];[a11_0x47d108(0x1ff)];['logger'];[a11_0x47d108(0x26c)];async['execute'](_0x12fe5a){const _0x206de8=a11_0x47d108,{tdx:_0x4534fc,options:_0x28aea0,args:_0x596e49}=_0x12fe5a;let _0x59c884=![];try{const _0x20a6c1=_0x28aea0,_0x170acb=_0x20a6c1['proxy']===![],_0xe4d7df=_0x20a6c1[_0x206de8(0x1c9)]===!![],_0x492152=_0x20a6c1[_0x206de8(0x267)]===!![],_0x46553f=[..._0x596e49];if(_0xe4d7df)_0x46553f[_0x206de8(0x249)]('-c');else _0x492152&&_0x46553f[_0x206de8(0x249)]('-r');const _0x11a784=createCommandSpinner(_0x206de8(0x1ce),{'verbose':_0x28aea0[_0x206de8(0x219)]});_0x11a784[_0x206de8(0x251)]();try{if(!_0x170acb){const _0x3c15f5=_0x28aea0[_0x206de8(0x20e)];try{const _0x4a9bc3=await _0x4534fc['user'][_0x206de8(0x215)]();_0x4a9bc3[_0x206de8(0x254)]&&writeCachedAccountInfo(_0x28aea0['site'],_0x4a9bc3[_0x206de8(0x254)],_0x3c15f5);}catch{}_0x11a784['text']=_0x206de8(0x243),this[_0x206de8(0x25c)]=new TDXLogger(_0x28aea0[_0x206de8(0x22c)],!![]),await this[_0x206de8(0x25c)][_0x206de8(0x1d9)]();const _0x39d1f3=this['logger'][_0x206de8(0x229)]();_0x11a784[_0x206de8(0x22d)]=_0x206de8(0x1ca)+_0x39d1f3;const _0x435e5c=getEndpoint(_0x28aea0['site'],_0x206de8(0x253));_0x11a784[_0x206de8(0x22d)]='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';let _0x23bec8;const _0x34e5a8=await getOAuthTokens(_0x3c15f5);if(_0x34e5a8)_0x23bec8={'type':_0x206de8(0x1d4),'accessToken':_0x34e5a8[_0x206de8(0x211)],'refreshToken':_0x34e5a8[_0x206de8(0x1eb)],'expiresAt':_0x34e5a8[_0x206de8(0x25f)],'consoleUrl':getConsoleUrl(_0x28aea0[_0x206de8(0x1d7)])};else{if(_0x4534fc['context'][_0x206de8(0x258)])_0x23bec8={'type':_0x206de8(0x25b),'apiKey':_0x4534fc[_0x206de8(0x202)][_0x206de8(0x258)]};else throw new SDKError(ErrorCode[_0x206de8(0x1f7)],_0x206de8(0x1fc));}this[_0x206de8(0x228)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x435e5c,'auth':_0x23bec8,'logger':this[_0x206de8(0x25c)],'site':_0x28aea0[_0x206de8(0x1d7)],'profile':_0x3c15f5}),await this['passThroughServer'][_0x206de8(0x251)](),this['port']=this[_0x206de8(0x228)][_0x206de8(0x26c)],_0x11a784[_0x206de8(0x22d)]=_0x206de8(0x1e5)+this[_0x206de8(0x26c)]+_0x206de8(0x221)+_0x435e5c,_0x11a784['text']=_0x206de8(0x25d),this[_0x206de8(0x1ff)]=await createClaudeSettings(this[_0x206de8(0x26c)],undefined,_0x3c15f5),_0x11a784[_0x206de8(0x22d)]=_0x206de8(0x26a);}else _0x11a784['text']=_0x206de8(0x1e8);try{_0x11a784[_0x206de8(0x22d)]=_0x206de8(0x1ea),await checkClaudeVersion(MIN_CLAUDE_VERSION,this['logger']),_0x11a784[_0x206de8(0x22d)]=_0x206de8(0x1ef);}catch(_0x97fa40){_0x11a784[_0x206de8(0x234)](_0x206de8(0x205));throw _0x97fa40;}try{await ensureMcpServer(_0x206de8(0x1fb),'https://docs.treasuredata.com/mcp',_0x206de8(0x1d8),_0x11a784,this[_0x206de8(0x25c)]);}catch(_0x16d41f){handleInstallationError(_0x16d41f,_0x206de8(0x206),_0x11a784,this[_0x206de8(0x25c)]);}try{const _0x4249cb=getTdSkillsRepoUrl();_0x59c884=_0x4249cb!==DEFAULT_TD_SKILLS_URL;_0x59c884&&await removeMarketplace('td-skills',this[_0x206de8(0x25c)]);await ensureMarketplace(_0x206de8(0x1e1),_0x4249cb,_0x11a784,this[_0x206de8(0x25c)]),await updateMarketplace(_0x206de8(0x1e1),_0x11a784,this[_0x206de8(0x25c)]),await ensurePlugin(_0x206de8(0x1dc),_0x206de8(0x1e1),_0x11a784,this[_0x206de8(0x25c)]),await ensurePlugin(_0x206de8(0x262),'td-skills',_0x11a784,this[_0x206de8(0x25c)]),await ensurePlugin(_0x206de8(0x1fe),_0x206de8(0x1e1),_0x11a784,this[_0x206de8(0x25c)]);try{const _0x162603=loadReleaseChannel(),_0x8c2b32=await resolveReleaseTag(_0x162603,_0x206de8(0x22a),'td-skills',_0x206de8(0x24f));_0x8c2b32&&await checkoutReleaseTag(_0x8c2b32,_0x11a784,this[_0x206de8(0x25c)]);}catch(_0x1a1653){this['logger']?.[_0x206de8(0x212)]('Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20'+_0x1a1653);}}catch(_0xaa1181){handleInstallationError(_0xaa1181,_0x206de8(0x208),_0x11a784,this[_0x206de8(0x25c)]);}_0x11a784[_0x206de8(0x21d)]();}catch(_0x90e25a){_0x11a784[_0x206de8(0x234)](_0x206de8(0x1db));throw _0x90e25a;}const _0xa08067=await findExecutable(_0x206de8(0x1f6));if(!_0xa08067)throw new SDKError(ErrorCode[_0x206de8(0x240)],_0x206de8(0x213),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x4f093b={...process.env};!_0x170acb&&(_0x4f093b['ANTHROPIC_BASE_URL']=_0x206de8(0x20a)+this['port'],_0x4f093b['ANTHROPIC_AUTH_TOKEN']=_0x206de8(0x256),_0x4f093b[_0x206de8(0x222)]='false',_0x4f093b[_0x206de8(0x239)]=_0x206de8(0x24a));const _0x4881e6=crossSpawn(_0xa08067,_0x46553f,{'stdio':_0x206de8(0x1d6),'env':_0x4f093b}),_0x37eb33=await new Promise(_0x58db69=>{const _0x3d29ae=_0x206de8;_0x4881e6['on'](_0x3d29ae(0x248),_0x426662=>{_0x58db69(_0x426662||0x0);}),_0x4881e6['on']('error',_0x2f685b=>{const _0x199a7a=_0x3d29ae;console[_0x199a7a(0x1dd)](a11_0x1f52ba[_0x199a7a(0x1e6)](_0x199a7a(0x237)+_0x2f685b[_0x199a7a(0x24c)])),_0x58db69(0x1);});});_0x59c884&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0x206de8(0x228)]&&(await this[_0x206de8(0x228)]['stop'](),console[_0x206de8(0x1ec)](a11_0x1f52ba['green'](_0x206de8(0x25e))));if(this[_0x206de8(0x25c)]){await this[_0x206de8(0x25c)][_0x206de8(0x260)]();const _0x51ca3a=this['logger']['getLogPath']();console['log'](a11_0x1f52ba[_0x206de8(0x23f)](_0x206de8(0x269)+_0x51ca3a));}return this[_0x206de8(0x1ff)]&&(await restoreClaudeSettings(this[_0x206de8(0x1ff)]),console['log'](a11_0x1f52ba['green'](_0x206de8(0x252)))),_0x37eb33;}catch(_0x1e00fe){_0x59c884&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0x206de8(0x228)]&&await this[_0x206de8(0x228)][_0x206de8(0x21d)]();this[_0x206de8(0x25c)]&&await this[_0x206de8(0x25c)]['close']();this[_0x206de8(0x1ff)]&&await restoreClaudeSettings(this['originalSettings']);throw _0x1e00fe;}}}
@@ -1 +1 @@
1
- const a12_0x2b436b=a12_0x4b9b;(function(_0xa40241,_0x17a122){const _0x2261ac=a12_0x4b9b,_0x162c20=_0xa40241();while(!![]){try{const _0x4d37a7=-parseInt(_0x2261ac(0x1e6))/0x1+parseInt(_0x2261ac(0x1f4))/0x2+parseInt(_0x2261ac(0x1e3))/0x3*(-parseInt(_0x2261ac(0x1f3))/0x4)+-parseInt(_0x2261ac(0x1cc))/0x5*(parseInt(_0x2261ac(0x1d5))/0x6)+-parseInt(_0x2261ac(0x1ec))/0x7+-parseInt(_0x2261ac(0x1e4))/0x8*(-parseInt(_0x2261ac(0x1e1))/0x9)+parseInt(_0x2261ac(0x1e8))/0xa;if(_0x4d37a7===_0x17a122)break;else _0x162c20['push'](_0x162c20['shift']());}catch(_0x55088f){_0x162c20['push'](_0x162c20['shift']());}}}(a12_0x2ed0,0x9a787));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(_0x4bb9ab=0x64){return new Promise(_0x3748c7=>{const _0x4ea6f4=a12_0x4b9b;let _0x5cbcba='',_0xec2733=![];const _0x45a202=createInterface({'input':process['stdin'],'terminal':![]}),_0x418e90=_0x4a118b=>{const _0x4fc857=a12_0x4b9b;if(_0xec2733)return;_0xec2733=!![],clearTimeout(_0xc3dec0),_0x45a202[_0x4fc857(0x1df)](),_0x3748c7(_0x4a118b);},_0xc3dec0=setTimeout(()=>{_0x418e90(null);},_0x4bb9ab);_0x45a202['on'](_0x4ea6f4(0x1f0),_0x513e41=>{_0x5cbcba+=_0x513e41;}),_0x45a202['on'](_0x4ea6f4(0x1df),()=>{const _0x49153e=_0x4ea6f4;if(_0xec2733)return;try{const _0x4915ac=JSON[_0x49153e(0x1d8)](_0x5cbcba);_0x418e90(_0x4915ac);}catch{_0x418e90(null);}});});}function a12_0x2ed0(){const _0x58bfe6=['log','execute','push','\x20-\x20','description','site','close','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','18HvVULw','tdx\x20','281058QGECPu','4940848LvWRbj','🪙\x20credit:\x20','1169404ooxJzz','Claude','19353110YsGjFw','\x20today\x20/\x20','sessionCredits','🧠\x20','3186785ANpWTj','profile','accountId','round','line','todayCredits','💎\x20tdx\x20-\x20Claude','44oJroLX','807048KvhGwQ','statusline','11265bGLqns','options','monthCredits','toFixed','tdx','cache_creation_input_tokens','session_id','context_window','\x20session\x20/\x20','762IATEHd','current_usage','join','parse'];a12_0x2ed0=function(){return _0x58bfe6;};return a12_0x2ed0();}function a12_0x4b9b(_0x38d559,_0x13a6f5){_0x38d559=_0x38d559-0x1cc;const _0x2ed0b8=a12_0x2ed0();let _0x4b9b00=_0x2ed0b8[_0x38d559];return _0x4b9b00;}function formatCredits(_0x57abc7){const _0x3d9581=a12_0x4b9b;return _0x57abc7[_0x3d9581(0x1cf)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a12_0x2b436b(0x1f5);[a12_0x2b436b(0x1dd)]=a12_0x2b436b(0x1e0);async[a12_0x2b436b(0x1da)](_0x77c34b){const _0x2be021=a12_0x2b436b;try{const _0x548e16=await readStdinJson();if(!_0x548e16?.[_0x2be021(0x1d2)])return console[_0x2be021(0x1d9)](_0x2be021(0x1f2)),0x0;const _0x513f51=_0x548e16[_0x2be021(0x1d2)],_0x3ce898=_0x548e16['model']?.['id']||'',_0x2c9422=_0x548e16[_0x2be021(0x1ed)]||_0x77c34b[_0x2be021(0x1cd)]['profile'],_0x19fb27=await getUsageStats(_0x513f51,_0x2c9422),_0x368e94=[],_0x2eea56=readCachedAccountInfo(_0x2c9422),_0x32e656=_0x2eea56?_0x2be021(0x1e2)+_0x2eea56[_0x2be021(0x1de)]+':'+_0x2eea56[_0x2be021(0x1ee)]:_0x2be021(0x1d0),_0x3f1f55=_0x3ce898?getModelDisplayName(_0x3ce898):_0x2be021(0x1e7);_0x368e94['push']('💎\x20'+_0x32e656+_0x2be021(0x1dc)+_0x3f1f55);const _0xea26f3=formatCredits(_0x19fb27[_0x2be021(0x1ea)]),_0x1b082f=formatCredits(_0x19fb27[_0x2be021(0x1f1)]),_0x50312b=formatCredits(_0x19fb27[_0x2be021(0x1ce)]);_0x368e94[_0x2be021(0x1db)](_0x2be021(0x1e5)+_0xea26f3+_0x2be021(0x1d4)+_0x1b082f+_0x2be021(0x1e9)+_0x50312b+'\x20month');const _0x41e629=_0x548e16[_0x2be021(0x1d3)],_0x488aea=_0x41e629?.[_0x2be021(0x1d6)];if(_0x488aea&&_0x41e629?.['used_percentage']!=null){const _0x32fb2b=_0x488aea['input_tokens']+_0x488aea[_0x2be021(0x1d1)]+_0x488aea['cache_read_input_tokens'],_0x288581=formatTokenCount(_0x32fb2b),_0x23362e=Math[_0x2be021(0x1ef)](_0x41e629['used_percentage']);_0x368e94[_0x2be021(0x1db)](_0x2be021(0x1eb)+_0x288581+'\x20('+_0x23362e+'%)');}return console[_0x2be021(0x1d9)](_0x368e94[_0x2be021(0x1d7)]('\x20|\x20')),0x0;}catch{return console[_0x2be021(0x1d9)](_0x2be021(0x1f2)),0x0;}}}
1
+ const a12_0x23a84f=a12_0x2baa;(function(_0x3f4cf1,_0x1ab0c4){const _0x40af14=a12_0x2baa,_0x4c05ef=_0x3f4cf1();while(!![]){try{const _0x37c36f=parseInt(_0x40af14(0x1b6))/0x1*(parseInt(_0x40af14(0x1c1))/0x2)+-parseInt(_0x40af14(0x1c2))/0x3+parseInt(_0x40af14(0x1cb))/0x4+-parseInt(_0x40af14(0x1cd))/0x5*(-parseInt(_0x40af14(0x1c8))/0x6)+-parseInt(_0x40af14(0x1b8))/0x7+parseInt(_0x40af14(0x1c0))/0x8*(parseInt(_0x40af14(0x1c6))/0x9)+-parseInt(_0x40af14(0x1ca))/0xa;if(_0x37c36f===_0x1ab0c4)break;else _0x4c05ef['push'](_0x4c05ef['shift']());}catch(_0x54f600){_0x4c05ef['push'](_0x4c05ef['shift']());}}}(a12_0x316c,0xa820b));function a12_0x316c(){const _0x29425b=['monthCredits','sessionCredits','659277vwlvpx','line','24AykXqL','model','10657250uWgjeL','3707684jsAfMM','round','822845NSVuKT','tdx\x20','description','close','parse','toFixed','statusline','session_id','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','context_window','options','name','current_usage','stdin','accountId','input_tokens','\x20today\x20/\x20','log','join','💎\x20tdx\x20-\x20Claude','147835EtILMB','\x20|\x20','1130101OJMuDb','\x20-\x20','todayCredits','push','🧠\x20','used_percentage','profile','🪙\x20credit:\x20','48RtPkUH','2AXPGuJ','770193REYZLz','\x20session\x20/\x20'];a12_0x316c=function(){return _0x29425b;};return a12_0x316c();}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';function a12_0x2baa(_0x5063d7,_0x3e1ec1){_0x5063d7=_0x5063d7-0x1ae;const _0x316c15=a12_0x316c();let _0x2baae2=_0x316c15[_0x5063d7];return _0x2baae2;}async function readStdinJson(_0x530533=0x64){return new Promise(_0x3ab502=>{const _0x15811f=a12_0x2baa;let _0x25fbee='',_0x232baf=![];const _0x174b26=createInterface({'input':process[_0x15811f(0x1af)],'terminal':![]}),_0x233dc6=_0x390b77=>{const _0x482e2f=_0x15811f;if(_0x232baf)return;_0x232baf=!![],clearTimeout(_0x14120c),_0x174b26[_0x482e2f(0x1d0)](),_0x3ab502(_0x390b77);},_0x14120c=setTimeout(()=>{_0x233dc6(null);},_0x530533);_0x174b26['on'](_0x15811f(0x1c7),_0x43d5da=>{_0x25fbee+=_0x43d5da;}),_0x174b26['on'](_0x15811f(0x1d0),()=>{const _0x5091b0=_0x15811f;if(_0x232baf)return;try{const _0x3dd482=JSON[_0x5091b0(0x1d1)](_0x25fbee);_0x233dc6(_0x3dd482);}catch{_0x233dc6(null);}});});}function formatCredits(_0x2de0cc){const _0x1e01f8=a12_0x2baa;return _0x2de0cc[_0x1e01f8(0x1d2)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a12_0x23a84f(0x1d8)]=a12_0x23a84f(0x1d3);[a12_0x23a84f(0x1cf)]=a12_0x23a84f(0x1d5);async['execute'](_0x5e5595){const _0x31181b=a12_0x23a84f;try{const _0x4be75b=await readStdinJson();if(!_0x4be75b?.[_0x31181b(0x1d4)])return console[_0x31181b(0x1b3)](_0x31181b(0x1b5)),0x0;const _0x4e07d6=_0x4be75b[_0x31181b(0x1d4)],_0x5a6665=_0x4be75b[_0x31181b(0x1c9)]?.['id']||'',_0x14c6e3=_0x4be75b[_0x31181b(0x1be)]||_0x5e5595[_0x31181b(0x1d7)][_0x31181b(0x1be)],_0x31ab47=await getUsageStats(_0x4e07d6,_0x14c6e3),_0x127aae=[],_0x4c05aa=readCachedAccountInfo(_0x14c6e3),_0x34e962=_0x4c05aa?_0x31181b(0x1ce)+_0x4c05aa['site']+':'+_0x4c05aa[_0x31181b(0x1b0)]:'tdx',_0x2f6b4e=_0x5a6665?getModelDisplayName(_0x5a6665):'Claude';_0x127aae[_0x31181b(0x1bb)]('💎\x20'+_0x34e962+_0x31181b(0x1b9)+_0x2f6b4e);const _0x502c73=formatCredits(_0x31ab47[_0x31181b(0x1c5)]),_0x3cd6e5=formatCredits(_0x31ab47[_0x31181b(0x1ba)]),_0x59eb6c=formatCredits(_0x31ab47[_0x31181b(0x1c4)]);_0x127aae[_0x31181b(0x1bb)](_0x31181b(0x1bf)+_0x502c73+_0x31181b(0x1c3)+_0x3cd6e5+_0x31181b(0x1b2)+_0x59eb6c+'\x20month');const _0x51c8a8=_0x4be75b[_0x31181b(0x1d6)],_0xbee10c=_0x51c8a8?.[_0x31181b(0x1ae)];if(_0xbee10c&&_0x51c8a8?.[_0x31181b(0x1bd)]!=null){const _0x1a3937=_0xbee10c[_0x31181b(0x1b1)]+_0xbee10c['cache_creation_input_tokens']+_0xbee10c['cache_read_input_tokens'],_0x2cd45c=formatTokenCount(_0x1a3937),_0x5c9946=Math[_0x31181b(0x1cc)](_0x51c8a8[_0x31181b(0x1bd)]);_0x127aae[_0x31181b(0x1bb)](_0x31181b(0x1bc)+_0x2cd45c+'\x20('+_0x5c9946+'%)');}return console[_0x31181b(0x1b3)](_0x127aae[_0x31181b(0x1b4)](_0x31181b(0x1b7))),0x0;}catch{return console[_0x31181b(0x1b3)]('💎\x20tdx\x20-\x20Claude'),0x0;}}}
@@ -1 +1 @@
1
- function a13_0x39f6(){const _0x49cc18=['error','red','format','length','\x20days\x20ago','dim','default','toLocaleTimeString','\x20credits','numeric','entryCount','profile','totalCredits','515SJmddS','bold','outputTable','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','getTime','13330IDzTZf','4688FQyPrE','repeat','message','jsonl','execute','Today','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','lastUsedAt','round','1306752YJNuHl','1492760VsSCMM','\x20\x20Total:\x20\x20\x20','yesterday','332143bglJka','Last\x20Used','Total','(default)','description','15323tYpkvE','profileCount','monthCredits','today\x20','source','short','Usage\x20by\x20Source','map','todayCredits','Unknown\x20error','credits','8cYlJjF','Source','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','toLocaleDateString','log','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','toFixed','padStart','padEnd','\x20\x20Today:\x20\x20\x20','2-digit','1576674tPhcTx','4715109buQdtn','14fkZhxf','usage','\x20\x20Month:\x20\x20\x20','Error:\x20','en-US','name','Requests','json','cyan'];a13_0x39f6=function(){return _0x49cc18;};return a13_0x39f6();}const a13_0xbff46d=a13_0x576e;(function(_0x29beab,_0x365f4b){const _0x3214ec=a13_0x576e,_0x23bdf6=_0x29beab();while(!![]){try{const _0x3b58ba=-parseInt(_0x3214ec(0x1b1))/0x1+-parseInt(_0x3214ec(0x1f4))/0x2+parseInt(_0x3214ec(0x1cc))/0x3+-parseInt(_0x3214ec(0x1ea))/0x4*(-parseInt(_0x3214ec(0x1e4))/0x5)+parseInt(_0x3214ec(0x1f3))/0x6*(-parseInt(_0x3214ec(0x1ce))/0x7)+parseInt(_0x3214ec(0x1c1))/0x8*(-parseInt(_0x3214ec(0x1cd))/0x9)+-parseInt(_0x3214ec(0x1e9))/0xa*(-parseInt(_0x3214ec(0x1b6))/0xb);if(_0x3b58ba===_0x365f4b)break;else _0x23bdf6['push'](_0x23bdf6['shift']());}catch(_0x4d93b5){_0x23bdf6['push'](_0x23bdf6['shift']());}}}(a13_0x39f6,0x718ef));function a13_0x576e(_0x38e978,_0x5abca2){_0x38e978=_0x38e978-0x1af;const _0x39f6ef=a13_0x39f6();let _0x576edd=_0x39f6ef[_0x38e978];return _0x576edd;}import a13_0x1838e3 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x924cea){const _0x3440fa=a13_0x576e;return _0x924cea[_0x3440fa(0x1c7)](0x2);}function formatLastUsed(_0x279a54){const _0x324772=a13_0x576e;if(!_0x279a54)return'never';const _0x5281af=new Date(_0x279a54),_0x479a88=new Date(),_0x1271d8=_0x5281af[_0x324772(0x1c4)]('en-CA'),_0x52494f=_0x479a88[_0x324772(0x1c4)]('en-CA');if(_0x1271d8===_0x52494f)return _0x324772(0x1b9)+_0x5281af[_0x324772(0x1de)](_0x324772(0x1d2),{'hour':'2-digit','minute':_0x324772(0x1cb)});const _0x45210e=new Date(_0x1271d8),_0x5ee2ce=new Date(_0x52494f),_0x5c0aa2=Math[_0x324772(0x1f2)]((_0x5ee2ce[_0x324772(0x1e8)]()-_0x45210e[_0x324772(0x1e8)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5c0aa2===0x1)return _0x324772(0x1b0);else return _0x5c0aa2>0x1&&_0x5c0aa2<0x7?_0x5c0aa2+_0x324772(0x1db):_0x5281af['toLocaleDateString'](_0x324772(0x1d2),{'month':_0x324772(0x1bb),'day':_0x324772(0x1e0)});}export class ClaudeUsageCommand extends BaseCommand{[a13_0xbff46d(0x1d3)]=a13_0xbff46d(0x1cf);[a13_0xbff46d(0x1b5)]=a13_0xbff46d(0x1e7);async[a13_0xbff46d(0x1ee)](_0x1c9cda){const _0x1f7c51=a13_0xbff46d,{options:_0xca813}=_0x1c9cda,_0x33495b=_0xca813[_0x1f7c51(0x1d9)]===_0x1f7c51(0x1d5)||_0xca813[_0x1f7c51(0x1d9)]===_0x1f7c51(0x1ed)||_0xca813[_0x1f7c51(0x1d5)];try{const [_0x4a3543,_0x4d3c18,_0x286557]=await Promise['all']([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x33495b?await this['outputStructured'](_0x4a3543,_0x4d3c18,_0x286557,_0xca813):this['outputTable'](_0x4a3543,_0x4d3c18,_0x286557),0x0;}catch(_0x36f352){const _0x59a129=_0x36f352 instanceof Error?_0x36f352[_0x1f7c51(0x1ec)]:_0x1f7c51(0x1bf);return console[_0x1f7c51(0x1d7)](a13_0x1838e3[_0x1f7c51(0x1d8)](_0x1f7c51(0x1d1)+_0x59a129)),0x1;}}async['outputStructured'](_0x39b847,_0x5770d5,_0x389a5d,_0x20b614){const _0x25743b=a13_0xbff46d,_0x39ee52={'summary':{'todayCredits':_0x389a5d[_0x25743b(0x1be)],'monthCredits':_0x389a5d['monthCredits'],'totalCredits':_0x389a5d['totalCredits'],'profileCount':_0x389a5d[_0x25743b(0x1b7)]},'profiles':_0x39b847[_0x25743b(0x1bd)](_0x3143f8=>({'profile':_0x3143f8['profile'],'credits':_0x3143f8[_0x25743b(0x1c0)],'requests':_0x3143f8[_0x25743b(0x1e1)],'lastUsedAt':_0x3143f8[_0x25743b(0x1f1)]})),'sources':_0x5770d5[_0x25743b(0x1bd)](_0x31408b=>({'source':_0x31408b[_0x25743b(0x1ba)],'credits':_0x31408b[_0x25743b(0x1c0)],'todayCredits':_0x31408b[_0x25743b(0x1be)],'monthCredits':_0x31408b[_0x25743b(0x1b8)],'requests':_0x31408b[_0x25743b(0x1e1)]}))};await handleSDKOutput([_0x39ee52],_0x20b614);}[a13_0xbff46d(0x1e6)](_0x503e07,_0xfae17a,_0x3867a7){const _0x12b831=a13_0xbff46d;console['log'](a13_0x1838e3[_0x12b831(0x1e5)](_0x12b831(0x1c6))),console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)]('─'['repeat'](0x32))),console['log'](_0x12b831(0x1ca)+a13_0x1838e3[_0x12b831(0x1d6)](formatCredits(_0x3867a7[_0x12b831(0x1be)]))+_0x12b831(0x1df)),console[_0x12b831(0x1c5)](_0x12b831(0x1d0)+a13_0x1838e3[_0x12b831(0x1d6)](formatCredits(_0x3867a7[_0x12b831(0x1b8)]))+'\x20credits'),console[_0x12b831(0x1c5)](_0x12b831(0x1af)+a13_0x1838e3['cyan'](formatCredits(_0x3867a7[_0x12b831(0x1e3)]))+_0x12b831(0x1df)),console[_0x12b831(0x1c5)]();if(_0xfae17a['length']>0x0){console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1e5)](_0x12b831(0x1bc))),console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)]('─'[_0x12b831(0x1eb)](0x3c)));const _0x5173a0=0xc,_0x420bd0=0xa,_0x3d5270=0xa,_0x460cb6=0xa;console[_0x12b831(0x1c5)]('\x20\x20'+_0x12b831(0x1c2)['padEnd'](_0x5173a0)+'\x20\x20'+_0x12b831(0x1b3)[_0x12b831(0x1c8)](_0x420bd0)+'\x20\x20'+_0x12b831(0x1ef)['padStart'](_0x3d5270)+'\x20\x20'+'Month'[_0x12b831(0x1c8)](_0x460cb6));for(const _0x2a3a7d of _0xfae17a){console[_0x12b831(0x1c5)]('\x20\x20'+_0x2a3a7d[_0x12b831(0x1ba)][_0x12b831(0x1c9)](_0x5173a0)+'\x20\x20'+a13_0x1838e3[_0x12b831(0x1d6)](formatCredits(_0x2a3a7d[_0x12b831(0x1c0)])['padStart'](_0x420bd0))+'\x20\x20'+formatCredits(_0x2a3a7d[_0x12b831(0x1be)])['padStart'](_0x3d5270)+'\x20\x20'+formatCredits(_0x2a3a7d['monthCredits'])[_0x12b831(0x1c8)](_0x460cb6));}console[_0x12b831(0x1c5)]();}if(_0x503e07[_0x12b831(0x1da)]===0x0){console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)](_0x12b831(0x1c3))),console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1e5)]('Usage\x20by\x20Profile')),console[_0x12b831(0x1c5)](a13_0x1838e3['dim']('─'[_0x12b831(0x1eb)](0x3c)));const _0xd89dcb=Math['max'](0xc,..._0x503e07[_0x12b831(0x1bd)](_0x48f538=>_0x48f538['profile']===_0x12b831(0x1dd)?_0x12b831(0x1b4)[_0x12b831(0x1da)]:_0x48f538['profile'][_0x12b831(0x1da)])),_0x2b6c46=0xa,_0x5e4376=0xa;console['log']('\x20\x20'+'Profile'['padEnd'](_0xd89dcb)+'\x20\x20'+'Credits'[_0x12b831(0x1c8)](_0x2b6c46)+'\x20\x20'+_0x12b831(0x1d4)['padStart'](_0x5e4376)+'\x20\x20'+_0x12b831(0x1b2));for(const _0x4e5fa1 of _0x503e07){const _0x3a8e75=_0x4e5fa1[_0x12b831(0x1e2)]===_0x12b831(0x1dd)?'(default)':_0x4e5fa1[_0x12b831(0x1e2)],_0x117063=_0x3a8e75['padEnd'](_0xd89dcb),_0xbe6d0f=_0x4e5fa1[_0x12b831(0x1e2)]===_0x12b831(0x1dd)?a13_0x1838e3[_0x12b831(0x1dc)](_0x117063):_0x117063;console['log']('\x20\x20'+_0xbe6d0f+'\x20\x20'+a13_0x1838e3[_0x12b831(0x1d6)](formatCredits(_0x4e5fa1[_0x12b831(0x1c0)])[_0x12b831(0x1c8)](_0x2b6c46))+'\x20\x20'+String(_0x4e5fa1[_0x12b831(0x1e1)])[_0x12b831(0x1c8)](_0x5e4376)+'\x20\x20'+a13_0x1838e3[_0x12b831(0x1dc)](formatLastUsed(_0x4e5fa1[_0x12b831(0x1f1)])));}console['log'](),console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)](_0x12b831(0x1f0))),console['log']();}}
1
+ function a13_0x204e(_0x4bc217,_0x33ca71){_0x4bc217=_0x4bc217-0x142;const _0x7d4a21=a13_0x7d4a();let _0x204e25=_0x7d4a21[_0x4bc217];return _0x204e25;}const a13_0x47783e=a13_0x204e;(function(_0x2202af,_0x17bc42){const _0x1a186f=a13_0x204e,_0x39451e=_0x2202af();while(!![]){try{const _0x823a2a=-parseInt(_0x1a186f(0x173))/0x1+-parseInt(_0x1a186f(0x14d))/0x2*(parseInt(_0x1a186f(0x17b))/0x3)+-parseInt(_0x1a186f(0x164))/0x4+-parseInt(_0x1a186f(0x14e))/0x5+-parseInt(_0x1a186f(0x15f))/0x6*(parseInt(_0x1a186f(0x16a))/0x7)+-parseInt(_0x1a186f(0x165))/0x8+parseInt(_0x1a186f(0x146))/0x9;if(_0x823a2a===_0x17bc42)break;else _0x39451e['push'](_0x39451e['shift']());}catch(_0x5abae6){_0x39451e['push'](_0x39451e['shift']());}}}(a13_0x7d4a,0x218fb));import a13_0x26d866 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x5ac32d){const _0xc7eb65=a13_0x204e;return _0x5ac32d[_0xc7eb65(0x17f)](0x2);}function formatLastUsed(_0x113e74){const _0x5ae1e6=a13_0x204e;if(!_0x113e74)return _0x5ae1e6(0x169);const _0x2271f6=new Date(_0x113e74),_0x2fbe2e=new Date(),_0x17c087=_0x2271f6[_0x5ae1e6(0x176)](_0x5ae1e6(0x155)),_0x3b5e12=_0x2fbe2e[_0x5ae1e6(0x176)](_0x5ae1e6(0x155));if(_0x17c087===_0x3b5e12)return'today\x20'+_0x2271f6[_0x5ae1e6(0x179)](_0x5ae1e6(0x154),{'hour':_0x5ae1e6(0x172),'minute':_0x5ae1e6(0x172)});const _0x215edf=new Date(_0x17c087),_0xe2e1d1=new Date(_0x3b5e12),_0x294094=Math[_0x5ae1e6(0x16c)]((_0xe2e1d1[_0x5ae1e6(0x162)]()-_0x215edf[_0x5ae1e6(0x162)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x294094===0x1)return'yesterday';else return _0x294094>0x1&&_0x294094<0x7?_0x294094+'\x20days\x20ago':_0x2271f6[_0x5ae1e6(0x176)](_0x5ae1e6(0x154),{'month':'short','day':_0x5ae1e6(0x180)});}function a13_0x7d4a(){const _0x5db5cc=['outputTable','monthCredits','outputStructured','toFixed','numeric','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','(default)','padEnd','profileCount','name','\x20credits','max','credits','9185895UGfMzH','Usage\x20by\x20Profile','repeat','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Requests','error','1338tLjGTk','1217535ISvpkq','Last\x20Used','profile','totalCredits','\x20\x20Today:\x20\x20\x20','Month','en-US','en-CA','message','default','length','Today','Credits','Usage\x20by\x20Source','entryCount','padStart','dim','101928TdvXpA','json','cyan','getTime','\x20\x20Total:\x20\x20\x20','268712xYWVYh','1316976zJlYcM','Profile','todayCredits','format','never','105WgIpqi','source','round','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','log','lastUsedAt','Total','red','2-digit','11233jDTggh','Source','description','toLocaleDateString','bold','map','toLocaleTimeString','jsonl','636tYbQNx'];a13_0x7d4a=function(){return _0x5db5cc;};return a13_0x7d4a();}export class ClaudeUsageCommand extends BaseCommand{[a13_0x47783e(0x142)]='usage';[a13_0x47783e(0x175)]=a13_0x47783e(0x16d);async['execute'](_0x485474){const _0x4b15db=a13_0x47783e,{options:_0x13907d}=_0x485474,_0x4c0446=_0x13907d[_0x4b15db(0x168)]===_0x4b15db(0x160)||_0x13907d['format']===_0x4b15db(0x17a)||_0x13907d[_0x4b15db(0x160)];try{const [_0x37bff4,_0x2d0ef4,_0x32d918]=await Promise['all']([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x4c0446?await this[_0x4b15db(0x17e)](_0x37bff4,_0x2d0ef4,_0x32d918,_0x13907d):this[_0x4b15db(0x17c)](_0x37bff4,_0x2d0ef4,_0x32d918),0x0;}catch(_0x4bbbfd){const _0x29d96c=_0x4bbbfd instanceof Error?_0x4bbbfd[_0x4b15db(0x156)]:'Unknown\x20error';return console[_0x4b15db(0x14c)](a13_0x26d866[_0x4b15db(0x171)]('Error:\x20'+_0x29d96c)),0x1;}}async[a13_0x47783e(0x17e)](_0x44e34c,_0x16c50d,_0x98794e,_0x41feb2){const _0x11a24c=a13_0x47783e,_0x4e0ce6={'summary':{'todayCredits':_0x98794e[_0x11a24c(0x167)],'monthCredits':_0x98794e[_0x11a24c(0x17d)],'totalCredits':_0x98794e[_0x11a24c(0x151)],'profileCount':_0x98794e[_0x11a24c(0x184)]},'profiles':_0x44e34c[_0x11a24c(0x178)](_0x522cb6=>({'profile':_0x522cb6[_0x11a24c(0x150)],'credits':_0x522cb6[_0x11a24c(0x145)],'requests':_0x522cb6[_0x11a24c(0x15c)],'lastUsedAt':_0x522cb6[_0x11a24c(0x16f)]})),'sources':_0x16c50d[_0x11a24c(0x178)](_0x560bb2=>({'source':_0x560bb2['source'],'credits':_0x560bb2[_0x11a24c(0x145)],'todayCredits':_0x560bb2['todayCredits'],'monthCredits':_0x560bb2[_0x11a24c(0x17d)],'requests':_0x560bb2[_0x11a24c(0x15c)]}))};await handleSDKOutput([_0x4e0ce6],_0x41feb2);}[a13_0x47783e(0x17c)](_0x4f8a3d,_0x5f3ad2,_0x46cb25){const _0x5d09b4=a13_0x47783e;console['log'](a13_0x26d866[_0x5d09b4(0x177)](_0x5d09b4(0x149))),console['log'](a13_0x26d866['dim']('─'[_0x5d09b4(0x148)](0x32))),console[_0x5d09b4(0x16e)](_0x5d09b4(0x152)+a13_0x26d866['cyan'](formatCredits(_0x46cb25['todayCredits']))+_0x5d09b4(0x143)),console[_0x5d09b4(0x16e)]('\x20\x20Month:\x20\x20\x20'+a13_0x26d866['cyan'](formatCredits(_0x46cb25[_0x5d09b4(0x17d)]))+_0x5d09b4(0x143)),console['log'](_0x5d09b4(0x163)+a13_0x26d866[_0x5d09b4(0x161)](formatCredits(_0x46cb25['totalCredits']))+_0x5d09b4(0x143)),console[_0x5d09b4(0x16e)]();if(_0x5f3ad2[_0x5d09b4(0x158)]>0x0){console[_0x5d09b4(0x16e)](a13_0x26d866[_0x5d09b4(0x177)](_0x5d09b4(0x15b))),console[_0x5d09b4(0x16e)](a13_0x26d866[_0x5d09b4(0x15e)]('─'[_0x5d09b4(0x148)](0x3c)));const _0x415d8a=0xc,_0x2914b5=0xa,_0x5e93a2=0xa,_0x4dfbb8=0xa;console[_0x5d09b4(0x16e)]('\x20\x20'+_0x5d09b4(0x174)[_0x5d09b4(0x183)](_0x415d8a)+'\x20\x20'+_0x5d09b4(0x170)[_0x5d09b4(0x15d)](_0x2914b5)+'\x20\x20'+_0x5d09b4(0x159)['padStart'](_0x5e93a2)+'\x20\x20'+_0x5d09b4(0x153)['padStart'](_0x4dfbb8));for(const _0xca0c27 of _0x5f3ad2){console[_0x5d09b4(0x16e)]('\x20\x20'+_0xca0c27[_0x5d09b4(0x16b)][_0x5d09b4(0x183)](_0x415d8a)+'\x20\x20'+a13_0x26d866[_0x5d09b4(0x161)](formatCredits(_0xca0c27[_0x5d09b4(0x145)])[_0x5d09b4(0x15d)](_0x2914b5))+'\x20\x20'+formatCredits(_0xca0c27[_0x5d09b4(0x167)])['padStart'](_0x5e93a2)+'\x20\x20'+formatCredits(_0xca0c27[_0x5d09b4(0x17d)])[_0x5d09b4(0x15d)](_0x4dfbb8));}console[_0x5d09b4(0x16e)]();}if(_0x4f8a3d[_0x5d09b4(0x158)]===0x0){console[_0x5d09b4(0x16e)](a13_0x26d866['dim'](_0x5d09b4(0x14a))),console['log'](a13_0x26d866['dim'](_0x5d09b4(0x181)));return;}console['log'](a13_0x26d866[_0x5d09b4(0x177)](_0x5d09b4(0x147))),console[_0x5d09b4(0x16e)](a13_0x26d866[_0x5d09b4(0x15e)]('─'[_0x5d09b4(0x148)](0x3c)));const _0x13f8b8=Math[_0x5d09b4(0x144)](0xc,..._0x4f8a3d[_0x5d09b4(0x178)](_0x1fe198=>_0x1fe198[_0x5d09b4(0x150)]===_0x5d09b4(0x157)?_0x5d09b4(0x182)[_0x5d09b4(0x158)]:_0x1fe198[_0x5d09b4(0x150)][_0x5d09b4(0x158)])),_0x197b01=0xa,_0x2fecbd=0xa;console[_0x5d09b4(0x16e)]('\x20\x20'+_0x5d09b4(0x166)['padEnd'](_0x13f8b8)+'\x20\x20'+_0x5d09b4(0x15a)['padStart'](_0x197b01)+'\x20\x20'+_0x5d09b4(0x14b)[_0x5d09b4(0x15d)](_0x2fecbd)+'\x20\x20'+_0x5d09b4(0x14f));for(const _0x23d299 of _0x4f8a3d){const _0x274673=_0x23d299['profile']===_0x5d09b4(0x157)?_0x5d09b4(0x182):_0x23d299[_0x5d09b4(0x150)],_0xcf2532=_0x274673[_0x5d09b4(0x183)](_0x13f8b8),_0x1032dc=_0x23d299['profile']===_0x5d09b4(0x157)?a13_0x26d866[_0x5d09b4(0x15e)](_0xcf2532):_0xcf2532;console[_0x5d09b4(0x16e)]('\x20\x20'+_0x1032dc+'\x20\x20'+a13_0x26d866[_0x5d09b4(0x161)](formatCredits(_0x23d299['credits'])['padStart'](_0x197b01))+'\x20\x20'+String(_0x23d299[_0x5d09b4(0x15c)])[_0x5d09b4(0x15d)](_0x2fecbd)+'\x20\x20'+a13_0x26d866[_0x5d09b4(0x15e)](formatLastUsed(_0x23d299[_0x5d09b4(0x16f)])));}console[_0x5d09b4(0x16e)](),console['log'](a13_0x26d866[_0x5d09b4(0x15e)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x5d09b4(0x16e)]();}}
@@ -1 +1 @@
1
- const a14_0xab77d7=a14_0x2863;(function(_0x186103,_0x5c53d2){const _0x50b395=a14_0x2863,_0x2673d5=_0x186103();while(!![]){try{const _0x2cb747=-parseInt(_0x50b395(0x8e))/0x1+-parseInt(_0x50b395(0x7d))/0x2*(-parseInt(_0x50b395(0x89))/0x3)+-parseInt(_0x50b395(0x91))/0x4+-parseInt(_0x50b395(0x8c))/0x5*(-parseInt(_0x50b395(0x97))/0x6)+-parseInt(_0x50b395(0xa3))/0x7*(-parseInt(_0x50b395(0x9f))/0x8)+parseInt(_0x50b395(0xa6))/0x9*(parseInt(_0x50b395(0xaa))/0xa)+parseInt(_0x50b395(0x96))/0xb*(-parseInt(_0x50b395(0xa7))/0xc);if(_0x2cb747===_0x5c53d2)break;else _0x2673d5['push'](_0x2673d5['shift']());}catch(_0x486033){_0x2673d5['push'](_0x2673d5['shift']());}}}(a14_0x5f58,0xb682c));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_0x4a5e0f from'chalk';export function printAuthError(_0x1b3305,_0xcc1a59=![],_0x2419f1){const _0x2e265f=a14_0x2863,_0x2fe4c1=_0x1b3305['problemDetails']?.[_0x2e265f(0x82)]||_0x1b3305['message'];console[_0x2e265f(0x80)](a14_0x4a5e0f[_0x2e265f(0x8f)](_0x2e265f(0x94))),console[_0x2e265f(0x80)](a14_0x4a5e0f[_0x2e265f(0x8f)](_0x2e265f(0x9e)+_0x2fe4c1));if(_0xcc1a59){const _0x4d6afe=_0x2419f1?_0x2e265f(0xa4)+_0x2419f1:'';console[_0x2e265f(0x80)]('\x0a'+a14_0x4a5e0f['dim'](_0x2e265f(0x9a))),console['error']('\x20\x20'+a14_0x4a5e0f['cyan'](_0x2e265f(0x7f)+_0x4d6afe)+'\x0a'),console[_0x2e265f(0x80)](''+a14_0x4a5e0f['dim'](_0x2e265f(0x93))),console['error']('\x20\x20'+a14_0x4a5e0f[_0x2e265f(0x8b)](_0x2e265f(0xab)+_0x4d6afe));}}function a14_0x5f58(){const _0x2023f6=['error','debug','detail','\x0aStack\x20trace:\x0a','values','register','USER_ERROR','Command\x20\x27','options','198753rsOJTo','isValid','cyan','1678730yluyqx','from','239119xOmcLC','red','category','3195108ULnYVw','value','To\x20check\x20your\x20current\x20auth\x20status:','Authentication\x20failed','profile','33QOrMFS','12YNlPZI','set','test','To\x20set\x20up\x20authentication:','commands','name','execute','Reason:\x20','6128gxCLqy','helpText','stack','status','7567zmmyoh','\x20--profile\x20','yellow','297sjBLyd','7471836gzfmjH','number','command','251170JuOMSv','tdx\x20auth','message','Error:\x20','get','validate','has','validateGlobalOptions','40lvVMnk','limit','tdx\x20auth\x20setup'];a14_0x5f58=function(){return _0x2023f6;};return a14_0x5f58();}export class BaseCommand{[a14_0xab77d7(0x7c)](_0x521027){const _0x1b1fb9=a14_0xab77d7,{options:_0x492008}=_0x521027,_0x482dcc=_0x492008[_0x1b1fb9(0x7e)];if(_0x482dcc!==undefined){const _0x5e62cc=typeof _0x482dcc===_0x1b1fb9(0xa8)?_0x482dcc:parseInt(_0x482dcc,0xa);if(isNaN(_0x5e62cc))return'Invalid\x20limit\x20value:\x20'+_0x482dcc+'.\x20Must\x20be\x20a\x20number.';const _0x4f2ad1=validateLimitOption(_0x5e62cc);if(!_0x4f2ad1[_0x1b1fb9(0x8a)])return _0x4f2ad1[_0x1b1fb9(0x80)];_0x521027[_0x1b1fb9(0x88)][_0x1b1fb9(0x7e)]=_0x4f2ad1[_0x1b1fb9(0x92)];}return undefined;}[a14_0xab77d7(0x7a)](_0x2e4c80){return undefined;}async['run'](_0x10ef54){const _0x27aee3=a14_0xab77d7;try{const _0x253f23=this['validateGlobalOptions'](_0x10ef54);if(_0x253f23)return console['error'](_0x27aee3(0x78)+_0x253f23),0x1;const _0x4c2ee2=this[_0x27aee3(0x7a)](_0x10ef54);if(_0x4c2ee2){const _0x482071=/^\s*(Usage|Note|Warning|Error):/i[_0x27aee3(0x99)](_0x4c2ee2);return _0x482071?console[_0x27aee3(0x80)](_0x4c2ee2):console[_0x27aee3(0x80)](_0x27aee3(0x78)+_0x4c2ee2),0x1;}const _0x157a59=await this[_0x27aee3(0x9d)](_0x10ef54);return _0x157a59??0x0;}catch(_0x41c7f2){if(_0x41c7f2 instanceof Error){if(_0x41c7f2 instanceof HTTPClientError&&_0x41c7f2[_0x27aee3(0xa2)]===0x191){const _0xc61515=_0x10ef54[_0x27aee3(0x88)][_0x27aee3(0x95)];printAuthError(_0x41c7f2,!![],_0xc61515);if(_0x41c7f2[_0x27aee3(0xa1)]){const _0x2eebfc=Logger['of'](_0x27aee3(0xa9));_0x2eebfc[_0x27aee3(0x81)]('Authentication\x20error\x20stack\x20trace:'),_0x2eebfc['debug'](_0x41c7f2[_0x27aee3(0xa1)]);}return 0x1;}console[_0x27aee3(0x80)](a14_0x4a5e0f['red'](_0x27aee3(0x78)+_0x41c7f2[_0x27aee3(0x77)]));_0x41c7f2 instanceof SDKError&&_0x41c7f2[_0x27aee3(0xa0)]&&console[_0x27aee3(0x80)](a14_0x4a5e0f[_0x27aee3(0xa5)](_0x41c7f2['helpText']));const _0x181cb0=_0x41c7f2 instanceof SDKError&&_0x41c7f2[_0x27aee3(0x90)]===ErrorCategory[_0x27aee3(0x86)];_0x41c7f2['stack']&&!_0x181cb0&&console[_0x27aee3(0x80)](_0x27aee3(0x83)+_0x41c7f2['stack']);}else console[_0x27aee3(0x80)](_0x27aee3(0x78)+String(_0x41c7f2));return 0x1;}}}export class CommandRegistry{[a14_0xab77d7(0x9b)]=new Map();[a14_0xab77d7(0x85)](_0x2da3d3){const _0x5bf6b7=a14_0xab77d7;if(this['commands']['has'](_0x2da3d3[_0x5bf6b7(0x9c)]))throw new Error(_0x5bf6b7(0x87)+_0x2da3d3[_0x5bf6b7(0x9c)]+'\x27\x20is\x20already\x20registered');this[_0x5bf6b7(0x9b)][_0x5bf6b7(0x98)](_0x2da3d3[_0x5bf6b7(0x9c)],_0x2da3d3);}[a14_0xab77d7(0x79)](_0x5e6aae){const _0x3088fc=a14_0xab77d7;return this['commands'][_0x3088fc(0x79)](_0x5e6aae);}['getAll'](){const _0x3c85c3=a14_0xab77d7;return Array[_0x3c85c3(0x8d)](this[_0x3c85c3(0x9b)][_0x3c85c3(0x84)]());}[a14_0xab77d7(0x7b)](_0x2edb1a){const _0x5862a8=a14_0xab77d7;return this['commands'][_0x5862a8(0x7b)](_0x2edb1a);}}function a14_0x2863(_0x343dfb,_0xee446c){_0x343dfb=_0x343dfb-0x77;const _0x5f5879=a14_0x5f58();let _0x286309=_0x5f5879[_0x343dfb];return _0x286309;}export const registry=new CommandRegistry();
1
+ const a14_0x20ec25=a14_0x7786;(function(_0x166576,_0x3fdfe8){const _0x416da2=a14_0x7786,_0xb4e644=_0x166576();while(!![]){try{const _0x56e6f2=-parseInt(_0x416da2(0xea))/0x1+-parseInt(_0x416da2(0x104))/0x2*(-parseInt(_0x416da2(0xe8))/0x3)+parseInt(_0x416da2(0x103))/0x4*(parseInt(_0x416da2(0xeb))/0x5)+-parseInt(_0x416da2(0xf9))/0x6*(parseInt(_0x416da2(0xfc))/0x7)+parseInt(_0x416da2(0xf6))/0x8+-parseInt(_0x416da2(0xf8))/0x9*(parseInt(_0x416da2(0xe0))/0xa)+-parseInt(_0x416da2(0x108))/0xb*(-parseInt(_0x416da2(0x10b))/0xc);if(_0x56e6f2===_0x3fdfe8)break;else _0xb4e644['push'](_0xb4e644['shift']());}catch(_0x29d86a){_0xb4e644['push'](_0xb4e644['shift']());}}}(a14_0x595d,0xbabae));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_0x190c66 from'chalk';export function printAuthError(_0xe2b959,_0x3f58fe=![],_0x45cb6a){const _0x59d799=a14_0x7786,_0x40d29d=_0xe2b959[_0x59d799(0xe9)]?.[_0x59d799(0xff)]||_0xe2b959[_0x59d799(0xf7)];console['error'](a14_0x190c66[_0x59d799(0xf3)](_0x59d799(0xf5))),console[_0x59d799(0x10a)](a14_0x190c66[_0x59d799(0xf3)](_0x59d799(0xf2)+_0x40d29d));if(_0x3f58fe){const _0x7299ed=_0x45cb6a?'\x20--profile\x20'+_0x45cb6a:'';console[_0x59d799(0x10a)]('\x0a'+a14_0x190c66[_0x59d799(0xef)]('To\x20set\x20up\x20authentication:')),console[_0x59d799(0x10a)]('\x20\x20'+a14_0x190c66[_0x59d799(0x10c)]('tdx\x20auth\x20setup'+_0x7299ed)+'\x0a'),console['error'](''+a14_0x190c66[_0x59d799(0xef)](_0x59d799(0xde))),console[_0x59d799(0x10a)]('\x20\x20'+a14_0x190c66['cyan'](_0x59d799(0xfe)+_0x7299ed));}}function a14_0x7786(_0x1d326d,_0x1e6b6a){_0x1d326d=_0x1d326d-0xdc;const _0x595d1e=a14_0x595d();let _0x778660=_0x595d1e[_0x1d326d];return _0x778660;}export class BaseCommand{[a14_0x20ec25(0xfb)](_0x59c07a){const _0x35f418=a14_0x20ec25,{options:_0x3e7a74}=_0x59c07a,_0x588f5b=_0x3e7a74[_0x35f418(0xf4)];if(_0x588f5b!==undefined){const _0x3fbf6d=typeof _0x588f5b==='number'?_0x588f5b:parseInt(_0x588f5b,0xa);if(isNaN(_0x3fbf6d))return _0x35f418(0xf1)+_0x588f5b+_0x35f418(0xe2);const _0x35bd2a=validateLimitOption(_0x3fbf6d);if(!_0x35bd2a['isValid'])return _0x35bd2a['error'];_0x59c07a[_0x35f418(0xed)][_0x35f418(0xf4)]=_0x35bd2a[_0x35f418(0xe6)];}return undefined;}[a14_0x20ec25(0xe1)](_0xe2e141){return undefined;}async['run'](_0x3fcb19){const _0x342c4d=a14_0x20ec25;try{const _0x59ed67=this[_0x342c4d(0xfb)](_0x3fcb19);if(_0x59ed67)return console[_0x342c4d(0x10a)](_0x342c4d(0xe3)+_0x59ed67),0x1;const _0x2f3ac6=this[_0x342c4d(0xe1)](_0x3fcb19);if(_0x2f3ac6){const _0x51dbd3=/^\s*(Usage|Note|Warning|Error):/i[_0x342c4d(0xfd)](_0x2f3ac6);return _0x51dbd3?console[_0x342c4d(0x10a)](_0x2f3ac6):console[_0x342c4d(0x10a)]('Error:\x20'+_0x2f3ac6),0x1;}const _0x2e6197=await this[_0x342c4d(0xf0)](_0x3fcb19);return _0x2e6197??0x0;}catch(_0x1243d3){if(_0x1243d3 instanceof Error){if(_0x1243d3 instanceof HTTPClientError&&_0x1243d3[_0x342c4d(0xdd)]===0x191){const _0x1bd804=_0x3fcb19[_0x342c4d(0xed)]['profile'];printAuthError(_0x1243d3,!![],_0x1bd804);if(_0x1243d3[_0x342c4d(0x100)]){const _0x4147f0=Logger['of'](_0x342c4d(0xee));_0x4147f0[_0x342c4d(0x10d)](_0x342c4d(0xdf)),_0x4147f0[_0x342c4d(0x10d)](_0x1243d3[_0x342c4d(0x100)]);}return 0x1;}console[_0x342c4d(0x10a)](a14_0x190c66[_0x342c4d(0xf3)](_0x342c4d(0xe3)+_0x1243d3[_0x342c4d(0xf7)]));_0x1243d3 instanceof SDKError&&_0x1243d3[_0x342c4d(0x101)]&&console['error'](a14_0x190c66[_0x342c4d(0xdc)](_0x1243d3[_0x342c4d(0x101)]));const _0x2d8325=_0x1243d3 instanceof SDKError&&_0x1243d3[_0x342c4d(0x107)]===ErrorCategory['USER_ERROR'];_0x1243d3[_0x342c4d(0x100)]&&!_0x2d8325&&console[_0x342c4d(0x10a)](_0x342c4d(0xec)+_0x1243d3[_0x342c4d(0x100)]);}else console[_0x342c4d(0x10a)](_0x342c4d(0xe3)+String(_0x1243d3));return 0x1;}}}function a14_0x595d(){const _0x4e44b7=['validate','.\x20Must\x20be\x20a\x20number.','Error:\x20','\x27\x20is\x20already\x20registered','get','value','register','617514CzBkNj','problemDetails','160147KTkgbz','5gVqpay','\x0aStack\x20trace:\x0a','options','command','dim','execute','Invalid\x20limit\x20value:\x20','Reason:\x20','red','limit','Authentication\x20failed','1375416slPcLx','message','5203404rJxNna','132TwlQZp','name','validateGlobalOptions','162757bhhGzh','test','tdx\x20auth','detail','stack','helpText','Command\x20\x27','3833512FZyfpE','6bxAMCY','has','commands','category','44ySLLVC','getAll','error','800556obUzBL','cyan','debug','yellow','status','To\x20check\x20your\x20current\x20auth\x20status:','Authentication\x20error\x20stack\x20trace:','10vTrDla'];a14_0x595d=function(){return _0x4e44b7;};return a14_0x595d();}export class CommandRegistry{[a14_0x20ec25(0x106)]=new Map();[a14_0x20ec25(0xe7)](_0x34f06d){const _0x1c80c3=a14_0x20ec25;if(this[_0x1c80c3(0x106)][_0x1c80c3(0x105)](_0x34f06d[_0x1c80c3(0xfa)]))throw new Error(_0x1c80c3(0x102)+_0x34f06d['name']+_0x1c80c3(0xe4));this[_0x1c80c3(0x106)]['set'](_0x34f06d[_0x1c80c3(0xfa)],_0x34f06d);}[a14_0x20ec25(0xe5)](_0x39577d){const _0x2ae3de=a14_0x20ec25;return this[_0x2ae3de(0x106)][_0x2ae3de(0xe5)](_0x39577d);}[a14_0x20ec25(0x109)](){const _0x426d5f=a14_0x20ec25;return Array['from'](this[_0x426d5f(0x106)]['values']());}[a14_0x20ec25(0x105)](_0x50a305){const _0x1aa58b=a14_0x20ec25;return this[_0x1aa58b(0x106)]['has'](_0x50a305);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a15_0x30d6cd=a15_0x467b;function a15_0x12ab(){const _0x296f08=['listTypes','limit','\x0aAvailable\x20fields:','connection:types','Name:\x20','description','\x27\x20as\x20connector\x20type','label','22363569jOaRtC','minimum','filter','push','criteria','426295nEUVYL','data','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','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','List\x20all\x20result\x20output\x20connections','length','find','getMetadata','1299693YnaFqD','join','green','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.','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','\x27...','✔\x20Found\x20connection:\x20','16CBNfRb','value','verbose','legacy_settings','maximum','✔\x20Resolved\x20\x27','sort','settings','output','padStart','resolve','map','connection','\x0aCredential\x20settings:','cyan','\x20\x20\x20\x20Options:\x20','\x0aConnection:\x20','1183483pCxUql','connection:show','log','\x20\x20\x20\x20','legacy','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','properties','connection:schema','Fetching\x20connection\x20\x27','Listing\x20connector\x20types...','type','\x0aNo\x20fields\x20defined\x20in\x20schema','23947lSzpJe','repeat','10eHbuiO','hint','error','Show\x20connection\x20details','\x20connector\x20type','Site:\x20','>=\x20','hidden','execute','\x0aNo\x20credential\x20settings\x20defined','Fetching\x20settings\x20for\x20connector\x20type:\x20','\x0aConnector:\x20','site','Resolving\x20connector\x20type\x20or\x20name:\x20','Fetching\x20schema\x20for\x20\x27','table','Options:\x20','blue','default_value','✔\x20Found\x20','44WCLiZd','connection:settings','\x20[record]','3348954WLhlwI','input','Treating\x20\x27','Listing\x20connections...','connection:list','name','dim','bold','validate','<=\x20','1230054luolbN','record','slice','yellow','max','entries','stringify','enumeration','\x20-\x20','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','List\x20available\x20connector\x20types','credential'];a15_0x12ab=function(){return _0x296f08;};return a15_0x12ab();}(function(_0x2d3711,_0x261f9f){const _0x246cbf=a15_0x467b,_0x561e92=_0x2d3711();while(!![]){try{const _0x430aca=-parseInt(_0x246cbf(0x15b))/0x1+-parseInt(_0x246cbf(0x18a))/0x2+-parseInt(_0x246cbf(0x1ab))/0x3+-parseInt(_0x246cbf(0x17d))/0x4*(-parseInt(_0x246cbf(0x1a3))/0x5)+-parseInt(_0x246cbf(0x180))/0x6+-parseInt(_0x246cbf(0x167))/0x7*(parseInt(_0x246cbf(0x1b2))/0x8)+parseInt(_0x246cbf(0x19e))/0x9*(parseInt(_0x246cbf(0x169))/0xa);if(_0x430aca===_0x261f9f)break;else _0x561e92['push'](_0x561e92['shift']());}catch(_0x47f1c4){_0x561e92['push'](_0x561e92['shift']());}}}(a15_0x12ab,0x98d1c));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_0x27c881 from'chalk';function normalizeSchemaForDisplay(_0x474af2){const _0x13620f=a15_0x467b,_0x39b3ab=_0x474af2[_0x13620f(0x161)]||[],_0x209299=_0x39b3ab[_0x13620f(0x1a9)](_0x126891=>_0x126891[_0x13620f(0x185)]===_0x13620f(0x1b5)&&_0x126891[_0x13620f(0x165)]===_0x13620f(0x18b)&&_0x126891[_0x13620f(0x161)]);if(_0x209299?.[_0x13620f(0x161)]){const _0x1b1008=_0x39b3ab['filter'](_0x3ee193=>_0x3ee193[_0x13620f(0x185)]!==_0x13620f(0x15f)&&_0x3ee193[_0x13620f(0x185)]!=='legacy_settings');return[..._0x1b1008,..._0x209299[_0x13620f(0x161)]];}return _0x39b3ab[_0x13620f(0x1a0)](_0xe836cd=>_0xe836cd['name']!==_0x13620f(0x15f));}function printSchemaFields(_0x53a7a1,_0x4505c7){const _0x1c0841=a15_0x467b,_0xac53d9='\x20\x20'[_0x1c0841(0x168)](_0x4505c7+0x1),_0x281928='\x20\x20'[_0x1c0841(0x168)](_0x4505c7+0x2);for(const _0x579761 of _0x53a7a1){if(!_0x579761[_0x1c0841(0x185)])continue;const _0x34acf0=_0x579761[_0x1c0841(0x165)]===_0x1c0841(0x18b)&&_0x579761[_0x1c0841(0x161)]&&_0x579761['properties'][_0x1c0841(0x1a8)]>0x0&&_0x579761[_0x1c0841(0x185)]!==_0x1c0841(0x1b5);let _0x40b3dd=''+_0xac53d9+a15_0x27c881[_0x1c0841(0x1ad)](_0x579761[_0x1c0841(0x185)]);_0x579761['title']&&(_0x40b3dd+=':\x20'+_0x579761['title']);if(_0x579761[_0x1c0841(0x181)])_0x40b3dd+=a15_0x27c881[_0x1c0841(0x186)]('\x20['+_0x579761[_0x1c0841(0x181)]+']');else _0x34acf0&&(_0x40b3dd+=a15_0x27c881[_0x1c0841(0x186)](_0x1c0841(0x17f)));console[_0x1c0841(0x15d)](_0x40b3dd);_0x579761[_0x1c0841(0x19b)]&&console[_0x1c0841(0x15d)](''+_0x281928+a15_0x27c881['dim'](_0x579761[_0x1c0841(0x19b)]));if(_0x579761['enumeration']){const _0x48b3f8=_0x579761[_0x1c0841(0x191)]['map'](_0x220f4f=>typeof _0x220f4f==='object'&&_0x1c0841(0x1b3)in _0x220f4f?_0x220f4f[_0x1c0841(0x1b3)]:_0x220f4f)[_0x1c0841(0x1ac)](',\x20');console[_0x1c0841(0x15d)](_0x281928+_0x1c0841(0x179)+a15_0x27c881[_0x1c0841(0x18d)](_0x48b3f8));}_0x579761[_0x1c0841(0x17b)]!==undefined&&console[_0x1c0841(0x15d)](_0x281928+'Default:\x20'+a15_0x27c881[_0x1c0841(0x17a)](String(_0x579761[_0x1c0841(0x17b)])));if(_0x579761['minimum']!==undefined||_0x579761[_0x1c0841(0x1b6)]!==undefined){const _0x1c70bd=_0x579761[_0x1c0841(0x19f)]!==undefined&&_0x579761[_0x1c0841(0x1b6)]!==undefined?_0x579761[_0x1c0841(0x19f)]+_0x1c0841(0x192)+_0x579761['maximum']:_0x579761[_0x1c0841(0x19f)]!==undefined?_0x1c0841(0x16f)+_0x579761[_0x1c0841(0x19f)]:_0x1c0841(0x189)+_0x579761['maximum'];console[_0x1c0841(0x15d)](_0x281928+'Range:\x20'+a15_0x27c881[_0x1c0841(0x17a)](_0x1c70bd));}if(_0x579761[_0x1c0841(0x1a2)]){const _0x13b3ba=Object[_0x1c0841(0x18f)](_0x579761[_0x1c0841(0x1a2)])[_0x1c0841(0x1bd)](([_0x201609,_0x29ae12])=>_0x201609+'='+JSON[_0x1c0841(0x190)](_0x29ae12))[_0x1c0841(0x1ac)](',\x20');console['log'](''+_0x281928+a15_0x27c881[_0x1c0841(0x186)]('Show\x20when:\x20'+_0x13b3ba));}_0x34acf0&&_0x579761[_0x1c0841(0x161)]&&printSchemaFields(_0x579761[_0x1c0841(0x161)],_0x4505c7+0x1);}}export class ConnectionListCommand extends BaseCommand{[a15_0x30d6cd(0x185)]=a15_0x30d6cd(0x184);['description']=a15_0x30d6cd(0x1a7);async[a15_0x30d6cd(0x171)](_0x1eb2d3){const _0x3e4af8=a15_0x30d6cd,{options:_0x454797,tdx:_0x19a53d}=_0x1eb2d3;_0x454797[_0x3e4af8(0x1b4)]&&console['error'](_0x3e4af8(0x16e)+_0x454797[_0x3e4af8(0x175)]);const _0x2d8418=resolveLimit(_0x454797[_0x3e4af8(0x197)],DEFAULT_LISTING_LIMIT),_0xbea80d=await withSpinner(_0x3e4af8(0x183),()=>_0x19a53d[_0x3e4af8(0x156)]['list'](),{'verbose':_0x454797[_0x3e4af8(0x1b4)]}),_0x3a0d42=_0xbea80d[_0x3e4af8(0x1a4)];console['error']('✔\x20Found\x20'+_0x3a0d42[_0x3e4af8(0x1a8)]+'\x20connection'+(_0x3a0d42[_0x3e4af8(0x1a8)]!==0x1?'s':''));if(isStructuredFormat(_0x454797)){const _0x220b24=_0x3a0d42[_0x3e4af8(0x18c)](0x0,_0x2d8418);await handleSDKOutput(_0x220b24,{..._0x454797,'limit':_0x2d8418});}else{const _0x2145ba=_0x3a0d42['length']>0x0?Math['max'](..._0x3a0d42[_0x3e4af8(0x1bd)](_0x4aa680=>_0x4aa680[_0x3e4af8(0x165)][_0x3e4af8(0x1a8)])):0x0,_0x303135=[];for(const _0x1384b9 of _0x3a0d42){const _0x2092d7=a15_0x27c881['cyan'](_0x1384b9['type'][_0x3e4af8(0x1bb)](_0x2145ba)),_0x25f54f=_0x1384b9['owner']?.['name']?_0x3e4af8(0x192)+a15_0x27c881[_0x3e4af8(0x186)](_0x1384b9['owner'][_0x3e4af8(0x185)]):'';_0x303135[_0x3e4af8(0x1a1)](_0x2092d7+'\x20\x20'+_0x1384b9[_0x3e4af8(0x185)]+_0x25f54f);}await writeOutput(_0x303135[_0x3e4af8(0x1ac)]('\x0a'),_0x454797['output'],_0x3e4af8(0x178));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']=a15_0x30d6cd(0x15c);['description']=a15_0x30d6cd(0x16c);[a15_0x30d6cd(0x188)](_0xbeccf1){const _0x441eb5=a15_0x30d6cd,{args:_0x39f7ea}=_0xbeccf1;if(!_0x39f7ea[0x0])return _0x441eb5(0x1a5);return undefined;}async[a15_0x30d6cd(0x171)](_0x40c06f){const _0x9a8c4b=a15_0x30d6cd,{options:_0x5f1604,args:_0x5b069c,tdx:_0x1e44e3}=_0x40c06f,_0x5ca2f4=_0x5b069c[0x0];_0x5f1604[_0x9a8c4b(0x1b4)]&&(console[_0x9a8c4b(0x16b)]('Site:\x20'+_0x5f1604[_0x9a8c4b(0x175)]),console['error']('Looking\x20up\x20connection:\x20'+_0x5ca2f4));const _0x3156c9=await withSpinner(_0x9a8c4b(0x163)+_0x5ca2f4+_0x9a8c4b(0x1b0),()=>_0x1e44e3[_0x9a8c4b(0x156)][_0x9a8c4b(0x1bc)](_0x5ca2f4),{'verbose':_0x5f1604[_0x9a8c4b(0x1b4)]}),_0x39072a=_0x3156c9[_0x9a8c4b(0x1a4)];return console[_0x9a8c4b(0x16b)](_0x9a8c4b(0x1b1)+_0x39072a[_0x9a8c4b(0x185)]),await handleSingleObjectOutput(_0x39072a,_0x5f1604),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a15_0x30d6cd(0x162);[a15_0x30d6cd(0x19b)]=a15_0x30d6cd(0x160);[a15_0x30d6cd(0x188)](_0x4aeb15){const _0x4c3d81=a15_0x30d6cd,{args:_0x199694}=_0x4aeb15;if(!_0x199694[0x0])return _0x4c3d81(0x1ae);return undefined;}async[a15_0x30d6cd(0x171)](_0x4df1e7){const _0x3b607e=a15_0x30d6cd,{options:_0x5c60d1,args:_0x1d1d04,tdx:_0x551196}=_0x4df1e7,_0xc75fad=_0x1d1d04[0x0];_0x5c60d1[_0x3b607e(0x1b4)]&&(console[_0x3b607e(0x16b)](_0x3b607e(0x16e)+_0x5c60d1['site']),console['error'](_0x3b607e(0x176)+_0xc75fad));let _0x147f4c=_0xc75fad,_0x8ea97d;try{const _0x117642=await _0x551196[_0x3b607e(0x156)]['findByName'](_0xc75fad);_0x117642&&(_0x147f4c=_0x117642[_0x3b607e(0x165)],_0x8ea97d=_0x117642[_0x3b607e(0x185)],_0x5c60d1['verbose']&&console['error'](_0x3b607e(0x1b7)+_0xc75fad+_0x3b607e(0x193)+_0x147f4c));}catch{_0x5c60d1[_0x3b607e(0x1b4)]&&console[_0x3b607e(0x16b)](_0x3b607e(0x182)+_0xc75fad+_0x3b607e(0x19c));}const _0x5ead72=await withSpinner(_0x3b607e(0x177)+_0x147f4c+'\x27...',()=>_0x551196[_0x3b607e(0x156)]['getOutputSchema'](_0x147f4c),{'verbose':_0x5c60d1[_0x3b607e(0x1b4)]}),_0x419aa8=_0x5ead72['data'];_0x8ea97d?console['error']('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x8ea97d+'\x27\x20(type:\x20'+_0x147f4c+')'):console['error']('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x147f4c);if(isStructuredFormat(_0x5c60d1))await handleSingleObjectOutput(_0x419aa8,_0x5c60d1);else{const _0x4f5f09=normalizeSchemaForDisplay(_0x419aa8);_0x8ea97d?(console[_0x3b607e(0x15d)](_0x3b607e(0x15a)+a15_0x27c881[_0x3b607e(0x158)](_0x8ea97d)),console[_0x3b607e(0x15d)]('Type:\x20'+a15_0x27c881[_0x3b607e(0x186)](_0x147f4c))):console[_0x3b607e(0x15d)](_0x3b607e(0x174)+a15_0x27c881[_0x3b607e(0x158)](_0x147f4c)),_0x4f5f09[_0x3b607e(0x1a8)]>0x0?(console[_0x3b607e(0x15d)](a15_0x27c881['bold'](_0x3b607e(0x198))),printSchemaFields(_0x4f5f09,0x0)):console[_0x3b607e(0x15d)](a15_0x27c881['dim'](_0x3b607e(0x166)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a15_0x30d6cd(0x185)]=a15_0x30d6cd(0x199);['description']=a15_0x30d6cd(0x194);async[a15_0x30d6cd(0x171)](_0x11b432){const _0x375f01=a15_0x30d6cd,{options:_0xef71a1,tdx:_0x4a4423}=_0x11b432;_0xef71a1['verbose']&&console['error'](_0x375f01(0x16e)+_0xef71a1[_0x375f01(0x175)]);const _0xe74489=await withSpinner(_0x375f01(0x164),()=>_0x4a4423['connection'][_0x375f01(0x196)](),{'verbose':_0xef71a1[_0x375f01(0x1b4)]}),_0x291646=_0xe74489[_0x375f01(0x1a4)][_0x375f01(0x1b8)]((_0x45b567,_0x5580ca)=>_0x45b567[_0x375f01(0x165)]['localeCompare'](_0x5580ca[_0x375f01(0x165)]));console[_0x375f01(0x16b)](_0x375f01(0x17c)+_0x291646[_0x375f01(0x1a8)]+_0x375f01(0x16d)+(_0x291646['length']!==0x1?'s':''));if(isStructuredFormat(_0xef71a1))await handleSDKOutput(_0x291646,_0xef71a1);else{const _0x5b4e8f=_0x291646[_0x375f01(0x1a8)]>0x0?Math[_0x375f01(0x18e)](..._0x291646[_0x375f01(0x1bd)](_0x1f73d5=>_0x1f73d5[_0x375f01(0x165)][_0x375f01(0x1a8)])):0x0,_0x4c9d92=[];for(const _0x4b0925 of _0x291646){const _0xb13cc0=a15_0x27c881[_0x375f01(0x158)](_0x4b0925[_0x375f01(0x165)][_0x375f01(0x1bb)](_0x5b4e8f));_0x4c9d92['push'](_0xb13cc0+'\x20\x20'+_0x4b0925[_0x375f01(0x185)]);}await writeOutput(_0x4c9d92[_0x375f01(0x1ac)]('\x0a'),_0xef71a1[_0x375f01(0x1ba)],_0x375f01(0x178));}return 0x0;}}function a15_0x467b(_0x2ebf54,_0x3f949c){_0x2ebf54=_0x2ebf54-0x156;const _0x12ab87=a15_0x12ab();let _0x467bc0=_0x12ab87[_0x2ebf54];return _0x467bc0;}export class ConnectionSettingsCommand extends BaseCommand{[a15_0x30d6cd(0x185)]=a15_0x30d6cd(0x17e);[a15_0x30d6cd(0x19b)]=a15_0x30d6cd(0x1a6);['validate'](_0xecef03){const {args:_0x351cf3}=_0xecef03;if(!_0x351cf3[0x0])return'Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.';return undefined;}async[a15_0x30d6cd(0x171)](_0x274441){const _0x148cfd=a15_0x30d6cd,{options:_0x4f2440,args:_0xc23b2,tdx:_0x317393}=_0x274441,_0x5513de=_0xc23b2[0x0];_0x4f2440['verbose']&&(console[_0x148cfd(0x16b)](_0x148cfd(0x16e)+_0x4f2440[_0x148cfd(0x175)]),console[_0x148cfd(0x16b)](_0x148cfd(0x173)+_0x5513de));const _0x35b2ee=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x5513de+_0x148cfd(0x1b0),()=>_0x317393[_0x148cfd(0x156)][_0x148cfd(0x1aa)](_0x5513de),{'verbose':_0x4f2440['verbose']}),_0x38e1c8=_0x35b2ee[_0x148cfd(0x1a4)];console['error'](_0x148cfd(0x1af)+_0x5513de);if(isStructuredFormat(_0x4f2440))await handleSingleObjectOutput(_0x38e1c8,_0x4f2440);else{console[_0x148cfd(0x15d)](_0x148cfd(0x174)+a15_0x27c881[_0x148cfd(0x158)](_0x5513de)),console[_0x148cfd(0x15d)](_0x148cfd(0x19a)+_0x38e1c8[_0x148cfd(0x185)]);const _0x132efc=_0x38e1c8[_0x148cfd(0x1b9)]||[],_0x4af7fc=_0x132efc[_0x148cfd(0x1a0)](_0x4b09b4=>_0x4b09b4[_0x148cfd(0x195)]);_0x4af7fc[_0x148cfd(0x1a8)]>0x0&&(console[_0x148cfd(0x15d)](a15_0x27c881[_0x148cfd(0x187)](_0x148cfd(0x157))),printMetadataSettings(_0x4af7fc));let _0x1fc0bc=![];try{const _0x5f38c7=await _0x317393[_0x148cfd(0x156)]['getOutputSchema'](_0x5513de),_0x3c555b=normalizeSchemaForDisplay(_0x5f38c7);_0x3c555b['length']>0x0&&(console[_0x148cfd(0x15d)](a15_0x27c881['bold'](_0x148cfd(0x198))),printSchemaFields(_0x3c555b,0x0),_0x1fc0bc=!![]);}catch{const _0x254da9=_0x132efc[_0x148cfd(0x1a0)](_0x2f9267=>!_0x2f9267[_0x148cfd(0x195)]);_0x254da9[_0x148cfd(0x1a8)]>0x0&&(console[_0x148cfd(0x15d)](a15_0x27c881[_0x148cfd(0x187)](_0x148cfd(0x198))),printMetadataSettings(_0x254da9),_0x1fc0bc=!![]);}!_0x1fc0bc&&_0x4f2440[_0x148cfd(0x1b4)]&&console['error'](a15_0x27c881[_0x148cfd(0x186)]('No\x20available\x20fields\x20for\x20this\x20connector')),_0x4af7fc['length']===0x0&&console[_0x148cfd(0x15d)](a15_0x27c881[_0x148cfd(0x186)](_0x148cfd(0x172)));}return 0x0;}}function printMetadataSettings(_0x5942b2){const _0x4f3707=a15_0x30d6cd;for(const _0x46b1fa of _0x5942b2){if(!_0x46b1fa[_0x4f3707(0x185)])continue;if(_0x46b1fa[_0x4f3707(0x170)])continue;let _0x4ce7ac='\x20\x20'+a15_0x27c881['green'](_0x46b1fa[_0x4f3707(0x185)]);_0x46b1fa[_0x4f3707(0x19d)]&&(_0x4ce7ac+=':\x20'+_0x46b1fa['label']);_0x46b1fa[_0x4f3707(0x165)]&&(_0x4ce7ac+=a15_0x27c881[_0x4f3707(0x186)]('\x20['+_0x46b1fa[_0x4f3707(0x165)]+']'));console['log'](_0x4ce7ac);_0x46b1fa['hint']&&console[_0x4f3707(0x15d)]('\x20\x20\x20\x20'+a15_0x27c881['dim'](_0x46b1fa[_0x4f3707(0x16a)]));if(_0x46b1fa['options']){const _0x33b75c=_0x46b1fa['options']['map'](_0x498769=>_0x498769['value'])['join'](',\x20');console[_0x4f3707(0x15d)](_0x4f3707(0x159)+a15_0x27c881['yellow'](_0x33b75c));}_0x46b1fa[_0x4f3707(0x17b)]!==undefined&&_0x46b1fa[_0x4f3707(0x17b)]!==null&&console['log']('\x20\x20\x20\x20Default:\x20'+a15_0x27c881['blue'](String(_0x46b1fa[_0x4f3707(0x17b)])));if(_0x46b1fa['criteria']){const _0x2eb327=Object['entries'](_0x46b1fa[_0x4f3707(0x1a2)])[_0x4f3707(0x1bd)](([_0x12c438,_0x29c776])=>_0x12c438+'='+JSON[_0x4f3707(0x190)](_0x29c776))['join'](',\x20');console[_0x4f3707(0x15d)](_0x4f3707(0x15e)+a15_0x27c881['dim']('Show\x20when:\x20'+_0x2eb327));}}}
1
+ const a15_0x46af76=a15_0x2214;(function(_0x19c640,_0x5ce454){const _0x205b87=a15_0x2214,_0x2971c5=_0x19c640();while(!![]){try{const _0x3102f3=parseInt(_0x205b87(0xdb))/0x1*(-parseInt(_0x205b87(0xfb))/0x2)+parseInt(_0x205b87(0xb1))/0x3+parseInt(_0x205b87(0xe9))/0x4+parseInt(_0x205b87(0x99))/0x5+parseInt(_0x205b87(0xb3))/0x6*(parseInt(_0x205b87(0xb2))/0x7)+-parseInt(_0x205b87(0xc3))/0x8+parseInt(_0x205b87(0x106))/0x9*(parseInt(_0x205b87(0xa1))/0xa);if(_0x3102f3===_0x5ce454)break;else _0x2971c5['push'](_0x2971c5['shift']());}catch(_0xfc1f5e){_0x2971c5['push'](_0x2971c5['shift']());}}}(a15_0x3fe2,0x3fbfc));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a15_0x2214(_0x2c4b78,_0x14d557){_0x2c4b78=_0x2c4b78-0x98;const _0x3fe27b=a15_0x3fe2();let _0x221412=_0x3fe27b[_0x2c4b78];return _0x221412;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a15_0x3fe2(){const _0x35dadc=['name','log','\x27\x20as\x20connector\x20type','object','40tiFold','connection:types','Options:\x20','connection:schema','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','verbose','criteria','properties','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','>=\x20','join','repeat','✔\x20Found\x20','Show\x20connection\x20details','bold','getMetadata','262146hiTlzf','7nJeYfV','468738Fvpxdp','table','hint','listTypes','connection:list','entries','options','data','resolve','owner','type','cyan','length','\x20\x20\x20\x20','label','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.','2705664ukbdrB','Site:\x20','Type:\x20','blue','✔\x20Found\x20schema\x20for\x20connection\x20\x27','connection:show','\x0aConnector:\x20','✔\x20Found\x20connection:\x20','legacy_settings','title','\x20connector\x20type','Listing\x20connector\x20types...','Name:\x20','execute','dim','List\x20available\x20connector\x20types','map','yellow','stringify','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','connection','Show\x20when:\x20','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','enumeration','3zMowpT','\x27...','Looking\x20up\x20connection:\x20','validate','error','findByName','limit','\x20\x20\x20\x20Options:\x20','\x20-\x20','\x0aNo\x20credential\x20settings\x20defined','max','\x20connection','description','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.','1549656wIvYLN','padStart','input','credential','hidden','\x20\x20\x20\x20Default:\x20','legacy','record','maximum','\x20[record]','\x0aAvailable\x20fields:','Default:\x20','\x0aCredential\x20settings:','localeCompare','default_value','\x0aNo\x20fields\x20defined\x20in\x20schema','filter','Listing\x20connections...','279878rjkBwJ','site','Resolving\x20connector\x20type\x20or\x20name:\x20','connection:settings','Treating\x20\x27','push','minimum','Fetching\x20schema\x20for\x20\x27','output','green','value','110286xlPoJm','getOutputSchema','Fetching\x20connection\x20\x27','2086030MghcFp','✔\x20Resolved\x20\x27','Fetching\x20settings\x20for\x20connector\x20type:\x20','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'];a15_0x3fe2=function(){return _0x35dadc;};return a15_0x3fe2();}import a15_0x1f3233 from'chalk';function normalizeSchemaForDisplay(_0x3073c5){const _0x4c11b2=a15_0x2214,_0x5db87f=_0x3073c5[_0x4c11b2(0xa8)]||[],_0x314e17=_0x5db87f['find'](_0xf0a6e2=>_0xf0a6e2[_0x4c11b2(0x9d)]===_0x4c11b2(0xcb)&&_0xf0a6e2[_0x4c11b2(0xbd)]===_0x4c11b2(0xf0)&&_0xf0a6e2[_0x4c11b2(0xa8)]);if(_0x314e17?.[_0x4c11b2(0xa8)]){const _0x59834a=_0x5db87f[_0x4c11b2(0xf9)](_0x69e23c=>_0x69e23c['name']!=='legacy'&&_0x69e23c[_0x4c11b2(0x9d)]!==_0x4c11b2(0xcb));return[..._0x59834a,..._0x314e17[_0x4c11b2(0xa8)]];}return _0x5db87f[_0x4c11b2(0xf9)](_0x5a9832=>_0x5a9832['name']!==_0x4c11b2(0xef));}function printSchemaFields(_0x1006c4,_0x42827a){const _0x212c08=a15_0x2214,_0x1eb39b='\x20\x20'[_0x212c08(0xac)](_0x42827a+0x1),_0x4742df='\x20\x20'[_0x212c08(0xac)](_0x42827a+0x2);for(const _0x46524c of _0x1006c4){if(!_0x46524c[_0x212c08(0x9d)])continue;const _0x19beef=_0x46524c[_0x212c08(0xbd)]===_0x212c08(0xf0)&&_0x46524c[_0x212c08(0xa8)]&&_0x46524c[_0x212c08(0xa8)][_0x212c08(0xbf)]>0x0&&_0x46524c[_0x212c08(0x9d)]!=='legacy_settings';let _0x1a5fb4=''+_0x1eb39b+a15_0x1f3233[_0x212c08(0x104)](_0x46524c[_0x212c08(0x9d)]);_0x46524c[_0x212c08(0xcc)]&&(_0x1a5fb4+=':\x20'+_0x46524c['title']);if(_0x46524c[_0x212c08(0xeb)])_0x1a5fb4+=a15_0x1f3233[_0x212c08(0xd1)]('\x20['+_0x46524c[_0x212c08(0xeb)]+']');else _0x19beef&&(_0x1a5fb4+=a15_0x1f3233[_0x212c08(0xd1)](_0x212c08(0xf2)));console[_0x212c08(0x9e)](_0x1a5fb4);_0x46524c[_0x212c08(0xe7)]&&console[_0x212c08(0x9e)](''+_0x4742df+a15_0x1f3233[_0x212c08(0xd1)](_0x46524c[_0x212c08(0xe7)]));if(_0x46524c[_0x212c08(0xda)]){const _0x4a80c3=_0x46524c[_0x212c08(0xda)][_0x212c08(0xd3)](_0x5df0ab=>typeof _0x5df0ab===_0x212c08(0xa0)&&'value'in _0x5df0ab?_0x5df0ab[_0x212c08(0x105)]:_0x5df0ab)['join'](',\x20');console[_0x212c08(0x9e)](_0x4742df+_0x212c08(0xa3)+a15_0x1f3233[_0x212c08(0xd4)](_0x4a80c3));}_0x46524c[_0x212c08(0xf7)]!==undefined&&console[_0x212c08(0x9e)](_0x4742df+_0x212c08(0xf4)+a15_0x1f3233[_0x212c08(0xc6)](String(_0x46524c[_0x212c08(0xf7)])));if(_0x46524c['minimum']!==undefined||_0x46524c['maximum']!==undefined){const _0x44277e=_0x46524c[_0x212c08(0x101)]!==undefined&&_0x46524c[_0x212c08(0xf1)]!==undefined?_0x46524c[_0x212c08(0x101)]+_0x212c08(0xe3)+_0x46524c['maximum']:_0x46524c[_0x212c08(0x101)]!==undefined?_0x212c08(0xaa)+_0x46524c['minimum']:'<=\x20'+_0x46524c['maximum'];console[_0x212c08(0x9e)](_0x4742df+'Range:\x20'+a15_0x1f3233[_0x212c08(0xc6)](_0x44277e));}if(_0x46524c['criteria']){const _0x199ed8=Object[_0x212c08(0xb8)](_0x46524c[_0x212c08(0xa7)])[_0x212c08(0xd3)](([_0x33569b,_0x343d6c])=>_0x33569b+'='+JSON['stringify'](_0x343d6c))[_0x212c08(0xab)](',\x20');console[_0x212c08(0x9e)](''+_0x4742df+a15_0x1f3233[_0x212c08(0xd1)](_0x212c08(0xd8)+_0x199ed8));}_0x19beef&&_0x46524c[_0x212c08(0xa8)]&&printSchemaFields(_0x46524c[_0x212c08(0xa8)],_0x42827a+0x1);}}export class ConnectionListCommand extends BaseCommand{[a15_0x46af76(0x9d)]=a15_0x46af76(0xb7);[a15_0x46af76(0xe7)]='List\x20all\x20result\x20output\x20connections';async['execute'](_0x40ed6b){const _0x3d373e=a15_0x46af76,{options:_0x5e05ea,tdx:_0x7c1244}=_0x40ed6b;_0x5e05ea[_0x3d373e(0xa6)]&&console[_0x3d373e(0xdf)](_0x3d373e(0xc4)+_0x5e05ea[_0x3d373e(0xfc)]);const _0x16eb42=resolveLimit(_0x5e05ea[_0x3d373e(0xe1)],DEFAULT_LISTING_LIMIT),_0xe74e45=await withSpinner(_0x3d373e(0xfa),()=>_0x7c1244[_0x3d373e(0xd7)]['list'](),{'verbose':_0x5e05ea[_0x3d373e(0xa6)]}),_0x17ae40=_0xe74e45[_0x3d373e(0xba)];console[_0x3d373e(0xdf)](_0x3d373e(0xad)+_0x17ae40['length']+_0x3d373e(0xe6)+(_0x17ae40[_0x3d373e(0xbf)]!==0x1?'s':''));if(isStructuredFormat(_0x5e05ea)){const _0x18eb42=_0x17ae40['slice'](0x0,_0x16eb42);await handleSDKOutput(_0x18eb42,{..._0x5e05ea,'limit':_0x16eb42});}else{const _0x49a2d5=_0x17ae40['length']>0x0?Math[_0x3d373e(0xe5)](..._0x17ae40[_0x3d373e(0xd3)](_0xff104e=>_0xff104e[_0x3d373e(0xbd)][_0x3d373e(0xbf)])):0x0,_0x5ef766=[];for(const _0x419aa5 of _0x17ae40){const _0x40711e=a15_0x1f3233[_0x3d373e(0xbe)](_0x419aa5[_0x3d373e(0xbd)]['padStart'](_0x49a2d5)),_0x286736=_0x419aa5[_0x3d373e(0xbc)]?.[_0x3d373e(0x9d)]?_0x3d373e(0xe3)+a15_0x1f3233[_0x3d373e(0xd1)](_0x419aa5['owner'][_0x3d373e(0x9d)]):'';_0x5ef766[_0x3d373e(0x100)](_0x40711e+'\x20\x20'+_0x419aa5[_0x3d373e(0x9d)]+_0x286736);}await writeOutput(_0x5ef766['join']('\x0a'),_0x5e05ea['output'],_0x3d373e(0xb4));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a15_0x46af76(0x9d)]=a15_0x46af76(0xc8);[a15_0x46af76(0xe7)]=a15_0x46af76(0xae);['validate'](_0x17f998){const _0x11ec52=a15_0x46af76,{args:_0x27d3b3}=_0x17f998;if(!_0x27d3b3[0x0])return _0x11ec52(0x9c);return undefined;}async[a15_0x46af76(0xd0)](_0x67d553){const _0x22a146=a15_0x46af76,{options:_0x5ad781,args:_0x4a04e3,tdx:_0x46d693}=_0x67d553,_0x481b48=_0x4a04e3[0x0];_0x5ad781[_0x22a146(0xa6)]&&(console[_0x22a146(0xdf)]('Site:\x20'+_0x5ad781['site']),console['error'](_0x22a146(0xdd)+_0x481b48));const _0x2f3917=await withSpinner(_0x22a146(0x98)+_0x481b48+_0x22a146(0xdc),()=>_0x46d693[_0x22a146(0xd7)][_0x22a146(0xbb)](_0x481b48),{'verbose':_0x5ad781[_0x22a146(0xa6)]}),_0x564e7e=_0x2f3917[_0x22a146(0xba)];return console[_0x22a146(0xdf)](_0x22a146(0xca)+_0x564e7e['name']),await handleSingleObjectOutput(_0x564e7e,_0x5ad781),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a15_0x46af76(0xa4);['description']=a15_0x46af76(0xa5);[a15_0x46af76(0xde)](_0x1aeddb){const _0x8fa772=a15_0x46af76,{args:_0x1d36e4}=_0x1aeddb;if(!_0x1d36e4[0x0])return _0x8fa772(0xe8);return undefined;}async[a15_0x46af76(0xd0)](_0x341589){const _0x499f17=a15_0x46af76,{options:_0x30dbc8,args:_0x46604f,tdx:_0x30f8e5}=_0x341589,_0x537fad=_0x46604f[0x0];_0x30dbc8[_0x499f17(0xa6)]&&(console[_0x499f17(0xdf)](_0x499f17(0xc4)+_0x30dbc8[_0x499f17(0xfc)]),console[_0x499f17(0xdf)](_0x499f17(0xfd)+_0x537fad));let _0x3a7878=_0x537fad,_0x3f742a;try{const _0x3f942d=await _0x30f8e5[_0x499f17(0xd7)][_0x499f17(0xe0)](_0x537fad);_0x3f942d&&(_0x3a7878=_0x3f942d['type'],_0x3f742a=_0x3f942d[_0x499f17(0x9d)],_0x30dbc8[_0x499f17(0xa6)]&&console['error'](_0x499f17(0x9a)+_0x537fad+_0x499f17(0xd6)+_0x3a7878));}catch{_0x30dbc8[_0x499f17(0xa6)]&&console[_0x499f17(0xdf)](_0x499f17(0xff)+_0x537fad+_0x499f17(0x9f));}const _0x8ee477=await withSpinner(_0x499f17(0x102)+_0x3a7878+_0x499f17(0xdc),()=>_0x30f8e5[_0x499f17(0xd7)][_0x499f17(0x107)](_0x3a7878),{'verbose':_0x30dbc8[_0x499f17(0xa6)]}),_0x5eb2d9=_0x8ee477[_0x499f17(0xba)];_0x3f742a?console[_0x499f17(0xdf)](_0x499f17(0xc7)+_0x3f742a+'\x27\x20(type:\x20'+_0x3a7878+')'):console['error']('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x3a7878);if(isStructuredFormat(_0x30dbc8))await handleSingleObjectOutput(_0x5eb2d9,_0x30dbc8);else{const _0x556d56=normalizeSchemaForDisplay(_0x5eb2d9);_0x3f742a?(console[_0x499f17(0x9e)]('\x0aConnection:\x20'+a15_0x1f3233['cyan'](_0x3f742a)),console[_0x499f17(0x9e)](_0x499f17(0xc5)+a15_0x1f3233[_0x499f17(0xd1)](_0x3a7878))):console[_0x499f17(0x9e)](_0x499f17(0xc9)+a15_0x1f3233[_0x499f17(0xbe)](_0x3a7878)),_0x556d56['length']>0x0?(console['log'](a15_0x1f3233[_0x499f17(0xaf)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x556d56,0x0)):console[_0x499f17(0x9e)](a15_0x1f3233['dim'](_0x499f17(0xf8)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a15_0x46af76(0x9d)]=a15_0x46af76(0xa2);[a15_0x46af76(0xe7)]=a15_0x46af76(0xd2);async[a15_0x46af76(0xd0)](_0x3f6e1f){const _0xa9f37d=a15_0x46af76,{options:_0x103673,tdx:_0x3f99a7}=_0x3f6e1f;_0x103673[_0xa9f37d(0xa6)]&&console[_0xa9f37d(0xdf)]('Site:\x20'+_0x103673['site']);const _0x2d02f5=await withSpinner(_0xa9f37d(0xce),()=>_0x3f99a7[_0xa9f37d(0xd7)][_0xa9f37d(0xb6)](),{'verbose':_0x103673[_0xa9f37d(0xa6)]}),_0x175411=_0x2d02f5[_0xa9f37d(0xba)]['sort']((_0xa9f56d,_0x52b36c)=>_0xa9f56d['type'][_0xa9f37d(0xf6)](_0x52b36c[_0xa9f37d(0xbd)]));console['error']('✔\x20Found\x20'+_0x175411[_0xa9f37d(0xbf)]+_0xa9f37d(0xcd)+(_0x175411[_0xa9f37d(0xbf)]!==0x1?'s':''));if(isStructuredFormat(_0x103673))await handleSDKOutput(_0x175411,_0x103673);else{const _0x1a474a=_0x175411[_0xa9f37d(0xbf)]>0x0?Math[_0xa9f37d(0xe5)](..._0x175411[_0xa9f37d(0xd3)](_0x51dad3=>_0x51dad3[_0xa9f37d(0xbd)][_0xa9f37d(0xbf)])):0x0,_0x4fa862=[];for(const _0x324a6c of _0x175411){const _0x1d447b=a15_0x1f3233[_0xa9f37d(0xbe)](_0x324a6c[_0xa9f37d(0xbd)][_0xa9f37d(0xea)](_0x1a474a));_0x4fa862[_0xa9f37d(0x100)](_0x1d447b+'\x20\x20'+_0x324a6c[_0xa9f37d(0x9d)]);}await writeOutput(_0x4fa862[_0xa9f37d(0xab)]('\x0a'),_0x103673[_0xa9f37d(0x103)],_0xa9f37d(0xb4));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a15_0x46af76(0x9d)]=a15_0x46af76(0xfe);['description']=a15_0x46af76(0xa9);[a15_0x46af76(0xde)](_0xcc0636){const _0x5ebf98=a15_0x46af76,{args:_0x2d196e}=_0xcc0636;if(!_0x2d196e[0x0])return _0x5ebf98(0xc2);return undefined;}async[a15_0x46af76(0xd0)](_0x206ea7){const _0x11800b=a15_0x46af76,{options:_0x2cb82c,args:_0x5dbd59,tdx:_0x35603d}=_0x206ea7,_0x53f8d9=_0x5dbd59[0x0];_0x2cb82c[_0x11800b(0xa6)]&&(console[_0x11800b(0xdf)](_0x11800b(0xc4)+_0x2cb82c[_0x11800b(0xfc)]),console[_0x11800b(0xdf)](_0x11800b(0x9b)+_0x53f8d9));const _0xefce94=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x53f8d9+_0x11800b(0xdc),()=>_0x35603d[_0x11800b(0xd7)][_0x11800b(0xb0)](_0x53f8d9),{'verbose':_0x2cb82c['verbose']}),_0x278831=_0xefce94['data'];console[_0x11800b(0xdf)](_0x11800b(0xd9)+_0x53f8d9);if(isStructuredFormat(_0x2cb82c))await handleSingleObjectOutput(_0x278831,_0x2cb82c);else{console['log'](_0x11800b(0xc9)+a15_0x1f3233['cyan'](_0x53f8d9)),console['log'](_0x11800b(0xcf)+_0x278831['name']);const _0x3b71da=_0x278831['settings']||[],_0x3c6350=_0x3b71da['filter'](_0x5f51a6=>_0x5f51a6[_0x11800b(0xec)]);_0x3c6350[_0x11800b(0xbf)]>0x0&&(console['log'](a15_0x1f3233['bold'](_0x11800b(0xf5))),printMetadataSettings(_0x3c6350));let _0x25716d=![];try{const _0x186196=await _0x35603d[_0x11800b(0xd7)][_0x11800b(0x107)](_0x53f8d9),_0x4c4d53=normalizeSchemaForDisplay(_0x186196);_0x4c4d53[_0x11800b(0xbf)]>0x0&&(console[_0x11800b(0x9e)](a15_0x1f3233[_0x11800b(0xaf)](_0x11800b(0xf3))),printSchemaFields(_0x4c4d53,0x0),_0x25716d=!![]);}catch{const _0x415fa2=_0x3b71da[_0x11800b(0xf9)](_0x5e65b2=>!_0x5e65b2[_0x11800b(0xec)]);_0x415fa2[_0x11800b(0xbf)]>0x0&&(console[_0x11800b(0x9e)](a15_0x1f3233[_0x11800b(0xaf)]('\x0aAvailable\x20fields:')),printMetadataSettings(_0x415fa2),_0x25716d=!![]);}!_0x25716d&&_0x2cb82c[_0x11800b(0xa6)]&&console[_0x11800b(0xdf)](a15_0x1f3233['dim']('No\x20available\x20fields\x20for\x20this\x20connector')),_0x3c6350[_0x11800b(0xbf)]===0x0&&console['log'](a15_0x1f3233[_0x11800b(0xd1)](_0x11800b(0xe4)));}return 0x0;}}function printMetadataSettings(_0x22cbab){const _0x29d3cd=a15_0x46af76;for(const _0x163e1b of _0x22cbab){if(!_0x163e1b['name'])continue;if(_0x163e1b[_0x29d3cd(0xed)])continue;let _0x53bcca='\x20\x20'+a15_0x1f3233['green'](_0x163e1b[_0x29d3cd(0x9d)]);_0x163e1b[_0x29d3cd(0xc1)]&&(_0x53bcca+=':\x20'+_0x163e1b['label']);_0x163e1b[_0x29d3cd(0xbd)]&&(_0x53bcca+=a15_0x1f3233[_0x29d3cd(0xd1)]('\x20['+_0x163e1b[_0x29d3cd(0xbd)]+']'));console[_0x29d3cd(0x9e)](_0x53bcca);_0x163e1b[_0x29d3cd(0xb5)]&&console[_0x29d3cd(0x9e)](_0x29d3cd(0xc0)+a15_0x1f3233[_0x29d3cd(0xd1)](_0x163e1b['hint']));if(_0x163e1b[_0x29d3cd(0xb9)]){const _0x560613=_0x163e1b['options'][_0x29d3cd(0xd3)](_0x184124=>_0x184124[_0x29d3cd(0x105)])[_0x29d3cd(0xab)](',\x20');console[_0x29d3cd(0x9e)](_0x29d3cd(0xe2)+a15_0x1f3233['yellow'](_0x560613));}_0x163e1b[_0x29d3cd(0xf7)]!==undefined&&_0x163e1b[_0x29d3cd(0xf7)]!==null&&console[_0x29d3cd(0x9e)](_0x29d3cd(0xee)+a15_0x1f3233['blue'](String(_0x163e1b['default_value'])));if(_0x163e1b['criteria']){const _0x53b744=Object[_0x29d3cd(0xb8)](_0x163e1b[_0x29d3cd(0xa7)])[_0x29d3cd(0xd3)](([_0x380285,_0x3373f8])=>_0x380285+'='+JSON[_0x29d3cd(0xd5)](_0x3373f8))[_0x29d3cd(0xab)](',\x20');console['log'](_0x29d3cd(0xc0)+a15_0x1f3233['dim']('Show\x20when:\x20'+_0x53b744));}}}
@@ -1 +1 @@
1
- const a16_0x1e8f72=a16_0x442c;(function(_0x548844,_0x13c8cb){const _0x39dbcf=a16_0x442c,_0xf7a8b3=_0x548844();while(!![]){try{const _0x3bde8f=parseInt(_0x39dbcf(0x96))/0x1+-parseInt(_0x39dbcf(0x8e))/0x2*(-parseInt(_0x39dbcf(0x8d))/0x3)+-parseInt(_0x39dbcf(0x9d))/0x4+-parseInt(_0x39dbcf(0x87))/0x5+parseInt(_0x39dbcf(0x84))/0x6+-parseInt(_0x39dbcf(0x92))/0x7+-parseInt(_0x39dbcf(0x9f))/0x8;if(_0x3bde8f===_0x13c8cb)break;else _0xf7a8b3['push'](_0xf7a8b3['shift']());}catch(_0x252157){_0xf7a8b3['push'](_0xf7a8b3['shift']());}}}(a16_0x553c,0x85af0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a16_0x553c(){const _0x508f2a=['Site:\x20','243838LkRMrx','Pattern:\x20','limit','site','700287kzqcii','length','\x20\x20Cause:\x20','Listing\x20databases...','verbose','database_name','query','2412068JfIsul','execute','656136CenvPF','Error:\x20','3105132Ywardf','data','cause','2491330vwAVHu','List\x20all\x20databases','message','listDatabases','error','\x20database','182631upCbbP','18GzVlxb','✔\x20Found\x20','📦\x20'];a16_0x553c=function(){return _0x508f2a;};return a16_0x553c();}function a16_0x442c(_0x1883b9,_0x3a9fad){_0x1883b9=_0x1883b9-0x83;const _0x553c8f=a16_0x553c();let _0x442cf5=_0x553c8f[_0x1883b9];return _0x442cf5;}export class DatabasesCommand extends BaseCommand{['name']='databases';['description']=a16_0x1e8f72(0x88);async[a16_0x1e8f72(0x9e)](_0x23fc87){const _0x19517a=a16_0x1e8f72,{options:_0x596bd5,args:_0x548acc,tdx:_0xe6197e}=_0x23fc87,_0x206152=_0x548acc[0x0];try{_0x596bd5[_0x19517a(0x9a)]&&(console['error'](_0x19517a(0x91)+_0x596bd5[_0x19517a(0x95)]),_0x206152&&console[_0x19517a(0x8b)](_0x19517a(0x93)+_0x206152));const _0x3c0a55=resolveLimit(_0x596bd5[_0x19517a(0x94)],DEFAULT_LISTING_LIMIT),_0x4ce4bd=await withSpinner(_0x19517a(0x99),()=>_0xe6197e[_0x19517a(0x9c)][_0x19517a(0x8a)](_0x206152,_0x3c0a55),{'verbose':_0x596bd5[_0x19517a(0x9a)]}),_0x30783a=_0x4ce4bd[_0x19517a(0x85)];console['error'](_0x19517a(0x8f)+_0x30783a[_0x19517a(0x97)]+_0x19517a(0x8c)+(_0x30783a[_0x19517a(0x97)]!==0x1?'s':''));if(isStructuredFormat(_0x596bd5))await handleSDKOutput(_0x30783a,{..._0x596bd5,'limit':_0x3c0a55});else for(const _0x41cb47 of _0x30783a){console['log'](_0x19517a(0x90)+_0x41cb47[_0x19517a(0x9b)]);}return 0x0;}catch(_0x243940){if(_0x243940 instanceof SDKError)return console[_0x19517a(0x8b)](_0x19517a(0x83)+_0x243940[_0x19517a(0x89)]),_0x243940[_0x19517a(0x86)]&&console['error'](_0x19517a(0x98)+_0x243940[_0x19517a(0x86)]),0x1;throw _0x243940;}}}
1
+ function a16_0x2dfc(){const _0x241a11=['Listing\x20databases...','name','3347260XlebHj','length','query','Pattern:\x20','📦\x20','\x20database','4ASsbrw','log','Error:\x20','message','cause','databases','listDatabases','8342WIdGPj','5361704AZvMHQ','Site:\x20','database_name','site','339355UKuDNP','error','2719530qTnVWE','138zpmdNS','description','2471178CMAiIN','1460601YwtWUc','execute'];a16_0x2dfc=function(){return _0x241a11;};return a16_0x2dfc();}const a16_0x191eb4=a16_0x3103;(function(_0x2716d3,_0xe68811){const _0x3de0e3=a16_0x3103,_0x1934e5=_0x2716d3();while(!![]){try{const _0x215b3e=parseInt(_0x3de0e3(0x1ac))/0x1*(-parseInt(_0x3de0e3(0x1b4))/0x2)+-parseInt(_0x3de0e3(0x19a))/0x3+parseInt(_0x3de0e3(0x1a5))/0x4*(parseInt(_0x3de0e3(0x1b1))/0x5)+parseInt(_0x3de0e3(0x1b3))/0x6+parseInt(_0x3de0e3(0x19f))/0x7+parseInt(_0x3de0e3(0x1ad))/0x8+parseInt(_0x3de0e3(0x19b))/0x9;if(_0x215b3e===_0xe68811)break;else _0x1934e5['push'](_0x1934e5['shift']());}catch(_0x4a5f93){_0x1934e5['push'](_0x1934e5['shift']());}}}(a16_0x2dfc,0x69964));function a16_0x3103(_0x300caa,_0x10a6eb){_0x300caa=_0x300caa-0x199;const _0x2dfc46=a16_0x2dfc();let _0x3103c1=_0x2dfc46[_0x300caa];return _0x3103c1;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a16_0x191eb4(0x19e)]=a16_0x191eb4(0x1aa);[a16_0x191eb4(0x199)]='List\x20all\x20databases';async[a16_0x191eb4(0x19c)](_0x304527){const _0x123348=a16_0x191eb4,{options:_0x18edde,args:_0x3e6cca,tdx:_0x3a5230}=_0x304527,_0x47a49c=_0x3e6cca[0x0];try{_0x18edde['verbose']&&(console[_0x123348(0x1b2)](_0x123348(0x1ae)+_0x18edde[_0x123348(0x1b0)]),_0x47a49c&&console[_0x123348(0x1b2)](_0x123348(0x1a2)+_0x47a49c));const _0x5c652a=resolveLimit(_0x18edde['limit'],DEFAULT_LISTING_LIMIT),_0x3aa0b3=await withSpinner(_0x123348(0x19d),()=>_0x3a5230[_0x123348(0x1a1)][_0x123348(0x1ab)](_0x47a49c,_0x5c652a),{'verbose':_0x18edde['verbose']}),_0x125eb9=_0x3aa0b3['data'];console['error']('✔\x20Found\x20'+_0x125eb9[_0x123348(0x1a0)]+_0x123348(0x1a4)+(_0x125eb9['length']!==0x1?'s':''));if(isStructuredFormat(_0x18edde))await handleSDKOutput(_0x125eb9,{..._0x18edde,'limit':_0x5c652a});else for(const _0x779072 of _0x125eb9){console[_0x123348(0x1a6)](_0x123348(0x1a3)+_0x779072[_0x123348(0x1af)]);}return 0x0;}catch(_0x2e3e1a){if(_0x2e3e1a instanceof SDKError)return console[_0x123348(0x1b2)](_0x123348(0x1a7)+_0x2e3e1a[_0x123348(0x1a8)]),_0x2e3e1a[_0x123348(0x1a9)]&&console['error']('\x20\x20Cause:\x20'+_0x2e3e1a[_0x123348(0x1a9)]),0x1;throw _0x2e3e1a;}}}