@treasuredata/tdx 0.16.2 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-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/segment-validate-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/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.d.ts +9 -0
- package/dist/sdk/claude-agent/environment.d.ts.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/environment.js.map +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x261440,_0x5d5eaf){const _0x53bf7f=a44_0x447e,_0x3a720e=_0x261440();while(!![]){try{const _0x5dedfd=parseInt(_0x53bf7f(0x190))/0x1*(parseInt(_0x53bf7f(0x164))/0x2)+-parseInt(_0x53bf7f(0x154))/0x3*(parseInt(_0x53bf7f(0x176))/0x4)+parseInt(_0x53bf7f(0x18f))/0x5+-parseInt(_0x53bf7f(0x156))/0x6*(parseInt(_0x53bf7f(0x18d))/0x7)+parseInt(_0x53bf7f(0x152))/0x8*(parseInt(_0x53bf7f(0x198))/0x9)+parseInt(_0x53bf7f(0x150))/0xa+-parseInt(_0x53bf7f(0x17e))/0xb*(parseInt(_0x53bf7f(0x14c))/0xc);if(_0x5dedfd===_0x5d5eaf)break;else _0x3a720e['push'](_0x3a720e['shift']());}catch(_0xbd4a57){_0x3a720e['push'](_0x3a720e['shift']());}}}(a44_0x2b40,0xa4bbe));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a44_0x317642 from'node:fs';import*as a44_0x5b00c5 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';function a44_0x447e(_0xca025e,_0x3ef099){_0xca025e=_0xca025e-0x148;const _0x2b40de=a44_0x2b40();let _0x447e84=_0x2b40de[_0xca025e];return _0x447e84;}import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a44_0x37c8bd from'chalk';export function getConfigDir(){const _0x5833b9=a44_0x447e;return process['env']['TDX_CONFIG_DIR']||join(homedir(),'.config',_0x5833b9(0x165));}export function getConfigFile(){const _0xc07a5f=a44_0x447e;return join(getConfigDir(),_0xc07a5f(0x15a));}export function getConfigFilePath(_0x426cf3){const _0x31ee1b=a44_0x447e,_0x48a91d=getConfigDir();return _0x426cf3?a44_0x5b00c5[_0x31ee1b(0x193)](_0x48a91d,'.env.'+_0x426cf3):getConfigFile();}export function getCacheDir(){const _0x56f224=a44_0x447e;return process['env']['TDX_CACHE_DIR']||join(homedir(),_0x56f224(0x168),_0x56f224(0x165));}export function getLLMProjectCacheFile(_0x2521d4){const _0x2f3b8f=a44_0x447e,_0x2f3ba2=_0x2521d4?_0x2f3b8f(0x14a)+_0x2521d4:_0x2f3b8f(0x15e);return join(getCacheDir(),_0x2f3ba2);}export function readCachedLLMProject(_0x369fbe){const _0x48efa=a44_0x447e;try{const _0x2fb26d=getLLMProjectCacheFile(_0x369fbe);if(!existsSync(_0x2fb26d))return null;const _0x213ae6=readFileSync(_0x2fb26d,_0x48efa(0x161))[_0x48efa(0x181)]();try{const _0x33529b=JSON[_0x48efa(0x166)](_0x213ae6);if(_0x33529b&&typeof _0x33529b['id']===_0x48efa(0x19b)&&typeof _0x33529b[_0x48efa(0x179)]==='string')return _0x33529b;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x274430,_0x35f155,_0x446117){const _0x534aa4=a44_0x447e;try{const _0x218262=getCacheDir(),_0x54b832=getLLMProjectCacheFile(_0x446117);!existsSync(_0x218262)&&mkdirSync(_0x218262,{'recursive':!![]});const _0x5efaaf={'name':_0x274430,'id':_0x35f155};writeFileSync(_0x54b832,JSON['stringify'](_0x5efaaf),_0x534aa4(0x161));}catch{}}export function getLLMAgentCacheFile(_0xd5162c){const _0x537622=a44_0x447e,_0x44d61c=_0xd5162c?_0x537622(0x199)+_0xd5162c:_0x537622(0x153);return join(getCacheDir(),_0x44d61c);}export function readCachedLLMAgent(_0x8f7f35){const _0x1d29ac=a44_0x447e;try{const _0x5a2172=getLLMAgentCacheFile(_0x8f7f35);if(!existsSync(_0x5a2172))return null;const _0x2e2878=readFileSync(_0x5a2172,_0x1d29ac(0x161))['trim']();try{const _0x357533=JSON['parse'](_0x2e2878);if(_0x357533&&typeof _0x357533['id']===_0x1d29ac(0x19b)&&typeof _0x357533[_0x1d29ac(0x179)]==='string'&&typeof _0x357533[_0x1d29ac(0x17c)]===_0x1d29ac(0x19b))return _0x357533;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x865f81,_0x417937,_0x4cbb0e,_0x14101e){const _0x4b4ef1=a44_0x447e;try{const _0x43fa9c=getCacheDir(),_0x56d0e4=getLLMAgentCacheFile(_0x14101e);!existsSync(_0x43fa9c)&&mkdirSync(_0x43fa9c,{'recursive':!![]});const _0x2d0fd3={'name':_0x865f81,'id':_0x417937,'projectId':_0x4cbb0e};writeFileSync(_0x56d0e4,JSON[_0x4b4ef1(0x171)](_0x2d0fd3),'utf-8');}catch{}}export function clearCachedLLMAgent(_0x71a90d){try{const _0x2fdefd=getLLMAgentCacheFile(_0x71a90d);existsSync(_0x2fdefd)&&unlinkSync(_0x2fdefd);}catch{}}export function getAccountInfoCacheFile(_0x472830){const _0x4e8934=_0x472830?'account_info.'+_0x472830+'.json':'account_info.json';return join(getCacheDir(),_0x4e8934);}export function readCachedAccountInfo(_0x414c9e){const _0x5f0cc=a44_0x447e;try{const _0x582fff=getAccountInfoCacheFile(_0x414c9e);if(!existsSync(_0x582fff))return null;const _0x2947d3=readFileSync(_0x582fff,'utf-8')[_0x5f0cc(0x181)](),_0x410986=JSON[_0x5f0cc(0x166)](_0x2947d3);if(_0x410986&&typeof _0x410986[_0x5f0cc(0x16e)]==='string'&&typeof _0x410986[_0x5f0cc(0x17d)]===_0x5f0cc(0x174))return _0x410986;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x3bcd33,_0x2ba5b0,_0x15284e){const _0x3d6a43=a44_0x447e;try{const _0x3ec967=getCacheDir(),_0x1572bb=getAccountInfoCacheFile(_0x15284e);!existsSync(_0x3ec967)&&mkdirSync(_0x3ec967,{'recursive':!![]});const _0x2d5f32={'site':_0x3bcd33,'accountId':_0x2ba5b0,'cachedAt':new Date()[_0x3d6a43(0x169)]()};writeFileSync(_0x1572bb,JSON[_0x3d6a43(0x171)](_0x2d5f32),_0x3d6a43(0x161));}catch{}}export function parseEnvFile(_0x8080af){const _0x33f7f5=a44_0x447e,_0x40f772={};for(const _0x58cc3f of _0x8080af['split']('\x0a')){const _0x4c2f8d=_0x58cc3f['trim']();if(!_0x4c2f8d||_0x4c2f8d[_0x33f7f5(0x185)]('#'))continue;const _0x39fa5e=_0x4c2f8d[_0x33f7f5(0x178)](/^([^=]+)=(.*)$/);if(_0x39fa5e){const _0x288a0c=_0x39fa5e[0x1][_0x33f7f5(0x181)]();let _0x4f4ed2=_0x39fa5e[0x2][_0x33f7f5(0x181)]();(_0x4f4ed2[_0x33f7f5(0x185)]('\x22')&&_0x4f4ed2[_0x33f7f5(0x18c)]('\x22')||_0x4f4ed2[_0x33f7f5(0x185)]('\x27')&&_0x4f4ed2[_0x33f7f5(0x18c)]('\x27'))&&(_0x4f4ed2=_0x4f4ed2[_0x33f7f5(0x151)](0x1,-0x1)),_0x40f772[_0x288a0c]=_0x4f4ed2;}}return _0x40f772;}export function readUserConfig(){const _0x12b01b=a44_0x447e,_0x5d7a71=getConfigFile();if(!existsSync(_0x5d7a71))return{};try{const _0x3d141=readFileSync(_0x5d7a71,_0x12b01b(0x161));return parseEnvFile(_0x3d141);}catch(_0x29b637){return console['warn']('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x5d7a71+':',_0x29b637),{};}}export function resolveSite(_0x26f570){const _0x1f89c6=a44_0x447e,_0x2aa38b=['us01',_0x1f89c6(0x18e),'eu01',_0x1f89c6(0x189),_0x1f89c6(0x173),_0x1f89c6(0x160),_0x1f89c6(0x187),'stg-us01',_0x1f89c6(0x182),_0x1f89c6(0x170)];if(_0x2aa38b['includes'](_0x26f570))return _0x26f570;if(_0x26f570 in SITE_ALIASES)return SITE_ALIASES[_0x26f570];return console[_0x1f89c6(0x15b)]('Warning:\x20Unknown\x20site\x20\x27'+_0x26f570+_0x1f89c6(0x157)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x518ea6,_0x318af3){const _0x1c0b9c=a44_0x447e,_0xaff957=_0x318af3||getActiveProfileName();if(_0xaff957){const _0x3f80e1=_0x1c0b9c(0x167)+normalizeProfileForEnvVar(_0xaff957);if(process['env'][_0x3f80e1])return process['env'][_0x3f80e1];}if(process[_0x1c0b9c(0x15d)][_0x1c0b9c(0x16d)])return process[_0x1c0b9c(0x15d)]['TDX_API_KEY'];if(process[_0x1c0b9c(0x15d)]['TD_API_KEY'])return process[_0x1c0b9c(0x15d)][_0x1c0b9c(0x15c)];const _0x3dbc88=_0x518ea6['toUpperCase']()[_0x1c0b9c(0x158)](/-/g,'_'),_0x5d6b62='TD_API_KEY_'+_0x3dbc88;if(_0xaff957){const _0x11856a=loadProfileEnv(_0xaff957);if(_0x11856a){if(_0x11856a[_0x5d6b62])return _0x11856a[_0x5d6b62];if(_0x11856a[_0x1c0b9c(0x15c)])return _0x11856a[_0x1c0b9c(0x15c)];}}const _0x2e0f5b=loadUserConfigOnce();if(_0x2e0f5b[_0x5d6b62])return _0x2e0f5b[_0x5d6b62];if(_0x2e0f5b[_0x1c0b9c(0x15c)])return _0x2e0f5b[_0x1c0b9c(0x15c)];return undefined;}export function normalizeProfileForEnvVar(_0x53bb1c){const _0x2aff59=a44_0x447e;return _0x53bb1c[_0x2aff59(0x191)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x3584d6,_0x361073){const _0x2d94ef=a44_0x447e,_0x37deef=_0x361073||getActiveProfileName()||undefined;if(_0x37deef){const _0x1fd985=_0x2d94ef(0x167)+normalizeProfileForEnvVar(_0x37deef);if(process[_0x2d94ef(0x15d)][_0x1fd985])return{'apiKey':process[_0x2d94ef(0x15d)][_0x1fd985],'source':_0x1fd985+_0x2d94ef(0x16f),'isDeprecated':![]};const _0xb10c16=getCachedCredential(_0x3584d6,_0x37deef);if(_0xb10c16)return{'apiKey':_0xb10c16,'source':'keychain\x20(profile:\x20'+_0x37deef+')','isDeprecated':![]};const _0x3ec093=await getKeychainAPIKey(_0x37deef);if(_0x3ec093)return setCachedCredential(_0x3ec093,_0x3584d6,_0x37deef),{'apiKey':_0x3ec093,'source':_0x2d94ef(0x15f)+_0x37deef+')','isDeprecated':![]};}if(process[_0x2d94ef(0x15d)][_0x2d94ef(0x16d)])return{'apiKey':process[_0x2d94ef(0x15d)][_0x2d94ef(0x16d)],'source':_0x2d94ef(0x17a),'isDeprecated':![]};if(!_0x37deef){const _0x5da7fe=getCachedCredential(_0x3584d6,undefined);if(_0x5da7fe)return{'apiKey':_0x5da7fe,'source':_0x2d94ef(0x163),'isDeprecated':![]};const _0x566d96=await getKeychainAPIKey(undefined);if(_0x566d96)return setCachedCredential(_0x566d96,_0x3584d6,undefined),{'apiKey':_0x566d96,'source':_0x2d94ef(0x163),'isDeprecated':![]};}if(process[_0x2d94ef(0x15d)][_0x2d94ef(0x15c)])return{'apiKey':process[_0x2d94ef(0x15d)][_0x2d94ef(0x15c)],'source':_0x2d94ef(0x177),'isDeprecated':!![]};const _0x366917=getLegacyEnvAPIKey(_0x3584d6,_0x37deef);if(_0x366917){const _0x406cda=await isKeychainAvailable();if(_0x406cda)try{await saveKeychainAPIKey(_0x366917,_0x37deef),setCachedCredential(_0x366917,_0x3584d6,_0x37deef);const _0x64e28b=getConfigFilePath(_0x37deef);cleanupLegacyEnvFile(_0x64e28b)&&console[_0x2d94ef(0x15b)](a44_0x37c8bd['yellow'](_0x2d94ef(0x16b)));}catch(_0x29ad40){console[_0x2d94ef(0x15b)](a44_0x37c8bd[_0x2d94ef(0x180)](_0x2d94ef(0x149)+_0x29ad40));}const _0x373d5a=_0x37deef?_0x2d94ef(0x18b)+_0x37deef+')':_0x2d94ef(0x16c);return{'apiKey':_0x366917,'source':_0x373d5a,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x3803e2,_0x2582d5,_0x189897=!![]){const _0x33e2d4=a44_0x447e,_0x56d6f1=await resolveAPIKeyAsync(_0x3803e2,_0x2582d5);if(!_0x56d6f1)return undefined;if(_0x189897&&_0x56d6f1[_0x33e2d4(0x14b)]&&_0x56d6f1[_0x33e2d4(0x16a)][_0x33e2d4(0x148)]('TD_API_KEY')){const _0x2a5cc9=_0x2582d5||getActiveProfileName()||undefined,_0x12daa1=_0x2a5cc9?_0x33e2d4(0x167)+normalizeProfileForEnvVar(_0x2a5cc9):_0x33e2d4(0x14d);console[_0x33e2d4(0x15b)](a44_0x37c8bd['yellow']('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x33e2d4(0x195)+_0x12daa1+').')));}return _0x56d6f1[_0x33e2d4(0x17b)];}function getLegacyEnvAPIKey(_0x557b38,_0x6d9c1c){const _0x3fb99c=a44_0x447e,_0xf70af8=_0x557b38[_0x3fb99c(0x191)]()['replace'](/-/g,'_'),_0x556650=_0x3fb99c(0x172)+_0xf70af8;if(_0x6d9c1c){const _0x418c26=loadProfileEnv(_0x6d9c1c);if(_0x418c26){if(_0x418c26[_0x556650])return _0x418c26[_0x556650];if(_0x418c26['TD_API_KEY'])return _0x418c26[_0x3fb99c(0x15c)];}}const _0x3d548f=loadUserConfigOnce();if(_0x3d548f[_0x556650])return _0x3d548f[_0x556650];if(_0x3d548f[_0x3fb99c(0x15c)])return _0x3d548f[_0x3fb99c(0x15c)];return undefined;}function cleanupLegacyEnvFile(_0x3b513a){const _0x5ec883=a44_0x447e;if(!existsSync(_0x3b513a))return![];try{const _0x5dc09d=readFileSync(_0x3b513a,'utf-8'),_0x3a6f6d=_0x5dc09d[_0x5ec883(0x184)]('\x0a'),_0x219b76=_0x3a6f6d[_0x5ec883(0x14f)](_0x2f522d=>{const _0x258ad4=_0x5ec883,_0x47567f=_0x2f522d[_0x258ad4(0x181)]();if(!_0x47567f||_0x47567f[_0x258ad4(0x185)]('#'))return!![];const [_0x1eec81]=_0x47567f[_0x258ad4(0x184)]('=');return!_0x1eec81[_0x258ad4(0x185)](_0x258ad4(0x15c));}),_0x5c7a4a=_0x219b76[_0x5ec883(0x19a)](_0x2b50fd=>{const _0x45975f=_0x5ec883,_0x48ce39=_0x2b50fd[_0x45975f(0x181)]();return _0x48ce39&&!_0x48ce39[_0x45975f(0x185)]('#');});if(!_0x5c7a4a)return unlinkSync(_0x3b513a),!![];return writeFileSync(_0x3b513a,_0x219b76[_0x5ec883(0x193)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x5a1086){const _0x131431=a44_0x447e,_0x3c5a14=a44_0x5b00c5['join'](getConfigDir(),_0x131431(0x196)+_0x5a1086);if(a44_0x317642['existsSync'](_0x3c5a14)){validateSecureFilePermissions(_0x3c5a14);try{const _0x16b611=a44_0x317642[_0x131431(0x194)](_0x3c5a14,'utf-8');return parseEnvFile(_0x16b611);}catch(_0x37a510){console[_0x131431(0x15b)]('Warning:\x20Failed\x20to\x20load\x20'+_0x3c5a14+':\x20'+_0x37a510);}}const _0xf863cd=a44_0x5b00c5[_0x131431(0x193)](getConfigDir(),_0x131431(0x188),_0x5a1086,_0x131431(0x15a));if(a44_0x317642[_0x131431(0x17f)](_0xf863cd)){validateSecureFilePermissions(_0xf863cd);try{const _0x16b5a0=a44_0x317642[_0x131431(0x194)](_0xf863cd,_0x131431(0x161));return parseEnvFile(_0x16b5a0);}catch(_0x2edf08){return console[_0x131431(0x15b)](_0x131431(0x197)+_0xf863cd+':\x20'+_0x2edf08),null;}}return null;}function a44_0x2b40(){const _0xf8bfe0=['ap02','stg-us01','legacy\x20.env\x20file\x20(profile:\x20','endsWith','161sWJCOY','jp01','4544470DIySml','901733dEtNXR','toUpperCase','apiKeys','join','readFileSync','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','.env.','Warning:\x20Failed\x20to\x20load\x20','50013RWzZjF','llm_default_agent.','some','string','includes','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','llm_default_project.','isDeprecated','312xIJiNV','TDX_API_KEY_<PROFILE>','profile','filter','11327370WFuszP','slice','1864VkZvzp','llm_default_agent','189XRDTtM','Warning:\x20Failed\x20to\x20read\x20','204930njKHrA','\x27,\x20defaulting\x20to\x20us01','replace','entries','.env','warn','TD_API_KEY','env','llm_default_project','keychain\x20(profile:\x20','dev-us01','utf-8','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','keychain','2RIjUuO','tdx','parse','TDX_API_KEY_','.cache','toISOString','source','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','legacy\x20.env\x20file','TDX_API_KEY','site','\x20env\x20var','stg-ap03','stringify','TD_API_KEY_','ap03','number','eu01','53528ByvMEK','TD_API_KEY\x20env\x20var\x20(deprecated)','match','name','TDX_API_KEY\x20env\x20var','apiKey','projectId','accountId','818554RIGaRJ','existsSync','yellow','trim','stg-jp01','us01','split','startsWith','map','dev-eu01','profiles'];a44_0x2b40=function(){return _0xf8bfe0;};return a44_0x2b40();}function getActiveProfileName(){const _0x41fe5c=a44_0x447e,_0x3ffeec=a44_0x5b00c5[_0x41fe5c(0x193)](getConfigDir(),'tdx.json');if(!a44_0x317642[_0x41fe5c(0x17f)](_0x3ffeec))return null;try{const _0x494f2b=a44_0x317642[_0x41fe5c(0x194)](_0x3ffeec,_0x41fe5c(0x161)),_0x2f6e62=JSON[_0x41fe5c(0x166)](_0x494f2b);return _0x2f6e62[_0x41fe5c(0x14e)]||null;}catch{return null;}}export function saveAPIKey(_0x20f82e,_0x2340d7,_0x5abaca){const _0x4ecdda=a44_0x447e,_0x59b080=getConfigDir(),_0x5bf621=getConfigFilePath(_0x5abaca);!existsSync(_0x59b080)&&mkdirSync(_0x59b080,{'recursive':!![],'mode':0x1c0});let _0x12a8e8={};if(existsSync(_0x5bf621))try{const _0x28f648=readFileSync(_0x5bf621,_0x4ecdda(0x161));_0x12a8e8=parseEnvFile(_0x28f648);}catch(_0x5dfe65){console['warn'](_0x4ecdda(0x155)+_0x5bf621+':',_0x5dfe65);}const _0x445407=_0x20f82e[_0x4ecdda(0x191)]()[_0x4ecdda(0x158)](/-/g,'_');_0x12a8e8[_0x4ecdda(0x172)+_0x445407]=_0x2340d7;const _0x4a58cb=Object[_0x4ecdda(0x159)](_0x12a8e8)[_0x4ecdda(0x186)](([_0x4c569d,_0x4ee2d5])=>_0x4c569d+'='+_0x4ee2d5);writeFileSync(_0x5bf621,_0x4a58cb[_0x4ecdda(0x193)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x4b0229,_0x47f501,_0x10489f){const _0x9cea7c=a44_0x447e;await saveKeychainAPIKey(_0x4b0229,_0x10489f),setCachedCredential(_0x4b0229,_0x47f501,_0x10489f);const _0x404145=getConfigFilePath(_0x10489f);cleanupLegacyEnvFile(_0x404145)&&console[_0x9cea7c(0x15b)](a44_0x37c8bd['yellow'](_0x9cea7c(0x162)));}export function loadConfig(){const _0x4d5a91=a44_0x447e,_0x79693a={'apiKeys':{},'defaultSite':_0x4d5a91(0x183)},_0x580d0e=['us01','jp01',_0x4d5a91(0x175),_0x4d5a91(0x189),_0x4d5a91(0x173),_0x4d5a91(0x160),'dev-eu01',_0x4d5a91(0x18a),_0x4d5a91(0x182),_0x4d5a91(0x170)];for(const _0x1d7314 of _0x580d0e){const _0x5f1657=getAPIKey(_0x1d7314);_0x5f1657&&(_0x79693a[_0x4d5a91(0x192)][_0x1d7314]=_0x5f1657);}return _0x79693a;}
|
|
1
|
+
(function(_0x501dd5,_0x20e552){const _0x511573=a44_0x5e06,_0xc6318e=_0x501dd5();while(!![]){try{const _0x3971c1=parseInt(_0x511573(0x11d))/0x1+parseInt(_0x511573(0xeb))/0x2*(parseInt(_0x511573(0x123))/0x3)+-parseInt(_0x511573(0xf2))/0x4+-parseInt(_0x511573(0xdc))/0x5+-parseInt(_0x511573(0xed))/0x6*(parseInt(_0x511573(0xe4))/0x7)+-parseInt(_0x511573(0xf7))/0x8*(parseInt(_0x511573(0x10f))/0x9)+parseInt(_0x511573(0x122))/0xa;if(_0x3971c1===_0x20e552)break;else _0xc6318e['push'](_0xc6318e['shift']());}catch(_0x25ca23){_0xc6318e['push'](_0xc6318e['shift']());}}}(a44_0x1e7c,0xec5e4));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a44_0x4723a7 from'node:fs';import*as a44_0x2d89f0 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a44_0x625295 from'chalk';function a44_0x1e7c(){const _0x12591d=['tdx','13943920dSRpWF','93rwWMEe','accountId','Warning:\x20Failed\x20to\x20read\x20','llm_default_agent','TD_API_KEY\x20env\x20var\x20(deprecated)','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','endsWith','isDeprecated','keychain','tdx.json','eu01','Warning:\x20Failed\x20to\x20load\x20','parse','.env.','profiles','5048795LPNetA','TD_API_KEY','stg-us01','us01','name','llm_default_project','stg-ap03','dev-us01','129479sGwBff','llm_default_agent.','jp01','stringify','yellow','account_info.json','.json','120712dmOPUv','.cache','426fcLJwI','join','apiKey','TDX_API_KEY\x20env\x20var','utf-8','4410312wBBvzZ','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','\x20env\x20var','ap02','warn','1488424OhXQJr','dev-eu01','map','\x27,\x20defaulting\x20to\x20us01','account_info.','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','source','split','some','match','ap03','keychain\x20(profile:\x20','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','TDX_CONFIG_DIR','includes','slice','existsSync','Warning:\x20Unknown\x20site\x20\x27','TDX_API_KEY_<PROFILE>','filter','TD_API_KEY_','toUpperCase','stg-jp01','.config','36jnQemn','env','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','TDX_API_KEY_','profile','replace','legacy\x20.env\x20file\x20(profile:\x20','string','site','apiKeys','.env','startsWith','number','trim','1872572XuqTDV','readFileSync','TDX_API_KEY','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'];a44_0x1e7c=function(){return _0x12591d;};return a44_0x1e7c();}export function getConfigDir(){const _0x26433c=a44_0x5e06;return process[_0x26433c(0x110)][_0x26433c(0x104)]||join(homedir(),_0x26433c(0x10e),'tdx');}function a44_0x5e06(_0x509055,_0x29196c){_0x509055=_0x509055-0xd2;const _0x1e7ca9=a44_0x1e7c();let _0x5e0649=_0x1e7ca9[_0x509055];return _0x5e0649;}export function getConfigFile(){const _0x37a0ad=a44_0x5e06;return join(getConfigDir(),_0x37a0ad(0x119));}export function getConfigFilePath(_0x44915a){const _0x3a955b=a44_0x5e06,_0x1e815a=getConfigDir();return _0x44915a?a44_0x2d89f0[_0x3a955b(0xee)](_0x1e815a,'.env.'+_0x44915a):getConfigFile();}export function getCacheDir(){const _0x48f3c9=a44_0x5e06;return process['env']['TDX_CACHE_DIR']||join(homedir(),_0x48f3c9(0xec),_0x48f3c9(0x121));}export function getLLMProjectCacheFile(_0xeaf820){const _0x183df5=a44_0x5e06,_0x246f64=_0xeaf820?'llm_default_project.'+_0xeaf820:_0x183df5(0xe1);return join(getCacheDir(),_0x246f64);}export function readCachedLLMProject(_0x4cf8d1){const _0xc02e9a=a44_0x5e06;try{const _0x3608e4=getLLMProjectCacheFile(_0x4cf8d1);if(!existsSync(_0x3608e4))return null;const _0x5a6860=readFileSync(_0x3608e4,_0xc02e9a(0xf1))[_0xc02e9a(0x11c)]();try{const _0x23eb29=JSON[_0xc02e9a(0xd9)](_0x5a6860);if(_0x23eb29&&typeof _0x23eb29['id']==='string'&&typeof _0x23eb29[_0xc02e9a(0xe0)]===_0xc02e9a(0x116))return _0x23eb29;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x421839,_0x39a6f7,_0x138fc){const _0x5e99c3=a44_0x5e06;try{const _0x3468cb=getCacheDir(),_0x2ffd21=getLLMProjectCacheFile(_0x138fc);!existsSync(_0x3468cb)&&mkdirSync(_0x3468cb,{'recursive':!![]});const _0x10494f={'name':_0x421839,'id':_0x39a6f7};writeFileSync(_0x2ffd21,JSON[_0x5e99c3(0xe7)](_0x10494f),_0x5e99c3(0xf1));}catch{}}export function getLLMAgentCacheFile(_0x5e01e5){const _0x416fca=a44_0x5e06,_0x534837=_0x5e01e5?_0x416fca(0xe5)+_0x5e01e5:_0x416fca(0x126);return join(getCacheDir(),_0x534837);}export function readCachedLLMAgent(_0x2a048c){const _0x72dc77=a44_0x5e06;try{const _0x4291ae=getLLMAgentCacheFile(_0x2a048c);if(!existsSync(_0x4291ae))return null;const _0x599dda=readFileSync(_0x4291ae,_0x72dc77(0xf1))[_0x72dc77(0x11c)]();try{const _0x1b53db=JSON[_0x72dc77(0xd9)](_0x599dda);if(_0x1b53db&&typeof _0x1b53db['id']===_0x72dc77(0x116)&&typeof _0x1b53db['name']===_0x72dc77(0x116)&&typeof _0x1b53db['projectId']===_0x72dc77(0x116))return _0x1b53db;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x57dc92,_0x1eafa6,_0x4ffa93,_0x532965){const _0x4bfb35=a44_0x5e06;try{const _0x191f52=getCacheDir(),_0x3c2cc5=getLLMAgentCacheFile(_0x532965);!existsSync(_0x191f52)&&mkdirSync(_0x191f52,{'recursive':!![]});const _0x2081b4={'name':_0x57dc92,'id':_0x1eafa6,'projectId':_0x4ffa93};writeFileSync(_0x3c2cc5,JSON['stringify'](_0x2081b4),_0x4bfb35(0xf1));}catch{}}export function clearCachedLLMAgent(_0x13515b){try{const _0x1f36c5=getLLMAgentCacheFile(_0x13515b);existsSync(_0x1f36c5)&&unlinkSync(_0x1f36c5);}catch{}}export function getAccountInfoCacheFile(_0x2fb309){const _0x525e44=a44_0x5e06,_0x32e8a9=_0x2fb309?_0x525e44(0xfb)+_0x2fb309+_0x525e44(0xea):_0x525e44(0xe9);return join(getCacheDir(),_0x32e8a9);}export function readCachedAccountInfo(_0x209117){const _0x2df24b=a44_0x5e06;try{const _0x506bb9=getAccountInfoCacheFile(_0x209117);if(!existsSync(_0x506bb9))return null;const _0x487168=readFileSync(_0x506bb9,'utf-8')['trim'](),_0x102589=JSON['parse'](_0x487168);if(_0x102589&&typeof _0x102589[_0x2df24b(0x117)]===_0x2df24b(0x116)&&typeof _0x102589[_0x2df24b(0x124)]===_0x2df24b(0x11b))return _0x102589;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x5b6f89,_0x24716a,_0xaeefb9){const _0x5d3ef5=a44_0x5e06;try{const _0x5add30=getCacheDir(),_0x19afe9=getAccountInfoCacheFile(_0xaeefb9);!existsSync(_0x5add30)&&mkdirSync(_0x5add30,{'recursive':!![]});const _0x37a5d1={'site':_0x5b6f89,'accountId':_0x24716a,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x19afe9,JSON[_0x5d3ef5(0xe7)](_0x37a5d1),_0x5d3ef5(0xf1));}catch{}}export function parseEnvFile(_0x2545ab){const _0x1ae5eb=a44_0x5e06,_0x3f2202={};for(const _0x305d40 of _0x2545ab[_0x1ae5eb(0xfe)]('\x0a')){const _0x1683f6=_0x305d40[_0x1ae5eb(0x11c)]();if(!_0x1683f6||_0x1683f6[_0x1ae5eb(0x11a)]('#'))continue;const _0x310dc6=_0x1683f6[_0x1ae5eb(0x100)](/^([^=]+)=(.*)$/);if(_0x310dc6){const _0x44f6fd=_0x310dc6[0x1]['trim']();let _0x4121b6=_0x310dc6[0x2][_0x1ae5eb(0x11c)]();(_0x4121b6[_0x1ae5eb(0x11a)]('\x22')&&_0x4121b6[_0x1ae5eb(0xd3)]('\x22')||_0x4121b6[_0x1ae5eb(0x11a)]('\x27')&&_0x4121b6[_0x1ae5eb(0xd3)]('\x27'))&&(_0x4121b6=_0x4121b6[_0x1ae5eb(0x106)](0x1,-0x1)),_0x3f2202[_0x44f6fd]=_0x4121b6;}}return _0x3f2202;}export function readUserConfig(){const _0x312a92=a44_0x5e06,_0x2c7a3a=getConfigFile();if(!existsSync(_0x2c7a3a))return{};try{const _0x2d0323=readFileSync(_0x2c7a3a,_0x312a92(0xf1));return parseEnvFile(_0x2d0323);}catch(_0x286398){return console[_0x312a92(0xf6)](_0x312a92(0x111)+_0x2c7a3a+':',_0x286398),{};}}export function resolveSite(_0x2bcbc1){const _0x39f39b=a44_0x5e06,_0x830a16=['us01',_0x39f39b(0xe6),_0x39f39b(0xd7),_0x39f39b(0xf5),_0x39f39b(0x101),'dev-us01',_0x39f39b(0xf8),_0x39f39b(0xde),_0x39f39b(0x10d),_0x39f39b(0xe2)];if(_0x830a16[_0x39f39b(0x105)](_0x2bcbc1))return _0x2bcbc1;if(_0x2bcbc1 in SITE_ALIASES)return SITE_ALIASES[_0x2bcbc1];return console['warn'](_0x39f39b(0x108)+_0x2bcbc1+_0x39f39b(0xfa)),_0x39f39b(0xdf);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x55fa32,_0xbf4fcf){const _0x143a89=a44_0x5e06,_0x1b1e76=_0xbf4fcf||getActiveProfileName();if(_0x1b1e76){const _0x3a42ff='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x1b1e76);if(process[_0x143a89(0x110)][_0x3a42ff])return process[_0x143a89(0x110)][_0x3a42ff];}if(process[_0x143a89(0x110)][_0x143a89(0x11f)])return process[_0x143a89(0x110)]['TDX_API_KEY'];if(process[_0x143a89(0x110)][_0x143a89(0xdd)])return process[_0x143a89(0x110)][_0x143a89(0xdd)];const _0x1b7da4=_0x55fa32['toUpperCase']()['replace'](/-/g,'_'),_0x3a7d41=_0x143a89(0x10b)+_0x1b7da4;if(_0x1b1e76){const _0x3f4700=loadProfileEnv(_0x1b1e76);if(_0x3f4700){if(_0x3f4700[_0x3a7d41])return _0x3f4700[_0x3a7d41];if(_0x3f4700[_0x143a89(0xdd)])return _0x3f4700[_0x143a89(0xdd)];}}const _0x812cb9=loadUserConfigOnce();if(_0x812cb9[_0x3a7d41])return _0x812cb9[_0x3a7d41];if(_0x812cb9[_0x143a89(0xdd)])return _0x812cb9[_0x143a89(0xdd)];return undefined;}export function normalizeProfileForEnvVar(_0xa0fd0d){const _0x284bd=a44_0x5e06;return _0xa0fd0d[_0x284bd(0x10c)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x4605a0,_0x1e8ad8){const _0x46c681=a44_0x5e06,_0x1406d6=_0x1e8ad8||getActiveProfileName()||undefined;if(_0x1406d6){const _0x58721d=_0x46c681(0x112)+normalizeProfileForEnvVar(_0x1406d6);if(process['env'][_0x58721d])return{'apiKey':process[_0x46c681(0x110)][_0x58721d],'source':_0x58721d+_0x46c681(0xf4),'isDeprecated':![]};const _0x4f88ce=getCachedCredential(_0x4605a0,_0x1406d6);if(_0x4f88ce)return{'apiKey':_0x4f88ce,'source':_0x46c681(0x102)+_0x1406d6+')','isDeprecated':![]};const _0x19b891=await getKeychainAPIKey(_0x1406d6);if(_0x19b891)return setCachedCredential(_0x19b891,_0x4605a0,_0x1406d6),{'apiKey':_0x19b891,'source':_0x46c681(0x102)+_0x1406d6+')','isDeprecated':![]};}if(process[_0x46c681(0x110)][_0x46c681(0x11f)])return{'apiKey':process[_0x46c681(0x110)][_0x46c681(0x11f)],'source':_0x46c681(0xf0),'isDeprecated':![]};if(!_0x1406d6){const _0x4c88f3=getCachedCredential(_0x4605a0,undefined);if(_0x4c88f3)return{'apiKey':_0x4c88f3,'source':_0x46c681(0xd5),'isDeprecated':![]};const _0x139249=await getKeychainAPIKey(undefined);if(_0x139249)return setCachedCredential(_0x139249,_0x4605a0,undefined),{'apiKey':_0x139249,'source':'keychain','isDeprecated':![]};}if(process['env']['TD_API_KEY'])return{'apiKey':process[_0x46c681(0x110)][_0x46c681(0xdd)],'source':_0x46c681(0x127),'isDeprecated':!![]};const _0x3a4ee9=getLegacyEnvAPIKey(_0x4605a0,_0x1406d6);if(_0x3a4ee9){const _0x2e9404=await isKeychainAvailable();if(_0x2e9404)try{await saveKeychainAPIKey(_0x3a4ee9,_0x1406d6),setCachedCredential(_0x3a4ee9,_0x4605a0,_0x1406d6);const _0x2c40ca=getConfigFilePath(_0x1406d6);cleanupLegacyEnvFile(_0x2c40ca)&&console['warn'](a44_0x625295[_0x46c681(0xe8)](_0x46c681(0xf3)));}catch(_0x3ab145){console[_0x46c681(0xf6)](a44_0x625295[_0x46c681(0xe8)](_0x46c681(0x103)+_0x3ab145));}const _0x5b7ec8=_0x1406d6?_0x46c681(0x115)+_0x1406d6+')':'legacy\x20.env\x20file';return{'apiKey':_0x3a4ee9,'source':_0x5b7ec8,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x5604b6,_0x49665d,_0x127f8e=!![]){const _0x300315=a44_0x5e06,_0x36032b=await resolveAPIKeyAsync(_0x5604b6,_0x49665d);if(!_0x36032b)return undefined;if(_0x127f8e&&_0x36032b[_0x300315(0xd4)]&&_0x36032b[_0x300315(0xfd)][_0x300315(0x105)](_0x300315(0xdd))){const _0x669d04=_0x49665d||getActiveProfileName()||undefined,_0x46cbe2=_0x669d04?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x669d04):_0x300315(0x109);console['warn'](a44_0x625295[_0x300315(0xe8)](_0x300315(0xd2)+(_0x300315(0xfc)+_0x46cbe2+').')));}return _0x36032b[_0x300315(0xef)];}function getLegacyEnvAPIKey(_0x5dbc11,_0x14455c){const _0x53e3a9=a44_0x5e06,_0x55f3ac=_0x5dbc11[_0x53e3a9(0x10c)]()[_0x53e3a9(0x114)](/-/g,'_'),_0x31ae2d=_0x53e3a9(0x10b)+_0x55f3ac;if(_0x14455c){const _0x28ac5b=loadProfileEnv(_0x14455c);if(_0x28ac5b){if(_0x28ac5b[_0x31ae2d])return _0x28ac5b[_0x31ae2d];if(_0x28ac5b[_0x53e3a9(0xdd)])return _0x28ac5b[_0x53e3a9(0xdd)];}}const _0x157d73=loadUserConfigOnce();if(_0x157d73[_0x31ae2d])return _0x157d73[_0x31ae2d];if(_0x157d73[_0x53e3a9(0xdd)])return _0x157d73['TD_API_KEY'];return undefined;}function cleanupLegacyEnvFile(_0x22f5c1){const _0x35a9cd=a44_0x5e06;if(!existsSync(_0x22f5c1))return![];try{const _0x17756e=readFileSync(_0x22f5c1,_0x35a9cd(0xf1)),_0x22e692=_0x17756e[_0x35a9cd(0xfe)]('\x0a'),_0xe9d295=_0x22e692[_0x35a9cd(0x10a)](_0x4e549c=>{const _0x15b13f=_0x35a9cd,_0x514201=_0x4e549c['trim']();if(!_0x514201||_0x514201[_0x15b13f(0x11a)]('#'))return!![];const [_0x211b20]=_0x514201[_0x15b13f(0xfe)]('=');return!_0x211b20[_0x15b13f(0x11a)](_0x15b13f(0xdd));}),_0x3b0a62=_0xe9d295[_0x35a9cd(0xff)](_0x23e3d8=>{const _0x5651bf=_0x35a9cd,_0x2342af=_0x23e3d8['trim']();return _0x2342af&&!_0x2342af[_0x5651bf(0x11a)]('#');});if(!_0x3b0a62)return unlinkSync(_0x22f5c1),!![];return writeFileSync(_0x22f5c1,_0xe9d295[_0x35a9cd(0xee)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x2edcf8){const _0x5662ce=a44_0x5e06,_0x2dd321=a44_0x2d89f0['join'](getConfigDir(),_0x5662ce(0xda)+_0x2edcf8);if(a44_0x4723a7[_0x5662ce(0x107)](_0x2dd321)){validateSecureFilePermissions(_0x2dd321);try{const _0x140528=a44_0x4723a7[_0x5662ce(0x11e)](_0x2dd321,_0x5662ce(0xf1));return parseEnvFile(_0x140528);}catch(_0x869fca){console[_0x5662ce(0xf6)]('Warning:\x20Failed\x20to\x20load\x20'+_0x2dd321+':\x20'+_0x869fca);}}const _0x443f43=a44_0x2d89f0['join'](getConfigDir(),_0x5662ce(0xdb),_0x2edcf8,'.env');if(a44_0x4723a7[_0x5662ce(0x107)](_0x443f43)){validateSecureFilePermissions(_0x443f43);try{const _0x5b658b=a44_0x4723a7[_0x5662ce(0x11e)](_0x443f43,_0x5662ce(0xf1));return parseEnvFile(_0x5b658b);}catch(_0x36afb2){return console[_0x5662ce(0xf6)](_0x5662ce(0xd8)+_0x443f43+':\x20'+_0x36afb2),null;}}return null;}function getActiveProfileName(){const _0x4fef33=a44_0x5e06,_0x20bc7=a44_0x2d89f0[_0x4fef33(0xee)](getConfigDir(),_0x4fef33(0xd6));if(!a44_0x4723a7['existsSync'](_0x20bc7))return null;try{const _0x2b1888=a44_0x4723a7[_0x4fef33(0x11e)](_0x20bc7,_0x4fef33(0xf1)),_0x37d56e=JSON['parse'](_0x2b1888);return _0x37d56e[_0x4fef33(0x113)]||null;}catch{return null;}}export function saveAPIKey(_0x1287e6,_0x737644,_0x459723){const _0x503e42=a44_0x5e06,_0x469218=getConfigDir(),_0x2e68ad=getConfigFilePath(_0x459723);!existsSync(_0x469218)&&mkdirSync(_0x469218,{'recursive':!![],'mode':0x1c0});let _0x57dab4={};if(existsSync(_0x2e68ad))try{const _0x22053c=readFileSync(_0x2e68ad,'utf-8');_0x57dab4=parseEnvFile(_0x22053c);}catch(_0xc56116){console[_0x503e42(0xf6)](_0x503e42(0x125)+_0x2e68ad+':',_0xc56116);}const _0x45f1af=_0x1287e6[_0x503e42(0x10c)]()[_0x503e42(0x114)](/-/g,'_');_0x57dab4[_0x503e42(0x10b)+_0x45f1af]=_0x737644;const _0x566414=Object['entries'](_0x57dab4)[_0x503e42(0xf9)](([_0xdb063d,_0xec3c64])=>_0xdb063d+'='+_0xec3c64);writeFileSync(_0x2e68ad,_0x566414['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x509ebd,_0x2aa048,_0x57744c){const _0x180e25=a44_0x5e06;await saveKeychainAPIKey(_0x509ebd,_0x57744c),setCachedCredential(_0x509ebd,_0x2aa048,_0x57744c);const _0x263b0d=getConfigFilePath(_0x57744c);cleanupLegacyEnvFile(_0x263b0d)&&console[_0x180e25(0xf6)](a44_0x625295['yellow'](_0x180e25(0x120)));}export function loadConfig(){const _0x1c3634=a44_0x5e06,_0x490280={'apiKeys':{},'defaultSite':_0x1c3634(0xdf)},_0xbed333=[_0x1c3634(0xdf),_0x1c3634(0xe6),_0x1c3634(0xd7),'ap02',_0x1c3634(0x101),_0x1c3634(0xe3),_0x1c3634(0xf8),_0x1c3634(0xde),_0x1c3634(0x10d),_0x1c3634(0xe2)];for(const _0x2d77d1 of _0xbed333){const _0xe72944=getAPIKey(_0x2d77d1);_0xe72944&&(_0x490280[_0x1c3634(0x118)][_0x2d77d1]=_0xe72944);}return _0x490280;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1f391b,_0x27f5f3){const _0x1cd5a2=a45_0x5854,_0x2df1ff=_0x1f391b();while(!![]){try{const _0x38914d=parseInt(_0x1cd5a2(0x14a))/0x1*(parseInt(_0x1cd5a2(0x141))/0x2)+parseInt(_0x1cd5a2(0x145))/0x3+-parseInt(_0x1cd5a2(0x140))/0x4+parseInt(_0x1cd5a2(0x143))/0x5+parseInt(_0x1cd5a2(0x146))/0x6*(-parseInt(_0x1cd5a2(0x13e))/0x7)+parseInt(_0x1cd5a2(0x14d))/0x8+-parseInt(_0x1cd5a2(0x148))/0x9;if(_0x38914d===_0x27f5f3)break;else _0x2df1ff['push'](_0x2df1ff['shift']());}catch(_0x57c208){_0x2df1ff['push'](_0x2df1ff['shift']());}}}(a45_0x4831,0xe10a7));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';function a45_0x4831(){const _0x4b74db=['10302yBMCuO','stringify','16390143Xvaoip','.json','221492jGYiyR','connections-','now','7593176BOAuRU','1414qRkbUg','parse','6212780QVAGsT','14NcdUvr','connections','8166235iHngbT','utf-8','1530255yoQruO'];a45_0x4831=function(){return _0x4b74db;};return a45_0x4831();}function a45_0x5854(_0x33f106,_0x177172){_0x33f106=_0x33f106-0x13e;const _0x483146=a45_0x4831();let _0x5854cd=_0x483146[_0x33f106];return _0x5854cd;}import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x17ddb6){const _0x49370f=a45_0x5854,_0x146ced=_0x17ddb6||'default';return join(getCacheDir(),_0x49370f(0x14b)+_0x146ced+_0x49370f(0x149));}export function loadCachedConnections(_0x4866d1){const _0x5e9e62=a45_0x5854,_0x2572a8=getCacheFilePath(_0x4866d1);if(!existsSync(_0x2572a8))return null;try{const _0x307665=readFileSync(_0x2572a8,_0x5e9e62(0x144)),_0x424493=JSON[_0x5e9e62(0x13f)](_0x307665);return _0x424493[_0x5e9e62(0x142)];}catch{return null;}}export function saveCachedConnections(_0x468c9f,_0x149f54){const _0x3dd8a9=a45_0x5854,_0x301d19=getCacheDir();!existsSync(_0x301d19)&&mkdirSync(_0x301d19,{'recursive':!![]});const _0x1958fb=getCacheFilePath(_0x468c9f),_0x4463a5={'connections':_0x149f54,'cachedAt':Date[_0x3dd8a9(0x14c)]()};writeFileSync(_0x1958fb,JSON[_0x3dd8a9(0x147)](_0x4463a5,null,0x2),_0x3dd8a9(0x144));}export function clearConnectionCache(_0x380f3d){const _0x3f10cb=getCacheFilePath(_0x380f3d);if(existsSync(_0x3f10cb))try{unlinkSync(_0x3f10cb);}catch{}}
|
package/dist/core/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x164c91,_0x637c9c){const _0x453961=a46_0x180f,_0x32a2d3=_0x164c91();while(!![]){try{const _0x1a0175=parseInt(_0x453961(0x10c))/0x1*(-parseInt(_0x453961(0x10d))/0x2)+-parseInt(_0x453961(0x107))/0x3+parseInt(_0x453961(0x10b))/0x4*(-parseInt(_0x453961(0x110))/0x5)+parseInt(_0x453961(0x106))/0x6*(-parseInt(_0x453961(0x10f))/0x7)+-parseInt(_0x453961(0x105))/0x8*(parseInt(_0x453961(0x109))/0x9)+parseInt(_0x453961(0x111))/0xa+-parseInt(_0x453961(0x10e))/0xb*(-parseInt(_0x453961(0x108))/0xc);if(_0x1a0175===_0x637c9c)break;else _0x32a2d3['push'](_0x32a2d3['shift']());}catch(_0xa3880d){_0x32a2d3['push'](_0x32a2d3['shift']());}}}(a46_0x528e,0x8695b));function a46_0x180f(_0x3d4186,_0x11c0e3){_0x3d4186=_0x3d4186-0x105;const _0x528ecb=a46_0x528e();let _0x180f4f=_0x528ecb[_0x3d4186];return _0x180f4f;}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;function a46_0x528e(){const _0x1a679d=['311775mGDSBY','4385230TKRcEY','24RVjptP','2796XahUSP','2324832NorCfC','4836undcpl','2655711UmPRkl','number','44bBSHVo','2yxIgDG','708766sGTYEk','98582HaiobX','6671oDLasB'];a46_0x528e=function(){return _0x1a679d;};return a46_0x528e();}export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0xa4d7e7,_0x546d1f){const _0x3ff9ec=a46_0x180f;if(_0xa4d7e7===undefined)return _0x546d1f;if(typeof _0xa4d7e7===_0x3ff9ec(0x10a))return _0xa4d7e7;return parseInt(_0xa4d7e7,0xa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e330a,_0x305726){const _0x38ca78=a47_0x252a,_0x2b25b5=_0x1e330a();while(!![]){try{const _0x36f100=parseInt(_0x38ca78(0xb3))/0x1+parseInt(_0x38ca78(0xb6))/0x2+parseInt(_0x38ca78(0xb9))/0x3*(parseInt(_0x38ca78(0xb5))/0x4)+-parseInt(_0x38ca78(0xbe))/0x5+-parseInt(_0x38ca78(0xbc))/0x6*(parseInt(_0x38ca78(0xb7))/0x7)+parseInt(_0x38ca78(0xc1))/0x8+parseInt(_0x38ca78(0xba))/0x9*(-parseInt(_0x38ca78(0xb8))/0xa);if(_0x36f100===_0x305726)break;else _0x2b25b5['push'](_0x2b25b5['shift']());}catch(_0x4ca250){_0x2b25b5['push'](_0x2b25b5['shift']());}}}(a47_0x2976,0x2891e));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x518103,_0x1c1346){const _0x25aef3=a47_0x252a,_0x5e4af2=_0x518103||_0x25aef3(0xbb),_0xe77a63=_0x1c1346||'__default_profile__';return _0x5e4af2+':'+_0xe77a63;}function a47_0x2976(){const _0x37b703=['717AZuYKf','47961SfEbnx','__default_site__','834diQwho','now','426600aBtHWp','delete','clear','2001456ASOADR','set','295421vgZtWj','get','1396rvTECa','252508hfffCO','10073eBOALz','570wyDdVn'];a47_0x2976=function(){return _0x37b703;};return a47_0x2976();}function a47_0x252a(_0x1ae280,_0x30db4e){_0x1ae280=_0x1ae280-0xb2;const _0x297633=a47_0x2976();let _0x252a8a=_0x297633[_0x1ae280];return _0x252a8a;}export function getCachedCredential(_0x9cb0a7,_0x3111ff){const _0x6433ee=a47_0x252a,_0x548e3d=getCacheKey(_0x9cb0a7,_0x3111ff),_0x3d7c8a=cache[_0x6433ee(0xb4)](_0x548e3d);if(!_0x3d7c8a)return null;if(Date[_0x6433ee(0xbd)]()-_0x3d7c8a['loadedAt']>CACHE_TTL_MS)return cache[_0x6433ee(0xbf)](_0x548e3d),null;return _0x3d7c8a['apiKey'];}export function setCachedCredential(_0x300758,_0x7f936b,_0x3473c4){const _0x41d195=a47_0x252a,_0x11f59b=getCacheKey(_0x7f936b,_0x3473c4);cache[_0x41d195(0xb2)](_0x11f59b,{'apiKey':_0x300758,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x47e642=a47_0x252a;cache[_0x47e642(0xc0)]();}export function clearCachedCredential(_0x59d19e,_0x398909){const _0x9b571d=a47_0x252a,_0x2d784e=getCacheKey(_0x59d19e,_0x398909);cache[_0x9b571d(0xbf)](_0x2d784e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a48_0x432606=a48_0x445f;function a48_0x5d45(){const _0x4ac3f1=['Global','llm_agent','us01','parent_segment','(session:\x20','profile:\x20','Profile\x20Credentials','site','loadGlobalConfig','existsSync','.env','readFileSync','verbose','parse','124585cQidMF','CLI\x20flag:\x20--',':\x20none\x20(using\x20session:\x20','26734776BkuLUQ',':\x20none','sessions','1727193eHoEhb','replace','Project','database','INFO','displayWithSources','display','profileCredentials','profiles','utf-8','TDX_SITE','llmProject','assign','resolveAPIKeyAsync','toString','workflowProject','apiKey','10971936KBNcvj','2111606FjzCZV','workflow_project','segmentPath','sessionId','getSource','tdx.json','[context]','getParameters','2307476YbOFpd','.json','llmAgent','not\x20set','log','Session','string','project','global','llm_project','Profile','join','1252084MhdWcP','layers','env','logLevel','\x0a[configuration\x20files]','default','injectIntoOptions','profile','(active)','configFiles','session','parentSegment','1GLqKGc','segment_path','activeProfile'];a48_0x5d45=function(){return _0x4ac3f1;};return a48_0x5d45();}(function(_0xa8a7ab,_0x37b6cd){const _0x140ca6=a48_0x445f,_0x1a4fae=_0xa8a7ab();while(!![]){try{const _0x2aa209=-parseInt(_0x140ca6(0x1b2))/0x1*(parseInt(_0x140ca6(0x19a))/0x2)+parseInt(_0x140ca6(0x180))/0x3+parseInt(_0x140ca6(0x1a6))/0x4+parseInt(_0x140ca6(0x17a))/0x5+-parseInt(_0x140ca6(0x191))/0x6+-parseInt(_0x140ca6(0x192))/0x7+parseInt(_0x140ca6(0x17d))/0x8;if(_0x2aa209===_0x37b6cd)break;else _0x1a4fae['push'](_0x1a4fae['shift']());}catch(_0x324249){_0x1a4fae['push'](_0x1a4fae['shift']());}}}(a48_0x5d45,0xed2c8));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';import*as a48_0x44b38c from'node:fs';import*as a48_0x55f5f8 from'node:path';function a48_0x445f(_0xbbd14a,_0x44528c){_0xbbd14a=_0xbbd14a-0x171;const _0x5d4532=a48_0x5d45();let _0x445f7a=_0x5d4532[_0xbbd14a];return _0x445f7a;}export class GlobalContext{[a48_0x432606(0x173)];[a48_0x432606(0x183)];[a48_0x432606(0x1b8)];['segment_path'];['llm_project'];[a48_0x432606(0x1b6)];[a48_0x432606(0x193)];[a48_0x432606(0x190)];[a48_0x432606(0x178)];[a48_0x432606(0x1a9)];[a48_0x432606(0x1ad)];[a48_0x432606(0x1a7)];[a48_0x432606(0x1b4)];[a48_0x432606(0x195)];['configFiles'];constructor(_0x45f279){const _0x5ea71c=a48_0x432606;this[_0x5ea71c(0x195)]=_0x45f279[_0x5ea71c(0x1b0)]||getCurrentSessionPID()[_0x5ea71c(0x18e)]();const _0xa14665=loadSessionContext(_0x45f279['session']),_0x16b08b=loadProjectConfig(),_0x37ece0=this[_0x5ea71c(0x174)]();this[_0x5ea71c(0x1b4)]=_0x45f279[_0x5ea71c(0x1ad)]||_0xa14665?.[_0x5ea71c(0x1ad)]||_0x37ece0['profile']||getActiveProfile();const _0x496694=this[_0x5ea71c(0x1b4)]?loadProfile(this[_0x5ea71c(0x1b4)]):null,_0x4306ab=_0x936e5c=>{const _0x31d29b=_0x5ea71c;if(!_0x936e5c)return{};const _0x980db8=_0x936e5c,_0x2e9cb4={};for(const [_0x322b3a,_0x45a769]of Object['entries'](_0x980db8)){typeof _0x45a769===_0x31d29b(0x1a0)&&(_0x2e9cb4[_0x322b3a]=_0x45a769);}return _0x2e9cb4;},_0x92c7ab={};if(_0x45f279['site']&&_0x45f279['site']!==_0x5ea71c(0x1b7))_0x92c7ab[_0x5ea71c(0x173)]=_0x45f279[_0x5ea71c(0x173)];const _0x28e46a=_0xa14665?.['database'],_0x1f5139=_0x16b08b?.['database'],_0x49bfc7=_0x496694?.['config']?.[_0x5ea71c(0x183)],_0x44a61c=_0x37ece0['database'];_0x45f279[_0x5ea71c(0x183)]&&(_0x45f279[_0x5ea71c(0x183)]!==_0x28e46a&&_0x45f279[_0x5ea71c(0x183)]!==_0x1f5139&&_0x45f279[_0x5ea71c(0x183)]!==_0x49bfc7&&_0x45f279[_0x5ea71c(0x183)]!==_0x44a61c)&&(_0x92c7ab[_0x5ea71c(0x183)]=_0x45f279[_0x5ea71c(0x183)]);if(_0x45f279[_0x5ea71c(0x1b1)])_0x92c7ab[_0x5ea71c(0x1b8)]=_0x45f279[_0x5ea71c(0x1b1)];if(_0x45f279[_0x5ea71c(0x18b)])_0x92c7ab[_0x5ea71c(0x1a3)]=_0x45f279[_0x5ea71c(0x18b)];if(_0x45f279['llmAgent'])_0x92c7ab[_0x5ea71c(0x1b6)]=_0x45f279[_0x5ea71c(0x19c)];if(_0x45f279[_0x5ea71c(0x1ad)])_0x92c7ab[_0x5ea71c(0x1ad)]=_0x45f279[_0x5ea71c(0x1ad)];this[_0x5ea71c(0x1a7)]={'cliFlags':_0x92c7ab,'session':_0x4306ab(_0xa14665),'project':_0x4306ab(_0x16b08b),'profile':_0x4306ab(_0x496694?.['config']),'global':_0x4306ab(_0x37ece0)};const _0x2feaf9={...this[_0x5ea71c(0x1a7)][_0x5ea71c(0x1a2)],...this[_0x5ea71c(0x1a7)][_0x5ea71c(0x1ad)],...this[_0x5ea71c(0x1a7)][_0x5ea71c(0x1a1)]};process[_0x5ea71c(0x1a8)][_0x5ea71c(0x18a)]&&!this[_0x5ea71c(0x1a7)][_0x5ea71c(0x1b0)][_0x5ea71c(0x173)]&&!this[_0x5ea71c(0x1a7)]['cliFlags']['site']&&(_0x2feaf9['site']=process['env']['TDX_SITE']);Object[_0x5ea71c(0x18c)](_0x2feaf9,this['layers'][_0x5ea71c(0x1b0)]),Object[_0x5ea71c(0x18c)](_0x2feaf9,this[_0x5ea71c(0x1a7)]['cliFlags']);const _0x53a7c9=_0x2feaf9['site']||_0x5ea71c(0x1b7);this['site']=resolveSite(_0x53a7c9),this[_0x5ea71c(0x183)]=_0x2feaf9[_0x5ea71c(0x183)],this['parent_segment']=_0x2feaf9[_0x5ea71c(0x1b8)],this['segment_path']=_0x2feaf9[_0x5ea71c(0x1b3)],this[_0x5ea71c(0x1a3)]=_0x2feaf9[_0x5ea71c(0x1a3)],this['llm_agent']=_0x2feaf9[_0x5ea71c(0x1b6)],this['workflow_project']=_0x2feaf9[_0x5ea71c(0x193)],this[_0x5ea71c(0x178)]=_0x45f279['verbose']||![],this[_0x5ea71c(0x1a9)]=_0x45f279[_0x5ea71c(0x1a9)]??LogLevel[_0x5ea71c(0x184)],this[_0x5ea71c(0x1ad)]=this[_0x5ea71c(0x1b4)]||undefined,this[_0x5ea71c(0x190)]=getAPIKey(this['site'],this[_0x5ea71c(0x1b4)]||undefined);const _0x56d12d=getConfigDir(),_0x4ae3fe=a48_0x55f5f8[_0x5ea71c(0x1a5)](_0x56d12d,_0x5ea71c(0x17f),this[_0x5ea71c(0x195)]+_0x5ea71c(0x19b)),_0x37672c=findProjectConfigPath(),_0x50af85=a48_0x55f5f8[_0x5ea71c(0x1a5)](_0x56d12d,_0x5ea71c(0x197)),_0x5e8ba8=a48_0x55f5f8['join'](_0x56d12d,_0x5ea71c(0x176));let _0x2a25ad=null,_0x1de0f2=null;this[_0x5ea71c(0x1b4)]&&(_0x2a25ad=a48_0x55f5f8[_0x5ea71c(0x1a5)](_0x56d12d,_0x5ea71c(0x188),this[_0x5ea71c(0x1b4)],'tdx.json'),_0x1de0f2=a48_0x55f5f8[_0x5ea71c(0x1a5)](_0x56d12d,_0x5ea71c(0x188),this['activeProfile'],_0x5ea71c(0x176))),this[_0x5ea71c(0x1af)]={'session':a48_0x44b38c[_0x5ea71c(0x175)](_0x4ae3fe)?_0x4ae3fe:null,'project':_0x37672c,'profile':_0x2a25ad&&a48_0x44b38c[_0x5ea71c(0x175)](_0x2a25ad)?_0x2a25ad:null,'profileCredentials':_0x1de0f2&&a48_0x44b38c['existsSync'](_0x1de0f2)?_0x1de0f2:null,'global':a48_0x44b38c[_0x5ea71c(0x175)](_0x50af85)?_0x50af85:null,'globalCredentials':a48_0x44b38c[_0x5ea71c(0x175)](_0x5e8ba8)?_0x5e8ba8:null};}[a48_0x432606(0x196)](_0x592e61,_0x22b83b){const _0x189995=a48_0x432606;if(!_0x22b83b)return _0x189995(0x19d);const _0xb0ba8=_0x22b83b;if(this['layers']['cliFlags'][_0x592e61]===_0xb0ba8){if(_0x592e61===_0x189995(0x173)&&_0xb0ba8===_0x189995(0x1b7)&&!this[_0x189995(0x1a7)][_0x189995(0x1b0)]['site']&&!this[_0x189995(0x1a7)][_0x189995(0x1a1)][_0x189995(0x173)]&&!this[_0x189995(0x1a7)]['profile'][_0x189995(0x173)]&&!this[_0x189995(0x1a7)]['global']['site'])return _0x189995(0x1ab);return _0x189995(0x17b)+_0x592e61[_0x189995(0x181)](/_/g,'-');}if(this[_0x189995(0x1a7)][_0x189995(0x1b0)][_0x592e61]===_0xb0ba8)return _0x189995(0x1b0);if(this[_0x189995(0x1a7)]['project'][_0x592e61]===_0xb0ba8)return _0x189995(0x1a1);if(this[_0x189995(0x1a7)][_0x189995(0x1ad)][_0x592e61]===_0xb0ba8)return _0x189995(0x171)+this['activeProfile'];if(this[_0x189995(0x1a7)]['global'][_0x592e61]===_0xb0ba8)return _0x189995(0x1a2);return _0x189995(0x1ab);}[a48_0x432606(0x174)](){const _0x5ba1df=a48_0x432606,_0x1f888c=a48_0x55f5f8[_0x5ba1df(0x1a5)](getConfigDir(),'tdx.json');if(!a48_0x44b38c[_0x5ba1df(0x175)](_0x1f888c))return{};try{const _0x533a1e=a48_0x44b38c[_0x5ba1df(0x177)](_0x1f888c,_0x5ba1df(0x189));return JSON[_0x5ba1df(0x179)](_0x533a1e);}catch{return{};}}[a48_0x432606(0x1ac)](_0x35b93a){const _0x3bd0b6=a48_0x432606;_0x35b93a[_0x3bd0b6(0x173)]=this['site'],!_0x35b93a['database']&&this['database']&&(_0x35b93a[_0x3bd0b6(0x183)]=this['database']),!_0x35b93a[_0x3bd0b6(0x1b1)]&&this[_0x3bd0b6(0x1b8)]&&(_0x35b93a[_0x3bd0b6(0x1b1)]=this[_0x3bd0b6(0x1b8)]),!_0x35b93a[_0x3bd0b6(0x194)]&&this['segment_path']&&(_0x35b93a[_0x3bd0b6(0x194)]=this[_0x3bd0b6(0x1b3)]),!_0x35b93a['llmProject']&&this[_0x3bd0b6(0x1a3)]&&(_0x35b93a['llmProject']=this[_0x3bd0b6(0x1a3)]),!_0x35b93a[_0x3bd0b6(0x19c)]&&this[_0x3bd0b6(0x1b6)]&&(_0x35b93a['llmAgent']=this[_0x3bd0b6(0x1b6)]),!_0x35b93a[_0x3bd0b6(0x18f)]&&this[_0x3bd0b6(0x193)]&&(_0x35b93a[_0x3bd0b6(0x18f)]=this['workflow_project']);}[a48_0x432606(0x199)](){const _0x216806=a48_0x432606;return[{'key':_0x216806(0x173),'value':this[_0x216806(0x173)]},{'key':_0x216806(0x183),'value':this[_0x216806(0x183)]},{'key':_0x216806(0x1b8),'value':this['parent_segment']},{'key':_0x216806(0x1b3),'value':this[_0x216806(0x1b3)]},{'key':_0x216806(0x1a3),'value':this['llm_project']},{'key':'llm_agent','value':this[_0x216806(0x1b6)]},{'key':_0x216806(0x193),'value':this['workflow_project']},{'key':_0x216806(0x1ad),'value':this[_0x216806(0x1b4)]||undefined}];}[a48_0x432606(0x186)](){const _0x1ef96f=a48_0x432606;console['log'](_0x1ef96f(0x198));for(const {key:_0xcb5a5b,value:_0x53ee96}of this['getParameters']()){_0x53ee96&&console['log'](_0xcb5a5b+':\x20'+_0x53ee96);}}[a48_0x432606(0x185)](){const _0x2e5589=a48_0x432606;console['log'](_0x2e5589(0x198));for(const {key:_0xd5d249,value:_0x4782bb}of this[_0x2e5589(0x199)]()){if(_0x4782bb){const _0x40c8bb=_0xd5d249==='profile'?_0x2e5589(0x1ae):'('+this[_0x2e5589(0x196)](_0xd5d249,_0x4782bb)+')';console[_0x2e5589(0x19e)](_0xd5d249+':\x20'+_0x4782bb+'\x20'+_0x40c8bb);}}console[_0x2e5589(0x19e)](_0x2e5589(0x1aa));const _0x4fe13a=[{'label':_0x2e5589(0x19f),'path':this[_0x2e5589(0x1af)][_0x2e5589(0x1b0)],'extra':_0x2e5589(0x1b9)+this['sessionId']+')'},{'label':_0x2e5589(0x182),'path':this[_0x2e5589(0x1af)]['project']},{'label':_0x2e5589(0x1a4),'path':this[_0x2e5589(0x1af)][_0x2e5589(0x1ad)]},{'label':_0x2e5589(0x172),'path':this[_0x2e5589(0x1af)][_0x2e5589(0x187)]},{'label':_0x2e5589(0x1b5),'path':this[_0x2e5589(0x1af)][_0x2e5589(0x1a2)]},{'label':'Global\x20Credentials','path':this[_0x2e5589(0x1af)]['globalCredentials']}];for(const {label:_0x36b8e6,path:_0x43fe4d,extra:_0x410055}of _0x4fe13a){if(_0x43fe4d)console['log'](_0x36b8e6+':\x20'+_0x43fe4d+'\x20✓'+(_0x410055?'\x20'+_0x410055:''));else{if(_0x36b8e6===_0x2e5589(0x19f))console[_0x2e5589(0x19e)](_0x36b8e6+_0x2e5589(0x17c)+this[_0x2e5589(0x195)]+')');else(_0x36b8e6==='Project'||_0x36b8e6===_0x2e5589(0x1b5))&&console[_0x2e5589(0x19e)](_0x36b8e6+_0x2e5589(0x17e));}}}async['resolveAPIKeyAsync'](){const _0x4356d1=a48_0x432606;return this[_0x4356d1(0x190)]=await getAPIKeyAsync(this[_0x4356d1(0x173)],this[_0x4356d1(0x1b4)]||undefined),this['apiKey'];}static async['createAsync'](_0x257e7b){const _0x4a0fc1=a48_0x432606,_0x2bfe12=new GlobalContext(_0x257e7b);return await _0x2bfe12[_0x4a0fc1(0x18d)](),_0x2bfe12;}}
|
|
1
|
+
const a48_0x261378=a48_0x1698;(function(_0x1ffbb6,_0x5f07ef){const _0x37851e=a48_0x1698,_0x5869f3=_0x1ffbb6();while(!![]){try{const _0x1c43d0=parseInt(_0x37851e(0x1ab))/0x1*(-parseInt(_0x37851e(0x1b3))/0x2)+-parseInt(_0x37851e(0x175))/0x3+parseInt(_0x37851e(0x1ad))/0x4*(parseInt(_0x37851e(0x1aa))/0x5)+parseInt(_0x37851e(0x16e))/0x6*(-parseInt(_0x37851e(0x1a0))/0x7)+parseInt(_0x37851e(0x194))/0x8+parseInt(_0x37851e(0x185))/0x9+parseInt(_0x37851e(0x1a3))/0xa*(parseInt(_0x37851e(0x17f))/0xb);if(_0x1c43d0===_0x5f07ef)break;else _0x5869f3['push'](_0x5869f3['shift']());}catch(_0x169fa2){_0x5869f3['push'](_0x5869f3['shift']());}}}(a48_0x4bea,0x693fd));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a48_0x4bea(){const _0x26436c=['log','[context]','Project','entries','Global\x20Credentials','133ynlNzh','configFiles','Profile','325010NjhHEf','segmentPath','llmProject','replace','INFO','assign','session','13055TfCVhP','215uhfWsK','verbose','428KFPwyr','llm_project','profile:\x20','layers','not\x20set','workflowProject','1958lHhQaN','tdx.json','217908mXbsVL','globalCredentials','llm_agent','CLI\x20flag:\x20--','profile','logLevel','getParameters','621585mDKxAn','existsSync','parentSegment','utf-8','llmAgent',':\x20none','Profile\x20Credentials','parent_segment','toString','(active)','44LZnJSg','\x0a[configuration\x20files]','Global','segment_path','site','getSource','6483069wCrZHZ','activeProfile','project','sessionId','workflow_project','profileCredentials','profiles','TDX_SITE','apiKey','global','readFileSync','Session','us01','resolveAPIKeyAsync','database','3272808KfdndK','default','cliFlags','config','join','loadGlobalConfig','injectIntoOptions'];a48_0x4bea=function(){return _0x26436c;};return a48_0x4bea();}function a48_0x1698(_0xe963a,_0xa0a7a0){_0xe963a=_0xe963a-0x16d;const _0x4beade=a48_0x4bea();let _0x169846=_0x4beade[_0xe963a];return _0x169846;}import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';import*as a48_0x1e663e from'node:fs';import*as a48_0x1d5b44 from'node:path';export class GlobalContext{[a48_0x261378(0x183)];['database'];['parent_segment'];['segment_path'];[a48_0x261378(0x1ae)];[a48_0x261378(0x170)];[a48_0x261378(0x189)];['apiKey'];[a48_0x261378(0x1ac)];['logLevel'];[a48_0x261378(0x172)];[a48_0x261378(0x1b0)];['activeProfile'];[a48_0x261378(0x188)];['configFiles'];constructor(_0x5f0178){const _0x2d225e=a48_0x261378;this[_0x2d225e(0x188)]=_0x5f0178[_0x2d225e(0x1a9)]||getCurrentSessionPID()[_0x2d225e(0x17d)]();const _0x508250=loadSessionContext(_0x5f0178['session']),_0x99a602=loadProjectConfig(),_0x3b73ea=this['loadGlobalConfig']();this['activeProfile']=_0x5f0178[_0x2d225e(0x172)]||_0x508250?.['profile']||_0x3b73ea[_0x2d225e(0x172)]||getActiveProfile();const _0x5af7fd=this[_0x2d225e(0x186)]?loadProfile(this[_0x2d225e(0x186)]):null,_0x5e6fce=_0x3d3921=>{const _0x91baee=_0x2d225e;if(!_0x3d3921)return{};const _0x57dab7=_0x3d3921,_0x1e0ffb={};for(const [_0x567bb7,_0x52a340]of Object[_0x91baee(0x19e)](_0x57dab7)){typeof _0x52a340==='string'&&(_0x1e0ffb[_0x567bb7]=_0x52a340);}return _0x1e0ffb;},_0x54965b={};if(_0x5f0178[_0x2d225e(0x183)]&&_0x5f0178[_0x2d225e(0x183)]!==_0x2d225e(0x191))_0x54965b[_0x2d225e(0x183)]=_0x5f0178[_0x2d225e(0x183)];const _0x62f1e5=_0x508250?.[_0x2d225e(0x193)],_0x163b1e=_0x99a602?.[_0x2d225e(0x193)],_0x54dfe4=_0x5af7fd?.[_0x2d225e(0x197)]?.[_0x2d225e(0x193)],_0x2b2352=_0x3b73ea['database'];_0x5f0178[_0x2d225e(0x193)]&&(_0x5f0178[_0x2d225e(0x193)]!==_0x62f1e5&&_0x5f0178[_0x2d225e(0x193)]!==_0x163b1e&&_0x5f0178[_0x2d225e(0x193)]!==_0x54dfe4&&_0x5f0178[_0x2d225e(0x193)]!==_0x2b2352)&&(_0x54965b[_0x2d225e(0x193)]=_0x5f0178['database']);if(_0x5f0178[_0x2d225e(0x177)])_0x54965b[_0x2d225e(0x17c)]=_0x5f0178['parentSegment'];if(_0x5f0178[_0x2d225e(0x1a5)])_0x54965b[_0x2d225e(0x1ae)]=_0x5f0178[_0x2d225e(0x1a5)];if(_0x5f0178[_0x2d225e(0x179)])_0x54965b[_0x2d225e(0x170)]=_0x5f0178[_0x2d225e(0x179)];if(_0x5f0178[_0x2d225e(0x172)])_0x54965b[_0x2d225e(0x172)]=_0x5f0178[_0x2d225e(0x172)];this[_0x2d225e(0x1b0)]={'cliFlags':_0x54965b,'session':_0x5e6fce(_0x508250),'project':_0x5e6fce(_0x99a602),'profile':_0x5e6fce(_0x5af7fd?.[_0x2d225e(0x197)]),'global':_0x5e6fce(_0x3b73ea)};const _0x934ff={...this[_0x2d225e(0x1b0)]['global'],...this[_0x2d225e(0x1b0)]['profile'],...this[_0x2d225e(0x1b0)][_0x2d225e(0x187)]};process['env'][_0x2d225e(0x18c)]&&!this[_0x2d225e(0x1b0)][_0x2d225e(0x1a9)]['site']&&!this[_0x2d225e(0x1b0)][_0x2d225e(0x196)]['site']&&(_0x934ff['site']=process['env']['TDX_SITE']);Object[_0x2d225e(0x1a8)](_0x934ff,this[_0x2d225e(0x1b0)]['session']),Object[_0x2d225e(0x1a8)](_0x934ff,this[_0x2d225e(0x1b0)]['cliFlags']);const _0x3ca9b8=_0x934ff[_0x2d225e(0x183)]||'us01';this[_0x2d225e(0x183)]=resolveSite(_0x3ca9b8),this[_0x2d225e(0x193)]=_0x934ff[_0x2d225e(0x193)],this[_0x2d225e(0x17c)]=_0x934ff['parent_segment'],this[_0x2d225e(0x182)]=_0x934ff[_0x2d225e(0x182)],this['llm_project']=_0x934ff[_0x2d225e(0x1ae)],this[_0x2d225e(0x170)]=_0x934ff[_0x2d225e(0x170)],this[_0x2d225e(0x189)]=_0x934ff[_0x2d225e(0x189)],this[_0x2d225e(0x1ac)]=_0x5f0178['verbose']||![],this[_0x2d225e(0x173)]=_0x5f0178[_0x2d225e(0x173)]??LogLevel[_0x2d225e(0x1a7)],this[_0x2d225e(0x172)]=this[_0x2d225e(0x186)]||undefined,this['apiKey']=getAPIKey(this[_0x2d225e(0x183)],this[_0x2d225e(0x186)]||undefined);const _0x5d1dc5=getConfigDir(),_0xc7c12c=a48_0x1d5b44[_0x2d225e(0x198)](_0x5d1dc5,'sessions',this['sessionId']+'.json'),_0x26865c=findProjectConfigPath(),_0x1ee2ba=a48_0x1d5b44[_0x2d225e(0x198)](_0x5d1dc5,_0x2d225e(0x16d)),_0x4fc274=a48_0x1d5b44[_0x2d225e(0x198)](_0x5d1dc5,'.env');let _0x25b792=null,_0x247c5e=null;this['activeProfile']&&(_0x25b792=a48_0x1d5b44['join'](_0x5d1dc5,_0x2d225e(0x18b),this[_0x2d225e(0x186)],_0x2d225e(0x16d)),_0x247c5e=a48_0x1d5b44[_0x2d225e(0x198)](_0x5d1dc5,_0x2d225e(0x18b),this[_0x2d225e(0x186)],'.env')),this[_0x2d225e(0x1a1)]={'session':a48_0x1e663e[_0x2d225e(0x176)](_0xc7c12c)?_0xc7c12c:null,'project':_0x26865c,'profile':_0x25b792&&a48_0x1e663e[_0x2d225e(0x176)](_0x25b792)?_0x25b792:null,'profileCredentials':_0x247c5e&&a48_0x1e663e[_0x2d225e(0x176)](_0x247c5e)?_0x247c5e:null,'global':a48_0x1e663e['existsSync'](_0x1ee2ba)?_0x1ee2ba:null,'globalCredentials':a48_0x1e663e['existsSync'](_0x4fc274)?_0x4fc274:null};}[a48_0x261378(0x184)](_0x261a7b,_0x84a512){const _0x5149cf=a48_0x261378;if(!_0x84a512)return _0x5149cf(0x1b1);const _0x173366=_0x84a512;if(this['layers'][_0x5149cf(0x196)][_0x261a7b]===_0x173366){if(_0x261a7b===_0x5149cf(0x183)&&_0x173366===_0x5149cf(0x191)&&!this['layers'][_0x5149cf(0x1a9)][_0x5149cf(0x183)]&&!this['layers']['project'][_0x5149cf(0x183)]&&!this[_0x5149cf(0x1b0)][_0x5149cf(0x172)]['site']&&!this[_0x5149cf(0x1b0)][_0x5149cf(0x18e)][_0x5149cf(0x183)])return'default';return _0x5149cf(0x171)+_0x261a7b[_0x5149cf(0x1a6)](/_/g,'-');}if(this['layers'][_0x5149cf(0x1a9)][_0x261a7b]===_0x173366)return'session';if(this[_0x5149cf(0x1b0)][_0x5149cf(0x187)][_0x261a7b]===_0x173366)return _0x5149cf(0x187);if(this[_0x5149cf(0x1b0)]['profile'][_0x261a7b]===_0x173366)return _0x5149cf(0x1af)+this[_0x5149cf(0x186)];if(this['layers'][_0x5149cf(0x18e)][_0x261a7b]===_0x173366)return'global';return _0x5149cf(0x195);}[a48_0x261378(0x199)](){const _0xef5452=a48_0x261378,_0x4dd210=a48_0x1d5b44[_0xef5452(0x198)](getConfigDir(),_0xef5452(0x16d));if(!a48_0x1e663e['existsSync'](_0x4dd210))return{};try{const _0x279575=a48_0x1e663e[_0xef5452(0x18f)](_0x4dd210,_0xef5452(0x178));return JSON['parse'](_0x279575);}catch{return{};}}[a48_0x261378(0x19a)](_0x2778a8){const _0x302a03=a48_0x261378;_0x2778a8['site']=this[_0x302a03(0x183)],!_0x2778a8[_0x302a03(0x193)]&&this[_0x302a03(0x193)]&&(_0x2778a8[_0x302a03(0x193)]=this[_0x302a03(0x193)]),!_0x2778a8['parentSegment']&&this['parent_segment']&&(_0x2778a8[_0x302a03(0x177)]=this[_0x302a03(0x17c)]),!_0x2778a8[_0x302a03(0x1a4)]&&this[_0x302a03(0x182)]&&(_0x2778a8['segmentPath']=this[_0x302a03(0x182)]),!_0x2778a8[_0x302a03(0x1a5)]&&this['llm_project']&&(_0x2778a8[_0x302a03(0x1a5)]=this['llm_project']),!_0x2778a8[_0x302a03(0x179)]&&this[_0x302a03(0x170)]&&(_0x2778a8[_0x302a03(0x179)]=this[_0x302a03(0x170)]),!_0x2778a8[_0x302a03(0x1b2)]&&this['workflow_project']&&(_0x2778a8['workflowProject']=this[_0x302a03(0x189)]);}[a48_0x261378(0x174)](){const _0x5419f5=a48_0x261378;return[{'key':_0x5419f5(0x183),'value':this[_0x5419f5(0x183)]},{'key':_0x5419f5(0x193),'value':this[_0x5419f5(0x193)]},{'key':_0x5419f5(0x17c),'value':this[_0x5419f5(0x17c)]},{'key':_0x5419f5(0x182),'value':this[_0x5419f5(0x182)]},{'key':'llm_project','value':this['llm_project']},{'key':'llm_agent','value':this[_0x5419f5(0x170)]},{'key':'workflow_project','value':this[_0x5419f5(0x189)]},{'key':_0x5419f5(0x172),'value':this[_0x5419f5(0x186)]||undefined}];}['display'](){const _0x59b1f7=a48_0x261378;console['log'](_0x59b1f7(0x19c));for(const {key:_0x403742,value:_0x150b84}of this[_0x59b1f7(0x174)]()){_0x150b84&&console[_0x59b1f7(0x19b)](_0x403742+':\x20'+_0x150b84);}}['displayWithSources'](){const _0x4d21f1=a48_0x261378;console['log'](_0x4d21f1(0x19c));for(const {key:_0x4c5561,value:_0x25cf00}of this[_0x4d21f1(0x174)]()){if(_0x25cf00){const _0x7280d3=_0x4c5561===_0x4d21f1(0x172)?_0x4d21f1(0x17e):'('+this['getSource'](_0x4c5561,_0x25cf00)+')';console['log'](_0x4c5561+':\x20'+_0x25cf00+'\x20'+_0x7280d3);}}console[_0x4d21f1(0x19b)](_0x4d21f1(0x180));const _0x4739ab=[{'label':_0x4d21f1(0x190),'path':this[_0x4d21f1(0x1a1)][_0x4d21f1(0x1a9)],'extra':'(session:\x20'+this[_0x4d21f1(0x188)]+')'},{'label':'Project','path':this[_0x4d21f1(0x1a1)]['project']},{'label':_0x4d21f1(0x1a2),'path':this[_0x4d21f1(0x1a1)][_0x4d21f1(0x172)]},{'label':_0x4d21f1(0x17b),'path':this['configFiles'][_0x4d21f1(0x18a)]},{'label':_0x4d21f1(0x181),'path':this[_0x4d21f1(0x1a1)][_0x4d21f1(0x18e)]},{'label':_0x4d21f1(0x19f),'path':this[_0x4d21f1(0x1a1)][_0x4d21f1(0x16f)]}];for(const {label:_0x12c4e0,path:_0x3729ca,extra:_0x21edae}of _0x4739ab){if(_0x3729ca)console[_0x4d21f1(0x19b)](_0x12c4e0+':\x20'+_0x3729ca+'\x20✓'+(_0x21edae?'\x20'+_0x21edae:''));else{if(_0x12c4e0===_0x4d21f1(0x190))console['log'](_0x12c4e0+':\x20none\x20(using\x20session:\x20'+this['sessionId']+')');else(_0x12c4e0===_0x4d21f1(0x19d)||_0x12c4e0===_0x4d21f1(0x181))&&console['log'](_0x12c4e0+_0x4d21f1(0x17a));}}}async[a48_0x261378(0x192)](){const _0x35af77=a48_0x261378;return this['apiKey']=await getAPIKeyAsync(this[_0x35af77(0x183)],this[_0x35af77(0x186)]||undefined),this[_0x35af77(0x18d)];}static async['createAsync'](_0xcaaac0){const _0xa3eaf8=a48_0x261378,_0x19ec90=new GlobalContext(_0xcaaac0);return await _0x19ec90[_0xa3eaf8(0x192)](),_0x19ec90;}}
|
package/dist/core/keychain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x1d0ecc=a49_0x9f4e;(function(_0x4136c8,_0x4ba69a){const _0x49d57b=a49_0x9f4e,_0x5c7ca5=_0x4136c8();while(!![]){try{const _0x16dd0f=parseInt(_0x49d57b(0x154))/0x1*(parseInt(_0x49d57b(0x164))/0x2)+-parseInt(_0x49d57b(0x15e))/0x3*(-parseInt(_0x49d57b(0x15c))/0x4)+-parseInt(_0x49d57b(0x176))/0x5+-parseInt(_0x49d57b(0x162))/0x6+-parseInt(_0x49d57b(0x175))/0x7+-parseInt(_0x49d57b(0x171))/0x8+parseInt(_0x49d57b(0x159))/0x9*(parseInt(_0x49d57b(0x172))/0xa);if(_0x16dd0f===_0x4ba69a)break;else _0x5c7ca5['push'](_0x5c7ca5['shift']());}catch(_0x3fd46a){_0x5c7ca5['push'](_0x5c7ca5['shift']());}}}(a49_0x1a10,0xbb0ab));const SERVICE_NAME=a49_0x1d0ecc(0x15b);function a49_0x1a10(){const _0x2b5ee7=['not_found','Warning:\x20','keyring','504CPCRFy','getPassword','tdx','28532JsZLQZ','unavailable','375mfqvxt','-25300','not\x20found','access_denied','4883352HFGjir','value','24TuGaut','access','restricted','System\x20keychain\x20is\x20not\x20available','cannot\x20find','@zowe/secrets-for-zowe-sdk','not\x20available','deletePassword','toLowerCase','includes','could\x20not\x20be\x20found',':api_key','-25293','11968032SQXJBr','549230DPrPKm','not\x20supported','reason','4538184IBzhtU','6161730cHkbLF','profile:','82447CJXQJp','success'];a49_0x1a10=function(){return _0x2b5ee7;};return a49_0x1a10();}let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x297a19=a49_0x1d0ecc;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x2b7ace=await import(_0x297a19(0x169));return keyringModule=_0x2b7ace[_0x297a19(0x158)],keyringModule;}catch(_0x59c597){return keyringLoadError=_0x59c597 instanceof Error?_0x59c597:new Error(String(_0x59c597)),null;}}function getAccountName(_0x57a65e){const _0x3ca395=a49_0x1d0ecc,_0x41f231=_0x57a65e||'';return _0x3ca395(0x153)+_0x41f231+_0x3ca395(0x16f);}function a49_0x9f4e(_0x493b86,_0x3294ff){_0x493b86=_0x493b86-0x153;const _0x1a1017=a49_0x1a10();let _0x9f4e32=_0x1a1017[_0x493b86];return _0x9f4e32;}export async function getKeychainAPIKey(_0x35ae05){const _0x1cc06d=a49_0x1d0ecc,_0x132255=await getKeychainAPIKeyWithStatus(_0x35ae05);if(_0x132255[_0x1cc06d(0x155)])return _0x132255[_0x1cc06d(0x163)];return _0x132255[_0x1cc06d(0x174)]===_0x1cc06d(0x161)&&console['error'](_0x1cc06d(0x157)+_0x132255['message']),null;}export async function getKeychainAPIKeyWithStatus(_0x22adef){const _0x3fd55d=a49_0x1d0ecc;try{const _0x54a92d=await getKeyring();if(!_0x54a92d)return{'success':![],'reason':_0x3fd55d(0x15d)};const _0x16af35=getAccountName(_0x22adef),_0x2eb4cb=await _0x54a92d[_0x3fd55d(0x15a)](SERVICE_NAME,_0x16af35);if(_0x2eb4cb)return{'success':!![],'value':_0x2eb4cb};return{'success':![],'reason':_0x3fd55d(0x156)};}catch(_0x65f8cd){const _0x154986=_0x65f8cd instanceof Error?_0x65f8cd['message']:String(_0x65f8cd);if(_0x154986[_0x3fd55d(0x16d)](_0x3fd55d(0x15f))||_0x154986[_0x3fd55d(0x16c)]()[_0x3fd55d(0x16d)](_0x3fd55d(0x16e))||_0x154986[_0x3fd55d(0x16c)]()['includes'](_0x3fd55d(0x160)))return{'success':![],'reason':_0x3fd55d(0x156)};if(_0x154986[_0x3fd55d(0x16d)](_0x3fd55d(0x170))||_0x154986[_0x3fd55d(0x16c)]()['includes'](_0x3fd55d(0x166))||_0x154986[_0x3fd55d(0x16c)]()['includes'](_0x3fd55d(0x165)))return{'success':![],'reason':_0x3fd55d(0x161),'message':'Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.'};return{'success':![],'reason':'unavailable','message':_0x154986};}}export async function saveKeychainAPIKey(_0x597dd9,_0x2c111a){const _0x575704=a49_0x1d0ecc,_0x3879b8=await getKeyring();if(!_0x3879b8)throw new Error(_0x575704(0x167));const _0x419994=getAccountName(_0x2c111a);await _0x3879b8['setPassword'](SERVICE_NAME,_0x419994,_0x597dd9);}export async function deleteKeychainAPIKey(_0x6d46e){const _0x5c3623=a49_0x1d0ecc;try{const _0x402a64=await getKeyring();if(!_0x402a64)return![];const _0xb8bcb5=getAccountName(_0x6d46e);return await _0x402a64[_0x5c3623(0x16b)](SERVICE_NAME,_0xb8bcb5);}catch{return![];}}export async function isKeychainAvailable(){const _0x14f42a=a49_0x1d0ecc;try{const _0x5076b2=await getKeyring();if(!_0x5076b2)return![];return await _0x5076b2[_0x14f42a(0x15a)](SERVICE_NAME,'__keychain_test__'),!![];}catch(_0x1b6b71){const _0x3fbd71=_0x1b6b71 instanceof Error?_0x1b6b71['message'][_0x14f42a(0x16c)]():'';if(_0x3fbd71[_0x14f42a(0x16d)](_0x14f42a(0x16a))||_0x3fbd71[_0x14f42a(0x16d)](_0x14f42a(0x173))||_0x3fbd71[_0x14f42a(0x16d)](_0x14f42a(0x168)))return![];return!![];}}
|
package/dist/core/profile.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x723e2b,_0x131f77){const _0x1875f0=a50_0x2db0,_0x5615cb=_0x723e2b();while(!![]){try{const _0x1b1bc7=parseInt(_0x1875f0(0xd7))/0x1+parseInt(_0x1875f0(0xab))/0x2+parseInt(_0x1875f0(0xba))/0x3+-parseInt(_0x1875f0(0xb5))/0x4*(-parseInt(_0x1875f0(0xbb))/0x5)+parseInt(_0x1875f0(0xc0))/0x6+-parseInt(_0x1875f0(0xbe))/0x7+-parseInt(_0x1875f0(0xbc))/0x8;if(_0x1b1bc7===_0x131f77)break;else _0x5615cb['push'](_0x5615cb['shift']());}catch(_0x232bd9){_0x5615cb['push'](_0x5615cb['shift']());}}}(a50_0xaf0c,0x59aa6));import*as a50_0x268b8c from'node:fs';import*as a50_0x5ed16c from'node:path';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export function getProfileParams(_0x5133bf){const _0x52425b=a50_0x2db0,_0x59d1a1={};if(!_0x5133bf)return _0x59d1a1;for(const [_0x490d25,_0x3c056c]of Object[_0x52425b(0xb6)](_0x5133bf)){_0x490d25!==_0x52425b(0xd0)&&_0x3c056c!==undefined&&(_0x59d1a1[_0x490d25]=_0x3c056c);}return _0x59d1a1;}export function getProfilesDir(){const _0x45ded5=a50_0x2db0;return a50_0x5ed16c[_0x45ded5(0xd8)](getConfigDir(),'profiles');}function getProfileDir(_0x537141){const _0x2f33a5=a50_0x2db0;return a50_0x5ed16c[_0x2f33a5(0xd8)](getProfilesDir(),_0x537141);}function getProfileConfigPath(_0x3e8eca){const _0x4c5983=a50_0x2db0;return a50_0x5ed16c[_0x4c5983(0xd8)](getProfileDir(_0x3e8eca),'tdx.json');}function getProfileEnvPath(_0x38785a){const _0x302bff=a50_0x2db0;return a50_0x5ed16c[_0x302bff(0xd8)](getProfileDir(_0x38785a),_0x302bff(0xe0));}function getGlobalConfigPath(){const _0x552ddc=a50_0x2db0;return a50_0x5ed16c[_0x552ddc(0xd8)](getConfigDir(),_0x552ddc(0xc8));}function validateProfileName(_0x235ddd){const _0x5803b9=a50_0x2db0;if(!/^[a-zA-Z0-9_-]+$/['test'](_0x235ddd))throw new Error('Invalid\x20profile\x20name:\x20'+_0x235ddd+_0x5803b9(0xca));}function validateProfileConfig(_0x5858e1,_0x24b280){const _0x202295=a50_0x2db0;if(typeof _0x5858e1!==_0x202295(0xaf)||_0x5858e1===null)throw new Error(_0x202295(0xb4)+_0x24b280+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0x4565bf=[_0x202295(0xd0),_0x202295(0xc2),'database',_0x202295(0xa5),_0x202295(0xaa),_0x202295(0xd4)],_0x4e49be=_0x5858e1;for(const _0x5b8a88 of Object[_0x202295(0x99)](_0x4e49be)){!_0x4565bf[_0x202295(0xdf)](_0x5b8a88)&&console[_0x202295(0xc7)]('Warning:\x20Profile\x20\x27'+_0x24b280+_0x202295(0xa2)+_0x5b8a88+_0x202295(0xae));}if(_0x4e49be[_0x202295(0xd0)]!==undefined&&typeof _0x4e49be['description']!==_0x202295(0xcb))throw new Error('Profile\x20\x27'+_0x24b280+_0x202295(0xc4));if(_0x4e49be['site']!==undefined&&typeof _0x4e49be[_0x202295(0xc2)]!==_0x202295(0xcb))throw new Error('Profile\x20\x27'+_0x24b280+_0x202295(0xb7));if(_0x4e49be['database']!==undefined&&typeof _0x4e49be[_0x202295(0xc5)]!==_0x202295(0xcb))throw new Error(_0x202295(0xb4)+_0x24b280+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x4e49be['parent_segment']!==undefined&&typeof _0x4e49be[_0x202295(0xa5)]!==_0x202295(0xcb))throw new Error(_0x202295(0xb4)+_0x24b280+_0x202295(0xa4));if(_0x4e49be[_0x202295(0xaa)]!==undefined&&typeof _0x4e49be[_0x202295(0xaa)]!==_0x202295(0xcb))throw new Error(_0x202295(0xb4)+_0x24b280+_0x202295(0xcd));if(_0x4e49be['llm_agent']!==undefined&&typeof _0x4e49be[_0x202295(0xd4)]!==_0x202295(0xcb))throw new Error('Profile\x20\x27'+_0x24b280+_0x202295(0xad));return!![];}function loadProfilesFromTdxJson(_0x29f960,_0xd0eaf9){const _0x29d207=a50_0x2db0;if(!a50_0x268b8c[_0x29d207(0xe5)](_0x29f960))return[];try{const _0x355c83=a50_0x268b8c[_0x29d207(0xb8)](_0x29f960,_0x29d207(0xce)),_0xfac4a5=JSON[_0x29d207(0x9a)](_0x355c83);if(!_0xfac4a5[_0x29d207(0x9e)]||typeof _0xfac4a5['profiles']!=='object')return[];const _0x46d3e1=[];for(const [_0x534164,_0x3501ee]of Object[_0x29d207(0xb6)](_0xfac4a5[_0x29d207(0x9e)])){try{validateProfileConfig(_0x3501ee,_0x534164);const _0x4e0fa0=getNewCredentialPath(_0x534164),_0x593452=getOldCredentialPath(_0x534164),_0x5d18a2=a50_0x268b8c[_0x29d207(0xe5)](_0x4e0fa0)||a50_0x268b8c['existsSync'](_0x593452);_0x46d3e1['push']({'name':_0x534164,'config':_0x3501ee,'metadata':{'name':_0x534164,'createdAt':new Date()[_0x29d207(0xdd)]()},'hasCredentials':_0x5d18a2,'scope':_0xd0eaf9});}catch(_0x21d4ca){_0x21d4ca instanceof Error&&(console[_0x29d207(0xc7)](_0x29d207(0xb0)+_0x29f960+':'),console['warn']('\x20\x20'+_0x21d4ca[_0x29d207(0xc3)]+'\x0a'));}}return _0x46d3e1;}catch(_0x6acbdb){return _0x6acbdb instanceof SyntaxError?(console['warn'](_0x29d207(0xe4)+_0x29f960+_0x29d207(0xe3)),console['warn'](_0x29d207(0xc9)+_0x6acbdb['message']+'\x0a')):console['warn'](_0x29d207(0xd5)+_0x29f960+':\x20'+_0x6acbdb+'\x0a'),[];}}export function getNewCredentialPath(_0x3c6ced){const _0x1dd7a9=a50_0x2db0;return a50_0x5ed16c[_0x1dd7a9(0xd8)](getConfigDir(),_0x1dd7a9(0xdb)+_0x3c6ced);}function getOldCredentialPath(_0x31e26e){const _0x30016c=a50_0x2db0;return a50_0x5ed16c['join'](getProfilesDir(),_0x31e26e,_0x30016c(0xe0));}function loadProfilesFromTdxJsonFiles(){const _0x1bf166=a50_0x2db0,_0x563566=[],_0x531527=findProjectConfigPath();_0x531527&&_0x563566['push'](...loadProfilesFromTdxJson(_0x531527,_0x1bf166(0x9b)));const _0x51ef41=a50_0x5ed16c['join'](getConfigDir(),_0x1bf166(0xc8));return _0x563566['push'](...loadProfilesFromTdxJson(_0x51ef41,'user')),_0x563566;}function loadProfilesFromDirectories(){const _0x1d77ab=a50_0x2db0,_0x34efc4=getProfilesDir();if(!a50_0x268b8c[_0x1d77ab(0xe5)](_0x34efc4))return[];try{return a50_0x268b8c[_0x1d77ab(0xa8)](_0x34efc4,{'withFileTypes':!![]})['filter'](_0x1375a5=>_0x1375a5[_0x1d77ab(0xc1)]())[_0x1d77ab(0xb1)](_0x24cef1=>_0x24cef1['name'])[_0x1d77ab(0xcc)](_0x5a31f8=>{const _0x12bc07=_0x1d77ab,_0x439c67=getProfileConfigPath(_0x5a31f8),_0x4dfddf=getProfileEnvPath(_0x5a31f8);return a50_0x268b8c[_0x12bc07(0xe5)](_0x439c67)||a50_0x268b8c[_0x12bc07(0xe5)](_0x4dfddf);})[_0x1d77ab(0xb1)](_0x4e7c55=>{const _0x181dc8=_0x1d77ab,_0x5e2baa=loadProfileFromDirectory(_0x4e7c55);if(_0x5e2baa)return{..._0x5e2baa,'scope':_0x181dc8(0xb2)};return null;})[_0x1d77ab(0xcc)](_0x208354=>_0x208354!==null);}catch{return[];}}function loadProfileFromDirectory(_0x348f3b){const _0x1c3f77=a50_0x2db0,_0x1af1a3=getProfileConfigPath(_0x348f3b),_0x47e2c4=getOldCredentialPath(_0x348f3b);if(!a50_0x268b8c[_0x1c3f77(0xe5)](_0x1af1a3)&&!a50_0x268b8c['existsSync'](_0x47e2c4))return null;let _0x4987cf={},_0x431080={'name':_0x348f3b,'createdAt':new Date()[_0x1c3f77(0xdd)]()};if(a50_0x268b8c[_0x1c3f77(0xe5)](_0x1af1a3))try{const _0x2612fa=a50_0x268b8c[_0x1c3f77(0xb8)](_0x1af1a3,_0x1c3f77(0xce)),_0x252bd0=JSON[_0x1c3f77(0x9a)](_0x2612fa),{metadata:_0x39418f,..._0x174e10}=_0x252bd0;_0x4987cf=_0x174e10,_0x39418f&&(_0x431080=_0x39418f);}catch{}return{'name':_0x348f3b,'config':_0x4987cf,'metadata':_0x431080,'hasCredentials':a50_0x268b8c[_0x1c3f77(0xe5)](_0x47e2c4),'scope':_0x1c3f77(0xb2)};}export function listProfiles(){const _0x30863a=a50_0x2db0,_0x21ae98=loadProfilesFromTdxJsonFiles(),_0x595d15=loadProfilesFromDirectories();if(_0x595d15[_0x30863a(0xe2)]>0x0){const _0x51d600=_0x595d15[_0x30863a(0xb1)](_0x8d96ac=>_0x8d96ac[_0x30863a(0xb3)])[_0x30863a(0xd8)](',\x20'),_0x23de3a=getConfigDir();console['warn'](_0x30863a(0xd2)+_0x51d600),console[_0x30863a(0xc7)](_0x30863a(0xbd)),console[_0x30863a(0xc7)](_0x30863a(0xe6)+a50_0x5ed16c[_0x30863a(0xd8)](_0x23de3a,_0x30863a(0xc8))),console[_0x30863a(0xc7)]('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x30863a(0xc7)](_0x30863a(0xbf));}const _0x300045=[..._0x21ae98,..._0x595d15],_0x53d6fc=new Map();for(const _0x249f4d of _0x300045){!_0x53d6fc[_0x30863a(0xa1)](_0x249f4d[_0x30863a(0xb3)])&&_0x53d6fc[_0x30863a(0xdc)](_0x249f4d[_0x30863a(0xb3)],_0x249f4d);}return Array[_0x30863a(0xac)](_0x53d6fc[_0x30863a(0xc6)]())['sort']((_0x52fd0b,_0x5c7df7)=>_0x52fd0b[_0x30863a(0xb3)]['localeCompare'](_0x5c7df7[_0x30863a(0xb3)]));}export function profileExists(_0x19b0dc){const _0x496848=a50_0x2db0,_0x5b979e=listProfiles();return _0x5b979e[_0x496848(0xa6)](_0x132960=>_0x132960[_0x496848(0xb3)]===_0x19b0dc);}export function loadProfile(_0x5343cf){const _0x4744f1=a50_0x2db0;validateProfileName(_0x5343cf);const _0x1f3f21=listProfiles(),_0x348189=_0x1f3f21[_0x4744f1(0xa7)](_0xb9b494=>_0xb9b494['name']===_0x5343cf);return _0x348189||null;}export function saveProfile(_0x244b1a,_0x450f17,_0x1581f0=![]){saveProfileToUserConfig(_0x244b1a,_0x450f17);}export function deleteProfile(_0xb8065c){const _0x1151a5=a50_0x2db0;validateProfileName(_0xb8065c);const _0x5dec55=getProfileDir(_0xb8065c);if(!a50_0x268b8c[_0x1151a5(0xe5)](_0x5dec55))throw new Error('Profile\x20'+_0xb8065c+'\x20does\x20not\x20exist');a50_0x268b8c[_0x1151a5(0xd6)](_0x5dec55,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0xea80ac,_0x482526){const _0x13e602=a50_0x2db0;validateProfileName(_0xea80ac);const _0x31e242=getGlobalConfigPath(),_0x2da29c=getConfigDir();!a50_0x268b8c[_0x13e602(0xe5)](_0x2da29c)&&createSecureDirectory(_0x2da29c);let _0x4f8ec5={};if(a50_0x268b8c[_0x13e602(0xe5)](_0x31e242))try{const _0x3b1082=a50_0x268b8c[_0x13e602(0xb8)](_0x31e242,_0x13e602(0xce));_0x4f8ec5=JSON['parse'](_0x3b1082);}catch{console[_0x13e602(0xc7)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x31e242+_0x13e602(0x9d));}!_0x4f8ec5[_0x13e602(0x9e)]&&(_0x4f8ec5[_0x13e602(0x9e)]={}),_0x4f8ec5[_0x13e602(0x9e)][_0xea80ac]=_0x482526,writeSecureFile(_0x31e242,JSON[_0x13e602(0xde)](_0x4f8ec5,null,0x2));}function a50_0x2db0(_0x369087,_0x146fc8){_0x369087=_0x369087-0x99;const _0xaf0cfa=a50_0xaf0c();let _0x2db055=_0xaf0cfa[_0x369087];return _0x2db055;}export function removeProfileFromUserConfig(_0x52684c){const _0x11f14a=a50_0x2db0;validateProfileName(_0x52684c);const _0x55ca4d=getGlobalConfigPath();if(!a50_0x268b8c[_0x11f14a(0xe5)](_0x55ca4d))throw new Error(_0x11f14a(0xb4)+_0x52684c+_0x11f14a(0xa0));let _0x4fe62b={};try{const _0x2c24cd=a50_0x268b8c[_0x11f14a(0xb8)](_0x55ca4d,'utf-8');_0x4fe62b=JSON[_0x11f14a(0x9a)](_0x2c24cd);}catch{throw new Error(_0x11f14a(0xd9)+_0x55ca4d);}if(!_0x4fe62b[_0x11f14a(0x9e)]||!_0x4fe62b[_0x11f14a(0x9e)][_0x52684c])throw new Error('Profile\x20\x27'+_0x52684c+'\x27\x20not\x20found\x20in\x20user\x20configuration');delete _0x4fe62b['profiles'][_0x52684c],_0x4fe62b['profile']===_0x52684c&&delete _0x4fe62b[_0x11f14a(0x9f)],writeSecureFile(_0x55ca4d,JSON['stringify'](_0x4fe62b,null,0x2));}export function getActiveProfile(){const _0x5d1045=a50_0x2db0,_0x46b71b=loadSessionContext();if(_0x46b71b?.[_0x5d1045(0x9f)])return _0x46b71b[_0x5d1045(0x9f)];if(process[_0x5d1045(0xcf)][_0x5d1045(0xd1)])return process[_0x5d1045(0xcf)][_0x5d1045(0xd1)];const _0x35aebf=getGlobalConfigPath();if(!a50_0x268b8c['existsSync'](_0x35aebf))return null;try{const _0x15bc78=a50_0x268b8c[_0x5d1045(0xb8)](_0x35aebf,_0x5d1045(0xce)),_0x940b07=JSON[_0x5d1045(0x9a)](_0x15bc78);return _0x940b07[_0x5d1045(0x9f)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x4ae83c){const _0x52dc99=a50_0x2db0,_0x2faf2a=getGlobalConfigPath(),_0x14ef5b=getConfigDir();!a50_0x268b8c[_0x52dc99(0xe5)](_0x14ef5b)&&createSecureDirectory(_0x14ef5b);let _0x70432a={};if(a50_0x268b8c[_0x52dc99(0xe5)](_0x2faf2a))try{const _0x471c88=a50_0x268b8c[_0x52dc99(0xb8)](_0x2faf2a,_0x52dc99(0xce));_0x70432a=JSON['parse'](_0x471c88);}catch{console[_0x52dc99(0xc7)](_0x52dc99(0x9c)+_0x2faf2a+_0x52dc99(0x9d));}_0x70432a[_0x52dc99(0xc2)]=_0x4ae83c,writeSecureFile(_0x2faf2a,JSON['stringify'](_0x70432a,null,0x2));}function a50_0xaf0c(){const _0x24b7ef=['Error:\x20','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','string','filter','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','utf-8','env','description','TDX_PROFILE','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x20\x20mv\x20\x22','llm_agent','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','rmSync','289892cDVYOC','join','Failed\x20to\x20parse\x20','\x22\x20\x22','.env.','set','toISOString','stringify','includes','.env','Profile\x20','length',':\x20Invalid\x20JSON\x20syntax','\x0aWarning:\x20Failed\x20to\x20parse\x20','existsSync','\x20\x201.\x20Edit:\x20','keys','parse','local','Warning:\x20Failed\x20to\x20parse\x20',',\x20creating\x20new\x20file','profiles','profile','\x27\x20not\x20found\x20in\x20user\x20configuration','has','\x27:\x20unknown\x20config\x20key\x20\x27','To\x20migrate:','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','parent_segment','some','find','readdirSync','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','llm_project','825784iMeRbR','from','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','\x27\x20will\x20be\x20ignored','object','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','map','directory','name','Profile\x20\x27','1456900TiRLBy','entries','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','readFileSync','\x20already\x20exists','1597656nPNuFR','10vgSQFQ','14503760sogAJz','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','791469yWOFCf','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','1977126EwtDaE','isDirectory','site','message','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','database','values','warn','tdx.json'];a50_0xaf0c=function(){return _0x24b7ef;};return a50_0xaf0c();}export function saveActiveProfileToUserConfig(_0x15d8c3){const _0x127741=a50_0x2db0;validateProfileName(_0x15d8c3);const _0x4977d6=getGlobalConfigPath(),_0x769d44=getConfigDir();!a50_0x268b8c[_0x127741(0xe5)](_0x769d44)&&createSecureDirectory(_0x769d44);let _0x5d65e9={};if(a50_0x268b8c[_0x127741(0xe5)](_0x4977d6))try{const _0xe5c4c9=a50_0x268b8c[_0x127741(0xb8)](_0x4977d6,_0x127741(0xce));_0x5d65e9=JSON[_0x127741(0x9a)](_0xe5c4c9);}catch{console[_0x127741(0xc7)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x4977d6+',\x20creating\x20new\x20file');}_0x5d65e9['profile']=_0x15d8c3,writeSecureFile(_0x4977d6,JSON[_0x127741(0xde)](_0x5d65e9,null,0x2));}function clearFieldFromUserConfig(_0x2ea701){const _0x5a4fb4=a50_0x2db0,_0x58a8fe=getGlobalConfigPath();if(!a50_0x268b8c['existsSync'](_0x58a8fe))return;let _0x4b74bd={};try{const _0x4a275a=a50_0x268b8c[_0x5a4fb4(0xb8)](_0x58a8fe,_0x5a4fb4(0xce));_0x4b74bd=JSON[_0x5a4fb4(0x9a)](_0x4a275a);}catch{return;}delete _0x4b74bd[_0x2ea701],writeSecureFile(_0x58a8fe,JSON[_0x5a4fb4(0xde)](_0x4b74bd,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x510c0e=a50_0x2db0;clearFieldFromUserConfig(_0x510c0e(0xc2));}export function clearActiveProfileFromUserConfig(){const _0x1bbaad=a50_0x2db0;clearFieldFromUserConfig(_0x1bbaad(0x9f));}export function createProfile(_0x213e41,_0x832110){const _0x1ff718=a50_0x2db0;validateProfileName(_0x213e41);if(profileExists(_0x213e41))throw new Error(_0x1ff718(0xe1)+_0x213e41+_0x1ff718(0xb9));saveProfile(_0x213e41,_0x832110);}export function saveProfileCredentials(_0x1ecdf0,_0x30fb06){const _0x3d9649=a50_0x2db0;validateProfileName(_0x1ecdf0);if(!profileExists(_0x1ecdf0))throw new Error(_0x3d9649(0xe1)+_0x1ecdf0+'\x20does\x20not\x20exist');const _0xce6c32=getNewCredentialPath(_0x1ecdf0);writeSecureFile(_0xce6c32,_0x30fb06);}export function loadProfileCredentials(_0x4f1196){const _0x40e68c=a50_0x2db0;validateProfileName(_0x4f1196);const _0x24ef4c=getNewCredentialPath(_0x4f1196);if(a50_0x268b8c[_0x40e68c(0xe5)](_0x24ef4c))try{return a50_0x268b8c['readFileSync'](_0x24ef4c,_0x40e68c(0xce));}catch{}const _0x2c83d8=getOldCredentialPath(_0x4f1196);if(a50_0x268b8c[_0x40e68c(0xe5)](_0x2c83d8)){console[_0x40e68c(0xc7)](_0x40e68c(0xa9)+_0x4f1196+'\x27'),console[_0x40e68c(0xc7)](_0x40e68c(0xa3)),console[_0x40e68c(0xc7)](_0x40e68c(0xd3)+_0x2c83d8+_0x40e68c(0xda)+_0x24ef4c+'\x22'),console['warn']('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a50_0x268b8c[_0x40e68c(0xb8)](_0x2c83d8,_0x40e68c(0xce));}catch{return null;}}return null;}
|
|
1
|
+
(function(_0x16eff1,_0x3c85de){const _0x30ee26=a50_0x5a82,_0x51c278=_0x16eff1();while(!![]){try{const _0x4e55cf=parseInt(_0x30ee26(0x150))/0x1*(-parseInt(_0x30ee26(0x18f))/0x2)+parseInt(_0x30ee26(0x15f))/0x3*(-parseInt(_0x30ee26(0x159))/0x4)+-parseInt(_0x30ee26(0x18d))/0x5+parseInt(_0x30ee26(0x17b))/0x6*(-parseInt(_0x30ee26(0x17a))/0x7)+-parseInt(_0x30ee26(0x19e))/0x8+parseInt(_0x30ee26(0x171))/0x9+parseInt(_0x30ee26(0x18a))/0xa;if(_0x4e55cf===_0x3c85de)break;else _0x51c278['push'](_0x51c278['shift']());}catch(_0x5cecb7){_0x51c278['push'](_0x51c278['shift']());}}}(a50_0x533d,0x7e9c3));import*as a50_0x94c7e from'node:fs';import*as a50_0x3cc5c3 from'node:path';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export function getProfileParams(_0xb586ca){const _0x47a808=a50_0x5a82,_0x5609b8={};if(!_0xb586ca)return _0x5609b8;for(const [_0x4a0f08,_0x2d3e15]of Object[_0x47a808(0x17e)](_0xb586ca)){_0x4a0f08!==_0x47a808(0x187)&&_0x2d3e15!==undefined&&(_0x5609b8[_0x4a0f08]=_0x2d3e15);}return _0x5609b8;}export function getProfilesDir(){const _0x4f4c46=a50_0x5a82;return a50_0x3cc5c3[_0x4f4c46(0x153)](getConfigDir(),_0x4f4c46(0x183));}function getProfileDir(_0x141d78){const _0x2233af=a50_0x5a82;return a50_0x3cc5c3[_0x2233af(0x153)](getProfilesDir(),_0x141d78);}function getProfileConfigPath(_0x4b363f){const _0x5adf18=a50_0x5a82;return a50_0x3cc5c3[_0x5adf18(0x153)](getProfileDir(_0x4b363f),_0x5adf18(0x198));}function getProfileEnvPath(_0x3887d9){const _0x58fc32=a50_0x5a82;return a50_0x3cc5c3[_0x58fc32(0x153)](getProfileDir(_0x3887d9),_0x58fc32(0x158));}function getGlobalConfigPath(){const _0x355e66=a50_0x5a82;return a50_0x3cc5c3[_0x355e66(0x153)](getConfigDir(),'tdx.json');}function validateProfileName(_0xc7887f){const _0x40019a=a50_0x5a82;if(!/^[a-zA-Z0-9_-]+$/[_0x40019a(0x15a)](_0xc7887f))throw new Error('Invalid\x20profile\x20name:\x20'+_0xc7887f+_0x40019a(0x19f));}function validateProfileConfig(_0x38da7b,_0xd87ffb){const _0x7d7a1e=a50_0x5a82;if(typeof _0x38da7b!=='object'||_0x38da7b===null)throw new Error(_0x7d7a1e(0x16b)+_0xd87ffb+_0x7d7a1e(0x16d));const _0x110995=[_0x7d7a1e(0x187),'site','database',_0x7d7a1e(0x16c),'llm_project','llm_agent'],_0x1f9859=_0x38da7b;for(const _0x50a514 of Object[_0x7d7a1e(0x172)](_0x1f9859)){!_0x110995[_0x7d7a1e(0x19b)](_0x50a514)&&console['warn'](_0x7d7a1e(0x164)+_0xd87ffb+_0x7d7a1e(0x176)+_0x50a514+'\x27\x20will\x20be\x20ignored');}if(_0x1f9859['description']!==undefined&&typeof _0x1f9859[_0x7d7a1e(0x187)]!==_0x7d7a1e(0x15e))throw new Error('Profile\x20\x27'+_0xd87ffb+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x1f9859[_0x7d7a1e(0x157)]!==undefined&&typeof _0x1f9859[_0x7d7a1e(0x157)]!=='string')throw new Error(_0x7d7a1e(0x16b)+_0xd87ffb+_0x7d7a1e(0x19d));if(_0x1f9859[_0x7d7a1e(0x192)]!==undefined&&typeof _0x1f9859[_0x7d7a1e(0x192)]!==_0x7d7a1e(0x15e))throw new Error(_0x7d7a1e(0x16b)+_0xd87ffb+_0x7d7a1e(0x182));if(_0x1f9859[_0x7d7a1e(0x16c)]!==undefined&&typeof _0x1f9859[_0x7d7a1e(0x16c)]!==_0x7d7a1e(0x15e))throw new Error(_0x7d7a1e(0x16b)+_0xd87ffb+_0x7d7a1e(0x175));if(_0x1f9859['llm_project']!==undefined&&typeof _0x1f9859[_0x7d7a1e(0x173)]!==_0x7d7a1e(0x15e))throw new Error(_0x7d7a1e(0x16b)+_0xd87ffb+_0x7d7a1e(0x194));if(_0x1f9859[_0x7d7a1e(0x195)]!==undefined&&typeof _0x1f9859[_0x7d7a1e(0x195)]!==_0x7d7a1e(0x15e))throw new Error(_0x7d7a1e(0x16b)+_0xd87ffb+_0x7d7a1e(0x152));return!![];}function a50_0x5a82(_0x5801fb,_0x4c3100){_0x5801fb=_0x5801fb-0x150;const _0x533df7=a50_0x533d();let _0x5a828e=_0x533df7[_0x5801fb];return _0x5a828e;}function loadProfilesFromTdxJson(_0x36d7d1,_0x44f213){const _0x1f8159=a50_0x5a82;if(!a50_0x94c7e[_0x1f8159(0x19c)](_0x36d7d1))return[];try{const _0x47b031=a50_0x94c7e[_0x1f8159(0x18e)](_0x36d7d1,_0x1f8159(0x186)),_0x149a79=JSON[_0x1f8159(0x163)](_0x47b031);if(!_0x149a79[_0x1f8159(0x183)]||typeof _0x149a79['profiles']!=='object')return[];const _0x35dcba=[];for(const [_0x50310c,_0x4c32b3]of Object['entries'](_0x149a79[_0x1f8159(0x183)])){try{validateProfileConfig(_0x4c32b3,_0x50310c);const _0x3bd86d=getNewCredentialPath(_0x50310c),_0x2ef9c0=getOldCredentialPath(_0x50310c),_0x41bad8=a50_0x94c7e[_0x1f8159(0x19c)](_0x3bd86d)||a50_0x94c7e[_0x1f8159(0x19c)](_0x2ef9c0);_0x35dcba[_0x1f8159(0x17c)]({'name':_0x50310c,'config':_0x4c32b3,'metadata':{'name':_0x50310c,'createdAt':new Date()[_0x1f8159(0x196)]()},'hasCredentials':_0x41bad8,'scope':_0x44f213});}catch(_0x5edb42){_0x5edb42 instanceof Error&&(console[_0x1f8159(0x169)](_0x1f8159(0x189)+_0x36d7d1+':'),console[_0x1f8159(0x169)]('\x20\x20'+_0x5edb42[_0x1f8159(0x160)]+'\x0a'));}}return _0x35dcba;}catch(_0x1e44a3){return _0x1e44a3 instanceof SyntaxError?(console[_0x1f8159(0x169)](_0x1f8159(0x16e)+_0x36d7d1+_0x1f8159(0x193)),console[_0x1f8159(0x169)](_0x1f8159(0x17f)+_0x1e44a3['message']+'\x0a')):console['warn'](_0x1f8159(0x185)+_0x36d7d1+':\x20'+_0x1e44a3+'\x0a'),[];}}export function getNewCredentialPath(_0x4e668f){const _0x2b134c=a50_0x5a82;return a50_0x3cc5c3[_0x2b134c(0x153)](getConfigDir(),'.env.'+_0x4e668f);}function getOldCredentialPath(_0x3ed11c){const _0x40739b=a50_0x5a82;return a50_0x3cc5c3[_0x40739b(0x153)](getProfilesDir(),_0x3ed11c,_0x40739b(0x158));}function loadProfilesFromTdxJsonFiles(){const _0x53935d=a50_0x5a82,_0x531b4b=[],_0x3cd490=findProjectConfigPath();_0x3cd490&&_0x531b4b['push'](...loadProfilesFromTdxJson(_0x3cd490,_0x53935d(0x16f)));const _0x52d2fa=a50_0x3cc5c3[_0x53935d(0x153)](getConfigDir(),'tdx.json');return _0x531b4b[_0x53935d(0x17c)](...loadProfilesFromTdxJson(_0x52d2fa,'user')),_0x531b4b;}function loadProfilesFromDirectories(){const _0x72dec6=a50_0x5a82,_0x5dabbc=getProfilesDir();if(!a50_0x94c7e[_0x72dec6(0x19c)](_0x5dabbc))return[];try{return a50_0x94c7e['readdirSync'](_0x5dabbc,{'withFileTypes':!![]})[_0x72dec6(0x174)](_0x28f58b=>_0x28f58b[_0x72dec6(0x16a)]())['map'](_0x285c83=>_0x285c83[_0x72dec6(0x197)])[_0x72dec6(0x174)](_0x4a894f=>{const _0x5c922b=_0x72dec6,_0x261a61=getProfileConfigPath(_0x4a894f),_0x67226f=getProfileEnvPath(_0x4a894f);return a50_0x94c7e['existsSync'](_0x261a61)||a50_0x94c7e[_0x5c922b(0x19c)](_0x67226f);})[_0x72dec6(0x188)](_0x5a5327=>{const _0x13de1e=loadProfileFromDirectory(_0x5a5327);if(_0x13de1e)return{..._0x13de1e,'scope':'directory'};return null;})['filter'](_0x4ea5a1=>_0x4ea5a1!==null);}catch{return[];}}function loadProfileFromDirectory(_0x1452da){const _0x379480=a50_0x5a82,_0x4b32b7=getProfileConfigPath(_0x1452da),_0x2f092c=getOldCredentialPath(_0x1452da);if(!a50_0x94c7e[_0x379480(0x19c)](_0x4b32b7)&&!a50_0x94c7e[_0x379480(0x19c)](_0x2f092c))return null;let _0x22c670={},_0x1c5319={'name':_0x1452da,'createdAt':new Date()['toISOString']()};if(a50_0x94c7e[_0x379480(0x19c)](_0x4b32b7))try{const _0x10738f=a50_0x94c7e[_0x379480(0x18e)](_0x4b32b7,_0x379480(0x186)),_0x7e4409=JSON['parse'](_0x10738f),{metadata:_0x4fa0d3,..._0x1b9c85}=_0x7e4409;_0x22c670=_0x1b9c85,_0x4fa0d3&&(_0x1c5319=_0x4fa0d3);}catch{}return{'name':_0x1452da,'config':_0x22c670,'metadata':_0x1c5319,'hasCredentials':a50_0x94c7e[_0x379480(0x19c)](_0x2f092c),'scope':_0x379480(0x177)};}export function listProfiles(){const _0x560c20=a50_0x5a82,_0x4f49cd=loadProfilesFromTdxJsonFiles(),_0x35aaba=loadProfilesFromDirectories();if(_0x35aaba[_0x560c20(0x156)]>0x0){const _0x56ea33=_0x35aaba[_0x560c20(0x188)](_0x43eee1=>_0x43eee1[_0x560c20(0x197)])[_0x560c20(0x153)](',\x20'),_0x114049=getConfigDir();console[_0x560c20(0x169)](_0x560c20(0x166)+_0x56ea33),console['warn']('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console['warn'](_0x560c20(0x162)+a50_0x3cc5c3[_0x560c20(0x153)](_0x114049,_0x560c20(0x198))),console['warn'](_0x560c20(0x168)),console[_0x560c20(0x169)](_0x560c20(0x165));}const _0x132edd=[..._0x4f49cd,..._0x35aaba],_0x671155=new Map();for(const _0x299521 of _0x132edd){!_0x671155[_0x560c20(0x15b)](_0x299521[_0x560c20(0x197)])&&_0x671155[_0x560c20(0x184)](_0x299521[_0x560c20(0x197)],_0x299521);}return Array[_0x560c20(0x17d)](_0x671155['values']())['sort']((_0x33a280,_0x3ded93)=>_0x33a280[_0x560c20(0x197)][_0x560c20(0x179)](_0x3ded93[_0x560c20(0x197)]));}export function profileExists(_0x31056c){const _0x2ba21c=a50_0x5a82,_0x367e58=listProfiles();return _0x367e58[_0x2ba21c(0x181)](_0x2c4831=>_0x2c4831[_0x2ba21c(0x197)]===_0x31056c);}export function loadProfile(_0x381a38){const _0x5a83b9=a50_0x5a82;validateProfileName(_0x381a38);const _0x4ea640=listProfiles(),_0x186ca0=_0x4ea640[_0x5a83b9(0x155)](_0x385510=>_0x385510[_0x5a83b9(0x197)]===_0x381a38);return _0x186ca0||null;}export function saveProfile(_0x53bb2c,_0x8c818a,_0x50161f=![]){saveProfileToUserConfig(_0x53bb2c,_0x8c818a);}export function deleteProfile(_0x157529){const _0x1b5955=a50_0x5a82;validateProfileName(_0x157529);const _0x5060e4=getProfileDir(_0x157529);if(!a50_0x94c7e[_0x1b5955(0x19c)](_0x5060e4))throw new Error(_0x1b5955(0x18b)+_0x157529+_0x1b5955(0x191));a50_0x94c7e[_0x1b5955(0x18c)](_0x5060e4,{'recursive':!![],'force':!![]});}function a50_0x533d(){const _0x5bc698=['\x20does\x20not\x20exist','database',':\x20Invalid\x20JSON\x20syntax','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','llm_agent','toISOString','name','tdx.json','TDX_PROFILE','Warning:\x20Failed\x20to\x20parse\x20','includes','existsSync','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','2252656VjUZdf','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','1702dNaLcy','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','join','profile','find','length','site','.env','7976YbfAgu','test','has','\x20\x20mv\x20\x22','Failed\x20to\x20parse\x20','string','1434TsvyBA','message','stringify','\x20\x201.\x20Edit:\x20','parse','Warning:\x20Profile\x20\x27','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','env','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','warn','isDirectory','Profile\x20\x27','parent_segment','\x27:\x20config\x20must\x20be\x20an\x20object','\x0aWarning:\x20Failed\x20to\x20parse\x20','local','\x27\x20not\x20found\x20in\x20user\x20configuration','6489171axebZl','keys','llm_project','filter','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','\x27:\x20unknown\x20config\x20key\x20\x27','directory','\x22\x20\x22','localeCompare','1778dHGpGY','4938MQgTEa','push','from','entries','Error:\x20','To\x20migrate:','some','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','profiles','set','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','utf-8','description','map','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','20070510zwNeDn','Profile\x20','rmSync','2662725oLdgnj','readFileSync','274wFYNNF','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'];a50_0x533d=function(){return _0x5bc698;};return a50_0x533d();}export function saveProfileToUserConfig(_0x539af0,_0x340eb1){const _0x41a842=a50_0x5a82;validateProfileName(_0x539af0);const _0xc3fd1e=getGlobalConfigPath(),_0x221fe8=getConfigDir();!a50_0x94c7e[_0x41a842(0x19c)](_0x221fe8)&&createSecureDirectory(_0x221fe8);let _0x15ee9d={};if(a50_0x94c7e['existsSync'](_0xc3fd1e))try{const _0x108adc=a50_0x94c7e[_0x41a842(0x18e)](_0xc3fd1e,_0x41a842(0x186));_0x15ee9d=JSON['parse'](_0x108adc);}catch{console[_0x41a842(0x169)](_0x41a842(0x19a)+_0xc3fd1e+',\x20creating\x20new\x20file');}!_0x15ee9d[_0x41a842(0x183)]&&(_0x15ee9d[_0x41a842(0x183)]={}),_0x15ee9d['profiles'][_0x539af0]=_0x340eb1,writeSecureFile(_0xc3fd1e,JSON['stringify'](_0x15ee9d,null,0x2));}export function removeProfileFromUserConfig(_0x466034){const _0xadaaeb=a50_0x5a82;validateProfileName(_0x466034);const _0xca918a=getGlobalConfigPath();if(!a50_0x94c7e[_0xadaaeb(0x19c)](_0xca918a))throw new Error(_0xadaaeb(0x16b)+_0x466034+_0xadaaeb(0x170));let _0x4fa398={};try{const _0x9d2231=a50_0x94c7e[_0xadaaeb(0x18e)](_0xca918a,_0xadaaeb(0x186));_0x4fa398=JSON[_0xadaaeb(0x163)](_0x9d2231);}catch{throw new Error(_0xadaaeb(0x15d)+_0xca918a);}if(!_0x4fa398[_0xadaaeb(0x183)]||!_0x4fa398['profiles'][_0x466034])throw new Error(_0xadaaeb(0x16b)+_0x466034+_0xadaaeb(0x170));delete _0x4fa398['profiles'][_0x466034],_0x4fa398[_0xadaaeb(0x154)]===_0x466034&&delete _0x4fa398['profile'],writeSecureFile(_0xca918a,JSON['stringify'](_0x4fa398,null,0x2));}export function getActiveProfile(){const _0x532827=a50_0x5a82,_0x23cb55=loadSessionContext();if(_0x23cb55?.[_0x532827(0x154)])return _0x23cb55[_0x532827(0x154)];if(process[_0x532827(0x167)][_0x532827(0x199)])return process['env']['TDX_PROFILE'];const _0x13e421=getGlobalConfigPath();if(!a50_0x94c7e[_0x532827(0x19c)](_0x13e421))return null;try{const _0x37eafd=a50_0x94c7e['readFileSync'](_0x13e421,_0x532827(0x186)),_0xb0af91=JSON[_0x532827(0x163)](_0x37eafd);return _0xb0af91[_0x532827(0x154)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x1c3147){const _0x375bde=a50_0x5a82,_0x193fb6=getGlobalConfigPath(),_0x5b1e80=getConfigDir();!a50_0x94c7e[_0x375bde(0x19c)](_0x5b1e80)&&createSecureDirectory(_0x5b1e80);let _0x8a46bf={};if(a50_0x94c7e[_0x375bde(0x19c)](_0x193fb6))try{const _0x1d408e=a50_0x94c7e[_0x375bde(0x18e)](_0x193fb6,_0x375bde(0x186));_0x8a46bf=JSON['parse'](_0x1d408e);}catch{console[_0x375bde(0x169)](_0x375bde(0x19a)+_0x193fb6+',\x20creating\x20new\x20file');}_0x8a46bf[_0x375bde(0x157)]=_0x1c3147,writeSecureFile(_0x193fb6,JSON[_0x375bde(0x161)](_0x8a46bf,null,0x2));}export function saveActiveProfileToUserConfig(_0x3368e5){const _0x1b8442=a50_0x5a82;validateProfileName(_0x3368e5);const _0x13cc76=getGlobalConfigPath(),_0x7ab096=getConfigDir();!a50_0x94c7e['existsSync'](_0x7ab096)&&createSecureDirectory(_0x7ab096);let _0x2cb057={};if(a50_0x94c7e['existsSync'](_0x13cc76))try{const _0x2cc088=a50_0x94c7e[_0x1b8442(0x18e)](_0x13cc76,_0x1b8442(0x186));_0x2cb057=JSON['parse'](_0x2cc088);}catch{console['warn'](_0x1b8442(0x19a)+_0x13cc76+',\x20creating\x20new\x20file');}_0x2cb057[_0x1b8442(0x154)]=_0x3368e5,writeSecureFile(_0x13cc76,JSON[_0x1b8442(0x161)](_0x2cb057,null,0x2));}function clearFieldFromUserConfig(_0x2dfcef){const _0x3bd0e0=a50_0x5a82,_0x3e4561=getGlobalConfigPath();if(!a50_0x94c7e['existsSync'](_0x3e4561))return;let _0x220257={};try{const _0xf7ce23=a50_0x94c7e[_0x3bd0e0(0x18e)](_0x3e4561,'utf-8');_0x220257=JSON[_0x3bd0e0(0x163)](_0xf7ce23);}catch{return;}delete _0x220257[_0x2dfcef],writeSecureFile(_0x3e4561,JSON[_0x3bd0e0(0x161)](_0x220257,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x1c79e0=a50_0x5a82;clearFieldFromUserConfig(_0x1c79e0(0x157));}export function clearActiveProfileFromUserConfig(){const _0xfc1a4a=a50_0x5a82;clearFieldFromUserConfig(_0xfc1a4a(0x154));}export function createProfile(_0x48b1f1,_0x3017b3){validateProfileName(_0x48b1f1);if(profileExists(_0x48b1f1))throw new Error('Profile\x20'+_0x48b1f1+'\x20already\x20exists');saveProfile(_0x48b1f1,_0x3017b3);}export function saveProfileCredentials(_0x369791,_0x2149c){const _0x1f6544=a50_0x5a82;validateProfileName(_0x369791);if(!profileExists(_0x369791))throw new Error(_0x1f6544(0x18b)+_0x369791+_0x1f6544(0x191));const _0x83fe33=getNewCredentialPath(_0x369791);writeSecureFile(_0x83fe33,_0x2149c);}export function loadProfileCredentials(_0x4ce0b5){const _0xcfd7e=a50_0x5a82;validateProfileName(_0x4ce0b5);const _0x74872c=getNewCredentialPath(_0x4ce0b5);if(a50_0x94c7e[_0xcfd7e(0x19c)](_0x74872c))try{return a50_0x94c7e[_0xcfd7e(0x18e)](_0x74872c,_0xcfd7e(0x186));}catch{}const _0x56fa19=getOldCredentialPath(_0x4ce0b5);if(a50_0x94c7e[_0xcfd7e(0x19c)](_0x56fa19)){console[_0xcfd7e(0x169)](_0xcfd7e(0x190)+_0x4ce0b5+'\x27'),console[_0xcfd7e(0x169)](_0xcfd7e(0x180)),console['warn'](_0xcfd7e(0x15c)+_0x56fa19+_0xcfd7e(0x178)+_0x74872c+'\x22'),console[_0xcfd7e(0x169)](_0xcfd7e(0x151));try{return a50_0x94c7e['readFileSync'](_0x56fa19,_0xcfd7e(0x186));}catch{return null;}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a51_0x4818a6=a51_0x4a72;function a51_0x7a5e(){const _0x199ba7=['Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','40rksrts','\x20is\x20ignored.\x20','20IwjgOJ','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','readFileSync','1779354UxcgMT','198216pNRJmx','tdx.json','12903021hvvinp','cwd','21379300CCmsNo','includes','stringify','4sQqzDb','utf-8','join','ENOENT','TD_API_KEY','parse','852102VqbhQD','code','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json',').\x20','profile','4411254zHEpra','warn','dirname','apiKey','api_key','1873627HpGihG'];a51_0x7a5e=function(){return _0x199ba7;};return a51_0x7a5e();}(function(_0x5598fc,_0x1563c8){const _0x35cd75=a51_0x4a72,_0x16a8ea=_0x5598fc();while(!![]){try{const _0x4cfe70=-parseInt(_0x35cd75(0x1d3))/0x1+parseInt(_0x35cd75(0x1e4))/0x2+parseInt(_0x35cd75(0x1d8))/0x3*(parseInt(_0x35cd75(0x1cd))/0x4)+parseInt(_0x35cd75(0x1e1))/0x5*(-parseInt(_0x35cd75(0x1c6))/0x6)+-parseInt(_0x35cd75(0x1dd))/0x7*(parseInt(_0x35cd75(0x1df))/0x8)+-parseInt(_0x35cd75(0x1c8))/0x9+parseInt(_0x35cd75(0x1ca))/0xa;if(_0x4cfe70===_0x1563c8)break;else _0x16a8ea['push'](_0x16a8ea['shift']());}catch(_0x13c146){_0x16a8ea['push'](_0x16a8ea['shift']());}}}(a51_0x7a5e,0xb51ad));function a51_0x4a72(_0x829a1b,_0x4c333b){_0x829a1b=_0x829a1b-0x1c6;const _0x7a5e00=a51_0x7a5e();let _0x4a729b=_0x7a5e00[_0x829a1b];return _0x4a729b;}import*as a51_0x513616 from'node:fs';import*as a51_0x3ca90e from'node:path';const PROJECT_CONFIG_FILENAME=a51_0x4818a6(0x1c7);export function findProjectConfigPath(_0x1881f9){const _0x35dd3f=a51_0x4818a6;let _0x2b8d36=_0x1881f9||process[_0x35dd3f(0x1c9)]();while(!![]){const _0x2cefe8=a51_0x3ca90e[_0x35dd3f(0x1cf)](_0x2b8d36,PROJECT_CONFIG_FILENAME);if(a51_0x513616['existsSync'](_0x2cefe8))return _0x2cefe8;const _0x276501=a51_0x3ca90e[_0x35dd3f(0x1da)](_0x2b8d36);if(_0x276501===_0x2b8d36)return null;_0x2b8d36=_0x276501;}}export function loadProjectConfig(_0x1c3680){const _0x5bab88=a51_0x4818a6,_0xa382cf=findProjectConfigPath(_0x1c3680);if(!_0xa382cf)return null;try{const _0x51b202=a51_0x513616[_0x5bab88(0x1e3)](_0xa382cf,_0x5bab88(0x1ce)),_0x542d05=JSON[_0x5bab88(0x1d2)](_0x51b202),_0x1e3aa4=JSON[_0x5bab88(0x1cc)](_0x542d05);if(_0x1e3aa4[_0x5bab88(0x1cb)](_0x5bab88(0x1d1))||_0x1e3aa4[_0x5bab88(0x1cb)](_0x5bab88(0x1db))||_0x1e3aa4[_0x5bab88(0x1cb)](_0x5bab88(0x1dc)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0xa382cf+_0x5bab88(0x1d6)+_0x5bab88(0x1de));const {metadata:_0x27dd2e,profile:_0x46a915,..._0x3513a9}=_0x542d05;return _0x46a915&&console[_0x5bab88(0x1d9)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0xa382cf+_0x5bab88(0x1e0)+_0x5bab88(0x1d5)),_0x3513a9;}catch(_0x46d587){if(_0x46d587 instanceof Error&&_0x5bab88(0x1d4)in _0x46d587&&_0x46d587[_0x5bab88(0x1d4)]===_0x5bab88(0x1d0))return null;throw new Error('Failed\x20to\x20load\x20project\x20config\x20from\x20'+_0xa382cf+':\x20'+_0x46d587);}}export function saveProjectConfig(_0xe5b44f,_0x4bc1a5){const _0x5e479d=a51_0x4818a6,_0x4ea1fe=_0x4bc1a5||process['cwd'](),_0x560cb8=a51_0x3ca90e[_0x5e479d(0x1cf)](_0x4ea1fe,PROJECT_CONFIG_FILENAME),_0x582b5d=JSON[_0x5e479d(0x1cc)](_0xe5b44f);if(_0x582b5d[_0x5e479d(0x1cb)](_0x5e479d(0x1d1))||_0x582b5d[_0x5e479d(0x1cb)]('apiKey')||_0x582b5d[_0x5e479d(0x1cb)](_0x5e479d(0x1dc)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x5e479d(0x1d7)in _0xe5b44f)throw new Error(_0x5e479d(0x1e2));a51_0x513616['writeFileSync'](_0x560cb8,JSON[_0x5e479d(0x1cc)](_0xe5b44f,null,0x2));}export function hasProjectConfig(_0x318e04){return findProjectConfigPath(_0x318e04)!==null;}export function getProjectRoot(_0x2018ee){const _0x588750=a51_0x4818a6,_0x3a88a1=findProjectConfigPath(_0x2018ee);return _0x3a88a1?a51_0x3ca90e[_0x588750(0x1da)](_0x3a88a1):null;}
|
package/dist/core/session.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x38eb48,_0x9fcb6b){const _0x17c049=a52_0x4b39,_0x43b163=_0x38eb48();while(!![]){try{const _0x388c58=-parseInt(_0x17c049(0x144))/0x1+parseInt(_0x17c049(0x155))/0x2*(parseInt(_0x17c049(0x156))/0x3)+-parseInt(_0x17c049(0x147))/0x4*(parseInt(_0x17c049(0x161))/0x5)+parseInt(_0x17c049(0x14f))/0x6+parseInt(_0x17c049(0x146))/0x7+parseInt(_0x17c049(0x151))/0x8*(-parseInt(_0x17c049(0x13f))/0x9)+parseInt(_0x17c049(0x145))/0xa;if(_0x388c58===_0x9fcb6b)break;else _0x43b163['push'](_0x43b163['shift']());}catch(_0x4e2b44){_0x43b163['push'](_0x43b163['shift']());}}}(a52_0x4a96,0xd24e2));import*as a52_0x3d48a9 from'node:fs';import*as a52_0x5209d3 from'node:path';import*as a52_0x5828ec from'node:os';function a52_0x4b39(_0x183171,_0x20400d){_0x183171=_0x183171-0x13a;const _0x4a96a7=a52_0x4a96();let _0x4b3966=_0x4a96a7[_0x183171];return _0x4b3966;}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 _0x129635=a52_0x4b39,_0x4f57df=process[_0x129635(0x15a)][_0x129635(0x142)]||a52_0x5209d3[_0x129635(0x158)](a52_0x5828ec['homedir'](),_0x129635(0x153),'tdx');return a52_0x5209d3[_0x129635(0x158)](_0x4f57df,_0x129635(0x13d));}function getSessionPath(_0x26727a){const _0x52fca4=a52_0x4b39;return a52_0x5209d3['join'](getSessionsDir(),_0x26727a+_0x52fca4(0x15b));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x10117d){if(_0x10117d)return _0x10117d;return getCurrentSessionPID()['toString']();}export function loadSessionContext(_0x40778f){const _0x1416f0=a52_0x4b39,_0x358efc=_0x40778f||getCurrentSessionPID()[_0x1416f0(0x150)](),_0x552bc0=/^\d+$/[_0x1416f0(0x15c)](_0x358efc)?parseInt(_0x358efc,0xa):null;return _0x552bc0!==null?loadSessionContextByPID(_0x552bc0):loadSessionContextByString(_0x358efc);}export function loadSessionContextByPID(_0x51f3d8){const _0x1fdf4b=a52_0x4b39,_0x118124=getSessionPath(_0x51f3d8);if(!a52_0x3d48a9[_0x1fdf4b(0x14d)](_0x118124))return null;try{const _0x382eda=a52_0x3d48a9[_0x1fdf4b(0x154)](_0x118124,_0x1fdf4b(0x13e)),_0x3c7e5d=JSON[_0x1fdf4b(0x15f)](_0x382eda),_0x3c9290=new Date(_0x3c7e5d[_0x1fdf4b(0x15e)])[_0x1fdf4b(0x152)](),_0x30aea4=Date[_0x1fdf4b(0x14b)]();if(_0x30aea4-_0x3c9290>SESSION_EXPIRATION_MS)return a52_0x3d48a9[_0x1fdf4b(0x160)](_0x118124),null;const _0x262817=JSON['stringify'](_0x3c7e5d);if(_0x262817[_0x1fdf4b(0x148)]('TD_API_KEY')||_0x262817[_0x1fdf4b(0x148)](_0x1fdf4b(0x141))||_0x262817[_0x1fdf4b(0x148)](_0x1fdf4b(0x149)))return console[_0x1fdf4b(0x140)](_0x1fdf4b(0x162)+_0x118124+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a52_0x3d48a9[_0x1fdf4b(0x160)](_0x118124),null;return _0x3c7e5d;}catch{try{a52_0x3d48a9['unlinkSync'](_0x118124);}catch{}return null;}}function loadSessionContextByString(_0x56005f){const _0x1f64f5=a52_0x4b39,_0x1c498e=a52_0x5209d3[_0x1f64f5(0x158)](getSessionsDir(),_0x56005f+_0x1f64f5(0x15b));if(!a52_0x3d48a9[_0x1f64f5(0x14d)](_0x1c498e))return null;try{const _0x57fc7a=a52_0x3d48a9['readFileSync'](_0x1c498e,_0x1f64f5(0x13e)),_0x2a3cf8=JSON[_0x1f64f5(0x15f)](_0x57fc7a),_0x7413b2=new Date(_0x2a3cf8[_0x1f64f5(0x15e)])[_0x1f64f5(0x152)](),_0x3a0058=Date[_0x1f64f5(0x14b)]();if(_0x3a0058-_0x7413b2>SESSION_EXPIRATION_MS)return a52_0x3d48a9[_0x1f64f5(0x160)](_0x1c498e),null;const _0x2ff155=JSON[_0x1f64f5(0x13a)](_0x2a3cf8);if(_0x2ff155[_0x1f64f5(0x148)](_0x1f64f5(0x157))||_0x2ff155[_0x1f64f5(0x148)](_0x1f64f5(0x141))||_0x2ff155[_0x1f64f5(0x148)]('api_key'))return console[_0x1f64f5(0x140)](_0x1f64f5(0x162)+_0x1c498e+_0x1f64f5(0x13b)),a52_0x3d48a9[_0x1f64f5(0x160)](_0x1c498e),null;return _0x2a3cf8;}catch{try{a52_0x3d48a9['unlinkSync'](_0x1c498e);}catch{}return null;}}export function saveSessionContext(_0x458a88,_0x41eeeb){const _0x354b48=a52_0x4b39,_0x121d2f=_0x41eeeb||getCurrentSessionPID()[_0x354b48(0x150)](),_0x270f25=/^\d+$/['test'](_0x121d2f)?parseInt(_0x121d2f,0xa):getCurrentSessionPID(),_0x3a5dd1=a52_0x5209d3[_0x354b48(0x158)](getSessionsDir(),_0x121d2f+_0x354b48(0x15b)),_0x53d32d=getSessionsDir();createSecureDirectory(_0x53d32d);const _0x25e544=JSON[_0x354b48(0x13a)](_0x458a88);if(_0x25e544['includes']('TD_API_KEY')||_0x25e544['includes'](_0x354b48(0x141))||_0x25e544[_0x354b48(0x148)](_0x354b48(0x149)))throw new Error(_0x354b48(0x15d));let _0x1d04d9;const _0x49ed5d=/^\d+$/[_0x354b48(0x15c)](_0x121d2f)?loadSessionContextByPID(parseInt(_0x121d2f,0xa)):loadSessionContextByString(_0x121d2f);_0x49ed5d?_0x1d04d9={..._0x49ed5d,..._0x458a88,'pid':_0x270f25,'sessionId':_0x121d2f!==_0x270f25[_0x354b48(0x150)]()?_0x121d2f:undefined,'updatedAt':new Date()[_0x354b48(0x159)]()}:_0x1d04d9={'pid':_0x270f25,'sessionId':_0x121d2f!==_0x270f25[_0x354b48(0x150)]()?_0x121d2f:undefined,..._0x458a88,'createdAt':new Date()[_0x354b48(0x159)](),'updatedAt':new Date()[_0x354b48(0x159)]()},a52_0x3d48a9[_0x354b48(0x14e)](_0x3a5dd1,JSON[_0x354b48(0x13a)](_0x1d04d9,null,0x2));}export function clearSessionContext(_0x205d37){const _0xf7c78a=a52_0x4b39,_0x3c4e19=_0x205d37||getCurrentSessionPID()[_0xf7c78a(0x150)](),_0x33054b=a52_0x5209d3[_0xf7c78a(0x158)](getSessionsDir(),_0x3c4e19+_0xf7c78a(0x15b));a52_0x3d48a9[_0xf7c78a(0x14d)](_0x33054b)&&a52_0x3d48a9[_0xf7c78a(0x160)](_0x33054b);}export function clearSessionContextField(_0x2eb3e5,_0x332fab){const _0x25c563=a52_0x4b39,_0x1aafaf=_0x332fab||getCurrentSessionPID()['toString'](),_0x415c75=a52_0x5209d3[_0x25c563(0x158)](getSessionsDir(),_0x1aafaf+'.json');if(!a52_0x3d48a9[_0x25c563(0x14d)](_0x415c75))return;try{const _0x184180=a52_0x3d48a9[_0x25c563(0x154)](_0x415c75,'utf-8'),_0x5ce986=JSON[_0x25c563(0x15f)](_0x184180);delete _0x5ce986[_0x2eb3e5],a52_0x3d48a9[_0x25c563(0x14e)](_0x415c75,JSON[_0x25c563(0x13a)](_0x5ce986,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x3c0186=a52_0x4b39,_0x3ebf99=getSessionsDir();if(!a52_0x3d48a9['existsSync'](_0x3ebf99))return 0x0;let _0xe5cb95=0x0;const _0x3e4e4d=Date[_0x3c0186(0x14b)]();try{const _0x341cc6=a52_0x3d48a9['readdirSync'](_0x3ebf99);for(const _0x8bb300 of _0x341cc6){if(!_0x8bb300['endsWith'](_0x3c0186(0x15b)))continue;const _0x5a7e6e=a52_0x5209d3[_0x3c0186(0x158)](_0x3ebf99,_0x8bb300),_0x538c80=_0x8bb300[_0x3c0186(0x143)](_0x3c0186(0x15b),''),_0x4d2c2b=parseInt(_0x538c80,0xa),_0x19cec0=!isNaN(_0x4d2c2b);if(_0x19cec0){if(!isProcessRunning(_0x4d2c2b)){a52_0x3d48a9['unlinkSync'](_0x5a7e6e),_0xe5cb95++;continue;}}try{const _0x2c6bac=a52_0x3d48a9['readFileSync'](_0x5a7e6e,'utf-8'),_0x5d6077=JSON[_0x3c0186(0x15f)](_0x2c6bac),_0x4fe9b5=new Date(_0x5d6077[_0x3c0186(0x15e)])[_0x3c0186(0x152)]();_0x3e4e4d-_0x4fe9b5>SESSION_EXPIRATION_MS&&(a52_0x3d48a9[_0x3c0186(0x160)](_0x5a7e6e),_0xe5cb95++);}catch{a52_0x3d48a9[_0x3c0186(0x160)](_0x5a7e6e),_0xe5cb95++;}}}catch{}return _0xe5cb95;}function a52_0x4a96(){const _0x13de53=['sessions','utf-8','18ULlmpO','warn','apiKey','TDX_CONFIG_DIR','replace','992095UvvqiL','24798380gNUqZC','5150432eCxPiV','8948vprGww','includes','api_key','sort','now','push','existsSync','writeFileSync','547278LznMoO','toString','2468472mrOLOm','getTime','.config','readFileSync','55098XYdYNE','78klWtVC','TD_API_KEY','join','toISOString','env','.json','test','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','createdAt','parse','unlinkSync','3470RKaSLr','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','stringify','.\x20This\x20is\x20insecure.\x20Removing\x20session.','readdirSync'];a52_0x4a96=function(){return _0x13de53;};return a52_0x4a96();}export function listActiveSessions(){const _0x4bda34=a52_0x4b39,_0xf8aa10=getSessionsDir();if(!a52_0x3d48a9[_0x4bda34(0x14d)](_0xf8aa10))return[];try{const _0x467a68=a52_0x3d48a9[_0x4bda34(0x13c)](_0xf8aa10),_0x541624=[];for(const _0x4a0037 of _0x467a68){if(!_0x4a0037['endsWith'](_0x4bda34(0x15b)))continue;const _0x2ab9fe=_0x4a0037[_0x4bda34(0x143)](_0x4bda34(0x15b),''),_0x24836f=parseInt(_0x2ab9fe,0xa);!isNaN(_0x24836f)&&isProcessRunning(_0x24836f)&&_0x541624[_0x4bda34(0x14c)](_0x24836f);}return _0x541624[_0x4bda34(0x14a)]((_0x32d6cc,_0x24c3e7)=>_0x32d6cc-_0x24c3e7);}catch{return[];}}
|
package/dist/core/user-cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d8ffd,_0x3323c6){const _0x5541bd=a53_0x5a6c,_0x5dea5c=_0x4d8ffd();while(!![]){try{const _0x23c46c=-parseInt(_0x5541bd(0x17d))/0x1*(-parseInt(_0x5541bd(0x178))/0x2)+parseInt(_0x5541bd(0x176))/0x3+parseInt(_0x5541bd(0x17b))/0x4*(-parseInt(_0x5541bd(0x16e))/0x5)+-parseInt(_0x5541bd(0x17e))/0x6*(parseInt(_0x5541bd(0x177))/0x7)+-parseInt(_0x5541bd(0x173))/0x8*(-parseInt(_0x5541bd(0x16f))/0x9)+parseInt(_0x5541bd(0x171))/0xa*(-parseInt(_0x5541bd(0x175))/0xb)+parseInt(_0x5541bd(0x17a))/0xc*(parseInt(_0x5541bd(0x174))/0xd);if(_0x23c46c===_0x3323c6)break;else _0x5dea5c['push'](_0x5dea5c['shift']());}catch(_0x4cd5fe){_0x5dea5c['push'](_0x5dea5c['shift']());}}}(a53_0x1405,0xe175f));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x1abb27){const _0x3782eb=a53_0x5a6c,_0x379215=_0x1abb27||_0x3782eb(0x172);return join(getCacheDir(),_0x3782eb(0x179)+_0x379215+_0x3782eb(0x17f));}function a53_0x5a6c(_0x43fd65,_0x28a2c0){_0x43fd65=_0x43fd65-0x16e;const _0x14052b=a53_0x1405();let _0x5a6cb4=_0x14052b[_0x43fd65];return _0x5a6cb4;}function a53_0x1405(){const _0x15be24=['1985026OaWBwM','users-','2183388AZyOFx','76aYSaAg','utf-8','1KDtzFi','4429038abpuUL','.json','now','88745WHJFdp','1017lkRKqv','parse','2960jzuDpn','default','38776OXlNpH','78IXyySQ','36289aZaNYw','1030431ZZeNqK','7KpCReD'];a53_0x1405=function(){return _0x15be24;};return a53_0x1405();}export function loadCachedUsers(_0x3ae650){const _0x1395fd=a53_0x5a6c,_0x40120a=getCacheFilePath(_0x3ae650);if(!existsSync(_0x40120a))return null;try{const _0x53b7d3=readFileSync(_0x40120a,_0x1395fd(0x17c)),_0x2db48b=JSON[_0x1395fd(0x170)](_0x53b7d3);return _0x2db48b['users'];}catch{return null;}}export function saveCachedUsers(_0x5d105f,_0x25f04e){const _0x420ecb=a53_0x5a6c,_0xba5bc2=getCacheDir();!existsSync(_0xba5bc2)&&mkdirSync(_0xba5bc2,{'recursive':!![]});const _0x22ec9a=getCacheFilePath(_0x5d105f),_0x100325={'users':_0x25f04e,'cachedAt':Date[_0x420ecb(0x180)]()};writeFileSync(_0x22ec9a,JSON['stringify'](_0x100325,null,0x2),_0x420ecb(0x17c));}export function clearUserCache(_0x2c3d33){const _0x170f0a=getCacheFilePath(_0x2c3d33);if(existsSync(_0x170f0a))try{unlinkSync(_0x170f0a);}catch{}}
|
package/dist/core/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x30f1a2,_0x3a32a6){const _0x1db9f2=a54_0x1786,_0x567fef=_0x30f1a2();while(!![]){try{const _0x17c623=-parseInt(_0x1db9f2(0x1df))/0x1+-parseInt(_0x1db9f2(0x1e8))/0x2+-parseInt(_0x1db9f2(0x1e7))/0x3+parseInt(_0x1db9f2(0x1e6))/0x4+parseInt(_0x1db9f2(0x1e9))/0x5+parseInt(_0x1db9f2(0x1e3))/0x6+-parseInt(_0x1db9f2(0x1ea))/0x7*(-parseInt(_0x1db9f2(0x1de))/0x8);if(_0x17c623===_0x3a32a6)break;else _0x567fef['push'](_0x567fef['shift']());}catch(_0x3d146f){_0x567fef['push'](_0x567fef['shift']());}}}(a54_0x10d4,0x20833));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a54_0x1786(_0x3c63b6,_0x443107){_0x3c63b6=_0x3c63b6-0x1de;const _0x10d4a0=a54_0x10d4();let _0x1786d5=_0x10d4a0[_0x3c63b6];return _0x1786d5;}function a54_0x10d4(){const _0x28b889=['951325lPAfUL','28APCzQe','utf-8','260296KeQUKu','118719LmekpF','includes','.dev','../../package.json','1101954otgfFj','version','parse','262284KpXkTb','754917Fjhuqg','132228AxwgDU'];a54_0x10d4=function(){return _0x28b889;};return a54_0x10d4();}let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x5d5ba8=a54_0x1786;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x108566=fileURLToPath(import.meta.url),_0x10d082=dirname(_0x108566);try{const _0x10aae9=join(_0x10d082,'../build-info.json');cachedBuildInfo=JSON[_0x5d5ba8(0x1e5)](readFileSync(_0x10aae9,_0x5d5ba8(0x1eb)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x269d0e=a54_0x1786;if(cachedVersion!==null)return cachedVersion;const _0x44c42b=fileURLToPath(import.meta.url),_0x4aa97d=dirname(_0x44c42b),_0x458df6=getBuildInfo();if(_0x458df6['version'])return cachedVersion=_0x458df6['version'],cachedVersion;try{const _0x212448=join(_0x4aa97d,_0x269d0e(0x1e2)),_0x7d694=JSON[_0x269d0e(0x1e5)](readFileSync(_0x212448,_0x269d0e(0x1eb)));cachedVersion=_0x7d694[_0x269d0e(0x1e4)];}catch{cachedVersion='0.0.0';}return cachedVersion;}export function isDevVersion(){const _0xd79b4e=a54_0x1786,_0x2dc498=getVersion();return _0x2dc498['includes'](_0xd79b4e(0x1e1))||_0x2dc498[_0xd79b4e(0x1e0)]('-');}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f9525,_0x4d2e00){var _0x1d2f17=a55_0x20a5,_0x25114b=_0x4f9525();while(!![]){try{var _0x2ec0e7=parseInt(_0x1d2f17(0x1bd))/0x1+parseInt(_0x1d2f17(0x1c4))/0x2*(parseInt(_0x1d2f17(0x1c6))/0x3)+parseInt(_0x1d2f17(0x1c5))/0x4*(parseInt(_0x1d2f17(0x1c0))/0x5)+parseInt(_0x1d2f17(0x1c1))/0x6+-parseInt(_0x1d2f17(0x1c3))/0x7*(-parseInt(_0x1d2f17(0x1bf))/0x8)+parseInt(_0x1d2f17(0x1c2))/0x9+-parseInt(_0x1d2f17(0x1be))/0xa;if(_0x2ec0e7===_0x4d2e00)break;else _0x25114b['push'](_0x25114b['shift']());}catch(_0x5ccd78){_0x25114b['push'](_0x25114b['shift']());}}}(a55_0x5b3a,0xbb773));function a55_0x5b3a(){var _0x39f182=['115DmAXPl','3207966xZOVhM','2967300ElYTpd','35OUdSwW','644834IhSkSo','229604sqRWvD','3eUqSNV','125410rbHsJg','20343870aYFyAT','271736UPJuDz'];a55_0x5b3a=function(){return _0x39f182;};return a55_0x5b3a();}export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';export*from'./sdk/client/td-api-client.js';export{TrinoApiClient}from'./sdk/client/trino-api-client.js';export*from'./sdk/client/rate-limiter.js';export*from'./sdk/types/trino.js';export*from'./commands/command.js';function a55_0x20a5(_0x316084,_0x44a9af){_0x316084=_0x316084-0x1bd;var _0x5b3abc=a55_0x5b3a();var _0x20a578=_0x5b3abc[_0x316084];return _0x20a578;}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';export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
|
package/dist/mcp/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4338aa,_0x4379bf){const _0x4469fc=a56_0x5c3f,_0x4ab575=_0x4338aa();while(!![]){try{const _0x13663e=-parseInt(_0x4469fc(0xee))/0x1+parseInt(_0x4469fc(0xf0))/0x2+-parseInt(_0x4469fc(0xe2))/0x3+-parseInt(_0x4469fc(0xf3))/0x4*(-parseInt(_0x4469fc(0xf7))/0x5)+-parseInt(_0x4469fc(0xf8))/0x6*(-parseInt(_0x4469fc(0xe7))/0x7)+-parseInt(_0x4469fc(0xe4))/0x8*(parseInt(_0x4469fc(0xff))/0x9)+parseInt(_0x4469fc(0xfe))/0xa*(parseInt(_0x4469fc(0x109))/0xb);if(_0x13663e===_0x4379bf)break;else _0x4ab575['push'](_0x4ab575['shift']());}catch(_0x50a604){_0x4ab575['push'](_0x4ab575['shift']());}}}(a56_0xac2e,0x6f955));function a56_0x5c3f(_0x46908f,_0x2e0baf){_0x46908f=_0x46908f-0xdc;const _0xac2eab=a56_0xac2e();let _0x5c3f1b=_0xac2eab[_0x46908f];return _0x5c3f1b;}function a56_0xac2e(){const _0x3b925e=['Data','error','105sMIHvF','length','tdx','output','1.0.0','once','connect','799432gMkQYb','**\x20(','1683940cqWIgH','Utilities','registerTool','292OJdIoA','close','CDP','category','54705iHJqvA','98034xAisjV','SIGTERM','Context','tdx_search','Command\x20failed','Command\x20completed\x20successfully','7620rGvNHs','1635111xhKWlb','join','string','name','env','No\x20commands\x20found\x20matching\x20\x22','tdx_run','optional','description','map','6281EyRUmb','enum','success','describe','Execute\x20any\x20tdx\x20CLI\x20command.\x20Returns\x20JSON\x20output.\x0a\x0aExamples:\x0a-\x20List\x20databases:\x20{\x22args\x22:\x20[\x22databases\x22]}\x0a-\x20Run\x20SQL\x20query:\x20{\x22args\x22:\x20[\x22query\x22,\x20\x22SELECT\x20*\x20FROM\x20mydb.users\x20LIMIT\x2010\x22]}\x0a-\x20List\x20segments:\x20{\x22args\x22:\x20[\x22segments\x22,\x20\x22--recursive\x22]}\x0a-\x20Show\x20job\x20details:\x20{\x22args\x22:\x20[\x22job\x22,\x20\x22show\x22,\x20\x2212345\x22]}\x0a-\x20List\x20tables:\x20{\x22args\x22:\x20[\x22tables\x22,\x20\x22mydb.*\x22]}\x0a\x0aNote:\x20Some\x20commands\x20(auth,\x20profile\x20management,\x20mcp)\x20are\x20blocked\x20for\x20security.','text','array','Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])','2103045BOHyXg','SIGINT','16AUMccQ'];a56_0xac2e=function(){return _0x3b925e;};return a56_0xac2e();}import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{z}from'zod';import{executeTdxRun,searchCommands}from'./tools/index.js';export function createMCPServer(_0x49a5ec={}){const _0x272b84=a56_0x5c3f,_0x21fed2=new McpServer({'name':_0x272b84(0xe9),'version':_0x272b84(0xeb)});return _0x21fed2[_0x272b84(0xf2)](_0x272b84(0x105),{'description':_0x272b84(0xde),'inputSchema':{'args':z[_0x272b84(0xe0)](z[_0x272b84(0x101)]())['describe'](_0x272b84(0xe1))}},async({args:_0x3cad74})=>{const _0x10143=_0x272b84,_0x4d8986=await executeTdxRun({'args':_0x3cad74},_0x49a5ec[_0x10143(0x103)]||{});return _0x4d8986[_0x10143(0xdc)]?{'content':[{'type':_0x10143(0xdf),'text':_0x4d8986[_0x10143(0xea)]||_0x10143(0xfd)}]}:{'content':[{'type':'text','text':_0x4d8986[_0x10143(0xe6)]||_0x4d8986[_0x10143(0xea)]||_0x10143(0xfc)}],'isError':!![]};}),_0x21fed2[_0x272b84(0xf2)](_0x272b84(0xfb),{'description':'Search\x20for\x20relevant\x20tdx\x20commands\x20based\x20on\x20what\x20you\x20want\x20to\x20do.\x0a\x0aExamples:\x0a-\x20{\x22query\x22:\x20\x22how\x20to\x20run\x20SQL\x20queries\x22}\x0a-\x20{\x22query\x22:\x20\x22list\x20databases\x20and\x20tables\x22}\x0a-\x20{\x22query\x22:\x20\x22manage\x20customer\x20segments\x22,\x20\x22category\x22:\x20\x22CDP\x22}\x0a-\x20{\x22query\x22:\x20\x22workflow\x20logs\x22}\x0a\x0aCategories:\x20Data,\x20CDP,\x20AI,\x20Context,\x20Utilities\x0a\x0aReturns\x20matching\x20commands\x20with\x20descriptions\x20and\x20example\x20usage.','inputSchema':{'query':z[_0x272b84(0x101)]()[_0x272b84(0xdd)]('Natural\x20language\x20query\x20(e.g.,\x20\x22list\x20databases\x22,\x20\x22run\x20SQL\x22,\x20\x22manage\x20segments\x22)'),'category':z[_0x272b84(0x10a)]([_0x272b84(0xe5),_0x272b84(0xf5),'AI',_0x272b84(0xfa),_0x272b84(0xf1)])[_0x272b84(0x106)]()['describe']('Optional\x20filter\x20by\x20category')}},async({query:_0x3e6e9a,category:_0x44b1a3})=>{const _0x1bb319=_0x272b84,_0x130f7b=searchCommands({'query':_0x3e6e9a,'category':_0x44b1a3});if(_0x130f7b[_0x1bb319(0xe8)]===0x0)return{'content':[{'type':_0x1bb319(0xdf),'text':_0x1bb319(0x104)+_0x3e6e9a+'\x22'}]};const _0x1d81e3=_0x130f7b[_0x1bb319(0x108)](_0x355716=>{const _0x965dc9=_0x1bb319,_0x10c188=_0x355716['examples'][_0x965dc9(0x108)](_0x81f9f3=>'\x20\x20'+_0x81f9f3)['join']('\x0a');return'**'+_0x355716[_0x965dc9(0x102)]+_0x965dc9(0xef)+_0x355716[_0x965dc9(0xf6)]+')\x0a'+_0x355716[_0x965dc9(0x107)]+'\x0a\x0aExamples:\x0a'+_0x10c188;})[_0x1bb319(0x100)]('\x0a\x0a---\x0a\x0a');return{'content':[{'type':_0x1bb319(0xdf),'text':_0x1d81e3}]};}),_0x21fed2;}export async function startMCPServer(_0x3dfc8b={}){const _0x11a3b4=a56_0x5c3f,_0x5ca33d=createMCPServer(_0x3dfc8b),_0x1905a5=new StdioServerTransport();return await _0x5ca33d[_0x11a3b4(0xed)](_0x1905a5),new Promise(_0x13b740=>{const _0x5d5b1c=_0x11a3b4;let _0x1f3579=![];const _0x4ba0f0=async()=>{const _0x5bd5d3=a56_0x5c3f;if(_0x1f3579)return;_0x1f3579=!![],await _0x5ca33d[_0x5bd5d3(0xf4)](),_0x13b740();};process['once'](_0x5d5b1c(0xe3),_0x4ba0f0),process[_0x5d5b1c(0xec)](_0x5d5b1c(0xf9),_0x4ba0f0),process['stdin'][_0x5d5b1c(0xec)](_0x5d5b1c(0xf4),_0x4ba0f0);});}
|
package/dist/mcp/tools/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x15d9b0,_0x581254){var _0x5f0e7c=a57_0x8d9d,_0x39f489=_0x15d9b0();while(!![]){try{var _0x4db750=-parseInt(_0x5f0e7c(0x1e7))/0x1*(parseInt(_0x5f0e7c(0x1ee))/0x2)+parseInt(_0x5f0e7c(0x1ed))/0x3+parseInt(_0x5f0e7c(0x1f0))/0x4*(parseInt(_0x5f0e7c(0x1eb))/0x5)+-parseInt(_0x5f0e7c(0x1ef))/0x6*(-parseInt(_0x5f0e7c(0x1ea))/0x7)+-parseInt(_0x5f0e7c(0x1e8))/0x8+-parseInt(_0x5f0e7c(0x1e9))/0x9+parseInt(_0x5f0e7c(0x1ec))/0xa;if(_0x4db750===_0x581254)break;else _0x39f489['push'](_0x39f489['shift']());}catch(_0xebcaeb){_0x39f489['push'](_0x39f489['shift']());}}}(a57_0x30e1,0x285f8));export{executeTdxRun,TdxRunInputSchema}from'./tdx-run.js';function a57_0x8d9d(_0x33107d,_0x5a5550){_0x33107d=_0x33107d-0x1e7;var _0x30e180=a57_0x30e1();var _0x8d9db3=_0x30e180[_0x33107d];return _0x8d9db3;}function a57_0x30e1(){var _0x36ed46=['2344550IpNgEI','199449mDxejL','2DKjlRl','204nRuHKL','483484qgIorK','93877duhNyI','952032qqpsrX','1832085RflqJU','8057alfekk','10bNmODz'];a57_0x30e1=function(){return _0x36ed46;};return a57_0x30e1();}export{searchCommands,TdxSearchInputSchema}from'./tdx-search.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a58_0x503056=a58_0x25d7;(function(_0x51591d,_0x537a80){const _0x162868=a58_0x25d7,_0x5a4f94=_0x51591d();while(!![]){try{const _0x292b3c=parseInt(_0x162868(0x181))/0x1*(-parseInt(_0x162868(0x186))/0x2)+-parseInt(_0x162868(0x18e))/0x3+parseInt(_0x162868(0x19a))/0x4*(-parseInt(_0x162868(0x195))/0x5)+-parseInt(_0x162868(0x190))/0x6+-parseInt(_0x162868(0x18a))/0x7+parseInt(_0x162868(0x187))/0x8*(parseInt(_0x162868(0x18c))/0x9)+parseInt(_0x162868(0x17f))/0xa;if(_0x292b3c===_0x537a80)break;else _0x5a4f94['push'](_0x5a4f94['shift']());}catch(_0x496161){_0x5a4f94['push'](_0x5a4f94['shift']());}}}(a58_0x4e46,0xe3211));function a58_0x4e46(){const _0x3b4ce8=['stdout','60693860OgsIed','stderr','1gMTkib','data','close','--no-color','Failed\x20to\x20spawn\x20tdx:\x20','1334070xKBuvR','464KrZmoq','message','error','11189360SLfeRA','Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])','189279HWkyER','toString','3375627qSFlqo','ignore','7381548PIRqaM','env','Command\x20timed\x20out\x20after\x2015\x20minutes.\x20For\x20long-running\x20queries,\x20use\x20job\x20submit\x20instead.','kill','pipe','5AkWiPH','array','--json','object','This\x20command\x20is\x20not\x20allowed\x20via\x20MCP','6951524gvXUXz'];a58_0x4e46=function(){return _0x3b4ce8;};return a58_0x4e46();}function a58_0x25d7(_0x324276,_0x2efab8){_0x324276=_0x324276-0x17f;const _0x4e46b3=a58_0x4e46();let _0x25d7f0=_0x4e46b3[_0x324276];return _0x25d7f0;}import{spawn}from'child_process';import{z}from'zod';import{isBlockedCommand,getBlockedReason,formatOutput}from'../utils.js';export const TdxRunInputSchema=z[a58_0x503056(0x198)]({'args':z[a58_0x503056(0x196)](z['string']())['describe'](a58_0x503056(0x18b))});const DEFAULT_TIMEOUT_MS=0xf*0x3c*0x3e8;export async function executeTdxRun(_0x36e512,_0x39a535){const _0x4467ed=a58_0x503056,{args:_0x16ebea}=_0x36e512;if(isBlockedCommand(_0x16ebea)){const _0x3b87d7=getBlockedReason(_0x16ebea);return{'success':![],'output':'','error':_0x3b87d7||_0x4467ed(0x199),'exitCode':0x1};}const _0x46485b=[_0x4467ed(0x197),_0x4467ed(0x184),..._0x16ebea];return new Promise(_0x3941a8=>{const _0x3fddaa=_0x4467ed,_0x58848a=spawn('tdx',_0x46485b,{'env':{...process[_0x3fddaa(0x191)],..._0x39a535,'CI':'true'},'stdio':[_0x3fddaa(0x18f),_0x3fddaa(0x194),_0x3fddaa(0x194)]});let _0x3e0cd8='',_0x138301='',_0x17a1bc=![];const _0x34b4ec=setTimeout(()=>{const _0x5e4359=_0x3fddaa;_0x17a1bc=!![],_0x58848a[_0x5e4359(0x193)]('SIGTERM');},DEFAULT_TIMEOUT_MS);_0x58848a[_0x3fddaa(0x19b)]['on'](_0x3fddaa(0x182),_0x492be5=>{const _0x4e0594=_0x3fddaa;_0x3e0cd8+=_0x492be5[_0x4e0594(0x18d)]();}),_0x58848a[_0x3fddaa(0x180)]['on'](_0x3fddaa(0x182),_0x1384df=>{const _0x4d1d03=_0x3fddaa;_0x138301+=_0x1384df[_0x4d1d03(0x18d)]();}),_0x58848a['on'](_0x3fddaa(0x189),_0x5b0a8b=>{const _0x5e1bc9=_0x3fddaa;clearTimeout(_0x34b4ec),_0x3941a8({'success':![],'output':'','error':_0x5e1bc9(0x185)+_0x5b0a8b[_0x5e1bc9(0x188)],'exitCode':0x1});}),_0x58848a['on'](_0x3fddaa(0x183),_0x5aed0b=>{const _0x11f87b=_0x3fddaa;clearTimeout(_0x34b4ec);if(_0x17a1bc){_0x3941a8({'success':![],'output':formatOutput(_0x3e0cd8),'error':_0x11f87b(0x192),'exitCode':0x7c});return;}const _0x2a6a90=_0x5aed0b??0x1,_0x5706a9=_0x2a6a90===0x0,_0x50fece=formatOutput(_0x3e0cd8||_0x138301),_0xbdb604=!_0x5706a9&&_0x138301?formatOutput(_0x138301):undefined;_0x3941a8({'success':_0x5706a9,'output':_0x50fece,'error':_0xbdb604,'exitCode':_0x2a6a90});});});}
|