@treasuredata/tdx 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.d.ts +20 -1
- package/dist/client/cdp-api-client.d.ts.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/cdp-api-client.js.map +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/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/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-pwd-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/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.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/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/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/llm.js +1 -1
- package/dist/sdk/query.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.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/cdp.d.ts +58 -0
- package/dist/types/cdp.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.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.js +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-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 a11_0x33a19c=a11_0x2840;(function(_0x623d64,_0x124aff){const _0x5eceb6=a11_0x2840,_0x417aae=_0x623d64();while(!![]){try{const _0x4bf15e=-parseInt(_0x5eceb6(0x1e3))/0x1+-parseInt(_0x5eceb6(0x1de))/0x2*(-parseInt(_0x5eceb6(0x1f0))/0x3)+parseInt(_0x5eceb6(0x1dc))/0x4+parseInt(_0x5eceb6(0x1d7))/0x5*(parseInt(_0x5eceb6(0x1ee))/0x6)+-parseInt(_0x5eceb6(0x1cc))/0x7*(-parseInt(_0x5eceb6(0x1dd))/0x8)+parseInt(_0x5eceb6(0x1da))/0x9+-parseInt(_0x5eceb6(0x1ea))/0xa;if(_0x4bf15e===_0x124aff)break;else _0x417aae['push'](_0x417aae['shift']());}catch(_0x181cab){_0x417aae['push'](_0x417aae['shift']());}}}(a11_0xd1b8,0xf22d7));import{BaseCommand}from'./command.js';function a11_0x2840(_0x2067d4,_0x3183b8){const _0xd1b859=a11_0xd1b8();return a11_0x2840=function(_0x28400f,_0x17c93c){_0x28400f=_0x28400f-0x1cb;let _0x6fe8ba=_0xd1b859[_0x28400f];return _0x6fe8ba;},a11_0x2840(_0x2067d4,_0x3183b8);}import{SDKError}from'../sdk/index.js';function a11_0xd1b8(){const _0xddf84d=['error','Site:\x20','listActivations','resolveSegmentId','Resolved\x20parent\x20ID:\x20','Listing\x20activations\x20for\x20segment\x20\x27','name','description','resolveParentId','cause','5jSekWe','Error:\x20Segment\x20name\x20is\x20required','length','9752193rjSFJE','Child\x20name:\x20','2713432gVwedY','32WGRCFC','2115936xdTRGh','Resolved\x20child\x20ID:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','message','site','473984TNfOBQ','segment','List\x20activations\x20for\x20a\x20segment','Resolving\x20parent\x20segment\x20\x27','verbose','data','✔\x20Found\x20','29677950bBLEht','\x27...','\x20\x20Cause:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','9655410fgaktq','Error:\x20','3PubahV','execute','8050nkgyEm'];a11_0xd1b8=function(){return _0xddf84d;};return a11_0xd1b8();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a11_0x33a19c(0x1d3)]='activations';[a11_0x33a19c(0x1d4)]=a11_0x33a19c(0x1e5);async[a11_0x33a19c(0x1cb)](_0x348c1d){const _0x5c7e8f=a11_0x33a19c,{options:_0x3576b3,args:_0x181a6e,tdx:_0x1c4285}=_0x348c1d;if(_0x181a6e[_0x5c7e8f(0x1d9)]===0x0)return console['error'](_0x5c7e8f(0x1d8)),console[_0x5c7e8f(0x1cd)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x42542c,childId:_0x4ad6b0}=parseSegmentRef(_0x181a6e[0x0]);if(!_0x4ad6b0)return console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1ed)),console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1e0)),0x1;_0x3576b3[_0x5c7e8f(0x1e7)]&&(console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1ce)+_0x3576b3[_0x5c7e8f(0x1e2)]),console['error']('Parent\x20name:\x20'+_0x42542c),console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1db)+_0x4ad6b0));const _0x310be4=await withSpinner(_0x5c7e8f(0x1e6)+_0x42542c+_0x5c7e8f(0x1eb),()=>_0x1c4285['segment'][_0x5c7e8f(0x1d5)](_0x42542c),{'verbose':_0x3576b3[_0x5c7e8f(0x1e7)]}),_0x5b0dfd=_0x310be4['data'];_0x3576b3['verbose']&&console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1d1)+_0x5b0dfd);const _0x2f02ee=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x4ad6b0+'\x27...',()=>_0x1c4285[_0x5c7e8f(0x1e4)][_0x5c7e8f(0x1d0)](_0x5b0dfd,_0x4ad6b0),{'verbose':_0x3576b3[_0x5c7e8f(0x1e7)]}),_0x419492=_0x2f02ee[_0x5c7e8f(0x1e8)];_0x3576b3['verbose']&&console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1df)+_0x419492);const _0x24f267=await withSpinner(_0x5c7e8f(0x1d2)+_0x4ad6b0+_0x5c7e8f(0x1eb),()=>_0x1c4285['segment'][_0x5c7e8f(0x1cf)](_0x5b0dfd,_0x419492),{'verbose':_0x3576b3[_0x5c7e8f(0x1e7)]}),_0x1a5328=_0x24f267[_0x5c7e8f(0x1e8)];return console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1e9)+_0x1a5328[_0x5c7e8f(0x1d9)]+'\x20activation'+(_0x1a5328[_0x5c7e8f(0x1d9)]!==0x1?'s':'')),await handleSDKOutput(_0x1a5328,_0x3576b3),0x0;}catch(_0xd66bca){if(_0xd66bca instanceof SDKError)return console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1ef)+_0xd66bca[_0x5c7e8f(0x1e1)]),_0xd66bca[_0x5c7e8f(0x1d6)]&&console[_0x5c7e8f(0x1cd)](_0x5c7e8f(0x1ec)+_0xd66bca[_0x5c7e8f(0x1d6)]),0x1;throw _0xd66bca;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0x2aed46=a12_0x3c8e;(function(_0x3fbf3e,_0xbfa7ba){const _0x3090db=a12_0x3c8e,_0x3e3531=_0x3fbf3e();while(!![]){try{const _0x11aade=-parseInt(_0x3090db(0x20a))/0x1+-parseInt(_0x3090db(0x20d))/0x2+parseInt(_0x3090db(0x1ed))/0x3*(parseInt(_0x3090db(0x1f0))/0x4)+parseInt(_0x3090db(0x204))/0x5*(parseInt(_0x3090db(0x1eb))/0x6)+parseInt(_0x3090db(0x210))/0x7+-parseInt(_0x3090db(0x1fb))/0x8*(parseInt(_0x3090db(0x206))/0x9)+parseInt(_0x3090db(0x1f1))/0xa*(parseInt(_0x3090db(0x20e))/0xb);if(_0x11aade===_0xbfa7ba)break;else _0x3e3531['push'](_0x3e3531['shift']());}catch(_0x3b4712){_0x3e3531['push'](_0x3e3531['shift']());}}}(a12_0x15cd,0xb4690));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../types/index.js';function a12_0x15cd(){const _0x1d3db1=['216501jHtEdz','has','set-cookie','12dwodEq','685310RRpNdb','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','cookie','toUpperCase','x-trino-user','verbose','keys','isArray','headers','length','1423384wybWjk','description','proxy-authorization','header','log','entries','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','join','1343535KNOpmj','GET','9ttMUVC','trim','PUT','trino','176115lteHgx','x-xsrf-token','includes','1385896rcoumZ','11vrKpJd','data','2982602YrQJDl','message','body','POST','readBodyFromFile','Error:\x20','Invalid\x20API\x20type:\x20','toLowerCase','site','cdp','type','output','Invalid\x20HTTP\x20method:\x20','Results\x20saved\x20to\x20','\x0aStack\x20trace:\x0a','llm','request','error','method','.\x20Valid\x20methods:\x20','startsWith','status','color','execute','api','stack','file','x-auth-token','substring','\x22.\x20','Invalid\x20header\x20format:\x20\x22','24SfBmiD','workflow'];a12_0x15cd=function(){return _0x1d3db1;};return a12_0x15cd();}import{resolveSite}from'../core/config.js';function a12_0x3c8e(_0xb35df9,_0x3e0107){const _0x15cd61=a12_0x15cd();return a12_0x3c8e=function(_0x3c8e2f,_0x491c88){_0x3c8e2f=_0x3c8e2f-0x1dc;let _0x269a49=_0x15cd61[_0x3c8e2f];return _0x269a49;},a12_0x3c8e(_0xb35df9,_0x3e0107);}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a12_0x2aed46(0x1fd),a12_0x2aed46(0x1f3),a12_0x2aed46(0x1ef),'set-cookie2',a12_0x2aed46(0x20b),a12_0x2aed46(0x1e7),a12_0x2aed46(0x1f5)]);function isSensitiveHeader(_0x332a81){const _0x4508f0=a12_0x2aed46;return SENSITIVE_HEADERS[_0x4508f0(0x1ee)](_0x332a81[_0x4508f0(0x217)]());}function parseHeader(_0x665d74){const _0x173637=a12_0x2aed46,_0x4c35f1=_0x665d74['indexOf'](':');if(_0x4c35f1===-0x1)throw new Error(_0x173637(0x1ea)+_0x665d74+_0x173637(0x1e9)+_0x173637(0x202));const _0x1a1deb=_0x665d74[_0x173637(0x1e8)](0x0,_0x4c35f1)[_0x173637(0x207)](),_0x149ad6=_0x665d74[_0x173637(0x1e8)](_0x4c35f1+0x1)[_0x173637(0x207)]();if(!_0x1a1deb)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x665d74+'\x22');return[_0x1a1deb,_0x149ad6];}export class ApiCommand extends BaseCommand{['name']=a12_0x2aed46(0x1e4);[a12_0x2aed46(0x1fc)]=a12_0x2aed46(0x201);['validate'](_0x7a4a92){const _0x31095d=a12_0x2aed46,{args:_0x559ad6,options:_0x1d39b2}=_0x7a4a92,_0x3fedb4=_0x1d39b2;if(_0x559ad6[_0x31095d(0x1fa)]===0x0)return _0x31095d(0x1f2);const _0x32260f=_0x559ad6[0x0];if(!_0x32260f[_0x31095d(0x1e0)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x32260f;const _0x2812e9=_0x3fedb4[_0x31095d(0x20f)],_0x4ffa97=_0x3fedb4[_0x31095d(0x1e6)];if(_0x2812e9&&_0x4ffa97)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x599ea5=_0x3fedb4[_0x31095d(0x1de)]||_0x31095d(0x205),_0xb1be9d=[_0x31095d(0x205),_0x31095d(0x213),_0x31095d(0x208),'DELETE','PATCH'];if(!_0xb1be9d[_0x31095d(0x20c)](_0x599ea5[_0x31095d(0x1f4)]()))return _0x31095d(0x21c)+_0x599ea5+_0x31095d(0x1df)+_0xb1be9d['join'](',\x20');const _0x4efc7c=_0x3fedb4[_0x31095d(0x21a)]||'td',_0x41cef3=['td',_0x31095d(0x219),_0x31095d(0x1ec),_0x31095d(0x209),_0x31095d(0x21f)];if(!_0x41cef3[_0x31095d(0x20c)](_0x4efc7c))return _0x31095d(0x216)+_0x4efc7c+'.\x20Valid\x20types:\x20'+_0x41cef3[_0x31095d(0x203)](',\x20');return undefined;}async[a12_0x2aed46(0x1e3)](_0x51f074){const _0x4d788f=a12_0x2aed46,{options:_0x363f76,args:_0xa3609e,tdx:_0x21d835}=_0x51f074,_0x17f5f6=_0x363f76,_0x666862=_0xa3609e[0x0],_0x19aa13=(_0x17f5f6['method']||_0x4d788f(0x205))[_0x4d788f(0x1f4)](),_0x3ed4bc=_0x17f5f6[_0x4d788f(0x20f)],_0x325cd3=_0x17f5f6[_0x4d788f(0x1e6)],_0x5de409=_0x17f5f6[_0x4d788f(0x1fe)],_0x25e474=_0x17f5f6[_0x4d788f(0x21a)]||'td';try{const _0x502849={};if(_0x5de409){const _0x71d9b4=Array[_0x4d788f(0x1f8)](_0x5de409)?_0x5de409:[_0x5de409];for(const _0x443033 of _0x71d9b4){const [_0x1e4364,_0x2af66d]=parseHeader(_0x443033);_0x502849[_0x1e4364]=_0x2af66d;}}let _0x162a14;if(_0x3ed4bc)_0x162a14=_0x3ed4bc;else{if(_0x325cd3)try{_0x162a14=RawAPI[_0x4d788f(0x214)](_0x325cd3);}catch(_0x34a7b3){return console[_0x4d788f(0x1dd)](_0x4d788f(0x215)+(_0x34a7b3 instanceof Error?_0x34a7b3[_0x4d788f(0x211)]:String(_0x34a7b3))),0x1;}}const _0x13267b={'method':_0x19aa13,'apiType':_0x25e474,'includeHeaders':_0x363f76[_0x4d788f(0x1f6)]};_0x162a14&&(_0x13267b[_0x4d788f(0x212)]=_0x162a14);Object[_0x4d788f(0x1f7)](_0x502849)[_0x4d788f(0x1fa)]>0x0&&(_0x13267b[_0x4d788f(0x1f9)]=_0x502849);if(_0x363f76[_0x4d788f(0x1f6)]){const _0x27342f=resolveSite(_0x363f76[_0x4d788f(0x218)]),_0x51a1a0=getEndpoint(_0x27342f,_0x25e474),_0x25f6a0=''+_0x51a1a0+_0x666862;console[_0x4d788f(0x1dd)]('>\x20'+_0x19aa13+'\x20'+_0x25f6a0);const _0x342494=getAuthHeaders(_0x27342f),_0xf724b8={..._0x342494,..._0x502849};for(const [_0x1e4a00,_0x1bc4ef]of Object[_0x4d788f(0x200)](_0xf724b8)){!isSensitiveHeader(_0x1e4a00)&&console[_0x4d788f(0x1dd)]('>\x20'+_0x1e4a00+':\x20'+_0x1bc4ef);}_0x162a14&&console[_0x4d788f(0x1dd)]('>'),console[_0x4d788f(0x1dd)]('');}const _0xedbb0=await _0x21d835[_0x4d788f(0x1e4)][_0x4d788f(0x1dc)](_0x666862,_0x13267b);if(_0x363f76[_0x4d788f(0x1f6)]&&_0xedbb0[_0x4d788f(0x1f9)]){console[_0x4d788f(0x1dd)]('<\x20HTTP/1.1\x20'+_0xedbb0[_0x4d788f(0x1e1)]);for(const [_0x47f9d7,_0x4342fb]of Object[_0x4d788f(0x200)](_0xedbb0[_0x4d788f(0x1f9)])){!isSensitiveHeader(_0x47f9d7)&&console[_0x4d788f(0x1dd)]('<\x20'+_0x47f9d7+':\x20'+_0x4342fb);}console[_0x4d788f(0x1dd)]('');}const _0x488d65=Boolean(_0x363f76[_0x4d788f(0x21b)]),_0x3386cb={'color':_0x363f76[_0x4d788f(0x1e2)],'noColor':_0x363f76['noColor']||_0x488d65&&!_0x363f76[_0x4d788f(0x1e2)]},_0x26dcc5=colorizeJSON(_0xedbb0['data'],_0x3386cb);return _0x363f76[_0x4d788f(0x21b)]?(writeFileSync(_0x363f76[_0x4d788f(0x21b)],_0x26dcc5),console[_0x4d788f(0x1dd)](_0x4d788f(0x21d)+_0x363f76[_0x4d788f(0x21b)])):console[_0x4d788f(0x1ff)](_0x26dcc5),0x0;}catch(_0x52c557){return _0x52c557 instanceof Error?(console[_0x4d788f(0x1dd)](_0x4d788f(0x215)+_0x52c557[_0x4d788f(0x211)]),_0x363f76['verbose']&&_0x52c557[_0x4d788f(0x1e5)]&&console[_0x4d788f(0x1dd)](_0x4d788f(0x21e)+_0x52c557['stack'])):console[_0x4d788f(0x1dd)](_0x4d788f(0x215)+String(_0x52c557)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a13_0x61e6ed=a13_0x1aa6;(function(_0x45e837,_0x16dd38){const _0x5dbff0=a13_0x1aa6,_0x381706=_0x45e837();while(!![]){try{const _0x3e35a5=parseInt(_0x5dbff0(0x203))/0x1+parseInt(_0x5dbff0(0x217))/0x2*(-parseInt(_0x5dbff0(0x21a))/0x3)+-parseInt(_0x5dbff0(0x20b))/0x4+-parseInt(_0x5dbff0(0x204))/0x5+-parseInt(_0x5dbff0(0x1d4))/0x6+-parseInt(_0x5dbff0(0x218))/0x7+parseInt(_0x5dbff0(0x20f))/0x8;if(_0x3e35a5===_0x16dd38)break;else _0x381706['push'](_0x381706['shift']());}catch(_0x55b539){_0x381706['push'](_0x381706['shift']());}}}(a13_0x51d8,0xae134));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';function a13_0x51d8(){const _0x4d7d97=['email','✓\x20Profile\x20\x27','\x20(profile:\x20','Enter\x20custom\x20site','ERROR','red','execute','No\x20credential\x20found','/app/mp/ak','tdx:\x20auth\x20setup','ap02','create','418153PsBffj','1956850zhGmoT','N/A','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Validating\x20API\x20key...','first_name','ap02\x20-\x20Korea','Name:\x20','4755148HnalKW','last_name','description','trim','26185096ZOFmkC','findIndex','join','\x0aSetup\x20cancelled','site','warn','Select\x20your\x20Treasure\x20Data\x20site:','API\x20key\x20cannot\x20be\x20empty','2sMQUXN','1347206qrerQE','us\x20\x20\x20-\x20United\x20States','722391cEVuLY','eu01','logLevel','green','filter','error','message','apiKey','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','jp\x20\x20\x20-\x20Japan','value','Enter\x20your\x20TD\x20API\x20key:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','auth','yellow','5789196ultcZM','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20(site:\x20','customSite','status','name','test','length','System\x20keychain\x20is\x20not\x20available','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Setup\x20API\x20key\x20authentication\x20interactively','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','select','Remove\x20API\x20key\x20from\x20system\x20keychain','jobs','other','bold','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x20for\x20profile:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✗\x20Validation\x20failed:\x20','password','auth:clear','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20API\x20key\x20removed\x20from\x20keychain','eu\x20\x20\x20-\x20Europe','log','getUserInfo','User:\x20','Enter\x20site\x20name:','Site\x20name\x20cannot\x20be\x20empty','us01','tdx:\x20auth\x20clear','push','\x20\x20tdx'];a13_0x51d8=function(){return _0x4d7d97;};return a13_0x51d8();}function a13_0x1aa6(_0x167d8e,_0x5c3b63){const _0x51d875=a13_0x51d8();return a13_0x1aa6=function(_0x1aa6fe,_0x350362){_0x1aa6fe=_0x1aa6fe-0x1cf;let _0x34e2ba=_0x51d875[_0x1aa6fe];return _0x34e2ba;},a13_0x1aa6(_0x167d8e,_0x5c3b63);}import{getConsoleUrl}from'../types/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a13_0x30ad0f from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a13_0x97d37 from'chalk';export class AuthSetupCommand extends BaseCommand{[a13_0x61e6ed(0x1d9)]='auth:setup';[a13_0x61e6ed(0x20d)]=a13_0x61e6ed(0x1de);async['execute'](_0x53198b){const _0x3e403d=a13_0x61e6ed,{options:_0x5d4c3d}=_0x53198b,_0x5abfff=_0x5d4c3d['profile'];console['log'](a13_0x97d37[_0x3e403d(0x1e4)](_0x3e403d(0x200)));const _0x429fb2=_0x5d4c3d[_0x3e403d(0x213)]||'us01',_0x517f1a=[{'title':_0x3e403d(0x219),'value':_0x3e403d(0x1f3)},{'title':_0x3e403d(0x223),'value':'jp01'},{'title':_0x3e403d(0x1ed),'value':_0x3e403d(0x21b)},{'title':_0x3e403d(0x209),'value':_0x3e403d(0x201)}];let _0x106ac0=_0x517f1a[_0x3e403d(0x210)](_0xb8b4d2=>_0xb8b4d2[_0x3e403d(0x1cf)]===_0x429fb2);_0x106ac0===-0x1&&_0x429fb2!==_0x3e403d(0x1f3)&&(_0x517f1a[_0x3e403d(0x1f5)]({'title':_0x429fb2,'value':_0x429fb2}),_0x106ac0=_0x517f1a[_0x3e403d(0x1db)]-0x1);_0x517f1a[_0x3e403d(0x1f5)]({'title':_0x3e403d(0x1fa),'value':_0x3e403d(0x1e3)});const _0x44e031=_0x5abfff?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x5abfff+'):':_0x3e403d(0x215),_0xac692=await a13_0x30ad0f({'type':_0x3e403d(0x1e0),'name':'site','message':_0x44e031,'choices':_0x517f1a,'initial':_0x106ac0>=0x0?_0x106ac0:0x0});if(!_0xac692[_0x3e403d(0x213)])return console[_0x3e403d(0x1ee)]('\x0aSetup\x20cancelled'),0x1;let _0x46b1cd;if(_0xac692[_0x3e403d(0x213)]==='other'){const _0x2d83fe=await a13_0x30ad0f({'type':'text','name':_0x3e403d(0x1d7),'message':_0x3e403d(0x1f1),'initial':'us01','validate':_0x325c30=>{const _0x34bc38=_0x3e403d;if(!_0x325c30||!_0x325c30[_0x34bc38(0x20e)]())return _0x34bc38(0x1f2);if(!/^[a-z0-9-]+$/[_0x34bc38(0x1da)](_0x325c30[_0x34bc38(0x20e)]()))return _0x34bc38(0x1e5);return!![];}});if(!_0x2d83fe[_0x3e403d(0x1d7)])return console[_0x3e403d(0x1ee)](_0x3e403d(0x212)),0x1;_0x46b1cd=_0x2d83fe[_0x3e403d(0x1d7)];}else _0x46b1cd=_0xac692['site'];const _0x5019c0=resolveSite(_0x46b1cd);console[_0x3e403d(0x1ee)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x5019c0),console[_0x3e403d(0x1ee)](_0x3e403d(0x1d5)),console['log']('\x20\x20'+getConsoleUrl(_0x5019c0,_0x3e403d(0x1ff)));const _0x11035e=await a13_0x30ad0f({'type':_0x3e403d(0x1e9),'name':'apiKey','message':_0x3e403d(0x1d0),'validate':_0xef486c=>{const _0x360173=_0x3e403d;if(!_0xef486c||!_0xef486c['trim']())return _0x360173(0x216);return!![];}});if(!_0x11035e['apiKey'])return console['log'](_0x3e403d(0x212)),0x1;const _0x21bccd=_0x11035e[_0x3e403d(0x221)];console[_0x3e403d(0x1ee)](_0x3e403d(0x207));try{const _0x2507b8=TDX[_0x3e403d(0x202)]({'site':_0x5019c0,'apiKey':_0x21bccd['trim'](),'logLevel':_0x5d4c3d[_0x3e403d(0x21c)]??LogLevel[_0x3e403d(0x1fb)]}),_0x38f8ac=await _0x2507b8['jobs'][_0x3e403d(0x1ef)]();console[_0x3e403d(0x1ee)](_0x3e403d(0x206)+_0x38f8ac[_0x3e403d(0x1f7)]+')');const _0x28117a=await isKeychainAvailable();_0x28117a?(await saveAPIKeyAsync(_0x21bccd[_0x3e403d(0x20e)](),_0x5019c0,_0x5abfff),console[_0x3e403d(0x1ee)](_0x3e403d(0x1df)+(_0x5abfff?_0x3e403d(0x1f9)+_0x5abfff+')':''))):(console[_0x3e403d(0x214)](a13_0x97d37['yellow'](_0x3e403d(0x1d1))),console[_0x3e403d(0x214)](a13_0x97d37[_0x3e403d(0x1d3)]('\x20\x20Set\x20TD_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x5abfff){const _0xeebc7c={'site':_0x5019c0};saveProfileToUserConfig(_0x5abfff,_0xeebc7c),console[_0x3e403d(0x1ee)](_0x3e403d(0x1f8)+_0x5abfff+'\x27\x20registered');}const _0x3accbb=_0x5abfff?'\x20--profile\x20'+_0x5abfff:'';return console['log'](),console[_0x3e403d(0x1ee)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x3e403d(0x1ee)](_0x3e403d(0x1f6)+_0x3accbb+_0x3e403d(0x1e7)),console[_0x3e403d(0x1ee)](_0x3e403d(0x1f6)+_0x3accbb+_0x3e403d(0x222)),0x0;}catch(_0x2620ce){if(_0x2620ce instanceof HTTPClientError&&_0x2620ce[_0x3e403d(0x1d8)]===0x191)return printAuthError(_0x2620ce),0x1;return console['error'](a13_0x97d37['red'](_0x3e403d(0x1e8)+(_0x2620ce instanceof Error?_0x2620ce[_0x3e403d(0x220)]:String(_0x2620ce)))),console[_0x3e403d(0x21f)](_0x3e403d(0x1dd)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a13_0x61e6ed(0x1d9)]=a13_0x61e6ed(0x1d2);[a13_0x61e6ed(0x20d)]=a13_0x61e6ed(0x1eb);async['execute'](_0x4e768d){const _0x4d5611=a13_0x61e6ed,{options:_0x57fbd1,tdx:_0xff2042}=_0x4e768d,_0x55341d=_0x57fbd1[_0x4d5611(0x213)],_0xb780ad=_0x57fbd1['profile'],_0x4361ef=_0xb780ad?_0xb780ad:_0x4d5611(0x205);console[_0x4d5611(0x1ee)]('tdx\x20profile:\x20'+_0x4361ef+_0x4d5611(0x1d6)+_0x55341d+')');const _0x22308b=await resolveAPIKeyAsync(_0x55341d,_0xb780ad);if(_0x22308b){const {source:_0x24db6b,isDeprecated:_0x4ebd41}=_0x22308b,_0xa8adf2='Read\x20credential\x20from\x20'+_0x24db6b;console[_0x4d5611(0x1ee)](_0x4ebd41?a13_0x97d37[_0x4d5611(0x1d3)](_0xa8adf2):_0xa8adf2);}else console['log'](a13_0x97d37[_0x4d5611(0x1d3)](_0x4d5611(0x1fe)));try{const _0x41e95c=await _0xff2042[_0x4d5611(0x1e2)][_0x4d5611(0x1ef)]();return console['log'](a13_0x97d37[_0x4d5611(0x21d)]('✓\x20Authentication\x20successful\x0a')),console[_0x4d5611(0x1ee)](_0x4d5611(0x1f0)+_0x41e95c['email']),(_0x41e95c[_0x4d5611(0x208)]||_0x41e95c[_0x4d5611(0x20c)])&&console[_0x4d5611(0x1ee)](_0x4d5611(0x20a)+[_0x41e95c['first_name'],_0x41e95c[_0x4d5611(0x20c)]][_0x4d5611(0x21e)](Boolean)[_0x4d5611(0x211)]('\x20')),0x0;}catch(_0x29357c){return _0x29357c instanceof HTTPClientError&&_0x29357c[_0x4d5611(0x1d8)]===0x191?printAuthError(_0x29357c,!![],_0xb780ad):console[_0x4d5611(0x21f)](a13_0x97d37['red'](_0x4d5611(0x1e8)+(_0x29357c instanceof Error?_0x29357c[_0x4d5611(0x220)]:String(_0x29357c)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a13_0x61e6ed(0x1d9)]=a13_0x61e6ed(0x1ea);['description']=a13_0x61e6ed(0x1e1);async[a13_0x61e6ed(0x1fd)](_0x3356f2){const _0x33509e=a13_0x61e6ed,{options:_0x341464}=_0x3356f2,_0x545dec=_0x341464['profile'];console[_0x33509e(0x1ee)](a13_0x97d37[_0x33509e(0x1e4)](_0x33509e(0x1f4)));const _0xa07d4a=await isKeychainAvailable();if(!_0xa07d4a)return console['error'](a13_0x97d37[_0x33509e(0x1fc)](_0x33509e(0x1dc))),0x1;const _0x56f10c=await deleteKeychainAPIKey(_0x545dec);return _0x56f10c?(clearCredentialCache(),console[_0x33509e(0x1ee)](_0x33509e(0x1ec)+(_0x545dec?_0x33509e(0x1f9)+_0x545dec+')':'')),0x0):(console[_0x33509e(0x1ee)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x545dec?_0x33509e(0x1e6)+_0x545dec:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a14_0x3ecb57=a14_0x17b7;(function(_0x19b1f2,_0x196797){const _0x3870d2=a14_0x17b7,_0x2aa494=_0x19b1f2();while(!![]){try{const _0x456dfc=parseInt(_0x3870d2(0xa5))/0x1*(-parseInt(_0x3870d2(0x9a))/0x2)+-parseInt(_0x3870d2(0xb2))/0x3+parseInt(_0x3870d2(0xca))/0x4*(parseInt(_0x3870d2(0x97))/0x5)+-parseInt(_0x3870d2(0xb1))/0x6*(-parseInt(_0x3870d2(0xcd))/0x7)+-parseInt(_0x3870d2(0xbb))/0x8+parseInt(_0x3870d2(0xae))/0x9+parseInt(_0x3870d2(0xc5))/0xa;if(_0x456dfc===_0x196797)break;else _0x2aa494['push'](_0x2aa494['shift']());}catch(_0x3d3804){_0x2aa494['push'](_0x2aa494['shift']());}}}(a14_0x5c81,0xa66c0));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a14_0x5c81(){const _0x5c66dd=['description','error','stack','code','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','\x27...','2902995aCMIpN','Agent\x20reference\x20must\x20include\x20project\x20name.\x20Usage:\x20--agent\x20\x22Project/Agent\x22','Getting\x20agent\x20for\x20model\x20\x27','50088eLeCLr','55092ljTozb','cause','tool_call','\x0a[Tool:\x20','functionName','\x0a[Output:\x20','includes','chatId','handleSSEEvent','498208nqUAIF','resolveAgentId','agent','\x20\x20Cause:\x20','log','type','data','streamChat','output','CHAT_NOT_FOUND','432560BStoSj','getAgentId','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','temperature','Error:\x20','892kxfESc','metadata','Continuing\x20chat:\x20','154DTGVnK','17785ICbqLn','write','event','580374ogFRxb','llm','\x0aStack\x20trace:','getOrCreateDefaultAgent','haiku','stdout','verbose','stderr','tool','content','validate','2kAWfgP','\x0a[Error:\x20','join'];a14_0x5c81=function(){return _0x5c66dd;};return a14_0x5c81();}import{parseAgentRef}from'../utils/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';import{resolveModelAlias}from'../utils/model-aliases.js';function a14_0x17b7(_0x243d6c,_0x4fc460){const _0x5c81f1=a14_0x5c81();return a14_0x17b7=function(_0x17b76f,_0x93ab43){_0x17b76f=_0x17b76f-0x97;let _0x21d3e4=_0x5c81f1[_0x17b76f];return _0x21d3e4;},a14_0x17b7(_0x243d6c,_0x4fc460);}function handleSDKError(_0x5a02b0,_0x21f053){const _0x4af90f=a14_0x17b7;if(_0x5a02b0 instanceof SDKError)console['error'](_0x4af90f(0xc9)+_0x5a02b0['message']),_0x21f053[_0x4af90f(0xa0)]&&(_0x5a02b0[_0x4af90f(0xb3)]&&console[_0x4af90f(0xa9)](_0x4af90f(0xbe)+_0x5a02b0['cause']),_0x5a02b0[_0x4af90f(0xaa)]&&(console[_0x4af90f(0xa9)](_0x4af90f(0x9c)),console[_0x4af90f(0xa9)](_0x5a02b0[_0x4af90f(0xaa)])));else throw _0x5a02b0;}export class ChatCommand extends BaseCommand{['name']='chat';[a14_0x3ecb57(0xa8)]=a14_0x3ecb57(0xc7);[a14_0x3ecb57(0xa4)](_0x135420){const _0x171218=a14_0x3ecb57,_0xcf5989=_0x135420['args']['join']('\x20');if(!_0xcf5989)return _0x171218(0xac);return undefined;}async[a14_0x3ecb57(0xc2)](_0x4bd78b,_0x26a4a0,_0x1cf208,_0x5634c3,_0x348e82){const _0x4fb489=a14_0x3ecb57;for await(const _0x15e541 of _0x4bd78b[_0x4fb489(0x9b)]['chat'](_0x26a4a0,{'agentId':_0x1cf208,'chatId':_0x5634c3})){if(_0x15e541['type']===_0x4fb489(0xcb)){const _0x5706d6=_0x15e541['data'][_0x4fb489(0xb9)];saveLastChatId(_0x5706d6),_0x348e82&&console['error']('Chat\x20session:\x20'+_0x5706d6);}else _0x15e541[_0x4fb489(0xc0)]===_0x4fb489(0x99)&&this[_0x4fb489(0xba)](_0x15e541['data']);}}async[a14_0x3ecb57(0xc6)](_0x3d90ce,_0x1cc292,_0x4741a6,_0x4afdce,_0x270cd3){const _0x1a7932=a14_0x3ecb57;if(_0x1cc292){const {projectName:_0x5f3d71,agentName:_0x57098a}=parseAgentRef(_0x1cc292);if(!_0x57098a)throw new Error(_0x1a7932(0xaf));const _0x220b24=await withSpinner('Resolving\x20project\x20\x27'+_0x5f3d71+_0x1a7932(0xad),()=>_0x3d90ce[_0x1a7932(0x9b)]['resolveProjectId'](_0x5f3d71),{'verbose':_0x270cd3}),_0x120c78=await withSpinner('Resolving\x20agent\x20\x27'+_0x57098a+'\x27...',()=>_0x3d90ce['llm'][_0x1a7932(0xbc)](_0x57098a,_0x220b24[_0x1a7932(0xc1)]),{'verbose':_0x270cd3});return _0x120c78[_0x1a7932(0xc1)];}else{const _0x285599=_0x4741a6||_0x1a7932(0x9e),_0x325d96=resolveModelAlias(_0x285599),_0x489ff8=await withSpinner(_0x1a7932(0xb0)+_0x325d96+'\x27...',()=>_0x3d90ce[_0x1a7932(0x9b)][_0x1a7932(0x9d)](_0x325d96,0x0,_0x4afdce),{'verbose':_0x270cd3});return _0x489ff8[_0x1a7932(0xc1)]['id'];}}async['execute'](_0x183490){const _0x30294b=a14_0x3ecb57,{options:_0x2d82bd,args:_0x54a5ac,tdx:_0x4ade34}=_0x183490,_0x1b72fe=_0x54a5ac[_0x30294b(0xa7)]('\x20'),_0x1dafa3=_0x2d82bd,_0x58eed0=_0x1dafa3[_0x30294b(0xbd)],_0x1774a7=_0x1dafa3['model'],_0x34615b=_0x1dafa3[_0x30294b(0xc8)]?Number(_0x1dafa3[_0x30294b(0xc8)]):undefined,_0x2aac33=_0x1dafa3['new'];try{let _0x1ce036,_0x47e7be;!_0x2aac33&&(_0x47e7be=loadLastChatId(),_0x47e7be&&_0x2d82bd[_0x30294b(0xa0)]&&console[_0x30294b(0xa9)](_0x30294b(0xcc)+_0x47e7be));(_0x2aac33||!_0x47e7be)&&(_0x1ce036=await this[_0x30294b(0xc6)](_0x4ade34,_0x58eed0,_0x1774a7,_0x34615b,_0x2d82bd['verbose']));try{await this[_0x30294b(0xc2)](_0x4ade34,_0x1b72fe,_0x1ce036,_0x47e7be,_0x2d82bd['verbose']);}catch(_0x255bbf){const _0x5a7dd8=_0x255bbf instanceof SDKError&&_0x255bbf[_0x30294b(0xab)]===ErrorCode[_0x30294b(0xc4)]||_0x255bbf instanceof Error&&_0x255bbf['message'][_0x30294b(0xb8)]('404');if(_0x5a7dd8)_0x2d82bd['verbose']&&console[_0x30294b(0xa9)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x1ce036&&(_0x1ce036=await this['getAgentId'](_0x4ade34,_0x58eed0,_0x1774a7,_0x34615b,_0x2d82bd[_0x30294b(0xa0)])),await this[_0x30294b(0xc2)](_0x4ade34,_0x1b72fe,_0x1ce036,undefined,_0x2d82bd[_0x30294b(0xa0)]);else throw _0x255bbf;}return console[_0x30294b(0xbf)](),0x0;}catch(_0x32ef76){return console['error'](),handleSDKError(_0x32ef76,_0x2d82bd),0x1;}}[a14_0x3ecb57(0xba)](_0x955995){const _0xd41f66=a14_0x3ecb57;if(_0xd41f66(0xa3)in _0x955995)process[_0xd41f66(0x9f)][_0xd41f66(0x98)](_0x955995[_0xd41f66(0xa3)]);else{if('tool_call'in _0x955995)process[_0xd41f66(0xa1)][_0xd41f66(0x98)](_0xd41f66(0xb5)+_0x955995[_0xd41f66(0xb4)][_0xd41f66(0xb6)]+']\x0a');else{if('tool'in _0x955995)process['stderr']['write']('[Tool\x20result:\x20'+_0x955995[_0xd41f66(0xa2)][_0xd41f66(0xb6)]+']\x0a');else{if(_0xd41f66(0xc3)in _0x955995)process[_0xd41f66(0xa1)][_0xd41f66(0x98)](_0xd41f66(0xb7)+_0x955995['output']['name']+']\x0a'),process[_0xd41f66(0xa1)][_0xd41f66(0x98)](_0x955995[_0xd41f66(0xc3)][_0xd41f66(0xa3)]+'\x0a');else _0xd41f66(0xa9)in _0x955995&&process[_0xd41f66(0xa1)]['write'](_0xd41f66(0xa6)+_0x955995[_0xd41f66(0xa9)]+']\x0a');}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a15_0x56649c=a15_0x5d62;(function(_0x3a603b,_0x13eb03){const _0x5e3e94=a15_0x5d62,_0x2eee13=_0x3a603b();while(!![]){try{const _0xe51df=parseInt(_0x5e3e94(0x22b))/0x1*(-parseInt(_0x5e3e94(0x217))/0x2)+parseInt(_0x5e3e94(0x21c))/0x3+parseInt(_0x5e3e94(0x1d2))/0x4+-parseInt(_0x5e3e94(0x21d))/0x5+-parseInt(_0x5e3e94(0x235))/0x6*(parseInt(_0x5e3e94(0x212))/0x7)+-parseInt(_0x5e3e94(0x209))/0x8*(parseInt(_0x5e3e94(0x231))/0x9)+parseInt(_0x5e3e94(0x1d4))/0xa;if(_0xe51df===_0x13eb03)break;else _0x2eee13['push'](_0x2eee13['shift']());}catch(_0x328f75){_0x2eee13['push'](_0x2eee13['shift']());}}}(a15_0x6e33,0x935da));function a15_0x5d62(_0x1960b9,_0x591a61){const _0x6e3369=a15_0x6e33();return a15_0x5d62=function(_0x5d629c,_0x3d38bf){_0x5d629c=_0x5d629c-0x1d0;let _0x5c9c60=_0x6e3369[_0x5d629c];return _0x5c9c60;},a15_0x5d62(_0x1960b9,_0x591a61);}import{spawn}from'node:child_process';import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';import a15_0x4420a5 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';function handleInstallationError(_0x40f3f0,_0x36b32e,_0x1b9b6b,_0x49a144){const _0x4b725b=a15_0x5d62;errorContains(_0x40f3f0,'already\x20exists',_0x4b725b(0x214),_0x4b725b(0x226))?(_0x1b9b6b['text']='✓\x20'+_0x36b32e+_0x4b725b(0x237),_0x49a144?.[_0x4b725b(0x200)](_0x36b32e+'\x20already\x20configured'),_0x40f3f0 instanceof SDKError&&_0x40f3f0[_0x4b725b(0x1e7)]&&_0x49a144?.['debug'](_0x4b725b(0x207)+_0x40f3f0[_0x4b725b(0x1e7)][_0x4b725b(0x228)])):(_0x1b9b6b['warn'](_0x4b725b(0x1e5)+_0x36b32e),_0x49a144?.[_0x4b725b(0x21f)](_0x36b32e+_0x4b725b(0x23e),_0x40f3f0));}async function executeClaudeCommand(_0x40d818,_0x3f3ffc,_0x26758a){const _0x4c8300=a15_0x5d62;return _0x26758a?.['info'](_0x4c8300(0x1d7)+_0x40d818[_0x4c8300(0x1e8)]('\x20')),new Promise((_0xb9eff7,_0x402c55)=>{const _0x2c7ada=_0x4c8300,_0x4a4290=spawn(_0x2c7ada(0x1df),_0x40d818,{'stdio':'pipe'});let _0x16e4db='',_0x5462f1='';_0x4a4290[_0x2c7ada(0x210)]['on'](_0x2c7ada(0x1ec),_0xc30769=>{const _0x18c025=_0x2c7ada;_0x16e4db+=_0xc30769[_0x18c025(0x239)]();}),_0x4a4290[_0x2c7ada(0x230)]['on']('data',_0x45d9b1=>{const _0x3a1fc9=_0x2c7ada;_0x5462f1+=_0x45d9b1[_0x3a1fc9(0x239)]();}),_0x4a4290['on'](_0x2c7ada(0x241),_0x199a97=>{const _0x4239d6=_0x2c7ada;if(_0x199a97===0x0)_0xb9eff7(_0x16e4db);else _0x3f3ffc?(_0x26758a?.[_0x4239d6(0x21f)](_0x4239d6(0x1e3)+_0x199a97+_0x4239d6(0x1e1)+_0x40d818[_0x4239d6(0x1e8)]('\x20')),_0x402c55(new SDKError(ErrorCode[_0x4239d6(0x238)],_0x3f3ffc,new Error(_0x5462f1)))):_0xb9eff7('');});});}function a15_0x6e33(){const _0x103212=['\x20configuration\x20failed','✓\x20Plugin\x20\x27','Configuring\x20marketplace\x20\x27','exit','ANTHROPIC_BASE_URL','Configuring\x20MCP\x20server\x20\x27','Setup\x20failed','object','utf-8','td-docs','1166716WNPJjO','inherit','37342860mmAbgH','server','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Executing:\x20claude\x20','http://127.0.0.1:','127.0.0.1','settings.local.json','name','log','tdx\x20--profile\x20','env','claude','https://github.com/treasure-data/td-skills','):\x20claude\x20','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Command\x20failed\x20(exit\x20','which','Warning:\x20Failed\x20to\x20configure\x20','attributes','cause','join','Updating\x20marketplace\x20\x27','COMMAND_NOT_FOUND','close','data','cwd','https://docs.treasuredata.com/mcp','tdx','Creating\x20.claude/settings.local.json...','string','✓\x20TD\x20LLM\x20proxy\x20server\x20stopped','\x27...','red','logLevel','verbose','TD\x20Docs\x20MCP\x20Server','site','stringify','description','tdx-skills','Finding\x20available\x20port...','includes','marketplace','Initializing\x20proxy\x20logger...','info','✓\x20MCP\x20server\x20\x27','hostname','getOrCreateDefaultProject','command','http','Failed\x20to\x20install\x20plugin\x20\x27','Command\x20output:\x20','--transport','8uLbfeP','sonnet','stop','workflow-skills','start','Setting\x20up\x20project...','\x20claude\x20statusline','stdout','Claude\x20Code\x20CLI\x20not\x20found','7lfPmdD','logger','already\x20installed','ANTHROPIC_MODEL','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','4fHXQhJ','statusLine','text','✓\x20Logging\x20to\x20','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','441165sISlWm','408840mVzkbG','fail','error','✓\x20Marketplace\x20\x27','originalSettings','execute','td-skills','Initializing...','green','already\x20configured','getLogPath','message','sql-skills','profile','593153eSAUwA','plugin','td-skills\x20Plugins','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','add','stderr','10370403bJZZjj','Failed\x20to\x20update\x20marketplace\x20\x27','update','✓\x20Using\x20project:\x20','6894414CzeAud','parse','\x20already\x20configured','INSTALLATION_FAILED','toString','trim','Failed\x20to\x20configure\x20marketplace\x20\x27','findClaudePath','.claude'];a15_0x6e33=function(){return _0x103212;};return a15_0x6e33();}async function ensureMcpServer(_0xa364,_0xd14bc1,_0x1a7e08,_0x50bb3d,_0x521386){const _0xb80c14=a15_0x5d62;_0x50bb3d['text']=_0xb80c14(0x243)+_0xa364+_0xb80c14(0x1f3),await executeClaudeCommand(['mcp',_0xb80c14(0x22f),_0xa364,_0xd14bc1,_0xb80c14(0x208),_0x1a7e08],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0xa364+'\x27',_0x521386),_0x50bb3d[_0xb80c14(0x219)]=_0xb80c14(0x201)+_0xa364+'\x27\x20configured';}async function ensureMarketplace(_0x5e0308,_0x19f2af,_0x61689a,_0x3a220e){const _0x14aa5a=a15_0x5d62;_0x61689a[_0x14aa5a(0x219)]=_0x14aa5a(0x240)+_0x5e0308+_0x14aa5a(0x1f3),await executeClaudeCommand([_0x14aa5a(0x22c),_0x14aa5a(0x1fe),'add',_0x19f2af],_0x14aa5a(0x23b)+_0x5e0308+'\x27',_0x3a220e),_0x61689a[_0x14aa5a(0x219)]='✓\x20Marketplace\x20\x27'+_0x5e0308+'\x27\x20configured';}async function updateMarketplace(_0x2e8cf5,_0xfbe984,_0x4a0a9a){const _0x5ccec9=a15_0x5d62;_0xfbe984['text']=_0x5ccec9(0x1e9)+_0x2e8cf5+_0x5ccec9(0x1f3),await executeClaudeCommand([_0x5ccec9(0x22c),'marketplace',_0x5ccec9(0x233)],_0x5ccec9(0x232)+_0x2e8cf5+'\x27',_0x4a0a9a),_0xfbe984[_0x5ccec9(0x219)]=_0x5ccec9(0x220)+_0x2e8cf5+'\x27\x20updated';}async function ensurePlugin(_0x4c75e6,_0x48d0f3,_0x311d34,_0x2aace0){const _0x158aa4=a15_0x5d62;_0x311d34[_0x158aa4(0x219)]='Installing\x20plugin\x20\x27'+_0x4c75e6+'\x27...',await executeClaudeCommand(['plugin','install',_0x4c75e6+'@'+_0x48d0f3],_0x158aa4(0x206)+_0x4c75e6+'\x27',_0x2aace0),_0x311d34[_0x158aa4(0x219)]=_0x158aa4(0x23f)+_0x4c75e6+'\x27\x20installed';}async function createClaudeSettings(_0x5abe0e,_0x3955ab='sonnet',_0x494ddc){const _0x2359e4=a15_0x5d62,_0x45d152=join(process[_0x2359e4(0x1ed)](),_0x2359e4(0x23d)),_0x5a9c09=join(_0x45d152,_0x2359e4(0x1da));await mkdir(_0x45d152,{'recursive':!![]});let _0x48f786={};if(existsSync(_0x5a9c09))try{const _0x44d016=await readFile(_0x5a9c09,_0x2359e4(0x1d0));_0x48f786=JSON[_0x2359e4(0x236)](_0x44d016);}catch{_0x48f786={};}const _0xf5a561=_0x48f786[_0x2359e4(0x1de)]||{},_0x48d00a={'ANTHROPIC_BASE_URL':_0xf5a561['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0xf5a561[_0x2359e4(0x215)],'statusLine':_0x48f786[_0x2359e4(0x218)]},_0x2876e7={..._0x48f786,'env':{..._0xf5a561,'ANTHROPIC_BASE_URL':_0x2359e4(0x1d8)+_0x5abe0e,'ANTHROPIC_MODEL':_0x3955ab},'statusLine':{'type':_0x2359e4(0x204),'command':_0x494ddc?_0x2359e4(0x1dd)+_0x494ddc+_0x2359e4(0x20f):'tdx\x20claude\x20statusline'}};return await writeFile(_0x5a9c09,JSON[_0x2359e4(0x1f9)](_0x2876e7,null,0x2)+'\x0a'),_0x48d00a;}async function restoreClaudeSettings(_0x3290cf){const _0x5aa09c=a15_0x5d62,_0x454d86=join(process[_0x5aa09c(0x1ed)](),_0x5aa09c(0x23d)),_0x26c02c=join(_0x454d86,'settings.local.json');if(!existsSync(_0x26c02c))return;try{const _0x3e847c=await readFile(_0x26c02c,_0x5aa09c(0x1d0)),_0x224145=JSON['parse'](_0x3e847c),_0x67177c=_0x224145[_0x5aa09c(0x1de)]||{},_0x41fbad=_0x67177c[_0x5aa09c(0x242)],_0x21740f=((()=>{const _0x384781=_0x5aa09c;if(typeof _0x41fbad!=='string')return![];try{const _0x28872f=new URL(_0x41fbad);return _0x28872f['hostname']==='localhost'||_0x28872f[_0x384781(0x202)]===_0x384781(0x1d9);}catch{return![];}})());_0x21740f?(delete _0x67177c['ANTHROPIC_BASE_URL'],delete _0x67177c[_0x5aa09c(0x215)]):(_0x3290cf[_0x5aa09c(0x242)]!==undefined?_0x67177c[_0x5aa09c(0x242)]=_0x3290cf[_0x5aa09c(0x242)]:delete _0x67177c[_0x5aa09c(0x242)],_0x3290cf[_0x5aa09c(0x215)]!==undefined?_0x67177c['ANTHROPIC_MODEL']=_0x3290cf[_0x5aa09c(0x215)]:delete _0x67177c[_0x5aa09c(0x215)]);const _0x392aa1=_0x224145[_0x5aa09c(0x218)],_0x466123=((()=>{const _0x1ced26=_0x5aa09c;if(!_0x392aa1||typeof _0x392aa1!==_0x1ced26(0x245))return![];if(_0x392aa1['type']!==_0x1ced26(0x204))return![];if(typeof _0x392aa1[_0x1ced26(0x204)]!==_0x1ced26(0x1f1))return![];return _0x392aa1[_0x1ced26(0x204)][_0x1ced26(0x1fd)](_0x1ced26(0x1ef))&&_0x392aa1[_0x1ced26(0x204)]['includes']('statusline');})());if(_0x466123)delete _0x224145['statusLine'];else _0x3290cf[_0x5aa09c(0x218)]!==undefined?_0x224145[_0x5aa09c(0x218)]=_0x3290cf[_0x5aa09c(0x218)]:delete _0x224145['statusLine'];_0x224145[_0x5aa09c(0x1de)]=_0x67177c,await writeFile(_0x26c02c,JSON['stringify'](_0x224145,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{['name']=a15_0x56649c(0x1df);[a15_0x56649c(0x1fa)]=a15_0x56649c(0x216);[a15_0x56649c(0x1d5)];[a15_0x56649c(0x221)];[a15_0x56649c(0x213)];async[a15_0x56649c(0x222)](_0x4cefca){const _0x343c4a=a15_0x56649c,{tdx:_0x488e1a,options:_0x54ffd5,args:_0x28f7cb}=_0x4cefca;try{const _0x8c522=_0x54ffd5,_0x56749f=_0x8c522['model']||_0x343c4a(0x20a),_0x347d59=_0x8c522['proxy']===![],_0x2bc346=createCommandSpinner(_0x343c4a(0x224),{'verbose':_0x54ffd5[_0x343c4a(0x1f6)]});_0x2bc346[_0x343c4a(0x20d)]();try{if(!_0x347d59){_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x1fc);const _0x5571d7=await findAvailablePort(0xfa0);_0x2bc346[_0x343c4a(0x219)]='✓\x20Port\x20'+_0x5571d7,_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x20e);const _0x204583=await _0x488e1a['llm'][_0x343c4a(0x203)](),_0x349875=_0x204583['id'];_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x234)+_0x204583[_0x343c4a(0x1e6)][_0x343c4a(0x1db)],_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x1ff),this[_0x343c4a(0x213)]=new TDXLogger(_0x54ffd5[_0x343c4a(0x1f5)],!![]),await this[_0x343c4a(0x213)]['init']();const _0x33ddc9=this['logger'][_0x343c4a(0x227)]();_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x21a)+_0x33ddc9,_0x2bc346[_0x343c4a(0x219)]='Starting\x20TD\x20LLM\x20proxy\x20server...',this[_0x343c4a(0x1d5)]=new ProxyServer({'port':_0x5571d7,'projectId':_0x349875,'tdx':_0x488e1a,'logger':this[_0x343c4a(0x213)],'site':_0x54ffd5[_0x343c4a(0x1f8)]}),await this['server'][_0x343c4a(0x20d)](),_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x22e)+_0x5571d7,_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x1f0);const _0x3f622d=_0x54ffd5[_0x343c4a(0x22a)];this[_0x343c4a(0x221)]=await createClaudeSettings(_0x5571d7,_0x56749f,_0x3f622d),_0x2bc346[_0x343c4a(0x219)]=_0x343c4a(0x1e2);}else _0x2bc346['text']=_0x343c4a(0x1d6);try{await ensureMcpServer(_0x343c4a(0x1d1),_0x343c4a(0x1ee),_0x343c4a(0x205),_0x2bc346,this[_0x343c4a(0x213)]);}catch(_0x282090){handleInstallationError(_0x282090,_0x343c4a(0x1f7),_0x2bc346,this[_0x343c4a(0x213)]);}try{await ensureMarketplace(_0x343c4a(0x223),_0x343c4a(0x1e0),_0x2bc346,this[_0x343c4a(0x213)]),await updateMarketplace(_0x343c4a(0x223),_0x2bc346,this['logger']),await ensurePlugin(_0x343c4a(0x229),_0x343c4a(0x223),_0x2bc346,this[_0x343c4a(0x213)]),await ensurePlugin(_0x343c4a(0x20c),_0x343c4a(0x223),_0x2bc346,this[_0x343c4a(0x213)]),await ensurePlugin(_0x343c4a(0x1fb),'td-skills',_0x2bc346,this[_0x343c4a(0x213)]);}catch(_0x2bda67){handleInstallationError(_0x2bda67,_0x343c4a(0x22d),_0x2bc346,this['logger']);}_0x2bc346[_0x343c4a(0x20b)]();}catch(_0x4ab3ac){_0x2bc346[_0x343c4a(0x21e)](_0x343c4a(0x244));throw _0x4ab3ac;}const _0x26b550=await this[_0x343c4a(0x23c)]();if(!_0x26b550)throw new SDKError(ErrorCode[_0x343c4a(0x1ea)],_0x343c4a(0x211),undefined,{'helpText':_0x343c4a(0x21b)});const _0x4fa8bd=spawn(_0x26b550,_0x28f7cb,{'stdio':_0x343c4a(0x1d3)}),_0x4c5031=await new Promise(_0x2cf756=>{const _0x1e76f4=_0x343c4a;_0x4fa8bd['on']('exit',_0x3d8500=>{_0x2cf756(_0x3d8500||0x0);}),_0x4fa8bd['on'](_0x1e76f4(0x21f),_0x593eb1=>{const _0x4ae59b=_0x1e76f4;console['error'](a15_0x4420a5[_0x4ae59b(0x1f4)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x593eb1[_0x4ae59b(0x228)])),_0x2cf756(0x1);});});this[_0x343c4a(0x1d5)]&&(await this['server'][_0x343c4a(0x20b)](),console[_0x343c4a(0x1dc)](a15_0x4420a5[_0x343c4a(0x225)](_0x343c4a(0x1f2))));if(this[_0x343c4a(0x213)]){await this[_0x343c4a(0x213)][_0x343c4a(0x1eb)]();const _0x4f1e40=this[_0x343c4a(0x213)]['getLogPath']();console[_0x343c4a(0x1dc)](a15_0x4420a5[_0x343c4a(0x225)]('✓\x20Logs\x20saved\x20to\x20'+_0x4f1e40));}return this[_0x343c4a(0x221)]&&(await restoreClaudeSettings(this[_0x343c4a(0x221)]),console[_0x343c4a(0x1dc)](a15_0x4420a5['green']('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x4c5031;}catch(_0x4babe1){this[_0x343c4a(0x1d5)]&&await this[_0x343c4a(0x1d5)][_0x343c4a(0x20b)]();this[_0x343c4a(0x213)]&&await this[_0x343c4a(0x213)][_0x343c4a(0x1eb)]();this[_0x343c4a(0x221)]&&await restoreClaudeSettings(this[_0x343c4a(0x221)]);throw _0x4babe1;}}async[a15_0x56649c(0x23c)](){return new Promise(_0x58a01b=>{const _0x3d1321=a15_0x5d62,_0x517edd=spawn(_0x3d1321(0x1e4),[_0x3d1321(0x1df)]);let _0x73769d='';_0x517edd[_0x3d1321(0x210)]['on'](_0x3d1321(0x1ec),_0xe5921b=>{const _0x93910d=_0x3d1321;_0x73769d+=_0xe5921b[_0x93910d(0x239)]();}),_0x517edd['on'](_0x3d1321(0x241),_0x2df89d=>{const _0x1a1c0c=_0x3d1321;_0x2df89d===0x0&&_0x73769d[_0x1a1c0c(0x23a)]()?_0x58a01b(_0x73769d['trim']()):_0x58a01b('claude');});});}}
|
|
1
|
+
const a15_0x3e9a59=a15_0x10ea;(function(_0x2e3b98,_0x5ce9f5){const _0x89a795=a15_0x10ea,_0x4e9efb=_0x2e3b98();while(!![]){try{const _0x431a5e=parseInt(_0x89a795(0x12f))/0x1+parseInt(_0x89a795(0x109))/0x2*(-parseInt(_0x89a795(0x130))/0x3)+parseInt(_0x89a795(0x169))/0x4+parseInt(_0x89a795(0x162))/0x5+-parseInt(_0x89a795(0x14a))/0x6+parseInt(_0x89a795(0x166))/0x7*(-parseInt(_0x89a795(0x120))/0x8)+parseInt(_0x89a795(0x165))/0x9;if(_0x431a5e===_0x5ce9f5)break;else _0x4e9efb['push'](_0x4e9efb['shift']());}catch(_0x5811dc){_0x4e9efb['push'](_0x4e9efb['shift']());}}}(a15_0x3307,0x622b0));import{spawn}from'node:child_process';import{readFile,writeFile,mkdir}from'node:fs/promises';import{existsSync}from'node:fs';import{join}from'node:path';function a15_0x10ea(_0x1f7f88,_0x3efefc){const _0x330725=a15_0x3307();return a15_0x10ea=function(_0x10ea78,_0x17f423){_0x10ea78=_0x10ea78-0x102;let _0x30b755=_0x330725[_0x10ea78];return _0x30b755;},a15_0x10ea(_0x1f7f88,_0x3efefc);}import a15_0xad2387 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{findAvailablePort}from'../utils/port.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';function handleInstallationError(_0x5789b7,_0x3436a6,_0x127445,_0x326206){const _0x14fd77=a15_0x10ea;errorContains(_0x5789b7,'already\x20exists',_0x14fd77(0x11a),_0x14fd77(0x128))?(_0x127445[_0x14fd77(0x106)]='✓\x20'+_0x3436a6+'\x20already\x20configured',_0x326206?.['info'](_0x3436a6+_0x14fd77(0x13a)),_0x5789b7 instanceof SDKError&&_0x5789b7[_0x14fd77(0x168)]&&_0x326206?.[_0x14fd77(0x12c)](_0x14fd77(0x14c)+_0x5789b7[_0x14fd77(0x168)][_0x14fd77(0x15e)])):(_0x127445['warn'](_0x14fd77(0x159)+_0x3436a6),_0x326206?.[_0x14fd77(0x148)](_0x3436a6+'\x20configuration\x20failed',_0x5789b7));}async function executeClaudeCommand(_0x28a4f0,_0x17fda9,_0x1dc94c){const _0x553c35=a15_0x10ea;return _0x1dc94c?.['info'](_0x553c35(0x155)+_0x28a4f0[_0x553c35(0x12a)]('\x20')),new Promise((_0x2d1f60,_0x2e35f6)=>{const _0x4e1a13=_0x553c35,_0x233397=spawn(_0x4e1a13(0x11d),_0x28a4f0,{'stdio':_0x4e1a13(0x112)});let _0x547e18='',_0x234a74='';_0x233397[_0x4e1a13(0x122)]['on'](_0x4e1a13(0x10b),_0x187c86=>{const _0x4fbf37=_0x4e1a13;_0x547e18+=_0x187c86[_0x4fbf37(0x164)]();}),_0x233397['stderr']['on'](_0x4e1a13(0x10b),_0xbec67f=>{const _0x53ac26=_0x4e1a13;_0x234a74+=_0xbec67f[_0x53ac26(0x164)]();}),_0x233397['on'](_0x4e1a13(0x137),_0xf5a9aa=>{const _0xedf155=_0x4e1a13;if(_0xf5a9aa===0x0)_0x2d1f60(_0x547e18);else _0x17fda9?(_0x1dc94c?.[_0xedf155(0x148)]('Command\x20failed\x20(exit\x20'+_0xf5a9aa+_0xedf155(0x158)+_0x28a4f0['join']('\x20')),_0x2e35f6(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x17fda9,new Error(_0x234a74)))):_0x2d1f60('');});});}function a15_0x3307(){const _0x4f19a6=['text','Finding\x20available\x20port...','statusLine','26xlVCFY','which','data','✓\x20Marketplace\x20\x27','Initializing...','cwd','start','model','attributes','pipe','http','Installing\x20plugin\x20\x27','https://github.com/treasure-data/td-skills','\x27\x20configured','\x27\x20installed','✓\x20Plugin\x20\x27','✓\x20Settings\x20restored:\x20.claude/settings.local.json','already\x20installed','includes','http://127.0.0.1:','claude','stop','✓\x20Settings\x20configured:\x20.claude/settings.local.json','8eXUaGW','Creating\x20.claude/settings.local.json...','stdout','tdx\x20claude\x20statusline','td-skills','Configuring\x20marketplace\x20\x27','trim','type','already\x20configured','ANTHROPIC_BASE_URL','join','td-skills\x20Plugins','debug','tdx','server','133142kCDPVP','100767aREpoJ','Failed\x20to\x20launch\x20Claude\x20Code:\x20','originalSettings','✓\x20Port\x20','getLogPath','green','logger','exit','parse','description','\x20already\x20configured','sonnet','td-docs','utf-8','update','\x27\x20updated','✓\x20Logging\x20to\x20','proxy','verbose','settings.local.json','Starting\x20TD\x20LLM\x20proxy\x20server...','Setting\x20up\x20project...','object','TD\x20Docs\x20MCP\x20Server','error','log','525516ZbnZra','stringify','Command\x20output:\x20','red','✓\x20Logs\x20saved\x20to\x20','inherit','\x20claude\x20statusline','Failed\x20to\x20configure\x20marketplace\x20\x27','findClaudePath','tdx\x20--profile\x20','site','Executing:\x20claude\x20','Initializing\x20proxy\x20logger...','sql-skills','):\x20claude\x20','Warning:\x20Failed\x20to\x20configure\x20','\x27...','profile','close','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','message','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','command','localhost','3159335MkINrG','Updating\x20marketplace\x20\x27','toString','7592490nSlhpM','5059691BMfcCU','.claude','cause','162132uxLQYK','name','init','logLevel','tdx-skills','Configuring\x20MCP\x20server\x20\x27','add','Setup\x20failed','ANTHROPIC_MODEL','✓\x20TD\x20LLM\x20proxy\x20running\x20on\x20port\x20','plugin','workflow-skills','marketplace','Failed\x20to\x20update\x20marketplace\x20\x27','hostname','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','env','COMMAND_NOT_FOUND'];a15_0x3307=function(){return _0x4f19a6;};return a15_0x3307();}async function ensureMcpServer(_0x474f79,_0x20fac7,_0x174aa9,_0x4ab550,_0x309b7c){const _0x33c5f6=a15_0x10ea;_0x4ab550[_0x33c5f6(0x106)]=_0x33c5f6(0x16e)+_0x474f79+'\x27...',await executeClaudeCommand(['mcp',_0x33c5f6(0x16f),_0x474f79,_0x20fac7,'--transport',_0x174aa9],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x474f79+'\x27',_0x309b7c),_0x4ab550[_0x33c5f6(0x106)]='✓\x20MCP\x20server\x20\x27'+_0x474f79+_0x33c5f6(0x116);}async function ensureMarketplace(_0x171eb2,_0x397105,_0x175135,_0x122be9){const _0x2b6424=a15_0x10ea;_0x175135['text']=_0x2b6424(0x125)+_0x171eb2+'\x27...',await executeClaudeCommand(['plugin',_0x2b6424(0x175),_0x2b6424(0x16f),_0x397105],_0x2b6424(0x151)+_0x171eb2+'\x27',_0x122be9),_0x175135[_0x2b6424(0x106)]=_0x2b6424(0x10c)+_0x171eb2+_0x2b6424(0x116);}async function updateMarketplace(_0x1943bb,_0x982fab,_0x40ac72){const _0x481363=a15_0x10ea;_0x982fab[_0x481363(0x106)]=_0x481363(0x163)+_0x1943bb+_0x481363(0x15a),await executeClaudeCommand([_0x481363(0x173),_0x481363(0x175),_0x481363(0x13e)],_0x481363(0x176)+_0x1943bb+'\x27',_0x40ac72),_0x982fab[_0x481363(0x106)]=_0x481363(0x10c)+_0x1943bb+_0x481363(0x13f);}async function ensurePlugin(_0x14a3ef,_0x3bf6c3,_0x59bca1,_0x5d8dc7){const _0x5ac901=a15_0x10ea;_0x59bca1['text']=_0x5ac901(0x114)+_0x14a3ef+_0x5ac901(0x15a),await executeClaudeCommand([_0x5ac901(0x173),'install',_0x14a3ef+'@'+_0x3bf6c3],'Failed\x20to\x20install\x20plugin\x20\x27'+_0x14a3ef+'\x27',_0x5d8dc7),_0x59bca1[_0x5ac901(0x106)]=_0x5ac901(0x118)+_0x14a3ef+_0x5ac901(0x117);}async function createClaudeSettings(_0x3deaa7,_0x169938=a15_0x3e9a59(0x13b),_0xe86328){const _0x3ccaa5=a15_0x3e9a59,_0x501917=join(process['cwd'](),'.claude'),_0x1ccbc7=join(_0x501917,_0x3ccaa5(0x143));await mkdir(_0x501917,{'recursive':!![]});let _0x3a1443={};if(existsSync(_0x1ccbc7))try{const _0x56e31a=await readFile(_0x1ccbc7,_0x3ccaa5(0x13d));_0x3a1443=JSON[_0x3ccaa5(0x138)](_0x56e31a);}catch{_0x3a1443={};}const _0x3e9435=_0x3a1443[_0x3ccaa5(0x104)]||{},_0x2a9531={'ANTHROPIC_BASE_URL':_0x3e9435[_0x3ccaa5(0x129)],'ANTHROPIC_MODEL':_0x3e9435[_0x3ccaa5(0x171)],'statusLine':_0x3a1443['statusLine']},_0x38b8ab={..._0x3a1443,'env':{..._0x3e9435,'ANTHROPIC_BASE_URL':_0x3ccaa5(0x11c)+_0x3deaa7,'ANTHROPIC_MODEL':_0x169938},'statusLine':{'type':_0x3ccaa5(0x160),'command':_0xe86328?_0x3ccaa5(0x153)+_0xe86328+_0x3ccaa5(0x150):_0x3ccaa5(0x123)}};return await writeFile(_0x1ccbc7,JSON['stringify'](_0x38b8ab,null,0x2)+'\x0a'),_0x2a9531;}async function restoreClaudeSettings(_0x4178c2){const _0x35c295=a15_0x3e9a59,_0x111214=join(process[_0x35c295(0x10e)](),_0x35c295(0x167)),_0x2c0601=join(_0x111214,_0x35c295(0x143));if(!existsSync(_0x2c0601))return;try{const _0x596540=await readFile(_0x2c0601,_0x35c295(0x13d)),_0x55b08e=JSON['parse'](_0x596540),_0x467912=_0x55b08e['env']||{},_0x2ca225=_0x467912[_0x35c295(0x129)],_0xead39c=((()=>{const _0x284fe8=_0x35c295;if(typeof _0x2ca225!=='string')return![];try{const _0x58be38=new URL(_0x2ca225);return _0x58be38[_0x284fe8(0x102)]===_0x284fe8(0x161)||_0x58be38['hostname']==='127.0.0.1';}catch{return![];}})());_0xead39c?(delete _0x467912[_0x35c295(0x129)],delete _0x467912[_0x35c295(0x171)]):(_0x4178c2['ANTHROPIC_BASE_URL']!==undefined?_0x467912[_0x35c295(0x129)]=_0x4178c2['ANTHROPIC_BASE_URL']:delete _0x467912[_0x35c295(0x129)],_0x4178c2['ANTHROPIC_MODEL']!==undefined?_0x467912['ANTHROPIC_MODEL']=_0x4178c2[_0x35c295(0x171)]:delete _0x467912['ANTHROPIC_MODEL']);const _0x1eab1e=_0x55b08e[_0x35c295(0x108)],_0x1bb27d=((()=>{const _0x5c96ac=_0x35c295;if(!_0x1eab1e||typeof _0x1eab1e!==_0x5c96ac(0x146))return![];if(_0x1eab1e[_0x5c96ac(0x127)]!==_0x5c96ac(0x160))return![];if(typeof _0x1eab1e['command']!=='string')return![];return _0x1eab1e[_0x5c96ac(0x160)][_0x5c96ac(0x11b)](_0x5c96ac(0x12d))&&_0x1eab1e[_0x5c96ac(0x160)][_0x5c96ac(0x11b)]('statusline');})());if(_0x1bb27d)delete _0x55b08e[_0x35c295(0x108)];else _0x4178c2[_0x35c295(0x108)]!==undefined?_0x55b08e['statusLine']=_0x4178c2[_0x35c295(0x108)]:delete _0x55b08e[_0x35c295(0x108)];_0x55b08e['env']=_0x467912,await writeFile(_0x2c0601,JSON[_0x35c295(0x14b)](_0x55b08e,null,0x2)+'\x0a');}catch{}}export class ClaudeCommand extends BaseCommand{[a15_0x3e9a59(0x16a)]=a15_0x3e9a59(0x11d);[a15_0x3e9a59(0x139)]=a15_0x3e9a59(0x15f);[a15_0x3e9a59(0x12e)];[a15_0x3e9a59(0x132)];[a15_0x3e9a59(0x136)];async['execute'](_0x1fc638){const _0x51d9c3=a15_0x3e9a59,{tdx:_0x543321,options:_0x4c92ac,args:_0x4977aa}=_0x1fc638;try{const _0x227045=_0x4c92ac,_0x350158=_0x227045[_0x51d9c3(0x110)]||'sonnet',_0x4aec57=_0x227045[_0x51d9c3(0x141)]===![],_0x3a2c6b=createCommandSpinner(_0x51d9c3(0x10d),{'verbose':_0x4c92ac[_0x51d9c3(0x142)]});_0x3a2c6b[_0x51d9c3(0x10f)]();try{if(!_0x4aec57){_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x107);const _0x1afcbe=await findAvailablePort(0xfa0);_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x133)+_0x1afcbe,_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x145);const _0x1480b1=await _0x543321['llm']['getOrCreateDefaultProject'](),_0x2b2bd0=_0x1480b1['id'];_0x3a2c6b[_0x51d9c3(0x106)]='✓\x20Using\x20project:\x20'+_0x1480b1[_0x51d9c3(0x111)][_0x51d9c3(0x16a)],_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x156),this[_0x51d9c3(0x136)]=new TDXLogger(_0x4c92ac[_0x51d9c3(0x16c)],!![]),await this['logger'][_0x51d9c3(0x16b)]();const _0x2c5c0c=this[_0x51d9c3(0x136)][_0x51d9c3(0x134)]();_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x140)+_0x2c5c0c,_0x3a2c6b['text']=_0x51d9c3(0x144),this[_0x51d9c3(0x12e)]=new ProxyServer({'port':_0x1afcbe,'projectId':_0x2b2bd0,'tdx':_0x543321,'logger':this[_0x51d9c3(0x136)],'site':_0x4c92ac[_0x51d9c3(0x154)]}),await this[_0x51d9c3(0x12e)][_0x51d9c3(0x10f)](),_0x3a2c6b['text']=_0x51d9c3(0x172)+_0x1afcbe,_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x121);const _0x40710c=_0x4c92ac[_0x51d9c3(0x15b)];this[_0x51d9c3(0x132)]=await createClaudeSettings(_0x1afcbe,_0x350158,_0x40710c),_0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x11f);}else _0x3a2c6b[_0x51d9c3(0x106)]=_0x51d9c3(0x103);try{await ensureMcpServer(_0x51d9c3(0x13c),'https://docs.treasuredata.com/mcp',_0x51d9c3(0x113),_0x3a2c6b,this[_0x51d9c3(0x136)]);}catch(_0x14441a){handleInstallationError(_0x14441a,_0x51d9c3(0x147),_0x3a2c6b,this[_0x51d9c3(0x136)]);}try{await ensureMarketplace(_0x51d9c3(0x124),_0x51d9c3(0x115),_0x3a2c6b,this['logger']),await updateMarketplace(_0x51d9c3(0x124),_0x3a2c6b,this['logger']),await ensurePlugin(_0x51d9c3(0x157),_0x51d9c3(0x124),_0x3a2c6b,this['logger']),await ensurePlugin(_0x51d9c3(0x174),_0x51d9c3(0x124),_0x3a2c6b,this[_0x51d9c3(0x136)]),await ensurePlugin(_0x51d9c3(0x16d),_0x51d9c3(0x124),_0x3a2c6b,this['logger']);}catch(_0x41e076){handleInstallationError(_0x41e076,_0x51d9c3(0x12b),_0x3a2c6b,this[_0x51d9c3(0x136)]);}_0x3a2c6b[_0x51d9c3(0x11e)]();}catch(_0x348d99){_0x3a2c6b['fail'](_0x51d9c3(0x170));throw _0x348d99;}const _0x23c594=await this[_0x51d9c3(0x152)]();if(!_0x23c594)throw new SDKError(ErrorCode[_0x51d9c3(0x105)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x51d9c3(0x15d)});const _0x29e7cc=spawn(_0x23c594,_0x4977aa,{'stdio':_0x51d9c3(0x14f)}),_0x5da4ae=await new Promise(_0x1f78fa=>{const _0x48c3be=_0x51d9c3;_0x29e7cc['on'](_0x48c3be(0x137),_0x5c699d=>{_0x1f78fa(_0x5c699d||0x0);}),_0x29e7cc['on'](_0x48c3be(0x148),_0x80bb8c=>{const _0x37df12=_0x48c3be;console[_0x37df12(0x148)](a15_0xad2387[_0x37df12(0x14d)](_0x37df12(0x131)+_0x80bb8c[_0x37df12(0x15e)])),_0x1f78fa(0x1);});});this[_0x51d9c3(0x12e)]&&(await this[_0x51d9c3(0x12e)][_0x51d9c3(0x11e)](),console[_0x51d9c3(0x149)](a15_0xad2387[_0x51d9c3(0x135)]('✓\x20TD\x20LLM\x20proxy\x20server\x20stopped')));if(this['logger']){await this['logger'][_0x51d9c3(0x15c)]();const _0x20d019=this[_0x51d9c3(0x136)][_0x51d9c3(0x134)]();console['log'](a15_0xad2387[_0x51d9c3(0x135)](_0x51d9c3(0x14e)+_0x20d019));}return this[_0x51d9c3(0x132)]&&(await restoreClaudeSettings(this[_0x51d9c3(0x132)]),console[_0x51d9c3(0x149)](a15_0xad2387['green'](_0x51d9c3(0x119)))),_0x5da4ae;}catch(_0x2cf513){this[_0x51d9c3(0x12e)]&&await this[_0x51d9c3(0x12e)][_0x51d9c3(0x11e)]();this[_0x51d9c3(0x136)]&&await this[_0x51d9c3(0x136)]['close']();this[_0x51d9c3(0x132)]&&await restoreClaudeSettings(this[_0x51d9c3(0x132)]);throw _0x2cf513;}}async['findClaudePath'](){return new Promise(_0xb1343a=>{const _0x3b0331=a15_0x10ea,_0x7a533e=spawn(_0x3b0331(0x10a),[_0x3b0331(0x11d)]);let _0x2d8965='';_0x7a533e[_0x3b0331(0x122)]['on'](_0x3b0331(0x10b),_0x488cf0=>{const _0x46c3dc=_0x3b0331;_0x2d8965+=_0x488cf0[_0x46c3dc(0x164)]();}),_0x7a533e['on'](_0x3b0331(0x137),_0x845212=>{const _0x51de7c=_0x3b0331;_0x845212===0x0&&_0x2d8965[_0x51de7c(0x126)]()?_0xb1343a(_0x2d8965['trim']()):_0xb1343a(_0x51de7c(0x11d));});});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x5472f4=a16_0x4d28;(function(_0x16543f,_0x1a991f){const _0xe1936b=a16_0x4d28,_0x3ea0c5=_0x16543f();while(!![]){try{const _0xb83cc=-parseInt(_0xe1936b(0xf2))/0x1*(-parseInt(_0xe1936b(0x113))/0x2)+-parseInt(_0xe1936b(0xf1))/0x3*(-parseInt(_0xe1936b(0xf3))/0x4)+parseInt(_0xe1936b(0x105))/0x5*(-parseInt(_0xe1936b(0x10a))/0x6)+parseInt(_0xe1936b(0x10b))/0x7+parseInt(_0xe1936b(0x10f))/0x8+parseInt(_0xe1936b(0xfe))/0x9*(parseInt(_0xe1936b(0x102))/0xa)+parseInt(_0xe1936b(0x10e))/0xb*(-parseInt(_0xe1936b(0xf0))/0xc);if(_0xb83cc===_0x1a991f)break;else _0x3ea0c5['push'](_0x3ea0c5['shift']());}catch(_0x1a8db2){_0x3ea0c5['push'](_0x3ea0c5['shift']());}}}(a16_0x2c44,0xc2d11));import{createInterface}from'node:readline';function a16_0x2c44(){const _0x531723=['model','close','join','175950khdivA','statusline','log','3190hjsIFz','🤖\x20tdx\x20-\x20','parse','stdin','name','5358IeGMml','6532932cqASef','execute','description','34272821KKbtaP','6040488MJdYPm','todayCredits','monthCredits','toFixed','2XaROBR','\x20today\x20/\x20','12NfrkkG','3018867cIvqSF','240428RKMryE','4QDebRx','\x20session\x20/\x20','\x20month','latestInputTokens','🤖\x20tdx\x20-\x20Claude','profile','push','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','🧠\x20','🪙\x20credit:\x20','session_id','792VNTkvu'];a16_0x2c44=function(){return _0x531723;};return a16_0x2c44();}import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{getModelDisplayName,formatTokenCount,calculateContextPercentage}from'../utils/model-factors.js';function a16_0x4d28(_0x230a76,_0x5da0c0){const _0x2c44bb=a16_0x2c44();return a16_0x4d28=function(_0x4d288c,_0x4bab83){_0x4d288c=_0x4d288c-0xf0;let _0x129583=_0x2c44bb[_0x4d288c];return _0x129583;},a16_0x4d28(_0x230a76,_0x5da0c0);}async function readStdinJson(_0x1d8345=0x64){return new Promise(_0x700107=>{const _0x45b0f1=a16_0x4d28;let _0x439507='',_0x3ddf22=![];const _0x293896=createInterface({'input':process[_0x45b0f1(0x108)],'terminal':![]}),_0x23f9db=_0x12f911=>{const _0x14d25e=_0x45b0f1;if(_0x3ddf22)return;_0x3ddf22=!![],clearTimeout(_0x100cd7),_0x293896[_0x14d25e(0x100)](),_0x700107(_0x12f911);},_0x100cd7=setTimeout(()=>{_0x23f9db(null);},_0x1d8345);_0x293896['on']('line',_0x1c14a5=>{_0x439507+=_0x1c14a5;}),_0x293896['on'](_0x45b0f1(0x100),()=>{const _0x6c5bb7=_0x45b0f1;if(_0x3ddf22)return;try{const _0x4b5c3c=JSON[_0x6c5bb7(0x107)](_0x439507);_0x23f9db(_0x4b5c3c);}catch{_0x23f9db(null);}});});}function formatCredits(_0x2cb15c){const _0x36bda8=a16_0x4d28;return _0x2cb15c[_0x36bda8(0x112)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a16_0x5472f4(0x109)]=a16_0x5472f4(0x103);[a16_0x5472f4(0x10d)]=a16_0x5472f4(0xfa);async[a16_0x5472f4(0x10c)](_0x20ace5){const _0xae97fc=a16_0x5472f4;try{const _0x948250=await readStdinJson();if(!_0x948250?.[_0xae97fc(0xfd)])return console[_0xae97fc(0x104)](_0xae97fc(0xf7)),0x0;const _0x198681=_0x948250['session_id'],_0x25ce21=_0x948250[_0xae97fc(0xff)]?.['id']||'',_0x30b771=_0x948250[_0xae97fc(0xf8)]||_0x20ace5['options'][_0xae97fc(0xf8)],_0x2741d0=await getUsageStats(_0x198681,_0x30b771),_0xdb1438=[],_0x554629=_0x25ce21?getModelDisplayName(_0x25ce21):'Claude';_0xdb1438[_0xae97fc(0xf9)](_0xae97fc(0x106)+_0x554629);const _0x44cd45=formatCredits(_0x2741d0['sessionCredits']),_0x15fb9a=formatCredits(_0x2741d0[_0xae97fc(0x110)]),_0x189c80=formatCredits(_0x2741d0[_0xae97fc(0x111)]);_0xdb1438['push'](_0xae97fc(0xfc)+_0x44cd45+_0xae97fc(0xf4)+_0x15fb9a+_0xae97fc(0x114)+_0x189c80+_0xae97fc(0xf5));if(_0x2741d0[_0xae97fc(0xf6)]>0x0&&_0x25ce21){const _0x1eab1a=formatTokenCount(_0x2741d0[_0xae97fc(0xf6)]),_0x15a2f5=calculateContextPercentage(_0x2741d0[_0xae97fc(0xf6)],_0x25ce21);_0xdb1438['push'](_0xae97fc(0xfb)+_0x1eab1a+'\x20('+_0x15a2f5+'%)');}return console['log'](_0xdb1438[_0xae97fc(0x101)]('\x20|\x20')),0x0;}catch{return console[_0xae97fc(0x104)](_0xae97fc(0xf7)),0x0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x482877=a17_0x1911;function a17_0x1911(_0xe20f49,_0x81c041){const _0x4930b2=a17_0x4930();return a17_0x1911=function(_0x1911ae,_0x42418a){_0x1911ae=_0x1911ae-0x13a;let _0x403208=_0x4930b2[_0x1911ae];return _0x403208;},a17_0x1911(_0xe20f49,_0x81c041);}(function(_0x2913f2,_0x3887f2){const _0x188c57=a17_0x1911,_0x579ad4=_0x2913f2();while(!![]){try{const _0x1992c8=-parseInt(_0x188c57(0x15d))/0x1+-parseInt(_0x188c57(0x147))/0x2*(-parseInt(_0x188c57(0x16a))/0x3)+-parseInt(_0x188c57(0x161))/0x4+-parseInt(_0x188c57(0x174))/0x5*(parseInt(_0x188c57(0x162))/0x6)+-parseInt(_0x188c57(0x16e))/0x7*(parseInt(_0x188c57(0x145))/0x8)+-parseInt(_0x188c57(0x140))/0x9+parseInt(_0x188c57(0x172))/0xa;if(_0x1992c8===_0x3887f2)break;else _0x579ad4['push'](_0x579ad4['shift']());}catch(_0xbba1af){_0x579ad4['push'](_0x579ad4['shift']());}}}(a17_0x4930,0xce3a6));import a17_0x401deb from'chalk';import{BaseCommand}from'./command.js';function a17_0x4930(){const _0x5de4b7=['1361112mYeLpm','6BFqOzB','Unknown\x20error','en-US','Credits','red','\x20credits','en-CA','Error:\x20','78FZjfht','json','log','cyan','1241149kYqoTG','yesterday','length','\x20\x20Total:\x20\x20\x20','40129070rdlrSN','Usage\x20by\x20Profile','1429595uAWTlW','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','\x20\x20Month:\x20\x20\x20','getTime','monthCredits','toLocaleDateString','format','numeric','execute','round','13608666WRzezO','all','outputTable','credits','never','8cilmSl','padStart','49400QmgWvz','(default)','profile','toFixed','\x20\x20Today:\x20\x20\x20','error','repeat','max','bold','outputStructured','default','description','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','Last\x20Used','today\x20','jsonl','message','toLocaleTimeString','entryCount','totalCredits','todayCredits','dim','1494819VMseya','lastUsedAt','padEnd','\x20\x20No\x20usage\x20data\x20recorded\x20yet.'];a17_0x4930=function(){return _0x5de4b7;};return a17_0x4930();}import{handleSDKOutput}from'../utils/command-output.js';import{getAllProfileStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0xd5b63c){const _0xda77e7=a17_0x1911;return _0xd5b63c[_0xda77e7(0x14a)](0x2);}function formatLastUsed(_0x255e51){const _0x29a6ec=a17_0x1911;if(!_0x255e51)return _0x29a6ec(0x144);const _0xe0a8c2=new Date(_0x255e51),_0x25b9e4=new Date(),_0x83d838=_0xe0a8c2[_0x29a6ec(0x13b)]('en-CA'),_0x554197=_0x25b9e4['toLocaleDateString'](_0x29a6ec(0x168));if(_0x83d838===_0x554197)return _0x29a6ec(0x155)+_0xe0a8c2[_0x29a6ec(0x158)]('en-US',{'hour':'2-digit','minute':'2-digit'});const _0xd0e516=new Date(_0x83d838),_0x185ce3=new Date(_0x554197),_0x50a193=Math[_0x29a6ec(0x13f)]((_0x185ce3[_0x29a6ec(0x177)]()-_0xd0e516['getTime']())/(0x18*0x3c*0x3c*0x3e8));if(_0x50a193===0x1)return _0x29a6ec(0x16f);else return _0x50a193>0x1&&_0x50a193<0x7?_0x50a193+'\x20days\x20ago':_0xe0a8c2[_0x29a6ec(0x13b)](_0x29a6ec(0x164),{'month':'short','day':_0x29a6ec(0x13d)});}export class ClaudeUsageCommand extends BaseCommand{['name']='usage';[a17_0x482877(0x152)]=a17_0x482877(0x153);async[a17_0x482877(0x13e)](_0x36f3ea){const _0x48b4c8=a17_0x482877,{options:_0x2c89a2}=_0x36f3ea,_0x3b91c0=_0x2c89a2[_0x48b4c8(0x13c)]===_0x48b4c8(0x16b)||_0x2c89a2[_0x48b4c8(0x13c)]===_0x48b4c8(0x156)||_0x2c89a2[_0x48b4c8(0x16b)];try{const [_0x50ac9f,_0x58b757]=await Promise[_0x48b4c8(0x141)]([getAllProfileStats(),getUsageSummary()]);return _0x3b91c0?await this[_0x48b4c8(0x150)](_0x50ac9f,_0x58b757,_0x2c89a2):this[_0x48b4c8(0x142)](_0x50ac9f,_0x58b757),0x0;}catch(_0x277874){const _0x3563aa=_0x277874 instanceof Error?_0x277874[_0x48b4c8(0x157)]:_0x48b4c8(0x163);return console[_0x48b4c8(0x14c)](a17_0x401deb[_0x48b4c8(0x166)](_0x48b4c8(0x169)+_0x3563aa)),0x1;}}async[a17_0x482877(0x150)](_0x31d859,_0x25d942,_0x1d057c){const _0x1a6270=a17_0x482877,_0x54dc00={'summary':{'todayCredits':_0x25d942[_0x1a6270(0x15b)],'monthCredits':_0x25d942[_0x1a6270(0x13a)],'totalCredits':_0x25d942[_0x1a6270(0x15a)],'profileCount':_0x25d942['profileCount']},'profiles':_0x31d859['map'](_0x5e0908=>({'profile':_0x5e0908[_0x1a6270(0x149)],'credits':_0x5e0908['credits'],'requests':_0x5e0908[_0x1a6270(0x159)],'lastUsedAt':_0x5e0908[_0x1a6270(0x15e)]}))};await handleSDKOutput([_0x54dc00],_0x1d057c);}[a17_0x482877(0x142)](_0x1e4dcc,_0x24013b){const _0x3b772e=a17_0x482877;console[_0x3b772e(0x16c)](a17_0x401deb[_0x3b772e(0x14f)](_0x3b772e(0x175))),console['log'](a17_0x401deb[_0x3b772e(0x15c)]('─'[_0x3b772e(0x14d)](0x32))),console[_0x3b772e(0x16c)](_0x3b772e(0x14b)+a17_0x401deb[_0x3b772e(0x16d)](formatCredits(_0x24013b[_0x3b772e(0x15b)]))+_0x3b772e(0x167)),console['log'](_0x3b772e(0x176)+a17_0x401deb[_0x3b772e(0x16d)](formatCredits(_0x24013b[_0x3b772e(0x13a)]))+_0x3b772e(0x167)),console[_0x3b772e(0x16c)](_0x3b772e(0x171)+a17_0x401deb['cyan'](formatCredits(_0x24013b[_0x3b772e(0x15a)]))+_0x3b772e(0x167)),console[_0x3b772e(0x16c)]();if(_0x1e4dcc['length']===0x0){console[_0x3b772e(0x16c)](a17_0x401deb['dim'](_0x3b772e(0x160))),console[_0x3b772e(0x16c)](a17_0x401deb[_0x3b772e(0x15c)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x3b772e(0x16c)](a17_0x401deb['bold'](_0x3b772e(0x173))),console[_0x3b772e(0x16c)](a17_0x401deb[_0x3b772e(0x15c)]('─'['repeat'](0x3c)));const _0x35af43=Math[_0x3b772e(0x14e)](0xc,..._0x1e4dcc['map'](_0x1bfd8f=>_0x1bfd8f[_0x3b772e(0x149)]===_0x3b772e(0x151)?_0x3b772e(0x148)[_0x3b772e(0x170)]:_0x1bfd8f[_0x3b772e(0x149)]['length'])),_0x1f51c8=0xa,_0x58eca8=0xa;console[_0x3b772e(0x16c)]('\x20\x20'+'Profile'[_0x3b772e(0x15f)](_0x35af43)+'\x20\x20'+_0x3b772e(0x165)[_0x3b772e(0x146)](_0x1f51c8)+'\x20\x20'+'Requests'['padStart'](_0x58eca8)+'\x20\x20'+_0x3b772e(0x154));for(const _0x26b051 of _0x1e4dcc){const _0x1b6fc6=_0x26b051[_0x3b772e(0x149)]===_0x3b772e(0x151)?_0x3b772e(0x148):_0x26b051['profile'],_0x436e5f=_0x1b6fc6[_0x3b772e(0x15f)](_0x35af43),_0x1e47c4=_0x26b051[_0x3b772e(0x149)]===_0x3b772e(0x151)?a17_0x401deb[_0x3b772e(0x15c)](_0x436e5f):_0x436e5f;console[_0x3b772e(0x16c)]('\x20\x20'+_0x1e47c4+'\x20\x20'+a17_0x401deb[_0x3b772e(0x16d)](formatCredits(_0x26b051[_0x3b772e(0x143)])[_0x3b772e(0x146)](_0x1f51c8))+'\x20\x20'+String(_0x26b051['entryCount'])[_0x3b772e(0x146)](_0x58eca8)+'\x20\x20'+a17_0x401deb[_0x3b772e(0x15c)](formatLastUsed(_0x26b051[_0x3b772e(0x15e)])));}console['log'](),console[_0x3b772e(0x16c)](a17_0x401deb[_0x3b772e(0x15c)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console['log']();}}
|
package/dist/commands/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a18_0x242f5a=a18_0x3620;(function(_0xe3649a,_0x573188){const _0x442467=a18_0x3620,_0x54a73a=_0xe3649a();while(!![]){try{const _0x18f759=parseInt(_0x442467(0x13c))/0x1+-parseInt(_0x442467(0x12e))/0x2+-parseInt(_0x442467(0x118))/0x3+parseInt(_0x442467(0x138))/0x4+-parseInt(_0x442467(0x11f))/0x5+parseInt(_0x442467(0x141))/0x6+parseInt(_0x442467(0x139))/0x7;if(_0x18f759===_0x573188)break;else _0x54a73a['push'](_0x54a73a['shift']());}catch(_0x326d89){_0x54a73a['push'](_0x54a73a['shift']());}}}(a18_0x3689,0x6f229));import{validateLimitOption}from'../utils/option-validation.js';function a18_0x3620(_0x16c3e4,_0x565eb7){const _0x36897d=a18_0x3689();return a18_0x3620=function(_0x362072,_0x2fe30b){_0x362072=_0x362072-0x114;let _0x94ef3a=_0x36897d[_0x362072];return _0x94ef3a;},a18_0x3620(_0x16c3e4,_0x565eb7);}import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a18_0x2d21f8 from'chalk';export function printAuthError(_0x3f596d,_0x13b99c=![],_0x354612){const _0x28aa47=a18_0x3620,_0x559f9b=_0x3f596d[_0x28aa47(0x12f)]?.[_0x28aa47(0x129)]||_0x3f596d[_0x28aa47(0x117)];console[_0x28aa47(0x135)](a18_0x2d21f8['red'](_0x28aa47(0x137))),console[_0x28aa47(0x135)](a18_0x2d21f8['red'](_0x28aa47(0x11b)+_0x559f9b));if(_0x13b99c){const _0x48248e=_0x354612?_0x28aa47(0x114)+_0x354612:'';console[_0x28aa47(0x135)](_0x28aa47(0x13d)),console[_0x28aa47(0x135)](_0x28aa47(0x124)+_0x48248e+'\x0a'),console['error']('To\x20check\x20your\x20current\x20auth\x20status:'),console[_0x28aa47(0x135)](_0x28aa47(0x130)+_0x48248e);}}export class BaseCommand{[a18_0x242f5a(0x13e)](_0x52e533){const _0x1e0cbe=a18_0x242f5a,{options:_0x5ae876}=_0x52e533,_0x28d174=_0x5ae876['limit'];if(_0x28d174!==undefined){const _0x1258f2=typeof _0x28d174===_0x1e0cbe(0x136)?_0x28d174:parseInt(_0x28d174,0xa);if(isNaN(_0x1258f2))return _0x1e0cbe(0x12b)+_0x28d174+_0x1e0cbe(0x128);const _0x4c88e3=validateLimitOption(_0x1258f2);if(!_0x4c88e3[_0x1e0cbe(0x115)])return _0x4c88e3['error'];_0x52e533['options'][_0x1e0cbe(0x11a)]=_0x4c88e3[_0x1e0cbe(0x13b)];}return undefined;}[a18_0x242f5a(0x120)](_0x30c950){return undefined;}async['run'](_0x381f7f){const _0x3ced36=a18_0x242f5a;try{const _0x2db825=this[_0x3ced36(0x13e)](_0x381f7f);if(_0x2db825)return console[_0x3ced36(0x135)](_0x3ced36(0x12c)+_0x2db825),0x1;const _0x24cc77=this[_0x3ced36(0x120)](_0x381f7f);if(_0x24cc77){const _0x1df03a=/^\s*(Usage|Note|Warning|Error):/i[_0x3ced36(0x133)](_0x24cc77);return _0x1df03a?console[_0x3ced36(0x135)](_0x24cc77):console[_0x3ced36(0x135)](_0x3ced36(0x12c)+_0x24cc77),0x1;}const _0x3bc524=await this['execute'](_0x381f7f);return _0x3bc524??0x0;}catch(_0x3f30c5){if(_0x3f30c5 instanceof Error){if(_0x3f30c5 instanceof HTTPClientError&&_0x3f30c5[_0x3ced36(0x11e)]===0x191){const _0x4e60de=_0x381f7f[_0x3ced36(0x121)][_0x3ced36(0x12a)];return printAuthError(_0x3f30c5,!![],_0x4e60de),_0x3f30c5[_0x3ced36(0x119)]&&_0x381f7f[_0x3ced36(0x11d)]&&(_0x381f7f[_0x3ced36(0x11d)][_0x3ced36(0x13f)][_0x3ced36(0x134)](_0x3ced36(0x125)),_0x381f7f[_0x3ced36(0x11d)][_0x3ced36(0x13f)][_0x3ced36(0x134)](_0x3f30c5[_0x3ced36(0x119)])),0x1;}console[_0x3ced36(0x135)](a18_0x2d21f8[_0x3ced36(0x11c)]('Error:\x20'+_0x3f30c5[_0x3ced36(0x117)]));_0x3f30c5 instanceof SDKError&&_0x3f30c5['helpText']&&console['error'](a18_0x2d21f8[_0x3ced36(0x13a)](_0x3f30c5[_0x3ced36(0x140)]));const _0x3a9b3f=_0x3f30c5 instanceof SDKError&&_0x3f30c5[_0x3ced36(0x122)]===ErrorCategory['USER_ERROR'];_0x3f30c5[_0x3ced36(0x119)]&&!_0x3a9b3f&&console['error'](_0x3ced36(0x116)+_0x3f30c5['stack']);}else console[_0x3ced36(0x135)](_0x3ced36(0x12c)+String(_0x3f30c5));return 0x1;}}}export class CommandRegistry{['commands']=new Map();['register'](_0x4af3c7){const _0xa6cbb6=a18_0x242f5a;if(this[_0xa6cbb6(0x127)][_0xa6cbb6(0x131)](_0x4af3c7[_0xa6cbb6(0x126)]))throw new Error('Command\x20\x27'+_0x4af3c7[_0xa6cbb6(0x126)]+'\x27\x20is\x20already\x20registered');this['commands']['set'](_0x4af3c7['name'],_0x4af3c7);}[a18_0x242f5a(0x123)](_0x5e242f){const _0x3df753=a18_0x242f5a;return this['commands'][_0x3df753(0x123)](_0x5e242f);}[a18_0x242f5a(0x132)](){const _0x41bc4f=a18_0x242f5a;return Array[_0x41bc4f(0x12d)](this[_0x41bc4f(0x127)]['values']());}[a18_0x242f5a(0x131)](_0x3f87e9){const _0x36d7f=a18_0x242f5a;return this[_0x36d7f(0x127)][_0x36d7f(0x131)](_0x3f87e9);}}function a18_0x3689(){const _0x3fee0f=['options','category','get','\x20\x20tdx\x20auth\x20setup','Authentication\x20error\x20stack\x20trace:','name','commands','.\x20Must\x20be\x20a\x20number.','detail','profile','Invalid\x20limit\x20value:\x20','Error:\x20','from','1376138nGnfAH','problemDetails','\x20\x20tdx\x20auth','has','getAll','test','debug','error','number','Authentication\x20failed','1700032MvoCxs','6575765NBjkVJ','yellow','value','120825zNNDqr','\x0aTo\x20set\x20up\x20authentication:','validateGlobalOptions','logger','helpText','2571780JFfQoG','\x20--profile\x20','isValid','\x0aStack\x20trace:\x0a','message','60561XJzevN','stack','limit','Reason:\x20','red','tdx','status','3751965dvHMTH','validate'];a18_0x3689=function(){return _0x3fee0f;};return a18_0x3689();}export const registry=new CommandRegistry();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a19_0x5363(){const _0x46a4fe=['26817DqfWiv','483185XjoVBy','Error:\x20','245223EPMWiB','242hiTrrT','390196FsUXJf','Session\x20context\x20cleared\x20(session:\x20','session','name','354JUiZqo','64jkOHzT','yellow','141730UnFgQV','displayWithSources','warn','debug','4NFqmAh','message','402856MNBLbH','toString','2305503XSnpCl','execute','display','\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','error','Show\x20current\x20resolved\x20context','\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a'];a19_0x5363=function(){return _0x46a4fe;};return a19_0x5363();}const a19_0x4bd0c4=a19_0x2456;(function(_0xcb7a7a,_0x87237f){const _0xcde468=a19_0x2456,_0x5cf9b5=_0xcb7a7a();while(!![]){try{const _0x1ca0c3=-parseInt(_0xcde468(0x113))/0x1+-parseInt(_0xcde468(0x121))/0x2+parseInt(_0xcde468(0x115))/0x3*(parseInt(_0xcde468(0x111))/0x4)+parseInt(_0xcde468(0x11d))/0x5+parseInt(_0xcde468(0x125))/0x6*(parseInt(_0xcde468(0x11c))/0x7)+-parseInt(_0xcde468(0x126))/0x8*(-parseInt(_0xcde468(0x11f))/0x9)+-parseInt(_0xcde468(0x128))/0xa*(parseInt(_0xcde468(0x120))/0xb);if(_0x1ca0c3===_0x87237f)break;else _0x5cf9b5['push'](_0x5cf9b5['shift']());}catch(_0x217994){_0x5cf9b5['push'](_0x5cf9b5['shift']());}}}(a19_0x5363,0x61817));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';function a19_0x2456(_0x40bfc0,_0x572b16){const _0x53634a=a19_0x5363();return a19_0x2456=function(_0x245672,_0x495d38){_0x245672=_0x245672-0x10e;let _0x22d059=_0x53634a[_0x245672];return _0x22d059;},a19_0x2456(_0x40bfc0,_0x572b16);}import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a19_0x474075 from'chalk';export class ContextCommand extends BaseCommand{[a19_0x4bd0c4(0x124)]='context';['description']=a19_0x4bd0c4(0x11a);async[a19_0x4bd0c4(0x116)](_0x1584d){const _0x44fd66=a19_0x4bd0c4,{options:_0x1fb0f0}=_0x1584d,_0x120b61=_0x1fb0f0[_0x44fd66(0x110)],_0x1f8086=_0x1fb0f0['clear'];console['warn'](a19_0x474075['yellow']('Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.')),console[_0x44fd66(0x10f)](a19_0x474075[_0x44fd66(0x127)](_0x44fd66(0x118))),console[_0x44fd66(0x10f)](a19_0x474075[_0x44fd66(0x127)](_0x44fd66(0x11b))),cleanExpiredSessions();try{if(_0x1f8086){clearSessionContext(_0x1fb0f0[_0x44fd66(0x123)]);const _0x5b030a=_0x1fb0f0[_0x44fd66(0x123)]||getCurrentSessionPID()[_0x44fd66(0x114)]();return console['log'](_0x44fd66(0x122)+_0x5b030a+')'),0x0;}const _0x4d8602=new GlobalContext(_0x1fb0f0);return _0x120b61?_0x4d8602[_0x44fd66(0x10e)]():_0x4d8602[_0x44fd66(0x117)](),0x0;}catch(_0x51dbb0){return _0x51dbb0 instanceof Error&&console[_0x44fd66(0x119)](_0x44fd66(0x11e)+_0x51dbb0[_0x44fd66(0x112)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x202962=a20_0x25b6;(function(_0xde56f3,_0x38ce3a){const _0xc1cd7c=a20_0x25b6,_0x3bf4e6=_0xde56f3();while(!![]){try{const _0x394662=parseInt(_0xc1cd7c(0x193))/0x1*(parseInt(_0xc1cd7c(0x188))/0x2)+-parseInt(_0xc1cd7c(0x19b))/0x3+parseInt(_0xc1cd7c(0x195))/0x4+parseInt(_0xc1cd7c(0x18f))/0x5*(-parseInt(_0xc1cd7c(0x194))/0x6)+parseInt(_0xc1cd7c(0x18b))/0x7*(parseInt(_0xc1cd7c(0x19e))/0x8)+-parseInt(_0xc1cd7c(0x199))/0x9+-parseInt(_0xc1cd7c(0x19a))/0xa*(-parseInt(_0xc1cd7c(0x18a))/0xb);if(_0x394662===_0x38ce3a)break;else _0x3bf4e6['push'](_0x3bf4e6['shift']());}catch(_0x35e333){_0x3bf4e6['push'](_0x3bf4e6['shift']());}}}(a20_0x3c6b,0xdab56));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a20_0x25b6(_0x3066ac,_0x42e7c2){const _0x3c6b6e=a20_0x3c6b();return a20_0x25b6=function(_0x25b6dd,_0xd937c4){_0x25b6dd=_0x25b6dd-0x186;let _0x5b7156=_0x3c6b6e[_0x25b6dd];return _0x5b7156;},a20_0x25b6(_0x3066ac,_0x42e7c2);}function a20_0x3c6b(){const _0xe7fa5c=['verbose','20792UfeeTk','limit','\x20database','✔\x20Found\x20','error','Listing\x20databases...','372614DpnOSj','execute','37299064xHRXrE','63ZBLTYF','length','Error:\x20','Site:\x20','222890KWOtTu','listDatabases','description','databases','3Pufptt','126poEiQX','798452ooIqEG','cause','message','query','14029101hCrZEI','10crifSe','2345976HgieZA','name'];a20_0x3c6b=function(){return _0xe7fa5c;};return a20_0x3c6b();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a20_0x202962(0x19c)]=a20_0x202962(0x192);[a20_0x202962(0x191)]='List\x20all\x20databases';async[a20_0x202962(0x189)](_0x4421c3){const _0x44c9e1=a20_0x202962,{options:_0x245f8e,args:_0x422ff6,tdx:_0x552872}=_0x4421c3,_0x16406a=_0x422ff6[0x0];try{_0x245f8e['verbose']&&(console['error'](_0x44c9e1(0x18e)+_0x245f8e['site']),_0x16406a&&console['error']('Pattern:\x20'+_0x16406a));const _0x4afe88=resolveLimit(_0x245f8e[_0x44c9e1(0x19f)],DEFAULT_LISTING_LIMIT),_0x5c23b6=await withSpinner(_0x44c9e1(0x187),()=>_0x552872[_0x44c9e1(0x198)][_0x44c9e1(0x190)](_0x16406a,_0x4afe88),{'verbose':_0x245f8e[_0x44c9e1(0x19d)]}),_0x28bcac=_0x5c23b6['data'];return console['error'](_0x44c9e1(0x1a1)+_0x28bcac[_0x44c9e1(0x18c)]+_0x44c9e1(0x1a0)+(_0x28bcac[_0x44c9e1(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0x28bcac,{..._0x245f8e,'limit':_0x4afe88}),0x0;}catch(_0x157b2a){if(_0x157b2a instanceof SDKError)return console['error'](_0x44c9e1(0x18d)+_0x157b2a[_0x44c9e1(0x197)]),_0x157b2a[_0x44c9e1(0x196)]&&console[_0x44c9e1(0x186)]('\x20\x20Cause:\x20'+_0x157b2a[_0x44c9e1(0x196)]),0x1;throw _0x157b2a;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x43eafd=a21_0x3d4c;function a21_0x1953(){const _0x5d52af=['database','1181335CRjBJG','validate','Describe\x20table\x20schema','577533bShMIS','Table\x20\x27','...','description','name','error','\x20\x20Cause:\x20','Database:\x20','table','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','3604951yEoMMC','✔\x20Found\x20','✖\x20Table\x20not\x20found','\x20in\x20','Error:\x20','message','describe','8nNBTuJ','9106245bvquBj','cause','query','length','verbose','describeTable','args','1059625lJQxfH','6aNlwAJ','2219106hZKBns','790thZZCC','Table:\x20','4jdmUlw','site','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','2796126NRWGUX'];a21_0x1953=function(){return _0x5d52af;};return a21_0x1953();}function a21_0x3d4c(_0x4c583f,_0xcac896){const _0x195365=a21_0x1953();return a21_0x3d4c=function(_0x3d4c13,_0x2b6e16){_0x3d4c13=_0x3d4c13-0x10e;let _0x4c281a=_0x195365[_0x3d4c13];return _0x4c281a;},a21_0x3d4c(_0x4c583f,_0xcac896);}(function(_0x3bd2a6,_0x13a9a7){const _0x39ae36=a21_0x3d4c,_0xcf7c57=_0x3bd2a6();while(!![]){try{const _0x119e34=parseInt(_0x39ae36(0x11d))/0x1+parseInt(_0x39ae36(0x125))/0x2+parseInt(_0x39ae36(0x11f))/0x3*(parseInt(_0x39ae36(0x122))/0x4)+parseInt(_0x39ae36(0x127))/0x5+parseInt(_0x39ae36(0x11e))/0x6*(parseInt(_0x39ae36(0x10e))/0x7)+-parseInt(_0x39ae36(0x115))/0x8*(-parseInt(_0x39ae36(0x116))/0x9)+parseInt(_0x39ae36(0x120))/0xa*(-parseInt(_0x39ae36(0x12a))/0xb);if(_0x119e34===_0x13a9a7)break;else _0xcf7c57['push'](_0xcf7c57['shift']());}catch(_0xff575e){_0xcf7c57['push'](_0xcf7c57['shift']());}}}(a21_0x1953,0xc66ae));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a21_0x43eafd(0x12e)]=a21_0x43eafd(0x114);[a21_0x43eafd(0x12d)]=a21_0x43eafd(0x129);async['execute'](_0x2276ef){const _0x46633e=a21_0x43eafd;return this[_0x46633e(0x11b)](_0x2276ef);}async[a21_0x43eafd(0x11b)](_0xf39b2){const _0x5628e4=a21_0x43eafd,{options:_0x10d98a,args:_0x275458,tdx:_0x5c478d}=_0xf39b2;let _0x39129d;try{_0x39129d=parseTableReference(_0x275458[0x0]);const _0x4de138=_0x10d98a[_0x5628e4(0x126)];!_0x39129d[_0x5628e4(0x126)]&&_0x4de138&&(_0x39129d[_0x5628e4(0x126)]=_0x4de138);const _0x1cc81f=validateTableDescribeReference(_0x39129d);if(_0x1cc81f)return console[_0x5628e4(0x12f)](_0x5628e4(0x112)+_0x1cc81f),0x1;}catch(_0xfdc9c){return console[_0x5628e4(0x12f)](_0x5628e4(0x112)+_0xfdc9c[_0x5628e4(0x113)]),0x1;}const _0x539f01=_0x39129d['database'],_0x31ce20=_0x39129d[_0x5628e4(0x132)];try{_0x10d98a[_0x5628e4(0x11a)]&&(console[_0x5628e4(0x12f)]('Site:\x20'+_0x10d98a[_0x5628e4(0x123)]),console[_0x5628e4(0x12f)](_0x5628e4(0x131)+_0x539f01),console['error'](_0x5628e4(0x121)+_0x31ce20));const _0x2ef168=await withSpinner('Describing\x20table\x20'+_0x539f01+'.'+_0x31ce20+_0x5628e4(0x12c),()=>_0x5c478d[_0x5628e4(0x118)]['describeTable'](_0x539f01,_0x31ce20),{'verbose':_0x10d98a[_0x5628e4(0x11a)]}),_0x3914cf=_0x2ef168['data'];if(_0x3914cf['length']===0x0)return console['error'](_0x5628e4(0x110)),console['error'](_0x5628e4(0x12b)+_0x539f01+'.'+_0x31ce20+'\x27\x20does\x20not\x20exist'),0x1;return console[_0x5628e4(0x12f)](_0x5628e4(0x10f)+_0x3914cf[_0x5628e4(0x119)]+'\x20column'+(_0x3914cf['length']!==0x1?'s':'')+_0x5628e4(0x111)+_0x539f01+'.'+_0x31ce20),await handleSDKOutput(_0x3914cf,_0x10d98a),0x0;}catch(_0x38e1e5){if(_0x38e1e5 instanceof SDKError)return console[_0x5628e4(0x12f)](_0x5628e4(0x112)+_0x38e1e5['message']),_0x38e1e5[_0x5628e4(0x117)]&&console[_0x5628e4(0x12f)](_0x5628e4(0x130)+_0x38e1e5[_0x5628e4(0x117)]),0x1;throw _0x38e1e5;}}[a21_0x43eafd(0x128)](_0x1b3500){const _0x61914c=a21_0x43eafd;if(_0x1b3500[_0x61914c(0x11c)][_0x61914c(0x119)]===0x0)return _0x61914c(0x124);if(_0x1b3500[_0x61914c(0x11c)][_0x61914c(0x119)]>0x1)return _0x61914c(0x133);return undefined;}}
|