@treasuredata/tdx 0.8.6 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0xe8103d=a12_0x5c58;(function(_0x3dc852,_0xa1524d){const _0x4ced49=a12_0x5c58,_0x280fbf=_0x3dc852();while(!![]){try{const _0x1b46ca=parseInt(_0x4ced49(0xbb))/0x1*(parseInt(_0x4ced49(0xdf))/0x2)+parseInt(_0x4ced49(0xe9))/0x3*(parseInt(_0x4ced49(0xd7))/0x4)+parseInt(_0x4ced49(0xdb))/0x5+-parseInt(_0x4ced49(0xf7))/0x6*(parseInt(_0x4ced49(0xe7))/0x7)+-parseInt(_0x4ced49(0xf3))/0x8+-parseInt(_0x4ced49(0xb8))/0x9*(-parseInt(_0x4ced49(0xf1))/0xa)+-parseInt(_0x4ced49(0xc9))/0xb;if(_0x1b46ca===_0xa1524d)break;else _0x280fbf['push'](_0x280fbf['shift']());}catch(_0x699ec){_0x280fbf['push'](_0x280fbf['shift']());}}}(a12_0x5524,0xa69f0));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a12_0x5c58(_0x5a5581,_0x56af1c){_0x5a5581=_0x5a5581-0xb5;const _0x5524e1=a12_0x5524();let _0x5c585f=_0x5524e1[_0x5a5581];return _0x5c585f;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a12_0x5524(){const _0x157374=['Invalid\x20API\x20type:\x20','length','133476XeSaxX','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','toLowerCase','color','72fxzgpD','api','workflow','43347hZnFrf','POST','\x0aStack\x20trace:\x0a','cdp','output','body','<\x20HTTP/1.1\x20','Results\x20saved\x20to\x20','toUpperCase','PUT','Endpoint\x20must\x20start\x20with\x20/:\x20','includes','startsWith','\x22.\x20','7223744fJZShW','message','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-xsrf-token','verbose','data','indexOf','keys','set-cookie','validate','file','readBodyFromFile','isArray','header','52HfwkxD','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','entries','DELETE','1860355RiCvqC','GET','join','headers','54YvrwLz','method','name','set-cookie2','authorization','trim','request','Invalid\x20HTTP\x20method:\x20','203iPDuot','trino','19560cZEpaV','substring','log','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','stack','noColor','Error:\x20','type','1395950lNhiWQ','error','6077136FGMvTA','site'];a12_0x5524=function(){return _0x157374;};return a12_0x5524();}import{getEndpoint}from'../types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a12_0xe8103d(0xe3),'proxy-authorization','cookie',a12_0xe8103d(0xd1),a12_0xe8103d(0xe2),a12_0xe8103d(0xcc),'x-auth-token','x-trino-user']);function isSensitiveHeader(_0x54f9b6){const _0x178103=a12_0xe8103d;return SENSITIVE_HEADERS['has'](_0x54f9b6[_0x178103(0xb6)]());}function parseHeader(_0x37a64e){const _0x3ac3f8=a12_0xe8103d,_0x54068d=_0x37a64e[_0x3ac3f8(0xcf)](':');if(_0x54068d===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x37a64e+_0x3ac3f8(0xc8)+_0x3ac3f8(0xcb));const _0x3aa0a4=_0x37a64e[_0x3ac3f8(0xea)](0x0,_0x54068d)[_0x3ac3f8(0xe4)](),_0x48eddf=_0x37a64e[_0x3ac3f8(0xea)](_0x54068d+0x1)[_0x3ac3f8(0xe4)]();if(!_0x3aa0a4)throw new Error(_0x3ac3f8(0xb5)+_0x37a64e+'\x22');return[_0x3aa0a4,_0x48eddf];}export class ApiCommand extends BaseCommand{[a12_0xe8103d(0xe1)]=a12_0xe8103d(0xb9);['description']=a12_0xe8103d(0xec);[a12_0xe8103d(0xd2)](_0x3338ea){const _0x22b456=a12_0xe8103d,{args:_0x12860d,options:_0x109a81}=_0x3338ea,_0xa2602=_0x109a81;if(_0x12860d[_0x22b456(0xf6)]===0x0)return _0x22b456(0xd8);const _0x350c33=_0x12860d[0x0];if(!_0x350c33[_0x22b456(0xc7)]('/'))return _0x22b456(0xc5)+_0x350c33;const _0x22cbfd=_0xa2602[_0x22b456(0xce)],_0x32eb11=_0xa2602['file'];if(_0x22cbfd&&_0x32eb11)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x2ae9e3=_0xa2602['method']||_0x22b456(0xdc),_0x5d5339=[_0x22b456(0xdc),_0x22b456(0xbc),_0x22b456(0xc4),_0x22b456(0xda),'PATCH'];if(!_0x5d5339[_0x22b456(0xc6)](_0x2ae9e3[_0x22b456(0xc3)]()))return _0x22b456(0xe6)+_0x2ae9e3+'.\x20Valid\x20methods:\x20'+_0x5d5339[_0x22b456(0xdd)](',\x20');const _0x29c33c=_0xa2602[_0x22b456(0xf0)]||'td',_0xff4816=['td',_0x22b456(0xbe),_0x22b456(0xba),_0x22b456(0xe8),'llm'];if(!_0xff4816['includes'](_0x29c33c))return _0x22b456(0xf5)+_0x29c33c+'.\x20Valid\x20types:\x20'+_0xff4816['join'](',\x20');return undefined;}async['execute'](_0x384512){const _0x495a67=a12_0xe8103d,{options:_0x26a05e,args:_0x1d701c,tdx:_0x442d42}=_0x384512,_0x34817b=_0x26a05e,_0x1d7843=_0x1d701c[0x0],_0x518400=(_0x34817b[_0x495a67(0xe0)]||_0x495a67(0xdc))[_0x495a67(0xc3)](),_0x364cdf=_0x34817b[_0x495a67(0xce)],_0x1b12b0=_0x34817b[_0x495a67(0xd3)],_0x3a3f69=_0x34817b[_0x495a67(0xd6)],_0x34a21c=_0x34817b[_0x495a67(0xf0)]||'td';try{const _0x24b138={};if(_0x3a3f69){const _0x28ea57=Array[_0x495a67(0xd5)](_0x3a3f69)?_0x3a3f69:[_0x3a3f69];for(const _0x39647c of _0x28ea57){const [_0x26935f,_0x2c4b27]=parseHeader(_0x39647c);_0x24b138[_0x26935f]=_0x2c4b27;}}let _0x4d2b7e;if(_0x364cdf)_0x4d2b7e=_0x364cdf;else{if(_0x1b12b0)try{_0x4d2b7e=RawAPI[_0x495a67(0xd4)](_0x1b12b0);}catch(_0x178342){return console[_0x495a67(0xf2)]('Error:\x20'+(_0x178342 instanceof Error?_0x178342[_0x495a67(0xca)]:String(_0x178342))),0x1;}}const _0x15c8a3={'method':_0x518400,'apiType':_0x34a21c,'includeHeaders':_0x26a05e[_0x495a67(0xcd)]};_0x4d2b7e&&(_0x15c8a3[_0x495a67(0xc0)]=_0x4d2b7e);Object[_0x495a67(0xd0)](_0x24b138)[_0x495a67(0xf6)]>0x0&&(_0x15c8a3[_0x495a67(0xde)]=_0x24b138);if(_0x26a05e['verbose']){const _0x2c20ce=resolveSite(_0x26a05e[_0x495a67(0xf4)]),_0x1958f6=getEndpoint(_0x2c20ce,_0x34a21c),_0xb734ad=''+_0x1958f6+_0x1d7843;console[_0x495a67(0xf2)]('>\x20'+_0x518400+'\x20'+_0xb734ad);const _0x4660ee=getAuthHeaders(_0x2c20ce),_0x5ef19e={..._0x4660ee,..._0x24b138};for(const [_0xb74cfb,_0x6870a4]of Object[_0x495a67(0xd9)](_0x5ef19e)){!isSensitiveHeader(_0xb74cfb)&&console[_0x495a67(0xf2)]('>\x20'+_0xb74cfb+':\x20'+_0x6870a4);}_0x4d2b7e&&console[_0x495a67(0xf2)]('>'),console[_0x495a67(0xf2)]('');}const _0x744662=await _0x442d42[_0x495a67(0xb9)][_0x495a67(0xe5)](_0x1d7843,_0x15c8a3);if(_0x26a05e['verbose']&&_0x744662[_0x495a67(0xde)]){console[_0x495a67(0xf2)](_0x495a67(0xc1)+_0x744662['status']);for(const [_0x153ce1,_0x425e34]of Object[_0x495a67(0xd9)](_0x744662[_0x495a67(0xde)])){!isSensitiveHeader(_0x153ce1)&&console['error']('<\x20'+_0x153ce1+':\x20'+_0x425e34);}console[_0x495a67(0xf2)]('');}const _0x3ca8c5=Boolean(_0x26a05e[_0x495a67(0xbf)]),_0x5077f6={'color':_0x26a05e[_0x495a67(0xb7)],'noColor':_0x26a05e[_0x495a67(0xee)]||_0x3ca8c5&&!_0x26a05e['color']},_0x65785c=colorizeJSON(_0x744662['data'],_0x5077f6);return _0x26a05e[_0x495a67(0xbf)]?(writeFileSync(_0x26a05e[_0x495a67(0xbf)],_0x65785c),console[_0x495a67(0xf2)](_0x495a67(0xc2)+_0x26a05e[_0x495a67(0xbf)])):console[_0x495a67(0xeb)](_0x65785c),0x0;}catch(_0x2ba4eb){return _0x2ba4eb instanceof Error?(console[_0x495a67(0xf2)](_0x495a67(0xef)+_0x2ba4eb[_0x495a67(0xca)]),_0x26a05e[_0x495a67(0xcd)]&&_0x2ba4eb[_0x495a67(0xed)]&&console[_0x495a67(0xf2)](_0x495a67(0xbd)+_0x2ba4eb[_0x495a67(0xed)])):console[_0x495a67(0xf2)](_0x495a67(0xef)+String(_0x2ba4eb)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a13_0x26bbd4=a13_0x3aee;(function(_0x41b8ac,_0x5cb678){const _0x26b94d=a13_0x3aee,_0x1acced=_0x41b8ac();while(!![]){try{const _0x45c01d=-parseInt(_0x26b94d(0x1b6))/0x1*(-parseInt(_0x26b94d(0x1e4))/0x2)+-parseInt(_0x26b94d(0x1d8))/0x3+-parseInt(_0x26b94d(0x1a3))/0x4+parseInt(_0x26b94d(0x1aa))/0x5*(-parseInt(_0x26b94d(0x19b))/0x6)+-parseInt(_0x26b94d(0x1e6))/0x7+parseInt(_0x26b94d(0x1b4))/0x8+parseInt(_0x26b94d(0x1d2))/0x9*(parseInt(_0x26b94d(0x1c1))/0xa);if(_0x45c01d===_0x5cb678)break;else _0x1acced['push'](_0x1acced['shift']());}catch(_0x306576){_0x1acced['push'](_0x1acced['shift']());}}}(a13_0x2521,0x5eadd));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a13_0x2521(){const _0x13da09=['Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','error','auth:clear','trim','name','2856200iGIdWC','jobs','904xbymlX','log','\x20\x20tdx','profile','password','ap02\x20-\x20Korea','last_name','description','execute','email','auth:setup','8363220WjQvdJ','bold','\x20--profile\x20','status','logLevel','\x27\x20registered','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','tdx:\x20auth\x20clear','us01','message','join','API\x20key\x20cannot\x20be\x20empty','✓\x20Authentication\x20successful\x0a','tdx:\x20auth\x20setup','yellow','Select\x20your\x20Treasure\x20Data\x20site:','other','9UpWEPM','System\x20keychain\x20is\x20not\x20available','eu01','filter','Setting\x20up\x20authentication\x20for\x20site:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','1149183CATMGF','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','red','apiKey','Name:\x20','✓\x20API\x20key\x20removed\x20from\x20keychain','Enter\x20your\x20TD\x20API\x20key:','No\x20API\x20key\x20found\x20in\x20keychain','Enter\x20site\x20name:','tdx\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','value','462Cxyhnt','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','2005276hYBJju','\x0aSetup\x20cancelled','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','N/A','customSite','ERROR','You\x20can\x20find\x20your\x20API\x20key\x20at:','21426LUWwRW','jp01','Setup\x20API\x20key\x20authentication\x20interactively','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','No\x20credential\x20found','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✗\x20Validation\x20failed:\x20','✓\x20Profile\x20\x27','1093668lGRkRw','first_name','jp\x20\x20\x20-\x20Japan','test','User:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Validating\x20API\x20key...','100WSUjaJ','\x20(site:\x20','\x20(profile:\x20','site','Read\x20credential\x20from\x20'];a13_0x2521=function(){return _0x13da09;};return a13_0x2521();}import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../types/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a13_0x24ef6f from'prompts';function a13_0x3aee(_0x1052e1,_0x3ff6e0){_0x1052e1=_0x1052e1-0x197;const _0x2521e4=a13_0x2521();let _0x3aee4d=_0x2521e4[_0x1052e1];return _0x3aee4d;}import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a13_0x243572 from'chalk';export class AuthSetupCommand extends BaseCommand{[a13_0x26bbd4(0x1b3)]=a13_0x26bbd4(0x1c0);[a13_0x26bbd4(0x1bd)]=a13_0x26bbd4(0x19d);async[a13_0x26bbd4(0x1be)](_0x366cec){const _0x6eebd2=a13_0x26bbd4,{options:_0xd83f35}=_0x366cec,_0x38ce2a=_0xd83f35[_0x6eebd2(0x1b9)];console[_0x6eebd2(0x1b7)](a13_0x243572[_0x6eebd2(0x1c2)](_0x6eebd2(0x1ce)));const _0x25cae4=_0xd83f35['site']||'us01',_0x2e7d59=[{'title':'us\x20\x20\x20-\x20United\x20States','value':'us01'},{'title':_0x6eebd2(0x1a5),'value':_0x6eebd2(0x19c)},{'title':'eu\x20\x20\x20-\x20Europe','value':_0x6eebd2(0x1d4)},{'title':_0x6eebd2(0x1bb),'value':'ap02'}];let _0x32b354=_0x2e7d59['findIndex'](_0x3d1f10=>_0x3d1f10[_0x6eebd2(0x1e3)]===_0x25cae4);_0x32b354===-0x1&&_0x25cae4!==_0x6eebd2(0x1c9)&&(_0x2e7d59['push']({'title':_0x25cae4,'value':_0x25cae4}),_0x32b354=_0x2e7d59['length']-0x1);_0x2e7d59['push']({'title':'Enter\x20custom\x20site','value':_0x6eebd2(0x1d1)});const _0x3d9681=_0x38ce2a?_0x6eebd2(0x1af)+_0x38ce2a+'):':_0x6eebd2(0x1d0),_0x5849c2=await a13_0x24ef6f({'type':'select','name':_0x6eebd2(0x1ad),'message':_0x3d9681,'choices':_0x2e7d59,'initial':_0x32b354>=0x0?_0x32b354:0x0});if(!_0x5849c2[_0x6eebd2(0x1ad)])return console[_0x6eebd2(0x1b7)]('\x0aSetup\x20cancelled'),0x1;let _0x5e8cf5;if(_0x5849c2[_0x6eebd2(0x1ad)]===_0x6eebd2(0x1d1)){const _0x55484a=await a13_0x24ef6f({'type':'text','name':_0x6eebd2(0x198),'message':_0x6eebd2(0x1e0),'initial':_0x6eebd2(0x1c9),'validate':_0x1599d8=>{const _0x281b92=_0x6eebd2;if(!_0x1599d8||!_0x1599d8[_0x281b92(0x1b2)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x281b92(0x1a6)](_0x1599d8[_0x281b92(0x1b2)]()))return _0x281b92(0x1e5);return!![];}});if(!_0x55484a[_0x6eebd2(0x198)])return console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1e7)),0x1;_0x5e8cf5=_0x55484a[_0x6eebd2(0x198)];}else _0x5e8cf5=_0x5849c2[_0x6eebd2(0x1ad)];const _0x3b1061=resolveSite(_0x5e8cf5);console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1d6)+_0x3b1061),console[_0x6eebd2(0x1b7)](_0x6eebd2(0x19a)),console[_0x6eebd2(0x1b7)]('\x20\x20'+getConsoleUrl(_0x3b1061,'/app/mp/ak'));const _0x165eab=await a13_0x24ef6f({'type':_0x6eebd2(0x1ba),'name':_0x6eebd2(0x1db),'message':_0x6eebd2(0x1de),'validate':_0x1402ac=>{const _0xc10781=_0x6eebd2;if(!_0x1402ac||!_0x1402ac['trim']())return _0xc10781(0x1cc);return!![];}});if(!_0x165eab['apiKey'])return console[_0x6eebd2(0x1b7)]('\x0aSetup\x20cancelled'),0x1;const _0x3d008c=_0x165eab[_0x6eebd2(0x1db)];console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1a9));try{const _0xa2d03e=TDX['create']({'site':_0x3b1061,'apiKey':_0x3d008c[_0x6eebd2(0x1b2)](),'logLevel':_0xd83f35[_0x6eebd2(0x1c5)]??LogLevel[_0x6eebd2(0x199)]}),_0x3dbaa9=await _0xa2d03e[_0x6eebd2(0x1b5)]['getUserInfo']();console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1a0)+_0x3dbaa9[_0x6eebd2(0x1bf)]+')');const _0x5331e1=await isKeychainAvailable();_0x5331e1?(await saveAPIKeyAsync(_0x3d008c['trim'](),_0x3b1061,_0x38ce2a),console[_0x6eebd2(0x1b7)](_0x6eebd2(0x19e)+(_0x38ce2a?_0x6eebd2(0x1ac)+_0x38ce2a+')':''))):(console['warn'](a13_0x243572[_0x6eebd2(0x1cf)](_0x6eebd2(0x1d7))),console['warn'](a13_0x243572['yellow'](_0x6eebd2(0x1c7))));if(_0x38ce2a){const _0x4ab005={'site':_0x3b1061};saveProfileToUserConfig(_0x38ce2a,_0x4ab005),console['log'](_0x6eebd2(0x1a2)+_0x38ce2a+_0x6eebd2(0x1c6));}const _0xd4cdc9=_0x38ce2a?_0x6eebd2(0x1c3)+_0x38ce2a:'';return console[_0x6eebd2(0x1b7)](),console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1d9)),console[_0x6eebd2(0x1b7)]('\x20\x20tdx'+_0xd4cdc9+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x6eebd2(0x1b7)](_0x6eebd2(0x1b8)+_0xd4cdc9+_0x6eebd2(0x1a8)),0x0;}catch(_0xe7ed88){if(_0xe7ed88 instanceof HTTPClientError&&_0xe7ed88[_0x6eebd2(0x1c4)]===0x191)return printAuthError(_0xe7ed88),0x1;return console[_0x6eebd2(0x1b0)](a13_0x243572[_0x6eebd2(0x1da)]('✗\x20Validation\x20failed:\x20'+(_0xe7ed88 instanceof Error?_0xe7ed88[_0x6eebd2(0x1ca)]:String(_0xe7ed88)))),console[_0x6eebd2(0x1b0)](_0x6eebd2(0x1e8)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';['description']=a13_0x26bbd4(0x1e9);async[a13_0x26bbd4(0x1be)](_0x39b97d){const _0x2d9b53=a13_0x26bbd4,{options:_0x2e844a,tdx:_0x525809}=_0x39b97d,_0x4ef866=_0x2e844a[_0x2d9b53(0x1ad)],_0x56cec9=_0x2e844a[_0x2d9b53(0x1b9)],_0x52e6cc=_0x56cec9?_0x56cec9:_0x2d9b53(0x197);console['log'](_0x2d9b53(0x1e1)+_0x52e6cc+_0x2d9b53(0x1ab)+_0x4ef866+')');const _0x5845d7=await resolveAPIKeyAsync(_0x4ef866,_0x56cec9);if(_0x5845d7){const {source:_0x470e08,isDeprecated:_0x33eff6}=_0x5845d7,_0x1e010d=_0x2d9b53(0x1ae)+_0x470e08;console[_0x2d9b53(0x1b7)](_0x33eff6?a13_0x243572[_0x2d9b53(0x1cf)](_0x1e010d):_0x1e010d);}else console[_0x2d9b53(0x1b7)](a13_0x243572['yellow'](_0x2d9b53(0x19f)));try{const _0x37c188=await _0x525809[_0x2d9b53(0x1b5)]['getUserInfo']();return console[_0x2d9b53(0x1b7)](a13_0x243572['green'](_0x2d9b53(0x1cd))),console[_0x2d9b53(0x1b7)](_0x2d9b53(0x1a7)+_0x37c188[_0x2d9b53(0x1bf)]),(_0x37c188[_0x2d9b53(0x1a4)]||_0x37c188[_0x2d9b53(0x1bc)])&&console[_0x2d9b53(0x1b7)](_0x2d9b53(0x1dc)+[_0x37c188['first_name'],_0x37c188['last_name']][_0x2d9b53(0x1d5)](Boolean)[_0x2d9b53(0x1cb)]('\x20')),0x0;}catch(_0x36a1eb){return _0x36a1eb instanceof HTTPClientError&&_0x36a1eb[_0x2d9b53(0x1c4)]===0x191?printAuthError(_0x36a1eb,!![],_0x56cec9):console[_0x2d9b53(0x1b0)](a13_0x243572[_0x2d9b53(0x1da)](_0x2d9b53(0x1a1)+(_0x36a1eb instanceof Error?_0x36a1eb[_0x2d9b53(0x1ca)]:String(_0x36a1eb)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a13_0x26bbd4(0x1b1);[a13_0x26bbd4(0x1bd)]=a13_0x26bbd4(0x1e2);async[a13_0x26bbd4(0x1be)](_0x2012c4){const _0x43ea89=a13_0x26bbd4,{options:_0x5e02ba}=_0x2012c4,_0x29e9fd=_0x5e02ba[_0x43ea89(0x1b9)];console['log'](a13_0x243572['bold'](_0x43ea89(0x1c8)));const _0x966893=await isKeychainAvailable();if(!_0x966893)return console[_0x43ea89(0x1b0)](a13_0x243572[_0x43ea89(0x1da)](_0x43ea89(0x1d3))),0x1;const _0x34407d=await deleteKeychainAPIKey(_0x29e9fd);return _0x34407d?(clearCredentialCache(),console[_0x43ea89(0x1b7)](_0x43ea89(0x1dd)+(_0x29e9fd?'\x20(profile:\x20'+_0x29e9fd+')':'')),0x0):(console['log'](_0x43ea89(0x1df)+(_0x29e9fd?'\x20for\x20profile:\x20'+_0x29e9fd:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x4368af=a14_0x5a83;(function(_0x303658,_0x418ff8){const _0x5b625c=a14_0x5a83,_0x3d4c18=_0x303658();while(!![]){try{const _0x3516c7=-parseInt(_0x5b625c(0x158))/0x1*(-parseInt(_0x5b625c(0x160))/0x2)+-parseInt(_0x5b625c(0x179))/0x3+parseInt(_0x5b625c(0x16d))/0x4*(parseInt(_0x5b625c(0x163))/0x5)+parseInt(_0x5b625c(0x161))/0x6*(parseInt(_0x5b625c(0x17c))/0x7)+-parseInt(_0x5b625c(0x157))/0x8+-parseInt(_0x5b625c(0x170))/0x9*(-parseInt(_0x5b625c(0x166))/0xa)+parseInt(_0x5b625c(0x150))/0xb*(-parseInt(_0x5b625c(0x178))/0xc);if(_0x3516c7===_0x418ff8)break;else _0x3d4c18['push'](_0x3d4c18['shift']());}catch(_0x2ea6ff){_0x3d4c18['push'](_0x3d4c18['shift']());}}}(a14_0x1ca4,0xd6f76));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';import{resolveModelAlias}from'../utils/model-aliases.js';function a14_0x5a83(_0x57fbde,_0x50de5f){_0x57fbde=_0x57fbde-0x146;const _0x1ca46f=a14_0x1ca4();let _0x5a8357=_0x1ca46f[_0x57fbde];return _0x5a8357;}function a14_0x1ca4(){const _0x5b586d=['model','streamChat','252398twCRxK','234462lsETuz','tool_call','6874050qJyzpC','stderr','functionName','791330wEYWfF','output','temperature','description','getOrCreateDefaultAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','\x0a[Output:\x20','4BbiaqX','\x0a[Error:\x20','cause','171aLOOdq','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','args','getAgentId','name','data','event','new','12vUhWaw','125988wtqOrL','chat','Chat\x20session:\x20','98RVAZgL','tool','haiku','message','content','\x0a[Tool:\x20','join','code','404','\x27...','chatId','metadata','validate','resolveAgentId','stack','37041037MAsKGc','type','llm','verbose','agent','handleSSEEvent','error','4189912YUkEgC','11TgeNoP','Agent\x20reference\x20must\x20include\x20project\x20name.\x20Usage:\x20--agent\x20\x22Project/Agent\x22','log','write','Error:\x20','Resolving\x20project\x20\x27'];a14_0x1ca4=function(){return _0x5b586d;};return a14_0x1ca4();}function handleSDKError(_0x50c884,_0x5daf23){const _0x2a7a9b=a14_0x5a83;if(_0x50c884 instanceof SDKError)console['error'](_0x2a7a9b(0x15c)+_0x50c884[_0x2a7a9b(0x17f)]),_0x5daf23[_0x2a7a9b(0x153)]&&(_0x50c884[_0x2a7a9b(0x16f)]&&console['error']('\x20\x20Cause:\x20'+_0x50c884['cause']),_0x50c884[_0x2a7a9b(0x14f)]&&(console[_0x2a7a9b(0x156)]('\x0aStack\x20trace:'),console['error'](_0x50c884[_0x2a7a9b(0x14f)])));else throw _0x50c884;}export class ChatCommand extends BaseCommand{[a14_0x4368af(0x174)]=a14_0x4368af(0x17a);[a14_0x4368af(0x169)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a14_0x4368af(0x14d)](_0x451e5a){const _0x3e25d3=a14_0x4368af,_0x3308f3=_0x451e5a[_0x3e25d3(0x172)][_0x3e25d3(0x147)]('\x20');if(!_0x3308f3)return _0x3e25d3(0x171);return undefined;}async[a14_0x4368af(0x15f)](_0x5230aa,_0x1f17ec,_0x41ca47,_0x301129,_0x1848d3){const _0x976759=a14_0x4368af;for await(const _0x2a3336 of _0x5230aa[_0x976759(0x152)][_0x976759(0x17a)](_0x1f17ec,{'agentId':_0x41ca47,'chatId':_0x301129})){if(_0x2a3336[_0x976759(0x151)]===_0x976759(0x14c)){const _0x1c5f37=_0x2a3336['data'][_0x976759(0x14b)];saveLastChatId(_0x1c5f37),_0x1848d3&&console[_0x976759(0x156)](_0x976759(0x17b)+_0x1c5f37);}else _0x2a3336['type']===_0x976759(0x176)&&this['handleSSEEvent'](_0x2a3336[_0x976759(0x175)]);}}async[a14_0x4368af(0x173)](_0x519778,_0x30396d,_0x4c285e,_0x1c4983,_0x2b63b8){const _0x5e4ce5=a14_0x4368af;if(_0x30396d){const {projectName:_0x3fdf3e,agentName:_0x15f720}=parseAgentRef(_0x30396d);if(!_0x15f720)throw new Error(_0x5e4ce5(0x159));const _0x3da1ae=await withSpinner(_0x5e4ce5(0x15d)+_0x3fdf3e+'\x27...',()=>_0x519778[_0x5e4ce5(0x152)]['resolveProjectId'](_0x3fdf3e),{'verbose':_0x2b63b8}),_0x3aca1b=await withSpinner('Resolving\x20agent\x20\x27'+_0x15f720+_0x5e4ce5(0x14a),()=>_0x519778['llm'][_0x5e4ce5(0x14e)](_0x15f720,_0x3da1ae['data']),{'verbose':_0x2b63b8});return _0x3aca1b[_0x5e4ce5(0x175)];}else{const _0x5f231c=_0x4c285e||_0x5e4ce5(0x17e),_0x1260ba=resolveModelAlias(_0x5f231c),_0x51266e=await withSpinner('Getting\x20agent\x20for\x20model\x20\x27'+_0x1260ba+_0x5e4ce5(0x14a),()=>_0x519778[_0x5e4ce5(0x152)][_0x5e4ce5(0x16a)](_0x1260ba,0x0,_0x1c4983),{'verbose':_0x2b63b8});return _0x51266e['data']['id'];}}async['execute'](_0x28bfab){const _0x43c421=a14_0x4368af,{options:_0x5d1b6c,args:_0x4b17a0,tdx:_0x1ebfd5}=_0x28bfab,_0x3159d7=_0x4b17a0[_0x43c421(0x147)]('\x20'),_0x367b97=_0x5d1b6c,_0x13a056=_0x367b97[_0x43c421(0x154)],_0x41a274=_0x367b97[_0x43c421(0x15e)],_0x177161=_0x367b97[_0x43c421(0x168)]?Number(_0x367b97[_0x43c421(0x168)]):undefined,_0x5ae297=_0x367b97[_0x43c421(0x177)];try{let _0x20fe41,_0x5e40be;!_0x5ae297&&(_0x5e40be=loadLastChatId(),_0x5e40be&&_0x5d1b6c[_0x43c421(0x153)]&&console['error']('Continuing\x20chat:\x20'+_0x5e40be));(_0x5ae297||!_0x5e40be)&&(_0x20fe41=await this[_0x43c421(0x173)](_0x1ebfd5,_0x13a056,_0x41a274,_0x177161,_0x5d1b6c[_0x43c421(0x153)]));try{await this['streamChat'](_0x1ebfd5,_0x3159d7,_0x20fe41,_0x5e40be,_0x5d1b6c['verbose']);}catch(_0x430b32){const _0x519116=_0x430b32 instanceof SDKError&&_0x430b32[_0x43c421(0x148)]===ErrorCode['CHAT_NOT_FOUND']||_0x430b32 instanceof Error&&_0x430b32[_0x43c421(0x17f)]['includes'](_0x43c421(0x149));if(_0x519116)_0x5d1b6c['verbose']&&console[_0x43c421(0x156)](_0x43c421(0x16b)),!_0x20fe41&&(_0x20fe41=await this[_0x43c421(0x173)](_0x1ebfd5,_0x13a056,_0x41a274,_0x177161,_0x5d1b6c[_0x43c421(0x153)])),await this['streamChat'](_0x1ebfd5,_0x3159d7,_0x20fe41,undefined,_0x5d1b6c[_0x43c421(0x153)]);else throw _0x430b32;}return console[_0x43c421(0x15a)](),0x0;}catch(_0x155411){return console['error'](),handleSDKError(_0x155411,_0x5d1b6c),0x1;}}[a14_0x4368af(0x155)](_0x100627){const _0x4fe6c=a14_0x4368af;if(_0x4fe6c(0x180)in _0x100627)process['stdout'][_0x4fe6c(0x15b)](_0x100627[_0x4fe6c(0x180)]);else{if(_0x4fe6c(0x162)in _0x100627)process[_0x4fe6c(0x164)][_0x4fe6c(0x15b)](_0x4fe6c(0x146)+_0x100627[_0x4fe6c(0x162)][_0x4fe6c(0x165)]+']\x0a');else{if(_0x4fe6c(0x17d)in _0x100627)process['stderr'][_0x4fe6c(0x15b)]('[Tool\x20result:\x20'+_0x100627[_0x4fe6c(0x17d)][_0x4fe6c(0x165)]+']\x0a');else{if(_0x4fe6c(0x167)in _0x100627)process['stderr'][_0x4fe6c(0x15b)](_0x4fe6c(0x16c)+_0x100627[_0x4fe6c(0x167)][_0x4fe6c(0x174)]+']\x0a'),process['stderr'][_0x4fe6c(0x15b)](_0x100627[_0x4fe6c(0x167)]['content']+'\x0a');else _0x4fe6c(0x156)in _0x100627&&process[_0x4fe6c(0x164)][_0x4fe6c(0x15b)](_0x4fe6c(0x16e)+_0x100627[_0x4fe6c(0x156)]+']\x0a');}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a15_0x490ab6=a15_0x494c;(function(_0x150cc1,_0x2f63e6){const _0x224d6c=a15_0x494c,_0x267d5f=_0x150cc1();while(!![]){try{const _0x8cf3ad=-parseInt(_0x224d6c(0x18d))/0x1+parseInt(_0x224d6c(0x174))/0x2*(-parseInt(_0x224d6c(0x176))/0x3)+parseInt(_0x224d6c(0x1db))/0x4*(parseInt(_0x224d6c(0x19a))/0x5)+-parseInt(_0x224d6c(0x19b))/0x6+parseInt(_0x224d6c(0x1a6))/0x7*(parseInt(_0x224d6c(0x169))/0x8)+parseInt(_0x224d6c(0x17c))/0x9*(parseInt(_0x224d6c(0x1bf))/0xa)+parseInt(_0x224d6c(0x1a1))/0xb;if(_0x8cf3ad===_0x2f63e6)break;else _0x267d5f['push'](_0x267d5f['shift']());}catch(_0x2740a4){_0x267d5f['push'](_0x267d5f['shift']());}}}(a15_0xbaee,0xcca5e));import{spawn}from'node:child_process';import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a15_0x695493 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';function a15_0xbaee(){const _0x5ccece=['utf-8','logger','mcp','Creating\x20.claude/settings.local.json...','marketplace','--transport','12qaRuON','attributes','site','Failed\x20to\x20configure\x20marketplace\x20\x27','start','✓\x20Plugin\x20\x27','stdout','getCurrent','8200MPADym','\x27\x20installed','command','update','resume','name','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','stop','Failed\x20to\x20install\x20plugin\x20\x27','tdx-managed-proxy','http','869546tCLQyx','data','3SoQJqh','tdx-skills','toString','Finding\x20available\x20port...','Setting\x20up\x20project...','getLogPath','18rQZlVO','TD\x20Docs\x20MCP\x20Server','✓\x20Logs\x20saved\x20to\x20','Updating\x20marketplace\x20\x27','message','Claude\x20Code\x20CLI\x20not\x20found','ANTHROPIC_MODEL','\x27\x20updated','td-skills\x20Plugins','text','✓\x20Port\x20','statusLine','Command\x20failed\x20(exit\x20','proxy','tdx','env','Warning:\x20Failed\x20to\x20configure\x20','799036vTDLZp','Command\x20output:\x20','includes','server','install','object','hostname','✓\x20Settings\x20restored:\x20.claude/settings.local.json','originalSettings','stderr','green','Configuring\x20MCP\x20server\x20\x27','\x20already\x20configured','341020fIydvG','4048092pKIoHP','ANTHROPIC_AUTH_TOKEN','):\x20claude\x20','cwd','which','td-skills','14447048MkZQqt','claude','✓\x20Marketplace\x20\x27','user','cause','413kcyqYn','127.0.0.1','continue','execute','Setup\x20failed','string','https://docs.treasuredata.com/mcp','tdx\x20claude\x20statusline','red','✓\x20Logging\x20to\x20','td-docs','✓\x20Settings\x20configured:\x20.claude/settings.local.json','findClaudePath','\x27...','info','debug','Failed\x20to\x20update\x20marketplace\x20\x27','description','exit','settings.local.json','\x27\x20configured','.claude','plugin','sql-skills','add','5841370ZEmRYh','model','port','✓\x20MCP\x20server\x20\x27','ANTHROPIC_BASE_URL','http://127.0.0.1:','Initializing...','Initializing\x20proxy\x20logger...','llm','log','Configuring\x20marketplace\x20\x27','trim','sonnet','stringify','profile','INSTALLATION_FAILED','unshift','already\x20configured','join','parse','error','CLAUDE_CODE_NOT_FOUND'];a15_0xbaee=function(){return _0x5ccece;};return a15_0xbaee();}import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';function a15_0x494c(_0x7ff9c2,_0x1ccad1){_0x7ff9c2=_0x7ff9c2-0x166;const _0xbaee5f=a15_0xbaee();let _0x494c36=_0xbaee5f[_0x7ff9c2];return _0x494c36;}function handleInstallationError(_0x3fde03,_0x59659d,_0x418e60,_0x2205ce){const _0x42e07a=a15_0x494c;errorContains(_0x3fde03,'already\x20exists','already\x20installed',_0x42e07a(0x1d0))?(_0x418e60['text']='✓\x20'+_0x59659d+_0x42e07a(0x199),_0x2205ce?.[_0x42e07a(0x1b4)](_0x59659d+_0x42e07a(0x199)),_0x3fde03 instanceof SDKError&&_0x3fde03['cause']&&_0x2205ce?.[_0x42e07a(0x1b5)](_0x42e07a(0x18e)+_0x3fde03[_0x42e07a(0x1a5)][_0x42e07a(0x180)])):(_0x418e60['warn'](_0x42e07a(0x18c)+_0x59659d),_0x2205ce?.[_0x42e07a(0x1d3)](_0x59659d+'\x20configuration\x20failed',_0x3fde03));}async function executeClaudeCommand(_0x8afd22,_0x4bfcf8,_0x1666af){const _0x32e53d=a15_0x494c;return _0x1666af?.['info']('Executing:\x20claude\x20'+_0x8afd22[_0x32e53d(0x1d1)]('\x20')),new Promise((_0x40e47d,_0x587d7d)=>{const _0x2c44a6=_0x32e53d,_0x5d027d=spawn(_0x2c44a6(0x1a2),_0x8afd22,{'stdio':'pipe'});let _0x28b81c='',_0x1ab677='';_0x5d027d[_0x2c44a6(0x167)]['on'](_0x2c44a6(0x175),_0x15f7d0=>{const _0x4113f3=_0x2c44a6;_0x28b81c+=_0x15f7d0[_0x4113f3(0x178)]();}),_0x5d027d[_0x2c44a6(0x196)]['on'](_0x2c44a6(0x175),_0x57409e=>{const _0x379582=_0x2c44a6;_0x1ab677+=_0x57409e[_0x379582(0x178)]();}),_0x5d027d['on'](_0x2c44a6(0x1b8),_0x56db77=>{const _0x262df9=_0x2c44a6;if(_0x56db77===0x0)_0x40e47d(_0x28b81c);else _0x4bfcf8?(_0x1666af?.[_0x262df9(0x1d3)](_0x262df9(0x188)+_0x56db77+_0x262df9(0x19d)+_0x8afd22[_0x262df9(0x1d1)]('\x20')),_0x587d7d(new SDKError(ErrorCode[_0x262df9(0x1ce)],_0x4bfcf8,new Error(_0x1ab677)))):_0x40e47d('');});});}async function ensureMcpServer(_0x3bcc9c,_0x1cf835,_0x8686dd,_0x3db60,_0x23f609){const _0x4849ae=a15_0x494c;_0x3db60[_0x4849ae(0x185)]=_0x4849ae(0x198)+_0x3bcc9c+_0x4849ae(0x1b3),await executeClaudeCommand([_0x4849ae(0x1d7),_0x4849ae(0x1be),_0x3bcc9c,_0x1cf835,_0x4849ae(0x1da),_0x8686dd],_0x4849ae(0x16f)+_0x3bcc9c+'\x27',_0x23f609),_0x3db60[_0x4849ae(0x185)]=_0x4849ae(0x1c2)+_0x3bcc9c+_0x4849ae(0x1ba);}async function ensureMarketplace(_0x418e2b,_0x25f564,_0x12afdc,_0x19e0ae){const _0x51c0ce=a15_0x494c;_0x12afdc[_0x51c0ce(0x185)]=_0x51c0ce(0x1c9)+_0x418e2b+_0x51c0ce(0x1b3),await executeClaudeCommand([_0x51c0ce(0x1bc),_0x51c0ce(0x1d9),_0x51c0ce(0x1be),_0x25f564],_0x51c0ce(0x1de)+_0x418e2b+'\x27',_0x19e0ae),_0x12afdc[_0x51c0ce(0x185)]=_0x51c0ce(0x1a3)+_0x418e2b+_0x51c0ce(0x1ba);}async function updateMarketplace(_0x3ccdf5,_0x4fdf01,_0x471954){const _0x3de4ee=a15_0x494c;_0x4fdf01[_0x3de4ee(0x185)]=_0x3de4ee(0x17f)+_0x3ccdf5+_0x3de4ee(0x1b3),await executeClaudeCommand([_0x3de4ee(0x1bc),'marketplace',_0x3de4ee(0x16c)],_0x3de4ee(0x1b6)+_0x3ccdf5+'\x27',_0x471954),_0x4fdf01[_0x3de4ee(0x185)]=_0x3de4ee(0x1a3)+_0x3ccdf5+_0x3de4ee(0x183);}async function ensurePlugin(_0x1ec0ae,_0x2dbdc2,_0x5f1e47,_0x2d6933){const _0x4c65b6=a15_0x494c;_0x5f1e47['text']='Installing\x20plugin\x20\x27'+_0x1ec0ae+_0x4c65b6(0x1b3),await executeClaudeCommand([_0x4c65b6(0x1bc),_0x4c65b6(0x191),_0x1ec0ae+'@'+_0x2dbdc2],_0x4c65b6(0x171)+_0x1ec0ae+'\x27',_0x2d6933),_0x5f1e47[_0x4c65b6(0x185)]=_0x4c65b6(0x166)+_0x1ec0ae+_0x4c65b6(0x16a);}async function createClaudeSettings(_0x30d549,_0x5c35f8=a15_0x490ab6(0x1cb),_0x9387af){const _0x264078=a15_0x490ab6,_0x10b91e=join(process[_0x264078(0x19e)](),_0x264078(0x1bb)),_0x3767b9=join(_0x10b91e,_0x264078(0x1b9));await mkdir(_0x10b91e,{'recursive':!![]});let _0x4ff8aa={};if(existsSync(_0x3767b9))try{const _0xd32e51=await readFile(_0x3767b9,_0x264078(0x1d5));_0x4ff8aa=JSON[_0x264078(0x1d2)](_0xd32e51);}catch{_0x4ff8aa={};}const _0x30fe37=_0x4ff8aa[_0x264078(0x18b)]||{},_0xe0014c={'ANTHROPIC_BASE_URL':_0x30fe37['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x30fe37[_0x264078(0x182)],'ANTHROPIC_AUTH_TOKEN':_0x30fe37[_0x264078(0x19c)],'statusLine':_0x4ff8aa[_0x264078(0x187)]},_0xc21c83={..._0x4ff8aa,'env':{..._0x30fe37,'ANTHROPIC_BASE_URL':_0x264078(0x1c4)+_0x30d549,'ANTHROPIC_MODEL':_0x5c35f8,'ANTHROPIC_AUTH_TOKEN':_0x264078(0x172)},'statusLine':{'type':_0x264078(0x16b),'command':_0x9387af?'tdx\x20--profile\x20'+_0x9387af+'\x20claude\x20statusline':_0x264078(0x1ad)}};return await writeFile(_0x3767b9,JSON[_0x264078(0x1cc)](_0xc21c83,null,0x2)+'\x0a'),_0xe0014c;}async function restoreClaudeSettings(_0x5880e5){const _0x4f6498=a15_0x490ab6,_0x16a032=join(process[_0x4f6498(0x19e)](),_0x4f6498(0x1bb)),_0x4d9c04=join(_0x16a032,_0x4f6498(0x1b9));if(!existsSync(_0x4d9c04))return;try{const _0x57418d=await readFile(_0x4d9c04,_0x4f6498(0x1d5)),_0x4725e9=JSON[_0x4f6498(0x1d2)](_0x57418d),_0x54e97e=_0x4725e9[_0x4f6498(0x18b)]||{},_0x3ab0e8=_0x54e97e[_0x4f6498(0x1c3)],_0x435505=((()=>{const _0x138333=_0x4f6498;if(typeof _0x3ab0e8!==_0x138333(0x1ab))return![];try{const _0x39bd1a=new URL(_0x3ab0e8);return _0x39bd1a[_0x138333(0x193)]==='localhost'||_0x39bd1a[_0x138333(0x193)]===_0x138333(0x1a7);}catch{return![];}})());_0x435505?(delete _0x54e97e['ANTHROPIC_BASE_URL'],delete _0x54e97e[_0x4f6498(0x182)],delete _0x54e97e[_0x4f6498(0x19c)]):(_0x5880e5[_0x4f6498(0x1c3)]!==undefined?_0x54e97e[_0x4f6498(0x1c3)]=_0x5880e5[_0x4f6498(0x1c3)]:delete _0x54e97e['ANTHROPIC_BASE_URL'],_0x5880e5[_0x4f6498(0x182)]!==undefined?_0x54e97e[_0x4f6498(0x182)]=_0x5880e5[_0x4f6498(0x182)]:delete _0x54e97e[_0x4f6498(0x182)],_0x5880e5[_0x4f6498(0x19c)]!==undefined?_0x54e97e[_0x4f6498(0x19c)]=_0x5880e5[_0x4f6498(0x19c)]:delete _0x54e97e[_0x4f6498(0x19c)]);const _0x238948=_0x4725e9[_0x4f6498(0x187)],_0x304651=((()=>{const _0x208f68=_0x4f6498;if(!_0x238948||typeof _0x238948!==_0x208f68(0x192))return![];if(_0x238948['type']!==_0x208f68(0x16b))return![];if(typeof _0x238948[_0x208f68(0x16b)]!==_0x208f68(0x1ab))return![];return _0x238948[_0x208f68(0x16b)][_0x208f68(0x18f)](_0x208f68(0x18a))&&_0x238948['command']['includes']('statusline');})());if(_0x304651)delete _0x4725e9[_0x4f6498(0x187)];else _0x5880e5[_0x4f6498(0x187)]!==undefined?_0x4725e9[_0x4f6498(0x187)]=_0x5880e5[_0x4f6498(0x187)]:delete _0x4725e9[_0x4f6498(0x187)];_0x4725e9[_0x4f6498(0x18b)]=_0x54e97e,await writeFile(_0x4d9c04,JSON['stringify'](_0x4725e9,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a15_0x490ab6(0x16e)]=a15_0x490ab6(0x1a2);[a15_0x490ab6(0x1b7)]='Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy';[a15_0x490ab6(0x190)];['originalSettings'];['logger'];[a15_0x490ab6(0x1c1)];async[a15_0x490ab6(0x1a9)](_0x424ae6){const _0x246932=a15_0x490ab6,{tdx:_0x13697d,options:_0x29cc1d,args:_0x5e7b8b}=_0x424ae6;try{const _0x1f35c8=_0x29cc1d,_0xd4fc20=_0x1f35c8[_0x246932(0x1c0)]||'sonnet',_0x11f70d=_0x1f35c8[_0x246932(0x189)]===![],_0x58d090=_0x1f35c8[_0x246932(0x1a8)]===!![],_0x1dc483=_0x1f35c8[_0x246932(0x16d)]===!![],_0x413701=[..._0x5e7b8b];if(_0x58d090)_0x413701[_0x246932(0x1cf)]('-c');else _0x1dc483&&_0x413701[_0x246932(0x1cf)]('-r');const _0x507752=createCommandSpinner(_0x246932(0x1c5),{'verbose':_0x29cc1d['verbose']});_0x507752[_0x246932(0x1df)]();try{if(!_0x11f70d){_0x507752[_0x246932(0x185)]=_0x246932(0x179),this['port']=await findAvailablePort(0xfa0),_0x507752[_0x246932(0x185)]=_0x246932(0x186)+this[_0x246932(0x1c1)],_0x507752[_0x246932(0x185)]=_0x246932(0x17a);const _0x1b2589=await _0x13697d[_0x246932(0x1c7)]['getOrCreateDefaultProject'](),_0x4f2c08=_0x1b2589['id'];_0x507752[_0x246932(0x185)]='✓\x20Using\x20project:\x20'+_0x1b2589[_0x246932(0x1dc)][_0x246932(0x16e)];const _0xdf24d8=_0x29cc1d[_0x246932(0x1cd)];try{const _0x172cce=await _0x13697d[_0x246932(0x1a4)][_0x246932(0x168)]();_0x172cce['account_id']&&writeCachedAccountInfo(_0x29cc1d[_0x246932(0x1dd)],_0x172cce['account_id'],_0xdf24d8);}catch{}_0x507752[_0x246932(0x185)]=_0x246932(0x1c6),this[_0x246932(0x1d6)]=new TDXLogger(_0x29cc1d['logLevel'],!![]),await this[_0x246932(0x1d6)]['init']();const _0x2a0397=this['logger'][_0x246932(0x17b)]();_0x507752[_0x246932(0x185)]=_0x246932(0x1af)+_0x2a0397,_0x507752[_0x246932(0x185)]='Starting\x20TD\x20LLM\x20proxy\x20server...',this[_0x246932(0x190)]=new ProxyServer({'port':this[_0x246932(0x1c1)],'projectId':_0x4f2c08,'tdx':_0x13697d,'logger':this['logger'],'site':_0x29cc1d[_0x246932(0x1dd)]}),await this[_0x246932(0x190)][_0x246932(0x1df)](),_0x507752[_0x246932(0x185)]='✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20'+this[_0x246932(0x1c1)],_0x507752['text']=_0x246932(0x1d8),this[_0x246932(0x195)]=await createClaudeSettings(this[_0x246932(0x1c1)],_0xd4fc20,_0xdf24d8),_0x507752['text']=_0x246932(0x1b1);}else _0x507752['text']='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';try{await ensureMcpServer(_0x246932(0x1b0),_0x246932(0x1ac),_0x246932(0x173),_0x507752,this[_0x246932(0x1d6)]);}catch(_0x574910){handleInstallationError(_0x574910,_0x246932(0x17d),_0x507752,this[_0x246932(0x1d6)]);}try{await ensureMarketplace('td-skills','https://github.com/treasure-data/td-skills',_0x507752,this[_0x246932(0x1d6)]),await updateMarketplace(_0x246932(0x1a0),_0x507752,this['logger']),await ensurePlugin(_0x246932(0x1bd),_0x246932(0x1a0),_0x507752,this['logger']),await ensurePlugin('workflow-skills','td-skills',_0x507752,this[_0x246932(0x1d6)]),await ensurePlugin(_0x246932(0x177),_0x246932(0x1a0),_0x507752,this[_0x246932(0x1d6)]);}catch(_0x30b0ad){handleInstallationError(_0x30b0ad,_0x246932(0x184),_0x507752,this[_0x246932(0x1d6)]);}_0x507752[_0x246932(0x170)]();}catch(_0x77d037){_0x507752['fail'](_0x246932(0x1aa));throw _0x77d037;}const _0x4874fd=await this[_0x246932(0x1b2)]();if(!_0x4874fd)throw new SDKError(ErrorCode[_0x246932(0x1d4)],_0x246932(0x181),undefined,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'});const _0x20993f={...process['env']};!_0x11f70d&&(_0x20993f[_0x246932(0x1c3)]=_0x246932(0x1c4)+this[_0x246932(0x1c1)],_0x20993f[_0x246932(0x182)]=_0xd4fc20,_0x20993f[_0x246932(0x19c)]=_0x246932(0x172));const _0x4a5857=spawn(_0x4874fd,_0x413701,{'stdio':'inherit','env':_0x20993f}),_0x8cb9d5=await new Promise(_0x53aaa9=>{const _0x4f1f8d=_0x246932;_0x4a5857['on'](_0x4f1f8d(0x1b8),_0x126b10=>{_0x53aaa9(_0x126b10||0x0);}),_0x4a5857['on'](_0x4f1f8d(0x1d3),_0x530dff=>{const _0x3e9d5d=_0x4f1f8d;console[_0x3e9d5d(0x1d3)](a15_0x695493[_0x3e9d5d(0x1ae)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x530dff[_0x3e9d5d(0x180)])),_0x53aaa9(0x1);});});this['server']&&(await this[_0x246932(0x190)][_0x246932(0x170)](),console[_0x246932(0x1c8)](a15_0x695493['green']('✓\x20TD\x20LLM\x20proxy\x20server\x20stopped')));if(this[_0x246932(0x1d6)]){await this['logger']['close']();const _0x4d7fed=this[_0x246932(0x1d6)][_0x246932(0x17b)]();console[_0x246932(0x1c8)](a15_0x695493[_0x246932(0x197)](_0x246932(0x17e)+_0x4d7fed));}return this[_0x246932(0x195)]&&(await restoreClaudeSettings(this[_0x246932(0x195)]),console[_0x246932(0x1c8)](a15_0x695493[_0x246932(0x197)](_0x246932(0x194)))),_0x8cb9d5;}catch(_0x452a25){this[_0x246932(0x190)]&&await this[_0x246932(0x190)][_0x246932(0x170)]();this[_0x246932(0x1d6)]&&await this[_0x246932(0x1d6)]['close']();this[_0x246932(0x195)]&&await restoreClaudeSettings(this[_0x246932(0x195)]);throw _0x452a25;}}async[a15_0x490ab6(0x1b2)](){return new Promise(_0x2aaf92=>{const _0x59c038=a15_0x494c,_0x285057=spawn(_0x59c038(0x19f),[_0x59c038(0x1a2)]);let _0x2634a3='';_0x285057[_0x59c038(0x167)]['on']('data',_0x193d2b=>{const _0x2f0388=_0x59c038;_0x2634a3+=_0x193d2b[_0x2f0388(0x178)]();}),_0x285057['on'](_0x59c038(0x1b8),_0xec5f23=>{const _0x2c9a17=_0x59c038;_0xec5f23===0x0&&_0x2634a3[_0x2c9a17(0x1ca)]()?_0x2aaf92(_0x2634a3[_0x2c9a17(0x1ca)]()):_0x2aaf92(null);});});}}
|
|
1
|
+
const a15_0x2dd6a2=a15_0x1a51;(function(_0x1428e5,_0x3438da){const _0x12dddd=a15_0x1a51,_0x2e4fe3=_0x1428e5();while(!![]){try{const _0x19a6ea=-parseInt(_0x12dddd(0xe6))/0x1+-parseInt(_0x12dddd(0x12e))/0x2*(-parseInt(_0x12dddd(0x146))/0x3)+parseInt(_0x12dddd(0x15b))/0x4+parseInt(_0x12dddd(0x108))/0x5+-parseInt(_0x12dddd(0x100))/0x6+-parseInt(_0x12dddd(0x123))/0x7*(-parseInt(_0x12dddd(0xe2))/0x8)+-parseInt(_0x12dddd(0x124))/0x9;if(_0x19a6ea===_0x3438da)break;else _0x2e4fe3['push'](_0x2e4fe3['shift']());}catch(_0x142ab0){_0x2e4fe3['push'](_0x2e4fe3['shift']());}}}(a15_0x4c87,0x6a67b));import{spawn}from'node:child_process';import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a15_0x51a9c9 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';function a15_0x4c87(){const _0x522c87=['✓\x20Settings\x20configured:\x20.claude/settings.local.json','join','tdx-skills','Failed\x20to\x20install\x20plugin\x20\x27','proxy','inherit','env','Updating\x20marketplace\x20\x27','Failed\x20to\x20launch\x20Claude\x20Code:\x20','parse','pipe','stderr','getCurrent','site','\x20claude\x20statusline','✓\x20Settings\x20restored:\x20.claude/settings.local.json','account_id','close','tdx\x20--profile\x20','3341312KmznIz','Failed\x20to\x20update\x20marketplace\x20\x27','✓\x20Marketplace\x20\x27','execute','stdout','\x20already\x20configured','ANTHROPIC_AUTH_TOKEN','originalSettings','✓\x20Logging\x20to\x20','8SmOmZW','Executing:\x20claude\x20','✓\x20Logs\x20saved\x20to\x20','string','469428ftrpXb','error','getOrCreateDefaultProject','td-docs','red','verbose','td-skills','✓\x20MCP\x20server\x20\x27','settings.local.json','cwd','plugin','port','user','llm','ANTHROPIC_BASE_URL','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','command','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','which','stop','INSTALLATION_FAILED','includes','model','statusLine','resume','tdx-managed-proxy','841698uTPAgY','logger','Setting\x20up\x20project...','cause','✓\x20Plugin\x20\x27','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','Command\x20failed\x20(exit\x20','tdx','1662905yiOAeq','\x27\x20installed','.claude','mcp','):\x20claude\x20','data','findClaudePath','Creating\x20.claude/settings.local.json...','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','start','Installing\x20plugin\x20\x27','http://127.0.0.1:','info','logLevel','Setup\x20failed','\x27\x20updated','localhost','toString','name','update','stringify','\x27...','install','server','add','unshift','exit','5148115KfRAkK','12539772AlpqKU','trim','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','getLogPath','--transport','marketplace','green','\x27\x20configured','\x20configuration\x20failed','type','89250OryJSp','message','attributes','Initializing\x20proxy\x20logger...','continue','td-skills\x20Plugins','claude','Initializing...','sql-skills','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','hostname','✓\x20Port\x20','text','TD\x20Docs\x20MCP\x20Server','ANTHROPIC_MODEL','tdx\x20claude\x20statusline','log','sonnet','utf-8','object','http','debug','warn','127.0.0.1','36LWxKEg','workflow-skills'];a15_0x4c87=function(){return _0x522c87;};return a15_0x4c87();}import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';function a15_0x1a51(_0x136e87,_0x5041ec){_0x136e87=_0x136e87-0xdf;const _0x4c870b=a15_0x4c87();let _0x1a5151=_0x4c870b[_0x136e87];return _0x1a5151;}import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo}from'../core/config.js';function handleInstallationError(_0x3c9baf,_0xcaf73d,_0x691d17,_0x22def2){const _0x251eb2=a15_0x1a51;errorContains(_0x3c9baf,'already\x20exists','already\x20installed','already\x20configured')?(_0x691d17[_0x251eb2(0x13a)]='✓\x20'+_0xcaf73d+'\x20already\x20configured',_0x22def2?.[_0x251eb2(0x114)](_0xcaf73d+_0x251eb2(0x160)),_0x3c9baf instanceof SDKError&&_0x3c9baf[_0x251eb2(0x103)]&&_0x22def2?.[_0x251eb2(0x143)]('Command\x20output:\x20'+_0x3c9baf['cause']['message'])):(_0x691d17[_0x251eb2(0x144)]('Warning:\x20Failed\x20to\x20configure\x20'+_0xcaf73d),_0x22def2?.[_0x251eb2(0xe7)](_0xcaf73d+_0x251eb2(0x12c),_0x3c9baf));}async function executeClaudeCommand(_0x48418e,_0x19c452,_0x15ae3e){const _0x29adc9=a15_0x1a51;return _0x15ae3e?.[_0x29adc9(0x114)](_0x29adc9(0xe3)+_0x48418e[_0x29adc9(0x149)]('\x20')),new Promise((_0x384e8b,_0x34f5d7)=>{const _0x5db880=_0x29adc9,_0x1f9691=spawn(_0x5db880(0x134),_0x48418e,{'stdio':_0x5db880(0x152)});let _0x15e0e6='',_0x1e2f7e='';_0x1f9691[_0x5db880(0x15f)]['on']('data',_0x56cefb=>{const _0x1c9426=_0x5db880;_0x15e0e6+=_0x56cefb[_0x1c9426(0x119)]();}),_0x1f9691[_0x5db880(0x153)]['on'](_0x5db880(0x10d),_0x26db18=>{const _0x48d40c=_0x5db880;_0x1e2f7e+=_0x26db18[_0x48d40c(0x119)]();}),_0x1f9691['on'](_0x5db880(0x122),_0x23f0fa=>{const _0x483736=_0x5db880;if(_0x23f0fa===0x0)_0x384e8b(_0x15e0e6);else _0x19c452?(_0x15ae3e?.['error'](_0x483736(0x106)+_0x23f0fa+_0x483736(0x10c)+_0x48418e[_0x483736(0x149)]('\x20')),_0x34f5d7(new SDKError(ErrorCode[_0x483736(0xfa)],_0x19c452,new Error(_0x1e2f7e)))):_0x384e8b('');});});}async function ensureMcpServer(_0x220c6a,_0x1a95a4,_0x30cb77,_0x59b152,_0x424477){const _0x3f98f6=a15_0x1a51;_0x59b152[_0x3f98f6(0x13a)]='Configuring\x20MCP\x20server\x20\x27'+_0x220c6a+_0x3f98f6(0x11d),await executeClaudeCommand([_0x3f98f6(0x10b),'add',_0x220c6a,_0x1a95a4,_0x3f98f6(0x128),_0x30cb77],_0x3f98f6(0x137)+_0x220c6a+'\x27',_0x424477),_0x59b152[_0x3f98f6(0x13a)]=_0x3f98f6(0xed)+_0x220c6a+_0x3f98f6(0x12b);}async function ensureMarketplace(_0x508258,_0x4df407,_0x1e0b9a,_0x2b5859){const _0x486942=a15_0x1a51;_0x1e0b9a[_0x486942(0x13a)]='Configuring\x20marketplace\x20\x27'+_0x508258+_0x486942(0x11d),await executeClaudeCommand([_0x486942(0xf0),_0x486942(0x129),_0x486942(0x120),_0x4df407],'Failed\x20to\x20configure\x20marketplace\x20\x27'+_0x508258+'\x27',_0x2b5859),_0x1e0b9a[_0x486942(0x13a)]=_0x486942(0x15d)+_0x508258+_0x486942(0x12b);}async function updateMarketplace(_0x51f7fe,_0x645820,_0x2c1af5){const _0x4c6bb8=a15_0x1a51;_0x645820[_0x4c6bb8(0x13a)]=_0x4c6bb8(0x14f)+_0x51f7fe+_0x4c6bb8(0x11d),await executeClaudeCommand(['plugin','marketplace',_0x4c6bb8(0x11b)],_0x4c6bb8(0x15c)+_0x51f7fe+'\x27',_0x2c1af5),_0x645820['text']='✓\x20Marketplace\x20\x27'+_0x51f7fe+_0x4c6bb8(0x117);}async function ensurePlugin(_0x47ab6d,_0x16e7e7,_0x303257,_0x1716c7){const _0x51b504=a15_0x1a51;_0x303257[_0x51b504(0x13a)]=_0x51b504(0x112)+_0x47ab6d+_0x51b504(0x11d),await executeClaudeCommand([_0x51b504(0xf0),_0x51b504(0x11e),_0x47ab6d+'@'+_0x16e7e7],_0x51b504(0x14b)+_0x47ab6d+'\x27',_0x1716c7),_0x303257[_0x51b504(0x13a)]=_0x51b504(0x104)+_0x47ab6d+_0x51b504(0x109);}async function createClaudeSettings(_0x5c9cca,_0x53ea17=a15_0x2dd6a2(0x13f),_0x2e17c7){const _0x48175a=a15_0x2dd6a2,_0x23a79d=join(process[_0x48175a(0xef)](),_0x48175a(0x10a)),_0x568ad9=join(_0x23a79d,_0x48175a(0xee));await mkdir(_0x23a79d,{'recursive':!![]});let _0x5db596={};if(existsSync(_0x568ad9))try{const _0x19f0f8=await readFile(_0x568ad9,_0x48175a(0x140));_0x5db596=JSON[_0x48175a(0x151)](_0x19f0f8);}catch{_0x5db596={};}const _0x554f9c=_0x5db596[_0x48175a(0x14e)]||{},_0x2f1e69={'ANTHROPIC_BASE_URL':_0x554f9c['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x554f9c['ANTHROPIC_MODEL'],'ANTHROPIC_AUTH_TOKEN':_0x554f9c[_0x48175a(0xdf)],'statusLine':_0x5db596[_0x48175a(0xfd)]},_0x35f6dc={..._0x5db596,'env':{..._0x554f9c,'ANTHROPIC_BASE_URL':_0x48175a(0x113)+_0x5c9cca,'ANTHROPIC_MODEL':_0x53ea17,'ANTHROPIC_AUTH_TOKEN':_0x48175a(0xff)},'statusLine':{'type':_0x48175a(0xf6),'command':_0x2e17c7?_0x48175a(0x15a)+_0x2e17c7+_0x48175a(0x156):_0x48175a(0x13d)}};return await writeFile(_0x568ad9,JSON[_0x48175a(0x11c)](_0x35f6dc,null,0x2)+'\x0a'),_0x2f1e69;}async function restoreClaudeSettings(_0x4c47af){const _0x51206f=a15_0x2dd6a2,_0x30c142=join(process[_0x51206f(0xef)](),'.claude'),_0x101042=join(_0x30c142,_0x51206f(0xee));if(!existsSync(_0x101042))return;try{const _0x1c76f7=await readFile(_0x101042,_0x51206f(0x140)),_0x5c74b6=JSON[_0x51206f(0x151)](_0x1c76f7),_0x10ebc0=_0x5c74b6[_0x51206f(0x14e)]||{},_0x10a9db=_0x10ebc0[_0x51206f(0xf4)],_0xcc547=((()=>{const _0x3416bc=_0x51206f;if(typeof _0x10a9db!==_0x3416bc(0xe5))return![];try{const _0xb4d750=new URL(_0x10a9db);return _0xb4d750[_0x3416bc(0x138)]===_0x3416bc(0x118)||_0xb4d750['hostname']===_0x3416bc(0x145);}catch{return![];}})());_0xcc547?(delete _0x10ebc0[_0x51206f(0xf4)],delete _0x10ebc0['ANTHROPIC_MODEL'],delete _0x10ebc0[_0x51206f(0xdf)]):(_0x4c47af[_0x51206f(0xf4)]!==undefined?_0x10ebc0[_0x51206f(0xf4)]=_0x4c47af['ANTHROPIC_BASE_URL']:delete _0x10ebc0[_0x51206f(0xf4)],_0x4c47af[_0x51206f(0x13c)]!==undefined?_0x10ebc0['ANTHROPIC_MODEL']=_0x4c47af['ANTHROPIC_MODEL']:delete _0x10ebc0[_0x51206f(0x13c)],_0x4c47af[_0x51206f(0xdf)]!==undefined?_0x10ebc0[_0x51206f(0xdf)]=_0x4c47af[_0x51206f(0xdf)]:delete _0x10ebc0['ANTHROPIC_AUTH_TOKEN']);const _0x30b6f9=_0x5c74b6[_0x51206f(0xfd)],_0x2c247=((()=>{const _0x18daf5=_0x51206f;if(!_0x30b6f9||typeof _0x30b6f9!==_0x18daf5(0x141))return![];if(_0x30b6f9[_0x18daf5(0x12d)]!==_0x18daf5(0xf6))return![];if(typeof _0x30b6f9[_0x18daf5(0xf6)]!==_0x18daf5(0xe5))return![];return _0x30b6f9[_0x18daf5(0xf6)][_0x18daf5(0xfb)](_0x18daf5(0x107))&&_0x30b6f9[_0x18daf5(0xf6)]['includes']('statusline');})());if(_0x2c247)delete _0x5c74b6[_0x51206f(0xfd)];else _0x4c47af[_0x51206f(0xfd)]!==undefined?_0x5c74b6['statusLine']=_0x4c47af[_0x51206f(0xfd)]:delete _0x5c74b6[_0x51206f(0xfd)];_0x5c74b6[_0x51206f(0x14e)]=_0x10ebc0,await writeFile(_0x101042,JSON[_0x51206f(0x11c)](_0x5c74b6,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a15_0x2dd6a2(0x11a)]='claude';['description']=a15_0x2dd6a2(0xf7);[a15_0x2dd6a2(0x11f)];[a15_0x2dd6a2(0xe0)];[a15_0x2dd6a2(0x101)];[a15_0x2dd6a2(0xf1)];async[a15_0x2dd6a2(0x15e)](_0x230161){const _0x34c171=a15_0x2dd6a2,{tdx:_0x10144b,options:_0x6116fa,args:_0x399b57}=_0x230161;try{const _0x109a38=_0x6116fa,_0x2635a2=_0x109a38[_0x34c171(0xfc)]||'sonnet',_0x123b7c=_0x109a38[_0x34c171(0x14c)]===![],_0x5167ba=_0x109a38[_0x34c171(0x132)]===!![],_0x373d98=_0x109a38[_0x34c171(0xfe)]===!![],_0x30ce83=[..._0x399b57];if(_0x5167ba)_0x30ce83['unshift']('-c');else _0x373d98&&_0x30ce83[_0x34c171(0x121)]('-r');const _0x5f1ae5=createCommandSpinner(_0x34c171(0x135),{'verbose':_0x6116fa[_0x34c171(0xeb)]});_0x5f1ae5['start']();try{if(!_0x123b7c){_0x5f1ae5[_0x34c171(0x13a)]='Finding\x20available\x20port...',this[_0x34c171(0xf1)]=await findAvailablePort(0xfa0),_0x5f1ae5['text']=_0x34c171(0x139)+this[_0x34c171(0xf1)],_0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0x102);const _0x4fc956=await _0x10144b[_0x34c171(0xf3)][_0x34c171(0xe8)](),_0x275078=_0x4fc956['id'];_0x5f1ae5[_0x34c171(0x13a)]='✓\x20Using\x20project:\x20'+_0x4fc956[_0x34c171(0x130)][_0x34c171(0x11a)];const _0x5e0904=_0x6116fa['profile'];try{const _0x2387bb=await _0x10144b[_0x34c171(0xf2)][_0x34c171(0x154)]();_0x2387bb[_0x34c171(0x158)]&&writeCachedAccountInfo(_0x6116fa[_0x34c171(0x155)],_0x2387bb['account_id'],_0x5e0904);}catch{}_0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0x131),this[_0x34c171(0x101)]=new TDXLogger(_0x6116fa[_0x34c171(0x115)],!![]),await this[_0x34c171(0x101)]['init']();const _0x4451d2=this['logger']['getLogPath']();_0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0xe1)+_0x4451d2,_0x5f1ae5[_0x34c171(0x13a)]='Starting\x20TD\x20LLM\x20proxy\x20server...',this['server']=new ProxyServer({'port':this['port'],'projectId':_0x275078,'tdx':_0x10144b,'logger':this[_0x34c171(0x101)],'site':_0x6116fa[_0x34c171(0x155)]}),await this[_0x34c171(0x11f)][_0x34c171(0x111)](),_0x5f1ae5['text']=_0x34c171(0x105)+this[_0x34c171(0xf1)],_0x5f1ae5['text']=_0x34c171(0x10f),this[_0x34c171(0xe0)]=await createClaudeSettings(this['port'],_0x2635a2,_0x5e0904),_0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0x148);}else _0x5f1ae5[_0x34c171(0x13a)]=_0x34c171(0x126);try{await ensureMcpServer(_0x34c171(0xe9),'https://docs.treasuredata.com/mcp',_0x34c171(0x142),_0x5f1ae5,this['logger']);}catch(_0x32d259){handleInstallationError(_0x32d259,_0x34c171(0x13b),_0x5f1ae5,this[_0x34c171(0x101)]);}try{await ensureMarketplace('td-skills','https://github.com/treasure-data/td-skills',_0x5f1ae5,this['logger']),await updateMarketplace(_0x34c171(0xec),_0x5f1ae5,this['logger']),await ensurePlugin(_0x34c171(0x136),_0x34c171(0xec),_0x5f1ae5,this['logger']),await ensurePlugin(_0x34c171(0x147),_0x34c171(0xec),_0x5f1ae5,this[_0x34c171(0x101)]),await ensurePlugin(_0x34c171(0x14a),_0x34c171(0xec),_0x5f1ae5,this[_0x34c171(0x101)]);}catch(_0x22b206){handleInstallationError(_0x22b206,_0x34c171(0x133),_0x5f1ae5,this[_0x34c171(0x101)]);}_0x5f1ae5[_0x34c171(0xf9)]();}catch(_0x2577f9){_0x5f1ae5['fail'](_0x34c171(0x116));throw _0x2577f9;}const _0x21b048=await this[_0x34c171(0x10e)]();if(!_0x21b048)throw new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x34c171(0x110)});const _0x4c3f53={...process[_0x34c171(0x14e)]};!_0x123b7c&&(_0x4c3f53[_0x34c171(0xf4)]=_0x34c171(0x113)+this[_0x34c171(0xf1)],_0x4c3f53['ANTHROPIC_MODEL']=_0x2635a2,_0x4c3f53[_0x34c171(0xdf)]='tdx-managed-proxy');const _0x1c7fb7=spawn(_0x21b048,_0x30ce83,{'stdio':_0x34c171(0x14d),'env':_0x4c3f53}),_0x584d0c=await new Promise(_0x141f45=>{const _0x55eb4c=_0x34c171;_0x1c7fb7['on'](_0x55eb4c(0x122),_0x4eb8af=>{_0x141f45(_0x4eb8af||0x0);}),_0x1c7fb7['on'](_0x55eb4c(0xe7),_0xc883dd=>{const _0x307d28=_0x55eb4c;console[_0x307d28(0xe7)](a15_0x51a9c9[_0x307d28(0xea)](_0x307d28(0x150)+_0xc883dd[_0x307d28(0x12f)])),_0x141f45(0x1);});});this[_0x34c171(0x11f)]&&(await this[_0x34c171(0x11f)]['stop'](),console[_0x34c171(0x13e)](a15_0x51a9c9[_0x34c171(0x12a)](_0x34c171(0xf5))));if(this[_0x34c171(0x101)]){await this[_0x34c171(0x101)]['close']();const _0x5c34f5=this['logger'][_0x34c171(0x127)]();console[_0x34c171(0x13e)](a15_0x51a9c9['green'](_0x34c171(0xe4)+_0x5c34f5));}return this[_0x34c171(0xe0)]&&(await restoreClaudeSettings(this[_0x34c171(0xe0)]),console[_0x34c171(0x13e)](a15_0x51a9c9[_0x34c171(0x12a)](_0x34c171(0x157)))),_0x584d0c;}catch(_0x25feb5){this[_0x34c171(0x11f)]&&await this[_0x34c171(0x11f)][_0x34c171(0xf9)]();this[_0x34c171(0x101)]&&await this['logger'][_0x34c171(0x159)]();this[_0x34c171(0xe0)]&&await restoreClaudeSettings(this[_0x34c171(0xe0)]);throw _0x25feb5;}}async[a15_0x2dd6a2(0x10e)](){return new Promise(_0x3e3834=>{const _0x45cd89=a15_0x1a51,_0xc2b4f=spawn(_0x45cd89(0xf8),[_0x45cd89(0x134)]);let _0x57538c='';_0xc2b4f[_0x45cd89(0x15f)]['on'](_0x45cd89(0x10d),_0x301ea7=>{const _0xc7fef=_0x45cd89;_0x57538c+=_0x301ea7[_0xc7fef(0x119)]();}),_0xc2b4f['on']('exit',_0x1f2fde=>{const _0x5fc9a3=_0x45cd89;_0x1f2fde===0x0&&_0x57538c['trim']()?_0x3e3834(_0x57538c[_0x5fc9a3(0x125)]()):_0x3e3834(null);});});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x3d2fd3=a16_0x2fd1;(function(_0x5a4e48,_0x4dee00){const _0x5064e4=a16_0x2fd1,_0x15bf79=_0x5a4e48();while(!![]){try{const _0x156156=-parseInt(_0x5064e4(0xc0))/0x1*(parseInt(_0x5064e4(0xbd))/0x2)+-parseInt(_0x5064e4(0xa9))/0x3*(parseInt(_0x5064e4(0xb0))/0x4)+parseInt(_0x5064e4(0xab))/0x5+-parseInt(_0x5064e4(0xb3))/0x6+parseInt(_0x5064e4(0xb8))/0x7*(parseInt(_0x5064e4(0xbb))/0x8)+parseInt(_0x5064e4(0xb6))/0x9+parseInt(_0x5064e4(0xaf))/0xa;if(_0x156156===_0x4dee00)break;else _0x15bf79['push'](_0x15bf79['shift']());}catch(_0x539d33){_0x15bf79['push'](_0x15bf79['shift']());}}}(a16_0x2ada,0x621dd));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';function a16_0x2ada(){const _0x4dc8a3=['log','push','stdin','Claude','description','latestInputTokens','name','execute','profile','138TvhtZc','statusline','1785825hoCEph','accountId','close','session_id','6355810hFDMIZ','32324hEzsCt','\x20-\x20','model','1256784IcnDiR','tdx','🧠\x20','571932AXLvkt','\x20today\x20/\x20','7qifhiS','sessionCredits','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','4655712ZjEiQp','\x20|\x20','12722ngTwcg','site','parse','103yEdphp','💎\x20','\x20session\x20/\x20','💎\x20tdx\x20-\x20Claude','toFixed'];a16_0x2ada=function(){return _0x4dc8a3;};return a16_0x2ada();}import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../utils/model-factors.js';async function readStdinJson(_0x251a91=0x64){return new Promise(_0x57c671=>{const _0x28c2f0=a16_0x2fd1;let _0x453a8f='',_0x3c182c=![];const _0x529d90=createInterface({'input':process[_0x28c2f0(0xa2)],'terminal':![]}),_0x1baa91=_0x3196b6=>{const _0x2caedc=_0x28c2f0;if(_0x3c182c)return;_0x3c182c=!![],clearTimeout(_0x4a95b6),_0x529d90[_0x2caedc(0xad)](),_0x57c671(_0x3196b6);},_0x4a95b6=setTimeout(()=>{_0x1baa91(null);},_0x251a91);_0x529d90['on']('line',_0x39a1c2=>{_0x453a8f+=_0x39a1c2;}),_0x529d90['on'](_0x28c2f0(0xad),()=>{const _0x9d602e=_0x28c2f0;if(_0x3c182c)return;try{const _0x3547d5=JSON[_0x9d602e(0xbf)](_0x453a8f);_0x1baa91(_0x3547d5);}catch{_0x1baa91(null);}});});}function a16_0x2fd1(_0x569756,_0x33a4bc){_0x569756=_0x569756-0xa0;const _0x2ada6e=a16_0x2ada();let _0x2fd18a=_0x2ada6e[_0x569756];return _0x2fd18a;}function formatCredits(_0x115dc3){const _0x4423b3=a16_0x2fd1;return _0x115dc3[_0x4423b3(0xc4)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a16_0x3d2fd3(0xa6)]=a16_0x3d2fd3(0xaa);[a16_0x3d2fd3(0xa4)]=a16_0x3d2fd3(0xba);async[a16_0x3d2fd3(0xa7)](_0x37fe89){const _0x25107a=a16_0x3d2fd3;try{const _0x37135d=await readStdinJson();if(!_0x37135d?.[_0x25107a(0xae)])return console[_0x25107a(0xa0)](_0x25107a(0xc3)),0x0;const _0xb4f5d8=_0x37135d['session_id'],_0x492415=_0x37135d[_0x25107a(0xb2)]?.['id']||'',_0x18478e=_0x37135d[_0x25107a(0xa8)]||_0x37fe89['options']['profile'],_0x25a76f=await getUsageStats(_0xb4f5d8,_0x18478e),_0x26a806=[],_0xe0ac31=readCachedAccountInfo(_0x18478e),_0x49bdc9=_0xe0ac31?'tdx\x20'+_0xe0ac31[_0x25107a(0xbe)]+':'+_0xe0ac31[_0x25107a(0xac)]:_0x25107a(0xb4),_0x368f87=_0x492415?getModelDisplayName(_0x492415):_0x25107a(0xa3);_0x26a806[_0x25107a(0xa1)](_0x25107a(0xc1)+_0x49bdc9+_0x25107a(0xb1)+_0x368f87);const _0x2394ab=formatCredits(_0x25a76f[_0x25107a(0xb9)]),_0x3155fd=formatCredits(_0x25a76f['todayCredits']),_0x2e4326=formatCredits(_0x25a76f['monthCredits']);_0x26a806[_0x25107a(0xa1)]('🪙\x20credit:\x20'+_0x2394ab+_0x25107a(0xc2)+_0x3155fd+_0x25107a(0xb7)+_0x2e4326+'\x20month');if(_0x25a76f[_0x25107a(0xa5)]>0x0&&_0x492415){const _0x46ea9f=formatTokenCount(_0x25a76f[_0x25107a(0xa5)]),_0xed2e81=calculateContextPercentage(_0x25a76f[_0x25107a(0xa5)],_0x492415);_0x26a806[_0x25107a(0xa1)](_0x25107a(0xb5)+_0x46ea9f+'\x20('+_0xed2e81+'%)');}return console['log'](_0x26a806['join'](_0x25107a(0xbc))),0x0;}catch{return console[_0x25107a(0xa0)](_0x25107a(0xc3)),0x0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x379910=a17_0x5d21;(function(_0x579961,_0x164a0c){const _0x219c76=a17_0x5d21,_0x108eb3=_0x579961();while(!![]){try{const _0x2dc9e2=parseInt(_0x219c76(0xaf))/0x1+parseInt(_0x219c76(0xbb))/0x2*(parseInt(_0x219c76(0xdb))/0x3)+parseInt(_0x219c76(0xc4))/0x4+-parseInt(_0x219c76(0xd9))/0x5+-parseInt(_0x219c76(0xb2))/0x6*(-parseInt(_0x219c76(0xc1))/0x7)+parseInt(_0x219c76(0xa8))/0x8*(parseInt(_0x219c76(0xb4))/0x9)+-parseInt(_0x219c76(0xc6))/0xa;if(_0x2dc9e2===_0x164a0c)break;else _0x108eb3['push'](_0x108eb3['shift']());}catch(_0x3cb12a){_0x108eb3['push'](_0x108eb3['shift']());}}}(a17_0x2413,0x1876b));import a17_0x1af28c from'chalk';function a17_0x5d21(_0x532bed,_0x3cdc3d){_0x532bed=_0x532bed-0xa6;const _0x241357=a17_0x2413();let _0x5d2177=_0x241357[_0x532bed];return _0x5d2177;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x5a6e95){const _0x582e61=a17_0x5d21;return _0x5a6e95[_0x582e61(0xae)](0x2);}function formatLastUsed(_0x6fb28d){const _0x4aee24=a17_0x5d21;if(!_0x6fb28d)return _0x4aee24(0xaa);const _0x5ab558=new Date(_0x6fb28d),_0x289a03=new Date(),_0x14e33e=_0x5ab558[_0x4aee24(0xc0)](_0x4aee24(0xd8)),_0x31afc7=_0x289a03[_0x4aee24(0xc0)](_0x4aee24(0xd8));if(_0x14e33e===_0x31afc7)return _0x4aee24(0xd0)+_0x5ab558[_0x4aee24(0xcf)](_0x4aee24(0xab),{'hour':'2-digit','minute':'2-digit'});const _0x1e5de6=new Date(_0x14e33e),_0x1c7345=new Date(_0x31afc7),_0x6475a5=Math['round']((_0x1c7345[_0x4aee24(0xb9)]()-_0x1e5de6['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x6475a5===0x1)return'yesterday';else return _0x6475a5>0x1&&_0x6475a5<0x7?_0x6475a5+_0x4aee24(0xd6):_0x5ab558['toLocaleDateString'](_0x4aee24(0xab),{'month':_0x4aee24(0xa6),'day':_0x4aee24(0xd3)});}export class ClaudeUsageCommand extends BaseCommand{['name']=a17_0x379910(0xb1);[a17_0x379910(0xe0)]=a17_0x379910(0xd5);async[a17_0x379910(0xbd)](_0x308e53){const _0x34eeae=a17_0x379910,{options:_0x725c18}=_0x308e53,_0x37eae8=_0x725c18['format']===_0x34eeae(0xac)||_0x725c18[_0x34eeae(0xc5)]===_0x34eeae(0xd2)||_0x725c18['json'];try{const [_0x251744,_0x2a368a]=await Promise['all']([getAllProfileStats(),getUsageSummary()]);return _0x37eae8?await this[_0x34eeae(0xa9)](_0x251744,_0x2a368a,_0x725c18):this[_0x34eeae(0xc9)](_0x251744,_0x2a368a),0x0;}catch(_0x30ba0e){const _0x3d83e6=_0x30ba0e instanceof Error?_0x30ba0e['message']:_0x34eeae(0xad);return console['error'](a17_0x1af28c['red'](_0x34eeae(0xb6)+_0x3d83e6)),0x1;}}async['outputStructured'](_0x5433d2,_0x3c5603,_0x2ed5f1){const _0x5a6ca7=a17_0x379910,_0x40beb4={'summary':{'todayCredits':_0x3c5603['todayCredits'],'monthCredits':_0x3c5603[_0x5a6ca7(0xe1)],'totalCredits':_0x3c5603[_0x5a6ca7(0xdd)],'profileCount':_0x3c5603[_0x5a6ca7(0xda)]},'profiles':_0x5433d2['map'](_0x3ef176=>({'profile':_0x3ef176[_0x5a6ca7(0xb0)],'credits':_0x3ef176[_0x5a6ca7(0xc8)],'requests':_0x3ef176[_0x5a6ca7(0xca)],'lastUsedAt':_0x3ef176[_0x5a6ca7(0xdc)]}))};await handleSDKOutput([_0x40beb4],_0x2ed5f1);}[a17_0x379910(0xc9)](_0x2e4087,_0x49bdd1){const _0x3bebf4=a17_0x379910;console[_0x3bebf4(0xb5)](a17_0x1af28c[_0x3bebf4(0xb8)]('\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary')),console['log'](a17_0x1af28c[_0x3bebf4(0xc7)]('─'['repeat'](0x32))),console['log'](_0x3bebf4(0xd7)+a17_0x1af28c[_0x3bebf4(0xce)](formatCredits(_0x49bdd1['todayCredits']))+_0x3bebf4(0xbe)),console[_0x3bebf4(0xb5)](_0x3bebf4(0xc3)+a17_0x1af28c[_0x3bebf4(0xce)](formatCredits(_0x49bdd1[_0x3bebf4(0xe1)]))+_0x3bebf4(0xbe)),console['log'](_0x3bebf4(0xc2)+a17_0x1af28c['cyan'](formatCredits(_0x49bdd1['totalCredits']))+_0x3bebf4(0xbe)),console['log']();if(_0x2e4087['length']===0x0){console[_0x3bebf4(0xb5)](a17_0x1af28c['dim']('\x20\x20No\x20usage\x20data\x20recorded\x20yet.')),console[_0x3bebf4(0xb5)](a17_0x1af28c[_0x3bebf4(0xc7)](_0x3bebf4(0xba)));return;}console['log'](a17_0x1af28c[_0x3bebf4(0xb8)](_0x3bebf4(0xd1))),console[_0x3bebf4(0xb5)](a17_0x1af28c[_0x3bebf4(0xc7)]('─'[_0x3bebf4(0xcd)](0x3c)));const _0x5be1a5=Math[_0x3bebf4(0xd4)](0xc,..._0x2e4087['map'](_0xf64240=>_0xf64240[_0x3bebf4(0xb0)]===_0x3bebf4(0xcc)?_0x3bebf4(0xbc)[_0x3bebf4(0xcb)]:_0xf64240[_0x3bebf4(0xb0)][_0x3bebf4(0xcb)])),_0x2e3dfd=0xa,_0x348ec0=0xa;console[_0x3bebf4(0xb5)]('\x20\x20'+'Profile'[_0x3bebf4(0xdf)](_0x5be1a5)+'\x20\x20'+_0x3bebf4(0xde)[_0x3bebf4(0xb3)](_0x2e3dfd)+'\x20\x20'+_0x3bebf4(0xa7)['padStart'](_0x348ec0)+'\x20\x20'+_0x3bebf4(0xbf));for(const _0x34fa25 of _0x2e4087){const _0x1e1f11=_0x34fa25['profile']==='default'?_0x3bebf4(0xbc):_0x34fa25['profile'],_0x52a075=_0x1e1f11[_0x3bebf4(0xdf)](_0x5be1a5),_0x233884=_0x34fa25[_0x3bebf4(0xb0)]===_0x3bebf4(0xcc)?a17_0x1af28c['dim'](_0x52a075):_0x52a075;console['log']('\x20\x20'+_0x233884+'\x20\x20'+a17_0x1af28c[_0x3bebf4(0xce)](formatCredits(_0x34fa25[_0x3bebf4(0xc8)])[_0x3bebf4(0xb3)](_0x2e3dfd))+'\x20\x20'+String(_0x34fa25[_0x3bebf4(0xca)])[_0x3bebf4(0xb3)](_0x348ec0)+'\x20\x20'+a17_0x1af28c[_0x3bebf4(0xc7)](formatLastUsed(_0x34fa25[_0x3bebf4(0xdc)])));}console[_0x3bebf4(0xb5)](),console[_0x3bebf4(0xb5)](a17_0x1af28c['dim'](_0x3bebf4(0xb7))),console[_0x3bebf4(0xb5)]();}}function a17_0x2413(){const _0x1b69c2=['default','repeat','cyan','toLocaleTimeString','today\x20','Usage\x20by\x20Profile','jsonl','numeric','max','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','\x20days\x20ago','\x20\x20Today:\x20\x20\x20','en-CA','443780KVtUEi','profileCount','3aUjRjK','lastUsedAt','totalCredits','Credits','padEnd','description','monthCredits','short','Requests','4016xcDhZS','outputStructured','never','en-US','json','Unknown\x20error','toFixed','136948FnazsZ','profile','usage','945354WdaxaI','padStart','9QCAteW','log','Error:\x20','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','bold','getTime','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','274150rNSvki','(default)','execute','\x20credits','Last\x20Used','toLocaleDateString','7zJbAqY','\x20\x20Total:\x20\x20\x20','\x20\x20Month:\x20\x20\x20','91612PKYzwz','format','2660280nBJLUa','dim','credits','outputTable','entryCount','length'];a17_0x2413=function(){return _0x1b69c2;};return a17_0x2413();}
|
package/dist/commands/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a18_0x3c42(_0x34d5ba,_0x4b3092){_0x34d5ba=_0x34d5ba-0x16c;const _0x446890=a18_0x4468();let _0x3c4283=_0x446890[_0x34d5ba];return _0x3c4283;}const a18_0x1b5a26=a18_0x3c42;(function(_0x5e432f,_0x5b5ae3){const _0x295a44=a18_0x3c42,_0xefbfd7=_0x5e432f();while(!![]){try{const _0x3c9a74=parseInt(_0x295a44(0x196))/0x1*(-parseInt(_0x295a44(0x19b))/0x2)+parseInt(_0x295a44(0x188))/0x3+-parseInt(_0x295a44(0x199))/0x4+parseInt(_0x295a44(0x181))/0x5+parseInt(_0x295a44(0x17d))/0x6*(-parseInt(_0x295a44(0x16f))/0x7)+parseInt(_0x295a44(0x195))/0x8+-parseInt(_0x295a44(0x17f))/0x9;if(_0x3c9a74===_0x5b5ae3)break;else _0xefbfd7['push'](_0xefbfd7['shift']());}catch(_0x53296b){_0xefbfd7['push'](_0xefbfd7['shift']());}}}(a18_0x4468,0x9a89d));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a18_0x1b45e4 from'chalk';function a18_0x4468(){const _0x1b6348=['Reason:\x20','error','detail','validate','\x20\x20tdx\x20auth','options','isValid','status','2221584aRXeKL','logger','3228066bwBhwc','execute','3970390VfjQbL','name','commands','.\x20Must\x20be\x20a\x20number.','tdx','helpText','stack','14445BnWKRx','getAll','category','debug','value','USER_ERROR','message','number','\x20--profile\x20','\x0aStack\x20trace:\x0a','has','get','Error:\x20','6999640ctuRqY','16VcjLQy','red','\x0aTo\x20set\x20up\x20authentication:','907396wiLzZn','To\x20check\x20your\x20current\x20auth\x20status:','10634KperZI','yellow','validateGlobalOptions','test','7oDTtIr','problemDetails','register','Invalid\x20limit\x20value:\x20','values','profile'];a18_0x4468=function(){return _0x1b6348;};return a18_0x4468();}export function printAuthError(_0x24c058,_0x2077cc=![],_0x27a03b){const _0x1f970f=a18_0x3c42,_0xba3427=_0x24c058[_0x1f970f(0x170)]?.[_0x1f970f(0x177)]||_0x24c058[_0x1f970f(0x18e)];console[_0x1f970f(0x176)](a18_0x1b45e4[_0x1f970f(0x197)]('Authentication\x20failed')),console[_0x1f970f(0x176)](a18_0x1b45e4[_0x1f970f(0x197)](_0x1f970f(0x175)+_0xba3427));if(_0x2077cc){const _0x55da18=_0x27a03b?_0x1f970f(0x190)+_0x27a03b:'';console[_0x1f970f(0x176)](_0x1f970f(0x198)),console[_0x1f970f(0x176)]('\x20\x20tdx\x20auth\x20setup'+_0x55da18+'\x0a'),console[_0x1f970f(0x176)](_0x1f970f(0x19a)),console[_0x1f970f(0x176)](_0x1f970f(0x179)+_0x55da18);}}export class BaseCommand{[a18_0x1b5a26(0x16d)](_0x578e27){const _0x46c6a3=a18_0x1b5a26,{options:_0x182edb}=_0x578e27,_0x30ec07=_0x182edb['limit'];if(_0x30ec07!==undefined){const _0x1cf220=typeof _0x30ec07===_0x46c6a3(0x18f)?_0x30ec07:parseInt(_0x30ec07,0xa);if(isNaN(_0x1cf220))return _0x46c6a3(0x172)+_0x30ec07+_0x46c6a3(0x184);const _0x226746=validateLimitOption(_0x1cf220);if(!_0x226746[_0x46c6a3(0x17b)])return _0x226746[_0x46c6a3(0x176)];_0x578e27[_0x46c6a3(0x17a)]['limit']=_0x226746[_0x46c6a3(0x18c)];}return undefined;}[a18_0x1b5a26(0x178)](_0x2972eb){return undefined;}async['run'](_0x1997af){const _0x490003=a18_0x1b5a26;try{const _0x1ccf6f=this[_0x490003(0x16d)](_0x1997af);if(_0x1ccf6f)return console[_0x490003(0x176)](_0x490003(0x194)+_0x1ccf6f),0x1;const _0x4c3e64=this[_0x490003(0x178)](_0x1997af);if(_0x4c3e64){const _0x27d52f=/^\s*(Usage|Note|Warning|Error):/i[_0x490003(0x16e)](_0x4c3e64);return _0x27d52f?console['error'](_0x4c3e64):console[_0x490003(0x176)]('Error:\x20'+_0x4c3e64),0x1;}const _0x5839ab=await this[_0x490003(0x180)](_0x1997af);return _0x5839ab??0x0;}catch(_0x135652){if(_0x135652 instanceof Error){if(_0x135652 instanceof HTTPClientError&&_0x135652[_0x490003(0x17c)]===0x191){const _0x222066=_0x1997af['options'][_0x490003(0x174)];return printAuthError(_0x135652,!![],_0x222066),_0x135652['stack']&&_0x1997af['tdx']&&(_0x1997af['tdx'][_0x490003(0x17e)][_0x490003(0x18b)]('Authentication\x20error\x20stack\x20trace:'),_0x1997af[_0x490003(0x185)][_0x490003(0x17e)][_0x490003(0x18b)](_0x135652[_0x490003(0x187)])),0x1;}console[_0x490003(0x176)](a18_0x1b45e4['red'](_0x490003(0x194)+_0x135652[_0x490003(0x18e)]));_0x135652 instanceof SDKError&&_0x135652[_0x490003(0x186)]&&console[_0x490003(0x176)](a18_0x1b45e4[_0x490003(0x16c)](_0x135652[_0x490003(0x186)]));const _0xa184ea=_0x135652 instanceof SDKError&&_0x135652[_0x490003(0x18a)]===ErrorCategory[_0x490003(0x18d)];_0x135652[_0x490003(0x187)]&&!_0xa184ea&&console['error'](_0x490003(0x191)+_0x135652[_0x490003(0x187)]);}else console[_0x490003(0x176)](_0x490003(0x194)+String(_0x135652));return 0x1;}}}export class CommandRegistry{[a18_0x1b5a26(0x183)]=new Map();[a18_0x1b5a26(0x171)](_0x576a11){const _0x28085f=a18_0x1b5a26;if(this['commands'][_0x28085f(0x192)](_0x576a11[_0x28085f(0x182)]))throw new Error('Command\x20\x27'+_0x576a11[_0x28085f(0x182)]+'\x27\x20is\x20already\x20registered');this[_0x28085f(0x183)]['set'](_0x576a11[_0x28085f(0x182)],_0x576a11);}[a18_0x1b5a26(0x193)](_0x20cfcf){const _0xdb1cb8=a18_0x1b5a26;return this[_0xdb1cb8(0x183)]['get'](_0x20cfcf);}[a18_0x1b5a26(0x189)](){const _0xf1cce1=a18_0x1b5a26;return Array['from'](this[_0xf1cce1(0x183)][_0xf1cce1(0x173)]());}[a18_0x1b5a26(0x192)](_0x36ef4e){const _0x22dd1a=a18_0x1b5a26;return this[_0x22dd1a(0x183)][_0x22dd1a(0x192)](_0x36ef4e);}}export const registry=new CommandRegistry();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x3dbf1c=a19_0x3168;function a19_0x5e23(){const _0x1d7df5=['cyan','connection:show','Fetching\x20connection\x20\x27','51316JcapLc','padStart','join','✔\x20Found\x20','Site:\x20','error','execute','Show\x20connection\x20details','7952930JmoAju','data','3721275leAzBT','type','name','push','slice','length','Listing\x20connections...','output','18609910zFmXgV','2064XauGIH','12131IYnqBf','connection','connection:list','\x27...','resolve','39PnLitv','limit','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','validate','\x20-\x20','list','6jzACCH','Looking\x20up\x20connection:\x20','owner','35ntGdIT','max','\x20connection','site','669655ARybKR','112444oqhUzO','description','table','verbose','map'];a19_0x5e23=function(){return _0x1d7df5;};return a19_0x5e23();}(function(_0x3d0974,_0x41d109){const _0x58c152=a19_0x3168,_0x1f8885=_0x3d0974();while(!![]){try{const _0x2692df=parseInt(_0x58c152(0x15d))/0x1*(parseInt(_0x58c152(0x16a))/0x2)+-parseInt(_0x58c152(0x154))/0x3*(-parseInt(_0x58c152(0x162))/0x4)+-parseInt(_0x58c152(0x161))/0x5*(-parseInt(_0x58c152(0x15a))/0x6)+-parseInt(_0x58c152(0x17e))/0x7*(parseInt(_0x58c152(0x17d))/0x8)+parseInt(_0x58c152(0x174))/0x9+parseInt(_0x58c152(0x172))/0xa+-parseInt(_0x58c152(0x17c))/0xb;if(_0x2692df===_0x41d109)break;else _0x1f8885['push'](_0x1f8885['shift']());}catch(_0x5e374d){_0x1f8885['push'](_0x1f8885['shift']());}}}(a19_0x5e23,0x72130));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import a19_0x7daa11 from'chalk';export class ConnectionListCommand extends BaseCommand{['name']=a19_0x3dbf1c(0x180);[a19_0x3dbf1c(0x163)]='List\x20all\x20result\x20output\x20connections';async[a19_0x3dbf1c(0x170)](_0x2fa074){const _0x2dd5fa=a19_0x3dbf1c,{options:_0x4ab1df,tdx:_0x535382}=_0x2fa074;_0x4ab1df['verbose']&&console[_0x2dd5fa(0x16f)](_0x2dd5fa(0x16e)+_0x4ab1df[_0x2dd5fa(0x160)]);const _0x1930b3=resolveLimit(_0x4ab1df[_0x2dd5fa(0x155)],DEFAULT_LISTING_LIMIT),_0xe13c5f=await withSpinner(_0x2dd5fa(0x17a),()=>_0x535382[_0x2dd5fa(0x17f)][_0x2dd5fa(0x159)](),{'verbose':_0x4ab1df[_0x2dd5fa(0x165)]}),_0x3eb076=_0xe13c5f[_0x2dd5fa(0x173)];console['error'](_0x2dd5fa(0x16d)+_0x3eb076[_0x2dd5fa(0x179)]+_0x2dd5fa(0x15f)+(_0x3eb076[_0x2dd5fa(0x179)]!==0x1?'s':''));if(isStructuredFormat(_0x4ab1df)){const _0x11e25c=_0x3eb076[_0x2dd5fa(0x178)](0x0,_0x1930b3);await handleSDKOutput(_0x11e25c,{..._0x4ab1df,'limit':_0x1930b3});}else{const _0x39664c=_0x3eb076[_0x2dd5fa(0x179)]>0x0?Math[_0x2dd5fa(0x15e)](..._0x3eb076[_0x2dd5fa(0x166)](_0x1db2af=>_0x1db2af['type'][_0x2dd5fa(0x179)])):0x0,_0x3d3050=[];for(const _0x43373e of _0x3eb076){const _0x56d0de=a19_0x7daa11[_0x2dd5fa(0x167)](_0x43373e[_0x2dd5fa(0x175)][_0x2dd5fa(0x16b)](_0x39664c)),_0x3e6fd2=_0x43373e['owner']?.[_0x2dd5fa(0x176)]?_0x2dd5fa(0x158)+a19_0x7daa11['dim'](_0x43373e[_0x2dd5fa(0x15c)]['name']):'';_0x3d3050[_0x2dd5fa(0x177)](_0x56d0de+'\x20\x20'+_0x43373e[_0x2dd5fa(0x176)]+_0x3e6fd2);}await writeOutput(_0x3d3050[_0x2dd5fa(0x16c)]('\x0a'),_0x4ab1df[_0x2dd5fa(0x17b)],_0x2dd5fa(0x164));}return 0x0;}}function a19_0x3168(_0x21c47a,_0x72230d){_0x21c47a=_0x21c47a-0x154;const _0x5e2346=a19_0x5e23();let _0x31683c=_0x5e2346[_0x21c47a];return _0x31683c;}export class ConnectionShowCommand extends BaseCommand{[a19_0x3dbf1c(0x176)]=a19_0x3dbf1c(0x168);[a19_0x3dbf1c(0x163)]=a19_0x3dbf1c(0x171);[a19_0x3dbf1c(0x157)](_0x3b773c){const _0x10c35d=a19_0x3dbf1c,{args:_0x2830d3}=_0x3b773c;if(!_0x2830d3[0x0])return _0x10c35d(0x156);return undefined;}async[a19_0x3dbf1c(0x170)](_0x1d0bee){const _0x5ba3c2=a19_0x3dbf1c,{options:_0x5f38ca,args:_0x37a2a6,tdx:_0xa067da}=_0x1d0bee,_0x3ad7ee=_0x37a2a6[0x0];_0x5f38ca[_0x5ba3c2(0x165)]&&(console[_0x5ba3c2(0x16f)](_0x5ba3c2(0x16e)+_0x5f38ca[_0x5ba3c2(0x160)]),console[_0x5ba3c2(0x16f)](_0x5ba3c2(0x15b)+_0x3ad7ee));const _0x3f70e5=await withSpinner(_0x5ba3c2(0x169)+_0x3ad7ee+_0x5ba3c2(0x181),()=>_0xa067da[_0x5ba3c2(0x17f)][_0x5ba3c2(0x182)](_0x3ad7ee),{'verbose':_0x5f38ca['verbose']}),_0x218ead=_0x3f70e5[_0x5ba3c2(0x173)];return console[_0x5ba3c2(0x16f)]('✔\x20Found\x20connection:\x20'+_0x218ead[_0x5ba3c2(0x176)]),await handleSingleObjectOutput(_0x218ead,_0x5f38ca),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a20_0x1402d6=a20_0x1282;function a20_0x1282(_0x1d0189,_0x9c177c){_0x1d0189=_0x1d0189-0x1a2;const _0x2c4148=a20_0x2c41();let _0x12820c=_0x2c4148[_0x1d0189];return _0x12820c;}(function(_0x47ba94,_0x20e52f){const _0x40f370=a20_0x1282,_0x4301d0=_0x47ba94();while(!![]){try{const _0xc322f9=-parseInt(_0x40f370(0x1bd))/0x1+-parseInt(_0x40f370(0x1aa))/0x2*(-parseInt(_0x40f370(0x1a8))/0x3)+parseInt(_0x40f370(0x1ad))/0x4+parseInt(_0x40f370(0x1b0))/0x5*(-parseInt(_0x40f370(0x1af))/0x6)+parseInt(_0x40f370(0x1ba))/0x7*(-parseInt(_0x40f370(0x1b4))/0x8)+parseInt(_0x40f370(0x1a6))/0x9*(parseInt(_0x40f370(0x1b7))/0xa)+-parseInt(_0x40f370(0x1b5))/0xb;if(_0xc322f9===_0x20e52f)break;else _0x4301d0['push'](_0x4301d0['shift']());}catch(_0x5741f9){_0x4301d0['push'](_0x4301d0['shift']());}}}(a20_0x2c41,0xf379f));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a20_0x19e9eb from'chalk';function a20_0x2c41(){const _0x3603ec=['3794Uflxkh','toString','session','271781QdZpcK','Error:\x20','message','displayWithSources','log','36gIlDaV','\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','819114aWlzJB','yellow','4edqPbe','execute','display','7904516JLgSKs','debug','1050066KKAzKt','25JFfpbf','warn','Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.','name','16832zlhIQW','8189698caHcGv','clear','3766990ZFXdpV','\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a','context'];a20_0x2c41=function(){return _0x3603ec;};return a20_0x2c41();}export class ContextCommand extends BaseCommand{[a20_0x1402d6(0x1b3)]=a20_0x1402d6(0x1b9);['description']='Show\x20current\x20resolved\x20context';async[a20_0x1402d6(0x1ab)](_0x4fcb5a){const _0xec9c60=a20_0x1402d6,{options:_0x5880ef}=_0x4fcb5a,_0x3155fc=_0x5880ef[_0xec9c60(0x1ae)],_0x548e20=_0x5880ef[_0xec9c60(0x1b6)];console[_0xec9c60(0x1b1)](a20_0x19e9eb[_0xec9c60(0x1a9)](_0xec9c60(0x1b2))),console['warn'](a20_0x19e9eb[_0xec9c60(0x1a9)](_0xec9c60(0x1a7))),console[_0xec9c60(0x1b1)](a20_0x19e9eb['yellow'](_0xec9c60(0x1b8))),cleanExpiredSessions();try{if(_0x548e20){clearSessionContext(_0x5880ef[_0xec9c60(0x1bc)]);const _0x59e8e3=_0x5880ef[_0xec9c60(0x1bc)]||getCurrentSessionPID()[_0xec9c60(0x1bb)]();return console[_0xec9c60(0x1a5)]('Session\x20context\x20cleared\x20(session:\x20'+_0x59e8e3+')'),0x0;}const _0x27d4c8=new GlobalContext(_0x5880ef);return _0x3155fc?_0x27d4c8[_0xec9c60(0x1a4)]():_0x27d4c8[_0xec9c60(0x1ac)](),0x0;}catch(_0x3789d0){return _0x3789d0 instanceof Error&&console['error'](_0xec9c60(0x1a2)+_0x3789d0[_0xec9c60(0x1a3)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x412482=a21_0x573f;(function(_0xc9b464,_0x16dcf4){const _0x10205b=a21_0x573f,_0x510a36=_0xc9b464();while(!![]){try{const _0x5d3056=parseInt(_0x10205b(0x184))/0x1*(parseInt(_0x10205b(0x16f))/0x2)+-parseInt(_0x10205b(0x17c))/0x3+-parseInt(_0x10205b(0x173))/0x4*(parseInt(_0x10205b(0x17f))/0x5)+parseInt(_0x10205b(0x17a))/0x6+-parseInt(_0x10205b(0x170))/0x7+-parseInt(_0x10205b(0x171))/0x8+parseInt(_0x10205b(0x176))/0x9;if(_0x5d3056===_0x16dcf4)break;else _0x510a36['push'](_0x510a36['shift']());}catch(_0x19fb88){_0x510a36['push'](_0x510a36['shift']());}}}(a21_0x398a,0xadaf0));function a21_0x573f(_0x2974cb,_0x368053){_0x2974cb=_0x2974cb-0x16b;const _0x398a57=a21_0x398a();let _0x573ff6=_0x398a57[_0x2974cb];return _0x573ff6;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a21_0x398a(){const _0x7f50d5=['listDatabases','length','error','7741086kEDSUi','description','3179076ONgPAe','Error:\x20','verbose','1113790tDFXSw','cause','Site:\x20','name','data','1531sZefOK','execute','site','\x20\x20Cause:\x20','✔\x20Found\x20','398PfIImO','8484623EBxAIA','6166544IkUqNM','query','8pSciGM','Pattern:\x20','List\x20all\x20databases','23442057airOqP'];a21_0x398a=function(){return _0x7f50d5;};return a21_0x398a();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a21_0x412482(0x182)]='databases';[a21_0x412482(0x17b)]=a21_0x412482(0x175);async[a21_0x412482(0x16b)](_0x400bf0){const _0x44d563=a21_0x412482,{options:_0x73d297,args:_0x2bfa55,tdx:_0x3b184f}=_0x400bf0,_0x201d9c=_0x2bfa55[0x0];try{_0x73d297[_0x44d563(0x17e)]&&(console[_0x44d563(0x179)](_0x44d563(0x181)+_0x73d297[_0x44d563(0x16c)]),_0x201d9c&&console[_0x44d563(0x179)](_0x44d563(0x174)+_0x201d9c));const _0x2c9f4=resolveLimit(_0x73d297['limit'],DEFAULT_LISTING_LIMIT),_0x1d936c=await withSpinner('Listing\x20databases...',()=>_0x3b184f[_0x44d563(0x172)][_0x44d563(0x177)](_0x201d9c,_0x2c9f4),{'verbose':_0x73d297[_0x44d563(0x17e)]}),_0x1983cb=_0x1d936c[_0x44d563(0x183)];return console[_0x44d563(0x179)](_0x44d563(0x16e)+_0x1983cb[_0x44d563(0x178)]+'\x20database'+(_0x1983cb['length']!==0x1?'s':'')),await handleSDKOutput(_0x1983cb,{..._0x73d297,'limit':_0x2c9f4}),0x0;}catch(_0x96feed){if(_0x96feed instanceof SDKError)return console[_0x44d563(0x179)](_0x44d563(0x17d)+_0x96feed['message']),_0x96feed[_0x44d563(0x180)]&&console['error'](_0x44d563(0x16d)+_0x96feed['cause']),0x1;throw _0x96feed;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x188e85=a22_0x1b69;(function(_0x50e97b,_0x27c439){const _0x4be144=a22_0x1b69,_0x150065=_0x50e97b();while(!![]){try{const _0x3da205=-parseInt(_0x4be144(0x1f2))/0x1*(-parseInt(_0x4be144(0x1f4))/0x2)+parseInt(_0x4be144(0x1f0))/0x3+parseInt(_0x4be144(0x1e8))/0x4+-parseInt(_0x4be144(0x1e5))/0x5+parseInt(_0x4be144(0x1e1))/0x6*(-parseInt(_0x4be144(0x1f7))/0x7)+-parseInt(_0x4be144(0x1e4))/0x8+parseInt(_0x4be144(0x1ee))/0x9;if(_0x3da205===_0x27c439)break;else _0x150065['push'](_0x150065['shift']());}catch(_0x1c6901){_0x150065['push'](_0x150065['shift']());}}}(a22_0x513b,0x4126e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a22_0x1b69(_0x3216c4,_0x349573){_0x3216c4=_0x3216c4-0x1d8;const _0x513b1a=a22_0x513b();let _0x1b6912=_0x513b1a[_0x3216c4];return _0x1b6912;}import{handleSDKOutput}from'../utils/command-output.js';function a22_0x513b(){const _0x5b3d22=['length','1843OXdWUg','Database:\x20','2YAEcym','error','✖\x20Table\x20not\x20found','43708YvsAtQ','\x20column','cause','\x20in\x20','\x20\x20Cause:\x20','describeTable','verbose','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','\x27\x20does\x20not\x20exist','Error:\x20','Describe\x20table\x20schema','...','Table:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','174zNjzsq','description','table','3085112VVJLZb','50940BqUTjI','query','describe','1864724ETNUOs','execute','database','validate','Describing\x20table\x20','args','2053845vpuoAB','message','442608Erywmy'];a22_0x513b=function(){return _0x5b3d22;};return a22_0x513b();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{['name']=a22_0x188e85(0x1e7);[a22_0x188e85(0x1e2)]=a22_0x188e85(0x1dd);async[a22_0x188e85(0x1e9)](_0x6913b7){const _0x1215a9=a22_0x188e85;return this[_0x1215a9(0x1d8)](_0x6913b7);}async[a22_0x188e85(0x1d8)](_0x4fd70e){const _0x4d16a4=a22_0x188e85,{options:_0x1c9913,args:_0x39f834,tdx:_0x567b0d}=_0x4fd70e;let _0x5d6292;try{_0x5d6292=parseTableReference(_0x39f834[0x0]);const _0x595362=_0x1c9913[_0x4d16a4(0x1ea)];!_0x5d6292[_0x4d16a4(0x1ea)]&&_0x595362&&(_0x5d6292[_0x4d16a4(0x1ea)]=_0x595362);const _0x53375e=validateTableDescribeReference(_0x5d6292);if(_0x53375e)return console[_0x4d16a4(0x1f5)]('Error:\x20'+_0x53375e),0x1;}catch(_0x37035e){return console[_0x4d16a4(0x1f5)]('Error:\x20'+_0x37035e[_0x4d16a4(0x1ef)]),0x1;}const _0x4363d5=_0x5d6292['database'],_0x1410d0=_0x5d6292[_0x4d16a4(0x1e3)];try{_0x1c9913[_0x4d16a4(0x1d9)]&&(console[_0x4d16a4(0x1f5)]('Site:\x20'+_0x1c9913['site']),console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1f3)+_0x4363d5),console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1df)+_0x1410d0));const _0x1811ed=await withSpinner(_0x4d16a4(0x1ec)+_0x4363d5+'.'+_0x1410d0+_0x4d16a4(0x1de),()=>_0x567b0d[_0x4d16a4(0x1e6)][_0x4d16a4(0x1d8)](_0x4363d5,_0x1410d0),{'verbose':_0x1c9913[_0x4d16a4(0x1d9)]}),_0x1bb124=_0x1811ed['data'];if(_0x1bb124[_0x4d16a4(0x1f1)]===0x0)return console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1f6)),console[_0x4d16a4(0x1f5)]('Table\x20\x27'+_0x4363d5+'.'+_0x1410d0+_0x4d16a4(0x1db)),0x1;return console[_0x4d16a4(0x1f5)]('✔\x20Found\x20'+_0x1bb124[_0x4d16a4(0x1f1)]+_0x4d16a4(0x1f8)+(_0x1bb124[_0x4d16a4(0x1f1)]!==0x1?'s':'')+_0x4d16a4(0x1fa)+_0x4363d5+'.'+_0x1410d0),await handleSDKOutput(_0x1bb124,_0x1c9913),0x0;}catch(_0x44e39a){if(_0x44e39a instanceof SDKError)return console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1dc)+_0x44e39a[_0x4d16a4(0x1ef)]),_0x44e39a[_0x4d16a4(0x1f9)]&&console[_0x4d16a4(0x1f5)](_0x4d16a4(0x1fb)+_0x44e39a[_0x4d16a4(0x1f9)]),0x1;throw _0x44e39a;}}[a22_0x188e85(0x1eb)](_0x338761){const _0x4c6a7d=a22_0x188e85;if(_0x338761[_0x4c6a7d(0x1ed)][_0x4c6a7d(0x1f1)]===0x0)return _0x4c6a7d(0x1da);if(_0x338761['args'][_0x4c6a7d(0x1f1)]>0x1)return _0x4c6a7d(0x1e0);return undefined;}}
|