@treasuredata/tdx 0.1.9 → 0.1.11
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/README.md +68 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-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/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +21 -0
- package/dist/commands/claude-command.d.ts.map +1 -0
- package/dist/commands/claude-command.js +1 -0
- package/dist/commands/claude-command.js.map +1 -0
- 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/llm-command.js +1 -1
- package/dist/commands/llm-proxy.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/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/global-context.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/server.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/table.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/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.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/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.d.ts +18 -0
- package/dist/utils/port.d.ts.map +1 -0
- package/dist/utils/port.js +1 -0
- package/dist/utils/port.js.map +1 -0
- package/dist/utils/process.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/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x98b91e=a15_0x2a7b;(function(_0x49cdea,_0x411086){const _0x5b65a9=a15_0x2a7b,_0x507666=_0x49cdea();while(!![]){try{const _0x48e7ff=parseInt(_0x5b65a9(0xd9))/0x1+-parseInt(_0x5b65a9(0xc7))/0x2*(-parseInt(_0x5b65a9(0xd6))/0x3)+parseInt(_0x5b65a9(0xc6))/0x4+-parseInt(_0x5b65a9(0xc2))/0x5*(parseInt(_0x5b65a9(0xba))/0x6)+-parseInt(_0x5b65a9(0xb9))/0x7*(parseInt(_0x5b65a9(0xbd))/0x8)+-parseInt(_0x5b65a9(0xc8))/0x9+-parseInt(_0x5b65a9(0xcb))/0xa*(-parseInt(_0x5b65a9(0xd3))/0xb);if(_0x48e7ff===_0x411086)break;else _0x507666['push'](_0x507666['shift']());}catch(_0x3cbc51){_0x507666['push'](_0x507666['shift']());}}}(a15_0x4404,0x87784));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a15_0x2a7b(_0x2e7dd5,_0x37034e){const _0x4404bb=a15_0x4404();return a15_0x2a7b=function(_0x2a7bc5,_0x326024){_0x2a7bc5=_0x2a7bc5-0xb8;let _0x3b9f35=_0x4404bb[_0x2a7bc5];return _0x3b9f35;},a15_0x2a7b(_0x2e7dd5,_0x37034e);}import{handleSDKOutput}from'../utils/command-output.js';function a15_0x4404(){const _0x477200=['✔\x20Found\x20','11VkmkWY','message','Error:\x20','3BFvSPf','\x20in\x20','database','778994IHwVwD','Database:\x20','name','\x27\x20does\x20not\x20exist','args','data','description','\x20\x20Cause:\x20','Site:\x20','1159907PhWXJe','900uFnFvK','length','Table:\x20','24PYSwON','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','Describing\x20table\x20','site','\x20column','20975RjLmuM','validate','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','error','1125336gPOotb','515044OhxXsy','6937794SMbmLs','describe','verbose','11342530cRiHFu','table','Describe\x20table\x20schema','✖\x20Table\x20not\x20found','describeTable','Table\x20\x27','execute'];a15_0x4404=function(){return _0x477200;};return a15_0x4404();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a15_0x98b91e(0xdb)]=a15_0x98b91e(0xc9);[a15_0x98b91e(0xdf)]=a15_0x98b91e(0xcd);async[a15_0x98b91e(0xd1)](_0x332bd5){const _0x2360e2=a15_0x98b91e;return this[_0x2360e2(0xcf)](_0x332bd5);}async['describeTable'](_0x486f6e){const _0x11405c=a15_0x98b91e,{options:_0x303d95,args:_0x1365c4,tdx:_0x1c897b}=_0x486f6e;let _0x1781cc;try{_0x1781cc=parseTableReference(_0x1365c4[0x0]);const _0x14e775=_0x303d95['database'];!_0x1781cc[_0x11405c(0xd8)]&&_0x14e775&&(_0x1781cc[_0x11405c(0xd8)]=_0x14e775);const _0x21583c=validateTableDescribeReference(_0x1781cc);if(_0x21583c)return console['error']('Error:\x20'+_0x21583c),0x1;}catch(_0x49ebbd){return console[_0x11405c(0xc5)](_0x11405c(0xd5)+_0x49ebbd[_0x11405c(0xd4)]),0x1;}const _0x50b780=_0x1781cc[_0x11405c(0xd8)],_0x1859e3=_0x1781cc[_0x11405c(0xcc)];try{_0x303d95['verbose']&&(console[_0x11405c(0xc5)](_0x11405c(0xb8)+_0x303d95[_0x11405c(0xc0)]),console[_0x11405c(0xc5)](_0x11405c(0xda)+_0x50b780),console[_0x11405c(0xc5)](_0x11405c(0xbc)+_0x1859e3));const _0x15efb4=await withSpinner(_0x11405c(0xbf)+_0x50b780+'.'+_0x1859e3+'...',()=>_0x1c897b[_0x11405c(0xcc)][_0x11405c(0xc9)](_0x50b780,_0x1859e3),{'verbose':_0x303d95[_0x11405c(0xca)]}),_0x5caefa=_0x15efb4[_0x11405c(0xde)];if(_0x5caefa[_0x11405c(0xbb)]===0x0)return console['error'](_0x11405c(0xce)),console[_0x11405c(0xc5)](_0x11405c(0xd0)+_0x50b780+'.'+_0x1859e3+_0x11405c(0xdc)),0x1;return console[_0x11405c(0xc5)](_0x11405c(0xd2)+_0x5caefa['length']+_0x11405c(0xc1)+(_0x5caefa[_0x11405c(0xbb)]!==0x1?'s':'')+_0x11405c(0xd7)+_0x50b780+'.'+_0x1859e3),await handleSDKOutput(_0x5caefa,_0x303d95),0x0;}catch(_0x55b88e){if(_0x55b88e instanceof SDKError)return console[_0x11405c(0xc5)]('Error:\x20'+_0x55b88e[_0x11405c(0xd4)]),_0x55b88e['cause']&&console['error'](_0x11405c(0xe0)+_0x55b88e['cause']),0x1;throw _0x55b88e;}}[a15_0x98b91e(0xc3)](_0x3216b8){const _0x5a6400=a15_0x98b91e;if(_0x3216b8[_0x5a6400(0xdd)]['length']===0x0)return _0x5a6400(0xc4);if(_0x3216b8['args']['length']>0x1)return _0x5a6400(0xbe);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a15_0x27eaf9=a15_0x39f0;(function(_0x450549,_0x3d43b2){const _0x548b74=a15_0x39f0,_0xf0000b=_0x450549();while(!![]){try{const _0x19f523=parseInt(_0x548b74(0x208))/0x1*(-parseInt(_0x548b74(0x1cf))/0x2)+parseInt(_0x548b74(0x20c))/0x3*(parseInt(_0x548b74(0x20e))/0x4)+-parseInt(_0x548b74(0x1d9))/0x5*(-parseInt(_0x548b74(0x1ed))/0x6)+-parseInt(_0x548b74(0x1fa))/0x7*(-parseInt(_0x548b74(0x1e0))/0x8)+parseInt(_0x548b74(0x1cb))/0x9+-parseInt(_0x548b74(0x216))/0xa+-parseInt(_0x548b74(0x1f9))/0xb*(-parseInt(_0x548b74(0x211))/0xc);if(_0x19f523===_0x3d43b2)break;else _0xf0000b['push'](_0xf0000b['shift']());}catch(_0x2f132a){_0xf0000b['push'](_0xf0000b['shift']());}}}(a15_0x162c,0x90bb6));import{BaseCommand}from'./command.js';function a15_0x162c(){const _0x37eda1=['3919455LvLxyX','starterMessage','createdAt','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','2iTdxue','messages','Fetching\x20chat\x20history\x20for\x20\x27','data','deleteProject','prompt','chats','Show\x20agent\x20details','Error:\x20Project\x20name\x20is\x20required','error','215qJQITN','createProject','llm:project:delete','systemPrompt','execute','stack','limit','361808lOIOWf','llm','\x27...','Getting\x20default\x20project...','verbose','projects','Agent\x20deleted:\x20','llm:agent:update','llm:agent:delete','agent','Delete\x20an\x20LLM\x20project','Fetching\x20available\x20models...','message','101310ODfSht','Project\x20created:\x20','...','Creating\x20agent\x20\x27','llm:agent:show','Fetching\x20agents...','Error:\x20Agent\x20name\x20is\x20required','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','Resolving\x20agent\x20\x27','attributes','Fetching\x20agent...','Create\x20a\x20new\x20LLM\x20project','579799VTNTiV','21BtlfPh','Error:\x20','Creating\x20project\x20\x27','llm:projects','filter','llm:agent:create','log','map','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','slice','length','\x20\x20Cause:\x20','Fetching\x20chat\x20sessions...','claude-4.5-haiku','219001oUygdj','Agent\x20updated:\x20','Set\x20current\x20project\x20context','maxToolIterations','888297koPnvW','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','4fcSarm','updateAgent','resolveAgentId','24azLSiw','deleteAgent','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','llmProject','history','8869220HnTWeX','\x0aStack\x20trace:','models','description','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','updatedAt','llm:models','name','llm:use','Update\x20an\x20existing\x20agent','llm:project:create','Updating\x20agent...','List\x20all\x20LLM\x20projects','Deleting\x20project\x20\x27','Project\x20deleted:\x20','llm:agents'];a15_0x162c=function(){return _0x37eda1;};return a15_0x162c();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a15_0x39f0(_0x56b47b,_0x4d4596){const _0x162c88=a15_0x162c();return a15_0x39f0=function(_0x39f053,_0x1a51ad){_0x39f053=_0x39f053-0x1cb;let _0x367cac=_0x162c88[_0x39f053];return _0x367cac;},a15_0x39f0(_0x56b47b,_0x4d4596);}import{matchGlobPattern}from'../utils/string-utils.js';function handleSDKError(_0x1efc99,_0x199733){const _0xe9d2d8=a15_0x39f0;if(_0x1efc99 instanceof SDKError)console['error'](_0xe9d2d8(0x1fb)+_0x1efc99[_0xe9d2d8(0x1ec)]),_0x199733['verbose']&&(_0x1efc99['cause']&&console['error'](_0xe9d2d8(0x205)+_0x1efc99['cause']),_0x1efc99[_0xe9d2d8(0x1de)]&&(console[_0xe9d2d8(0x1d8)](_0xe9d2d8(0x217)),console['error'](_0x1efc99[_0xe9d2d8(0x1de)])));else throw _0x1efc99;}async function getProjectIdOrDefault(_0x596354){const _0x5260fb=a15_0x39f0,{tdx:_0x53dc76,options:_0x277f3a}=_0x596354,_0x2b91de=_0x277f3a[_0x5260fb(0x214)];if(_0x2b91de){const _0x434d73=await withSpinner('Resolving\x20project\x20\x27'+_0x2b91de+_0x5260fb(0x1e2),()=>_0x53dc76[_0x5260fb(0x1e1)]['resolveProjectId'](_0x2b91de),{'verbose':_0x277f3a[_0x5260fb(0x1e4)]});return _0x434d73['data'];}let _0x5450e0=_0x53dc76['llm']['getCurrentProject']();if(_0x5450e0)return _0x5450e0;const _0x56219d=await withSpinner(_0x5260fb(0x1e3),()=>_0x53dc76[_0x5260fb(0x1e1)]['getOrCreateDefaultProject'](),{'verbose':_0x277f3a[_0x5260fb(0x1e4)]});return _0x56219d['data']['id'];}function toLLMProjectInfo(_0x263588){const _0x4f5c3a=a15_0x39f0;return{'name':_0x263588['attributes'][_0x4f5c3a(0x21d)],'description':_0x263588['attributes'][_0x4f5c3a(0x219)],'createdAt':_0x263588[_0x4f5c3a(0x1f6)][_0x4f5c3a(0x1cd)],'updatedAt':_0x263588[_0x4f5c3a(0x1f6)][_0x4f5c3a(0x21b)]};}function toAgentInfo(_0xdf1fd8){const _0x284c1d=a15_0x39f0;return{'name':_0xdf1fd8[_0x284c1d(0x1f6)][_0x284c1d(0x21d)],'description':_0xdf1fd8[_0x284c1d(0x1f6)][_0x284c1d(0x219)],'prompt':truncatePrompt(_0xdf1fd8['attributes']['prompt']),'createdAt':_0xdf1fd8[_0x284c1d(0x1f6)][_0x284c1d(0x1cd)],'updatedAt':_0xdf1fd8[_0x284c1d(0x1f6)][_0x284c1d(0x21b)]};}function truncatePrompt(_0x20320b){const _0x2c030b=a15_0x39f0;if(!_0x20320b)return undefined;const _0x3a107a=0x64;if(_0x20320b[_0x2c030b(0x204)]<=_0x3a107a)return _0x20320b;return _0x20320b[_0x2c030b(0x203)](0x0,_0x3a107a)+_0x2c030b(0x1ef);}export class LLMModelsCommand extends BaseCommand{[a15_0x27eaf9(0x21d)]=a15_0x27eaf9(0x21c);[a15_0x27eaf9(0x219)]='List\x20available\x20LLM\x20models';async['execute'](_0x3202fd){const _0x49f739=a15_0x27eaf9,{options:_0x29137c,tdx:_0x13075e}=_0x3202fd;try{const _0x22b707=await withSpinner(_0x49f739(0x1eb),()=>_0x13075e[_0x49f739(0x1e1)][_0x49f739(0x218)](),{'verbose':_0x29137c[_0x49f739(0x1e4)]});return await handleSDKOutput(_0x22b707[_0x49f739(0x1d2)],_0x29137c),0x0;}catch(_0x2ed57d){return handleSDKError(_0x2ed57d,_0x29137c),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a15_0x27eaf9(0x21d)]=a15_0x27eaf9(0x1fd);[a15_0x27eaf9(0x219)]=a15_0x27eaf9(0x222);async[a15_0x27eaf9(0x1dd)](_0x43b5ba){const _0x48b875=a15_0x27eaf9,{options:_0x19a790,args:_0x322b0c,tdx:_0x10f88d}=_0x43b5ba;try{const _0x8514a0=_0x322b0c[0x0],_0x3f895f=_0x19a790[_0x48b875(0x1df)]?Number(_0x19a790['limit']):0x32,_0xf80454=await withSpinner('Fetching\x20projects...',()=>_0x10f88d[_0x48b875(0x1e1)][_0x48b875(0x1e5)](_0x3f895f),{'verbose':_0x19a790['verbose']});let _0x1dd4a1=_0xf80454[_0x48b875(0x1d2)];_0x8514a0&&(_0x1dd4a1=_0xf80454[_0x48b875(0x1d2)][_0x48b875(0x1fe)](_0x2060d7=>matchGlobPattern(_0x2060d7[_0x48b875(0x1f6)][_0x48b875(0x21d)],_0x8514a0)));const _0x4d3b10=_0x1dd4a1[_0x48b875(0x201)](toLLMProjectInfo);return await handleSDKOutput(_0x4d3b10,_0x19a790),0x0;}catch(_0x8d28b0){return handleSDKError(_0x8d28b0,_0x19a790),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a15_0x27eaf9(0x21d)]=a15_0x27eaf9(0x225);[a15_0x27eaf9(0x219)]='List\x20agents\x20in\x20current\x20project';async[a15_0x27eaf9(0x1dd)](_0x1e0d64){const _0x38273c=a15_0x27eaf9,{options:_0x3a8571,args:_0x2ad656,tdx:_0x562663}=_0x1e0d64;try{const _0x38e424=_0x2ad656[0x0],_0x6c3725=await getProjectIdOrDefault(_0x1e0d64),_0x583e3e=await withSpinner(_0x38273c(0x1f2),()=>_0x562663[_0x38273c(0x1e1)]['agents'](_0x6c3725),{'verbose':_0x3a8571['verbose']});let _0x4340cb=_0x583e3e[_0x38273c(0x1d2)];_0x38e424&&(_0x4340cb=_0x583e3e['data'][_0x38273c(0x1fe)](_0xf1ed7e=>matchGlobPattern(_0xf1ed7e[_0x38273c(0x1f6)][_0x38273c(0x21d)],_0x38e424)));const _0x1cb47e=_0x4340cb[_0x38273c(0x201)](toAgentInfo);return await handleSDKOutput(_0x1cb47e,_0x3a8571),0x0;}catch(_0x292a83){return handleSDKError(_0x292a83,_0x3a8571),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a15_0x27eaf9(0x1f1);[a15_0x27eaf9(0x219)]=a15_0x27eaf9(0x1d6);async[a15_0x27eaf9(0x1dd)](_0x41899e){const _0x5e924a=a15_0x27eaf9,{options:_0xcec74,args:_0x1f6b96,tdx:_0x4c055d}=_0x41899e;if(_0x1f6b96[_0x5e924a(0x204)]===0x0)return console['error'](_0x5e924a(0x1f3)),console[_0x5e924a(0x1d8)](_0x5e924a(0x202)),0x1;const _0x63045d=_0x1f6b96[0x0];try{const _0xb621e6=await getProjectIdOrDefault(_0x41899e),_0x5ae3ca=await withSpinner(_0x5e924a(0x1f5)+_0x63045d+_0x5e924a(0x1e2),()=>_0x4c055d[_0x5e924a(0x1e1)][_0x5e924a(0x210)](_0x63045d,_0xb621e6),{'verbose':_0xcec74[_0x5e924a(0x1e4)]}),_0x11a549=await withSpinner(_0x5e924a(0x1f7),()=>_0x4c055d[_0x5e924a(0x1e1)][_0x5e924a(0x1e9)](_0x5ae3ca['data']),{'verbose':_0xcec74[_0x5e924a(0x1e4)]});return await handleSDKOutput([_0x11a549[_0x5e924a(0x1d2)]],_0xcec74),0x0;}catch(_0x155315){return handleSDKError(_0x155315,_0xcec74),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a15_0x27eaf9(0x1ff);[a15_0x27eaf9(0x219)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a15_0x27eaf9(0x1dd)](_0x51e3a1){const _0x5a068f=a15_0x27eaf9,{options:_0x49108b,args:_0x29ff79,tdx:_0x4d22b8}=_0x51e3a1;if(_0x29ff79[_0x5a068f(0x204)]===0x0)return console[_0x5a068f(0x1d8)](_0x5a068f(0x1f3)),console[_0x5a068f(0x1d8)](_0x5a068f(0x213)),0x1;const _0x1d20f2=_0x29ff79[0x0],_0x28ee1b=_0x49108b,_0x2edbb9=_0x28ee1b[_0x5a068f(0x1dc)],_0x37c63b=_0x28ee1b['model']||_0x5a068f(0x207),_0x37e16e=_0x28ee1b[_0x5a068f(0x1cc)],_0x36adbb=_0x28ee1b[_0x5a068f(0x20b)]?Number(_0x28ee1b['maxToolIterations']):undefined,_0x48ca70=_0x28ee1b['temperature']?Number(_0x28ee1b['temperature']):undefined;try{const _0x55993c=await getProjectIdOrDefault(_0x51e3a1),_0x271f8b=await withSpinner(_0x5a068f(0x1f0)+_0x1d20f2+_0x5a068f(0x1e2),()=>_0x4d22b8[_0x5a068f(0x1e1)]['createAgent']({'name':_0x1d20f2,'projectId':_0x55993c,'modelType':_0x37c63b,'systemPrompt':_0x2edbb9,'starterMessage':_0x37e16e,'maxToolIterations':_0x36adbb,'temperature':_0x48ca70}),{'verbose':_0x49108b[_0x5a068f(0x1e4)]});return console[_0x5a068f(0x200)]('Agent\x20created:\x20'+_0x271f8b[_0x5a068f(0x1d2)]['id']),await handleSDKOutput([_0x271f8b[_0x5a068f(0x1d2)]],_0x49108b),0x0;}catch(_0x11e244){return handleSDKError(_0x11e244,_0x49108b),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a15_0x27eaf9(0x21d)]=a15_0x27eaf9(0x1e7);[a15_0x27eaf9(0x219)]=a15_0x27eaf9(0x21f);async['execute'](_0x4c19a6){const _0xe25016=a15_0x27eaf9,{options:_0x1c4666,args:_0x1d46b9,tdx:_0x25729d}=_0x4c19a6;if(_0x1d46b9[_0xe25016(0x204)]===0x0)return console[_0xe25016(0x1d8)](_0xe25016(0x1f3)),console[_0xe25016(0x1d8)](_0xe25016(0x1ce)),0x1;const _0xdd9496=_0x1d46b9[0x0],_0x163a84=_0x1c4666,_0x2c70c1=_0x163a84['name'],_0xda5404=_0x163a84[_0xe25016(0x1d4)],_0x2eadf4=_0x163a84['description'],_0x5cf711=_0x163a84[_0xe25016(0x1cc)];if(!_0x2c70c1&&!_0xda5404&&!_0x2eadf4&&!_0x5cf711)return console[_0xe25016(0x1d8)]('Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required'),console[_0xe25016(0x1d8)](_0xe25016(0x1f4)),0x1;try{const _0x34b263=await getProjectIdOrDefault(_0x4c19a6),_0x25e587=await withSpinner(_0xe25016(0x1f5)+_0xdd9496+_0xe25016(0x1e2),()=>_0x25729d['llm']['resolveAgentId'](_0xdd9496,_0x34b263),{'verbose':_0x1c4666['verbose']}),_0x1fa2df=_0x25e587[_0xe25016(0x1d2)],_0x55886f=await withSpinner(_0xe25016(0x221),()=>_0x25729d[_0xe25016(0x1e1)][_0xe25016(0x20f)](_0x1fa2df,{'name':_0x2c70c1,'prompt':_0xda5404,'description':_0x2eadf4,'starterMessage':_0x5cf711}),{'verbose':_0x1c4666[_0xe25016(0x1e4)]});return console[_0xe25016(0x200)](_0xe25016(0x209)+_0x55886f[_0xe25016(0x1d2)]['id']),await handleSDKOutput([_0x55886f[_0xe25016(0x1d2)]],_0x1c4666),0x0;}catch(_0x77240){return handleSDKError(_0x77240,_0x1c4666),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a15_0x27eaf9(0x1e8);[a15_0x27eaf9(0x219)]='Delete\x20an\x20agent';async[a15_0x27eaf9(0x1dd)](_0x55c2b6){const _0xc1c51c=a15_0x27eaf9,{options:_0x4ab8cc,args:_0x163f79,tdx:_0x5aaf14}=_0x55c2b6;if(_0x163f79[_0xc1c51c(0x204)]===0x0)return console['error'](_0xc1c51c(0x1f3)),console['error'](_0xc1c51c(0x20d)),0x1;const _0x4594c5=_0x163f79[0x0];try{const _0x172377=await getProjectIdOrDefault(_0x55c2b6),_0x31c95f=await withSpinner(_0xc1c51c(0x1f5)+_0x4594c5+_0xc1c51c(0x1e2),()=>_0x5aaf14[_0xc1c51c(0x1e1)][_0xc1c51c(0x210)](_0x4594c5,_0x172377),{'verbose':_0x4ab8cc[_0xc1c51c(0x1e4)]}),_0x3f5578=_0x31c95f[_0xc1c51c(0x1d2)];return await withSpinner('Deleting\x20agent...',()=>_0x5aaf14[_0xc1c51c(0x1e1)][_0xc1c51c(0x212)](_0x3f5578),{'verbose':_0x4ab8cc[_0xc1c51c(0x1e4)]}),console['log'](_0xc1c51c(0x1e6)+_0x3f5578),0x0;}catch(_0x3241db){return handleSDKError(_0x3241db,_0x4ab8cc),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']='llm:history';[a15_0x27eaf9(0x219)]='Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions';async['execute'](_0x99dd43){const _0x63e2fd=a15_0x27eaf9,{options:_0x5ea190,args:_0x286b26,tdx:_0x2a6239}=_0x99dd43,_0x2f4a66=_0x286b26[0x0];try{if(!_0x2f4a66){const _0x45a56c=_0x5ea190[_0x63e2fd(0x1df)]?Number(_0x5ea190[_0x63e2fd(0x1df)]):0x32,_0x379f01=await withSpinner(_0x63e2fd(0x206),()=>_0x2a6239[_0x63e2fd(0x1e1)][_0x63e2fd(0x1d5)](_0x45a56c),{'verbose':_0x5ea190[_0x63e2fd(0x1e4)]});return await handleSDKOutput(_0x379f01[_0x63e2fd(0x1d2)],_0x5ea190),0x0;}else{const _0x4b14f5=await withSpinner(_0x63e2fd(0x1d1)+_0x2f4a66+'\x27...',()=>_0x2a6239['llm'][_0x63e2fd(0x215)](_0x2f4a66),{'verbose':_0x5ea190[_0x63e2fd(0x1e4)]});return await handleSDKOutput(_0x4b14f5[_0x63e2fd(0x1d2)][_0x63e2fd(0x1d0)],_0x5ea190),0x0;}}catch(_0x4674ab){return handleSDKError(_0x4674ab,_0x5ea190),0x1;}}}export class LLMUseCommand extends BaseCommand{[a15_0x27eaf9(0x21d)]=a15_0x27eaf9(0x21e);['description']=a15_0x27eaf9(0x20a);async[a15_0x27eaf9(0x1dd)](_0x540626){const _0x8060c=a15_0x27eaf9,{options:_0x2af3c9,args:_0x2e662d,tdx:_0x19997f}=_0x540626;if(_0x2e662d[_0x8060c(0x204)]===0x0)return console[_0x8060c(0x1d8)](_0x8060c(0x1d7)),console['error']('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x29ee09=_0x2e662d[0x0];try{return await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x29ee09+_0x8060c(0x1e2),()=>_0x19997f[_0x8060c(0x1e1)]['setCurrentProject'](_0x29ee09),{'verbose':_0x2af3c9[_0x8060c(0x1e4)]}),console[_0x8060c(0x200)]('Project\x20context\x20set\x20to:\x20'+_0x29ee09),0x0;}catch(_0x534538){return handleSDKError(_0x534538,_0x2af3c9),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a15_0x27eaf9(0x21d)]=a15_0x27eaf9(0x220);[a15_0x27eaf9(0x219)]=a15_0x27eaf9(0x1f8);async[a15_0x27eaf9(0x1dd)](_0x5ad765){const _0x5468b7=a15_0x27eaf9,{options:_0x35acb6,args:_0xde5780,tdx:_0xaf163e}=_0x5ad765;if(_0xde5780[_0x5468b7(0x204)]===0x0)return console['error'](_0x5468b7(0x1d7)),console['error']('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x25b0b1=_0xde5780[0x0],_0x2d9fc7=_0x35acb6,_0x24e331=_0x2d9fc7['description'];try{const _0x56050c=await withSpinner(_0x5468b7(0x1fc)+_0x25b0b1+_0x5468b7(0x1e2),()=>_0xaf163e[_0x5468b7(0x1e1)][_0x5468b7(0x1da)]({'name':_0x25b0b1,'description':_0x24e331}),{'verbose':_0x35acb6[_0x5468b7(0x1e4)]});console[_0x5468b7(0x200)](_0x5468b7(0x1ee)+_0x56050c['data']['id']);const _0x639b5e=toLLMProjectInfo(_0x56050c[_0x5468b7(0x1d2)]);return await handleSDKOutput([_0x639b5e],_0x35acb6),0x0;}catch(_0x436af6){return handleSDKError(_0x436af6,_0x35acb6),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']=a15_0x27eaf9(0x1db);['description']=a15_0x27eaf9(0x1ea);async[a15_0x27eaf9(0x1dd)](_0x1dc2db){const _0x59ce75=a15_0x27eaf9,{options:_0x5163fe,args:_0x489055,tdx:_0x248eff}=_0x1dc2db;if(_0x489055['length']===0x0)return console[_0x59ce75(0x1d8)](_0x59ce75(0x1d7)),console[_0x59ce75(0x1d8)](_0x59ce75(0x21a)),0x1;const _0x4e7503=_0x489055[0x0];try{return await withSpinner(_0x59ce75(0x223)+_0x4e7503+_0x59ce75(0x1e2),()=>_0x248eff['llm'][_0x59ce75(0x1d3)](_0x4e7503),{'verbose':_0x5163fe['verbose']}),console[_0x59ce75(0x200)](_0x59ce75(0x224)+_0x4e7503),0x0;}catch(_0x33960e){return handleSDKError(_0x33960e,_0x5163fe),0x1;}}}
|
|
1
|
+
const a16_0x4d7218=a16_0x5b81;(function(_0x2599f8,_0x4c55de){const _0x171988=a16_0x5b81,_0x2138d7=_0x2599f8();while(!![]){try{const _0x5b622d=-parseInt(_0x171988(0x9c))/0x1+-parseInt(_0x171988(0xb1))/0x2*(parseInt(_0x171988(0x9d))/0x3)+-parseInt(_0x171988(0xa2))/0x4+parseInt(_0x171988(0xc9))/0x5*(parseInt(_0x171988(0xe0))/0x6)+-parseInt(_0x171988(0xa3))/0x7*(parseInt(_0x171988(0xa0))/0x8)+parseInt(_0x171988(0xa9))/0x9*(parseInt(_0x171988(0xb6))/0xa)+-parseInt(_0x171988(0xc3))/0xb*(-parseInt(_0x171988(0xc4))/0xc);if(_0x5b622d===_0x4c55de)break;else _0x2138d7['push'](_0x2138d7['shift']());}catch(_0x3049c9){_0x2138d7['push'](_0x2138d7['shift']());}}}(a16_0x237e,0x60a6e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';function handleSDKError(_0x48c808,_0x150890){const _0xbd48db=a16_0x5b81;if(_0x48c808 instanceof SDKError)console[_0xbd48db(0xd5)](_0xbd48db(0xb7)+_0x48c808['message']),_0x150890[_0xbd48db(0xbf)]&&(_0x48c808[_0xbd48db(0xcd)]&&console[_0xbd48db(0xd5)]('\x20\x20Cause:\x20'+_0x48c808[_0xbd48db(0xcd)]),_0x48c808[_0xbd48db(0xda)]&&(console[_0xbd48db(0xd5)](_0xbd48db(0x98)),console['error'](_0x48c808[_0xbd48db(0xda)])));else throw _0x48c808;}function a16_0x5b81(_0x4dd2b9,_0x238c2e){const _0x237e30=a16_0x237e();return a16_0x5b81=function(_0x5b81b6,_0x4671ff){_0x5b81b6=_0x5b81b6-0x97;let _0x2bff78=_0x237e30[_0x5b81b6];return _0x2bff78;},a16_0x5b81(_0x4dd2b9,_0x238c2e);}async function getProjectIdOrDefault(_0x894e){const _0x18cc29=a16_0x5b81,{tdx:_0x1ff1b8,options:_0x3f10c5}=_0x894e,_0x485dda=_0x3f10c5[_0x18cc29(0xac)];if(_0x485dda){const _0x2a04b6=await withSpinner(_0x18cc29(0xe2)+_0x485dda+_0x18cc29(0xab),()=>_0x1ff1b8[_0x18cc29(0xd7)][_0x18cc29(0xe7)](_0x485dda),{'verbose':_0x3f10c5[_0x18cc29(0xbf)]});return _0x2a04b6[_0x18cc29(0xa4)];}let _0x169ec8=_0x1ff1b8['llm'][_0x18cc29(0xde)]();if(_0x169ec8)return _0x169ec8;const _0x59804d=await withSpinner('Getting\x20default\x20project...',()=>_0x1ff1b8[_0x18cc29(0xd7)][_0x18cc29(0xca)](),{'verbose':_0x3f10c5[_0x18cc29(0xbf)]});return _0x59804d[_0x18cc29(0xa4)]['id'];}function toLLMProjectInfo(_0x7cb0b1){const _0x3a558b=a16_0x5b81;return{'name':_0x7cb0b1[_0x3a558b(0xcc)][_0x3a558b(0x9b)],'description':_0x7cb0b1[_0x3a558b(0xcc)][_0x3a558b(0xc6)],'createdAt':_0x7cb0b1[_0x3a558b(0xcc)][_0x3a558b(0xb5)],'updatedAt':_0x7cb0b1[_0x3a558b(0xcc)][_0x3a558b(0xd1)]};}function toAgentInfo(_0x26fb99){const _0x578e34=a16_0x5b81;return{'name':_0x26fb99[_0x578e34(0xcc)]['name'],'description':_0x26fb99[_0x578e34(0xcc)][_0x578e34(0xc6)],'prompt':truncatePrompt(_0x26fb99[_0x578e34(0xcc)][_0x578e34(0xae)]),'createdAt':_0x26fb99[_0x578e34(0xcc)][_0x578e34(0xb5)],'updatedAt':_0x26fb99['attributes'][_0x578e34(0xd1)]};}function truncatePrompt(_0x2b1285){const _0x3626aa=a16_0x5b81;if(!_0x2b1285)return undefined;const _0x1e4b15=0x64;if(_0x2b1285[_0x3626aa(0xe6)]<=_0x1e4b15)return _0x2b1285;return _0x2b1285[_0x3626aa(0xd9)](0x0,_0x1e4b15)+_0x3626aa(0xb4);}export class LLMModelsCommand extends BaseCommand{[a16_0x4d7218(0x9b)]='llm:models';[a16_0x4d7218(0xc6)]='List\x20available\x20LLM\x20models';async[a16_0x4d7218(0xea)](_0x3976de){const _0x1a82f8=a16_0x4d7218,{options:_0x196b15,tdx:_0x284364}=_0x3976de;try{const _0x39b52e=await withSpinner('Fetching\x20available\x20models...',()=>_0x284364[_0x1a82f8(0xd7)][_0x1a82f8(0xd6)](),{'verbose':_0x196b15['verbose']});return await handleSDKOutput(_0x39b52e[_0x1a82f8(0xa4)],_0x196b15),0x0;}catch(_0x1f5324){return handleSDKError(_0x1f5324,_0x196b15),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a16_0x4d7218(0x9b)]='llm:projects';[a16_0x4d7218(0xc6)]=a16_0x4d7218(0xb3);async[a16_0x4d7218(0xea)](_0x3ca560){const _0x23042d=a16_0x4d7218,{options:_0x1f406b,args:_0x4a4b94,tdx:_0x3de064}=_0x3ca560;try{const _0x5aaac6=_0x4a4b94[0x0],_0x29f7f0=_0x1f406b['limit']?Number(_0x1f406b[_0x23042d(0xbc)]):0x32,_0x133b42=await withSpinner('Fetching\x20projects...',()=>_0x3de064[_0x23042d(0xd7)][_0x23042d(0xad)](_0x29f7f0),{'verbose':_0x1f406b[_0x23042d(0xbf)]});let _0x800156=_0x133b42[_0x23042d(0xa4)];_0x5aaac6&&(_0x800156=_0x133b42['data'][_0x23042d(0xc1)](_0x51fe87=>matchGlobPattern(_0x51fe87[_0x23042d(0xcc)]['name'],_0x5aaac6)));const _0xb44a15=_0x800156[_0x23042d(0xe5)](toLLMProjectInfo);return await handleSDKOutput(_0xb44a15,_0x1f406b),0x0;}catch(_0x68ac0f){return handleSDKError(_0x68ac0f,_0x1f406b),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a16_0x4d7218(0x9b)]=a16_0x4d7218(0xa1);[a16_0x4d7218(0xc6)]=a16_0x4d7218(0xdd);async[a16_0x4d7218(0xea)](_0x33ca1c){const _0x430543=a16_0x4d7218,{options:_0xd88869,args:_0x3b16cb,tdx:_0x4f4b0a}=_0x33ca1c;try{const _0x409bce=_0x3b16cb[0x0],_0x45ced4=await getProjectIdOrDefault(_0x33ca1c),_0x414446=await withSpinner('Fetching\x20agents...',()=>_0x4f4b0a[_0x430543(0xd7)]['agents'](_0x45ced4),{'verbose':_0xd88869[_0x430543(0xbf)]});let _0x832ef4=_0x414446[_0x430543(0xa4)];_0x409bce&&(_0x832ef4=_0x414446['data'][_0x430543(0xc1)](_0x96b5f=>matchGlobPattern(_0x96b5f[_0x430543(0xcc)][_0x430543(0x9b)],_0x409bce)));const _0x440b34=_0x832ef4[_0x430543(0xe5)](toAgentInfo);return await handleSDKOutput(_0x440b34,_0xd88869),0x0;}catch(_0x1994d2){return handleSDKError(_0x1994d2,_0xd88869),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a16_0x4d7218(0x9b)]='llm:agent:show';['description']=a16_0x4d7218(0xaa);async[a16_0x4d7218(0xea)](_0x2f76e1){const _0x2c83ec=a16_0x4d7218,{options:_0x579ac7,args:_0x43e07b,tdx:_0x5a45d9}=_0x2f76e1;if(_0x43e07b['length']===0x0)return console[_0x2c83ec(0xd5)](_0x2c83ec(0xe9)),console[_0x2c83ec(0xd5)](_0x2c83ec(0xa8)),0x1;const _0x284da1=_0x43e07b[0x0];try{const _0x1f4af4=await getProjectIdOrDefault(_0x2f76e1),_0x4b37df=await withSpinner('Resolving\x20agent\x20\x27'+_0x284da1+_0x2c83ec(0xab),()=>_0x5a45d9[_0x2c83ec(0xd7)][_0x2c83ec(0xdf)](_0x284da1,_0x1f4af4),{'verbose':_0x579ac7['verbose']}),_0x101643=await withSpinner('Fetching\x20agent...',()=>_0x5a45d9[_0x2c83ec(0xd7)]['agent'](_0x4b37df[_0x2c83ec(0xa4)]),{'verbose':_0x579ac7[_0x2c83ec(0xbf)]});return await handleSDKOutput([_0x101643[_0x2c83ec(0xa4)]],_0x579ac7),0x0;}catch(_0x86cc2){return handleSDKError(_0x86cc2,_0x579ac7),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a16_0x4d7218(0xce);[a16_0x4d7218(0xc6)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a16_0x4d7218(0xea)](_0x4e2138){const _0x252614=a16_0x4d7218,{options:_0x5f52fa,args:_0x3f5d70,tdx:_0x53f652}=_0x4e2138;if(_0x3f5d70[_0x252614(0xe6)]===0x0)return console[_0x252614(0xd5)](_0x252614(0xe9)),console[_0x252614(0xd5)]('Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]'),0x1;const _0x4795a2=_0x3f5d70[0x0],_0x1b56ea=_0x5f52fa,_0x326468=_0x1b56ea[_0x252614(0xcb)],_0x5c54fe=_0x1b56ea['model']||_0x252614(0xa5),_0x5c730e=_0x1b56ea[_0x252614(0xc2)],_0x214a39=_0x1b56ea[_0x252614(0xe1)]?Number(_0x1b56ea['maxToolIterations']):undefined,_0x3132b7=_0x1b56ea[_0x252614(0xb9)]?Number(_0x1b56ea[_0x252614(0xb9)]):undefined;try{const _0x12fb2b=await getProjectIdOrDefault(_0x4e2138),_0x33c130=await withSpinner('Creating\x20agent\x20\x27'+_0x4795a2+'\x27...',()=>_0x53f652['llm'][_0x252614(0xb0)]({'name':_0x4795a2,'projectId':_0x12fb2b,'modelType':_0x5c54fe,'systemPrompt':_0x326468,'starterMessage':_0x5c730e,'maxToolIterations':_0x214a39,'temperature':_0x3132b7}),{'verbose':_0x5f52fa[_0x252614(0xbf)]});return console['log']('Agent\x20created:\x20'+_0x33c130[_0x252614(0xa4)]['id']),await handleSDKOutput([_0x33c130[_0x252614(0xa4)]],_0x5f52fa),0x0;}catch(_0x24cb45){return handleSDKError(_0x24cb45,_0x5f52fa),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a16_0x4d7218(0x9b)]='llm:agent:update';[a16_0x4d7218(0xc6)]=a16_0x4d7218(0xeb);async[a16_0x4d7218(0xea)](_0x4053b6){const _0x5ee532=a16_0x4d7218,{options:_0x56879b,args:_0x4f5edb,tdx:_0x3326da}=_0x4053b6;if(_0x4f5edb[_0x5ee532(0xe6)]===0x0)return console[_0x5ee532(0xd5)](_0x5ee532(0xe9)),console[_0x5ee532(0xd5)](_0x5ee532(0x97)),0x1;const _0x3f255d=_0x4f5edb[0x0],_0x57a74d=_0x56879b,_0x1192b3=_0x57a74d[_0x5ee532(0x9b)],_0x5c4138=_0x57a74d[_0x5ee532(0xae)],_0x36bf4b=_0x57a74d['description'],_0x2c8fed=_0x57a74d[_0x5ee532(0xc2)];if(!_0x1192b3&&!_0x5c4138&&!_0x36bf4b&&!_0x2c8fed)return console[_0x5ee532(0xd5)](_0x5ee532(0xc0)),console['error']('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x44b38b=await getProjectIdOrDefault(_0x4053b6),_0x3c3b6f=await withSpinner('Resolving\x20agent\x20\x27'+_0x3f255d+'\x27...',()=>_0x3326da[_0x5ee532(0xd7)]['resolveAgentId'](_0x3f255d,_0x44b38b),{'verbose':_0x56879b[_0x5ee532(0xbf)]}),_0x34ac7e=_0x3c3b6f[_0x5ee532(0xa4)],_0xfecf44=await withSpinner(_0x5ee532(0xb2),()=>_0x3326da['llm'][_0x5ee532(0xdc)](_0x34ac7e,{'name':_0x1192b3,'prompt':_0x5c4138,'description':_0x36bf4b,'starterMessage':_0x2c8fed}),{'verbose':_0x56879b[_0x5ee532(0xbf)]});return console[_0x5ee532(0x9e)]('Agent\x20updated:\x20'+_0xfecf44[_0x5ee532(0xa4)]['id']),await handleSDKOutput([_0xfecf44[_0x5ee532(0xa4)]],_0x56879b),0x0;}catch(_0x5b4e9f){return handleSDKError(_0x5b4e9f,_0x56879b),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a16_0x4d7218(0x9b)]='llm:agent:delete';[a16_0x4d7218(0xc6)]='Delete\x20an\x20agent';async['execute'](_0x41d6e3){const _0x43b9df=a16_0x4d7218,{options:_0x417102,args:_0x56e558,tdx:_0x130283}=_0x41d6e3;if(_0x56e558[_0x43b9df(0xe6)]===0x0)return console[_0x43b9df(0xd5)](_0x43b9df(0xe9)),console[_0x43b9df(0xd5)](_0x43b9df(0xb8)),0x1;const _0x265fc4=_0x56e558[0x0];try{const _0x2da1fc=await getProjectIdOrDefault(_0x41d6e3),_0x147a4e=await withSpinner(_0x43b9df(0xd8)+_0x265fc4+_0x43b9df(0xab),()=>_0x130283[_0x43b9df(0xd7)]['resolveAgentId'](_0x265fc4,_0x2da1fc),{'verbose':_0x417102[_0x43b9df(0xbf)]}),_0x332330=_0x147a4e['data'];return await withSpinner(_0x43b9df(0xbb),()=>_0x130283[_0x43b9df(0xd7)][_0x43b9df(0xc7)](_0x332330),{'verbose':_0x417102[_0x43b9df(0xbf)]}),console['log'](_0x43b9df(0xd4)+_0x332330),0x0;}catch(_0x47ab8b){return handleSDKError(_0x47ab8b,_0x417102),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a16_0x4d7218(0x9b)]=a16_0x4d7218(0xd3);['description']=a16_0x4d7218(0xc5);async[a16_0x4d7218(0xea)](_0x36a1eb){const _0x10ddb4=a16_0x4d7218,{options:_0x478f57,args:_0x5946f4,tdx:_0x474313}=_0x36a1eb,_0xc7fdc5=_0x5946f4[0x0];try{if(!_0xc7fdc5){const _0x24c40d=_0x478f57[_0x10ddb4(0xbc)]?Number(_0x478f57[_0x10ddb4(0xbc)]):0x32,_0x7077af=await withSpinner(_0x10ddb4(0xc8),()=>_0x474313['llm']['chats'](_0x24c40d),{'verbose':_0x478f57['verbose']});return await handleSDKOutput(_0x7077af[_0x10ddb4(0xa4)],_0x478f57),0x0;}else{const _0x516653=await withSpinner(_0x10ddb4(0xe4)+_0xc7fdc5+_0x10ddb4(0xab),()=>_0x474313[_0x10ddb4(0xd7)][_0x10ddb4(0x99)](_0xc7fdc5),{'verbose':_0x478f57[_0x10ddb4(0xbf)]});return await handleSDKOutput(_0x516653[_0x10ddb4(0xa4)][_0x10ddb4(0xa7)],_0x478f57),0x0;}}catch(_0xef6984){return handleSDKError(_0xef6984,_0x478f57),0x1;}}}function a16_0x237e(){const _0x3c393e=['Deleting\x20project\x20\x27','name','210654lNWQDa','3LxswFW','log','Creating\x20project\x20\x27','547864nsjbyE','llm:agents','2302468byDcBh','77kxqwIR','data','claude-4.5-haiku','Usage:\x20tdx\x20llm\x20use\x20<project-name>','messages','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','18cXWXaT','Show\x20agent\x20details','\x27...','llmProject','projects','prompt','llm:project:delete','createAgent','1488820LSuGpz','Updating\x20agent...','List\x20all\x20LLM\x20projects','...','createdAt','2128340LmJRGo','Error:\x20','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','temperature','Delete\x20an\x20LLM\x20project','Deleting\x20agent...','limit','Project\x20deleted:\x20','llm:use','verbose','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','filter','starterMessage','2145UBGkNi','125460qShouK','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','description','deleteAgent','Fetching\x20chat\x20sessions...','345fulJDa','getOrCreateDefaultProject','systemPrompt','attributes','cause','llm:agent:create','Project\x20context\x20set\x20to:\x20','Setting\x20project\x20context\x20to\x20\x27','updatedAt','createProject','llm:history','Agent\x20deleted:\x20','error','models','llm','Resolving\x20agent\x20\x27','slice','stack','llm:project:create','updateAgent','List\x20agents\x20in\x20current\x20project','getCurrentProject','resolveAgentId','18738POmZqM','maxToolIterations','Resolving\x20project\x20\x27','deleteProject','Fetching\x20chat\x20history\x20for\x20\x27','map','length','resolveProjectId','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','Error:\x20Agent\x20name\x20is\x20required','execute','Update\x20an\x20existing\x20agent','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','\x0aStack\x20trace:','history'];a16_0x237e=function(){return _0x3c393e;};return a16_0x237e();}export class LLMUseCommand extends BaseCommand{['name']=a16_0x4d7218(0xbe);[a16_0x4d7218(0xc6)]='Set\x20current\x20project\x20context';async[a16_0x4d7218(0xea)](_0x5190d){const _0x10dd24=a16_0x4d7218,{options:_0x5e36c8,args:_0x1ab67b,tdx:_0x5b5f58}=_0x5190d;if(_0x1ab67b[_0x10dd24(0xe6)]===0x0)return console[_0x10dd24(0xd5)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x10dd24(0xa6)),0x1;const _0x4367f9=_0x1ab67b[0x0];try{return await withSpinner(_0x10dd24(0xd0)+_0x4367f9+_0x10dd24(0xab),()=>_0x5b5f58['llm']['setCurrentProject'](_0x4367f9),{'verbose':_0x5e36c8[_0x10dd24(0xbf)]}),console[_0x10dd24(0x9e)](_0x10dd24(0xcf)+_0x4367f9),0x0;}catch(_0x57bd49){return handleSDKError(_0x57bd49,_0x5e36c8),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a16_0x4d7218(0x9b)]=a16_0x4d7218(0xdb);[a16_0x4d7218(0xc6)]='Create\x20a\x20new\x20LLM\x20project';async[a16_0x4d7218(0xea)](_0x3eb576){const _0x5845ed=a16_0x4d7218,{options:_0x134111,args:_0xf5990d,tdx:_0x178af7}=_0x3eb576;if(_0xf5990d[_0x5845ed(0xe6)]===0x0)return console[_0x5845ed(0xd5)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x5845ed(0xe8)),0x1;const _0x4c5189=_0xf5990d[0x0],_0x3ab48f=_0x134111,_0x42c626=_0x3ab48f['description'];try{const _0x29da0f=await withSpinner(_0x5845ed(0x9f)+_0x4c5189+_0x5845ed(0xab),()=>_0x178af7[_0x5845ed(0xd7)][_0x5845ed(0xd2)]({'name':_0x4c5189,'description':_0x42c626}),{'verbose':_0x134111[_0x5845ed(0xbf)]});console['log']('Project\x20created:\x20'+_0x29da0f[_0x5845ed(0xa4)]['id']);const _0x4f704c=toLLMProjectInfo(_0x29da0f['data']);return await handleSDKOutput([_0x4f704c],_0x134111),0x0;}catch(_0x4ed0a2){return handleSDKError(_0x4ed0a2,_0x134111),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a16_0x4d7218(0x9b)]=a16_0x4d7218(0xaf);[a16_0x4d7218(0xc6)]=a16_0x4d7218(0xba);async['execute'](_0x943af9){const _0x1827db=a16_0x4d7218,{options:_0x3fedeb,args:_0x4bddef,tdx:_0xcd5e03}=_0x943af9;if(_0x4bddef[_0x1827db(0xe6)]===0x0)return console[_0x1827db(0xd5)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x1827db(0xd5)]('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0x173e88=_0x4bddef[0x0];try{return await withSpinner(_0x1827db(0x9a)+_0x173e88+_0x1827db(0xab),()=>_0xcd5e03[_0x1827db(0xd7)][_0x1827db(0xe3)](_0x173e88),{'verbose':_0x3fedeb[_0x1827db(0xbf)]}),console[_0x1827db(0x9e)](_0x1827db(0xbd)+_0x173e88),0x0;}catch(_0x344af4){return handleSDKError(_0x344af4,_0x3fedeb),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x1e2c86=a17_0x88a0;(function(_0x359600,_0xd3a58d){const _0xc74b8e=a17_0x88a0,_0x445537=_0x359600();while(!![]){try{const _0xcf940b=-parseInt(_0xc74b8e(0xf4))/0x1*(-parseInt(_0xc74b8e(0xce))/0x2)+-parseInt(_0xc74b8e(0xbd))/0x3+-parseInt(_0xc74b8e(0xde))/0x4*(-parseInt(_0xc74b8e(0xd9))/0x5)+-parseInt(_0xc74b8e(0xef))/0x6*(-parseInt(_0xc74b8e(0xe0))/0x7)+-parseInt(_0xc74b8e(0xfd))/0x8*(-parseInt(_0xc74b8e(0xe1))/0x9)+-parseInt(_0xc74b8e(0xd5))/0xa+-parseInt(_0xc74b8e(0xe3))/0xb*(-parseInt(_0xc74b8e(0xdb))/0xc);if(_0xcf940b===_0xd3a58d)break;else _0x445537['push'](_0x445537['shift']());}catch(_0x330016){_0x445537['push'](_0x445537['shift']());}}}(a17_0x4efc,0x84889));import a17_0x36adde from'chalk';function a17_0x88a0(_0x3436ac,_0x7222cb){const _0x4efc04=a17_0x4efc();return a17_0x88a0=function(_0x88a0b7,_0x444791){_0x88a0b7=_0x88a0b7-0xbc;let _0x53c47f=_0x4efc04[_0x88a0b7];return _0x53c47f;},a17_0x88a0(_0x3436ac,_0x7222cb);}import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function getProjectIdOrDefault(_0x4d405b,_0x48ff11){const _0x4529dd=a17_0x88a0,{tdx:_0x215cd1,options:_0x4d3f96}=_0x4d405b,_0x423903=_0x48ff11||_0x4d3f96['llmProject'];if(_0x423903){const _0x36a2b2=await _0x215cd1[_0x4529dd(0xf3)][_0x4529dd(0xe2)](),_0xed1013=_0x36a2b2['find'](_0x88fa87=>_0x88fa87[_0x4529dd(0xe8)]['name']===_0x423903);if(!_0xed1013)throw new SDKError(ErrorCode['NOT_FOUND'],'Project\x20\x27'+_0x423903+_0x4529dd(0xdd),undefined,{'helpText':_0x4529dd(0xed)});return _0xed1013['id'];}const _0x40a492=await _0x215cd1['llm'][_0x4529dd(0xfc)]();return _0x40a492['id'];}async function getAgentIdOrDefault(_0x5dd5f7,_0x13a38c,_0x27b812){const _0xf2c223=a17_0x88a0,{tdx:_0x1ea2b3,options:_0x587b1d}=_0x5dd5f7,_0x1ecf98=_0x27b812||_0x587b1d[_0xf2c223(0xf2)];if(_0x1ecf98){const _0x53a351=await _0x1ea2b3['llm'][_0xf2c223(0xec)](_0x13a38c),_0x2be350=_0x53a351[_0xf2c223(0xc4)](_0x22107b=>_0x22107b[_0xf2c223(0xe8)][_0xf2c223(0xc0)]===_0x1ecf98);if(!_0x2be350)throw new SDKError(ErrorCode[_0xf2c223(0xf8)],_0xf2c223(0xd8)+_0x1ecf98+_0xf2c223(0xda),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20agents\x22\x20to\x20see\x20available\x20agents'});return _0x2be350['id'];}const _0x369f83=await _0x1ea2b3[_0xf2c223(0xf3)][_0xf2c223(0xf0)]();return _0x369f83['id'];}export class LLMProxyCommand extends BaseCommand{[a17_0x1e2c86(0xc0)]=a17_0x1e2c86(0xd6);[a17_0x1e2c86(0xe7)]=a17_0x1e2c86(0xcd);['server'];async[a17_0x1e2c86(0xf7)](_0x401ffe){const _0x300ff8=a17_0x1e2c86,{tdx:_0x4cb468,options:_0x4e1aa4}=_0x401ffe;try{const _0x20496d=_0x4e1aa4,_0x355bd5=_0x20496d[_0x300ff8(0xfe)]||0xfa0,_0x517b43=_0x20496d[_0x300ff8(0xcb)],_0x5661ae=_0x20496d['agent'],_0x5ec728=_0x20496d[_0x300ff8(0xf9)];console['log'](a17_0x36adde['dim'](_0x300ff8(0xfb)));const _0x4e31a7=await getProjectIdOrDefault(_0x401ffe,_0x517b43),_0x3dd6e0=await getAgentIdOrDefault(_0x401ffe,_0x4e31a7,_0x5661ae),_0x1a74ac=await _0x4cb468['llm'][_0x300ff8(0xe2)](),_0x238e6f=_0x1a74ac[_0x300ff8(0xc4)](_0x59bcf4=>_0x59bcf4['id']===_0x4e31a7),_0x29d819=await _0x4cb468[_0x300ff8(0xf3)][_0x300ff8(0xec)](_0x4e31a7),_0x2609db=_0x29d819[_0x300ff8(0xc4)](_0x37032f=>_0x37032f['id']===_0x3dd6e0);console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xe5)](_0x300ff8(0xbc))),this[_0x300ff8(0xea)]=new ProxyServer({'port':_0x355bd5,'projectId':_0x4e31a7,'agentId':_0x3dd6e0,'tdx':_0x4cb468,'debug':_0x5ec728}),await this[_0x300ff8(0xea)][_0x300ff8(0xd3)](),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xf6)]['bold'](_0x300ff8(0xc6))),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xf6)](_0x300ff8(0xdc))),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xf6)](_0x300ff8(0xbe))),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xc9)][_0x300ff8(0xf1)](_0x300ff8(0xd4))),console['log'](a17_0x36adde[_0x300ff8(0xd1)]('Server\x20Configuration:')),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xe5)](_0x300ff8(0xc8)),a17_0x36adde[_0x300ff8(0xcf)](_0x300ff8(0xd0)+_0x355bd5)),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xe5)](_0x300ff8(0xe4)),a17_0x36adde[_0x300ff8(0xcf)](_0x238e6f?.['attributes'][_0x300ff8(0xc0)]||_0x4e31a7)),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xe5)]('\x20\x20Agent:'),a17_0x36adde[_0x300ff8(0xcf)](_0x2609db?.['attributes']['name']||_0x3dd6e0)),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xe5)](_0x300ff8(0xd7)),a17_0x36adde['white'](_0x4e1aa4[_0x300ff8(0xc2)]));_0x5ec728&&console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xf6)](_0x300ff8(0xc3)),a17_0x36adde['white']('enabled\x20(request/response\x20logging\x20to\x20stderr)'));console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xd1)](_0x300ff8(0xc1))),console[_0x300ff8(0xca)](a17_0x36adde['dim']('\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a')),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xcf)]('\x20\x20{')),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xcf)]('\x20\x20\x20\x20\x22env\x22:\x20{')),console['log'](a17_0x36adde[_0x300ff8(0xcf)](_0x300ff8(0xd2)+_0x355bd5+'\x22,')),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xcf)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22dummy\x22,')),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xcf)](_0x300ff8(0xdf))),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xcf)](_0x300ff8(0xfa))),console['log'](a17_0x36adde['white'](_0x300ff8(0xcc))),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xd1)](_0x300ff8(0xc5))),console['log'](a17_0x36adde[_0x300ff8(0xe5)](_0x300ff8(0xe9))),console['log'](a17_0x36adde[_0x300ff8(0xe5)](_0x300ff8(0xeb))),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xe5)](_0x300ff8(0xee))),console[_0x300ff8(0xca)](a17_0x36adde[_0x300ff8(0xf6)]('Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a'));const _0x489590=async()=>{const _0x6e76d0=_0x300ff8;console[_0x6e76d0(0xca)](a17_0x36adde['dim']('\x0a\x0aShutting\x20down\x20proxy\x20server...')),this[_0x6e76d0(0xea)]&&await this[_0x6e76d0(0xea)][_0x6e76d0(0xf5)](),console['log'](a17_0x36adde[_0x6e76d0(0xc9)](_0x6e76d0(0xbf))),process[_0x6e76d0(0xc7)](0x0);};return process['on']('SIGINT',_0x489590),process['on'](_0x300ff8(0xe6),_0x489590),await new Promise(()=>{}),0x0;}catch(_0x199071){this[_0x300ff8(0xea)]&&await this[_0x300ff8(0xea)][_0x300ff8(0xf5)]();throw _0x199071;}}}function a17_0x4efc(){const _0x4b24f9=['\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','7qIUegO','4221765EPFxww','projects','209YGjYvW','\x20\x20Project:','dim','SIGTERM','description','attributes','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','server','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','agents','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','2813352lNdrQl','getOrCreateDefaultAgent','bold','llmAgent','llm','1xukWcs','stop','yellow','execute','NOT_FOUND','debug','\x20\x20\x20\x20}','Resolving\x20project\x20and\x20agent...','getOrCreateDefaultProject','8yfHHUb','port','Starting\x20proxy\x20server...','1034076ZiGabh','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','✓\x20Proxy\x20server\x20stopped','name','\x0aClaude\x20Code\x20Configuration:','site','\x20\x20Debug:','find','\x0aTesting\x20with\x20Agent\x20SDK:','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','exit','\x20\x20Address:','green','log','project','\x20\x20}','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','588212SoAWpm','white','http://0.0.0.0:','cyan','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','start','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','9307190crmMkt','llm:proxy','\x20\x20Site:','Agent\x20\x27','83215PhainH','\x27\x20not\x20found\x20in\x20project','138972WexAdV','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','\x27\x20not\x20found','88OHKTmD'];a17_0x4efc=function(){return _0x4b24f9;};return a17_0x4efc();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a18_0xd3cb24=a18_0x4250;(function(_0x237613,_0x4f3210){const _0x56c6cc=a18_0x4250,_0x4a2d3a=_0x237613();while(!![]){try{const _0x34aacc=-parseInt(_0x56c6cc(0x1ec))/0x1*(parseInt(_0x56c6cc(0x201))/0x2)+parseInt(_0x56c6cc(0x1fe))/0x3*(parseInt(_0x56c6cc(0x1f6))/0x4)+-parseInt(_0x56c6cc(0x1fd))/0x5*(parseInt(_0x56c6cc(0x1ee))/0x6)+-parseInt(_0x56c6cc(0x1f5))/0x7*(-parseInt(_0x56c6cc(0x1ef))/0x8)+-parseInt(_0x56c6cc(0x1fa))/0x9*(-parseInt(_0x56c6cc(0x203))/0xa)+-parseInt(_0x56c6cc(0x1f3))/0xb+-parseInt(_0x56c6cc(0x1f4))/0xc*(parseInt(_0x56c6cc(0x1f7))/0xd);if(_0x34aacc===_0x4f3210)break;else _0x4a2d3a['push'](_0x4a2d3a['shift']());}catch(_0x16737a){_0x4a2d3a['push'](_0x4a2d3a['shift']());}}}(a18_0x5245,0x26fb8));function a18_0x5245(){const _0x31dca7=['map','config','24814qBUpAX','Error:\x20','2060810BiILeu','error','name','execute','1LYdGtR','\x20\x20Global:\x20~/.config/tdx/tdx.json','11814ZwHgDE','80plUKJY','description','length','scope','1429065nOiQli','3838152POMseT','189427DTjRus','160CWHckI','13hZTEzR','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','9UEdIiD','log','List\x20all\x20available\x20profiles','95RceIoI','13692rCwCUS'];a18_0x5245=function(){return _0x31dca7;};return a18_0x5245();}import{BaseCommand}from'./command.js';function a18_0x4250(_0x59c47a,_0x5d993a){const _0x524518=a18_0x5245();return a18_0x4250=function(_0x42506c,_0x1674c7){_0x42506c=_0x42506c-0x1ec;let _0x212b5b=_0x524518[_0x42506c];return _0x212b5b;},a18_0x4250(_0x59c47a,_0x5d993a);}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a18_0xd3cb24(0x205)]='profiles';[a18_0xd3cb24(0x1f0)]=a18_0xd3cb24(0x1fc);async[a18_0xd3cb24(0x206)](_0x35d803){const _0x1e0dae=a18_0xd3cb24,{options:_0x29b9a0}=_0x35d803;try{const _0x528cb6=listProfiles(),_0x3264f9=getActiveProfile();if(_0x528cb6[_0x1e0dae(0x1f1)]===0x0)return console[_0x1e0dae(0x1fb)](_0x1e0dae(0x1f8)),console[_0x1e0dae(0x1fb)](_0x1e0dae(0x1f9)),console['log'](_0x1e0dae(0x1ed)),0x0;const _0x58ebd4=_0x528cb6[_0x1e0dae(0x1ff)](_0x40e87a=>{const _0x5d0bc5=_0x1e0dae,_0x4aa6a6=_0x40e87a['name']===_0x3264f9,_0x2d4d7b=getProfileParams(_0x40e87a['config']);return{'name':_0x40e87a['name'],'active':_0x4aa6a6,'scope':_0x40e87a[_0x5d0bc5(0x1f2)],'description':_0x40e87a[_0x5d0bc5(0x200)][_0x5d0bc5(0x1f0)]||'','params':_0x2d4d7b};});return await handleSDKOutput(_0x58ebd4,_0x29b9a0),0x0;}catch(_0x16a74f){return _0x16a74f instanceof Error&&console[_0x1e0dae(0x204)](_0x1e0dae(0x202)+_0x16a74f['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x381574=a19_0x1266;function a19_0x4875(){const _0x5453b0=['\x0aAll\x20results\x20saved\x20to\x20','8rnvAWa','551400eQhfqN','3694432WjCHuZ','push','\x20-\x20','3983285ZSeIgv','verbose','Query\x20failed\x20[','20414yaFBhM','Executing\x20statement\x20','Statement\x20','code','execute','length','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','\x20rows\x20','file','error','elapsedTimeMillis','output','in\x20','join','name','440943uJpmOA','28NLWzFJ','validate','11JfDYMH','SQL:\x20','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','database','Error:\x20','catalog','Executing\x20query...','data','toLocaleString','8220789CQkwtr','UNKNOWN_ERROR','Site:\x20','message','Run\x20Trino\x20queries\x20(streaming)','processedRows','stats','jobId','setJobId','9950530QVrsEt','options','site','query'];a19_0x4875=function(){return _0x5453b0;};return a19_0x4875();}(function(_0x2c7fd4,_0x4a5719){const _0x11b25d=a19_0x1266,_0xee30d7=_0x2c7fd4();while(!![]){try{const _0x1afdf9=parseInt(_0x11b25d(0xc4))/0x1*(parseInt(_0x11b25d(0xe3))/0x2)+-parseInt(_0x11b25d(0xc1))/0x3*(parseInt(_0x11b25d(0xc2))/0x4)+-parseInt(_0x11b25d(0xe0))/0x5+parseInt(_0x11b25d(0xdc))/0x6+parseInt(_0x11b25d(0xdd))/0x7+parseInt(_0x11b25d(0xdb))/0x8*(parseInt(_0x11b25d(0xcd))/0x9)+parseInt(_0x11b25d(0xd6))/0xa;if(_0x1afdf9===_0x4a5719)break;else _0xee30d7['push'](_0xee30d7['shift']());}catch(_0x1a8547){_0xee30d7['push'](_0xee30d7['shift']());}}}(a19_0x4875,0xc6f37));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput}from'../utils/command-output.js';function a19_0x1266(_0x50507c,_0x4e9ed0){const _0x4875a3=a19_0x4875();return a19_0x1266=function(_0x12661e,_0x212051){_0x12661e=_0x12661e-0xb7;let _0x572ecb=_0x4875a3[_0x12661e];return _0x572ecb;},a19_0x1266(_0x50507c,_0x4e9ed0);}import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';export class QueryCommand extends BaseCommand{[a19_0x381574(0xc0)]='query';['description']=a19_0x381574(0xd1);async[a19_0x381574(0xe7)](_0x14cd47){const _0x31f5e9=a19_0x381574,{options:_0x2ffc44,args:_0x3c35fb,tdx:_0x54a4bf}=_0x14cd47,_0x5bc2a9=_0x3c35fb[0x0],_0x269297=_0x2ffc44[_0x31f5e9(0xba)];let _0x4f3d1d;if(_0x269297)try{_0x4f3d1d=readSqlStatementsFromFile(_0x269297);}catch(_0x570c1f){return console[_0x31f5e9(0xbb)]('Error:\x20'+_0x570c1f[_0x31f5e9(0xd0)]),0x1;}else try{_0x4f3d1d=splitSqlStatements(_0x5bc2a9);}catch(_0x25a97f){return console[_0x31f5e9(0xbb)](_0x31f5e9(0xc8)+_0x25a97f['message']),0x1;}const _0x45a35c=_0x2ffc44[_0x31f5e9(0xc7)]||'information_schema',_0x3a5841=_0x2ffc44[_0x31f5e9(0xc9)];try{const _0x35db00=[],_0x30fc3c=!!_0x2ffc44[_0x31f5e9(0xbd)];for(let _0x25f965=0x0;_0x25f965<_0x4f3d1d[_0x31f5e9(0xb7)];_0x25f965++){const _0x5be120=_0x4f3d1d[_0x25f965],_0x15da23=_0x25f965+0x1,_0x5b94b8=_0x4f3d1d['length'],_0xf995c1=_0x5b94b8>0x1;_0x2ffc44[_0x31f5e9(0xe1)]&&(console['error']('\x0a'+(_0xf995c1?_0x31f5e9(0xe5)+_0x15da23+'/'+_0x5b94b8+':':'')),console[_0x31f5e9(0xbb)](_0x31f5e9(0xcf)+_0x2ffc44[_0x31f5e9(0xd8)]),console['error']('Catalog:\x20'+(_0x3a5841||'td')),console[_0x31f5e9(0xbb)]('Schema:\x20'+_0x45a35c),console[_0x31f5e9(0xbb)](_0x31f5e9(0xc5)+_0x5be120));const _0x3c1ccb=_0xf995c1?_0x31f5e9(0xe4)+_0x15da23+'/'+_0x5b94b8+'...':_0x31f5e9(0xca);try{const _0x36dc36=await withQuerySpinner(_0x3c1ccb,async _0x29fb3d=>{const _0x1f655c=_0x31f5e9,_0x1d0e65=await _0x54a4bf[_0x1f655c(0xd9)](_0x5be120,{'catalog':_0x3a5841,'schema':_0x45a35c,'onJobId':_0x2aebc3=>{const _0xa3d91e=_0x1f655c;_0x29fb3d[_0xa3d91e(0xd5)](_0x2aebc3);}});return _0x1d0e65;},{'verbose':_0x2ffc44['verbose']}),_0x12598e=_0x36dc36[_0x31f5e9(0xcb)],_0x2d3828=_0x12598e[_0x31f5e9(0xd4)]?'\x20[Job\x20ID:\x20'+_0x12598e[_0x31f5e9(0xd4)]+']':'',_0xfea2bd=_0xf995c1?_0x31f5e9(0xe5)+_0x15da23+'/'+_0x5b94b8+_0x31f5e9(0xdf):'';console[_0x31f5e9(0xbb)]('✔\x20'+_0xfea2bd+'Query\x20completed:\x20Processed\x20'+_0x12598e['stats'][_0x31f5e9(0xd2)][_0x31f5e9(0xcc)]()+_0x31f5e9(0xb9)+(_0x31f5e9(0xbe)+formatElapsed(_0x12598e[_0x31f5e9(0xd3)][_0x31f5e9(0xbc)])+_0x2d3828));if(_0xf995c1&&_0x30fc3c){const {formatQueryOutput:_0x2fe411,resolveOutputOptions:_0xf3b827}=await import('../utils/command-output.js'),_0x2cd7d2=_0xf3b827(_0x2ffc44),_0x5262dd=await _0x2fe411(_0x12598e,_0x2cd7d2);_0x35db00[_0x31f5e9(0xde)](_0x5262dd);}else await handleQueryOutput(_0x12598e,_0x2ffc44);}catch(_0x2502cf){const _0xc7fe78=_0x2502cf instanceof SDKError?_0x2502cf[_0x31f5e9(0xe6)]:_0x31f5e9(0xce);return console[_0x31f5e9(0xbb)]('✖\x20'+(_0xf995c1?_0x31f5e9(0xe5)+_0x15da23+'/'+_0x5b94b8+_0x31f5e9(0xdf):'')+_0x31f5e9(0xe2)+_0xc7fe78+']'),console[_0x31f5e9(0xbb)]('\x0a'+_0x2502cf[_0x31f5e9(0xd0)]),0x1;}}if(_0x4f3d1d[_0x31f5e9(0xb7)]>0x1&&_0x30fc3c&&_0x35db00[_0x31f5e9(0xb7)]>0x0){const _0xdf245d=_0x35db00[_0x31f5e9(0xbf)]('\x0a');writeFileSync(_0x2ffc44[_0x31f5e9(0xbd)],_0xdf245d),console['error'](_0x31f5e9(0xda)+_0x2ffc44[_0x31f5e9(0xbd)]);}return 0x0;}catch(_0x7e1589){throw _0x7e1589;}}[a19_0x381574(0xc3)](_0x519113){const _0x17e97f=a19_0x381574,_0xb5f9ba=_0x519113['args'][0x0],_0x35addc=_0x519113[_0x17e97f(0xd7)][_0x17e97f(0xba)];if(!_0xb5f9ba&&!_0x35addc)return _0x17e97f(0xc6);if(_0xb5f9ba&&_0x35addc)return _0x17e97f(0xb8);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a19_0x17cb27=a19_0x2224;(function(_0x1b913e,_0x5ba251){const _0x46c091=a19_0x2224,_0x1cfde0=_0x1b913e();while(!![]){try{const _0x311e03=parseInt(_0x46c091(0x1df))/0x1*(parseInt(_0x46c091(0x1d0))/0x2)+-parseInt(_0x46c091(0x1e4))/0x3*(-parseInt(_0x46c091(0x1d1))/0x4)+-parseInt(_0x46c091(0x209))/0x5*(parseInt(_0x46c091(0x1eb))/0x6)+parseInt(_0x46c091(0x1c0))/0x7+-parseInt(_0x46c091(0x1fd))/0x8*(-parseInt(_0x46c091(0x1ff))/0x9)+-parseInt(_0x46c091(0x1c1))/0xa+parseInt(_0x46c091(0x1f6))/0xb*(-parseInt(_0x46c091(0x1c5))/0xc);if(_0x311e03===_0x5ba251)break;else _0x1cfde0['push'](_0x1cfde0['shift']());}catch(_0x12845e){_0x1cfde0['push'](_0x1cfde0['shift']());}}}(a19_0x403d,0xbc1a5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a19_0x403d(){const _0x52c90f=['Fetching\x20SQL\x20for\x20parent\x20\x27','8QWINqr','resolveParentId','test','\x20\x20Cause:\x20','execute','120399NjmXBO','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Folder\x20name:\x20','getFolder','json','Fetching\x20SQL\x20for\x20segment\x20\x27','segment:sql','702588duRfld','Resolved\x20parent\x20ID:\x20','Resolving\x20folder\x20\x27','Resolved\x20child\x20ID:\x20','Usage:\x20tdx\x20segment\x20sql\x20<parent_name>\x20or\x20<parent_name/child_name>','format','segment','Usage:\x20tdx\x20segment\x20show\x20<parent_name>\x20or\x20<parent_name/child_name>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','elapsedTimeMillis','limit','132022KcaCwE','\x27...','error','log','getSegmentSQL','site','\x20rows\x20','48cnTZTQ','stats','1195983PSKpfN','in\x20','jsonl','message','Fetching\x20folder\x20\x27','length','Fetching\x20segment\x20\x27','getParentSQL','Error:\x20Folder\x20reference\x20is\x20required','Executing\x20segment\x20query...','20dBVONv','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segment:show','information_schema','Child\x20name:\x20','\x20[Job\x20ID:\x20','Error:\x20Segment\x20name\x20is\x20required','segment:describe','5179496BIiNzc','12677350BNMuFh','data','description','processedRows','1308PuwMWi','Resolving\x20parent\x20segment\x20\x27','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','segment:folder:show','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Site:\x20','Fetching\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20describe\x20<parent_name>\x20or\x20<parent_name/child_name>','verbose','cause','Resolving\x20child\x20segment\x20\x27','368726KwQoDa','80yUrrCu','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Resolved\x20folder\x20ID:\x20','name','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Parent\x20name:\x20','Error:\x20','resolveSegmentId','SQL\x20query:\x0a','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Found\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','listFolders'];a19_0x403d=function(){return _0x52c90f;};return a19_0x403d();}function a19_0x2224(_0x469edb,_0xc00316){const _0x403d1a=a19_0x403d();return a19_0x2224=function(_0x222484,_0x2f0d36){_0x222484=_0x222484-0x1bc;let _0x381598=_0x403d1a[_0x222484];return _0x381598;},a19_0x2224(_0x469edb,_0xc00316);}import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{['name']=a19_0x17cb27(0x1bf);[a19_0x17cb27(0x1c3)]='Show\x20parent\x20or\x20child\x20segment\x20details';async[a19_0x17cb27(0x1e3)](_0x3216ee){const _0x1ddd1b=a19_0x17cb27,{options:_0x314317,args:_0x5f96d6,tdx:_0x3bf560}=_0x3216ee;if(_0x5f96d6[_0x1ddd1b(0x204)]===0x0)return console[_0x1ddd1b(0x1f8)](_0x1ddd1b(0x1be)),console[_0x1ddd1b(0x1f8)](_0x1ddd1b(0x1cc)),0x1;try{const {parentId:_0x3683b3,childId:_0x1d6ef9}=parseSegmentRef(_0x5f96d6[0x0]);_0x314317[_0x1ddd1b(0x1cd)]&&(console[_0x1ddd1b(0x1f8)](_0x1ddd1b(0x1ca)+_0x314317[_0x1ddd1b(0x1fb)]),console[_0x1ddd1b(0x1f8)](_0x1ddd1b(0x1d6)+_0x3683b3),_0x1d6ef9&&console[_0x1ddd1b(0x1f8)](_0x1ddd1b(0x1bc)+_0x1d6ef9));const _0x21150e=await withSpinner(_0x1ddd1b(0x1c6)+_0x3683b3+_0x1ddd1b(0x1f7),()=>_0x3bf560[_0x1ddd1b(0x1f1)]['resolveParentId'](_0x3683b3),{'verbose':_0x314317[_0x1ddd1b(0x1cd)]}),_0x1ba3cf=_0x21150e['data'];_0x314317[_0x1ddd1b(0x1cd)]&&console[_0x1ddd1b(0x1f8)]('Resolved\x20parent\x20ID:\x20'+_0x1ba3cf);if(!_0x1d6ef9){const _0x3d9405=await withSpinner(_0x1ddd1b(0x1cb)+_0x3683b3+_0x1ddd1b(0x1f7),()=>_0x3bf560[_0x1ddd1b(0x1f1)]['getParent'](_0x1ba3cf),{'verbose':_0x314317['verbose']});await handleSDKOutput([_0x3d9405[_0x1ddd1b(0x1c2)]],_0x314317);}else{const _0x24ae06=await withSpinner(_0x1ddd1b(0x1cf)+_0x1d6ef9+'\x27...',()=>_0x3bf560[_0x1ddd1b(0x1f1)][_0x1ddd1b(0x1d8)](_0x1ba3cf,_0x1d6ef9),{'verbose':_0x314317[_0x1ddd1b(0x1cd)]}),_0xf964d8=_0x24ae06[_0x1ddd1b(0x1c2)];_0x314317[_0x1ddd1b(0x1cd)]&&console[_0x1ddd1b(0x1f8)](_0x1ddd1b(0x1ee)+_0xf964d8);const _0xe9ed5d=await withSpinner(_0x1ddd1b(0x205)+_0x1d6ef9+_0x1ddd1b(0x1f7),()=>_0x3bf560[_0x1ddd1b(0x1f1)]['getSegment'](_0x1ba3cf,_0xf964d8),{'verbose':_0x314317[_0x1ddd1b(0x1cd)]});await handleSDKOutput([_0xe9ed5d['data']],_0x314317);}return 0x0;}catch(_0x2ba072){if(_0x2ba072 instanceof SDKError)return console['error'](_0x1ddd1b(0x1d7)+_0x2ba072[_0x1ddd1b(0x202)]),_0x2ba072[_0x1ddd1b(0x1ce)]&&console[_0x1ddd1b(0x1f8)]('\x20\x20Cause:\x20'+_0x2ba072['cause']),0x1;throw _0x2ba072;}}}export class SegmentShowCommand extends BaseCommand{['name']=a19_0x17cb27(0x20b);['description']=a19_0x17cb27(0x1e5);async['execute'](_0x199768){const _0x1533d9=a19_0x17cb27,{options:_0xa368e,args:_0x3d8536,tdx:_0x5e8f37}=_0x199768;if(_0x3d8536[_0x1533d9(0x204)]===0x0)return console[_0x1533d9(0x1f8)](_0x1533d9(0x1be)),console[_0x1533d9(0x1f8)](_0x1533d9(0x1f2)),0x1;try{const {parentId:_0x206e63,childId:_0x25870a}=parseSegmentRef(_0x3d8536[0x0]);_0xa368e[_0x1533d9(0x1cd)]&&(console[_0x1533d9(0x1f8)]('Site:\x20'+_0xa368e[_0x1533d9(0x1fb)]),console['error'](_0x1533d9(0x1d6)+_0x206e63),_0x25870a&&console['error'](_0x1533d9(0x1bc)+_0x25870a));const _0x361226=await withSpinner(_0x1533d9(0x1c6)+_0x206e63+_0x1533d9(0x1f7),()=>_0x5e8f37[_0x1533d9(0x1f1)]['resolveParentId'](_0x206e63),{'verbose':_0xa368e[_0x1533d9(0x1cd)]}),_0x578e31=_0x361226[_0x1533d9(0x1c2)];_0xa368e['verbose']&&console[_0x1533d9(0x1f8)]('Resolved\x20parent\x20ID:\x20'+_0x578e31);let _0x5b1b47;if(!_0x25870a){const _0x544d6c=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20\x27'+_0x206e63+_0x1533d9(0x1f7),()=>_0x5e8f37[_0x1533d9(0x1f1)][_0x1533d9(0x206)](_0x578e31),{'verbose':_0xa368e[_0x1533d9(0x1cd)]});_0x5b1b47=_0x544d6c[_0x1533d9(0x1c2)];}else{const _0x59ea41=await withSpinner(_0x1533d9(0x1cf)+_0x25870a+_0x1533d9(0x1f7),()=>_0x5e8f37[_0x1533d9(0x1f1)][_0x1533d9(0x1d8)](_0x578e31,_0x25870a),{'verbose':_0xa368e['verbose']}),_0x35804d=_0x59ea41[_0x1533d9(0x1c2)];_0xa368e[_0x1533d9(0x1cd)]&&console[_0x1533d9(0x1f8)](_0x1533d9(0x1ee)+_0x35804d);const _0x263997=await withSpinner('Fetching\x20SQL\x20for\x20segment\x20\x27'+_0x25870a+_0x1533d9(0x1f7),()=>_0x5e8f37[_0x1533d9(0x1f1)][_0x1533d9(0x1fa)](_0x578e31,_0x35804d),{'verbose':_0xa368e[_0x1533d9(0x1cd)]});_0x5b1b47=_0x263997[_0x1533d9(0x1c2)];}const _0xa36517=_0xa368e[_0x1533d9(0x1f5)],_0x4f0e60=/\bLIMIT\s+\d+/i[_0x1533d9(0x1e1)](_0x5b1b47);!_0x4f0e60&&(_0x5b1b47=_0x5b1b47['trim']()['replace'](/;+$/,''),_0x5b1b47=_0x1533d9(0x1da)+_0x5b1b47+_0x1533d9(0x1f3)+_0xa36517);_0xa368e['verbose']&&console['error'](_0x1533d9(0x1d9)+_0x5b1b47);const _0x472f3b=await withQuerySpinner(_0x1533d9(0x208),async _0x388bda=>{const _0x54108a=_0x1533d9,_0x826553=await _0x5e8f37['query'](_0x5b1b47,{'catalog':'td','schema':_0x54108a(0x20c),'onJobId':_0x24773a=>{_0x388bda['setJobId'](_0x24773a);}});return _0x826553;},{'verbose':_0xa368e['verbose']}),_0x50d2a1=_0x472f3b['data'],_0x1a6938=_0x50d2a1['jobId']?_0x1533d9(0x1bd)+_0x50d2a1['jobId']+']':'';return console[_0x1533d9(0x1f8)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x50d2a1[_0x1533d9(0x1fe)][_0x1533d9(0x1c4)]['toLocaleString']()+_0x1533d9(0x1fc)+(_0x1533d9(0x200)+formatElapsed(_0x50d2a1[_0x1533d9(0x1fe)][_0x1533d9(0x1f4)])+_0x1a6938)),await handleQueryOutput(_0x50d2a1,_0xa368e),0x0;}catch(_0xb19a24){if(_0xb19a24 instanceof SDKError)return console[_0x1533d9(0x1f8)]('✖\x20Query\x20failed\x20['+_0xb19a24['code']+']'),console['error']('\x0a'+_0xb19a24[_0x1533d9(0x202)]),0x1;throw _0xb19a24;}}}export class SegmentFolderListCommand extends BaseCommand{[a19_0x17cb27(0x1d4)]='segment:folder:list';[a19_0x17cb27(0x1c3)]=a19_0x17cb27(0x1c7);async['execute'](_0x119646){const _0x10a154=a19_0x17cb27,{options:_0x184123,args:_0x513467,tdx:_0x5e59a8}=_0x119646;if(_0x513467[_0x10a154(0x204)]===0x0)return console[_0x10a154(0x1f8)](_0x10a154(0x1dc)),console[_0x10a154(0x1f8)](_0x10a154(0x20a)),0x1;const _0x4ff50a=_0x513467[0x0];try{_0x184123['verbose']&&(console[_0x10a154(0x1f8)]('Site:\x20'+_0x184123[_0x10a154(0x1fb)]),console[_0x10a154(0x1f8)](_0x10a154(0x1d6)+_0x4ff50a));const _0x4ed22a=await withSpinner(_0x10a154(0x1c6)+_0x4ff50a+_0x10a154(0x1f7),()=>_0x5e59a8['segment']['resolveParentId'](_0x4ff50a),{'verbose':_0x184123[_0x10a154(0x1cd)]}),_0x4ce97e=_0x4ed22a[_0x10a154(0x1c2)];_0x184123[_0x10a154(0x1cd)]&&console[_0x10a154(0x1f8)](_0x10a154(0x1ec)+_0x4ce97e);const _0x4bb166=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x4ff50a+_0x10a154(0x1f7),()=>_0x5e59a8[_0x10a154(0x1f1)][_0x10a154(0x1dd)](_0x4ce97e),{'verbose':_0x184123['verbose']}),_0x178375=_0x4bb166[_0x10a154(0x1c2)];return console[_0x10a154(0x1f8)](_0x10a154(0x1db)+_0x178375[_0x10a154(0x204)]+'\x20folder'+(_0x178375['length']!==0x1?'s':'')),await handleSDKOutput(_0x178375,_0x184123),0x0;}catch(_0x353674){if(_0x353674 instanceof SDKError)return console[_0x10a154(0x1f8)](_0x10a154(0x1d7)+_0x353674[_0x10a154(0x202)]),_0x353674[_0x10a154(0x1ce)]&&console[_0x10a154(0x1f8)](_0x10a154(0x1e2)+_0x353674[_0x10a154(0x1ce)]),0x1;throw _0x353674;}}}export class SegmentFolderShowCommand extends BaseCommand{[a19_0x17cb27(0x1d4)]=a19_0x17cb27(0x1c8);[a19_0x17cb27(0x1c3)]='Show\x20segment\x20folder\x20details';async['execute'](_0x4918de){const _0x4c33c8=a19_0x17cb27,{options:_0x12bef9,args:_0x15c123,tdx:_0x5ecc34}=_0x4918de;if(_0x15c123[_0x4c33c8(0x204)]===0x0)return console['error'](_0x4c33c8(0x207)),console[_0x4c33c8(0x1f8)](_0x4c33c8(0x1c9)),0x1;try{const {parentId:_0x4f4590,childId:_0x1e363e}=parseSegmentRef(_0x15c123[0x0]);_0x12bef9[_0x4c33c8(0x1cd)]&&(console[_0x4c33c8(0x1f8)](_0x4c33c8(0x1ca)+_0x12bef9['site']),console[_0x4c33c8(0x1f8)]('Parent\x20name:\x20'+_0x4f4590),_0x1e363e&&console[_0x4c33c8(0x1f8)](_0x4c33c8(0x1e6)+_0x1e363e));if(!_0x1e363e)return console[_0x4c33c8(0x1f8)](_0x4c33c8(0x1d2)),0x1;const _0x4a83cd=await withSpinner(_0x4c33c8(0x1c6)+_0x4f4590+_0x4c33c8(0x1f7),()=>_0x5ecc34[_0x4c33c8(0x1f1)][_0x4c33c8(0x1e0)](_0x4f4590),{'verbose':_0x12bef9[_0x4c33c8(0x1cd)]}),_0x518131=_0x4a83cd[_0x4c33c8(0x1c2)];_0x12bef9[_0x4c33c8(0x1cd)]&&console[_0x4c33c8(0x1f8)](_0x4c33c8(0x1ec)+_0x518131);const _0x89ba8f=await withSpinner(_0x4c33c8(0x1ed)+_0x1e363e+'\x27...',()=>_0x5ecc34[_0x4c33c8(0x1f1)]['resolveFolderId'](_0x518131,_0x1e363e),{'verbose':_0x12bef9[_0x4c33c8(0x1cd)]}),_0x43d34d=_0x89ba8f['data'];_0x12bef9[_0x4c33c8(0x1cd)]&&console[_0x4c33c8(0x1f8)](_0x4c33c8(0x1d3)+_0x43d34d);const _0x5cc742=await withSpinner(_0x4c33c8(0x203)+_0x1e363e+_0x4c33c8(0x1f7),()=>_0x5ecc34['segment'][_0x4c33c8(0x1e7)](_0x43d34d),{'verbose':_0x12bef9[_0x4c33c8(0x1cd)]});return await handleSDKOutput([_0x5cc742[_0x4c33c8(0x1c2)]],_0x12bef9),0x0;}catch(_0x51f710){if(_0x51f710 instanceof SDKError)return console[_0x4c33c8(0x1f8)](_0x4c33c8(0x1d7)+_0x51f710[_0x4c33c8(0x202)]),_0x51f710[_0x4c33c8(0x1ce)]&&console[_0x4c33c8(0x1f8)](_0x4c33c8(0x1e2)+_0x51f710[_0x4c33c8(0x1ce)]),0x1;throw _0x51f710;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a19_0x17cb27(0x1ea);[a19_0x17cb27(0x1c3)]=a19_0x17cb27(0x1d5);async[a19_0x17cb27(0x1e3)](_0x978879){const _0x15d7c3=a19_0x17cb27,{options:_0x2c1ddf,args:_0xeaa621,tdx:_0x51b7bc}=_0x978879;if(_0xeaa621[_0x15d7c3(0x204)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console['error'](_0x15d7c3(0x1ef)),0x1;try{const {parentId:_0x48ba96,childId:_0x39a358}=parseSegmentRef(_0xeaa621[0x0]);_0x2c1ddf[_0x15d7c3(0x1cd)]&&(console[_0x15d7c3(0x1f8)](_0x15d7c3(0x1ca)+_0x2c1ddf[_0x15d7c3(0x1fb)]),console[_0x15d7c3(0x1f8)](_0x15d7c3(0x1d6)+_0x48ba96),_0x39a358&&console[_0x15d7c3(0x1f8)]('Child\x20name:\x20'+_0x39a358));const _0x5896c0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x48ba96+_0x15d7c3(0x1f7),()=>_0x51b7bc[_0x15d7c3(0x1f1)][_0x15d7c3(0x1e0)](_0x48ba96),{'verbose':_0x2c1ddf['verbose']}),_0x440a97=_0x5896c0['data'];_0x2c1ddf[_0x15d7c3(0x1cd)]&&console[_0x15d7c3(0x1f8)](_0x15d7c3(0x1ec)+_0x440a97);let _0x5cb5f3;if(!_0x39a358){const _0x1c8df8=await withSpinner(_0x15d7c3(0x1de)+_0x48ba96+_0x15d7c3(0x1f7),()=>_0x51b7bc['segment']['getParentSQL'](_0x440a97),{'verbose':_0x2c1ddf[_0x15d7c3(0x1cd)]});_0x5cb5f3=_0x1c8df8[_0x15d7c3(0x1c2)];}else{const _0x8801f6=await withSpinner(_0x15d7c3(0x1cf)+_0x39a358+_0x15d7c3(0x1f7),()=>_0x51b7bc[_0x15d7c3(0x1f1)]['resolveSegmentId'](_0x440a97,_0x39a358),{'verbose':_0x2c1ddf[_0x15d7c3(0x1cd)]}),_0x37bf9a=_0x8801f6[_0x15d7c3(0x1c2)];_0x2c1ddf[_0x15d7c3(0x1cd)]&&console[_0x15d7c3(0x1f8)]('Resolved\x20child\x20ID:\x20'+_0x37bf9a);const _0x2ebea3=await withSpinner(_0x15d7c3(0x1e9)+_0x39a358+_0x15d7c3(0x1f7),()=>_0x51b7bc[_0x15d7c3(0x1f1)]['getSegmentSQL'](_0x440a97,_0x37bf9a),{'verbose':_0x2c1ddf[_0x15d7c3(0x1cd)]});_0x5cb5f3=_0x2ebea3[_0x15d7c3(0x1c2)];}return _0x2c1ddf[_0x15d7c3(0x1f0)]===_0x15d7c3(0x1e8)||_0x2c1ddf['format']===_0x15d7c3(0x201)?await handleSDKOutput([{'sql':_0x5cb5f3}],_0x2c1ddf):console[_0x15d7c3(0x1f9)](_0x5cb5f3),0x0;}catch(_0x52e4ad){if(_0x52e4ad instanceof SDKError)return console[_0x15d7c3(0x1f8)](_0x15d7c3(0x1d7)+_0x52e4ad[_0x15d7c3(0x202)]),_0x52e4ad[_0x15d7c3(0x1ce)]&&console[_0x15d7c3(0x1f8)](_0x15d7c3(0x1e2)+_0x52e4ad[_0x15d7c3(0x1ce)]),0x1;throw _0x52e4ad;}}}
|
|
1
|
+
const a20_0x10f175=a20_0x583a;(function(_0x86c5bc,_0xa5e5ec){const _0x10ef6e=a20_0x583a,_0x319635=_0x86c5bc();while(!![]){try{const _0x5b3287=parseInt(_0x10ef6e(0xfe))/0x1+-parseInt(_0x10ef6e(0xee))/0x2*(-parseInt(_0x10ef6e(0x12a))/0x3)+-parseInt(_0x10ef6e(0x11b))/0x4*(parseInt(_0x10ef6e(0x127))/0x5)+parseInt(_0x10ef6e(0xe5))/0x6+-parseInt(_0x10ef6e(0x10f))/0x7*(-parseInt(_0x10ef6e(0x11e))/0x8)+parseInt(_0x10ef6e(0x10a))/0x9*(parseInt(_0x10ef6e(0xde))/0xa)+parseInt(_0x10ef6e(0xe9))/0xb*(-parseInt(_0x10ef6e(0xdf))/0xc);if(_0x5b3287===_0xa5e5ec)break;else _0x319635['push'](_0x319635['shift']());}catch(_0x1aa9b7){_0x319635['push'](_0x319635['shift']());}}}(a20_0x2ecf,0xd5315));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a20_0x10f175(0xf8)]='segment:describe';[a20_0x10f175(0x10c)]=a20_0x10f175(0xe4);async[a20_0x10f175(0x124)](_0x5591d0){const _0x179a6f=a20_0x10f175,{options:_0x590ef1,args:_0xecf69f,tdx:_0x19821c}=_0x5591d0;if(_0xecf69f[_0x179a6f(0xfd)]===0x0)return console[_0x179a6f(0xda)](_0x179a6f(0xfc)),console['error'](_0x179a6f(0xe3)),0x1;try{const {parentId:_0x394274,childId:_0x52f2e9}=parseSegmentRef(_0xecf69f[0x0]);_0x590ef1[_0x179a6f(0x119)]&&(console[_0x179a6f(0xda)](_0x179a6f(0x11d)+_0x590ef1[_0x179a6f(0x121)]),console[_0x179a6f(0xda)]('Parent\x20name:\x20'+_0x394274),_0x52f2e9&&console[_0x179a6f(0xda)](_0x179a6f(0x116)+_0x52f2e9));const _0x3ed347=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x394274+_0x179a6f(0xef),()=>_0x19821c[_0x179a6f(0xe1)][_0x179a6f(0xdb)](_0x394274),{'verbose':_0x590ef1[_0x179a6f(0x119)]}),_0x3ab81a=_0x3ed347[_0x179a6f(0xf9)];_0x590ef1['verbose']&&console[_0x179a6f(0xda)](_0x179a6f(0x107)+_0x3ab81a);if(!_0x52f2e9){const _0x399b8c=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x394274+_0x179a6f(0xef),()=>_0x19821c[_0x179a6f(0xe1)]['getParent'](_0x3ab81a),{'verbose':_0x590ef1[_0x179a6f(0x119)]});await handleSDKOutput([_0x399b8c[_0x179a6f(0xf9)]],_0x590ef1);}else{const _0x51694e=await withSpinner(_0x179a6f(0xf0)+_0x52f2e9+_0x179a6f(0xef),()=>_0x19821c[_0x179a6f(0xe1)][_0x179a6f(0x11c)](_0x3ab81a,_0x52f2e9),{'verbose':_0x590ef1[_0x179a6f(0x119)]}),_0x17830c=_0x51694e[_0x179a6f(0xf9)];_0x590ef1['verbose']&&console[_0x179a6f(0xda)](_0x179a6f(0x10e)+_0x17830c);const _0x2773b6=await withSpinner('Fetching\x20segment\x20\x27'+_0x52f2e9+_0x179a6f(0xef),()=>_0x19821c[_0x179a6f(0xe1)][_0x179a6f(0x118)](_0x3ab81a,_0x17830c),{'verbose':_0x590ef1[_0x179a6f(0x119)]});await handleSDKOutput([_0x2773b6['data']],_0x590ef1);}return 0x0;}catch(_0x3a5780){if(_0x3a5780 instanceof SDKError)return console[_0x179a6f(0xda)]('Error:\x20'+_0x3a5780[_0x179a6f(0x109)]),_0x3a5780[_0x179a6f(0x125)]&&console[_0x179a6f(0xda)]('\x20\x20Cause:\x20'+_0x3a5780[_0x179a6f(0x125)]),0x1;throw _0x3a5780;}}}export class SegmentShowCommand extends BaseCommand{[a20_0x10f175(0xf8)]=a20_0x10f175(0x103);[a20_0x10f175(0x10c)]=a20_0x10f175(0x12b);async['execute'](_0xd9f134){const _0x1f13b3=a20_0x10f175,{options:_0x53cda3,args:_0x49e32e,tdx:_0x86e95a}=_0xd9f134;if(_0x49e32e[_0x1f13b3(0xfd)]===0x0)return console[_0x1f13b3(0xda)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x1f13b3(0xda)](_0x1f13b3(0xe6)),0x1;try{const {parentId:_0x2e5726,childId:_0x54aa14}=parseSegmentRef(_0x49e32e[0x0]);_0x53cda3[_0x1f13b3(0x119)]&&(console[_0x1f13b3(0xda)](_0x1f13b3(0x11d)+_0x53cda3[_0x1f13b3(0x121)]),console[_0x1f13b3(0xda)]('Parent\x20name:\x20'+_0x2e5726),_0x54aa14&&console[_0x1f13b3(0xda)](_0x1f13b3(0x116)+_0x54aa14));const _0x1eddb9=await withSpinner(_0x1f13b3(0x102)+_0x2e5726+_0x1f13b3(0xef),()=>_0x86e95a[_0x1f13b3(0xe1)]['resolveParentId'](_0x2e5726),{'verbose':_0x53cda3['verbose']}),_0x1002c1=_0x1eddb9['data'];_0x53cda3['verbose']&&console[_0x1f13b3(0xda)]('Resolved\x20parent\x20ID:\x20'+_0x1002c1);let _0x464b10;if(!_0x54aa14){const _0x217849=await withSpinner(_0x1f13b3(0xdd)+_0x2e5726+_0x1f13b3(0xef),()=>_0x86e95a[_0x1f13b3(0xe1)]['getParentSQL'](_0x1002c1),{'verbose':_0x53cda3[_0x1f13b3(0x119)]});_0x464b10=_0x217849['data'];}else{const _0x1251a2=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x54aa14+_0x1f13b3(0xef),()=>_0x86e95a[_0x1f13b3(0xe1)]['resolveSegmentId'](_0x1002c1,_0x54aa14),{'verbose':_0x53cda3[_0x1f13b3(0x119)]}),_0x5aa44e=_0x1251a2[_0x1f13b3(0xf9)];_0x53cda3[_0x1f13b3(0x119)]&&console[_0x1f13b3(0xda)](_0x1f13b3(0x10e)+_0x5aa44e);const _0x31d752=await withSpinner(_0x1f13b3(0x113)+_0x54aa14+_0x1f13b3(0xef),()=>_0x86e95a[_0x1f13b3(0xe1)][_0x1f13b3(0xf2)](_0x1002c1,_0x5aa44e),{'verbose':_0x53cda3['verbose']});_0x464b10=_0x31d752[_0x1f13b3(0xf9)];}const _0x579e3a=_0x53cda3[_0x1f13b3(0xec)],_0x59e87b=/\bLIMIT\s+\d+/i[_0x1f13b3(0x122)](_0x464b10);!_0x59e87b&&(_0x464b10=_0x464b10[_0x1f13b3(0x11a)]()[_0x1f13b3(0x129)](/;+$/,''),_0x464b10=_0x1f13b3(0x11f)+_0x464b10+_0x1f13b3(0x115)+_0x579e3a);_0x53cda3[_0x1f13b3(0x119)]&&console[_0x1f13b3(0xda)](_0x1f13b3(0x10d)+_0x464b10);const _0x1a6881=await withQuerySpinner(_0x1f13b3(0xf4),async _0x4d8b6d=>{const _0x346906=_0x1f13b3,_0x161780=await _0x86e95a[_0x346906(0xe7)](_0x464b10,{'catalog':'td','schema':'information_schema','onJobId':_0x4c834b=>{const _0x18adb9=_0x346906;_0x4d8b6d[_0x18adb9(0xed)](_0x4c834b);}});return _0x161780;},{'verbose':_0x53cda3[_0x1f13b3(0x119)]}),_0x5e6877=_0x1a6881['data'],_0x20b54a=_0x5e6877['jobId']?'\x20[Job\x20ID:\x20'+_0x5e6877['jobId']+']':'';return console[_0x1f13b3(0xda)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x5e6877[_0x1f13b3(0xf6)][_0x1f13b3(0xe0)]['toLocaleString']()+_0x1f13b3(0x112)+(_0x1f13b3(0xeb)+formatElapsed(_0x5e6877[_0x1f13b3(0xf6)][_0x1f13b3(0x105)])+_0x20b54a)),await handleQueryOutput(_0x5e6877,_0x53cda3),0x0;}catch(_0x147dd3){if(_0x147dd3 instanceof SDKError)return console[_0x1f13b3(0xda)](_0x1f13b3(0x110)+_0x147dd3[_0x1f13b3(0xf1)]+']'),console['error']('\x0a'+_0x147dd3[_0x1f13b3(0x109)]),0x1;throw _0x147dd3;}}}function a20_0x583a(_0x57f9c3,_0x379e37){const _0x2ecfe2=a20_0x2ecf();return a20_0x583a=function(_0x583a83,_0x2a6cb){_0x583a83=_0x583a83-0xda;let _0x2477e7=_0x2ecfe2[_0x583a83];return _0x2477e7;},a20_0x583a(_0x57f9c3,_0x379e37);}function a20_0x2ecf(){const _0x533c96=['Show\x20parent\x20or\x20child\x20segment\x20details','3153360ViJHmV','Usage:\x20tdx\x20segment\x20show\x20<parent_name>\x20or\x20<parent_name/child_name>','query','Error:\x20Folder\x20reference\x20is\x20required','2431gwwvAu','Fetching\x20folder\x20\x27','in\x20','limit','setJobId','674ydluYA','\x27...','Resolving\x20child\x20segment\x20\x27','code','getSegmentSQL','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Executing\x20segment\x20query...','format','stats','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','name','data','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Segment\x20name\x20is\x20required','length','615625zwqWxb','Resolved\x20folder\x20ID:\x20','log','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolving\x20parent\x20segment\x20\x27','segment:show','Parent\x20name:\x20','elapsedTimeMillis','jsonl','Resolved\x20parent\x20ID:\x20','Error:\x20','message','171297HjtPvc','\x20\x20Cause:\x20','description','SQL\x20query:\x0a','Resolved\x20child\x20ID:\x20','14RiCGsj','✖\x20Query\x20failed\x20[','json','\x20rows\x20','Fetching\x20SQL\x20for\x20segment\x20\x27','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Child\x20name:\x20','Show\x20segment\x20folder\x20details','getSegment','verbose','trim','236664JMpJmp','resolveSegmentId','Site:\x20','6384912JHYDTk','SELECT\x20*\x20FROM\x20(\x0a','Folder\x20name:\x20','site','test','getFolder','execute','cause','Listing\x20folders\x20for\x20parent\x20\x27','125EWUnUx','resolveFolderId','replace','4668zUhRgk','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','error','resolveParentId','Usage:\x20tdx\x20segment\x20sql\x20<parent_name>\x20or\x20<parent_name/child_name>','Fetching\x20SQL\x20for\x20parent\x20\x27','170mLcqcr','66948VGOSGv','processedRows','segment','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Usage:\x20tdx\x20segment\x20describe\x20<parent_name>\x20or\x20<parent_name/child_name>'];a20_0x2ecf=function(){return _0x533c96;};return a20_0x2ecf();}export class SegmentFolderListCommand extends BaseCommand{[a20_0x10f175(0xf8)]=a20_0x10f175(0xfa);[a20_0x10f175(0x10c)]=a20_0x10f175(0x114);async[a20_0x10f175(0x124)](_0x153d5d){const _0x49eafa=a20_0x10f175,{options:_0x1ac03c,args:_0x4aa631,tdx:_0x84d5ef}=_0x153d5d;if(_0x4aa631[_0x49eafa(0xfd)]===0x0)return console[_0x49eafa(0xda)](_0x49eafa(0x101)),console[_0x49eafa(0xda)](_0x49eafa(0xfb)),0x1;const _0x44116b=_0x4aa631[0x0];try{_0x1ac03c[_0x49eafa(0x119)]&&(console[_0x49eafa(0xda)](_0x49eafa(0x11d)+_0x1ac03c[_0x49eafa(0x121)]),console[_0x49eafa(0xda)]('Parent\x20name:\x20'+_0x44116b));const _0x1c721e=await withSpinner(_0x49eafa(0x102)+_0x44116b+_0x49eafa(0xef),()=>_0x84d5ef['segment']['resolveParentId'](_0x44116b),{'verbose':_0x1ac03c[_0x49eafa(0x119)]}),_0x507d8c=_0x1c721e[_0x49eafa(0xf9)];_0x1ac03c[_0x49eafa(0x119)]&&console[_0x49eafa(0xda)]('Resolved\x20parent\x20ID:\x20'+_0x507d8c);const _0x129a1d=await withSpinner(_0x49eafa(0x126)+_0x44116b+_0x49eafa(0xef),()=>_0x84d5ef[_0x49eafa(0xe1)]['listFolders'](_0x507d8c),{'verbose':_0x1ac03c[_0x49eafa(0x119)]}),_0x3e1dad=_0x129a1d[_0x49eafa(0xf9)];return console[_0x49eafa(0xda)]('✔\x20Found\x20'+_0x3e1dad[_0x49eafa(0xfd)]+'\x20folder'+(_0x3e1dad[_0x49eafa(0xfd)]!==0x1?'s':'')),await handleSDKOutput(_0x3e1dad,_0x1ac03c),0x0;}catch(_0x39b35f){if(_0x39b35f instanceof SDKError)return console['error'](_0x49eafa(0x108)+_0x39b35f[_0x49eafa(0x109)]),_0x39b35f['cause']&&console[_0x49eafa(0xda)]('\x20\x20Cause:\x20'+_0x39b35f[_0x49eafa(0x125)]),0x1;throw _0x39b35f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a20_0x10f175(0xf8)]='segment:folder:show';[a20_0x10f175(0x10c)]=a20_0x10f175(0x117);async[a20_0x10f175(0x124)](_0x412d7f){const _0x1093c1=a20_0x10f175,{options:_0x36f56b,args:_0x20b005,tdx:_0x52a81e}=_0x412d7f;if(_0x20b005['length']===0x0)return console[_0x1093c1(0xda)](_0x1093c1(0xe8)),console[_0x1093c1(0xda)](_0x1093c1(0xe2)),0x1;try{const {parentId:_0x66cd9a,childId:_0xba13ca}=parseSegmentRef(_0x20b005[0x0]);_0x36f56b['verbose']&&(console['error'](_0x1093c1(0x11d)+_0x36f56b[_0x1093c1(0x121)]),console[_0x1093c1(0xda)](_0x1093c1(0x104)+_0x66cd9a),_0xba13ca&&console['error'](_0x1093c1(0x120)+_0xba13ca));if(!_0xba13ca)return console['error'](_0x1093c1(0xf3)),0x1;const _0x46528d=await withSpinner(_0x1093c1(0x102)+_0x66cd9a+_0x1093c1(0xef),()=>_0x52a81e[_0x1093c1(0xe1)][_0x1093c1(0xdb)](_0x66cd9a),{'verbose':_0x36f56b[_0x1093c1(0x119)]}),_0xc2f9f1=_0x46528d[_0x1093c1(0xf9)];_0x36f56b['verbose']&&console[_0x1093c1(0xda)](_0x1093c1(0x107)+_0xc2f9f1);const _0x496cd1=await withSpinner('Resolving\x20folder\x20\x27'+_0xba13ca+_0x1093c1(0xef),()=>_0x52a81e[_0x1093c1(0xe1)][_0x1093c1(0x128)](_0xc2f9f1,_0xba13ca),{'verbose':_0x36f56b[_0x1093c1(0x119)]}),_0x5aff3f=_0x496cd1[_0x1093c1(0xf9)];_0x36f56b[_0x1093c1(0x119)]&&console['error'](_0x1093c1(0xff)+_0x5aff3f);const _0x3f2211=await withSpinner(_0x1093c1(0xea)+_0xba13ca+'\x27...',()=>_0x52a81e['segment'][_0x1093c1(0x123)](_0x5aff3f),{'verbose':_0x36f56b[_0x1093c1(0x119)]});return await handleSDKOutput([_0x3f2211[_0x1093c1(0xf9)]],_0x36f56b),0x0;}catch(_0x404f94){if(_0x404f94 instanceof SDKError)return console[_0x1093c1(0xda)](_0x1093c1(0x108)+_0x404f94[_0x1093c1(0x109)]),_0x404f94['cause']&&console[_0x1093c1(0xda)]('\x20\x20Cause:\x20'+_0x404f94[_0x1093c1(0x125)]),0x1;throw _0x404f94;}}}export class SegmentSQLCommand extends BaseCommand{[a20_0x10f175(0xf8)]='segment:sql';[a20_0x10f175(0x10c)]=a20_0x10f175(0xf7);async[a20_0x10f175(0x124)](_0x2d8f3a){const _0x6adddc=a20_0x10f175,{options:_0xafdd12,args:_0x1e23c7,tdx:_0x47dced}=_0x2d8f3a;if(_0x1e23c7[_0x6adddc(0xfd)]===0x0)return console[_0x6adddc(0xda)](_0x6adddc(0xfc)),console[_0x6adddc(0xda)](_0x6adddc(0xdc)),0x1;try{const {parentId:_0x524a5b,childId:_0x32f8c9}=parseSegmentRef(_0x1e23c7[0x0]);_0xafdd12[_0x6adddc(0x119)]&&(console[_0x6adddc(0xda)](_0x6adddc(0x11d)+_0xafdd12[_0x6adddc(0x121)]),console[_0x6adddc(0xda)]('Parent\x20name:\x20'+_0x524a5b),_0x32f8c9&&console['error']('Child\x20name:\x20'+_0x32f8c9));const _0x1b8e28=await withSpinner(_0x6adddc(0x102)+_0x524a5b+'\x27...',()=>_0x47dced['segment'][_0x6adddc(0xdb)](_0x524a5b),{'verbose':_0xafdd12[_0x6adddc(0x119)]}),_0x183429=_0x1b8e28[_0x6adddc(0xf9)];_0xafdd12['verbose']&&console['error'](_0x6adddc(0x107)+_0x183429);let _0x4c5ee3;if(!_0x32f8c9){const _0x357b91=await withSpinner(_0x6adddc(0xdd)+_0x524a5b+_0x6adddc(0xef),()=>_0x47dced[_0x6adddc(0xe1)]['getParentSQL'](_0x183429),{'verbose':_0xafdd12[_0x6adddc(0x119)]});_0x4c5ee3=_0x357b91[_0x6adddc(0xf9)];}else{const _0x587910=await withSpinner(_0x6adddc(0xf0)+_0x32f8c9+'\x27...',()=>_0x47dced['segment']['resolveSegmentId'](_0x183429,_0x32f8c9),{'verbose':_0xafdd12['verbose']}),_0x20e4ef=_0x587910[_0x6adddc(0xf9)];_0xafdd12[_0x6adddc(0x119)]&&console['error'](_0x6adddc(0x10e)+_0x20e4ef);const _0x3429fd=await withSpinner('Fetching\x20SQL\x20for\x20segment\x20\x27'+_0x32f8c9+'\x27...',()=>_0x47dced['segment'][_0x6adddc(0xf2)](_0x183429,_0x20e4ef),{'verbose':_0xafdd12[_0x6adddc(0x119)]});_0x4c5ee3=_0x3429fd[_0x6adddc(0xf9)];}return _0xafdd12['format']===_0x6adddc(0x111)||_0xafdd12[_0x6adddc(0xf5)]===_0x6adddc(0x106)?await handleSDKOutput([{'sql':_0x4c5ee3}],_0xafdd12):console[_0x6adddc(0x100)](_0x4c5ee3),0x0;}catch(_0x33915c){if(_0x33915c instanceof SDKError)return console['error'](_0x6adddc(0x108)+_0x33915c[_0x6adddc(0x109)]),_0x33915c[_0x6adddc(0x125)]&&console[_0x6adddc(0xda)](_0x6adddc(0x10b)+_0x33915c[_0x6adddc(0x125)]),0x1;throw _0x33915c;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x206d0c=a21_0x29ee;(function(_0x51eca4,_0x548964){const _0x5af0b0=a21_0x29ee,_0x249bd7=_0x51eca4();while(!![]){try{const _0x45858e=parseInt(_0x5af0b0(0x1b2))/0x1*(parseInt(_0x5af0b0(0x1d0))/0x2)+parseInt(_0x5af0b0(0x1b7))/0x3*(-parseInt(_0x5af0b0(0x1d2))/0x4)+parseInt(_0x5af0b0(0x1c4))/0x5+parseInt(_0x5af0b0(0x1bc))/0x6*(parseInt(_0x5af0b0(0x1c3))/0x7)+-parseInt(_0x5af0b0(0x1ca))/0x8+-parseInt(_0x5af0b0(0x1b8))/0x9+parseInt(_0x5af0b0(0x1c5))/0xa*(-parseInt(_0x5af0b0(0x1d1))/0xb);if(_0x45858e===_0x548964)break;else _0x249bd7['push'](_0x249bd7['shift']());}catch(_0x255c99){_0x249bd7['push'](_0x249bd7['shift']());}}}(a21_0x3929,0x9afd9));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a21_0x3929(){const _0x1b843c=['Error:\x20','population','\x20segment','3yJfGBj','description','Listing\x20segments\x20for\x20parent\x20\x27','map','error','9375hKuEvn','1320930kISWLm','message','\x20parent\x20segment','\x27...','49386UwGfLg','listParents','site','Site:\x20','Resolving\x20parent\x20segment\x20\x27','segment','Listing\x20parent\x20segments...','847WpKqgu','3200200nsivPy','12650MDLMMF','cause','segments','updatedAt','Parent\x20name:\x20','2173616SDeHMs','attributes','createdAt','data','✔\x20Found\x20','resolveParentId','219838CNtFaV','869gyznzi','1040fpDGFb','length','\x20\x20Cause:\x20','verbose'];a21_0x3929=function(){return _0x1b843c;};return a21_0x3929();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a21_0x29ee(_0x50b438,_0x28f283){const _0x39292e=a21_0x3929();return a21_0x29ee=function(_0x29ee9d,_0x1ce4a8){_0x29ee9d=_0x29ee9d-0x1b0;let _0x2d7034=_0x39292e[_0x29ee9d];return _0x2d7034;},a21_0x29ee(_0x50b438,_0x28f283);}export class SegmentsCommand extends BaseCommand{['name']=a21_0x206d0c(0x1c7);['description']='List\x20parent\x20segments\x20or\x20child\x20segments';async['execute'](_0x57203c){const _0x124602=a21_0x206d0c,{options:_0x5d6b59,args:_0x32f1b7,tdx:_0x581be2}=_0x57203c,_0x261926=_0x32f1b7[0x0];try{_0x5d6b59[_0x124602(0x1d5)]&&(console['error'](_0x124602(0x1bf)+_0x5d6b59[_0x124602(0x1be)]),_0x261926&&console['error'](_0x124602(0x1c9)+_0x261926));if(!_0x261926){const _0x4ce0ec=await withSpinner(_0x124602(0x1c2),()=>_0x581be2[_0x124602(0x1c1)][_0x124602(0x1bd)](),{'verbose':_0x5d6b59[_0x124602(0x1d5)]}),_0xe237de=_0x4ce0ec[_0x124602(0x1cd)];console[_0x124602(0x1b6)]('✔\x20Found\x20'+_0xe237de[_0x124602(0x1d3)]+_0x124602(0x1ba)+(_0xe237de[_0x124602(0x1d3)]!==0x1?'s':''));const _0x3ce526=_0xe237de[_0x124602(0x1b5)](_0x48fd4e=>({'id':_0x48fd4e['id'],'name':_0x48fd4e['attributes']['name'],'description':_0x48fd4e[_0x124602(0x1cb)][_0x124602(0x1b3)],'population':_0x48fd4e['attributes'][_0x124602(0x1b0)],'createdAt':_0x48fd4e['attributes'][_0x124602(0x1cc)],'updatedAt':_0x48fd4e[_0x124602(0x1cb)][_0x124602(0x1c8)]}));await handleSDKOutput(_0x3ce526,_0x5d6b59);}else{const _0x1a3cc8=await withSpinner(_0x124602(0x1c0)+_0x261926+_0x124602(0x1bb),()=>_0x581be2[_0x124602(0x1c1)][_0x124602(0x1cf)](_0x261926),{'verbose':_0x5d6b59['verbose']}),_0x5958df=_0x1a3cc8['data'];_0x5d6b59['verbose']&&console[_0x124602(0x1b6)]('Resolved\x20parent\x20ID:\x20'+_0x5958df);const _0x4dba23=await withSpinner(_0x124602(0x1b4)+_0x261926+_0x124602(0x1bb),()=>_0x581be2[_0x124602(0x1c1)]['listSegments'](_0x5958df),{'verbose':_0x5d6b59[_0x124602(0x1d5)]}),_0x3f31ee=_0x4dba23[_0x124602(0x1cd)];console['error'](_0x124602(0x1ce)+_0x3f31ee[_0x124602(0x1d3)]+_0x124602(0x1b1)+(_0x3f31ee['length']!==0x1?'s':''));const _0x22a29b=_0x3f31ee[_0x124602(0x1b5)](_0x5f569e=>({'id':_0x5f569e['id'],'name':_0x5f569e['name'],'description':_0x5f569e[_0x124602(0x1b3)],'population':_0x5f569e[_0x124602(0x1b0)],'createdAt':_0x5f569e[_0x124602(0x1cc)],'updatedAt':_0x5f569e[_0x124602(0x1c8)]}));await handleSDKOutput(_0x22a29b,_0x5d6b59);}return 0x0;}catch(_0x4541a7){if(_0x4541a7 instanceof SDKError)return console[_0x124602(0x1b6)](_0x124602(0x1d6)+_0x4541a7[_0x124602(0x1b9)]),_0x4541a7[_0x124602(0x1c6)]&&console[_0x124602(0x1b6)](_0x124602(0x1d4)+_0x4541a7[_0x124602(0x1c6)]),0x1;throw _0x4541a7;}}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a22_0x13ef(){const _0x32df7f=['1049523OANEWi','database','Usage:\x20tdx\x20show\x20<database.table>','86514Ogrtbi','...','verbose','Error:\x20','Table:\x20','error','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Retrieved\x20','Show\x20table\x20contents','1315cxFvUz','showTable','execute','name','Catalog:\x20','\x20from\x20','catalog','2020224FeTihz','20426922NBiulr','\x20\x20Cause:\x20','message','7026999pjTHzX','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Limit:\x20','description','show','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','table','Database:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','588IXFXeq','validate','Site:\x20','limit','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','length','site','cause','5653096qsPRkr','8OKHOxk','data'];a22_0x13ef=function(){return _0x32df7f;};return a22_0x13ef();}const a22_0x8677e8=a22_0x46ff;(function(_0x154281,_0x4b143c){const _0x5ef9fd=a22_0x46ff,_0x20fa20=_0x154281();while(!![]){try{const _0xf9608=-parseInt(_0x5ef9fd(0x15a))/0x1*(-parseInt(_0x5ef9fd(0x155))/0x2)+parseInt(_0x5ef9fd(0x157))/0x3+parseInt(_0x5ef9fd(0x177))/0x4*(parseInt(_0x5ef9fd(0x163))/0x5)+parseInt(_0x5ef9fd(0x16a))/0x6+parseInt(_0x5ef9fd(0x16e))/0x7+parseInt(_0x5ef9fd(0x154))/0x8+-parseInt(_0x5ef9fd(0x16b))/0x9;if(_0xf9608===_0x4b143c)break;else _0x20fa20['push'](_0x20fa20['shift']());}catch(_0x5c04b1){_0x20fa20['push'](_0x20fa20['shift']());}}}(a22_0x13ef,0x7d062));import{BaseCommand}from'./command.js';function a22_0x46ff(_0x29f97a,_0xa13552){const _0x13ef26=a22_0x13ef();return a22_0x46ff=function(_0x46ffb8,_0x42d453){_0x46ffb8=_0x46ffb8-0x154;let _0x17c845=_0x13ef26[_0x46ffb8];return _0x17c845;},a22_0x46ff(_0x29f97a,_0xa13552);}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 ShowCommand extends BaseCommand{[a22_0x8677e8(0x166)]=a22_0x8677e8(0x172);[a22_0x8677e8(0x171)]=a22_0x8677e8(0x162);async[a22_0x8677e8(0x165)](_0x554647){const _0x6ccada=a22_0x8677e8;return this[_0x6ccada(0x164)](_0x554647);}async[a22_0x8677e8(0x164)](_0x470d66){const _0x2160b0=a22_0x8677e8,{options:_0x430bf9,args:_0x30c38f,tdx:_0x2166e1}=_0x470d66;let _0x203eae;try{_0x203eae=parseTableReference(_0x30c38f[0x0]);const _0x328b64=_0x430bf9[_0x2160b0(0x158)];!_0x203eae[_0x2160b0(0x158)]&&_0x328b64&&(_0x203eae[_0x2160b0(0x158)]=_0x328b64);const _0x1b1903=validateTableDescribeReference(_0x203eae);if(_0x1b1903)return console[_0x2160b0(0x15f)](_0x2160b0(0x15d)+_0x1b1903),console[_0x2160b0(0x15f)](_0x2160b0(0x159)),console[_0x2160b0(0x15f)](_0x2160b0(0x17b)),console[_0x2160b0(0x15f)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x136a16){return console['error'](_0x2160b0(0x15d)+_0x136a16[_0x2160b0(0x16d)]),console['error'](_0x2160b0(0x159)),console['error'](_0x2160b0(0x17b)),console[_0x2160b0(0x15f)](_0x2160b0(0x160)),0x1;}const _0x34c034=_0x203eae[_0x2160b0(0x169)],_0x10790a=_0x203eae[_0x2160b0(0x158)],_0xfcd19d=_0x203eae[_0x2160b0(0x174)],_0x42cf6b=_0x430bf9[_0x2160b0(0x17a)];try{_0x430bf9[_0x2160b0(0x15c)]&&(console['error'](_0x2160b0(0x179)+_0x430bf9[_0x2160b0(0x17d)]),_0x34c034&&console[_0x2160b0(0x15f)](_0x2160b0(0x167)+_0x34c034),console[_0x2160b0(0x15f)](_0x2160b0(0x175)+_0x10790a),console[_0x2160b0(0x15f)](_0x2160b0(0x15e)+_0xfcd19d),console[_0x2160b0(0x15f)](_0x2160b0(0x170)+_0x42cf6b));const _0x5263ab=_0x34c034?_0x34c034+'.'+_0x10790a+'.'+_0xfcd19d:_0x10790a+'.'+_0xfcd19d,_0x2d010e=await withSpinner('Querying\x20'+_0x5263ab+_0x2160b0(0x15b),()=>_0x2166e1[_0x2160b0(0x174)]['show'](_0x10790a,_0xfcd19d,_0x42cf6b,_0x34c034),{'verbose':_0x430bf9[_0x2160b0(0x15c)]}),_0x22f117=_0x2d010e[_0x2160b0(0x156)],_0x2055ba=_0x22f117[_0x2160b0(0x156)];return _0x2055ba['length']===0x0?console[_0x2160b0(0x15f)](_0x2160b0(0x176)):console[_0x2160b0(0x15f)](_0x2160b0(0x161)+_0x2055ba['length']+'\x20row'+(_0x2055ba[_0x2160b0(0x17c)]!==0x1?'s':'')+_0x2160b0(0x168)+_0x5263ab),await handleSDKOutput(_0x2055ba,_0x430bf9),0x0;}catch(_0x52e388){if(_0x52e388 instanceof SDKError)return console['error'](_0x2160b0(0x15d)+_0x52e388[_0x2160b0(0x16d)]),_0x52e388[_0x2160b0(0x17e)]&&console[_0x2160b0(0x15f)](_0x2160b0(0x16c)+_0x52e388['cause']),0x1;throw _0x52e388;}}[a22_0x8677e8(0x178)](_0x3b484d){const _0x5d7a04=a22_0x8677e8;if(_0x3b484d['args'][_0x5d7a04(0x17c)]===0x0)return _0x5d7a04(0x173);if(_0x3b484d['args'][_0x5d7a04(0x17c)]>0x1)return _0x5d7a04(0x16f);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a23_0x296c(_0x40d21e,_0x404b45){const _0x50dab5=a23_0x50da();return a23_0x296c=function(_0x296cc3,_0x4efbda){_0x296cc3=_0x296cc3-0x16d;let _0x347ba6=_0x50dab5[_0x296cc3];return _0x347ba6;},a23_0x296c(_0x40d21e,_0x404b45);}function a23_0x50da(){const _0x3c0f0a=['error','cause','2724318uQZcSK','872796fqjzPl','Database\x20\x27','19880zLJKTd','message','site','list','Note:\x20\x27','Database\x20pattern:\x20','582992lMAYlf','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Error:\x20','length','List\x20tables\x20in\x20a\x20database','.*\x22','Error:\x20Pattern\x20\x27','execute','\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x27\x20across\x20all\x20databases.','324242FoLdhd','✔\x20Found\x20','462948fxrwqp','description','database','tables','table','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','5trCjaX','includes','verbose','\x20table','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','102519arucsq','Or\x20use\x20--in\x20flag:','Database:\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','Table\x20pattern:\x20','✖\x20No\x20tables\x20found','validate'];a23_0x50da=function(){return _0x3c0f0a;};return a23_0x50da();}const a23_0x31e6f9=a23_0x296c;(function(_0x20648c,_0x5923de){const _0x5cf4c3=a23_0x296c,_0x28d78b=_0x20648c();while(!![]){try{const _0x5a2695=parseInt(_0x5cf4c3(0x17d))/0x1+parseInt(_0x5cf4c3(0x16f))/0x2+parseInt(_0x5cf4c3(0x171))/0x3+parseInt(_0x5cf4c3(0x188))/0x4+-parseInt(_0x5cf4c3(0x177))/0x5*(parseInt(_0x5cf4c3(0x187))/0x6)+-parseInt(_0x5cf4c3(0x18a))/0x7+parseInt(_0x5cf4c3(0x190))/0x8;if(_0x5a2695===_0x5923de)break;else _0x28d78b['push'](_0x28d78b['shift']());}catch(_0x316973){_0x28d78b['push'](_0x28d78b['shift']());}}}(a23_0x50da,0x3dcd0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{['name']=a23_0x31e6f9(0x174);[a23_0x31e6f9(0x172)]=a23_0x31e6f9(0x194);async[a23_0x31e6f9(0x197)](_0x13f938){const _0x10cc8e=a23_0x31e6f9,{options:_0x501f79,args:_0x36884a,tdx:_0x219874}=_0x13f938;let _0xd92660;if(_0x36884a[_0x10cc8e(0x193)]===0x0)_0xd92660={'database':undefined,'table':undefined,'original':''};else{if(_0x36884a[_0x10cc8e(0x193)]===0x1)try{_0xd92660=parseTableReference(_0x36884a[0x0]);if(_0xd92660[_0x10cc8e(0x175)]&&!_0xd92660[_0x10cc8e(0x173)]&&!_0xd92660['table'][_0x10cc8e(0x178)]('*')&&!_0xd92660[_0x10cc8e(0x175)]['includes']('?'))return console['error'](_0x10cc8e(0x196)+_0x36884a[0x0]+_0x10cc8e(0x198)),console[_0x10cc8e(0x185)](_0x10cc8e(0x17c)+_0xd92660[_0x10cc8e(0x175)]+'\x27?'),console['error'](_0x10cc8e(0x180)+_0xd92660[_0x10cc8e(0x175)]+_0x10cc8e(0x195)),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0xd92660['table']),console[_0x10cc8e(0x185)](_0x10cc8e(0x176)+_0xd92660[_0x10cc8e(0x175)]),console[_0x10cc8e(0x185)](''),console['error'](_0x10cc8e(0x18e)+_0x36884a[0x0]+_0x10cc8e(0x191)+_0xd92660[_0x10cc8e(0x175)]+_0x10cc8e(0x16e)),0x1;}catch(_0x6ddfc2){return console[_0x10cc8e(0x185)]('Error:\x20'+_0x6ddfc2[_0x10cc8e(0x18b)]),0x1;}else return console[_0x10cc8e(0x185)](_0x10cc8e(0x17b)),console[_0x10cc8e(0x185)](_0x10cc8e(0x199)),console[_0x10cc8e(0x185)](_0x10cc8e(0x16d)),console['error'](_0x10cc8e(0x181)),console[_0x10cc8e(0x185)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x10cc8e(0x185)](_0x10cc8e(0x17e)),console[_0x10cc8e(0x185)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x4f1cd3=_0x501f79[_0x10cc8e(0x173)];!_0xd92660[_0x10cc8e(0x173)]&&_0x4f1cd3&&(_0xd92660[_0x10cc8e(0x173)]=_0x4f1cd3);try{const _0x52f0ab=_0x94ec2d=>_0x94ec2d&&(_0x94ec2d['includes']('*')||_0x94ec2d[_0x10cc8e(0x178)]('?')),_0x34fd26=_0x52f0ab(_0xd92660['database']);_0x501f79['verbose']&&(console['error']('Site:\x20'+_0x501f79[_0x10cc8e(0x18c)]),_0xd92660[_0x10cc8e(0x173)]?_0x34fd26?console['error'](_0x10cc8e(0x18f)+_0xd92660[_0x10cc8e(0x173)]):console['error'](_0x10cc8e(0x17f)+_0xd92660[_0x10cc8e(0x173)]):console[_0x10cc8e(0x185)]('Database:\x20all'),_0xd92660[_0x10cc8e(0x175)]&&console['error'](_0x10cc8e(0x182)+_0xd92660[_0x10cc8e(0x175)]));const _0x2148e5=_0xd92660[_0x10cc8e(0x173)]&&!_0x34fd26?_0xd92660[_0x10cc8e(0x173)]:undefined,_0x3c9c17=_0x34fd26?_0xd92660[_0x10cc8e(0x173)]:undefined,_0x2519d8=_0xd92660[_0x10cc8e(0x175)],_0x3fb9c3=await withSpinner('Listing\x20tables...',()=>_0x219874[_0x10cc8e(0x175)][_0x10cc8e(0x18d)](_0x2148e5,_0x2519d8,_0x3c9c17),{'verbose':_0x501f79[_0x10cc8e(0x179)]}),_0x43bc83=_0x3fb9c3['data'];if(_0x43bc83[_0x10cc8e(0x193)]===0x0&&_0xd92660['database']&&!_0x34fd26)return console[_0x10cc8e(0x185)](_0x10cc8e(0x183)),console[_0x10cc8e(0x185)](_0x10cc8e(0x189)+_0xd92660[_0x10cc8e(0x173)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console['error'](_0x10cc8e(0x170)+_0x43bc83[_0x10cc8e(0x193)]+_0x10cc8e(0x17a)+(_0x43bc83[_0x10cc8e(0x193)]!==0x1?'s':'')),await handleSDKOutput(_0x43bc83,_0x501f79),0x0;}catch(_0x518245){if(_0x518245 instanceof SDKError)return console[_0x10cc8e(0x185)](_0x10cc8e(0x192)+_0x518245['message']),_0x518245[_0x10cc8e(0x186)]&&console[_0x10cc8e(0x185)]('\x20\x20Cause:\x20'+_0x518245[_0x10cc8e(0x186)]),0x1;throw _0x518245;}}[a23_0x31e6f9(0x184)](_0x223b9a){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x2d4365=a24_0x2121;(function(_0x6defa7,_0x8d15b){const _0x2616be=a24_0x2121,_0x4eba6e=_0x6defa7();while(!![]){try{const _0x194709=-parseInt(_0x2616be(0x20d))/0x1+-parseInt(_0x2616be(0x1fd))/0x2*(parseInt(_0x2616be(0x1f9))/0x3)+-parseInt(_0x2616be(0x20f))/0x4+-parseInt(_0x2616be(0x1fb))/0x5*(-parseInt(_0x2616be(0x219))/0x6)+parseInt(_0x2616be(0x205))/0x7*(parseInt(_0x2616be(0x20a))/0x8)+-parseInt(_0x2616be(0x1f7))/0x9+-parseInt(_0x2616be(0x217))/0xa*(-parseInt(_0x2616be(0x20e))/0xb);if(_0x194709===_0x8d15b)break;else _0x4eba6e['push'](_0x4eba6e['shift']());}catch(_0x351581){_0x4eba6e['push'](_0x4eba6e['shift']());}}}(a24_0x1b15,0x1ff75));function a24_0x2121(_0x22aee7,_0x2a219b){const _0x1b1533=a24_0x1b15();return a24_0x2121=function(_0x212123,_0x42d614){_0x212123=_0x212123-0x1f2;let _0x292939=_0x1b1533[_0x212123];return _0x292939;},a24_0x2121(_0x22aee7,_0x2a219b);}function a24_0x1b15(){const _0x3c75bd=['length','Error:\x20','includes','database','594297nRcvJl','message','6icjbWH','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','230810LzaaNr','toString','252892eliHzG','.\x20Must\x20be\x20one\x20of:\x20','Session\x20llm_project\x20set\x20to:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','error','Invalid\x20resource:\x20','description','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','26782OzDaov','Error:\x20Profile\x20\x27','execute','Set\x20session-level\x20context','validate','472WjaUbw','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','name','161369CPPgIz','121JpIkTF','225576FDnnyd','parent_segment','session','\x27\x20does\x20not\x20exist','profile','llm_project','join','\x20(session:\x20','359750qLvKuo','Session\x20parent_segment\x20set\x20to:\x20','6loTddj','Session\x20database\x20set\x20to:\x20','log'];a24_0x1b15=function(){return _0x3c75bd;};return a24_0x1b15();}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a24_0x2d4365(0x20c)]='use';[a24_0x2d4365(0x203)]=a24_0x2d4365(0x208);[a24_0x2d4365(0x209)](_0x138877){const _0x5e414f=a24_0x2d4365,{args:_0x5b85d5}=_0x138877;if(_0x5b85d5[_0x5e414f(0x1f3)]<0x2)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x5e414f(0x200)+'Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a'+_0x5e414f(0x20b);const _0x4be547=_0x5b85d5[0x0],_0x1410ba=[_0x5e414f(0x1f6),_0x5e414f(0x210),_0x5e414f(0x214),_0x5e414f(0x213)];if(!_0x1410ba[_0x5e414f(0x1f5)](_0x4be547))return _0x5e414f(0x202)+_0x4be547+_0x5e414f(0x1fe)+_0x1410ba[_0x5e414f(0x215)](',\x20');return undefined;}async[a24_0x2d4365(0x207)](_0x2c4bfa){const _0x47ae5c=a24_0x2d4365,{args:_0x51f40d,options:_0x5e624f}=_0x2c4bfa;try{const _0x455de3=_0x51f40d[0x0],_0x2fa497=_0x51f40d[0x1];if(_0x455de3===_0x47ae5c(0x213)){if(!profileExists(_0x2fa497))return console[_0x47ae5c(0x201)](_0x47ae5c(0x206)+_0x2fa497+_0x47ae5c(0x212)),console['error'](_0x47ae5c(0x1fa)),0x1;const _0x45a18b=_0x5e624f[_0x47ae5c(0x211)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x2fa497},_0x5e624f[_0x47ae5c(0x211)]),console[_0x47ae5c(0x1f2)]('Session\x20profile\x20set\x20to:\x20'+_0x2fa497+_0x47ae5c(0x216)+_0x45a18b+')'),console[_0x47ae5c(0x1f2)](_0x47ae5c(0x204)),0x0;}const _0xaadab1={},_0x8dda65=_0x5e624f['session']||getCurrentSessionPID()[_0x47ae5c(0x1fc)]();switch(_0x455de3){case _0x47ae5c(0x1f6):_0xaadab1['database']=_0x2fa497,console[_0x47ae5c(0x1f2)](_0x47ae5c(0x21a)+_0x2fa497+_0x47ae5c(0x216)+_0x8dda65+')');break;case _0x47ae5c(0x210):_0xaadab1[_0x47ae5c(0x210)]=_0x2fa497,console[_0x47ae5c(0x1f2)](_0x47ae5c(0x218)+_0x2fa497+_0x47ae5c(0x216)+_0x8dda65+')');break;case _0x47ae5c(0x214):_0xaadab1[_0x47ae5c(0x214)]=_0x2fa497,console['log'](_0x47ae5c(0x1ff)+_0x2fa497+_0x47ae5c(0x216)+_0x8dda65+')');break;}return saveSessionContext(_0xaadab1,_0x5e624f[_0x47ae5c(0x211)]),console[_0x47ae5c(0x1f2)](_0x47ae5c(0x204)),0x0;}catch(_0x22dd26){return _0x22dd26 instanceof Error&&console['error'](_0x47ae5c(0x1f4)+_0x22dd26[_0x47ae5c(0x1f8)]),0x1;}}}
|