@treasuredata/tdx 2026.3.47 → 2026.3.48

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 (220) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/index.js.map +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +1 -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 a9_0x566461=a9_0x29f5;(function(_0x23b594,_0x5e7015){const _0x337d67=a9_0x29f5,_0x421471=_0x23b594();while(!![]){try{const _0x2ceef6=parseInt(_0x337d67(0xe5))/0x1+-parseInt(_0x337d67(0xa5))/0x2+-parseInt(_0x337d67(0xee))/0x3*(parseInt(_0x337d67(0x117))/0x4)+-parseInt(_0x337d67(0xc4))/0x5+parseInt(_0x337d67(0xd5))/0x6*(-parseInt(_0x337d67(0xa1))/0x7)+-parseInt(_0x337d67(0xa0))/0x8+parseInt(_0x337d67(0x112))/0x9;if(_0x2ceef6===_0x5e7015)break;else _0x421471['push'](_0x421471['shift']());}catch(_0x32569d){_0x421471['push'](_0x421471['shift']());}}}(a9_0x11c5,0xc45a4));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a9_0x552bab from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a9_0x34d5d5 from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';function a9_0x29f5(_0x332497,_0x3c06f5){_0x332497=_0x332497-0x9b;const _0x11c5b7=a9_0x11c5();let _0x29f58b=_0x11c5b7[_0x332497];return _0x29f58b;}import{collectYamlFiles}from'../sdk/cas/push-workflow.js';import{saveSessionContext}from'../core/session.js';function a9_0x11c5(){const _0xab182e=['name','map','error','red','dirname','behaviors','\x20or\x20set\x20context\x20with\x20','masterSchema','Found\x20','utf-8','yellow','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20file(s)\x20to\x20write\x20','segments','Pulling\x20composable\x20audience\x20\x27','\x20activations)','cyan','basename','Analyzing\x20CAS\x20YAML\x20files...','table','Master\x20Table','Audience\x20name\x20required.','description','🧊\x20','33323463mnlQHX','get','\x27...','column','population','3110872qhOjdY','list','absolutePath','tdx\x20use\x20cas\x20<name>','\x20segment(s)','cas','Directory\x20not\x20found:\x20','names','8255232ModKIr','6245351Cjykkx','data','pull','rows','331498IxgONr','\x20\x20Schema:\x20','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','execute','Running\x20preview\x20for\x20\x27','Write\x20files?','isNew','verbose','\x20\x20Table:\x20\x20','\x20=\x20','counts','Context\x20set:\x20','Preview\x20composable\x20segment\x20query\x20on\x20CDW','tdx\x20cas\x20push\x20<path>','schema','content','log','\x20\x20Key:\x20\x20\x20\x20','All\x20files\x20are\x20up\x20to\x20date.','status','cas:list','session','activations','\x0aSample\x20Rows\x20(','files','\x20YAML\x20file(s)','Count:\x20\x20','cas:desc','tdx\x20cas\x20desc\x20<name>','Error:\x20\x20','hasChanges','6378490aXsiPg','diff','Describe\x20a\x20composable\x20audience','count','masterTable','Wrote\x20','cas:preview','type','preview','dryRun','audienceName','\x20composable\x20audiences','Would\x20push:\x20','Behaviors\x20(','List\x20composable\x20audiences','composableAudience','No\x20YAML\x20files\x20found\x20in:\x20','6ScybDn','push','green','dim','bold','yes','audiences','setPhase','\x20file(s)\x20to\x20','\x20activation(s)','Cancelled.','masterKeyColumn','attributes','\x20(new)','Status:\x20','cwd','1244915TcDefG','filter','\x20—\x20','join','dir','relativePath','timeColumn','Pull\x20composable\x20audience\x20to\x20YAML\x20files','No\x20composable\x20audience\x20specified.','3Tknuif','success','underline','Use\x20','tdx\x20cas\x20pull\x20<name>','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','Source:\x20\x20\x20','\x20segments,\x20','No\x20composable\x20audiences\x20found.','relative','length'];a9_0x11c5=function(){return _0xab182e;};return a9_0x11c5();}import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{['name']=a9_0x566461(0xb9);[a9_0x566461(0x110)]=a9_0x566461(0xd2);async[a9_0x566461(0xa8)](_0xe73d86){const _0x2bf1be=a9_0x566461,{options:_0xb31832,tdx:_0x3fc741}=_0xe73d86,_0x3142d1=await withProgressSpinner('Fetching\x20composable\x20audiences...',()=>_0x3fc741[_0x2bf1be(0x9d)][_0x2bf1be(0x118)](),{'verbose':_0xb31832[_0x2bf1be(0xac)]}),_0x139521=_0x3142d1[_0x2bf1be(0xa2)];if(isStructuredFormat(_0xb31832))return await handleSDKOutput(_0x139521,_0xb31832),0x0;if(_0x139521[_0x2bf1be(0xf9)]===0x0)return console[_0x2bf1be(0xb5)](a9_0x552bab[_0x2bf1be(0xd8)](_0x2bf1be(0xf7))),0x0;console[_0x2bf1be(0xb5)](a9_0x552bab[_0x2bf1be(0xd7)](_0x2bf1be(0x102)+_0x139521[_0x2bf1be(0xf9)]+_0x2bf1be(0xcf)));for(const _0x16cb7a of _0x139521){const _0x2acb79=_0x16cb7a[_0x2bf1be(0x116)]?a9_0x552bab[_0x2bf1be(0xd8)]('\x20('+Number(_0x16cb7a[_0x2bf1be(0x116)])['toLocaleString']()+')'):'',_0x373bc4=a9_0x552bab[_0x2bf1be(0xd8)]('\x20'+_0x16cb7a[_0x2bf1be(0x101)]+'.'+_0x16cb7a[_0x2bf1be(0xc8)]);console[_0x2bf1be(0xb5)](_0x2bf1be(0x111)+_0x16cb7a['name']+_0x2acb79+_0x373bc4),_0x16cb7a[_0x2bf1be(0x110)]&&console['log']('\x20\x20'+a9_0x552bab[_0x2bf1be(0xd8)](_0x16cb7a[_0x2bf1be(0x110)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a9_0x566461(0xfa)]=a9_0x566461(0xc0);['description']=a9_0x566461(0xc6);async[a9_0x566461(0xa8)](_0x287675){const _0x52335d=a9_0x566461,{options:_0x242ac2,args:_0x3269ee,tdx:_0x6c9ce2}=_0x287675,_0x3f92de=_0x3269ee[0x0]||_0x242ac2[_0x52335d(0xd3)];if(!_0x3f92de)return console[_0x52335d(0xfc)](a9_0x552bab[_0x52335d(0x104)]('No\x20composable\x20audience\x20specified.')),console[_0x52335d(0xfc)](_0x52335d(0xf1)+a9_0x552bab[_0x52335d(0x10a)](_0x52335d(0xc1))+_0x52335d(0x100)+a9_0x552bab[_0x52335d(0x10a)]('tdx\x20use\x20cas\x20<name>')),0x1;const _0x33fcba=await withProgressSpinner('Fetching\x20audience\x20\x27'+_0x3f92de+_0x52335d(0x114),()=>_0x6c9ce2[_0x52335d(0x9d)][_0x52335d(0x113)](_0x3f92de),{'verbose':_0x242ac2[_0x52335d(0xac)]}),_0x3b7d91=_0x33fcba['data'];if(isStructuredFormat(_0x242ac2))return await handleSingleObjectOutput(_0x3b7d91,_0x242ac2),0x0;console[_0x52335d(0xb5)](a9_0x552bab['bold'](_0x3b7d91[_0x52335d(0xfa)]));if(_0x3b7d91[_0x52335d(0x110)])console[_0x52335d(0xb5)](a9_0x552bab[_0x52335d(0xd8)](_0x3b7d91[_0x52335d(0x110)]));console[_0x52335d(0xb5)](),console[_0x52335d(0xb5)](a9_0x552bab[_0x52335d(0xf0)](_0x52335d(0x10e))),console[_0x52335d(0xb5)](_0x52335d(0xa6)+_0x3b7d91[_0x52335d(0x101)]),console[_0x52335d(0xb5)](_0x52335d(0xad)+_0x3b7d91[_0x52335d(0xc8)]),console[_0x52335d(0xb5)](_0x52335d(0xb6)+_0x3b7d91[_0x52335d(0xe0)]),console[_0x52335d(0xb5)]();if(_0x3b7d91[_0x52335d(0xe1)]?.['length']){console['log'](a9_0x552bab[_0x52335d(0xf0)]('Attributes\x20('+_0x3b7d91['attributes'][_0x52335d(0xf9)]+')'));for(const _0x386092 of _0x3b7d91[_0x52335d(0xe1)]){console[_0x52335d(0xb5)]('\x20\x20'+a9_0x552bab[_0x52335d(0xd9)](_0x386092[_0x52335d(0xfa)])+'\x20—\x20'+_0x386092[_0x52335d(0xb3)]+'.'+_0x386092[_0x52335d(0x10d)]+'.'+_0x386092[_0x52335d(0x115)]+'\x20('+a9_0x552bab[_0x52335d(0xd8)](_0x386092[_0x52335d(0xcb)])+')');}console[_0x52335d(0xb5)]();}if(_0x3b7d91[_0x52335d(0xff)]?.[_0x52335d(0xf9)]){console[_0x52335d(0xb5)](a9_0x552bab[_0x52335d(0xf0)](_0x52335d(0xd1)+_0x3b7d91[_0x52335d(0xff)][_0x52335d(0xf9)]+')'));for(const _0x10fab9 of _0x3b7d91[_0x52335d(0xff)]){const _0x8cb7f9=_0x10fab9['timeColumn']?'\x20(time:\x20'+_0x10fab9[_0x52335d(0xeb)]+')':'';console['log']('\x20\x20'+a9_0x552bab['bold'](_0x10fab9['name'])+_0x52335d(0xe7)+_0x10fab9[_0x52335d(0xb3)]+'.'+_0x10fab9[_0x52335d(0x10d)]+_0x8cb7f9);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a9_0x566461(0xfa)]='cas:pull';[a9_0x566461(0x110)]=a9_0x566461(0xec);async[a9_0x566461(0xa8)](_0x370d03){const _0x2e4259=a9_0x566461,{options:_0xdbe83,args:_0x46e807,tdx:_0x254514}=_0x370d03,_0x2beb70=_0xdbe83,_0x123134=_0x46e807[0x0]||_0xdbe83[_0x2e4259(0xd3)];if(!_0x123134)return console[_0x2e4259(0xfc)](a9_0x552bab[_0x2e4259(0x104)](_0x2e4259(0xed))),console[_0x2e4259(0xfc)](_0x2e4259(0xf1)+a9_0x552bab[_0x2e4259(0x10a)](_0x2e4259(0xf2))+_0x2e4259(0x100)+a9_0x552bab['cyan'](_0x2e4259(0x9b))),0x1;const _0x2e4b19=_0x2beb70[_0x2e4259(0xe9)]||a9_0x34d5d5[_0x2e4259(0xe8)](process[_0x2e4259(0xe4)](),_0x2e4259(0x9d),sanitizeFileName(_0x123134)),_0x46fb12=await withProgressSpinner(_0x2e4259(0x108)+_0x123134+_0x2e4259(0x114),_0x261807=>_0x254514[_0x2e4259(0x9d)][_0x2e4259(0xa3)](_0x123134,{'targetDir':_0x2e4b19,'verbose':_0x2beb70[_0x2e4259(0xac)],'progress':{'update':_0x41860f=>_0x261807['setPhase'](_0x41860f)}}),{'verbose':_0x2beb70['verbose']}),_0x3d5a6d=_0x46fb12[_0x2e4259(0xa2)],_0x375f00=_0x3d5a6d[_0x2e4259(0xbd)][_0x2e4259(0xe6)](_0x39120d=>_0x39120d['isNew']||_0x39120d[_0x2e4259(0xc3)]);saveSessionContext({'composable_audience':_0x3d5a6d['audienceName']},_0x2beb70[_0x2e4259(0xba)]),console[_0x2e4259(0xb5)](a9_0x552bab[_0x2e4259(0xd7)](_0x2e4259(0xb0)+a9_0x552bab[_0x2e4259(0xd8)]('composable_audience')+_0x2e4259(0xae)+a9_0x552bab[_0x2e4259(0x10a)](_0x3d5a6d[_0x2e4259(0xce)])));if(_0x375f00[_0x2e4259(0xf9)]===0x0)return console[_0x2e4259(0xb5)](a9_0x552bab[_0x2e4259(0xd7)](_0x2e4259(0xb7))),0x0;for(const _0x2b21d3 of _0x375f00){if(_0x2b21d3[_0x2e4259(0xab)])console['log'](a9_0x552bab[_0x2e4259(0xd7)]('+\x20'+_0x2b21d3['relativePath']+_0x2e4259(0xe2)));else _0x2b21d3['diff']&&(console[_0x2e4259(0xb5)](a9_0x552bab[_0x2e4259(0x104)]('~\x20'+_0x2b21d3[_0x2e4259(0xea)])),console[_0x2e4259(0xb5)](_0x2b21d3[_0x2e4259(0xc5)]));}console['log']('\x0a'+_0x375f00[_0x2e4259(0xf9)]+_0x2e4259(0x106)+('('+_0x3d5a6d[_0x2e4259(0xaf)][_0x2e4259(0x107)]+_0x2e4259(0xf6)+_0x3d5a6d['counts'][_0x2e4259(0xbb)]+_0x2e4259(0x109)));if(_0x2beb70[_0x2e4259(0xcd)])return console[_0x2e4259(0xb5)](a9_0x552bab[_0x2e4259(0xd8)]('(dry\x20run\x20—\x20no\x20files\x20written)')),0x0;if(!_0x2beb70[_0x2e4259(0xda)]&&isInteractive()){const _0xf716cd=await confirmKey(_0x2e4259(0xaa));if(!_0xf716cd)return console['log'](a9_0x552bab['dim'](_0x2e4259(0xdf))),0x0;}for(const _0x278b88 of _0x375f00){const _0x5687fd=a9_0x34d5d5[_0x2e4259(0xfe)](_0x278b88['absolutePath']);if(!existsSync(_0x5687fd))mkdirSync(_0x5687fd,{'recursive':!![]});writeFileSync(_0x278b88[_0x2e4259(0x119)],_0x278b88[_0x2e4259(0xb4)],_0x2e4259(0x103));}return console[_0x2e4259(0xb5)](a9_0x552bab[_0x2e4259(0xd7)](_0x2e4259(0xc9)+_0x375f00[_0x2e4259(0xf9)]+_0x2e4259(0xdd)+_0x2e4b19)),0x0;}}export class CASPushCommand extends BaseCommand{[a9_0x566461(0xfa)]='cas:push';[a9_0x566461(0x110)]='Push\x20YAML\x20files\x20to\x20CAS\x20API';async[a9_0x566461(0xa8)](_0x18c8d1){const _0x4b00b1=a9_0x566461,{options:_0x4219ef,args:_0x4b5ec5,tdx:_0x1dee7b}=_0x18c8d1,_0x81f1af=_0x4219ef;let _0x4007cc=_0x4b5ec5[0x0];!_0x4007cc&&_0x4219ef[_0x4b00b1(0xd3)]&&(_0x4007cc=a9_0x34d5d5['join'](process[_0x4b00b1(0xe4)](),'cas',sanitizeFileName(_0x4219ef[_0x4b00b1(0xd3)])));if(!_0x4007cc)return console[_0x4b00b1(0xfc)](a9_0x552bab[_0x4b00b1(0x104)](_0x4b00b1(0xed))),console[_0x4b00b1(0xfc)](_0x4b00b1(0xf1)+a9_0x552bab[_0x4b00b1(0x10a)](_0x4b00b1(0xb2))+'\x20or\x20set\x20context\x20with\x20'+a9_0x552bab[_0x4b00b1(0x10a)](_0x4b00b1(0x9b))),0x1;if(!existsSync(_0x4007cc))return console[_0x4b00b1(0xfc)](a9_0x552bab[_0x4b00b1(0xfd)](_0x4b00b1(0x9e)+_0x4007cc)),console['error'](a9_0x552bab[_0x4b00b1(0xd8)](_0x4b00b1(0x105))),0x1;const _0x495086=_0x4219ef[_0x4b00b1(0xd3)]||a9_0x34d5d5[_0x4b00b1(0x10b)](_0x4007cc),_0x446cbe=a9_0x34d5d5[_0x4b00b1(0xf8)](process[_0x4b00b1(0xe4)](),_0x4007cc)||'.';console[_0x4b00b1(0xb5)]('Audience:\x20'+a9_0x552bab['cyan'](_0x495086)),console[_0x4b00b1(0xb5)](_0x4b00b1(0xf5)+a9_0x552bab[_0x4b00b1(0xd8)](_0x446cbe)),console[_0x4b00b1(0xb5)](a9_0x552bab[_0x4b00b1(0x104)](_0x4b00b1(0xa7))),console[_0x4b00b1(0xb5)]();const _0x388ef3=collectYamlFiles(_0x4007cc);if(_0x388ef3[_0x4b00b1(0xf9)]===0x0)return console[_0x4b00b1(0xfc)](a9_0x552bab[_0x4b00b1(0xfd)](_0x4b00b1(0xd4)+_0x4007cc)),0x1;console[_0x4b00b1(0xb5)](_0x4b00b1(0x102)+_0x388ef3[_0x4b00b1(0xf9)]+_0x4b00b1(0xbe));const _0x544d6b=await withProgressSpinner(_0x4b00b1(0x10c),_0x493881=>_0x1dee7b[_0x4b00b1(0x9d)][_0x4b00b1(0xd6)](_0x388ef3,{'dryRun':!![],'verbose':_0x81f1af[_0x4b00b1(0xac)],'progress':{'update':_0x56a1c4=>_0x493881[_0x4b00b1(0xdc)](_0x56a1c4)}}),{'verbose':_0x81f1af[_0x4b00b1(0xac)]}),_0x4c2535=_0x544d6b[_0x4b00b1(0xa2)],{created:_0x10d603}=_0x4c2535,_0x6ff07c=[];if(_0x10d603[_0x4b00b1(0xdb)])_0x6ff07c[_0x4b00b1(0xd6)](_0x10d603[_0x4b00b1(0xdb)]+'\x20audience(s)');if(_0x10d603['segments'])_0x6ff07c[_0x4b00b1(0xd6)](_0x10d603[_0x4b00b1(0x107)]+_0x4b00b1(0x9c));if(_0x10d603[_0x4b00b1(0xbb)])_0x6ff07c[_0x4b00b1(0xd6)](_0x10d603[_0x4b00b1(0xbb)]+_0x4b00b1(0xde));return _0x6ff07c['length']===0x0?console[_0x4b00b1(0xb5)](a9_0x552bab[_0x4b00b1(0xd8)]('No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.')):console['log'](_0x4b00b1(0xd0)+_0x6ff07c[_0x4b00b1(0xe8)](',\x20')),console['log'](a9_0x552bab[_0x4b00b1(0xd8)](_0x4b00b1(0xf4))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a9_0x566461(0xfa)]=a9_0x566461(0xca);['description']=a9_0x566461(0xb1);async[a9_0x566461(0xa8)](_0x338d9f){const _0x2701a8=a9_0x566461,{options:_0x4ef227,args:_0x4d9c47,tdx:_0xf077c9}=_0x338d9f,_0x54dc78=_0x4d9c47[0x0],_0x2c8d0f=_0x4d9c47[0x1]||_0x4ef227[_0x2701a8(0xd3)];if(!_0x54dc78)return console[_0x2701a8(0xfc)](a9_0x552bab['red'](_0x2701a8(0xf3))),0x1;if(!_0x2c8d0f)return console[_0x2701a8(0xfc)](a9_0x552bab[_0x2701a8(0x104)](_0x2701a8(0x10f))),console[_0x2701a8(0xfc)](_0x2701a8(0xf1)+a9_0x552bab[_0x2701a8(0x10a)]('--audience\x20<name>')+_0x2701a8(0x100)+a9_0x552bab[_0x2701a8(0x10a)](_0x2701a8(0x9b))),0x1;const _0x2488ee=await withProgressSpinner(_0x2701a8(0xa9)+_0x54dc78+_0x2701a8(0x114),()=>_0xf077c9[_0x2701a8(0x9d)][_0x2701a8(0xcc)](_0x2c8d0f,_0x54dc78),{'verbose':_0x4ef227[_0x2701a8(0xac)]}),{query:_0xf8a2dd,customers:_0x194e60}=_0x2488ee[_0x2701a8(0xa2)];if(isStructuredFormat(_0x4ef227))return await handleSingleObjectOutput({'query':_0xf8a2dd,'customers':_0x194e60},_0x4ef227),0x0;const _0x17cbd7=_0xf8a2dd[_0x2701a8(0xb8)]===_0x2701a8(0xef)?a9_0x552bab[_0x2701a8(0xd7)]:a9_0x552bab[_0x2701a8(0x104)];console[_0x2701a8(0xb5)](_0x2701a8(0xe3)+_0x17cbd7(_0xf8a2dd['status'])),console[_0x2701a8(0xb5)](_0x2701a8(0xbf)+a9_0x552bab['bold'](String(_0xf8a2dd[_0x2701a8(0xc7)])));_0xf8a2dd[_0x2701a8(0xfc)]&&console[_0x2701a8(0xb5)](_0x2701a8(0xc2)+a9_0x552bab[_0x2701a8(0xfd)](_0xf8a2dd[_0x2701a8(0xfc)]));if(_0x194e60?.[_0x2701a8(0x9f)]&&_0x194e60?.[_0x2701a8(0xa4)]){console[_0x2701a8(0xb5)](a9_0x552bab[_0x2701a8(0xf0)](_0x2701a8(0xbc)+_0x194e60['rows'][_0x2701a8(0xf9)]+')'));const _0x131bf3=_0x194e60[_0x2701a8(0xa4)][_0x2701a8(0xfb)](_0x41cb49=>{const _0x356336=_0x2701a8,_0x2da0c2={};for(let _0x2749b0=0x0;_0x2749b0<_0x194e60[_0x356336(0x9f)]['length'];_0x2749b0++){_0x2da0c2[_0x194e60[_0x356336(0x9f)][_0x2749b0]]=_0x41cb49[_0x2749b0];}return _0x2da0c2;});await handleSDKOutput(_0x131bf3,_0x4ef227);}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 a10_0x16cf32=a10_0x1ff5;(function(_0x4f8bdd,_0xc17645){const _0x3ffd10=a10_0x1ff5,_0x4d0c28=_0x4f8bdd();while(!![]){try{const _0x7d1155=-parseInt(_0x3ffd10(0x1e8))/0x1+-parseInt(_0x3ffd10(0x1e4))/0x2+-parseInt(_0x3ffd10(0x1e9))/0x3*(-parseInt(_0x3ffd10(0x1e3))/0x4)+parseInt(_0x3ffd10(0x1e7))/0x5+-parseInt(_0x3ffd10(0x1ed))/0x6*(-parseInt(_0x3ffd10(0x1dc))/0x7)+parseInt(_0x3ffd10(0x1d9))/0x8*(-parseInt(_0x3ffd10(0x1d6))/0x9)+parseInt(_0x3ffd10(0x1e5))/0xa;if(_0x7d1155===_0xc17645)break;else _0x4d0c28['push'](_0x4d0c28['shift']());}catch(_0x1c7b4c){_0x4d0c28['push'](_0x4d0c28['shift']());}}}(a10_0x6cbf,0xec35b));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{formatRows}from'../sdk/util/formatters.js';function a10_0x6cbf(){const _0x336902=['verbose','Found\x20','304XFapmI','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','description','37877BMJZwx','Fetching\x20segments\x20for\x20\x27','data','name','List\x20composable\x20segments\x20for\x20an\x20audience','dim','green','3284NMEnOj','2951700yPtzYZ','15697750dHxDwY','log','2989320DeUNuQ','275037zrYnFG','4332kWJlCW','🎯\x20','error','cas','42qvEhIw','cas:sg:list','execute','listSegments','red','population','\x27...','length','159309HkiASB'];a10_0x6cbf=function(){return _0x336902;};return a10_0x6cbf();}function a10_0x1ff5(_0x27c027,_0x5f7a03){_0x27c027=_0x27c027-0x1d5;const _0x6cbfc7=a10_0x6cbf();let _0x1ff5c8=_0x6cbfc7[_0x27c027];return _0x1ff5c8;}import a10_0x5d6b88 from'chalk';export class CASSegmentListCommand extends BaseCommand{[a10_0x16cf32(0x1df)]=a10_0x16cf32(0x1ee);['description']=a10_0x16cf32(0x1e0);async[a10_0x16cf32(0x1ef)](_0x450540){const _0x3ecb09=a10_0x16cf32,{options:_0x33f8ec,args:_0x4cd1e7,tdx:_0x2bd83}=_0x450540,_0x5ee182=_0x4cd1e7[0x0]||_0x33f8ec['composableAudience'];if(!_0x5ee182)return console[_0x3ecb09(0x1eb)](a10_0x5d6b88[_0x3ecb09(0x1f1)](_0x3ecb09(0x1da))),console['error'](a10_0x5d6b88[_0x3ecb09(0x1e1)]('Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>')),0x1;const _0x18633b=await withProgressSpinner(_0x3ecb09(0x1dd)+_0x5ee182+_0x3ecb09(0x1f3),()=>_0x2bd83[_0x3ecb09(0x1ec)][_0x3ecb09(0x1f0)](_0x5ee182),{'verbose':_0x33f8ec[_0x3ecb09(0x1d7)]}),_0x54c287=_0x18633b[_0x3ecb09(0x1de)];if(isStructuredFormat(_0x33f8ec))return await handleSDKOutput(_0x54c287,_0x33f8ec),0x0;console[_0x3ecb09(0x1e6)](a10_0x5d6b88[_0x3ecb09(0x1e2)](_0x3ecb09(0x1d8)+_0x54c287['length']+'\x20segment'+(_0x54c287['length']!==0x1?'s':'')));if(_0x54c287[_0x3ecb09(0x1d5)]===0x0)return 0x0;for(const _0x484696 of _0x54c287){const _0x335758=_0x484696[_0x3ecb09(0x1f2)]!=null?a10_0x5d6b88[_0x3ecb09(0x1e1)]('\x20('+formatRows(_0x484696['population'])+')'):'';console[_0x3ecb09(0x1e6)](_0x3ecb09(0x1ea)+_0x484696[_0x3ecb09(0x1df)]+_0x335758),_0x484696[_0x3ecb09(0x1db)]&&console[_0x3ecb09(0x1e6)]('\x20\x20'+a10_0x5d6b88[_0x3ecb09(0x1e1)](_0x484696[_0x3ecb09(0x1db)]));}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
+ function a11_0x1f68(){const _0x211082=['\x27\x20not\x20found','string','args','includes','stack','1176SxPZIc','stdout','Resolving\x20project\x20\x27','cause','targetWebSearchTool','name','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','error','48596bOObHi','streamChatJsonl','\x0aError:\x20','Error:\x20Chat\x20session\x20\x27','stringify','Error:\x20','options','getDefaultAgent','getOrCreateDefaultAgent','type','content','11132640TXhtPv','\x20\x20Cause:\x20','3554304FSufQf','slice','targetAgent','join','write','\x0aStack\x20trace:','tool_call','resolveAgentId','claude-4.5-haiku','done','log','chat','data','llmProject','CHAT_NOT_FOUND','description','agentId','Create\x20a\x20new\x20chat\x20session','message','404','llm','targetFunction','projectId','llmAgent','handleChatEvent','chatId','tool','Chat\x20session:\x20','\x27...','execute','chat-create','agent','verbose','2940959OJqPuJ','code','Getting\x20default\x20agent...','1251plunmp','metadata','functionName','5450695laKKeg','6sbbJFw','streamChat','site','context','stream','event','513559tAHDeb','targetKnowledgeBase','Using\x20cached\x20default\x20agent:\x20'];a11_0x1f68=function(){return _0x211082;};return a11_0x1f68();}const a11_0x4a40c9=a11_0x317f;function a11_0x317f(_0x432084,_0x169317){_0x432084=_0x432084-0x71;const _0x1f68d6=a11_0x1f68();let _0x317fa9=_0x1f68d6[_0x432084];return _0x317fa9;}(function(_0x20e6f8,_0x3b4b5a){const _0x362924=a11_0x317f,_0x2cd937=_0x20e6f8();while(!![]){try{const _0x42173e=parseInt(_0x362924(0xa0))/0x1+-parseInt(_0x362924(0xa8))/0x2*(-parseInt(_0x362924(0x96))/0x3)+parseInt(_0x362924(0xb0))/0x4+-parseInt(_0x362924(0x99))/0x5*(-parseInt(_0x362924(0x9a))/0x6)+-parseInt(_0x362924(0x93))/0x7+parseInt(_0x362924(0x72))/0x8+-parseInt(_0x362924(0xbb))/0x9;if(_0x42173e===_0x3b4b5a)break;else _0x2cd937['push'](_0x2cd937['shift']());}catch(_0x5bd826){_0x2cd937['push'](_0x2cd937['shift']());}}}(a11_0x1f68,0x9e42a));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(_0x2a15fe,_0x4675af){const _0x51b8a6=a11_0x317f;if(_0x2a15fe instanceof SDKError)console[_0x51b8a6(0xaf)](_0x51b8a6(0xb5)+_0x2a15fe['message']),_0x4675af[_0x51b8a6(0x92)]&&(_0x2a15fe[_0x51b8a6(0xab)]&&console['error'](_0x51b8a6(0x71)+_0x2a15fe['cause']),_0x2a15fe[_0x51b8a6(0xa7)]&&(console[_0x51b8a6(0xaf)](_0x51b8a6(0x77)),console[_0x51b8a6(0xaf)](_0x2a15fe[_0x51b8a6(0xa7)])));else throw _0x2a15fe;}async function resolveAgentId(_0x57775a,_0x4bee8d,_0x18b725,_0x3a4eed,_0x1bd3c0){const _0x209e7d=a11_0x317f,_0x2a5ce4=_0x4bee8d||_0x18b725;if(_0x2a5ce4){const {projectName:_0xe545ff,agentName:_0x341efc}=parseAgentRef(_0x2a5ce4),_0x2fa89e=_0x341efc||_0x2a5ce4,_0x3727b6=_0x341efc?_0xe545ff:_0x3a4eed;if(!_0x3727b6)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x1bd3c0){const _0x45793e=_0x4bee8d?'--agent\x20flag':'session\x20context';console[_0x209e7d(0xaf)]('Using\x20agent\x20from\x20'+_0x45793e+':\x20'+_0x3727b6+'/'+_0x2fa89e);}const _0x2b32fe=await withSpinner(_0x209e7d(0xaa)+_0x3727b6+_0x209e7d(0x8e),()=>_0x57775a[_0x209e7d(0x86)]['resolveProjectId'](_0x3727b6),{'verbose':_0x1bd3c0}),_0x1be834=await withSpinner('Resolving\x20agent\x20\x27'+_0x2fa89e+'\x27...',()=>_0x57775a['llm'][_0x209e7d(0x79)](_0x2fa89e,_0x2b32fe[_0x209e7d(0x7e)]),{'verbose':_0x1bd3c0});return _0x1be834['data'];}else{const _0x538fbd=_0x57775a[_0x209e7d(0x86)][_0x209e7d(0xb7)]();if(_0x538fbd)return _0x1bd3c0&&console[_0x209e7d(0xaf)](_0x209e7d(0xa2)+_0x538fbd[_0x209e7d(0xad)]),_0x538fbd['id'];const _0x22ac07=await withSpinner(_0x209e7d(0x95),()=>_0x57775a[_0x209e7d(0x86)][_0x209e7d(0xb8)](_0x209e7d(0x7a),0x0),{'verbose':_0x1bd3c0});return _0x22ac07['data']['id'];}}export class ChatCommand extends BaseCommand{['name']=a11_0x4a40c9(0x7d);[a11_0x4a40c9(0x81)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';['validate'](_0x9f6db1){const _0x425ee8=a11_0x4a40c9,_0x3878b8=_0x9f6db1[_0x425ee8(0xa5)][_0x425ee8(0x75)]('\x20');if(!_0x3878b8)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a11_0x4a40c9(0x9b)](_0x225e77,_0xec3cf8,_0x520688,_0x30afe8,_0x34ec6c){const _0x277e01=a11_0x4a40c9;for await(const _0x93969f of _0x225e77['llm'][_0x277e01(0x7d)](_0xec3cf8,{'agentId':_0x520688,'chatId':_0x30afe8})){if(_0x93969f[_0x277e01(0xb9)]===_0x277e01(0x97)){const _0x1b1513=_0x93969f[_0x277e01(0x7e)][_0x277e01(0x8b)];saveLastChatId(_0x1b1513),_0x34ec6c&&console[_0x277e01(0xaf)](_0x277e01(0x8d)+_0x1b1513);}else _0x93969f[_0x277e01(0xb9)]===_0x277e01(0x9f)&&this[_0x277e01(0x8a)](_0x93969f[_0x277e01(0x7e)]);}}async[a11_0x4a40c9(0xb1)](_0x5d1a3e,_0x3f8ddf,_0x537c6f,_0x5c6a63){const _0x257ab0=a11_0x4a40c9,_0x4b17ad=_0x5d1a3e[_0x257ab0(0x9d)][_0x257ab0(0x9c)];let _0x415dc3=![];for await(const _0xb9123f of _0x5d1a3e[_0x257ab0(0x86)]['chat'](_0x3f8ddf,{'agentId':_0x537c6f,'chatId':_0x5c6a63})){if(_0xb9123f[_0x257ab0(0xb9)]===_0x257ab0(0x97)){const _0x364bae=_0xb9123f[_0x257ab0(0x7e)];saveLastChatId(_0x364bae['chatId']);const _0x301f2f=_0x364bae['projectId']&&_0x364bae[_0x257ab0(0x82)]?getLLMConversationUrl(_0x4b17ad,_0x364bae[_0x257ab0(0x88)],_0x364bae[_0x257ab0(0x82)],_0x364bae[_0x257ab0(0x8b)]):undefined;console[_0x257ab0(0x7c)](JSON[_0x257ab0(0xb4)]({'type':'metadata','data':{'chatId':_0x364bae['chatId'],'agentId':_0x364bae[_0x257ab0(0x82)],'consoleUrl':_0x301f2f}})),_0x415dc3=!![];}else{if(_0xb9123f[_0x257ab0(0xb9)]===_0x257ab0(0x9f)){!_0x415dc3&&_0x5c6a63&&(console[_0x257ab0(0x7c)](JSON['stringify']({'type':_0x257ab0(0x97),'data':{'chatId':_0x5c6a63}})),_0x415dc3=!![]);const _0x587640=_0xb9123f['data'];if(_0x257ab0(0xba)in _0x587640)console[_0x257ab0(0x7c)](JSON[_0x257ab0(0xb4)]({'type':_0x257ab0(0xba),'data':{'content':_0x587640[_0x257ab0(0xba)]}}));else{if(_0x257ab0(0x78)in _0x587640){const _0xf92e11=_0x587640['tool_call'];console[_0x257ab0(0x7c)](JSON[_0x257ab0(0xb4)]({'type':_0x257ab0(0x78),'data':{'id':_0xf92e11['id'],'name':_0xf92e11[_0x257ab0(0x98)],'target':_0xf92e11[_0x257ab0(0xa1)]?.['name']||_0xf92e11[_0x257ab0(0x74)]?.['name']||_0xf92e11[_0x257ab0(0xac)]?.['name']||_0xf92e11[_0x257ab0(0x87)]}}));}else{if(_0x257ab0(0x8c)in _0x587640)console[_0x257ab0(0x7c)](JSON[_0x257ab0(0xb4)]({'type':'tool_result','data':{'id':_0x587640['tool']['id'],'name':_0x587640[_0x257ab0(0x8c)]['functionName'],'result':typeof _0x587640['tool'][_0x257ab0(0xba)]===_0x257ab0(0xa4)?_0x587640[_0x257ab0(0x8c)][_0x257ab0(0xba)][_0x257ab0(0x73)](0x0,0x1f4):''}}));else _0x257ab0(0xaf)in _0x587640&&console[_0x257ab0(0x7c)](JSON[_0x257ab0(0xb4)]({'type':_0x257ab0(0xaf),'data':{'error':_0x587640[_0x257ab0(0xaf)]}}));}}}}}console[_0x257ab0(0x7c)](JSON[_0x257ab0(0xb4)]({'type':_0x257ab0(0x7b)}));}async[a11_0x4a40c9(0x8f)](_0x1dec57){const _0x3ac26a=a11_0x4a40c9,{options:_0x919c35,args:_0x4bb36d,tdx:_0x5b337d}=_0x1dec57,_0x2237cc=_0x4bb36d[_0x3ac26a(0x75)]('\x20'),_0x1ff2f9=_0x919c35,_0x5657ad=_0x1ff2f9[_0x3ac26a(0x91)],_0x440bb0=_0x1ff2f9[_0x3ac26a(0x89)],_0x87fbc2=_0x1ff2f9[_0x3ac26a(0x7f)],_0x5c85f1=_0x1ff2f9['new'],_0x3ab9fe=_0x1ff2f9[_0x3ac26a(0x8b)],_0x134b77=_0x1ff2f9[_0x3ac26a(0x9e)];if(_0x5c85f1&&_0x3ab9fe)return console[_0x3ac26a(0xaf)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x44a06b,_0x3a6cb8;if(_0x3ab9fe)_0x3a6cb8=_0x3ab9fe;else!_0x5c85f1&&(_0x3a6cb8=loadLastChatId(),_0x3a6cb8&&_0x919c35[_0x3ac26a(0x92)]&&console[_0x3ac26a(0xaf)]('Continuing\x20chat:\x20'+_0x3a6cb8));!_0x3ab9fe&&(_0x5c85f1||!_0x3a6cb8)&&(_0x44a06b=await resolveAgentId(_0x5b337d,_0x5657ad,_0x440bb0,_0x87fbc2,_0x919c35[_0x3ac26a(0x92)]));const _0x4baba6=_0x134b77?(_0x8ce54a,_0x4fae74,_0x334f45)=>this[_0x3ac26a(0xb1)](_0x5b337d,_0x8ce54a,_0x4fae74,_0x334f45):(_0x459b05,_0x232613,_0x1ec178)=>this['streamChat'](_0x5b337d,_0x459b05,_0x232613,_0x1ec178,_0x919c35[_0x3ac26a(0x92)]);try{await _0x4baba6(_0x2237cc,_0x44a06b,_0x3a6cb8);}catch(_0x4191ca){const _0x2a3cf0=_0x4191ca instanceof SDKError&&_0x4191ca[_0x3ac26a(0x94)]===ErrorCode[_0x3ac26a(0x80)]||_0x4191ca instanceof Error&&_0x4191ca[_0x3ac26a(0x84)][_0x3ac26a(0xa6)](_0x3ac26a(0x85));if(_0x2a3cf0&&_0x3ab9fe)return console['error'](_0x3ac26a(0xb3)+_0x3ab9fe+_0x3ac26a(0xa3)),0x1;if(_0x2a3cf0)_0x919c35[_0x3ac26a(0x92)]&&console[_0x3ac26a(0xaf)](_0x3ac26a(0xae)),!_0x44a06b&&(_0x44a06b=await resolveAgentId(_0x5b337d,_0x5657ad,_0x440bb0,_0x87fbc2,_0x919c35[_0x3ac26a(0x92)])),await _0x4baba6(_0x2237cc,_0x44a06b,undefined);else throw _0x4191ca;}return!_0x134b77&&console[_0x3ac26a(0x7c)](),0x0;}catch(_0x293a12){return console[_0x3ac26a(0xaf)](),handleSDKError(_0x293a12,_0x919c35),0x1;}}['handleChatEvent'](_0x2956b6){const _0x388024=a11_0x4a40c9;if(_0x388024(0xba)in _0x2956b6)process[_0x388024(0xa9)][_0x388024(0x76)](_0x2956b6[_0x388024(0xba)]);else _0x388024(0xaf)in _0x2956b6&&console['error'](_0x388024(0xb2)+_0x2956b6[_0x388024(0xaf)]);}}export class ChatCreateCommand extends BaseCommand{[a11_0x4a40c9(0xad)]=a11_0x4a40c9(0x90);['description']=a11_0x4a40c9(0x83);['validate'](_0x524247){const _0x29e477=a11_0x4a40c9,_0x5d3d32=_0x524247[_0x29e477(0xb6)],_0x3a1a63=_0x5d3d32['agent'],_0x3a2042=_0x5d3d32['llmAgent'];if(!_0x3a1a63&&!_0x3a2042)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a11_0x4a40c9(0x8f)](_0x319b40){const _0x2550e4=a11_0x4a40c9,{options:_0x493765,tdx:_0x52d4d2}=_0x319b40,_0x82c9f8=_0x493765,_0x35f947=_0x82c9f8['agent'],_0x26565f=_0x82c9f8[_0x2550e4(0x89)],_0x4e6f25=_0x82c9f8[_0x2550e4(0x7f)];try{const _0x11d67b=await resolveAgentId(_0x52d4d2,_0x35f947,_0x26565f,_0x4e6f25,_0x493765[_0x2550e4(0x92)]),_0x1ce952=await _0x52d4d2[_0x2550e4(0x86)]['startChat'](_0x11d67b);return saveLastChatId(_0x1ce952['id']),console[_0x2550e4(0x7c)](JSON[_0x2550e4(0xb4)]({'chatId':_0x1ce952['id'],'agentId':_0x11d67b})),0x0;}catch(_0x5b2c57){return handleSDKError(_0x5b2c57,_0x493765),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 a12_0x5ae5fc=a12_0x59e5;(function(_0x560882,_0x3b5c44){const _0x5c15dc=a12_0x59e5,_0x2542f1=_0x560882();while(!![]){try{const _0x127cfe=parseInt(_0x5c15dc(0x88))/0x1*(-parseInt(_0x5c15dc(0x113))/0x2)+-parseInt(_0x5c15dc(0xcc))/0x3*(-parseInt(_0x5c15dc(0x116))/0x4)+parseInt(_0x5c15dc(0xaa))/0x5*(parseInt(_0x5c15dc(0xbe))/0x6)+parseInt(_0x5c15dc(0x9c))/0x7*(parseInt(_0x5c15dc(0xe8))/0x8)+parseInt(_0x5c15dc(0xdd))/0x9*(-parseInt(_0x5c15dc(0xdf))/0xa)+parseInt(_0x5c15dc(0x98))/0xb+parseInt(_0x5c15dc(0xef))/0xc*(-parseInt(_0x5c15dc(0xbd))/0xd);if(_0x127cfe===_0x3b5c44)break;else _0x2542f1['push'](_0x2542f1['shift']());}catch(_0x1224b5){_0x2542f1['push'](_0x2542f1['shift']());}}}(a12_0x57d7,0x1928d));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{execFile}from'node:child_process';import{existsSync}from'node:fs';import{homedir}from'node:os';function a12_0x57d7(){const _0x41f685=['td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','already\x20configured','INSTALLATION_FAILED','✓\x20td-skills\x20checked\x20out\x20at\x20','):\x20claude\x20','✓\x20Marketplace\x20\x27','user','update','debug','reset','checkout','toISOString','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','fetch','633699qLAsLB','origin/main','--transport','.claude','8197BJcuMj','.tdx-settings-backup.json','stringify','env','Executing:\x20claude\x20','ENOENT','passThroughServer','data','claude','\x20claude\x20statusline','\x27\x20updated','\x27\x20configured','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','green','5hSFgck','Command\x20output:\x20','git','\x20already\x20configured','plugins','description','\x20→\x20','...','add','originalSettings','utf-8','\x27\x20removed','tdx\x20--profile\x20','Failed\x20to\x20spawn\x20claude\x20command:\x20','pid','stdout','Failed\x20to\x20launch\x20Claude\x20Code:\x20','apiKey','Command\x20failed\x20(exit\x20','9009qzgBav','1210914tPyWal','\x20meets\x20minimum\x20requirement','Failed\x20to\x20remove\x20marketplace\x20\x27','\x20is\x20too\x20old\x20(minimum:\x20','td-skills','CLAUDE_CODE_USE_VERTEX','td-docs','TD\x20Docs\x20MCP\x20Server','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','cwd','text','already\x20exists','treasure-data','false','150PQdubp','http','td-skills\x20checked\x20out\x20at\x20tag\x20','✓\x20Claude\x20Code\x20version\x20OK','Command\x20spawn\x20error:\x20','logLevel','parse','toString','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','patch','Claude\x20Code\x20CLI\x20not\x20found','INTERNAL','execute','2.0.20','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','llm-proxy','https://github.com/treasure-data/td-skills','9vcJZrH','mcp','706360LSAAbA','cause','CLAUDE_CODE_NOT_FOUND','settings.local.json','https://docs.treasuredata.com/mcp','account_id','Configuring\x20MCP\x20server\x20\x27','plugin','\x20or\x20later.','944tofShY','✓\x20Logging\x20to\x20','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','warn','Creating\x20.claude/settings.local.json...','code','--hard','3924FeNRxU','CLAUDE_CODE_USE_BEDROCK','exit','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','Installing\x20plugin\x20\x27','command','main','Marketplace\x20\x27','port','marketplace','\x27...','ANTHROPIC_BASE_URL','Failed\x20to\x20list\x20marketplaces','minor','✓\x20Settings\x20restored:\x20.claude/settings.local.json','stop','unshift','pipe','fail','trim','continue','message','✓\x20Logs\x20saved\x20to\x20','ANTHROPIC_MODEL','list','logger','--tags','statusLine','match','major','td-skills\x20Plugins','verbose','kill','getLogPath','2XybmBM','close','\x27:\x20','10084QXMcSG','already\x20installed','site','http://127.0.0.1:','Warning:\x20Failed\x20to\x20configure\x20','tdx-skills','Claude\x20Code\x20version\x20check\x20failed','origin','inherit','log','error','getCurrent','join','\x27\x20installed','Claude\x20Code\x20version\x20','INVALID_ARGUMENT','tdx-managed-proxy','resume','ANTHROPIC_AUTH_TOKEN','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Checking\x20out\x20td-skills\x20','info','Failed\x20to\x20configure\x20marketplace\x20\x27','123356hHerkW','init'];a12_0x57d7=function(){return _0x41f685;};return a12_0x57d7();}import{join}from'node:path';import{promisify}from'node:util';import a12_0x1b6ba2 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_0x5ae5fc(0xd9),SETTINGS_BACKUP_FILENAME=a12_0x5ae5fc(0x9d);function isProcessRunning(_0x362148){const _0x36d533=a12_0x5ae5fc;try{return process[_0x36d533(0x111)](_0x362148,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x340bee,_0x2af7a5){const _0x12cfb9=a12_0x5ae5fc;if(!existsSync(_0x340bee))return;try{const _0x2650ff=await readFile(_0x340bee,_0x12cfb9(0xb4)),_0x48ac76=JSON[_0x12cfb9(0xd2)](_0x2650ff),_0x1f6ad6=_0x48ac76[_0x12cfb9(0x9f)]||{};for(const _0x397efa of[_0x12cfb9(0xfc),_0x12cfb9(0x108),_0x12cfb9(0x83),_0x12cfb9(0xf0),_0x12cfb9(0xc3)]){_0x2af7a5[_0x397efa]!==undefined?_0x1f6ad6[_0x397efa]=_0x2af7a5[_0x397efa]:delete _0x1f6ad6[_0x397efa];}_0x2af7a5[_0x12cfb9(0x10c)]!==undefined?_0x48ac76['statusLine']=_0x2af7a5[_0x12cfb9(0x10c)]:delete _0x48ac76['statusLine'],_0x48ac76['env']=_0x1f6ad6,await writeFile(_0x340bee,JSON[_0x12cfb9(0x9e)](_0x48ac76,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x530387){try{await unlink(_0x530387);}catch{}}async function recoverFromStaleBackup(_0xf9b91f,_0x5707d9){const _0x369471=a12_0x5ae5fc;if(!existsSync(_0x5707d9))return undefined;try{const _0x2506bb=await readFile(_0x5707d9,'utf-8'),_0x4af78e=JSON[_0x369471(0xd2)](_0x2506bb);if(isProcessRunning(_0x4af78e[_0x369471(0xb8)]))return{'liveSessionOriginals':_0x4af78e['originalSettings']};return await applyOriginalSettings(_0xf9b91f,_0x4af78e[_0x369471(0xb3)]),await safeUnlink(_0x5707d9),undefined;}catch{return await safeUnlink(_0x5707d9),undefined;}}function handleInstallationError(_0xf0cf2,_0x51ce4a,_0x17a4d3,_0x347c99){const _0x43ad53=a12_0x5ae5fc;errorContains(_0xf0cf2,_0x43ad53(0xc9),_0x43ad53(0x117),_0x43ad53(0x8b))?(_0x17a4d3['text']='✓\x20'+_0x51ce4a+_0x43ad53(0xad),_0x347c99?.[_0x43ad53(0x86)](_0x51ce4a+_0x43ad53(0xad)),_0xf0cf2 instanceof SDKError&&_0xf0cf2[_0x43ad53(0xe0)]&&_0x347c99?.[_0x43ad53(0x92)](_0x43ad53(0xab)+_0xf0cf2[_0x43ad53(0xe0)]['message'])):(_0x17a4d3['warn'](_0x43ad53(0x75)+_0x51ce4a),_0x347c99?.[_0x43ad53(0x7b)](_0x51ce4a+'\x20configuration\x20failed',_0xf0cf2));}export function parseVersion(_0x5c795d){const _0x182547=a12_0x5ae5fc,_0x7ac3f1=_0x5c795d[_0x182547(0x104)]()[_0x182547(0x10d)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x7ac3f1)return null;return{'major':parseInt(_0x7ac3f1[0x1],0xa),'minor':parseInt(_0x7ac3f1[0x2],0xa),'patch':parseInt(_0x7ac3f1[0x3],0xa)};}export function compareVersions(_0x4ed6fe,_0x1b7421){const _0x28ae9=a12_0x5ae5fc;if(_0x4ed6fe[_0x28ae9(0x10e)]!==_0x1b7421['major'])return _0x4ed6fe['major']-_0x1b7421[_0x28ae9(0x10e)];if(_0x4ed6fe[_0x28ae9(0xfe)]!==_0x1b7421[_0x28ae9(0xfe)])return _0x4ed6fe[_0x28ae9(0xfe)]-_0x1b7421[_0x28ae9(0xfe)];return _0x4ed6fe[_0x28ae9(0xd5)]-_0x1b7421['patch'];}async function checkClaudeVersion(_0x4e98ea,_0x5d5f8c){const _0x40ec61=a12_0x5ae5fc;_0x5d5f8c?.['debug'](_0x40ec61(0x96)+_0x4e98ea+')');const _0x4c2884=await executeClaudeCommand(['--version'],undefined,_0x5d5f8c),_0x25e324=parseVersion(_0x4c2884);if(!_0x25e324){_0x5d5f8c?.[_0x40ec61(0xeb)](_0x40ec61(0xc6)+_0x4c2884);return;}const _0x44b2c6=_0x25e324['major']+'.'+_0x25e324[_0x40ec61(0xfe)]+'.'+_0x25e324['patch'],_0x8c5cd8=parseVersion(_0x4e98ea);if(!_0x8c5cd8){_0x5d5f8c?.['warn']('Invalid\x20minimum\x20version\x20format:\x20'+_0x4e98ea);return;}if(compareVersions(_0x25e324,_0x8c5cd8)<0x0){_0x5d5f8c?.[_0x40ec61(0x7b)](_0x40ec61(0x7f)+_0x44b2c6+_0x40ec61(0xc1)+_0x4e98ea+')');throw new SDKError(ErrorCode['CLAUDE_CODE_UNSUPPORTED_VERSION'],_0x40ec61(0x7f)+_0x44b2c6+_0x40ec61(0xf2)+_0x4e98ea+_0x40ec61(0xe7),undefined,{'helpText':_0x40ec61(0xea)});}_0x5d5f8c?.[_0x40ec61(0x92)](_0x40ec61(0x7f)+_0x44b2c6+_0x40ec61(0xbf));}async function executeClaudeCommand(_0x2e47b7,_0x19dc89,_0x46b032){const _0x442f5b=a12_0x5ae5fc;return _0x46b032?.[_0x442f5b(0x86)](_0x442f5b(0xa0)+_0x2e47b7[_0x442f5b(0x7d)]('\x20')),new Promise((_0x3bc8fe,_0x24097e)=>{const _0x1b2885=_0x442f5b,_0x1661c5=crossSpawn(_0x1b2885(0xa4),_0x2e47b7,{'stdio':_0x1b2885(0x102)});let _0x2d5dd1='',_0xf714c4='';_0x1661c5[_0x1b2885(0xb9)]?.['on'](_0x1b2885(0xa3),_0x21f8f8=>{const _0x335ef7=_0x1b2885;_0x2d5dd1+=_0x21f8f8[_0x335ef7(0xd3)]();}),_0x1661c5['stderr']?.['on'](_0x1b2885(0xa3),_0x1bf073=>{const _0x57bbad=_0x1b2885;_0xf714c4+=_0x1bf073[_0x57bbad(0xd3)]();}),_0x1661c5['on'](_0x1b2885(0x7b),_0x398e1c=>{const _0x5c7446=_0x1b2885;_0x398e1c[_0x5c7446(0xed)]===_0x5c7446(0xa1)?(_0x46b032?.[_0x5c7446(0x7b)](_0x5c7446(0xd6)),_0x24097e(new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x5c7446(0xd6),_0x398e1c,{'helpText':_0x5c7446(0xf3)}))):(_0x46b032?.[_0x5c7446(0x7b)](_0x5c7446(0xd0)+_0x398e1c[_0x5c7446(0x106)]),_0x24097e(new SDKError(ErrorCode[_0x5c7446(0xd7)],_0x5c7446(0xb7)+_0x398e1c[_0x5c7446(0x106)],_0x398e1c)));}),_0x1661c5['on'](_0x1b2885(0xf1),_0x2bb985=>{const _0x3bd406=_0x1b2885;if(_0x2bb985===0x0)_0x3bc8fe(_0x2d5dd1);else _0x19dc89?(_0x46b032?.[_0x3bd406(0x7b)](_0x3bd406(0xbc)+_0x2bb985+_0x3bd406(0x8e)+_0x2e47b7[_0x3bd406(0x7d)]('\x20')),_0x24097e(new SDKError(ErrorCode[_0x3bd406(0x8c)],_0x19dc89,new Error(_0xf714c4)))):_0x3bc8fe('');});});}async function ensureMcpServer(_0x5c7d35,_0x1370c6,_0x200bcc,_0x5e84dc,_0x41770f){const _0x352932=a12_0x5ae5fc;_0x5e84dc['text']=_0x352932(0xe5)+_0x5c7d35+_0x352932(0xfb),await executeClaudeCommand([_0x352932(0xde),_0x352932(0xb2),_0x5c7d35,_0x1370c6,_0x352932(0x9a),_0x200bcc],_0x352932(0xda)+_0x5c7d35+'\x27',_0x41770f),_0x5e84dc[_0x352932(0xc8)]='✓\x20MCP\x20server\x20\x27'+_0x5c7d35+_0x352932(0xa7);}export const DEFAULT_TD_SKILLS_URL=a12_0x5ae5fc(0xdc);export function getTdSkillsRepoUrl(){const _0x292e36=process.env.TDX_TD_SKILLS_REPO;if(_0x292e36)return _0x292e36;return DEFAULT_TD_SKILLS_URL;}function a12_0x59e5(_0xc49c41,_0xfb5639){_0xc49c41=_0xc49c41-0x74;const _0x57d778=a12_0x57d7();let _0x59e5da=_0x57d778[_0xc49c41];return _0x59e5da;}async function removeMarketplace(_0x24796c,_0x339065){const _0x219e6d=a12_0x5ae5fc;try{const _0xa3a354=await executeClaudeCommand([_0x219e6d(0xe6),_0x219e6d(0xfa),_0x219e6d(0x109)],_0x219e6d(0xfd),_0x339065);if(!_0xa3a354['includes'](_0x24796c)){_0x339065?.[_0x219e6d(0x92)](_0x219e6d(0xf8)+_0x24796c+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand([_0x219e6d(0xe6),_0x219e6d(0xfa),'remove',_0x24796c],_0x219e6d(0xc0)+_0x24796c+'\x27',_0x339065),_0x339065?.[_0x219e6d(0x86)](_0x219e6d(0xf8)+_0x24796c+_0x219e6d(0xb5));}catch(_0x446e60){_0x339065?.[_0x219e6d(0xeb)]('Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x24796c+_0x219e6d(0x115)+_0x446e60);}}async function restoreDefaultTdSkillsMarketplace(_0x25f7fd){const _0x304dd0=a12_0x5ae5fc;try{await removeMarketplace('td-skills',_0x25f7fd),await executeClaudeCommand([_0x304dd0(0xe6),_0x304dd0(0xfa),_0x304dd0(0xb2),DEFAULT_TD_SKILLS_URL],undefined,_0x25f7fd),_0x25f7fd?.[_0x304dd0(0x86)]('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0x464491,_0x2f950a,_0x347f19,_0x3d5259){const _0x3bccbc=a12_0x5ae5fc;_0x347f19[_0x3bccbc(0xc8)]='Configuring\x20marketplace\x20\x27'+_0x464491+_0x3bccbc(0xfb),await executeClaudeCommand([_0x3bccbc(0xe6),_0x3bccbc(0xfa),_0x3bccbc(0xb2),_0x2f950a],_0x3bccbc(0x87)+_0x464491+'\x27',_0x3d5259),_0x347f19[_0x3bccbc(0xc8)]=_0x3bccbc(0x8f)+_0x464491+_0x3bccbc(0xa7);}async function updateMarketplace(_0x36a007,_0x571619,_0x21952c){const _0x430462=a12_0x5ae5fc;_0x571619['text']='Updating\x20marketplace\x20\x27'+_0x36a007+_0x430462(0xfb),await executeClaudeCommand([_0x430462(0xe6),_0x430462(0xfa),_0x430462(0x91)],'Failed\x20to\x20update\x20marketplace\x20\x27'+_0x36a007+'\x27',_0x21952c),_0x571619[_0x430462(0xc8)]=_0x430462(0x8f)+_0x36a007+_0x430462(0xa6);}async function ensurePlugin(_0x3d06a6,_0xc94e37,_0x512e49,_0x4c0845){const _0x22cc1b=a12_0x5ae5fc;_0x512e49[_0x22cc1b(0xc8)]=_0x22cc1b(0xf5)+_0x3d06a6+_0x22cc1b(0xfb),await executeClaudeCommand(['plugin','install',_0x3d06a6+'@'+_0xc94e37],'Failed\x20to\x20install\x20plugin\x20\x27'+_0x3d06a6+'\x27',_0x4c0845),_0x512e49[_0x22cc1b(0xc8)]='✓\x20Plugin\x20\x27'+_0x3d06a6+_0x22cc1b(0x7e);}function getClaudeConfigDir(){const _0x5cf24f=a12_0x5ae5fc;return process.env.CLAUDE_CONFIG_DIR||join(homedir(),_0x5cf24f(0x9b));}async function checkoutReleaseTag(_0x5cf2e9,_0x3b0cec,_0x55b2a2){const _0x3267d7=a12_0x5ae5fc,_0x27d7da=join(getClaudeConfigDir(),_0x3267d7(0xae),'marketplaces',_0x3267d7(0xc2));if(!existsSync(_0x27d7da)){_0x55b2a2?.[_0x3267d7(0x92)](_0x3267d7(0x8a));return;}_0x3b0cec[_0x3267d7(0xc8)]=_0x3267d7(0x85)+_0x5cf2e9+_0x3267d7(0xb1),await execFileAsync(_0x3267d7(0xac),[_0x3267d7(0x97),_0x3267d7(0x78),_0x3267d7(0x10b),'--force'],{'cwd':_0x27d7da});try{await execFileAsync(_0x3267d7(0xac),[_0x3267d7(0x94),_0x3267d7(0xf7)],{'cwd':_0x27d7da});}catch{await execFileAsync('git',[_0x3267d7(0x94),'-b','main',_0x3267d7(0x99)],{'cwd':_0x27d7da});}await execFileAsync(_0x3267d7(0xac),[_0x3267d7(0x93),_0x3267d7(0xee),_0x5cf2e9],{'cwd':_0x27d7da}),_0x3b0cec['text']=_0x3267d7(0x8d)+_0x5cf2e9,_0x55b2a2?.[_0x3267d7(0x86)](_0x3267d7(0xce)+_0x5cf2e9);}async function createClaudeSettings(_0x5b465f,_0x2abf30,_0x46f5a4){const _0x17fb88=a12_0x5ae5fc,_0xba2f44=join(process[_0x17fb88(0xc7)](),_0x17fb88(0x9b)),_0x59fe02=join(_0xba2f44,_0x17fb88(0xe2)),_0x10ff0c=join(_0xba2f44,SETTINGS_BACKUP_FILENAME);await mkdir(_0xba2f44,{'recursive':!![]});const _0x20afbd=await recoverFromStaleBackup(_0x59fe02,_0x10ff0c);let _0x2a07c2;if(_0x20afbd)_0x2a07c2=_0x20afbd['liveSessionOriginals'];else{let _0x9598bd={};if(existsSync(_0x59fe02))try{const _0x29380a=await readFile(_0x59fe02,_0x17fb88(0xb4));_0x9598bd=JSON[_0x17fb88(0xd2)](_0x29380a);}catch{_0x9598bd={};}const _0x1c4e61=_0x9598bd[_0x17fb88(0x9f)]||{};_0x2a07c2={'ANTHROPIC_BASE_URL':_0x1c4e61['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x1c4e61[_0x17fb88(0x108)],'ANTHROPIC_AUTH_TOKEN':_0x1c4e61[_0x17fb88(0x83)],'CLAUDE_CODE_USE_BEDROCK':_0x1c4e61[_0x17fb88(0xf0)],'CLAUDE_CODE_USE_VERTEX':_0x1c4e61[_0x17fb88(0xc3)],'statusLine':_0x9598bd[_0x17fb88(0x10c)]};const _0x43b368={'createdAt':new Date()[_0x17fb88(0x95)](),'pid':process[_0x17fb88(0xb8)],'originalSettings':_0x2a07c2};await writeFile(_0x10ff0c,JSON[_0x17fb88(0x9e)](_0x43b368,null,0x2)+'\x0a');}let _0x15ffc5={};if(existsSync(_0x59fe02))try{const _0x290c89=await readFile(_0x59fe02,_0x17fb88(0xb4));_0x15ffc5=JSON[_0x17fb88(0xd2)](_0x290c89);}catch{_0x15ffc5={};}const _0x11664a=_0x15ffc5[_0x17fb88(0x9f)]||{},_0x4f3978={..._0x15ffc5,'env':{..._0x11664a,'ANTHROPIC_BASE_URL':'http://127.0.0.1:'+_0x5b465f,..._0x2abf30&&{'ANTHROPIC_MODEL':_0x2abf30},'ANTHROPIC_AUTH_TOKEN':_0x17fb88(0x81),'CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0x17fb88(0xcb)},'statusLine':{'type':_0x17fb88(0xf6),'command':_0x46f5a4?_0x17fb88(0xb6)+_0x46f5a4+_0x17fb88(0xa5):'tdx\x20claude\x20statusline'}};return await writeFile(_0x59fe02,JSON[_0x17fb88(0x9e)](_0x4f3978,null,0x2)+'\x0a'),_0x2a07c2;}async function restoreClaudeSettings(_0x59b9b7){const _0x1c58b2=a12_0x5ae5fc,_0x502d0c=join(process[_0x1c58b2(0xc7)](),'.claude'),_0x3908a0=join(_0x502d0c,_0x1c58b2(0xe2)),_0x517716=join(_0x502d0c,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x3908a0,_0x59b9b7);try{if(existsSync(_0x517716)){const _0x5a5d1e=await readFile(_0x517716,_0x1c58b2(0xb4)),_0x477563=JSON[_0x1c58b2(0xd2)](_0x5a5d1e);_0x477563['pid']===process[_0x1c58b2(0xb8)]&&await safeUnlink(_0x517716);}}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a12_0x5ae5fc(0xa4);[a12_0x5ae5fc(0xaf)]=a12_0x5ae5fc(0xd4);[a12_0x5ae5fc(0xa2)];[a12_0x5ae5fc(0xb3)];[a12_0x5ae5fc(0x10a)];[a12_0x5ae5fc(0xf9)];async[a12_0x5ae5fc(0xd8)](_0x4329e5){const _0x41efad=a12_0x5ae5fc,{tdx:_0x39b332,options:_0x51277b,args:_0x3eca8c}=_0x4329e5;let _0xd7851=![];try{const _0x2ea575=_0x51277b,_0x142046=_0x2ea575['proxy']===![],_0x2054e6=_0x2ea575[_0x41efad(0x105)]===!![],_0x54bc1c=_0x2ea575[_0x41efad(0x82)]===!![],_0x17c1b2=[..._0x3eca8c];if(_0x2054e6)_0x17c1b2[_0x41efad(0x101)]('-c');else _0x54bc1c&&_0x17c1b2[_0x41efad(0x101)]('-r');const _0xc2a17c=createCommandSpinner('Initializing...',{'verbose':_0x51277b[_0x41efad(0x110)]});_0xc2a17c['start']();try{if(!_0x142046){const _0x3ad4d2=_0x51277b['profile'];try{const _0x1a75de=await _0x39b332[_0x41efad(0x90)][_0x41efad(0x7c)]();_0x1a75de[_0x41efad(0xe4)]&&writeCachedAccountInfo(_0x51277b[_0x41efad(0x118)],_0x1a75de[_0x41efad(0xe4)],_0x3ad4d2);}catch{}_0xc2a17c[_0x41efad(0xc8)]='Initializing\x20proxy\x20logger...',this[_0x41efad(0x10a)]=new TDXLogger(_0x51277b[_0x41efad(0xd1)],!![]),await this[_0x41efad(0x10a)][_0x41efad(0x89)]();const _0xda56ae=this['logger'][_0x41efad(0x112)]();_0xc2a17c[_0x41efad(0xc8)]=_0x41efad(0xe9)+_0xda56ae;const _0x2cc24a=getEndpoint(_0x51277b['site'],_0x41efad(0xdb));_0xc2a17c['text']='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';if(!_0x39b332['context']['apiKey'])throw new SDKError(ErrorCode[_0x41efad(0x80)],'API\x20key\x20is\x20required\x20for\x20TD\x20LLM\x20Proxy\x20mode');this[_0x41efad(0xa2)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x2cc24a,'apiKey':_0x39b332['context'][_0x41efad(0xbb)],'logger':this[_0x41efad(0x10a)],'site':_0x51277b['site'],'profile':_0x3ad4d2}),await this[_0x41efad(0xa2)]['start'](),this[_0x41efad(0xf9)]=this[_0x41efad(0xa2)][_0x41efad(0xf9)],_0xc2a17c[_0x41efad(0xc8)]=_0x41efad(0xa8)+this[_0x41efad(0xf9)]+_0x41efad(0xb0)+_0x2cc24a,_0xc2a17c[_0x41efad(0xc8)]=_0x41efad(0xec),this[_0x41efad(0xb3)]=await createClaudeSettings(this[_0x41efad(0xf9)],undefined,_0x3ad4d2),_0xc2a17c['text']='✓\x20Settings\x20configured:\x20.claude/settings.local.json';}else _0xc2a17c[_0x41efad(0xc8)]=_0x41efad(0x84);try{_0xc2a17c[_0x41efad(0xc8)]='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x41efad(0x10a)]),_0xc2a17c[_0x41efad(0xc8)]=_0x41efad(0xcf);}catch(_0x29da69){_0xc2a17c['fail'](_0x41efad(0x77));throw _0x29da69;}try{await ensureMcpServer(_0x41efad(0xc4),_0x41efad(0xe3),_0x41efad(0xcd),_0xc2a17c,this['logger']);}catch(_0x3961e8){handleInstallationError(_0x3961e8,_0x41efad(0xc5),_0xc2a17c,this[_0x41efad(0x10a)]);}try{const _0x1e313b=getTdSkillsRepoUrl();_0xd7851=_0x1e313b!==DEFAULT_TD_SKILLS_URL;_0xd7851&&await removeMarketplace(_0x41efad(0xc2),this[_0x41efad(0x10a)]);await ensureMarketplace('td-skills',_0x1e313b,_0xc2a17c,this['logger']),await updateMarketplace(_0x41efad(0xc2),_0xc2a17c,this[_0x41efad(0x10a)]),await ensurePlugin('sql-skills',_0x41efad(0xc2),_0xc2a17c,this[_0x41efad(0x10a)]),await ensurePlugin('workflow-skills',_0x41efad(0xc2),_0xc2a17c,this['logger']),await ensurePlugin(_0x41efad(0x76),_0x41efad(0xc2),_0xc2a17c,this[_0x41efad(0x10a)]);try{const _0x11c429=loadReleaseChannel(),_0x5157f9=await resolveReleaseTag(_0x11c429,_0x41efad(0xca),_0x41efad(0xc2),'tdx-cli');_0x5157f9&&await checkoutReleaseTag(_0x5157f9,_0xc2a17c,this[_0x41efad(0x10a)]);}catch(_0x31ba0a){this['logger']?.['warn']('Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20'+_0x31ba0a);}}catch(_0x56ce66){handleInstallationError(_0x56ce66,_0x41efad(0x10f),_0xc2a17c,this[_0x41efad(0x10a)]);}_0xc2a17c[_0x41efad(0x100)]();}catch(_0x12a71c){_0xc2a17c[_0x41efad(0x103)]('Setup\x20failed');throw _0x12a71c;}const _0x3307d2=await findExecutable(_0x41efad(0xa4));if(!_0x3307d2)throw new SDKError(ErrorCode[_0x41efad(0xe1)],_0x41efad(0xd6),undefined,{'helpText':_0x41efad(0xf3)});const _0x235bdb={...process.env};!_0x142046&&(_0x235bdb[_0x41efad(0xfc)]=_0x41efad(0x74)+this[_0x41efad(0xf9)],_0x235bdb[_0x41efad(0x83)]='tdx-managed-proxy',_0x235bdb[_0x41efad(0xf0)]=_0x41efad(0xcb),_0x235bdb['CLAUDE_CODE_USE_VERTEX']='false');const _0x386360=crossSpawn(_0x3307d2,_0x17c1b2,{'stdio':_0x41efad(0x79),'env':_0x235bdb}),_0xe1c4d9=await new Promise(_0x3c3ab5=>{const _0x4b20f7=_0x41efad;_0x386360['on'](_0x4b20f7(0xf1),_0xdc7e36=>{_0x3c3ab5(_0xdc7e36||0x0);}),_0x386360['on']('error',_0x1c1437=>{const _0x4dce53=_0x4b20f7;console['error'](a12_0x1b6ba2['red'](_0x4dce53(0xba)+_0x1c1437[_0x4dce53(0x106)])),_0x3c3ab5(0x1);});});_0xd7851&&await restoreDefaultTdSkillsMarketplace(this[_0x41efad(0x10a)]);this['passThroughServer']&&(await this[_0x41efad(0xa2)][_0x41efad(0x100)](),console[_0x41efad(0x7a)](a12_0x1b6ba2[_0x41efad(0xa9)](_0x41efad(0xf4))));if(this[_0x41efad(0x10a)]){await this['logger'][_0x41efad(0x114)]();const _0x4538ab=this[_0x41efad(0x10a)]['getLogPath']();console[_0x41efad(0x7a)](a12_0x1b6ba2[_0x41efad(0xa9)](_0x41efad(0x107)+_0x4538ab));}return this[_0x41efad(0xb3)]&&(await restoreClaudeSettings(this[_0x41efad(0xb3)]),console[_0x41efad(0x7a)](a12_0x1b6ba2[_0x41efad(0xa9)](_0x41efad(0xff)))),_0xe1c4d9;}catch(_0x5d2603){_0xd7851&&await restoreDefaultTdSkillsMarketplace(this[_0x41efad(0x10a)]);this[_0x41efad(0xa2)]&&await this[_0x41efad(0xa2)][_0x41efad(0x100)]();this['logger']&&await this[_0x41efad(0x10a)][_0x41efad(0x114)]();this[_0x41efad(0xb3)]&&await restoreClaudeSettings(this[_0x41efad(0xb3)]);throw _0x5d2603;}}}
@@ -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 a13_0x3c11c8=a13_0x3802;(function(_0x174741,_0x7802cc){const _0x486d92=a13_0x3802,_0x536cac=_0x174741();while(!![]){try{const _0x29f979=-parseInt(_0x486d92(0xe3))/0x1*(parseInt(_0x486d92(0xd1))/0x2)+parseInt(_0x486d92(0xd4))/0x3+-parseInt(_0x486d92(0xd3))/0x4+-parseInt(_0x486d92(0xde))/0x5+parseInt(_0x486d92(0xc2))/0x6+parseInt(_0x486d92(0xe4))/0x7+parseInt(_0x486d92(0xcc))/0x8*(parseInt(_0x486d92(0xcf))/0x9);if(_0x29f979===_0x7802cc)break;else _0x536cac['push'](_0x536cac['shift']());}catch(_0x1a30a9){_0x536cac['push'](_0x536cac['shift']());}}}(a13_0xf14b,0x43130));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a13_0xf14b(){const _0x42a1ca=['\x20-\x20','18567ulYftn','model','4YOxyav','\x20|\x20','1358140hvyEZQ','1208877mqmEcH','stdin','profile','close','🧠\x20','💎\x20tdx\x20-\x20Claude','description','options','round','log','456770HBDWzn','cache_read_input_tokens','\x20today\x20/\x20','used_percentage','sessionCredits','115342JLZQiF','904995SaMUhn','todayCredits','execute','Claude','line','\x20month','1174212ZiMCfn','session_id','toFixed','statusline','parse','join','tdx','push','🪙\x20credit:\x20','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','808xYpXjY','context_window'];a13_0xf14b=function(){return _0x42a1ca;};return a13_0xf14b();}function a13_0x3802(_0x3d79b0,_0x585145){_0x3d79b0=_0x3d79b0-0xc1;const _0xf14b92=a13_0xf14b();let _0x3802e4=_0xf14b92[_0x3d79b0];return _0x3802e4;}import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x3bddcb=0x64){return new Promise(_0x40185e=>{const _0x2a1f18=a13_0x3802;let _0x138d13='',_0x2923ef=![];const _0x477695=createInterface({'input':process[_0x2a1f18(0xd5)],'terminal':![]}),_0x24f748=_0x181bf4=>{if(_0x2923ef)return;_0x2923ef=!![],clearTimeout(_0x242377),_0x477695['close'](),_0x40185e(_0x181bf4);},_0x242377=setTimeout(()=>{_0x24f748(null);},_0x3bddcb);_0x477695['on'](_0x2a1f18(0xe8),_0x1c6ee2=>{_0x138d13+=_0x1c6ee2;}),_0x477695['on'](_0x2a1f18(0xd7),()=>{const _0x46fff2=_0x2a1f18;if(_0x2923ef)return;try{const _0x165d8a=JSON[_0x46fff2(0xc6)](_0x138d13);_0x24f748(_0x165d8a);}catch{_0x24f748(null);}});});}function formatCredits(_0x38546a){const _0x3ccbc5=a13_0x3802;return _0x38546a[_0x3ccbc5(0xc4)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a13_0x3c11c8(0xc5);[a13_0x3c11c8(0xda)]=a13_0x3c11c8(0xcb);async[a13_0x3c11c8(0xe6)](_0x513591){const _0x100eb9=a13_0x3c11c8;try{const _0x57ee00=await readStdinJson();if(!_0x57ee00?.[_0x100eb9(0xc3)])return console[_0x100eb9(0xdd)]('💎\x20tdx\x20-\x20Claude'),0x0;const _0x33e6b=_0x57ee00[_0x100eb9(0xc3)],_0x5da3f8=_0x57ee00[_0x100eb9(0xd0)]?.['id']||'',_0xa648ea=_0x57ee00[_0x100eb9(0xd6)]||_0x513591[_0x100eb9(0xdb)][_0x100eb9(0xd6)],_0x4ecf11=await getUsageStats(_0x33e6b,_0xa648ea),_0x189b7a=[],_0x39fb24=readCachedAccountInfo(_0xa648ea),_0x1ba6ad=_0x39fb24?'tdx\x20'+_0x39fb24['site']+':'+_0x39fb24['accountId']:_0x100eb9(0xc8),_0x5d964b=_0x5da3f8?getModelDisplayName(_0x5da3f8):_0x100eb9(0xe7);_0x189b7a[_0x100eb9(0xc9)]('💎\x20'+_0x1ba6ad+_0x100eb9(0xce)+_0x5d964b);const _0x222793=formatCredits(_0x4ecf11[_0x100eb9(0xe2)]),_0x2d5607=formatCredits(_0x4ecf11[_0x100eb9(0xe5)]),_0x80d08d=formatCredits(_0x4ecf11['monthCredits']);_0x189b7a[_0x100eb9(0xc9)](_0x100eb9(0xca)+_0x222793+'\x20session\x20/\x20'+_0x2d5607+_0x100eb9(0xe0)+_0x80d08d+_0x100eb9(0xc1));const _0x547279=_0x57ee00[_0x100eb9(0xcd)],_0x35aec2=_0x547279?.['current_usage'];if(_0x35aec2&&_0x547279?.[_0x100eb9(0xe1)]!=null){const _0x2745a9=_0x35aec2['input_tokens']+_0x35aec2['cache_creation_input_tokens']+_0x35aec2[_0x100eb9(0xdf)],_0x47178d=formatTokenCount(_0x2745a9),_0x2418b2=Math[_0x100eb9(0xdc)](_0x547279[_0x100eb9(0xe1)]);_0x189b7a['push'](_0x100eb9(0xd8)+_0x47178d+'\x20('+_0x2418b2+'%)');}return console['log'](_0x189b7a[_0x100eb9(0xc7)](_0x100eb9(0xd2))),0x0;}catch{return console[_0x100eb9(0xdd)](_0x100eb9(0xd9)),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 a14_0x4cf854=a14_0x3435;(function(_0x32e2a6,_0x180c78){const _0x5e5f4e=a14_0x3435,_0x3ceabc=_0x32e2a6();while(!![]){try{const _0x2e2962=parseInt(_0x5e5f4e(0x1e3))/0x1*(-parseInt(_0x5e5f4e(0x1c7))/0x2)+-parseInt(_0x5e5f4e(0x1b5))/0x3*(-parseInt(_0x5e5f4e(0x1af))/0x4)+-parseInt(_0x5e5f4e(0x1cf))/0x5+-parseInt(_0x5e5f4e(0x1e5))/0x6+parseInt(_0x5e5f4e(0x1c3))/0x7*(parseInt(_0x5e5f4e(0x1b1))/0x8)+-parseInt(_0x5e5f4e(0x1bf))/0x9+parseInt(_0x5e5f4e(0x1c2))/0xa;if(_0x2e2962===_0x180c78)break;else _0x3ceabc['push'](_0x3ceabc['shift']());}catch(_0x47857c){_0x3ceabc['push'](_0x3ceabc['shift']());}}}(a14_0x3a7a,0xe5527));function a14_0x3435(_0x3cfefd,_0x26cba8){_0x3cfefd=_0x3cfefd-0x1a4;const _0x3a7a4e=a14_0x3a7a();let _0x34359e=_0x3a7a4e[_0x3cfefd];return _0x34359e;}function a14_0x3a7a(){const _0x23c983=['Today','\x20\x20Today:\x20\x20\x20','31319690FBAQiR','7zfdzVr','name','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','\x20\x20Total:\x20\x20\x20','196kcTUqJ','error','\x20credits','2-digit','profile','round','today\x20','toFixed','7990255yopeaj','entryCount','todayCredits','length','outputStructured','bold','padStart','profileCount','yesterday','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','json','never','Credits','Total','cyan','Source','Profile','red','source','en-US','18974xdwPwL','dim','5711568CYIwIn','padEnd','numeric','format','Usage\x20by\x20Source','toLocaleDateString','Month','credits','toLocaleTimeString','outputTable','repeat','(default)','1377432ryddUN','\x20days\x20ago','12820176DKtuWd','\x20\x20Month:\x20\x20\x20','usage','monthCredits','12kSdVpe','short','log','message','all','totalCredits','lastUsedAt','en-CA','map','default','6868701tASNiX'];a14_0x3a7a=function(){return _0x23c983;};return a14_0x3a7a();}import a14_0x21480a 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(_0x489a24){const _0x4ef010=a14_0x3435;return _0x489a24[_0x4ef010(0x1ce)](0x2);}function formatLastUsed(_0x4ed4b4){const _0x957a63=a14_0x3435;if(!_0x4ed4b4)return _0x957a63(0x1da);const _0x31f5e3=new Date(_0x4ed4b4),_0x2811fc=new Date(),_0x39fcad=_0x31f5e3[_0x957a63(0x1a8)](_0x957a63(0x1bc)),_0x3fcb16=_0x2811fc['toLocaleDateString'](_0x957a63(0x1bc));if(_0x39fcad===_0x3fcb16)return _0x957a63(0x1cd)+_0x31f5e3[_0x957a63(0x1ab)](_0x957a63(0x1e2),{'hour':_0x957a63(0x1ca),'minute':'2-digit'});const _0x47cd24=new Date(_0x39fcad),_0x2bd99f=new Date(_0x3fcb16),_0x4fb62d=Math[_0x957a63(0x1cc)]((_0x2bd99f['getTime']()-_0x47cd24['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x4fb62d===0x1)return _0x957a63(0x1d7);else return _0x4fb62d>0x1&&_0x4fb62d<0x7?_0x4fb62d+_0x957a63(0x1b0):_0x31f5e3['toLocaleDateString'](_0x957a63(0x1e2),{'month':_0x957a63(0x1b6),'day':_0x957a63(0x1a5)});}export class ClaudeUsageCommand extends BaseCommand{[a14_0x4cf854(0x1c4)]=a14_0x4cf854(0x1b3);['description']=a14_0x4cf854(0x1d8);async['execute'](_0x2ce5d1){const _0x133609=a14_0x4cf854,{options:_0x4542fb}=_0x2ce5d1,_0x52e301=_0x4542fb[_0x133609(0x1a6)]===_0x133609(0x1d9)||_0x4542fb['format']==='jsonl'||_0x4542fb[_0x133609(0x1d9)];try{const [_0x38a942,_0x3795f1,_0x3b0304]=await Promise[_0x133609(0x1b9)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x52e301?await this[_0x133609(0x1d3)](_0x38a942,_0x3795f1,_0x3b0304,_0x4542fb):this['outputTable'](_0x38a942,_0x3795f1,_0x3b0304),0x0;}catch(_0x5757d5){const _0x19cafa=_0x5757d5 instanceof Error?_0x5757d5[_0x133609(0x1b8)]:'Unknown\x20error';return console[_0x133609(0x1c8)](a14_0x21480a[_0x133609(0x1e0)]('Error:\x20'+_0x19cafa)),0x1;}}async['outputStructured'](_0x560018,_0x476e03,_0x2ae673,_0x466e82){const _0x58a057=a14_0x4cf854,_0x14b2a5={'summary':{'todayCredits':_0x2ae673['todayCredits'],'monthCredits':_0x2ae673[_0x58a057(0x1b4)],'totalCredits':_0x2ae673[_0x58a057(0x1ba)],'profileCount':_0x2ae673[_0x58a057(0x1d6)]},'profiles':_0x560018[_0x58a057(0x1bd)](_0x5f0380=>({'profile':_0x5f0380[_0x58a057(0x1cb)],'credits':_0x5f0380[_0x58a057(0x1aa)],'requests':_0x5f0380['entryCount'],'lastUsedAt':_0x5f0380[_0x58a057(0x1bb)]})),'sources':_0x476e03[_0x58a057(0x1bd)](_0xddc507=>({'source':_0xddc507[_0x58a057(0x1e1)],'credits':_0xddc507[_0x58a057(0x1aa)],'todayCredits':_0xddc507[_0x58a057(0x1d1)],'monthCredits':_0xddc507['monthCredits'],'requests':_0xddc507[_0x58a057(0x1d0)]}))};await handleSDKOutput([_0x14b2a5],_0x466e82);}[a14_0x4cf854(0x1ac)](_0x6e50ed,_0x3cd701,_0x57cb77){const _0x5b6a96=a14_0x4cf854;console[_0x5b6a96(0x1b7)](a14_0x21480a[_0x5b6a96(0x1d4)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console[_0x5b6a96(0x1b7)](a14_0x21480a[_0x5b6a96(0x1e4)]('─'[_0x5b6a96(0x1ad)](0x32))),console[_0x5b6a96(0x1b7)](_0x5b6a96(0x1c1)+a14_0x21480a[_0x5b6a96(0x1dd)](formatCredits(_0x57cb77[_0x5b6a96(0x1d1)]))+_0x5b6a96(0x1c9)),console['log'](_0x5b6a96(0x1b2)+a14_0x21480a[_0x5b6a96(0x1dd)](formatCredits(_0x57cb77['monthCredits']))+_0x5b6a96(0x1c9)),console[_0x5b6a96(0x1b7)](_0x5b6a96(0x1c6)+a14_0x21480a['cyan'](formatCredits(_0x57cb77[_0x5b6a96(0x1ba)]))+_0x5b6a96(0x1c9)),console['log']();if(_0x3cd701[_0x5b6a96(0x1d2)]>0x0){console['log'](a14_0x21480a['bold'](_0x5b6a96(0x1a7))),console[_0x5b6a96(0x1b7)](a14_0x21480a['dim']('─'[_0x5b6a96(0x1ad)](0x3c)));const _0x5bcec6=0xc,_0xddd8a=0xa,_0x3be525=0xa,_0x562ca7=0xa;console[_0x5b6a96(0x1b7)]('\x20\x20'+_0x5b6a96(0x1de)['padEnd'](_0x5bcec6)+'\x20\x20'+_0x5b6a96(0x1dc)[_0x5b6a96(0x1d5)](_0xddd8a)+'\x20\x20'+_0x5b6a96(0x1c0)[_0x5b6a96(0x1d5)](_0x3be525)+'\x20\x20'+_0x5b6a96(0x1a9)['padStart'](_0x562ca7));for(const _0x4e0502 of _0x3cd701){console[_0x5b6a96(0x1b7)]('\x20\x20'+_0x4e0502[_0x5b6a96(0x1e1)][_0x5b6a96(0x1a4)](_0x5bcec6)+'\x20\x20'+a14_0x21480a[_0x5b6a96(0x1dd)](formatCredits(_0x4e0502[_0x5b6a96(0x1aa)])[_0x5b6a96(0x1d5)](_0xddd8a))+'\x20\x20'+formatCredits(_0x4e0502['todayCredits'])[_0x5b6a96(0x1d5)](_0x3be525)+'\x20\x20'+formatCredits(_0x4e0502[_0x5b6a96(0x1b4)])[_0x5b6a96(0x1d5)](_0x562ca7));}console['log']();}if(_0x6e50ed[_0x5b6a96(0x1d2)]===0x0){console[_0x5b6a96(0x1b7)](a14_0x21480a[_0x5b6a96(0x1e4)](_0x5b6a96(0x1c5))),console[_0x5b6a96(0x1b7)](a14_0x21480a[_0x5b6a96(0x1e4)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x5b6a96(0x1b7)](a14_0x21480a[_0x5b6a96(0x1d4)]('Usage\x20by\x20Profile')),console[_0x5b6a96(0x1b7)](a14_0x21480a[_0x5b6a96(0x1e4)]('─'['repeat'](0x3c)));const _0x47b9cd=Math['max'](0xc,..._0x6e50ed['map'](_0x4643e1=>_0x4643e1[_0x5b6a96(0x1cb)]===_0x5b6a96(0x1be)?_0x5b6a96(0x1ae)['length']:_0x4643e1['profile'][_0x5b6a96(0x1d2)])),_0x5481f9=0xa,_0x304f10=0xa;console[_0x5b6a96(0x1b7)]('\x20\x20'+_0x5b6a96(0x1df)['padEnd'](_0x47b9cd)+'\x20\x20'+_0x5b6a96(0x1db)[_0x5b6a96(0x1d5)](_0x5481f9)+'\x20\x20'+'Requests'['padStart'](_0x304f10)+'\x20\x20'+'Last\x20Used');for(const _0x4897fa of _0x6e50ed){const _0x84ea9a=_0x4897fa[_0x5b6a96(0x1cb)]===_0x5b6a96(0x1be)?_0x5b6a96(0x1ae):_0x4897fa['profile'],_0x4983b2=_0x84ea9a[_0x5b6a96(0x1a4)](_0x47b9cd),_0x116a25=_0x4897fa['profile']===_0x5b6a96(0x1be)?a14_0x21480a[_0x5b6a96(0x1e4)](_0x4983b2):_0x4983b2;console[_0x5b6a96(0x1b7)]('\x20\x20'+_0x116a25+'\x20\x20'+a14_0x21480a[_0x5b6a96(0x1dd)](formatCredits(_0x4897fa[_0x5b6a96(0x1aa)])[_0x5b6a96(0x1d5)](_0x5481f9))+'\x20\x20'+String(_0x4897fa[_0x5b6a96(0x1d0)])[_0x5b6a96(0x1d5)](_0x304f10)+'\x20\x20'+a14_0x21480a[_0x5b6a96(0x1e4)](formatLastUsed(_0x4897fa[_0x5b6a96(0x1bb)])));}console['log'](),console[_0x5b6a96(0x1b7)](a14_0x21480a['dim']('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x5b6a96(0x1b7)]();}}
@@ -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 a15_0x55dcf6=a15_0x1b6f;function a15_0x3965(){const _0x2ab7a7=['get','detail','3352yEhFsR','has','error','run','category','value','stack','3128991mCKhGH','from','cyan','3416916tTnkhW','tdx\x20auth','\x20--profile\x20','3354995QaQVHI','40782fSftyS','execute','1196868WHuDZS','set','\x0aStack\x20trace:\x0a','options','Authentication\x20failed','message','dim','red','limit','values','test','validate','register','Reason:\x20','Invalid\x20limit\x20value:\x20','debug','validateGlobalOptions','yellow','416014rXpiPx','status','Authentication\x20error\x20stack\x20trace:','Error:\x20','3362970zWUslq','problemDetails','number','To\x20set\x20up\x20authentication:','To\x20check\x20your\x20current\x20auth\x20status:','commands'];a15_0x3965=function(){return _0x2ab7a7;};return a15_0x3965();}(function(_0xed8644,_0x4dc83a){const _0x483fff=a15_0x1b6f,_0x4bdcdd=_0xed8644();while(!![]){try{const _0x18c67b=parseInt(_0x483fff(0x1af))/0x1+parseInt(_0x483fff(0x1c1))/0x2+parseInt(_0x483fff(0x1a6))/0x3+parseInt(_0x483fff(0x1a9))/0x4+parseInt(_0x483fff(0x1ac))/0x5+-parseInt(_0x483fff(0x1c5))/0x6+-parseInt(_0x483fff(0x1ad))/0x7*(parseInt(_0x483fff(0x1cd))/0x8);if(_0x18c67b===_0x4dc83a)break;else _0x4bdcdd['push'](_0x4bdcdd['shift']());}catch(_0x1816f2){_0x4bdcdd['push'](_0x4bdcdd['shift']());}}}(a15_0x3965,0xed2f7));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';function a15_0x1b6f(_0x3f2095,_0x193147){_0x3f2095=_0x3f2095-0x1a1;const _0x396529=a15_0x3965();let _0x1b6ffe=_0x396529[_0x3f2095];return _0x1b6ffe;}import a15_0x47df6e from'chalk';export function printAuthError(_0x411376,_0x5156c0=![],_0x144bfa){const _0xabd165=a15_0x1b6f,_0x5b476f=_0x411376[_0xabd165(0x1c6)]?.[_0xabd165(0x1cc)]||_0x411376[_0xabd165(0x1b4)];console[_0xabd165(0x1a1)](a15_0x47df6e['red'](_0xabd165(0x1b3))),console['error'](a15_0x47df6e['red'](_0xabd165(0x1bc)+_0x5b476f));if(_0x5156c0){const _0x15ee20=_0x144bfa?_0xabd165(0x1ab)+_0x144bfa:'';console[_0xabd165(0x1a1)]('\x0a'+a15_0x47df6e[_0xabd165(0x1b5)](_0xabd165(0x1c8))),console['error']('\x20\x20'+a15_0x47df6e[_0xabd165(0x1a8)]('tdx\x20auth\x20setup'+_0x15ee20)+'\x0a'),console[_0xabd165(0x1a1)](''+a15_0x47df6e[_0xabd165(0x1b5)](_0xabd165(0x1c9))),console['error']('\x20\x20'+a15_0x47df6e[_0xabd165(0x1a8)](_0xabd165(0x1aa)+_0x15ee20));}}export class BaseCommand{[a15_0x55dcf6(0x1bf)](_0x18ff8c){const _0x56e298=a15_0x55dcf6,{options:_0x413184}=_0x18ff8c,_0x529ed4=_0x413184[_0x56e298(0x1b7)];if(_0x529ed4!==undefined){const _0x6dce8e=typeof _0x529ed4===_0x56e298(0x1c7)?_0x529ed4:parseInt(_0x529ed4,0xa);if(isNaN(_0x6dce8e))return _0x56e298(0x1bd)+_0x529ed4+'.\x20Must\x20be\x20a\x20number.';const _0x1b65ba=validateLimitOption(_0x6dce8e);if(!_0x1b65ba['isValid'])return _0x1b65ba[_0x56e298(0x1a1)];_0x18ff8c[_0x56e298(0x1b2)]['limit']=_0x1b65ba[_0x56e298(0x1a4)];}return undefined;}['validate'](_0x3750c3){return undefined;}async[a15_0x55dcf6(0x1a2)](_0x61b743){const _0x19beea=a15_0x55dcf6;try{const _0x1c664e=this[_0x19beea(0x1bf)](_0x61b743);if(_0x1c664e)return console[_0x19beea(0x1a1)](_0x19beea(0x1c4)+_0x1c664e),0x1;const _0x340dd7=this[_0x19beea(0x1ba)](_0x61b743);if(_0x340dd7){const _0x4c1c84=/^\s*(Usage|Note|Warning|Error):/i[_0x19beea(0x1b9)](_0x340dd7);return _0x4c1c84?console['error'](_0x340dd7):console[_0x19beea(0x1a1)](_0x19beea(0x1c4)+_0x340dd7),0x1;}const _0x1c4a04=await this[_0x19beea(0x1ae)](_0x61b743);return _0x1c4a04??0x0;}catch(_0x1b53f9){if(_0x1b53f9 instanceof Error){if(_0x1b53f9 instanceof HTTPClientError&&_0x1b53f9[_0x19beea(0x1c2)]===0x191){const _0x1af16a=_0x61b743[_0x19beea(0x1b2)]['profile'];printAuthError(_0x1b53f9,!![],_0x1af16a);if(_0x1b53f9['stack']){const _0xe858ce=Logger['of']('command');_0xe858ce[_0x19beea(0x1be)](_0x19beea(0x1c3)),_0xe858ce[_0x19beea(0x1be)](_0x1b53f9[_0x19beea(0x1a5)]);}return 0x1;}console['error'](a15_0x47df6e[_0x19beea(0x1b6)](_0x19beea(0x1c4)+_0x1b53f9[_0x19beea(0x1b4)]));_0x1b53f9 instanceof SDKError&&_0x1b53f9['helpText']&&console['error'](a15_0x47df6e[_0x19beea(0x1c0)](_0x1b53f9['helpText']));const _0x4bfaf6=_0x1b53f9 instanceof SDKError&&_0x1b53f9[_0x19beea(0x1a3)]===ErrorCategory['USER_ERROR'];_0x1b53f9[_0x19beea(0x1a5)]&&!_0x4bfaf6&&console['error'](_0x19beea(0x1b1)+_0x1b53f9[_0x19beea(0x1a5)]);}else console[_0x19beea(0x1a1)](_0x19beea(0x1c4)+String(_0x1b53f9));return 0x1;}}}export class CommandRegistry{['commands']=new Map();[a15_0x55dcf6(0x1bb)](_0x2adbe0){const _0x5238cc=a15_0x55dcf6;if(this[_0x5238cc(0x1ca)]['has'](_0x2adbe0['name']))throw new Error('Command\x20\x27'+_0x2adbe0['name']+'\x27\x20is\x20already\x20registered');this[_0x5238cc(0x1ca)][_0x5238cc(0x1b0)](_0x2adbe0['name'],_0x2adbe0);}[a15_0x55dcf6(0x1cb)](_0x3a516d){const _0x2829c7=a15_0x55dcf6;return this[_0x2829c7(0x1ca)]['get'](_0x3a516d);}['getAll'](){const _0x493acd=a15_0x55dcf6;return Array[_0x493acd(0x1a7)](this[_0x493acd(0x1ca)][_0x493acd(0x1b8)]());}[a15_0x55dcf6(0x1ce)](_0x2b390e){const _0x1b0d74=a15_0x55dcf6;return this[_0x1b0d74(0x1ca)][_0x1b0d74(0x1ce)](_0x2b390e);}}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 a16_0x35b414=a16_0x2d63;(function(_0x376c64,_0x2226af){const _0x1d7b67=a16_0x2d63,_0x1406f6=_0x376c64();while(!![]){try{const _0x4afc51=-parseInt(_0x1d7b67(0x82))/0x1+-parseInt(_0x1d7b67(0x88))/0x2+parseInt(_0x1d7b67(0xa5))/0x3*(-parseInt(_0x1d7b67(0x90))/0x4)+parseInt(_0x1d7b67(0x6c))/0x5+parseInt(_0x1d7b67(0xc0))/0x6+-parseInt(_0x1d7b67(0xb6))/0x7+parseInt(_0x1d7b67(0xaa))/0x8;if(_0x4afc51===_0x2226af)break;else _0x1406f6['push'](_0x1406f6['shift']());}catch(_0x4a105a){_0x1406f6['push'](_0x1406f6['shift']());}}}(a16_0x5afa,0xedfc6));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a16_0x2d63(_0xa2e1de,_0x5c5393){_0xa2e1de=_0xa2e1de-0x67;const _0x5afa52=a16_0x5afa();let _0x2d63ca=_0x5afa52[_0xa2e1de];return _0x2d63ca;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a16_0x4948b8 from'chalk';function normalizeSchemaForDisplay(_0x87f8e7){const _0x2f058d=a16_0x2d63,_0x31e246=_0x87f8e7[_0x2f058d(0x67)]||[],_0x14be22=_0x31e246[_0x2f058d(0xcb)](_0x5a0b97=>_0x5a0b97[_0x2f058d(0x6b)]==='legacy_settings'&&_0x5a0b97[_0x2f058d(0xa4)]===_0x2f058d(0x86)&&_0x5a0b97[_0x2f058d(0x67)]);if(_0x14be22?.['properties']){const _0x1fef3b=_0x31e246[_0x2f058d(0xc6)](_0x36c4ae=>_0x36c4ae[_0x2f058d(0x6b)]!==_0x2f058d(0xbd)&&_0x36c4ae['name']!==_0x2f058d(0x9f));return[..._0x1fef3b,..._0x14be22[_0x2f058d(0x67)]];}return _0x31e246[_0x2f058d(0xc6)](_0x34d7a8=>_0x34d7a8[_0x2f058d(0x6b)]!==_0x2f058d(0xbd));}function printSchemaFields(_0x525548,_0x45ae7c){const _0x5e8d18=a16_0x2d63,_0xf1a169='\x20\x20'['repeat'](_0x45ae7c+0x1),_0x51bdba='\x20\x20'[_0x5e8d18(0xb7)](_0x45ae7c+0x2);for(const _0x551212 of _0x525548){if(!_0x551212['name'])continue;const _0x674caf=_0x551212[_0x5e8d18(0xa4)]===_0x5e8d18(0x86)&&_0x551212['properties']&&_0x551212[_0x5e8d18(0x67)][_0x5e8d18(0x92)]>0x0&&_0x551212[_0x5e8d18(0x6b)]!==_0x5e8d18(0x9f);let _0x5ec115=''+_0xf1a169+a16_0x4948b8[_0x5e8d18(0x9e)](_0x551212[_0x5e8d18(0x6b)]);_0x551212['title']&&(_0x5ec115+=':\x20'+_0x551212[_0x5e8d18(0x70)]);if(_0x551212[_0x5e8d18(0xb1)])_0x5ec115+=a16_0x4948b8[_0x5e8d18(0xad)]('\x20['+_0x551212[_0x5e8d18(0xb1)]+']');else _0x674caf&&(_0x5ec115+=a16_0x4948b8[_0x5e8d18(0xad)](_0x5e8d18(0x80)));console[_0x5e8d18(0x72)](_0x5ec115);_0x551212[_0x5e8d18(0x9b)]&&console[_0x5e8d18(0x72)](''+_0x51bdba+a16_0x4948b8[_0x5e8d18(0xad)](_0x551212[_0x5e8d18(0x9b)]));if(_0x551212[_0x5e8d18(0xb0)]){const _0x4480a9=_0x551212[_0x5e8d18(0xb0)][_0x5e8d18(0x91)](_0x2e6d40=>typeof _0x2e6d40==='object'&&_0x5e8d18(0x79)in _0x2e6d40?_0x2e6d40[_0x5e8d18(0x79)]:_0x2e6d40)['join'](',\x20');console[_0x5e8d18(0x72)](_0x51bdba+_0x5e8d18(0xba)+a16_0x4948b8[_0x5e8d18(0xc8)](_0x4480a9));}_0x551212[_0x5e8d18(0xc7)]!==undefined&&console[_0x5e8d18(0x72)](_0x51bdba+'Default:\x20'+a16_0x4948b8[_0x5e8d18(0xca)](String(_0x551212[_0x5e8d18(0xc7)])));if(_0x551212[_0x5e8d18(0x7d)]!==undefined||_0x551212['maximum']!==undefined){const _0x17aa2f=_0x551212[_0x5e8d18(0x7d)]!==undefined&&_0x551212[_0x5e8d18(0x6e)]!==undefined?_0x551212[_0x5e8d18(0x7d)]+_0x5e8d18(0x98)+_0x551212['maximum']:_0x551212[_0x5e8d18(0x7d)]!==undefined?_0x5e8d18(0xc9)+_0x551212[_0x5e8d18(0x7d)]:'<=\x20'+_0x551212[_0x5e8d18(0x6e)];console[_0x5e8d18(0x72)](_0x51bdba+_0x5e8d18(0x7b)+a16_0x4948b8[_0x5e8d18(0xca)](_0x17aa2f));}if(_0x551212[_0x5e8d18(0xbb)]){const _0xec73ca=Object[_0x5e8d18(0x71)](_0x551212[_0x5e8d18(0xbb)])[_0x5e8d18(0x91)](([_0x2ba4c7,_0x4f2ff0])=>_0x2ba4c7+'='+JSON['stringify'](_0x4f2ff0))[_0x5e8d18(0xbf)](',\x20');console[_0x5e8d18(0x72)](''+_0x51bdba+a16_0x4948b8[_0x5e8d18(0xad)]('Show\x20when:\x20'+_0xec73ca));}_0x674caf&&_0x551212['properties']&&printSchemaFields(_0x551212[_0x5e8d18(0x67)],_0x45ae7c+0x1);}}export class ConnectionListCommand extends BaseCommand{['name']='connection:list';['description']='List\x20all\x20result\x20output\x20connections';async[a16_0x35b414(0xb3)](_0x2c0df3){const _0x2ffa0e=a16_0x35b414,{options:_0x26d0b7,tdx:_0x5e9186}=_0x2c0df3;_0x26d0b7[_0x2ffa0e(0xa8)]&&console['error'](_0x2ffa0e(0x81)+_0x26d0b7['site']);const _0x1c4294=resolveLimit(_0x26d0b7[_0x2ffa0e(0x85)],DEFAULT_LISTING_LIMIT),_0x340760=await withSpinner(_0x2ffa0e(0x73),()=>_0x5e9186[_0x2ffa0e(0x95)][_0x2ffa0e(0xbe)](),{'verbose':_0x26d0b7[_0x2ffa0e(0xa8)]}),_0x19ff81=_0x340760[_0x2ffa0e(0x74)];console[_0x2ffa0e(0xb9)]('✔\x20Found\x20'+_0x19ff81[_0x2ffa0e(0x92)]+'\x20connection'+(_0x19ff81['length']!==0x1?'s':''));if(isStructuredFormat(_0x26d0b7)){const _0x45c3ce=_0x19ff81['slice'](0x0,_0x1c4294);await handleSDKOutput(_0x45c3ce,{..._0x26d0b7,'limit':_0x1c4294});}else{const _0x2b3d4e=_0x19ff81[_0x2ffa0e(0x92)]>0x0?Math['max'](..._0x19ff81[_0x2ffa0e(0x91)](_0x706160=>_0x706160[_0x2ffa0e(0xa4)][_0x2ffa0e(0x92)])):0x0,_0x134c0c=[];for(const _0x14ea48 of _0x19ff81){const _0x5469bf=a16_0x4948b8['cyan'](_0x14ea48[_0x2ffa0e(0xa4)][_0x2ffa0e(0xc3)](_0x2b3d4e)),_0x327550=_0x14ea48[_0x2ffa0e(0x8f)]?.[_0x2ffa0e(0x6b)]?_0x2ffa0e(0x98)+a16_0x4948b8[_0x2ffa0e(0xad)](_0x14ea48['owner']['name']):'';_0x134c0c[_0x2ffa0e(0x7e)](_0x5469bf+'\x20\x20'+_0x14ea48[_0x2ffa0e(0x6b)]+_0x327550);}await writeOutput(_0x134c0c[_0x2ffa0e(0xbf)]('\x0a'),_0x26d0b7[_0x2ffa0e(0x97)],_0x2ffa0e(0xae));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a16_0x35b414(0x6b)]='connection:show';[a16_0x35b414(0x9b)]=a16_0x35b414(0x6f);['validate'](_0x3a52ae){const {args:_0x4c72b8}=_0x3a52ae;if(!_0x4c72b8[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[a16_0x35b414(0xb3)](_0x1eca40){const _0x33e12c=a16_0x35b414,{options:_0x4dfebb,args:_0x2ca3a9,tdx:_0x7d6222}=_0x1eca40,_0x252ab3=_0x2ca3a9[0x0];_0x4dfebb[_0x33e12c(0xa8)]&&(console[_0x33e12c(0xb9)](_0x33e12c(0x81)+_0x4dfebb[_0x33e12c(0xab)]),console[_0x33e12c(0xb9)](_0x33e12c(0xaf)+_0x252ab3));const _0x5dd4fa=await withSpinner(_0x33e12c(0x7f)+_0x252ab3+_0x33e12c(0xc2),()=>_0x7d6222['connection']['resolve'](_0x252ab3),{'verbose':_0x4dfebb[_0x33e12c(0xa8)]}),_0x481638=_0x5dd4fa[_0x33e12c(0x74)];return console[_0x33e12c(0xb9)](_0x33e12c(0x76)+_0x481638[_0x33e12c(0x6b)]),await handleSingleObjectOutput(_0x481638,_0x4dfebb),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a16_0x35b414(0xa7);[a16_0x35b414(0x9b)]=a16_0x35b414(0xa0);[a16_0x35b414(0xc4)](_0xaeb05b){const _0x4cfbfa=a16_0x35b414,{args:_0x3572ef}=_0xaeb05b;if(!_0x3572ef[0x0])return _0x4cfbfa(0x75);return undefined;}async['execute'](_0x464888){const _0x15284a=a16_0x35b414,{options:_0x3027b0,args:_0x2ce2d2,tdx:_0x489fb6}=_0x464888,_0x219f4b=_0x2ce2d2[0x0];_0x3027b0[_0x15284a(0xa8)]&&(console[_0x15284a(0xb9)](_0x15284a(0x81)+_0x3027b0[_0x15284a(0xab)]),console['error']('Resolving\x20connector\x20type\x20or\x20name:\x20'+_0x219f4b));let _0x3d8b4e=_0x219f4b,_0x2502e8;try{const _0x5b85a7=await _0x489fb6[_0x15284a(0x95)][_0x15284a(0x94)](_0x219f4b);_0x5b85a7&&(_0x3d8b4e=_0x5b85a7[_0x15284a(0xa4)],_0x2502e8=_0x5b85a7[_0x15284a(0x6b)],_0x3027b0[_0x15284a(0xa8)]&&console[_0x15284a(0xb9)](_0x15284a(0x84)+_0x219f4b+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x3d8b4e));}catch{_0x3027b0['verbose']&&console[_0x15284a(0xb9)]('Treating\x20\x27'+_0x219f4b+_0x15284a(0x89));}const _0x358c0f=await withSpinner(_0x15284a(0x8c)+_0x3d8b4e+_0x15284a(0xc2),()=>_0x489fb6['connection'][_0x15284a(0x8d)](_0x3d8b4e),{'verbose':_0x3027b0['verbose']}),_0x32befe=_0x358c0f[_0x15284a(0x74)];_0x2502e8?console[_0x15284a(0xb9)](_0x15284a(0x69)+_0x2502e8+_0x15284a(0xa9)+_0x3d8b4e+')'):console[_0x15284a(0xb9)](_0x15284a(0xc1)+_0x3d8b4e);if(isStructuredFormat(_0x3027b0))await handleSingleObjectOutput(_0x32befe,_0x3027b0);else{const _0x2926a9=normalizeSchemaForDisplay(_0x32befe);_0x2502e8?(console['log']('\x0aConnection:\x20'+a16_0x4948b8[_0x15284a(0xa2)](_0x2502e8)),console[_0x15284a(0x72)](_0x15284a(0xbc)+a16_0x4948b8[_0x15284a(0xad)](_0x3d8b4e))):console[_0x15284a(0x72)](_0x15284a(0xac)+a16_0x4948b8[_0x15284a(0xa2)](_0x3d8b4e)),_0x2926a9[_0x15284a(0x92)]>0x0?(console['log'](a16_0x4948b8[_0x15284a(0x7c)](_0x15284a(0x96))),printSchemaFields(_0x2926a9,0x0)):console[_0x15284a(0x72)](a16_0x4948b8['dim'](_0x15284a(0xa6)));}return 0x0;}}function a16_0x5afa(){const _0x53bf64=['Options:\x20','criteria','Type:\x20','legacy','list','join','9447126LeFMZP','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','\x27...','padStart','validate','Fetching\x20settings\x20for\x20\x27','filter','default_value','yellow','>=\x20','blue','find','options','Show\x20when:\x20','properties','listTypes','✔\x20Found\x20schema\x20for\x20connection\x20\x27','\x20\x20\x20\x20Default:\x20','name','3560350uUaVQq','hint','maximum','Show\x20connection\x20details','title','entries','log','Listing\x20connections...','data','Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.','✔\x20Found\x20connection:\x20','\x0aNo\x20credential\x20settings\x20defined','connection:settings','value','stringify','Range:\x20','bold','minimum','push','Fetching\x20connection\x20\x27','\x20[record]','Site:\x20','1412032FVlwry','Name:\x20','✔\x20Resolved\x20\x27','limit','record','\x20\x20\x20\x20Options:\x20','2329236jrArzv','\x27\x20as\x20connector\x20type','label','\x0aCredential\x20settings:','Fetching\x20schema\x20for\x20\x27','getOutputSchema','max','owner','4ErKRQK','map','length','List\x20available\x20connector\x20types','findByName','connection','\x0aAvailable\x20fields:','output','\x20-\x20','✔\x20Found\x20','settings','description','\x20\x20\x20\x20','Fetching\x20settings\x20for\x20connector\x20type:\x20','green','legacy_settings','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','localeCompare','cyan','sort','type','5541990xvGVAR','\x0aNo\x20fields\x20defined\x20in\x20schema','connection:schema','verbose','\x27\x20(type:\x20','24913192ppnstg','site','\x0aConnector:\x20','dim','table','Looking\x20up\x20connection:\x20','enumeration','input','connection:types','execute','No\x20available\x20fields\x20for\x20this\x20connector','\x20connector\x20type','13790bXhpex','repeat','credential','error'];a16_0x5afa=function(){return _0x53bf64;};return a16_0x5afa();}export class ConnectionTypesCommand extends BaseCommand{[a16_0x35b414(0x6b)]=a16_0x35b414(0xb2);[a16_0x35b414(0x9b)]=a16_0x35b414(0x93);async[a16_0x35b414(0xb3)](_0x16415a){const _0x5c1723=a16_0x35b414,{options:_0x297645,tdx:_0x5dad0d}=_0x16415a;_0x297645[_0x5c1723(0xa8)]&&console[_0x5c1723(0xb9)](_0x5c1723(0x81)+_0x297645[_0x5c1723(0xab)]);const _0x4c4df6=await withSpinner('Listing\x20connector\x20types...',()=>_0x5dad0d[_0x5c1723(0x95)][_0x5c1723(0x68)](),{'verbose':_0x297645[_0x5c1723(0xa8)]}),_0x528e7b=_0x4c4df6['data'][_0x5c1723(0xa3)]((_0x19a2d4,_0x3779b9)=>_0x19a2d4[_0x5c1723(0xa4)][_0x5c1723(0xa1)](_0x3779b9[_0x5c1723(0xa4)]));console[_0x5c1723(0xb9)](_0x5c1723(0x99)+_0x528e7b[_0x5c1723(0x92)]+_0x5c1723(0xb5)+(_0x528e7b[_0x5c1723(0x92)]!==0x1?'s':''));if(isStructuredFormat(_0x297645))await handleSDKOutput(_0x528e7b,_0x297645);else{const _0x2913ad=_0x528e7b[_0x5c1723(0x92)]>0x0?Math[_0x5c1723(0x8e)](..._0x528e7b['map'](_0x1b482b=>_0x1b482b[_0x5c1723(0xa4)]['length'])):0x0,_0x31e419=[];for(const _0x335fe0 of _0x528e7b){const _0x8ef8a4=a16_0x4948b8[_0x5c1723(0xa2)](_0x335fe0['type'][_0x5c1723(0xc3)](_0x2913ad));_0x31e419['push'](_0x8ef8a4+'\x20\x20'+_0x335fe0[_0x5c1723(0x6b)]);}await writeOutput(_0x31e419['join']('\x0a'),_0x297645['output'],_0x5c1723(0xae));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a16_0x35b414(0x6b)]=a16_0x35b414(0x78);[a16_0x35b414(0x9b)]='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';[a16_0x35b414(0xc4)](_0x54b0f2){const {args:_0x5409e9}=_0x54b0f2;if(!_0x5409e9[0x0])return'Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.';return undefined;}async[a16_0x35b414(0xb3)](_0x3f91ad){const _0x1c8f68=a16_0x35b414,{options:_0x4408ec,args:_0x2990e3,tdx:_0x1d2743}=_0x3f91ad,_0xec1598=_0x2990e3[0x0];_0x4408ec[_0x1c8f68(0xa8)]&&(console['error'](_0x1c8f68(0x81)+_0x4408ec[_0x1c8f68(0xab)]),console['error'](_0x1c8f68(0x9d)+_0xec1598));const _0x40ab16=await withSpinner(_0x1c8f68(0xc5)+_0xec1598+_0x1c8f68(0xc2),()=>_0x1d2743['connection']['getMetadata'](_0xec1598),{'verbose':_0x4408ec[_0x1c8f68(0xa8)]}),_0x317ac4=_0x40ab16[_0x1c8f68(0x74)];console['error']('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0xec1598);if(isStructuredFormat(_0x4408ec))await handleSingleObjectOutput(_0x317ac4,_0x4408ec);else{console[_0x1c8f68(0x72)](_0x1c8f68(0xac)+a16_0x4948b8[_0x1c8f68(0xa2)](_0xec1598)),console[_0x1c8f68(0x72)](_0x1c8f68(0x83)+_0x317ac4[_0x1c8f68(0x6b)]);const _0x3d9102=_0x317ac4[_0x1c8f68(0x9a)]||[],_0x3f2e2b=_0x3d9102['filter'](_0x48915c=>_0x48915c[_0x1c8f68(0xb8)]);_0x3f2e2b[_0x1c8f68(0x92)]>0x0&&(console[_0x1c8f68(0x72)](a16_0x4948b8['bold'](_0x1c8f68(0x8b))),printMetadataSettings(_0x3f2e2b));let _0x9ecdc4=![];try{const _0x5009c8=await _0x1d2743[_0x1c8f68(0x95)][_0x1c8f68(0x8d)](_0xec1598),_0x40e774=normalizeSchemaForDisplay(_0x5009c8);_0x40e774[_0x1c8f68(0x92)]>0x0&&(console['log'](a16_0x4948b8[_0x1c8f68(0x7c)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x40e774,0x0),_0x9ecdc4=!![]);}catch{const _0xdf4b78=_0x3d9102[_0x1c8f68(0xc6)](_0x320699=>!_0x320699[_0x1c8f68(0xb8)]);_0xdf4b78['length']>0x0&&(console[_0x1c8f68(0x72)](a16_0x4948b8['bold'](_0x1c8f68(0x96))),printMetadataSettings(_0xdf4b78),_0x9ecdc4=!![]);}!_0x9ecdc4&&_0x4408ec['verbose']&&console['error'](a16_0x4948b8['dim'](_0x1c8f68(0xb4))),_0x3f2e2b[_0x1c8f68(0x92)]===0x0&&console[_0x1c8f68(0x72)](a16_0x4948b8[_0x1c8f68(0xad)](_0x1c8f68(0x77)));}return 0x0;}}function printMetadataSettings(_0x38a030){const _0x261302=a16_0x35b414;for(const _0xc33b21 of _0x38a030){if(!_0xc33b21[_0x261302(0x6b)])continue;if(_0xc33b21['hidden'])continue;let _0x3b24e5='\x20\x20'+a16_0x4948b8['green'](_0xc33b21[_0x261302(0x6b)]);_0xc33b21['label']&&(_0x3b24e5+=':\x20'+_0xc33b21[_0x261302(0x8a)]);_0xc33b21[_0x261302(0xa4)]&&(_0x3b24e5+=a16_0x4948b8[_0x261302(0xad)]('\x20['+_0xc33b21[_0x261302(0xa4)]+']'));console[_0x261302(0x72)](_0x3b24e5);_0xc33b21['hint']&&console['log'](_0x261302(0x9c)+a16_0x4948b8['dim'](_0xc33b21[_0x261302(0x6d)]));if(_0xc33b21['options']){const _0x2282ce=_0xc33b21[_0x261302(0xcc)][_0x261302(0x91)](_0x212389=>_0x212389['value'])[_0x261302(0xbf)](',\x20');console[_0x261302(0x72)](_0x261302(0x87)+a16_0x4948b8[_0x261302(0xc8)](_0x2282ce));}_0xc33b21[_0x261302(0xc7)]!==undefined&&_0xc33b21[_0x261302(0xc7)]!==null&&console[_0x261302(0x72)](_0x261302(0x6a)+a16_0x4948b8[_0x261302(0xca)](String(_0xc33b21[_0x261302(0xc7)])));if(_0xc33b21['criteria']){const _0x5632fa=Object[_0x261302(0x71)](_0xc33b21[_0x261302(0xbb)])[_0x261302(0x91)](([_0x411664,_0x347211])=>_0x411664+'='+JSON[_0x261302(0x7a)](_0x347211))[_0x261302(0xbf)](',\x20');console[_0x261302(0x72)]('\x20\x20\x20\x20'+a16_0x4948b8[_0x261302(0xad)](_0x261302(0xcd)+_0x5632fa));}}}
@@ -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 a17_0x208eb3=a17_0x4884;(function(_0x330a89,_0x2d432c){const _0x13555c=a17_0x4884,_0x45ad7b=_0x330a89();while(!![]){try{const _0x599f56=parseInt(_0x13555c(0x1e6))/0x1+-parseInt(_0x13555c(0x1e9))/0x2*(parseInt(_0x13555c(0x1ed))/0x3)+-parseInt(_0x13555c(0x1f5))/0x4*(-parseInt(_0x13555c(0x1f7))/0x5)+-parseInt(_0x13555c(0x1e5))/0x6+parseInt(_0x13555c(0x1e2))/0x7+-parseInt(_0x13555c(0x1e0))/0x8*(parseInt(_0x13555c(0x1ec))/0x9)+parseInt(_0x13555c(0x1e7))/0xa;if(_0x599f56===_0x2d432c)break;else _0x45ad7b['push'](_0x45ad7b['shift']());}catch(_0x903c25){_0x45ad7b['push'](_0x45ad7b['shift']());}}}(a17_0x4fe9,0xf0659));function a17_0x4fe9(){const _0x1381eb=['8BKSfJb','site','3231984rWBygO','data','message','2275782IKDHIQ','1322563iowHwr','5990980uwCncl','query','2heQofc','\x20\x20Cause:\x20','execute','62568YyklRv','4131615WKTwNI','✔\x20Found\x20','cause','Pattern:\x20','List\x20all\x20databases','name','verbose','description','486328jcVcUz','error','15xMcAcq','length','📦\x20','Listing\x20databases...'];a17_0x4fe9=function(){return _0x1381eb;};return a17_0x4fe9();}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';function a17_0x4884(_0x82e00a,_0x3a6b60){_0x82e00a=_0x82e00a-0x1e0;const _0x4fe9b7=a17_0x4fe9();let _0x4884fe=_0x4fe9b7[_0x82e00a];return _0x4884fe;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a17_0x208eb3(0x1f2)]='databases';[a17_0x208eb3(0x1f4)]=a17_0x208eb3(0x1f1);async[a17_0x208eb3(0x1eb)](_0x2174c0){const _0x3cfada=a17_0x208eb3,{options:_0xcec650,args:_0x2fe31d,tdx:_0x52c464}=_0x2174c0,_0x4543df=_0x2fe31d[0x0];try{_0xcec650[_0x3cfada(0x1f3)]&&(console[_0x3cfada(0x1f6)]('Site:\x20'+_0xcec650[_0x3cfada(0x1e1)]),_0x4543df&&console[_0x3cfada(0x1f6)](_0x3cfada(0x1f0)+_0x4543df));const _0x4c9343=resolveLimit(_0xcec650['limit'],DEFAULT_LISTING_LIMIT),_0x3ca46c=await withSpinner(_0x3cfada(0x1fa),()=>_0x52c464[_0x3cfada(0x1e8)]['listDatabases'](_0x4543df,_0x4c9343),{'verbose':_0xcec650[_0x3cfada(0x1f3)]}),_0xebc8e=_0x3ca46c[_0x3cfada(0x1e3)];console[_0x3cfada(0x1f6)](_0x3cfada(0x1ee)+_0xebc8e['length']+'\x20database'+(_0xebc8e[_0x3cfada(0x1f8)]!==0x1?'s':''));if(isStructuredFormat(_0xcec650))await handleSDKOutput(_0xebc8e,{..._0xcec650,'limit':_0x4c9343});else for(const _0x1b0207 of _0xebc8e){console['log'](_0x3cfada(0x1f9)+_0x1b0207['database_name']);}return 0x0;}catch(_0x908a05){if(_0x908a05 instanceof SDKError)return console[_0x3cfada(0x1f6)]('Error:\x20'+_0x908a05[_0x3cfada(0x1e4)]),_0x908a05['cause']&&console[_0x3cfada(0x1f6)](_0x3cfada(0x1ea)+_0x908a05[_0x3cfada(0x1ef)]),0x1;throw _0x908a05;}}}