@treasuredata/tdx 0.7.3 → 0.7.4

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 (108) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.d.ts +20 -1
  6. package/dist/client/cdp-api-client.d.ts.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/cdp-api-client.js.map +1 -1
  9. package/dist/client/engage-api-client.js +1 -1
  10. package/dist/client/http-client.js +1 -1
  11. package/dist/client/llm-api-client.js +1 -1
  12. package/dist/client/rate-limiter.js +1 -1
  13. package/dist/client/td-api-client.js +1 -1
  14. package/dist/client/trino-api-client.js +1 -1
  15. package/dist/client/workflow-client.js +1 -1
  16. package/dist/commands/activations.js +1 -1
  17. package/dist/commands/api-command.js +1 -1
  18. package/dist/commands/auth-command.js +1 -1
  19. package/dist/commands/chat-command.js +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.js +1 -1
  24. package/dist/commands/context-command.js +1 -1
  25. package/dist/commands/databases.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-proxy.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pwd-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segments.js +1 -1
  41. package/dist/commands/show.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/use-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/credential-cache.js +1 -1
  48. package/dist/core/global-context.js +1 -1
  49. package/dist/core/keychain.js +1 -1
  50. package/dist/core/profile.js +1 -1
  51. package/dist/core/project-config.js +1 -1
  52. package/dist/core/session.js +1 -1
  53. package/dist/index.js +1 -1
  54. package/dist/proxy/anthropic-adapter.js +1 -1
  55. package/dist/proxy/claude-usage-tracker.js +1 -1
  56. package/dist/proxy/context-signature.js +1 -1
  57. package/dist/proxy/conversation-utils.js +1 -1
  58. package/dist/proxy/server.js +1 -1
  59. package/dist/proxy/session-cache.js +1 -1
  60. package/dist/sdk/api.js +1 -1
  61. package/dist/sdk/engage.js +1 -1
  62. package/dist/sdk/errors.js +1 -1
  63. package/dist/sdk/index.js +1 -1
  64. package/dist/sdk/job.js +1 -1
  65. package/dist/sdk/llm.js +1 -1
  66. package/dist/sdk/query.js +1 -1
  67. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  68. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  69. package/dist/sdk/segment.d.ts.map +1 -1
  70. package/dist/sdk/segment.js +1 -1
  71. package/dist/sdk/segment.js.map +1 -1
  72. package/dist/sdk/workflow.js +1 -1
  73. package/dist/types/cdp.d.ts +58 -0
  74. package/dist/types/cdp.d.ts.map +1 -1
  75. package/dist/types/endpoints.js +1 -1
  76. package/dist/types/index.d.ts +1 -1
  77. package/dist/types/index.d.ts.map +1 -1
  78. package/dist/types/index.js +1 -1
  79. package/dist/utils/agent-ref-parser.js +1 -1
  80. package/dist/utils/chat-cache.js +1 -1
  81. package/dist/utils/colors.js +1 -1
  82. package/dist/utils/command-output.js +1 -1
  83. package/dist/utils/constants.js +1 -1
  84. package/dist/utils/diff.js +1 -1
  85. package/dist/utils/fields-display.js +1 -1
  86. package/dist/utils/file-permissions.js +1 -1
  87. package/dist/utils/format-detector.js +1 -1
  88. package/dist/utils/formatters.js +1 -1
  89. package/dist/utils/json-loader.js +1 -1
  90. package/dist/utils/llm-backup-utils.js +1 -1
  91. package/dist/utils/model-aliases.js +1 -1
  92. package/dist/utils/model-factors.js +1 -1
  93. package/dist/utils/option-validation.js +1 -1
  94. package/dist/utils/port.js +1 -1
  95. package/dist/utils/process.js +1 -1
  96. package/dist/utils/prompt.js +1 -1
  97. package/dist/utils/segment-path-parser.js +1 -1
  98. package/dist/utils/segment-ref-parser.js +1 -1
  99. package/dist/utils/spinner.js +1 -1
  100. package/dist/utils/sql-parser.js +1 -1
  101. package/dist/utils/sse-parser.js +1 -1
  102. package/dist/utils/string-utils.js +1 -1
  103. package/dist/utils/table-ref-parser.js +1 -1
  104. package/dist/utils/tdx-logger.js +1 -1
  105. package/dist/utils/tree-formatter.js +1 -1
  106. package/dist/utils/version-check.js +1 -1
  107. package/dist/utils/workflow-utils.js +1 -1
  108. package/package.json +1 -1
@@ -1 +1 @@
1
- const a11_0x1bcc35=a11_0xfbc8;(function(_0x1a94c0,_0x532b6b){const _0x35d6b7=a11_0xfbc8,_0x67bba=_0x1a94c0();while(!![]){try{const _0x43368f=parseInt(_0x35d6b7(0x11c))/0x1*(-parseInt(_0x35d6b7(0x126))/0x2)+parseInt(_0x35d6b7(0x119))/0x3*(parseInt(_0x35d6b7(0x130))/0x4)+parseInt(_0x35d6b7(0x138))/0x5*(parseInt(_0x35d6b7(0x120))/0x6)+parseInt(_0x35d6b7(0x12f))/0x7+parseInt(_0x35d6b7(0x131))/0x8+parseInt(_0x35d6b7(0x125))/0x9+-parseInt(_0x35d6b7(0x128))/0xa;if(_0x43368f===_0x532b6b)break;else _0x67bba['push'](_0x67bba['shift']());}catch(_0x43f661){_0x67bba['push'](_0x67bba['shift']());}}}(a11_0x273c,0x80496));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a11_0x273c(){const _0x150f70=['27747560LHsalV','message','length','resolveParentId','error','Error:\x20Segment\x20name\x20is\x20required','activations','4610585ggwRXZ','100nFxynA','8205184EXSDuI','Resolved\x20child\x20ID:\x20','data','execute','✔\x20Found\x20','Resolving\x20parent\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','108980TkPKVt','Listing\x20activations\x20for\x20segment\x20\x27','Child\x20name:\x20','description','\x20activation','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','resolveSegmentId','Resolved\x20parent\x20ID:\x20','101511eQPWau','name','\x27...','312259uzRqHi','site','verbose','listActivations','204PiCmYU','segment','\x20\x20Cause:\x20','List\x20activations\x20for\x20a\x20segment','cause','8691327RvPhsg','6EdakoN','Resolving\x20child\x20segment\x20\x27'];a11_0x273c=function(){return _0x150f70;};return a11_0x273c();}function a11_0xfbc8(_0x40aef8,_0x47fffd){const _0x273cc9=a11_0x273c();return a11_0xfbc8=function(_0xfbc82e,_0x18df67){_0xfbc82e=_0xfbc82e-0x119;let _0x10b195=_0x273cc9[_0xfbc82e];return _0x10b195;},a11_0xfbc8(_0x40aef8,_0x47fffd);}import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a11_0x1bcc35(0x11a)]=a11_0x1bcc35(0x12e);[a11_0x1bcc35(0x13b)]=a11_0x1bcc35(0x123);async[a11_0x1bcc35(0x134)](_0x57599d){const _0xf96c2b=a11_0x1bcc35,{options:_0x170201,args:_0x5a8737,tdx:_0x2e32d9}=_0x57599d;if(_0x5a8737[_0xf96c2b(0x12a)]===0x0)return console[_0xf96c2b(0x12c)](_0xf96c2b(0x12d)),console[_0xf96c2b(0x12c)](_0xf96c2b(0x13d)),0x1;try{const {parentId:_0x5cf4c3,childId:_0x1a8d1f}=parseSegmentRef(_0x5a8737[0x0]);if(!_0x1a8d1f)return console[_0xf96c2b(0x12c)](_0xf96c2b(0x137)),console['error'](_0xf96c2b(0x13d)),0x1;_0x170201[_0xf96c2b(0x11e)]&&(console[_0xf96c2b(0x12c)]('Site:\x20'+_0x170201[_0xf96c2b(0x11d)]),console['error']('Parent\x20name:\x20'+_0x5cf4c3),console['error'](_0xf96c2b(0x13a)+_0x1a8d1f));const _0x292582=await withSpinner(_0xf96c2b(0x136)+_0x5cf4c3+_0xf96c2b(0x11b),()=>_0x2e32d9[_0xf96c2b(0x121)][_0xf96c2b(0x12b)](_0x5cf4c3),{'verbose':_0x170201[_0xf96c2b(0x11e)]}),_0x3a3960=_0x292582['data'];_0x170201[_0xf96c2b(0x11e)]&&console[_0xf96c2b(0x12c)](_0xf96c2b(0x13f)+_0x3a3960);const _0x4f4e0e=await withSpinner(_0xf96c2b(0x127)+_0x1a8d1f+'\x27...',()=>_0x2e32d9[_0xf96c2b(0x121)][_0xf96c2b(0x13e)](_0x3a3960,_0x1a8d1f),{'verbose':_0x170201['verbose']}),_0x2deeae=_0x4f4e0e['data'];_0x170201[_0xf96c2b(0x11e)]&&console[_0xf96c2b(0x12c)](_0xf96c2b(0x132)+_0x2deeae);const _0x5c71ff=await withSpinner(_0xf96c2b(0x139)+_0x1a8d1f+_0xf96c2b(0x11b),()=>_0x2e32d9[_0xf96c2b(0x121)][_0xf96c2b(0x11f)](_0x3a3960,_0x2deeae),{'verbose':_0x170201[_0xf96c2b(0x11e)]}),_0x28439f=_0x5c71ff[_0xf96c2b(0x133)];return console[_0xf96c2b(0x12c)](_0xf96c2b(0x135)+_0x28439f[_0xf96c2b(0x12a)]+_0xf96c2b(0x13c)+(_0x28439f['length']!==0x1?'s':'')),await handleSDKOutput(_0x28439f,_0x170201),0x0;}catch(_0x1a9f1a){if(_0x1a9f1a instanceof SDKError)return console['error']('Error:\x20'+_0x1a9f1a[_0xf96c2b(0x129)]),_0x1a9f1a['cause']&&console[_0xf96c2b(0x12c)](_0xf96c2b(0x122)+_0x1a9f1a[_0xf96c2b(0x124)]),0x1;throw _0x1a9f1a;}}}
1
+ const a11_0x33a19c=a11_0x2840;(function(_0x623d64,_0x124aff){const _0x5eceb6=a11_0x2840,_0x417aae=_0x623d64();while(!![]){try{const _0x4bf15e=-parseInt(_0x5eceb6(0x1e3))/0x1+-parseInt(_0x5eceb6(0x1de))/0x2*(-parseInt(_0x5eceb6(0x1f0))/0x3)+parseInt(_0x5eceb6(0x1dc))/0x4+parseInt(_0x5eceb6(0x1d7))/0x5*(parseInt(_0x5eceb6(0x1ee))/0x6)+-parseInt(_0x5eceb6(0x1cc))/0x7*(-parseInt(_0x5eceb6(0x1dd))/0x8)+parseInt(_0x5eceb6(0x1da))/0x9+-parseInt(_0x5eceb6(0x1ea))/0xa;if(_0x4bf15e===_0x124aff)break;else _0x417aae['push'](_0x417aae['shift']());}catch(_0x181cab){_0x417aae['push'](_0x417aae['shift']());}}}(a11_0xd1b8,0xf22d7));import{BaseCommand}from'./command.js';function a11_0x2840(_0x2067d4,_0x3183b8){const _0xd1b859=a11_0xd1b8();return a11_0x2840=function(_0x28400f,_0x17c93c){_0x28400f=_0x28400f-0x1cb;let _0x6fe8ba=_0xd1b859[_0x28400f];return _0x6fe8ba;},a11_0x2840(_0x2067d4,_0x3183b8);}import{SDKError}from'../sdk/index.js';function a11_0xd1b8(){const _0xddf84d=['error','Site:\x20','listActivations','resolveSegmentId','Resolved\x20parent\x20ID:\x20','Listing\x20activations\x20for\x20segment\x20\x27','name','description','resolveParentId','cause','5jSekWe','Error:\x20Segment\x20name\x20is\x20required','length','9752193rjSFJE','Child\x20name:\x20','2713432gVwedY','32WGRCFC','2115936xdTRGh','Resolved\x20child\x20ID:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','message','site','473984TNfOBQ','segment','List\x20activations\x20for\x20a\x20segment','Resolving\x20parent\x20segment\x20\x27','verbose','data','✔\x20Found\x20','29677950bBLEht','\x27...','\x20\x20Cause:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','9655410fgaktq','Error:\x20','3PubahV','execute','8050nkgyEm'];a11_0xd1b8=function(){return _0xddf84d;};return a11_0xd1b8();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a11_0x33a19c(0x1d3)]='activations';[a11_0x33a19c(0x1d4)]=a11_0x33a19c(0x1e5);async[a11_0x33a19c(0x1cb)](_0x348c1d){const _0x5c7e8f=a11_0x33a19c,{options:_0x3576b3,args:_0x181a6e,tdx:_0x1c4285}=_0x348c1d;if(_0x181a6e[_0x5c7e8f(0x1d9)]===0x0)return console['error'](_0x5c7e8f(0x1d8)),console[_0x5c7e8f(0x1cd)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x42542c,childId:_0x4ad6b0}=parseSegmentRef(_0x181a6e[0x0]);if(!_0x4ad6b0)return console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1ed)),console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1e0)),0x1;_0x3576b3[_0x5c7e8f(0x1e7)]&&(console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1ce)+_0x3576b3[_0x5c7e8f(0x1e2)]),console['error']('Parent\x20name:\x20'+_0x42542c),console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1db)+_0x4ad6b0));const _0x310be4=await withSpinner(_0x5c7e8f(0x1e6)+_0x42542c+_0x5c7e8f(0x1eb),()=>_0x1c4285['segment'][_0x5c7e8f(0x1d5)](_0x42542c),{'verbose':_0x3576b3[_0x5c7e8f(0x1e7)]}),_0x5b0dfd=_0x310be4['data'];_0x3576b3['verbose']&&console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1d1)+_0x5b0dfd);const _0x2f02ee=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x4ad6b0+'\x27...',()=>_0x1c4285[_0x5c7e8f(0x1e4)][_0x5c7e8f(0x1d0)](_0x5b0dfd,_0x4ad6b0),{'verbose':_0x3576b3[_0x5c7e8f(0x1e7)]}),_0x419492=_0x2f02ee[_0x5c7e8f(0x1e8)];_0x3576b3['verbose']&&console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1df)+_0x419492);const _0x24f267=await withSpinner(_0x5c7e8f(0x1d2)+_0x4ad6b0+_0x5c7e8f(0x1eb),()=>_0x1c4285['segment'][_0x5c7e8f(0x1cf)](_0x5b0dfd,_0x419492),{'verbose':_0x3576b3[_0x5c7e8f(0x1e7)]}),_0x1a5328=_0x24f267[_0x5c7e8f(0x1e8)];return console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1e9)+_0x1a5328[_0x5c7e8f(0x1d9)]+'\x20activation'+(_0x1a5328[_0x5c7e8f(0x1d9)]!==0x1?'s':'')),await handleSDKOutput(_0x1a5328,_0x3576b3),0x0;}catch(_0xd66bca){if(_0xd66bca instanceof SDKError)return console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1ef)+_0xd66bca[_0x5c7e8f(0x1e1)]),_0xd66bca[_0x5c7e8f(0x1d6)]&&console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1ec)+_0xd66bca[_0x5c7e8f(0x1d6)]),0x1;throw _0xd66bca;}}}
@@ -1 +1 @@
1
- const a12_0x375ab7=a12_0x2a83;function a12_0x2fe6(){const _0x4df27d=['workflow','log','verbose','trino','15bTWbkv','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','error','toUpperCase','trim','method','512EYXmiS','5637784uzdlAp','Results\x20saved\x20to\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','message','headers','readBodyFromFile','1501205oqfCkc','startsWith','output','isArray','color','Invalid\x20HTTP\x20method:\x20','authorization','substring','keys','file','data','stack','join','.\x20Valid\x20types:\x20','x-trino-user','41720dgNBzD','status','site','set-cookie','includes','api','validate','header','Invalid\x20header\x20format:\x20\x22','indexOf','850360tzMDwL','noColor','x-auth-token','Invalid\x20API\x20type:\x20','GET','cookie','has','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','PUT','llm','name','proxy-authorization','length','4685604kaBofi','452490GgXOaH','type','PATCH','execute','POST','DELETE','Error:\x20','entries','request','description','.\x20Valid\x20methods:\x20','set-cookie2','9155907BFDfZf','toLowerCase'];a12_0x2fe6=function(){return _0x4df27d;};return a12_0x2fe6();}(function(_0x1bb210,_0x4f008f){const _0x3bb505=a12_0x2a83,_0x4384b9=_0x1bb210();while(!![]){try{const _0x5de429=parseInt(_0x3bb505(0x1b2))/0x1+parseInt(_0x3bb505(0x1c0))/0x2*(-parseInt(_0x3bb505(0x1d2))/0x3)+parseInt(_0x3bb505(0x1d9))/0x4+parseInt(_0x3bb505(0x1df))/0x5+parseInt(_0x3bb505(0x1bf))/0x6+-parseInt(_0x3bb505(0x1a8))/0x7*(parseInt(_0x3bb505(0x1d8))/0x8)+-parseInt(_0x3bb505(0x1cc))/0x9;if(_0x5de429===_0x4f008f)break;else _0x4384b9['push'](_0x4384b9['shift']());}catch(_0x503191){_0x4384b9['push'](_0x4384b9['shift']());}}}(a12_0x2fe6,0xc5ff1));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a12_0x2a83(_0x7609b2,_0xa8da10){const _0x2fe66b=a12_0x2fe6();return a12_0x2a83=function(_0x2a83f0,_0x41ea3a){_0x2a83f0=_0x2a83f0-0x1a0;let _0x5943a9=_0x2fe66b[_0x2a83f0];return _0x5943a9;},a12_0x2a83(_0x7609b2,_0xa8da10);}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a12_0x375ab7(0x1e5),a12_0x375ab7(0x1bd),a12_0x375ab7(0x1b7),a12_0x375ab7(0x1ab),a12_0x375ab7(0x1cb),'x-xsrf-token',a12_0x375ab7(0x1b4),a12_0x375ab7(0x1a7)]);function isSensitiveHeader(_0x262e09){const _0x91da1=a12_0x375ab7;return SENSITIVE_HEADERS[_0x91da1(0x1b8)](_0x262e09[_0x91da1(0x1cd)]());}function parseHeader(_0x5f024d){const _0x3e0b7c=a12_0x375ab7,_0x5c903c=_0x5f024d[_0x3e0b7c(0x1b1)](':');if(_0x5c903c===-0x1)throw new Error(_0x3e0b7c(0x1b0)+_0x5f024d+'\x22.\x20'+_0x3e0b7c(0x1db));const _0x1e3388=_0x5f024d['substring'](0x0,_0x5c903c)[_0x3e0b7c(0x1d6)](),_0xd7f037=_0x5f024d[_0x3e0b7c(0x1a0)](_0x5c903c+0x1)[_0x3e0b7c(0x1d6)]();if(!_0x1e3388)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5f024d+'\x22');return[_0x1e3388,_0xd7f037];}export class ApiCommand extends BaseCommand{[a12_0x375ab7(0x1bc)]='api';[a12_0x375ab7(0x1c9)]=a12_0x375ab7(0x1b9);[a12_0x375ab7(0x1ae)](_0x47e643){const _0x4a9600=a12_0x375ab7,{args:_0x369397,options:_0x1d9cff}=_0x47e643,_0x2d32f3=_0x1d9cff;if(_0x369397[_0x4a9600(0x1be)]===0x0)return _0x4a9600(0x1d3);const _0x693dcb=_0x369397[0x0];if(!_0x693dcb[_0x4a9600(0x1e0)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x693dcb;const _0x1a34d3=_0x2d32f3[_0x4a9600(0x1a3)],_0x3a61fa=_0x2d32f3[_0x4a9600(0x1a2)];if(_0x1a34d3&&_0x3a61fa)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0xc58b9c=_0x2d32f3[_0x4a9600(0x1d7)]||_0x4a9600(0x1b6),_0x5ef165=[_0x4a9600(0x1b6),_0x4a9600(0x1c4),_0x4a9600(0x1ba),_0x4a9600(0x1c5),_0x4a9600(0x1c2)];if(!_0x5ef165[_0x4a9600(0x1ac)](_0xc58b9c['toUpperCase']()))return _0x4a9600(0x1e4)+_0xc58b9c+_0x4a9600(0x1ca)+_0x5ef165[_0x4a9600(0x1a5)](',\x20');const _0x1d6a74=_0x2d32f3[_0x4a9600(0x1c1)]||'td',_0x214ee5=['td','cdp',_0x4a9600(0x1ce),_0x4a9600(0x1d1),_0x4a9600(0x1bb)];if(!_0x214ee5['includes'](_0x1d6a74))return _0x4a9600(0x1b5)+_0x1d6a74+_0x4a9600(0x1a6)+_0x214ee5[_0x4a9600(0x1a5)](',\x20');return undefined;}async[a12_0x375ab7(0x1c3)](_0x427988){const _0x47675a=a12_0x375ab7,{options:_0x239e5c,args:_0x32df1b,tdx:_0x465eab}=_0x427988,_0x256c79=_0x239e5c,_0xb10de3=_0x32df1b[0x0],_0x360980=(_0x256c79['method']||_0x47675a(0x1b6))[_0x47675a(0x1d5)](),_0x50a929=_0x256c79['data'],_0xce6e58=_0x256c79[_0x47675a(0x1a2)],_0x2cdedd=_0x256c79[_0x47675a(0x1af)],_0x41e988=_0x256c79[_0x47675a(0x1c1)]||'td';try{const _0x47a149={};if(_0x2cdedd){const _0x998034=Array[_0x47675a(0x1e2)](_0x2cdedd)?_0x2cdedd:[_0x2cdedd];for(const _0x364ef8 of _0x998034){const [_0x32f81f,_0x2dce08]=parseHeader(_0x364ef8);_0x47a149[_0x32f81f]=_0x2dce08;}}let _0x5c7d80;if(_0x50a929)_0x5c7d80=_0x50a929;else{if(_0xce6e58)try{_0x5c7d80=RawAPI[_0x47675a(0x1de)](_0xce6e58);}catch(_0x3af7b1){return console[_0x47675a(0x1d4)](_0x47675a(0x1c6)+(_0x3af7b1 instanceof Error?_0x3af7b1['message']:String(_0x3af7b1))),0x1;}}const _0x3b1754={'method':_0x360980,'apiType':_0x41e988,'includeHeaders':_0x239e5c[_0x47675a(0x1d0)]};_0x5c7d80&&(_0x3b1754['body']=_0x5c7d80);Object[_0x47675a(0x1a1)](_0x47a149)[_0x47675a(0x1be)]>0x0&&(_0x3b1754[_0x47675a(0x1dd)]=_0x47a149);if(_0x239e5c[_0x47675a(0x1d0)]){const _0x2317a2=resolveSite(_0x239e5c[_0x47675a(0x1aa)]),_0x7027a=getEndpoint(_0x2317a2,_0x41e988),_0x2a1928=''+_0x7027a+_0xb10de3;console[_0x47675a(0x1d4)]('>\x20'+_0x360980+'\x20'+_0x2a1928);const _0x3b0aa3=getAuthHeaders(_0x2317a2),_0x4bd5b7={..._0x3b0aa3,..._0x47a149};for(const [_0x34c760,_0x45ff44]of Object[_0x47675a(0x1c7)](_0x4bd5b7)){!isSensitiveHeader(_0x34c760)&&console[_0x47675a(0x1d4)]('>\x20'+_0x34c760+':\x20'+_0x45ff44);}_0x5c7d80&&console[_0x47675a(0x1d4)]('>'),console['error']('');}const _0x537c34=await _0x465eab[_0x47675a(0x1ad)][_0x47675a(0x1c8)](_0xb10de3,_0x3b1754);if(_0x239e5c[_0x47675a(0x1d0)]&&_0x537c34[_0x47675a(0x1dd)]){console[_0x47675a(0x1d4)]('<\x20HTTP/1.1\x20'+_0x537c34[_0x47675a(0x1a9)]);for(const [_0x46db8b,_0x24619e]of Object[_0x47675a(0x1c7)](_0x537c34[_0x47675a(0x1dd)])){!isSensitiveHeader(_0x46db8b)&&console['error']('<\x20'+_0x46db8b+':\x20'+_0x24619e);}console[_0x47675a(0x1d4)]('');}const _0x438368=Boolean(_0x239e5c[_0x47675a(0x1e1)]),_0x174a73={'color':_0x239e5c[_0x47675a(0x1e3)],'noColor':_0x239e5c[_0x47675a(0x1b3)]||_0x438368&&!_0x239e5c[_0x47675a(0x1e3)]},_0x3a90e3=colorizeJSON(_0x537c34[_0x47675a(0x1a3)],_0x174a73);return _0x239e5c['output']?(writeFileSync(_0x239e5c['output'],_0x3a90e3),console['error'](_0x47675a(0x1da)+_0x239e5c[_0x47675a(0x1e1)])):console[_0x47675a(0x1cf)](_0x3a90e3),0x0;}catch(_0x500deb){return _0x500deb instanceof Error?(console[_0x47675a(0x1d4)](_0x47675a(0x1c6)+_0x500deb[_0x47675a(0x1dc)]),_0x239e5c['verbose']&&_0x500deb['stack']&&console[_0x47675a(0x1d4)]('\x0aStack\x20trace:\x0a'+_0x500deb[_0x47675a(0x1a4)])):console[_0x47675a(0x1d4)](_0x47675a(0x1c6)+String(_0x500deb)),0x1;}}}
1
+ const a12_0x2aed46=a12_0x3c8e;(function(_0x3fbf3e,_0xbfa7ba){const _0x3090db=a12_0x3c8e,_0x3e3531=_0x3fbf3e();while(!![]){try{const _0x11aade=-parseInt(_0x3090db(0x20a))/0x1+-parseInt(_0x3090db(0x20d))/0x2+parseInt(_0x3090db(0x1ed))/0x3*(parseInt(_0x3090db(0x1f0))/0x4)+parseInt(_0x3090db(0x204))/0x5*(parseInt(_0x3090db(0x1eb))/0x6)+parseInt(_0x3090db(0x210))/0x7+-parseInt(_0x3090db(0x1fb))/0x8*(parseInt(_0x3090db(0x206))/0x9)+parseInt(_0x3090db(0x1f1))/0xa*(parseInt(_0x3090db(0x20e))/0xb);if(_0x11aade===_0xbfa7ba)break;else _0x3e3531['push'](_0x3e3531['shift']());}catch(_0x3b4712){_0x3e3531['push'](_0x3e3531['shift']());}}}(a12_0x15cd,0xb4690));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../types/index.js';function a12_0x15cd(){const _0x1d3db1=['216501jHtEdz','has','set-cookie','12dwodEq','685310RRpNdb','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','cookie','toUpperCase','x-trino-user','verbose','keys','isArray','headers','length','1423384wybWjk','description','proxy-authorization','header','log','entries','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','join','1343535KNOpmj','GET','9ttMUVC','trim','PUT','trino','176115lteHgx','x-xsrf-token','includes','1385896rcoumZ','11vrKpJd','data','2982602YrQJDl','message','body','POST','readBodyFromFile','Error:\x20','Invalid\x20API\x20type:\x20','toLowerCase','site','cdp','type','output','Invalid\x20HTTP\x20method:\x20','Results\x20saved\x20to\x20','\x0aStack\x20trace:\x0a','llm','request','error','method','.\x20Valid\x20methods:\x20','startsWith','status','color','execute','api','stack','file','x-auth-token','substring','\x22.\x20','Invalid\x20header\x20format:\x20\x22','24SfBmiD','workflow'];a12_0x15cd=function(){return _0x1d3db1;};return a12_0x15cd();}import{resolveSite}from'../core/config.js';function a12_0x3c8e(_0xb35df9,_0x3e0107){const _0x15cd61=a12_0x15cd();return a12_0x3c8e=function(_0x3c8e2f,_0x491c88){_0x3c8e2f=_0x3c8e2f-0x1dc;let _0x269a49=_0x15cd61[_0x3c8e2f];return _0x269a49;},a12_0x3c8e(_0xb35df9,_0x3e0107);}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a12_0x2aed46(0x1fd),a12_0x2aed46(0x1f3),a12_0x2aed46(0x1ef),'set-cookie2',a12_0x2aed46(0x20b),a12_0x2aed46(0x1e7),a12_0x2aed46(0x1f5)]);function isSensitiveHeader(_0x332a81){const _0x4508f0=a12_0x2aed46;return SENSITIVE_HEADERS[_0x4508f0(0x1ee)](_0x332a81[_0x4508f0(0x217)]());}function parseHeader(_0x665d74){const _0x173637=a12_0x2aed46,_0x4c35f1=_0x665d74['indexOf'](':');if(_0x4c35f1===-0x1)throw new Error(_0x173637(0x1ea)+_0x665d74+_0x173637(0x1e9)+_0x173637(0x202));const _0x1a1deb=_0x665d74[_0x173637(0x1e8)](0x0,_0x4c35f1)[_0x173637(0x207)](),_0x149ad6=_0x665d74[_0x173637(0x1e8)](_0x4c35f1+0x1)[_0x173637(0x207)]();if(!_0x1a1deb)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x665d74+'\x22');return[_0x1a1deb,_0x149ad6];}export class ApiCommand extends BaseCommand{['name']=a12_0x2aed46(0x1e4);[a12_0x2aed46(0x1fc)]=a12_0x2aed46(0x201);['validate'](_0x7a4a92){const _0x31095d=a12_0x2aed46,{args:_0x559ad6,options:_0x1d39b2}=_0x7a4a92,_0x3fedb4=_0x1d39b2;if(_0x559ad6[_0x31095d(0x1fa)]===0x0)return _0x31095d(0x1f2);const _0x32260f=_0x559ad6[0x0];if(!_0x32260f[_0x31095d(0x1e0)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x32260f;const _0x2812e9=_0x3fedb4[_0x31095d(0x20f)],_0x4ffa97=_0x3fedb4[_0x31095d(0x1e6)];if(_0x2812e9&&_0x4ffa97)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x599ea5=_0x3fedb4[_0x31095d(0x1de)]||_0x31095d(0x205),_0xb1be9d=[_0x31095d(0x205),_0x31095d(0x213),_0x31095d(0x208),'DELETE','PATCH'];if(!_0xb1be9d[_0x31095d(0x20c)](_0x599ea5[_0x31095d(0x1f4)]()))return _0x31095d(0x21c)+_0x599ea5+_0x31095d(0x1df)+_0xb1be9d['join'](',\x20');const _0x4efc7c=_0x3fedb4[_0x31095d(0x21a)]||'td',_0x41cef3=['td',_0x31095d(0x219),_0x31095d(0x1ec),_0x31095d(0x209),_0x31095d(0x21f)];if(!_0x41cef3[_0x31095d(0x20c)](_0x4efc7c))return _0x31095d(0x216)+_0x4efc7c+'.\x20Valid\x20types:\x20'+_0x41cef3[_0x31095d(0x203)](',\x20');return undefined;}async[a12_0x2aed46(0x1e3)](_0x51f074){const _0x4d788f=a12_0x2aed46,{options:_0x363f76,args:_0xa3609e,tdx:_0x21d835}=_0x51f074,_0x17f5f6=_0x363f76,_0x666862=_0xa3609e[0x0],_0x19aa13=(_0x17f5f6['method']||_0x4d788f(0x205))[_0x4d788f(0x1f4)](),_0x3ed4bc=_0x17f5f6[_0x4d788f(0x20f)],_0x325cd3=_0x17f5f6[_0x4d788f(0x1e6)],_0x5de409=_0x17f5f6[_0x4d788f(0x1fe)],_0x25e474=_0x17f5f6[_0x4d788f(0x21a)]||'td';try{const _0x502849={};if(_0x5de409){const _0x71d9b4=Array[_0x4d788f(0x1f8)](_0x5de409)?_0x5de409:[_0x5de409];for(const _0x443033 of _0x71d9b4){const [_0x1e4364,_0x2af66d]=parseHeader(_0x443033);_0x502849[_0x1e4364]=_0x2af66d;}}let _0x162a14;if(_0x3ed4bc)_0x162a14=_0x3ed4bc;else{if(_0x325cd3)try{_0x162a14=RawAPI[_0x4d788f(0x214)](_0x325cd3);}catch(_0x34a7b3){return console[_0x4d788f(0x1dd)](_0x4d788f(0x215)+(_0x34a7b3 instanceof Error?_0x34a7b3[_0x4d788f(0x211)]:String(_0x34a7b3))),0x1;}}const _0x13267b={'method':_0x19aa13,'apiType':_0x25e474,'includeHeaders':_0x363f76[_0x4d788f(0x1f6)]};_0x162a14&&(_0x13267b[_0x4d788f(0x212)]=_0x162a14);Object[_0x4d788f(0x1f7)](_0x502849)[_0x4d788f(0x1fa)]>0x0&&(_0x13267b[_0x4d788f(0x1f9)]=_0x502849);if(_0x363f76[_0x4d788f(0x1f6)]){const _0x27342f=resolveSite(_0x363f76[_0x4d788f(0x218)]),_0x51a1a0=getEndpoint(_0x27342f,_0x25e474),_0x25f6a0=''+_0x51a1a0+_0x666862;console[_0x4d788f(0x1dd)]('>\x20'+_0x19aa13+'\x20'+_0x25f6a0);const _0x342494=getAuthHeaders(_0x27342f),_0xf724b8={..._0x342494,..._0x502849};for(const [_0x1e4a00,_0x1bc4ef]of Object[_0x4d788f(0x200)](_0xf724b8)){!isSensitiveHeader(_0x1e4a00)&&console[_0x4d788f(0x1dd)]('>\x20'+_0x1e4a00+':\x20'+_0x1bc4ef);}_0x162a14&&console[_0x4d788f(0x1dd)]('>'),console[_0x4d788f(0x1dd)]('');}const _0xedbb0=await _0x21d835[_0x4d788f(0x1e4)][_0x4d788f(0x1dc)](_0x666862,_0x13267b);if(_0x363f76[_0x4d788f(0x1f6)]&&_0xedbb0[_0x4d788f(0x1f9)]){console[_0x4d788f(0x1dd)]('<\x20HTTP/1.1\x20'+_0xedbb0[_0x4d788f(0x1e1)]);for(const [_0x47f9d7,_0x4342fb]of Object[_0x4d788f(0x200)](_0xedbb0[_0x4d788f(0x1f9)])){!isSensitiveHeader(_0x47f9d7)&&console[_0x4d788f(0x1dd)]('<\x20'+_0x47f9d7+':\x20'+_0x4342fb);}console[_0x4d788f(0x1dd)]('');}const _0x488d65=Boolean(_0x363f76[_0x4d788f(0x21b)]),_0x3386cb={'color':_0x363f76[_0x4d788f(0x1e2)],'noColor':_0x363f76['noColor']||_0x488d65&&!_0x363f76[_0x4d788f(0x1e2)]},_0x26dcc5=colorizeJSON(_0xedbb0['data'],_0x3386cb);return _0x363f76[_0x4d788f(0x21b)]?(writeFileSync(_0x363f76[_0x4d788f(0x21b)],_0x26dcc5),console[_0x4d788f(0x1dd)](_0x4d788f(0x21d)+_0x363f76[_0x4d788f(0x21b)])):console[_0x4d788f(0x1ff)](_0x26dcc5),0x0;}catch(_0x52c557){return _0x52c557 instanceof Error?(console[_0x4d788f(0x1dd)](_0x4d788f(0x215)+_0x52c557[_0x4d788f(0x211)]),_0x363f76['verbose']&&_0x52c557[_0x4d788f(0x1e5)]&&console[_0x4d788f(0x1dd)](_0x4d788f(0x21e)+_0x52c557['stack'])):console[_0x4d788f(0x1dd)](_0x4d788f(0x215)+String(_0x52c557)),0x1;}}}
@@ -1 +1 @@
1
- function a13_0x2bee(_0x19775c,_0xc66735){const _0x2d7578=a13_0x2d75();return a13_0x2bee=function(_0x2bee6c,_0xc0634e){_0x2bee6c=_0x2bee6c-0x13b;let _0x3691ac=_0x2d7578[_0x2bee6c];return _0x3691ac;},a13_0x2bee(_0x19775c,_0xc66735);}const a13_0x284af6=a13_0x2bee;(function(_0x5b8f9b,_0x209a45){const _0x18e2b6=a13_0x2bee,_0x4bf161=_0x5b8f9b();while(!![]){try{const _0x355cc6=parseInt(_0x18e2b6(0x163))/0x1*(-parseInt(_0x18e2b6(0x147))/0x2)+-parseInt(_0x18e2b6(0x15a))/0x3+-parseInt(_0x18e2b6(0x145))/0x4+parseInt(_0x18e2b6(0x18d))/0x5+-parseInt(_0x18e2b6(0x179))/0x6+-parseInt(_0x18e2b6(0x151))/0x7+parseInt(_0x18e2b6(0x15d))/0x8;if(_0x355cc6===_0x209a45)break;else _0x4bf161['push'](_0x4bf161['shift']());}catch(_0x1e34bd){_0x4bf161['push'](_0x4bf161['shift']());}}}(a13_0x2d75,0x29997));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../types/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a13_0x2fd6b3 from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a13_0x50f03d from'chalk';export class AuthSetupCommand extends BaseCommand{[a13_0x284af6(0x188)]='auth:setup';[a13_0x284af6(0x167)]=a13_0x284af6(0x162);async[a13_0x284af6(0x14c)](_0x462ab7){const _0x1a7d33=a13_0x284af6,{options:_0x2a6972}=_0x462ab7,_0x3bf659=_0x2a6972[_0x1a7d33(0x148)];console['log'](a13_0x50f03d[_0x1a7d33(0x18a)](_0x1a7d33(0x182)));const _0x1bdf12=_0x2a6972[_0x1a7d33(0x175)]||'us01',_0x193bfd=[{'title':_0x1a7d33(0x143),'value':_0x1a7d33(0x142)},{'title':_0x1a7d33(0x178),'value':_0x1a7d33(0x185)},{'title':_0x1a7d33(0x180),'value':_0x1a7d33(0x14a)},{'title':_0x1a7d33(0x150),'value':_0x1a7d33(0x14b)}];let _0x50200d=_0x193bfd[_0x1a7d33(0x146)](_0x42aabf=>_0x42aabf[_0x1a7d33(0x18c)]===_0x1bdf12);_0x50200d===-0x1&&_0x1bdf12!==_0x1a7d33(0x142)&&(_0x193bfd['push']({'title':_0x1bdf12,'value':_0x1bdf12}),_0x50200d=_0x193bfd['length']-0x1);_0x193bfd['push']({'title':'Enter\x20custom\x20site','value':_0x1a7d33(0x18b)});const _0x2ecc9a=_0x3bf659?_0x1a7d33(0x158)+_0x3bf659+'):':_0x1a7d33(0x17a),_0x49d16b=await a13_0x2fd6b3({'type':_0x1a7d33(0x141),'name':'site','message':_0x2ecc9a,'choices':_0x193bfd,'initial':_0x50200d>=0x0?_0x50200d:0x0});if(!_0x49d16b[_0x1a7d33(0x175)])return console['log'](_0x1a7d33(0x16d)),0x1;let _0x47e35b;if(_0x49d16b['site']===_0x1a7d33(0x18b)){const _0x1efb36=await a13_0x2fd6b3({'type':'text','name':_0x1a7d33(0x15e),'message':_0x1a7d33(0x16c),'initial':_0x1a7d33(0x142),'validate':_0x3a76cb=>{const _0x20cbe9=_0x1a7d33;if(!_0x3a76cb||!_0x3a76cb[_0x20cbe9(0x17e)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x20cbe9(0x189)](_0x3a76cb[_0x20cbe9(0x17e)]()))return _0x20cbe9(0x190);return!![];}});if(!_0x1efb36['customSite'])return console[_0x1a7d33(0x17c)](_0x1a7d33(0x16d)),0x1;_0x47e35b=_0x1efb36[_0x1a7d33(0x15e)];}else _0x47e35b=_0x49d16b[_0x1a7d33(0x175)];const _0x3bd817=resolveSite(_0x47e35b);console['log'](_0x1a7d33(0x159)+_0x3bd817),console[_0x1a7d33(0x17c)](_0x1a7d33(0x18e)),console['log']('\x20\x20'+getConsoleUrl(_0x3bd817,_0x1a7d33(0x155)));const _0x787db2=await a13_0x2fd6b3({'type':_0x1a7d33(0x15f),'name':_0x1a7d33(0x183),'message':_0x1a7d33(0x15c),'validate':_0x2c1735=>{const _0x290d5e=_0x1a7d33;if(!_0x2c1735||!_0x2c1735[_0x290d5e(0x17e)]())return _0x290d5e(0x186);return!![];}});if(!_0x787db2[_0x1a7d33(0x183)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x4b6c69=_0x787db2['apiKey'];console[_0x1a7d33(0x17c)](_0x1a7d33(0x13f));try{const _0x40be9d=TDX[_0x1a7d33(0x13b)]({'site':_0x3bd817,'apiKey':_0x4b6c69[_0x1a7d33(0x17e)](),'logLevel':_0x2a6972[_0x1a7d33(0x149)]??LogLevel['ERROR']}),_0x50ee38=await _0x40be9d['jobs'][_0x1a7d33(0x174)]();console['log'](_0x1a7d33(0x17d)+_0x50ee38[_0x1a7d33(0x173)]+')');const _0x251967=await isKeychainAvailable();_0x251967?(await saveAPIKeyAsync(_0x4b6c69['trim'](),_0x3bd817,_0x3bf659),console[_0x1a7d33(0x17c)](_0x1a7d33(0x153)+(_0x3bf659?_0x1a7d33(0x184)+_0x3bf659+')':''))):(console[_0x1a7d33(0x140)](a13_0x50f03d[_0x1a7d33(0x177)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x1a7d33(0x140)](a13_0x50f03d[_0x1a7d33(0x177)](_0x1a7d33(0x161))));if(_0x3bf659){const _0x2cfd33={'site':_0x3bd817};saveProfileToUserConfig(_0x3bf659,_0x2cfd33),console[_0x1a7d33(0x17c)](_0x1a7d33(0x144)+_0x3bf659+_0x1a7d33(0x169));}const _0x4e32e5=_0x3bf659?_0x1a7d33(0x17f)+_0x3bf659:'';return console[_0x1a7d33(0x17c)](),console[_0x1a7d33(0x17c)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x1a7d33(0x17c)](_0x1a7d33(0x14e)+_0x4e32e5+_0x1a7d33(0x14f)),console[_0x1a7d33(0x17c)](_0x1a7d33(0x14e)+_0x4e32e5+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x48d562){if(_0x48d562 instanceof HTTPClientError&&_0x48d562['status']===0x191)return printAuthError(_0x48d562),0x1;return console[_0x1a7d33(0x168)](a13_0x50f03d[_0x1a7d33(0x170)](_0x1a7d33(0x16f)+(_0x48d562 instanceof Error?_0x48d562[_0x1a7d33(0x17b)]:String(_0x48d562)))),console[_0x1a7d33(0x168)](_0x1a7d33(0x13d)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a13_0x284af6(0x188)]=a13_0x284af6(0x164);[a13_0x284af6(0x167)]=a13_0x284af6(0x13e);async[a13_0x284af6(0x14c)](_0x3f9324){const _0x44f40a=a13_0x284af6,{options:_0x491e90,tdx:_0x4b66ee}=_0x3f9324,_0x47d285=_0x491e90[_0x44f40a(0x175)],_0x315f0a=_0x491e90['profile'],_0xaf9da3=_0x315f0a?_0x315f0a:_0x44f40a(0x16e);console[_0x44f40a(0x17c)](_0x44f40a(0x154)+_0xaf9da3+_0x44f40a(0x16a)+_0x47d285+')');const _0x5cf895=await resolveAPIKeyAsync(_0x47d285,_0x315f0a);if(_0x5cf895){const {source:_0x2fc2cb,isDeprecated:_0x1b3564}=_0x5cf895,_0x39c542=_0x44f40a(0x14d)+_0x2fc2cb;console['log'](_0x1b3564?a13_0x50f03d[_0x44f40a(0x177)](_0x39c542):_0x39c542);}else console[_0x44f40a(0x17c)](a13_0x50f03d[_0x44f40a(0x177)](_0x44f40a(0x160)));try{const _0x312370=await _0x4b66ee['jobs'][_0x44f40a(0x174)]();return console[_0x44f40a(0x17c)](a13_0x50f03d[_0x44f40a(0x166)]('✓\x20Authentication\x20successful\x0a')),console['log'](_0x44f40a(0x171)+_0x312370[_0x44f40a(0x173)]),(_0x312370['first_name']||_0x312370[_0x44f40a(0x176)])&&console['log'](_0x44f40a(0x172)+[_0x312370[_0x44f40a(0x16b)],_0x312370[_0x44f40a(0x176)]]['filter'](Boolean)[_0x44f40a(0x18f)]('\x20')),0x0;}catch(_0x4d3a1f){return _0x4d3a1f instanceof HTTPClientError&&_0x4d3a1f[_0x44f40a(0x13c)]===0x191?printAuthError(_0x4d3a1f,!![],_0x315f0a):console['error'](a13_0x50f03d[_0x44f40a(0x170)](_0x44f40a(0x16f)+(_0x4d3a1f instanceof Error?_0x4d3a1f['message']:String(_0x4d3a1f)))),0x1;}}}function a13_0x2d75(){const _0x1cc4d6=['987685AnQdPB','You\x20can\x20find\x20your\x20API\x20key\x20at:','join','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','create','status','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Validating\x20API\x20key...','warn','select','us01','us\x20\x20\x20-\x20United\x20States','✓\x20Profile\x20\x27','1170808OIfThp','findIndex','2dRfVKA','profile','logLevel','eu01','ap02','execute','Read\x20credential\x20from\x20','\x20\x20tdx','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','ap02\x20-\x20Korea','1699775zxozvX','\x20for\x20profile:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','tdx\x20profile:\x20','/app/mp/ak','✓\x20API\x20key\x20removed\x20from\x20keychain','auth:clear','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','129390JoFyRe','System\x20keychain\x20is\x20not\x20available','Enter\x20your\x20TD\x20API\x20key:','8070304PAaJlF','customSite','password','No\x20credential\x20found','\x20\x20Set\x20TD_API_KEY\x20environment\x20variable\x20for\x20authentication.','Setup\x20API\x20key\x20authentication\x20interactively','192985VslLit','auth','tdx:\x20auth\x20clear','green','description','error','\x27\x20registered','\x20(site:\x20','first_name','Enter\x20site\x20name:','\x0aSetup\x20cancelled','N/A','✗\x20Validation\x20failed:\x20','red','User:\x20','Name:\x20','email','getUserInfo','site','last_name','yellow','jp\x20\x20\x20-\x20Japan','1585752DHofuB','Select\x20your\x20Treasure\x20Data\x20site:','message','log','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','trim','\x20--profile\x20','eu\x20\x20\x20-\x20Europe','No\x20API\x20key\x20found\x20in\x20keychain','tdx:\x20auth\x20setup','apiKey','\x20(profile:\x20','jp01','API\x20key\x20cannot\x20be\x20empty','Remove\x20API\x20key\x20from\x20system\x20keychain','name','test','bold','other','value'];a13_0x2d75=function(){return _0x1cc4d6;};return a13_0x2d75();}export class AuthClearCommand extends BaseCommand{['name']=a13_0x284af6(0x157);[a13_0x284af6(0x167)]=a13_0x284af6(0x187);async[a13_0x284af6(0x14c)](_0x2d0bbd){const _0x1f4c6c=a13_0x284af6,{options:_0xf25c6f}=_0x2d0bbd,_0x5072f0=_0xf25c6f[_0x1f4c6c(0x148)];console['log'](a13_0x50f03d[_0x1f4c6c(0x18a)](_0x1f4c6c(0x165)));const _0xc4a6a8=await isKeychainAvailable();if(!_0xc4a6a8)return console[_0x1f4c6c(0x168)](a13_0x50f03d[_0x1f4c6c(0x170)](_0x1f4c6c(0x15b))),0x1;const _0xc56fa=await deleteKeychainAPIKey(_0x5072f0);return _0xc56fa?(clearCredentialCache(),console[_0x1f4c6c(0x17c)](_0x1f4c6c(0x156)+(_0x5072f0?_0x1f4c6c(0x184)+_0x5072f0+')':'')),0x0):(console[_0x1f4c6c(0x17c)](_0x1f4c6c(0x181)+(_0x5072f0?_0x1f4c6c(0x152)+_0x5072f0:'')),0x1);}}
1
+ const a13_0x61e6ed=a13_0x1aa6;(function(_0x45e837,_0x16dd38){const _0x5dbff0=a13_0x1aa6,_0x381706=_0x45e837();while(!![]){try{const _0x3e35a5=parseInt(_0x5dbff0(0x203))/0x1+parseInt(_0x5dbff0(0x217))/0x2*(-parseInt(_0x5dbff0(0x21a))/0x3)+-parseInt(_0x5dbff0(0x20b))/0x4+-parseInt(_0x5dbff0(0x204))/0x5+-parseInt(_0x5dbff0(0x1d4))/0x6+-parseInt(_0x5dbff0(0x218))/0x7+parseInt(_0x5dbff0(0x20f))/0x8;if(_0x3e35a5===_0x16dd38)break;else _0x381706['push'](_0x381706['shift']());}catch(_0x55b539){_0x381706['push'](_0x381706['shift']());}}}(a13_0x51d8,0xae134));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';function a13_0x51d8(){const _0x4d7d97=['email','✓\x20Profile\x20\x27','\x20(profile:\x20','Enter\x20custom\x20site','ERROR','red','execute','No\x20credential\x20found','/app/mp/ak','tdx:\x20auth\x20setup','ap02','create','418153PsBffj','1956850zhGmoT','N/A','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Validating\x20API\x20key...','first_name','ap02\x20-\x20Korea','Name:\x20','4755148HnalKW','last_name','description','trim','26185096ZOFmkC','findIndex','join','\x0aSetup\x20cancelled','site','warn','Select\x20your\x20Treasure\x20Data\x20site:','API\x20key\x20cannot\x20be\x20empty','2sMQUXN','1347206qrerQE','us\x20\x20\x20-\x20United\x20States','722391cEVuLY','eu01','logLevel','green','filter','error','message','apiKey','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','jp\x20\x20\x20-\x20Japan','value','Enter\x20your\x20TD\x20API\x20key:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','auth','yellow','5789196ultcZM','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20(site:\x20','customSite','status','name','test','length','System\x20keychain\x20is\x20not\x20available','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Setup\x20API\x20key\x20authentication\x20interactively','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','select','Remove\x20API\x20key\x20from\x20system\x20keychain','jobs','other','bold','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x20for\x20profile:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✗\x20Validation\x20failed:\x20','password','auth:clear','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20API\x20key\x20removed\x20from\x20keychain','eu\x20\x20\x20-\x20Europe','log','getUserInfo','User:\x20','Enter\x20site\x20name:','Site\x20name\x20cannot\x20be\x20empty','us01','tdx:\x20auth\x20clear','push','\x20\x20tdx'];a13_0x51d8=function(){return _0x4d7d97;};return a13_0x51d8();}function a13_0x1aa6(_0x167d8e,_0x5c3b63){const _0x51d875=a13_0x51d8();return a13_0x1aa6=function(_0x1aa6fe,_0x350362){_0x1aa6fe=_0x1aa6fe-0x1cf;let _0x34e2ba=_0x51d875[_0x1aa6fe];return _0x34e2ba;},a13_0x1aa6(_0x167d8e,_0x5c3b63);}import{getConsoleUrl}from'../types/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a13_0x30ad0f from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a13_0x97d37 from'chalk';export class AuthSetupCommand extends BaseCommand{[a13_0x61e6ed(0x1d9)]='auth:setup';[a13_0x61e6ed(0x20d)]=a13_0x61e6ed(0x1de);async['execute'](_0x53198b){const _0x3e403d=a13_0x61e6ed,{options:_0x5d4c3d}=_0x53198b,_0x5abfff=_0x5d4c3d['profile'];console['log'](a13_0x97d37[_0x3e403d(0x1e4)](_0x3e403d(0x200)));const _0x429fb2=_0x5d4c3d[_0x3e403d(0x213)]||'us01',_0x517f1a=[{'title':_0x3e403d(0x219),'value':_0x3e403d(0x1f3)},{'title':_0x3e403d(0x223),'value':'jp01'},{'title':_0x3e403d(0x1ed),'value':_0x3e403d(0x21b)},{'title':_0x3e403d(0x209),'value':_0x3e403d(0x201)}];let _0x106ac0=_0x517f1a[_0x3e403d(0x210)](_0xb8b4d2=>_0xb8b4d2[_0x3e403d(0x1cf)]===_0x429fb2);_0x106ac0===-0x1&&_0x429fb2!==_0x3e403d(0x1f3)&&(_0x517f1a[_0x3e403d(0x1f5)]({'title':_0x429fb2,'value':_0x429fb2}),_0x106ac0=_0x517f1a[_0x3e403d(0x1db)]-0x1);_0x517f1a[_0x3e403d(0x1f5)]({'title':_0x3e403d(0x1fa),'value':_0x3e403d(0x1e3)});const _0x44e031=_0x5abfff?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x5abfff+'):':_0x3e403d(0x215),_0xac692=await a13_0x30ad0f({'type':_0x3e403d(0x1e0),'name':'site','message':_0x44e031,'choices':_0x517f1a,'initial':_0x106ac0>=0x0?_0x106ac0:0x0});if(!_0xac692[_0x3e403d(0x213)])return console[_0x3e403d(0x1ee)]('\x0aSetup\x20cancelled'),0x1;let _0x46b1cd;if(_0xac692[_0x3e403d(0x213)]==='other'){const _0x2d83fe=await a13_0x30ad0f({'type':'text','name':_0x3e403d(0x1d7),'message':_0x3e403d(0x1f1),'initial':'us01','validate':_0x325c30=>{const _0x34bc38=_0x3e403d;if(!_0x325c30||!_0x325c30[_0x34bc38(0x20e)]())return _0x34bc38(0x1f2);if(!/^[a-z0-9-]+$/[_0x34bc38(0x1da)](_0x325c30[_0x34bc38(0x20e)]()))return _0x34bc38(0x1e5);return!![];}});if(!_0x2d83fe[_0x3e403d(0x1d7)])return console[_0x3e403d(0x1ee)](_0x3e403d(0x212)),0x1;_0x46b1cd=_0x2d83fe[_0x3e403d(0x1d7)];}else _0x46b1cd=_0xac692['site'];const _0x5019c0=resolveSite(_0x46b1cd);console[_0x3e403d(0x1ee)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x5019c0),console[_0x3e403d(0x1ee)](_0x3e403d(0x1d5)),console['log']('\x20\x20'+getConsoleUrl(_0x5019c0,_0x3e403d(0x1ff)));const _0x11035e=await a13_0x30ad0f({'type':_0x3e403d(0x1e9),'name':'apiKey','message':_0x3e403d(0x1d0),'validate':_0xef486c=>{const _0x360173=_0x3e403d;if(!_0xef486c||!_0xef486c['trim']())return _0x360173(0x216);return!![];}});if(!_0x11035e['apiKey'])return console['log'](_0x3e403d(0x212)),0x1;const _0x21bccd=_0x11035e[_0x3e403d(0x221)];console[_0x3e403d(0x1ee)](_0x3e403d(0x207));try{const _0x2507b8=TDX[_0x3e403d(0x202)]({'site':_0x5019c0,'apiKey':_0x21bccd['trim'](),'logLevel':_0x5d4c3d[_0x3e403d(0x21c)]??LogLevel[_0x3e403d(0x1fb)]}),_0x38f8ac=await _0x2507b8['jobs'][_0x3e403d(0x1ef)]();console[_0x3e403d(0x1ee)](_0x3e403d(0x206)+_0x38f8ac[_0x3e403d(0x1f7)]+')');const _0x28117a=await isKeychainAvailable();_0x28117a?(await saveAPIKeyAsync(_0x21bccd[_0x3e403d(0x20e)](),_0x5019c0,_0x5abfff),console[_0x3e403d(0x1ee)](_0x3e403d(0x1df)+(_0x5abfff?_0x3e403d(0x1f9)+_0x5abfff+')':''))):(console[_0x3e403d(0x214)](a13_0x97d37['yellow'](_0x3e403d(0x1d1))),console[_0x3e403d(0x214)](a13_0x97d37[_0x3e403d(0x1d3)]('\x20\x20Set\x20TD_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x5abfff){const _0xeebc7c={'site':_0x5019c0};saveProfileToUserConfig(_0x5abfff,_0xeebc7c),console[_0x3e403d(0x1ee)](_0x3e403d(0x1f8)+_0x5abfff+'\x27\x20registered');}const _0x3accbb=_0x5abfff?'\x20--profile\x20'+_0x5abfff:'';return console['log'](),console[_0x3e403d(0x1ee)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x3e403d(0x1ee)](_0x3e403d(0x1f6)+_0x3accbb+_0x3e403d(0x1e7)),console[_0x3e403d(0x1ee)](_0x3e403d(0x1f6)+_0x3accbb+_0x3e403d(0x222)),0x0;}catch(_0x2620ce){if(_0x2620ce instanceof HTTPClientError&&_0x2620ce[_0x3e403d(0x1d8)]===0x191)return printAuthError(_0x2620ce),0x1;return console['error'](a13_0x97d37['red'](_0x3e403d(0x1e8)+(_0x2620ce instanceof Error?_0x2620ce[_0x3e403d(0x220)]:String(_0x2620ce)))),console[_0x3e403d(0x21f)](_0x3e403d(0x1dd)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a13_0x61e6ed(0x1d9)]=a13_0x61e6ed(0x1d2);[a13_0x61e6ed(0x20d)]=a13_0x61e6ed(0x1eb);async['execute'](_0x4e768d){const _0x4d5611=a13_0x61e6ed,{options:_0x57fbd1,tdx:_0xff2042}=_0x4e768d,_0x55341d=_0x57fbd1[_0x4d5611(0x213)],_0xb780ad=_0x57fbd1['profile'],_0x4361ef=_0xb780ad?_0xb780ad:_0x4d5611(0x205);console[_0x4d5611(0x1ee)]('tdx\x20profile:\x20'+_0x4361ef+_0x4d5611(0x1d6)+_0x55341d+')');const _0x22308b=await resolveAPIKeyAsync(_0x55341d,_0xb780ad);if(_0x22308b){const {source:_0x24db6b,isDeprecated:_0x4ebd41}=_0x22308b,_0xa8adf2='Read\x20credential\x20from\x20'+_0x24db6b;console[_0x4d5611(0x1ee)](_0x4ebd41?a13_0x97d37[_0x4d5611(0x1d3)](_0xa8adf2):_0xa8adf2);}else console['log'](a13_0x97d37[_0x4d5611(0x1d3)](_0x4d5611(0x1fe)));try{const _0x41e95c=await _0xff2042[_0x4d5611(0x1e2)][_0x4d5611(0x1ef)]();return console['log'](a13_0x97d37[_0x4d5611(0x21d)]('✓\x20Authentication\x20successful\x0a')),console[_0x4d5611(0x1ee)](_0x4d5611(0x1f0)+_0x41e95c['email']),(_0x41e95c[_0x4d5611(0x208)]||_0x41e95c[_0x4d5611(0x20c)])&&console[_0x4d5611(0x1ee)](_0x4d5611(0x20a)+[_0x41e95c['first_name'],_0x41e95c[_0x4d5611(0x20c)]][_0x4d5611(0x21e)](Boolean)[_0x4d5611(0x211)]('\x20')),0x0;}catch(_0x29357c){return _0x29357c instanceof HTTPClientError&&_0x29357c[_0x4d5611(0x1d8)]===0x191?printAuthError(_0x29357c,!![],_0xb780ad):console[_0x4d5611(0x21f)](a13_0x97d37['red'](_0x4d5611(0x1e8)+(_0x29357c instanceof Error?_0x29357c[_0x4d5611(0x220)]:String(_0x29357c)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a13_0x61e6ed(0x1d9)]=a13_0x61e6ed(0x1ea);['description']=a13_0x61e6ed(0x1e1);async[a13_0x61e6ed(0x1fd)](_0x3356f2){const _0x33509e=a13_0x61e6ed,{options:_0x341464}=_0x3356f2,_0x545dec=_0x341464['profile'];console[_0x33509e(0x1ee)](a13_0x97d37[_0x33509e(0x1e4)](_0x33509e(0x1f4)));const _0xa07d4a=await isKeychainAvailable();if(!_0xa07d4a)return console['error'](a13_0x97d37[_0x33509e(0x1fc)](_0x33509e(0x1dc))),0x1;const _0x56f10c=await deleteKeychainAPIKey(_0x545dec);return _0x56f10c?(clearCredentialCache(),console[_0x33509e(0x1ee)](_0x33509e(0x1ec)+(_0x545dec?_0x33509e(0x1f9)+_0x545dec+')':'')),0x0):(console[_0x33509e(0x1ee)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x545dec?_0x33509e(0x1e6)+_0x545dec:'')),0x1);}}
@@ -1 +1 @@
1
- function a14_0x244e(_0x167ac9,_0x17433b){const _0x2d953d=a14_0x2d95();return a14_0x244e=function(_0x244ee8,_0x5c92a9){_0x244ee8=_0x244ee8-0xc3;let _0x44404f=_0x2d953d[_0x244ee8];return _0x44404f;},a14_0x244e(_0x167ac9,_0x17433b);}const a14_0x5c8435=a14_0x244e;(function(_0x13f132,_0x3ad170){const _0x2e7aac=a14_0x244e,_0x282bcc=_0x13f132();while(!![]){try{const _0x531d27=parseInt(_0x2e7aac(0xc4))/0x1+-parseInt(_0x2e7aac(0xca))/0x2*(parseInt(_0x2e7aac(0xf5))/0x3)+parseInt(_0x2e7aac(0x100))/0x4+-parseInt(_0x2e7aac(0xdb))/0x5+-parseInt(_0x2e7aac(0xd5))/0x6*(-parseInt(_0x2e7aac(0xde))/0x7)+parseInt(_0x2e7aac(0xe6))/0x8*(-parseInt(_0x2e7aac(0xd3))/0x9)+parseInt(_0x2e7aac(0xf1))/0xa;if(_0x531d27===_0x3ad170)break;else _0x282bcc['push'](_0x282bcc['shift']());}catch(_0x34acb2){_0x282bcc['push'](_0x282bcc['shift']());}}}(a14_0x2d95,0x8b0dc));function a14_0x2d95(){const _0x244273=['Resolving\x20agent\x20\x27','description','\x20\x20Cause:\x20','resolveAgentId','stderr','resolveProjectId','Getting\x20agent\x20for\x20model\x20\x27','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','execute','3467744gdonns','Resolving\x20project\x20\x27','463914KelvGk','output','\x0a[Error:\x20','[Tool\x20result:\x20','chat','verbose','102796uRdFlO','data','log','haiku','\x0a[Tool:\x20','includes','stack','args','stdout','8301456uMUxEL','Continuing\x20chat:\x20','374130TZGniO','Error:\x20','validate','getAgentId','\x0aStack\x20trace:','\x27...','751820JCZtui','chatId','error','35ieITRB','code','llm','CHAT_NOT_FOUND','join','message','agent','model','8qJxZgm','type','metadata','tool_call','\x0a[Output:\x20','tool','write','name','cause','Agent\x20reference\x20must\x20include\x20project\x20name.\x20Usage:\x20--agent\x20\x22Project/Agent\x22','event','6678610hgxjRw','content','handleSSEEvent','streamChat','39iOAlBD','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'];a14_0x2d95=function(){return _0x244273;};return a14_0x2d95();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';import{resolveModelAlias}from'../utils/model-aliases.js';function handleSDKError(_0x5a5042,_0x2a7ea0){const _0xf6422=a14_0x244e;if(_0x5a5042 instanceof SDKError)console[_0xf6422(0xdd)](_0xf6422(0xd6)+_0x5a5042[_0xf6422(0xe3)]),_0x2a7ea0[_0xf6422(0xc9)]&&(_0x5a5042['cause']&&console[_0xf6422(0xdd)](_0xf6422(0xf9)+_0x5a5042[_0xf6422(0xee)]),_0x5a5042[_0xf6422(0xd0)]&&(console[_0xf6422(0xdd)](_0xf6422(0xd9)),console[_0xf6422(0xdd)](_0x5a5042[_0xf6422(0xd0)])));else throw _0x5a5042;}export class ChatCommand extends BaseCommand{[a14_0x5c8435(0xed)]=a14_0x5c8435(0xc8);[a14_0x5c8435(0xf8)]=a14_0x5c8435(0xfe);[a14_0x5c8435(0xd7)](_0x612b1a){const _0x25a433=a14_0x5c8435,_0x41145a=_0x612b1a[_0x25a433(0xd1)][_0x25a433(0xe2)]('\x20');if(!_0x41145a)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a14_0x5c8435(0xf4)](_0x5c1b24,_0x233329,_0x3b6516,_0x3f10b1,_0x378e11){const _0x301a92=a14_0x5c8435;for await(const _0x2dd0ff of _0x5c1b24['llm']['chat'](_0x233329,{'agentId':_0x3b6516,'chatId':_0x3f10b1})){if(_0x2dd0ff['type']===_0x301a92(0xe8)){const _0x2b3e32=_0x2dd0ff[_0x301a92(0xcb)][_0x301a92(0xdc)];saveLastChatId(_0x2b3e32),_0x378e11&&console['error']('Chat\x20session:\x20'+_0x2b3e32);}else _0x2dd0ff[_0x301a92(0xe7)]===_0x301a92(0xf0)&&this[_0x301a92(0xf3)](_0x2dd0ff[_0x301a92(0xcb)]);}}async[a14_0x5c8435(0xd8)](_0xe2d449,_0xd131dd,_0x30f3b0,_0xef9e2c,_0x2e19fb){const _0x1b03f8=a14_0x5c8435;if(_0xd131dd){const {projectName:_0x1a8449,agentName:_0x1abd23}=parseAgentRef(_0xd131dd);if(!_0x1abd23)throw new Error(_0x1b03f8(0xef));const _0x581f4c=await withSpinner(_0x1b03f8(0xc3)+_0x1a8449+_0x1b03f8(0xda),()=>_0xe2d449[_0x1b03f8(0xe0)][_0x1b03f8(0xfc)](_0x1a8449),{'verbose':_0x2e19fb}),_0x48a7a6=await withSpinner(_0x1b03f8(0xf7)+_0x1abd23+_0x1b03f8(0xda),()=>_0xe2d449[_0x1b03f8(0xe0)][_0x1b03f8(0xfa)](_0x1abd23,_0x581f4c[_0x1b03f8(0xcb)]),{'verbose':_0x2e19fb});return _0x48a7a6['data'];}else{const _0x4f6381=_0x30f3b0||_0x1b03f8(0xcd),_0x53a401=resolveModelAlias(_0x4f6381),_0x5e08f3=await withSpinner(_0x1b03f8(0xfd)+_0x53a401+'\x27...',()=>_0xe2d449[_0x1b03f8(0xe0)]['getOrCreateDefaultAgent'](_0x53a401,0x0,_0xef9e2c),{'verbose':_0x2e19fb});return _0x5e08f3[_0x1b03f8(0xcb)]['id'];}}async[a14_0x5c8435(0xff)](_0x194fca){const _0x23be10=a14_0x5c8435,{options:_0x597881,args:_0x46755d,tdx:_0x1cf286}=_0x194fca,_0x29b78a=_0x46755d[_0x23be10(0xe2)]('\x20'),_0x560746=_0x597881,_0x10b1f9=_0x560746[_0x23be10(0xe4)],_0x147d5d=_0x560746[_0x23be10(0xe5)],_0x3bb917=_0x560746['temperature']?Number(_0x560746['temperature']):undefined,_0xfde4ed=_0x560746['new'];try{let _0x3ae7ad,_0x1979d;!_0xfde4ed&&(_0x1979d=loadLastChatId(),_0x1979d&&_0x597881[_0x23be10(0xc9)]&&console[_0x23be10(0xdd)](_0x23be10(0xd4)+_0x1979d));(_0xfde4ed||!_0x1979d)&&(_0x3ae7ad=await this[_0x23be10(0xd8)](_0x1cf286,_0x10b1f9,_0x147d5d,_0x3bb917,_0x597881['verbose']));try{await this['streamChat'](_0x1cf286,_0x29b78a,_0x3ae7ad,_0x1979d,_0x597881[_0x23be10(0xc9)]);}catch(_0x272950){const _0x380cf7=_0x272950 instanceof SDKError&&_0x272950[_0x23be10(0xdf)]===ErrorCode[_0x23be10(0xe1)]||_0x272950 instanceof Error&&_0x272950[_0x23be10(0xe3)][_0x23be10(0xcf)]('404');if(_0x380cf7)_0x597881[_0x23be10(0xc9)]&&console[_0x23be10(0xdd)](_0x23be10(0xf6)),!_0x3ae7ad&&(_0x3ae7ad=await this['getAgentId'](_0x1cf286,_0x10b1f9,_0x147d5d,_0x3bb917,_0x597881[_0x23be10(0xc9)])),await this[_0x23be10(0xf4)](_0x1cf286,_0x29b78a,_0x3ae7ad,undefined,_0x597881[_0x23be10(0xc9)]);else throw _0x272950;}return console[_0x23be10(0xcc)](),0x0;}catch(_0x3454b7){return console[_0x23be10(0xdd)](),handleSDKError(_0x3454b7,_0x597881),0x1;}}[a14_0x5c8435(0xf3)](_0x572c6a){const _0x5724bc=a14_0x5c8435;if(_0x5724bc(0xf2)in _0x572c6a)process[_0x5724bc(0xd2)][_0x5724bc(0xec)](_0x572c6a['content']);else{if(_0x5724bc(0xe9)in _0x572c6a)process[_0x5724bc(0xfb)][_0x5724bc(0xec)](_0x5724bc(0xce)+_0x572c6a[_0x5724bc(0xe9)]['functionName']+']\x0a');else{if(_0x5724bc(0xeb)in _0x572c6a)process['stderr']['write'](_0x5724bc(0xc7)+_0x572c6a[_0x5724bc(0xeb)]['functionName']+']\x0a');else{if(_0x5724bc(0xc5)in _0x572c6a)process[_0x5724bc(0xfb)]['write'](_0x5724bc(0xea)+_0x572c6a[_0x5724bc(0xc5)][_0x5724bc(0xed)]+']\x0a'),process[_0x5724bc(0xfb)][_0x5724bc(0xec)](_0x572c6a['output']['content']+'\x0a');else _0x5724bc(0xdd)in _0x572c6a&&process[_0x5724bc(0xfb)][_0x5724bc(0xec)](_0x5724bc(0xc6)+_0x572c6a[_0x5724bc(0xdd)]+']\x0a');}}}}}
1
+ const a14_0x3ecb57=a14_0x17b7;(function(_0x19b1f2,_0x196797){const _0x3870d2=a14_0x17b7,_0x2aa494=_0x19b1f2();while(!![]){try{const _0x456dfc=parseInt(_0x3870d2(0xa5))/0x1*(-parseInt(_0x3870d2(0x9a))/0x2)+-parseInt(_0x3870d2(0xb2))/0x3+parseInt(_0x3870d2(0xca))/0x4*(parseInt(_0x3870d2(0x97))/0x5)+-parseInt(_0x3870d2(0xb1))/0x6*(-parseInt(_0x3870d2(0xcd))/0x7)+-parseInt(_0x3870d2(0xbb))/0x8+parseInt(_0x3870d2(0xae))/0x9+parseInt(_0x3870d2(0xc5))/0xa;if(_0x456dfc===_0x196797)break;else _0x2aa494['push'](_0x2aa494['shift']());}catch(_0x3d3804){_0x2aa494['push'](_0x2aa494['shift']());}}}(a14_0x5c81,0xa66c0));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a14_0x5c81(){const _0x5c66dd=['description','error','stack','code','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','\x27...','2902995aCMIpN','Agent\x20reference\x20must\x20include\x20project\x20name.\x20Usage:\x20--agent\x20\x22Project/Agent\x22','Getting\x20agent\x20for\x20model\x20\x27','50088eLeCLr','55092ljTozb','cause','tool_call','\x0a[Tool:\x20','functionName','\x0a[Output:\x20','includes','chatId','handleSSEEvent','498208nqUAIF','resolveAgentId','agent','\x20\x20Cause:\x20','log','type','data','streamChat','output','CHAT_NOT_FOUND','432560BStoSj','getAgentId','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','temperature','Error:\x20','892kxfESc','metadata','Continuing\x20chat:\x20','154DTGVnK','17785ICbqLn','write','event','580374ogFRxb','llm','\x0aStack\x20trace:','getOrCreateDefaultAgent','haiku','stdout','verbose','stderr','tool','content','validate','2kAWfgP','\x0a[Error:\x20','join'];a14_0x5c81=function(){return _0x5c66dd;};return a14_0x5c81();}import{parseAgentRef}from'../utils/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';import{resolveModelAlias}from'../utils/model-aliases.js';function a14_0x17b7(_0x243d6c,_0x4fc460){const _0x5c81f1=a14_0x5c81();return a14_0x17b7=function(_0x17b76f,_0x93ab43){_0x17b76f=_0x17b76f-0x97;let _0x21d3e4=_0x5c81f1[_0x17b76f];return _0x21d3e4;},a14_0x17b7(_0x243d6c,_0x4fc460);}function handleSDKError(_0x5a02b0,_0x21f053){const _0x4af90f=a14_0x17b7;if(_0x5a02b0 instanceof SDKError)console['error'](_0x4af90f(0xc9)+_0x5a02b0['message']),_0x21f053[_0x4af90f(0xa0)]&&(_0x5a02b0[_0x4af90f(0xb3)]&&console[_0x4af90f(0xa9)](_0x4af90f(0xbe)+_0x5a02b0['cause']),_0x5a02b0[_0x4af90f(0xaa)]&&(console[_0x4af90f(0xa9)](_0x4af90f(0x9c)),console[_0x4af90f(0xa9)](_0x5a02b0[_0x4af90f(0xaa)])));else throw _0x5a02b0;}export class ChatCommand extends BaseCommand{['name']='chat';[a14_0x3ecb57(0xa8)]=a14_0x3ecb57(0xc7);[a14_0x3ecb57(0xa4)](_0x135420){const _0x171218=a14_0x3ecb57,_0xcf5989=_0x135420['args']['join']('\x20');if(!_0xcf5989)return _0x171218(0xac);return undefined;}async[a14_0x3ecb57(0xc2)](_0x4bd78b,_0x26a4a0,_0x1cf208,_0x5634c3,_0x348e82){const _0x4fb489=a14_0x3ecb57;for await(const _0x15e541 of _0x4bd78b[_0x4fb489(0x9b)]['chat'](_0x26a4a0,{'agentId':_0x1cf208,'chatId':_0x5634c3})){if(_0x15e541['type']===_0x4fb489(0xcb)){const _0x5706d6=_0x15e541['data'][_0x4fb489(0xb9)];saveLastChatId(_0x5706d6),_0x348e82&&console['error']('Chat\x20session:\x20'+_0x5706d6);}else _0x15e541[_0x4fb489(0xc0)]===_0x4fb489(0x99)&&this[_0x4fb489(0xba)](_0x15e541['data']);}}async[a14_0x3ecb57(0xc6)](_0x3d90ce,_0x1cc292,_0x4741a6,_0x4afdce,_0x270cd3){const _0x1a7932=a14_0x3ecb57;if(_0x1cc292){const {projectName:_0x5f3d71,agentName:_0x57098a}=parseAgentRef(_0x1cc292);if(!_0x57098a)throw new Error(_0x1a7932(0xaf));const _0x220b24=await withSpinner('Resolving\x20project\x20\x27'+_0x5f3d71+_0x1a7932(0xad),()=>_0x3d90ce[_0x1a7932(0x9b)]['resolveProjectId'](_0x5f3d71),{'verbose':_0x270cd3}),_0x120c78=await withSpinner('Resolving\x20agent\x20\x27'+_0x57098a+'\x27...',()=>_0x3d90ce['llm'][_0x1a7932(0xbc)](_0x57098a,_0x220b24[_0x1a7932(0xc1)]),{'verbose':_0x270cd3});return _0x120c78[_0x1a7932(0xc1)];}else{const _0x285599=_0x4741a6||_0x1a7932(0x9e),_0x325d96=resolveModelAlias(_0x285599),_0x489ff8=await withSpinner(_0x1a7932(0xb0)+_0x325d96+'\x27...',()=>_0x3d90ce[_0x1a7932(0x9b)][_0x1a7932(0x9d)](_0x325d96,0x0,_0x4afdce),{'verbose':_0x270cd3});return _0x489ff8[_0x1a7932(0xc1)]['id'];}}async['execute'](_0x183490){const _0x30294b=a14_0x3ecb57,{options:_0x2d82bd,args:_0x54a5ac,tdx:_0x4ade34}=_0x183490,_0x1b72fe=_0x54a5ac[_0x30294b(0xa7)]('\x20'),_0x1dafa3=_0x2d82bd,_0x58eed0=_0x1dafa3[_0x30294b(0xbd)],_0x1774a7=_0x1dafa3['model'],_0x34615b=_0x1dafa3[_0x30294b(0xc8)]?Number(_0x1dafa3[_0x30294b(0xc8)]):undefined,_0x2aac33=_0x1dafa3['new'];try{let _0x1ce036,_0x47e7be;!_0x2aac33&&(_0x47e7be=loadLastChatId(),_0x47e7be&&_0x2d82bd[_0x30294b(0xa0)]&&console[_0x30294b(0xa9)](_0x30294b(0xcc)+_0x47e7be));(_0x2aac33||!_0x47e7be)&&(_0x1ce036=await this[_0x30294b(0xc6)](_0x4ade34,_0x58eed0,_0x1774a7,_0x34615b,_0x2d82bd['verbose']));try{await this[_0x30294b(0xc2)](_0x4ade34,_0x1b72fe,_0x1ce036,_0x47e7be,_0x2d82bd['verbose']);}catch(_0x255bbf){const _0x5a7dd8=_0x255bbf instanceof SDKError&&_0x255bbf[_0x30294b(0xab)]===ErrorCode[_0x30294b(0xc4)]||_0x255bbf instanceof Error&&_0x255bbf['message'][_0x30294b(0xb8)]('404');if(_0x5a7dd8)_0x2d82bd['verbose']&&console[_0x30294b(0xa9)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x1ce036&&(_0x1ce036=await this['getAgentId'](_0x4ade34,_0x58eed0,_0x1774a7,_0x34615b,_0x2d82bd[_0x30294b(0xa0)])),await this[_0x30294b(0xc2)](_0x4ade34,_0x1b72fe,_0x1ce036,undefined,_0x2d82bd[_0x30294b(0xa0)]);else throw _0x255bbf;}return console[_0x30294b(0xbf)](),0x0;}catch(_0x32ef76){return console['error'](),handleSDKError(_0x32ef76,_0x2d82bd),0x1;}}[a14_0x3ecb57(0xba)](_0x955995){const _0xd41f66=a14_0x3ecb57;if(_0xd41f66(0xa3)in _0x955995)process[_0xd41f66(0x9f)][_0xd41f66(0x98)](_0x955995[_0xd41f66(0xa3)]);else{if('tool_call'in _0x955995)process[_0xd41f66(0xa1)][_0xd41f66(0x98)](_0xd41f66(0xb5)+_0x955995[_0xd41f66(0xb4)][_0xd41f66(0xb6)]+']\x0a');else{if('tool'in _0x955995)process['stderr']['write']('[Tool\x20result:\x20'+_0x955995[_0xd41f66(0xa2)][_0xd41f66(0xb6)]+']\x0a');else{if(_0xd41f66(0xc3)in _0x955995)process[_0xd41f66(0xa1)][_0xd41f66(0x98)](_0xd41f66(0xb7)+_0x955995['output']['name']+']\x0a'),process[_0xd41f66(0xa1)][_0xd41f66(0x98)](_0x955995[_0xd41f66(0xc3)][_0xd41f66(0xa3)]+'\x0a');else _0xd41f66(0xa9)in _0x955995&&process[_0xd41f66(0xa1)]['write'](_0xd41f66(0xa6)+_0x955995[_0xd41f66(0xa9)]+']\x0a');}}}}}
@@ -1 +1 @@
1
- const a15_0x56649c=a15_0x5d62;(function(_0x3a603b,_0x13eb03){const _0x5e3e94=a15_0x5d62,_0x2eee13=_0x3a603b();while(!![]){try{const _0xe51df=parseInt(_0x5e3e94(0x22b))/0x1*(-parseInt(_0x5e3e94(0x217))/0x2)+parseInt(_0x5e3e94(0x21c))/0x3+parseInt(_0x5e3e94(0x1d2))/0x4+-parseInt(_0x5e3e94(0x21d))/0x5+-parseInt(_0x5e3e94(0x235))/0x6*(parseInt(_0x5e3e94(0x212))/0x7)+-parseInt(_0x5e3e94(0x209))/0x8*(parseInt(_0x5e3e94(0x231))/0x9)+parseInt(_0x5e3e94(0x1d4))/0xa;if(_0xe51df===_0x13eb03)break;else _0x2eee13['push'](_0x2eee13['shift']());}catch(_0x328f75){_0x2eee13['push'](_0x2eee13['shift']());}}}(a15_0x6e33,0x935da));function a15_0x5d62(_0x1960b9,_0x591a61){const _0x6e3369=a15_0x6e33();return a15_0x5d62=function(_0x5d629c,_0x3d38bf){_0x5d629c=_0x5d629c-0x1d0;let _0x5c9c60=_0x6e3369[_0x5d629c];return _0x5c9c60;},a15_0x5d62(_0x1960b9,_0x591a61);}import{spawn}from'node:child_process';import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a15_0x4420a5 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';function handleInstallationError(_0x40f3f0,_0x36b32e,_0x1b9b6b,_0x49a144){const _0x4b725b=a15_0x5d62;errorContains(_0x40f3f0,'already\x20exists',_0x4b725b(0x214),_0x4b725b(0x226))?(_0x1b9b6b['text']='✓\x20'+_0x36b32e+_0x4b725b(0x237),_0x49a144?.[_0x4b725b(0x200)](_0x36b32e+'\x20already\x20configured'),_0x40f3f0 instanceof SDKError&&_0x40f3f0[_0x4b725b(0x1e7)]&&_0x49a144?.['debug'](_0x4b725b(0x207)+_0x40f3f0[_0x4b725b(0x1e7)][_0x4b725b(0x228)])):(_0x1b9b6b['warn'](_0x4b725b(0x1e5)+_0x36b32e),_0x49a144?.[_0x4b725b(0x21f)](_0x36b32e+_0x4b725b(0x23e),_0x40f3f0));}async function executeClaudeCommand(_0x40d818,_0x3f3ffc,_0x26758a){const _0x4c8300=a15_0x5d62;return _0x26758a?.['info'](_0x4c8300(0x1d7)+_0x40d818[_0x4c8300(0x1e8)]('\x20')),new Promise((_0xb9eff7,_0x402c55)=>{const _0x2c7ada=_0x4c8300,_0x4a4290=spawn(_0x2c7ada(0x1df),_0x40d818,{'stdio':'pipe'});let _0x16e4db='',_0x5462f1='';_0x4a4290[_0x2c7ada(0x210)]['on'](_0x2c7ada(0x1ec),_0xc30769=>{const _0x18c025=_0x2c7ada;_0x16e4db+=_0xc30769[_0x18c025(0x239)]();}),_0x4a4290[_0x2c7ada(0x230)]['on']('data',_0x45d9b1=>{const _0x3a1fc9=_0x2c7ada;_0x5462f1+=_0x45d9b1[_0x3a1fc9(0x239)]();}),_0x4a4290['on'](_0x2c7ada(0x241),_0x199a97=>{const _0x4239d6=_0x2c7ada;if(_0x199a97===0x0)_0xb9eff7(_0x16e4db);else _0x3f3ffc?(_0x26758a?.[_0x4239d6(0x21f)](_0x4239d6(0x1e3)+_0x199a97+_0x4239d6(0x1e1)+_0x40d818[_0x4239d6(0x1e8)]('\x20')),_0x402c55(new SDKError(ErrorCode[_0x4239d6(0x238)],_0x3f3ffc,new Error(_0x5462f1)))):_0xb9eff7('');});});}function a15_0x6e33(){const _0x103212=['\x20configuration\x20failed','✓\x20Plugin\x20\x27','Configuring\x20marketplace\x20\x27','exit','ANTHROPIC_BASE_URL','Configuring\x20MCP\x20server\x20\x27','Setup\x20failed','object','utf-8','td-docs','1166716WNPJjO','inherit','37342860mmAbgH','server','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Executing:\x20claude\x20','http://127.0.0.1:','127.0.0.1','settings.local.json','name','log','tdx\x20--profile\x20','env','claude','https://github.com/treasure-data/td-skills','):\x20claude\x20','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Command\x20failed\x20(exit\x20','which','Warning:\x20Failed\x20to\x20configure\x20','attributes','cause','join','Updating\x20marketplace\x20\x27','COMMAND_NOT_FOUND','close','data','cwd','https://docs.treasuredata.com/mcp','tdx','Creating\x20.claude/settings.local.json...','string','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','\x27...','red','logLevel','verbose','TD\x20Docs\x20MCP\x20Server','site','stringify','description','tdx-skills','Finding\x20available\x20port...','includes','marketplace','Initializing\x20proxy\x20logger...','info','✓\x20MCP\x20server\x20\x27','hostname','getOrCreateDefaultProject','command','http','Failed\x20to\x20install\x20plugin\x20\x27','Command\x20output:\x20','--transport','8uLbfeP','sonnet','stop','workflow-skills','start','Setting\x20up\x20project...','\x20claude\x20statusline','stdout','Claude\x20Code\x20CLI\x20not\x20found','7lfPmdD','logger','already\x20installed','ANTHROPIC_MODEL','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','4fHXQhJ','statusLine','text','✓\x20Logging\x20to\x20','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','441165sISlWm','408840mVzkbG','fail','error','✓\x20Marketplace\x20\x27','originalSettings','execute','td-skills','Initializing...','green','already\x20configured','getLogPath','message','sql-skills','profile','593153eSAUwA','plugin','td-skills\x20Plugins','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','add','stderr','10370403bJZZjj','Failed\x20to\x20update\x20marketplace\x20\x27','update','✓\x20Using\x20project:\x20','6894414CzeAud','parse','\x20already\x20configured','INSTALLATION_FAILED','toString','trim','Failed\x20to\x20configure\x20marketplace\x20\x27','findClaudePath','.claude'];a15_0x6e33=function(){return _0x103212;};return a15_0x6e33();}async function ensureMcpServer(_0xa364,_0xd14bc1,_0x1a7e08,_0x50bb3d,_0x521386){const _0xb80c14=a15_0x5d62;_0x50bb3d['text']=_0xb80c14(0x243)+_0xa364+_0xb80c14(0x1f3),await executeClaudeCommand(['mcp',_0xb80c14(0x22f),_0xa364,_0xd14bc1,_0xb80c14(0x208),_0x1a7e08],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0xa364+'\x27',_0x521386),_0x50bb3d[_0xb80c14(0x219)]=_0xb80c14(0x201)+_0xa364+'\x27\x20configured';}async function ensureMarketplace(_0x5e0308,_0x19f2af,_0x61689a,_0x3a220e){const _0x14aa5a=a15_0x5d62;_0x61689a[_0x14aa5a(0x219)]=_0x14aa5a(0x240)+_0x5e0308+_0x14aa5a(0x1f3),await executeClaudeCommand([_0x14aa5a(0x22c),_0x14aa5a(0x1fe),'add',_0x19f2af],_0x14aa5a(0x23b)+_0x5e0308+'\x27',_0x3a220e),_0x61689a[_0x14aa5a(0x219)]='✓\x20Marketplace\x20\x27'+_0x5e0308+'\x27\x20configured';}async function updateMarketplace(_0x2e8cf5,_0xfbe984,_0x4a0a9a){const _0x5ccec9=a15_0x5d62;_0xfbe984['text']=_0x5ccec9(0x1e9)+_0x2e8cf5+_0x5ccec9(0x1f3),await executeClaudeCommand([_0x5ccec9(0x22c),'marketplace',_0x5ccec9(0x233)],_0x5ccec9(0x232)+_0x2e8cf5+'\x27',_0x4a0a9a),_0xfbe984[_0x5ccec9(0x219)]=_0x5ccec9(0x220)+_0x2e8cf5+'\x27\x20updated';}async function ensurePlugin(_0x4c75e6,_0x48d0f3,_0x311d34,_0x2aace0){const _0x158aa4=a15_0x5d62;_0x311d34[_0x158aa4(0x219)]='Installing\x20plugin\x20\x27'+_0x4c75e6+'\x27...',await executeClaudeCommand(['plugin','install',_0x4c75e6+'@'+_0x48d0f3],_0x158aa4(0x206)+_0x4c75e6+'\x27',_0x2aace0),_0x311d34[_0x158aa4(0x219)]=_0x158aa4(0x23f)+_0x4c75e6+'\x27\x20installed';}async function createClaudeSettings(_0x5abe0e,_0x3955ab='sonnet',_0x494ddc){const _0x2359e4=a15_0x5d62,_0x45d152=join(process[_0x2359e4(0x1ed)](),_0x2359e4(0x23d)),_0x5a9c09=join(_0x45d152,_0x2359e4(0x1da));await mkdir(_0x45d152,{'recursive':!![]});let _0x48f786={};if(existsSync(_0x5a9c09))try{const _0x44d016=await readFile(_0x5a9c09,_0x2359e4(0x1d0));_0x48f786=JSON[_0x2359e4(0x236)](_0x44d016);}catch{_0x48f786={};}const _0xf5a561=_0x48f786[_0x2359e4(0x1de)]||{},_0x48d00a={'ANTHROPIC_BASE_URL':_0xf5a561['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0xf5a561[_0x2359e4(0x215)],'statusLine':_0x48f786[_0x2359e4(0x218)]},_0x2876e7={..._0x48f786,'env':{..._0xf5a561,'ANTHROPIC_BASE_URL':_0x2359e4(0x1d8)+_0x5abe0e,'ANTHROPIC_MODEL':_0x3955ab},'statusLine':{'type':_0x2359e4(0x204),'command':_0x494ddc?_0x2359e4(0x1dd)+_0x494ddc+_0x2359e4(0x20f):'tdx\x20claude\x20statusline'}};return await writeFile(_0x5a9c09,JSON[_0x2359e4(0x1f9)](_0x2876e7,null,0x2)+'\x0a'),_0x48d00a;}async function restoreClaudeSettings(_0x3290cf){const _0x5aa09c=a15_0x5d62,_0x454d86=join(process[_0x5aa09c(0x1ed)](),_0x5aa09c(0x23d)),_0x26c02c=join(_0x454d86,'settings.local.json');if(!existsSync(_0x26c02c))return;try{const _0x3e847c=await readFile(_0x26c02c,_0x5aa09c(0x1d0)),_0x224145=JSON['parse'](_0x3e847c),_0x67177c=_0x224145[_0x5aa09c(0x1de)]||{},_0x41fbad=_0x67177c[_0x5aa09c(0x242)],_0x21740f=((()=>{const _0x384781=_0x5aa09c;if(typeof _0x41fbad!=='string')return![];try{const _0x28872f=new URL(_0x41fbad);return _0x28872f['hostname']==='localhost'||_0x28872f[_0x384781(0x202)]===_0x384781(0x1d9);}catch{return![];}})());_0x21740f?(delete _0x67177c['ANTHROPIC_BASE_URL'],delete _0x67177c[_0x5aa09c(0x215)]):(_0x3290cf[_0x5aa09c(0x242)]!==undefined?_0x67177c[_0x5aa09c(0x242)]=_0x3290cf[_0x5aa09c(0x242)]:delete _0x67177c[_0x5aa09c(0x242)],_0x3290cf[_0x5aa09c(0x215)]!==undefined?_0x67177c['ANTHROPIC_MODEL']=_0x3290cf[_0x5aa09c(0x215)]:delete _0x67177c[_0x5aa09c(0x215)]);const _0x392aa1=_0x224145[_0x5aa09c(0x218)],_0x466123=((()=>{const _0x1ced26=_0x5aa09c;if(!_0x392aa1||typeof _0x392aa1!==_0x1ced26(0x245))return![];if(_0x392aa1['type']!==_0x1ced26(0x204))return![];if(typeof _0x392aa1[_0x1ced26(0x204)]!==_0x1ced26(0x1f1))return![];return _0x392aa1[_0x1ced26(0x204)][_0x1ced26(0x1fd)](_0x1ced26(0x1ef))&&_0x392aa1[_0x1ced26(0x204)]['includes']('statusline');})());if(_0x466123)delete _0x224145['statusLine'];else _0x3290cf[_0x5aa09c(0x218)]!==undefined?_0x224145[_0x5aa09c(0x218)]=_0x3290cf[_0x5aa09c(0x218)]:delete _0x224145['statusLine'];_0x224145[_0x5aa09c(0x1de)]=_0x67177c,await writeFile(_0x26c02c,JSON['stringify'](_0x224145,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a15_0x56649c(0x1df);[a15_0x56649c(0x1fa)]=a15_0x56649c(0x216);[a15_0x56649c(0x1d5)];[a15_0x56649c(0x221)];[a15_0x56649c(0x213)];async[a15_0x56649c(0x222)](_0x4cefca){const _0x343c4a=a15_0x56649c,{tdx:_0x488e1a,options:_0x54ffd5,args:_0x28f7cb}=_0x4cefca;try{const _0x8c522=_0x54ffd5,_0x56749f=_0x8c522['model']||_0x343c4a(0x20a),_0x347d59=_0x8c522['proxy']===![],_0x2bc346=createCommandSpinner(_0x343c4a(0x224),{'verbose':_0x54ffd5[_0x343c4a(0x1f6)]});_0x2bc346[_0x343c4a(0x20d)]();try{if(!_0x347d59){_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x1fc);const _0x5571d7=await findAvailablePort(0xfa0);_0x2bc346[_0x343c4a(0x219)]='✓\x20Port\x20'+_0x5571d7,_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x20e);const _0x204583=await _0x488e1a['llm'][_0x343c4a(0x203)](),_0x349875=_0x204583['id'];_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x234)+_0x204583[_0x343c4a(0x1e6)][_0x343c4a(0x1db)],_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x1ff),this[_0x343c4a(0x213)]=new TDXLogger(_0x54ffd5[_0x343c4a(0x1f5)],!![]),await this[_0x343c4a(0x213)]['init']();const _0x33ddc9=this['logger'][_0x343c4a(0x227)]();_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x21a)+_0x33ddc9,_0x2bc346[_0x343c4a(0x219)]='Starting\x20TD\x20LLM\x20proxy\x20server...',this[_0x343c4a(0x1d5)]=new ProxyServer({'port':_0x5571d7,'projectId':_0x349875,'tdx':_0x488e1a,'logger':this[_0x343c4a(0x213)],'site':_0x54ffd5[_0x343c4a(0x1f8)]}),await this['server'][_0x343c4a(0x20d)](),_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x22e)+_0x5571d7,_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x1f0);const _0x3f622d=_0x54ffd5[_0x343c4a(0x22a)];this[_0x343c4a(0x221)]=await createClaudeSettings(_0x5571d7,_0x56749f,_0x3f622d),_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x1e2);}else _0x2bc346['text']=_0x343c4a(0x1d6);try{await ensureMcpServer(_0x343c4a(0x1d1),_0x343c4a(0x1ee),_0x343c4a(0x205),_0x2bc346,this[_0x343c4a(0x213)]);}catch(_0x282090){handleInstallationError(_0x282090,_0x343c4a(0x1f7),_0x2bc346,this[_0x343c4a(0x213)]);}try{await ensureMarketplace(_0x343c4a(0x223),_0x343c4a(0x1e0),_0x2bc346,this[_0x343c4a(0x213)]),await updateMarketplace(_0x343c4a(0x223),_0x2bc346,this['logger']),await ensurePlugin(_0x343c4a(0x229),_0x343c4a(0x223),_0x2bc346,this[_0x343c4a(0x213)]),await ensurePlugin(_0x343c4a(0x20c),_0x343c4a(0x223),_0x2bc346,this[_0x343c4a(0x213)]),await ensurePlugin(_0x343c4a(0x1fb),'td-skills',_0x2bc346,this[_0x343c4a(0x213)]);}catch(_0x2bda67){handleInstallationError(_0x2bda67,_0x343c4a(0x22d),_0x2bc346,this['logger']);}_0x2bc346[_0x343c4a(0x20b)]();}catch(_0x4ab3ac){_0x2bc346[_0x343c4a(0x21e)](_0x343c4a(0x244));throw _0x4ab3ac;}const _0x26b550=await this[_0x343c4a(0x23c)]();if(!_0x26b550)throw new SDKError(ErrorCode[_0x343c4a(0x1ea)],_0x343c4a(0x211),undefined,{'helpText':_0x343c4a(0x21b)});const _0x4fa8bd=spawn(_0x26b550,_0x28f7cb,{'stdio':_0x343c4a(0x1d3)}),_0x4c5031=await new Promise(_0x2cf756=>{const _0x1e76f4=_0x343c4a;_0x4fa8bd['on']('exit',_0x3d8500=>{_0x2cf756(_0x3d8500||0x0);}),_0x4fa8bd['on'](_0x1e76f4(0x21f),_0x593eb1=>{const _0x4ae59b=_0x1e76f4;console['error'](a15_0x4420a5[_0x4ae59b(0x1f4)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x593eb1[_0x4ae59b(0x228)])),_0x2cf756(0x1);});});this[_0x343c4a(0x1d5)]&&(await this['server'][_0x343c4a(0x20b)](),console[_0x343c4a(0x1dc)](a15_0x4420a5[_0x343c4a(0x225)](_0x343c4a(0x1f2))));if(this[_0x343c4a(0x213)]){await this[_0x343c4a(0x213)][_0x343c4a(0x1eb)]();const _0x4f1e40=this[_0x343c4a(0x213)]['getLogPath']();console[_0x343c4a(0x1dc)](a15_0x4420a5[_0x343c4a(0x225)]('✓\x20Logs\x20saved\x20to\x20'+_0x4f1e40));}return this[_0x343c4a(0x221)]&&(await restoreClaudeSettings(this[_0x343c4a(0x221)]),console[_0x343c4a(0x1dc)](a15_0x4420a5['green']('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x4c5031;}catch(_0x4babe1){this[_0x343c4a(0x1d5)]&&await this[_0x343c4a(0x1d5)][_0x343c4a(0x20b)]();this[_0x343c4a(0x213)]&&await this[_0x343c4a(0x213)][_0x343c4a(0x1eb)]();this[_0x343c4a(0x221)]&&await restoreClaudeSettings(this[_0x343c4a(0x221)]);throw _0x4babe1;}}async[a15_0x56649c(0x23c)](){return new Promise(_0x58a01b=>{const _0x3d1321=a15_0x5d62,_0x517edd=spawn(_0x3d1321(0x1e4),[_0x3d1321(0x1df)]);let _0x73769d='';_0x517edd[_0x3d1321(0x210)]['on'](_0x3d1321(0x1ec),_0xe5921b=>{const _0x93910d=_0x3d1321;_0x73769d+=_0xe5921b[_0x93910d(0x239)]();}),_0x517edd['on'](_0x3d1321(0x241),_0x2df89d=>{const _0x1a1c0c=_0x3d1321;_0x2df89d===0x0&&_0x73769d[_0x1a1c0c(0x23a)]()?_0x58a01b(_0x73769d['trim']()):_0x58a01b('claude');});});}}
1
+ const a15_0x3e9a59=a15_0x10ea;(function(_0x2e3b98,_0x5ce9f5){const _0x89a795=a15_0x10ea,_0x4e9efb=_0x2e3b98();while(!![]){try{const _0x431a5e=parseInt(_0x89a795(0x12f))/0x1+parseInt(_0x89a795(0x109))/0x2*(-parseInt(_0x89a795(0x130))/0x3)+parseInt(_0x89a795(0x169))/0x4+parseInt(_0x89a795(0x162))/0x5+-parseInt(_0x89a795(0x14a))/0x6+parseInt(_0x89a795(0x166))/0x7*(-parseInt(_0x89a795(0x120))/0x8)+parseInt(_0x89a795(0x165))/0x9;if(_0x431a5e===_0x5ce9f5)break;else _0x4e9efb['push'](_0x4e9efb['shift']());}catch(_0x5811dc){_0x4e9efb['push'](_0x4e9efb['shift']());}}}(a15_0x3307,0x622b0));import{spawn}from'node:child_process';import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';function a15_0x10ea(_0x1f7f88,_0x3efefc){const _0x330725=a15_0x3307();return a15_0x10ea=function(_0x10ea78,_0x17f423){_0x10ea78=_0x10ea78-0x102;let _0x30b755=_0x330725[_0x10ea78];return _0x30b755;},a15_0x10ea(_0x1f7f88,_0x3efefc);}import a15_0xad2387 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';function handleInstallationError(_0x5789b7,_0x3436a6,_0x127445,_0x326206){const _0x14fd77=a15_0x10ea;errorContains(_0x5789b7,'already\x20exists',_0x14fd77(0x11a),_0x14fd77(0x128))?(_0x127445[_0x14fd77(0x106)]='✓\x20'+_0x3436a6+'\x20already\x20configured',_0x326206?.['info'](_0x3436a6+_0x14fd77(0x13a)),_0x5789b7 instanceof SDKError&&_0x5789b7[_0x14fd77(0x168)]&&_0x326206?.[_0x14fd77(0x12c)](_0x14fd77(0x14c)+_0x5789b7[_0x14fd77(0x168)][_0x14fd77(0x15e)])):(_0x127445['warn'](_0x14fd77(0x159)+_0x3436a6),_0x326206?.[_0x14fd77(0x148)](_0x3436a6+'\x20configuration\x20failed',_0x5789b7));}async function executeClaudeCommand(_0x28a4f0,_0x17fda9,_0x1dc94c){const _0x553c35=a15_0x10ea;return _0x1dc94c?.['info'](_0x553c35(0x155)+_0x28a4f0[_0x553c35(0x12a)]('\x20')),new Promise((_0x2d1f60,_0x2e35f6)=>{const _0x4e1a13=_0x553c35,_0x233397=spawn(_0x4e1a13(0x11d),_0x28a4f0,{'stdio':_0x4e1a13(0x112)});let _0x547e18='',_0x234a74='';_0x233397[_0x4e1a13(0x122)]['on'](_0x4e1a13(0x10b),_0x187c86=>{const _0x4fbf37=_0x4e1a13;_0x547e18+=_0x187c86[_0x4fbf37(0x164)]();}),_0x233397['stderr']['on'](_0x4e1a13(0x10b),_0xbec67f=>{const _0x53ac26=_0x4e1a13;_0x234a74+=_0xbec67f[_0x53ac26(0x164)]();}),_0x233397['on'](_0x4e1a13(0x137),_0xf5a9aa=>{const _0xedf155=_0x4e1a13;if(_0xf5a9aa===0x0)_0x2d1f60(_0x547e18);else _0x17fda9?(_0x1dc94c?.[_0xedf155(0x148)]('Command\x20failed\x20(exit\x20'+_0xf5a9aa+_0xedf155(0x158)+_0x28a4f0['join']('\x20')),_0x2e35f6(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x17fda9,new Error(_0x234a74)))):_0x2d1f60('');});});}function a15_0x3307(){const _0x4f19a6=['text','Finding\x20available\x20port...','statusLine','26xlVCFY','which','data','✓\x20Marketplace\x20\x27','Initializing...','cwd','start','model','attributes','pipe','http','Installing\x20plugin\x20\x27','https://github.com/treasure-data/td-skills','\x27\x20configured','\x27\x20installed','✓\x20Plugin\x20\x27','✓\x20Settings\x20restored:\x20.claude/settings.local.json','already\x20installed','includes','http://127.0.0.1:','claude','stop','✓\x20Settings\x20configured:\x20.claude/settings.local.json','8eXUaGW','Creating\x20.claude/settings.local.json...','stdout','tdx\x20claude\x20statusline','td-skills','Configuring\x20marketplace\x20\x27','trim','type','already\x20configured','ANTHROPIC_BASE_URL','join','td-skills\x20Plugins','debug','tdx','server','133142kCDPVP','100767aREpoJ','Failed\x20to\x20launch\x20Claude\x20Code:\x20','originalSettings','✓\x20Port\x20','getLogPath','green','logger','exit','parse','description','\x20already\x20configured','sonnet','td-docs','utf-8','update','\x27\x20updated','✓\x20Logging\x20to\x20','proxy','verbose','settings.local.json','Starting\x20TD\x20LLM\x20proxy\x20server...','Setting\x20up\x20project...','object','TD\x20Docs\x20MCP\x20Server','error','log','525516ZbnZra','stringify','Command\x20output:\x20','red','✓\x20Logs\x20saved\x20to\x20','inherit','\x20claude\x20statusline','Failed\x20to\x20configure\x20marketplace\x20\x27','findClaudePath','tdx\x20--profile\x20','site','Executing:\x20claude\x20','Initializing\x20proxy\x20logger...','sql-skills','):\x20claude\x20','Warning:\x20Failed\x20to\x20configure\x20','\x27...','profile','close','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','message','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','command','localhost','3159335MkINrG','Updating\x20marketplace\x20\x27','toString','7592490nSlhpM','5059691BMfcCU','.claude','cause','162132uxLQYK','name','init','logLevel','tdx-skills','Configuring\x20MCP\x20server\x20\x27','add','Setup\x20failed','ANTHROPIC_MODEL','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','plugin','workflow-skills','marketplace','Failed\x20to\x20update\x20marketplace\x20\x27','hostname','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','env','COMMAND_NOT_FOUND'];a15_0x3307=function(){return _0x4f19a6;};return a15_0x3307();}async function ensureMcpServer(_0x474f79,_0x20fac7,_0x174aa9,_0x4ab550,_0x309b7c){const _0x33c5f6=a15_0x10ea;_0x4ab550[_0x33c5f6(0x106)]=_0x33c5f6(0x16e)+_0x474f79+'\x27...',await executeClaudeCommand(['mcp',_0x33c5f6(0x16f),_0x474f79,_0x20fac7,'--transport',_0x174aa9],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x474f79+'\x27',_0x309b7c),_0x4ab550[_0x33c5f6(0x106)]='✓\x20MCP\x20server\x20\x27'+_0x474f79+_0x33c5f6(0x116);}async function ensureMarketplace(_0x171eb2,_0x397105,_0x175135,_0x122be9){const _0x2b6424=a15_0x10ea;_0x175135['text']=_0x2b6424(0x125)+_0x171eb2+'\x27...',await executeClaudeCommand(['plugin',_0x2b6424(0x175),_0x2b6424(0x16f),_0x397105],_0x2b6424(0x151)+_0x171eb2+'\x27',_0x122be9),_0x175135[_0x2b6424(0x106)]=_0x2b6424(0x10c)+_0x171eb2+_0x2b6424(0x116);}async function updateMarketplace(_0x1943bb,_0x982fab,_0x40ac72){const _0x481363=a15_0x10ea;_0x982fab[_0x481363(0x106)]=_0x481363(0x163)+_0x1943bb+_0x481363(0x15a),await executeClaudeCommand([_0x481363(0x173),_0x481363(0x175),_0x481363(0x13e)],_0x481363(0x176)+_0x1943bb+'\x27',_0x40ac72),_0x982fab[_0x481363(0x106)]=_0x481363(0x10c)+_0x1943bb+_0x481363(0x13f);}async function ensurePlugin(_0x14a3ef,_0x3bf6c3,_0x59bca1,_0x5d8dc7){const _0x5ac901=a15_0x10ea;_0x59bca1['text']=_0x5ac901(0x114)+_0x14a3ef+_0x5ac901(0x15a),await executeClaudeCommand([_0x5ac901(0x173),'install',_0x14a3ef+'@'+_0x3bf6c3],'Failed\x20to\x20install\x20plugin\x20\x27'+_0x14a3ef+'\x27',_0x5d8dc7),_0x59bca1[_0x5ac901(0x106)]=_0x5ac901(0x118)+_0x14a3ef+_0x5ac901(0x117);}async function createClaudeSettings(_0x3deaa7,_0x169938=a15_0x3e9a59(0x13b),_0xe86328){const _0x3ccaa5=a15_0x3e9a59,_0x501917=join(process['cwd'](),'.claude'),_0x1ccbc7=join(_0x501917,_0x3ccaa5(0x143));await mkdir(_0x501917,{'recursive':!![]});let _0x3a1443={};if(existsSync(_0x1ccbc7))try{const _0x56e31a=await readFile(_0x1ccbc7,_0x3ccaa5(0x13d));_0x3a1443=JSON[_0x3ccaa5(0x138)](_0x56e31a);}catch{_0x3a1443={};}const _0x3e9435=_0x3a1443[_0x3ccaa5(0x104)]||{},_0x2a9531={'ANTHROPIC_BASE_URL':_0x3e9435[_0x3ccaa5(0x129)],'ANTHROPIC_MODEL':_0x3e9435[_0x3ccaa5(0x171)],'statusLine':_0x3a1443['statusLine']},_0x38b8ab={..._0x3a1443,'env':{..._0x3e9435,'ANTHROPIC_BASE_URL':_0x3ccaa5(0x11c)+_0x3deaa7,'ANTHROPIC_MODEL':_0x169938},'statusLine':{'type':_0x3ccaa5(0x160),'command':_0xe86328?_0x3ccaa5(0x153)+_0xe86328+_0x3ccaa5(0x150):_0x3ccaa5(0x123)}};return await writeFile(_0x1ccbc7,JSON['stringify'](_0x38b8ab,null,0x2)+'\x0a'),_0x2a9531;}async function restoreClaudeSettings(_0x4178c2){const _0x35c295=a15_0x3e9a59,_0x111214=join(process[_0x35c295(0x10e)](),_0x35c295(0x167)),_0x2c0601=join(_0x111214,_0x35c295(0x143));if(!existsSync(_0x2c0601))return;try{const _0x596540=await readFile(_0x2c0601,_0x35c295(0x13d)),_0x55b08e=JSON['parse'](_0x596540),_0x467912=_0x55b08e['env']||{},_0x2ca225=_0x467912[_0x35c295(0x129)],_0xead39c=((()=>{const _0x284fe8=_0x35c295;if(typeof _0x2ca225!=='string')return![];try{const _0x58be38=new URL(_0x2ca225);return _0x58be38[_0x284fe8(0x102)]===_0x284fe8(0x161)||_0x58be38['hostname']==='127.0.0.1';}catch{return![];}})());_0xead39c?(delete _0x467912[_0x35c295(0x129)],delete _0x467912[_0x35c295(0x171)]):(_0x4178c2['ANTHROPIC_BASE_URL']!==undefined?_0x467912[_0x35c295(0x129)]=_0x4178c2['ANTHROPIC_BASE_URL']:delete _0x467912[_0x35c295(0x129)],_0x4178c2['ANTHROPIC_MODEL']!==undefined?_0x467912['ANTHROPIC_MODEL']=_0x4178c2[_0x35c295(0x171)]:delete _0x467912['ANTHROPIC_MODEL']);const _0x1eab1e=_0x55b08e[_0x35c295(0x108)],_0x1bb27d=((()=>{const _0x5c96ac=_0x35c295;if(!_0x1eab1e||typeof _0x1eab1e!==_0x5c96ac(0x146))return![];if(_0x1eab1e[_0x5c96ac(0x127)]!==_0x5c96ac(0x160))return![];if(typeof _0x1eab1e['command']!=='string')return![];return _0x1eab1e[_0x5c96ac(0x160)][_0x5c96ac(0x11b)](_0x5c96ac(0x12d))&&_0x1eab1e[_0x5c96ac(0x160)][_0x5c96ac(0x11b)]('statusline');})());if(_0x1bb27d)delete _0x55b08e[_0x35c295(0x108)];else _0x4178c2[_0x35c295(0x108)]!==undefined?_0x55b08e['statusLine']=_0x4178c2[_0x35c295(0x108)]:delete _0x55b08e[_0x35c295(0x108)];_0x55b08e['env']=_0x467912,await writeFile(_0x2c0601,JSON[_0x35c295(0x14b)](_0x55b08e,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a15_0x3e9a59(0x16a)]=a15_0x3e9a59(0x11d);[a15_0x3e9a59(0x139)]=a15_0x3e9a59(0x15f);[a15_0x3e9a59(0x12e)];[a15_0x3e9a59(0x132)];[a15_0x3e9a59(0x136)];async['execute'](_0x1fc638){const _0x51d9c3=a15_0x3e9a59,{tdx:_0x543321,options:_0x4c92ac,args:_0x4977aa}=_0x1fc638;try{const _0x227045=_0x4c92ac,_0x350158=_0x227045[_0x51d9c3(0x110)]||'sonnet',_0x4aec57=_0x227045[_0x51d9c3(0x141)]===![],_0x3a2c6b=createCommandSpinner(_0x51d9c3(0x10d),{'verbose':_0x4c92ac[_0x51d9c3(0x142)]});_0x3a2c6b[_0x51d9c3(0x10f)]();try{if(!_0x4aec57){_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x107);const _0x1afcbe=await findAvailablePort(0xfa0);_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x133)+_0x1afcbe,_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x145);const _0x1480b1=await _0x543321['llm']['getOrCreateDefaultProject'](),_0x2b2bd0=_0x1480b1['id'];_0x3a2c6b[_0x51d9c3(0x106)]='✓\x20Using\x20project:\x20'+_0x1480b1[_0x51d9c3(0x111)][_0x51d9c3(0x16a)],_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x156),this[_0x51d9c3(0x136)]=new TDXLogger(_0x4c92ac[_0x51d9c3(0x16c)],!![]),await this['logger'][_0x51d9c3(0x16b)]();const _0x2c5c0c=this[_0x51d9c3(0x136)][_0x51d9c3(0x134)]();_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x140)+_0x2c5c0c,_0x3a2c6b['text']=_0x51d9c3(0x144),this[_0x51d9c3(0x12e)]=new ProxyServer({'port':_0x1afcbe,'projectId':_0x2b2bd0,'tdx':_0x543321,'logger':this[_0x51d9c3(0x136)],'site':_0x4c92ac[_0x51d9c3(0x154)]}),await this[_0x51d9c3(0x12e)][_0x51d9c3(0x10f)](),_0x3a2c6b['text']=_0x51d9c3(0x172)+_0x1afcbe,_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x121);const _0x40710c=_0x4c92ac[_0x51d9c3(0x15b)];this[_0x51d9c3(0x132)]=await createClaudeSettings(_0x1afcbe,_0x350158,_0x40710c),_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x11f);}else _0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x103);try{await ensureMcpServer(_0x51d9c3(0x13c),'https://docs.treasuredata.com/mcp',_0x51d9c3(0x113),_0x3a2c6b,this[_0x51d9c3(0x136)]);}catch(_0x14441a){handleInstallationError(_0x14441a,_0x51d9c3(0x147),_0x3a2c6b,this[_0x51d9c3(0x136)]);}try{await ensureMarketplace(_0x51d9c3(0x124),_0x51d9c3(0x115),_0x3a2c6b,this['logger']),await updateMarketplace(_0x51d9c3(0x124),_0x3a2c6b,this['logger']),await ensurePlugin(_0x51d9c3(0x157),_0x51d9c3(0x124),_0x3a2c6b,this['logger']),await ensurePlugin(_0x51d9c3(0x174),_0x51d9c3(0x124),_0x3a2c6b,this[_0x51d9c3(0x136)]),await ensurePlugin(_0x51d9c3(0x16d),_0x51d9c3(0x124),_0x3a2c6b,this['logger']);}catch(_0x41e076){handleInstallationError(_0x41e076,_0x51d9c3(0x12b),_0x3a2c6b,this[_0x51d9c3(0x136)]);}_0x3a2c6b[_0x51d9c3(0x11e)]();}catch(_0x348d99){_0x3a2c6b['fail'](_0x51d9c3(0x170));throw _0x348d99;}const _0x23c594=await this[_0x51d9c3(0x152)]();if(!_0x23c594)throw new SDKError(ErrorCode[_0x51d9c3(0x105)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x51d9c3(0x15d)});const _0x29e7cc=spawn(_0x23c594,_0x4977aa,{'stdio':_0x51d9c3(0x14f)}),_0x5da4ae=await new Promise(_0x1f78fa=>{const _0x48c3be=_0x51d9c3;_0x29e7cc['on'](_0x48c3be(0x137),_0x5c699d=>{_0x1f78fa(_0x5c699d||0x0);}),_0x29e7cc['on'](_0x48c3be(0x148),_0x80bb8c=>{const _0x37df12=_0x48c3be;console[_0x37df12(0x148)](a15_0xad2387[_0x37df12(0x14d)](_0x37df12(0x131)+_0x80bb8c[_0x37df12(0x15e)])),_0x1f78fa(0x1);});});this[_0x51d9c3(0x12e)]&&(await this[_0x51d9c3(0x12e)][_0x51d9c3(0x11e)](),console[_0x51d9c3(0x149)](a15_0xad2387[_0x51d9c3(0x135)]('✓\x20TD\x20LLM\x20proxy\x20server\x20stopped')));if(this['logger']){await this['logger'][_0x51d9c3(0x15c)]();const _0x20d019=this[_0x51d9c3(0x136)][_0x51d9c3(0x134)]();console['log'](a15_0xad2387[_0x51d9c3(0x135)](_0x51d9c3(0x14e)+_0x20d019));}return this[_0x51d9c3(0x132)]&&(await restoreClaudeSettings(this[_0x51d9c3(0x132)]),console[_0x51d9c3(0x149)](a15_0xad2387['green'](_0x51d9c3(0x119)))),_0x5da4ae;}catch(_0x2cf513){this[_0x51d9c3(0x12e)]&&await this[_0x51d9c3(0x12e)][_0x51d9c3(0x11e)]();this[_0x51d9c3(0x136)]&&await this[_0x51d9c3(0x136)]['close']();this[_0x51d9c3(0x132)]&&await restoreClaudeSettings(this[_0x51d9c3(0x132)]);throw _0x2cf513;}}async['findClaudePath'](){return new Promise(_0xb1343a=>{const _0x3b0331=a15_0x10ea,_0x7a533e=spawn(_0x3b0331(0x10a),[_0x3b0331(0x11d)]);let _0x2d8965='';_0x7a533e[_0x3b0331(0x122)]['on'](_0x3b0331(0x10b),_0x488cf0=>{const _0x46c3dc=_0x3b0331;_0x2d8965+=_0x488cf0[_0x46c3dc(0x164)]();}),_0x7a533e['on'](_0x3b0331(0x137),_0x845212=>{const _0x51de7c=_0x3b0331;_0x845212===0x0&&_0x2d8965[_0x51de7c(0x126)]()?_0xb1343a(_0x2d8965['trim']()):_0xb1343a(_0x51de7c(0x11d));});});}}
@@ -1 +1 @@
1
- const a16_0x4149f5=a16_0x1539;(function(_0x29255f,_0x34e303){const _0x1155bb=a16_0x1539,_0xaf1940=_0x29255f();while(!![]){try{const _0x15dc9c=parseInt(_0x1155bb(0x150))/0x1+parseInt(_0x1155bb(0x15b))/0x2*(parseInt(_0x1155bb(0x13d))/0x3)+parseInt(_0x1155bb(0x143))/0x4+-parseInt(_0x1155bb(0x14f))/0x5*(parseInt(_0x1155bb(0x14d))/0x6)+parseInt(_0x1155bb(0x151))/0x7*(parseInt(_0x1155bb(0x156))/0x8)+parseInt(_0x1155bb(0x140))/0x9*(parseInt(_0x1155bb(0x142))/0xa)+-parseInt(_0x1155bb(0x158))/0xb*(parseInt(_0x1155bb(0x14e))/0xc);if(_0x15dc9c===_0x34e303)break;else _0xaf1940['push'](_0xaf1940['shift']());}catch(_0x4fc4bf){_0xaf1940['push'](_0xaf1940['shift']());}}}(a16_0x4943,0x73e06));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../utils/model-factors.js';function a16_0x1539(_0x294232,_0x2f8515){const _0x4943e6=a16_0x4943();return a16_0x1539=function(_0x153965,_0x1c7f44){_0x153965=_0x153965-0x13a;let _0x5e1c7e=_0x4943e6[_0x153965];return _0x5e1c7e;},a16_0x1539(_0x294232,_0x2f8515);}async function readStdinJson(_0xe91c93=0x64){return new Promise(_0x56b022=>{const _0x1dd38d=a16_0x1539;let _0x514620='',_0x4f86a9=![];const _0x48096c=createInterface({'input':process[_0x1dd38d(0x147)],'terminal':![]}),_0x3725e0=_0x31dd13=>{if(_0x4f86a9)return;_0x4f86a9=!![],clearTimeout(_0x30f442),_0x48096c['close'](),_0x56b022(_0x31dd13);},_0x30f442=setTimeout(()=>{_0x3725e0(null);},_0xe91c93);_0x48096c['on']('line',_0x474b0f=>{_0x514620+=_0x474b0f;}),_0x48096c['on']('close',()=>{const _0x473f7e=_0x1dd38d;if(_0x4f86a9)return;try{const _0x4edb45=JSON[_0x473f7e(0x13a)](_0x514620);_0x3725e0(_0x4edb45);}catch{_0x3725e0(null);}});});}function a16_0x4943(){const _0x51c7a9=['332870ZZTWMJ','353983GcMeDs','98MMhufm','statusline','join','log','session_id','358528WOuVTK','monthCredits','188210dJpAnC','model','name','120342CIDDsy','\x20today\x20/\x20','parse','options','description','15axBvxc','Claude','profile','258939tDdtFS','🤖\x20tdx\x20-\x20Claude','10LNSRrZ','3080284xgRrXc','sessionCredits','🤖\x20tdx\x20-\x20','\x20session\x20/\x20','stdin','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','🪙\x20credit:\x20','todayCredits','latestInputTokens','push','6mYupjx','1080orKbaR'];a16_0x4943=function(){return _0x51c7a9;};return a16_0x4943();}function formatCredits(_0x563770){return _0x563770['toFixed'](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a16_0x4149f5(0x15a)]=a16_0x4149f5(0x152);[a16_0x4149f5(0x13c)]=a16_0x4149f5(0x148);async['execute'](_0x598479){const _0x1d1a60=a16_0x4149f5;try{const _0x2a67be=await readStdinJson();if(!_0x2a67be?.[_0x1d1a60(0x155)])return console[_0x1d1a60(0x154)](_0x1d1a60(0x141)),0x0;const _0x6d9af0=_0x2a67be[_0x1d1a60(0x155)],_0x57bc6a=_0x2a67be[_0x1d1a60(0x159)]?.['id']||'',_0x54713f=_0x2a67be[_0x1d1a60(0x13f)]||_0x598479[_0x1d1a60(0x13b)][_0x1d1a60(0x13f)],_0x21119c=await getUsageStats(_0x6d9af0,_0x54713f),_0x36c450=[],_0x21b35b=_0x57bc6a?getModelDisplayName(_0x57bc6a):_0x1d1a60(0x13e);_0x36c450['push'](_0x1d1a60(0x145)+_0x21b35b);const _0x42b857=formatCredits(_0x21119c[_0x1d1a60(0x144)]),_0x743111=formatCredits(_0x21119c[_0x1d1a60(0x14a)]),_0x54d273=formatCredits(_0x21119c[_0x1d1a60(0x157)]);_0x36c450[_0x1d1a60(0x14c)](_0x1d1a60(0x149)+_0x42b857+_0x1d1a60(0x146)+_0x743111+_0x1d1a60(0x15c)+_0x54d273+'\x20month');if(_0x21119c[_0x1d1a60(0x14b)]>0x0&&_0x57bc6a){const _0x3cf432=formatTokenCount(_0x21119c['latestInputTokens']),_0x33fbfa=calculateContextPercentage(_0x21119c['latestInputTokens'],_0x57bc6a);_0x36c450['push']('🧠\x20'+_0x3cf432+'\x20('+_0x33fbfa+'%)');}return console['log'](_0x36c450[_0x1d1a60(0x153)]('\x20|\x20')),0x0;}catch{return console['log']('🤖\x20tdx\x20-\x20Claude'),0x0;}}}
1
+ const a16_0x5472f4=a16_0x4d28;(function(_0x16543f,_0x1a991f){const _0xe1936b=a16_0x4d28,_0x3ea0c5=_0x16543f();while(!![]){try{const _0xb83cc=-parseInt(_0xe1936b(0xf2))/0x1*(-parseInt(_0xe1936b(0x113))/0x2)+-parseInt(_0xe1936b(0xf1))/0x3*(-parseInt(_0xe1936b(0xf3))/0x4)+parseInt(_0xe1936b(0x105))/0x5*(-parseInt(_0xe1936b(0x10a))/0x6)+parseInt(_0xe1936b(0x10b))/0x7+parseInt(_0xe1936b(0x10f))/0x8+parseInt(_0xe1936b(0xfe))/0x9*(parseInt(_0xe1936b(0x102))/0xa)+parseInt(_0xe1936b(0x10e))/0xb*(-parseInt(_0xe1936b(0xf0))/0xc);if(_0xb83cc===_0x1a991f)break;else _0x3ea0c5['push'](_0x3ea0c5['shift']());}catch(_0x1a8db2){_0x3ea0c5['push'](_0x3ea0c5['shift']());}}}(a16_0x2c44,0xc2d11));import{createInterface}from'node:readline';function a16_0x2c44(){const _0x531723=['model','close','join','175950khdivA','statusline','log','3190hjsIFz','🤖\x20tdx\x20-\x20','parse','stdin','name','5358IeGMml','6532932cqASef','execute','description','34272821KKbtaP','6040488MJdYPm','todayCredits','monthCredits','toFixed','2XaROBR','\x20today\x20/\x20','12NfrkkG','3018867cIvqSF','240428RKMryE','4QDebRx','\x20session\x20/\x20','\x20month','latestInputTokens','🤖\x20tdx\x20-\x20Claude','profile','push','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','🧠\x20','🪙\x20credit:\x20','session_id','792VNTkvu'];a16_0x2c44=function(){return _0x531723;};return a16_0x2c44();}import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../utils/model-factors.js';function a16_0x4d28(_0x230a76,_0x5da0c0){const _0x2c44bb=a16_0x2c44();return a16_0x4d28=function(_0x4d288c,_0x4bab83){_0x4d288c=_0x4d288c-0xf0;let _0x129583=_0x2c44bb[_0x4d288c];return _0x129583;},a16_0x4d28(_0x230a76,_0x5da0c0);}async function readStdinJson(_0x1d8345=0x64){return new Promise(_0x700107=>{const _0x45b0f1=a16_0x4d28;let _0x439507='',_0x3ddf22=![];const _0x293896=createInterface({'input':process[_0x45b0f1(0x108)],'terminal':![]}),_0x23f9db=_0x12f911=>{const _0x14d25e=_0x45b0f1;if(_0x3ddf22)return;_0x3ddf22=!![],clearTimeout(_0x100cd7),_0x293896[_0x14d25e(0x100)](),_0x700107(_0x12f911);},_0x100cd7=setTimeout(()=>{_0x23f9db(null);},_0x1d8345);_0x293896['on']('line',_0x1c14a5=>{_0x439507+=_0x1c14a5;}),_0x293896['on'](_0x45b0f1(0x100),()=>{const _0x6c5bb7=_0x45b0f1;if(_0x3ddf22)return;try{const _0x4b5c3c=JSON[_0x6c5bb7(0x107)](_0x439507);_0x23f9db(_0x4b5c3c);}catch{_0x23f9db(null);}});});}function formatCredits(_0x2cb15c){const _0x36bda8=a16_0x4d28;return _0x2cb15c[_0x36bda8(0x112)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a16_0x5472f4(0x109)]=a16_0x5472f4(0x103);[a16_0x5472f4(0x10d)]=a16_0x5472f4(0xfa);async[a16_0x5472f4(0x10c)](_0x20ace5){const _0xae97fc=a16_0x5472f4;try{const _0x948250=await readStdinJson();if(!_0x948250?.[_0xae97fc(0xfd)])return console[_0xae97fc(0x104)](_0xae97fc(0xf7)),0x0;const _0x198681=_0x948250['session_id'],_0x25ce21=_0x948250[_0xae97fc(0xff)]?.['id']||'',_0x30b771=_0x948250[_0xae97fc(0xf8)]||_0x20ace5['options'][_0xae97fc(0xf8)],_0x2741d0=await getUsageStats(_0x198681,_0x30b771),_0xdb1438=[],_0x554629=_0x25ce21?getModelDisplayName(_0x25ce21):'Claude';_0xdb1438[_0xae97fc(0xf9)](_0xae97fc(0x106)+_0x554629);const _0x44cd45=formatCredits(_0x2741d0['sessionCredits']),_0x15fb9a=formatCredits(_0x2741d0[_0xae97fc(0x110)]),_0x189c80=formatCredits(_0x2741d0[_0xae97fc(0x111)]);_0xdb1438['push'](_0xae97fc(0xfc)+_0x44cd45+_0xae97fc(0xf4)+_0x15fb9a+_0xae97fc(0x114)+_0x189c80+_0xae97fc(0xf5));if(_0x2741d0[_0xae97fc(0xf6)]>0x0&&_0x25ce21){const _0x1eab1a=formatTokenCount(_0x2741d0[_0xae97fc(0xf6)]),_0x15a2f5=calculateContextPercentage(_0x2741d0[_0xae97fc(0xf6)],_0x25ce21);_0xdb1438['push'](_0xae97fc(0xfb)+_0x1eab1a+'\x20('+_0x15a2f5+'%)');}return console['log'](_0xdb1438[_0xae97fc(0x101)]('\x20|\x20')),0x0;}catch{return console[_0xae97fc(0x104)](_0xae97fc(0xf7)),0x0;}}}
@@ -1 +1 @@
1
- const a17_0x145f1b=a17_0x18d9;(function(_0x210baa,_0x17f551){const _0x5a0991=a17_0x18d9,_0x5a05b3=_0x210baa();while(!![]){try{const _0x4ffc88=-parseInt(_0x5a0991(0x1ee))/0x1+parseInt(_0x5a0991(0x1e6))/0x2+-parseInt(_0x5a0991(0x206))/0x3*(parseInt(_0x5a0991(0x1ed))/0x4)+-parseInt(_0x5a0991(0x1f6))/0x5*(-parseInt(_0x5a0991(0x21b))/0x6)+parseInt(_0x5a0991(0x205))/0x7*(-parseInt(_0x5a0991(0x1e8))/0x8)+parseInt(_0x5a0991(0x202))/0x9+-parseInt(_0x5a0991(0x1f7))/0xa*(-parseInt(_0x5a0991(0x1f3))/0xb);if(_0x4ffc88===_0x17f551)break;else _0x5a05b3['push'](_0x5a05b3['shift']());}catch(_0x482a91){_0x5a05b3['push'](_0x5a05b3['shift']());}}}(a17_0x444a,0x65f34));import a17_0x25cc12 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function a17_0x18d9(_0x3cdf9c,_0x1ffd18){const _0x444add=a17_0x444a();return a17_0x18d9=function(_0x18d969,_0x565c44){_0x18d969=_0x18d969-0x1e4;let _0x1cf6fe=_0x444add[_0x18d969];return _0x1cf6fe;},a17_0x18d9(_0x3cdf9c,_0x1ffd18);}function a17_0x444a(){const _0x37db45=['usage','getTime','padEnd','Unknown\x20error','padStart','Credits','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','default','never','\x20days\x20ago','\x20\x20Month:\x20\x20\x20','dim','\x20\x20Total:\x20\x20\x20','today\x20','outputTable','numeric','outputStructured','Usage\x20by\x20Profile','profile','1392QcfdNg','credits','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','toLocaleDateString','log','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','620316bVmxIQ','yesterday','107576tTKhGV','entryCount','2-digit','totalCredits','profileCount','457416gWBGwY','363594rLsrYk','todayCredits','execute','bold','repeat','76340WLIdJG','Profile','description','11185jjOUsC','370Upxcig','Requests','message','json','(default)','length','\x20\x20Today:\x20\x20\x20','error','name','cyan','en-CA','1858176pEcjHZ','\x20credits','map','28BkCtog','12wttRru','en-US'];a17_0x444a=function(){return _0x37db45;};return a17_0x444a();}function formatCredits(_0x572878){return _0x572878['toFixed'](0x2);}function formatLastUsed(_0x12f939){const _0x205c4c=a17_0x18d9;if(!_0x12f939)return _0x205c4c(0x210);const _0x474894=new Date(_0x12f939),_0x18b359=new Date(),_0x34aa25=_0x474894['toLocaleDateString'](_0x205c4c(0x201)),_0x154334=_0x18b359[_0x205c4c(0x21e)](_0x205c4c(0x201));if(_0x34aa25===_0x154334)return _0x205c4c(0x215)+_0x474894['toLocaleTimeString'](_0x205c4c(0x207),{'hour':_0x205c4c(0x1ea),'minute':_0x205c4c(0x1ea)});const _0x5d2f18=new Date(_0x34aa25),_0x36f549=new Date(_0x154334),_0x4c3f95=Math['round']((_0x36f549[_0x205c4c(0x209)]()-_0x5d2f18['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x4c3f95===0x1)return _0x205c4c(0x1e7);else return _0x4c3f95>0x1&&_0x4c3f95<0x7?_0x4c3f95+_0x205c4c(0x211):_0x474894['toLocaleDateString'](_0x205c4c(0x207),{'month':'short','day':_0x205c4c(0x217)});}export class ClaudeUsageCommand extends BaseCommand{[a17_0x145f1b(0x1ff)]=a17_0x145f1b(0x208);[a17_0x145f1b(0x1f5)]=a17_0x145f1b(0x20e);async[a17_0x145f1b(0x1f0)](_0x5e17c3){const _0x8b234e=a17_0x145f1b,{options:_0x516fec}=_0x5e17c3,_0x1dbdf9=_0x516fec['format']==='json'||_0x516fec['format']==='jsonl'||_0x516fec[_0x8b234e(0x1fa)];try{const [_0x286a90,_0x465934]=await Promise['all']([getAllProfileStats(),getUsageSummary()]);return _0x1dbdf9?await this[_0x8b234e(0x218)](_0x286a90,_0x465934,_0x516fec):this[_0x8b234e(0x216)](_0x286a90,_0x465934),0x0;}catch(_0x382923){const _0x75fa20=_0x382923 instanceof Error?_0x382923[_0x8b234e(0x1f9)]:_0x8b234e(0x20b);return console[_0x8b234e(0x1fe)](a17_0x25cc12['red']('Error:\x20'+_0x75fa20)),0x1;}}async[a17_0x145f1b(0x218)](_0x484ed2,_0x5b6e70,_0x27c711){const _0x556258=a17_0x145f1b,_0x4b6440={'summary':{'todayCredits':_0x5b6e70[_0x556258(0x1ef)],'monthCredits':_0x5b6e70['monthCredits'],'totalCredits':_0x5b6e70[_0x556258(0x1eb)],'profileCount':_0x5b6e70[_0x556258(0x1ec)]},'profiles':_0x484ed2[_0x556258(0x204)](_0xc9847=>({'profile':_0xc9847[_0x556258(0x21a)],'credits':_0xc9847[_0x556258(0x21c)],'requests':_0xc9847[_0x556258(0x1e9)],'lastUsedAt':_0xc9847['lastUsedAt']}))};await handleSDKOutput([_0x4b6440],_0x27c711);}[a17_0x145f1b(0x216)](_0x3f92ae,_0x1bb655){const _0x5a9a12=a17_0x145f1b;console['log'](a17_0x25cc12[_0x5a9a12(0x1f1)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console[_0x5a9a12(0x1e4)](a17_0x25cc12[_0x5a9a12(0x213)]('─'[_0x5a9a12(0x1f2)](0x32))),console[_0x5a9a12(0x1e4)](_0x5a9a12(0x1fd)+a17_0x25cc12[_0x5a9a12(0x200)](formatCredits(_0x1bb655[_0x5a9a12(0x1ef)]))+_0x5a9a12(0x203)),console[_0x5a9a12(0x1e4)](_0x5a9a12(0x212)+a17_0x25cc12['cyan'](formatCredits(_0x1bb655['monthCredits']))+_0x5a9a12(0x203)),console['log'](_0x5a9a12(0x214)+a17_0x25cc12[_0x5a9a12(0x200)](formatCredits(_0x1bb655['totalCredits']))+_0x5a9a12(0x203)),console['log']();if(_0x3f92ae['length']===0x0){console[_0x5a9a12(0x1e4)](a17_0x25cc12[_0x5a9a12(0x213)](_0x5a9a12(0x21d))),console['log'](a17_0x25cc12['dim'](_0x5a9a12(0x1e5)));return;}console[_0x5a9a12(0x1e4)](a17_0x25cc12[_0x5a9a12(0x1f1)](_0x5a9a12(0x219))),console[_0x5a9a12(0x1e4)](a17_0x25cc12[_0x5a9a12(0x213)]('─'[_0x5a9a12(0x1f2)](0x3c)));const _0x28c970=Math['max'](0xc,..._0x3f92ae[_0x5a9a12(0x204)](_0x262016=>_0x262016[_0x5a9a12(0x21a)]===_0x5a9a12(0x20f)?_0x5a9a12(0x1fb)[_0x5a9a12(0x1fc)]:_0x262016[_0x5a9a12(0x21a)][_0x5a9a12(0x1fc)])),_0x106b78=0xa,_0x461522=0xa;console[_0x5a9a12(0x1e4)]('\x20\x20'+_0x5a9a12(0x1f4)[_0x5a9a12(0x20a)](_0x28c970)+'\x20\x20'+_0x5a9a12(0x20d)[_0x5a9a12(0x20c)](_0x106b78)+'\x20\x20'+_0x5a9a12(0x1f8)[_0x5a9a12(0x20c)](_0x461522)+'\x20\x20'+'Last\x20Used');for(const _0x528399 of _0x3f92ae){const _0x43153c=_0x528399[_0x5a9a12(0x21a)]===_0x5a9a12(0x20f)?_0x5a9a12(0x1fb):_0x528399[_0x5a9a12(0x21a)],_0x51e8e2=_0x43153c['padEnd'](_0x28c970),_0x2d347e=_0x528399['profile']===_0x5a9a12(0x20f)?a17_0x25cc12[_0x5a9a12(0x213)](_0x51e8e2):_0x51e8e2;console[_0x5a9a12(0x1e4)]('\x20\x20'+_0x2d347e+'\x20\x20'+a17_0x25cc12['cyan'](formatCredits(_0x528399['credits'])[_0x5a9a12(0x20c)](_0x106b78))+'\x20\x20'+String(_0x528399[_0x5a9a12(0x1e9)])[_0x5a9a12(0x20c)](_0x461522)+'\x20\x20'+a17_0x25cc12[_0x5a9a12(0x213)](formatLastUsed(_0x528399['lastUsedAt'])));}console[_0x5a9a12(0x1e4)](),console['log'](a17_0x25cc12[_0x5a9a12(0x213)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x5a9a12(0x1e4)]();}}
1
+ const a17_0x482877=a17_0x1911;function a17_0x1911(_0xe20f49,_0x81c041){const _0x4930b2=a17_0x4930();return a17_0x1911=function(_0x1911ae,_0x42418a){_0x1911ae=_0x1911ae-0x13a;let _0x403208=_0x4930b2[_0x1911ae];return _0x403208;},a17_0x1911(_0xe20f49,_0x81c041);}(function(_0x2913f2,_0x3887f2){const _0x188c57=a17_0x1911,_0x579ad4=_0x2913f2();while(!![]){try{const _0x1992c8=-parseInt(_0x188c57(0x15d))/0x1+-parseInt(_0x188c57(0x147))/0x2*(-parseInt(_0x188c57(0x16a))/0x3)+-parseInt(_0x188c57(0x161))/0x4+-parseInt(_0x188c57(0x174))/0x5*(parseInt(_0x188c57(0x162))/0x6)+-parseInt(_0x188c57(0x16e))/0x7*(parseInt(_0x188c57(0x145))/0x8)+-parseInt(_0x188c57(0x140))/0x9+parseInt(_0x188c57(0x172))/0xa;if(_0x1992c8===_0x3887f2)break;else _0x579ad4['push'](_0x579ad4['shift']());}catch(_0xbba1af){_0x579ad4['push'](_0x579ad4['shift']());}}}(a17_0x4930,0xce3a6));import a17_0x401deb from'chalk';import{BaseCommand}from'./command.js';function a17_0x4930(){const _0x5de4b7=['1361112mYeLpm','6BFqOzB','Unknown\x20error','en-US','Credits','red','\x20credits','en-CA','Error:\x20','78FZjfht','json','log','cyan','1241149kYqoTG','yesterday','length','\x20\x20Total:\x20\x20\x20','40129070rdlrSN','Usage\x20by\x20Profile','1429595uAWTlW','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','\x20\x20Month:\x20\x20\x20','getTime','monthCredits','toLocaleDateString','format','numeric','execute','round','13608666WRzezO','all','outputTable','credits','never','8cilmSl','padStart','49400QmgWvz','(default)','profile','toFixed','\x20\x20Today:\x20\x20\x20','error','repeat','max','bold','outputStructured','default','description','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','Last\x20Used','today\x20','jsonl','message','toLocaleTimeString','entryCount','totalCredits','todayCredits','dim','1494819VMseya','lastUsedAt','padEnd','\x20\x20No\x20usage\x20data\x20recorded\x20yet.'];a17_0x4930=function(){return _0x5de4b7;};return a17_0x4930();}import{handleSDKOutput}from'../utils/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0xd5b63c){const _0xda77e7=a17_0x1911;return _0xd5b63c[_0xda77e7(0x14a)](0x2);}function formatLastUsed(_0x255e51){const _0x29a6ec=a17_0x1911;if(!_0x255e51)return _0x29a6ec(0x144);const _0xe0a8c2=new Date(_0x255e51),_0x25b9e4=new Date(),_0x83d838=_0xe0a8c2[_0x29a6ec(0x13b)]('en-CA'),_0x554197=_0x25b9e4['toLocaleDateString'](_0x29a6ec(0x168));if(_0x83d838===_0x554197)return _0x29a6ec(0x155)+_0xe0a8c2[_0x29a6ec(0x158)]('en-US',{'hour':'2-digit','minute':'2-digit'});const _0xd0e516=new Date(_0x83d838),_0x185ce3=new Date(_0x554197),_0x50a193=Math[_0x29a6ec(0x13f)]((_0x185ce3[_0x29a6ec(0x177)]()-_0xd0e516['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x50a193===0x1)return _0x29a6ec(0x16f);else return _0x50a193>0x1&&_0x50a193<0x7?_0x50a193+'\x20days\x20ago':_0xe0a8c2[_0x29a6ec(0x13b)](_0x29a6ec(0x164),{'month':'short','day':_0x29a6ec(0x13d)});}export class ClaudeUsageCommand extends BaseCommand{['name']='usage';[a17_0x482877(0x152)]=a17_0x482877(0x153);async[a17_0x482877(0x13e)](_0x36f3ea){const _0x48b4c8=a17_0x482877,{options:_0x2c89a2}=_0x36f3ea,_0x3b91c0=_0x2c89a2[_0x48b4c8(0x13c)]===_0x48b4c8(0x16b)||_0x2c89a2[_0x48b4c8(0x13c)]===_0x48b4c8(0x156)||_0x2c89a2[_0x48b4c8(0x16b)];try{const [_0x50ac9f,_0x58b757]=await Promise[_0x48b4c8(0x141)]([getAllProfileStats(),getUsageSummary()]);return _0x3b91c0?await this[_0x48b4c8(0x150)](_0x50ac9f,_0x58b757,_0x2c89a2):this[_0x48b4c8(0x142)](_0x50ac9f,_0x58b757),0x0;}catch(_0x277874){const _0x3563aa=_0x277874 instanceof Error?_0x277874[_0x48b4c8(0x157)]:_0x48b4c8(0x163);return console[_0x48b4c8(0x14c)](a17_0x401deb[_0x48b4c8(0x166)](_0x48b4c8(0x169)+_0x3563aa)),0x1;}}async[a17_0x482877(0x150)](_0x31d859,_0x25d942,_0x1d057c){const _0x1a6270=a17_0x482877,_0x54dc00={'summary':{'todayCredits':_0x25d942[_0x1a6270(0x15b)],'monthCredits':_0x25d942[_0x1a6270(0x13a)],'totalCredits':_0x25d942[_0x1a6270(0x15a)],'profileCount':_0x25d942['profileCount']},'profiles':_0x31d859['map'](_0x5e0908=>({'profile':_0x5e0908[_0x1a6270(0x149)],'credits':_0x5e0908['credits'],'requests':_0x5e0908[_0x1a6270(0x159)],'lastUsedAt':_0x5e0908[_0x1a6270(0x15e)]}))};await handleSDKOutput([_0x54dc00],_0x1d057c);}[a17_0x482877(0x142)](_0x1e4dcc,_0x24013b){const _0x3b772e=a17_0x482877;console[_0x3b772e(0x16c)](a17_0x401deb[_0x3b772e(0x14f)](_0x3b772e(0x175))),console['log'](a17_0x401deb[_0x3b772e(0x15c)]('─'[_0x3b772e(0x14d)](0x32))),console[_0x3b772e(0x16c)](_0x3b772e(0x14b)+a17_0x401deb[_0x3b772e(0x16d)](formatCredits(_0x24013b[_0x3b772e(0x15b)]))+_0x3b772e(0x167)),console['log'](_0x3b772e(0x176)+a17_0x401deb[_0x3b772e(0x16d)](formatCredits(_0x24013b[_0x3b772e(0x13a)]))+_0x3b772e(0x167)),console[_0x3b772e(0x16c)](_0x3b772e(0x171)+a17_0x401deb['cyan'](formatCredits(_0x24013b[_0x3b772e(0x15a)]))+_0x3b772e(0x167)),console[_0x3b772e(0x16c)]();if(_0x1e4dcc['length']===0x0){console[_0x3b772e(0x16c)](a17_0x401deb['dim'](_0x3b772e(0x160))),console[_0x3b772e(0x16c)](a17_0x401deb[_0x3b772e(0x15c)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x3b772e(0x16c)](a17_0x401deb['bold'](_0x3b772e(0x173))),console[_0x3b772e(0x16c)](a17_0x401deb[_0x3b772e(0x15c)]('─'['repeat'](0x3c)));const _0x35af43=Math[_0x3b772e(0x14e)](0xc,..._0x1e4dcc['map'](_0x1bfd8f=>_0x1bfd8f[_0x3b772e(0x149)]===_0x3b772e(0x151)?_0x3b772e(0x148)[_0x3b772e(0x170)]:_0x1bfd8f[_0x3b772e(0x149)]['length'])),_0x1f51c8=0xa,_0x58eca8=0xa;console[_0x3b772e(0x16c)]('\x20\x20'+'Profile'[_0x3b772e(0x15f)](_0x35af43)+'\x20\x20'+_0x3b772e(0x165)[_0x3b772e(0x146)](_0x1f51c8)+'\x20\x20'+'Requests'['padStart'](_0x58eca8)+'\x20\x20'+_0x3b772e(0x154));for(const _0x26b051 of _0x1e4dcc){const _0x1b6fc6=_0x26b051[_0x3b772e(0x149)]===_0x3b772e(0x151)?_0x3b772e(0x148):_0x26b051['profile'],_0x436e5f=_0x1b6fc6[_0x3b772e(0x15f)](_0x35af43),_0x1e47c4=_0x26b051[_0x3b772e(0x149)]===_0x3b772e(0x151)?a17_0x401deb[_0x3b772e(0x15c)](_0x436e5f):_0x436e5f;console[_0x3b772e(0x16c)]('\x20\x20'+_0x1e47c4+'\x20\x20'+a17_0x401deb[_0x3b772e(0x16d)](formatCredits(_0x26b051[_0x3b772e(0x143)])[_0x3b772e(0x146)](_0x1f51c8))+'\x20\x20'+String(_0x26b051['entryCount'])[_0x3b772e(0x146)](_0x58eca8)+'\x20\x20'+a17_0x401deb[_0x3b772e(0x15c)](formatLastUsed(_0x26b051[_0x3b772e(0x15e)])));}console['log'](),console[_0x3b772e(0x16c)](a17_0x401deb[_0x3b772e(0x15c)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console['log']();}}
@@ -1 +1 @@
1
- const a18_0x2d5056=a18_0x4728;(function(_0xd1dddd,_0x5ca90c){const _0x5eafcb=a18_0x4728,_0x23007f=_0xd1dddd();while(!![]){try{const _0x2ca1b8=parseInt(_0x5eafcb(0x1a7))/0x1*(-parseInt(_0x5eafcb(0x1a4))/0x2)+parseInt(_0x5eafcb(0x1ad))/0x3+parseInt(_0x5eafcb(0x1b8))/0x4+parseInt(_0x5eafcb(0x1a1))/0x5+parseInt(_0x5eafcb(0x1bc))/0x6*(parseInt(_0x5eafcb(0x1b7))/0x7)+parseInt(_0x5eafcb(0x19d))/0x8+parseInt(_0x5eafcb(0x199))/0x9*(-parseInt(_0x5eafcb(0x19b))/0xa);if(_0x2ca1b8===_0x5ca90c)break;else _0x23007f['push'](_0x23007f['shift']());}catch(_0xc1e761){_0x23007f['push'](_0x23007f['shift']());}}}(a18_0x5ddf,0x6073e));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../client/http-client.js';function a18_0x5ddf(){const _0x39aef7=['414TEgQOz','isValid','320410UWExAD','Authentication\x20failed','4779384RWHVZd','\x0aTo\x20set\x20up\x20authentication:','profile','error','3568035VzOJyw','options','Command\x20\x27','2gtZBBj','\x0aStack\x20trace:\x0a','number','600311jYBzCT','helpText','stack','USER_ERROR','values','category','2132751kWZOLS','test','validate','\x20--profile\x20','.\x20Must\x20be\x20a\x20number.','logger','problemDetails','value','\x20\x20tdx\x20auth','tdx','18760vIrgFT','1671360iOyPgw','get','Error:\x20','debug','66SlhHlD','red','message','limit','detail','validateGlobalOptions','yellow','Invalid\x20limit\x20value:\x20','Reason:\x20','name','To\x20check\x20your\x20current\x20auth\x20status:','from','commands','status','set','has'];a18_0x5ddf=function(){return _0x39aef7;};return a18_0x5ddf();}import{SDKError,ErrorCategory}from'../sdk/errors.js';function a18_0x4728(_0x4079c1,_0x95627f){const _0x5ddf83=a18_0x5ddf();return a18_0x4728=function(_0x472823,_0x1340ba){_0x472823=_0x472823-0x191;let _0x54fff5=_0x5ddf83[_0x472823];return _0x54fff5;},a18_0x4728(_0x4079c1,_0x95627f);}import a18_0x4abad7 from'chalk';export function printAuthError(_0x2a9268,_0x2925e1=![],_0x397669){const _0x131d4d=a18_0x4728,_0xb3544e=_0x2a9268[_0x131d4d(0x1b3)]?.[_0x131d4d(0x1c0)]||_0x2a9268[_0x131d4d(0x1be)];console[_0x131d4d(0x1a0)](a18_0x4abad7['red'](_0x131d4d(0x19c))),console['error'](a18_0x4abad7[_0x131d4d(0x1bd)](_0x131d4d(0x191)+_0xb3544e));if(_0x2925e1){const _0x990303=_0x397669?_0x131d4d(0x1b0)+_0x397669:'';console[_0x131d4d(0x1a0)](_0x131d4d(0x19e)),console['error']('\x20\x20tdx\x20auth\x20setup'+_0x990303+'\x0a'),console[_0x131d4d(0x1a0)](_0x131d4d(0x193)),console[_0x131d4d(0x1a0)](_0x131d4d(0x1b5)+_0x990303);}}export class BaseCommand{[a18_0x2d5056(0x1c1)](_0x333f4a){const _0x3aa0f7=a18_0x2d5056,{options:_0x45cd84}=_0x333f4a,_0xaefb02=_0x45cd84[_0x3aa0f7(0x1bf)];if(_0xaefb02!==undefined){const _0x2e3591=typeof _0xaefb02===_0x3aa0f7(0x1a6)?_0xaefb02:parseInt(_0xaefb02,0xa);if(isNaN(_0x2e3591))return _0x3aa0f7(0x1c3)+_0xaefb02+_0x3aa0f7(0x1b1);const _0x28d51c=validateLimitOption(_0x2e3591);if(!_0x28d51c[_0x3aa0f7(0x19a)])return _0x28d51c[_0x3aa0f7(0x1a0)];_0x333f4a[_0x3aa0f7(0x1a2)][_0x3aa0f7(0x1bf)]=_0x28d51c[_0x3aa0f7(0x1b4)];}return undefined;}[a18_0x2d5056(0x1af)](_0x481a38){return undefined;}async['run'](_0x737679){const _0x3560a1=a18_0x2d5056;try{const _0x31f3f2=this['validateGlobalOptions'](_0x737679);if(_0x31f3f2)return console[_0x3560a1(0x1a0)](_0x3560a1(0x1ba)+_0x31f3f2),0x1;const _0x2b0d6c=this[_0x3560a1(0x1af)](_0x737679);if(_0x2b0d6c){const _0xc63113=/^\s*(Usage|Note|Warning|Error):/i[_0x3560a1(0x1ae)](_0x2b0d6c);return _0xc63113?console['error'](_0x2b0d6c):console[_0x3560a1(0x1a0)](_0x3560a1(0x1ba)+_0x2b0d6c),0x1;}const _0x2d2c00=await this['execute'](_0x737679);return _0x2d2c00??0x0;}catch(_0x3e327f){if(_0x3e327f instanceof Error){if(_0x3e327f instanceof HTTPClientError&&_0x3e327f[_0x3560a1(0x196)]===0x191){const _0x1fb4ea=_0x737679[_0x3560a1(0x1a2)][_0x3560a1(0x19f)];return printAuthError(_0x3e327f,!![],_0x1fb4ea),_0x3e327f['stack']&&_0x737679[_0x3560a1(0x1b6)]&&(_0x737679[_0x3560a1(0x1b6)][_0x3560a1(0x1b2)][_0x3560a1(0x1bb)]('Authentication\x20error\x20stack\x20trace:'),_0x737679['tdx']['logger'][_0x3560a1(0x1bb)](_0x3e327f[_0x3560a1(0x1a9)])),0x1;}console[_0x3560a1(0x1a0)](a18_0x4abad7[_0x3560a1(0x1bd)]('Error:\x20'+_0x3e327f['message']));_0x3e327f instanceof SDKError&&_0x3e327f[_0x3560a1(0x1a8)]&&console[_0x3560a1(0x1a0)](a18_0x4abad7[_0x3560a1(0x1c2)](_0x3e327f[_0x3560a1(0x1a8)]));const _0x2f7b1e=_0x3e327f instanceof SDKError&&_0x3e327f[_0x3560a1(0x1ac)]===ErrorCategory[_0x3560a1(0x1aa)];_0x3e327f[_0x3560a1(0x1a9)]&&!_0x2f7b1e&&console[_0x3560a1(0x1a0)](_0x3560a1(0x1a5)+_0x3e327f[_0x3560a1(0x1a9)]);}else console['error']('Error:\x20'+String(_0x3e327f));return 0x1;}}}export class CommandRegistry{[a18_0x2d5056(0x195)]=new Map();['register'](_0x206c9f){const _0x2c14e1=a18_0x2d5056;if(this[_0x2c14e1(0x195)][_0x2c14e1(0x198)](_0x206c9f[_0x2c14e1(0x192)]))throw new Error(_0x2c14e1(0x1a3)+_0x206c9f[_0x2c14e1(0x192)]+'\x27\x20is\x20already\x20registered');this['commands'][_0x2c14e1(0x197)](_0x206c9f[_0x2c14e1(0x192)],_0x206c9f);}[a18_0x2d5056(0x1b9)](_0x482d9e){const _0x459071=a18_0x2d5056;return this[_0x459071(0x195)][_0x459071(0x1b9)](_0x482d9e);}['getAll'](){const _0x5adab0=a18_0x2d5056;return Array[_0x5adab0(0x194)](this[_0x5adab0(0x195)][_0x5adab0(0x1ab)]());}[a18_0x2d5056(0x198)](_0x158507){const _0x538cd5=a18_0x2d5056;return this[_0x538cd5(0x195)][_0x538cd5(0x198)](_0x158507);}}export const registry=new CommandRegistry();
1
+ const a18_0x242f5a=a18_0x3620;(function(_0xe3649a,_0x573188){const _0x442467=a18_0x3620,_0x54a73a=_0xe3649a();while(!![]){try{const _0x18f759=parseInt(_0x442467(0x13c))/0x1+-parseInt(_0x442467(0x12e))/0x2+-parseInt(_0x442467(0x118))/0x3+parseInt(_0x442467(0x138))/0x4+-parseInt(_0x442467(0x11f))/0x5+parseInt(_0x442467(0x141))/0x6+parseInt(_0x442467(0x139))/0x7;if(_0x18f759===_0x573188)break;else _0x54a73a['push'](_0x54a73a['shift']());}catch(_0x326d89){_0x54a73a['push'](_0x54a73a['shift']());}}}(a18_0x3689,0x6f229));import{validateLimitOption}from'../utils/option-validation.js';function a18_0x3620(_0x16c3e4,_0x565eb7){const _0x36897d=a18_0x3689();return a18_0x3620=function(_0x362072,_0x2fe30b){_0x362072=_0x362072-0x114;let _0x94ef3a=_0x36897d[_0x362072];return _0x94ef3a;},a18_0x3620(_0x16c3e4,_0x565eb7);}import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a18_0x2d21f8 from'chalk';export function printAuthError(_0x3f596d,_0x13b99c=![],_0x354612){const _0x28aa47=a18_0x3620,_0x559f9b=_0x3f596d[_0x28aa47(0x12f)]?.[_0x28aa47(0x129)]||_0x3f596d[_0x28aa47(0x117)];console[_0x28aa47(0x135)](a18_0x2d21f8['red'](_0x28aa47(0x137))),console[_0x28aa47(0x135)](a18_0x2d21f8['red'](_0x28aa47(0x11b)+_0x559f9b));if(_0x13b99c){const _0x48248e=_0x354612?_0x28aa47(0x114)+_0x354612:'';console[_0x28aa47(0x135)](_0x28aa47(0x13d)),console[_0x28aa47(0x135)](_0x28aa47(0x124)+_0x48248e+'\x0a'),console['error']('To\x20check\x20your\x20current\x20auth\x20status:'),console[_0x28aa47(0x135)](_0x28aa47(0x130)+_0x48248e);}}export class BaseCommand{[a18_0x242f5a(0x13e)](_0x52e533){const _0x1e0cbe=a18_0x242f5a,{options:_0x5ae876}=_0x52e533,_0x28d174=_0x5ae876['limit'];if(_0x28d174!==undefined){const _0x1258f2=typeof _0x28d174===_0x1e0cbe(0x136)?_0x28d174:parseInt(_0x28d174,0xa);if(isNaN(_0x1258f2))return _0x1e0cbe(0x12b)+_0x28d174+_0x1e0cbe(0x128);const _0x4c88e3=validateLimitOption(_0x1258f2);if(!_0x4c88e3[_0x1e0cbe(0x115)])return _0x4c88e3['error'];_0x52e533['options'][_0x1e0cbe(0x11a)]=_0x4c88e3[_0x1e0cbe(0x13b)];}return undefined;}[a18_0x242f5a(0x120)](_0x30c950){return undefined;}async['run'](_0x381f7f){const _0x3ced36=a18_0x242f5a;try{const _0x2db825=this[_0x3ced36(0x13e)](_0x381f7f);if(_0x2db825)return console[_0x3ced36(0x135)](_0x3ced36(0x12c)+_0x2db825),0x1;const _0x24cc77=this[_0x3ced36(0x120)](_0x381f7f);if(_0x24cc77){const _0x1df03a=/^\s*(Usage|Note|Warning|Error):/i[_0x3ced36(0x133)](_0x24cc77);return _0x1df03a?console[_0x3ced36(0x135)](_0x24cc77):console[_0x3ced36(0x135)](_0x3ced36(0x12c)+_0x24cc77),0x1;}const _0x3bc524=await this['execute'](_0x381f7f);return _0x3bc524??0x0;}catch(_0x3f30c5){if(_0x3f30c5 instanceof Error){if(_0x3f30c5 instanceof HTTPClientError&&_0x3f30c5[_0x3ced36(0x11e)]===0x191){const _0x4e60de=_0x381f7f[_0x3ced36(0x121)][_0x3ced36(0x12a)];return printAuthError(_0x3f30c5,!![],_0x4e60de),_0x3f30c5[_0x3ced36(0x119)]&&_0x381f7f[_0x3ced36(0x11d)]&&(_0x381f7f[_0x3ced36(0x11d)][_0x3ced36(0x13f)][_0x3ced36(0x134)](_0x3ced36(0x125)),_0x381f7f[_0x3ced36(0x11d)][_0x3ced36(0x13f)][_0x3ced36(0x134)](_0x3f30c5[_0x3ced36(0x119)])),0x1;}console[_0x3ced36(0x135)](a18_0x2d21f8[_0x3ced36(0x11c)]('Error:\x20'+_0x3f30c5[_0x3ced36(0x117)]));_0x3f30c5 instanceof SDKError&&_0x3f30c5['helpText']&&console['error'](a18_0x2d21f8[_0x3ced36(0x13a)](_0x3f30c5[_0x3ced36(0x140)]));const _0x3a9b3f=_0x3f30c5 instanceof SDKError&&_0x3f30c5[_0x3ced36(0x122)]===ErrorCategory['USER_ERROR'];_0x3f30c5[_0x3ced36(0x119)]&&!_0x3a9b3f&&console['error'](_0x3ced36(0x116)+_0x3f30c5['stack']);}else console[_0x3ced36(0x135)](_0x3ced36(0x12c)+String(_0x3f30c5));return 0x1;}}}export class CommandRegistry{['commands']=new Map();['register'](_0x4af3c7){const _0xa6cbb6=a18_0x242f5a;if(this[_0xa6cbb6(0x127)][_0xa6cbb6(0x131)](_0x4af3c7[_0xa6cbb6(0x126)]))throw new Error('Command\x20\x27'+_0x4af3c7[_0xa6cbb6(0x126)]+'\x27\x20is\x20already\x20registered');this['commands']['set'](_0x4af3c7['name'],_0x4af3c7);}[a18_0x242f5a(0x123)](_0x5e242f){const _0x3df753=a18_0x242f5a;return this['commands'][_0x3df753(0x123)](_0x5e242f);}[a18_0x242f5a(0x132)](){const _0x41bc4f=a18_0x242f5a;return Array[_0x41bc4f(0x12d)](this[_0x41bc4f(0x127)]['values']());}[a18_0x242f5a(0x131)](_0x3f87e9){const _0x36d7f=a18_0x242f5a;return this[_0x36d7f(0x127)][_0x36d7f(0x131)](_0x3f87e9);}}function a18_0x3689(){const _0x3fee0f=['options','category','get','\x20\x20tdx\x20auth\x20setup','Authentication\x20error\x20stack\x20trace:','name','commands','.\x20Must\x20be\x20a\x20number.','detail','profile','Invalid\x20limit\x20value:\x20','Error:\x20','from','1376138nGnfAH','problemDetails','\x20\x20tdx\x20auth','has','getAll','test','debug','error','number','Authentication\x20failed','1700032MvoCxs','6575765NBjkVJ','yellow','value','120825zNNDqr','\x0aTo\x20set\x20up\x20authentication:','validateGlobalOptions','logger','helpText','2571780JFfQoG','\x20--profile\x20','isValid','\x0aStack\x20trace:\x0a','message','60561XJzevN','stack','limit','Reason:\x20','red','tdx','status','3751965dvHMTH','validate'];a18_0x3689=function(){return _0x3fee0f;};return a18_0x3689();}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- function a19_0x3e84(_0x4651be,_0x44d4a6){const _0x53cebd=a19_0x53ce();return a19_0x3e84=function(_0x3e8440,_0x31bdcb){_0x3e8440=_0x3e8440-0x6c;let _0x2f3152=_0x53cebd[_0x3e8440];return _0x2f3152;},a19_0x3e84(_0x4651be,_0x44d4a6);}const a19_0x59a907=a19_0x3e84;function a19_0x53ce(){const _0x2ae3c6=['message','session','display','name','28848FPiBYm','5419368yemJRi','2906218QfCkhp','execute','12dhwrrt','96bKFCdF','warn','Session\x20context\x20cleared\x20(session:\x20','toString','396zMrAkh','Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.','error','debug','log','yellow','5210DLDtLC','596uKCLqQ','19420bNPIgW','Show\x20current\x20resolved\x20context','1205677gCtcuV','context','Error:\x20','clear','6mwYDqz','197732ldtnuV'];a19_0x53ce=function(){return _0x2ae3c6;};return a19_0x53ce();}(function(_0xa30fed,_0x5c4424){const _0x2d953c=a19_0x3e84,_0x654eae=_0xa30fed();while(!![]){try{const _0x395b54=-parseInt(_0x2d953c(0x71))/0x1*(-parseInt(_0x2d953c(0x72))/0x2)+-parseInt(_0x2d953c(0x77))/0x3+parseInt(_0x2d953c(0x87))/0x4*(parseInt(_0x2d953c(0x88))/0x5)+-parseInt(_0x2d953c(0x7b))/0x6*(-parseInt(_0x2d953c(0x79))/0x7)+-parseInt(_0x2d953c(0x78))/0x8+parseInt(_0x2d953c(0x80))/0x9*(-parseInt(_0x2d953c(0x86))/0xa)+-parseInt(_0x2d953c(0x6d))/0xb*(parseInt(_0x2d953c(0x7c))/0xc);if(_0x395b54===_0x5c4424)break;else _0x654eae['push'](_0x654eae['shift']());}catch(_0x11fc4b){_0x654eae['push'](_0x654eae['shift']());}}}(a19_0x53ce,0x656d3));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a19_0x2e0a2b from'chalk';export class ContextCommand extends BaseCommand{[a19_0x59a907(0x76)]=a19_0x59a907(0x6e);['description']=a19_0x59a907(0x6c);async[a19_0x59a907(0x7a)](_0x59dbfc){const _0xe6a123=a19_0x59a907,{options:_0x3614c4}=_0x59dbfc,_0x32ffc9=_0x3614c4[_0xe6a123(0x83)],_0x2ec76f=_0x3614c4[_0xe6a123(0x70)];console[_0xe6a123(0x7d)](a19_0x2e0a2b[_0xe6a123(0x85)](_0xe6a123(0x81))),console[_0xe6a123(0x7d)](a19_0x2e0a2b['yellow']('\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context')),console['warn'](a19_0x2e0a2b[_0xe6a123(0x85)]('\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a')),cleanExpiredSessions();try{if(_0x2ec76f){clearSessionContext(_0x3614c4['session']);const _0x3efc12=_0x3614c4[_0xe6a123(0x74)]||getCurrentSessionPID()[_0xe6a123(0x7f)]();return console[_0xe6a123(0x84)](_0xe6a123(0x7e)+_0x3efc12+')'),0x0;}const _0x2b96b7=new GlobalContext(_0x3614c4);return _0x32ffc9?_0x2b96b7['displayWithSources']():_0x2b96b7[_0xe6a123(0x75)](),0x0;}catch(_0x4fba1d){return _0x4fba1d instanceof Error&&console[_0xe6a123(0x82)](_0xe6a123(0x6f)+_0x4fba1d[_0xe6a123(0x73)]),0x1;}}}
1
+ function a19_0x5363(){const _0x46a4fe=['26817DqfWiv','483185XjoVBy','Error:\x20','245223EPMWiB','242hiTrrT','390196FsUXJf','Session\x20context\x20cleared\x20(session:\x20','session','name','354JUiZqo','64jkOHzT','yellow','141730UnFgQV','displayWithSources','warn','debug','4NFqmAh','message','402856MNBLbH','toString','2305503XSnpCl','execute','display','\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','error','Show\x20current\x20resolved\x20context','\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a'];a19_0x5363=function(){return _0x46a4fe;};return a19_0x5363();}const a19_0x4bd0c4=a19_0x2456;(function(_0xcb7a7a,_0x87237f){const _0xcde468=a19_0x2456,_0x5cf9b5=_0xcb7a7a();while(!![]){try{const _0x1ca0c3=-parseInt(_0xcde468(0x113))/0x1+-parseInt(_0xcde468(0x121))/0x2+parseInt(_0xcde468(0x115))/0x3*(parseInt(_0xcde468(0x111))/0x4)+parseInt(_0xcde468(0x11d))/0x5+parseInt(_0xcde468(0x125))/0x6*(parseInt(_0xcde468(0x11c))/0x7)+-parseInt(_0xcde468(0x126))/0x8*(-parseInt(_0xcde468(0x11f))/0x9)+-parseInt(_0xcde468(0x128))/0xa*(parseInt(_0xcde468(0x120))/0xb);if(_0x1ca0c3===_0x87237f)break;else _0x5cf9b5['push'](_0x5cf9b5['shift']());}catch(_0x217994){_0x5cf9b5['push'](_0x5cf9b5['shift']());}}}(a19_0x5363,0x61817));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';function a19_0x2456(_0x40bfc0,_0x572b16){const _0x53634a=a19_0x5363();return a19_0x2456=function(_0x245672,_0x495d38){_0x245672=_0x245672-0x10e;let _0x22d059=_0x53634a[_0x245672];return _0x22d059;},a19_0x2456(_0x40bfc0,_0x572b16);}import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a19_0x474075 from'chalk';export class ContextCommand extends BaseCommand{[a19_0x4bd0c4(0x124)]='context';['description']=a19_0x4bd0c4(0x11a);async[a19_0x4bd0c4(0x116)](_0x1584d){const _0x44fd66=a19_0x4bd0c4,{options:_0x1fb0f0}=_0x1584d,_0x120b61=_0x1fb0f0[_0x44fd66(0x110)],_0x1f8086=_0x1fb0f0['clear'];console['warn'](a19_0x474075['yellow']('Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.')),console[_0x44fd66(0x10f)](a19_0x474075[_0x44fd66(0x127)](_0x44fd66(0x118))),console[_0x44fd66(0x10f)](a19_0x474075[_0x44fd66(0x127)](_0x44fd66(0x11b))),cleanExpiredSessions();try{if(_0x1f8086){clearSessionContext(_0x1fb0f0[_0x44fd66(0x123)]);const _0x5b030a=_0x1fb0f0[_0x44fd66(0x123)]||getCurrentSessionPID()[_0x44fd66(0x114)]();return console['log'](_0x44fd66(0x122)+_0x5b030a+')'),0x0;}const _0x4d8602=new GlobalContext(_0x1fb0f0);return _0x120b61?_0x4d8602[_0x44fd66(0x10e)]():_0x4d8602[_0x44fd66(0x117)](),0x0;}catch(_0x51dbb0){return _0x51dbb0 instanceof Error&&console[_0x44fd66(0x119)](_0x44fd66(0x11e)+_0x51dbb0[_0x44fd66(0x112)]),0x1;}}}
@@ -1 +1 @@
1
- const a20_0xe3c1b=a20_0x366f;(function(_0x383df7,_0x141919){const _0x57ee10=a20_0x366f,_0x554a57=_0x383df7();while(!![]){try{const _0x26ae4f=-parseInt(_0x57ee10(0x1fa))/0x1+parseInt(_0x57ee10(0x1f5))/0x2+parseInt(_0x57ee10(0x209))/0x3*(-parseInt(_0x57ee10(0x204))/0x4)+-parseInt(_0x57ee10(0x201))/0x5+parseInt(_0x57ee10(0x208))/0x6+parseInt(_0x57ee10(0x1f6))/0x7+parseInt(_0x57ee10(0x205))/0x8;if(_0x26ae4f===_0x141919)break;else _0x554a57['push'](_0x554a57['shift']());}catch(_0x3b7f0f){_0x554a57['push'](_0x554a57['shift']());}}}(a20_0x3e35,0x35a86));import{BaseCommand}from'./command.js';function a20_0x3e35(){const _0x1dd2d8=['cause','execute','listDatabases','2053810fjanrd','name','\x20\x20Cause:\x20','571176bVHinH','4796360MpqIfD','List\x20all\x20databases','verbose','1060224Lgivor','9BSWebK','limit','length','description','databases','Listing\x20databases...','✔\x20Found\x20','query','315466oMMNIw','2214758hHqXmu','error','data','Pattern:\x20','191450dnDgiz','message','site','\x20database'];a20_0x3e35=function(){return _0x1dd2d8;};return a20_0x3e35();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a20_0x366f(_0x3994f2,_0xfa738){const _0x3e35ac=a20_0x3e35();return a20_0x366f=function(_0x366fee,_0x3d8972){_0x366fee=_0x366fee-0x1f1;let _0x129ce7=_0x3e35ac[_0x366fee];return _0x129ce7;},a20_0x366f(_0x3994f2,_0xfa738);}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a20_0xe3c1b(0x202)]=a20_0xe3c1b(0x1f1);[a20_0xe3c1b(0x20c)]=a20_0xe3c1b(0x206);async[a20_0xe3c1b(0x1ff)](_0x21f061){const _0x26a53e=a20_0xe3c1b,{options:_0x53081e,args:_0x550ad0,tdx:_0x419a5d}=_0x21f061,_0x43ff0d=_0x550ad0[0x0];try{_0x53081e[_0x26a53e(0x207)]&&(console[_0x26a53e(0x1f7)]('Site:\x20'+_0x53081e[_0x26a53e(0x1fc)]),_0x43ff0d&&console[_0x26a53e(0x1f7)](_0x26a53e(0x1f9)+_0x43ff0d));const _0x26faeb=resolveLimit(_0x53081e[_0x26a53e(0x20a)],DEFAULT_LISTING_LIMIT),_0x2edd0b=await withSpinner(_0x26a53e(0x1f2),()=>_0x419a5d[_0x26a53e(0x1f4)][_0x26a53e(0x200)](_0x43ff0d,_0x26faeb),{'verbose':_0x53081e[_0x26a53e(0x207)]}),_0xed7567=_0x2edd0b[_0x26a53e(0x1f8)];return console[_0x26a53e(0x1f7)](_0x26a53e(0x1f3)+_0xed7567[_0x26a53e(0x20b)]+_0x26a53e(0x1fd)+(_0xed7567['length']!==0x1?'s':'')),await handleSDKOutput(_0xed7567,{..._0x53081e,'limit':_0x26faeb}),0x0;}catch(_0x1e4872){if(_0x1e4872 instanceof SDKError)return console[_0x26a53e(0x1f7)]('Error:\x20'+_0x1e4872[_0x26a53e(0x1fb)]),_0x1e4872[_0x26a53e(0x1fe)]&&console[_0x26a53e(0x1f7)](_0x26a53e(0x203)+_0x1e4872[_0x26a53e(0x1fe)]),0x1;throw _0x1e4872;}}}
1
+ const a20_0x202962=a20_0x25b6;(function(_0xde56f3,_0x38ce3a){const _0xc1cd7c=a20_0x25b6,_0x3bf4e6=_0xde56f3();while(!![]){try{const _0x394662=parseInt(_0xc1cd7c(0x193))/0x1*(parseInt(_0xc1cd7c(0x188))/0x2)+-parseInt(_0xc1cd7c(0x19b))/0x3+parseInt(_0xc1cd7c(0x195))/0x4+parseInt(_0xc1cd7c(0x18f))/0x5*(-parseInt(_0xc1cd7c(0x194))/0x6)+parseInt(_0xc1cd7c(0x18b))/0x7*(parseInt(_0xc1cd7c(0x19e))/0x8)+-parseInt(_0xc1cd7c(0x199))/0x9+-parseInt(_0xc1cd7c(0x19a))/0xa*(-parseInt(_0xc1cd7c(0x18a))/0xb);if(_0x394662===_0x38ce3a)break;else _0x3bf4e6['push'](_0x3bf4e6['shift']());}catch(_0x35e333){_0x3bf4e6['push'](_0x3bf4e6['shift']());}}}(a20_0x3c6b,0xdab56));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a20_0x25b6(_0x3066ac,_0x42e7c2){const _0x3c6b6e=a20_0x3c6b();return a20_0x25b6=function(_0x25b6dd,_0xd937c4){_0x25b6dd=_0x25b6dd-0x186;let _0x5b7156=_0x3c6b6e[_0x25b6dd];return _0x5b7156;},a20_0x25b6(_0x3066ac,_0x42e7c2);}function a20_0x3c6b(){const _0xe7fa5c=['verbose','20792UfeeTk','limit','\x20database','✔\x20Found\x20','error','Listing\x20databases...','372614DpnOSj','execute','37299064xHRXrE','63ZBLTYF','length','Error:\x20','Site:\x20','222890KWOtTu','listDatabases','description','databases','3Pufptt','126poEiQX','798452ooIqEG','cause','message','query','14029101hCrZEI','10crifSe','2345976HgieZA','name'];a20_0x3c6b=function(){return _0xe7fa5c;};return a20_0x3c6b();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a20_0x202962(0x19c)]=a20_0x202962(0x192);[a20_0x202962(0x191)]='List\x20all\x20databases';async[a20_0x202962(0x189)](_0x4421c3){const _0x44c9e1=a20_0x202962,{options:_0x245f8e,args:_0x422ff6,tdx:_0x552872}=_0x4421c3,_0x16406a=_0x422ff6[0x0];try{_0x245f8e['verbose']&&(console['error'](_0x44c9e1(0x18e)+_0x245f8e['site']),_0x16406a&&console['error']('Pattern:\x20'+_0x16406a));const _0x4afe88=resolveLimit(_0x245f8e[_0x44c9e1(0x19f)],DEFAULT_LISTING_LIMIT),_0x5c23b6=await withSpinner(_0x44c9e1(0x187),()=>_0x552872[_0x44c9e1(0x198)][_0x44c9e1(0x190)](_0x16406a,_0x4afe88),{'verbose':_0x245f8e[_0x44c9e1(0x19d)]}),_0x28bcac=_0x5c23b6['data'];return console['error'](_0x44c9e1(0x1a1)+_0x28bcac[_0x44c9e1(0x18c)]+_0x44c9e1(0x1a0)+(_0x28bcac[_0x44c9e1(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0x28bcac,{..._0x245f8e,'limit':_0x4afe88}),0x0;}catch(_0x157b2a){if(_0x157b2a instanceof SDKError)return console['error'](_0x44c9e1(0x18d)+_0x157b2a[_0x44c9e1(0x197)]),_0x157b2a[_0x44c9e1(0x196)]&&console[_0x44c9e1(0x186)]('\x20\x20Cause:\x20'+_0x157b2a[_0x44c9e1(0x196)]),0x1;throw _0x157b2a;}}}
@@ -1 +1 @@
1
- const a21_0x4125f7=a21_0x2648;(function(_0x31cfcc,_0x31fa6a){const _0x3c7a56=a21_0x2648,_0x3f4c49=_0x31cfcc();while(!![]){try{const _0x5a1d51=parseInt(_0x3c7a56(0x88))/0x1+-parseInt(_0x3c7a56(0x8b))/0x2+-parseInt(_0x3c7a56(0x92))/0x3+-parseInt(_0x3c7a56(0x87))/0x4+-parseInt(_0x3c7a56(0x7b))/0x5*(-parseInt(_0x3c7a56(0x8c))/0x6)+parseInt(_0x3c7a56(0x8f))/0x7+parseInt(_0x3c7a56(0x7e))/0x8;if(_0x5a1d51===_0x31fa6a)break;else _0x3f4c49['push'](_0x3f4c49['shift']());}catch(_0x295e1f){_0x3f4c49['push'](_0x3f4c49['shift']());}}}(a21_0x2747,0x38698));function a21_0x2648(_0x40e380,_0x4451c9){const _0x27474b=a21_0x2747();return a21_0x2648=function(_0x264863,_0x168a95){_0x264863=_0x264863-0x75;let _0x1200d9=_0x27474b[_0x264863];return _0x1200d9;},a21_0x2648(_0x40e380,_0x4451c9);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a21_0x2747(){const _0x24f870=['execute','Site:\x20','error','table','284975jbZFYf','\x20in\x20','Database:\x20','1258720AFqwAo','cause','validate','message','verbose','args','describe','describeTable','\x20\x20Cause:\x20','1427716alHoWK','184725zFbwcO','length','Table:\x20','63892xZNTkl','36AkKyej','query','database','134722LkiCpR','Describe\x20table\x20schema','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','250026FqDrId','name','site','Error:\x20'];a21_0x2747=function(){return _0x24f870;};return a21_0x2747();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a21_0x4125f7(0x93)]=a21_0x4125f7(0x84);['description']=a21_0x4125f7(0x90);async[a21_0x4125f7(0x77)](_0xb029c8){const _0x584045=a21_0x4125f7;return this[_0x584045(0x85)](_0xb029c8);}async[a21_0x4125f7(0x85)](_0x2c74d8){const _0x4cc8e3=a21_0x4125f7,{options:_0x25621f,args:_0x18954e,tdx:_0x10c967}=_0x2c74d8;let _0xddc02a;try{_0xddc02a=parseTableReference(_0x18954e[0x0]);const _0x5a61a5=_0x25621f[_0x4cc8e3(0x8e)];!_0xddc02a[_0x4cc8e3(0x8e)]&&_0x5a61a5&&(_0xddc02a[_0x4cc8e3(0x8e)]=_0x5a61a5);const _0x22cb63=validateTableDescribeReference(_0xddc02a);if(_0x22cb63)return console[_0x4cc8e3(0x79)](_0x4cc8e3(0x76)+_0x22cb63),0x1;}catch(_0x1e2951){return console[_0x4cc8e3(0x79)]('Error:\x20'+_0x1e2951[_0x4cc8e3(0x81)]),0x1;}const _0x11f915=_0xddc02a[_0x4cc8e3(0x8e)],_0x302a5e=_0xddc02a[_0x4cc8e3(0x7a)];try{_0x25621f[_0x4cc8e3(0x82)]&&(console[_0x4cc8e3(0x79)](_0x4cc8e3(0x78)+_0x25621f[_0x4cc8e3(0x75)]),console[_0x4cc8e3(0x79)](_0x4cc8e3(0x7d)+_0x11f915),console[_0x4cc8e3(0x79)](_0x4cc8e3(0x8a)+_0x302a5e));const _0x45e2bf=await withSpinner('Describing\x20table\x20'+_0x11f915+'.'+_0x302a5e+'...',()=>_0x10c967[_0x4cc8e3(0x8d)]['describeTable'](_0x11f915,_0x302a5e),{'verbose':_0x25621f[_0x4cc8e3(0x82)]}),_0x150b0c=_0x45e2bf['data'];if(_0x150b0c['length']===0x0)return console[_0x4cc8e3(0x79)]('✖\x20Table\x20not\x20found'),console['error']('Table\x20\x27'+_0x11f915+'.'+_0x302a5e+'\x27\x20does\x20not\x20exist'),0x1;return console['error']('✔\x20Found\x20'+_0x150b0c[_0x4cc8e3(0x89)]+'\x20column'+(_0x150b0c['length']!==0x1?'s':'')+_0x4cc8e3(0x7c)+_0x11f915+'.'+_0x302a5e),await handleSDKOutput(_0x150b0c,_0x25621f),0x0;}catch(_0x208bbb){if(_0x208bbb instanceof SDKError)return console['error'](_0x4cc8e3(0x76)+_0x208bbb[_0x4cc8e3(0x81)]),_0x208bbb['cause']&&console[_0x4cc8e3(0x79)](_0x4cc8e3(0x86)+_0x208bbb[_0x4cc8e3(0x7f)]),0x1;throw _0x208bbb;}}[a21_0x4125f7(0x80)](_0x5aaf81){const _0x5b7fcc=a21_0x4125f7;if(_0x5aaf81[_0x5b7fcc(0x83)][_0x5b7fcc(0x89)]===0x0)return'Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';if(_0x5aaf81['args'][_0x5b7fcc(0x89)]>0x1)return _0x5b7fcc(0x91);return undefined;}}
1
+ const a21_0x43eafd=a21_0x3d4c;function a21_0x1953(){const _0x5d52af=['database','1181335CRjBJG','validate','Describe\x20table\x20schema','577533bShMIS','Table\x20\x27','...','description','name','error','\x20\x20Cause:\x20','Database:\x20','table','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','3604951yEoMMC','✔\x20Found\x20','✖\x20Table\x20not\x20found','\x20in\x20','Error:\x20','message','describe','8nNBTuJ','9106245bvquBj','cause','query','length','verbose','describeTable','args','1059625lJQxfH','6aNlwAJ','2219106hZKBns','790thZZCC','Table:\x20','4jdmUlw','site','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','2796126NRWGUX'];a21_0x1953=function(){return _0x5d52af;};return a21_0x1953();}function a21_0x3d4c(_0x4c583f,_0xcac896){const _0x195365=a21_0x1953();return a21_0x3d4c=function(_0x3d4c13,_0x2b6e16){_0x3d4c13=_0x3d4c13-0x10e;let _0x4c281a=_0x195365[_0x3d4c13];return _0x4c281a;},a21_0x3d4c(_0x4c583f,_0xcac896);}(function(_0x3bd2a6,_0x13a9a7){const _0x39ae36=a21_0x3d4c,_0xcf7c57=_0x3bd2a6();while(!![]){try{const _0x119e34=parseInt(_0x39ae36(0x11d))/0x1+parseInt(_0x39ae36(0x125))/0x2+parseInt(_0x39ae36(0x11f))/0x3*(parseInt(_0x39ae36(0x122))/0x4)+parseInt(_0x39ae36(0x127))/0x5+parseInt(_0x39ae36(0x11e))/0x6*(parseInt(_0x39ae36(0x10e))/0x7)+-parseInt(_0x39ae36(0x115))/0x8*(-parseInt(_0x39ae36(0x116))/0x9)+parseInt(_0x39ae36(0x120))/0xa*(-parseInt(_0x39ae36(0x12a))/0xb);if(_0x119e34===_0x13a9a7)break;else _0xcf7c57['push'](_0xcf7c57['shift']());}catch(_0xff575e){_0xcf7c57['push'](_0xcf7c57['shift']());}}}(a21_0x1953,0xc66ae));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a21_0x43eafd(0x12e)]=a21_0x43eafd(0x114);[a21_0x43eafd(0x12d)]=a21_0x43eafd(0x129);async['execute'](_0x2276ef){const _0x46633e=a21_0x43eafd;return this[_0x46633e(0x11b)](_0x2276ef);}async[a21_0x43eafd(0x11b)](_0xf39b2){const _0x5628e4=a21_0x43eafd,{options:_0x10d98a,args:_0x275458,tdx:_0x5c478d}=_0xf39b2;let _0x39129d;try{_0x39129d=parseTableReference(_0x275458[0x0]);const _0x4de138=_0x10d98a[_0x5628e4(0x126)];!_0x39129d[_0x5628e4(0x126)]&&_0x4de138&&(_0x39129d[_0x5628e4(0x126)]=_0x4de138);const _0x1cc81f=validateTableDescribeReference(_0x39129d);if(_0x1cc81f)return console[_0x5628e4(0x12f)](_0x5628e4(0x112)+_0x1cc81f),0x1;}catch(_0xfdc9c){return console[_0x5628e4(0x12f)](_0x5628e4(0x112)+_0xfdc9c[_0x5628e4(0x113)]),0x1;}const _0x539f01=_0x39129d['database'],_0x31ce20=_0x39129d[_0x5628e4(0x132)];try{_0x10d98a[_0x5628e4(0x11a)]&&(console[_0x5628e4(0x12f)]('Site:\x20'+_0x10d98a[_0x5628e4(0x123)]),console[_0x5628e4(0x12f)](_0x5628e4(0x131)+_0x539f01),console['error'](_0x5628e4(0x121)+_0x31ce20));const _0x2ef168=await withSpinner('Describing\x20table\x20'+_0x539f01+'.'+_0x31ce20+_0x5628e4(0x12c),()=>_0x5c478d[_0x5628e4(0x118)]['describeTable'](_0x539f01,_0x31ce20),{'verbose':_0x10d98a[_0x5628e4(0x11a)]}),_0x3914cf=_0x2ef168['data'];if(_0x3914cf['length']===0x0)return console['error'](_0x5628e4(0x110)),console['error'](_0x5628e4(0x12b)+_0x539f01+'.'+_0x31ce20+'\x27\x20does\x20not\x20exist'),0x1;return console[_0x5628e4(0x12f)](_0x5628e4(0x10f)+_0x3914cf[_0x5628e4(0x119)]+'\x20column'+(_0x3914cf['length']!==0x1?'s':'')+_0x5628e4(0x111)+_0x539f01+'.'+_0x31ce20),await handleSDKOutput(_0x3914cf,_0x10d98a),0x0;}catch(_0x38e1e5){if(_0x38e1e5 instanceof SDKError)return console[_0x5628e4(0x12f)](_0x5628e4(0x112)+_0x38e1e5['message']),_0x38e1e5[_0x5628e4(0x117)]&&console[_0x5628e4(0x12f)](_0x5628e4(0x130)+_0x38e1e5[_0x5628e4(0x117)]),0x1;throw _0x38e1e5;}}[a21_0x43eafd(0x128)](_0x1b3500){const _0x61914c=a21_0x43eafd;if(_0x1b3500[_0x61914c(0x11c)][_0x61914c(0x119)]===0x0)return _0x61914c(0x124);if(_0x1b3500[_0x61914c(0x11c)][_0x61914c(0x119)]>0x1)return _0x61914c(0x133);return undefined;}}