@treasuredata/tdx 0.9.3 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- 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.d.ts +52 -1
- package/dist/client/llm-api-client.d.ts.map +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/llm-api-client.js.map +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.d.ts +45 -1
- package/dist/client/td-api-client.d.ts.map +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/td-api-client.js.map +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/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.d.ts +35 -0
- package/dist/commands/connection-command.d.ts.map +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/connection-command.js.map +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +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-pull-command.d.ts.map +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-pull-command.js.map +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +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/user-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/connection-cache.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/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +15 -2
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection-validator.d.ts +119 -0
- package/dist/sdk/connection-validator.d.ts.map +1 -0
- package/dist/sdk/connection-validator.js +1 -0
- package/dist/sdk/connection-validator.js.map +1 -0
- package/dist/sdk/connection.d.ts +120 -1
- package/dist/sdk/connection.d.ts.map +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/connection.js.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +4 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +22 -6
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/connector-schema.d.ts +182 -0
- package/dist/types/connector-schema.d.ts.map +1 -0
- package/dist/types/connector-schema.js +1 -0
- package/dist/types/connector-schema.js.map +1 -0
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/llm.d.ts +107 -2
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/utils/agent-config.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.d.ts.map +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/journey-utils.js.map +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-config.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 a9_0x16c64e=a9_0x344c;(function(_0x1984c7,_0x24b10a){const _0x5c6fd4=a9_0x344c,_0x2a15fa=_0x1984c7();while(!![]){try{const _0x27fff6=parseInt(_0x5c6fd4(0x1be))/0x1+parseInt(_0x5c6fd4(0x1bc))/0x2+-parseInt(_0x5c6fd4(0x18f))/0x3+-parseInt(_0x5c6fd4(0x1a6))/0x4*(parseInt(_0x5c6fd4(0x191))/0x5)+parseInt(_0x5c6fd4(0x1ac))/0x6+parseInt(_0x5c6fd4(0x18d))/0x7+parseInt(_0x5c6fd4(0x189))/0x8*(parseInt(_0x5c6fd4(0x19f))/0x9);if(_0x27fff6===_0x24b10a)break;else _0x2a15fa['push'](_0x2a15fa['shift']());}catch(_0xb3033c){_0x2a15fa['push'](_0x2a15fa['shift']());}}}(a9_0x81fa,0x5a520));import{HTTPClient}from'./http-client.js';function a9_0x344c(_0x2f54c0,_0x2e9b6a){_0x2f54c0=_0x2f54c0-0x178;const _0x81fa9d=a9_0x81fa();let _0x344cc3=_0x81fa9d[_0x2f54c0];return _0x344cc3;}import{getEndpoint}from'../types/index.js';import{getTrinoHeaders}from'../core/auth.js';function a9_0x81fa(){const _0x53d85f=['PERMISSION_DENIED','TRINO_SYNTAX_ERROR','981PAulQJ','[query]','name',']\x20Query\x20ID:\x20','ALREADY_EXISTS','totalSplits','length','2434372DZoKGC','message','aborted','errorName','streamResults','headers','2158194RYZbOO','TRINO_INVALID_ARGUMENT','trino','warnings','state','consider\x20adding\x20LIMIT\x20clause','isTTY','httpClient','INTERNAL_ERROR','errorLocation','X-Trino-Schema','processedRows','min','convertRowsToObjects','stats','INTERNAL','399946gAnhCC','apiKey','405848wVffcq','dim','GET','forEach','POST','red','nextUri','executeQuery','errorType','\x20rows)\x20-\x20','columns','split','push','EXTERNAL','TRINO_INTERNAL_ERROR','max','data','request','9816QjPrmb','padStart','error','cancelQuery','458416JJFzEW','X-Trino-Catalog','558618IySaiP','x-td-jobid','5ZkfXJn','checkResponseError','Query\x20cancelled\x20by\x20user','join','toLocaleString','completedSplits','stdout','repeat','Invalid\x20nextUri\x20format:\x20','site','pathname','warn'];a9_0x81fa=function(){return _0x53d85f;};return a9_0x81fa();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{Chalk}from'chalk';export class TrinoApiClient{['httpClient'];constructor(_0x1d2e60,_0x28cf13){const _0x282e8e=a9_0x344c,_0x1e4273=getEndpoint(_0x1d2e60['site'],_0x282e8e(0x1ae)),_0x533a12=getTrinoHeaders(_0x1d2e60[_0x282e8e(0x19a)],_0x1d2e60[_0x282e8e(0x1bd)]);this[_0x282e8e(0x1b3)]=new HTTPClient(_0x1e4273,_0x533a12,_0x28cf13);}async[a9_0x16c64e(0x17e)](_0x44ec7c,_0x394765={}){const _0x11ce3c=a9_0x16c64e,{catalog:_0x1e8d89,schema:_0x14da5e,timeout:_0x29554a,signal:_0xc71dc,onJobId:_0x18cb48,onProgress:_0x595340}=_0x394765,_0x167cd3={'Content-Type':'text/plain'};(_0x1e8d89||_0x14da5e)&&(_0x167cd3[_0x11ce3c(0x18e)]=_0x1e8d89||'td');_0x14da5e&&(_0x167cd3[_0x11ce3c(0x1b6)]=_0x14da5e);const _0x5099f7=await this[_0x11ce3c(0x1b3)][_0x11ce3c(0x188)](_0x11ce3c(0x17b),'/v1/statement',{'headers':_0x167cd3,'body':_0x44ec7c,'timeout':_0x29554a,'signal':_0xc71dc,'includeHeaders':!![]}),_0xf8b693=_0x5099f7['data'],_0x108226=_0x5099f7[_0x11ce3c(0x1ab)],_0x24e7ec=_0x108226[_0x11ce3c(0x190)]||_0x108226['X-TD-JobId'];_0x24e7ec&&_0x18cb48&&_0x18cb48(_0x24e7ec);this[_0x11ce3c(0x192)](_0xf8b693,_0xf8b693['id'],_0x44ec7c);const _0x43e4f1=await this['streamResults'](_0xf8b693,_0x44ec7c,_0xc71dc,_0x595340);return _0x24e7ec&&(_0x43e4f1['jobId']=_0x24e7ec),_0x43e4f1;}async[a9_0x16c64e(0x1aa)](_0x1ff391,_0x3c1004,_0x39e36c,_0x4936be){const _0x300220=a9_0x16c64e,_0x2a213a=_0x1ff391['id'];let _0x5269fc=[];const _0x57ae5c=[],_0x35e15c=[];let _0x103abf=_0x1ff391;const _0x565dd5=0x186a0;_0x103abf['columns']&&(_0x5269fc=_0x103abf[_0x300220(0x181)]);_0x103abf[_0x300220(0x187)]&&_0x57ae5c[_0x300220(0x183)](..._0x103abf[_0x300220(0x187)]);_0x103abf[_0x300220(0x1af)]&&_0x35e15c[_0x300220(0x183)](..._0x103abf[_0x300220(0x1af)]);_0x4936be&&_0x103abf[_0x300220(0x1ba)]&&_0x4936be({'state':_0x103abf[_0x300220(0x1ba)][_0x300220(0x1b0)],'processedRows':_0x103abf[_0x300220(0x1ba)][_0x300220(0x1b7)],'completedSplits':_0x103abf[_0x300220(0x1ba)][_0x300220(0x196)],'totalSplits':_0x103abf[_0x300220(0x1ba)][_0x300220(0x1a4)]});while(_0x103abf[_0x300220(0x17d)]){if(_0x39e36c?.[_0x300220(0x1a8)]){await this[_0x300220(0x18c)](_0x103abf['nextUri']);throw new Error(_0x300220(0x193));}let _0x25c175;try{_0x25c175=new URL(_0x103abf['nextUri'])[_0x300220(0x19b)];}catch{throw new Error(_0x300220(0x199)+_0x103abf[_0x300220(0x17d)]);}_0x103abf=await this[_0x300220(0x1b3)][_0x300220(0x188)](_0x300220(0x179),_0x25c175,{'signal':_0x39e36c}),this[_0x300220(0x192)](_0x103abf,_0x2a213a,_0x3c1004),_0x103abf[_0x300220(0x181)]&&_0x5269fc[_0x300220(0x1a5)]===0x0&&(_0x5269fc=_0x103abf[_0x300220(0x181)]),_0x103abf[_0x300220(0x187)]&&(_0x57ae5c[_0x300220(0x183)](..._0x103abf[_0x300220(0x187)]),_0x57ae5c[_0x300220(0x1a5)]>_0x565dd5&&_0x57ae5c[_0x300220(0x1a5)]%0xc350===0x0&&console[_0x300220(0x19c)]('Warning:\x20Large\x20result\x20set\x20('+_0x57ae5c[_0x300220(0x1a5)][_0x300220(0x195)]()+_0x300220(0x180)+_0x300220(0x1b1))),_0x103abf[_0x300220(0x1af)]&&_0x35e15c[_0x300220(0x183)](..._0x103abf[_0x300220(0x1af)]),_0x4936be&&_0x103abf[_0x300220(0x1ba)]&&_0x4936be({'state':_0x103abf[_0x300220(0x1ba)][_0x300220(0x1b0)],'processedRows':_0x103abf['stats'][_0x300220(0x1b7)],'completedSplits':_0x103abf[_0x300220(0x1ba)]['completedSplits'],'totalSplits':_0x103abf[_0x300220(0x1ba)]['totalSplits']});}const _0x287cf0=this[_0x300220(0x1b9)](_0x5269fc,_0x57ae5c);return{'queryId':_0x2a213a,'columns':_0x5269fc,'data':_0x287cf0,'stats':_0x103abf[_0x300220(0x1ba)],'warnings':_0x35e15c[_0x300220(0x1a5)]>0x0?_0x35e15c:undefined};}[a9_0x16c64e(0x192)](_0x4e3aeb,_0x5c71a8,_0x3e88e8){const _0x145a7b=a9_0x16c64e;if(!_0x4e3aeb[_0x145a7b(0x18b)])return;const _0x2dc0d2=_0x4e3aeb['error'],_0x40bcda=mapTrinoErrorToErrorCode(_0x2dc0d2),_0x26ae1d=process[_0x145a7b(0x197)]['isTTY']?new Chalk({'level':0x3}):new Chalk({'level':0x0}),_0x457e2b='['+_0x2dc0d2[_0x145a7b(0x1a9)]+_0x145a7b(0x1a2)+_0x5c71a8;let _0x51fabd=_0x26ae1d[_0x145a7b(0x17c)](_0x457e2b+'\x0a'+_0x2dc0d2[_0x145a7b(0x1a7)]);if(_0x3e88e8&&_0x2dc0d2[_0x145a7b(0x1b5)]){const {lineNumber:_0xfebd42,columnNumber:_0x5369b5}=_0x2dc0d2[_0x145a7b(0x1b5)];_0x51fabd+='\x0a\x0a'+_0x26ae1d['dim'](_0x145a7b(0x1a0))+'\x0a'+formatSqlErrorContext(_0x3e88e8,_0xfebd42,_0x5369b5);}throw new SDKError(_0x40bcda,_0x51fabd,_0x2dc0d2);}[a9_0x16c64e(0x1b9)](_0x3f80dc,_0x31ec11){const _0x575126=a9_0x16c64e;if(_0x3f80dc[_0x575126(0x1a5)]===0x0)return _0x31ec11;return _0x31ec11['map'](_0x50a3db=>{const _0x4a2cf9=_0x575126,_0x3d3606={};return _0x3f80dc[_0x4a2cf9(0x17a)]((_0x2136cd,_0x5afb9a)=>{const _0x13a8f9=_0x4a2cf9;_0x3d3606[_0x2136cd[_0x13a8f9(0x1a1)]]=_0x50a3db[_0x5afb9a];}),_0x3d3606;});}async[a9_0x16c64e(0x18c)](_0xbbd509){const _0x5bd478=a9_0x16c64e;try{const _0x4ba87c=new URL(_0xbbd509)[_0x5bd478(0x19b)];await this[_0x5bd478(0x1b3)][_0x5bd478(0x188)]('DELETE',_0x4ba87c);}catch(_0x194a95){console['warn']('Failed\x20to\x20cancel\x20query:',_0x194a95);}}}function formatSqlErrorContext(_0x247d62,_0x5cbef9,_0x523b33){const _0x41b4be=a9_0x16c64e,_0x22d755=_0x247d62[_0x41b4be(0x182)]('\x0a');if(_0x5cbef9<0x1||_0x5cbef9>_0x22d755[_0x41b4be(0x1a5)])return _0x247d62;const _0x4d3826=_0x5cbef9-0x1,_0x21d5d1=Math[_0x41b4be(0x186)](0x0,_0x4d3826-0x2),_0x47114b=Math[_0x41b4be(0x1b8)](_0x22d755[_0x41b4be(0x1a5)],_0x4d3826+0x3),_0x3b403a=[],_0x511e7c=process[_0x41b4be(0x197)][_0x41b4be(0x1b2)]?new Chalk({'level':0x3}):new Chalk({'level':0x0});for(let _0x5e514f=_0x21d5d1;_0x5e514f<_0x47114b;_0x5e514f++){const _0x2d4ca2=_0x5e514f===_0x4d3826?'>\x20':'\x20\x20',_0x56157c=String(_0x5e514f+0x1)[_0x41b4be(0x18a)](0x3,'\x20'),_0x476e1f=_0x511e7c[_0x41b4be(0x178)](''+_0x2d4ca2+_0x56157c+'\x20|');_0x3b403a[_0x41b4be(0x183)](_0x476e1f+'\x20'+_0x22d755[_0x5e514f]);if(_0x5e514f===_0x4d3826){const _0xa37ea1=0x8+(_0x523b33-0x1);_0x3b403a[_0x41b4be(0x183)]('\x20'[_0x41b4be(0x198)](_0xa37ea1)+'^');}}return _0x3b403a[_0x41b4be(0x194)]('\x0a');}function mapTrinoErrorToErrorCode(_0x14837c){const _0xcb16cc=a9_0x16c64e,_0x309560=_0x14837c[_0xcb16cc(0x17f)],_0x3e8234=_0x14837c['errorCode'];if(_0x309560==='USER_ERROR')switch(_0x3e8234){case 0x1:return ErrorCode[_0xcb16cc(0x19e)];case 0x3:return ErrorCode['TRINO_USER_CANCELLED'];case 0x4:return ErrorCode[_0xcb16cc(0x19d)];case 0x5:case 0x2c:case 0x2d:case 0x2e:case 0x2f:return ErrorCode['TRINO_NOT_FOUND'];case 0xc:case 0x31:case 0x32:return ErrorCode[_0xcb16cc(0x1a3)];default:return ErrorCode[_0xcb16cc(0x1ad)];}else{if(_0x309560===_0xcb16cc(0x1b4))return ErrorCode[_0xcb16cc(0x185)];else{if(_0x309560==='INSUFFICIENT_RESOURCES')return ErrorCode['TRINO_INSUFFICIENT_RESOURCES'];else{if(_0x309560===_0xcb16cc(0x184))return ErrorCode['TRINO_INTERNAL_ERROR'];}}}return ErrorCode[_0xcb16cc(0x1bb)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a10_0x48f0e1=a10_0x2617;function a10_0x2617(_0x1426d3,_0x162cd2){_0x1426d3=_0x1426d3-0xe7;const _0x2e858d=a10_0x2e85();let _0x2617ab=_0x2e858d[_0x1426d3];return _0x2617ab;}(function(_0x10e756,_0x2adea0){const _0x73f8bd=a10_0x2617,_0x28c3af=_0x10e756();while(!![]){try{const _0x35edb9=parseInt(_0x73f8bd(0x10d))/0x1*(-parseInt(_0x73f8bd(0x125))/0x2)+-parseInt(_0x73f8bd(0xf8))/0x3+parseInt(_0x73f8bd(0x12e))/0x4+-parseInt(_0x73f8bd(0x114))/0x5+parseInt(_0x73f8bd(0x13e))/0x6*(-parseInt(_0x73f8bd(0xf5))/0x7)+parseInt(_0x73f8bd(0x11b))/0x8*(-parseInt(_0x73f8bd(0x12f))/0x9)+parseInt(_0x73f8bd(0x10f))/0xa;if(_0x35edb9===_0x2adea0)break;else _0x28c3af['push'](_0x28c3af['shift']());}catch(_0x5f4caf){_0x28c3af['push'](_0x28c3af['shift']());}}}(a10_0x2e85,0xe5eb2));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';import{matchGlobPattern}from'../utils/string-utils.js';function a10_0x2e85(){const _0x321e31=['task','/api/attempts/','/archive','name_pattern','/files?','DELETE','GET','retryAttemptName','to_time','name','/kill','POST','retrySession','project_name','getTaskLogs','startAttempt','721JBlhrm','/logs?','search_project_name','1079121TKGxVa','killAttempt','httpClient','workflow_name','getAttemptTasks','apiKey','/sessions','filter','workflowId','clear_schedule','replace','request','getAttempt','from_time','/api/sessions/','retry_params','project_id','projectName','include_subtasks','resume_from','project','70315ysyHKp','/files','37431640ssqhCR','sessions','allowQueueing','params','/api/attempts?','8750030QVCljj','attempts','clear_schedule_all','tasks','scheduleFrom','schedule_from','status','737864AknxFm','/api/projects?','workflow','PUT','lastId','readFile','projects','offset','/api/attempts','listWorkflows','2xioFWf','listAttempts','/archive?','/retry','/tasks','writeFile','/api/sessions','listLogFiles','workflowName','3971496DHqGyl','9qTYGOP','reason','last_id','/tasks/','revision','clearScheduleAll','deleteProject','site','retryAttempt','/tasks?','true','/api/projects/','limit','uploadProjectArchive','from_task','88662ZPmiWR','authHeaders','toString','append','force','include_retried','downloadProjectArchive'];a10_0x2e85=function(){return _0x321e31;};return a10_0x2e85();}export class WorkflowApiClient{[a10_0x48f0e1(0xfa)];[a10_0x48f0e1(0x13f)];constructor(_0x13d9bb,_0x1e416c){const _0x5741c5=a10_0x48f0e1,_0x1609b6=getEndpoint(_0x13d9bb[_0x5741c5(0x136)],_0x5741c5(0x11d));this[_0x5741c5(0x13f)]=toHeaderRecord(getAuthHeaders(_0x13d9bb['site'],_0x13d9bb[_0x5741c5(0xfd)])),this[_0x5741c5(0xfa)]=new HTTPClient(_0x1609b6,this[_0x5741c5(0x13f)],_0x1e416c);}async['listProjects'](_0x135562){const _0x5b2bb8=a10_0x48f0e1,_0x120c7f=new URLSearchParams();if(_0x135562?.[_0x5b2bb8(0x13b)])_0x120c7f[_0x5b2bb8(0x141)](_0x5b2bb8(0x13b),String(_0x135562[_0x5b2bb8(0x13b)]));if(_0x135562?.[_0x5b2bb8(0x131)])_0x120c7f[_0x5b2bb8(0x141)](_0x5b2bb8(0x131),_0x135562[_0x5b2bb8(0x131)]);if(_0x135562?.[_0x5b2bb8(0xe8)]){const _0x27a2e1=_0x135562[_0x5b2bb8(0xe8)][_0x5b2bb8(0x102)](/[*?]/g,'');_0x27a2e1&&_0x120c7f[_0x5b2bb8(0x141)]('name_pattern',_0x27a2e1);}const _0x17a05e=_0x120c7f['toString'](),_0x41b175=_0x17a05e?'/api/projects?'+_0x17a05e:'/api/projects',_0x17cd75=await this[_0x5b2bb8(0xfa)][_0x5b2bb8(0x103)](_0x5b2bb8(0xeb),_0x41b175);let _0x2bf3ec=_0x17cd75[_0x5b2bb8(0x121)]||[];return _0x135562?.[_0x5b2bb8(0xe8)]&&(_0x2bf3ec=_0x2bf3ec[_0x5b2bb8(0xff)](_0x4a5c07=>{const _0x4a5523=_0x5b2bb8;return matchGlobPattern(_0x4a5c07[_0x4a5523(0xee)],_0x135562[_0x4a5523(0xe8)]);})),{'data':_0x2bf3ec,'lastId':_0x17cd75[_0x5b2bb8(0x11f)]};}async[a10_0x48f0e1(0x124)](_0x4bfb82){const _0x4fdf00=a10_0x48f0e1,_0x382235=new URLSearchParams();if(_0x4bfb82?.[_0x4fdf00(0x13b)])_0x382235[_0x4fdf00(0x141)]('limit',String(_0x4bfb82[_0x4fdf00(0x13b)]));if(_0x4bfb82?.['last_id'])_0x382235[_0x4fdf00(0x141)](_0x4fdf00(0x131),_0x4bfb82['last_id']);if(_0x4bfb82?.[_0x4fdf00(0xf2)]){const _0x324e7c=_0x4bfb82[_0x4fdf00(0xf2)][_0x4fdf00(0x102)](/[*?]/g,'');_0x324e7c&&(_0x382235[_0x4fdf00(0x141)]('name_pattern',_0x324e7c),_0x382235[_0x4fdf00(0x141)](_0x4fdf00(0xf7),'true'));}const _0x5669b3=_0x382235['toString'](),_0x36fb28=_0x5669b3?'/api/workflows?'+_0x5669b3:'/api/workflows',_0x20da32=await this[_0x4fdf00(0xfa)]['request'](_0x4fdf00(0xeb),_0x36fb28);let _0xe43dee=_0x20da32['workflows']||[];return _0x4bfb82?.[_0x4fdf00(0xf2)]&&(_0xe43dee=_0xe43dee[_0x4fdf00(0xff)](_0x3e9959=>{const _0x4d1a62=_0x4fdf00,_0x9c2df1=_0x3e9959[_0x4d1a62(0x10c)]?.[_0x4d1a62(0xee)];if(!_0x9c2df1)return![];return matchGlobPattern(_0x9c2df1,_0x4bfb82[_0x4d1a62(0xf2)]);})),{'data':_0xe43dee,'lastId':_0x20da32[_0x4fdf00(0x11f)]};}async['listSessions'](_0x496653){const _0x21e629=a10_0x48f0e1;let _0x239bb0=_0x21e629(0x12b);_0x496653?.[_0x21e629(0x108)]&&(_0x239bb0=_0x21e629(0x13a)+encodeURIComponent(_0x496653[_0x21e629(0x108)])+_0x21e629(0xfe));const _0x3bdc83=new URLSearchParams();if(_0x496653?.[_0x21e629(0xfb)])_0x3bdc83[_0x21e629(0x141)](_0x21e629(0x11d),_0x496653['workflow_name']);if(_0x496653?.[_0x21e629(0x11a)])_0x3bdc83[_0x21e629(0x141)](_0x21e629(0x11a),_0x496653[_0x21e629(0x11a)]);if(_0x496653?.[_0x21e629(0x105)])_0x3bdc83[_0x21e629(0x141)](_0x21e629(0x105),_0x496653[_0x21e629(0x105)]);if(_0x496653?.[_0x21e629(0xed)])_0x3bdc83[_0x21e629(0x141)]('to_time',_0x496653[_0x21e629(0xed)]);if(_0x496653?.[_0x21e629(0x13b)])_0x3bdc83[_0x21e629(0x141)]('limit',String(_0x496653[_0x21e629(0x13b)]));if(_0x496653?.[_0x21e629(0x131)])_0x3bdc83[_0x21e629(0x141)](_0x21e629(0x131),_0x496653[_0x21e629(0x131)]);const _0x214f60=_0x3bdc83[_0x21e629(0x140)]();_0x214f60&&(_0x239bb0=_0x239bb0+'?'+_0x214f60);const _0x401b53=await this[_0x21e629(0xfa)][_0x21e629(0x103)](_0x21e629(0xeb),_0x239bb0);return{'data':_0x401b53[_0x21e629(0x110)]||[],'lastId':_0x401b53[_0x21e629(0x11f)]};}async[a10_0x48f0e1(0x126)](_0x1b1ab5){const _0x48fb16=a10_0x48f0e1,_0x5873c4=new URLSearchParams();if(_0x1b1ab5?.[_0x48fb16(0xf2)])_0x5873c4[_0x48fb16(0x141)]('project',_0x1b1ab5[_0x48fb16(0xf2)]);if(_0x1b1ab5?.['workflow_name'])_0x5873c4[_0x48fb16(0x141)](_0x48fb16(0x11d),_0x1b1ab5[_0x48fb16(0xfb)]);if(_0x1b1ab5?.[_0x48fb16(0x143)])_0x5873c4[_0x48fb16(0x141)](_0x48fb16(0x143),'1');if(_0x1b1ab5?.['limit'])_0x5873c4[_0x48fb16(0x141)]('limit',String(_0x1b1ab5[_0x48fb16(0x13b)]));if(_0x1b1ab5?.[_0x48fb16(0x131)])_0x5873c4['append'](_0x48fb16(0x131),_0x1b1ab5[_0x48fb16(0x131)]);const _0x55c959=_0x5873c4[_0x48fb16(0x140)](),_0x199c94=_0x55c959?_0x48fb16(0x113)+_0x55c959:'/api/attempts',_0x38a422=await this[_0x48fb16(0xfa)]['request'](_0x48fb16(0xeb),_0x199c94);return{'data':_0x38a422[_0x48fb16(0x115)]||[],'lastId':_0x38a422[_0x48fb16(0x11f)]};}async[a10_0x48f0e1(0x104)](_0x2dbf7c){const _0x4b1bf1=a10_0x48f0e1;return await this[_0x4b1bf1(0xfa)][_0x4b1bf1(0x103)](_0x4b1bf1(0xeb),_0x4b1bf1(0x146)+encodeURIComponent(_0x2dbf7c));}async[a10_0x48f0e1(0xfc)](_0x18705e,_0x42efc2=![]){const _0x58d9ef=a10_0x48f0e1,_0x1ddece=new URLSearchParams();_0x42efc2&&_0x1ddece[_0x58d9ef(0x141)](_0x58d9ef(0x10a),'true');const _0x187a7f=_0x1ddece[_0x58d9ef(0x140)](),_0x3be134=_0x187a7f?_0x58d9ef(0x146)+encodeURIComponent(_0x18705e)+_0x58d9ef(0x138)+_0x187a7f:_0x58d9ef(0x146)+encodeURIComponent(_0x18705e)+_0x58d9ef(0x129),_0x1bdf70=await this[_0x58d9ef(0xfa)][_0x58d9ef(0x103)](_0x58d9ef(0xeb),_0x3be134);return _0x1bdf70[_0x58d9ef(0x117)]||[];}async[a10_0x48f0e1(0xf3)](_0x591ce3,_0x1d62be,_0x224f77){const _0x52c118=a10_0x48f0e1,_0x4d906c=new URLSearchParams();_0x224f77?.['offset']!==undefined&&_0x4d906c['append'](_0x52c118(0x122),String(_0x224f77[_0x52c118(0x122)]));_0x224f77?.[_0x52c118(0x13b)]!==undefined&&_0x4d906c[_0x52c118(0x141)]('limit',String(_0x224f77[_0x52c118(0x13b)]));const _0x15e3df=_0x4d906c['toString'](),_0x22b39c=_0x15e3df?'/api/attempts/'+encodeURIComponent(_0x591ce3)+_0x52c118(0x132)+encodeURIComponent(_0x1d62be)+_0x52c118(0xf6)+_0x15e3df:_0x52c118(0x146)+encodeURIComponent(_0x591ce3)+_0x52c118(0x132)+encodeURIComponent(_0x1d62be)+'/logs',_0x460bd1=await this[_0x52c118(0xfa)][_0x52c118(0x103)](_0x52c118(0xeb),_0x22b39c);return _0x460bd1['logs']||[];}async[a10_0x48f0e1(0x12c)](_0x1346c,_0x4dbdf6){const _0x5d7057=a10_0x48f0e1,_0x496bfa=new URLSearchParams();_0x4dbdf6&&_0x496bfa['append'](_0x5d7057(0x145),_0x4dbdf6);const _0x3e4311=_0x496bfa[_0x5d7057(0x140)](),_0x46f5a5=_0x3e4311?'/api/logs/'+encodeURIComponent(_0x1346c)+_0x5d7057(0xe9)+_0x3e4311:'/api/logs/'+encodeURIComponent(_0x1346c)+_0x5d7057(0x10e),_0x5a7824=await this['httpClient'][_0x5d7057(0x103)](_0x5d7057(0xeb),_0x46f5a5);return _0x5a7824['files']||[];}async[a10_0x48f0e1(0xf9)](_0x2d44d4,_0x54285d){const _0x2a6dae=a10_0x48f0e1,_0x119047={};return _0x54285d&&(_0x119047[_0x2a6dae(0x130)]=_0x54285d),await this['httpClient'][_0x2a6dae(0x103)]('POST',_0x2a6dae(0x146)+encodeURIComponent(_0x2d44d4)+_0x2a6dae(0xef),{'body':_0x119047});}async[a10_0x48f0e1(0xf1)](_0x4bb9ba,_0x538773){const _0x36122c=a10_0x48f0e1,_0x346f35={};return _0x538773?.[_0x36122c(0x13d)]&&(_0x346f35[_0x36122c(0x13d)]=_0x538773[_0x36122c(0x13d)]),_0x538773?.[_0x36122c(0x107)]&&(_0x346f35[_0x36122c(0x107)]=_0x538773['retry_params']),await this['httpClient'][_0x36122c(0x103)](_0x36122c(0xf0),_0x36122c(0x106)+encodeURIComponent(_0x4bb9ba)+_0x36122c(0x128),{'body':_0x346f35});}async[a10_0x48f0e1(0x137)](_0x2c2ce5,_0x21f04c){const _0x429606=a10_0x48f0e1,_0x2723c3={};return _0x21f04c?.[_0x429606(0x10b)]&&(_0x2723c3[_0x429606(0x10b)]=_0x21f04c[_0x429606(0x10b)]),_0x21f04c?.['retry_params']&&(_0x2723c3[_0x429606(0x107)]=_0x21f04c['retry_params']),_0x21f04c?.['force']&&(_0x2723c3[_0x429606(0x142)]=_0x21f04c[_0x429606(0x142)]),await this[_0x429606(0xfa)][_0x429606(0x103)](_0x429606(0xf0),_0x429606(0x146)+encodeURIComponent(_0x2c2ce5)+_0x429606(0x128),{'body':_0x2723c3});}async[a10_0x48f0e1(0xf4)](_0x4dbe06){const _0x47d1fd=a10_0x48f0e1,_0x24afad={'sessionTime':_0x4dbe06['sessionTime'],'params':_0x4dbe06[_0x47d1fd(0x112)]};return _0x4dbe06[_0x47d1fd(0x100)]&&(_0x24afad[_0x47d1fd(0x100)]=_0x4dbe06[_0x47d1fd(0x100)]),_0x4dbe06[_0x47d1fd(0x109)]&&(_0x24afad[_0x47d1fd(0x109)]=_0x4dbe06['projectName']),_0x4dbe06[_0x47d1fd(0x12d)]&&(_0x24afad['workflowName']=_0x4dbe06[_0x47d1fd(0x12d)]),_0x4dbe06[_0x47d1fd(0xec)]&&(_0x24afad['retryAttemptName']=_0x4dbe06[_0x47d1fd(0xec)]),_0x4dbe06[_0x47d1fd(0x111)]!==undefined&&(_0x24afad[_0x47d1fd(0x111)]=_0x4dbe06[_0x47d1fd(0x111)]),await this[_0x47d1fd(0xfa)][_0x47d1fd(0x103)](_0x47d1fd(0x11e),_0x47d1fd(0x123),{'body':_0x24afad});}async[a10_0x48f0e1(0x144)](_0xbae43d,_0x363959,_0xb4a781){const _0x180a2b=a10_0x48f0e1,{promises:_0x4c188a}=await import('fs'),_0x1be490=new URLSearchParams();_0xb4a781&&_0x1be490[_0x180a2b(0x141)](_0x180a2b(0x133),_0xb4a781);const _0x50c95e=_0x1be490[_0x180a2b(0x140)](),_0x8e1416=_0x50c95e?_0x180a2b(0x13a)+encodeURIComponent(_0xbae43d)+_0x180a2b(0x127)+_0x50c95e:'/api/projects/'+encodeURIComponent(_0xbae43d)+_0x180a2b(0xe7),_0x319ca5=await this[_0x180a2b(0xfa)]['request'](_0x180a2b(0xeb),_0x8e1416,{'headers':{'Accept':'application/gzip'},'responseType':'arraybuffer'});return await _0x4c188a[_0x180a2b(0x12a)](_0x363959,_0x319ca5),_0x363959;}async[a10_0x48f0e1(0x13c)](_0x56f1bc,_0x5e4f89,_0x2f1630,_0x177505){const _0x452609=a10_0x48f0e1,{promises:_0x4eb20f}=await import('fs'),_0x235d81=new URLSearchParams();_0x235d81[_0x452609(0x141)](_0x452609(0x10c),_0x56f1bc),_0x235d81[_0x452609(0x141)](_0x452609(0x133),_0x5e4f89);_0x177505?.['scheduleFrom']&&_0x235d81[_0x452609(0x141)](_0x452609(0x119),_0x177505[_0x452609(0x118)]);_0x177505?.['clearSchedule']&&_0x177505['clearSchedule']['forEach'](_0x1c045e=>{const _0x5b7b97=_0x452609;_0x235d81[_0x5b7b97(0x141)](_0x5b7b97(0x101),_0x1c045e);});_0x177505?.[_0x452609(0x134)]&&_0x235d81[_0x452609(0x141)](_0x452609(0x116),_0x452609(0x139));const _0x27fd2e=_0x235d81[_0x452609(0x140)](),_0xe265e8=_0x452609(0x11c)+_0x27fd2e,_0x42216b=await _0x4eb20f[_0x452609(0x120)](_0x2f1630);return await this[_0x452609(0xfa)][_0x452609(0x103)](_0x452609(0x11e),_0xe265e8,{'body':_0x42216b,'headers':{'Content-Type':'application/gzip'}});}async[a10_0x48f0e1(0x135)](_0x8ffaac){const _0x53fc2b=a10_0x48f0e1;return await this[_0x53fc2b(0xfa)]['request'](_0x53fc2b(0xea),_0x53fc2b(0x13a)+encodeURIComponent(_0x8ffaac));}}
|
|
1
|
+
const a10_0x27cb81=a10_0x2736;(function(_0x124519,_0xeb34fe){const _0xce6971=a10_0x2736,_0x5525f4=_0x124519();while(!![]){try{const _0x4591f8=-parseInt(_0xce6971(0xaa))/0x1*(-parseInt(_0xce6971(0xb7))/0x2)+-parseInt(_0xce6971(0xb1))/0x3+-parseInt(_0xce6971(0xd3))/0x4*(parseInt(_0xce6971(0xdc))/0x5)+parseInt(_0xce6971(0xfa))/0x6*(parseInt(_0xce6971(0xb4))/0x7)+-parseInt(_0xce6971(0xf5))/0x8+parseInt(_0xce6971(0xb6))/0x9+-parseInt(_0xce6971(0xa6))/0xa*(-parseInt(_0xce6971(0xb3))/0xb);if(_0x4591f8===_0xeb34fe)break;else _0x5525f4['push'](_0x5525f4['shift']());}catch(_0x1ff867){_0x5525f4['push'](_0x5525f4['shift']());}}}(a10_0x4df6,0xaaaf3));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';function a10_0x2736(_0x13e189,_0x432fd0){_0x13e189=_0x13e189-0x9e;const _0x4df6ea=a10_0x4df6();let _0x2736eb=_0x4df6ea[_0x13e189];return _0x2736eb;}import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';import{matchGlobPattern}from'../utils/string-utils.js';function a10_0x4df6(){const _0x122c11=['to_time','schedule_from','/api/attempts?','from_time','readFile','listProjects','/retry','workflow','filter','1099816TkieFa','downloadProjectArchive','append','project','sessionTime','548742lLYMfO','resume_from','params','lastId','/api/workflows?','request','retrySession','/tasks/','GET','/archive','/kill','projectName','httpClient','13235370dXXxBq','listSessions','getAttempt','/tasks','135526RwsURN','authHeaders','deleteProject','application/gzip','name_pattern','status','include_subtasks','2890014MHzndD','/api/attempts/','11ZgBOSy','14ABsHgD','/files?','3879783TEUeyd','2myDDQM','/logs','tasks','site','uploadProjectArchive','include_retried','last_id','/archive?','from_task','logs','/api/logs/','name','listAttempts','clearSchedule','retryAttemptName','POST','/api/projects','limit','/api/attempts','/logs?','true','reason','PUT','getAttemptTasks','replace','workflowId','/tasks?','revision','4xOwJZk','files','toString','startAttempt','clearScheduleAll','scheduleFrom','workflowName','clear_schedule','force','1365630dlukxy','offset','DELETE','workflows','retry_params','allowQueueing','writeFile','/api/projects/','search_project_name','listWorkflows','attempts','workflow_name','project_id','task','projects','project_name'];a10_0x4df6=function(){return _0x122c11;};return a10_0x4df6();}export class WorkflowApiClient{[a10_0x27cb81(0xa5)];[a10_0x27cb81(0xab)];constructor(_0x149d96,_0x587cc9){const _0x58654f=a10_0x27cb81,_0x255b9b=getEndpoint(_0x149d96[_0x58654f(0xba)],'workflow');this[_0x58654f(0xab)]=toHeaderRecord(getAuthHeaders(_0x149d96[_0x58654f(0xba)],_0x149d96['apiKey'])),this['httpClient']=new HTTPClient(_0x255b9b,this['authHeaders'],_0x587cc9);}async[a10_0x27cb81(0xf1)](_0x7fdc9e){const _0x173c73=a10_0x27cb81,_0x3f102d=new URLSearchParams();if(_0x7fdc9e?.[_0x173c73(0xc8)])_0x3f102d[_0x173c73(0xf7)](_0x173c73(0xc8),String(_0x7fdc9e['limit']));if(_0x7fdc9e?.[_0x173c73(0xbd)])_0x3f102d[_0x173c73(0xf7)](_0x173c73(0xbd),_0x7fdc9e[_0x173c73(0xbd)]);if(_0x7fdc9e?.[_0x173c73(0xae)]){const _0x379bdc=_0x7fdc9e[_0x173c73(0xae)][_0x173c73(0xcf)](/[*?]/g,'');_0x379bdc&&_0x3f102d['append']('name_pattern',_0x379bdc);}const _0x3ff63b=_0x3f102d['toString'](),_0x1fb80e=_0x3ff63b?'/api/projects?'+_0x3ff63b:_0x173c73(0xc7),_0x140310=await this[_0x173c73(0xa5)]['request']('GET',_0x1fb80e);let _0x4ca606=_0x140310[_0x173c73(0xea)]||[];return _0x7fdc9e?.['name_pattern']&&(_0x4ca606=_0x4ca606['filter'](_0x675781=>{const _0x59dee0=_0x173c73;return matchGlobPattern(_0x675781[_0x59dee0(0xc2)],_0x7fdc9e['name_pattern']);})),{'data':_0x4ca606,'lastId':_0x140310[_0x173c73(0xfd)]};}async[a10_0x27cb81(0xe5)](_0x313c18){const _0x324d71=a10_0x27cb81,_0x505485=new URLSearchParams();if(_0x313c18?.[_0x324d71(0xc8)])_0x505485[_0x324d71(0xf7)](_0x324d71(0xc8),String(_0x313c18[_0x324d71(0xc8)]));if(_0x313c18?.[_0x324d71(0xbd)])_0x505485['append']('last_id',_0x313c18[_0x324d71(0xbd)]);if(_0x313c18?.['project_name']){const _0x23ae40=_0x313c18[_0x324d71(0xeb)]['replace'](/[*?]/g,'');_0x23ae40&&(_0x505485[_0x324d71(0xf7)](_0x324d71(0xae),_0x23ae40),_0x505485[_0x324d71(0xf7)](_0x324d71(0xe4),_0x324d71(0xcb)));}const _0x4e1559=_0x505485['toString'](),_0x53fe50=_0x4e1559?_0x324d71(0xfe)+_0x4e1559:'/api/workflows',_0x3cfcc5=await this[_0x324d71(0xa5)][_0x324d71(0x9e)](_0x324d71(0xa1),_0x53fe50);let _0x2b78ba=_0x3cfcc5[_0x324d71(0xdf)]||[];return _0x313c18?.[_0x324d71(0xeb)]&&(_0x2b78ba=_0x2b78ba[_0x324d71(0xf4)](_0x406fbb=>{const _0x51607b=_0x324d71,_0x50f334=_0x406fbb[_0x51607b(0xf8)]?.[_0x51607b(0xc2)];if(!_0x50f334)return![];return matchGlobPattern(_0x50f334,_0x313c18['project_name']);})),{'data':_0x2b78ba,'lastId':_0x3cfcc5[_0x324d71(0xfd)]};}async[a10_0x27cb81(0xa7)](_0x3a2a47){const _0x12eebf=a10_0x27cb81;let _0xf17739='/api/sessions';_0x3a2a47?.[_0x12eebf(0xe8)]&&(_0xf17739=_0x12eebf(0xe3)+encodeURIComponent(_0x3a2a47['project_id'])+'/sessions');const _0x431adf=new URLSearchParams();if(_0x3a2a47?.[_0x12eebf(0xe7)])_0x431adf['append'](_0x12eebf(0xf3),_0x3a2a47[_0x12eebf(0xe7)]);if(_0x3a2a47?.['status'])_0x431adf[_0x12eebf(0xf7)](_0x12eebf(0xaf),_0x3a2a47[_0x12eebf(0xaf)]);if(_0x3a2a47?.[_0x12eebf(0xef)])_0x431adf['append'](_0x12eebf(0xef),_0x3a2a47[_0x12eebf(0xef)]);if(_0x3a2a47?.[_0x12eebf(0xec)])_0x431adf[_0x12eebf(0xf7)](_0x12eebf(0xec),_0x3a2a47[_0x12eebf(0xec)]);if(_0x3a2a47?.[_0x12eebf(0xc8)])_0x431adf[_0x12eebf(0xf7)]('limit',String(_0x3a2a47[_0x12eebf(0xc8)]));if(_0x3a2a47?.['last_id'])_0x431adf[_0x12eebf(0xf7)]('last_id',_0x3a2a47[_0x12eebf(0xbd)]);const _0x3ba43d=_0x431adf[_0x12eebf(0xd5)]();_0x3ba43d&&(_0xf17739=_0xf17739+'?'+_0x3ba43d);const _0x24ad62=await this['httpClient'][_0x12eebf(0x9e)](_0x12eebf(0xa1),_0xf17739);return{'data':_0x24ad62['sessions']||[],'lastId':_0x24ad62[_0x12eebf(0xfd)]};}async[a10_0x27cb81(0xc3)](_0x17921a){const _0x1b2bf8=a10_0x27cb81,_0x5d85b5=new URLSearchParams();if(_0x17921a?.[_0x1b2bf8(0xeb)])_0x5d85b5['append']('project',_0x17921a[_0x1b2bf8(0xeb)]);if(_0x17921a?.[_0x1b2bf8(0xe7)])_0x5d85b5[_0x1b2bf8(0xf7)](_0x1b2bf8(0xf3),_0x17921a[_0x1b2bf8(0xe7)]);if(_0x17921a?.[_0x1b2bf8(0xbc)])_0x5d85b5[_0x1b2bf8(0xf7)](_0x1b2bf8(0xbc),'1');if(_0x17921a?.['limit'])_0x5d85b5[_0x1b2bf8(0xf7)]('limit',String(_0x17921a[_0x1b2bf8(0xc8)]));if(_0x17921a?.[_0x1b2bf8(0xbd)])_0x5d85b5[_0x1b2bf8(0xf7)](_0x1b2bf8(0xbd),_0x17921a[_0x1b2bf8(0xbd)]);const _0x1ed07e=_0x5d85b5[_0x1b2bf8(0xd5)](),_0x1f7093=_0x1ed07e?_0x1b2bf8(0xee)+_0x1ed07e:_0x1b2bf8(0xc9),_0x526a90=await this[_0x1b2bf8(0xa5)]['request'](_0x1b2bf8(0xa1),_0x1f7093);return{'data':_0x526a90[_0x1b2bf8(0xe6)]||[],'lastId':_0x526a90['lastId']};}async[a10_0x27cb81(0xa8)](_0x4ec004){const _0x367eae=a10_0x27cb81;return await this[_0x367eae(0xa5)][_0x367eae(0x9e)](_0x367eae(0xa1),_0x367eae(0xb2)+encodeURIComponent(_0x4ec004));}async[a10_0x27cb81(0xce)](_0x4a052f,_0x268387=![]){const _0x5e96d1=a10_0x27cb81,_0x53393a=new URLSearchParams();_0x268387&&_0x53393a[_0x5e96d1(0xf7)](_0x5e96d1(0xb0),_0x5e96d1(0xcb));const _0xd10039=_0x53393a[_0x5e96d1(0xd5)](),_0x1294e8=_0xd10039?_0x5e96d1(0xb2)+encodeURIComponent(_0x4a052f)+_0x5e96d1(0xd1)+_0xd10039:'/api/attempts/'+encodeURIComponent(_0x4a052f)+_0x5e96d1(0xa9),_0x42e598=await this[_0x5e96d1(0xa5)]['request'](_0x5e96d1(0xa1),_0x1294e8);return _0x42e598[_0x5e96d1(0xb9)]||[];}async['getTaskLogs'](_0x2144a6,_0x34dc18,_0x595e5f){const _0x56746e=a10_0x27cb81,_0x3e2093=new URLSearchParams();_0x595e5f?.[_0x56746e(0xdd)]!==undefined&&_0x3e2093[_0x56746e(0xf7)](_0x56746e(0xdd),String(_0x595e5f[_0x56746e(0xdd)]));_0x595e5f?.[_0x56746e(0xc8)]!==undefined&&_0x3e2093[_0x56746e(0xf7)](_0x56746e(0xc8),String(_0x595e5f[_0x56746e(0xc8)]));const _0x52a292=_0x3e2093['toString'](),_0x4cc07c=_0x52a292?_0x56746e(0xb2)+encodeURIComponent(_0x2144a6)+_0x56746e(0xa0)+encodeURIComponent(_0x34dc18)+_0x56746e(0xca)+_0x52a292:_0x56746e(0xb2)+encodeURIComponent(_0x2144a6)+_0x56746e(0xa0)+encodeURIComponent(_0x34dc18)+_0x56746e(0xb8),_0x259d5e=await this[_0x56746e(0xa5)][_0x56746e(0x9e)](_0x56746e(0xa1),_0x4cc07c);return _0x259d5e[_0x56746e(0xc0)]||[];}async['listLogFiles'](_0x19baa9,_0x4b6c70){const _0x36983e=a10_0x27cb81,_0x5517a3=new URLSearchParams();_0x4b6c70&&_0x5517a3[_0x36983e(0xf7)](_0x36983e(0xe9),_0x4b6c70);const _0x9f2b97=_0x5517a3[_0x36983e(0xd5)](),_0xe66f6c=_0x9f2b97?'/api/logs/'+encodeURIComponent(_0x19baa9)+_0x36983e(0xb5)+_0x9f2b97:_0x36983e(0xc1)+encodeURIComponent(_0x19baa9)+'/files',_0x10c557=await this[_0x36983e(0xa5)][_0x36983e(0x9e)]('GET',_0xe66f6c);return _0x10c557[_0x36983e(0xd4)]||[];}async['killAttempt'](_0x18cd0a,_0x4f53cf){const _0x563a29=a10_0x27cb81,_0x246b82={};return _0x4f53cf&&(_0x246b82[_0x563a29(0xcc)]=_0x4f53cf),await this[_0x563a29(0xa5)][_0x563a29(0x9e)](_0x563a29(0xc6),_0x563a29(0xb2)+encodeURIComponent(_0x18cd0a)+_0x563a29(0xa3),{'body':_0x246b82});}async[a10_0x27cb81(0x9f)](_0x274c56,_0x5576fb){const _0x4d1528=a10_0x27cb81,_0x2d53c4={};return _0x5576fb?.[_0x4d1528(0xbf)]&&(_0x2d53c4[_0x4d1528(0xbf)]=_0x5576fb[_0x4d1528(0xbf)]),_0x5576fb?.['retry_params']&&(_0x2d53c4[_0x4d1528(0xe0)]=_0x5576fb[_0x4d1528(0xe0)]),await this['httpClient']['request'](_0x4d1528(0xc6),'/api/sessions/'+encodeURIComponent(_0x274c56)+_0x4d1528(0xf2),{'body':_0x2d53c4});}async['retryAttempt'](_0x58af1e,_0x285ab1){const _0x271251=a10_0x27cb81,_0x261b01={};return _0x285ab1?.[_0x271251(0xfb)]&&(_0x261b01[_0x271251(0xfb)]=_0x285ab1[_0x271251(0xfb)]),_0x285ab1?.[_0x271251(0xe0)]&&(_0x261b01[_0x271251(0xe0)]=_0x285ab1['retry_params']),_0x285ab1?.[_0x271251(0xdb)]&&(_0x261b01[_0x271251(0xdb)]=_0x285ab1[_0x271251(0xdb)]),await this[_0x271251(0xa5)][_0x271251(0x9e)]('POST','/api/attempts/'+encodeURIComponent(_0x58af1e)+_0x271251(0xf2),{'body':_0x261b01});}async[a10_0x27cb81(0xd6)](_0x4e85eb){const _0x225b02=a10_0x27cb81,_0x169217={'sessionTime':_0x4e85eb[_0x225b02(0xf9)],'params':_0x4e85eb[_0x225b02(0xfc)]};return _0x4e85eb[_0x225b02(0xd0)]&&(_0x169217['workflowId']=_0x4e85eb[_0x225b02(0xd0)]),_0x4e85eb[_0x225b02(0xa4)]&&(_0x169217['projectName']=_0x4e85eb[_0x225b02(0xa4)]),_0x4e85eb['workflowName']&&(_0x169217[_0x225b02(0xd9)]=_0x4e85eb[_0x225b02(0xd9)]),_0x4e85eb[_0x225b02(0xc5)]&&(_0x169217[_0x225b02(0xc5)]=_0x4e85eb[_0x225b02(0xc5)]),_0x4e85eb[_0x225b02(0xe1)]!==undefined&&(_0x169217['allowQueueing']=_0x4e85eb[_0x225b02(0xe1)]),await this[_0x225b02(0xa5)]['request'](_0x225b02(0xcd),_0x225b02(0xc9),{'body':_0x169217});}async[a10_0x27cb81(0xf6)](_0x3857fe,_0x46511a,_0x25f1e7){const _0x48a627=a10_0x27cb81,{promises:_0x81eee3}=await import('fs'),_0x420a89=new URLSearchParams();_0x25f1e7&&_0x420a89[_0x48a627(0xf7)](_0x48a627(0xd2),_0x25f1e7);const _0x2c6667=_0x420a89[_0x48a627(0xd5)](),_0x1f0fdb=_0x2c6667?_0x48a627(0xe3)+encodeURIComponent(_0x3857fe)+_0x48a627(0xbe)+_0x2c6667:_0x48a627(0xe3)+encodeURIComponent(_0x3857fe)+_0x48a627(0xa2),_0x36614b=await this[_0x48a627(0xa5)][_0x48a627(0x9e)](_0x48a627(0xa1),_0x1f0fdb,{'headers':{'Accept':_0x48a627(0xad)},'responseType':'arraybuffer'});return await _0x81eee3[_0x48a627(0xe2)](_0x46511a,_0x36614b),_0x46511a;}async[a10_0x27cb81(0xbb)](_0x440f96,_0x1f483d,_0x5f2275,_0x8e4592){const _0x53a5fa=a10_0x27cb81,{promises:_0x44238c}=await import('fs'),_0x3afaf9=new URLSearchParams();_0x3afaf9[_0x53a5fa(0xf7)](_0x53a5fa(0xf8),_0x440f96),_0x3afaf9[_0x53a5fa(0xf7)]('revision',_0x1f483d);_0x8e4592?.['scheduleFrom']&&_0x3afaf9[_0x53a5fa(0xf7)](_0x53a5fa(0xed),_0x8e4592[_0x53a5fa(0xd8)]);_0x8e4592?.[_0x53a5fa(0xc4)]&&_0x8e4592['clearSchedule']['forEach'](_0x421ecc=>{const _0x4bc7dc=_0x53a5fa;_0x3afaf9[_0x4bc7dc(0xf7)](_0x4bc7dc(0xda),_0x421ecc);});_0x8e4592?.[_0x53a5fa(0xd7)]&&_0x3afaf9[_0x53a5fa(0xf7)]('clear_schedule_all',_0x53a5fa(0xcb));const _0x2e37a2=_0x3afaf9[_0x53a5fa(0xd5)](),_0x3520f6='/api/projects?'+_0x2e37a2,_0x49f50c=await _0x44238c[_0x53a5fa(0xf0)](_0x5f2275);return await this['httpClient'][_0x53a5fa(0x9e)](_0x53a5fa(0xcd),_0x3520f6,{'body':_0x49f50c,'headers':{'Content-Type':_0x53a5fa(0xad)}});}async[a10_0x27cb81(0xac)](_0x40f24b){const _0x3d4779=a10_0x27cb81;return await this[_0x3d4779(0xa5)][_0x3d4779(0x9e)](_0x3d4779(0xde),_0x3d4779(0xe3)+encodeURIComponent(_0x40f24b));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a11_0x56dd(_0x188c4b,_0x47401b){_0x188c4b=_0x188c4b-0x1e4;const _0x2e5f92=a11_0x2e5f();let _0x56dd0d=_0x2e5f92[_0x188c4b];return _0x56dd0d;}const a11_0x3e58ce=a11_0x56dd;(function(_0x1320c7,_0x2f66ec){const _0x3dd572=a11_0x56dd,_0x5730b4=_0x1320c7();while(!![]){try{const _0x371eb5=parseInt(_0x3dd572(0x1eb))/0x1*(parseInt(_0x3dd572(0x20a))/0x2)+parseInt(_0x3dd572(0x1ed))/0x3+parseInt(_0x3dd572(0x1e8))/0x4*(-parseInt(_0x3dd572(0x1ef))/0x5)+-parseInt(_0x3dd572(0x1e7))/0x6*(parseInt(_0x3dd572(0x206))/0x7)+parseInt(_0x3dd572(0x1f2))/0x8*(-parseInt(_0x3dd572(0x1fd))/0x9)+-parseInt(_0x3dd572(0x1f3))/0xa*(-parseInt(_0x3dd572(0x1fe))/0xb)+parseInt(_0x3dd572(0x1ff))/0xc*(parseInt(_0x3dd572(0x201))/0xd);if(_0x371eb5===_0x2f66ec)break;else _0x5730b4['push'](_0x5730b4['shift']());}catch(_0x53b68d){_0x5730b4['push'](_0x5730b4['shift']());}}}(a11_0x2e5f,0x5cd00));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';function a11_0x2e5f(){const _0x16d153=['36oPgnEg','length','532259aNTvQm','\x27...','List\x20activations\x20for\x20a\x20segment','data','\x20activation','21JZWIIE','✔\x20Found\x20','Parent\x20name:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','2Ohnlzd','\x20\x20Cause:\x20','cause','description','Child\x20name:\x20','1070166kzrcHz','2056ciZoTJ','resolveParentId','Resolving\x20child\x20segment\x20\x27','189963igZCVP','execute','1203402vaMhwi','Error:\x20','1955CFoFst','resolveSegmentId','site','2088536gmocnS','20DwjBxP','segment','Resolved\x20parent\x20ID:\x20','verbose','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','error','Resolved\x20child\x20ID:\x20','Site:\x20','Error:\x20Segment\x20name\x20is\x20required','name','9LTqIQO','3648469dVIhXR'];a11_0x2e5f=function(){return _0x16d153;};return a11_0x2e5f();}export class ActivationsCommand extends BaseCommand{[a11_0x3e58ce(0x1fc)]='activations';[a11_0x3e58ce(0x1e5)]=a11_0x3e58ce(0x203);async[a11_0x3e58ce(0x1ec)](_0x128e72){const _0x2f2df7=a11_0x3e58ce,{options:_0x5ab92f,args:_0x2bde76,tdx:_0x3aa3b3}=_0x128e72;if(_0x2bde76[_0x2f2df7(0x200)]===0x0)return console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1fb)),console[_0x2f2df7(0x1f8)](_0x2f2df7(0x209)),0x1;try{const {parentId:_0x29f9be,childId:_0x5da5f6}=parseSegmentRef(_0x2bde76[0x0]);if(!_0x5da5f6)return console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1f7)),console[_0x2f2df7(0x1f8)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x5ab92f[_0x2f2df7(0x1f6)]&&(console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1fa)+_0x5ab92f[_0x2f2df7(0x1f1)]),console[_0x2f2df7(0x1f8)](_0x2f2df7(0x208)+_0x29f9be),console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1e6)+_0x5da5f6));const _0x3d7201=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x29f9be+_0x2f2df7(0x202),()=>_0x3aa3b3['segment'][_0x2f2df7(0x1e9)](_0x29f9be),{'verbose':_0x5ab92f['verbose']}),_0x35254b=_0x3d7201[_0x2f2df7(0x204)];_0x5ab92f[_0x2f2df7(0x1f6)]&&console['error'](_0x2f2df7(0x1f5)+_0x35254b);const _0x1417fa=await withSpinner(_0x2f2df7(0x1ea)+_0x5da5f6+_0x2f2df7(0x202),()=>_0x3aa3b3[_0x2f2df7(0x1f4)][_0x2f2df7(0x1f0)](_0x35254b,_0x5da5f6),{'verbose':_0x5ab92f[_0x2f2df7(0x1f6)]}),_0x1ced84=_0x1417fa[_0x2f2df7(0x204)];_0x5ab92f[_0x2f2df7(0x1f6)]&&console['error'](_0x2f2df7(0x1f9)+_0x1ced84);const _0x4719d2=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x5da5f6+_0x2f2df7(0x202),()=>_0x3aa3b3[_0x2f2df7(0x1f4)]['listActivations'](_0x35254b,_0x1ced84),{'verbose':_0x5ab92f[_0x2f2df7(0x1f6)]}),_0x7a43f5=_0x4719d2[_0x2f2df7(0x204)];return console[_0x2f2df7(0x1f8)](_0x2f2df7(0x207)+_0x7a43f5['length']+_0x2f2df7(0x205)+(_0x7a43f5['length']!==0x1?'s':'')),await handleSDKOutput(_0x7a43f5,_0x5ab92f),0x0;}catch(_0x5217e5){if(_0x5217e5 instanceof SDKError)return console[_0x2f2df7(0x1f8)](_0x2f2df7(0x1ee)+_0x5217e5['message']),_0x5217e5['cause']&&console[_0x2f2df7(0x1f8)](_0x2f2df7(0x20b)+_0x5217e5[_0x2f2df7(0x1e4)]),0x1;throw _0x5217e5;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a12_0x2bae4c=a12_0x3cd2;(function(_0x518dc7,_0x42150f){const _0x28ad11=a12_0x3cd2,_0x452324=_0x518dc7();while(!![]){try{const _0x52518d=parseInt(_0x28ad11(0x164))/0x1+-parseInt(_0x28ad11(0x116))/0x2+parseInt(_0x28ad11(0x113))/0x3+-parseInt(_0x28ad11(0x14f))/0x4*(parseInt(_0x28ad11(0x114))/0x5)+-parseInt(_0x28ad11(0x198))/0x6+parseInt(_0x28ad11(0x191))/0x7*(-parseInt(_0x28ad11(0x12f))/0x8)+parseInt(_0x28ad11(0x11e))/0x9;if(_0x52518d===_0x42150f)break;else _0x452324['push'](_0x452324['shift']());}catch(_0x2f6bda){_0x452324['push'](_0x452324['shift']());}}}(a12_0x413a,0xdfd7b));import a12_0x22025a from'chalk';import a12_0x3503c0 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath}from'../utils/agent-config.js';import{saveSessionContext}from'../core/session.js';import{normalizeName}from'../sdk/agent/agent-yaml.js';function a12_0x3cd2(_0x48d97f,_0x44d50d){_0x48d97f=_0x48d97f-0x101;const _0x413a97=a12_0x413a();let _0x3cd2c4=_0x413a97[_0x48d97f];return _0x3cd2c4;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';function formatCountSummary(_0x340a39){const _0x4ba832=a12_0x3cd2,_0x3de0e4=[];if(_0x340a39[_0x4ba832(0x197)]!==undefined)_0x3de0e4[_0x4ba832(0x193)](_0x340a39['total']+_0x4ba832(0x165));if(_0x340a39[_0x4ba832(0x15e)]!==undefined&&_0x340a39['new']>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x169)](_0x340a39['new']+_0x4ba832(0x195)));if(_0x340a39[_0x4ba832(0x16d)]!==undefined&&_0x340a39['created']>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x169)](_0x340a39[_0x4ba832(0x16d)]+'\x20created'));if(_0x340a39[_0x4ba832(0x16a)]!==undefined&&_0x340a39[_0x4ba832(0x16a)]>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x152)](_0x340a39['updated']+'\x20updated'));if(_0x340a39[_0x4ba832(0x130)]!==undefined&&_0x340a39[_0x4ba832(0x130)]>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x14d)](_0x340a39[_0x4ba832(0x130)]+_0x4ba832(0x14a)));if(_0x340a39[_0x4ba832(0x18b)]!==undefined&&_0x340a39[_0x4ba832(0x18b)]>0x0)_0x3de0e4[_0x4ba832(0x193)](a12_0x22025a[_0x4ba832(0x17a)](_0x340a39[_0x4ba832(0x18b)]+'\x20errors'));return _0x3de0e4['join'](',\x20');}function displayDiffs(_0x483585,_0x4cfc5f,_0x4bfdbf,_0x279466){const _0x24ecfc=a12_0x3cd2;for(const _0x330a1b of _0x483585){if(_0x330a1b[_0x24ecfc(0x112)]){const _0x14f3fe=_0x330a1b[_0x24ecfc(0x14c)]||_0x330a1b[_0x24ecfc(0x101)];console['log'](_0x24ecfc(0x10d)+_0x14f3fe+'\x27:'),console[_0x24ecfc(0x140)]('─'[_0x24ecfc(0x186)](0x3c)),console[_0x24ecfc(0x140)](_0x330a1b['diff']),console[_0x24ecfc(0x140)]('─'[_0x24ecfc(0x186)](0x3c));}}for(const _0x440b5a of _0x4cfc5f){_0x440b5a[_0x24ecfc(0x112)]&&(console['log'](_0x24ecfc(0x180)+_0x440b5a['name']+'\x27:'),console['log']('─'[_0x24ecfc(0x186)](0x3c)),console['log'](_0x440b5a['diff']),console[_0x24ecfc(0x140)]('─'[_0x24ecfc(0x186)](0x3c)));}for(const _0x1c4ae2 of _0x4bfdbf){_0x1c4ae2[_0x24ecfc(0x112)]&&(console[_0x24ecfc(0x140)](_0x24ecfc(0x12e)+_0x1c4ae2[_0x24ecfc(0x101)]+'\x27:'),console['log']('─'[_0x24ecfc(0x186)](0x3c)),console['log'](_0x1c4ae2[_0x24ecfc(0x112)]),console['log']('─'['repeat'](0x3c)));}for(const _0x3ec62c of _0x279466){_0x3ec62c[_0x24ecfc(0x112)]&&(console[_0x24ecfc(0x140)](_0x24ecfc(0x184)+_0x3ec62c[_0x24ecfc(0x101)]+'\x27:'),console['log']('─'[_0x24ecfc(0x186)](0x3c)),console[_0x24ecfc(0x140)](_0x3ec62c[_0x24ecfc(0x112)]),console[_0x24ecfc(0x140)]('─'[_0x24ecfc(0x186)](0x3c)));}}function a12_0x413a(){const _0x104bca=['join','No\x20tdx.json\x20found\x20in\x20','errors','\x0a✔\x20Pulled\x20','prompts','dirname','\x0aProject\x20pushed\x20with\x20errors','Dry\x20run\x20-\x20no\x20changes\x20made','3845394kucSim','parse','push','\x20files\x20to\x20','\x20new','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','total','10946118RRghDC','action','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Analyzing\x20changes\x20to\x20push...','pushProject','name','outputDir','dim','Using\x20local\x20project:\x20','\x20files?','agent.yml','\x20changed','\x20\x20Agent\x20\x22','\x0aErrors\x20found:','site','\x22\x20but\x20no\x20local\x20folder\x20found.\x0a','cyan','\x0aChanges\x20to\x20agent\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20successfully','llmProject','Analyzing\x20project\x20\x22','diff','736056MOPEKN','780005lSabcM','Pushing\x20agent\x20from\x20\x22','2221132WumFIv','Pushing\x20to\x20project...','Chat:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20context\x20project:\x20','New\x20project\x20name\x20is\x20required','Status:\x20','counts','26664300KMiUyy','llm','\x22\x20to\x20a\x20different\x20profile','textKnowledgeBases','Clone\x20cancelled','llm_project','agents','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Project\x20cloned\x20successfully','execute','force','MISSING_ARGUMENT','Agent:\x20','\x0aPush\x20summary\x20for\x20\x27','agent:clone','pushAgent','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','8RROHOd','unchanged','Writing\x20files...','Summary:','sourceProjectName','Dry\x20run\x20-\x20no\x20files\x20written','outputPath','newProjectName','\x20\x20Prompts:\x20','tdx.json','Cloning\x20\x22','knowledgeBases','\x22...','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','Using\x20project:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','log','dryRun','\x22:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','hasChanges','INVALID_ARGUMENT','output','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Would\x20pull\x20agent:\x20','description','\x20unchanged','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agentName','gray','\x20resources?','8PDKFwx','\x22\x20from\x20project\x20\x22','Agent\x20','yellow','projectName','agentId','\x20|\x20','Errors:','\x20=\x20','✔\x20Context\x20set:\x20','projectId','agent:push','Would\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','cwd','new','\x20\x20Knowledge\x20Bases:\x20','Output:\x20','utf-8','\x20resources\x20to\x20\x27','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','1505070TgqCZd','\x20total','\x20\x20Prompt\x20\x22','\x0aPush\x20','Would\x20clone:','green','updated','session','\x20\x20Knowledge\x20Base\x20\x22','created','\x22\x20to\x20\x22','Project\x20cloned\x20with\x20errors','Project:\x20','\x20\x20tdx\x20agent\x20pull\x20','Pull\x20cancelled','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','newProjectId','pullProject','error','\x20\x20Source:\x20','New\x20project:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','red','Source:\x20','\x20--profile\x20','Using\x20project\x20from\x20','\x20\x20Target:\x20','\x20\x20Agents:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','<new-name>','Pulling\x20agent\x20\x22','yes','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','repeat','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22\x20to\x20new\x20project\x20\x22'];a12_0x413a=function(){return _0x104bca;};return a12_0x413a();}export class AgentPullCommand extends BaseCommand{[a12_0x2bae4c(0x101)]='agent:pull';[a12_0x2bae4c(0x149)]=a12_0x2bae4c(0x173);async[a12_0x2bae4c(0x127)](_0x4127e8){const _0x45732e=a12_0x2bae4c,{options:_0x310154,args:_0x251afc,tdx:_0x463263}=_0x4127e8,_0x2e3c69=_0x251afc[0x0],_0x5b89c9=_0x251afc[0x1],_0x2e8e25=_0x310154[_0x45732e(0x146)],_0x3aac05=_0x310154[_0x45732e(0x141)],_0x5d033d=_0x310154['force'],_0x4f722f=_0x310154[_0x45732e(0x183)],_0x30923a=_0x310154[_0x45732e(0x110)];let _0x39281a,_0x212f51;const _0x31f37f=findAgentConfigPath(process[_0x45732e(0x15d)]());if(_0x2e3c69){const _0x22237c=a12_0x3503c0[_0x45732e(0x189)](_0x2e3c69,_0x45732e(0x138));if(existsSync(_0x22237c))try{const _0xc60ff=JSON[_0x45732e(0x192)](readFileSync(_0x22237c,'utf-8'));_0x39281a=_0xc60ff[_0x45732e(0x123)],_0x212f51=_0x2e3c69,console[_0x45732e(0x140)](a12_0x22025a['dim'](_0x45732e(0x17d)+_0x22237c+':\x20'+_0x39281a));}catch{_0x39281a=_0x2e3c69;}else _0x39281a=_0x2e3c69;}else{if(_0x31f37f)try{const _0x2eb025=JSON[_0x45732e(0x192)](readFileSync(_0x31f37f,_0x45732e(0x161)));_0x39281a=_0x2eb025['llm_project'],_0x212f51=a12_0x3503c0[_0x45732e(0x18e)](_0x31f37f),console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x103)](_0x45732e(0x13e)+_0x39281a));}catch{_0x39281a=_0x30923a;}else _0x39281a=_0x30923a;}if(!_0x39281a)return console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x152)](_0x45732e(0x187))),console[_0x45732e(0x140)](_0x45732e(0x13d)),console[_0x45732e(0x140)](_0x45732e(0x196)),console[_0x45732e(0x140)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console['log'](_0x45732e(0x19a)),0x1;if(_0x5b89c9){const {data:_0x274ab2}=await withSpinner(_0x45732e(0x182)+_0x5b89c9+_0x45732e(0x150)+_0x39281a+'\x22...',()=>_0x463263[_0x45732e(0x11f)]['pullAgent'](_0x39281a,_0x5b89c9,_0x2e8e25,{'dryRun':_0x3aac05,'force':_0x5d033d}));if(_0x3aac05)return console[_0x45732e(0x140)](a12_0x22025a['yellow'](_0x45732e(0x134))),console[_0x45732e(0x140)](_0x45732e(0x148)+_0x274ab2[_0x45732e(0x14c)]),console[_0x45732e(0x140)]('Output\x20path:\x20'+_0x274ab2[_0x45732e(0x135)]),_0x274ab2[_0x45732e(0x112)]&&(console[_0x45732e(0x140)]('\x0aChanges:'),console[_0x45732e(0x140)]('─'[_0x45732e(0x186)](0x3c)),console[_0x45732e(0x140)](_0x274ab2[_0x45732e(0x112)]),console[_0x45732e(0x140)]('─'[_0x45732e(0x186)](0x3c))),0x0;return console[_0x45732e(0x140)](a12_0x22025a['green']('Agent\x20pulled\x20successfully')),console[_0x45732e(0x140)]('Agent:\x20'+_0x274ab2[_0x45732e(0x14c)]),console[_0x45732e(0x140)](_0x45732e(0x160)+_0x274ab2['outputPath']),console['log'](_0x45732e(0x11c)+(_0x274ab2['isNew']?a12_0x22025a[_0x45732e(0x169)](_0x45732e(0x15e)):_0x274ab2[_0x45732e(0x144)]?a12_0x22025a[_0x45732e(0x152)](_0x45732e(0x16a)):a12_0x22025a['gray'](_0x45732e(0x130)))),0x0;}const _0x241674=_0x212f51||_0x2e8e25,{data:_0x243c80}=await withSpinner(_0x45732e(0x111)+_0x39281a+_0x45732e(0x13b),()=>_0x463263[_0x45732e(0x11f)]['pullProject'](_0x39281a,_0x241674,{'dryRun':!![]})),_0x4dc1cb=_0x243c80[_0x45732e(0x11d)][_0x45732e(0x124)][_0x45732e(0x15e)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x13a)][_0x45732e(0x15e)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x121)][_0x45732e(0x15e)]+_0x243c80[_0x45732e(0x11d)]['prompts'][_0x45732e(0x15e)],_0x33f110=_0x243c80['counts'][_0x45732e(0x124)]['updated']+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x13a)][_0x45732e(0x16a)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x121)][_0x45732e(0x16a)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x18d)][_0x45732e(0x16a)],_0x435b5d=_0x243c80['counts'][_0x45732e(0x124)][_0x45732e(0x130)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x13a)][_0x45732e(0x130)]+_0x243c80[_0x45732e(0x11d)]['textKnowledgeBases'][_0x45732e(0x130)]+_0x243c80[_0x45732e(0x11d)][_0x45732e(0x18d)]['unchanged'];console[_0x45732e(0x140)]('\x0aPull\x20summary\x20for\x20\x27'+_0x243c80['projectName']+'\x27:'),console[_0x45732e(0x140)]('\x20\x20'+a12_0x22025a[_0x45732e(0x169)]('+\x20'+_0x4dc1cb+_0x45732e(0x195))+_0x45732e(0x155)+a12_0x22025a[_0x45732e(0x152)]('~\x20'+_0x33f110+'\x20changed')+_0x45732e(0x155)+a12_0x22025a[_0x45732e(0x103)]('=\x20'+_0x435b5d+_0x45732e(0x14a))),console[_0x45732e(0x140)]('\x20\x20Agents:\x20'+formatCountSummary(_0x243c80['counts'][_0x45732e(0x124)])),console[_0x45732e(0x140)](_0x45732e(0x15f)+formatCountSummary(_0x243c80['counts'][_0x45732e(0x13a)])),console[_0x45732e(0x140)](_0x45732e(0x143)+formatCountSummary(_0x243c80['counts'][_0x45732e(0x121)])),console['log'](_0x45732e(0x137)+formatCountSummary(_0x243c80[_0x45732e(0x11d)][_0x45732e(0x18d)])),console[_0x45732e(0x140)](_0x45732e(0x17e)+a12_0x22025a['cyan'](_0x243c80[_0x45732e(0x102)])),displayDiffs(_0x243c80[_0x45732e(0x124)],_0x243c80[_0x45732e(0x13a)],_0x243c80[_0x45732e(0x121)],_0x243c80[_0x45732e(0x18d)]);if(_0x3aac05)return console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x152)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4dc1cb===0x0&&_0x33f110===0x0)return console[_0x45732e(0x140)](a12_0x22025a['green'](_0x45732e(0x163))),saveSessionContext({'llm_project':_0x243c80[_0x45732e(0x153)]},_0x310154[_0x45732e(0x16b)]),console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x169)](_0x45732e(0x158)+a12_0x22025a[_0x45732e(0x103)](_0x45732e(0x123))+_0x45732e(0x157)+a12_0x22025a[_0x45732e(0x10c)](_0x243c80['projectName']))),0x0;if(!_0x4f722f&&!_0x5d033d){const _0x594e4f=await confirmKey('\x0aWrite\x20'+(_0x4dc1cb+_0x33f110)+_0x45732e(0x105));if(!_0x594e4f)return console[_0x45732e(0x140)](_0x45732e(0x172)),0x0;}const {data:_0x580a36}=await withSpinner(_0x45732e(0x131),()=>_0x463263[_0x45732e(0x11f)][_0x45732e(0x175)](_0x39281a,_0x241674,{'force':_0x5d033d}));return console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x169)](_0x45732e(0x18c)+(_0x4dc1cb+_0x33f110)+_0x45732e(0x194)+_0x580a36[_0x45732e(0x102)])),saveSessionContext({'llm_project':_0x580a36[_0x45732e(0x153)]},_0x310154['session']),console[_0x45732e(0x140)](a12_0x22025a[_0x45732e(0x169)](_0x45732e(0x158)+a12_0x22025a['dim'](_0x45732e(0x123))+'\x20=\x20'+a12_0x22025a['cyan'](_0x580a36[_0x45732e(0x153)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a12_0x2bae4c(0x101)]=a12_0x2bae4c(0x12c);[a12_0x2bae4c(0x149)]=a12_0x2bae4c(0x147);async[a12_0x2bae4c(0x127)](_0x550d8f){const _0xaf4b7c=a12_0x2bae4c,{options:_0x206cea,args:_0x3b3f1a,tdx:_0x4cc942}=_0x550d8f,_0x3410ed=_0x3b3f1a[0x0],_0x138c01=_0x206cea[_0xaf4b7c(0x101)],_0x28551f=_0x206cea[_0xaf4b7c(0x141)],_0x3ba680=_0x206cea[_0xaf4b7c(0x183)],_0x536d36=_0x206cea[_0xaf4b7c(0x10a)],_0x2ea15b=_0x206cea['llmProject'];let _0x5c7dd8;const _0x6d26b8=findAgentConfigPath(process[_0xaf4b7c(0x15d)]());if(_0x3410ed){const _0x188096=a12_0x3503c0['join'](_0x3410ed,_0xaf4b7c(0x138));existsSync(_0x188096)?(_0x5c7dd8=_0x3410ed,console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x103)]('Using\x20local\x20project:\x20'+_0x3410ed))):_0x5c7dd8=_0x3410ed;}else{if(_0x6d26b8)_0x5c7dd8=a12_0x3503c0[_0xaf4b7c(0x18e)](_0x6d26b8),console[_0xaf4b7c(0x140)](a12_0x22025a['dim']('Using\x20current\x20project:\x20'+_0x5c7dd8));else{if(_0x2ea15b){const _0x2784f7=normalizeName(_0x2ea15b),_0x295157=a12_0x3503c0['join'](process[_0xaf4b7c(0x15d)](),_0xaf4b7c(0x124),_0x2784f7,_0xaf4b7c(0x138));if(existsSync(_0x295157))_0x5c7dd8=a12_0x3503c0[_0xaf4b7c(0x18e)](_0x295157),console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x103)](_0xaf4b7c(0x104)+_0x5c7dd8));else{const _0xb61035=_0x206cea['profile'];if(_0xb61035)throw new SDKError(ErrorCode[_0xaf4b7c(0x145)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x2ea15b+_0xaf4b7c(0x120),undefined,{'helpText':_0xaf4b7c(0x10e)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0xaf4b7c(0x171)+_0x2ea15b+'\x0a')+(_0xaf4b7c(0x15c)+_0x2784f7+'\x20--name\x20'+(_0x138c01||_0xaf4b7c(0x181))+_0xaf4b7c(0x17c)+_0xb61035)});_0x5c7dd8=_0x2ea15b,console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x103)](_0xaf4b7c(0x11a)+_0x2ea15b));}}}}if(!_0x5c7dd8)return console[_0xaf4b7c(0x140)](a12_0x22025a['yellow'](_0xaf4b7c(0x179))),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x185)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0xaf4b7c(0x140)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0xaf4b7c(0x140)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x138c01)throw new SDKError(ErrorCode[_0xaf4b7c(0x129)],_0xaf4b7c(0x11b),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x3ba680&&!_0x28551f){const _0x61333d=await confirmKey('Clone\x20\x22'+_0x5c7dd8+_0xaf4b7c(0x188)+_0x138c01+'\x22?');if(!_0x61333d)return console[_0xaf4b7c(0x140)](_0xaf4b7c(0x122)),0x0;}const {data:_0x149031}=await withSpinner(_0xaf4b7c(0x139)+_0x5c7dd8+_0xaf4b7c(0x16e)+_0x138c01+'\x22...',()=>_0x4cc942[_0xaf4b7c(0x11f)]['cloneProject'](_0x5c7dd8,_0x138c01,{'dryRun':_0x28551f}));if(_0x28551f)return console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x152)](_0xaf4b7c(0x190))),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x17b)+_0x149031[_0xaf4b7c(0x133)]),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x178)+_0x138c01),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x168)),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x17f)+_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x124)][_0xaf4b7c(0x16d)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x13a)][_0xaf4b7c(0x16d)]),console['log']('\x20\x20Prompts:\x20'+_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x18d)]['created']),0x0;const _0x118c78=_0x149031['counts'][_0xaf4b7c(0x124)][_0xaf4b7c(0x18b)]>0x0||_0x149031['counts'][_0xaf4b7c(0x13a)][_0xaf4b7c(0x18b)]>0x0||_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x18d)]['errors']>0x0;_0x118c78?console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x152)](_0xaf4b7c(0x16f))):console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x169)](_0xaf4b7c(0x126)));console[_0xaf4b7c(0x140)](_0xaf4b7c(0x17b)+_0x149031[_0xaf4b7c(0x133)]),console['log'](_0xaf4b7c(0x178)+_0x149031[_0xaf4b7c(0x136)]),console['log']('New\x20project\x20ID:\x20'+_0x149031['newProjectId']),console[_0xaf4b7c(0x140)](),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x132)),console[_0xaf4b7c(0x140)]('\x20\x20Agents:\x20'+formatCountSummary(_0x149031[_0xaf4b7c(0x11d)][_0xaf4b7c(0x124)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x149031['counts'][_0xaf4b7c(0x13a)])),console[_0xaf4b7c(0x140)](_0xaf4b7c(0x137)+formatCountSummary(_0x149031['counts'][_0xaf4b7c(0x18d)]));if(_0x118c78){console['log'](),console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x17a)]('Errors:'));for(const _0x3d9d20 of _0x149031['agents']){_0x3d9d20[_0xaf4b7c(0x199)]===_0xaf4b7c(0x176)&&console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x17a)](_0xaf4b7c(0x108)+_0x3d9d20[_0xaf4b7c(0x14c)]+_0xaf4b7c(0x142)+_0x3d9d20['error']));}for(const _0x2f3d72 of _0x149031[_0xaf4b7c(0x13a)]){_0x2f3d72[_0xaf4b7c(0x199)]===_0xaf4b7c(0x176)&&console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x17a)](_0xaf4b7c(0x16c)+_0x2f3d72[_0xaf4b7c(0x101)]+_0xaf4b7c(0x142)+_0x2f3d72[_0xaf4b7c(0x176)]));}for(const _0x4d1a70 of _0x149031[_0xaf4b7c(0x18d)]){_0x4d1a70[_0xaf4b7c(0x199)]===_0xaf4b7c(0x176)&&console[_0xaf4b7c(0x140)](a12_0x22025a['red'](_0xaf4b7c(0x166)+_0x4d1a70['name']+_0xaf4b7c(0x142)+_0x4d1a70[_0xaf4b7c(0x176)]));}return 0x1;}saveSessionContext({'llm_project':_0x149031[_0xaf4b7c(0x136)]},_0x206cea[_0xaf4b7c(0x16b)]),console[_0xaf4b7c(0x140)](),console[_0xaf4b7c(0x140)](a12_0x22025a[_0xaf4b7c(0x169)]('Context\x20set:\x20'+a12_0x22025a[_0xaf4b7c(0x103)]('llm_project')+_0xaf4b7c(0x157)+a12_0x22025a[_0xaf4b7c(0x10c)](_0x149031[_0xaf4b7c(0x136)])));const _0x55cdd2=getLLMProjectUrl(_0x536d36,_0x149031[_0xaf4b7c(0x174)]);return console[_0xaf4b7c(0x140)](_0xaf4b7c(0x170)+a12_0x22025a['cyan'](_0x55cdd2)),0x0;}}export class AgentPushCommand extends BaseCommand{[a12_0x2bae4c(0x101)]=a12_0x2bae4c(0x15a);['description']=a12_0x2bae4c(0x13c);async[a12_0x2bae4c(0x127)](_0x45f8e6){const _0x399e4b=a12_0x2bae4c,{options:_0x2b4984,args:_0x27e950,tdx:_0x59075c}=_0x45f8e6;let _0x2ba9c2=_0x27e950[0x0]||process[_0x399e4b(0x15d)]();const _0x53d561=_0x2b4984[_0x399e4b(0x141)],_0x276de7=_0x2b4984[_0x399e4b(0x128)],_0x40a4a5=_0x2b4984[_0x399e4b(0x183)],_0x255775=_0x2b4984['site'],_0x114f24=a12_0x3503c0[_0x399e4b(0x189)](_0x2ba9c2,_0x399e4b(0x106)),_0x1011e6=existsSync(_0x114f24);if(_0x1011e6){const {data:_0x3edb0}=await withSpinner(_0x399e4b(0x115)+_0x2ba9c2+_0x399e4b(0x13b),()=>_0x59075c[_0x399e4b(0x11f)][_0x399e4b(0x12d)](_0x2ba9c2,{'dryRun':_0x53d561,'force':_0x276de7}));if(_0x53d561)return console['log'](a12_0x22025a[_0x399e4b(0x152)](_0x399e4b(0x190))),console[_0x399e4b(0x140)](_0x399e4b(0x15b)+_0x3edb0[_0x399e4b(0x14c)]),0x0;if(_0x3edb0['action']===_0x399e4b(0x176))return console[_0x399e4b(0x140)](a12_0x22025a['red']('Failed\x20to\x20push\x20agent:\x20'+_0x3edb0['error'])),0x1;console['log'](a12_0x22025a[_0x399e4b(0x169)](_0x399e4b(0x151)+_0x3edb0[_0x399e4b(0x199)]+_0x399e4b(0x10f))),console[_0x399e4b(0x140)](_0x399e4b(0x12a)+_0x3edb0[_0x399e4b(0x14c)]);if(_0x3edb0['agentId']&&_0x3edb0[_0x399e4b(0x159)]){const _0x233011=getLLMAgentChatUrl(_0x255775,_0x3edb0[_0x399e4b(0x159)],_0x3edb0[_0x399e4b(0x154)]);console[_0x399e4b(0x140)](_0x399e4b(0x118)+a12_0x22025a[_0x399e4b(0x10c)](_0x233011));}return 0x0;}let _0x27dc35=a12_0x3503c0[_0x399e4b(0x189)](_0x2ba9c2,_0x399e4b(0x138));if(!existsSync(_0x27dc35)){const _0xfcb1e5=findAgentConfigPath(_0x2ba9c2);if(_0xfcb1e5)_0x2ba9c2=a12_0x3503c0['dirname'](_0xfcb1e5),_0x27dc35=_0xfcb1e5,console[_0x399e4b(0x140)](a12_0x22025a['dim'](_0x399e4b(0x13e)+_0x2ba9c2));else{const _0x22b517=_0x2b4984[_0x399e4b(0x110)];if(_0x22b517){const _0x3bec2d=normalizeName(_0x22b517),_0x58cb46=a12_0x3503c0['join'](_0x2ba9c2,_0x399e4b(0x124)),_0x3c1f7d=a12_0x3503c0[_0x399e4b(0x189)](_0x58cb46,_0x3bec2d,'tdx.json');existsSync(_0x3c1f7d)&&(_0x2ba9c2=a12_0x3503c0[_0x399e4b(0x18e)](_0x3c1f7d),_0x27dc35=_0x3c1f7d,console[_0x399e4b(0x140)](a12_0x22025a['dim'](_0x399e4b(0x13e)+_0x2ba9c2)));}if(!existsSync(_0x27dc35)){let _0x451b52=_0x399e4b(0x14b);_0x22b517&&(_0x451b52='Current\x20context\x20has\x20llm_project=\x22'+_0x22b517+_0x399e4b(0x10b)+(_0x399e4b(0x13f)+_0x22b517+'\x27\x20to\x20create\x20the\x20folder\x20structure.'));throw new SDKError(ErrorCode[_0x399e4b(0x145)],_0x399e4b(0x18a)+_0x2ba9c2,undefined,{'helpText':_0x451b52});}}}const {data:_0x3c1efd}=await withSpinner(_0x399e4b(0x19b),()=>_0x59075c[_0x399e4b(0x11f)][_0x399e4b(0x19c)](_0x2ba9c2,{'dryRun':!![]})),_0x58c757=_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x18b)]>0x0;if(_0x58c757){console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x109)));for(const _0x13390d of _0x3c1efd['agents']){_0x13390d[_0x399e4b(0x199)]===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x108)+_0x13390d[_0x399e4b(0x14c)]+'\x22:\x20'+_0x13390d['error']));}return 0x1;}const _0x3ae685=_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x16d)]+_0x3c1efd['counts'][_0x399e4b(0x13a)][_0x399e4b(0x16d)]+_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x121)][_0x399e4b(0x16d)]+_0x3c1efd[_0x399e4b(0x11d)]['prompts'][_0x399e4b(0x16d)],_0x3df9ce=_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x16a)]+_0x3c1efd['counts'][_0x399e4b(0x13a)]['updated']+_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x121)]['updated']+_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x18d)][_0x399e4b(0x16a)],_0x45d176=_0x3c1efd[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x130)]+_0x3c1efd['counts'][_0x399e4b(0x13a)][_0x399e4b(0x130)]+_0x3c1efd[_0x399e4b(0x11d)]['textKnowledgeBases'][_0x399e4b(0x130)]+_0x3c1efd[_0x399e4b(0x11d)]['prompts']['unchanged'];console[_0x399e4b(0x140)](_0x399e4b(0x12b)+_0x3c1efd[_0x399e4b(0x153)]+'\x27:'),console[_0x399e4b(0x140)]('\x20\x20'+a12_0x22025a[_0x399e4b(0x169)]('+\x20'+_0x3ae685+'\x20new')+'\x20|\x20'+a12_0x22025a['yellow']('~\x20'+_0x3df9ce+_0x399e4b(0x107))+'\x20|\x20'+a12_0x22025a[_0x399e4b(0x103)]('=\x20'+_0x45d176+'\x20unchanged')),console[_0x399e4b(0x140)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3c1efd['counts'][_0x399e4b(0x124)])),console[_0x399e4b(0x140)](_0x399e4b(0x15f)+formatCountSummary(_0x3c1efd['counts']['knowledgeBases'])),console[_0x399e4b(0x140)](_0x399e4b(0x143)+formatCountSummary(_0x3c1efd[_0x399e4b(0x11d)]['textKnowledgeBases'])),console[_0x399e4b(0x140)](_0x399e4b(0x137)+formatCountSummary(_0x3c1efd['counts'][_0x399e4b(0x18d)])),console[_0x399e4b(0x140)](_0x399e4b(0x177)+a12_0x22025a[_0x399e4b(0x10c)](_0x2ba9c2)),displayDiffs(_0x3c1efd[_0x399e4b(0x124)],_0x3c1efd[_0x399e4b(0x13a)],_0x3c1efd[_0x399e4b(0x121)],_0x3c1efd[_0x399e4b(0x18d)]);if(_0x53d561)return console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x152)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x3ae685===0x0&&_0x3df9ce===0x0){console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x169)](_0x399e4b(0x119)));const _0x38b202=getLLMProjectUrl(_0x255775,_0x3c1efd[_0x399e4b(0x159)]);return console[_0x399e4b(0x140)](_0x399e4b(0x170)+a12_0x22025a['cyan'](_0x38b202)),0x0;}if(!_0x40a4a5&&!_0x276de7){const _0x30ed5c=await confirmKey(_0x399e4b(0x167)+(_0x3ae685+_0x3df9ce)+_0x399e4b(0x14e));if(!_0x30ed5c)return console['log']('Push\x20cancelled'),0x0;}const {data:_0x1ade2d}=await withSpinner(_0x399e4b(0x117),()=>_0x59075c['llm'][_0x399e4b(0x19c)](_0x2ba9c2,{'force':_0x276de7})),_0x20bb3c=_0x1ade2d[_0x399e4b(0x11d)][_0x399e4b(0x124)][_0x399e4b(0x18b)]>0x0||_0x1ade2d[_0x399e4b(0x11d)][_0x399e4b(0x13a)][_0x399e4b(0x18b)]>0x0||_0x1ade2d[_0x399e4b(0x11d)]['textKnowledgeBases']['errors']>0x0||_0x1ade2d[_0x399e4b(0x11d)][_0x399e4b(0x18d)][_0x399e4b(0x18b)]>0x0;if(_0x20bb3c){console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x152)](_0x399e4b(0x18f))),console[_0x399e4b(0x140)](),console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x156)));for(const _0x1471c9 of _0x1ade2d[_0x399e4b(0x124)]){_0x1471c9['action']===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)]('\x20\x20Agent\x20\x22'+_0x1471c9[_0x399e4b(0x14c)]+'\x22:\x20'+_0x1471c9[_0x399e4b(0x176)]));}for(const _0x675bac of _0x1ade2d[_0x399e4b(0x13a)]){_0x675bac[_0x399e4b(0x199)]===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x16c)+_0x675bac[_0x399e4b(0x101)]+'\x22:\x20'+_0x675bac[_0x399e4b(0x176)]));}for(const _0x3a6ee7 of _0x1ade2d[_0x399e4b(0x121)]){_0x3a6ee7[_0x399e4b(0x199)]===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x125)+_0x3a6ee7['name']+_0x399e4b(0x142)+_0x3a6ee7[_0x399e4b(0x176)]));}for(const _0xa9e0af of _0x1ade2d[_0x399e4b(0x18d)]){_0xa9e0af[_0x399e4b(0x199)]===_0x399e4b(0x176)&&console[_0x399e4b(0x140)](a12_0x22025a[_0x399e4b(0x17a)](_0x399e4b(0x166)+_0xa9e0af[_0x399e4b(0x101)]+'\x22:\x20'+_0xa9e0af[_0x399e4b(0x176)]));}return 0x1;}console[_0x399e4b(0x140)](a12_0x22025a['green']('\x0a✔\x20Pushed\x20'+(_0x3ae685+_0x3df9ce)+_0x399e4b(0x162)+_0x1ade2d[_0x399e4b(0x153)]+'\x27'));const _0x5a5e79=getLLMProjectUrl(_0x255775,_0x1ade2d[_0x399e4b(0x159)]);return console[_0x399e4b(0x140)]('Project:\x20'+a12_0x22025a[_0x399e4b(0x10c)](_0x5a5e79)),0x0;}}
|
|
1
|
+
const a12_0x3d7ff1=a12_0xe260;(function(_0x4766c9,_0x20eff0){const _0x4489e3=a12_0xe260,_0x20f0a=_0x4766c9();while(!![]){try{const _0x2e35e6=-parseInt(_0x4489e3(0x147))/0x1+-parseInt(_0x4489e3(0x1b9))/0x2*(-parseInt(_0x4489e3(0x18c))/0x3)+-parseInt(_0x4489e3(0x174))/0x4+parseInt(_0x4489e3(0x13a))/0x5*(parseInt(_0x4489e3(0x185))/0x6)+-parseInt(_0x4489e3(0x159))/0x7*(parseInt(_0x4489e3(0x193))/0x8)+parseInt(_0x4489e3(0x151))/0x9*(-parseInt(_0x4489e3(0x1af))/0xa)+parseInt(_0x4489e3(0x179))/0xb*(parseInt(_0x4489e3(0x1ab))/0xc);if(_0x2e35e6===_0x20eff0)break;else _0x20f0a['push'](_0x20f0a['shift']());}catch(_0x190866){_0x20f0a['push'](_0x20f0a['shift']());}}}(a12_0x4e94,0x29a84));import a12_0x20c898 from'chalk';import a12_0x362ccb from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath}from'../utils/agent-config.js';function a12_0x4e94(){const _0xf3cb44=['Pulling\x20agent\x20\x22','utf-8','Analyzing\x20changes\x20to\x20push...','\x20\x20Prompt\x20\x22','791724tNUfmk','\x0aChanges\x20to\x20agent\x20\x27','No\x20tdx.json\x20found\x20in\x20','Failed\x20to\x20push\x20agent:\x20','tdx.json','11jpsPbJ','name','Current\x20context\x20has\x20llm_project=\x22','Dry\x20run\x20-\x20no\x20changes\x20made','Pushing\x20to\x20project...','knowledgeBases','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','diff','log','\x20\x20Knowledge\x20Base\x20\x22','\x20files\x20to\x20','\x0aWrite\x20','6QUNdbD','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','yellow','cloneProject','Agent\x20','\x20--profile\x20','Push\x20cancelled','3zhTpVE','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','pushProject','Chat:\x20','total','\x20\x20Text\x20Knowledge\x20Bases:\x20','Source:\x20','1270184JyKRmJ','dryRun','force','repeat','red','\x20total','textKnowledgeBases','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Project\x20cloned\x20with\x20errors','Analyzing\x20project\x20\x22','cyan','gray','\x20\x20Agents:\x20','Errors:','yes','\x20unchanged','agent:pull','pushAgent','\x22:\x20','llm_project','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Source:\x20','6000180IkDHAa','Agent:\x20','prompts','new','30wPcUOP','projectName','created','\x22...','\x0aErrors\x20found:','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','action','dim','push','projectId','196322qIXUQi','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Using\x20local\x20project:\x20','INVALID_ARGUMENT','\x0aPull\x20summary\x20for\x20\x27','Pull\x20cancelled','agent.yml','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Target:\x20','\x0a✔\x20Pulled\x20','llmProject','agentName','\x20new','\x0aPush\x20','cwd','Clone\x20\x22','outputDir','Agent\x20pulled\x20successfully','\x20\x20tdx\x20agent\x20clone\x20agents/','✔\x20Context\x20set:\x20','New\x20project:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','Writing\x20files...','New\x20project\x20ID:\x20','counts','Would\x20clone:','description','Using\x20current\x20project:\x20','newProjectName','Dry\x20run\x20-\x20no\x20files\x20written','428755xRRomr','profile','\x20successfully','\x20|\x20','\x22\x20to\x20new\x20project\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Project\x20cloned\x20successfully','unchanged','error','parse','site','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Would\x20push\x20agent:\x20','142804nwjnQj','Run\x20\x27tdx\x20agent\x20pull\x20','\x20changed','output','execute','Summary:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20context\x20project:\x20','join','session','41373bxszUS','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Project:\x20','newProjectId','agents','dirname','Would\x20pull\x20agent:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','7yiTCMA','Using\x20project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Pushing\x20agent\x20from\x20\x22','\x20errors','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Output\x20path:\x20','outputPath','updated','\x20\x20Prompts:\x20','\x20=\x20','llm','\x20\x20Agent\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','New\x20project\x20name\x20is\x20required','\x20\x20tdx\x20agent\x20pull\x20','errors','agentId','<new-name>','green','pullProject','\x22\x20but\x20no\x20local\x20folder\x20found.\x0a'];a12_0x4e94=function(){return _0xf3cb44;};return a12_0x4e94();}import{saveSessionContext}from'../core/session.js';import{normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../types/endpoints.js';function formatCountSummary(_0x5b14bc){const _0xc9928b=a12_0xe260,_0xc08f2c=[];if(_0x5b14bc[_0xc9928b(0x190)]!==undefined)_0xc08f2c[_0xc9928b(0x1b7)](_0x5b14bc[_0xc9928b(0x190)]+_0xc9928b(0x198));if(_0x5b14bc[_0xc9928b(0x1ae)]!==undefined&&_0x5b14bc['new']>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898[_0xc9928b(0x16d)](_0x5b14bc[_0xc9928b(0x1ae)]+_0xc9928b(0x1c5)));if(_0x5b14bc[_0xc9928b(0x1b1)]!==undefined&&_0x5b14bc[_0xc9928b(0x1b1)]>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898['green'](_0x5b14bc['created']+'\x20created'));if(_0x5b14bc[_0xc9928b(0x162)]!==undefined&&_0x5b14bc[_0xc9928b(0x162)]>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898[_0xc9928b(0x187)](_0x5b14bc[_0xc9928b(0x162)]+'\x20updated'));if(_0x5b14bc[_0xc9928b(0x141)]!==undefined&&_0x5b14bc[_0xc9928b(0x141)]>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898[_0xc9928b(0x19f)](_0x5b14bc['unchanged']+_0xc9928b(0x1a3)));if(_0x5b14bc[_0xc9928b(0x16a)]!==undefined&&_0x5b14bc[_0xc9928b(0x16a)]>0x0)_0xc08f2c[_0xc9928b(0x1b7)](a12_0x20c898[_0xc9928b(0x197)](_0x5b14bc[_0xc9928b(0x16a)]+_0xc9928b(0x15d)));return _0xc08f2c['join'](',\x20');}function a12_0xe260(_0x33f17c,_0x25484f){_0x33f17c=_0x33f17c-0x135;const _0x4e94f3=a12_0x4e94();let _0xe260f5=_0x4e94f3[_0x33f17c];return _0xe260f5;}function displayDiffs(_0x14d1d4,_0xfdb5b7,_0x5e4677,_0x14ce02){const _0x8f87cd=a12_0xe260;for(const _0xbbacd2 of _0x14d1d4){if(_0xbbacd2[_0x8f87cd(0x180)]){const _0x46a8d7=_0xbbacd2[_0x8f87cd(0x1c4)]||_0xbbacd2['name'];console[_0x8f87cd(0x181)](_0x8f87cd(0x175)+_0x46a8d7+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x8f87cd(0x181)](_0xbbacd2['diff']),console[_0x8f87cd(0x181)]('─'[_0x8f87cd(0x196)](0x3c));}}for(const _0x46d065 of _0xfdb5b7){_0x46d065[_0x8f87cd(0x180)]&&(console[_0x8f87cd(0x181)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x46d065[_0x8f87cd(0x17a)]+'\x27:'),console[_0x8f87cd(0x181)]('─'['repeat'](0x3c)),console['log'](_0x46d065['diff']),console[_0x8f87cd(0x181)]('─'[_0x8f87cd(0x196)](0x3c)));}for(const _0x188fa9 of _0x5e4677){_0x188fa9[_0x8f87cd(0x180)]&&(console['log'](_0x8f87cd(0x17f)+_0x188fa9[_0x8f87cd(0x17a)]+'\x27:'),console['log']('─'[_0x8f87cd(0x196)](0x3c)),console[_0x8f87cd(0x181)](_0x188fa9[_0x8f87cd(0x180)]),console['log']('─'[_0x8f87cd(0x196)](0x3c)));}for(const _0x4385fd of _0x14ce02){_0x4385fd[_0x8f87cd(0x180)]&&(console['log'](_0x8f87cd(0x1a8)+_0x4385fd[_0x8f87cd(0x17a)]+'\x27:'),console[_0x8f87cd(0x181)]('─'['repeat'](0x3c)),console[_0x8f87cd(0x181)](_0x4385fd['diff']),console['log']('─'[_0x8f87cd(0x196)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a12_0x3d7ff1(0x17a)]=a12_0x3d7ff1(0x1a4);[a12_0x3d7ff1(0x136)]=a12_0x3d7ff1(0x15e);async[a12_0x3d7ff1(0x14b)](_0x465a9f){const _0x20f1cb=a12_0x3d7ff1,{options:_0x50b464,args:_0x2533ed,tdx:_0x2f8a04}=_0x465a9f,_0x122962=_0x2533ed[0x0],_0x1c0610=_0x2533ed[0x1],_0x20ec60=_0x50b464[_0x20f1cb(0x14a)],_0x2cb99d=_0x50b464['dryRun'],_0xf1f934=_0x50b464[_0x20f1cb(0x195)],_0x58d8c9=_0x50b464[_0x20f1cb(0x1a2)],_0x1ba2de=_0x50b464[_0x20f1cb(0x1c3)];let _0x3ff32c,_0x5f4896;const _0x381f7d=findAgentConfigPath(process[_0x20f1cb(0x1c7)]());if(_0x122962){const _0x367110=a12_0x362ccb[_0x20f1cb(0x14f)](_0x122962,_0x20f1cb(0x178));if(existsSync(_0x367110))try{const _0x357d78=JSON[_0x20f1cb(0x143)](readFileSync(_0x367110,_0x20f1cb(0x171)));_0x3ff32c=_0x357d78['llm_project'],_0x5f4896=_0x122962,console[_0x20f1cb(0x181)](a12_0x20c898[_0x20f1cb(0x1b6)]('Using\x20project\x20from\x20'+_0x367110+':\x20'+_0x3ff32c));}catch{_0x3ff32c=_0x122962;}else _0x3ff32c=_0x122962;}else{if(_0x381f7d)try{const _0x28f9b7=JSON[_0x20f1cb(0x143)](readFileSync(_0x381f7d,_0x20f1cb(0x171)));_0x3ff32c=_0x28f9b7['llm_project'],_0x5f4896=a12_0x362ccb['dirname'](_0x381f7d),console['log'](a12_0x20c898[_0x20f1cb(0x1b6)](_0x20f1cb(0x15a)+_0x3ff32c));}catch{_0x3ff32c=_0x1ba2de;}else _0x3ff32c=_0x1ba2de;}if(!_0x3ff32c)return console['log'](a12_0x20c898[_0x20f1cb(0x187)](_0x20f1cb(0x1b4))),console[_0x20f1cb(0x181)](_0x20f1cb(0x1ce)),console[_0x20f1cb(0x181)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x20f1cb(0x181)](_0x20f1cb(0x167)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x1c0610){const {data:_0x5df16c}=await withSpinner(_0x20f1cb(0x170)+_0x1c0610+'\x22\x20from\x20project\x20\x22'+_0x3ff32c+_0x20f1cb(0x1b2),()=>_0x2f8a04['llm']['pullAgent'](_0x3ff32c,_0x1c0610,_0x20ec60,{'dryRun':_0x2cb99d,'force':_0xf1f934}));if(_0x2cb99d)return console['log'](a12_0x20c898[_0x20f1cb(0x187)](_0x20f1cb(0x139))),console['log'](_0x20f1cb(0x157)+_0x5df16c['agentName']),console[_0x20f1cb(0x181)](_0x20f1cb(0x160)+_0x5df16c['outputPath']),_0x5df16c[_0x20f1cb(0x180)]&&(console[_0x20f1cb(0x181)]('\x0aChanges:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x5df16c[_0x20f1cb(0x180)]),console[_0x20f1cb(0x181)]('─'[_0x20f1cb(0x196)](0x3c))),0x0;return console['log'](a12_0x20c898[_0x20f1cb(0x16d)](_0x20f1cb(0x1ca))),console[_0x20f1cb(0x181)]('Agent:\x20'+_0x5df16c[_0x20f1cb(0x1c4)]),console[_0x20f1cb(0x181)]('Output:\x20'+_0x5df16c[_0x20f1cb(0x161)]),console[_0x20f1cb(0x181)]('Status:\x20'+(_0x5df16c['isNew']?a12_0x20c898[_0x20f1cb(0x16d)](_0x20f1cb(0x1ae)):_0x5df16c['hasChanges']?a12_0x20c898[_0x20f1cb(0x187)](_0x20f1cb(0x162)):a12_0x20c898['gray'](_0x20f1cb(0x141)))),0x0;}const _0x2600a8=_0x5f4896||_0x20ec60,{data:_0x3090da}=await withSpinner(_0x20f1cb(0x19d)+_0x3ff32c+'\x22...',()=>_0x2f8a04[_0x20f1cb(0x165)]['pullProject'](_0x3ff32c,_0x2600a8,{'dryRun':!![]})),_0x32a9df=_0x3090da[_0x20f1cb(0x1d1)]['agents'][_0x20f1cb(0x1ae)]+_0x3090da['counts'][_0x20f1cb(0x17e)][_0x20f1cb(0x1ae)]+_0x3090da['counts']['textKnowledgeBases']['new']+_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x1ad)][_0x20f1cb(0x1ae)],_0x14b2b2=_0x3090da['counts'][_0x20f1cb(0x155)][_0x20f1cb(0x162)]+_0x3090da[_0x20f1cb(0x1d1)]['knowledgeBases'][_0x20f1cb(0x162)]+_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x199)][_0x20f1cb(0x162)]+_0x3090da['counts'][_0x20f1cb(0x1ad)][_0x20f1cb(0x162)],_0x14159b=_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x155)][_0x20f1cb(0x141)]+_0x3090da['counts'][_0x20f1cb(0x17e)][_0x20f1cb(0x141)]+_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x199)][_0x20f1cb(0x141)]+_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x1ad)][_0x20f1cb(0x141)];console[_0x20f1cb(0x181)](_0x20f1cb(0x1bd)+_0x3090da[_0x20f1cb(0x1b0)]+'\x27:'),console[_0x20f1cb(0x181)]('\x20\x20'+a12_0x20c898[_0x20f1cb(0x16d)]('+\x20'+_0x32a9df+_0x20f1cb(0x1c5))+_0x20f1cb(0x13d)+a12_0x20c898['yellow']('~\x20'+_0x14b2b2+_0x20f1cb(0x149))+'\x20|\x20'+a12_0x20c898[_0x20f1cb(0x1b6)]('=\x20'+_0x14159b+_0x20f1cb(0x1a3))),console[_0x20f1cb(0x181)](_0x20f1cb(0x1a0)+formatCountSummary(_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x155)])),console[_0x20f1cb(0x181)](_0x20f1cb(0x1a9)+formatCountSummary(_0x3090da[_0x20f1cb(0x1d1)]['knowledgeBases'])),console[_0x20f1cb(0x181)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3090da[_0x20f1cb(0x1d1)][_0x20f1cb(0x199)])),console[_0x20f1cb(0x181)](_0x20f1cb(0x163)+formatCountSummary(_0x3090da[_0x20f1cb(0x1d1)]['prompts'])),console['log'](_0x20f1cb(0x1c1)+a12_0x20c898[_0x20f1cb(0x19e)](_0x3090da[_0x20f1cb(0x1c9)])),displayDiffs(_0x3090da[_0x20f1cb(0x155)],_0x3090da[_0x20f1cb(0x17e)],_0x3090da[_0x20f1cb(0x199)],_0x3090da[_0x20f1cb(0x1ad)]);if(_0x2cb99d)return console[_0x20f1cb(0x181)](a12_0x20c898[_0x20f1cb(0x187)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x32a9df===0x0&&_0x14b2b2===0x0)return console['log'](a12_0x20c898[_0x20f1cb(0x16d)](_0x20f1cb(0x145))),saveSessionContext({'llm_project':_0x3090da[_0x20f1cb(0x1b0)]},_0x50b464[_0x20f1cb(0x150)]),console[_0x20f1cb(0x181)](a12_0x20c898['green'](_0x20f1cb(0x1cc)+a12_0x20c898[_0x20f1cb(0x1b6)](_0x20f1cb(0x1a7))+_0x20f1cb(0x164)+a12_0x20c898[_0x20f1cb(0x19e)](_0x3090da[_0x20f1cb(0x1b0)]))),0x0;if(!_0x58d8c9&&!_0xf1f934){const _0x2bcf13=await confirmKey(_0x20f1cb(0x184)+(_0x32a9df+_0x14b2b2)+'\x20files?');if(!_0x2bcf13)return console['log'](_0x20f1cb(0x1be)),0x0;}const {data:_0x8b3fb9}=await withSpinner(_0x20f1cb(0x1cf),()=>_0x2f8a04[_0x20f1cb(0x165)][_0x20f1cb(0x16e)](_0x3ff32c,_0x2600a8,{'force':_0xf1f934}));return console[_0x20f1cb(0x181)](a12_0x20c898[_0x20f1cb(0x16d)](_0x20f1cb(0x1c2)+(_0x32a9df+_0x14b2b2)+_0x20f1cb(0x183)+_0x8b3fb9[_0x20f1cb(0x1c9)])),saveSessionContext({'llm_project':_0x8b3fb9[_0x20f1cb(0x1b0)]},_0x50b464['session']),console[_0x20f1cb(0x181)](a12_0x20c898['green'](_0x20f1cb(0x1cc)+a12_0x20c898['dim'](_0x20f1cb(0x1a7))+_0x20f1cb(0x164)+a12_0x20c898['cyan'](_0x8b3fb9[_0x20f1cb(0x1b0)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a12_0x3d7ff1(0x17a)]='agent:clone';[a12_0x3d7ff1(0x136)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a12_0x3d7ff1(0x14b)](_0x9729eb){const _0x54c32a=a12_0x3d7ff1,{options:_0xa20688,args:_0x53125c,tdx:_0x460731}=_0x9729eb,_0x410d0e=_0x53125c[0x0],_0x5d2933=_0xa20688['name'],_0x55dceb=_0xa20688[_0x54c32a(0x194)],_0x428427=_0xa20688[_0x54c32a(0x1a2)],_0x518dfd=_0xa20688[_0x54c32a(0x144)],_0x4bbb9=_0xa20688[_0x54c32a(0x1c3)];let _0x33f0c8;const _0x4d8232=findAgentConfigPath(process['cwd']());if(_0x410d0e){const _0x1a3d18=a12_0x362ccb['join'](_0x410d0e,_0x54c32a(0x178));existsSync(_0x1a3d18)?(_0x33f0c8=_0x410d0e,console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x1b6)](_0x54c32a(0x1bb)+_0x410d0e))):_0x33f0c8=_0x410d0e;}else{if(_0x4d8232)_0x33f0c8=a12_0x362ccb[_0x54c32a(0x156)](_0x4d8232),console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x1b6)](_0x54c32a(0x137)+_0x33f0c8));else{if(_0x4bbb9){const _0x502b74=normalizeName(_0x4bbb9),_0x293645=a12_0x362ccb['join'](process[_0x54c32a(0x1c7)](),'agents',_0x502b74,_0x54c32a(0x178));if(existsSync(_0x293645))_0x33f0c8=a12_0x362ccb[_0x54c32a(0x156)](_0x293645),console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x1b6)]('Using\x20local\x20project:\x20'+_0x33f0c8));else{const _0x1798d2=_0xa20688[_0x54c32a(0x13b)];if(_0x1798d2)throw new SDKError(ErrorCode[_0x54c32a(0x1bc)],_0x54c32a(0x1ba)+_0x4bbb9+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x54c32a(0x18d)+_0x54c32a(0x14d)+(_0x54c32a(0x169)+_0x4bbb9+'\x0a')+(_0x54c32a(0x1cb)+_0x502b74+'\x20--name\x20'+(_0x5d2933||_0x54c32a(0x16c))+_0x54c32a(0x18a)+_0x1798d2)});_0x33f0c8=_0x4bbb9,console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x1b6)](_0x54c32a(0x14e)+_0x4bbb9));}}}}if(!_0x33f0c8)return console[_0x54c32a(0x181)](a12_0x20c898['yellow'](_0x54c32a(0x152))),console[_0x54c32a(0x181)](_0x54c32a(0x1c0)),console[_0x54c32a(0x181)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x54c32a(0x181)](_0x54c32a(0x186)),console[_0x54c32a(0x181)](_0x54c32a(0x19a)),0x1;if(!_0x5d2933)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x54c32a(0x168),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x428427&&!_0x55dceb){const _0x353bd2=await confirmKey(_0x54c32a(0x1c8)+_0x33f0c8+_0x54c32a(0x13e)+_0x5d2933+'\x22?');if(!_0x353bd2)return console[_0x54c32a(0x181)]('Clone\x20cancelled'),0x0;}const {data:_0x3139ff}=await withSpinner('Cloning\x20\x22'+_0x33f0c8+'\x22\x20to\x20\x22'+_0x5d2933+_0x54c32a(0x1b2),()=>_0x460731[_0x54c32a(0x165)][_0x54c32a(0x188)](_0x33f0c8,_0x5d2933,{'dryRun':_0x55dceb}));if(_0x55dceb)return console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x187)](_0x54c32a(0x17c))),console[_0x54c32a(0x181)]('Source:\x20'+_0x3139ff['sourceProjectName']),console['log'](_0x54c32a(0x1cd)+_0x5d2933),console[_0x54c32a(0x181)](_0x54c32a(0x135)),console[_0x54c32a(0x181)](_0x54c32a(0x1a0)+_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x155)][_0x54c32a(0x1b1)]),console[_0x54c32a(0x181)]('\x20\x20Knowledge\x20Bases:\x20'+_0x3139ff['counts'][_0x54c32a(0x17e)][_0x54c32a(0x1b1)]),console[_0x54c32a(0x181)](_0x54c32a(0x163)+_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x1ad)][_0x54c32a(0x1b1)]),0x0;const _0x2c26f8=_0x3139ff[_0x54c32a(0x1d1)]['agents'][_0x54c32a(0x16a)]>0x0||_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x17e)][_0x54c32a(0x16a)]>0x0||_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x1ad)][_0x54c32a(0x16a)]>0x0;_0x2c26f8?console[_0x54c32a(0x181)](a12_0x20c898['yellow'](_0x54c32a(0x19c))):console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x16d)](_0x54c32a(0x140)));console['log'](_0x54c32a(0x192)+_0x3139ff['sourceProjectName']),console['log']('New\x20project:\x20'+_0x3139ff[_0x54c32a(0x138)]),console[_0x54c32a(0x181)](_0x54c32a(0x1d0)+_0x3139ff[_0x54c32a(0x154)]),console['log'](),console[_0x54c32a(0x181)](_0x54c32a(0x14c)),console['log'](_0x54c32a(0x1a0)+formatCountSummary(_0x3139ff['counts']['agents'])),console[_0x54c32a(0x181)](_0x54c32a(0x1a9)+formatCountSummary(_0x3139ff[_0x54c32a(0x1d1)]['knowledgeBases'])),console['log'](_0x54c32a(0x163)+formatCountSummary(_0x3139ff[_0x54c32a(0x1d1)][_0x54c32a(0x1ad)]));if(_0x2c26f8){console[_0x54c32a(0x181)](),console['log'](a12_0x20c898[_0x54c32a(0x197)](_0x54c32a(0x1a1)));for(const _0x1c56bc of _0x3139ff[_0x54c32a(0x155)]){_0x1c56bc[_0x54c32a(0x1b5)]===_0x54c32a(0x142)&&console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x197)](_0x54c32a(0x166)+_0x1c56bc[_0x54c32a(0x1c4)]+_0x54c32a(0x1a6)+_0x1c56bc[_0x54c32a(0x142)]));}for(const _0x1a16ef of _0x3139ff[_0x54c32a(0x17e)]){_0x1a16ef['action']===_0x54c32a(0x142)&&console[_0x54c32a(0x181)](a12_0x20c898[_0x54c32a(0x197)](_0x54c32a(0x182)+_0x1a16ef[_0x54c32a(0x17a)]+'\x22:\x20'+_0x1a16ef[_0x54c32a(0x142)]));}for(const _0x4d7653 of _0x3139ff[_0x54c32a(0x1ad)]){_0x4d7653[_0x54c32a(0x1b5)]===_0x54c32a(0x142)&&console[_0x54c32a(0x181)](a12_0x20c898['red']('\x20\x20Prompt\x20\x22'+_0x4d7653['name']+_0x54c32a(0x1a6)+_0x4d7653['error']));}return 0x1;}saveSessionContext({'llm_project':_0x3139ff[_0x54c32a(0x138)]},_0xa20688[_0x54c32a(0x150)]),console[_0x54c32a(0x181)](),console[_0x54c32a(0x181)](a12_0x20c898['green']('Context\x20set:\x20'+a12_0x20c898['dim']('llm_project')+_0x54c32a(0x164)+a12_0x20c898[_0x54c32a(0x19e)](_0x3139ff[_0x54c32a(0x138)])));const _0x44e87f=getLLMProjectUrl(_0x518dfd,_0x3139ff[_0x54c32a(0x154)]);return console['log'](_0x54c32a(0x153)+a12_0x20c898[_0x54c32a(0x19e)](_0x44e87f)),0x0;}}export class AgentPushCommand extends BaseCommand{[a12_0x3d7ff1(0x17a)]='agent:push';[a12_0x3d7ff1(0x136)]=a12_0x3d7ff1(0x19b);async[a12_0x3d7ff1(0x14b)](_0x5e64c3){const _0x99b0c1=a12_0x3d7ff1,{options:_0x4845a5,args:_0x4c0b8f,tdx:_0xb7be7c}=_0x5e64c3;let _0x3fee15=_0x4c0b8f[0x0]||process[_0x99b0c1(0x1c7)]();const _0x5a2e49=_0x4845a5[_0x99b0c1(0x194)],_0x401cc7=_0x4845a5[_0x99b0c1(0x195)],_0x50bccc=_0x4845a5[_0x99b0c1(0x1a2)],_0xc43ea5=_0x4845a5['site'],_0x55bba6=a12_0x362ccb[_0x99b0c1(0x14f)](_0x3fee15,_0x99b0c1(0x1bf)),_0x515aee=existsSync(_0x55bba6);if(_0x515aee){const {data:_0x33f668}=await withSpinner(_0x99b0c1(0x15c)+_0x3fee15+_0x99b0c1(0x1b2),()=>_0xb7be7c[_0x99b0c1(0x165)][_0x99b0c1(0x1a5)](_0x3fee15,{'dryRun':_0x5a2e49,'force':_0x401cc7}));if(_0x5a2e49)return console['log'](a12_0x20c898[_0x99b0c1(0x187)](_0x99b0c1(0x17c))),console[_0x99b0c1(0x181)](_0x99b0c1(0x146)+_0x33f668[_0x99b0c1(0x1c4)]),0x0;if(_0x33f668[_0x99b0c1(0x1b5)]==='error')return console[_0x99b0c1(0x181)](a12_0x20c898['red'](_0x99b0c1(0x177)+_0x33f668[_0x99b0c1(0x142)])),0x1;console[_0x99b0c1(0x181)](a12_0x20c898['green'](_0x99b0c1(0x189)+_0x33f668['action']+_0x99b0c1(0x13c))),console[_0x99b0c1(0x181)](_0x99b0c1(0x1ac)+_0x33f668[_0x99b0c1(0x1c4)]);if(_0x33f668[_0x99b0c1(0x16b)]&&_0x33f668[_0x99b0c1(0x1b8)]){const _0x22b09c=getLLMAgentChatUrl(_0xc43ea5,_0x33f668[_0x99b0c1(0x1b8)],_0x33f668[_0x99b0c1(0x16b)]);console[_0x99b0c1(0x181)](_0x99b0c1(0x18f)+a12_0x20c898[_0x99b0c1(0x19e)](_0x22b09c));}return 0x0;}let _0x536e25=a12_0x362ccb[_0x99b0c1(0x14f)](_0x3fee15,_0x99b0c1(0x178));if(!existsSync(_0x536e25)){const _0xca1659=findAgentConfigPath(_0x3fee15);if(_0xca1659)_0x3fee15=a12_0x362ccb[_0x99b0c1(0x156)](_0xca1659),_0x536e25=_0xca1659,console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x1b6)]('Using\x20project:\x20'+_0x3fee15));else{const _0x5132c4=_0x4845a5['llmProject'];if(_0x5132c4){const _0x5b3f6d=normalizeName(_0x5132c4),_0x1cf0b1=a12_0x362ccb[_0x99b0c1(0x14f)](_0x3fee15,_0x99b0c1(0x155)),_0x4deb50=a12_0x362ccb[_0x99b0c1(0x14f)](_0x1cf0b1,_0x5b3f6d,_0x99b0c1(0x178));existsSync(_0x4deb50)&&(_0x3fee15=a12_0x362ccb[_0x99b0c1(0x156)](_0x4deb50),_0x536e25=_0x4deb50,console['log'](a12_0x20c898[_0x99b0c1(0x1b6)](_0x99b0c1(0x15a)+_0x3fee15)));}if(!existsSync(_0x536e25)){let _0x7ced2d=_0x99b0c1(0x13f);_0x5132c4&&(_0x7ced2d=_0x99b0c1(0x17b)+_0x5132c4+_0x99b0c1(0x16f)+(_0x99b0c1(0x148)+_0x5132c4+_0x99b0c1(0x15b)));throw new SDKError(ErrorCode[_0x99b0c1(0x1bc)],_0x99b0c1(0x176)+_0x3fee15,undefined,{'helpText':_0x7ced2d});}}}const {data:_0x8a4255}=await withSpinner(_0x99b0c1(0x172),()=>_0xb7be7c[_0x99b0c1(0x165)][_0x99b0c1(0x18e)](_0x3fee15,{'dryRun':!![]})),_0x108f16=_0x8a4255['counts'][_0x99b0c1(0x155)]['errors']>0x0;if(_0x108f16){console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x1b3)));for(const _0x2a97cc of _0x8a4255[_0x99b0c1(0x155)]){_0x2a97cc[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x166)+_0x2a97cc[_0x99b0c1(0x1c4)]+'\x22:\x20'+_0x2a97cc[_0x99b0c1(0x142)]));}return 0x1;}const _0x1b20cf=_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x155)]['created']+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x17e)][_0x99b0c1(0x1b1)]+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x199)][_0x99b0c1(0x1b1)]+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x1ad)][_0x99b0c1(0x1b1)],_0x296b65=_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x155)][_0x99b0c1(0x162)]+_0x8a4255[_0x99b0c1(0x1d1)]['knowledgeBases'][_0x99b0c1(0x162)]+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x199)][_0x99b0c1(0x162)]+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x1ad)][_0x99b0c1(0x162)],_0x47ef83=_0x8a4255['counts'][_0x99b0c1(0x155)]['unchanged']+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x17e)][_0x99b0c1(0x141)]+_0x8a4255['counts']['textKnowledgeBases']['unchanged']+_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x1ad)][_0x99b0c1(0x141)];console[_0x99b0c1(0x181)]('\x0aPush\x20summary\x20for\x20\x27'+_0x8a4255[_0x99b0c1(0x1b0)]+'\x27:'),console['log']('\x20\x20'+a12_0x20c898['green']('+\x20'+_0x1b20cf+_0x99b0c1(0x1c5))+_0x99b0c1(0x13d)+a12_0x20c898[_0x99b0c1(0x187)]('~\x20'+_0x296b65+_0x99b0c1(0x149))+_0x99b0c1(0x13d)+a12_0x20c898[_0x99b0c1(0x1b6)]('=\x20'+_0x47ef83+_0x99b0c1(0x1a3))),console[_0x99b0c1(0x181)](_0x99b0c1(0x1a0)+formatCountSummary(_0x8a4255[_0x99b0c1(0x1d1)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x8a4255[_0x99b0c1(0x1d1)][_0x99b0c1(0x17e)])),console[_0x99b0c1(0x181)](_0x99b0c1(0x191)+formatCountSummary(_0x8a4255[_0x99b0c1(0x1d1)]['textKnowledgeBases'])),console['log'](_0x99b0c1(0x163)+formatCountSummary(_0x8a4255['counts']['prompts'])),console['log'](_0x99b0c1(0x1aa)+a12_0x20c898['cyan'](_0x3fee15)),displayDiffs(_0x8a4255[_0x99b0c1(0x155)],_0x8a4255['knowledgeBases'],_0x8a4255['textKnowledgeBases'],_0x8a4255[_0x99b0c1(0x1ad)]);if(_0x5a2e49)return console['log'](a12_0x20c898[_0x99b0c1(0x187)](_0x99b0c1(0x15f))),0x0;if(_0x1b20cf===0x0&&_0x296b65===0x0){console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x16d)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x5e2f2a=getLLMProjectUrl(_0xc43ea5,_0x8a4255['projectId']);return console['log'](_0x99b0c1(0x153)+a12_0x20c898[_0x99b0c1(0x19e)](_0x5e2f2a)),0x0;}if(!_0x50bccc&&!_0x401cc7){const _0x3c7374=await confirmKey(_0x99b0c1(0x1c6)+(_0x1b20cf+_0x296b65)+'\x20resources?');if(!_0x3c7374)return console[_0x99b0c1(0x181)](_0x99b0c1(0x18b)),0x0;}const {data:_0x1f35ca}=await withSpinner(_0x99b0c1(0x17d),()=>_0xb7be7c['llm'][_0x99b0c1(0x18e)](_0x3fee15,{'force':_0x401cc7})),_0xc6e943=_0x1f35ca[_0x99b0c1(0x1d1)][_0x99b0c1(0x155)][_0x99b0c1(0x16a)]>0x0||_0x1f35ca[_0x99b0c1(0x1d1)]['knowledgeBases'][_0x99b0c1(0x16a)]>0x0||_0x1f35ca['counts']['textKnowledgeBases'][_0x99b0c1(0x16a)]>0x0||_0x1f35ca['counts'][_0x99b0c1(0x1ad)][_0x99b0c1(0x16a)]>0x0;if(_0xc6e943){console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x187)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x1a1)));for(const _0x3f050c of _0x1f35ca[_0x99b0c1(0x155)]){_0x3f050c[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)]('\x20\x20Agent\x20\x22'+_0x3f050c[_0x99b0c1(0x1c4)]+_0x99b0c1(0x1a6)+_0x3f050c['error']));}for(const _0x411d34 of _0x1f35ca[_0x99b0c1(0x17e)]){_0x411d34[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x182)+_0x411d34[_0x99b0c1(0x17a)]+_0x99b0c1(0x1a6)+_0x411d34['error']));}for(const _0x35cd1c of _0x1f35ca[_0x99b0c1(0x199)]){_0x35cd1c[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x158)+_0x35cd1c[_0x99b0c1(0x17a)]+_0x99b0c1(0x1a6)+_0x35cd1c[_0x99b0c1(0x142)]));}for(const _0x3aec37 of _0x1f35ca['prompts']){_0x3aec37[_0x99b0c1(0x1b5)]===_0x99b0c1(0x142)&&console[_0x99b0c1(0x181)](a12_0x20c898[_0x99b0c1(0x197)](_0x99b0c1(0x173)+_0x3aec37[_0x99b0c1(0x17a)]+'\x22:\x20'+_0x3aec37[_0x99b0c1(0x142)]));}return 0x1;}console[_0x99b0c1(0x181)](a12_0x20c898['green']('\x0a✔\x20Pushed\x20'+(_0x1b20cf+_0x296b65)+'\x20resources\x20to\x20\x27'+_0x1f35ca[_0x99b0c1(0x1b0)]+'\x27'));const _0xa566d2=getLLMProjectUrl(_0xc43ea5,_0x1f35ca[_0x99b0c1(0x1b8)]);return console[_0x99b0c1(0x181)](_0x99b0c1(0x153)+a12_0x20c898[_0x99b0c1(0x19e)](_0xa566d2)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a13_0x198657=a13_0x5d13;(function(_0x2e6c3b,_0x11ffff){const _0x13bd50=a13_0x5d13,_0x1612dc=_0x2e6c3b();while(!![]){try{const _0x52c57f=-parseInt(_0x13bd50(0x196))/0x1*(-parseInt(_0x13bd50(0x192))/0x2)+-parseInt(_0x13bd50(0x190))/0x3+-parseInt(_0x13bd50(0x182))/0x4+parseInt(_0x13bd50(0x16c))/0x5+parseInt(_0x13bd50(0x183))/0x6*(parseInt(_0x13bd50(0x17c))/0x7)+parseInt(_0x13bd50(0x165))/0x8+-parseInt(_0x13bd50(0x186))/0x9*(parseInt(_0x13bd50(0x184))/0xa);if(_0x52c57f===_0x11ffff)break;else _0x1612dc['push'](_0x1612dc['shift']());}catch(_0x2db3c8){_0x1612dc['push'](_0x1612dc['shift']());}}}(a13_0x39f2,0x6b5fa));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a13_0x39f2(){const _0x376f8c=['readBodyFromFile','error','14TwBLxw','execute','log','Invalid\x20HTTP\x20method:\x20','api','trim','2389100VQlJSF','2563374ncjIiO','30QvPIiA','data','4007169Istmel','site','x-xsrf-token','POST','x-trino-user','message','output','workflow','method','cookie','158121SksbXo','trino','2OXulCq','authorization','has','name','827557IcryVM','color','set-cookie','file','type','join','\x22.\x20','request','x-auth-token','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Invalid\x20header\x20format:\x20\x22','body','isArray','entries','<\x20HTTP/1.1\x20','verbose','substring','443520fiWeCZ','noColor','startsWith','Error:\x20','.\x20Valid\x20methods:\x20','length','Invalid\x20API\x20type:\x20','3440260vOKDlH','toUpperCase','PUT','description','stack','includes','validate','header','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','keys','proxy-authorization','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','headers','GET'];a13_0x39f2=function(){return _0x376f8c;};return a13_0x39f2();}import{writeFileSync}from'fs';function a13_0x5d13(_0x3989eb,_0x1a2b40){_0x3989eb=_0x3989eb-0x15a;const _0x39f27a=a13_0x39f2();let _0x5d13a1=_0x39f27a[_0x3989eb];return _0x5d13a1;}import{getEndpoint}from'../types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a13_0x198657(0x193),a13_0x198657(0x176),a13_0x198657(0x18f),a13_0x198657(0x198),'set-cookie2',a13_0x198657(0x188),a13_0x198657(0x15c),a13_0x198657(0x18a)]);function isSensitiveHeader(_0x3c5c59){const _0x4f0d59=a13_0x198657;return SENSITIVE_HEADERS[_0x4f0d59(0x194)](_0x3c5c59['toLowerCase']());}function parseHeader(_0x1f98cf){const _0x427300=a13_0x198657,_0x3f9412=_0x1f98cf['indexOf'](':');if(_0x3f9412===-0x1)throw new Error(_0x427300(0x15e)+_0x1f98cf+_0x427300(0x15a)+_0x427300(0x174));const _0x3c3957=_0x1f98cf[_0x427300(0x164)](0x0,_0x3f9412)[_0x427300(0x181)](),_0x5e6110=_0x1f98cf[_0x427300(0x164)](_0x3f9412+0x1)['trim']();if(!_0x3c3957)throw new Error(_0x427300(0x177)+_0x1f98cf+'\x22');return[_0x3c3957,_0x5e6110];}export class ApiCommand extends BaseCommand{[a13_0x198657(0x195)]=a13_0x198657(0x180);[a13_0x198657(0x16f)]=a13_0x198657(0x15d);[a13_0x198657(0x172)](_0x513f69){const _0x329322=a13_0x198657,{args:_0x5addcf,options:_0x28130d}=_0x513f69,_0x14d2cc=_0x28130d;if(_0x5addcf[_0x329322(0x16a)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x5ead13=_0x5addcf[0x0];if(!_0x5ead13[_0x329322(0x167)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x5ead13;const _0x49c826=_0x14d2cc['data'],_0x2986a2=_0x14d2cc[_0x329322(0x199)];if(_0x49c826&&_0x2986a2)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x599e2e=_0x14d2cc[_0x329322(0x18e)]||_0x329322(0x179),_0x162351=['GET',_0x329322(0x189),_0x329322(0x16e),'DELETE','PATCH'];if(!_0x162351[_0x329322(0x171)](_0x599e2e[_0x329322(0x16d)]()))return _0x329322(0x17f)+_0x599e2e+_0x329322(0x169)+_0x162351['join'](',\x20');const _0x3be3bb=_0x14d2cc[_0x329322(0x19a)]||'td',_0x578018=['td','cdp',_0x329322(0x18d),_0x329322(0x191),'llm'];if(!_0x578018[_0x329322(0x171)](_0x3be3bb))return _0x329322(0x16b)+_0x3be3bb+'.\x20Valid\x20types:\x20'+_0x578018[_0x329322(0x19b)](',\x20');return undefined;}async[a13_0x198657(0x17d)](_0x1baeec){const _0xcdf906=a13_0x198657,{options:_0x492db7,args:_0x2b3bb3,tdx:_0x496196}=_0x1baeec,_0x160aee=_0x492db7,_0x34e122=_0x2b3bb3[0x0],_0x2cbb69=(_0x160aee[_0xcdf906(0x18e)]||_0xcdf906(0x179))[_0xcdf906(0x16d)](),_0x1c05f4=_0x160aee[_0xcdf906(0x185)],_0x15e3e0=_0x160aee[_0xcdf906(0x199)],_0x52a03c=_0x160aee[_0xcdf906(0x173)],_0x5670d1=_0x160aee[_0xcdf906(0x19a)]||'td';try{const _0x54ae4c={};if(_0x52a03c){const _0x3fc60d=Array[_0xcdf906(0x160)](_0x52a03c)?_0x52a03c:[_0x52a03c];for(const _0x427474 of _0x3fc60d){const [_0x5e70c7,_0x47297e]=parseHeader(_0x427474);_0x54ae4c[_0x5e70c7]=_0x47297e;}}let _0x3c5e68;if(_0x1c05f4)_0x3c5e68=_0x1c05f4;else{if(_0x15e3e0)try{_0x3c5e68=RawAPI[_0xcdf906(0x17a)](_0x15e3e0);}catch(_0x4cf1a6){return console[_0xcdf906(0x17b)](_0xcdf906(0x168)+(_0x4cf1a6 instanceof Error?_0x4cf1a6[_0xcdf906(0x18b)]:String(_0x4cf1a6))),0x1;}}const _0x43aec5={'method':_0x2cbb69,'apiType':_0x5670d1,'includeHeaders':_0x492db7[_0xcdf906(0x163)]};_0x3c5e68&&(_0x43aec5[_0xcdf906(0x15f)]=_0x3c5e68);Object[_0xcdf906(0x175)](_0x54ae4c)[_0xcdf906(0x16a)]>0x0&&(_0x43aec5[_0xcdf906(0x178)]=_0x54ae4c);if(_0x492db7[_0xcdf906(0x163)]){const _0x434a55=resolveSite(_0x492db7[_0xcdf906(0x187)]),_0x517131=getEndpoint(_0x434a55,_0x5670d1),_0x5da1b2=''+_0x517131+_0x34e122;console[_0xcdf906(0x17b)]('>\x20'+_0x2cbb69+'\x20'+_0x5da1b2);const _0x280d83=getAuthHeaders(_0x434a55),_0x287c90={..._0x280d83,..._0x54ae4c};for(const [_0x63c6d1,_0x23be95]of Object[_0xcdf906(0x161)](_0x287c90)){!isSensitiveHeader(_0x63c6d1)&&console[_0xcdf906(0x17b)]('>\x20'+_0x63c6d1+':\x20'+_0x23be95);}_0x3c5e68&&console[_0xcdf906(0x17b)]('>'),console[_0xcdf906(0x17b)]('');}const _0x37c42d=await _0x496196[_0xcdf906(0x180)][_0xcdf906(0x15b)](_0x34e122,_0x43aec5);if(_0x492db7[_0xcdf906(0x163)]&&_0x37c42d[_0xcdf906(0x178)]){console[_0xcdf906(0x17b)](_0xcdf906(0x162)+_0x37c42d['status']);for(const [_0x5b326f,_0x1cc53a]of Object[_0xcdf906(0x161)](_0x37c42d[_0xcdf906(0x178)])){!isSensitiveHeader(_0x5b326f)&&console[_0xcdf906(0x17b)]('<\x20'+_0x5b326f+':\x20'+_0x1cc53a);}console[_0xcdf906(0x17b)]('');}const _0x418b76=Boolean(_0x492db7[_0xcdf906(0x18c)]),_0x3540f9={'color':_0x492db7[_0xcdf906(0x197)],'noColor':_0x492db7[_0xcdf906(0x166)]||_0x418b76&&!_0x492db7[_0xcdf906(0x197)]},_0x1aa758=colorizeJSON(_0x37c42d[_0xcdf906(0x185)],_0x3540f9);return _0x492db7[_0xcdf906(0x18c)]?(writeFileSync(_0x492db7[_0xcdf906(0x18c)],_0x1aa758),console[_0xcdf906(0x17b)]('Results\x20saved\x20to\x20'+_0x492db7[_0xcdf906(0x18c)])):console[_0xcdf906(0x17e)](_0x1aa758),0x0;}catch(_0x53c7fa){return _0x53c7fa instanceof Error?(console[_0xcdf906(0x17b)](_0xcdf906(0x168)+_0x53c7fa[_0xcdf906(0x18b)]),_0x492db7[_0xcdf906(0x163)]&&_0x53c7fa['stack']&&console[_0xcdf906(0x17b)]('\x0aStack\x20trace:\x0a'+_0x53c7fa[_0xcdf906(0x170)])):console[_0xcdf906(0x17b)]('Error:\x20'+String(_0x53c7fa)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a14_0x4551de=a14_0x126c;(function(_0x59f2e8,_0x1f9bf6){const _0x4aa622=a14_0x126c,_0x143da1=_0x59f2e8();while(!![]){try{const _0x310a43=parseInt(_0x4aa622(0x111))/0x1*(-parseInt(_0x4aa622(0xed))/0x2)+-parseInt(_0x4aa622(0xcc))/0x3*(-parseInt(_0x4aa622(0x107))/0x4)+parseInt(_0x4aa622(0xfc))/0x5+-parseInt(_0x4aa622(0xe9))/0x6+parseInt(_0x4aa622(0x101))/0x7*(-parseInt(_0x4aa622(0x10b))/0x8)+-parseInt(_0x4aa622(0xc4))/0x9*(parseInt(_0x4aa622(0xd1))/0xa)+parseInt(_0x4aa622(0xe7))/0xb*(parseInt(_0x4aa622(0xff))/0xc);if(_0x310a43===_0x1f9bf6)break;else _0x143da1['push'](_0x143da1['shift']());}catch(_0x2c24cb){_0x143da1['push'](_0x143da1['shift']());}}}(a14_0x55e5,0x5c8d8));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../types/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import a14_0x44d144 from'prompts';import{HTTPClientError}from'../client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a14_0x318fe2 from'chalk';export class AuthSetupCommand extends BaseCommand{[a14_0x4551de(0xdb)]='auth:setup';[a14_0x4551de(0x114)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a14_0x4551de(0xf7)](_0x226e1f){const _0x3d7837=a14_0x4551de,{options:_0x5abc9c}=_0x226e1f,_0x171f66=_0x5abc9c[_0x3d7837(0xec)];console[_0x3d7837(0xf1)](a14_0x318fe2[_0x3d7837(0xe2)]('tdx:\x20auth\x20setup'));const _0x11c1bb=_0x5abc9c[_0x3d7837(0xfd)]||_0x3d7837(0xc9),_0x3ed863=[{'title':'us\x20\x20\x20-\x20United\x20States','value':_0x3d7837(0xc9)},{'title':_0x3d7837(0x10a),'value':_0x3d7837(0xf9)},{'title':_0x3d7837(0xcb),'value':_0x3d7837(0xf8)},{'title':_0x3d7837(0xda),'value':_0x3d7837(0x106)}];let _0x7dd0b6=_0x3ed863[_0x3d7837(0xd6)](_0x5ce2f3=>_0x5ce2f3[_0x3d7837(0x113)]===_0x11c1bb);_0x7dd0b6===-0x1&&_0x11c1bb!==_0x3d7837(0xc9)&&(_0x3ed863[_0x3d7837(0xd2)]({'title':_0x11c1bb,'value':_0x11c1bb}),_0x7dd0b6=_0x3ed863[_0x3d7837(0xd3)]-0x1);_0x3ed863[_0x3d7837(0xd2)]({'title':'Enter\x20custom\x20site','value':_0x3d7837(0xc7)});const _0x273b42=_0x171f66?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x171f66+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x2e315f=await a14_0x44d144({'type':_0x3d7837(0xf6),'name':'site','message':_0x273b42,'choices':_0x3ed863,'initial':_0x7dd0b6>=0x0?_0x7dd0b6:0x0});if(!_0x2e315f['site'])return console[_0x3d7837(0xf1)]('\x0aSetup\x20cancelled'),0x1;let _0x320061;if(_0x2e315f[_0x3d7837(0xfd)]===_0x3d7837(0xc7)){const _0x19f12e=await a14_0x44d144({'type':_0x3d7837(0xe4),'name':_0x3d7837(0x10d),'message':_0x3d7837(0xc3),'initial':'us01','validate':_0x50b140=>{const _0x400362=_0x3d7837;if(!_0x50b140||!_0x50b140[_0x400362(0xfb)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x400362(0xe3)](_0x50b140['trim']()))return _0x400362(0xd5);return!![];}});if(!_0x19f12e[_0x3d7837(0x10d)])return console['log'](_0x3d7837(0xd0)),0x1;_0x320061=_0x19f12e['customSite'];}else _0x320061=_0x2e315f[_0x3d7837(0xfd)];const _0x5c911d=resolveSite(_0x320061);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x5c911d),console['log'](_0x3d7837(0xdf)),console[_0x3d7837(0xf1)]('\x20\x20'+getConsoleUrl(_0x5c911d,_0x3d7837(0xd9)));const _0x4f2354=await a14_0x44d144({'type':_0x3d7837(0xd7),'name':'apiKey','message':_0x3d7837(0xee),'validate':_0x22018a=>{const _0x33c141=_0x3d7837;if(!_0x22018a||!_0x22018a['trim']())return _0x33c141(0xf4);return!![];}});if(!_0x4f2354['apiKey'])return console[_0x3d7837(0xf1)](_0x3d7837(0xd0)),0x1;const _0x198db3=_0x4f2354[_0x3d7837(0xeb)];console[_0x3d7837(0xf1)]('Validating\x20API\x20key...');try{const _0x5a3ced=TDX['create']({'site':_0x5c911d,'apiKey':_0x198db3[_0x3d7837(0xfb)](),'logLevel':_0x5abc9c[_0x3d7837(0xc8)]??LogLevel[_0x3d7837(0x103)]}),_0x258841=await _0x5a3ced[_0x3d7837(0xce)][_0x3d7837(0xe6)]();console['log'](_0x3d7837(0xdd)+_0x258841[_0x3d7837(0x112)]+')');const _0x287b55=await isKeychainAvailable();_0x287b55?(await saveAPIKeyAsync(_0x198db3[_0x3d7837(0xfb)](),_0x5c911d,_0x171f66),console[_0x3d7837(0xf1)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x171f66?_0x3d7837(0xc5)+_0x171f66+')':''))):(console['warn'](a14_0x318fe2[_0x3d7837(0xf3)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x3d7837(0x105)](a14_0x318fe2[_0x3d7837(0xf3)](_0x3d7837(0x10c))));if(_0x171f66){const _0x455edb={'site':_0x5c911d};saveProfileToUserConfig(_0x171f66,_0x455edb),console[_0x3d7837(0xf1)](_0x3d7837(0xe8)+_0x171f66+_0x3d7837(0xc6));}const _0x5336bb=_0x171f66?_0x3d7837(0xfe)+_0x171f66:'';return console[_0x3d7837(0xf1)](),console['log'](_0x3d7837(0x102)),console[_0x3d7837(0xf1)]('\x20\x20tdx'+_0x5336bb+_0x3d7837(0xcd)),console[_0x3d7837(0xf1)](_0x3d7837(0xca)+_0x5336bb+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x48953c){if(_0x48953c instanceof HTTPClientError&&_0x48953c[_0x3d7837(0xfa)]===0x191)return printAuthError(_0x48953c),0x1;return console['error'](a14_0x318fe2[_0x3d7837(0x10e)](_0x3d7837(0xe1)+(_0x48953c instanceof Error?_0x48953c[_0x3d7837(0x100)]:String(_0x48953c)))),console[_0x3d7837(0xc0)](_0x3d7837(0xe5)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a14_0x4551de(0xdb)]=a14_0x4551de(0xe0);['description']=a14_0x4551de(0xc1);async[a14_0x4551de(0xf7)](_0x1eeb0c){const _0x5ad1d7=a14_0x4551de,{options:_0x18481a,tdx:_0x43df7c}=_0x1eeb0c,_0x554e91=_0x18481a['site'],_0x5dbaa0=_0x18481a[_0x5ad1d7(0xec)],_0x245c57=_0x5dbaa0?_0x5dbaa0:_0x5ad1d7(0xf5);console['log'](_0x5ad1d7(0xef)+_0x245c57+_0x5ad1d7(0xde)+_0x554e91+')');const _0x3a4161=await resolveAPIKeyAsync(_0x554e91,_0x5dbaa0);if(_0x3a4161){const {source:_0x20f506,isDeprecated:_0x2f7ebc}=_0x3a4161,_0x4d8d71=_0x5ad1d7(0xd8)+_0x20f506;console['log'](_0x2f7ebc?a14_0x318fe2['yellow'](_0x4d8d71):_0x4d8d71);}else console[_0x5ad1d7(0xf1)](a14_0x318fe2[_0x5ad1d7(0xf3)](_0x5ad1d7(0xdc)));try{const _0x1be1b6=await _0x43df7c[_0x5ad1d7(0xce)][_0x5ad1d7(0xe6)]();return console[_0x5ad1d7(0xf1)](a14_0x318fe2['green'](_0x5ad1d7(0xc2))),console[_0x5ad1d7(0xf1)](_0x5ad1d7(0x109)+_0x1be1b6[_0x5ad1d7(0x112)]),(_0x1be1b6[_0x5ad1d7(0x108)]||_0x1be1b6[_0x5ad1d7(0xf2)])&&console['log'](_0x5ad1d7(0xcf)+[_0x1be1b6[_0x5ad1d7(0x108)],_0x1be1b6[_0x5ad1d7(0xf2)]][_0x5ad1d7(0x110)](Boolean)['join']('\x20')),0x0;}catch(_0x105765){return _0x105765 instanceof HTTPClientError&&_0x105765['status']===0x191?printAuthError(_0x105765,!![],_0x5dbaa0):console[_0x5ad1d7(0xc0)](a14_0x318fe2[_0x5ad1d7(0x10e)](_0x5ad1d7(0xe1)+(_0x105765 instanceof Error?_0x105765[_0x5ad1d7(0x100)]:String(_0x105765)))),0x1;}}}function a14_0x55e5(){const _0x383f92=['jp\x20\x20\x20-\x20Japan','2424jDpGhM','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','customSite','red','tdx:\x20auth\x20clear','filter','69653MgUGKj','email','value','description','✓\x20API\x20key\x20removed\x20from\x20keychain','error','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20Authentication\x20successful\x0a','Enter\x20site\x20name:','90kggJzq','\x20(profile:\x20','\x27\x20registered','other','logLevel','us01','\x20\x20tdx','eu\x20\x20\x20-\x20Europe','972meMWXK','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','jobs','Name:\x20','\x0aSetup\x20cancelled','226910QmSDdJ','push','length','No\x20API\x20key\x20found\x20in\x20keychain','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','findIndex','password','Read\x20credential\x20from\x20','/app/mp/ak','ap02\x20-\x20Korea','name','No\x20credential\x20found','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20(site:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','auth','✗\x20Validation\x20failed:\x20','bold','test','text','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','getUserInfo','19095571WTwYNH','✓\x20Profile\x20\x27','857814rKYvaX','auth:clear','apiKey','profile','20eOJGTR','Enter\x20your\x20TD\x20API\x20key:','tdx\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','log','last_name','yellow','API\x20key\x20cannot\x20be\x20empty','N/A','select','execute','eu01','jp01','status','trim','837455bAcNEd','site','\x20--profile\x20','12iTxcOw','message','15939gyvIOA','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','ERROR','\x20for\x20profile:\x20','warn','ap02','2864aMcknE','first_name','User:\x20'];a14_0x55e5=function(){return _0x383f92;};return a14_0x55e5();}function a14_0x126c(_0x175580,_0x5b942f){_0x175580=_0x175580-0xc0;const _0x55e502=a14_0x55e5();let _0x126ca8=_0x55e502[_0x175580];return _0x126ca8;}export class AuthClearCommand extends BaseCommand{[a14_0x4551de(0xdb)]=a14_0x4551de(0xea);['description']=a14_0x4551de(0xf0);async['execute'](_0x75c616){const _0x3a9d36=a14_0x4551de,{options:_0x317332}=_0x75c616,_0x404108=_0x317332[_0x3a9d36(0xec)];console['log'](a14_0x318fe2[_0x3a9d36(0xe2)](_0x3a9d36(0x10f)));const _0x24c9bb=await isKeychainAvailable();if(!_0x24c9bb)return console[_0x3a9d36(0xc0)](a14_0x318fe2[_0x3a9d36(0x10e)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x4c9815=await deleteKeychainAPIKey(_0x404108);return _0x4c9815?(clearCredentialCache(),console[_0x3a9d36(0xf1)](_0x3a9d36(0x115)+(_0x404108?_0x3a9d36(0xc5)+_0x404108+')':'')),0x0):(console['log'](_0x3a9d36(0xd4)+(_0x404108?_0x3a9d36(0x104)+_0x404108:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x221c1a=a15_0x2e16;(function(_0x4d3974,_0x18d758){const _0x54aaea=a15_0x2e16,_0x4dc3e2=_0x4d3974();while(!![]){try{const _0x2aff39=-parseInt(_0x54aaea(0x194))/0x1+-parseInt(_0x54aaea(0x189))/0x2+parseInt(_0x54aaea(0x1b3))/0x3*(parseInt(_0x54aaea(0x19b))/0x4)+parseInt(_0x54aaea(0x1a3))/0x5+parseInt(_0x54aaea(0x19e))/0x6*(-parseInt(_0x54aaea(0x1b1))/0x7)+-parseInt(_0x54aaea(0x1a9))/0x8*(-parseInt(_0x54aaea(0x190))/0x9)+-parseInt(_0x54aaea(0x1b2))/0xa*(parseInt(_0x54aaea(0x185))/0xb);if(_0x2aff39===_0x18d758)break;else _0x4dc3e2['push'](_0x4dc3e2['shift']());}catch(_0x3c7419){_0x4dc3e2['push'](_0x4dc3e2['shift']());}}}(a15_0x52c0,0xa2568));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a15_0x52c0(){const _0x1439e3=['stdout','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','verbose','\x20\x20Cause:\x20','data','9uYADjr','getDefaultAgent','chat','join','931872CuCdrB','claude-4.5-haiku','validate','chatId','name','resolveAgentId','Resolving\x20agent\x20\x27','76UUXfgW','log','write','24AuUZTW','agent','CHAT_NOT_FOUND','metadata','content','5681560KFhKYe','code','handleChatEvent','streamChat','Getting\x20default\x20agent...','resolveProjectId','9148648zUdUqB','llmProject','getOrCreateDefaultAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','404','Resolving\x20project\x20\x27','type','Using\x20agent\x20from\x20','444969qIeUUM','140ByQCYB','44283NFWzcp','description','Error:\x20','llm','new','Chat\x20session:\x20','cause','getAgentId','338294phxrDy','message','error','session\x20context','557440XoLXbc'];a15_0x52c0=function(){return _0x1439e3;};return a15_0x52c0();}import{parseAgentRef}from'../utils/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../utils/chat-cache.js';function a15_0x2e16(_0x5be0ee,_0x56b5ac){_0x5be0ee=_0x5be0ee-0x183;const _0x52c042=a15_0x52c0();let _0x2e165b=_0x52c042[_0x5be0ee];return _0x2e165b;}function handleSDKError(_0x2856ad,_0x4c7401){const _0x3f04a7=a15_0x2e16;if(_0x2856ad instanceof SDKError)console[_0x3f04a7(0x187)](_0x3f04a7(0x1b5)+_0x2856ad[_0x3f04a7(0x186)]),_0x4c7401['verbose']&&(_0x2856ad['cause']&&console['error'](_0x3f04a7(0x18e)+_0x2856ad[_0x3f04a7(0x183)]),_0x2856ad['stack']&&(console[_0x3f04a7(0x187)]('\x0aStack\x20trace:'),console['error'](_0x2856ad['stack'])));else throw _0x2856ad;}export class ChatCommand extends BaseCommand{['name']='chat';[a15_0x221c1a(0x1b4)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a15_0x221c1a(0x196)](_0x89f042){const _0x2f4d70=a15_0x221c1a,_0x3c9a83=_0x89f042['args'][_0x2f4d70(0x193)]('\x20');if(!_0x3c9a83)return _0x2f4d70(0x18c);return undefined;}async['streamChat'](_0x70105e,_0x26e77c,_0x2aea95,_0xeb1a79,_0x64e405){const _0x50e641=a15_0x221c1a;for await(const _0xcec20a of _0x70105e[_0x50e641(0x1b6)][_0x50e641(0x192)](_0x26e77c,{'agentId':_0x2aea95,'chatId':_0xeb1a79})){if(_0xcec20a['type']===_0x50e641(0x1a1)){const _0x1a1bd5=_0xcec20a[_0x50e641(0x18f)][_0x50e641(0x197)];saveLastChatId(_0x1a1bd5),_0x64e405&&console[_0x50e641(0x187)](_0x50e641(0x1b8)+_0x1a1bd5);}else _0xcec20a[_0x50e641(0x1af)]==='event'&&this[_0x50e641(0x1a5)](_0xcec20a[_0x50e641(0x18f)]);}}async[a15_0x221c1a(0x184)](_0x53f42c,_0x2c67f4,_0x129e10,_0x425473,_0x5b7b5e){const _0x2a727a=a15_0x221c1a,_0x4239f0=_0x2c67f4||_0x129e10;if(_0x4239f0){const {projectName:_0x58adea,agentName:_0x444e08}=parseAgentRef(_0x4239f0),_0x297de7=_0x444e08||_0x4239f0,_0x1c38d8=_0x444e08?_0x58adea:_0x425473;if(!_0x1c38d8)throw new Error(_0x2a727a(0x18b));if(_0x5b7b5e){const _0x577018=_0x2c67f4?'--agent\x20flag':_0x2a727a(0x188);console['error'](_0x2a727a(0x1b0)+_0x577018+':\x20'+_0x1c38d8+'/'+_0x297de7);}const _0x4c440a=await withSpinner(_0x2a727a(0x1ae)+_0x1c38d8+'\x27...',()=>_0x53f42c[_0x2a727a(0x1b6)][_0x2a727a(0x1a8)](_0x1c38d8),{'verbose':_0x5b7b5e}),_0x16a4a2=await withSpinner(_0x2a727a(0x19a)+_0x297de7+'\x27...',()=>_0x53f42c[_0x2a727a(0x1b6)][_0x2a727a(0x199)](_0x297de7,_0x4c440a['data']),{'verbose':_0x5b7b5e});return _0x16a4a2['data'];}else{const _0x5c7dc1=_0x53f42c[_0x2a727a(0x1b6)][_0x2a727a(0x191)]();if(_0x5c7dc1)return _0x5b7b5e&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0x5c7dc1[_0x2a727a(0x198)]),_0x5c7dc1['id'];const _0x5e5c78=await withSpinner(_0x2a727a(0x1a7),()=>_0x53f42c[_0x2a727a(0x1b6)][_0x2a727a(0x1ab)](_0x2a727a(0x195),0x0),{'verbose':_0x5b7b5e});return _0x5e5c78[_0x2a727a(0x18f)]['id'];}}async['execute'](_0x26947e){const _0xd99783=a15_0x221c1a,{options:_0x3a8a37,args:_0x172b68,tdx:_0x25945d}=_0x26947e,_0x149d04=_0x172b68['join']('\x20'),_0x1e1b73=_0x3a8a37,_0x45b58e=_0x1e1b73[_0xd99783(0x19f)],_0x1abe93=_0x1e1b73['llmAgent'],_0x4e9dc8=_0x1e1b73[_0xd99783(0x1aa)],_0x550c10=_0x1e1b73[_0xd99783(0x1b7)];try{let _0x2f3972,_0x3e1ba0;!_0x550c10&&(_0x3e1ba0=loadLastChatId(),_0x3e1ba0&&_0x3a8a37[_0xd99783(0x18d)]&&console[_0xd99783(0x187)]('Continuing\x20chat:\x20'+_0x3e1ba0));(_0x550c10||!_0x3e1ba0)&&(_0x2f3972=await this[_0xd99783(0x184)](_0x25945d,_0x45b58e,_0x1abe93,_0x4e9dc8,_0x3a8a37[_0xd99783(0x18d)]));try{await this[_0xd99783(0x1a6)](_0x25945d,_0x149d04,_0x2f3972,_0x3e1ba0,_0x3a8a37[_0xd99783(0x18d)]);}catch(_0x5beb74){const _0x2e588c=_0x5beb74 instanceof SDKError&&_0x5beb74[_0xd99783(0x1a4)]===ErrorCode[_0xd99783(0x1a0)]||_0x5beb74 instanceof Error&&_0x5beb74[_0xd99783(0x186)]['includes'](_0xd99783(0x1ad));if(_0x2e588c)_0x3a8a37[_0xd99783(0x18d)]&&console[_0xd99783(0x187)](_0xd99783(0x1ac)),!_0x2f3972&&(_0x2f3972=await this[_0xd99783(0x184)](_0x25945d,_0x45b58e,_0x1abe93,_0x4e9dc8,_0x3a8a37['verbose'])),await this[_0xd99783(0x1a6)](_0x25945d,_0x149d04,_0x2f3972,undefined,_0x3a8a37[_0xd99783(0x18d)]);else throw _0x5beb74;}return console[_0xd99783(0x19c)](),0x0;}catch(_0x25b57f){return console['error'](),handleSDKError(_0x25b57f,_0x3a8a37),0x1;}}[a15_0x221c1a(0x1a5)](_0x25fef9){const _0x8233cc=a15_0x221c1a;if(_0x8233cc(0x1a2)in _0x25fef9)process[_0x8233cc(0x18a)][_0x8233cc(0x19d)](_0x25fef9[_0x8233cc(0x1a2)]);else _0x8233cc(0x187)in _0x25fef9&&console[_0x8233cc(0x187)]('\x0aError:\x20'+_0x25fef9[_0x8233cc(0x187)]);}}
|