@treasuredata/tdx 2026.3.47 → 2026.3.49

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 (255) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.d.ts +22 -0
  12. package/dist/commands/auth-command.d.ts.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/delivery-command.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.d.ts +5 -5
  41. package/dist/commands/profile-command.d.ts.map +1 -1
  42. package/dist/commands/profile-command.js +1 -1
  43. package/dist/commands/profile-command.js.map +1 -1
  44. package/dist/commands/profiles-command.js +1 -1
  45. package/dist/commands/query-command.js +1 -1
  46. package/dist/commands/schedule-command.js +1 -1
  47. package/dist/commands/segment-command.js +1 -1
  48. package/dist/commands/segment-create-command.js +1 -1
  49. package/dist/commands/segment-fields-command.js +1 -1
  50. package/dist/commands/segment-pull-command.js +1 -1
  51. package/dist/commands/segment-push-command.js +1 -1
  52. package/dist/commands/segment-update-command.js +1 -1
  53. package/dist/commands/segment-use-command.js +1 -1
  54. package/dist/commands/segment-validate-command.js +1 -1
  55. package/dist/commands/segments.js +1 -1
  56. package/dist/commands/show.js +1 -1
  57. package/dist/commands/status-command.js +1 -1
  58. package/dist/commands/tables.js +1 -1
  59. package/dist/commands/unset-command.js +1 -1
  60. package/dist/commands/upgrade-command.js +1 -1
  61. package/dist/commands/use-command.js +1 -1
  62. package/dist/commands/user-command.js +1 -1
  63. package/dist/commands/work-command.js +1 -1
  64. package/dist/commands/workflow-command.js +1 -1
  65. package/dist/core/auth.js +1 -1
  66. package/dist/core/command-output.js +1 -1
  67. package/dist/core/config.js +1 -1
  68. package/dist/core/connection-cache.js +1 -1
  69. package/dist/core/constants.js +1 -1
  70. package/dist/core/credential-cache.js +1 -1
  71. package/dist/core/global-context.js +1 -1
  72. package/dist/core/keychain.js +1 -1
  73. package/dist/core/oauth-keychain.js +1 -1
  74. package/dist/core/oauth.d.ts +12 -8
  75. package/dist/core/oauth.d.ts.map +1 -1
  76. package/dist/core/oauth.js +1 -1
  77. package/dist/core/oauth.js.map +1 -1
  78. package/dist/core/profile.js +1 -1
  79. package/dist/core/project-config.js +1 -1
  80. package/dist/core/session.js +1 -1
  81. package/dist/core/user-cache.js +1 -1
  82. package/dist/core/version.js +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/mcp/server.js +1 -1
  85. package/dist/mcp/tools/index.js +1 -1
  86. package/dist/mcp/tools/tdx-run.js +1 -1
  87. package/dist/mcp/tools/tdx-search.js +1 -1
  88. package/dist/mcp/utils.d.ts.map +1 -1
  89. package/dist/mcp/utils.js +1 -1
  90. package/dist/mcp/utils.js.map +1 -1
  91. package/dist/proxy/claude-usage-tracker.js +1 -1
  92. package/dist/proxy/passthrough-server.js +1 -1
  93. package/dist/proxy/sse-usage-parser.js +1 -1
  94. package/dist/sdk/agent/agent-config.js +1 -1
  95. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/test/evaluator.js +1 -1
  98. package/dist/sdk/agent/test/executor.js +1 -1
  99. package/dist/sdk/agent/test/index.js +1 -1
  100. package/dist/sdk/agent/test/output.js +1 -1
  101. package/dist/sdk/agent/test/parser.js +1 -1
  102. package/dist/sdk/agent/tool-target-registry.js +1 -1
  103. package/dist/sdk/api.js +1 -1
  104. package/dist/sdk/cas/cas-api-client.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  107. package/dist/sdk/cas/index.js +1 -1
  108. package/dist/sdk/cas/pull-workflow.js +1 -1
  109. package/dist/sdk/cas/push-workflow.js +1 -1
  110. package/dist/sdk/client/cdp-api-client.js +1 -1
  111. package/dist/sdk/client/delivery-api-client.js +1 -1
  112. package/dist/sdk/client/endpoints.js +1 -1
  113. package/dist/sdk/client/engage-api-client.js +1 -1
  114. package/dist/sdk/client/http-client.js +1 -1
  115. package/dist/sdk/client/llm-api-client.js +1 -1
  116. package/dist/sdk/client/oauth-refresh.js +1 -1
  117. package/dist/sdk/client/rate-limiter.js +1 -1
  118. package/dist/sdk/client/td-api-client.js +1 -1
  119. package/dist/sdk/client/trino-api-client.js +1 -1
  120. package/dist/sdk/client/workflow-client.js +1 -1
  121. package/dist/sdk/connection-validator.js +1 -1
  122. package/dist/sdk/connection.js +1 -1
  123. package/dist/sdk/delivery.js +1 -1
  124. package/dist/sdk/engage/campaign-pull.js +1 -1
  125. package/dist/sdk/engage/campaign-push.js +1 -1
  126. package/dist/sdk/engage/campaign-validator.js +1 -1
  127. package/dist/sdk/engage/campaign-yaml.js +1 -1
  128. package/dist/sdk/engage/template-pull.js +1 -1
  129. package/dist/sdk/engage/template-push.js +1 -1
  130. package/dist/sdk/engage/template-validator.js +1 -1
  131. package/dist/sdk/engage/template-yaml.js +1 -1
  132. package/dist/sdk/engage/types/campaign-def.js +1 -1
  133. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  134. package/dist/sdk/engage/types/template-schema.js +1 -1
  135. package/dist/sdk/engage.js +1 -1
  136. package/dist/sdk/errors.js +1 -1
  137. package/dist/sdk/index.js +1 -1
  138. package/dist/sdk/io/index.js +1 -1
  139. package/dist/sdk/io/node-filesystem.js +1 -1
  140. package/dist/sdk/job.js +1 -1
  141. package/dist/sdk/journey.js +1 -1
  142. package/dist/sdk/llm/chat-cache.js +1 -1
  143. package/dist/sdk/llm/index.js +1 -1
  144. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  145. package/dist/sdk/llm/model-factors.js +1 -1
  146. package/dist/sdk/personalization.js +1 -1
  147. package/dist/sdk/policy.js +1 -1
  148. package/dist/sdk/query/index.js +1 -1
  149. package/dist/sdk/query/sql-parser.js +1 -1
  150. package/dist/sdk/realtime.js +1 -1
  151. package/dist/sdk/schedule.js +1 -1
  152. package/dist/sdk/segment/child-segment-yaml.d.ts +8 -0
  153. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  154. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  155. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  156. package/dist/sdk/segment/fields-display.js +1 -1
  157. package/dist/sdk/segment/file-discovery.js +1 -1
  158. package/dist/sdk/segment/journey-utils.js +1 -1
  159. package/dist/sdk/segment/journey-validator.js +1 -1
  160. package/dist/sdk/segment/journey-yaml.js +1 -1
  161. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  162. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  163. package/dist/sdk/segment/pull-workflow.js +1 -1
  164. package/dist/sdk/segment/push-recovery.js +1 -1
  165. package/dist/sdk/segment/push-workflow.js +1 -1
  166. package/dist/sdk/segment/resolution-context.js +1 -1
  167. package/dist/sdk/segment/segment-path-parser.js +1 -1
  168. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  169. package/dist/sdk/segment/segment-validator.js +1 -1
  170. package/dist/sdk/segment/target-resolution.js +1 -1
  171. package/dist/sdk/segment/tdx-config.js +1 -1
  172. package/dist/sdk/segment/types/activation-schema.js +1 -1
  173. package/dist/sdk/segment/types/journey-def.js +1 -1
  174. package/dist/sdk/segment/types/journey-schema.js +1 -1
  175. package/dist/sdk/segment/types/segment-def.js +1 -1
  176. package/dist/sdk/segment/types/segment-schema.js +1 -1
  177. package/dist/sdk/segment/validate-files.js +1 -1
  178. package/dist/sdk/segment/yaml-validator.js +1 -1
  179. package/dist/sdk/segment.js +1 -1
  180. package/dist/sdk/types/index.d.ts +1 -1
  181. package/dist/sdk/types/index.d.ts.map +1 -1
  182. package/dist/sdk/types/index.js +1 -1
  183. package/dist/sdk/types/index.js.map +1 -1
  184. package/dist/sdk/types/progress.js +1 -1
  185. package/dist/sdk/types/workspace.d.ts +29 -0
  186. package/dist/sdk/types/workspace.d.ts.map +1 -1
  187. package/dist/sdk/types/workspace.js +1 -1
  188. package/dist/sdk/user.js +1 -1
  189. package/dist/sdk/util/format-detector.js +1 -1
  190. package/dist/sdk/util/formatters.js +1 -1
  191. package/dist/sdk/util/index.js +1 -1
  192. package/dist/sdk/util/paginate.js +1 -1
  193. package/dist/sdk/util/tree-formatter.js +1 -1
  194. package/dist/sdk/workflow/archive-validation.js +1 -1
  195. package/dist/sdk/workflow/clone-workflow.js +1 -1
  196. package/dist/sdk/workflow/index.js +1 -1
  197. package/dist/sdk/workflow/pull-workflow.js +1 -1
  198. package/dist/sdk/workflow/push-workflow.js +1 -1
  199. package/dist/sdk/workflow/tdx-config.js +1 -1
  200. package/dist/sdk/workflow/workflow-utils.js +1 -1
  201. package/dist/sdk/workspace/frontmatter.js +1 -1
  202. package/dist/sdk/workspace/git.d.ts +4 -1
  203. package/dist/sdk/workspace/git.d.ts.map +1 -1
  204. package/dist/sdk/workspace/git.js +1 -1
  205. package/dist/sdk/workspace/git.js.map +1 -1
  206. package/dist/sdk/workspace/index.d.ts +8 -15
  207. package/dist/sdk/workspace/index.d.ts.map +1 -1
  208. package/dist/sdk/workspace/index.js +1 -1
  209. package/dist/sdk/workspace/index.js.map +1 -1
  210. package/dist/sdk/workspace/templates.js +1 -1
  211. package/dist/sdk/workspace/weekly.d.ts +3 -13
  212. package/dist/sdk/workspace/weekly.d.ts.map +1 -1
  213. package/dist/sdk/workspace/weekly.js +1 -1
  214. package/dist/sdk/workspace/weekly.js.map +1 -1
  215. package/dist/sdk/workspace/wikilinks.d.ts +15 -0
  216. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
  217. package/dist/sdk/workspace/wikilinks.js +1 -1
  218. package/dist/sdk/workspace/wikilinks.js.map +1 -1
  219. package/dist/test-utils/command-runner.js +1 -1
  220. package/dist/test-utils/factories.js +1 -1
  221. package/dist/test-utils/fixtures.js +1 -1
  222. package/dist/test-utils/http-mock.js +1 -1
  223. package/dist/test-utils/index.js +1 -1
  224. package/dist/utils/async.js +1 -1
  225. package/dist/utils/colors.js +1 -1
  226. package/dist/utils/diff.js +1 -1
  227. package/dist/utils/file-permissions.js +1 -1
  228. package/dist/utils/file-reader.js +1 -1
  229. package/dist/utils/github-releases.js +1 -1
  230. package/dist/utils/global-cache.js +1 -1
  231. package/dist/utils/json-loader.js +1 -1
  232. package/dist/utils/local-cache.js +1 -1
  233. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  234. package/dist/utils/logger/formatters/index.js +1 -1
  235. package/dist/utils/logger/handlers/console-handler.js +1 -1
  236. package/dist/utils/logger/handlers/file-handler.js +1 -1
  237. package/dist/utils/logger/handlers/index.js +1 -1
  238. package/dist/utils/logger/handlers/null-handler.js +1 -1
  239. package/dist/utils/logger/index.js +1 -1
  240. package/dist/utils/logger/logger.js +1 -1
  241. package/dist/utils/logger/types.js +1 -1
  242. package/dist/utils/option-validation.js +1 -1
  243. package/dist/utils/process.js +1 -1
  244. package/dist/utils/prompt.js +1 -1
  245. package/dist/utils/spinner.js +1 -1
  246. package/dist/utils/sse-parser.js +1 -1
  247. package/dist/utils/string-utils.js +1 -1
  248. package/dist/utils/table-ref-parser.js +1 -1
  249. package/dist/utils/tdx-logger.js +1 -1
  250. package/dist/utils/version-check.js +1 -1
  251. package/package.json +1 -1
  252. package/dist/commands/auth-login-command.d.ts +0 -29
  253. package/dist/commands/auth-login-command.d.ts.map +0 -1
  254. package/dist/commands/auth-login-command.js +0 -1
  255. package/dist/commands/auth-login-command.js.map +0 -1
@@ -1 +1 @@
1
- const a9_0x87750a=a9_0x3237;(function(_0x57693d,_0x20b209){const _0x16a57a=a9_0x3237,_0x541060=_0x57693d();while(!![]){try{const _0x1c6ab0=-parseInt(_0x16a57a(0xeb))/0x1*(-parseInt(_0x16a57a(0x142))/0x2)+-parseInt(_0x16a57a(0x13a))/0x3+-parseInt(_0x16a57a(0xef))/0x4*(parseInt(_0x16a57a(0xf3))/0x5)+parseInt(_0x16a57a(0xf1))/0x6+-parseInt(_0x16a57a(0x108))/0x7+-parseInt(_0x16a57a(0x102))/0x8*(parseInt(_0x16a57a(0xf0))/0x9)+-parseInt(_0x16a57a(0xe8))/0xa*(-parseInt(_0x16a57a(0xda))/0xb);if(_0x1c6ab0===_0x20b209)break;else _0x541060['push'](_0x541060['shift']());}catch(_0xb6d22a){_0x541060['push'](_0x541060['shift']());}}}(a9_0x2147,0x30125));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a9_0x3237(_0x4681b1,_0x5beca6){_0x4681b1=_0x4681b1-0xc9;const _0x2147ad=a9_0x2147();let _0x323741=_0x2147ad[_0x4681b1];return _0x323741;}import a9_0x4f4561 from'chalk';function a9_0x2147(){const _0x52adf4=['verbose','5ORqCaT','Directory\x20not\x20found:\x20','\x20or\x20set\x20context\x20with\x20','cas:pull','\x20audience(s)','error','column','composableAudience','\x20(time:\x20','Running\x20preview\x20for\x20\x27','cwd','\x20composable\x20audiences','Context\x20set:\x20','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','\x20YAML\x20file(s)','32QcEAHd','toLocaleString','masterKeyColumn','attributes','\x20\x20Key:\x20\x20\x20\x20','\x20\x20Table:\x20\x20','2190055LSJPTy','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','counts','yes','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','🧊\x20','data','push','activations','count','Use\x20','content','Error:\x20\x20','cas','yellow','Describe\x20a\x20composable\x20audience','tdx\x20cas\x20desc\x20<name>','schema','audienceName','Behaviors\x20(','Audience\x20name\x20required.','composable_audience','\x20\x20Schema:\x20','Preview\x20composable\x20segment\x20query\x20on\x20CDW','Pull\x20composable\x20audience\x20to\x20YAML\x20files','isNew','masterSchema','dirname','absolutePath','utf-8','masterTable','cyan','files','underline','log','Source:\x20\x20\x20','Master\x20Table','Would\x20push:\x20','segments','name','\x20activations)','timeColumn','join','names','Fetching\x20audience\x20\x27','No\x20composable\x20audiences\x20found.','\x27...','diff','success','\x20segments,\x20','1695FoROSg','(dry\x20run\x20—\x20no\x20files\x20written)','length','\x20segment(s)','tdx\x20cas\x20push\x20<path>','rows','relative','bold','226682KGkkOm','Fetching\x20composable\x20audiences...','\x20=\x20','\x20—\x20','Cancelled.','cas:desc','tdx\x20cas\x20pull\x20<name>','cas:preview','description','basename','Status:\x20','\x20file(s)\x20to\x20write\x20','setPhase','audiences','type','red','--audience\x20<name>','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','relativePath','map','\x20file(s)\x20to\x20','dryRun','1396439aAlSwF','green','hasChanges','\x0aSample\x20Rows\x20(','execute','status','\x20(new)','Wrote\x20','No\x20composable\x20audience\x20specified.','behaviors','dir','Found\x20','population','Audience:\x20','30iQryup','tdx\x20use\x20cas\x20<name>','filter','3HXVjba','pull','dim','Analyzing\x20CAS\x20YAML\x20files...','1553276NOJoDS','202671aHnfKm','1607136KcbJXK'];a9_0x2147=function(){return _0x52adf4;};return a9_0x2147();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a9_0x140ef2 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{[a9_0x87750a(0x12f)]='cas:list';[a9_0x87750a(0xcc)]='List\x20composable\x20audiences';async[a9_0x87750a(0xde)](_0x428a0f){const _0x4e052a=a9_0x87750a,{options:_0x4b9b69,tdx:_0x48bb9d}=_0x428a0f,_0x3b9949=await withProgressSpinner(_0x4e052a(0x143),()=>_0x48bb9d[_0x4e052a(0x115)]['list'](),{'verbose':_0x4b9b69[_0x4e052a(0xf2)]}),_0x2bbb2b=_0x3b9949[_0x4e052a(0x10e)];if(isStructuredFormat(_0x4b9b69))return await handleSDKOutput(_0x2bbb2b,_0x4b9b69),0x0;if(_0x2bbb2b[_0x4e052a(0x13c)]===0x0)return console['log'](a9_0x4f4561[_0x4e052a(0xed)](_0x4e052a(0x135))),0x0;console[_0x4e052a(0x12a)](a9_0x4f4561['green'](_0x4e052a(0xe5)+_0x2bbb2b[_0x4e052a(0x13c)]+_0x4e052a(0xfe)));for(const _0x366b47 of _0x2bbb2b){const _0x2f813d=_0x366b47[_0x4e052a(0xe6)]?a9_0x4f4561[_0x4e052a(0xed)]('\x20('+Number(_0x366b47[_0x4e052a(0xe6)])[_0x4e052a(0x103)]()+')'):'',_0x1b42d7=a9_0x4f4561[_0x4e052a(0xed)]('\x20'+_0x366b47[_0x4e052a(0x122)]+'.'+_0x366b47[_0x4e052a(0x126)]);console[_0x4e052a(0x12a)](_0x4e052a(0x10d)+_0x366b47['name']+_0x2f813d+_0x1b42d7),_0x366b47['description']&&console[_0x4e052a(0x12a)]('\x20\x20'+a9_0x4f4561[_0x4e052a(0xed)](_0x366b47[_0x4e052a(0xcc)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a9_0x87750a(0x12f)]=a9_0x87750a(0xc9);[a9_0x87750a(0xcc)]=a9_0x87750a(0x117);async['execute'](_0x4a85ce){const _0x1fdc5a=a9_0x87750a,{options:_0x32ce64,args:_0x5b8049,tdx:_0x28e379}=_0x4a85ce,_0x5148ae=_0x5b8049[0x0]||_0x32ce64[_0x1fdc5a(0xfa)];if(!_0x5148ae)return console['error'](a9_0x4f4561[_0x1fdc5a(0x116)](_0x1fdc5a(0xe2))),console['error'](_0x1fdc5a(0x112)+a9_0x4f4561[_0x1fdc5a(0x127)](_0x1fdc5a(0x118))+_0x1fdc5a(0xf5)+a9_0x4f4561['cyan'](_0x1fdc5a(0xe9))),0x1;const _0x28fd20=await withProgressSpinner(_0x1fdc5a(0x134)+_0x5148ae+_0x1fdc5a(0x136),()=>_0x28e379[_0x1fdc5a(0x115)]['get'](_0x5148ae),{'verbose':_0x32ce64[_0x1fdc5a(0xf2)]}),_0x4d69bf=_0x28fd20[_0x1fdc5a(0x10e)];if(isStructuredFormat(_0x32ce64))return await handleSingleObjectOutput(_0x4d69bf,_0x32ce64),0x0;console[_0x1fdc5a(0x12a)](a9_0x4f4561[_0x1fdc5a(0x141)](_0x4d69bf[_0x1fdc5a(0x12f)]));if(_0x4d69bf['description'])console[_0x1fdc5a(0x12a)](a9_0x4f4561[_0x1fdc5a(0xed)](_0x4d69bf['description']));console[_0x1fdc5a(0x12a)](),console[_0x1fdc5a(0x12a)](a9_0x4f4561[_0x1fdc5a(0x129)](_0x1fdc5a(0x12c))),console[_0x1fdc5a(0x12a)](_0x1fdc5a(0x11e)+_0x4d69bf[_0x1fdc5a(0x122)]),console[_0x1fdc5a(0x12a)](_0x1fdc5a(0x107)+_0x4d69bf[_0x1fdc5a(0x126)]),console[_0x1fdc5a(0x12a)](_0x1fdc5a(0x106)+_0x4d69bf[_0x1fdc5a(0x104)]),console[_0x1fdc5a(0x12a)]();if(_0x4d69bf[_0x1fdc5a(0x105)]?.[_0x1fdc5a(0x13c)]){console['log'](a9_0x4f4561[_0x1fdc5a(0x129)]('Attributes\x20('+_0x4d69bf[_0x1fdc5a(0x105)][_0x1fdc5a(0x13c)]+')'));for(const _0x1c6790 of _0x4d69bf[_0x1fdc5a(0x105)]){console['log']('\x20\x20'+a9_0x4f4561[_0x1fdc5a(0x141)](_0x1c6790['name'])+_0x1fdc5a(0x145)+_0x1c6790[_0x1fdc5a(0x119)]+'.'+_0x1c6790['table']+'.'+_0x1c6790[_0x1fdc5a(0xf9)]+'\x20('+a9_0x4f4561[_0x1fdc5a(0xed)](_0x1c6790[_0x1fdc5a(0xd2)])+')');}console['log']();}if(_0x4d69bf[_0x1fdc5a(0xe3)]?.[_0x1fdc5a(0x13c)]){console[_0x1fdc5a(0x12a)](a9_0x4f4561[_0x1fdc5a(0x129)](_0x1fdc5a(0x11b)+_0x4d69bf[_0x1fdc5a(0xe3)][_0x1fdc5a(0x13c)]+')'));for(const _0x412a04 of _0x4d69bf[_0x1fdc5a(0xe3)]){const _0x3a6692=_0x412a04[_0x1fdc5a(0x131)]?_0x1fdc5a(0xfb)+_0x412a04[_0x1fdc5a(0x131)]+')':'';console[_0x1fdc5a(0x12a)]('\x20\x20'+a9_0x4f4561[_0x1fdc5a(0x141)](_0x412a04[_0x1fdc5a(0x12f)])+'\x20—\x20'+_0x412a04[_0x1fdc5a(0x119)]+'.'+_0x412a04['table']+_0x3a6692);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a9_0x87750a(0x12f)]=a9_0x87750a(0xf6);[a9_0x87750a(0xcc)]=a9_0x87750a(0x120);async[a9_0x87750a(0xde)](_0x1930d6){const _0x15241b=a9_0x87750a,{options:_0x4e3a57,args:_0x397da6,tdx:_0x3480ec}=_0x1930d6,_0x4489fc=_0x4e3a57,_0x232665=_0x397da6[0x0]||_0x4e3a57[_0x15241b(0xfa)];if(!_0x232665)return console[_0x15241b(0xf8)](a9_0x4f4561[_0x15241b(0x116)](_0x15241b(0xe2))),console[_0x15241b(0xf8)](_0x15241b(0x112)+a9_0x4f4561['cyan'](_0x15241b(0xca))+_0x15241b(0xf5)+a9_0x4f4561['cyan'](_0x15241b(0xe9))),0x1;const _0x3fb0c2=_0x4489fc[_0x15241b(0xe4)]||a9_0x140ef2[_0x15241b(0x132)](process['cwd'](),_0x15241b(0x115),sanitizeFileName(_0x232665)),_0x27580f=await withProgressSpinner('Pulling\x20composable\x20audience\x20\x27'+_0x232665+'\x27...',_0x1e2c9=>_0x3480ec[_0x15241b(0x115)][_0x15241b(0xec)](_0x232665,{'targetDir':_0x3fb0c2,'verbose':_0x4489fc[_0x15241b(0xf2)],'progress':{'update':_0x2abd8c=>_0x1e2c9[_0x15241b(0xd0)](_0x2abd8c)}}),{'verbose':_0x4489fc[_0x15241b(0xf2)]}),_0xe93a0c=_0x27580f['data'],_0xf5f1ff=_0xe93a0c[_0x15241b(0x128)][_0x15241b(0xea)](_0x59b2dd=>_0x59b2dd[_0x15241b(0x121)]||_0x59b2dd[_0x15241b(0xdc)]);saveSessionContext({'composable_audience':_0xe93a0c['audienceName']},_0x4489fc['session']),console['log'](a9_0x4f4561[_0x15241b(0xdb)](_0x15241b(0xff)+a9_0x4f4561[_0x15241b(0xed)](_0x15241b(0x11d))+_0x15241b(0x144)+a9_0x4f4561[_0x15241b(0x127)](_0xe93a0c[_0x15241b(0x11a)])));if(_0xf5f1ff['length']===0x0)return console[_0x15241b(0x12a)](a9_0x4f4561[_0x15241b(0xdb)]('All\x20files\x20are\x20up\x20to\x20date.')),0x0;for(const _0x20c56b of _0xf5f1ff){if(_0x20c56b['isNew'])console[_0x15241b(0x12a)](a9_0x4f4561[_0x15241b(0xdb)]('+\x20'+_0x20c56b[_0x15241b(0xd6)]+_0x15241b(0xe0)));else _0x20c56b[_0x15241b(0x137)]&&(console[_0x15241b(0x12a)](a9_0x4f4561[_0x15241b(0x116)]('~\x20'+_0x20c56b[_0x15241b(0xd6)])),console[_0x15241b(0x12a)](_0x20c56b[_0x15241b(0x137)]));}console[_0x15241b(0x12a)]('\x0a'+_0xf5f1ff['length']+_0x15241b(0xcf)+('('+_0xe93a0c[_0x15241b(0x10a)][_0x15241b(0x12e)]+_0x15241b(0x139)+_0xe93a0c[_0x15241b(0x10a)][_0x15241b(0x110)]+_0x15241b(0x130)));if(_0x4489fc[_0x15241b(0xd9)])return console[_0x15241b(0x12a)](a9_0x4f4561[_0x15241b(0xed)](_0x15241b(0x13b))),0x0;if(!_0x4489fc[_0x15241b(0x10b)]&&isInteractive()){const _0x1a2787=await confirmKey('Write\x20files?');if(!_0x1a2787)return console[_0x15241b(0x12a)](a9_0x4f4561[_0x15241b(0xed)](_0x15241b(0x146))),0x0;}for(const _0x4e003b of _0xf5f1ff){const _0x1988a3=a9_0x140ef2[_0x15241b(0x123)](_0x4e003b['absolutePath']);if(!existsSync(_0x1988a3))mkdirSync(_0x1988a3,{'recursive':!![]});writeFileSync(_0x4e003b[_0x15241b(0x124)],_0x4e003b[_0x15241b(0x113)],_0x15241b(0x125));}return console[_0x15241b(0x12a)](a9_0x4f4561[_0x15241b(0xdb)](_0x15241b(0xe1)+_0xf5f1ff[_0x15241b(0x13c)]+_0x15241b(0xd8)+_0x3fb0c2)),0x0;}}export class CASPushCommand extends BaseCommand{[a9_0x87750a(0x12f)]='cas:push';[a9_0x87750a(0xcc)]='Push\x20YAML\x20files\x20to\x20CAS\x20API';async[a9_0x87750a(0xde)](_0x347f82){const _0x3c655b=a9_0x87750a,{options:_0x287277,args:_0x36be12,tdx:_0x366b6a}=_0x347f82,_0x4a3040=_0x287277;let _0x7075d7=_0x36be12[0x0];!_0x7075d7&&_0x287277[_0x3c655b(0xfa)]&&(_0x7075d7=a9_0x140ef2[_0x3c655b(0x132)](process[_0x3c655b(0xfd)](),'cas',sanitizeFileName(_0x287277['composableAudience'])));if(!_0x7075d7)return console[_0x3c655b(0xf8)](a9_0x4f4561[_0x3c655b(0x116)]('No\x20composable\x20audience\x20specified.')),console['error'](_0x3c655b(0x112)+a9_0x4f4561['cyan'](_0x3c655b(0x13e))+_0x3c655b(0xf5)+a9_0x4f4561['cyan'](_0x3c655b(0xe9))),0x1;if(!existsSync(_0x7075d7))return console[_0x3c655b(0xf8)](a9_0x4f4561['red'](_0x3c655b(0xf4)+_0x7075d7)),console['error'](a9_0x4f4561[_0x3c655b(0xed)](_0x3c655b(0x10c))),0x1;const _0x52c115=_0x287277['composableAudience']||a9_0x140ef2[_0x3c655b(0xcd)](_0x7075d7),_0x3c9fd3=a9_0x140ef2[_0x3c655b(0x140)](process[_0x3c655b(0xfd)](),_0x7075d7)||'.';console[_0x3c655b(0x12a)](_0x3c655b(0xe7)+a9_0x4f4561[_0x3c655b(0x127)](_0x52c115)),console[_0x3c655b(0x12a)](_0x3c655b(0x12b)+a9_0x4f4561[_0x3c655b(0xed)](_0x3c9fd3)),console[_0x3c655b(0x12a)](a9_0x4f4561[_0x3c655b(0x116)](_0x3c655b(0x109))),console[_0x3c655b(0x12a)]();const _0x404fd4=collectYamlFiles(_0x7075d7);if(_0x404fd4[_0x3c655b(0x13c)]===0x0)return console['error'](a9_0x4f4561[_0x3c655b(0xd3)]('No\x20YAML\x20files\x20found\x20in:\x20'+_0x7075d7)),0x1;console[_0x3c655b(0x12a)]('Found\x20'+_0x404fd4[_0x3c655b(0x13c)]+_0x3c655b(0x101));const _0x530db3=await withProgressSpinner(_0x3c655b(0xee),_0x136815=>_0x366b6a[_0x3c655b(0x115)][_0x3c655b(0x10f)](_0x404fd4,{'dryRun':!![],'verbose':_0x4a3040['verbose'],'progress':{'update':_0x20e4ee=>_0x136815[_0x3c655b(0xd0)](_0x20e4ee)}}),{'verbose':_0x4a3040[_0x3c655b(0xf2)]}),_0x45a603=_0x530db3[_0x3c655b(0x10e)],{created:_0x322ed4}=_0x45a603,_0x24dd6f=[];if(_0x322ed4[_0x3c655b(0xd1)])_0x24dd6f[_0x3c655b(0x10f)](_0x322ed4[_0x3c655b(0xd1)]+_0x3c655b(0xf7));if(_0x322ed4[_0x3c655b(0x12e)])_0x24dd6f[_0x3c655b(0x10f)](_0x322ed4[_0x3c655b(0x12e)]+_0x3c655b(0x13d));if(_0x322ed4[_0x3c655b(0x110)])_0x24dd6f[_0x3c655b(0x10f)](_0x322ed4[_0x3c655b(0x110)]+'\x20activation(s)');return _0x24dd6f[_0x3c655b(0x13c)]===0x0?console['log'](a9_0x4f4561['dim'](_0x3c655b(0x100))):console[_0x3c655b(0x12a)](_0x3c655b(0x12d)+_0x24dd6f[_0x3c655b(0x132)](',\x20')),console[_0x3c655b(0x12a)](a9_0x4f4561[_0x3c655b(0xed)](_0x3c655b(0xd5))),0x0;}}export class CASPreviewCommand extends BaseCommand{['name']=a9_0x87750a(0xcb);[a9_0x87750a(0xcc)]=a9_0x87750a(0x11f);async[a9_0x87750a(0xde)](_0xcd6975){const _0x5de2d4=a9_0x87750a,{options:_0x257402,args:_0x28ba3e,tdx:_0x362e01}=_0xcd6975,_0x25f04f=_0x28ba3e[0x0],_0x767b5c=_0x28ba3e[0x1]||_0x257402['composableAudience'];if(!_0x25f04f)return console[_0x5de2d4(0xf8)](a9_0x4f4561[_0x5de2d4(0xd3)]('Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]')),0x1;if(!_0x767b5c)return console['error'](a9_0x4f4561['yellow'](_0x5de2d4(0x11c))),console[_0x5de2d4(0xf8)](_0x5de2d4(0x112)+a9_0x4f4561[_0x5de2d4(0x127)](_0x5de2d4(0xd4))+_0x5de2d4(0xf5)+a9_0x4f4561[_0x5de2d4(0x127)](_0x5de2d4(0xe9))),0x1;const _0xbd9ddb=await withProgressSpinner(_0x5de2d4(0xfc)+_0x25f04f+'\x27...',()=>_0x362e01[_0x5de2d4(0x115)]['preview'](_0x767b5c,_0x25f04f),{'verbose':_0x257402['verbose']}),{query:_0x41ddc7,customers:_0x5b1348}=_0xbd9ddb[_0x5de2d4(0x10e)];if(isStructuredFormat(_0x257402))return await handleSingleObjectOutput({'query':_0x41ddc7,'customers':_0x5b1348},_0x257402),0x0;const _0x4ab524=_0x41ddc7[_0x5de2d4(0xdf)]===_0x5de2d4(0x138)?a9_0x4f4561[_0x5de2d4(0xdb)]:a9_0x4f4561[_0x5de2d4(0x116)];console[_0x5de2d4(0x12a)](_0x5de2d4(0xce)+_0x4ab524(_0x41ddc7[_0x5de2d4(0xdf)])),console[_0x5de2d4(0x12a)]('Count:\x20\x20'+a9_0x4f4561[_0x5de2d4(0x141)](String(_0x41ddc7[_0x5de2d4(0x111)])));_0x41ddc7[_0x5de2d4(0xf8)]&&console[_0x5de2d4(0x12a)](_0x5de2d4(0x114)+a9_0x4f4561[_0x5de2d4(0xd3)](_0x41ddc7[_0x5de2d4(0xf8)]));if(_0x5b1348?.['names']&&_0x5b1348?.[_0x5de2d4(0x13f)]){console[_0x5de2d4(0x12a)](a9_0x4f4561['underline'](_0x5de2d4(0xdd)+_0x5b1348[_0x5de2d4(0x13f)][_0x5de2d4(0x13c)]+')'));const _0xcaa67d=_0x5b1348['rows'][_0x5de2d4(0xd7)](_0x3b925e=>{const _0x5094d8=_0x5de2d4,_0x3e2cc8={};for(let _0x4ef5bd=0x0;_0x4ef5bd<_0x5b1348[_0x5094d8(0x133)][_0x5094d8(0x13c)];_0x4ef5bd++){_0x3e2cc8[_0x5b1348[_0x5094d8(0x133)][_0x4ef5bd]]=_0x3b925e[_0x4ef5bd];}return _0x3e2cc8;});await handleSDKOutput(_0xcaa67d,_0x257402);}return 0x0;}}
1
+ const a8_0x72b2f8=a8_0x58db;(function(_0x3a1654,_0x4659c9){const _0x15cac9=a8_0x58db,_0x17677b=_0x3a1654();while(!![]){try{const _0x172117=-parseInt(_0x15cac9(0x1b5))/0x1+-parseInt(_0x15cac9(0x1a9))/0x2+-parseInt(_0x15cac9(0x18c))/0x3*(parseInt(_0x15cac9(0x192))/0x4)+parseInt(_0x15cac9(0x1cf))/0x5*(-parseInt(_0x15cac9(0x1e3))/0x6)+parseInt(_0x15cac9(0x1c7))/0x7*(-parseInt(_0x15cac9(0x1d4))/0x8)+parseInt(_0x15cac9(0x1df))/0x9+parseInt(_0x15cac9(0x1ef))/0xa*(parseInt(_0x15cac9(0x1c9))/0xb);if(_0x172117===_0x4659c9)break;else _0x17677b['push'](_0x17677b['shift']());}catch(_0x12e1d9){_0x17677b['push'](_0x17677b['shift']());}}}(a8_0x4adb,0x4fe4b));import{BaseCommand}from'./command.js';function a8_0x4adb(){const _0x1abfe2=['\x0aSample\x20Rows\x20(','Fetching\x20composable\x20audiences...','population','content','session','Pull\x20composable\x20audience\x20to\x20YAML\x20files','\x20YAML\x20file(s)','Error:\x20\x20','Fetching\x20audience\x20\x27','814314XGKHAs','cas:preview','Found\x20','Context\x20set:\x20','\x20file(s)\x20to\x20write\x20','dim','4dsugrR','setPhase','names','cas:list','Use\x20','toLocaleString','Audience\x20name\x20required.','pull','Preview\x20composable\x20segment\x20query\x20on\x20CDW','get','push','No\x20composable\x20audience\x20specified.','\x20\x20Schema:\x20','green','No\x20YAML\x20files\x20found\x20in:\x20','behaviors','audiences','Would\x20push:\x20','dirname','masterTable','filter','Master\x20Table','\x20(time:\x20','1130998jQnswG','Attributes\x20(','Count:\x20\x20','type','counts','error','count','red','Pulling\x20composable\x20audience\x20\x27','log','masterSchema','\x20segment(s)','559953rGzYTH','cyan','composableAudience','cwd','Analyzing\x20CAS\x20YAML\x20files...','\x27...','\x20activations)','Source:\x20\x20\x20','table','attributes','description','schema','🧊\x20','\x20audience(s)','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','tdx\x20cas\x20desc\x20<name>','timeColumn','tdx\x20cas\x20pull\x20<name>','7nNonHQ','list','77Rzucgh','data','length','underline','tdx\x20cas\x20push\x20<path>','cas','5JVDsGB','diff','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','rows','2618904TwhcHN','Directory\x20not\x20found:\x20','tdx\x20use\x20cas\x20<name>','masterKeyColumn','hasChanges','verbose','cas:desc','basename','files','cas:push','bold','3194244JhQvBB','yellow','dryRun','yes','2078346HDxBEH','\x20=\x20','No\x20composable\x20audiences\x20found.','All\x20files\x20are\x20up\x20to\x20date.','(dry\x20run\x20—\x20no\x20files\x20written)','activations','absolutePath','\x20—\x20','Behaviors\x20(','join','Describe\x20a\x20composable\x20audience','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','2918530pGJtWE','segments','success','\x20or\x20set\x20context\x20with\x20','isNew','name','execute','utf-8','\x20segments,\x20','relativePath','Running\x20preview\x20for\x20\x27'];a8_0x4adb=function(){return _0x1abfe2;};return a8_0x4adb();}import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x498081 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x27b4b3 from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';import{collectYamlFiles}from'../sdk/cas/push-workflow.js';import{saveSessionContext}from'../core/session.js';function a8_0x58db(_0x3078de,_0x577530){_0x3078de=_0x3078de-0x17d;const _0x4adb23=a8_0x4adb();let _0x58dbca=_0x4adb23[_0x3078de];return _0x58dbca;}import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]=a8_0x72b2f8(0x195);[a8_0x72b2f8(0x1bf)]='List\x20composable\x20audiences';async[a8_0x72b2f8(0x17e)](_0x4124e1){const _0x41dd4f=a8_0x72b2f8,{options:_0x1b8856,tdx:_0x4619ff}=_0x4124e1,_0x4c6b89=await withProgressSpinner(_0x41dd4f(0x184),()=>_0x4619ff['cas'][_0x41dd4f(0x1c8)](),{'verbose':_0x1b8856[_0x41dd4f(0x1d9)]}),_0x14879d=_0x4c6b89['data'];if(isStructuredFormat(_0x1b8856))return await handleSDKOutput(_0x14879d,_0x1b8856),0x0;if(_0x14879d[_0x41dd4f(0x1cb)]===0x0)return console[_0x41dd4f(0x1b2)](a8_0x498081[_0x41dd4f(0x191)](_0x41dd4f(0x1e5))),0x0;console['log'](a8_0x498081[_0x41dd4f(0x19f)](_0x41dd4f(0x18e)+_0x14879d[_0x41dd4f(0x1cb)]+'\x20composable\x20audiences'));for(const _0x209d42 of _0x14879d){const _0x53c580=_0x209d42[_0x41dd4f(0x185)]?a8_0x498081['dim']('\x20('+Number(_0x209d42['population'])[_0x41dd4f(0x197)]()+')'):'',_0x2432cc=a8_0x498081['dim']('\x20'+_0x209d42[_0x41dd4f(0x1b3)]+'.'+_0x209d42['masterTable']);console['log'](_0x41dd4f(0x1c1)+_0x209d42[_0x41dd4f(0x17d)]+_0x53c580+_0x2432cc),_0x209d42['description']&&console[_0x41dd4f(0x1b2)]('\x20\x20'+a8_0x498081[_0x41dd4f(0x191)](_0x209d42[_0x41dd4f(0x1bf)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]=a8_0x72b2f8(0x1da);[a8_0x72b2f8(0x1bf)]=a8_0x72b2f8(0x1ed);async[a8_0x72b2f8(0x17e)](_0x2d5395){const _0x22a251=a8_0x72b2f8,{options:_0x5d8e2d,args:_0x108018,tdx:_0x283403}=_0x2d5395,_0x2c7139=_0x108018[0x0]||_0x5d8e2d['composableAudience'];if(!_0x2c7139)return console[_0x22a251(0x1ae)](a8_0x498081[_0x22a251(0x1e0)](_0x22a251(0x19d))),console[_0x22a251(0x1ae)]('Use\x20'+a8_0x498081['cyan'](_0x22a251(0x1c4))+_0x22a251(0x1f2)+a8_0x498081[_0x22a251(0x1b6)](_0x22a251(0x1d6))),0x1;const _0x4767f4=await withProgressSpinner(_0x22a251(0x18b)+_0x2c7139+_0x22a251(0x1ba),()=>_0x283403['cas'][_0x22a251(0x19b)](_0x2c7139),{'verbose':_0x5d8e2d[_0x22a251(0x1d9)]}),_0x10c43b=_0x4767f4['data'];if(isStructuredFormat(_0x5d8e2d))return await handleSingleObjectOutput(_0x10c43b,_0x5d8e2d),0x0;console[_0x22a251(0x1b2)](a8_0x498081[_0x22a251(0x1de)](_0x10c43b['name']));if(_0x10c43b['description'])console[_0x22a251(0x1b2)](a8_0x498081[_0x22a251(0x191)](_0x10c43b[_0x22a251(0x1bf)]));console[_0x22a251(0x1b2)](),console[_0x22a251(0x1b2)](a8_0x498081[_0x22a251(0x1cc)](_0x22a251(0x1a7))),console[_0x22a251(0x1b2)](_0x22a251(0x19e)+_0x10c43b['masterSchema']),console['log']('\x20\x20Table:\x20\x20'+_0x10c43b[_0x22a251(0x1a5)]),console[_0x22a251(0x1b2)]('\x20\x20Key:\x20\x20\x20\x20'+_0x10c43b[_0x22a251(0x1d7)]),console[_0x22a251(0x1b2)]();if(_0x10c43b['attributes']?.[_0x22a251(0x1cb)]){console[_0x22a251(0x1b2)](a8_0x498081['underline'](_0x22a251(0x1aa)+_0x10c43b[_0x22a251(0x1be)][_0x22a251(0x1cb)]+')'));for(const _0x155833 of _0x10c43b[_0x22a251(0x1be)]){console[_0x22a251(0x1b2)]('\x20\x20'+a8_0x498081[_0x22a251(0x1de)](_0x155833['name'])+'\x20—\x20'+_0x155833['schema']+'.'+_0x155833[_0x22a251(0x1bd)]+'.'+_0x155833['column']+'\x20('+a8_0x498081[_0x22a251(0x191)](_0x155833[_0x22a251(0x1ac)])+')');}console['log']();}if(_0x10c43b[_0x22a251(0x1a1)]?.[_0x22a251(0x1cb)]){console['log'](a8_0x498081[_0x22a251(0x1cc)](_0x22a251(0x1eb)+_0x10c43b[_0x22a251(0x1a1)][_0x22a251(0x1cb)]+')'));for(const _0x39b920 of _0x10c43b[_0x22a251(0x1a1)]){const _0x4de21b=_0x39b920[_0x22a251(0x1c5)]?_0x22a251(0x1a8)+_0x39b920['timeColumn']+')':'';console[_0x22a251(0x1b2)]('\x20\x20'+a8_0x498081[_0x22a251(0x1de)](_0x39b920[_0x22a251(0x17d)])+_0x22a251(0x1ea)+_0x39b920[_0x22a251(0x1c0)]+'.'+_0x39b920[_0x22a251(0x1bd)]+_0x4de21b);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]='cas:pull';[a8_0x72b2f8(0x1bf)]=a8_0x72b2f8(0x188);async[a8_0x72b2f8(0x17e)](_0x3cd2da){const _0x4f8dee=a8_0x72b2f8,{options:_0x5a8dd2,args:_0x2e9734,tdx:_0x3a4d4e}=_0x3cd2da,_0x38bca0=_0x5a8dd2,_0x3d3888=_0x2e9734[0x0]||_0x5a8dd2[_0x4f8dee(0x1b7)];if(!_0x3d3888)return console['error'](a8_0x498081[_0x4f8dee(0x1e0)](_0x4f8dee(0x19d))),console['error'](_0x4f8dee(0x196)+a8_0x498081[_0x4f8dee(0x1b6)](_0x4f8dee(0x1c6))+_0x4f8dee(0x1f2)+a8_0x498081[_0x4f8dee(0x1b6)](_0x4f8dee(0x1d6))),0x1;const _0x1ae2a1=_0x38bca0['dir']||a8_0x27b4b3[_0x4f8dee(0x1ec)](process[_0x4f8dee(0x1b8)](),_0x4f8dee(0x1ce),sanitizeFileName(_0x3d3888)),_0x5cda9e=await withProgressSpinner(_0x4f8dee(0x1b1)+_0x3d3888+'\x27...',_0x3f04ac=>_0x3a4d4e['cas'][_0x4f8dee(0x199)](_0x3d3888,{'targetDir':_0x1ae2a1,'verbose':_0x38bca0[_0x4f8dee(0x1d9)],'progress':{'update':_0x47074d=>_0x3f04ac[_0x4f8dee(0x193)](_0x47074d)}}),{'verbose':_0x38bca0[_0x4f8dee(0x1d9)]}),_0x3b3892=_0x5cda9e[_0x4f8dee(0x1ca)],_0xe60691=_0x3b3892[_0x4f8dee(0x1dc)][_0x4f8dee(0x1a6)](_0x2da598=>_0x2da598[_0x4f8dee(0x1f3)]||_0x2da598[_0x4f8dee(0x1d8)]);saveSessionContext({'composable_audience':_0x3b3892['audienceName']},_0x38bca0[_0x4f8dee(0x187)]),console[_0x4f8dee(0x1b2)](a8_0x498081['green'](_0x4f8dee(0x18f)+a8_0x498081['dim']('composable_audience')+_0x4f8dee(0x1e4)+a8_0x498081[_0x4f8dee(0x1b6)](_0x3b3892['audienceName'])));if(_0xe60691[_0x4f8dee(0x1cb)]===0x0)return console[_0x4f8dee(0x1b2)](a8_0x498081[_0x4f8dee(0x19f)](_0x4f8dee(0x1e6))),0x0;for(const _0x2aa2a5 of _0xe60691){if(_0x2aa2a5['isNew'])console[_0x4f8dee(0x1b2)](a8_0x498081[_0x4f8dee(0x19f)]('+\x20'+_0x2aa2a5[_0x4f8dee(0x181)]+'\x20(new)'));else _0x2aa2a5[_0x4f8dee(0x1d0)]&&(console[_0x4f8dee(0x1b2)](a8_0x498081[_0x4f8dee(0x1e0)]('~\x20'+_0x2aa2a5['relativePath'])),console['log'](_0x2aa2a5['diff']));}console[_0x4f8dee(0x1b2)]('\x0a'+_0xe60691[_0x4f8dee(0x1cb)]+_0x4f8dee(0x190)+('('+_0x3b3892[_0x4f8dee(0x1ad)][_0x4f8dee(0x1f0)]+_0x4f8dee(0x180)+_0x3b3892['counts']['activations']+_0x4f8dee(0x1bb)));if(_0x38bca0[_0x4f8dee(0x1e1)])return console[_0x4f8dee(0x1b2)](a8_0x498081[_0x4f8dee(0x191)](_0x4f8dee(0x1e7))),0x0;if(!_0x38bca0[_0x4f8dee(0x1e2)]&&isInteractive()){const _0x2b3c7a=await confirmKey('Write\x20files?');if(!_0x2b3c7a)return console['log'](a8_0x498081[_0x4f8dee(0x191)]('Cancelled.')),0x0;}for(const _0x240dba of _0xe60691){const _0x318a78=a8_0x27b4b3[_0x4f8dee(0x1a4)](_0x240dba[_0x4f8dee(0x1e9)]);if(!existsSync(_0x318a78))mkdirSync(_0x318a78,{'recursive':!![]});writeFileSync(_0x240dba[_0x4f8dee(0x1e9)],_0x240dba[_0x4f8dee(0x186)],_0x4f8dee(0x17f));}return console[_0x4f8dee(0x1b2)](a8_0x498081['green']('Wrote\x20'+_0xe60691[_0x4f8dee(0x1cb)]+'\x20file(s)\x20to\x20'+_0x1ae2a1)),0x0;}}export class CASPushCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]=a8_0x72b2f8(0x1dd);[a8_0x72b2f8(0x1bf)]='Push\x20YAML\x20files\x20to\x20CAS\x20API';async['execute'](_0x272e25){const _0x2d3a51=a8_0x72b2f8,{options:_0x5f1ea2,args:_0x54a252,tdx:_0x617223}=_0x272e25,_0x126a20=_0x5f1ea2;let _0x487953=_0x54a252[0x0];!_0x487953&&_0x5f1ea2[_0x2d3a51(0x1b7)]&&(_0x487953=a8_0x27b4b3[_0x2d3a51(0x1ec)](process['cwd'](),_0x2d3a51(0x1ce),sanitizeFileName(_0x5f1ea2[_0x2d3a51(0x1b7)])));if(!_0x487953)return console['error'](a8_0x498081['yellow']('No\x20composable\x20audience\x20specified.')),console[_0x2d3a51(0x1ae)]('Use\x20'+a8_0x498081[_0x2d3a51(0x1b6)](_0x2d3a51(0x1cd))+_0x2d3a51(0x1f2)+a8_0x498081[_0x2d3a51(0x1b6)](_0x2d3a51(0x1d6))),0x1;if(!existsSync(_0x487953))return console[_0x2d3a51(0x1ae)](a8_0x498081[_0x2d3a51(0x1b0)](_0x2d3a51(0x1d5)+_0x487953)),console[_0x2d3a51(0x1ae)](a8_0x498081[_0x2d3a51(0x191)](_0x2d3a51(0x1d2))),0x1;const _0x127929=_0x5f1ea2[_0x2d3a51(0x1b7)]||a8_0x27b4b3[_0x2d3a51(0x1db)](_0x487953),_0x1810e3=a8_0x27b4b3['relative'](process[_0x2d3a51(0x1b8)](),_0x487953)||'.';console[_0x2d3a51(0x1b2)]('Audience:\x20'+a8_0x498081[_0x2d3a51(0x1b6)](_0x127929)),console['log'](_0x2d3a51(0x1bc)+a8_0x498081[_0x2d3a51(0x191)](_0x1810e3)),console[_0x2d3a51(0x1b2)](a8_0x498081['yellow'](_0x2d3a51(0x1c3))),console[_0x2d3a51(0x1b2)]();const _0x3d73e0=collectYamlFiles(_0x487953);if(_0x3d73e0[_0x2d3a51(0x1cb)]===0x0)return console['error'](a8_0x498081[_0x2d3a51(0x1b0)](_0x2d3a51(0x1a0)+_0x487953)),0x1;console[_0x2d3a51(0x1b2)](_0x2d3a51(0x18e)+_0x3d73e0[_0x2d3a51(0x1cb)]+_0x2d3a51(0x189));const _0x411a8d=await withProgressSpinner(_0x2d3a51(0x1b9),_0x198c34=>_0x617223['cas'][_0x2d3a51(0x19c)](_0x3d73e0,{'dryRun':!![],'verbose':_0x126a20[_0x2d3a51(0x1d9)],'progress':{'update':_0xa655b9=>_0x198c34[_0x2d3a51(0x193)](_0xa655b9)}}),{'verbose':_0x126a20['verbose']}),_0x4aba59=_0x411a8d[_0x2d3a51(0x1ca)],{created:_0x372a10}=_0x4aba59,_0x1a6a1d=[];if(_0x372a10[_0x2d3a51(0x1a2)])_0x1a6a1d['push'](_0x372a10[_0x2d3a51(0x1a2)]+_0x2d3a51(0x1c2));if(_0x372a10[_0x2d3a51(0x1f0)])_0x1a6a1d['push'](_0x372a10[_0x2d3a51(0x1f0)]+_0x2d3a51(0x1b4));if(_0x372a10['activations'])_0x1a6a1d[_0x2d3a51(0x19c)](_0x372a10[_0x2d3a51(0x1e8)]+'\x20activation(s)');return _0x1a6a1d[_0x2d3a51(0x1cb)]===0x0?console['log'](a8_0x498081[_0x2d3a51(0x191)](_0x2d3a51(0x1ee))):console[_0x2d3a51(0x1b2)](_0x2d3a51(0x1a3)+_0x1a6a1d[_0x2d3a51(0x1ec)](',\x20')),console[_0x2d3a51(0x1b2)](a8_0x498081[_0x2d3a51(0x191)](_0x2d3a51(0x1d1))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]=a8_0x72b2f8(0x18d);['description']=a8_0x72b2f8(0x19a);async[a8_0x72b2f8(0x17e)](_0x153544){const _0x36b5da=a8_0x72b2f8,{options:_0x290c54,args:_0x490829,tdx:_0x5b85ac}=_0x153544,_0x2ea009=_0x490829[0x0],_0x5bd30a=_0x490829[0x1]||_0x290c54[_0x36b5da(0x1b7)];if(!_0x2ea009)return console['error'](a8_0x498081['red']('Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]')),0x1;if(!_0x5bd30a)return console[_0x36b5da(0x1ae)](a8_0x498081[_0x36b5da(0x1e0)](_0x36b5da(0x198))),console[_0x36b5da(0x1ae)](_0x36b5da(0x196)+a8_0x498081['cyan']('--audience\x20<name>')+_0x36b5da(0x1f2)+a8_0x498081['cyan']('tdx\x20use\x20cas\x20<name>')),0x1;const _0x70a42c=await withProgressSpinner(_0x36b5da(0x182)+_0x2ea009+_0x36b5da(0x1ba),()=>_0x5b85ac[_0x36b5da(0x1ce)]['preview'](_0x5bd30a,_0x2ea009),{'verbose':_0x290c54[_0x36b5da(0x1d9)]}),{query:_0x1730eb,customers:_0x53915f}=_0x70a42c[_0x36b5da(0x1ca)];if(isStructuredFormat(_0x290c54))return await handleSingleObjectOutput({'query':_0x1730eb,'customers':_0x53915f},_0x290c54),0x0;const _0x32e1fa=_0x1730eb['status']===_0x36b5da(0x1f1)?a8_0x498081[_0x36b5da(0x19f)]:a8_0x498081[_0x36b5da(0x1e0)];console[_0x36b5da(0x1b2)]('Status:\x20'+_0x32e1fa(_0x1730eb['status'])),console[_0x36b5da(0x1b2)](_0x36b5da(0x1ab)+a8_0x498081[_0x36b5da(0x1de)](String(_0x1730eb[_0x36b5da(0x1af)])));_0x1730eb[_0x36b5da(0x1ae)]&&console['log'](_0x36b5da(0x18a)+a8_0x498081['red'](_0x1730eb[_0x36b5da(0x1ae)]));if(_0x53915f?.[_0x36b5da(0x194)]&&_0x53915f?.[_0x36b5da(0x1d3)]){console[_0x36b5da(0x1b2)](a8_0x498081[_0x36b5da(0x1cc)](_0x36b5da(0x183)+_0x53915f['rows'][_0x36b5da(0x1cb)]+')'));const _0x4e4857=_0x53915f[_0x36b5da(0x1d3)]['map'](_0x3aadac=>{const _0x3d7a49=_0x36b5da,_0x3460c5={};for(let _0x3b9384=0x0;_0x3b9384<_0x53915f[_0x3d7a49(0x194)][_0x3d7a49(0x1cb)];_0x3b9384++){_0x3460c5[_0x53915f[_0x3d7a49(0x194)][_0x3b9384]]=_0x3aadac[_0x3b9384];}return _0x3460c5;});await handleSDKOutput(_0x4e4857,_0x290c54);}return 0x0;}}
@@ -1 +1 @@
1
- const a10_0x2a519d=a10_0x3da1;(function(_0x27258f,_0x49f86b){const _0xeb4c27=a10_0x3da1,_0x2ac59e=_0x27258f();while(!![]){try{const _0x2844a7=parseInt(_0xeb4c27(0x12b))/0x1+parseInt(_0xeb4c27(0x11a))/0x2+parseInt(_0xeb4c27(0x117))/0x3*(-parseInt(_0xeb4c27(0x10e))/0x4)+parseInt(_0xeb4c27(0x11f))/0x5*(parseInt(_0xeb4c27(0x110))/0x6)+parseInt(_0xeb4c27(0x114))/0x7+parseInt(_0xeb4c27(0x11e))/0x8*(-parseInt(_0xeb4c27(0x118))/0x9)+-parseInt(_0xeb4c27(0x128))/0xa*(-parseInt(_0xeb4c27(0x123))/0xb);if(_0x2844a7===_0x49f86b)break;else _0x2ac59e['push'](_0x2ac59e['shift']());}catch(_0x20e97c){_0x2ac59e['push'](_0x2ac59e['shift']());}}}(a10_0x5e4d,0x8e031));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a10_0x3da1(_0x22ffb6,_0x5ee935){_0x22ffb6=_0x22ffb6-0x10d;const _0x5e4d88=a10_0x5e4d();let _0x3da106=_0x5e4d88[_0x22ffb6];return _0x3da106;}import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a10_0x5e4d(){const _0x4b7b0f=['256855DAiaqi','execute','Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>','Fetching\x20segments\x20for\x20\x27','1211661fbsiog','error','🎯\x20','log','dim','50agmfBU','green','Found\x20','136936vHWowb','description','8cUNRFp','name','102GHMbXl','\x27...','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','verbose','7708491VcsxHy','red','\x20segment','1739004xiWRPI','923202lHcxZo','length','209172TAXQWc','cas','population','listSegments','80cRyOlQ'];a10_0x5e4d=function(){return _0x4b7b0f;};return a10_0x5e4d();}import{formatRows}from'../sdk/util/formatters.js';import a10_0x1a53a5 from'chalk';export class CASSegmentListCommand extends BaseCommand{[a10_0x2a519d(0x10f)]='cas:sg:list';['description']='List\x20composable\x20segments\x20for\x20an\x20audience';async[a10_0x2a519d(0x120)](_0x299a3c){const _0x5eb740=a10_0x2a519d,{options:_0x5a1bea,args:_0x572125,tdx:_0x16b31f}=_0x299a3c,_0x1c5b82=_0x572125[0x0]||_0x5a1bea['composableAudience'];if(!_0x1c5b82)return console['error'](a10_0x1a53a5[_0x5eb740(0x115)](_0x5eb740(0x112))),console[_0x5eb740(0x124)](a10_0x1a53a5[_0x5eb740(0x127)](_0x5eb740(0x121))),0x1;const _0x50cdf9=await withProgressSpinner(_0x5eb740(0x122)+_0x1c5b82+_0x5eb740(0x111),()=>_0x16b31f[_0x5eb740(0x11b)][_0x5eb740(0x11d)](_0x1c5b82),{'verbose':_0x5a1bea[_0x5eb740(0x113)]}),_0x18b3ed=_0x50cdf9['data'];if(isStructuredFormat(_0x5a1bea))return await handleSDKOutput(_0x18b3ed,_0x5a1bea),0x0;console[_0x5eb740(0x126)](a10_0x1a53a5[_0x5eb740(0x129)](_0x5eb740(0x12a)+_0x18b3ed[_0x5eb740(0x119)]+_0x5eb740(0x116)+(_0x18b3ed['length']!==0x1?'s':'')));if(_0x18b3ed[_0x5eb740(0x119)]===0x0)return 0x0;for(const _0x3cc728 of _0x18b3ed){const _0xc8e001=_0x3cc728[_0x5eb740(0x11c)]!=null?a10_0x1a53a5[_0x5eb740(0x127)]('\x20('+formatRows(_0x3cc728[_0x5eb740(0x11c)])+')'):'';console[_0x5eb740(0x126)](_0x5eb740(0x125)+_0x3cc728[_0x5eb740(0x10f)]+_0xc8e001),_0x3cc728[_0x5eb740(0x10d)]&&console[_0x5eb740(0x126)]('\x20\x20'+a10_0x1a53a5[_0x5eb740(0x127)](_0x3cc728[_0x5eb740(0x10d)]));}return 0x0;}}
1
+ const a9_0x5efec6=a9_0x6974;(function(_0x521663,_0x311e59){const _0x2f3ca2=a9_0x6974,_0x3429af=_0x521663();while(!![]){try{const _0x2f0fe2=parseInt(_0x2f3ca2(0x9e))/0x1*(-parseInt(_0x2f3ca2(0x9f))/0x2)+parseInt(_0x2f3ca2(0x92))/0x3+parseInt(_0x2f3ca2(0x8b))/0x4+parseInt(_0x2f3ca2(0x93))/0x5*(-parseInt(_0x2f3ca2(0x8c))/0x6)+parseInt(_0x2f3ca2(0x99))/0x7*(-parseInt(_0x2f3ca2(0x90))/0x8)+parseInt(_0x2f3ca2(0x96))/0x9*(parseInt(_0x2f3ca2(0x8f))/0xa)+-parseInt(_0x2f3ca2(0x9c))/0xb;if(_0x2f0fe2===_0x311e59)break;else _0x3429af['push'](_0x3429af['shift']());}catch(_0x2eb52a){_0x3429af['push'](_0x3429af['shift']());}}}(a9_0x556d,0x2e21d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a9_0x556d(){const _0x4744e1=['451995XgMzHM','330rOLwcS','description','List\x20composable\x20segments\x20for\x20an\x20audience','13437RfnQFM','cas','length','98iRxrMx','error','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','1757393caKaRA','cas:sg:list','20533KGwVFF','4ISvqAC','population','name','composableAudience','dim','execute','\x20segment','🎯\x20','Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>','listSegments','log','885712wsVIKH','15612iMfDZv','red','Found\x20','2230NdhVKz','82008qgwzQF','Fetching\x20segments\x20for\x20\x27'];a9_0x556d=function(){return _0x4744e1;};return a9_0x556d();}import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a9_0x6974(_0x21be49,_0x3af53e){_0x21be49=_0x21be49-0x82;const _0x556d05=a9_0x556d();let _0x6974b0=_0x556d05[_0x21be49];return _0x6974b0;}import{formatRows}from'../sdk/util/formatters.js';import a9_0x1a450a from'chalk';export class CASSegmentListCommand extends BaseCommand{[a9_0x5efec6(0x82)]=a9_0x5efec6(0x9d);[a9_0x5efec6(0x94)]=a9_0x5efec6(0x95);async[a9_0x5efec6(0x85)](_0x2b4822){const _0x5401bb=a9_0x5efec6,{options:_0x27ede3,args:_0x2b7b22,tdx:_0x1cc6f5}=_0x2b4822,_0x5b9572=_0x2b7b22[0x0]||_0x27ede3[_0x5401bb(0x83)];if(!_0x5b9572)return console['error'](a9_0x1a450a[_0x5401bb(0x8d)](_0x5401bb(0x9b))),console[_0x5401bb(0x9a)](a9_0x1a450a['dim'](_0x5401bb(0x88))),0x1;const _0x2b2fb3=await withProgressSpinner(_0x5401bb(0x91)+_0x5b9572+'\x27...',()=>_0x1cc6f5[_0x5401bb(0x97)][_0x5401bb(0x89)](_0x5b9572),{'verbose':_0x27ede3['verbose']}),_0x59e0c0=_0x2b2fb3['data'];if(isStructuredFormat(_0x27ede3))return await handleSDKOutput(_0x59e0c0,_0x27ede3),0x0;console[_0x5401bb(0x8a)](a9_0x1a450a['green'](_0x5401bb(0x8e)+_0x59e0c0[_0x5401bb(0x98)]+_0x5401bb(0x86)+(_0x59e0c0[_0x5401bb(0x98)]!==0x1?'s':'')));if(_0x59e0c0[_0x5401bb(0x98)]===0x0)return 0x0;for(const _0x10ddcf of _0x59e0c0){const _0x34cb2b=_0x10ddcf['population']!=null?a9_0x1a450a[_0x5401bb(0x84)]('\x20('+formatRows(_0x10ddcf[_0x5401bb(0xa0)])+')'):'';console[_0x5401bb(0x8a)](_0x5401bb(0x87)+_0x10ddcf[_0x5401bb(0x82)]+_0x34cb2b),_0x10ddcf['description']&&console['log']('\x20\x20'+a9_0x1a450a[_0x5401bb(0x84)](_0x10ddcf[_0x5401bb(0x94)]));}return 0x0;}}
@@ -1 +1 @@
1
- const a11_0x1bf7ea=a11_0x3fa9;(function(_0x5b490f,_0x2c3cc5){const _0x1d43cf=a11_0x3fa9,_0x689dd9=_0x5b490f();while(!![]){try{const _0x2b2497=-parseInt(_0x1d43cf(0x1ee))/0x1+-parseInt(_0x1d43cf(0x21f))/0x2+parseInt(_0x1d43cf(0x1e8))/0x3+-parseInt(_0x1d43cf(0x22f))/0x4*(-parseInt(_0x1d43cf(0x221))/0x5)+-parseInt(_0x1d43cf(0x200))/0x6+parseInt(_0x1d43cf(0x1fc))/0x7+parseInt(_0x1d43cf(0x228))/0x8*(parseInt(_0x1d43cf(0x1fd))/0x9);if(_0x2b2497===_0x2c3cc5)break;else _0x689dd9['push'](_0x689dd9['shift']());}catch(_0x8206a5){_0x689dd9['push'](_0x689dd9['shift']());}}}(a11_0x1f24,0xdf5c5));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a11_0x1f24(){const _0x2476ed=['llmProject','message','3036162LWoQgA','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','4040990aPOOie','streamChat','Resolving\x20project\x20\x27','write','\x27...','join','agent','672KLvVBT','Using\x20cached\x20default\x20agent:\x20','Create\x20a\x20new\x20chat\x20session','log','string','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','chatId','4SdDNuB','Using\x20agent\x20from\x20','error','tool','name','targetKnowledgeBase','data','agentId','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','targetAgent','chat-create','\x20\x20Cause:\x20','Getting\x20default\x20agent...','tool_result','3483051ZUFCJO','handleChatEvent','code','404','Continuing\x20chat:\x20','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','905752pyLoLX','targetFunction','streamChatJsonl','new','projectId','done','Error:\x20','startChat','execute','content','llmAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','stringify','Resolving\x20agent\x20\x27','5398967qgovNm','101655DnBaQi','cause','options','2103348PcVgpQ','site','Error:\x20Chat\x20session\x20\x27','Chat\x20session:\x20','targetWebSearchTool','tool_call','CHAT_NOT_FOUND','context','functionName','stdout','metadata','includes','session\x20context','\x0aStack\x20trace:','--agent\x20flag','args','llm','verbose','stack','event','\x0aError:\x20','claude-4.5-haiku','\x27\x20not\x20found','type','description','chat','validate','getOrCreateDefaultAgent','resolveAgentId'];a11_0x1f24=function(){return _0x2476ed;};return a11_0x1f24();}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function a11_0x3fa9(_0x39a9ce,_0x3f0877){_0x39a9ce=_0x39a9ce-0x1de;const _0x1f24c9=a11_0x1f24();let _0x3fa953=_0x1f24c9[_0x39a9ce];return _0x3fa953;}import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x49fc8d,_0x39344c){const _0x302a03=a11_0x3fa9;if(_0x49fc8d instanceof SDKError)console['error'](_0x302a03(0x1f4)+_0x49fc8d['message']),_0x39344c[_0x302a03(0x211)]&&(_0x49fc8d[_0x302a03(0x1fe)]&&console[_0x302a03(0x231)](_0x302a03(0x1e5)+_0x49fc8d[_0x302a03(0x1fe)]),_0x49fc8d[_0x302a03(0x212)]&&(console[_0x302a03(0x231)](_0x302a03(0x20d)),console['error'](_0x49fc8d[_0x302a03(0x212)])));else throw _0x49fc8d;}async function resolveAgentId(_0x26e55e,_0x5727f8,_0xc6d771,_0x43c5f7,_0x52550e){const _0x41071f=a11_0x3fa9,_0x55d5a6=_0x5727f8||_0xc6d771;if(_0x55d5a6){const {projectName:_0x2cfc80,agentName:_0x20a412}=parseAgentRef(_0x55d5a6),_0x34aed6=_0x20a412||_0x55d5a6,_0xdf408=_0x20a412?_0x2cfc80:_0x43c5f7;if(!_0xdf408)throw new Error(_0x41071f(0x1ed));if(_0x52550e){const _0x19d223=_0x5727f8?_0x41071f(0x20e):_0x41071f(0x20c);console[_0x41071f(0x231)](_0x41071f(0x230)+_0x19d223+':\x20'+_0xdf408+'/'+_0x34aed6);}const _0x3927a3=await withSpinner(_0x41071f(0x223)+_0xdf408+_0x41071f(0x225),()=>_0x26e55e['llm']['resolveProjectId'](_0xdf408),{'verbose':_0x52550e}),_0x533b7f=await withSpinner(_0x41071f(0x1fb)+_0x34aed6+'\x27...',()=>_0x26e55e[_0x41071f(0x210)][_0x41071f(0x21c)](_0x34aed6,_0x3927a3['data']),{'verbose':_0x52550e});return _0x533b7f[_0x41071f(0x1e0)];}else{const _0x215117=_0x26e55e['llm']['getDefaultAgent']();if(_0x215117)return _0x52550e&&console[_0x41071f(0x231)](_0x41071f(0x229)+_0x215117[_0x41071f(0x1de)]),_0x215117['id'];const _0xe4adcd=await withSpinner(_0x41071f(0x1e6),()=>_0x26e55e[_0x41071f(0x210)][_0x41071f(0x21b)](_0x41071f(0x215),0x0),{'verbose':_0x52550e});return _0xe4adcd['data']['id'];}}export class ChatCommand extends BaseCommand{[a11_0x1bf7ea(0x1de)]='chat';['description']=a11_0x1bf7ea(0x1f9);['validate'](_0x45c695){const _0x5496a6=a11_0x1bf7ea,_0x4a9838=_0x45c695[_0x5496a6(0x20f)][_0x5496a6(0x226)]('\x20');if(!_0x4a9838)return _0x5496a6(0x220);return undefined;}async[a11_0x1bf7ea(0x222)](_0xc32143,_0x381999,_0x1370d7,_0x42524a,_0x278743){const _0x472111=a11_0x1bf7ea;for await(const _0x501ac0 of _0xc32143['llm'][_0x472111(0x219)](_0x381999,{'agentId':_0x1370d7,'chatId':_0x42524a})){if(_0x501ac0[_0x472111(0x217)]===_0x472111(0x20a)){const _0x52e631=_0x501ac0[_0x472111(0x1e0)]['chatId'];saveLastChatId(_0x52e631),_0x278743&&console['error'](_0x472111(0x203)+_0x52e631);}else _0x501ac0[_0x472111(0x217)]===_0x472111(0x213)&&this[_0x472111(0x1e9)](_0x501ac0['data']);}}async['streamChatJsonl'](_0x469ab7,_0x126ac2,_0x34bf1e,_0x3a2c78){const _0x3d9716=a11_0x1bf7ea,_0x223f6f=_0x469ab7[_0x3d9716(0x207)][_0x3d9716(0x201)];let _0x2d68e4=![];for await(const _0x4c2edb of _0x469ab7[_0x3d9716(0x210)]['chat'](_0x126ac2,{'agentId':_0x34bf1e,'chatId':_0x3a2c78})){if(_0x4c2edb[_0x3d9716(0x217)]===_0x3d9716(0x20a)){const _0x14d552=_0x4c2edb['data'];saveLastChatId(_0x14d552[_0x3d9716(0x22e)]);const _0x314e84=_0x14d552[_0x3d9716(0x1f2)]&&_0x14d552[_0x3d9716(0x1e1)]?getLLMConversationUrl(_0x223f6f,_0x14d552[_0x3d9716(0x1f2)],_0x14d552[_0x3d9716(0x1e1)],_0x14d552['chatId']):undefined;console[_0x3d9716(0x22b)](JSON['stringify']({'type':_0x3d9716(0x20a),'data':{'chatId':_0x14d552['chatId'],'agentId':_0x14d552[_0x3d9716(0x1e1)],'consoleUrl':_0x314e84}})),_0x2d68e4=!![];}else{if(_0x4c2edb[_0x3d9716(0x217)]===_0x3d9716(0x213)){!_0x2d68e4&&_0x3a2c78&&(console[_0x3d9716(0x22b)](JSON[_0x3d9716(0x1fa)]({'type':_0x3d9716(0x20a),'data':{'chatId':_0x3a2c78}})),_0x2d68e4=!![]);const _0x35f5a5=_0x4c2edb[_0x3d9716(0x1e0)];if(_0x3d9716(0x1f7)in _0x35f5a5)console[_0x3d9716(0x22b)](JSON['stringify']({'type':_0x3d9716(0x1f7),'data':{'content':_0x35f5a5['content']}}));else{if(_0x3d9716(0x205)in _0x35f5a5){const _0x586285=_0x35f5a5[_0x3d9716(0x205)];console[_0x3d9716(0x22b)](JSON[_0x3d9716(0x1fa)]({'type':_0x3d9716(0x205),'data':{'id':_0x586285['id'],'name':_0x586285[_0x3d9716(0x208)],'target':_0x586285[_0x3d9716(0x1df)]?.[_0x3d9716(0x1de)]||_0x586285[_0x3d9716(0x1e3)]?.[_0x3d9716(0x1de)]||_0x586285[_0x3d9716(0x204)]?.[_0x3d9716(0x1de)]||_0x586285[_0x3d9716(0x1ef)]}}));}else{if('tool'in _0x35f5a5)console['log'](JSON['stringify']({'type':_0x3d9716(0x1e7),'data':{'id':_0x35f5a5[_0x3d9716(0x232)]['id'],'name':_0x35f5a5['tool']['functionName'],'result':typeof _0x35f5a5[_0x3d9716(0x232)]['content']===_0x3d9716(0x22c)?_0x35f5a5[_0x3d9716(0x232)][_0x3d9716(0x1f7)]['slice'](0x0,0x1f4):''}}));else _0x3d9716(0x231)in _0x35f5a5&&console[_0x3d9716(0x22b)](JSON[_0x3d9716(0x1fa)]({'type':'error','data':{'error':_0x35f5a5['error']}}));}}}}}console[_0x3d9716(0x22b)](JSON['stringify']({'type':_0x3d9716(0x1f3)}));}async[a11_0x1bf7ea(0x1f6)](_0x139b79){const _0x122cd8=a11_0x1bf7ea,{options:_0x55bb6e,args:_0x28fb52,tdx:_0x557470}=_0x139b79,_0x363e52=_0x28fb52[_0x122cd8(0x226)]('\x20'),_0x2ccf62=_0x55bb6e,_0xf3a167=_0x2ccf62[_0x122cd8(0x227)],_0x30a9ec=_0x2ccf62[_0x122cd8(0x1f8)],_0x48e90d=_0x2ccf62[_0x122cd8(0x21d)],_0x552125=_0x2ccf62[_0x122cd8(0x1f1)],_0x3e0871=_0x2ccf62['chatId'],_0x15d3fd=_0x2ccf62['stream'];if(_0x552125&&_0x3e0871)return console[_0x122cd8(0x231)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x5cd51f,_0x55e58d;if(_0x3e0871)_0x55e58d=_0x3e0871;else!_0x552125&&(_0x55e58d=loadLastChatId(),_0x55e58d&&_0x55bb6e[_0x122cd8(0x211)]&&console[_0x122cd8(0x231)](_0x122cd8(0x1ec)+_0x55e58d));!_0x3e0871&&(_0x552125||!_0x55e58d)&&(_0x5cd51f=await resolveAgentId(_0x557470,_0xf3a167,_0x30a9ec,_0x48e90d,_0x55bb6e['verbose']));const _0x2262e8=_0x15d3fd?(_0x155f0e,_0x57342f,_0x157987)=>this[_0x122cd8(0x1f0)](_0x557470,_0x155f0e,_0x57342f,_0x157987):(_0x59573f,_0x3672d4,_0x49b47a)=>this[_0x122cd8(0x222)](_0x557470,_0x59573f,_0x3672d4,_0x49b47a,_0x55bb6e[_0x122cd8(0x211)]);try{await _0x2262e8(_0x363e52,_0x5cd51f,_0x55e58d);}catch(_0x5f419d){const _0x54b648=_0x5f419d instanceof SDKError&&_0x5f419d[_0x122cd8(0x1ea)]===ErrorCode[_0x122cd8(0x206)]||_0x5f419d instanceof Error&&_0x5f419d[_0x122cd8(0x21e)][_0x122cd8(0x20b)](_0x122cd8(0x1eb));if(_0x54b648&&_0x3e0871)return console['error'](_0x122cd8(0x202)+_0x3e0871+_0x122cd8(0x216)),0x1;if(_0x54b648)_0x55bb6e[_0x122cd8(0x211)]&&console['error'](_0x122cd8(0x22d)),!_0x5cd51f&&(_0x5cd51f=await resolveAgentId(_0x557470,_0xf3a167,_0x30a9ec,_0x48e90d,_0x55bb6e['verbose'])),await _0x2262e8(_0x363e52,_0x5cd51f,undefined);else throw _0x5f419d;}return!_0x15d3fd&&console[_0x122cd8(0x22b)](),0x0;}catch(_0x93eda){return console[_0x122cd8(0x231)](),handleSDKError(_0x93eda,_0x55bb6e),0x1;}}[a11_0x1bf7ea(0x1e9)](_0x246eb5){const _0x41e48b=a11_0x1bf7ea;if(_0x41e48b(0x1f7)in _0x246eb5)process[_0x41e48b(0x209)][_0x41e48b(0x224)](_0x246eb5[_0x41e48b(0x1f7)]);else _0x41e48b(0x231)in _0x246eb5&&console[_0x41e48b(0x231)](_0x41e48b(0x214)+_0x246eb5[_0x41e48b(0x231)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a11_0x1bf7ea(0x1e4);[a11_0x1bf7ea(0x218)]=a11_0x1bf7ea(0x22a);[a11_0x1bf7ea(0x21a)](_0x11a993){const _0x5d679d=a11_0x1bf7ea,_0x3df5a7=_0x11a993[_0x5d679d(0x1ff)],_0x256ecf=_0x3df5a7['agent'],_0xf30b63=_0x3df5a7[_0x5d679d(0x1f8)];if(!_0x256ecf&&!_0xf30b63)return _0x5d679d(0x1e2);return undefined;}async['execute'](_0x768a8c){const _0x46236d=a11_0x1bf7ea,{options:_0x468362,tdx:_0x36a00c}=_0x768a8c,_0x5c422d=_0x468362,_0x59af80=_0x5c422d[_0x46236d(0x227)],_0x126a9c=_0x5c422d['llmAgent'],_0x2236e7=_0x5c422d[_0x46236d(0x21d)];try{const _0x10ed3d=await resolveAgentId(_0x36a00c,_0x59af80,_0x126a9c,_0x2236e7,_0x468362[_0x46236d(0x211)]),_0x1f7dc9=await _0x36a00c[_0x46236d(0x210)][_0x46236d(0x1f5)](_0x10ed3d);return saveLastChatId(_0x1f7dc9['id']),console['log'](JSON[_0x46236d(0x1fa)]({'chatId':_0x1f7dc9['id'],'agentId':_0x10ed3d})),0x0;}catch(_0x13d682){return handleSDKError(_0x13d682,_0x468362),0x1;}}}
1
+ const a10_0x2b1972=a10_0x506c;(function(_0x50fcaf,_0xf7141e){const _0x40e46e=a10_0x506c,_0x570275=_0x50fcaf();while(!![]){try{const _0x34a02d=-parseInt(_0x40e46e(0x1d3))/0x1*(parseInt(_0x40e46e(0x1ca))/0x2)+parseInt(_0x40e46e(0x1f7))/0x3*(-parseInt(_0x40e46e(0x1ba))/0x4)+parseInt(_0x40e46e(0x1be))/0x5+-parseInt(_0x40e46e(0x1d4))/0x6+-parseInt(_0x40e46e(0x1f3))/0x7*(-parseInt(_0x40e46e(0x1ac))/0x8)+parseInt(_0x40e46e(0x1ad))/0x9+-parseInt(_0x40e46e(0x1af))/0xa;if(_0x34a02d===_0xf7141e)break;else _0x570275['push'](_0x570275['shift']());}catch(_0xe86956){_0x570275['push'](_0x570275['shift']());}}}(a10_0x271d,0x92b54));function a10_0x506c(_0x5a3ebc,_0x4f58da){_0x5a3ebc=_0x5a3ebc-0x1ab;const _0x271d6e=a10_0x271d();let _0x506c11=_0x271d6e[_0x5a3ebc];return _0x506c11;}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(_0x300e2a,_0x14199e){const _0xde1f8c=a10_0x506c;if(_0x300e2a instanceof SDKError)console[_0xde1f8c(0x1b3)](_0xde1f8c(0x1e0)+_0x300e2a[_0xde1f8c(0x1b1)]),_0x14199e[_0xde1f8c(0x1c2)]&&(_0x300e2a[_0xde1f8c(0x1c8)]&&console[_0xde1f8c(0x1b3)](_0xde1f8c(0x1de)+_0x300e2a[_0xde1f8c(0x1c8)]),_0x300e2a['stack']&&(console[_0xde1f8c(0x1b3)](_0xde1f8c(0x1d0)),console[_0xde1f8c(0x1b3)](_0x300e2a[_0xde1f8c(0x1cb)])));else throw _0x300e2a;}async function resolveAgentId(_0x350710,_0x54bd49,_0x522dfc,_0x4f29d1,_0x84cd83){const _0x56d53a=a10_0x506c,_0x4a98ed=_0x54bd49||_0x522dfc;if(_0x4a98ed){const {projectName:_0x64586b,agentName:_0x241fc3}=parseAgentRef(_0x4a98ed),_0x413d8a=_0x241fc3||_0x4a98ed,_0x5b6bf9=_0x241fc3?_0x64586b:_0x4f29d1;if(!_0x5b6bf9)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x84cd83){const _0x5e84a3=_0x54bd49?_0x56d53a(0x1c7):'session\x20context';console['error']('Using\x20agent\x20from\x20'+_0x5e84a3+':\x20'+_0x5b6bf9+'/'+_0x413d8a);}const _0x5b39b6=await withSpinner(_0x56d53a(0x1bf)+_0x5b6bf9+_0x56d53a(0x1e2),()=>_0x350710['llm'][_0x56d53a(0x1ea)](_0x5b6bf9),{'verbose':_0x84cd83}),_0x25d64d=await withSpinner(_0x56d53a(0x1ee)+_0x413d8a+_0x56d53a(0x1e2),()=>_0x350710[_0x56d53a(0x1f0)][_0x56d53a(0x1ab)](_0x413d8a,_0x5b39b6[_0x56d53a(0x1ef)]),{'verbose':_0x84cd83});return _0x25d64d['data'];}else{const _0x485fa6=_0x350710['llm'][_0x56d53a(0x1da)]();if(_0x485fa6)return _0x84cd83&&console[_0x56d53a(0x1b3)](_0x56d53a(0x1d2)+_0x485fa6[_0x56d53a(0x1b9)]),_0x485fa6['id'];const _0x19d703=await withSpinner(_0x56d53a(0x1c0),()=>_0x350710[_0x56d53a(0x1f0)][_0x56d53a(0x1e4)](_0x56d53a(0x1dc),0x0),{'verbose':_0x84cd83});return _0x19d703['data']['id'];}}function a10_0x271d(){const _0x565b1b=['getDefaultAgent','includes','claude-4.5-haiku','functionName','\x20\x20Cause:\x20','llmProject','Error:\x20','llmAgent','\x27...','event','getOrCreateDefaultAgent','content','args','chat','join','context','resolveProjectId','targetAgent','streamChatJsonl','404','Resolving\x20agent\x20\x27','data','llm','projectId','\x0aError:\x20','6700813xShRvH','execute','agent','handleChatEvent','126cJIBVk','targetFunction','resolveAgentId','8zRujhc','4028274FKNVXu','write','7536530hIjWEt','metadata','message','tool','error','tool_call','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','type','Chat\x20session:\x20','description','name','33036MxiCqp','done','slice','streamChat','5282505zmsrzO','Resolving\x20project\x20\x27','Getting\x20default\x20agent...','Create\x20a\x20new\x20chat\x20session','verbose','agentId','code','log','CHAT_NOT_FOUND','--agent\x20flag','cause','chatId','14318jXRzQB','stack','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','new','stream','\x0aStack\x20trace:','validate','Using\x20cached\x20default\x20agent:\x20','62ebNakK','1896246UunxlY','site','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','targetKnowledgeBase','stringify','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'];a10_0x271d=function(){return _0x565b1b;};return a10_0x271d();}export class ChatCommand extends BaseCommand{[a10_0x2b1972(0x1b9)]=a10_0x2b1972(0x1e7);[a10_0x2b1972(0x1b8)]=a10_0x2b1972(0x1d6);[a10_0x2b1972(0x1d1)](_0x359da9){const _0x310255=a10_0x2b1972,_0xeadda5=_0x359da9[_0x310255(0x1e6)][_0x310255(0x1e8)]('\x20');if(!_0xeadda5)return _0x310255(0x1cd);return undefined;}async[a10_0x2b1972(0x1bd)](_0x31b06e,_0x11196d,_0x42d494,_0x375436,_0x4ccd54){const _0x259962=a10_0x2b1972;for await(const _0xbd585d of _0x31b06e[_0x259962(0x1f0)][_0x259962(0x1e7)](_0x11196d,{'agentId':_0x42d494,'chatId':_0x375436})){if(_0xbd585d[_0x259962(0x1b6)]===_0x259962(0x1b0)){const _0x1954b0=_0xbd585d['data'][_0x259962(0x1c9)];saveLastChatId(_0x1954b0),_0x4ccd54&&console[_0x259962(0x1b3)](_0x259962(0x1b7)+_0x1954b0);}else _0xbd585d['type']==='event'&&this[_0x259962(0x1f6)](_0xbd585d[_0x259962(0x1ef)]);}}async[a10_0x2b1972(0x1ec)](_0x1d1b86,_0x5d4709,_0x3e930a,_0x136ed0){const _0x6a346c=a10_0x2b1972,_0x1ed6d3=_0x1d1b86[_0x6a346c(0x1e9)][_0x6a346c(0x1d5)];let _0x367300=![];for await(const _0x3adf49 of _0x1d1b86['llm']['chat'](_0x5d4709,{'agentId':_0x3e930a,'chatId':_0x136ed0})){if(_0x3adf49[_0x6a346c(0x1b6)]===_0x6a346c(0x1b0)){const _0x215cb4=_0x3adf49['data'];saveLastChatId(_0x215cb4[_0x6a346c(0x1c9)]);const _0xda348e=_0x215cb4[_0x6a346c(0x1f1)]&&_0x215cb4[_0x6a346c(0x1c3)]?getLLMConversationUrl(_0x1ed6d3,_0x215cb4[_0x6a346c(0x1f1)],_0x215cb4[_0x6a346c(0x1c3)],_0x215cb4[_0x6a346c(0x1c9)]):undefined;console[_0x6a346c(0x1c5)](JSON[_0x6a346c(0x1d8)]({'type':_0x6a346c(0x1b0),'data':{'chatId':_0x215cb4[_0x6a346c(0x1c9)],'agentId':_0x215cb4['agentId'],'consoleUrl':_0xda348e}})),_0x367300=!![];}else{if(_0x3adf49[_0x6a346c(0x1b6)]===_0x6a346c(0x1e3)){!_0x367300&&_0x136ed0&&(console[_0x6a346c(0x1c5)](JSON[_0x6a346c(0x1d8)]({'type':_0x6a346c(0x1b0),'data':{'chatId':_0x136ed0}})),_0x367300=!![]);const _0x4e304a=_0x3adf49['data'];if('content'in _0x4e304a)console[_0x6a346c(0x1c5)](JSON[_0x6a346c(0x1d8)]({'type':_0x6a346c(0x1e5),'data':{'content':_0x4e304a['content']}}));else{if(_0x6a346c(0x1b4)in _0x4e304a){const _0x3db8bf=_0x4e304a[_0x6a346c(0x1b4)];console['log'](JSON[_0x6a346c(0x1d8)]({'type':_0x6a346c(0x1b4),'data':{'id':_0x3db8bf['id'],'name':_0x3db8bf[_0x6a346c(0x1dd)],'target':_0x3db8bf[_0x6a346c(0x1d7)]?.[_0x6a346c(0x1b9)]||_0x3db8bf[_0x6a346c(0x1eb)]?.['name']||_0x3db8bf['targetWebSearchTool']?.[_0x6a346c(0x1b9)]||_0x3db8bf[_0x6a346c(0x1f8)]}}));}else{if(_0x6a346c(0x1b2)in _0x4e304a)console['log'](JSON['stringify']({'type':'tool_result','data':{'id':_0x4e304a[_0x6a346c(0x1b2)]['id'],'name':_0x4e304a['tool']['functionName'],'result':typeof _0x4e304a[_0x6a346c(0x1b2)][_0x6a346c(0x1e5)]==='string'?_0x4e304a[_0x6a346c(0x1b2)][_0x6a346c(0x1e5)][_0x6a346c(0x1bc)](0x0,0x1f4):''}}));else _0x6a346c(0x1b3)in _0x4e304a&&console[_0x6a346c(0x1c5)](JSON[_0x6a346c(0x1d8)]({'type':_0x6a346c(0x1b3),'data':{'error':_0x4e304a['error']}}));}}}}}console[_0x6a346c(0x1c5)](JSON[_0x6a346c(0x1d8)]({'type':_0x6a346c(0x1bb)}));}async[a10_0x2b1972(0x1f4)](_0x424c9b){const _0x42e69e=a10_0x2b1972,{options:_0x194e74,args:_0x3d4d50,tdx:_0x57b2c7}=_0x424c9b,_0x30d7bc=_0x3d4d50['join']('\x20'),_0x4bbd24=_0x194e74,_0x548de0=_0x4bbd24[_0x42e69e(0x1f5)],_0x7be185=_0x4bbd24[_0x42e69e(0x1e1)],_0x51e3cf=_0x4bbd24['llmProject'],_0x5ef003=_0x4bbd24[_0x42e69e(0x1ce)],_0x5a80af=_0x4bbd24['chatId'],_0x2fe88a=_0x4bbd24[_0x42e69e(0x1cf)];if(_0x5ef003&&_0x5a80af)return console[_0x42e69e(0x1b3)](_0x42e69e(0x1cc)),0x1;try{let _0x3c7f41,_0x20a6e9;if(_0x5a80af)_0x20a6e9=_0x5a80af;else!_0x5ef003&&(_0x20a6e9=loadLastChatId(),_0x20a6e9&&_0x194e74[_0x42e69e(0x1c2)]&&console['error']('Continuing\x20chat:\x20'+_0x20a6e9));!_0x5a80af&&(_0x5ef003||!_0x20a6e9)&&(_0x3c7f41=await resolveAgentId(_0x57b2c7,_0x548de0,_0x7be185,_0x51e3cf,_0x194e74[_0x42e69e(0x1c2)]));const _0x2b3d1b=_0x2fe88a?(_0x57fe08,_0x178184,_0xe760db)=>this[_0x42e69e(0x1ec)](_0x57b2c7,_0x57fe08,_0x178184,_0xe760db):(_0x15d0c6,_0x5bb228,_0x10c795)=>this['streamChat'](_0x57b2c7,_0x15d0c6,_0x5bb228,_0x10c795,_0x194e74[_0x42e69e(0x1c2)]);try{await _0x2b3d1b(_0x30d7bc,_0x3c7f41,_0x20a6e9);}catch(_0x536c24){const _0x451783=_0x536c24 instanceof SDKError&&_0x536c24[_0x42e69e(0x1c4)]===ErrorCode[_0x42e69e(0x1c6)]||_0x536c24 instanceof Error&&_0x536c24[_0x42e69e(0x1b1)][_0x42e69e(0x1db)](_0x42e69e(0x1ed));if(_0x451783&&_0x5a80af)return console[_0x42e69e(0x1b3)]('Error:\x20Chat\x20session\x20\x27'+_0x5a80af+'\x27\x20not\x20found'),0x1;if(_0x451783)_0x194e74[_0x42e69e(0x1c2)]&&console[_0x42e69e(0x1b3)](_0x42e69e(0x1d9)),!_0x3c7f41&&(_0x3c7f41=await resolveAgentId(_0x57b2c7,_0x548de0,_0x7be185,_0x51e3cf,_0x194e74[_0x42e69e(0x1c2)])),await _0x2b3d1b(_0x30d7bc,_0x3c7f41,undefined);else throw _0x536c24;}return!_0x2fe88a&&console[_0x42e69e(0x1c5)](),0x0;}catch(_0x103edb){return console[_0x42e69e(0x1b3)](),handleSDKError(_0x103edb,_0x194e74),0x1;}}[a10_0x2b1972(0x1f6)](_0x3744ed){const _0x3fbbd3=a10_0x2b1972;if('content'in _0x3744ed)process['stdout'][_0x3fbbd3(0x1ae)](_0x3744ed[_0x3fbbd3(0x1e5)]);else'error'in _0x3744ed&&console[_0x3fbbd3(0x1b3)](_0x3fbbd3(0x1f2)+_0x3744ed[_0x3fbbd3(0x1b3)]);}}export class ChatCreateCommand extends BaseCommand{['name']='chat-create';['description']=a10_0x2b1972(0x1c1);[a10_0x2b1972(0x1d1)](_0xad1845){const _0x213d8b=a10_0x2b1972,_0x144b3c=_0xad1845['options'],_0x279a87=_0x144b3c[_0x213d8b(0x1f5)],_0x4e1229=_0x144b3c['llmAgent'];if(!_0x279a87&&!_0x4e1229)return _0x213d8b(0x1b5);return undefined;}async[a10_0x2b1972(0x1f4)](_0x51c82a){const _0x31634d=a10_0x2b1972,{options:_0x206d4c,tdx:_0x2dfef3}=_0x51c82a,_0x5bf870=_0x206d4c,_0x2c685d=_0x5bf870[_0x31634d(0x1f5)],_0x372541=_0x5bf870[_0x31634d(0x1e1)],_0x582086=_0x5bf870[_0x31634d(0x1df)];try{const _0x9711da=await resolveAgentId(_0x2dfef3,_0x2c685d,_0x372541,_0x582086,_0x206d4c[_0x31634d(0x1c2)]),_0x40e762=await _0x2dfef3['llm']['startChat'](_0x9711da);return saveLastChatId(_0x40e762['id']),console[_0x31634d(0x1c5)](JSON[_0x31634d(0x1d8)]({'chatId':_0x40e762['id'],'agentId':_0x9711da})),0x0;}catch(_0x2be169){return handleSDKError(_0x2be169,_0x206d4c),0x1;}}}
@@ -1 +1 @@
1
- const a12_0x41411c=a12_0x490a;(function(_0x33b1f7,_0xb6c2b1){const _0x4c38f6=a12_0x490a,_0x4d4c39=_0x33b1f7();while(!![]){try{const _0x1d7e39=-parseInt(_0x4c38f6(0x161))/0x1+parseInt(_0x4c38f6(0x140))/0x2+parseInt(_0x4c38f6(0x13e))/0x3+parseInt(_0x4c38f6(0x159))/0x4+-parseInt(_0x4c38f6(0x11d))/0x5+-parseInt(_0x4c38f6(0x117))/0x6+parseInt(_0x4c38f6(0x149))/0x7;if(_0x1d7e39===_0xb6c2b1)break;else _0x4d4c39['push'](_0x4d4c39['shift']());}catch(_0x146276){_0x4d4c39['push'](_0x4d4c39['shift']());}}}(a12_0x47c0,0x3a8fd));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{execFile}from'node:child_process';function a12_0x490a(_0x5f0a88,_0x54f405){_0x5f0a88=_0x5f0a88-0xd5;const _0x47c057=a12_0x47c0();let _0x490a2b=_0x47c057[_0x5f0a88];return _0x490a2b;}import{existsSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';import{promisify}from'node:util';import a12_0x40fb77 from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo,loadReleaseChannel}from'../core/config.js';import{resolveReleaseTag}from'../utils/github-releases.js';const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION=a12_0x41411c(0x139),SETTINGS_BACKUP_FILENAME='.tdx-settings-backup.json';function isProcessRunning(_0x5ee00b){const _0x2ce5b1=a12_0x41411c;try{return process[_0x2ce5b1(0x105)](_0x5ee00b,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x29b52,_0x2dba5c){const _0xfc9ab3=a12_0x41411c;if(!existsSync(_0x29b52))return;try{const _0x537201=await readFile(_0x29b52,_0xfc9ab3(0x133)),_0x39954f=JSON['parse'](_0x537201),_0x31dfdf=_0x39954f['env']||{};for(const _0x45a984 of[_0xfc9ab3(0x135),_0xfc9ab3(0xf6),_0xfc9ab3(0x12d),_0xfc9ab3(0x13c),'CLAUDE_CODE_USE_VERTEX']){_0x2dba5c[_0x45a984]!==undefined?_0x31dfdf[_0x45a984]=_0x2dba5c[_0x45a984]:delete _0x31dfdf[_0x45a984];}_0x2dba5c['statusLine']!==undefined?_0x39954f[_0xfc9ab3(0x144)]=_0x2dba5c[_0xfc9ab3(0x144)]:delete _0x39954f[_0xfc9ab3(0x144)],_0x39954f[_0xfc9ab3(0xdc)]=_0x31dfdf,await writeFile(_0x29b52,JSON[_0xfc9ab3(0x14f)](_0x39954f,null,0x2)+'\x0a');}catch{}}function a12_0x47c0(){const _0x47e155=['Failed\x20to\x20spawn\x20claude\x20command:\x20','passThroughServer','INVALID_ARGUMENT','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','312709PQYoYA','join','.claude','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','logger','✓\x20MCP\x20server\x20\x27','\x27\x20configured','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','red','--transport','claude','fail','Updating\x20marketplace\x20\x27','\x27\x20installed','plugins','...','CLAUDE_CODE_NOT_FOUND','pipe','warn','Initializing...','proxy','env','tdx-skills','cause','minor','originalSettings','site','sql-skills','getLogPath','CLAUDE_CODE_USE_VERTEX','\x20configuration\x20failed','td-skills\x20checked\x20out\x20at\x20tag\x20','Marketplace\x20\x27','settings.local.json','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','main','fetch','Failed\x20to\x20update\x20marketplace\x20\x27','✓\x20Logs\x20saved\x20to\x20','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','liveSessionOriginals','message','list','getCurrent','CLAUDE_CODE_UNSUPPORTED_VERSION','plugin','✓\x20Settings\x20configured:\x20.claude/settings.local.json','ANTHROPIC_MODEL','Failed\x20to\x20launch\x20Claude\x20Code:\x20','TD\x20Docs\x20MCP\x20Server','text','description','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','resume','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','already\x20installed','parse','account_id','td-docs','\x27...','match','Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20','kill','info','✓\x20td-skills\x20checked\x20out\x20at\x20','start','td-skills\x20Plugins','Failed\x20to\x20list\x20marketplaces','Claude\x20Code\x20CLI\x20not\x20found','debug','Invalid\x20minimum\x20version\x20format:\x20','major','remove','Configuring\x20MCP\x20server\x20\x27','Installing\x20plugin\x20\x27','Command\x20failed\x20(exit\x20','--hard','stderr','patch','tdx-managed-proxy','1477098otqCOj','close','✓\x20Settings\x20restored:\x20.claude/settings.local.json','green','Failed\x20to\x20install\x20plugin\x20\x27','\x20is\x20too\x20old\x20(minimum:\x20','1672555EIpUjC','✓\x20Claude\x20Code\x20version\x20OK','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','git','trim','Setup\x20failed','false','treasure-data','toString','context','✓\x20Marketplace\x20\x27','unshift','origin','Warning:\x20Failed\x20to\x20configure\x20','✓\x20Plugin\x20\x27','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','ANTHROPIC_AUTH_TOKEN','origin/main','tdx\x20claude\x20statusline','\x20meets\x20minimum\x20requirement','http://127.0.0.1:','\x20→\x20','utf-8','Creating\x20.claude/settings.local.json...','ANTHROPIC_BASE_URL','reset','continue','error','2.0.20','cwd','add','CLAUDE_CODE_USE_BEDROCK','pid','347334JlIbAj','Failed\x20to\x20remove\x20marketplace\x20\x27','640302KPGjMT','init','port','Claude\x20Code\x20version\x20','statusLine','marketplace','checkout','logLevel','Command\x20spawn\x20error:\x20','4075540gHMtdw','log','stop','\x27\x20updated','tdx-cli','toISOString','stringify','ENOENT','includes','--version','td-skills','\x20already\x20configured','name','INSTALLATION_FAILED','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','llm-proxy','460492WTCkxs','already\x20exists','data','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'];a12_0x47c0=function(){return _0x47e155;};return a12_0x47c0();}async function safeUnlink(_0x276e4a){try{await unlink(_0x276e4a);}catch{}}async function recoverFromStaleBackup(_0x2bc146,_0x188c26){const _0x3ae6f4=a12_0x41411c;if(!existsSync(_0x188c26))return undefined;try{const _0xed5c07=await readFile(_0x188c26,_0x3ae6f4(0x133)),_0x533448=JSON['parse'](_0xed5c07);if(isProcessRunning(_0x533448['pid']))return{'liveSessionOriginals':_0x533448[_0x3ae6f4(0xe0)]};return await applyOriginalSettings(_0x2bc146,_0x533448[_0x3ae6f4(0xe0)]),await safeUnlink(_0x188c26),undefined;}catch{return await safeUnlink(_0x188c26),undefined;}}function handleInstallationError(_0x6d9bb7,_0x323dce,_0xb86732,_0x70345b){const _0x35a3e3=a12_0x41411c;errorContains(_0x6d9bb7,_0x35a3e3(0x15a),_0x35a3e3(0xfe),'already\x20configured')?(_0xb86732[_0x35a3e3(0xf9)]='✓\x20'+_0x323dce+_0x35a3e3(0x154),_0x70345b?.['info'](_0x323dce+_0x35a3e3(0x154)),_0x6d9bb7 instanceof SDKError&&_0x6d9bb7[_0x35a3e3(0xde)]&&_0x70345b?.[_0x35a3e3(0x10c)]('Command\x20output:\x20'+_0x6d9bb7[_0x35a3e3(0xde)][_0x35a3e3(0xf0)])):(_0xb86732['warn'](_0x35a3e3(0x12a)+_0x323dce),_0x70345b?.[_0x35a3e3(0x138)](_0x323dce+_0x35a3e3(0xe5),_0x6d9bb7));}export function parseVersion(_0x856c76){const _0x11a46e=a12_0x41411c,_0x4dbf6f=_0x856c76[_0x11a46e(0x121)]()[_0x11a46e(0x103)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x4dbf6f)return null;return{'major':parseInt(_0x4dbf6f[0x1],0xa),'minor':parseInt(_0x4dbf6f[0x2],0xa),'patch':parseInt(_0x4dbf6f[0x3],0xa)};}export function compareVersions(_0x57f89d,_0x59420b){const _0x2c47d0=a12_0x41411c;if(_0x57f89d['major']!==_0x59420b[_0x2c47d0(0x10e)])return _0x57f89d['major']-_0x59420b[_0x2c47d0(0x10e)];if(_0x57f89d[_0x2c47d0(0xdf)]!==_0x59420b['minor'])return _0x57f89d[_0x2c47d0(0xdf)]-_0x59420b[_0x2c47d0(0xdf)];return _0x57f89d[_0x2c47d0(0x115)]-_0x59420b[_0x2c47d0(0x115)];}async function checkClaudeVersion(_0x3f7a81,_0xef64cd){const _0x5f0bc9=a12_0x41411c;_0xef64cd?.[_0x5f0bc9(0x10c)](_0x5f0bc9(0xfb)+_0x3f7a81+')');const _0x365433=await executeClaudeCommand([_0x5f0bc9(0x152)],undefined,_0xef64cd),_0x294bf9=parseVersion(_0x365433);if(!_0x294bf9){_0xef64cd?.[_0x5f0bc9(0xd9)](_0x5f0bc9(0x160)+_0x365433);return;}const _0x21c4c3=_0x294bf9['major']+'.'+_0x294bf9['minor']+'.'+_0x294bf9[_0x5f0bc9(0x115)],_0x2a2d92=parseVersion(_0x3f7a81);if(!_0x2a2d92){_0xef64cd?.[_0x5f0bc9(0xd9)](_0x5f0bc9(0x10d)+_0x3f7a81);return;}if(compareVersions(_0x294bf9,_0x2a2d92)<0x0){_0xef64cd?.[_0x5f0bc9(0x138)](_0x5f0bc9(0x143)+_0x21c4c3+_0x5f0bc9(0x11c)+_0x3f7a81+')');throw new SDKError(ErrorCode[_0x5f0bc9(0xf3)],_0x5f0bc9(0x143)+_0x21c4c3+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x3f7a81+'\x20or\x20later.',undefined,{'helpText':_0x5f0bc9(0x15c)});}_0xef64cd?.['debug'](_0x5f0bc9(0x143)+_0x21c4c3+_0x5f0bc9(0x130));}async function executeClaudeCommand(_0x894785,_0x10a3ea,_0x40a390){const _0x250240=a12_0x41411c;return _0x40a390?.['info']('Executing:\x20claude\x20'+_0x894785[_0x250240(0x162)]('\x20')),new Promise((_0x5759f6,_0x4e1838)=>{const _0x52ecf4=_0x250240,_0x38f7a4=crossSpawn('claude',_0x894785,{'stdio':_0x52ecf4(0xd8)});let _0xcfcaee='',_0x247562='';_0x38f7a4['stdout']?.['on']('data',_0x5a7f57=>{_0xcfcaee+=_0x5a7f57['toString']();}),_0x38f7a4[_0x52ecf4(0x114)]?.['on'](_0x52ecf4(0x15b),_0xfc7047=>{const _0xbc5489=_0x52ecf4;_0x247562+=_0xfc7047[_0xbc5489(0x125)]();}),_0x38f7a4['on']('error',_0x233071=>{const _0x5f0858=_0x52ecf4;_0x233071['code']===_0x5f0858(0x150)?(_0x40a390?.[_0x5f0858(0x138)]('Claude\x20Code\x20CLI\x20not\x20found'),_0x4e1838(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],'Claude\x20Code\x20CLI\x20not\x20found',_0x233071,{'helpText':_0x5f0858(0xfd)}))):(_0x40a390?.['error'](_0x5f0858(0x148)+_0x233071['message']),_0x4e1838(new SDKError(ErrorCode['INTERNAL'],_0x5f0858(0x15d)+_0x233071[_0x5f0858(0xf0)],_0x233071)));}),_0x38f7a4['on']('exit',_0x3606d4=>{const _0x17de23=_0x52ecf4;if(_0x3606d4===0x0)_0x5759f6(_0xcfcaee);else _0x10a3ea?(_0x40a390?.[_0x17de23(0x138)](_0x17de23(0x112)+_0x3606d4+'):\x20claude\x20'+_0x894785[_0x17de23(0x162)]('\x20')),_0x4e1838(new SDKError(ErrorCode[_0x17de23(0x156)],_0x10a3ea,new Error(_0x247562)))):_0x5759f6('');});});}async function ensureMcpServer(_0x2139eb,_0x8c1512,_0x1449af,_0x1a8f16,_0x3b603e){const _0x25af7c=a12_0x41411c;_0x1a8f16[_0x25af7c(0xf9)]=_0x25af7c(0x110)+_0x2139eb+_0x25af7c(0x102),await executeClaudeCommand(['mcp','add',_0x2139eb,_0x8c1512,_0x25af7c(0x16a),_0x1449af],_0x25af7c(0x12c)+_0x2139eb+'\x27',_0x3b603e),_0x1a8f16[_0x25af7c(0xf9)]=_0x25af7c(0x166)+_0x2139eb+_0x25af7c(0x167);}export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x217140=process.env.TDX_TD_SKILLS_REPO;if(_0x217140)return _0x217140;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x227f1d,_0x468a7b){const _0x53f408=a12_0x41411c;try{const _0x4ccad6=await executeClaudeCommand([_0x53f408(0xf4),'marketplace',_0x53f408(0xf1)],_0x53f408(0x10a),_0x468a7b);if(!_0x4ccad6[_0x53f408(0x151)](_0x227f1d)){_0x468a7b?.[_0x53f408(0x10c)](_0x53f408(0xe7)+_0x227f1d+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand([_0x53f408(0xf4),'marketplace',_0x53f408(0x10f),_0x227f1d],_0x53f408(0x13f)+_0x227f1d+'\x27',_0x468a7b),_0x468a7b?.[_0x53f408(0x106)](_0x53f408(0xe7)+_0x227f1d+'\x27\x20removed');}catch(_0x371970){_0x468a7b?.[_0x53f408(0xd9)](_0x53f408(0x13f)+_0x227f1d+'\x27:\x20'+_0x371970);}}async function restoreDefaultTdSkillsMarketplace(_0x3cf751){const _0x537573=a12_0x41411c;try{await removeMarketplace('td-skills',_0x3cf751),await executeClaudeCommand([_0x537573(0xf4),_0x537573(0x145),_0x537573(0x13b),DEFAULT_TD_SKILLS_URL],undefined,_0x3cf751),_0x3cf751?.[_0x537573(0x106)]('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0x5e3f2f,_0x5ee116,_0x1b0d9c,_0x50d8dc){const _0x44a55b=a12_0x41411c;_0x1b0d9c[_0x44a55b(0xf9)]='Configuring\x20marketplace\x20\x27'+_0x5e3f2f+_0x44a55b(0x102),await executeClaudeCommand([_0x44a55b(0xf4),'marketplace',_0x44a55b(0x13b),_0x5ee116],'Failed\x20to\x20configure\x20marketplace\x20\x27'+_0x5e3f2f+'\x27',_0x50d8dc),_0x1b0d9c[_0x44a55b(0xf9)]='✓\x20Marketplace\x20\x27'+_0x5e3f2f+'\x27\x20configured';}async function updateMarketplace(_0x30eb20,_0xe3a218,_0x1ee94c){const _0x1d79e6=a12_0x41411c;_0xe3a218[_0x1d79e6(0xf9)]=_0x1d79e6(0x16d)+_0x30eb20+_0x1d79e6(0x102),await executeClaudeCommand(['plugin','marketplace','update'],_0x1d79e6(0xec)+_0x30eb20+'\x27',_0x1ee94c),_0xe3a218[_0x1d79e6(0xf9)]=_0x1d79e6(0x127)+_0x30eb20+_0x1d79e6(0x14c);}async function ensurePlugin(_0x5ed0f5,_0x20021a,_0x4bdc46,_0x23ad69){const _0x17dd88=a12_0x41411c;_0x4bdc46[_0x17dd88(0xf9)]=_0x17dd88(0x111)+_0x5ed0f5+_0x17dd88(0x102),await executeClaudeCommand([_0x17dd88(0xf4),'install',_0x5ed0f5+'@'+_0x20021a],_0x17dd88(0x11b)+_0x5ed0f5+'\x27',_0x23ad69),_0x4bdc46[_0x17dd88(0xf9)]=_0x17dd88(0x12b)+_0x5ed0f5+_0x17dd88(0x16e);}function getClaudeConfigDir(){return process.env.CLAUDE_CONFIG_DIR||join(homedir(),'.claude');}async function checkoutReleaseTag(_0x368546,_0x2454bf,_0x23884d){const _0x26f340=a12_0x41411c,_0xf2ca62=join(getClaudeConfigDir(),_0x26f340(0xd5),'marketplaces',_0x26f340(0x153));if(!existsSync(_0xf2ca62)){_0x23884d?.[_0x26f340(0x10c)](_0x26f340(0xee));return;}_0x2454bf[_0x26f340(0xf9)]='Checking\x20out\x20td-skills\x20'+_0x368546+_0x26f340(0xd6),await execFileAsync(_0x26f340(0x120),[_0x26f340(0xeb),_0x26f340(0x129),'--tags','--force'],{'cwd':_0xf2ca62});try{await execFileAsync(_0x26f340(0x120),[_0x26f340(0x146),_0x26f340(0xea)],{'cwd':_0xf2ca62});}catch{await execFileAsync(_0x26f340(0x120),[_0x26f340(0x146),'-b',_0x26f340(0xea),_0x26f340(0x12e)],{'cwd':_0xf2ca62});}await execFileAsync('git',[_0x26f340(0x136),_0x26f340(0x113),_0x368546],{'cwd':_0xf2ca62}),_0x2454bf[_0x26f340(0xf9)]=_0x26f340(0x107)+_0x368546,_0x23884d?.[_0x26f340(0x106)](_0x26f340(0xe6)+_0x368546);}async function createClaudeSettings(_0x1620d9,_0xfac649,_0x109589){const _0x1f753a=a12_0x41411c,_0x3deba8=join(process['cwd'](),_0x1f753a(0x163)),_0x119822=join(_0x3deba8,_0x1f753a(0xe8)),_0x370627=join(_0x3deba8,SETTINGS_BACKUP_FILENAME);await mkdir(_0x3deba8,{'recursive':!![]});const _0x196c78=await recoverFromStaleBackup(_0x119822,_0x370627);let _0x5b6c3b;if(_0x196c78)_0x5b6c3b=_0x196c78[_0x1f753a(0xef)];else{let _0x53f992={};if(existsSync(_0x119822))try{const _0x1bf4da=await readFile(_0x119822,_0x1f753a(0x133));_0x53f992=JSON[_0x1f753a(0xff)](_0x1bf4da);}catch{_0x53f992={};}const _0x115485=_0x53f992['env']||{};_0x5b6c3b={'ANTHROPIC_BASE_URL':_0x115485[_0x1f753a(0x135)],'ANTHROPIC_MODEL':_0x115485[_0x1f753a(0xf6)],'ANTHROPIC_AUTH_TOKEN':_0x115485[_0x1f753a(0x12d)],'CLAUDE_CODE_USE_BEDROCK':_0x115485[_0x1f753a(0x13c)],'CLAUDE_CODE_USE_VERTEX':_0x115485[_0x1f753a(0xe4)],'statusLine':_0x53f992[_0x1f753a(0x144)]};const _0x2f5845={'createdAt':new Date()[_0x1f753a(0x14e)](),'pid':process[_0x1f753a(0x13d)],'originalSettings':_0x5b6c3b};await writeFile(_0x370627,JSON[_0x1f753a(0x14f)](_0x2f5845,null,0x2)+'\x0a');}let _0x51eb9d={};if(existsSync(_0x119822))try{const _0x334e2f=await readFile(_0x119822,'utf-8');_0x51eb9d=JSON['parse'](_0x334e2f);}catch{_0x51eb9d={};}const _0x330186=_0x51eb9d[_0x1f753a(0xdc)]||{},_0x4fba3d={..._0x51eb9d,'env':{..._0x330186,'ANTHROPIC_BASE_URL':_0x1f753a(0x131)+_0x1620d9,..._0xfac649&&{'ANTHROPIC_MODEL':_0xfac649},'ANTHROPIC_AUTH_TOKEN':_0x1f753a(0x116),'CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0x1f753a(0x123)},'statusLine':{'type':'command','command':_0x109589?'tdx\x20--profile\x20'+_0x109589+'\x20claude\x20statusline':_0x1f753a(0x12f)}};return await writeFile(_0x119822,JSON[_0x1f753a(0x14f)](_0x4fba3d,null,0x2)+'\x0a'),_0x5b6c3b;}async function restoreClaudeSettings(_0x287966){const _0x168639=a12_0x41411c,_0x3958db=join(process[_0x168639(0x13a)](),'.claude'),_0x2901a0=join(_0x3958db,'settings.local.json'),_0x14f05d=join(_0x3958db,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x2901a0,_0x287966);try{if(existsSync(_0x14f05d)){const _0x3e2a30=await readFile(_0x14f05d,_0x168639(0x133)),_0x4d8524=JSON[_0x168639(0xff)](_0x3e2a30);_0x4d8524[_0x168639(0x13d)]===process[_0x168639(0x13d)]&&await safeUnlink(_0x14f05d);}}catch{}}export class ClaudeCommand extends BaseCommand{[a12_0x41411c(0x155)]=a12_0x41411c(0x16b);[a12_0x41411c(0xfa)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';[a12_0x41411c(0x15e)];[a12_0x41411c(0xe0)];[a12_0x41411c(0x165)];['port'];async['execute'](_0x35c40f){const _0x41dc14=a12_0x41411c,{tdx:_0x5bd3c6,options:_0x69ea0c,args:_0x450e07}=_0x35c40f;let _0x4002c6=![];try{const _0x5d7e1e=_0x69ea0c,_0x3f1e2e=_0x5d7e1e[_0x41dc14(0xdb)]===![],_0x462c6e=_0x5d7e1e[_0x41dc14(0x137)]===!![],_0x3e5347=_0x5d7e1e[_0x41dc14(0xfc)]===!![],_0x3264c1=[..._0x450e07];if(_0x462c6e)_0x3264c1[_0x41dc14(0x128)]('-c');else _0x3e5347&&_0x3264c1[_0x41dc14(0x128)]('-r');const _0x161414=createCommandSpinner(_0x41dc14(0xda),{'verbose':_0x69ea0c['verbose']});_0x161414['start']();try{if(!_0x3f1e2e){const _0x518220=_0x69ea0c['profile'];try{const _0x97cdfc=await _0x5bd3c6['user'][_0x41dc14(0xf2)]();_0x97cdfc['account_id']&&writeCachedAccountInfo(_0x69ea0c[_0x41dc14(0xe1)],_0x97cdfc[_0x41dc14(0x100)],_0x518220);}catch{}_0x161414[_0x41dc14(0xf9)]='Initializing\x20proxy\x20logger...',this[_0x41dc14(0x165)]=new TDXLogger(_0x69ea0c[_0x41dc14(0x147)],!![]),await this['logger'][_0x41dc14(0x141)]();const _0x1a6b70=this[_0x41dc14(0x165)][_0x41dc14(0xe3)]();_0x161414[_0x41dc14(0xf9)]='✓\x20Logging\x20to\x20'+_0x1a6b70;const _0x543e12=getEndpoint(_0x69ea0c[_0x41dc14(0xe1)],_0x41dc14(0x158));_0x161414[_0x41dc14(0xf9)]=_0x41dc14(0x164);if(!_0x5bd3c6[_0x41dc14(0x126)]['apiKey'])throw new SDKError(ErrorCode[_0x41dc14(0x15f)],_0x41dc14(0x11f));this[_0x41dc14(0x15e)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x543e12,'apiKey':_0x5bd3c6[_0x41dc14(0x126)]['apiKey'],'logger':this[_0x41dc14(0x165)],'site':_0x69ea0c[_0x41dc14(0xe1)],'profile':_0x518220}),await this[_0x41dc14(0x15e)][_0x41dc14(0x108)](),this[_0x41dc14(0x142)]=this[_0x41dc14(0x15e)]['port'],_0x161414[_0x41dc14(0xf9)]=_0x41dc14(0xe9)+this[_0x41dc14(0x142)]+_0x41dc14(0x132)+_0x543e12,_0x161414[_0x41dc14(0xf9)]=_0x41dc14(0x134),this['originalSettings']=await createClaudeSettings(this[_0x41dc14(0x142)],undefined,_0x518220),_0x161414[_0x41dc14(0xf9)]=_0x41dc14(0xf5);}else _0x161414[_0x41dc14(0xf9)]=_0x41dc14(0x168);try{_0x161414['text']='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x41dc14(0x165)]),_0x161414[_0x41dc14(0xf9)]=_0x41dc14(0x11e);}catch(_0x59d77a){_0x161414[_0x41dc14(0x16c)]('Claude\x20Code\x20version\x20check\x20failed');throw _0x59d77a;}try{await ensureMcpServer(_0x41dc14(0x101),'https://docs.treasuredata.com/mcp','http',_0x161414,this['logger']);}catch(_0x4f717c){handleInstallationError(_0x4f717c,_0x41dc14(0xf8),_0x161414,this['logger']);}try{const _0x25294a=getTdSkillsRepoUrl();_0x4002c6=_0x25294a!==DEFAULT_TD_SKILLS_URL;_0x4002c6&&await removeMarketplace(_0x41dc14(0x153),this[_0x41dc14(0x165)]);await ensureMarketplace(_0x41dc14(0x153),_0x25294a,_0x161414,this[_0x41dc14(0x165)]),await updateMarketplace(_0x41dc14(0x153),_0x161414,this[_0x41dc14(0x165)]),await ensurePlugin(_0x41dc14(0xe2),_0x41dc14(0x153),_0x161414,this[_0x41dc14(0x165)]),await ensurePlugin('workflow-skills','td-skills',_0x161414,this[_0x41dc14(0x165)]),await ensurePlugin(_0x41dc14(0xdd),'td-skills',_0x161414,this[_0x41dc14(0x165)]);try{const _0x1bc79e=loadReleaseChannel(),_0x46f676=await resolveReleaseTag(_0x1bc79e,_0x41dc14(0x124),_0x41dc14(0x153),_0x41dc14(0x14d));_0x46f676&&await checkoutReleaseTag(_0x46f676,_0x161414,this[_0x41dc14(0x165)]);}catch(_0x2c734e){this[_0x41dc14(0x165)]?.[_0x41dc14(0xd9)](_0x41dc14(0x104)+_0x2c734e);}}catch(_0x2f9335){handleInstallationError(_0x2f9335,_0x41dc14(0x109),_0x161414,this['logger']);}_0x161414[_0x41dc14(0x14b)]();}catch(_0x4130c4){_0x161414[_0x41dc14(0x16c)](_0x41dc14(0x122));throw _0x4130c4;}const _0x24ace6=await findExecutable('claude');if(!_0x24ace6)throw new SDKError(ErrorCode[_0x41dc14(0xd7)],_0x41dc14(0x10b),undefined,{'helpText':_0x41dc14(0xfd)});const _0x1a88e6={...process.env};!_0x3f1e2e&&(_0x1a88e6[_0x41dc14(0x135)]='http://127.0.0.1:'+this[_0x41dc14(0x142)],_0x1a88e6[_0x41dc14(0x12d)]=_0x41dc14(0x116),_0x1a88e6[_0x41dc14(0x13c)]=_0x41dc14(0x123),_0x1a88e6[_0x41dc14(0xe4)]=_0x41dc14(0x123));const _0x1f21b6=crossSpawn(_0x24ace6,_0x3264c1,{'stdio':'inherit','env':_0x1a88e6}),_0x20e7fb=await new Promise(_0x4009b3=>{const _0x2dd0db=_0x41dc14;_0x1f21b6['on']('exit',_0xb09728=>{_0x4009b3(_0xb09728||0x0);}),_0x1f21b6['on'](_0x2dd0db(0x138),_0x24c2ea=>{const _0x5bf64a=_0x2dd0db;console['error'](a12_0x40fb77[_0x5bf64a(0x169)](_0x5bf64a(0xf7)+_0x24c2ea['message'])),_0x4009b3(0x1);});});_0x4002c6&&await restoreDefaultTdSkillsMarketplace(this[_0x41dc14(0x165)]);this[_0x41dc14(0x15e)]&&(await this['passThroughServer'][_0x41dc14(0x14b)](),console[_0x41dc14(0x14a)](a12_0x40fb77[_0x41dc14(0x11a)](_0x41dc14(0x157))));if(this[_0x41dc14(0x165)]){await this[_0x41dc14(0x165)][_0x41dc14(0x118)]();const _0x1ba279=this[_0x41dc14(0x165)]['getLogPath']();console[_0x41dc14(0x14a)](a12_0x40fb77[_0x41dc14(0x11a)](_0x41dc14(0xed)+_0x1ba279));}return this['originalSettings']&&(await restoreClaudeSettings(this['originalSettings']),console['log'](a12_0x40fb77[_0x41dc14(0x11a)](_0x41dc14(0x119)))),_0x20e7fb;}catch(_0x2f9d64){_0x4002c6&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0x41dc14(0x15e)]&&await this[_0x41dc14(0x15e)]['stop']();this[_0x41dc14(0x165)]&&await this[_0x41dc14(0x165)]['close']();this[_0x41dc14(0xe0)]&&await restoreClaudeSettings(this['originalSettings']);throw _0x2f9d64;}}}
1
+ const a11_0x539e5b=a11_0x181c;(function(_0x1c71c9,_0x10c67a){const _0x3dfffa=a11_0x181c,_0x18f496=_0x1c71c9();while(!![]){try{const _0x389a70=-parseInt(_0x3dfffa(0xf2))/0x1*(-parseInt(_0x3dfffa(0x122))/0x2)+-parseInt(_0x3dfffa(0xe3))/0x3+parseInt(_0x3dfffa(0x10e))/0x4+parseInt(_0x3dfffa(0xd7))/0x5*(parseInt(_0x3dfffa(0x106))/0x6)+-parseInt(_0x3dfffa(0x8e))/0x7*(parseInt(_0x3dfffa(0xe0))/0x8)+-parseInt(_0x3dfffa(0xfb))/0x9+parseInt(_0x3dfffa(0xc1))/0xa*(parseInt(_0x3dfffa(0xfe))/0xb);if(_0x389a70===_0x10c67a)break;else _0x18f496['push'](_0x18f496['shift']());}catch(_0x7c8dcf){_0x18f496['push'](_0x18f496['shift']());}}}(a11_0x4551,0xc4af7));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{execFile}from'node:child_process';function a11_0x4551(){const _0x3ce5cf=['--force','init','\x20or\x20later.','tdx-cli','...','1sjcRMR','td-skills\x20Plugins','\x20→\x20','ANTHROPIC_BASE_URL','update','pid','Failed\x20to\x20list\x20marketplaces','tdx-managed-proxy','execute','606834ReOdSj','stderr','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','222541MzhKWE','INVALID_ARGUMENT','\x20claude\x20statusline','Command\x20output:\x20','Installing\x20plugin\x20\x27','2.0.20','command','Failed\x20to\x20launch\x20Claude\x20Code:\x20','1254HyKVrM','text','verbose','statusLine','ENOENT','toISOString','unshift','Setup\x20failed','4764572hOqAQK','warn','Claude\x20Code\x20version\x20','\x27...','✓\x20Settings\x20configured:\x20.claude/settings.local.json','CLAUDE_CODE_NOT_FOUND','Initializing...','false','API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode','http','already\x20exists','logLevel','cwd','stdout','--tags','CLAUDE_CODE_UNSUPPORTED_VERSION','stop','inherit','treasure-data','join','582804yjZOFQ','tdx\x20claude\x20statusline','description','Configuring\x20marketplace\x20\x27','\x20meets\x20minimum\x20requirement','start','https://github.com/treasure-data/td-skills','git','account_id','Configuring\x20MCP\x20server\x20\x27','marketplaces','marketplace','Command\x20failed\x20(exit\x20','green','trim','error','ANTHROPIC_MODEL','--version','tdx-skills','Claude\x20Code\x20CLI\x20not\x20found','claude','port','4109hhvwpI','✓\x20Claude\x20Code\x20version\x20OK','parse','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','--hard','\x27\x20removed','major','close','reset','Marketplace\x20\x27','remove','debug','apiKey','.claude','originalSettings','stringify','getCurrent','CLAUDE_CODE_USE_VERTEX','getLogPath','✓\x20td-skills\x20checked\x20out\x20at\x20','main','Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20','sql-skills','ANTHROPIC_AUTH_TOKEN','list','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','log','td-docs','checkout','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','settings.local.json','add','Failed\x20to\x20install\x20plugin\x20\x27','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','\x27\x20updated','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','env','\x20already\x20configured','mcp','code','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','plugin','utf-8','Failed\x20to\x20remove\x20marketplace\x20\x27','Executing:\x20claude\x20','--transport','info','origin','✓\x20Settings\x20restored:\x20.claude/settings.local.json','workflow-skills','resume','10fbhwTA','pipe','install','✓\x20MCP\x20server\x20\x27','CLAUDE_CODE_USE_BEDROCK','\x27\x20configured','site','user','tdx\x20--profile\x20','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','kill','profile','liveSessionOriginals','passThroughServer','Initializing\x20proxy\x20logger...','Failed\x20to\x20configure\x20marketplace\x20\x27','td-skills','patch','data','TD\x20Docs\x20MCP\x20Server','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Failed\x20to\x20update\x20marketplace\x20\x27','13675LyfmvI','minor','\x20is\x20too\x20old\x20(minimum:\x20','Warning:\x20Failed\x20to\x20configure\x20','td-skills\x20checked\x20out\x20at\x20tag\x20','fetch','):\x20claude\x20','message','http://127.0.0.1:','6608qXjiJo','Command\x20spawn\x20error:\x20','\x20configuration\x20failed','2149440VKnqad','match','already\x20configured','proxy','toString','Creating\x20.claude/settings.local.json...','logger','fail','✓\x20Marketplace\x20\x27','exit'];a11_0x4551=function(){return _0x3ce5cf;};return a11_0x4551();}import{existsSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';import{promisify}from'node:util';import a11_0x3e42f4 from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint}from'../sdk/client/endpoints.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo,loadReleaseChannel}from'../core/config.js';import{resolveReleaseTag}from'../utils/github-releases.js';const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION=a11_0x539e5b(0x103),SETTINGS_BACKUP_FILENAME='.tdx-settings-backup.json';function isProcessRunning(_0xbd13b2){const _0x1bb6a9=a11_0x539e5b;try{return process[_0x1bb6a9(0xcb)](_0xbd13b2,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x2b5f11,_0xdb6fcd){const _0x50a2c4=a11_0x539e5b;if(!existsSync(_0x2b5f11))return;try{const _0x64c858=await readFile(_0x2b5f11,_0x50a2c4(0xb8)),_0xdcef3=JSON[_0x50a2c4(0x90)](_0x64c858),_0x44f741=_0xdcef3[_0x50a2c4(0xb2)]||{};for(const _0x4f93cf of[_0x50a2c4(0xf5),_0x50a2c4(0x88),'ANTHROPIC_AUTH_TOKEN',_0x50a2c4(0xc5),_0x50a2c4(0x9f)]){_0xdb6fcd[_0x4f93cf]!==undefined?_0x44f741[_0x4f93cf]=_0xdb6fcd[_0x4f93cf]:delete _0x44f741[_0x4f93cf];}_0xdb6fcd[_0x50a2c4(0x109)]!==undefined?_0xdcef3['statusLine']=_0xdb6fcd[_0x50a2c4(0x109)]:delete _0xdcef3[_0x50a2c4(0x109)],_0xdcef3[_0x50a2c4(0xb2)]=_0x44f741,await writeFile(_0x2b5f11,JSON[_0x50a2c4(0x9d)](_0xdcef3,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x7ba8d1){try{await unlink(_0x7ba8d1);}catch{}}async function recoverFromStaleBackup(_0x5caa2e,_0x4fbeeb){const _0x40badc=a11_0x539e5b;if(!existsSync(_0x4fbeeb))return undefined;try{const _0x555877=await readFile(_0x4fbeeb,_0x40badc(0xb8)),_0x1c9814=JSON[_0x40badc(0x90)](_0x555877);if(isProcessRunning(_0x1c9814['pid']))return{'liveSessionOriginals':_0x1c9814[_0x40badc(0x9c)]};return await applyOriginalSettings(_0x5caa2e,_0x1c9814[_0x40badc(0x9c)]),await safeUnlink(_0x4fbeeb),undefined;}catch{return await safeUnlink(_0x4fbeeb),undefined;}}function handleInstallationError(_0x23a4d9,_0x4b259c,_0x89e838,_0x29869a){const _0x196f64=a11_0x539e5b;errorContains(_0x23a4d9,_0x196f64(0x118),'already\x20installed',_0x196f64(0xe5))?(_0x89e838[_0x196f64(0x107)]='✓\x20'+_0x4b259c+_0x196f64(0xb3),_0x29869a?.['info'](_0x4b259c+_0x196f64(0xb3)),_0x23a4d9 instanceof SDKError&&_0x23a4d9['cause']&&_0x29869a?.[_0x196f64(0x99)](_0x196f64(0x101)+_0x23a4d9['cause'][_0x196f64(0xde)])):(_0x89e838[_0x196f64(0x10f)](_0x196f64(0xda)+_0x4b259c),_0x29869a?.[_0x196f64(0x87)](_0x4b259c+_0x196f64(0xe2),_0x23a4d9));}export function parseVersion(_0x28d0f5){const _0x538444=a11_0x539e5b,_0x5ead25=_0x28d0f5[_0x538444(0x86)]()[_0x538444(0xe4)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x5ead25)return null;return{'major':parseInt(_0x5ead25[0x1],0xa),'minor':parseInt(_0x5ead25[0x2],0xa),'patch':parseInt(_0x5ead25[0x3],0xa)};}export function compareVersions(_0xa3947c,_0x2ca955){const _0x29e7ff=a11_0x539e5b;if(_0xa3947c['major']!==_0x2ca955[_0x29e7ff(0x94)])return _0xa3947c[_0x29e7ff(0x94)]-_0x2ca955[_0x29e7ff(0x94)];if(_0xa3947c[_0x29e7ff(0xd8)]!==_0x2ca955[_0x29e7ff(0xd8)])return _0xa3947c['minor']-_0x2ca955[_0x29e7ff(0xd8)];return _0xa3947c[_0x29e7ff(0xd2)]-_0x2ca955['patch'];}async function checkClaudeVersion(_0x4ee5ca,_0x3963e1){const _0x385f48=a11_0x539e5b;_0x3963e1?.[_0x385f48(0x99)](_0x385f48(0xb6)+_0x4ee5ca+')');const _0x4cf217=await executeClaudeCommand([_0x385f48(0x89)],undefined,_0x3963e1),_0x5f5b0f=parseVersion(_0x4cf217);if(!_0x5f5b0f){_0x3963e1?.['warn']('Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20'+_0x4cf217);return;}const _0x4ed411=_0x5f5b0f[_0x385f48(0x94)]+'.'+_0x5f5b0f['minor']+'.'+_0x5f5b0f[_0x385f48(0xd2)],_0x442fa5=parseVersion(_0x4ee5ca);if(!_0x442fa5){_0x3963e1?.['warn']('Invalid\x20minimum\x20version\x20format:\x20'+_0x4ee5ca);return;}if(compareVersions(_0x5f5b0f,_0x442fa5)<0x0){_0x3963e1?.[_0x385f48(0x87)]('Claude\x20Code\x20version\x20'+_0x4ed411+_0x385f48(0xd9)+_0x4ee5ca+')');throw new SDKError(ErrorCode[_0x385f48(0x11d)],'Claude\x20Code\x20version\x20'+_0x4ed411+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x4ee5ca+_0x385f48(0xef),undefined,{'helpText':_0x385f48(0xab)});}_0x3963e1?.[_0x385f48(0x99)](_0x385f48(0x110)+_0x4ed411+_0x385f48(0x7c));}async function executeClaudeCommand(_0x281bc8,_0x39ff10,_0x12d8d1){const _0x356cc0=a11_0x539e5b;return _0x12d8d1?.['info'](_0x356cc0(0xba)+_0x281bc8[_0x356cc0(0x121)]('\x20')),new Promise((_0x3eb8d6,_0xa01eab)=>{const _0x4b85a7=_0x356cc0,_0x11be2e=crossSpawn(_0x4b85a7(0x8c),_0x281bc8,{'stdio':_0x4b85a7(0xc2)});let _0x703f0b='',_0x25104f='';_0x11be2e[_0x4b85a7(0x11b)]?.['on']('data',_0x1fea41=>{const _0x18f7c3=_0x4b85a7;_0x703f0b+=_0x1fea41[_0x18f7c3(0xe7)]();}),_0x11be2e[_0x4b85a7(0xfc)]?.['on'](_0x4b85a7(0xd3),_0x2fa9a2=>{const _0x14acf1=_0x4b85a7;_0x25104f+=_0x2fa9a2[_0x14acf1(0xe7)]();}),_0x11be2e['on'](_0x4b85a7(0x87),_0x22ff7e=>{const _0x2781b9=_0x4b85a7;_0x22ff7e[_0x2781b9(0xb5)]===_0x2781b9(0x10a)?(_0x12d8d1?.['error']('Claude\x20Code\x20CLI\x20not\x20found'),_0xa01eab(new SDKError(ErrorCode[_0x2781b9(0x113)],_0x2781b9(0x8b),_0x22ff7e,{'helpText':_0x2781b9(0xd5)}))):(_0x12d8d1?.[_0x2781b9(0x87)](_0x2781b9(0xe1)+_0x22ff7e[_0x2781b9(0xde)]),_0xa01eab(new SDKError(ErrorCode['INTERNAL'],'Failed\x20to\x20spawn\x20claude\x20command:\x20'+_0x22ff7e[_0x2781b9(0xde)],_0x22ff7e)));}),_0x11be2e['on']('exit',_0x504d29=>{const _0x33e7fe=_0x4b85a7;if(_0x504d29===0x0)_0x3eb8d6(_0x703f0b);else _0x39ff10?(_0x12d8d1?.[_0x33e7fe(0x87)](_0x33e7fe(0x84)+_0x504d29+_0x33e7fe(0xdd)+_0x281bc8[_0x33e7fe(0x121)]('\x20')),_0xa01eab(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x39ff10,new Error(_0x25104f)))):_0x3eb8d6('');});});}async function ensureMcpServer(_0x435082,_0x23a9dc,_0x36d0d4,_0x5f302c,_0x1710d0){const _0x82dcc=a11_0x539e5b;_0x5f302c[_0x82dcc(0x107)]=_0x82dcc(0x81)+_0x435082+_0x82dcc(0x111),await executeClaudeCommand([_0x82dcc(0xb4),_0x82dcc(0xad),_0x435082,_0x23a9dc,_0x82dcc(0xbb),_0x36d0d4],_0x82dcc(0xfd)+_0x435082+'\x27',_0x1710d0),_0x5f302c[_0x82dcc(0x107)]=_0x82dcc(0xc4)+_0x435082+_0x82dcc(0xc6);}export const DEFAULT_TD_SKILLS_URL=a11_0x539e5b(0x7e);export function getTdSkillsRepoUrl(){const _0x206808=process.env.TDX_TD_SKILLS_REPO;if(_0x206808)return _0x206808;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x2bb262,_0x56d096){const _0x12a932=a11_0x539e5b;try{const _0x7d45e0=await executeClaudeCommand(['plugin','marketplace',_0x12a932(0xa6)],_0x12a932(0xf8),_0x56d096);if(!_0x7d45e0['includes'](_0x2bb262)){_0x56d096?.[_0x12a932(0x99)](_0x12a932(0x97)+_0x2bb262+_0x12a932(0xca));return;}await executeClaudeCommand([_0x12a932(0xb7),'marketplace',_0x12a932(0x98),_0x2bb262],_0x12a932(0xb9)+_0x2bb262+'\x27',_0x56d096),_0x56d096?.['info'](_0x12a932(0x97)+_0x2bb262+_0x12a932(0x93));}catch(_0x3d743f){_0x56d096?.[_0x12a932(0x10f)](_0x12a932(0xb9)+_0x2bb262+'\x27:\x20'+_0x3d743f);}}async function restoreDefaultTdSkillsMarketplace(_0x1ae3cd){const _0xcc27a6=a11_0x539e5b;try{await removeMarketplace('td-skills',_0x1ae3cd),await executeClaudeCommand([_0xcc27a6(0xb7),_0xcc27a6(0x83),_0xcc27a6(0xad),DEFAULT_TD_SKILLS_URL],undefined,_0x1ae3cd),_0x1ae3cd?.['info']('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0x4671a4,_0x40042c,_0x3a7769,_0x5df58b){const _0x5830a3=a11_0x539e5b;_0x3a7769[_0x5830a3(0x107)]=_0x5830a3(0x7b)+_0x4671a4+_0x5830a3(0x111),await executeClaudeCommand([_0x5830a3(0xb7),_0x5830a3(0x83),_0x5830a3(0xad),_0x40042c],_0x5830a3(0xd0)+_0x4671a4+'\x27',_0x5df58b),_0x3a7769[_0x5830a3(0x107)]=_0x5830a3(0xeb)+_0x4671a4+'\x27\x20configured';}async function updateMarketplace(_0x5bf786,_0x12634c,_0x24a048){const _0x32208b=a11_0x539e5b;_0x12634c[_0x32208b(0x107)]='Updating\x20marketplace\x20\x27'+_0x5bf786+_0x32208b(0x111),await executeClaudeCommand(['plugin',_0x32208b(0x83),_0x32208b(0xf6)],_0x32208b(0xd6)+_0x5bf786+'\x27',_0x24a048),_0x12634c['text']=_0x32208b(0xeb)+_0x5bf786+_0x32208b(0xb0);}async function ensurePlugin(_0x50e551,_0x507d39,_0x501af6,_0x3e4a31){const _0x5a94b5=a11_0x539e5b;_0x501af6[_0x5a94b5(0x107)]=_0x5a94b5(0x102)+_0x50e551+_0x5a94b5(0x111),await executeClaudeCommand([_0x5a94b5(0xb7),_0x5a94b5(0xc3),_0x50e551+'@'+_0x507d39],_0x5a94b5(0xae)+_0x50e551+'\x27',_0x3e4a31),_0x501af6['text']='✓\x20Plugin\x20\x27'+_0x50e551+'\x27\x20installed';}function getClaudeConfigDir(){const _0x3aa914=a11_0x539e5b;return process.env.CLAUDE_CONFIG_DIR||join(homedir(),_0x3aa914(0x9b));}async function checkoutReleaseTag(_0x29c1f8,_0x17609b,_0x4dcba6){const _0x1c9c35=a11_0x539e5b,_0x20b8e6=join(getClaudeConfigDir(),'plugins',_0x1c9c35(0x82),_0x1c9c35(0xd1));if(!existsSync(_0x20b8e6)){_0x4dcba6?.[_0x1c9c35(0x99)](_0x1c9c35(0x91));return;}_0x17609b[_0x1c9c35(0x107)]='Checking\x20out\x20td-skills\x20'+_0x29c1f8+_0x1c9c35(0xf1),await execFileAsync(_0x1c9c35(0x7f),[_0x1c9c35(0xdc),_0x1c9c35(0xbd),_0x1c9c35(0x11c),_0x1c9c35(0xed)],{'cwd':_0x20b8e6});try{await execFileAsync(_0x1c9c35(0x7f),[_0x1c9c35(0xaa),_0x1c9c35(0xa2)],{'cwd':_0x20b8e6});}catch{await execFileAsync(_0x1c9c35(0x7f),['checkout','-b','main','origin/main'],{'cwd':_0x20b8e6});}await execFileAsync(_0x1c9c35(0x7f),[_0x1c9c35(0x96),_0x1c9c35(0x92),_0x29c1f8],{'cwd':_0x20b8e6}),_0x17609b[_0x1c9c35(0x107)]=_0x1c9c35(0xa1)+_0x29c1f8,_0x4dcba6?.[_0x1c9c35(0xbc)](_0x1c9c35(0xdb)+_0x29c1f8);}async function createClaudeSettings(_0x252449,_0x540927,_0x48fd83){const _0x1d7a90=a11_0x539e5b,_0x5cca95=join(process['cwd'](),'.claude'),_0x15fd11=join(_0x5cca95,_0x1d7a90(0xac)),_0x231afc=join(_0x5cca95,SETTINGS_BACKUP_FILENAME);await mkdir(_0x5cca95,{'recursive':!![]});const _0x7bbcd=await recoverFromStaleBackup(_0x15fd11,_0x231afc);let _0x1218e1;if(_0x7bbcd)_0x1218e1=_0x7bbcd[_0x1d7a90(0xcd)];else{let _0x27697b={};if(existsSync(_0x15fd11))try{const _0x1bc3d4=await readFile(_0x15fd11,'utf-8');_0x27697b=JSON[_0x1d7a90(0x90)](_0x1bc3d4);}catch{_0x27697b={};}const _0x5bfbff=_0x27697b[_0x1d7a90(0xb2)]||{};_0x1218e1={'ANTHROPIC_BASE_URL':_0x5bfbff[_0x1d7a90(0xf5)],'ANTHROPIC_MODEL':_0x5bfbff[_0x1d7a90(0x88)],'ANTHROPIC_AUTH_TOKEN':_0x5bfbff[_0x1d7a90(0xa5)],'CLAUDE_CODE_USE_BEDROCK':_0x5bfbff[_0x1d7a90(0xc5)],'CLAUDE_CODE_USE_VERTEX':_0x5bfbff[_0x1d7a90(0x9f)],'statusLine':_0x27697b['statusLine']};const _0x40123e={'createdAt':new Date()[_0x1d7a90(0x10b)](),'pid':process[_0x1d7a90(0xf7)],'originalSettings':_0x1218e1};await writeFile(_0x231afc,JSON['stringify'](_0x40123e,null,0x2)+'\x0a');}let _0x651fe5={};if(existsSync(_0x15fd11))try{const _0xeb3aec=await readFile(_0x15fd11,'utf-8');_0x651fe5=JSON[_0x1d7a90(0x90)](_0xeb3aec);}catch{_0x651fe5={};}const _0x2f8b9f=_0x651fe5[_0x1d7a90(0xb2)]||{},_0xd8d8b4={..._0x651fe5,'env':{..._0x2f8b9f,'ANTHROPIC_BASE_URL':_0x1d7a90(0xdf)+_0x252449,..._0x540927&&{'ANTHROPIC_MODEL':_0x540927},'ANTHROPIC_AUTH_TOKEN':_0x1d7a90(0xf9),'CLAUDE_CODE_USE_BEDROCK':_0x1d7a90(0x115),'CLAUDE_CODE_USE_VERTEX':_0x1d7a90(0x115)},'statusLine':{'type':_0x1d7a90(0x104),'command':_0x48fd83?_0x1d7a90(0xc9)+_0x48fd83+_0x1d7a90(0x100):_0x1d7a90(0x123)}};return await writeFile(_0x15fd11,JSON[_0x1d7a90(0x9d)](_0xd8d8b4,null,0x2)+'\x0a'),_0x1218e1;}async function restoreClaudeSettings(_0x582846){const _0xd2afcb=a11_0x539e5b,_0x4d6264=join(process[_0xd2afcb(0x11a)](),_0xd2afcb(0x9b)),_0x28ee87=join(_0x4d6264,_0xd2afcb(0xac)),_0x3f40d7=join(_0x4d6264,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x28ee87,_0x582846);try{if(existsSync(_0x3f40d7)){const _0xfa1745=await readFile(_0x3f40d7,_0xd2afcb(0xb8)),_0x40c5f4=JSON[_0xd2afcb(0x90)](_0xfa1745);_0x40c5f4[_0xd2afcb(0xf7)]===process[_0xd2afcb(0xf7)]&&await safeUnlink(_0x3f40d7);}}catch{}}function a11_0x181c(_0x5f0f03,_0x4d9911){_0x5f0f03=_0x5f0f03-0x7b;const _0x45516b=a11_0x4551();let _0x181cfe=_0x45516b[_0x5f0f03];return _0x181cfe;}export class ClaudeCommand extends BaseCommand{['name']=a11_0x539e5b(0x8c);[a11_0x539e5b(0x124)]=a11_0x539e5b(0xa7);[a11_0x539e5b(0xce)];[a11_0x539e5b(0x9c)];[a11_0x539e5b(0xe9)];[a11_0x539e5b(0x8d)];async[a11_0x539e5b(0xfa)](_0x315f79){const _0x124a33=a11_0x539e5b,{tdx:_0x43bcb3,options:_0xce14fc,args:_0x401d23}=_0x315f79;let _0x7e4049=![];try{const _0x5351e7=_0xce14fc,_0x28d17b=_0x5351e7[_0x124a33(0xe6)]===![],_0x3cb1a4=_0x5351e7['continue']===!![],_0x59dbf5=_0x5351e7[_0x124a33(0xc0)]===!![],_0x104cbf=[..._0x401d23];if(_0x3cb1a4)_0x104cbf[_0x124a33(0x10c)]('-c');else _0x59dbf5&&_0x104cbf[_0x124a33(0x10c)]('-r');const _0x83d2ca=createCommandSpinner(_0x124a33(0x114),{'verbose':_0xce14fc[_0x124a33(0x108)]});_0x83d2ca[_0x124a33(0x7d)]();try{if(!_0x28d17b){const _0x698d08=_0xce14fc[_0x124a33(0xcc)];try{const _0x18db91=await _0x43bcb3[_0x124a33(0xc8)][_0x124a33(0x9e)]();_0x18db91[_0x124a33(0x80)]&&writeCachedAccountInfo(_0xce14fc[_0x124a33(0xc7)],_0x18db91[_0x124a33(0x80)],_0x698d08);}catch{}_0x83d2ca['text']=_0x124a33(0xcf),this['logger']=new TDXLogger(_0xce14fc[_0x124a33(0x119)],!![]),await this[_0x124a33(0xe9)][_0x124a33(0xee)]();const _0x3d518e=this[_0x124a33(0xe9)][_0x124a33(0xa0)]();_0x83d2ca[_0x124a33(0x107)]='✓\x20Logging\x20to\x20'+_0x3d518e;const _0x4e91e2=getEndpoint(_0xce14fc[_0x124a33(0xc7)],'llm-proxy');_0x83d2ca[_0x124a33(0x107)]='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';if(!_0x43bcb3['context']['apiKey'])throw new SDKError(ErrorCode[_0x124a33(0xff)],_0x124a33(0x116));this['passThroughServer']=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x4e91e2,'apiKey':_0x43bcb3['context'][_0x124a33(0x9a)],'logger':this[_0x124a33(0xe9)],'site':_0xce14fc[_0x124a33(0xc7)],'profile':_0x698d08}),await this[_0x124a33(0xce)]['start'](),this['port']=this[_0x124a33(0xce)][_0x124a33(0x8d)],_0x83d2ca['text']=_0x124a33(0xaf)+this[_0x124a33(0x8d)]+_0x124a33(0xf4)+_0x4e91e2,_0x83d2ca[_0x124a33(0x107)]=_0x124a33(0xe8),this[_0x124a33(0x9c)]=await createClaudeSettings(this[_0x124a33(0x8d)],undefined,_0x698d08),_0x83d2ca[_0x124a33(0x107)]=_0x124a33(0x112);}else _0x83d2ca['text']='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';try{_0x83d2ca[_0x124a33(0x107)]='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x124a33(0xe9)]),_0x83d2ca[_0x124a33(0x107)]=_0x124a33(0x8f);}catch(_0x1c8524){_0x83d2ca[_0x124a33(0xea)]('Claude\x20Code\x20version\x20check\x20failed');throw _0x1c8524;}try{await ensureMcpServer(_0x124a33(0xa9),'https://docs.treasuredata.com/mcp',_0x124a33(0x117),_0x83d2ca,this[_0x124a33(0xe9)]);}catch(_0x4c279f){handleInstallationError(_0x4c279f,_0x124a33(0xd4),_0x83d2ca,this[_0x124a33(0xe9)]);}try{const _0x26ac09=getTdSkillsRepoUrl();_0x7e4049=_0x26ac09!==DEFAULT_TD_SKILLS_URL;_0x7e4049&&await removeMarketplace(_0x124a33(0xd1),this['logger']);await ensureMarketplace(_0x124a33(0xd1),_0x26ac09,_0x83d2ca,this[_0x124a33(0xe9)]),await updateMarketplace(_0x124a33(0xd1),_0x83d2ca,this['logger']),await ensurePlugin(_0x124a33(0xa4),_0x124a33(0xd1),_0x83d2ca,this[_0x124a33(0xe9)]),await ensurePlugin(_0x124a33(0xbf),_0x124a33(0xd1),_0x83d2ca,this[_0x124a33(0xe9)]),await ensurePlugin(_0x124a33(0x8a),_0x124a33(0xd1),_0x83d2ca,this[_0x124a33(0xe9)]);try{const _0xd0c6d1=loadReleaseChannel(),_0x4cac4d=await resolveReleaseTag(_0xd0c6d1,_0x124a33(0x120),_0x124a33(0xd1),_0x124a33(0xf0));_0x4cac4d&&await checkoutReleaseTag(_0x4cac4d,_0x83d2ca,this[_0x124a33(0xe9)]);}catch(_0x25c43e){this[_0x124a33(0xe9)]?.[_0x124a33(0x10f)](_0x124a33(0xa3)+_0x25c43e);}}catch(_0x1b9ed5){handleInstallationError(_0x1b9ed5,_0x124a33(0xf3),_0x83d2ca,this['logger']);}_0x83d2ca['stop']();}catch(_0x49941b){_0x83d2ca[_0x124a33(0xea)](_0x124a33(0x10d));throw _0x49941b;}const _0x4129cc=await findExecutable('claude');if(!_0x4129cc)throw new SDKError(ErrorCode[_0x124a33(0x113)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x124a33(0xd5)});const _0x26278b={...process.env};!_0x28d17b&&(_0x26278b[_0x124a33(0xf5)]=_0x124a33(0xdf)+this['port'],_0x26278b[_0x124a33(0xa5)]=_0x124a33(0xf9),_0x26278b[_0x124a33(0xc5)]=_0x124a33(0x115),_0x26278b['CLAUDE_CODE_USE_VERTEX']=_0x124a33(0x115));const _0x12c016=crossSpawn(_0x4129cc,_0x104cbf,{'stdio':_0x124a33(0x11f),'env':_0x26278b}),_0x4c640b=await new Promise(_0x5ea912=>{const _0x1d9c5e=_0x124a33;_0x12c016['on'](_0x1d9c5e(0xec),_0x46dddb=>{_0x5ea912(_0x46dddb||0x0);}),_0x12c016['on']('error',_0x58eaba=>{const _0x555df8=_0x1d9c5e;console[_0x555df8(0x87)](a11_0x3e42f4['red'](_0x555df8(0x105)+_0x58eaba[_0x555df8(0xde)])),_0x5ea912(0x1);});});_0x7e4049&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&(await this[_0x124a33(0xce)][_0x124a33(0x11e)](),console[_0x124a33(0xa8)](a11_0x3e42f4[_0x124a33(0x85)](_0x124a33(0xb1))));if(this[_0x124a33(0xe9)]){await this[_0x124a33(0xe9)]['close']();const _0x416fe6=this['logger'][_0x124a33(0xa0)]();console['log'](a11_0x3e42f4[_0x124a33(0x85)]('✓\x20Logs\x20saved\x20to\x20'+_0x416fe6));}return this[_0x124a33(0x9c)]&&(await restoreClaudeSettings(this[_0x124a33(0x9c)]),console[_0x124a33(0xa8)](a11_0x3e42f4['green'](_0x124a33(0xbe)))),_0x4c640b;}catch(_0xf51234){_0x7e4049&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0x124a33(0xce)]&&await this[_0x124a33(0xce)][_0x124a33(0x11e)]();this[_0x124a33(0xe9)]&&await this['logger'][_0x124a33(0x95)]();this['originalSettings']&&await restoreClaudeSettings(this['originalSettings']);throw _0xf51234;}}}
@@ -1 +1 @@
1
- const a13_0x3f632b=a13_0x4ce2;(function(_0x4de49d,_0x5782b2){const _0xcba6de=a13_0x4ce2,_0x16afda=_0x4de49d();while(!![]){try{const _0x4b6df0=parseInt(_0xcba6de(0x160))/0x1+-parseInt(_0xcba6de(0x16c))/0x2*(-parseInt(_0xcba6de(0x177))/0x3)+-parseInt(_0xcba6de(0x178))/0x4+-parseInt(_0xcba6de(0x159))/0x5+-parseInt(_0xcba6de(0x168))/0x6*(parseInt(_0xcba6de(0x16a))/0x7)+parseInt(_0xcba6de(0x162))/0x8*(parseInt(_0xcba6de(0x15e))/0x9)+-parseInt(_0xcba6de(0x165))/0xa;if(_0x4b6df0===_0x5782b2)break;else _0x16afda['push'](_0x16afda['shift']());}catch(_0x1f5ede){_0x16afda['push'](_0x16afda['shift']());}}}(a13_0x2633,0x23e8d));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';function a13_0x2633(){const _0x3a2e2e=['💎\x20','session_id','execute','568020ZTBjDH','\x20|\x20','🧠\x20','profile','\x20-\x20','261cCMkxa','parse','284676WPIZTk','push','71608GbLmHZ','name','log','1890080KauSOP','cache_read_input_tokens','💎\x20tdx\x20-\x20Claude','83862HgFXWr','\x20month','42OKrLTN','description','2SxapsV','model','input_tokens','round','site','close','monthCredits','Claude','sessionCredits','line','🪙\x20credit:\x20','47151PzzFav','105652lwoCRL','accountId','options','todayCredits','toFixed','join'];a13_0x2633=function(){return _0x3a2e2e;};return a13_0x2633();}import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';function a13_0x4ce2(_0x40d40a,_0x7c4df){_0x40d40a=_0x40d40a-0x156;const _0x263364=a13_0x2633();let _0x4ce2fe=_0x263364[_0x40d40a];return _0x4ce2fe;}async function readStdinJson(_0x209167=0x64){return new Promise(_0x2ffd6b=>{const _0x1d4688=a13_0x4ce2;let _0x4e5035='',_0x21a377=![];const _0x5b07db=createInterface({'input':process['stdin'],'terminal':![]}),_0x3cc0c9=_0x1dcb74=>{const _0x53fc25=a13_0x4ce2;if(_0x21a377)return;_0x21a377=!![],clearTimeout(_0x526ea5),_0x5b07db[_0x53fc25(0x171)](),_0x2ffd6b(_0x1dcb74);},_0x526ea5=setTimeout(()=>{_0x3cc0c9(null);},_0x209167);_0x5b07db['on'](_0x1d4688(0x175),_0x4fc241=>{_0x4e5035+=_0x4fc241;}),_0x5b07db['on'](_0x1d4688(0x171),()=>{const _0x215f8d=_0x1d4688;if(_0x21a377)return;try{const _0x2c9b9d=JSON[_0x215f8d(0x15f)](_0x4e5035);_0x3cc0c9(_0x2c9b9d);}catch{_0x3cc0c9(null);}});});}function formatCredits(_0x15f1b2){const _0x1d08e3=a13_0x4ce2;return _0x15f1b2[_0x1d08e3(0x17c)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a13_0x3f632b(0x163)]='statusline';[a13_0x3f632b(0x16b)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async[a13_0x3f632b(0x158)](_0x384d50){const _0x182260=a13_0x3f632b;try{const _0x4e27eb=await readStdinJson();if(!_0x4e27eb?.[_0x182260(0x157)])return console['log'](_0x182260(0x167)),0x0;const _0x2ba3d4=_0x4e27eb['session_id'],_0x1fd3ab=_0x4e27eb[_0x182260(0x16d)]?.['id']||'',_0x322f4c=_0x4e27eb['profile']||_0x384d50[_0x182260(0x17a)][_0x182260(0x15c)],_0x23dc5d=await getUsageStats(_0x2ba3d4,_0x322f4c),_0x3ed34c=[],_0x3248e8=readCachedAccountInfo(_0x322f4c),_0x2bd43b=_0x3248e8?'tdx\x20'+_0x3248e8[_0x182260(0x170)]+':'+_0x3248e8[_0x182260(0x179)]:'tdx',_0x150e4b=_0x1fd3ab?getModelDisplayName(_0x1fd3ab):_0x182260(0x173);_0x3ed34c[_0x182260(0x161)](_0x182260(0x156)+_0x2bd43b+_0x182260(0x15d)+_0x150e4b);const _0xf23b5=formatCredits(_0x23dc5d[_0x182260(0x174)]),_0x5a6102=formatCredits(_0x23dc5d[_0x182260(0x17b)]),_0x423e79=formatCredits(_0x23dc5d[_0x182260(0x172)]);_0x3ed34c[_0x182260(0x161)](_0x182260(0x176)+_0xf23b5+'\x20session\x20/\x20'+_0x5a6102+'\x20today\x20/\x20'+_0x423e79+_0x182260(0x169));const _0x1711b3=_0x4e27eb['context_window'],_0xa29dc3=_0x1711b3?.['current_usage'];if(_0xa29dc3&&_0x1711b3?.['used_percentage']!=null){const _0x2945f5=_0xa29dc3[_0x182260(0x16e)]+_0xa29dc3['cache_creation_input_tokens']+_0xa29dc3[_0x182260(0x166)],_0x51542d=formatTokenCount(_0x2945f5),_0x25a711=Math[_0x182260(0x16f)](_0x1711b3['used_percentage']);_0x3ed34c[_0x182260(0x161)](_0x182260(0x15b)+_0x51542d+'\x20('+_0x25a711+'%)');}return console[_0x182260(0x164)](_0x3ed34c[_0x182260(0x17d)](_0x182260(0x15a))),0x0;}catch{return console[_0x182260(0x164)](_0x182260(0x167)),0x0;}}}
1
+ const a12_0xdeb4e4=a12_0xbffc;(function(_0x4d731e,_0x130b3e){const _0x2b8375=a12_0xbffc,_0x13cc35=_0x4d731e();while(!![]){try{const _0x5bc057=parseInt(_0x2b8375(0x158))/0x1+-parseInt(_0x2b8375(0x171))/0x2*(-parseInt(_0x2b8375(0x153))/0x3)+parseInt(_0x2b8375(0x16a))/0x4+parseInt(_0x2b8375(0x16c))/0x5+-parseInt(_0x2b8375(0x14f))/0x6*(parseInt(_0x2b8375(0x159))/0x7)+parseInt(_0x2b8375(0x14b))/0x8*(parseInt(_0x2b8375(0x170))/0x9)+-parseInt(_0x2b8375(0x157))/0xa*(parseInt(_0x2b8375(0x15e))/0xb);if(_0x5bc057===_0x130b3e)break;else _0x13cc35['push'](_0x13cc35['shift']());}catch(_0x41cc9c){_0x13cc35['push'](_0x13cc35['shift']());}}}(a12_0xe675,0x8a0b2));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';function a12_0xbffc(_0x2c3597,_0x11e8f9){_0x2c3597=_0x2c3597-0x145;const _0xe675f1=a12_0xe675();let _0xbffc87=_0xe675f1[_0x2c3597];return _0xbffc87;}function a12_0xe675(){const _0x50f3ea=['\x20session\x20/\x20','push','round','close','\x20month','monthCredits','used_percentage','\x20|\x20','1012344avOcDr','join','2971310GWaBuT','\x20-\x20','execute','Claude','1874331xNwDoh','430CDTGNk','statusline','cache_read_input_tokens','💎\x20','parse','cache_creation_input_tokens','current_usage','32YTwgpC','💎\x20tdx\x20-\x20Claude','accountId','🪙\x20credit:\x20','1874892NEjbWt','sessionCredits','profile','🧠\x20','10713KpMSfF','tdx','\x20today\x20/\x20','todayCredits','22897340wwLxYH','1031975tThsJz','14CAapxa','session_id','context_window','tdx\x20','options','11lYmBWP','log','site','description'];a12_0xe675=function(){return _0x50f3ea;};return a12_0xe675();}async function readStdinJson(_0x31a381=0x64){return new Promise(_0x229218=>{const _0x15b114=a12_0xbffc;let _0x164076='',_0x147268=![];const _0x5bb778=createInterface({'input':process['stdin'],'terminal':![]}),_0x17270f=_0x5682c5=>{const _0x3b690d=a12_0xbffc;if(_0x147268)return;_0x147268=!![],clearTimeout(_0x1ca25c),_0x5bb778[_0x3b690d(0x165)](),_0x229218(_0x5682c5);},_0x1ca25c=setTimeout(()=>{_0x17270f(null);},_0x31a381);_0x5bb778['on']('line',_0x15a7b1=>{_0x164076+=_0x15a7b1;}),_0x5bb778['on'](_0x15b114(0x165),()=>{const _0x3fe5cd=_0x15b114;if(_0x147268)return;try{const _0x653cfd=JSON[_0x3fe5cd(0x148)](_0x164076);_0x17270f(_0x653cfd);}catch{_0x17270f(null);}});});}function formatCredits(_0x3faf09){return _0x3faf09['toFixed'](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a12_0xdeb4e4(0x145);[a12_0xdeb4e4(0x161)]='Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)';async[a12_0xdeb4e4(0x16e)](_0x51d8af){const _0x4d6116=a12_0xdeb4e4;try{const _0x4066bf=await readStdinJson();if(!_0x4066bf?.[_0x4d6116(0x15a)])return console[_0x4d6116(0x15f)](_0x4d6116(0x14c)),0x0;const _0x588ede=_0x4066bf[_0x4d6116(0x15a)],_0x325569=_0x4066bf['model']?.['id']||'',_0x358d57=_0x4066bf[_0x4d6116(0x151)]||_0x51d8af[_0x4d6116(0x15d)][_0x4d6116(0x151)],_0x6b116b=await getUsageStats(_0x588ede,_0x358d57),_0x140325=[],_0x39ff6d=readCachedAccountInfo(_0x358d57),_0x2094d7=_0x39ff6d?_0x4d6116(0x15c)+_0x39ff6d[_0x4d6116(0x160)]+':'+_0x39ff6d[_0x4d6116(0x14d)]:_0x4d6116(0x154),_0x4c0636=_0x325569?getModelDisplayName(_0x325569):_0x4d6116(0x16f);_0x140325[_0x4d6116(0x163)](_0x4d6116(0x147)+_0x2094d7+_0x4d6116(0x16d)+_0x4c0636);const _0x46ca3b=formatCredits(_0x6b116b[_0x4d6116(0x150)]),_0x341f25=formatCredits(_0x6b116b[_0x4d6116(0x156)]),_0x11fd3e=formatCredits(_0x6b116b[_0x4d6116(0x167)]);_0x140325[_0x4d6116(0x163)](_0x4d6116(0x14e)+_0x46ca3b+_0x4d6116(0x162)+_0x341f25+_0x4d6116(0x155)+_0x11fd3e+_0x4d6116(0x166));const _0x1ec9a7=_0x4066bf[_0x4d6116(0x15b)],_0x26b0b1=_0x1ec9a7?.[_0x4d6116(0x14a)];if(_0x26b0b1&&_0x1ec9a7?.[_0x4d6116(0x168)]!=null){const _0x37aecf=_0x26b0b1['input_tokens']+_0x26b0b1[_0x4d6116(0x149)]+_0x26b0b1[_0x4d6116(0x146)],_0x238ca1=formatTokenCount(_0x37aecf),_0x2fa766=Math[_0x4d6116(0x164)](_0x1ec9a7[_0x4d6116(0x168)]);_0x140325[_0x4d6116(0x163)](_0x4d6116(0x152)+_0x238ca1+'\x20('+_0x2fa766+'%)');}return console[_0x4d6116(0x15f)](_0x140325[_0x4d6116(0x16b)](_0x4d6116(0x169))),0x0;}catch{return console[_0x4d6116(0x15f)](_0x4d6116(0x14c)),0x0;}}}
@@ -1 +1 @@
1
- const a14_0x4f3324=a14_0x4fc7;function a14_0x1c84(){const _0x57d098=['Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','\x20credits','2-digit','toFixed','2700240qbgRfH','todayCredits','6kuYFQs','Unknown\x20error','Usage\x20by\x20Source','name','length','20uzvqZC','jsonl','\x20days\x20ago','short','Usage\x20by\x20Profile','2442kKJjPv','padEnd','en-CA','71845GAZnvN','\x20\x20Today:\x20\x20\x20','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','6156577lPKxfM','(default)','3813864kYDKVb','yesterday','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','json','toLocaleTimeString','bold','repeat','Source','49980wkkQQH','profileCount','Total','dim','Profile','entryCount','178erVISy','toLocaleDateString','17412yPIjRM','Month','27wDUaiu','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','today\x20','default','numeric','profile','monthCredits','format','lastUsedAt','red','outputStructured','log','map','Requests','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','outputTable','377691IMHeWY','\x20\x20Total:\x20\x20\x20','totalCredits','padStart','Today','en-US','credits','cyan','source','description','all','getTime'];a14_0x1c84=function(){return _0x57d098;};return a14_0x1c84();}(function(_0x119fa3,_0x39aae6){const _0x5f1256=a14_0x4fc7,_0x4fff4b=_0x119fa3();while(!![]){try{const _0x2c1586=parseInt(_0x5f1256(0x176))/0x1+-parseInt(_0x5f1256(0x162))/0x2*(-parseInt(_0x5f1256(0x164))/0x3)+-parseInt(_0x5f1256(0x18d))/0x4*(-parseInt(_0x5f1256(0x14f))/0x5)+parseInt(_0x5f1256(0x188))/0x6*(parseInt(_0x5f1256(0x152))/0x7)+parseInt(_0x5f1256(0x154))/0x8+-parseInt(_0x5f1256(0x166))/0x9*(parseInt(_0x5f1256(0x186))/0xa)+parseInt(_0x5f1256(0x192))/0xb*(-parseInt(_0x5f1256(0x15c))/0xc);if(_0x2c1586===_0x39aae6)break;else _0x4fff4b['push'](_0x4fff4b['shift']());}catch(_0x5e38c9){_0x4fff4b['push'](_0x4fff4b['shift']());}}}(a14_0x1c84,0x8f772));import a14_0x4d3d53 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(_0x401d9b){const _0x2c49a6=a14_0x4fc7;return _0x401d9b[_0x2c49a6(0x185)](0x2);}function a14_0x4fc7(_0x4f015a,_0x46c92b){_0x4f015a=_0x4f015a-0x14e;const _0x1c847a=a14_0x1c84();let _0x4fc732=_0x1c847a[_0x4f015a];return _0x4fc732;}function formatLastUsed(_0x3c2790){const _0x589f03=a14_0x4fc7;if(!_0x3c2790)return'never';const _0x3a6133=new Date(_0x3c2790),_0x4e6905=new Date(),_0x2970fc=_0x3a6133[_0x589f03(0x163)]('en-CA'),_0x1ac39e=_0x4e6905[_0x589f03(0x163)](_0x589f03(0x14e));if(_0x2970fc===_0x1ac39e)return _0x589f03(0x168)+_0x3a6133[_0x589f03(0x158)](_0x589f03(0x17b),{'hour':_0x589f03(0x184),'minute':'2-digit'});const _0x1d2c79=new Date(_0x2970fc),_0x275ff8=new Date(_0x1ac39e),_0x5bf865=Math['round']((_0x275ff8[_0x589f03(0x181)]()-_0x1d2c79[_0x589f03(0x181)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5bf865===0x1)return _0x589f03(0x155);else return _0x5bf865>0x1&&_0x5bf865<0x7?_0x5bf865+_0x589f03(0x18f):_0x3a6133['toLocaleDateString'](_0x589f03(0x17b),{'month':_0x589f03(0x190),'day':_0x589f03(0x16a)});}export class ClaudeUsageCommand extends BaseCommand{[a14_0x4f3324(0x18b)]='usage';[a14_0x4f3324(0x17f)]=a14_0x4f3324(0x156);async['execute'](_0x2918f1){const _0x4c5c05=a14_0x4f3324,{options:_0x1bfcd8}=_0x2918f1,_0x85f3b1=_0x1bfcd8['format']===_0x4c5c05(0x157)||_0x1bfcd8[_0x4c5c05(0x16d)]===_0x4c5c05(0x18e)||_0x1bfcd8[_0x4c5c05(0x157)];try{const [_0x5ea3c9,_0x4b6eb3,_0x150c05]=await Promise[_0x4c5c05(0x180)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x85f3b1?await this['outputStructured'](_0x5ea3c9,_0x4b6eb3,_0x150c05,_0x1bfcd8):this[_0x4c5c05(0x175)](_0x5ea3c9,_0x4b6eb3,_0x150c05),0x0;}catch(_0x5d52f4){const _0x353533=_0x5d52f4 instanceof Error?_0x5d52f4['message']:_0x4c5c05(0x189);return console['error'](a14_0x4d3d53[_0x4c5c05(0x16f)]('Error:\x20'+_0x353533)),0x1;}}async[a14_0x4f3324(0x170)](_0xf82d95,_0x551b39,_0x477b7c,_0x3c122e){const _0x5d0961=a14_0x4f3324,_0xbe8f66={'summary':{'todayCredits':_0x477b7c[_0x5d0961(0x187)],'monthCredits':_0x477b7c[_0x5d0961(0x16c)],'totalCredits':_0x477b7c[_0x5d0961(0x178)],'profileCount':_0x477b7c[_0x5d0961(0x15d)]},'profiles':_0xf82d95[_0x5d0961(0x172)](_0x1b72c7=>({'profile':_0x1b72c7[_0x5d0961(0x16b)],'credits':_0x1b72c7[_0x5d0961(0x17c)],'requests':_0x1b72c7['entryCount'],'lastUsedAt':_0x1b72c7[_0x5d0961(0x16e)]})),'sources':_0x551b39['map'](_0x47a45c=>({'source':_0x47a45c[_0x5d0961(0x17e)],'credits':_0x47a45c[_0x5d0961(0x17c)],'todayCredits':_0x47a45c[_0x5d0961(0x187)],'monthCredits':_0x47a45c['monthCredits'],'requests':_0x47a45c[_0x5d0961(0x161)]}))};await handleSDKOutput([_0xbe8f66],_0x3c122e);}[a14_0x4f3324(0x175)](_0x2ae9e6,_0x2a8cf5,_0x20d946){const _0x5e6fcf=a14_0x4f3324;console[_0x5e6fcf(0x171)](a14_0x4d3d53[_0x5e6fcf(0x159)](_0x5e6fcf(0x151))),console[_0x5e6fcf(0x171)](a14_0x4d3d53[_0x5e6fcf(0x15f)]('─'[_0x5e6fcf(0x15a)](0x32))),console[_0x5e6fcf(0x171)](_0x5e6fcf(0x150)+a14_0x4d3d53[_0x5e6fcf(0x17d)](formatCredits(_0x20d946[_0x5e6fcf(0x187)]))+_0x5e6fcf(0x183)),console[_0x5e6fcf(0x171)]('\x20\x20Month:\x20\x20\x20'+a14_0x4d3d53['cyan'](formatCredits(_0x20d946['monthCredits']))+_0x5e6fcf(0x183)),console[_0x5e6fcf(0x171)](_0x5e6fcf(0x177)+a14_0x4d3d53[_0x5e6fcf(0x17d)](formatCredits(_0x20d946[_0x5e6fcf(0x178)]))+'\x20credits'),console[_0x5e6fcf(0x171)]();if(_0x2a8cf5['length']>0x0){console[_0x5e6fcf(0x171)](a14_0x4d3d53[_0x5e6fcf(0x159)](_0x5e6fcf(0x18a))),console[_0x5e6fcf(0x171)](a14_0x4d3d53[_0x5e6fcf(0x15f)]('─'[_0x5e6fcf(0x15a)](0x3c)));const _0x27041d=0xc,_0x218835=0xa,_0x1ed9a5=0xa,_0x1d5b63=0xa;console[_0x5e6fcf(0x171)]('\x20\x20'+_0x5e6fcf(0x15b)[_0x5e6fcf(0x193)](_0x27041d)+'\x20\x20'+_0x5e6fcf(0x15e)[_0x5e6fcf(0x179)](_0x218835)+'\x20\x20'+_0x5e6fcf(0x17a)[_0x5e6fcf(0x179)](_0x1ed9a5)+'\x20\x20'+_0x5e6fcf(0x165)[_0x5e6fcf(0x179)](_0x1d5b63));for(const _0xdf7be4 of _0x2a8cf5){console[_0x5e6fcf(0x171)]('\x20\x20'+_0xdf7be4[_0x5e6fcf(0x17e)][_0x5e6fcf(0x193)](_0x27041d)+'\x20\x20'+a14_0x4d3d53[_0x5e6fcf(0x17d)](formatCredits(_0xdf7be4[_0x5e6fcf(0x17c)])[_0x5e6fcf(0x179)](_0x218835))+'\x20\x20'+formatCredits(_0xdf7be4[_0x5e6fcf(0x187)])[_0x5e6fcf(0x179)](_0x1ed9a5)+'\x20\x20'+formatCredits(_0xdf7be4[_0x5e6fcf(0x16c)])['padStart'](_0x1d5b63));}console[_0x5e6fcf(0x171)]();}if(_0x2ae9e6[_0x5e6fcf(0x18c)]===0x0){console['log'](a14_0x4d3d53['dim'](_0x5e6fcf(0x167))),console[_0x5e6fcf(0x171)](a14_0x4d3d53[_0x5e6fcf(0x15f)](_0x5e6fcf(0x174)));return;}console[_0x5e6fcf(0x171)](a14_0x4d3d53['bold'](_0x5e6fcf(0x191))),console[_0x5e6fcf(0x171)](a14_0x4d3d53[_0x5e6fcf(0x15f)]('─'[_0x5e6fcf(0x15a)](0x3c)));const _0x3ed0f4=Math['max'](0xc,..._0x2ae9e6[_0x5e6fcf(0x172)](_0x7741ab=>_0x7741ab[_0x5e6fcf(0x16b)]===_0x5e6fcf(0x169)?_0x5e6fcf(0x153)['length']:_0x7741ab[_0x5e6fcf(0x16b)]['length'])),_0xd9ee0e=0xa,_0x40cce8=0xa;console[_0x5e6fcf(0x171)]('\x20\x20'+_0x5e6fcf(0x160)[_0x5e6fcf(0x193)](_0x3ed0f4)+'\x20\x20'+'Credits'[_0x5e6fcf(0x179)](_0xd9ee0e)+'\x20\x20'+_0x5e6fcf(0x173)[_0x5e6fcf(0x179)](_0x40cce8)+'\x20\x20'+'Last\x20Used');for(const _0xf5838b of _0x2ae9e6){const _0x181ae4=_0xf5838b[_0x5e6fcf(0x16b)]===_0x5e6fcf(0x169)?_0x5e6fcf(0x153):_0xf5838b[_0x5e6fcf(0x16b)],_0x26ec02=_0x181ae4[_0x5e6fcf(0x193)](_0x3ed0f4),_0x459b12=_0xf5838b[_0x5e6fcf(0x16b)]===_0x5e6fcf(0x169)?a14_0x4d3d53[_0x5e6fcf(0x15f)](_0x26ec02):_0x26ec02;console['log']('\x20\x20'+_0x459b12+'\x20\x20'+a14_0x4d3d53['cyan'](formatCredits(_0xf5838b[_0x5e6fcf(0x17c)])[_0x5e6fcf(0x179)](_0xd9ee0e))+'\x20\x20'+String(_0xf5838b['entryCount'])[_0x5e6fcf(0x179)](_0x40cce8)+'\x20\x20'+a14_0x4d3d53[_0x5e6fcf(0x15f)](formatLastUsed(_0xf5838b[_0x5e6fcf(0x16e)])));}console[_0x5e6fcf(0x171)](),console[_0x5e6fcf(0x171)](a14_0x4d3d53[_0x5e6fcf(0x15f)](_0x5e6fcf(0x182))),console['log']();}}
1
+ const a13_0x5839fd=a13_0x15ba;function a13_0x15ba(_0x2babd6,_0x3087bf){_0x2babd6=_0x2babd6-0x74;const _0x91cb9=a13_0x91cb();let _0x15bafc=_0x91cb9[_0x2babd6];return _0x15bafc;}(function(_0x2fe196,_0xe667a6){const _0x8d4669=a13_0x15ba,_0xd69bfb=_0x2fe196();while(!![]){try{const _0x4fb542=parseInt(_0x8d4669(0x79))/0x1*(parseInt(_0x8d4669(0xb6))/0x2)+-parseInt(_0x8d4669(0xa6))/0x3*(parseInt(_0x8d4669(0x97))/0x4)+parseInt(_0x8d4669(0x7b))/0x5+parseInt(_0x8d4669(0xa4))/0x6+parseInt(_0x8d4669(0x85))/0x7+-parseInt(_0x8d4669(0x83))/0x8*(parseInt(_0x8d4669(0x8c))/0x9)+parseInt(_0x8d4669(0xb5))/0xa*(-parseInt(_0x8d4669(0x98))/0xb);if(_0x4fb542===_0xe667a6)break;else _0xd69bfb['push'](_0xd69bfb['shift']());}catch(_0x477f88){_0xd69bfb['push'](_0xd69bfb['shift']());}}}(a13_0x91cb,0xc737d));import a13_0x57fab9 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(_0x487bae){const _0x3b4a19=a13_0x15ba;return _0x487bae[_0x3b4a19(0xb2)](0x2);}function formatLastUsed(_0x14b6b8){const _0x1ac2d4=a13_0x15ba;if(!_0x14b6b8)return'never';const _0x58a9b2=new Date(_0x14b6b8),_0x4d0ff9=new Date(),_0x5a4963=_0x58a9b2['toLocaleDateString'](_0x1ac2d4(0xb0)),_0x1fe70b=_0x4d0ff9['toLocaleDateString']('en-CA');if(_0x5a4963===_0x1fe70b)return'today\x20'+_0x58a9b2[_0x1ac2d4(0xb4)](_0x1ac2d4(0x9a),{'hour':'2-digit','minute':_0x1ac2d4(0x99)});const _0x3724d7=new Date(_0x5a4963),_0x2c0bb0=new Date(_0x1fe70b),_0x5ce16e=Math['round']((_0x2c0bb0['getTime']()-_0x3724d7[_0x1ac2d4(0x86)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5ce16e===0x1)return _0x1ac2d4(0x96);else return _0x5ce16e>0x1&&_0x5ce16e<0x7?_0x5ce16e+_0x1ac2d4(0xa9):_0x58a9b2['toLocaleDateString']('en-US',{'month':_0x1ac2d4(0x88),'day':_0x1ac2d4(0xaa)});}export class ClaudeUsageCommand extends BaseCommand{[a13_0x5839fd(0x77)]='usage';['description']=a13_0x5839fd(0xae);async[a13_0x5839fd(0x7d)](_0x4249ca){const _0x41c2b0=a13_0x5839fd,{options:_0x167851}=_0x4249ca,_0x4d3775=_0x167851['format']===_0x41c2b0(0x87)||_0x167851['format']===_0x41c2b0(0xab)||_0x167851[_0x41c2b0(0x87)];try{const [_0x4562d0,_0x5cf0cd,_0x3e89d9]=await Promise[_0x41c2b0(0x93)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x4d3775?await this[_0x41c2b0(0xaf)](_0x4562d0,_0x5cf0cd,_0x3e89d9,_0x167851):this[_0x41c2b0(0x90)](_0x4562d0,_0x5cf0cd,_0x3e89d9),0x0;}catch(_0x3e5063){const _0x1cbda9=_0x3e5063 instanceof Error?_0x3e5063['message']:_0x41c2b0(0xb3);return console[_0x41c2b0(0x9d)](a13_0x57fab9[_0x41c2b0(0xac)]('Error:\x20'+_0x1cbda9)),0x1;}}async[a13_0x5839fd(0xaf)](_0x34242c,_0x4e431f,_0x22f855,_0x43e6dd){const _0x445db3=a13_0x5839fd,_0x18bba6={'summary':{'todayCredits':_0x22f855[_0x445db3(0x7a)],'monthCredits':_0x22f855['monthCredits'],'totalCredits':_0x22f855[_0x445db3(0x8d)],'profileCount':_0x22f855['profileCount']},'profiles':_0x34242c[_0x445db3(0xa3)](_0x298235=>({'profile':_0x298235[_0x445db3(0x8e)],'credits':_0x298235[_0x445db3(0xa2)],'requests':_0x298235[_0x445db3(0x81)],'lastUsedAt':_0x298235['lastUsedAt']})),'sources':_0x4e431f[_0x445db3(0xa3)](_0x2bc32e=>({'source':_0x2bc32e[_0x445db3(0x7f)],'credits':_0x2bc32e[_0x445db3(0xa2)],'todayCredits':_0x2bc32e[_0x445db3(0x7a)],'monthCredits':_0x2bc32e['monthCredits'],'requests':_0x2bc32e[_0x445db3(0x81)]}))};await handleSDKOutput([_0x18bba6],_0x43e6dd);}['outputTable'](_0x243e6b,_0x410dcc,_0x4e90f1){const _0x262792=a13_0x5839fd;console['log'](a13_0x57fab9[_0x262792(0xa0)](_0x262792(0x82))),console[_0x262792(0x76)](a13_0x57fab9[_0x262792(0x8f)]('─'[_0x262792(0x89)](0x32))),console['log'](_0x262792(0x78)+a13_0x57fab9['cyan'](formatCredits(_0x4e90f1[_0x262792(0x7a)]))+_0x262792(0xa7)),console[_0x262792(0x76)](_0x262792(0x9e)+a13_0x57fab9[_0x262792(0x84)](formatCredits(_0x4e90f1[_0x262792(0x75)]))+_0x262792(0xa7)),console[_0x262792(0x76)](_0x262792(0x8a)+a13_0x57fab9[_0x262792(0x84)](formatCredits(_0x4e90f1[_0x262792(0x8d)]))+'\x20credits'),console[_0x262792(0x76)]();if(_0x410dcc[_0x262792(0x8b)]>0x0){console['log'](a13_0x57fab9['bold'](_0x262792(0xad))),console[_0x262792(0x76)](a13_0x57fab9['dim']('─'[_0x262792(0x89)](0x3c)));const _0x5e1b99=0xc,_0x207cf0=0xa,_0xffa763=0xa,_0x45c895=0xa;console[_0x262792(0x76)]('\x20\x20'+'Source'[_0x262792(0x80)](_0x5e1b99)+'\x20\x20'+'Total'[_0x262792(0x9f)](_0x207cf0)+'\x20\x20'+_0x262792(0xb1)[_0x262792(0x9f)](_0xffa763)+'\x20\x20'+_0x262792(0x9b)[_0x262792(0x9f)](_0x45c895));for(const _0x19e811 of _0x410dcc){console['log']('\x20\x20'+_0x19e811[_0x262792(0x7f)][_0x262792(0x80)](_0x5e1b99)+'\x20\x20'+a13_0x57fab9[_0x262792(0x84)](formatCredits(_0x19e811[_0x262792(0xa2)])['padStart'](_0x207cf0))+'\x20\x20'+formatCredits(_0x19e811[_0x262792(0x7a)])[_0x262792(0x9f)](_0xffa763)+'\x20\x20'+formatCredits(_0x19e811[_0x262792(0x75)])[_0x262792(0x9f)](_0x45c895));}console[_0x262792(0x76)]();}if(_0x243e6b[_0x262792(0x8b)]===0x0){console['log'](a13_0x57fab9[_0x262792(0x8f)](_0x262792(0x94))),console['log'](a13_0x57fab9[_0x262792(0x8f)](_0x262792(0x92)));return;}console[_0x262792(0x76)](a13_0x57fab9[_0x262792(0xa0)](_0x262792(0x95))),console[_0x262792(0x76)](a13_0x57fab9[_0x262792(0x8f)]('─'[_0x262792(0x89)](0x3c)));const _0x61192c=Math['max'](0xc,..._0x243e6b[_0x262792(0xa3)](_0x48f771=>_0x48f771['profile']===_0x262792(0x7c)?_0x262792(0x7e)[_0x262792(0x8b)]:_0x48f771[_0x262792(0x8e)]['length'])),_0x49b3a5=0xa,_0x2ee6cf=0xa;console[_0x262792(0x76)]('\x20\x20'+_0x262792(0xa5)[_0x262792(0x80)](_0x61192c)+'\x20\x20'+_0x262792(0x74)[_0x262792(0x9f)](_0x49b3a5)+'\x20\x20'+_0x262792(0xa1)[_0x262792(0x9f)](_0x2ee6cf)+'\x20\x20'+_0x262792(0x91));for(const _0x2cb0fc of _0x243e6b){const _0x49dd08=_0x2cb0fc[_0x262792(0x8e)]==='default'?_0x262792(0x7e):_0x2cb0fc[_0x262792(0x8e)],_0x4e4bab=_0x49dd08[_0x262792(0x80)](_0x61192c),_0x240980=_0x2cb0fc[_0x262792(0x8e)]===_0x262792(0x7c)?a13_0x57fab9['dim'](_0x4e4bab):_0x4e4bab;console['log']('\x20\x20'+_0x240980+'\x20\x20'+a13_0x57fab9['cyan'](formatCredits(_0x2cb0fc[_0x262792(0xa2)])[_0x262792(0x9f)](_0x49b3a5))+'\x20\x20'+String(_0x2cb0fc[_0x262792(0x81)])[_0x262792(0x9f)](_0x2ee6cf)+'\x20\x20'+a13_0x57fab9[_0x262792(0x8f)](formatLastUsed(_0x2cb0fc[_0x262792(0x9c)])));}console['log'](),console[_0x262792(0x76)](a13_0x57fab9[_0x262792(0x8f)](_0x262792(0xa8))),console[_0x262792(0x76)]();}}function a13_0x91cb(){const _0x49e60a=['monthCredits','log','name','\x20\x20Today:\x20\x20\x20','838ewDzZF','todayCredits','4917145FXpZHB','default','execute','(default)','source','padEnd','entryCount','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','8sLDUxP','cyan','3582355bNRYRc','getTime','json','short','repeat','\x20\x20Total:\x20\x20\x20','length','9447849lffoME','totalCredits','profile','dim','outputTable','Last\x20Used','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','all','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Usage\x20by\x20Profile','yesterday','8bmDqYf','178717iEvQGO','2-digit','en-US','Month','lastUsedAt','error','\x20\x20Month:\x20\x20\x20','padStart','bold','Requests','credits','map','1549992WGuaoc','Profile','1248162FYIjwR','\x20credits','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','\x20days\x20ago','numeric','jsonl','red','Usage\x20by\x20Source','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','outputStructured','en-CA','Today','toFixed','Unknown\x20error','toLocaleTimeString','80mbZLpt','2564xCITrO','Credits'];a13_0x91cb=function(){return _0x49e60a;};return a13_0x91cb();}
@@ -1 +1 @@
1
- const a15_0x5afa98=a15_0x258d;(function(_0x27915d,_0x524443){const _0x4f400d=a15_0x258d,_0x102ee1=_0x27915d();while(!![]){try{const _0x40b204=parseInt(_0x4f400d(0x115))/0x1*(parseInt(_0x4f400d(0x11d))/0x2)+parseInt(_0x4f400d(0x104))/0x3*(parseInt(_0x4f400d(0x106))/0x4)+parseInt(_0x4f400d(0x111))/0x5*(parseInt(_0x4f400d(0x110))/0x6)+-parseInt(_0x4f400d(0xfe))/0x7+parseInt(_0x4f400d(0x127))/0x8*(-parseInt(_0x4f400d(0x11e))/0x9)+parseInt(_0x4f400d(0x12f))/0xa+parseInt(_0x4f400d(0x101))/0xb*(-parseInt(_0x4f400d(0x129))/0xc);if(_0x40b204===_0x524443)break;else _0x102ee1['push'](_0x102ee1['shift']());}catch(_0x2883b3){_0x102ee1['push'](_0x102ee1['shift']());}}}(a15_0x5623,0xd4995));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a15_0x5623(){const _0x1bbf1f=['test','error','To\x20check\x20your\x20current\x20auth\x20status:','dim','9369689iGmuBs','tdx\x20auth\x20setup','execute','459140xOHsDW','message','command','310533nQhdZi','helpText','4OhkVqg','stack','run','red','getAll','from','debug','get','category','commands','7810062vDXeeF','5qNweZn','cyan','options','\x20--profile\x20','1mehrIl','validateGlobalOptions','Error:\x20','isValid','Invalid\x20limit\x20value:\x20','\x0aStack\x20trace:\x0a','status','values','1927654TmllVO','63cKoOAf','Authentication\x20error\x20stack\x20trace:','USER_ERROR','\x27\x20is\x20already\x20registered','name','number','detail','Authentication\x20failed','yellow','1328840qTVuKh','has','132WOnEqo','.\x20Must\x20be\x20a\x20number.','validate','limit','value','tdx\x20auth','14621920TaPHsT'];a15_0x5623=function(){return _0x1bbf1f;};return a15_0x5623();}import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a15_0x307ae7 from'chalk';function a15_0x258d(_0x15da71,_0x28e310){_0x15da71=_0x15da71-0xfa;const _0x5623c0=a15_0x5623();let _0x258d09=_0x5623c0[_0x15da71];return _0x258d09;}export function printAuthError(_0x4e82bd,_0xd93899=![],_0x594640){const _0x22b4de=a15_0x258d,_0x1cb744=_0x4e82bd['problemDetails']?.[_0x22b4de(0x124)]||_0x4e82bd[_0x22b4de(0x102)];console[_0x22b4de(0xfb)](a15_0x307ae7[_0x22b4de(0x109)](_0x22b4de(0x125))),console['error'](a15_0x307ae7['red']('Reason:\x20'+_0x1cb744));if(_0xd93899){const _0x54b456=_0x594640?_0x22b4de(0x114)+_0x594640:'';console[_0x22b4de(0xfb)]('\x0a'+a15_0x307ae7[_0x22b4de(0xfd)]('To\x20set\x20up\x20authentication:')),console['error']('\x20\x20'+a15_0x307ae7[_0x22b4de(0x112)](_0x22b4de(0xff)+_0x54b456)+'\x0a'),console[_0x22b4de(0xfb)](''+a15_0x307ae7['dim'](_0x22b4de(0xfc))),console['error']('\x20\x20'+a15_0x307ae7['cyan'](_0x22b4de(0x12e)+_0x54b456));}}export class BaseCommand{['validateGlobalOptions'](_0x1fa779){const _0x237116=a15_0x258d,{options:_0xe266e0}=_0x1fa779,_0x4e8c32=_0xe266e0[_0x237116(0x12c)];if(_0x4e8c32!==undefined){const _0x3c96d3=typeof _0x4e8c32===_0x237116(0x123)?_0x4e8c32:parseInt(_0x4e8c32,0xa);if(isNaN(_0x3c96d3))return _0x237116(0x119)+_0x4e8c32+_0x237116(0x12a);const _0x1111c3=validateLimitOption(_0x3c96d3);if(!_0x1111c3[_0x237116(0x118)])return _0x1111c3['error'];_0x1fa779[_0x237116(0x113)][_0x237116(0x12c)]=_0x1111c3[_0x237116(0x12d)];}return undefined;}[a15_0x5afa98(0x12b)](_0x4cf93e){return undefined;}async[a15_0x5afa98(0x108)](_0x224397){const _0x554070=a15_0x5afa98;try{const _0x45ceb3=this[_0x554070(0x116)](_0x224397);if(_0x45ceb3)return console[_0x554070(0xfb)](_0x554070(0x117)+_0x45ceb3),0x1;const _0x1d7a0f=this[_0x554070(0x12b)](_0x224397);if(_0x1d7a0f){const _0x112bd6=/^\s*(Usage|Note|Warning|Error):/i[_0x554070(0xfa)](_0x1d7a0f);return _0x112bd6?console[_0x554070(0xfb)](_0x1d7a0f):console[_0x554070(0xfb)](_0x554070(0x117)+_0x1d7a0f),0x1;}const _0x3d3444=await this[_0x554070(0x100)](_0x224397);return _0x3d3444??0x0;}catch(_0x170d73){if(_0x170d73 instanceof Error){if(_0x170d73 instanceof HTTPClientError&&_0x170d73[_0x554070(0x11b)]===0x191){const _0x5b3591=_0x224397[_0x554070(0x113)]['profile'];printAuthError(_0x170d73,!![],_0x5b3591);if(_0x170d73[_0x554070(0x107)]){const _0x3df1a2=Logger['of'](_0x554070(0x103));_0x3df1a2[_0x554070(0x10c)](_0x554070(0x11f)),_0x3df1a2[_0x554070(0x10c)](_0x170d73[_0x554070(0x107)]);}return 0x1;}console[_0x554070(0xfb)](a15_0x307ae7[_0x554070(0x109)](_0x554070(0x117)+_0x170d73[_0x554070(0x102)]));_0x170d73 instanceof SDKError&&_0x170d73['helpText']&&console[_0x554070(0xfb)](a15_0x307ae7[_0x554070(0x126)](_0x170d73[_0x554070(0x105)]));const _0x1766ef=_0x170d73 instanceof SDKError&&_0x170d73[_0x554070(0x10e)]===ErrorCategory[_0x554070(0x120)];_0x170d73[_0x554070(0x107)]&&!_0x1766ef&&console[_0x554070(0xfb)](_0x554070(0x11a)+_0x170d73['stack']);}else console[_0x554070(0xfb)](_0x554070(0x117)+String(_0x170d73));return 0x1;}}}export class CommandRegistry{['commands']=new Map();['register'](_0xf569ba){const _0x3b6fd0=a15_0x5afa98;if(this['commands'][_0x3b6fd0(0x128)](_0xf569ba['name']))throw new Error('Command\x20\x27'+_0xf569ba[_0x3b6fd0(0x122)]+_0x3b6fd0(0x121));this['commands']['set'](_0xf569ba[_0x3b6fd0(0x122)],_0xf569ba);}[a15_0x5afa98(0x10d)](_0x2f8941){const _0x2f0110=a15_0x5afa98;return this[_0x2f0110(0x10f)]['get'](_0x2f8941);}[a15_0x5afa98(0x10a)](){const _0x4ba1ec=a15_0x5afa98;return Array[_0x4ba1ec(0x10b)](this[_0x4ba1ec(0x10f)][_0x4ba1ec(0x11c)]());}[a15_0x5afa98(0x128)](_0xe4fbf){const _0x400e66=a15_0x5afa98;return this[_0x400e66(0x10f)]['has'](_0xe4fbf);}}export const registry=new CommandRegistry();
1
+ const a14_0x28894d=a14_0x660c;(function(_0x31a1e9,_0x4be0b9){const _0x9f87d0=a14_0x660c,_0x23abb7=_0x31a1e9();while(!![]){try{const _0x1534f0=-parseInt(_0x9f87d0(0xea))/0x1*(-parseInt(_0x9f87d0(0xd7))/0x2)+parseInt(_0x9f87d0(0xd1))/0x3*(parseInt(_0x9f87d0(0xf0))/0x4)+-parseInt(_0x9f87d0(0xd9))/0x5*(-parseInt(_0x9f87d0(0xcc))/0x6)+parseInt(_0x9f87d0(0xe6))/0x7*(-parseInt(_0x9f87d0(0xed))/0x8)+-parseInt(_0x9f87d0(0xde))/0x9+parseInt(_0x9f87d0(0xe1))/0xa*(parseInt(_0x9f87d0(0xee))/0xb)+-parseInt(_0x9f87d0(0xd8))/0xc;if(_0x1534f0===_0x4be0b9)break;else _0x23abb7['push'](_0x23abb7['shift']());}catch(_0x3dbded){_0x23abb7['push'](_0x23abb7['shift']());}}}(a14_0x5b26,0xc99cf));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_0x7d782a from'chalk';export function printAuthError(_0x5db784,_0x4a7118=![],_0x5cc74a){const _0x494b60=a14_0x660c,_0x4792e2=_0x5db784[_0x494b60(0xf5)]?.[_0x494b60(0xff)]||_0x5db784[_0x494b60(0xdb)];console[_0x494b60(0xdf)](a14_0x7d782a[_0x494b60(0xe8)]('Authentication\x20failed')),console[_0x494b60(0xdf)](a14_0x7d782a['red'](_0x494b60(0xfa)+_0x4792e2));if(_0x4a7118){const _0x311da6=_0x5cc74a?_0x494b60(0xf4)+_0x5cc74a:'';console[_0x494b60(0xdf)]('\x0a'+a14_0x7d782a[_0x494b60(0xeb)](_0x494b60(0xf1))),console[_0x494b60(0xdf)]('\x20\x20'+a14_0x7d782a[_0x494b60(0xfb)]('tdx\x20auth\x20setup'+_0x311da6)+'\x0a'),console[_0x494b60(0xdf)](''+a14_0x7d782a[_0x494b60(0xeb)](_0x494b60(0xe7))),console['error']('\x20\x20'+a14_0x7d782a[_0x494b60(0xfb)](_0x494b60(0xe2)+_0x311da6));}}function a14_0x660c(_0x1a65c8,_0x2d1c75){_0x1a65c8=_0x1a65c8-0xc8;const _0x5b261c=a14_0x5b26();let _0x660ca9=_0x5b261c[_0x1a65c8];return _0x660ca9;}function a14_0x5b26(){const _0x2b2080=['Error:\x20','isValid','1658902UbCYtd','To\x20check\x20your\x20current\x20auth\x20status:','red','profile','1TEcRZh','dim','\x27\x20is\x20already\x20registered','8KsdHSe','11SFjYit','number','8vRYpub','To\x20set\x20up\x20authentication:','has','execute','\x20--profile\x20','problemDetails','validateGlobalOptions','.\x20Must\x20be\x20a\x20number.','set','value','Reason:\x20','cyan','name','commands','USER_ERROR','detail','getAll','run','yellow','helpText','limit','1123692vUUtcq','from','test','values','debug','1690041NipjnU','status','options','category','stack','get','1185710mBJigp','22396980QduuqD','10uEhYFX','Authentication\x20error\x20stack\x20trace:','message','validate','register','4840200XTYpPA','error','command','13728950KBOCAn','tdx\x20auth','Command\x20\x27'];a14_0x5b26=function(){return _0x2b2080;};return a14_0x5b26();}export class BaseCommand{['validateGlobalOptions'](_0x55acb5){const _0x5b0fd7=a14_0x660c,{options:_0x5bbb43}=_0x55acb5,_0x405021=_0x5bbb43[_0x5b0fd7(0xcb)];if(_0x405021!==undefined){const _0xaec99f=typeof _0x405021===_0x5b0fd7(0xef)?_0x405021:parseInt(_0x405021,0xa);if(isNaN(_0xaec99f))return'Invalid\x20limit\x20value:\x20'+_0x405021+_0x5b0fd7(0xf7);const _0x191cdb=validateLimitOption(_0xaec99f);if(!_0x191cdb[_0x5b0fd7(0xe5)])return _0x191cdb[_0x5b0fd7(0xdf)];_0x55acb5[_0x5b0fd7(0xd3)]['limit']=_0x191cdb[_0x5b0fd7(0xf9)];}return undefined;}['validate'](_0x17e06e){return undefined;}async[a14_0x28894d(0xc8)](_0x3e7e4b){const _0x5dda59=a14_0x28894d;try{const _0x2946e0=this[_0x5dda59(0xf6)](_0x3e7e4b);if(_0x2946e0)return console[_0x5dda59(0xdf)](_0x5dda59(0xe4)+_0x2946e0),0x1;const _0x44c1ae=this[_0x5dda59(0xdc)](_0x3e7e4b);if(_0x44c1ae){const _0x75fc97=/^\s*(Usage|Note|Warning|Error):/i[_0x5dda59(0xce)](_0x44c1ae);return _0x75fc97?console[_0x5dda59(0xdf)](_0x44c1ae):console[_0x5dda59(0xdf)]('Error:\x20'+_0x44c1ae),0x1;}const _0x4f4914=await this[_0x5dda59(0xf3)](_0x3e7e4b);return _0x4f4914??0x0;}catch(_0x23a0da){if(_0x23a0da instanceof Error){if(_0x23a0da instanceof HTTPClientError&&_0x23a0da[_0x5dda59(0xd2)]===0x191){const _0x2a7ddb=_0x3e7e4b[_0x5dda59(0xd3)][_0x5dda59(0xe9)];printAuthError(_0x23a0da,!![],_0x2a7ddb);if(_0x23a0da[_0x5dda59(0xd5)]){const _0x544a94=Logger['of'](_0x5dda59(0xe0));_0x544a94['debug'](_0x5dda59(0xda)),_0x544a94[_0x5dda59(0xd0)](_0x23a0da[_0x5dda59(0xd5)]);}return 0x1;}console[_0x5dda59(0xdf)](a14_0x7d782a[_0x5dda59(0xe8)](_0x5dda59(0xe4)+_0x23a0da[_0x5dda59(0xdb)]));_0x23a0da instanceof SDKError&&_0x23a0da[_0x5dda59(0xca)]&&console['error'](a14_0x7d782a[_0x5dda59(0xc9)](_0x23a0da[_0x5dda59(0xca)]));const _0xd77c23=_0x23a0da instanceof SDKError&&_0x23a0da[_0x5dda59(0xd4)]===ErrorCategory[_0x5dda59(0xfe)];_0x23a0da['stack']&&!_0xd77c23&&console[_0x5dda59(0xdf)]('\x0aStack\x20trace:\x0a'+_0x23a0da[_0x5dda59(0xd5)]);}else console['error'](_0x5dda59(0xe4)+String(_0x23a0da));return 0x1;}}}export class CommandRegistry{[a14_0x28894d(0xfd)]=new Map();[a14_0x28894d(0xdd)](_0x1cf6b3){const _0x27ef79=a14_0x28894d;if(this[_0x27ef79(0xfd)][_0x27ef79(0xf2)](_0x1cf6b3[_0x27ef79(0xfc)]))throw new Error(_0x27ef79(0xe3)+_0x1cf6b3['name']+_0x27ef79(0xec));this[_0x27ef79(0xfd)][_0x27ef79(0xf8)](_0x1cf6b3[_0x27ef79(0xfc)],_0x1cf6b3);}['get'](_0x2e96fc){const _0x1c5f21=a14_0x28894d;return this[_0x1c5f21(0xfd)][_0x1c5f21(0xd6)](_0x2e96fc);}[a14_0x28894d(0x100)](){const _0x333f95=a14_0x28894d;return Array[_0x333f95(0xcd)](this[_0x333f95(0xfd)][_0x333f95(0xcf)]());}[a14_0x28894d(0xf2)](_0x410175){const _0xa08e49=a14_0x28894d;return this['commands'][_0xa08e49(0xf2)](_0x410175);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a16_0x21261b=a16_0x2300;function a16_0x2300(_0x27a2b2,_0x1770e1){_0x27a2b2=_0x27a2b2-0x79;const _0x3ad916=a16_0x3ad9();let _0x23005f=_0x3ad916[_0x27a2b2];return _0x23005f;}(function(_0x354d7d,_0x79d698){const _0x33afcc=a16_0x2300,_0x2d50a1=_0x354d7d();while(!![]){try{const _0x24afa6=parseInt(_0x33afcc(0x7f))/0x1+parseInt(_0x33afcc(0xb7))/0x2*(parseInt(_0x33afcc(0x82))/0x3)+parseInt(_0x33afcc(0xc3))/0x4+-parseInt(_0x33afcc(0xab))/0x5*(-parseInt(_0x33afcc(0xd9))/0x6)+parseInt(_0x33afcc(0x84))/0x7*(parseInt(_0x33afcc(0xd8))/0x8)+parseInt(_0x33afcc(0x81))/0x9*(parseInt(_0x33afcc(0x8f))/0xa)+parseInt(_0x33afcc(0x99))/0xb*(-parseInt(_0x33afcc(0xc7))/0xc);if(_0x24afa6===_0x79d698)break;else _0x2d50a1['push'](_0x2d50a1['shift']());}catch(_0x176719){_0x2d50a1['push'](_0x2d50a1['shift']());}}}(a16_0x3ad9,0xcdaa7));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 a16_0x5ed6b9 from'chalk';function normalizeSchemaForDisplay(_0x5caf7a){const _0x311bcd=a16_0x2300,_0x1b012d=_0x5caf7a[_0x311bcd(0xd0)]||[],_0x435445=_0x1b012d['find'](_0x5b3e95=>_0x5b3e95[_0x311bcd(0xe6)]===_0x311bcd(0xb3)&&_0x5b3e95[_0x311bcd(0x7d)]==='record'&&_0x5b3e95[_0x311bcd(0xd0)]);if(_0x435445?.[_0x311bcd(0xd0)]){const _0x9f3626=_0x1b012d[_0x311bcd(0x98)](_0x4db6db=>_0x4db6db[_0x311bcd(0xe6)]!==_0x311bcd(0xa5)&&_0x4db6db[_0x311bcd(0xe6)]!==_0x311bcd(0xb3));return[..._0x9f3626,..._0x435445[_0x311bcd(0xd0)]];}return _0x1b012d[_0x311bcd(0x98)](_0x5cbced=>_0x5cbced[_0x311bcd(0xe6)]!==_0x311bcd(0xa5));}function printSchemaFields(_0x21548d,_0x58571c){const _0x1a5ccd=a16_0x2300,_0x1f3bd2='\x20\x20'[_0x1a5ccd(0xae)](_0x58571c+0x1),_0xa7c011='\x20\x20'[_0x1a5ccd(0xae)](_0x58571c+0x2);for(const _0x3ffa42 of _0x21548d){if(!_0x3ffa42[_0x1a5ccd(0xe6)])continue;const _0x5e8e9c=_0x3ffa42[_0x1a5ccd(0x7d)]===_0x1a5ccd(0xd2)&&_0x3ffa42[_0x1a5ccd(0xd0)]&&_0x3ffa42[_0x1a5ccd(0xd0)][_0x1a5ccd(0x8e)]>0x0&&_0x3ffa42[_0x1a5ccd(0xe6)]!==_0x1a5ccd(0xb3);let _0x5ceecf=''+_0x1f3bd2+a16_0x5ed6b9[_0x1a5ccd(0xa3)](_0x3ffa42[_0x1a5ccd(0xe6)]);_0x3ffa42[_0x1a5ccd(0x96)]&&(_0x5ceecf+=':\x20'+_0x3ffa42[_0x1a5ccd(0x96)]);if(_0x3ffa42[_0x1a5ccd(0xa6)])_0x5ceecf+=a16_0x5ed6b9[_0x1a5ccd(0xc5)]('\x20['+_0x3ffa42[_0x1a5ccd(0xa6)]+']');else _0x5e8e9c&&(_0x5ceecf+=a16_0x5ed6b9[_0x1a5ccd(0xc5)](_0x1a5ccd(0x9e)));console[_0x1a5ccd(0xb0)](_0x5ceecf);_0x3ffa42[_0x1a5ccd(0xbe)]&&console[_0x1a5ccd(0xb0)](''+_0xa7c011+a16_0x5ed6b9['dim'](_0x3ffa42[_0x1a5ccd(0xbe)]));if(_0x3ffa42[_0x1a5ccd(0xba)]){const _0x2e3626=_0x3ffa42['enumeration'][_0x1a5ccd(0xaf)](_0x3f45e6=>typeof _0x3f45e6===_0x1a5ccd(0xe2)&&'value'in _0x3f45e6?_0x3f45e6['value']:_0x3f45e6)[_0x1a5ccd(0x87)](',\x20');console['log'](_0xa7c011+_0x1a5ccd(0xbb)+a16_0x5ed6b9[_0x1a5ccd(0x88)](_0x2e3626));}_0x3ffa42['default_value']!==undefined&&console['log'](_0xa7c011+_0x1a5ccd(0xb2)+a16_0x5ed6b9[_0x1a5ccd(0xcd)](String(_0x3ffa42[_0x1a5ccd(0x7b)])));if(_0x3ffa42['minimum']!==undefined||_0x3ffa42[_0x1a5ccd(0x97)]!==undefined){const _0x2fcc08=_0x3ffa42['minimum']!==undefined&&_0x3ffa42[_0x1a5ccd(0x97)]!==undefined?_0x3ffa42[_0x1a5ccd(0x95)]+_0x1a5ccd(0xc1)+_0x3ffa42[_0x1a5ccd(0x97)]:_0x3ffa42[_0x1a5ccd(0x95)]!==undefined?_0x1a5ccd(0xa4)+_0x3ffa42[_0x1a5ccd(0x95)]:'<=\x20'+_0x3ffa42[_0x1a5ccd(0x97)];console[_0x1a5ccd(0xb0)](_0xa7c011+_0x1a5ccd(0xc4)+a16_0x5ed6b9[_0x1a5ccd(0xcd)](_0x2fcc08));}if(_0x3ffa42[_0x1a5ccd(0xe0)]){const _0x38c8bc=Object[_0x1a5ccd(0xe1)](_0x3ffa42[_0x1a5ccd(0xe0)])[_0x1a5ccd(0xaf)](([_0x47f4c1,_0x326575])=>_0x47f4c1+'='+JSON[_0x1a5ccd(0x85)](_0x326575))[_0x1a5ccd(0x87)](',\x20');console[_0x1a5ccd(0xb0)](''+_0xa7c011+a16_0x5ed6b9[_0x1a5ccd(0xc5)]('Show\x20when:\x20'+_0x38c8bc));}_0x5e8e9c&&_0x3ffa42[_0x1a5ccd(0xd0)]&&printSchemaFields(_0x3ffa42[_0x1a5ccd(0xd0)],_0x58571c+0x1);}}export class ConnectionListCommand extends BaseCommand{['name']=a16_0x21261b(0xb1);[a16_0x21261b(0xbe)]=a16_0x21261b(0xa0);async['execute'](_0x5d5926){const _0x1b7598=a16_0x21261b,{options:_0x107c3e,tdx:_0x3b16f5}=_0x5d5926;_0x107c3e[_0x1b7598(0xbc)]&&console[_0x1b7598(0x86)](_0x1b7598(0xa7)+_0x107c3e[_0x1b7598(0xad)]);const _0x4a35d7=resolveLimit(_0x107c3e[_0x1b7598(0xb4)],DEFAULT_LISTING_LIMIT),_0x1e904=await withSpinner(_0x1b7598(0x90),()=>_0x3b16f5[_0x1b7598(0x9f)][_0x1b7598(0x8a)](),{'verbose':_0x107c3e['verbose']}),_0x34899d=_0x1e904['data'];console[_0x1b7598(0x86)]('✔\x20Found\x20'+_0x34899d[_0x1b7598(0x8e)]+'\x20connection'+(_0x34899d[_0x1b7598(0x8e)]!==0x1?'s':''));if(isStructuredFormat(_0x107c3e)){const _0xeea447=_0x34899d[_0x1b7598(0xc9)](0x0,_0x4a35d7);await handleSDKOutput(_0xeea447,{..._0x107c3e,'limit':_0x4a35d7});}else{const _0x27318f=_0x34899d[_0x1b7598(0x8e)]>0x0?Math[_0x1b7598(0xe5)](..._0x34899d[_0x1b7598(0xaf)](_0x44fde0=>_0x44fde0[_0x1b7598(0x7d)][_0x1b7598(0x8e)])):0x0,_0x54378c=[];for(const _0x598f9b of _0x34899d){const _0xf68b21=a16_0x5ed6b9[_0x1b7598(0xd1)](_0x598f9b[_0x1b7598(0x7d)][_0x1b7598(0x8d)](_0x27318f)),_0x1200f3=_0x598f9b['owner']?.[_0x1b7598(0xe6)]?'\x20-\x20'+a16_0x5ed6b9[_0x1b7598(0xc5)](_0x598f9b[_0x1b7598(0xdf)][_0x1b7598(0xe6)]):'';_0x54378c[_0x1b7598(0x7e)](_0xf68b21+'\x20\x20'+_0x598f9b[_0x1b7598(0xe6)]+_0x1200f3);}await writeOutput(_0x54378c[_0x1b7598(0x87)]('\x0a'),_0x107c3e[_0x1b7598(0xb9)],'table');}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a16_0x21261b(0xe6)]=a16_0x21261b(0xd7);[a16_0x21261b(0xbe)]=a16_0x21261b(0x7c);[a16_0x21261b(0xc2)](_0x568ae8){const _0x3fc7b9=a16_0x21261b,{args:_0x199cef}=_0x568ae8;if(!_0x199cef[0x0])return _0x3fc7b9(0xa1);return undefined;}async[a16_0x21261b(0xa9)](_0x361a4b){const _0x4d45cf=a16_0x21261b,{options:_0x416354,args:_0x5dd390,tdx:_0x56db7d}=_0x361a4b,_0x5da7fc=_0x5dd390[0x0];_0x416354['verbose']&&(console[_0x4d45cf(0x86)](_0x4d45cf(0xa7)+_0x416354[_0x4d45cf(0xad)]),console[_0x4d45cf(0x86)]('Looking\x20up\x20connection:\x20'+_0x5da7fc));const _0x36bea4=await withSpinner(_0x4d45cf(0x91)+_0x5da7fc+_0x4d45cf(0xc6),()=>_0x56db7d['connection']['resolve'](_0x5da7fc),{'verbose':_0x416354[_0x4d45cf(0xbc)]}),_0x237fc9=_0x36bea4[_0x4d45cf(0x7a)];return console[_0x4d45cf(0x86)](_0x4d45cf(0xe4)+_0x237fc9[_0x4d45cf(0xe6)]),await handleSingleObjectOutput(_0x237fc9,_0x416354),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a16_0x21261b(0xe6)]=a16_0x21261b(0xb5);[a16_0x21261b(0xbe)]=a16_0x21261b(0x8b);[a16_0x21261b(0xc2)](_0x365dbc){const _0x143772=a16_0x21261b,{args:_0x1579c9}=_0x365dbc;if(!_0x1579c9[0x0])return _0x143772(0x9c);return undefined;}async[a16_0x21261b(0xa9)](_0x12759e){const _0x299222=a16_0x21261b,{options:_0x48de38,args:_0x433ff2,tdx:_0x576280}=_0x12759e,_0x516004=_0x433ff2[0x0];_0x48de38[_0x299222(0xbc)]&&(console[_0x299222(0x86)]('Site:\x20'+_0x48de38[_0x299222(0xad)]),console['error']('Resolving\x20connector\x20type\x20or\x20name:\x20'+_0x516004));let _0xd7c269=_0x516004,_0x12ba00;try{const _0x21706a=await _0x576280[_0x299222(0x9f)][_0x299222(0x9d)](_0x516004);_0x21706a&&(_0xd7c269=_0x21706a['type'],_0x12ba00=_0x21706a['name'],_0x48de38[_0x299222(0xbc)]&&console['error'](_0x299222(0xdc)+_0x516004+_0x299222(0x80)+_0xd7c269));}catch{_0x48de38['verbose']&&console[_0x299222(0x86)](_0x299222(0xd5)+_0x516004+_0x299222(0x94));}const _0x46c934=await withSpinner(_0x299222(0x93)+_0xd7c269+'\x27...',()=>_0x576280[_0x299222(0x9f)][_0x299222(0x9b)](_0xd7c269),{'verbose':_0x48de38[_0x299222(0xbc)]}),_0x1b14d5=_0x46c934['data'];_0x12ba00?console[_0x299222(0x86)](_0x299222(0x8c)+_0x12ba00+'\x27\x20(type:\x20'+_0xd7c269+')'):console['error']('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0xd7c269);if(isStructuredFormat(_0x48de38))await handleSingleObjectOutput(_0x1b14d5,_0x48de38);else{const _0x258650=normalizeSchemaForDisplay(_0x1b14d5);_0x12ba00?(console[_0x299222(0xb0)](_0x299222(0xac)+a16_0x5ed6b9[_0x299222(0xd1)](_0x12ba00)),console[_0x299222(0xb0)](_0x299222(0xc8)+a16_0x5ed6b9[_0x299222(0xc5)](_0xd7c269))):console[_0x299222(0xb0)](_0x299222(0x79)+a16_0x5ed6b9[_0x299222(0xd1)](_0xd7c269)),_0x258650[_0x299222(0x8e)]>0x0?(console[_0x299222(0xb0)](a16_0x5ed6b9[_0x299222(0xa8)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x258650,0x0)):console[_0x299222(0xb0)](a16_0x5ed6b9[_0x299222(0xc5)]('\x0aNo\x20fields\x20defined\x20in\x20schema'));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a16_0x21261b(0xb8);[a16_0x21261b(0xbe)]=a16_0x21261b(0xbd);async[a16_0x21261b(0xa9)](_0x1d0c9e){const _0x1151c1=a16_0x21261b,{options:_0x6208e1,tdx:_0xfb1812}=_0x1d0c9e;_0x6208e1[_0x1151c1(0xbc)]&&console['error']('Site:\x20'+_0x6208e1[_0x1151c1(0xad)]);const _0x5ce3f2=await withSpinner(_0x1151c1(0xda),()=>_0xfb1812[_0x1151c1(0x9f)][_0x1151c1(0xa2)](),{'verbose':_0x6208e1[_0x1151c1(0xbc)]}),_0x5cb9a1=_0x5ce3f2[_0x1151c1(0x7a)][_0x1151c1(0xe3)]((_0x42ff0c,_0x3d44f8)=>_0x42ff0c[_0x1151c1(0x7d)][_0x1151c1(0xb6)](_0x3d44f8[_0x1151c1(0x7d)]));console[_0x1151c1(0x86)]('✔\x20Found\x20'+_0x5cb9a1[_0x1151c1(0x8e)]+'\x20connector\x20type'+(_0x5cb9a1[_0x1151c1(0x8e)]!==0x1?'s':''));if(isStructuredFormat(_0x6208e1))await handleSDKOutput(_0x5cb9a1,_0x6208e1);else{const _0x5c189=_0x5cb9a1[_0x1151c1(0x8e)]>0x0?Math[_0x1151c1(0xe5)](..._0x5cb9a1[_0x1151c1(0xaf)](_0x532182=>_0x532182[_0x1151c1(0x7d)]['length'])):0x0,_0xe2714f=[];for(const _0x5ca965 of _0x5cb9a1){const _0x50a88a=a16_0x5ed6b9[_0x1151c1(0xd1)](_0x5ca965[_0x1151c1(0x7d)]['padStart'](_0x5c189));_0xe2714f['push'](_0x50a88a+'\x20\x20'+_0x5ca965[_0x1151c1(0xe6)]);}await writeOutput(_0xe2714f[_0x1151c1(0x87)]('\x0a'),_0x6208e1['output'],_0x1151c1(0x9a));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a16_0x21261b(0xe6)]=a16_0x21261b(0xd6);['description']=a16_0x21261b(0xc0);['validate'](_0x460b94){const _0x430b97=a16_0x21261b,{args:_0x1c1ffa}=_0x460b94;if(!_0x1c1ffa[0x0])return _0x430b97(0xde);return undefined;}async[a16_0x21261b(0xa9)](_0x2e83b0){const _0x181c17=a16_0x21261b,{options:_0x2dc777,args:_0x53aa07,tdx:_0x514167}=_0x2e83b0,_0x13c3fa=_0x53aa07[0x0];_0x2dc777['verbose']&&(console[_0x181c17(0x86)](_0x181c17(0xa7)+_0x2dc777[_0x181c17(0xad)]),console['error'](_0x181c17(0xce)+_0x13c3fa));const _0x4a90ee=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x13c3fa+_0x181c17(0xc6),()=>_0x514167['connection'][_0x181c17(0xd4)](_0x13c3fa),{'verbose':_0x2dc777[_0x181c17(0xbc)]}),_0x36c04f=_0x4a90ee[_0x181c17(0x7a)];console[_0x181c17(0x86)]('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x13c3fa);if(isStructuredFormat(_0x2dc777))await handleSingleObjectOutput(_0x36c04f,_0x2dc777);else{console[_0x181c17(0xb0)](_0x181c17(0x79)+a16_0x5ed6b9[_0x181c17(0xd1)](_0x13c3fa)),console['log'](_0x181c17(0x89)+_0x36c04f[_0x181c17(0xe6)]);const _0x553780=_0x36c04f[_0x181c17(0xaa)]||[],_0x4f11c2=_0x553780[_0x181c17(0x98)](_0x467f63=>_0x467f63[_0x181c17(0x92)]);_0x4f11c2['length']>0x0&&(console['log'](a16_0x5ed6b9[_0x181c17(0xa8)]('\x0aCredential\x20settings:')),printMetadataSettings(_0x4f11c2));let _0x20319d=![];try{const _0x80ad57=await _0x514167[_0x181c17(0x9f)][_0x181c17(0x9b)](_0x13c3fa),_0x352b30=normalizeSchemaForDisplay(_0x80ad57);_0x352b30['length']>0x0&&(console[_0x181c17(0xb0)](a16_0x5ed6b9[_0x181c17(0xa8)](_0x181c17(0xcb))),printSchemaFields(_0x352b30,0x0),_0x20319d=!![]);}catch{const _0x292c62=_0x553780[_0x181c17(0x98)](_0x290018=>!_0x290018[_0x181c17(0x92)]);_0x292c62[_0x181c17(0x8e)]>0x0&&(console[_0x181c17(0xb0)](a16_0x5ed6b9['bold'](_0x181c17(0xcb))),printMetadataSettings(_0x292c62),_0x20319d=!![]);}!_0x20319d&&_0x2dc777[_0x181c17(0xbc)]&&console[_0x181c17(0x86)](a16_0x5ed6b9[_0x181c17(0xc5)](_0x181c17(0xca))),_0x4f11c2[_0x181c17(0x8e)]===0x0&&console['log'](a16_0x5ed6b9['dim'](_0x181c17(0xdb)));}return 0x0;}}function printMetadataSettings(_0x587ae0){const _0x1892c5=a16_0x21261b;for(const _0x543b51 of _0x587ae0){if(!_0x543b51[_0x1892c5(0xe6)])continue;if(_0x543b51['hidden'])continue;let _0x27a923='\x20\x20'+a16_0x5ed6b9['green'](_0x543b51[_0x1892c5(0xe6)]);_0x543b51[_0x1892c5(0xcc)]&&(_0x27a923+=':\x20'+_0x543b51[_0x1892c5(0xcc)]);_0x543b51['type']&&(_0x27a923+=a16_0x5ed6b9[_0x1892c5(0xc5)]('\x20['+_0x543b51[_0x1892c5(0x7d)]+']'));console[_0x1892c5(0xb0)](_0x27a923);_0x543b51[_0x1892c5(0xd3)]&&console['log']('\x20\x20\x20\x20'+a16_0x5ed6b9[_0x1892c5(0xc5)](_0x543b51[_0x1892c5(0xd3)]));if(_0x543b51[_0x1892c5(0x83)]){const _0x213a7a=_0x543b51[_0x1892c5(0x83)]['map'](_0x3a59d4=>_0x3a59d4[_0x1892c5(0xcf)])[_0x1892c5(0x87)](',\x20');console[_0x1892c5(0xb0)]('\x20\x20\x20\x20Options:\x20'+a16_0x5ed6b9[_0x1892c5(0x88)](_0x213a7a));}_0x543b51['default_value']!==undefined&&_0x543b51[_0x1892c5(0x7b)]!==null&&console['log'](_0x1892c5(0xbf)+a16_0x5ed6b9[_0x1892c5(0xcd)](String(_0x543b51[_0x1892c5(0x7b)])));if(_0x543b51[_0x1892c5(0xe0)]){const _0x126518=Object[_0x1892c5(0xe1)](_0x543b51['criteria'])[_0x1892c5(0xaf)](([_0xe1a2d0,_0x5b6928])=>_0xe1a2d0+'='+JSON[_0x1892c5(0x85)](_0x5b6928))[_0x1892c5(0x87)](',\x20');console[_0x1892c5(0xb0)](_0x1892c5(0xdd)+a16_0x5ed6b9[_0x1892c5(0xc5)]('Show\x20when:\x20'+_0x126518));}}}function a16_0x3ad9(){const _0x384934=['Default:\x20','legacy_settings','limit','connection:schema','localeCompare','1388134WDvEaB','connection:types','output','enumeration','Options:\x20','verbose','List\x20available\x20connector\x20types','description','\x20\x20\x20\x20Default:\x20','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','\x20-\x20','validate','5168420IBKnJC','Range:\x20','dim','\x27...','864hIbIxn','Type:\x20','slice','No\x20available\x20fields\x20for\x20this\x20connector','\x0aAvailable\x20fields:','label','blue','Fetching\x20settings\x20for\x20connector\x20type:\x20','value','properties','cyan','record','hint','getMetadata','Treating\x20\x27','connection:settings','connection:show','1790944fQtHIl','1749246EfHTHW','Listing\x20connector\x20types...','\x0aNo\x20credential\x20settings\x20defined','✔\x20Resolved\x20\x27','\x20\x20\x20\x20','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.','owner','criteria','entries','object','sort','✔\x20Found\x20connection:\x20','max','name','\x0aConnector:\x20','data','default_value','Show\x20connection\x20details','type','push','1659370RioYDT','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','2873304GMVZyx','3QGZCAJ','options','7dCDjHn','stringify','error','join','yellow','Name:\x20','list','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','✔\x20Found\x20schema\x20for\x20connection\x20\x27','padStart','length','10OrttLj','Listing\x20connections...','Fetching\x20connection\x20\x27','credential','Fetching\x20schema\x20for\x20\x27','\x27\x20as\x20connector\x20type','minimum','title','maximum','filter','555775NheoLr','table','getOutputSchema','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.','findByName','\x20[record]','connection','List\x20all\x20result\x20output\x20connections','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','listTypes','green','>=\x20','legacy','input','Site:\x20','bold','execute','settings','5UiLqwo','\x0aConnection:\x20','site','repeat','map','log','connection:list'];a16_0x3ad9=function(){return _0x384934;};return a16_0x3ad9();}
1
+ const a15_0xb70734=a15_0x3ccf;(function(_0x2c278b,_0x228b29){const _0x21bfb5=a15_0x3ccf,_0x498618=_0x2c278b();while(!![]){try{const _0x861853=-parseInt(_0x21bfb5(0x100))/0x1+parseInt(_0x21bfb5(0xe6))/0x2+parseInt(_0x21bfb5(0xe0))/0x3*(-parseInt(_0x21bfb5(0xb9))/0x4)+-parseInt(_0x21bfb5(0xd5))/0x5+parseInt(_0x21bfb5(0xfd))/0x6+-parseInt(_0x21bfb5(0xc0))/0x7*(-parseInt(_0x21bfb5(0x109))/0x8)+-parseInt(_0x21bfb5(0x118))/0x9*(-parseInt(_0x21bfb5(0x113))/0xa);if(_0x861853===_0x228b29)break;else _0x498618['push'](_0x498618['shift']());}catch(_0x58fb02){_0x498618['push'](_0x498618['shift']());}}}(a15_0x308f,0xb2653));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';function a15_0x3ccf(_0x423281,_0x788050){_0x423281=_0x423281-0xb0;const _0x308f45=a15_0x308f();let _0x3ccfb5=_0x308f45[_0x423281];return _0x3ccfb5;}import a15_0x4a7cd7 from'chalk';function normalizeSchemaForDisplay(_0x3ff994){const _0x4be084=a15_0x3ccf,_0x365010=_0x3ff994['properties']||[],_0x373783=_0x365010[_0x4be084(0x111)](_0x2f7465=>_0x2f7465['name']==='legacy_settings'&&_0x2f7465[_0x4be084(0xfe)]==='record'&&_0x2f7465[_0x4be084(0x11c)]);if(_0x373783?.[_0x4be084(0x11c)]){const _0x1f7347=_0x365010['filter'](_0x40fcc3=>_0x40fcc3[_0x4be084(0xc5)]!==_0x4be084(0xb7)&&_0x40fcc3[_0x4be084(0xc5)]!==_0x4be084(0xe9));return[..._0x1f7347,..._0x373783[_0x4be084(0x11c)]];}return _0x365010['filter'](_0x62c3a1=>_0x62c3a1['name']!==_0x4be084(0xb7));}function printSchemaFields(_0x10b4c4,_0xc260e7){const _0x16d161=a15_0x3ccf,_0x35f596='\x20\x20'[_0x16d161(0xd8)](_0xc260e7+0x1),_0x33fc2b='\x20\x20'['repeat'](_0xc260e7+0x2);for(const _0xd4dad0 of _0x10b4c4){if(!_0xd4dad0[_0x16d161(0xc5)])continue;const _0x518477=_0xd4dad0[_0x16d161(0xfe)]===_0x16d161(0xbb)&&_0xd4dad0[_0x16d161(0x11c)]&&_0xd4dad0[_0x16d161(0x11c)][_0x16d161(0x10a)]>0x0&&_0xd4dad0[_0x16d161(0xc5)]!==_0x16d161(0xe9);let _0x234fa4=''+_0x35f596+a15_0x4a7cd7[_0x16d161(0x107)](_0xd4dad0[_0x16d161(0xc5)]);_0xd4dad0[_0x16d161(0xd1)]&&(_0x234fa4+=':\x20'+_0xd4dad0[_0x16d161(0xd1)]);if(_0xd4dad0[_0x16d161(0xc1)])_0x234fa4+=a15_0x4a7cd7[_0x16d161(0xb8)]('\x20['+_0xd4dad0[_0x16d161(0xc1)]+']');else _0x518477&&(_0x234fa4+=a15_0x4a7cd7[_0x16d161(0xb8)](_0x16d161(0x103)));console['log'](_0x234fa4);_0xd4dad0[_0x16d161(0xc7)]&&console['log'](''+_0x33fc2b+a15_0x4a7cd7[_0x16d161(0xb8)](_0xd4dad0['description']));if(_0xd4dad0[_0x16d161(0xcc)]){const _0x471fbb=_0xd4dad0['enumeration'][_0x16d161(0xbe)](_0x32ec23=>typeof _0x32ec23===_0x16d161(0xcf)&&_0x16d161(0xbf)in _0x32ec23?_0x32ec23[_0x16d161(0xbf)]:_0x32ec23)['join'](',\x20');console['log'](_0x33fc2b+_0x16d161(0xb1)+a15_0x4a7cd7['yellow'](_0x471fbb));}_0xd4dad0[_0x16d161(0xff)]!==undefined&&console[_0x16d161(0x114)](_0x33fc2b+_0x16d161(0xd0)+a15_0x4a7cd7[_0x16d161(0xb4)](String(_0xd4dad0['default_value'])));if(_0xd4dad0[_0x16d161(0xba)]!==undefined||_0xd4dad0[_0x16d161(0xe1)]!==undefined){const _0x3fca38=_0xd4dad0['minimum']!==undefined&&_0xd4dad0[_0x16d161(0xe1)]!==undefined?_0xd4dad0['minimum']+_0x16d161(0xc8)+_0xd4dad0[_0x16d161(0xe1)]:_0xd4dad0['minimum']!==undefined?_0x16d161(0x119)+_0xd4dad0[_0x16d161(0xba)]:_0x16d161(0x110)+_0xd4dad0[_0x16d161(0xe1)];console[_0x16d161(0x114)](_0x33fc2b+'Range:\x20'+a15_0x4a7cd7[_0x16d161(0xb4)](_0x3fca38));}if(_0xd4dad0[_0x16d161(0x116)]){const _0x466967=Object[_0x16d161(0xef)](_0xd4dad0[_0x16d161(0x116)])[_0x16d161(0xbe)](([_0x43c888,_0x3c7403])=>_0x43c888+'='+JSON[_0x16d161(0x106)](_0x3c7403))[_0x16d161(0xe4)](',\x20');console[_0x16d161(0x114)](''+_0x33fc2b+a15_0x4a7cd7[_0x16d161(0xb8)](_0x16d161(0xf3)+_0x466967));}_0x518477&&_0xd4dad0['properties']&&printSchemaFields(_0xd4dad0['properties'],_0xc260e7+0x1);}}function a15_0x308f(){const _0x529b1e=['2073744dYlbfS','type','default_value','97677EmdcwG','\x0aNo\x20fields\x20defined\x20in\x20schema','connection:schema','\x20[record]','✔\x20Resolved\x20\x27','List\x20available\x20connector\x20types','stringify','green','padStart','5046080ylHbZF','length','List\x20all\x20result\x20output\x20connections','Fetching\x20settings\x20for\x20\x27','options','resolve','Site:\x20','<=\x20','find','\x0aNo\x20credential\x20settings\x20defined','10MvkeNe','log','\x20\x20\x20\x20Options:\x20','criteria','label','14818716ZzaJRo','>=\x20','connection:show','data','properties','Fetching\x20connection\x20\x27','Options:\x20','Looking\x20up\x20connection:\x20','verbose','blue','execute','Show\x20connection\x20details','legacy','dim','5806820NfbzCj','minimum','record','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.','slice','map','value','7aKspBf','input','table','connection','Name:\x20','name','owner','description','\x20-\x20','getOutputSchema','limit','filter','enumeration','Treating\x20\x27','Fetching\x20settings\x20for\x20connector\x20type:\x20','object','Default:\x20','title','\x20connector\x20type','\x0aAvailable\x20fields:','site','3590805lhJRTy','\x20connection','max','repeat','\x0aConnector:\x20','hint','\x20\x20\x20\x20','Type:\x20','hidden','cyan','No\x20available\x20fields\x20for\x20this\x20connector','3wJlUvJ','maximum','settings','credential','join','localeCompare','750684coYfjj','Resolving\x20connector\x20type\x20or\x20name:\x20','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','legacy_settings','list','sort','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.','\x27...','✔\x20Found\x20schema\x20for\x20connection\x20\x27','entries','✔\x20Found\x20','\x27\x20as\x20connector\x20type','findByName','Show\x20when:\x20','Listing\x20connector\x20types...','bold','connection:settings','output','\x0aCredential\x20settings:','validate','\x20\x20\x20\x20Default:\x20','error','\x27\x20(type:\x20'];a15_0x308f=function(){return _0x529b1e;};return a15_0x308f();}export class ConnectionListCommand extends BaseCommand{[a15_0xb70734(0xc5)]='connection:list';['description']=a15_0xb70734(0x10b);async['execute'](_0xec6f83){const _0x1f14d1=a15_0xb70734,{options:_0x4fb715,tdx:_0x5cb60e}=_0xec6f83;_0x4fb715['verbose']&&console[_0x1f14d1(0xfb)](_0x1f14d1(0x10f)+_0x4fb715[_0x1f14d1(0xd4)]);const _0x43b82c=resolveLimit(_0x4fb715[_0x1f14d1(0xca)],DEFAULT_LISTING_LIMIT),_0x14c3a8=await withSpinner('Listing\x20connections...',()=>_0x5cb60e[_0x1f14d1(0xc3)][_0x1f14d1(0xea)](),{'verbose':_0x4fb715[_0x1f14d1(0xb3)]}),_0x76be71=_0x14c3a8['data'];console['error']('✔\x20Found\x20'+_0x76be71['length']+_0x1f14d1(0xd6)+(_0x76be71[_0x1f14d1(0x10a)]!==0x1?'s':''));if(isStructuredFormat(_0x4fb715)){const _0x3b7fcc=_0x76be71[_0x1f14d1(0xbd)](0x0,_0x43b82c);await handleSDKOutput(_0x3b7fcc,{..._0x4fb715,'limit':_0x43b82c});}else{const _0x2a86c9=_0x76be71[_0x1f14d1(0x10a)]>0x0?Math[_0x1f14d1(0xd7)](..._0x76be71['map'](_0x1367a3=>_0x1367a3['type'][_0x1f14d1(0x10a)])):0x0,_0x41dfe5=[];for(const _0xa6f700 of _0x76be71){const _0x473455=a15_0x4a7cd7[_0x1f14d1(0xde)](_0xa6f700[_0x1f14d1(0xfe)][_0x1f14d1(0x108)](_0x2a86c9)),_0x128c50=_0xa6f700[_0x1f14d1(0xc6)]?.[_0x1f14d1(0xc5)]?'\x20-\x20'+a15_0x4a7cd7[_0x1f14d1(0xb8)](_0xa6f700['owner'][_0x1f14d1(0xc5)]):'';_0x41dfe5['push'](_0x473455+'\x20\x20'+_0xa6f700[_0x1f14d1(0xc5)]+_0x128c50);}await writeOutput(_0x41dfe5[_0x1f14d1(0xe4)]('\x0a'),_0x4fb715['output'],_0x1f14d1(0xc2));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a15_0xb70734(0xc5)]=a15_0xb70734(0x11a);['description']=a15_0xb70734(0xb6);[a15_0xb70734(0xf9)](_0x14b4a0){const {args:_0xf6a855}=_0x14b4a0;if(!_0xf6a855[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_0xb70734(0xb5)](_0x413f6e){const _0x1603f4=a15_0xb70734,{options:_0x5bc8f7,args:_0x383d73,tdx:_0x5e697f}=_0x413f6e,_0x5b7b37=_0x383d73[0x0];_0x5bc8f7[_0x1603f4(0xb3)]&&(console[_0x1603f4(0xfb)](_0x1603f4(0x10f)+_0x5bc8f7[_0x1603f4(0xd4)]),console[_0x1603f4(0xfb)](_0x1603f4(0xb2)+_0x5b7b37));const _0x275946=await withSpinner(_0x1603f4(0xb0)+_0x5b7b37+'\x27...',()=>_0x5e697f['connection'][_0x1603f4(0x10e)](_0x5b7b37),{'verbose':_0x5bc8f7[_0x1603f4(0xb3)]}),_0x16a6e6=_0x275946[_0x1603f4(0x11b)];return console[_0x1603f4(0xfb)]('✔\x20Found\x20connection:\x20'+_0x16a6e6[_0x1603f4(0xc5)]),await handleSingleObjectOutput(_0x16a6e6,_0x5bc8f7),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a15_0xb70734(0xc5)]=a15_0xb70734(0x102);[a15_0xb70734(0xc7)]='Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation';['validate'](_0x1780dc){const _0x3dac7b=a15_0xb70734,{args:_0x157abc}=_0x1780dc;if(!_0x157abc[0x0])return _0x3dac7b(0xbc);return undefined;}async['execute'](_0x1a85cf){const _0x59bedb=a15_0xb70734,{options:_0x4ffcfc,args:_0x55c4f5,tdx:_0x436bc9}=_0x1a85cf,_0x91108e=_0x55c4f5[0x0];_0x4ffcfc[_0x59bedb(0xb3)]&&(console['error'](_0x59bedb(0x10f)+_0x4ffcfc['site']),console[_0x59bedb(0xfb)](_0x59bedb(0xe7)+_0x91108e));let _0x463637=_0x91108e,_0x307797;try{const _0x51d097=await _0x436bc9[_0x59bedb(0xc3)][_0x59bedb(0xf2)](_0x91108e);_0x51d097&&(_0x463637=_0x51d097[_0x59bedb(0xfe)],_0x307797=_0x51d097['name'],_0x4ffcfc[_0x59bedb(0xb3)]&&console['error'](_0x59bedb(0x104)+_0x91108e+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x463637));}catch{_0x4ffcfc[_0x59bedb(0xb3)]&&console[_0x59bedb(0xfb)](_0x59bedb(0xcd)+_0x91108e+_0x59bedb(0xf1));}const _0x589861=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x463637+_0x59bedb(0xed),()=>_0x436bc9[_0x59bedb(0xc3)][_0x59bedb(0xc9)](_0x463637),{'verbose':_0x4ffcfc[_0x59bedb(0xb3)]}),_0x27ab7c=_0x589861[_0x59bedb(0x11b)];_0x307797?console['error'](_0x59bedb(0xee)+_0x307797+_0x59bedb(0xfc)+_0x463637+')'):console[_0x59bedb(0xfb)]('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x463637);if(isStructuredFormat(_0x4ffcfc))await handleSingleObjectOutput(_0x27ab7c,_0x4ffcfc);else{const _0x5cd83e=normalizeSchemaForDisplay(_0x27ab7c);_0x307797?(console[_0x59bedb(0x114)]('\x0aConnection:\x20'+a15_0x4a7cd7[_0x59bedb(0xde)](_0x307797)),console[_0x59bedb(0x114)](_0x59bedb(0xdc)+a15_0x4a7cd7[_0x59bedb(0xb8)](_0x463637))):console['log'](_0x59bedb(0xd9)+a15_0x4a7cd7[_0x59bedb(0xde)](_0x463637)),_0x5cd83e[_0x59bedb(0x10a)]>0x0?(console[_0x59bedb(0x114)](a15_0x4a7cd7[_0x59bedb(0xf5)](_0x59bedb(0xd3))),printSchemaFields(_0x5cd83e,0x0)):console[_0x59bedb(0x114)](a15_0x4a7cd7['dim'](_0x59bedb(0x101)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a15_0xb70734(0xc5)]='connection:types';[a15_0xb70734(0xc7)]=a15_0xb70734(0x105);async['execute'](_0x2d50b8){const _0x27d7bd=a15_0xb70734,{options:_0x255e63,tdx:_0x1f220c}=_0x2d50b8;_0x255e63['verbose']&&console['error'](_0x27d7bd(0x10f)+_0x255e63[_0x27d7bd(0xd4)]);const _0x533c6b=await withSpinner(_0x27d7bd(0xf4),()=>_0x1f220c[_0x27d7bd(0xc3)]['listTypes'](),{'verbose':_0x255e63[_0x27d7bd(0xb3)]}),_0x59cd44=_0x533c6b['data'][_0x27d7bd(0xeb)]((_0x37f5cb,_0x122cc4)=>_0x37f5cb[_0x27d7bd(0xfe)][_0x27d7bd(0xe5)](_0x122cc4[_0x27d7bd(0xfe)]));console['error'](_0x27d7bd(0xf0)+_0x59cd44['length']+_0x27d7bd(0xd2)+(_0x59cd44['length']!==0x1?'s':''));if(isStructuredFormat(_0x255e63))await handleSDKOutput(_0x59cd44,_0x255e63);else{const _0x7a893b=_0x59cd44[_0x27d7bd(0x10a)]>0x0?Math[_0x27d7bd(0xd7)](..._0x59cd44[_0x27d7bd(0xbe)](_0xe5cb9c=>_0xe5cb9c[_0x27d7bd(0xfe)][_0x27d7bd(0x10a)])):0x0,_0x5d0f41=[];for(const _0x49f335 of _0x59cd44){const _0x4be0e0=a15_0x4a7cd7[_0x27d7bd(0xde)](_0x49f335[_0x27d7bd(0xfe)][_0x27d7bd(0x108)](_0x7a893b));_0x5d0f41['push'](_0x4be0e0+'\x20\x20'+_0x49f335[_0x27d7bd(0xc5)]);}await writeOutput(_0x5d0f41[_0x27d7bd(0xe4)]('\x0a'),_0x255e63[_0x27d7bd(0xf7)],_0x27d7bd(0xc2));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a15_0xb70734(0xc5)]=a15_0xb70734(0xf6);[a15_0xb70734(0xc7)]=a15_0xb70734(0xe8);[a15_0xb70734(0xf9)](_0x2ed9f3){const _0x697731=a15_0xb70734,{args:_0x40d5b8}=_0x2ed9f3;if(!_0x40d5b8[0x0])return _0x697731(0xec);return undefined;}async[a15_0xb70734(0xb5)](_0x206f03){const _0x20d0f5=a15_0xb70734,{options:_0x3824ed,args:_0x1db339,tdx:_0x47f61d}=_0x206f03,_0x407c68=_0x1db339[0x0];_0x3824ed[_0x20d0f5(0xb3)]&&(console[_0x20d0f5(0xfb)](_0x20d0f5(0x10f)+_0x3824ed[_0x20d0f5(0xd4)]),console[_0x20d0f5(0xfb)](_0x20d0f5(0xce)+_0x407c68));const _0x4aaba0=await withSpinner(_0x20d0f5(0x10c)+_0x407c68+'\x27...',()=>_0x47f61d['connection']['getMetadata'](_0x407c68),{'verbose':_0x3824ed[_0x20d0f5(0xb3)]}),_0x1eef99=_0x4aaba0['data'];console[_0x20d0f5(0xfb)]('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x407c68);if(isStructuredFormat(_0x3824ed))await handleSingleObjectOutput(_0x1eef99,_0x3824ed);else{console[_0x20d0f5(0x114)](_0x20d0f5(0xd9)+a15_0x4a7cd7['cyan'](_0x407c68)),console[_0x20d0f5(0x114)](_0x20d0f5(0xc4)+_0x1eef99['name']);const _0x38f1a0=_0x1eef99[_0x20d0f5(0xe2)]||[],_0x472c68=_0x38f1a0[_0x20d0f5(0xcb)](_0x7fa0b1=>_0x7fa0b1['credential']);_0x472c68[_0x20d0f5(0x10a)]>0x0&&(console[_0x20d0f5(0x114)](a15_0x4a7cd7[_0x20d0f5(0xf5)](_0x20d0f5(0xf8))),printMetadataSettings(_0x472c68));let _0x4e3ee5=![];try{const _0x1653be=await _0x47f61d[_0x20d0f5(0xc3)][_0x20d0f5(0xc9)](_0x407c68),_0x50ed1e=normalizeSchemaForDisplay(_0x1653be);_0x50ed1e[_0x20d0f5(0x10a)]>0x0&&(console[_0x20d0f5(0x114)](a15_0x4a7cd7[_0x20d0f5(0xf5)](_0x20d0f5(0xd3))),printSchemaFields(_0x50ed1e,0x0),_0x4e3ee5=!![]);}catch{const _0x295c2f=_0x38f1a0[_0x20d0f5(0xcb)](_0x17dddc=>!_0x17dddc[_0x20d0f5(0xe3)]);_0x295c2f[_0x20d0f5(0x10a)]>0x0&&(console[_0x20d0f5(0x114)](a15_0x4a7cd7['bold'](_0x20d0f5(0xd3))),printMetadataSettings(_0x295c2f),_0x4e3ee5=!![]);}!_0x4e3ee5&&_0x3824ed[_0x20d0f5(0xb3)]&&console[_0x20d0f5(0xfb)](a15_0x4a7cd7[_0x20d0f5(0xb8)](_0x20d0f5(0xdf))),_0x472c68['length']===0x0&&console[_0x20d0f5(0x114)](a15_0x4a7cd7[_0x20d0f5(0xb8)](_0x20d0f5(0x112)));}return 0x0;}}function printMetadataSettings(_0x4dd568){const _0x470b37=a15_0xb70734;for(const _0x5c0feb of _0x4dd568){if(!_0x5c0feb[_0x470b37(0xc5)])continue;if(_0x5c0feb[_0x470b37(0xdd)])continue;let _0x15a3f7='\x20\x20'+a15_0x4a7cd7[_0x470b37(0x107)](_0x5c0feb[_0x470b37(0xc5)]);_0x5c0feb[_0x470b37(0x117)]&&(_0x15a3f7+=':\x20'+_0x5c0feb['label']);_0x5c0feb['type']&&(_0x15a3f7+=a15_0x4a7cd7['dim']('\x20['+_0x5c0feb[_0x470b37(0xfe)]+']'));console[_0x470b37(0x114)](_0x15a3f7);_0x5c0feb[_0x470b37(0xda)]&&console[_0x470b37(0x114)](_0x470b37(0xdb)+a15_0x4a7cd7[_0x470b37(0xb8)](_0x5c0feb['hint']));if(_0x5c0feb[_0x470b37(0x10d)]){const _0x242ebc=_0x5c0feb[_0x470b37(0x10d)][_0x470b37(0xbe)](_0x392d85=>_0x392d85[_0x470b37(0xbf)])['join'](',\x20');console['log'](_0x470b37(0x115)+a15_0x4a7cd7['yellow'](_0x242ebc));}_0x5c0feb[_0x470b37(0xff)]!==undefined&&_0x5c0feb['default_value']!==null&&console['log'](_0x470b37(0xfa)+a15_0x4a7cd7[_0x470b37(0xb4)](String(_0x5c0feb[_0x470b37(0xff)])));if(_0x5c0feb[_0x470b37(0x116)]){const _0x529e47=Object[_0x470b37(0xef)](_0x5c0feb[_0x470b37(0x116)])[_0x470b37(0xbe)](([_0x21c9cf,_0x4bc2a1])=>_0x21c9cf+'='+JSON[_0x470b37(0x106)](_0x4bc2a1))[_0x470b37(0xe4)](',\x20');console[_0x470b37(0x114)](_0x470b37(0xdb)+a15_0x4a7cd7[_0x470b37(0xb8)](_0x470b37(0xf3)+_0x529e47));}}}
@@ -1 +1 @@
1
- const a17_0x55149d=a17_0x288c;function a17_0x288c(_0x383b42,_0xe13c0c){_0x383b42=_0x383b42-0x158;const _0x1dff9c=a17_0x1dff();let _0x288cc2=_0x1dff9c[_0x383b42];return _0x288cc2;}(function(_0xd5dc11,_0x274009){const _0x5ae65d=a17_0x288c,_0x51d0e4=_0xd5dc11();while(!![]){try{const _0x5e14d8=-parseInt(_0x5ae65d(0x164))/0x1*(parseInt(_0x5ae65d(0x16a))/0x2)+-parseInt(_0x5ae65d(0x166))/0x3*(-parseInt(_0x5ae65d(0x15e))/0x4)+-parseInt(_0x5ae65d(0x162))/0x5*(parseInt(_0x5ae65d(0x16f))/0x6)+-parseInt(_0x5ae65d(0x159))/0x7*(-parseInt(_0x5ae65d(0x172))/0x8)+-parseInt(_0x5ae65d(0x163))/0x9*(parseInt(_0x5ae65d(0x161))/0xa)+-parseInt(_0x5ae65d(0x16c))/0xb*(-parseInt(_0x5ae65d(0x158))/0xc)+parseInt(_0x5ae65d(0x176))/0xd;if(_0x5e14d8===_0x274009)break;else _0x51d0e4['push'](_0x51d0e4['shift']());}catch(_0x4eae13){_0x51d0e4['push'](_0x51d0e4['shift']());}}}(a17_0x1dff,0x47447));import{BaseCommand}from'./command.js';function a17_0x1dff(){const _0x6a30f=['limit','site','451272dMpYQW','execute','length','8jrUhTH','cause','data','Listing\x20databases...','6521242CAwIxX','587604BPvmLN','1578479pCaDbA','database_name','📦\x20','error','Error:\x20','139964REVdEe','✔\x20Found\x20','log','10ZtBzXo','25AAlTmG','4100013udQuFk','153pcnOPl','Pattern:\x20','33Pfdxya','name','description','message','1770xfnNKQ','listDatabases','33ZuJrhO'];a17_0x1dff=function(){return _0x6a30f;};return a17_0x1dff();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a17_0x55149d(0x167)]='databases';[a17_0x55149d(0x168)]='List\x20all\x20databases';async[a17_0x55149d(0x170)](_0x364592){const _0x2debcb=a17_0x55149d,{options:_0x5e78a2,args:_0x37dbbc,tdx:_0x1625c9}=_0x364592,_0x46a62e=_0x37dbbc[0x0];try{_0x5e78a2['verbose']&&(console[_0x2debcb(0x15c)]('Site:\x20'+_0x5e78a2[_0x2debcb(0x16e)]),_0x46a62e&&console[_0x2debcb(0x15c)](_0x2debcb(0x165)+_0x46a62e));const _0x64ed02=resolveLimit(_0x5e78a2[_0x2debcb(0x16d)],DEFAULT_LISTING_LIMIT),_0x4eeefc=await withSpinner(_0x2debcb(0x175),()=>_0x1625c9['query'][_0x2debcb(0x16b)](_0x46a62e,_0x64ed02),{'verbose':_0x5e78a2['verbose']}),_0x4cdae5=_0x4eeefc[_0x2debcb(0x174)];console[_0x2debcb(0x15c)](_0x2debcb(0x15f)+_0x4cdae5[_0x2debcb(0x171)]+'\x20database'+(_0x4cdae5[_0x2debcb(0x171)]!==0x1?'s':''));if(isStructuredFormat(_0x5e78a2))await handleSDKOutput(_0x4cdae5,{..._0x5e78a2,'limit':_0x64ed02});else for(const _0x415ef2 of _0x4cdae5){console[_0x2debcb(0x160)](_0x2debcb(0x15b)+_0x415ef2[_0x2debcb(0x15a)]);}return 0x0;}catch(_0x677af8){if(_0x677af8 instanceof SDKError)return console[_0x2debcb(0x15c)](_0x2debcb(0x15d)+_0x677af8[_0x2debcb(0x169)]),_0x677af8['cause']&&console[_0x2debcb(0x15c)]('\x20\x20Cause:\x20'+_0x677af8[_0x2debcb(0x173)]),0x1;throw _0x677af8;}}}
1
+ const a16_0x216c47=a16_0x467e;(function(_0x5db922,_0x4c9b0c){const _0x5df4b0=a16_0x467e,_0x26fa56=_0x5db922();while(!![]){try{const _0x461cc5=-parseInt(_0x5df4b0(0xad))/0x1+parseInt(_0x5df4b0(0xba))/0x2*(-parseInt(_0x5df4b0(0xaf))/0x3)+parseInt(_0x5df4b0(0xb1))/0x4+-parseInt(_0x5df4b0(0xb7))/0x5*(-parseInt(_0x5df4b0(0xbb))/0x6)+-parseInt(_0x5df4b0(0xb4))/0x7*(-parseInt(_0x5df4b0(0xa7))/0x8)+parseInt(_0x5df4b0(0x9f))/0x9*(parseInt(_0x5df4b0(0xaa))/0xa)+-parseInt(_0x5df4b0(0xa6))/0xb*(-parseInt(_0x5df4b0(0xa0))/0xc);if(_0x461cc5===_0x4c9b0c)break;else _0x26fa56['push'](_0x26fa56['shift']());}catch(_0x542bb6){_0x26fa56['push'](_0x26fa56['shift']());}}}(a16_0x21be,0x5042b));function a16_0x21be(){const _0x4a010e=['3GiFbKr','database_name','1459160OsTTbn','listDatabases','cause','140nMwszq','log','verbose','1258420HofMJx','Site:\x20','length','1004390cumNmm','6aaocqC','Error:\x20','Pattern:\x20','📦\x20','message','\x20database','642357NyluRF','492ZYstvM','site','✔\x20Found\x20','query','\x20\x20Cause:\x20','name','3388lXuGCc','176392fTKsho','limit','List\x20all\x20databases','20KLYWcW','data','description','381886zsMuFg','error'];a16_0x21be=function(){return _0x4a010e;};return a16_0x21be();}function a16_0x467e(_0xcfd95b,_0x5b36a1){_0xcfd95b=_0xcfd95b-0x9a;const _0x21bec7=a16_0x21be();let _0x467ee2=_0x21bec7[_0xcfd95b];return _0x467ee2;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a16_0x216c47(0xa5)]='databases';[a16_0x216c47(0xac)]=a16_0x216c47(0xa9);async['execute'](_0x4f7d08){const _0x189a56=a16_0x216c47,{options:_0x906fff,args:_0x19c197,tdx:_0x2c73c9}=_0x4f7d08,_0x410bd3=_0x19c197[0x0];try{_0x906fff['verbose']&&(console[_0x189a56(0xae)](_0x189a56(0xb8)+_0x906fff[_0x189a56(0xa1)]),_0x410bd3&&console[_0x189a56(0xae)](_0x189a56(0x9b)+_0x410bd3));const _0x202f24=resolveLimit(_0x906fff[_0x189a56(0xa8)],DEFAULT_LISTING_LIMIT),_0x357199=await withSpinner('Listing\x20databases...',()=>_0x2c73c9[_0x189a56(0xa3)][_0x189a56(0xb2)](_0x410bd3,_0x202f24),{'verbose':_0x906fff[_0x189a56(0xb6)]}),_0x537e3a=_0x357199[_0x189a56(0xab)];console[_0x189a56(0xae)](_0x189a56(0xa2)+_0x537e3a['length']+_0x189a56(0x9e)+(_0x537e3a[_0x189a56(0xb9)]!==0x1?'s':''));if(isStructuredFormat(_0x906fff))await handleSDKOutput(_0x537e3a,{..._0x906fff,'limit':_0x202f24});else for(const _0x831d35 of _0x537e3a){console[_0x189a56(0xb5)](_0x189a56(0x9c)+_0x831d35[_0x189a56(0xb0)]);}return 0x0;}catch(_0x188ee0){if(_0x188ee0 instanceof SDKError)return console[_0x189a56(0xae)](_0x189a56(0x9a)+_0x188ee0[_0x189a56(0x9d)]),_0x188ee0['cause']&&console[_0x189a56(0xae)](_0x189a56(0xa4)+_0x188ee0[_0x189a56(0xb3)]),0x1;throw _0x188ee0;}}}