@treasuredata/tdx 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +2 -2
- package/dist/cli.js +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.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/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.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.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/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function a16_0xe915(_0x557e13,_0x49354e){const _0x3bdffd=a16_0x3bdf();return a16_0xe915=function(_0xe91597,_0x1bf670){_0xe91597=_0xe91597-0x1b3;let _0x5d695d=_0x3bdffd[_0xe91597];return _0x5d695d;},a16_0xe915(_0x557e13,_0x49354e);}const a16_0x476f74=a16_0xe915;(function(_0x1b3463,_0x37b579){const _0x30f406=a16_0xe915,_0x1994ef=_0x1b3463();while(!![]){try{const _0x10a954=-parseInt(_0x30f406(0x1d0))/0x1*(parseInt(_0x30f406(0x1cd))/0x2)+-parseInt(_0x30f406(0x1fb))/0x3*(parseInt(_0x30f406(0x1d7))/0x4)+parseInt(_0x30f406(0x1d4))/0x5*(-parseInt(_0x30f406(0x1c1))/0x6)+-parseInt(_0x30f406(0x1c7))/0x7+-parseInt(_0x30f406(0x1f7))/0x8*(parseInt(_0x30f406(0x1d1))/0x9)+parseInt(_0x30f406(0x1f0))/0xa*(-parseInt(_0x30f406(0x1e2))/0xb)+parseInt(_0x30f406(0x1e1))/0xc;if(_0x10a954===_0x37b579)break;else _0x1994ef['push'](_0x1994ef['shift']());}catch(_0x13b811){_0x1994ef['push'](_0x1994ef['shift']());}}}(a16_0x3bdf,0x270fe));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a16_0x476f74(0x1de)]=a16_0x476f74(0x1b3);['description']='List\x20jobs';async['execute'](_0x3a5de9){const _0x213867=a16_0x476f74,{options:_0x2587c9,tdx:_0x1db2d8}=_0x3a5de9;try{const _0x2254cd=resolveLimit(_0x2587c9['limit'],DEFAULT_DISPLAY_LIMIT),_0xa21510=_0x2587c9[_0x213867(0x1e8)];_0x2587c9['verbose']&&(console[_0x213867(0x1c4)](_0x213867(0x1d6)+_0x2254cd+_0x213867(0x1e3)),_0xa21510&&console[_0x213867(0x1c4)](_0x213867(0x1bf)+_0xa21510));const _0x462361=await withSpinner(_0x213867(0x1ba),()=>_0x1db2d8['jobs'][_0x213867(0x1e6)]({'from':0x0,'to':_0x2254cd-0x1,'status':_0xa21510}),{'verbose':_0x2587c9[_0x213867(0x200)]}),_0x207be2=_0x462361['data'];console[_0x213867(0x1c4)](_0x213867(0x1f9)+_0x207be2[_0x213867(0x1b7)]+_0x213867(0x1d5)+(_0x207be2[_0x213867(0x1b7)]!==0x1?'s':''));const _0x4a1e8f=_0x207be2[_0x213867(0x1e7)](_0x12a444=>{const _0x24d37a=_0x213867;let _0x2f6f2d;if(_0x12a444[_0x24d37a(0x1bd)]&&_0x12a444[_0x24d37a(0x1ca)]){const _0x3e03a7=new Date(_0x12a444[_0x24d37a(0x1bd)])[_0x24d37a(0x1d9)](),_0x20c1a5=new Date(_0x12a444[_0x24d37a(0x1ca)])[_0x24d37a(0x1d9)]();_0x2f6f2d=Math[_0x24d37a(0x1e9)]((_0x20c1a5-_0x3e03a7)/0x3e8);}return{'job_id':_0x12a444[_0x24d37a(0x1c6)],'type':_0x12a444[_0x24d37a(0x1f3)],'status':_0x12a444[_0x24d37a(0x1e8)],'user_name':_0x12a444[_0x24d37a(0x1da)],'duration_sec':_0x2f6f2d,'created_at':_0x12a444[_0x24d37a(0x1cb)],'started_at':_0x12a444[_0x24d37a(0x1bd)],'end_at':_0x12a444[_0x24d37a(0x1ca)]};});return await handleSDKOutput(_0x4a1e8f,_0x2587c9),0x0;}catch(_0xc0f69d){if(_0xc0f69d instanceof SDKError)return console['error']('Error:\x20'+_0xc0f69d[_0x213867(0x1ea)]),_0xc0f69d['cause']&&console[_0x213867(0x1c4)](_0x213867(0x1f4)+_0xc0f69d[_0x213867(0x1c0)]),0x1;throw _0xc0f69d;}}}export class JobShowCommand extends BaseCommand{[a16_0x476f74(0x1de)]=a16_0x476f74(0x1fe);[a16_0x476f74(0x1b5)]='Show\x20job\x20details';async[a16_0x476f74(0x1f6)](_0x37ce99){const _0x4f7c46=a16_0x476f74,{options:_0x19c37d,args:_0x5bb98d,tdx:_0x51710e}=_0x37ce99,_0x3abc07=_0x5bb98d[0x0];if(!_0x3abc07)return console[_0x4f7c46(0x1c4)](_0x4f7c46(0x1ff)),console[_0x4f7c46(0x1c4)](_0x4f7c46(0x1fa)),0x1;try{const _0x2e15e2=await withSpinner('Getting\x20job\x20details...',()=>_0x51710e[_0x4f7c46(0x1b3)][_0x4f7c46(0x1cf)](_0x3abc07),{'verbose':_0x19c37d[_0x4f7c46(0x200)]}),_0x1950fb=_0x2e15e2[_0x4f7c46(0x1df)];let _0x279faa;if(_0x1950fb[_0x4f7c46(0x1bd)]&&_0x1950fb['end_at']){const _0x124ed2=new Date(_0x1950fb[_0x4f7c46(0x1bd)])[_0x4f7c46(0x1d9)](),_0x5f2711=new Date(_0x1950fb['end_at'])['getTime']();_0x279faa=Math[_0x4f7c46(0x1e9)]((_0x5f2711-_0x124ed2)/0x3e8);}const _0x56aa5c={'job_id':_0x1950fb[_0x4f7c46(0x1c6)],'type':_0x1950fb[_0x4f7c46(0x1f3)],'status':_0x1950fb['status'],..._0x1950fb[_0x4f7c46(0x1da)]&&{'user_name':_0x1950fb[_0x4f7c46(0x1da)]},..._0x279faa!==undefined&&{'duration_sec':_0x279faa},..._0x1950fb[_0x4f7c46(0x1cb)]&&{'created_at':_0x1950fb[_0x4f7c46(0x1cb)]},..._0x1950fb[_0x4f7c46(0x1bd)]&&{'started_at':_0x1950fb[_0x4f7c46(0x1bd)]},..._0x1950fb[_0x4f7c46(0x1ca)]&&{'end_at':_0x1950fb[_0x4f7c46(0x1ca)]},..._0x1950fb[_0x4f7c46(0x1db)]&&{'database':_0x1950fb['database']},..._0x1950fb[_0x4f7c46(0x1ce)]!==undefined&&{'priority':_0x1950fb[_0x4f7c46(0x1ce)]},..._0x1950fb[_0x4f7c46(0x1bc)]&&{'url':_0x1950fb[_0x4f7c46(0x1bc)]},..._0x1950fb[_0x4f7c46(0x1c2)]&&{'query':_0x1950fb[_0x4f7c46(0x1c2)]},..._0x1950fb['debug']&&{'debug':_0x1950fb[_0x4f7c46(0x1f8)]}};return await handleSingleObjectOutput(_0x56aa5c,_0x19c37d),0x0;}catch(_0x50cb6c){if(_0x50cb6c instanceof SDKError)return console[_0x4f7c46(0x1c4)](_0x4f7c46(0x1d2)+_0x50cb6c['message']),_0x50cb6c[_0x4f7c46(0x1c0)]&&console[_0x4f7c46(0x1c4)](_0x4f7c46(0x1f4)+_0x50cb6c[_0x4f7c46(0x1c0)]),0x1;throw _0x50cb6c;}}}export class JobKillCommand extends BaseCommand{['name']=a16_0x476f74(0x1b4);[a16_0x476f74(0x1b5)]=a16_0x476f74(0x1f2);async[a16_0x476f74(0x1f6)](_0x5a1619){const _0x338abd=a16_0x476f74,{options:_0x3a111b,args:_0x292177,tdx:_0x3c423d}=_0x5a1619,_0x351621=_0x292177[0x0];if(!_0x351621)return console[_0x338abd(0x1c4)](_0x338abd(0x1ff)),console[_0x338abd(0x1c4)](_0x338abd(0x1c9)),0x1;try{if(!_0x3a111b[_0x338abd(0x1be)]){const _0x5a6959=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x351621+'?');if(!_0x5a6959)return console[_0x338abd(0x1c4)](_0x338abd(0x1ef)),0x0;}return await withSpinner(_0x338abd(0x1e0),()=>_0x3c423d[_0x338abd(0x1b3)][_0x338abd(0x1b9)](_0x351621),{'verbose':_0x3a111b[_0x338abd(0x200)]}),console[_0x338abd(0x1c4)](_0x338abd(0x1f5)+_0x351621),console[_0x338abd(0x1c4)](_0x338abd(0x1c3)+_0x351621+_0x338abd(0x1d8)),0x0;}catch(_0x1570fa){if(_0x1570fa instanceof SDKError)return console[_0x338abd(0x1c4)](_0x338abd(0x1d2)+_0x1570fa[_0x338abd(0x1ea)]),_0x1570fa[_0x338abd(0x1c0)]&&console[_0x338abd(0x1c4)](_0x338abd(0x1f4)+_0x1570fa[_0x338abd(0x1c0)]),0x1;throw _0x1570fa;}}}export class JobSubmitCommand extends BaseCommand{[a16_0x476f74(0x1de)]=a16_0x476f74(0x1ed);['description']='Submit\x20a\x20job';async[a16_0x476f74(0x1f6)](_0x57f9d3){const _0x250d1e=a16_0x476f74,{options:_0x10bd9e,args:_0x2cbb54,tdx:_0x2e8b37}=_0x57f9d3;try{const _0x3911b4=_0x10bd9e[_0x250d1e(0x1b6)]||'trino',_0x35a19c=_0x10bd9e[_0x250d1e(0x1e5)],_0x3f8911=_0x10bd9e[_0x250d1e(0x1db)]||_0x250d1e(0x1e4);if(_0x3911b4!==_0x250d1e(0x1ee)&&_0x3911b4!=='hive')return console['error']('Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22'),0x1;let _0x5ec979;if(_0x35a19c){if(_0x2cbb54[0x0])return console[_0x250d1e(0x1c4)](_0x250d1e(0x1eb)),0x1;const _0x59e74e=readSqlStatementsFromFile(_0x35a19c);if(_0x59e74e['length']===0x0)return console[_0x250d1e(0x1c4)]('Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file'),0x1;if(_0x59e74e[_0x250d1e(0x1b7)]>0x1)return console[_0x250d1e(0x1c4)]('Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'),0x1;_0x5ec979=_0x59e74e[0x0];}else{if(!_0x2cbb54[0x0])return console[_0x250d1e(0x1c4)](_0x250d1e(0x1c8)),console['error']('Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'),0x1;_0x5ec979=_0x2cbb54[0x0];}_0x10bd9e[_0x250d1e(0x200)]&&(console[_0x250d1e(0x1c4)](_0x250d1e(0x1b8)+_0x3911b4),console[_0x250d1e(0x1c4)]('Database:\x20'+_0x3f8911),console[_0x250d1e(0x1c4)]('Query:\x20'+_0x5ec979[_0x250d1e(0x1dd)](0x0,0x64)+(_0x5ec979[_0x250d1e(0x1b7)]>0x64?_0x250d1e(0x1ec):'')));const _0x208c6d=await withSpinner(_0x250d1e(0x1bb),()=>_0x2e8b37[_0x250d1e(0x1b3)][_0x250d1e(0x1d3)](_0x3f8911,_0x5ec979,_0x3911b4),{'verbose':_0x10bd9e[_0x250d1e(0x200)]}),_0x36c6e4=_0x208c6d[_0x250d1e(0x1df)];return console['error'](_0x250d1e(0x1fd)),console[_0x250d1e(0x1c4)](_0x250d1e(0x1fc)+_0x36c6e4[_0x250d1e(0x1c6)]),await handleSDKOutput([_0x36c6e4],_0x10bd9e),0x0;}catch(_0x4128b1){if(_0x4128b1 instanceof SDKError)return console[_0x250d1e(0x1c4)](_0x250d1e(0x1d2)+_0x4128b1[_0x250d1e(0x1ea)]),_0x4128b1[_0x250d1e(0x1c0)]&&console[_0x250d1e(0x1c4)](_0x250d1e(0x1f4)+_0x4128b1[_0x250d1e(0x1c0)]),0x1;throw _0x4128b1;}}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a16_0x476f74(0x1b5)]='Get\x20job\x20results';async['execute'](_0xa8b341){const _0x50a824=a16_0x476f74,{options:_0x131b1c,args:_0x209dd8,tdx:_0x26ee1b}=_0xa8b341,_0x41a487=_0x209dd8[0x0];if(!_0x41a487)return console[_0x50a824(0x1c4)](_0x50a824(0x1ff)),console[_0x50a824(0x1c4)](_0x50a824(0x1f1)),0x1;try{const _0x2ec880=await withSpinner(_0x50a824(0x1dc),()=>_0x26ee1b[_0x50a824(0x1b3)][_0x50a824(0x1c5)](_0x41a487),{'verbose':_0x131b1c[_0x50a824(0x200)]}),_0x8190ec=_0x2ec880[_0x50a824(0x1df)];return console[_0x50a824(0x1c4)]('✔\x20Retrieved\x20'+_0x8190ec['length']+_0x50a824(0x1cc)+(_0x8190ec['length']!==0x1?'s':'')),await handleSDKOutput(_0x8190ec,_0x131b1c),0x0;}catch(_0x31bf19){if(_0x31bf19 instanceof SDKError)return console[_0x50a824(0x1c4)]('Error:\x20'+_0x31bf19[_0x50a824(0x1ea)]),_0x31bf19[_0x50a824(0x1c0)]&&console[_0x50a824(0x1c4)]('\x20\x20Cause:\x20'+_0x31bf19[_0x50a824(0x1c0)]),0x1;throw _0x31bf19;}}}function a16_0x3bdf(){const _0xd5ff03=['\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','error','result','job_id','738598nZAGLp','Error:\x20Query\x20is\x20required','Usage:\x20job\x20kill\x20<job-id>','end_at','created_at','\x20row','34VmuhFM','priority','show','15889HjNnuc','72531MrkFUR','Error:\x20','submit','1591670traxql','\x20job','Limit:\x20','5824YWiEKD','\x27\x20to\x20verify\x20the\x20job\x20status','getTime','user_name','database','Getting\x20job\x20results...','substring','name','data','Submitting\x20kill\x20request...','15181416nmVgpd','11SxXwDZ','\x20jobs','information_schema','file','list','map','status','round','message','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','...','job:submit','trino','Cancelled','820010xdKAte','Usage:\x20job\x20result\x20<job-id>','Kill\x20a\x20job','type','\x20\x20Cause:\x20','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','execute','16sFshTY','debug','✔\x20Found\x20','Usage:\x20job\x20show\x20<job-id>','645fTIsha','\x20\x20Job\x20ID:\x20','✔\x20Job\x20submitted','job:show','Error:\x20Job\x20ID\x20is\x20required','verbose','jobs','job:kill','description','jobType','length','Job\x20type:\x20','kill','Listing\x20jobs...','Submitting\x20job...','url','start_at','yes','Status\x20filter:\x20','cause','6JvVgNj','query'];a16_0x3bdf=function(){return _0xd5ff03;};return a16_0x3bdf();}
|
|
1
|
+
const a16_0x1dd964=a16_0x4142;(function(_0x1e8d6f,_0x142272){const _0x30d9d7=a16_0x4142,_0x444a46=_0x1e8d6f();while(!![]){try{const _0x19bfe1=-parseInt(_0x30d9d7(0xc3))/0x1*(-parseInt(_0x30d9d7(0xc0))/0x2)+parseInt(_0x30d9d7(0x103))/0x3+parseInt(_0x30d9d7(0xce))/0x4*(-parseInt(_0x30d9d7(0xd9))/0x5)+-parseInt(_0x30d9d7(0xfb))/0x6+parseInt(_0x30d9d7(0xd2))/0x7*(-parseInt(_0x30d9d7(0xd1))/0x8)+-parseInt(_0x30d9d7(0xfe))/0x9+parseInt(_0x30d9d7(0xe7))/0xa;if(_0x19bfe1===_0x142272)break;else _0x444a46['push'](_0x444a46['shift']());}catch(_0x5544e0){_0x444a46['push'](_0x444a46['shift']());}}}(a16_0x1c8d,0x4caf1));import{BaseCommand}from'./command.js';function a16_0x4142(_0x4e6562,_0xe94d9a){const _0x1c8da2=a16_0x1c8d();return a16_0x4142=function(_0x41421d,_0x20868f){_0x41421d=_0x41421d-0xb8;let _0x49c9d1=_0x1c8da2[_0x41421d];return _0x49c9d1;},a16_0x4142(_0x4e6562,_0xe94d9a);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';function a16_0x1c8d(){const _0x848612=['Getting\x20job\x20details...','31yKjsGd','...','list','map','Submit\x20a\x20job','limit','job:result','Show\x20job\x20details','message','job:show','status','2453204YBpAwR','file','error','8fvPGPM','3581018uaHEnm','show','query','\x20job','Submitting\x20job...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Submitting\x20kill\x20request...','5dktABI','created_at','jobType','round','job_id','cause','Kill\x20a\x20job','\x20\x20Job\x20ID:\x20','description','yes','database','Error:\x20Job\x20ID\x20is\x20required','kill','Query:\x20','8432420gpHfmr','\x20row','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','name','end_at','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','user_name','type','Cancelled','result','information_schema','execute','job:kill','verbose','trino','submit','getTime','jobs','2245740yYzpsA','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Error:\x20','470322XGOeCn','Status\x20filter:\x20','\x20\x20Cause:\x20','Usage:\x20job\x20show\x20<job-id>','data','1803057thrmPO','debug','Usage:\x20job\x20result\x20<job-id>','Limit:\x20','length','Getting\x20job\x20results...','Listing\x20jobs...','✔\x20Found\x20','start_at','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','\x20jobs','27178SBbOju','url'];a16_0x1c8d=function(){return _0x848612;};return a16_0x1c8d();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a16_0x1dd964(0xea)]=a16_0x1dd964(0xfa);['description']='List\x20jobs';async[a16_0x1dd964(0xf4)](_0x2a667a){const _0x4a4b77=a16_0x1dd964,{options:_0x114a24,tdx:_0x52f380}=_0x2a667a;try{const _0xcf24d2=resolveLimit(_0x114a24[_0x4a4b77(0xc8)],DEFAULT_DISPLAY_LIMIT),_0x41bae1=_0x114a24[_0x4a4b77(0xcd)];_0x114a24[_0x4a4b77(0xf6)]&&(console[_0x4a4b77(0xd0)](_0x4a4b77(0xb8)+_0xcf24d2+_0x4a4b77(0xbf)),_0x41bae1&&console[_0x4a4b77(0xd0)](_0x4a4b77(0xff)+_0x41bae1));const _0x4f2c0c=await withSpinner(_0x4a4b77(0xbb),()=>_0x52f380['jobs'][_0x4a4b77(0xc5)]({'from':0x0,'to':_0xcf24d2-0x1,'status':_0x41bae1}),{'verbose':_0x114a24[_0x4a4b77(0xf6)]}),_0x4e7cb1=_0x4f2c0c['data'];console[_0x4a4b77(0xd0)](_0x4a4b77(0xbc)+_0x4e7cb1[_0x4a4b77(0xb9)]+_0x4a4b77(0xd5)+(_0x4e7cb1[_0x4a4b77(0xb9)]!==0x1?'s':''));const _0x1bc4a8=_0x4e7cb1[_0x4a4b77(0xc6)](_0xc9753=>{const _0x4e0f4a=_0x4a4b77;let _0x39ae4d;if(_0xc9753[_0x4e0f4a(0xbd)]&&_0xc9753[_0x4e0f4a(0xeb)]){const _0x3e3f13=new Date(_0xc9753['start_at'])[_0x4e0f4a(0xf9)](),_0x3f25cb=new Date(_0xc9753[_0x4e0f4a(0xeb)])[_0x4e0f4a(0xf9)]();_0x39ae4d=Math[_0x4e0f4a(0xdc)]((_0x3f25cb-_0x3e3f13)/0x3e8);}return{'job_id':_0xc9753['job_id'],'type':_0xc9753['type'],'status':_0xc9753[_0x4e0f4a(0xcd)],'user_name':_0xc9753[_0x4e0f4a(0xef)],'duration_sec':_0x39ae4d,'created_at':_0xc9753[_0x4e0f4a(0xda)],'started_at':_0xc9753['start_at'],'end_at':_0xc9753[_0x4e0f4a(0xeb)]};});return await handleSDKOutput(_0x1bc4a8,_0x114a24),0x0;}catch(_0x4af63e){if(_0x4af63e instanceof SDKError)return console[_0x4a4b77(0xd0)](_0x4a4b77(0xfd)+_0x4af63e[_0x4a4b77(0xcb)]),_0x4af63e[_0x4a4b77(0xde)]&&console[_0x4a4b77(0xd0)]('\x20\x20Cause:\x20'+_0x4af63e['cause']),0x1;throw _0x4af63e;}}}export class JobShowCommand extends BaseCommand{['name']=a16_0x1dd964(0xcc);[a16_0x1dd964(0xe1)]=a16_0x1dd964(0xca);async['execute'](_0x248d22){const _0x3411fb=a16_0x1dd964,{options:_0x2fe603,args:_0x2ce9f2,tdx:_0x30ab5c}=_0x248d22,_0x120741=_0x2ce9f2[0x0];if(!_0x120741)return console[_0x3411fb(0xd0)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x3411fb(0xd0)](_0x3411fb(0x101)),0x1;try{const _0x438961=await withSpinner(_0x3411fb(0xc2),()=>_0x30ab5c[_0x3411fb(0xfa)][_0x3411fb(0xd3)](_0x120741),{'verbose':_0x2fe603['verbose']}),_0xfbef4a=_0x438961[_0x3411fb(0x102)];let _0x1b84b3;if(_0xfbef4a[_0x3411fb(0xbd)]&&_0xfbef4a['end_at']){const _0x103dda=new Date(_0xfbef4a[_0x3411fb(0xbd)])['getTime'](),_0x4aba75=new Date(_0xfbef4a[_0x3411fb(0xeb)])['getTime']();_0x1b84b3=Math[_0x3411fb(0xdc)]((_0x4aba75-_0x103dda)/0x3e8);}const _0x14c802={'job_id':_0xfbef4a[_0x3411fb(0xdd)],'type':_0xfbef4a[_0x3411fb(0xf0)],'status':_0xfbef4a[_0x3411fb(0xcd)],..._0xfbef4a['user_name']&&{'user_name':_0xfbef4a[_0x3411fb(0xef)]},..._0x1b84b3!==undefined&&{'duration_sec':_0x1b84b3},..._0xfbef4a[_0x3411fb(0xda)]&&{'created_at':_0xfbef4a[_0x3411fb(0xda)]},..._0xfbef4a[_0x3411fb(0xbd)]&&{'started_at':_0xfbef4a[_0x3411fb(0xbd)]},..._0xfbef4a[_0x3411fb(0xeb)]&&{'end_at':_0xfbef4a[_0x3411fb(0xeb)]},..._0xfbef4a[_0x3411fb(0xe3)]&&{'database':_0xfbef4a[_0x3411fb(0xe3)]},..._0xfbef4a['priority']!==undefined&&{'priority':_0xfbef4a['priority']},..._0xfbef4a[_0x3411fb(0xc1)]&&{'url':_0xfbef4a[_0x3411fb(0xc1)]},..._0xfbef4a[_0x3411fb(0xd4)]&&{'query':_0xfbef4a[_0x3411fb(0xd4)]},..._0xfbef4a[_0x3411fb(0x104)]&&{'debug':_0xfbef4a[_0x3411fb(0x104)]}};return await handleSingleObjectOutput(_0x14c802,_0x2fe603),0x0;}catch(_0x434d73){if(_0x434d73 instanceof SDKError)return console[_0x3411fb(0xd0)](_0x3411fb(0xfd)+_0x434d73[_0x3411fb(0xcb)]),_0x434d73[_0x3411fb(0xde)]&&console[_0x3411fb(0xd0)]('\x20\x20Cause:\x20'+_0x434d73[_0x3411fb(0xde)]),0x1;throw _0x434d73;}}}export class JobKillCommand extends BaseCommand{[a16_0x1dd964(0xea)]=a16_0x1dd964(0xf5);[a16_0x1dd964(0xe1)]=a16_0x1dd964(0xdf);async[a16_0x1dd964(0xf4)](_0x1b81f9){const _0x5a5390=a16_0x1dd964,{options:_0x362b19,args:_0x4b70ce,tdx:_0x13f240}=_0x1b81f9,_0x28bca2=_0x4b70ce[0x0];if(!_0x28bca2)return console[_0x5a5390(0xd0)](_0x5a5390(0xe4)),console[_0x5a5390(0xd0)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x362b19[_0x5a5390(0xe2)]){const _0xff2fe0=await confirm(_0x5a5390(0xd7)+_0x28bca2+'?');if(!_0xff2fe0)return console[_0x5a5390(0xd0)](_0x5a5390(0xf1)),0x0;}return await withSpinner(_0x5a5390(0xd8),()=>_0x13f240[_0x5a5390(0xfa)][_0x5a5390(0xe5)](_0x28bca2),{'verbose':_0x362b19[_0x5a5390(0xf6)]}),console[_0x5a5390(0xd0)](_0x5a5390(0xe9)+_0x28bca2),console[_0x5a5390(0xd0)](_0x5a5390(0xed)+_0x28bca2+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}catch(_0x3a7573){if(_0x3a7573 instanceof SDKError)return console[_0x5a5390(0xd0)](_0x5a5390(0xfd)+_0x3a7573[_0x5a5390(0xcb)]),_0x3a7573['cause']&&console['error'](_0x5a5390(0x100)+_0x3a7573[_0x5a5390(0xde)]),0x1;throw _0x3a7573;}}}export class JobSubmitCommand extends BaseCommand{[a16_0x1dd964(0xea)]='job:submit';['description']=a16_0x1dd964(0xc7);async['execute'](_0x199dcb){const _0x5b176f=a16_0x1dd964,{options:_0x16dfb1,args:_0x35ef83,tdx:_0x43ccaa}=_0x199dcb;try{const _0x88531=_0x16dfb1[_0x5b176f(0xdb)]||_0x5b176f(0xf7),_0x4cdd12=_0x16dfb1[_0x5b176f(0xcf)],_0xd491cd=_0x16dfb1[_0x5b176f(0xe3)]||_0x5b176f(0xf3);if(_0x88531!=='trino'&&_0x88531!=='hive')return console[_0x5b176f(0xd0)](_0x5b176f(0xfc)),0x1;let _0x152b69;if(_0x4cdd12){if(_0x35ef83[0x0])return console[_0x5b176f(0xd0)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0xd3bbff=readSqlStatementsFromFile(_0x4cdd12);if(_0xd3bbff[_0x5b176f(0xb9)]===0x0)return console[_0x5b176f(0xd0)](_0x5b176f(0xbe)),0x1;if(_0xd3bbff[_0x5b176f(0xb9)]>0x1)return console[_0x5b176f(0xd0)](_0x5b176f(0xec)),0x1;_0x152b69=_0xd3bbff[0x0];}else{if(!_0x35ef83[0x0])return console[_0x5b176f(0xd0)]('Error:\x20Query\x20is\x20required'),console[_0x5b176f(0xd0)](_0x5b176f(0xee)),0x1;_0x152b69=_0x35ef83[0x0];}_0x16dfb1['verbose']&&(console[_0x5b176f(0xd0)]('Job\x20type:\x20'+_0x88531),console[_0x5b176f(0xd0)]('Database:\x20'+_0xd491cd),console[_0x5b176f(0xd0)](_0x5b176f(0xe6)+_0x152b69['substring'](0x0,0x64)+(_0x152b69[_0x5b176f(0xb9)]>0x64?_0x5b176f(0xc4):'')));const _0x130b1b=await withSpinner(_0x5b176f(0xd6),()=>_0x43ccaa[_0x5b176f(0xfa)][_0x5b176f(0xf8)](_0xd491cd,_0x152b69,_0x88531),{'verbose':_0x16dfb1['verbose']}),_0x7a2c6d=_0x130b1b[_0x5b176f(0x102)];return console[_0x5b176f(0xd0)]('✔\x20Job\x20submitted'),console[_0x5b176f(0xd0)](_0x5b176f(0xe0)+_0x7a2c6d['job_id']),await handleSDKOutput([_0x7a2c6d],_0x16dfb1),0x0;}catch(_0x136c5a){if(_0x136c5a instanceof SDKError)return console[_0x5b176f(0xd0)]('Error:\x20'+_0x136c5a[_0x5b176f(0xcb)]),_0x136c5a[_0x5b176f(0xde)]&&console['error']('\x20\x20Cause:\x20'+_0x136c5a['cause']),0x1;throw _0x136c5a;}}}export class JobResultCommand extends BaseCommand{[a16_0x1dd964(0xea)]=a16_0x1dd964(0xc9);[a16_0x1dd964(0xe1)]='Get\x20job\x20results';async[a16_0x1dd964(0xf4)](_0x2f0998){const _0x20b666=a16_0x1dd964,{options:_0xea3f13,args:_0x108a2e,tdx:_0x4dfef9}=_0x2f0998,_0x3a9a83=_0x108a2e[0x0];if(!_0x3a9a83)return console[_0x20b666(0xd0)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x20b666(0xd0)](_0x20b666(0x105)),0x1;try{const _0x28f180=await withSpinner(_0x20b666(0xba),()=>_0x4dfef9['jobs'][_0x20b666(0xf2)](_0x3a9a83),{'verbose':_0xea3f13[_0x20b666(0xf6)]}),_0x452df7=_0x28f180['data'];return console[_0x20b666(0xd0)]('✔\x20Retrieved\x20'+_0x452df7['length']+_0x20b666(0xe8)+(_0x452df7[_0x20b666(0xb9)]!==0x1?'s':'')),await handleSDKOutput(_0x452df7,_0xea3f13),0x0;}catch(_0x4ff9a0){if(_0x4ff9a0 instanceof SDKError)return console[_0x20b666(0xd0)](_0x20b666(0xfd)+_0x4ff9a0[_0x20b666(0xcb)]),_0x4ff9a0['cause']&&console[_0x20b666(0xd0)](_0x20b666(0x100)+_0x4ff9a0[_0x20b666(0xde)]),0x1;throw _0x4ff9a0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a17_0x11bbbf=a17_0x32f7;(function(_0x21d497,_0x4d6ac6){const _0x4ef44a=a17_0x32f7,_0xd7c93b=_0x21d497();while(!![]){try{const _0x5e013d=-parseInt(_0x4ef44a(0xe0))/0x1+parseInt(_0x4ef44a(0xa5))/0x2*(parseInt(_0x4ef44a(0xfd))/0x3)+parseInt(_0x4ef44a(0xc8))/0x4*(-parseInt(_0x4ef44a(0xda))/0x5)+parseInt(_0x4ef44a(0xd3))/0x6+-parseInt(_0x4ef44a(0xb9))/0x7+-parseInt(_0x4ef44a(0x9d))/0x8*(-parseInt(_0x4ef44a(0xf8))/0x9)+-parseInt(_0x4ef44a(0xab))/0xa;if(_0x5e013d===_0x4d6ac6)break;else _0xd7c93b['push'](_0xd7c93b['shift']());}catch(_0x15b1f7){_0xd7c93b['push'](_0xd7c93b['shift']());}}}(a17_0x4d38,0x1d498));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a17_0x32f7(_0x24e746,_0x301458){const _0x4d38ca=a17_0x4d38();return a17_0x32f7=function(_0x32f7e9,_0x50949a){_0x32f7e9=_0x32f7e9-0x6d;let _0x3286ad=_0x4d38ca[_0x32f7e9];return _0x3286ad;},a17_0x32f7(_0x24e746,_0x301458);}import{withSpinner}from'../utils/spinner.js';function a17_0x4d38(){const _0x1df424=['stack','message','image','Creating\x20agent\x20\x27','List\x20all\x20LLM\x20projects','split','Fetching\x20chat\x20history\x20for\x20\x27','deleteAgent','List\x20agents\x20in\x20current\x20project','llm','1269024OzNlIY','cyan','temperature','tsv','Fetching\x20available\x20models...','Usage:\x20tdx\x20llm\x20use\x20<project-name>','\x20bytes)','30qojrBA','getOrCreateDefaultProject','format','Project\x20deleted:\x20','llm:agent:show','\x20->\x20ImageGen:','80955CBoaYu','targetWebSearchTool','maxToolIterations','Delete\x20an\x20agent','execute','Setting\x20project\x20context\x20to\x20\x27','[image]\x20\x20','\x0aStack\x20trace:','resolveProjectId','limit','Error:\x20','yellow','magenta','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','No\x20chat\x20sessions\x20found.','blue','targetImageGenerator','keys','history','\x20\x20Cause:\x20','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Agent\x20deleted:\x20','Project\x20created:\x20','dim','360531qoUUWh','Project\x20not\x20found:\x20','Fetching\x20agent...','llm:history','createdAt','21oprorG','jsonl','name','Deleting\x20project\x20\x27','string','Project\x20context\x20set\x20to:\x20','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','last','llm:agent:delete','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','No\x20messages\x20found\x20in\x20chat\x20history.','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','\x20->\x20WebSearch:','llm:projects','model','agents','output','join','json','toLowerCase','includes','length','llm:project:delete','List\x20available\x20LLM\x20models','Error:\x20Project\x20name\x20is\x20required','chats','content','tool_call','Agent\x20created:\x20','...','data','createAgent','systemPrompt','Fetching\x20most\x20recent\x20chat...','Error:\x20Agent\x20name\x20is\x20required','Use\x20format:\x20project-name/agent-name','llmProject','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','[output]\x20','llm:project:create','filter','targetAgent','createProject','llm:use','starterMessage','getCurrentProject','resolveAgentId','Usage:\x20tdx\x20llm\x20history\x20--last','tool','LLM_PROJECT_NOT_FOUND','8RMLWtb','input','llm:agent:create','llm:agent:update','llm:agents','Resolving\x20project\x20\x27','INVALID_ARGUMENT','green','8908TcygAl','description','stringify','slice','Update\x20an\x20existing\x20agent','\x27...','85870HFOlqP','Invalid\x20path\x20syntax:\x20','targetKnowledgeBase','error','verbose','map','[error]\x20\x20','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Fetching\x20agents...','[input]\x20\x20','cause','projects','bold','claude-4.5-haiku','435645mQpXbo','attributes','Deleting\x20agent...','[tool]\x20\x20\x20','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Create\x20a\x20new\x20LLM\x20project','log','Resolving\x20agent\x20\x27','Set\x20current\x20project\x20context','table','setCurrentProject','Updating\x20agent...','find','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','\x20->\x20KB:','7336KGQBBv'];a17_0x4d38=function(){return _0x1df424;};return a17_0x4d38();}import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';function handleSDKError(_0x14d0dd,_0x51596c){const _0x41592a=a17_0x32f7;if(_0x14d0dd instanceof SDKError)console[_0x41592a(0xae)](_0x41592a(0xea)+_0x14d0dd[_0x41592a(0xca)]),_0x51596c[_0x41592a(0xaf)]&&(_0x14d0dd[_0x41592a(0xb5)]&&console[_0x41592a(0xae)](_0x41592a(0xf3)+_0x14d0dd[_0x41592a(0xb5)]),_0x14d0dd[_0x41592a(0xc9)]&&(console[_0x41592a(0xae)](_0x41592a(0xe7)),console[_0x41592a(0xae)](_0x14d0dd[_0x41592a(0xc9)])));else throw _0x14d0dd;}function formatChatHistoryEntry(_0x3a3bfd,_0x349a63){const _0x332955=a17_0x32f7,_0x2b0e49=getChalk(_0x349a63),_0x53f7f8=_0x2b0e49[_0x332955(0xf7)](_0x3a3bfd['at']);if(_0x332955(0x9e)in _0x3a3bfd){const _0x20bc7e=_0x2b0e49[_0x332955(0xd4)](_0x332955(0xb4));return _0x53f7f8+'\x20'+_0x20bc7e+':\x20'+_0x3a3bfd[_0x332955(0x9e)];}if('content'in _0x3a3bfd){const _0x4ae536=_0x2b0e49[_0x332955(0xa4)]('[content]');return _0x53f7f8+'\x20'+_0x4ae536+':\x20'+_0x3a3bfd[_0x332955(0x85)];}if(_0x332955(0x86)in _0x3a3bfd){const _0x34523e=_0x2b0e49[_0x332955(0xeb)]('[tool_call]'),{functionName:_0x3df66e,functionArguments:_0x46e8d3,targetFunction:_0x23fb2d}=_0x3a3bfd[_0x332955(0x86)];let _0x5039e4=_0x53f7f8+'\x20'+_0x34523e+':\x20'+_0x2b0e49[_0x332955(0xb7)](_0x3df66e);if(_0x46e8d3&&Object[_0x332955(0xf1)](_0x46e8d3)['length']>0x0){const _0x6a1f63=Object['entries'](_0x46e8d3)[_0x332955(0xb0)](([_0x54672d,_0x4fb4b5])=>_0x54672d+'='+JSON['stringify'](_0x4fb4b5))[_0x332955(0x7c)](',\x20');_0x5039e4+='('+_0x6a1f63+')';}_0x23fb2d&&(_0x5039e4+=_0x2b0e49[_0x332955(0xf7)]('\x20['+_0x23fb2d+']'));let _0x388c98='';if(_0x3a3bfd[_0x332955(0x86)][_0x332955(0xad)])_0x388c98=_0x332955(0xc7)+_0x3a3bfd[_0x332955(0x86)][_0x332955(0xad)][_0x332955(0x6d)];else{if(_0x3a3bfd[_0x332955(0x86)]['targetAgent'])_0x388c98='\x20->\x20Agent:'+_0x3a3bfd[_0x332955(0x86)][_0x332955(0x94)][_0x332955(0x6d)];else{if(_0x3a3bfd['tool_call'][_0x332955(0xe1)])_0x388c98=_0x332955(0x77)+_0x3a3bfd[_0x332955(0x86)][_0x332955(0xe1)][_0x332955(0x6d)];else _0x3a3bfd[_0x332955(0x86)][_0x332955(0xf0)]&&(_0x388c98=_0x332955(0xdf)+_0x3a3bfd[_0x332955(0x86)][_0x332955(0xf0)][_0x332955(0x6d)]);}}return _0x5039e4+_0x388c98;}if(_0x332955(0x9b)in _0x3a3bfd){const _0x28efcc=_0x2b0e49[_0x332955(0xec)](_0x332955(0xbc)),{functionName:_0x4663e2,functionArguments:_0x27a4fd,content:_0x53b2c1,newChat:_0x572986}=_0x3a3bfd[_0x332955(0x9b)];let _0x198040=_0x53f7f8+'\x20'+_0x28efcc+':\x20'+_0x2b0e49['bold'](_0x4663e2);if(_0x27a4fd){const _0x42168f=typeof _0x27a4fd===_0x332955(0x6f)?_0x27a4fd:JSON[_0x332955(0xa7)](_0x27a4fd);_0x198040+='('+_0x42168f+')';}return _0x53b2c1&&(_0x198040+='\x0a'+_0x2b0e49[_0x332955(0xf7)](_0x53b2c1)),_0x572986&&(_0x198040+=_0x2b0e49[_0x332955(0xf7)]('\x20→\x20chat:\x20'+_0x572986['id'])),_0x198040;}if(_0x332955(0x7b)in _0x3a3bfd){const _0x36f50c=_0x2b0e49[_0x332955(0xef)](_0x332955(0x91));return _0x53f7f8+'\x20'+_0x36f50c+':\x20'+_0x3a3bfd[_0x332955(0x7b)][_0x332955(0x6d)]+'\x20('+_0x3a3bfd['output']['content'][_0x332955(0x80)]+_0x332955(0xd9);}if(_0x332955(0xcb)in _0x3a3bfd){const _0x3c29a8=_0x2b0e49[_0x332955(0xef)](_0x332955(0xe6)),{width:_0x924874,height:_0x49c7ea,headerText:_0x4a5e5a}=_0x3a3bfd[_0x332955(0xcb)],_0x143185=_0x4a5e5a?'\x20-\x20'+_0x4a5e5a:'';return _0x53f7f8+'\x20'+_0x3c29a8+':\x20'+_0x924874+'x'+_0x49c7ea+_0x143185;}if(_0x332955(0xae)in _0x3a3bfd){const _0x158378=_0x2b0e49['red'](_0x332955(0xb1));return _0x53f7f8+'\x20'+_0x158378+':\x20'+_0x3a3bfd[_0x332955(0xae)];}return _0x53f7f8+'\x20'+_0x2b0e49[_0x332955(0xf7)]('[unknown]')+':\x20'+JSON[_0x332955(0xa7)](_0x3a3bfd);}async function getProjectIdOrDefault(_0x5d9139){const _0x3473d4=a17_0x32f7,{tdx:_0x49d4d5,options:_0x4a02f2}=_0x5d9139,_0x51ec41=_0x4a02f2[_0x3473d4(0x8f)];if(_0x51ec41){const _0x3177c2=await withSpinner(_0x3473d4(0xa2)+_0x51ec41+_0x3473d4(0xaa),()=>_0x49d4d5[_0x3473d4(0xd2)][_0x3473d4(0xe8)](_0x51ec41),{'verbose':_0x4a02f2[_0x3473d4(0xaf)]});return _0x3177c2['data'];}let _0x2575d1=_0x49d4d5[_0x3473d4(0xd2)][_0x3473d4(0x98)]();if(_0x2575d1)return _0x2575d1;const _0x19bbb6=await withSpinner('Getting\x20default\x20project...',()=>_0x49d4d5[_0x3473d4(0xd2)][_0x3473d4(0xdb)](),{'verbose':_0x4a02f2['verbose']});return _0x19bbb6[_0x3473d4(0x89)]['id'];}function toLLMProjectInfo(_0x1069d3){const _0x2a9b03=a17_0x32f7;return{'name':_0x1069d3[_0x2a9b03(0xba)][_0x2a9b03(0x6d)],'description':_0x1069d3[_0x2a9b03(0xba)][_0x2a9b03(0xa6)],'createdAt':_0x1069d3[_0x2a9b03(0xba)][_0x2a9b03(0xfc)],'updatedAt':_0x1069d3[_0x2a9b03(0xba)]['updatedAt']};}function toAgentInfo(_0x36a12d){const _0x1d1516=a17_0x32f7;return{'name':_0x36a12d[_0x1d1516(0xba)]['name'],'description':_0x36a12d[_0x1d1516(0xba)][_0x1d1516(0xa6)],'prompt':truncatePrompt(_0x36a12d[_0x1d1516(0xba)]['prompt']),'createdAt':_0x36a12d[_0x1d1516(0xba)]['createdAt'],'updatedAt':_0x36a12d[_0x1d1516(0xba)]['updatedAt']};}function truncatePrompt(_0x50f900){const _0x42b13d=a17_0x32f7;if(!_0x50f900)return undefined;const _0x35c37a=0x64;if(_0x50f900['length']<=_0x35c37a)return _0x50f900;return _0x50f900[_0x42b13d(0xa8)](0x0,_0x35c37a)+_0x42b13d(0x88);}export class LLMModelsCommand extends BaseCommand{[a17_0x11bbbf(0x6d)]='llm:models';[a17_0x11bbbf(0xa6)]=a17_0x11bbbf(0x82);async[a17_0x11bbbf(0xe4)](_0x16d23a){const _0x12418c=a17_0x11bbbf,{options:_0x350cd7,tdx:_0x354338}=_0x16d23a;try{const _0x5dc17e=await withSpinner(_0x12418c(0xd7),()=>_0x354338[_0x12418c(0xd2)]['models'](),{'verbose':_0x350cd7[_0x12418c(0xaf)]});return await handleSDKOutput(_0x5dc17e[_0x12418c(0x89)],_0x350cd7),0x0;}catch(_0x39734b){return handleSDKError(_0x39734b,_0x350cd7),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a17_0x11bbbf(0x6d)]=a17_0x11bbbf(0x78);['description']=a17_0x11bbbf(0xcd);async[a17_0x11bbbf(0xe4)](_0x16a04c){const _0x4bb4ed=a17_0x11bbbf,{options:_0x43dd3b,args:_0x3c2728,tdx:_0x34f2b0}=_0x16a04c;try{const _0x4964d3=_0x3c2728[0x0],_0x311c38=resolveLimit(_0x43dd3b[_0x4bb4ed(0xe9)],DEFAULT_LLM_LIMIT),_0x4518be=await withSpinner('Fetching\x20projects...',()=>_0x34f2b0[_0x4bb4ed(0xd2)][_0x4bb4ed(0xb6)](_0x311c38),{'verbose':_0x43dd3b['verbose']});let _0x459531=_0x4518be[_0x4bb4ed(0x89)];_0x4964d3&&(_0x459531=_0x4518be[_0x4bb4ed(0x89)][_0x4bb4ed(0x93)](_0x3a6e77=>matchGlobPattern(_0x3a6e77[_0x4bb4ed(0xba)]['name'],_0x4964d3)));const _0x1df6fe=_0x459531[_0x4bb4ed(0xb0)](toLLMProjectInfo);return await handleSDKOutput(_0x1df6fe,_0x43dd3b),0x0;}catch(_0x52f97b){return handleSDKError(_0x52f97b,_0x43dd3b),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a17_0x11bbbf(0x6d)]=a17_0x11bbbf(0xa1);['description']=a17_0x11bbbf(0xd1);async['execute'](_0x57331f){const _0x45abe8=a17_0x11bbbf,{options:_0x220068,args:_0x52fbe5,tdx:_0x1f226c}=_0x57331f;try{const _0x79c58=_0x52fbe5[0x0];let _0x543439,_0x3f9cc2=_0x79c58;if(_0x79c58&&_0x79c58[_0x45abe8(0x7f)]('/')){const _0x5a6078=_0x79c58[_0x45abe8(0xce)]('/');if(_0x5a6078['length']===0x2){const [_0x419f70,_0x53d94e]=_0x5a6078,_0xd8f0e9=await _0x1f226c[_0x45abe8(0xd2)][_0x45abe8(0xb6)](),_0x31dfb3=_0xd8f0e9[_0x45abe8(0xc5)](_0x41c26f=>_0x41c26f[_0x45abe8(0xba)][_0x45abe8(0x6d)]['toLowerCase']()===_0x419f70[_0x45abe8(0x7e)]());if(!_0x31dfb3)throw new SDKError(ErrorCode[_0x45abe8(0x9c)],_0x45abe8(0xf9)+_0x419f70,undefined,{'helpText':_0x45abe8(0x76)});_0x543439=_0x31dfb3['id'],_0x3f9cc2=_0x53d94e;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20path\x20syntax:\x20'+_0x79c58,undefined,{'helpText':_0x45abe8(0x8e)});}else _0x543439=await getProjectIdOrDefault(_0x57331f);const _0x5b148f=await withSpinner(_0x45abe8(0xb3),()=>_0x1f226c[_0x45abe8(0xd2)][_0x45abe8(0x7a)](_0x543439),{'verbose':_0x220068[_0x45abe8(0xaf)]});let _0x249091=_0x5b148f['data'];_0x3f9cc2&&(_0x249091=_0x5b148f[_0x45abe8(0x89)][_0x45abe8(0x93)](_0x547ad6=>matchGlobPattern(_0x547ad6['attributes'][_0x45abe8(0x6d)],_0x3f9cc2)));const _0x5efcc4=_0x249091[_0x45abe8(0xb0)](toAgentInfo);return await handleSDKOutput(_0x5efcc4,_0x220068),0x0;}catch(_0x459858){return handleSDKError(_0x459858,_0x220068),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a17_0x11bbbf(0xde);[a17_0x11bbbf(0xa6)]='Show\x20agent\x20details';async[a17_0x11bbbf(0xe4)](_0x27c785){const _0x39ed50=a17_0x11bbbf,{options:_0x219faf,args:_0x2ea08c,tdx:_0x56b7de}=_0x27c785;if(_0x2ea08c['length']===0x0)return console[_0x39ed50(0xae)](_0x39ed50(0x8d)),console['error'](_0x39ed50(0xbd)),0x1;const _0x46f4e3=_0x2ea08c[0x0];try{const _0x1a4c90=await getProjectIdOrDefault(_0x27c785),_0x3a43e9=await withSpinner(_0x39ed50(0xc0)+_0x46f4e3+'\x27...',()=>_0x56b7de[_0x39ed50(0xd2)][_0x39ed50(0x99)](_0x46f4e3,_0x1a4c90),{'verbose':_0x219faf['verbose']}),_0xb67a04=await withSpinner(_0x39ed50(0xfa),()=>_0x56b7de[_0x39ed50(0xd2)]['agent'](_0x3a43e9[_0x39ed50(0x89)]),{'verbose':_0x219faf['verbose']});return await handleSDKOutput([_0xb67a04[_0x39ed50(0x89)]],_0x219faf),0x0;}catch(_0x250431){return handleSDKError(_0x250431,_0x219faf),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a17_0x11bbbf(0x6d)]=a17_0x11bbbf(0x9f);[a17_0x11bbbf(0xa6)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a17_0x11bbbf(0xe4)](_0x561f4f){const _0x2910d1=a17_0x11bbbf,{options:_0x4ee3c0,args:_0x4d0304,tdx:_0x30a1cc}=_0x561f4f;if(_0x4d0304['length']===0x0)return console['error'](_0x2910d1(0x8d)),console[_0x2910d1(0xae)](_0x2910d1(0xed)),console[_0x2910d1(0xae)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x4d949c=_0x4d0304[0x0],_0x453eec=_0x4ee3c0,_0x2ba607=_0x453eec[_0x2910d1(0x8b)],_0x174ea8=_0x453eec[_0x2910d1(0x79)]||_0x2910d1(0xb8),_0x732693=_0x453eec[_0x2910d1(0x97)],_0x8685da=_0x453eec[_0x2910d1(0xe2)]?Number(_0x453eec['maxToolIterations']):undefined,_0x4c83ef=_0x453eec[_0x2910d1(0xd5)]?Number(_0x453eec[_0x2910d1(0xd5)]):undefined;try{let _0x14e0e9,_0x8fa90a;if(_0x4d949c['includes']('/')){const _0x158071=_0x4d949c['split']('/');if(_0x158071[_0x2910d1(0x80)]===0x2){const [_0x2baa2e,_0x2d274a]=_0x158071,_0x574099=await withSpinner(_0x2910d1(0xa2)+_0x2baa2e+_0x2910d1(0xaa),()=>_0x30a1cc[_0x2910d1(0xd2)][_0x2910d1(0xe8)](_0x2baa2e),{'verbose':_0x4ee3c0['verbose']});_0x14e0e9=_0x574099[_0x2910d1(0x89)],_0x8fa90a=_0x2d274a;}else throw new SDKError(ErrorCode[_0x2910d1(0xa3)],_0x2910d1(0xac)+_0x4d949c,undefined,{'helpText':_0x2910d1(0x8e)});}else _0x14e0e9=await getProjectIdOrDefault(_0x561f4f),_0x8fa90a=_0x4d949c;const _0x28e400=await withSpinner(_0x2910d1(0xcc)+_0x8fa90a+_0x2910d1(0xaa),()=>_0x30a1cc[_0x2910d1(0xd2)][_0x2910d1(0x8a)]({'name':_0x8fa90a,'projectId':_0x14e0e9,'modelType':_0x174ea8,'systemPrompt':_0x2ba607,'starterMessage':_0x732693,'maxToolIterations':_0x8685da,'temperature':_0x4c83ef}),{'verbose':_0x4ee3c0['verbose']});return console[_0x2910d1(0xbf)](_0x2910d1(0x87)+_0x28e400[_0x2910d1(0x89)]['id']),await handleSDKOutput([_0x28e400['data']],_0x4ee3c0),0x0;}catch(_0x585b7d){return handleSDKError(_0x585b7d,_0x4ee3c0),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a17_0x11bbbf(0x6d)]=a17_0x11bbbf(0xa0);[a17_0x11bbbf(0xa6)]=a17_0x11bbbf(0xa9);async[a17_0x11bbbf(0xe4)](_0x59d740){const _0x308df4=a17_0x11bbbf,{options:_0x214d07,args:_0x15c278,tdx:_0x40dd7c}=_0x59d740;if(_0x15c278['length']===0x0)return console[_0x308df4(0xae)](_0x308df4(0x8d)),console[_0x308df4(0xae)](_0x308df4(0xb2)),0x1;const _0x1de8ac=_0x15c278[0x0],_0x5712d7=_0x214d07,_0x2f3f0c=_0x5712d7[_0x308df4(0x6d)],_0xbf2712=_0x5712d7['prompt'],_0x453347=_0x5712d7[_0x308df4(0xa6)],_0x22371d=_0x5712d7[_0x308df4(0x97)];if(!_0x2f3f0c&&!_0xbf2712&&!_0x453347&&!_0x22371d)return console[_0x308df4(0xae)](_0x308df4(0x74)),console[_0x308df4(0xae)](_0x308df4(0xc6)),0x1;try{const _0x616657=await getProjectIdOrDefault(_0x59d740),_0x1bc735=await withSpinner(_0x308df4(0xc0)+_0x1de8ac+'\x27...',()=>_0x40dd7c[_0x308df4(0xd2)]['resolveAgentId'](_0x1de8ac,_0x616657),{'verbose':_0x214d07[_0x308df4(0xaf)]}),_0x411f06=_0x1bc735['data'],_0x59c3c6=await withSpinner(_0x308df4(0xc4),()=>_0x40dd7c['llm']['updateAgent'](_0x411f06,{'name':_0x2f3f0c,'prompt':_0xbf2712,'description':_0x453347,'starterMessage':_0x22371d}),{'verbose':_0x214d07[_0x308df4(0xaf)]});return console[_0x308df4(0xbf)]('Agent\x20updated:\x20'+_0x59c3c6[_0x308df4(0x89)]['id']),await handleSDKOutput([_0x59c3c6['data']],_0x214d07),0x0;}catch(_0x54cf19){return handleSDKError(_0x54cf19,_0x214d07),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a17_0x11bbbf(0x6d)]=a17_0x11bbbf(0x73);['description']=a17_0x11bbbf(0xe3);async[a17_0x11bbbf(0xe4)](_0x48ad54){const _0x3c0463=a17_0x11bbbf,{options:_0x33542f,args:_0x4f5d15,tdx:_0x2e5734}=_0x48ad54;if(_0x4f5d15[_0x3c0463(0x80)]===0x0)return console['error'](_0x3c0463(0x8d)),console[_0x3c0463(0xae)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x239bf7=_0x4f5d15[0x0];try{const _0x47cd4a=await getProjectIdOrDefault(_0x48ad54),_0x216e19=await withSpinner(_0x3c0463(0xc0)+_0x239bf7+_0x3c0463(0xaa),()=>_0x2e5734[_0x3c0463(0xd2)]['resolveAgentId'](_0x239bf7,_0x47cd4a),{'verbose':_0x33542f[_0x3c0463(0xaf)]}),_0x42d1dc=_0x216e19[_0x3c0463(0x89)];return await withSpinner(_0x3c0463(0xbb),()=>_0x2e5734[_0x3c0463(0xd2)][_0x3c0463(0xd0)](_0x42d1dc),{'verbose':_0x33542f['verbose']}),console[_0x3c0463(0xbf)](_0x3c0463(0xf5)+_0x42d1dc),0x0;}catch(_0x4ace61){return handleSDKError(_0x4ace61,_0x33542f),0x1;}}}export class LLMHistoryCommand extends BaseCommand{['name']=a17_0x11bbbf(0xfb);[a17_0x11bbbf(0xa6)]=a17_0x11bbbf(0xf4);async[a17_0x11bbbf(0xe4)](_0x57131d){const _0xbb40f4=a17_0x11bbbf,{options:_0x3db593,args:_0xe19c89,tdx:_0x29e2de}=_0x57131d;let _0x18bcd3=_0xe19c89[0x0];const _0x23e136=_0x3db593,_0x2cf6fa=_0x23e136[_0xbb40f4(0x72)];try{if(_0x2cf6fa){if(_0x18bcd3)return console[_0xbb40f4(0xae)]('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console[_0xbb40f4(0xae)](_0xbb40f4(0x9a)),0x1;const _0x147326=await withSpinner(_0xbb40f4(0x8c),()=>_0x29e2de[_0xbb40f4(0xd2)][_0xbb40f4(0x84)](0x1),{'verbose':_0x3db593[_0xbb40f4(0xaf)]});if(_0x147326[_0xbb40f4(0x89)][_0xbb40f4(0x80)]===0x0)return console[_0xbb40f4(0xbf)](_0xbb40f4(0xee)),0x0;_0x18bcd3=_0x147326[_0xbb40f4(0x89)][0x0]['id'];}if(!_0x18bcd3){const _0x384a99=resolveLimit(_0x3db593[_0xbb40f4(0xe9)],DEFAULT_LLM_LIMIT),_0xaebe99=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x29e2de['llm'][_0xbb40f4(0x84)](_0x384a99),{'verbose':_0x3db593[_0xbb40f4(0xaf)]});if(_0x3db593[_0xbb40f4(0xdc)]==='json'||_0x3db593[_0xbb40f4(0xdc)]==='jsonl')await handleSDKOutput(_0xaebe99['data'],_0x3db593);else{const _0x2233b4=_0xaebe99[_0xbb40f4(0x89)][_0xbb40f4(0xb0)](_0x3bf7c7=>({'created_at':_0x3bf7c7[_0xbb40f4(0xba)][_0xbb40f4(0xfc)],'chat_id':_0x3bf7c7['id'],'first_input':_0x3bf7c7[_0xbb40f4(0xba)]['firstInputContent']||'(no\x20message)'}));await handleSDKOutput(_0x2233b4,_0x3db593);}return 0x0;}else{const _0x48da31=await withSpinner(_0xbb40f4(0xcf)+_0x18bcd3+'\x27...',()=>_0x29e2de[_0xbb40f4(0xd2)][_0xbb40f4(0xf2)](_0x18bcd3),{'verbose':_0x3db593[_0xbb40f4(0xaf)]}),_0x5a7947=_0x48da31['data']['data']??[];if(_0x5a7947[_0xbb40f4(0x80)]===0x0)return console['log'](_0xbb40f4(0x75)),0x0;if(_0x3db593[_0xbb40f4(0xdc)]===_0xbb40f4(0x7d)||_0x3db593[_0xbb40f4(0xdc)]===_0xbb40f4(0xfe)||_0x3db593[_0xbb40f4(0xdc)]===_0xbb40f4(0xc2)||_0x3db593[_0xbb40f4(0xdc)]===_0xbb40f4(0xd6))await handleSDKOutput(_0x5a7947,_0x3db593);else for(const _0x38840d of _0x5a7947){console[_0xbb40f4(0xbf)](formatChatHistoryEntry(_0x38840d,_0x3db593));}return 0x0;}}catch(_0x3f03de){return handleSDKError(_0x3f03de,_0x3db593),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0x11bbbf(0x6d)]=a17_0x11bbbf(0x96);['description']=a17_0x11bbbf(0xc1);async[a17_0x11bbbf(0xe4)](_0x2bee0d){const _0x468d73=a17_0x11bbbf,{options:_0x10719c,args:_0xde7f61,tdx:_0x5ad006}=_0x2bee0d;if(_0xde7f61['length']===0x0)return console[_0x468d73(0xae)](_0x468d73(0x83)),console[_0x468d73(0xae)](_0x468d73(0xd8)),0x1;const _0xf98c29=_0xde7f61[0x0];try{return await withSpinner(_0x468d73(0xe5)+_0xf98c29+_0x468d73(0xaa),()=>_0x5ad006[_0x468d73(0xd2)][_0x468d73(0xc3)](_0xf98c29),{'verbose':_0x10719c['verbose']}),console[_0x468d73(0xbf)](_0x468d73(0x70)+_0xf98c29),0x0;}catch(_0x14d3b6){return handleSDKError(_0x14d3b6,_0x10719c),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a17_0x11bbbf(0x6d)]=a17_0x11bbbf(0x92);[a17_0x11bbbf(0xa6)]=a17_0x11bbbf(0xbe);async['execute'](_0x36f6e0){const _0x4f87aa=a17_0x11bbbf,{options:_0x4c2c54,args:_0x568255,tdx:_0x1e9f01}=_0x36f6e0;if(_0x568255[_0x4f87aa(0x80)]===0x0)return console[_0x4f87aa(0xae)](_0x4f87aa(0x83)),console[_0x4f87aa(0xae)](_0x4f87aa(0x90)),0x1;const _0x258b92=_0x568255[0x0],_0x54fddb=_0x4c2c54,_0x4fe369=_0x54fddb[_0x4f87aa(0xa6)];try{const _0x12485d=await withSpinner('Creating\x20project\x20\x27'+_0x258b92+'\x27...',()=>_0x1e9f01[_0x4f87aa(0xd2)][_0x4f87aa(0x95)]({'name':_0x258b92,'description':_0x4fe369}),{'verbose':_0x4c2c54[_0x4f87aa(0xaf)]});console['log'](_0x4f87aa(0xf6)+_0x12485d[_0x4f87aa(0x89)]['id']);const _0x1362ca=toLLMProjectInfo(_0x12485d['data']);return await handleSDKOutput([_0x1362ca],_0x4c2c54),0x0;}catch(_0x3786f2){return handleSDKError(_0x3786f2,_0x4c2c54),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a17_0x11bbbf(0x6d)]=a17_0x11bbbf(0x81);[a17_0x11bbbf(0xa6)]='Delete\x20an\x20LLM\x20project';async[a17_0x11bbbf(0xe4)](_0x5f40f5){const _0x1426f3=a17_0x11bbbf,{options:_0x377a92,args:_0x4c8cbd,tdx:_0x338f39}=_0x5f40f5;if(_0x4c8cbd[_0x1426f3(0x80)]===0x0)return console['error'](_0x1426f3(0x83)),console[_0x1426f3(0xae)](_0x1426f3(0x71)),0x1;const _0x2efb39=_0x4c8cbd[0x0];try{return await withSpinner(_0x1426f3(0x6e)+_0x2efb39+_0x1426f3(0xaa),()=>_0x338f39[_0x1426f3(0xd2)]['deleteProject'](_0x2efb39),{'verbose':_0x377a92['verbose']}),console['log'](_0x1426f3(0xdd)+_0x2efb39),0x0;}catch(_0x38c9f5){return handleSDKError(_0x38c9f5,_0x377a92),0x1;}}}
|
|
1
|
+
const a17_0x27ab6f=a17_0x1b44;(function(_0xe42838,_0x10d1d9){const _0x1de733=a17_0x1b44,_0x335259=_0xe42838();while(!![]){try{const _0x226a1d=parseInt(_0x1de733(0x143))/0x1*(-parseInt(_0x1de733(0x174))/0x2)+-parseInt(_0x1de733(0x151))/0x3*(-parseInt(_0x1de733(0x149))/0x4)+-parseInt(_0x1de733(0x13b))/0x5+-parseInt(_0x1de733(0x182))/0x6+-parseInt(_0x1de733(0x193))/0x7*(-parseInt(_0x1de733(0x196))/0x8)+parseInt(_0x1de733(0x1c0))/0x9+-parseInt(_0x1de733(0x1a4))/0xa*(-parseInt(_0x1de733(0x1a3))/0xb);if(_0x226a1d===_0x10d1d9)break;else _0x335259['push'](_0x335259['shift']());}catch(_0x5efa57){_0x335259['push'](_0x335259['shift']());}}}(a17_0x3b82,0xc29a3));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';function handleSDKError(_0x1eb583,_0x451647){const _0x3ad4e0=a17_0x1b44;if(_0x1eb583 instanceof SDKError)console[_0x3ad4e0(0x166)](_0x3ad4e0(0x18a)+_0x1eb583[_0x3ad4e0(0x16c)]),_0x451647[_0x3ad4e0(0x16e)]&&(_0x1eb583[_0x3ad4e0(0x198)]&&console[_0x3ad4e0(0x166)](_0x3ad4e0(0x16a)+_0x1eb583[_0x3ad4e0(0x198)]),_0x1eb583['stack']&&(console['error'](_0x3ad4e0(0x14d)),console[_0x3ad4e0(0x166)](_0x1eb583['stack'])));else throw _0x1eb583;}function formatChatHistoryEntry(_0x41c068,_0x1cba78){const _0x771705=a17_0x1b44,_0x3f612c=getChalk(_0x1cba78),_0x7a0a4d=_0x3f612c[_0x771705(0x1b6)](_0x41c068['at']);if(_0x771705(0x1a7)in _0x41c068){const _0x32abdd=_0x3f612c[_0x771705(0x1a0)](_0x771705(0x1a1));return _0x7a0a4d+'\x20'+_0x32abdd+':\x20'+_0x41c068['input'];}if(_0x771705(0x147)in _0x41c068){const _0x47aca5=_0x3f612c[_0x771705(0x172)](_0x771705(0x1b5));return _0x7a0a4d+'\x20'+_0x47aca5+':\x20'+_0x41c068[_0x771705(0x147)];}if(_0x771705(0x140)in _0x41c068){const _0x13c9d6=_0x3f612c[_0x771705(0x136)](_0x771705(0x19f)),{functionName:_0x1d5f9b,functionArguments:_0x4c1c08,targetFunction:_0x5372a1}=_0x41c068[_0x771705(0x140)];let _0x16ec39=_0x7a0a4d+'\x20'+_0x13c9d6+':\x20'+_0x3f612c[_0x771705(0x1ac)](_0x1d5f9b);if(_0x4c1c08&&Object[_0x771705(0x13f)](_0x4c1c08)[_0x771705(0x156)]>0x0){const _0x3da834=Object['entries'](_0x4c1c08)['map'](([_0x5a38bd,_0x504432])=>_0x5a38bd+'='+JSON[_0x771705(0x1af)](_0x504432))[_0x771705(0x160)](',\x20');_0x16ec39+='('+_0x3da834+')';}_0x5372a1&&(_0x16ec39+=_0x3f612c['dim']('\x20['+_0x5372a1+']'));let _0xb6c534='';if(_0x41c068[_0x771705(0x140)][_0x771705(0x19c)])_0xb6c534=_0x771705(0x187)+_0x41c068[_0x771705(0x140)]['targetKnowledgeBase'][_0x771705(0x1c2)];else{if(_0x41c068['tool_call'][_0x771705(0x18b)])_0xb6c534=_0x771705(0x18c)+_0x41c068[_0x771705(0x140)][_0x771705(0x18b)][_0x771705(0x1c2)];else{if(_0x41c068['tool_call'][_0x771705(0x1a6)])_0xb6c534=_0x771705(0x169)+_0x41c068['tool_call'][_0x771705(0x1a6)][_0x771705(0x1c2)];else _0x41c068[_0x771705(0x140)][_0x771705(0x1bf)]&&(_0xb6c534=_0x771705(0x1a8)+_0x41c068[_0x771705(0x140)]['targetImageGenerator'][_0x771705(0x1c2)]);}}return _0x16ec39+_0xb6c534;}if('tool'in _0x41c068){const _0x36e0eb=_0x3f612c[_0x771705(0x16d)](_0x771705(0x159)),{functionName:_0x312ed8,functionArguments:_0xbaae5a,content:_0x29c548,newChat:_0x2d0652}=_0x41c068[_0x771705(0x163)];let _0x6b505a=_0x7a0a4d+'\x20'+_0x36e0eb+':\x20'+_0x3f612c[_0x771705(0x1ac)](_0x312ed8);if(_0xbaae5a){const _0x8f5ca3=typeof _0xbaae5a==='string'?_0xbaae5a:JSON[_0x771705(0x1af)](_0xbaae5a);_0x6b505a+='('+_0x8f5ca3+')';}return _0x29c548&&(_0x6b505a+='\x0a'+_0x3f612c['dim'](_0x29c548)),_0x2d0652&&(_0x6b505a+=_0x3f612c[_0x771705(0x1b6)]('\x20→\x20chat:\x20'+_0x2d0652['id'])),_0x6b505a;}if(_0x771705(0x161)in _0x41c068){const _0xddcad=_0x3f612c['blue'](_0x771705(0x19d));return _0x7a0a4d+'\x20'+_0xddcad+':\x20'+_0x41c068[_0x771705(0x161)]['name']+'\x20('+_0x41c068[_0x771705(0x161)][_0x771705(0x147)][_0x771705(0x156)]+_0x771705(0x1c1);}if('image'in _0x41c068){const _0x236831=_0x3f612c[_0x771705(0x14c)](_0x771705(0x13d)),{width:_0x46534a,height:_0x5ef215,headerText:_0x339151}=_0x41c068['image'],_0xbfbf4c=_0x339151?_0x771705(0x1ba)+_0x339151:'';return _0x7a0a4d+'\x20'+_0x236831+':\x20'+_0x46534a+'x'+_0x5ef215+_0xbfbf4c;}if(_0x771705(0x166)in _0x41c068){const _0x307432=_0x3f612c[_0x771705(0x164)](_0x771705(0x137));return _0x7a0a4d+'\x20'+_0x307432+':\x20'+_0x41c068[_0x771705(0x166)];}return _0x7a0a4d+'\x20'+_0x3f612c['dim'](_0x771705(0x155))+':\x20'+JSON[_0x771705(0x1af)](_0x41c068);}function a17_0x1b44(_0x43a37b,_0x4fc88e){const _0x3b82e3=a17_0x3b82();return a17_0x1b44=function(_0x1b44dc,_0x13dee9){_0x1b44dc=_0x1b44dc-0x132;let _0x1a2c2f=_0x3b82e3[_0x1b44dc];return _0x1a2c2f;},a17_0x1b44(_0x43a37b,_0x4fc88e);}async function getProjectIdOrDefault(_0x7db95c){const _0xf49a33=a17_0x1b44,{tdx:_0x48a80e,options:_0x3b6800}=_0x7db95c,_0x45f1ea=_0x3b6800[_0xf49a33(0x192)];if(_0x45f1ea){const _0x1e5def=await withSpinner(_0xf49a33(0x15c)+_0x45f1ea+_0xf49a33(0x139),()=>_0x48a80e[_0xf49a33(0x19b)][_0xf49a33(0x13c)](_0x45f1ea),{'verbose':_0x3b6800['verbose']});return _0x1e5def[_0xf49a33(0x1b3)];}let _0x4cfd86=_0x48a80e[_0xf49a33(0x19b)][_0xf49a33(0x15e)]();if(_0x4cfd86)return _0x4cfd86;const _0x2ecaab=await withSpinner('Getting\x20default\x20project...',()=>_0x48a80e[_0xf49a33(0x19b)][_0xf49a33(0x146)](),{'verbose':_0x3b6800[_0xf49a33(0x16e)]});return _0x2ecaab['data']['id'];}function toLLMProjectInfo(_0x1c633a){const _0x33c51f=a17_0x1b44;return{'name':_0x1c633a[_0x33c51f(0x153)][_0x33c51f(0x1c2)],'description':_0x1c633a[_0x33c51f(0x153)]['description'],'createdAt':_0x1c633a[_0x33c51f(0x153)]['createdAt'],'updatedAt':_0x1c633a[_0x33c51f(0x153)]['updatedAt']};}function a17_0x3b82(){const _0x8777b7=['map','llm:agent:delete','llm:project:create','LLM_PROJECT_NOT_FOUND','...','llmProject','7TrsUuY','jsonl','projects','12073504gNbjaY','Fetching\x20available\x20models...','cause','Updating\x20agent...','Create\x20a\x20new\x20LLM\x20project','llm','targetKnowledgeBase','[output]\x20','includes','[tool_call]','cyan','[input]\x20\x20','resolveAgentId','297FCGgFM','258710rkvZLX','Fetching\x20chat\x20history\x20for\x20\x27','targetWebSearchTool','input','\x20->\x20ImageGen:','agents','agent','Creating\x20agent\x20\x27','bold','Usage:\x20tdx\x20llm\x20use\x20<project-name>','No\x20messages\x20found\x20in\x20chat\x20history.','stringify','llm:agent:create','Error:\x20Agent\x20name\x20is\x20required','maxToolIterations','data','Create\x20a\x20new\x20agent\x20in\x20current\x20project','[content]','dim','chats','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','prompt','\x20-\x20','No\x20chat\x20sessions\x20found.','llm:project:delete','tsv','createAgent','targetImageGenerator','3795489ilnSdO','\x20bytes)','name','Set\x20current\x20project\x20context','llm:projects','Project\x20not\x20found:\x20','Update\x20an\x20existing\x20agent','yellow','[error]\x20\x20','List\x20available\x20LLM\x20models','\x27...','deleteAgent','2343770CLdTeX','resolveProjectId','[image]\x20\x20','Creating\x20project\x20\x27','keys','tool_call','llm:agent:update','claude-4.5-haiku','1oZfwvI','Error:\x20Project\x20name\x20is\x20required','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','getOrCreateDefaultProject','content','Usage:\x20tdx\x20llm\x20history\x20--last','123524itHoPu','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','Use\x20format:\x20project-name/agent-name','blue','\x0aStack\x20trace:','List\x20all\x20LLM\x20projects','llm:models','(no\x20message)','12iRnleR','filter','attributes','Deleting\x20agent...','[unknown]','length','Fetching\x20chat\x20sessions...','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','[tool]\x20\x20\x20','starterMessage','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Resolving\x20project\x20\x27','updatedAt','getCurrentProject','description','join','output','deleteProject','tool','red','slice','error','split','Agent\x20updated:\x20','\x20->\x20WebSearch:','\x20\x20Cause:\x20','execute','message','magenta','verbose','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','llm:history','createdAt','green','temperature','220648PRSZDa','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','Fetching\x20most\x20recent\x20chat...','INVALID_ARGUMENT','Fetching\x20agent...','find','llm:use','json','format','Setting\x20project\x20context\x20to\x20\x27','Resolving\x20agent\x20\x27','List\x20agents\x20in\x20current\x20project','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','log','8260686WxysqI','updateAgent','systemPrompt','setCurrentProject','Invalid\x20path\x20syntax:\x20','\x20->\x20KB:','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Error:\x20','targetAgent','\x20->\x20Agent:'];a17_0x3b82=function(){return _0x8777b7;};return a17_0x3b82();}function toAgentInfo(_0x42715b){const _0x3f4616=a17_0x1b44;return{'name':_0x42715b[_0x3f4616(0x153)][_0x3f4616(0x1c2)],'description':_0x42715b[_0x3f4616(0x153)]['description'],'prompt':truncatePrompt(_0x42715b['attributes'][_0x3f4616(0x1b9)]),'createdAt':_0x42715b[_0x3f4616(0x153)][_0x3f4616(0x171)],'updatedAt':_0x42715b[_0x3f4616(0x153)][_0x3f4616(0x15d)]};}function truncatePrompt(_0x4bde0f){const _0x359bdb=a17_0x1b44;if(!_0x4bde0f)return undefined;const _0x26756e=0x64;if(_0x4bde0f[_0x359bdb(0x156)]<=_0x26756e)return _0x4bde0f;return _0x4bde0f[_0x359bdb(0x165)](0x0,_0x26756e)+_0x359bdb(0x191);}export class LLMModelsCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x14f);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x138);async[a17_0x27ab6f(0x16b)](_0x48613c){const _0x356b82=a17_0x27ab6f,{options:_0x225787,tdx:_0x1cc98c}=_0x48613c;try{const _0x64126e=await withSpinner(_0x356b82(0x197),()=>_0x1cc98c[_0x356b82(0x19b)]['models'](),{'verbose':_0x225787[_0x356b82(0x16e)]});return await handleSDKOutput(_0x64126e[_0x356b82(0x1b3)],_0x225787),0x0;}catch(_0x281100){return handleSDKError(_0x281100,_0x225787),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']=a17_0x27ab6f(0x133);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x14e);async[a17_0x27ab6f(0x16b)](_0x85021a){const _0x413503=a17_0x27ab6f,{options:_0x50a41b,args:_0x56c127,tdx:_0x2be85c}=_0x85021a;try{const _0x3177ae=_0x56c127[0x0],_0x55fca4=resolveLimit(_0x50a41b['limit'],DEFAULT_LLM_LIMIT),_0x28cec2=await withSpinner('Fetching\x20projects...',()=>_0x2be85c[_0x413503(0x19b)][_0x413503(0x195)](_0x55fca4),{'verbose':_0x50a41b[_0x413503(0x16e)]});let _0x4dd12f=_0x28cec2['data'];_0x3177ae&&(_0x4dd12f=_0x28cec2[_0x413503(0x1b3)]['filter'](_0x3ddbe4=>matchGlobPattern(_0x3ddbe4[_0x413503(0x153)][_0x413503(0x1c2)],_0x3177ae)));const _0x2d2dd3=_0x4dd12f[_0x413503(0x18d)](toLLMProjectInfo);return await handleSDKOutput(_0x2d2dd3,_0x50a41b),0x0;}catch(_0x5afa96){return handleSDKError(_0x5afa96,_0x50a41b),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]='llm:agents';[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x17f);async[a17_0x27ab6f(0x16b)](_0x361731){const _0x4d6413=a17_0x27ab6f,{options:_0x550295,args:_0x1e1f7b,tdx:_0x97eace}=_0x361731;try{const _0x1e4da5=_0x1e1f7b[0x0];let _0x45560a,_0x4a8616=_0x1e4da5;if(_0x1e4da5&&_0x1e4da5['includes']('/')){const _0x2cc57c=_0x1e4da5[_0x4d6413(0x167)]('/');if(_0x2cc57c['length']===0x2){const [_0x51b1a5,_0x1b329c]=_0x2cc57c,_0x210ace=await _0x97eace[_0x4d6413(0x19b)]['projects'](),_0x383fd4=_0x210ace[_0x4d6413(0x179)](_0x58278f=>_0x58278f['attributes']['name']['toLowerCase']()===_0x51b1a5['toLowerCase']());if(!_0x383fd4)throw new SDKError(ErrorCode[_0x4d6413(0x190)],_0x4d6413(0x134)+_0x51b1a5,undefined,{'helpText':_0x4d6413(0x158)});_0x45560a=_0x383fd4['id'],_0x4a8616=_0x1b329c;}else throw new SDKError(ErrorCode[_0x4d6413(0x177)],_0x4d6413(0x186)+_0x1e4da5,undefined,{'helpText':_0x4d6413(0x14b)});}else _0x45560a=await getProjectIdOrDefault(_0x361731);const _0x45b898=await withSpinner('Fetching\x20agents...',()=>_0x97eace[_0x4d6413(0x19b)][_0x4d6413(0x1a9)](_0x45560a),{'verbose':_0x550295[_0x4d6413(0x16e)]});let _0xa746dd=_0x45b898[_0x4d6413(0x1b3)];_0x4a8616&&(_0xa746dd=_0x45b898[_0x4d6413(0x1b3)][_0x4d6413(0x152)](_0x513ab0=>matchGlobPattern(_0x513ab0[_0x4d6413(0x153)][_0x4d6413(0x1c2)],_0x4a8616)));const _0xf64e43=_0xa746dd['map'](toAgentInfo);return await handleSDKOutput(_0xf64e43,_0x550295),0x0;}catch(_0x56fbd2){return handleSDKError(_0x56fbd2,_0x550295),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]='llm:agent:show';[a17_0x27ab6f(0x15f)]='Show\x20agent\x20details';async[a17_0x27ab6f(0x16b)](_0x5daa4b){const _0x89c512=a17_0x27ab6f,{options:_0x57d38d,args:_0x342f78,tdx:_0x4e7f92}=_0x5daa4b;if(_0x342f78[_0x89c512(0x156)]===0x0)return console['error'](_0x89c512(0x1b1)),console[_0x89c512(0x166)]('Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>'),0x1;const _0x309367=_0x342f78[0x0];try{const _0x1a0862=await getProjectIdOrDefault(_0x5daa4b),_0x278b29=await withSpinner('Resolving\x20agent\x20\x27'+_0x309367+_0x89c512(0x139),()=>_0x4e7f92['llm'][_0x89c512(0x1a2)](_0x309367,_0x1a0862),{'verbose':_0x57d38d[_0x89c512(0x16e)]}),_0x294064=await withSpinner(_0x89c512(0x178),()=>_0x4e7f92[_0x89c512(0x19b)][_0x89c512(0x1aa)](_0x278b29['data']),{'verbose':_0x57d38d['verbose']});return await handleSDKOutput([_0x294064[_0x89c512(0x1b3)]],_0x57d38d),0x0;}catch(_0x20b016){return handleSDKError(_0x20b016,_0x57d38d),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a17_0x27ab6f(0x1b0);['description']=a17_0x27ab6f(0x1b4);async[a17_0x27ab6f(0x16b)](_0x304e12){const _0x23e835=a17_0x27ab6f,{options:_0x36eab9,args:_0x53ee6e,tdx:_0x501753}=_0x304e12;if(_0x53ee6e[_0x23e835(0x156)]===0x0)return console[_0x23e835(0x166)](_0x23e835(0x1b1)),console['error'](_0x23e835(0x188)),console['error'](_0x23e835(0x189)),0x1;const _0x1dcd0d=_0x53ee6e[0x0],_0x33eb19=_0x36eab9,_0x3b8909=_0x33eb19[_0x23e835(0x184)],_0x4de2c0=_0x33eb19['model']||_0x23e835(0x142),_0x1714af=_0x33eb19[_0x23e835(0x15a)],_0x2f13bc=_0x33eb19[_0x23e835(0x1b2)]?Number(_0x33eb19[_0x23e835(0x1b2)]):undefined,_0x18e961=_0x33eb19[_0x23e835(0x173)]?Number(_0x33eb19[_0x23e835(0x173)]):undefined;try{let _0xc45611,_0x3bf034;if(_0x1dcd0d[_0x23e835(0x19e)]('/')){const _0x1eec6b=_0x1dcd0d[_0x23e835(0x167)]('/');if(_0x1eec6b[_0x23e835(0x156)]===0x2){const [_0x59c914,_0x1cbd39]=_0x1eec6b,_0x3eedd4=await withSpinner(_0x23e835(0x15c)+_0x59c914+'\x27...',()=>_0x501753['llm'][_0x23e835(0x13c)](_0x59c914),{'verbose':_0x36eab9[_0x23e835(0x16e)]});_0xc45611=_0x3eedd4['data'],_0x3bf034=_0x1cbd39;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x23e835(0x186)+_0x1dcd0d,undefined,{'helpText':_0x23e835(0x14b)});}else _0xc45611=await getProjectIdOrDefault(_0x304e12),_0x3bf034=_0x1dcd0d;const _0x4f882a=await withSpinner(_0x23e835(0x1ab)+_0x3bf034+_0x23e835(0x139),()=>_0x501753['llm'][_0x23e835(0x1be)]({'name':_0x3bf034,'projectId':_0xc45611,'modelType':_0x4de2c0,'systemPrompt':_0x3b8909,'starterMessage':_0x1714af,'maxToolIterations':_0x2f13bc,'temperature':_0x18e961}),{'verbose':_0x36eab9[_0x23e835(0x16e)]});return console['log']('Agent\x20created:\x20'+_0x4f882a[_0x23e835(0x1b3)]['id']),await handleSDKOutput([_0x4f882a[_0x23e835(0x1b3)]],_0x36eab9),0x0;}catch(_0x5304f0){return handleSDKError(_0x5304f0,_0x36eab9),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x141);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x135);async['execute'](_0x19f277){const _0x546191=a17_0x27ab6f,{options:_0x4f7d78,args:_0x2dbe11,tdx:_0x1ceb8c}=_0x19f277;if(_0x2dbe11[_0x546191(0x156)]===0x0)return console[_0x546191(0x166)](_0x546191(0x1b1)),console[_0x546191(0x166)](_0x546191(0x145)),0x1;const _0x5bee63=_0x2dbe11[0x0],_0xe4d7cb=_0x4f7d78,_0x51a26a=_0xe4d7cb[_0x546191(0x1c2)],_0x365a01=_0xe4d7cb['prompt'],_0x2b3ac3=_0xe4d7cb['description'],_0x39d911=_0xe4d7cb['starterMessage'];if(!_0x51a26a&&!_0x365a01&&!_0x2b3ac3&&!_0x39d911)return console['error'](_0x546191(0x15b)),console[_0x546191(0x166)]('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0x41a0ec=await getProjectIdOrDefault(_0x19f277),_0x3aa439=await withSpinner(_0x546191(0x17e)+_0x5bee63+_0x546191(0x139),()=>_0x1ceb8c[_0x546191(0x19b)][_0x546191(0x1a2)](_0x5bee63,_0x41a0ec),{'verbose':_0x4f7d78[_0x546191(0x16e)]}),_0x105e82=_0x3aa439['data'],_0x7b8e94=await withSpinner(_0x546191(0x199),()=>_0x1ceb8c[_0x546191(0x19b)][_0x546191(0x183)](_0x105e82,{'name':_0x51a26a,'prompt':_0x365a01,'description':_0x2b3ac3,'starterMessage':_0x39d911}),{'verbose':_0x4f7d78[_0x546191(0x16e)]});return console[_0x546191(0x181)](_0x546191(0x168)+_0x7b8e94[_0x546191(0x1b3)]['id']),await handleSDKOutput([_0x7b8e94['data']],_0x4f7d78),0x0;}catch(_0x16fb83){return handleSDKError(_0x16fb83,_0x4f7d78),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a17_0x27ab6f(0x18e);[a17_0x27ab6f(0x15f)]='Delete\x20an\x20agent';async['execute'](_0x3ba2d5){const _0x27d345=a17_0x27ab6f,{options:_0x3bf17d,args:_0x46bea8,tdx:_0x49eec3}=_0x3ba2d5;if(_0x46bea8[_0x27d345(0x156)]===0x0)return console[_0x27d345(0x166)](_0x27d345(0x1b1)),console[_0x27d345(0x166)](_0x27d345(0x16f)),0x1;const _0x35ff2e=_0x46bea8[0x0];try{const _0x56673c=await getProjectIdOrDefault(_0x3ba2d5),_0x4326e5=await withSpinner(_0x27d345(0x17e)+_0x35ff2e+_0x27d345(0x139),()=>_0x49eec3[_0x27d345(0x19b)][_0x27d345(0x1a2)](_0x35ff2e,_0x56673c),{'verbose':_0x3bf17d[_0x27d345(0x16e)]}),_0x441160=_0x4326e5[_0x27d345(0x1b3)];return await withSpinner(_0x27d345(0x154),()=>_0x49eec3['llm'][_0x27d345(0x13a)](_0x441160),{'verbose':_0x3bf17d['verbose']}),console[_0x27d345(0x181)]('Agent\x20deleted:\x20'+_0x441160),0x0;}catch(_0x32fc7e){return handleSDKError(_0x32fc7e,_0x3bf17d),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x170);['description']=a17_0x27ab6f(0x1b8);async[a17_0x27ab6f(0x16b)](_0x5142f4){const _0x18b8f3=a17_0x27ab6f,{options:_0x4df3f5,args:_0x23bd64,tdx:_0x1646d9}=_0x5142f4;let _0x2952a8=_0x23bd64[0x0];const _0x24f00b=_0x4df3f5,_0x18e4d4=_0x24f00b['last'];try{if(_0x18e4d4){if(_0x2952a8)return console['error'](_0x18b8f3(0x175)),console['error'](_0x18b8f3(0x148)),0x1;const _0x391a62=await withSpinner(_0x18b8f3(0x176),()=>_0x1646d9[_0x18b8f3(0x19b)]['chats'](0x1),{'verbose':_0x4df3f5[_0x18b8f3(0x16e)]});if(_0x391a62[_0x18b8f3(0x1b3)]['length']===0x0)return console['log'](_0x18b8f3(0x1bb)),0x0;_0x2952a8=_0x391a62[_0x18b8f3(0x1b3)][0x0]['id'];}if(!_0x2952a8){const _0x335838=resolveLimit(_0x4df3f5['limit'],DEFAULT_LLM_LIMIT),_0x2f831b=await withSpinner(_0x18b8f3(0x157),()=>_0x1646d9[_0x18b8f3(0x19b)][_0x18b8f3(0x1b7)](_0x335838),{'verbose':_0x4df3f5[_0x18b8f3(0x16e)]});if(_0x4df3f5[_0x18b8f3(0x17c)]===_0x18b8f3(0x17b)||_0x4df3f5[_0x18b8f3(0x17c)]===_0x18b8f3(0x194))await handleSDKOutput(_0x2f831b[_0x18b8f3(0x1b3)],_0x4df3f5);else{const _0x3d82b7=_0x2f831b['data'][_0x18b8f3(0x18d)](_0xba08e3=>({'created_at':_0xba08e3[_0x18b8f3(0x153)][_0x18b8f3(0x171)],'chat_id':_0xba08e3['id'],'first_input':_0xba08e3[_0x18b8f3(0x153)]['firstInputContent']||_0x18b8f3(0x150)}));await handleSDKOutput(_0x3d82b7,_0x4df3f5);}return 0x0;}else{const _0x3d8645=await withSpinner(_0x18b8f3(0x1a5)+_0x2952a8+_0x18b8f3(0x139),()=>_0x1646d9[_0x18b8f3(0x19b)]['history'](_0x2952a8),{'verbose':_0x4df3f5[_0x18b8f3(0x16e)]}),_0x47038e=_0x3d8645[_0x18b8f3(0x1b3)][_0x18b8f3(0x1b3)]??[];if(_0x47038e['length']===0x0)return console[_0x18b8f3(0x181)](_0x18b8f3(0x1ae)),0x0;if(_0x4df3f5[_0x18b8f3(0x17c)]==='json'||_0x4df3f5['format']==='jsonl'||_0x4df3f5[_0x18b8f3(0x17c)]==='table'||_0x4df3f5[_0x18b8f3(0x17c)]===_0x18b8f3(0x1bd))await handleSDKOutput(_0x47038e,_0x4df3f5);else for(const _0x1d15c7 of _0x47038e){console['log'](formatChatHistoryEntry(_0x1d15c7,_0x4df3f5));}return 0x0;}}catch(_0x486e99){return handleSDKError(_0x486e99,_0x4df3f5),0x1;}}}export class LLMUseCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x17a);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x132);async[a17_0x27ab6f(0x16b)](_0x596ac0){const _0x588c75=a17_0x27ab6f,{options:_0x27bbbf,args:_0x5a36db,tdx:_0x16d703}=_0x596ac0;if(_0x5a36db[_0x588c75(0x156)]===0x0)return console[_0x588c75(0x166)](_0x588c75(0x144)),console['error'](_0x588c75(0x1ad)),0x1;const _0x18081a=_0x5a36db[0x0];try{return await withSpinner(_0x588c75(0x17d)+_0x18081a+_0x588c75(0x139),()=>_0x16d703[_0x588c75(0x19b)][_0x588c75(0x185)](_0x18081a),{'verbose':_0x27bbbf[_0x588c75(0x16e)]}),console['log']('Project\x20context\x20set\x20to:\x20'+_0x18081a),0x0;}catch(_0x2d4bf4){return handleSDKError(_0x2d4bf4,_0x27bbbf),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a17_0x27ab6f(0x18f);[a17_0x27ab6f(0x15f)]=a17_0x27ab6f(0x19a);async[a17_0x27ab6f(0x16b)](_0x54d0f0){const _0x1ed0ff=a17_0x27ab6f,{options:_0x5c9940,args:_0x2a5fcc,tdx:_0x557c80}=_0x54d0f0;if(_0x2a5fcc[_0x1ed0ff(0x156)]===0x0)return console[_0x1ed0ff(0x166)](_0x1ed0ff(0x144)),console[_0x1ed0ff(0x166)](_0x1ed0ff(0x180)),0x1;const _0x455501=_0x2a5fcc[0x0],_0x318210=_0x5c9940,_0x2946e2=_0x318210[_0x1ed0ff(0x15f)];try{const _0x3eda05=await withSpinner(_0x1ed0ff(0x13e)+_0x455501+'\x27...',()=>_0x557c80[_0x1ed0ff(0x19b)]['createProject']({'name':_0x455501,'description':_0x2946e2}),{'verbose':_0x5c9940['verbose']});console[_0x1ed0ff(0x181)]('Project\x20created:\x20'+_0x3eda05[_0x1ed0ff(0x1b3)]['id']);const _0xbff244=toLLMProjectInfo(_0x3eda05[_0x1ed0ff(0x1b3)]);return await handleSDKOutput([_0xbff244],_0x5c9940),0x0;}catch(_0x2ebc99){return handleSDKError(_0x2ebc99,_0x5c9940),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a17_0x27ab6f(0x1c2)]=a17_0x27ab6f(0x1bc);[a17_0x27ab6f(0x15f)]='Delete\x20an\x20LLM\x20project';async[a17_0x27ab6f(0x16b)](_0x4bf48b){const _0x539dd=a17_0x27ab6f,{options:_0x56a5a1,args:_0x418b41,tdx:_0x7bd6b8}=_0x4bf48b;if(_0x418b41[_0x539dd(0x156)]===0x0)return console[_0x539dd(0x166)](_0x539dd(0x144)),console[_0x539dd(0x166)](_0x539dd(0x14a)),0x1;const _0x2ffdd8=_0x418b41[0x0];try{return await withSpinner('Deleting\x20project\x20\x27'+_0x2ffdd8+'\x27...',()=>_0x7bd6b8[_0x539dd(0x19b)][_0x539dd(0x162)](_0x2ffdd8),{'verbose':_0x56a5a1[_0x539dd(0x16e)]}),console[_0x539dd(0x181)]('Project\x20deleted:\x20'+_0x2ffdd8),0x0;}catch(_0x1ac122){return handleSDKError(_0x1ac122,_0x56a5a1),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a18_0x49bc2d=a18_0x2d82;(function(_0x7478e1,_0x3d23da){const _0x4548d5=a18_0x2d82,_0xaa2c35=_0x7478e1();while(!![]){try{const _0xdd8a81=parseInt(_0x4548d5(0x1e4))/0x1+parseInt(_0x4548d5(0x1d6))/0x2+-parseInt(_0x4548d5(0x1fa))/0x3*(parseInt(_0x4548d5(0x200))/0x4)+-parseInt(_0x4548d5(0x1f2))/0x5*(-parseInt(_0x4548d5(0x1da))/0x6)+-parseInt(_0x4548d5(0x1e3))/0x7+parseInt(_0x4548d5(0x1ff))/0x8+parseInt(_0x4548d5(0x1e2))/0x9*(-parseInt(_0x4548d5(0x209))/0xa);if(_0xdd8a81===_0x3d23da)break;else _0xaa2c35['push'](_0xaa2c35['shift']());}catch(_0x35040c){_0xaa2c35['push'](_0xaa2c35['shift']());}}}(a18_0x1924,0xe8f03));function a18_0x2d82(_0x5418f4,_0x452275){const _0x1924b5=a18_0x1924();return a18_0x2d82=function(_0x2d82d6,_0x257c5e){_0x2d82d6=_0x2d82d6-0x1d1;let _0x5edf17=_0x1924b5[_0x2d82d6];return _0x5edf17;},a18_0x2d82(_0x5418f4,_0x452275);}import a18_0x1987d7 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';function a18_0x1924(){const _0x39b422=['\x0aClaude\x20Code\x20Configuration:','llm','2794895mKNbcu','\x20\x20Address:','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','server','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','log','bold','created\x20on-demand\x20per\x20model','1332AayzJg','SIGINT','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','14668992dgkzgC','13844uACQaB','stop','NOT_FOUND','name','start','\x20\x20Project:','\x0aTesting\x20with\x20Agent\x20SDK:','logLevel','attributes','14841740RMSWOX','find','init','Project\x20\x27','Starting\x20proxy\x20server...','cyan','projects','\x20\x20\x20\x20\x22env\x22:\x20{','2458146HixOGq','close','green','\x20is\x20unavailable,\x20using\x20port\x20','12XxpnCc','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','✓\x20Proxy\x20server\x20stopped','project','\x20\x20}','dim','\x20\x20{','white','9UYAPer','9151093KxGVVm','1101617nFdbvQ','http://0.0.0.0:','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','yellow','execute','SIGTERM','\x20\x20Agents:','llmProject','logger','port','llm:proxy','\x20\x20\x20\x20}'];a18_0x1924=function(){return _0x39b422;};return a18_0x1924();}async function getProjectIdOrDefault(_0x22f805,_0x3dc13f){const _0xe88b48=a18_0x2d82,{tdx:_0x36af3b,options:_0x1051ff}=_0x22f805,_0x2bc84c=_0x3dc13f||_0x1051ff[_0xe88b48(0x1eb)];if(_0x2bc84c){const _0x121bc4=await _0x36af3b[_0xe88b48(0x1f1)]['projects'](),_0x2c6cb2=_0x121bc4['find'](_0x2814b9=>_0x2814b9[_0xe88b48(0x208)][_0xe88b48(0x203)]===_0x2bc84c);if(!_0x2c6cb2)throw new SDKError(ErrorCode[_0xe88b48(0x202)],_0xe88b48(0x1d1)+_0x2bc84c+'\x27\x20not\x20found',undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x2c6cb2['id'];}const _0x41c6d3=await _0x36af3b['llm']['getOrCreateDefaultProject']();return _0x41c6d3['id'];}export class LLMProxyCommand extends BaseCommand{['name']=a18_0x49bc2d(0x1ee);['description']=a18_0x49bc2d(0x1fe);['server'];[a18_0x49bc2d(0x1ec)];async[a18_0x49bc2d(0x1e8)](_0x3c5f2a){const _0x14d092=a18_0x49bc2d,{tdx:_0x5ac90c,options:_0xb0c71f}=_0x3c5f2a;try{const _0x30b1f0=_0xb0c71f,_0x4c221e=_0x30b1f0[_0x14d092(0x1ed)]||0xfa0,_0x24278c=_0x30b1f0[_0x14d092(0x1dd)],_0x129964=await findAvailablePort(_0x4c221e);console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)]('Resolving\x20project...'));const _0x226c47=await getProjectIdOrDefault(_0x3c5f2a,_0x24278c),_0x1443a3=await _0x5ac90c[_0x14d092(0x1f1)][_0x14d092(0x1d4)](),_0x21d8bc=_0x1443a3[_0x14d092(0x20a)](_0x6c9ea3=>_0x6c9ea3['id']===_0x226c47);this[_0x14d092(0x1ec)]=new TDXLogger(_0xb0c71f[_0x14d092(0x207)]),await this['logger'][_0x14d092(0x20b)](),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x1d2)));_0x129964!==_0x4c221e&&console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e7)]('Port\x20'+_0x4c221e+_0x14d092(0x1d9)+_0x129964));this['server']=new ProxyServer({'port':_0x129964,'projectId':_0x226c47,'tdx':_0x5ac90c,'logger':this[_0x14d092(0x1ec)]}),await this[_0x14d092(0x1f5)][_0x14d092(0x204)](),console['log'](a18_0x1987d7['yellow'][_0x14d092(0x1f8)]('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e7)](_0x14d092(0x1fc))),console[_0x14d092(0x1f7)](a18_0x1987d7['yellow']('Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a')),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1d8)][_0x14d092(0x1f8)]('✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a')),console['log'](a18_0x1987d7[_0x14d092(0x1d3)]('Server\x20Configuration:')),console[_0x14d092(0x1f7)](a18_0x1987d7['dim'](_0x14d092(0x1f3)),a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1e5)+_0x129964)),console['log'](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x205)),a18_0x1987d7[_0x14d092(0x1e1)](_0x21d8bc?.[_0x14d092(0x208)][_0x14d092(0x203)]||_0x226c47)),console['log'](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x1ea)),a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1f9))),console['log'](a18_0x1987d7['dim']('\x20\x20Site:'),a18_0x1987d7[_0x14d092(0x1e1)](_0xb0c71f['site'])),console[_0x14d092(0x1f7)](a18_0x1987d7['cyan'](_0x14d092(0x1f0))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)]('\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a')),console['log'](a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1e0))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1d5))),console['log'](a18_0x1987d7['white'](_0x14d092(0x1f4)+_0x129964+'\x22,')),console['log'](a18_0x1987d7['white'](_0x14d092(0x1db))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1ef))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e1)](_0x14d092(0x1de))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1d3)](_0x14d092(0x206))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)]('\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK')),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x1f6))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1df)](_0x14d092(0x1fd))),console[_0x14d092(0x1f7)](a18_0x1987d7[_0x14d092(0x1e7)](_0x14d092(0x1e6)));const _0x237d02=async()=>{const _0x4a2e7a=_0x14d092;console['log'](a18_0x1987d7[_0x4a2e7a(0x1df)]('\x0a\x0aShutting\x20down\x20proxy\x20server...')),this[_0x4a2e7a(0x1f5)]&&await this[_0x4a2e7a(0x1f5)][_0x4a2e7a(0x201)](),this[_0x4a2e7a(0x1ec)]&&await this[_0x4a2e7a(0x1ec)][_0x4a2e7a(0x1d7)](),console[_0x4a2e7a(0x1f7)](a18_0x1987d7[_0x4a2e7a(0x1d8)](_0x4a2e7a(0x1dc))),process['exit'](0x0);};return process['on'](_0x14d092(0x1fb),_0x237d02),process['on'](_0x14d092(0x1e9),_0x237d02),await new Promise(()=>{}),0x0;}catch(_0x1979f7){this['server']&&await this[_0x14d092(0x1f5)][_0x14d092(0x201)]();this[_0x14d092(0x1ec)]&&await this[_0x14d092(0x1ec)][_0x14d092(0x1d7)]();throw _0x1979f7;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a19_0x26bf(_0x2d2dd4,_0x1ea68e){const _0x2900b3=a19_0x2900();return a19_0x26bf=function(_0x26bfe4,_0x54cf17){_0x26bfe4=_0x26bfe4-0xa2;let _0x1b842c=_0x2900b3[_0x26bfe4];return _0x1b842c;},a19_0x26bf(_0x2d2dd4,_0x1ea68e);}const a19_0x2ef768=a19_0x26bf;(function(_0x4ef89c,_0x2d2e55){const _0xb1e107=a19_0x26bf,_0x480a19=_0x4ef89c();while(!![]){try{const _0x4b5a4b=parseInt(_0xb1e107(0xb8))/0x1+-parseInt(_0xb1e107(0xc3))/0x2*(parseInt(_0xb1e107(0xc8))/0x3)+-parseInt(_0xb1e107(0xbb))/0x4*(-parseInt(_0xb1e107(0xa2))/0x5)+-parseInt(_0xb1e107(0xa5))/0x6*(parseInt(_0xb1e107(0xcd))/0x7)+parseInt(_0xb1e107(0xb4))/0x8+-parseInt(_0xb1e107(0xc1))/0x9+-parseInt(_0xb1e107(0xba))/0xa*(-parseInt(_0xb1e107(0xb1))/0xb);if(_0x4b5a4b===_0x2d2e55)break;else _0x480a19['push'](_0x480a19['shift']());}catch(_0xdd44b4){_0x480a19['push'](_0x480a19['shift']());}}}(a19_0x2900,0xea726));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a19_0x2900(){const _0x1e38fd=['Updating\x20parent\x20segment\x20\x27','scheduleType','Site:\x20','✔\x20Updated\x20parent\x20segment\x20\x27','10eUptUH','Table:\x20','segment','36gtRjVf','timezone','\x27\x20with\x20ID:\x20','Fetching\x20current\x20configuration\x20for\x20\x27','database','behaviorsFile','addBehaviorsFile','data','customerGroupFile','Create\x20new\x20parent\x20segment\x20(audience)','segment:parent:create','behaviors','1133YQbyAE','addBehaviors','Database:\x20','3311488XWdnKt','attributes','description','segment:parent:update','37344XqIEka','execute','281180CfJKVX','2969012zmlysu','updateParent','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','length','Name:\x20','table','7198209OYuigT','Creating\x20parent\x20segment\x20\x27','3130562opKSDW','name','Parent\x20segment:\x20','✔\x20Created\x20parent\x20segment\x20\x27','attributesFile','3pHRSOF','error','customerGroup','addAttributesFile','verbose','1757658tsOGfj','site','\x27...','master','scheduleOption'];a19_0x2900=function(){return _0x1e38fd;};return a19_0x2900();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x2ef768(0xc4)]=a19_0x2ef768(0xaf);['description']=a19_0x2ef768(0xae);async['execute'](_0x38c1cb){const _0x4af2f4=a19_0x2ef768,{options:_0x214624,args:_0x1d7f57,tdx:_0xe41a52}=_0x38c1cb,_0x280f89=_0x214624;if(_0x1d7f57[_0x4af2f4(0xbe)]===0x0)return console[_0x4af2f4(0xc9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x4af2f4(0xc9)](_0x4af2f4(0xbd)),0x1;const _0x2ff083=_0x1d7f57[0x0];if(!_0x280f89[_0x4af2f4(0xa9)]||!_0x280f89[_0x4af2f4(0xc0)])return console[_0x4af2f4(0xc9)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x4af2f4(0xc9)](_0x4af2f4(0xbd)),0x1;_0x280f89[_0x4af2f4(0xcc)]&&(console['error']('Site:\x20'+_0x280f89['site']),console[_0x4af2f4(0xc9)](_0x4af2f4(0xbf)+_0x2ff083),console[_0x4af2f4(0xc9)](_0x4af2f4(0xb3)+_0x280f89[_0x4af2f4(0xa9)]),console[_0x4af2f4(0xc9)](_0x4af2f4(0xa3)+_0x280f89['table']));const _0x338d7a=await loadJSONFromOptions(_0x280f89[_0x4af2f4(0xb5)],_0x280f89[_0x4af2f4(0xc7)]),_0x37d2df=await loadJSONFromOptions(_0x280f89[_0x4af2f4(0xb0)],_0x280f89[_0x4af2f4(0xaa)]),_0xd9edca=await loadJSONFromOptions(_0x280f89[_0x4af2f4(0xca)],_0x280f89[_0x4af2f4(0xad)]),_0xa6b526={'name':_0x2ff083,'description':_0x280f89[_0x4af2f4(0xb6)],'scheduleType':_0x280f89[_0x4af2f4(0xd3)],'scheduleOption':_0x280f89[_0x4af2f4(0xd1)],'timezone':_0x280f89[_0x4af2f4(0xa6)],'master':{'parentDatabaseName':_0x280f89[_0x4af2f4(0xa9)],'parentTableName':_0x280f89[_0x4af2f4(0xc0)]},'attributes':_0x338d7a,'behaviors':_0x37d2df,'customerGroup':_0xd9edca},_0x1e32e5=await withSpinner(_0x4af2f4(0xc2)+_0x2ff083+_0x4af2f4(0xcf),()=>_0xe41a52[_0x4af2f4(0xa4)]['createParent'](_0xa6b526),{'verbose':_0x214624[_0x4af2f4(0xcc)]}),_0x34e85e=_0x1e32e5[_0x4af2f4(0xac)];return console['error'](_0x4af2f4(0xc6)+_0x34e85e[_0x4af2f4(0xc4)]+_0x4af2f4(0xa7)+_0x34e85e['id']),await handleSDKOutput([_0x34e85e],_0x214624),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a19_0x2ef768(0xc4)]=a19_0x2ef768(0xb7);[a19_0x2ef768(0xb6)]='Update\x20existing\x20parent\x20segment\x20(audience)';async[a19_0x2ef768(0xb9)](_0x46730c){const _0x5dc6d5=a19_0x2ef768,{options:_0x100e65,args:_0x50da2c,tdx:_0x1431aa}=_0x46730c,_0x2b221f=_0x100e65;if(_0x50da2c['length']===0x0)return console[_0x5dc6d5(0xc9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x5dc6d5(0xc9)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x418c3a=_0x50da2c[0x0];_0x2b221f[_0x5dc6d5(0xcc)]&&(console[_0x5dc6d5(0xc9)](_0x5dc6d5(0xd4)+_0x2b221f[_0x5dc6d5(0xce)]),console[_0x5dc6d5(0xc9)](_0x5dc6d5(0xc5)+_0x418c3a));const _0x3f2c25=await withSpinner(_0x5dc6d5(0xa8)+_0x418c3a+_0x5dc6d5(0xcf),()=>_0x1431aa[_0x5dc6d5(0xa4)]['getParentFull'](_0x418c3a),{'verbose':_0x2b221f['verbose']}),_0x38757e=_0x3f2c25[_0x5dc6d5(0xac)],_0x3092ce=await loadJSONFromOptions(_0x2b221f['addAttributes'],_0x2b221f[_0x5dc6d5(0xcb)]),_0x2875ce=await loadJSONFromOptions(_0x2b221f[_0x5dc6d5(0xb2)],_0x2b221f[_0x5dc6d5(0xab)]),_0x54a8ea={'name':_0x38757e[_0x5dc6d5(0xc4)],'description':_0x2b221f[_0x5dc6d5(0xb6)]!==undefined?_0x2b221f[_0x5dc6d5(0xb6)]:_0x38757e[_0x5dc6d5(0xb6)],'scheduleType':_0x2b221f[_0x5dc6d5(0xd3)]!==undefined?_0x2b221f['scheduleType']:_0x38757e['scheduleType'],'scheduleOption':_0x2b221f[_0x5dc6d5(0xd1)]!==undefined?_0x2b221f[_0x5dc6d5(0xd1)]:_0x38757e[_0x5dc6d5(0xd1)],'timezone':_0x2b221f['timezone']!==undefined?_0x2b221f[_0x5dc6d5(0xa6)]:_0x38757e[_0x5dc6d5(0xa6)],'master':_0x38757e[_0x5dc6d5(0xd0)],'attributes':_0x3092ce?[..._0x38757e[_0x5dc6d5(0xb5)]||[],..._0x3092ce]:_0x38757e[_0x5dc6d5(0xb5)],'behaviors':_0x2875ce?[..._0x38757e[_0x5dc6d5(0xb0)]||[],..._0x2875ce]:_0x38757e[_0x5dc6d5(0xb0)],'customerGroup':_0x38757e[_0x5dc6d5(0xca)]},_0x1c6c8e=await withSpinner(_0x5dc6d5(0xd2)+_0x418c3a+_0x5dc6d5(0xcf),()=>_0x1431aa[_0x5dc6d5(0xa4)][_0x5dc6d5(0xbc)](_0x418c3a,_0x54a8ea),{'verbose':_0x2b221f['verbose']}),_0x444356=_0x1c6c8e[_0x5dc6d5(0xac)];return console['error'](_0x5dc6d5(0xd5)+_0x444356[_0x5dc6d5(0xc4)]+'\x27'),await handleSDKOutput([_0x444356],_0x2b221f),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x4ec802=a20_0x1e5c;(function(_0x35e45a,_0x486423){const _0xbdc6ff=a20_0x1e5c,_0xe271b1=_0x35e45a();while(!![]){try{const _0xf09610=-parseInt(_0xbdc6ff(0x167))/0x1+-parseInt(_0xbdc6ff(0x160))/0x2+-parseInt(_0xbdc6ff(0x165))/0x3*(-parseInt(_0xbdc6ff(0x16f))/0x4)+parseInt(_0xbdc6ff(0x16b))/0x5*(-parseInt(_0xbdc6ff(0x170))/0x6)+parseInt(_0xbdc6ff(0x15c))/0x7*(parseInt(_0xbdc6ff(0x164))/0x8)+-parseInt(_0xbdc6ff(0x16a))/0x9+parseInt(_0xbdc6ff(0x163))/0xa;if(_0xf09610===_0x486423)break;else _0xe271b1['push'](_0xe271b1['shift']());}catch(_0x7d67d5){_0xe271b1['push'](_0xe271b1['shift']());}}}(a20_0x172e,0x4d10b));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a20_0x1e5c(_0x4ee7af,_0x273462){const _0x172ef0=a20_0x172e();return a20_0x1e5c=function(_0x1e5ce3,_0x1c3ab){_0x1e5ce3=_0x1e5ce3-0x15c;let _0x23fd12=_0x172ef0[_0x1e5ce3];return _0x23fd12;},a20_0x1e5c(_0x4ee7af,_0x273462);}import{handleSDKOutput}from'../utils/command-output.js';function a20_0x172e(){const _0x233fea=['config','328896HgaHIk','\x20\x20Global:\x20~/.config/tdx/tdx.json','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2124756Hzebwx','1915925OPhCVJ','log','Error:\x20','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','274540fYCGzf','6NuPMIi','14Qllowi','length','map','name','228006Rlnsng','description','error','8596960xZKjcL','699824AodzLB','15HWPPAS'];a20_0x172e=function(){return _0x233fea;};return a20_0x172e();}export class ProfilesCommand extends BaseCommand{[a20_0x4ec802(0x15f)]='profiles';[a20_0x4ec802(0x161)]='List\x20all\x20available\x20profiles';async['execute'](_0x5d9ebe){const _0x365dd1=a20_0x4ec802,{options:_0xa22c2c}=_0x5d9ebe;try{const _0xa98521=listProfiles(),_0x593c5d=getActiveProfile();if(_0xa98521[_0x365dd1(0x15d)]===0x0)return console['log'](_0x365dd1(0x16e)),console['log'](_0x365dd1(0x169)),console[_0x365dd1(0x16c)](_0x365dd1(0x168)),0x0;const _0x55a4d8=_0xa98521[_0x365dd1(0x15e)](_0x15dffa=>{const _0x3aef44=_0x365dd1,_0x2958b1=_0x15dffa['name']===_0x593c5d,_0x39887c=getProfileParams(_0x15dffa['config']);return{'name':_0x15dffa['name'],'active':_0x2958b1,'scope':_0x15dffa['scope'],'description':_0x15dffa[_0x3aef44(0x166)][_0x3aef44(0x161)]||'','params':_0x39887c};});return await handleSDKOutput(_0x55a4d8,_0xa22c2c),0x0;}catch(_0x24a964){return _0x24a964 instanceof Error&&console[_0x365dd1(0x162)](_0x365dd1(0x16d)+_0x24a964['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x3784a5=a21_0x6d66;(function(_0x435af9,_0x1e1984){const _0x4c54bf=a21_0x6d66,_0x105666=_0x435af9();while(!![]){try{const _0x4c0701=-parseInt(_0x4c54bf(0x1da))/0x1*(-parseInt(_0x4c54bf(0x1ea))/0x2)+-parseInt(_0x4c54bf(0x1e1))/0x3*(-parseInt(_0x4c54bf(0x1d8))/0x4)+-parseInt(_0x4c54bf(0x1e5))/0x5+parseInt(_0x4c54bf(0x1fb))/0x6*(parseInt(_0x4c54bf(0x1ff))/0x7)+-parseInt(_0x4c54bf(0x1fc))/0x8+-parseInt(_0x4c54bf(0x203))/0x9*(-parseInt(_0x4c54bf(0x1db))/0xa)+parseInt(_0x4c54bf(0x1ed))/0xb*(-parseInt(_0x4c54bf(0x205))/0xc);if(_0x4c0701===_0x1e1984)break;else _0x105666['push'](_0x105666['shift']());}catch(_0x58b8b4){_0x105666['push'](_0x105666['shift']());}}}(a21_0x4224,0x877b5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a21_0x4224(){const _0x54edf2=['stats','length','Statement\x20','\x20[Job\x20ID:\x20','\x20-\x20','Site:\x20','5716BpwlEC','Run\x20Trino\x20queries\x20(streaming)','189080ZIJIkz','10892970PhPPJp','SQL:\x20','Catalog:\x20','state','options','Executing\x20query\x20[','177yVXQId','name','information_schema','args','5102935uNCiQL','\x0aAll\x20results\x20saved\x20to\x20','Error:\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','message','4drHZUh','setPhase','file','33IUbbKL','totalSplits','completedSplits','jobId','output','join','Executing\x20statement\x20','\x20rows\x20','setJobId','processedRows','originalMessage','verbose','error','elapsedTimeMillis','115254kDJtuU','1976464AiEbrq','site','query','161HnlUTZ','\x20splits','in\x20','push','9lLKjFd','execute','683988aeKLUG','Executing\x20query...'];a21_0x4224=function(){return _0x54edf2;};return a21_0x4224();}import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a21_0x6d66(_0x1b795d,_0x234e30){const _0x42249b=a21_0x4224();return a21_0x6d66=function(_0x6d66e4,_0x1fb81b){_0x6d66e4=_0x6d66e4-0x1d7;let _0x3b2e3c=_0x42249b[_0x6d66e4];return _0x3b2e3c;},a21_0x6d66(_0x1b795d,_0x234e30);}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a21_0x3784a5(0x1e2)]=a21_0x3784a5(0x1fe);['description']=a21_0x3784a5(0x1d9);async[a21_0x3784a5(0x204)](_0x249b94){const _0x26077c=a21_0x3784a5,{options:_0x4cb098,args:_0x183073,tdx:_0x3cc815}=_0x249b94,_0x2ebb6d=_0x183073[0x0],_0x29b437=_0x4cb098[_0x26077c(0x1ec)];let _0x17d80a;if(_0x29b437)try{_0x17d80a=readSqlStatementsFromFile(_0x29b437);}catch(_0x565638){return console[_0x26077c(0x1f9)](_0x26077c(0x1e7)+_0x565638[_0x26077c(0x1e9)]),0x1;}else try{_0x17d80a=splitSqlStatements(_0x2ebb6d);}catch(_0x1b053d){return console[_0x26077c(0x1f9)]('Error:\x20'+_0x1b053d[_0x26077c(0x1e9)]),0x1;}const _0x29019d=_0x4cb098['database']||_0x26077c(0x1e3),_0x347b4a=_0x4cb098['catalog'];try{const _0x140bf8=[],_0x36e695=!!_0x4cb098[_0x26077c(0x1f1)];for(let _0x15ec4a=0x0;_0x15ec4a<_0x17d80a[_0x26077c(0x208)];_0x15ec4a++){const _0x1be4a3=_0x17d80a[_0x15ec4a],_0xfc300a=_0x15ec4a+0x1,_0x4c6049=_0x17d80a[_0x26077c(0x208)],_0x125e1d=_0x4c6049>0x1;_0x4cb098['verbose']&&(console[_0x26077c(0x1f9)]('\x0a'+(_0x125e1d?_0x26077c(0x209)+_0xfc300a+'/'+_0x4c6049+':':'')),console[_0x26077c(0x1f9)](_0x26077c(0x1d7)+_0x4cb098[_0x26077c(0x1fd)]),console['error'](_0x26077c(0x1dd)+(_0x347b4a||'td')),console[_0x26077c(0x1f9)]('Schema:\x20'+_0x29019d),console[_0x26077c(0x1f9)](_0x26077c(0x1dc)+_0x1be4a3));const _0x3776e1=_0x125e1d?_0x26077c(0x1f3)+_0xfc300a+'/'+_0x4c6049+'...':_0x26077c(0x206);try{const _0x571e9e=await withQuerySpinner(_0x3776e1,async _0x59b28d=>{const _0x213d5e=_0x26077c,_0x10a8b7=await _0x3cc815[_0x213d5e(0x1fe)](_0x1be4a3,{'catalog':_0x347b4a,'schema':_0x29019d,'onJobId':_0x20211b=>{const _0x39ff57=_0x213d5e;_0x59b28d[_0x39ff57(0x1f5)](_0x20211b);},'onProgress':_0x24bd2e=>{const _0x309e9b=_0x213d5e;_0x59b28d[_0x309e9b(0x1eb)](_0x309e9b(0x1e0)+_0x24bd2e[_0x309e9b(0x1de)]+']'),_0x59b28d['setExtra'](formatRows(_0x24bd2e[_0x309e9b(0x1f6)])+_0x309e9b(0x1f4)+_0x24bd2e[_0x309e9b(0x1ef)]+'/'+_0x24bd2e[_0x309e9b(0x1ee)]+_0x309e9b(0x200));}});return _0x10a8b7;},{'verbose':_0x4cb098[_0x26077c(0x1f8)]}),_0x4143a1=_0x571e9e['data'],_0x5f46d8=_0x4143a1[_0x26077c(0x1f0)]?_0x26077c(0x20a)+_0x4143a1['jobId']+']':'',_0x174d71=_0x125e1d?_0x26077c(0x209)+_0xfc300a+'/'+_0x4c6049+_0x26077c(0x20b):'';console[_0x26077c(0x1f9)]('✔\x20'+_0x174d71+'Query\x20completed:\x20Processed\x20'+formatRows(_0x4143a1[_0x26077c(0x207)][_0x26077c(0x1f6)])+_0x26077c(0x1f4)+(_0x26077c(0x201)+formatElapsed(_0x4143a1[_0x26077c(0x207)][_0x26077c(0x1fa)])+_0x5f46d8));if(_0x125e1d&&_0x36e695){const _0x472b8a=resolveOutputOptions(_0x4cb098),_0x5cd419=await formatQueryOutput(_0x4143a1,_0x472b8a);_0x140bf8[_0x26077c(0x202)](_0x5cd419);}else await handleQueryOutput(_0x4143a1,_0x4cb098);}catch(_0xbf4a70){const _0xd4613c=_0x125e1d?'Statement\x20'+_0xfc300a+'/'+_0x4c6049+':\x0a':'',_0x1391c1=_0xbf4a70 instanceof SDKError?_0xbf4a70[_0x26077c(0x1f7)]:_0xbf4a70[_0x26077c(0x1e9)];return console['error'](''+_0xd4613c+_0x1391c1),0x1;}}if(_0x17d80a['length']>0x1&&_0x36e695&&_0x140bf8[_0x26077c(0x208)]>0x0){const _0x15c63d=_0x140bf8[_0x26077c(0x1f2)]('\x0a');writeFileSync(_0x4cb098[_0x26077c(0x1f1)],_0x15c63d),console['error'](_0x26077c(0x1e6)+_0x4cb098[_0x26077c(0x1f1)]);}return 0x0;}catch(_0x5634fe){throw _0x5634fe;}}['validate'](_0x3c1292){const _0x3e9cb9=a21_0x3784a5,_0xe842c2=_0x3c1292[_0x3e9cb9(0x1e4)][0x0],_0x4a53a4=_0x3c1292[_0x3e9cb9(0x1df)][_0x3e9cb9(0x1ec)];if(!_0xe842c2&&!_0x4a53a4)return _0x3e9cb9(0x1e8);if(_0xe842c2&&_0x4a53a4)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a22_0xc2df(_0x361e38,_0x2dc8e5){const _0x193009=a22_0x1930();return a22_0xc2df=function(_0xc2df86,_0x409a87){_0xc2df86=_0xc2df86-0xb5;let _0x447cc7=_0x193009[_0xc2df86];return _0x447cc7;},a22_0xc2df(_0x361e38,_0x2dc8e5);}const a22_0x20a446=a22_0xc2df;(function(_0x353b70,_0xcea62d){const _0x5a408c=a22_0xc2df,_0x13c205=_0x353b70();while(!![]){try{const _0x28635f=parseInt(_0x5a408c(0xd2))/0x1+-parseInt(_0x5a408c(0xd3))/0x2*(parseInt(_0x5a408c(0xdb))/0x3)+parseInt(_0x5a408c(0x10e))/0x4+-parseInt(_0x5a408c(0xca))/0x5+parseInt(_0x5a408c(0xda))/0x6+-parseInt(_0x5a408c(0xec))/0x7+-parseInt(_0x5a408c(0x122))/0x8;if(_0x28635f===_0xcea62d)break;else _0x13c205['push'](_0x13c205['shift']());}catch(_0x9060a5){_0x13c205['push'](_0x13c205['shift']());}}}(a22_0x1930,0xc5f03));function a22_0x1930(){const _0x40a3ca=['folderId','limit','7245888nPudLn','getFolder','toLocaleString','Site:\x20','stats','Resolving\x20path\x20\x27','jobId','execute','includes','Resolved\x20parent\x20ID:\x20','description','Fetching\x20parent\x20segment\x20details...','\x20folder','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Resolved\x20type:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','segmentId','Resolved\x20parent\x20folder\x20ID:\x20','createFolder','\x27\x20with\x20ID:\x20','Folder\x20name:\x20','segment:folder:create','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','log','Listing\x20folders\x20for\x20parent\x20\x27','parent','Parent\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20name:\x20','527355oyWdIn','segment:folder:list','Fetching\x20SQL\x20for\x20parent\x20segment...','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','information_schema','Fetching\x20segment\x20details...','replace','Usage:\x20tdx\x20segment\x20describe\x20<path>','364900YVUHiG','356854EhKsyj','Executing\x20segment\x20query...','name','error','message','✔\x20Created\x20folder\x20\x27','jsonl','7152072njmnnr','6aIZCHz','Error:\x20Folder\x20reference\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','segment:sql','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20folder\x20details...','✔\x20Query\x20completed:\x20Processed\x20','Examples:','getParentSQL','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','getSegmentSQL','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolving\x20parent\x20segment\x20\x27','INTERNAL','query','3223836IidPKh','Folder\x20ID\x20missing\x20from\x20resolved\x20path','resolveParentId','SQL\x20query:\x0a','folder','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','segment:show','listFolders','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Segment\x20ID:\x20','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Show\x20segment\x20or\x20folder\x20details','Creating\x20folder\x20\x27','Error:\x20','✔\x20Found\x20','code','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','length','Fetching\x20SQL\x20for\x20segment...','data','Folder\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','elapsedTimeMillis','cause','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','site','getParent','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','verbose','json','segmentPath','4329808VKfHNX','resolvePathToResource','parentId','Show\x20segment\x20folder\x20details','resolveFolderId','processedRows','\x20\x20Cause:\x20','Resolving\x20folder\x20\x27','\x27...','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getSegment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','format','segment:describe','Usage:\x20tdx\x20segment\x20sql\x20<path>','type','Parent\x20segment:\x20','segment'];a22_0x1930=function(){return _0x40a3ca;};return a22_0x1930();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}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';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x20a446(0xd5)]=a22_0x20a446(0x11b);[a22_0x20a446(0xb7)]=a22_0x20a446(0xf9);async[a22_0x20a446(0x129)](_0xe26670){const _0xba8b3f=a22_0x20a446,{options:_0x128f39,args:_0x3fd1d7,tdx:_0x38133a}=_0xe26670;if(_0x3fd1d7[_0xba8b3f(0xff)]===0x0)return console[_0xba8b3f(0xd6)](_0xba8b3f(0xde)),console[_0xba8b3f(0xd6)](_0xba8b3f(0xd1)),console[_0xba8b3f(0xd6)](_0xba8b3f(0xe4)),console[_0xba8b3f(0xd6)](_0xba8b3f(0x10a)),console[_0xba8b3f(0xd6)](_0xba8b3f(0xe1)),console[_0xba8b3f(0xd6)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x14748f=_0x3fd1d7[0x0],_0x3ea231=_0x128f39[_0xba8b3f(0x10d)];let _0x35ecee=_0x14748f;_0x3ea231&&!_0x14748f[_0xba8b3f(0xb5)]('/')&&(_0x35ecee=_0x3ea231+'/'+_0x14748f,_0x128f39['verbose']&&console[_0xba8b3f(0xd6)](_0xba8b3f(0x103)+_0x35ecee));const _0x50bec2=await withSpinner('Resolving\x20path\x20\x27'+_0x35ecee+'\x27...',()=>_0x38133a[_0xba8b3f(0x11f)][_0xba8b3f(0x10f)](_0x35ecee),{'verbose':_0x128f39['verbose']}),_0x36a5ca=_0x50bec2[_0xba8b3f(0x101)];_0x128f39['verbose']&&(console[_0xba8b3f(0xd6)](_0xba8b3f(0xbb)+_0x36a5ca[_0xba8b3f(0x11d)]),console[_0xba8b3f(0xd6)](_0xba8b3f(0xc7)+_0x36a5ca['parentId']),_0x36a5ca[_0xba8b3f(0x120)]&&console['error'](_0xba8b3f(0x102)+_0x36a5ca[_0xba8b3f(0x120)]),_0x36a5ca['segmentId']&&console[_0xba8b3f(0xd6)](_0xba8b3f(0xf5)+_0x36a5ca[_0xba8b3f(0xbd)]));if(_0x36a5ca['type']==='parent'){const _0x50eb7a=await withSpinner(_0xba8b3f(0xb8),()=>_0x38133a[_0xba8b3f(0x11f)][_0xba8b3f(0x109)](_0x36a5ca[_0xba8b3f(0x110)]),{'verbose':_0x128f39[_0xba8b3f(0x10b)]});await handleSDKOutput([_0x50eb7a['data']],_0x128f39);}else{if(_0x36a5ca['type']===_0xba8b3f(0xf0)){if(!_0x36a5ca['folderId'])throw new SDKError(ErrorCode['INTERNAL'],_0xba8b3f(0xed));const _0x32b674=await withSpinner(_0xba8b3f(0xe2),()=>_0x38133a[_0xba8b3f(0x11f)][_0xba8b3f(0x123)](_0x36a5ca['folderId']),{'verbose':_0x128f39[_0xba8b3f(0x10b)]});await handleSDKOutput([_0x32b674[_0xba8b3f(0x101)]],_0x128f39);}else{if(_0x36a5ca[_0xba8b3f(0x11d)]===_0xba8b3f(0x11f)){if(!_0x36a5ca[_0xba8b3f(0xbd)])throw new SDKError(ErrorCode[_0xba8b3f(0xea)],_0xba8b3f(0xc8));const _0x5da8a9=await withSpinner(_0xba8b3f(0xcf),()=>_0x38133a[_0xba8b3f(0x11f)][_0xba8b3f(0x118)](_0x36a5ca[_0xba8b3f(0x110)],_0x36a5ca[_0xba8b3f(0xbd)]),{'verbose':_0x128f39['verbose']});await handleSDKOutput([_0x5da8a9[_0xba8b3f(0x101)]],_0x128f39);}}}return 0x0;}catch(_0x42e236){if(_0x42e236 instanceof SDKError)return console[_0xba8b3f(0xd6)]('Error:\x20'+_0x42e236['message']),_0x42e236[_0xba8b3f(0x105)]&&console[_0xba8b3f(0xd6)](_0xba8b3f(0x114)+_0x42e236[_0xba8b3f(0x105)]),0x1;throw _0x42e236;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x20a446(0xd5)]=a22_0x20a446(0xf2);['description']=a22_0x20a446(0xe8);async[a22_0x20a446(0x129)](_0x451d64){const _0x34cb32=a22_0x20a446,{options:_0x28832a,args:_0x16e16c,tdx:_0x1f16b3}=_0x451d64;if(_0x16e16c[_0x34cb32(0xff)]===0x0)return console[_0x34cb32(0xd6)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x34cb32(0xd6)]('Examples:'),console[_0x34cb32(0xd6)](_0x34cb32(0xdf)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x34cb32(0xd6)](_0x34cb32(0xf7)),0x1;try{const _0x5aaa16=_0x16e16c[0x0],_0x289924=_0x28832a[_0x34cb32(0x10d)];let _0x35c01d=_0x5aaa16;_0x289924&&!_0x5aaa16['includes']('/')&&(_0x35c01d=_0x289924+'/'+_0x5aaa16,_0x28832a[_0x34cb32(0x10b)]&&console['error'](_0x34cb32(0x103)+_0x35c01d));const _0x2db568=await withSpinner(_0x34cb32(0x127)+_0x35c01d+_0x34cb32(0x116),()=>_0x1f16b3['segment'][_0x34cb32(0x10f)](_0x35c01d),{'verbose':_0x28832a[_0x34cb32(0x10b)]}),_0x30cd0a=_0x2db568[_0x34cb32(0x101)];_0x28832a['verbose']&&(console[_0x34cb32(0xd6)](_0x34cb32(0xbb)+_0x30cd0a[_0x34cb32(0x11d)]),console[_0x34cb32(0xd6)](_0x34cb32(0xc7)+_0x30cd0a['parentId']));if(_0x30cd0a[_0x34cb32(0x11d)]===_0x34cb32(0xf0))return console['error'](_0x34cb32(0xbc)),console['error'](_0x34cb32(0xf1)),0x1;let _0x524c8a;if(_0x30cd0a[_0x34cb32(0x11d)]===_0x34cb32(0xc6)){const _0x42da27=await withSpinner(_0x34cb32(0xcc),()=>_0x1f16b3[_0x34cb32(0x11f)][_0x34cb32(0xe5)](_0x30cd0a[_0x34cb32(0x110)]),{'verbose':_0x28832a[_0x34cb32(0x10b)]});_0x524c8a=_0x42da27['data'];}else{if(!_0x30cd0a[_0x34cb32(0xbd)])throw new SDKError(ErrorCode['INTERNAL'],_0x34cb32(0xc8));const _0x1c34e0=await withSpinner(_0x34cb32(0x100),()=>_0x1f16b3['segment'][_0x34cb32(0xe7)](_0x30cd0a[_0x34cb32(0x110)],_0x30cd0a[_0x34cb32(0xbd)]),{'verbose':_0x28832a['verbose']});_0x524c8a=_0x1c34e0[_0x34cb32(0x101)];}const _0x4e279d=resolveLimit(_0x28832a[_0x34cb32(0x121)],DEFAULT_DISPLAY_LIMIT),_0x30c295=/\bLIMIT\s+\d+/i['test'](_0x524c8a);!_0x30c295&&(_0x524c8a=_0x524c8a['trim']()[_0x34cb32(0xd0)](/;+$/,''),_0x524c8a='SELECT\x20*\x20FROM\x20(\x0a'+_0x524c8a+_0x34cb32(0xcd)+_0x4e279d);_0x28832a['verbose']&&console[_0x34cb32(0xd6)](_0x34cb32(0xef)+_0x524c8a);const _0x5edaf4=await withQuerySpinner(_0x34cb32(0xd4),async _0x5b83dd=>{const _0x549792=_0x34cb32,_0x5c0aa9=await _0x1f16b3[_0x549792(0xeb)](_0x524c8a,{'catalog':'td','schema':_0x549792(0xce),'onJobId':_0x1a5b13=>{_0x5b83dd['setJobId'](_0x1a5b13);}});return _0x5c0aa9;},{'verbose':_0x28832a[_0x34cb32(0x10b)]}),_0x4df3cf=_0x5edaf4[_0x34cb32(0x101)],_0x5defbf=_0x4df3cf['jobId']?'\x20[Job\x20ID:\x20'+_0x4df3cf[_0x34cb32(0x128)]+']':'';return console[_0x34cb32(0xd6)](_0x34cb32(0xe3)+_0x4df3cf[_0x34cb32(0x126)][_0x34cb32(0x113)][_0x34cb32(0x124)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x4df3cf['stats'][_0x34cb32(0x104)])+_0x5defbf)),await handleQueryOutput(_0x4df3cf,_0x28832a),0x0;}catch(_0x6791a4){if(_0x6791a4 instanceof SDKError)return console[_0x34cb32(0xd6)]('✖\x20Query\x20failed\x20['+_0x6791a4[_0x34cb32(0xfd)]+']'),console[_0x34cb32(0xd6)]('\x0a'+_0x6791a4['message']),0x1;throw _0x6791a4;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x20a446(0xd5)]=a22_0x20a446(0xcb);[a22_0x20a446(0xb7)]=a22_0x20a446(0xf8);async[a22_0x20a446(0x129)](_0x507fb6){const _0x4da3a5=a22_0x20a446,{options:_0x4c10b5,args:_0x18a83a,tdx:_0x2ccaf1}=_0x507fb6;if(_0x18a83a[_0x4da3a5(0xff)]===0x0)return console[_0x4da3a5(0xd6)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x4da3a5(0xd6)](_0x4da3a5(0xdd)),0x1;const _0x35ac21=_0x18a83a[0x0];try{_0x4c10b5[_0x4da3a5(0x10b)]&&(console[_0x4da3a5(0xd6)](_0x4da3a5(0x125)+_0x4c10b5['site']),console[_0x4da3a5(0xd6)]('Parent\x20name:\x20'+_0x35ac21));const _0x2ab839=await withSpinner(_0x4da3a5(0xe9)+_0x35ac21+_0x4da3a5(0x116),()=>_0x2ccaf1[_0x4da3a5(0x11f)]['resolveParentId'](_0x35ac21),{'verbose':_0x4c10b5['verbose']}),_0x4fae35=_0x2ab839[_0x4da3a5(0x101)];_0x4c10b5['verbose']&&console['error'](_0x4da3a5(0xb6)+_0x4fae35);const _0x4c64de=await withSpinner(_0x4da3a5(0xc5)+_0x35ac21+_0x4da3a5(0x116),()=>_0x2ccaf1[_0x4da3a5(0x11f)][_0x4da3a5(0xf3)](_0x4fae35),{'verbose':_0x4c10b5['verbose']}),_0x1aa6c0=_0x4c64de[_0x4da3a5(0x101)];return console[_0x4da3a5(0xd6)](_0x4da3a5(0xfc)+_0x1aa6c0['length']+_0x4da3a5(0xb9)+(_0x1aa6c0[_0x4da3a5(0xff)]!==0x1?'s':'')),await handleSDKOutput(_0x1aa6c0,_0x4c10b5),0x0;}catch(_0x43272c){if(_0x43272c instanceof SDKError)return console[_0x4da3a5(0xd6)](_0x4da3a5(0xfb)+_0x43272c[_0x4da3a5(0xd7)]),_0x43272c[_0x4da3a5(0x105)]&&console[_0x4da3a5(0xd6)](_0x4da3a5(0x114)+_0x43272c[_0x4da3a5(0x105)]),0x1;throw _0x43272c;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x20a446(0xd5)]='segment:folder:show';[a22_0x20a446(0xb7)]=a22_0x20a446(0x111);async['execute'](_0x438c72){const _0x5261a8=a22_0x20a446,{options:_0x128eba,args:_0x32a471,tdx:_0x2a868b}=_0x438c72;if(_0x32a471[_0x5261a8(0xff)]===0x0)return console[_0x5261a8(0xd6)](_0x5261a8(0xdc)),console[_0x5261a8(0xd6)](_0x5261a8(0x107)),0x1;try{const {parentId:_0x351e0c,childId:_0x50e78f}=parseSegmentRef(_0x32a471[0x0]);_0x128eba['verbose']&&(console[_0x5261a8(0xd6)](_0x5261a8(0x125)+_0x128eba[_0x5261a8(0x108)]),console[_0x5261a8(0xd6)](_0x5261a8(0xc9)+_0x351e0c),_0x50e78f&&console[_0x5261a8(0xd6)](_0x5261a8(0xc1)+_0x50e78f));if(!_0x50e78f)return console[_0x5261a8(0xd6)](_0x5261a8(0xe6)),0x1;const _0x3d4f53=await withSpinner(_0x5261a8(0xe9)+_0x351e0c+'\x27...',()=>_0x2a868b['segment'][_0x5261a8(0xee)](_0x351e0c),{'verbose':_0x128eba[_0x5261a8(0x10b)]}),_0x971b12=_0x3d4f53['data'];_0x128eba[_0x5261a8(0x10b)]&&console[_0x5261a8(0xd6)](_0x5261a8(0xb6)+_0x971b12);const _0x23a2e2=await withSpinner(_0x5261a8(0x115)+_0x50e78f+_0x5261a8(0x116),()=>_0x2a868b[_0x5261a8(0x11f)][_0x5261a8(0x112)](_0x971b12,_0x50e78f),{'verbose':_0x128eba[_0x5261a8(0x10b)]}),_0x43c818=_0x23a2e2[_0x5261a8(0x101)];_0x128eba[_0x5261a8(0x10b)]&&console[_0x5261a8(0xd6)](_0x5261a8(0xf6)+_0x43c818);const _0x401a31=await withSpinner('Fetching\x20folder\x20\x27'+_0x50e78f+_0x5261a8(0x116),()=>_0x2a868b[_0x5261a8(0x11f)][_0x5261a8(0x123)](_0x43c818),{'verbose':_0x128eba[_0x5261a8(0x10b)]});return await handleSDKOutput([_0x401a31[_0x5261a8(0x101)]],_0x128eba),0x0;}catch(_0x473caf){if(_0x473caf instanceof SDKError)return console[_0x5261a8(0xd6)](_0x5261a8(0xfb)+_0x473caf['message']),_0x473caf['cause']&&console[_0x5261a8(0xd6)](_0x5261a8(0x114)+_0x473caf['cause']),0x1;throw _0x473caf;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a22_0x20a446(0xe0);[a22_0x20a446(0xb7)]='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async[a22_0x20a446(0x129)](_0x168ef8){const _0x223cc4=a22_0x20a446,{options:_0x23414a,args:_0x2f9363,tdx:_0x3c47e4}=_0x168ef8;if(_0x2f9363[_0x223cc4(0xff)]===0x0)return console[_0x223cc4(0xd6)](_0x223cc4(0x119)),console[_0x223cc4(0xd6)](_0x223cc4(0x11c)),console[_0x223cc4(0xd6)](_0x223cc4(0xe4)),console[_0x223cc4(0xd6)](_0x223cc4(0x106)),console[_0x223cc4(0xd6)](_0x223cc4(0x117)),console[_0x223cc4(0xd6)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x8d74a1=_0x2f9363[0x0],_0x50f44f=_0x23414a[_0x223cc4(0x10d)];let _0x22e109=_0x8d74a1;_0x50f44f&&!_0x8d74a1[_0x223cc4(0xb5)]('/')&&(_0x22e109=_0x50f44f+'/'+_0x8d74a1,_0x23414a[_0x223cc4(0x10b)]&&console[_0x223cc4(0xd6)](_0x223cc4(0x103)+_0x22e109));const _0xb9d9c5=await withSpinner(_0x223cc4(0x127)+_0x22e109+_0x223cc4(0x116),()=>_0x3c47e4[_0x223cc4(0x11f)][_0x223cc4(0x10f)](_0x22e109),{'verbose':_0x23414a[_0x223cc4(0x10b)]}),_0x52c09c=_0xb9d9c5[_0x223cc4(0x101)];_0x23414a[_0x223cc4(0x10b)]&&(console['error'](_0x223cc4(0xbb)+_0x52c09c['type']),console[_0x223cc4(0xd6)](_0x223cc4(0xc7)+_0x52c09c[_0x223cc4(0x110)]));if(_0x52c09c[_0x223cc4(0x11d)]===_0x223cc4(0xf0))return console['error'](_0x223cc4(0xf4)),console[_0x223cc4(0xd6)](_0x223cc4(0xfe)),0x1;let _0x3245b6;if(_0x52c09c[_0x223cc4(0x11d)]===_0x223cc4(0xc6)){const _0x2fde84=await withSpinner(_0x223cc4(0xcc),()=>_0x3c47e4[_0x223cc4(0x11f)][_0x223cc4(0xe5)](_0x52c09c[_0x223cc4(0x110)]),{'verbose':_0x23414a['verbose']});_0x3245b6=_0x2fde84[_0x223cc4(0x101)];}else{if(!_0x52c09c[_0x223cc4(0xbd)])throw new SDKError(ErrorCode[_0x223cc4(0xea)],_0x223cc4(0xc8));const _0x41a97f=await withSpinner(_0x223cc4(0x100),()=>_0x3c47e4[_0x223cc4(0x11f)]['getSegmentSQL'](_0x52c09c[_0x223cc4(0x110)],_0x52c09c[_0x223cc4(0xbd)]),{'verbose':_0x23414a[_0x223cc4(0x10b)]});_0x3245b6=_0x41a97f[_0x223cc4(0x101)];}return _0x23414a[_0x223cc4(0x11a)]===_0x223cc4(0x10c)||_0x23414a[_0x223cc4(0x11a)]===_0x223cc4(0xd9)?await handleSDKOutput([{'sql':_0x3245b6}],_0x23414a):console[_0x223cc4(0xc4)](_0x3245b6),0x0;}catch(_0x13780c){if(_0x13780c instanceof SDKError)return console[_0x223cc4(0xd6)](_0x223cc4(0xfb)+_0x13780c[_0x223cc4(0xd7)]),_0x13780c[_0x223cc4(0x105)]&&console[_0x223cc4(0xd6)](_0x223cc4(0x114)+_0x13780c['cause']),0x1;throw _0x13780c;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x20a446(0xd5)]=a22_0x20a446(0xc2);['description']='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x5da06d){const _0x468b01=a22_0x20a446,{options:_0x2b64ba,args:_0x317097,tdx:_0x351887}=_0x5da06d,_0x4a147b=_0x2b64ba;if(_0x317097[_0x468b01(0xff)]<0x2)return console['error'](_0x468b01(0xba)),console['error'](_0x468b01(0xc3)),0x1;const _0xfcb27f=_0x317097[0x0],_0x37c2d5=_0x317097[0x1];_0x4a147b[_0x468b01(0x10b)]&&(console['error'](_0x468b01(0x125)+_0x4a147b[_0x468b01(0x108)]),console['error'](_0x468b01(0x11e)+_0xfcb27f),console[_0x468b01(0xd6)](_0x468b01(0xc1)+_0x37c2d5));let _0x3c6e96;if(_0x4a147b['parentFolder']){const _0x35791b=_0x4a147b['parentFolder'],_0x1e9093=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xfcb27f+_0x468b01(0x116),()=>_0x351887[_0x468b01(0x11f)][_0x468b01(0xee)](_0xfcb27f),{'verbose':_0x4a147b['verbose']}),_0x3edf96=_0x1e9093['data'],_0x168467=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x35791b+_0x468b01(0x116),()=>_0x351887[_0x468b01(0x11f)]['resolveFolderId'](_0x3edf96,_0x35791b),{'verbose':_0x4a147b[_0x468b01(0x10b)]});_0x3c6e96=_0x168467['data'],_0x4a147b[_0x468b01(0x10b)]&&console['error'](_0x468b01(0xbe)+_0x3c6e96);}const _0x2d87e3={'name':_0x37c2d5,'description':_0x4a147b[_0x468b01(0xb7)],'parentFolderId':_0x3c6e96},_0x53452b=await withSpinner(_0x468b01(0xfa)+_0x37c2d5+_0x468b01(0x116),()=>_0x351887[_0x468b01(0x11f)][_0x468b01(0xbf)](_0xfcb27f,_0x2d87e3),{'verbose':_0x4a147b['verbose']}),_0x3c1854=_0x53452b[_0x468b01(0x101)];return console[_0x468b01(0xd6)](_0x468b01(0xd8)+_0x3c1854['name']+_0x468b01(0xc0)+_0x3c1854['id']),await handleSDKOutput([_0x3c1854],_0x4a147b),0x0;}}
|
|
1
|
+
const a22_0x1e14fc=a22_0x3975;(function(_0x7bef9d,_0x30efb9){const _0x4ef1cf=a22_0x3975,_0x372ca6=_0x7bef9d();while(!![]){try{const _0x5cc10f=-parseInt(_0x4ef1cf(0x142))/0x1+-parseInt(_0x4ef1cf(0x11e))/0x2*(-parseInt(_0x4ef1cf(0x104))/0x3)+parseInt(_0x4ef1cf(0x148))/0x4*(parseInt(_0x4ef1cf(0x14a))/0x5)+parseInt(_0x4ef1cf(0x125))/0x6*(parseInt(_0x4ef1cf(0x11f))/0x7)+-parseInt(_0x4ef1cf(0x12f))/0x8*(parseInt(_0x4ef1cf(0x122))/0x9)+-parseInt(_0x4ef1cf(0x131))/0xa+-parseInt(_0x4ef1cf(0x101))/0xb*(-parseInt(_0x4ef1cf(0xf3))/0xc);if(_0x5cc10f===_0x30efb9)break;else _0x372ca6['push'](_0x372ca6['shift']());}catch(_0x407f22){_0x372ca6['push'](_0x372ca6['shift']());}}}(a22_0x4598,0xa949b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}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';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x1e14fc(0x130)]=a22_0x1e14fc(0xef);[a22_0x1e14fc(0x103)]='Show\x20segment\x20or\x20folder\x20details';async[a22_0x1e14fc(0x10e)](_0x65139c){const _0x3bfe25=a22_0x1e14fc,{options:_0x1a8639,args:_0x5f295f,tdx:_0xbafc20}=_0x65139c;if(_0x5f295f[_0x3bfe25(0x156)]===0x0)return console['error'](_0x3bfe25(0x149)),console[_0x3bfe25(0x10c)](_0x3bfe25(0xfb)),console[_0x3bfe25(0x10c)](_0x3bfe25(0xed)),console[_0x3bfe25(0x10c)](_0x3bfe25(0x123)),console[_0x3bfe25(0x10c)](_0x3bfe25(0x10f)),console[_0x3bfe25(0x10c)](_0x3bfe25(0xfa)),0x1;try{const _0x4f1913=_0x5f295f[0x0],_0x53e51b=_0x1a8639['segmentPath'];let _0x38db5b=_0x4f1913;_0x53e51b&&!_0x4f1913[_0x3bfe25(0x153)]('/')&&(_0x38db5b=_0x53e51b+'/'+_0x4f1913,_0x1a8639[_0x3bfe25(0xfe)]&&console[_0x3bfe25(0x10c)](_0x3bfe25(0x10b)+_0x38db5b));const _0x12b67b=await withSpinner(_0x3bfe25(0xfd)+_0x38db5b+_0x3bfe25(0x152),()=>_0xbafc20[_0x3bfe25(0x140)]['resolvePathToResource'](_0x38db5b),{'verbose':_0x1a8639[_0x3bfe25(0xfe)]}),_0x141381=_0x12b67b['data'];_0x1a8639['verbose']&&(console[_0x3bfe25(0x10c)]('Resolved\x20type:\x20'+_0x141381[_0x3bfe25(0x12e)]),console[_0x3bfe25(0x10c)]('Parent\x20ID:\x20'+_0x141381[_0x3bfe25(0x13a)]),_0x141381[_0x3bfe25(0x137)]&&console[_0x3bfe25(0x10c)](_0x3bfe25(0x14d)+_0x141381[_0x3bfe25(0x137)]),_0x141381[_0x3bfe25(0xec)]&&console['error'](_0x3bfe25(0x158)+_0x141381[_0x3bfe25(0xec)]));if(_0x141381['type']===_0x3bfe25(0x105)){const _0x4720d0=await withSpinner(_0x3bfe25(0x139),()=>_0xbafc20['segment'][_0x3bfe25(0x113)](_0x141381['parentId']),{'verbose':_0x1a8639[_0x3bfe25(0xfe)]});await handleSDKOutput([_0x4720d0[_0x3bfe25(0x106)]],_0x1a8639);}else{if(_0x141381[_0x3bfe25(0x12e)]===_0x3bfe25(0x107)){if(!_0x141381[_0x3bfe25(0x137)])throw new SDKError(ErrorCode['INTERNAL'],_0x3bfe25(0x15a));const _0x8cc8f2=await withSpinner('Fetching\x20folder\x20details...',()=>_0xbafc20['segment'][_0x3bfe25(0x15d)](_0x141381[_0x3bfe25(0x137)]),{'verbose':_0x1a8639['verbose']});await handleSDKOutput([_0x8cc8f2[_0x3bfe25(0x106)]],_0x1a8639);}else{if(_0x141381[_0x3bfe25(0x12e)]===_0x3bfe25(0x140)){if(!_0x141381[_0x3bfe25(0xec)])throw new SDKError(ErrorCode[_0x3bfe25(0x14f)],_0x3bfe25(0x13c));const _0x1f3c1f=await withSpinner(_0x3bfe25(0x121),()=>_0xbafc20[_0x3bfe25(0x140)]['getSegment'](_0x141381[_0x3bfe25(0x13a)],_0x141381[_0x3bfe25(0xec)]),{'verbose':_0x1a8639[_0x3bfe25(0xfe)]});await handleSDKOutput([_0x1f3c1f[_0x3bfe25(0x106)]],_0x1a8639);}}}return 0x0;}catch(_0x254d6f){if(_0x254d6f instanceof SDKError)return console['error'](_0x3bfe25(0x118)+_0x254d6f[_0x3bfe25(0x13f)]),_0x254d6f['cause']&&console['error'](_0x3bfe25(0x13b)+_0x254d6f[_0x3bfe25(0x119)]),0x1;throw _0x254d6f;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x1e14fc(0x130)]=a22_0x1e14fc(0x144);[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x133);async['execute'](_0x304b0b){const _0x47c54e=a22_0x1e14fc,{options:_0x198585,args:_0xa42028,tdx:_0x3cce35}=_0x304b0b;if(_0xa42028[_0x47c54e(0x156)]===0x0)return console[_0x47c54e(0x10c)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x47c54e(0x10c)](_0x47c54e(0x10a)),console[_0x47c54e(0x10c)](_0x47c54e(0xed)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x47c54e(0x136)),console[_0x47c54e(0x10c)](_0x47c54e(0x15b)),0x1;try{const _0x5c6da5=_0xa42028[0x0],_0x4d7064=_0x198585[_0x47c54e(0x11a)];let _0x48ef4f=_0x5c6da5;_0x4d7064&&!_0x5c6da5[_0x47c54e(0x153)]('/')&&(_0x48ef4f=_0x4d7064+'/'+_0x5c6da5,_0x198585[_0x47c54e(0xfe)]&&console[_0x47c54e(0x10c)](_0x47c54e(0x10b)+_0x48ef4f));const _0x2d6933=await withSpinner(_0x47c54e(0xfd)+_0x48ef4f+_0x47c54e(0x152),()=>_0x3cce35[_0x47c54e(0x140)]['resolvePathToResource'](_0x48ef4f),{'verbose':_0x198585[_0x47c54e(0xfe)]}),_0x14364b=_0x2d6933[_0x47c54e(0x106)];_0x198585[_0x47c54e(0xfe)]&&(console['error']('Resolved\x20type:\x20'+_0x14364b[_0x47c54e(0x12e)]),console[_0x47c54e(0x10c)](_0x47c54e(0xf2)+_0x14364b['parentId']));if(_0x14364b[_0x47c54e(0x12e)]===_0x47c54e(0x107))return console['error'](_0x47c54e(0x11c)),console[_0x47c54e(0x10c)](_0x47c54e(0x11b)),0x1;let _0x167d52;if(_0x14364b['type']===_0x47c54e(0x105)){const _0x1062c5=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x3cce35[_0x47c54e(0x140)][_0x47c54e(0x13e)](_0x14364b['parentId']),{'verbose':_0x198585['verbose']});_0x167d52=_0x1062c5['data'];}else{if(!_0x14364b[_0x47c54e(0xec)])throw new SDKError(ErrorCode[_0x47c54e(0x14f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x398572=await withSpinner(_0x47c54e(0xf7),()=>_0x3cce35[_0x47c54e(0x140)][_0x47c54e(0x14b)](_0x14364b['parentId'],_0x14364b[_0x47c54e(0xec)]),{'verbose':_0x198585[_0x47c54e(0xfe)]});_0x167d52=_0x398572['data'];}const _0x32cbf7=resolveLimit(_0x198585[_0x47c54e(0xf4)],DEFAULT_DISPLAY_LIMIT),_0x2ba327=/\bLIMIT\s+\d+/i['test'](_0x167d52);!_0x2ba327&&(_0x167d52=_0x167d52[_0x47c54e(0x15e)]()[_0x47c54e(0x129)](/;+$/,''),_0x167d52=_0x47c54e(0xee)+_0x167d52+_0x47c54e(0xf1)+_0x32cbf7);_0x198585[_0x47c54e(0xfe)]&&console[_0x47c54e(0x10c)](_0x47c54e(0x157)+_0x167d52);const _0x3e0d11=await withQuerySpinner(_0x47c54e(0x127),async _0x489bf1=>{const _0x48c734=_0x47c54e,_0x345fc3=await _0x3cce35['query'](_0x167d52,{'catalog':'td','schema':_0x48c734(0x110),'onJobId':_0x540e3f=>{_0x489bf1['setJobId'](_0x540e3f);}});return _0x345fc3;},{'verbose':_0x198585['verbose']}),_0x1e1025=_0x3e0d11[_0x47c54e(0x106)],_0xaa8732=_0x1e1025[_0x47c54e(0x155)]?_0x47c54e(0x111)+_0x1e1025[_0x47c54e(0x155)]+']':'';return console[_0x47c54e(0x10c)](_0x47c54e(0x154)+_0x1e1025['stats'][_0x47c54e(0x108)]['toLocaleString']()+_0x47c54e(0x146)+(_0x47c54e(0x12d)+formatElapsed(_0x1e1025['stats']['elapsedTimeMillis'])+_0xaa8732)),await handleQueryOutput(_0x1e1025,_0x198585),0x0;}catch(_0x523fac){if(_0x523fac instanceof SDKError)return console[_0x47c54e(0x10c)](_0x47c54e(0xf8)+_0x523fac[_0x47c54e(0x141)]+']'),console[_0x47c54e(0x10c)]('\x0a'+_0x523fac['message']),0x1;throw _0x523fac;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x1e14fc(0x130)]=a22_0x1e14fc(0x100);[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x14e);async['execute'](_0x3d0c36){const _0x50f55e=a22_0x1e14fc,{options:_0x3af545,args:_0x7deb6c,tdx:_0x42d8f1}=_0x3d0c36;if(_0x7deb6c['length']===0x0)return console[_0x50f55e(0x10c)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x5d9616=_0x7deb6c[0x0];try{_0x3af545[_0x50f55e(0xfe)]&&(console[_0x50f55e(0x10c)](_0x50f55e(0x135)+_0x3af545[_0x50f55e(0x112)]),console['error'](_0x50f55e(0x151)+_0x5d9616));const _0x1a68e5=await withSpinner(_0x50f55e(0x138)+_0x5d9616+'\x27...',()=>_0x42d8f1[_0x50f55e(0x140)][_0x50f55e(0x102)](_0x5d9616),{'verbose':_0x3af545[_0x50f55e(0xfe)]}),_0x295bf4=_0x1a68e5['data'];_0x3af545[_0x50f55e(0xfe)]&&console[_0x50f55e(0x10c)](_0x50f55e(0x115)+_0x295bf4);const _0x4affc2=await withSpinner(_0x50f55e(0xf9)+_0x5d9616+_0x50f55e(0x152),()=>_0x42d8f1[_0x50f55e(0x140)]['listFolders'](_0x295bf4),{'verbose':_0x3af545[_0x50f55e(0xfe)]}),_0x2c8fc2=_0x4affc2['data'];return console['error'](_0x50f55e(0x109)+_0x2c8fc2[_0x50f55e(0x156)]+_0x50f55e(0x15c)+(_0x2c8fc2[_0x50f55e(0x156)]!==0x1?'s':'')),await handleSDKOutput(_0x2c8fc2,_0x3af545),0x0;}catch(_0x17f638){if(_0x17f638 instanceof SDKError)return console['error'](_0x50f55e(0x118)+_0x17f638['message']),_0x17f638[_0x50f55e(0x119)]&&console[_0x50f55e(0x10c)](_0x50f55e(0x13b)+_0x17f638['cause']),0x1;throw _0x17f638;}}}function a22_0x3975(_0x5bb802,_0x69622e){const _0x459837=a22_0x4598();return a22_0x3975=function(_0x39757e,_0x16174e){_0x39757e=_0x39757e-0xec;let _0x1dc39a=_0x459837[_0x39757e];return _0x1dc39a;},a22_0x3975(_0x5bb802,_0x69622e);}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x1e14fc(0x130)]='segment:folder:show';['description']=a22_0x1e14fc(0x116);async[a22_0x1e14fc(0x10e)](_0x461ee5){const _0x5a75d2=a22_0x1e14fc,{options:_0x58d419,args:_0x446b8b,tdx:_0xe3e7c1}=_0x461ee5;if(_0x446b8b['length']===0x0)return console[_0x5a75d2(0x10c)](_0x5a75d2(0x120)),console[_0x5a75d2(0x10c)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x196bb0,childId:_0x1f9af3}=parseSegmentRef(_0x446b8b[0x0]);_0x58d419[_0x5a75d2(0xfe)]&&(console[_0x5a75d2(0x10c)](_0x5a75d2(0x135)+_0x58d419[_0x5a75d2(0x112)]),console['error'](_0x5a75d2(0x151)+_0x196bb0),_0x1f9af3&&console['error'](_0x5a75d2(0xf6)+_0x1f9af3));if(!_0x1f9af3)return console[_0x5a75d2(0x10c)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x857cca=await withSpinner(_0x5a75d2(0x138)+_0x196bb0+'\x27...',()=>_0xe3e7c1[_0x5a75d2(0x140)][_0x5a75d2(0x102)](_0x196bb0),{'verbose':_0x58d419['verbose']}),_0x4f0bc7=_0x857cca[_0x5a75d2(0x106)];_0x58d419[_0x5a75d2(0xfe)]&&console[_0x5a75d2(0x10c)](_0x5a75d2(0x115)+_0x4f0bc7);const _0x36acbc=await withSpinner(_0x5a75d2(0x147)+_0x1f9af3+_0x5a75d2(0x152),()=>_0xe3e7c1[_0x5a75d2(0x140)][_0x5a75d2(0x128)](_0x4f0bc7,_0x1f9af3),{'verbose':_0x58d419['verbose']}),_0x35cf4f=_0x36acbc[_0x5a75d2(0x106)];_0x58d419['verbose']&&console[_0x5a75d2(0x10c)](_0x5a75d2(0x150)+_0x35cf4f);const _0xa50964=await withSpinner(_0x5a75d2(0x126)+_0x1f9af3+_0x5a75d2(0x152),()=>_0xe3e7c1['segment'][_0x5a75d2(0x15d)](_0x35cf4f),{'verbose':_0x58d419[_0x5a75d2(0xfe)]});return await handleSDKOutput([_0xa50964[_0x5a75d2(0x106)]],_0x58d419),0x0;}catch(_0x3b5e35){if(_0x3b5e35 instanceof SDKError)return console[_0x5a75d2(0x10c)]('Error:\x20'+_0x3b5e35[_0x5a75d2(0x13f)]),_0x3b5e35[_0x5a75d2(0x119)]&&console[_0x5a75d2(0x10c)](_0x5a75d2(0x13b)+_0x3b5e35[_0x5a75d2(0x119)]),0x1;throw _0x3b5e35;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x1e14fc(0x130)]='segment:sql';[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x117);async[a22_0x1e14fc(0x10e)](_0x32aed9){const _0x13d62d=a22_0x1e14fc,{options:_0x228686,args:_0x15301c,tdx:_0x44fdbd}=_0x32aed9;if(_0x15301c['length']===0x0)return console[_0x13d62d(0x10c)](_0x13d62d(0x13d)),console['error'](_0x13d62d(0x159)),console[_0x13d62d(0x10c)](_0x13d62d(0xed)),console[_0x13d62d(0x10c)](_0x13d62d(0xf5)),console[_0x13d62d(0x10c)](_0x13d62d(0x134)),console[_0x13d62d(0x10c)](_0x13d62d(0x12b)),0x1;try{const _0x294755=_0x15301c[0x0],_0x45bf64=_0x228686['segmentPath'];let _0x42e561=_0x294755;_0x45bf64&&!_0x294755[_0x13d62d(0x153)]('/')&&(_0x42e561=_0x45bf64+'/'+_0x294755,_0x228686[_0x13d62d(0xfe)]&&console['error'](_0x13d62d(0x10b)+_0x42e561));const _0x3a104c=await withSpinner(_0x13d62d(0xfd)+_0x42e561+_0x13d62d(0x152),()=>_0x44fdbd[_0x13d62d(0x140)]['resolvePathToResource'](_0x42e561),{'verbose':_0x228686[_0x13d62d(0xfe)]}),_0x4292e0=_0x3a104c[_0x13d62d(0x106)];_0x228686['verbose']&&(console[_0x13d62d(0x10c)]('Resolved\x20type:\x20'+_0x4292e0[_0x13d62d(0x12e)]),console[_0x13d62d(0x10c)]('Parent\x20ID:\x20'+_0x4292e0[_0x13d62d(0x13a)]));if(_0x4292e0['type']===_0x13d62d(0x107))return console[_0x13d62d(0x10c)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x13d62d(0x10c)](_0x13d62d(0x12c)),0x1;let _0x7b0093;if(_0x4292e0[_0x13d62d(0x12e)]===_0x13d62d(0x105)){const _0x379feb=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x44fdbd[_0x13d62d(0x140)]['getParentSQL'](_0x4292e0[_0x13d62d(0x13a)]),{'verbose':_0x228686['verbose']});_0x7b0093=_0x379feb[_0x13d62d(0x106)];}else{if(!_0x4292e0[_0x13d62d(0xec)])throw new SDKError(ErrorCode[_0x13d62d(0x14f)],_0x13d62d(0x13c));const _0x5efa91=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x44fdbd[_0x13d62d(0x140)]['getSegmentSQL'](_0x4292e0[_0x13d62d(0x13a)],_0x4292e0[_0x13d62d(0xec)]),{'verbose':_0x228686[_0x13d62d(0xfe)]});_0x7b0093=_0x5efa91[_0x13d62d(0x106)];}return _0x228686[_0x13d62d(0xff)]===_0x13d62d(0x14c)||_0x228686['format']==='jsonl'?await handleSDKOutput([{'sql':_0x7b0093}],_0x228686):console[_0x13d62d(0x132)](_0x7b0093),0x0;}catch(_0x237291){if(_0x237291 instanceof SDKError)return console['error']('Error:\x20'+_0x237291[_0x13d62d(0x13f)]),_0x237291['cause']&&console['error'](_0x13d62d(0x13b)+_0x237291[_0x13d62d(0x119)]),0x1;throw _0x237291;}}}function a22_0x4598(){const _0x4df051=['\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Folder\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','✖\x20Query\x20failed\x20[','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Usage:\x20tdx\x20segment\x20describe\x20<path>','✔\x20Created\x20folder\x20\x27','Resolving\x20path\x20\x27','verbose','format','segment:folder:list','237457NDprOS','resolveParentId','description','100209WRIsZY','parent','data','folder','processedRows','✔\x20Found\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','Resolved\x20relative\x20path\x20to:\x20','error','Resolving\x20parent\x20folder\x20\x27','execute','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','information_schema','\x20[Job\x20ID:\x20','site','getParent','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20parent\x20ID:\x20','Show\x20segment\x20folder\x20details','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Error:\x20','cause','segmentPath','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolved\x20parent\x20folder\x20ID:\x20','82GPDsnI','1386763UGQpPC','Error:\x20Folder\x20reference\x20is\x20required','Fetching\x20segment\x20details...','1783989RYtXCy','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Create\x20segment\x20folder\x20for\x20organization','24dsbbGW','Fetching\x20folder\x20\x27','Executing\x20segment\x20query...','resolveFolderId','replace','Parent\x20segment:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','in\x20','type','48RvMAsY','name','9620140lYmiWY','log','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderId','Resolving\x20parent\x20segment\x20\x27','Fetching\x20parent\x20segment\x20details...','parentId','\x20\x20Cause:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','getParentSQL','message','segment','code','384685uoYvRx','\x27\x20with\x20ID:\x20','segment:show','createFolder','\x20rows\x20','Resolving\x20folder\x20\x27','1304zxnrSz','Error:\x20Path\x20or\x20name\x20is\x20required','8095caMgiJ','getSegmentSQL','json','Folder\x20ID:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','INTERNAL','Resolved\x20folder\x20ID:\x20','Parent\x20name:\x20','\x27...','includes','✔\x20Query\x20completed:\x20Processed\x20','jobId','length','SQL\x20query:\x0a','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20sql\x20<path>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20folder','getFolder','trim','segmentId','Examples:','SELECT\x20*\x20FROM\x20(\x0a','segment:describe','parentFolder','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20ID:\x20','300mdcQCJ','limit'];a22_0x4598=function(){return _0x4df051;};return a22_0x4598();}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x1e14fc(0x130)]='segment:folder:create';[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x124);async[a22_0x1e14fc(0x10e)](_0x197885){const _0x11e23c=a22_0x1e14fc,{options:_0x1a36fb,args:_0x5740ae,tdx:_0x588080}=_0x197885,_0x3838fe=_0x1a36fb;if(_0x5740ae[_0x11e23c(0x156)]<0x2)return console[_0x11e23c(0x10c)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x11e23c(0x10c)](_0x11e23c(0x114)),0x1;const _0x457123=_0x5740ae[0x0],_0x1793a8=_0x5740ae[0x1];_0x3838fe[_0x11e23c(0xfe)]&&(console['error'](_0x11e23c(0x135)+_0x3838fe[_0x11e23c(0x112)]),console[_0x11e23c(0x10c)](_0x11e23c(0x12a)+_0x457123),console[_0x11e23c(0x10c)](_0x11e23c(0xf6)+_0x1793a8));let _0x32f184;if(_0x3838fe[_0x11e23c(0xf0)]){const _0x14bbc2=_0x3838fe[_0x11e23c(0xf0)],_0x5ce834=await withSpinner(_0x11e23c(0x138)+_0x457123+_0x11e23c(0x152),()=>_0x588080[_0x11e23c(0x140)][_0x11e23c(0x102)](_0x457123),{'verbose':_0x3838fe[_0x11e23c(0xfe)]}),_0x83be2d=_0x5ce834[_0x11e23c(0x106)],_0x8374b=await withSpinner(_0x11e23c(0x10d)+_0x14bbc2+_0x11e23c(0x152),()=>_0x588080[_0x11e23c(0x140)][_0x11e23c(0x128)](_0x83be2d,_0x14bbc2),{'verbose':_0x3838fe[_0x11e23c(0xfe)]});_0x32f184=_0x8374b[_0x11e23c(0x106)],_0x3838fe[_0x11e23c(0xfe)]&&console[_0x11e23c(0x10c)](_0x11e23c(0x11d)+_0x32f184);}const _0x50a591={'name':_0x1793a8,'description':_0x3838fe[_0x11e23c(0x103)],'parentFolderId':_0x32f184},_0x2163c0=await withSpinner('Creating\x20folder\x20\x27'+_0x1793a8+'\x27...',()=>_0x588080['segment'][_0x11e23c(0x145)](_0x457123,_0x50a591),{'verbose':_0x3838fe[_0x11e23c(0xfe)]}),_0x194ff0=_0x2163c0[_0x11e23c(0x106)];return console[_0x11e23c(0x10c)](_0x11e23c(0xfc)+_0x194ff0[_0x11e23c(0x130)]+_0x11e23c(0x143)+_0x194ff0['id']),await handleSDKOutput([_0x194ff0],_0x3838fe),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0xb16e67=a23_0x1bd1;function a23_0x1bd1(_0x4f8dd1,_0x58933c){const _0x36cec3=a23_0x36ce();return a23_0x1bd1=function(_0x1bd1a1,_0x2e2044){_0x1bd1a1=_0x1bd1a1-0x1b4;let _0x203f80=_0x36cec3[_0x1bd1a1];return _0x203f80;},a23_0x1bd1(_0x4f8dd1,_0x58933c);}(function(_0x57c35c,_0x55566a){const _0x2d4884=a23_0x1bd1,_0x3c9927=_0x57c35c();while(!![]){try{const _0x5a3057=parseInt(_0x2d4884(0x1cc))/0x1+-parseInt(_0x2d4884(0x1c2))/0x2*(-parseInt(_0x2d4884(0x1e5))/0x3)+parseInt(_0x2d4884(0x1de))/0x4+parseInt(_0x2d4884(0x1c4))/0x5+parseInt(_0x2d4884(0x1d0))/0x6*(-parseInt(_0x2d4884(0x1c9))/0x7)+parseInt(_0x2d4884(0x1c5))/0x8+-parseInt(_0x2d4884(0x1b8))/0x9;if(_0x5a3057===_0x55566a)break;else _0x3c9927['push'](_0x3c9927['shift']());}catch(_0x5f24bb){_0x3c9927['push'](_0x3c9927['shift']());}}}(a23_0x36ce,0x3f7da));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a23_0x36ce(){const _0x13d590=['resolveParentId','verbose','length','Parent:\x20','parent','rule','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Create\x20child\x20segment\x20with\x20filtering\x20rules','602316zDuuee','execute','✔\x20Created\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','kind','Examples:','description','303gvuaSp','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segment','error','\x20\x20\x20Path:\x20','1391229CwXJCz','segmentPath','data','folder','type','Creating\x20segment\x20\x27','resolveFolderId','Target\x20path:\x20','folderId','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','596ixVMoy','resolvePathToResource','307490Oloupm','57192DohjzK','Resolving\x20folder\x20path\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Resolving\x20folder\x20\x27','4242UmwJmD','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','site','273789zPwNOb','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','ruleFile','1074EvPLRp','name','\x27...','Resolved\x20folder\x20ID:\x20','segments'];a23_0x36ce=function(){return _0x13d590;};return a23_0x36ce();}export class SegmentCreateCommand extends BaseCommand{[a23_0xb16e67(0x1d1)]=a23_0xb16e67(0x1db);[a23_0xb16e67(0x1e4)]=a23_0xb16e67(0x1dd);async[a23_0xb16e67(0x1df)](_0x4b6fdd){const _0x1f61bc=a23_0xb16e67,{options:_0x482fa5,args:_0x118fce,tdx:_0x4752c0}=_0x4b6fdd,_0x3097a6=_0x482fa5;if(_0x118fce[_0x1f61bc(0x1d7)]===0x0)return console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1ca)),console['error'](_0x1f61bc(0x1b4)),console['error'](_0x1f61bc(0x1e3)),console[_0x1f61bc(0x1b6)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x1f61bc(0x1b6)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x1f61bc(0x1dc)),0x1;const _0x1198c5=_0x118fce[0x0],_0x558430=_0x482fa5[_0x1f61bc(0x1b9)];let _0x277516=_0x1198c5;_0x558430&&!_0x1198c5['includes']('/')&&(_0x277516=_0x558430+'/'+_0x1198c5,_0x3097a6['verbose']&&console['error'](_0x1f61bc(0x1cd)+_0x277516));const _0x1e3568=parsePath(_0x277516);if(_0x1e3568[_0x1f61bc(0x1d4)][_0x1f61bc(0x1d7)]<0x2)return console['error'](_0x1f61bc(0x1c1)),console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1c7)),0x1;const _0xe7041b=_0x1e3568[_0x1f61bc(0x1d4)][0x0],_0x3de008=getBaseName(_0x277516),_0x386e68=getParentPath(_0x277516);_0x3097a6[_0x1f61bc(0x1d6)]&&(console[_0x1f61bc(0x1b6)]('Site:\x20'+_0x3097a6[_0x1f61bc(0x1cb)]),console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1bf)+_0x277516),console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1d8)+_0xe7041b),console[_0x1f61bc(0x1b6)]('Segment\x20name:\x20'+_0x3de008),console[_0x1f61bc(0x1b6)]('Parent\x20path:\x20'+_0x386e68));const _0x295a53=await withSpinner(_0x1f61bc(0x1e1)+_0xe7041b+_0x1f61bc(0x1d2),()=>_0x4752c0[_0x1f61bc(0x1b5)][_0x1f61bc(0x1d5)](_0xe7041b),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]}),_0x24be4c=_0x295a53[_0x1f61bc(0x1ba)];let _0x124da1;if(_0x1e3568['segments']['length']>0x2){const _0x21bffa=await withSpinner(_0x1f61bc(0x1c6)+_0x386e68+_0x1f61bc(0x1d2),()=>_0x4752c0[_0x1f61bc(0x1b5)][_0x1f61bc(0x1c3)](_0x386e68),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]}),_0xc666d9=_0x21bffa['data'];if(_0xc666d9[_0x1f61bc(0x1bc)]!==_0x1f61bc(0x1bb)&&_0xc666d9[_0x1f61bc(0x1bc)]!==_0x1f61bc(0x1d9))return console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1ce)),0x1;_0x124da1=_0xc666d9[_0x1f61bc(0x1c0)];}else{if(_0x3097a6[_0x1f61bc(0x1bb)]){const _0x19b048=await withSpinner(_0x1f61bc(0x1c8)+_0x3097a6['folder']+_0x1f61bc(0x1d2),()=>_0x4752c0[_0x1f61bc(0x1b5)][_0x1f61bc(0x1be)](_0x24be4c,_0x3097a6[_0x1f61bc(0x1bb)]),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]});_0x124da1=_0x19b048[_0x1f61bc(0x1ba)];}}_0x3097a6['verbose']&&_0x124da1&&console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1d3)+_0x124da1);const _0x5b2977=await loadJSONFromOptions(_0x3097a6[_0x1f61bc(0x1da)],_0x3097a6[_0x1f61bc(0x1cf)]),_0x2f7701={'name':_0x3de008,'description':_0x3097a6[_0x1f61bc(0x1e4)],'rule':_0x5b2977,'kind':_0x3097a6['kind']!==undefined?parseInt(_0x3097a6[_0x1f61bc(0x1e2)],0xa):undefined,'isVisible':_0x3097a6['invisible']?![]:undefined,'segmentFolderId':_0x124da1,'countPopulation':_0x3097a6['noCountPopulation']?![]:undefined},_0x2e2929=await withSpinner(_0x1f61bc(0x1bd)+_0x3de008+_0x1f61bc(0x1d2),()=>_0x4752c0['segment']['createSegment'](_0x24be4c,_0x2f7701),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]}),_0xb1c26e=_0x2e2929[_0x1f61bc(0x1ba)];return console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1e0)+_0xb1c26e['name']+'\x27\x20with\x20ID:\x20'+_0xb1c26e['id']),_0x277516!==_0x1198c5&&console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1b7)+_0x277516),await handleSDKOutput([_0xb1c26e],_0x3097a6),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a24_0x531f(_0x119687,_0x376631){const _0x236811=a24_0x2368();return a24_0x531f=function(_0x531f8b,_0x2b0b3e){_0x531f8b=_0x531f8b-0x15a;let _0x21b7a3=_0x236811[_0x531f8b];return _0x21b7a3;},a24_0x531f(_0x119687,_0x376631);}const a24_0x6b3d10=a24_0x531f;(function(_0x346e6,_0x252850){const _0x1c33d1=a24_0x531f,_0x1ceed0=_0x346e6();while(!![]){try{const _0x3d88a4=parseInt(_0x1c33d1(0x15b))/0x1+parseInt(_0x1c33d1(0x171))/0x2*(parseInt(_0x1c33d1(0x165))/0x3)+-parseInt(_0x1c33d1(0x160))/0x4+parseInt(_0x1c33d1(0x15a))/0x5*(parseInt(_0x1c33d1(0x15f))/0x6)+parseInt(_0x1c33d1(0x16a))/0x7*(parseInt(_0x1c33d1(0x15d))/0x8)+parseInt(_0x1c33d1(0x164))/0x9*(parseInt(_0x1c33d1(0x16e))/0xa)+parseInt(_0x1c33d1(0x166))/0xb*(-parseInt(_0x1c33d1(0x167))/0xc);if(_0x3d88a4===_0x252850)break;else _0x1ceed0['push'](_0x1ceed0['shift']());}catch(_0x395fca){_0x1ceed0['push'](_0x1ceed0['shift']());}}}(a24_0x2368,0x2ef69));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a24_0x2368(){const _0x134016=['101066JJASyl','name','✔\x20Found\x20','data','error','5bkaHeJ','89590MxQByG','site','2000336CvTheD','segment:fields','1168572YQCGPl','1337408wPwibZ','\x27...','Listing\x20fields\x20for\x20\x27','execute','2554731AuFJDI','9BAJoKM','187xsIFDc','312804izhrPd','Error:\x20Parent\x20segment\x20name\x20is\x20required','listFields','7RDOBwV','\x20field','Parent\x20segment:\x20','Site:\x20','10XCPwuk','verbose','length'];a24_0x2368=function(){return _0x134016;};return a24_0x2368();}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x6b3d10(0x172)]=a24_0x6b3d10(0x15e);['description']='List\x20available\x20fields\x20for\x20segmentation';async[a24_0x6b3d10(0x163)](_0x181835){const _0xefd34c=a24_0x6b3d10,{options:_0x5ae7d9,args:_0x4bbc1a,tdx:_0x4aa85d}=_0x181835;if(_0x4bbc1a['length']===0x0)return console[_0xefd34c(0x175)](_0xefd34c(0x168)),console[_0xefd34c(0x175)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),0x1;const _0x5d731a=_0x4bbc1a[0x0];_0x5ae7d9[_0xefd34c(0x16f)]&&(console[_0xefd34c(0x175)](_0xefd34c(0x16d)+_0x5ae7d9[_0xefd34c(0x15c)]),console[_0xefd34c(0x175)](_0xefd34c(0x16c)+_0x5d731a));const _0x1e45a3=await withSpinner(_0xefd34c(0x162)+_0x5d731a+_0xefd34c(0x161),()=>_0x4aa85d['segment'][_0xefd34c(0x169)](_0x5d731a),{'verbose':_0x5ae7d9['verbose']}),_0x163e40=_0x1e45a3[_0xefd34c(0x174)];return console['error'](_0xefd34c(0x173)+_0x163e40[_0xefd34c(0x170)]+_0xefd34c(0x16b)+(_0x163e40['length']!==0x1?'s':'')),await handleSDKOutput(_0x163e40,_0x5ae7d9),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x5603ff=a25_0xf46d;(function(_0x188f9f,_0x40672d){const _0x230bd2=a25_0xf46d,_0x267edc=_0x188f9f();while(!![]){try{const _0x2e8e6c=parseInt(_0x230bd2(0xa5))/0x1*(-parseInt(_0x230bd2(0xa6))/0x2)+parseInt(_0x230bd2(0x9d))/0x3*(parseInt(_0x230bd2(0x9e))/0x4)+-parseInt(_0x230bd2(0xa7))/0x5+-parseInt(_0x230bd2(0xa8))/0x6*(-parseInt(_0x230bd2(0x96))/0x7)+parseInt(_0x230bd2(0xa0))/0x8+parseInt(_0x230bd2(0x95))/0x9+-parseInt(_0x230bd2(0x91))/0xa*(-parseInt(_0x230bd2(0x90))/0xb);if(_0x2e8e6c===_0x40672d)break;else _0x267edc['push'](_0x267edc['shift']());}catch(_0x4e24fc){_0x267edc['push'](_0x267edc['shift']());}}}(a25_0x1d73,0xd5e84));function a25_0x1d73(){const _0x134f48=['jsonl','1247EVKgMk','604rTJOLH','7993885bpEIMr','6KFvBsg','segmentPath','770iWgyeF','43690DzhOfd','log','json','execute','6121377kMlNGj','7959343AEGaYx','name','format','error','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','segment:pwd','description','3TOQTSB','2121524zDdsDr','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','1584976hHFVFY','verbose','Context\x20details:','\x20\x20Path:\x20'];a25_0x1d73=function(){return _0x134f48;};return a25_0x1d73();}import{BaseCommand}from'./command.js';function a25_0xf46d(_0x153722,_0x93b6f7){const _0x1d732f=a25_0x1d73();return a25_0xf46d=function(_0xf46dad,_0x2350bb){_0xf46dad=_0xf46dad-0x8f;let _0xe12844=_0x1d732f[_0xf46dad];return _0xe12844;},a25_0xf46d(_0x153722,_0x93b6f7);}export class SegmentPwdCommand extends BaseCommand{[a25_0x5603ff(0x97)]=a25_0x5603ff(0x9b);[a25_0x5603ff(0x9c)]='Show\x20current\x20segment/folder\x20context';async[a25_0x5603ff(0x94)](_0x4a2472){const _0x5504f3=a25_0x5603ff,{options:_0x2280f5}=_0x4a2472;try{const _0x14c232=_0x2280f5[_0x5504f3(0x8f)];if(!_0x14c232)return _0x2280f5[_0x5504f3(0x98)]===_0x5504f3(0x93)||_0x2280f5[_0x5504f3(0x98)]===_0x5504f3(0xa4)?console[_0x5504f3(0x92)](JSON['stringify']({'path':'/','type':'root'})):console[_0x5504f3(0x92)]('/'),0x0;if(_0x2280f5['format']===_0x5504f3(0x93)||_0x2280f5[_0x5504f3(0x98)]===_0x5504f3(0xa4)){const _0x5e46d3={'path':_0x14c232};console[_0x5504f3(0x92)](JSON['stringify'](_0x5e46d3));}else console['log'](_0x14c232),_0x2280f5[_0x5504f3(0xa1)]&&(console[_0x5504f3(0x99)](''),console[_0x5504f3(0x99)](_0x5504f3(0xa2)),console[_0x5504f3(0x99)](_0x5504f3(0xa3)+_0x14c232),console[_0x5504f3(0x99)](''),console['error'](_0x5504f3(0x9a)),console[_0x5504f3(0x99)](_0x5504f3(0x9f)));return 0x0;}catch(_0x2e523f){throw _0x2e523f;}}}
|