@treasuredata/tdx 0.8.6 → 0.8.7

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 (114) 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.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/api-command.js +1 -1
  15. package/dist/commands/auth-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/context-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/journey-command.js +1 -1
  28. package/dist/commands/llm-command.js +1 -1
  29. package/dist/commands/llm-proxy.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profiles-command.js +1 -1
  32. package/dist/commands/query-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-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/user-command.js +1 -1
  45. package/dist/commands/workflow-command.js +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/core/user-cache.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/proxy/anthropic-adapter.js +1 -1
  58. package/dist/proxy/claude-usage-tracker.js +1 -1
  59. package/dist/proxy/context-signature.js +1 -1
  60. package/dist/proxy/conversation-utils.js +1 -1
  61. package/dist/proxy/server.js +1 -1
  62. package/dist/proxy/session-cache.js +1 -1
  63. package/dist/sdk/api.js +1 -1
  64. package/dist/sdk/connection.js +1 -1
  65. package/dist/sdk/engage.js +1 -1
  66. package/dist/sdk/errors.js +1 -1
  67. package/dist/sdk/index.js +1 -1
  68. package/dist/sdk/job.js +1 -1
  69. package/dist/sdk/journey.js +1 -1
  70. package/dist/sdk/llm.js +1 -1
  71. package/dist/sdk/query.js +1 -1
  72. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  73. package/dist/sdk/segment/journey-yaml.js +1 -1
  74. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  75. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  76. package/dist/sdk/segment.js +1 -1
  77. package/dist/sdk/user.js +1 -1
  78. package/dist/sdk/workflow.js +1 -1
  79. package/dist/types/endpoints.js +1 -1
  80. package/dist/types/index.js +1 -1
  81. package/dist/utils/agent-ref-parser.js +1 -1
  82. package/dist/utils/async.js +1 -1
  83. package/dist/utils/chat-cache.js +1 -1
  84. package/dist/utils/colors.js +1 -1
  85. package/dist/utils/command-output.js +1 -1
  86. package/dist/utils/constants.js +1 -1
  87. package/dist/utils/diff.js +1 -1
  88. package/dist/utils/fields-display.js +1 -1
  89. package/dist/utils/file-permissions.js +1 -1
  90. package/dist/utils/format-detector.js +1 -1
  91. package/dist/utils/formatters.js +1 -1
  92. package/dist/utils/json-loader.js +1 -1
  93. package/dist/utils/llm-backup-utils.js +1 -1
  94. package/dist/utils/model-aliases.js +1 -1
  95. package/dist/utils/model-factors.js +1 -1
  96. package/dist/utils/option-validation.js +1 -1
  97. package/dist/utils/port.js +1 -1
  98. package/dist/utils/process.d.ts.map +1 -1
  99. package/dist/utils/process.js +1 -1
  100. package/dist/utils/process.js.map +1 -1
  101. package/dist/utils/prompt.js +1 -1
  102. package/dist/utils/segment-path-parser.js +1 -1
  103. package/dist/utils/segment-ref-parser.js +1 -1
  104. package/dist/utils/spinner.js +1 -1
  105. package/dist/utils/sql-parser.js +1 -1
  106. package/dist/utils/sse-parser.js +1 -1
  107. package/dist/utils/string-utils.js +1 -1
  108. package/dist/utils/table-ref-parser.js +1 -1
  109. package/dist/utils/tdx-config.js +1 -1
  110. package/dist/utils/tdx-logger.js +1 -1
  111. package/dist/utils/tree-formatter.js +1 -1
  112. package/dist/utils/version-check.js +1 -1
  113. package/dist/utils/workflow-utils.js +1 -1
  114. package/package.json +1 -1
@@ -1 +1 @@
1
- const a12_0x1a6808=a12_0x369f;(function(_0x3ce2fc,_0xea4bfa){const _0x3c33ab=a12_0x369f,_0xa8a84f=_0x3ce2fc();while(!![]){try{const _0x460473=parseInt(_0x3c33ab(0x1d6))/0x1+parseInt(_0x3c33ab(0x1d4))/0x2*(parseInt(_0x3c33ab(0x1b8))/0x3)+-parseInt(_0x3c33ab(0x1cc))/0x4+-parseInt(_0x3c33ab(0x1bd))/0x5*(-parseInt(_0x3c33ab(0x1d5))/0x6)+parseInt(_0x3c33ab(0x1c4))/0x7*(parseInt(_0x3c33ab(0x1b3))/0x8)+-parseInt(_0x3c33ab(0x1a5))/0x9+-parseInt(_0x3c33ab(0x1d1))/0xa*(parseInt(_0x3c33ab(0x1b6))/0xb);if(_0x460473===_0xea4bfa)break;else _0xa8a84f['push'](_0xa8a84f['shift']());}catch(_0xe126aa){_0xa8a84f['push'](_0xa8a84f['shift']());}}}(a12_0x2d7a,0x3ef34));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a12_0x369f(_0x317bf0,_0x41f361){_0x317bf0=_0x317bf0-0x1a1;const _0x2d7a6a=a12_0x2d7a();let _0x369fb5=_0x2d7a6a[_0x317bf0];return _0x369fb5;}import{writeFileSync}from'fs';import{getEndpoint}from'../types/index.js';function a12_0x2d7a(){const _0x3f3a03=['validate','10xBRdZz','llm','verbose','544916RTOiCz','1226634NKioYz','462711WTAXsT','message','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','PATCH','workflow','Endpoint\x20must\x20start\x20with\x20/:\x20','description','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','keys','noColor','method','DELETE','output','<\x20HTTP/1.1\x20','1719828bPNgCK','error','substring','\x0aStack\x20trace:\x0a','Error:\x20','x-xsrf-token','set-cookie2','join','cdp','authorization','api','log','Invalid\x20HTTP\x20method:\x20','headers','2866696gOmAdZ','x-trino-user','PUT','8586193jhMSGy','site','3sflqcD','Invalid\x20header\x20format:\x20\x22','toLowerCase','type','proxy-authorization','5AxDWqT','readBodyFromFile','file','name','stack','x-auth-token','length','7nEaxQd','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','body','\x22.\x20','GET','toUpperCase','indexOf','color','273784iRXlCo','trim','POST','execute'];a12_0x2d7a=function(){return _0x3f3a03;};return a12_0x2d7a();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a12_0x1a6808(0x1ae),a12_0x1a6808(0x1bc),'cookie','set-cookie',a12_0x1a6808(0x1ab),a12_0x1a6808(0x1aa),a12_0x1a6808(0x1c2),a12_0x1a6808(0x1b4)]);function isSensitiveHeader(_0x31058a){const _0x3b5da3=a12_0x1a6808;return SENSITIVE_HEADERS['has'](_0x31058a[_0x3b5da3(0x1ba)]());}function parseHeader(_0x2c816f){const _0x530159=a12_0x1a6808,_0x22982a=_0x2c816f[_0x530159(0x1ca)](':');if(_0x22982a===-0x1)throw new Error(_0x530159(0x1b9)+_0x2c816f+_0x530159(0x1c7)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x497bd6=_0x2c816f[_0x530159(0x1a7)](0x0,_0x22982a)[_0x530159(0x1cd)](),_0x45ed66=_0x2c816f[_0x530159(0x1a7)](_0x22982a+0x1)[_0x530159(0x1cd)]();if(!_0x497bd6)throw new Error(_0x530159(0x1dd)+_0x2c816f+'\x22');return[_0x497bd6,_0x45ed66];}export class ApiCommand extends BaseCommand{[a12_0x1a6808(0x1c0)]=a12_0x1a6808(0x1af);[a12_0x1a6808(0x1dc)]=a12_0x1a6808(0x1c5);[a12_0x1a6808(0x1d0)](_0x5f8dc2){const _0x4c53fa=a12_0x1a6808,{args:_0x490b66,options:_0x3d3a63}=_0x5f8dc2,_0x4974b4=_0x3d3a63;if(_0x490b66[_0x4c53fa(0x1c3)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x3cb710=_0x490b66[0x0];if(!_0x3cb710['startsWith']('/'))return _0x4c53fa(0x1db)+_0x3cb710;const _0x1150ca=_0x4974b4['data'],_0x52a674=_0x4974b4[_0x4c53fa(0x1bf)];if(_0x1150ca&&_0x52a674)return _0x4c53fa(0x1d8);const _0x22a4f=_0x4974b4[_0x4c53fa(0x1a1)]||_0x4c53fa(0x1c8),_0x40be94=['GET',_0x4c53fa(0x1ce),_0x4c53fa(0x1b5),_0x4c53fa(0x1a2),_0x4c53fa(0x1d9)];if(!_0x40be94['includes'](_0x22a4f[_0x4c53fa(0x1c9)]()))return _0x4c53fa(0x1b1)+_0x22a4f+'.\x20Valid\x20methods:\x20'+_0x40be94[_0x4c53fa(0x1ac)](',\x20');const _0x49d057=_0x4974b4[_0x4c53fa(0x1bb)]||'td',_0x5f4bc2=['td',_0x4c53fa(0x1ad),_0x4c53fa(0x1da),'trino',_0x4c53fa(0x1d2)];if(!_0x5f4bc2['includes'](_0x49d057))return'Invalid\x20API\x20type:\x20'+_0x49d057+'.\x20Valid\x20types:\x20'+_0x5f4bc2['join'](',\x20');return undefined;}async[a12_0x1a6808(0x1cf)](_0x5c539a){const _0x2dd845=a12_0x1a6808,{options:_0x4ea116,args:_0x59b399,tdx:_0x2cd0b4}=_0x5c539a,_0x144e19=_0x4ea116,_0x5d88e8=_0x59b399[0x0],_0x592d02=(_0x144e19[_0x2dd845(0x1a1)]||_0x2dd845(0x1c8))[_0x2dd845(0x1c9)](),_0x11b053=_0x144e19['data'],_0x2904e4=_0x144e19['file'],_0x53fe17=_0x144e19['header'],_0x46de2a=_0x144e19[_0x2dd845(0x1bb)]||'td';try{const _0x5e79ff={};if(_0x53fe17){const _0x2eb61e=Array['isArray'](_0x53fe17)?_0x53fe17:[_0x53fe17];for(const _0x4acb14 of _0x2eb61e){const [_0x479f2b,_0x4dfd53]=parseHeader(_0x4acb14);_0x5e79ff[_0x479f2b]=_0x4dfd53;}}let _0x20b301;if(_0x11b053)_0x20b301=_0x11b053;else{if(_0x2904e4)try{_0x20b301=RawAPI[_0x2dd845(0x1be)](_0x2904e4);}catch(_0x425e4a){return console[_0x2dd845(0x1a6)](_0x2dd845(0x1a9)+(_0x425e4a instanceof Error?_0x425e4a[_0x2dd845(0x1d7)]:String(_0x425e4a))),0x1;}}const _0x5b946e={'method':_0x592d02,'apiType':_0x46de2a,'includeHeaders':_0x4ea116[_0x2dd845(0x1d3)]};_0x20b301&&(_0x5b946e[_0x2dd845(0x1c6)]=_0x20b301);Object[_0x2dd845(0x1de)](_0x5e79ff)[_0x2dd845(0x1c3)]>0x0&&(_0x5b946e[_0x2dd845(0x1b2)]=_0x5e79ff);if(_0x4ea116[_0x2dd845(0x1d3)]){const _0xf24010=resolveSite(_0x4ea116[_0x2dd845(0x1b7)]),_0x400864=getEndpoint(_0xf24010,_0x46de2a),_0x62f5ac=''+_0x400864+_0x5d88e8;console[_0x2dd845(0x1a6)]('>\x20'+_0x592d02+'\x20'+_0x62f5ac);const _0x40537a=getAuthHeaders(_0xf24010),_0x1f8989={..._0x40537a,..._0x5e79ff};for(const [_0x3e41fe,_0x24c683]of Object['entries'](_0x1f8989)){!isSensitiveHeader(_0x3e41fe)&&console[_0x2dd845(0x1a6)]('>\x20'+_0x3e41fe+':\x20'+_0x24c683);}_0x20b301&&console[_0x2dd845(0x1a6)]('>'),console[_0x2dd845(0x1a6)]('');}const _0x177a3b=await _0x2cd0b4[_0x2dd845(0x1af)]['request'](_0x5d88e8,_0x5b946e);if(_0x4ea116[_0x2dd845(0x1d3)]&&_0x177a3b['headers']){console['error'](_0x2dd845(0x1a4)+_0x177a3b['status']);for(const [_0x5bde32,_0x2f7e28]of Object['entries'](_0x177a3b['headers'])){!isSensitiveHeader(_0x5bde32)&&console[_0x2dd845(0x1a6)]('<\x20'+_0x5bde32+':\x20'+_0x2f7e28);}console[_0x2dd845(0x1a6)]('');}const _0x1583a5=Boolean(_0x4ea116[_0x2dd845(0x1a3)]),_0x1b60e9={'color':_0x4ea116[_0x2dd845(0x1cb)],'noColor':_0x4ea116[_0x2dd845(0x1df)]||_0x1583a5&&!_0x4ea116[_0x2dd845(0x1cb)]},_0xdfd1f7=colorizeJSON(_0x177a3b['data'],_0x1b60e9);return _0x4ea116[_0x2dd845(0x1a3)]?(writeFileSync(_0x4ea116[_0x2dd845(0x1a3)],_0xdfd1f7),console[_0x2dd845(0x1a6)]('Results\x20saved\x20to\x20'+_0x4ea116[_0x2dd845(0x1a3)])):console[_0x2dd845(0x1b0)](_0xdfd1f7),0x0;}catch(_0x55d675){return _0x55d675 instanceof Error?(console['error'](_0x2dd845(0x1a9)+_0x55d675[_0x2dd845(0x1d7)]),_0x4ea116[_0x2dd845(0x1d3)]&&_0x55d675[_0x2dd845(0x1c1)]&&console[_0x2dd845(0x1a6)](_0x2dd845(0x1a8)+_0x55d675[_0x2dd845(0x1c1)])):console['error'](_0x2dd845(0x1a9)+String(_0x55d675)),0x1;}}}
1
+ const a12_0xe8103d=a12_0x5c58;(function(_0x3dc852,_0xa1524d){const _0x4ced49=a12_0x5c58,_0x280fbf=_0x3dc852();while(!![]){try{const _0x1b46ca=parseInt(_0x4ced49(0xbb))/0x1*(parseInt(_0x4ced49(0xdf))/0x2)+parseInt(_0x4ced49(0xe9))/0x3*(parseInt(_0x4ced49(0xd7))/0x4)+parseInt(_0x4ced49(0xdb))/0x5+-parseInt(_0x4ced49(0xf7))/0x6*(parseInt(_0x4ced49(0xe7))/0x7)+-parseInt(_0x4ced49(0xf3))/0x8+-parseInt(_0x4ced49(0xb8))/0x9*(-parseInt(_0x4ced49(0xf1))/0xa)+-parseInt(_0x4ced49(0xc9))/0xb;if(_0x1b46ca===_0xa1524d)break;else _0x280fbf['push'](_0x280fbf['shift']());}catch(_0x699ec){_0x280fbf['push'](_0x280fbf['shift']());}}}(a12_0x5524,0xa69f0));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a12_0x5c58(_0x5a5581,_0x56af1c){_0x5a5581=_0x5a5581-0xb5;const _0x5524e1=a12_0x5524();let _0x5c585f=_0x5524e1[_0x5a5581];return _0x5c585f;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a12_0x5524(){const _0x157374=['Invalid\x20API\x20type:\x20','length','133476XeSaxX','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','toLowerCase','color','72fxzgpD','api','workflow','43347hZnFrf','POST','\x0aStack\x20trace:\x0a','cdp','output','body','<\x20HTTP/1.1\x20','Results\x20saved\x20to\x20','toUpperCase','PUT','Endpoint\x20must\x20start\x20with\x20/:\x20','includes','startsWith','\x22.\x20','7223744fJZShW','message','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-xsrf-token','verbose','data','indexOf','keys','set-cookie','validate','file','readBodyFromFile','isArray','header','52HfwkxD','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','entries','DELETE','1860355RiCvqC','GET','join','headers','54YvrwLz','method','name','set-cookie2','authorization','trim','request','Invalid\x20HTTP\x20method:\x20','203iPDuot','trino','19560cZEpaV','substring','log','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','stack','noColor','Error:\x20','type','1395950lNhiWQ','error','6077136FGMvTA','site'];a12_0x5524=function(){return _0x157374;};return a12_0x5524();}import{getEndpoint}from'../types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a12_0xe8103d(0xe3),'proxy-authorization','cookie',a12_0xe8103d(0xd1),a12_0xe8103d(0xe2),a12_0xe8103d(0xcc),'x-auth-token','x-trino-user']);function isSensitiveHeader(_0x54f9b6){const _0x178103=a12_0xe8103d;return SENSITIVE_HEADERS['has'](_0x54f9b6[_0x178103(0xb6)]());}function parseHeader(_0x37a64e){const _0x3ac3f8=a12_0xe8103d,_0x54068d=_0x37a64e[_0x3ac3f8(0xcf)](':');if(_0x54068d===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x37a64e+_0x3ac3f8(0xc8)+_0x3ac3f8(0xcb));const _0x3aa0a4=_0x37a64e[_0x3ac3f8(0xea)](0x0,_0x54068d)[_0x3ac3f8(0xe4)](),_0x48eddf=_0x37a64e[_0x3ac3f8(0xea)](_0x54068d+0x1)[_0x3ac3f8(0xe4)]();if(!_0x3aa0a4)throw new Error(_0x3ac3f8(0xb5)+_0x37a64e+'\x22');return[_0x3aa0a4,_0x48eddf];}export class ApiCommand extends BaseCommand{[a12_0xe8103d(0xe1)]=a12_0xe8103d(0xb9);['description']=a12_0xe8103d(0xec);[a12_0xe8103d(0xd2)](_0x3338ea){const _0x22b456=a12_0xe8103d,{args:_0x12860d,options:_0x109a81}=_0x3338ea,_0xa2602=_0x109a81;if(_0x12860d[_0x22b456(0xf6)]===0x0)return _0x22b456(0xd8);const _0x350c33=_0x12860d[0x0];if(!_0x350c33[_0x22b456(0xc7)]('/'))return _0x22b456(0xc5)+_0x350c33;const _0x22cbfd=_0xa2602[_0x22b456(0xce)],_0x32eb11=_0xa2602['file'];if(_0x22cbfd&&_0x32eb11)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x2ae9e3=_0xa2602['method']||_0x22b456(0xdc),_0x5d5339=[_0x22b456(0xdc),_0x22b456(0xbc),_0x22b456(0xc4),_0x22b456(0xda),'PATCH'];if(!_0x5d5339[_0x22b456(0xc6)](_0x2ae9e3[_0x22b456(0xc3)]()))return _0x22b456(0xe6)+_0x2ae9e3+'.\x20Valid\x20methods:\x20'+_0x5d5339[_0x22b456(0xdd)](',\x20');const _0x29c33c=_0xa2602[_0x22b456(0xf0)]||'td',_0xff4816=['td',_0x22b456(0xbe),_0x22b456(0xba),_0x22b456(0xe8),'llm'];if(!_0xff4816['includes'](_0x29c33c))return _0x22b456(0xf5)+_0x29c33c+'.\x20Valid\x20types:\x20'+_0xff4816['join'](',\x20');return undefined;}async['execute'](_0x384512){const _0x495a67=a12_0xe8103d,{options:_0x26a05e,args:_0x1d701c,tdx:_0x442d42}=_0x384512,_0x34817b=_0x26a05e,_0x1d7843=_0x1d701c[0x0],_0x518400=(_0x34817b[_0x495a67(0xe0)]||_0x495a67(0xdc))[_0x495a67(0xc3)](),_0x364cdf=_0x34817b[_0x495a67(0xce)],_0x1b12b0=_0x34817b[_0x495a67(0xd3)],_0x3a3f69=_0x34817b[_0x495a67(0xd6)],_0x34a21c=_0x34817b[_0x495a67(0xf0)]||'td';try{const _0x24b138={};if(_0x3a3f69){const _0x28ea57=Array[_0x495a67(0xd5)](_0x3a3f69)?_0x3a3f69:[_0x3a3f69];for(const _0x39647c of _0x28ea57){const [_0x26935f,_0x2c4b27]=parseHeader(_0x39647c);_0x24b138[_0x26935f]=_0x2c4b27;}}let _0x4d2b7e;if(_0x364cdf)_0x4d2b7e=_0x364cdf;else{if(_0x1b12b0)try{_0x4d2b7e=RawAPI[_0x495a67(0xd4)](_0x1b12b0);}catch(_0x178342){return console[_0x495a67(0xf2)]('Error:\x20'+(_0x178342 instanceof Error?_0x178342[_0x495a67(0xca)]:String(_0x178342))),0x1;}}const _0x15c8a3={'method':_0x518400,'apiType':_0x34a21c,'includeHeaders':_0x26a05e[_0x495a67(0xcd)]};_0x4d2b7e&&(_0x15c8a3[_0x495a67(0xc0)]=_0x4d2b7e);Object[_0x495a67(0xd0)](_0x24b138)[_0x495a67(0xf6)]>0x0&&(_0x15c8a3[_0x495a67(0xde)]=_0x24b138);if(_0x26a05e['verbose']){const _0x2c20ce=resolveSite(_0x26a05e[_0x495a67(0xf4)]),_0x1958f6=getEndpoint(_0x2c20ce,_0x34a21c),_0xb734ad=''+_0x1958f6+_0x1d7843;console[_0x495a67(0xf2)]('>\x20'+_0x518400+'\x20'+_0xb734ad);const _0x4660ee=getAuthHeaders(_0x2c20ce),_0x5ef19e={..._0x4660ee,..._0x24b138};for(const [_0xb74cfb,_0x6870a4]of Object[_0x495a67(0xd9)](_0x5ef19e)){!isSensitiveHeader(_0xb74cfb)&&console[_0x495a67(0xf2)]('>\x20'+_0xb74cfb+':\x20'+_0x6870a4);}_0x4d2b7e&&console[_0x495a67(0xf2)]('>'),console[_0x495a67(0xf2)]('');}const _0x744662=await _0x442d42[_0x495a67(0xb9)][_0x495a67(0xe5)](_0x1d7843,_0x15c8a3);if(_0x26a05e['verbose']&&_0x744662[_0x495a67(0xde)]){console[_0x495a67(0xf2)](_0x495a67(0xc1)+_0x744662['status']);for(const [_0x153ce1,_0x425e34]of Object[_0x495a67(0xd9)](_0x744662[_0x495a67(0xde)])){!isSensitiveHeader(_0x153ce1)&&console['error']('<\x20'+_0x153ce1+':\x20'+_0x425e34);}console[_0x495a67(0xf2)]('');}const _0x3ca8c5=Boolean(_0x26a05e[_0x495a67(0xbf)]),_0x5077f6={'color':_0x26a05e[_0x495a67(0xb7)],'noColor':_0x26a05e[_0x495a67(0xee)]||_0x3ca8c5&&!_0x26a05e['color']},_0x65785c=colorizeJSON(_0x744662['data'],_0x5077f6);return _0x26a05e[_0x495a67(0xbf)]?(writeFileSync(_0x26a05e[_0x495a67(0xbf)],_0x65785c),console[_0x495a67(0xf2)](_0x495a67(0xc2)+_0x26a05e[_0x495a67(0xbf)])):console[_0x495a67(0xeb)](_0x65785c),0x0;}catch(_0x2ba4eb){return _0x2ba4eb instanceof Error?(console[_0x495a67(0xf2)](_0x495a67(0xef)+_0x2ba4eb[_0x495a67(0xca)]),_0x26a05e[_0x495a67(0xcd)]&&_0x2ba4eb[_0x495a67(0xed)]&&console[_0x495a67(0xf2)](_0x495a67(0xbd)+_0x2ba4eb[_0x495a67(0xed)])):console[_0x495a67(0xf2)](_0x495a67(0xef)+String(_0x2ba4eb)),0x1;}}}
@@ -1 +1 @@
1
- const a13_0x560beb=a13_0x28e6;(function(_0x43b650,_0x209b4b){const _0x369a11=a13_0x28e6,_0x51dff9=_0x43b650();while(!![]){try{const _0x3ee1ae=-parseInt(_0x369a11(0xa0))/0x1+parseInt(_0x369a11(0xd5))/0x2+-parseInt(_0x369a11(0xda))/0x3+parseInt(_0x369a11(0xd8))/0x4+-parseInt(_0x369a11(0xaf))/0x5+-parseInt(_0x369a11(0xe2))/0x6+parseInt(_0x369a11(0xe5))/0x7;if(_0x3ee1ae===_0x209b4b)break;else _0x51dff9['push'](_0x51dff9['shift']());}catch(_0x907959){_0x51dff9['push'](_0x51dff9['shift']());}}}(a13_0x5ebb,0x66c2f));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_0xc550f6 from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';function a13_0x28e6(_0x4e89ef,_0x2ea15c){_0x4e89ef=_0x4e89ef-0x9f;const _0x5ebb5b=a13_0x5ebb();let _0x28e668=_0x5ebb5b[_0x4e89ef];return _0x28e668;}import{LogLevel}from'../utils/tdx-logger.js';import a13_0x5350f5 from'chalk';function a13_0x5ebb(){const _0x5932e7=['N/A','log','Site\x20name\x20cannot\x20be\x20empty','getUserInfo','tdx:\x20auth\x20setup','customSite','Name:\x20','Setup\x20API\x20key\x20authentication\x20interactively','first_name','jobs','Select\x20your\x20Treasure\x20Data\x20site:','apiKey','warn','2307745uNrQMv','auth','us01','jp01','site','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','message','\x20(profile:\x20','execute','profile','green','trim','other','findIndex','✓\x20Authentication\x20successful\x0a','value','push','\x0aSetup\x20cancelled','Enter\x20site\x20name:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','ap02\x20-\x20Korea','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth:setup','✗\x20Validation\x20failed:\x20','email','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','last_name','name','/app/mp/ak','create','You\x20can\x20find\x20your\x20API\x20key\x20at:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20\x20tdx','Read\x20credential\x20from\x20','User:\x20','filter','error','Validating\x20API\x20key...','1471844BAjyOP','Enter\x20custom\x20site','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','127108LWMMzn','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','1741425FCpIqw','\x20(site:\x20','yellow','jp\x20\x20\x20-\x20Japan','logLevel','ERROR','API\x20key\x20cannot\x20be\x20empty','Enter\x20your\x20TD\x20API\x20key:','3706554oZYaDv','System\x20keychain\x20is\x20not\x20available','test','14481635TAUbiF','tdx:\x20auth\x20clear','length','description','755810VdlfeM','text'];a13_0x5ebb=function(){return _0x5932e7;};return a13_0x5ebb();}export class AuthSetupCommand extends BaseCommand{['name']=a13_0x560beb(0xc5);[a13_0x560beb(0x9f)]=a13_0x560beb(0xa9);async[a13_0x560beb(0xb7)](_0x222256){const _0x18f3ad=a13_0x560beb,{options:_0x2d8b38}=_0x222256,_0x3353fc=_0x2d8b38[_0x18f3ad(0xb8)];console[_0x18f3ad(0xa3)](a13_0x5350f5['bold'](_0x18f3ad(0xa6)));const _0x5b5844=_0x2d8b38[_0x18f3ad(0xb3)]||_0x18f3ad(0xb1),_0x24c41a=[{'title':'us\x20\x20\x20-\x20United\x20States','value':_0x18f3ad(0xb1)},{'title':_0x18f3ad(0xdd),'value':_0x18f3ad(0xb2)},{'title':'eu\x20\x20\x20-\x20Europe','value':'eu01'},{'title':_0x18f3ad(0xc3),'value':'ap02'}];let _0x53cf06=_0x24c41a[_0x18f3ad(0xbc)](_0x367c5c=>_0x367c5c[_0x18f3ad(0xbe)]===_0x5b5844);_0x53cf06===-0x1&&_0x5b5844!==_0x18f3ad(0xb1)&&(_0x24c41a[_0x18f3ad(0xbf)]({'title':_0x5b5844,'value':_0x5b5844}),_0x53cf06=_0x24c41a[_0x18f3ad(0xe7)]-0x1);_0x24c41a['push']({'title':_0x18f3ad(0xd6),'value':_0x18f3ad(0xbb)});const _0xc8619d=_0x3353fc?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x3353fc+'):':_0x18f3ad(0xac),_0x4eaac8=await a13_0xc550f6({'type':'select','name':_0x18f3ad(0xb3),'message':_0xc8619d,'choices':_0x24c41a,'initial':_0x53cf06>=0x0?_0x53cf06:0x0});if(!_0x4eaac8[_0x18f3ad(0xb3)])return console[_0x18f3ad(0xa3)]('\x0aSetup\x20cancelled'),0x1;let _0x5afe4c;if(_0x4eaac8['site']===_0x18f3ad(0xbb)){const _0x339739=await a13_0xc550f6({'type':_0x18f3ad(0xa1),'name':_0x18f3ad(0xa7),'message':_0x18f3ad(0xc1),'initial':_0x18f3ad(0xb1),'validate':_0x21eba1=>{const _0x7dde9d=_0x18f3ad;if(!_0x21eba1||!_0x21eba1[_0x7dde9d(0xba)]())return _0x7dde9d(0xa4);if(!/^[a-z0-9-]+$/[_0x7dde9d(0xe4)](_0x21eba1[_0x7dde9d(0xba)]()))return _0x7dde9d(0xc8);return!![];}});if(!_0x339739[_0x18f3ad(0xa7)])return console['log'](_0x18f3ad(0xc0)),0x1;_0x5afe4c=_0x339739['customSite'];}else _0x5afe4c=_0x4eaac8[_0x18f3ad(0xb3)];const _0x130416=resolveSite(_0x5afe4c);console[_0x18f3ad(0xa3)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x130416),console['log'](_0x18f3ad(0xcd)),console[_0x18f3ad(0xa3)]('\x20\x20'+getConsoleUrl(_0x130416,_0x18f3ad(0xcb)));const _0x590026=await a13_0xc550f6({'type':'password','name':_0x18f3ad(0xad),'message':_0x18f3ad(0xe1),'validate':_0x28be5f=>{const _0x10027e=_0x18f3ad;if(!_0x28be5f||!_0x28be5f['trim']())return _0x10027e(0xe0);return!![];}});if(!_0x590026[_0x18f3ad(0xad)])return console[_0x18f3ad(0xa3)](_0x18f3ad(0xc0)),0x1;const _0x5d2611=_0x590026[_0x18f3ad(0xad)];console['log'](_0x18f3ad(0xd4));try{const _0x216215=TDX[_0x18f3ad(0xcc)]({'site':_0x130416,'apiKey':_0x5d2611[_0x18f3ad(0xba)](),'logLevel':_0x2d8b38[_0x18f3ad(0xde)]??LogLevel[_0x18f3ad(0xdf)]}),_0x32295c=await _0x216215[_0x18f3ad(0xab)]['getUserInfo']();console[_0x18f3ad(0xa3)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x32295c[_0x18f3ad(0xc7)]+')');const _0x2e5a76=await isKeychainAvailable();_0x2e5a76?(await saveAPIKeyAsync(_0x5d2611[_0x18f3ad(0xba)](),_0x130416,_0x3353fc),console[_0x18f3ad(0xa3)](_0x18f3ad(0xb4)+(_0x3353fc?_0x18f3ad(0xb6)+_0x3353fc+')':''))):(console['warn'](a13_0x5350f5['yellow'](_0x18f3ad(0xce))),console[_0x18f3ad(0xae)](a13_0x5350f5[_0x18f3ad(0xdc)](_0x18f3ad(0xd7))));if(_0x3353fc){const _0x419474={'site':_0x130416};saveProfileToUserConfig(_0x3353fc,_0x419474),console[_0x18f3ad(0xa3)]('✓\x20Profile\x20\x27'+_0x3353fc+'\x27\x20registered');}const _0x131186=_0x3353fc?'\x20--profile\x20'+_0x3353fc:'';return console['log'](),console['log'](_0x18f3ad(0xc2)),console['log'](_0x18f3ad(0xcf)+_0x131186+_0x18f3ad(0xc4)),console[_0x18f3ad(0xa3)](_0x18f3ad(0xcf)+_0x131186+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2f8548){if(_0x2f8548 instanceof HTTPClientError&&_0x2f8548['status']===0x191)return printAuthError(_0x2f8548),0x1;return console[_0x18f3ad(0xd3)](a13_0x5350f5['red'](_0x18f3ad(0xc6)+(_0x2f8548 instanceof Error?_0x2f8548[_0x18f3ad(0xb5)]:String(_0x2f8548)))),console[_0x18f3ad(0xd3)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a13_0x560beb(0xca)]=a13_0x560beb(0xb0);[a13_0x560beb(0x9f)]=a13_0x560beb(0xd9);async[a13_0x560beb(0xb7)](_0x9173ab){const _0x577c22=a13_0x560beb,{options:_0x589284,tdx:_0x3e05ac}=_0x9173ab,_0x3f691f=_0x589284[_0x577c22(0xb3)],_0x32ef81=_0x589284[_0x577c22(0xb8)],_0xf8a435=_0x32ef81?_0x32ef81:_0x577c22(0xa2);console[_0x577c22(0xa3)]('tdx\x20profile:\x20'+_0xf8a435+_0x577c22(0xdb)+_0x3f691f+')');const _0x5eeff4=await resolveAPIKeyAsync(_0x3f691f,_0x32ef81);if(_0x5eeff4){const {source:_0x1720e3,isDeprecated:_0x406a2d}=_0x5eeff4,_0xe863d3=_0x577c22(0xd0)+_0x1720e3;console['log'](_0x406a2d?a13_0x5350f5['yellow'](_0xe863d3):_0xe863d3);}else console[_0x577c22(0xa3)](a13_0x5350f5['yellow']('No\x20credential\x20found'));try{const _0x3541b4=await _0x3e05ac[_0x577c22(0xab)][_0x577c22(0xa5)]();return console['log'](a13_0x5350f5[_0x577c22(0xb9)](_0x577c22(0xbd))),console[_0x577c22(0xa3)](_0x577c22(0xd1)+_0x3541b4[_0x577c22(0xc7)]),(_0x3541b4['first_name']||_0x3541b4[_0x577c22(0xc9)])&&console[_0x577c22(0xa3)](_0x577c22(0xa8)+[_0x3541b4[_0x577c22(0xaa)],_0x3541b4[_0x577c22(0xc9)]][_0x577c22(0xd2)](Boolean)['join']('\x20')),0x0;}catch(_0x49a17e){return _0x49a17e instanceof HTTPClientError&&_0x49a17e['status']===0x191?printAuthError(_0x49a17e,!![],_0x32ef81):console[_0x577c22(0xd3)](a13_0x5350f5['red'](_0x577c22(0xc6)+(_0x49a17e instanceof Error?_0x49a17e[_0x577c22(0xb5)]:String(_0x49a17e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x49c37d){const _0x3bcbf5=a13_0x560beb,{options:_0x2bfb6f}=_0x49c37d,_0xd1948=_0x2bfb6f['profile'];console[_0x3bcbf5(0xa3)](a13_0x5350f5['bold'](_0x3bcbf5(0xe6)));const _0x42fbb0=await isKeychainAvailable();if(!_0x42fbb0)return console[_0x3bcbf5(0xd3)](a13_0x5350f5['red'](_0x3bcbf5(0xe3))),0x1;const _0xc40e39=await deleteKeychainAPIKey(_0xd1948);return _0xc40e39?(clearCredentialCache(),console[_0x3bcbf5(0xa3)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0xd1948?_0x3bcbf5(0xb6)+_0xd1948+')':'')),0x0):(console[_0x3bcbf5(0xa3)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0xd1948?'\x20for\x20profile:\x20'+_0xd1948:'')),0x1);}}
1
+ const a13_0x26bbd4=a13_0x3aee;(function(_0x41b8ac,_0x5cb678){const _0x26b94d=a13_0x3aee,_0x1acced=_0x41b8ac();while(!![]){try{const _0x45c01d=-parseInt(_0x26b94d(0x1b6))/0x1*(-parseInt(_0x26b94d(0x1e4))/0x2)+-parseInt(_0x26b94d(0x1d8))/0x3+-parseInt(_0x26b94d(0x1a3))/0x4+parseInt(_0x26b94d(0x1aa))/0x5*(-parseInt(_0x26b94d(0x19b))/0x6)+-parseInt(_0x26b94d(0x1e6))/0x7+parseInt(_0x26b94d(0x1b4))/0x8+parseInt(_0x26b94d(0x1d2))/0x9*(parseInt(_0x26b94d(0x1c1))/0xa);if(_0x45c01d===_0x5cb678)break;else _0x1acced['push'](_0x1acced['shift']());}catch(_0x306576){_0x1acced['push'](_0x1acced['shift']());}}}(a13_0x2521,0x5eadd));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a13_0x2521(){const _0x13da09=['Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','error','auth:clear','trim','name','2856200iGIdWC','jobs','904xbymlX','log','\x20\x20tdx','profile','password','ap02\x20-\x20Korea','last_name','description','execute','email','auth:setup','8363220WjQvdJ','bold','\x20--profile\x20','status','logLevel','\x27\x20registered','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','tdx:\x20auth\x20clear','us01','message','join','API\x20key\x20cannot\x20be\x20empty','✓\x20Authentication\x20successful\x0a','tdx:\x20auth\x20setup','yellow','Select\x20your\x20Treasure\x20Data\x20site:','other','9UpWEPM','System\x20keychain\x20is\x20not\x20available','eu01','filter','Setting\x20up\x20authentication\x20for\x20site:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','1149183CATMGF','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','red','apiKey','Name:\x20','✓\x20API\x20key\x20removed\x20from\x20keychain','Enter\x20your\x20TD\x20API\x20key:','No\x20API\x20key\x20found\x20in\x20keychain','Enter\x20site\x20name:','tdx\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','value','462Cxyhnt','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','2005276hYBJju','\x0aSetup\x20cancelled','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','N/A','customSite','ERROR','You\x20can\x20find\x20your\x20API\x20key\x20at:','21426LUWwRW','jp01','Setup\x20API\x20key\x20authentication\x20interactively','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','No\x20credential\x20found','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✗\x20Validation\x20failed:\x20','✓\x20Profile\x20\x27','1093668lGRkRw','first_name','jp\x20\x20\x20-\x20Japan','test','User:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Validating\x20API\x20key...','100WSUjaJ','\x20(site:\x20','\x20(profile:\x20','site','Read\x20credential\x20from\x20'];a13_0x2521=function(){return _0x13da09;};return a13_0x2521();}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_0x24ef6f from'prompts';function a13_0x3aee(_0x1052e1,_0x3ff6e0){_0x1052e1=_0x1052e1-0x197;const _0x2521e4=a13_0x2521();let _0x3aee4d=_0x2521e4[_0x1052e1];return _0x3aee4d;}import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a13_0x243572 from'chalk';export class AuthSetupCommand extends BaseCommand{[a13_0x26bbd4(0x1b3)]=a13_0x26bbd4(0x1c0);[a13_0x26bbd4(0x1bd)]=a13_0x26bbd4(0x19d);async[a13_0x26bbd4(0x1be)](_0x366cec){const _0x6eebd2=a13_0x26bbd4,{options:_0xd83f35}=_0x366cec,_0x38ce2a=_0xd83f35[_0x6eebd2(0x1b9)];console[_0x6eebd2(0x1b7)](a13_0x243572[_0x6eebd2(0x1c2)](_0x6eebd2(0x1ce)));const _0x25cae4=_0xd83f35['site']||'us01',_0x2e7d59=[{'title':'us\x20\x20\x20-\x20United\x20States','value':'us01'},{'title':_0x6eebd2(0x1a5),'value':_0x6eebd2(0x19c)},{'title':'eu\x20\x20\x20-\x20Europe','value':_0x6eebd2(0x1d4)},{'title':_0x6eebd2(0x1bb),'value':'ap02'}];let _0x32b354=_0x2e7d59['findIndex'](_0x3d1f10=>_0x3d1f10[_0x6eebd2(0x1e3)]===_0x25cae4);_0x32b354===-0x1&&_0x25cae4!==_0x6eebd2(0x1c9)&&(_0x2e7d59['push']({'title':_0x25cae4,'value':_0x25cae4}),_0x32b354=_0x2e7d59['length']-0x1);_0x2e7d59['push']({'title':'Enter\x20custom\x20site','value':_0x6eebd2(0x1d1)});const _0x3d9681=_0x38ce2a?_0x6eebd2(0x1af)+_0x38ce2a+'):':_0x6eebd2(0x1d0),_0x5849c2=await a13_0x24ef6f({'type':'select','name':_0x6eebd2(0x1ad),'message':_0x3d9681,'choices':_0x2e7d59,'initial':_0x32b354>=0x0?_0x32b354:0x0});if(!_0x5849c2[_0x6eebd2(0x1ad)])return console[_0x6eebd2(0x1b7)]('\x0aSetup\x20cancelled'),0x1;let _0x5e8cf5;if(_0x5849c2[_0x6eebd2(0x1ad)]===_0x6eebd2(0x1d1)){const _0x55484a=await a13_0x24ef6f({'type':'text','name':_0x6eebd2(0x198),'message':_0x6eebd2(0x1e0),'initial':_0x6eebd2(0x1c9),'validate':_0x1599d8=>{const _0x281b92=_0x6eebd2;if(!_0x1599d8||!_0x1599d8[_0x281b92(0x1b2)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x281b92(0x1a6)](_0x1599d8[_0x281b92(0x1b2)]()))return _0x281b92(0x1e5);return!![];}});if(!_0x55484a[_0x6eebd2(0x198)])return console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1e7)),0x1;_0x5e8cf5=_0x55484a[_0x6eebd2(0x198)];}else _0x5e8cf5=_0x5849c2[_0x6eebd2(0x1ad)];const _0x3b1061=resolveSite(_0x5e8cf5);console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1d6)+_0x3b1061),console[_0x6eebd2(0x1b7)](_0x6eebd2(0x19a)),console[_0x6eebd2(0x1b7)]('\x20\x20'+getConsoleUrl(_0x3b1061,'/app/mp/ak'));const _0x165eab=await a13_0x24ef6f({'type':_0x6eebd2(0x1ba),'name':_0x6eebd2(0x1db),'message':_0x6eebd2(0x1de),'validate':_0x1402ac=>{const _0xc10781=_0x6eebd2;if(!_0x1402ac||!_0x1402ac['trim']())return _0xc10781(0x1cc);return!![];}});if(!_0x165eab['apiKey'])return console[_0x6eebd2(0x1b7)]('\x0aSetup\x20cancelled'),0x1;const _0x3d008c=_0x165eab[_0x6eebd2(0x1db)];console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1a9));try{const _0xa2d03e=TDX['create']({'site':_0x3b1061,'apiKey':_0x3d008c[_0x6eebd2(0x1b2)](),'logLevel':_0xd83f35[_0x6eebd2(0x1c5)]??LogLevel[_0x6eebd2(0x199)]}),_0x3dbaa9=await _0xa2d03e[_0x6eebd2(0x1b5)]['getUserInfo']();console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1a0)+_0x3dbaa9[_0x6eebd2(0x1bf)]+')');const _0x5331e1=await isKeychainAvailable();_0x5331e1?(await saveAPIKeyAsync(_0x3d008c['trim'](),_0x3b1061,_0x38ce2a),console[_0x6eebd2(0x1b7)](_0x6eebd2(0x19e)+(_0x38ce2a?_0x6eebd2(0x1ac)+_0x38ce2a+')':''))):(console['warn'](a13_0x243572[_0x6eebd2(0x1cf)](_0x6eebd2(0x1d7))),console['warn'](a13_0x243572['yellow'](_0x6eebd2(0x1c7))));if(_0x38ce2a){const _0x4ab005={'site':_0x3b1061};saveProfileToUserConfig(_0x38ce2a,_0x4ab005),console['log'](_0x6eebd2(0x1a2)+_0x38ce2a+_0x6eebd2(0x1c6));}const _0xd4cdc9=_0x38ce2a?_0x6eebd2(0x1c3)+_0x38ce2a:'';return console[_0x6eebd2(0x1b7)](),console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1d9)),console[_0x6eebd2(0x1b7)]('\x20\x20tdx'+_0xd4cdc9+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1b8)+_0xd4cdc9+_0x6eebd2(0x1a8)),0x0;}catch(_0xe7ed88){if(_0xe7ed88 instanceof HTTPClientError&&_0xe7ed88[_0x6eebd2(0x1c4)]===0x191)return printAuthError(_0xe7ed88),0x1;return console[_0x6eebd2(0x1b0)](a13_0x243572[_0x6eebd2(0x1da)]('✗\x20Validation\x20failed:\x20'+(_0xe7ed88 instanceof Error?_0xe7ed88[_0x6eebd2(0x1ca)]:String(_0xe7ed88)))),console[_0x6eebd2(0x1b0)](_0x6eebd2(0x1e8)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';['description']=a13_0x26bbd4(0x1e9);async[a13_0x26bbd4(0x1be)](_0x39b97d){const _0x2d9b53=a13_0x26bbd4,{options:_0x2e844a,tdx:_0x525809}=_0x39b97d,_0x4ef866=_0x2e844a[_0x2d9b53(0x1ad)],_0x56cec9=_0x2e844a[_0x2d9b53(0x1b9)],_0x52e6cc=_0x56cec9?_0x56cec9:_0x2d9b53(0x197);console['log'](_0x2d9b53(0x1e1)+_0x52e6cc+_0x2d9b53(0x1ab)+_0x4ef866+')');const _0x5845d7=await resolveAPIKeyAsync(_0x4ef866,_0x56cec9);if(_0x5845d7){const {source:_0x470e08,isDeprecated:_0x33eff6}=_0x5845d7,_0x1e010d=_0x2d9b53(0x1ae)+_0x470e08;console[_0x2d9b53(0x1b7)](_0x33eff6?a13_0x243572[_0x2d9b53(0x1cf)](_0x1e010d):_0x1e010d);}else console[_0x2d9b53(0x1b7)](a13_0x243572['yellow'](_0x2d9b53(0x19f)));try{const _0x37c188=await _0x525809[_0x2d9b53(0x1b5)]['getUserInfo']();return console[_0x2d9b53(0x1b7)](a13_0x243572['green'](_0x2d9b53(0x1cd))),console[_0x2d9b53(0x1b7)](_0x2d9b53(0x1a7)+_0x37c188[_0x2d9b53(0x1bf)]),(_0x37c188[_0x2d9b53(0x1a4)]||_0x37c188[_0x2d9b53(0x1bc)])&&console[_0x2d9b53(0x1b7)](_0x2d9b53(0x1dc)+[_0x37c188['first_name'],_0x37c188['last_name']][_0x2d9b53(0x1d5)](Boolean)[_0x2d9b53(0x1cb)]('\x20')),0x0;}catch(_0x36a1eb){return _0x36a1eb instanceof HTTPClientError&&_0x36a1eb[_0x2d9b53(0x1c4)]===0x191?printAuthError(_0x36a1eb,!![],_0x56cec9):console[_0x2d9b53(0x1b0)](a13_0x243572[_0x2d9b53(0x1da)](_0x2d9b53(0x1a1)+(_0x36a1eb instanceof Error?_0x36a1eb[_0x2d9b53(0x1ca)]:String(_0x36a1eb)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a13_0x26bbd4(0x1b1);[a13_0x26bbd4(0x1bd)]=a13_0x26bbd4(0x1e2);async[a13_0x26bbd4(0x1be)](_0x2012c4){const _0x43ea89=a13_0x26bbd4,{options:_0x5e02ba}=_0x2012c4,_0x29e9fd=_0x5e02ba[_0x43ea89(0x1b9)];console['log'](a13_0x243572['bold'](_0x43ea89(0x1c8)));const _0x966893=await isKeychainAvailable();if(!_0x966893)return console[_0x43ea89(0x1b0)](a13_0x243572[_0x43ea89(0x1da)](_0x43ea89(0x1d3))),0x1;const _0x34407d=await deleteKeychainAPIKey(_0x29e9fd);return _0x34407d?(clearCredentialCache(),console[_0x43ea89(0x1b7)](_0x43ea89(0x1dd)+(_0x29e9fd?'\x20(profile:\x20'+_0x29e9fd+')':'')),0x0):(console['log'](_0x43ea89(0x1df)+(_0x29e9fd?'\x20for\x20profile:\x20'+_0x29e9fd:'')),0x1);}}
@@ -1 +1 @@
1
- const a14_0x562863=a14_0x5441;(function(_0x24812e,_0xa8158a){const _0x3d41d1=a14_0x5441,_0x240420=_0x24812e();while(!![]){try{const _0x54fef6=-parseInt(_0x3d41d1(0xca))/0x1+-parseInt(_0x3d41d1(0xe8))/0x2*(parseInt(_0x3d41d1(0xc9))/0x3)+parseInt(_0x3d41d1(0xc5))/0x4+parseInt(_0x3d41d1(0xd6))/0x5*(-parseInt(_0x3d41d1(0xb2))/0x6)+parseInt(_0x3d41d1(0xb8))/0x7*(-parseInt(_0x3d41d1(0xc2))/0x8)+-parseInt(_0x3d41d1(0xd9))/0x9+-parseInt(_0x3d41d1(0xdf))/0xa*(-parseInt(_0x3d41d1(0xe1))/0xb);if(_0x54fef6===_0xa8158a)break;else _0x240420['push'](_0x240420['shift']());}catch(_0x460939){_0x240420['push'](_0x240420['shift']());}}}(a14_0x2463,0x86676));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a14_0x2463(){const _0x228d32=['event','execute','2TvqKuh','Getting\x20agent\x20for\x20model\x20\x27','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','\x27...','functionName','60UuIlHp','error','llm','validate','output','code','6484604diFcOI','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','temperature','chatId','CHAT_NOT_FOUND','content','Agent\x20reference\x20must\x20include\x20project\x20name.\x20Usage:\x20--agent\x20\x22Project/Agent\x22','resolveAgentId','name','resolveProjectId','8wnKaTq','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','handleSSEEvent','2671788cgrARl','tool','metadata','message','608136xGDUcs','371430bhCPrj','stderr','cause','data','join','\x0a[Error:\x20','Continuing\x20chat:\x20','includes','stack','streamChat','\x0aStack\x20trace:','chat','34600WHtVDA','write','verbose','8249508VxdxiB','new','\x20\x20Cause:\x20','\x0a[Tool:\x20','Resolving\x20agent\x20\x27','Chat\x20session:\x20','2110CdaIyw','\x0a[Output:\x20','123497hELsVp','Error:\x20','agent','model','getAgentId'];a14_0x2463=function(){return _0x228d32;};return a14_0x2463();}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';function a14_0x5441(_0x8816f9,_0x3aa1a3){_0x8816f9=_0x8816f9-0xb2;const _0x24631b=a14_0x2463();let _0x5441c9=_0x24631b[_0x8816f9];return _0x5441c9;}import{resolveModelAlias}from'../utils/model-aliases.js';function handleSDKError(_0x453664,_0x7f6602){const _0x2052b0=a14_0x5441;if(_0x453664 instanceof SDKError)console['error'](_0x2052b0(0xe2)+_0x453664[_0x2052b0(0xc8)]),_0x7f6602[_0x2052b0(0xd8)]&&(_0x453664[_0x2052b0(0xcc)]&&console[_0x2052b0(0xb3)](_0x2052b0(0xdb)+_0x453664[_0x2052b0(0xcc)]),_0x453664[_0x2052b0(0xd2)]&&(console['error'](_0x2052b0(0xd4)),console[_0x2052b0(0xb3)](_0x453664[_0x2052b0(0xd2)])));else throw _0x453664;}export class ChatCommand extends BaseCommand{[a14_0x562863(0xc0)]=a14_0x562863(0xd5);['description']=a14_0x562863(0xb9);[a14_0x562863(0xb5)](_0x2fb88e){const _0x3474c2=a14_0x562863,_0x490bfd=_0x2fb88e['args'][_0x3474c2(0xce)]('\x20');if(!_0x490bfd)return _0x3474c2(0xc3);return undefined;}async[a14_0x562863(0xd3)](_0x16f315,_0x997410,_0x11a7aa,_0x1f362c,_0x2ecd53){const _0x3aa801=a14_0x562863;for await(const _0x20d941 of _0x16f315[_0x3aa801(0xb4)][_0x3aa801(0xd5)](_0x997410,{'agentId':_0x11a7aa,'chatId':_0x1f362c})){if(_0x20d941['type']===_0x3aa801(0xc7)){const _0x303867=_0x20d941[_0x3aa801(0xcd)][_0x3aa801(0xbb)];saveLastChatId(_0x303867),_0x2ecd53&&console[_0x3aa801(0xb3)](_0x3aa801(0xde)+_0x303867);}else _0x20d941['type']===_0x3aa801(0xe6)&&this['handleSSEEvent'](_0x20d941[_0x3aa801(0xcd)]);}}async[a14_0x562863(0xe5)](_0x2d16c6,_0x403837,_0x18b1fb,_0x483556,_0x15fc3e){const _0x247046=a14_0x562863;if(_0x403837){const {projectName:_0x5f8277,agentName:_0x2f72ae}=parseAgentRef(_0x403837);if(!_0x2f72ae)throw new Error(_0x247046(0xbe));const _0xb9c322=await withSpinner('Resolving\x20project\x20\x27'+_0x5f8277+_0x247046(0xeb),()=>_0x2d16c6['llm'][_0x247046(0xc1)](_0x5f8277),{'verbose':_0x15fc3e}),_0x3cc661=await withSpinner(_0x247046(0xdd)+_0x2f72ae+_0x247046(0xeb),()=>_0x2d16c6[_0x247046(0xb4)][_0x247046(0xbf)](_0x2f72ae,_0xb9c322[_0x247046(0xcd)]),{'verbose':_0x15fc3e});return _0x3cc661['data'];}else{const _0x163299=_0x18b1fb||'haiku',_0x31fbcc=resolveModelAlias(_0x163299),_0x1be0ba=await withSpinner(_0x247046(0xe9)+_0x31fbcc+'\x27...',()=>_0x2d16c6[_0x247046(0xb4)]['getOrCreateDefaultAgent'](_0x31fbcc,0x0,_0x483556),{'verbose':_0x15fc3e});return _0x1be0ba[_0x247046(0xcd)]['id'];}}async[a14_0x562863(0xe7)](_0x3a115c){const _0xeb82de=a14_0x562863,{options:_0x10a7db,args:_0x4c0a58,tdx:_0x52e8e0}=_0x3a115c,_0x297a0d=_0x4c0a58['join']('\x20'),_0x3e2ebd=_0x10a7db,_0x12b536=_0x3e2ebd[_0xeb82de(0xe3)],_0x25f4f5=_0x3e2ebd[_0xeb82de(0xe4)],_0x23336d=_0x3e2ebd[_0xeb82de(0xba)]?Number(_0x3e2ebd['temperature']):undefined,_0x26e280=_0x3e2ebd[_0xeb82de(0xda)];try{let _0x1c46ce,_0x458a83;!_0x26e280&&(_0x458a83=loadLastChatId(),_0x458a83&&_0x10a7db['verbose']&&console[_0xeb82de(0xb3)](_0xeb82de(0xd0)+_0x458a83));(_0x26e280||!_0x458a83)&&(_0x1c46ce=await this[_0xeb82de(0xe5)](_0x52e8e0,_0x12b536,_0x25f4f5,_0x23336d,_0x10a7db[_0xeb82de(0xd8)]));try{await this[_0xeb82de(0xd3)](_0x52e8e0,_0x297a0d,_0x1c46ce,_0x458a83,_0x10a7db[_0xeb82de(0xd8)]);}catch(_0x4060b9){const _0x233579=_0x4060b9 instanceof SDKError&&_0x4060b9[_0xeb82de(0xb7)]===ErrorCode[_0xeb82de(0xbc)]||_0x4060b9 instanceof Error&&_0x4060b9['message'][_0xeb82de(0xd1)]('404');if(_0x233579)_0x10a7db[_0xeb82de(0xd8)]&&console['error'](_0xeb82de(0xea)),!_0x1c46ce&&(_0x1c46ce=await this['getAgentId'](_0x52e8e0,_0x12b536,_0x25f4f5,_0x23336d,_0x10a7db[_0xeb82de(0xd8)])),await this[_0xeb82de(0xd3)](_0x52e8e0,_0x297a0d,_0x1c46ce,undefined,_0x10a7db[_0xeb82de(0xd8)]);else throw _0x4060b9;}return console['log'](),0x0;}catch(_0x4516dd){return console[_0xeb82de(0xb3)](),handleSDKError(_0x4516dd,_0x10a7db),0x1;}}[a14_0x562863(0xc4)](_0x56514a){const _0x1c7693=a14_0x562863;if('content'in _0x56514a)process['stdout']['write'](_0x56514a['content']);else{if('tool_call'in _0x56514a)process[_0x1c7693(0xcb)][_0x1c7693(0xd7)](_0x1c7693(0xdc)+_0x56514a['tool_call'][_0x1c7693(0xec)]+']\x0a');else{if(_0x1c7693(0xc6)in _0x56514a)process['stderr']['write']('[Tool\x20result:\x20'+_0x56514a[_0x1c7693(0xc6)][_0x1c7693(0xec)]+']\x0a');else{if(_0x1c7693(0xb6)in _0x56514a)process[_0x1c7693(0xcb)][_0x1c7693(0xd7)](_0x1c7693(0xe0)+_0x56514a[_0x1c7693(0xb6)][_0x1c7693(0xc0)]+']\x0a'),process[_0x1c7693(0xcb)][_0x1c7693(0xd7)](_0x56514a[_0x1c7693(0xb6)][_0x1c7693(0xbd)]+'\x0a');else _0x1c7693(0xb3)in _0x56514a&&process['stderr']['write'](_0x1c7693(0xcf)+_0x56514a[_0x1c7693(0xb3)]+']\x0a');}}}}}
1
+ const a14_0x4368af=a14_0x5a83;(function(_0x303658,_0x418ff8){const _0x5b625c=a14_0x5a83,_0x3d4c18=_0x303658();while(!![]){try{const _0x3516c7=-parseInt(_0x5b625c(0x158))/0x1*(-parseInt(_0x5b625c(0x160))/0x2)+-parseInt(_0x5b625c(0x179))/0x3+parseInt(_0x5b625c(0x16d))/0x4*(parseInt(_0x5b625c(0x163))/0x5)+parseInt(_0x5b625c(0x161))/0x6*(parseInt(_0x5b625c(0x17c))/0x7)+-parseInt(_0x5b625c(0x157))/0x8+-parseInt(_0x5b625c(0x170))/0x9*(-parseInt(_0x5b625c(0x166))/0xa)+parseInt(_0x5b625c(0x150))/0xb*(-parseInt(_0x5b625c(0x178))/0xc);if(_0x3516c7===_0x418ff8)break;else _0x3d4c18['push'](_0x3d4c18['shift']());}catch(_0x2ea6ff){_0x3d4c18['push'](_0x3d4c18['shift']());}}}(a14_0x1ca4,0xd6f76));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 a14_0x5a83(_0x57fbde,_0x50de5f){_0x57fbde=_0x57fbde-0x146;const _0x1ca46f=a14_0x1ca4();let _0x5a8357=_0x1ca46f[_0x57fbde];return _0x5a8357;}function a14_0x1ca4(){const _0x5b586d=['model','streamChat','252398twCRxK','234462lsETuz','tool_call','6874050qJyzpC','stderr','functionName','791330wEYWfF','output','temperature','description','getOrCreateDefaultAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','\x0a[Output:\x20','4BbiaqX','\x0a[Error:\x20','cause','171aLOOdq','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','args','getAgentId','name','data','event','new','12vUhWaw','125988wtqOrL','chat','Chat\x20session:\x20','98RVAZgL','tool','haiku','message','content','\x0a[Tool:\x20','join','code','404','\x27...','chatId','metadata','validate','resolveAgentId','stack','37041037MAsKGc','type','llm','verbose','agent','handleSSEEvent','error','4189912YUkEgC','11TgeNoP','Agent\x20reference\x20must\x20include\x20project\x20name.\x20Usage:\x20--agent\x20\x22Project/Agent\x22','log','write','Error:\x20','Resolving\x20project\x20\x27'];a14_0x1ca4=function(){return _0x5b586d;};return a14_0x1ca4();}function handleSDKError(_0x50c884,_0x5daf23){const _0x2a7a9b=a14_0x5a83;if(_0x50c884 instanceof SDKError)console['error'](_0x2a7a9b(0x15c)+_0x50c884[_0x2a7a9b(0x17f)]),_0x5daf23[_0x2a7a9b(0x153)]&&(_0x50c884[_0x2a7a9b(0x16f)]&&console['error']('\x20\x20Cause:\x20'+_0x50c884['cause']),_0x50c884[_0x2a7a9b(0x14f)]&&(console[_0x2a7a9b(0x156)]('\x0aStack\x20trace:'),console['error'](_0x50c884[_0x2a7a9b(0x14f)])));else throw _0x50c884;}export class ChatCommand extends BaseCommand{[a14_0x4368af(0x174)]=a14_0x4368af(0x17a);[a14_0x4368af(0x169)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a14_0x4368af(0x14d)](_0x451e5a){const _0x3e25d3=a14_0x4368af,_0x3308f3=_0x451e5a[_0x3e25d3(0x172)][_0x3e25d3(0x147)]('\x20');if(!_0x3308f3)return _0x3e25d3(0x171);return undefined;}async[a14_0x4368af(0x15f)](_0x5230aa,_0x1f17ec,_0x41ca47,_0x301129,_0x1848d3){const _0x976759=a14_0x4368af;for await(const _0x2a3336 of _0x5230aa[_0x976759(0x152)][_0x976759(0x17a)](_0x1f17ec,{'agentId':_0x41ca47,'chatId':_0x301129})){if(_0x2a3336[_0x976759(0x151)]===_0x976759(0x14c)){const _0x1c5f37=_0x2a3336['data'][_0x976759(0x14b)];saveLastChatId(_0x1c5f37),_0x1848d3&&console[_0x976759(0x156)](_0x976759(0x17b)+_0x1c5f37);}else _0x2a3336['type']===_0x976759(0x176)&&this['handleSSEEvent'](_0x2a3336[_0x976759(0x175)]);}}async[a14_0x4368af(0x173)](_0x519778,_0x30396d,_0x4c285e,_0x1c4983,_0x2b63b8){const _0x5e4ce5=a14_0x4368af;if(_0x30396d){const {projectName:_0x3fdf3e,agentName:_0x15f720}=parseAgentRef(_0x30396d);if(!_0x15f720)throw new Error(_0x5e4ce5(0x159));const _0x3da1ae=await withSpinner(_0x5e4ce5(0x15d)+_0x3fdf3e+'\x27...',()=>_0x519778[_0x5e4ce5(0x152)]['resolveProjectId'](_0x3fdf3e),{'verbose':_0x2b63b8}),_0x3aca1b=await withSpinner('Resolving\x20agent\x20\x27'+_0x15f720+_0x5e4ce5(0x14a),()=>_0x519778['llm'][_0x5e4ce5(0x14e)](_0x15f720,_0x3da1ae['data']),{'verbose':_0x2b63b8});return _0x3aca1b[_0x5e4ce5(0x175)];}else{const _0x5f231c=_0x4c285e||_0x5e4ce5(0x17e),_0x1260ba=resolveModelAlias(_0x5f231c),_0x51266e=await withSpinner('Getting\x20agent\x20for\x20model\x20\x27'+_0x1260ba+_0x5e4ce5(0x14a),()=>_0x519778[_0x5e4ce5(0x152)][_0x5e4ce5(0x16a)](_0x1260ba,0x0,_0x1c4983),{'verbose':_0x2b63b8});return _0x51266e['data']['id'];}}async['execute'](_0x28bfab){const _0x43c421=a14_0x4368af,{options:_0x5d1b6c,args:_0x4b17a0,tdx:_0x1ebfd5}=_0x28bfab,_0x3159d7=_0x4b17a0[_0x43c421(0x147)]('\x20'),_0x367b97=_0x5d1b6c,_0x13a056=_0x367b97[_0x43c421(0x154)],_0x41a274=_0x367b97[_0x43c421(0x15e)],_0x177161=_0x367b97[_0x43c421(0x168)]?Number(_0x367b97[_0x43c421(0x168)]):undefined,_0x5ae297=_0x367b97[_0x43c421(0x177)];try{let _0x20fe41,_0x5e40be;!_0x5ae297&&(_0x5e40be=loadLastChatId(),_0x5e40be&&_0x5d1b6c[_0x43c421(0x153)]&&console['error']('Continuing\x20chat:\x20'+_0x5e40be));(_0x5ae297||!_0x5e40be)&&(_0x20fe41=await this[_0x43c421(0x173)](_0x1ebfd5,_0x13a056,_0x41a274,_0x177161,_0x5d1b6c[_0x43c421(0x153)]));try{await this['streamChat'](_0x1ebfd5,_0x3159d7,_0x20fe41,_0x5e40be,_0x5d1b6c['verbose']);}catch(_0x430b32){const _0x519116=_0x430b32 instanceof SDKError&&_0x430b32[_0x43c421(0x148)]===ErrorCode['CHAT_NOT_FOUND']||_0x430b32 instanceof Error&&_0x430b32[_0x43c421(0x17f)]['includes'](_0x43c421(0x149));if(_0x519116)_0x5d1b6c['verbose']&&console[_0x43c421(0x156)](_0x43c421(0x16b)),!_0x20fe41&&(_0x20fe41=await this[_0x43c421(0x173)](_0x1ebfd5,_0x13a056,_0x41a274,_0x177161,_0x5d1b6c[_0x43c421(0x153)])),await this['streamChat'](_0x1ebfd5,_0x3159d7,_0x20fe41,undefined,_0x5d1b6c[_0x43c421(0x153)]);else throw _0x430b32;}return console[_0x43c421(0x15a)](),0x0;}catch(_0x155411){return console['error'](),handleSDKError(_0x155411,_0x5d1b6c),0x1;}}[a14_0x4368af(0x155)](_0x100627){const _0x4fe6c=a14_0x4368af;if(_0x4fe6c(0x180)in _0x100627)process['stdout'][_0x4fe6c(0x15b)](_0x100627[_0x4fe6c(0x180)]);else{if(_0x4fe6c(0x162)in _0x100627)process[_0x4fe6c(0x164)][_0x4fe6c(0x15b)](_0x4fe6c(0x146)+_0x100627[_0x4fe6c(0x162)][_0x4fe6c(0x165)]+']\x0a');else{if(_0x4fe6c(0x17d)in _0x100627)process['stderr'][_0x4fe6c(0x15b)]('[Tool\x20result:\x20'+_0x100627[_0x4fe6c(0x17d)][_0x4fe6c(0x165)]+']\x0a');else{if(_0x4fe6c(0x167)in _0x100627)process['stderr'][_0x4fe6c(0x15b)](_0x4fe6c(0x16c)+_0x100627[_0x4fe6c(0x167)][_0x4fe6c(0x174)]+']\x0a'),process['stderr'][_0x4fe6c(0x15b)](_0x100627[_0x4fe6c(0x167)]['content']+'\x0a');else _0x4fe6c(0x156)in _0x100627&&process[_0x4fe6c(0x164)][_0x4fe6c(0x15b)](_0x4fe6c(0x16e)+_0x100627[_0x4fe6c(0x156)]+']\x0a');}}}}}
@@ -1 +1 @@
1
- const a15_0x490ab6=a15_0x494c;(function(_0x150cc1,_0x2f63e6){const _0x224d6c=a15_0x494c,_0x267d5f=_0x150cc1();while(!![]){try{const _0x8cf3ad=-parseInt(_0x224d6c(0x18d))/0x1+parseInt(_0x224d6c(0x174))/0x2*(-parseInt(_0x224d6c(0x176))/0x3)+parseInt(_0x224d6c(0x1db))/0x4*(parseInt(_0x224d6c(0x19a))/0x5)+-parseInt(_0x224d6c(0x19b))/0x6+parseInt(_0x224d6c(0x1a6))/0x7*(parseInt(_0x224d6c(0x169))/0x8)+parseInt(_0x224d6c(0x17c))/0x9*(parseInt(_0x224d6c(0x1bf))/0xa)+parseInt(_0x224d6c(0x1a1))/0xb;if(_0x8cf3ad===_0x2f63e6)break;else _0x267d5f['push'](_0x267d5f['shift']());}catch(_0x2740a4){_0x267d5f['push'](_0x267d5f['shift']());}}}(a15_0xbaee,0xcca5e));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_0x695493 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';function a15_0xbaee(){const _0x5ccece=['utf-8','logger','mcp','Creating\x20.claude/settings.local.json...','marketplace','--transport','12qaRuON','attributes','site','Failed\x20to\x20configure\x20marketplace\x20\x27','start','✓\x20Plugin\x20\x27','stdout','getCurrent','8200MPADym','\x27\x20installed','command','update','resume','name','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','stop','Failed\x20to\x20install\x20plugin\x20\x27','tdx-managed-proxy','http','869546tCLQyx','data','3SoQJqh','tdx-skills','toString','Finding\x20available\x20port...','Setting\x20up\x20project...','getLogPath','18rQZlVO','TD\x20Docs\x20MCP\x20Server','✓\x20Logs\x20saved\x20to\x20','Updating\x20marketplace\x20\x27','message','Claude\x20Code\x20CLI\x20not\x20found','ANTHROPIC_MODEL','\x27\x20updated','td-skills\x20Plugins','text','✓\x20Port\x20','statusLine','Command\x20failed\x20(exit\x20','proxy','tdx','env','Warning:\x20Failed\x20to\x20configure\x20','799036vTDLZp','Command\x20output:\x20','includes','server','install','object','hostname','✓\x20Settings\x20restored:\x20.claude/settings.local.json','originalSettings','stderr','green','Configuring\x20MCP\x20server\x20\x27','\x20already\x20configured','341020fIydvG','4048092pKIoHP','ANTHROPIC_AUTH_TOKEN','):\x20claude\x20','cwd','which','td-skills','14447048MkZQqt','claude','✓\x20Marketplace\x20\x27','user','cause','413kcyqYn','127.0.0.1','continue','execute','Setup\x20failed','string','https://docs.treasuredata.com/mcp','tdx\x20claude\x20statusline','red','✓\x20Logging\x20to\x20','td-docs','✓\x20Settings\x20configured:\x20.claude/settings.local.json','findClaudePath','\x27...','info','debug','Failed\x20to\x20update\x20marketplace\x20\x27','description','exit','settings.local.json','\x27\x20configured','.claude','plugin','sql-skills','add','5841370ZEmRYh','model','port','✓\x20MCP\x20server\x20\x27','ANTHROPIC_BASE_URL','http://127.0.0.1:','Initializing...','Initializing\x20proxy\x20logger...','llm','log','Configuring\x20marketplace\x20\x27','trim','sonnet','stringify','profile','INSTALLATION_FAILED','unshift','already\x20configured','join','parse','error','CLAUDE_CODE_NOT_FOUND'];a15_0xbaee=function(){return _0x5ccece;};return a15_0xbaee();}import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';function a15_0x494c(_0x7ff9c2,_0x1ccad1){_0x7ff9c2=_0x7ff9c2-0x166;const _0xbaee5f=a15_0xbaee();let _0x494c36=_0xbaee5f[_0x7ff9c2];return _0x494c36;}function handleInstallationError(_0x3fde03,_0x59659d,_0x418e60,_0x2205ce){const _0x42e07a=a15_0x494c;errorContains(_0x3fde03,'already\x20exists','already\x20installed',_0x42e07a(0x1d0))?(_0x418e60['text']='✓\x20'+_0x59659d+_0x42e07a(0x199),_0x2205ce?.[_0x42e07a(0x1b4)](_0x59659d+_0x42e07a(0x199)),_0x3fde03 instanceof SDKError&&_0x3fde03['cause']&&_0x2205ce?.[_0x42e07a(0x1b5)](_0x42e07a(0x18e)+_0x3fde03[_0x42e07a(0x1a5)][_0x42e07a(0x180)])):(_0x418e60['warn'](_0x42e07a(0x18c)+_0x59659d),_0x2205ce?.[_0x42e07a(0x1d3)](_0x59659d+'\x20configuration\x20failed',_0x3fde03));}async function executeClaudeCommand(_0x8afd22,_0x4bfcf8,_0x1666af){const _0x32e53d=a15_0x494c;return _0x1666af?.['info']('Executing:\x20claude\x20'+_0x8afd22[_0x32e53d(0x1d1)]('\x20')),new Promise((_0x40e47d,_0x587d7d)=>{const _0x2c44a6=_0x32e53d,_0x5d027d=spawn(_0x2c44a6(0x1a2),_0x8afd22,{'stdio':'pipe'});let _0x28b81c='',_0x1ab677='';_0x5d027d[_0x2c44a6(0x167)]['on'](_0x2c44a6(0x175),_0x15f7d0=>{const _0x4113f3=_0x2c44a6;_0x28b81c+=_0x15f7d0[_0x4113f3(0x178)]();}),_0x5d027d[_0x2c44a6(0x196)]['on'](_0x2c44a6(0x175),_0x57409e=>{const _0x379582=_0x2c44a6;_0x1ab677+=_0x57409e[_0x379582(0x178)]();}),_0x5d027d['on'](_0x2c44a6(0x1b8),_0x56db77=>{const _0x262df9=_0x2c44a6;if(_0x56db77===0x0)_0x40e47d(_0x28b81c);else _0x4bfcf8?(_0x1666af?.[_0x262df9(0x1d3)](_0x262df9(0x188)+_0x56db77+_0x262df9(0x19d)+_0x8afd22[_0x262df9(0x1d1)]('\x20')),_0x587d7d(new SDKError(ErrorCode[_0x262df9(0x1ce)],_0x4bfcf8,new Error(_0x1ab677)))):_0x40e47d('');});});}async function ensureMcpServer(_0x3bcc9c,_0x1cf835,_0x8686dd,_0x3db60,_0x23f609){const _0x4849ae=a15_0x494c;_0x3db60[_0x4849ae(0x185)]=_0x4849ae(0x198)+_0x3bcc9c+_0x4849ae(0x1b3),await executeClaudeCommand([_0x4849ae(0x1d7),_0x4849ae(0x1be),_0x3bcc9c,_0x1cf835,_0x4849ae(0x1da),_0x8686dd],_0x4849ae(0x16f)+_0x3bcc9c+'\x27',_0x23f609),_0x3db60[_0x4849ae(0x185)]=_0x4849ae(0x1c2)+_0x3bcc9c+_0x4849ae(0x1ba);}async function ensureMarketplace(_0x418e2b,_0x25f564,_0x12afdc,_0x19e0ae){const _0x51c0ce=a15_0x494c;_0x12afdc[_0x51c0ce(0x185)]=_0x51c0ce(0x1c9)+_0x418e2b+_0x51c0ce(0x1b3),await executeClaudeCommand([_0x51c0ce(0x1bc),_0x51c0ce(0x1d9),_0x51c0ce(0x1be),_0x25f564],_0x51c0ce(0x1de)+_0x418e2b+'\x27',_0x19e0ae),_0x12afdc[_0x51c0ce(0x185)]=_0x51c0ce(0x1a3)+_0x418e2b+_0x51c0ce(0x1ba);}async function updateMarketplace(_0x3ccdf5,_0x4fdf01,_0x471954){const _0x3de4ee=a15_0x494c;_0x4fdf01[_0x3de4ee(0x185)]=_0x3de4ee(0x17f)+_0x3ccdf5+_0x3de4ee(0x1b3),await executeClaudeCommand([_0x3de4ee(0x1bc),'marketplace',_0x3de4ee(0x16c)],_0x3de4ee(0x1b6)+_0x3ccdf5+'\x27',_0x471954),_0x4fdf01[_0x3de4ee(0x185)]=_0x3de4ee(0x1a3)+_0x3ccdf5+_0x3de4ee(0x183);}async function ensurePlugin(_0x1ec0ae,_0x2dbdc2,_0x5f1e47,_0x2d6933){const _0x4c65b6=a15_0x494c;_0x5f1e47['text']='Installing\x20plugin\x20\x27'+_0x1ec0ae+_0x4c65b6(0x1b3),await executeClaudeCommand([_0x4c65b6(0x1bc),_0x4c65b6(0x191),_0x1ec0ae+'@'+_0x2dbdc2],_0x4c65b6(0x171)+_0x1ec0ae+'\x27',_0x2d6933),_0x5f1e47[_0x4c65b6(0x185)]=_0x4c65b6(0x166)+_0x1ec0ae+_0x4c65b6(0x16a);}async function createClaudeSettings(_0x30d549,_0x5c35f8=a15_0x490ab6(0x1cb),_0x9387af){const _0x264078=a15_0x490ab6,_0x10b91e=join(process[_0x264078(0x19e)](),_0x264078(0x1bb)),_0x3767b9=join(_0x10b91e,_0x264078(0x1b9));await mkdir(_0x10b91e,{'recursive':!![]});let _0x4ff8aa={};if(existsSync(_0x3767b9))try{const _0xd32e51=await readFile(_0x3767b9,_0x264078(0x1d5));_0x4ff8aa=JSON[_0x264078(0x1d2)](_0xd32e51);}catch{_0x4ff8aa={};}const _0x30fe37=_0x4ff8aa[_0x264078(0x18b)]||{},_0xe0014c={'ANTHROPIC_BASE_URL':_0x30fe37['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x30fe37[_0x264078(0x182)],'ANTHROPIC_AUTH_TOKEN':_0x30fe37[_0x264078(0x19c)],'statusLine':_0x4ff8aa[_0x264078(0x187)]},_0xc21c83={..._0x4ff8aa,'env':{..._0x30fe37,'ANTHROPIC_BASE_URL':_0x264078(0x1c4)+_0x30d549,'ANTHROPIC_MODEL':_0x5c35f8,'ANTHROPIC_AUTH_TOKEN':_0x264078(0x172)},'statusLine':{'type':_0x264078(0x16b),'command':_0x9387af?'tdx\x20--profile\x20'+_0x9387af+'\x20claude\x20statusline':_0x264078(0x1ad)}};return await writeFile(_0x3767b9,JSON[_0x264078(0x1cc)](_0xc21c83,null,0x2)+'\x0a'),_0xe0014c;}async function restoreClaudeSettings(_0x5880e5){const _0x4f6498=a15_0x490ab6,_0x16a032=join(process[_0x4f6498(0x19e)](),_0x4f6498(0x1bb)),_0x4d9c04=join(_0x16a032,_0x4f6498(0x1b9));if(!existsSync(_0x4d9c04))return;try{const _0x57418d=await readFile(_0x4d9c04,_0x4f6498(0x1d5)),_0x4725e9=JSON[_0x4f6498(0x1d2)](_0x57418d),_0x54e97e=_0x4725e9[_0x4f6498(0x18b)]||{},_0x3ab0e8=_0x54e97e[_0x4f6498(0x1c3)],_0x435505=((()=>{const _0x138333=_0x4f6498;if(typeof _0x3ab0e8!==_0x138333(0x1ab))return![];try{const _0x39bd1a=new URL(_0x3ab0e8);return _0x39bd1a[_0x138333(0x193)]==='localhost'||_0x39bd1a[_0x138333(0x193)]===_0x138333(0x1a7);}catch{return![];}})());_0x435505?(delete _0x54e97e['ANTHROPIC_BASE_URL'],delete _0x54e97e[_0x4f6498(0x182)],delete _0x54e97e[_0x4f6498(0x19c)]):(_0x5880e5[_0x4f6498(0x1c3)]!==undefined?_0x54e97e[_0x4f6498(0x1c3)]=_0x5880e5[_0x4f6498(0x1c3)]:delete _0x54e97e['ANTHROPIC_BASE_URL'],_0x5880e5[_0x4f6498(0x182)]!==undefined?_0x54e97e[_0x4f6498(0x182)]=_0x5880e5[_0x4f6498(0x182)]:delete _0x54e97e[_0x4f6498(0x182)],_0x5880e5[_0x4f6498(0x19c)]!==undefined?_0x54e97e[_0x4f6498(0x19c)]=_0x5880e5[_0x4f6498(0x19c)]:delete _0x54e97e[_0x4f6498(0x19c)]);const _0x238948=_0x4725e9[_0x4f6498(0x187)],_0x304651=((()=>{const _0x208f68=_0x4f6498;if(!_0x238948||typeof _0x238948!==_0x208f68(0x192))return![];if(_0x238948['type']!==_0x208f68(0x16b))return![];if(typeof _0x238948[_0x208f68(0x16b)]!==_0x208f68(0x1ab))return![];return _0x238948[_0x208f68(0x16b)][_0x208f68(0x18f)](_0x208f68(0x18a))&&_0x238948['command']['includes']('statusline');})());if(_0x304651)delete _0x4725e9[_0x4f6498(0x187)];else _0x5880e5[_0x4f6498(0x187)]!==undefined?_0x4725e9[_0x4f6498(0x187)]=_0x5880e5[_0x4f6498(0x187)]:delete _0x4725e9[_0x4f6498(0x187)];_0x4725e9[_0x4f6498(0x18b)]=_0x54e97e,await writeFile(_0x4d9c04,JSON['stringify'](_0x4725e9,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a15_0x490ab6(0x16e)]=a15_0x490ab6(0x1a2);[a15_0x490ab6(0x1b7)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';[a15_0x490ab6(0x190)];['originalSettings'];['logger'];[a15_0x490ab6(0x1c1)];async[a15_0x490ab6(0x1a9)](_0x424ae6){const _0x246932=a15_0x490ab6,{tdx:_0x13697d,options:_0x29cc1d,args:_0x5e7b8b}=_0x424ae6;try{const _0x1f35c8=_0x29cc1d,_0xd4fc20=_0x1f35c8[_0x246932(0x1c0)]||'sonnet',_0x11f70d=_0x1f35c8[_0x246932(0x189)]===![],_0x58d090=_0x1f35c8[_0x246932(0x1a8)]===!![],_0x1dc483=_0x1f35c8[_0x246932(0x16d)]===!![],_0x413701=[..._0x5e7b8b];if(_0x58d090)_0x413701[_0x246932(0x1cf)]('-c');else _0x1dc483&&_0x413701[_0x246932(0x1cf)]('-r');const _0x507752=createCommandSpinner(_0x246932(0x1c5),{'verbose':_0x29cc1d['verbose']});_0x507752[_0x246932(0x1df)]();try{if(!_0x11f70d){_0x507752[_0x246932(0x185)]=_0x246932(0x179),this['port']=await findAvailablePort(0xfa0),_0x507752[_0x246932(0x185)]=_0x246932(0x186)+this[_0x246932(0x1c1)],_0x507752[_0x246932(0x185)]=_0x246932(0x17a);const _0x1b2589=await _0x13697d[_0x246932(0x1c7)]['getOrCreateDefaultProject'](),_0x4f2c08=_0x1b2589['id'];_0x507752[_0x246932(0x185)]='✓\x20Using\x20project:\x20'+_0x1b2589[_0x246932(0x1dc)][_0x246932(0x16e)];const _0xdf24d8=_0x29cc1d[_0x246932(0x1cd)];try{const _0x172cce=await _0x13697d[_0x246932(0x1a4)][_0x246932(0x168)]();_0x172cce['account_id']&&writeCachedAccountInfo(_0x29cc1d[_0x246932(0x1dd)],_0x172cce['account_id'],_0xdf24d8);}catch{}_0x507752[_0x246932(0x185)]=_0x246932(0x1c6),this[_0x246932(0x1d6)]=new TDXLogger(_0x29cc1d['logLevel'],!![]),await this[_0x246932(0x1d6)]['init']();const _0x2a0397=this['logger'][_0x246932(0x17b)]();_0x507752[_0x246932(0x185)]=_0x246932(0x1af)+_0x2a0397,_0x507752[_0x246932(0x185)]='Starting\x20TD\x20LLM\x20proxy\x20server...',this[_0x246932(0x190)]=new ProxyServer({'port':this[_0x246932(0x1c1)],'projectId':_0x4f2c08,'tdx':_0x13697d,'logger':this['logger'],'site':_0x29cc1d[_0x246932(0x1dd)]}),await this[_0x246932(0x190)][_0x246932(0x1df)](),_0x507752[_0x246932(0x185)]='✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20'+this[_0x246932(0x1c1)],_0x507752['text']=_0x246932(0x1d8),this[_0x246932(0x195)]=await createClaudeSettings(this[_0x246932(0x1c1)],_0xd4fc20,_0xdf24d8),_0x507752['text']=_0x246932(0x1b1);}else _0x507752['text']='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';try{await ensureMcpServer(_0x246932(0x1b0),_0x246932(0x1ac),_0x246932(0x173),_0x507752,this[_0x246932(0x1d6)]);}catch(_0x574910){handleInstallationError(_0x574910,_0x246932(0x17d),_0x507752,this[_0x246932(0x1d6)]);}try{await ensureMarketplace('td-skills','https://github.com/treasure-data/td-skills',_0x507752,this[_0x246932(0x1d6)]),await updateMarketplace(_0x246932(0x1a0),_0x507752,this['logger']),await ensurePlugin(_0x246932(0x1bd),_0x246932(0x1a0),_0x507752,this['logger']),await ensurePlugin('workflow-skills','td-skills',_0x507752,this[_0x246932(0x1d6)]),await ensurePlugin(_0x246932(0x177),_0x246932(0x1a0),_0x507752,this[_0x246932(0x1d6)]);}catch(_0x30b0ad){handleInstallationError(_0x30b0ad,_0x246932(0x184),_0x507752,this[_0x246932(0x1d6)]);}_0x507752[_0x246932(0x170)]();}catch(_0x77d037){_0x507752['fail'](_0x246932(0x1aa));throw _0x77d037;}const _0x4874fd=await this[_0x246932(0x1b2)]();if(!_0x4874fd)throw new SDKError(ErrorCode[_0x246932(0x1d4)],_0x246932(0x181),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x20993f={...process['env']};!_0x11f70d&&(_0x20993f[_0x246932(0x1c3)]=_0x246932(0x1c4)+this[_0x246932(0x1c1)],_0x20993f[_0x246932(0x182)]=_0xd4fc20,_0x20993f[_0x246932(0x19c)]=_0x246932(0x172));const _0x4a5857=spawn(_0x4874fd,_0x413701,{'stdio':'inherit','env':_0x20993f}),_0x8cb9d5=await new Promise(_0x53aaa9=>{const _0x4f1f8d=_0x246932;_0x4a5857['on'](_0x4f1f8d(0x1b8),_0x126b10=>{_0x53aaa9(_0x126b10||0x0);}),_0x4a5857['on'](_0x4f1f8d(0x1d3),_0x530dff=>{const _0x3e9d5d=_0x4f1f8d;console[_0x3e9d5d(0x1d3)](a15_0x695493[_0x3e9d5d(0x1ae)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x530dff[_0x3e9d5d(0x180)])),_0x53aaa9(0x1);});});this['server']&&(await this[_0x246932(0x190)][_0x246932(0x170)](),console[_0x246932(0x1c8)](a15_0x695493['green']('✓\x20TD\x20LLM\x20proxy\x20server\x20stopped')));if(this[_0x246932(0x1d6)]){await this['logger']['close']();const _0x4d7fed=this[_0x246932(0x1d6)][_0x246932(0x17b)]();console[_0x246932(0x1c8)](a15_0x695493[_0x246932(0x197)](_0x246932(0x17e)+_0x4d7fed));}return this[_0x246932(0x195)]&&(await restoreClaudeSettings(this[_0x246932(0x195)]),console[_0x246932(0x1c8)](a15_0x695493[_0x246932(0x197)](_0x246932(0x194)))),_0x8cb9d5;}catch(_0x452a25){this[_0x246932(0x190)]&&await this[_0x246932(0x190)][_0x246932(0x170)]();this[_0x246932(0x1d6)]&&await this[_0x246932(0x1d6)]['close']();this[_0x246932(0x195)]&&await restoreClaudeSettings(this[_0x246932(0x195)]);throw _0x452a25;}}async[a15_0x490ab6(0x1b2)](){return new Promise(_0x2aaf92=>{const _0x59c038=a15_0x494c,_0x285057=spawn(_0x59c038(0x19f),[_0x59c038(0x1a2)]);let _0x2634a3='';_0x285057[_0x59c038(0x167)]['on']('data',_0x193d2b=>{const _0x2f0388=_0x59c038;_0x2634a3+=_0x193d2b[_0x2f0388(0x178)]();}),_0x285057['on'](_0x59c038(0x1b8),_0xec5f23=>{const _0x2c9a17=_0x59c038;_0xec5f23===0x0&&_0x2634a3[_0x2c9a17(0x1ca)]()?_0x2aaf92(_0x2634a3[_0x2c9a17(0x1ca)]()):_0x2aaf92(null);});});}}
1
+ const a15_0x2dd6a2=a15_0x1a51;(function(_0x1428e5,_0x3438da){const _0x12dddd=a15_0x1a51,_0x2e4fe3=_0x1428e5();while(!![]){try{const _0x19a6ea=-parseInt(_0x12dddd(0xe6))/0x1+-parseInt(_0x12dddd(0x12e))/0x2*(-parseInt(_0x12dddd(0x146))/0x3)+parseInt(_0x12dddd(0x15b))/0x4+parseInt(_0x12dddd(0x108))/0x5+-parseInt(_0x12dddd(0x100))/0x6+-parseInt(_0x12dddd(0x123))/0x7*(-parseInt(_0x12dddd(0xe2))/0x8)+-parseInt(_0x12dddd(0x124))/0x9;if(_0x19a6ea===_0x3438da)break;else _0x2e4fe3['push'](_0x2e4fe3['shift']());}catch(_0x142ab0){_0x2e4fe3['push'](_0x2e4fe3['shift']());}}}(a15_0x4c87,0x6a67b));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_0x51a9c9 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';function a15_0x4c87(){const _0x522c87=['✓\x20Settings\x20configured:\x20.claude/settings.local.json','join','tdx-skills','Failed\x20to\x20install\x20plugin\x20\x27','proxy','inherit','env','Updating\x20marketplace\x20\x27','Failed\x20to\x20launch\x20Claude\x20Code:\x20','parse','pipe','stderr','getCurrent','site','\x20claude\x20statusline','✓\x20Settings\x20restored:\x20.claude/settings.local.json','account_id','close','tdx\x20--profile\x20','3341312KmznIz','Failed\x20to\x20update\x20marketplace\x20\x27','✓\x20Marketplace\x20\x27','execute','stdout','\x20already\x20configured','ANTHROPIC_AUTH_TOKEN','originalSettings','✓\x20Logging\x20to\x20','8SmOmZW','Executing:\x20claude\x20','✓\x20Logs\x20saved\x20to\x20','string','469428ftrpXb','error','getOrCreateDefaultProject','td-docs','red','verbose','td-skills','✓\x20MCP\x20server\x20\x27','settings.local.json','cwd','plugin','port','user','llm','ANTHROPIC_BASE_URL','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','command','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','which','stop','INSTALLATION_FAILED','includes','model','statusLine','resume','tdx-managed-proxy','841698uTPAgY','logger','Setting\x20up\x20project...','cause','✓\x20Plugin\x20\x27','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','Command\x20failed\x20(exit\x20','tdx','1662905yiOAeq','\x27\x20installed','.claude','mcp','):\x20claude\x20','data','findClaudePath','Creating\x20.claude/settings.local.json...','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','start','Installing\x20plugin\x20\x27','http://127.0.0.1:','info','logLevel','Setup\x20failed','\x27\x20updated','localhost','toString','name','update','stringify','\x27...','install','server','add','unshift','exit','5148115KfRAkK','12539772AlpqKU','trim','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','getLogPath','--transport','marketplace','green','\x27\x20configured','\x20configuration\x20failed','type','89250OryJSp','message','attributes','Initializing\x20proxy\x20logger...','continue','td-skills\x20Plugins','claude','Initializing...','sql-skills','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','hostname','✓\x20Port\x20','text','TD\x20Docs\x20MCP\x20Server','ANTHROPIC_MODEL','tdx\x20claude\x20statusline','log','sonnet','utf-8','object','http','debug','warn','127.0.0.1','36LWxKEg','workflow-skills'];a15_0x4c87=function(){return _0x522c87;};return a15_0x4c87();}import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';function a15_0x1a51(_0x136e87,_0x5041ec){_0x136e87=_0x136e87-0xdf;const _0x4c870b=a15_0x4c87();let _0x1a5151=_0x4c870b[_0x136e87];return _0x1a5151;}import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';function handleInstallationError(_0x3c9baf,_0xcaf73d,_0x691d17,_0x22def2){const _0x251eb2=a15_0x1a51;errorContains(_0x3c9baf,'already\x20exists','already\x20installed','already\x20configured')?(_0x691d17[_0x251eb2(0x13a)]='✓\x20'+_0xcaf73d+'\x20already\x20configured',_0x22def2?.[_0x251eb2(0x114)](_0xcaf73d+_0x251eb2(0x160)),_0x3c9baf instanceof SDKError&&_0x3c9baf[_0x251eb2(0x103)]&&_0x22def2?.[_0x251eb2(0x143)]('Command\x20output:\x20'+_0x3c9baf['cause']['message'])):(_0x691d17[_0x251eb2(0x144)]('Warning:\x20Failed\x20to\x20configure\x20'+_0xcaf73d),_0x22def2?.[_0x251eb2(0xe7)](_0xcaf73d+_0x251eb2(0x12c),_0x3c9baf));}async function executeClaudeCommand(_0x48418e,_0x19c452,_0x15ae3e){const _0x29adc9=a15_0x1a51;return _0x15ae3e?.[_0x29adc9(0x114)](_0x29adc9(0xe3)+_0x48418e[_0x29adc9(0x149)]('\x20')),new Promise((_0x384e8b,_0x34f5d7)=>{const _0x5db880=_0x29adc9,_0x1f9691=spawn(_0x5db880(0x134),_0x48418e,{'stdio':_0x5db880(0x152)});let _0x15e0e6='',_0x1e2f7e='';_0x1f9691[_0x5db880(0x15f)]['on']('data',_0x56cefb=>{const _0x1c9426=_0x5db880;_0x15e0e6+=_0x56cefb[_0x1c9426(0x119)]();}),_0x1f9691[_0x5db880(0x153)]['on'](_0x5db880(0x10d),_0x26db18=>{const _0x48d40c=_0x5db880;_0x1e2f7e+=_0x26db18[_0x48d40c(0x119)]();}),_0x1f9691['on'](_0x5db880(0x122),_0x23f0fa=>{const _0x483736=_0x5db880;if(_0x23f0fa===0x0)_0x384e8b(_0x15e0e6);else _0x19c452?(_0x15ae3e?.['error'](_0x483736(0x106)+_0x23f0fa+_0x483736(0x10c)+_0x48418e[_0x483736(0x149)]('\x20')),_0x34f5d7(new SDKError(ErrorCode[_0x483736(0xfa)],_0x19c452,new Error(_0x1e2f7e)))):_0x384e8b('');});});}async function ensureMcpServer(_0x220c6a,_0x1a95a4,_0x30cb77,_0x59b152,_0x424477){const _0x3f98f6=a15_0x1a51;_0x59b152[_0x3f98f6(0x13a)]='Configuring\x20MCP\x20server\x20\x27'+_0x220c6a+_0x3f98f6(0x11d),await executeClaudeCommand([_0x3f98f6(0x10b),'add',_0x220c6a,_0x1a95a4,_0x3f98f6(0x128),_0x30cb77],_0x3f98f6(0x137)+_0x220c6a+'\x27',_0x424477),_0x59b152[_0x3f98f6(0x13a)]=_0x3f98f6(0xed)+_0x220c6a+_0x3f98f6(0x12b);}async function ensureMarketplace(_0x508258,_0x4df407,_0x1e0b9a,_0x2b5859){const _0x486942=a15_0x1a51;_0x1e0b9a[_0x486942(0x13a)]='Configuring\x20marketplace\x20\x27'+_0x508258+_0x486942(0x11d),await executeClaudeCommand([_0x486942(0xf0),_0x486942(0x129),_0x486942(0x120),_0x4df407],'Failed\x20to\x20configure\x20marketplace\x20\x27'+_0x508258+'\x27',_0x2b5859),_0x1e0b9a[_0x486942(0x13a)]=_0x486942(0x15d)+_0x508258+_0x486942(0x12b);}async function updateMarketplace(_0x51f7fe,_0x645820,_0x2c1af5){const _0x4c6bb8=a15_0x1a51;_0x645820[_0x4c6bb8(0x13a)]=_0x4c6bb8(0x14f)+_0x51f7fe+_0x4c6bb8(0x11d),await executeClaudeCommand(['plugin','marketplace',_0x4c6bb8(0x11b)],_0x4c6bb8(0x15c)+_0x51f7fe+'\x27',_0x2c1af5),_0x645820['text']='✓\x20Marketplace\x20\x27'+_0x51f7fe+_0x4c6bb8(0x117);}async function ensurePlugin(_0x47ab6d,_0x16e7e7,_0x303257,_0x1716c7){const _0x51b504=a15_0x1a51;_0x303257[_0x51b504(0x13a)]=_0x51b504(0x112)+_0x47ab6d+_0x51b504(0x11d),await executeClaudeCommand([_0x51b504(0xf0),_0x51b504(0x11e),_0x47ab6d+'@'+_0x16e7e7],_0x51b504(0x14b)+_0x47ab6d+'\x27',_0x1716c7),_0x303257[_0x51b504(0x13a)]=_0x51b504(0x104)+_0x47ab6d+_0x51b504(0x109);}async function createClaudeSettings(_0x5c9cca,_0x53ea17=a15_0x2dd6a2(0x13f),_0x2e17c7){const _0x48175a=a15_0x2dd6a2,_0x23a79d=join(process[_0x48175a(0xef)](),_0x48175a(0x10a)),_0x568ad9=join(_0x23a79d,_0x48175a(0xee));await mkdir(_0x23a79d,{'recursive':!![]});let _0x5db596={};if(existsSync(_0x568ad9))try{const _0x19f0f8=await readFile(_0x568ad9,_0x48175a(0x140));_0x5db596=JSON[_0x48175a(0x151)](_0x19f0f8);}catch{_0x5db596={};}const _0x554f9c=_0x5db596[_0x48175a(0x14e)]||{},_0x2f1e69={'ANTHROPIC_BASE_URL':_0x554f9c['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x554f9c['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x554f9c[_0x48175a(0xdf)],'statusLine':_0x5db596[_0x48175a(0xfd)]},_0x35f6dc={..._0x5db596,'env':{..._0x554f9c,'ANTHROPIC_BASE_URL':_0x48175a(0x113)+_0x5c9cca,'ANTHROPIC_MODEL':_0x53ea17,'ANTHROPIC_AUTH_TOKEN':_0x48175a(0xff)},'statusLine':{'type':_0x48175a(0xf6),'command':_0x2e17c7?_0x48175a(0x15a)+_0x2e17c7+_0x48175a(0x156):_0x48175a(0x13d)}};return await writeFile(_0x568ad9,JSON[_0x48175a(0x11c)](_0x35f6dc,null,0x2)+'\x0a'),_0x2f1e69;}async function restoreClaudeSettings(_0x4c47af){const _0x51206f=a15_0x2dd6a2,_0x30c142=join(process[_0x51206f(0xef)](),'.claude'),_0x101042=join(_0x30c142,_0x51206f(0xee));if(!existsSync(_0x101042))return;try{const _0x1c76f7=await readFile(_0x101042,_0x51206f(0x140)),_0x5c74b6=JSON[_0x51206f(0x151)](_0x1c76f7),_0x10ebc0=_0x5c74b6[_0x51206f(0x14e)]||{},_0x10a9db=_0x10ebc0[_0x51206f(0xf4)],_0xcc547=((()=>{const _0x3416bc=_0x51206f;if(typeof _0x10a9db!==_0x3416bc(0xe5))return![];try{const _0xb4d750=new URL(_0x10a9db);return _0xb4d750[_0x3416bc(0x138)]===_0x3416bc(0x118)||_0xb4d750['hostname']===_0x3416bc(0x145);}catch{return![];}})());_0xcc547?(delete _0x10ebc0[_0x51206f(0xf4)],delete _0x10ebc0['ANTHROPIC_MODEL'],delete _0x10ebc0[_0x51206f(0xdf)]):(_0x4c47af[_0x51206f(0xf4)]!==undefined?_0x10ebc0[_0x51206f(0xf4)]=_0x4c47af['ANTHROPIC_BASE_URL']:delete _0x10ebc0[_0x51206f(0xf4)],_0x4c47af[_0x51206f(0x13c)]!==undefined?_0x10ebc0['ANTHROPIC_MODEL']=_0x4c47af['ANTHROPIC_MODEL']:delete _0x10ebc0[_0x51206f(0x13c)],_0x4c47af[_0x51206f(0xdf)]!==undefined?_0x10ebc0[_0x51206f(0xdf)]=_0x4c47af[_0x51206f(0xdf)]:delete _0x10ebc0['ANTHROPIC_AUTH_TOKEN']);const _0x30b6f9=_0x5c74b6[_0x51206f(0xfd)],_0x2c247=((()=>{const _0x18daf5=_0x51206f;if(!_0x30b6f9||typeof _0x30b6f9!==_0x18daf5(0x141))return![];if(_0x30b6f9[_0x18daf5(0x12d)]!==_0x18daf5(0xf6))return![];if(typeof _0x30b6f9[_0x18daf5(0xf6)]!==_0x18daf5(0xe5))return![];return _0x30b6f9[_0x18daf5(0xf6)][_0x18daf5(0xfb)](_0x18daf5(0x107))&&_0x30b6f9[_0x18daf5(0xf6)]['includes']('statusline');})());if(_0x2c247)delete _0x5c74b6[_0x51206f(0xfd)];else _0x4c47af[_0x51206f(0xfd)]!==undefined?_0x5c74b6['statusLine']=_0x4c47af[_0x51206f(0xfd)]:delete _0x5c74b6[_0x51206f(0xfd)];_0x5c74b6[_0x51206f(0x14e)]=_0x10ebc0,await writeFile(_0x101042,JSON[_0x51206f(0x11c)](_0x5c74b6,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a15_0x2dd6a2(0x11a)]='claude';['description']=a15_0x2dd6a2(0xf7);[a15_0x2dd6a2(0x11f)];[a15_0x2dd6a2(0xe0)];[a15_0x2dd6a2(0x101)];[a15_0x2dd6a2(0xf1)];async[a15_0x2dd6a2(0x15e)](_0x230161){const _0x34c171=a15_0x2dd6a2,{tdx:_0x10144b,options:_0x6116fa,args:_0x399b57}=_0x230161;try{const _0x109a38=_0x6116fa,_0x2635a2=_0x109a38[_0x34c171(0xfc)]||'sonnet',_0x123b7c=_0x109a38[_0x34c171(0x14c)]===![],_0x5167ba=_0x109a38[_0x34c171(0x132)]===!![],_0x373d98=_0x109a38[_0x34c171(0xfe)]===!![],_0x30ce83=[..._0x399b57];if(_0x5167ba)_0x30ce83['unshift']('-c');else _0x373d98&&_0x30ce83[_0x34c171(0x121)]('-r');const _0x5f1ae5=createCommandSpinner(_0x34c171(0x135),{'verbose':_0x6116fa[_0x34c171(0xeb)]});_0x5f1ae5['start']();try{if(!_0x123b7c){_0x5f1ae5[_0x34c171(0x13a)]='Finding\x20available\x20port...',this[_0x34c171(0xf1)]=await findAvailablePort(0xfa0),_0x5f1ae5['text']=_0x34c171(0x139)+this[_0x34c171(0xf1)],_0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0x102);const _0x4fc956=await _0x10144b[_0x34c171(0xf3)][_0x34c171(0xe8)](),_0x275078=_0x4fc956['id'];_0x5f1ae5[_0x34c171(0x13a)]='✓\x20Using\x20project:\x20'+_0x4fc956[_0x34c171(0x130)][_0x34c171(0x11a)];const _0x5e0904=_0x6116fa['profile'];try{const _0x2387bb=await _0x10144b[_0x34c171(0xf2)][_0x34c171(0x154)]();_0x2387bb[_0x34c171(0x158)]&&writeCachedAccountInfo(_0x6116fa[_0x34c171(0x155)],_0x2387bb['account_id'],_0x5e0904);}catch{}_0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0x131),this[_0x34c171(0x101)]=new TDXLogger(_0x6116fa[_0x34c171(0x115)],!![]),await this[_0x34c171(0x101)]['init']();const _0x4451d2=this['logger']['getLogPath']();_0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0xe1)+_0x4451d2,_0x5f1ae5[_0x34c171(0x13a)]='Starting\x20TD\x20LLM\x20proxy\x20server...',this['server']=new ProxyServer({'port':this['port'],'projectId':_0x275078,'tdx':_0x10144b,'logger':this[_0x34c171(0x101)],'site':_0x6116fa[_0x34c171(0x155)]}),await this[_0x34c171(0x11f)][_0x34c171(0x111)](),_0x5f1ae5['text']=_0x34c171(0x105)+this[_0x34c171(0xf1)],_0x5f1ae5['text']=_0x34c171(0x10f),this[_0x34c171(0xe0)]=await createClaudeSettings(this['port'],_0x2635a2,_0x5e0904),_0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0x148);}else _0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0x126);try{await ensureMcpServer(_0x34c171(0xe9),'https://docs.treasuredata.com/mcp',_0x34c171(0x142),_0x5f1ae5,this['logger']);}catch(_0x32d259){handleInstallationError(_0x32d259,_0x34c171(0x13b),_0x5f1ae5,this[_0x34c171(0x101)]);}try{await ensureMarketplace('td-skills','https://github.com/treasure-data/td-skills',_0x5f1ae5,this['logger']),await updateMarketplace(_0x34c171(0xec),_0x5f1ae5,this['logger']),await ensurePlugin(_0x34c171(0x136),_0x34c171(0xec),_0x5f1ae5,this['logger']),await ensurePlugin(_0x34c171(0x147),_0x34c171(0xec),_0x5f1ae5,this[_0x34c171(0x101)]),await ensurePlugin(_0x34c171(0x14a),_0x34c171(0xec),_0x5f1ae5,this[_0x34c171(0x101)]);}catch(_0x22b206){handleInstallationError(_0x22b206,_0x34c171(0x133),_0x5f1ae5,this[_0x34c171(0x101)]);}_0x5f1ae5[_0x34c171(0xf9)]();}catch(_0x2577f9){_0x5f1ae5['fail'](_0x34c171(0x116));throw _0x2577f9;}const _0x21b048=await this[_0x34c171(0x10e)]();if(!_0x21b048)throw new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x34c171(0x110)});const _0x4c3f53={...process[_0x34c171(0x14e)]};!_0x123b7c&&(_0x4c3f53[_0x34c171(0xf4)]=_0x34c171(0x113)+this[_0x34c171(0xf1)],_0x4c3f53['ANTHROPIC_MODEL']=_0x2635a2,_0x4c3f53[_0x34c171(0xdf)]='tdx-managed-proxy');const _0x1c7fb7=spawn(_0x21b048,_0x30ce83,{'stdio':_0x34c171(0x14d),'env':_0x4c3f53}),_0x584d0c=await new Promise(_0x141f45=>{const _0x55eb4c=_0x34c171;_0x1c7fb7['on'](_0x55eb4c(0x122),_0x4eb8af=>{_0x141f45(_0x4eb8af||0x0);}),_0x1c7fb7['on'](_0x55eb4c(0xe7),_0xc883dd=>{const _0x307d28=_0x55eb4c;console[_0x307d28(0xe7)](a15_0x51a9c9[_0x307d28(0xea)](_0x307d28(0x150)+_0xc883dd[_0x307d28(0x12f)])),_0x141f45(0x1);});});this[_0x34c171(0x11f)]&&(await this[_0x34c171(0x11f)]['stop'](),console[_0x34c171(0x13e)](a15_0x51a9c9[_0x34c171(0x12a)](_0x34c171(0xf5))));if(this[_0x34c171(0x101)]){await this[_0x34c171(0x101)]['close']();const _0x5c34f5=this['logger'][_0x34c171(0x127)]();console[_0x34c171(0x13e)](a15_0x51a9c9['green'](_0x34c171(0xe4)+_0x5c34f5));}return this[_0x34c171(0xe0)]&&(await restoreClaudeSettings(this[_0x34c171(0xe0)]),console[_0x34c171(0x13e)](a15_0x51a9c9[_0x34c171(0x12a)](_0x34c171(0x157)))),_0x584d0c;}catch(_0x25feb5){this[_0x34c171(0x11f)]&&await this[_0x34c171(0x11f)][_0x34c171(0xf9)]();this[_0x34c171(0x101)]&&await this['logger'][_0x34c171(0x159)]();this[_0x34c171(0xe0)]&&await restoreClaudeSettings(this[_0x34c171(0xe0)]);throw _0x25feb5;}}async[a15_0x2dd6a2(0x10e)](){return new Promise(_0x3e3834=>{const _0x45cd89=a15_0x1a51,_0xc2b4f=spawn(_0x45cd89(0xf8),[_0x45cd89(0x134)]);let _0x57538c='';_0xc2b4f[_0x45cd89(0x15f)]['on'](_0x45cd89(0x10d),_0x301ea7=>{const _0xc7fef=_0x45cd89;_0x57538c+=_0x301ea7[_0xc7fef(0x119)]();}),_0xc2b4f['on']('exit',_0x1f2fde=>{const _0x5fc9a3=_0x45cd89;_0x1f2fde===0x0&&_0x57538c['trim']()?_0x3e3834(_0x57538c[_0x5fc9a3(0x125)]()):_0x3e3834(null);});});}}
@@ -1 +1 @@
1
- const a16_0x198bbb=a16_0x3e65;(function(_0x3bac93,_0x12ac74){const _0x559cc3=a16_0x3e65,_0x2b68cd=_0x3bac93();while(!![]){try{const _0x1b22a1=-parseInt(_0x559cc3(0x188))/0x1+parseInt(_0x559cc3(0x194))/0x2+-parseInt(_0x559cc3(0x18b))/0x3+parseInt(_0x559cc3(0x1a6))/0x4+parseInt(_0x559cc3(0x192))/0x5*(parseInt(_0x559cc3(0x1aa))/0x6)+parseInt(_0x559cc3(0x1a2))/0x7+parseInt(_0x559cc3(0x18e))/0x8*(-parseInt(_0x559cc3(0x199))/0x9);if(_0x1b22a1===_0x12ac74)break;else _0x2b68cd['push'](_0x2b68cd['shift']());}catch(_0x17df57){_0x2b68cd['push'](_0x2b68cd['shift']());}}}(a16_0x4921,0xb9016));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../utils/model-factors.js';function a16_0x4921(){const _0x364394=['705696lgBoRz','sessionCredits','profile','statusline','509202syXFqT','options','🧠\x20','3484449HpFWkt','monthCredits','execute','88EytXve','line','model','\x20month','60VFaZey','💎\x20','2393424psPVmb','\x20|\x20','Claude','close','accountId','1507293zHcmGD','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','session_id','💎\x20tdx\x20-\x20Claude','latestInputTokens','parse','site','\x20-\x20','tdx\x20','8053731IrCwEO','join','push','log','2048308tYcECb','\x20session\x20/\x20','toFixed','tdx'];a16_0x4921=function(){return _0x364394;};return a16_0x4921();}async function readStdinJson(_0xb47637=0x64){return new Promise(_0x11735b=>{const _0x4b45ef=a16_0x3e65;let _0x159d56='',_0x4037db=![];const _0xe19009=createInterface({'input':process['stdin'],'terminal':![]}),_0x308820=_0x59845b=>{const _0x496456=a16_0x3e65;if(_0x4037db)return;_0x4037db=!![],clearTimeout(_0x194a51),_0xe19009[_0x496456(0x197)](),_0x11735b(_0x59845b);},_0x194a51=setTimeout(()=>{_0x308820(null);},_0xb47637);_0xe19009['on'](_0x4b45ef(0x18f),_0x3ff7df=>{_0x159d56+=_0x3ff7df;}),_0xe19009['on'](_0x4b45ef(0x197),()=>{const _0x3b26c0=_0x4b45ef;if(_0x4037db)return;try{const _0x121246=JSON[_0x3b26c0(0x19e)](_0x159d56);_0x308820(_0x121246);}catch{_0x308820(null);}});});}function formatCredits(_0x434757){const _0x4db6f5=a16_0x3e65;return _0x434757[_0x4db6f5(0x1a8)](0x2);}function a16_0x3e65(_0x22c95e,_0x49d61b){_0x22c95e=_0x22c95e-0x187;const _0x4921ec=a16_0x4921();let _0x3e659f=_0x4921ec[_0x22c95e];return _0x3e659f;}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a16_0x198bbb(0x187);['description']=a16_0x198bbb(0x19a);async[a16_0x198bbb(0x18d)](_0x30a3d1){const _0x5b4f6a=a16_0x198bbb;try{const _0x4f316b=await readStdinJson();if(!_0x4f316b?.[_0x5b4f6a(0x19b)])return console[_0x5b4f6a(0x1a5)](_0x5b4f6a(0x19c)),0x0;const _0x5d3027=_0x4f316b[_0x5b4f6a(0x19b)],_0x4e8e5a=_0x4f316b[_0x5b4f6a(0x190)]?.['id']||'',_0x2583e8=_0x4f316b[_0x5b4f6a(0x1ac)]||_0x30a3d1[_0x5b4f6a(0x189)][_0x5b4f6a(0x1ac)],_0x4d3024=await getUsageStats(_0x5d3027,_0x2583e8),_0x40a8c1=[],_0x5ef76f=readCachedAccountInfo(_0x2583e8),_0x16845b=_0x5ef76f?_0x5b4f6a(0x1a1)+_0x5ef76f[_0x5b4f6a(0x19f)]+':'+_0x5ef76f[_0x5b4f6a(0x198)]:_0x5b4f6a(0x1a9),_0x529884=_0x4e8e5a?getModelDisplayName(_0x4e8e5a):_0x5b4f6a(0x196);_0x40a8c1[_0x5b4f6a(0x1a4)](_0x5b4f6a(0x193)+_0x16845b+_0x5b4f6a(0x1a0)+_0x529884);const _0x3d9106=formatCredits(_0x4d3024[_0x5b4f6a(0x1ab)]),_0x10c67e=formatCredits(_0x4d3024['todayCredits']),_0x1d1d62=formatCredits(_0x4d3024[_0x5b4f6a(0x18c)]);_0x40a8c1[_0x5b4f6a(0x1a4)]('🪙\x20credit:\x20'+_0x3d9106+_0x5b4f6a(0x1a7)+_0x10c67e+'\x20today\x20/\x20'+_0x1d1d62+_0x5b4f6a(0x191));if(_0x4d3024[_0x5b4f6a(0x19d)]>0x0&&_0x4e8e5a){const _0x3ab41a=formatTokenCount(_0x4d3024[_0x5b4f6a(0x19d)]),_0x2cb022=calculateContextPercentage(_0x4d3024[_0x5b4f6a(0x19d)],_0x4e8e5a);_0x40a8c1[_0x5b4f6a(0x1a4)](_0x5b4f6a(0x18a)+_0x3ab41a+'\x20('+_0x2cb022+'%)');}return console[_0x5b4f6a(0x1a5)](_0x40a8c1[_0x5b4f6a(0x1a3)](_0x5b4f6a(0x195))),0x0;}catch{return console[_0x5b4f6a(0x1a5)](_0x5b4f6a(0x19c)),0x0;}}}
1
+ const a16_0x3d2fd3=a16_0x2fd1;(function(_0x5a4e48,_0x4dee00){const _0x5064e4=a16_0x2fd1,_0x15bf79=_0x5a4e48();while(!![]){try{const _0x156156=-parseInt(_0x5064e4(0xc0))/0x1*(parseInt(_0x5064e4(0xbd))/0x2)+-parseInt(_0x5064e4(0xa9))/0x3*(parseInt(_0x5064e4(0xb0))/0x4)+parseInt(_0x5064e4(0xab))/0x5+-parseInt(_0x5064e4(0xb3))/0x6+parseInt(_0x5064e4(0xb8))/0x7*(parseInt(_0x5064e4(0xbb))/0x8)+parseInt(_0x5064e4(0xb6))/0x9+parseInt(_0x5064e4(0xaf))/0xa;if(_0x156156===_0x4dee00)break;else _0x15bf79['push'](_0x15bf79['shift']());}catch(_0x539d33){_0x15bf79['push'](_0x15bf79['shift']());}}}(a16_0x2ada,0x621dd));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';function a16_0x2ada(){const _0x4dc8a3=['log','push','stdin','Claude','description','latestInputTokens','name','execute','profile','138TvhtZc','statusline','1785825hoCEph','accountId','close','session_id','6355810hFDMIZ','32324hEzsCt','\x20-\x20','model','1256784IcnDiR','tdx','🧠\x20','571932AXLvkt','\x20today\x20/\x20','7qifhiS','sessionCredits','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','4655712ZjEiQp','\x20|\x20','12722ngTwcg','site','parse','103yEdphp','💎\x20','\x20session\x20/\x20','💎\x20tdx\x20-\x20Claude','toFixed'];a16_0x2ada=function(){return _0x4dc8a3;};return a16_0x2ada();}import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../utils/model-factors.js';async function readStdinJson(_0x251a91=0x64){return new Promise(_0x57c671=>{const _0x28c2f0=a16_0x2fd1;let _0x453a8f='',_0x3c182c=![];const _0x529d90=createInterface({'input':process[_0x28c2f0(0xa2)],'terminal':![]}),_0x1baa91=_0x3196b6=>{const _0x2caedc=_0x28c2f0;if(_0x3c182c)return;_0x3c182c=!![],clearTimeout(_0x4a95b6),_0x529d90[_0x2caedc(0xad)](),_0x57c671(_0x3196b6);},_0x4a95b6=setTimeout(()=>{_0x1baa91(null);},_0x251a91);_0x529d90['on']('line',_0x39a1c2=>{_0x453a8f+=_0x39a1c2;}),_0x529d90['on'](_0x28c2f0(0xad),()=>{const _0x9d602e=_0x28c2f0;if(_0x3c182c)return;try{const _0x3547d5=JSON[_0x9d602e(0xbf)](_0x453a8f);_0x1baa91(_0x3547d5);}catch{_0x1baa91(null);}});});}function a16_0x2fd1(_0x569756,_0x33a4bc){_0x569756=_0x569756-0xa0;const _0x2ada6e=a16_0x2ada();let _0x2fd18a=_0x2ada6e[_0x569756];return _0x2fd18a;}function formatCredits(_0x115dc3){const _0x4423b3=a16_0x2fd1;return _0x115dc3[_0x4423b3(0xc4)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a16_0x3d2fd3(0xa6)]=a16_0x3d2fd3(0xaa);[a16_0x3d2fd3(0xa4)]=a16_0x3d2fd3(0xba);async[a16_0x3d2fd3(0xa7)](_0x37fe89){const _0x25107a=a16_0x3d2fd3;try{const _0x37135d=await readStdinJson();if(!_0x37135d?.[_0x25107a(0xae)])return console[_0x25107a(0xa0)](_0x25107a(0xc3)),0x0;const _0xb4f5d8=_0x37135d['session_id'],_0x492415=_0x37135d[_0x25107a(0xb2)]?.['id']||'',_0x18478e=_0x37135d[_0x25107a(0xa8)]||_0x37fe89['options']['profile'],_0x25a76f=await getUsageStats(_0xb4f5d8,_0x18478e),_0x26a806=[],_0xe0ac31=readCachedAccountInfo(_0x18478e),_0x49bdc9=_0xe0ac31?'tdx\x20'+_0xe0ac31[_0x25107a(0xbe)]+':'+_0xe0ac31[_0x25107a(0xac)]:_0x25107a(0xb4),_0x368f87=_0x492415?getModelDisplayName(_0x492415):_0x25107a(0xa3);_0x26a806[_0x25107a(0xa1)](_0x25107a(0xc1)+_0x49bdc9+_0x25107a(0xb1)+_0x368f87);const _0x2394ab=formatCredits(_0x25a76f[_0x25107a(0xb9)]),_0x3155fd=formatCredits(_0x25a76f['todayCredits']),_0x2e4326=formatCredits(_0x25a76f['monthCredits']);_0x26a806[_0x25107a(0xa1)]('🪙\x20credit:\x20'+_0x2394ab+_0x25107a(0xc2)+_0x3155fd+_0x25107a(0xb7)+_0x2e4326+'\x20month');if(_0x25a76f[_0x25107a(0xa5)]>0x0&&_0x492415){const _0x46ea9f=formatTokenCount(_0x25a76f[_0x25107a(0xa5)]),_0xed2e81=calculateContextPercentage(_0x25a76f[_0x25107a(0xa5)],_0x492415);_0x26a806[_0x25107a(0xa1)](_0x25107a(0xb5)+_0x46ea9f+'\x20('+_0xed2e81+'%)');}return console['log'](_0x26a806['join'](_0x25107a(0xbc))),0x0;}catch{return console[_0x25107a(0xa0)](_0x25107a(0xc3)),0x0;}}}
@@ -1 +1 @@
1
- const a17_0x35b98d=a17_0x40f2;(function(_0x696c65,_0xc17ee2){const _0x19af47=a17_0x40f2,_0x4a75cc=_0x696c65();while(!![]){try{const _0x3cd43c=parseInt(_0x19af47(0x15e))/0x1*(parseInt(_0x19af47(0x146))/0x2)+parseInt(_0x19af47(0x14e))/0x3+-parseInt(_0x19af47(0x143))/0x4+parseInt(_0x19af47(0x142))/0x5*(parseInt(_0x19af47(0x13a))/0x6)+parseInt(_0x19af47(0x15d))/0x7*(parseInt(_0x19af47(0x141))/0x8)+parseInt(_0x19af47(0x13b))/0x9+-parseInt(_0x19af47(0x13e))/0xa;if(_0x3cd43c===_0xc17ee2)break;else _0x4a75cc['push'](_0x4a75cc['shift']());}catch(_0x5e3ae4){_0x4a75cc['push'](_0x4a75cc['shift']());}}}(a17_0x1927,0x3e12a));import a17_0x55dc5d from'chalk';import{BaseCommand}from'./command.js';function a17_0x1927(){const _0x4476a7=['409162YphpgO','length','jsonl','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','credits','round','Last\x20Used','never','510597sKhEYA','\x20days\x20ago','Unknown\x20error','monthCredits','log','(default)','cyan','todayCredits','bold','outputTable','en-CA','\x20\x20Today:\x20\x20\x20','\x20credits','Profile','map','13531SrPXTI','1wYYYDZ','error','today\x20','toLocaleDateString','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','lastUsedAt','padStart','2-digit','en-US','short','Error:\x20','totalCredits','dim','profile','yesterday','execute','outputStructured','getTime','format','1806gnZhQX','2847762rnzhar','json','default','10027220Exdiyu','all','repeat','1704WGdAwL','8225AMRPvR','1364400tWztWh','description','toFixed'];a17_0x1927=function(){return _0x4476a7;};return a17_0x1927();}import{handleSDKOutput}from'../utils/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x3d42a4){const _0x291eb1=a17_0x40f2;return _0x3d42a4[_0x291eb1(0x145)](0x2);}function formatLastUsed(_0x186dc7){const _0x444283=a17_0x40f2;if(!_0x186dc7)return _0x444283(0x14d);const _0x26804e=new Date(_0x186dc7),_0x3fbc34=new Date(),_0x4cdf76=_0x26804e[_0x444283(0x12a)]('en-CA'),_0x47fe04=_0x3fbc34[_0x444283(0x12a)](_0x444283(0x158));if(_0x4cdf76===_0x47fe04)return _0x444283(0x160)+_0x26804e['toLocaleTimeString']('en-US',{'hour':'2-digit','minute':_0x444283(0x12e)});const _0x10b5ec=new Date(_0x4cdf76),_0x20c8e3=new Date(_0x47fe04),_0x3ade64=Math[_0x444283(0x14b)]((_0x20c8e3[_0x444283(0x138)]()-_0x10b5ec[_0x444283(0x138)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x3ade64===0x1)return _0x444283(0x135);else return _0x3ade64>0x1&&_0x3ade64<0x7?_0x3ade64+_0x444283(0x14f):_0x26804e['toLocaleDateString'](_0x444283(0x12f),{'month':_0x444283(0x130),'day':'numeric'});}function a17_0x40f2(_0x4779c9,_0x489a60){_0x4779c9=_0x4779c9-0x12a;const _0x1927c8=a17_0x1927();let _0x40f20d=_0x1927c8[_0x4779c9];return _0x40f20d;}export class ClaudeUsageCommand extends BaseCommand{['name']='usage';[a17_0x35b98d(0x144)]=a17_0x35b98d(0x149);async[a17_0x35b98d(0x136)](_0x5f5462){const _0x17aa78=a17_0x35b98d,{options:_0x363176}=_0x5f5462,_0x54a5b1=_0x363176[_0x17aa78(0x139)]===_0x17aa78(0x13c)||_0x363176['format']===_0x17aa78(0x148)||_0x363176[_0x17aa78(0x13c)];try{const [_0x29ca54,_0x52f067]=await Promise[_0x17aa78(0x13f)]([getAllProfileStats(),getUsageSummary()]);return _0x54a5b1?await this[_0x17aa78(0x137)](_0x29ca54,_0x52f067,_0x363176):this['outputTable'](_0x29ca54,_0x52f067),0x0;}catch(_0x49d9df){const _0x4030e0=_0x49d9df instanceof Error?_0x49d9df['message']:_0x17aa78(0x150);return console[_0x17aa78(0x15f)](a17_0x55dc5d['red'](_0x17aa78(0x131)+_0x4030e0)),0x1;}}async[a17_0x35b98d(0x137)](_0x4fc63a,_0x57da53,_0x1a532a){const _0x51a3aa=a17_0x35b98d,_0x34bde9={'summary':{'todayCredits':_0x57da53[_0x51a3aa(0x155)],'monthCredits':_0x57da53[_0x51a3aa(0x151)],'totalCredits':_0x57da53[_0x51a3aa(0x132)],'profileCount':_0x57da53['profileCount']},'profiles':_0x4fc63a[_0x51a3aa(0x15c)](_0xa1287=>({'profile':_0xa1287[_0x51a3aa(0x134)],'credits':_0xa1287[_0x51a3aa(0x14a)],'requests':_0xa1287['entryCount'],'lastUsedAt':_0xa1287['lastUsedAt']}))};await handleSDKOutput([_0x34bde9],_0x1a532a);}[a17_0x35b98d(0x157)](_0x3623d5,_0x8d25ac){const _0xa642db=a17_0x35b98d;console[_0xa642db(0x152)](a17_0x55dc5d[_0xa642db(0x156)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console[_0xa642db(0x152)](a17_0x55dc5d[_0xa642db(0x133)]('─'['repeat'](0x32))),console[_0xa642db(0x152)](_0xa642db(0x159)+a17_0x55dc5d[_0xa642db(0x154)](formatCredits(_0x8d25ac['todayCredits']))+_0xa642db(0x15a)),console['log']('\x20\x20Month:\x20\x20\x20'+a17_0x55dc5d[_0xa642db(0x154)](formatCredits(_0x8d25ac[_0xa642db(0x151)]))+_0xa642db(0x15a)),console[_0xa642db(0x152)]('\x20\x20Total:\x20\x20\x20'+a17_0x55dc5d[_0xa642db(0x154)](formatCredits(_0x8d25ac[_0xa642db(0x132)]))+_0xa642db(0x15a)),console[_0xa642db(0x152)]();if(_0x3623d5['length']===0x0){console[_0xa642db(0x152)](a17_0x55dc5d[_0xa642db(0x133)](_0xa642db(0x12b))),console[_0xa642db(0x152)](a17_0x55dc5d[_0xa642db(0x133)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console['log'](a17_0x55dc5d[_0xa642db(0x156)]('Usage\x20by\x20Profile')),console[_0xa642db(0x152)](a17_0x55dc5d['dim']('─'[_0xa642db(0x140)](0x3c)));const _0x56e059=Math['max'](0xc,..._0x3623d5['map'](_0x128f58=>_0x128f58['profile']===_0xa642db(0x13d)?_0xa642db(0x153)[_0xa642db(0x147)]:_0x128f58[_0xa642db(0x134)][_0xa642db(0x147)])),_0x1c705a=0xa,_0x42ba93=0xa;console[_0xa642db(0x152)]('\x20\x20'+_0xa642db(0x15b)['padEnd'](_0x56e059)+'\x20\x20'+'Credits'[_0xa642db(0x12d)](_0x1c705a)+'\x20\x20'+'Requests'[_0xa642db(0x12d)](_0x42ba93)+'\x20\x20'+_0xa642db(0x14c));for(const _0x2396d0 of _0x3623d5){const _0x2ef383=_0x2396d0[_0xa642db(0x134)]===_0xa642db(0x13d)?_0xa642db(0x153):_0x2396d0[_0xa642db(0x134)],_0x35c540=_0x2ef383['padEnd'](_0x56e059),_0x2d5644=_0x2396d0['profile']==='default'?a17_0x55dc5d['dim'](_0x35c540):_0x35c540;console['log']('\x20\x20'+_0x2d5644+'\x20\x20'+a17_0x55dc5d[_0xa642db(0x154)](formatCredits(_0x2396d0[_0xa642db(0x14a)])['padStart'](_0x1c705a))+'\x20\x20'+String(_0x2396d0['entryCount'])[_0xa642db(0x12d)](_0x42ba93)+'\x20\x20'+a17_0x55dc5d[_0xa642db(0x133)](formatLastUsed(_0x2396d0[_0xa642db(0x12c)])));}console[_0xa642db(0x152)](),console[_0xa642db(0x152)](a17_0x55dc5d[_0xa642db(0x133)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0xa642db(0x152)]();}}
1
+ const a17_0x379910=a17_0x5d21;(function(_0x579961,_0x164a0c){const _0x219c76=a17_0x5d21,_0x108eb3=_0x579961();while(!![]){try{const _0x2dc9e2=parseInt(_0x219c76(0xaf))/0x1+parseInt(_0x219c76(0xbb))/0x2*(parseInt(_0x219c76(0xdb))/0x3)+parseInt(_0x219c76(0xc4))/0x4+-parseInt(_0x219c76(0xd9))/0x5+-parseInt(_0x219c76(0xb2))/0x6*(-parseInt(_0x219c76(0xc1))/0x7)+parseInt(_0x219c76(0xa8))/0x8*(parseInt(_0x219c76(0xb4))/0x9)+-parseInt(_0x219c76(0xc6))/0xa;if(_0x2dc9e2===_0x164a0c)break;else _0x108eb3['push'](_0x108eb3['shift']());}catch(_0x3cb12a){_0x108eb3['push'](_0x108eb3['shift']());}}}(a17_0x2413,0x1876b));import a17_0x1af28c from'chalk';function a17_0x5d21(_0x532bed,_0x3cdc3d){_0x532bed=_0x532bed-0xa6;const _0x241357=a17_0x2413();let _0x5d2177=_0x241357[_0x532bed];return _0x5d2177;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x5a6e95){const _0x582e61=a17_0x5d21;return _0x5a6e95[_0x582e61(0xae)](0x2);}function formatLastUsed(_0x6fb28d){const _0x4aee24=a17_0x5d21;if(!_0x6fb28d)return _0x4aee24(0xaa);const _0x5ab558=new Date(_0x6fb28d),_0x289a03=new Date(),_0x14e33e=_0x5ab558[_0x4aee24(0xc0)](_0x4aee24(0xd8)),_0x31afc7=_0x289a03[_0x4aee24(0xc0)](_0x4aee24(0xd8));if(_0x14e33e===_0x31afc7)return _0x4aee24(0xd0)+_0x5ab558[_0x4aee24(0xcf)](_0x4aee24(0xab),{'hour':'2-digit','minute':'2-digit'});const _0x1e5de6=new Date(_0x14e33e),_0x1c7345=new Date(_0x31afc7),_0x6475a5=Math['round']((_0x1c7345[_0x4aee24(0xb9)]()-_0x1e5de6['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x6475a5===0x1)return'yesterday';else return _0x6475a5>0x1&&_0x6475a5<0x7?_0x6475a5+_0x4aee24(0xd6):_0x5ab558['toLocaleDateString'](_0x4aee24(0xab),{'month':_0x4aee24(0xa6),'day':_0x4aee24(0xd3)});}export class ClaudeUsageCommand extends BaseCommand{['name']=a17_0x379910(0xb1);[a17_0x379910(0xe0)]=a17_0x379910(0xd5);async[a17_0x379910(0xbd)](_0x308e53){const _0x34eeae=a17_0x379910,{options:_0x725c18}=_0x308e53,_0x37eae8=_0x725c18['format']===_0x34eeae(0xac)||_0x725c18[_0x34eeae(0xc5)]===_0x34eeae(0xd2)||_0x725c18['json'];try{const [_0x251744,_0x2a368a]=await Promise['all']([getAllProfileStats(),getUsageSummary()]);return _0x37eae8?await this[_0x34eeae(0xa9)](_0x251744,_0x2a368a,_0x725c18):this[_0x34eeae(0xc9)](_0x251744,_0x2a368a),0x0;}catch(_0x30ba0e){const _0x3d83e6=_0x30ba0e instanceof Error?_0x30ba0e['message']:_0x34eeae(0xad);return console['error'](a17_0x1af28c['red'](_0x34eeae(0xb6)+_0x3d83e6)),0x1;}}async['outputStructured'](_0x5433d2,_0x3c5603,_0x2ed5f1){const _0x5a6ca7=a17_0x379910,_0x40beb4={'summary':{'todayCredits':_0x3c5603['todayCredits'],'monthCredits':_0x3c5603[_0x5a6ca7(0xe1)],'totalCredits':_0x3c5603[_0x5a6ca7(0xdd)],'profileCount':_0x3c5603[_0x5a6ca7(0xda)]},'profiles':_0x5433d2['map'](_0x3ef176=>({'profile':_0x3ef176[_0x5a6ca7(0xb0)],'credits':_0x3ef176[_0x5a6ca7(0xc8)],'requests':_0x3ef176[_0x5a6ca7(0xca)],'lastUsedAt':_0x3ef176[_0x5a6ca7(0xdc)]}))};await handleSDKOutput([_0x40beb4],_0x2ed5f1);}[a17_0x379910(0xc9)](_0x2e4087,_0x49bdd1){const _0x3bebf4=a17_0x379910;console[_0x3bebf4(0xb5)](a17_0x1af28c[_0x3bebf4(0xb8)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console['log'](a17_0x1af28c[_0x3bebf4(0xc7)]('─'['repeat'](0x32))),console['log'](_0x3bebf4(0xd7)+a17_0x1af28c[_0x3bebf4(0xce)](formatCredits(_0x49bdd1['todayCredits']))+_0x3bebf4(0xbe)),console[_0x3bebf4(0xb5)](_0x3bebf4(0xc3)+a17_0x1af28c[_0x3bebf4(0xce)](formatCredits(_0x49bdd1[_0x3bebf4(0xe1)]))+_0x3bebf4(0xbe)),console['log'](_0x3bebf4(0xc2)+a17_0x1af28c['cyan'](formatCredits(_0x49bdd1['totalCredits']))+_0x3bebf4(0xbe)),console['log']();if(_0x2e4087['length']===0x0){console[_0x3bebf4(0xb5)](a17_0x1af28c['dim']('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console[_0x3bebf4(0xb5)](a17_0x1af28c[_0x3bebf4(0xc7)](_0x3bebf4(0xba)));return;}console['log'](a17_0x1af28c[_0x3bebf4(0xb8)](_0x3bebf4(0xd1))),console[_0x3bebf4(0xb5)](a17_0x1af28c[_0x3bebf4(0xc7)]('─'[_0x3bebf4(0xcd)](0x3c)));const _0x5be1a5=Math[_0x3bebf4(0xd4)](0xc,..._0x2e4087['map'](_0xf64240=>_0xf64240[_0x3bebf4(0xb0)]===_0x3bebf4(0xcc)?_0x3bebf4(0xbc)[_0x3bebf4(0xcb)]:_0xf64240[_0x3bebf4(0xb0)][_0x3bebf4(0xcb)])),_0x2e3dfd=0xa,_0x348ec0=0xa;console[_0x3bebf4(0xb5)]('\x20\x20'+'Profile'[_0x3bebf4(0xdf)](_0x5be1a5)+'\x20\x20'+_0x3bebf4(0xde)[_0x3bebf4(0xb3)](_0x2e3dfd)+'\x20\x20'+_0x3bebf4(0xa7)['padStart'](_0x348ec0)+'\x20\x20'+_0x3bebf4(0xbf));for(const _0x34fa25 of _0x2e4087){const _0x1e1f11=_0x34fa25['profile']==='default'?_0x3bebf4(0xbc):_0x34fa25['profile'],_0x52a075=_0x1e1f11[_0x3bebf4(0xdf)](_0x5be1a5),_0x233884=_0x34fa25[_0x3bebf4(0xb0)]===_0x3bebf4(0xcc)?a17_0x1af28c['dim'](_0x52a075):_0x52a075;console['log']('\x20\x20'+_0x233884+'\x20\x20'+a17_0x1af28c[_0x3bebf4(0xce)](formatCredits(_0x34fa25[_0x3bebf4(0xc8)])[_0x3bebf4(0xb3)](_0x2e3dfd))+'\x20\x20'+String(_0x34fa25[_0x3bebf4(0xca)])[_0x3bebf4(0xb3)](_0x348ec0)+'\x20\x20'+a17_0x1af28c[_0x3bebf4(0xc7)](formatLastUsed(_0x34fa25[_0x3bebf4(0xdc)])));}console[_0x3bebf4(0xb5)](),console[_0x3bebf4(0xb5)](a17_0x1af28c['dim'](_0x3bebf4(0xb7))),console[_0x3bebf4(0xb5)]();}}function a17_0x2413(){const _0x1b69c2=['default','repeat','cyan','toLocaleTimeString','today\x20','Usage\x20by\x20Profile','jsonl','numeric','max','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','\x20days\x20ago','\x20\x20Today:\x20\x20\x20','en-CA','443780KVtUEi','profileCount','3aUjRjK','lastUsedAt','totalCredits','Credits','padEnd','description','monthCredits','short','Requests','4016xcDhZS','outputStructured','never','en-US','json','Unknown\x20error','toFixed','136948FnazsZ','profile','usage','945354WdaxaI','padStart','9QCAteW','log','Error:\x20','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','bold','getTime','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','274150rNSvki','(default)','execute','\x20credits','Last\x20Used','toLocaleDateString','7zJbAqY','\x20\x20Total:\x20\x20\x20','\x20\x20Month:\x20\x20\x20','91612PKYzwz','format','2660280nBJLUa','dim','credits','outputTable','entryCount','length'];a17_0x2413=function(){return _0x1b69c2;};return a17_0x2413();}
@@ -1 +1 @@
1
- const a18_0x1627d3=a18_0x15e7;function a18_0x40c4(){const _0x4c0afa=['validateGlobalOptions','register','279OYTfKt','logger','5629IsbWSb','8162yesRnS','yellow','tdx','options','24vwBpuq','\x0aStack\x20trace:\x0a','stack','validate','45150yEQwlt','\x20\x20tdx\x20auth','message','Command\x20\x27','337052dHjFyq','profile','.\x20Must\x20be\x20a\x20number.','Authentication\x20error\x20stack\x20trace:','run','has','commands','\x20--profile\x20','\x20\x20tdx\x20auth\x20setup','27mLfCFh','problemDetails','\x0aTo\x20set\x20up\x20authentication:','debug','\x27\x20is\x20already\x20registered','execute','category','886085mrJAlI','Authentication\x20failed','221890axqccY','1501138cIHzkQ','number','isValid','Error:\x20','limit','1932FuTwfu','get','helpText','error','red','512igwuNV','2mgpfnw','name','3283ABYhem','from'];a18_0x40c4=function(){return _0x4c0afa;};return a18_0x40c4();}(function(_0x4d6673,_0x17a2c1){const _0x578534=a18_0x15e7,_0x4fdcc3=_0x4d6673();while(!![]){try{const _0x43297e=-parseInt(_0x578534(0x141))/0x1*(-parseInt(_0x578534(0x136))/0x2)+parseInt(_0x578534(0x12c))/0x3*(-parseInt(_0x578534(0x123))/0x4)+parseInt(_0x578534(0x133))/0x5*(-parseInt(_0x578534(0x11b))/0x6)+-parseInt(_0x578534(0x143))/0x7*(parseInt(_0x578534(0x140))/0x8)+-parseInt(_0x578534(0x147))/0x9*(parseInt(_0x578534(0x135))/0xa)+-parseInt(_0x578534(0x14a))/0xb*(-parseInt(_0x578534(0x13b))/0xc)+-parseInt(_0x578534(0x149))/0xd*(-parseInt(_0x578534(0x11f))/0xe);if(_0x43297e===_0x17a2c1)break;else _0x4fdcc3['push'](_0x4fdcc3['shift']());}catch(_0x52c87d){_0x4fdcc3['push'](_0x4fdcc3['shift']());}}}(a18_0x40c4,0xcb1ab));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a18_0x1c5830 from'chalk';function a18_0x15e7(_0x40f52d,_0x302693){_0x40f52d=_0x40f52d-0x118;const _0x40c4c7=a18_0x40c4();let _0x15e795=_0x40c4c7[_0x40f52d];return _0x15e795;}export function printAuthError(_0x3c6b44,_0x84e582=![],_0x2b6eac){const _0x1552aa=a18_0x15e7,_0x1b724d=_0x3c6b44[_0x1552aa(0x12d)]?.['detail']||_0x3c6b44[_0x1552aa(0x121)];console[_0x1552aa(0x13e)](a18_0x1c5830[_0x1552aa(0x13f)](_0x1552aa(0x134))),console[_0x1552aa(0x13e)](a18_0x1c5830[_0x1552aa(0x13f)]('Reason:\x20'+_0x1b724d));if(_0x84e582){const _0x298699=_0x2b6eac?_0x1552aa(0x12a)+_0x2b6eac:'';console[_0x1552aa(0x13e)](_0x1552aa(0x12e)),console[_0x1552aa(0x13e)](_0x1552aa(0x12b)+_0x298699+'\x0a'),console['error']('To\x20check\x20your\x20current\x20auth\x20status:'),console[_0x1552aa(0x13e)](_0x1552aa(0x120)+_0x298699);}}export class BaseCommand{[a18_0x1627d3(0x145)](_0x22a192){const _0xc1930b=a18_0x1627d3,{options:_0x29c7ea}=_0x22a192,_0x4ff6c2=_0x29c7ea[_0xc1930b(0x13a)];if(_0x4ff6c2!==undefined){const _0x585362=typeof _0x4ff6c2===_0xc1930b(0x137)?_0x4ff6c2:parseInt(_0x4ff6c2,0xa);if(isNaN(_0x585362))return'Invalid\x20limit\x20value:\x20'+_0x4ff6c2+_0xc1930b(0x125);const _0x5a5e93=validateLimitOption(_0x585362);if(!_0x5a5e93[_0xc1930b(0x138)])return _0x5a5e93['error'];_0x22a192[_0xc1930b(0x11a)][_0xc1930b(0x13a)]=_0x5a5e93['value'];}return undefined;}['validate'](_0x4a0931){return undefined;}async[a18_0x1627d3(0x127)](_0x453f71){const _0x422405=a18_0x1627d3;try{const _0x120d9e=this[_0x422405(0x145)](_0x453f71);if(_0x120d9e)return console[_0x422405(0x13e)](_0x422405(0x139)+_0x120d9e),0x1;const _0x2872ee=this[_0x422405(0x11e)](_0x453f71);if(_0x2872ee){const _0x54fc5c=/^\s*(Usage|Note|Warning|Error):/i['test'](_0x2872ee);return _0x54fc5c?console[_0x422405(0x13e)](_0x2872ee):console[_0x422405(0x13e)](_0x422405(0x139)+_0x2872ee),0x1;}const _0x53baa5=await this[_0x422405(0x131)](_0x453f71);return _0x53baa5??0x0;}catch(_0x4607d0){if(_0x4607d0 instanceof Error){if(_0x4607d0 instanceof HTTPClientError&&_0x4607d0['status']===0x191){const _0x4fb22e=_0x453f71[_0x422405(0x11a)][_0x422405(0x124)];return printAuthError(_0x4607d0,!![],_0x4fb22e),_0x4607d0[_0x422405(0x11d)]&&_0x453f71[_0x422405(0x119)]&&(_0x453f71[_0x422405(0x119)][_0x422405(0x148)]['debug'](_0x422405(0x126)),_0x453f71[_0x422405(0x119)][_0x422405(0x148)][_0x422405(0x12f)](_0x4607d0['stack'])),0x1;}console[_0x422405(0x13e)](a18_0x1c5830[_0x422405(0x13f)](_0x422405(0x139)+_0x4607d0['message']));_0x4607d0 instanceof SDKError&&_0x4607d0[_0x422405(0x13d)]&&console['error'](a18_0x1c5830[_0x422405(0x118)](_0x4607d0[_0x422405(0x13d)]));const _0x552363=_0x4607d0 instanceof SDKError&&_0x4607d0[_0x422405(0x132)]===ErrorCategory['USER_ERROR'];_0x4607d0[_0x422405(0x11d)]&&!_0x552363&&console['error'](_0x422405(0x11c)+_0x4607d0['stack']);}else console[_0x422405(0x13e)](_0x422405(0x139)+String(_0x4607d0));return 0x1;}}}export class CommandRegistry{[a18_0x1627d3(0x129)]=new Map();[a18_0x1627d3(0x146)](_0x3e93b5){const _0x2d69d8=a18_0x1627d3;if(this[_0x2d69d8(0x129)][_0x2d69d8(0x128)](_0x3e93b5[_0x2d69d8(0x142)]))throw new Error(_0x2d69d8(0x122)+_0x3e93b5['name']+_0x2d69d8(0x130));this['commands']['set'](_0x3e93b5[_0x2d69d8(0x142)],_0x3e93b5);}['get'](_0x4fe453){const _0x4e375c=a18_0x1627d3;return this[_0x4e375c(0x129)][_0x4e375c(0x13c)](_0x4fe453);}['getAll'](){const _0x38a572=a18_0x1627d3;return Array[_0x38a572(0x144)](this[_0x38a572(0x129)]['values']());}[a18_0x1627d3(0x128)](_0x1f1e08){const _0x5c4729=a18_0x1627d3;return this[_0x5c4729(0x129)][_0x5c4729(0x128)](_0x1f1e08);}}export const registry=new CommandRegistry();
1
+ function a18_0x3c42(_0x34d5ba,_0x4b3092){_0x34d5ba=_0x34d5ba-0x16c;const _0x446890=a18_0x4468();let _0x3c4283=_0x446890[_0x34d5ba];return _0x3c4283;}const a18_0x1b5a26=a18_0x3c42;(function(_0x5e432f,_0x5b5ae3){const _0x295a44=a18_0x3c42,_0xefbfd7=_0x5e432f();while(!![]){try{const _0x3c9a74=parseInt(_0x295a44(0x196))/0x1*(-parseInt(_0x295a44(0x19b))/0x2)+parseInt(_0x295a44(0x188))/0x3+-parseInt(_0x295a44(0x199))/0x4+parseInt(_0x295a44(0x181))/0x5+parseInt(_0x295a44(0x17d))/0x6*(-parseInt(_0x295a44(0x16f))/0x7)+parseInt(_0x295a44(0x195))/0x8+-parseInt(_0x295a44(0x17f))/0x9;if(_0x3c9a74===_0x5b5ae3)break;else _0xefbfd7['push'](_0xefbfd7['shift']());}catch(_0x53296b){_0xefbfd7['push'](_0xefbfd7['shift']());}}}(a18_0x4468,0x9a89d));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a18_0x1b45e4 from'chalk';function a18_0x4468(){const _0x1b6348=['Reason:\x20','error','detail','validate','\x20\x20tdx\x20auth','options','isValid','status','2221584aRXeKL','logger','3228066bwBhwc','execute','3970390VfjQbL','name','commands','.\x20Must\x20be\x20a\x20number.','tdx','helpText','stack','14445BnWKRx','getAll','category','debug','value','USER_ERROR','message','number','\x20--profile\x20','\x0aStack\x20trace:\x0a','has','get','Error:\x20','6999640ctuRqY','16VcjLQy','red','\x0aTo\x20set\x20up\x20authentication:','907396wiLzZn','To\x20check\x20your\x20current\x20auth\x20status:','10634KperZI','yellow','validateGlobalOptions','test','7oDTtIr','problemDetails','register','Invalid\x20limit\x20value:\x20','values','profile'];a18_0x4468=function(){return _0x1b6348;};return a18_0x4468();}export function printAuthError(_0x24c058,_0x2077cc=![],_0x27a03b){const _0x1f970f=a18_0x3c42,_0xba3427=_0x24c058[_0x1f970f(0x170)]?.[_0x1f970f(0x177)]||_0x24c058[_0x1f970f(0x18e)];console[_0x1f970f(0x176)](a18_0x1b45e4[_0x1f970f(0x197)]('Authentication\x20failed')),console[_0x1f970f(0x176)](a18_0x1b45e4[_0x1f970f(0x197)](_0x1f970f(0x175)+_0xba3427));if(_0x2077cc){const _0x55da18=_0x27a03b?_0x1f970f(0x190)+_0x27a03b:'';console[_0x1f970f(0x176)](_0x1f970f(0x198)),console[_0x1f970f(0x176)]('\x20\x20tdx\x20auth\x20setup'+_0x55da18+'\x0a'),console[_0x1f970f(0x176)](_0x1f970f(0x19a)),console[_0x1f970f(0x176)](_0x1f970f(0x179)+_0x55da18);}}export class BaseCommand{[a18_0x1b5a26(0x16d)](_0x578e27){const _0x46c6a3=a18_0x1b5a26,{options:_0x182edb}=_0x578e27,_0x30ec07=_0x182edb['limit'];if(_0x30ec07!==undefined){const _0x1cf220=typeof _0x30ec07===_0x46c6a3(0x18f)?_0x30ec07:parseInt(_0x30ec07,0xa);if(isNaN(_0x1cf220))return _0x46c6a3(0x172)+_0x30ec07+_0x46c6a3(0x184);const _0x226746=validateLimitOption(_0x1cf220);if(!_0x226746[_0x46c6a3(0x17b)])return _0x226746[_0x46c6a3(0x176)];_0x578e27[_0x46c6a3(0x17a)]['limit']=_0x226746[_0x46c6a3(0x18c)];}return undefined;}[a18_0x1b5a26(0x178)](_0x2972eb){return undefined;}async['run'](_0x1997af){const _0x490003=a18_0x1b5a26;try{const _0x1ccf6f=this[_0x490003(0x16d)](_0x1997af);if(_0x1ccf6f)return console[_0x490003(0x176)](_0x490003(0x194)+_0x1ccf6f),0x1;const _0x4c3e64=this[_0x490003(0x178)](_0x1997af);if(_0x4c3e64){const _0x27d52f=/^\s*(Usage|Note|Warning|Error):/i[_0x490003(0x16e)](_0x4c3e64);return _0x27d52f?console['error'](_0x4c3e64):console[_0x490003(0x176)]('Error:\x20'+_0x4c3e64),0x1;}const _0x5839ab=await this[_0x490003(0x180)](_0x1997af);return _0x5839ab??0x0;}catch(_0x135652){if(_0x135652 instanceof Error){if(_0x135652 instanceof HTTPClientError&&_0x135652[_0x490003(0x17c)]===0x191){const _0x222066=_0x1997af['options'][_0x490003(0x174)];return printAuthError(_0x135652,!![],_0x222066),_0x135652['stack']&&_0x1997af['tdx']&&(_0x1997af['tdx'][_0x490003(0x17e)][_0x490003(0x18b)]('Authentication\x20error\x20stack\x20trace:'),_0x1997af[_0x490003(0x185)][_0x490003(0x17e)][_0x490003(0x18b)](_0x135652[_0x490003(0x187)])),0x1;}console[_0x490003(0x176)](a18_0x1b45e4['red'](_0x490003(0x194)+_0x135652[_0x490003(0x18e)]));_0x135652 instanceof SDKError&&_0x135652[_0x490003(0x186)]&&console[_0x490003(0x176)](a18_0x1b45e4[_0x490003(0x16c)](_0x135652[_0x490003(0x186)]));const _0xa184ea=_0x135652 instanceof SDKError&&_0x135652[_0x490003(0x18a)]===ErrorCategory[_0x490003(0x18d)];_0x135652[_0x490003(0x187)]&&!_0xa184ea&&console['error'](_0x490003(0x191)+_0x135652[_0x490003(0x187)]);}else console[_0x490003(0x176)](_0x490003(0x194)+String(_0x135652));return 0x1;}}}export class CommandRegistry{[a18_0x1b5a26(0x183)]=new Map();[a18_0x1b5a26(0x171)](_0x576a11){const _0x28085f=a18_0x1b5a26;if(this['commands'][_0x28085f(0x192)](_0x576a11[_0x28085f(0x182)]))throw new Error('Command\x20\x27'+_0x576a11[_0x28085f(0x182)]+'\x27\x20is\x20already\x20registered');this[_0x28085f(0x183)]['set'](_0x576a11[_0x28085f(0x182)],_0x576a11);}[a18_0x1b5a26(0x193)](_0x20cfcf){const _0xdb1cb8=a18_0x1b5a26;return this[_0xdb1cb8(0x183)]['get'](_0x20cfcf);}[a18_0x1b5a26(0x189)](){const _0xf1cce1=a18_0x1b5a26;return Array['from'](this[_0xf1cce1(0x183)][_0xf1cce1(0x173)]());}[a18_0x1b5a26(0x192)](_0x36ef4e){const _0x22dd1a=a18_0x1b5a26;return this[_0x22dd1a(0x183)][_0x22dd1a(0x192)](_0x36ef4e);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a19_0x34fbb7=a19_0x499b;(function(_0x118c86,_0x27ba29){const _0x32f9ce=a19_0x499b,_0x267634=_0x118c86();while(!![]){try{const _0x44f1be=-parseInt(_0x32f9ce(0x1ab))/0x1+parseInt(_0x32f9ce(0x1cb))/0x2+parseInt(_0x32f9ce(0x1b1))/0x3+parseInt(_0x32f9ce(0x1a9))/0x4*(-parseInt(_0x32f9ce(0x1bd))/0x5)+-parseInt(_0x32f9ce(0x1bc))/0x6*(parseInt(_0x32f9ce(0x1ba))/0x7)+-parseInt(_0x32f9ce(0x1c6))/0x8+parseInt(_0x32f9ce(0x1b5))/0x9*(parseInt(_0x32f9ce(0x1ac))/0xa);if(_0x44f1be===_0x27ba29)break;else _0x267634['push'](_0x267634['shift']());}catch(_0x5027be){_0x267634['push'](_0x267634['shift']());}}}(a19_0x1bcd,0x353f7));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a19_0x499b(_0x44e47d,_0x3552ec){_0x44e47d=_0x44e47d-0x1a4;const _0x1bcda0=a19_0x1bcd();let _0x499ba9=_0x1bcda0[_0x44e47d];return _0x499ba9;}import a19_0x362ee6 from'chalk';function a19_0x1bcd(){const _0x44c7cc=['\x20-\x20','632112kcIUMk','Site:\x20','dim','owner','2505834JOsYVi','✔\x20Found\x20','execute','length','Looking\x20up\x20connection:\x20','572432TUeeud','error','6uEEURz','125335tvdfKo','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','resolve','padStart','slice','Listing\x20connections...','description','connection','Fetching\x20connection\x20\x27','474640cNBiIW','join','Show\x20connection\x20details','list','\x27...','326052LyZaBX','type','validate','name','\x20connection','push','List\x20all\x20result\x20output\x20connections','max','verbose','data','map','28LnTRls','cyan','395904RweYnP','20xJSZrS','table','connection:show','output'];a19_0x1bcd=function(){return _0x44c7cc;};return a19_0x1bcd();}export class ConnectionListCommand extends BaseCommand{[a19_0x34fbb7(0x1ce)]='connection:list';[a19_0x34fbb7(0x1c3)]=a19_0x34fbb7(0x1a4);async[a19_0x34fbb7(0x1b7)](_0x4a4f88){const _0x5d50db=a19_0x34fbb7,{options:_0x3d0449,tdx:_0x4e4abd}=_0x4a4f88;_0x3d0449[_0x5d50db(0x1a6)]&&console[_0x5d50db(0x1bb)](_0x5d50db(0x1b2)+_0x3d0449['site']);const _0x501d66=resolveLimit(_0x3d0449['limit'],DEFAULT_LISTING_LIMIT),_0x37eca9=await withSpinner(_0x5d50db(0x1c2),()=>_0x4e4abd[_0x5d50db(0x1c4)][_0x5d50db(0x1c9)](),{'verbose':_0x3d0449[_0x5d50db(0x1a6)]}),_0x54ddb9=_0x37eca9[_0x5d50db(0x1a7)];console[_0x5d50db(0x1bb)](_0x5d50db(0x1b6)+_0x54ddb9[_0x5d50db(0x1b8)]+_0x5d50db(0x1cf)+(_0x54ddb9['length']!==0x1?'s':''));if(isStructuredFormat(_0x3d0449)){const _0x2b958d=_0x54ddb9[_0x5d50db(0x1c1)](0x0,_0x501d66);await handleSDKOutput(_0x2b958d,{..._0x3d0449,'limit':_0x501d66});}else{const _0x7adbf3=_0x54ddb9['length']>0x0?Math[_0x5d50db(0x1a5)](..._0x54ddb9[_0x5d50db(0x1a8)](_0x56cc87=>_0x56cc87[_0x5d50db(0x1cc)][_0x5d50db(0x1b8)])):0x0,_0x196201=[];for(const _0xdfd43b of _0x54ddb9){const _0x4c7374=a19_0x362ee6[_0x5d50db(0x1aa)](_0xdfd43b[_0x5d50db(0x1cc)][_0x5d50db(0x1c0)](_0x7adbf3)),_0x572940=_0xdfd43b[_0x5d50db(0x1b4)]?.[_0x5d50db(0x1ce)]?_0x5d50db(0x1b0)+a19_0x362ee6[_0x5d50db(0x1b3)](_0xdfd43b[_0x5d50db(0x1b4)]['name']):'';_0x196201[_0x5d50db(0x1d0)](_0x4c7374+'\x20\x20'+_0xdfd43b[_0x5d50db(0x1ce)]+_0x572940);}await writeOutput(_0x196201[_0x5d50db(0x1c7)]('\x0a'),_0x3d0449[_0x5d50db(0x1af)],_0x5d50db(0x1ad));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']=a19_0x34fbb7(0x1ae);[a19_0x34fbb7(0x1c3)]=a19_0x34fbb7(0x1c8);[a19_0x34fbb7(0x1cd)](_0x293986){const _0xf6f70b=a19_0x34fbb7,{args:_0x49f094}=_0x293986;if(!_0x49f094[0x0])return _0xf6f70b(0x1be);return undefined;}async['execute'](_0x543b57){const _0x3c7a7f=a19_0x34fbb7,{options:_0x1dcf1a,args:_0x2b1644,tdx:_0x3c5619}=_0x543b57,_0xf667a5=_0x2b1644[0x0];_0x1dcf1a[_0x3c7a7f(0x1a6)]&&(console['error'](_0x3c7a7f(0x1b2)+_0x1dcf1a['site']),console[_0x3c7a7f(0x1bb)](_0x3c7a7f(0x1b9)+_0xf667a5));const _0x5ba31c=await withSpinner(_0x3c7a7f(0x1c5)+_0xf667a5+_0x3c7a7f(0x1ca),()=>_0x3c5619[_0x3c7a7f(0x1c4)][_0x3c7a7f(0x1bf)](_0xf667a5),{'verbose':_0x1dcf1a[_0x3c7a7f(0x1a6)]}),_0x34d084=_0x5ba31c[_0x3c7a7f(0x1a7)];return console[_0x3c7a7f(0x1bb)]('✔\x20Found\x20connection:\x20'+_0x34d084[_0x3c7a7f(0x1ce)]),await handleSingleObjectOutput(_0x34d084,_0x1dcf1a),0x0;}}
1
+ const a19_0x3dbf1c=a19_0x3168;function a19_0x5e23(){const _0x1d7df5=['cyan','connection:show','Fetching\x20connection\x20\x27','51316JcapLc','padStart','join','✔\x20Found\x20','Site:\x20','error','execute','Show\x20connection\x20details','7952930JmoAju','data','3721275leAzBT','type','name','push','slice','length','Listing\x20connections...','output','18609910zFmXgV','2064XauGIH','12131IYnqBf','connection','connection:list','\x27...','resolve','39PnLitv','limit','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','validate','\x20-\x20','list','6jzACCH','Looking\x20up\x20connection:\x20','owner','35ntGdIT','max','\x20connection','site','669655ARybKR','112444oqhUzO','description','table','verbose','map'];a19_0x5e23=function(){return _0x1d7df5;};return a19_0x5e23();}(function(_0x3d0974,_0x41d109){const _0x58c152=a19_0x3168,_0x1f8885=_0x3d0974();while(!![]){try{const _0x2692df=parseInt(_0x58c152(0x15d))/0x1*(parseInt(_0x58c152(0x16a))/0x2)+-parseInt(_0x58c152(0x154))/0x3*(-parseInt(_0x58c152(0x162))/0x4)+-parseInt(_0x58c152(0x161))/0x5*(-parseInt(_0x58c152(0x15a))/0x6)+-parseInt(_0x58c152(0x17e))/0x7*(parseInt(_0x58c152(0x17d))/0x8)+parseInt(_0x58c152(0x174))/0x9+parseInt(_0x58c152(0x172))/0xa+-parseInt(_0x58c152(0x17c))/0xb;if(_0x2692df===_0x41d109)break;else _0x1f8885['push'](_0x1f8885['shift']());}catch(_0x5e374d){_0x1f8885['push'](_0x1f8885['shift']());}}}(a19_0x5e23,0x72130));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import a19_0x7daa11 from'chalk';export class ConnectionListCommand extends BaseCommand{['name']=a19_0x3dbf1c(0x180);[a19_0x3dbf1c(0x163)]='List\x20all\x20result\x20output\x20connections';async[a19_0x3dbf1c(0x170)](_0x2fa074){const _0x2dd5fa=a19_0x3dbf1c,{options:_0x4ab1df,tdx:_0x535382}=_0x2fa074;_0x4ab1df['verbose']&&console[_0x2dd5fa(0x16f)](_0x2dd5fa(0x16e)+_0x4ab1df[_0x2dd5fa(0x160)]);const _0x1930b3=resolveLimit(_0x4ab1df[_0x2dd5fa(0x155)],DEFAULT_LISTING_LIMIT),_0xe13c5f=await withSpinner(_0x2dd5fa(0x17a),()=>_0x535382[_0x2dd5fa(0x17f)][_0x2dd5fa(0x159)](),{'verbose':_0x4ab1df[_0x2dd5fa(0x165)]}),_0x3eb076=_0xe13c5f[_0x2dd5fa(0x173)];console['error'](_0x2dd5fa(0x16d)+_0x3eb076[_0x2dd5fa(0x179)]+_0x2dd5fa(0x15f)+(_0x3eb076[_0x2dd5fa(0x179)]!==0x1?'s':''));if(isStructuredFormat(_0x4ab1df)){const _0x11e25c=_0x3eb076[_0x2dd5fa(0x178)](0x0,_0x1930b3);await handleSDKOutput(_0x11e25c,{..._0x4ab1df,'limit':_0x1930b3});}else{const _0x39664c=_0x3eb076[_0x2dd5fa(0x179)]>0x0?Math[_0x2dd5fa(0x15e)](..._0x3eb076[_0x2dd5fa(0x166)](_0x1db2af=>_0x1db2af['type'][_0x2dd5fa(0x179)])):0x0,_0x3d3050=[];for(const _0x43373e of _0x3eb076){const _0x56d0de=a19_0x7daa11[_0x2dd5fa(0x167)](_0x43373e[_0x2dd5fa(0x175)][_0x2dd5fa(0x16b)](_0x39664c)),_0x3e6fd2=_0x43373e['owner']?.[_0x2dd5fa(0x176)]?_0x2dd5fa(0x158)+a19_0x7daa11['dim'](_0x43373e[_0x2dd5fa(0x15c)]['name']):'';_0x3d3050[_0x2dd5fa(0x177)](_0x56d0de+'\x20\x20'+_0x43373e[_0x2dd5fa(0x176)]+_0x3e6fd2);}await writeOutput(_0x3d3050[_0x2dd5fa(0x16c)]('\x0a'),_0x4ab1df[_0x2dd5fa(0x17b)],_0x2dd5fa(0x164));}return 0x0;}}function a19_0x3168(_0x21c47a,_0x72230d){_0x21c47a=_0x21c47a-0x154;const _0x5e2346=a19_0x5e23();let _0x31683c=_0x5e2346[_0x21c47a];return _0x31683c;}export class ConnectionShowCommand extends BaseCommand{[a19_0x3dbf1c(0x176)]=a19_0x3dbf1c(0x168);[a19_0x3dbf1c(0x163)]=a19_0x3dbf1c(0x171);[a19_0x3dbf1c(0x157)](_0x3b773c){const _0x10c35d=a19_0x3dbf1c,{args:_0x2830d3}=_0x3b773c;if(!_0x2830d3[0x0])return _0x10c35d(0x156);return undefined;}async[a19_0x3dbf1c(0x170)](_0x1d0bee){const _0x5ba3c2=a19_0x3dbf1c,{options:_0x5f38ca,args:_0x37a2a6,tdx:_0xa067da}=_0x1d0bee,_0x3ad7ee=_0x37a2a6[0x0];_0x5f38ca[_0x5ba3c2(0x165)]&&(console[_0x5ba3c2(0x16f)](_0x5ba3c2(0x16e)+_0x5f38ca[_0x5ba3c2(0x160)]),console[_0x5ba3c2(0x16f)](_0x5ba3c2(0x15b)+_0x3ad7ee));const _0x3f70e5=await withSpinner(_0x5ba3c2(0x169)+_0x3ad7ee+_0x5ba3c2(0x181),()=>_0xa067da[_0x5ba3c2(0x17f)][_0x5ba3c2(0x182)](_0x3ad7ee),{'verbose':_0x5f38ca['verbose']}),_0x218ead=_0x3f70e5[_0x5ba3c2(0x173)];return console[_0x5ba3c2(0x16f)]('✔\x20Found\x20connection:\x20'+_0x218ead[_0x5ba3c2(0x176)]),await handleSingleObjectOutput(_0x218ead,_0x5f38ca),0x0;}}
@@ -1 +1 @@
1
- function a20_0x2f0e(){const _0x2e3fc5=['Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.','\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','896936lWuWpP','Error:\x20','2dWawnN','Show\x20current\x20resolved\x20context','session','yellow','error','display','12JkSWjt','697249bwEECE','toString','message','Session\x20context\x20cleared\x20(session:\x20','name','warn','description','201209ySohPL','656202sgFDDm','1705705yaJUeP','564723TpOLXl','700688UDdojz','log','\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a','execute'];a20_0x2f0e=function(){return _0x2e3fc5;};return a20_0x2f0e();}const a20_0x11eb03=a20_0x328c;(function(_0x42a15c,_0x5289db){const _0x356208=a20_0x328c,_0x35bcdf=_0x42a15c();while(!![]){try{const _0x360d94=parseInt(_0x356208(0x1d3))/0x1*(parseInt(_0x356208(0x1c5))/0x2)+-parseInt(_0x356208(0x1d4))/0x3+parseInt(_0x356208(0x1c3))/0x4+-parseInt(_0x356208(0x1d5))/0x5+-parseInt(_0x356208(0x1cb))/0x6*(-parseInt(_0x356208(0x1cc))/0x7)+parseInt(_0x356208(0x1d7))/0x8+parseInt(_0x356208(0x1d6))/0x9;if(_0x360d94===_0x5289db)break;else _0x35bcdf['push'](_0x35bcdf['shift']());}catch(_0x1fa8c8){_0x35bcdf['push'](_0x35bcdf['shift']());}}}(a20_0x2f0e,0x3484b));import{BaseCommand}from'./command.js';function a20_0x328c(_0x572348,_0x13f305){_0x572348=_0x572348-0x1c1;const _0x2f0e46=a20_0x2f0e();let _0x328c02=_0x2f0e46[_0x572348];return _0x328c02;}import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a20_0x5a7dd3 from'chalk';export class ContextCommand extends BaseCommand{[a20_0x11eb03(0x1d0)]='context';[a20_0x11eb03(0x1d2)]=a20_0x11eb03(0x1c6);async[a20_0x11eb03(0x1da)](_0x7f966b){const _0x3bf5c0=a20_0x11eb03,{options:_0x1e425f}=_0x7f966b,_0x5f9291=_0x1e425f['debug'],_0xb2719e=_0x1e425f['clear'];console[_0x3bf5c0(0x1d1)](a20_0x5a7dd3[_0x3bf5c0(0x1c8)](_0x3bf5c0(0x1c1))),console[_0x3bf5c0(0x1d1)](a20_0x5a7dd3[_0x3bf5c0(0x1c8)](_0x3bf5c0(0x1c2))),console['warn'](a20_0x5a7dd3[_0x3bf5c0(0x1c8)](_0x3bf5c0(0x1d9))),cleanExpiredSessions();try{if(_0xb2719e){clearSessionContext(_0x1e425f[_0x3bf5c0(0x1c7)]);const _0x5883f6=_0x1e425f[_0x3bf5c0(0x1c7)]||getCurrentSessionPID()[_0x3bf5c0(0x1cd)]();return console[_0x3bf5c0(0x1d8)](_0x3bf5c0(0x1cf)+_0x5883f6+')'),0x0;}const _0x276fdc=new GlobalContext(_0x1e425f);return _0x5f9291?_0x276fdc['displayWithSources']():_0x276fdc[_0x3bf5c0(0x1ca)](),0x0;}catch(_0x4f97aa){return _0x4f97aa instanceof Error&&console[_0x3bf5c0(0x1c9)](_0x3bf5c0(0x1c4)+_0x4f97aa[_0x3bf5c0(0x1ce)]),0x1;}}}
1
+ const a20_0x1402d6=a20_0x1282;function a20_0x1282(_0x1d0189,_0x9c177c){_0x1d0189=_0x1d0189-0x1a2;const _0x2c4148=a20_0x2c41();let _0x12820c=_0x2c4148[_0x1d0189];return _0x12820c;}(function(_0x47ba94,_0x20e52f){const _0x40f370=a20_0x1282,_0x4301d0=_0x47ba94();while(!![]){try{const _0xc322f9=-parseInt(_0x40f370(0x1bd))/0x1+-parseInt(_0x40f370(0x1aa))/0x2*(-parseInt(_0x40f370(0x1a8))/0x3)+parseInt(_0x40f370(0x1ad))/0x4+parseInt(_0x40f370(0x1b0))/0x5*(-parseInt(_0x40f370(0x1af))/0x6)+parseInt(_0x40f370(0x1ba))/0x7*(-parseInt(_0x40f370(0x1b4))/0x8)+parseInt(_0x40f370(0x1a6))/0x9*(parseInt(_0x40f370(0x1b7))/0xa)+-parseInt(_0x40f370(0x1b5))/0xb;if(_0xc322f9===_0x20e52f)break;else _0x4301d0['push'](_0x4301d0['shift']());}catch(_0x5741f9){_0x4301d0['push'](_0x4301d0['shift']());}}}(a20_0x2c41,0xf379f));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a20_0x19e9eb from'chalk';function a20_0x2c41(){const _0x3603ec=['3794Uflxkh','toString','session','271781QdZpcK','Error:\x20','message','displayWithSources','log','36gIlDaV','\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','819114aWlzJB','yellow','4edqPbe','execute','display','7904516JLgSKs','debug','1050066KKAzKt','25JFfpbf','warn','Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.','name','16832zlhIQW','8189698caHcGv','clear','3766990ZFXdpV','\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a','context'];a20_0x2c41=function(){return _0x3603ec;};return a20_0x2c41();}export class ContextCommand extends BaseCommand{[a20_0x1402d6(0x1b3)]=a20_0x1402d6(0x1b9);['description']='Show\x20current\x20resolved\x20context';async[a20_0x1402d6(0x1ab)](_0x4fcb5a){const _0xec9c60=a20_0x1402d6,{options:_0x5880ef}=_0x4fcb5a,_0x3155fc=_0x5880ef[_0xec9c60(0x1ae)],_0x548e20=_0x5880ef[_0xec9c60(0x1b6)];console[_0xec9c60(0x1b1)](a20_0x19e9eb[_0xec9c60(0x1a9)](_0xec9c60(0x1b2))),console['warn'](a20_0x19e9eb[_0xec9c60(0x1a9)](_0xec9c60(0x1a7))),console[_0xec9c60(0x1b1)](a20_0x19e9eb['yellow'](_0xec9c60(0x1b8))),cleanExpiredSessions();try{if(_0x548e20){clearSessionContext(_0x5880ef[_0xec9c60(0x1bc)]);const _0x59e8e3=_0x5880ef[_0xec9c60(0x1bc)]||getCurrentSessionPID()[_0xec9c60(0x1bb)]();return console[_0xec9c60(0x1a5)]('Session\x20context\x20cleared\x20(session:\x20'+_0x59e8e3+')'),0x0;}const _0x27d4c8=new GlobalContext(_0x5880ef);return _0x3155fc?_0x27d4c8[_0xec9c60(0x1a4)]():_0x27d4c8[_0xec9c60(0x1ac)](),0x0;}catch(_0x3789d0){return _0x3789d0 instanceof Error&&console['error'](_0xec9c60(0x1a2)+_0x3789d0[_0xec9c60(0x1a3)]),0x1;}}}
@@ -1 +1 @@
1
- const a21_0x35779a=a21_0x3e5c;(function(_0xf192ae,_0x36a33f){const _0x23acb1=a21_0x3e5c,_0x50b9b0=_0xf192ae();while(!![]){try{const _0x578326=parseInt(_0x23acb1(0x1a2))/0x1+parseInt(_0x23acb1(0x1af))/0x2*(-parseInt(_0x23acb1(0x1a9))/0x3)+-parseInt(_0x23acb1(0x1a0))/0x4*(parseInt(_0x23acb1(0x1a8))/0x5)+-parseInt(_0x23acb1(0x19b))/0x6+-parseInt(_0x23acb1(0x1b1))/0x7*(-parseInt(_0x23acb1(0x19d))/0x8)+parseInt(_0x23acb1(0x1a1))/0x9+parseInt(_0x23acb1(0x19a))/0xa;if(_0x578326===_0x36a33f)break;else _0x50b9b0['push'](_0x50b9b0['shift']());}catch(_0x36b89d){_0x50b9b0['push'](_0x50b9b0['shift']());}}}(a21_0x3fc8,0x36341));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a21_0x3fc8(){const _0x5e68b2=['961429mZvBKT','description','site','1258790YGODjr','430260tlXtDc','Pattern:\x20','8ThMAaB','databases','data','4CXrEBp','1054035zlKdiG','295295JxIxLZ','error','cause','message','length','execute','923060gmsdtr','591891hqMgJQ','Error:\x20','✔\x20Found\x20','\x20\x20Cause:\x20','verbose','List\x20all\x20databases','2birEPk','Site:\x20'];a21_0x3fc8=function(){return _0x5e68b2;};return a21_0x3fc8();}import{withSpinner}from'../utils/spinner.js';function a21_0x3e5c(_0x2819dc,_0x5a5012){_0x2819dc=_0x2819dc-0x19a;const _0x3fc89e=a21_0x3fc8();let _0x3e5c94=_0x3fc89e[_0x2819dc];return _0x3e5c94;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{['name']=a21_0x35779a(0x19e);[a21_0x35779a(0x1b2)]=a21_0x35779a(0x1ae);async[a21_0x35779a(0x1a7)](_0x432611){const _0x5a93f9=a21_0x35779a,{options:_0x5b56bb,args:_0x44cc57,tdx:_0x39b71b}=_0x432611,_0x57946d=_0x44cc57[0x0];try{_0x5b56bb[_0x5a93f9(0x1ad)]&&(console[_0x5a93f9(0x1a3)](_0x5a93f9(0x1b0)+_0x5b56bb[_0x5a93f9(0x1b3)]),_0x57946d&&console[_0x5a93f9(0x1a3)](_0x5a93f9(0x19c)+_0x57946d));const _0x25541b=resolveLimit(_0x5b56bb['limit'],DEFAULT_LISTING_LIMIT),_0x293c0a=await withSpinner('Listing\x20databases...',()=>_0x39b71b['query']['listDatabases'](_0x57946d,_0x25541b),{'verbose':_0x5b56bb[_0x5a93f9(0x1ad)]}),_0x3ca71c=_0x293c0a[_0x5a93f9(0x19f)];return console[_0x5a93f9(0x1a3)](_0x5a93f9(0x1ab)+_0x3ca71c[_0x5a93f9(0x1a6)]+'\x20database'+(_0x3ca71c[_0x5a93f9(0x1a6)]!==0x1?'s':'')),await handleSDKOutput(_0x3ca71c,{..._0x5b56bb,'limit':_0x25541b}),0x0;}catch(_0x45e0b3){if(_0x45e0b3 instanceof SDKError)return console[_0x5a93f9(0x1a3)](_0x5a93f9(0x1aa)+_0x45e0b3[_0x5a93f9(0x1a5)]),_0x45e0b3[_0x5a93f9(0x1a4)]&&console[_0x5a93f9(0x1a3)](_0x5a93f9(0x1ac)+_0x45e0b3[_0x5a93f9(0x1a4)]),0x1;throw _0x45e0b3;}}}
1
+ const a21_0x412482=a21_0x573f;(function(_0xc9b464,_0x16dcf4){const _0x10205b=a21_0x573f,_0x510a36=_0xc9b464();while(!![]){try{const _0x5d3056=parseInt(_0x10205b(0x184))/0x1*(parseInt(_0x10205b(0x16f))/0x2)+-parseInt(_0x10205b(0x17c))/0x3+-parseInt(_0x10205b(0x173))/0x4*(parseInt(_0x10205b(0x17f))/0x5)+parseInt(_0x10205b(0x17a))/0x6+-parseInt(_0x10205b(0x170))/0x7+-parseInt(_0x10205b(0x171))/0x8+parseInt(_0x10205b(0x176))/0x9;if(_0x5d3056===_0x16dcf4)break;else _0x510a36['push'](_0x510a36['shift']());}catch(_0x19fb88){_0x510a36['push'](_0x510a36['shift']());}}}(a21_0x398a,0xadaf0));function a21_0x573f(_0x2974cb,_0x368053){_0x2974cb=_0x2974cb-0x16b;const _0x398a57=a21_0x398a();let _0x573ff6=_0x398a57[_0x2974cb];return _0x573ff6;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a21_0x398a(){const _0x7f50d5=['listDatabases','length','error','7741086kEDSUi','description','3179076ONgPAe','Error:\x20','verbose','1113790tDFXSw','cause','Site:\x20','name','data','1531sZefOK','execute','site','\x20\x20Cause:\x20','✔\x20Found\x20','398PfIImO','8484623EBxAIA','6166544IkUqNM','query','8pSciGM','Pattern:\x20','List\x20all\x20databases','23442057airOqP'];a21_0x398a=function(){return _0x7f50d5;};return a21_0x398a();}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{[a21_0x412482(0x182)]='databases';[a21_0x412482(0x17b)]=a21_0x412482(0x175);async[a21_0x412482(0x16b)](_0x400bf0){const _0x44d563=a21_0x412482,{options:_0x73d297,args:_0x2bfa55,tdx:_0x3b184f}=_0x400bf0,_0x201d9c=_0x2bfa55[0x0];try{_0x73d297[_0x44d563(0x17e)]&&(console[_0x44d563(0x179)](_0x44d563(0x181)+_0x73d297[_0x44d563(0x16c)]),_0x201d9c&&console[_0x44d563(0x179)](_0x44d563(0x174)+_0x201d9c));const _0x2c9f4=resolveLimit(_0x73d297['limit'],DEFAULT_LISTING_LIMIT),_0x1d936c=await withSpinner('Listing\x20databases...',()=>_0x3b184f[_0x44d563(0x172)][_0x44d563(0x177)](_0x201d9c,_0x2c9f4),{'verbose':_0x73d297[_0x44d563(0x17e)]}),_0x1983cb=_0x1d936c[_0x44d563(0x183)];return console[_0x44d563(0x179)](_0x44d563(0x16e)+_0x1983cb[_0x44d563(0x178)]+'\x20database'+(_0x1983cb['length']!==0x1?'s':'')),await handleSDKOutput(_0x1983cb,{..._0x73d297,'limit':_0x2c9f4}),0x0;}catch(_0x96feed){if(_0x96feed instanceof SDKError)return console[_0x44d563(0x179)](_0x44d563(0x17d)+_0x96feed['message']),_0x96feed[_0x44d563(0x180)]&&console['error'](_0x44d563(0x16d)+_0x96feed['cause']),0x1;throw _0x96feed;}}}
@@ -1 +1 @@
1
- const a22_0x9f6c42=a22_0x2e77;(function(_0xf714e9,_0x232484){const _0x21d297=a22_0x2e77,_0x233a27=_0xf714e9();while(!![]){try{const _0x42fa55=-parseInt(_0x21d297(0x143))/0x1*(parseInt(_0x21d297(0x150))/0x2)+parseInt(_0x21d297(0x141))/0x3+-parseInt(_0x21d297(0x142))/0x4+-parseInt(_0x21d297(0x133))/0x5+-parseInt(_0x21d297(0x13b))/0x6*(-parseInt(_0x21d297(0x153))/0x7)+parseInt(_0x21d297(0x138))/0x8+-parseInt(_0x21d297(0x13a))/0x9*(parseInt(_0x21d297(0x14a))/0xa);if(_0x42fa55===_0x232484)break;else _0x233a27['push'](_0x233a27['shift']());}catch(_0x4ce8b1){_0x233a27['push'](_0x233a27['shift']());}}}(a22_0x4b6d,0x4ad2b));import{BaseCommand}from'./command.js';function a22_0x2e77(_0x5b10df,_0x1c8c2c){_0x5b10df=_0x5b10df-0x133;const _0x4b6d0b=a22_0x4b6d();let _0x2e7780=_0x4b6d0b[_0x5b10df];return _0x2e7780;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a22_0x4b6d(){const _0x492db7=['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','\x27\x20does\x20not\x20exist','816789SqOoRV','375880opOMAN','152seJXfK','Table:\x20','data','site','length','describeTable','\x20\x20Cause:\x20','20RoyquG','Error:\x20','✖\x20Table\x20not\x20found','error','\x20in\x20','Describe\x20table\x20schema','2512MbLeCv','Table\x20\x27','database','2965928yurKwC','verbose','cause','378935rFinTP','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','message','...','execute','4744248oUdWtd','Database:\x20','2798343Dgplbm','6kejbXH','table','args','name'];a22_0x4b6d=function(){return _0x492db7;};return a22_0x4b6d();}import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a22_0x9f6c42(0x13e)]='describe';['description']=a22_0x9f6c42(0x14f);async[a22_0x9f6c42(0x137)](_0x3c9542){return this['describeTable'](_0x3c9542);}async[a22_0x9f6c42(0x148)](_0x19927e){const _0x441de7=a22_0x9f6c42,{options:_0x43368b,args:_0x39edff,tdx:_0x3cfe42}=_0x19927e;let _0x126a32;try{_0x126a32=parseTableReference(_0x39edff[0x0]);const _0x1f670a=_0x43368b[_0x441de7(0x152)];!_0x126a32[_0x441de7(0x152)]&&_0x1f670a&&(_0x126a32[_0x441de7(0x152)]=_0x1f670a);const _0x3e6db1=validateTableDescribeReference(_0x126a32);if(_0x3e6db1)return console[_0x441de7(0x14d)](_0x441de7(0x14b)+_0x3e6db1),0x1;}catch(_0x4c78f9){return console[_0x441de7(0x14d)](_0x441de7(0x14b)+_0x4c78f9['message']),0x1;}const _0x27ba7e=_0x126a32[_0x441de7(0x152)],_0x205021=_0x126a32[_0x441de7(0x13c)];try{_0x43368b['verbose']&&(console[_0x441de7(0x14d)]('Site:\x20'+_0x43368b[_0x441de7(0x146)]),console[_0x441de7(0x14d)](_0x441de7(0x139)+_0x27ba7e),console[_0x441de7(0x14d)](_0x441de7(0x144)+_0x205021));const _0x3062a6=await withSpinner('Describing\x20table\x20'+_0x27ba7e+'.'+_0x205021+_0x441de7(0x136),()=>_0x3cfe42['query']['describeTable'](_0x27ba7e,_0x205021),{'verbose':_0x43368b[_0x441de7(0x154)]}),_0x556d1b=_0x3062a6[_0x441de7(0x145)];if(_0x556d1b[_0x441de7(0x147)]===0x0)return console[_0x441de7(0x14d)](_0x441de7(0x14c)),console[_0x441de7(0x14d)](_0x441de7(0x151)+_0x27ba7e+'.'+_0x205021+_0x441de7(0x140)),0x1;return console['error']('✔\x20Found\x20'+_0x556d1b[_0x441de7(0x147)]+'\x20column'+(_0x556d1b[_0x441de7(0x147)]!==0x1?'s':'')+_0x441de7(0x14e)+_0x27ba7e+'.'+_0x205021),await handleSDKOutput(_0x556d1b,_0x43368b),0x0;}catch(_0x46f0b6){if(_0x46f0b6 instanceof SDKError)return console[_0x441de7(0x14d)](_0x441de7(0x14b)+_0x46f0b6[_0x441de7(0x135)]),_0x46f0b6[_0x441de7(0x155)]&&console[_0x441de7(0x14d)](_0x441de7(0x149)+_0x46f0b6[_0x441de7(0x155)]),0x1;throw _0x46f0b6;}}['validate'](_0x3171e9){const _0x23c5dc=a22_0x9f6c42;if(_0x3171e9[_0x23c5dc(0x13d)]['length']===0x0)return _0x23c5dc(0x13f);if(_0x3171e9[_0x23c5dc(0x13d)][_0x23c5dc(0x147)]>0x1)return _0x23c5dc(0x134);return undefined;}}
1
+ const a22_0x188e85=a22_0x1b69;(function(_0x50e97b,_0x27c439){const _0x4be144=a22_0x1b69,_0x150065=_0x50e97b();while(!![]){try{const _0x3da205=-parseInt(_0x4be144(0x1f2))/0x1*(-parseInt(_0x4be144(0x1f4))/0x2)+parseInt(_0x4be144(0x1f0))/0x3+parseInt(_0x4be144(0x1e8))/0x4+-parseInt(_0x4be144(0x1e5))/0x5+parseInt(_0x4be144(0x1e1))/0x6*(-parseInt(_0x4be144(0x1f7))/0x7)+-parseInt(_0x4be144(0x1e4))/0x8+parseInt(_0x4be144(0x1ee))/0x9;if(_0x3da205===_0x27c439)break;else _0x150065['push'](_0x150065['shift']());}catch(_0x1c6901){_0x150065['push'](_0x150065['shift']());}}}(a22_0x513b,0x4126e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a22_0x1b69(_0x3216c4,_0x349573){_0x3216c4=_0x3216c4-0x1d8;const _0x513b1a=a22_0x513b();let _0x1b6912=_0x513b1a[_0x3216c4];return _0x1b6912;}import{handleSDKOutput}from'../utils/command-output.js';function a22_0x513b(){const _0x5b3d22=['length','1843OXdWUg','Database:\x20','2YAEcym','error','✖\x20Table\x20not\x20found','43708YvsAtQ','\x20column','cause','\x20in\x20','\x20\x20Cause:\x20','describeTable','verbose','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','\x27\x20does\x20not\x20exist','Error:\x20','Describe\x20table\x20schema','...','Table:\x20','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','174zNjzsq','description','table','3085112VVJLZb','50940BqUTjI','query','describe','1864724ETNUOs','execute','database','validate','Describing\x20table\x20','args','2053845vpuoAB','message','442608Erywmy'];a22_0x513b=function(){return _0x5b3d22;};return a22_0x513b();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{['name']=a22_0x188e85(0x1e7);[a22_0x188e85(0x1e2)]=a22_0x188e85(0x1dd);async[a22_0x188e85(0x1e9)](_0x6913b7){const _0x1215a9=a22_0x188e85;return this[_0x1215a9(0x1d8)](_0x6913b7);}async[a22_0x188e85(0x1d8)](_0x4fd70e){const _0x4d16a4=a22_0x188e85,{options:_0x1c9913,args:_0x39f834,tdx:_0x567b0d}=_0x4fd70e;let _0x5d6292;try{_0x5d6292=parseTableReference(_0x39f834[0x0]);const _0x595362=_0x1c9913[_0x4d16a4(0x1ea)];!_0x5d6292[_0x4d16a4(0x1ea)]&&_0x595362&&(_0x5d6292[_0x4d16a4(0x1ea)]=_0x595362);const _0x53375e=validateTableDescribeReference(_0x5d6292);if(_0x53375e)return console[_0x4d16a4(0x1f5)]('Error:\x20'+_0x53375e),0x1;}catch(_0x37035e){return console[_0x4d16a4(0x1f5)]('Error:\x20'+_0x37035e[_0x4d16a4(0x1ef)]),0x1;}const _0x4363d5=_0x5d6292['database'],_0x1410d0=_0x5d6292[_0x4d16a4(0x1e3)];try{_0x1c9913[_0x4d16a4(0x1d9)]&&(console[_0x4d16a4(0x1f5)]('Site:\x20'+_0x1c9913['site']),console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1f3)+_0x4363d5),console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1df)+_0x1410d0));const _0x1811ed=await withSpinner(_0x4d16a4(0x1ec)+_0x4363d5+'.'+_0x1410d0+_0x4d16a4(0x1de),()=>_0x567b0d[_0x4d16a4(0x1e6)][_0x4d16a4(0x1d8)](_0x4363d5,_0x1410d0),{'verbose':_0x1c9913[_0x4d16a4(0x1d9)]}),_0x1bb124=_0x1811ed['data'];if(_0x1bb124[_0x4d16a4(0x1f1)]===0x0)return console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1f6)),console[_0x4d16a4(0x1f5)]('Table\x20\x27'+_0x4363d5+'.'+_0x1410d0+_0x4d16a4(0x1db)),0x1;return console[_0x4d16a4(0x1f5)]('✔\x20Found\x20'+_0x1bb124[_0x4d16a4(0x1f1)]+_0x4d16a4(0x1f8)+(_0x1bb124[_0x4d16a4(0x1f1)]!==0x1?'s':'')+_0x4d16a4(0x1fa)+_0x4363d5+'.'+_0x1410d0),await handleSDKOutput(_0x1bb124,_0x1c9913),0x0;}catch(_0x44e39a){if(_0x44e39a instanceof SDKError)return console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1dc)+_0x44e39a[_0x4d16a4(0x1ef)]),_0x44e39a[_0x4d16a4(0x1f9)]&&console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1fb)+_0x44e39a[_0x4d16a4(0x1f9)]),0x1;throw _0x44e39a;}}[a22_0x188e85(0x1eb)](_0x338761){const _0x4c6a7d=a22_0x188e85;if(_0x338761[_0x4c6a7d(0x1ed)][_0x4c6a7d(0x1f1)]===0x0)return _0x4c6a7d(0x1da);if(_0x338761['args'][_0x4c6a7d(0x1f1)]>0x1)return _0x4c6a7d(0x1e0);return undefined;}}