@treasuredata/tdx 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/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
|
|
1
|
+
const a16_0x546bfb=a16_0x32f1;(function(_0x52a944,_0x50b05b){const _0x59e3fe=a16_0x32f1,_0x4a016b=_0x52a944();while(!![]){try{const _0x1f361e=-parseInt(_0x59e3fe(0xb7))/0x1*(parseInt(_0x59e3fe(0xce))/0x2)+parseInt(_0x59e3fe(0xc7))/0x3*(-parseInt(_0x59e3fe(0xcb))/0x4)+parseInt(_0x59e3fe(0xcc))/0x5*(parseInt(_0x59e3fe(0xb8))/0x6)+-parseInt(_0x59e3fe(0xcf))/0x7+parseInt(_0x59e3fe(0xd1))/0x8+parseInt(_0x59e3fe(0xc2))/0x9*(-parseInt(_0x59e3fe(0xb9))/0xa)+-parseInt(_0x59e3fe(0xc5))/0xb*(-parseInt(_0x59e3fe(0xbb))/0xc);if(_0x1f361e===_0x50b05b)break;else _0x4a016b['push'](_0x4a016b['shift']());}catch(_0x197886){_0x4a016b['push'](_0x4a016b['shift']());}}}(a16_0x418f,0x40793));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a16_0x32f1(_0x7586,_0x2f4271){const _0x418fb6=a16_0x418f();return a16_0x32f1=function(_0x32f16a,_0x108671){_0x32f16a=_0x32f16a-0xb7;let _0x5f0c08=_0x418fb6[_0x32f16a];return _0x5f0c08;},a16_0x32f1(_0x7586,_0x2f4271);}function a16_0x418f(){const _0x575144=['List\x20all\x20databases','✔\x20Found\x20','327948HjOGvN','5lVXIuw','verbose','2tkeZWU','437822GzAoOu','limit','3190992GPdjpy','266047PAlzcS','2432922fJeVYB','2430yzLwJS','\x20\x20Cause:\x20','7428bBUZtE','cause','data','error','query','length','Listing\x20databases...','15408FrGjvV','databases','execute','6545azCltO','Error:\x20','6PIZRBK','listDatabases'];a16_0x418f=function(){return _0x575144;};return a16_0x418f();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{['name']=a16_0x546bfb(0xc3);['description']=a16_0x546bfb(0xc9);async[a16_0x546bfb(0xc4)](_0x15a24f){const _0x5d90ea=a16_0x546bfb,{options:_0x15a20b,args:_0xbf856c,tdx:_0x47a6d0}=_0x15a24f,_0x442f81=_0xbf856c[0x0];try{_0x15a20b['verbose']&&(console[_0x5d90ea(0xbe)]('Site:\x20'+_0x15a20b['site']),_0x442f81&&console[_0x5d90ea(0xbe)]('Pattern:\x20'+_0x442f81));const _0x1d5ae3=resolveLimit(_0x15a20b[_0x5d90ea(0xd0)],DEFAULT_LISTING_LIMIT),_0x34edc5=await withSpinner(_0x5d90ea(0xc1),()=>_0x47a6d0[_0x5d90ea(0xbf)][_0x5d90ea(0xc8)](_0x442f81,_0x1d5ae3),{'verbose':_0x15a20b[_0x5d90ea(0xcd)]}),_0x300c05=_0x34edc5[_0x5d90ea(0xbd)];return console[_0x5d90ea(0xbe)](_0x5d90ea(0xca)+_0x300c05['length']+'\x20database'+(_0x300c05[_0x5d90ea(0xc0)]!==0x1?'s':'')),await handleSDKOutput(_0x300c05,{..._0x15a20b,'limit':_0x1d5ae3}),0x0;}catch(_0xc063ad){if(_0xc063ad instanceof SDKError)return console['error'](_0x5d90ea(0xc6)+_0xc063ad['message']),_0xc063ad[_0x5d90ea(0xbc)]&&console[_0x5d90ea(0xbe)](_0x5d90ea(0xba)+_0xc063ad[_0x5d90ea(0xbc)]),0x1;throw _0xc063ad;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a17_0x12e0(){const _0x5b485b=['data','1014243UUEEuN','\x20\x20Cause:\x20','...','table','822962GZKgUw','database','name','444680SgPsso','message','describeTable','373482lEiuuk','verbose','64ZqgVmn','length','Table:\x20','error','validate','\x27\x20does\x20not\x20exist','961690ViaPnC','site','2723515AseyQC','✔\x20Found\x20','describe','Error:\x20','args','Describing\x20table\x20','30uLTGTt','8yUdkFa','64148dEEeff','query','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','121qPnHfH','cause'];a17_0x12e0=function(){return _0x5b485b;};return a17_0x12e0();}function a17_0x51d9(_0x9cac7c,_0x313025){const _0x12e033=a17_0x12e0();return a17_0x51d9=function(_0x51d907,_0x5634e2){_0x51d907=_0x51d907-0x169;let _0x3b1a54=_0x12e033[_0x51d907];return _0x3b1a54;},a17_0x51d9(_0x9cac7c,_0x313025);}const a17_0x2ebc81=a17_0x51d9;(function(_0x218201,_0x40bfbe){const _0x420842=a17_0x51d9,_0x14510f=_0x218201();while(!![]){try{const _0x220383=-parseInt(_0x420842(0x182))/0x1*(-parseInt(_0x420842(0x181))/0x2)+parseInt(_0x420842(0x188))/0x3+parseInt(_0x420842(0x16d))/0x4+-parseInt(_0x420842(0x17a))/0x5+-parseInt(_0x420842(0x180))/0x6*(parseInt(_0x420842(0x16a))/0x7)+parseInt(_0x420842(0x172))/0x8*(-parseInt(_0x420842(0x170))/0x9)+-parseInt(_0x420842(0x178))/0xa*(-parseInt(_0x420842(0x185))/0xb);if(_0x220383===_0x40bfbe)break;else _0x14510f['push'](_0x14510f['shift']());}catch(_0x1f4ec8){_0x14510f['push'](_0x14510f['shift']());}}}(a17_0x12e0,0x490b1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a17_0x2ebc81(0x16c)]=a17_0x2ebc81(0x17c);['description']='Describe\x20table\x20schema';async['execute'](_0x2e71f8){const _0x5a83cc=a17_0x2ebc81;return this[_0x5a83cc(0x16f)](_0x2e71f8);}async[a17_0x2ebc81(0x16f)](_0x41651b){const _0x4399ef=a17_0x2ebc81,{options:_0x336132,args:_0x41f31e,tdx:_0x6eba77}=_0x41651b;let _0x38d7d4;try{_0x38d7d4=parseTableReference(_0x41f31e[0x0]);const _0x47c165=_0x336132['database'];!_0x38d7d4[_0x4399ef(0x16b)]&&_0x47c165&&(_0x38d7d4[_0x4399ef(0x16b)]=_0x47c165);const _0x647def=validateTableDescribeReference(_0x38d7d4);if(_0x647def)return console[_0x4399ef(0x175)](_0x4399ef(0x17d)+_0x647def),0x1;}catch(_0x4b82f5){return console['error'](_0x4399ef(0x17d)+_0x4b82f5[_0x4399ef(0x16e)]),0x1;}const _0x2cb00e=_0x38d7d4[_0x4399ef(0x16b)],_0x5c0ae0=_0x38d7d4[_0x4399ef(0x169)];try{_0x336132[_0x4399ef(0x171)]&&(console[_0x4399ef(0x175)]('Site:\x20'+_0x336132[_0x4399ef(0x179)]),console[_0x4399ef(0x175)]('Database:\x20'+_0x2cb00e),console['error'](_0x4399ef(0x174)+_0x5c0ae0));const _0x2574fa=await withSpinner(_0x4399ef(0x17f)+_0x2cb00e+'.'+_0x5c0ae0+_0x4399ef(0x18a),()=>_0x6eba77[_0x4399ef(0x183)][_0x4399ef(0x16f)](_0x2cb00e,_0x5c0ae0),{'verbose':_0x336132[_0x4399ef(0x171)]}),_0x279aa7=_0x2574fa[_0x4399ef(0x187)];if(_0x279aa7[_0x4399ef(0x173)]===0x0)return console['error']('✖\x20Table\x20not\x20found'),console['error']('Table\x20\x27'+_0x2cb00e+'.'+_0x5c0ae0+_0x4399ef(0x177)),0x1;return console['error'](_0x4399ef(0x17b)+_0x279aa7[_0x4399ef(0x173)]+'\x20column'+(_0x279aa7[_0x4399ef(0x173)]!==0x1?'s':'')+'\x20in\x20'+_0x2cb00e+'.'+_0x5c0ae0),await handleSDKOutput(_0x279aa7,_0x336132),0x0;}catch(_0x1a0982){if(_0x1a0982 instanceof SDKError)return console[_0x4399ef(0x175)](_0x4399ef(0x17d)+_0x1a0982['message']),_0x1a0982[_0x4399ef(0x186)]&&console['error'](_0x4399ef(0x189)+_0x1a0982[_0x4399ef(0x186)]),0x1;throw _0x1a0982;}}[a17_0x2ebc81(0x176)](_0x157e70){const _0x330a37=a17_0x2ebc81;if(_0x157e70[_0x330a37(0x17e)][_0x330a37(0x173)]===0x0)return _0x330a37(0x184);if(_0x157e70[_0x330a37(0x17e)][_0x330a37(0x173)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x2dde50=a18_0x24db;(function(_0x4d0e4e,_0x9d5829){const _0x565427=a18_0x24db,_0x23bac9=_0x4d0e4e();while(!![]){try{const _0x18ed93=parseInt(_0x565427(0x116))/0x1+parseInt(_0x565427(0x13d))/0x2*(-parseInt(_0x565427(0x164))/0x3)+parseInt(_0x565427(0x178))/0x4+parseInt(_0x565427(0x12c))/0x5+-parseInt(_0x565427(0x16c))/0x6*(parseInt(_0x565427(0x179))/0x7)+-parseInt(_0x565427(0x10e))/0x8+parseInt(_0x565427(0x176))/0x9*(parseInt(_0x565427(0x16a))/0xa);if(_0x18ed93===_0x9d5829)break;else _0x23bac9['push'](_0x23bac9['shift']());}catch(_0x5ce046){_0x23bac9['push'](_0x23bac9['shift']());}}}(a18_0x5abf,0x9cef9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x8aa126,_0x3be665,_0x1d1114=![]){const _0x1e23da=a18_0x24db;if(_0x8aa126[_0x1e23da(0x15d)])return await _0x3be665['engage']['resolveWorkspaceId'](_0x8aa126['workspace']);const _0x381c7e=loadSessionContext(_0x8aa126[_0x1e23da(0x10d)]);if(_0x381c7e?.[_0x1e23da(0xf1)])return await _0x3be665[_0x1e23da(0x150)][_0x1e23da(0x15e)](_0x381c7e['engage_workspace']);if(_0x1d1114)throw new SDKError(ErrorCode[_0x1e23da(0x104)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':_0x1e23da(0x173)});return undefined;}async function resolveSegmentFromOptions(_0x1f09be,_0x34f6e5){const _0x9cfc0c=a18_0x24db;if(!_0x1f09be[_0x9cfc0c(0xfe)])return{};const _0x173ebb=_0x1f09be[_0x9cfc0c(0xfe)],_0x4246fc=await _0x34f6e5[_0x9cfc0c(0xfe)]['resolvePathToResource'](_0x173ebb);return{'audienceId':_0x4246fc[_0x9cfc0c(0x143)],'audienceName':_0x4246fc[_0x9cfc0c(0x161)],..._0x4246fc[_0x9cfc0c(0x175)]&&{'segmentId':_0x4246fc['segmentId'],'segmentName':_0x4246fc[_0x9cfc0c(0x14f)]}};}function buildConnectorConfig(_0xdd83e0){const _0x3cf669=a18_0x24db,_0x4cd156=_0xdd83e0['emailSenderId'],_0x55a754=_0xdd83e0[_0x3cf669(0x131)];if(!_0x4cd156&&!_0x55a754)return undefined;return{..._0x4cd156&&{'emailSenderId':_0x4cd156},..._0x55a754&&{'jsonColumns':_0x55a754}};}export class EngageCampaignsCommand extends BaseCommand{['name']='engage:campaigns';['description']=a18_0x2dde50(0x119);async[a18_0x2dde50(0x10a)](_0x1aa00a){const _0x4fd71f=a18_0x2dde50,{options:_0x44c720,args:_0x5dd10e,tdx:_0x219e67}=_0x1aa00a,_0xf22826=_0x5dd10e[0x0],_0x2e7945=resolveLimit(_0x44c720[_0x4fd71f(0x145)],DEFAULT_LLM_LIMIT),_0x1fd1eb=_0x44c720,_0x3ac8ed=_0x1fd1eb[_0x4fd71f(0x12a)],_0x163ae5=_0x1fd1eb['status'],_0x1150fc=await resolveWorkspaceIdFromOptions(_0x1fd1eb,_0x219e67),_0x529caf=await withSpinner(_0x4fd71f(0x15f),()=>_0x219e67[_0x4fd71f(0x150)][_0x4fd71f(0x103)]({'type':_0x3ac8ed,'status':_0x163ae5,'workspaceId':_0x1150fc,'limit':_0x2e7945}),{'verbose':_0x44c720[_0x4fd71f(0x114)]});let _0xd29f79=_0x529caf[_0x4fd71f(0x168)];return _0xf22826&&(_0xd29f79=_0x529caf[_0x4fd71f(0x168)][_0x4fd71f(0x166)](_0x4a4d71=>matchGlobPattern(_0x4a4d71[_0x4fd71f(0xfd)],_0xf22826))),await handleSDKOutput(_0xd29f79,_0x44c720),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a18_0x2dde50(0xfd)]=a18_0x2dde50(0x124);[a18_0x2dde50(0x151)]=a18_0x2dde50(0x156);async[a18_0x2dde50(0x10a)](_0x239927){const _0x5061c8=a18_0x2dde50,{options:_0x2acd84,args:_0x5812a0,tdx:_0x2c3048}=_0x239927;if(_0x5812a0[_0x5061c8(0x15b)]===0x0)return console[_0x5061c8(0x11e)](_0x5061c8(0x139)),console[_0x5061c8(0x11e)](_0x5061c8(0x13c)),0x1;const _0x155fe8=_0x5812a0[0x0],_0xe57c1f=_0x2acd84,_0x25aa0a=await resolveWorkspaceIdFromOptions(_0xe57c1f,_0x2c3048),_0x1ac72a=_0xe57c1f['full'];if(_0x1ac72a){const _0x5e4549=await withSpinner(_0x5061c8(0x155)+_0x155fe8+_0x5061c8(0x162),()=>_0x2c3048[_0x5061c8(0x150)][_0x5061c8(0xf2)](_0x155fe8,_0x25aa0a),{'verbose':_0x2acd84[_0x5061c8(0x114)]});await handleSDKOutput([_0x5e4549],_0x2acd84);}else{const _0x2cf848=await withSpinner(_0x5061c8(0x155)+_0x155fe8+_0x5061c8(0x162),()=>_0x2c3048['engage']['getCampaign'](_0x155fe8,_0x25aa0a),{'verbose':_0x2acd84[_0x5061c8(0x114)]});await handleSDKOutput([_0x2cf848],_0x2acd84);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a18_0x2dde50(0xfd)]=a18_0x2dde50(0x14b);[a18_0x2dde50(0x151)]=a18_0x2dde50(0x149);async[a18_0x2dde50(0x10a)](_0x29e8c1){const _0x9ff74f=a18_0x2dde50,{options:_0x16bc5c,tdx:_0x4692f7}=_0x29e8c1,_0x3671b9=_0x16bc5c,_0x3a88bb=_0x3671b9[_0x9ff74f(0xfd)],_0x31eb38=_0x3671b9[_0x9ff74f(0x12a)];if(!_0x3a88bb)return console[_0x9ff74f(0x11e)](_0x9ff74f(0xff)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x31eb38)return console[_0x9ff74f(0x11e)](_0x9ff74f(0xef)),console[_0x9ff74f(0x11e)](_0x9ff74f(0x130)),0x1;const _0x5a6140=await resolveWorkspaceIdFromOptions(_0x3671b9,_0x4692f7,!![]),_0x3074f5=await resolveSegmentFromOptions(_0x3671b9,_0x4692f7),_0x11cd56=buildConnectorConfig(_0x3671b9),_0x181c09={'name':_0x3a88bb,'campaignType':_0x31eb38,'workspaceId':_0x5a6140,'description':_0x3671b9['description'],..._0x3074f5,'connectorConfig':_0x11cd56,'startAt':_0x3671b9['startAt'],'timezone':_0x3671b9['timezone']},_0x3e401d=await withSpinner('Creating\x20campaign\x20\x27'+_0x3a88bb+_0x9ff74f(0x162),()=>_0x4692f7[_0x9ff74f(0x150)][_0x9ff74f(0x17a)](_0x181c09));return await handleSDKOutput([_0x3e401d['data']],_0x16bc5c),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a18_0x2dde50(0xfd)]=a18_0x2dde50(0x10c);['description']=a18_0x2dde50(0x169);async['execute'](_0x1abaef){const _0x822120=a18_0x2dde50,{options:_0xec2d29,args:_0x1e79c0,tdx:_0x149863}=_0x1abaef;if(_0x1e79c0[_0x822120(0x15b)]===0x0)return console[_0x822120(0x11e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x58b935=_0x1e79c0[0x0],_0x3cdcfb=_0xec2d29,_0x5946fd=await resolveWorkspaceIdFromOptions(_0x3cdcfb,_0x149863),_0x2dfda6=await resolveSegmentFromOptions(_0x3cdcfb,_0x149863),_0x4531cb=buildConnectorConfig(_0x3cdcfb),_0x203f9f={'name':_0x3cdcfb[_0x822120(0xfd)],'description':_0x3cdcfb['description'],..._0x2dfda6,'connectorConfig':_0x4531cb,'startAt':_0x3cdcfb[_0x822120(0x14a)],'timezone':_0x3cdcfb[_0x822120(0x144)]},_0x1d33d8=Object[_0x822120(0x135)](Object[_0x822120(0x10f)](_0x203f9f)[_0x822120(0x166)](([,_0x360661])=>_0x360661!==undefined));if(Object[_0x822120(0x125)](_0x1d33d8)[_0x822120(0x15b)]===0x0)return console[_0x822120(0x11e)](_0x822120(0x13e)),console[_0x822120(0x11e)](_0x822120(0x171)),0x1;const _0x5f3e76=await withSpinner(_0x822120(0x134)+_0x58b935+'\x27...',()=>_0x149863[_0x822120(0x150)][_0x822120(0x167)](_0x58b935,_0x1d33d8,_0x5946fd),{'verbose':_0xec2d29[_0x822120(0x114)]});return await handleSDKOutput([_0x5f3e76['data']],_0xec2d29),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a18_0x2dde50(0xfd)]='engage:campaign:delete';['description']=a18_0x2dde50(0x146);async['execute'](_0x54325a){const _0x35bd62=a18_0x2dde50,{options:_0x186a88,args:_0x3d8647,tdx:_0x1f3467}=_0x54325a;if(_0x3d8647[_0x35bd62(0x15b)]===0x0)return console[_0x35bd62(0x11e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x35bd62(0x11e)](_0x35bd62(0x136)),0x1;const _0x55c6ec=_0x3d8647[0x0],_0x595af5=_0x186a88,_0x328a05=await resolveWorkspaceIdFromOptions(_0x595af5,_0x1f3467);if(!_0x186a88[_0x35bd62(0x117)]){const _0x4412f2=await confirm(_0x35bd62(0x163)+_0x55c6ec+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x4412f2)return console[_0x35bd62(0x115)](_0x35bd62(0x170)),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x55c6ec+_0x35bd62(0x162),()=>_0x1f3467[_0x35bd62(0x150)][_0x35bd62(0x17c)](_0x55c6ec,_0x328a05),{'verbose':_0x186a88[_0x35bd62(0x114)]}),console[_0x35bd62(0x115)](_0x35bd62(0x120)+_0x55c6ec+_0x35bd62(0x11b)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']='engage:campaign:launch';['description']=a18_0x2dde50(0x13a);async[a18_0x2dde50(0x10a)](_0xe21d50){const _0x275a1a=a18_0x2dde50,{options:_0x5eab21,args:_0x1291c3,tdx:_0x53eeed}=_0xe21d50;if(_0x1291c3[_0x275a1a(0x15b)]===0x0)return console[_0x275a1a(0x11e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x275a1a(0x11e)]('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0x54d4dd=_0x1291c3[0x0],_0x5163dc=_0x5eab21,_0x3c59c8=await resolveWorkspaceIdFromOptions(_0x5163dc,_0x53eeed);return await withSpinner(_0x275a1a(0x133)+_0x54d4dd+'\x27...',()=>_0x53eeed[_0x275a1a(0x150)][_0x275a1a(0x128)](_0x54d4dd,_0x3c59c8),{'verbose':_0x5eab21['verbose']}),console[_0x275a1a(0x115)](_0x275a1a(0x120)+_0x54d4dd+_0x275a1a(0x111)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a18_0x2dde50(0xfd)]='engage:campaign:pause';[a18_0x2dde50(0x151)]=a18_0x2dde50(0x11f);async[a18_0x2dde50(0x10a)](_0x30987d){const _0xab55e7=a18_0x2dde50,{options:_0x53643d,args:_0x1e6223,tdx:_0x27dcc8}=_0x30987d;if(_0x1e6223[_0xab55e7(0x15b)]===0x0)return console[_0xab55e7(0x11e)](_0xab55e7(0x139)),console['error'](_0xab55e7(0x11d)),0x1;const _0x75015b=_0x1e6223[0x0],_0x1fd5a4=_0x53643d,_0x32b58f=await resolveWorkspaceIdFromOptions(_0x1fd5a4,_0x27dcc8);return await withSpinner(_0xab55e7(0x140)+_0x75015b+_0xab55e7(0x162),()=>_0x27dcc8[_0xab55e7(0x150)]['pauseCampaign'](_0x75015b,_0x32b58f),{'verbose':_0x53643d[_0xab55e7(0x114)]}),console['log'](_0xab55e7(0x120)+_0x75015b+_0xab55e7(0xf9)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a18_0x2dde50(0xfd)]='engage:campaign:resume';[a18_0x2dde50(0x151)]=a18_0x2dde50(0xf7);async[a18_0x2dde50(0x10a)](_0x904ebc){const _0x1578e5=a18_0x2dde50,{options:_0x3496ff,args:_0x308c6f,tdx:_0x3bd120}=_0x904ebc;if(_0x308c6f[_0x1578e5(0x15b)]===0x0)return console['error'](_0x1578e5(0x139)),console['error'](_0x1578e5(0x11c)),0x1;const _0x491502=_0x308c6f[0x0],_0x1f0acb=_0x3496ff,_0x40e7cf=await resolveWorkspaceIdFromOptions(_0x1f0acb,_0x3bd120);return await withSpinner(_0x1578e5(0x147)+_0x491502+_0x1578e5(0x162),()=>_0x3bd120['engage'][_0x1578e5(0xf4)](_0x491502,_0x40e7cf),{'verbose':_0x3496ff[_0x1578e5(0x114)]}),console[_0x1578e5(0x115)]('Campaign\x20\x27'+_0x491502+_0x1578e5(0x127)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a18_0x2dde50(0xfd)]=a18_0x2dde50(0x157);[a18_0x2dde50(0x151)]=a18_0x2dde50(0x106);async[a18_0x2dde50(0x10a)](_0x4fd1a3){const _0x8bfc0=a18_0x2dde50,{options:_0xe3ae90,args:_0x31a838,tdx:_0x2deedb}=_0x4fd1a3;if(_0x31a838[_0x8bfc0(0x15b)]===0x0)return console[_0x8bfc0(0x11e)](_0x8bfc0(0x139)),console['error'](_0x8bfc0(0x126)),0x1;const _0x31fd17=_0x31a838[0x0],_0x595332=_0xe3ae90,_0x4f1ce9=await resolveWorkspaceIdFromOptions(_0x595332,_0x2deedb),_0x4cf642=await withSpinner(_0x8bfc0(0xfa)+_0x31fd17+_0x8bfc0(0x162),()=>_0x2deedb[_0x8bfc0(0x150)]['duplicateCampaign'](_0x31fd17,_0x4f1ce9),{'verbose':_0xe3ae90['verbose']});return await handleSDKOutput([_0x4cf642[_0x8bfc0(0x168)]],_0xe3ae90),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a18_0x2dde50(0xec);[a18_0x2dde50(0x151)]=a18_0x2dde50(0x13b);async['execute'](_0x38f071){const _0x369fc0=a18_0x2dde50,{options:_0x2fab57,args:_0x3e7891,tdx:_0x50572b}=_0x38f071,_0x4c50c8=_0x3e7891[0x0],_0x4d0846=resolveLimit(_0x2fab57[_0x369fc0(0x145)],DEFAULT_LLM_LIMIT),_0x523da1=_0x2fab57,_0x2185c5=await resolveWorkspaceIdFromOptions(_0x523da1,_0x50572b),_0x5b0f47=await withSpinner(_0x369fc0(0x112),()=>_0x50572b[_0x369fc0(0x150)][_0x369fc0(0xf0)]({'workspaceId':_0x2185c5,'limit':_0x4d0846}),{'verbose':_0x2fab57[_0x369fc0(0x114)]});let _0x2ae3f0=_0x5b0f47[_0x369fc0(0x168)];return _0x4c50c8&&(_0x2ae3f0=_0x5b0f47['data'][_0x369fc0(0x166)](_0x23ebe=>matchGlobPattern(_0x23ebe[_0x369fc0(0xfd)],_0x4c50c8))),await handleSDKOutput(_0x2ae3f0,_0x2fab57),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a18_0x2dde50(0x108);[a18_0x2dde50(0x151)]=a18_0x2dde50(0x137);async[a18_0x2dde50(0x10a)](_0x446cae){const _0x43372b=a18_0x2dde50,{options:_0x1be791,args:_0x5fc5cd,tdx:_0x5c7450}=_0x446cae;if(_0x5fc5cd[_0x43372b(0x15b)]===0x0)return console[_0x43372b(0x11e)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x43372b(0x11e)](_0x43372b(0x142)),0x1;const _0x3c1b65=_0x5fc5cd[0x0],_0x2318a9=_0x1be791,_0x57749e=await resolveWorkspaceIdFromOptions(_0x2318a9,_0x5c7450),_0x8a61fb=_0x2318a9[_0x43372b(0xfc)];if(_0x8a61fb){const _0x59c63a=await withSpinner(_0x43372b(0xf8)+_0x3c1b65+_0x43372b(0x162),()=>_0x5c7450[_0x43372b(0x150)][_0x43372b(0x121)](_0x3c1b65,_0x57749e),{'verbose':_0x1be791[_0x43372b(0x114)]});await handleSDKOutput([_0x59c63a],_0x1be791);}else{const _0x575f53=await withSpinner('Fetching\x20template\x20\x27'+_0x3c1b65+'\x27...',()=>_0x5c7450[_0x43372b(0x150)][_0x43372b(0x14d)](_0x3c1b65,_0x57749e),{'verbose':_0x1be791[_0x43372b(0x114)]});await handleSDKOutput([_0x575f53],_0x1be791);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']='engage:template:create';['description']=a18_0x2dde50(0x16d);async['execute'](_0x36d5d9){const _0x402445=a18_0x2dde50,{options:_0xf460c1,tdx:_0x20f43f}=_0x36d5d9,_0x4bb83d=_0xf460c1,_0x33b0ab=_0x4bb83d[_0x402445(0xfd)],_0x3499ab=_0x4bb83d[_0x402445(0x16f)],_0xfc2de2=_0x4bb83d[_0x402445(0x158)];if(!_0x33b0ab)return console[_0x402445(0x11e)](_0x402445(0xff)),console[_0x402445(0x11e)](_0x402445(0x174)),0x1;if(!_0x3499ab)return console[_0x402445(0x11e)]('Error:\x20--subject\x20is\x20required'),0x1;if(!_0xfc2de2)return console[_0x402445(0x11e)](_0x402445(0x105)),0x1;const _0x34b82b=await resolveWorkspaceIdFromOptions(_0x4bb83d,_0x20f43f,!![]),_0x9186ea={'name':_0x33b0ab,'subjectTemplate':_0x3499ab,'htmlTemplate':_0xfc2de2,'workspaceId':_0x34b82b,'plaintextTemplate':_0x4bb83d['plaintext'],'editorType':_0x4bb83d[_0x402445(0x12e)]},_0x4d2bcc=await withSpinner(_0x402445(0x113)+_0x33b0ab+'\x27...',()=>_0x20f43f['engage'][_0x402445(0x141)](_0x9186ea));return await handleSDKOutput([_0x4d2bcc[_0x402445(0x168)]],_0xf460c1),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a18_0x2dde50(0xfd)]=a18_0x2dde50(0x138);[a18_0x2dde50(0x151)]='Update\x20an\x20email\x20template';async[a18_0x2dde50(0x10a)](_0xa040c7){const _0x6b32d6=a18_0x2dde50,{options:_0xbac6f,args:_0x597257,tdx:_0x5d4a78}=_0xa040c7;if(_0x597257[_0x6b32d6(0x15b)]===0x0)return console[_0x6b32d6(0x11e)](_0x6b32d6(0x14c)),console[_0x6b32d6(0x11e)](_0x6b32d6(0x11a)),0x1;const _0x14fb99=_0x597257[0x0],_0x66388f=_0xbac6f,_0x5d76a9=await resolveWorkspaceIdFromOptions(_0x66388f,_0x5d4a78),_0x1f29b5={'name':_0x66388f[_0x6b32d6(0xfd)],'subjectTemplate':_0x66388f['subject'],'htmlTemplate':_0x66388f['html'],'plaintextTemplate':_0x66388f['plaintext']},_0x4adc6e=Object[_0x6b32d6(0x135)](Object['entries'](_0x1f29b5)[_0x6b32d6(0x166)](([,_0x354289])=>_0x354289!==undefined));if(Object[_0x6b32d6(0x125)](_0x4adc6e)[_0x6b32d6(0x15b)]===0x0)return console[_0x6b32d6(0x11e)](_0x6b32d6(0x13e)),console['error'](_0x6b32d6(0x123)),0x1;const _0x4ddd85=await withSpinner(_0x6b32d6(0x118)+_0x14fb99+_0x6b32d6(0x162),()=>_0x5d4a78[_0x6b32d6(0x150)][_0x6b32d6(0x16e)](_0x14fb99,_0x4adc6e,_0x5d76a9),{'verbose':_0xbac6f[_0x6b32d6(0x114)]});return await handleSDKOutput([_0x4ddd85[_0x6b32d6(0x168)]],_0xbac6f),0x0;}}function a18_0x5abf(){const _0x33819a=['Campaign\x20\x27','getTemplateFull','engage:workspace:use','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','engage:campaign:show','keys','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','\x27\x20resumed\x20successfully','launchCampaign','Options:\x20--name,\x20--description','type','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','1482270dMtZsk','deleteWorkspace','editorType','Verifying\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','jsonColumns','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','Launching\x20campaign\x20\x27','Updating\x20campaign\x20\x27','fromEntries','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Show\x20email\x20template\x20details','engage:template:update','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Launch\x20a\x20campaign','List\x20email\x20templates','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','150520EVvoXd','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','\x27?\x20This\x20cannot\x20be\x20undone.','Pausing\x20campaign\x20\x27','createTemplate','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','parentId','timezone','limit','Delete\x20a\x20campaign','Resuming\x20campaign\x20\x27','Engage\x20workspace\x20set\x20to:\x20','Create\x20a\x20new\x20campaign','startAt','engage:campaign:create','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','getTemplate','Template\x20\x27','segmentName','engage','description','engage:workspace:delete','List\x20workspaces','Show\x20workspace\x20details','Fetching\x20campaign\x20\x27','Show\x20campaign\x20details','engage:campaign:duplicate','html','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','length','listWorkspaces','workspace','resolveWorkspaceId','Fetching\x20campaigns...','Workspace\x20\x27','parentName','\x27...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','9qyhLRd','Deleting\x20template\x20\x27','filter','updateCampaign','data','Update\x20a\x20campaign','14830Kvubtc','Error:\x20Workspace\x20name\x20is\x20required','6ZlybAA','Create\x20an\x20email\x20template','updateTemplate','subject','Operation\x20cancelled','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','segmentId','6651PkKkWw','Fetching\x20workspaces...','670556EEkKEd','2286277cUEZkY','createCampaign','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','deleteCampaign','engage:templates','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Deleting\x20workspace\x20\x27','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','listTemplates','engage_workspace','getCampaignFull','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','resumeCampaign','engage:workspace:update','Delete\x20a\x20workspace','Resume\x20a\x20paused\x20campaign','Fetching\x20template\x20\x27','\x27\x20paused\x20successfully','Duplicating\x20campaign\x20\x27','getWorkspace','full','name','segment','Error:\x20--name\x20is\x20required','engage:template:delete','Fetching\x20workspace\x20\x27','engage:workspace:create','listCampaigns','MISSING_ARGUMENT','Error:\x20--html\x20is\x20required','Duplicate\x20a\x20campaign','Create\x20a\x20workspace','engage:template:show','engage:workspace:show','execute','deleteTemplate','engage:campaign:update','session','6117896EALaaF','entries','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','\x27\x20launched\x20successfully','Fetching\x20templates...','Creating\x20template\x20\x27','verbose','log','399907LdafqW','yes','Updating\x20template\x20\x27','List\x20campaigns','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27\x20deleted\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','error','Pause\x20a\x20campaign'];a18_0x5abf=function(){return _0x33819a;};return a18_0x5abf();}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a18_0x2dde50(0x100);['description']='Delete\x20an\x20email\x20template';async[a18_0x2dde50(0x10a)](_0x57ea0d){const _0x474bd6=a18_0x2dde50,{options:_0x5b9cbc,args:_0x3fac8e,tdx:_0x40ab3c}=_0x57ea0d;if(_0x3fac8e[_0x474bd6(0x15b)]===0x0)return console[_0x474bd6(0x11e)](_0x474bd6(0x14c)),console[_0x474bd6(0x11e)](_0x474bd6(0x110)),0x1;const _0x4d696d=_0x3fac8e[0x0],_0x119c93=_0x5b9cbc,_0x27c5e0=await resolveWorkspaceIdFromOptions(_0x119c93,_0x40ab3c);if(!_0x5b9cbc[_0x474bd6(0x117)]){const _0x3668bf=await confirm(_0x474bd6(0xed)+_0x4d696d+_0x474bd6(0x13f));if(!_0x3668bf)return console[_0x474bd6(0x115)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x474bd6(0x165)+_0x4d696d+_0x474bd6(0x162),()=>_0x40ab3c[_0x474bd6(0x150)][_0x474bd6(0x10b)](_0x4d696d,_0x27c5e0),{'verbose':_0x5b9cbc[_0x474bd6(0x114)]}),console[_0x474bd6(0x115)](_0x474bd6(0x14e)+_0x4d696d+_0x474bd6(0x11b)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a18_0x2dde50(0xfd)]='engage:workspaces';[a18_0x2dde50(0x151)]=a18_0x2dde50(0x153);async[a18_0x2dde50(0x10a)](_0x151cc6){const _0x39785e=a18_0x2dde50,{options:_0x5d1d66,args:_0x2ff47d,tdx:_0x3347e0}=_0x151cc6,_0x1430e3=_0x2ff47d[0x0],_0x214a0c=resolveLimit(_0x5d1d66[_0x39785e(0x145)],DEFAULT_LLM_LIMIT),_0x5bc6c4=await withSpinner(_0x39785e(0x177),()=>_0x3347e0[_0x39785e(0x150)][_0x39785e(0x15c)]({'limit':_0x214a0c}),{'verbose':_0x5d1d66['verbose']});let _0x54de23=_0x5bc6c4[_0x39785e(0x168)];return _0x1430e3&&(_0x54de23=_0x5bc6c4[_0x39785e(0x168)][_0x39785e(0x166)](_0x12b5a0=>matchGlobPattern(_0x12b5a0['name'],_0x1430e3))),await handleSDKOutput(_0x54de23,_0x5d1d66),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a18_0x2dde50(0x109);[a18_0x2dde50(0x151)]=a18_0x2dde50(0x154);async['execute'](_0x43fa95){const _0x3dc228=a18_0x2dde50,{options:_0x250bf5,args:_0x5e32ac,tdx:_0x151593}=_0x43fa95;if(_0x5e32ac[_0x3dc228(0x15b)]===0x0)return console['error'](_0x3dc228(0x12b)),console[_0x3dc228(0x11e)](_0x3dc228(0xf3)),0x1;const _0x25b28d=_0x5e32ac[0x0],_0x371e30=_0x250bf5,_0x1c03c4=_0x371e30[_0x3dc228(0xfc)];if(_0x1c03c4){const _0x153e72=await withSpinner(_0x3dc228(0x101)+_0x25b28d+_0x3dc228(0x162),()=>_0x151593[_0x3dc228(0x150)]['getWorkspaceFull'](_0x25b28d),{'verbose':_0x250bf5['verbose']});await handleSDKOutput([_0x153e72],_0x250bf5);}else{const _0x441dd2=await withSpinner('Fetching\x20workspace\x20\x27'+_0x25b28d+'\x27...',()=>_0x151593[_0x3dc228(0x150)][_0x3dc228(0xfb)](_0x25b28d),{'verbose':_0x250bf5[_0x3dc228(0x114)]});await handleSDKOutput([_0x441dd2],_0x250bf5);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a18_0x2dde50(0xfd)]=a18_0x2dde50(0x102);['description']=a18_0x2dde50(0x107);async['execute'](_0x377736){const _0x1ef9ff=a18_0x2dde50,{options:_0x3048d8,tdx:_0x55be97}=_0x377736,_0xe7e257=_0x3048d8,_0x16b613=_0xe7e257[_0x1ef9ff(0xfd)];if(!_0x16b613)return console[_0x1ef9ff(0x11e)](_0x1ef9ff(0xff)),console[_0x1ef9ff(0x11e)](_0x1ef9ff(0x15a)),0x1;const _0x55248a={'name':_0x16b613,'description':_0xe7e257[_0x1ef9ff(0x151)]},_0x21ef88=await withSpinner('Creating\x20workspace\x20\x27'+_0x16b613+'\x27...',()=>_0x55be97[_0x1ef9ff(0x150)]['createWorkspace'](_0x55248a));return await handleSDKOutput([_0x21ef88['data']],_0x3048d8),0x0;}}function a18_0x24db(_0x5c386c,_0x1b5035){const _0x5abfb5=a18_0x5abf();return a18_0x24db=function(_0x24dbe6,_0x10412d){_0x24dbe6=_0x24dbe6-0xec;let _0x41313c=_0x5abfb5[_0x24dbe6];return _0x41313c;},a18_0x24db(_0x5c386c,_0x1b5035);}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a18_0x2dde50(0xfd)]=a18_0x2dde50(0xf5);[a18_0x2dde50(0x151)]='Update\x20a\x20workspace';async[a18_0x2dde50(0x10a)](_0x352cb4){const _0x20dd4c=a18_0x2dde50,{options:_0x572964,args:_0x5d8a86,tdx:_0x16842f}=_0x352cb4;if(_0x5d8a86[_0x20dd4c(0x15b)]===0x0)return console[_0x20dd4c(0x11e)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x20dd4c(0x11e)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x2efa89=_0x5d8a86[0x0],_0x2e36d2=_0x572964,_0x5e1a6c={'name':_0x2e36d2['name'],'description':_0x2e36d2[_0x20dd4c(0x151)]},_0x330b57=Object[_0x20dd4c(0x135)](Object['entries'](_0x5e1a6c)[_0x20dd4c(0x166)](([,_0x4b8f41])=>_0x4b8f41!==undefined));if(Object['keys'](_0x330b57)[_0x20dd4c(0x15b)]===0x0)return console['error'](_0x20dd4c(0x13e)),console['error'](_0x20dd4c(0x129)),0x1;const _0x4f38f3=await withSpinner('Updating\x20workspace\x20\x27'+_0x2efa89+'\x27...',()=>_0x16842f[_0x20dd4c(0x150)]['updateWorkspace'](_0x2efa89,_0x330b57),{'verbose':_0x572964[_0x20dd4c(0x114)]});return await handleSDKOutput([_0x4f38f3[_0x20dd4c(0x168)]],_0x572964),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a18_0x2dde50(0xfd)]=a18_0x2dde50(0x152);[a18_0x2dde50(0x151)]=a18_0x2dde50(0xf6);async[a18_0x2dde50(0x10a)](_0x2759d6){const _0x331ef9=a18_0x2dde50,{options:_0x5e016e,args:_0x45a445,tdx:_0x2740b9}=_0x2759d6;if(_0x45a445[_0x331ef9(0x15b)]===0x0)return console[_0x331ef9(0x11e)](_0x331ef9(0x12b)),console[_0x331ef9(0x11e)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x506529=_0x45a445[0x0];if(!_0x5e016e['yes']){const _0x2d0aea=await confirm(_0x331ef9(0x17b)+_0x506529+_0x331ef9(0x13f));if(!_0x2d0aea)return console[_0x331ef9(0x115)](_0x331ef9(0x170)),0x0;}return await withSpinner(_0x331ef9(0xee)+_0x506529+'\x27...',()=>_0x2740b9['engage'][_0x331ef9(0x12d)](_0x506529),{'verbose':_0x5e016e[_0x331ef9(0x114)]}),console[_0x331ef9(0x115)](_0x331ef9(0x160)+_0x506529+_0x331ef9(0x11b)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a18_0x2dde50(0xfd)]=a18_0x2dde50(0x122);[a18_0x2dde50(0x151)]=a18_0x2dde50(0x172);async['execute'](_0x2e890b){const _0x169bdd=a18_0x2dde50,{options:_0x1e717c,args:_0x1c7b10,tdx:_0x46d311}=_0x2e890b;if(_0x1c7b10['length']===0x0)return console[_0x169bdd(0x11e)](_0x169bdd(0x16b)),console[_0x169bdd(0x11e)](_0x169bdd(0x132)),0x1;const _0x218726=_0x1c7b10[0x0];await withSpinner(_0x169bdd(0x12f)+_0x218726+_0x169bdd(0x162),()=>_0x46d311[_0x169bdd(0x150)]['resolveWorkspaceId'](_0x218726));const _0xb05a93=_0x1e717c[_0x169bdd(0x10d)]||undefined;return saveSessionContext({'engage_workspace':_0x218726},_0xb05a93),console[_0x169bdd(0x115)](_0x169bdd(0x148)+_0x218726),console[_0x169bdd(0x115)](_0x169bdd(0x159)),0x0;}}
|
|
1
|
+
const a18_0x135397=a18_0x3209;(function(_0x56eebf,_0x51c000){const _0x1c1a61=a18_0x3209,_0x23ddc4=_0x56eebf();while(!![]){try{const _0x177ed1=parseInt(_0x1c1a61(0xcd))/0x1*(parseInt(_0x1c1a61(0xb9))/0x2)+parseInt(_0x1c1a61(0xd1))/0x3+parseInt(_0x1c1a61(0x101))/0x4+-parseInt(_0x1c1a61(0xb0))/0x5+parseInt(_0x1c1a61(0xa3))/0x6+-parseInt(_0x1c1a61(0xb8))/0x7+-parseInt(_0x1c1a61(0x9d))/0x8;if(_0x177ed1===_0x51c000)break;else _0x23ddc4['push'](_0x23ddc4['shift']());}catch(_0x5ab07a){_0x23ddc4['push'](_0x23ddc4['shift']());}}}(a18_0x9f0d,0xdca61));import{BaseCommand}from'./command.js';function a18_0x3209(_0xd014be,_0x258cbb){const _0x9f0d74=a18_0x9f0d();return a18_0x3209=function(_0x320917,_0x37ed58){_0x320917=_0x320917-0x9a;let _0x5278a8=_0x9f0d74[_0x320917];return _0x5278a8;},a18_0x3209(_0xd014be,_0x258cbb);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0xe93bae,_0x348bf4,_0x227af5=![]){const _0x3749e9=a18_0x3209;if(_0xe93bae[_0x3749e9(0xa5)])return await _0x348bf4['engage']['resolveWorkspaceId'](_0xe93bae[_0x3749e9(0xa5)]);const _0x52791f=loadSessionContext(_0xe93bae['session']);if(_0x52791f?.[_0x3749e9(0xc5)])return await _0x348bf4[_0x3749e9(0x108)]['resolveWorkspaceId'](_0x52791f[_0x3749e9(0xc5)]);if(_0x227af5)throw new SDKError(ErrorCode[_0x3749e9(0xef)],_0x3749e9(0x10e),undefined,{'helpText':_0x3749e9(0xd0)});return undefined;}async function resolveSegmentFromOptions(_0x21094a,_0x453c4b){const _0x1b77d8=a18_0x3209;if(!_0x21094a[_0x1b77d8(0xf8)])return{};const _0xae9681=_0x21094a[_0x1b77d8(0xf8)],_0x5f355e=await _0x453c4b['segment']['resolvePathToResource'](_0xae9681);return{'audienceId':_0x5f355e[_0x1b77d8(0x103)],'audienceName':_0x5f355e[_0x1b77d8(0x105)],..._0x5f355e[_0x1b77d8(0x10b)]&&{'segmentId':_0x5f355e[_0x1b77d8(0x10b)],'segmentName':_0x5f355e['segmentName']}};}function buildConnectorConfig(_0x11edd5){const _0x52b775=a18_0x3209,_0x45d6ba=_0x11edd5[_0x52b775(0x111)],_0x1c7346=_0x11edd5['jsonColumns'];if(!_0x45d6ba&&!_0x1c7346)return undefined;return{..._0x45d6ba&&{'emailSenderId':_0x45d6ba},..._0x1c7346&&{'jsonColumns':_0x1c7346}};}export class EngageCampaignsCommand extends BaseCommand{['name']='engage:campaigns';['description']=a18_0x135397(0xdd);async[a18_0x135397(0xa4)](_0x24bbf7){const _0x4a9fcd=a18_0x135397,{options:_0x129e36,args:_0x1f967e,tdx:_0x19b00b}=_0x24bbf7,_0x388e97=_0x1f967e[0x0],_0x1462df=resolveLimit(_0x129e36[_0x4a9fcd(0xf4)],DEFAULT_LLM_LIMIT),_0x19889f=_0x129e36,_0x5219a9=_0x19889f[_0x4a9fcd(0xca)],_0x16f702=_0x19889f['status'],_0x3e1d04=await resolveWorkspaceIdFromOptions(_0x19889f,_0x19b00b),_0x155b35=await withSpinner('Fetching\x20campaigns...',()=>_0x19b00b['engage']['listCampaigns']({'type':_0x5219a9,'status':_0x16f702,'workspaceId':_0x3e1d04,'limit':_0x1462df}),{'verbose':_0x129e36[_0x4a9fcd(0xf5)]});let _0x2e4441=_0x155b35[_0x4a9fcd(0xb5)];return _0x388e97&&(_0x2e4441=_0x155b35[_0x4a9fcd(0xb5)][_0x4a9fcd(0xd4)](_0x5a26a8=>matchGlobPattern(_0x5a26a8[_0x4a9fcd(0x107)],_0x388e97))),await handleSDKOutput(_0x2e4441,_0x129e36),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a18_0x135397(0x107)]='engage:campaign:show';[a18_0x135397(0xc1)]=a18_0x135397(0x112);async[a18_0x135397(0xa4)](_0x5a0eb4){const _0x2fd930=a18_0x135397,{options:_0x1e7de1,args:_0x2377fc,tdx:_0x22c8fc}=_0x5a0eb4;if(_0x2377fc[_0x2fd930(0xa1)]===0x0)return console[_0x2fd930(0xba)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x2fd930(0xba)](_0x2fd930(0x9b)),0x1;const _0x3bfea6=_0x2377fc[0x0],_0x5a63df=_0x1e7de1,_0x5c19d4=await resolveWorkspaceIdFromOptions(_0x5a63df,_0x22c8fc),_0x4bcc43=_0x5a63df['full'];if(_0x4bcc43){const _0x1e17f7=await withSpinner(_0x2fd930(0xe9)+_0x3bfea6+_0x2fd930(0x113),()=>_0x22c8fc[_0x2fd930(0x108)][_0x2fd930(0xb3)](_0x3bfea6,_0x5c19d4),{'verbose':_0x1e7de1[_0x2fd930(0xf5)]});await handleSDKOutput([_0x1e17f7],_0x1e7de1);}else{const _0x443bd7=await withSpinner(_0x2fd930(0xe9)+_0x3bfea6+_0x2fd930(0x113),()=>_0x22c8fc[_0x2fd930(0x108)][_0x2fd930(0xbd)](_0x3bfea6,_0x5c19d4),{'verbose':_0x1e7de1['verbose']});await handleSDKOutput([_0x443bd7],_0x1e7de1);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a18_0x135397(0x107)]=a18_0x135397(0xec);[a18_0x135397(0xc1)]='Create\x20a\x20new\x20campaign';async['execute'](_0x4790e9){const _0x385d59=a18_0x135397,{options:_0x23e05f,tdx:_0x3737df}=_0x4790e9,_0x5b924e=_0x23e05f,_0x3dc27a=_0x5b924e[_0x385d59(0x107)],_0x3c4d9c=_0x5b924e['type'];if(!_0x3dc27a)return console[_0x385d59(0xba)](_0x385d59(0xf9)),console[_0x385d59(0xba)](_0x385d59(0xa9)),0x1;if(!_0x3c4d9c)return console[_0x385d59(0xba)]('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0x385d59(0xba)](_0x385d59(0xa9)),0x1;const _0x5305c9=await resolveWorkspaceIdFromOptions(_0x5b924e,_0x3737df,!![]),_0x8ab5d1=await resolveSegmentFromOptions(_0x5b924e,_0x3737df),_0x24f7d3=buildConnectorConfig(_0x5b924e),_0x11b0ac={'name':_0x3dc27a,'campaignType':_0x3c4d9c,'workspaceId':_0x5305c9,'description':_0x5b924e[_0x385d59(0xc1)],..._0x8ab5d1,'connectorConfig':_0x24f7d3,'startAt':_0x5b924e[_0x385d59(0xdb)],'timezone':_0x5b924e['timezone']},_0x159820=await withSpinner(_0x385d59(0xee)+_0x3dc27a+'\x27...',()=>_0x3737df['engage'][_0x385d59(0xe5)](_0x11b0ac));return await handleSDKOutput([_0x159820[_0x385d59(0xb5)]],_0x23e05f),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a18_0x135397(0x107)]='engage:campaign:update';[a18_0x135397(0xc1)]=a18_0x135397(0xe1);async['execute'](_0x5dc162){const _0x42d4f0=a18_0x135397,{options:_0x5106a5,args:_0x13c2cc,tdx:_0x3b981a}=_0x5dc162;if(_0x13c2cc[_0x42d4f0(0xa1)]===0x0)return console[_0x42d4f0(0xba)](_0x42d4f0(0xbb)),console[_0x42d4f0(0xba)](_0x42d4f0(0xd8)),0x1;const _0x49cd43=_0x13c2cc[0x0],_0x56aaf7=_0x5106a5,_0x3bbc11=await resolveWorkspaceIdFromOptions(_0x56aaf7,_0x3b981a),_0x6dc69d=await resolveSegmentFromOptions(_0x56aaf7,_0x3b981a),_0x476115=buildConnectorConfig(_0x56aaf7),_0x5230c0={'name':_0x56aaf7['name'],'description':_0x56aaf7[_0x42d4f0(0xc1)],..._0x6dc69d,'connectorConfig':_0x476115,'startAt':_0x56aaf7[_0x42d4f0(0xdb)],'timezone':_0x56aaf7[_0x42d4f0(0xd6)]},_0x2bd32b=Object['fromEntries'](Object['entries'](_0x5230c0)[_0x42d4f0(0xd4)](([,_0x2dc1e9])=>_0x2dc1e9!==undefined));if(Object['keys'](_0x2bd32b)[_0x42d4f0(0xa1)]===0x0)return console[_0x42d4f0(0xba)](_0x42d4f0(0x116)),console[_0x42d4f0(0xba)](_0x42d4f0(0x11b)),0x1;const _0x281fea=await withSpinner('Updating\x20campaign\x20\x27'+_0x49cd43+_0x42d4f0(0x113),()=>_0x3b981a[_0x42d4f0(0x108)][_0x42d4f0(0xd2)](_0x49cd43,_0x2bd32b,_0x3bbc11),{'verbose':_0x5106a5['verbose']});return await handleSDKOutput([_0x281fea[_0x42d4f0(0xb5)]],_0x5106a5),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a18_0x135397(0x107)]='engage:campaign:delete';[a18_0x135397(0xc1)]=a18_0x135397(0x100);async['execute'](_0x3fd805){const _0x42212f=a18_0x135397,{options:_0x4b0167,args:_0x469002,tdx:_0x408ae1}=_0x3fd805;if(_0x469002[_0x42212f(0xa1)]===0x0)return console[_0x42212f(0xba)](_0x42212f(0xbb)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x53c2b3=_0x469002[0x0],_0x3de09a=_0x4b0167,_0x321733=await resolveWorkspaceIdFromOptions(_0x3de09a,_0x408ae1);if(!_0x4b0167['yes']){const _0x186efd=await confirm(_0x42212f(0xcf)+_0x53c2b3+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x186efd)return console[_0x42212f(0xc7)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x42212f(0x102)+_0x53c2b3+_0x42212f(0x113),()=>_0x408ae1[_0x42212f(0x108)][_0x42212f(0xfa)](_0x53c2b3,_0x321733),{'verbose':_0x4b0167[_0x42212f(0xf5)]}),console['log']('Campaign\x20\x27'+_0x53c2b3+_0x42212f(0xeb)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a18_0x135397(0x107)]=a18_0x135397(0x109);[a18_0x135397(0xc1)]='Launch\x20a\x20campaign';async[a18_0x135397(0xa4)](_0x1507ba){const _0x6ce224=a18_0x135397,{options:_0x428321,args:_0x368b6a,tdx:_0x305be0}=_0x1507ba;if(_0x368b6a[_0x6ce224(0xa1)]===0x0)return console[_0x6ce224(0xba)](_0x6ce224(0xbb)),console[_0x6ce224(0xba)](_0x6ce224(0xbc)),0x1;const _0x422cce=_0x368b6a[0x0],_0x5bd880=_0x428321,_0x2c8b21=await resolveWorkspaceIdFromOptions(_0x5bd880,_0x305be0);return await withSpinner(_0x6ce224(0x10c)+_0x422cce+_0x6ce224(0x113),()=>_0x305be0[_0x6ce224(0x108)][_0x6ce224(0xb2)](_0x422cce,_0x2c8b21),{'verbose':_0x428321[_0x6ce224(0xf5)]}),console[_0x6ce224(0xc7)](_0x6ce224(0xae)+_0x422cce+'\x27\x20launched\x20successfully'),0x0;}}function a18_0x9f0d(){const _0x4699f3=['emailSenderId','Show\x20campaign\x20details','\x27...','Resuming\x20campaign\x20\x27','\x27\x20paused\x20successfully','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Template\x20\x27','keys','engage:workspace:update','Error:\x20--html\x20is\x20required','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','session','listTemplates','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Deleting\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Update\x20a\x20workspace','947040LDTwLJ','resumeCampaign','Delete\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','length','engage:campaign:pause','2057982biSmyo','execute','workspace','Delete\x20a\x20workspace','Pausing\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','yes','Updating\x20template\x20\x27','pauseCampaign','engage:campaign:duplicate','Campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','6190385FngKqt','Pause\x20a\x20campaign','launchCampaign','getCampaignFull','Error:\x20Workspace\x20name\x20is\x20required','data','full','List\x20workspaces','324058FvLvAX','38ksXSEw','error','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','getCampaign','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Update\x20an\x20email\x20template','description','deleteTemplate','Resume\x20a\x20paused\x20campaign','engage:workspace:create','engage_workspace','plaintext','log','subject','engage:template:update','type','createTemplate','Operation\x20cancelled','70381cCnvgi','Fetching\x20template\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','757542bWQztw','updateCampaign','Verifying\x20workspace\x20\x27','filter','html','timezone','duplicateCampaign','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27\x20resumed\x20successfully','engage:template:create','startAt','Duplicate\x20a\x20campaign','List\x20campaigns','Engage\x20workspace\x20set\x20to:\x20','listWorkspaces','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','Update\x20a\x20campaign','engage:workspace:use','Fetching\x20workspaces...','deleteWorkspace','createCampaign','createWorkspace','engage:workspaces','List\x20email\x20templates','Fetching\x20campaign\x20\x27','Workspace\x20\x27','\x27\x20deleted\x20successfully','engage:campaign:create','engage:workspace:delete','Creating\x20campaign\x20\x27','MISSING_ARGUMENT','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Show\x20email\x20template\x20details','Fetching\x20templates...','getTemplateFull','limit','verbose','getWorkspace','Fetching\x20workspace\x20\x27','segment','Error:\x20--name\x20is\x20required','deleteCampaign','getTemplate','\x27?\x20This\x20cannot\x20be\x20undone.','entries','engage:template:delete','Create\x20an\x20email\x20template','Delete\x20a\x20campaign','1495112QrxDju','Deleting\x20campaign\x20\x27','parentId','editorType','parentName','Updating\x20workspace\x20\x27','name','engage','engage:campaign:launch','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','segmentId','Launching\x20campaign\x20\x27','Options:\x20--name,\x20--description','Workspace\x20is\x20required\x20for\x20this\x20operation','updateWorkspace','Show\x20workspace\x20details'];a18_0x9f0d=function(){return _0x4699f3;};return a18_0x9f0d();}export class EngageCampaignPauseCommand extends BaseCommand{[a18_0x135397(0x107)]=a18_0x135397(0xa2);[a18_0x135397(0xc1)]=a18_0x135397(0xb1);async[a18_0x135397(0xa4)](_0x270405){const _0x3ffa74=a18_0x135397,{options:_0x2eaddf,args:_0x21e4ca,tdx:_0xcae7c0}=_0x270405;if(_0x21e4ca[_0x3ffa74(0xa1)]===0x0)return console[_0x3ffa74(0xba)](_0x3ffa74(0xbb)),console[_0x3ffa74(0xba)](_0x3ffa74(0x10a)),0x1;const _0x5e91a8=_0x21e4ca[0x0],_0x2b46ca=_0x2eaddf,_0x34263c=await resolveWorkspaceIdFromOptions(_0x2b46ca,_0xcae7c0);return await withSpinner(_0x3ffa74(0xa7)+_0x5e91a8+'\x27...',()=>_0xcae7c0[_0x3ffa74(0x108)][_0x3ffa74(0xac)](_0x5e91a8,_0x34263c),{'verbose':_0x2eaddf[_0x3ffa74(0xf5)]}),console['log'](_0x3ffa74(0xae)+_0x5e91a8+_0x3ffa74(0x115)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a18_0x135397(0x107)]='engage:campaign:resume';[a18_0x135397(0xc1)]=a18_0x135397(0xc3);async[a18_0x135397(0xa4)](_0x1ef9fc){const _0x56a8e6=a18_0x135397,{options:_0x3b9c76,args:_0x52c408,tdx:_0x7124ae}=_0x1ef9fc;if(_0x52c408[_0x56a8e6(0xa1)]===0x0)return console[_0x56a8e6(0xba)](_0x56a8e6(0xbb)),console[_0x56a8e6(0xba)](_0x56a8e6(0xa0)),0x1;const _0x5a3c4c=_0x52c408[0x0],_0x491aa2=_0x3b9c76,_0x309cb7=await resolveWorkspaceIdFromOptions(_0x491aa2,_0x7124ae);return await withSpinner(_0x56a8e6(0x114)+_0x5a3c4c+_0x56a8e6(0x113),()=>_0x7124ae[_0x56a8e6(0x108)][_0x56a8e6(0x9e)](_0x5a3c4c,_0x309cb7),{'verbose':_0x3b9c76[_0x56a8e6(0xf5)]}),console[_0x56a8e6(0xc7)](_0x56a8e6(0xae)+_0x5a3c4c+_0x56a8e6(0xd9)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a18_0x135397(0xad);['description']=a18_0x135397(0xdc);async['execute'](_0x4fa6d8){const _0x2ef297=a18_0x135397,{options:_0xe905d7,args:_0x867638,tdx:_0x5a15df}=_0x4fa6d8;if(_0x867638[_0x2ef297(0xa1)]===0x0)return console[_0x2ef297(0xba)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x2ef297(0xba)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0xd53f61=_0x867638[0x0],_0xf8536e=_0xe905d7,_0x1a3448=await resolveWorkspaceIdFromOptions(_0xf8536e,_0x5a15df),_0x58214a=await withSpinner('Duplicating\x20campaign\x20\x27'+_0xd53f61+'\x27...',()=>_0x5a15df[_0x2ef297(0x108)][_0x2ef297(0xd7)](_0xd53f61,_0x1a3448),{'verbose':_0xe905d7[_0x2ef297(0xf5)]});return await handleSDKOutput([_0x58214a[_0x2ef297(0xb5)]],_0xe905d7),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a18_0x135397(0x107)]='engage:templates';[a18_0x135397(0xc1)]=a18_0x135397(0xe8);async[a18_0x135397(0xa4)](_0xf31fe6){const _0x5d87f6=a18_0x135397,{options:_0x3f0fd8,args:_0x5090eb,tdx:_0xdf7733}=_0xf31fe6,_0x2a760c=_0x5090eb[0x0],_0x5982b8=resolveLimit(_0x3f0fd8[_0x5d87f6(0xf4)],DEFAULT_LLM_LIMIT),_0x505c6b=_0x3f0fd8,_0x3b04aa=await resolveWorkspaceIdFromOptions(_0x505c6b,_0xdf7733),_0x2a97cb=await withSpinner(_0x5d87f6(0xf2),()=>_0xdf7733[_0x5d87f6(0x108)][_0x5d87f6(0x11d)]({'workspaceId':_0x3b04aa,'limit':_0x5982b8}),{'verbose':_0x3f0fd8['verbose']});let _0x2a4761=_0x2a97cb[_0x5d87f6(0xb5)];return _0x2a760c&&(_0x2a4761=_0x2a97cb[_0x5d87f6(0xb5)][_0x5d87f6(0xd4)](_0x56ea75=>matchGlobPattern(_0x56ea75[_0x5d87f6(0x107)],_0x2a760c))),await handleSDKOutput(_0x2a4761,_0x3f0fd8),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']='engage:template:show';[a18_0x135397(0xc1)]=a18_0x135397(0xf1);async[a18_0x135397(0xa4)](_0x2e78b5){const _0x22b48a=a18_0x135397,{options:_0xe5e446,args:_0x114041,tdx:_0x3897ca}=_0x2e78b5;if(_0x114041['length']===0x0)return console[_0x22b48a(0xba)](_0x22b48a(0xbe)),console[_0x22b48a(0xba)](_0x22b48a(0xf0)),0x1;const _0x41e845=_0x114041[0x0],_0x592026=_0xe5e446,_0x132aed=await resolveWorkspaceIdFromOptions(_0x592026,_0x3897ca),_0x3cb9d3=_0x592026[_0x22b48a(0xb6)];if(_0x3cb9d3){const _0xe106af=await withSpinner(_0x22b48a(0xce)+_0x41e845+'\x27...',()=>_0x3897ca[_0x22b48a(0x108)][_0x22b48a(0xf3)](_0x41e845,_0x132aed),{'verbose':_0xe5e446[_0x22b48a(0xf5)]});await handleSDKOutput([_0xe106af],_0xe5e446);}else{const _0x3615bf=await withSpinner(_0x22b48a(0xce)+_0x41e845+_0x22b48a(0x113),()=>_0x3897ca[_0x22b48a(0x108)][_0x22b48a(0xfb)](_0x41e845,_0x132aed),{'verbose':_0xe5e446['verbose']});await handleSDKOutput([_0x3615bf],_0xe5e446);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']=a18_0x135397(0xda);[a18_0x135397(0xc1)]=a18_0x135397(0xff);async['execute'](_0x14101b){const _0x2cf879=a18_0x135397,{options:_0x18461b,tdx:_0x2fcd45}=_0x14101b,_0x40aa28=_0x18461b,_0x4c2108=_0x40aa28[_0x2cf879(0x107)],_0x434b71=_0x40aa28[_0x2cf879(0xc8)],_0x560526=_0x40aa28[_0x2cf879(0xd5)];if(!_0x4c2108)return console[_0x2cf879(0xba)](_0x2cf879(0xf9)),console['error']('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x434b71)return console[_0x2cf879(0xba)]('Error:\x20--subject\x20is\x20required'),0x1;if(!_0x560526)return console[_0x2cf879(0xba)](_0x2cf879(0x11a)),0x1;const _0x58b97c=await resolveWorkspaceIdFromOptions(_0x40aa28,_0x2fcd45,!![]),_0x33ee8e={'name':_0x4c2108,'subjectTemplate':_0x434b71,'htmlTemplate':_0x560526,'workspaceId':_0x58b97c,'plaintextTemplate':_0x40aa28[_0x2cf879(0xc6)],'editorType':_0x40aa28[_0x2cf879(0x104)]},_0x129be1=await withSpinner('Creating\x20template\x20\x27'+_0x4c2108+_0x2cf879(0x113),()=>_0x2fcd45[_0x2cf879(0x108)][_0x2cf879(0xcb)](_0x33ee8e));return await handleSDKOutput([_0x129be1[_0x2cf879(0xb5)]],_0x18461b),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a18_0x135397(0xc9);[a18_0x135397(0xc1)]=a18_0x135397(0xc0);async['execute'](_0x13dff4){const _0x4a59ad=a18_0x135397,{options:_0x1930a4,args:_0x210a1a,tdx:_0x4277f5}=_0x13dff4;if(_0x210a1a[_0x4a59ad(0xa1)]===0x0)return console['error'](_0x4a59ad(0xbe)),console[_0x4a59ad(0xba)](_0x4a59ad(0xbf)),0x1;const _0x5b9f1b=_0x210a1a[0x0],_0xa1236=_0x1930a4,_0x3a39c2=await resolveWorkspaceIdFromOptions(_0xa1236,_0x4277f5),_0x55f65a={'name':_0xa1236[_0x4a59ad(0x107)],'subjectTemplate':_0xa1236[_0x4a59ad(0xc8)],'htmlTemplate':_0xa1236[_0x4a59ad(0xd5)],'plaintextTemplate':_0xa1236['plaintext']},_0x2ad629=Object['fromEntries'](Object[_0x4a59ad(0xfd)](_0x55f65a)['filter'](([,_0x2387a3])=>_0x2387a3!==undefined));if(Object['keys'](_0x2ad629)[_0x4a59ad(0xa1)]===0x0)return console[_0x4a59ad(0xba)](_0x4a59ad(0x116)),console[_0x4a59ad(0xba)]('Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext'),0x1;const _0x3fb021=await withSpinner(_0x4a59ad(0xab)+_0x5b9f1b+_0x4a59ad(0x113),()=>_0x4277f5[_0x4a59ad(0x108)]['updateTemplate'](_0x5b9f1b,_0x2ad629,_0x3a39c2),{'verbose':_0x1930a4[_0x4a59ad(0xf5)]});return await handleSDKOutput([_0x3fb021[_0x4a59ad(0xb5)]],_0x1930a4),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a18_0x135397(0x107)]=a18_0x135397(0xfe);[a18_0x135397(0xc1)]=a18_0x135397(0x9f);async[a18_0x135397(0xa4)](_0x2395a1){const _0x380256=a18_0x135397,{options:_0x3ee974,args:_0xa4e916,tdx:_0xec603d}=_0x2395a1;if(_0xa4e916['length']===0x0)return console[_0x380256(0xba)](_0x380256(0xbe)),console[_0x380256(0xba)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x4adcf9=_0xa4e916[0x0],_0x1b7cef=_0x3ee974,_0x45d29b=await resolveWorkspaceIdFromOptions(_0x1b7cef,_0xec603d);if(!_0x3ee974[_0x380256(0xaa)]){const _0x51fdcf=await confirm(_0x380256(0xaf)+_0x4adcf9+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x51fdcf)return console[_0x380256(0xc7)](_0x380256(0xcc)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x4adcf9+_0x380256(0x113),()=>_0xec603d[_0x380256(0x108)][_0x380256(0xc2)](_0x4adcf9,_0x45d29b),{'verbose':_0x3ee974[_0x380256(0xf5)]}),console['log'](_0x380256(0x117)+_0x4adcf9+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a18_0x135397(0x107)]=a18_0x135397(0xe7);[a18_0x135397(0xc1)]=a18_0x135397(0xb7);async[a18_0x135397(0xa4)](_0x530c63){const _0x28b68d=a18_0x135397,{options:_0x12aa8e,args:_0x3474ea,tdx:_0x1df8c4}=_0x530c63,_0x5ad71f=_0x3474ea[0x0],_0x26df91=resolveLimit(_0x12aa8e[_0x28b68d(0xf4)],DEFAULT_LLM_LIMIT),_0x4e82d1=await withSpinner(_0x28b68d(0xe3),()=>_0x1df8c4[_0x28b68d(0x108)][_0x28b68d(0xdf)]({'limit':_0x26df91}),{'verbose':_0x12aa8e[_0x28b68d(0xf5)]});let _0x2c929f=_0x4e82d1[_0x28b68d(0xb5)];return _0x5ad71f&&(_0x2c929f=_0x4e82d1[_0x28b68d(0xb5)][_0x28b68d(0xd4)](_0x2fd556=>matchGlobPattern(_0x2fd556[_0x28b68d(0x107)],_0x5ad71f))),await handleSDKOutput(_0x2c929f,_0x12aa8e),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a18_0x135397(0x107)]='engage:workspace:show';[a18_0x135397(0xc1)]=a18_0x135397(0x110);async[a18_0x135397(0xa4)](_0x4a263e){const _0xbbb35d=a18_0x135397,{options:_0x5c541a,args:_0x455633,tdx:_0x449ac4}=_0x4a263e;if(_0x455633[_0xbbb35d(0xa1)]===0x0)return console[_0xbbb35d(0xba)](_0xbbb35d(0x11e)),console[_0xbbb35d(0xba)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x17b2b3=_0x455633[0x0],_0x390c4a=_0x5c541a,_0x195933=_0x390c4a['full'];if(_0x195933){const _0x52d61f=await withSpinner(_0xbbb35d(0xf7)+_0x17b2b3+_0xbbb35d(0x113),()=>_0x449ac4['engage']['getWorkspaceFull'](_0x17b2b3),{'verbose':_0x5c541a[_0xbbb35d(0xf5)]});await handleSDKOutput([_0x52d61f],_0x5c541a);}else{const _0x580f6b=await withSpinner(_0xbbb35d(0xf7)+_0x17b2b3+_0xbbb35d(0x113),()=>_0x449ac4[_0xbbb35d(0x108)][_0xbbb35d(0xf6)](_0x17b2b3),{'verbose':_0x5c541a[_0xbbb35d(0xf5)]});await handleSDKOutput([_0x580f6b],_0x5c541a);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a18_0x135397(0x107)]=a18_0x135397(0xc4);[a18_0x135397(0xc1)]='Create\x20a\x20workspace';async['execute'](_0xaea5df){const _0x5684bd=a18_0x135397,{options:_0x59ba36,tdx:_0x16cdcd}=_0xaea5df,_0x2905d4=_0x59ba36,_0x17d1ad=_0x2905d4[_0x5684bd(0x107)];if(!_0x17d1ad)return console['error'](_0x5684bd(0xf9)),console['error'](_0x5684bd(0xa8)),0x1;const _0x44a71c={'name':_0x17d1ad,'description':_0x2905d4['description']},_0x39049b=await withSpinner('Creating\x20workspace\x20\x27'+_0x17d1ad+_0x5684bd(0x113),()=>_0x16cdcd[_0x5684bd(0x108)][_0x5684bd(0xe6)](_0x44a71c));return await handleSDKOutput([_0x39049b[_0x5684bd(0xb5)]],_0x59ba36),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a18_0x135397(0x107)]=a18_0x135397(0x119);[a18_0x135397(0xc1)]=a18_0x135397(0x9c);async['execute'](_0x5f2656){const _0x5f0df2=a18_0x135397,{options:_0x472e0f,args:_0x229821,tdx:_0x5ee973}=_0x5f2656;if(_0x229821[_0x5f0df2(0xa1)]===0x0)return console[_0x5f0df2(0xba)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x2de07c=_0x229821[0x0],_0xd0f9a2=_0x472e0f,_0x2cb50e={'name':_0xd0f9a2[_0x5f0df2(0x107)],'description':_0xd0f9a2[_0x5f0df2(0xc1)]},_0x152058=Object['fromEntries'](Object['entries'](_0x2cb50e)['filter'](([,_0x204166])=>_0x204166!==undefined));if(Object[_0x5f0df2(0x118)](_0x152058)[_0x5f0df2(0xa1)]===0x0)return console[_0x5f0df2(0xba)](_0x5f0df2(0x116)),console[_0x5f0df2(0xba)](_0x5f0df2(0x10d)),0x1;const _0x4a94c4=await withSpinner(_0x5f0df2(0x106)+_0x2de07c+_0x5f0df2(0x113),()=>_0x5ee973[_0x5f0df2(0x108)][_0x5f0df2(0x10f)](_0x2de07c,_0x152058),{'verbose':_0x472e0f[_0x5f0df2(0xf5)]});return await handleSDKOutput([_0x4a94c4[_0x5f0df2(0xb5)]],_0x472e0f),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a18_0x135397(0x107)]=a18_0x135397(0xed);[a18_0x135397(0xc1)]=a18_0x135397(0xa6);async[a18_0x135397(0xa4)](_0x1afdfa){const _0x2e0f58=a18_0x135397,{options:_0xbe7769,args:_0xa4b1e,tdx:_0x5ba835}=_0x1afdfa;if(_0xa4b1e['length']===0x0)return console[_0x2e0f58(0xba)](_0x2e0f58(0x11e)),console[_0x2e0f58(0xba)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x2fcca0=_0xa4b1e[0x0];if(!_0xbe7769[_0x2e0f58(0xaa)]){const _0x17972c=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x2fcca0+_0x2e0f58(0xfc));if(!_0x17972c)return console[_0x2e0f58(0xc7)](_0x2e0f58(0xcc)),0x0;}return await withSpinner(_0x2e0f58(0x9a)+_0x2fcca0+_0x2e0f58(0x113),()=>_0x5ba835[_0x2e0f58(0x108)][_0x2e0f58(0xe4)](_0x2fcca0),{'verbose':_0xbe7769['verbose']}),console['log'](_0x2e0f58(0xea)+_0x2fcca0+_0x2e0f58(0xeb)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a18_0x135397(0x107)]=a18_0x135397(0xe2);[a18_0x135397(0xc1)]='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async[a18_0x135397(0xa4)](_0x4495c6){const _0x401f85=a18_0x135397,{options:_0xf0248a,args:_0x29b6f0,tdx:_0x2541d1}=_0x4495c6;if(_0x29b6f0[_0x401f85(0xa1)]===0x0)return console[_0x401f85(0xba)](_0x401f85(0xb4)),console[_0x401f85(0xba)](_0x401f85(0xe0)),0x1;const _0x6d53c2=_0x29b6f0[0x0];await withSpinner(_0x401f85(0xd3)+_0x6d53c2+_0x401f85(0x113),()=>_0x2541d1['engage']['resolveWorkspaceId'](_0x6d53c2));const _0x4becf7=_0xf0248a[_0x401f85(0x11c)]||undefined;return saveSessionContext({'engage_workspace':_0x6d53c2},_0x4becf7),console['log'](_0x401f85(0xde)+_0x6d53c2),console[_0x401f85(0xc7)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
const a19_0x372571=a19_0x3b49;(function(_0x26e0b3,_0x4944e6){const _0x5632f6=a19_0x3b49,_0x535837=_0x26e0b3();while(!![]){try{const _0x384287=-parseInt(_0x5632f6(0xf8))/0x1+parseInt(_0x5632f6(0x111))/0x2*(parseInt(_0x5632f6(0xf7))/0x3)+-parseInt(_0x5632f6(0x102))/0x4+parseInt(_0x5632f6(0x127))/0x5+parseInt(_0x5632f6(0x121))/0x6+parseInt(_0x5632f6(0x11e))/0x7+parseInt(_0x5632f6(0xeb))/0x8*(-parseInt(_0x5632f6(0xf1))/0x9);if(_0x384287===_0x4944e6)break;else _0x535837['push'](_0x535837['shift']());}catch(_0x572723){_0x535837['push'](_0x535837['shift']());}}}(a19_0x18d4,0xe93c5));import{BaseCommand}from'./command.js';function a19_0x18d4(){const _0x1b1290=['Database:\x20','priority','url','Kill\x20a\x20job','kill','267kmTrqi','350022sUfDzs','Usage:\x20job\x20kill\x20<job-id>','Error:\x20Job\x20ID\x20is\x20required','yes','type','file','Job\x20type:\x20','Get\x20job\x20results','error','length','2551664HsgpjK','Cancelled','job:kill','trino','Getting\x20job\x20results...','job_id','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','cause','\x20\x20Job\x20ID:\x20','Submit\x20a\x20job','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','message','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','description','debug','31246DEbGLw','show','jobType','Status\x20filter:\x20','Show\x20job\x20details','database','submit','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','query','getTime','✔\x20Job\x20submitted','user_name','\x20row','8258782EKPlcp','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','jobs','5174994xJGxGm','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','execute','map','\x27\x20to\x20verify\x20the\x20job\x20status','start_at','5308715XXyOMN','job:submit','\x20\x20Cause:\x20','✔\x20Found\x20','substring','end_at','created_at','name','round','...','Getting\x20job\x20details...','Submitting\x20kill\x20request...','List\x20jobs','limit','Usage:\x20job\x20result\x20<job-id>','verbose','608evvjIg','Limit:\x20','Error:\x20Query\x20is\x20required','Error:\x20','data','information_schema','302121QfYlWR'];a19_0x18d4=function(){return _0x1b1290;};return a19_0x18d4();}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';function a19_0x3b49(_0x11a156,_0x11778b){const _0x18d465=a19_0x18d4();return a19_0x3b49=function(_0x3b4973,_0x206984){_0x3b4973=_0x3b4973-0xeb;let _0x5d6e31=_0x18d465[_0x3b4973];return _0x5d6e31;},a19_0x3b49(_0x11a156,_0x11778b);}export class JobListCommand extends BaseCommand{['name']=a19_0x372571(0x120);[a19_0x372571(0x10f)]=a19_0x372571(0x133);async[a19_0x372571(0x123)](_0x4c031a){const _0x21af3c=a19_0x372571,{options:_0x1023bb,tdx:_0x4d6f19}=_0x4c031a;try{const _0x4ed9f5=resolveLimit(_0x1023bb[_0x21af3c(0x134)],DEFAULT_DISPLAY_LIMIT),_0x55dc31=_0x1023bb['status'];_0x1023bb[_0x21af3c(0x136)]&&(console[_0x21af3c(0x100)](_0x21af3c(0xec)+_0x4ed9f5+'\x20jobs'),_0x55dc31&&console['error'](_0x21af3c(0x114)+_0x55dc31));const _0xae1b15=await withSpinner('Listing\x20jobs...',()=>_0x4d6f19['jobs']['list']({'from':0x0,'to':_0x4ed9f5-0x1,'status':_0x55dc31}),{'verbose':_0x1023bb[_0x21af3c(0x136)]}),_0x4b36b7=_0xae1b15['data'];console[_0x21af3c(0x100)](_0x21af3c(0x12a)+_0x4b36b7[_0x21af3c(0x101)]+'\x20job'+(_0x4b36b7[_0x21af3c(0x101)]!==0x1?'s':''));const _0x4e301f=_0x4b36b7[_0x21af3c(0x124)](_0x3c9eb5=>{const _0x4eff51=_0x21af3c;let _0x239153;if(_0x3c9eb5[_0x4eff51(0x126)]&&_0x3c9eb5[_0x4eff51(0x12c)]){const _0x13c93d=new Date(_0x3c9eb5[_0x4eff51(0x126)])[_0x4eff51(0x11a)](),_0x11fc2e=new Date(_0x3c9eb5['end_at'])[_0x4eff51(0x11a)]();_0x239153=Math['round']((_0x11fc2e-_0x13c93d)/0x3e8);}return{'job_id':_0x3c9eb5[_0x4eff51(0x107)],'type':_0x3c9eb5[_0x4eff51(0xfc)],'status':_0x3c9eb5['status'],'user_name':_0x3c9eb5[_0x4eff51(0x11c)],'duration_sec':_0x239153,'created_at':_0x3c9eb5[_0x4eff51(0x12d)],'started_at':_0x3c9eb5['start_at'],'end_at':_0x3c9eb5[_0x4eff51(0x12c)]};});return await handleSDKOutput(_0x4e301f,_0x1023bb),0x0;}catch(_0x43e7b7){if(_0x43e7b7 instanceof SDKError)return console[_0x21af3c(0x100)]('Error:\x20'+_0x43e7b7['message']),_0x43e7b7[_0x21af3c(0x109)]&&console[_0x21af3c(0x100)](_0x21af3c(0x129)+_0x43e7b7[_0x21af3c(0x109)]),0x1;throw _0x43e7b7;}}}export class JobShowCommand extends BaseCommand{[a19_0x372571(0x12e)]='job:show';[a19_0x372571(0x10f)]=a19_0x372571(0x115);async['execute'](_0x197554){const _0x4d5b1e=a19_0x372571,{options:_0x3d649a,args:_0x5353b8,tdx:_0x40cdfc}=_0x197554,_0xc0dfe7=_0x5353b8[0x0];if(!_0xc0dfe7)return console['error'](_0x4d5b1e(0xfa)),console[_0x4d5b1e(0x100)]('Usage:\x20job\x20show\x20<job-id>'),0x1;try{const _0x31eba8=await withSpinner(_0x4d5b1e(0x131),()=>_0x40cdfc[_0x4d5b1e(0x120)][_0x4d5b1e(0x112)](_0xc0dfe7),{'verbose':_0x3d649a['verbose']}),_0x49298b=_0x31eba8[_0x4d5b1e(0xef)];let _0xc8bf0e;if(_0x49298b[_0x4d5b1e(0x126)]&&_0x49298b[_0x4d5b1e(0x12c)]){const _0x4a9a5b=new Date(_0x49298b[_0x4d5b1e(0x126)])['getTime'](),_0x41fa41=new Date(_0x49298b[_0x4d5b1e(0x12c)])[_0x4d5b1e(0x11a)]();_0xc8bf0e=Math[_0x4d5b1e(0x12f)]((_0x41fa41-_0x4a9a5b)/0x3e8);}const _0x1fdb32={'job_id':_0x49298b[_0x4d5b1e(0x107)],'type':_0x49298b[_0x4d5b1e(0xfc)],'status':_0x49298b['status'],..._0x49298b['user_name']&&{'user_name':_0x49298b['user_name']},..._0xc8bf0e!==undefined&&{'duration_sec':_0xc8bf0e},..._0x49298b[_0x4d5b1e(0x12d)]&&{'created_at':_0x49298b[_0x4d5b1e(0x12d)]},..._0x49298b[_0x4d5b1e(0x126)]&&{'started_at':_0x49298b[_0x4d5b1e(0x126)]},..._0x49298b[_0x4d5b1e(0x12c)]&&{'end_at':_0x49298b[_0x4d5b1e(0x12c)]},..._0x49298b[_0x4d5b1e(0x116)]&&{'database':_0x49298b['database']},..._0x49298b[_0x4d5b1e(0xf3)]!==undefined&&{'priority':_0x49298b[_0x4d5b1e(0xf3)]},..._0x49298b[_0x4d5b1e(0xf4)]&&{'url':_0x49298b[_0x4d5b1e(0xf4)]},..._0x49298b[_0x4d5b1e(0x119)]&&{'query':_0x49298b[_0x4d5b1e(0x119)]},..._0x49298b[_0x4d5b1e(0x110)]&&{'debug':_0x49298b[_0x4d5b1e(0x110)]}};return await handleSingleObjectOutput(_0x1fdb32,_0x3d649a),0x0;}catch(_0x416251){if(_0x416251 instanceof SDKError)return console[_0x4d5b1e(0x100)]('Error:\x20'+_0x416251[_0x4d5b1e(0x10d)]),_0x416251[_0x4d5b1e(0x109)]&&console[_0x4d5b1e(0x100)]('\x20\x20Cause:\x20'+_0x416251[_0x4d5b1e(0x109)]),0x1;throw _0x416251;}}}export class JobKillCommand extends BaseCommand{[a19_0x372571(0x12e)]=a19_0x372571(0x104);['description']=a19_0x372571(0xf5);async['execute'](_0x313520){const _0x5ab89d=a19_0x372571,{options:_0x45351c,args:_0x438c91,tdx:_0x5c31ed}=_0x313520,_0x1f992c=_0x438c91[0x0];if(!_0x1f992c)return console[_0x5ab89d(0x100)](_0x5ab89d(0xfa)),console[_0x5ab89d(0x100)](_0x5ab89d(0xf9)),0x1;try{if(!_0x45351c[_0x5ab89d(0xfb)]){const _0x10d686=await confirm(_0x5ab89d(0x10c)+_0x1f992c+'?');if(!_0x10d686)return console[_0x5ab89d(0x100)](_0x5ab89d(0x103)),0x0;}return await withSpinner(_0x5ab89d(0x132),()=>_0x5c31ed[_0x5ab89d(0x120)][_0x5ab89d(0xf6)](_0x1f992c),{'verbose':_0x45351c[_0x5ab89d(0x136)]}),console['error'](_0x5ab89d(0x11f)+_0x1f992c),console[_0x5ab89d(0x100)](_0x5ab89d(0x10e)+_0x1f992c+_0x5ab89d(0x125)),0x0;}catch(_0x50e0d7){if(_0x50e0d7 instanceof SDKError)return console['error'](_0x5ab89d(0xee)+_0x50e0d7[_0x5ab89d(0x10d)]),_0x50e0d7['cause']&&console[_0x5ab89d(0x100)](_0x5ab89d(0x129)+_0x50e0d7[_0x5ab89d(0x109)]),0x1;throw _0x50e0d7;}}}export class JobSubmitCommand extends BaseCommand{[a19_0x372571(0x12e)]=a19_0x372571(0x128);[a19_0x372571(0x10f)]=a19_0x372571(0x10b);async['execute'](_0x5b3958){const _0x4c085d=a19_0x372571,{options:_0x18cdad,args:_0x5ba6c5,tdx:_0x60939e}=_0x5b3958;try{const _0x29051d=_0x18cdad[_0x4c085d(0x113)]||_0x4c085d(0x105),_0x4df340=_0x18cdad[_0x4c085d(0xfd)],_0x21f641=_0x18cdad[_0x4c085d(0x116)]||_0x4c085d(0xf0);if(_0x29051d!==_0x4c085d(0x105)&&_0x29051d!=='hive')return console[_0x4c085d(0x100)](_0x4c085d(0x108)),0x1;let _0x525a4d;if(_0x4df340){if(_0x5ba6c5[0x0])return console[_0x4c085d(0x100)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x21fdde=readSqlStatementsFromFile(_0x4df340);if(_0x21fdde[_0x4c085d(0x101)]===0x0)return console[_0x4c085d(0x100)]('Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file'),0x1;if(_0x21fdde['length']>0x1)return console[_0x4c085d(0x100)](_0x4c085d(0x122)),0x1;_0x525a4d=_0x21fdde[0x0];}else{if(!_0x5ba6c5[0x0])return console[_0x4c085d(0x100)](_0x4c085d(0xed)),console[_0x4c085d(0x100)](_0x4c085d(0x118)),0x1;_0x525a4d=_0x5ba6c5[0x0];}_0x18cdad[_0x4c085d(0x136)]&&(console[_0x4c085d(0x100)](_0x4c085d(0xfe)+_0x29051d),console['error'](_0x4c085d(0xf2)+_0x21f641),console[_0x4c085d(0x100)]('Query:\x20'+_0x525a4d[_0x4c085d(0x12b)](0x0,0x64)+(_0x525a4d[_0x4c085d(0x101)]>0x64?_0x4c085d(0x130):'')));const _0x48e317=await withSpinner('Submitting\x20job...',()=>_0x60939e[_0x4c085d(0x120)][_0x4c085d(0x117)](_0x21f641,_0x525a4d,_0x29051d),{'verbose':_0x18cdad[_0x4c085d(0x136)]}),_0x33dda9=_0x48e317['data'];return console[_0x4c085d(0x100)](_0x4c085d(0x11b)),console[_0x4c085d(0x100)](_0x4c085d(0x10a)+_0x33dda9[_0x4c085d(0x107)]),await handleSDKOutput([_0x33dda9],_0x18cdad),0x0;}catch(_0x33dadb){if(_0x33dadb instanceof SDKError)return console[_0x4c085d(0x100)]('Error:\x20'+_0x33dadb[_0x4c085d(0x10d)]),_0x33dadb[_0x4c085d(0x109)]&&console[_0x4c085d(0x100)]('\x20\x20Cause:\x20'+_0x33dadb[_0x4c085d(0x109)]),0x1;throw _0x33dadb;}}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a19_0x372571(0x10f)]=a19_0x372571(0xff);async[a19_0x372571(0x123)](_0x1e9c67){const _0x1245a9=a19_0x372571,{options:_0x5b815a,args:_0x562b2d,tdx:_0x106f77}=_0x1e9c67,_0x3622df=_0x562b2d[0x0];if(!_0x3622df)return console[_0x1245a9(0x100)](_0x1245a9(0xfa)),console[_0x1245a9(0x100)](_0x1245a9(0x135)),0x1;try{const _0x17d22f=await withSpinner(_0x1245a9(0x106),()=>_0x106f77[_0x1245a9(0x120)]['result'](_0x3622df),{'verbose':_0x5b815a[_0x1245a9(0x136)]}),_0x240b7f=_0x17d22f[_0x1245a9(0xef)];return console['error']('✔\x20Retrieved\x20'+_0x240b7f[_0x1245a9(0x101)]+_0x1245a9(0x11d)+(_0x240b7f[_0x1245a9(0x101)]!==0x1?'s':'')),await handleSDKOutput(_0x240b7f,_0x5b815a),0x0;}catch(_0x1810ed){if(_0x1810ed instanceof SDKError)return console[_0x1245a9(0x100)](_0x1245a9(0xee)+_0x1810ed[_0x1245a9(0x10d)]),_0x1810ed[_0x1245a9(0x109)]&&console[_0x1245a9(0x100)](_0x1245a9(0x129)+_0x1810ed[_0x1245a9(0x109)]),0x1;throw _0x1810ed;}}}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
const a20_0x1ccf27=a20_0x34b6;(function(_0x47c5da,_0x3feecd){const _0x195612=a20_0x34b6,_0x205be6=_0x47c5da();while(!![]){try{const _0x5c5740=-parseInt(_0x195612(0x181))/0x1+parseInt(_0x195612(0x149))/0x2*(-parseInt(_0x195612(0x153))/0x3)+-parseInt(_0x195612(0x1bd))/0x4*(parseInt(_0x195612(0x1c8))/0x5)+-parseInt(_0x195612(0x174))/0x6+-parseInt(_0x195612(0x144))/0x7*(parseInt(_0x195612(0x185))/0x8)+-parseInt(_0x195612(0x14f))/0x9*(parseInt(_0x195612(0x1b3))/0xa)+parseInt(_0x195612(0x151))/0xb;if(_0x5c5740===_0x3feecd)break;else _0x205be6['push'](_0x205be6['shift']());}catch(_0x44402f){_0x205be6['push'](_0x205be6['shift']());}}}(a20_0x5634,0xa82b4));import{BaseCommand}from'./command.js';function a20_0x5634(){const _0x5694e9=['Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','bold','projectId','584444ZpuvGZ','backupProject','verbose','models','createProject','name','llm:projects','prompts','(no\x20message)','red','counts','40fpVmhz','projects','\x20bytes)','Create\x20a\x20new\x20LLM\x20project','agent','[content]','\x20->\x20Agent:','map','Agent\x20created:\x20','[unknown]','Backup\x20cancelled.','Resolving\x20project\x20\x27','\x20->\x20KB:','string','join','targetImageGenerator','Invalid\x20path\x20syntax:\x20','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','\x20->\x20ImageGen:','Setting\x20project\x20context\x20to\x20\x27','llm:agent:update','INVALID_ARGUMENT','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','llm','chats','execute','llm:agent:delete','No\x20messages\x20found\x20in\x20chat\x20history.','output','image','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','attributes','description','yellow','agents','\x20\x20Knowledge\x20Bases:\x20','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','targetKnowledgeBase','filter','Getting\x20default\x20project...','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','Project\x20created:\x20','Output\x20directory\x20\x27','Project\x20restored:\x20','Resolving\x20agent\x20\x27','firstInputContent','toLowerCase','\x20\x20Cause:\x20','14vbMNyD','length','llm:models','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','jsonl','566uAikzw','\x20\x20Prompts:\x20','createdAt','targetWebSearchTool','history','restoreProject','286866mpiAte','Agent\x20updated:\x20','60303144ZVGpaF','targetAgent','6522wBgEiW','\x27...','List\x20all\x20LLM\x20projects','magenta','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','Restoring\x20project\x20from\x20\x27','deleteProject','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','temperature','llm:history','updatedAt','Fetching\x20chat\x20sessions...','content','.llm','No\x20chat\x20sessions\x20found.','Fetching\x20agents...','message','getOrCreateDefaultProject','yes','outputDir','exportedFrom','split','updateAgent','Error:\x20Agent\x20name\x20is\x20required','Update\x20an\x20existing\x20agent','Fetching\x20most\x20recent\x20chat...','llm:project:restore','blue','Deleting\x20project\x20\x27','Usage:\x20tdx\x20llm\x20use\x20<project-name>','7189650pMKPwH','dryRun','\x0aStack\x20trace:','tool_call','cause','llm:project:delete','llm:project:create','tool','\x20\x20Agents:\x20','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','\x20→\x20chat:\x20','\x20\x20Integrations:\x20','List\x20agents\x20in\x20current\x20project','142997DyvAHd','Restore\x20cancelled.','maxToolIterations','Delete\x20an\x20agent','2464160TqsBAt','format','\x20->\x20WebSearch:','entries','createAgent','Error:\x20Project\x20name\x20is\x20required','[input]\x20\x20','Project\x20backed\x20up\x20to:\x20','projectName','sourceSite','cyan','List\x20available\x20LLM\x20models','llm:agent:show','stack','log','Checking\x20for\x20existing\x20projects...','table','resolveAgentId','systemPrompt','Show\x20agent\x20details','last','slice','data','error','model','prompt','llm:agents','includes','Set\x20current\x20project\x20context','setCurrentProject','green','Delete\x20an\x20LLM\x20project','llmProject','json','getBackupMetadata','dim','[tool]\x20\x20\x20','rmSync','LLM_PROJECT_NOT_FOUND','limit','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','stringify','\x27\x20already\x20exists.\x20Overwrite?','integrations','Agent\x20deleted:\x20','[output]\x20','330GTQrGN','resolveProjectId','find','[error]\x20\x20','Create\x20a\x20new\x20agent\x20in\x20current\x20project','knowledgeBases','input'];a20_0x5634=function(){return _0x5694e9;};return a20_0x5634();}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_0x452631 from'node:fs';function handleSDKError(_0x3fb835,_0x57d375){const _0x20bfd4=a20_0x34b6;if(_0x3fb835 instanceof SDKError)console['error']('Error:\x20'+_0x3fb835[_0x20bfd4(0x166)]),_0x57d375[_0x20bfd4(0x1bf)]&&(_0x3fb835['cause']&&console[_0x20bfd4(0x19c)](_0x20bfd4(0x143)+_0x3fb835[_0x20bfd4(0x178)]),_0x3fb835['stack']&&(console[_0x20bfd4(0x19c)](_0x20bfd4(0x176)),console[_0x20bfd4(0x19c)](_0x3fb835[_0x20bfd4(0x192)])));else throw _0x3fb835;}function formatChatHistoryEntry(_0x5bd79b,_0x2646cb){const _0x8946cf=a20_0x34b6,_0x530412=getChalk(_0x2646cb),_0x1792d4=_0x530412['dim'](_0x5bd79b['at']);if('input'in _0x5bd79b){const _0x4178f1=_0x530412[_0x8946cf(0x18f)](_0x8946cf(0x18b));return _0x1792d4+'\x20'+_0x4178f1+':\x20'+_0x5bd79b[_0x8946cf(0x1b9)];}if(_0x8946cf(0x162)in _0x5bd79b){const _0x51b8a7=_0x530412[_0x8946cf(0x1a3)](_0x8946cf(0x1cd));return _0x1792d4+'\x20'+_0x51b8a7+':\x20'+_0x5bd79b[_0x8946cf(0x162)];}if(_0x8946cf(0x177)in _0x5bd79b){const _0x4b2577=_0x530412[_0x8946cf(0x135)]('[tool_call]'),{functionName:_0x426ed3,functionArguments:_0x80f218,targetFunction:_0x59a338}=_0x5bd79b[_0x8946cf(0x177)];let _0x383d39=_0x1792d4+'\x20'+_0x4b2577+':\x20'+_0x530412[_0x8946cf(0x1bb)](_0x426ed3);if(_0x80f218&&Object['keys'](_0x80f218)['length']>0x0){const _0x34644c=Object[_0x8946cf(0x188)](_0x80f218)[_0x8946cf(0x1cf)](([_0x1f09ca,_0x32b631])=>_0x1f09ca+'='+JSON[_0x8946cf(0x1ae)](_0x32b631))[_0x8946cf(0x1d6)](',\x20');_0x383d39+='('+_0x34644c+')';}_0x59a338&&(_0x383d39+=_0x530412[_0x8946cf(0x1a8)]('\x20['+_0x59a338+']'));let _0x507c88='';if(_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x139)])_0x507c88=_0x8946cf(0x1d4)+_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x139)][_0x8946cf(0x1c2)];else{if(_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x152)])_0x507c88=_0x8946cf(0x1ce)+_0x5bd79b['tool_call']['targetAgent'][_0x8946cf(0x1c2)];else{if(_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x14c)])_0x507c88=_0x8946cf(0x187)+_0x5bd79b[_0x8946cf(0x177)][_0x8946cf(0x14c)][_0x8946cf(0x1c2)];else _0x5bd79b['tool_call'][_0x8946cf(0x122)]&&(_0x507c88=_0x8946cf(0x125)+_0x5bd79b[_0x8946cf(0x177)]['targetImageGenerator'][_0x8946cf(0x1c2)]);}}return _0x383d39+_0x507c88;}if(_0x8946cf(0x17b)in _0x5bd79b){const _0x4a2de7=_0x530412[_0x8946cf(0x156)](_0x8946cf(0x1a9)),{functionName:_0x3733ea,functionArguments:_0x2f0b44,content:_0x1e127a,newChat:_0x32fd33}=_0x5bd79b['tool'];let _0x1173bb=_0x1792d4+'\x20'+_0x4a2de7+':\x20'+_0x530412[_0x8946cf(0x1bb)](_0x3733ea);if(_0x2f0b44){const _0x4a85fc=typeof _0x2f0b44===_0x8946cf(0x1d5)?_0x2f0b44:JSON[_0x8946cf(0x1ae)](_0x2f0b44);_0x1173bb+='('+_0x4a85fc+')';}return _0x1e127a&&(_0x1173bb+='\x0a'+_0x530412[_0x8946cf(0x1a8)](_0x1e127a)),_0x32fd33&&(_0x1173bb+=_0x530412[_0x8946cf(0x1a8)](_0x8946cf(0x17e)+_0x32fd33['id'])),_0x1173bb;}if('output'in _0x5bd79b){const _0x1497b9=_0x530412[_0x8946cf(0x171)](_0x8946cf(0x1b2));return _0x1792d4+'\x20'+_0x1497b9+':\x20'+_0x5bd79b[_0x8946cf(0x130)][_0x8946cf(0x1c2)]+'\x20('+_0x5bd79b[_0x8946cf(0x130)][_0x8946cf(0x162)][_0x8946cf(0x145)]+_0x8946cf(0x1ca);}if('image'in _0x5bd79b){const _0x50fe17=_0x530412[_0x8946cf(0x171)]('[image]\x20\x20'),{width:_0x4fd53f,height:_0x5b43eb,headerText:_0xb9d25c}=_0x5bd79b[_0x8946cf(0x131)],_0x38b093=_0xb9d25c?'\x20-\x20'+_0xb9d25c:'';return _0x1792d4+'\x20'+_0x50fe17+':\x20'+_0x4fd53f+'x'+_0x5b43eb+_0x38b093;}if(_0x8946cf(0x19c)in _0x5bd79b){const _0x1bff5c=_0x530412[_0x8946cf(0x1c6)](_0x8946cf(0x1b6));return _0x1792d4+'\x20'+_0x1bff5c+':\x20'+_0x5bd79b[_0x8946cf(0x19c)];}return _0x1792d4+'\x20'+_0x530412[_0x8946cf(0x1a8)](_0x8946cf(0x1d1))+':\x20'+JSON[_0x8946cf(0x1ae)](_0x5bd79b);}async function getProjectIdOrDefault(_0x8fac1f){const _0x129fa1=a20_0x34b6,{tdx:_0x47f1a2,options:_0x309f2e}=_0x8fac1f,_0x5a1545=_0x309f2e[_0x129fa1(0x1a5)];if(_0x5a1545){const _0x16db85=await withSpinner('Resolving\x20project\x20\x27'+_0x5a1545+_0x129fa1(0x154),()=>_0x47f1a2[_0x129fa1(0x12b)][_0x129fa1(0x1b4)](_0x5a1545),{'verbose':_0x309f2e[_0x129fa1(0x1bf)]});return _0x16db85[_0x129fa1(0x19b)];}let _0x3ec0e6=_0x47f1a2[_0x129fa1(0x12b)]['getCurrentProject']();if(_0x3ec0e6)return _0x3ec0e6;const _0x285aee=await withSpinner(_0x129fa1(0x13b),()=>_0x47f1a2[_0x129fa1(0x12b)][_0x129fa1(0x167)](),{'verbose':_0x309f2e[_0x129fa1(0x1bf)]});return _0x285aee[_0x129fa1(0x19b)]['id'];}function toLLMProjectInfo(_0x24188a){const _0x13a693=a20_0x34b6;return{'name':_0x24188a[_0x13a693(0x133)][_0x13a693(0x1c2)],'description':_0x24188a['attributes'][_0x13a693(0x134)],'createdAt':_0x24188a[_0x13a693(0x133)]['createdAt'],'updatedAt':_0x24188a[_0x13a693(0x133)][_0x13a693(0x160)]};}function toAgentInfo(_0x464fbe){const _0x45c4dd=a20_0x34b6;return{'name':_0x464fbe[_0x45c4dd(0x133)][_0x45c4dd(0x1c2)],'description':_0x464fbe[_0x45c4dd(0x133)][_0x45c4dd(0x134)],'prompt':truncatePrompt(_0x464fbe['attributes']['prompt']),'createdAt':_0x464fbe[_0x45c4dd(0x133)][_0x45c4dd(0x14b)],'updatedAt':_0x464fbe[_0x45c4dd(0x133)][_0x45c4dd(0x160)]};}function truncatePrompt(_0x129d1d){const _0x2a839a=a20_0x34b6;if(!_0x129d1d)return undefined;const _0x44a1bc=0x64;if(_0x129d1d[_0x2a839a(0x145)]<=_0x44a1bc)return _0x129d1d;return _0x129d1d[_0x2a839a(0x19a)](0x0,_0x44a1bc)+'...';}export class LLMModelsCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x146);['description']=a20_0x1ccf27(0x190);async['execute'](_0x3bca01){const _0x5450e5=a20_0x1ccf27,{options:_0x19472b,tdx:_0x465a93}=_0x3bca01;try{const _0x2d1e56=await withSpinner('Fetching\x20available\x20models...',()=>_0x465a93['llm'][_0x5450e5(0x1c0)](),{'verbose':_0x19472b[_0x5450e5(0x1bf)]});return await handleSDKOutput(_0x2d1e56['data'],_0x19472b),0x0;}catch(_0x366b14){return handleSDKError(_0x366b14,_0x19472b),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x1c3);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x155);async[a20_0x1ccf27(0x12d)](_0x59ec84){const _0x2c9bec=a20_0x1ccf27,{options:_0x539edc,args:_0xbcef51,tdx:_0x236182}=_0x59ec84;try{const _0x5cc678=_0xbcef51[0x0],_0x208c01=resolveLimit(_0x539edc[_0x2c9bec(0x1ac)],DEFAULT_LLM_LIMIT),_0x559887=await withSpinner('Fetching\x20projects...',()=>_0x236182[_0x2c9bec(0x12b)][_0x2c9bec(0x1c9)](_0x208c01),{'verbose':_0x539edc[_0x2c9bec(0x1bf)]});let _0x4e285b=_0x559887[_0x2c9bec(0x19b)];_0x5cc678&&(_0x4e285b=_0x559887[_0x2c9bec(0x19b)][_0x2c9bec(0x13a)](_0x57680d=>matchGlobPattern(_0x57680d[_0x2c9bec(0x133)][_0x2c9bec(0x1c2)],_0x5cc678)));const _0x5d3709=_0x4e285b[_0x2c9bec(0x1cf)](toLLMProjectInfo);return await handleSDKOutput(_0x5d3709,_0x539edc),0x0;}catch(_0x18a5ba){return handleSDKError(_0x18a5ba,_0x539edc),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x19f);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x180);async[a20_0x1ccf27(0x12d)](_0x17a1d5){const _0x336d3a=a20_0x1ccf27,{options:_0x355ec7,args:_0x27b44c,tdx:_0x34fa34}=_0x17a1d5;try{const _0x3ce8c5=_0x27b44c[0x0];let _0x29dfd1,_0x4d4090=_0x3ce8c5;if(_0x3ce8c5&&_0x3ce8c5[_0x336d3a(0x1a0)]('/')){const _0x4ecfff=_0x3ce8c5[_0x336d3a(0x16b)]('/');if(_0x4ecfff['length']===0x2){const [_0xa31976,_0x52f128]=_0x4ecfff,_0x37d624=await _0x34fa34[_0x336d3a(0x12b)][_0x336d3a(0x1c9)](),_0x34badb=_0x37d624[_0x336d3a(0x1b5)](_0x1e456e=>_0x1e456e[_0x336d3a(0x133)][_0x336d3a(0x1c2)][_0x336d3a(0x142)]()===_0xa31976[_0x336d3a(0x142)]());if(!_0x34badb)throw new SDKError(ErrorCode[_0x336d3a(0x1ab)],'Project\x20not\x20found:\x20'+_0xa31976,undefined,{'helpText':_0x336d3a(0x138)});_0x29dfd1=_0x34badb['id'],_0x4d4090=_0x52f128;}else throw new SDKError(ErrorCode[_0x336d3a(0x128)],_0x336d3a(0x123)+_0x3ce8c5,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x29dfd1=await getProjectIdOrDefault(_0x17a1d5);const _0x350fbe=await withSpinner(_0x336d3a(0x165),()=>_0x34fa34[_0x336d3a(0x12b)]['agents'](_0x29dfd1),{'verbose':_0x355ec7[_0x336d3a(0x1bf)]});let _0x515a0a=_0x350fbe[_0x336d3a(0x19b)];_0x4d4090&&(_0x515a0a=_0x350fbe[_0x336d3a(0x19b)][_0x336d3a(0x13a)](_0x5329b3=>matchGlobPattern(_0x5329b3[_0x336d3a(0x133)][_0x336d3a(0x1c2)],_0x4d4090)));const _0x4b341e=_0x515a0a[_0x336d3a(0x1cf)](toAgentInfo);return await handleSDKOutput(_0x4b341e,_0x355ec7),0x0;}catch(_0x340da4){return handleSDKError(_0x340da4,_0x355ec7),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a20_0x1ccf27(0x191);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x198);async[a20_0x1ccf27(0x12d)](_0x344c0b){const _0xa0338e=a20_0x1ccf27,{options:_0x701436,args:_0x27cd73,tdx:_0x241089}=_0x344c0b;if(_0x27cd73['length']===0x0)return console[_0xa0338e(0x19c)](_0xa0338e(0x16d)),console[_0xa0338e(0x19c)](_0xa0338e(0x124)),0x1;const _0x2dff8d=_0x27cd73[0x0];try{const _0x3678c7=await getProjectIdOrDefault(_0x344c0b),_0x3b8b01=await withSpinner(_0xa0338e(0x140)+_0x2dff8d+_0xa0338e(0x154),()=>_0x241089[_0xa0338e(0x12b)][_0xa0338e(0x196)](_0x2dff8d,_0x3678c7),{'verbose':_0x701436[_0xa0338e(0x1bf)]}),_0x582ac1=await withSpinner('Fetching\x20agent...',()=>_0x241089[_0xa0338e(0x12b)][_0xa0338e(0x1cc)](_0x3b8b01[_0xa0338e(0x19b)]),{'verbose':_0x701436[_0xa0338e(0x1bf)]});return await handleSDKOutput([_0x582ac1[_0xa0338e(0x19b)]],_0x701436),0x0;}catch(_0x5bce6b){return handleSDKError(_0x5bce6b,_0x701436),0x1;}}}function a20_0x34b6(_0x31ce83,_0x2eaeec){const _0x5634fb=a20_0x5634();return a20_0x34b6=function(_0x34b68f,_0x3e3e2b){_0x34b68f=_0x34b68f-0x122;let _0xe0de48=_0x5634fb[_0x34b68f];return _0xe0de48;},a20_0x34b6(_0x31ce83,_0x2eaeec);}export class LLMAgentCreateCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]='llm:agent:create';[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x1b7);async[a20_0x1ccf27(0x12d)](_0x2c3b03){const _0x3b52cf=a20_0x1ccf27,{options:_0x1d55af,args:_0x18f252,tdx:_0xc5f11b}=_0x2c3b03;if(_0x18f252[_0x3b52cf(0x145)]===0x0)return console['error'](_0x3b52cf(0x16d)),console[_0x3b52cf(0x19c)](_0x3b52cf(0x1ba)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x39c097=_0x18f252[0x0],_0x27c2c1=_0x1d55af,_0x3b9f6b=_0x27c2c1[_0x3b52cf(0x197)],_0x329fac=_0x27c2c1[_0x3b52cf(0x19d)]||'claude-4.5-haiku',_0x3e328f=_0x27c2c1['starterMessage'],_0x1169d0=_0x27c2c1[_0x3b52cf(0x183)]?Number(_0x27c2c1['maxToolIterations']):undefined,_0xf1ea2b=_0x27c2c1[_0x3b52cf(0x15e)]?Number(_0x27c2c1['temperature']):undefined;try{let _0x525c78,_0x679563;if(_0x39c097[_0x3b52cf(0x1a0)]('/')){const _0x4a2df0=_0x39c097[_0x3b52cf(0x16b)]('/');if(_0x4a2df0['length']===0x2){const [_0x25aa92,_0x3c6ff3]=_0x4a2df0,_0x1c3014=await withSpinner(_0x3b52cf(0x1d3)+_0x25aa92+_0x3b52cf(0x154),()=>_0xc5f11b[_0x3b52cf(0x12b)]['resolveProjectId'](_0x25aa92),{'verbose':_0x1d55af[_0x3b52cf(0x1bf)]});_0x525c78=_0x1c3014[_0x3b52cf(0x19b)],_0x679563=_0x3c6ff3;}else throw new SDKError(ErrorCode[_0x3b52cf(0x128)],_0x3b52cf(0x123)+_0x39c097,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else _0x525c78=await getProjectIdOrDefault(_0x2c3b03),_0x679563=_0x39c097;const _0x4e734f=await withSpinner('Creating\x20agent\x20\x27'+_0x679563+'\x27...',()=>_0xc5f11b['llm'][_0x3b52cf(0x189)]({'name':_0x679563,'projectId':_0x525c78,'modelType':_0x329fac,'systemPrompt':_0x3b9f6b,'starterMessage':_0x3e328f,'maxToolIterations':_0x1169d0,'temperature':_0xf1ea2b}),{'verbose':_0x1d55af[_0x3b52cf(0x1bf)]});return console[_0x3b52cf(0x193)](_0x3b52cf(0x1d0)+_0x4e734f[_0x3b52cf(0x19b)]['id']),await handleSDKOutput([_0x4e734f['data']],_0x1d55af),0x0;}catch(_0x5a8d80){return handleSDKError(_0x5a8d80,_0x1d55af),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x127);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x16e);async[a20_0x1ccf27(0x12d)](_0x563558){const _0xd0f9e2=a20_0x1ccf27,{options:_0x1515a7,args:_0x135f77,tdx:_0x16ca5e}=_0x563558;if(_0x135f77[_0xd0f9e2(0x145)]===0x0)return console[_0xd0f9e2(0x19c)](_0xd0f9e2(0x16d)),console[_0xd0f9e2(0x19c)](_0xd0f9e2(0x15c)),0x1;const _0x3bdcf1=_0x135f77[0x0],_0x5ab4f9=_0x1515a7,_0x38e463=_0x5ab4f9[_0xd0f9e2(0x1c2)],_0x478076=_0x5ab4f9[_0xd0f9e2(0x19e)],_0x1b3ce5=_0x5ab4f9[_0xd0f9e2(0x134)],_0x3d6cb1=_0x5ab4f9['starterMessage'];if(!_0x38e463&&!_0x478076&&!_0x1b3ce5&&!_0x3d6cb1)return console['error'](_0xd0f9e2(0x129)),console[_0xd0f9e2(0x19c)](_0xd0f9e2(0x158)),0x1;try{const _0x34f4b8=await getProjectIdOrDefault(_0x563558),_0x399066=await withSpinner(_0xd0f9e2(0x140)+_0x3bdcf1+_0xd0f9e2(0x154),()=>_0x16ca5e['llm'][_0xd0f9e2(0x196)](_0x3bdcf1,_0x34f4b8),{'verbose':_0x1515a7[_0xd0f9e2(0x1bf)]}),_0x38246b=_0x399066[_0xd0f9e2(0x19b)],_0x22e2af=await withSpinner('Updating\x20agent...',()=>_0x16ca5e[_0xd0f9e2(0x12b)][_0xd0f9e2(0x16c)](_0x38246b,{'name':_0x38e463,'prompt':_0x478076,'description':_0x1b3ce5,'starterMessage':_0x3d6cb1}),{'verbose':_0x1515a7[_0xd0f9e2(0x1bf)]});return console[_0xd0f9e2(0x193)](_0xd0f9e2(0x150)+_0x22e2af[_0xd0f9e2(0x19b)]['id']),await handleSDKOutput([_0x22e2af['data']],_0x1515a7),0x0;}catch(_0x51c87b){return handleSDKError(_0x51c87b,_0x1515a7),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x12e);['description']=a20_0x1ccf27(0x184);async[a20_0x1ccf27(0x12d)](_0x69fd55){const _0x1a291f=a20_0x1ccf27,{options:_0x2bbb5a,args:_0x3c53ee,tdx:_0x495e56}=_0x69fd55;if(_0x3c53ee[_0x1a291f(0x145)]===0x0)return console[_0x1a291f(0x19c)](_0x1a291f(0x16d)),console[_0x1a291f(0x19c)](_0x1a291f(0x132)),0x1;const _0xd34f70=_0x3c53ee[0x0];try{const _0xbf077f=await getProjectIdOrDefault(_0x69fd55),_0xd1e118=await withSpinner(_0x1a291f(0x140)+_0xd34f70+_0x1a291f(0x154),()=>_0x495e56[_0x1a291f(0x12b)][_0x1a291f(0x196)](_0xd34f70,_0xbf077f),{'verbose':_0x2bbb5a[_0x1a291f(0x1bf)]}),_0x570412=_0xd1e118[_0x1a291f(0x19b)];return await withSpinner('Deleting\x20agent...',()=>_0x495e56['llm']['deleteAgent'](_0x570412),{'verbose':_0x2bbb5a[_0x1a291f(0x1bf)]}),console['log'](_0x1a291f(0x1b1)+_0x570412),0x0;}catch(_0x23bb23){return handleSDKError(_0x23bb23,_0x2bbb5a),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x15f);[a20_0x1ccf27(0x134)]='Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions';async[a20_0x1ccf27(0x12d)](_0x1b6a85){const _0x137c52=a20_0x1ccf27,{options:_0x2665c9,args:_0x37fb52,tdx:_0xa3e8e4}=_0x1b6a85;let _0x471179=_0x37fb52[0x0];const _0x2f167d=_0x2665c9,_0x5bdb10=_0x2f167d[_0x137c52(0x199)];try{if(_0x5bdb10){if(_0x471179)return console[_0x137c52(0x19c)](_0x137c52(0x1ad)),console[_0x137c52(0x19c)]('Usage:\x20tdx\x20llm\x20history\x20--last'),0x1;const _0x169fc5=await withSpinner(_0x137c52(0x16f),()=>_0xa3e8e4[_0x137c52(0x12b)][_0x137c52(0x12c)](0x1),{'verbose':_0x2665c9[_0x137c52(0x1bf)]});if(_0x169fc5[_0x137c52(0x19b)][_0x137c52(0x145)]===0x0)return console[_0x137c52(0x193)](_0x137c52(0x164)),0x0;_0x471179=_0x169fc5['data'][0x0]['id'];}if(!_0x471179){const _0x6fa9dc=resolveLimit(_0x2665c9[_0x137c52(0x1ac)],DEFAULT_LLM_LIMIT),_0xdcdcbe=await withSpinner(_0x137c52(0x161),()=>_0xa3e8e4[_0x137c52(0x12b)][_0x137c52(0x12c)](_0x6fa9dc),{'verbose':_0x2665c9[_0x137c52(0x1bf)]});if(_0x2665c9[_0x137c52(0x186)]===_0x137c52(0x1a6)||_0x2665c9[_0x137c52(0x186)]===_0x137c52(0x148))await handleSDKOutput(_0xdcdcbe[_0x137c52(0x19b)],_0x2665c9);else{const _0x2ad349=_0xdcdcbe[_0x137c52(0x19b)][_0x137c52(0x1cf)](_0xd8993b=>({'created_at':_0xd8993b[_0x137c52(0x133)][_0x137c52(0x14b)],'chat_id':_0xd8993b['id'],'first_input':_0xd8993b[_0x137c52(0x133)][_0x137c52(0x141)]||_0x137c52(0x1c5)}));await handleSDKOutput(_0x2ad349,_0x2665c9);}return 0x0;}else{const _0x28e0c9=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x471179+_0x137c52(0x154),()=>_0xa3e8e4[_0x137c52(0x12b)][_0x137c52(0x14d)](_0x471179),{'verbose':_0x2665c9[_0x137c52(0x1bf)]}),_0x4a356d=_0x28e0c9[_0x137c52(0x19b)][_0x137c52(0x19b)]??[];if(_0x4a356d[_0x137c52(0x145)]===0x0)return console['log'](_0x137c52(0x12f)),0x0;if(_0x2665c9[_0x137c52(0x186)]===_0x137c52(0x1a6)||_0x2665c9[_0x137c52(0x186)]===_0x137c52(0x148)||_0x2665c9['format']===_0x137c52(0x195)||_0x2665c9[_0x137c52(0x186)]==='tsv')await handleSDKOutput(_0x4a356d,_0x2665c9);else for(const _0x367d1e of _0x4a356d){console[_0x137c52(0x193)](formatChatHistoryEntry(_0x367d1e,_0x2665c9));}return 0x0;}}catch(_0x58c46f){return handleSDKError(_0x58c46f,_0x2665c9),0x1;}}}export class LLMUseCommand extends BaseCommand{['name']='llm:use';[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x1a1);async['execute'](_0x13b344){const _0x1910db=a20_0x1ccf27,{options:_0x22ff7f,args:_0x4cdb50,tdx:_0x1fdd54}=_0x13b344;if(_0x4cdb50[_0x1910db(0x145)]===0x0)return console['error'](_0x1910db(0x18a)),console[_0x1910db(0x19c)](_0x1910db(0x173)),0x1;const _0x42a0bb=_0x4cdb50[0x0];try{return await withSpinner(_0x1910db(0x126)+_0x42a0bb+_0x1910db(0x154),()=>_0x1fdd54['llm'][_0x1910db(0x1a2)](_0x42a0bb),{'verbose':_0x22ff7f[_0x1910db(0x1bf)]}),console['log']('Project\x20context\x20set\x20to:\x20'+_0x42a0bb),0x0;}catch(_0x3d72c9){return handleSDKError(_0x3d72c9,_0x22ff7f),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x17a);[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x1cb);async[a20_0x1ccf27(0x12d)](_0x5b6bf5){const _0x9a3e89=a20_0x1ccf27,{options:_0x15c06a,args:_0x36038f,tdx:_0x1bbef9}=_0x5b6bf5;if(_0x36038f[_0x9a3e89(0x145)]===0x0)return console[_0x9a3e89(0x19c)](_0x9a3e89(0x18a)),console[_0x9a3e89(0x19c)](_0x9a3e89(0x12a)),0x1;const _0x4a6d73=_0x36038f[0x0],_0x453ff1=_0x15c06a,_0x1c58f5=_0x453ff1[_0x9a3e89(0x134)];try{const _0x5ef045=await withSpinner('Creating\x20project\x20\x27'+_0x4a6d73+_0x9a3e89(0x154),()=>_0x1bbef9[_0x9a3e89(0x12b)][_0x9a3e89(0x1c1)]({'name':_0x4a6d73,'description':_0x1c58f5}),{'verbose':_0x15c06a[_0x9a3e89(0x1bf)]});console['log'](_0x9a3e89(0x13d)+_0x5ef045[_0x9a3e89(0x19b)]['id']);const _0x36aae5=toLLMProjectInfo(_0x5ef045[_0x9a3e89(0x19b)]);return await handleSDKOutput([_0x36aae5],_0x15c06a),0x0;}catch(_0x94edb){return handleSDKError(_0x94edb,_0x15c06a),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x179);['description']=a20_0x1ccf27(0x1a4);async[a20_0x1ccf27(0x12d)](_0x3ca796){const _0x46f1d5=a20_0x1ccf27,{options:_0xd747b5,args:_0x451012,tdx:_0x5df4df}=_0x3ca796;if(_0x451012['length']===0x0)return console[_0x46f1d5(0x19c)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x46f1d5(0x19c)](_0x46f1d5(0x17d)),0x1;const _0x4737ae=_0x451012[0x0];try{return await withSpinner(_0x46f1d5(0x172)+_0x4737ae+_0x46f1d5(0x154),()=>_0x5df4df[_0x46f1d5(0x12b)][_0x46f1d5(0x15a)](_0x4737ae),{'verbose':_0xd747b5[_0x46f1d5(0x1bf)]}),console['log']('Project\x20deleted:\x20'+_0x4737ae),0x0;}catch(_0x15c180){return handleSDKError(_0x15c180,_0xd747b5),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]='llm:project:backup';[a20_0x1ccf27(0x134)]=a20_0x1ccf27(0x157);async[a20_0x1ccf27(0x12d)](_0x30f27a){const _0x422837=a20_0x1ccf27,{options:_0x311d86,args:_0x58d840,tdx:_0x1e2b0d}=_0x30f27a;if(_0x58d840['length']===0x0)return console[_0x422837(0x19c)](_0x422837(0x18a)),console[_0x422837(0x19c)](_0x422837(0x15d)),0x1;const _0x4131b1=_0x58d840[0x0],_0x130b54=_0x311d86,_0x3aac64=_0x130b54['output'],_0x113b83=_0x130b54[_0x422837(0x175)];try{const _0x2f4188=_0x3aac64||_0x4131b1+_0x422837(0x163);if(a20_0x452631['existsSync'](_0x2f4188)&&!_0x113b83){if(!_0x311d86[_0x422837(0x168)]){const _0x3e4fec=await confirm(_0x422837(0x13e)+_0x2f4188+_0x422837(0x1af));if(!_0x3e4fec)return console[_0x422837(0x193)](_0x422837(0x1d2)),0x0;}a20_0x452631[_0x422837(0x1aa)](_0x2f4188,{'recursive':!![]});}const _0x3b1d31=await withSpinner(_0x113b83?'Analyzing\x20project\x20\x27'+_0x4131b1+_0x422837(0x154):'Backing\x20up\x20project\x20\x27'+_0x4131b1+'\x27...',()=>_0x1e2b0d[_0x422837(0x12b)][_0x422837(0x1be)](_0x4131b1,_0x3aac64,{'dryRun':_0x113b83}),{'verbose':_0x311d86[_0x422837(0x1bf)]}),_0x58bf6b=_0x3b1d31[_0x422837(0x19b)];return _0x113b83?console[_0x422837(0x193)]('[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20'+_0x58bf6b[_0x422837(0x169)]):console[_0x422837(0x193)](_0x422837(0x18c)+_0x58bf6b[_0x422837(0x169)]),console[_0x422837(0x193)](_0x422837(0x17c)+_0x58bf6b['counts'][_0x422837(0x136)]),console[_0x422837(0x193)](_0x422837(0x137)+_0x58bf6b[_0x422837(0x1c7)]['knowledgeBases']),console['log'](_0x422837(0x14a)+_0x58bf6b[_0x422837(0x1c7)][_0x422837(0x1c4)]),console[_0x422837(0x193)](_0x422837(0x17f)+_0x58bf6b[_0x422837(0x1c7)]['integrations']),(_0x311d86[_0x422837(0x186)]===_0x422837(0x1a6)||_0x311d86[_0x422837(0x186)]==='jsonl')&&await handleSDKOutput([_0x58bf6b],_0x311d86),0x0;}catch(_0x1c3d35){return handleSDKError(_0x1c3d35,_0x311d86),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a20_0x1ccf27(0x1c2)]=a20_0x1ccf27(0x170);['description']='Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder';async['execute'](_0x5c2501){const _0x2cb609=a20_0x1ccf27,{options:_0x195ac8,args:_0x134604,tdx:_0x25a31a}=_0x5c2501;if(_0x134604['length']===0x0)return console[_0x2cb609(0x19c)]('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console[_0x2cb609(0x19c)](_0x2cb609(0x13c)),0x1;const _0x4c2c3f=_0x134604[0x0],_0xad3684=_0x195ac8,_0xc9ebbc=_0xad3684[_0x2cb609(0x1c2)],_0x4c201e=_0xad3684[_0x2cb609(0x175)];try{if(!_0x4c201e){const _0x1040c9=_0x25a31a[_0x2cb609(0x12b)][_0x2cb609(0x1a7)](_0x4c2c3f),_0x32b9d3=_0xc9ebbc||_0x1040c9[_0x2cb609(0x16a)][_0x2cb609(0x18d)],_0x557f68=await withSpinner(_0x2cb609(0x194),()=>_0x25a31a[_0x2cb609(0x12b)][_0x2cb609(0x1c9)](),{'verbose':_0x195ac8['verbose']}),_0x129aca=_0x557f68['data'][_0x2cb609(0x1b5)](_0x3b95b3=>_0x3b95b3[_0x2cb609(0x133)][_0x2cb609(0x1c2)]===_0x32b9d3);if(_0x129aca&&!_0x195ac8['yes']){const _0x19d510=await confirm('A\x20project\x20named\x20\x27'+_0x32b9d3+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x19d510)return console['log'](_0x2cb609(0x182)),0x0;}}const _0x1a83fe=await withSpinner(_0x4c201e?'Validating\x20backup\x20from\x20\x27'+_0x4c2c3f+'\x27...':_0x2cb609(0x159)+_0x4c2c3f+'\x27...',()=>_0x25a31a[_0x2cb609(0x12b)][_0x2cb609(0x14e)](_0x4c2c3f,{'name':_0xc9ebbc,'dryRun':_0x4c201e}),{'verbose':_0x195ac8[_0x2cb609(0x1bf)]}),_0x2bfafd=_0x1a83fe[_0x2cb609(0x19b)];return _0x2bfafd[_0x2cb609(0x18e)]&&console[_0x2cb609(0x193)](_0x2cb609(0x15b)+_0x2bfafd['sourceSite']+'\x27'),_0x4c201e?console[_0x2cb609(0x193)](_0x2cb609(0x147)+_0x2bfafd[_0x2cb609(0x18d)]):console['log'](_0x2cb609(0x13f)+_0x2bfafd[_0x2cb609(0x18d)]+'\x20('+_0x2bfafd[_0x2cb609(0x1bc)]+')'),console[_0x2cb609(0x193)](_0x2cb609(0x17c)+_0x2bfafd[_0x2cb609(0x1c7)][_0x2cb609(0x136)]),console[_0x2cb609(0x193)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2bfafd['counts'][_0x2cb609(0x1b8)]),console['log']('\x20\x20Prompts:\x20'+_0x2bfafd[_0x2cb609(0x1c7)][_0x2cb609(0x1c4)]),console[_0x2cb609(0x193)](_0x2cb609(0x17f)+_0x2bfafd['counts'][_0x2cb609(0x1b0)]),(_0x195ac8[_0x2cb609(0x186)]===_0x2cb609(0x1a6)||_0x195ac8[_0x2cb609(0x186)]===_0x2cb609(0x148))&&await handleSDKOutput([_0x2bfafd],_0x195ac8),0x0;}catch(_0x35c7b2){return handleSDKError(_0x35c7b2,_0x195ac8),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x4e3b3c=a21_0xa6c1;function a21_0x437e(){const _0x189177=['getOrCreateDefaultProject','2513664gjTOBx','55AesXNX','40WDumvu','execute','Port\x20','logger','\x0aTesting\x20with\x20Agent\x20SDK:','SIGTERM','start','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','126wgaLIO','green','log','find','http://0.0.0.0:','\x20\x20\x20\x20}','484IYBzUf','server','9996iuVuXT','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','llmProject','\x0aClaude\x20Code\x20Configuration:','\x20\x20Address:','cyan','yellow','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','\x20\x20}','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','description','exit','500094vTLjjX','\x20is\x20unavailable,\x20using\x20port\x20','projects','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','white','project','\x27\x20not\x20found','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','Starting\x20proxy\x20server...','2tgffSl','close','Server\x20Configuration:','dim','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','llm','llm:proxy','name','Resolving\x20project...','\x20\x20\x20\x20\x22env\x22:\x20{','\x0a\x0aShutting\x20down\x20proxy\x20server...','port','\x20\x20Agents:','bold','stop','init','70475AnXxAf','\x20\x20Project:','SIGINT','5943072NPqCBi','site','NOT_FOUND','124572jnYdSY','Project\x20\x27','\x20\x20{','\x20\x20Site:','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','created\x20on-demand\x20per\x20model','attributes','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','logLevel','468774FNDrIR'];a21_0x437e=function(){return _0x189177;};return a21_0x437e();}(function(_0xd7ab2e,_0x5b1ff9){const _0x212502=a21_0xa6c1,_0x7b013d=_0xd7ab2e();while(!![]){try{const _0x1470c8=parseInt(_0x212502(0x116))/0x1*(parseInt(_0x212502(0x105))/0x2)+parseInt(_0x212502(0x131))/0x3*(parseInt(_0x212502(0x11c))/0x4)+-parseInt(_0x212502(0x128))/0x5*(parseInt(_0x212502(0x125))/0x6)+-parseInt(_0x212502(0xfb))/0x7+-parseInt(_0x212502(0x119))/0x8+-parseInt(_0x212502(0x127))/0x9*(-parseInt(_0x212502(0x129))/0xa)+parseInt(_0x212502(0x137))/0xb*(parseInt(_0x212502(0x139))/0xc);if(_0x1470c8===_0x5b1ff9)break;else _0x7b013d['push'](_0x7b013d['shift']());}catch(_0x37dbbc){_0x7b013d['push'](_0x7b013d['shift']());}}}(a21_0x437e,0xd19cc));import a21_0x5bb3b0 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';function a21_0xa6c1(_0x205152,_0x498b32){const _0x437ef3=a21_0x437e();return a21_0xa6c1=function(_0xa6c100,_0x349fa8){_0xa6c100=_0xa6c100-0xf5;let _0x2eeeb6=_0x437ef3[_0xa6c100];return _0x2eeeb6;},a21_0xa6c1(_0x205152,_0x498b32);}import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x4c761b,_0x84dd01){const _0x486eb4=a21_0xa6c1,{tdx:_0xac3ee4,options:_0x242708}=_0x4c761b,_0xb62eb2=_0x84dd01||_0x242708[_0x486eb4(0x13b)];if(_0xb62eb2){const _0xc23914=await _0xac3ee4[_0x486eb4(0x10b)][_0x486eb4(0xfd)](),_0x426421=_0xc23914[_0x486eb4(0x134)](_0x25662e=>_0x25662e[_0x486eb4(0x122)][_0x486eb4(0x10d)]===_0xb62eb2);if(!_0x426421)throw new SDKError(ErrorCode[_0x486eb4(0x11b)],_0x486eb4(0x11d)+_0xb62eb2+_0x486eb4(0x102),undefined,{'helpText':_0x486eb4(0xf6)});return _0x426421['id'];}const _0x13f743=await _0xac3ee4[_0x486eb4(0x10b)][_0x486eb4(0x126)]();return _0x13f743['id'];}export class LLMProxyCommand extends BaseCommand{[a21_0x4e3b3c(0x10d)]=a21_0x4e3b3c(0x10c);[a21_0x4e3b3c(0xf9)]=a21_0x4e3b3c(0x120);[a21_0x4e3b3c(0x138)];['logger'];async[a21_0x4e3b3c(0x12a)](_0x22dc88){const _0x1c9a36=a21_0x4e3b3c,{tdx:_0x5732ff,options:_0x3c643f}=_0x22dc88;try{const _0x6c56da=_0x3c643f,_0x3c6092=_0x6c56da[_0x1c9a36(0x111)]||0xfa0,_0x1da552=_0x6c56da[_0x1c9a36(0x101)],_0x530e23=await findAvailablePort(_0x3c6092);console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x108)](_0x1c9a36(0x10e)));const _0x56d740=await getProjectIdOrDefault(_0x22dc88,_0x1da552),_0x3b5674=await _0x5732ff['llm'][_0x1c9a36(0xfd)](),_0x12fb90=_0x3b5674[_0x1c9a36(0x134)](_0x17926f=>_0x17926f['id']===_0x56d740);this[_0x1c9a36(0x12c)]=new TDXLogger(_0x3c643f[_0x1c9a36(0x124)]),await this[_0x1c9a36(0x12c)][_0x1c9a36(0x115)](),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x108)](_0x1c9a36(0x104)));_0x530e23!==_0x3c6092&&console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0xf5)](_0x1c9a36(0x12b)+_0x3c6092+_0x1c9a36(0xfc)+_0x530e23));this[_0x1c9a36(0x138)]=new ProxyServer({'port':_0x530e23,'projectId':_0x56d740,'tdx':_0x5732ff,'logger':this['logger'],'site':_0x3c643f[_0x1c9a36(0x11a)]}),await this['server'][_0x1c9a36(0x12f)](),console[_0x1c9a36(0x133)](a21_0x5bb3b0['yellow']['bold']('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0xf5)](_0x1c9a36(0x130))),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0xf5)](_0x1c9a36(0x13a))),console['log'](a21_0x5bb3b0[_0x1c9a36(0x132)][_0x1c9a36(0x113)](_0x1c9a36(0x123))),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x13e)](_0x1c9a36(0x107))),console['log'](a21_0x5bb3b0[_0x1c9a36(0x108)](_0x1c9a36(0x13d)),a21_0x5bb3b0['white'](_0x1c9a36(0x135)+_0x530e23)),console[_0x1c9a36(0x133)](a21_0x5bb3b0['dim'](_0x1c9a36(0x117)),a21_0x5bb3b0[_0x1c9a36(0x100)](_0x12fb90?.[_0x1c9a36(0x122)][_0x1c9a36(0x10d)]||_0x56d740)),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x108)](_0x1c9a36(0x112)),a21_0x5bb3b0['white'](_0x1c9a36(0x121))),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x108)](_0x1c9a36(0x11f)),a21_0x5bb3b0[_0x1c9a36(0x100)](_0x3c643f[_0x1c9a36(0x11a)])),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x13e)](_0x1c9a36(0x13c))),console[_0x1c9a36(0x133)](a21_0x5bb3b0['dim'](_0x1c9a36(0xff))),console['log'](a21_0x5bb3b0[_0x1c9a36(0x100)](_0x1c9a36(0x11e))),console['log'](a21_0x5bb3b0[_0x1c9a36(0x100)](_0x1c9a36(0x10f))),console[_0x1c9a36(0x133)](a21_0x5bb3b0['white']('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:'+_0x530e23+'\x22,')),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x100)](_0x1c9a36(0x10a))),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x100)](_0x1c9a36(0x136))),console['log'](a21_0x5bb3b0[_0x1c9a36(0x100)](_0x1c9a36(0xf7))),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x13e)](_0x1c9a36(0x12d))),console[_0x1c9a36(0x133)](a21_0x5bb3b0['dim'](_0x1c9a36(0xf8))),console[_0x1c9a36(0x133)](a21_0x5bb3b0[_0x1c9a36(0x108)](_0x1c9a36(0x109))),console['log'](a21_0x5bb3b0[_0x1c9a36(0x108)](_0x1c9a36(0x103))),console[_0x1c9a36(0x133)](a21_0x5bb3b0['yellow'](_0x1c9a36(0xfe)));const _0x203ca1=async()=>{const _0xf0f1d5=_0x1c9a36;console['log'](a21_0x5bb3b0[_0xf0f1d5(0x108)](_0xf0f1d5(0x110))),this['server']&&await this[_0xf0f1d5(0x138)][_0xf0f1d5(0x114)](),this[_0xf0f1d5(0x12c)]&&await this[_0xf0f1d5(0x12c)][_0xf0f1d5(0x106)](),console[_0xf0f1d5(0x133)](a21_0x5bb3b0[_0xf0f1d5(0x132)]('✓\x20Proxy\x20server\x20stopped')),process[_0xf0f1d5(0xfa)](0x0);};return process['on'](_0x1c9a36(0x118),_0x203ca1),process['on'](_0x1c9a36(0x12e),_0x203ca1),await new Promise(()=>{}),0x0;}catch(_0x4f9821){this[_0x1c9a36(0x138)]&&await this['server']['stop']();this['logger']&&await this[_0x1c9a36(0x12c)][_0x1c9a36(0x106)]();throw _0x4f9821;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x46744b=a22_0x2c84;(function(_0x3494be,_0x295675){const _0x3eb4a2=a22_0x2c84,_0x40d238=_0x3494be();while(!![]){try{const _0x59d90d=-parseInt(_0x3eb4a2(0x1bc))/0x1*(-parseInt(_0x3eb4a2(0x1ae))/0x2)+parseInt(_0x3eb4a2(0x1b8))/0x3*(parseInt(_0x3eb4a2(0x1ad))/0x4)+parseInt(_0x3eb4a2(0x1b1))/0x5+-parseInt(_0x3eb4a2(0x1b4))/0x6*(-parseInt(_0x3eb4a2(0x1c2))/0x7)+-parseInt(_0x3eb4a2(0x1b2))/0x8+-parseInt(_0x3eb4a2(0x1af))/0x9+parseInt(_0x3eb4a2(0x1bb))/0xa;if(_0x59d90d===_0x295675)break;else _0x40d238['push'](_0x40d238['shift']());}catch(_0x8bbb06){_0x40d238['push'](_0x40d238['shift']());}}}(a22_0x24a9,0x224a9));import{BaseCommand}from'./command.js';function a22_0x24a9(){const _0xca2419=['8343VrJmLc','verbose','behaviors','2018720GHIJBz','5NWYUom','✔\x20Updated\x20parent\x20segment\x20\x27','Parent\x20segment:\x20','site','Fetching\x20current\x20configuration\x20for\x20\x27','scheduleType','1105685kmlYBJ','error','✔\x20Created\x20parent\x20segment\x20\x27','customerGroupFile','segment','\x27\x20with\x20ID:\x20','data','length','Name:\x20','attributes','addBehaviorsFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20--database\x20and\x20--table\x20are\x20required','Create\x20new\x20parent\x20segment\x20(audience)','addBehaviors','Updating\x20parent\x20segment\x20\x27','scheduleOption','database','Site:\x20','description','addAttributes','\x27...','timezone','name','Creating\x20parent\x20segment\x20\x27','152XMClnB','38490LmSiJQ','2022354wDuIpD','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','101910PVNMrH','1735592PxTRBn','addAttributesFile','6qvdGBc','createParent','table','Update\x20existing\x20parent\x20segment\x20(audience)'];a22_0x24a9=function(){return _0xca2419;};return a22_0x24a9();}import{handleSDKOutput}from'../utils/command-output.js';function a22_0x2c84(_0x918f1f,_0x59a6c1){const _0x24a969=a22_0x24a9();return a22_0x2c84=function(_0x2c84df,_0xe1f9d2){_0x2c84df=_0x2c84df-0x1a6;let _0x133a7b=_0x24a969[_0x2c84df];return _0x133a7b;},a22_0x2c84(_0x918f1f,_0x59a6c1);}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{['name']='segment:parent:create';[a22_0x46744b(0x1a7)]=a22_0x46744b(0x1cf);async['execute'](_0x46fea9){const _0x261f02=a22_0x46744b,{options:_0x297ea9,args:_0x45fc24,tdx:_0x3f6241}=_0x46fea9,_0xddb26c=_0x297ea9;if(_0x45fc24[_0x261f02(0x1c9)]===0x0)return console[_0x261f02(0x1c3)](_0x261f02(0x1cd)),console[_0x261f02(0x1c3)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0xa20a1d=_0x45fc24[0x0];if(!_0xddb26c[_0x261f02(0x1d3)]||!_0xddb26c[_0x261f02(0x1b6)])return console[_0x261f02(0x1c3)](_0x261f02(0x1ce)),console[_0x261f02(0x1c3)](_0x261f02(0x1b0)),0x1;_0xddb26c[_0x261f02(0x1b9)]&&(console[_0x261f02(0x1c3)]('Site:\x20'+_0xddb26c[_0x261f02(0x1bf)]),console[_0x261f02(0x1c3)](_0x261f02(0x1ca)+_0xa20a1d),console['error']('Database:\x20'+_0xddb26c[_0x261f02(0x1d3)]),console[_0x261f02(0x1c3)]('Table:\x20'+_0xddb26c[_0x261f02(0x1b6)]));const _0x2475ef=await loadJSONFromOptions(_0xddb26c[_0x261f02(0x1cb)],_0xddb26c['attributesFile']),_0x16fcd8=await loadJSONFromOptions(_0xddb26c[_0x261f02(0x1ba)],_0xddb26c['behaviorsFile']),_0x5de111=await loadJSONFromOptions(_0xddb26c['customerGroup'],_0xddb26c[_0x261f02(0x1c5)]),_0x3b0281={'name':_0xa20a1d,'description':_0xddb26c[_0x261f02(0x1a7)],'scheduleType':_0xddb26c[_0x261f02(0x1c1)],'scheduleOption':_0xddb26c[_0x261f02(0x1d2)],'timezone':_0xddb26c['timezone'],'master':{'parentDatabaseName':_0xddb26c[_0x261f02(0x1d3)],'parentTableName':_0xddb26c[_0x261f02(0x1b6)]},'attributes':_0x2475ef,'behaviors':_0x16fcd8,'customerGroup':_0x5de111},_0xded994=await withSpinner(_0x261f02(0x1ac)+_0xa20a1d+_0x261f02(0x1a9),()=>_0x3f6241[_0x261f02(0x1c6)][_0x261f02(0x1b5)](_0x3b0281),{'verbose':_0x297ea9[_0x261f02(0x1b9)]}),_0x290cff=_0xded994[_0x261f02(0x1c8)];return console[_0x261f02(0x1c3)](_0x261f02(0x1c4)+_0x290cff[_0x261f02(0x1ab)]+_0x261f02(0x1c7)+_0x290cff['id']),await handleSDKOutput([_0x290cff],_0x297ea9),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x46744b(0x1ab)]='segment:parent:update';[a22_0x46744b(0x1a7)]=a22_0x46744b(0x1b7);async['execute'](_0x4756fc){const _0x28a691=a22_0x46744b,{options:_0x517289,args:_0x559f8b,tdx:_0x5e6621}=_0x4756fc,_0x2139ac=_0x517289;if(_0x559f8b[_0x28a691(0x1c9)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x28a691(0x1c3)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x2ca158=_0x559f8b[0x0];_0x2139ac[_0x28a691(0x1b9)]&&(console[_0x28a691(0x1c3)](_0x28a691(0x1a6)+_0x2139ac[_0x28a691(0x1bf)]),console['error'](_0x28a691(0x1be)+_0x2ca158));const _0x4e1fc0=await withSpinner(_0x28a691(0x1c0)+_0x2ca158+'\x27...',()=>_0x5e6621[_0x28a691(0x1c6)]['getParentFull'](_0x2ca158),{'verbose':_0x2139ac[_0x28a691(0x1b9)]}),_0x2ac517=_0x4e1fc0['data'],_0x5b1b81=await loadJSONFromOptions(_0x2139ac[_0x28a691(0x1a8)],_0x2139ac[_0x28a691(0x1b3)]),_0x406315=await loadJSONFromOptions(_0x2139ac[_0x28a691(0x1d0)],_0x2139ac[_0x28a691(0x1cc)]),_0x44f532={'name':_0x2ac517[_0x28a691(0x1ab)],'description':_0x2139ac[_0x28a691(0x1a7)]!==undefined?_0x2139ac['description']:_0x2ac517[_0x28a691(0x1a7)],'scheduleType':_0x2139ac[_0x28a691(0x1c1)]!==undefined?_0x2139ac['scheduleType']:_0x2ac517[_0x28a691(0x1c1)],'scheduleOption':_0x2139ac['scheduleOption']!==undefined?_0x2139ac[_0x28a691(0x1d2)]:_0x2ac517['scheduleOption'],'timezone':_0x2139ac[_0x28a691(0x1aa)]!==undefined?_0x2139ac[_0x28a691(0x1aa)]:_0x2ac517[_0x28a691(0x1aa)],'master':_0x2ac517['master'],'attributes':_0x5b1b81?[..._0x2ac517[_0x28a691(0x1cb)]||[],..._0x5b1b81]:_0x2ac517['attributes'],'behaviors':_0x406315?[..._0x2ac517[_0x28a691(0x1ba)]||[],..._0x406315]:_0x2ac517[_0x28a691(0x1ba)],'customerGroup':_0x2ac517['customerGroup']},_0x51da3b=await withSpinner(_0x28a691(0x1d1)+_0x2ca158+_0x28a691(0x1a9),()=>_0x5e6621['segment']['updateParent'](_0x2ca158,_0x44f532),{'verbose':_0x2139ac[_0x28a691(0x1b9)]}),_0x3bb9c6=_0x51da3b[_0x28a691(0x1c8)];return console['error'](_0x28a691(0x1bd)+_0x3bb9c6[_0x28a691(0x1ab)]+'\x27'),await handleSDKOutput([_0x3bb9c6],_0x2139ac),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x5420d4=a23_0x1dde;(function(_0x5ab10d,_0x301128){const _0x2dc611=a23_0x1dde,_0x360ff4=_0x5ab10d();while(!![]){try{const _0x2cf87a=-parseInt(_0x2dc611(0x154))/0x1*(parseInt(_0x2dc611(0x14b))/0x2)+-parseInt(_0x2dc611(0x14d))/0x3*(-parseInt(_0x2dc611(0x146))/0x4)+parseInt(_0x2dc611(0x159))/0x5+parseInt(_0x2dc611(0x153))/0x6+parseInt(_0x2dc611(0x148))/0x7*(parseInt(_0x2dc611(0x152))/0x8)+parseInt(_0x2dc611(0x15a))/0x9*(parseInt(_0x2dc611(0x14a))/0xa)+-parseInt(_0x2dc611(0x143))/0xb;if(_0x2cf87a===_0x301128)break;else _0x360ff4['push'](_0x360ff4['shift']());}catch(_0xc06fd9){_0x360ff4['push'](_0x360ff4['shift']());}}}(a23_0x3a87,0x64111));import{BaseCommand}from'./command.js';function a23_0x1dde(_0x19f54c,_0x3a3ac0){const _0x3a874b=a23_0x3a87();return a23_0x1dde=function(_0x1dde4e,_0x38510d){_0x1dde4e=_0x1dde4e-0x143;let _0x267db2=_0x3a874b[_0x1dde4e];return _0x267db2;},a23_0x1dde(_0x19f54c,_0x3a3ac0);}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{['name']=a23_0x5420d4(0x145);['description']='List\x20all\x20available\x20profiles';async[a23_0x5420d4(0x158)](_0x1503a0){const _0x3822e5=a23_0x5420d4,{options:_0x6f5c46}=_0x1503a0;try{const _0xe77fe3=listProfiles(),_0x4a1a43=getActiveProfile();if(_0xe77fe3[_0x3822e5(0x144)]===0x0)return console['log'](_0x3822e5(0x147)),console[_0x3822e5(0x14c)](_0x3822e5(0x14e)),console[_0x3822e5(0x14c)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x2dcc48=_0xe77fe3[_0x3822e5(0x149)](_0x3fcad9=>{const _0x431686=_0x3822e5,_0x50d1a1=_0x3fcad9[_0x431686(0x150)]===_0x4a1a43,_0x18e18e=getProfileParams(_0x3fcad9[_0x431686(0x151)]);return{'name':_0x3fcad9[_0x431686(0x150)],'active':_0x50d1a1,'scope':_0x3fcad9[_0x431686(0x156)],'description':_0x3fcad9[_0x431686(0x151)][_0x431686(0x14f)]||'','params':_0x18e18e};});return await handleSDKOutput(_0x2dcc48,_0x6f5c46),0x0;}catch(_0x1b2625){return _0x1b2625 instanceof Error&&console[_0x3822e5(0x155)]('Error:\x20'+_0x1b2625[_0x3822e5(0x157)]),0x1;}}}function a23_0x3a87(){const _0x6ce810=['profiles','76672NoATEH','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','4598657pasPXx','map','50cLzFNF','2XuZjCC','log','3uwexoo','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','description','name','config','8aVUuNT','360780bJlRjw','289589JycnZF','error','scope','message','execute','63550HktDyf','505026aDiMUt','3630737fLheCc','length'];a23_0x3a87=function(){return _0x6ce810;};return a23_0x3a87();}
|