@treasuredata/tdx 0.1.17 → 0.1.19
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/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.d.ts +2 -2
- package/dist/client/llm-client.d.ts.map +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/chat-command.js.map +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.d.ts.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +1 -1
- package/dist/commands/llm-proxy.d.ts.map +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/llm-proxy.js.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.d.ts +3 -3
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/anthropic-adapter.js.map +1 -1
- package/dist/proxy/server.d.ts +5 -3
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.d.ts +14 -0
- 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.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +41 -21
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.d.ts +4 -0
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/colors.js.map +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.d.ts +15 -0
- package/dist/utils/model-aliases.d.ts.map +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-aliases.js.map +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.d.ts +2 -2
- package/dist/utils/sse-parser.d.ts.map +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/sse-parser.js.map +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.d.ts +28 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +1 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +3 -1
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x4dc40f=a30_0x4bd0;(function(_0x4c78c6,_0x1b6fdd){const _0xc9c537=a30_0x4bd0,_0x3c26e6=_0x4c78c6();while(!![]){try{const _0x1b4d84=parseInt(_0xc9c537(0xd0))/0x1+-parseInt(_0xc9c537(0xf8))/0x2+parseInt(_0xc9c537(0xe8))/0x3+parseInt(_0xc9c537(0xd5))/0x4+-parseInt(_0xc9c537(0xf3))/0x5*(parseInt(_0xc9c537(0xd4))/0x6)+parseInt(_0xc9c537(0xde))/0x7*(-parseInt(_0xc9c537(0xe1))/0x8)+-parseInt(_0xc9c537(0xeb))/0x9*(-parseInt(_0xc9c537(0xdb))/0xa);if(_0x1b4d84===_0x1b6fdd)break;else _0x3c26e6['push'](_0x3c26e6['shift']());}catch(_0x2591ab){_0x3c26e6['push'](_0x3c26e6['shift']());}}}(a30_0x1a19,0x18c3f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a30_0x4bd0(_0x26d03c,_0x326752){const _0x1a1906=a30_0x1a19();return a30_0x4bd0=function(_0x4bd08c,_0x14f2dc){_0x4bd08c=_0x4bd08c-0xd0;let _0x40b0e0=_0x1a1906[_0x4bd08c];return _0x40b0e0;},a30_0x4bd0(_0x26d03c,_0x326752);}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a30_0x1a19(){const _0x5a6954=['.*\x22','description','data','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Database\x20\x27','406615NMIUMK','length','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','✔\x20Found\x20','table','43304jYoJCw','Site:\x20','Note:\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Error:\x20Pattern\x20\x27','verbose','execute','107822jXpUFu','validate','✖\x20No\x20tables\x20found','cause','12qvhZZf','435792xDiKjP','message','includes','error','Database\x20pattern:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','30lSAGGM','list','Error:\x20','70QwVWZG','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','33656wkWPSy','database','Table\x20pattern:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','List\x20tables\x20in\x20a\x20database','Or\x20use\x20--in\x20flag:','Listing\x20tables...','46164EsMVJj','tables','\x20\x20Cause:\x20','286947NOwInO','site','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'];a30_0x1a19=function(){return _0x5a6954;};return a30_0x1a19();}export class TablesCommand extends BaseCommand{['name']=a30_0x4dc40f(0xe9);[a30_0x4dc40f(0xef)]=a30_0x4dc40f(0xe5);async[a30_0x4dc40f(0xfe)](_0x16f2dd){const _0x1c4781=a30_0x4dc40f,{options:_0x3ab05a,args:_0x49e677,tdx:_0x3b496d}=_0x16f2dd;let _0x56ab4b;if(_0x49e677[_0x1c4781(0xf4)]===0x0)_0x56ab4b={'database':undefined,'table':undefined,'original':''};else{if(_0x49e677[_0x1c4781(0xf4)]===0x1)try{_0x56ab4b=parseTableReference(_0x49e677[0x0]);if(_0x56ab4b[_0x1c4781(0xf7)]&&!_0x56ab4b[_0x1c4781(0xe2)]&&!_0x56ab4b[_0x1c4781(0xf7)][_0x1c4781(0xd7)]('*')&&!_0x56ab4b[_0x1c4781(0xf7)][_0x1c4781(0xd7)]('?'))return console['error'](_0x1c4781(0xfc)+_0x49e677[0x0]+'\x27\x20is\x20ambiguous.'),console['error']('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x56ab4b[_0x1c4781(0xf7)]+'\x27?'),console['error']('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x56ab4b[_0x1c4781(0xf7)]+_0x1c4781(0xee)),console[_0x1c4781(0xd8)](_0x1c4781(0xfb)+_0x56ab4b[_0x1c4781(0xf7)]),console['error'](_0x1c4781(0xe0)+_0x56ab4b[_0x1c4781(0xf7)]),console[_0x1c4781(0xd8)](''),console[_0x1c4781(0xd8)](_0x1c4781(0xfa)+_0x49e677[0x0]+_0x1c4781(0xe4)+_0x56ab4b[_0x1c4781(0xf7)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x52226f){return console[_0x1c4781(0xd8)](_0x1c4781(0xdd)+_0x52226f[_0x1c4781(0xd6)]),0x1;}else return console[_0x1c4781(0xd8)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x1c4781(0xd8)](_0x1c4781(0xf5)),console[_0x1c4781(0xd8)](_0x1c4781(0xdf)),console[_0x1c4781(0xd8)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x1c4781(0xda)),console[_0x1c4781(0xd8)](_0x1c4781(0xe6)),console[_0x1c4781(0xd8)](_0x1c4781(0xed)),0x1;}const _0x124d83=_0x3ab05a[_0x1c4781(0xe2)];!_0x56ab4b[_0x1c4781(0xe2)]&&_0x124d83&&(_0x56ab4b[_0x1c4781(0xe2)]=_0x124d83);try{const _0xf64a06=_0x1e396c=>_0x1e396c&&(_0x1e396c[_0x1c4781(0xd7)]('*')||_0x1e396c[_0x1c4781(0xd7)]('?')),_0x346813=_0xf64a06(_0x56ab4b[_0x1c4781(0xe2)]);_0x3ab05a[_0x1c4781(0xfd)]&&(console[_0x1c4781(0xd8)](_0x1c4781(0xf9)+_0x3ab05a[_0x1c4781(0xec)]),_0x56ab4b[_0x1c4781(0xe2)]?_0x346813?console[_0x1c4781(0xd8)](_0x1c4781(0xd9)+_0x56ab4b['database']):console[_0x1c4781(0xd8)]('Database:\x20'+_0x56ab4b['database']):console[_0x1c4781(0xd8)]('Database:\x20all'),_0x56ab4b[_0x1c4781(0xf7)]&&console['error'](_0x1c4781(0xe3)+_0x56ab4b['table']));const _0x433f45=_0x56ab4b[_0x1c4781(0xe2)]&&!_0x346813?_0x56ab4b[_0x1c4781(0xe2)]:undefined,_0x400562=_0x346813?_0x56ab4b['database']:undefined,_0x1241c5=_0x56ab4b['table'],_0x59005b=await withSpinner(_0x1c4781(0xe7),()=>_0x3b496d[_0x1c4781(0xf7)][_0x1c4781(0xdc)](_0x433f45,_0x1241c5,_0x400562),{'verbose':_0x3ab05a[_0x1c4781(0xfd)]}),_0x287dce=_0x59005b[_0x1c4781(0xf0)];if(_0x287dce['length']===0x0&&_0x56ab4b[_0x1c4781(0xe2)]&&!_0x346813)return console['error'](_0x1c4781(0xd2)),console['error'](_0x1c4781(0xf2)+_0x56ab4b[_0x1c4781(0xe2)]+_0x1c4781(0xf1)),0x1;return console[_0x1c4781(0xd8)](_0x1c4781(0xf6)+_0x287dce[_0x1c4781(0xf4)]+'\x20table'+(_0x287dce['length']!==0x1?'s':'')),await handleSDKOutput(_0x287dce,_0x3ab05a),0x0;}catch(_0x52e4b7){if(_0x52e4b7 instanceof SDKError)return console[_0x1c4781(0xd8)](_0x1c4781(0xdd)+_0x52e4b7[_0x1c4781(0xd6)]),_0x52e4b7[_0x1c4781(0xd3)]&&console[_0x1c4781(0xd8)](_0x1c4781(0xea)+_0x52e4b7['cause']),0x1;throw _0x52e4b7;}}[a30_0x4dc40f(0xd1)](_0x1b96de){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a31_0x586624=a31_0x3239;(function(_0x3d7d4c,_0x2dc0af){const _0x51a0a8=a31_0x3239,_0x316559=_0x3d7d4c();while(!![]){try{const _0x49bdfa=parseInt(_0x51a0a8(0x17e))/0x1*(-parseInt(_0x51a0a8(0x16e))/0x2)+parseInt(_0x51a0a8(0x171))/0x3*(-parseInt(_0x51a0a8(0x17f))/0x4)+-parseInt(_0x51a0a8(0x184))/0x5*(parseInt(_0x51a0a8(0x186))/0x6)+parseInt(_0x51a0a8(0x192))/0x7*(-parseInt(_0x51a0a8(0x18f))/0x8)+-parseInt(_0x51a0a8(0x18b))/0x9+-parseInt(_0x51a0a8(0x16c))/0xa+-parseInt(_0x51a0a8(0x16d))/0xb*(-parseInt(_0x51a0a8(0x172))/0xc);if(_0x49bdfa===_0x2dc0af)break;else _0x316559['push'](_0x316559['shift']());}catch(_0x96ffbc){_0x316559['push'](_0x316559['shift']());}}}(a31_0x2123,0xf1d8f));function a31_0x3239(_0x2e802f,_0x1c124b){const _0x2123a8=a31_0x2123();return a31_0x3239=function(_0x323953,_0x205988){_0x323953=_0x323953-0x16b;let _0x4fd856=_0x2123a8[_0x323953];return _0x4fd856;},a31_0x3239(_0x2e802f,_0x1c124b);}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';function a31_0x2123(){const _0x10e509=['description','name','Session\x20parent_segment\x20set\x20to:\x20','Set\x20session-level\x20context','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','1RfkGZo','16kGYPoE','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','log','\x20(session:\x20','toString','5kcOBTa','validate','9962898XZPEtf','error','Error:\x20','execute','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','15939891jbndKl','llm_project','database','parent_segment','24MNDIoA','Invalid\x20resource:\x20','session','407967KEWzIu','join','message','6612730NPmzzG','16766882ToPZrw','2672722rwcYGa','Session\x20llm_project\x20set\x20to:\x20','.\x20Must\x20be\x20one\x20of:\x20','769983wKmZbR','60GQGovO','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','profile','length','includes','use','Error:\x20Profile\x20\x27'];a31_0x2123=function(){return _0x10e509;};return a31_0x2123();}export class UseCommand extends BaseCommand{[a31_0x586624(0x17a)]=a31_0x586624(0x177);[a31_0x586624(0x179)]=a31_0x586624(0x17c);[a31_0x586624(0x185)](_0x53c7ca){const _0x4c7803=a31_0x586624,{args:_0x5c1c16}=_0x53c7ca;if(_0x5c1c16[_0x4c7803(0x175)]<0x2)return _0x4c7803(0x18a)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x4c7803(0x173)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x1da688=_0x5c1c16[0x0],_0x29ef61=[_0x4c7803(0x18d),_0x4c7803(0x18e),'llm_project',_0x4c7803(0x174)];if(!_0x29ef61[_0x4c7803(0x176)](_0x1da688))return _0x4c7803(0x190)+_0x1da688+_0x4c7803(0x170)+_0x29ef61[_0x4c7803(0x193)](',\x20');return undefined;}async[a31_0x586624(0x189)](_0x3f08af){const _0x24a1b8=a31_0x586624,{args:_0x2a9cf9,options:_0x1fbc4a}=_0x3f08af;try{const _0x4e11cc=_0x2a9cf9[0x0],_0x2ba841=_0x2a9cf9[0x1];if(_0x4e11cc===_0x24a1b8(0x174)){if(!profileExists(_0x2ba841))return console['error'](_0x24a1b8(0x178)+_0x2ba841+'\x27\x20does\x20not\x20exist'),console[_0x24a1b8(0x187)](_0x24a1b8(0x17d)),0x1;const _0x434796=_0x1fbc4a[_0x24a1b8(0x191)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x2ba841},_0x1fbc4a[_0x24a1b8(0x191)]),console[_0x24a1b8(0x181)]('Session\x20profile\x20set\x20to:\x20'+_0x2ba841+_0x24a1b8(0x182)+_0x434796+')'),console[_0x24a1b8(0x181)](_0x24a1b8(0x180)),0x0;}const _0x1765b4={},_0x4bb27f=_0x1fbc4a[_0x24a1b8(0x191)]||getCurrentSessionPID()[_0x24a1b8(0x183)]();switch(_0x4e11cc){case _0x24a1b8(0x18d):_0x1765b4[_0x24a1b8(0x18d)]=_0x2ba841,console[_0x24a1b8(0x181)]('Session\x20database\x20set\x20to:\x20'+_0x2ba841+_0x24a1b8(0x182)+_0x4bb27f+')');break;case _0x24a1b8(0x18e):_0x1765b4[_0x24a1b8(0x18e)]=_0x2ba841,console[_0x24a1b8(0x181)](_0x24a1b8(0x17b)+_0x2ba841+_0x24a1b8(0x182)+_0x4bb27f+')');break;case _0x24a1b8(0x18c):_0x1765b4[_0x24a1b8(0x18c)]=_0x2ba841,console[_0x24a1b8(0x181)](_0x24a1b8(0x16f)+_0x2ba841+_0x24a1b8(0x182)+_0x4bb27f+')');break;}return saveSessionContext(_0x1765b4,_0x1fbc4a['session']),console['log'](_0x24a1b8(0x180)),0x0;}catch(_0x1ee12d){return _0x1ee12d instanceof Error&&console[_0x24a1b8(0x187)](_0x24a1b8(0x188)+_0x1ee12d[_0x24a1b8(0x16b)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x1d683a=a32_0x453f;function a32_0x453f(_0x2174ae,_0x53c72c){const _0x4c65dc=a32_0x4c65();return a32_0x453f=function(_0x453f3b,_0x3d2202){_0x453f3b=_0x453f3b-0x1d1;let _0x32ce42=_0x4c65dc[_0x453f3b];return _0x32ce42;},a32_0x453f(_0x2174ae,_0x53c72c);}(function(_0x4e4227,_0x41a6b5){const _0x17603f=a32_0x453f,_0x42aa87=_0x4e4227();while(!![]){try{const _0x3b3199=-parseInt(_0x17603f(0x20c))/0x1*(-parseInt(_0x17603f(0x1d1))/0x2)+parseInt(_0x17603f(0x243))/0x3+parseInt(_0x17603f(0x1f3))/0x4*(parseInt(_0x17603f(0x1d6))/0x5)+-parseInt(_0x17603f(0x21a))/0x6*(-parseInt(_0x17603f(0x1d5))/0x7)+-parseInt(_0x17603f(0x20d))/0x8*(-parseInt(_0x17603f(0x231))/0x9)+-parseInt(_0x17603f(0x235))/0xa+-parseInt(_0x17603f(0x203))/0xb*(parseInt(_0x17603f(0x1e4))/0xc);if(_0x3b3199===_0x41a6b5)break;else _0x42aa87['push'](_0x42aa87['shift']());}catch(_0x146f48){_0x42aa87['push'](_0x42aa87['shift']());}}}(a32_0x4c65,0x9ed01));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{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x1d683a(0x242)]='workflow:projects';[a32_0x1d683a(0x244)]=a32_0x1d683a(0x1dd);async[a32_0x1d683a(0x23c)](_0xb295c7){const _0x2e921d=a32_0x1d683a,{options:_0x35b80b,args:_0x90cc5b,tdx:_0x2c40d}=_0xb295c7,_0x29de17=_0x90cc5b[0x0];try{_0x35b80b[_0x2e921d(0x1e3)]&&_0x29de17&&console[_0x2e921d(0x220)]('Pattern:\x20'+_0x29de17);const _0x2d0ffd=await withSpinner(_0x2e921d(0x1d7),()=>_0x2c40d[_0x2e921d(0x227)][_0x2e921d(0x216)](_0x29de17,{'limit':_0x35b80b[_0x2e921d(0x1f2)]}),{'verbose':_0x35b80b[_0x2e921d(0x1e3)]}),_0x21a2bc=_0x2d0ffd['data'];return console[_0x2e921d(0x220)]('✔\x20Found\x20'+_0x21a2bc[_0x2e921d(0x1e2)]+_0x2e921d(0x1f0)+(_0x21a2bc[_0x2e921d(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x21a2bc,_0x35b80b),0x0;}catch(_0x2eb68d){if(_0x2eb68d instanceof SDKError)return console[_0x2e921d(0x220)](_0x2e921d(0x20f)+_0x2eb68d[_0x2e921d(0x223)]),_0x2eb68d['cause']&&console['error'](_0x2e921d(0x1df)+_0x2eb68d['cause']),0x1;throw _0x2eb68d;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']='workflow:workflows';[a32_0x1d683a(0x244)]='List\x20workflows';async[a32_0x1d683a(0x23c)](_0x7d1624){const _0x11c2b1=a32_0x1d683a,{options:_0x13811e,args:_0x5bcf1b,tdx:_0x3e079f}=_0x7d1624,_0x32193d=_0x5bcf1b[0x0];try{_0x13811e[_0x11c2b1(0x1e3)]&&_0x32193d&&console['error'](_0x11c2b1(0x1d3)+_0x32193d);const _0x177288=await withSpinner(_0x11c2b1(0x211),()=>_0x3e079f['workflow'][_0x11c2b1(0x236)](_0x32193d,{'limit':_0x13811e[_0x11c2b1(0x1f2)]}),{'verbose':_0x13811e[_0x11c2b1(0x1e3)]}),_0x5386dc=_0x177288[_0x11c2b1(0x1d9)];return console[_0x11c2b1(0x220)]('✔\x20Found\x20'+_0x5386dc[_0x11c2b1(0x1e2)]+_0x11c2b1(0x1ed)+(_0x5386dc['length']!==0x1?'s':'')),await handleSDKOutput(_0x5386dc,_0x13811e),0x0;}catch(_0x22f3fa){if(_0x22f3fa instanceof SDKError)return console[_0x11c2b1(0x220)]('Error:\x20'+_0x22f3fa[_0x11c2b1(0x223)]),_0x22f3fa[_0x11c2b1(0x1f6)]&&console[_0x11c2b1(0x220)](_0x11c2b1(0x1df)+_0x22f3fa[_0x11c2b1(0x1f6)]),0x1;throw _0x22f3fa;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x217);[a32_0x1d683a(0x244)]='List\x20workflow\x20execution\x20sessions';async[a32_0x1d683a(0x23c)](_0x1d0991){const _0x20950c=a32_0x1d683a,{options:_0x562271,args:_0x7f8c92,tdx:_0x21ceb9}=_0x1d0991;let _0x4cd9a9,_0x56a864;if(_0x7f8c92[0x0]){const _0x29b09e=_0x7f8c92[0x0][_0x20950c(0x21c)]('.');if(_0x29b09e['length']===0x1)_0x4cd9a9=_0x29b09e[0x0];else{if(_0x29b09e[_0x20950c(0x1e2)]===0x2)[_0x4cd9a9,_0x56a864]=_0x29b09e;else return console['error'](_0x20950c(0x248)),0x1;}}try{if(_0x562271[_0x20950c(0x1e3)]){if(_0x4cd9a9&&_0x56a864)console[_0x20950c(0x220)](_0x20950c(0x23f)+_0x4cd9a9+'.'+_0x56a864);else _0x4cd9a9&&console[_0x20950c(0x220)](_0x20950c(0x224)+_0x4cd9a9);const _0x159c8a=_0x562271[_0x20950c(0x1f5)];_0x159c8a&&console[_0x20950c(0x220)](_0x20950c(0x21f)+_0x159c8a);}const _0x33d68d=await withSpinner(_0x20950c(0x249),()=>_0x21ceb9['workflow']['sessions']({'projectName':_0x4cd9a9,'workflowName':_0x56a864,'status':_0x562271['status'],'fromTime':_0x562271[_0x20950c(0x1f8)],'toTime':_0x562271['to'],'limit':_0x562271['limit']}),{'verbose':_0x562271['verbose']}),_0x311a02=_0x33d68d[_0x20950c(0x1d9)];return console[_0x20950c(0x220)](_0x20950c(0x1ec)+_0x311a02[_0x20950c(0x1e2)]+'\x20session'+(_0x311a02[_0x20950c(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x311a02,_0x562271),0x0;}catch(_0x4c8683){if(_0x4c8683 instanceof SDKError)return console[_0x20950c(0x220)](_0x20950c(0x20f)+_0x4c8683['message']),_0x4c8683['cause']&&console['error'](_0x20950c(0x1df)+_0x4c8683[_0x20950c(0x1f6)]),0x1;throw _0x4c8683;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x22a);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x201);async[a32_0x1d683a(0x23c)](_0x173491){const _0x571b8e=a32_0x1d683a,{options:_0x184af7,args:_0x50adf0,tdx:_0xb58681}=_0x173491;let _0x5680ea,_0xb1a261;if(_0x50adf0[0x0]){const _0x56d63a=_0x50adf0[0x0][_0x571b8e(0x21c)]('.');if(_0x56d63a[_0x571b8e(0x1e2)]===0x1)_0x5680ea=_0x56d63a[0x0];else{if(_0x56d63a['length']===0x2)[_0x5680ea,_0xb1a261]=_0x56d63a;else return console[_0x571b8e(0x220)](_0x571b8e(0x248)),0x1;}}try{const _0x3fc716=_0x184af7[_0x571b8e(0x1ff)];if(_0x184af7[_0x571b8e(0x1e3)]){if(_0x5680ea&&_0xb1a261)console[_0x571b8e(0x220)](_0x571b8e(0x23f)+_0x5680ea+'.'+_0xb1a261);else _0x5680ea&&console[_0x571b8e(0x220)](_0x571b8e(0x224)+_0x5680ea);_0x3fc716&&console[_0x571b8e(0x220)]('Include\x20retried:\x20yes');}const _0x119b12=await withSpinner(_0x571b8e(0x20e),()=>_0xb58681[_0x571b8e(0x227)][_0x571b8e(0x212)]({'projectName':_0x5680ea,'workflowName':_0xb1a261,'includeRetried':_0x3fc716,'limit':_0x184af7[_0x571b8e(0x1f2)]}),{'verbose':_0x184af7[_0x571b8e(0x1e3)]}),_0x3b6cf6=_0x119b12['data'];return console['error'](_0x571b8e(0x1ec)+_0x3b6cf6[_0x571b8e(0x1e2)]+_0x571b8e(0x1e6)+(_0x3b6cf6[_0x571b8e(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x3b6cf6,_0x184af7),0x0;}catch(_0x5f5682){if(_0x5f5682 instanceof SDKError)return console['error'](_0x571b8e(0x20f)+_0x5f5682['message']),_0x5f5682['cause']&&console['error'](_0x571b8e(0x1df)+_0x5f5682[_0x571b8e(0x1f6)]),0x1;throw _0x5f5682;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x1d683a(0x242)]='workflow:attempt';['description']=a32_0x1d683a(0x24d);async[a32_0x1d683a(0x23c)](_0x2c2147){const _0x40d79a=a32_0x1d683a,{options:_0x3a5ada,args:_0x17f60a,tdx:_0x1ffa2d}=_0x2c2147,_0x441e18=_0x17f60a[0x0];if(!_0x441e18)return console['error'](_0x40d79a(0x1e8)),0x1;try{_0x3a5ada['verbose']&&console['error'](_0x40d79a(0x241)+_0x441e18);const _0x1165e9=await withSpinner('Getting\x20attempt\x20details...',()=>_0x1ffa2d[_0x40d79a(0x227)][_0x40d79a(0x1d2)](_0x441e18),{'verbose':_0x3a5ada[_0x40d79a(0x1e3)]}),_0x5a3703=_0x1165e9[_0x40d79a(0x1d9)];return await handleSDKOutput([_0x5a3703],_0x3a5ada),0x0;}catch(_0x5c54d2){if(_0x5c54d2 instanceof SDKError)return console[_0x40d79a(0x220)](_0x40d79a(0x20f)+_0x5c54d2['message']),_0x5c54d2[_0x40d79a(0x1f6)]&&console[_0x40d79a(0x220)](_0x40d79a(0x1df)+_0x5c54d2[_0x40d79a(0x1f6)]),0x1;throw _0x5c54d2;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a32_0x1d683a(0x24c);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x225);async[a32_0x1d683a(0x23c)](_0x42c0c6){const _0x23d57a=a32_0x1d683a,{options:_0x1673bc,args:_0x359baa,tdx:_0x1886d6}=_0x42c0c6,_0x9b5a70=_0x359baa[0x0];if(!_0x9b5a70)return console[_0x23d57a(0x220)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x383ca1=_0x1673bc[_0x23d57a(0x221)];_0x1673bc[_0x23d57a(0x1e3)]&&(console['error']('Attempt\x20ID:\x20'+_0x9b5a70),_0x383ca1&&console['error'](_0x23d57a(0x1e7)));const _0x13e538=await withSpinner(_0x23d57a(0x219),()=>_0x1886d6[_0x23d57a(0x227)]['tasks'](_0x9b5a70,_0x383ca1||![]),{'verbose':_0x1673bc['verbose']}),_0x1163e7=_0x13e538[_0x23d57a(0x1d9)];return console[_0x23d57a(0x220)](_0x23d57a(0x1ec)+_0x1163e7[_0x23d57a(0x1e2)]+'\x20task'+(_0x1163e7[_0x23d57a(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x1163e7,_0x1673bc),0x0;}catch(_0x2dd345){if(_0x2dd345 instanceof SDKError)return console[_0x23d57a(0x220)](_0x23d57a(0x20f)+_0x2dd345['message']),_0x2dd345[_0x23d57a(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x2dd345[_0x23d57a(0x1f6)]),0x1;throw _0x2dd345;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x232);[a32_0x1d683a(0x244)]='Show\x20logs\x20for\x20a\x20specific\x20task';async['execute'](_0x27ed65){const _0x3b8f46=a32_0x1d683a,{options:_0x2b7dfb,args:_0x287b26,tdx:_0x3dae73}=_0x27ed65,_0x464ec2=_0x287b26[0x0],_0x4106da=_0x287b26[0x1];if(!_0x464ec2||!_0x4106da)return console['error']('Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required'),0x1;try{_0x2b7dfb[_0x3b8f46(0x1e3)]&&(console[_0x3b8f46(0x220)]('Attempt\x20ID:\x20'+_0x464ec2),console['error'](_0x3b8f46(0x1ea)+_0x4106da));const _0x2a737c=_0x2b7dfb[_0x3b8f46(0x20b)],_0x286e39=await withSpinner('Getting\x20task\x20logs...',()=>_0x3dae73['workflow'][_0x3b8f46(0x208)](_0x464ec2,_0x4106da,{'offset':_0x2a737c,'limit':_0x2b7dfb[_0x3b8f46(0x1f2)]}),{'verbose':_0x2b7dfb['verbose']}),_0x1a192f=_0x286e39['data'];return console[_0x3b8f46(0x220)]('✔\x20Found\x20'+_0x1a192f[_0x3b8f46(0x1e2)]+_0x3b8f46(0x1e0)+(_0x1a192f['length']!==0x1?'ies':'y')),await handleSDKOutput(_0x1a192f,_0x2b7dfb),0x0;}catch(_0x290813){if(_0x290813 instanceof SDKError)return console['error'](_0x3b8f46(0x20f)+_0x290813[_0x3b8f46(0x223)]),_0x290813[_0x3b8f46(0x1f6)]&&console[_0x3b8f46(0x220)](_0x3b8f46(0x1df)+_0x290813['cause']),0x1;throw _0x290813;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x23d);[a32_0x1d683a(0x244)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x119564){const _0x265bdd=a32_0x1d683a,{options:_0xf59173,args:_0x57645c,tdx:_0x1ec766}=_0x119564,_0x3eaee6=_0x57645c[0x0];if(!_0x3eaee6)return console[_0x265bdd(0x220)](_0x265bdd(0x1e8)),0x1;try{const _0x27663f=_0xf59173[_0x265bdd(0x230)];_0xf59173[_0x265bdd(0x1e3)]&&(console[_0x265bdd(0x220)](_0x265bdd(0x241)+_0x3eaee6),_0x27663f&&console['error'](_0x265bdd(0x1d4)+_0x27663f));if(!_0xf59173['yes']){const _0x46b5fd=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3eaee6+'?');if(!_0x46b5fd)return console[_0x265bdd(0x220)](_0x265bdd(0x22c)),0x0;}const _0x19b415=await withSpinner('Killing\x20attempt...',()=>_0x1ec766[_0x265bdd(0x227)]['kill'](_0x3eaee6,_0x27663f),{'verbose':_0xf59173[_0x265bdd(0x1e3)]}),_0x5c245b=_0x19b415[_0x265bdd(0x1d9)];return console[_0x265bdd(0x220)]('✔\x20'+_0x5c245b),0x0;}catch(_0x54d4a5){if(_0x54d4a5 instanceof SDKError)return console['error'](_0x265bdd(0x20f)+_0x54d4a5[_0x265bdd(0x223)]),_0x54d4a5[_0x265bdd(0x1f6)]&&console[_0x265bdd(0x220)](_0x265bdd(0x1df)+_0x54d4a5[_0x265bdd(0x1f6)]),0x1;throw _0x54d4a5;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x210);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a32_0x1d683a(0x23c)](_0x3d6476){const _0x535a9e=a32_0x1d683a,{options:_0x4bcf1a,args:_0x4e6285,tdx:_0x4ad7d4}=_0x3d6476,_0x3c8506=_0x4e6285[0x0];if(!_0x3c8506)return console['error'](_0x535a9e(0x218)),console[_0x535a9e(0x220)](_0x535a9e(0x246)),0x1;let _0x5d82b6=![],_0x12dd8f=_0x3c8506;if(_0x3c8506[_0x535a9e(0x22b)](_0x535a9e(0x1fb)))_0x5d82b6=!![],_0x12dd8f=_0x3c8506[_0x535a9e(0x1e5)](0x8);else{if(_0x3c8506[_0x535a9e(0x22b)](_0x535a9e(0x1fa)))_0x5d82b6=![],_0x12dd8f=_0x3c8506[_0x535a9e(0x1e5)](0x8);else return console[_0x535a9e(0x220)](_0x535a9e(0x240)),console['error'](_0x535a9e(0x246)),0x1;}try{const _0x39a0f9=_0x4bcf1a[_0x535a9e(0x1f4)],_0x58458d=_0x4bcf1a[_0x535a9e(0x239)],_0x5405e4=_0x4bcf1a[_0x535a9e(0x204)],_0x4fbbf9=_0x4bcf1a['force'];_0x4bcf1a[_0x535a9e(0x1e3)]&&(console[_0x535a9e(0x220)](_0x535a9e(0x1f7)+(_0x5d82b6?_0x535a9e(0x24b):_0x535a9e(0x1d2))+'\x20'+_0x12dd8f),_0x39a0f9&&console[_0x535a9e(0x220)]('From\x20task:\x20'+_0x39a0f9),_0x58458d&&console[_0x535a9e(0x220)](_0x535a9e(0x22e)+_0x58458d),_0x5405e4&&console[_0x535a9e(0x220)](_0x535a9e(0x21e)+_0x5405e4),_0x4fbbf9&&console[_0x535a9e(0x220)](_0x535a9e(0x213)));let _0x4a88d2;if(_0x5405e4)try{if(_0x5405e4[_0x535a9e(0x22b)]('@')){const _0x57ae48=await import(_0x535a9e(0x1da)),_0x5106c4=_0x5405e4[_0x535a9e(0x1e5)](0x1),_0x54938f=await _0x57ae48['readFile'](_0x5106c4,_0x535a9e(0x23e));_0x4a88d2=JSON[_0x535a9e(0x209)](_0x54938f);}else _0x4a88d2=JSON[_0x535a9e(0x209)](_0x5405e4);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4bcf1a[_0x535a9e(0x233)]){const _0x5f52c5=await confirm(_0x535a9e(0x1db)+(_0x5d82b6?_0x535a9e(0x24b):_0x535a9e(0x1d2))+'\x20'+_0x12dd8f+'?');if(!_0x5f52c5)return console[_0x535a9e(0x220)](_0x535a9e(0x22c)),0x0;}let _0x233fbb;_0x5d82b6?_0x233fbb=await withSpinner(_0x535a9e(0x22d),()=>_0x4ad7d4[_0x535a9e(0x227)]['retrySession'](_0x12dd8f,{'fromTask':_0x39a0f9,'retryParams':_0x4a88d2}),{'verbose':_0x4bcf1a[_0x535a9e(0x1e3)]}):_0x233fbb=await withSpinner(_0x535a9e(0x21d),()=>_0x4ad7d4[_0x535a9e(0x227)]['retryAttempt'](_0x12dd8f,{'resumeFrom':_0x58458d,'retryParams':_0x4a88d2,'force':_0x4fbbf9}),{'verbose':_0x4bcf1a[_0x535a9e(0x1e3)]});const _0x10fa05=_0x233fbb[_0x535a9e(0x1d9)];return console[_0x535a9e(0x220)]('✔\x20Retry\x20started'),console[_0x535a9e(0x220)](_0x535a9e(0x228)+_0x10fa05[_0x535a9e(0x1fc)]),console[_0x535a9e(0x220)](_0x535a9e(0x23a)+_0x10fa05[_0x535a9e(0x24a)]),0x0;}catch(_0x37d845){if(_0x37d845 instanceof SDKError)return console[_0x535a9e(0x220)](_0x535a9e(0x20f)+_0x37d845[_0x535a9e(0x223)]),_0x37d845[_0x535a9e(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x37d845['cause']),0x1;throw _0x37d845;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x222);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x1e9);async[a32_0x1d683a(0x23c)](_0x52f8d7){const _0x10df88=a32_0x1d683a,{options:_0x153e50,args:_0x41cdda,tdx:_0x2876cc}=_0x52f8d7,_0x1d9670=_0x41cdda[0x0],_0x31fa59=_0x41cdda[0x1]||'.';if(!_0x1d9670)return console[_0x10df88(0x220)](_0x10df88(0x1fd)),console[_0x10df88(0x220)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x4703fa=_0x153e50[_0x10df88(0x238)];_0x153e50[_0x10df88(0x1e3)]&&(console[_0x10df88(0x220)](_0x10df88(0x21b)+_0x1d9670),console[_0x10df88(0x220)]('Output\x20directory:\x20'+_0x31fa59),_0x4703fa&&console[_0x10df88(0x220)](_0x10df88(0x1dc)+_0x4703fa));const _0x44b089=await withSpinner(_0x10df88(0x205)+_0x1d9670+'...',()=>_0x2876cc['workflow'][_0x10df88(0x1eb)](_0x1d9670,_0x31fa59,{'revision':_0x4703fa}),{'verbose':_0x153e50[_0x10df88(0x1e3)]}),_0x9f34ca=_0x44b089[_0x10df88(0x1d9)];return console[_0x10df88(0x220)](_0x10df88(0x202)+_0x9f34ca[_0x10df88(0x229)]),console['error'](_0x10df88(0x226)+_0x9f34ca[_0x10df88(0x238)]),console[_0x10df88(0x220)](_0x10df88(0x1f9)+_0x9f34ca['filesExtracted']),console['error']('\x20\x20Location:\x20'+_0x31fa59+'/'+_0x9f34ca[_0x10df88(0x229)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a32_0x1d683a(0x242)]=a32_0x1d683a(0x207);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x1ee);async[a32_0x1d683a(0x23c)](_0x56fe58){const _0x38c6ae=a32_0x1d683a,{options:_0x1276cb,args:_0x2d510c,tdx:_0x350bb9}=_0x56fe58;let _0x570b49='.',_0x25c4f1=_0x1276cb[_0x38c6ae(0x242)];if(_0x2d510c[0x0]){const {promises:_0xdf59b3}=await import('fs');try{const _0x25679d=await _0xdf59b3[_0x38c6ae(0x23b)](_0x2d510c[0x0]);if(_0x25679d[_0x38c6ae(0x214)]())_0x570b49=_0x2d510c[0x0];else return console[_0x38c6ae(0x220)](_0x38c6ae(0x20f)+_0x2d510c[0x0]+_0x38c6ae(0x1ef)),0x1;}catch{_0x25c4f1=_0x2d510c[0x0],_0x570b49='.';}}const _0x59d379=_0x1276cb[_0x38c6ae(0x238)],_0x3d3dcf=_0x1276cb['skipValidation'];_0x1276cb[_0x38c6ae(0x1e3)]&&(console[_0x38c6ae(0x220)]('Project\x20directory:\x20'+_0x570b49),_0x25c4f1&&console['error'](_0x38c6ae(0x200)+_0x25c4f1),_0x59d379&&console[_0x38c6ae(0x220)](_0x38c6ae(0x1dc)+_0x59d379),_0x3d3dcf&&console['error'](_0x38c6ae(0x22f)));const _0x1d23db=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x350bb9[_0x38c6ae(0x227)][_0x38c6ae(0x1d8)](_0x570b49,{'projectName':_0x25c4f1,'revision':_0x59d379,'skipValidation':_0x3d3dcf}),{'verbose':_0x1276cb['verbose']}),_0x52c408=_0x1d23db['data'];return console[_0x38c6ae(0x220)](_0x38c6ae(0x245)+_0x52c408[_0x38c6ae(0x229)]),console[_0x38c6ae(0x220)]('\x20\x20Project\x20ID:\x20'+_0x52c408['projectId']),console[_0x38c6ae(0x220)](_0x38c6ae(0x226)+_0x52c408[_0x38c6ae(0x238)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a32_0x1d683a(0x1fe);[a32_0x1d683a(0x244)]=a32_0x1d683a(0x247);async['execute'](_0x1ff859){const _0x49260e=a32_0x1d683a,{options:_0x31e053,args:_0x553c27,tdx:_0x13a715}=_0x1ff859,_0xf912c5=_0x553c27[0x0];if(!_0xf912c5)return console['error'](_0x49260e(0x1de)),console[_0x49260e(0x220)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x31e053[_0x49260e(0x1e3)]&&console[_0x49260e(0x220)](_0x49260e(0x21b)+_0xf912c5);if(!_0x31e053[_0x49260e(0x233)]){const _0x4ee724=await confirm(_0x49260e(0x234)+_0xf912c5+_0x49260e(0x20a));if(!_0x4ee724)return console[_0x49260e(0x220)](_0x49260e(0x22c)),0x0;}const _0x31476d=await withSpinner(_0x49260e(0x1e1)+_0xf912c5+_0x49260e(0x1f1),()=>_0x13a715[_0x49260e(0x227)][_0x49260e(0x215)](_0xf912c5),{'verbose':_0x31e053[_0x49260e(0x1e3)]}),_0x441dd7=_0x31476d[_0x49260e(0x1d9)];return console['error']('✔\x20Deleted\x20project\x20'+_0x441dd7[_0x49260e(0x229)]),console[_0x49260e(0x220)](_0x49260e(0x237)+_0x441dd7[_0x49260e(0x206)]),0x0;}}function a32_0x4c65(){const _0x5996fb=['Attempt\x20ID:\x20','name','649248AohEFb','description','✔\x20Pushed\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Listing\x20workflow\x20sessions...','sessionId','session','workflow:tasks','Show\x20specific\x20attempt\x20details','837524YhOZrY','attempt','Project\x20filter:\x20','Reason:\x20','7CKyfZy','55qvYpOo','Listing\x20workflow\x20projects...','push','data','fs/promises','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Revision:\x20','List\x20all\x20workflow\x20projects','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Cause:\x20','\x20log\x20entr','Deleting\x20project\x20','length','verbose','2388OCOIjP','substring','\x20attempt','Including\x20subtasks:\x20yes','Error:\x20Attempt\x20ID\x20is\x20required','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Task\x20name:\x20','download','✔\x20Found\x20','\x20workflow','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','\x20is\x20not\x20a\x20directory','\x20project','...','limit','328912LUouzU','fromTask','status','cause','Target:\x20','from','\x20\x20Files\x20extracted:\x20','attempt:','session:','attemptId','Error:\x20Project\x20name\x20is\x20required','workflow:delete','includeRetried','Project\x20name:\x20','List\x20workflow\x20attempts','✔\x20Downloaded\x20','126929vhbecz','params','Downloading\x20project\x20','projectId','workflow:push','logs','parse','\x22?\x20This\x20cannot\x20be\x20undone.','offset','1wXQoxw','3336280goCEfR','Listing\x20workflow\x20attempts...','Error:\x20','workflow:retry','Listing\x20workflows...','attempts','Force:\x20yes','isDirectory','delete','projects','workflow:sessions','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Getting\x20attempt\x20tasks...','4508556CsDxaL','Project:\x20','split','Retrying\x20attempt...','Params:\x20','Status:\x20','error','includeSubtasks','workflow:download','message','Filter:\x20project=','Show\x20tasks\x20for\x20an\x20attempt','\x20\x20Revision:\x20','workflow','\x20\x20New\x20attempt\x20ID:\x20','projectName','workflow:attempts','startsWith','Cancelled','Retrying\x20session...','Resume\x20from:\x20','Validation:\x20skipped','reason','27HIRpqL','workflow:logs','yes','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','5954590moClOB','workflows','\x20\x20Project\x20ID:\x20','revision','resumeFrom','\x20\x20Session\x20ID:\x20','stat','execute','workflow:kill','utf-8','Filter:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'];a32_0x4c65=function(){return _0x5996fb;};return a32_0x4c65();}
|
|
1
|
+
const a32_0x13ff80=a32_0x5a7c;function a32_0x5650(){const _0x239ed5=['1808004FulWes','filesExtracted','Downloading\x20project\x20','stat','...','workflow:retry','attemptId','Validation:\x20skipped','532HfWQDg','workflow:kill','3082408KmOBAi','Listing\x20workflow\x20sessions...','session:','startsWith','includeSubtasks','fromTask','\x20log\x20entr','✔\x20Deleted\x20project\x20','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','workflow:sessions','61554DZgkQR','attempts','1gOtmpy','attempt','workflow:logs','length','session','retrySession','Killing\x20attempt...','\x20\x20Files\x20extracted:\x20','error','from','includeRetried','Cancelled','\x20session','logs','name','6720420qjNbXg','Attempt\x20ID:\x20','Retry\x20a\x20session\x20or\x20attempt','workflow:push','15hfhVpu','cause','workflow:projects','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','split','Task\x20name:\x20','Params:\x20','\x20\x20Cause:\x20','List\x20workflow\x20execution\x20sessions','Show\x20tasks\x20for\x20an\x20attempt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','data','fs/promises','skipValidation','Filter:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Project\x20directory:\x20','limit','Pattern:\x20','Error:\x20','projectId','\x20is\x20not\x20a\x20directory','reason','Kill\x20a\x20running\x20attempt','Listing\x20workflows...','delete','workflow:download','ies','projects','Project\x20name:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','From\x20task:\x20','verbose','Revision:\x20','params','execute','Including\x20subtasks:\x20yes','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','yes','retryAttempt','Usage:\x20workflow:delete\x20<project-name-or-id>','\x20\x20New\x20attempt\x20ID:\x20','Listing\x20workflow\x20attempts...','substring','Getting\x20attempt\x20details...','✔\x20Retry\x20started','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','3952201SSTboB','workflow','178348YxHapD','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflow:attempts','revision','parse','Filter:\x20project=','9XjZyrE','List\x20workflow\x20attempts','projectName','Listing\x20workflow\x20projects...','workflow:attempt','Error:\x20Attempt\x20ID\x20is\x20required','Getting\x20attempt\x20tasks...','\x20\x20Project\x20ID:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Getting\x20task\x20logs...','\x20\x20Location:\x20','✔\x20Found\x20','Project:\x20','sessionId','status','Deleting\x20project\x20','Include\x20retried:\x20yes','readFile','workflow:tasks','Resume\x20from:\x20','workflows','Target:\x20','Reason:\x20','Show\x20logs\x20for\x20a\x20specific\x20task','\x20\x20Session\x20ID:\x20','message','\x20workflow','description','\x22?\x20This\x20cannot\x20be\x20undone.','\x20task','Output\x20directory:\x20','8330440SWjJBP','workflow:workflows','offset'];a32_0x5650=function(){return _0x239ed5;};return a32_0x5650();}(function(_0x38fc14,_0x320c5b){const _0x4d5dd8=a32_0x5a7c,_0x27c79c=_0x38fc14();while(!![]){try{const _0x31442c=-parseInt(_0x4d5dd8(0x111))/0x1*(-parseInt(_0x4d5dd8(0xfb))/0x2)+parseInt(_0x4d5dd8(0x124))/0x3*(parseInt(_0x4d5dd8(0x156))/0x4)+parseInt(_0x4d5dd8(0x120))/0x5+-parseInt(_0x4d5dd8(0x10f))/0x6*(parseInt(_0x4d5dd8(0x103))/0x7)+-parseInt(_0x4d5dd8(0x105))/0x8+parseInt(_0x4d5dd8(0x15c))/0x9*(-parseInt(_0x4d5dd8(0xf8))/0xa)+parseInt(_0x4d5dd8(0x154))/0xb;if(_0x31442c===_0x320c5b)break;else _0x27c79c['push'](_0x27c79c['shift']());}catch(_0x1ca565){_0x27c79c['push'](_0x27c79c['shift']());}}}(a32_0x5650,0xcb31b));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{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x126);[a32_0x13ff80(0xf4)]='List\x20all\x20workflow\x20projects';async[a32_0x13ff80(0x148)](_0x1ae513){const _0x8a1b40=a32_0x13ff80,{options:_0x3794aa,args:_0xb24461,tdx:_0xc37ca}=_0x1ae513,_0x4c8a83=_0xb24461[0x0];try{_0x3794aa[_0x8a1b40(0x145)]&&_0x4c8a83&&console[_0x8a1b40(0x119)](_0x8a1b40(0x137)+_0x4c8a83);const _0x50b48a=await withSpinner(_0x8a1b40(0x15f),()=>_0xc37ca[_0x8a1b40(0x155)][_0x8a1b40(0x141)](_0x4c8a83,{'limit':_0x3794aa[_0x8a1b40(0x136)]}),{'verbose':_0x3794aa[_0x8a1b40(0x145)]}),_0x3c7808=_0x50b48a[_0x8a1b40(0x130)];return console[_0x8a1b40(0x119)](_0x8a1b40(0x167)+_0x3c7808[_0x8a1b40(0x114)]+'\x20project'+(_0x3c7808[_0x8a1b40(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x3c7808,_0x3794aa),0x0;}catch(_0x4e6155){if(_0x4e6155 instanceof SDKError)return console[_0x8a1b40(0x119)](_0x8a1b40(0x138)+_0x4e6155['message']),_0x4e6155['cause']&&console['error'](_0x8a1b40(0x12b)+_0x4e6155[_0x8a1b40(0x125)]),0x1;throw _0x4e6155;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0xf9);[a32_0x13ff80(0xf4)]='List\x20workflows';async[a32_0x13ff80(0x148)](_0x218d40){const _0x35a413=a32_0x13ff80,{options:_0x1c213e,args:_0x32c627,tdx:_0x5e2cd4}=_0x218d40,_0x510e4d=_0x32c627[0x0];try{_0x1c213e[_0x35a413(0x145)]&&_0x510e4d&&console[_0x35a413(0x119)]('Project\x20filter:\x20'+_0x510e4d);const _0x118bfe=await withSpinner(_0x35a413(0x13d),()=>_0x5e2cd4[_0x35a413(0x155)][_0x35a413(0xed)](_0x510e4d,{'limit':_0x1c213e[_0x35a413(0x136)]}),{'verbose':_0x1c213e[_0x35a413(0x145)]}),_0x1e67fe=_0x118bfe['data'];return console[_0x35a413(0x119)]('✔\x20Found\x20'+_0x1e67fe['length']+_0x35a413(0xf3)+(_0x1e67fe[_0x35a413(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x1e67fe,_0x1c213e),0x0;}catch(_0x5ecb87){if(_0x5ecb87 instanceof SDKError)return console[_0x35a413(0x119)](_0x35a413(0x138)+_0x5ecb87['message']),_0x5ecb87[_0x35a413(0x125)]&&console['error'](_0x35a413(0x12b)+_0x5ecb87[_0x35a413(0x125)]),0x1;throw _0x5ecb87;}}}export class WorkflowSessionsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x10e);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x12c);async[a32_0x13ff80(0x148)](_0xaf36fc){const _0x28725c=a32_0x13ff80,{options:_0x5c90a0,args:_0x136d07,tdx:_0x408895}=_0xaf36fc;let _0x47c1e0,_0x20ad01;if(_0x136d07[0x0]){const _0x13e519=_0x136d07[0x0]['split']('.');if(_0x13e519['length']===0x1)_0x47c1e0=_0x13e519[0x0];else{if(_0x13e519['length']===0x2)[_0x47c1e0,_0x20ad01]=_0x13e519;else return console['error']('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x5c90a0[_0x28725c(0x145)]){if(_0x47c1e0&&_0x20ad01)console[_0x28725c(0x119)](_0x28725c(0x133)+_0x47c1e0+'.'+_0x20ad01);else _0x47c1e0&&console[_0x28725c(0x119)](_0x28725c(0x15b)+_0x47c1e0);const _0x198866=_0x5c90a0['status'];_0x198866&&console[_0x28725c(0x119)]('Status:\x20'+_0x198866);}const _0x3c0cd1=await withSpinner(_0x28725c(0x106),()=>_0x408895[_0x28725c(0x155)]['sessions']({'projectName':_0x47c1e0,'workflowName':_0x20ad01,'status':_0x5c90a0[_0x28725c(0xe7)],'fromTime':_0x5c90a0[_0x28725c(0x11a)],'toTime':_0x5c90a0['to'],'limit':_0x5c90a0[_0x28725c(0x136)]}),{'verbose':_0x5c90a0[_0x28725c(0x145)]}),_0x5ad890=_0x3c0cd1['data'];return console['error'](_0x28725c(0x167)+_0x5ad890[_0x28725c(0x114)]+_0x28725c(0x11d)+(_0x5ad890[_0x28725c(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x5ad890,_0x5c90a0),0x0;}catch(_0x380fef){if(_0x380fef instanceof SDKError)return console[_0x28725c(0x119)](_0x28725c(0x138)+_0x380fef[_0x28725c(0xf2)]),_0x380fef[_0x28725c(0x125)]&&console[_0x28725c(0x119)](_0x28725c(0x12b)+_0x380fef[_0x28725c(0x125)]),0x1;throw _0x380fef;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x158);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x15d);async[a32_0x13ff80(0x148)](_0x4c98a6){const _0x58e37c=a32_0x13ff80,{options:_0x355e9b,args:_0x107bf8,tdx:_0x56cd15}=_0x4c98a6;let _0x75b718,_0x48a118;if(_0x107bf8[0x0]){const _0xf53be2=_0x107bf8[0x0][_0x58e37c(0x128)]('.');if(_0xf53be2['length']===0x1)_0x75b718=_0xf53be2[0x0];else{if(_0xf53be2['length']===0x2)[_0x75b718,_0x48a118]=_0xf53be2;else return console[_0x58e37c(0x119)](_0x58e37c(0x127)),0x1;}}try{const _0x5408eb=_0x355e9b[_0x58e37c(0x11b)];if(_0x355e9b[_0x58e37c(0x145)]){if(_0x75b718&&_0x48a118)console[_0x58e37c(0x119)](_0x58e37c(0x133)+_0x75b718+'.'+_0x48a118);else _0x75b718&&console['error'](_0x58e37c(0x15b)+_0x75b718);_0x5408eb&&console[_0x58e37c(0x119)](_0x58e37c(0xe9));}const _0x1d3fb0=await withSpinner(_0x58e37c(0x14f),()=>_0x56cd15[_0x58e37c(0x155)][_0x58e37c(0x110)]({'projectName':_0x75b718,'workflowName':_0x48a118,'includeRetried':_0x5408eb,'limit':_0x355e9b[_0x58e37c(0x136)]}),{'verbose':_0x355e9b[_0x58e37c(0x145)]}),_0x2a381a=_0x1d3fb0[_0x58e37c(0x130)];return console[_0x58e37c(0x119)](_0x58e37c(0x167)+_0x2a381a[_0x58e37c(0x114)]+'\x20attempt'+(_0x2a381a['length']!==0x1?'s':'')),await handleSDKOutput(_0x2a381a,_0x355e9b),0x0;}catch(_0x36b994){if(_0x36b994 instanceof SDKError)return console[_0x58e37c(0x119)](_0x58e37c(0x138)+_0x36b994[_0x58e37c(0xf2)]),_0x36b994[_0x58e37c(0x125)]&&console[_0x58e37c(0x119)](_0x58e37c(0x12b)+_0x36b994[_0x58e37c(0x125)]),0x1;throw _0x36b994;}}}function a32_0x5a7c(_0x17f220,_0x46dd2a){const _0x565092=a32_0x5650();return a32_0x5a7c=function(_0x5a7cd3,_0x2aed99){_0x5a7cd3=_0x5a7cd3-0xe7;let _0x288da4=_0x565092[_0x5a7cd3];return _0x288da4;},a32_0x5a7c(_0x17f220,_0x46dd2a);}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x160);['description']='Show\x20specific\x20attempt\x20details';async[a32_0x13ff80(0x148)](_0x4eada8){const _0x3d970f=a32_0x13ff80,{options:_0x3d4748,args:_0x43f41b,tdx:_0xb3d9aa}=_0x4eada8,_0x151153=_0x43f41b[0x0];if(!_0x151153)return console['error'](_0x3d970f(0x161)),0x1;try{_0x3d4748[_0x3d970f(0x145)]&&console[_0x3d970f(0x119)](_0x3d970f(0x121)+_0x151153);const _0x1b0957=await withSpinner(_0x3d970f(0x151),()=>_0xb3d9aa['workflow'][_0x3d970f(0x112)](_0x151153),{'verbose':_0x3d4748[_0x3d970f(0x145)]}),_0x244aef=_0x1b0957[_0x3d970f(0x130)];return await handleSDKOutput([_0x244aef],_0x3d4748),0x0;}catch(_0x55e1cb){if(_0x55e1cb instanceof SDKError)return console['error'](_0x3d970f(0x138)+_0x55e1cb[_0x3d970f(0xf2)]),_0x55e1cb[_0x3d970f(0x125)]&&console[_0x3d970f(0x119)](_0x3d970f(0x12b)+_0x55e1cb[_0x3d970f(0x125)]),0x1;throw _0x55e1cb;}}}export class WorkflowTasksCommand extends BaseCommand{['name']=a32_0x13ff80(0xeb);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x12d);async[a32_0x13ff80(0x148)](_0x411203){const _0x111478=a32_0x13ff80,{options:_0x302353,args:_0x385396,tdx:_0xc9feaa}=_0x411203,_0x248ccf=_0x385396[0x0];if(!_0x248ccf)return console[_0x111478(0x119)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x479ac0=_0x302353[_0x111478(0x109)];_0x302353[_0x111478(0x145)]&&(console[_0x111478(0x119)]('Attempt\x20ID:\x20'+_0x248ccf),_0x479ac0&&console[_0x111478(0x119)](_0x111478(0x149)));const _0x46ab0f=await withSpinner(_0x111478(0x162),()=>_0xc9feaa[_0x111478(0x155)]['tasks'](_0x248ccf,_0x479ac0||![]),{'verbose':_0x302353['verbose']}),_0x565b78=_0x46ab0f[_0x111478(0x130)];return console[_0x111478(0x119)](_0x111478(0x167)+_0x565b78[_0x111478(0x114)]+_0x111478(0xf6)+(_0x565b78[_0x111478(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x565b78,_0x302353),0x0;}catch(_0xcf9d32){if(_0xcf9d32 instanceof SDKError)return console[_0x111478(0x119)](_0x111478(0x138)+_0xcf9d32[_0x111478(0xf2)]),_0xcf9d32['cause']&&console[_0x111478(0x119)](_0x111478(0x12b)+_0xcf9d32[_0x111478(0x125)]),0x1;throw _0xcf9d32;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x113);['description']=a32_0x13ff80(0xf0);async[a32_0x13ff80(0x148)](_0x46ba21){const _0x189977=a32_0x13ff80,{options:_0x23aebc,args:_0x15791d,tdx:_0x319b1b}=_0x46ba21,_0x5f4048=_0x15791d[0x0],_0x1005d7=_0x15791d[0x1];if(!_0x5f4048||!_0x1005d7)return console['error'](_0x189977(0x10d)),0x1;try{_0x23aebc[_0x189977(0x145)]&&(console[_0x189977(0x119)](_0x189977(0x121)+_0x5f4048),console[_0x189977(0x119)](_0x189977(0x129)+_0x1005d7));const _0x2c2c22=_0x23aebc[_0x189977(0xfa)],_0x3e2e39=await withSpinner(_0x189977(0x165),()=>_0x319b1b[_0x189977(0x155)][_0x189977(0x11e)](_0x5f4048,_0x1005d7,{'offset':_0x2c2c22,'limit':_0x23aebc[_0x189977(0x136)]}),{'verbose':_0x23aebc[_0x189977(0x145)]}),_0x457f02=_0x3e2e39[_0x189977(0x130)];return console[_0x189977(0x119)](_0x189977(0x167)+_0x457f02[_0x189977(0x114)]+_0x189977(0x10b)+(_0x457f02[_0x189977(0x114)]!==0x1?_0x189977(0x140):'y')),await handleSDKOutput(_0x457f02,_0x23aebc),0x0;}catch(_0x57e868){if(_0x57e868 instanceof SDKError)return console[_0x189977(0x119)](_0x189977(0x138)+_0x57e868[_0x189977(0xf2)]),_0x57e868['cause']&&console[_0x189977(0x119)](_0x189977(0x12b)+_0x57e868['cause']),0x1;throw _0x57e868;}}}export class WorkflowKillCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x104);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x13c);async[a32_0x13ff80(0x148)](_0x291f6c){const _0x20bf25=a32_0x13ff80,{options:_0xad14f5,args:_0x18e9cb,tdx:_0x1ab9ef}=_0x291f6c,_0x1fc624=_0x18e9cb[0x0];if(!_0x1fc624)return console[_0x20bf25(0x119)](_0x20bf25(0x161)),0x1;try{const _0x302565=_0xad14f5[_0x20bf25(0x13b)];_0xad14f5[_0x20bf25(0x145)]&&(console[_0x20bf25(0x119)](_0x20bf25(0x121)+_0x1fc624),_0x302565&&console['error'](_0x20bf25(0xef)+_0x302565));if(!_0xad14f5['yes']){const _0x3d7018=await confirm(_0x20bf25(0x12f)+_0x1fc624+'?');if(!_0x3d7018)return console['error']('Cancelled'),0x0;}const _0x498b51=await withSpinner(_0x20bf25(0x117),()=>_0x1ab9ef['workflow']['kill'](_0x1fc624,_0x302565),{'verbose':_0xad14f5[_0x20bf25(0x145)]}),_0x2a5d24=_0x498b51[_0x20bf25(0x130)];return console[_0x20bf25(0x119)]('✔\x20'+_0x2a5d24),0x0;}catch(_0x244f53){if(_0x244f53 instanceof SDKError)return console[_0x20bf25(0x119)](_0x20bf25(0x138)+_0x244f53[_0x20bf25(0xf2)]),_0x244f53[_0x20bf25(0x125)]&&console[_0x20bf25(0x119)](_0x20bf25(0x12b)+_0x244f53['cause']),0x1;throw _0x244f53;}}}export class WorkflowRetryCommand extends BaseCommand{[a32_0x13ff80(0x11f)]=a32_0x13ff80(0x100);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x122);async[a32_0x13ff80(0x148)](_0x3a5c9d){const _0x23fe0c=a32_0x13ff80,{options:_0x4d3ab2,args:_0x56c616,tdx:_0x6ec883}=_0x3a5c9d,_0x35135b=_0x56c616[0x0];if(!_0x35135b)return console[_0x23fe0c(0x119)](_0x23fe0c(0x14a)),console[_0x23fe0c(0x119)](_0x23fe0c(0x143)),0x1;let _0x7c7eb4=![],_0x1c7b4b=_0x35135b;if(_0x35135b[_0x23fe0c(0x108)](_0x23fe0c(0x107)))_0x7c7eb4=!![],_0x1c7b4b=_0x35135b[_0x23fe0c(0x150)](0x8);else{if(_0x35135b[_0x23fe0c(0x108)]('attempt:'))_0x7c7eb4=![],_0x1c7b4b=_0x35135b[_0x23fe0c(0x150)](0x8);else return console[_0x23fe0c(0x119)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x53b80f=_0x4d3ab2[_0x23fe0c(0x10a)],_0x26dfd7=_0x4d3ab2['resumeFrom'],_0x4f2d6f=_0x4d3ab2[_0x23fe0c(0x147)],_0xf664e8=_0x4d3ab2['force'];_0x4d3ab2[_0x23fe0c(0x145)]&&(console[_0x23fe0c(0x119)](_0x23fe0c(0xee)+(_0x7c7eb4?'session':_0x23fe0c(0x112))+'\x20'+_0x1c7b4b),_0x53b80f&&console['error'](_0x23fe0c(0x144)+_0x53b80f),_0x26dfd7&&console[_0x23fe0c(0x119)](_0x23fe0c(0xec)+_0x26dfd7),_0x4f2d6f&&console[_0x23fe0c(0x119)](_0x23fe0c(0x12a)+_0x4f2d6f),_0xf664e8&&console[_0x23fe0c(0x119)]('Force:\x20yes'));let _0x529e18;if(_0x4f2d6f)try{if(_0x4f2d6f[_0x23fe0c(0x108)]('@')){const _0x481a5c=await import(_0x23fe0c(0x131)),_0x2032f0=_0x4f2d6f[_0x23fe0c(0x150)](0x1),_0x299c2b=await _0x481a5c[_0x23fe0c(0xea)](_0x2032f0,'utf-8');_0x529e18=JSON['parse'](_0x299c2b);}else _0x529e18=JSON[_0x23fe0c(0x15a)](_0x4f2d6f);}catch{return console[_0x23fe0c(0x119)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4d3ab2[_0x23fe0c(0x14b)]){const _0x3afedf=await confirm(_0x23fe0c(0x134)+(_0x7c7eb4?_0x23fe0c(0x115):_0x23fe0c(0x112))+'\x20'+_0x1c7b4b+'?');if(!_0x3afedf)return console[_0x23fe0c(0x119)](_0x23fe0c(0x11c)),0x0;}let _0x10fa48;_0x7c7eb4?_0x10fa48=await withSpinner('Retrying\x20session...',()=>_0x6ec883[_0x23fe0c(0x155)][_0x23fe0c(0x116)](_0x1c7b4b,{'fromTask':_0x53b80f,'retryParams':_0x529e18}),{'verbose':_0x4d3ab2[_0x23fe0c(0x145)]}):_0x10fa48=await withSpinner('Retrying\x20attempt...',()=>_0x6ec883['workflow'][_0x23fe0c(0x14c)](_0x1c7b4b,{'resumeFrom':_0x26dfd7,'retryParams':_0x529e18,'force':_0xf664e8}),{'verbose':_0x4d3ab2['verbose']});const _0x273fbb=_0x10fa48['data'];return console[_0x23fe0c(0x119)](_0x23fe0c(0x152)),console[_0x23fe0c(0x119)](_0x23fe0c(0x14e)+_0x273fbb[_0x23fe0c(0x101)]),console[_0x23fe0c(0x119)](_0x23fe0c(0xf1)+_0x273fbb[_0x23fe0c(0x169)]),0x0;}catch(_0x3c068a){if(_0x3c068a instanceof SDKError)return console[_0x23fe0c(0x119)](_0x23fe0c(0x138)+_0x3c068a[_0x23fe0c(0xf2)]),_0x3c068a['cause']&&console['error'](_0x23fe0c(0x12b)+_0x3c068a[_0x23fe0c(0x125)]),0x1;throw _0x3c068a;}}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a32_0x13ff80(0x13f);[a32_0x13ff80(0xf4)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a32_0x13ff80(0x148)](_0x569239){const _0x12cd62=a32_0x13ff80,{options:_0x42c0e7,args:_0xc604cb,tdx:_0x3f3c4a}=_0x569239,_0x2cbfa5=_0xc604cb[0x0],_0x3cce60=_0xc604cb[0x1]||'.';if(!_0x2cbfa5)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x12cd62(0x157)),0x1;const _0x1ad6a7=_0x42c0e7[_0x12cd62(0x159)];_0x42c0e7[_0x12cd62(0x145)]&&(console[_0x12cd62(0x119)](_0x12cd62(0x168)+_0x2cbfa5),console['error'](_0x12cd62(0xf7)+_0x3cce60),_0x1ad6a7&&console['error']('Revision:\x20'+_0x1ad6a7));const _0x30aedd=await withSpinner(_0x12cd62(0xfd)+_0x2cbfa5+_0x12cd62(0xff),()=>_0x3f3c4a[_0x12cd62(0x155)]['download'](_0x2cbfa5,_0x3cce60,{'revision':_0x1ad6a7}),{'verbose':_0x42c0e7[_0x12cd62(0x145)]}),_0x5df2f0=_0x30aedd['data'];return console[_0x12cd62(0x119)]('✔\x20Downloaded\x20'+_0x5df2f0['projectName']),console[_0x12cd62(0x119)]('\x20\x20Revision:\x20'+_0x5df2f0[_0x12cd62(0x159)]),console[_0x12cd62(0x119)](_0x12cd62(0x118)+_0x5df2f0[_0x12cd62(0xfc)]),console[_0x12cd62(0x119)](_0x12cd62(0x166)+_0x3cce60+'/'+_0x5df2f0['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a32_0x13ff80(0x123);[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x164);async['execute'](_0x15a28a){const _0x371bde=a32_0x13ff80,{options:_0x292120,args:_0x389934,tdx:_0x553069}=_0x15a28a;let _0xb02b5d='.',_0x301b63=_0x292120[_0x371bde(0x11f)];if(_0x389934[0x0]){const {promises:_0x34381f}=await import('fs');try{const _0x90c398=await _0x34381f[_0x371bde(0xfe)](_0x389934[0x0]);if(_0x90c398['isDirectory']())_0xb02b5d=_0x389934[0x0];else return console[_0x371bde(0x119)](_0x371bde(0x138)+_0x389934[0x0]+_0x371bde(0x13a)),0x1;}catch{_0x301b63=_0x389934[0x0],_0xb02b5d='.';}}const _0x598583=_0x292120['revision'],_0x4d0813=_0x292120[_0x371bde(0x132)];_0x292120[_0x371bde(0x145)]&&(console[_0x371bde(0x119)](_0x371bde(0x135)+_0xb02b5d),_0x301b63&&console[_0x371bde(0x119)](_0x371bde(0x142)+_0x301b63),_0x598583&&console[_0x371bde(0x119)](_0x371bde(0x146)+_0x598583),_0x4d0813&&console['error'](_0x371bde(0x102)));const _0x2ce089=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x553069['workflow']['push'](_0xb02b5d,{'projectName':_0x301b63,'revision':_0x598583,'skipValidation':_0x4d0813}),{'verbose':_0x292120[_0x371bde(0x145)]}),_0x24ec96=_0x2ce089['data'];return console[_0x371bde(0x119)]('✔\x20Pushed\x20'+_0x24ec96[_0x371bde(0x15e)]),console[_0x371bde(0x119)](_0x371bde(0x163)+_0x24ec96[_0x371bde(0x139)]),console[_0x371bde(0x119)]('\x20\x20Revision:\x20'+_0x24ec96['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x13ff80(0x11f)]='workflow:delete';[a32_0x13ff80(0xf4)]=a32_0x13ff80(0x153);async[a32_0x13ff80(0x148)](_0xe45c45){const _0x4193ea=a32_0x13ff80,{options:_0x1518c2,args:_0x1c3784,tdx:_0x4620b9}=_0xe45c45,_0x2804e8=_0x1c3784[0x0];if(!_0x2804e8)return console['error'](_0x4193ea(0x12e)),console[_0x4193ea(0x119)](_0x4193ea(0x14d)),0x1;_0x1518c2[_0x4193ea(0x145)]&&console[_0x4193ea(0x119)]('Project:\x20'+_0x2804e8);if(!_0x1518c2['yes']){const _0x1eb0a5=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2804e8+_0x4193ea(0xf5));if(!_0x1eb0a5)return console[_0x4193ea(0x119)](_0x4193ea(0x11c)),0x0;}const _0x205c8f=await withSpinner(_0x4193ea(0xe8)+_0x2804e8+_0x4193ea(0xff),()=>_0x4620b9[_0x4193ea(0x155)][_0x4193ea(0x13e)](_0x2804e8),{'verbose':_0x1518c2['verbose']}),_0x2bac2a=_0x205c8f[_0x4193ea(0x130)];return console[_0x4193ea(0x119)](_0x4193ea(0x10c)+_0x2bac2a[_0x4193ea(0x15e)]),console[_0x4193ea(0x119)]('\x20\x20Project\x20ID:\x20'+_0x2bac2a[_0x4193ea(0x139)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x51491f,_0xb6c1a1){const _0x50506a=a33_0x2703,_0x1ab7d0=_0x51491f();while(!![]){try{const _0x202a97=parseInt(_0x50506a(0x74))/0x1+-parseInt(_0x50506a(0x80))/0x2+-parseInt(_0x50506a(0x75))/0x3+parseInt(_0x50506a(0x85))/0x4*(-parseInt(_0x50506a(0x79))/0x5)+parseInt(_0x50506a(0x7b))/0x6+parseInt(_0x50506a(0x7e))/0x7*(parseInt(_0x50506a(0x76))/0x8)+-parseInt(_0x50506a(0x82))/0x9;if(_0x202a97===_0xb6c1a1)break;else _0x1ab7d0['push'](_0x1ab7d0['shift']());}catch(_0x26801d){_0x1ab7d0['push'](_0x1ab7d0['shift']());}}}(a33_0x9b54,0xae672));import{platform}from'os';function a33_0x2703(_0x115401,_0x26ca7d){const _0x9b54aa=a33_0x9b54();return a33_0x2703=function(_0x270388,_0x164471){_0x270388=_0x270388-0x72;let _0x3d5c66=_0x9b54aa[_0x270388];return _0x3d5c66;},a33_0x2703(_0x115401,_0x26ca7d);}import{readFileSync}from'fs';function a33_0x9b54(){const _0x1f5366=['5157576LHGDDH','replace','parse','381724ZQIrAC','TD1\x20','tdx','tdx/','1202956FdSitZ','196674qbYtXs','10875688IYxAEd','version','X-Trino-User','55VOJyhU','../../package.json','789888YeXWWn',';\x20node/','0.0.0','7iPrqpO','entries','582696GiLWyN','Authorization'];a33_0x9b54=function(){return _0x1f5366;};return a33_0x9b54();}import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x34a74f=a33_0x2703;try{const _0x23754d=fileURLToPath(import.meta['url']),_0x50f3b7=dirname(_0x23754d),_0x43ac12=join(_0x50f3b7,_0x34a74f(0x7a)),_0x12c26b=JSON[_0x34a74f(0x84)](readFileSync(_0x43ac12,'utf-8'));return _0x12c26b[_0x34a74f(0x77)];}catch{return _0x34a74f(0x7d);}}export function getUserAgent(){const _0x131b69=a33_0x2703,_0x199064=getVersion(),_0x179aa8=platform(),_0x45da9e=process[_0x131b69(0x77)][_0x131b69(0x83)]('v','');return _0x131b69(0x73)+_0x199064+'\x20('+_0x179aa8+_0x131b69(0x7c)+_0x45da9e+')';}export function getAuthHeaders(_0x1fd158,_0x2dd082){const _0x262b1a=a33_0x2703,_0x5eed6e=getVersion(),_0x26d7e2={'User-Agent':getUserAgent(),'X-TD-Client':_0x262b1a(0x72),'X-TD-Client-Version':_0x5eed6e};return _0x2dd082&&(_0x26d7e2[_0x262b1a(0x81)]=_0x262b1a(0x86)+_0x2dd082),_0x26d7e2;}export function toHeaderRecord(_0x1c71e6){const _0x59b7c8=a33_0x2703,_0x160c3c={};for(const [_0x90bbb8,_0x557883]of Object[_0x59b7c8(0x7f)](_0x1c71e6)){_0x557883!==undefined&&(_0x160c3c[_0x90bbb8]=_0x557883);}return _0x160c3c;}export function getTrinoHeaders(_0xe12c77,_0x50ea2){const _0x55e0e2=a33_0x2703,_0x4bd014=getAuthHeaders(_0xe12c77,_0x50ea2),_0x2b66f3=toHeaderRecord(_0x4bd014);return delete _0x2b66f3['Authorization'],_0x50ea2&&(_0x2b66f3[_0x55e0e2(0x78)]=_0x50ea2),_0x2b66f3;}export function hasAPIKey(_0x3bcda8){const _0x2dffc4=getAPIKey(_0x3bcda8);return _0x2dffc4!==undefined&&_0x2dffc4['length']>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x256c06,_0x26f134){const _0x15e2bf=a34_0x5b66,_0x19a156=_0x256c06();while(!![]){try{const _0x766012=-parseInt(_0x15e2bf(0x12f))/0x1+parseInt(_0x15e2bf(0x123))/0x2+-parseInt(_0x15e2bf(0x107))/0x3+-parseInt(_0x15e2bf(0x10d))/0x4*(-parseInt(_0x15e2bf(0x10a))/0x5)+-parseInt(_0x15e2bf(0x11d))/0x6+-parseInt(_0x15e2bf(0x11e))/0x7*(-parseInt(_0x15e2bf(0x132))/0x8)+parseInt(_0x15e2bf(0x115))/0x9;if(_0x766012===_0x26f134)break;else _0x19a156['push'](_0x19a156['shift']());}catch(_0x497d6a){_0x19a156['push'](_0x19a156['shift']());}}}(a34_0x348d,0xab8a3));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a34_0xf7e83b from'node:fs';import*as a34_0x4e978a from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x38b679=a34_0x5b66;return process[_0x38b679(0x10b)][_0x38b679(0x119)]||join(homedir(),_0x38b679(0x12a),'tdx');}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getCacheDir(){const _0x46d0f9=a34_0x5b66;return process['env']['TDX_CACHE_DIR']||join(homedir(),'.cache',_0x46d0f9(0x105));}export function getLLMProjectCacheFile(){const _0x3dd226=a34_0x5b66;return join(getCacheDir(),_0x3dd226(0x116));}export function readCachedLLMProject(){const _0x4da9ff=a34_0x5b66;try{const _0x4c7494=getLLMProjectCacheFile();if(!existsSync(_0x4c7494))return null;return readFileSync(_0x4c7494,_0x4da9ff(0x114))[_0x4da9ff(0x12b)]();}catch{return null;}}export function writeCachedLLMProject(_0xe0c000){const _0x373dbc=a34_0x5b66;try{const _0x11a915=getCacheDir(),_0x168eaa=getLLMProjectCacheFile();!existsSync(_0x11a915)&&mkdirSync(_0x11a915,{'recursive':!![]}),writeFileSync(_0x168eaa,_0xe0c000,_0x373dbc(0x114));}catch(_0x78577a){console[_0x373dbc(0x121)](_0x373dbc(0x10f),_0x78577a);}}export function parseEnvFile(_0x563a69){const _0x238d18=a34_0x5b66,_0xb9a35={};for(const _0x1b1eb0 of _0x563a69[_0x238d18(0x136)]('\x0a')){const _0x58a6aa=_0x1b1eb0[_0x238d18(0x12b)]();if(!_0x58a6aa||_0x58a6aa[_0x238d18(0x10e)]('#'))continue;const _0x4b46e6=_0x58a6aa[_0x238d18(0x11c)](/^([^=]+)=(.*)$/);if(_0x4b46e6){const _0x283953=_0x4b46e6[0x1][_0x238d18(0x12b)]();let _0x285347=_0x4b46e6[0x2][_0x238d18(0x12b)]();(_0x285347[_0x238d18(0x10e)]('\x22')&&_0x285347[_0x238d18(0x125)]('\x22')||_0x285347[_0x238d18(0x10e)]('\x27')&&_0x285347[_0x238d18(0x125)]('\x27'))&&(_0x285347=_0x285347[_0x238d18(0x120)](0x1,-0x1)),_0xb9a35[_0x283953]=_0x285347;}}return _0xb9a35;}export function readUserConfig(){const _0x300db6=a34_0x5b66,_0x222d28=getConfigFile();if(!existsSync(_0x222d28))return{};try{const _0x5c9798=readFileSync(_0x222d28,'utf-8');return parseEnvFile(_0x5c9798);}catch(_0x3243a0){return console[_0x300db6(0x118)](_0x300db6(0x124)+_0x222d28+':',_0x3243a0),{};}}export function resolveSite(_0x3493d3){const _0x3d76a4=a34_0x5b66,_0x38120a=[_0x3d76a4(0x101),_0x3d76a4(0x108),_0x3d76a4(0x117),_0x3d76a4(0x104),_0x3d76a4(0x100),_0x3d76a4(0x12e),_0x3d76a4(0x11a),_0x3d76a4(0x110),_0x3d76a4(0x10c),_0x3d76a4(0x134)];if(_0x38120a[_0x3d76a4(0x103)](_0x3493d3))return _0x3493d3;if(_0x3493d3 in SITE_ALIASES)return SITE_ALIASES[_0x3493d3];return console[_0x3d76a4(0x118)]('Warning:\x20Unknown\x20site\x20\x27'+_0x3493d3+'\x27,\x20defaulting\x20to\x20us01'),_0x3d76a4(0x101);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x3857fc,_0x47247e){const _0x1a421e=a34_0x5b66,_0x1aaefa=_0x3857fc[_0x1a421e(0x11f)]()[_0x1a421e(0x11b)](/-/g,'_'),_0x3019da=_0x1a421e(0x111)+_0x1aaefa;if(process[_0x1a421e(0x10b)][_0x3019da])return process['env'][_0x3019da];if(process['env'][_0x1a421e(0x128)])return process['env'][_0x1a421e(0x128)];const _0x1cbdd1=_0x47247e||getActiveProfileName();if(_0x1cbdd1){const _0x2bf240=loadProfileEnv(_0x1cbdd1);if(_0x2bf240){if(_0x2bf240[_0x3019da])return _0x2bf240[_0x3019da];if(_0x2bf240[_0x1a421e(0x128)])return _0x2bf240['TD_API_KEY'];}}const _0x19a71d=loadUserConfigOnce();if(_0x19a71d[_0x3019da])return _0x19a71d[_0x3019da];if(_0x19a71d[_0x1a421e(0x128)])return _0x19a71d[_0x1a421e(0x128)];return undefined;}export function getAPIKeySource(_0xc02085,_0x2a4c0b){const _0x57f580=a34_0x5b66,_0x48750e=_0x57f580(0x111)+_0xc02085[_0x57f580(0x11f)]()[_0x57f580(0x11b)](/-/g,'_');if(process['env'][_0x48750e])return _0x57f580(0x109)+_0x48750e;if(process[_0x57f580(0x10b)]['TD_API_KEY'])return _0x57f580(0x12d);const _0x2befb9=_0x2a4c0b||getActiveProfileName();if(_0x2befb9){const _0x30b12c=loadProfileEnv(_0x2befb9);if(_0x30b12c){if(_0x30b12c[_0x48750e])return _0x57f580(0x102)+_0x2befb9+'\x20('+_0x48750e+')';if(_0x30b12c[_0x57f580(0x128)])return _0x57f580(0x102)+_0x2befb9+_0x57f580(0x112);}}const _0x9b2f2d=loadUserConfigOnce(),_0x284982=getConfigFile();if(_0x9b2f2d[_0x48750e])return _0x57f580(0x122)+_0x284982+'\x20('+_0x48750e+')';if(_0x9b2f2d[_0x57f580(0x128)])return _0x57f580(0x122)+_0x284982+'\x20(TD_API_KEY)';return null;}function loadProfileEnv(_0x596582){const _0x3cfee5=a34_0x5b66,_0x437bbb=a34_0x4e978a['join'](getConfigDir(),_0x3cfee5(0x129)+_0x596582);if(a34_0xf7e83b['existsSync'](_0x437bbb)){validateSecureFilePermissions(_0x437bbb);try{const _0x3a9e9c=a34_0xf7e83b[_0x3cfee5(0x131)](_0x437bbb,_0x3cfee5(0x114));return parseEnvFile(_0x3a9e9c);}catch(_0x410032){console[_0x3cfee5(0x118)](_0x3cfee5(0x12c)+_0x437bbb+':\x20'+_0x410032);}}const _0x388db0=a34_0x4e978a[_0x3cfee5(0x135)](getConfigDir(),_0x3cfee5(0x113),_0x596582,'.env');if(a34_0xf7e83b[_0x3cfee5(0x130)](_0x388db0)){validateSecureFilePermissions(_0x388db0);try{const _0x3238c8=a34_0xf7e83b[_0x3cfee5(0x131)](_0x388db0,'utf-8');return parseEnvFile(_0x3238c8);}catch(_0x2da45a){return console[_0x3cfee5(0x118)](_0x3cfee5(0x12c)+_0x388db0+':\x20'+_0x2da45a),null;}}return null;}function getActiveProfileName(){const _0x2e712d=a34_0x5b66,_0x59e967=a34_0x4e978a['join'](getConfigDir(),'tdx.json');if(!a34_0xf7e83b[_0x2e712d(0x130)](_0x59e967))return null;try{const _0x106592=a34_0xf7e83b[_0x2e712d(0x131)](_0x59e967,'utf-8'),_0x5b80a3=JSON[_0x2e712d(0x106)](_0x106592);return _0x5b80a3[_0x2e712d(0x127)]||null;}catch{return null;}}export function saveAPIKey(_0x1e7bd7,_0x575ce4){const _0x11697e=a34_0x5b66,_0x51c664=getConfigDir(),_0x3242a7=getConfigFile();!existsSync(_0x51c664)&&mkdirSync(_0x51c664,{'recursive':!![],'mode':0x1c0});const _0x1b118c=readUserConfig(),_0x30f4ea=_0x1e7bd7[_0x11697e(0x11f)]()[_0x11697e(0x11b)](/-/g,'_');_0x1b118c[_0x11697e(0x111)+_0x30f4ea]=_0x575ce4;const _0x3518e3=Object['entries'](_0x1b118c)[_0x11697e(0x126)](([_0x433ad8,_0x11b2bd])=>_0x433ad8+'='+_0x11b2bd);writeFileSync(_0x3242a7,_0x3518e3['join']('\x0a')+'\x0a',{'mode':0x180});}function a34_0x5b66(_0x303428,_0x22c55f){const _0x348d20=a34_0x348d();return a34_0x5b66=function(_0x5b6623,_0x16ecf5){_0x5b6623=_0x5b6623-0x100;let _0x188893=_0x348d20[_0x5b6623];return _0x188893;},a34_0x5b66(_0x303428,_0x22c55f);}export function loadConfig(){const _0x3bf834=a34_0x5b66,_0x43462e={'apiKeys':{},'defaultSite':_0x3bf834(0x101)},_0x338dc6=[_0x3bf834(0x101),_0x3bf834(0x108),_0x3bf834(0x117),_0x3bf834(0x104),'ap03','dev-us01',_0x3bf834(0x11a),_0x3bf834(0x110),_0x3bf834(0x10c),_0x3bf834(0x134)];for(const _0x47064c of _0x338dc6){const _0x2ff546=getAPIKey(_0x47064c);_0x2ff546&&(_0x43462e[_0x3bf834(0x133)][_0x47064c]=_0x2ff546);}return _0x43462e;}function a34_0x348d(){const _0x28bd5d=['existsSync','readFileSync','38992nlpOfB','apiKeys','stg-ap03','join','split','ap03','us01','profile:\x20','includes','ap02','tdx','parse','4157544FCdcie','jp01','env:\x20','85sQTjvd','env','stg-jp01','45804WRIzRr','startsWith','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','stg-us01','TD_API_KEY_','\x20(TD_API_KEY)','profiles','utf-8','15238737pEqPEf','llm_default_project','eu01','warn','TDX_CONFIG_DIR','dev-eu01','replace','match','5990292BJreIV','1603ncJtUI','toUpperCase','slice','error','global:\x20','2777608CyleiC','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','endsWith','map','profile','TD_API_KEY','.env.','.config','trim','Warning:\x20Failed\x20to\x20load\x20','env:\x20TD_API_KEY','dev-us01','1305953MaaywJ'];a34_0x348d=function(){return _0x28bd5d;};return a34_0x348d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x55e126=a35_0xddc7;(function(_0x5da368,_0x2c5fc0){const _0x32ea73=a35_0xddc7,_0x2212c1=_0x5da368();while(!![]){try{const _0x3d29aa=parseInt(_0x32ea73(0xc5))/0x1+-parseInt(_0x32ea73(0xd7))/0x2*(parseInt(_0x32ea73(0xbb))/0x3)+parseInt(_0x32ea73(0xc0))/0x4+parseInt(_0x32ea73(0xce))/0x5*(parseInt(_0x32ea73(0xbf))/0x6)+parseInt(_0x32ea73(0xbc))/0x7+parseInt(_0x32ea73(0xdf))/0x8+-parseInt(_0x32ea73(0xcf))/0x9;if(_0x3d29aa===_0x2c5fc0)break;else _0x2212c1['push'](_0x2212c1['shift']());}catch(_0x1cf9cf){_0x2212c1['push'](_0x2212c1['shift']());}}}(a35_0x57bb,0xe72bf));import{resolveSite,getAPIKey,getConfigDir}from'./config.js';import{loadSessionContext}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a35_0x57bb(){const _0x549d28=['5fbIeZw','13283424kKstwB','profile:\x20','global','profile','displayWithSources','configFiles','apiKey','join','3397222GLVAgB','log','display','getParameters','Global','Project','.json','not\x20set','5729096NEObXA','default','[context]','session','layers',':\x20none','parent_segment','us01','utf-8','verbose','site','sessions','loadGlobalConfig',':\x20none\x20(using\x20session:\x20','tdx.json','replace','activeProfile','toString','existsSync','.env','Session','sessionId','segmentPath','project','3ToVlun','10704351IplkkA','readFileSync','database','369804nCSEvv','3186048rXpbWN','entries','\x0a[configuration\x20files]','llmProject','cliFlags','1017950oxOaOv','globalCredentials','Profile\x20Credentials','parentSegment','ppid','segment_path','(active)','profiles','llm_project'];a35_0x57bb=function(){return _0x549d28;};return a35_0x57bb();}import{getActiveProfile,loadProfile}from'./profile.js';import*as a35_0x3da532 from'node:fs';function a35_0xddc7(_0x1148b6,_0x4f624b){const _0x57bbc0=a35_0x57bb();return a35_0xddc7=function(_0xddc73c,_0x6f2a7c){_0xddc73c=_0xddc73c-0xb1;let _0x3ad54e=_0x57bbc0[_0xddc73c];return _0x3ad54e;},a35_0xddc7(_0x1148b6,_0x4f624b);}import*as a35_0x4d5475 from'node:path';export class GlobalContext{[a35_0x55e126(0xe9)];[a35_0x55e126(0xbe)];['parent_segment'];[a35_0x55e126(0xca)];[a35_0x55e126(0xcd)];['apiKey'];[a35_0x55e126(0xe8)];[a35_0x55e126(0xe3)];[a35_0x55e126(0xb3)];[a35_0x55e126(0xb8)];[a35_0x55e126(0xd4)];constructor(_0x341e69){const _0x2ec2cf=a35_0x55e126;this['sessionId']=_0x341e69[_0x2ec2cf(0xe2)]||process[_0x2ec2cf(0xc9)][_0x2ec2cf(0xb4)]();const _0x4e251f=loadSessionContext(_0x341e69[_0x2ec2cf(0xe2)]),_0x14c615=loadProjectConfig(),_0x489b1d=this[_0x2ec2cf(0xeb)]();this[_0x2ec2cf(0xb3)]=_0x341e69['profile']||_0x4e251f?.[_0x2ec2cf(0xd2)]||_0x489b1d[_0x2ec2cf(0xd2)]||getActiveProfile();const _0x5e0d99=this['activeProfile']?loadProfile(this[_0x2ec2cf(0xb3)]):null,_0x5681f8=_0x25c521=>{const _0x23c88c=_0x2ec2cf;if(!_0x25c521)return{};const _0x5e395d=_0x25c521,_0x301f9f={};for(const [_0x18b351,_0x4c70e5]of Object[_0x23c88c(0xc1)](_0x5e395d)){typeof _0x4c70e5==='string'&&(_0x301f9f[_0x18b351]=_0x4c70e5);}return _0x301f9f;},_0x386044={};if(_0x341e69[_0x2ec2cf(0xe9)]&&_0x341e69['site']!==_0x2ec2cf(0xe6))_0x386044['site']=_0x341e69[_0x2ec2cf(0xe9)];const _0x17f5ed=_0x4e251f?.[_0x2ec2cf(0xbe)],_0x45acd3=_0x14c615?.[_0x2ec2cf(0xbe)],_0x4e8747=_0x5e0d99?.['config']?.[_0x2ec2cf(0xbe)],_0x19f0c0=_0x489b1d[_0x2ec2cf(0xbe)];_0x341e69[_0x2ec2cf(0xbe)]&&(_0x341e69[_0x2ec2cf(0xbe)]!==_0x17f5ed&&_0x341e69['database']!==_0x45acd3&&_0x341e69[_0x2ec2cf(0xbe)]!==_0x4e8747&&_0x341e69[_0x2ec2cf(0xbe)]!==_0x19f0c0)&&(_0x386044['database']=_0x341e69[_0x2ec2cf(0xbe)]);if(_0x341e69[_0x2ec2cf(0xc8)])_0x386044[_0x2ec2cf(0xe5)]=_0x341e69[_0x2ec2cf(0xc8)];if(_0x341e69[_0x2ec2cf(0xc3)])_0x386044['llm_project']=_0x341e69[_0x2ec2cf(0xc3)];if(_0x341e69[_0x2ec2cf(0xd2)])_0x386044[_0x2ec2cf(0xd2)]=_0x341e69[_0x2ec2cf(0xd2)];this[_0x2ec2cf(0xe3)]={'cliFlags':_0x386044,'session':_0x5681f8(_0x4e251f),'project':_0x5681f8(_0x14c615),'profile':_0x5681f8(_0x5e0d99?.['config']),'global':_0x5681f8(_0x489b1d)};const _0xb1fa06={...this[_0x2ec2cf(0xe3)][_0x2ec2cf(0xd1)],...this[_0x2ec2cf(0xe3)][_0x2ec2cf(0xd2)],...this[_0x2ec2cf(0xe3)]['project'],...this[_0x2ec2cf(0xe3)]['session'],...this[_0x2ec2cf(0xe3)][_0x2ec2cf(0xc4)]},_0x95af35=_0xb1fa06[_0x2ec2cf(0xe9)]||'us01';this['site']=resolveSite(_0x95af35),this['database']=_0xb1fa06[_0x2ec2cf(0xbe)],this[_0x2ec2cf(0xe5)]=_0xb1fa06[_0x2ec2cf(0xe5)],this[_0x2ec2cf(0xca)]=_0xb1fa06[_0x2ec2cf(0xca)],this[_0x2ec2cf(0xcd)]=_0xb1fa06[_0x2ec2cf(0xcd)],this[_0x2ec2cf(0xe8)]=_0x341e69[_0x2ec2cf(0xe8)]||![],this[_0x2ec2cf(0xd5)]=getAPIKey(this[_0x2ec2cf(0xe9)],this['activeProfile']||undefined);const _0x6ff728=getConfigDir(),_0x24851c=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xea),this['sessionId']+_0x2ec2cf(0xdd)),_0x5ca16c=findProjectConfigPath(),_0x3b7cf5=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xb1)),_0x205660=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xb6));let _0x464ad9=null,_0xdea19d=null;this[_0x2ec2cf(0xb3)]&&(_0x464ad9=a35_0x4d5475[_0x2ec2cf(0xd6)](_0x6ff728,_0x2ec2cf(0xcc),this[_0x2ec2cf(0xb3)],'tdx.json'),_0xdea19d=a35_0x4d5475['join'](_0x6ff728,_0x2ec2cf(0xcc),this[_0x2ec2cf(0xb3)],_0x2ec2cf(0xb6))),this[_0x2ec2cf(0xd4)]={'session':a35_0x3da532[_0x2ec2cf(0xb5)](_0x24851c)?_0x24851c:null,'project':_0x5ca16c,'profile':_0x464ad9&&a35_0x3da532[_0x2ec2cf(0xb5)](_0x464ad9)?_0x464ad9:null,'profileCredentials':_0xdea19d&&a35_0x3da532['existsSync'](_0xdea19d)?_0xdea19d:null,'global':a35_0x3da532[_0x2ec2cf(0xb5)](_0x3b7cf5)?_0x3b7cf5:null,'globalCredentials':a35_0x3da532[_0x2ec2cf(0xb5)](_0x205660)?_0x205660:null};}['getSource'](_0x2d40f1,_0x10d934){const _0x23f330=a35_0x55e126;if(!_0x10d934)return _0x23f330(0xde);const _0x3d8d74=_0x10d934;if(this['layers']['cliFlags'][_0x2d40f1]===_0x3d8d74){if(_0x2d40f1===_0x23f330(0xe9)&&_0x3d8d74===_0x23f330(0xe6)&&!this[_0x23f330(0xe3)][_0x23f330(0xe2)][_0x23f330(0xe9)]&&!this[_0x23f330(0xe3)][_0x23f330(0xba)]['site']&&!this[_0x23f330(0xe3)][_0x23f330(0xd2)][_0x23f330(0xe9)]&&!this[_0x23f330(0xe3)][_0x23f330(0xd1)][_0x23f330(0xe9)])return _0x23f330(0xe0);return'CLI\x20flag:\x20--'+_0x2d40f1[_0x23f330(0xb2)](/_/g,'-');}if(this['layers'][_0x23f330(0xe2)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xe2);if(this[_0x23f330(0xe3)][_0x23f330(0xba)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xba);if(this[_0x23f330(0xe3)][_0x23f330(0xd2)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xd0)+this[_0x23f330(0xb3)];if(this[_0x23f330(0xe3)][_0x23f330(0xd1)][_0x2d40f1]===_0x3d8d74)return _0x23f330(0xd1);return _0x23f330(0xe0);}[a35_0x55e126(0xeb)](){const _0xb93176=a35_0x55e126,_0x29e283=a35_0x4d5475[_0xb93176(0xd6)](getConfigDir(),'tdx.json');if(!a35_0x3da532[_0xb93176(0xb5)](_0x29e283))return{};try{const _0x58d8a8=a35_0x3da532[_0xb93176(0xbd)](_0x29e283,_0xb93176(0xe7));return JSON['parse'](_0x58d8a8);}catch{return{};}}['injectIntoOptions'](_0x19c829){const _0x1e4910=a35_0x55e126;_0x19c829[_0x1e4910(0xe9)]=this[_0x1e4910(0xe9)],!_0x19c829[_0x1e4910(0xbe)]&&this[_0x1e4910(0xbe)]&&(_0x19c829[_0x1e4910(0xbe)]=this[_0x1e4910(0xbe)]),!_0x19c829[_0x1e4910(0xc8)]&&this[_0x1e4910(0xe5)]&&(_0x19c829[_0x1e4910(0xc8)]=this[_0x1e4910(0xe5)]),!_0x19c829[_0x1e4910(0xb9)]&&this[_0x1e4910(0xca)]&&(_0x19c829[_0x1e4910(0xb9)]=this[_0x1e4910(0xca)]),!_0x19c829[_0x1e4910(0xc3)]&&this[_0x1e4910(0xcd)]&&(_0x19c829['llmProject']=this[_0x1e4910(0xcd)]);}[a35_0x55e126(0xda)](){const _0x230eb6=a35_0x55e126;return[{'key':_0x230eb6(0xe9),'value':this[_0x230eb6(0xe9)]},{'key':_0x230eb6(0xbe),'value':this[_0x230eb6(0xbe)]},{'key':_0x230eb6(0xe5),'value':this['parent_segment']},{'key':'segment_path','value':this['segment_path']},{'key':_0x230eb6(0xcd),'value':this[_0x230eb6(0xcd)]},{'key':_0x230eb6(0xd2),'value':this[_0x230eb6(0xb3)]||undefined}];}[a35_0x55e126(0xd9)](){const _0x5812d0=a35_0x55e126;console[_0x5812d0(0xd8)](_0x5812d0(0xe1));for(const {key:_0x25179f,value:_0x29c62f}of this[_0x5812d0(0xda)]()){_0x29c62f&&console[_0x5812d0(0xd8)](_0x25179f+':\x20'+_0x29c62f);}}[a35_0x55e126(0xd3)](){const _0x4f1e41=a35_0x55e126;console[_0x4f1e41(0xd8)](_0x4f1e41(0xe1));for(const {key:_0x5b82f3,value:_0x59814}of this[_0x4f1e41(0xda)]()){if(_0x59814){const _0x39f4bd=_0x5b82f3===_0x4f1e41(0xd2)?_0x4f1e41(0xcb):'('+this['getSource'](_0x5b82f3,_0x59814)+')';console[_0x4f1e41(0xd8)](_0x5b82f3+':\x20'+_0x59814+'\x20'+_0x39f4bd);}}console[_0x4f1e41(0xd8)](_0x4f1e41(0xc2));const _0x32c943=[{'label':_0x4f1e41(0xb7),'path':this[_0x4f1e41(0xd4)]['session'],'extra':'(session:\x20'+this[_0x4f1e41(0xb8)]+')'},{'label':_0x4f1e41(0xdc),'path':this[_0x4f1e41(0xd4)][_0x4f1e41(0xba)]},{'label':'Profile','path':this[_0x4f1e41(0xd4)]['profile']},{'label':_0x4f1e41(0xc7),'path':this[_0x4f1e41(0xd4)]['profileCredentials']},{'label':'Global','path':this[_0x4f1e41(0xd4)]['global']},{'label':'Global\x20Credentials','path':this['configFiles'][_0x4f1e41(0xc6)]}];for(const {label:_0x27f145,path:_0x1e41d2,extra:_0x597ce1}of _0x32c943){if(_0x1e41d2)console[_0x4f1e41(0xd8)](_0x27f145+':\x20'+_0x1e41d2+'\x20✓'+(_0x597ce1?'\x20'+_0x597ce1:''));else{if(_0x27f145==='Session')console['log'](_0x27f145+_0x4f1e41(0xec)+this[_0x4f1e41(0xb8)]+')');else(_0x27f145===_0x4f1e41(0xdc)||_0x27f145===_0x4f1e41(0xdb))&&console[_0x4f1e41(0xd8)](_0x27f145+_0x4f1e41(0xe4));}}}}
|
package/dist/core/profile.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x285938,_0x365251){const _0x170986=a36_0x4313,_0x55452c=_0x285938();while(!![]){try{const _0x941da1=-parseInt(_0x170986(0xd7))/0x1+-parseInt(_0x170986(0xcb))/0x2+-parseInt(_0x170986(0x9d))/0x3+-parseInt(_0x170986(0xce))/0x4*(parseInt(_0x170986(0x98))/0x5)+parseInt(_0x170986(0xb8))/0x6+-parseInt(_0x170986(0xc4))/0x7+parseInt(_0x170986(0xb3))/0x8*(parseInt(_0x170986(0xca))/0x9);if(_0x941da1===_0x365251)break;else _0x55452c['push'](_0x55452c['shift']());}catch(_0x32dcb8){_0x55452c['push'](_0x55452c['shift']());}}}(a36_0x1951,0x770a2));import*as a36_0x3e6cb7 from'node:fs';import*as a36_0x2db0d7 from'node:path';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';export function getProfileParams(_0x5ea232){const _0x1c4eee={};if(!_0x5ea232)return _0x1c4eee;for(const [_0x419cb2,_0x56dec5]of Object['entries'](_0x5ea232)){_0x419cb2!=='description'&&_0x56dec5!==undefined&&(_0x1c4eee[_0x419cb2]=_0x56dec5);}return _0x1c4eee;}export function getProfilesDir(){const _0x24eaad=a36_0x4313;return a36_0x2db0d7[_0x24eaad(0x9a)](getConfigDir(),_0x24eaad(0xa8));}function getProfileDir(_0x1b42bd){const _0x1f4b4e=a36_0x4313;return a36_0x2db0d7[_0x1f4b4e(0x9a)](getProfilesDir(),_0x1b42bd);}function getProfileConfigPath(_0x2f0b22){const _0x4cb190=a36_0x4313;return a36_0x2db0d7['join'](getProfileDir(_0x2f0b22),_0x4cb190(0xdb));}function getProfileEnvPath(_0x3f0888){const _0x51f735=a36_0x4313;return a36_0x2db0d7[_0x51f735(0x9a)](getProfileDir(_0x3f0888),_0x51f735(0xe2));}function getGlobalConfigPath(){return a36_0x2db0d7['join'](getConfigDir(),'tdx.json');}function validateProfileName(_0x3ee3c2){const _0x2ce566=a36_0x4313;if(!/^[a-zA-Z0-9_-]+$/[_0x2ce566(0xd1)](_0x3ee3c2))throw new Error('Invalid\x20profile\x20name:\x20'+_0x3ee3c2+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.');}function validateProfileConfig(_0x1cd1e8,_0x4d9760){const _0x40d26d=a36_0x4313;if(typeof _0x1cd1e8!==_0x40d26d(0xa7)||_0x1cd1e8===null)throw new Error('Profile\x20\x27'+_0x4d9760+_0x40d26d(0xc1));const _0x38c25d=['description',_0x40d26d(0xcd),_0x40d26d(0xd6),_0x40d26d(0xba),_0x40d26d(0xad),_0x40d26d(0xda)],_0x287b81=_0x1cd1e8;for(const _0x4ef549 of Object[_0x40d26d(0xb2)](_0x287b81)){!_0x38c25d[_0x40d26d(0xe3)](_0x4ef549)&&console[_0x40d26d(0xa1)]('Warning:\x20Profile\x20\x27'+_0x4d9760+_0x40d26d(0xa9)+_0x4ef549+_0x40d26d(0xb6));}if(_0x287b81[_0x40d26d(0xbc)]!==undefined&&typeof _0x287b81[_0x40d26d(0xbc)]!==_0x40d26d(0xde))throw new Error(_0x40d26d(0xc9)+_0x4d9760+_0x40d26d(0xb0));if(_0x287b81[_0x40d26d(0xcd)]!==undefined&&typeof _0x287b81[_0x40d26d(0xcd)]!==_0x40d26d(0xde))throw new Error(_0x40d26d(0xc9)+_0x4d9760+_0x40d26d(0xc6));if(_0x287b81[_0x40d26d(0xd6)]!==undefined&&typeof _0x287b81[_0x40d26d(0xd6)]!==_0x40d26d(0xde))throw new Error(_0x40d26d(0xc9)+_0x4d9760+_0x40d26d(0xd0));if(_0x287b81[_0x40d26d(0xba)]!==undefined&&typeof _0x287b81[_0x40d26d(0xba)]!=='string')throw new Error(_0x40d26d(0xc9)+_0x4d9760+'\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string');if(_0x287b81[_0x40d26d(0xad)]!==undefined&&typeof _0x287b81[_0x40d26d(0xad)]!=='string')throw new Error(_0x40d26d(0xc9)+_0x4d9760+_0x40d26d(0xcf));if(_0x287b81['llm_agent']!==undefined&&typeof _0x287b81[_0x40d26d(0xda)]!==_0x40d26d(0xde))throw new Error('Profile\x20\x27'+_0x4d9760+_0x40d26d(0x9c));return!![];}function loadProfilesFromTdxJson(_0xdc63c6,_0x1ad69e){const _0x3f68c6=a36_0x4313;if(!a36_0x3e6cb7[_0x3f68c6(0x9b)](_0xdc63c6))return[];try{const _0x748b87=a36_0x3e6cb7[_0x3f68c6(0xd8)](_0xdc63c6,_0x3f68c6(0xa6)),_0x90f745=JSON[_0x3f68c6(0xae)](_0x748b87);if(!_0x90f745[_0x3f68c6(0xa8)]||typeof _0x90f745['profiles']!==_0x3f68c6(0xa7))return[];const _0x24afee=[];for(const [_0x2a7bbe,_0x432d4d]of Object['entries'](_0x90f745[_0x3f68c6(0xa8)])){try{validateProfileConfig(_0x432d4d,_0x2a7bbe);const _0x2f24b4=getNewCredentialPath(_0x2a7bbe),_0x811535=getOldCredentialPath(_0x2a7bbe),_0x125269=a36_0x3e6cb7[_0x3f68c6(0x9b)](_0x2f24b4)||a36_0x3e6cb7[_0x3f68c6(0x9b)](_0x811535);_0x24afee[_0x3f68c6(0xd4)]({'name':_0x2a7bbe,'config':_0x432d4d,'metadata':{'name':_0x2a7bbe,'createdAt':new Date()[_0x3f68c6(0xa2)]()},'hasCredentials':_0x125269,'scope':_0x1ad69e});}catch(_0x486fb0){_0x486fb0 instanceof Error&&(console[_0x3f68c6(0xa1)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0xdc63c6+':'),console['warn']('\x20\x20'+_0x486fb0['message']+'\x0a'));}}return _0x24afee;}catch(_0x1f3e93){return _0x1f3e93 instanceof SyntaxError?(console[_0x3f68c6(0xa1)](_0x3f68c6(0xd3)+_0xdc63c6+_0x3f68c6(0xb7)),console[_0x3f68c6(0xa1)](_0x3f68c6(0xbb)+_0x1f3e93[_0x3f68c6(0xbd)]+'\x0a')):console[_0x3f68c6(0xa1)](_0x3f68c6(0xb9)+_0xdc63c6+':\x20'+_0x1f3e93+'\x0a'),[];}}function a36_0x4313(_0x4241b7,_0x156557){const _0x195140=a36_0x1951();return a36_0x4313=function(_0x43131d,_0x11fbe2){_0x43131d=_0x43131d-0x98;let _0x17c187=_0x195140[_0x43131d];return _0x17c187;},a36_0x4313(_0x4241b7,_0x156557);}export function getNewCredentialPath(_0x2ace4d){const _0x176ff0=a36_0x4313;return a36_0x2db0d7[_0x176ff0(0x9a)](getConfigDir(),_0x176ff0(0xc7)+_0x2ace4d);}function getOldCredentialPath(_0x32e9b7){const _0x16143d=a36_0x4313;return a36_0x2db0d7[_0x16143d(0x9a)](getProfilesDir(),_0x32e9b7,_0x16143d(0xe2));}function loadProfilesFromTdxJsonFiles(){const _0x50952f=a36_0x4313,_0x2f6a60=[],_0x2a3459=findProjectConfigPath();_0x2a3459&&_0x2f6a60[_0x50952f(0xd4)](...loadProfilesFromTdxJson(_0x2a3459,_0x50952f(0xe4)));const _0x59df24=a36_0x2db0d7['join'](getConfigDir(),_0x50952f(0xdb));return _0x2f6a60[_0x50952f(0xd4)](...loadProfilesFromTdxJson(_0x59df24,_0x50952f(0xb4))),_0x2f6a60;}function loadProfilesFromDirectories(){const _0x3ae9d6=a36_0x4313,_0x4adceb=getProfilesDir();if(!a36_0x3e6cb7[_0x3ae9d6(0x9b)](_0x4adceb))return[];try{return a36_0x3e6cb7[_0x3ae9d6(0xc8)](_0x4adceb,{'withFileTypes':!![]})[_0x3ae9d6(0xa5)](_0x44209d=>_0x44209d[_0x3ae9d6(0xc2)]())['map'](_0x30d09c=>_0x30d09c[_0x3ae9d6(0xdc)])[_0x3ae9d6(0xa5)](_0x157e46=>{const _0x2f583d=_0x3ae9d6,_0x26a4e3=getProfileConfigPath(_0x157e46),_0x27d98a=getProfileEnvPath(_0x157e46);return a36_0x3e6cb7['existsSync'](_0x26a4e3)||a36_0x3e6cb7[_0x2f583d(0x9b)](_0x27d98a);})[_0x3ae9d6(0xd9)](_0x4a5a1b=>{const _0x263dc5=_0x3ae9d6,_0xa53447=loadProfileFromDirectory(_0x4a5a1b);if(_0xa53447)return{..._0xa53447,'scope':_0x263dc5(0xbe)};return null;})[_0x3ae9d6(0xa5)](_0xc5efbd=>_0xc5efbd!==null);}catch{return[];}}function a36_0x1951(){const _0x529cb3=['readFileSync','map','llm_agent','tdx.json','name','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20profile\x20configuration.\x20Use\x20.env\x20file\x20instead.','string','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','\x20already\x20exists','lastUsed','.env','includes','local','5GRcben','To\x20migrate:','join','existsSync','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','2075487uJQyMf','profile','apiKey','sort','warn','toISOString','Profile\x20','length','filter','utf-8','object','profiles','\x27:\x20unknown\x20config\x20key\x20\x27','stringify','has','some','llm_project','parse','api_key','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','writeFileSync','keys','24doeHYc','user','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x27\x20will\x20be\x20ignored',':\x20Invalid\x20JSON\x20syntax','123744tFnRbd','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','parent_segment','Error:\x20','description','message','directory','find','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','\x27:\x20config\x20must\x20be\x20an\x20object','isDirectory','\x20\x201.\x20Edit:\x20','6430746lQIVHP','\x20\x20mv\x20\x22','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','.env.','readdirSync','Profile\x20\x27','8996229wDRXdF','317450HVicDe','\x20does\x20not\x20exist','site','257156VewnbY','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','test','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','\x0aWarning:\x20Failed\x20to\x20parse\x20','push','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','database','698260befgFM'];a36_0x1951=function(){return _0x529cb3;};return a36_0x1951();}function loadProfileFromDirectory(_0xb2ed4){const _0x2faf42=a36_0x4313,_0x3e14b6=getProfileConfigPath(_0xb2ed4),_0x4bfd3d=getOldCredentialPath(_0xb2ed4);if(!a36_0x3e6cb7[_0x2faf42(0x9b)](_0x3e14b6)&&!a36_0x3e6cb7[_0x2faf42(0x9b)](_0x4bfd3d))return null;let _0x1cd11f={},_0x260b85={'name':_0xb2ed4,'createdAt':new Date()[_0x2faf42(0xa2)]()};if(a36_0x3e6cb7[_0x2faf42(0x9b)](_0x3e14b6))try{const _0x582157=a36_0x3e6cb7[_0x2faf42(0xd8)](_0x3e14b6,_0x2faf42(0xa6)),_0x14ab6a=JSON[_0x2faf42(0xae)](_0x582157),{metadata:_0x1c8e93,..._0x1ce5a2}=_0x14ab6a;_0x1cd11f=_0x1ce5a2,_0x1c8e93&&(_0x260b85=_0x1c8e93);}catch{}return{'name':_0xb2ed4,'config':_0x1cd11f,'metadata':_0x260b85,'hasCredentials':a36_0x3e6cb7['existsSync'](_0x4bfd3d),'scope':_0x2faf42(0xbe)};}export function listProfiles(){const _0x53e563=a36_0x4313,_0x442320=loadProfilesFromTdxJsonFiles(),_0x114f81=loadProfilesFromDirectories();if(_0x114f81[_0x53e563(0xa4)]>0x0){const _0x2a7798=_0x114f81['map'](_0x29be0a=>_0x29be0a['name'])['join'](',\x20'),_0x41a822=getConfigDir();console[_0x53e563(0xa1)](_0x53e563(0xb5)+_0x2a7798),console[_0x53e563(0xa1)](_0x53e563(0xdf)),console[_0x53e563(0xa1)](_0x53e563(0xc3)+a36_0x2db0d7[_0x53e563(0x9a)](_0x41a822,_0x53e563(0xdb))),console['warn']('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x53e563(0xa1)](_0x53e563(0xc0));}const _0x139867=[..._0x442320,..._0x114f81],_0x2b0897=new Map();for(const _0x427ea4 of _0x139867){!_0x2b0897[_0x53e563(0xab)](_0x427ea4[_0x53e563(0xdc)])&&_0x2b0897['set'](_0x427ea4['name'],_0x427ea4);}return Array['from'](_0x2b0897['values']())[_0x53e563(0xa0)]((_0xe73813,_0x27d178)=>_0xe73813[_0x53e563(0xdc)]['localeCompare'](_0x27d178[_0x53e563(0xdc)]));}export function profileExists(_0x13fe6f){const _0x29a784=a36_0x4313,_0x35ac58=listProfiles();return _0x35ac58[_0x29a784(0xac)](_0x20e953=>_0x20e953[_0x29a784(0xdc)]===_0x13fe6f);}export function loadProfile(_0x5e2d87){const _0x2f0355=a36_0x4313;validateProfileName(_0x5e2d87);const _0x4f61da=listProfiles(),_0x45e6cb=_0x4f61da[_0x2f0355(0xbf)](_0x59f457=>_0x59f457[_0x2f0355(0xdc)]===_0x5e2d87);return _0x45e6cb||null;}export function saveProfile(_0x38433a,_0x5a32fc,_0x1cd75e=![]){const _0x4b061f=a36_0x4313;validateProfileName(_0x38433a);const _0x9c7711=getProfileDir(_0x38433a),_0x42504c=getProfileConfigPath(_0x38433a);createSecureDirectory(_0x9c7711);let _0x148bca;const _0x5e60fd=loadProfile(_0x38433a);_0x5e60fd?(_0x148bca=_0x5e60fd['metadata'],_0x1cd75e&&(_0x148bca[_0x4b061f(0xe1)]=new Date()[_0x4b061f(0xa2)]())):_0x148bca={'name':_0x38433a,'createdAt':new Date()[_0x4b061f(0xa2)]()};const _0x119c3f=JSON[_0x4b061f(0xaa)](_0x5a32fc);if(_0x119c3f[_0x4b061f(0xe3)]('TD_API_KEY')||_0x119c3f['includes'](_0x4b061f(0x9f))||_0x119c3f[_0x4b061f(0xe3)](_0x4b061f(0xaf)))throw new Error(_0x4b061f(0xdd));const _0x323d5b={..._0x5a32fc,'metadata':_0x148bca};a36_0x3e6cb7[_0x4b061f(0xb1)](_0x42504c,JSON[_0x4b061f(0xaa)](_0x323d5b,null,0x2));}export function deleteProfile(_0x393bcf){const _0x159f66=a36_0x4313;validateProfileName(_0x393bcf);const _0x5d5fdd=getProfileDir(_0x393bcf);if(!a36_0x3e6cb7['existsSync'](_0x5d5fdd))throw new Error(_0x159f66(0xa3)+_0x393bcf+_0x159f66(0xcc));a36_0x3e6cb7['rmSync'](_0x5d5fdd,{'recursive':!![],'force':!![]});}export function getActiveProfile(){const _0x142ce2=a36_0x4313,_0x48c486=getGlobalConfigPath();if(!a36_0x3e6cb7['existsSync'](_0x48c486))return null;try{const _0x344f6e=a36_0x3e6cb7['readFileSync'](_0x48c486,_0x142ce2(0xa6)),_0x5ad12e=JSON[_0x142ce2(0xae)](_0x344f6e);return _0x5ad12e[_0x142ce2(0x9e)]||null;}catch{return null;}}export function createProfile(_0x2cbc18,_0x2e2aec){const _0x41212b=a36_0x4313;validateProfileName(_0x2cbc18);if(profileExists(_0x2cbc18))throw new Error(_0x41212b(0xa3)+_0x2cbc18+_0x41212b(0xe0));saveProfile(_0x2cbc18,_0x2e2aec);}export function saveProfileCredentials(_0x5e30c2,_0x1650a2){const _0x4cae2d=a36_0x4313;validateProfileName(_0x5e30c2);if(!profileExists(_0x5e30c2))throw new Error(_0x4cae2d(0xa3)+_0x5e30c2+'\x20does\x20not\x20exist');const _0x44d257=getNewCredentialPath(_0x5e30c2);writeSecureFile(_0x44d257,_0x1650a2);}export function loadProfileCredentials(_0xf07f54){const _0x2e0fc1=a36_0x4313;validateProfileName(_0xf07f54);const _0xd0d153=getNewCredentialPath(_0xf07f54);if(a36_0x3e6cb7['existsSync'](_0xd0d153))try{return a36_0x3e6cb7['readFileSync'](_0xd0d153,_0x2e0fc1(0xa6));}catch{}const _0x1354dd=getOldCredentialPath(_0xf07f54);if(a36_0x3e6cb7[_0x2e0fc1(0x9b)](_0x1354dd)){console[_0x2e0fc1(0xa1)](_0x2e0fc1(0xd5)+_0xf07f54+'\x27'),console['warn'](_0x2e0fc1(0x99)),console[_0x2e0fc1(0xa1)](_0x2e0fc1(0xc5)+_0x1354dd+'\x22\x20\x22'+_0xd0d153+'\x22'),console[_0x2e0fc1(0xa1)](_0x2e0fc1(0xd2));try{return a36_0x3e6cb7[_0x2e0fc1(0xd8)](_0x1354dd,'utf-8');}catch{return null;}}return null;}
|
|
1
|
+
(function(_0x303ff,_0x467e81){const _0x185574=a36_0x9f3a,_0x4897b3=_0x303ff();while(!![]){try{const _0x19f8da=-parseInt(_0x185574(0x8b))/0x1*(-parseInt(_0x185574(0xb6))/0x2)+parseInt(_0x185574(0xcb))/0x3*(-parseInt(_0x185574(0x8d))/0x4)+parseInt(_0x185574(0x9d))/0x5*(-parseInt(_0x185574(0xc1))/0x6)+parseInt(_0x185574(0x97))/0x7+-parseInt(_0x185574(0xc8))/0x8+-parseInt(_0x185574(0x9b))/0x9*(-parseInt(_0x185574(0xa8))/0xa)+-parseInt(_0x185574(0xbc))/0xb*(-parseInt(_0x185574(0xca))/0xc);if(_0x19f8da===_0x467e81)break;else _0x4897b3['push'](_0x4897b3['shift']());}catch(_0x5845a6){_0x4897b3['push'](_0x4897b3['shift']());}}}(a36_0x1076,0x2816b));import*as a36_0x3d02bc from'node:fs';import*as a36_0x44f137 from'node:path';function a36_0x1076(){const _0x4b1a7b=['.env.','\x20\x20mv\x20\x22','toISOString','674dMJcxr','\x20does\x20not\x20exist','52036RuQJIB','.env','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','utf-8','metadata','llm_agent','stringify','parse','sort','description','599361wcZfYh','name','\x27\x20will\x20be\x20ignored','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','9gXGujU','push','6310MnQwab','\x20already\x20exists','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','site','\x27:\x20unknown\x20config\x20key\x20\x27','tdx.json','llm_project','writeFileSync','set','from','Invalid\x20profile\x20name:\x20','1101110ALFBOQ','Profile\x20\x27','map','includes','message',':\x20Invalid\x20JSON\x20syntax','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','object','entries','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','warn','test','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Failed\x20to\x20parse\x20','82YOSRqN','has','database','TD_API_KEY','profiles','Error:\x20','11likyvX','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','find','\x22\x20\x22','\x27:\x20config\x20must\x20be\x20an\x20object','1500ARhFhD','parent_segment','lastUsed','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','join','\x20\x201.\x20Edit:\x20','1778120VayeJu','filter','8709252zMJDbn','57zSvHgk','keys','existsSync','readFileSync','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','Warning:\x20Profile\x20\x27','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','api_key','profile','Profile\x20','directory','readdirSync','local','values','rmSync','string','localeCompare'];a36_0x1076=function(){return _0x4b1a7b;};return a36_0x1076();}import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';export function getProfileParams(_0x2678e8){const _0x35cd4e=a36_0x9f3a,_0x41c684={};if(!_0x2678e8)return _0x41c684;for(const [_0xd00527,_0xf8e0e5]of Object[_0x35cd4e(0xb0)](_0x2678e8)){_0xd00527!=='description'&&_0xf8e0e5!==undefined&&(_0x41c684[_0xd00527]=_0xf8e0e5);}return _0x41c684;}export function getProfilesDir(){const _0x12df90=a36_0x9f3a;return a36_0x44f137[_0x12df90(0xc6)](getConfigDir(),_0x12df90(0xba));}function getProfileDir(_0x570c5e){const _0x1797eb=a36_0x9f3a;return a36_0x44f137[_0x1797eb(0xc6)](getProfilesDir(),_0x570c5e);}function getProfileConfigPath(_0x51767c){const _0x483b35=a36_0x9f3a;return a36_0x44f137[_0x483b35(0xc6)](getProfileDir(_0x51767c),_0x483b35(0xa2));}function getProfileEnvPath(_0x1956a5){const _0x5c3246=a36_0x9f3a;return a36_0x44f137[_0x5c3246(0xc6)](getProfileDir(_0x1956a5),_0x5c3246(0x8e));}function getGlobalConfigPath(){const _0xc926ec=a36_0x9f3a;return a36_0x44f137[_0xc926ec(0xc6)](getConfigDir(),_0xc926ec(0xa2));}function validateProfileName(_0x216759){const _0x2f63ea=a36_0x9f3a;if(!/^[a-zA-Z0-9_-]+$/[_0x2f63ea(0xb3)](_0x216759))throw new Error(_0x2f63ea(0xa7)+_0x216759+_0x2f63ea(0xcf));}function validateProfileConfig(_0x19a0a5,_0x4fafbd){const _0x5d33ff=a36_0x9f3a;if(typeof _0x19a0a5!==_0x5d33ff(0xaf)||_0x19a0a5===null)throw new Error('Profile\x20\x27'+_0x4fafbd+_0x5d33ff(0xc0));const _0x937d7a=[_0x5d33ff(0x96),_0x5d33ff(0xa0),_0x5d33ff(0xb8),_0x5d33ff(0xc2),_0x5d33ff(0xa3),_0x5d33ff(0x92)],_0x2a9df3=_0x19a0a5;for(const _0xaa80bc of Object[_0x5d33ff(0xcc)](_0x2a9df3)){!_0x937d7a[_0x5d33ff(0xab)](_0xaa80bc)&&console[_0x5d33ff(0xb2)](_0x5d33ff(0xd0)+_0x4fafbd+_0x5d33ff(0xa1)+_0xaa80bc+_0x5d33ff(0x99));}if(_0x2a9df3['description']!==undefined&&typeof _0x2a9df3[_0x5d33ff(0x96)]!=='string')throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0xae));if(_0x2a9df3['site']!==undefined&&typeof _0x2a9df3['site']!==_0x5d33ff(0x86))throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0x9f));if(_0x2a9df3['database']!==undefined&&typeof _0x2a9df3['database']!==_0x5d33ff(0x86))throw new Error('Profile\x20\x27'+_0x4fafbd+_0x5d33ff(0xc5));if(_0x2a9df3[_0x5d33ff(0xc2)]!==undefined&&typeof _0x2a9df3[_0x5d33ff(0xc2)]!==_0x5d33ff(0x86))throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0xb1));if(_0x2a9df3[_0x5d33ff(0xa3)]!==undefined&&typeof _0x2a9df3[_0x5d33ff(0xa3)]!==_0x5d33ff(0x86))throw new Error('Profile\x20\x27'+_0x4fafbd+_0x5d33ff(0xbd));if(_0x2a9df3[_0x5d33ff(0x92)]!==undefined&&typeof _0x2a9df3[_0x5d33ff(0x92)]!==_0x5d33ff(0x86))throw new Error(_0x5d33ff(0xa9)+_0x4fafbd+_0x5d33ff(0xb4));return!![];}function loadProfilesFromTdxJson(_0x3a8840,_0x156d72){const _0x23eaf7=a36_0x9f3a;if(!a36_0x3d02bc[_0x23eaf7(0xcd)](_0x3a8840))return[];try{const _0xabe833=a36_0x3d02bc[_0x23eaf7(0xce)](_0x3a8840,_0x23eaf7(0x90)),_0x1b1686=JSON[_0x23eaf7(0x94)](_0xabe833);if(!_0x1b1686[_0x23eaf7(0xba)]||typeof _0x1b1686[_0x23eaf7(0xba)]!==_0x23eaf7(0xaf))return[];const _0x39d883=[];for(const [_0x435b22,_0x58db13]of Object[_0x23eaf7(0xb0)](_0x1b1686['profiles'])){try{validateProfileConfig(_0x58db13,_0x435b22);const _0x1abd78=getNewCredentialPath(_0x435b22),_0x14d762=getOldCredentialPath(_0x435b22),_0x3dc4d1=a36_0x3d02bc[_0x23eaf7(0xcd)](_0x1abd78)||a36_0x3d02bc[_0x23eaf7(0xcd)](_0x14d762);_0x39d883['push']({'name':_0x435b22,'config':_0x58db13,'metadata':{'name':_0x435b22,'createdAt':new Date()[_0x23eaf7(0x8a)]()},'hasCredentials':_0x3dc4d1,'scope':_0x156d72});}catch(_0x46c2bf){_0x46c2bf instanceof Error&&(console[_0x23eaf7(0xb2)](_0x23eaf7(0x8f)+_0x3a8840+':'),console[_0x23eaf7(0xb2)]('\x20\x20'+_0x46c2bf[_0x23eaf7(0xac)]+'\x0a'));}}return _0x39d883;}catch(_0x1305b5){return _0x1305b5 instanceof SyntaxError?(console[_0x23eaf7(0xb2)](_0x23eaf7(0xb5)+_0x3a8840+_0x23eaf7(0xad)),console[_0x23eaf7(0xb2)](_0x23eaf7(0xbb)+_0x1305b5[_0x23eaf7(0xac)]+'\x0a')):console['warn'](_0x23eaf7(0xc4)+_0x3a8840+':\x20'+_0x1305b5+'\x0a'),[];}}export function getNewCredentialPath(_0x39269d){const _0x3caaba=a36_0x9f3a;return a36_0x44f137[_0x3caaba(0xc6)](getConfigDir(),_0x3caaba(0x88)+_0x39269d);}function getOldCredentialPath(_0x2d45e3){const _0x318971=a36_0x9f3a;return a36_0x44f137[_0x318971(0xc6)](getProfilesDir(),_0x2d45e3,_0x318971(0x8e));}function loadProfilesFromTdxJsonFiles(){const _0x3ecf37=a36_0x9f3a,_0x328e73=[],_0x3fb43d=findProjectConfigPath();_0x3fb43d&&_0x328e73[_0x3ecf37(0x9c)](...loadProfilesFromTdxJson(_0x3fb43d,_0x3ecf37(0x83)));const _0x24e954=a36_0x44f137['join'](getConfigDir(),_0x3ecf37(0xa2));return _0x328e73['push'](...loadProfilesFromTdxJson(_0x24e954,'user')),_0x328e73;}function loadProfilesFromDirectories(){const _0x419333=a36_0x9f3a,_0x178686=getProfilesDir();if(!a36_0x3d02bc[_0x419333(0xcd)](_0x178686))return[];try{return a36_0x3d02bc[_0x419333(0x82)](_0x178686,{'withFileTypes':!![]})[_0x419333(0xc9)](_0xe9f323=>_0xe9f323['isDirectory']())[_0x419333(0xaa)](_0x5c1625=>_0x5c1625[_0x419333(0x98)])[_0x419333(0xc9)](_0x144c83=>{const _0x1f330b=_0x419333,_0x46d8d0=getProfileConfigPath(_0x144c83),_0x57f78c=getProfileEnvPath(_0x144c83);return a36_0x3d02bc[_0x1f330b(0xcd)](_0x46d8d0)||a36_0x3d02bc[_0x1f330b(0xcd)](_0x57f78c);})[_0x419333(0xaa)](_0x1317cb=>{const _0x1081ef=_0x419333,_0x62f66d=loadProfileFromDirectory(_0x1317cb);if(_0x62f66d)return{..._0x62f66d,'scope':_0x1081ef(0x81)};return null;})['filter'](_0x3117a9=>_0x3117a9!==null);}catch{return[];}}function loadProfileFromDirectory(_0x3ea22b){const _0x495556=a36_0x9f3a,_0xdb0072=getProfileConfigPath(_0x3ea22b),_0x5e5cbb=getOldCredentialPath(_0x3ea22b);if(!a36_0x3d02bc[_0x495556(0xcd)](_0xdb0072)&&!a36_0x3d02bc['existsSync'](_0x5e5cbb))return null;let _0x407957={},_0x63789e={'name':_0x3ea22b,'createdAt':new Date()[_0x495556(0x8a)]()};if(a36_0x3d02bc['existsSync'](_0xdb0072))try{const _0x213da7=a36_0x3d02bc[_0x495556(0xce)](_0xdb0072,'utf-8'),_0x3ef89d=JSON[_0x495556(0x94)](_0x213da7),{metadata:_0x1509ae,..._0x49b739}=_0x3ef89d;_0x407957=_0x49b739,_0x1509ae&&(_0x63789e=_0x1509ae);}catch{}return{'name':_0x3ea22b,'config':_0x407957,'metadata':_0x63789e,'hasCredentials':a36_0x3d02bc[_0x495556(0xcd)](_0x5e5cbb),'scope':_0x495556(0x81)};}export function listProfiles(){const _0x2b6389=a36_0x9f3a,_0x2f71d0=loadProfilesFromTdxJsonFiles(),_0x58ff95=loadProfilesFromDirectories();if(_0x58ff95['length']>0x0){const _0x2f6cfa=_0x58ff95[_0x2b6389(0xaa)](_0x7fe442=>_0x7fe442[_0x2b6389(0x98)])['join'](',\x20'),_0x27f551=getConfigDir();console['warn']('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x2f6cfa),console[_0x2b6389(0xb2)](_0x2b6389(0x7d)),console['warn'](_0x2b6389(0xc7)+a36_0x44f137[_0x2b6389(0xc6)](_0x27f551,_0x2b6389(0xa2))),console['warn']('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x2b6389(0xb2)](_0x2b6389(0x9a));}const _0x369f9f=[..._0x2f71d0,..._0x58ff95],_0x4eb341=new Map();for(const _0x23a455 of _0x369f9f){!_0x4eb341[_0x2b6389(0xb7)](_0x23a455[_0x2b6389(0x98)])&&_0x4eb341[_0x2b6389(0xa5)](_0x23a455['name'],_0x23a455);}return Array[_0x2b6389(0xa6)](_0x4eb341[_0x2b6389(0x84)]())[_0x2b6389(0x95)]((_0x156530,_0x2b193b)=>_0x156530[_0x2b6389(0x98)][_0x2b6389(0x87)](_0x2b193b[_0x2b6389(0x98)]));}function a36_0x9f3a(_0x46f865,_0x6d1193){const _0x1076e0=a36_0x1076();return a36_0x9f3a=function(_0x9f3a3f,_0xcb55e8){_0x9f3a3f=_0x9f3a3f-0x7d;let _0x2cc4f9=_0x1076e0[_0x9f3a3f];return _0x2cc4f9;},a36_0x9f3a(_0x46f865,_0x6d1193);}export function profileExists(_0x4429c3){const _0x2bfc42=a36_0x9f3a,_0x520b89=listProfiles();return _0x520b89['some'](_0x426d0e=>_0x426d0e[_0x2bfc42(0x98)]===_0x4429c3);}export function loadProfile(_0xfa43e4){const _0x585ca5=a36_0x9f3a;validateProfileName(_0xfa43e4);const _0x12a48e=listProfiles(),_0x9de196=_0x12a48e[_0x585ca5(0xbe)](_0x321464=>_0x321464[_0x585ca5(0x98)]===_0xfa43e4);return _0x9de196||null;}export function saveProfile(_0x10aebd,_0x2b4391,_0x54251e=![]){const _0x52b4cc=a36_0x9f3a;validateProfileName(_0x10aebd);const _0x6790a7=getProfileDir(_0x10aebd),_0x105393=getProfileConfigPath(_0x10aebd);createSecureDirectory(_0x6790a7);let _0x2e3bc7;const _0x31ca22=loadProfile(_0x10aebd);_0x31ca22?(_0x2e3bc7=_0x31ca22[_0x52b4cc(0x91)],_0x54251e&&(_0x2e3bc7[_0x52b4cc(0xc3)]=new Date()['toISOString']())):_0x2e3bc7={'name':_0x10aebd,'createdAt':new Date()['toISOString']()};const _0x4ab33d=JSON[_0x52b4cc(0x93)](_0x2b4391);if(_0x4ab33d[_0x52b4cc(0xab)](_0x52b4cc(0xb9))||_0x4ab33d[_0x52b4cc(0xab)]('apiKey')||_0x4ab33d[_0x52b4cc(0xab)](_0x52b4cc(0x7e)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20profile\x20configuration.\x20Use\x20.env\x20file\x20instead.');const _0xeff465={..._0x2b4391,'metadata':_0x2e3bc7};a36_0x3d02bc[_0x52b4cc(0xa4)](_0x105393,JSON[_0x52b4cc(0x93)](_0xeff465,null,0x2));}export function deleteProfile(_0x1089ae){const _0x662a18=a36_0x9f3a;validateProfileName(_0x1089ae);const _0x477e84=getProfileDir(_0x1089ae);if(!a36_0x3d02bc['existsSync'](_0x477e84))throw new Error(_0x662a18(0x80)+_0x1089ae+_0x662a18(0x8c));a36_0x3d02bc[_0x662a18(0x85)](_0x477e84,{'recursive':!![],'force':!![]});}export function getActiveProfile(){const _0x17af38=a36_0x9f3a,_0x5c5028=getGlobalConfigPath();if(!a36_0x3d02bc[_0x17af38(0xcd)](_0x5c5028))return null;try{const _0x6d679=a36_0x3d02bc[_0x17af38(0xce)](_0x5c5028,_0x17af38(0x90)),_0x40d6cf=JSON[_0x17af38(0x94)](_0x6d679);return _0x40d6cf[_0x17af38(0x7f)]||null;}catch{return null;}}export function createProfile(_0x188c21,_0x1d12df){const _0x3aa37c=a36_0x9f3a;validateProfileName(_0x188c21);if(profileExists(_0x188c21))throw new Error('Profile\x20'+_0x188c21+_0x3aa37c(0x9e));saveProfile(_0x188c21,_0x1d12df);}export function saveProfileCredentials(_0x896d62,_0x4a18d6){const _0x578411=a36_0x9f3a;validateProfileName(_0x896d62);if(!profileExists(_0x896d62))throw new Error(_0x578411(0x80)+_0x896d62+_0x578411(0x8c));const _0x4fb96f=getNewCredentialPath(_0x896d62);writeSecureFile(_0x4fb96f,_0x4a18d6);}export function loadProfileCredentials(_0x4996df){const _0x234a81=a36_0x9f3a;validateProfileName(_0x4996df);const _0x3b4357=getNewCredentialPath(_0x4996df);if(a36_0x3d02bc[_0x234a81(0xcd)](_0x3b4357))try{return a36_0x3d02bc['readFileSync'](_0x3b4357,_0x234a81(0x90));}catch{}const _0x1f2c9b=getOldCredentialPath(_0x4996df);if(a36_0x3d02bc[_0x234a81(0xcd)](_0x1f2c9b)){console[_0x234a81(0xb2)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x4996df+'\x27'),console[_0x234a81(0xb2)]('To\x20migrate:'),console[_0x234a81(0xb2)](_0x234a81(0x89)+_0x1f2c9b+_0x234a81(0xbf)+_0x3b4357+'\x22'),console['warn']('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a36_0x3d02bc[_0x234a81(0xce)](_0x1f2c9b,_0x234a81(0x90));}catch{return null;}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a37_0xad7d3f=a37_0x567b;(function(_0x33965e,_0x5476a5){const _0x392e22=a37_0x567b,_0x1f5198=_0x33965e();while(!![]){try{const _0x2f0832=parseInt(_0x392e22(0xc8))/0x1*(parseInt(_0x392e22(0xe2))/0x2)+-parseInt(_0x392e22(0xca))/0x3*(parseInt(_0x392e22(0xe5))/0x4)+-parseInt(_0x392e22(0xd5))/0x5*(-parseInt(_0x392e22(0xd1))/0x6)+parseInt(_0x392e22(0xe1))/0x7*(parseInt(_0x392e22(0xcb))/0x8)+-parseInt(_0x392e22(0xd2))/0x9*(parseInt(_0x392e22(0xd0))/0xa)+-parseInt(_0x392e22(0xe4))/0xb*(-parseInt(_0x392e22(0xdd))/0xc)+-parseInt(_0x392e22(0xc6))/0xd;if(_0x2f0832===_0x5476a5)break;else _0x1f5198['push'](_0x1f5198['shift']());}catch(_0x4cb68a){_0x1f5198['push'](_0x1f5198['shift']());}}}(a37_0x2b9e,0xc102f));import*as a37_0x24a68a from'node:fs';function a37_0x567b(_0x16b7ae,_0x21be30){const _0x2b9eb6=a37_0x2b9e();return a37_0x567b=function(_0x567b88,_0x13452d){_0x567b88=_0x567b88-0xc6;let _0x1d1f51=_0x2b9eb6[_0x567b88];return _0x1d1f51;},a37_0x567b(_0x16b7ae,_0x21be30);}import*as a37_0x4fc7ba from'node:path';const PROJECT_CONFIG_FILENAME=a37_0xad7d3f(0xdb);function a37_0x2b9e(){const _0x4e5381=['Failed\x20to\x20load\x20project\x20config\x20from\x20','7894730PLyMLg','6wfbQgk','9IqWzqC','apiKey','join','1909010WBtwvS','parse','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','cwd','Warning:\x20\x27profile\x27\x20field\x20in\x20','code','tdx.json','readFileSync','1356gywkZW','dirname','api_key','includes','7273DNevNL','162314YeHmRm','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','103004BrJkMq','4UBDriZ','ENOENT','1248650AjKmYS','TD_API_KEY','9wIGjDE','existsSync','1987701DHKNOG','1296xrgrWN',').\x20','stringify','utf-8'];a37_0x2b9e=function(){return _0x4e5381;};return a37_0x2b9e();}export function findProjectConfigPath(_0x5def79){const _0x259713=a37_0xad7d3f;let _0x4631d2=_0x5def79||process[_0x259713(0xd8)]();while(!![]){const _0x6f3f73=a37_0x4fc7ba[_0x259713(0xd4)](_0x4631d2,PROJECT_CONFIG_FILENAME);if(a37_0x24a68a[_0x259713(0xc9)](_0x6f3f73))return _0x6f3f73;const _0x334094=a37_0x4fc7ba[_0x259713(0xde)](_0x4631d2);if(_0x334094===_0x4631d2)return null;_0x4631d2=_0x334094;}}export function loadProjectConfig(_0x454bb5){const _0x2871ec=a37_0xad7d3f,_0x47d105=findProjectConfigPath(_0x454bb5);if(!_0x47d105)return null;try{const _0xbb5442=a37_0x24a68a[_0x2871ec(0xdc)](_0x47d105,_0x2871ec(0xce)),_0x5b1a7c=JSON[_0x2871ec(0xd6)](_0xbb5442),_0x1e9ae6=JSON[_0x2871ec(0xcd)](_0x5b1a7c);if(_0x1e9ae6[_0x2871ec(0xe0)](_0x2871ec(0xc7))||_0x1e9ae6['includes']('apiKey')||_0x1e9ae6[_0x2871ec(0xe0)](_0x2871ec(0xdf)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x47d105+_0x2871ec(0xcc)+_0x2871ec(0xd7));const {metadata:_0x50741b,profile:_0x1314e0,..._0x5576d1}=_0x5b1a7c;return _0x1314e0&&console['warn'](_0x2871ec(0xd9)+_0x47d105+'\x20is\x20ignored.\x20'+_0x2871ec(0xe3)),_0x5576d1;}catch(_0x1e5bb7){if(_0x1e5bb7 instanceof Error&&'code'in _0x1e5bb7&&_0x1e5bb7[_0x2871ec(0xda)]===_0x2871ec(0xe6))return null;throw new Error(_0x2871ec(0xcf)+_0x47d105+':\x20'+_0x1e5bb7);}}export function saveProjectConfig(_0x287861,_0x94a4dc){const _0x2e2244=a37_0xad7d3f,_0x4ceacd=_0x94a4dc||process['cwd'](),_0x140e40=a37_0x4fc7ba[_0x2e2244(0xd4)](_0x4ceacd,PROJECT_CONFIG_FILENAME),_0x57f3a1=JSON[_0x2e2244(0xcd)](_0x287861);if(_0x57f3a1['includes'](_0x2e2244(0xc7))||_0x57f3a1[_0x2e2244(0xe0)](_0x2e2244(0xd3))||_0x57f3a1['includes'](_0x2e2244(0xdf)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if('profile'in _0x287861)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a37_0x24a68a['writeFileSync'](_0x140e40,JSON[_0x2e2244(0xcd)](_0x287861,null,0x2));}export function hasProjectConfig(_0x41b21a){return findProjectConfigPath(_0x41b21a)!==null;}export function getProjectRoot(_0x41658c){const _0x157357=a37_0xad7d3f,_0x22185d=findProjectConfigPath(_0x41658c);return _0x22185d?a37_0x4fc7ba[_0x157357(0xde)](_0x22185d):null;}
|
package/dist/core/session.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xc6d289,_0x5df9b4){const _0x587398=a38_0x4c89,_0x4a7b65=_0xc6d289();while(!![]){try{const _0x430640=parseInt(_0x587398(0x91))/0x1*(-parseInt(_0x587398(0x89))/0x2)+parseInt(_0x587398(0x97))/0x3+parseInt(_0x587398(0x84))/0x4*(-parseInt(_0x587398(0x96))/0x5)+parseInt(_0x587398(0x87))/0x6*(-parseInt(_0x587398(0x78))/0x7)+parseInt(_0x587398(0x9a))/0x8+-parseInt(_0x587398(0xa2))/0x9*(parseInt(_0x587398(0x81))/0xa)+parseInt(_0x587398(0x7b))/0xb;if(_0x430640===_0x5df9b4)break;else _0x4a7b65['push'](_0x4a7b65['shift']());}catch(_0x1156a9){_0x4a7b65['push'](_0x4a7b65['shift']());}}}(a38_0x5de9,0xeef99));import*as a38_0x10485b from'node:fs';import*as a38_0x3a2c43 from'node:path';import*as a38_0x25fe5d from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x45105a=a38_0x4c89,_0x3966b4=process['env'][_0x45105a(0x8e)]||a38_0x3a2c43[_0x45105a(0x8a)](a38_0x25fe5d[_0x45105a(0x7e)](),_0x45105a(0x7f),_0x45105a(0x7d));return a38_0x3a2c43[_0x45105a(0x8a)](_0x3966b4,_0x45105a(0x8d));}function getSessionPath(_0x23b3fd){const _0x51af1d=a38_0x4c89;return a38_0x3a2c43['join'](getSessionsDir(),_0x23b3fd+_0x51af1d(0x9d));}export function getCurrentSessionPID(){return getPPID();}function a38_0x4c89(_0x25a5be,_0x187edc){const _0x5de9f3=a38_0x5de9();return a38_0x4c89=function(_0x4c8908,_0x17f928){_0x4c8908=_0x4c8908-0x78;let _0x179cd3=_0x5de9f3[_0x4c8908];return _0x179cd3;},a38_0x4c89(_0x25a5be,_0x187edc);}export function getSessionID(_0x561e95){const _0x3b7329=a38_0x4c89;if(_0x561e95)return _0x561e95;return getCurrentSessionPID()[_0x3b7329(0x7c)]();}export function loadSessionContext(_0x3463c4){const _0x2448fd=a38_0x4c89,_0x1e9d48=_0x3463c4||getCurrentSessionPID()[_0x2448fd(0x7c)](),_0x1b45e0=/^\d+$/['test'](_0x1e9d48)?parseInt(_0x1e9d48,0xa):null;return _0x1b45e0!==null?loadSessionContextByPID(_0x1b45e0):loadSessionContextByString(_0x1e9d48);}export function loadSessionContextByPID(_0x1f2b46){const _0x667481=a38_0x4c89,_0x51d96d=getSessionPath(_0x1f2b46);if(!a38_0x10485b[_0x667481(0x82)](_0x51d96d))return null;try{const _0x4ca956=a38_0x10485b['readFileSync'](_0x51d96d,'utf-8'),_0x5adac3=JSON['parse'](_0x4ca956),_0x47c279=new Date(_0x5adac3[_0x667481(0x93)])[_0x667481(0x9b)](),_0x2ccecf=Date['now']();if(_0x2ccecf-_0x47c279>SESSION_EXPIRATION_MS)return a38_0x10485b[_0x667481(0x95)](_0x51d96d),null;const _0x6588c9=JSON[_0x667481(0x8f)](_0x5adac3);if(_0x6588c9[_0x667481(0x9f)](_0x667481(0x99))||_0x6588c9[_0x667481(0x9f)](_0x667481(0x80))||_0x6588c9[_0x667481(0x9f)]('api_key'))return console[_0x667481(0xa1)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x51d96d+_0x667481(0x8b)),a38_0x10485b[_0x667481(0x95)](_0x51d96d),null;return _0x5adac3;}catch{try{a38_0x10485b[_0x667481(0x95)](_0x51d96d);}catch{}return null;}}function loadSessionContextByString(_0x303b03){const _0x492fac=a38_0x4c89,_0x21c74d=a38_0x3a2c43[_0x492fac(0x8a)](getSessionsDir(),_0x303b03+_0x492fac(0x9d));if(!a38_0x10485b[_0x492fac(0x82)](_0x21c74d))return null;try{const _0x4977bd=a38_0x10485b[_0x492fac(0x8c)](_0x21c74d,_0x492fac(0x94)),_0x3c64cb=JSON[_0x492fac(0x9c)](_0x4977bd),_0x520fc8=new Date(_0x3c64cb['createdAt'])['getTime'](),_0x18a68e=Date[_0x492fac(0x88)]();if(_0x18a68e-_0x520fc8>SESSION_EXPIRATION_MS)return a38_0x10485b[_0x492fac(0x95)](_0x21c74d),null;const _0x3fb92d=JSON[_0x492fac(0x8f)](_0x3c64cb);if(_0x3fb92d[_0x492fac(0x9f)](_0x492fac(0x99))||_0x3fb92d[_0x492fac(0x9f)]('apiKey')||_0x3fb92d[_0x492fac(0x9f)]('api_key'))return console[_0x492fac(0xa1)](_0x492fac(0x83)+_0x21c74d+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a38_0x10485b[_0x492fac(0x95)](_0x21c74d),null;return _0x3c64cb;}catch{try{a38_0x10485b[_0x492fac(0x95)](_0x21c74d);}catch{}return null;}}export function saveSessionContext(_0x44d98d,_0x29eee4){const _0xc191b4=a38_0x4c89,_0x109f6b=_0x29eee4||getCurrentSessionPID()[_0xc191b4(0x7c)](),_0x15e45a=/^\d+$/[_0xc191b4(0x7a)](_0x109f6b)?parseInt(_0x109f6b,0xa):getCurrentSessionPID(),_0x15afb4=a38_0x3a2c43[_0xc191b4(0x8a)](getSessionsDir(),_0x109f6b+_0xc191b4(0x9d)),_0x4e9795=getSessionsDir();createSecureDirectory(_0x4e9795);const _0x42d903=JSON[_0xc191b4(0x8f)](_0x44d98d);if(_0x42d903[_0xc191b4(0x9f)](_0xc191b4(0x99))||_0x42d903[_0xc191b4(0x9f)](_0xc191b4(0x80))||_0x42d903[_0xc191b4(0x9f)](_0xc191b4(0x85)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.');let _0x5cf830;const _0x1ad9b5=/^\d+$/['test'](_0x109f6b)?loadSessionContextByPID(parseInt(_0x109f6b,0xa)):loadSessionContextByString(_0x109f6b);_0x1ad9b5?_0x5cf830={..._0x1ad9b5,..._0x44d98d,'pid':_0x15e45a,'sessionId':_0x109f6b!==_0x15e45a[_0xc191b4(0x7c)]()?_0x109f6b:undefined,'updatedAt':new Date()['toISOString']()}:_0x5cf830={'pid':_0x15e45a,'sessionId':_0x109f6b!==_0x15e45a[_0xc191b4(0x7c)]()?_0x109f6b:undefined,..._0x44d98d,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0xc191b4(0x98)]()},a38_0x10485b[_0xc191b4(0x86)](_0x15afb4,JSON[_0xc191b4(0x8f)](_0x5cf830,null,0x2));}export function clearSessionContext(_0x315d48){const _0x26eaac=a38_0x4c89,_0xa1e624=_0x315d48||getCurrentSessionPID()[_0x26eaac(0x7c)](),_0x445779=a38_0x3a2c43[_0x26eaac(0x8a)](getSessionsDir(),_0xa1e624+_0x26eaac(0x9d));a38_0x10485b[_0x26eaac(0x82)](_0x445779)&&a38_0x10485b[_0x26eaac(0x95)](_0x445779);}export function cleanExpiredSessions(){const _0x596866=a38_0x4c89,_0x34e4e1=getSessionsDir();if(!a38_0x10485b[_0x596866(0x82)](_0x34e4e1))return 0x0;let _0xcff8d=0x0;const _0x285254=Date[_0x596866(0x88)]();try{const _0x4a3df4=a38_0x10485b[_0x596866(0x79)](_0x34e4e1);for(const _0x1c4353 of _0x4a3df4){if(!_0x1c4353[_0x596866(0x90)](_0x596866(0x9d)))continue;const _0x1d0cbe=a38_0x3a2c43['join'](_0x34e4e1,_0x1c4353),_0x631cc8=_0x1c4353[_0x596866(0x9e)](_0x596866(0x9d),''),_0x423682=parseInt(_0x631cc8,0xa),_0xbe8b4=!isNaN(_0x423682);if(_0xbe8b4){if(!isProcessRunning(_0x423682)){a38_0x10485b[_0x596866(0x95)](_0x1d0cbe),_0xcff8d++;continue;}}try{const _0x286c10=a38_0x10485b[_0x596866(0x8c)](_0x1d0cbe,_0x596866(0x94)),_0x5e0229=JSON[_0x596866(0x9c)](_0x286c10),_0x557a0c=new Date(_0x5e0229[_0x596866(0x93)])[_0x596866(0x9b)]();_0x285254-_0x557a0c>SESSION_EXPIRATION_MS&&(a38_0x10485b[_0x596866(0x95)](_0x1d0cbe),_0xcff8d++);}catch{a38_0x10485b[_0x596866(0x95)](_0x1d0cbe),_0xcff8d++;}}}catch{}return _0xcff8d;}export function listActiveSessions(){const _0x570b6d=a38_0x4c89,_0x1b6302=getSessionsDir();if(!a38_0x10485b['existsSync'](_0x1b6302))return[];try{const _0x191a3a=a38_0x10485b['readdirSync'](_0x1b6302),_0x4c7f76=[];for(const _0x56e291 of _0x191a3a){if(!_0x56e291['endsWith'](_0x570b6d(0x9d)))continue;const _0x42213d=_0x56e291[_0x570b6d(0x9e)](_0x570b6d(0x9d),''),_0xbd8b7b=parseInt(_0x42213d,0xa);!isNaN(_0xbd8b7b)&&isProcessRunning(_0xbd8b7b)&&_0x4c7f76[_0x570b6d(0x92)](_0xbd8b7b);}return _0x4c7f76[_0x570b6d(0xa0)]((_0x32b98e,_0x45dfbe)=>_0x32b98e-_0x45dfbe);}catch{return[];}}function a38_0x5de9(){const _0x4641ce=['.config','apiKey','650KBtnQv','existsSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','2812OwpMSq','api_key','writeFileSync','88836ylHzRG','now','3368648kaltFx','join','.\x20This\x20is\x20insecure.\x20Removing\x20session.','readFileSync','sessions','TDX_CONFIG_DIR','stringify','endsWith','1IttYPL','push','createdAt','utf-8','unlinkSync','13285wMVjAm','5625081Ozzwyb','toISOString','TD_API_KEY','4464264LcbMZA','getTime','parse','.json','replace','includes','sort','warn','253629cBqPmE','539EjIQaa','readdirSync','test','55767833txBpQm','toString','tdx','homedir'];a38_0x5de9=function(){return _0x4641ce;};return a38_0x5de9();}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a39_0x1b37(){var _0x3224b5=['6pXMkiY','274KGsjiy','28512176cHEmmP','5318978EOsHWc','10722231yJuxRf','1028232mhPUrj','5YHQYTU','9948870hikTgY','1718SzaxPu','7293252UnLEht','8LRJvkh'];a39_0x1b37=function(){return _0x3224b5;};return a39_0x1b37();}(function(_0x50381e,_0x4d5455){var _0x110005=a39_0x5f11,_0x2d7932=_0x50381e();while(!![]){try{var _0x3ed785=parseInt(_0x110005(0x13d))/0x1*(parseInt(_0x110005(0x141))/0x2)+parseInt(_0x110005(0x140))/0x3*(parseInt(_0x110005(0x145))/0x4)+parseInt(_0x110005(0x146))/0x5*(-parseInt(_0x110005(0x13e))/0x6)+parseInt(_0x110005(0x143))/0x7+parseInt(_0x110005(0x13f))/0x8*(-parseInt(_0x110005(0x144))/0x9)+-parseInt(_0x110005(0x13c))/0xa+parseInt(_0x110005(0x142))/0xb;if(_0x3ed785===_0x4d5455)break;else _0x2d7932['push'](_0x2d7932['shift']());}catch(_0x3dc4bf){_0x2d7932['push'](_0x2d7932['shift']());}}}(a39_0x1b37,0xaacac));export*from'./types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./client/http-client.js';export*from'./client/td-client.js';export{TrinoClient}from'./client/trino-client.js';export*from'./client/rate-limiter.js';export*from'./types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';function a39_0x5f11(_0x1fe488,_0x51a1c6){var _0x1b372a=a39_0x1b37();return a39_0x5f11=function(_0x5f117f,_0x2f016a){_0x5f117f=_0x5f117f-0x13c;var _0x25474e=_0x1b372a[_0x5f117f];return _0x25474e;},a39_0x5f11(_0x1fe488,_0x51a1c6);}export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
|