@treasuredata/tdx 0.7.0 → 0.7.2

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 (104) 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/context-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/job-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/llm-proxy.js +1 -1
  28. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  29. package/dist/commands/parent-segment-command.js +1 -1
  30. package/dist/commands/parent-segment-command.js.map +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-pwd-command.js +1 -1
  37. package/dist/commands/segment-update-command.js +1 -1
  38. package/dist/commands/segment-use-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/credential-cache.js +1 -1
  47. package/dist/core/global-context.js +1 -1
  48. package/dist/core/keychain.js +1 -1
  49. package/dist/core/profile.js +1 -1
  50. package/dist/core/project-config.js +1 -1
  51. package/dist/core/session.js +1 -1
  52. package/dist/index.js +1 -1
  53. package/dist/proxy/anthropic-adapter.js +1 -1
  54. package/dist/proxy/claude-usage-tracker.js +1 -1
  55. package/dist/proxy/context-signature.js +1 -1
  56. package/dist/proxy/conversation-utils.js +1 -1
  57. package/dist/proxy/server.js +1 -1
  58. package/dist/proxy/session-cache.js +1 -1
  59. package/dist/sdk/api.js +1 -1
  60. package/dist/sdk/engage.js +1 -1
  61. package/dist/sdk/errors.js +1 -1
  62. package/dist/sdk/index.js +1 -1
  63. package/dist/sdk/job.js +1 -1
  64. package/dist/sdk/llm.js +1 -1
  65. package/dist/sdk/query.js +1 -1
  66. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  67. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  68. package/dist/sdk/segment.js +1 -1
  69. package/dist/sdk/workflow.js +1 -1
  70. package/dist/types/endpoints.d.ts +12 -0
  71. package/dist/types/endpoints.d.ts.map +1 -1
  72. package/dist/types/endpoints.js +1 -1
  73. package/dist/types/endpoints.js.map +1 -1
  74. package/dist/types/index.js +1 -1
  75. package/dist/utils/agent-ref-parser.js +1 -1
  76. package/dist/utils/chat-cache.js +1 -1
  77. package/dist/utils/colors.js +1 -1
  78. package/dist/utils/command-output.js +1 -1
  79. package/dist/utils/constants.js +1 -1
  80. package/dist/utils/diff.js +1 -1
  81. package/dist/utils/fields-display.js +1 -1
  82. package/dist/utils/file-permissions.js +1 -1
  83. package/dist/utils/format-detector.js +1 -1
  84. package/dist/utils/formatters.js +1 -1
  85. package/dist/utils/json-loader.js +1 -1
  86. package/dist/utils/llm-backup-utils.js +1 -1
  87. package/dist/utils/model-aliases.js +1 -1
  88. package/dist/utils/model-factors.js +1 -1
  89. package/dist/utils/option-validation.js +1 -1
  90. package/dist/utils/port.js +1 -1
  91. package/dist/utils/process.js +1 -1
  92. package/dist/utils/prompt.js +1 -1
  93. package/dist/utils/segment-path-parser.js +1 -1
  94. package/dist/utils/segment-ref-parser.js +1 -1
  95. package/dist/utils/spinner.js +1 -1
  96. package/dist/utils/sql-parser.js +1 -1
  97. package/dist/utils/sse-parser.js +1 -1
  98. package/dist/utils/string-utils.js +1 -1
  99. package/dist/utils/table-ref-parser.js +1 -1
  100. package/dist/utils/tdx-logger.js +1 -1
  101. package/dist/utils/tree-formatter.js +1 -1
  102. package/dist/utils/version-check.js +1 -1
  103. package/dist/utils/workflow-utils.js +1 -1
  104. package/package.json +4 -2
@@ -1 +1 @@
1
- function a12_0x5e2b(_0x15f13a,_0x4ce169){const _0x4667a1=a12_0x4667();return a12_0x5e2b=function(_0x5e2bd4,_0x4e4e8f){_0x5e2bd4=_0x5e2bd4-0x7f;let _0x10cb2a=_0x4667a1[_0x5e2bd4];return _0x10cb2a;},a12_0x5e2b(_0x15f13a,_0x4ce169);}const a12_0x26711c=a12_0x5e2b;(function(_0x144eee,_0x2d45ed){const _0x4ecdbd=a12_0x5e2b,_0x567d02=_0x144eee();while(!![]){try{const _0x84020e=-parseInt(_0x4ecdbd(0x91))/0x1*(parseInt(_0x4ecdbd(0xbc))/0x2)+-parseInt(_0x4ecdbd(0x89))/0x3+parseInt(_0x4ecdbd(0x88))/0x4*(parseInt(_0x4ecdbd(0x96))/0x5)+parseInt(_0x4ecdbd(0x9d))/0x6+parseInt(_0x4ecdbd(0xae))/0x7+-parseInt(_0x4ecdbd(0xbb))/0x8*(-parseInt(_0x4ecdbd(0xa9))/0x9)+-parseInt(_0x4ecdbd(0x8a))/0xa*(-parseInt(_0x4ecdbd(0xb6))/0xb);if(_0x84020e===_0x2d45ed)break;else _0x567d02['push'](_0x567d02['shift']());}catch(_0x133fd2){_0x567d02['push'](_0x567d02['shift']());}}}(a12_0x4667,0x38032));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a12_0x4667(){const _0x22ffd4=['Invalid\x20header\x20format:\x20\x22','.\x20Valid\x20methods:\x20','verbose','GET','header','PUT','type','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Invalid\x20HTTP\x20method:\x20','api','workflow','217988yscPte','394611oZnkTv','98390zbppQq','isArray','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','readBodyFromFile','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','noColor','substring','38521neynMw','data','\x22.\x20','toLowerCase','trim','5jGGNfl','headers','log','Error:\x20','error','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','POST','893658ybkOtv','startsWith','Endpoint\x20must\x20start\x20with\x20/:\x20','join','length','PATCH','Invalid\x20API\x20type:\x20','indexOf','entries','.\x20Valid\x20types:\x20','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','authorization','8757rgRAbB','output','keys','\x0aStack\x20trace:\x0a','request','2960055jzIphX','message','x-trino-user','<\x20HTTP/1.1\x20','DELETE','stack','llm','execute','77JFwNgR','file','toUpperCase','cookie','method','736nQXhod','22rBhWsQ','includes'];a12_0x4667=function(){return _0x22ffd4;};return a12_0x4667();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a12_0x26711c(0xa8),'proxy-authorization',a12_0x26711c(0xb9),'set-cookie','set-cookie2','x-xsrf-token','x-auth-token',a12_0x26711c(0xb0)]);function isSensitiveHeader(_0x2fc9ba){const _0x538d81=a12_0x26711c;return SENSITIVE_HEADERS['has'](_0x2fc9ba[_0x538d81(0x94)]());}function parseHeader(_0x2134da){const _0x379118=a12_0x26711c,_0x26f4ce=_0x2134da[_0x379118(0xa4)](':');if(_0x26f4ce===-0x1)throw new Error(_0x379118(0xbe)+_0x2134da+_0x379118(0x93)+_0x379118(0x9b));const _0x223c25=_0x2134da[_0x379118(0x90)](0x0,_0x26f4ce)['trim'](),_0x663765=_0x2134da['substring'](_0x26f4ce+0x1)[_0x379118(0x95)]();if(!_0x223c25)throw new Error(_0x379118(0xa7)+_0x2134da+'\x22');return[_0x223c25,_0x663765];}export class ApiCommand extends BaseCommand{['name']=a12_0x26711c(0x86);['description']=a12_0x26711c(0x84);['validate'](_0x1195dd){const _0x6adebc=a12_0x26711c,{args:_0x3374c1,options:_0x115cd8}=_0x1195dd,_0x7fc534=_0x115cd8;if(_0x3374c1[_0x6adebc(0xa1)]===0x0)return _0x6adebc(0x8c);const _0x259ae0=_0x3374c1[0x0];if(!_0x259ae0[_0x6adebc(0x9e)]('/'))return _0x6adebc(0x9f)+_0x259ae0;const _0x3a15a8=_0x7fc534['data'],_0x4312c5=_0x7fc534[_0x6adebc(0xb7)];if(_0x3a15a8&&_0x4312c5)return _0x6adebc(0x8e);const _0x4d7812=_0x7fc534[_0x6adebc(0xba)]||_0x6adebc(0x80),_0x50aca3=[_0x6adebc(0x80),_0x6adebc(0x9c),_0x6adebc(0x82),_0x6adebc(0xb2),_0x6adebc(0xa2)];if(!_0x50aca3['includes'](_0x4d7812[_0x6adebc(0xb8)]()))return _0x6adebc(0x85)+_0x4d7812+_0x6adebc(0xbf)+_0x50aca3[_0x6adebc(0xa0)](',\x20');const _0x37eef5=_0x7fc534[_0x6adebc(0x83)]||'td',_0x3f194a=['td','cdp',_0x6adebc(0x87),'trino',_0x6adebc(0xb4)];if(!_0x3f194a[_0x6adebc(0xbd)](_0x37eef5))return _0x6adebc(0xa3)+_0x37eef5+_0x6adebc(0xa6)+_0x3f194a['join'](',\x20');return undefined;}async[a12_0x26711c(0xb5)](_0x2fd647){const _0x21ccda=a12_0x26711c,{options:_0x4e2e7f,args:_0x4cd242,tdx:_0x339ae9}=_0x2fd647,_0xc42a95=_0x4e2e7f,_0xb4a746=_0x4cd242[0x0],_0x3943cd=(_0xc42a95[_0x21ccda(0xba)]||_0x21ccda(0x80))[_0x21ccda(0xb8)](),_0x5b4b6c=_0xc42a95[_0x21ccda(0x92)],_0x46a4bc=_0xc42a95[_0x21ccda(0xb7)],_0x147b8a=_0xc42a95[_0x21ccda(0x81)],_0x41185e=_0xc42a95['type']||'td';try{const _0x227634={};if(_0x147b8a){const _0x49fb36=Array[_0x21ccda(0x8b)](_0x147b8a)?_0x147b8a:[_0x147b8a];for(const _0x56ac63 of _0x49fb36){const [_0x307368,_0x5ac18b]=parseHeader(_0x56ac63);_0x227634[_0x307368]=_0x5ac18b;}}let _0x43f74a;if(_0x5b4b6c)_0x43f74a=_0x5b4b6c;else{if(_0x46a4bc)try{_0x43f74a=RawAPI[_0x21ccda(0x8d)](_0x46a4bc);}catch(_0x4a447b){return console[_0x21ccda(0x9a)](_0x21ccda(0x99)+(_0x4a447b instanceof Error?_0x4a447b[_0x21ccda(0xaf)]:String(_0x4a447b))),0x1;}}const _0x275f90={'method':_0x3943cd,'apiType':_0x41185e,'includeHeaders':_0x4e2e7f[_0x21ccda(0x7f)]};_0x43f74a&&(_0x275f90['body']=_0x43f74a);Object[_0x21ccda(0xab)](_0x227634)[_0x21ccda(0xa1)]>0x0&&(_0x275f90[_0x21ccda(0x97)]=_0x227634);if(_0x4e2e7f[_0x21ccda(0x7f)]){const _0x1f7946=resolveSite(_0x4e2e7f['site']),_0x32ffa0=getEndpoint(_0x1f7946,_0x41185e),_0x29c294=''+_0x32ffa0+_0xb4a746;console[_0x21ccda(0x9a)]('>\x20'+_0x3943cd+'\x20'+_0x29c294);const _0x46096c=getAuthHeaders(_0x1f7946),_0x345b0f={..._0x46096c,..._0x227634};for(const [_0x54a061,_0x27a128]of Object[_0x21ccda(0xa5)](_0x345b0f)){!isSensitiveHeader(_0x54a061)&&console[_0x21ccda(0x9a)]('>\x20'+_0x54a061+':\x20'+_0x27a128);}_0x43f74a&&console[_0x21ccda(0x9a)]('>'),console[_0x21ccda(0x9a)]('');}const _0x423973=await _0x339ae9[_0x21ccda(0x86)][_0x21ccda(0xad)](_0xb4a746,_0x275f90);if(_0x4e2e7f['verbose']&&_0x423973[_0x21ccda(0x97)]){console['error'](_0x21ccda(0xb1)+_0x423973['status']);for(const [_0x46789b,_0x19d260]of Object[_0x21ccda(0xa5)](_0x423973['headers'])){!isSensitiveHeader(_0x46789b)&&console['error']('<\x20'+_0x46789b+':\x20'+_0x19d260);}console[_0x21ccda(0x9a)]('');}const _0x2cca5b=Boolean(_0x4e2e7f['output']),_0x1212c9={'color':_0x4e2e7f['color'],'noColor':_0x4e2e7f[_0x21ccda(0x8f)]||_0x2cca5b&&!_0x4e2e7f['color']},_0x2d3da1=colorizeJSON(_0x423973[_0x21ccda(0x92)],_0x1212c9);return _0x4e2e7f['output']?(writeFileSync(_0x4e2e7f[_0x21ccda(0xaa)],_0x2d3da1),console[_0x21ccda(0x9a)]('Results\x20saved\x20to\x20'+_0x4e2e7f[_0x21ccda(0xaa)])):console[_0x21ccda(0x98)](_0x2d3da1),0x0;}catch(_0x40cbc9){return _0x40cbc9 instanceof Error?(console[_0x21ccda(0x9a)]('Error:\x20'+_0x40cbc9[_0x21ccda(0xaf)]),_0x4e2e7f[_0x21ccda(0x7f)]&&_0x40cbc9[_0x21ccda(0xb3)]&&console[_0x21ccda(0x9a)](_0x21ccda(0xac)+_0x40cbc9[_0x21ccda(0xb3)])):console['error'](_0x21ccda(0x99)+String(_0x40cbc9)),0x1;}}}
1
+ const a12_0x2115f3=a12_0x5529;function a12_0x5529(_0x392d00,_0x1a5f35){const _0xc956b6=a12_0xc956();return a12_0x5529=function(_0x5529a1,_0x5a48b8){_0x5529a1=_0x5529a1-0xb4;let _0x3d4aea=_0xc956b6[_0x5529a1];return _0x3d4aea;},a12_0x5529(_0x392d00,_0x1a5f35);}(function(_0x17bfa4,_0x2b9c18){const _0x3ddf90=a12_0x5529,_0x4499d8=_0x17bfa4();while(!![]){try{const _0x15da0e=-parseInt(_0x3ddf90(0xc1))/0x1+parseInt(_0x3ddf90(0xe7))/0x2+parseInt(_0x3ddf90(0xc4))/0x3+-parseInt(_0x3ddf90(0xb7))/0x4*(-parseInt(_0x3ddf90(0xd5))/0x5)+parseInt(_0x3ddf90(0xe5))/0x6*(parseInt(_0x3ddf90(0xbb))/0x7)+-parseInt(_0x3ddf90(0xd3))/0x8*(parseInt(_0x3ddf90(0xe4))/0x9)+-parseInt(_0x3ddf90(0xf5))/0xa*(parseInt(_0x3ddf90(0xc0))/0xb);if(_0x15da0e===_0x2b9c18)break;else _0x4499d8['push'](_0x4499d8['shift']());}catch(_0x1043e9){_0x4499d8['push'](_0x4499d8['shift']());}}}(a12_0xc956,0x954a8));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a12_0xc956(){const _0x4b67b4=['set-cookie','136XWptxF','length','set-cookie2','x-xsrf-token','33929AkGGrQ','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','request','verbose','proxy-authorization','11xeccHc','800102eMMkrv','Invalid\x20API\x20type:\x20','trim','3273753VcgmVM','Invalid\x20HTTP\x20method:\x20','error','substring','.\x20Valid\x20types:\x20','validate','toLowerCase','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','includes','color','trino','x-trino-user','status','authorization','body','11368dnUDYS','noColor','12150XATerb','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','toUpperCase','has','api','type','Error:\x20','entries','PATCH','llm','startsWith','<\x20HTTP/1.1\x20','execute','Invalid\x20header\x20format:\x20\x22','\x22.\x20','4563BRpyCx','1464CBdlPi','join','343014HhSEjL','PUT','file','header','site','headers','stack','cdp','message','DELETE','name','method','Results\x20saved\x20to\x20','Endpoint\x20must\x20start\x20with\x20/:\x20','3960010eyYnlg','GET','data','output','POST'];a12_0xc956=function(){return _0x4b67b4;};return a12_0xc956();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a12_0x2115f3(0xd1),a12_0x2115f3(0xbf),'cookie',a12_0x2115f3(0xb6),a12_0x2115f3(0xb9),a12_0x2115f3(0xba),'x-auth-token',a12_0x2115f3(0xcf)]);function isSensitiveHeader(_0x2ec897){const _0x23811f=a12_0x2115f3;return SENSITIVE_HEADERS[_0x23811f(0xd8)](_0x2ec897[_0x23811f(0xca)]());}function parseHeader(_0x396cc9){const _0x2ddb2c=a12_0x2115f3,_0x4dc510=_0x396cc9['indexOf'](':');if(_0x4dc510===-0x1)throw new Error(_0x2ddb2c(0xe2)+_0x396cc9+_0x2ddb2c(0xe3)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x2f71ee=_0x396cc9[_0x2ddb2c(0xc7)](0x0,_0x4dc510)[_0x2ddb2c(0xc3)](),_0xa86953=_0x396cc9[_0x2ddb2c(0xc7)](_0x4dc510+0x1)[_0x2ddb2c(0xc3)]();if(!_0x2f71ee)throw new Error(_0x2ddb2c(0xd6)+_0x396cc9+'\x22');return[_0x2f71ee,_0xa86953];}export class ApiCommand extends BaseCommand{[a12_0x2115f3(0xf1)]=a12_0x2115f3(0xd9);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a12_0x2115f3(0xc9)](_0x1b0e7d){const _0x3b6dab=a12_0x2115f3,{args:_0xc4d1d2,options:_0x16b4f4}=_0x1b0e7d,_0x266077=_0x16b4f4;if(_0xc4d1d2[_0x3b6dab(0xb8)]===0x0)return _0x3b6dab(0xbc);const _0x2ee4a5=_0xc4d1d2[0x0];if(!_0x2ee4a5[_0x3b6dab(0xdf)]('/'))return _0x3b6dab(0xf4)+_0x2ee4a5;const _0x59f4f3=_0x266077[_0x3b6dab(0xf7)],_0x11f423=_0x266077['file'];if(_0x59f4f3&&_0x11f423)return _0x3b6dab(0xcb);const _0x2eda16=_0x266077[_0x3b6dab(0xf2)]||_0x3b6dab(0xf6),_0x4e9fa2=[_0x3b6dab(0xf6),_0x3b6dab(0xb5),_0x3b6dab(0xe8),_0x3b6dab(0xf0),_0x3b6dab(0xdd)];if(!_0x4e9fa2[_0x3b6dab(0xcc)](_0x2eda16['toUpperCase']()))return _0x3b6dab(0xc5)+_0x2eda16+'.\x20Valid\x20methods:\x20'+_0x4e9fa2[_0x3b6dab(0xe6)](',\x20');const _0x5a4745=_0x266077[_0x3b6dab(0xda)]||'td',_0x5b00e0=['td',_0x3b6dab(0xee),'workflow',_0x3b6dab(0xce),_0x3b6dab(0xde)];if(!_0x5b00e0[_0x3b6dab(0xcc)](_0x5a4745))return _0x3b6dab(0xc2)+_0x5a4745+_0x3b6dab(0xc8)+_0x5b00e0[_0x3b6dab(0xe6)](',\x20');return undefined;}async[a12_0x2115f3(0xe1)](_0x30c7c2){const _0x3deca4=a12_0x2115f3,{options:_0x10e5bc,args:_0x2b1086,tdx:_0x3b1d45}=_0x30c7c2,_0xe0b7bf=_0x10e5bc,_0x5b228b=_0x2b1086[0x0],_0x5ba96d=(_0xe0b7bf[_0x3deca4(0xf2)]||'GET')[_0x3deca4(0xd7)](),_0x1230a6=_0xe0b7bf[_0x3deca4(0xf7)],_0x50e508=_0xe0b7bf[_0x3deca4(0xe9)],_0x274ac2=_0xe0b7bf[_0x3deca4(0xea)],_0x59954d=_0xe0b7bf[_0x3deca4(0xda)]||'td';try{const _0x3a05f1={};if(_0x274ac2){const _0x1dce95=Array['isArray'](_0x274ac2)?_0x274ac2:[_0x274ac2];for(const _0x2662fa of _0x1dce95){const [_0x38494e,_0x5cca51]=parseHeader(_0x2662fa);_0x3a05f1[_0x38494e]=_0x5cca51;}}let _0x115cc5;if(_0x1230a6)_0x115cc5=_0x1230a6;else{if(_0x50e508)try{_0x115cc5=RawAPI['readBodyFromFile'](_0x50e508);}catch(_0x245a29){return console[_0x3deca4(0xc6)]('Error:\x20'+(_0x245a29 instanceof Error?_0x245a29['message']:String(_0x245a29))),0x1;}}const _0x157be0={'method':_0x5ba96d,'apiType':_0x59954d,'includeHeaders':_0x10e5bc['verbose']};_0x115cc5&&(_0x157be0[_0x3deca4(0xd2)]=_0x115cc5);Object['keys'](_0x3a05f1)[_0x3deca4(0xb8)]>0x0&&(_0x157be0[_0x3deca4(0xec)]=_0x3a05f1);if(_0x10e5bc['verbose']){const _0x127ba9=resolveSite(_0x10e5bc[_0x3deca4(0xeb)]),_0x4998e2=getEndpoint(_0x127ba9,_0x59954d),_0x2fc172=''+_0x4998e2+_0x5b228b;console['error']('>\x20'+_0x5ba96d+'\x20'+_0x2fc172);const _0x2bd194=getAuthHeaders(_0x127ba9),_0x5c16e9={..._0x2bd194,..._0x3a05f1};for(const [_0xb959d4,_0x2a2e53]of Object[_0x3deca4(0xdc)](_0x5c16e9)){!isSensitiveHeader(_0xb959d4)&&console[_0x3deca4(0xc6)]('>\x20'+_0xb959d4+':\x20'+_0x2a2e53);}_0x115cc5&&console[_0x3deca4(0xc6)]('>'),console[_0x3deca4(0xc6)]('');}const _0x331a06=await _0x3b1d45[_0x3deca4(0xd9)][_0x3deca4(0xbd)](_0x5b228b,_0x157be0);if(_0x10e5bc[_0x3deca4(0xbe)]&&_0x331a06[_0x3deca4(0xec)]){console[_0x3deca4(0xc6)](_0x3deca4(0xe0)+_0x331a06[_0x3deca4(0xd0)]);for(const [_0x543176,_0x568b26]of Object[_0x3deca4(0xdc)](_0x331a06[_0x3deca4(0xec)])){!isSensitiveHeader(_0x543176)&&console[_0x3deca4(0xc6)]('<\x20'+_0x543176+':\x20'+_0x568b26);}console[_0x3deca4(0xc6)]('');}const _0x5698ff=Boolean(_0x10e5bc[_0x3deca4(0xb4)]),_0x523de7={'color':_0x10e5bc['color'],'noColor':_0x10e5bc[_0x3deca4(0xd4)]||_0x5698ff&&!_0x10e5bc[_0x3deca4(0xcd)]},_0x123c59=colorizeJSON(_0x331a06[_0x3deca4(0xf7)],_0x523de7);return _0x10e5bc['output']?(writeFileSync(_0x10e5bc[_0x3deca4(0xb4)],_0x123c59),console['error'](_0x3deca4(0xf3)+_0x10e5bc[_0x3deca4(0xb4)])):console['log'](_0x123c59),0x0;}catch(_0x5bb1a0){return _0x5bb1a0 instanceof Error?(console['error'](_0x3deca4(0xdb)+_0x5bb1a0[_0x3deca4(0xef)]),_0x10e5bc[_0x3deca4(0xbe)]&&_0x5bb1a0[_0x3deca4(0xed)]&&console[_0x3deca4(0xc6)]('\x0aStack\x20trace:\x0a'+_0x5bb1a0['stack'])):console[_0x3deca4(0xc6)](_0x3deca4(0xdb)+String(_0x5bb1a0)),0x1;}}}
@@ -1 +1 @@
1
- function a13_0x1358(){const _0x1ad8e0=['apiKey','You\x20can\x20find\x20your\x20API\x20key\x20at:','description','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','No\x20credential\x20found','select','Site\x20name\x20cannot\x20be\x20empty','value','✓\x20Authentication\x20successful\x0a','auth:setup','push','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','us01','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20\x20Set\x20TD_API_KEY\x20environment\x20variable\x20for\x20authentication.','first_name','profile','jp\x20\x20\x20-\x20Japan','ERROR','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','yellow','\x20\x20tdx','log','other','logLevel','Validating\x20API\x20key...','trim','No\x20API\x20key\x20found\x20in\x20keychain','status','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','tdx:\x20auth\x20setup','4969060BxRjvr','1560978WFkwrm','jobs','findIndex','1133226XYPvQG','bold','176dAZFBA','Name:\x20','✓\x20API\x20key\x20removed\x20from\x20keychain','site','\x20--profile\x20','7558ETVbvg','Enter\x20site\x20name:','text','User:\x20','error','execute','join','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','tdx\x20profile:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','filter','N/A','create','System\x20keychain\x20is\x20not\x20available','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','red','2538790htQDyS','30LNdKJQ','getUserInfo','message','name','\x0aSetup\x20cancelled','API\x20key\x20cannot\x20be\x20empty','Enter\x20your\x20TD\x20API\x20key:','Select\x20your\x20Treasure\x20Data\x20site:','12424kKEQZW','warn','ap02\x20-\x20Korea','Remove\x20API\x20key\x20from\x20system\x20keychain','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','222eNCdTS','Setting\x20up\x20authentication\x20for\x20site:\x20','length','password','5509nTZxaA','customSite','us\x20\x20\x20-\x20United\x20States','\x20for\x20profile:\x20','1210855GpaVHD','eu01','\x20(profile:\x20','last_name','email','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','auth','eu\x20\x20\x20-\x20Europe','/app/mp/ak','Setup\x20API\x20key\x20authentication\x20interactively'];a13_0x1358=function(){return _0x1ad8e0;};return a13_0x1358();}const a13_0x2c9e62=a13_0x3f03;(function(_0x5f47ef,_0x3f1c18){const _0x44b8d2=a13_0x3f03,_0x16b770=_0x5f47ef();while(!![]){try{const _0x225447=parseInt(_0x44b8d2(0x1fa))/0x1+parseInt(_0x44b8d2(0x201))/0x2*(-parseInt(_0x44b8d2(0x21f))/0x3)+parseInt(_0x44b8d2(0x1f6))/0x4+parseInt(_0x44b8d2(0x1cd))/0x5*(parseInt(_0x44b8d2(0x212))/0x6)+parseInt(_0x44b8d2(0x1c9))/0x7*(parseInt(_0x44b8d2(0x21a))/0x8)+parseInt(_0x44b8d2(0x1f7))/0x9+-parseInt(_0x44b8d2(0x211))/0xa*(parseInt(_0x44b8d2(0x1fc))/0xb);if(_0x225447===_0x3f1c18)break;else _0x16b770['push'](_0x16b770['shift']());}catch(_0x43e3f9){_0x16b770['push'](_0x16b770['shift']());}}}(a13_0x1358,0x9c521));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';function a13_0x3f03(_0x126fea,_0x475ed1){const _0x13583d=a13_0x1358();return a13_0x3f03=function(_0x3f0338,_0x571cf9){_0x3f0338=_0x3f0338-0x1c8;let _0x118f84=_0x13583d[_0x3f0338];return _0x118f84;},a13_0x3f03(_0x126fea,_0x475ed1);}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a13_0x5030f8 from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a13_0x1438cb from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a13_0x2c9e62(0x1e0);[a13_0x2c9e62(0x1d9)]=a13_0x2c9e62(0x1d6);async[a13_0x2c9e62(0x206)](_0x1daa83){const _0x2cd3aa=a13_0x2c9e62,{options:_0x39c0b5}=_0x1daa83,_0x154ac8=_0x39c0b5[_0x2cd3aa(0x1e7)];console[_0x2cd3aa(0x1ed)](a13_0x1438cb[_0x2cd3aa(0x1fb)](_0x2cd3aa(0x1f5)));const _0x58666e=_0x39c0b5[_0x2cd3aa(0x1ff)]||_0x2cd3aa(0x1e3),_0x5b29e5=[{'title':_0x2cd3aa(0x1cb),'value':_0x2cd3aa(0x1e3)},{'title':_0x2cd3aa(0x1e8),'value':'jp01'},{'title':_0x2cd3aa(0x1d4),'value':_0x2cd3aa(0x1ce)},{'title':_0x2cd3aa(0x21c),'value':'ap02'}];let _0x429efc=_0x5b29e5[_0x2cd3aa(0x1f9)](_0x13018b=>_0x13018b[_0x2cd3aa(0x1de)]===_0x58666e);_0x429efc===-0x1&&_0x58666e!==_0x2cd3aa(0x1e3)&&(_0x5b29e5['push']({'title':_0x58666e,'value':_0x58666e}),_0x429efc=_0x5b29e5[_0x2cd3aa(0x221)]-0x1);_0x5b29e5[_0x2cd3aa(0x1e1)]({'title':'Enter\x20custom\x20site','value':'other'});const _0x30ebf8=_0x154ac8?_0x2cd3aa(0x21e)+_0x154ac8+'):':_0x2cd3aa(0x219),_0x427e9b=await a13_0x5030f8({'type':_0x2cd3aa(0x1dc),'name':_0x2cd3aa(0x1ff),'message':_0x30ebf8,'choices':_0x5b29e5,'initial':_0x429efc>=0x0?_0x429efc:0x0});if(!_0x427e9b[_0x2cd3aa(0x1ff)])return console[_0x2cd3aa(0x1ed)](_0x2cd3aa(0x216)),0x1;let _0x1909fe;if(_0x427e9b[_0x2cd3aa(0x1ff)]===_0x2cd3aa(0x1ee)){const _0x2e6819=await a13_0x5030f8({'type':_0x2cd3aa(0x203),'name':'customSite','message':_0x2cd3aa(0x202),'initial':_0x2cd3aa(0x1e3),'validate':_0x1afab4=>{const _0x5bec88=_0x2cd3aa;if(!_0x1afab4||!_0x1afab4[_0x5bec88(0x1f1)]())return _0x5bec88(0x1dd);if(!/^[a-z0-9-]+$/['test'](_0x1afab4[_0x5bec88(0x1f1)]()))return _0x5bec88(0x1da);return!![];}});if(!_0x2e6819['customSite'])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x1909fe=_0x2e6819[_0x2cd3aa(0x1ca)];}else _0x1909fe=_0x427e9b['site'];const _0x16de12=resolveSite(_0x1909fe);console[_0x2cd3aa(0x1ed)](_0x2cd3aa(0x220)+_0x16de12),console[_0x2cd3aa(0x1ed)](_0x2cd3aa(0x1d8)),console['log']('\x20\x20'+getConsoleUrl(_0x16de12,_0x2cd3aa(0x1d5)));const _0x46e1c6=await a13_0x5030f8({'type':_0x2cd3aa(0x1c8),'name':_0x2cd3aa(0x1d7),'message':_0x2cd3aa(0x218),'validate':_0xe8713e=>{const _0x37f798=_0x2cd3aa;if(!_0xe8713e||!_0xe8713e['trim']())return _0x37f798(0x217);return!![];}});if(!_0x46e1c6[_0x2cd3aa(0x1d7)])return console['log'](_0x2cd3aa(0x216)),0x1;const _0x5c9954=_0x46e1c6[_0x2cd3aa(0x1d7)];console[_0x2cd3aa(0x1ed)](_0x2cd3aa(0x1f0));try{const _0x21bbf1=TDX[_0x2cd3aa(0x20d)]({'site':_0x16de12,'apiKey':_0x5c9954[_0x2cd3aa(0x1f1)](),'logLevel':_0x39c0b5[_0x2cd3aa(0x1ef)]??LogLevel[_0x2cd3aa(0x1e9)]}),_0x467f89=await _0x21bbf1[_0x2cd3aa(0x1f8)][_0x2cd3aa(0x213)]();console[_0x2cd3aa(0x1ed)](_0x2cd3aa(0x208)+_0x467f89[_0x2cd3aa(0x1d1)]+')');const _0x5942bc=await isKeychainAvailable();_0x5942bc?(await saveAPIKeyAsync(_0x5c9954[_0x2cd3aa(0x1f1)](),_0x16de12,_0x154ac8),console[_0x2cd3aa(0x1ed)](_0x2cd3aa(0x1d2)+(_0x154ac8?_0x2cd3aa(0x1cf)+_0x154ac8+')':''))):(console[_0x2cd3aa(0x21b)](a13_0x1438cb[_0x2cd3aa(0x1eb)](_0x2cd3aa(0x20a))),console[_0x2cd3aa(0x21b)](a13_0x1438cb[_0x2cd3aa(0x1eb)](_0x2cd3aa(0x1e5))));if(_0x154ac8){const _0x5efb29={'site':_0x16de12};saveProfileToUserConfig(_0x154ac8,_0x5efb29),console[_0x2cd3aa(0x1ed)]('✓\x20Profile\x20\x27'+_0x154ac8+'\x27\x20registered');}const _0x84f59f=_0x154ac8?_0x2cd3aa(0x200)+_0x154ac8:'';return console[_0x2cd3aa(0x1ed)](),console[_0x2cd3aa(0x1ed)](_0x2cd3aa(0x1f4)),console[_0x2cd3aa(0x1ed)]('\x20\x20tdx'+_0x84f59f+_0x2cd3aa(0x20f)),console['log'](_0x2cd3aa(0x1ec)+_0x84f59f+_0x2cd3aa(0x1ea)),0x0;}catch(_0x337ce3){if(_0x337ce3 instanceof HTTPClientError&&_0x337ce3[_0x2cd3aa(0x1f3)]===0x191)return printAuthError(_0x337ce3),0x1;return console[_0x2cd3aa(0x205)](a13_0x1438cb['red']('✗\x20Validation\x20failed:\x20'+(_0x337ce3 instanceof Error?_0x337ce3[_0x2cd3aa(0x214)]:String(_0x337ce3)))),console[_0x2cd3aa(0x205)](_0x2cd3aa(0x1e4)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a13_0x2c9e62(0x215)]=a13_0x2c9e62(0x1d3);['description']=a13_0x2c9e62(0x1e2);async[a13_0x2c9e62(0x206)](_0x27a901){const _0x357036=a13_0x2c9e62,{options:_0x285ced,tdx:_0x19a31a}=_0x27a901,_0x48afdc=_0x285ced[_0x357036(0x1ff)],_0x2233f6=_0x285ced['profile'],_0x1d4348=_0x2233f6?_0x2233f6:_0x357036(0x20c);console[_0x357036(0x1ed)](_0x357036(0x209)+_0x1d4348+'\x20(site:\x20'+_0x48afdc+')');const _0x3b6882=await resolveAPIKeyAsync(_0x48afdc,_0x2233f6);if(_0x3b6882){const {source:_0x269bde,isDeprecated:_0x31f48e}=_0x3b6882,_0x5f0e52='Read\x20credential\x20from\x20'+_0x269bde;console['log'](_0x31f48e?a13_0x1438cb[_0x357036(0x1eb)](_0x5f0e52):_0x5f0e52);}else console[_0x357036(0x1ed)](a13_0x1438cb[_0x357036(0x1eb)](_0x357036(0x1db)));try{const _0x211865=await _0x19a31a[_0x357036(0x1f8)][_0x357036(0x213)]();return console[_0x357036(0x1ed)](a13_0x1438cb['green'](_0x357036(0x1df))),console['log'](_0x357036(0x204)+_0x211865[_0x357036(0x1d1)]),(_0x211865[_0x357036(0x1e6)]||_0x211865[_0x357036(0x1d0)])&&console['log'](_0x357036(0x1fd)+[_0x211865[_0x357036(0x1e6)],_0x211865[_0x357036(0x1d0)]][_0x357036(0x20b)](Boolean)[_0x357036(0x207)]('\x20')),0x0;}catch(_0x2f8ad2){return _0x2f8ad2 instanceof HTTPClientError&&_0x2f8ad2[_0x357036(0x1f3)]===0x191?printAuthError(_0x2f8ad2,!![],_0x2233f6):console['error'](a13_0x1438cb[_0x357036(0x210)]('✗\x20Validation\x20failed:\x20'+(_0x2f8ad2 instanceof Error?_0x2f8ad2[_0x357036(0x214)]:String(_0x2f8ad2)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a13_0x2c9e62(0x1d9)]=a13_0x2c9e62(0x21d);async[a13_0x2c9e62(0x206)](_0x1960cd){const _0x38fb91=a13_0x2c9e62,{options:_0x5c4109}=_0x1960cd,_0xdb7615=_0x5c4109[_0x38fb91(0x1e7)];console[_0x38fb91(0x1ed)](a13_0x1438cb[_0x38fb91(0x1fb)]('tdx:\x20auth\x20clear'));const _0x87c932=await isKeychainAvailable();if(!_0x87c932)return console[_0x38fb91(0x205)](a13_0x1438cb[_0x38fb91(0x210)](_0x38fb91(0x20e))),0x1;const _0x404ea2=await deleteKeychainAPIKey(_0xdb7615);return _0x404ea2?(clearCredentialCache(),console[_0x38fb91(0x1ed)](_0x38fb91(0x1fe)+(_0xdb7615?'\x20(profile:\x20'+_0xdb7615+')':'')),0x0):(console[_0x38fb91(0x1ed)](_0x38fb91(0x1f2)+(_0xdb7615?_0x38fb91(0x1cc)+_0xdb7615:'')),0x1);}}
1
+ const a13_0x2eaad2=a13_0x4467;(function(_0x3b1a09,_0x130582){const _0x6cf3c3=a13_0x4467,_0xfdc190=_0x3b1a09();while(!![]){try{const _0x266136=-parseInt(_0x6cf3c3(0xa2))/0x1+parseInt(_0x6cf3c3(0xd1))/0x2*(-parseInt(_0x6cf3c3(0xc0))/0x3)+parseInt(_0x6cf3c3(0xcf))/0x4+parseInt(_0x6cf3c3(0xb6))/0x5+-parseInt(_0x6cf3c3(0xb2))/0x6*(parseInt(_0x6cf3c3(0xa7))/0x7)+-parseInt(_0x6cf3c3(0xe5))/0x8*(parseInt(_0x6cf3c3(0xac))/0x9)+parseInt(_0x6cf3c3(0xd7))/0xa;if(_0x266136===_0x130582)break;else _0xfdc190['push'](_0xfdc190['shift']());}catch(_0x215121){_0xfdc190['push'](_0xfdc190['shift']());}}}(a13_0x3e01,0xe2410));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_0x2c2bce from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a13_0x1e3024 from'chalk';export class AuthSetupCommand extends BaseCommand{[a13_0x2eaad2(0x9d)]=a13_0x2eaad2(0xb9);[a13_0x2eaad2(0x9e)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a13_0x2eaad2(0xb8)](_0x485dfd){const _0x53fbff=a13_0x2eaad2,{options:_0x3f35fe}=_0x485dfd,_0x33a66c=_0x3f35fe[_0x53fbff(0x99)];console[_0x53fbff(0xcc)](a13_0x1e3024[_0x53fbff(0xa1)](_0x53fbff(0xeb)));const _0x5e2241=_0x3f35fe[_0x53fbff(0xea)]||'us01',_0xc305e1=[{'title':_0x53fbff(0x9a),'value':_0x53fbff(0xb3)},{'title':'jp\x20\x20\x20-\x20Japan','value':_0x53fbff(0xd6)},{'title':'eu\x20\x20\x20-\x20Europe','value':_0x53fbff(0xbc)},{'title':_0x53fbff(0xe2),'value':'ap02'}];let _0x379af8=_0xc305e1['findIndex'](_0x7593a4=>_0x7593a4[_0x53fbff(0xc9)]===_0x5e2241);_0x379af8===-0x1&&_0x5e2241!==_0x53fbff(0xb3)&&(_0xc305e1[_0x53fbff(0xe4)]({'title':_0x5e2241,'value':_0x5e2241}),_0x379af8=_0xc305e1[_0x53fbff(0xc5)]-0x1);_0xc305e1[_0x53fbff(0xe4)]({'title':'Enter\x20custom\x20site','value':'other'});const _0x5e248a=_0x33a66c?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x33a66c+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x370f91=await a13_0x2c2bce({'type':_0x53fbff(0xc6),'name':_0x53fbff(0xea),'message':_0x5e248a,'choices':_0xc305e1,'initial':_0x379af8>=0x0?_0x379af8:0x0});if(!_0x370f91['site'])return console['log'](_0x53fbff(0xe0)),0x1;let _0x45b505;if(_0x370f91['site']===_0x53fbff(0x9c)){const _0x28ad6f=await a13_0x2c2bce({'type':_0x53fbff(0xd9),'name':_0x53fbff(0xae),'message':_0x53fbff(0xa0),'initial':'us01','validate':_0x4eae4d=>{const _0x39569c=_0x53fbff;if(!_0x4eae4d||!_0x4eae4d['trim']())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/['test'](_0x4eae4d[_0x39569c(0xe3)]()))return _0x39569c(0xdc);return!![];}});if(!_0x28ad6f[_0x53fbff(0xae)])return console['log'](_0x53fbff(0xe0)),0x1;_0x45b505=_0x28ad6f['customSite'];}else _0x45b505=_0x370f91[_0x53fbff(0xea)];const _0x107c19=resolveSite(_0x45b505);console[_0x53fbff(0xcc)](_0x53fbff(0xb4)+_0x107c19),console[_0x53fbff(0xcc)](_0x53fbff(0xa3)),console[_0x53fbff(0xcc)]('\x20\x20'+getConsoleUrl(_0x107c19,_0x53fbff(0xbe)));const _0x3bcdef=await a13_0x2c2bce({'type':_0x53fbff(0xb5),'name':_0x53fbff(0xdf),'message':_0x53fbff(0xd2),'validate':_0x4defd3=>{const _0x4d7ed6=_0x53fbff;if(!_0x4defd3||!_0x4defd3[_0x4d7ed6(0xe3)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3bcdef['apiKey'])return console[_0x53fbff(0xcc)](_0x53fbff(0xe0)),0x1;const _0x14f889=_0x3bcdef[_0x53fbff(0xdf)];console[_0x53fbff(0xcc)](_0x53fbff(0xd5));try{const _0x38b7e9=TDX[_0x53fbff(0xe8)]({'site':_0x107c19,'apiKey':_0x14f889[_0x53fbff(0xe3)](),'logLevel':_0x3f35fe[_0x53fbff(0xa4)]??LogLevel[_0x53fbff(0xd0)]}),_0x2cad58=await _0x38b7e9[_0x53fbff(0xbb)][_0x53fbff(0xe7)]();console[_0x53fbff(0xcc)](_0x53fbff(0xe1)+_0x2cad58[_0x53fbff(0xde)]+')');const _0x344601=await isKeychainAvailable();_0x344601?(await saveAPIKeyAsync(_0x14f889[_0x53fbff(0xe3)](),_0x107c19,_0x33a66c),console[_0x53fbff(0xcc)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x33a66c?'\x20(profile:\x20'+_0x33a66c+')':''))):(console[_0x53fbff(0x9f)](a13_0x1e3024[_0x53fbff(0xba)](_0x53fbff(0xc4))),console[_0x53fbff(0x9f)](a13_0x1e3024[_0x53fbff(0xba)]('\x20\x20Set\x20TD_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x33a66c){const _0x57a0ed={'site':_0x107c19};saveProfileToUserConfig(_0x33a66c,_0x57a0ed),console[_0x53fbff(0xcc)](_0x53fbff(0xbd)+_0x33a66c+_0x53fbff(0xd8));}const _0x1502c5=_0x33a66c?_0x53fbff(0xca)+_0x33a66c:'';return console[_0x53fbff(0xcc)](),console[_0x53fbff(0xcc)](_0x53fbff(0xa8)),console[_0x53fbff(0xcc)](_0x53fbff(0xec)+_0x1502c5+_0x53fbff(0xe9)),console[_0x53fbff(0xcc)]('\x20\x20tdx'+_0x1502c5+_0x53fbff(0xbf)),0x0;}catch(_0x100a54){if(_0x100a54 instanceof HTTPClientError&&_0x100a54[_0x53fbff(0xb1)]===0x191)return printAuthError(_0x100a54),0x1;return console[_0x53fbff(0xd3)](a13_0x1e3024['red'](_0x53fbff(0xd4)+(_0x100a54 instanceof Error?_0x100a54[_0x53fbff(0xc1)]:String(_0x100a54)))),console[_0x53fbff(0xd3)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a13_0x2eaad2(0x9d)]='auth';[a13_0x2eaad2(0x9e)]=a13_0x2eaad2(0xce);async[a13_0x2eaad2(0xb8)](_0x524859){const _0x697d22=a13_0x2eaad2,{options:_0x2ba785,tdx:_0x37afd3}=_0x524859,_0x47711c=_0x2ba785[_0x697d22(0xea)],_0x4dd1f5=_0x2ba785[_0x697d22(0x99)],_0x513f82=_0x4dd1f5?_0x4dd1f5:_0x697d22(0xdd);console['log']('tdx\x20profile:\x20'+_0x513f82+_0x697d22(0xc8)+_0x47711c+')');const _0x33241a=await resolveAPIKeyAsync(_0x47711c,_0x4dd1f5);if(_0x33241a){const {source:_0x4d2836,isDeprecated:_0x7ddd5}=_0x33241a,_0x2e87cf=_0x697d22(0xa6)+_0x4d2836;console[_0x697d22(0xcc)](_0x7ddd5?a13_0x1e3024[_0x697d22(0xba)](_0x2e87cf):_0x2e87cf);}else console[_0x697d22(0xcc)](a13_0x1e3024[_0x697d22(0xba)](_0x697d22(0xdb)));try{const _0x4d5be7=await _0x37afd3['jobs']['getUserInfo']();return console[_0x697d22(0xcc)](a13_0x1e3024[_0x697d22(0xb0)](_0x697d22(0xc2))),console[_0x697d22(0xcc)](_0x697d22(0xab)+_0x4d5be7[_0x697d22(0xde)]),(_0x4d5be7[_0x697d22(0x9b)]||_0x4d5be7['last_name'])&&console[_0x697d22(0xcc)](_0x697d22(0xda)+[_0x4d5be7[_0x697d22(0x9b)],_0x4d5be7[_0x697d22(0xaf)]]['filter'](Boolean)[_0x697d22(0xcd)]('\x20')),0x0;}catch(_0x1ba72c){return _0x1ba72c instanceof HTTPClientError&&_0x1ba72c['status']===0x191?printAuthError(_0x1ba72c,!![],_0x4dd1f5):console[_0x697d22(0xd3)](a13_0x1e3024[_0x697d22(0xa9)](_0x697d22(0xd4)+(_0x1ba72c instanceof Error?_0x1ba72c[_0x697d22(0xc1)]:String(_0x1ba72c)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a13_0x2eaad2(0xc3);[a13_0x2eaad2(0x9e)]=a13_0x2eaad2(0xe6);async[a13_0x2eaad2(0xb8)](_0x24e849){const _0x77eac3=a13_0x2eaad2,{options:_0x5851fd}=_0x24e849,_0x25f09f=_0x5851fd[_0x77eac3(0x99)];console[_0x77eac3(0xcc)](a13_0x1e3024[_0x77eac3(0xa1)](_0x77eac3(0xaa)));const _0x2d2a6b=await isKeychainAvailable();if(!_0x2d2a6b)return console['error'](a13_0x1e3024[_0x77eac3(0xa9)](_0x77eac3(0xad))),0x1;const _0x3772df=await deleteKeychainAPIKey(_0x25f09f);return _0x3772df?(clearCredentialCache(),console[_0x77eac3(0xcc)](_0x77eac3(0xc7)+(_0x25f09f?_0x77eac3(0xb7)+_0x25f09f+')':'')),0x0):(console[_0x77eac3(0xcc)](_0x77eac3(0xcb)+(_0x25f09f?_0x77eac3(0xa5)+_0x25f09f:'')),0x1);}}function a13_0x4467(_0x3309cc,_0x132968){const _0x3e0141=a13_0x3e01();return a13_0x4467=function(_0x44674b,_0x25aedd){_0x44674b=_0x44674b-0x99;let _0x1fd7f1=_0x3e0141[_0x44674b];return _0x1fd7f1;},a13_0x4467(_0x3309cc,_0x132968);}function a13_0x3e01(){const _0x199a02=['execute','auth:setup','yellow','jobs','eu01','✓\x20Profile\x20\x27','/app/mp/ak','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','1953roKAHH','message','✓\x20Authentication\x20successful\x0a','auth:clear','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','length','select','✓\x20API\x20key\x20removed\x20from\x20keychain','\x20(site:\x20','value','\x20--profile\x20','No\x20API\x20key\x20found\x20in\x20keychain','log','join','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','175852UWFiap','ERROR','3108pzfRuU','Enter\x20your\x20TD\x20API\x20key:','error','✗\x20Validation\x20failed:\x20','Validating\x20API\x20key...','jp01','52965050WhcZdZ','\x27\x20registered','text','Name:\x20','No\x20credential\x20found','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','N/A','email','apiKey','\x0aSetup\x20cancelled','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','ap02\x20-\x20Korea','trim','push','4156184GJEwDD','Remove\x20API\x20key\x20from\x20system\x20keychain','getUserInfo','create','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','site','tdx:\x20auth\x20setup','\x20\x20tdx','profile','us\x20\x20\x20-\x20United\x20States','first_name','other','name','description','warn','Enter\x20site\x20name:','bold','695778IMttlT','You\x20can\x20find\x20your\x20API\x20key\x20at:','logLevel','\x20for\x20profile:\x20','Read\x20credential\x20from\x20','11028164ueNgFG','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','red','tdx:\x20auth\x20clear','User:\x20','27nNyOcj','System\x20keychain\x20is\x20not\x20available','customSite','last_name','green','status','6dIpBNm','us01','Setting\x20up\x20authentication\x20for\x20site:\x20','password','2138605ysoQPZ','\x20(profile:\x20'];a13_0x3e01=function(){return _0x199a02;};return a13_0x3e01();}
@@ -1 +1 @@
1
- const a14_0x2e3dc6=a14_0x44da;function a14_0x44da(_0x141cc8,_0x16921c){const _0x5b8dc5=a14_0x5b8d();return a14_0x44da=function(_0x44da9f,_0x5ea22e){_0x44da9f=_0x44da9f-0xa2;let _0x556082=_0x5b8dc5[_0x44da9f];return _0x556082;},a14_0x44da(_0x141cc8,_0x16921c);}(function(_0x2f199c,_0x31e3e2){const _0x5f4e59=a14_0x44da,_0x504348=_0x2f199c();while(!![]){try{const _0x4db99c=parseInt(_0x5f4e59(0xc6))/0x1+-parseInt(_0x5f4e59(0xc4))/0x2*(-parseInt(_0x5f4e59(0xc3))/0x3)+-parseInt(_0x5f4e59(0xa3))/0x4+parseInt(_0x5f4e59(0xd4))/0x5+-parseInt(_0x5f4e59(0xd9))/0x6+-parseInt(_0x5f4e59(0xcb))/0x7*(-parseInt(_0x5f4e59(0xd7))/0x8)+-parseInt(_0x5f4e59(0xab))/0x9;if(_0x4db99c===_0x31e3e2)break;else _0x504348['push'](_0x504348['shift']());}catch(_0x40fdf4){_0x504348['push'](_0x504348['shift']());}}}(a14_0x5b8d,0xb1bdd));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';import{resolveModelAlias}from'../utils/model-aliases.js';function handleSDKError(_0xc2058,_0x11e6f8){const _0x29fd16=a14_0x44da;if(_0xc2058 instanceof SDKError)console['error'](_0x29fd16(0xb0)+_0xc2058[_0x29fd16(0xce)]),_0x11e6f8[_0x29fd16(0xaf)]&&(_0xc2058['cause']&&console[_0x29fd16(0xa7)](_0x29fd16(0xa5)+_0xc2058['cause']),_0xc2058[_0x29fd16(0xb3)]&&(console[_0x29fd16(0xa7)]('\x0aStack\x20trace:'),console[_0x29fd16(0xa7)](_0xc2058[_0x29fd16(0xb3)])));else throw _0xc2058;}export class ChatCommand extends BaseCommand{[a14_0x2e3dc6(0xbc)]='chat';['description']=a14_0x2e3dc6(0xd2);['validate'](_0x3d1ff5){const _0x4b551c=a14_0x2e3dc6,_0x4a2bc8=_0x3d1ff5[_0x4b551c(0xb4)][_0x4b551c(0xa8)]('\x20');if(!_0x4a2bc8)return _0x4b551c(0xdb);return undefined;}async[a14_0x2e3dc6(0xb7)](_0x1f6aed,_0x587553,_0x146039,_0x1214d4,_0x5cf09d){const _0x558d5d=a14_0x2e3dc6;for await(const _0x536f1d of _0x1f6aed['llm'][_0x558d5d(0xc5)](_0x587553,{'agentId':_0x146039,'chatId':_0x1214d4})){if(_0x536f1d[_0x558d5d(0xd3)]==='metadata'){const _0x530a7e=_0x536f1d[_0x558d5d(0xc1)][_0x558d5d(0xc9)];saveLastChatId(_0x530a7e),_0x5cf09d&&console[_0x558d5d(0xa7)](_0x558d5d(0xa9)+_0x530a7e);}else _0x536f1d[_0x558d5d(0xd3)]===_0x558d5d(0xc7)&&this['handleSSEEvent'](_0x536f1d[_0x558d5d(0xc1)]);}}async[a14_0x2e3dc6(0xbe)](_0x323a65,_0x432efe,_0x24659b,_0x2fc86c,_0x297e44){const _0x22d14d=a14_0x2e3dc6;if(_0x432efe){const {projectName:_0x40d90e,agentName:_0x48f64a}=parseAgentRef(_0x432efe);if(!_0x48f64a)throw new Error(_0x22d14d(0xd6));const _0x2f18da=await withSpinner(_0x22d14d(0xa6)+_0x40d90e+'\x27...',()=>_0x323a65[_0x22d14d(0xbf)][_0x22d14d(0xba)](_0x40d90e),{'verbose':_0x297e44}),_0x407c60=await withSpinner(_0x22d14d(0xc2)+_0x48f64a+_0x22d14d(0xb2),()=>_0x323a65['llm']['resolveAgentId'](_0x48f64a,_0x2f18da['data']),{'verbose':_0x297e44});return _0x407c60[_0x22d14d(0xc1)];}else{const _0xe7dce1=_0x24659b||_0x22d14d(0xbd),_0x10c887=resolveModelAlias(_0xe7dce1),_0x365854=await withSpinner(_0x22d14d(0xd5)+_0x10c887+_0x22d14d(0xb2),()=>_0x323a65[_0x22d14d(0xbf)][_0x22d14d(0xbb)](_0x10c887,0x0,_0x2fc86c),{'verbose':_0x297e44});return _0x365854[_0x22d14d(0xc1)]['id'];}}async[a14_0x2e3dc6(0xb8)](_0x3022f5){const _0x7924fc=a14_0x2e3dc6,{options:_0x3941b7,args:_0x54db7f,tdx:_0x3fc0c6}=_0x3022f5,_0x9febec=_0x54db7f[_0x7924fc(0xa8)]('\x20'),_0x2ae449=_0x3941b7,_0x76cec7=_0x2ae449[_0x7924fc(0xad)],_0x10d07f=_0x2ae449[_0x7924fc(0xa4)],_0x17dfd2=_0x2ae449[_0x7924fc(0xcf)]?Number(_0x2ae449[_0x7924fc(0xcf)]):undefined,_0x16af62=_0x2ae449['new'];try{let _0x2af6a7,_0x434b23;!_0x16af62&&(_0x434b23=loadLastChatId(),_0x434b23&&_0x3941b7[_0x7924fc(0xaf)]&&console['error'](_0x7924fc(0xb9)+_0x434b23));(_0x16af62||!_0x434b23)&&(_0x2af6a7=await this[_0x7924fc(0xbe)](_0x3fc0c6,_0x76cec7,_0x10d07f,_0x17dfd2,_0x3941b7[_0x7924fc(0xaf)]));try{await this[_0x7924fc(0xb7)](_0x3fc0c6,_0x9febec,_0x2af6a7,_0x434b23,_0x3941b7[_0x7924fc(0xaf)]);}catch(_0x2c937f){const _0x5c75c4=_0x2c937f instanceof SDKError&&_0x2c937f[_0x7924fc(0xd8)]===ErrorCode['CHAT_NOT_FOUND']||_0x2c937f instanceof Error&&_0x2c937f['message'][_0x7924fc(0xb5)]('404');if(_0x5c75c4)_0x3941b7[_0x7924fc(0xaf)]&&console[_0x7924fc(0xa7)](_0x7924fc(0xc0)),!_0x2af6a7&&(_0x2af6a7=await this[_0x7924fc(0xbe)](_0x3fc0c6,_0x76cec7,_0x10d07f,_0x17dfd2,_0x3941b7['verbose'])),await this['streamChat'](_0x3fc0c6,_0x9febec,_0x2af6a7,undefined,_0x3941b7[_0x7924fc(0xaf)]);else throw _0x2c937f;}return console[_0x7924fc(0xc8)](),0x0;}catch(_0x60cc0a){return console[_0x7924fc(0xa7)](),handleSDKError(_0x60cc0a,_0x3941b7),0x1;}}[a14_0x2e3dc6(0xae)](_0x2bbd03){const _0x4d537e=a14_0x2e3dc6;if('content'in _0x2bbd03)process['stdout']['write'](_0x2bbd03[_0x4d537e(0xaa)]);else{if(_0x4d537e(0xda)in _0x2bbd03)process['stderr']['write'](_0x4d537e(0xa2)+_0x2bbd03[_0x4d537e(0xda)][_0x4d537e(0xb1)]+']\x0a');else{if(_0x4d537e(0xd1)in _0x2bbd03)process[_0x4d537e(0xd0)][_0x4d537e(0xcc)](_0x4d537e(0xb6)+_0x2bbd03['tool'][_0x4d537e(0xb1)]+']\x0a');else{if(_0x4d537e(0xcd)in _0x2bbd03)process[_0x4d537e(0xd0)]['write'](_0x4d537e(0xca)+_0x2bbd03['output'][_0x4d537e(0xbc)]+']\x0a'),process[_0x4d537e(0xd0)][_0x4d537e(0xcc)](_0x2bbd03[_0x4d537e(0xcd)][_0x4d537e(0xaa)]+'\x0a');else _0x4d537e(0xa7)in _0x2bbd03&&process['stderr'][_0x4d537e(0xcc)](_0x4d537e(0xac)+_0x2bbd03[_0x4d537e(0xa7)]+']\x0a');}}}}}function a14_0x5b8d(){const _0x4493ed=['log','chatId','\x0a[Output:\x20','1678593GbbhuE','write','output','message','temperature','stderr','tool','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','type','603740GeUfVG','Getting\x20agent\x20for\x20model\x20\x27','Agent\x20reference\x20must\x20include\x20project\x20name.\x20Usage:\x20--agent\x20\x22Project/Agent\x22','24OntVcn','code','5471154kKHINp','tool_call','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','\x0a[Tool:\x20','1137108DpAzVC','model','\x20\x20Cause:\x20','Resolving\x20project\x20\x27','error','join','Chat\x20session:\x20','content','6868899TgHDKT','\x0a[Error:\x20','agent','handleSSEEvent','verbose','Error:\x20','functionName','\x27...','stack','args','includes','[Tool\x20result:\x20','streamChat','execute','Continuing\x20chat:\x20','resolveProjectId','getOrCreateDefaultAgent','name','haiku','getAgentId','llm','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','data','Resolving\x20agent\x20\x27','1643646ZoSKtK','2ihXgfg','chat','1299349iNtPbK','event'];a14_0x5b8d=function(){return _0x4493ed;};return a14_0x5b8d();}
1
+ const a14_0xa33ba0=a14_0x48ee;(function(_0x4b5033,_0x1244ae){const _0x39dc3b=a14_0x48ee,_0xa37a41=_0x4b5033();while(!![]){try{const _0x2b7898=-parseInt(_0x39dc3b(0x182))/0x1+-parseInt(_0x39dc3b(0x15e))/0x2*(-parseInt(_0x39dc3b(0x15f))/0x3)+parseInt(_0x39dc3b(0x18e))/0x4*(parseInt(_0x39dc3b(0x14f))/0x5)+-parseInt(_0x39dc3b(0x18b))/0x6+parseInt(_0x39dc3b(0x18a))/0x7+parseInt(_0x39dc3b(0x166))/0x8*(parseInt(_0x39dc3b(0x16b))/0x9)+-parseInt(_0x39dc3b(0x186))/0xa*(-parseInt(_0x39dc3b(0x17f))/0xb);if(_0x2b7898===_0x1244ae)break;else _0xa37a41['push'](_0xa37a41['shift']());}catch(_0x55a19b){_0xa37a41['push'](_0xa37a41['shift']());}}}(a14_0x2575,0x32ecd));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';function a14_0x48ee(_0x3e49c0,_0xa89890){const _0x25750a=a14_0x2575();return a14_0x48ee=function(_0x48ee7c,_0xe79398){_0x48ee7c=_0x48ee7c-0x14f;let _0x5c7e1a=_0x25750a[_0x48ee7c];return _0x5c7e1a;},a14_0x48ee(_0x3e49c0,_0xa89890);}import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';import{resolveModelAlias}from'../utils/model-aliases.js';function handleSDKError(_0xc58d7a,_0x5e5acf){const _0x11116c=a14_0x48ee;if(_0xc58d7a instanceof SDKError)console[_0x11116c(0x183)](_0x11116c(0x164)+_0xc58d7a[_0x11116c(0x181)]),_0x5e5acf['verbose']&&(_0xc58d7a['cause']&&console[_0x11116c(0x183)](_0x11116c(0x15d)+_0xc58d7a[_0x11116c(0x152)]),_0xc58d7a['stack']&&(console['error'](_0x11116c(0x175)),console[_0x11116c(0x183)](_0xc58d7a[_0x11116c(0x157)])));else throw _0xc58d7a;}export class ChatCommand extends BaseCommand{[a14_0xa33ba0(0x179)]=a14_0xa33ba0(0x184);[a14_0xa33ba0(0x17b)]=a14_0xa33ba0(0x16f);[a14_0xa33ba0(0x16d)](_0x237b06){const _0x56b771=a14_0xa33ba0,_0x39ca14=_0x237b06[_0x56b771(0x17a)][_0x56b771(0x158)]('\x20');if(!_0x39ca14)return _0x56b771(0x18d);return undefined;}async[a14_0xa33ba0(0x16a)](_0x9fe254,_0x4c82c4,_0x2df8d4,_0xca9706,_0x439b19){const _0x527695=a14_0xa33ba0;for await(const _0x5356ae of _0x9fe254[_0x527695(0x161)][_0x527695(0x184)](_0x4c82c4,{'agentId':_0x2df8d4,'chatId':_0xca9706})){if(_0x5356ae['type']===_0x527695(0x170)){const _0xd025c0=_0x5356ae[_0x527695(0x165)][_0x527695(0x153)];saveLastChatId(_0xd025c0),_0x439b19&&console[_0x527695(0x183)](_0x527695(0x162)+_0xd025c0);}else _0x5356ae[_0x527695(0x16c)]==='event'&&this[_0x527695(0x160)](_0x5356ae[_0x527695(0x165)]);}}async[a14_0xa33ba0(0x169)](_0x477840,_0x1ad19c,_0x3e2bc3,_0x31da9f,_0x4ff75e){const _0x127a7d=a14_0xa33ba0;if(_0x1ad19c){const {projectName:_0x296800,agentName:_0xacce47}=parseAgentRef(_0x1ad19c);if(!_0xacce47)throw new Error('Agent\x20reference\x20must\x20include\x20project\x20name.\x20Usage:\x20--agent\x20\x22Project/Agent\x22');const _0x165ff2=await withSpinner(_0x127a7d(0x188)+_0x296800+'\x27...',()=>_0x477840[_0x127a7d(0x161)][_0x127a7d(0x173)](_0x296800),{'verbose':_0x4ff75e}),_0x9fe4ad=await withSpinner(_0x127a7d(0x17d)+_0xacce47+'\x27...',()=>_0x477840[_0x127a7d(0x161)][_0x127a7d(0x15a)](_0xacce47,_0x165ff2[_0x127a7d(0x165)]),{'verbose':_0x4ff75e});return _0x9fe4ad[_0x127a7d(0x165)];}else{const _0x4d438c=_0x3e2bc3||_0x127a7d(0x159),_0x476408=resolveModelAlias(_0x4d438c),_0x586511=await withSpinner(_0x127a7d(0x174)+_0x476408+'\x27...',()=>_0x477840[_0x127a7d(0x161)]['getOrCreateDefaultAgent'](_0x476408,0x0,_0x31da9f),{'verbose':_0x4ff75e});return _0x586511[_0x127a7d(0x165)]['id'];}}async[a14_0xa33ba0(0x177)](_0xbaadb1){const _0x5e7439=a14_0xa33ba0,{options:_0x10c242,args:_0x4e6c45,tdx:_0x3cb8e7}=_0xbaadb1,_0x4fd653=_0x4e6c45[_0x5e7439(0x158)]('\x20'),_0x5e33ec=_0x10c242,_0x1f8c52=_0x5e33ec[_0x5e7439(0x185)],_0x10c28b=_0x5e33ec[_0x5e7439(0x172)],_0x1556f1=_0x5e33ec[_0x5e7439(0x167)]?Number(_0x5e33ec[_0x5e7439(0x167)]):undefined,_0x39329c=_0x5e33ec[_0x5e7439(0x187)];try{let _0x2badb9,_0x393a77;!_0x39329c&&(_0x393a77=loadLastChatId(),_0x393a77&&_0x10c242['verbose']&&console[_0x5e7439(0x183)](_0x5e7439(0x168)+_0x393a77));(_0x39329c||!_0x393a77)&&(_0x2badb9=await this[_0x5e7439(0x169)](_0x3cb8e7,_0x1f8c52,_0x10c28b,_0x1556f1,_0x10c242['verbose']));try{await this[_0x5e7439(0x16a)](_0x3cb8e7,_0x4fd653,_0x2badb9,_0x393a77,_0x10c242['verbose']);}catch(_0x4eea2d){const _0x3d5457=_0x4eea2d instanceof SDKError&&_0x4eea2d[_0x5e7439(0x15b)]===ErrorCode['CHAT_NOT_FOUND']||_0x4eea2d instanceof Error&&_0x4eea2d[_0x5e7439(0x181)][_0x5e7439(0x163)](_0x5e7439(0x16e));if(_0x3d5457)_0x10c242[_0x5e7439(0x171)]&&console[_0x5e7439(0x183)](_0x5e7439(0x15c)),!_0x2badb9&&(_0x2badb9=await this['getAgentId'](_0x3cb8e7,_0x1f8c52,_0x10c28b,_0x1556f1,_0x10c242['verbose'])),await this[_0x5e7439(0x16a)](_0x3cb8e7,_0x4fd653,_0x2badb9,undefined,_0x10c242[_0x5e7439(0x171)]);else throw _0x4eea2d;}return console['log'](),0x0;}catch(_0x3029cb){return console[_0x5e7439(0x183)](),handleSDKError(_0x3029cb,_0x10c242),0x1;}}['handleSSEEvent'](_0x473c26){const _0x24b14c=a14_0xa33ba0;if(_0x24b14c(0x189)in _0x473c26)process[_0x24b14c(0x155)]['write'](_0x473c26[_0x24b14c(0x189)]);else{if(_0x24b14c(0x176)in _0x473c26)process['stderr']['write'](_0x24b14c(0x154)+_0x473c26[_0x24b14c(0x176)][_0x24b14c(0x18c)]+']\x0a');else{if(_0x24b14c(0x156)in _0x473c26)process[_0x24b14c(0x17c)][_0x24b14c(0x151)](_0x24b14c(0x180)+_0x473c26['tool']['functionName']+']\x0a');else{if(_0x24b14c(0x150)in _0x473c26)process[_0x24b14c(0x17c)][_0x24b14c(0x151)](_0x24b14c(0x17e)+_0x473c26[_0x24b14c(0x150)]['name']+']\x0a'),process['stderr'][_0x24b14c(0x151)](_0x473c26['output'][_0x24b14c(0x189)]+'\x0a');else _0x24b14c(0x183)in _0x473c26&&process[_0x24b14c(0x17c)][_0x24b14c(0x151)](_0x24b14c(0x178)+_0x473c26[_0x24b14c(0x183)]+']\x0a');}}}}}function a14_0x2575(){const _0x5d11f5=['286FwXLEU','8418OAkXmh','handleSSEEvent','llm','Chat\x20session:\x20','includes','Error:\x20','data','8cgaHwX','temperature','Continuing\x20chat:\x20','getAgentId','streamChat','426366qusANQ','type','validate','404','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','metadata','verbose','model','resolveProjectId','Getting\x20agent\x20for\x20model\x20\x27','\x0aStack\x20trace:','tool_call','execute','\x0a[Error:\x20','name','args','description','stderr','Resolving\x20agent\x20\x27','\x0a[Output:\x20','329549eObOqN','[Tool\x20result:\x20','message','381371KMLezB','error','chat','agent','10ELJpkt','new','Resolving\x20project\x20\x27','content','1089753rTNoyy','620070CyggWI','functionName','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','4tEQjNu','295175FDUJwX','output','write','cause','chatId','\x0a[Tool:\x20','stdout','tool','stack','join','haiku','resolveAgentId','code','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','\x20\x20Cause:\x20'];a14_0x2575=function(){return _0x5d11f5;};return a14_0x2575();}
@@ -1 +1 @@
1
- const a15_0x32522a=a15_0x32ea;function a15_0x2b8e(){const _0x37eb46=['green','data','site','✓\x20Using\x20project:\x20','✓\x20Port\x20','Failed\x20to\x20configure\x20marketplace\x20\x27','inherit','trim','\x27\x20installed','✓\x20Logs\x20saved\x20to\x20','utf-8','already\x20installed','\x20already\x20configured','td-skills\x20Plugins','includes','sql-skills','INSTALLATION_FAILED','object','error','install','join','localhost','which','✓\x20Marketplace\x20\x27','close','llm','parse','toString','COMMAND_NOT_FOUND','3197858IvbQky','getLogPath','tdx','attributes','Updating\x20marketplace\x20\x27','Starting\x20TD\x20LLM\x20proxy\x20server...','sonnet','765hCEfMs','Failed\x20to\x20update\x20marketplace\x20\x27','td-skills','Executing:\x20claude\x20','fail','start','execute','settings.local.json','✓\x20Plugin\x20\x27','):\x20claude\x20','Command\x20output:\x20','plugin','claude','✓\x20Settings\x20restored:\x20.claude/settings.local.json','ANTHROPIC_MODEL','Failed\x20to\x20install\x20plugin\x20\x27','text','Failed\x20to\x20launch\x20Claude\x20Code:\x20','https://github.com/treasure-data/td-skills','cause','already\x20exists','env','debug','verbose','findClaudePath','cwd','7275790ZtyBJx','add','659950juZeNV','hostname','Warning:\x20Failed\x20to\x20configure\x20','string','2131136AsUhMK','Setting\x20up\x20project...','server','54500OjvwHx','http://127.0.0.1:','✓\x20MCP\x20server\x20\x27','message','name','warn','stringify','statusLine','profile','proxy','originalSettings','TD\x20Docs\x20MCP\x20Server','logger','tdx\x20claude\x20statusline','exit','log','\x27...','Configuring\x20marketplace\x20\x27','127.0.0.1','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','--transport','Creating\x20.claude/settings.local.json...','ANTHROPIC_BASE_URL','84AYUzvR','marketplace','.claude','command','red','model','140344APyimW','tdx-skills','tdx\x20--profile\x20','Finding\x20available\x20port...','Command\x20failed\x20(exit\x20','mcp','Configuring\x20MCP\x20server\x20\x27','Setup\x20failed','\x20claude\x20statusline','✓\x20Logging\x20to\x20','stop','\x20configuration\x20failed','714918gDePTe','3smSWqV'];a15_0x2b8e=function(){return _0x37eb46;};return a15_0x2b8e();}(function(_0x14e606,_0x202fe8){const _0x45df1e=a15_0x32ea,_0x59bc46=_0x14e606();while(!![]){try{const _0x564b41=parseInt(_0x45df1e(0x184))/0x1+-parseInt(_0x45df1e(0x15a))/0x2+-parseInt(_0x45df1e(0x13c))/0x3*(parseInt(_0x45df1e(0x12f))/0x4)+-parseInt(_0x45df1e(0x17b))/0x5+parseInt(_0x45df1e(0x13b))/0x6*(-parseInt(_0x45df1e(0x129))/0x7)+-parseInt(_0x45df1e(0x181))/0x8+-parseInt(_0x45df1e(0x161))/0x9*(-parseInt(_0x45df1e(0x17d))/0xa);if(_0x564b41===_0x202fe8)break;else _0x59bc46['push'](_0x59bc46['shift']());}catch(_0x442c11){_0x59bc46['push'](_0x59bc46['shift']());}}}(a15_0x2b8e,0xd6852));import{spawn}from'node:child_process';function a15_0x32ea(_0x539d27,_0x2e48e7){const _0x2b8e1f=a15_0x2b8e();return a15_0x32ea=function(_0x32ea49,_0x26c18b){_0x32ea49=_0x32ea49-0x123;let _0x2010e2=_0x2b8e1f[_0x32ea49];return _0x2010e2;},a15_0x32ea(_0x539d27,_0x2e48e7);}import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a15_0x3db7a8 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';function handleInstallationError(_0x5226bc,_0x4a6644,_0x17704d,_0x2a57ac){const _0x3b359f=a15_0x32ea;errorContains(_0x5226bc,_0x3b359f(0x175),_0x3b359f(0x148),'already\x20configured')?(_0x17704d[_0x3b359f(0x171)]='✓\x20'+_0x4a6644+_0x3b359f(0x149),_0x2a57ac?.['info'](_0x4a6644+_0x3b359f(0x149)),_0x5226bc instanceof SDKError&&_0x5226bc[_0x3b359f(0x174)]&&_0x2a57ac?.[_0x3b359f(0x177)](_0x3b359f(0x16b)+_0x5226bc[_0x3b359f(0x174)][_0x3b359f(0x187)])):(_0x17704d[_0x3b359f(0x189)](_0x3b359f(0x17f)+_0x4a6644),_0x2a57ac?.[_0x3b359f(0x14f)](_0x4a6644+_0x3b359f(0x13a),_0x5226bc));}async function executeClaudeCommand(_0x44e8cd,_0x493e73,_0x1236e6){const _0x2dca39=a15_0x32ea;return _0x1236e6?.['info'](_0x2dca39(0x164)+_0x44e8cd[_0x2dca39(0x151)]('\x20')),new Promise((_0x2dca9b,_0x4a3f57)=>{const _0x1de899=_0x2dca39,_0xc6024e=spawn(_0x1de899(0x16d),_0x44e8cd,{'stdio':'pipe'});let _0x181f4a='',_0x2b5e67='';_0xc6024e['stdout']['on'](_0x1de899(0x13e),_0x35bff9=>{const _0x407536=_0x1de899;_0x181f4a+=_0x35bff9[_0x407536(0x158)]();}),_0xc6024e['stderr']['on'](_0x1de899(0x13e),_0x5c5556=>{const _0x431e05=_0x1de899;_0x2b5e67+=_0x5c5556[_0x431e05(0x158)]();}),_0xc6024e['on'](_0x1de899(0x192),_0x4cc180=>{const _0xb9eddb=_0x1de899;if(_0x4cc180===0x0)_0x2dca9b(_0x181f4a);else _0x493e73?(_0x1236e6?.['error'](_0xb9eddb(0x133)+_0x4cc180+_0xb9eddb(0x16a)+_0x44e8cd['join']('\x20')),_0x4a3f57(new SDKError(ErrorCode[_0xb9eddb(0x14d)],_0x493e73,new Error(_0x2b5e67)))):_0x2dca9b('');});});}async function ensureMcpServer(_0x69c530,_0xb7735,_0x13882d,_0x8bab27,_0x52d572){const _0x2edf77=a15_0x32ea;_0x8bab27['text']=_0x2edf77(0x135)+_0x69c530+_0x2edf77(0x194),await executeClaudeCommand([_0x2edf77(0x134),'add',_0x69c530,_0xb7735,_0x2edf77(0x126),_0x13882d],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x69c530+'\x27',_0x52d572),_0x8bab27['text']=_0x2edf77(0x186)+_0x69c530+'\x27\x20configured';}async function ensureMarketplace(_0x3340f1,_0x2efec0,_0x447678,_0x28b8af){const _0xc02047=a15_0x32ea;_0x447678[_0xc02047(0x171)]=_0xc02047(0x123)+_0x3340f1+_0xc02047(0x194),await executeClaudeCommand([_0xc02047(0x16c),'marketplace',_0xc02047(0x17c),_0x2efec0],_0xc02047(0x142)+_0x3340f1+'\x27',_0x28b8af),_0x447678[_0xc02047(0x171)]=_0xc02047(0x154)+_0x3340f1+'\x27\x20configured';}async function updateMarketplace(_0x968a64,_0x11a012,_0x1be2ff){const _0x3faf26=a15_0x32ea;_0x11a012['text']=_0x3faf26(0x15e)+_0x968a64+_0x3faf26(0x194),await executeClaudeCommand([_0x3faf26(0x16c),_0x3faf26(0x12a),'update'],_0x3faf26(0x162)+_0x968a64+'\x27',_0x1be2ff),_0x11a012['text']='✓\x20Marketplace\x20\x27'+_0x968a64+'\x27\x20updated';}async function ensurePlugin(_0x5ec643,_0x5fbed3,_0x2c8fe1,_0x3da0ad){const _0x2be522=a15_0x32ea;_0x2c8fe1[_0x2be522(0x171)]='Installing\x20plugin\x20\x27'+_0x5ec643+_0x2be522(0x194),await executeClaudeCommand(['plugin',_0x2be522(0x150),_0x5ec643+'@'+_0x5fbed3],_0x2be522(0x170)+_0x5ec643+'\x27',_0x3da0ad),_0x2c8fe1[_0x2be522(0x171)]=_0x2be522(0x169)+_0x5ec643+_0x2be522(0x145);}async function createClaudeSettings(_0x292d5d,_0x34867b=a15_0x32522a(0x160),_0x49c362){const _0x25a7d5=a15_0x32522a,_0x1c8505=join(process[_0x25a7d5(0x17a)](),'.claude'),_0x35c217=join(_0x1c8505,_0x25a7d5(0x168));await mkdir(_0x1c8505,{'recursive':!![]});let _0x41cc4d={};if(existsSync(_0x35c217))try{const _0x7edfd9=await readFile(_0x35c217,_0x25a7d5(0x147));_0x41cc4d=JSON[_0x25a7d5(0x157)](_0x7edfd9);}catch{_0x41cc4d={};}const _0x3314e2=_0x41cc4d['env']||{},_0x3eeebf={'ANTHROPIC_BASE_URL':_0x3314e2[_0x25a7d5(0x128)],'ANTHROPIC_MODEL':_0x3314e2[_0x25a7d5(0x16f)],'statusLine':_0x41cc4d['statusLine']},_0x52bbf3={..._0x41cc4d,'env':{..._0x3314e2,'ANTHROPIC_BASE_URL':_0x25a7d5(0x185)+_0x292d5d,'ANTHROPIC_MODEL':_0x34867b},'statusLine':{'type':_0x25a7d5(0x12c),'command':_0x49c362?_0x25a7d5(0x131)+_0x49c362+_0x25a7d5(0x137):_0x25a7d5(0x191)}};return await writeFile(_0x35c217,JSON[_0x25a7d5(0x18a)](_0x52bbf3,null,0x2)+'\x0a'),_0x3eeebf;}async function restoreClaudeSettings(_0x5c4715){const _0x547378=a15_0x32522a,_0x564ed4=join(process[_0x547378(0x17a)](),_0x547378(0x12b)),_0x264584=join(_0x564ed4,_0x547378(0x168));if(!existsSync(_0x264584))return;try{const _0x3d2c9b=await readFile(_0x264584,_0x547378(0x147)),_0x30dc67=JSON[_0x547378(0x157)](_0x3d2c9b),_0x33f71f=_0x30dc67[_0x547378(0x176)]||{},_0x477fac=_0x33f71f[_0x547378(0x128)],_0x4d3f03=((()=>{const _0x30e966=_0x547378;if(typeof _0x477fac!==_0x30e966(0x180))return![];try{const _0x453d98=new URL(_0x477fac);return _0x453d98[_0x30e966(0x17e)]===_0x30e966(0x152)||_0x453d98[_0x30e966(0x17e)]===_0x30e966(0x124);}catch{return![];}})());_0x4d3f03?(delete _0x33f71f[_0x547378(0x128)],delete _0x33f71f[_0x547378(0x16f)]):(_0x5c4715[_0x547378(0x128)]!==undefined?_0x33f71f[_0x547378(0x128)]=_0x5c4715[_0x547378(0x128)]:delete _0x33f71f[_0x547378(0x128)],_0x5c4715[_0x547378(0x16f)]!==undefined?_0x33f71f[_0x547378(0x16f)]=_0x5c4715[_0x547378(0x16f)]:delete _0x33f71f[_0x547378(0x16f)]);const _0x2d5af6=_0x30dc67[_0x547378(0x18b)],_0x54ce69=((()=>{const _0x4b4e65=_0x547378;if(!_0x2d5af6||typeof _0x2d5af6!==_0x4b4e65(0x14e))return![];if(_0x2d5af6['type']!==_0x4b4e65(0x12c))return![];if(typeof _0x2d5af6[_0x4b4e65(0x12c)]!=='string')return![];return _0x2d5af6['command'][_0x4b4e65(0x14b)](_0x4b4e65(0x15c))&&_0x2d5af6['command'][_0x4b4e65(0x14b)]('statusline');})());if(_0x54ce69)delete _0x30dc67['statusLine'];else _0x5c4715[_0x547378(0x18b)]!==undefined?_0x30dc67[_0x547378(0x18b)]=_0x5c4715['statusLine']:delete _0x30dc67['statusLine'];_0x30dc67[_0x547378(0x176)]=_0x33f71f,await writeFile(_0x264584,JSON[_0x547378(0x18a)](_0x30dc67,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{['name']='claude';['description']='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';['server'];[a15_0x32522a(0x18e)];[a15_0x32522a(0x190)];async[a15_0x32522a(0x167)](_0x39fd9d){const _0x5cd4c1=a15_0x32522a,{tdx:_0x1e0b3e,options:_0x69d0e4,args:_0x5c63da}=_0x39fd9d;try{const _0x2fc274=_0x69d0e4,_0x2b740b=_0x2fc274[_0x5cd4c1(0x12e)]||_0x5cd4c1(0x160),_0x5745be=_0x2fc274[_0x5cd4c1(0x18d)]===![],_0x451f58=createCommandSpinner('Initializing...',{'verbose':_0x69d0e4[_0x5cd4c1(0x178)]});_0x451f58[_0x5cd4c1(0x166)]();try{if(!_0x5745be){_0x451f58[_0x5cd4c1(0x171)]=_0x5cd4c1(0x132);const _0x46f7fb=await findAvailablePort(0xfa0);_0x451f58[_0x5cd4c1(0x171)]=_0x5cd4c1(0x141)+_0x46f7fb,_0x451f58[_0x5cd4c1(0x171)]=_0x5cd4c1(0x182);const _0x548426=await _0x1e0b3e[_0x5cd4c1(0x156)]['getOrCreateDefaultProject'](),_0x1d954e=_0x548426['id'];_0x451f58[_0x5cd4c1(0x171)]=_0x5cd4c1(0x140)+_0x548426[_0x5cd4c1(0x15d)][_0x5cd4c1(0x188)],_0x451f58[_0x5cd4c1(0x171)]='Initializing\x20proxy\x20logger...',this[_0x5cd4c1(0x190)]=new TDXLogger(_0x69d0e4['logLevel'],!![]),await this[_0x5cd4c1(0x190)]['init']();const _0x32faa6=this[_0x5cd4c1(0x190)][_0x5cd4c1(0x15b)]();_0x451f58[_0x5cd4c1(0x171)]=_0x5cd4c1(0x138)+_0x32faa6,_0x451f58[_0x5cd4c1(0x171)]=_0x5cd4c1(0x15f),this[_0x5cd4c1(0x183)]=new ProxyServer({'port':_0x46f7fb,'projectId':_0x1d954e,'tdx':_0x1e0b3e,'logger':this[_0x5cd4c1(0x190)],'site':_0x69d0e4[_0x5cd4c1(0x13f)]}),await this[_0x5cd4c1(0x183)][_0x5cd4c1(0x166)](),_0x451f58[_0x5cd4c1(0x171)]=_0x5cd4c1(0x125)+_0x46f7fb,_0x451f58[_0x5cd4c1(0x171)]=_0x5cd4c1(0x127);const _0x2c4620=_0x69d0e4[_0x5cd4c1(0x18c)];this[_0x5cd4c1(0x18e)]=await createClaudeSettings(_0x46f7fb,_0x2b740b,_0x2c4620),_0x451f58[_0x5cd4c1(0x171)]='✓\x20Settings\x20configured:\x20.claude/settings.local.json';}else _0x451f58[_0x5cd4c1(0x171)]='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';try{await ensureMcpServer('td-docs','https://docs.treasuredata.com/mcp','http',_0x451f58,this['logger']);}catch(_0x529fc9){handleInstallationError(_0x529fc9,_0x5cd4c1(0x18f),_0x451f58,this['logger']);}try{await ensureMarketplace('td-skills',_0x5cd4c1(0x173),_0x451f58,this[_0x5cd4c1(0x190)]),await updateMarketplace(_0x5cd4c1(0x163),_0x451f58,this['logger']),await ensurePlugin(_0x5cd4c1(0x14c),_0x5cd4c1(0x163),_0x451f58,this[_0x5cd4c1(0x190)]),await ensurePlugin('workflow-skills',_0x5cd4c1(0x163),_0x451f58,this[_0x5cd4c1(0x190)]),await ensurePlugin(_0x5cd4c1(0x130),_0x5cd4c1(0x163),_0x451f58,this['logger']);}catch(_0x2bb314){handleInstallationError(_0x2bb314,_0x5cd4c1(0x14a),_0x451f58,this[_0x5cd4c1(0x190)]);}_0x451f58['stop']();}catch(_0x915b60){_0x451f58[_0x5cd4c1(0x165)](_0x5cd4c1(0x136));throw _0x915b60;}const _0x12cdd7=await this[_0x5cd4c1(0x179)]();if(!_0x12cdd7)throw new SDKError(ErrorCode[_0x5cd4c1(0x159)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x2de097=spawn(_0x12cdd7,_0x5c63da,{'stdio':_0x5cd4c1(0x143)}),_0xd44b09=await new Promise(_0x6ccd26=>{const _0x4f6675=_0x5cd4c1;_0x2de097['on'](_0x4f6675(0x192),_0x4a39d0=>{_0x6ccd26(_0x4a39d0||0x0);}),_0x2de097['on'](_0x4f6675(0x14f),_0x1d0c51=>{const _0x1353c2=_0x4f6675;console[_0x1353c2(0x14f)](a15_0x3db7a8[_0x1353c2(0x12d)](_0x1353c2(0x172)+_0x1d0c51['message'])),_0x6ccd26(0x1);});});this[_0x5cd4c1(0x183)]&&(await this[_0x5cd4c1(0x183)]['stop'](),console['log'](a15_0x3db7a8[_0x5cd4c1(0x13d)]('✓\x20TD\x20LLM\x20proxy\x20server\x20stopped')));if(this[_0x5cd4c1(0x190)]){await this[_0x5cd4c1(0x190)][_0x5cd4c1(0x155)]();const _0x2a3b90=this[_0x5cd4c1(0x190)][_0x5cd4c1(0x15b)]();console['log'](a15_0x3db7a8[_0x5cd4c1(0x13d)](_0x5cd4c1(0x146)+_0x2a3b90));}return this['originalSettings']&&(await restoreClaudeSettings(this[_0x5cd4c1(0x18e)]),console[_0x5cd4c1(0x193)](a15_0x3db7a8['green'](_0x5cd4c1(0x16e)))),_0xd44b09;}catch(_0x567040){this[_0x5cd4c1(0x183)]&&await this[_0x5cd4c1(0x183)][_0x5cd4c1(0x139)]();this[_0x5cd4c1(0x190)]&&await this['logger']['close']();this[_0x5cd4c1(0x18e)]&&await restoreClaudeSettings(this[_0x5cd4c1(0x18e)]);throw _0x567040;}}async[a15_0x32522a(0x179)](){return new Promise(_0x49fafd=>{const _0x1dddb7=a15_0x32ea,_0x347e96=spawn(_0x1dddb7(0x153),[_0x1dddb7(0x16d)]);let _0x408a9e='';_0x347e96['stdout']['on'](_0x1dddb7(0x13e),_0x367012=>{const _0x2057fe=_0x1dddb7;_0x408a9e+=_0x367012[_0x2057fe(0x158)]();}),_0x347e96['on']('exit',_0x403eed=>{const _0x5380f5=_0x1dddb7;_0x403eed===0x0&&_0x408a9e[_0x5380f5(0x144)]()?_0x49fafd(_0x408a9e['trim']()):_0x49fafd('claude');});});}}
1
+ const a15_0x4f5c1e=a15_0x3080;(function(_0x295863,_0x1263c4){const _0x57260b=a15_0x3080,_0x1e20e3=_0x295863();while(!![]){try{const _0x159924=-parseInt(_0x57260b(0x10f))/0x1*(parseInt(_0x57260b(0x125))/0x2)+parseInt(_0x57260b(0x106))/0x3*(parseInt(_0x57260b(0xdc))/0x4)+-parseInt(_0x57260b(0x10c))/0x5+-parseInt(_0x57260b(0xe2))/0x6+parseInt(_0x57260b(0x112))/0x7*(-parseInt(_0x57260b(0x130))/0x8)+-parseInt(_0x57260b(0xf7))/0x9+-parseInt(_0x57260b(0xcb))/0xa*(-parseInt(_0x57260b(0x13a))/0xb);if(_0x159924===_0x1263c4)break;else _0x1e20e3['push'](_0x1e20e3['shift']());}catch(_0x406dc7){_0x1e20e3['push'](_0x1e20e3['shift']());}}}(a15_0x1a3b,0xbea15));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_0x202161 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';function handleInstallationError(_0x39933c,_0x48b090,_0x54974f,_0x23f717){const _0x52a5c9=a15_0x3080;errorContains(_0x39933c,_0x52a5c9(0xc8),_0x52a5c9(0xd0),_0x52a5c9(0xf2))?(_0x54974f['text']='✓\x20'+_0x48b090+'\x20already\x20configured',_0x23f717?.[_0x52a5c9(0x11b)](_0x48b090+_0x52a5c9(0xd7)),_0x39933c instanceof SDKError&&_0x39933c['cause']&&_0x23f717?.[_0x52a5c9(0xcd)]('Command\x20output:\x20'+_0x39933c[_0x52a5c9(0xd3)][_0x52a5c9(0xf3)])):(_0x54974f[_0x52a5c9(0xf0)]('Warning:\x20Failed\x20to\x20configure\x20'+_0x48b090),_0x23f717?.['error'](_0x48b090+_0x52a5c9(0x135),_0x39933c));}async function executeClaudeCommand(_0x1e1a3b,_0x3d53bf,_0x155650){const _0x21dd3c=a15_0x3080;return _0x155650?.[_0x21dd3c(0x11b)](_0x21dd3c(0x132)+_0x1e1a3b[_0x21dd3c(0xe5)]('\x20')),new Promise((_0x363647,_0x3bc647)=>{const _0x1662f5=_0x21dd3c,_0x2b1eb9=spawn(_0x1662f5(0x118),_0x1e1a3b,{'stdio':_0x1662f5(0x133)});let _0x443a98='',_0x2ac150='';_0x2b1eb9[_0x1662f5(0xe0)]['on'](_0x1662f5(0x127),_0x5d323a=>{const _0x2a651e=_0x1662f5;_0x443a98+=_0x5d323a[_0x2a651e(0x111)]();}),_0x2b1eb9[_0x1662f5(0xf4)]['on'](_0x1662f5(0x127),_0x2ee44b=>{const _0x9cc02a=_0x1662f5;_0x2ac150+=_0x2ee44b[_0x9cc02a(0x111)]();}),_0x2b1eb9['on'](_0x1662f5(0x109),_0x387bcd=>{const _0x548d2e=_0x1662f5;if(_0x387bcd===0x0)_0x363647(_0x443a98);else _0x3d53bf?(_0x155650?.[_0x548d2e(0xe7)](_0x548d2e(0x122)+_0x387bcd+'):\x20claude\x20'+_0x1e1a3b[_0x548d2e(0xe5)]('\x20')),_0x3bc647(new SDKError(ErrorCode[_0x548d2e(0x137)],_0x3d53bf,new Error(_0x2ac150)))):_0x363647('');});});}async function ensureMcpServer(_0x39ab1d,_0x5274e3,_0x38720a,_0x22d3ac,_0x29901a){const _0x2a0d7d=a15_0x3080;_0x22d3ac[_0x2a0d7d(0x102)]=_0x2a0d7d(0xf5)+_0x39ab1d+'\x27...',await executeClaudeCommand([_0x2a0d7d(0xdf),'add',_0x39ab1d,_0x5274e3,_0x2a0d7d(0x124),_0x38720a],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x39ab1d+'\x27',_0x29901a),_0x22d3ac[_0x2a0d7d(0x102)]=_0x2a0d7d(0xf8)+_0x39ab1d+_0x2a0d7d(0xc6);}async function ensureMarketplace(_0xb5c60,_0x57b055,_0x575ed5,_0x3a49af){const _0x4cc7a3=a15_0x3080;_0x575ed5[_0x4cc7a3(0x102)]=_0x4cc7a3(0xef)+_0xb5c60+'\x27...',await executeClaudeCommand([_0x4cc7a3(0xee),'marketplace','add',_0x57b055],_0x4cc7a3(0x12f)+_0xb5c60+'\x27',_0x3a49af),_0x575ed5['text']=_0x4cc7a3(0xcf)+_0xb5c60+_0x4cc7a3(0xc6);}async function updateMarketplace(_0x5e67fd,_0x207c1b,_0x1b72fd){const _0x318118=a15_0x3080;_0x207c1b['text']=_0x318118(0xd2)+_0x5e67fd+'\x27...',await executeClaudeCommand([_0x318118(0xee),'marketplace',_0x318118(0x12b)],_0x318118(0xd8)+_0x5e67fd+'\x27',_0x1b72fd),_0x207c1b[_0x318118(0x102)]=_0x318118(0xcf)+_0x5e67fd+_0x318118(0xe9);}function a15_0x1a3b(){const _0xe07fd9=['debug','env','✓\x20Marketplace\x20\x27','already\x20installed','proxy','Updating\x20marketplace\x20\x27','cause','ANTHROPIC_BASE_URL','ANTHROPIC_MODEL','workflow-skills','\x20already\x20configured','Failed\x20to\x20update\x20marketplace\x20\x27','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','install','getLogPath','35396WZqhqI','trim','start','mcp','stdout','statusLine','1848510PZhxGA','model','string','join','llm','error','green','\x27\x20updated','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','which','log','Initializing...','plugin','Configuring\x20marketplace\x20\x27','warn','TD\x20Docs\x20MCP\x20Server','already\x20configured','message','stderr','Configuring\x20MCP\x20server\x20\x27','Failed\x20to\x20launch\x20Claude\x20Code:\x20','9458343AOBAyX','✓\x20MCP\x20server\x20\x27','utf-8','execute','inherit','sonnet','\x27\x20installed','Failed\x20to\x20install\x20plugin\x20\x27','settings.local.json','tdx\x20--profile\x20','tdx\x20claude\x20statusline','text','localhost','parse','stringify','69eTZbbE','Claude\x20Code\x20CLI\x20not\x20found','✓\x20Logs\x20saved\x20to\x20','exit','server','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','1008420jvLiHI','Initializing\x20proxy\x20logger...','logger','338017zfSXDa','cwd','toString','1599913DSPiEe','stop','includes','COMMAND_NOT_FOUND','findClaudePath','✓\x20Settings\x20restored:\x20.claude/settings.local.json','claude','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','td-skills','info','✓\x20Plugin\x20\x27','sql-skills','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','close','getOrCreateDefaultProject','originalSettings','Command\x20failed\x20(exit\x20','https://docs.treasuredata.com/mcp','--transport','2vLLBtH','https://github.com/treasure-data/td-skills','data','td-skills\x20Plugins','tdx','name','update','fail','site','attributes','Failed\x20to\x20configure\x20marketplace\x20\x27','8vKkEpb','\x27...','Executing:\x20claude\x20','pipe','Setup\x20failed','\x20configuration\x20failed','init','INSTALLATION_FAILED','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Finding\x20available\x20port...','66ZOMnwX','http','command','\x27\x20configured','http://127.0.0.1:','already\x20exists','Starting\x20TD\x20LLM\x20proxy\x20server...','hostname','4507610BpLAnG','.claude'];a15_0x1a3b=function(){return _0xe07fd9;};return a15_0x1a3b();}async function ensurePlugin(_0x25ff94,_0x557b41,_0x4a6d23,_0x5cb6c2){const _0x2f957a=a15_0x3080;_0x4a6d23[_0x2f957a(0x102)]='Installing\x20plugin\x20\x27'+_0x25ff94+_0x2f957a(0x131),await executeClaudeCommand([_0x2f957a(0xee),_0x2f957a(0xda),_0x25ff94+'@'+_0x557b41],_0x2f957a(0xfe)+_0x25ff94+'\x27',_0x5cb6c2),_0x4a6d23[_0x2f957a(0x102)]=_0x2f957a(0x11c)+_0x25ff94+_0x2f957a(0xfd);}async function createClaudeSettings(_0x253c05,_0x66a7f5=a15_0x4f5c1e(0xfc),_0x4a72d3){const _0x2e1ab8=a15_0x4f5c1e,_0x454251=join(process[_0x2e1ab8(0x110)](),_0x2e1ab8(0xcc)),_0x563a52=join(_0x454251,_0x2e1ab8(0xff));await mkdir(_0x454251,{'recursive':!![]});let _0x1d5b16={};if(existsSync(_0x563a52))try{const _0x2796b0=await readFile(_0x563a52,_0x2e1ab8(0xf9));_0x1d5b16=JSON[_0x2e1ab8(0x104)](_0x2796b0);}catch{_0x1d5b16={};}const _0x2e85aa=_0x1d5b16[_0x2e1ab8(0xce)]||{},_0x5d3bca={'ANTHROPIC_BASE_URL':_0x2e85aa[_0x2e1ab8(0xd4)],'ANTHROPIC_MODEL':_0x2e85aa['ANTHROPIC_MODEL'],'statusLine':_0x1d5b16['statusLine']},_0x40e025={..._0x1d5b16,'env':{..._0x2e85aa,'ANTHROPIC_BASE_URL':_0x2e1ab8(0xc7)+_0x253c05,'ANTHROPIC_MODEL':_0x66a7f5},'statusLine':{'type':_0x2e1ab8(0x13c),'command':_0x4a72d3?_0x2e1ab8(0x100)+_0x4a72d3+'\x20claude\x20statusline':_0x2e1ab8(0x101)}};return await writeFile(_0x563a52,JSON[_0x2e1ab8(0x105)](_0x40e025,null,0x2)+'\x0a'),_0x5d3bca;}function a15_0x3080(_0x5ab275,_0x20ac5c){const _0x1a3b79=a15_0x1a3b();return a15_0x3080=function(_0x3080e6,_0x2cc339){_0x3080e6=_0x3080e6-0xc6;let _0x4c9e42=_0x1a3b79[_0x3080e6];return _0x4c9e42;},a15_0x3080(_0x5ab275,_0x20ac5c);}async function restoreClaudeSettings(_0x15e7af){const _0x59305d=a15_0x4f5c1e,_0x3a0e18=join(process[_0x59305d(0x110)](),'.claude'),_0x457941=join(_0x3a0e18,_0x59305d(0xff));if(!existsSync(_0x457941))return;try{const _0x44e874=await readFile(_0x457941,_0x59305d(0xf9)),_0x2c2ade=JSON['parse'](_0x44e874),_0x410653=_0x2c2ade[_0x59305d(0xce)]||{},_0x35eac3=_0x410653[_0x59305d(0xd4)],_0x3d8a49=((()=>{const _0x265a91=_0x59305d;if(typeof _0x35eac3!=='string')return![];try{const _0x53eaf6=new URL(_0x35eac3);return _0x53eaf6['hostname']===_0x265a91(0x103)||_0x53eaf6[_0x265a91(0xca)]==='127.0.0.1';}catch{return![];}})());_0x3d8a49?(delete _0x410653[_0x59305d(0xd4)],delete _0x410653['ANTHROPIC_MODEL']):(_0x15e7af['ANTHROPIC_BASE_URL']!==undefined?_0x410653[_0x59305d(0xd4)]=_0x15e7af['ANTHROPIC_BASE_URL']:delete _0x410653[_0x59305d(0xd4)],_0x15e7af[_0x59305d(0xd5)]!==undefined?_0x410653[_0x59305d(0xd5)]=_0x15e7af[_0x59305d(0xd5)]:delete _0x410653[_0x59305d(0xd5)]);const _0x24c2ae=_0x2c2ade['statusLine'],_0x493aee=((()=>{const _0x2b3c4b=_0x59305d;if(!_0x24c2ae||typeof _0x24c2ae!=='object')return![];if(_0x24c2ae['type']!=='command')return![];if(typeof _0x24c2ae[_0x2b3c4b(0x13c)]!==_0x2b3c4b(0xe4))return![];return _0x24c2ae[_0x2b3c4b(0x13c)][_0x2b3c4b(0x114)](_0x2b3c4b(0x129))&&_0x24c2ae['command'][_0x2b3c4b(0x114)]('statusline');})());if(_0x493aee)delete _0x2c2ade[_0x59305d(0xe1)];else _0x15e7af['statusLine']!==undefined?_0x2c2ade[_0x59305d(0xe1)]=_0x15e7af[_0x59305d(0xe1)]:delete _0x2c2ade[_0x59305d(0xe1)];_0x2c2ade[_0x59305d(0xce)]=_0x410653,await writeFile(_0x457941,JSON[_0x59305d(0x105)](_0x2c2ade,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a15_0x4f5c1e(0x12a)]=a15_0x4f5c1e(0x118);['description']=a15_0x4f5c1e(0xea);[a15_0x4f5c1e(0x10a)];[a15_0x4f5c1e(0x121)];[a15_0x4f5c1e(0x10e)];async[a15_0x4f5c1e(0xfa)](_0x5baa59){const _0x3f3f4b=a15_0x4f5c1e,{tdx:_0x31dcfc,options:_0x9b4193,args:_0x29a3c8}=_0x5baa59;try{const _0x221fd0=_0x9b4193,_0x5d425d=_0x221fd0[_0x3f3f4b(0xe3)]||_0x3f3f4b(0xfc),_0x39a0bc=_0x221fd0[_0x3f3f4b(0xd1)]===![],_0x204092=createCommandSpinner(_0x3f3f4b(0xed),{'verbose':_0x9b4193['verbose']});_0x204092[_0x3f3f4b(0xde)]();try{if(!_0x39a0bc){_0x204092[_0x3f3f4b(0x102)]=_0x3f3f4b(0x139);const _0x30b568=await findAvailablePort(0xfa0);_0x204092[_0x3f3f4b(0x102)]='✓\x20Port\x20'+_0x30b568,_0x204092[_0x3f3f4b(0x102)]='Setting\x20up\x20project...';const _0xf5a454=await _0x31dcfc[_0x3f3f4b(0xe6)][_0x3f3f4b(0x120)](),_0x464c66=_0xf5a454['id'];_0x204092[_0x3f3f4b(0x102)]='✓\x20Using\x20project:\x20'+_0xf5a454[_0x3f3f4b(0x12e)][_0x3f3f4b(0x12a)],_0x204092[_0x3f3f4b(0x102)]=_0x3f3f4b(0x10d),this[_0x3f3f4b(0x10e)]=new TDXLogger(_0x9b4193['logLevel'],!![]),await this[_0x3f3f4b(0x10e)][_0x3f3f4b(0x136)]();const _0x5eeed4=this[_0x3f3f4b(0x10e)]['getLogPath']();_0x204092[_0x3f3f4b(0x102)]='✓\x20Logging\x20to\x20'+_0x5eeed4,_0x204092[_0x3f3f4b(0x102)]=_0x3f3f4b(0xc9),this[_0x3f3f4b(0x10a)]=new ProxyServer({'port':_0x30b568,'projectId':_0x464c66,'tdx':_0x31dcfc,'logger':this[_0x3f3f4b(0x10e)],'site':_0x9b4193[_0x3f3f4b(0x12d)]}),await this[_0x3f3f4b(0x10a)][_0x3f3f4b(0xde)](),_0x204092['text']=_0x3f3f4b(0x119)+_0x30b568,_0x204092['text']='Creating\x20.claude/settings.local.json...';const _0x62b3b8=_0x9b4193['profile'];this[_0x3f3f4b(0x121)]=await createClaudeSettings(_0x30b568,_0x5d425d,_0x62b3b8),_0x204092['text']=_0x3f3f4b(0x138);}else _0x204092['text']=_0x3f3f4b(0xd9);try{await ensureMcpServer('td-docs',_0x3f3f4b(0x123),_0x3f3f4b(0x13b),_0x204092,this[_0x3f3f4b(0x10e)]);}catch(_0x4a159b){handleInstallationError(_0x4a159b,_0x3f3f4b(0xf1),_0x204092,this[_0x3f3f4b(0x10e)]);}try{await ensureMarketplace(_0x3f3f4b(0x11a),_0x3f3f4b(0x126),_0x204092,this[_0x3f3f4b(0x10e)]),await updateMarketplace(_0x3f3f4b(0x11a),_0x204092,this[_0x3f3f4b(0x10e)]),await ensurePlugin(_0x3f3f4b(0x11d),_0x3f3f4b(0x11a),_0x204092,this[_0x3f3f4b(0x10e)]),await ensurePlugin(_0x3f3f4b(0xd6),_0x3f3f4b(0x11a),_0x204092,this[_0x3f3f4b(0x10e)]),await ensurePlugin('tdx-skills',_0x3f3f4b(0x11a),_0x204092,this['logger']);}catch(_0x2c0864){handleInstallationError(_0x2c0864,_0x3f3f4b(0x128),_0x204092,this[_0x3f3f4b(0x10e)]);}_0x204092[_0x3f3f4b(0x113)]();}catch(_0x3d7358){_0x204092[_0x3f3f4b(0x12c)](_0x3f3f4b(0x134));throw _0x3d7358;}const _0x36e0ed=await this[_0x3f3f4b(0x116)]();if(!_0x36e0ed)throw new SDKError(ErrorCode[_0x3f3f4b(0x115)],_0x3f3f4b(0x107),undefined,{'helpText':_0x3f3f4b(0x11e)});const _0x10b434=spawn(_0x36e0ed,_0x29a3c8,{'stdio':_0x3f3f4b(0xfb)}),_0x52b123=await new Promise(_0x2740e4=>{const _0x47c826=_0x3f3f4b;_0x10b434['on'](_0x47c826(0x109),_0x5e3219=>{_0x2740e4(_0x5e3219||0x0);}),_0x10b434['on'](_0x47c826(0xe7),_0x408ef4=>{const _0x2408e3=_0x47c826;console['error'](a15_0x202161['red'](_0x2408e3(0xf6)+_0x408ef4['message'])),_0x2740e4(0x1);});});this['server']&&(await this[_0x3f3f4b(0x10a)][_0x3f3f4b(0x113)](),console['log'](a15_0x202161[_0x3f3f4b(0xe8)](_0x3f3f4b(0x10b))));if(this['logger']){await this['logger'][_0x3f3f4b(0x11f)]();const _0x1b23ed=this[_0x3f3f4b(0x10e)][_0x3f3f4b(0xdb)]();console[_0x3f3f4b(0xec)](a15_0x202161[_0x3f3f4b(0xe8)](_0x3f3f4b(0x108)+_0x1b23ed));}return this[_0x3f3f4b(0x121)]&&(await restoreClaudeSettings(this['originalSettings']),console[_0x3f3f4b(0xec)](a15_0x202161[_0x3f3f4b(0xe8)](_0x3f3f4b(0x117)))),_0x52b123;}catch(_0x286b54){this['server']&&await this[_0x3f3f4b(0x10a)][_0x3f3f4b(0x113)]();this[_0x3f3f4b(0x10e)]&&await this[_0x3f3f4b(0x10e)][_0x3f3f4b(0x11f)]();this[_0x3f3f4b(0x121)]&&await restoreClaudeSettings(this[_0x3f3f4b(0x121)]);throw _0x286b54;}}async[a15_0x4f5c1e(0x116)](){return new Promise(_0x2287cd=>{const _0x32ad68=a15_0x3080,_0x5a382b=spawn(_0x32ad68(0xeb),[_0x32ad68(0x118)]);let _0x279695='';_0x5a382b[_0x32ad68(0xe0)]['on'](_0x32ad68(0x127),_0x5d433b=>{const _0x30ea99=_0x32ad68;_0x279695+=_0x5d433b[_0x30ea99(0x111)]();}),_0x5a382b['on'](_0x32ad68(0x109),_0x37f255=>{const _0x3257d8=_0x32ad68;_0x37f255===0x0&&_0x279695[_0x3257d8(0xdd)]()?_0x2287cd(_0x279695[_0x3257d8(0xdd)]()):_0x2287cd(_0x3257d8(0x118));});});}}
@@ -1 +1 @@
1
- const a16_0x2ba4ff=a16_0x30da;(function(_0x316918,_0x5b68aa){const _0x52623e=a16_0x30da,_0x2ddfa2=_0x316918();while(!![]){try{const _0x2ed54e=parseInt(_0x52623e(0xc8))/0x1+-parseInt(_0x52623e(0xc4))/0x2*(-parseInt(_0x52623e(0xc5))/0x3)+parseInt(_0x52623e(0xd2))/0x4+parseInt(_0x52623e(0xca))/0x5*(parseInt(_0x52623e(0xb6))/0x6)+parseInt(_0x52623e(0xbd))/0x7*(-parseInt(_0x52623e(0xc0))/0x8)+-parseInt(_0x52623e(0xc3))/0x9*(parseInt(_0x52623e(0xd5))/0xa)+parseInt(_0x52623e(0xc6))/0xb*(-parseInt(_0x52623e(0xba))/0xc);if(_0x2ed54e===_0x5b68aa)break;else _0x2ddfa2['push'](_0x2ddfa2['shift']());}catch(_0x567517){_0x2ddfa2['push'](_0x2ddfa2['shift']());}}}(a16_0xc5fe,0xc8d46));import{createInterface}from'node:readline';function a16_0xc5fe(){const _0x345ea2=['Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','close','9RGWHku','254LprBQS','23334FBOYdN','11qlvocd','latestInputTokens','1405704nQgWXE','\x20today\x20/\x20','1075suVsiq','execute','model','stdin','Claude','parse','\x20|\x20','🧠\x20','3968928jEUlTs','\x20session\x20/\x20','toFixed','15532290dkGNqo','monthCredits','log','todayCredits','9678VhEYiQ','🤖\x20tdx\x20-\x20Claude','description','\x20month','7027008vpaiuz','push','join','21yTMcoe','🤖\x20tdx\x20-\x20','options','2056336GJbioP'];a16_0xc5fe=function(){return _0x345ea2;};return a16_0xc5fe();}import{BaseCommand}from'./command.js';function a16_0x30da(_0x46ee21,_0x1937cf){const _0xc5fe44=a16_0xc5fe();return a16_0x30da=function(_0x30da2c,_0x5191e1){_0x30da2c=_0x30da2c-0xb5;let _0x54f48c=_0xc5fe44[_0x30da2c];return _0x54f48c;},a16_0x30da(_0x46ee21,_0x1937cf);}import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../utils/model-factors.js';async function readStdinJson(_0x2654ac=0x64){return new Promise(_0x446cc8=>{const _0x47ef59=a16_0x30da;let _0x31948d='',_0x3dc88f=![];const _0x35a8da=createInterface({'input':process[_0x47ef59(0xcd)],'terminal':![]}),_0x2eeb94=_0x1d0732=>{const _0x17e3f4=_0x47ef59;if(_0x3dc88f)return;_0x3dc88f=!![],clearTimeout(_0x1f57e8),_0x35a8da[_0x17e3f4(0xc2)](),_0x446cc8(_0x1d0732);},_0x1f57e8=setTimeout(()=>{_0x2eeb94(null);},_0x2654ac);_0x35a8da['on']('line',_0x485eb1=>{_0x31948d+=_0x485eb1;}),_0x35a8da['on'](_0x47ef59(0xc2),()=>{const _0x414aec=_0x47ef59;if(_0x3dc88f)return;try{const _0x437d97=JSON[_0x414aec(0xcf)](_0x31948d);_0x2eeb94(_0x437d97);}catch{_0x2eeb94(null);}});});}function formatCredits(_0x425040){const _0x5162ac=a16_0x30da;return _0x425040[_0x5162ac(0xd4)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{['name']='statusline';[a16_0x2ba4ff(0xb8)]=a16_0x2ba4ff(0xc1);async[a16_0x2ba4ff(0xcb)](_0x4f20c2){const _0x1738f3=a16_0x2ba4ff;try{const _0x82e98a=await readStdinJson();if(!_0x82e98a?.['session_id'])return console['log'](_0x1738f3(0xb7)),0x0;const _0xa2fc2a=_0x82e98a['session_id'],_0x2d48d1=_0x82e98a[_0x1738f3(0xcc)]?.['id']||'',_0x56d283=_0x82e98a['profile']||_0x4f20c2[_0x1738f3(0xbf)]['profile'],_0x40a725=await getUsageStats(_0xa2fc2a,_0x56d283),_0x400279=[],_0x6a0c4f=_0x2d48d1?getModelDisplayName(_0x2d48d1):_0x1738f3(0xce);_0x400279[_0x1738f3(0xbb)](_0x1738f3(0xbe)+_0x6a0c4f);const _0x3d9fa8=formatCredits(_0x40a725['sessionCredits']),_0x969b55=formatCredits(_0x40a725[_0x1738f3(0xb5)]),_0x45de5d=formatCredits(_0x40a725[_0x1738f3(0xd6)]);_0x400279[_0x1738f3(0xbb)]('🪙\x20credit:\x20'+_0x3d9fa8+_0x1738f3(0xd3)+_0x969b55+_0x1738f3(0xc9)+_0x45de5d+_0x1738f3(0xb9));if(_0x40a725[_0x1738f3(0xc7)]>0x0&&_0x2d48d1){const _0xab778f=formatTokenCount(_0x40a725[_0x1738f3(0xc7)]),_0x5ebecb=calculateContextPercentage(_0x40a725[_0x1738f3(0xc7)],_0x2d48d1);_0x400279['push'](_0x1738f3(0xd1)+_0xab778f+'\x20('+_0x5ebecb+'%)');}return console['log'](_0x400279[_0x1738f3(0xbc)](_0x1738f3(0xd0))),0x0;}catch{return console[_0x1738f3(0xd7)](_0x1738f3(0xb7)),0x0;}}}
1
+ const a16_0x563944=a16_0x517f;(function(_0x3100cf,_0x466599){const _0x4477d0=a16_0x517f,_0x7cdefc=_0x3100cf();while(!![]){try{const _0x550e9c=parseInt(_0x4477d0(0x125))/0x1+parseInt(_0x4477d0(0x132))/0x2+parseInt(_0x4477d0(0x13b))/0x3+parseInt(_0x4477d0(0x12d))/0x4+-parseInt(_0x4477d0(0x134))/0x5*(parseInt(_0x4477d0(0x12e))/0x6)+-parseInt(_0x4477d0(0x120))/0x7*(parseInt(_0x4477d0(0x11d))/0x8)+-parseInt(_0x4477d0(0x11c))/0x9;if(_0x550e9c===_0x466599)break;else _0x7cdefc['push'](_0x7cdefc['shift']());}catch(_0x5d9e55){_0x7cdefc['push'](_0x7cdefc['shift']());}}}(a16_0x3661,0xc039f));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';function a16_0x517f(_0x25cf69,_0x3283d3){const _0x36619e=a16_0x3661();return a16_0x517f=function(_0x517f7b,_0x55dee7){_0x517f7b=_0x517f7b-0x11b;let _0x2fb0d9=_0x36619e[_0x517f7b];return _0x2fb0d9;},a16_0x517f(_0x25cf69,_0x3283d3);}import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a16_0x3661(){const _0x42ebf1=['toFixed','🧠\x20','monthCredits','1365319wNKfpF','close','🪙\x20credit:\x20','latestInputTokens','statusline','profile','todayCredits','push','1685100NkOpPn','6kUCgFl','model','sessionCredits','parse','1073434pjTGoC','session_id','5183410mJbfjf','join','\x20|\x20','\x20session\x20/\x20','stdin','description','execute','4262814aXCQsa','\x20today\x20/\x20','log','17070228WWbEeb','47032OSFMEP','🤖\x20tdx\x20-\x20Claude','\x20month','28BEscQB','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)'];a16_0x3661=function(){return _0x42ebf1;};return a16_0x3661();}import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../utils/model-factors.js';async function readStdinJson(_0x4ef958=0x64){return new Promise(_0x20da42=>{const _0x2bdf35=a16_0x517f;let _0x37826f='',_0x16e89d=![];const _0x22485e=createInterface({'input':process[_0x2bdf35(0x138)],'terminal':![]}),_0x34d644=_0x40441e=>{const _0x4734b7=_0x2bdf35;if(_0x16e89d)return;_0x16e89d=!![],clearTimeout(_0x1be75f),_0x22485e[_0x4734b7(0x126)](),_0x20da42(_0x40441e);},_0x1be75f=setTimeout(()=>{_0x34d644(null);},_0x4ef958);_0x22485e['on']('line',_0x3eafa6=>{_0x37826f+=_0x3eafa6;}),_0x22485e['on']('close',()=>{const _0x579509=_0x2bdf35;if(_0x16e89d)return;try{const _0x3976d2=JSON[_0x579509(0x131)](_0x37826f);_0x34d644(_0x3976d2);}catch{_0x34d644(null);}});});}function formatCredits(_0x7870f6){const _0x16c2dd=a16_0x517f;return _0x7870f6[_0x16c2dd(0x122)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a16_0x563944(0x129);[a16_0x563944(0x139)]=a16_0x563944(0x121);async[a16_0x563944(0x13a)](_0x35a29b){const _0x453b44=a16_0x563944;try{const _0x9aeb96=await readStdinJson();if(!_0x9aeb96?.[_0x453b44(0x133)])return console['log'](_0x453b44(0x11e)),0x0;const _0x15ee05=_0x9aeb96[_0x453b44(0x133)],_0xaba01d=_0x9aeb96[_0x453b44(0x12f)]?.['id']||'',_0x310798=_0x9aeb96['profile']||_0x35a29b['options'][_0x453b44(0x12a)],_0x13a51f=await getUsageStats(_0x15ee05,_0x310798),_0x35a448=[],_0x21d7d1=_0xaba01d?getModelDisplayName(_0xaba01d):'Claude';_0x35a448[_0x453b44(0x12c)]('🤖\x20tdx\x20-\x20'+_0x21d7d1);const _0x2f798d=formatCredits(_0x13a51f[_0x453b44(0x130)]),_0x520669=formatCredits(_0x13a51f[_0x453b44(0x12b)]),_0x11cc4c=formatCredits(_0x13a51f[_0x453b44(0x124)]);_0x35a448[_0x453b44(0x12c)](_0x453b44(0x127)+_0x2f798d+_0x453b44(0x137)+_0x520669+_0x453b44(0x13c)+_0x11cc4c+_0x453b44(0x11f));if(_0x13a51f[_0x453b44(0x128)]>0x0&&_0xaba01d){const _0x14883f=formatTokenCount(_0x13a51f[_0x453b44(0x128)]),_0x2b7859=calculateContextPercentage(_0x13a51f[_0x453b44(0x128)],_0xaba01d);_0x35a448[_0x453b44(0x12c)](_0x453b44(0x123)+_0x14883f+'\x20('+_0x2b7859+'%)');}return console[_0x453b44(0x11b)](_0x35a448[_0x453b44(0x135)](_0x453b44(0x136))),0x0;}catch{return console[_0x453b44(0x11b)](_0x453b44(0x11e)),0x0;}}}
@@ -1 +1 @@
1
- function a17_0x1ee2(){const _0x426bc9=['all','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','never','entryCount','todayCredits','length','execute','bold','(default)','Credits','2-digit','credits','message','numeric','lastUsedAt','totalCredits','outputTable','Usage\x20by\x20Profile','Unknown\x20error','repeat','padEnd','outputStructured','toLocaleTimeString','monthCredits','Requests','dim','16DWnZqO','2306316xcNjcp','1047261NjAIhY','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','usage','profileCount','log','default','toFixed','en-US','5svDxyf','\x20\x20Today:\x20\x20\x20','2772518habJVY','toLocaleDateString','round','profile','name','short','max','4035213yQbCzY','\x20days\x20ago','today\x20','6647118tTHNCQ','map','padStart','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','error','cyan','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','json','Error:\x20','54jVeZou','en-CA','getTime','39583bnQcbh','\x20\x20Total:\x20\x20\x20','\x20credits','29514790QQMhmC'];a17_0x1ee2=function(){return _0x426bc9;};return a17_0x1ee2();}const a17_0x2d123c=a17_0x580f;(function(_0x512b8e,_0x1c9ea2){const _0x308ccb=a17_0x580f,_0x39b260=_0x512b8e();while(!![]){try{const _0x1b2ade=-parseInt(_0x308ccb(0x186))/0x1*(-parseInt(_0x308ccb(0x183))/0x2)+-parseInt(_0x308ccb(0x166))/0x3+parseInt(_0x308ccb(0x165))/0x4+-parseInt(_0x308ccb(0x16e))/0x5*(-parseInt(_0x308ccb(0x17a))/0x6)+parseInt(_0x308ccb(0x170))/0x7*(parseInt(_0x308ccb(0x164))/0x8)+parseInt(_0x308ccb(0x177))/0x9+-parseInt(_0x308ccb(0x149))/0xa;if(_0x1b2ade===_0x1c9ea2)break;else _0x39b260['push'](_0x39b260['shift']());}catch(_0x855601){_0x39b260['push'](_0x39b260['shift']());}}}(a17_0x1ee2,0xa9378));import a17_0x273368 from'chalk';function a17_0x580f(_0x51d4d4,_0x4b7339){const _0x1ee213=a17_0x1ee2();return a17_0x580f=function(_0x580fbd,_0x5ef29c){_0x580fbd=_0x580fbd-0x148;let _0x2176bf=_0x1ee213[_0x580fbd];return _0x2176bf;},a17_0x580f(_0x51d4d4,_0x4b7339);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x354afe){const _0x511236=a17_0x580f;return _0x354afe[_0x511236(0x16c)](0x2);}function formatLastUsed(_0x34bc4f){const _0x3bcf97=a17_0x580f;if(!_0x34bc4f)return _0x3bcf97(0x14c);const _0x2f6904=new Date(_0x34bc4f),_0x3f0fe3=new Date(),_0x50eec3=_0x2f6904[_0x3bcf97(0x171)](_0x3bcf97(0x184)),_0xa52516=_0x3f0fe3[_0x3bcf97(0x171)]('en-CA');if(_0x50eec3===_0xa52516)return _0x3bcf97(0x179)+_0x2f6904[_0x3bcf97(0x160)](_0x3bcf97(0x16d),{'hour':_0x3bcf97(0x154),'minute':_0x3bcf97(0x154)});const _0x6c64bb=new Date(_0x50eec3),_0xb0d35d=new Date(_0xa52516),_0x5e4304=Math[_0x3bcf97(0x172)]((_0xb0d35d[_0x3bcf97(0x185)]()-_0x6c64bb[_0x3bcf97(0x185)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5e4304===0x1)return'yesterday';else return _0x5e4304>0x1&&_0x5e4304<0x7?_0x5e4304+_0x3bcf97(0x178):_0x2f6904[_0x3bcf97(0x171)](_0x3bcf97(0x16d),{'month':_0x3bcf97(0x175),'day':_0x3bcf97(0x157)});}export class ClaudeUsageCommand extends BaseCommand{[a17_0x2d123c(0x174)]=a17_0x2d123c(0x168);['description']=a17_0x2d123c(0x14b);async[a17_0x2d123c(0x150)](_0xc62e54){const _0x1d668d=a17_0x2d123c,{options:_0x46bac7}=_0xc62e54,_0x48d8e5=_0x46bac7['format']===_0x1d668d(0x181)||_0x46bac7['format']==='jsonl'||_0x46bac7[_0x1d668d(0x181)];try{const [_0x2613d7,_0x39a2d9]=await Promise[_0x1d668d(0x14a)]([getAllProfileStats(),getUsageSummary()]);return _0x48d8e5?await this[_0x1d668d(0x15f)](_0x2613d7,_0x39a2d9,_0x46bac7):this[_0x1d668d(0x15a)](_0x2613d7,_0x39a2d9),0x0;}catch(_0x18f642){const _0xd0ac5e=_0x18f642 instanceof Error?_0x18f642[_0x1d668d(0x156)]:_0x1d668d(0x15c);return console[_0x1d668d(0x17e)](a17_0x273368['red'](_0x1d668d(0x182)+_0xd0ac5e)),0x1;}}async['outputStructured'](_0x140089,_0x43233c,_0x3663f9){const _0x557c49=a17_0x2d123c,_0x584d10={'summary':{'todayCredits':_0x43233c['todayCredits'],'monthCredits':_0x43233c[_0x557c49(0x161)],'totalCredits':_0x43233c[_0x557c49(0x159)],'profileCount':_0x43233c[_0x557c49(0x169)]},'profiles':_0x140089[_0x557c49(0x17b)](_0x50ffcf=>({'profile':_0x50ffcf[_0x557c49(0x173)],'credits':_0x50ffcf[_0x557c49(0x155)],'requests':_0x50ffcf[_0x557c49(0x14d)],'lastUsedAt':_0x50ffcf[_0x557c49(0x158)]}))};await handleSDKOutput([_0x584d10],_0x3663f9);}[a17_0x2d123c(0x15a)](_0x453013,_0x43974a){const _0x3732a8=a17_0x2d123c;console[_0x3732a8(0x16a)](a17_0x273368[_0x3732a8(0x151)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console[_0x3732a8(0x16a)](a17_0x273368[_0x3732a8(0x163)]('─'[_0x3732a8(0x15d)](0x32))),console[_0x3732a8(0x16a)](_0x3732a8(0x16f)+a17_0x273368[_0x3732a8(0x17f)](formatCredits(_0x43974a[_0x3732a8(0x14e)]))+_0x3732a8(0x148)),console['log']('\x20\x20Month:\x20\x20\x20'+a17_0x273368['cyan'](formatCredits(_0x43974a[_0x3732a8(0x161)]))+_0x3732a8(0x148)),console[_0x3732a8(0x16a)](_0x3732a8(0x187)+a17_0x273368[_0x3732a8(0x17f)](formatCredits(_0x43974a[_0x3732a8(0x159)]))+_0x3732a8(0x148)),console[_0x3732a8(0x16a)]();if(_0x453013[_0x3732a8(0x14f)]===0x0){console['log'](a17_0x273368[_0x3732a8(0x163)](_0x3732a8(0x17d))),console[_0x3732a8(0x16a)](a17_0x273368['dim'](_0x3732a8(0x167)));return;}console[_0x3732a8(0x16a)](a17_0x273368[_0x3732a8(0x151)](_0x3732a8(0x15b))),console[_0x3732a8(0x16a)](a17_0x273368[_0x3732a8(0x163)]('─'[_0x3732a8(0x15d)](0x3c)));const _0x15c4cd=Math[_0x3732a8(0x176)](0xc,..._0x453013[_0x3732a8(0x17b)](_0x31a6f2=>_0x31a6f2[_0x3732a8(0x173)]===_0x3732a8(0x16b)?_0x3732a8(0x152)[_0x3732a8(0x14f)]:_0x31a6f2['profile'][_0x3732a8(0x14f)])),_0x5ea5d5=0xa,_0x365db0=0xa;console[_0x3732a8(0x16a)]('\x20\x20'+'Profile'[_0x3732a8(0x15e)](_0x15c4cd)+'\x20\x20'+_0x3732a8(0x153)[_0x3732a8(0x17c)](_0x5ea5d5)+'\x20\x20'+_0x3732a8(0x162)[_0x3732a8(0x17c)](_0x365db0)+'\x20\x20'+'Last\x20Used');for(const _0x57d197 of _0x453013){const _0x596625=_0x57d197[_0x3732a8(0x173)]===_0x3732a8(0x16b)?_0x3732a8(0x152):_0x57d197['profile'],_0x227412=_0x596625[_0x3732a8(0x15e)](_0x15c4cd),_0x4882fa=_0x57d197[_0x3732a8(0x173)]===_0x3732a8(0x16b)?a17_0x273368['dim'](_0x227412):_0x227412;console['log']('\x20\x20'+_0x4882fa+'\x20\x20'+a17_0x273368[_0x3732a8(0x17f)](formatCredits(_0x57d197[_0x3732a8(0x155)])[_0x3732a8(0x17c)](_0x5ea5d5))+'\x20\x20'+String(_0x57d197[_0x3732a8(0x14d)])['padStart'](_0x365db0)+'\x20\x20'+a17_0x273368['dim'](formatLastUsed(_0x57d197['lastUsedAt'])));}console[_0x3732a8(0x16a)](),console[_0x3732a8(0x16a)](a17_0x273368['dim'](_0x3732a8(0x180))),console[_0x3732a8(0x16a)]();}}
1
+ const a17_0x116bd7=a17_0x1992;(function(_0x462f9b,_0x4d1727){const _0x426ea3=a17_0x1992,_0x574f66=_0x462f9b();while(!![]){try{const _0x429d92=-parseInt(_0x426ea3(0x1ab))/0x1*(parseInt(_0x426ea3(0x17a))/0x2)+-parseInt(_0x426ea3(0x184))/0x3+-parseInt(_0x426ea3(0x186))/0x4+parseInt(_0x426ea3(0x187))/0x5*(parseInt(_0x426ea3(0x171))/0x6)+parseInt(_0x426ea3(0x1a6))/0x7+-parseInt(_0x426ea3(0x1a0))/0x8*(parseInt(_0x426ea3(0x1a1))/0x9)+parseInt(_0x426ea3(0x1aa))/0xa*(parseInt(_0x426ea3(0x1af))/0xb);if(_0x429d92===_0x4d1727)break;else _0x574f66['push'](_0x574f66['shift']());}catch(_0x3f849d){_0x574f66['push'](_0x574f66['shift']());}}}(a17_0x4d7d,0xab6cf));import a17_0x5bc90f from'chalk';import{BaseCommand}from'./command.js';function a17_0x1992(_0x527a45,_0x5191fa){const _0x4d7dd2=a17_0x4d7d();return a17_0x1992=function(_0x1992dd,_0x48e0de){_0x1992dd=_0x1992dd-0x16e;let _0x2b27df=_0x4d7dd2[_0x1992dd];return _0x2b27df;},a17_0x1992(_0x527a45,_0x5191fa);}import{handleSDKOutput}from'../utils/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x3633fb){const _0x2f6720=a17_0x1992;return _0x3633fb[_0x2f6720(0x194)](0x2);}function formatLastUsed(_0x57b63e){const _0x25a36e=a17_0x1992;if(!_0x57b63e)return _0x25a36e(0x197);const _0x3735e4=new Date(_0x57b63e),_0x2c5c5b=new Date(),_0x596841=_0x3735e4[_0x25a36e(0x19d)](_0x25a36e(0x1ac)),_0x3283dc=_0x2c5c5b[_0x25a36e(0x19d)](_0x25a36e(0x1ac));if(_0x596841===_0x3283dc)return _0x25a36e(0x172)+_0x3735e4[_0x25a36e(0x18d)](_0x25a36e(0x183),{'hour':_0x25a36e(0x19e),'minute':_0x25a36e(0x19e)});const _0x16fb99=new Date(_0x596841),_0xcd9c61=new Date(_0x3283dc),_0x46ee94=Math[_0x25a36e(0x198)]((_0xcd9c61[_0x25a36e(0x1a4)]()-_0x16fb99['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x46ee94===0x1)return _0x25a36e(0x17b);else return _0x46ee94>0x1&&_0x46ee94<0x7?_0x46ee94+_0x25a36e(0x1a9):_0x3735e4['toLocaleDateString'](_0x25a36e(0x183),{'month':_0x25a36e(0x18e),'day':_0x25a36e(0x19c)});}function a17_0x4d7d(){const _0x12be8a=['totalCredits','\x20credits','en-US','2417499fEJxcj','json','4003140VjffyL','3282990tkYFKu','map','jsonl','profileCount','profile','outputTable','toLocaleTimeString','short','Profile','max','all','(default)','red','toFixed','Requests','padStart','never','round','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','bold','name','numeric','toLocaleDateString','2-digit','length','688rrTbso','38853KYwbdG','usage','todayCredits','getTime','repeat','6767446dZASsu','log','execute','\x20days\x20ago','10kfxibv','586WbsbEU','en-CA','Usage\x20by\x20Profile','entryCount','17955179ZsaAZJ','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','\x20\x20Month:\x20\x20\x20','Credits','Unknown\x20error','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Last\x20Used','format','6IkacFE','today\x20','monthCredits','message','padEnd','description','credits','\x20\x20Total:\x20\x20\x20','Error:\x20','1282GMGCwf','yesterday','dim','cyan','lastUsedAt','outputStructured','default'];a17_0x4d7d=function(){return _0x12be8a;};return a17_0x4d7d();}export class ClaudeUsageCommand extends BaseCommand{[a17_0x116bd7(0x19b)]=a17_0x116bd7(0x1a2);[a17_0x116bd7(0x176)]='Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile';async[a17_0x116bd7(0x1a8)](_0x55020c){const _0x48c0a0=a17_0x116bd7,{options:_0x4b9c5b}=_0x55020c,_0x2192ec=_0x4b9c5b[_0x48c0a0(0x170)]===_0x48c0a0(0x185)||_0x4b9c5b['format']===_0x48c0a0(0x189)||_0x4b9c5b[_0x48c0a0(0x185)];try{const [_0x2d3cae,_0x20b424]=await Promise[_0x48c0a0(0x191)]([getAllProfileStats(),getUsageSummary()]);return _0x2192ec?await this['outputStructured'](_0x2d3cae,_0x20b424,_0x4b9c5b):this[_0x48c0a0(0x18c)](_0x2d3cae,_0x20b424),0x0;}catch(_0x111bae){const _0x5a9420=_0x111bae instanceof Error?_0x111bae[_0x48c0a0(0x174)]:_0x48c0a0(0x1b3);return console['error'](a17_0x5bc90f[_0x48c0a0(0x193)](_0x48c0a0(0x179)+_0x5a9420)),0x1;}}async[a17_0x116bd7(0x17f)](_0x7e56df,_0x2afbd6,_0x370c29){const _0x410a01=a17_0x116bd7,_0x2e6cdb={'summary':{'todayCredits':_0x2afbd6[_0x410a01(0x1a3)],'monthCredits':_0x2afbd6[_0x410a01(0x173)],'totalCredits':_0x2afbd6[_0x410a01(0x181)],'profileCount':_0x2afbd6[_0x410a01(0x18a)]},'profiles':_0x7e56df[_0x410a01(0x188)](_0x45f9c3=>({'profile':_0x45f9c3[_0x410a01(0x18b)],'credits':_0x45f9c3[_0x410a01(0x177)],'requests':_0x45f9c3['entryCount'],'lastUsedAt':_0x45f9c3[_0x410a01(0x17e)]}))};await handleSDKOutput([_0x2e6cdb],_0x370c29);}[a17_0x116bd7(0x18c)](_0x14557f,_0x255c20){const _0x5b8de9=a17_0x116bd7;console[_0x5b8de9(0x1a7)](a17_0x5bc90f[_0x5b8de9(0x19a)](_0x5b8de9(0x1b4))),console['log'](a17_0x5bc90f[_0x5b8de9(0x17c)]('─'[_0x5b8de9(0x1a5)](0x32))),console[_0x5b8de9(0x1a7)]('\x20\x20Today:\x20\x20\x20'+a17_0x5bc90f[_0x5b8de9(0x17d)](formatCredits(_0x255c20[_0x5b8de9(0x1a3)]))+_0x5b8de9(0x182)),console[_0x5b8de9(0x1a7)](_0x5b8de9(0x1b1)+a17_0x5bc90f['cyan'](formatCredits(_0x255c20[_0x5b8de9(0x173)]))+_0x5b8de9(0x182)),console['log'](_0x5b8de9(0x178)+a17_0x5bc90f[_0x5b8de9(0x17d)](formatCredits(_0x255c20['totalCredits']))+_0x5b8de9(0x182)),console[_0x5b8de9(0x1a7)]();if(_0x14557f[_0x5b8de9(0x19f)]===0x0){console[_0x5b8de9(0x1a7)](a17_0x5bc90f[_0x5b8de9(0x17c)](_0x5b8de9(0x16e))),console[_0x5b8de9(0x1a7)](a17_0x5bc90f[_0x5b8de9(0x17c)](_0x5b8de9(0x199)));return;}console[_0x5b8de9(0x1a7)](a17_0x5bc90f[_0x5b8de9(0x19a)](_0x5b8de9(0x1ad))),console[_0x5b8de9(0x1a7)](a17_0x5bc90f[_0x5b8de9(0x17c)]('─'['repeat'](0x3c)));const _0x6454e2=Math[_0x5b8de9(0x190)](0xc,..._0x14557f[_0x5b8de9(0x188)](_0x2628d2=>_0x2628d2[_0x5b8de9(0x18b)]===_0x5b8de9(0x180)?'(default)'[_0x5b8de9(0x19f)]:_0x2628d2[_0x5b8de9(0x18b)][_0x5b8de9(0x19f)])),_0x586937=0xa,_0x25c970=0xa;console[_0x5b8de9(0x1a7)]('\x20\x20'+_0x5b8de9(0x18f)[_0x5b8de9(0x175)](_0x6454e2)+'\x20\x20'+_0x5b8de9(0x1b2)[_0x5b8de9(0x196)](_0x586937)+'\x20\x20'+_0x5b8de9(0x195)[_0x5b8de9(0x196)](_0x25c970)+'\x20\x20'+_0x5b8de9(0x16f));for(const _0x173639 of _0x14557f){const _0xa9bce1=_0x173639[_0x5b8de9(0x18b)]===_0x5b8de9(0x180)?_0x5b8de9(0x192):_0x173639[_0x5b8de9(0x18b)],_0x493da9=_0xa9bce1[_0x5b8de9(0x175)](_0x6454e2),_0x53ad5d=_0x173639[_0x5b8de9(0x18b)]==='default'?a17_0x5bc90f[_0x5b8de9(0x17c)](_0x493da9):_0x493da9;console[_0x5b8de9(0x1a7)]('\x20\x20'+_0x53ad5d+'\x20\x20'+a17_0x5bc90f[_0x5b8de9(0x17d)](formatCredits(_0x173639[_0x5b8de9(0x177)])['padStart'](_0x586937))+'\x20\x20'+String(_0x173639[_0x5b8de9(0x1ae)])['padStart'](_0x25c970)+'\x20\x20'+a17_0x5bc90f[_0x5b8de9(0x17c)](formatLastUsed(_0x173639['lastUsedAt'])));}console[_0x5b8de9(0x1a7)](),console[_0x5b8de9(0x1a7)](a17_0x5bc90f[_0x5b8de9(0x17c)](_0x5b8de9(0x1b0))),console['log']();}}
@@ -1 +1 @@
1
- const a18_0x50a557=a18_0x5b30;(function(_0x23cf45,_0x498450){const _0x37bbec=a18_0x5b30,_0x55ab67=_0x23cf45();while(!![]){try{const _0x598aa3=parseInt(_0x37bbec(0x84))/0x1*(parseInt(_0x37bbec(0xab))/0x2)+-parseInt(_0x37bbec(0x83))/0x3*(parseInt(_0x37bbec(0x96))/0x4)+parseInt(_0x37bbec(0x89))/0x5+parseInt(_0x37bbec(0x8b))/0x6*(-parseInt(_0x37bbec(0x90))/0x7)+-parseInt(_0x37bbec(0x81))/0x8*(-parseInt(_0x37bbec(0x99))/0x9)+parseInt(_0x37bbec(0xa0))/0xa*(parseInt(_0x37bbec(0x8f))/0xb)+-parseInt(_0x37bbec(0x85))/0xc*(parseInt(_0x37bbec(0xa9))/0xd);if(_0x598aa3===_0x498450)break;else _0x55ab67['push'](_0x55ab67['shift']());}catch(_0x467e17){_0x55ab67['push'](_0x55ab67['shift']());}}}(a18_0x11aa,0x1881a));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a18_0x20feed from'chalk';export function printAuthError(_0x14856e,_0x3db56d=![],_0x25b9ef){const _0x48a0b6=a18_0x5b30,_0x43dd37=_0x14856e[_0x48a0b6(0x95)]?.['detail']||_0x14856e[_0x48a0b6(0x9a)];console[_0x48a0b6(0xa5)](a18_0x20feed[_0x48a0b6(0x8d)](_0x48a0b6(0x9f))),console[_0x48a0b6(0xa5)](a18_0x20feed[_0x48a0b6(0x8d)](_0x48a0b6(0xae)+_0x43dd37));if(_0x3db56d){const _0x5786c7=_0x25b9ef?_0x48a0b6(0x7c)+_0x25b9ef:'';console['error']('\x0aTo\x20set\x20up\x20authentication:'),console['error'](_0x48a0b6(0x93)+_0x5786c7+'\x0a'),console[_0x48a0b6(0xa5)](_0x48a0b6(0xac)),console[_0x48a0b6(0xa5)](_0x48a0b6(0x9d)+_0x5786c7);}}export class BaseCommand{[a18_0x50a557(0xa4)](_0x3f7afb){const _0x1c4fb6=a18_0x50a557,{options:_0x33f1e7}=_0x3f7afb,_0x3baf98=_0x33f1e7[_0x1c4fb6(0x8e)];if(_0x3baf98!==undefined){const _0x10cb60=typeof _0x3baf98===_0x1c4fb6(0xa6)?_0x3baf98:parseInt(_0x3baf98,0xa);if(isNaN(_0x10cb60))return'Invalid\x20limit\x20value:\x20'+_0x3baf98+_0x1c4fb6(0xa8);const _0x2e8aaf=validateLimitOption(_0x10cb60);if(!_0x2e8aaf[_0x1c4fb6(0x91)])return _0x2e8aaf['error'];_0x3f7afb[_0x1c4fb6(0x7e)]['limit']=_0x2e8aaf['value'];}return undefined;}[a18_0x50a557(0xa2)](_0x3fc8db){return undefined;}async[a18_0x50a557(0x98)](_0x9357ad){const _0x3e9836=a18_0x50a557;try{const _0x59e8be=this[_0x3e9836(0xa4)](_0x9357ad);if(_0x59e8be)return console[_0x3e9836(0xa5)](_0x3e9836(0xaa)+_0x59e8be),0x1;const _0x226fea=this[_0x3e9836(0xa2)](_0x9357ad);if(_0x226fea){const _0x16bb88=/^\s*(Usage|Note|Warning|Error):/i[_0x3e9836(0x82)](_0x226fea);return _0x16bb88?console[_0x3e9836(0xa5)](_0x226fea):console[_0x3e9836(0xa5)](_0x3e9836(0xaa)+_0x226fea),0x1;}const _0xe01d12=await this[_0x3e9836(0x87)](_0x9357ad);return _0xe01d12??0x0;}catch(_0x52a53b){if(_0x52a53b instanceof Error){if(_0x52a53b instanceof HTTPClientError&&_0x52a53b[_0x3e9836(0xaf)]===0x191){const _0x1046b8=_0x9357ad[_0x3e9836(0x7e)][_0x3e9836(0x7f)];return printAuthError(_0x52a53b,!![],_0x1046b8),_0x52a53b[_0x3e9836(0x8c)]&&_0x9357ad[_0x3e9836(0x94)]&&(_0x9357ad[_0x3e9836(0x94)][_0x3e9836(0xb2)][_0x3e9836(0xa7)](_0x3e9836(0x9e)),_0x9357ad['tdx']['logger'][_0x3e9836(0xa7)](_0x52a53b[_0x3e9836(0x8c)])),0x1;}console[_0x3e9836(0xa5)](a18_0x20feed[_0x3e9836(0x8d)](_0x3e9836(0xaa)+_0x52a53b[_0x3e9836(0x9a)]));_0x52a53b instanceof SDKError&&_0x52a53b['helpText']&&console['error'](a18_0x20feed[_0x3e9836(0x9c)](_0x52a53b[_0x3e9836(0xb1)]));const _0x38b97c=_0x52a53b instanceof SDKError&&_0x52a53b[_0x3e9836(0xa3)]===ErrorCategory[_0x3e9836(0x97)];_0x52a53b[_0x3e9836(0x8c)]&&!_0x38b97c&&console[_0x3e9836(0xa5)](_0x3e9836(0x88)+_0x52a53b[_0x3e9836(0x8c)]);}else console[_0x3e9836(0xa5)](_0x3e9836(0xaa)+String(_0x52a53b));return 0x1;}}}function a18_0x5b30(_0x57f1fc,_0x166caf){const _0x11aa32=a18_0x11aa();return a18_0x5b30=function(_0x5b30c9,_0xbc068e){_0x5b30c9=_0x5b30c9-0x7c;let _0x2c029e=_0x11aa32[_0x5b30c9];return _0x2c029e;},a18_0x5b30(_0x57f1fc,_0x166caf);}function a18_0x11aa(){const _0x4a5b43=['.\x20Must\x20be\x20a\x20number.','13vPbSEI','Error:\x20','168IYzxdq','To\x20check\x20your\x20current\x20auth\x20status:','register','Reason:\x20','status','get','helpText','logger','\x20--profile\x20','commands','options','profile','set','8yqLoyS','test','282MlSbmZ','1884VjLSkp','1463796FNQkMz','from','execute','\x0aStack\x20trace:\x0a','715000tteYQb','\x27\x20is\x20already\x20registered','997962SELscR','stack','red','limit','11XvXjQj','7dKGqJt','isValid','name','\x20\x20tdx\x20auth\x20setup','tdx','problemDetails','260dHiiio','USER_ERROR','run','684189ZrISlq','message','has','yellow','\x20\x20tdx\x20auth','Authentication\x20error\x20stack\x20trace:','Authentication\x20failed','175210jYSWhQ','values','validate','category','validateGlobalOptions','error','number','debug'];a18_0x11aa=function(){return _0x4a5b43;};return a18_0x11aa();}export class CommandRegistry{['commands']=new Map();[a18_0x50a557(0xad)](_0x448790){const _0x211c6d=a18_0x50a557;if(this['commands'][_0x211c6d(0x9b)](_0x448790[_0x211c6d(0x92)]))throw new Error('Command\x20\x27'+_0x448790['name']+_0x211c6d(0x8a));this[_0x211c6d(0x7d)][_0x211c6d(0x80)](_0x448790[_0x211c6d(0x92)],_0x448790);}[a18_0x50a557(0xb0)](_0x9497f2){const _0x38d81c=a18_0x50a557;return this[_0x38d81c(0x7d)][_0x38d81c(0xb0)](_0x9497f2);}['getAll'](){const _0x2e658c=a18_0x50a557;return Array[_0x2e658c(0x86)](this['commands'][_0x2e658c(0xa1)]());}[a18_0x50a557(0x9b)](_0x1e7e3e){const _0x270b13=a18_0x50a557;return this['commands'][_0x270b13(0x9b)](_0x1e7e3e);}}export const registry=new CommandRegistry();
1
+ function a18_0x1249(){const _0xa60d7d=['validate','helpText','options','get','48JmmaMH','Reason:\x20','limit','message','validateGlobalOptions','red','Invalid\x20limit\x20value:\x20','260322OgHSVH','22oilDFl','468770tYDzcS','has','status','Authentication\x20error\x20stack\x20trace:','commands','.\x20Must\x20be\x20a\x20number.','\x20\x20tdx\x20auth\x20setup','values','7qolYJb','596241nIvSba','profile','category','test','yellow','\x27\x20is\x20already\x20registered','820688iESYOa','isValid','\x20\x20tdx\x20auth','problemDetails','stack','set','\x20--profile\x20','Command\x20\x27','register','631872tyXtpu','To\x20check\x20your\x20current\x20auth\x20status:','tdx','\x0aTo\x20set\x20up\x20authentication:','217771qGiodh','Error:\x20','\x0aStack\x20trace:\x0a','number','6QHwtzh','4055315goOrHA','error','name','detail','logger','run','Authentication\x20failed','from'];a18_0x1249=function(){return _0xa60d7d;};return a18_0x1249();}const a18_0x1038a8=a18_0x1337;(function(_0x44f473,_0xb38fa0){const _0x3c2076=a18_0x1337,_0xe994a4=_0x44f473();while(!![]){try{const _0x39d00a=parseInt(_0x3c2076(0xeb))/0x1+-parseInt(_0x3c2076(0x103))/0x2*(-parseInt(_0x3c2076(0xef))/0x3)+-parseInt(_0x3c2076(0xde))/0x4+parseInt(_0x3c2076(0xf0))/0x5+-parseInt(_0x3c2076(0xe7))/0x6*(parseInt(_0x3c2076(0xd7))/0x7)+-parseInt(_0x3c2076(0xfc))/0x8*(parseInt(_0x3c2076(0xd8))/0x9)+parseInt(_0x3c2076(0x105))/0xa*(-parseInt(_0x3c2076(0x104))/0xb);if(_0x39d00a===_0xb38fa0)break;else _0xe994a4['push'](_0xe994a4['shift']());}catch(_0x2ade3c){_0xe994a4['push'](_0xe994a4['shift']());}}}(a18_0x1249,0x77000));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';function a18_0x1337(_0x2cec84,_0x37ff9f){const _0x1249b4=a18_0x1249();return a18_0x1337=function(_0x133765,_0x2bff69){_0x133765=_0x133765-0xd3;let _0x35fc5f=_0x1249b4[_0x133765];return _0x35fc5f;},a18_0x1337(_0x2cec84,_0x37ff9f);}import a18_0x1cf394 from'chalk';export function printAuthError(_0x43be0c,_0x36f59c=![],_0x665d1a){const _0x46feec=a18_0x1337,_0x129825=_0x43be0c[_0x46feec(0xe1)]?.[_0x46feec(0xf3)]||_0x43be0c['message'];console[_0x46feec(0xf1)](a18_0x1cf394[_0x46feec(0x101)](_0x46feec(0xf6))),console[_0x46feec(0xf1)](a18_0x1cf394[_0x46feec(0x101)](_0x46feec(0xfd)+_0x129825));if(_0x36f59c){const _0x4d7f7a=_0x665d1a?_0x46feec(0xe4)+_0x665d1a:'';console[_0x46feec(0xf1)](_0x46feec(0xea)),console[_0x46feec(0xf1)](_0x46feec(0xd5)+_0x4d7f7a+'\x0a'),console['error'](_0x46feec(0xe8)),console[_0x46feec(0xf1)](_0x46feec(0xe0)+_0x4d7f7a);}}export class BaseCommand{[a18_0x1038a8(0x100)](_0xf02538){const _0xbb430e=a18_0x1038a8,{options:_0x1cf966}=_0xf02538,_0xedfd2b=_0x1cf966[_0xbb430e(0xfe)];if(_0xedfd2b!==undefined){const _0x234465=typeof _0xedfd2b===_0xbb430e(0xee)?_0xedfd2b:parseInt(_0xedfd2b,0xa);if(isNaN(_0x234465))return _0xbb430e(0x102)+_0xedfd2b+_0xbb430e(0xd4);const _0x368037=validateLimitOption(_0x234465);if(!_0x368037[_0xbb430e(0xdf)])return _0x368037[_0xbb430e(0xf1)];_0xf02538[_0xbb430e(0xfa)][_0xbb430e(0xfe)]=_0x368037['value'];}return undefined;}['validate'](_0x25b76a){return undefined;}async[a18_0x1038a8(0xf5)](_0x1ec483){const _0x4f3f58=a18_0x1038a8;try{const _0x41df69=this[_0x4f3f58(0x100)](_0x1ec483);if(_0x41df69)return console[_0x4f3f58(0xf1)](_0x4f3f58(0xec)+_0x41df69),0x1;const _0x3ffb2e=this[_0x4f3f58(0xf8)](_0x1ec483);if(_0x3ffb2e){const _0x3008ab=/^\s*(Usage|Note|Warning|Error):/i[_0x4f3f58(0xdb)](_0x3ffb2e);return _0x3008ab?console[_0x4f3f58(0xf1)](_0x3ffb2e):console['error'](_0x4f3f58(0xec)+_0x3ffb2e),0x1;}const _0x7adccd=await this['execute'](_0x1ec483);return _0x7adccd??0x0;}catch(_0x4bb632){if(_0x4bb632 instanceof Error){if(_0x4bb632 instanceof HTTPClientError&&_0x4bb632[_0x4f3f58(0x107)]===0x191){const _0x3342b8=_0x1ec483['options'][_0x4f3f58(0xd9)];return printAuthError(_0x4bb632,!![],_0x3342b8),_0x4bb632[_0x4f3f58(0xe2)]&&_0x1ec483[_0x4f3f58(0xe9)]&&(_0x1ec483[_0x4f3f58(0xe9)][_0x4f3f58(0xf4)]['debug'](_0x4f3f58(0x108)),_0x1ec483[_0x4f3f58(0xe9)][_0x4f3f58(0xf4)]['debug'](_0x4bb632[_0x4f3f58(0xe2)])),0x1;}console[_0x4f3f58(0xf1)](a18_0x1cf394['red'](_0x4f3f58(0xec)+_0x4bb632[_0x4f3f58(0xff)]));_0x4bb632 instanceof SDKError&&_0x4bb632[_0x4f3f58(0xf9)]&&console[_0x4f3f58(0xf1)](a18_0x1cf394[_0x4f3f58(0xdc)](_0x4bb632[_0x4f3f58(0xf9)]));const _0x478058=_0x4bb632 instanceof SDKError&&_0x4bb632[_0x4f3f58(0xda)]===ErrorCategory['USER_ERROR'];_0x4bb632['stack']&&!_0x478058&&console['error'](_0x4f3f58(0xed)+_0x4bb632[_0x4f3f58(0xe2)]);}else console[_0x4f3f58(0xf1)](_0x4f3f58(0xec)+String(_0x4bb632));return 0x1;}}}export class CommandRegistry{[a18_0x1038a8(0xd3)]=new Map();[a18_0x1038a8(0xe6)](_0x66e3bb){const _0x34a710=a18_0x1038a8;if(this[_0x34a710(0xd3)]['has'](_0x66e3bb[_0x34a710(0xf2)]))throw new Error(_0x34a710(0xe5)+_0x66e3bb['name']+_0x34a710(0xdd));this[_0x34a710(0xd3)][_0x34a710(0xe3)](_0x66e3bb[_0x34a710(0xf2)],_0x66e3bb);}[a18_0x1038a8(0xfb)](_0x4bfedf){const _0x38e9c9=a18_0x1038a8;return this[_0x38e9c9(0xd3)]['get'](_0x4bfedf);}['getAll'](){const _0x5d9f89=a18_0x1038a8;return Array[_0x5d9f89(0xf7)](this['commands'][_0x5d9f89(0xd6)]());}[a18_0x1038a8(0x106)](_0x5de96d){const _0x1c98d0=a18_0x1038a8;return this[_0x1c98d0(0xd3)][_0x1c98d0(0x106)](_0x5de96d);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a19_0x1830b7=a19_0x380c;(function(_0x5f4b51,_0x33da90){const _0x49cf58=a19_0x380c,_0x66dac8=_0x5f4b51();while(!![]){try{const _0x1fc3e3=parseInt(_0x49cf58(0x1a9))/0x1*(parseInt(_0x49cf58(0x1b6))/0x2)+-parseInt(_0x49cf58(0x1c0))/0x3*(-parseInt(_0x49cf58(0x1bb))/0x4)+-parseInt(_0x49cf58(0x1b3))/0x5*(-parseInt(_0x49cf58(0x1b2))/0x6)+-parseInt(_0x49cf58(0x1c3))/0x7*(parseInt(_0x49cf58(0x1b0))/0x8)+parseInt(_0x49cf58(0x1ac))/0x9*(parseInt(_0x49cf58(0x1b4))/0xa)+parseInt(_0x49cf58(0x1bc))/0xb*(parseInt(_0x49cf58(0x1c2))/0xc)+-parseInt(_0x49cf58(0x1ab))/0xd;if(_0x1fc3e3===_0x33da90)break;else _0x66dac8['push'](_0x66dac8['shift']());}catch(_0x58b6c4){_0x66dac8['push'](_0x66dac8['shift']());}}}(a19_0x9a51,0xbc59b));function a19_0x9a51(){const _0x498c5b=['Session\x20context\x20cleared\x20(session:\x20','session','Error:\x20','32pxysRq','context','6niylNK','2532505lCAHDp','2570OjhCLL','error','2SUUiUM','warn','\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a','description','\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','4idAruq','24959FxPdXN','display','toString','Show\x20current\x20resolved\x20context','1004967jjzYZf','displayWithSources','5052qcWCZK','633395NUzxhR','clear','yellow','debug','493393zBpiIX','name','23580154GUGvUW','23013PnXURP'];a19_0x9a51=function(){return _0x498c5b;};return a19_0x9a51();}import{BaseCommand}from'./command.js';function a19_0x380c(_0x3bd7af,_0x38a5cd){const _0x9a5195=a19_0x9a51();return a19_0x380c=function(_0x380c94,_0x4bf9bb){_0x380c94=_0x380c94-0x1a6;let _0x242531=_0x9a5195[_0x380c94];return _0x242531;},a19_0x380c(_0x3bd7af,_0x38a5cd);}import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a19_0x4d9cb7 from'chalk';export class ContextCommand extends BaseCommand{[a19_0x1830b7(0x1aa)]=a19_0x1830b7(0x1b1);[a19_0x1830b7(0x1b9)]=a19_0x1830b7(0x1bf);async['execute'](_0x2ce856){const _0x4b90e2=a19_0x1830b7,{options:_0x1e4266}=_0x2ce856,_0x4cfd69=_0x1e4266[_0x4b90e2(0x1a8)],_0x4a5d0c=_0x1e4266[_0x4b90e2(0x1a6)];console[_0x4b90e2(0x1b7)](a19_0x4d9cb7[_0x4b90e2(0x1a7)]('Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.')),console[_0x4b90e2(0x1b7)](a19_0x4d9cb7[_0x4b90e2(0x1a7)](_0x4b90e2(0x1ba))),console[_0x4b90e2(0x1b7)](a19_0x4d9cb7[_0x4b90e2(0x1a7)](_0x4b90e2(0x1b8))),cleanExpiredSessions();try{if(_0x4a5d0c){clearSessionContext(_0x1e4266[_0x4b90e2(0x1ae)]);const _0x1e0290=_0x1e4266['session']||getCurrentSessionPID()[_0x4b90e2(0x1be)]();return console['log'](_0x4b90e2(0x1ad)+_0x1e0290+')'),0x0;}const _0xf7a276=new GlobalContext(_0x1e4266);return _0x4cfd69?_0xf7a276[_0x4b90e2(0x1c1)]():_0xf7a276[_0x4b90e2(0x1bd)](),0x0;}catch(_0x196d3c){return _0x196d3c instanceof Error&&console[_0x4b90e2(0x1b5)](_0x4b90e2(0x1af)+_0x196d3c['message']),0x1;}}}
1
+ const a19_0x3fee9c=a19_0xe8bc;(function(_0x543a14,_0x4898fc){const _0x3e7495=a19_0xe8bc,_0xa7270e=_0x543a14();while(!![]){try{const _0x45d489=-parseInt(_0x3e7495(0x1ab))/0x1*(parseInt(_0x3e7495(0x1a5))/0x2)+-parseInt(_0x3e7495(0x1ad))/0x3+parseInt(_0x3e7495(0x1a6))/0x4+parseInt(_0x3e7495(0x1a4))/0x5*(-parseInt(_0x3e7495(0x193))/0x6)+-parseInt(_0x3e7495(0x197))/0x7*(parseInt(_0x3e7495(0x19e))/0x8)+parseInt(_0x3e7495(0x1a7))/0x9*(-parseInt(_0x3e7495(0x198))/0xa)+-parseInt(_0x3e7495(0x1a9))/0xb*(-parseInt(_0x3e7495(0x1ac))/0xc);if(_0x45d489===_0x4898fc)break;else _0xa7270e['push'](_0xa7270e['shift']());}catch(_0x4e22dc){_0xa7270e['push'](_0xa7270e['shift']());}}}(a19_0x162d,0x3c010));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a19_0x50dfd7 from'chalk';function a19_0xe8bc(_0x83f158,_0x3c2c3d){const _0x162dd8=a19_0x162d();return a19_0xe8bc=function(_0xe8bcda,_0x57250e){_0xe8bcda=_0xe8bcda-0x191;let _0x3edda6=_0x162dd8[_0xe8bcda];return _0x3edda6;},a19_0xe8bc(_0x83f158,_0x3c2c3d);}function a19_0x162d(){const _0x5911d4=['log','warn','8rkeLqu','error','Session\x20context\x20cleared\x20(session:\x20','name','Show\x20current\x20resolved\x20context','yellow','9815ubcEFM','2vTnZBj','681828kpgaYR','9XyCxBX','context','2244143YyLuXW','message','99931BtUjcu','96jaWZrf','1180266XybLmx','clear','toString','1386zwkJgn','execute','\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','debug','1063090AZAXar','4581090vPZxEW','session','display','displayWithSources'];a19_0x162d=function(){return _0x5911d4;};return a19_0x162d();}export class ContextCommand extends BaseCommand{[a19_0x3fee9c(0x1a1)]=a19_0x3fee9c(0x1a8);['description']=a19_0x3fee9c(0x1a2);async[a19_0x3fee9c(0x194)](_0x4b8d8b){const _0x4bf547=a19_0x3fee9c,{options:_0xeded17}=_0x4b8d8b,_0x38f9f1=_0xeded17[_0x4bf547(0x196)],_0x30b33f=_0xeded17[_0x4bf547(0x191)];console[_0x4bf547(0x19d)](a19_0x50dfd7[_0x4bf547(0x1a3)]('Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.')),console[_0x4bf547(0x19d)](a19_0x50dfd7['yellow'](_0x4bf547(0x195))),console[_0x4bf547(0x19d)](a19_0x50dfd7[_0x4bf547(0x1a3)]('\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a')),cleanExpiredSessions();try{if(_0x30b33f){clearSessionContext(_0xeded17['session']);const _0x4013b6=_0xeded17[_0x4bf547(0x199)]||getCurrentSessionPID()[_0x4bf547(0x192)]();return console[_0x4bf547(0x19c)](_0x4bf547(0x1a0)+_0x4013b6+')'),0x0;}const _0x8a4138=new GlobalContext(_0xeded17);return _0x38f9f1?_0x8a4138[_0x4bf547(0x19b)]():_0x8a4138[_0x4bf547(0x19a)](),0x0;}catch(_0x3cbb12){return _0x3cbb12 instanceof Error&&console[_0x4bf547(0x19f)]('Error:\x20'+_0x3cbb12[_0x4bf547(0x1aa)]),0x1;}}}
@@ -1 +1 @@
1
- const a20_0xaf4693=a20_0x20ae;(function(_0x2d0557,_0x7ec647){const _0x4d93fd=a20_0x20ae,_0x3b3247=_0x2d0557();while(!![]){try{const _0x6d08e3=-parseInt(_0x4d93fd(0x158))/0x1+-parseInt(_0x4d93fd(0x16d))/0x2+parseInt(_0x4d93fd(0x15d))/0x3*(parseInt(_0x4d93fd(0x168))/0x4)+-parseInt(_0x4d93fd(0x170))/0x5+parseInt(_0x4d93fd(0x162))/0x6*(-parseInt(_0x4d93fd(0x161))/0x7)+-parseInt(_0x4d93fd(0x15c))/0x8+parseInt(_0x4d93fd(0x16f))/0x9;if(_0x6d08e3===_0x7ec647)break;else _0x3b3247['push'](_0x3b3247['shift']());}catch(_0x2119b3){_0x3b3247['push'](_0x3b3247['shift']());}}}(a20_0x5872,0x31970));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a20_0x20ae(_0x100fa2,_0x179388){const _0x587264=a20_0x5872();return a20_0x20ae=function(_0x20aeb8,_0x5729c4){_0x20aeb8=_0x20aeb8-0x157;let _0x5c98e9=_0x587264[_0x20aeb8];return _0x5c98e9;},a20_0x20ae(_0x100fa2,_0x179388);}function a20_0x5872(){const _0x401cc8=['15099MCmGyk','750VBBPJq','✔\x20Found\x20','query','length','message','Error:\x20','96njdikz','data','description','site','\x20database','725820cRDaQy','listDatabases','11259891pMnqtT','759835CudlTa','limit','List\x20all\x20databases','238102yhaaZO','verbose','execute','Site:\x20','1400312HEGVXa','18708xAJCRC','error','\x20\x20Cause:\x20','databases'];a20_0x5872=function(){return _0x401cc8;};return a20_0x5872();}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{['name']=a20_0xaf4693(0x160);[a20_0xaf4693(0x16a)]=a20_0xaf4693(0x157);async[a20_0xaf4693(0x15a)](_0xe4cdd9){const _0x41030c=a20_0xaf4693,{options:_0xd4eefb,args:_0x3499ea,tdx:_0x77d8ad}=_0xe4cdd9,_0x50987f=_0x3499ea[0x0];try{_0xd4eefb[_0x41030c(0x159)]&&(console[_0x41030c(0x15e)](_0x41030c(0x15b)+_0xd4eefb[_0x41030c(0x16b)]),_0x50987f&&console[_0x41030c(0x15e)]('Pattern:\x20'+_0x50987f));const _0x511b62=resolveLimit(_0xd4eefb[_0x41030c(0x171)],DEFAULT_LISTING_LIMIT),_0x1a8b29=await withSpinner('Listing\x20databases...',()=>_0x77d8ad[_0x41030c(0x164)][_0x41030c(0x16e)](_0x50987f,_0x511b62),{'verbose':_0xd4eefb[_0x41030c(0x159)]}),_0x4fc2d7=_0x1a8b29[_0x41030c(0x169)];return console['error'](_0x41030c(0x163)+_0x4fc2d7['length']+_0x41030c(0x16c)+(_0x4fc2d7[_0x41030c(0x165)]!==0x1?'s':'')),await handleSDKOutput(_0x4fc2d7,{..._0xd4eefb,'limit':_0x511b62}),0x0;}catch(_0x4fb4f0){if(_0x4fb4f0 instanceof SDKError)return console['error'](_0x41030c(0x167)+_0x4fb4f0[_0x41030c(0x166)]),_0x4fb4f0['cause']&&console[_0x41030c(0x15e)](_0x41030c(0x15f)+_0x4fb4f0['cause']),0x1;throw _0x4fb4f0;}}}
1
+ const a20_0x341809=a20_0x3df5;(function(_0x3da77e,_0x192720){const _0x910f39=a20_0x3df5,_0x2988c4=_0x3da77e();while(!![]){try{const _0x45b150=-parseInt(_0x910f39(0x13e))/0x1+-parseInt(_0x910f39(0x130))/0x2+-parseInt(_0x910f39(0x13d))/0x3+parseInt(_0x910f39(0x12d))/0x4+parseInt(_0x910f39(0x131))/0x5*(parseInt(_0x910f39(0x140))/0x6)+-parseInt(_0x910f39(0x141))/0x7*(-parseInt(_0x910f39(0x12a))/0x8)+parseInt(_0x910f39(0x136))/0x9;if(_0x45b150===_0x192720)break;else _0x2988c4['push'](_0x2988c4['shift']());}catch(_0x37c5d0){_0x2988c4['push'](_0x2988c4['shift']());}}}(a20_0x5023,0x1f699));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a20_0x3df5(_0x13baf3,_0x42d280){const _0x502384=a20_0x5023();return a20_0x3df5=function(_0x3df59e,_0x2d7602){_0x3df59e=_0x3df59e-0x129;let _0x2cd356=_0x502384[_0x3df59e];return _0x2cd356;},a20_0x3df5(_0x13baf3,_0x42d280);}import{handleSDKOutput}from'../utils/command-output.js';function a20_0x5023(){const _0x1ae372=['217GSxuXA','execute','22064ebtCJK','site','listDatabases','177076uhfgLo','Pattern:\x20','cause','381050mxVCSC','601505rcIWrB','error','databases','length','verbose','1009485QGyufS','limit','Listing\x20databases...','query','data','\x20\x20Cause:\x20','Error:\x20','3486uAlbTt','162182ZqMcnm','✔\x20Found\x20','12pQUDsU'];a20_0x5023=function(){return _0x1ae372;};return a20_0x5023();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{['name']=a20_0x341809(0x133);['description']='List\x20all\x20databases';async[a20_0x341809(0x129)](_0x2a9398){const _0x569472=a20_0x341809,{options:_0x1ec08b,args:_0x177606,tdx:_0x232e95}=_0x2a9398,_0x7f4a40=_0x177606[0x0];try{_0x1ec08b[_0x569472(0x135)]&&(console['error']('Site:\x20'+_0x1ec08b[_0x569472(0x12b)]),_0x7f4a40&&console[_0x569472(0x132)](_0x569472(0x12e)+_0x7f4a40));const _0x2205fc=resolveLimit(_0x1ec08b[_0x569472(0x137)],DEFAULT_LISTING_LIMIT),_0x4ccba1=await withSpinner(_0x569472(0x138),()=>_0x232e95[_0x569472(0x139)][_0x569472(0x12c)](_0x7f4a40,_0x2205fc),{'verbose':_0x1ec08b[_0x569472(0x135)]}),_0x30289e=_0x4ccba1[_0x569472(0x13a)];return console[_0x569472(0x132)](_0x569472(0x13f)+_0x30289e[_0x569472(0x134)]+'\x20database'+(_0x30289e[_0x569472(0x134)]!==0x1?'s':'')),await handleSDKOutput(_0x30289e,{..._0x1ec08b,'limit':_0x2205fc}),0x0;}catch(_0x4f4a2e){if(_0x4f4a2e instanceof SDKError)return console[_0x569472(0x132)](_0x569472(0x13c)+_0x4f4a2e['message']),_0x4f4a2e[_0x569472(0x12f)]&&console[_0x569472(0x132)](_0x569472(0x13b)+_0x4f4a2e[_0x569472(0x12f)]),0x1;throw _0x4f4a2e;}}}
@@ -1 +1 @@
1
- const a21_0x894e24=a21_0x3ca7;function a21_0x505e(){const _0xc96cc8=['...','Describe\x20table\x20schema','verbose','describeTable','892782nSyDFu','Describing\x20table\x20','Error:\x20','name','25UKceLs','541141WSEtfA','46530WaZTcb','✖\x20Table\x20not\x20found','message','Database:\x20','1834728FgcJtA','847245jxJKXm','\x20in\x20','database','40GHQJrj','7860ZSDqkR','cause','\x27\x20does\x20not\x20exist','error','data','516650WdvTMA','Table\x20\x27','validate','describe','description','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','Site:\x20','site','args','length','\x20column'];a21_0x505e=function(){return _0xc96cc8;};return a21_0x505e();}(function(_0x4a9bbb,_0x7fa631){const _0x1620d7=a21_0x3ca7,_0x55f811=_0x4a9bbb();while(!![]){try{const _0x53afb0=-parseInt(_0x1620d7(0x15b))/0x1+parseInt(_0x1620d7(0x16a))/0x2+-parseInt(_0x1620d7(0x156))/0x3+-parseInt(_0x1620d7(0x165))/0x4*(parseInt(_0x1620d7(0x15a))/0x5)+parseInt(_0x1620d7(0x160))/0x6+parseInt(_0x1620d7(0x161))/0x7*(parseInt(_0x1620d7(0x164))/0x8)+-parseInt(_0x1620d7(0x15c))/0x9;if(_0x53afb0===_0x7fa631)break;else _0x55f811['push'](_0x55f811['shift']());}catch(_0x57135a){_0x55f811['push'](_0x55f811['shift']());}}}(a21_0x505e,0x4d0a6));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a21_0x3ca7(_0x2dd0aa,_0x30c819){const _0x505e94=a21_0x505e();return a21_0x3ca7=function(_0x3ca740,_0x3796ec){_0x3ca740=_0x3ca740-0x154;let _0x39c622=_0x505e94[_0x3ca740];return _0x39c622;},a21_0x3ca7(_0x2dd0aa,_0x30c819);}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a21_0x894e24(0x159)]=a21_0x894e24(0x16d);[a21_0x894e24(0x16e)]=a21_0x894e24(0x176);async['execute'](_0x363f89){const _0x20a07a=a21_0x894e24;return this[_0x20a07a(0x155)](_0x363f89);}async[a21_0x894e24(0x155)](_0x1970cd){const _0x5dcdd7=a21_0x894e24,{options:_0x2dfed2,args:_0x31e02e,tdx:_0x4cee91}=_0x1970cd;let _0x267913;try{_0x267913=parseTableReference(_0x31e02e[0x0]);const _0x66bb59=_0x2dfed2[_0x5dcdd7(0x163)];!_0x267913['database']&&_0x66bb59&&(_0x267913[_0x5dcdd7(0x163)]=_0x66bb59);const _0x57bdbd=validateTableDescribeReference(_0x267913);if(_0x57bdbd)return console['error'](_0x5dcdd7(0x158)+_0x57bdbd),0x1;}catch(_0x53ca91){return console['error'](_0x5dcdd7(0x158)+_0x53ca91[_0x5dcdd7(0x15e)]),0x1;}const _0x5bacd4=_0x267913[_0x5dcdd7(0x163)],_0x597275=_0x267913['table'];try{_0x2dfed2[_0x5dcdd7(0x154)]&&(console[_0x5dcdd7(0x168)](_0x5dcdd7(0x170)+_0x2dfed2[_0x5dcdd7(0x171)]),console[_0x5dcdd7(0x168)](_0x5dcdd7(0x15f)+_0x5bacd4),console['error']('Table:\x20'+_0x597275));const _0x4bb65c=await withSpinner(_0x5dcdd7(0x157)+_0x5bacd4+'.'+_0x597275+_0x5dcdd7(0x175),()=>_0x4cee91['query']['describeTable'](_0x5bacd4,_0x597275),{'verbose':_0x2dfed2[_0x5dcdd7(0x154)]}),_0xb3d7ca=_0x4bb65c[_0x5dcdd7(0x169)];if(_0xb3d7ca[_0x5dcdd7(0x173)]===0x0)return console['error'](_0x5dcdd7(0x15d)),console[_0x5dcdd7(0x168)](_0x5dcdd7(0x16b)+_0x5bacd4+'.'+_0x597275+_0x5dcdd7(0x167)),0x1;return console['error']('✔\x20Found\x20'+_0xb3d7ca['length']+_0x5dcdd7(0x174)+(_0xb3d7ca['length']!==0x1?'s':'')+_0x5dcdd7(0x162)+_0x5bacd4+'.'+_0x597275),await handleSDKOutput(_0xb3d7ca,_0x2dfed2),0x0;}catch(_0x2e02ec){if(_0x2e02ec instanceof SDKError)return console[_0x5dcdd7(0x168)](_0x5dcdd7(0x158)+_0x2e02ec[_0x5dcdd7(0x15e)]),_0x2e02ec[_0x5dcdd7(0x166)]&&console[_0x5dcdd7(0x168)]('\x20\x20Cause:\x20'+_0x2e02ec[_0x5dcdd7(0x166)]),0x1;throw _0x2e02ec;}}[a21_0x894e24(0x16c)](_0x570be1){const _0x2f21c4=a21_0x894e24;if(_0x570be1[_0x2f21c4(0x172)][_0x2f21c4(0x173)]===0x0)return _0x2f21c4(0x16f);if(_0x570be1['args'][_0x2f21c4(0x173)]>0x1)return'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';return undefined;}}
1
+ const a21_0x2c1235=a21_0x5321;(function(_0x5abe08,_0x2b4cb2){const _0x519c97=a21_0x5321,_0x792d9d=_0x5abe08();while(!![]){try{const _0x1ad2f8=parseInt(_0x519c97(0x1d5))/0x1+parseInt(_0x519c97(0x1e3))/0x2*(-parseInt(_0x519c97(0x1d1))/0x3)+-parseInt(_0x519c97(0x1e6))/0x4+parseInt(_0x519c97(0x1d9))/0x5*(-parseInt(_0x519c97(0x1d3))/0x6)+-parseInt(_0x519c97(0x1de))/0x7*(-parseInt(_0x519c97(0x1c5))/0x8)+-parseInt(_0x519c97(0x1ea))/0x9*(-parseInt(_0x519c97(0x1e5))/0xa)+-parseInt(_0x519c97(0x1d6))/0xb*(-parseInt(_0x519c97(0x1e8))/0xc);if(_0x1ad2f8===_0x2b4cb2)break;else _0x792d9d['push'](_0x792d9d['shift']());}catch(_0xcaba03){_0x792d9d['push'](_0x792d9d['shift']());}}}(a21_0x4776,0xd2a1b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a21_0x4776(){const _0x121d2d=['...','error','107178NuLTnj','query','6msWURW','Describing\x20table\x20','996961LDLVWm','704DCALsb','Table\x20\x27','table','6796645juirmG','Site:\x20','verbose','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','\x20column','7JPJiwd','Table:\x20','validate','args','site','18mgFOwf','Database:\x20','120UGySKz','3805764ybicAk','database','136020KasNjw','name','176067duZVGZ','description','Describe\x20table\x20schema','12303152pHtbTc','describe','length','Error:\x20','data','✖\x20Table\x20not\x20found','message','\x20\x20Cause:\x20','cause','describeTable'];a21_0x4776=function(){return _0x121d2d;};return a21_0x4776();}import{withSpinner}from'../utils/spinner.js';function a21_0x5321(_0x445b78,_0x3e97a7){const _0x477601=a21_0x4776();return a21_0x5321=function(_0x53215a,_0x1acc81){_0x53215a=_0x53215a-0x1c4;let _0x176fe4=_0x477601[_0x53215a];return _0x176fe4;},a21_0x5321(_0x445b78,_0x3e97a7);}export class DescribeCommand extends BaseCommand{[a21_0x2c1235(0x1e9)]=a21_0x2c1235(0x1c6);[a21_0x2c1235(0x1eb)]=a21_0x2c1235(0x1c4);async['execute'](_0x2036dc){return this['describeTable'](_0x2036dc);}async['describeTable'](_0x26697b){const _0x1752ec=a21_0x2c1235,{options:_0x273a2e,args:_0x25c83c,tdx:_0xa089be}=_0x26697b;let _0x4222fb;try{_0x4222fb=parseTableReference(_0x25c83c[0x0]);const _0x3199b4=_0x273a2e['database'];!_0x4222fb[_0x1752ec(0x1e7)]&&_0x3199b4&&(_0x4222fb[_0x1752ec(0x1e7)]=_0x3199b4);const _0x50d201=validateTableDescribeReference(_0x4222fb);if(_0x50d201)return console[_0x1752ec(0x1d0)](_0x1752ec(0x1c8)+_0x50d201),0x1;}catch(_0x317ffe){return console[_0x1752ec(0x1d0)](_0x1752ec(0x1c8)+_0x317ffe[_0x1752ec(0x1cb)]),0x1;}const _0x4ca606=_0x4222fb[_0x1752ec(0x1e7)],_0x38c9e2=_0x4222fb[_0x1752ec(0x1d8)];try{_0x273a2e[_0x1752ec(0x1db)]&&(console[_0x1752ec(0x1d0)](_0x1752ec(0x1da)+_0x273a2e[_0x1752ec(0x1e2)]),console[_0x1752ec(0x1d0)](_0x1752ec(0x1e4)+_0x4ca606),console[_0x1752ec(0x1d0)](_0x1752ec(0x1df)+_0x38c9e2));const _0x689f6c=await withSpinner(_0x1752ec(0x1d4)+_0x4ca606+'.'+_0x38c9e2+_0x1752ec(0x1cf),()=>_0xa089be[_0x1752ec(0x1d2)][_0x1752ec(0x1ce)](_0x4ca606,_0x38c9e2),{'verbose':_0x273a2e[_0x1752ec(0x1db)]}),_0x178e57=_0x689f6c[_0x1752ec(0x1c9)];if(_0x178e57[_0x1752ec(0x1c7)]===0x0)return console[_0x1752ec(0x1d0)](_0x1752ec(0x1ca)),console[_0x1752ec(0x1d0)](_0x1752ec(0x1d7)+_0x4ca606+'.'+_0x38c9e2+'\x27\x20does\x20not\x20exist'),0x1;return console[_0x1752ec(0x1d0)]('✔\x20Found\x20'+_0x178e57['length']+_0x1752ec(0x1dd)+(_0x178e57[_0x1752ec(0x1c7)]!==0x1?'s':'')+'\x20in\x20'+_0x4ca606+'.'+_0x38c9e2),await handleSDKOutput(_0x178e57,_0x273a2e),0x0;}catch(_0x257025){if(_0x257025 instanceof SDKError)return console[_0x1752ec(0x1d0)]('Error:\x20'+_0x257025[_0x1752ec(0x1cb)]),_0x257025[_0x1752ec(0x1cd)]&&console[_0x1752ec(0x1d0)](_0x1752ec(0x1cc)+_0x257025[_0x1752ec(0x1cd)]),0x1;throw _0x257025;}}[a21_0x2c1235(0x1e0)](_0x4494a8){const _0x4c7042=a21_0x2c1235;if(_0x4494a8[_0x4c7042(0x1e1)][_0x4c7042(0x1c7)]===0x0)return'Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';if(_0x4494a8[_0x4c7042(0x1e1)][_0x4c7042(0x1c7)]>0x1)return _0x4c7042(0x1dc);return undefined;}}