@treasuredata/tdx 2026.3.55 → 2026.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) 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.d.ts.map +1 -1
  143. package/dist/sdk/segment/file-discovery.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js.map +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
  153. package/dist/sdk/segment/push-workflow.js +1 -1
  154. package/dist/sdk/segment/push-workflow.js.map +1 -1
  155. package/dist/sdk/segment/resolution-context.js +1 -1
  156. package/dist/sdk/segment/segment-path-parser.js +1 -1
  157. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  158. package/dist/sdk/segment/segment-validator.js +1 -1
  159. package/dist/sdk/segment/target-resolution.js +1 -1
  160. package/dist/sdk/segment/tdx-config.js +1 -1
  161. package/dist/sdk/segment/types/activation-schema.js +1 -1
  162. package/dist/sdk/segment/types/journey-def.js +1 -1
  163. package/dist/sdk/segment/types/journey-schema.js +1 -1
  164. package/dist/sdk/segment/types/segment-def.js +1 -1
  165. package/dist/sdk/segment/types/segment-schema.js +1 -1
  166. package/dist/sdk/segment/validate-files.js +1 -1
  167. package/dist/sdk/segment/yaml-validator.js +1 -1
  168. package/dist/sdk/segment.js +1 -1
  169. package/dist/sdk/types/index.js +1 -1
  170. package/dist/sdk/types/progress.js +1 -1
  171. package/dist/sdk/types/workspace.js +1 -1
  172. package/dist/sdk/user.js +1 -1
  173. package/dist/sdk/util/format-detector.js +1 -1
  174. package/dist/sdk/util/formatters.js +1 -1
  175. package/dist/sdk/util/index.js +1 -1
  176. package/dist/sdk/util/paginate.js +1 -1
  177. package/dist/sdk/util/tree-formatter.js +1 -1
  178. package/dist/sdk/workflow/archive-validation.js +1 -1
  179. package/dist/sdk/workflow/clone-workflow.js +1 -1
  180. package/dist/sdk/workflow/index.js +1 -1
  181. package/dist/sdk/workflow/pull-workflow.js +1 -1
  182. package/dist/sdk/workflow/push-workflow.js +1 -1
  183. package/dist/sdk/workflow/tdx-config.js +1 -1
  184. package/dist/sdk/workflow/workflow-utils.js +1 -1
  185. package/dist/sdk/workspace/frontmatter.js +1 -1
  186. package/dist/sdk/workspace/git.js +1 -1
  187. package/dist/sdk/workspace/index.d.ts.map +1 -1
  188. package/dist/sdk/workspace/index.js +1 -1
  189. package/dist/sdk/workspace/index.js.map +1 -1
  190. package/dist/sdk/workspace/templates.js +1 -1
  191. package/dist/sdk/workspace/weekly.js +1 -1
  192. package/dist/sdk/workspace/wikilinks.js +1 -1
  193. package/dist/test-utils/command-runner.js +1 -1
  194. package/dist/test-utils/factories.js +1 -1
  195. package/dist/test-utils/fixtures.js +1 -1
  196. package/dist/test-utils/http-mock.js +1 -1
  197. package/dist/test-utils/index.js +1 -1
  198. package/dist/utils/async.js +1 -1
  199. package/dist/utils/colors.js +1 -1
  200. package/dist/utils/diff.js +1 -1
  201. package/dist/utils/file-permissions.js +1 -1
  202. package/dist/utils/file-reader.js +1 -1
  203. package/dist/utils/github-releases.js +1 -1
  204. package/dist/utils/global-cache.js +1 -1
  205. package/dist/utils/json-loader.js +1 -1
  206. package/dist/utils/local-cache.js +1 -1
  207. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  208. package/dist/utils/logger/formatters/index.js +1 -1
  209. package/dist/utils/logger/handlers/console-handler.js +1 -1
  210. package/dist/utils/logger/handlers/file-handler.js +1 -1
  211. package/dist/utils/logger/handlers/index.js +1 -1
  212. package/dist/utils/logger/handlers/null-handler.js +1 -1
  213. package/dist/utils/logger/index.js +1 -1
  214. package/dist/utils/logger/logger.js +1 -1
  215. package/dist/utils/logger/types.js +1 -1
  216. package/dist/utils/option-validation.js +1 -1
  217. package/dist/utils/process.js +1 -1
  218. package/dist/utils/process.js.map +1 -1
  219. package/dist/utils/prompt.js +1 -1
  220. package/dist/utils/spinner.js +1 -1
  221. package/dist/utils/sse-parser.js +1 -1
  222. package/dist/utils/string-utils.js +1 -1
  223. package/dist/utils/table-ref-parser.js +1 -1
  224. package/dist/utils/tdx-logger.js +1 -1
  225. package/dist/utils/version-check.js +1 -1
  226. package/package.json +1 -1
@@ -1 +1 @@
1
- const a8_0x515b60=a8_0x33fa;(function(_0x514d0c,_0x52cbc0){const _0x1f64cc=a8_0x33fa,_0x1b213c=_0x514d0c();while(!![]){try{const _0x2801f9=-parseInt(_0x1f64cc(0x152))/0x1*(-parseInt(_0x1f64cc(0x100))/0x2)+parseInt(_0x1f64cc(0x14c))/0x3*(-parseInt(_0x1f64cc(0x12e))/0x4)+-parseInt(_0x1f64cc(0x139))/0x5*(-parseInt(_0x1f64cc(0x155))/0x6)+-parseInt(_0x1f64cc(0x179))/0x7*(parseInt(_0x1f64cc(0x165))/0x8)+parseInt(_0x1f64cc(0x126))/0x9+-parseInt(_0x1f64cc(0x113))/0xa+parseInt(_0x1f64cc(0x163))/0xb*(parseInt(_0x1f64cc(0x160))/0xc);if(_0x2801f9===_0x52cbc0)break;else _0x1b213c['push'](_0x1b213c['shift']());}catch(_0x4c365b){_0x1b213c['push'](_0x1b213c['shift']());}}}(a8_0x1531,0x26db3));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0xb443bc from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x34f308 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{['name']='cas:list';[a8_0x515b60(0x125)]=a8_0x515b60(0x12a);async[a8_0x515b60(0x158)](_0x417dd8){const _0x52cb68=a8_0x515b60,{options:_0x58a320,tdx:_0x23dca9}=_0x417dd8,_0x18686f=await withProgressSpinner(_0x52cb68(0x17b),()=>_0x23dca9['cas'][_0x52cb68(0x166)](),{'verbose':_0x58a320[_0x52cb68(0x13c)]}),_0x42854b=_0x18686f[_0x52cb68(0x138)];if(isStructuredFormat(_0x58a320))return await handleSDKOutput(_0x42854b,_0x58a320),0x0;if(_0x42854b['length']===0x0)return console[_0x52cb68(0x17c)](a8_0xb443bc[_0x52cb68(0x12d)](_0x52cb68(0x106))),0x0;console[_0x52cb68(0x17c)](a8_0xb443bc[_0x52cb68(0x109)]('Found\x20'+_0x42854b[_0x52cb68(0x10c)]+_0x52cb68(0x115)));for(const _0x56ede8 of _0x42854b){const _0x78a620=_0x56ede8['population']?a8_0xb443bc[_0x52cb68(0x12d)]('\x20('+Number(_0x56ede8[_0x52cb68(0x114)])[_0x52cb68(0x16f)]()+')'):'',_0x525131=a8_0xb443bc['dim']('\x20'+_0x56ede8[_0x52cb68(0x15b)]+'.'+_0x56ede8[_0x52cb68(0x15e)]);console[_0x52cb68(0x17c)](_0x52cb68(0x135)+_0x56ede8[_0x52cb68(0x16c)]+_0x78a620+_0x525131),_0x56ede8[_0x52cb68(0x125)]&&console[_0x52cb68(0x17c)]('\x20\x20'+a8_0xb443bc[_0x52cb68(0x12d)](_0x56ede8[_0x52cb68(0x125)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{['name']='cas:desc';[a8_0x515b60(0x125)]=a8_0x515b60(0x131);async[a8_0x515b60(0x158)](_0x59f208){const _0x5a6c3d=a8_0x515b60,{options:_0x1af848,args:_0x3cd4be,tdx:_0x5c0229}=_0x59f208,_0x597c63=_0x3cd4be[0x0]||_0x1af848['composableAudience'];if(!_0x597c63)return console[_0x5a6c3d(0x156)](a8_0xb443bc[_0x5a6c3d(0x103)](_0x5a6c3d(0x169))),console[_0x5a6c3d(0x156)]('Use\x20'+a8_0xb443bc[_0x5a6c3d(0x157)](_0x5a6c3d(0x116))+_0x5a6c3d(0x107)+a8_0xb443bc[_0x5a6c3d(0x157)](_0x5a6c3d(0x148))),0x1;const _0x24a85e=await withProgressSpinner(_0x5a6c3d(0x104)+_0x597c63+_0x5a6c3d(0x11b),()=>_0x5c0229[_0x5a6c3d(0x11d)][_0x5a6c3d(0x141)](_0x597c63),{'verbose':_0x1af848[_0x5a6c3d(0x13c)]}),_0x4d80ef=_0x24a85e[_0x5a6c3d(0x138)];if(isStructuredFormat(_0x1af848))return await handleSingleObjectOutput(_0x4d80ef,_0x1af848),0x0;console[_0x5a6c3d(0x17c)](a8_0xb443bc['bold'](_0x4d80ef['name']));if(_0x4d80ef[_0x5a6c3d(0x125)])console['log'](a8_0xb443bc[_0x5a6c3d(0x12d)](_0x4d80ef[_0x5a6c3d(0x125)]));console[_0x5a6c3d(0x17c)](),console[_0x5a6c3d(0x17c)](a8_0xb443bc[_0x5a6c3d(0x122)](_0x5a6c3d(0x172))),console[_0x5a6c3d(0x17c)](_0x5a6c3d(0x164)+_0x4d80ef[_0x5a6c3d(0x15b)]),console['log'](_0x5a6c3d(0x147)+_0x4d80ef[_0x5a6c3d(0x15e)]),console[_0x5a6c3d(0x17c)](_0x5a6c3d(0x136)+_0x4d80ef[_0x5a6c3d(0x10e)]),console[_0x5a6c3d(0x17c)]();if(_0x4d80ef[_0x5a6c3d(0x13e)]?.[_0x5a6c3d(0x10c)]){console['log'](a8_0xb443bc[_0x5a6c3d(0x122)](_0x5a6c3d(0x13d)+_0x4d80ef[_0x5a6c3d(0x13e)][_0x5a6c3d(0x10c)]+')'));for(const _0x3bb5e5 of _0x4d80ef['attributes']){console[_0x5a6c3d(0x17c)]('\x20\x20'+a8_0xb443bc[_0x5a6c3d(0x129)](_0x3bb5e5[_0x5a6c3d(0x16c)])+_0x5a6c3d(0xff)+_0x3bb5e5[_0x5a6c3d(0x14e)]+'.'+_0x3bb5e5['table']+'.'+_0x3bb5e5[_0x5a6c3d(0x16a)]+'\x20('+a8_0xb443bc[_0x5a6c3d(0x12d)](_0x3bb5e5[_0x5a6c3d(0x137)])+')');}console[_0x5a6c3d(0x17c)]();}if(_0x4d80ef['behaviors']?.[_0x5a6c3d(0x10c)]){console[_0x5a6c3d(0x17c)](a8_0xb443bc[_0x5a6c3d(0x122)]('Behaviors\x20('+_0x4d80ef['behaviors'][_0x5a6c3d(0x10c)]+')'));for(const _0x309685 of _0x4d80ef[_0x5a6c3d(0x108)]){const _0x26fca7=_0x309685[_0x5a6c3d(0x143)]?_0x5a6c3d(0x121)+_0x309685[_0x5a6c3d(0x143)]+')':'';console['log']('\x20\x20'+a8_0xb443bc['bold'](_0x309685[_0x5a6c3d(0x16c)])+_0x5a6c3d(0xff)+_0x309685[_0x5a6c3d(0x14e)]+'.'+_0x309685['table']+_0x26fca7);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x515b60(0x16c)]=a8_0x515b60(0x14b);['description']=a8_0x515b60(0x151);async[a8_0x515b60(0x158)](_0x263582){const _0x15dc28=a8_0x515b60,{options:_0x131f82,args:_0x5188d4,tdx:_0xa1b8b9}=_0x263582,_0x25512a=_0x131f82,_0x12a516=_0x5188d4[0x0]||_0x131f82[_0x15dc28(0x170)];if(!_0x12a516)return console[_0x15dc28(0x156)](a8_0xb443bc[_0x15dc28(0x103)]('No\x20composable\x20audience\x20specified.')),console[_0x15dc28(0x156)]('Use\x20'+a8_0xb443bc[_0x15dc28(0x157)](_0x15dc28(0x173))+_0x15dc28(0x107)+a8_0xb443bc['cyan']('tdx\x20use\x20cas\x20<name>')),0x1;const _0x67f60=_0x25512a[_0x15dc28(0x14f)]||a8_0x34f308['join'](process[_0x15dc28(0x17a)](),_0x15dc28(0x11d),sanitizeFileName(_0x12a516)),_0x3164a9=await withProgressSpinner(_0x15dc28(0x13f)+_0x12a516+_0x15dc28(0x11b),_0x3af836=>_0xa1b8b9[_0x15dc28(0x11d)]['pull'](_0x12a516,{'targetDir':_0x67f60,'verbose':_0x25512a[_0x15dc28(0x13c)],'progress':{'update':_0x7ac984=>_0x3af836[_0x15dc28(0x118)](_0x7ac984)}}),{'verbose':_0x25512a[_0x15dc28(0x13c)]}),_0x33c44d=_0x3164a9[_0x15dc28(0x138)],_0x5ac865=_0x33c44d[_0x15dc28(0x153)][_0x15dc28(0x167)](_0x1f2680=>_0x1f2680['isNew']||_0x1f2680['hasChanges']);saveSessionContext({'composable_audience':_0x33c44d[_0x15dc28(0x15c)]},_0x25512a[_0x15dc28(0x119)]),console['log'](a8_0xb443bc[_0x15dc28(0x109)](_0x15dc28(0x112)+a8_0xb443bc[_0x15dc28(0x12d)]('composable_audience')+_0x15dc28(0x11a)+a8_0xb443bc[_0x15dc28(0x157)](_0x33c44d[_0x15dc28(0x15c)])));if(_0x5ac865[_0x15dc28(0x10c)]===0x0)return console[_0x15dc28(0x17c)](a8_0xb443bc['green'](_0x15dc28(0x154))),0x0;for(const _0x41a24a of _0x5ac865){if(_0x41a24a['isNew'])console[_0x15dc28(0x17c)](a8_0xb443bc[_0x15dc28(0x109)]('+\x20'+_0x41a24a[_0x15dc28(0x176)]+_0x15dc28(0x10b)));else _0x41a24a[_0x15dc28(0x134)]&&(console[_0x15dc28(0x17c)](a8_0xb443bc[_0x15dc28(0x103)]('~\x20'+_0x41a24a[_0x15dc28(0x176)])),console[_0x15dc28(0x17c)](_0x41a24a[_0x15dc28(0x134)]));}console[_0x15dc28(0x17c)]('\x0a'+_0x5ac865['length']+_0x15dc28(0x145)+('('+_0x33c44d[_0x15dc28(0x174)][_0x15dc28(0x12c)]+_0x15dc28(0x130)+_0x33c44d[_0x15dc28(0x174)][_0x15dc28(0x120)]+_0x15dc28(0x132)));if(_0x25512a[_0x15dc28(0x128)])return console[_0x15dc28(0x17c)](a8_0xb443bc['dim'](_0x15dc28(0x15f))),0x0;if(!_0x25512a[_0x15dc28(0x127)]&&isInteractive()){const _0x708ef7=await confirmKey(_0x15dc28(0x149));if(!_0x708ef7)return console[_0x15dc28(0x17c)](a8_0xb443bc[_0x15dc28(0x12d)](_0x15dc28(0x13b))),0x0;}for(const _0x335b96 of _0x5ac865){const _0xf5a3c9=a8_0x34f308[_0x15dc28(0x14a)](_0x335b96[_0x15dc28(0x16b)]);if(!existsSync(_0xf5a3c9))mkdirSync(_0xf5a3c9,{'recursive':!![]});writeFileSync(_0x335b96['absolutePath'],_0x335b96['content'],_0x15dc28(0x10a));}return console[_0x15dc28(0x17c)](a8_0xb443bc[_0x15dc28(0x109)]('Wrote\x20'+_0x5ac865[_0x15dc28(0x10c)]+_0x15dc28(0x10d)+_0x67f60)),0x0;}}function a8_0x33fa(_0x4c7bc2,_0x5b9b0f){_0x4c7bc2=_0x4c7bc2-0xff;const _0x153176=a8_0x1531();let _0x33faa0=_0x153176[_0x4c7bc2];return _0x33faa0;}export class CASPushCommand extends BaseCommand{[a8_0x515b60(0x16c)]=a8_0x515b60(0x133);['description']=a8_0x515b60(0x13a);async[a8_0x515b60(0x158)](_0x5a0964){const _0x37f0cf=a8_0x515b60,{options:_0x491c1d,args:_0x5ab4ef,tdx:_0x1bcd27}=_0x5a0964,_0x288b29=_0x491c1d;let _0xcafce6=_0x5ab4ef[0x0];!_0xcafce6&&_0x491c1d[_0x37f0cf(0x170)]&&(_0xcafce6=a8_0x34f308[_0x37f0cf(0x11e)](process[_0x37f0cf(0x17a)](),_0x37f0cf(0x11d),sanitizeFileName(_0x491c1d[_0x37f0cf(0x170)])));if(!_0xcafce6)return console[_0x37f0cf(0x156)](a8_0xb443bc[_0x37f0cf(0x103)](_0x37f0cf(0x169))),console['error']('Use\x20'+a8_0xb443bc[_0x37f0cf(0x157)](_0x37f0cf(0x10f))+_0x37f0cf(0x107)+a8_0xb443bc[_0x37f0cf(0x157)](_0x37f0cf(0x148))),0x1;if(!existsSync(_0xcafce6))return console[_0x37f0cf(0x156)](a8_0xb443bc[_0x37f0cf(0x178)](_0x37f0cf(0x150)+_0xcafce6)),console[_0x37f0cf(0x156)](a8_0xb443bc[_0x37f0cf(0x12d)](_0x37f0cf(0x142))),0x1;const _0x25dab2=_0x491c1d['composableAudience']||a8_0x34f308[_0x37f0cf(0x11f)](_0xcafce6),_0x4f6c21=a8_0x34f308[_0x37f0cf(0x171)](process[_0x37f0cf(0x17a)](),_0xcafce6)||'.';console[_0x37f0cf(0x17c)](_0x37f0cf(0x105)+a8_0xb443bc[_0x37f0cf(0x157)](_0x25dab2)),console['log'](_0x37f0cf(0x12b)+a8_0xb443bc[_0x37f0cf(0x12d)](_0x4f6c21)),console[_0x37f0cf(0x17c)](a8_0xb443bc['yellow'](_0x37f0cf(0x124))),console[_0x37f0cf(0x17c)]();const _0x238857=collectYamlFiles(_0xcafce6);if(_0x238857['length']===0x0)return console[_0x37f0cf(0x156)](a8_0xb443bc[_0x37f0cf(0x178)](_0x37f0cf(0x123)+_0xcafce6)),0x1;console[_0x37f0cf(0x17c)]('Found\x20'+_0x238857[_0x37f0cf(0x10c)]+_0x37f0cf(0x175));const _0xec4204=await withProgressSpinner(_0x37f0cf(0x102),_0x32caf7=>_0x1bcd27[_0x37f0cf(0x11d)][_0x37f0cf(0x111)](_0x238857,{'dryRun':!![],'verbose':_0x288b29[_0x37f0cf(0x13c)],'progress':{'update':_0x406b77=>_0x32caf7[_0x37f0cf(0x118)](_0x406b77)}}),{'verbose':_0x288b29[_0x37f0cf(0x13c)]}),_0x2b1a13=_0xec4204[_0x37f0cf(0x138)],{created:_0x164730}=_0x2b1a13,_0x315723=[];if(_0x164730[_0x37f0cf(0x117)])_0x315723[_0x37f0cf(0x111)](_0x164730['audiences']+_0x37f0cf(0x161));if(_0x164730[_0x37f0cf(0x12c)])_0x315723[_0x37f0cf(0x111)](_0x164730[_0x37f0cf(0x12c)]+_0x37f0cf(0x101));if(_0x164730[_0x37f0cf(0x120)])_0x315723[_0x37f0cf(0x111)](_0x164730[_0x37f0cf(0x120)]+_0x37f0cf(0x140));return _0x315723['length']===0x0?console['log'](a8_0xb443bc[_0x37f0cf(0x12d)](_0x37f0cf(0x15a))):console[_0x37f0cf(0x17c)](_0x37f0cf(0x16d)+_0x315723['join'](',\x20')),console[_0x37f0cf(0x17c)](a8_0xb443bc['dim']('(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)')),0x0;}}export class CASPreviewCommand extends BaseCommand{['name']=a8_0x515b60(0x146);[a8_0x515b60(0x125)]=a8_0x515b60(0x15d);async[a8_0x515b60(0x158)](_0x1fa677){const _0x1421de=a8_0x515b60,{options:_0x48ab22,args:_0x3c70a7,tdx:_0x7ba81f}=_0x1fa677,_0x2bb3a1=_0x3c70a7[0x0],_0x59b099=_0x3c70a7[0x1]||_0x48ab22[_0x1421de(0x170)];if(!_0x2bb3a1)return console[_0x1421de(0x156)](a8_0xb443bc['red'](_0x1421de(0x17d))),0x1;if(!_0x59b099)return console['error'](a8_0xb443bc[_0x1421de(0x103)](_0x1421de(0x144))),console[_0x1421de(0x156)](_0x1421de(0x159)+a8_0xb443bc[_0x1421de(0x157)](_0x1421de(0x16e))+'\x20or\x20set\x20context\x20with\x20'+a8_0xb443bc[_0x1421de(0x157)](_0x1421de(0x148))),0x1;const _0x2d7584=await withProgressSpinner(_0x1421de(0x11c)+_0x2bb3a1+_0x1421de(0x11b),()=>_0x7ba81f[_0x1421de(0x11d)][_0x1421de(0x162)](_0x59b099,_0x2bb3a1),{'verbose':_0x48ab22[_0x1421de(0x13c)]}),{query:_0x5695d4,customers:_0x130cb1}=_0x2d7584[_0x1421de(0x138)];if(isStructuredFormat(_0x48ab22))return await handleSingleObjectOutput({'query':_0x5695d4,'customers':_0x130cb1},_0x48ab22),0x0;const _0x264a1a=_0x5695d4[_0x1421de(0x110)]===_0x1421de(0x177)?a8_0xb443bc['green']:a8_0xb443bc[_0x1421de(0x103)];console['log']('Status:\x20'+_0x264a1a(_0x5695d4[_0x1421de(0x110)])),console[_0x1421de(0x17c)]('Count:\x20\x20'+a8_0xb443bc['bold'](String(_0x5695d4[_0x1421de(0x168)])));_0x5695d4['error']&&console[_0x1421de(0x17c)]('Error:\x20\x20'+a8_0xb443bc['red'](_0x5695d4['error']));if(_0x130cb1?.[_0x1421de(0x14d)]&&_0x130cb1?.[_0x1421de(0x12f)]){console[_0x1421de(0x17c)](a8_0xb443bc['underline']('\x0aSample\x20Rows\x20('+_0x130cb1['rows']['length']+')'));const _0x5c717f=_0x130cb1[_0x1421de(0x12f)]['map'](_0x45f367=>{const _0x271fcb=_0x1421de,_0x5c34e8={};for(let _0xc4dfa7=0x0;_0xc4dfa7<_0x130cb1[_0x271fcb(0x14d)][_0x271fcb(0x10c)];_0xc4dfa7++){_0x5c34e8[_0x130cb1[_0x271fcb(0x14d)][_0xc4dfa7]]=_0x45f367[_0xc4dfa7];}return _0x5c34e8;});await handleSDKOutput(_0x5c717f,_0x48ab22);}return 0x0;}}function a8_0x1531(){const _0xf29bc8=['basename','activations','\x20(time:\x20','underline','No\x20YAML\x20files\x20found\x20in:\x20','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','description','823068MDXpww','yes','dryRun','bold','List\x20composable\x20audiences','Source:\x20\x20\x20','segments','dim','460348qQPjyt','rows','\x20segments,\x20','Describe\x20a\x20composable\x20audience','\x20activations)','cas:push','diff','🧊\x20','\x20\x20Key:\x20\x20\x20\x20','type','data','681985oUdBMw','Push\x20YAML\x20files\x20to\x20CAS\x20API','Cancelled.','verbose','Attributes\x20(','attributes','Pulling\x20composable\x20audience\x20\x27','\x20activation(s)','get','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','timeColumn','Audience\x20name\x20required.','\x20file(s)\x20to\x20write\x20','cas:preview','\x20\x20Table:\x20\x20','tdx\x20use\x20cas\x20<name>','Write\x20files?','dirname','cas:pull','3baCdxc','names','schema','dir','Directory\x20not\x20found:\x20','Pull\x20composable\x20audience\x20to\x20YAML\x20files','1432LmcuBv','files','All\x20files\x20are\x20up\x20to\x20date.','6vJlMht','error','cyan','execute','Use\x20','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','masterSchema','audienceName','Preview\x20composable\x20segment\x20query\x20on\x20CDW','masterTable','(dry\x20run\x20—\x20no\x20files\x20written)','262392jestkR','\x20audience(s)','preview','66tcigwV','\x20\x20Schema:\x20','1576xpeZhQ','list','filter','count','No\x20composable\x20audience\x20specified.','column','absolutePath','name','Would\x20push:\x20','--audience\x20<name>','toLocaleString','composableAudience','relative','Master\x20Table','tdx\x20cas\x20pull\x20<name>','counts','\x20YAML\x20file(s)','relativePath','success','red','3990Wvoapq','cwd','Fetching\x20composable\x20audiences...','log','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','\x20—\x20','76StQjGQ','\x20segment(s)','Analyzing\x20CAS\x20YAML\x20files...','yellow','Fetching\x20audience\x20\x27','Audience:\x20','No\x20composable\x20audiences\x20found.','\x20or\x20set\x20context\x20with\x20','behaviors','green','utf-8','\x20(new)','length','\x20file(s)\x20to\x20','masterKeyColumn','tdx\x20cas\x20push\x20<path>','status','push','Context\x20set:\x20','269290BiqsEs','population','\x20composable\x20audiences','tdx\x20cas\x20desc\x20<name>','audiences','setPhase','session','\x20=\x20','\x27...','Running\x20preview\x20for\x20\x27','cas','join'];a8_0x1531=function(){return _0xf29bc8;};return a8_0x1531();}
1
+ const a8_0x526435=a8_0x31ce;function a8_0x1327(){const _0x310405=['table','timeColumn','behaviors','cyan','Audience:\x20','length','name','absolutePath','No\x20composable\x20audiences\x20found.','No\x20composable\x20audience\x20specified.','audienceName','population','push','Analyzing\x20CAS\x20YAML\x20files...','hasChanges','yes','\x20—\x20','3mZCowV','counts','Push\x20YAML\x20files\x20to\x20CAS\x20API','underline','green','1779366ZuEHGU','files','cas:preview','data','Use\x20','activations','session','\x20file(s)\x20to\x20','\x20=\x20','description','Fetching\x20audience\x20\x27','List\x20composable\x20audiences','6236325hgTIHm','bold','masterSchema','\x20or\x20set\x20context\x20with\x20','Attributes\x20(','cwd','Describe\x20a\x20composable\x20audience','setPhase','column','red','Pull\x20composable\x20audience\x20to\x20YAML\x20files','error','get','dirname','Running\x20preview\x20for\x20\x27','yellow','toLocaleString','Preview\x20composable\x20segment\x20query\x20on\x20CDW','1778772JWoRpk','execute','8UoVEGv','segments','\x20(new)','\x20segment(s)','log','type','dim','🧊\x20','\x20segments,\x20','attributes','All\x20files\x20are\x20up\x20to\x20date.','2lQVfNK','Master\x20Table','Directory\x20not\x20found:\x20','cas','tdx\x20cas\x20push\x20<path>','list','Behaviors\x20(','rows','cas:list','Cancelled.','\x20activation(s)','composableAudience','\x20\x20Table:\x20\x20','Context\x20set:\x20','diff','Source:\x20\x20\x20','content','dryRun','Count:\x20\x20','composable_audience','Audience\x20name\x20required.','audiences','names','451652qCSXAq','3321262GGOHVQ','join','Fetching\x20composable\x20audiences...','cas:push','masterKeyColumn','status','verbose','isNew','\x20composable\x20audiences','4160490NEeIwB','\x20(time:\x20','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','\x20audience(s)','schema','tdx\x20use\x20cas\x20<name>','\x27...','\x20YAML\x20file(s)','\x20\x20Schema:\x20','\x20file(s)\x20to\x20write\x20','227355fWTcHg','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','dir','success','Found\x20','tdx\x20cas\x20pull\x20<name>'];a8_0x1327=function(){return _0x310405;};return a8_0x1327();}(function(_0x5a949f,_0x4fb8a0){const _0x2589ff=a8_0x31ce,_0x5cd340=_0x5a949f();while(!![]){try{const _0xde4c8e=-parseInt(_0x2589ff(0xf2))/0x1*(parseInt(_0x2589ff(0x14d))/0x2)+-parseInt(_0x2589ff(0x11d))/0x3*(parseInt(_0x2589ff(0x140))/0x4)+parseInt(_0x2589ff(0x106))/0x5+-parseInt(_0x2589ff(0x122))/0x6+parseInt(_0x2589ff(0xf3))/0x7+-parseInt(_0x2589ff(0x142))/0x8*(-parseInt(_0x2589ff(0x12e))/0x9)+parseInt(_0x2589ff(0xfc))/0xa;if(_0xde4c8e===_0x4fb8a0)break;else _0x5cd340['push'](_0x5cd340['shift']());}catch(_0x1818a5){_0x5cd340['push'](_0x5cd340['shift']());}}}(a8_0x1327,0x6a725));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x4910ea from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a8_0x31ce(_0x4a216b,_0x5cd539){_0x4a216b=_0x4a216b-0xe2;const _0x1327db=a8_0x1327();let _0x31ce91=_0x1327db[_0x4a216b];return _0x31ce91;}import a8_0x170b51 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_0x526435(0x112)]=a8_0x526435(0xe3);[a8_0x526435(0x12b)]=a8_0x526435(0x12d);async[a8_0x526435(0x141)](_0x182ca9){const _0x129971=a8_0x526435,{options:_0x493585,tdx:_0x36cfd0}=_0x182ca9,_0x233058=await withProgressSpinner(_0x129971(0xf5),()=>_0x36cfd0[_0x129971(0x150)][_0x129971(0x152)](),{'verbose':_0x493585['verbose']}),_0x587a98=_0x233058['data'];if(isStructuredFormat(_0x493585))return await handleSDKOutput(_0x587a98,_0x493585),0x0;if(_0x587a98[_0x129971(0x111)]===0x0)return console[_0x129971(0x146)](a8_0x4910ea[_0x129971(0x148)](_0x129971(0x114))),0x0;console[_0x129971(0x146)](a8_0x4910ea[_0x129971(0x121)](_0x129971(0x10a)+_0x587a98['length']+_0x129971(0xfb)));for(const _0x4244bd of _0x587a98){const _0x4f5004=_0x4244bd[_0x129971(0x117)]?a8_0x4910ea[_0x129971(0x148)]('\x20('+Number(_0x4244bd[_0x129971(0x117)])[_0x129971(0x13e)]()+')'):'',_0x54236=a8_0x4910ea['dim']('\x20'+_0x4244bd[_0x129971(0x130)]+'.'+_0x4244bd['masterTable']);console[_0x129971(0x146)](_0x129971(0x149)+_0x4244bd[_0x129971(0x112)]+_0x4f5004+_0x54236),_0x4244bd[_0x129971(0x12b)]&&console[_0x129971(0x146)]('\x20\x20'+a8_0x4910ea['dim'](_0x4244bd[_0x129971(0x12b)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0x526435(0x112)]='cas:desc';[a8_0x526435(0x12b)]=a8_0x526435(0x134);async[a8_0x526435(0x141)](_0x311fbd){const _0x468ca1=a8_0x526435,{options:_0x1d0190,args:_0x10175a,tdx:_0x3ae419}=_0x311fbd,_0x1fcb06=_0x10175a[0x0]||_0x1d0190['composableAudience'];if(!_0x1fcb06)return console[_0x468ca1(0x139)](a8_0x4910ea[_0x468ca1(0x13d)]('No\x20composable\x20audience\x20specified.')),console[_0x468ca1(0x139)]('Use\x20'+a8_0x4910ea[_0x468ca1(0x10f)]('tdx\x20cas\x20desc\x20<name>')+_0x468ca1(0x131)+a8_0x4910ea['cyan'](_0x468ca1(0x101))),0x1;const _0x2cef6e=await withProgressSpinner(_0x468ca1(0x12c)+_0x1fcb06+_0x468ca1(0x102),()=>_0x3ae419['cas'][_0x468ca1(0x13a)](_0x1fcb06),{'verbose':_0x1d0190[_0x468ca1(0xf9)]}),_0x5e6f04=_0x2cef6e[_0x468ca1(0x125)];if(isStructuredFormat(_0x1d0190))return await handleSingleObjectOutput(_0x5e6f04,_0x1d0190),0x0;console[_0x468ca1(0x146)](a8_0x4910ea[_0x468ca1(0x12f)](_0x5e6f04['name']));if(_0x5e6f04[_0x468ca1(0x12b)])console['log'](a8_0x4910ea[_0x468ca1(0x148)](_0x5e6f04['description']));console[_0x468ca1(0x146)](),console[_0x468ca1(0x146)](a8_0x4910ea[_0x468ca1(0x120)](_0x468ca1(0x14e))),console[_0x468ca1(0x146)](_0x468ca1(0x104)+_0x5e6f04[_0x468ca1(0x130)]),console['log'](_0x468ca1(0xe7)+_0x5e6f04['masterTable']),console[_0x468ca1(0x146)]('\x20\x20Key:\x20\x20\x20\x20'+_0x5e6f04[_0x468ca1(0xf7)]),console[_0x468ca1(0x146)]();if(_0x5e6f04[_0x468ca1(0x14b)]?.[_0x468ca1(0x111)]){console[_0x468ca1(0x146)](a8_0x4910ea[_0x468ca1(0x120)](_0x468ca1(0x132)+_0x5e6f04['attributes']['length']+')'));for(const _0x191435 of _0x5e6f04[_0x468ca1(0x14b)]){console[_0x468ca1(0x146)]('\x20\x20'+a8_0x4910ea[_0x468ca1(0x12f)](_0x191435[_0x468ca1(0x112)])+_0x468ca1(0x11c)+_0x191435[_0x468ca1(0x100)]+'.'+_0x191435[_0x468ca1(0x10c)]+'.'+_0x191435[_0x468ca1(0x136)]+'\x20('+a8_0x4910ea[_0x468ca1(0x148)](_0x191435[_0x468ca1(0x147)])+')');}console[_0x468ca1(0x146)]();}if(_0x5e6f04['behaviors']?.[_0x468ca1(0x111)]){console['log'](a8_0x4910ea[_0x468ca1(0x120)](_0x468ca1(0x153)+_0x5e6f04[_0x468ca1(0x10e)][_0x468ca1(0x111)]+')'));for(const _0x464308 of _0x5e6f04[_0x468ca1(0x10e)]){const _0x92ac6f=_0x464308['timeColumn']?_0x468ca1(0xfd)+_0x464308[_0x468ca1(0x10d)]+')':'';console[_0x468ca1(0x146)]('\x20\x20'+a8_0x4910ea[_0x468ca1(0x12f)](_0x464308[_0x468ca1(0x112)])+'\x20—\x20'+_0x464308[_0x468ca1(0x100)]+'.'+_0x464308['table']+_0x92ac6f);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x526435(0x112)]='cas:pull';[a8_0x526435(0x12b)]=a8_0x526435(0x138);async[a8_0x526435(0x141)](_0x1f84a0){const _0x107c80=a8_0x526435,{options:_0x54c4d3,args:_0xbb0b9b,tdx:_0xd6b4bd}=_0x1f84a0,_0x20d392=_0x54c4d3,_0x818715=_0xbb0b9b[0x0]||_0x54c4d3[_0x107c80(0xe6)];if(!_0x818715)return console[_0x107c80(0x139)](a8_0x4910ea['yellow'](_0x107c80(0x115))),console[_0x107c80(0x139)](_0x107c80(0x126)+a8_0x4910ea[_0x107c80(0x10f)](_0x107c80(0x10b))+_0x107c80(0x131)+a8_0x4910ea['cyan'](_0x107c80(0x101))),0x1;const _0x45fcdf=_0x20d392[_0x107c80(0x108)]||a8_0x170b51[_0x107c80(0xf4)](process['cwd'](),_0x107c80(0x150),sanitizeFileName(_0x818715)),_0x4ed7c0=await withProgressSpinner('Pulling\x20composable\x20audience\x20\x27'+_0x818715+_0x107c80(0x102),_0x3e8345=>_0xd6b4bd['cas']['pull'](_0x818715,{'targetDir':_0x45fcdf,'verbose':_0x20d392['verbose'],'progress':{'update':_0x46a8ab=>_0x3e8345[_0x107c80(0x135)](_0x46a8ab)}}),{'verbose':_0x20d392['verbose']}),_0x2a48cf=_0x4ed7c0[_0x107c80(0x125)],_0xa4bc1d=_0x2a48cf[_0x107c80(0x123)]['filter'](_0x39fa8c=>_0x39fa8c[_0x107c80(0xfa)]||_0x39fa8c[_0x107c80(0x11a)]);saveSessionContext({'composable_audience':_0x2a48cf[_0x107c80(0x116)]},_0x20d392[_0x107c80(0x128)]),console[_0x107c80(0x146)](a8_0x4910ea['green'](_0x107c80(0xe8)+a8_0x4910ea[_0x107c80(0x148)](_0x107c80(0xee))+_0x107c80(0x12a)+a8_0x4910ea['cyan'](_0x2a48cf['audienceName'])));if(_0xa4bc1d[_0x107c80(0x111)]===0x0)return console[_0x107c80(0x146)](a8_0x4910ea['green'](_0x107c80(0x14c))),0x0;for(const _0x2df39f of _0xa4bc1d){if(_0x2df39f[_0x107c80(0xfa)])console[_0x107c80(0x146)](a8_0x4910ea[_0x107c80(0x121)]('+\x20'+_0x2df39f['relativePath']+_0x107c80(0x144)));else _0x2df39f['diff']&&(console[_0x107c80(0x146)](a8_0x4910ea[_0x107c80(0x13d)]('~\x20'+_0x2df39f['relativePath'])),console['log'](_0x2df39f[_0x107c80(0xe9)]));}console[_0x107c80(0x146)]('\x0a'+_0xa4bc1d['length']+_0x107c80(0x105)+('('+_0x2a48cf[_0x107c80(0x11e)]['segments']+_0x107c80(0x14a)+_0x2a48cf[_0x107c80(0x11e)]['activations']+'\x20activations)'));if(_0x20d392[_0x107c80(0xec)])return console[_0x107c80(0x146)](a8_0x4910ea[_0x107c80(0x148)]('(dry\x20run\x20—\x20no\x20files\x20written)')),0x0;if(!_0x20d392[_0x107c80(0x11b)]&&isInteractive()){const _0x2477b0=await confirmKey('Write\x20files?');if(!_0x2477b0)return console[_0x107c80(0x146)](a8_0x4910ea[_0x107c80(0x148)](_0x107c80(0xe4))),0x0;}for(const _0x3cacc8 of _0xa4bc1d){const _0x37d73e=a8_0x170b51[_0x107c80(0x13b)](_0x3cacc8[_0x107c80(0x113)]);if(!existsSync(_0x37d73e))mkdirSync(_0x37d73e,{'recursive':!![]});writeFileSync(_0x3cacc8['absolutePath'],_0x3cacc8[_0x107c80(0xeb)],'utf-8');}return console[_0x107c80(0x146)](a8_0x4910ea[_0x107c80(0x121)]('Wrote\x20'+_0xa4bc1d['length']+_0x107c80(0x129)+_0x45fcdf)),0x0;}}export class CASPushCommand extends BaseCommand{[a8_0x526435(0x112)]=a8_0x526435(0xf6);['description']=a8_0x526435(0x11f);async['execute'](_0x455075){const _0x2981cb=a8_0x526435,{options:_0x307731,args:_0x5afe14,tdx:_0x463a8a}=_0x455075,_0x16fe73=_0x307731;let _0x366f18=_0x5afe14[0x0];!_0x366f18&&_0x307731[_0x2981cb(0xe6)]&&(_0x366f18=a8_0x170b51['join'](process['cwd'](),_0x2981cb(0x150),sanitizeFileName(_0x307731[_0x2981cb(0xe6)])));if(!_0x366f18)return console[_0x2981cb(0x139)](a8_0x4910ea[_0x2981cb(0x13d)](_0x2981cb(0x115))),console[_0x2981cb(0x139)](_0x2981cb(0x126)+a8_0x4910ea[_0x2981cb(0x10f)](_0x2981cb(0x151))+_0x2981cb(0x131)+a8_0x4910ea[_0x2981cb(0x10f)](_0x2981cb(0x101))),0x1;if(!existsSync(_0x366f18))return console['error'](a8_0x4910ea[_0x2981cb(0x137)](_0x2981cb(0x14f)+_0x366f18)),console[_0x2981cb(0x139)](a8_0x4910ea['dim']('Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x358be1=_0x307731[_0x2981cb(0xe6)]||a8_0x170b51['basename'](_0x366f18),_0x2e3abf=a8_0x170b51['relative'](process[_0x2981cb(0x133)](),_0x366f18)||'.';console[_0x2981cb(0x146)](_0x2981cb(0x110)+a8_0x4910ea['cyan'](_0x358be1)),console[_0x2981cb(0x146)](_0x2981cb(0xea)+a8_0x4910ea['dim'](_0x2e3abf)),console['log'](a8_0x4910ea[_0x2981cb(0x13d)]('\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.')),console[_0x2981cb(0x146)]();const _0x2a3ff2=collectYamlFiles(_0x366f18);if(_0x2a3ff2[_0x2981cb(0x111)]===0x0)return console[_0x2981cb(0x139)](a8_0x4910ea['red']('No\x20YAML\x20files\x20found\x20in:\x20'+_0x366f18)),0x1;console[_0x2981cb(0x146)]('Found\x20'+_0x2a3ff2['length']+_0x2981cb(0x103));const _0x38b9f7=await withProgressSpinner(_0x2981cb(0x119),_0x25e5d9=>_0x463a8a['cas'][_0x2981cb(0x118)](_0x2a3ff2,{'dryRun':!![],'verbose':_0x16fe73['verbose'],'progress':{'update':_0x58097a=>_0x25e5d9[_0x2981cb(0x135)](_0x58097a)}}),{'verbose':_0x16fe73[_0x2981cb(0xf9)]}),_0x2052ec=_0x38b9f7[_0x2981cb(0x125)],{created:_0x3bfdf6}=_0x2052ec,_0x4ea6eb=[];if(_0x3bfdf6[_0x2981cb(0xf0)])_0x4ea6eb[_0x2981cb(0x118)](_0x3bfdf6[_0x2981cb(0xf0)]+_0x2981cb(0xff));if(_0x3bfdf6[_0x2981cb(0x143)])_0x4ea6eb['push'](_0x3bfdf6[_0x2981cb(0x143)]+_0x2981cb(0x145));if(_0x3bfdf6['activations'])_0x4ea6eb['push'](_0x3bfdf6[_0x2981cb(0x127)]+_0x2981cb(0xe5));return _0x4ea6eb['length']===0x0?console['log'](a8_0x4910ea[_0x2981cb(0x148)]('No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.')):console['log']('Would\x20push:\x20'+_0x4ea6eb[_0x2981cb(0xf4)](',\x20')),console[_0x2981cb(0x146)](a8_0x4910ea[_0x2981cb(0x148)](_0x2981cb(0xfe))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x526435(0x112)]=a8_0x526435(0x124);[a8_0x526435(0x12b)]=a8_0x526435(0x13f);async[a8_0x526435(0x141)](_0xe40721){const _0x24652e=a8_0x526435,{options:_0x1b1724,args:_0x427662,tdx:_0x19d196}=_0xe40721,_0x48ff47=_0x427662[0x0],_0xeaf6fe=_0x427662[0x1]||_0x1b1724[_0x24652e(0xe6)];if(!_0x48ff47)return console[_0x24652e(0x139)](a8_0x4910ea[_0x24652e(0x137)](_0x24652e(0x107))),0x1;if(!_0xeaf6fe)return console['error'](a8_0x4910ea[_0x24652e(0x13d)](_0x24652e(0xef))),console[_0x24652e(0x139)](_0x24652e(0x126)+a8_0x4910ea[_0x24652e(0x10f)]('--audience\x20<name>')+_0x24652e(0x131)+a8_0x4910ea[_0x24652e(0x10f)](_0x24652e(0x101))),0x1;const _0x7933f1=await withProgressSpinner(_0x24652e(0x13c)+_0x48ff47+_0x24652e(0x102),()=>_0x19d196[_0x24652e(0x150)]['preview'](_0xeaf6fe,_0x48ff47),{'verbose':_0x1b1724[_0x24652e(0xf9)]}),{query:_0x1ffcac,customers:_0x517742}=_0x7933f1[_0x24652e(0x125)];if(isStructuredFormat(_0x1b1724))return await handleSingleObjectOutput({'query':_0x1ffcac,'customers':_0x517742},_0x1b1724),0x0;const _0xc109f=_0x1ffcac[_0x24652e(0xf8)]===_0x24652e(0x109)?a8_0x4910ea[_0x24652e(0x121)]:a8_0x4910ea[_0x24652e(0x13d)];console[_0x24652e(0x146)]('Status:\x20'+_0xc109f(_0x1ffcac['status'])),console['log'](_0x24652e(0xed)+a8_0x4910ea[_0x24652e(0x12f)](String(_0x1ffcac['count'])));_0x1ffcac[_0x24652e(0x139)]&&console[_0x24652e(0x146)]('Error:\x20\x20'+a8_0x4910ea['red'](_0x1ffcac[_0x24652e(0x139)]));if(_0x517742?.[_0x24652e(0xf1)]&&_0x517742?.[_0x24652e(0xe2)]){console[_0x24652e(0x146)](a8_0x4910ea[_0x24652e(0x120)]('\x0aSample\x20Rows\x20('+_0x517742['rows'][_0x24652e(0x111)]+')'));const _0x522307=_0x517742['rows']['map'](_0x24bad9=>{const _0xf52a39=_0x24652e,_0x5decd7={};for(let _0x345cee=0x0;_0x345cee<_0x517742[_0xf52a39(0xf1)][_0xf52a39(0x111)];_0x345cee++){_0x5decd7[_0x517742[_0xf52a39(0xf1)][_0x345cee]]=_0x24bad9[_0x345cee];}return _0x5decd7;});await handleSDKOutput(_0x522307,_0x1b1724);}return 0x0;}}
@@ -1 +1 @@
1
- const a9_0x181dbb=a9_0x1a86;(function(_0x1b8693,_0x5d64d5){const _0x221388=a9_0x1a86,_0x4a1664=_0x1b8693();while(!![]){try{const _0x435b62=parseInt(_0x221388(0x118))/0x1+parseInt(_0x221388(0x116))/0x2*(-parseInt(_0x221388(0x127))/0x3)+parseInt(_0x221388(0x12c))/0x4+-parseInt(_0x221388(0x11e))/0x5+-parseInt(_0x221388(0x12d))/0x6+parseInt(_0x221388(0x122))/0x7*(-parseInt(_0x221388(0x124))/0x8)+parseInt(_0x221388(0x125))/0x9*(parseInt(_0x221388(0x12b))/0xa);if(_0x435b62===_0x5d64d5)break;else _0x4a1664['push'](_0x4a1664['shift']());}catch(_0x52abb8){_0x4a1664['push'](_0x4a1664['shift']());}}}(a9_0x55b9,0xc2139));import{BaseCommand}from'./command.js';function a9_0x1a86(_0x186b53,_0xa963d8){_0x186b53=_0x186b53-0x113;const _0x55b9e6=a9_0x55b9();let _0x1a8607=_0x55b9e6[_0x186b53];return _0x1a8607;}import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a9_0x55b9(){const _0x29bd37=['Found\x20','15ZVxuzm','description','cas:sg:list','red','289690kVKwSh','6087384AjpTzu','8302602vVngXu','cas','Fetching\x20segments\x20for\x20\x27','List\x20composable\x20segments\x20for\x20an\x20audience','composableAudience','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','388630OrlxUw','log','960433NyfGwk','🎯\x20','length','dim','population','green','7456640OiJGLS','verbose','\x20segment','execute','35DnkASr','Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>','1041064djUhhh','873fsECqL'];a9_0x55b9=function(){return _0x29bd37;};return a9_0x55b9();}import{formatRows}from'../sdk/util/formatters.js';import a9_0x42db7b from'chalk';export class CASSegmentListCommand extends BaseCommand{['name']=a9_0x181dbb(0x129);['description']=a9_0x181dbb(0x113);async[a9_0x181dbb(0x121)](_0x4a82d4){const _0x5adfed=a9_0x181dbb,{options:_0x51ada8,args:_0x36d692,tdx:_0x51d799}=_0x4a82d4,_0x42a577=_0x36d692[0x0]||_0x51ada8[_0x5adfed(0x114)];if(!_0x42a577)return console['error'](a9_0x42db7b[_0x5adfed(0x12a)](_0x5adfed(0x115))),console['error'](a9_0x42db7b[_0x5adfed(0x11b)](_0x5adfed(0x123))),0x1;const _0x3336ac=await withProgressSpinner(_0x5adfed(0x12f)+_0x42a577+'\x27...',()=>_0x51d799[_0x5adfed(0x12e)]['listSegments'](_0x42a577),{'verbose':_0x51ada8[_0x5adfed(0x11f)]}),_0x292199=_0x3336ac['data'];if(isStructuredFormat(_0x51ada8))return await handleSDKOutput(_0x292199,_0x51ada8),0x0;console[_0x5adfed(0x117)](a9_0x42db7b[_0x5adfed(0x11d)](_0x5adfed(0x126)+_0x292199[_0x5adfed(0x11a)]+_0x5adfed(0x120)+(_0x292199[_0x5adfed(0x11a)]!==0x1?'s':'')));if(_0x292199[_0x5adfed(0x11a)]===0x0)return 0x0;for(const _0x8acdc4 of _0x292199){const _0x17424d=_0x8acdc4[_0x5adfed(0x11c)]!=null?a9_0x42db7b[_0x5adfed(0x11b)]('\x20('+formatRows(_0x8acdc4['population'])+')'):'';console[_0x5adfed(0x117)](_0x5adfed(0x119)+_0x8acdc4['name']+_0x17424d),_0x8acdc4[_0x5adfed(0x128)]&&console['log']('\x20\x20'+a9_0x42db7b['dim'](_0x8acdc4[_0x5adfed(0x128)]));}return 0x0;}}
1
+ const a9_0x5cb0a6=a9_0x656e;(function(_0x1a81ac,_0x23e830){const _0x40da3a=a9_0x656e,_0x5b4a0c=_0x1a81ac();while(!![]){try{const _0x364d43=parseInt(_0x40da3a(0xd0))/0x1+-parseInt(_0x40da3a(0xda))/0x2+-parseInt(_0x40da3a(0xc7))/0x3*(-parseInt(_0x40da3a(0xd5))/0x4)+-parseInt(_0x40da3a(0xd7))/0x5+parseInt(_0x40da3a(0xd1))/0x6*(parseInt(_0x40da3a(0xc5))/0x7)+-parseInt(_0x40da3a(0xd9))/0x8+parseInt(_0x40da3a(0xd6))/0x9;if(_0x364d43===_0x23e830)break;else _0x5b4a0c['push'](_0x5b4a0c['shift']());}catch(_0x1afe6b){_0x5b4a0c['push'](_0x5b4a0c['shift']());}}}(a9_0xde4c,0x5fb5f));import{BaseCommand}from'./command.js';function a9_0x656e(_0x457f21,_0xd2554d){_0x457f21=_0x457f21-0xc4;const _0xde4cf0=a9_0xde4c();let _0x656e30=_0xde4cf0[_0x457f21];return _0x656e30;}function a9_0xde4c(){const _0x176874=['execute','green','red','742287xzbcyC','390984npblHV','\x27...','error','List\x20composable\x20segments\x20for\x20an\x20audience','334472GTRoOb','1577493atRHme','3820435tSUuxI','cas','4971304BGEFra','493342CQLHRc','cas:sg:list','name','description','Fetching\x20segments\x20for\x20\x27','56zJXGpo','dim','21ofxNuX','log','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','population','verbose','length'];a9_0xde4c=function(){return _0x176874;};return a9_0xde4c();}import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{formatRows}from'../sdk/util/formatters.js';import a9_0x110e5f from'chalk';export class CASSegmentListCommand extends BaseCommand{['name']=a9_0x5cb0a6(0xdb);[a9_0x5cb0a6(0xdd)]=a9_0x5cb0a6(0xd4);async[a9_0x5cb0a6(0xcd)](_0x5a6e07){const _0x220f77=a9_0x5cb0a6,{options:_0x19859c,args:_0x12fc3d,tdx:_0x20001a}=_0x5a6e07,_0x3056c1=_0x12fc3d[0x0]||_0x19859c['composableAudience'];if(!_0x3056c1)return console[_0x220f77(0xd3)](a9_0x110e5f[_0x220f77(0xcf)](_0x220f77(0xc9))),console[_0x220f77(0xd3)](a9_0x110e5f[_0x220f77(0xc6)]('Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>')),0x1;const _0x13d1b9=await withProgressSpinner(_0x220f77(0xc4)+_0x3056c1+_0x220f77(0xd2),()=>_0x20001a[_0x220f77(0xd8)]['listSegments'](_0x3056c1),{'verbose':_0x19859c[_0x220f77(0xcb)]}),_0x46a151=_0x13d1b9['data'];if(isStructuredFormat(_0x19859c))return await handleSDKOutput(_0x46a151,_0x19859c),0x0;console[_0x220f77(0xc8)](a9_0x110e5f[_0x220f77(0xce)]('Found\x20'+_0x46a151[_0x220f77(0xcc)]+'\x20segment'+(_0x46a151[_0x220f77(0xcc)]!==0x1?'s':'')));if(_0x46a151['length']===0x0)return 0x0;for(const _0x1e8862 of _0x46a151){const _0x1ebcf5=_0x1e8862[_0x220f77(0xca)]!=null?a9_0x110e5f[_0x220f77(0xc6)]('\x20('+formatRows(_0x1e8862['population'])+')'):'';console['log']('🎯\x20'+_0x1e8862[_0x220f77(0xdc)]+_0x1ebcf5),_0x1e8862['description']&&console[_0x220f77(0xc8)]('\x20\x20'+a9_0x110e5f[_0x220f77(0xc6)](_0x1e8862[_0x220f77(0xdd)]));}return 0x0;}}
@@ -1 +1 @@
1
- const a10_0xc3133d=a10_0x2afb;(function(_0x5b231d,_0x5317e5){const _0x2aaca1=a10_0x2afb,_0x507c92=_0x5b231d();while(!![]){try{const _0x3c918d=-parseInt(_0x2aaca1(0x1f4))/0x1+parseInt(_0x2aaca1(0x207))/0x2*(-parseInt(_0x2aaca1(0x1f9))/0x3)+-parseInt(_0x2aaca1(0x1d5))/0x4+-parseInt(_0x2aaca1(0x1ca))/0x5*(parseInt(_0x2aaca1(0x1de))/0x6)+parseInt(_0x2aaca1(0x1f7))/0x7*(-parseInt(_0x2aaca1(0x1da))/0x8)+parseInt(_0x2aaca1(0x20e))/0x9*(-parseInt(_0x2aaca1(0x1fa))/0xa)+-parseInt(_0x2aaca1(0x1d3))/0xb*(-parseInt(_0x2aaca1(0x20a))/0xc);if(_0x3c918d===_0x5317e5)break;else _0x507c92['push'](_0x507c92['shift']());}catch(_0x1626fd){_0x507c92['push'](_0x507c92['shift']());}}}(a10_0x3a1e,0x8addd));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(_0x557b4c,_0x40b63b){const _0x56f797=a10_0x2afb;if(_0x557b4c instanceof SDKError)console['error']('Error:\x20'+_0x557b4c[_0x56f797(0x1f2)]),_0x40b63b['verbose']&&(_0x557b4c[_0x56f797(0x1ea)]&&console[_0x56f797(0x1e0)]('\x20\x20Cause:\x20'+_0x557b4c['cause']),_0x557b4c[_0x56f797(0x1e6)]&&(console[_0x56f797(0x1e0)](_0x56f797(0x1f8)),console[_0x56f797(0x1e0)](_0x557b4c[_0x56f797(0x1e6)])));else throw _0x557b4c;}function a10_0x3a1e(){const _0x5ce73c=['llmProject','12ywGzcK','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Create\x20a\x20new\x20chat\x20session','resolveAgentId','23805WQfwYR','claude-4.5-haiku','new','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','write','verbose','streamChatJsonl','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','chat-create','60ORJQYt','stdout','site','join','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','projectId','validate','stream','tool_result','51659663paAXNN','content','4482928ilJlEB','type','Chat\x20session:\x20','event','getDefaultAgent','8pHiXGF','args','Error:\x20Chat\x20session\x20\x27','llm','388998MNqxhZ','CHAT_NOT_FOUND','error','\x0aError:\x20','Using\x20agent\x20from\x20','code','\x27...','agentId','stack','string','execute','tool','cause','functionName','stringify','data','handleChatEvent','--agent\x20flag','chat','done','message','getOrCreateDefaultAgent','596085kgSwYP','tool_call','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','6358023RMErlA','\x0aStack\x20trace:','6BuhJVe','1780bIZfwo','name','targetFunction','session\x20context','metadata','targetWebSearchTool','\x27\x20not\x20found','log','agent','llmAgent','description','streamChat','chatId','253624HgDQlz','context'];a10_0x3a1e=function(){return _0x5ce73c;};return a10_0x3a1e();}function a10_0x2afb(_0x18073d,_0x1e4483){_0x18073d=_0x18073d-0x1c7;const _0x3a1eed=a10_0x3a1e();let _0x2afb17=_0x3a1eed[_0x18073d];return _0x2afb17;}async function resolveAgentId(_0x5ccf7f,_0x5a292b,_0x2381ad,_0x246a41,_0x390a44){const _0x51bd0d=a10_0x2afb,_0x39582a=_0x5a292b||_0x2381ad;if(_0x39582a){const {projectName:_0x332f12,agentName:_0xf1f162}=parseAgentRef(_0x39582a),_0x584ade=_0xf1f162||_0x39582a,_0x3b1baf=_0xf1f162?_0x332f12:_0x246a41;if(!_0x3b1baf)throw new Error(_0x51bd0d(0x1f6));if(_0x390a44){const _0x2466ec=_0x5a292b?_0x51bd0d(0x1ef):_0x51bd0d(0x1fd);console[_0x51bd0d(0x1e0)](_0x51bd0d(0x1e2)+_0x2466ec+':\x20'+_0x3b1baf+'/'+_0x584ade);}const _0x13a586=await withSpinner('Resolving\x20project\x20\x27'+_0x3b1baf+_0x51bd0d(0x1e4),()=>_0x5ccf7f[_0x51bd0d(0x1dd)]['resolveProjectId'](_0x3b1baf),{'verbose':_0x390a44}),_0x1db184=await withSpinner('Resolving\x20agent\x20\x27'+_0x584ade+_0x51bd0d(0x1e4),()=>_0x5ccf7f[_0x51bd0d(0x1dd)][_0x51bd0d(0x20d)](_0x584ade,_0x13a586[_0x51bd0d(0x1ed)]),{'verbose':_0x390a44});return _0x1db184[_0x51bd0d(0x1ed)];}else{const _0x252771=_0x5ccf7f[_0x51bd0d(0x1dd)][_0x51bd0d(0x1d9)]();if(_0x252771)return _0x390a44&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0x252771['name']),_0x252771['id'];const _0x99cc45=await withSpinner('Getting\x20default\x20agent...',()=>_0x5ccf7f[_0x51bd0d(0x1dd)][_0x51bd0d(0x1f3)](_0x51bd0d(0x20f),0x0),{'verbose':_0x390a44});return _0x99cc45[_0x51bd0d(0x1ed)]['id'];}}export class ChatCommand extends BaseCommand{[a10_0xc3133d(0x1fb)]='chat';['description']=a10_0xc3133d(0x1c8);[a10_0xc3133d(0x1d0)](_0x130502){const _0x26515c=a10_0xc3133d,_0x20efa7=_0x130502[_0x26515c(0x1db)][_0x26515c(0x1cd)]('\x20');if(!_0x20efa7)return _0x26515c(0x20b);return undefined;}async[a10_0xc3133d(0x205)](_0x5c08c5,_0xba7cd6,_0x30a598,_0x313a8c,_0xad6f5c){const _0x39402d=a10_0xc3133d;for await(const _0x10b4e5 of _0x5c08c5[_0x39402d(0x1dd)][_0x39402d(0x1f0)](_0xba7cd6,{'agentId':_0x30a598,'chatId':_0x313a8c})){if(_0x10b4e5[_0x39402d(0x1d6)]==='metadata'){const _0x37e931=_0x10b4e5['data'][_0x39402d(0x206)];saveLastChatId(_0x37e931),_0xad6f5c&&console[_0x39402d(0x1e0)](_0x39402d(0x1d7)+_0x37e931);}else _0x10b4e5[_0x39402d(0x1d6)]===_0x39402d(0x1d8)&&this['handleChatEvent'](_0x10b4e5[_0x39402d(0x1ed)]);}}async[a10_0xc3133d(0x1c7)](_0x57a3e2,_0x5be743,_0x5f31c3,_0xdb8407){const _0x469ec4=a10_0xc3133d,_0x145e43=_0x57a3e2[_0x469ec4(0x208)][_0x469ec4(0x1cc)];let _0x1ccf3c=![];for await(const _0x1d7d11 of _0x57a3e2[_0x469ec4(0x1dd)]['chat'](_0x5be743,{'agentId':_0x5f31c3,'chatId':_0xdb8407})){if(_0x1d7d11[_0x469ec4(0x1d6)]===_0x469ec4(0x1fe)){const _0x2e90ec=_0x1d7d11['data'];saveLastChatId(_0x2e90ec[_0x469ec4(0x206)]);const _0x4d2214=_0x2e90ec[_0x469ec4(0x1cf)]&&_0x2e90ec['agentId']?getLLMConversationUrl(_0x145e43,_0x2e90ec['projectId'],_0x2e90ec[_0x469ec4(0x1e5)],_0x2e90ec[_0x469ec4(0x206)]):undefined;console[_0x469ec4(0x201)](JSON[_0x469ec4(0x1ec)]({'type':_0x469ec4(0x1fe),'data':{'chatId':_0x2e90ec[_0x469ec4(0x206)],'agentId':_0x2e90ec[_0x469ec4(0x1e5)],'consoleUrl':_0x4d2214}})),_0x1ccf3c=!![];}else{if(_0x1d7d11[_0x469ec4(0x1d6)]==='event'){!_0x1ccf3c&&_0xdb8407&&(console[_0x469ec4(0x201)](JSON[_0x469ec4(0x1ec)]({'type':'metadata','data':{'chatId':_0xdb8407}})),_0x1ccf3c=!![]);const _0x4a6a6e=_0x1d7d11[_0x469ec4(0x1ed)];if(_0x469ec4(0x1d4)in _0x4a6a6e)console[_0x469ec4(0x201)](JSON[_0x469ec4(0x1ec)]({'type':_0x469ec4(0x1d4),'data':{'content':_0x4a6a6e['content']}}));else{if(_0x469ec4(0x1f5)in _0x4a6a6e){const _0x9cb229=_0x4a6a6e[_0x469ec4(0x1f5)];console['log'](JSON['stringify']({'type':_0x469ec4(0x1f5),'data':{'id':_0x9cb229['id'],'name':_0x9cb229[_0x469ec4(0x1eb)],'target':_0x9cb229['targetKnowledgeBase']?.['name']||_0x9cb229['targetAgent']?.['name']||_0x9cb229[_0x469ec4(0x1ff)]?.['name']||_0x9cb229[_0x469ec4(0x1fc)]}}));}else{if(_0x469ec4(0x1e9)in _0x4a6a6e)console[_0x469ec4(0x201)](JSON[_0x469ec4(0x1ec)]({'type':_0x469ec4(0x1d2),'data':{'id':_0x4a6a6e[_0x469ec4(0x1e9)]['id'],'name':_0x4a6a6e[_0x469ec4(0x1e9)][_0x469ec4(0x1eb)],'result':typeof _0x4a6a6e[_0x469ec4(0x1e9)][_0x469ec4(0x1d4)]===_0x469ec4(0x1e7)?_0x4a6a6e['tool'][_0x469ec4(0x1d4)]['slice'](0x0,0x1f4):''}}));else'error'in _0x4a6a6e&&console[_0x469ec4(0x201)](JSON['stringify']({'type':_0x469ec4(0x1e0),'data':{'error':_0x4a6a6e[_0x469ec4(0x1e0)]}}));}}}}}console[_0x469ec4(0x201)](JSON[_0x469ec4(0x1ec)]({'type':_0x469ec4(0x1f1)}));}async['execute'](_0x1484a2){const _0x2c3ea1=a10_0xc3133d,{options:_0x497c7e,args:_0x4cdce5,tdx:_0x5d28c9}=_0x1484a2,_0x5334c9=_0x4cdce5[_0x2c3ea1(0x1cd)]('\x20'),_0x588ef8=_0x497c7e,_0x14b24d=_0x588ef8[_0x2c3ea1(0x202)],_0x321b77=_0x588ef8['llmAgent'],_0x1af8c6=_0x588ef8['llmProject'],_0x5ce495=_0x588ef8[_0x2c3ea1(0x210)],_0x1df0f2=_0x588ef8[_0x2c3ea1(0x206)],_0x19f05d=_0x588ef8[_0x2c3ea1(0x1d1)];if(_0x5ce495&&_0x1df0f2)return console[_0x2c3ea1(0x1e0)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x5e991d,_0x2f4350;if(_0x1df0f2)_0x2f4350=_0x1df0f2;else!_0x5ce495&&(_0x2f4350=loadLastChatId(),_0x2f4350&&_0x497c7e[_0x2c3ea1(0x213)]&&console[_0x2c3ea1(0x1e0)]('Continuing\x20chat:\x20'+_0x2f4350));!_0x1df0f2&&(_0x5ce495||!_0x2f4350)&&(_0x5e991d=await resolveAgentId(_0x5d28c9,_0x14b24d,_0x321b77,_0x1af8c6,_0x497c7e['verbose']));const _0x46cdb5=_0x19f05d?(_0x272990,_0x1ce58a,_0x2267e1)=>this[_0x2c3ea1(0x1c7)](_0x5d28c9,_0x272990,_0x1ce58a,_0x2267e1):(_0x4dff38,_0x55af48,_0x54eee8)=>this[_0x2c3ea1(0x205)](_0x5d28c9,_0x4dff38,_0x55af48,_0x54eee8,_0x497c7e[_0x2c3ea1(0x213)]);try{await _0x46cdb5(_0x5334c9,_0x5e991d,_0x2f4350);}catch(_0x2264e9){const _0x428140=_0x2264e9 instanceof SDKError&&_0x2264e9[_0x2c3ea1(0x1e3)]===ErrorCode[_0x2c3ea1(0x1df)]||_0x2264e9 instanceof Error&&_0x2264e9[_0x2c3ea1(0x1f2)]['includes']('404');if(_0x428140&&_0x1df0f2)return console[_0x2c3ea1(0x1e0)](_0x2c3ea1(0x1dc)+_0x1df0f2+_0x2c3ea1(0x200)),0x1;if(_0x428140)_0x497c7e[_0x2c3ea1(0x213)]&&console[_0x2c3ea1(0x1e0)](_0x2c3ea1(0x1ce)),!_0x5e991d&&(_0x5e991d=await resolveAgentId(_0x5d28c9,_0x14b24d,_0x321b77,_0x1af8c6,_0x497c7e[_0x2c3ea1(0x213)])),await _0x46cdb5(_0x5334c9,_0x5e991d,undefined);else throw _0x2264e9;}return!_0x19f05d&&console['log'](),0x0;}catch(_0xc3e877){return console[_0x2c3ea1(0x1e0)](),handleSDKError(_0xc3e877,_0x497c7e),0x1;}}[a10_0xc3133d(0x1ee)](_0x14caa4){const _0x6b50a1=a10_0xc3133d;if('content'in _0x14caa4)process[_0x6b50a1(0x1cb)][_0x6b50a1(0x212)](_0x14caa4[_0x6b50a1(0x1d4)]);else _0x6b50a1(0x1e0)in _0x14caa4&&console['error'](_0x6b50a1(0x1e1)+_0x14caa4[_0x6b50a1(0x1e0)]);}}export class ChatCreateCommand extends BaseCommand{[a10_0xc3133d(0x1fb)]=a10_0xc3133d(0x1c9);[a10_0xc3133d(0x204)]=a10_0xc3133d(0x20c);[a10_0xc3133d(0x1d0)](_0xf4b1ec){const _0x5a01a0=a10_0xc3133d,_0x45b67f=_0xf4b1ec['options'],_0x56c395=_0x45b67f[_0x5a01a0(0x202)],_0x1ad8e1=_0x45b67f[_0x5a01a0(0x203)];if(!_0x56c395&&!_0x1ad8e1)return _0x5a01a0(0x211);return undefined;}async[a10_0xc3133d(0x1e8)](_0x4aaab6){const _0x2b3619=a10_0xc3133d,{options:_0x17fba7,tdx:_0x4d4d7e}=_0x4aaab6,_0xfd6c12=_0x17fba7,_0x5b1319=_0xfd6c12[_0x2b3619(0x202)],_0x1ecfd7=_0xfd6c12[_0x2b3619(0x203)],_0x4778e5=_0xfd6c12[_0x2b3619(0x209)];try{const _0x14613f=await resolveAgentId(_0x4d4d7e,_0x5b1319,_0x1ecfd7,_0x4778e5,_0x17fba7['verbose']),_0x20a494=await _0x4d4d7e[_0x2b3619(0x1dd)]['startChat'](_0x14613f);return saveLastChatId(_0x20a494['id']),console['log'](JSON[_0x2b3619(0x1ec)]({'chatId':_0x20a494['id'],'agentId':_0x14613f})),0x0;}catch(_0x4b9f68){return handleSDKError(_0x4b9f68,_0x17fba7),0x1;}}}
1
+ const a10_0x8c1e9e=a10_0x3a30;function a10_0x2499(){const _0x521df8=['\x0aError:\x20','9dVEPNS','Resolving\x20agent\x20\x27','startChat','new','log','streamChat','done','getDefaultAgent','Chat\x20session:\x20','\x20\x20Cause:\x20','stack','tool','llm','validate','getOrCreateDefaultAgent','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','event','message','args','functionName','cause','targetAgent','\x0aStack\x20trace:','llmProject','Resolving\x20project\x20\x27','4ZWAdaf','--agent\x20flag','agentId','claude-4.5-haiku','llmAgent','976494LppenN','targetKnowledgeBase','stream','2nakxbC','handleChatEvent','name','Continuing\x20chat:\x20','4855580SgXUIR','stringify','type','projectId','data','105380vvQKnn','8349000ZkQMdz','session\x20context','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','streamChatJsonl','targetFunction','chatId','resolveAgentId','tool_call','execute','slice','site','metadata','join','1516214tZdzgg','context','Using\x20cached\x20default\x20agent:\x20','CHAT_NOT_FOUND','2964230VCnGmA','options','targetWebSearchTool','code','agent','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','tool_result','verbose','string','chat','Error:\x20','content','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','error','5067584JGucaV','description','6BwkTgh','Error:\x20Chat\x20session\x20\x27','chat-create','Using\x20agent\x20from\x20'];a10_0x2499=function(){return _0x521df8;};return a10_0x2499();}(function(_0x145d2e,_0x1fb110){const _0x4d1e52=a10_0x3a30,_0x18d14a=_0x145d2e();while(!![]){try{const _0x2449db=-parseInt(_0x4d1e52(0x16d))/0x1+parseInt(_0x4d1e52(0x164))/0x2*(parseInt(_0x4d1e52(0x161))/0x3)+-parseInt(_0x4d1e52(0x15c))/0x4*(-parseInt(_0x4d1e52(0x17f))/0x5)+parseInt(_0x4d1e52(0x18f))/0x6*(parseInt(_0x4d1e52(0x17b))/0x7)+-parseInt(_0x4d1e52(0x18d))/0x8*(-parseInt(_0x4d1e52(0x143))/0x9)+-parseInt(_0x4d1e52(0x168))/0xa+-parseInt(_0x4d1e52(0x16e))/0xb;if(_0x2449db===_0x1fb110)break;else _0x18d14a['push'](_0x18d14a['shift']());}catch(_0x5b53c7){_0x18d14a['push'](_0x18d14a['shift']());}}}(a10_0x2499,0x66298));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 a10_0x3a30(_0x3c99a1,_0x2943dd){_0x3c99a1=_0x3c99a1-0x141;const _0x24994f=a10_0x2499();let _0x3a30b4=_0x24994f[_0x3c99a1];return _0x3a30b4;}function handleSDKError(_0x4403b6,_0x1b4ff7){const _0x224962=a10_0x3a30;if(_0x4403b6 instanceof SDKError)console[_0x224962(0x18c)](_0x224962(0x189)+_0x4403b6[_0x224962(0x154)]),_0x1b4ff7[_0x224962(0x186)]&&(_0x4403b6['cause']&&console[_0x224962(0x18c)](_0x224962(0x14c)+_0x4403b6[_0x224962(0x157)]),_0x4403b6[_0x224962(0x14d)]&&(console[_0x224962(0x18c)](_0x224962(0x159)),console[_0x224962(0x18c)](_0x4403b6['stack'])));else throw _0x4403b6;}async function resolveAgentId(_0x6ec3d4,_0x5745bf,_0x2926eb,_0x562343,_0xfd2f79){const _0x3254db=a10_0x3a30,_0xf2e5e=_0x5745bf||_0x2926eb;if(_0xf2e5e){const {projectName:_0x4c40de,agentName:_0x196a8f}=parseAgentRef(_0xf2e5e),_0x2fce52=_0x196a8f||_0xf2e5e,_0x1290b4=_0x196a8f?_0x4c40de:_0x562343;if(!_0x1290b4)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0xfd2f79){const _0x43f02d=_0x5745bf?_0x3254db(0x15d):_0x3254db(0x16f);console[_0x3254db(0x18c)](_0x3254db(0x141)+_0x43f02d+':\x20'+_0x1290b4+'/'+_0x2fce52);}const _0x3a3911=await withSpinner(_0x3254db(0x15b)+_0x1290b4+'\x27...',()=>_0x6ec3d4[_0x3254db(0x14f)]['resolveProjectId'](_0x1290b4),{'verbose':_0xfd2f79}),_0x243803=await withSpinner(_0x3254db(0x144)+_0x2fce52+'\x27...',()=>_0x6ec3d4[_0x3254db(0x14f)][_0x3254db(0x174)](_0x2fce52,_0x3a3911[_0x3254db(0x16c)]),{'verbose':_0xfd2f79});return _0x243803[_0x3254db(0x16c)];}else{const _0x526ed5=_0x6ec3d4[_0x3254db(0x14f)][_0x3254db(0x14a)]();if(_0x526ed5)return _0xfd2f79&&console[_0x3254db(0x18c)](_0x3254db(0x17d)+_0x526ed5[_0x3254db(0x166)]),_0x526ed5['id'];const _0x377bcd=await withSpinner('Getting\x20default\x20agent...',()=>_0x6ec3d4['llm'][_0x3254db(0x151)](_0x3254db(0x15f),0x0),{'verbose':_0xfd2f79});return _0x377bcd[_0x3254db(0x16c)]['id'];}}export class ChatCommand extends BaseCommand{[a10_0x8c1e9e(0x166)]='chat';[a10_0x8c1e9e(0x18e)]=a10_0x8c1e9e(0x18b);['validate'](_0x53e36c){const _0x413b8f=a10_0x8c1e9e,_0x4763f6=_0x53e36c[_0x413b8f(0x155)][_0x413b8f(0x17a)]('\x20');if(!_0x4763f6)return _0x413b8f(0x152);return undefined;}async[a10_0x8c1e9e(0x148)](_0x56e489,_0x2d5d19,_0x2be42a,_0x249c81,_0x4aff0c){const _0x1235ba=a10_0x8c1e9e;for await(const _0x356068 of _0x56e489[_0x1235ba(0x14f)][_0x1235ba(0x188)](_0x2d5d19,{'agentId':_0x2be42a,'chatId':_0x249c81})){if(_0x356068[_0x1235ba(0x16a)]==='metadata'){const _0xcd50f4=_0x356068[_0x1235ba(0x16c)]['chatId'];saveLastChatId(_0xcd50f4),_0x4aff0c&&console[_0x1235ba(0x18c)](_0x1235ba(0x14b)+_0xcd50f4);}else _0x356068['type']===_0x1235ba(0x153)&&this[_0x1235ba(0x165)](_0x356068[_0x1235ba(0x16c)]);}}async[a10_0x8c1e9e(0x171)](_0x28a445,_0xfd84dd,_0x455d8f,_0x5b3b5d){const _0x17546e=a10_0x8c1e9e,_0x4851dd=_0x28a445[_0x17546e(0x17c)][_0x17546e(0x178)];let _0x829583=![];for await(const _0x50f4ce of _0x28a445[_0x17546e(0x14f)][_0x17546e(0x188)](_0xfd84dd,{'agentId':_0x455d8f,'chatId':_0x5b3b5d})){if(_0x50f4ce['type']===_0x17546e(0x179)){const _0x1d369d=_0x50f4ce[_0x17546e(0x16c)];saveLastChatId(_0x1d369d[_0x17546e(0x173)]);const _0x5f29b5=_0x1d369d['projectId']&&_0x1d369d[_0x17546e(0x15e)]?getLLMConversationUrl(_0x4851dd,_0x1d369d[_0x17546e(0x16b)],_0x1d369d[_0x17546e(0x15e)],_0x1d369d['chatId']):undefined;console[_0x17546e(0x147)](JSON[_0x17546e(0x169)]({'type':'metadata','data':{'chatId':_0x1d369d[_0x17546e(0x173)],'agentId':_0x1d369d[_0x17546e(0x15e)],'consoleUrl':_0x5f29b5}})),_0x829583=!![];}else{if(_0x50f4ce[_0x17546e(0x16a)]===_0x17546e(0x153)){!_0x829583&&_0x5b3b5d&&(console[_0x17546e(0x147)](JSON[_0x17546e(0x169)]({'type':'metadata','data':{'chatId':_0x5b3b5d}})),_0x829583=!![]);const _0x10063d=_0x50f4ce['data'];if(_0x17546e(0x18a)in _0x10063d)console['log'](JSON[_0x17546e(0x169)]({'type':_0x17546e(0x18a),'data':{'content':_0x10063d[_0x17546e(0x18a)]}}));else{if('tool_call'in _0x10063d){const _0x96e6c4=_0x10063d[_0x17546e(0x175)];console[_0x17546e(0x147)](JSON[_0x17546e(0x169)]({'type':_0x17546e(0x175),'data':{'id':_0x96e6c4['id'],'name':_0x96e6c4[_0x17546e(0x156)],'target':_0x96e6c4[_0x17546e(0x162)]?.[_0x17546e(0x166)]||_0x96e6c4[_0x17546e(0x158)]?.[_0x17546e(0x166)]||_0x96e6c4[_0x17546e(0x181)]?.[_0x17546e(0x166)]||_0x96e6c4[_0x17546e(0x172)]}}));}else{if('tool'in _0x10063d)console['log'](JSON['stringify']({'type':_0x17546e(0x185),'data':{'id':_0x10063d[_0x17546e(0x14e)]['id'],'name':_0x10063d[_0x17546e(0x14e)]['functionName'],'result':typeof _0x10063d[_0x17546e(0x14e)][_0x17546e(0x18a)]===_0x17546e(0x187)?_0x10063d[_0x17546e(0x14e)][_0x17546e(0x18a)][_0x17546e(0x177)](0x0,0x1f4):''}}));else _0x17546e(0x18c)in _0x10063d&&console[_0x17546e(0x147)](JSON[_0x17546e(0x169)]({'type':_0x17546e(0x18c),'data':{'error':_0x10063d[_0x17546e(0x18c)]}}));}}}}}console[_0x17546e(0x147)](JSON[_0x17546e(0x169)]({'type':_0x17546e(0x149)}));}async[a10_0x8c1e9e(0x176)](_0x26a296){const _0x465ceb=a10_0x8c1e9e,{options:_0x5a2a62,args:_0x390480,tdx:_0x53c786}=_0x26a296,_0x260819=_0x390480[_0x465ceb(0x17a)]('\x20'),_0x3fc37a=_0x5a2a62,_0x2451d2=_0x3fc37a[_0x465ceb(0x183)],_0xff47e1=_0x3fc37a[_0x465ceb(0x160)],_0x48f8b0=_0x3fc37a[_0x465ceb(0x15a)],_0x406f7e=_0x3fc37a[_0x465ceb(0x146)],_0x587a2f=_0x3fc37a[_0x465ceb(0x173)],_0x144cd4=_0x3fc37a[_0x465ceb(0x163)];if(_0x406f7e&&_0x587a2f)return console[_0x465ceb(0x18c)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x473737,_0x1f32e4;if(_0x587a2f)_0x1f32e4=_0x587a2f;else!_0x406f7e&&(_0x1f32e4=loadLastChatId(),_0x1f32e4&&_0x5a2a62[_0x465ceb(0x186)]&&console[_0x465ceb(0x18c)](_0x465ceb(0x167)+_0x1f32e4));!_0x587a2f&&(_0x406f7e||!_0x1f32e4)&&(_0x473737=await resolveAgentId(_0x53c786,_0x2451d2,_0xff47e1,_0x48f8b0,_0x5a2a62['verbose']));const _0xfb71c8=_0x144cd4?(_0x1f585c,_0x51c690,_0x35a1b8)=>this[_0x465ceb(0x171)](_0x53c786,_0x1f585c,_0x51c690,_0x35a1b8):(_0x3266f7,_0x520770,_0x174838)=>this['streamChat'](_0x53c786,_0x3266f7,_0x520770,_0x174838,_0x5a2a62['verbose']);try{await _0xfb71c8(_0x260819,_0x473737,_0x1f32e4);}catch(_0x12c6a4){const _0x47d324=_0x12c6a4 instanceof SDKError&&_0x12c6a4[_0x465ceb(0x182)]===ErrorCode[_0x465ceb(0x17e)]||_0x12c6a4 instanceof Error&&_0x12c6a4[_0x465ceb(0x154)]['includes']('404');if(_0x47d324&&_0x587a2f)return console[_0x465ceb(0x18c)](_0x465ceb(0x190)+_0x587a2f+'\x27\x20not\x20found'),0x1;if(_0x47d324)_0x5a2a62['verbose']&&console[_0x465ceb(0x18c)](_0x465ceb(0x170)),!_0x473737&&(_0x473737=await resolveAgentId(_0x53c786,_0x2451d2,_0xff47e1,_0x48f8b0,_0x5a2a62['verbose'])),await _0xfb71c8(_0x260819,_0x473737,undefined);else throw _0x12c6a4;}return!_0x144cd4&&console[_0x465ceb(0x147)](),0x0;}catch(_0x35f78c){return console[_0x465ceb(0x18c)](),handleSDKError(_0x35f78c,_0x5a2a62),0x1;}}[a10_0x8c1e9e(0x165)](_0x5976b1){const _0x3951cb=a10_0x8c1e9e;if(_0x3951cb(0x18a)in _0x5976b1)process['stdout']['write'](_0x5976b1[_0x3951cb(0x18a)]);else _0x3951cb(0x18c)in _0x5976b1&&console[_0x3951cb(0x18c)](_0x3951cb(0x142)+_0x5976b1['error']);}}export class ChatCreateCommand extends BaseCommand{[a10_0x8c1e9e(0x166)]=a10_0x8c1e9e(0x191);['description']='Create\x20a\x20new\x20chat\x20session';[a10_0x8c1e9e(0x150)](_0x1d0915){const _0x73623d=a10_0x8c1e9e,_0x18c2f2=_0x1d0915[_0x73623d(0x180)],_0x1e7297=_0x18c2f2[_0x73623d(0x183)],_0x46ec03=_0x18c2f2['llmAgent'];if(!_0x1e7297&&!_0x46ec03)return _0x73623d(0x184);return undefined;}async[a10_0x8c1e9e(0x176)](_0x29dea4){const _0x4599e3=a10_0x8c1e9e,{options:_0x37099a,tdx:_0x47db6b}=_0x29dea4,_0x4d9bfe=_0x37099a,_0x9caa87=_0x4d9bfe['agent'],_0x599b00=_0x4d9bfe['llmAgent'],_0x3b5ae3=_0x4d9bfe[_0x4599e3(0x15a)];try{const _0x143549=await resolveAgentId(_0x47db6b,_0x9caa87,_0x599b00,_0x3b5ae3,_0x37099a['verbose']),_0x797a1b=await _0x47db6b['llm'][_0x4599e3(0x145)](_0x143549);return saveLastChatId(_0x797a1b['id']),console[_0x4599e3(0x147)](JSON[_0x4599e3(0x169)]({'chatId':_0x797a1b['id'],'agentId':_0x143549})),0x0;}catch(_0x51a6ce){return handleSDKError(_0x51a6ce,_0x37099a),0x1;}}}
@@ -1 +1 @@
1
- const a11_0x33970b=a11_0x1b77;(function(_0x429fe7,_0x220098){const _0x35cc28=a11_0x1b77,_0x577e4e=_0x429fe7();while(!![]){try{const _0x53a996=-parseInt(_0x35cc28(0xc1))/0x1+-parseInt(_0x35cc28(0xa2))/0x2+parseInt(_0x35cc28(0xcc))/0x3*(parseInt(_0x35cc28(0x107))/0x4)+parseInt(_0x35cc28(0xcb))/0x5*(parseInt(_0x35cc28(0xe8))/0x6)+parseInt(_0x35cc28(0x11f))/0x7*(-parseInt(_0x35cc28(0xe1))/0x8)+-parseInt(_0x35cc28(0x101))/0x9*(parseInt(_0x35cc28(0x99))/0xa)+parseInt(_0x35cc28(0x8d))/0xb*(parseInt(_0x35cc28(0x112))/0xc);if(_0x53a996===_0x220098)break;else _0x577e4e['push'](_0x577e4e['shift']());}catch(_0x273b47){_0x577e4e['push'](_0x577e4e['shift']());}}}(a11_0x3460,0xb8ff1));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_0x497450 from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint,getConsoleUrl}from'../sdk/client/endpoints.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';function a11_0x1b77(_0xee4c44,_0xe67542){_0xee4c44=_0xee4c44-0x75;const _0x3460f9=a11_0x3460();let _0x1b77c7=_0x3460f9[_0xee4c44];return _0x1b77c7;}import{writeCachedAccountInfo,loadReleaseChannel}from'../core/config.js';import{resolveReleaseTag}from'../utils/github-releases.js';const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION=a11_0x33970b(0xab),SETTINGS_BACKUP_FILENAME=a11_0x33970b(0x89);function isProcessRunning(_0x1f165a){const _0x49dbd7=a11_0x33970b;try{return process[_0x49dbd7(0x85)](_0x1f165a,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x517294,_0x127f14){const _0xec85f6=a11_0x33970b;if(!existsSync(_0x517294))return;try{const _0x19293c=await readFile(_0x517294,_0xec85f6(0xb0)),_0x5c93c8=JSON[_0xec85f6(0xdd)](_0x19293c),_0x4e5237=_0x5c93c8[_0xec85f6(0x93)]||{};for(const _0x432034 of[_0xec85f6(0x7b),_0xec85f6(0x108),_0xec85f6(0x9e),_0xec85f6(0x7e),_0xec85f6(0x8a)]){_0x127f14[_0x432034]!==undefined?_0x4e5237[_0x432034]=_0x127f14[_0x432034]:delete _0x4e5237[_0x432034];}_0x127f14[_0xec85f6(0x11a)]!==undefined?_0x5c93c8[_0xec85f6(0x11a)]=_0x127f14[_0xec85f6(0x11a)]:delete _0x5c93c8[_0xec85f6(0x11a)],_0x5c93c8[_0xec85f6(0x93)]=_0x4e5237,await writeFile(_0x517294,JSON[_0xec85f6(0xf1)](_0x5c93c8,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x56d4ae){try{await unlink(_0x56d4ae);}catch{}}async function recoverFromStaleBackup(_0x3e44a2,_0x15e4e8){const _0x4b2fd1=a11_0x33970b;if(!existsSync(_0x15e4e8))return undefined;try{const _0x5f4232=await readFile(_0x15e4e8,_0x4b2fd1(0xb0)),_0x596ace=JSON[_0x4b2fd1(0xdd)](_0x5f4232);if(isProcessRunning(_0x596ace[_0x4b2fd1(0x11b)]))return{'liveSessionOriginals':_0x596ace['originalSettings']};return await applyOriginalSettings(_0x3e44a2,_0x596ace[_0x4b2fd1(0x113)]),await safeUnlink(_0x15e4e8),undefined;}catch{return await safeUnlink(_0x15e4e8),undefined;}}function handleInstallationError(_0x23f798,_0x53e094,_0x4dfd20,_0x5e52f9){const _0x400e08=a11_0x33970b;errorContains(_0x23f798,_0x400e08(0xf6),_0x400e08(0xef),'already\x20configured')?(_0x4dfd20[_0x400e08(0xde)]='✓\x20'+_0x53e094+'\x20already\x20configured',_0x5e52f9?.['info'](_0x53e094+_0x400e08(0x9a)),_0x23f798 instanceof SDKError&&_0x23f798[_0x400e08(0xe3)]&&_0x5e52f9?.['debug'](_0x400e08(0xca)+_0x23f798[_0x400e08(0xe3)][_0x400e08(0x80)])):(_0x4dfd20[_0x400e08(0x122)](_0x400e08(0xe4)+_0x53e094),_0x5e52f9?.['error'](_0x53e094+_0x400e08(0xaa),_0x23f798));}export function parseVersion(_0x6eeece){const _0x4df071=a11_0x33970b,_0x4ca209=_0x6eeece['trim']()[_0x4df071(0x8e)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x4ca209)return null;return{'major':parseInt(_0x4ca209[0x1],0xa),'minor':parseInt(_0x4ca209[0x2],0xa),'patch':parseInt(_0x4ca209[0x3],0xa)};}export function compareVersions(_0x546d92,_0x5e751e){const _0x4198e8=a11_0x33970b;if(_0x546d92['major']!==_0x5e751e['major'])return _0x546d92[_0x4198e8(0xb2)]-_0x5e751e['major'];if(_0x546d92['minor']!==_0x5e751e[_0x4198e8(0xb6)])return _0x546d92[_0x4198e8(0xb6)]-_0x5e751e['minor'];return _0x546d92['patch']-_0x5e751e[_0x4198e8(0xb8)];}async function checkClaudeVersion(_0x275b43,_0x155f15){const _0x3c1095=a11_0x33970b;_0x155f15?.[_0x3c1095(0x94)](_0x3c1095(0x87)+_0x275b43+')');const _0x524acd=await executeClaudeCommand([_0x3c1095(0x81)],undefined,_0x155f15),_0x3655c7=parseVersion(_0x524acd);if(!_0x3655c7){_0x155f15?.[_0x3c1095(0x122)](_0x3c1095(0x8c)+_0x524acd);return;}const _0x37263b=_0x3655c7[_0x3c1095(0xb2)]+'.'+_0x3655c7[_0x3c1095(0xb6)]+'.'+_0x3655c7[_0x3c1095(0xb8)],_0x583d38=parseVersion(_0x275b43);if(!_0x583d38){_0x155f15?.[_0x3c1095(0x122)](_0x3c1095(0xb3)+_0x275b43);return;}if(compareVersions(_0x3655c7,_0x583d38)<0x0){_0x155f15?.[_0x3c1095(0x105)](_0x3c1095(0xe5)+_0x37263b+_0x3c1095(0xf0)+_0x275b43+')');throw new SDKError(ErrorCode[_0x3c1095(0xc7)],_0x3c1095(0xe5)+_0x37263b+_0x3c1095(0xc2)+_0x275b43+'\x20or\x20later.',undefined,{'helpText':_0x3c1095(0xfe)});}_0x155f15?.[_0x3c1095(0x94)](_0x3c1095(0xe5)+_0x37263b+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x27ca47,_0x539743,_0x1295da){const _0x4d2cff=a11_0x33970b;return _0x1295da?.[_0x4d2cff(0x77)](_0x4d2cff(0xd2)+_0x27ca47['join']('\x20')),new Promise((_0x8497c3,_0x128b76)=>{const _0x30ae54=_0x4d2cff,_0x2050d5=crossSpawn('claude',_0x27ca47,{'stdio':_0x30ae54(0xa0)});let _0x1eeb32='',_0x381265='';_0x2050d5[_0x30ae54(0x7a)]?.['on'](_0x30ae54(0x75),_0xa97bd6=>{const _0x391d47=_0x30ae54;_0x1eeb32+=_0xa97bd6[_0x391d47(0xcf)]();}),_0x2050d5[_0x30ae54(0xa7)]?.['on'](_0x30ae54(0x75),_0x570e6f=>{const _0x46af1d=_0x30ae54;_0x381265+=_0x570e6f[_0x46af1d(0xcf)]();}),_0x2050d5['on']('error',_0x5bcc75=>{const _0x4976be=_0x30ae54;_0x5bcc75['code']===_0x4976be(0x120)?(_0x1295da?.[_0x4976be(0x105)](_0x4976be(0xa9)),_0x128b76(new SDKError(ErrorCode[_0x4976be(0x117)],_0x4976be(0xa9),_0x5bcc75,{'helpText':_0x4976be(0xa5)}))):(_0x1295da?.[_0x4976be(0x105)](_0x4976be(0x90)+_0x5bcc75[_0x4976be(0x80)]),_0x128b76(new SDKError(ErrorCode[_0x4976be(0x96)],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x5bcc75[_0x4976be(0x80)],_0x5bcc75)));}),_0x2050d5['on'](_0x30ae54(0x9f),_0x55102e=>{const _0x1570c4=_0x30ae54;if(_0x55102e===0x0)_0x8497c3(_0x1eeb32);else _0x539743?(_0x1295da?.[_0x1570c4(0x105)](_0x1570c4(0xf5)+_0x55102e+_0x1570c4(0xea)+_0x27ca47['join']('\x20')),_0x128b76(new SDKError(ErrorCode[_0x1570c4(0xee)],_0x539743,new Error(_0x381265)))):_0x8497c3('');});});}async function ensureMcpServer(_0x46810e,_0x1e30ba,_0x58caf6,_0x435214,_0xad68){const _0x5e9721=a11_0x33970b;_0x435214['text']=_0x5e9721(0xf3)+_0x46810e+'\x27...',await executeClaudeCommand(['mcp',_0x5e9721(0xc5),_0x46810e,_0x1e30ba,_0x5e9721(0xaf),_0x58caf6],_0x5e9721(0xd1)+_0x46810e+'\x27',_0xad68),_0x435214['text']=_0x5e9721(0xd0)+_0x46810e+_0x5e9721(0x10b);}export const DEFAULT_TD_SKILLS_URL=a11_0x33970b(0xe9);function a11_0x3460(){const _0x483e57=['already\x20installed','\x20is\x20too\x20old\x20(minimum:\x20','stringify','fail','Configuring\x20MCP\x20server\x20\x27','access_token','Command\x20failed\x20(exit\x20','already\x20exists','td-docs','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','td-skills\x20Plugins','tdx-managed-proxy','log','refresh_token','git','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','\x27\x20removed','origin/main','801nnlwPd','Checking\x20Claude\x20Code\x20version...','td-skills\x20checked\x20out\x20at\x20tag\x20','false','error','✓\x20Marketplace\x20\x27','3888nPrhHc','ANTHROPIC_MODEL','TD\x20Docs\x20MCP\x20Server','user','\x27\x20configured','start','\x27\x20updated','tdx\x20claude\x20statusline','marketplaces','logLevel','green','107664WcIOwp','originalSettings','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','tdx-skills','.claude','CLAUDE_CODE_NOT_FOUND','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','stop','statusLine','pid','apiKey','...','✓\x20Claude\x20Code\x20version\x20OK','15435PlJsbL','ENOENT','llm-proxy','warn','Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup','data','INVALID_ARGUMENT','info','--tags','getLogPath','stdout','ANTHROPIC_BASE_URL','red','execute','CLAUDE_CODE_USE_BEDROCK','passThroughServer','message','--version','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','http://127.0.0.1:','profile','kill','remove','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','oauth','.tdx-settings-backup.json','CLAUDE_CODE_USE_VERTEX','--hard','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','2464fVsmEb','match','--force','Command\x20spawn\x20error:\x20','https://docs.treasuredata.com/mcp','td-skills','env','debug','✓\x20Logs\x20saved\x20to\x20','INTERNAL','Updating\x20marketplace\x20\x27','command','69380VUUsll','\x20already\x20configured','tdx-cli','Initializing\x20proxy\x20logger...','Failed\x20to\x20update\x20marketplace\x20\x27','ANTHROPIC_AUTH_TOKEN','exit','pipe','Initializing...','1490812WPEPWv','\x27...','Checking\x20out\x20td-skills\x20','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','includes','stderr','settings.local.json','Claude\x20Code\x20CLI\x20not\x20found','\x20configuration\x20failed','2.0.20','✓\x20Settings\x20configured:\x20.claude/settings.local.json','update','\x27\x20installed','--transport','utf-8','getCurrent','major','Invalid\x20minimum\x20version\x20format:\x20','Setup\x20failed','Marketplace\x20\x27','minor','sql-skills','patch','continue','fetch','cwd','marketplace','treasure-data','verbose','description','Configuring\x20marketplace\x20\x27','717643daIswn','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','inherit','plugins','add','close','CLAUDE_CODE_UNSUPPORTED_VERSION','reset','Installing\x20plugin\x20\x27','Command\x20output:\x20','10WfhVPs','2046ImbuQU','claude','Failed\x20to\x20remove\x20marketplace\x20\x27','toString','✓\x20MCP\x20server\x20\x27','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','Executing:\x20claude\x20','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','logger','\x27:\x20','Failed\x20to\x20launch\x20Claude\x20Code:\x20','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','✓\x20td-skills\x20checked\x20out\x20at\x20','site','account_id','name','plugin','parse','text','Claude\x20Code\x20version\x20check\x20failed','origin','4160XuoHYc','main','cause','Warning:\x20Failed\x20to\x20configure\x20','Claude\x20Code\x20version\x20','port','Restored\x20default\x20td-skills\x20marketplace','3936732MewgBw','https://github.com/treasure-data/td-skills','):\x20claude\x20','unshift','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','expires_at','INSTALLATION_FAILED'];a11_0x3460=function(){return _0x483e57;};return a11_0x3460();}export function getTdSkillsRepoUrl(){const _0x210cb6=process.env.TDX_TD_SKILLS_REPO;if(_0x210cb6)return _0x210cb6;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x37ca2e,_0x5456c9){const _0x38594c=a11_0x33970b;try{const _0x189fda=await executeClaudeCommand([_0x38594c(0xdc),_0x38594c(0xbc),'list'],'Failed\x20to\x20list\x20marketplaces',_0x5456c9);if(!_0x189fda[_0x38594c(0xa6)](_0x37ca2e)){_0x5456c9?.[_0x38594c(0x94)](_0x38594c(0xb5)+_0x37ca2e+_0x38594c(0xec));return;}await executeClaudeCommand([_0x38594c(0xdc),_0x38594c(0xbc),_0x38594c(0x86),_0x37ca2e],_0x38594c(0xce)+_0x37ca2e+'\x27',_0x5456c9),_0x5456c9?.[_0x38594c(0x77)]('Marketplace\x20\x27'+_0x37ca2e+_0x38594c(0xff));}catch(_0x30a39e){_0x5456c9?.[_0x38594c(0x122)]('Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x37ca2e+_0x38594c(0xd5)+_0x30a39e);}}async function restoreDefaultTdSkillsMarketplace(_0x2324e5){const _0x495f4d=a11_0x33970b;try{await removeMarketplace(_0x495f4d(0x92),_0x2324e5),await executeClaudeCommand([_0x495f4d(0xdc),_0x495f4d(0xbc),'add',DEFAULT_TD_SKILLS_URL],undefined,_0x2324e5),_0x2324e5?.[_0x495f4d(0x77)](_0x495f4d(0xe7));}catch{}}async function ensureMarketplace(_0xa14934,_0x100eed,_0x264e69,_0x2ed6c4){const _0x2a8544=a11_0x33970b;_0x264e69[_0x2a8544(0xde)]=_0x2a8544(0xc0)+_0xa14934+'\x27...',await executeClaudeCommand(['plugin',_0x2a8544(0xbc),_0x2a8544(0xc5),_0x100eed],'Failed\x20to\x20configure\x20marketplace\x20\x27'+_0xa14934+'\x27',_0x2ed6c4),_0x264e69[_0x2a8544(0xde)]=_0x2a8544(0x106)+_0xa14934+'\x27\x20configured';}async function updateMarketplace(_0x36809d,_0x1eab20,_0x326d78){const _0x1af06d=a11_0x33970b;_0x1eab20[_0x1af06d(0xde)]=_0x1af06d(0x97)+_0x36809d+_0x1af06d(0xa3),await executeClaudeCommand(['plugin',_0x1af06d(0xbc),_0x1af06d(0xad)],_0x1af06d(0x9d)+_0x36809d+'\x27',_0x326d78),_0x1eab20[_0x1af06d(0xde)]=_0x1af06d(0x106)+_0x36809d+_0x1af06d(0x10d);}async function ensurePlugin(_0x347ffb,_0x261a1f,_0x3547d8,_0x45ee05){const _0x2dc2d5=a11_0x33970b;_0x3547d8[_0x2dc2d5(0xde)]=_0x2dc2d5(0xc9)+_0x347ffb+'\x27...',await executeClaudeCommand([_0x2dc2d5(0xdc),'install',_0x347ffb+'@'+_0x261a1f],'Failed\x20to\x20install\x20plugin\x20\x27'+_0x347ffb+'\x27',_0x45ee05),_0x3547d8[_0x2dc2d5(0xde)]='✓\x20Plugin\x20\x27'+_0x347ffb+_0x2dc2d5(0xae);}function getClaudeConfigDir(){const _0x4b4a2e=a11_0x33970b;return process.env.CLAUDE_CONFIG_DIR||join(homedir(),_0x4b4a2e(0x116));}async function checkoutReleaseTag(_0x531336,_0x4f2119,_0xf426bf){const _0x4da74b=a11_0x33970b,_0x2c46dc=join(getClaudeConfigDir(),_0x4da74b(0xc4),_0x4da74b(0x10f),_0x4da74b(0x92));if(!existsSync(_0x2c46dc)){_0xf426bf?.[_0x4da74b(0x94)](_0x4da74b(0xf8));return;}_0x4f2119[_0x4da74b(0xde)]=_0x4da74b(0xa4)+_0x531336+_0x4da74b(0x11d),await execFileAsync(_0x4da74b(0xfd),[_0x4da74b(0xba),_0x4da74b(0xe0),_0x4da74b(0x78),_0x4da74b(0x8f)],{'cwd':_0x2c46dc});try{await execFileAsync(_0x4da74b(0xfd),['checkout',_0x4da74b(0xe2)],{'cwd':_0x2c46dc});}catch{await execFileAsync('git',['checkout','-b',_0x4da74b(0xe2),_0x4da74b(0x100)],{'cwd':_0x2c46dc});}await execFileAsync('git',[_0x4da74b(0xc8),_0x4da74b(0x8b),_0x531336],{'cwd':_0x2c46dc}),_0x4f2119[_0x4da74b(0xde)]=_0x4da74b(0xd8)+_0x531336,_0xf426bf?.['info'](_0x4da74b(0x103)+_0x531336);}async function createClaudeSettings(_0x19c0c4,_0x51e516,_0x5c50a2){const _0x2812ea=a11_0x33970b,_0x5c9e3c=join(process[_0x2812ea(0xbb)](),_0x2812ea(0x116)),_0x351200=join(_0x5c9e3c,_0x2812ea(0xa8)),_0x10fb6b=join(_0x5c9e3c,SETTINGS_BACKUP_FILENAME);await mkdir(_0x5c9e3c,{'recursive':!![]});const _0x29a5f1=await recoverFromStaleBackup(_0x351200,_0x10fb6b);let _0x492b6c;if(_0x29a5f1)_0x492b6c=_0x29a5f1['liveSessionOriginals'];else{let _0x2f14e5={};if(existsSync(_0x351200))try{const _0x3c588f=await readFile(_0x351200,'utf-8');_0x2f14e5=JSON['parse'](_0x3c588f);}catch{_0x2f14e5={};}const _0x11ab86=_0x2f14e5[_0x2812ea(0x93)]||{};_0x492b6c={'ANTHROPIC_BASE_URL':_0x11ab86[_0x2812ea(0x7b)],'ANTHROPIC_MODEL':_0x11ab86['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x11ab86[_0x2812ea(0x9e)],'CLAUDE_CODE_USE_BEDROCK':_0x11ab86[_0x2812ea(0x7e)],'CLAUDE_CODE_USE_VERTEX':_0x11ab86[_0x2812ea(0x8a)],'statusLine':_0x2f14e5['statusLine']};const _0x4f11eb={'createdAt':new Date()['toISOString'](),'pid':process['pid'],'originalSettings':_0x492b6c};await writeFile(_0x10fb6b,JSON['stringify'](_0x4f11eb,null,0x2)+'\x0a');}let _0x7e9d65={};if(existsSync(_0x351200))try{const _0x425a1e=await readFile(_0x351200,_0x2812ea(0xb0));_0x7e9d65=JSON['parse'](_0x425a1e);}catch{_0x7e9d65={};}const _0x213217=_0x7e9d65[_0x2812ea(0x93)]||{},_0x5073fd={..._0x7e9d65,'env':{..._0x213217,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x19c0c4,..._0x51e516&&{'ANTHROPIC_MODEL':_0x51e516},'ANTHROPIC_AUTH_TOKEN':_0x2812ea(0xfa),'CLAUDE_CODE_USE_BEDROCK':_0x2812ea(0x104),'CLAUDE_CODE_USE_VERTEX':_0x2812ea(0x104)},'statusLine':{'type':_0x2812ea(0x98),'command':_0x5c50a2?'tdx\x20--profile\x20'+_0x5c50a2+'\x20claude\x20statusline':_0x2812ea(0x10e)}};return await writeFile(_0x351200,JSON[_0x2812ea(0xf1)](_0x5073fd,null,0x2)+'\x0a'),_0x492b6c;}async function restoreClaudeSettings(_0x4425f2){const _0x1412bf=a11_0x33970b,_0x590d09=join(process[_0x1412bf(0xbb)](),_0x1412bf(0x116)),_0x1a9273=join(_0x590d09,_0x1412bf(0xa8)),_0x2172f1=join(_0x590d09,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x1a9273,_0x4425f2);try{if(existsSync(_0x2172f1)){const _0x2d5f5b=await readFile(_0x2172f1,_0x1412bf(0xb0)),_0x41d79b=JSON[_0x1412bf(0xdd)](_0x2d5f5b);_0x41d79b[_0x1412bf(0x11b)]===process[_0x1412bf(0x11b)]&&await safeUnlink(_0x2172f1);}}catch{}}export class ClaudeCommand extends BaseCommand{[a11_0x33970b(0xdb)]=a11_0x33970b(0xcd);[a11_0x33970b(0xbf)]=a11_0x33970b(0x82);['passThroughServer'];[a11_0x33970b(0x113)];[a11_0x33970b(0xd4)];['port'];async[a11_0x33970b(0x7d)](_0x50c77f){const _0xce8dc6=a11_0x33970b,{tdx:_0x6c14a3,options:_0x44e731,args:_0xd9569d}=_0x50c77f;let _0x5a9cde=![];try{const _0xc93564=_0x44e731,_0x415fea=_0xc93564['proxy']===![],_0x5ca577=_0xc93564[_0xce8dc6(0xb9)]===!![],_0x589a59=_0xc93564['resume']===!![],_0x204951=[..._0xd9569d];if(_0x5ca577)_0x204951[_0xce8dc6(0xeb)]('-c');else _0x589a59&&_0x204951[_0xce8dc6(0xeb)]('-r');const _0x1a1972=createCommandSpinner(_0xce8dc6(0xa1),{'verbose':_0x44e731[_0xce8dc6(0xbe)]});_0x1a1972[_0xce8dc6(0x10c)]();try{if(!_0x415fea){const _0xb94a51=_0x44e731[_0xce8dc6(0x84)];try{const _0x12846a=await _0x6c14a3[_0xce8dc6(0x10a)][_0xce8dc6(0xb1)]();_0x12846a['account_id']&&writeCachedAccountInfo(_0x44e731['site'],_0x12846a[_0xce8dc6(0xda)],_0xb94a51);}catch{}_0x1a1972[_0xce8dc6(0xde)]=_0xce8dc6(0x9c),this['logger']=new TDXLogger(_0x44e731[_0xce8dc6(0x110)],!![]),await this['logger']['init']();const _0x32f199=this[_0xce8dc6(0xd4)][_0xce8dc6(0x79)]();_0x1a1972[_0xce8dc6(0xde)]='✓\x20Logging\x20to\x20'+_0x32f199;const _0x4947e0=getEndpoint(_0x44e731['site'],_0xce8dc6(0x121));_0x1a1972['text']=_0xce8dc6(0xd7);let _0x1eff05;const _0x84ae1b=await getOAuthTokens(_0xb94a51);if(_0x84ae1b)_0x1eff05={'type':_0xce8dc6(0x88),'accessToken':_0x84ae1b[_0xce8dc6(0xf4)],'refreshToken':_0x84ae1b[_0xce8dc6(0xfc)],'expiresAt':_0x84ae1b[_0xce8dc6(0xed)],'consoleUrl':getConsoleUrl(_0x44e731[_0xce8dc6(0xd9)])};else{if(_0x6c14a3['context'][_0xce8dc6(0x11c)])_0x1eff05={'type':'apikey','apiKey':_0x6c14a3['context'][_0xce8dc6(0x11c)]};else throw new SDKError(ErrorCode[_0xce8dc6(0x76)],_0xce8dc6(0x123));}this[_0xce8dc6(0x7f)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x4947e0,'auth':_0x1eff05,'logger':this[_0xce8dc6(0xd4)],'site':_0x44e731[_0xce8dc6(0xd9)],'profile':_0xb94a51}),await this['passThroughServer']['start'](),this['port']=this['passThroughServer'][_0xce8dc6(0xe6)],_0x1a1972['text']=_0xce8dc6(0xd3)+this['port']+'\x20→\x20'+_0x4947e0,_0x1a1972[_0xce8dc6(0xde)]='Creating\x20.claude/settings.local.json...',this[_0xce8dc6(0x113)]=await createClaudeSettings(this['port'],undefined,_0xb94a51),_0x1a1972[_0xce8dc6(0xde)]=_0xce8dc6(0xac);}else _0x1a1972[_0xce8dc6(0xde)]=_0xce8dc6(0x118);try{_0x1a1972['text']=_0xce8dc6(0x102),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0xce8dc6(0xd4)]),_0x1a1972[_0xce8dc6(0xde)]=_0xce8dc6(0x11e);}catch(_0x5021a){_0x1a1972[_0xce8dc6(0xf2)](_0xce8dc6(0xdf));throw _0x5021a;}try{await ensureMcpServer(_0xce8dc6(0xf7),_0xce8dc6(0x91),'http',_0x1a1972,this['logger']);}catch(_0x576c21){handleInstallationError(_0x576c21,_0xce8dc6(0x109),_0x1a1972,this[_0xce8dc6(0xd4)]);}try{const _0x54e8d3=getTdSkillsRepoUrl();_0x5a9cde=_0x54e8d3!==DEFAULT_TD_SKILLS_URL;_0x5a9cde&&await removeMarketplace('td-skills',this[_0xce8dc6(0xd4)]);await ensureMarketplace(_0xce8dc6(0x92),_0x54e8d3,_0x1a1972,this[_0xce8dc6(0xd4)]),await updateMarketplace(_0xce8dc6(0x92),_0x1a1972,this[_0xce8dc6(0xd4)]),await ensurePlugin(_0xce8dc6(0xb7),_0xce8dc6(0x92),_0x1a1972,this[_0xce8dc6(0xd4)]),await ensurePlugin('workflow-skills',_0xce8dc6(0x92),_0x1a1972,this[_0xce8dc6(0xd4)]),await ensurePlugin(_0xce8dc6(0x115),_0xce8dc6(0x92),_0x1a1972,this[_0xce8dc6(0xd4)]);try{const _0x54d72d=loadReleaseChannel(),_0xcc7a94=await resolveReleaseTag(_0x54d72d,_0xce8dc6(0xbd),_0xce8dc6(0x92),_0xce8dc6(0x9b));_0xcc7a94&&await checkoutReleaseTag(_0xcc7a94,_0x1a1972,this[_0xce8dc6(0xd4)]);}catch(_0x292d4e){this[_0xce8dc6(0xd4)]?.['warn']('Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20'+_0x292d4e);}}catch(_0x33ca3d){handleInstallationError(_0x33ca3d,_0xce8dc6(0xf9),_0x1a1972,this[_0xce8dc6(0xd4)]);}_0x1a1972[_0xce8dc6(0x119)]();}catch(_0xca60b3){_0x1a1972['fail'](_0xce8dc6(0xb4));throw _0xca60b3;}const _0x171930=await findExecutable(_0xce8dc6(0xcd));if(!_0x171930)throw new SDKError(ErrorCode[_0xce8dc6(0x117)],_0xce8dc6(0xa9),undefined,{'helpText':_0xce8dc6(0xa5)});const _0x515261={...process.env};!_0x415fea&&(_0x515261['ANTHROPIC_BASE_URL']=_0xce8dc6(0x83)+this['port'],_0x515261[_0xce8dc6(0x9e)]='tdx-managed-proxy',_0x515261[_0xce8dc6(0x7e)]=_0xce8dc6(0x104),_0x515261['CLAUDE_CODE_USE_VERTEX']='false');const _0x2d6ee0=crossSpawn(_0x171930,_0x204951,{'stdio':_0xce8dc6(0xc3),'env':_0x515261}),_0x2a238a=await new Promise(_0x491516=>{const _0xcc5e0e=_0xce8dc6;_0x2d6ee0['on'](_0xcc5e0e(0x9f),_0xaa5c37=>{_0x491516(_0xaa5c37||0x0);}),_0x2d6ee0['on']('error',_0x1f6c2c=>{const _0x14942f=_0xcc5e0e;console[_0x14942f(0x105)](a11_0x497450[_0x14942f(0x7c)](_0x14942f(0xd6)+_0x1f6c2c[_0x14942f(0x80)])),_0x491516(0x1);});});_0x5a9cde&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&(await this[_0xce8dc6(0x7f)][_0xce8dc6(0x119)](),console[_0xce8dc6(0xfb)](a11_0x497450[_0xce8dc6(0x111)](_0xce8dc6(0x114))));if(this[_0xce8dc6(0xd4)]){await this[_0xce8dc6(0xd4)][_0xce8dc6(0xc6)]();const _0x10afdb=this[_0xce8dc6(0xd4)][_0xce8dc6(0x79)]();console[_0xce8dc6(0xfb)](a11_0x497450[_0xce8dc6(0x111)](_0xce8dc6(0x95)+_0x10afdb));}return this[_0xce8dc6(0x113)]&&(await restoreClaudeSettings(this[_0xce8dc6(0x113)]),console[_0xce8dc6(0xfb)](a11_0x497450[_0xce8dc6(0x111)]('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x2a238a;}catch(_0xc3a68d){_0x5a9cde&&await restoreDefaultTdSkillsMarketplace(this[_0xce8dc6(0xd4)]);this[_0xce8dc6(0x7f)]&&await this['passThroughServer'][_0xce8dc6(0x119)]();this['logger']&&await this[_0xce8dc6(0xd4)][_0xce8dc6(0xc6)]();this[_0xce8dc6(0x113)]&&await restoreClaudeSettings(this[_0xce8dc6(0x113)]);throw _0xc3a68d;}}}
1
+ const a11_0x5c3c73=a11_0x35d4;(function(_0x25afe7,_0x29f748){const _0x332faa=a11_0x35d4,_0x1b7776=_0x25afe7();while(!![]){try{const _0x475dc2=-parseInt(_0x332faa(0x122))/0x1*(-parseInt(_0x332faa(0x137))/0x2)+-parseInt(_0x332faa(0x170))/0x3+-parseInt(_0x332faa(0xf8))/0x4+parseInt(_0x332faa(0x10e))/0x5*(parseInt(_0x332faa(0xff))/0x6)+parseInt(_0x332faa(0x165))/0x7+-parseInt(_0x332faa(0x18f))/0x8+parseInt(_0x332faa(0x11d))/0x9;if(_0x475dc2===_0x29f748)break;else _0x1b7776['push'](_0x1b7776['shift']());}catch(_0x4bc447){_0x1b7776['push'](_0x1b7776['shift']());}}}(a11_0x2b63,0x1ad29));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';function a11_0x35d4(_0x306aca,_0x5b4a3c){_0x306aca=_0x306aca-0xf3;const _0x2b635a=a11_0x2b63();let _0x35d4e9=_0x2b635a[_0x306aca];return _0x35d4e9;}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_0x384c76 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';function a11_0x2b63(){const _0x184a5b=['trim','Configuring\x20MCP\x20server\x20\x27','stringify','):\x20claude\x20','profile','liveSessionOriginals','Command\x20spawn\x20error:\x20','utf-8','init','\x27...','.tdx-settings-backup.json','user','major','1392223rCmhWd','td-skills','marketplace','port','already\x20exists','Updating\x20marketplace\x20\x27','--tags','main','\x27\x20installed','unshift','kill','468663hFRsNv','includes','minor','\x20is\x20too\x20old\x20(minimum:\x20','Initializing...','\x27:\x20','\x27\x20configured','site','error','stdout','marketplaces','statusLine','Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup','reset','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','Configuring\x20marketplace\x20\x27','proxy','ANTHROPIC_AUTH_TOKEN','install','access_token','Command\x20failed\x20(exit\x20','treasure-data','https://docs.treasuredata.com/mcp','CLAUDE_CODE_USE_BEDROCK','✓\x20Plugin\x20\x27','http','mcp','Claude\x20Code\x20CLI\x20not\x20found','message','debug','info','841464pFrRQV','description','toISOString','claude','CLAUDE_CODE_USE_VERTEX','toString','\x20or\x20later.','list','origin/main','\x20configuration\x20failed','join','Failed\x20to\x20launch\x20Claude\x20Code:\x20','✓\x20Logging\x20to\x20','resume','.claude','Failed\x20to\x20update\x20marketplace\x20\x27','remove','Marketplace\x20\x27','originalSettings','ANTHROPIC_BASE_URL','571404dsygGj','tdx-cli','http://127.0.0.1:','add','\x27\x20updated','✓\x20Settings\x20restored:\x20.claude/settings.local.json','plugin','25404SYxBut','verbose','red','log','tdx\x20--profile\x20','passThroughServer','refresh_token','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','continue','ANTHROPIC_MODEL','parse','Warning:\x20Failed\x20to\x20configure\x20','Failed\x20to\x20install\x20plugin\x20\x27','llm-proxy','\x20already\x20configured','30RyPuCP','oauth','Setup\x20failed','fail','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','td-skills\x20checked\x20out\x20at\x20tag\x20','Failed\x20to\x20remove\x20marketplace\x20\x27','expires_at','start','workflow-skills','logLevel','\x27\x20removed','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20','logger','1237563eLavaK','Invalid\x20minimum\x20version\x20format:\x20','plugins','Checking\x20Claude\x20Code\x20version...','stop','14jxcKpi','data','Creating\x20.claude/settings.local.json...','context','tdx\x20claude\x20statusline','name','✓\x20Marketplace\x20\x27','stderr','Claude\x20Code\x20version\x20check\x20failed','Failed\x20to\x20configure\x20marketplace\x20\x27','Executing:\x20claude\x20','getLogPath','CLAUDE_CODE_NOT_FOUND','Command\x20output:\x20','match','\x20claude\x20statusline','settings.local.json','Restored\x20default\x20td-skills\x20marketplace','execute','✓\x20MCP\x20server\x20\x27','tdx-managed-proxy','21760RWsLUS','account_id','pid','env','green','false','git','Claude\x20Code\x20version\x20','command','✓\x20td-skills\x20checked\x20out\x20at\x20','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','apikey','checkout','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','Installing\x20plugin\x20\x27','exit','text','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','apiKey','✓\x20Claude\x20Code\x20version\x20OK','INTERNAL','cause','pipe','cwd','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Failed\x20to\x20spawn\x20claude\x20command:\x20','close','patch','CLAUDE_CODE_UNSUPPORTED_VERSION','warn','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','origin','Starting\x20TD\x20LLM\x20pass-through\x20proxy...'];a11_0x2b63=function(){return _0x184a5b;};return a11_0x2b63();}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='2.0.20',SETTINGS_BACKUP_FILENAME=a11_0x5c3c73(0x162);function isProcessRunning(_0xb67aab){const _0x263431=a11_0x5c3c73;try{return process[_0x263431(0x16f)](_0xb67aab,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x3580b2,_0x4f0421){const _0x324e20=a11_0x5c3c73;if(!existsSync(_0x3580b2))return;try{const _0x461397=await readFile(_0x3580b2,_0x324e20(0x15f)),_0x2bce19=JSON[_0x324e20(0x109)](_0x461397),_0x3c6125=_0x2bce19[_0x324e20(0x13a)]||{};for(const _0x56b96c of['ANTHROPIC_BASE_URL','ANTHROPIC_MODEL','ANTHROPIC_AUTH_TOKEN','CLAUDE_CODE_USE_BEDROCK',_0x324e20(0x193)]){_0x4f0421[_0x56b96c]!==undefined?_0x3c6125[_0x56b96c]=_0x4f0421[_0x56b96c]:delete _0x3c6125[_0x56b96c];}_0x4f0421['statusLine']!==undefined?_0x2bce19[_0x324e20(0x17b)]=_0x4f0421[_0x324e20(0x17b)]:delete _0x2bce19[_0x324e20(0x17b)],_0x2bce19['env']=_0x3c6125,await writeFile(_0x3580b2,JSON[_0x324e20(0x15a)](_0x2bce19,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x41e903){try{await unlink(_0x41e903);}catch{}}async function recoverFromStaleBackup(_0x46c4a9,_0xd6d1a6){const _0x4655f2=a11_0x5c3c73;if(!existsSync(_0xd6d1a6))return undefined;try{const _0xfe308d=await readFile(_0xd6d1a6,_0x4655f2(0x15f)),_0x52784a=JSON['parse'](_0xfe308d);if(isProcessRunning(_0x52784a[_0x4655f2(0x139)]))return{'liveSessionOriginals':_0x52784a['originalSettings']};return await applyOriginalSettings(_0x46c4a9,_0x52784a[_0x4655f2(0xf6)]),await safeUnlink(_0xd6d1a6),undefined;}catch{return await safeUnlink(_0xd6d1a6),undefined;}}function handleInstallationError(_0xdd7703,_0x952b87,_0x1bd23e,_0x2e9401){const _0x3b457d=a11_0x5c3c73;errorContains(_0xdd7703,_0x3b457d(0x169),'already\x20installed','already\x20configured')?(_0x1bd23e[_0x3b457d(0x147)]='✓\x20'+_0x952b87+'\x20already\x20configured',_0x2e9401?.[_0x3b457d(0x18e)](_0x952b87+_0x3b457d(0x10d)),_0xdd7703 instanceof SDKError&&_0xdd7703['cause']&&_0x2e9401?.[_0x3b457d(0x18d)](_0x3b457d(0x12f)+_0xdd7703[_0x3b457d(0x14c)][_0x3b457d(0x18c)])):(_0x1bd23e[_0x3b457d(0x154)](_0x3b457d(0x10a)+_0x952b87),_0x2e9401?.[_0x3b457d(0x178)](_0x952b87+_0x3b457d(0x198),_0xdd7703));}export function parseVersion(_0x316d8e){const _0x8407ce=a11_0x5c3c73,_0x40cc32=_0x316d8e[_0x8407ce(0x158)]()[_0x8407ce(0x130)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x40cc32)return null;return{'major':parseInt(_0x40cc32[0x1],0xa),'minor':parseInt(_0x40cc32[0x2],0xa),'patch':parseInt(_0x40cc32[0x3],0xa)};}export function compareVersions(_0x4b353a,_0x5e29a0){const _0x471d6f=a11_0x5c3c73;if(_0x4b353a[_0x471d6f(0x164)]!==_0x5e29a0[_0x471d6f(0x164)])return _0x4b353a[_0x471d6f(0x164)]-_0x5e29a0[_0x471d6f(0x164)];if(_0x4b353a['minor']!==_0x5e29a0[_0x471d6f(0x172)])return _0x4b353a[_0x471d6f(0x172)]-_0x5e29a0[_0x471d6f(0x172)];return _0x4b353a['patch']-_0x5e29a0[_0x471d6f(0x152)];}async function checkClaudeVersion(_0x5929e4,_0x37d6ed){const _0x5ca930=a11_0x5c3c73;_0x37d6ed?.[_0x5ca930(0x18d)]('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x5929e4+')');const _0x4573ae=await executeClaudeCommand(['--version'],undefined,_0x37d6ed),_0x2b29fa=parseVersion(_0x4573ae);if(!_0x2b29fa){_0x37d6ed?.['warn'](_0x5ca930(0x17e)+_0x4573ae);return;}const _0x109b68=_0x2b29fa[_0x5ca930(0x164)]+'.'+_0x2b29fa[_0x5ca930(0x172)]+'.'+_0x2b29fa[_0x5ca930(0x152)],_0x3db831=parseVersion(_0x5929e4);if(!_0x3db831){_0x37d6ed?.[_0x5ca930(0x154)](_0x5ca930(0x11e)+_0x5929e4);return;}if(compareVersions(_0x2b29fa,_0x3db831)<0x0){_0x37d6ed?.[_0x5ca930(0x178)](_0x5ca930(0x13e)+_0x109b68+_0x5ca930(0x173)+_0x5929e4+')');throw new SDKError(ErrorCode[_0x5ca930(0x153)],_0x5ca930(0x13e)+_0x109b68+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x5929e4+_0x5ca930(0x195),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x37d6ed?.[_0x5ca930(0x18d)]('Claude\x20Code\x20version\x20'+_0x109b68+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0xf65ec3,_0x3461f7,_0x20000e){const _0x5c0368=a11_0x5c3c73;return _0x20000e?.[_0x5c0368(0x18e)](_0x5c0368(0x12c)+_0xf65ec3[_0x5c0368(0x199)]('\x20')),new Promise((_0x5b905c,_0x2ee53b)=>{const _0xc3430=_0x5c0368,_0x21c770=crossSpawn(_0xc3430(0x192),_0xf65ec3,{'stdio':_0xc3430(0x14d)});let _0x4afc21='',_0xbd0cd9='';_0x21c770[_0xc3430(0x179)]?.['on'](_0xc3430(0x123),_0x1528fe=>{const _0x50e87c=_0xc3430;_0x4afc21+=_0x1528fe[_0x50e87c(0x194)]();}),_0x21c770[_0xc3430(0x129)]?.['on']('data',_0x581d06=>{const _0x134f89=_0xc3430;_0xbd0cd9+=_0x581d06[_0x134f89(0x194)]();}),_0x21c770['on']('error',_0x29ae0d=>{const _0xfe4f51=_0xc3430;_0x29ae0d['code']==='ENOENT'?(_0x20000e?.['error']('Claude\x20Code\x20CLI\x20not\x20found'),_0x2ee53b(new SDKError(ErrorCode[_0xfe4f51(0x12e)],_0xfe4f51(0x18b),_0x29ae0d,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x20000e?.[_0xfe4f51(0x178)](_0xfe4f51(0x15e)+_0x29ae0d['message']),_0x2ee53b(new SDKError(ErrorCode[_0xfe4f51(0x14b)],_0xfe4f51(0x150)+_0x29ae0d[_0xfe4f51(0x18c)],_0x29ae0d)));}),_0x21c770['on'](_0xc3430(0x146),_0x486d37=>{const _0x131df0=_0xc3430;if(_0x486d37===0x0)_0x5b905c(_0x4afc21);else _0x3461f7?(_0x20000e?.[_0x131df0(0x178)](_0x131df0(0x184)+_0x486d37+_0x131df0(0x15b)+_0xf65ec3['join']('\x20')),_0x2ee53b(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x3461f7,new Error(_0xbd0cd9)))):_0x5b905c('');});});}async function ensureMcpServer(_0x1e99be,_0x18680b,_0x5d1109,_0x1080ce,_0x4b55f){const _0x2b68a6=a11_0x5c3c73;_0x1080ce[_0x2b68a6(0x147)]=_0x2b68a6(0x159)+_0x1e99be+_0x2b68a6(0x161),await executeClaudeCommand([_0x2b68a6(0x18a),_0x2b68a6(0xfb),_0x1e99be,_0x18680b,'--transport',_0x5d1109],_0x2b68a6(0x144)+_0x1e99be+'\x27',_0x4b55f),_0x1080ce[_0x2b68a6(0x147)]=_0x2b68a6(0x135)+_0x1e99be+_0x2b68a6(0x176);}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x5173ab=process.env.TDX_TD_SKILLS_REPO;if(_0x5173ab)return _0x5173ab;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x2c33d6,_0x330be4){const _0x4bbe81=a11_0x5c3c73;try{const _0x20728e=await executeClaudeCommand([_0x4bbe81(0xfe),'marketplace',_0x4bbe81(0x196)],'Failed\x20to\x20list\x20marketplaces',_0x330be4);if(!_0x20728e[_0x4bbe81(0x171)](_0x2c33d6)){_0x330be4?.[_0x4bbe81(0x18d)](_0x4bbe81(0xf5)+_0x2c33d6+_0x4bbe81(0x155));return;}await executeClaudeCommand(['plugin',_0x4bbe81(0x167),_0x4bbe81(0xf4),_0x2c33d6],_0x4bbe81(0x114)+_0x2c33d6+'\x27',_0x330be4),_0x330be4?.['info'](_0x4bbe81(0xf5)+_0x2c33d6+_0x4bbe81(0x119));}catch(_0x339f1){_0x330be4?.[_0x4bbe81(0x154)]('Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x2c33d6+_0x4bbe81(0x175)+_0x339f1);}}async function restoreDefaultTdSkillsMarketplace(_0x4b384a){const _0x22f50b=a11_0x5c3c73;try{await removeMarketplace('td-skills',_0x4b384a),await executeClaudeCommand([_0x22f50b(0xfe),_0x22f50b(0x167),'add',DEFAULT_TD_SKILLS_URL],undefined,_0x4b384a),_0x4b384a?.[_0x22f50b(0x18e)](_0x22f50b(0x133));}catch{}}async function ensureMarketplace(_0x29c23c,_0x4f2c19,_0x530acd,_0x2d00da){const _0x3d6669=a11_0x5c3c73;_0x530acd[_0x3d6669(0x147)]=_0x3d6669(0x17f)+_0x29c23c+'\x27...',await executeClaudeCommand([_0x3d6669(0xfe),'marketplace',_0x3d6669(0xfb),_0x4f2c19],_0x3d6669(0x12b)+_0x29c23c+'\x27',_0x2d00da),_0x530acd[_0x3d6669(0x147)]=_0x3d6669(0x128)+_0x29c23c+'\x27\x20configured';}async function updateMarketplace(_0x4c4608,_0xf1e40b,_0x3e2711){const _0x4ffb54=a11_0x5c3c73;_0xf1e40b[_0x4ffb54(0x147)]=_0x4ffb54(0x16a)+_0x4c4608+'\x27...',await executeClaudeCommand([_0x4ffb54(0xfe),_0x4ffb54(0x167),'update'],_0x4ffb54(0xf3)+_0x4c4608+'\x27',_0x3e2711),_0xf1e40b[_0x4ffb54(0x147)]=_0x4ffb54(0x128)+_0x4c4608+_0x4ffb54(0xfc);}async function ensurePlugin(_0x594b78,_0x2bed00,_0x2de343,_0x264c7a){const _0x5ca60f=a11_0x5c3c73;_0x2de343[_0x5ca60f(0x147)]=_0x5ca60f(0x145)+_0x594b78+'\x27...',await executeClaudeCommand([_0x5ca60f(0xfe),_0x5ca60f(0x182),_0x594b78+'@'+_0x2bed00],_0x5ca60f(0x10b)+_0x594b78+'\x27',_0x264c7a),_0x2de343[_0x5ca60f(0x147)]=_0x5ca60f(0x188)+_0x594b78+_0x5ca60f(0x16d);}function getClaudeConfigDir(){return process.env.CLAUDE_CONFIG_DIR||join(homedir(),'.claude');}async function checkoutReleaseTag(_0x17871e,_0x50bf92,_0x195ebc){const _0x13b19f=a11_0x5c3c73,_0x7ece06=join(getClaudeConfigDir(),_0x13b19f(0x11f),_0x13b19f(0x17a),'td-skills');if(!existsSync(_0x7ece06)){_0x195ebc?.['debug']('td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout');return;}_0x50bf92[_0x13b19f(0x147)]='Checking\x20out\x20td-skills\x20'+_0x17871e+'...',await execFileAsync(_0x13b19f(0x13d),['fetch',_0x13b19f(0x156),_0x13b19f(0x16b),'--force'],{'cwd':_0x7ece06});try{await execFileAsync(_0x13b19f(0x13d),['checkout',_0x13b19f(0x16c)],{'cwd':_0x7ece06});}catch{await execFileAsync(_0x13b19f(0x13d),[_0x13b19f(0x143),'-b',_0x13b19f(0x16c),_0x13b19f(0x197)],{'cwd':_0x7ece06});}await execFileAsync(_0x13b19f(0x13d),[_0x13b19f(0x17d),'--hard',_0x17871e],{'cwd':_0x7ece06}),_0x50bf92['text']=_0x13b19f(0x140)+_0x17871e,_0x195ebc?.['info'](_0x13b19f(0x113)+_0x17871e);}async function createClaudeSettings(_0x542f56,_0x19359c,_0x207c69){const _0xf68f46=a11_0x5c3c73,_0xa16132=join(process[_0xf68f46(0x14e)](),_0xf68f46(0x19d)),_0x16222a=join(_0xa16132,_0xf68f46(0x132)),_0x5dd093=join(_0xa16132,SETTINGS_BACKUP_FILENAME);await mkdir(_0xa16132,{'recursive':!![]});const _0x5bb0b3=await recoverFromStaleBackup(_0x16222a,_0x5dd093);let _0x36dcc8;if(_0x5bb0b3)_0x36dcc8=_0x5bb0b3[_0xf68f46(0x15d)];else{let _0x5c2aac={};if(existsSync(_0x16222a))try{const _0x2a665c=await readFile(_0x16222a,_0xf68f46(0x15f));_0x5c2aac=JSON[_0xf68f46(0x109)](_0x2a665c);}catch{_0x5c2aac={};}const _0x438b81=_0x5c2aac[_0xf68f46(0x13a)]||{};_0x36dcc8={'ANTHROPIC_BASE_URL':_0x438b81[_0xf68f46(0xf7)],'ANTHROPIC_MODEL':_0x438b81[_0xf68f46(0x108)],'ANTHROPIC_AUTH_TOKEN':_0x438b81[_0xf68f46(0x181)],'CLAUDE_CODE_USE_BEDROCK':_0x438b81[_0xf68f46(0x187)],'CLAUDE_CODE_USE_VERTEX':_0x438b81[_0xf68f46(0x193)],'statusLine':_0x5c2aac['statusLine']};const _0x18f82f={'createdAt':new Date()[_0xf68f46(0x191)](),'pid':process[_0xf68f46(0x139)],'originalSettings':_0x36dcc8};await writeFile(_0x5dd093,JSON[_0xf68f46(0x15a)](_0x18f82f,null,0x2)+'\x0a');}let _0x38637e={};if(existsSync(_0x16222a))try{const _0x156452=await readFile(_0x16222a,_0xf68f46(0x15f));_0x38637e=JSON[_0xf68f46(0x109)](_0x156452);}catch{_0x38637e={};}const _0x4ebdf9=_0x38637e[_0xf68f46(0x13a)]||{},_0x36de32={..._0x38637e,'env':{..._0x4ebdf9,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x542f56,..._0x19359c&&{'ANTHROPIC_MODEL':_0x19359c},'ANTHROPIC_AUTH_TOKEN':_0xf68f46(0x136),'CLAUDE_CODE_USE_BEDROCK':_0xf68f46(0x13c),'CLAUDE_CODE_USE_VERTEX':_0xf68f46(0x13c)},'statusLine':{'type':_0xf68f46(0x13f),'command':_0x207c69?_0xf68f46(0x103)+_0x207c69+_0xf68f46(0x131):_0xf68f46(0x126)}};return await writeFile(_0x16222a,JSON[_0xf68f46(0x15a)](_0x36de32,null,0x2)+'\x0a'),_0x36dcc8;}async function restoreClaudeSettings(_0x109033){const _0x4d4380=a11_0x5c3c73,_0x59c7b5=join(process['cwd'](),_0x4d4380(0x19d)),_0x5b116b=join(_0x59c7b5,'settings.local.json'),_0x3012b7=join(_0x59c7b5,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x5b116b,_0x109033);try{if(existsSync(_0x3012b7)){const _0x46c150=await readFile(_0x3012b7,_0x4d4380(0x15f)),_0xe1891e=JSON[_0x4d4380(0x109)](_0x46c150);_0xe1891e[_0x4d4380(0x139)]===process[_0x4d4380(0x139)]&&await safeUnlink(_0x3012b7);}}catch{}}export class ClaudeCommand extends BaseCommand{[a11_0x5c3c73(0x127)]=a11_0x5c3c73(0x192);[a11_0x5c3c73(0x190)]=a11_0x5c3c73(0x11a);[a11_0x5c3c73(0x104)];[a11_0x5c3c73(0xf6)];['logger'];[a11_0x5c3c73(0x168)];async[a11_0x5c3c73(0x134)](_0x8ee131){const _0x4dc268=a11_0x5c3c73,{tdx:_0x3490be,options:_0x33d4b6,args:_0x112d1a}=_0x8ee131;let _0x33702f=![];try{const _0x2d0c07=_0x33d4b6,_0x4278b8=_0x2d0c07[_0x4dc268(0x180)]===![],_0x3dfc0c=_0x2d0c07[_0x4dc268(0x107)]===!![],_0xba59ea=_0x2d0c07[_0x4dc268(0x19c)]===!![],_0x101967=[..._0x112d1a];if(_0x3dfc0c)_0x101967[_0x4dc268(0x16e)]('-c');else _0xba59ea&&_0x101967[_0x4dc268(0x16e)]('-r');const _0x3f37ff=createCommandSpinner(_0x4dc268(0x174),{'verbose':_0x33d4b6[_0x4dc268(0x100)]});_0x3f37ff[_0x4dc268(0x116)]();try{if(!_0x4278b8){const _0x2f393e=_0x33d4b6[_0x4dc268(0x15c)];try{const _0x4de29b=await _0x3490be[_0x4dc268(0x163)]['getCurrent']();_0x4de29b['account_id']&&writeCachedAccountInfo(_0x33d4b6[_0x4dc268(0x177)],_0x4de29b[_0x4dc268(0x138)],_0x2f393e);}catch{}_0x3f37ff[_0x4dc268(0x147)]='Initializing\x20proxy\x20logger...',this[_0x4dc268(0x11c)]=new TDXLogger(_0x33d4b6[_0x4dc268(0x118)],!![]),await this[_0x4dc268(0x11c)][_0x4dc268(0x160)]();const _0xad111f=this['logger'][_0x4dc268(0x12d)]();_0x3f37ff['text']=_0x4dc268(0x19b)+_0xad111f;const _0x5d88e1=getEndpoint(_0x33d4b6['site'],_0x4dc268(0x10c));_0x3f37ff['text']=_0x4dc268(0x157);let _0x1af70d;const _0x1c8959=await getOAuthTokens(_0x2f393e);if(_0x1c8959)_0x1af70d={'type':_0x4dc268(0x10f),'accessToken':_0x1c8959[_0x4dc268(0x183)],'refreshToken':_0x1c8959[_0x4dc268(0x105)],'expiresAt':_0x1c8959[_0x4dc268(0x115)],'consoleUrl':getConsoleUrl(_0x33d4b6['site'])};else{if(_0x3490be[_0x4dc268(0x125)][_0x4dc268(0x149)])_0x1af70d={'type':_0x4dc268(0x142),'apiKey':_0x3490be[_0x4dc268(0x125)][_0x4dc268(0x149)]};else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4dc268(0x17c));}this[_0x4dc268(0x104)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x5d88e1,'auth':_0x1af70d,'logger':this[_0x4dc268(0x11c)],'site':_0x33d4b6[_0x4dc268(0x177)],'profile':_0x2f393e}),await this[_0x4dc268(0x104)][_0x4dc268(0x116)](),this['port']=this[_0x4dc268(0x104)][_0x4dc268(0x168)],_0x3f37ff[_0x4dc268(0x147)]=_0x4dc268(0x106)+this[_0x4dc268(0x168)]+'\x20→\x20'+_0x5d88e1,_0x3f37ff['text']=_0x4dc268(0x124),this['originalSettings']=await createClaudeSettings(this['port'],undefined,_0x2f393e),_0x3f37ff[_0x4dc268(0x147)]=_0x4dc268(0x14f);}else _0x3f37ff[_0x4dc268(0x147)]=_0x4dc268(0x112);try{_0x3f37ff[_0x4dc268(0x147)]=_0x4dc268(0x120),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x4dc268(0x11c)]),_0x3f37ff[_0x4dc268(0x147)]=_0x4dc268(0x14a);}catch(_0x5a2b0c){_0x3f37ff[_0x4dc268(0x111)](_0x4dc268(0x12a));throw _0x5a2b0c;}try{await ensureMcpServer('td-docs',_0x4dc268(0x186),_0x4dc268(0x189),_0x3f37ff,this[_0x4dc268(0x11c)]);}catch(_0xce22e){handleInstallationError(_0xce22e,'TD\x20Docs\x20MCP\x20Server',_0x3f37ff,this[_0x4dc268(0x11c)]);}try{const _0x141346=getTdSkillsRepoUrl();_0x33702f=_0x141346!==DEFAULT_TD_SKILLS_URL;_0x33702f&&await removeMarketplace(_0x4dc268(0x166),this[_0x4dc268(0x11c)]);await ensureMarketplace(_0x4dc268(0x166),_0x141346,_0x3f37ff,this[_0x4dc268(0x11c)]),await updateMarketplace(_0x4dc268(0x166),_0x3f37ff,this[_0x4dc268(0x11c)]),await ensurePlugin('sql-skills','td-skills',_0x3f37ff,this[_0x4dc268(0x11c)]),await ensurePlugin(_0x4dc268(0x117),_0x4dc268(0x166),_0x3f37ff,this[_0x4dc268(0x11c)]),await ensurePlugin('tdx-skills',_0x4dc268(0x166),_0x3f37ff,this[_0x4dc268(0x11c)]);try{const _0x5e874f=loadReleaseChannel(),_0x450901=await resolveReleaseTag(_0x5e874f,_0x4dc268(0x185),_0x4dc268(0x166),_0x4dc268(0xf9));_0x450901&&await checkoutReleaseTag(_0x450901,_0x3f37ff,this[_0x4dc268(0x11c)]);}catch(_0x22e0da){this['logger']?.[_0x4dc268(0x154)](_0x4dc268(0x11b)+_0x22e0da);}}catch(_0x198c9d){handleInstallationError(_0x198c9d,'td-skills\x20Plugins',_0x3f37ff,this['logger']);}_0x3f37ff[_0x4dc268(0x121)]();}catch(_0x13fdd8){_0x3f37ff[_0x4dc268(0x111)](_0x4dc268(0x110));throw _0x13fdd8;}const _0x6c1686=await findExecutable('claude');if(!_0x6c1686)throw new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x4dc268(0x18b),undefined,{'helpText':_0x4dc268(0x141)});const _0x12d67f={...process.env};!_0x4278b8&&(_0x12d67f[_0x4dc268(0xf7)]=_0x4dc268(0xfa)+this[_0x4dc268(0x168)],_0x12d67f['ANTHROPIC_AUTH_TOKEN']=_0x4dc268(0x136),_0x12d67f['CLAUDE_CODE_USE_BEDROCK']='false',_0x12d67f[_0x4dc268(0x193)]=_0x4dc268(0x13c));const _0x6ec0d2=crossSpawn(_0x6c1686,_0x101967,{'stdio':'inherit','env':_0x12d67f}),_0x497703=await new Promise(_0x52ea65=>{const _0x50fea2=_0x4dc268;_0x6ec0d2['on'](_0x50fea2(0x146),_0x102db5=>{_0x52ea65(_0x102db5||0x0);}),_0x6ec0d2['on'](_0x50fea2(0x178),_0x565657=>{const _0x2ef065=_0x50fea2;console['error'](a11_0x384c76[_0x2ef065(0x101)](_0x2ef065(0x19a)+_0x565657[_0x2ef065(0x18c)])),_0x52ea65(0x1);});});_0x33702f&&await restoreDefaultTdSkillsMarketplace(this[_0x4dc268(0x11c)]);this['passThroughServer']&&(await this[_0x4dc268(0x104)][_0x4dc268(0x121)](),console[_0x4dc268(0x102)](a11_0x384c76[_0x4dc268(0x13b)](_0x4dc268(0x148))));if(this[_0x4dc268(0x11c)]){await this[_0x4dc268(0x11c)][_0x4dc268(0x151)]();const _0x113ec7=this[_0x4dc268(0x11c)]['getLogPath']();console['log'](a11_0x384c76[_0x4dc268(0x13b)]('✓\x20Logs\x20saved\x20to\x20'+_0x113ec7));}return this[_0x4dc268(0xf6)]&&(await restoreClaudeSettings(this[_0x4dc268(0xf6)]),console[_0x4dc268(0x102)](a11_0x384c76[_0x4dc268(0x13b)](_0x4dc268(0xfd)))),_0x497703;}catch(_0xab0292){_0x33702f&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0x4dc268(0x104)]&&await this[_0x4dc268(0x104)][_0x4dc268(0x121)]();this[_0x4dc268(0x11c)]&&await this[_0x4dc268(0x11c)]['close']();this[_0x4dc268(0xf6)]&&await restoreClaudeSettings(this['originalSettings']);throw _0xab0292;}}}
@@ -1 +1 @@
1
- const a12_0x216d1f=a12_0x490f;(function(_0x4cb40b,_0x34d48c){const _0x4560ce=a12_0x490f,_0x2b0d07=_0x4cb40b();while(!![]){try{const _0x2d4d87=parseInt(_0x4560ce(0x118))/0x1+parseInt(_0x4560ce(0xfd))/0x2*(parseInt(_0x4560ce(0xfa))/0x3)+-parseInt(_0x4560ce(0xfb))/0x4+parseInt(_0x4560ce(0x115))/0x5*(parseInt(_0x4560ce(0xf7))/0x6)+-parseInt(_0x4560ce(0x109))/0x7*(-parseInt(_0x4560ce(0xfc))/0x8)+-parseInt(_0x4560ce(0x112))/0x9*(parseInt(_0x4560ce(0x106))/0xa)+parseInt(_0x4560ce(0x10f))/0xb*(-parseInt(_0x4560ce(0x11a))/0xc);if(_0x2d4d87===_0x34d48c)break;else _0x2b0d07['push'](_0x2b0d07['shift']());}catch(_0x4d86cf){_0x2b0d07['push'](_0x2b0d07['shift']());}}}(a12_0x53a2,0x8f58c));function a12_0x490f(_0x37419b,_0x1ac3f5){_0x37419b=_0x37419b-0xf3;const _0x53a267=a12_0x53a2();let _0x490fe3=_0x53a267[_0x37419b];return _0x490fe3;}import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';function a12_0x53a2(){const _0x19cd62=['205357eKlezL','💎\x20tdx\x20-\x20Claude','612NBcgmI','close','🧠\x20','execute','name','model','options','\x20|\x20','statusline','87090YjkqyY','join','todayCredits','1986vQGCYP','1654436jgQHaZ','8sCmvfp','2360YzNsnv','monthCredits','line','context_window','toFixed','description','site','Claude','\x20today\x20/\x20','191020RaITBp','cache_read_input_tokens','sessionCredits','2412193irYdHz','accountId','round','tdx','tdx\x20','push','100067Jegihz','current_usage','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','279CVwroB','session_id','\x20-\x20','250flKFil','log','💎\x20'];a12_0x53a2=function(){return _0x19cd62;};return a12_0x53a2();}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(_0x39a32e=0x64){return new Promise(_0x10d39e=>{const _0x8eea3=a12_0x490f;let _0x5b6dae='',_0x39afcd=![];const _0x4eec73=createInterface({'input':process['stdin'],'terminal':![]}),_0x4dce81=_0x44eef8=>{const _0x51590e=a12_0x490f;if(_0x39afcd)return;_0x39afcd=!![],clearTimeout(_0x18ac20),_0x4eec73[_0x51590e(0x11b)](),_0x10d39e(_0x44eef8);},_0x18ac20=setTimeout(()=>{_0x4dce81(null);},_0x39a32e);_0x4eec73['on'](_0x8eea3(0xff),_0x1c53f8=>{_0x5b6dae+=_0x1c53f8;}),_0x4eec73['on']('close',()=>{if(_0x39afcd)return;try{const _0x112671=JSON['parse'](_0x5b6dae);_0x4dce81(_0x112671);}catch{_0x4dce81(null);}});});}function formatCredits(_0x2025ee){const _0x5bb230=a12_0x490f;return _0x2025ee[_0x5bb230(0x101)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a12_0x216d1f(0x11e)]=a12_0x216d1f(0xf6);[a12_0x216d1f(0x102)]=a12_0x216d1f(0x111);async[a12_0x216d1f(0x11d)](_0x3a565a){const _0x2093eb=a12_0x216d1f;try{const _0x3a4738=await readStdinJson();if(!_0x3a4738?.[_0x2093eb(0x113)])return console[_0x2093eb(0x116)](_0x2093eb(0x119)),0x0;const _0x1c2482=_0x3a4738[_0x2093eb(0x113)],_0x5eea59=_0x3a4738[_0x2093eb(0xf3)]?.['id']||'',_0x5b16c2=_0x3a4738['profile']||_0x3a565a[_0x2093eb(0xf4)]['profile'],_0x40b957=await getUsageStats(_0x1c2482,_0x5b16c2),_0x48d8c7=[],_0x13eac1=readCachedAccountInfo(_0x5b16c2),_0x5add0b=_0x13eac1?_0x2093eb(0x10d)+_0x13eac1[_0x2093eb(0x103)]+':'+_0x13eac1[_0x2093eb(0x10a)]:_0x2093eb(0x10c),_0x1daae3=_0x5eea59?getModelDisplayName(_0x5eea59):_0x2093eb(0x104);_0x48d8c7[_0x2093eb(0x10e)](_0x2093eb(0x117)+_0x5add0b+_0x2093eb(0x114)+_0x1daae3);const _0x4eab13=formatCredits(_0x40b957[_0x2093eb(0x108)]),_0x2c6f25=formatCredits(_0x40b957[_0x2093eb(0xf9)]),_0x88b911=formatCredits(_0x40b957[_0x2093eb(0xfe)]);_0x48d8c7[_0x2093eb(0x10e)]('🪙\x20credit:\x20'+_0x4eab13+'\x20session\x20/\x20'+_0x2c6f25+_0x2093eb(0x105)+_0x88b911+'\x20month');const _0xfcfc4a=_0x3a4738[_0x2093eb(0x100)],_0x42ec8f=_0xfcfc4a?.[_0x2093eb(0x110)];if(_0x42ec8f&&_0xfcfc4a?.['used_percentage']!=null){const _0x3532e8=_0x42ec8f['input_tokens']+_0x42ec8f['cache_creation_input_tokens']+_0x42ec8f[_0x2093eb(0x107)],_0x35ce30=formatTokenCount(_0x3532e8),_0x399d6c=Math[_0x2093eb(0x10b)](_0xfcfc4a['used_percentage']);_0x48d8c7['push'](_0x2093eb(0x11c)+_0x35ce30+'\x20('+_0x399d6c+'%)');}return console[_0x2093eb(0x116)](_0x48d8c7[_0x2093eb(0xf8)](_0x2093eb(0xf5))),0x0;}catch{return console['log'](_0x2093eb(0x119)),0x0;}}}
1
+ const a12_0xda23fa=a12_0x13f5;(function(_0x456c18,_0x19ecd1){const _0x2317a6=a12_0x13f5,_0x14388e=_0x456c18();while(!![]){try{const _0x59cb0f=-parseInt(_0x2317a6(0xe9))/0x1*(-parseInt(_0x2317a6(0xef))/0x2)+-parseInt(_0x2317a6(0xf9))/0x3+-parseInt(_0x2317a6(0xed))/0x4*(-parseInt(_0x2317a6(0x107))/0x5)+parseInt(_0x2317a6(0xf1))/0x6+-parseInt(_0x2317a6(0x100))/0x7*(parseInt(_0x2317a6(0x109))/0x8)+-parseInt(_0x2317a6(0xee))/0x9*(parseInt(_0x2317a6(0xe2))/0xa)+parseInt(_0x2317a6(0x10a))/0xb;if(_0x59cb0f===_0x19ecd1)break;else _0x14388e['push'](_0x14388e['shift']());}catch(_0x2e12a6){_0x14388e['push'](_0x14388e['shift']());}}}(a12_0x58ef,0xc54da));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';function a12_0x58ef(){const _0x3c0f67=['14526072bJBUxg','profile','description','statusline','monthCredits','8011790NiXast','\x20today\x20/\x20','tdx\x20','🪙\x20credit:\x20','cache_read_input_tokens','todayCredits','Claude','22KmIGRE','\x20-\x20','input_tokens','join','4pcHpAZ','18CvognI','131938OuRsXe','\x20session\x20/\x20','8729010wlakie','accountId','session_id','push','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','🧠\x20','\x20|\x20','💎\x20tdx\x20-\x20Claude','2358660hOYWDz','stdin','used_percentage','\x20month','current_usage','execute','log','140hxvUIb','close','parse','💎\x20','site','tdx','sessionCredits','2887835cEEqZd','round','643016jSBpNn'];a12_0x58ef=function(){return _0x3c0f67;};return a12_0x58ef();}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(_0x1dfd52=0x64){return new Promise(_0x119ff7=>{const _0x100615=a12_0x13f5;let _0x5b5fe5='',_0x1a1bce=![];const _0x308ad2=createInterface({'input':process[_0x100615(0xfa)],'terminal':![]}),_0xbde2fa=_0x23c3e2=>{const _0xab66a2=_0x100615;if(_0x1a1bce)return;_0x1a1bce=!![],clearTimeout(_0x415670),_0x308ad2[_0xab66a2(0x101)](),_0x119ff7(_0x23c3e2);},_0x415670=setTimeout(()=>{_0xbde2fa(null);},_0x1dfd52);_0x308ad2['on']('line',_0x12469d=>{_0x5b5fe5+=_0x12469d;}),_0x308ad2['on']('close',()=>{const _0x198a76=_0x100615;if(_0x1a1bce)return;try{const _0x361816=JSON[_0x198a76(0x102)](_0x5b5fe5);_0xbde2fa(_0x361816);}catch{_0xbde2fa(null);}});});}function a12_0x13f5(_0x1c8489,_0x1e6e0f){_0x1c8489=_0x1c8489-0xe2;const _0x58ef76=a12_0x58ef();let _0x13f5c2=_0x58ef76[_0x1c8489];return _0x13f5c2;}function formatCredits(_0x5f5372){return _0x5f5372['toFixed'](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a12_0xda23fa(0x10d);[a12_0xda23fa(0x10c)]=a12_0xda23fa(0xf5);async[a12_0xda23fa(0xfe)](_0x47807f){const _0x433190=a12_0xda23fa;try{const _0x27917e=await readStdinJson();if(!_0x27917e?.[_0x433190(0xf3)])return console['log'](_0x433190(0xf8)),0x0;const _0x3fb0d8=_0x27917e[_0x433190(0xf3)],_0x5e6e32=_0x27917e['model']?.['id']||'',_0x182b59=_0x27917e[_0x433190(0x10b)]||_0x47807f['options'][_0x433190(0x10b)],_0x2cbaf7=await getUsageStats(_0x3fb0d8,_0x182b59),_0x379354=[],_0x5507a2=readCachedAccountInfo(_0x182b59),_0x386f38=_0x5507a2?_0x433190(0xe4)+_0x5507a2[_0x433190(0x104)]+':'+_0x5507a2[_0x433190(0xf2)]:_0x433190(0x105),_0xf35a1e=_0x5e6e32?getModelDisplayName(_0x5e6e32):_0x433190(0xe8);_0x379354[_0x433190(0xf4)](_0x433190(0x103)+_0x386f38+_0x433190(0xea)+_0xf35a1e);const _0x57456d=formatCredits(_0x2cbaf7[_0x433190(0x106)]),_0x14baa6=formatCredits(_0x2cbaf7[_0x433190(0xe7)]),_0x4ff67d=formatCredits(_0x2cbaf7[_0x433190(0x10e)]);_0x379354[_0x433190(0xf4)](_0x433190(0xe5)+_0x57456d+_0x433190(0xf0)+_0x14baa6+_0x433190(0xe3)+_0x4ff67d+_0x433190(0xfc));const _0x563cce=_0x27917e['context_window'],_0x52c3ac=_0x563cce?.[_0x433190(0xfd)];if(_0x52c3ac&&_0x563cce?.[_0x433190(0xfb)]!=null){const _0x552aff=_0x52c3ac[_0x433190(0xeb)]+_0x52c3ac['cache_creation_input_tokens']+_0x52c3ac[_0x433190(0xe6)],_0x46b218=formatTokenCount(_0x552aff),_0x422e22=Math[_0x433190(0x108)](_0x563cce[_0x433190(0xfb)]);_0x379354[_0x433190(0xf4)](_0x433190(0xf6)+_0x46b218+'\x20('+_0x422e22+'%)');}return console[_0x433190(0xff)](_0x379354[_0x433190(0xec)](_0x433190(0xf7))),0x0;}catch{return console[_0x433190(0xff)](_0x433190(0xf8)),0x0;}}}
@@ -1 +1 @@
1
- function a13_0xd14e(){const _0xdf5191=['Profile','default','7117160SAgXVl','outputStructured','Credits','cyan','2646777HvBELh','repeat','message','format','toLocaleTimeString','2-digit','\x20\x20Month:\x20\x20\x20','entryCount','description','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','9wuouls','Usage\x20by\x20Profile','profileCount','lastUsedAt','en-US','112ccDVkJ','round','Total','todayCredits','toLocaleDateString','Error:\x20','totalCredits','length','Month','json','map','\x20\x20Today:\x20\x20\x20','(default)','Last\x20Used','short','918zsCTQW','3435544rIOpLm','en-CA','getTime','monthCredits','padEnd','toFixed','numeric','17201510lSfbPo','dim','credits','Usage\x20by\x20Source','source','6LbwQFS','Today','\x20credits','error','red','13479944YQCszF','max','bold','823347wzIQks','profile','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','padStart','log','execute','outputTable','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','Source','name','all'];a13_0xd14e=function(){return _0xdf5191;};return a13_0xd14e();}const a13_0x51c183=a13_0x5252;(function(_0x2c291b,_0x5b7a5a){const _0x179744=a13_0x5252,_0x34b554=_0x2c291b();while(!![]){try{const _0x3357de=parseInt(_0x179744(0x16b))/0x1+-parseInt(_0x179744(0x19b))/0x2+parseInt(_0x179744(0x19a))/0x3*(-parseInt(_0x179744(0x18b))/0x4)+parseInt(_0x179744(0x178))/0x5*(parseInt(_0x179744(0x163))/0x6)+parseInt(_0x179744(0x17c))/0x7+parseInt(_0x179744(0x168))/0x8*(parseInt(_0x179744(0x186))/0x9)+-parseInt(_0x179744(0x1a2))/0xa;if(_0x3357de===_0x5b7a5a)break;else _0x34b554['push'](_0x34b554['shift']());}catch(_0x2f6dc0){_0x34b554['push'](_0x34b554['shift']());}}}(a13_0xd14e,0xd2ca0));import a13_0x5f3ffc 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(_0xc6dff2){const _0x2cb2b3=a13_0x5252;return _0xc6dff2[_0x2cb2b3(0x1a0)](0x2);}function formatLastUsed(_0x5d9c61){const _0x54aa4c=a13_0x5252;if(!_0x5d9c61)return'never';const _0x3a913c=new Date(_0x5d9c61),_0x34435a=new Date(),_0x3b9318=_0x3a913c['toLocaleDateString'](_0x54aa4c(0x19c)),_0x3c198c=_0x34435a[_0x54aa4c(0x18f)]('en-CA');if(_0x3b9318===_0x3c198c)return'today\x20'+_0x3a913c[_0x54aa4c(0x180)](_0x54aa4c(0x18a),{'hour':_0x54aa4c(0x181),'minute':_0x54aa4c(0x181)});const _0x1e16c5=new Date(_0x3b9318),_0x4be040=new Date(_0x3c198c),_0x330b61=Math[_0x54aa4c(0x18c)]((_0x4be040[_0x54aa4c(0x19d)]()-_0x1e16c5['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x330b61===0x1)return'yesterday';else return _0x330b61>0x1&&_0x330b61<0x7?_0x330b61+'\x20days\x20ago':_0x3a913c[_0x54aa4c(0x18f)](_0x54aa4c(0x18a),{'month':_0x54aa4c(0x199),'day':_0x54aa4c(0x1a1)});}function a13_0x5252(_0x33ec16,_0x42ee41){_0x33ec16=_0x33ec16-0x163;const _0xd14e7e=a13_0xd14e();let _0x5252eb=_0xd14e7e[_0x33ec16];return _0x5252eb;}export class ClaudeUsageCommand extends BaseCommand{[a13_0x51c183(0x174)]='usage';[a13_0x51c183(0x184)]=a13_0x51c183(0x16d);async[a13_0x51c183(0x170)](_0x35bce0){const _0x5a09a7=a13_0x51c183,{options:_0x1acea6}=_0x35bce0,_0xe0074a=_0x1acea6[_0x5a09a7(0x17f)]==='json'||_0x1acea6[_0x5a09a7(0x17f)]==='jsonl'||_0x1acea6[_0x5a09a7(0x194)];try{const [_0x2ea623,_0x567c55,_0x419d6c]=await Promise[_0x5a09a7(0x175)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0xe0074a?await this[_0x5a09a7(0x179)](_0x2ea623,_0x567c55,_0x419d6c,_0x1acea6):this[_0x5a09a7(0x171)](_0x2ea623,_0x567c55,_0x419d6c),0x0;}catch(_0x4214e3){const _0x14e51a=_0x4214e3 instanceof Error?_0x4214e3[_0x5a09a7(0x17e)]:'Unknown\x20error';return console[_0x5a09a7(0x166)](a13_0x5f3ffc[_0x5a09a7(0x167)](_0x5a09a7(0x190)+_0x14e51a)),0x1;}}async[a13_0x51c183(0x179)](_0x1a1c99,_0x493b99,_0x1ba6de,_0x4615b5){const _0x291fdf=a13_0x51c183,_0x3fbb0d={'summary':{'todayCredits':_0x1ba6de[_0x291fdf(0x18e)],'monthCredits':_0x1ba6de[_0x291fdf(0x19e)],'totalCredits':_0x1ba6de[_0x291fdf(0x191)],'profileCount':_0x1ba6de[_0x291fdf(0x188)]},'profiles':_0x1a1c99[_0x291fdf(0x195)](_0xacbea4=>({'profile':_0xacbea4['profile'],'credits':_0xacbea4[_0x291fdf(0x1a4)],'requests':_0xacbea4[_0x291fdf(0x183)],'lastUsedAt':_0xacbea4[_0x291fdf(0x189)]})),'sources':_0x493b99[_0x291fdf(0x195)](_0x285178=>({'source':_0x285178[_0x291fdf(0x1a6)],'credits':_0x285178['credits'],'todayCredits':_0x285178[_0x291fdf(0x18e)],'monthCredits':_0x285178['monthCredits'],'requests':_0x285178['entryCount']}))};await handleSDKOutput([_0x3fbb0d],_0x4615b5);}[a13_0x51c183(0x171)](_0x1657c7,_0xa5e7e4,_0x2406ee){const _0xf92f79=a13_0x51c183;console['log'](a13_0x5f3ffc[_0xf92f79(0x16a)](_0xf92f79(0x185))),console[_0xf92f79(0x16f)](a13_0x5f3ffc[_0xf92f79(0x1a3)]('─'[_0xf92f79(0x17d)](0x32))),console[_0xf92f79(0x16f)](_0xf92f79(0x196)+a13_0x5f3ffc[_0xf92f79(0x17b)](formatCredits(_0x2406ee['todayCredits']))+'\x20credits'),console[_0xf92f79(0x16f)](_0xf92f79(0x182)+a13_0x5f3ffc[_0xf92f79(0x17b)](formatCredits(_0x2406ee[_0xf92f79(0x19e)]))+'\x20credits'),console['log']('\x20\x20Total:\x20\x20\x20'+a13_0x5f3ffc[_0xf92f79(0x17b)](formatCredits(_0x2406ee[_0xf92f79(0x191)]))+_0xf92f79(0x165)),console[_0xf92f79(0x16f)]();if(_0xa5e7e4[_0xf92f79(0x192)]>0x0){console[_0xf92f79(0x16f)](a13_0x5f3ffc[_0xf92f79(0x16a)](_0xf92f79(0x1a5))),console[_0xf92f79(0x16f)](a13_0x5f3ffc['dim']('─'[_0xf92f79(0x17d)](0x3c)));const _0x34271e=0xc,_0x5757a9=0xa,_0x5d4d25=0xa,_0x5cf1da=0xa;console[_0xf92f79(0x16f)]('\x20\x20'+_0xf92f79(0x173)[_0xf92f79(0x19f)](_0x34271e)+'\x20\x20'+_0xf92f79(0x18d)[_0xf92f79(0x16e)](_0x5757a9)+'\x20\x20'+_0xf92f79(0x164)[_0xf92f79(0x16e)](_0x5d4d25)+'\x20\x20'+_0xf92f79(0x193)[_0xf92f79(0x16e)](_0x5cf1da));for(const _0x5e5854 of _0xa5e7e4){console['log']('\x20\x20'+_0x5e5854['source'][_0xf92f79(0x19f)](_0x34271e)+'\x20\x20'+a13_0x5f3ffc[_0xf92f79(0x17b)](formatCredits(_0x5e5854[_0xf92f79(0x1a4)])[_0xf92f79(0x16e)](_0x5757a9))+'\x20\x20'+formatCredits(_0x5e5854['todayCredits'])[_0xf92f79(0x16e)](_0x5d4d25)+'\x20\x20'+formatCredits(_0x5e5854[_0xf92f79(0x19e)])[_0xf92f79(0x16e)](_0x5cf1da));}console[_0xf92f79(0x16f)]();}if(_0x1657c7['length']===0x0){console[_0xf92f79(0x16f)](a13_0x5f3ffc[_0xf92f79(0x1a3)]('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console['log'](a13_0x5f3ffc[_0xf92f79(0x1a3)](_0xf92f79(0x172)));return;}console[_0xf92f79(0x16f)](a13_0x5f3ffc[_0xf92f79(0x16a)](_0xf92f79(0x187))),console['log'](a13_0x5f3ffc[_0xf92f79(0x1a3)]('─'['repeat'](0x3c)));const _0x441da6=Math[_0xf92f79(0x169)](0xc,..._0x1657c7[_0xf92f79(0x195)](_0x3080f4=>_0x3080f4['profile']===_0xf92f79(0x177)?'(default)'[_0xf92f79(0x192)]:_0x3080f4['profile'][_0xf92f79(0x192)])),_0x3df8a2=0xa,_0xe3805b=0xa;console[_0xf92f79(0x16f)]('\x20\x20'+_0xf92f79(0x176)['padEnd'](_0x441da6)+'\x20\x20'+_0xf92f79(0x17a)[_0xf92f79(0x16e)](_0x3df8a2)+'\x20\x20'+'Requests'[_0xf92f79(0x16e)](_0xe3805b)+'\x20\x20'+_0xf92f79(0x198));for(const _0x55fa24 of _0x1657c7){const _0x3859da=_0x55fa24[_0xf92f79(0x16c)]===_0xf92f79(0x177)?_0xf92f79(0x197):_0x55fa24[_0xf92f79(0x16c)],_0x16b4dd=_0x3859da[_0xf92f79(0x19f)](_0x441da6),_0x46f719=_0x55fa24[_0xf92f79(0x16c)]===_0xf92f79(0x177)?a13_0x5f3ffc[_0xf92f79(0x1a3)](_0x16b4dd):_0x16b4dd;console['log']('\x20\x20'+_0x46f719+'\x20\x20'+a13_0x5f3ffc[_0xf92f79(0x17b)](formatCredits(_0x55fa24[_0xf92f79(0x1a4)])[_0xf92f79(0x16e)](_0x3df8a2))+'\x20\x20'+String(_0x55fa24['entryCount'])[_0xf92f79(0x16e)](_0xe3805b)+'\x20\x20'+a13_0x5f3ffc[_0xf92f79(0x1a3)](formatLastUsed(_0x55fa24['lastUsedAt'])));}console[_0xf92f79(0x16f)](),console[_0xf92f79(0x16f)](a13_0x5f3ffc[_0xf92f79(0x1a3)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console['log']();}}
1
+ const a13_0x4830ef=a13_0x2f21;(function(_0x5ee469,_0x2b0892){const _0x1aca2f=a13_0x2f21,_0x246772=_0x5ee469();while(!![]){try{const _0x357263=-parseInt(_0x1aca2f(0x1c4))/0x1*(parseInt(_0x1aca2f(0x1da))/0x2)+parseInt(_0x1aca2f(0x1dd))/0x3*(-parseInt(_0x1aca2f(0x1e5))/0x4)+-parseInt(_0x1aca2f(0x1e4))/0x5+-parseInt(_0x1aca2f(0x1ba))/0x6+-parseInt(_0x1aca2f(0x1cf))/0x7+parseInt(_0x1aca2f(0x1d9))/0x8+parseInt(_0x1aca2f(0x1ed))/0x9;if(_0x357263===_0x2b0892)break;else _0x246772['push'](_0x246772['shift']());}catch(_0x2ee9a4){_0x246772['push'](_0x246772['shift']());}}}(a13_0x4638,0x78a41));import a13_0x386fb0 from'chalk';function a13_0x2f21(_0x575e22,_0x11410f){_0x575e22=_0x575e22-0x1b5;const _0x463805=a13_0x4638();let _0x2f2180=_0x463805[_0x575e22];return _0x2f2180;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function a13_0x4638(){const _0x28320b=['all','Today','error','json','outputStructured','usage','8nlsaQs','execute','Requests','padEnd','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','default','Month','cyan','source','toLocaleTimeString','credits','1536031CXHQPq','Last\x20Used','profile','monthCredits','repeat','\x20credits','short','dim','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','Error:\x20','4080576OJapSS','81208iQVMge','map','Credits','1057971eBrjMx','en-US','getTime','jsonl','bold','Total','red','4661500llLFvO','4TBWGZm','outputTable','todayCredits','\x20\x20Today:\x20\x20\x20','\x20\x20Total:\x20\x20\x20','Source','message','format','16587747FWjTUr','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','numeric','description','log','entryCount','round','yesterday','en-CA','padStart','Profile','toFixed','Usage\x20by\x20Source','lastUsedAt','name','178728DsmOrW','2-digit','length','toLocaleDateString'];a13_0x4638=function(){return _0x28320b;};return a13_0x4638();}function formatCredits(_0x271fb1){const _0x3dcf01=a13_0x2f21;return _0x271fb1[_0x3dcf01(0x1b6)](0x2);}function formatLastUsed(_0x185dc2){const _0x3902a0=a13_0x2f21;if(!_0x185dc2)return'never';const _0x53538c=new Date(_0x185dc2),_0x39abf6=new Date(),_0x2fdfe0=_0x53538c['toLocaleDateString'](_0x3902a0(0x1f5)),_0x20bac3=_0x39abf6[_0x3902a0(0x1bd)]('en-CA');if(_0x2fdfe0===_0x20bac3)return'today\x20'+_0x53538c[_0x3902a0(0x1cd)](_0x3902a0(0x1de),{'hour':'2-digit','minute':_0x3902a0(0x1bb)});const _0xf7d717=new Date(_0x2fdfe0),_0x30d887=new Date(_0x20bac3),_0x517428=Math[_0x3902a0(0x1f3)]((_0x30d887[_0x3902a0(0x1df)]()-_0xf7d717['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x517428===0x1)return _0x3902a0(0x1f4);else return _0x517428>0x1&&_0x517428<0x7?_0x517428+'\x20days\x20ago':_0x53538c[_0x3902a0(0x1bd)](_0x3902a0(0x1de),{'month':_0x3902a0(0x1d5),'day':_0x3902a0(0x1ef)});}export class ClaudeUsageCommand extends BaseCommand{[a13_0x4830ef(0x1b9)]=a13_0x4830ef(0x1c3);[a13_0x4830ef(0x1f0)]=a13_0x4830ef(0x1c8);async[a13_0x4830ef(0x1c5)](_0x587bcf){const _0x443411=a13_0x4830ef,{options:_0x5394c0}=_0x587bcf,_0x1fd575=_0x5394c0[_0x443411(0x1ec)]===_0x443411(0x1c1)||_0x5394c0[_0x443411(0x1ec)]===_0x443411(0x1e0)||_0x5394c0[_0x443411(0x1c1)];try{const [_0x118c40,_0x38496f,_0x3bb562]=await Promise[_0x443411(0x1be)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x1fd575?await this['outputStructured'](_0x118c40,_0x38496f,_0x3bb562,_0x5394c0):this['outputTable'](_0x118c40,_0x38496f,_0x3bb562),0x0;}catch(_0x21271b){const _0x348cce=_0x21271b instanceof Error?_0x21271b[_0x443411(0x1eb)]:'Unknown\x20error';return console[_0x443411(0x1c0)](a13_0x386fb0[_0x443411(0x1e3)](_0x443411(0x1d8)+_0x348cce)),0x1;}}async[a13_0x4830ef(0x1c2)](_0x583114,_0x26b5d2,_0x42032b,_0x317de1){const _0x208bed=a13_0x4830ef,_0x485e18={'summary':{'todayCredits':_0x42032b[_0x208bed(0x1e7)],'monthCredits':_0x42032b[_0x208bed(0x1d2)],'totalCredits':_0x42032b['totalCredits'],'profileCount':_0x42032b['profileCount']},'profiles':_0x583114[_0x208bed(0x1db)](_0xb2e5d0=>({'profile':_0xb2e5d0[_0x208bed(0x1d1)],'credits':_0xb2e5d0[_0x208bed(0x1ce)],'requests':_0xb2e5d0['entryCount'],'lastUsedAt':_0xb2e5d0[_0x208bed(0x1b8)]})),'sources':_0x26b5d2['map'](_0xc8bc04=>({'source':_0xc8bc04[_0x208bed(0x1cc)],'credits':_0xc8bc04[_0x208bed(0x1ce)],'todayCredits':_0xc8bc04['todayCredits'],'monthCredits':_0xc8bc04[_0x208bed(0x1d2)],'requests':_0xc8bc04[_0x208bed(0x1f2)]}))};await handleSDKOutput([_0x485e18],_0x317de1);}[a13_0x4830ef(0x1e6)](_0x4fe0d6,_0x335ddc,_0x3a49fd){const _0x312e4f=a13_0x4830ef;console[_0x312e4f(0x1f1)](a13_0x386fb0[_0x312e4f(0x1e1)](_0x312e4f(0x1d7))),console[_0x312e4f(0x1f1)](a13_0x386fb0[_0x312e4f(0x1d6)]('─'[_0x312e4f(0x1d3)](0x32))),console['log'](_0x312e4f(0x1e8)+a13_0x386fb0[_0x312e4f(0x1cb)](formatCredits(_0x3a49fd['todayCredits']))+_0x312e4f(0x1d4)),console['log']('\x20\x20Month:\x20\x20\x20'+a13_0x386fb0[_0x312e4f(0x1cb)](formatCredits(_0x3a49fd['monthCredits']))+'\x20credits'),console['log'](_0x312e4f(0x1e9)+a13_0x386fb0[_0x312e4f(0x1cb)](formatCredits(_0x3a49fd['totalCredits']))+_0x312e4f(0x1d4)),console[_0x312e4f(0x1f1)]();if(_0x335ddc['length']>0x0){console[_0x312e4f(0x1f1)](a13_0x386fb0[_0x312e4f(0x1e1)](_0x312e4f(0x1b7))),console['log'](a13_0x386fb0['dim']('─'[_0x312e4f(0x1d3)](0x3c)));const _0x4cfbd4=0xc,_0x40b571=0xa,_0x183526=0xa,_0x5a2f9f=0xa;console[_0x312e4f(0x1f1)]('\x20\x20'+_0x312e4f(0x1ea)['padEnd'](_0x4cfbd4)+'\x20\x20'+_0x312e4f(0x1e2)[_0x312e4f(0x1f6)](_0x40b571)+'\x20\x20'+_0x312e4f(0x1bf)[_0x312e4f(0x1f6)](_0x183526)+'\x20\x20'+_0x312e4f(0x1ca)[_0x312e4f(0x1f6)](_0x5a2f9f));for(const _0x146804 of _0x335ddc){console[_0x312e4f(0x1f1)]('\x20\x20'+_0x146804[_0x312e4f(0x1cc)][_0x312e4f(0x1c7)](_0x4cfbd4)+'\x20\x20'+a13_0x386fb0[_0x312e4f(0x1cb)](formatCredits(_0x146804[_0x312e4f(0x1ce)])[_0x312e4f(0x1f6)](_0x40b571))+'\x20\x20'+formatCredits(_0x146804['todayCredits'])[_0x312e4f(0x1f6)](_0x183526)+'\x20\x20'+formatCredits(_0x146804[_0x312e4f(0x1d2)])[_0x312e4f(0x1f6)](_0x5a2f9f));}console[_0x312e4f(0x1f1)]();}if(_0x4fe0d6['length']===0x0){console[_0x312e4f(0x1f1)](a13_0x386fb0[_0x312e4f(0x1d6)](_0x312e4f(0x1ee))),console[_0x312e4f(0x1f1)](a13_0x386fb0[_0x312e4f(0x1d6)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x312e4f(0x1f1)](a13_0x386fb0[_0x312e4f(0x1e1)]('Usage\x20by\x20Profile')),console[_0x312e4f(0x1f1)](a13_0x386fb0[_0x312e4f(0x1d6)]('─'[_0x312e4f(0x1d3)](0x3c)));const _0xb09c7=Math['max'](0xc,..._0x4fe0d6[_0x312e4f(0x1db)](_0x198276=>_0x198276[_0x312e4f(0x1d1)]===_0x312e4f(0x1c9)?'(default)'[_0x312e4f(0x1bc)]:_0x198276['profile'][_0x312e4f(0x1bc)])),_0x1e2267=0xa,_0x51b5da=0xa;console['log']('\x20\x20'+_0x312e4f(0x1b5)[_0x312e4f(0x1c7)](_0xb09c7)+'\x20\x20'+_0x312e4f(0x1dc)[_0x312e4f(0x1f6)](_0x1e2267)+'\x20\x20'+_0x312e4f(0x1c6)[_0x312e4f(0x1f6)](_0x51b5da)+'\x20\x20'+_0x312e4f(0x1d0));for(const _0x45ac52 of _0x4fe0d6){const _0x3ee650=_0x45ac52[_0x312e4f(0x1d1)]===_0x312e4f(0x1c9)?'(default)':_0x45ac52[_0x312e4f(0x1d1)],_0x243d83=_0x3ee650[_0x312e4f(0x1c7)](_0xb09c7),_0x70cc5f=_0x45ac52[_0x312e4f(0x1d1)]==='default'?a13_0x386fb0[_0x312e4f(0x1d6)](_0x243d83):_0x243d83;console[_0x312e4f(0x1f1)]('\x20\x20'+_0x70cc5f+'\x20\x20'+a13_0x386fb0['cyan'](formatCredits(_0x45ac52['credits'])[_0x312e4f(0x1f6)](_0x1e2267))+'\x20\x20'+String(_0x45ac52[_0x312e4f(0x1f2)])[_0x312e4f(0x1f6)](_0x51b5da)+'\x20\x20'+a13_0x386fb0['dim'](formatLastUsed(_0x45ac52[_0x312e4f(0x1b8)])));}console[_0x312e4f(0x1f1)](),console['log'](a13_0x386fb0[_0x312e4f(0x1d6)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x312e4f(0x1f1)]();}}
@@ -1 +1 @@
1
- const a14_0x1c3f82=a14_0x151b;(function(_0x4ff9c6,_0x58724a){const _0x471f8d=a14_0x151b,_0x765518=_0x4ff9c6();while(!![]){try{const _0x3aba27=-parseInt(_0x471f8d(0x1fb))/0x1+-parseInt(_0x471f8d(0x205))/0x2*(-parseInt(_0x471f8d(0x1db))/0x3)+parseInt(_0x471f8d(0x208))/0x4*(-parseInt(_0x471f8d(0x206))/0x5)+-parseInt(_0x471f8d(0x1e3))/0x6+parseInt(_0x471f8d(0x1fd))/0x7+-parseInt(_0x471f8d(0x1d8))/0x8*(-parseInt(_0x471f8d(0x1f4))/0x9)+parseInt(_0x471f8d(0x1f3))/0xa;if(_0x3aba27===_0x58724a)break;else _0x765518['push'](_0x765518['shift']());}catch(_0x3601d8){_0x765518['push'](_0x765518['shift']());}}}(a14_0x4596,0xe44e4));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';function a14_0x151b(_0x375595,_0x520214){_0x375595=_0x375595-0x1d6;const _0x4596f2=a14_0x4596();let _0x151b8c=_0x4596f2[_0x375595];return _0x151b8c;}function a14_0x4596(){const _0x58a34b=['has','tdx\x20auth','value','dim','cyan','USER_ERROR','profile','message','red','name','yellow','Reason:\x20','1709000qAIRGm','18iqwVbD','options','validate','command','status','Authentication\x20failed','execute','499085xfyFwy','stack','6067621sVySXw','isValid','helpText','number','error','To\x20check\x20your\x20current\x20auth\x20status:','problemDetails','commands','2wPOIJx','5025535PclWIl','from','4zHzoho','\x0aStack\x20trace:\x0a','category','6863664zZjady','tdx\x20auth\x20setup','validateGlobalOptions','3587289jEqEKm','set','values','\x20--profile\x20','Authentication\x20error\x20stack\x20trace:','Invalid\x20limit\x20value:\x20','debug','get','9060300ikYnVh','test','Error:\x20','getAll'];a14_0x4596=function(){return _0x58a34b;};return a14_0x4596();}import a14_0x2d3231 from'chalk';export function printAuthError(_0x29476b,_0x2d6207=![],_0x26b539){const _0x3f1d93=a14_0x151b,_0x1c9d07=_0x29476b[_0x3f1d93(0x203)]?.['detail']||_0x29476b[_0x3f1d93(0x1ee)];console[_0x3f1d93(0x201)](a14_0x2d3231[_0x3f1d93(0x1ef)](_0x3f1d93(0x1f9))),console[_0x3f1d93(0x201)](a14_0x2d3231[_0x3f1d93(0x1ef)](_0x3f1d93(0x1f2)+_0x1c9d07));if(_0x2d6207){const _0x34dc3f=_0x26b539?_0x3f1d93(0x1de)+_0x26b539:'';console[_0x3f1d93(0x201)]('\x0a'+a14_0x2d3231[_0x3f1d93(0x1ea)]('To\x20set\x20up\x20authentication:')),console['error']('\x20\x20'+a14_0x2d3231['cyan'](_0x3f1d93(0x1d9)+_0x34dc3f)+'\x0a'),console['error'](''+a14_0x2d3231[_0x3f1d93(0x1ea)](_0x3f1d93(0x202))),console['error']('\x20\x20'+a14_0x2d3231[_0x3f1d93(0x1eb)](_0x3f1d93(0x1e8)+_0x34dc3f));}}export class BaseCommand{['validateGlobalOptions'](_0x286dc5){const _0x51e016=a14_0x151b,{options:_0x51c199}=_0x286dc5,_0x15effb=_0x51c199['limit'];if(_0x15effb!==undefined){const _0xa0d1f2=typeof _0x15effb===_0x51e016(0x200)?_0x15effb:parseInt(_0x15effb,0xa);if(isNaN(_0xa0d1f2))return _0x51e016(0x1e0)+_0x15effb+'.\x20Must\x20be\x20a\x20number.';const _0x414aff=validateLimitOption(_0xa0d1f2);if(!_0x414aff[_0x51e016(0x1fe)])return _0x414aff[_0x51e016(0x201)];_0x286dc5[_0x51e016(0x1f5)]['limit']=_0x414aff[_0x51e016(0x1e9)];}return undefined;}[a14_0x1c3f82(0x1f6)](_0x53ceb2){return undefined;}async['run'](_0x272460){const _0x21a598=a14_0x1c3f82;try{const _0xdbb94f=this[_0x21a598(0x1da)](_0x272460);if(_0xdbb94f)return console[_0x21a598(0x201)](_0x21a598(0x1e5)+_0xdbb94f),0x1;const _0x3478c9=this[_0x21a598(0x1f6)](_0x272460);if(_0x3478c9){const _0x512b12=/^\s*(Usage|Note|Warning|Error):/i[_0x21a598(0x1e4)](_0x3478c9);return _0x512b12?console['error'](_0x3478c9):console[_0x21a598(0x201)](_0x21a598(0x1e5)+_0x3478c9),0x1;}const _0x540cd6=await this[_0x21a598(0x1fa)](_0x272460);return _0x540cd6??0x0;}catch(_0x2ee4dc){if(_0x2ee4dc instanceof Error){if(_0x2ee4dc instanceof HTTPClientError&&_0x2ee4dc[_0x21a598(0x1f8)]===0x191){const _0x38eaaf=_0x272460[_0x21a598(0x1f5)][_0x21a598(0x1ed)];printAuthError(_0x2ee4dc,!![],_0x38eaaf);if(_0x2ee4dc[_0x21a598(0x1fc)]){const _0x46d724=Logger['of'](_0x21a598(0x1f7));_0x46d724[_0x21a598(0x1e1)](_0x21a598(0x1df)),_0x46d724[_0x21a598(0x1e1)](_0x2ee4dc[_0x21a598(0x1fc)]);}return 0x1;}console[_0x21a598(0x201)](a14_0x2d3231[_0x21a598(0x1ef)](_0x21a598(0x1e5)+_0x2ee4dc[_0x21a598(0x1ee)]));_0x2ee4dc instanceof SDKError&&_0x2ee4dc[_0x21a598(0x1ff)]&&console[_0x21a598(0x201)](a14_0x2d3231[_0x21a598(0x1f1)](_0x2ee4dc['helpText']));const _0x411649=_0x2ee4dc instanceof SDKError&&_0x2ee4dc[_0x21a598(0x1d7)]===ErrorCategory[_0x21a598(0x1ec)];_0x2ee4dc[_0x21a598(0x1fc)]&&!_0x411649&&console['error'](_0x21a598(0x1d6)+_0x2ee4dc[_0x21a598(0x1fc)]);}else console[_0x21a598(0x201)](_0x21a598(0x1e5)+String(_0x2ee4dc));return 0x1;}}}export class CommandRegistry{['commands']=new Map();['register'](_0xb2374a){const _0x2777fe=a14_0x1c3f82;if(this[_0x2777fe(0x204)]['has'](_0xb2374a[_0x2777fe(0x1f0)]))throw new Error('Command\x20\x27'+_0xb2374a[_0x2777fe(0x1f0)]+'\x27\x20is\x20already\x20registered');this[_0x2777fe(0x204)][_0x2777fe(0x1dc)](_0xb2374a['name'],_0xb2374a);}[a14_0x1c3f82(0x1e2)](_0xbcfeec){const _0x316d9c=a14_0x1c3f82;return this['commands'][_0x316d9c(0x1e2)](_0xbcfeec);}[a14_0x1c3f82(0x1e6)](){const _0x4db15a=a14_0x1c3f82;return Array[_0x4db15a(0x207)](this[_0x4db15a(0x204)][_0x4db15a(0x1dd)]());}[a14_0x1c3f82(0x1e7)](_0x5923db){const _0x363c24=a14_0x1c3f82;return this['commands'][_0x363c24(0x1e7)](_0x5923db);}}export const registry=new CommandRegistry();
1
+ function a14_0x151b(_0x344304,_0x1d9da1){_0x344304=_0x344304-0x1c6;const _0x2f20b7=a14_0x2f20();let _0x151be0=_0x2f20b7[_0x344304];return _0x151be0;}const a14_0x495ba6=a14_0x151b;(function(_0x2a866f,_0x1e6ff3){const _0xdb8c0d=a14_0x151b,_0x2eddcd=_0x2a866f();while(!![]){try{const _0x45c241=parseInt(_0xdb8c0d(0x1d6))/0x1+-parseInt(_0xdb8c0d(0x1cc))/0x2*(-parseInt(_0xdb8c0d(0x1d5))/0x3)+-parseInt(_0xdb8c0d(0x1f7))/0x4*(parseInt(_0xdb8c0d(0x1d0))/0x5)+parseInt(_0xdb8c0d(0x1cf))/0x6*(-parseInt(_0xdb8c0d(0x1f3))/0x7)+parseInt(_0xdb8c0d(0x1eb))/0x8+-parseInt(_0xdb8c0d(0x1ef))/0x9*(-parseInt(_0xdb8c0d(0x1f2))/0xa)+-parseInt(_0xdb8c0d(0x1e0))/0xb*(parseInt(_0xdb8c0d(0x1f5))/0xc);if(_0x45c241===_0x1e6ff3)break;else _0x2eddcd['push'](_0x2eddcd['shift']());}catch(_0x3f8495){_0x2eddcd['push'](_0x2eddcd['shift']());}}}(a14_0x2f20,0x33df8));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_0x1a4b32 from'chalk';export function printAuthError(_0x70ba93,_0x1dfbf2=![],_0x3be411){const _0x579041=a14_0x151b,_0x347a9f=_0x70ba93[_0x579041(0x1c9)]?.[_0x579041(0x1cb)]||_0x70ba93[_0x579041(0x1df)];console[_0x579041(0x1fa)](a14_0x1a4b32[_0x579041(0x1ee)](_0x579041(0x1e4))),console[_0x579041(0x1fa)](a14_0x1a4b32['red']('Reason:\x20'+_0x347a9f));if(_0x1dfbf2){const _0x50b4e2=_0x3be411?_0x579041(0x1cd)+_0x3be411:'';console['error']('\x0a'+a14_0x1a4b32[_0x579041(0x1da)](_0x579041(0x1f4))),console['error']('\x20\x20'+a14_0x1a4b32[_0x579041(0x1ec)](_0x579041(0x1e6)+_0x50b4e2)+'\x0a'),console[_0x579041(0x1fa)](''+a14_0x1a4b32[_0x579041(0x1da)](_0x579041(0x1c7))),console[_0x579041(0x1fa)]('\x20\x20'+a14_0x1a4b32[_0x579041(0x1ec)]('tdx\x20auth'+_0x50b4e2));}}function a14_0x2f20(){const _0x86bdbc=['category','commands','name','options','message','66396SUtgTW','set','getAll','status','Authentication\x20failed','number','tdx\x20auth\x20setup','Invalid\x20limit\x20value:\x20','validateGlobalOptions','register','limit','2280888YVDQUF','cyan','Authentication\x20error\x20stack\x20trace:','red','415476GOKHEh','Command\x20\x27','validate','70hnPLAD','3059NXhBlQ','To\x20set\x20up\x20authentication:','648cOwmpv','execute','30036RrZkUd','helpText','value','error','stack','To\x20check\x20your\x20current\x20auth\x20status:','isValid','problemDetails','Error:\x20','detail','107306UWWIkU','\x20--profile\x20','.\x20Must\x20be\x20a\x20number.','5322wjZptG','40gwBpTL','command','debug','values','has','3pBMvCU','324195gmxIqC','\x27\x20is\x20already\x20registered','get','yellow','dim'];a14_0x2f20=function(){return _0x86bdbc;};return a14_0x2f20();}export class BaseCommand{[a14_0x495ba6(0x1e8)](_0x170340){const _0xbe4ad7=a14_0x495ba6,{options:_0x4b2084}=_0x170340,_0x1e5637=_0x4b2084[_0xbe4ad7(0x1ea)];if(_0x1e5637!==undefined){const _0x59db23=typeof _0x1e5637===_0xbe4ad7(0x1e5)?_0x1e5637:parseInt(_0x1e5637,0xa);if(isNaN(_0x59db23))return _0xbe4ad7(0x1e7)+_0x1e5637+_0xbe4ad7(0x1ce);const _0x5b16c4=validateLimitOption(_0x59db23);if(!_0x5b16c4[_0xbe4ad7(0x1c8)])return _0x5b16c4[_0xbe4ad7(0x1fa)];_0x170340[_0xbe4ad7(0x1de)]['limit']=_0x5b16c4[_0xbe4ad7(0x1f9)];}return undefined;}['validate'](_0x38e2e1){return undefined;}async['run'](_0x107938){const _0x2a731c=a14_0x495ba6;try{const _0x5368c4=this[_0x2a731c(0x1e8)](_0x107938);if(_0x5368c4)return console['error'](_0x2a731c(0x1ca)+_0x5368c4),0x1;const _0xf9aaf0=this[_0x2a731c(0x1f1)](_0x107938);if(_0xf9aaf0){const _0x54a02f=/^\s*(Usage|Note|Warning|Error):/i['test'](_0xf9aaf0);return _0x54a02f?console[_0x2a731c(0x1fa)](_0xf9aaf0):console[_0x2a731c(0x1fa)]('Error:\x20'+_0xf9aaf0),0x1;}const _0x3caa53=await this[_0x2a731c(0x1f6)](_0x107938);return _0x3caa53??0x0;}catch(_0x1ef823){if(_0x1ef823 instanceof Error){if(_0x1ef823 instanceof HTTPClientError&&_0x1ef823[_0x2a731c(0x1e3)]===0x191){const _0x456da4=_0x107938['options']['profile'];printAuthError(_0x1ef823,!![],_0x456da4);if(_0x1ef823['stack']){const _0x42c96f=Logger['of'](_0x2a731c(0x1d1));_0x42c96f[_0x2a731c(0x1d2)](_0x2a731c(0x1ed)),_0x42c96f[_0x2a731c(0x1d2)](_0x1ef823[_0x2a731c(0x1c6)]);}return 0x1;}console[_0x2a731c(0x1fa)](a14_0x1a4b32['red'](_0x2a731c(0x1ca)+_0x1ef823[_0x2a731c(0x1df)]));_0x1ef823 instanceof SDKError&&_0x1ef823[_0x2a731c(0x1f8)]&&console[_0x2a731c(0x1fa)](a14_0x1a4b32[_0x2a731c(0x1d9)](_0x1ef823['helpText']));const _0x9f04f5=_0x1ef823 instanceof SDKError&&_0x1ef823[_0x2a731c(0x1db)]===ErrorCategory['USER_ERROR'];_0x1ef823[_0x2a731c(0x1c6)]&&!_0x9f04f5&&console[_0x2a731c(0x1fa)]('\x0aStack\x20trace:\x0a'+_0x1ef823[_0x2a731c(0x1c6)]);}else console[_0x2a731c(0x1fa)](_0x2a731c(0x1ca)+String(_0x1ef823));return 0x1;}}}export class CommandRegistry{['commands']=new Map();[a14_0x495ba6(0x1e9)](_0x590dec){const _0x177975=a14_0x495ba6;if(this[_0x177975(0x1dc)][_0x177975(0x1d4)](_0x590dec[_0x177975(0x1dd)]))throw new Error(_0x177975(0x1f0)+_0x590dec[_0x177975(0x1dd)]+_0x177975(0x1d7));this[_0x177975(0x1dc)][_0x177975(0x1e1)](_0x590dec[_0x177975(0x1dd)],_0x590dec);}[a14_0x495ba6(0x1d8)](_0x2af104){const _0x255496=a14_0x495ba6;return this[_0x255496(0x1dc)][_0x255496(0x1d8)](_0x2af104);}[a14_0x495ba6(0x1e2)](){const _0x190d7b=a14_0x495ba6;return Array['from'](this[_0x190d7b(0x1dc)][_0x190d7b(0x1d3)]());}[a14_0x495ba6(0x1d4)](_0x5480a7){const _0x287b78=a14_0x495ba6;return this[_0x287b78(0x1dc)]['has'](_0x5480a7);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a15_0x2a878e=a15_0x2859;(function(_0x2b0176,_0x226c3c){const _0x31f2f6=a15_0x2859,_0x4cf76d=_0x2b0176();while(!![]){try{const _0x42994b=parseInt(_0x31f2f6(0x1b3))/0x1*(parseInt(_0x31f2f6(0x193))/0x2)+parseInt(_0x31f2f6(0x171))/0x3*(parseInt(_0x31f2f6(0x170))/0x4)+parseInt(_0x31f2f6(0x188))/0x5*(-parseInt(_0x31f2f6(0x1b9))/0x6)+parseInt(_0x31f2f6(0x1b8))/0x7*(parseInt(_0x31f2f6(0x196))/0x8)+parseInt(_0x31f2f6(0x1a4))/0x9*(parseInt(_0x31f2f6(0x176))/0xa)+parseInt(_0x31f2f6(0x1a9))/0xb+-parseInt(_0x31f2f6(0x19f))/0xc*(parseInt(_0x31f2f6(0x16e))/0xd);if(_0x42994b===_0x226c3c)break;else _0x4cf76d['push'](_0x4cf76d['shift']());}catch(_0x5285b6){_0x4cf76d['push'](_0x4cf76d['shift']());}}}(a15_0x5ba1,0xed487));function a15_0x2859(_0xb6e3c8,_0x402a4b){_0xb6e3c8=_0xb6e3c8-0x14f;const _0x5ba1aa=a15_0x5ba1();let _0x285978=_0x5ba1aa[_0xb6e3c8];return _0x285978;}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_0x14eef9 from'chalk';function normalizeSchemaForDisplay(_0x543e94){const _0x52c5d6=a15_0x2859,_0x3406c9=_0x543e94[_0x52c5d6(0x186)]||[],_0xcaecfd=_0x3406c9[_0x52c5d6(0x19d)](_0xe9d083=>_0xe9d083['name']==='legacy_settings'&&_0xe9d083[_0x52c5d6(0x156)]===_0x52c5d6(0x163)&&_0xe9d083[_0x52c5d6(0x186)]);if(_0xcaecfd?.['properties']){const _0x58e813=_0x3406c9[_0x52c5d6(0x168)](_0xc4c4fa=>_0xc4c4fa[_0x52c5d6(0x191)]!==_0x52c5d6(0x18b)&&_0xc4c4fa[_0x52c5d6(0x191)]!==_0x52c5d6(0x166));return[..._0x58e813,..._0xcaecfd[_0x52c5d6(0x186)]];}return _0x3406c9[_0x52c5d6(0x168)](_0x56d2eb=>_0x56d2eb[_0x52c5d6(0x191)]!=='legacy');}function printSchemaFields(_0x132f12,_0x5d3699){const _0x2239cc=a15_0x2859,_0x860cdf='\x20\x20'['repeat'](_0x5d3699+0x1),_0x2c917b='\x20\x20'[_0x2239cc(0x1ab)](_0x5d3699+0x2);for(const _0x262e96 of _0x132f12){if(!_0x262e96['name'])continue;const _0x112166=_0x262e96[_0x2239cc(0x156)]===_0x2239cc(0x163)&&_0x262e96['properties']&&_0x262e96['properties'][_0x2239cc(0x164)]>0x0&&_0x262e96[_0x2239cc(0x191)]!==_0x2239cc(0x166);let _0x171405=''+_0x860cdf+a15_0x14eef9['green'](_0x262e96[_0x2239cc(0x191)]);_0x262e96[_0x2239cc(0x1ae)]&&(_0x171405+=':\x20'+_0x262e96[_0x2239cc(0x1ae)]);if(_0x262e96[_0x2239cc(0x15d)])_0x171405+=a15_0x14eef9[_0x2239cc(0x167)]('\x20['+_0x262e96['input']+']');else _0x112166&&(_0x171405+=a15_0x14eef9['dim'](_0x2239cc(0x190)));console[_0x2239cc(0x17b)](_0x171405);_0x262e96['description']&&console[_0x2239cc(0x17b)](''+_0x2c917b+a15_0x14eef9[_0x2239cc(0x167)](_0x262e96['description']));if(_0x262e96[_0x2239cc(0x15f)]){const _0x4eb552=_0x262e96[_0x2239cc(0x15f)][_0x2239cc(0x181)](_0x467216=>typeof _0x467216==='object'&&'value'in _0x467216?_0x467216[_0x2239cc(0x17c)]:_0x467216)[_0x2239cc(0x19b)](',\x20');console[_0x2239cc(0x17b)](_0x2c917b+_0x2239cc(0x161)+a15_0x14eef9[_0x2239cc(0x1b6)](_0x4eb552));}_0x262e96[_0x2239cc(0x177)]!==undefined&&console[_0x2239cc(0x17b)](_0x2c917b+'Default:\x20'+a15_0x14eef9[_0x2239cc(0x16c)](String(_0x262e96[_0x2239cc(0x177)])));if(_0x262e96[_0x2239cc(0x1a6)]!==undefined||_0x262e96[_0x2239cc(0x154)]!==undefined){const _0x569db7=_0x262e96[_0x2239cc(0x1a6)]!==undefined&&_0x262e96[_0x2239cc(0x154)]!==undefined?_0x262e96[_0x2239cc(0x1a6)]+_0x2239cc(0x15c)+_0x262e96[_0x2239cc(0x154)]:_0x262e96[_0x2239cc(0x1a6)]!==undefined?_0x2239cc(0x18a)+_0x262e96['minimum']:_0x2239cc(0x1a8)+_0x262e96[_0x2239cc(0x154)];console[_0x2239cc(0x17b)](_0x2c917b+_0x2239cc(0x160)+a15_0x14eef9[_0x2239cc(0x16c)](_0x569db7));}if(_0x262e96['criteria']){const _0x5bb670=Object[_0x2239cc(0x1a7)](_0x262e96[_0x2239cc(0x1a3)])['map'](([_0x18f067,_0x15330f])=>_0x18f067+'='+JSON[_0x2239cc(0x16d)](_0x15330f))['join'](',\x20');console[_0x2239cc(0x17b)](''+_0x2c917b+a15_0x14eef9[_0x2239cc(0x167)](_0x2239cc(0x17f)+_0x5bb670));}_0x112166&&_0x262e96['properties']&&printSchemaFields(_0x262e96[_0x2239cc(0x186)],_0x5d3699+0x1);}}export class ConnectionListCommand extends BaseCommand{['name']=a15_0x2a878e(0x18f);['description']='List\x20all\x20result\x20output\x20connections';async[a15_0x2a878e(0x158)](_0x15caca){const _0x528d14=a15_0x2a878e,{options:_0x192f55,tdx:_0x260b53}=_0x15caca;_0x192f55['verbose']&&console['error'](_0x528d14(0x1b1)+_0x192f55[_0x528d14(0x195)]);const _0x1d4137=resolveLimit(_0x192f55[_0x528d14(0x155)],DEFAULT_LISTING_LIMIT),_0x40e524=await withSpinner('Listing\x20connections...',()=>_0x260b53[_0x528d14(0x19c)][_0x528d14(0x15e)](),{'verbose':_0x192f55[_0x528d14(0x157)]}),_0x5ed648=_0x40e524[_0x528d14(0x173)];console[_0x528d14(0x1b7)]('✔\x20Found\x20'+_0x5ed648[_0x528d14(0x164)]+_0x528d14(0x199)+(_0x5ed648['length']!==0x1?'s':''));if(isStructuredFormat(_0x192f55)){const _0xc5ee8a=_0x5ed648['slice'](0x0,_0x1d4137);await handleSDKOutput(_0xc5ee8a,{..._0x192f55,'limit':_0x1d4137});}else{const _0x10d2fb=_0x5ed648[_0x528d14(0x164)]>0x0?Math['max'](..._0x5ed648[_0x528d14(0x181)](_0x2d1893=>_0x2d1893[_0x528d14(0x156)]['length'])):0x0,_0x550b5e=[];for(const _0x5f00ea of _0x5ed648){const _0x3913cd=a15_0x14eef9[_0x528d14(0x169)](_0x5f00ea[_0x528d14(0x156)][_0x528d14(0x1ad)](_0x10d2fb)),_0x4c7dec=_0x5f00ea['owner']?.[_0x528d14(0x191)]?'\x20-\x20'+a15_0x14eef9[_0x528d14(0x167)](_0x5f00ea['owner'][_0x528d14(0x191)]):'';_0x550b5e['push'](_0x3913cd+'\x20\x20'+_0x5f00ea[_0x528d14(0x191)]+_0x4c7dec);}await writeOutput(_0x550b5e[_0x528d14(0x19b)]('\x0a'),_0x192f55[_0x528d14(0x178)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a15_0x2a878e(0x191)]=a15_0x2a878e(0x1b4);[a15_0x2a878e(0x192)]='Show\x20connection\x20details';[a15_0x2a878e(0x15a)](_0x54a89d){const {args:_0x303828}=_0x54a89d;if(!_0x303828[0x0])return'Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22';return undefined;}async[a15_0x2a878e(0x158)](_0x5706f3){const _0x43a9da=a15_0x2a878e,{options:_0x46672f,args:_0x5186bf,tdx:_0x342e71}=_0x5706f3,_0x204bba=_0x5186bf[0x0];_0x46672f[_0x43a9da(0x157)]&&(console['error']('Site:\x20'+_0x46672f[_0x43a9da(0x195)]),console['error']('Looking\x20up\x20connection:\x20'+_0x204bba));const _0x10bb2b=await withSpinner(_0x43a9da(0x165)+_0x204bba+_0x43a9da(0x197),()=>_0x342e71[_0x43a9da(0x19c)][_0x43a9da(0x1aa)](_0x204bba),{'verbose':_0x46672f[_0x43a9da(0x157)]}),_0x3b1613=_0x10bb2b[_0x43a9da(0x173)];return console['error'](_0x43a9da(0x162)+_0x3b1613['name']),await handleSingleObjectOutput(_0x3b1613,_0x46672f),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a15_0x2a878e(0x191)]='connection:schema';['description']=a15_0x2a878e(0x17d);[a15_0x2a878e(0x15a)](_0x3111a4){const {args:_0x380ddf}=_0x3111a4;if(!_0x380ddf[0x0])return'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.';return undefined;}async[a15_0x2a878e(0x158)](_0x549890){const _0x37eadd=a15_0x2a878e,{options:_0x33c4f6,args:_0xcd937d,tdx:_0x2ac2bf}=_0x549890,_0x1eb9b5=_0xcd937d[0x0];_0x33c4f6[_0x37eadd(0x157)]&&(console[_0x37eadd(0x1b7)](_0x37eadd(0x1b1)+_0x33c4f6[_0x37eadd(0x195)]),console[_0x37eadd(0x1b7)](_0x37eadd(0x180)+_0x1eb9b5));let _0x399153=_0x1eb9b5,_0x5080c9;try{const _0x3d0521=await _0x2ac2bf['connection'][_0x37eadd(0x185)](_0x1eb9b5);_0x3d0521&&(_0x399153=_0x3d0521[_0x37eadd(0x156)],_0x5080c9=_0x3d0521[_0x37eadd(0x191)],_0x33c4f6[_0x37eadd(0x157)]&&console[_0x37eadd(0x1b7)]('✔\x20Resolved\x20\x27'+_0x1eb9b5+_0x37eadd(0x150)+_0x399153));}catch{_0x33c4f6[_0x37eadd(0x157)]&&console[_0x37eadd(0x1b7)](_0x37eadd(0x194)+_0x1eb9b5+_0x37eadd(0x1b0));}const _0x2b81a9=await withSpinner(_0x37eadd(0x18d)+_0x399153+_0x37eadd(0x197),()=>_0x2ac2bf[_0x37eadd(0x19c)][_0x37eadd(0x17a)](_0x399153),{'verbose':_0x33c4f6[_0x37eadd(0x157)]}),_0x502976=_0x2b81a9[_0x37eadd(0x173)];_0x5080c9?console[_0x37eadd(0x1b7)](_0x37eadd(0x174)+_0x5080c9+'\x27\x20(type:\x20'+_0x399153+')'):console[_0x37eadd(0x1b7)](_0x37eadd(0x1ac)+_0x399153);if(isStructuredFormat(_0x33c4f6))await handleSingleObjectOutput(_0x502976,_0x33c4f6);else{const _0xd291f2=normalizeSchemaForDisplay(_0x502976);_0x5080c9?(console[_0x37eadd(0x17b)](_0x37eadd(0x17e)+a15_0x14eef9[_0x37eadd(0x169)](_0x5080c9)),console['log'](_0x37eadd(0x187)+a15_0x14eef9['dim'](_0x399153))):console[_0x37eadd(0x17b)](_0x37eadd(0x179)+a15_0x14eef9[_0x37eadd(0x169)](_0x399153)),_0xd291f2[_0x37eadd(0x164)]>0x0?(console[_0x37eadd(0x17b)](a15_0x14eef9[_0x37eadd(0x1a5)](_0x37eadd(0x15b))),printSchemaFields(_0xd291f2,0x0)):console[_0x37eadd(0x17b)](a15_0x14eef9['dim'](_0x37eadd(0x172)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a15_0x2a878e(0x191)]=a15_0x2a878e(0x153);[a15_0x2a878e(0x192)]=a15_0x2a878e(0x1b2);async[a15_0x2a878e(0x158)](_0x1350d9){const _0x2ef7fa=a15_0x2a878e,{options:_0x36986a,tdx:_0x2acace}=_0x1350d9;_0x36986a['verbose']&&console[_0x2ef7fa(0x1b7)]('Site:\x20'+_0x36986a[_0x2ef7fa(0x195)]);const _0x45a0dd=await withSpinner(_0x2ef7fa(0x152),()=>_0x2acace[_0x2ef7fa(0x19c)][_0x2ef7fa(0x182)](),{'verbose':_0x36986a[_0x2ef7fa(0x157)]}),_0x3be93c=_0x45a0dd[_0x2ef7fa(0x173)][_0x2ef7fa(0x1a0)]((_0x53b028,_0x4e1fb6)=>_0x53b028[_0x2ef7fa(0x156)][_0x2ef7fa(0x16f)](_0x4e1fb6[_0x2ef7fa(0x156)]));console[_0x2ef7fa(0x1b7)](_0x2ef7fa(0x183)+_0x3be93c['length']+_0x2ef7fa(0x184)+(_0x3be93c[_0x2ef7fa(0x164)]!==0x1?'s':''));if(isStructuredFormat(_0x36986a))await handleSDKOutput(_0x3be93c,_0x36986a);else{const _0x1c8026=_0x3be93c['length']>0x0?Math[_0x2ef7fa(0x175)](..._0x3be93c[_0x2ef7fa(0x181)](_0x49cee7=>_0x49cee7[_0x2ef7fa(0x156)][_0x2ef7fa(0x164)])):0x0,_0x37c1ce=[];for(const _0x4fda1d of _0x3be93c){const _0x19d6b3=a15_0x14eef9['cyan'](_0x4fda1d['type'][_0x2ef7fa(0x1ad)](_0x1c8026));_0x37c1ce[_0x2ef7fa(0x19a)](_0x19d6b3+'\x20\x20'+_0x4fda1d[_0x2ef7fa(0x191)]);}await writeOutput(_0x37c1ce[_0x2ef7fa(0x19b)]('\x0a'),_0x36986a[_0x2ef7fa(0x178)],'table');}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a15_0x2a878e(0x191)]=a15_0x2a878e(0x198);[a15_0x2a878e(0x192)]='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';['validate'](_0x1a883e){const _0x1d00b3=a15_0x2a878e,{args:_0x29de2d}=_0x1a883e;if(!_0x29de2d[0x0])return _0x1d00b3(0x18e);return undefined;}async[a15_0x2a878e(0x158)](_0x3185d4){const _0x517ec4=a15_0x2a878e,{options:_0x499501,args:_0x2dbcc4,tdx:_0x30f214}=_0x3185d4,_0x389587=_0x2dbcc4[0x0];_0x499501[_0x517ec4(0x157)]&&(console[_0x517ec4(0x1b7)](_0x517ec4(0x1b1)+_0x499501[_0x517ec4(0x195)]),console[_0x517ec4(0x1b7)]('Fetching\x20settings\x20for\x20connector\x20type:\x20'+_0x389587));const _0x1e1d20=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x389587+_0x517ec4(0x197),()=>_0x30f214[_0x517ec4(0x19c)][_0x517ec4(0x1a2)](_0x389587),{'verbose':_0x499501[_0x517ec4(0x157)]}),_0x14dff2=_0x1e1d20[_0x517ec4(0x173)];console[_0x517ec4(0x1b7)](_0x517ec4(0x189)+_0x389587);if(isStructuredFormat(_0x499501))await handleSingleObjectOutput(_0x14dff2,_0x499501);else{console[_0x517ec4(0x17b)](_0x517ec4(0x179)+a15_0x14eef9[_0x517ec4(0x169)](_0x389587)),console[_0x517ec4(0x17b)](_0x517ec4(0x151)+_0x14dff2[_0x517ec4(0x191)]);const _0x5d08a2=_0x14dff2[_0x517ec4(0x16b)]||[],_0x18180d=_0x5d08a2[_0x517ec4(0x168)](_0x419972=>_0x419972[_0x517ec4(0x1b5)]);_0x18180d[_0x517ec4(0x164)]>0x0&&(console['log'](a15_0x14eef9[_0x517ec4(0x1a5)]('\x0aCredential\x20settings:')),printMetadataSettings(_0x18180d));let _0x5cd28c=![];try{const _0x3565be=await _0x30f214[_0x517ec4(0x19c)][_0x517ec4(0x17a)](_0x389587),_0x37f5e9=normalizeSchemaForDisplay(_0x3565be);_0x37f5e9['length']>0x0&&(console[_0x517ec4(0x17b)](a15_0x14eef9[_0x517ec4(0x1a5)](_0x517ec4(0x15b))),printSchemaFields(_0x37f5e9,0x0),_0x5cd28c=!![]);}catch{const _0x373567=_0x5d08a2[_0x517ec4(0x168)](_0x43ff1b=>!_0x43ff1b['credential']);_0x373567[_0x517ec4(0x164)]>0x0&&(console[_0x517ec4(0x17b)](a15_0x14eef9[_0x517ec4(0x1a5)](_0x517ec4(0x15b))),printMetadataSettings(_0x373567),_0x5cd28c=!![]);}!_0x5cd28c&&_0x499501[_0x517ec4(0x157)]&&console['error'](a15_0x14eef9['dim'](_0x517ec4(0x16a))),_0x18180d[_0x517ec4(0x164)]===0x0&&console[_0x517ec4(0x17b)](a15_0x14eef9[_0x517ec4(0x167)]('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function a15_0x5ba1(){const _0x4445e3=['48835gyKSIf','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','>=\x20','legacy','label','Fetching\x20schema\x20for\x20\x27','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.','connection:list','\x20[record]','name','description','2YlBiaR','Treating\x20\x27','site','15257832hGvFHr','\x27...','connection:settings','\x20connection','push','join','connection','find','\x20\x20\x20\x20Options:\x20','42400140CucHeg','sort','green','getMetadata','criteria','5193OIZZMU','bold','minimum','entries','<=\x20','8039988FQtcFE','resolve','repeat','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','padStart','title','options','\x27\x20as\x20connector\x20type','Site:\x20','List\x20available\x20connector\x20types','1840659SsVZbi','connection:show','credential','yellow','error','7EXsslH','1080rTAIYB','\x20\x20\x20\x20','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','Name:\x20','Listing\x20connector\x20types...','connection:types','maximum','limit','type','verbose','execute','hint','validate','\x0aAvailable\x20fields:','\x20-\x20','input','list','enumeration','Range:\x20','Options:\x20','✔\x20Found\x20connection:\x20','record','length','Fetching\x20connection\x20\x27','legacy_settings','dim','filter','cyan','No\x20available\x20fields\x20for\x20this\x20connector','settings','blue','stringify','13HdALOp','localeCompare','627036idjoOL','21qjihpo','\x0aNo\x20fields\x20defined\x20in\x20schema','data','✔\x20Found\x20schema\x20for\x20connection\x20\x27','max','11910JuXuEk','default_value','output','\x0aConnector:\x20','getOutputSchema','log','value','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','\x0aConnection:\x20','Show\x20when:\x20','Resolving\x20connector\x20type\x20or\x20name:\x20','map','listTypes','✔\x20Found\x20','\x20connector\x20type','findByName','properties','Type:\x20'];a15_0x5ba1=function(){return _0x4445e3;};return a15_0x5ba1();}function printMetadataSettings(_0x36884e){const _0x59bbf6=a15_0x2a878e;for(const _0x4ddbf3 of _0x36884e){if(!_0x4ddbf3[_0x59bbf6(0x191)])continue;if(_0x4ddbf3['hidden'])continue;let _0x4a981d='\x20\x20'+a15_0x14eef9[_0x59bbf6(0x1a1)](_0x4ddbf3[_0x59bbf6(0x191)]);_0x4ddbf3['label']&&(_0x4a981d+=':\x20'+_0x4ddbf3[_0x59bbf6(0x18c)]);_0x4ddbf3[_0x59bbf6(0x156)]&&(_0x4a981d+=a15_0x14eef9[_0x59bbf6(0x167)]('\x20['+_0x4ddbf3['type']+']'));console[_0x59bbf6(0x17b)](_0x4a981d);_0x4ddbf3['hint']&&console['log'](_0x59bbf6(0x14f)+a15_0x14eef9[_0x59bbf6(0x167)](_0x4ddbf3[_0x59bbf6(0x159)]));if(_0x4ddbf3[_0x59bbf6(0x1af)]){const _0x4bbafe=_0x4ddbf3['options'][_0x59bbf6(0x181)](_0x4665cc=>_0x4665cc[_0x59bbf6(0x17c)])[_0x59bbf6(0x19b)](',\x20');console['log'](_0x59bbf6(0x19e)+a15_0x14eef9['yellow'](_0x4bbafe));}_0x4ddbf3[_0x59bbf6(0x177)]!==undefined&&_0x4ddbf3[_0x59bbf6(0x177)]!==null&&console[_0x59bbf6(0x17b)]('\x20\x20\x20\x20Default:\x20'+a15_0x14eef9[_0x59bbf6(0x16c)](String(_0x4ddbf3[_0x59bbf6(0x177)])));if(_0x4ddbf3[_0x59bbf6(0x1a3)]){const _0x3a0930=Object[_0x59bbf6(0x1a7)](_0x4ddbf3[_0x59bbf6(0x1a3)])[_0x59bbf6(0x181)](([_0x1f0948,_0x33d701])=>_0x1f0948+'='+JSON[_0x59bbf6(0x16d)](_0x33d701))['join'](',\x20');console['log'](_0x59bbf6(0x14f)+a15_0x14eef9[_0x59bbf6(0x167)](_0x59bbf6(0x17f)+_0x3a0930));}}}
1
+ const a15_0x1d73d5=a15_0x11c8;(function(_0x40b40c,_0x48357d){const _0x16d2ae=a15_0x11c8,_0x170b9=_0x40b40c();while(!![]){try{const _0x320eb4=parseInt(_0x16d2ae(0x174))/0x1*(parseInt(_0x16d2ae(0x16d))/0x2)+-parseInt(_0x16d2ae(0x191))/0x3+-parseInt(_0x16d2ae(0x15d))/0x4+-parseInt(_0x16d2ae(0x160))/0x5+parseInt(_0x16d2ae(0x1ad))/0x6*(parseInt(_0x16d2ae(0x163))/0x7)+parseInt(_0x16d2ae(0x162))/0x8+parseInt(_0x16d2ae(0x17f))/0x9;if(_0x320eb4===_0x48357d)break;else _0x170b9['push'](_0x170b9['shift']());}catch(_0x4da609){_0x170b9['push'](_0x170b9['shift']());}}}(a15_0x5058,0x3323c));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_0x48a827 from'chalk';function normalizeSchemaForDisplay(_0x128ebf){const _0xd51f7=a15_0x11c8,_0xe3981c=_0x128ebf['properties']||[],_0x3ee0ae=_0xe3981c['find'](_0xf9a9f=>_0xf9a9f[_0xd51f7(0x186)]===_0xd51f7(0x185)&&_0xf9a9f[_0xd51f7(0x1a0)]==='record'&&_0xf9a9f[_0xd51f7(0x1b4)]);if(_0x3ee0ae?.[_0xd51f7(0x1b4)]){const _0x5c1a4f=_0xe3981c[_0xd51f7(0x18d)](_0x78c147=>_0x78c147[_0xd51f7(0x186)]!==_0xd51f7(0x17b)&&_0x78c147[_0xd51f7(0x186)]!==_0xd51f7(0x185));return[..._0x5c1a4f,..._0x3ee0ae['properties']];}return _0xe3981c[_0xd51f7(0x18d)](_0x2df97f=>_0x2df97f[_0xd51f7(0x186)]!==_0xd51f7(0x17b));}function printSchemaFields(_0x7968a0,_0x50f0de){const _0x5416f7=a15_0x11c8,_0x27e340='\x20\x20'['repeat'](_0x50f0de+0x1),_0x2ef229='\x20\x20'[_0x5416f7(0x175)](_0x50f0de+0x2);for(const _0x2e0845 of _0x7968a0){if(!_0x2e0845[_0x5416f7(0x186)])continue;const _0x3f7232=_0x2e0845[_0x5416f7(0x1a0)]==='record'&&_0x2e0845['properties']&&_0x2e0845[_0x5416f7(0x1b4)][_0x5416f7(0x19a)]>0x0&&_0x2e0845['name']!==_0x5416f7(0x185);let _0x4a85aa=''+_0x27e340+a15_0x48a827[_0x5416f7(0x194)](_0x2e0845['name']);_0x2e0845['title']&&(_0x4a85aa+=':\x20'+_0x2e0845[_0x5416f7(0x1a3)]);if(_0x2e0845[_0x5416f7(0x17e)])_0x4a85aa+=a15_0x48a827['dim']('\x20['+_0x2e0845[_0x5416f7(0x17e)]+']');else _0x3f7232&&(_0x4a85aa+=a15_0x48a827['dim'](_0x5416f7(0x177)));console[_0x5416f7(0x178)](_0x4a85aa);_0x2e0845['description']&&console[_0x5416f7(0x178)](''+_0x2ef229+a15_0x48a827[_0x5416f7(0x197)](_0x2e0845[_0x5416f7(0x161)]));if(_0x2e0845[_0x5416f7(0x16b)]){const _0x24a90c=_0x2e0845[_0x5416f7(0x16b)][_0x5416f7(0x198)](_0x36066f=>typeof _0x36066f===_0x5416f7(0x1ae)&&_0x5416f7(0x152)in _0x36066f?_0x36066f[_0x5416f7(0x152)]:_0x36066f)[_0x5416f7(0x153)](',\x20');console[_0x5416f7(0x178)](_0x2ef229+_0x5416f7(0x1ac)+a15_0x48a827['yellow'](_0x24a90c));}_0x2e0845[_0x5416f7(0x19e)]!==undefined&&console[_0x5416f7(0x178)](_0x2ef229+'Default:\x20'+a15_0x48a827[_0x5416f7(0x179)](String(_0x2e0845[_0x5416f7(0x19e)])));if(_0x2e0845[_0x5416f7(0x18b)]!==undefined||_0x2e0845[_0x5416f7(0x182)]!==undefined){const _0x512949=_0x2e0845['minimum']!==undefined&&_0x2e0845['maximum']!==undefined?_0x2e0845[_0x5416f7(0x18b)]+_0x5416f7(0x1aa)+_0x2e0845[_0x5416f7(0x182)]:_0x2e0845[_0x5416f7(0x18b)]!==undefined?_0x5416f7(0x188)+_0x2e0845[_0x5416f7(0x18b)]:_0x5416f7(0x16a)+_0x2e0845['maximum'];console['log'](_0x2ef229+_0x5416f7(0x1b2)+a15_0x48a827[_0x5416f7(0x179)](_0x512949));}if(_0x2e0845[_0x5416f7(0x18a)]){const _0x3ef0e5=Object['entries'](_0x2e0845[_0x5416f7(0x18a)])[_0x5416f7(0x198)](([_0x4b7c90,_0x2b7ccf])=>_0x4b7c90+'='+JSON[_0x5416f7(0x1b8)](_0x2b7ccf))[_0x5416f7(0x153)](',\x20');console['log'](''+_0x2ef229+a15_0x48a827[_0x5416f7(0x197)]('Show\x20when:\x20'+_0x3ef0e5));}_0x3f7232&&_0x2e0845[_0x5416f7(0x1b4)]&&printSchemaFields(_0x2e0845['properties'],_0x50f0de+0x1);}}export class ConnectionListCommand extends BaseCommand{[a15_0x1d73d5(0x186)]=a15_0x1d73d5(0x19d);[a15_0x1d73d5(0x161)]='List\x20all\x20result\x20output\x20connections';async[a15_0x1d73d5(0x189)](_0x5da381){const _0x1a061e=a15_0x1d73d5,{options:_0x2b6570,tdx:_0x493338}=_0x5da381;_0x2b6570[_0x1a061e(0x18f)]&&console[_0x1a061e(0x180)](_0x1a061e(0x16f)+_0x2b6570[_0x1a061e(0x195)]);const _0x24da66=resolveLimit(_0x2b6570[_0x1a061e(0x172)],DEFAULT_LISTING_LIMIT),_0x22ec33=await withSpinner(_0x1a061e(0x192),()=>_0x493338[_0x1a061e(0x1a4)][_0x1a061e(0x19f)](),{'verbose':_0x2b6570['verbose']}),_0x14c9ba=_0x22ec33['data'];console[_0x1a061e(0x180)](_0x1a061e(0x1b3)+_0x14c9ba['length']+_0x1a061e(0x184)+(_0x14c9ba[_0x1a061e(0x19a)]!==0x1?'s':''));if(isStructuredFormat(_0x2b6570)){const _0x1abaf8=_0x14c9ba['slice'](0x0,_0x24da66);await handleSDKOutput(_0x1abaf8,{..._0x2b6570,'limit':_0x24da66});}else{const _0x670dc4=_0x14c9ba[_0x1a061e(0x19a)]>0x0?Math[_0x1a061e(0x19b)](..._0x14c9ba[_0x1a061e(0x198)](_0x3d1058=>_0x3d1058[_0x1a061e(0x1a0)][_0x1a061e(0x19a)])):0x0,_0x15d46f=[];for(const _0x37488d of _0x14c9ba){const _0x472717=a15_0x48a827[_0x1a061e(0x173)](_0x37488d['type'][_0x1a061e(0x15e)](_0x670dc4)),_0x3ee85a=_0x37488d[_0x1a061e(0x196)]?.[_0x1a061e(0x186)]?_0x1a061e(0x1aa)+a15_0x48a827['dim'](_0x37488d['owner'][_0x1a061e(0x186)]):'';_0x15d46f['push'](_0x472717+'\x20\x20'+_0x37488d[_0x1a061e(0x186)]+_0x3ee85a);}await writeOutput(_0x15d46f[_0x1a061e(0x153)]('\x0a'),_0x2b6570[_0x1a061e(0x1ab)],_0x1a061e(0x165));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a15_0x1d73d5(0x186)]='connection:show';[a15_0x1d73d5(0x161)]=a15_0x1d73d5(0x151);[a15_0x1d73d5(0x1a2)](_0x35f930){const _0x5e3d3f=a15_0x1d73d5,{args:_0x4e08b5}=_0x35f930;if(!_0x4e08b5[0x0])return _0x5e3d3f(0x158);return undefined;}async[a15_0x1d73d5(0x189)](_0x1bd14f){const _0x2f4265=a15_0x1d73d5,{options:_0x199b6f,args:_0x16d229,tdx:_0x99176a}=_0x1bd14f,_0x56d807=_0x16d229[0x0];_0x199b6f[_0x2f4265(0x18f)]&&(console[_0x2f4265(0x180)]('Site:\x20'+_0x199b6f[_0x2f4265(0x195)]),console[_0x2f4265(0x180)](_0x2f4265(0x159)+_0x56d807));const _0x5b80e6=await withSpinner(_0x2f4265(0x1b5)+_0x56d807+_0x2f4265(0x15a),()=>_0x99176a[_0x2f4265(0x1a4)][_0x2f4265(0x1b0)](_0x56d807),{'verbose':_0x199b6f[_0x2f4265(0x18f)]}),_0x13caa9=_0x5b80e6['data'];return console[_0x2f4265(0x180)](_0x2f4265(0x170)+_0x13caa9[_0x2f4265(0x186)]),await handleSingleObjectOutput(_0x13caa9,_0x199b6f),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a15_0x1d73d5(0x168);['description']=a15_0x1d73d5(0x176);[a15_0x1d73d5(0x1a2)](_0x51ba79){const {args:_0x546d64}=_0x51ba79;if(!_0x546d64[0x0])return'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.';return undefined;}async[a15_0x1d73d5(0x189)](_0x1e9c92){const _0xc1fa4f=a15_0x1d73d5,{options:_0x3803a2,args:_0x5cbdb6,tdx:_0x35fb62}=_0x1e9c92,_0x3f0a9d=_0x5cbdb6[0x0];_0x3803a2[_0xc1fa4f(0x18f)]&&(console[_0xc1fa4f(0x180)](_0xc1fa4f(0x16f)+_0x3803a2[_0xc1fa4f(0x195)]),console[_0xc1fa4f(0x180)](_0xc1fa4f(0x190)+_0x3f0a9d));let _0x4447e6=_0x3f0a9d,_0x5e4d12;try{const _0x3bba29=await _0x35fb62[_0xc1fa4f(0x1a4)]['findByName'](_0x3f0a9d);_0x3bba29&&(_0x4447e6=_0x3bba29[_0xc1fa4f(0x1a0)],_0x5e4d12=_0x3bba29['name'],_0x3803a2[_0xc1fa4f(0x18f)]&&console[_0xc1fa4f(0x180)]('✔\x20Resolved\x20\x27'+_0x3f0a9d+_0xc1fa4f(0x17a)+_0x4447e6));}catch{_0x3803a2[_0xc1fa4f(0x18f)]&&console[_0xc1fa4f(0x180)](_0xc1fa4f(0x1a8)+_0x3f0a9d+'\x27\x20as\x20connector\x20type');}const _0x53f023=await withSpinner(_0xc1fa4f(0x166)+_0x4447e6+_0xc1fa4f(0x15a),()=>_0x35fb62[_0xc1fa4f(0x1a4)]['getOutputSchema'](_0x4447e6),{'verbose':_0x3803a2[_0xc1fa4f(0x18f)]}),_0x233bdb=_0x53f023['data'];_0x5e4d12?console[_0xc1fa4f(0x180)]('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x5e4d12+_0xc1fa4f(0x187)+_0x4447e6+')'):console[_0xc1fa4f(0x180)]('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x4447e6);if(isStructuredFormat(_0x3803a2))await handleSingleObjectOutput(_0x233bdb,_0x3803a2);else{const _0x1a9d93=normalizeSchemaForDisplay(_0x233bdb);_0x5e4d12?(console[_0xc1fa4f(0x178)](_0xc1fa4f(0x156)+a15_0x48a827[_0xc1fa4f(0x173)](_0x5e4d12)),console[_0xc1fa4f(0x178)](_0xc1fa4f(0x18e)+a15_0x48a827['dim'](_0x4447e6))):console['log'](_0xc1fa4f(0x199)+a15_0x48a827[_0xc1fa4f(0x173)](_0x4447e6)),_0x1a9d93[_0xc1fa4f(0x19a)]>0x0?(console[_0xc1fa4f(0x178)](a15_0x48a827['bold']('\x0aAvailable\x20fields:')),printSchemaFields(_0x1a9d93,0x0)):console[_0xc1fa4f(0x178)](a15_0x48a827[_0xc1fa4f(0x197)](_0xc1fa4f(0x1a6)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a15_0x1d73d5(0x186)]=a15_0x1d73d5(0x181);[a15_0x1d73d5(0x161)]='List\x20available\x20connector\x20types';async[a15_0x1d73d5(0x189)](_0x3d6318){const _0x5edef8=a15_0x1d73d5,{options:_0x4e53d8,tdx:_0x396521}=_0x3d6318;_0x4e53d8[_0x5edef8(0x18f)]&&console['error'](_0x5edef8(0x16f)+_0x4e53d8[_0x5edef8(0x195)]);const _0x262035=await withSpinner(_0x5edef8(0x171),()=>_0x396521[_0x5edef8(0x1a4)][_0x5edef8(0x169)](),{'verbose':_0x4e53d8[_0x5edef8(0x18f)]}),_0x2d52fe=_0x262035[_0x5edef8(0x167)]['sort']((_0x5edfc6,_0x344864)=>_0x5edfc6[_0x5edef8(0x1a0)]['localeCompare'](_0x344864[_0x5edef8(0x1a0)]));console[_0x5edef8(0x180)](_0x5edef8(0x1b3)+_0x2d52fe[_0x5edef8(0x19a)]+'\x20connector\x20type'+(_0x2d52fe[_0x5edef8(0x19a)]!==0x1?'s':''));if(isStructuredFormat(_0x4e53d8))await handleSDKOutput(_0x2d52fe,_0x4e53d8);else{const _0x259805=_0x2d52fe[_0x5edef8(0x19a)]>0x0?Math[_0x5edef8(0x19b)](..._0x2d52fe[_0x5edef8(0x198)](_0x5a2b3d=>_0x5a2b3d[_0x5edef8(0x1a0)][_0x5edef8(0x19a)])):0x0,_0x4bb503=[];for(const _0x583a77 of _0x2d52fe){const _0x179c49=a15_0x48a827[_0x5edef8(0x173)](_0x583a77[_0x5edef8(0x1a0)][_0x5edef8(0x15e)](_0x259805));_0x4bb503[_0x5edef8(0x15f)](_0x179c49+'\x20\x20'+_0x583a77[_0x5edef8(0x186)]);}await writeOutput(_0x4bb503[_0x5edef8(0x153)]('\x0a'),_0x4e53d8[_0x5edef8(0x1ab)],'table');}return 0x0;}}function a15_0x5058(){const _0xa3fd52=['output','Options:\x20','18dUHbGI','object','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.','resolve','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','Range:\x20','✔\x20Found\x20','properties','Fetching\x20connection\x20\x27','\x20\x20\x20\x20','getOutputSchema','stringify','Show\x20connection\x20details','value','join','options','connection:settings','\x0aConnection:\x20','label','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','Looking\x20up\x20connection:\x20','\x27...','\x0aCredential\x20settings:','yellow','1368168tIegIR','padStart','push','1031015IsWWWA','description','1521672CfWRUe','865914CqadJW','No\x20available\x20fields\x20for\x20this\x20connector','table','Fetching\x20schema\x20for\x20\x27','data','connection:schema','listTypes','<=\x20','enumeration','\x0aAvailable\x20fields:','26EzZFAU','bold','Site:\x20','✔\x20Found\x20connection:\x20','Listing\x20connector\x20types...','limit','cyan','790XQwYJq','repeat','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','\x20[record]','log','blue','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','legacy','\x20\x20\x20\x20Default:\x20','hint','input','3037014jfKOvh','error','connection:types','maximum','getMetadata','\x20connection','legacy_settings','name','\x27\x20(type:\x20','>=\x20','execute','criteria','minimum','\x20\x20\x20\x20Options:\x20','filter','Type:\x20','verbose','Resolving\x20connector\x20type\x20or\x20name:\x20','453954CjUXnE','Listing\x20connections...','entries','green','site','owner','dim','map','\x0aConnector:\x20','length','max','credential','connection:list','default_value','list','type','Fetching\x20settings\x20for\x20connector\x20type:\x20','validate','title','connection','settings','\x0aNo\x20fields\x20defined\x20in\x20schema','hidden','Treating\x20\x27','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','\x20-\x20'];a15_0x5058=function(){return _0xa3fd52;};return a15_0x5058();}function a15_0x11c8(_0xfdb15,_0x20afaf){_0xfdb15=_0xfdb15-0x151;const _0x50584a=a15_0x5058();let _0x11c8bf=_0x50584a[_0xfdb15];return _0x11c8bf;}export class ConnectionSettingsCommand extends BaseCommand{[a15_0x1d73d5(0x186)]=a15_0x1d73d5(0x155);[a15_0x1d73d5(0x161)]=a15_0x1d73d5(0x1a9);[a15_0x1d73d5(0x1a2)](_0x1c547d){const _0x21858c=a15_0x1d73d5,{args:_0x1ba158}=_0x1c547d;if(!_0x1ba158[0x0])return _0x21858c(0x1af);return undefined;}async['execute'](_0x56e39f){const _0xb0ee72=a15_0x1d73d5,{options:_0x30e3fd,args:_0x590916,tdx:_0x3efc18}=_0x56e39f,_0x592883=_0x590916[0x0];_0x30e3fd[_0xb0ee72(0x18f)]&&(console[_0xb0ee72(0x180)](_0xb0ee72(0x16f)+_0x30e3fd['site']),console['error'](_0xb0ee72(0x1a1)+_0x592883));const _0x965862=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x592883+'\x27...',()=>_0x3efc18[_0xb0ee72(0x1a4)][_0xb0ee72(0x183)](_0x592883),{'verbose':_0x30e3fd[_0xb0ee72(0x18f)]}),_0x4ad88c=_0x965862['data'];console[_0xb0ee72(0x180)](_0xb0ee72(0x1b1)+_0x592883);if(isStructuredFormat(_0x30e3fd))await handleSingleObjectOutput(_0x4ad88c,_0x30e3fd);else{console[_0xb0ee72(0x178)]('\x0aConnector:\x20'+a15_0x48a827[_0xb0ee72(0x173)](_0x592883)),console[_0xb0ee72(0x178)]('Name:\x20'+_0x4ad88c['name']);const _0x2f31d3=_0x4ad88c[_0xb0ee72(0x1a5)]||[],_0x448c59=_0x2f31d3[_0xb0ee72(0x18d)](_0x52cbc7=>_0x52cbc7['credential']);_0x448c59[_0xb0ee72(0x19a)]>0x0&&(console[_0xb0ee72(0x178)](a15_0x48a827['bold'](_0xb0ee72(0x15b))),printMetadataSettings(_0x448c59));let _0x3f379f=![];try{const _0x23d509=await _0x3efc18['connection'][_0xb0ee72(0x1b7)](_0x592883),_0x52ce6f=normalizeSchemaForDisplay(_0x23d509);_0x52ce6f[_0xb0ee72(0x19a)]>0x0&&(console[_0xb0ee72(0x178)](a15_0x48a827[_0xb0ee72(0x16e)](_0xb0ee72(0x16c))),printSchemaFields(_0x52ce6f,0x0),_0x3f379f=!![]);}catch{const _0x3e924f=_0x2f31d3[_0xb0ee72(0x18d)](_0x45469c=>!_0x45469c[_0xb0ee72(0x19c)]);_0x3e924f[_0xb0ee72(0x19a)]>0x0&&(console[_0xb0ee72(0x178)](a15_0x48a827[_0xb0ee72(0x16e)](_0xb0ee72(0x16c))),printMetadataSettings(_0x3e924f),_0x3f379f=!![]);}!_0x3f379f&&_0x30e3fd['verbose']&&console['error'](a15_0x48a827['dim'](_0xb0ee72(0x164))),_0x448c59['length']===0x0&&console[_0xb0ee72(0x178)](a15_0x48a827['dim']('\x0aNo\x20credential\x20settings\x20defined'));}return 0x0;}}function printMetadataSettings(_0x17c2e7){const _0x4bdadd=a15_0x1d73d5;for(const _0x2c5f77 of _0x17c2e7){if(!_0x2c5f77[_0x4bdadd(0x186)])continue;if(_0x2c5f77[_0x4bdadd(0x1a7)])continue;let _0x3a8257='\x20\x20'+a15_0x48a827[_0x4bdadd(0x194)](_0x2c5f77[_0x4bdadd(0x186)]);_0x2c5f77[_0x4bdadd(0x157)]&&(_0x3a8257+=':\x20'+_0x2c5f77[_0x4bdadd(0x157)]);_0x2c5f77[_0x4bdadd(0x1a0)]&&(_0x3a8257+=a15_0x48a827[_0x4bdadd(0x197)]('\x20['+_0x2c5f77[_0x4bdadd(0x1a0)]+']'));console[_0x4bdadd(0x178)](_0x3a8257);_0x2c5f77[_0x4bdadd(0x17d)]&&console[_0x4bdadd(0x178)](_0x4bdadd(0x1b6)+a15_0x48a827[_0x4bdadd(0x197)](_0x2c5f77['hint']));if(_0x2c5f77[_0x4bdadd(0x154)]){const _0x22bd10=_0x2c5f77[_0x4bdadd(0x154)]['map'](_0x6ceb41=>_0x6ceb41['value'])[_0x4bdadd(0x153)](',\x20');console['log'](_0x4bdadd(0x18c)+a15_0x48a827[_0x4bdadd(0x15c)](_0x22bd10));}_0x2c5f77['default_value']!==undefined&&_0x2c5f77['default_value']!==null&&console[_0x4bdadd(0x178)](_0x4bdadd(0x17c)+a15_0x48a827[_0x4bdadd(0x179)](String(_0x2c5f77[_0x4bdadd(0x19e)])));if(_0x2c5f77[_0x4bdadd(0x18a)]){const _0x2ee8f3=Object[_0x4bdadd(0x193)](_0x2c5f77[_0x4bdadd(0x18a)])[_0x4bdadd(0x198)](([_0x377067,_0x2100fa])=>_0x377067+'='+JSON[_0x4bdadd(0x1b8)](_0x2100fa))[_0x4bdadd(0x153)](',\x20');console[_0x4bdadd(0x178)](_0x4bdadd(0x1b6)+a15_0x48a827['dim']('Show\x20when:\x20'+_0x2ee8f3));}}}
@@ -1 +1 @@
1
- const a16_0x2802bd=a16_0x2f7f;(function(_0x4887d1,_0x42e10a){const _0x4c8b71=a16_0x2f7f,_0x2e58c3=_0x4887d1();while(!![]){try{const _0x564f33=parseInt(_0x4c8b71(0xe8))/0x1+parseInt(_0x4c8b71(0xfe))/0x2+-parseInt(_0x4c8b71(0xf4))/0x3*(-parseInt(_0x4c8b71(0xec))/0x4)+parseInt(_0x4c8b71(0xea))/0x5+parseInt(_0x4c8b71(0xf9))/0x6+parseInt(_0x4c8b71(0xe7))/0x7*(-parseInt(_0x4c8b71(0xfa))/0x8)+-parseInt(_0x4c8b71(0x100))/0x9;if(_0x564f33===_0x42e10a)break;else _0x2e58c3['push'](_0x2e58c3['shift']());}catch(_0x5e0b1c){_0x2e58c3['push'](_0x2e58c3['shift']());}}}(a16_0x1fe9,0x1ca43));import{BaseCommand}from'./command.js';function a16_0x1fe9(){const _0x56cabd=['📦\x20','description','length','databases','Listing\x20databases...','47397wuDEBG','Site:\x20','message','listDatabases','verbose','65856Uvbyol','684632wUEsqs','cause','limit','site','420096sQKavS','List\x20all\x20databases','5041935Duqoir','name','\x20\x20Cause:\x20','execute','7kFdKSB','164594HPAoOW','error','1018510myxVFR','data','44BvzMIm','log','Error:\x20'];a16_0x1fe9=function(){return _0x56cabd;};return a16_0x1fe9();}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_0x2f7f(_0x3b49dc,_0x8f674f){_0x3b49dc=_0x3b49dc-0xe4;const _0x1fe923=a16_0x1fe9();let _0x2f7feb=_0x1fe923[_0x3b49dc];return _0x2f7feb;}export class DatabasesCommand extends BaseCommand{[a16_0x2802bd(0xe4)]=a16_0x2802bd(0xf2);[a16_0x2802bd(0xf0)]=a16_0x2802bd(0xff);async[a16_0x2802bd(0xe6)](_0x4f83b0){const _0x37d532=a16_0x2802bd,{options:_0x5724b9,args:_0x51c170,tdx:_0x578b49}=_0x4f83b0,_0x487331=_0x51c170[0x0];try{_0x5724b9[_0x37d532(0xf8)]&&(console['error'](_0x37d532(0xf5)+_0x5724b9[_0x37d532(0xfd)]),_0x487331&&console[_0x37d532(0xe9)]('Pattern:\x20'+_0x487331));const _0x43e543=resolveLimit(_0x5724b9[_0x37d532(0xfc)],DEFAULT_LISTING_LIMIT),_0x88a222=await withSpinner(_0x37d532(0xf3),()=>_0x578b49['query'][_0x37d532(0xf7)](_0x487331,_0x43e543),{'verbose':_0x5724b9[_0x37d532(0xf8)]}),_0x1e0f2f=_0x88a222[_0x37d532(0xeb)];console[_0x37d532(0xe9)]('✔\x20Found\x20'+_0x1e0f2f[_0x37d532(0xf1)]+'\x20database'+(_0x1e0f2f[_0x37d532(0xf1)]!==0x1?'s':''));if(isStructuredFormat(_0x5724b9))await handleSDKOutput(_0x1e0f2f,{..._0x5724b9,'limit':_0x43e543});else for(const _0x400f65 of _0x1e0f2f){console[_0x37d532(0xed)](_0x37d532(0xef)+_0x400f65['database_name']);}return 0x0;}catch(_0x4b4d34){if(_0x4b4d34 instanceof SDKError)return console[_0x37d532(0xe9)](_0x37d532(0xee)+_0x4b4d34[_0x37d532(0xf6)]),_0x4b4d34[_0x37d532(0xfb)]&&console[_0x37d532(0xe9)](_0x37d532(0xe5)+_0x4b4d34[_0x37d532(0xfb)]),0x1;throw _0x4b4d34;}}}
1
+ const a16_0x2938f5=a16_0x466b;(function(_0x1a2386,_0x5d14e6){const _0x18bfe4=a16_0x466b,_0x461aef=_0x1a2386();while(!![]){try{const _0x2ae272=parseInt(_0x18bfe4(0x203))/0x1+parseInt(_0x18bfe4(0x1ff))/0x2+-parseInt(_0x18bfe4(0x204))/0x3+-parseInt(_0x18bfe4(0x1f3))/0x4+-parseInt(_0x18bfe4(0x1fe))/0x5+-parseInt(_0x18bfe4(0x1f8))/0x6*(-parseInt(_0x18bfe4(0x1f2))/0x7)+parseInt(_0x18bfe4(0x1f5))/0x8*(-parseInt(_0x18bfe4(0x1fb))/0x9);if(_0x2ae272===_0x5d14e6)break;else _0x461aef['push'](_0x461aef['shift']());}catch(_0x2a952f){_0x461aef['push'](_0x461aef['shift']());}}}(a16_0x40e2,0x450d8));import{BaseCommand}from'./command.js';function a16_0x466b(_0x1b936c,_0x3c0e6b){_0x1b936c=_0x1b936c-0x1f2;const _0x40e2d7=a16_0x40e2();let _0x466b5b=_0x40e2d7[_0x1b936c];return _0x466b5b;}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_0x40e2(){const _0x3d0fb0=['30jRpUIh','cause','verbose','9jclPhR','site','Pattern:\x20','1108215vTHieW','362864moZVyn','\x20\x20Cause:\x20','Error:\x20','message','162680vaVqgn','459969pNdoJC','description','execute','✔\x20Found\x20','length','702989qEoNtU','13152emVGvT','List\x20all\x20databases','1481224xztros','log','error'];a16_0x40e2=function(){return _0x3d0fb0;};return a16_0x40e2();}export class DatabasesCommand extends BaseCommand{['name']='databases';[a16_0x2938f5(0x205)]=a16_0x2938f5(0x1f4);async[a16_0x2938f5(0x206)](_0x107679){const _0x6bd4c8=a16_0x2938f5,{options:_0x25831e,args:_0x128613,tdx:_0x3ca7f8}=_0x107679,_0xfb5d0b=_0x128613[0x0];try{_0x25831e[_0x6bd4c8(0x1fa)]&&(console['error']('Site:\x20'+_0x25831e[_0x6bd4c8(0x1fc)]),_0xfb5d0b&&console[_0x6bd4c8(0x1f7)](_0x6bd4c8(0x1fd)+_0xfb5d0b));const _0x504651=resolveLimit(_0x25831e['limit'],DEFAULT_LISTING_LIMIT),_0x2faa04=await withSpinner('Listing\x20databases...',()=>_0x3ca7f8['query']['listDatabases'](_0xfb5d0b,_0x504651),{'verbose':_0x25831e['verbose']}),_0x48c7d1=_0x2faa04['data'];console[_0x6bd4c8(0x1f7)](_0x6bd4c8(0x207)+_0x48c7d1[_0x6bd4c8(0x208)]+'\x20database'+(_0x48c7d1['length']!==0x1?'s':''));if(isStructuredFormat(_0x25831e))await handleSDKOutput(_0x48c7d1,{..._0x25831e,'limit':_0x504651});else for(const _0x52948e of _0x48c7d1){console[_0x6bd4c8(0x1f6)]('📦\x20'+_0x52948e['database_name']);}return 0x0;}catch(_0xcac92a){if(_0xcac92a instanceof SDKError)return console[_0x6bd4c8(0x1f7)](_0x6bd4c8(0x201)+_0xcac92a[_0x6bd4c8(0x202)]),_0xcac92a['cause']&&console[_0x6bd4c8(0x1f7)](_0x6bd4c8(0x200)+_0xcac92a[_0x6bd4c8(0x1f9)]),0x1;throw _0xcac92a;}}}