@treasuredata/tdx 0.4.4 → 0.4.5
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/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.d.ts +79 -1
- package/dist/client/engage-api-client.d.ts.map +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/engage-api-client.js.map +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/command.d.ts.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/command.js.map +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.d.ts +128 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +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.d.ts +1 -0
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +1 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/engage.d.ts +105 -1
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +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/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/engage.d.ts +102 -0
- package/dist/types/engage.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a19_0x502973=a19_0x1b4f;function a19_0x1b4f(_0x2d88a2,_0x1d5a90){const _0x6db20e=a19_0x6db2();return a19_0x1b4f=function(_0x1b4f42,_0x4359b8){_0x1b4f42=_0x1b4f42-0x121;let _0x451e1a=_0x6db20e[_0x1b4f42];return _0x451e1a;},a19_0x1b4f(_0x2d88a2,_0x1d5a90);}(function(_0x2af7f0,_0x587332){const _0x1770e3=a19_0x1b4f,_0x4d4a29=_0x2af7f0();while(!![]){try{const _0x592a26=-parseInt(_0x1770e3(0x128))/0x1+parseInt(_0x1770e3(0x144))/0x2+parseInt(_0x1770e3(0x150))/0x3+parseInt(_0x1770e3(0x139))/0x4+-parseInt(_0x1770e3(0x15b))/0x5+-parseInt(_0x1770e3(0x166))/0x6*(-parseInt(_0x1770e3(0x156))/0x7)+-parseInt(_0x1770e3(0x13a))/0x8*(parseInt(_0x1770e3(0x14b))/0x9);if(_0x592a26===_0x587332)break;else _0x4d4a29['push'](_0x4d4a29['shift']());}catch(_0x4235a3){_0x4d4a29['push'](_0x4d4a29['shift']());}}}(a19_0x6db2,0xf1e15));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a19_0x6db2(){const _0x41e67a=['message','trino','Show\x20job\x20details','job:kill','file','kill','18uZRkTV','execute','\x20\x20Cause:\x20','Submitting\x20kill\x20request...','Listing\x20jobs...','hive','Kill\x20a\x20job','job_id','job:submit','start_at','end_at','created_at','Query:\x20','Get\x20job\x20results','876999YToofL','Limit:\x20','submit','status','user_name','Error:\x20','Submit\x20a\x20job','name','\x20job','cause','Database:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','type','\x20row','Status\x20filter:\x20','Getting\x20job\x20results...','query','7473220PPzMih','1005656CeKIdi','✔\x20Found\x20','Job\x20type:\x20','yes','result','substring','error','Error:\x20Job\x20ID\x20is\x20required','priority','Getting\x20job\x20details...','1192824tKCGwD','\x27\x20to\x20verify\x20the\x20job\x20status','database','✔\x20Job\x20submitted','data','show','job:result','45WaOYEq','jobs','length','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','\x20jobs','12447ttFwUr','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','verbose','getTime','debug','description','4453435UzzlYY','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','url','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','jobType','9406030jlfVVN','Usage:\x20job\x20show\x20<job-id>','round','Error:\x20Query\x20is\x20required','job:show'];a19_0x6db2=function(){return _0x41e67a;};return a19_0x6db2();}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{[a19_0x502973(0x12f)]=a19_0x502973(0x14c);[a19_0x502973(0x155)]='List\x20jobs';async[a19_0x502973(0x167)](_0x3a530f){const _0x50b0a7=a19_0x502973,{options:_0x130bb4,tdx:_0x14c55d}=_0x3a530f;try{const _0x5daee9=resolveLimit(_0x130bb4['limit'],DEFAULT_DISPLAY_LIMIT),_0x174797=_0x130bb4[_0x50b0a7(0x12b)];_0x130bb4[_0x50b0a7(0x152)]&&(console[_0x50b0a7(0x140)](_0x50b0a7(0x129)+_0x5daee9+_0x50b0a7(0x14f)),_0x174797&&console[_0x50b0a7(0x140)](_0x50b0a7(0x136)+_0x174797));const _0x2ea861=await withSpinner(_0x50b0a7(0x16a),()=>_0x14c55d[_0x50b0a7(0x14c)]['list']({'from':0x0,'to':_0x5daee9-0x1,'status':_0x174797}),{'verbose':_0x130bb4[_0x50b0a7(0x152)]}),_0x579915=_0x2ea861[_0x50b0a7(0x148)];console[_0x50b0a7(0x140)](_0x50b0a7(0x13b)+_0x579915[_0x50b0a7(0x14d)]+_0x50b0a7(0x130)+(_0x579915[_0x50b0a7(0x14d)]!==0x1?'s':''));const _0x234588=_0x579915['map'](_0x3cf6e9=>{const _0x1f15bb=_0x50b0a7;let _0x57a7fc;if(_0x3cf6e9['start_at']&&_0x3cf6e9[_0x1f15bb(0x124)]){const _0x391719=new Date(_0x3cf6e9['start_at'])['getTime'](),_0x57355a=new Date(_0x3cf6e9['end_at'])[_0x1f15bb(0x153)]();_0x57a7fc=Math[_0x1f15bb(0x15d)]((_0x57355a-_0x391719)/0x3e8);}return{'job_id':_0x3cf6e9[_0x1f15bb(0x121)],'type':_0x3cf6e9[_0x1f15bb(0x134)],'status':_0x3cf6e9[_0x1f15bb(0x12b)],'user_name':_0x3cf6e9[_0x1f15bb(0x12c)],'duration_sec':_0x57a7fc,'created_at':_0x3cf6e9[_0x1f15bb(0x125)],'started_at':_0x3cf6e9[_0x1f15bb(0x123)],'end_at':_0x3cf6e9[_0x1f15bb(0x124)]};});return await handleSDKOutput(_0x234588,_0x130bb4),0x0;}catch(_0x48d88b){if(_0x48d88b instanceof SDKError)return console[_0x50b0a7(0x140)](_0x50b0a7(0x12d)+_0x48d88b[_0x50b0a7(0x160)]),_0x48d88b['cause']&&console['error']('\x20\x20Cause:\x20'+_0x48d88b['cause']),0x1;throw _0x48d88b;}}}export class JobShowCommand extends BaseCommand{[a19_0x502973(0x12f)]=a19_0x502973(0x15f);['description']=a19_0x502973(0x162);async[a19_0x502973(0x167)](_0x5895e6){const _0x543623=a19_0x502973,{options:_0x55f358,args:_0xe4fcb1,tdx:_0x4ec116}=_0x5895e6,_0x3e37ae=_0xe4fcb1[0x0];if(!_0x3e37ae)return console[_0x543623(0x140)](_0x543623(0x141)),console[_0x543623(0x140)](_0x543623(0x15c)),0x1;try{const _0x3cc0c4=await withSpinner(_0x543623(0x143),()=>_0x4ec116['jobs'][_0x543623(0x149)](_0x3e37ae),{'verbose':_0x55f358[_0x543623(0x152)]}),_0x91f351=_0x3cc0c4[_0x543623(0x148)];let _0x4129a8;if(_0x91f351[_0x543623(0x123)]&&_0x91f351[_0x543623(0x124)]){const _0x55eb1c=new Date(_0x91f351[_0x543623(0x123)])[_0x543623(0x153)](),_0x1c0070=new Date(_0x91f351[_0x543623(0x124)])[_0x543623(0x153)]();_0x4129a8=Math['round']((_0x1c0070-_0x55eb1c)/0x3e8);}const _0x83e120={'job_id':_0x91f351[_0x543623(0x121)],'type':_0x91f351[_0x543623(0x134)],'status':_0x91f351[_0x543623(0x12b)],..._0x91f351[_0x543623(0x12c)]&&{'user_name':_0x91f351[_0x543623(0x12c)]},..._0x4129a8!==undefined&&{'duration_sec':_0x4129a8},..._0x91f351[_0x543623(0x125)]&&{'created_at':_0x91f351['created_at']},..._0x91f351['start_at']&&{'started_at':_0x91f351[_0x543623(0x123)]},..._0x91f351[_0x543623(0x124)]&&{'end_at':_0x91f351[_0x543623(0x124)]},..._0x91f351[_0x543623(0x146)]&&{'database':_0x91f351[_0x543623(0x146)]},..._0x91f351[_0x543623(0x142)]!==undefined&&{'priority':_0x91f351[_0x543623(0x142)]},..._0x91f351['url']&&{'url':_0x91f351[_0x543623(0x158)]},..._0x91f351[_0x543623(0x138)]&&{'query':_0x91f351[_0x543623(0x138)]},..._0x91f351[_0x543623(0x154)]&&{'debug':_0x91f351[_0x543623(0x154)]}};return await handleSingleObjectOutput(_0x83e120,_0x55f358),0x0;}catch(_0x5e45d6){if(_0x5e45d6 instanceof SDKError)return console[_0x543623(0x140)](_0x543623(0x12d)+_0x5e45d6[_0x543623(0x160)]),_0x5e45d6[_0x543623(0x131)]&&console[_0x543623(0x140)](_0x543623(0x168)+_0x5e45d6[_0x543623(0x131)]),0x1;throw _0x5e45d6;}}}export class JobKillCommand extends BaseCommand{[a19_0x502973(0x12f)]=a19_0x502973(0x163);['description']=a19_0x502973(0x16c);async[a19_0x502973(0x167)](_0x11b3e3){const _0x1212b8=a19_0x502973,{options:_0x4a82d1,args:_0x2469ab,tdx:_0x26dd9e}=_0x11b3e3,_0x242854=_0x2469ab[0x0];if(!_0x242854)return console[_0x1212b8(0x140)](_0x1212b8(0x141)),console[_0x1212b8(0x140)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x4a82d1[_0x1212b8(0x13d)]){const _0x19f290=await confirm(_0x1212b8(0x133)+_0x242854+'?');if(!_0x19f290)return console[_0x1212b8(0x140)]('Cancelled'),0x0;}return await withSpinner(_0x1212b8(0x169),()=>_0x26dd9e['jobs'][_0x1212b8(0x165)](_0x242854),{'verbose':_0x4a82d1[_0x1212b8(0x152)]}),console[_0x1212b8(0x140)](_0x1212b8(0x157)+_0x242854),console[_0x1212b8(0x140)](_0x1212b8(0x151)+_0x242854+_0x1212b8(0x145)),0x0;}catch(_0x4cc717){if(_0x4cc717 instanceof SDKError)return console[_0x1212b8(0x140)](_0x1212b8(0x12d)+_0x4cc717[_0x1212b8(0x160)]),_0x4cc717[_0x1212b8(0x131)]&&console[_0x1212b8(0x140)]('\x20\x20Cause:\x20'+_0x4cc717[_0x1212b8(0x131)]),0x1;throw _0x4cc717;}}}export class JobSubmitCommand extends BaseCommand{[a19_0x502973(0x12f)]=a19_0x502973(0x122);[a19_0x502973(0x155)]=a19_0x502973(0x12e);async[a19_0x502973(0x167)](_0x11c787){const _0x6a9ac2=a19_0x502973,{options:_0x59a7eb,args:_0x2e2c5c,tdx:_0x21ff9e}=_0x11c787;try{const _0x43be57=_0x59a7eb[_0x6a9ac2(0x15a)]||_0x6a9ac2(0x161),_0x406468=_0x59a7eb[_0x6a9ac2(0x164)],_0x30d0f6=_0x59a7eb[_0x6a9ac2(0x146)]||'information_schema';if(_0x43be57!=='trino'&&_0x43be57!==_0x6a9ac2(0x16b))return console[_0x6a9ac2(0x140)]('Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22'),0x1;let _0x1ad827;if(_0x406468){if(_0x2e2c5c[0x0])return console[_0x6a9ac2(0x140)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x3b061b=readSqlStatementsFromFile(_0x406468);if(_0x3b061b[_0x6a9ac2(0x14d)]===0x0)return console[_0x6a9ac2(0x140)]('Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file'),0x1;if(_0x3b061b[_0x6a9ac2(0x14d)]>0x1)return console['error'](_0x6a9ac2(0x159)),0x1;_0x1ad827=_0x3b061b[0x0];}else{if(!_0x2e2c5c[0x0])return console[_0x6a9ac2(0x140)](_0x6a9ac2(0x15e)),console[_0x6a9ac2(0x140)](_0x6a9ac2(0x14e)),0x1;_0x1ad827=_0x2e2c5c[0x0];}_0x59a7eb[_0x6a9ac2(0x152)]&&(console['error'](_0x6a9ac2(0x13c)+_0x43be57),console[_0x6a9ac2(0x140)](_0x6a9ac2(0x132)+_0x30d0f6),console[_0x6a9ac2(0x140)](_0x6a9ac2(0x126)+_0x1ad827[_0x6a9ac2(0x13f)](0x0,0x64)+(_0x1ad827[_0x6a9ac2(0x14d)]>0x64?'...':'')));const _0xb1f6f1=await withSpinner('Submitting\x20job...',()=>_0x21ff9e[_0x6a9ac2(0x14c)][_0x6a9ac2(0x12a)](_0x30d0f6,_0x1ad827,_0x43be57),{'verbose':_0x59a7eb[_0x6a9ac2(0x152)]}),_0x112141=_0xb1f6f1[_0x6a9ac2(0x148)];return console[_0x6a9ac2(0x140)](_0x6a9ac2(0x147)),console['error']('\x20\x20Job\x20ID:\x20'+_0x112141['job_id']),await handleSDKOutput([_0x112141],_0x59a7eb),0x0;}catch(_0x2e4a54){if(_0x2e4a54 instanceof SDKError)return console['error']('Error:\x20'+_0x2e4a54[_0x6a9ac2(0x160)]),_0x2e4a54[_0x6a9ac2(0x131)]&&console[_0x6a9ac2(0x140)](_0x6a9ac2(0x168)+_0x2e4a54[_0x6a9ac2(0x131)]),0x1;throw _0x2e4a54;}}}export class JobResultCommand extends BaseCommand{[a19_0x502973(0x12f)]=a19_0x502973(0x14a);['description']=a19_0x502973(0x127);async[a19_0x502973(0x167)](_0x4313a6){const _0x4e1da8=a19_0x502973,{options:_0x4b417c,args:_0x3279ca,tdx:_0x3c0b4d}=_0x4313a6,_0x45a00e=_0x3279ca[0x0];if(!_0x45a00e)return console[_0x4e1da8(0x140)](_0x4e1da8(0x141)),console[_0x4e1da8(0x140)]('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0x8c53=await withSpinner(_0x4e1da8(0x137),()=>_0x3c0b4d[_0x4e1da8(0x14c)][_0x4e1da8(0x13e)](_0x45a00e),{'verbose':_0x4b417c['verbose']}),_0x392eb9=_0x8c53[_0x4e1da8(0x148)];return console[_0x4e1da8(0x140)]('✔\x20Retrieved\x20'+_0x392eb9[_0x4e1da8(0x14d)]+_0x4e1da8(0x135)+(_0x392eb9[_0x4e1da8(0x14d)]!==0x1?'s':'')),await handleSDKOutput(_0x392eb9,_0x4b417c),0x0;}catch(_0x1e1ee0){if(_0x1e1ee0 instanceof SDKError)return console[_0x4e1da8(0x140)](_0x4e1da8(0x12d)+_0x1e1ee0[_0x4e1da8(0x160)]),_0x1e1ee0[_0x4e1da8(0x131)]&&console[_0x4e1da8(0x140)]('\x20\x20Cause:\x20'+_0x1e1ee0[_0x4e1da8(0x131)]),0x1;throw _0x1e1ee0;}}}
|
|
1
|
+
const a19_0x52fb63=a19_0xb6d9;function a19_0x123f(){const _0x5593b1=['3876610oGmPgC','5454295qVFdYl','job:result','user_name','cause','Error:\x20','name','created_at','972120HVTppC','Submit\x20a\x20job','type','url','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','3525417rqgDcQ','list','job:kill','\x20row','44644YwvuPt','10wmHgVD','Error:\x20Query\x20is\x20required','\x27\x20to\x20verify\x20the\x20job\x20status','Listing\x20jobs...','data','show','Job\x20type:\x20','jobType','execute','Usage:\x20job\x20show\x20<job-id>','Query:\x20','length','10kNvplT','verbose','Usage:\x20job\x20kill\x20<job-id>','Error:\x20Job\x20ID\x20is\x20required','Kill\x20a\x20job','hive','trino','error','Status\x20filter:\x20','✔\x20Job\x20submitted','8JgQNvz','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','7ymvIId','\x20\x20Cause:\x20','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','job:submit','debug','job_id','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','692961jvoFzq','getTime','jobs','end_at','Submitting\x20job...','message','List\x20jobs','Getting\x20job\x20results...','Getting\x20job\x20details...','job:show','map','✔\x20Retrieved\x20','result','file','information_schema','description','priority','...','kill','status','round','start_at','database','2124128utUwfr'];a19_0x123f=function(){return _0x5593b1;};return a19_0x123f();}(function(_0x4fee98,_0x984967){const _0x4675a0=a19_0xb6d9,_0x15c086=_0x4fee98();while(!![]){try{const _0x413a77=parseInt(_0x4675a0(0x128))/0x1*(parseInt(_0x4675a0(0x11b))/0x2)+-parseInt(_0x4675a0(0x13c))/0x3*(-parseInt(_0x4675a0(0x132))/0x4)+parseInt(_0x4675a0(0x11c))/0x5*(parseInt(_0x4675a0(0x112))/0x6)+parseInt(_0x4675a0(0x134))/0x7*(-parseInt(_0x4675a0(0x109))/0x8)+parseInt(_0x4675a0(0x117))/0x9+-parseInt(_0x4675a0(0x10a))/0xa+-parseInt(_0x4675a0(0x10b))/0xb;if(_0x413a77===_0x984967)break;else _0x15c086['push'](_0x15c086['shift']());}catch(_0x5be62a){_0x15c086['push'](_0x15c086['shift']());}}}(a19_0x123f,0x3d815));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{['name']='jobs';[a19_0x52fb63(0x14b)]=a19_0x52fb63(0x142);async[a19_0x52fb63(0x124)](_0x36abb8){const _0x3c55fc=a19_0x52fb63,{options:_0x4b94a0,tdx:_0x18b9fc}=_0x36abb8;try{const _0x1a0da5=resolveLimit(_0x4b94a0['limit'],DEFAULT_DISPLAY_LIMIT),_0x40f5a0=_0x4b94a0[_0x3c55fc(0x105)];_0x4b94a0[_0x3c55fc(0x129)]&&(console['error']('Limit:\x20'+_0x1a0da5+'\x20jobs'),_0x40f5a0&&console[_0x3c55fc(0x12f)](_0x3c55fc(0x130)+_0x40f5a0));const _0x243277=await withSpinner(_0x3c55fc(0x11f),()=>_0x18b9fc[_0x3c55fc(0x13e)][_0x3c55fc(0x118)]({'from':0x0,'to':_0x1a0da5-0x1,'status':_0x40f5a0}),{'verbose':_0x4b94a0[_0x3c55fc(0x129)]}),_0x39ae39=_0x243277['data'];console[_0x3c55fc(0x12f)]('✔\x20Found\x20'+_0x39ae39[_0x3c55fc(0x127)]+'\x20job'+(_0x39ae39[_0x3c55fc(0x127)]!==0x1?'s':''));const _0x186e09=_0x39ae39[_0x3c55fc(0x146)](_0x45c2c2=>{const _0x3c4a0c=_0x3c55fc;let _0x43398f;if(_0x45c2c2[_0x3c4a0c(0x107)]&&_0x45c2c2[_0x3c4a0c(0x13f)]){const _0xe59bcc=new Date(_0x45c2c2['start_at'])[_0x3c4a0c(0x13d)](),_0x3811de=new Date(_0x45c2c2[_0x3c4a0c(0x13f)])[_0x3c4a0c(0x13d)]();_0x43398f=Math['round']((_0x3811de-_0xe59bcc)/0x3e8);}return{'job_id':_0x45c2c2['job_id'],'type':_0x45c2c2[_0x3c4a0c(0x114)],'status':_0x45c2c2[_0x3c4a0c(0x105)],'user_name':_0x45c2c2[_0x3c4a0c(0x10d)],'duration_sec':_0x43398f,'created_at':_0x45c2c2[_0x3c4a0c(0x111)],'started_at':_0x45c2c2[_0x3c4a0c(0x107)],'end_at':_0x45c2c2[_0x3c4a0c(0x13f)]};});return await handleSDKOutput(_0x186e09,_0x4b94a0),0x0;}catch(_0x4381ab){if(_0x4381ab instanceof SDKError)return console[_0x3c55fc(0x12f)](_0x3c55fc(0x10f)+_0x4381ab[_0x3c55fc(0x141)]),_0x4381ab[_0x3c55fc(0x10e)]&&console[_0x3c55fc(0x12f)](_0x3c55fc(0x135)+_0x4381ab[_0x3c55fc(0x10e)]),0x1;throw _0x4381ab;}}}export class JobShowCommand extends BaseCommand{[a19_0x52fb63(0x110)]=a19_0x52fb63(0x145);['description']='Show\x20job\x20details';async[a19_0x52fb63(0x124)](_0x3b4549){const _0x1cc593=a19_0x52fb63,{options:_0x18f6da,args:_0x306668,tdx:_0x258c31}=_0x3b4549,_0x2bcd=_0x306668[0x0];if(!_0x2bcd)return console[_0x1cc593(0x12f)](_0x1cc593(0x12b)),console[_0x1cc593(0x12f)](_0x1cc593(0x125)),0x1;try{const _0x1da4bd=await withSpinner(_0x1cc593(0x144),()=>_0x258c31[_0x1cc593(0x13e)][_0x1cc593(0x121)](_0x2bcd),{'verbose':_0x18f6da[_0x1cc593(0x129)]}),_0xc737cb=_0x1da4bd[_0x1cc593(0x120)];let _0x2a4072;if(_0xc737cb[_0x1cc593(0x107)]&&_0xc737cb['end_at']){const _0xed498c=new Date(_0xc737cb[_0x1cc593(0x107)])[_0x1cc593(0x13d)](),_0x494a8f=new Date(_0xc737cb[_0x1cc593(0x13f)])[_0x1cc593(0x13d)]();_0x2a4072=Math[_0x1cc593(0x106)]((_0x494a8f-_0xed498c)/0x3e8);}const _0x11bdd8={'job_id':_0xc737cb[_0x1cc593(0x13a)],'type':_0xc737cb[_0x1cc593(0x114)],'status':_0xc737cb[_0x1cc593(0x105)],..._0xc737cb[_0x1cc593(0x10d)]&&{'user_name':_0xc737cb[_0x1cc593(0x10d)]},..._0x2a4072!==undefined&&{'duration_sec':_0x2a4072},..._0xc737cb['created_at']&&{'created_at':_0xc737cb[_0x1cc593(0x111)]},..._0xc737cb['start_at']&&{'started_at':_0xc737cb[_0x1cc593(0x107)]},..._0xc737cb[_0x1cc593(0x13f)]&&{'end_at':_0xc737cb['end_at']},..._0xc737cb['database']&&{'database':_0xc737cb[_0x1cc593(0x108)]},..._0xc737cb[_0x1cc593(0x102)]!==undefined&&{'priority':_0xc737cb[_0x1cc593(0x102)]},..._0xc737cb[_0x1cc593(0x115)]&&{'url':_0xc737cb[_0x1cc593(0x115)]},..._0xc737cb['query']&&{'query':_0xc737cb['query']},..._0xc737cb[_0x1cc593(0x139)]&&{'debug':_0xc737cb[_0x1cc593(0x139)]}};return await handleSingleObjectOutput(_0x11bdd8,_0x18f6da),0x0;}catch(_0x2cd784){if(_0x2cd784 instanceof SDKError)return console['error']('Error:\x20'+_0x2cd784['message']),_0x2cd784[_0x1cc593(0x10e)]&&console[_0x1cc593(0x12f)](_0x1cc593(0x135)+_0x2cd784[_0x1cc593(0x10e)]),0x1;throw _0x2cd784;}}}function a19_0xb6d9(_0x33f652,_0x46b1c8){const _0x123f20=a19_0x123f();return a19_0xb6d9=function(_0xb6d9ac,_0x97f13e){_0xb6d9ac=_0xb6d9ac-0x102;let _0x2a96cd=_0x123f20[_0xb6d9ac];return _0x2a96cd;},a19_0xb6d9(_0x33f652,_0x46b1c8);}export class JobKillCommand extends BaseCommand{[a19_0x52fb63(0x110)]=a19_0x52fb63(0x119);['description']=a19_0x52fb63(0x12c);async[a19_0x52fb63(0x124)](_0x2fa3ce){const _0x55ace8=a19_0x52fb63,{options:_0x32dad0,args:_0x5f09b2,tdx:_0x4ceee6}=_0x2fa3ce,_0x43057e=_0x5f09b2[0x0];if(!_0x43057e)return console[_0x55ace8(0x12f)](_0x55ace8(0x12b)),console[_0x55ace8(0x12f)](_0x55ace8(0x12a)),0x1;try{if(!_0x32dad0['yes']){const _0x3138db=await confirm(_0x55ace8(0x13b)+_0x43057e+'?');if(!_0x3138db)return console['error']('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x4ceee6[_0x55ace8(0x13e)][_0x55ace8(0x104)](_0x43057e),{'verbose':_0x32dad0[_0x55ace8(0x129)]}),console['error']('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x43057e),console[_0x55ace8(0x12f)](_0x55ace8(0x116)+_0x43057e+_0x55ace8(0x11e)),0x0;}catch(_0x507d82){if(_0x507d82 instanceof SDKError)return console[_0x55ace8(0x12f)](_0x55ace8(0x10f)+_0x507d82[_0x55ace8(0x141)]),_0x507d82[_0x55ace8(0x10e)]&&console['error'](_0x55ace8(0x135)+_0x507d82[_0x55ace8(0x10e)]),0x1;throw _0x507d82;}}}export class JobSubmitCommand extends BaseCommand{[a19_0x52fb63(0x110)]=a19_0x52fb63(0x138);[a19_0x52fb63(0x14b)]=a19_0x52fb63(0x113);async['execute'](_0x280cb8){const _0x3d782f=a19_0x52fb63,{options:_0x7bf505,args:_0x46c51c,tdx:_0x1b01ec}=_0x280cb8;try{const _0x1626a9=_0x7bf505[_0x3d782f(0x123)]||_0x3d782f(0x12e),_0x512460=_0x7bf505[_0x3d782f(0x149)],_0x32047d=_0x7bf505[_0x3d782f(0x108)]||_0x3d782f(0x14a);if(_0x1626a9!=='trino'&&_0x1626a9!==_0x3d782f(0x12d))return console[_0x3d782f(0x12f)]('Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22'),0x1;let _0x1b064a;if(_0x512460){if(_0x46c51c[0x0])return console[_0x3d782f(0x12f)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x1ff082=readSqlStatementsFromFile(_0x512460);if(_0x1ff082[_0x3d782f(0x127)]===0x0)return console[_0x3d782f(0x12f)](_0x3d782f(0x137)),0x1;if(_0x1ff082[_0x3d782f(0x127)]>0x1)return console[_0x3d782f(0x12f)](_0x3d782f(0x133)),0x1;_0x1b064a=_0x1ff082[0x0];}else{if(!_0x46c51c[0x0])return console['error'](_0x3d782f(0x11d)),console[_0x3d782f(0x12f)](_0x3d782f(0x136)),0x1;_0x1b064a=_0x46c51c[0x0];}_0x7bf505[_0x3d782f(0x129)]&&(console['error'](_0x3d782f(0x122)+_0x1626a9),console[_0x3d782f(0x12f)]('Database:\x20'+_0x32047d),console['error'](_0x3d782f(0x126)+_0x1b064a['substring'](0x0,0x64)+(_0x1b064a[_0x3d782f(0x127)]>0x64?_0x3d782f(0x103):'')));const _0x5b8eab=await withSpinner(_0x3d782f(0x140),()=>_0x1b01ec['jobs']['submit'](_0x32047d,_0x1b064a,_0x1626a9),{'verbose':_0x7bf505[_0x3d782f(0x129)]}),_0x48ab3b=_0x5b8eab[_0x3d782f(0x120)];return console[_0x3d782f(0x12f)](_0x3d782f(0x131)),console[_0x3d782f(0x12f)]('\x20\x20Job\x20ID:\x20'+_0x48ab3b[_0x3d782f(0x13a)]),await handleSDKOutput([_0x48ab3b],_0x7bf505),0x0;}catch(_0x568e42){if(_0x568e42 instanceof SDKError)return console[_0x3d782f(0x12f)](_0x3d782f(0x10f)+_0x568e42[_0x3d782f(0x141)]),_0x568e42['cause']&&console[_0x3d782f(0x12f)](_0x3d782f(0x135)+_0x568e42[_0x3d782f(0x10e)]),0x1;throw _0x568e42;}}}export class JobResultCommand extends BaseCommand{[a19_0x52fb63(0x110)]=a19_0x52fb63(0x10c);[a19_0x52fb63(0x14b)]='Get\x20job\x20results';async[a19_0x52fb63(0x124)](_0x34a1be){const _0x94228c=a19_0x52fb63,{options:_0x55f627,args:_0x2f1b9c,tdx:_0x1145c5}=_0x34a1be,_0x4aa8e3=_0x2f1b9c[0x0];if(!_0x4aa8e3)return console[_0x94228c(0x12f)](_0x94228c(0x12b)),console[_0x94228c(0x12f)]('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0xcacb6b=await withSpinner(_0x94228c(0x143),()=>_0x1145c5[_0x94228c(0x13e)][_0x94228c(0x148)](_0x4aa8e3),{'verbose':_0x55f627['verbose']}),_0x3fa9e6=_0xcacb6b[_0x94228c(0x120)];return console[_0x94228c(0x12f)](_0x94228c(0x147)+_0x3fa9e6['length']+_0x94228c(0x11a)+(_0x3fa9e6[_0x94228c(0x127)]!==0x1?'s':'')),await handleSDKOutput(_0x3fa9e6,_0x55f627),0x0;}catch(_0x15e651){if(_0x15e651 instanceof SDKError)return console['error'](_0x94228c(0x10f)+_0x15e651['message']),_0x15e651[_0x94228c(0x10e)]&&console['error'](_0x94228c(0x135)+_0x15e651[_0x94228c(0x10e)]),0x1;throw _0x15e651;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x5daf09=a20_0x2f2a;(function(_0x4e7f35,_0x327983){const _0x57fa8b=a20_0x2f2a,_0x4ab245=_0x4e7f35();while(!![]){try{const _0x1cd032=-parseInt(_0x57fa8b(0x23e))/0x1*(parseInt(_0x57fa8b(0x1b8))/0x2)+-parseInt(_0x57fa8b(0x22d))/0x3+-parseInt(_0x57fa8b(0x1c4))/0x4+parseInt(_0x57fa8b(0x1e3))/0x5+parseInt(_0x57fa8b(0x226))/0x6+parseInt(_0x57fa8b(0x1fd))/0x7+-parseInt(_0x57fa8b(0x209))/0x8;if(_0x1cd032===_0x327983)break;else _0x4ab245['push'](_0x4ab245['shift']());}catch(_0x490b76){_0x4ab245['push'](_0x4ab245['shift']());}}}(a20_0x3475,0xc7591));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a20_0x3475(){const _0x5e059b=['backupProject','blue','List\x20agents\x20in\x20current\x20project','input','\x0aStack\x20trace:','Use\x20format:\x20project-name/agent-name','[unknown]','image','model','knowledgeBases','llm:agent:create','sourceSite','\x20-\x20','keys','[input]\x20\x20','resolveProjectId','resolveAgentId','INVALID_ARGUMENT','3298365mCLHPE','maxToolIterations','llm:use','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','Fetching\x20chat\x20sessions...','Fetching\x20agent...','Project\x20not\x20found:\x20','prompt','llm:agent:update','createdAt','[image]\x20\x20','find','firstInputContent','green','List\x20all\x20LLM\x20projects','\x27...','stringify','Set\x20current\x20project\x20context','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','starterMessage','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','Error:\x20Agent\x20name\x20is\x20required','targetWebSearchTool','entries','10537408QUIPwX','chats','llmProject','name','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','Fetching\x20most\x20recent\x20chat...','setCurrentProject','description','llm:models','getBackupMetadata','Project\x20created:\x20','cause','3186640JaUDqx','content','Agent\x20deleted:\x20','data','[error]\x20\x20','\x20->\x20Agent:','tsv','restoreProject','rmSync','limit','Updating\x20agent...','jsonl','Error:\x20Project\x20name\x20is\x20required','updatedAt','\x20->\x20KB:','Backup\x20cancelled.','getOrCreateDefaultProject','magenta','tool_call','\x27\x20already\x20exists.\x20Overwrite?','targetKnowledgeBase','Agent\x20created:\x20','Usage:\x20tdx\x20llm\x20use\x20<project-name>','No\x20chat\x20sessions\x20found.','Deleting\x20project\x20\x27','counts','slice','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','llm:project:create','6462162laZfZY','prompts','length','toLowerCase','Checking\x20for\x20existing\x20projects...','log','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','1479465AtyueP','Usage:\x20tdx\x20llm\x20history\x20--last','dryRun','cyan','bold','json','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','format','targetImageGenerator','Deleting\x20agent...','Project\x20context\x20set\x20to:\x20','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','llm:agents','Delete\x20an\x20LLM\x20project','error','stack','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','94401VZHKsG','\x20bytes)','llm','Fetching\x20projects...','llm:project:backup','llm:agent:show','systemPrompt','\x20->\x20WebSearch:','Fetching\x20agents...','Restore\x20cancelled.','Invalid\x20path\x20syntax:\x20','\x20\x20Prompts:\x20','Setting\x20project\x20context\x20to\x20\x27','Resolving\x20agent\x20\x27','outputDir','A\x20project\x20named\x20\x27','output','\x20→\x20chat:\x20','targetAgent','.llm','temperature','Fetching\x20chat\x20history\x20for\x20\x27','includes','split','...','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','llm:agent:delete','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','\x20\x20Integrations:\x20','last','dim','models','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Project\x20deleted:\x20','getCurrentProject','(no\x20message)','execute','join','projects','projectName','[output]\x20','yellow','Create\x20a\x20new\x20agent\x20in\x20current\x20project','yes','createAgent','4VPwweC','Creating\x20project\x20\x27','llm:project:restore','tool','Show\x20agent\x20details','Update\x20an\x20existing\x20agent','verbose','\x20\x20Knowledge\x20Bases:\x20','List\x20available\x20LLM\x20models','Delete\x20an\x20agent','Validating\x20backup\x20from\x20\x27','claude-4.5-haiku','5380912QImcoY','Error:\x20Backup\x20folder\x20path\x20is\x20required','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','Project\x20restored:\x20','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','red','Output\x20directory\x20\x27','Project\x20backed\x20up\x20to:\x20','map','exportedFrom','table','Resolving\x20project\x20\x27','attributes'];a20_0x3475=function(){return _0x5e059b;};return a20_0x3475();}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';import{confirm}from'../utils/prompt.js';import*as a20_0x7d7ebf from'node:fs';function handleSDKError(_0x573f08,_0x10b248){const _0x10f172=a20_0x2f2a;if(_0x573f08 instanceof SDKError)console['error']('Error:\x20'+_0x573f08['message']),_0x10b248['verbose']&&(_0x573f08[_0x10f172(0x208)]&&console[_0x10f172(0x23b)]('\x20\x20Cause:\x20'+_0x573f08[_0x10f172(0x208)]),_0x573f08[_0x10f172(0x23c)]&&(console[_0x10f172(0x23b)](_0x10f172(0x1d5)),console[_0x10f172(0x23b)](_0x573f08[_0x10f172(0x23c)])));else throw _0x573f08;}function formatChatHistoryEntry(_0x5238b5,_0xb9e701){const _0x187d16=a20_0x2f2a,_0x46eed2=getChalk(_0xb9e701),_0x4a98af=_0x46eed2[_0x187d16(0x1a9)](_0x5238b5['at']);if(_0x187d16(0x1d4)in _0x5238b5){const _0x44e31f=_0x46eed2[_0x187d16(0x230)](_0x187d16(0x1df));return _0x4a98af+'\x20'+_0x44e31f+':\x20'+_0x5238b5['input'];}if(_0x187d16(0x20a)in _0x5238b5){const _0x344156=_0x46eed2[_0x187d16(0x1f1)]('[content]');return _0x4a98af+'\x20'+_0x344156+':\x20'+_0x5238b5[_0x187d16(0x20a)];}if(_0x187d16(0x21b)in _0x5238b5){const _0x319089=_0x46eed2[_0x187d16(0x1b4)]('[tool_call]'),{functionName:_0x118062,functionArguments:_0x3595f1,targetFunction:_0x2a2aa9}=_0x5238b5[_0x187d16(0x21b)];let _0x38a857=_0x4a98af+'\x20'+_0x319089+':\x20'+_0x46eed2[_0x187d16(0x231)](_0x118062);if(_0x3595f1&&Object[_0x187d16(0x1de)](_0x3595f1)['length']>0x0){const _0x59c3c0=Object[_0x187d16(0x1fc)](_0x3595f1)['map'](([_0x101289,_0xd81865])=>_0x101289+'='+JSON[_0x187d16(0x1f4)](_0xd81865))[_0x187d16(0x1b0)](',\x20');_0x38a857+='('+_0x59c3c0+')';}_0x2a2aa9&&(_0x38a857+=_0x46eed2[_0x187d16(0x1a9)]('\x20['+_0x2a2aa9+']'));let _0x1dbc86='';if(_0x5238b5[_0x187d16(0x21b)][_0x187d16(0x21d)])_0x1dbc86=_0x187d16(0x217)+_0x5238b5[_0x187d16(0x21b)][_0x187d16(0x21d)][_0x187d16(0x200)];else{if(_0x5238b5[_0x187d16(0x21b)][_0x187d16(0x250)])_0x1dbc86=_0x187d16(0x20e)+_0x5238b5[_0x187d16(0x21b)][_0x187d16(0x250)][_0x187d16(0x200)];else{if(_0x5238b5['tool_call'][_0x187d16(0x1fb)])_0x1dbc86=_0x187d16(0x245)+_0x5238b5[_0x187d16(0x21b)][_0x187d16(0x1fb)][_0x187d16(0x200)];else _0x5238b5['tool_call'][_0x187d16(0x235)]&&(_0x1dbc86='\x20->\x20ImageGen:'+_0x5238b5['tool_call'][_0x187d16(0x235)][_0x187d16(0x200)]);}}return _0x38a857+_0x1dbc86;}if(_0x187d16(0x1bb)in _0x5238b5){const _0x2ade8b=_0x46eed2[_0x187d16(0x21a)]('[tool]\x20\x20\x20'),{functionName:_0x273034,functionArguments:_0x144f0b,content:_0x359175,newChat:_0x4d39c6}=_0x5238b5[_0x187d16(0x1bb)];let _0x6b5282=_0x4a98af+'\x20'+_0x2ade8b+':\x20'+_0x46eed2[_0x187d16(0x231)](_0x273034);if(_0x144f0b){const _0x4ffc33=typeof _0x144f0b==='string'?_0x144f0b:JSON[_0x187d16(0x1f4)](_0x144f0b);_0x6b5282+='('+_0x4ffc33+')';}return _0x359175&&(_0x6b5282+='\x0a'+_0x46eed2[_0x187d16(0x1a9)](_0x359175)),_0x4d39c6&&(_0x6b5282+=_0x46eed2['dim'](_0x187d16(0x24f)+_0x4d39c6['id'])),_0x6b5282;}if('output'in _0x5238b5){const _0x285c1c=_0x46eed2[_0x187d16(0x1d2)](_0x187d16(0x1b3));return _0x4a98af+'\x20'+_0x285c1c+':\x20'+_0x5238b5['output']['name']+'\x20('+_0x5238b5['output']['content']['length']+_0x187d16(0x23f);}if(_0x187d16(0x1d8)in _0x5238b5){const _0x1fdd7c=_0x46eed2[_0x187d16(0x1d2)](_0x187d16(0x1ee)),{width:_0x17be1b,height:_0x3719cc,headerText:_0x4a63bb}=_0x5238b5['image'],_0x530a2c=_0x4a63bb?_0x187d16(0x1dd)+_0x4a63bb:'';return _0x4a98af+'\x20'+_0x1fdd7c+':\x20'+_0x17be1b+'x'+_0x3719cc+_0x530a2c;}if(_0x187d16(0x23b)in _0x5238b5){const _0x436f73=_0x46eed2[_0x187d16(0x1c9)](_0x187d16(0x20d));return _0x4a98af+'\x20'+_0x436f73+':\x20'+_0x5238b5[_0x187d16(0x23b)];}return _0x4a98af+'\x20'+_0x46eed2[_0x187d16(0x1a9)](_0x187d16(0x1d7))+':\x20'+JSON[_0x187d16(0x1f4)](_0x5238b5);}async function getProjectIdOrDefault(_0x41ca07){const _0x2527ae=a20_0x2f2a,{tdx:_0x204016,options:_0xb936f7}=_0x41ca07,_0x4ff779=_0xb936f7[_0x2527ae(0x1ff)];if(_0x4ff779){const _0x55775a=await withSpinner(_0x2527ae(0x1cf)+_0x4ff779+_0x2527ae(0x1f3),()=>_0x204016[_0x2527ae(0x240)]['resolveProjectId'](_0x4ff779),{'verbose':_0xb936f7[_0x2527ae(0x1be)]});return _0x55775a[_0x2527ae(0x20c)];}let _0x5aee0b=_0x204016[_0x2527ae(0x240)][_0x2527ae(0x1ad)]();if(_0x5aee0b)return _0x5aee0b;const _0x3b55bf=await withSpinner('Getting\x20default\x20project...',()=>_0x204016['llm'][_0x2527ae(0x219)](),{'verbose':_0xb936f7[_0x2527ae(0x1be)]});return _0x3b55bf[_0x2527ae(0x20c)]['id'];}function toLLMProjectInfo(_0x3d7be2){const _0x27c426=a20_0x2f2a;return{'name':_0x3d7be2[_0x27c426(0x1d0)][_0x27c426(0x200)],'description':_0x3d7be2[_0x27c426(0x1d0)][_0x27c426(0x204)],'createdAt':_0x3d7be2['attributes'][_0x27c426(0x1ed)],'updatedAt':_0x3d7be2[_0x27c426(0x1d0)]['updatedAt']};}function toAgentInfo(_0x4dcc45){const _0x4aca82=a20_0x2f2a;return{'name':_0x4dcc45[_0x4aca82(0x1d0)]['name'],'description':_0x4dcc45[_0x4aca82(0x1d0)][_0x4aca82(0x204)],'prompt':truncatePrompt(_0x4dcc45[_0x4aca82(0x1d0)][_0x4aca82(0x1eb)]),'createdAt':_0x4dcc45['attributes'][_0x4aca82(0x1ed)],'updatedAt':_0x4dcc45[_0x4aca82(0x1d0)][_0x4aca82(0x216)]};}function truncatePrompt(_0x42978b){const _0x1108a9=a20_0x2f2a;if(!_0x42978b)return undefined;const _0x529090=0x64;if(_0x42978b[_0x1108a9(0x228)]<=_0x529090)return _0x42978b;return _0x42978b[_0x1108a9(0x223)](0x0,_0x529090)+_0x1108a9(0x1a3);}function a20_0x2f2a(_0x5805a9,_0x599bd1){const _0x347589=a20_0x3475();return a20_0x2f2a=function(_0x2f2a89,_0x4fcb57){_0x2f2a89=_0x2f2a89-0x1a2;let _0x116a54=_0x347589[_0x2f2a89];return _0x116a54;},a20_0x2f2a(_0x5805a9,_0x599bd1);}export class LLMModelsCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x205);[a20_0x5daf09(0x204)]=a20_0x5daf09(0x1c0);async[a20_0x5daf09(0x1af)](_0x3d2033){const _0x1d3f8a=a20_0x5daf09,{options:_0x5a1b18,tdx:_0x341339}=_0x3d2033;try{const _0x394101=await withSpinner('Fetching\x20available\x20models...',()=>_0x341339[_0x1d3f8a(0x240)][_0x1d3f8a(0x1aa)](),{'verbose':_0x5a1b18['verbose']});return await handleSDKOutput(_0x394101[_0x1d3f8a(0x20c)],_0x5a1b18),0x0;}catch(_0x563f0a){return handleSDKError(_0x563f0a,_0x5a1b18),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']='llm:projects';[a20_0x5daf09(0x204)]=a20_0x5daf09(0x1f2);async[a20_0x5daf09(0x1af)](_0x3a236d){const _0x4623f2=a20_0x5daf09,{options:_0x59b0c3,args:_0x4a4c7a,tdx:_0x24f20b}=_0x3a236d;try{const _0x30de94=_0x4a4c7a[0x0],_0x291b5a=resolveLimit(_0x59b0c3[_0x4623f2(0x212)],DEFAULT_LLM_LIMIT),_0x20484c=await withSpinner(_0x4623f2(0x241),()=>_0x24f20b[_0x4623f2(0x240)][_0x4623f2(0x1b1)](_0x291b5a),{'verbose':_0x59b0c3[_0x4623f2(0x1be)]});let _0x36bc15=_0x20484c['data'];_0x30de94&&(_0x36bc15=_0x20484c[_0x4623f2(0x20c)]['filter'](_0x5d6b50=>matchGlobPattern(_0x5d6b50[_0x4623f2(0x1d0)]['name'],_0x30de94)));const _0x49f38e=_0x36bc15[_0x4623f2(0x1cc)](toLLMProjectInfo);return await handleSDKOutput(_0x49f38e,_0x59b0c3),0x0;}catch(_0x45cdfd){return handleSDKError(_0x45cdfd,_0x59b0c3),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x239);[a20_0x5daf09(0x204)]=a20_0x5daf09(0x1d3);async[a20_0x5daf09(0x1af)](_0x50f3df){const _0x3c9c1f=a20_0x5daf09,{options:_0x5dabb0,args:_0x527000,tdx:_0x4e740d}=_0x50f3df;try{const _0x105d5b=_0x527000[0x0];let _0x594bdf,_0x4a49be=_0x105d5b;if(_0x105d5b&&_0x105d5b[_0x3c9c1f(0x254)]('/')){const _0x1207d0=_0x105d5b['split']('/');if(_0x1207d0[_0x3c9c1f(0x228)]===0x2){const [_0x32417c,_0xee2ac5]=_0x1207d0,_0x13a937=await _0x4e740d[_0x3c9c1f(0x240)][_0x3c9c1f(0x1b1)](),_0x12c29f=_0x13a937[_0x3c9c1f(0x1ef)](_0x3d5872=>_0x3d5872[_0x3c9c1f(0x1d0)]['name'][_0x3c9c1f(0x229)]()===_0x32417c[_0x3c9c1f(0x229)]());if(!_0x12c29f)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],_0x3c9c1f(0x1ea)+_0x32417c,undefined,{'helpText':_0x3c9c1f(0x224)});_0x594bdf=_0x12c29f['id'],_0x4a49be=_0xee2ac5;}else throw new SDKError(ErrorCode[_0x3c9c1f(0x1e2)],_0x3c9c1f(0x248)+_0x105d5b,undefined,{'helpText':_0x3c9c1f(0x1d6)});}else _0x594bdf=await getProjectIdOrDefault(_0x50f3df);const _0x47bde6=await withSpinner(_0x3c9c1f(0x246),()=>_0x4e740d[_0x3c9c1f(0x240)]['agents'](_0x594bdf),{'verbose':_0x5dabb0['verbose']});let _0x276368=_0x47bde6[_0x3c9c1f(0x20c)];_0x4a49be&&(_0x276368=_0x47bde6[_0x3c9c1f(0x20c)]['filter'](_0x1d07b9=>matchGlobPattern(_0x1d07b9[_0x3c9c1f(0x1d0)][_0x3c9c1f(0x200)],_0x4a49be)));const _0x2e05dc=_0x276368[_0x3c9c1f(0x1cc)](toAgentInfo);return await handleSDKOutput(_0x2e05dc,_0x5dabb0),0x0;}catch(_0x4aee61){return handleSDKError(_0x4aee61,_0x5dabb0),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x243);[a20_0x5daf09(0x204)]=a20_0x5daf09(0x1bc);async[a20_0x5daf09(0x1af)](_0x4106c5){const _0xb78c5c=a20_0x5daf09,{options:_0x58d099,args:_0xf47918,tdx:_0x201856}=_0x4106c5;if(_0xf47918[_0xb78c5c(0x228)]===0x0)return console[_0xb78c5c(0x23b)](_0xb78c5c(0x1fa)),console[_0xb78c5c(0x23b)](_0xb78c5c(0x238)),0x1;const _0x5e8264=_0xf47918[0x0];try{const _0xa0d867=await getProjectIdOrDefault(_0x4106c5),_0x147943=await withSpinner(_0xb78c5c(0x24b)+_0x5e8264+_0xb78c5c(0x1f3),()=>_0x201856[_0xb78c5c(0x240)][_0xb78c5c(0x1e1)](_0x5e8264,_0xa0d867),{'verbose':_0x58d099[_0xb78c5c(0x1be)]}),_0x312a05=await withSpinner(_0xb78c5c(0x1e9),()=>_0x201856['llm']['agent'](_0x147943[_0xb78c5c(0x20c)]),{'verbose':_0x58d099['verbose']});return await handleSDKOutput([_0x312a05[_0xb78c5c(0x20c)]],_0x58d099),0x0;}catch(_0x4e05a1){return handleSDKError(_0x4e05a1,_0x58d099),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x1db);[a20_0x5daf09(0x204)]=a20_0x5daf09(0x1b5);async[a20_0x5daf09(0x1af)](_0x4c7c78){const _0x4d0090=a20_0x5daf09,{options:_0x575158,args:_0x51c509,tdx:_0x516396}=_0x4c7c78;if(_0x51c509['length']===0x0)return console['error'](_0x4d0090(0x1fa)),console['error'](_0x4d0090(0x201)),console[_0x4d0090(0x23b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x29fdb3=_0x51c509[0x0],_0x2669fe=_0x575158,_0x1456c7=_0x2669fe[_0x4d0090(0x244)],_0x22dfad=_0x2669fe[_0x4d0090(0x1d9)]||_0x4d0090(0x1c3),_0x141b14=_0x2669fe['starterMessage'],_0x224d18=_0x2669fe[_0x4d0090(0x1e4)]?Number(_0x2669fe['maxToolIterations']):undefined,_0x709e59=_0x2669fe[_0x4d0090(0x252)]?Number(_0x2669fe[_0x4d0090(0x252)]):undefined;try{let _0x413ab1,_0x2b34bb;if(_0x29fdb3[_0x4d0090(0x254)]('/')){const _0x1c93c8=_0x29fdb3[_0x4d0090(0x1a2)]('/');if(_0x1c93c8[_0x4d0090(0x228)]===0x2){const [_0x2eaf4c,_0x40cf6d]=_0x1c93c8,_0x52e71a=await withSpinner('Resolving\x20project\x20\x27'+_0x2eaf4c+'\x27...',()=>_0x516396['llm'][_0x4d0090(0x1e0)](_0x2eaf4c),{'verbose':_0x575158['verbose']});_0x413ab1=_0x52e71a[_0x4d0090(0x20c)],_0x2b34bb=_0x40cf6d;}else throw new SDKError(ErrorCode[_0x4d0090(0x1e2)],_0x4d0090(0x248)+_0x29fdb3,undefined,{'helpText':_0x4d0090(0x1d6)});}else _0x413ab1=await getProjectIdOrDefault(_0x4c7c78),_0x2b34bb=_0x29fdb3;const _0x27594c=await withSpinner('Creating\x20agent\x20\x27'+_0x2b34bb+_0x4d0090(0x1f3),()=>_0x516396[_0x4d0090(0x240)][_0x4d0090(0x1b7)]({'name':_0x2b34bb,'projectId':_0x413ab1,'modelType':_0x22dfad,'systemPrompt':_0x1456c7,'starterMessage':_0x141b14,'maxToolIterations':_0x224d18,'temperature':_0x709e59}),{'verbose':_0x575158['verbose']});return console[_0x4d0090(0x22b)](_0x4d0090(0x21e)+_0x27594c[_0x4d0090(0x20c)]['id']),await handleSDKOutput([_0x27594c['data']],_0x575158),0x0;}catch(_0x5d2e2a){return handleSDKError(_0x5d2e2a,_0x575158),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x1ec);[a20_0x5daf09(0x204)]=a20_0x5daf09(0x1bd);async['execute'](_0x325de5){const _0x1a1bd7=a20_0x5daf09,{options:_0x2d6dc0,args:_0x2c0194,tdx:_0x19c41e}=_0x325de5;if(_0x2c0194[_0x1a1bd7(0x228)]===0x0)return console['error'](_0x1a1bd7(0x1fa)),console[_0x1a1bd7(0x23b)]('Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]'),0x1;const _0x1f2dd0=_0x2c0194[0x0],_0x599bd7=_0x2d6dc0,_0x5e65eb=_0x599bd7[_0x1a1bd7(0x200)],_0x268307=_0x599bd7[_0x1a1bd7(0x1eb)],_0x2891f3=_0x599bd7[_0x1a1bd7(0x204)],_0x2cb03a=_0x599bd7[_0x1a1bd7(0x1f8)];if(!_0x5e65eb&&!_0x268307&&!_0x2891f3&&!_0x2cb03a)return console[_0x1a1bd7(0x23b)](_0x1a1bd7(0x1e6)),console[_0x1a1bd7(0x23b)](_0x1a1bd7(0x1c8)),0x1;try{const _0x5d4214=await getProjectIdOrDefault(_0x325de5),_0x3756e9=await withSpinner(_0x1a1bd7(0x24b)+_0x1f2dd0+_0x1a1bd7(0x1f3),()=>_0x19c41e[_0x1a1bd7(0x240)][_0x1a1bd7(0x1e1)](_0x1f2dd0,_0x5d4214),{'verbose':_0x2d6dc0[_0x1a1bd7(0x1be)]}),_0x4e1a76=_0x3756e9[_0x1a1bd7(0x20c)],_0x31eade=await withSpinner(_0x1a1bd7(0x213),()=>_0x19c41e[_0x1a1bd7(0x240)]['updateAgent'](_0x4e1a76,{'name':_0x5e65eb,'prompt':_0x268307,'description':_0x2891f3,'starterMessage':_0x2cb03a}),{'verbose':_0x2d6dc0['verbose']});return console['log']('Agent\x20updated:\x20'+_0x31eade['data']['id']),await handleSDKOutput([_0x31eade[_0x1a1bd7(0x20c)]],_0x2d6dc0),0x0;}catch(_0x474ce6){return handleSDKError(_0x474ce6,_0x2d6dc0),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x1a5);['description']=a20_0x5daf09(0x1c1);async['execute'](_0x3ccc6f){const _0x252035=a20_0x5daf09,{options:_0x4f7ab2,args:_0x426a30,tdx:_0xbdbaa5}=_0x3ccc6f;if(_0x426a30[_0x252035(0x228)]===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0x252035(0x23b)](_0x252035(0x1a6)),0x1;const _0x414209=_0x426a30[0x0];try{const _0x856c92=await getProjectIdOrDefault(_0x3ccc6f),_0x4af7bf=await withSpinner('Resolving\x20agent\x20\x27'+_0x414209+'\x27...',()=>_0xbdbaa5[_0x252035(0x240)]['resolveAgentId'](_0x414209,_0x856c92),{'verbose':_0x4f7ab2[_0x252035(0x1be)]}),_0x3d32d5=_0x4af7bf[_0x252035(0x20c)];return await withSpinner(_0x252035(0x236),()=>_0xbdbaa5[_0x252035(0x240)]['deleteAgent'](_0x3d32d5),{'verbose':_0x4f7ab2[_0x252035(0x1be)]}),console[_0x252035(0x22b)](_0x252035(0x20b)+_0x3d32d5),0x0;}catch(_0x4614ae){return handleSDKError(_0x4614ae,_0x4f7ab2),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a20_0x5daf09(0x200)]='llm:history';['description']=a20_0x5daf09(0x1ab);async[a20_0x5daf09(0x1af)](_0x48ebdb){const _0x3492a1=a20_0x5daf09,{options:_0x418645,args:_0x375eee,tdx:_0x495961}=_0x48ebdb;let _0x182962=_0x375eee[0x0];const _0x2e368e=_0x418645,_0x4d8608=_0x2e368e[_0x3492a1(0x1a8)];try{if(_0x4d8608){if(_0x182962)return console['error'](_0x3492a1(0x1a4)),console[_0x3492a1(0x23b)](_0x3492a1(0x22e)),0x1;const _0x30a7f8=await withSpinner(_0x3492a1(0x202),()=>_0x495961[_0x3492a1(0x240)][_0x3492a1(0x1fe)](0x1),{'verbose':_0x418645[_0x3492a1(0x1be)]});if(_0x30a7f8[_0x3492a1(0x20c)][_0x3492a1(0x228)]===0x0)return console[_0x3492a1(0x22b)](_0x3492a1(0x220)),0x0;_0x182962=_0x30a7f8[_0x3492a1(0x20c)][0x0]['id'];}if(!_0x182962){const _0x4053b5=resolveLimit(_0x418645[_0x3492a1(0x212)],DEFAULT_LLM_LIMIT),_0x2013f2=await withSpinner(_0x3492a1(0x1e8),()=>_0x495961[_0x3492a1(0x240)][_0x3492a1(0x1fe)](_0x4053b5),{'verbose':_0x418645[_0x3492a1(0x1be)]});if(_0x418645[_0x3492a1(0x234)]===_0x3492a1(0x232)||_0x418645[_0x3492a1(0x234)]===_0x3492a1(0x214))await handleSDKOutput(_0x2013f2[_0x3492a1(0x20c)],_0x418645);else{const _0x16fc75=_0x2013f2[_0x3492a1(0x20c)]['map'](_0x100fa3=>({'created_at':_0x100fa3[_0x3492a1(0x1d0)]['createdAt'],'chat_id':_0x100fa3['id'],'first_input':_0x100fa3[_0x3492a1(0x1d0)][_0x3492a1(0x1f0)]||_0x3492a1(0x1ae)}));await handleSDKOutput(_0x16fc75,_0x418645);}return 0x0;}else{const _0x5c004d=await withSpinner(_0x3492a1(0x253)+_0x182962+_0x3492a1(0x1f3),()=>_0x495961[_0x3492a1(0x240)]['history'](_0x182962),{'verbose':_0x418645[_0x3492a1(0x1be)]}),_0x176bf0=_0x5c004d[_0x3492a1(0x20c)]['data']??[];if(_0x176bf0[_0x3492a1(0x228)]===0x0)return console[_0x3492a1(0x22b)]('No\x20messages\x20found\x20in\x20chat\x20history.'),0x0;if(_0x418645[_0x3492a1(0x234)]===_0x3492a1(0x232)||_0x418645[_0x3492a1(0x234)]===_0x3492a1(0x214)||_0x418645[_0x3492a1(0x234)]===_0x3492a1(0x1ce)||_0x418645[_0x3492a1(0x234)]===_0x3492a1(0x20f))await handleSDKOutput(_0x176bf0,_0x418645);else for(const _0x4a61a1 of _0x176bf0){console[_0x3492a1(0x22b)](formatChatHistoryEntry(_0x4a61a1,_0x418645));}return 0x0;}}catch(_0x5780bb){return handleSDKError(_0x5780bb,_0x418645),0x1;}}}export class LLMUseCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x1e5);[a20_0x5daf09(0x204)]=a20_0x5daf09(0x1f5);async[a20_0x5daf09(0x1af)](_0x5d130d){const _0x1faa45=a20_0x5daf09,{options:_0x475955,args:_0x57850a,tdx:_0x1328c2}=_0x5d130d;if(_0x57850a[_0x1faa45(0x228)]===0x0)return console['error'](_0x1faa45(0x215)),console[_0x1faa45(0x23b)](_0x1faa45(0x21f)),0x1;const _0x47df0b=_0x57850a[0x0];try{return await withSpinner(_0x1faa45(0x24a)+_0x47df0b+_0x1faa45(0x1f3),()=>_0x1328c2[_0x1faa45(0x240)][_0x1faa45(0x203)](_0x47df0b),{'verbose':_0x475955[_0x1faa45(0x1be)]}),console[_0x1faa45(0x22b)](_0x1faa45(0x237)+_0x47df0b),0x0;}catch(_0x4391df){return handleSDKError(_0x4391df,_0x475955),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x225);[a20_0x5daf09(0x204)]='Create\x20a\x20new\x20LLM\x20project';async[a20_0x5daf09(0x1af)](_0x17525f){const _0x490861=a20_0x5daf09,{options:_0x3dd949,args:_0x427f8d,tdx:_0x86d0}=_0x17525f;if(_0x427f8d['length']===0x0)return console[_0x490861(0x23b)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x490861(0x23b)](_0x490861(0x1c6)),0x1;const _0x535612=_0x427f8d[0x0],_0x304e9a=_0x3dd949,_0xde30ab=_0x304e9a['description'];try{const _0x3fe02d=await withSpinner(_0x490861(0x1b9)+_0x535612+_0x490861(0x1f3),()=>_0x86d0[_0x490861(0x240)]['createProject']({'name':_0x535612,'description':_0xde30ab}),{'verbose':_0x3dd949[_0x490861(0x1be)]});console[_0x490861(0x22b)](_0x490861(0x207)+_0x3fe02d['data']['id']);const _0x96e974=toLLMProjectInfo(_0x3fe02d[_0x490861(0x20c)]);return await handleSDKOutput([_0x96e974],_0x3dd949),0x0;}catch(_0x42050a){return handleSDKError(_0x42050a,_0x3dd949),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x5daf09(0x200)]='llm:project:delete';[a20_0x5daf09(0x204)]=a20_0x5daf09(0x23a);async['execute'](_0x2e6d04){const _0x4f00c1=a20_0x5daf09,{options:_0x438ef7,args:_0x2b58b8,tdx:_0x176255}=_0x2e6d04;if(_0x2b58b8[_0x4f00c1(0x228)]===0x0)return console['error'](_0x4f00c1(0x215)),console[_0x4f00c1(0x23b)](_0x4f00c1(0x1e7)),0x1;const _0x373c79=_0x2b58b8[0x0];try{return await withSpinner(_0x4f00c1(0x221)+_0x373c79+_0x4f00c1(0x1f3),()=>_0x176255['llm']['deleteProject'](_0x373c79),{'verbose':_0x438ef7['verbose']}),console[_0x4f00c1(0x22b)](_0x4f00c1(0x1ac)+_0x373c79),0x0;}catch(_0x145eec){return handleSDKError(_0x145eec,_0x438ef7),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x242);[a20_0x5daf09(0x204)]=a20_0x5daf09(0x1f6);async['execute'](_0x20bef5){const _0x5e1a46=a20_0x5daf09,{options:_0x4346bd,args:_0xf27cba,tdx:_0x5f5ddd}=_0x20bef5;if(_0xf27cba[_0x5e1a46(0x228)]===0x0)return console[_0x5e1a46(0x23b)](_0x5e1a46(0x215)),console[_0x5e1a46(0x23b)]('Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]'),0x1;const _0x31c051=_0xf27cba[0x0],_0x505dff=_0x4346bd,_0x547d5c=_0x505dff[_0x5e1a46(0x24e)],_0x3b61d7=_0x505dff[_0x5e1a46(0x22f)];try{const _0x4c6089=_0x547d5c||_0x31c051+_0x5e1a46(0x251);if(a20_0x7d7ebf['existsSync'](_0x4c6089)&&!_0x3b61d7){if(!_0x4346bd[_0x5e1a46(0x1b6)]){const _0x2b86ea=await confirm(_0x5e1a46(0x1ca)+_0x4c6089+_0x5e1a46(0x21c));if(!_0x2b86ea)return console[_0x5e1a46(0x22b)](_0x5e1a46(0x218)),0x0;}a20_0x7d7ebf[_0x5e1a46(0x211)](_0x4c6089,{'recursive':!![]});}const _0x51877f=await withSpinner(_0x3b61d7?'Analyzing\x20project\x20\x27'+_0x31c051+_0x5e1a46(0x1f3):'Backing\x20up\x20project\x20\x27'+_0x31c051+_0x5e1a46(0x1f3),()=>_0x5f5ddd['llm'][_0x5e1a46(0x1d1)](_0x31c051,_0x547d5c,{'dryRun':_0x3b61d7}),{'verbose':_0x4346bd[_0x5e1a46(0x1be)]}),_0x42abd5=_0x51877f[_0x5e1a46(0x20c)];return _0x3b61d7?console[_0x5e1a46(0x22b)](_0x5e1a46(0x23d)+_0x42abd5[_0x5e1a46(0x24c)]):console[_0x5e1a46(0x22b)](_0x5e1a46(0x1cb)+_0x42abd5['outputDir']),console[_0x5e1a46(0x22b)]('\x20\x20Agents:\x20'+_0x42abd5['counts']['agents']),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x42abd5[_0x5e1a46(0x222)][_0x5e1a46(0x1da)]),console[_0x5e1a46(0x22b)]('\x20\x20Prompts:\x20'+_0x42abd5['counts'][_0x5e1a46(0x227)]),console[_0x5e1a46(0x22b)](_0x5e1a46(0x1a7)+_0x42abd5['counts']['integrations']),(_0x4346bd['format']===_0x5e1a46(0x232)||_0x4346bd['format']===_0x5e1a46(0x214))&&await handleSDKOutput([_0x42abd5],_0x4346bd),0x0;}catch(_0x3de813){return handleSDKError(_0x3de813,_0x4346bd),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x5daf09(0x200)]=a20_0x5daf09(0x1ba);[a20_0x5daf09(0x204)]=a20_0x5daf09(0x1f9);async[a20_0x5daf09(0x1af)](_0x2ff8a7){const _0x111da5=a20_0x5daf09,{options:_0x3a9a7a,args:_0x564a6b,tdx:_0x5a03e2}=_0x2ff8a7;if(_0x564a6b[_0x111da5(0x228)]===0x0)return console[_0x111da5(0x23b)](_0x111da5(0x1c5)),console[_0x111da5(0x23b)](_0x111da5(0x233)),0x1;const _0x25766f=_0x564a6b[0x0],_0x1c0ce1=_0x3a9a7a,_0xc346c1=_0x1c0ce1[_0x111da5(0x200)],_0x3f1b2e=_0x1c0ce1[_0x111da5(0x22f)];try{if(!_0x3f1b2e){const _0x1ce729=_0x5a03e2[_0x111da5(0x240)][_0x111da5(0x206)](_0x25766f),_0x1674c9=_0xc346c1||_0x1ce729[_0x111da5(0x1cd)]['projectName'],_0x2ac0a3=await withSpinner(_0x111da5(0x22a),()=>_0x5a03e2[_0x111da5(0x240)][_0x111da5(0x1b1)](),{'verbose':_0x3a9a7a[_0x111da5(0x1be)]}),_0x5957ce=_0x2ac0a3[_0x111da5(0x20c)]['find'](_0x571549=>_0x571549['attributes'][_0x111da5(0x200)]===_0x1674c9);if(_0x5957ce&&!_0x3a9a7a['yes']){const _0x11b4e6=await confirm(_0x111da5(0x24d)+_0x1674c9+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x11b4e6)return console[_0x111da5(0x22b)](_0x111da5(0x247)),0x0;}}const _0xc7260f=await withSpinner(_0x3f1b2e?_0x111da5(0x1c2)+_0x25766f+'\x27...':'Restoring\x20project\x20from\x20\x27'+_0x25766f+_0x111da5(0x1f3),()=>_0x5a03e2[_0x111da5(0x240)][_0x111da5(0x210)](_0x25766f,{'name':_0xc346c1,'dryRun':_0x3f1b2e}),{'verbose':_0x3a9a7a['verbose']}),_0x18f130=_0xc7260f[_0x111da5(0x20c)];return _0x18f130[_0x111da5(0x1dc)]&&console[_0x111da5(0x22b)](_0x111da5(0x22c)+_0x18f130['sourceSite']+'\x27'),_0x3f1b2e?console[_0x111da5(0x22b)](_0x111da5(0x1f7)+_0x18f130[_0x111da5(0x1b2)]):console['log'](_0x111da5(0x1c7)+_0x18f130[_0x111da5(0x1b2)]+'\x20('+_0x18f130['projectId']+')'),console['log']('\x20\x20Agents:\x20'+_0x18f130[_0x111da5(0x222)]['agents']),console[_0x111da5(0x22b)](_0x111da5(0x1bf)+_0x18f130[_0x111da5(0x222)]['knowledgeBases']),console[_0x111da5(0x22b)](_0x111da5(0x249)+_0x18f130['counts'][_0x111da5(0x227)]),console[_0x111da5(0x22b)](_0x111da5(0x1a7)+_0x18f130[_0x111da5(0x222)]['integrations']),(_0x3a9a7a['format']===_0x111da5(0x232)||_0x3a9a7a['format']===_0x111da5(0x214))&&await handleSDKOutput([_0x18f130],_0x3a9a7a),0x0;}catch(_0x2cbc26){return handleSDKError(_0x2cbc26,_0x3a9a7a),0x1;}}}
|
|
1
|
+
const a20_0x4eec83=a20_0xaacb;(function(_0xdffd2a,_0x2d16bf){const _0x451468=a20_0xaacb,_0x40db8d=_0xdffd2a();while(!![]){try{const _0x431f7a=-parseInt(_0x451468(0x267))/0x1*(-parseInt(_0x451468(0x1c4))/0x2)+parseInt(_0x451468(0x1f0))/0x3*(parseInt(_0x451468(0x1f6))/0x4)+-parseInt(_0x451468(0x1be))/0x5+parseInt(_0x451468(0x21d))/0x6+parseInt(_0x451468(0x214))/0x7+parseInt(_0x451468(0x222))/0x8*(-parseInt(_0x451468(0x208))/0x9)+-parseInt(_0x451468(0x257))/0xa*(parseInt(_0x451468(0x1fb))/0xb);if(_0x431f7a===_0x2d16bf)break;else _0x40db8d['push'](_0x40db8d['shift']());}catch(_0x16356a){_0x40db8d['push'](_0x40db8d['shift']());}}}(a20_0x4d65,0xc7fda));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';import{confirm}from'../utils/prompt.js';import*as a20_0x1edd83 from'node:fs';function handleSDKError(_0x2b201f,_0x4aa573){const _0x4521f0=a20_0xaacb;if(_0x2b201f instanceof SDKError)console[_0x4521f0(0x231)](_0x4521f0(0x24a)+_0x2b201f['message']),_0x4aa573[_0x4521f0(0x20e)]&&(_0x2b201f['cause']&&console['error'](_0x4521f0(0x217)+_0x2b201f['cause']),_0x2b201f[_0x4521f0(0x1c8)]&&(console['error'](_0x4521f0(0x274)),console[_0x4521f0(0x231)](_0x2b201f[_0x4521f0(0x1c8)])));else throw _0x2b201f;}function formatChatHistoryEntry(_0x21b1f5,_0x10af5d){const _0x28a22d=a20_0xaacb,_0x24ff21=getChalk(_0x10af5d),_0x2b099e=_0x24ff21['dim'](_0x21b1f5['at']);if(_0x28a22d(0x215)in _0x21b1f5){const _0x16d417=_0x24ff21[_0x28a22d(0x1c3)](_0x28a22d(0x212));return _0x2b099e+'\x20'+_0x16d417+':\x20'+_0x21b1f5[_0x28a22d(0x215)];}if(_0x28a22d(0x21f)in _0x21b1f5){const _0x33a80c=_0x24ff21[_0x28a22d(0x254)](_0x28a22d(0x1de));return _0x2b099e+'\x20'+_0x33a80c+':\x20'+_0x21b1f5[_0x28a22d(0x21f)];}if(_0x28a22d(0x1df)in _0x21b1f5){const _0x2ec93a=_0x24ff21[_0x28a22d(0x22d)]('[tool_call]'),{functionName:_0x18557a,functionArguments:_0x357a5d,targetFunction:_0x5ca226}=_0x21b1f5[_0x28a22d(0x1df)];let _0x16daff=_0x2b099e+'\x20'+_0x2ec93a+':\x20'+_0x24ff21[_0x28a22d(0x22f)](_0x18557a);if(_0x357a5d&&Object[_0x28a22d(0x219)](_0x357a5d)[_0x28a22d(0x233)]>0x0){const _0x309558=Object[_0x28a22d(0x229)](_0x357a5d)[_0x28a22d(0x1bf)](([_0x2a31c3,_0x157d63])=>_0x2a31c3+'='+JSON['stringify'](_0x157d63))[_0x28a22d(0x24d)](',\x20');_0x16daff+='('+_0x309558+')';}_0x5ca226&&(_0x16daff+=_0x24ff21[_0x28a22d(0x1ec)]('\x20['+_0x5ca226+']'));let _0x531a04='';if(_0x21b1f5[_0x28a22d(0x1df)]['targetKnowledgeBase'])_0x531a04=_0x28a22d(0x240)+_0x21b1f5[_0x28a22d(0x1df)][_0x28a22d(0x23e)][_0x28a22d(0x1ed)];else{if(_0x21b1f5[_0x28a22d(0x1df)]['targetAgent'])_0x531a04='\x20->\x20Agent:'+_0x21b1f5['tool_call'][_0x28a22d(0x25f)][_0x28a22d(0x1ed)];else{if(_0x21b1f5[_0x28a22d(0x1df)][_0x28a22d(0x1ca)])_0x531a04=_0x28a22d(0x244)+_0x21b1f5[_0x28a22d(0x1df)][_0x28a22d(0x1ca)]['name'];else _0x21b1f5['tool_call'][_0x28a22d(0x1ea)]&&(_0x531a04=_0x28a22d(0x23d)+_0x21b1f5[_0x28a22d(0x1df)][_0x28a22d(0x1ea)][_0x28a22d(0x1ed)]);}}return _0x16daff+_0x531a04;}if('tool'in _0x21b1f5){const _0x2406a2=_0x24ff21[_0x28a22d(0x22e)](_0x28a22d(0x245)),{functionName:_0x11ff4d,functionArguments:_0x5d776b,content:_0x9f175b,newChat:_0x1e5d6d}=_0x21b1f5[_0x28a22d(0x255)];let _0x59ad72=_0x2b099e+'\x20'+_0x2406a2+':\x20'+_0x24ff21[_0x28a22d(0x22f)](_0x11ff4d);if(_0x5d776b){const _0x4574e6=typeof _0x5d776b===_0x28a22d(0x1e3)?_0x5d776b:JSON['stringify'](_0x5d776b);_0x59ad72+='('+_0x4574e6+')';}return _0x9f175b&&(_0x59ad72+='\x0a'+_0x24ff21[_0x28a22d(0x1ec)](_0x9f175b)),_0x1e5d6d&&(_0x59ad72+=_0x24ff21['dim'](_0x28a22d(0x23a)+_0x1e5d6d['id'])),_0x59ad72;}if('output'in _0x21b1f5){const _0x956149=_0x24ff21['blue'](_0x28a22d(0x1dd));return _0x2b099e+'\x20'+_0x956149+':\x20'+_0x21b1f5[_0x28a22d(0x1bc)]['name']+'\x20('+_0x21b1f5[_0x28a22d(0x1bc)][_0x28a22d(0x21f)][_0x28a22d(0x233)]+'\x20bytes)';}if(_0x28a22d(0x1c6)in _0x21b1f5){const _0x1084e9=_0x24ff21['blue'](_0x28a22d(0x1b8)),{width:_0x2bba26,height:_0x4b5aec,headerText:_0x21a044}=_0x21b1f5[_0x28a22d(0x1c6)],_0x462da0=_0x21a044?_0x28a22d(0x1f1)+_0x21a044:'';return _0x2b099e+'\x20'+_0x1084e9+':\x20'+_0x2bba26+'x'+_0x4b5aec+_0x462da0;}if(_0x28a22d(0x231)in _0x21b1f5){const _0x2c8172=_0x24ff21[_0x28a22d(0x21c)](_0x28a22d(0x1f8));return _0x2b099e+'\x20'+_0x2c8172+':\x20'+_0x21b1f5['error'];}return _0x2b099e+'\x20'+_0x24ff21[_0x28a22d(0x1ec)](_0x28a22d(0x1e6))+':\x20'+JSON[_0x28a22d(0x270)](_0x21b1f5);}async function getProjectIdOrDefault(_0x16dcc8){const _0x5d7f27=a20_0xaacb,{tdx:_0x5a96cf,options:_0x1abb93}=_0x16dcc8,_0x604f0a=_0x1abb93[_0x5d7f27(0x1f3)];if(_0x604f0a){const _0x2400a6=await withSpinner('Resolving\x20project\x20\x27'+_0x604f0a+_0x5d7f27(0x26d),()=>_0x5a96cf[_0x5d7f27(0x25b)][_0x5d7f27(0x1bd)](_0x604f0a),{'verbose':_0x1abb93[_0x5d7f27(0x20e)]});return _0x2400a6[_0x5d7f27(0x265)];}let _0x3fd91d=_0x5a96cf[_0x5d7f27(0x25b)][_0x5d7f27(0x202)]();if(_0x3fd91d)return _0x3fd91d;const _0x25bc3f=await withSpinner(_0x5d7f27(0x210),()=>_0x5a96cf[_0x5d7f27(0x25b)][_0x5d7f27(0x26e)](),{'verbose':_0x1abb93[_0x5d7f27(0x20e)]});return _0x25bc3f[_0x5d7f27(0x265)]['id'];}function toLLMProjectInfo(_0x2d6a51){const _0x1c6b94=a20_0xaacb;return{'name':_0x2d6a51[_0x1c6b94(0x1e2)]['name'],'description':_0x2d6a51[_0x1c6b94(0x1e2)][_0x1c6b94(0x268)],'createdAt':_0x2d6a51[_0x1c6b94(0x1e2)]['createdAt'],'updatedAt':_0x2d6a51[_0x1c6b94(0x1e2)][_0x1c6b94(0x271)]};}function toAgentInfo(_0x268b21){const _0x513c64=a20_0xaacb;return{'name':_0x268b21[_0x513c64(0x1e2)][_0x513c64(0x1ed)],'description':_0x268b21[_0x513c64(0x1e2)]['description'],'prompt':truncatePrompt(_0x268b21[_0x513c64(0x1e2)]['prompt']),'createdAt':_0x268b21[_0x513c64(0x1e2)][_0x513c64(0x273)],'updatedAt':_0x268b21['attributes'][_0x513c64(0x271)]};}function truncatePrompt(_0x312e44){const _0x59980b=a20_0xaacb;if(!_0x312e44)return undefined;const _0xc933a6=0x64;if(_0x312e44[_0x59980b(0x233)]<=_0xc933a6)return _0x312e44;return _0x312e44[_0x59980b(0x23c)](0x0,_0xc933a6)+_0x59980b(0x21a);}export class LLMModelsCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]=a20_0x4eec83(0x1dc);[a20_0x4eec83(0x268)]=a20_0x4eec83(0x226);async[a20_0x4eec83(0x1cf)](_0x1952a7){const _0x56af45=a20_0x4eec83,{options:_0xad82e2,tdx:_0x2e2d1d}=_0x1952a7;try{const _0x14f94c=await withSpinner(_0x56af45(0x204),()=>_0x2e2d1d[_0x56af45(0x25b)][_0x56af45(0x225)](),{'verbose':_0xad82e2[_0x56af45(0x20e)]});return await handleSDKOutput(_0x14f94c[_0x56af45(0x265)],_0xad82e2),0x0;}catch(_0x1a3b31){return handleSDKError(_0x1a3b31,_0xad82e2),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']='llm:projects';[a20_0x4eec83(0x268)]='List\x20all\x20LLM\x20projects';async[a20_0x4eec83(0x1cf)](_0x43c8a9){const _0x8ff536=a20_0x4eec83,{options:_0x1c043b,args:_0x3dd847,tdx:_0x5679a2}=_0x43c8a9;try{const _0x270f0e=_0x3dd847[0x0],_0x1fc972=resolveLimit(_0x1c043b[_0x8ff536(0x1e4)],DEFAULT_LLM_LIMIT),_0x9d2be9=await withSpinner(_0x8ff536(0x1e8),()=>_0x5679a2[_0x8ff536(0x25b)][_0x8ff536(0x1cd)](_0x1fc972),{'verbose':_0x1c043b['verbose']});let _0x5a10eb=_0x9d2be9[_0x8ff536(0x265)];_0x270f0e&&(_0x5a10eb=_0x9d2be9[_0x8ff536(0x265)][_0x8ff536(0x258)](_0x1b57ad=>matchGlobPattern(_0x1b57ad[_0x8ff536(0x1e2)][_0x8ff536(0x1ed)],_0x270f0e)));const _0x28c108=_0x5a10eb[_0x8ff536(0x1bf)](toLLMProjectInfo);return await handleSDKOutput(_0x28c108,_0x1c043b),0x0;}catch(_0x3ffdd2){return handleSDKError(_0x3ffdd2,_0x1c043b),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]=a20_0x4eec83(0x224);['description']=a20_0x4eec83(0x1c2);async['execute'](_0x329b87){const _0xfb4944=a20_0x4eec83,{options:_0x25b007,args:_0x5acf22,tdx:_0x125f7b}=_0x329b87;try{const _0x36c20f=_0x5acf22[0x0];let _0x58b2ea,_0x1e63e5=_0x36c20f;if(_0x36c20f&&_0x36c20f[_0xfb4944(0x227)]('/')){const _0x4e99f6=_0x36c20f[_0xfb4944(0x1f4)]('/');if(_0x4e99f6[_0xfb4944(0x233)]===0x2){const [_0x40f385,_0x189e7f]=_0x4e99f6,_0x2890b9=await _0x125f7b[_0xfb4944(0x25b)][_0xfb4944(0x1cd)](),_0x429b62=_0x2890b9[_0xfb4944(0x232)](_0x5d774b=>_0x5d774b[_0xfb4944(0x1e2)][_0xfb4944(0x1ed)]['toLowerCase']()===_0x40f385[_0xfb4944(0x1fa)]());if(!_0x429b62)throw new SDKError(ErrorCode[_0xfb4944(0x248)],_0xfb4944(0x201)+_0x40f385,undefined,{'helpText':_0xfb4944(0x1f9)});_0x58b2ea=_0x429b62['id'],_0x1e63e5=_0x189e7f;}else throw new SDKError(ErrorCode[_0xfb4944(0x205)],'Invalid\x20path\x20syntax:\x20'+_0x36c20f,undefined,{'helpText':_0xfb4944(0x276)});}else _0x58b2ea=await getProjectIdOrDefault(_0x329b87);const _0x53cc92=await withSpinner(_0xfb4944(0x1ef),()=>_0x125f7b[_0xfb4944(0x25b)][_0xfb4944(0x20f)](_0x58b2ea),{'verbose':_0x25b007[_0xfb4944(0x20e)]});let _0x171397=_0x53cc92['data'];_0x1e63e5&&(_0x171397=_0x53cc92[_0xfb4944(0x265)]['filter'](_0x5db4be=>matchGlobPattern(_0x5db4be[_0xfb4944(0x1e2)][_0xfb4944(0x1ed)],_0x1e63e5)));const _0x32818a=_0x171397['map'](toAgentInfo);return await handleSDKOutput(_0x32818a,_0x25b007),0x0;}catch(_0x31f0de){return handleSDKError(_0x31f0de,_0x25b007),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]='llm:agent:show';[a20_0x4eec83(0x268)]='Show\x20agent\x20details';async[a20_0x4eec83(0x1cf)](_0x925b5c){const _0xbf2f32=a20_0x4eec83,{options:_0x4064f4,args:_0xba0b28,tdx:_0x4d138e}=_0x925b5c;if(_0xba0b28[_0xbf2f32(0x233)]===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0xbf2f32(0x231)](_0xbf2f32(0x249)),0x1;const _0x47e576=_0xba0b28[0x0];try{const _0x5a3e39=await getProjectIdOrDefault(_0x925b5c),_0x3379dd=await withSpinner('Resolving\x20agent\x20\x27'+_0x47e576+_0xbf2f32(0x26d),()=>_0x4d138e[_0xbf2f32(0x25b)][_0xbf2f32(0x24e)](_0x47e576,_0x5a3e39),{'verbose':_0x4064f4[_0xbf2f32(0x20e)]}),_0x2bc570=await withSpinner(_0xbf2f32(0x269),()=>_0x4d138e[_0xbf2f32(0x25b)][_0xbf2f32(0x1d0)](_0x3379dd['data']),{'verbose':_0x4064f4[_0xbf2f32(0x20e)]});return await handleSDKOutput([_0x2bc570[_0xbf2f32(0x265)]],_0x4064f4),0x0;}catch(_0x4dbc7e){return handleSDKError(_0x4dbc7e,_0x4064f4),0x1;}}}function a20_0x4d65(){const _0xcb0e2b=['getCurrentProject','Project\x20restored:\x20','Fetching\x20available\x20models...','INVALID_ARGUMENT','Validating\x20backup\x20from\x20\x27','json','18sElLZx','llm:agent:delete','Deleting\x20agent...','updateAgent','Create\x20a\x20new\x20LLM\x20project','getBackupMetadata','verbose','agents','Getting\x20default\x20project...','Project\x20context\x20set\x20to:\x20','[input]\x20\x20','rmSync','7836423waWLnh','input','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','\x20\x20Cause:\x20','Checking\x20for\x20existing\x20projects...','keys','...','Agent\x20deleted:\x20','red','644334veGaCv','Output\x20directory\x20\x27','content','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','2438312gFqqMp','Usage:\x20tdx\x20llm\x20history\x20--last','llm:agents','models','List\x20available\x20LLM\x20models','includes','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','entries','integrations','Creating\x20agent\x20\x27','log','yellow','magenta','bold','.llm','error','find','length','llm:project:backup','Error:\x20Backup\x20folder\x20path\x20is\x20required','Fetching\x20chat\x20history\x20for\x20\x27','Backup\x20cancelled.','tsv','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','\x20→\x20chat:\x20','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','slice','\x20->\x20ImageGen:','targetKnowledgeBase','temperature','\x20->\x20KB:','Set\x20current\x20project\x20context','llm:agent:update','setCurrentProject','\x20->\x20WebSearch:','[tool]\x20\x20\x20','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','starterMessage','LLM_PROJECT_NOT_FOUND','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Error:\x20','outputDir','A\x20project\x20named\x20\x27','join','resolveAgentId','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','deleteAgent','Project\x20backed\x20up\x20to:\x20','format','green','tool','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','238090TqZVZV','filter','counts','createProject','llm','Agent\x20updated:\x20','Fetching\x20most\x20recent\x20chat...','Analyzing\x20project\x20\x27','targetAgent','\x20\x20Agents:\x20','No\x20messages\x20found\x20in\x20chat\x20history.','table','dryRun','llm:history','data','Error:\x20Agent\x20name\x20is\x20required','138078NijgFm','description','Fetching\x20agent...','Usage:\x20tdx\x20llm\x20use\x20<project-name>','\x20\x20Integrations:\x20','Backing\x20up\x20project\x20\x27','\x27...','getOrCreateDefaultProject','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','stringify','updatedAt','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder','createdAt','\x0aStack\x20trace:','Restoring\x20project\x20from\x20\x27','Use\x20format:\x20project-name/agent-name','[image]\x20\x20','yes','Project\x20deleted:\x20','deleteProject','output','resolveProjectId','7687565SJWjoT','map','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','List\x20agents\x20in\x20current\x20project','cyan','16ooHZuf','Project\x20created:\x20','image','Delete\x20an\x20LLM\x20project','stack','projectName','targetWebSearchTool','prompts','projectId','projects','maxToolIterations','execute','agent','Delete\x20an\x20agent','existsSync','chats','claude-4.5-haiku','llm:project:delete','Resolving\x20agent\x20\x27','systemPrompt','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','(no\x20message)','Agent\x20created:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','llm:models','[output]\x20','[content]','tool_call','Error:\x20Project\x20name\x20is\x20required','\x20\x20Knowledge\x20Bases:\x20','attributes','string','limit','Restore\x20cancelled.','[unknown]','createAgent','Fetching\x20projects...','Setting\x20project\x20context\x20to\x20\x27','targetImageGenerator','exportedFrom','dim','name','llm:use','Fetching\x20agents...','6PjvfhS','\x20-\x20','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','llmProject','split','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','1698064VzqCLN','Creating\x20project\x20\x27','[error]\x20\x20','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','toLowerCase','99HhDDGV','jsonl','history','knowledgeBases','model','restoreProject','Project\x20not\x20found:\x20'];a20_0x4d65=function(){return _0xcb0e2b;};return a20_0x4d65();}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]='llm:agent:create';['description']='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a20_0x4eec83(0x1cf)](_0x297c56){const _0x3047c8=a20_0x4eec83,{options:_0x5d1539,args:_0x37bf48,tdx:_0x9857ee}=_0x297c56;if(_0x37bf48['length']===0x0)return console[_0x3047c8(0x231)](_0x3047c8(0x266)),console[_0x3047c8(0x231)](_0x3047c8(0x24f)),console[_0x3047c8(0x231)](_0x3047c8(0x1db)),0x1;const _0x21e14c=_0x37bf48[0x0],_0x873fca=_0x5d1539,_0x441a8d=_0x873fca[_0x3047c8(0x1d7)],_0x165b5f=_0x873fca[_0x3047c8(0x1ff)]||_0x3047c8(0x1d4),_0x3d2c03=_0x873fca[_0x3047c8(0x247)],_0x5e1325=_0x873fca['maxToolIterations']?Number(_0x873fca[_0x3047c8(0x1ce)]):undefined,_0x3dfba8=_0x873fca[_0x3047c8(0x23f)]?Number(_0x873fca[_0x3047c8(0x23f)]):undefined;try{let _0x50f160,_0x4c2747;if(_0x21e14c[_0x3047c8(0x227)]('/')){const _0x4cfe82=_0x21e14c[_0x3047c8(0x1f4)]('/');if(_0x4cfe82['length']===0x2){const [_0x5374f4,_0x3e38b6]=_0x4cfe82,_0x19c37d=await withSpinner('Resolving\x20project\x20\x27'+_0x5374f4+'\x27...',()=>_0x9857ee[_0x3047c8(0x25b)][_0x3047c8(0x1bd)](_0x5374f4),{'verbose':_0x5d1539['verbose']});_0x50f160=_0x19c37d['data'],_0x4c2747=_0x3e38b6;}else throw new SDKError(ErrorCode[_0x3047c8(0x205)],'Invalid\x20path\x20syntax:\x20'+_0x21e14c,undefined,{'helpText':_0x3047c8(0x276)});}else _0x50f160=await getProjectIdOrDefault(_0x297c56),_0x4c2747=_0x21e14c;const _0x2822ee=await withSpinner(_0x3047c8(0x22b)+_0x4c2747+_0x3047c8(0x26d),()=>_0x9857ee[_0x3047c8(0x25b)][_0x3047c8(0x1e7)]({'name':_0x4c2747,'projectId':_0x50f160,'modelType':_0x165b5f,'systemPrompt':_0x441a8d,'starterMessage':_0x3d2c03,'maxToolIterations':_0x5e1325,'temperature':_0x3dfba8}),{'verbose':_0x5d1539[_0x3047c8(0x20e)]});return console[_0x3047c8(0x22c)](_0x3047c8(0x1da)+_0x2822ee[_0x3047c8(0x265)]['id']),await handleSDKOutput([_0x2822ee[_0x3047c8(0x265)]],_0x5d1539),0x0;}catch(_0x518f7){return handleSDKError(_0x518f7,_0x5d1539),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]=a20_0x4eec83(0x242);[a20_0x4eec83(0x268)]='Update\x20an\x20existing\x20agent';async['execute'](_0x3888e4){const _0x34e975=a20_0x4eec83,{options:_0x325e9f,args:_0x2885ad,tdx:_0x397615}=_0x3888e4;if(_0x2885ad['length']===0x0)return console[_0x34e975(0x231)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x34e975(0x231)](_0x34e975(0x246)),0x1;const _0x19bb1d=_0x2885ad[0x0],_0x56968e=_0x325e9f,_0xf3086e=_0x56968e[_0x34e975(0x1ed)],_0xe82499=_0x56968e['prompt'],_0x3f1b61=_0x56968e['description'],_0x48fa7c=_0x56968e[_0x34e975(0x247)];if(!_0xf3086e&&!_0xe82499&&!_0x3f1b61&&!_0x48fa7c)return console[_0x34e975(0x231)](_0x34e975(0x26f)),console[_0x34e975(0x231)](_0x34e975(0x1c0)),0x1;try{const _0x2a5292=await getProjectIdOrDefault(_0x3888e4),_0x442efe=await withSpinner('Resolving\x20agent\x20\x27'+_0x19bb1d+_0x34e975(0x26d),()=>_0x397615[_0x34e975(0x25b)][_0x34e975(0x24e)](_0x19bb1d,_0x2a5292),{'verbose':_0x325e9f[_0x34e975(0x20e)]}),_0x2a6518=_0x442efe['data'],_0x2e47ee=await withSpinner('Updating\x20agent...',()=>_0x397615[_0x34e975(0x25b)][_0x34e975(0x20b)](_0x2a6518,{'name':_0xf3086e,'prompt':_0xe82499,'description':_0x3f1b61,'starterMessage':_0x48fa7c}),{'verbose':_0x325e9f[_0x34e975(0x20e)]});return console[_0x34e975(0x22c)](_0x34e975(0x25c)+_0x2e47ee[_0x34e975(0x265)]['id']),await handleSDKOutput([_0x2e47ee['data']],_0x325e9f),0x0;}catch(_0x28b28d){return handleSDKError(_0x28b28d,_0x325e9f),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]=a20_0x4eec83(0x209);[a20_0x4eec83(0x268)]=a20_0x4eec83(0x1d1);async['execute'](_0x16a059){const _0x5ed132=a20_0x4eec83,{options:_0x36adff,args:_0x40ffbb,tdx:_0x423544}=_0x16a059;if(_0x40ffbb['length']===0x0)return console[_0x5ed132(0x231)](_0x5ed132(0x266)),console['error'](_0x5ed132(0x1f5)),0x1;const _0x45532b=_0x40ffbb[0x0];try{const _0x1fc8ae=await getProjectIdOrDefault(_0x16a059),_0xef664e=await withSpinner(_0x5ed132(0x1d6)+_0x45532b+_0x5ed132(0x26d),()=>_0x423544[_0x5ed132(0x25b)]['resolveAgentId'](_0x45532b,_0x1fc8ae),{'verbose':_0x36adff[_0x5ed132(0x20e)]}),_0x4b49e9=_0xef664e[_0x5ed132(0x265)];return await withSpinner(_0x5ed132(0x20a),()=>_0x423544['llm'][_0x5ed132(0x251)](_0x4b49e9),{'verbose':_0x36adff[_0x5ed132(0x20e)]}),console['log'](_0x5ed132(0x21b)+_0x4b49e9),0x0;}catch(_0x5db9fd){return handleSDKError(_0x5db9fd,_0x36adff),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]=a20_0x4eec83(0x264);[a20_0x4eec83(0x268)]=a20_0x4eec83(0x239);async[a20_0x4eec83(0x1cf)](_0x1c9e98){const _0x49067f=a20_0x4eec83,{options:_0x4d10d4,args:_0x10d6a9,tdx:_0x4618b3}=_0x1c9e98;let _0xbddab=_0x10d6a9[0x0];const _0x22170d=_0x4d10d4,_0x23bd11=_0x22170d['last'];try{if(_0x23bd11){if(_0xbddab)return console[_0x49067f(0x231)](_0x49067f(0x221)),console[_0x49067f(0x231)](_0x49067f(0x223)),0x1;const _0x1602f6=await withSpinner(_0x49067f(0x25d),()=>_0x4618b3[_0x49067f(0x25b)]['chats'](0x1),{'verbose':_0x4d10d4['verbose']});if(_0x1602f6[_0x49067f(0x265)]['length']===0x0)return console['log']('No\x20chat\x20sessions\x20found.'),0x0;_0xbddab=_0x1602f6[_0x49067f(0x265)][0x0]['id'];}if(!_0xbddab){const _0x4ee23b=resolveLimit(_0x4d10d4[_0x49067f(0x1e4)],DEFAULT_LLM_LIMIT),_0x25079a=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x4618b3[_0x49067f(0x25b)][_0x49067f(0x1d3)](_0x4ee23b),{'verbose':_0x4d10d4['verbose']});if(_0x4d10d4[_0x49067f(0x253)]===_0x49067f(0x207)||_0x4d10d4[_0x49067f(0x253)]==='jsonl')await handleSDKOutput(_0x25079a[_0x49067f(0x265)],_0x4d10d4);else{const _0x1498bd=_0x25079a[_0x49067f(0x265)]['map'](_0x2d9dc1=>({'created_at':_0x2d9dc1['attributes']['createdAt'],'chat_id':_0x2d9dc1['id'],'first_input':_0x2d9dc1[_0x49067f(0x1e2)]['firstInputContent']||_0x49067f(0x1d9)}));await handleSDKOutput(_0x1498bd,_0x4d10d4);}return 0x0;}else{const _0x5bf518=await withSpinner(_0x49067f(0x236)+_0xbddab+_0x49067f(0x26d),()=>_0x4618b3[_0x49067f(0x25b)][_0x49067f(0x1fd)](_0xbddab),{'verbose':_0x4d10d4['verbose']}),_0x2e98f4=_0x5bf518[_0x49067f(0x265)][_0x49067f(0x265)]??[];if(_0x2e98f4[_0x49067f(0x233)]===0x0)return console[_0x49067f(0x22c)](_0x49067f(0x261)),0x0;if(_0x4d10d4[_0x49067f(0x253)]===_0x49067f(0x207)||_0x4d10d4[_0x49067f(0x253)]===_0x49067f(0x1fc)||_0x4d10d4[_0x49067f(0x253)]===_0x49067f(0x262)||_0x4d10d4[_0x49067f(0x253)]===_0x49067f(0x238))await handleSDKOutput(_0x2e98f4,_0x4d10d4);else for(const _0x52d389 of _0x2e98f4){console['log'](formatChatHistoryEntry(_0x52d389,_0x4d10d4));}return 0x0;}}catch(_0x5b9c47){return handleSDKError(_0x5b9c47,_0x4d10d4),0x1;}}}export class LLMUseCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]=a20_0x4eec83(0x1ee);[a20_0x4eec83(0x268)]=a20_0x4eec83(0x241);async['execute'](_0x12ddcc){const _0x1639b8=a20_0x4eec83,{options:_0x2d34e2,args:_0x1ccd26,tdx:_0x22be9d}=_0x12ddcc;if(_0x1ccd26[_0x1639b8(0x233)]===0x0)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x1639b8(0x231)](_0x1639b8(0x26a)),0x1;const _0x30c394=_0x1ccd26[0x0];try{return await withSpinner(_0x1639b8(0x1e9)+_0x30c394+'\x27...',()=>_0x22be9d[_0x1639b8(0x25b)][_0x1639b8(0x243)](_0x30c394),{'verbose':_0x2d34e2[_0x1639b8(0x20e)]}),console[_0x1639b8(0x22c)](_0x1639b8(0x211)+_0x30c394),0x0;}catch(_0x270304){return handleSDKError(_0x270304,_0x2d34e2),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]='llm:project:create';[a20_0x4eec83(0x268)]=a20_0x4eec83(0x20c);async[a20_0x4eec83(0x1cf)](_0x111372){const _0x670ef2=a20_0x4eec83,{options:_0xb3d87d,args:_0x36bee9,tdx:_0x443c43}=_0x111372;if(_0x36bee9[_0x670ef2(0x233)]===0x0)return console[_0x670ef2(0x231)](_0x670ef2(0x1e0)),console[_0x670ef2(0x231)](_0x670ef2(0x216)),0x1;const _0x4daf3b=_0x36bee9[0x0],_0x257ebc=_0xb3d87d,_0x348564=_0x257ebc[_0x670ef2(0x268)];try{const _0x2e6a0b=await withSpinner(_0x670ef2(0x1f7)+_0x4daf3b+_0x670ef2(0x26d),()=>_0x443c43[_0x670ef2(0x25b)][_0x670ef2(0x25a)]({'name':_0x4daf3b,'description':_0x348564}),{'verbose':_0xb3d87d['verbose']});console[_0x670ef2(0x22c)](_0x670ef2(0x1c5)+_0x2e6a0b[_0x670ef2(0x265)]['id']);const _0xbe2ede=toLLMProjectInfo(_0x2e6a0b[_0x670ef2(0x265)]);return await handleSDKOutput([_0xbe2ede],_0xb3d87d),0x0;}catch(_0x2677bc){return handleSDKError(_0x2677bc,_0xb3d87d),0x1;}}}function a20_0xaacb(_0x24a82c,_0x19dd4a){const _0x4d6521=a20_0x4d65();return a20_0xaacb=function(_0xaacba7,_0x1eda24){_0xaacba7=_0xaacba7-0x1b8;let _0xb04ff2=_0x4d6521[_0xaacba7];return _0xb04ff2;},a20_0xaacb(_0x24a82c,_0x19dd4a);}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]=a20_0x4eec83(0x1d5);[a20_0x4eec83(0x268)]=a20_0x4eec83(0x1c7);async['execute'](_0x4866fb){const _0x52fbb0=a20_0x4eec83,{options:_0x39a2e9,args:_0x2a03d8,tdx:_0x2cab6e}=_0x4866fb;if(_0x2a03d8['length']===0x0)return console['error'](_0x52fbb0(0x1e0)),console[_0x52fbb0(0x231)](_0x52fbb0(0x220)),0x1;const _0x29d6ec=_0x2a03d8[0x0];try{return await withSpinner('Deleting\x20project\x20\x27'+_0x29d6ec+_0x52fbb0(0x26d),()=>_0x2cab6e[_0x52fbb0(0x25b)][_0x52fbb0(0x1bb)](_0x29d6ec),{'verbose':_0x39a2e9[_0x52fbb0(0x20e)]}),console[_0x52fbb0(0x22c)](_0x52fbb0(0x1ba)+_0x29d6ec),0x0;}catch(_0x34e80b){return handleSDKError(_0x34e80b,_0x39a2e9),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]=a20_0x4eec83(0x234);['description']=a20_0x4eec83(0x1c1);async[a20_0x4eec83(0x1cf)](_0x246be1){const _0x36bff0=a20_0x4eec83,{options:_0x577f19,args:_0x48dc48,tdx:_0xde64f5}=_0x246be1;if(_0x48dc48[_0x36bff0(0x233)]===0x0)return console[_0x36bff0(0x231)](_0x36bff0(0x1e0)),console['error'](_0x36bff0(0x1f2)),0x1;const _0x461d74=_0x48dc48[0x0],_0x464365=_0x577f19,_0x5dc8b8=_0x464365[_0x36bff0(0x1bc)],_0x3f2b03=_0x464365[_0x36bff0(0x263)];try{const _0x3c937b=_0x5dc8b8||_0x461d74+_0x36bff0(0x230);if(a20_0x1edd83[_0x36bff0(0x1d2)](_0x3c937b)&&!_0x3f2b03){if(!_0x577f19[_0x36bff0(0x1b9)]){const _0xe2ac99=await confirm(_0x36bff0(0x21e)+_0x3c937b+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0xe2ac99)return console['log'](_0x36bff0(0x237)),0x0;}a20_0x1edd83[_0x36bff0(0x213)](_0x3c937b,{'recursive':!![]});}const _0x5ee358=await withSpinner(_0x3f2b03?_0x36bff0(0x25e)+_0x461d74+_0x36bff0(0x26d):_0x36bff0(0x26c)+_0x461d74+_0x36bff0(0x26d),()=>_0xde64f5['llm']['backupProject'](_0x461d74,_0x5dc8b8,{'dryRun':_0x3f2b03}),{'verbose':_0x577f19[_0x36bff0(0x20e)]}),_0x44df79=_0x5ee358[_0x36bff0(0x265)];return _0x3f2b03?console[_0x36bff0(0x22c)](_0x36bff0(0x1d8)+_0x44df79[_0x36bff0(0x24b)]):console[_0x36bff0(0x22c)](_0x36bff0(0x252)+_0x44df79[_0x36bff0(0x24b)]),console[_0x36bff0(0x22c)](_0x36bff0(0x260)+_0x44df79[_0x36bff0(0x259)]['agents']),console[_0x36bff0(0x22c)](_0x36bff0(0x1e1)+_0x44df79[_0x36bff0(0x259)][_0x36bff0(0x1fe)]),console[_0x36bff0(0x22c)]('\x20\x20Prompts:\x20'+_0x44df79[_0x36bff0(0x259)][_0x36bff0(0x1cb)]),console[_0x36bff0(0x22c)](_0x36bff0(0x26b)+_0x44df79[_0x36bff0(0x259)][_0x36bff0(0x22a)]),(_0x577f19['format']===_0x36bff0(0x207)||_0x577f19[_0x36bff0(0x253)]===_0x36bff0(0x1fc))&&await handleSDKOutput([_0x44df79],_0x577f19),0x0;}catch(_0x36a4a1){return handleSDKError(_0x36a4a1,_0x577f19),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x4eec83(0x1ed)]='llm:project:restore';[a20_0x4eec83(0x268)]=a20_0x4eec83(0x272);async[a20_0x4eec83(0x1cf)](_0x2ef7e0){const _0x2aa477=a20_0x4eec83,{options:_0x49018f,args:_0x16daad,tdx:_0x34042a}=_0x2ef7e0;if(_0x16daad[_0x2aa477(0x233)]===0x0)return console[_0x2aa477(0x231)](_0x2aa477(0x235)),console[_0x2aa477(0x231)](_0x2aa477(0x256)),0x1;const _0x2f64be=_0x16daad[0x0],_0x2b7d7f=_0x49018f,_0x3b0625=_0x2b7d7f[_0x2aa477(0x1ed)],_0x47e5da=_0x2b7d7f[_0x2aa477(0x263)];try{if(!_0x47e5da){const _0xaee00e=_0x34042a[_0x2aa477(0x25b)][_0x2aa477(0x20d)](_0x2f64be),_0x4d6c9f=_0x3b0625||_0xaee00e[_0x2aa477(0x1eb)]['projectName'],_0x33b112=await withSpinner(_0x2aa477(0x218),()=>_0x34042a[_0x2aa477(0x25b)][_0x2aa477(0x1cd)](),{'verbose':_0x49018f[_0x2aa477(0x20e)]}),_0x410e8a=_0x33b112[_0x2aa477(0x265)]['find'](_0x233d4e=>_0x233d4e['attributes'][_0x2aa477(0x1ed)]===_0x4d6c9f);if(_0x410e8a&&!_0x49018f[_0x2aa477(0x1b9)]){const _0x257d01=await confirm(_0x2aa477(0x24c)+_0x4d6c9f+_0x2aa477(0x228));if(!_0x257d01)return console[_0x2aa477(0x22c)](_0x2aa477(0x1e5)),0x0;}}const _0x1091cf=await withSpinner(_0x47e5da?_0x2aa477(0x206)+_0x2f64be+_0x2aa477(0x26d):_0x2aa477(0x275)+_0x2f64be+_0x2aa477(0x26d),()=>_0x34042a[_0x2aa477(0x25b)][_0x2aa477(0x200)](_0x2f64be,{'name':_0x3b0625,'dryRun':_0x47e5da}),{'verbose':_0x49018f[_0x2aa477(0x20e)]}),_0x560098=_0x1091cf[_0x2aa477(0x265)];return _0x560098['sourceSite']&&console[_0x2aa477(0x22c)](_0x2aa477(0x23b)+_0x560098['sourceSite']+'\x27'),_0x47e5da?console['log'](_0x2aa477(0x250)+_0x560098[_0x2aa477(0x1c9)]):console[_0x2aa477(0x22c)](_0x2aa477(0x203)+_0x560098['projectName']+'\x20('+_0x560098[_0x2aa477(0x1cc)]+')'),console[_0x2aa477(0x22c)](_0x2aa477(0x260)+_0x560098[_0x2aa477(0x259)]['agents']),console[_0x2aa477(0x22c)]('\x20\x20Knowledge\x20Bases:\x20'+_0x560098[_0x2aa477(0x259)][_0x2aa477(0x1fe)]),console[_0x2aa477(0x22c)]('\x20\x20Prompts:\x20'+_0x560098[_0x2aa477(0x259)][_0x2aa477(0x1cb)]),console[_0x2aa477(0x22c)](_0x2aa477(0x26b)+_0x560098[_0x2aa477(0x259)][_0x2aa477(0x22a)]),(_0x49018f[_0x2aa477(0x253)]===_0x2aa477(0x207)||_0x49018f[_0x2aa477(0x253)]==='jsonl')&&await handleSDKOutput([_0x560098],_0x49018f),0x0;}catch(_0x46f7f3){return handleSDKError(_0x46f7f3,_0x49018f),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x3f5d35=a21_0x29a1;(function(_0x30e1ff,_0x5476f5){const _0x5270e6=a21_0x29a1,_0x4cea23=_0x30e1ff();while(!![]){try{const _0x32941e=parseInt(_0x5270e6(0x155))/0x1+-parseInt(_0x5270e6(0x136))/0x2+parseInt(_0x5270e6(0x147))/0x3+parseInt(_0x5270e6(0x142))/0x4*(parseInt(_0x5270e6(0x14e))/0x5)+-parseInt(_0x5270e6(0x12f))/0x6*(parseInt(_0x5270e6(0x140))/0x7)+parseInt(_0x5270e6(0x13e))/0x8+-parseInt(_0x5270e6(0x131))/0x9;if(_0x32941e===_0x5476f5)break;else _0x4cea23['push'](_0x4cea23['shift']());}catch(_0x4edfc0){_0x4cea23['push'](_0x4cea23['shift']());}}}(a21_0x483c,0xbc874));import a21_0x3f5b3e from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';function a21_0x29a1(_0x490524,_0x4354e0){const _0x483c17=a21_0x483c();return a21_0x29a1=function(_0x29a1fb,_0x478f13){_0x29a1fb=_0x29a1fb-0x122;let _0x351e85=_0x483c17[_0x29a1fb];return _0x351e85;},a21_0x29a1(_0x490524,_0x4354e0);}import{TDXLogger}from'../utils/tdx-logger.js';function a21_0x483c(){const _0x3a0565=['482766NiJtoo','stop','6620256fwNFRa','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','\x0aClaude\x20Code\x20Configuration:','description','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','1675530uhEvut','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','init','log','\x20\x20\x20\x20\x22env\x22:\x20{','SIGTERM','start','7138872xrnsuG','\x20\x20}','28RILwQy','✓\x20Proxy\x20server\x20stopped','10660pMxfHv','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','exit','llm','green','8343sboDPG','site','bold','Port\x20','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','\x0aTesting\x20with\x20Agent\x20SDK:','white','625lJiPul','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','project','Server\x20Configuration:','\x20\x20Agents:','server','1439140KeDTHF','close','\x20\x20Address:','\x20\x20Project:','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','NOT_FOUND','Starting\x20proxy\x20server...','SIGINT','name','\x20\x20\x20\x20}','llmProject','projects','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','yellow','dim','llm:proxy','logger','logLevel','find','execute','cyan','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','\x27\x20not\x20found','attributes','http://0.0.0.0:','\x20is\x20unavailable,\x20using\x20port\x20'];a21_0x483c=function(){return _0x3a0565;};return a21_0x483c();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x537fd1,_0x10738a){const _0x3c9baa=a21_0x29a1,{tdx:_0x5a262f,options:_0x142117}=_0x537fd1,_0x470ab0=_0x10738a||_0x142117[_0x3c9baa(0x15f)];if(_0x470ab0){const _0x41a11b=await _0x5a262f[_0x3c9baa(0x145)][_0x3c9baa(0x160)](),_0x31e6dc=_0x41a11b[_0x3c9baa(0x127)](_0x53e2eb=>_0x53e2eb[_0x3c9baa(0x12c)][_0x3c9baa(0x15d)]===_0x470ab0);if(!_0x31e6dc)throw new SDKError(ErrorCode[_0x3c9baa(0x15a)],'Project\x20\x27'+_0x470ab0+_0x3c9baa(0x12b),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x31e6dc['id'];}const _0x583872=await _0x5a262f[_0x3c9baa(0x145)]['getOrCreateDefaultProject']();return _0x583872['id'];}export class LLMProxyCommand extends BaseCommand{[a21_0x3f5d35(0x15d)]=a21_0x3f5d35(0x124);[a21_0x3f5d35(0x134)]=a21_0x3f5d35(0x137);[a21_0x3f5d35(0x154)];[a21_0x3f5d35(0x125)];async[a21_0x3f5d35(0x128)](_0x5d1098){const _0x3f585b=a21_0x3f5d35,{tdx:_0x3baff3,options:_0x1b7989}=_0x5d1098;try{const _0x4153de=_0x1b7989,_0x1a8be8=_0x4153de['port']||0xfa0,_0x2d71ce=_0x4153de[_0x3f585b(0x151)],_0x59bd7a=await findAvailablePort(_0x1a8be8);console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x123)]('Resolving\x20project...'));const _0x3e0075=await getProjectIdOrDefault(_0x5d1098,_0x2d71ce),_0x1bf02f=await _0x3baff3[_0x3f585b(0x145)]['projects'](),_0x2254cc=_0x1bf02f[_0x3f585b(0x127)](_0x1829ec=>_0x1829ec['id']===_0x3e0075);this['logger']=new TDXLogger(_0x1b7989[_0x3f585b(0x126)]),await this[_0x3f585b(0x125)][_0x3f585b(0x139)](),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x123)](_0x3f585b(0x15b)));_0x59bd7a!==_0x1a8be8&&console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x122)](_0x3f585b(0x14a)+_0x1a8be8+_0x3f585b(0x12e)+_0x59bd7a));this[_0x3f585b(0x154)]=new ProxyServer({'port':_0x59bd7a,'projectId':_0x3e0075,'tdx':_0x3baff3,'logger':this[_0x3f585b(0x125)],'site':_0x1b7989[_0x3f585b(0x148)]}),await this[_0x3f585b(0x154)][_0x3f585b(0x13d)](),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x122)][_0x3f585b(0x149)](_0x3f585b(0x162))),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x122)]('This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.')),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x122)](_0x3f585b(0x143))),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x146)][_0x3f585b(0x149)](_0x3f585b(0x14b))),console['log'](a21_0x3f5b3e[_0x3f585b(0x129)](_0x3f585b(0x152))),console[_0x3f585b(0x13a)](a21_0x3f5b3e['dim'](_0x3f585b(0x157)),a21_0x3f5b3e[_0x3f585b(0x14d)](_0x3f585b(0x12d)+_0x59bd7a)),console['log'](a21_0x3f5b3e[_0x3f585b(0x123)](_0x3f585b(0x158)),a21_0x3f5b3e[_0x3f585b(0x14d)](_0x2254cc?.['attributes']['name']||_0x3e0075)),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x123)](_0x3f585b(0x153)),a21_0x3f5b3e[_0x3f585b(0x14d)]('created\x20on-demand\x20per\x20model')),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x123)]('\x20\x20Site:'),a21_0x3f5b3e[_0x3f585b(0x14d)](_0x1b7989[_0x3f585b(0x148)])),console['log'](a21_0x3f5b3e['cyan'](_0x3f585b(0x133))),console['log'](a21_0x3f5b3e[_0x3f585b(0x123)](_0x3f585b(0x132))),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x14d)]('\x20\x20{')),console[_0x3f585b(0x13a)](a21_0x3f5b3e['white'](_0x3f585b(0x13b))),console['log'](a21_0x3f5b3e['white'](_0x3f585b(0x150)+_0x59bd7a+'\x22,')),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x14d)](_0x3f585b(0x138))),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x14d)](_0x3f585b(0x15e))),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x14d)](_0x3f585b(0x13f))),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x129)](_0x3f585b(0x14c))),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x123)](_0x3f585b(0x159))),console['log'](a21_0x3f5b3e[_0x3f585b(0x123)](_0x3f585b(0x135))),console['log'](a21_0x3f5b3e[_0x3f585b(0x123)](_0x3f585b(0x161))),console[_0x3f585b(0x13a)](a21_0x3f5b3e[_0x3f585b(0x122)](_0x3f585b(0x12a)));const _0x3341bf=async()=>{const _0x49beb5=_0x3f585b;console[_0x49beb5(0x13a)](a21_0x3f5b3e['dim'](_0x49beb5(0x14f))),this[_0x49beb5(0x154)]&&await this[_0x49beb5(0x154)][_0x49beb5(0x130)](),this[_0x49beb5(0x125)]&&await this['logger']['close'](),console[_0x49beb5(0x13a)](a21_0x3f5b3e['green'](_0x49beb5(0x141))),process[_0x49beb5(0x144)](0x0);};return process['on'](_0x3f585b(0x15c),_0x3341bf),process['on'](_0x3f585b(0x13c),_0x3341bf),await new Promise(()=>{}),0x0;}catch(_0x493580){this[_0x3f585b(0x154)]&&await this[_0x3f585b(0x154)][_0x3f585b(0x130)]();this['logger']&&await this[_0x3f585b(0x125)][_0x3f585b(0x156)]();throw _0x493580;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x11fef3=a22_0x5ec7;(function(_0x4a4c8c,_0x5303df){const _0x1cca09=a22_0x5ec7,_0x3055e8=_0x4a4c8c();while(!![]){try{const _0x2231e2=-parseInt(_0x1cca09(0xcc))/0x1+-parseInt(_0x1cca09(0xb0))/0x2+-parseInt(_0x1cca09(0xc7))/0x3+parseInt(_0x1cca09(0xb8))/0x4*(parseInt(_0x1cca09(0xab))/0x5)+-parseInt(_0x1cca09(0xaa))/0x6+-parseInt(_0x1cca09(0xc6))/0x7+parseInt(_0x1cca09(0xbf))/0x8;if(_0x2231e2===_0x5303df)break;else _0x3055e8['push'](_0x3055e8['shift']());}catch(_0x57060a){_0x3055e8['push'](_0x3055e8['shift']());}}}(a22_0x2dc1,0x1ce46));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';export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x11fef3(0xd8)]='segment:parent:create';[a22_0x11fef3(0xd2)]=a22_0x11fef3(0xc4);async['execute'](_0x38f072){const _0x50da32=a22_0x11fef3,{options:_0x39b11a,args:_0x5ec9b5,tdx:_0x5aed9c}=_0x38f072,_0x468663=_0x39b11a;if(_0x5ec9b5[_0x50da32(0xd3)]===0x0)return console[_0x50da32(0xba)](_0x50da32(0xaf)),console[_0x50da32(0xba)](_0x50da32(0xbb)),0x1;const _0x2e9b86=_0x5ec9b5[0x0];if(!_0x468663[_0x50da32(0xd9)]||!_0x468663[_0x50da32(0xb9)])return console[_0x50da32(0xba)](_0x50da32(0xb7)),console['error'](_0x50da32(0xbb)),0x1;_0x468663['verbose']&&(console[_0x50da32(0xba)](_0x50da32(0xd1)+_0x468663[_0x50da32(0xd7)]),console[_0x50da32(0xba)](_0x50da32(0xc1)+_0x2e9b86),console[_0x50da32(0xba)](_0x50da32(0xb5)+_0x468663[_0x50da32(0xd9)]),console[_0x50da32(0xba)](_0x50da32(0xb2)+_0x468663[_0x50da32(0xb9)]));const _0x4003ef=await loadJSONFromOptions(_0x468663[_0x50da32(0xbc)],_0x468663[_0x50da32(0xbd)]),_0x2cf637=await loadJSONFromOptions(_0x468663[_0x50da32(0xb4)],_0x468663[_0x50da32(0xae)]),_0x2a5da5=await loadJSONFromOptions(_0x468663[_0x50da32(0xcb)],_0x468663[_0x50da32(0xc3)]),_0x2f8075={'name':_0x2e9b86,'description':_0x468663[_0x50da32(0xd2)],'scheduleType':_0x468663[_0x50da32(0xca)],'scheduleOption':_0x468663[_0x50da32(0xcf)],'timezone':_0x468663[_0x50da32(0xd6)],'master':{'parentDatabaseName':_0x468663['database'],'parentTableName':_0x468663['table']},'attributes':_0x4003ef,'behaviors':_0x2cf637,'customerGroup':_0x2a5da5},_0x8e19df=await withSpinner(_0x50da32(0xc9)+_0x2e9b86+'\x27...',()=>_0x5aed9c[_0x50da32(0xc2)][_0x50da32(0xda)](_0x2f8075),{'verbose':_0x39b11a[_0x50da32(0xd4)]}),_0x406371=_0x8e19df[_0x50da32(0xad)];return console['error'](_0x50da32(0xcd)+_0x406371[_0x50da32(0xd8)]+_0x50da32(0xd5)+_0x406371['id']),await handleSDKOutput([_0x406371],_0x39b11a),0x0;}}function a22_0x5ec7(_0x5bc50f,_0x429b27){const _0x2dc197=a22_0x2dc1();return a22_0x5ec7=function(_0x5ec72c,_0x482d3b){_0x5ec72c=_0x5ec72c-0xa9;let _0x3424dc=_0x2dc197[_0x5ec72c];return _0x3424dc;},a22_0x5ec7(_0x5bc50f,_0x429b27);}function a22_0x2dc1(){const _0x11d1c6=['site','name','database','createParent','✔\x20Updated\x20parent\x20segment\x20\x27','1144224wCnlVW','5eJccJY','addBehaviors','data','behaviorsFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','412838CYxgFv','Fetching\x20current\x20configuration\x20for\x20\x27','Table:\x20','addBehaviorsFile','behaviors','Database:\x20','getParentFull','Error:\x20--database\x20and\x20--table\x20are\x20required','7972PXGEED','table','error','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','attributes','attributesFile','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','6916088pSKHls','addAttributes','Name:\x20','segment','customerGroupFile','Create\x20new\x20parent\x20segment\x20(audience)','Update\x20existing\x20parent\x20segment\x20(audience)','547414oUawiY','467922ybGolW','\x27...','Creating\x20parent\x20segment\x20\x27','scheduleType','customerGroup','116863bEsveh','✔\x20Created\x20parent\x20segment\x20\x27','updateParent','scheduleOption','master','Site:\x20','description','length','verbose','\x27\x20with\x20ID:\x20','timezone'];a22_0x2dc1=function(){return _0x11d1c6;};return a22_0x2dc1();}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';[a22_0x11fef3(0xd2)]=a22_0x11fef3(0xc5);async['execute'](_0x238a6a){const _0x572cc8=a22_0x11fef3,{options:_0x4a685a,args:_0x18bbc6,tdx:_0x35823d}=_0x238a6a,_0x5465af=_0x4a685a;if(_0x18bbc6['length']===0x0)return console[_0x572cc8(0xba)](_0x572cc8(0xaf)),console[_0x572cc8(0xba)](_0x572cc8(0xbe)),0x1;const _0x2be581=_0x18bbc6[0x0];_0x5465af[_0x572cc8(0xd4)]&&(console[_0x572cc8(0xba)]('Site:\x20'+_0x5465af[_0x572cc8(0xd7)]),console['error']('Parent\x20segment:\x20'+_0x2be581));const _0x426837=await withSpinner(_0x572cc8(0xb1)+_0x2be581+_0x572cc8(0xc8),()=>_0x35823d['segment'][_0x572cc8(0xb6)](_0x2be581),{'verbose':_0x5465af[_0x572cc8(0xd4)]}),_0x2be697=_0x426837[_0x572cc8(0xad)],_0x135511=await loadJSONFromOptions(_0x5465af[_0x572cc8(0xc0)],_0x5465af['addAttributesFile']),_0x397316=await loadJSONFromOptions(_0x5465af[_0x572cc8(0xac)],_0x5465af[_0x572cc8(0xb3)]),_0x556e61={'name':_0x2be697[_0x572cc8(0xd8)],'description':_0x5465af[_0x572cc8(0xd2)]!==undefined?_0x5465af['description']:_0x2be697[_0x572cc8(0xd2)],'scheduleType':_0x5465af[_0x572cc8(0xca)]!==undefined?_0x5465af['scheduleType']:_0x2be697[_0x572cc8(0xca)],'scheduleOption':_0x5465af[_0x572cc8(0xcf)]!==undefined?_0x5465af['scheduleOption']:_0x2be697[_0x572cc8(0xcf)],'timezone':_0x5465af[_0x572cc8(0xd6)]!==undefined?_0x5465af[_0x572cc8(0xd6)]:_0x2be697[_0x572cc8(0xd6)],'master':_0x2be697[_0x572cc8(0xd0)],'attributes':_0x135511?[..._0x2be697[_0x572cc8(0xbc)]||[],..._0x135511]:_0x2be697[_0x572cc8(0xbc)],'behaviors':_0x397316?[..._0x2be697[_0x572cc8(0xb4)]||[],..._0x397316]:_0x2be697['behaviors'],'customerGroup':_0x2be697[_0x572cc8(0xcb)]},_0x1b0498=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x2be581+'\x27...',()=>_0x35823d[_0x572cc8(0xc2)][_0x572cc8(0xce)](_0x2be581,_0x556e61),{'verbose':_0x5465af[_0x572cc8(0xd4)]}),_0x3cc4d9=_0x1b0498[_0x572cc8(0xad)];return console[_0x572cc8(0xba)](_0x572cc8(0xa9)+_0x3cc4d9[_0x572cc8(0xd8)]+'\x27'),await handleSDKOutput([_0x3cc4d9],_0x5465af),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x3b266f=a23_0x3b60;(function(_0x16a397,_0x2ec0f9){const _0x3d3280=a23_0x3b60,_0x213c96=_0x16a397();while(!![]){try{const _0x382691=-parseInt(_0x3d3280(0x1c3))/0x1+-parseInt(_0x3d3280(0x1b8))/0x2+-parseInt(_0x3d3280(0x1b1))/0x3*(parseInt(_0x3d3280(0x1b5))/0x4)+parseInt(_0x3d3280(0x1bf))/0x5+-parseInt(_0x3d3280(0x1b7))/0x6*(parseInt(_0x3d3280(0x1b6))/0x7)+parseInt(_0x3d3280(0x1b9))/0x8*(parseInt(_0x3d3280(0x1c5))/0x9)+parseInt(_0x3d3280(0x1c6))/0xa;if(_0x382691===_0x2ec0f9)break;else _0x213c96['push'](_0x213c96['shift']());}catch(_0x2a610e){_0x213c96['push'](_0x213c96['shift']());}}}(a23_0x399c,0x576f2));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a23_0x3b60(_0x40e16e,_0x608abf){const _0x399cbd=a23_0x399c();return a23_0x3b60=function(_0x3b60ab,_0x511764){_0x3b60ab=_0x3b60ab-0x1b1;let _0x2248b3=_0x399cbd[_0x3b60ab];return _0x2248b3;},a23_0x3b60(_0x40e16e,_0x608abf);}function a23_0x399c(){const _0xb3cf93=['365172UyvJhj','957010BkYutR','4848632LrpMSx','log','profiles','description','Error:\x20','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2538775ktSzcC','error','execute','scope','508041UEcUNQ','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','9EtQNZc','7829080lzMOQh','87LtEVrL','name','length','\x20\x20Global:\x20~/.config/tdx/tdx.json','42568Vttset','28QOWMFh'];a23_0x399c=function(){return _0xb3cf93;};return a23_0x399c();}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a23_0x3b266f(0x1b2)]=a23_0x3b266f(0x1bb);['description']='List\x20all\x20available\x20profiles';async[a23_0x3b266f(0x1c1)](_0x58df7f){const _0x490deb=a23_0x3b266f,{options:_0x82d60e}=_0x58df7f;try{const _0x56d865=listProfiles(),_0x33ae92=getActiveProfile();if(_0x56d865[_0x490deb(0x1b3)]===0x0)return console['log'](_0x490deb(0x1c4)),console[_0x490deb(0x1ba)](_0x490deb(0x1be)),console[_0x490deb(0x1ba)](_0x490deb(0x1b4)),0x0;const _0x31de42=_0x56d865['map'](_0x35eed0=>{const _0x2f6e1e=_0x490deb,_0x2e2f21=_0x35eed0[_0x2f6e1e(0x1b2)]===_0x33ae92,_0x1b76f3=getProfileParams(_0x35eed0['config']);return{'name':_0x35eed0[_0x2f6e1e(0x1b2)],'active':_0x2e2f21,'scope':_0x35eed0[_0x2f6e1e(0x1c2)],'description':_0x35eed0['config'][_0x2f6e1e(0x1bc)]||'','params':_0x1b76f3};});return await handleSDKOutput(_0x31de42,_0x82d60e),0x0;}catch(_0x3029fe){return _0x3029fe instanceof Error&&console[_0x490deb(0x1c0)](_0x490deb(0x1bd)+_0x3029fe['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x5d2fc6=a24_0x1b00;function a24_0x1b00(_0x1ee25e,_0x314001){const _0x587708=a24_0x5877();return a24_0x1b00=function(_0x1b0002,_0x5bc754){_0x1b0002=_0x1b0002-0xaf;let _0x229aff=_0x587708[_0x1b0002];return _0x229aff;},a24_0x1b00(_0x1ee25e,_0x314001);}(function(_0x536666,_0x47977f){const _0x1b3127=a24_0x1b00,_0x309d77=_0x536666();while(!![]){try{const _0x33024f=parseInt(_0x1b3127(0xd9))/0x1*(parseInt(_0x1b3127(0xc1))/0x2)+-parseInt(_0x1b3127(0xd7))/0x3+parseInt(_0x1b3127(0xc3))/0x4*(parseInt(_0x1b3127(0xb7))/0x5)+parseInt(_0x1b3127(0xd4))/0x6+parseInt(_0x1b3127(0xca))/0x7+parseInt(_0x1b3127(0xe0))/0x8*(parseInt(_0x1b3127(0xd6))/0x9)+-parseInt(_0x1b3127(0xb1))/0xa*(parseInt(_0x1b3127(0xbf))/0xb);if(_0x33024f===_0x47977f)break;else _0x309d77['push'](_0x309d77['shift']());}catch(_0x1fbd7f){_0x309d77['push'](_0x309d77['shift']());}}}(a24_0x5877,0x81bfe));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a24_0x5877(){const _0x5afb20=['information_schema','3687576LAzqSj','query','state','Error:\x20','5590zAKZsx','file','jobId','\x20[Job\x20ID:\x20','error','Schema:\x20','4509705UhSUKN','processedRows','Executing\x20query\x20[','database','name','verbose','message','setExtra','43483tTjukx','elapsedTimeMillis','1975882AFNuAu','originalMessage','4HkSikZ','\x20splits','description','\x20rows\x20','Executing\x20query...','output','\x0aAll\x20results\x20saved\x20to\x20','4591524AORgPF','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','args','\x20-\x20','join','Query\x20completed:\x20Processed\x20','validate','Statement\x20','options','data','471618zYFcau','site','9PVSdHr','1032549GPyVia','completedSplits','1FhYLRI','push','length','Site:\x20','stats','setJobId'];a24_0x5877=function(){return _0x5afb20;};return a24_0x5877();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a24_0x5d2fc6(0xbb)]=a24_0x5d2fc6(0xe1);[a24_0x5d2fc6(0xc5)]='Run\x20Trino\x20queries\x20(streaming)';async['execute'](_0x360ba9){const _0x1b7c82=a24_0x5d2fc6,{options:_0x3d76e7,args:_0x558ec6,tdx:_0xbee988}=_0x360ba9,_0x274569=_0x558ec6[0x0],_0x4d464c=_0x3d76e7['file'];let _0x6b21d9;if(_0x4d464c)try{_0x6b21d9=readSqlStatementsFromFile(_0x4d464c);}catch(_0x1992af){return console[_0x1b7c82(0xb5)]('Error:\x20'+_0x1992af[_0x1b7c82(0xbd)]),0x1;}else try{_0x6b21d9=splitSqlStatements(_0x274569);}catch(_0x217dd4){return console['error'](_0x1b7c82(0xb0)+_0x217dd4['message']),0x1;}const _0x24ef0e=_0x3d76e7[_0x1b7c82(0xba)]||_0x1b7c82(0xdf),_0x2db84a=_0x3d76e7['catalog'];try{const _0x167e7e=[],_0x377a4c=!!_0x3d76e7[_0x1b7c82(0xc8)];for(let _0x230bf5=0x0;_0x230bf5<_0x6b21d9[_0x1b7c82(0xdb)];_0x230bf5++){const _0x213f10=_0x6b21d9[_0x230bf5],_0x9b4fd6=_0x230bf5+0x1,_0x3461db=_0x6b21d9['length'],_0xb79fa=_0x3461db>0x1;_0x3d76e7[_0x1b7c82(0xbc)]&&(console[_0x1b7c82(0xb5)]('\x0a'+(_0xb79fa?_0x1b7c82(0xd1)+_0x9b4fd6+'/'+_0x3461db+':':'')),console[_0x1b7c82(0xb5)](_0x1b7c82(0xdc)+_0x3d76e7[_0x1b7c82(0xd5)]),console['error']('Catalog:\x20'+(_0x2db84a||'td')),console['error'](_0x1b7c82(0xb6)+_0x24ef0e),console['error']('SQL:\x20'+_0x213f10));const _0x330c2b=_0xb79fa?'Executing\x20statement\x20'+_0x9b4fd6+'/'+_0x3461db+'...':_0x1b7c82(0xc7);try{const _0x43c712=await withQuerySpinner(_0x330c2b,async _0x13ebd6=>{const _0xabc58b=_0x1b7c82,_0x559451=await _0xbee988[_0xabc58b(0xe1)]['execute'](_0x213f10,{'catalog':_0x2db84a,'schema':_0x24ef0e,'onJobId':_0x261d83=>{const _0x577102=_0xabc58b;_0x13ebd6[_0x577102(0xde)](_0x261d83);},'onProgress':_0x23375e=>{const _0x344db3=_0xabc58b;_0x13ebd6['setPhase'](_0x344db3(0xb9)+_0x23375e[_0x344db3(0xaf)]+']'),_0x13ebd6[_0x344db3(0xbe)](formatRows(_0x23375e[_0x344db3(0xb8)])+'\x20rows\x20'+_0x23375e[_0x344db3(0xd8)]+'/'+_0x23375e['totalSplits']+_0x344db3(0xc4));}});return _0x559451;},{'verbose':_0x3d76e7[_0x1b7c82(0xbc)]}),_0x5de81c=_0x43c712[_0x1b7c82(0xd3)],_0x222119=_0x5de81c[_0x1b7c82(0xb3)]?_0x1b7c82(0xb4)+_0x5de81c[_0x1b7c82(0xb3)]+']':'',_0x38dafc=_0xb79fa?_0x1b7c82(0xd1)+_0x9b4fd6+'/'+_0x3461db+_0x1b7c82(0xcd):'';console[_0x1b7c82(0xb5)]('✔\x20'+_0x38dafc+_0x1b7c82(0xcf)+formatRows(_0x5de81c['stats'][_0x1b7c82(0xb8)])+_0x1b7c82(0xc6)+('in\x20'+formatElapsed(_0x5de81c[_0x1b7c82(0xdd)][_0x1b7c82(0xc0)])+_0x222119));if(_0xb79fa&&_0x377a4c){const _0x43e04b=resolveOutputOptions(_0x3d76e7),_0x415449=await formatQueryOutput(_0x5de81c,_0x43e04b);_0x167e7e[_0x1b7c82(0xda)](_0x415449);}else await handleQueryOutput(_0x5de81c,_0x3d76e7);}catch(_0x3c4e58){const _0x167cce=_0xb79fa?_0x1b7c82(0xd1)+_0x9b4fd6+'/'+_0x3461db+':\x0a':'',_0x27df0c=_0x3c4e58 instanceof SDKError?_0x3c4e58[_0x1b7c82(0xc2)]:_0x3c4e58[_0x1b7c82(0xbd)];return console[_0x1b7c82(0xb5)](''+_0x167cce+_0x27df0c),0x1;}}if(_0x6b21d9[_0x1b7c82(0xdb)]>0x1&&_0x377a4c&&_0x167e7e[_0x1b7c82(0xdb)]>0x0){const _0xfb328e=_0x167e7e[_0x1b7c82(0xce)]('\x0a');writeFileSync(_0x3d76e7['output'],_0xfb328e),console[_0x1b7c82(0xb5)](_0x1b7c82(0xc9)+_0x3d76e7['output']);}return 0x0;}catch(_0x2ec349){throw _0x2ec349;}}[a24_0x5d2fc6(0xd0)](_0x59dc21){const _0x37dd2d=a24_0x5d2fc6,_0x3f5271=_0x59dc21[_0x37dd2d(0xcc)][0x0],_0x1dfbd4=_0x59dc21[_0x37dd2d(0xd2)][_0x37dd2d(0xb2)];if(!_0x3f5271&&!_0x1dfbd4)return'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';if(_0x3f5271&&_0x1dfbd4)return _0x37dd2d(0xcb);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x1e49cb=a25_0x20f0;function a25_0x20f0(_0x36217d,_0x495e16){const _0x1b403a=a25_0x1b40();return a25_0x20f0=function(_0x20f046,_0x51e95a){_0x20f046=_0x20f046-0x98;let _0x24d6b1=_0x1b403a[_0x20f046];return _0x24d6b1;},a25_0x20f0(_0x36217d,_0x495e16);}(function(_0x368409,_0x27cc3b){const _0x2ebe04=a25_0x20f0,_0x4863e9=_0x368409();while(!![]){try{const _0x4dafb9=-parseInt(_0x2ebe04(0xe6))/0x1*(-parseInt(_0x2ebe04(0xaa))/0x2)+-parseInt(_0x2ebe04(0xb6))/0x3+parseInt(_0x2ebe04(0xa9))/0x4*(parseInt(_0x2ebe04(0xe2))/0x5)+parseInt(_0x2ebe04(0xb8))/0x6+-parseInt(_0x2ebe04(0xe8))/0x7+-parseInt(_0x2ebe04(0xb9))/0x8+parseInt(_0x2ebe04(0xfc))/0x9;if(_0x4dafb9===_0x27cc3b)break;else _0x4863e9['push'](_0x4863e9['shift']());}catch(_0x5038fd){_0x4863e9['push'](_0x4863e9['shift']());}}}(a25_0x1b40,0x3de09));function a25_0x1b40(){const _0x156288=['Examples:','getFolder','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20folder','segment:describe','getSegmentSQL','71005umSWop','cause','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolved\x20type:\x20','1BNoRGp','data','647892GIWvCx','site','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20parent\x20segment\x20details...','format','replace','getParent','segment:show','segmentId','Resolved\x20relative\x20path\x20to:\x20','limit','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:sql','description','folderId','getParentSQL','✔\x20Created\x20folder\x20\x27','folder','length','6952959mQTqdz','Error:\x20Path\x20or\x20name\x20is\x20required','jobId','Usage:\x20tdx\x20segment\x20describe\x20<path>','parentSegment','setJobId','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','parent','\x27\x20with\x20ID:\x20','parentId','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','✔\x20Found\x20','name','resolvePathToResource','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getSegment','Folder\x20ID:\x20','Error:\x20','✔\x20Query\x20completed:\x20Processed\x20','toLocaleString','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','processedRows','stats','parentFolder','execute','INTERNAL','Folder\x20name:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','query','32PIqPzi','155378lRwLuT','Fetching\x20folder\x20details...','verbose','segment:folder:show','test','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Executing\x20segment\x20query...','Fetching\x20SQL\x20for\x20parent\x20segment...','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Resolving\x20parent\x20folder\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','type','1384014uQfxeZ','jsonl','1992210btcNMK','3908320VsiMYt','Segment\x20ID:\x20','error','Fetching\x20segment\x20details...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolveFolderId','Fetching\x20folder\x20\x27','Resolving\x20parent\x20segment\x20\x27','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Show\x20segment\x20or\x20folder\x20details','SQL\x20query:\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','includes','segmentPath','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','code','\x20[Job\x20ID:\x20','Site:\x20','Resolving\x20folder\x20\x27','segment','Parent\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','Create\x20segment\x20folder\x20for\x20organization','in\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Cause:\x20','information_schema','message','\x20rows\x20','\x27...','Resolved\x20parent\x20ID:\x20'];a25_0x1b40=function(){return _0x156288;};return a25_0x1b40();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}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{[a25_0x1e49cb(0x98)]=a25_0x1e49cb(0xe0);['description']=a25_0x1e49cb(0xc2);async['execute'](_0x4fc1a0){const _0x27449b=a25_0x1e49cb,{options:_0x3b6314,args:_0x5dcecd,tdx:_0x2826fc}=_0x4fc1a0,_0x735d55=_0x5dcecd[0x0],_0x57a1c0=!_0x735d55&&!!_0x3b6314['parentSegment'],_0x2a42ea=_0x735d55||_0x3b6314[_0x27449b(0x100)];if(!_0x2a42ea)return console['error'](_0x27449b(0xfd)),console[_0x27449b(0xbb)](_0x27449b(0xff)),console['error'](_0x27449b(0xdb)),console[_0x27449b(0xbb)](_0x27449b(0xa0)),console[_0x27449b(0xbb)](_0x27449b(0xeb)),console[_0x27449b(0xbb)](_0x27449b(0x107)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x344aed=_0x3b6314['segmentPath'];let _0x42ebd0=_0x2a42ea;!_0x57a1c0&&_0x344aed&&!_0x2a42ea['includes']('/')&&(_0x42ebd0=_0x344aed+'/'+_0x2a42ea,_0x3b6314[_0x27449b(0xac)]&&console[_0x27449b(0xbb)](_0x27449b(0xf2)+_0x42ebd0));const _0x51eb28=await withSpinner(_0x27449b(0x102)+_0x42ebd0+_0x27449b(0xd9),()=>_0x2826fc[_0x27449b(0xcf)][_0x27449b(0x99)](_0x42ebd0),{'verbose':_0x3b6314[_0x27449b(0xac)]}),_0x310dd5=_0x51eb28['data'];_0x3b6314['verbose']&&(console[_0x27449b(0xbb)]('Resolved\x20type:\x20'+_0x310dd5[_0x27449b(0xb5)]),console[_0x27449b(0xbb)](_0x27449b(0xd0)+_0x310dd5[_0x27449b(0x106)]),_0x310dd5['folderId']&&console[_0x27449b(0xbb)](_0x27449b(0x9c)+_0x310dd5[_0x27449b(0xf7)]),_0x310dd5[_0x27449b(0xf1)]&&console['error'](_0x27449b(0xba)+_0x310dd5['segmentId']));if(_0x310dd5['type']===_0x27449b(0x104)){const _0x2a1aa6=await withSpinner(_0x27449b(0xec),()=>_0x2826fc[_0x27449b(0xcf)][_0x27449b(0xef)](_0x310dd5[_0x27449b(0x106)]),{'verbose':_0x3b6314[_0x27449b(0xac)]});await handleSingleObjectOutput(_0x2a1aa6[_0x27449b(0xe7)],_0x3b6314);}else{if(_0x310dd5['type']==='folder'){if(!_0x310dd5[_0x27449b(0xf7)])throw new SDKError(ErrorCode[_0x27449b(0xa5)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x96c8bc=await withSpinner(_0x27449b(0xab),()=>_0x2826fc[_0x27449b(0xcf)][_0x27449b(0xdc)](_0x310dd5[_0x27449b(0xf7)]),{'verbose':_0x3b6314[_0x27449b(0xac)]});await handleSingleObjectOutput(_0x96c8bc[_0x27449b(0xe7)],_0x3b6314);}else{if(_0x310dd5['type']==='segment'){if(!_0x310dd5[_0x27449b(0xf1)])throw new SDKError(ErrorCode['INTERNAL'],_0x27449b(0xf4));const _0x3ec3a2=await withSpinner(_0x27449b(0xbc),()=>_0x2826fc[_0x27449b(0xcf)][_0x27449b(0x9b)](_0x310dd5[_0x27449b(0x106)],_0x310dd5[_0x27449b(0xf1)]),{'verbose':_0x3b6314[_0x27449b(0xac)]});await handleSingleObjectOutput(_0x3ec3a2[_0x27449b(0xe7)],_0x3b6314);}}}return 0x0;}catch(_0x22d8eb){if(_0x22d8eb instanceof SDKError)return console[_0x27449b(0xbb)](_0x27449b(0x9d)+_0x22d8eb[_0x27449b(0xd7)]),_0x22d8eb['cause']&&console[_0x27449b(0xbb)](_0x27449b(0xd5)+_0x22d8eb['cause']),0x1;throw _0x22d8eb;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x1e49cb(0x98)]=a25_0x1e49cb(0xf0);[a25_0x1e49cb(0xf6)]=a25_0x1e49cb(0xc1);async[a25_0x1e49cb(0xa4)](_0x4ebc2a){const _0x2fa8dd=a25_0x1e49cb,{options:_0x2c145a,args:_0x8b6952,tdx:_0x9de3d9}=_0x4ebc2a,_0x43a1b5=_0x8b6952[0x0],_0x874e95=!_0x43a1b5&&!!_0x2c145a[_0x2fa8dd(0x100)],_0x5a938b=_0x43a1b5||_0x2c145a[_0x2fa8dd(0x100)];if(!_0x5a938b)return console[_0x2fa8dd(0xbb)](_0x2fa8dd(0xbd)),console[_0x2fa8dd(0xbb)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x2fa8dd(0xbb)](_0x2fa8dd(0xdb)),console[_0x2fa8dd(0xbb)](_0x2fa8dd(0xca)),console[_0x2fa8dd(0xbb)](_0x2fa8dd(0x9a)),console[_0x2fa8dd(0xbb)](_0x2fa8dd(0xc8)),console[_0x2fa8dd(0xbb)](_0x2fa8dd(0xdd)),0x1;try{const _0x3a3d0c=_0x2c145a[_0x2fa8dd(0xc7)];let _0x9fe468=_0x5a938b;!_0x874e95&&_0x3a3d0c&&!_0x5a938b['includes']('/')&&(_0x9fe468=_0x3a3d0c+'/'+_0x5a938b,_0x2c145a[_0x2fa8dd(0xac)]&&console[_0x2fa8dd(0xbb)]('Resolved\x20relative\x20path\x20to:\x20'+_0x9fe468));const _0x16a11e=await withSpinner(_0x2fa8dd(0x102)+_0x9fe468+'\x27...',()=>_0x9de3d9[_0x2fa8dd(0xcf)][_0x2fa8dd(0x99)](_0x9fe468),{'verbose':_0x2c145a[_0x2fa8dd(0xac)]}),_0x385250=_0x16a11e[_0x2fa8dd(0xe7)];_0x2c145a[_0x2fa8dd(0xac)]&&(console[_0x2fa8dd(0xbb)]('Resolved\x20type:\x20'+_0x385250[_0x2fa8dd(0xb5)]),console['error'](_0x2fa8dd(0xd0)+_0x385250['parentId']));if(_0x385250[_0x2fa8dd(0xb5)]===_0x2fa8dd(0xfa))return console[_0x2fa8dd(0xbb)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x2fa8dd(0xbb)](_0x2fa8dd(0xb2)),0x1;let _0x59d9c1;if(_0x385250[_0x2fa8dd(0xb5)]===_0x2fa8dd(0x104)){const _0xc2d948=await withSpinner(_0x2fa8dd(0xb1),()=>_0x9de3d9[_0x2fa8dd(0xcf)][_0x2fa8dd(0xf8)](_0x385250[_0x2fa8dd(0x106)]),{'verbose':_0x2c145a['verbose']});_0x59d9c1=_0xc2d948['data'];}else{if(!_0x385250[_0x2fa8dd(0xf1)])throw new SDKError(ErrorCode[_0x2fa8dd(0xa5)],_0x2fa8dd(0xf4));const _0x5305c9=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x9de3d9[_0x2fa8dd(0xcf)][_0x2fa8dd(0xe1)](_0x385250[_0x2fa8dd(0x106)],_0x385250[_0x2fa8dd(0xf1)]),{'verbose':_0x2c145a[_0x2fa8dd(0xac)]});_0x59d9c1=_0x5305c9[_0x2fa8dd(0xe7)];}const _0x165364=resolveLimit(_0x2c145a[_0x2fa8dd(0xf3)],DEFAULT_DISPLAY_LIMIT),_0x4b826e=/\bLIMIT\s+\d+/i[_0x2fa8dd(0xae)](_0x59d9c1);!_0x4b826e&&(_0x59d9c1=_0x59d9c1['trim']()[_0x2fa8dd(0xee)](/;+$/,''),_0x59d9c1=_0x2fa8dd(0xd1)+_0x59d9c1+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x165364);_0x2c145a[_0x2fa8dd(0xac)]&&console[_0x2fa8dd(0xbb)](_0x2fa8dd(0xc3)+_0x59d9c1);const _0x31c92c=await withQuerySpinner(_0x2fa8dd(0xb0),async _0x400648=>{const _0x1c2c23=_0x2fa8dd,_0x2f658d=await _0x9de3d9[_0x1c2c23(0xa8)]['execute'](_0x59d9c1,{'catalog':'td','schema':_0x1c2c23(0xd6),'onJobId':_0x4b447c=>{const _0x4a9f79=_0x1c2c23;_0x400648[_0x4a9f79(0x101)](_0x4b447c);}});return _0x2f658d;},{'verbose':_0x2c145a[_0x2fa8dd(0xac)]}),_0x25a5d8=_0x31c92c[_0x2fa8dd(0xe7)],_0x539430=_0x25a5d8[_0x2fa8dd(0xfe)]?_0x2fa8dd(0xcc)+_0x25a5d8[_0x2fa8dd(0xfe)]+']':'';return console[_0x2fa8dd(0xbb)](_0x2fa8dd(0x9e)+_0x25a5d8[_0x2fa8dd(0xa2)][_0x2fa8dd(0xa1)][_0x2fa8dd(0x9f)]()+_0x2fa8dd(0xd8)+(_0x2fa8dd(0xd3)+formatElapsed(_0x25a5d8[_0x2fa8dd(0xa2)]['elapsedTimeMillis'])+_0x539430)),await handleQueryOutput(_0x25a5d8,_0x2c145a),0x0;}catch(_0x14dc65){if(_0x14dc65 instanceof SDKError)return console[_0x2fa8dd(0xbb)]('✖\x20Query\x20failed\x20['+_0x14dc65[_0x2fa8dd(0xcb)]+']'),console[_0x2fa8dd(0xbb)]('\x0a'+_0x14dc65['message']),0x1;throw _0x14dc65;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x1e49cb(0x98)]='segment:folder:list';['description']=a25_0x1e49cb(0xde);async[a25_0x1e49cb(0xa4)](_0x5b1851){const _0x59b956=a25_0x1e49cb,{options:_0x594af5,args:_0xa8b354,tdx:_0x149894}=_0x5b1851;if(_0xa8b354['length']===0x0)return console[_0x59b956(0xbb)](_0x59b956(0xc4)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x278ab6=_0xa8b354[0x0];try{_0x594af5['verbose']&&(console[_0x59b956(0xbb)](_0x59b956(0xcd)+_0x594af5['site']),console[_0x59b956(0xbb)]('Parent\x20name:\x20'+_0x278ab6));const _0x53ba76=await withSpinner(_0x59b956(0xc0)+_0x278ab6+_0x59b956(0xd9),()=>_0x149894[_0x59b956(0xcf)]['resolveParentId'](_0x278ab6),{'verbose':_0x594af5['verbose']}),_0x35950d=_0x53ba76[_0x59b956(0xe7)];_0x594af5['verbose']&&console[_0x59b956(0xbb)](_0x59b956(0xda)+_0x35950d);const _0x430dfb=await withSpinner(_0x59b956(0xb4)+_0x278ab6+_0x59b956(0xd9),()=>_0x149894[_0x59b956(0xcf)]['listFolders'](_0x35950d),{'verbose':_0x594af5[_0x59b956(0xac)]}),_0x24d98d=_0x430dfb['data'];return console[_0x59b956(0xbb)](_0x59b956(0x108)+_0x24d98d['length']+_0x59b956(0xdf)+(_0x24d98d['length']!==0x1?'s':'')),await handleSDKOutput(_0x24d98d,_0x594af5),0x0;}catch(_0x36daef){if(_0x36daef instanceof SDKError)return console['error']('Error:\x20'+_0x36daef[_0x59b956(0xd7)]),_0x36daef['cause']&&console[_0x59b956(0xbb)](_0x59b956(0xd5)+_0x36daef['cause']),0x1;throw _0x36daef;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x1e49cb(0x98)]=a25_0x1e49cb(0xad);[a25_0x1e49cb(0xf6)]='Show\x20segment\x20folder\x20details';async[a25_0x1e49cb(0xa4)](_0x5f0381){const _0x71dd7b=a25_0x1e49cb,{options:_0x162818,args:_0x2ecc8a,tdx:_0x5810ac}=_0x5f0381;if(_0x2ecc8a[_0x71dd7b(0xfb)]===0x0)return console[_0x71dd7b(0xbb)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x71dd7b(0xbb)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x3ccbc5,childId:_0x1144e8}=parseSegmentRef(_0x2ecc8a[0x0]);_0x162818[_0x71dd7b(0xac)]&&(console[_0x71dd7b(0xbb)]('Site:\x20'+_0x162818[_0x71dd7b(0xe9)]),console[_0x71dd7b(0xbb)]('Parent\x20name:\x20'+_0x3ccbc5),_0x1144e8&&console[_0x71dd7b(0xbb)](_0x71dd7b(0xa6)+_0x1144e8));if(!_0x1144e8)return console[_0x71dd7b(0xbb)](_0x71dd7b(0xaf)),0x1;const _0x30ba8b=await withSpinner(_0x71dd7b(0xc0)+_0x3ccbc5+_0x71dd7b(0xd9),()=>_0x5810ac[_0x71dd7b(0xcf)]['resolveParentId'](_0x3ccbc5),{'verbose':_0x162818[_0x71dd7b(0xac)]}),_0xdab1ea=_0x30ba8b[_0x71dd7b(0xe7)];_0x162818[_0x71dd7b(0xac)]&&console['error'](_0x71dd7b(0xda)+_0xdab1ea);const _0x3183e0=await withSpinner(_0x71dd7b(0xce)+_0x1144e8+_0x71dd7b(0xd9),()=>_0x5810ac[_0x71dd7b(0xcf)][_0x71dd7b(0xbe)](_0xdab1ea,_0x1144e8),{'verbose':_0x162818['verbose']}),_0x5f2360=_0x3183e0[_0x71dd7b(0xe7)];_0x162818[_0x71dd7b(0xac)]&&console[_0x71dd7b(0xbb)](_0x71dd7b(0xc9)+_0x5f2360);const _0x4829ca=await withSpinner(_0x71dd7b(0xbf)+_0x1144e8+'\x27...',()=>_0x5810ac[_0x71dd7b(0xcf)][_0x71dd7b(0xdc)](_0x5f2360),{'verbose':_0x162818['verbose']});return await handleSDKOutput([_0x4829ca[_0x71dd7b(0xe7)]],_0x162818),0x0;}catch(_0x4d44a4){if(_0x4d44a4 instanceof SDKError)return console[_0x71dd7b(0xbb)]('Error:\x20'+_0x4d44a4[_0x71dd7b(0xd7)]),_0x4d44a4['cause']&&console[_0x71dd7b(0xbb)](_0x71dd7b(0xd5)+_0x4d44a4[_0x71dd7b(0xe3)]),0x1;throw _0x4d44a4;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x1e49cb(0x98)]=a25_0x1e49cb(0xf5);[a25_0x1e49cb(0xf6)]=a25_0x1e49cb(0xea);async[a25_0x1e49cb(0xa4)](_0x1c0e26){const _0x103237=a25_0x1e49cb,{options:_0xeedd2c,args:_0x203188,tdx:_0x41729a}=_0x1c0e26,_0x1013ac=_0x203188[0x0],_0x59c1d6=!_0x1013ac&&!!_0xeedd2c['parentSegment'],_0x23e8f2=_0x1013ac||_0xeedd2c['parentSegment'];if(!_0x23e8f2)return console[_0x103237(0xbb)](_0x103237(0xbd)),console[_0x103237(0xbb)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console['error'](_0x103237(0xdb)),console['error'](_0x103237(0x103)),console['error'](_0x103237(0xa7)),console['error'](_0x103237(0xc5)),console[_0x103237(0xbb)](_0x103237(0xdd)),0x1;try{const _0x393855=_0xeedd2c[_0x103237(0xc7)];let _0x10a4db=_0x23e8f2;!_0x59c1d6&&_0x393855&&!_0x23e8f2[_0x103237(0xc6)]('/')&&(_0x10a4db=_0x393855+'/'+_0x23e8f2,_0xeedd2c[_0x103237(0xac)]&&console[_0x103237(0xbb)](_0x103237(0xf2)+_0x10a4db));const _0x47198f=await withSpinner('Resolving\x20path\x20\x27'+_0x10a4db+_0x103237(0xd9),()=>_0x41729a[_0x103237(0xcf)]['resolvePathToResource'](_0x10a4db),{'verbose':_0xeedd2c[_0x103237(0xac)]}),_0x3addbc=_0x47198f[_0x103237(0xe7)];_0xeedd2c['verbose']&&(console[_0x103237(0xbb)](_0x103237(0xe5)+_0x3addbc[_0x103237(0xb5)]),console['error'](_0x103237(0xd0)+_0x3addbc[_0x103237(0x106)]));if(_0x3addbc[_0x103237(0xb5)]==='folder')return console['error'](_0x103237(0xe4)),console[_0x103237(0xbb)](_0x103237(0xd4)),0x1;let _0x4ece70;if(_0x3addbc[_0x103237(0xb5)]===_0x103237(0x104)){const _0x2934ca=await withSpinner(_0x103237(0xb1),()=>_0x41729a[_0x103237(0xcf)]['getParentSQL'](_0x3addbc[_0x103237(0x106)]),{'verbose':_0xeedd2c[_0x103237(0xac)]});_0x4ece70=_0x2934ca[_0x103237(0xe7)];}else{if(!_0x3addbc['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x254379=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x41729a[_0x103237(0xcf)][_0x103237(0xe1)](_0x3addbc['parentId'],_0x3addbc[_0x103237(0xf1)]),{'verbose':_0xeedd2c[_0x103237(0xac)]});_0x4ece70=_0x254379[_0x103237(0xe7)];}return _0xeedd2c[_0x103237(0xed)]==='json'||_0xeedd2c['format']===_0x103237(0xb7)?await handleSDKOutput([{'sql':_0x4ece70}],_0xeedd2c):console['log'](_0x4ece70),0x0;}catch(_0x2982ce){if(_0x2982ce instanceof SDKError)return console[_0x103237(0xbb)](_0x103237(0x9d)+_0x2982ce[_0x103237(0xd7)]),_0x2982ce[_0x103237(0xe3)]&&console[_0x103237(0xbb)](_0x103237(0xd5)+_0x2982ce[_0x103237(0xe3)]),0x1;throw _0x2982ce;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a25_0x1e49cb(0xf6)]=a25_0x1e49cb(0xd2);async[a25_0x1e49cb(0xa4)](_0x4bf3c1){const _0x2d6980=a25_0x1e49cb,{options:_0x437a24,args:_0x831ec2,tdx:_0x223456}=_0x4bf3c1,_0x3ecae7=_0x437a24;if(_0x831ec2['length']<0x2)return console[_0x2d6980(0xbb)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x5a9844=_0x831ec2[0x0],_0x2b589f=_0x831ec2[0x1];_0x3ecae7[_0x2d6980(0xac)]&&(console['error'](_0x2d6980(0xcd)+_0x3ecae7[_0x2d6980(0xe9)]),console['error']('Parent\x20segment:\x20'+_0x5a9844),console[_0x2d6980(0xbb)](_0x2d6980(0xa6)+_0x2b589f));let _0x29c05e;if(_0x3ecae7[_0x2d6980(0xa3)]){const _0x3ce526=_0x3ecae7[_0x2d6980(0xa3)],_0x477169=await withSpinner(_0x2d6980(0xc0)+_0x5a9844+'\x27...',()=>_0x223456[_0x2d6980(0xcf)]['resolveParentId'](_0x5a9844),{'verbose':_0x3ecae7['verbose']}),_0x5d80aa=_0x477169[_0x2d6980(0xe7)],_0x2b0634=await withSpinner(_0x2d6980(0xb3)+_0x3ce526+_0x2d6980(0xd9),()=>_0x223456[_0x2d6980(0xcf)][_0x2d6980(0xbe)](_0x5d80aa,_0x3ce526),{'verbose':_0x3ecae7[_0x2d6980(0xac)]});_0x29c05e=_0x2b0634[_0x2d6980(0xe7)],_0x3ecae7['verbose']&&console[_0x2d6980(0xbb)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x29c05e);}const _0x45cc3c={'name':_0x2b589f,'description':_0x3ecae7[_0x2d6980(0xf6)],'parentFolderId':_0x29c05e},_0x5ad170=await withSpinner('Creating\x20folder\x20\x27'+_0x2b589f+_0x2d6980(0xd9),()=>_0x223456[_0x2d6980(0xcf)]['createFolder'](_0x5a9844,_0x45cc3c),{'verbose':_0x3ecae7[_0x2d6980(0xac)]}),_0x5624fa=_0x5ad170[_0x2d6980(0xe7)];return console[_0x2d6980(0xbb)](_0x2d6980(0xf9)+_0x5624fa[_0x2d6980(0x98)]+_0x2d6980(0x105)+_0x5624fa['id']),await handleSDKOutput([_0x5624fa],_0x3ecae7),0x0;}}
|
|
1
|
+
function a25_0x6f8b(){const _0x475cc4=['error','\x27\x20with\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','SELECT\x20*\x20FROM\x20(\x0a','getParent','Examples:','Resolving\x20parent\x20folder\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','folderId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20show\x20<path>','\x20rows\x20','Error:\x20','cause','4VCaAJM','log','Fetching\x20folder\x20details...','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','name','parentFolder','INTERNAL','Resolving\x20parent\x20segment\x20\x27','segmentPath','getSegment','format','parent','folder','Site:\x20','type','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','getSegmentSQL','4nsDItI','Executing\x20segment\x20query...','\x27...','Parent\x20segment:\x20','execute','length','Show\x20segment\x20folder\x20details','listFolders','resolvePathToResource','trim','Usage:\x20tdx\x20segment\x20sql\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','json','✖\x20Query\x20failed\x20[','segment:folder:list','178407UUqJBb','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20type:\x20','segmentId','4911080kYQcPh','parentId','Error:\x20Parent\x20segment\x20name\x20is\x20required','site','Fetching\x20folder\x20\x27','jobId','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','elapsedTimeMillis','in\x20','✔\x20Found\x20','Creating\x20folder\x20\x27','segment','✔\x20Query\x20completed:\x20Processed\x20','replace','description','Show\x20segment\x20or\x20folder\x20details','Folder\x20ID:\x20','query','507085wQRyXX','21197946YqHZEO','2466600shmbEi','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','jsonl','segment:folder:create','Fetching\x20parent\x20segment\x20details...','verbose','✔\x20Created\x20folder\x20\x27','resolveFolderId','processedRows','message','Fetching\x20SQL\x20for\x20segment...','createFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20Path\x20or\x20name\x20is\x20required','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','1031859uMEnZJ','Resolving\x20path\x20\x27','60893YBbIYY','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:describe','248zckXGY','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','includes','getFolder','Resolved\x20relative\x20path\x20to:\x20','code','Usage:\x20tdx\x20segment\x20describe\x20<path>','Parent\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','84dyxcZH','parentSegment','data','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','test','\x20\x20Cause:\x20','Parent\x20ID:\x20','limit','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','information_schema','Resolved\x20parent\x20ID:\x20','getParentSQL','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','resolveParentId','Resolved\x20folder\x20ID:\x20','Resolving\x20folder\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','setJobId'];a25_0x6f8b=function(){return _0x475cc4;};return a25_0x6f8b();}const a25_0x15c124=a25_0x3915;(function(_0x1edfa0,_0x4334d2){const _0x28cd45=a25_0x3915,_0x216b98=_0x1edfa0();while(!![]){try{const _0x42df5b=-parseInt(_0x28cd45(0xcd))/0x1*(-parseInt(_0x28cd45(0x11f))/0x2)+parseInt(_0x28cd45(0xdf))/0x3+-parseInt(_0x28cd45(0x10e))/0x4*(-parseInt(_0x28cd45(0x133))/0x5)+parseInt(_0x28cd45(0xee))/0x6*(-parseInt(_0x28cd45(0xe1))/0x7)+-parseInt(_0x28cd45(0xe4))/0x8*(-parseInt(_0x28cd45(0x12f))/0x9)+-parseInt(_0x28cd45(0xcf))/0xa+-parseInt(_0x28cd45(0xce))/0xb;if(_0x42df5b===_0x4334d2)break;else _0x216b98['push'](_0x216b98['shift']());}catch(_0x2bf282){_0x216b98['push'](_0x216b98['shift']());}}}(a25_0x6f8b,0xa0f78));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}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';function a25_0x3915(_0x185223,_0x399166){const _0x6f8b7d=a25_0x6f8b();return a25_0x3915=function(_0x3915ad,_0x5cde36){_0x3915ad=_0x3915ad-0xc5;let _0x158695=_0x6f8b7d[_0x3915ad];return _0x158695;},a25_0x3915(_0x185223,_0x399166);}export class SegmentDescribeCommand extends BaseCommand{[a25_0x15c124(0x112)]=a25_0x15c124(0xe3);[a25_0x15c124(0xc9)]=a25_0x15c124(0xca);async[a25_0x15c124(0x123)](_0x239716){const _0x3dac85=a25_0x15c124,{options:_0x315d08,args:_0xf898f0,tdx:_0x2ec315}=_0x239716,_0x5b9330=_0xf898f0[0x0],_0x548f7c=!_0x5b9330&&!!_0x315d08['parentSegment'],_0x380002=_0x5b9330||_0x315d08[_0x3dac85(0xef)];if(!_0x380002)return console['error'](_0x3dac85(0xdd)),console[_0x3dac85(0x100)](_0x3dac85(0xeb)),console[_0x3dac85(0x100)](_0x3dac85(0x105)),console[_0x3dac85(0x100)](_0x3dac85(0xf1)),console[_0x3dac85(0x100)](_0x3dac85(0xdb)),console[_0x3dac85(0x100)](_0x3dac85(0xed)),console[_0x3dac85(0x100)](_0x3dac85(0x12b)),0x1;try{const _0x3b342e=_0x315d08[_0x3dac85(0x116)];let _0xb1d3af=_0x380002;!_0x548f7c&&_0x3b342e&&!_0x380002[_0x3dac85(0xe7)]('/')&&(_0xb1d3af=_0x3b342e+'/'+_0x380002,_0x315d08[_0x3dac85(0xd4)]&&console[_0x3dac85(0x100)]('Resolved\x20relative\x20path\x20to:\x20'+_0xb1d3af));const _0xbeacd6=await withSpinner(_0x3dac85(0xe0)+_0xb1d3af+_0x3dac85(0x121),()=>_0x2ec315[_0x3dac85(0xc6)][_0x3dac85(0x127)](_0xb1d3af),{'verbose':_0x315d08['verbose']}),_0x50f256=_0xbeacd6[_0x3dac85(0xf0)];_0x315d08[_0x3dac85(0xd4)]&&(console[_0x3dac85(0x100)](_0x3dac85(0x131)+_0x50f256[_0x3dac85(0x11c)]),console['error']('Parent\x20ID:\x20'+_0x50f256['parentId']),_0x50f256['folderId']&&console[_0x3dac85(0x100)](_0x3dac85(0xcb)+_0x50f256[_0x3dac85(0x108)]),_0x50f256[_0x3dac85(0x132)]&&console[_0x3dac85(0x100)]('Segment\x20ID:\x20'+_0x50f256[_0x3dac85(0x132)]));if(_0x50f256[_0x3dac85(0x11c)]==='parent'){const _0x50a450=await withSpinner(_0x3dac85(0xd3),()=>_0x2ec315[_0x3dac85(0xc6)][_0x3dac85(0x104)](_0x50f256[_0x3dac85(0x134)]),{'verbose':_0x315d08[_0x3dac85(0xd4)]});await handleSingleObjectOutput(_0x50a450[_0x3dac85(0xf0)],_0x315d08);}else{if(_0x50f256[_0x3dac85(0x11c)]===_0x3dac85(0x11a)){if(!_0x50f256[_0x3dac85(0x108)])throw new SDKError(ErrorCode[_0x3dac85(0x114)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3e6086=await withSpinner(_0x3dac85(0x110),()=>_0x2ec315[_0x3dac85(0xc6)][_0x3dac85(0xe8)](_0x50f256[_0x3dac85(0x108)]),{'verbose':_0x315d08[_0x3dac85(0xd4)]});await handleSingleObjectOutput(_0x3e6086[_0x3dac85(0xf0)],_0x315d08);}else{if(_0x50f256[_0x3dac85(0x11c)]===_0x3dac85(0xc6)){if(!_0x50f256[_0x3dac85(0x132)])throw new SDKError(ErrorCode[_0x3dac85(0x114)],_0x3dac85(0x102));const _0x3aba0b=await withSpinner('Fetching\x20segment\x20details...',()=>_0x2ec315[_0x3dac85(0xc6)][_0x3dac85(0x117)](_0x50f256['parentId'],_0x50f256[_0x3dac85(0x132)]),{'verbose':_0x315d08[_0x3dac85(0xd4)]});await handleSingleObjectOutput(_0x3aba0b[_0x3dac85(0xf0)],_0x315d08);}}}return 0x0;}catch(_0x7eb1a6){if(_0x7eb1a6 instanceof SDKError)return console[_0x3dac85(0x100)](_0x3dac85(0x10c)+_0x7eb1a6[_0x3dac85(0xd8)]),_0x7eb1a6[_0x3dac85(0x10d)]&&console[_0x3dac85(0x100)](_0x3dac85(0xf3)+_0x7eb1a6[_0x3dac85(0x10d)]),0x1;throw _0x7eb1a6;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';[a25_0x15c124(0xc9)]='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a25_0x15c124(0x123)](_0x38d1d8){const _0x4e7b1d=a25_0x15c124,{options:_0x233f15,args:_0x28a870,tdx:_0x540aeb}=_0x38d1d8,_0x23ba64=_0x28a870[0x0],_0x20c89a=!_0x23ba64&&!!_0x233f15[_0x4e7b1d(0xef)],_0x287ffb=_0x23ba64||_0x233f15['parentSegment'];if(!_0x287ffb)return console[_0x4e7b1d(0x100)](_0x4e7b1d(0x109)),console[_0x4e7b1d(0x100)](_0x4e7b1d(0x10a)),console[_0x4e7b1d(0x100)](_0x4e7b1d(0x105)),console[_0x4e7b1d(0x100)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x4e7b1d(0x100)](_0x4e7b1d(0xe2)),console[_0x4e7b1d(0x100)](_0x4e7b1d(0x11d)),console[_0x4e7b1d(0x100)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x36d5a3=_0x233f15[_0x4e7b1d(0x116)];let _0x1e9dc4=_0x287ffb;!_0x20c89a&&_0x36d5a3&&!_0x287ffb[_0x4e7b1d(0xe7)]('/')&&(_0x1e9dc4=_0x36d5a3+'/'+_0x287ffb,_0x233f15[_0x4e7b1d(0xd4)]&&console[_0x4e7b1d(0x100)](_0x4e7b1d(0xe9)+_0x1e9dc4));const _0x197d99=await withSpinner(_0x4e7b1d(0xe0)+_0x1e9dc4+_0x4e7b1d(0x121),()=>_0x540aeb['segment'][_0x4e7b1d(0x127)](_0x1e9dc4),{'verbose':_0x233f15['verbose']}),_0xe0b1bb=_0x197d99[_0x4e7b1d(0xf0)];_0x233f15[_0x4e7b1d(0xd4)]&&(console['error'](_0x4e7b1d(0x131)+_0xe0b1bb[_0x4e7b1d(0x11c)]),console['error'](_0x4e7b1d(0xf4)+_0xe0b1bb[_0x4e7b1d(0x134)]));if(_0xe0b1bb[_0x4e7b1d(0x11c)]===_0x4e7b1d(0x11a))return console[_0x4e7b1d(0x100)](_0x4e7b1d(0xfe)),console['error']('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x324610;if(_0xe0b1bb[_0x4e7b1d(0x11c)]===_0x4e7b1d(0x119)){const _0x518dfc=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x540aeb[_0x4e7b1d(0xc6)][_0x4e7b1d(0xf9)](_0xe0b1bb[_0x4e7b1d(0x134)]),{'verbose':_0x233f15[_0x4e7b1d(0xd4)]});_0x324610=_0x518dfc[_0x4e7b1d(0xf0)];}else{if(!_0xe0b1bb[_0x4e7b1d(0x132)])throw new SDKError(ErrorCode[_0x4e7b1d(0x114)],_0x4e7b1d(0x102));const _0x234910=await withSpinner(_0x4e7b1d(0xd9),()=>_0x540aeb[_0x4e7b1d(0xc6)][_0x4e7b1d(0x11e)](_0xe0b1bb[_0x4e7b1d(0x134)],_0xe0b1bb['segmentId']),{'verbose':_0x233f15[_0x4e7b1d(0xd4)]});_0x324610=_0x234910[_0x4e7b1d(0xf0)];}const _0x39f23f=resolveLimit(_0x233f15[_0x4e7b1d(0xf5)],DEFAULT_DISPLAY_LIMIT),_0x4051c4=/\bLIMIT\s+\d+/i[_0x4e7b1d(0xf2)](_0x324610);!_0x4051c4&&(_0x324610=_0x324610[_0x4e7b1d(0x128)]()[_0x4e7b1d(0xc8)](/;+$/,''),_0x324610=_0x4e7b1d(0x103)+_0x324610+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x39f23f);_0x233f15[_0x4e7b1d(0xd4)]&&console['error']('SQL\x20query:\x0a'+_0x324610);const _0x45cd9d=await withQuerySpinner(_0x4e7b1d(0x120),async _0x561463=>{const _0x5b7fac=_0x4e7b1d,_0x40fb20=await _0x540aeb[_0x5b7fac(0xcc)]['execute'](_0x324610,{'catalog':'td','schema':_0x5b7fac(0xf7),'onJobId':_0x1006e9=>{const _0x1f9583=_0x5b7fac;_0x561463[_0x1f9583(0xff)](_0x1006e9);}});return _0x40fb20;},{'verbose':_0x233f15['verbose']}),_0x14897f=_0x45cd9d['data'],_0x429f12=_0x14897f[_0x4e7b1d(0x138)]?'\x20[Job\x20ID:\x20'+_0x14897f['jobId']+']':'';return console[_0x4e7b1d(0x100)](_0x4e7b1d(0xc7)+_0x14897f['stats'][_0x4e7b1d(0xd7)]['toLocaleString']()+_0x4e7b1d(0x10b)+(_0x4e7b1d(0x13b)+formatElapsed(_0x14897f['stats'][_0x4e7b1d(0x13a)])+_0x429f12)),await handleQueryOutput(_0x14897f,_0x233f15),0x0;}catch(_0x564381){if(_0x564381 instanceof SDKError)return console[_0x4e7b1d(0x100)](_0x4e7b1d(0x12d)+_0x564381[_0x4e7b1d(0xea)]+']'),console[_0x4e7b1d(0x100)]('\x0a'+_0x564381['message']),0x1;throw _0x564381;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x15c124(0x112)]=a25_0x15c124(0x12e);['description']='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a25_0x15c124(0x123)](_0x579ac5){const _0x5393a6=a25_0x15c124,{options:_0x60c820,args:_0x4a5820,tdx:_0x37dfba}=_0x579ac5;if(_0x4a5820[_0x5393a6(0x124)]===0x0)return console[_0x5393a6(0x100)](_0x5393a6(0x135)),console['error'](_0x5393a6(0x12a)),0x1;const _0x3ab948=_0x4a5820[0x0];try{_0x60c820['verbose']&&(console['error'](_0x5393a6(0x11b)+_0x60c820['site']),console[_0x5393a6(0x100)](_0x5393a6(0xec)+_0x3ab948));const _0x32520c=await withSpinner(_0x5393a6(0x115)+_0x3ab948+_0x5393a6(0x121),()=>_0x37dfba['segment'][_0x5393a6(0xfb)](_0x3ab948),{'verbose':_0x60c820[_0x5393a6(0xd4)]}),_0x3ca0a4=_0x32520c[_0x5393a6(0xf0)];_0x60c820[_0x5393a6(0xd4)]&&console[_0x5393a6(0x100)](_0x5393a6(0xf8)+_0x3ca0a4);const _0x14189a=await withSpinner(_0x5393a6(0x107)+_0x3ab948+_0x5393a6(0x121),()=>_0x37dfba['segment'][_0x5393a6(0x126)](_0x3ca0a4),{'verbose':_0x60c820[_0x5393a6(0xd4)]}),_0x301d0d=_0x14189a[_0x5393a6(0xf0)];return console[_0x5393a6(0x100)](_0x5393a6(0x13c)+_0x301d0d[_0x5393a6(0x124)]+'\x20folder'+(_0x301d0d[_0x5393a6(0x124)]!==0x1?'s':'')),await handleSDKOutput(_0x301d0d,_0x60c820),0x0;}catch(_0x3e1331){if(_0x3e1331 instanceof SDKError)return console['error'](_0x5393a6(0x10c)+_0x3e1331[_0x5393a6(0xd8)]),_0x3e1331[_0x5393a6(0x10d)]&&console['error'](_0x5393a6(0xf3)+_0x3e1331[_0x5393a6(0x10d)]),0x1;throw _0x3e1331;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x15c124(0x112)]='segment:folder:show';['description']=a25_0x15c124(0x125);async[a25_0x15c124(0x123)](_0x4d659e){const _0x223219=a25_0x15c124,{options:_0x54352b,args:_0x110592,tdx:_0x3a3941}=_0x4d659e;if(_0x110592[_0x223219(0x124)]===0x0)return console[_0x223219(0x100)](_0x223219(0x130)),console[_0x223219(0x100)](_0x223219(0xf6)),0x1;try{const {parentId:_0x59ae7c,childId:_0xfecd51}=parseSegmentRef(_0x110592[0x0]);_0x54352b[_0x223219(0xd4)]&&(console[_0x223219(0x100)]('Site:\x20'+_0x54352b[_0x223219(0x136)]),console['error'](_0x223219(0xec)+_0x59ae7c),_0xfecd51&&console[_0x223219(0x100)]('Folder\x20name:\x20'+_0xfecd51));if(!_0xfecd51)return console[_0x223219(0x100)](_0x223219(0x111)),0x1;const _0x1e3aa9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x59ae7c+'\x27...',()=>_0x3a3941[_0x223219(0xc6)][_0x223219(0xfb)](_0x59ae7c),{'verbose':_0x54352b[_0x223219(0xd4)]}),_0x539f96=_0x1e3aa9[_0x223219(0xf0)];_0x54352b[_0x223219(0xd4)]&&console[_0x223219(0x100)](_0x223219(0xf8)+_0x539f96);const _0x147a71=await withSpinner(_0x223219(0xfd)+_0xfecd51+_0x223219(0x121),()=>_0x3a3941['segment'][_0x223219(0xd6)](_0x539f96,_0xfecd51),{'verbose':_0x54352b[_0x223219(0xd4)]}),_0x234923=_0x147a71['data'];_0x54352b[_0x223219(0xd4)]&&console[_0x223219(0x100)](_0x223219(0xfc)+_0x234923);const _0xa87699=await withSpinner(_0x223219(0x137)+_0xfecd51+_0x223219(0x121),()=>_0x3a3941[_0x223219(0xc6)][_0x223219(0xe8)](_0x234923),{'verbose':_0x54352b[_0x223219(0xd4)]});return await handleSDKOutput([_0xa87699[_0x223219(0xf0)]],_0x54352b),0x0;}catch(_0x393ed0){if(_0x393ed0 instanceof SDKError)return console['error']('Error:\x20'+_0x393ed0[_0x223219(0xd8)]),_0x393ed0[_0x223219(0x10d)]&&console['error'](_0x223219(0xf3)+_0x393ed0[_0x223219(0x10d)]),0x1;throw _0x393ed0;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x15c124(0x112)]='segment:sql';[a25_0x15c124(0xc9)]=a25_0x15c124(0xe5);async[a25_0x15c124(0x123)](_0x1db591){const _0x5d5c89=a25_0x15c124,{options:_0x11de56,args:_0x273500,tdx:_0x240785}=_0x1db591,_0x1575b7=_0x273500[0x0],_0x1c5001=!_0x1575b7&&!!_0x11de56[_0x5d5c89(0xef)],_0x392b42=_0x1575b7||_0x11de56[_0x5d5c89(0xef)];if(!_0x392b42)return console[_0x5d5c89(0x100)](_0x5d5c89(0x109)),console[_0x5d5c89(0x100)](_0x5d5c89(0x129)),console[_0x5d5c89(0x100)](_0x5d5c89(0x105)),console[_0x5d5c89(0x100)](_0x5d5c89(0xe6)),console[_0x5d5c89(0x100)](_0x5d5c89(0x139)),console[_0x5d5c89(0x100)](_0x5d5c89(0xd0)),console[_0x5d5c89(0x100)](_0x5d5c89(0x12b)),0x1;try{const _0x4715d5=_0x11de56[_0x5d5c89(0x116)];let _0x4718e6=_0x392b42;!_0x1c5001&&_0x4715d5&&!_0x392b42['includes']('/')&&(_0x4718e6=_0x4715d5+'/'+_0x392b42,_0x11de56['verbose']&&console[_0x5d5c89(0x100)](_0x5d5c89(0xe9)+_0x4718e6));const _0x75663b=await withSpinner(_0x5d5c89(0xe0)+_0x4718e6+_0x5d5c89(0x121),()=>_0x240785['segment'][_0x5d5c89(0x127)](_0x4718e6),{'verbose':_0x11de56[_0x5d5c89(0xd4)]}),_0x44198f=_0x75663b['data'];_0x11de56['verbose']&&(console[_0x5d5c89(0x100)](_0x5d5c89(0x131)+_0x44198f[_0x5d5c89(0x11c)]),console[_0x5d5c89(0x100)]('Parent\x20ID:\x20'+_0x44198f[_0x5d5c89(0x134)]));if(_0x44198f['type']===_0x5d5c89(0x11a))return console['error'](_0x5d5c89(0xdc)),console[_0x5d5c89(0x100)](_0x5d5c89(0xde)),0x1;let _0x3dfece;if(_0x44198f[_0x5d5c89(0x11c)]===_0x5d5c89(0x119)){const _0x3acb69=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x240785['segment'][_0x5d5c89(0xf9)](_0x44198f['parentId']),{'verbose':_0x11de56['verbose']});_0x3dfece=_0x3acb69['data'];}else{if(!_0x44198f[_0x5d5c89(0x132)])throw new SDKError(ErrorCode['INTERNAL'],_0x5d5c89(0x102));const _0x5e2894=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x240785[_0x5d5c89(0xc6)][_0x5d5c89(0x11e)](_0x44198f[_0x5d5c89(0x134)],_0x44198f[_0x5d5c89(0x132)]),{'verbose':_0x11de56[_0x5d5c89(0xd4)]});_0x3dfece=_0x5e2894[_0x5d5c89(0xf0)];}return _0x11de56[_0x5d5c89(0x118)]===_0x5d5c89(0x12c)||_0x11de56[_0x5d5c89(0x118)]===_0x5d5c89(0xd1)?await handleSDKOutput([{'sql':_0x3dfece}],_0x11de56):console[_0x5d5c89(0x10f)](_0x3dfece),0x0;}catch(_0x9b1e02){if(_0x9b1e02 instanceof SDKError)return console[_0x5d5c89(0x100)](_0x5d5c89(0x10c)+_0x9b1e02[_0x5d5c89(0xd8)]),_0x9b1e02['cause']&&console[_0x5d5c89(0x100)]('\x20\x20Cause:\x20'+_0x9b1e02[_0x5d5c89(0x10d)]),0x1;throw _0x9b1e02;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x15c124(0x112)]=a25_0x15c124(0xd2);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x15c124(0x123)](_0x292458){const _0x4f9487=a25_0x15c124,{options:_0x302cfa,args:_0x473409,tdx:_0x2108fe}=_0x292458,_0x8b89f9=_0x302cfa;if(_0x473409[_0x4f9487(0x124)]<0x2)return console[_0x4f9487(0x100)](_0x4f9487(0xfa)),console[_0x4f9487(0x100)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x36ab76=_0x473409[0x0],_0x19be06=_0x473409[0x1];_0x8b89f9[_0x4f9487(0xd4)]&&(console[_0x4f9487(0x100)](_0x4f9487(0x11b)+_0x8b89f9[_0x4f9487(0x136)]),console[_0x4f9487(0x100)](_0x4f9487(0x122)+_0x36ab76),console['error']('Folder\x20name:\x20'+_0x19be06));let _0x2eefc4;if(_0x8b89f9['parentFolder']){const _0x34c054=_0x8b89f9[_0x4f9487(0x113)],_0x539e2e=await withSpinner(_0x4f9487(0x115)+_0x36ab76+_0x4f9487(0x121),()=>_0x2108fe[_0x4f9487(0xc6)]['resolveParentId'](_0x36ab76),{'verbose':_0x8b89f9[_0x4f9487(0xd4)]}),_0x2480f0=_0x539e2e[_0x4f9487(0xf0)],_0x4ba96a=await withSpinner(_0x4f9487(0x106)+_0x34c054+_0x4f9487(0x121),()=>_0x2108fe[_0x4f9487(0xc6)][_0x4f9487(0xd6)](_0x2480f0,_0x34c054),{'verbose':_0x8b89f9[_0x4f9487(0xd4)]});_0x2eefc4=_0x4ba96a['data'],_0x8b89f9[_0x4f9487(0xd4)]&&console[_0x4f9487(0x100)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x2eefc4);}const _0x14605b={'name':_0x19be06,'description':_0x8b89f9[_0x4f9487(0xc9)],'parentFolderId':_0x2eefc4},_0x32126b=await withSpinner(_0x4f9487(0xc5)+_0x19be06+_0x4f9487(0x121),()=>_0x2108fe[_0x4f9487(0xc6)][_0x4f9487(0xda)](_0x36ab76,_0x14605b),{'verbose':_0x8b89f9['verbose']}),_0x2e8de0=_0x32126b[_0x4f9487(0xf0)];return console[_0x4f9487(0x100)](_0x4f9487(0xd5)+_0x2e8de0[_0x4f9487(0x112)]+_0x4f9487(0x101)+_0x2e8de0['id']),await handleSDKOutput([_0x2e8de0],_0x8b89f9),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x30ce8d=a26_0x5d6d;(function(_0x52b78f,_0x4dcb34){const _0xf24e76=a26_0x5d6d,_0x27ed35=_0x52b78f();while(!![]){try{const _0x17f71b=-parseInt(_0xf24e76(0xb7))/0x1*(parseInt(_0xf24e76(0xc3))/0x2)+parseInt(_0xf24e76(0xb8))/0x3+parseInt(_0xf24e76(0xca))/0x4+-parseInt(_0xf24e76(0xb1))/0x5*(-parseInt(_0xf24e76(0xdb))/0x6)+parseInt(_0xf24e76(0xdd))/0x7+-parseInt(_0xf24e76(0xb5))/0x8*(parseInt(_0xf24e76(0xdc))/0x9)+-parseInt(_0xf24e76(0xcf))/0xa;if(_0x17f71b===_0x4dcb34)break;else _0x27ed35['push'](_0x27ed35['shift']());}catch(_0x18d6f4){_0x27ed35['push'](_0x27ed35['shift']());}}}(a26_0x5395,0xb8c11));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a26_0x5d6d(_0x43d277,_0x32af43){const _0x5395d7=a26_0x5395();return a26_0x5d6d=function(_0x5d6df1,_0x446a0a){_0x5d6df1=_0x5d6df1-0xac;let _0x374b0f=_0x5395d7[_0x5d6df1];return _0x374b0f;},a26_0x5d6d(_0x43d277,_0x32af43);}import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x5395(){const _0x6fc99f=['1564192whYqvE','type','Resolved\x20relative\x20path\x20to:\x20','invisible','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','createSegment','5xHVrFU','includes','segment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','1601528WReLls','error','99xvvzuF','3861225HAqgOn','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','kind','✔\x20Created\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','site','folder','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','name','\x27\x20with\x20ID:\x20','13132wJaFOl','Parent:\x20','description','\x27...','Resolving\x20folder\x20path\x20\x27','noCountPopulation','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','3675372DlTmal','Target\x20path:\x20','folderId','verbose','segmentPath','14109360vzBtEe','length','Segment\x20name:\x20','segment:create','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','parent','Site:\x20','segments','Resolving\x20folder\x20\x27','\x20\x20\x20Path:\x20','Examples:','4732386dqLcoB','18rfdBIS'];a26_0x5395=function(){return _0x6fc99f;};return a26_0x5395();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a26_0x30ce8d(0xc1)]=a26_0x30ce8d(0xd2);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a26_0x30ce8d(0xaf)](_0x1e0a21){const _0x8bf6b=a26_0x30ce8d,{options:_0x59a94f,args:_0x49f1a3,tdx:_0xe8c863}=_0x1e0a21,_0x532d60=_0x59a94f;if(_0x49f1a3[_0x8bf6b(0xd0)]===0x0)return console[_0x8bf6b(0xb6)](_0x8bf6b(0xae)),console['error'](_0x8bf6b(0xb4)),console[_0x8bf6b(0xb6)](_0x8bf6b(0xda)),console[_0x8bf6b(0xb6)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x8bf6b(0xb6)](_0x8bf6b(0xba)),console[_0x8bf6b(0xb6)](_0x8bf6b(0xc9)),0x1;const _0x469bed=_0x49f1a3[0x0],_0x431527=_0x59a94f[_0x8bf6b(0xce)];let _0x275cae=_0x469bed;_0x431527&&!_0x469bed[_0x8bf6b(0xb2)]('/')&&(_0x275cae=_0x431527+'/'+_0x469bed,_0x532d60[_0x8bf6b(0xcd)]&&console[_0x8bf6b(0xb6)](_0x8bf6b(0xac)+_0x275cae));const _0x22a24b=parsePath(_0x275cae);if(_0x22a24b[_0x8bf6b(0xd7)][_0x8bf6b(0xd0)]<0x2)return console[_0x8bf6b(0xb6)](_0x8bf6b(0xc0)),console['error'](_0x8bf6b(0xd3)),0x1;const _0x4970c1=_0x22a24b[_0x8bf6b(0xd7)][0x0],_0x592bc8=getBaseName(_0x275cae),_0x50d62e=getParentPath(_0x275cae);_0x532d60[_0x8bf6b(0xcd)]&&(console[_0x8bf6b(0xb6)](_0x8bf6b(0xd6)+_0x532d60[_0x8bf6b(0xbe)]),console[_0x8bf6b(0xb6)](_0x8bf6b(0xcb)+_0x275cae),console[_0x8bf6b(0xb6)](_0x8bf6b(0xc4)+_0x4970c1),console[_0x8bf6b(0xb6)](_0x8bf6b(0xd1)+_0x592bc8),console[_0x8bf6b(0xb6)]('Parent\x20path:\x20'+_0x50d62e));const _0x377b31=await withSpinner(_0x8bf6b(0xbd)+_0x4970c1+_0x8bf6b(0xc6),()=>_0xe8c863[_0x8bf6b(0xb3)]['resolveParentId'](_0x4970c1),{'verbose':_0x532d60['verbose']}),_0x537dd0=_0x377b31['data'];let _0x5e2673;if(_0x22a24b[_0x8bf6b(0xd7)][_0x8bf6b(0xd0)]>0x2){const _0x359ad8=await withSpinner(_0x8bf6b(0xc7)+_0x50d62e+_0x8bf6b(0xc6),()=>_0xe8c863[_0x8bf6b(0xb3)]['resolvePathToResource'](_0x50d62e),{'verbose':_0x532d60[_0x8bf6b(0xcd)]}),_0x4b71a8=_0x359ad8[_0x8bf6b(0xd4)];if(_0x4b71a8[_0x8bf6b(0xde)]!==_0x8bf6b(0xbf)&&_0x4b71a8[_0x8bf6b(0xde)]!==_0x8bf6b(0xd5))return console[_0x8bf6b(0xb6)](_0x8bf6b(0xb9)),0x1;_0x5e2673=_0x4b71a8[_0x8bf6b(0xcc)];}else{if(_0x532d60[_0x8bf6b(0xbf)]){const _0x1d2bb7=await withSpinner(_0x8bf6b(0xd8)+_0x532d60[_0x8bf6b(0xbf)]+_0x8bf6b(0xc6),()=>_0xe8c863[_0x8bf6b(0xb3)]['resolveFolderId'](_0x537dd0,_0x532d60[_0x8bf6b(0xbf)]),{'verbose':_0x532d60[_0x8bf6b(0xcd)]});_0x5e2673=_0x1d2bb7[_0x8bf6b(0xd4)];}}_0x532d60[_0x8bf6b(0xcd)]&&_0x5e2673&&console[_0x8bf6b(0xb6)]('Resolved\x20folder\x20ID:\x20'+_0x5e2673);const _0x23271b=await loadJSONFromOptions(_0x532d60['rule'],_0x532d60['ruleFile']),_0x53f600={'name':_0x592bc8,'description':_0x532d60[_0x8bf6b(0xc5)],'rule':_0x23271b,'kind':_0x532d60[_0x8bf6b(0xbb)]!==undefined?parseInt(_0x532d60[_0x8bf6b(0xbb)],0xa):undefined,'isVisible':_0x532d60[_0x8bf6b(0xad)]?![]:undefined,'segmentFolderId':_0x5e2673,'countPopulation':_0x532d60[_0x8bf6b(0xc8)]?![]:undefined},_0xb0256a=await withSpinner('Creating\x20segment\x20\x27'+_0x592bc8+_0x8bf6b(0xc6),()=>_0xe8c863[_0x8bf6b(0xb3)][_0x8bf6b(0xb0)](_0x537dd0,_0x53f600),{'verbose':_0x532d60['verbose']}),_0x188325=_0xb0256a[_0x8bf6b(0xd4)];return console[_0x8bf6b(0xb6)](_0x8bf6b(0xbc)+_0x188325[_0x8bf6b(0xc1)]+_0x8bf6b(0xc2)+_0x188325['id']),_0x275cae!==_0x469bed&&console[_0x8bf6b(0xb6)](_0x8bf6b(0xd9)+_0x275cae),await handleSDKOutput([_0x188325],_0x532d60),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0xa3e3(){const _0x3c7810=['50RGdrwi','✔\x20Found\x20','data','Error:\x20Parent\x20segment\x20name\x20is\x20required','5717880CBkIWc','68cnhyAV','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','8dxYddn','parentSegment','454uTDMLk','name','Listing\x20fields\x20for\x20\x27','1035083sHWHpF','description','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','listFields','segment','328818idVYPi','List\x20available\x20fields\x20for\x20segmentation','error','27564OQeVWW','1166eulwIf','\x20field','verbose','133890NoQfIq','2129xxyhQr','12835251UeUyBQ','length'];a27_0xa3e3=function(){return _0x3c7810;};return a27_0xa3e3();}const a27_0x5a8095=a27_0x3bff;(function(_0x2632be,_0x70e19a){const _0x843b7c=a27_0x3bff,_0x5adb9d=_0x2632be();while(!![]){try{const _0x49f5eb=parseInt(_0x843b7c(0x198))/0x1*(parseInt(_0x843b7c(0x1a5))/0x2)+parseInt(_0x843b7c(0x1b4))/0x3*(-parseInt(_0x843b7c(0x1a0))/0x4)+-parseInt(_0x843b7c(0x19b))/0x5*(-parseInt(_0x843b7c(0x1ad))/0x6)+parseInt(_0x843b7c(0x1a8))/0x7*(-parseInt(_0x843b7c(0x1a3))/0x8)+parseInt(_0x843b7c(0x199))/0x9+-parseInt(_0x843b7c(0x19f))/0xa+-parseInt(_0x843b7c(0x1b1))/0xb*(parseInt(_0x843b7c(0x1b0))/0xc);if(_0x49f5eb===_0x70e19a)break;else _0x5adb9d['push'](_0x5adb9d['shift']());}catch(_0x2b3524){_0x5adb9d['push'](_0x5adb9d['shift']());}}}(a27_0xa3e3,0xb3973));function a27_0x3bff(_0x45f764,_0xa03f33){const _0xa3e3e=a27_0xa3e3();return a27_0x3bff=function(_0x3bff67,_0x2737a4){_0x3bff67=_0x3bff67-0x198;let _0x5878f3=_0xa3e3e[_0x3bff67];return _0x5878f3;},a27_0x3bff(_0x45f764,_0xa03f33);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x5a8095(0x1a6)]='segment:fields';[a27_0x5a8095(0x1a9)]=a27_0x5a8095(0x1ae);async['execute'](_0x5e7e2f){const _0x5f19af=a27_0x5a8095,{options:_0x2d08c1,args:_0x21bcae,tdx:_0x10f6e0}=_0x5e7e2f,_0x5a688c=_0x21bcae[0x0]||_0x2d08c1[_0x5f19af(0x1a4)];if(!_0x5a688c)return console[_0x5f19af(0x1af)](_0x5f19af(0x19e)),console[_0x5f19af(0x1af)](_0x5f19af(0x1a2)),console[_0x5f19af(0x1af)](_0x5f19af(0x1aa)),0x1;_0x2d08c1[_0x5f19af(0x1b3)]&&(console[_0x5f19af(0x1af)]('Site:\x20'+_0x2d08c1['site']),console[_0x5f19af(0x1af)](_0x5f19af(0x1a1)+_0x5a688c));const _0x1fbd88=await withSpinner(_0x5f19af(0x1a7)+_0x5a688c+'\x27...',()=>_0x10f6e0[_0x5f19af(0x1ac)][_0x5f19af(0x1ab)](_0x5a688c),{'verbose':_0x2d08c1[_0x5f19af(0x1b3)]}),_0x496f55=_0x1fbd88[_0x5f19af(0x19d)];return console[_0x5f19af(0x1af)](_0x5f19af(0x19c)+_0x496f55['length']+_0x5f19af(0x1b2)+(_0x496f55[_0x5f19af(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x496f55,_0x2d08c1),0x0;}}
|