@treasuredata/tdx 0.14.5 → 0.14.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/api-command.js +1 -1
  8. package/dist/commands/auth-command.js +1 -1
  9. package/dist/commands/chat-command.js +1 -1
  10. package/dist/commands/claude-command.d.ts +0 -4
  11. package/dist/commands/claude-command.d.ts.map +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-command.js.map +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/llm-proxy.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profile-command.js +1 -1
  28. package/dist/commands/profiles-command.js +1 -1
  29. package/dist/commands/query-command.js +1 -1
  30. package/dist/commands/segment-command.js +1 -1
  31. package/dist/commands/segment-create-command.js +1 -1
  32. package/dist/commands/segment-fields-command.js +1 -1
  33. package/dist/commands/segment-pull-command.js +1 -1
  34. package/dist/commands/segment-push-command.js +1 -1
  35. package/dist/commands/segment-update-command.js +1 -1
  36. package/dist/commands/segment-use-command.js +1 -1
  37. package/dist/commands/segment-validate-command.js +1 -1
  38. package/dist/commands/segments.js +1 -1
  39. package/dist/commands/show.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/proxy/anthropic-adapter.js +1 -1
  60. package/dist/proxy/claude-usage-tracker.js +1 -1
  61. package/dist/proxy/context-signature.js +1 -1
  62. package/dist/proxy/conversation-utils.js +1 -1
  63. package/dist/proxy/passthrough-server.js +1 -1
  64. package/dist/proxy/server.js +1 -1
  65. package/dist/proxy/session-cache.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/api.js +1 -1
  71. package/dist/sdk/client/cdp-api-client.js +1 -1
  72. package/dist/sdk/client/endpoints.js +1 -1
  73. package/dist/sdk/client/engage-api-client.js +1 -1
  74. package/dist/sdk/client/http-client.js +1 -1
  75. package/dist/sdk/client/llm-api-client.d.ts +3 -2
  76. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  77. package/dist/sdk/client/llm-api-client.js +1 -1
  78. package/dist/sdk/client/llm-api-client.js.map +1 -1
  79. package/dist/sdk/client/rate-limiter.js +1 -1
  80. package/dist/sdk/client/td-api-client.js +1 -1
  81. package/dist/sdk/client/trino-api-client.js +1 -1
  82. package/dist/sdk/client/workflow-client.js +1 -1
  83. package/dist/sdk/connection-validator.js +1 -1
  84. package/dist/sdk/connection.js +1 -1
  85. package/dist/sdk/engage.js +1 -1
  86. package/dist/sdk/errors.js +1 -1
  87. package/dist/sdk/index.js +1 -1
  88. package/dist/sdk/io/index.js +1 -1
  89. package/dist/sdk/io/node-filesystem.js +1 -1
  90. package/dist/sdk/job.js +1 -1
  91. package/dist/sdk/journey.js +1 -1
  92. package/dist/sdk/llm/chat-cache.js +1 -1
  93. package/dist/sdk/llm/index.js +1 -1
  94. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  95. package/dist/sdk/llm/model-aliases.js +1 -1
  96. package/dist/sdk/llm/model-factors.js +1 -1
  97. package/dist/sdk/query/index.js +1 -1
  98. package/dist/sdk/query/sql-parser.js +1 -1
  99. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  100. package/dist/sdk/segment/fields-display.js +1 -1
  101. package/dist/sdk/segment/file-discovery.js +1 -1
  102. package/dist/sdk/segment/journey-utils.js +1 -1
  103. package/dist/sdk/segment/journey-yaml.js +1 -1
  104. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  105. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  106. package/dist/sdk/segment/pull-workflow.js +1 -1
  107. package/dist/sdk/segment/push-workflow.js +1 -1
  108. package/dist/sdk/segment/resolution-context.js +1 -1
  109. package/dist/sdk/segment/segment-path-parser.js +1 -1
  110. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  111. package/dist/sdk/segment/target-resolution.js +1 -1
  112. package/dist/sdk/segment/tdx-config.js +1 -1
  113. package/dist/sdk/segment/validate-files.js +1 -1
  114. package/dist/sdk/segment/yaml-validator.js +1 -1
  115. package/dist/sdk/segment.js +1 -1
  116. package/dist/sdk/types/index.js +1 -1
  117. package/dist/sdk/types/progress.js +1 -1
  118. package/dist/sdk/user.js +1 -1
  119. package/dist/sdk/util/format-detector.js +1 -1
  120. package/dist/sdk/util/formatters.js +1 -1
  121. package/dist/sdk/util/index.js +1 -1
  122. package/dist/sdk/util/tree-formatter.js +1 -1
  123. package/dist/sdk/workflow/clone-workflow.js +1 -1
  124. package/dist/sdk/workflow/index.js +1 -1
  125. package/dist/sdk/workflow/pull-workflow.js +1 -1
  126. package/dist/sdk/workflow/push-workflow.js +1 -1
  127. package/dist/sdk/workflow/tdx-config.js +1 -1
  128. package/dist/sdk/workflow/workflow-utils.js +1 -1
  129. package/dist/utils/async.js +1 -1
  130. package/dist/utils/colors.js +1 -1
  131. package/dist/utils/diff.js +1 -1
  132. package/dist/utils/file-permissions.js +1 -1
  133. package/dist/utils/json-loader.js +1 -1
  134. package/dist/utils/option-validation.js +1 -1
  135. package/dist/utils/port.js +1 -1
  136. package/dist/utils/process.d.ts +21 -0
  137. package/dist/utils/process.d.ts.map +1 -1
  138. package/dist/utils/process.js +1 -1
  139. package/dist/utils/process.js.map +1 -1
  140. package/dist/utils/prompt.js +1 -1
  141. package/dist/utils/spinner.js +1 -1
  142. package/dist/utils/sse-parser.js +1 -1
  143. package/dist/utils/string-utils.js +1 -1
  144. package/dist/utils/table-ref-parser.js +1 -1
  145. package/dist/utils/tdx-logger.js +1 -1
  146. package/dist/utils/version-check.js +1 -1
  147. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x5b57a4,_0x5ee282){const _0x25b1d2=a42_0x5560,_0x38ec32=_0x5b57a4();while(!![]){try{const _0x153193=parseInt(_0x25b1d2(0x121))/0x1+-parseInt(_0x25b1d2(0x116))/0x2*(-parseInt(_0x25b1d2(0x139))/0x3)+-parseInt(_0x25b1d2(0xf7))/0x4+parseInt(_0x25b1d2(0x118))/0x5*(-parseInt(_0x25b1d2(0x125))/0x6)+-parseInt(_0x25b1d2(0x135))/0x7+-parseInt(_0x25b1d2(0x115))/0x8*(-parseInt(_0x25b1d2(0xf8))/0x9)+parseInt(_0x25b1d2(0x119))/0xa;if(_0x153193===_0x5ee282)break;else _0x38ec32['push'](_0x38ec32['shift']());}catch(_0x41e722){_0x38ec32['push'](_0x38ec32['shift']());}}}(a42_0x4908,0x99a31));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a42_0x4c9b8c from'node:fs';import*as a42_0x3c6ade 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 a42_0x446434 from'chalk';export function getConfigDir(){const _0x53d01b=a42_0x5560;return process[_0x53d01b(0xfe)][_0x53d01b(0xfb)]||join(homedir(),_0x53d01b(0x117),_0x53d01b(0xf4));}export function getConfigFile(){const _0xcc3fc=a42_0x5560;return join(getConfigDir(),_0xcc3fc(0x129));}export function getConfigFilePath(_0x1dd642){const _0x1a24cd=a42_0x5560,_0xaa8edb=getConfigDir();return _0x1dd642?a42_0x3c6ade[_0x1a24cd(0x126)](_0xaa8edb,'.env.'+_0x1dd642):getConfigFile();}export function getCacheDir(){const _0x38b816=a42_0x5560;return process[_0x38b816(0xfe)][_0x38b816(0x12f)]||join(homedir(),_0x38b816(0xf2),_0x38b816(0xf4));}export function getLLMProjectCacheFile(_0x387302){const _0xe5ff4b=a42_0x5560,_0x4a3bfd=_0x387302?'llm_default_project.'+_0x387302:_0xe5ff4b(0x10d);return join(getCacheDir(),_0x4a3bfd);}export function readCachedLLMProject(_0x241485){const _0x393a50=a42_0x5560;try{const _0x3465a1=getLLMProjectCacheFile(_0x241485);if(!existsSync(_0x3465a1))return null;const _0x12a5fc=readFileSync(_0x3465a1,_0x393a50(0x134))['trim']();try{const _0x4c181c=JSON[_0x393a50(0x101)](_0x12a5fc);if(_0x4c181c&&typeof _0x4c181c['id']===_0x393a50(0x111)&&typeof _0x4c181c[_0x393a50(0x130)]===_0x393a50(0x111))return _0x4c181c;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x335db6,_0x54092d,_0x3a542b){const _0x39bce0=a42_0x5560;try{const _0x1abdee=getCacheDir(),_0x23eef9=getLLMProjectCacheFile(_0x3a542b);!existsSync(_0x1abdee)&&mkdirSync(_0x1abdee,{'recursive':!![]});const _0x45008e={'name':_0x335db6,'id':_0x54092d};writeFileSync(_0x23eef9,JSON[_0x39bce0(0x110)](_0x45008e),_0x39bce0(0x134));}catch{}}export function getLLMAgentCacheFile(_0x50fbe3){const _0x4afc09=a42_0x5560,_0xa469ec=_0x50fbe3?_0x4afc09(0x109)+_0x50fbe3:_0x4afc09(0x112);return join(getCacheDir(),_0xa469ec);}export function readCachedLLMAgent(_0x4bb77c){const _0x963986=a42_0x5560;try{const _0x35aaf6=getLLMAgentCacheFile(_0x4bb77c);if(!existsSync(_0x35aaf6))return null;const _0x30a86a=readFileSync(_0x35aaf6,_0x963986(0x134))[_0x963986(0x107)]();try{const _0x5bef5c=JSON[_0x963986(0x101)](_0x30a86a);if(_0x5bef5c&&typeof _0x5bef5c['id']===_0x963986(0x111)&&typeof _0x5bef5c[_0x963986(0x130)]===_0x963986(0x111)&&typeof _0x5bef5c[_0x963986(0x10e)]===_0x963986(0x111))return _0x5bef5c;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x1c8a1a,_0x780dab,_0x4fea17,_0x239125){const _0x330329=a42_0x5560;try{const _0x1ae8b7=getCacheDir(),_0x3a3838=getLLMAgentCacheFile(_0x239125);!existsSync(_0x1ae8b7)&&mkdirSync(_0x1ae8b7,{'recursive':!![]});const _0x4213fb={'name':_0x1c8a1a,'id':_0x780dab,'projectId':_0x4fea17};writeFileSync(_0x3a3838,JSON[_0x330329(0x110)](_0x4213fb),'utf-8');}catch{}}export function clearCachedLLMAgent(_0xeac849){try{const _0x147e49=getLLMAgentCacheFile(_0xeac849);existsSync(_0x147e49)&&unlinkSync(_0x147e49);}catch{}}export function getAccountInfoCacheFile(_0x110a84){const _0x49b869=a42_0x5560,_0x2242bd=_0x110a84?_0x49b869(0x12a)+_0x110a84+_0x49b869(0xf9):_0x49b869(0x133);return join(getCacheDir(),_0x2242bd);}export function readCachedAccountInfo(_0x17a07f){const _0x1d1715=a42_0x5560;try{const _0xc092aa=getAccountInfoCacheFile(_0x17a07f);if(!existsSync(_0xc092aa))return null;const _0x163abb=readFileSync(_0xc092aa,_0x1d1715(0x134))[_0x1d1715(0x107)](),_0x581f2d=JSON[_0x1d1715(0x101)](_0x163abb);if(_0x581f2d&&typeof _0x581f2d[_0x1d1715(0xee)]==='string'&&typeof _0x581f2d[_0x1d1715(0x124)]===_0x1d1715(0xf1))return _0x581f2d;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x4e6732,_0x4ed079,_0x4050c9){const _0x174185=a42_0x5560;try{const _0x1d3467=getCacheDir(),_0x107503=getAccountInfoCacheFile(_0x4050c9);!existsSync(_0x1d3467)&&mkdirSync(_0x1d3467,{'recursive':!![]});const _0x301b4a={'site':_0x4e6732,'accountId':_0x4ed079,'cachedAt':new Date()[_0x174185(0x104)]()};writeFileSync(_0x107503,JSON[_0x174185(0x110)](_0x301b4a),_0x174185(0x134));}catch{}}export function parseEnvFile(_0x5a68c8){const _0x4c68cf=a42_0x5560,_0x379d49={};for(const _0xb3189b of _0x5a68c8['split']('\x0a')){const _0x4ca568=_0xb3189b[_0x4c68cf(0x107)]();if(!_0x4ca568||_0x4ca568[_0x4c68cf(0x132)]('#'))continue;const _0x2d22e0=_0x4ca568[_0x4c68cf(0x13d)](/^([^=]+)=(.*)$/);if(_0x2d22e0){const _0x2059ee=_0x2d22e0[0x1]['trim']();let _0x4b2788=_0x2d22e0[0x2][_0x4c68cf(0x107)]();(_0x4b2788['startsWith']('\x22')&&_0x4b2788[_0x4c68cf(0x127)]('\x22')||_0x4b2788[_0x4c68cf(0x132)]('\x27')&&_0x4b2788[_0x4c68cf(0x127)]('\x27'))&&(_0x4b2788=_0x4b2788[_0x4c68cf(0x100)](0x1,-0x1)),_0x379d49[_0x2059ee]=_0x4b2788;}}return _0x379d49;}export function readUserConfig(){const _0x76d4b0=a42_0x5560,_0x5e2c74=getConfigFile();if(!existsSync(_0x5e2c74))return{};try{const _0xab93e7=readFileSync(_0x5e2c74,_0x76d4b0(0x134));return parseEnvFile(_0xab93e7);}catch(_0x1d1ec9){return console[_0x76d4b0(0x138)](_0x76d4b0(0x10f)+_0x5e2c74+':',_0x1d1ec9),{};}}export function resolveSite(_0x2017a1){const _0x1f413b=a42_0x5560,_0x376f60=['us01',_0x1f413b(0x13c),_0x1f413b(0x120),_0x1f413b(0x11a),_0x1f413b(0x12c),_0x1f413b(0x123),_0x1f413b(0xff),_0x1f413b(0x13a),_0x1f413b(0x10a),_0x1f413b(0x10c)];if(_0x376f60[_0x1f413b(0x131)](_0x2017a1))return _0x2017a1;if(_0x2017a1 in SITE_ALIASES)return SITE_ALIASES[_0x2017a1];return console[_0x1f413b(0x138)]('Warning:\x20Unknown\x20site\x20\x27'+_0x2017a1+_0x1f413b(0x136)),_0x1f413b(0x106);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}function a42_0x4908(){const _0x14d5c4=['join','endsWith','legacy\x20.env\x20file\x20(profile:\x20','.env','account_info.','filter','ap03','profiles','readFileSync','TDX_CACHE_DIR','name','includes','startsWith','account_info.json','utf-8','4440254bmmabb','\x27,\x20defaulting\x20to\x20us01','yellow','warn','3TZZdPD','stg-us01','map','jp01','match','site','split','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','number','.cache','legacy\x20.env\x20file','tdx','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','Warning:\x20Failed\x20to\x20load\x20','512112zYgYRo','819WkTuRl','.json','keychain\x20(profile:\x20','TDX_CONFIG_DIR','profile','keychain','env','dev-eu01','slice','parse','Warning:\x20Failed\x20to\x20read\x20','entries','toISOString','tdx.json','us01','trim','replace','llm_default_agent.','stg-jp01','toUpperCase','stg-ap03','llm_default_project','projectId','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','stringify','string','llm_default_agent','isDeprecated','TD_API_KEY_','40856rJJGlI','875668NmoYKD','.config','35dFqdcH','12736050zIFugR','ap02','TD_API_KEY','existsSync','TDX_API_KEY','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','TDX_API_KEY_','eu01','391800KAvLNK','\x20env\x20var','dev-us01','accountId','1008282WmDVES'];a42_0x4908=function(){return _0x14d5c4;};return a42_0x4908();}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x33f530,_0x363f63){const _0x37ba65=a42_0x5560,_0x215f23=_0x363f63||getActiveProfileName();if(_0x215f23){const _0x4a3397=_0x37ba65(0x11f)+normalizeProfileForEnvVar(_0x215f23);if(process['env'][_0x4a3397])return process[_0x37ba65(0xfe)][_0x4a3397];}if(process[_0x37ba65(0xfe)][_0x37ba65(0x11d)])return process[_0x37ba65(0xfe)]['TDX_API_KEY'];if(process[_0x37ba65(0xfe)][_0x37ba65(0x11b)])return process[_0x37ba65(0xfe)]['TD_API_KEY'];const _0x4a712f=_0x33f530['toUpperCase']()[_0x37ba65(0x108)](/-/g,'_'),_0xb76728=_0x37ba65(0x114)+_0x4a712f;if(_0x215f23){const _0x1f48b1=loadProfileEnv(_0x215f23);if(_0x1f48b1){if(_0x1f48b1[_0xb76728])return _0x1f48b1[_0xb76728];if(_0x1f48b1[_0x37ba65(0x11b)])return _0x1f48b1[_0x37ba65(0x11b)];}}const _0x330499=loadUserConfigOnce();if(_0x330499[_0xb76728])return _0x330499[_0xb76728];if(_0x330499[_0x37ba65(0x11b)])return _0x330499['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x4b532b){const _0x5293ae=a42_0x5560;return _0x4b532b[_0x5293ae(0x10b)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x565d58,_0x1bb014){const _0x5d1f83=a42_0x5560,_0x499959=_0x1bb014||getActiveProfileName()||undefined;if(_0x499959){const _0x20c955='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x499959);if(process['env'][_0x20c955])return{'apiKey':process['env'][_0x20c955],'source':_0x20c955+_0x5d1f83(0x122),'isDeprecated':![]};const _0x675919=getCachedCredential(_0x565d58,_0x499959);if(_0x675919)return{'apiKey':_0x675919,'source':_0x5d1f83(0xfa)+_0x499959+')','isDeprecated':![]};const _0x47e091=await getKeychainAPIKey(_0x499959);if(_0x47e091)return setCachedCredential(_0x47e091,_0x565d58,_0x499959),{'apiKey':_0x47e091,'source':_0x5d1f83(0xfa)+_0x499959+')','isDeprecated':![]};}if(process['env'][_0x5d1f83(0x11d)])return{'apiKey':process[_0x5d1f83(0xfe)]['TDX_API_KEY'],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x499959){const _0x542079=getCachedCredential(_0x565d58,undefined);if(_0x542079)return{'apiKey':_0x542079,'source':_0x5d1f83(0xfd),'isDeprecated':![]};const _0x39b5ce=await getKeychainAPIKey(undefined);if(_0x39b5ce)return setCachedCredential(_0x39b5ce,_0x565d58,undefined),{'apiKey':_0x39b5ce,'source':_0x5d1f83(0xfd),'isDeprecated':![]};}if(process[_0x5d1f83(0xfe)][_0x5d1f83(0x11b)])return{'apiKey':process['env']['TD_API_KEY'],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x21e1b8=getLegacyEnvAPIKey(_0x565d58,_0x499959);if(_0x21e1b8){const _0x33d236=await isKeychainAvailable();if(_0x33d236)try{await saveKeychainAPIKey(_0x21e1b8,_0x499959),setCachedCredential(_0x21e1b8,_0x565d58,_0x499959);const _0x5e7c6d=getConfigFilePath(_0x499959);cleanupLegacyEnvFile(_0x5e7c6d)&&console['warn'](a42_0x446434['yellow']('⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage'));}catch(_0x3b99d1){console[_0x5d1f83(0x138)](a42_0x446434[_0x5d1f83(0x137)](_0x5d1f83(0xf0)+_0x3b99d1));}const _0x42585c=_0x499959?_0x5d1f83(0x128)+_0x499959+')':_0x5d1f83(0xf3);return{'apiKey':_0x21e1b8,'source':_0x42585c,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x537a05,_0x3b6ed9,_0x24e597=!![]){const _0x1577de=a42_0x5560,_0x21a270=await resolveAPIKeyAsync(_0x537a05,_0x3b6ed9);if(!_0x21a270)return undefined;if(_0x24e597&&_0x21a270[_0x1577de(0x113)]&&_0x21a270['source'][_0x1577de(0x131)](_0x1577de(0x11b))){const _0x1a0a68=_0x3b6ed9||getActiveProfileName()||undefined,_0x5ec623=_0x1a0a68?_0x1577de(0x11f)+normalizeProfileForEnvVar(_0x1a0a68):'TDX_API_KEY_<PROFILE>';console['warn'](a42_0x446434[_0x1577de(0x137)](_0x1577de(0xf5)+(_0x1577de(0x11e)+_0x5ec623+').')));}return _0x21a270['apiKey'];}function getLegacyEnvAPIKey(_0x21f173,_0x1ecb3c){const _0x4d1c82=a42_0x5560,_0x2622c2=_0x21f173['toUpperCase']()[_0x4d1c82(0x108)](/-/g,'_'),_0x2ab91b=_0x4d1c82(0x114)+_0x2622c2;if(_0x1ecb3c){const _0x4d4ba5=loadProfileEnv(_0x1ecb3c);if(_0x4d4ba5){if(_0x4d4ba5[_0x2ab91b])return _0x4d4ba5[_0x2ab91b];if(_0x4d4ba5[_0x4d1c82(0x11b)])return _0x4d4ba5[_0x4d1c82(0x11b)];}}const _0x41d761=loadUserConfigOnce();if(_0x41d761[_0x2ab91b])return _0x41d761[_0x2ab91b];if(_0x41d761[_0x4d1c82(0x11b)])return _0x41d761[_0x4d1c82(0x11b)];return undefined;}function cleanupLegacyEnvFile(_0x1807e1){const _0x1c5b0e=a42_0x5560;if(!existsSync(_0x1807e1))return![];try{const _0x53f90b=readFileSync(_0x1807e1,_0x1c5b0e(0x134)),_0x22e4c4=_0x53f90b[_0x1c5b0e(0xef)]('\x0a'),_0x682a96=_0x22e4c4[_0x1c5b0e(0x12b)](_0x292304=>{const _0x231d0e=_0x1c5b0e,_0x59a8e1=_0x292304[_0x231d0e(0x107)]();if(!_0x59a8e1||_0x59a8e1[_0x231d0e(0x132)]('#'))return!![];const [_0x1afd40]=_0x59a8e1[_0x231d0e(0xef)]('=');return!_0x1afd40[_0x231d0e(0x132)](_0x231d0e(0x11b));}),_0x5d3c7f=_0x682a96['some'](_0x1ef543=>{const _0x390ce7=_0x1c5b0e,_0x5536a5=_0x1ef543[_0x390ce7(0x107)]();return _0x5536a5&&!_0x5536a5['startsWith']('#');});if(!_0x5d3c7f)return unlinkSync(_0x1807e1),!![];return writeFileSync(_0x1807e1,_0x682a96['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x19f7f2){const _0x1750bb=a42_0x5560,_0x149d14=a42_0x3c6ade[_0x1750bb(0x126)](getConfigDir(),'.env.'+_0x19f7f2);if(a42_0x4c9b8c[_0x1750bb(0x11c)](_0x149d14)){validateSecureFilePermissions(_0x149d14);try{const _0x2eea89=a42_0x4c9b8c[_0x1750bb(0x12e)](_0x149d14,_0x1750bb(0x134));return parseEnvFile(_0x2eea89);}catch(_0x2acd64){console['warn'](_0x1750bb(0xf6)+_0x149d14+':\x20'+_0x2acd64);}}const _0x1197c9=a42_0x3c6ade[_0x1750bb(0x126)](getConfigDir(),_0x1750bb(0x12d),_0x19f7f2,'.env');if(a42_0x4c9b8c[_0x1750bb(0x11c)](_0x1197c9)){validateSecureFilePermissions(_0x1197c9);try{const _0x124116=a42_0x4c9b8c[_0x1750bb(0x12e)](_0x1197c9,'utf-8');return parseEnvFile(_0x124116);}catch(_0x428948){return console[_0x1750bb(0x138)](_0x1750bb(0xf6)+_0x1197c9+':\x20'+_0x428948),null;}}return null;}function getActiveProfileName(){const _0x443fda=a42_0x5560,_0x506a24=a42_0x3c6ade[_0x443fda(0x126)](getConfigDir(),_0x443fda(0x105));if(!a42_0x4c9b8c['existsSync'](_0x506a24))return null;try{const _0x82bcc7=a42_0x4c9b8c[_0x443fda(0x12e)](_0x506a24,'utf-8'),_0x271324=JSON['parse'](_0x82bcc7);return _0x271324[_0x443fda(0xfc)]||null;}catch{return null;}}function a42_0x5560(_0x89ff1d,_0x4cc73e){_0x89ff1d=_0x89ff1d-0xee;const _0x4908bc=a42_0x4908();let _0x556090=_0x4908bc[_0x89ff1d];return _0x556090;}export function saveAPIKey(_0x4c7f70,_0x1cf910,_0x212e0c){const _0x16dc4b=a42_0x5560,_0x4a618f=getConfigDir(),_0x18760b=getConfigFilePath(_0x212e0c);!existsSync(_0x4a618f)&&mkdirSync(_0x4a618f,{'recursive':!![],'mode':0x1c0});let _0x2a506e={};if(existsSync(_0x18760b))try{const _0x43d7b2=readFileSync(_0x18760b,'utf-8');_0x2a506e=parseEnvFile(_0x43d7b2);}catch(_0x52675c){console[_0x16dc4b(0x138)](_0x16dc4b(0x102)+_0x18760b+':',_0x52675c);}const _0x366292=_0x4c7f70[_0x16dc4b(0x10b)]()[_0x16dc4b(0x108)](/-/g,'_');_0x2a506e[_0x16dc4b(0x114)+_0x366292]=_0x1cf910;const _0x5d159d=Object[_0x16dc4b(0x103)](_0x2a506e)[_0x16dc4b(0x13b)](([_0x284486,_0x494849])=>_0x284486+'='+_0x494849);writeFileSync(_0x18760b,_0x5d159d[_0x16dc4b(0x126)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x128e17,_0x5ad490,_0x19e0a9){const _0x11d35d=a42_0x5560;await saveKeychainAPIKey(_0x128e17,_0x19e0a9),setCachedCredential(_0x128e17,_0x5ad490,_0x19e0a9);const _0x558455=getConfigFilePath(_0x19e0a9);cleanupLegacyEnvFile(_0x558455)&&console[_0x11d35d(0x138)](a42_0x446434[_0x11d35d(0x137)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x17eae8=a42_0x5560,_0x200a3b={'apiKeys':{},'defaultSite':_0x17eae8(0x106)},_0x230f4d=[_0x17eae8(0x106),_0x17eae8(0x13c),_0x17eae8(0x120),'ap02',_0x17eae8(0x12c),_0x17eae8(0x123),_0x17eae8(0xff),_0x17eae8(0x13a),'stg-jp01',_0x17eae8(0x10c)];for(const _0x55a6cf of _0x230f4d){const _0x415f4d=getAPIKey(_0x55a6cf);_0x415f4d&&(_0x200a3b['apiKeys'][_0x55a6cf]=_0x415f4d);}return _0x200a3b;}
1
+ (function(_0x395cd7,_0x290178){const _0x264827=a42_0xb962,_0x50a2c8=_0x395cd7();while(!![]){try{const _0x13e77b=-parseInt(_0x264827(0x1de))/0x1*(parseInt(_0x264827(0x1bb))/0x2)+parseInt(_0x264827(0x1db))/0x3*(-parseInt(_0x264827(0x1f0))/0x4)+parseInt(_0x264827(0x1e0))/0x5+parseInt(_0x264827(0x1b8))/0x6+-parseInt(_0x264827(0x1c0))/0x7+-parseInt(_0x264827(0x1dd))/0x8+parseInt(_0x264827(0x1c8))/0x9;if(_0x13e77b===_0x290178)break;else _0x50a2c8['push'](_0x50a2c8['shift']());}catch(_0x5aed3d){_0x50a2c8['push'](_0x50a2c8['shift']());}}}(a42_0x5cae,0xd2d39));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a42_0x5a132c from'node:fs';import*as a42_0x2a2137 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 a42_0xb962(_0x138edb,_0x180802){_0x138edb=_0x138edb-0x1a6;const _0x5cae81=a42_0x5cae();let _0xb962ac=_0x5cae81[_0x138edb];return _0xb962ac;}import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a42_0x36fb2b from'chalk';export function getConfigDir(){const _0x5c37db=a42_0xb962;return process[_0x5c37db(0x1e6)][_0x5c37db(0x1bd)]||join(homedir(),_0x5c37db(0x1da),'tdx');}export function getConfigFile(){const _0x33ba56=a42_0xb962;return join(getConfigDir(),_0x33ba56(0x1be));}export function getConfigFilePath(_0x1db889){const _0x44afd5=a42_0xb962,_0x1d8860=getConfigDir();return _0x1db889?a42_0x2a2137[_0x44afd5(0x1dc)](_0x1d8860,_0x44afd5(0x1a9)+_0x1db889):getConfigFile();}export function getCacheDir(){const _0x401b0a=a42_0xb962;return process[_0x401b0a(0x1e6)][_0x401b0a(0x1ef)]||join(homedir(),'.cache',_0x401b0a(0x1ec));}export function getLLMProjectCacheFile(_0x520362){const _0x5634ce=a42_0xb962,_0x17af98=_0x520362?_0x5634ce(0x1a8)+_0x520362:_0x5634ce(0x1c4);return join(getCacheDir(),_0x17af98);}export function readCachedLLMProject(_0x2a6085){const _0x4e497c=a42_0xb962;try{const _0x74a197=getLLMProjectCacheFile(_0x2a6085);if(!existsSync(_0x74a197))return null;const _0x566559=readFileSync(_0x74a197,_0x4e497c(0x1c3))[_0x4e497c(0x1ee)]();try{const _0x40bf4e=JSON[_0x4e497c(0x1eb)](_0x566559);if(_0x40bf4e&&typeof _0x40bf4e['id']==='string'&&typeof _0x40bf4e['name']==='string')return _0x40bf4e;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x583246,_0x5b8d9f,_0x4c1936){const _0x3f5aaa=a42_0xb962;try{const _0x52bd47=getCacheDir(),_0x19ef10=getLLMProjectCacheFile(_0x4c1936);!existsSync(_0x52bd47)&&mkdirSync(_0x52bd47,{'recursive':!![]});const _0x5e965c={'name':_0x583246,'id':_0x5b8d9f};writeFileSync(_0x19ef10,JSON['stringify'](_0x5e965c),_0x3f5aaa(0x1c3));}catch{}}export function getLLMAgentCacheFile(_0x560e18){const _0x405bfd=a42_0xb962,_0x33edd7=_0x560e18?_0x405bfd(0x1c7)+_0x560e18:_0x405bfd(0x1b1);return join(getCacheDir(),_0x33edd7);}export function readCachedLLMAgent(_0x522311){const _0x520ecc=a42_0xb962;try{const _0x531ed6=getLLMAgentCacheFile(_0x522311);if(!existsSync(_0x531ed6))return null;const _0x1f6228=readFileSync(_0x531ed6,_0x520ecc(0x1c3))[_0x520ecc(0x1ee)]();try{const _0x290b1b=JSON['parse'](_0x1f6228);if(_0x290b1b&&typeof _0x290b1b['id']===_0x520ecc(0x1aa)&&typeof _0x290b1b[_0x520ecc(0x1e1)]===_0x520ecc(0x1aa)&&typeof _0x290b1b['projectId']==='string')return _0x290b1b;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x122e19,_0xcc1a85,_0x126410,_0x159856){const _0x42a9ad=a42_0xb962;try{const _0x541e62=getCacheDir(),_0x1296b5=getLLMAgentCacheFile(_0x159856);!existsSync(_0x541e62)&&mkdirSync(_0x541e62,{'recursive':!![]});const _0x282696={'name':_0x122e19,'id':_0xcc1a85,'projectId':_0x126410};writeFileSync(_0x1296b5,JSON[_0x42a9ad(0x1f1)](_0x282696),_0x42a9ad(0x1c3));}catch{}}export function clearCachedLLMAgent(_0x37c19a){try{const _0x49cfa8=getLLMAgentCacheFile(_0x37c19a);existsSync(_0x49cfa8)&&unlinkSync(_0x49cfa8);}catch{}}export function getAccountInfoCacheFile(_0x4144f9){const _0x36f824=a42_0xb962,_0xec1ec7=_0x4144f9?_0x36f824(0x1d9)+_0x4144f9+_0x36f824(0x1c9):'account_info.json';return join(getCacheDir(),_0xec1ec7);}export function readCachedAccountInfo(_0x52aec2){const _0x81f4cc=a42_0xb962;try{const _0x2bc181=getAccountInfoCacheFile(_0x52aec2);if(!existsSync(_0x2bc181))return null;const _0x4f2971=readFileSync(_0x2bc181,_0x81f4cc(0x1c3))[_0x81f4cc(0x1ee)](),_0x32557d=JSON[_0x81f4cc(0x1eb)](_0x4f2971);if(_0x32557d&&typeof _0x32557d['site']===_0x81f4cc(0x1aa)&&typeof _0x32557d[_0x81f4cc(0x1df)]===_0x81f4cc(0x1e8))return _0x32557d;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x2709f0,_0x3211c0,_0x24c4ef){const _0x9e22c3=a42_0xb962;try{const _0x206c7b=getCacheDir(),_0x2d4565=getAccountInfoCacheFile(_0x24c4ef);!existsSync(_0x206c7b)&&mkdirSync(_0x206c7b,{'recursive':!![]});const _0x32352c={'site':_0x2709f0,'accountId':_0x3211c0,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x2d4565,JSON[_0x9e22c3(0x1f1)](_0x32352c),_0x9e22c3(0x1c3));}catch{}}function a42_0x5cae(){const _0x5085b0=['apiKeys','TDX_CONFIG_DIR','.env','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','3369632bMyLQs','slice','Warning:\x20Failed\x20to\x20load\x20','utf-8','llm_default_project','replace','ap02','llm_default_agent.','12617397achJmg','.json','profile','tdx.json','split','existsSync','\x27,\x20defaulting\x20to\x20us01','map','stg-ap03','dev-us01','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','legacy\x20.env\x20file','includes','keychain','Warning:\x20Failed\x20to\x20read\x20','TDX_API_KEY','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','account_info.','.config','532509DMXJnJ','join','4092872QhnFDW','39cFRwFi','accountId','3953480bZJwNw','name','\x20env\x20var','toUpperCase','stg-us01','endsWith','env','entries','number','startsWith','Warning:\x20Unknown\x20site\x20\x27','parse','tdx','TD_API_KEY\x20env\x20var\x20(deprecated)','trim','TDX_CACHE_DIR','16JBCTjY','stringify','TD_API_KEY','TDX_API_KEY_','dev-eu01','llm_default_project.','.env.','string','some','ap03','TD_API_KEY_','match','filter','eu01','llm_default_agent','readFileSync','us01','jp01','warn','profiles','stg-jp01','7629456cuTfhS','keychain\x20(profile:\x20','yellow','46034tpQgoc'];a42_0x5cae=function(){return _0x5085b0;};return a42_0x5cae();}export function parseEnvFile(_0x30cfdd){const _0x53f12a=a42_0xb962,_0xd39e39={};for(const _0x5f3676 of _0x30cfdd[_0x53f12a(0x1cc)]('\x0a')){const _0x3026f6=_0x5f3676['trim']();if(!_0x3026f6||_0x3026f6[_0x53f12a(0x1e9)]('#'))continue;const _0x154812=_0x3026f6[_0x53f12a(0x1ae)](/^([^=]+)=(.*)$/);if(_0x154812){const _0x4e680c=_0x154812[0x1][_0x53f12a(0x1ee)]();let _0x35b1cf=_0x154812[0x2]['trim']();(_0x35b1cf[_0x53f12a(0x1e9)]('\x22')&&_0x35b1cf[_0x53f12a(0x1e5)]('\x22')||_0x35b1cf[_0x53f12a(0x1e9)]('\x27')&&_0x35b1cf[_0x53f12a(0x1e5)]('\x27'))&&(_0x35b1cf=_0x35b1cf[_0x53f12a(0x1c1)](0x1,-0x1)),_0xd39e39[_0x4e680c]=_0x35b1cf;}}return _0xd39e39;}export function readUserConfig(){const _0x5e9eaa=a42_0xb962,_0x40fe8e=getConfigFile();if(!existsSync(_0x40fe8e))return{};try{const _0x28ed32=readFileSync(_0x40fe8e,_0x5e9eaa(0x1c3));return parseEnvFile(_0x28ed32);}catch(_0x2eeffc){return console[_0x5e9eaa(0x1b5)](_0x5e9eaa(0x1bf)+_0x40fe8e+':',_0x2eeffc),{};}}export function resolveSite(_0x3edfe9){const _0x103de6=a42_0xb962,_0x5e3b95=[_0x103de6(0x1b3),_0x103de6(0x1b4),'eu01',_0x103de6(0x1c6),_0x103de6(0x1ac),_0x103de6(0x1d1),_0x103de6(0x1a7),_0x103de6(0x1e4),_0x103de6(0x1b7),'stg-ap03'];if(_0x5e3b95[_0x103de6(0x1d4)](_0x3edfe9))return _0x3edfe9;if(_0x3edfe9 in SITE_ALIASES)return SITE_ALIASES[_0x3edfe9];return console[_0x103de6(0x1b5)](_0x103de6(0x1ea)+_0x3edfe9+_0x103de6(0x1ce)),_0x103de6(0x1b3);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x4d277c,_0x34928a){const _0xeeb8fb=a42_0xb962,_0x3a7304=_0x34928a||getActiveProfileName();if(_0x3a7304){const _0xa05c5=_0xeeb8fb(0x1a6)+normalizeProfileForEnvVar(_0x3a7304);if(process[_0xeeb8fb(0x1e6)][_0xa05c5])return process[_0xeeb8fb(0x1e6)][_0xa05c5];}if(process[_0xeeb8fb(0x1e6)][_0xeeb8fb(0x1d7)])return process['env'][_0xeeb8fb(0x1d7)];if(process[_0xeeb8fb(0x1e6)][_0xeeb8fb(0x1f2)])return process[_0xeeb8fb(0x1e6)][_0xeeb8fb(0x1f2)];const _0x5d976f=_0x4d277c[_0xeeb8fb(0x1e3)]()[_0xeeb8fb(0x1c5)](/-/g,'_'),_0x44dc46='TD_API_KEY_'+_0x5d976f;if(_0x3a7304){const _0x4e68a6=loadProfileEnv(_0x3a7304);if(_0x4e68a6){if(_0x4e68a6[_0x44dc46])return _0x4e68a6[_0x44dc46];if(_0x4e68a6['TD_API_KEY'])return _0x4e68a6[_0xeeb8fb(0x1f2)];}}const _0x2bc255=loadUserConfigOnce();if(_0x2bc255[_0x44dc46])return _0x2bc255[_0x44dc46];if(_0x2bc255[_0xeeb8fb(0x1f2)])return _0x2bc255[_0xeeb8fb(0x1f2)];return undefined;}export function normalizeProfileForEnvVar(_0x4bbdd4){const _0x1fa923=a42_0xb962;return _0x4bbdd4[_0x1fa923(0x1e3)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x275e94,_0x2b462d){const _0x1d1cb4=a42_0xb962,_0xe80172=_0x2b462d||getActiveProfileName()||undefined;if(_0xe80172){const _0x32f5e8=_0x1d1cb4(0x1a6)+normalizeProfileForEnvVar(_0xe80172);if(process['env'][_0x32f5e8])return{'apiKey':process[_0x1d1cb4(0x1e6)][_0x32f5e8],'source':_0x32f5e8+_0x1d1cb4(0x1e2),'isDeprecated':![]};const _0x1c677d=getCachedCredential(_0x275e94,_0xe80172);if(_0x1c677d)return{'apiKey':_0x1c677d,'source':_0x1d1cb4(0x1b9)+_0xe80172+')','isDeprecated':![]};const _0x4fb0ba=await getKeychainAPIKey(_0xe80172);if(_0x4fb0ba)return setCachedCredential(_0x4fb0ba,_0x275e94,_0xe80172),{'apiKey':_0x4fb0ba,'source':_0x1d1cb4(0x1b9)+_0xe80172+')','isDeprecated':![]};}if(process[_0x1d1cb4(0x1e6)]['TDX_API_KEY'])return{'apiKey':process['env']['TDX_API_KEY'],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0xe80172){const _0x581d39=getCachedCredential(_0x275e94,undefined);if(_0x581d39)return{'apiKey':_0x581d39,'source':_0x1d1cb4(0x1d5),'isDeprecated':![]};const _0x4e9f46=await getKeychainAPIKey(undefined);if(_0x4e9f46)return setCachedCredential(_0x4e9f46,_0x275e94,undefined),{'apiKey':_0x4e9f46,'source':_0x1d1cb4(0x1d5),'isDeprecated':![]};}if(process[_0x1d1cb4(0x1e6)]['TD_API_KEY'])return{'apiKey':process['env'][_0x1d1cb4(0x1f2)],'source':_0x1d1cb4(0x1ed),'isDeprecated':!![]};const _0x2c7a3e=getLegacyEnvAPIKey(_0x275e94,_0xe80172);if(_0x2c7a3e){const _0x19d6f9=await isKeychainAvailable();if(_0x19d6f9)try{await saveKeychainAPIKey(_0x2c7a3e,_0xe80172),setCachedCredential(_0x2c7a3e,_0x275e94,_0xe80172);const _0x543c1b=getConfigFilePath(_0xe80172);cleanupLegacyEnvFile(_0x543c1b)&&console[_0x1d1cb4(0x1b5)](a42_0x36fb2b[_0x1d1cb4(0x1ba)](_0x1d1cb4(0x1d2)));}catch(_0x3346fa){console[_0x1d1cb4(0x1b5)](a42_0x36fb2b[_0x1d1cb4(0x1ba)](_0x1d1cb4(0x1d8)+_0x3346fa));}const _0x7ae629=_0xe80172?'legacy\x20.env\x20file\x20(profile:\x20'+_0xe80172+')':_0x1d1cb4(0x1d3);return{'apiKey':_0x2c7a3e,'source':_0x7ae629,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x190837,_0x81ba97,_0x5956f3=!![]){const _0x585b31=a42_0xb962,_0x27872d=await resolveAPIKeyAsync(_0x190837,_0x81ba97);if(!_0x27872d)return undefined;if(_0x5956f3&&_0x27872d['isDeprecated']&&_0x27872d['source'][_0x585b31(0x1d4)](_0x585b31(0x1f2))){const _0x226ec6=_0x81ba97||getActiveProfileName()||undefined,_0x5a5324=_0x226ec6?_0x585b31(0x1a6)+normalizeProfileForEnvVar(_0x226ec6):'TDX_API_KEY_<PROFILE>';console['warn'](a42_0x36fb2b[_0x585b31(0x1ba)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x5a5324+').')));}return _0x27872d['apiKey'];}function getLegacyEnvAPIKey(_0x1c5c29,_0x514403){const _0x45600e=a42_0xb962,_0x182bdd=_0x1c5c29[_0x45600e(0x1e3)]()[_0x45600e(0x1c5)](/-/g,'_'),_0x369260=_0x45600e(0x1ad)+_0x182bdd;if(_0x514403){const _0x1f8ad0=loadProfileEnv(_0x514403);if(_0x1f8ad0){if(_0x1f8ad0[_0x369260])return _0x1f8ad0[_0x369260];if(_0x1f8ad0[_0x45600e(0x1f2)])return _0x1f8ad0[_0x45600e(0x1f2)];}}const _0x34a0a4=loadUserConfigOnce();if(_0x34a0a4[_0x369260])return _0x34a0a4[_0x369260];if(_0x34a0a4[_0x45600e(0x1f2)])return _0x34a0a4[_0x45600e(0x1f2)];return undefined;}function cleanupLegacyEnvFile(_0x59514a){const _0x3f0cb7=a42_0xb962;if(!existsSync(_0x59514a))return![];try{const _0x405908=readFileSync(_0x59514a,'utf-8'),_0x17c12c=_0x405908['split']('\x0a'),_0x5a2aee=_0x17c12c[_0x3f0cb7(0x1af)](_0xcd3834=>{const _0x3c4a94=_0x3f0cb7,_0x3f3d09=_0xcd3834[_0x3c4a94(0x1ee)]();if(!_0x3f3d09||_0x3f3d09[_0x3c4a94(0x1e9)]('#'))return!![];const [_0x3d3d10]=_0x3f3d09[_0x3c4a94(0x1cc)]('=');return!_0x3d3d10['startsWith'](_0x3c4a94(0x1f2));}),_0x64c2a8=_0x5a2aee[_0x3f0cb7(0x1ab)](_0x4987d9=>{const _0x3e83ee=_0x3f0cb7,_0x2eb09f=_0x4987d9[_0x3e83ee(0x1ee)]();return _0x2eb09f&&!_0x2eb09f[_0x3e83ee(0x1e9)]('#');});if(!_0x64c2a8)return unlinkSync(_0x59514a),!![];return writeFileSync(_0x59514a,_0x5a2aee[_0x3f0cb7(0x1dc)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x1e4735){const _0x152127=a42_0xb962,_0x232f6c=a42_0x2a2137['join'](getConfigDir(),'.env.'+_0x1e4735);if(a42_0x5a132c[_0x152127(0x1cd)](_0x232f6c)){validateSecureFilePermissions(_0x232f6c);try{const _0x4e2a15=a42_0x5a132c['readFileSync'](_0x232f6c,'utf-8');return parseEnvFile(_0x4e2a15);}catch(_0x22c453){console[_0x152127(0x1b5)](_0x152127(0x1c2)+_0x232f6c+':\x20'+_0x22c453);}}const _0x15fa6b=a42_0x2a2137[_0x152127(0x1dc)](getConfigDir(),_0x152127(0x1b6),_0x1e4735,_0x152127(0x1be));if(a42_0x5a132c[_0x152127(0x1cd)](_0x15fa6b)){validateSecureFilePermissions(_0x15fa6b);try{const _0x29e275=a42_0x5a132c[_0x152127(0x1b2)](_0x15fa6b,_0x152127(0x1c3));return parseEnvFile(_0x29e275);}catch(_0x41b1ac){return console[_0x152127(0x1b5)](_0x152127(0x1c2)+_0x15fa6b+':\x20'+_0x41b1ac),null;}}return null;}function getActiveProfileName(){const _0x7e1199=a42_0xb962,_0x38cc3d=a42_0x2a2137[_0x7e1199(0x1dc)](getConfigDir(),_0x7e1199(0x1cb));if(!a42_0x5a132c[_0x7e1199(0x1cd)](_0x38cc3d))return null;try{const _0x50cc26=a42_0x5a132c['readFileSync'](_0x38cc3d,_0x7e1199(0x1c3)),_0x2bbc3b=JSON['parse'](_0x50cc26);return _0x2bbc3b[_0x7e1199(0x1ca)]||null;}catch{return null;}}export function saveAPIKey(_0x420217,_0xb223c,_0x1f73e8){const _0xd55280=a42_0xb962,_0x15a4e8=getConfigDir(),_0x54cb05=getConfigFilePath(_0x1f73e8);!existsSync(_0x15a4e8)&&mkdirSync(_0x15a4e8,{'recursive':!![],'mode':0x1c0});let _0x24854b={};if(existsSync(_0x54cb05))try{const _0x31230b=readFileSync(_0x54cb05,_0xd55280(0x1c3));_0x24854b=parseEnvFile(_0x31230b);}catch(_0x339ebe){console[_0xd55280(0x1b5)](_0xd55280(0x1d6)+_0x54cb05+':',_0x339ebe);}const _0x3508ae=_0x420217['toUpperCase']()[_0xd55280(0x1c5)](/-/g,'_');_0x24854b['TD_API_KEY_'+_0x3508ae]=_0xb223c;const _0x4331a=Object[_0xd55280(0x1e7)](_0x24854b)[_0xd55280(0x1cf)](([_0x455e1d,_0x3653d5])=>_0x455e1d+'='+_0x3653d5);writeFileSync(_0x54cb05,_0x4331a[_0xd55280(0x1dc)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x55360e,_0x50a1de,_0x389c19){const _0x2bad61=a42_0xb962;await saveKeychainAPIKey(_0x55360e,_0x389c19),setCachedCredential(_0x55360e,_0x50a1de,_0x389c19);const _0x1416d1=getConfigFilePath(_0x389c19);cleanupLegacyEnvFile(_0x1416d1)&&console[_0x2bad61(0x1b5)](a42_0x36fb2b[_0x2bad61(0x1ba)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x114b58=a42_0xb962,_0x4dc9d4={'apiKeys':{},'defaultSite':_0x114b58(0x1b3)},_0x388941=[_0x114b58(0x1b3),_0x114b58(0x1b4),_0x114b58(0x1b0),_0x114b58(0x1c6),'ap03','dev-us01','dev-eu01','stg-us01',_0x114b58(0x1b7),_0x114b58(0x1d0)];for(const _0x590b0a of _0x388941){const _0x13b49a=getAPIKey(_0x590b0a);_0x13b49a&&(_0x4dc9d4[_0x114b58(0x1bc)][_0x590b0a]=_0x13b49a);}return _0x4dc9d4;}
@@ -1 +1 @@
1
- (function(_0x5d5dbf,_0x3fa04c){const _0x20eb05=a43_0x44d9,_0x2c9b93=_0x5d5dbf();while(!![]){try{const _0x30504e=-parseInt(_0x20eb05(0xd7))/0x1*(-parseInt(_0x20eb05(0xd9))/0x2)+parseInt(_0x20eb05(0xd6))/0x3+parseInt(_0x20eb05(0xdc))/0x4+-parseInt(_0x20eb05(0xe2))/0x5+-parseInt(_0x20eb05(0xe3))/0x6*(-parseInt(_0x20eb05(0xd4))/0x7)+parseInt(_0x20eb05(0xdb))/0x8+-parseInt(_0x20eb05(0xd8))/0x9*(parseInt(_0x20eb05(0xe4))/0xa);if(_0x30504e===_0x3fa04c)break;else _0x2c9b93['push'](_0x2c9b93['shift']());}catch(_0x3b9122){_0x2c9b93['push'](_0x2c9b93['shift']());}}}(a43_0x198a,0x8d213));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';function a43_0x44d9(_0x43fb91,_0x5dfad6){_0x43fb91=_0x43fb91-0xd4;const _0x198adf=a43_0x198a();let _0x44d9d0=_0x198adf[_0x43fb91];return _0x44d9d0;}import{join}from'path';function a43_0x198a(){const _0x13f067=['3276092nCfbga','parse','default','connections','stringify','connections-','3825995FIlHin','30OQoyKa','10IxduNL','.json','1536227KLlnyA','now','1007667LHuaRZ','19kDTTDX','16139979mChiDF','75770ieQtPF','utf-8','1316520lRWkVS'];a43_0x198a=function(){return _0x13f067;};return a43_0x198a();}import{getCacheDir}from'./config.js';function getCacheFilePath(_0xbf2d1b){const _0x40a9ce=a43_0x44d9,_0x4c244a=_0xbf2d1b||_0x40a9ce(0xde);return join(getCacheDir(),_0x40a9ce(0xe1)+_0x4c244a+_0x40a9ce(0xe5));}export function loadCachedConnections(_0x4557b4){const _0x3df059=a43_0x44d9,_0x4e9fee=getCacheFilePath(_0x4557b4);if(!existsSync(_0x4e9fee))return null;try{const _0x21fe71=readFileSync(_0x4e9fee,_0x3df059(0xda)),_0x1fb05e=JSON[_0x3df059(0xdd)](_0x21fe71);return _0x1fb05e[_0x3df059(0xdf)];}catch{return null;}}export function saveCachedConnections(_0x5038d4,_0xf287a4){const _0xb83b13=a43_0x44d9,_0x47b867=getCacheDir();!existsSync(_0x47b867)&&mkdirSync(_0x47b867,{'recursive':!![]});const _0x4003b7=getCacheFilePath(_0x5038d4),_0x1c4ebc={'connections':_0xf287a4,'cachedAt':Date[_0xb83b13(0xd5)]()};writeFileSync(_0x4003b7,JSON[_0xb83b13(0xe0)](_0x1c4ebc,null,0x2),'utf-8');}export function clearConnectionCache(_0x50d22e){const _0x1d7d07=getCacheFilePath(_0x50d22e);if(existsSync(_0x1d7d07))try{unlinkSync(_0x1d7d07);}catch{}}
1
+ function a43_0x42d9(_0x4230a5,_0x3f1369){_0x4230a5=_0x4230a5-0xe0;const _0x15276=a43_0x1527();let _0x42d9e8=_0x15276[_0x4230a5];return _0x42d9e8;}(function(_0x470bb9,_0x13e500){const _0x1bd93f=a43_0x42d9,_0x31a822=_0x470bb9();while(!![]){try{const _0x214568=-parseInt(_0x1bd93f(0xed))/0x1*(-parseInt(_0x1bd93f(0xe9))/0x2)+parseInt(_0x1bd93f(0xe8))/0x3+parseInt(_0x1bd93f(0xe4))/0x4+-parseInt(_0x1bd93f(0xea))/0x5*(-parseInt(_0x1bd93f(0xe5))/0x6)+-parseInt(_0x1bd93f(0xe6))/0x7*(parseInt(_0x1bd93f(0xee))/0x8)+parseInt(_0x1bd93f(0xe3))/0x9+-parseInt(_0x1bd93f(0xe1))/0xa;if(_0x214568===_0x13e500)break;else _0x31a822['push'](_0x31a822['shift']());}catch(_0x3450e3){_0x31a822['push'](_0x31a822['shift']());}}}(a43_0x1527,0x3bb8f));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';function a43_0x1527(){const _0x5881e7=['connections','default','14599390JAJItA','connections-','1903428JnKfeE','1838624AbPDDM','14418UbyuMd','462007LADNWI','parse','1307697dFszBS','282tvKNWh','445FRvNpR','stringify','utf-8','3189pgFVDW','8tRAumb','.json','now'];a43_0x1527=function(){return _0x5881e7;};return a43_0x1527();}import{getCacheDir}from'./config.js';function getCacheFilePath(_0x5d1c3e){const _0x27cc2f=a43_0x42d9,_0x3a6276=_0x5d1c3e||_0x27cc2f(0xe0);return join(getCacheDir(),_0x27cc2f(0xe2)+_0x3a6276+_0x27cc2f(0xef));}export function loadCachedConnections(_0x195f51){const _0x262a12=a43_0x42d9,_0x5a48e8=getCacheFilePath(_0x195f51);if(!existsSync(_0x5a48e8))return null;try{const _0x373ecd=readFileSync(_0x5a48e8,_0x262a12(0xec)),_0x44975b=JSON[_0x262a12(0xe7)](_0x373ecd);return _0x44975b[_0x262a12(0xf1)];}catch{return null;}}export function saveCachedConnections(_0x3b6548,_0x5d4a61){const _0x231c84=a43_0x42d9,_0x520e41=getCacheDir();!existsSync(_0x520e41)&&mkdirSync(_0x520e41,{'recursive':!![]});const _0x104e0d=getCacheFilePath(_0x3b6548),_0x217adb={'connections':_0x5d4a61,'cachedAt':Date[_0x231c84(0xf0)]()};writeFileSync(_0x104e0d,JSON[_0x231c84(0xeb)](_0x217adb,null,0x2),_0x231c84(0xec));}export function clearConnectionCache(_0x44736d){const _0x27ad6b=getCacheFilePath(_0x44736d);if(existsSync(_0x27ad6b))try{unlinkSync(_0x27ad6b);}catch{}}
@@ -1 +1 @@
1
- (function(_0x541d85,_0x19a4b2){const _0x12dd20=a44_0x4cef,_0x3d7165=_0x541d85();while(!![]){try{const _0x32d04b=-parseInt(_0x12dd20(0x13c))/0x1*(-parseInt(_0x12dd20(0x144))/0x2)+parseInt(_0x12dd20(0x143))/0x3*(-parseInt(_0x12dd20(0x13a))/0x4)+parseInt(_0x12dd20(0x13f))/0x5*(-parseInt(_0x12dd20(0x139))/0x6)+-parseInt(_0x12dd20(0x13b))/0x7*(-parseInt(_0x12dd20(0x141))/0x8)+-parseInt(_0x12dd20(0x142))/0x9+parseInt(_0x12dd20(0x13d))/0xa+parseInt(_0x12dd20(0x138))/0xb*(parseInt(_0x12dd20(0x13e))/0xc);if(_0x32d04b===_0x19a4b2)break;else _0x3d7165['push'](_0x3d7165['shift']());}catch(_0x10941c){_0x3d7165['push'](_0x3d7165['shift']());}}}(a44_0x1743,0xea5d6));function a44_0x1743(){const _0x1ebd0d=['644VAKhUS','120833gogUSk','1586270obahWs','36sHxBMz','545rSjDTW','number','148792BxCtMI','5378094hBaBtR','12423elLJAh','10nesxJN','593197dKsfoe','18318KhvWiI','720qZWYjE'];a44_0x1743=function(){return _0x1ebd0d;};return a44_0x1743();}export const DEFAULT_DISPLAY_LIMIT=0x28;function a44_0x4cef(_0x21a976,_0xd415c9){_0x21a976=_0x21a976-0x138;const _0x1743a7=a44_0x1743();let _0x4cef73=_0x1743a7[_0x21a976];return _0x4cef73;}export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x249864,_0x142ea3){const _0x409922=a44_0x4cef;if(_0x249864===undefined)return _0x142ea3;if(typeof _0x249864===_0x409922(0x140))return _0x249864;return parseInt(_0x249864,0xa);}
1
+ function a44_0x20cb(){const _0x299e9d=['76535gdZWlT','number','39780dCqUOp','57NFLdPd','138KJjPIH','991136oyTYXL','350570ArwmwU','750376JExaFa','8477739WoNqqT','613494tJFMyI'];a44_0x20cb=function(){return _0x299e9d;};return a44_0x20cb();}(function(_0x2f8f26,_0x53697a){const _0x1da167=a44_0x4c42,_0x7bf4e8=_0x2f8f26();while(!![]){try{const _0xfc99e1=-parseInt(_0x1da167(0xb4))/0x1+-parseInt(_0x1da167(0xb0))/0x2*(parseInt(_0x1da167(0xb1))/0x3)+-parseInt(_0x1da167(0xb3))/0x4+-parseInt(_0x1da167(0xae))/0x5*(-parseInt(_0x1da167(0xb2))/0x6)+parseInt(_0x1da167(0xad))/0x7+-parseInt(_0x1da167(0xb5))/0x8+parseInt(_0x1da167(0xac))/0x9;if(_0xfc99e1===_0x53697a)break;else _0x7bf4e8['push'](_0x7bf4e8['shift']());}catch(_0x11234c){_0x7bf4e8['push'](_0x7bf4e8['shift']());}}}(a44_0x20cb,0x4c13d));function a44_0x4c42(_0x410d4d,_0x5e9f24){_0x410d4d=_0x410d4d-0xac;const _0x20cbdf=a44_0x20cb();let _0x4c42e1=_0x20cbdf[_0x410d4d];return _0x4c42e1;}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0xc75e05,_0x8a81d4){const _0x2559e0=a44_0x4c42;if(_0xc75e05===undefined)return _0x8a81d4;if(typeof _0xc75e05===_0x2559e0(0xaf))return _0xc75e05;return parseInt(_0xc75e05,0xa);}
@@ -1 +1 @@
1
- function a45_0x4273(_0x505c1f,_0x252ff0){_0x505c1f=_0x505c1f-0xd5;const _0x147286=a45_0x1472();let _0x4273eb=_0x147286[_0x505c1f];return _0x4273eb;}(function(_0x4dd4ab,_0x261d01){const _0x313c04=a45_0x4273,_0x28ccf9=_0x4dd4ab();while(!![]){try{const _0x2589bf=-parseInt(_0x313c04(0xdf))/0x1*(-parseInt(_0x313c04(0xe3))/0x2)+parseInt(_0x313c04(0xe2))/0x3+-parseInt(_0x313c04(0xd5))/0x4+parseInt(_0x313c04(0xdd))/0x5+-parseInt(_0x313c04(0xdb))/0x6*(-parseInt(_0x313c04(0xd7))/0x7)+parseInt(_0x313c04(0xe4))/0x8*(parseInt(_0x313c04(0xd8))/0x9)+-parseInt(_0x313c04(0xd6))/0xa;if(_0x2589bf===_0x261d01)break;else _0x28ccf9['push'](_0x28ccf9['shift']());}catch(_0x28c25a){_0x28ccf9['push'](_0x28ccf9['shift']());}}}(a45_0x1472,0xde748));function a45_0x1472(){const _0x2b85c1=['1HTlxBg','__default_profile__','loadedAt','2230359qIzTXW','2094668UGxGSn','347752fIzVpA','delete','apiKey','set','4072592wiQGrh','20326430YFqIjo','1015084KNSYIY','333VEtEYb','now','get','18ZIwngH','__default_site__','638955fCIREP','clear'];a45_0x1472=function(){return _0x2b85c1;};return a45_0x1472();}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0xdc4912,_0xb1730a){const _0x4fef61=a45_0x4273,_0x11d8e9=_0xdc4912||_0x4fef61(0xdc),_0x3eae02=_0xb1730a||_0x4fef61(0xe0);return _0x11d8e9+':'+_0x3eae02;}export function getCachedCredential(_0x632428,_0x44443d){const _0x34f029=a45_0x4273,_0x3d2183=getCacheKey(_0x632428,_0x44443d),_0x184226=cache[_0x34f029(0xda)](_0x3d2183);if(!_0x184226)return null;if(Date[_0x34f029(0xd9)]()-_0x184226[_0x34f029(0xe1)]>CACHE_TTL_MS)return cache['delete'](_0x3d2183),null;return _0x184226[_0x34f029(0xe6)];}export function setCachedCredential(_0x4d003b,_0x46d0a3,_0x26fad3){const _0x13cb32=a45_0x4273,_0x2b034e=getCacheKey(_0x46d0a3,_0x26fad3);cache[_0x13cb32(0xe7)](_0x2b034e,{'apiKey':_0x4d003b,'loadedAt':Date[_0x13cb32(0xd9)]()});}export function clearCredentialCache(){const _0x130004=a45_0x4273;cache[_0x130004(0xde)]();}export function clearCachedCredential(_0x15d04c,_0x408821){const _0x10fab3=a45_0x4273,_0x2dd2c2=getCacheKey(_0x15d04c,_0x408821);cache[_0x10fab3(0xe5)](_0x2dd2c2);}
1
+ (function(_0x3769fa,_0x2250e1){const _0x47ec7c=a45_0x48ef,_0x4185a6=_0x3769fa();while(!![]){try{const _0x200853=-parseInt(_0x47ec7c(0xb4))/0x1*(parseInt(_0x47ec7c(0xb2))/0x2)+-parseInt(_0x47ec7c(0xa6))/0x3*(-parseInt(_0x47ec7c(0xa9))/0x4)+-parseInt(_0x47ec7c(0xb7))/0x5+-parseInt(_0x47ec7c(0xad))/0x6*(-parseInt(_0x47ec7c(0xb8))/0x7)+-parseInt(_0x47ec7c(0xaa))/0x8*(-parseInt(_0x47ec7c(0xa7))/0x9)+-parseInt(_0x47ec7c(0xac))/0xa*(-parseInt(_0x47ec7c(0xb5))/0xb)+-parseInt(_0x47ec7c(0xab))/0xc;if(_0x200853===_0x2250e1)break;else _0x4185a6['push'](_0x4185a6['shift']());}catch(_0x4939c0){_0x4185a6['push'](_0x4185a6['shift']());}}}(a45_0x4bf5,0x196eb));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a45_0x4bf5(){const _0x3b2882=['115208cJBQZS','2053968fmsCmD','3710JfEXNF','6wfbdFj','loadedAt','clear','get','now','7124pNymzM','set','17IyjUav','2277mdeVPR','delete','201635NkQzLC','654514qpfDWJ','apiKey','19863vmGcor','108rvwqkJ','__default_profile__','20MjASGW'];a45_0x4bf5=function(){return _0x3b2882;};return a45_0x4bf5();}function getCacheKey(_0x24aed1,_0x9fa14f){const _0x49b342=a45_0x48ef,_0x176e69=_0x24aed1||'__default_site__',_0x3c98e4=_0x9fa14f||_0x49b342(0xa8);return _0x176e69+':'+_0x3c98e4;}export function getCachedCredential(_0x10a52e,_0x3557d3){const _0x273cd3=a45_0x48ef,_0xb5fc2c=getCacheKey(_0x10a52e,_0x3557d3),_0x12a430=cache[_0x273cd3(0xb0)](_0xb5fc2c);if(!_0x12a430)return null;if(Date['now']()-_0x12a430[_0x273cd3(0xae)]>CACHE_TTL_MS)return cache['delete'](_0xb5fc2c),null;return _0x12a430[_0x273cd3(0xa5)];}function a45_0x48ef(_0x35bd86,_0x7678e5){_0x35bd86=_0x35bd86-0xa5;const _0x4bf5ba=a45_0x4bf5();let _0x48ef71=_0x4bf5ba[_0x35bd86];return _0x48ef71;}export function setCachedCredential(_0x6c9f83,_0x56ac83,_0x10d860){const _0xeeee5f=a45_0x48ef,_0x4b14ba=getCacheKey(_0x56ac83,_0x10d860);cache[_0xeeee5f(0xb3)](_0x4b14ba,{'apiKey':_0x6c9f83,'loadedAt':Date[_0xeeee5f(0xb1)]()});}export function clearCredentialCache(){const _0x277a6c=a45_0x48ef;cache[_0x277a6c(0xaf)]();}export function clearCachedCredential(_0x4b02dd,_0x1a8baa){const _0x14b814=a45_0x48ef,_0x416104=getCacheKey(_0x4b02dd,_0x1a8baa);cache[_0x14b814(0xb6)](_0x416104);}
@@ -1 +1 @@
1
- const a46_0x2e2551=a46_0x2383;function a46_0x2383(_0x435aab,_0x148e21){_0x435aab=_0x435aab-0x176;const _0x29a9b9=a46_0x29a9();let _0x238360=_0x29a9b9[_0x435aab];return _0x238360;}(function(_0x2c0845,_0x54f428){const _0x3ab672=a46_0x2383,_0x11c95c=_0x2c0845();while(!![]){try{const _0x362e06=-parseInt(_0x3ab672(0x19e))/0x1*(-parseInt(_0x3ab672(0x1b9))/0x2)+-parseInt(_0x3ab672(0x17a))/0x3+parseInt(_0x3ab672(0x1c0))/0x4*(parseInt(_0x3ab672(0x1a0))/0x5)+-parseInt(_0x3ab672(0x178))/0x6*(-parseInt(_0x3ab672(0x17c))/0x7)+-parseInt(_0x3ab672(0x17d))/0x8*(-parseInt(_0x3ab672(0x1b6))/0x9)+-parseInt(_0x3ab672(0x1af))/0xa*(parseInt(_0x3ab672(0x1a8))/0xb)+-parseInt(_0x3ab672(0x1b5))/0xc*(parseInt(_0x3ab672(0x1b0))/0xd);if(_0x362e06===_0x54f428)break;else _0x11c95c['push'](_0x11c95c['shift']());}catch(_0x300c3a){_0x11c95c['push'](_0x11c95c['shift']());}}}(a46_0x29a9,0x4aa24));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';function a46_0x29a9(){const _0x3ad39b=['662705sTsOdM','utf-8','segmentPath','cliFlags','\x0a[configuration\x20files]','parentSegment','layers','injectIntoOptions','11891bZpTSQ','getParameters','sessionId','workflow_project','sessions','llmAgent','resolveAPIKeyAsync','2630tAEPUw','39WyKnwG','loadGlobalConfig','profile','parent_segment',':\x20none','157860UMhjXr','27KfhXbO','(session:\x20','log','2YMeyoD','config','workflowProject','createAsync','join','Profile\x20Credentials','replace','4xISRdh','activeProfile','Project','TDX_SITE','Session','42996gmdEmF','llm_project','1597551ArwwPM','globalCredentials','182lbfbIE','1236120ATRvXL','display','tdx.json','profiles','llm_agent','Global','llmProject','readFileSync','global','Global\x20Credentials','site','verbose','displayWithSources','default','logLevel','env','session','apiKey','segment_path','.json','project','existsSync','CLI\x20flag:\x20--','not\x20set','toString','profileCredentials',':\x20none\x20(using\x20session:\x20','database','configFiles','us01','string','.env','[context]','379583SSDNsl','assign'];a46_0x29a9=function(){return _0x3ad39b;};return a46_0x29a9();}import*as a46_0x447b2a from'node:fs';import*as a46_0x47147f from'node:path';export class GlobalContext{[a46_0x2e2551(0x187)];[a46_0x2e2551(0x198)];[a46_0x2e2551(0x1b3)];['segment_path'];[a46_0x2e2551(0x179)];[a46_0x2e2551(0x181)];[a46_0x2e2551(0x1ab)];[a46_0x2e2551(0x18e)];[a46_0x2e2551(0x188)];['logLevel'];[a46_0x2e2551(0x1b2)];[a46_0x2e2551(0x1a6)];[a46_0x2e2551(0x1c1)];[a46_0x2e2551(0x1aa)];['configFiles'];constructor(_0x62c9bc){const _0x201581=a46_0x2e2551;this[_0x201581(0x1aa)]=_0x62c9bc[_0x201581(0x18d)]||getCurrentSessionPID()[_0x201581(0x195)]();const _0x2f41c8=loadSessionContext(_0x62c9bc[_0x201581(0x18d)]),_0xf5fc72=loadProjectConfig(),_0x527e7f=this['loadGlobalConfig']();this[_0x201581(0x1c1)]=_0x62c9bc[_0x201581(0x1b2)]||_0x2f41c8?.[_0x201581(0x1b2)]||_0x527e7f['profile']||getActiveProfile();const _0x273ae9=this[_0x201581(0x1c1)]?loadProfile(this[_0x201581(0x1c1)]):null,_0x30a209=_0x28b4f5=>{const _0x1e8d07=_0x201581;if(!_0x28b4f5)return{};const _0x32e8d8=_0x28b4f5,_0x561ea6={};for(const [_0x576fda,_0x149d3d]of Object['entries'](_0x32e8d8)){typeof _0x149d3d===_0x1e8d07(0x19b)&&(_0x561ea6[_0x576fda]=_0x149d3d);}return _0x561ea6;},_0x744e9b={};if(_0x62c9bc['site']&&_0x62c9bc['site']!==_0x201581(0x19a))_0x744e9b[_0x201581(0x187)]=_0x62c9bc[_0x201581(0x187)];const _0x2e2a7f=_0x2f41c8?.[_0x201581(0x198)],_0x2bd45e=_0xf5fc72?.[_0x201581(0x198)],_0xba5fdc=_0x273ae9?.[_0x201581(0x1ba)]?.[_0x201581(0x198)],_0x282977=_0x527e7f[_0x201581(0x198)];_0x62c9bc[_0x201581(0x198)]&&(_0x62c9bc[_0x201581(0x198)]!==_0x2e2a7f&&_0x62c9bc['database']!==_0x2bd45e&&_0x62c9bc[_0x201581(0x198)]!==_0xba5fdc&&_0x62c9bc[_0x201581(0x198)]!==_0x282977)&&(_0x744e9b[_0x201581(0x198)]=_0x62c9bc[_0x201581(0x198)]);if(_0x62c9bc[_0x201581(0x1a5)])_0x744e9b['parent_segment']=_0x62c9bc[_0x201581(0x1a5)];if(_0x62c9bc[_0x201581(0x183)])_0x744e9b['llm_project']=_0x62c9bc[_0x201581(0x183)];if(_0x62c9bc[_0x201581(0x1ad)])_0x744e9b[_0x201581(0x181)]=_0x62c9bc[_0x201581(0x1ad)];if(_0x62c9bc[_0x201581(0x1b2)])_0x744e9b[_0x201581(0x1b2)]=_0x62c9bc[_0x201581(0x1b2)];this[_0x201581(0x1a6)]={'cliFlags':_0x744e9b,'session':_0x30a209(_0x2f41c8),'project':_0x30a209(_0xf5fc72),'profile':_0x30a209(_0x273ae9?.['config']),'global':_0x30a209(_0x527e7f)};const _0x1edd23={...this['layers'][_0x201581(0x185)],...this['layers'][_0x201581(0x1b2)],...this[_0x201581(0x1a6)][_0x201581(0x191)]};process[_0x201581(0x18c)][_0x201581(0x176)]&&!this[_0x201581(0x1a6)][_0x201581(0x18d)][_0x201581(0x187)]&&!this[_0x201581(0x1a6)]['cliFlags']['site']&&(_0x1edd23[_0x201581(0x187)]=process[_0x201581(0x18c)][_0x201581(0x176)]);Object[_0x201581(0x19f)](_0x1edd23,this['layers'][_0x201581(0x18d)]),Object[_0x201581(0x19f)](_0x1edd23,this[_0x201581(0x1a6)]['cliFlags']);const _0x122a7d=_0x1edd23[_0x201581(0x187)]||'us01';this[_0x201581(0x187)]=resolveSite(_0x122a7d),this[_0x201581(0x198)]=_0x1edd23[_0x201581(0x198)],this[_0x201581(0x1b3)]=_0x1edd23[_0x201581(0x1b3)],this[_0x201581(0x18f)]=_0x1edd23[_0x201581(0x18f)],this[_0x201581(0x179)]=_0x1edd23['llm_project'],this[_0x201581(0x181)]=_0x1edd23[_0x201581(0x181)],this[_0x201581(0x1ab)]=_0x1edd23[_0x201581(0x1ab)],this[_0x201581(0x188)]=_0x62c9bc[_0x201581(0x188)]||![],this[_0x201581(0x18b)]=_0x62c9bc[_0x201581(0x18b)]??LogLevel['INFO'],this[_0x201581(0x1b2)]=this['activeProfile']||undefined,this[_0x201581(0x18e)]=getAPIKey(this['site'],this[_0x201581(0x1c1)]||undefined);const _0x1a329f=getConfigDir(),_0x8ce7f6=a46_0x47147f['join'](_0x1a329f,_0x201581(0x1ac),this[_0x201581(0x1aa)]+_0x201581(0x190)),_0x2e8bd4=findProjectConfigPath(),_0x1341d4=a46_0x47147f[_0x201581(0x1bd)](_0x1a329f,_0x201581(0x17f)),_0x198bb3=a46_0x47147f['join'](_0x1a329f,_0x201581(0x19c));let _0x97d3cc=null,_0x262034=null;this[_0x201581(0x1c1)]&&(_0x97d3cc=a46_0x47147f[_0x201581(0x1bd)](_0x1a329f,_0x201581(0x180),this[_0x201581(0x1c1)],_0x201581(0x17f)),_0x262034=a46_0x47147f[_0x201581(0x1bd)](_0x1a329f,'profiles',this['activeProfile'],_0x201581(0x19c))),this[_0x201581(0x199)]={'session':a46_0x447b2a[_0x201581(0x192)](_0x8ce7f6)?_0x8ce7f6:null,'project':_0x2e8bd4,'profile':_0x97d3cc&&a46_0x447b2a[_0x201581(0x192)](_0x97d3cc)?_0x97d3cc:null,'profileCredentials':_0x262034&&a46_0x447b2a[_0x201581(0x192)](_0x262034)?_0x262034:null,'global':a46_0x447b2a[_0x201581(0x192)](_0x1341d4)?_0x1341d4:null,'globalCredentials':a46_0x447b2a['existsSync'](_0x198bb3)?_0x198bb3:null};}['getSource'](_0x512866,_0x307c9c){const _0x26526f=a46_0x2e2551;if(!_0x307c9c)return _0x26526f(0x194);const _0x2bf40e=_0x307c9c;if(this[_0x26526f(0x1a6)][_0x26526f(0x1a3)][_0x512866]===_0x2bf40e){if(_0x512866==='site'&&_0x2bf40e==='us01'&&!this[_0x26526f(0x1a6)]['session'][_0x26526f(0x187)]&&!this['layers']['project'][_0x26526f(0x187)]&&!this['layers'][_0x26526f(0x1b2)][_0x26526f(0x187)]&&!this[_0x26526f(0x1a6)]['global'][_0x26526f(0x187)])return _0x26526f(0x18a);return _0x26526f(0x193)+_0x512866[_0x26526f(0x1bf)](/_/g,'-');}if(this[_0x26526f(0x1a6)][_0x26526f(0x18d)][_0x512866]===_0x2bf40e)return'session';if(this[_0x26526f(0x1a6)][_0x26526f(0x191)][_0x512866]===_0x2bf40e)return _0x26526f(0x191);if(this[_0x26526f(0x1a6)]['profile'][_0x512866]===_0x2bf40e)return'profile:\x20'+this[_0x26526f(0x1c1)];if(this[_0x26526f(0x1a6)]['global'][_0x512866]===_0x2bf40e)return _0x26526f(0x185);return _0x26526f(0x18a);}[a46_0x2e2551(0x1b1)](){const _0x377027=a46_0x2e2551,_0x4dece9=a46_0x47147f[_0x377027(0x1bd)](getConfigDir(),_0x377027(0x17f));if(!a46_0x447b2a['existsSync'](_0x4dece9))return{};try{const _0x4038a1=a46_0x447b2a[_0x377027(0x184)](_0x4dece9,_0x377027(0x1a1));return JSON['parse'](_0x4038a1);}catch{return{};}}[a46_0x2e2551(0x1a7)](_0x1a715c){const _0x4119df=a46_0x2e2551;_0x1a715c[_0x4119df(0x187)]=this[_0x4119df(0x187)],!_0x1a715c[_0x4119df(0x198)]&&this['database']&&(_0x1a715c['database']=this[_0x4119df(0x198)]),!_0x1a715c[_0x4119df(0x1a5)]&&this[_0x4119df(0x1b3)]&&(_0x1a715c[_0x4119df(0x1a5)]=this[_0x4119df(0x1b3)]),!_0x1a715c[_0x4119df(0x1a2)]&&this[_0x4119df(0x18f)]&&(_0x1a715c['segmentPath']=this[_0x4119df(0x18f)]),!_0x1a715c[_0x4119df(0x183)]&&this[_0x4119df(0x179)]&&(_0x1a715c[_0x4119df(0x183)]=this['llm_project']),!_0x1a715c[_0x4119df(0x1ad)]&&this[_0x4119df(0x181)]&&(_0x1a715c[_0x4119df(0x1ad)]=this[_0x4119df(0x181)]),!_0x1a715c[_0x4119df(0x1bb)]&&this[_0x4119df(0x1ab)]&&(_0x1a715c[_0x4119df(0x1bb)]=this['workflow_project']);}['getParameters'](){const _0x1365ba=a46_0x2e2551;return[{'key':_0x1365ba(0x187),'value':this[_0x1365ba(0x187)]},{'key':_0x1365ba(0x198),'value':this[_0x1365ba(0x198)]},{'key':_0x1365ba(0x1b3),'value':this[_0x1365ba(0x1b3)]},{'key':_0x1365ba(0x18f),'value':this[_0x1365ba(0x18f)]},{'key':_0x1365ba(0x179),'value':this[_0x1365ba(0x179)]},{'key':_0x1365ba(0x181),'value':this[_0x1365ba(0x181)]},{'key':_0x1365ba(0x1ab),'value':this[_0x1365ba(0x1ab)]},{'key':_0x1365ba(0x1b2),'value':this['activeProfile']||undefined}];}[a46_0x2e2551(0x17e)](){const _0x182b8e=a46_0x2e2551;console['log'](_0x182b8e(0x19d));for(const {key:_0x192b2e,value:_0x180f7a}of this[_0x182b8e(0x1a9)]()){_0x180f7a&&console[_0x182b8e(0x1b8)](_0x192b2e+':\x20'+_0x180f7a);}}[a46_0x2e2551(0x189)](){const _0x32d5bc=a46_0x2e2551;console['log'](_0x32d5bc(0x19d));for(const {key:_0x219808,value:_0x361e55}of this[_0x32d5bc(0x1a9)]()){if(_0x361e55){const _0x499c9d=_0x219808===_0x32d5bc(0x1b2)?'(active)':'('+this['getSource'](_0x219808,_0x361e55)+')';console['log'](_0x219808+':\x20'+_0x361e55+'\x20'+_0x499c9d);}}console[_0x32d5bc(0x1b8)](_0x32d5bc(0x1a4));const _0x39ac4e=[{'label':'Session','path':this[_0x32d5bc(0x199)]['session'],'extra':_0x32d5bc(0x1b7)+this[_0x32d5bc(0x1aa)]+')'},{'label':_0x32d5bc(0x1c2),'path':this[_0x32d5bc(0x199)][_0x32d5bc(0x191)]},{'label':'Profile','path':this[_0x32d5bc(0x199)]['profile']},{'label':_0x32d5bc(0x1be),'path':this[_0x32d5bc(0x199)][_0x32d5bc(0x196)]},{'label':_0x32d5bc(0x182),'path':this['configFiles'][_0x32d5bc(0x185)]},{'label':_0x32d5bc(0x186),'path':this[_0x32d5bc(0x199)][_0x32d5bc(0x17b)]}];for(const {label:_0x4ad0b2,path:_0x12fe82,extra:_0x40209d}of _0x39ac4e){if(_0x12fe82)console[_0x32d5bc(0x1b8)](_0x4ad0b2+':\x20'+_0x12fe82+'\x20✓'+(_0x40209d?'\x20'+_0x40209d:''));else{if(_0x4ad0b2===_0x32d5bc(0x177))console['log'](_0x4ad0b2+_0x32d5bc(0x197)+this['sessionId']+')');else(_0x4ad0b2==='Project'||_0x4ad0b2===_0x32d5bc(0x182))&&console[_0x32d5bc(0x1b8)](_0x4ad0b2+_0x32d5bc(0x1b4));}}}async['resolveAPIKeyAsync'](){const _0x3bcc48=a46_0x2e2551;return this['apiKey']=await getAPIKeyAsync(this['site'],this[_0x3bcc48(0x1c1)]||undefined),this['apiKey'];}static async[a46_0x2e2551(0x1bc)](_0x3e6053){const _0x5fc3ff=a46_0x2e2551,_0x21aec7=new GlobalContext(_0x3e6053);return await _0x21aec7[_0x5fc3ff(0x1ae)](),_0x21aec7;}}
1
+ const a46_0x5c727a=a46_0x451d;(function(_0x271603,_0x35d075){const _0x59bf20=a46_0x451d,_0x39ad35=_0x271603();while(!![]){try{const _0x377b30=-parseInt(_0x59bf20(0x1f1))/0x1*(-parseInt(_0x59bf20(0x223))/0x2)+-parseInt(_0x59bf20(0x22c))/0x3+-parseInt(_0x59bf20(0x1eb))/0x4*(-parseInt(_0x59bf20(0x1fe))/0x5)+parseInt(_0x59bf20(0x211))/0x6+parseInt(_0x59bf20(0x1f8))/0x7*(parseInt(_0x59bf20(0x1f9))/0x8)+-parseInt(_0x59bf20(0x20a))/0x9*(parseInt(_0x59bf20(0x224))/0xa)+-parseInt(_0x59bf20(0x21d))/0xb;if(_0x377b30===_0x35d075)break;else _0x39ad35['push'](_0x39ad35['shift']());}catch(_0xf5fe3e){_0x39ad35['push'](_0x39ad35['shift']());}}}(a46_0x8366,0x4f0db));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a46_0x8366(){const _0x46a593=['9vWGldT','existsSync','llmAgent','workflowProject','createAsync','CLI\x20flag:\x20--','getParameters','1534086GMeeOc','assign','toString','getSource','llm_project','globalCredentials','global','configFiles','llmProject','Profile','display','(session:\x20','3870317JhGWWs','readFileSync','tdx.json','site','segment_path','env','2IEuUrY','1701190YvTkey','workflow_project','layers','utf-8','Profile\x20Credentials','profiles','database','log','775338mmChJG','Project','.json','parentSegment','profile','.env','4TdXxXc','cliFlags','entries','injectIntoOptions','Global\x20Credentials','activeProfile','48681rRmElU','[context]','join','segmentPath','\x0a[configuration\x20files]','sessions','logLevel','7294zacvsh','2456RHHMgB','verbose','Global','llm_agent','string','2399795KnKTBJ','loadGlobalConfig','apiKey','replace','us01','sessionId','config','session','profile:\x20','resolveAPIKeyAsync','parent_segment','project'];a46_0x8366=function(){return _0x46a593;};return a46_0x8366();}import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';function a46_0x451d(_0x568fa7,_0x4fa258){_0x568fa7=_0x568fa7-0x1e9;const _0x83669=a46_0x8366();let _0x451deb=_0x83669[_0x568fa7];return _0x451deb;}import*as a46_0x2d292b from'node:fs';import*as a46_0x3709d8 from'node:path';export class GlobalContext{[a46_0x5c727a(0x220)];[a46_0x5c727a(0x22a)];[a46_0x5c727a(0x208)];[a46_0x5c727a(0x221)];[a46_0x5c727a(0x215)];[a46_0x5c727a(0x1fc)];[a46_0x5c727a(0x225)];[a46_0x5c727a(0x200)];[a46_0x5c727a(0x1fa)];['logLevel'];[a46_0x5c727a(0x1e9)];[a46_0x5c727a(0x226)];[a46_0x5c727a(0x1f0)];[a46_0x5c727a(0x203)];[a46_0x5c727a(0x218)];constructor(_0x2c0496){const _0x4a3c5c=a46_0x5c727a;this['sessionId']=_0x2c0496[_0x4a3c5c(0x205)]||getCurrentSessionPID()[_0x4a3c5c(0x213)]();const _0x4371c4=loadSessionContext(_0x2c0496[_0x4a3c5c(0x205)]),_0xeab338=loadProjectConfig(),_0x8c3ab9=this['loadGlobalConfig']();this['activeProfile']=_0x2c0496[_0x4a3c5c(0x1e9)]||_0x4371c4?.[_0x4a3c5c(0x1e9)]||_0x8c3ab9[_0x4a3c5c(0x1e9)]||getActiveProfile();const _0x1ade69=this[_0x4a3c5c(0x1f0)]?loadProfile(this['activeProfile']):null,_0x6f427=_0x1163ad=>{const _0x5b5ea4=_0x4a3c5c;if(!_0x1163ad)return{};const _0x5df538=_0x1163ad,_0x30187a={};for(const [_0x101578,_0x1927cf]of Object[_0x5b5ea4(0x1ed)](_0x5df538)){typeof _0x1927cf===_0x5b5ea4(0x1fd)&&(_0x30187a[_0x101578]=_0x1927cf);}return _0x30187a;},_0x338b92={};if(_0x2c0496[_0x4a3c5c(0x220)]&&_0x2c0496[_0x4a3c5c(0x220)]!==_0x4a3c5c(0x202))_0x338b92[_0x4a3c5c(0x220)]=_0x2c0496[_0x4a3c5c(0x220)];const _0xc68427=_0x4371c4?.['database'],_0x440c94=_0xeab338?.[_0x4a3c5c(0x22a)],_0x171d49=_0x1ade69?.['config']?.[_0x4a3c5c(0x22a)],_0x33efe2=_0x8c3ab9[_0x4a3c5c(0x22a)];_0x2c0496[_0x4a3c5c(0x22a)]&&(_0x2c0496[_0x4a3c5c(0x22a)]!==_0xc68427&&_0x2c0496[_0x4a3c5c(0x22a)]!==_0x440c94&&_0x2c0496['database']!==_0x171d49&&_0x2c0496[_0x4a3c5c(0x22a)]!==_0x33efe2)&&(_0x338b92[_0x4a3c5c(0x22a)]=_0x2c0496[_0x4a3c5c(0x22a)]);if(_0x2c0496['parentSegment'])_0x338b92['parent_segment']=_0x2c0496[_0x4a3c5c(0x22f)];if(_0x2c0496['llmProject'])_0x338b92[_0x4a3c5c(0x215)]=_0x2c0496[_0x4a3c5c(0x219)];if(_0x2c0496[_0x4a3c5c(0x20c)])_0x338b92[_0x4a3c5c(0x1fc)]=_0x2c0496[_0x4a3c5c(0x20c)];if(_0x2c0496[_0x4a3c5c(0x1e9)])_0x338b92[_0x4a3c5c(0x1e9)]=_0x2c0496[_0x4a3c5c(0x1e9)];this[_0x4a3c5c(0x226)]={'cliFlags':_0x338b92,'session':_0x6f427(_0x4371c4),'project':_0x6f427(_0xeab338),'profile':_0x6f427(_0x1ade69?.[_0x4a3c5c(0x204)]),'global':_0x6f427(_0x8c3ab9)};const _0x3e10db={...this[_0x4a3c5c(0x226)]['global'],...this[_0x4a3c5c(0x226)][_0x4a3c5c(0x1e9)],...this[_0x4a3c5c(0x226)][_0x4a3c5c(0x209)]};process[_0x4a3c5c(0x222)]['TDX_SITE']&&!this['layers']['session']['site']&&!this[_0x4a3c5c(0x226)][_0x4a3c5c(0x1ec)]['site']&&(_0x3e10db['site']=process['env']['TDX_SITE']);Object[_0x4a3c5c(0x212)](_0x3e10db,this['layers']['session']),Object['assign'](_0x3e10db,this[_0x4a3c5c(0x226)][_0x4a3c5c(0x1ec)]);const _0x401fe1=_0x3e10db[_0x4a3c5c(0x220)]||_0x4a3c5c(0x202);this[_0x4a3c5c(0x220)]=resolveSite(_0x401fe1),this[_0x4a3c5c(0x22a)]=_0x3e10db[_0x4a3c5c(0x22a)],this['parent_segment']=_0x3e10db['parent_segment'],this[_0x4a3c5c(0x221)]=_0x3e10db[_0x4a3c5c(0x221)],this[_0x4a3c5c(0x215)]=_0x3e10db['llm_project'],this['llm_agent']=_0x3e10db[_0x4a3c5c(0x1fc)],this['workflow_project']=_0x3e10db[_0x4a3c5c(0x225)],this[_0x4a3c5c(0x1fa)]=_0x2c0496[_0x4a3c5c(0x1fa)]||![],this[_0x4a3c5c(0x1f7)]=_0x2c0496['logLevel']??LogLevel['INFO'],this[_0x4a3c5c(0x1e9)]=this[_0x4a3c5c(0x1f0)]||undefined,this[_0x4a3c5c(0x200)]=getAPIKey(this[_0x4a3c5c(0x220)],this[_0x4a3c5c(0x1f0)]||undefined);const _0x3125f9=getConfigDir(),_0x6bd8ca=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x1f6),this[_0x4a3c5c(0x203)]+_0x4a3c5c(0x22e)),_0x15797b=findProjectConfigPath(),_0x4a8532=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x21f)),_0x2e978=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x1ea));let _0x1fd8b3=null,_0x40c14d=null;this[_0x4a3c5c(0x1f0)]&&(_0x1fd8b3=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x229),this['activeProfile'],_0x4a3c5c(0x21f)),_0x40c14d=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x229),this[_0x4a3c5c(0x1f0)],_0x4a3c5c(0x1ea))),this[_0x4a3c5c(0x218)]={'session':a46_0x2d292b[_0x4a3c5c(0x20b)](_0x6bd8ca)?_0x6bd8ca:null,'project':_0x15797b,'profile':_0x1fd8b3&&a46_0x2d292b[_0x4a3c5c(0x20b)](_0x1fd8b3)?_0x1fd8b3:null,'profileCredentials':_0x40c14d&&a46_0x2d292b[_0x4a3c5c(0x20b)](_0x40c14d)?_0x40c14d:null,'global':a46_0x2d292b['existsSync'](_0x4a8532)?_0x4a8532:null,'globalCredentials':a46_0x2d292b[_0x4a3c5c(0x20b)](_0x2e978)?_0x2e978:null};}[a46_0x5c727a(0x214)](_0x5dbbce,_0x4767ee){const _0x7f1918=a46_0x5c727a;if(!_0x4767ee)return'not\x20set';const _0x24a55e=_0x4767ee;if(this[_0x7f1918(0x226)][_0x7f1918(0x1ec)][_0x5dbbce]===_0x24a55e){if(_0x5dbbce===_0x7f1918(0x220)&&_0x24a55e===_0x7f1918(0x202)&&!this['layers']['session'][_0x7f1918(0x220)]&&!this[_0x7f1918(0x226)]['project'][_0x7f1918(0x220)]&&!this[_0x7f1918(0x226)][_0x7f1918(0x1e9)][_0x7f1918(0x220)]&&!this['layers'][_0x7f1918(0x217)]['site'])return'default';return _0x7f1918(0x20f)+_0x5dbbce[_0x7f1918(0x201)](/_/g,'-');}if(this[_0x7f1918(0x226)]['session'][_0x5dbbce]===_0x24a55e)return _0x7f1918(0x205);if(this[_0x7f1918(0x226)][_0x7f1918(0x209)][_0x5dbbce]===_0x24a55e)return _0x7f1918(0x209);if(this[_0x7f1918(0x226)][_0x7f1918(0x1e9)][_0x5dbbce]===_0x24a55e)return _0x7f1918(0x206)+this[_0x7f1918(0x1f0)];if(this[_0x7f1918(0x226)][_0x7f1918(0x217)][_0x5dbbce]===_0x24a55e)return'global';return'default';}[a46_0x5c727a(0x1ff)](){const _0x4833e6=a46_0x5c727a,_0x4aec4d=a46_0x3709d8[_0x4833e6(0x1f3)](getConfigDir(),_0x4833e6(0x21f));if(!a46_0x2d292b[_0x4833e6(0x20b)](_0x4aec4d))return{};try{const _0x1edafc=a46_0x2d292b[_0x4833e6(0x21e)](_0x4aec4d,_0x4833e6(0x227));return JSON['parse'](_0x1edafc);}catch{return{};}}[a46_0x5c727a(0x1ee)](_0x25e421){const _0xb1cbe7=a46_0x5c727a;_0x25e421[_0xb1cbe7(0x220)]=this[_0xb1cbe7(0x220)],!_0x25e421[_0xb1cbe7(0x22a)]&&this[_0xb1cbe7(0x22a)]&&(_0x25e421[_0xb1cbe7(0x22a)]=this[_0xb1cbe7(0x22a)]),!_0x25e421[_0xb1cbe7(0x22f)]&&this[_0xb1cbe7(0x208)]&&(_0x25e421[_0xb1cbe7(0x22f)]=this[_0xb1cbe7(0x208)]),!_0x25e421[_0xb1cbe7(0x1f4)]&&this['segment_path']&&(_0x25e421[_0xb1cbe7(0x1f4)]=this[_0xb1cbe7(0x221)]),!_0x25e421[_0xb1cbe7(0x219)]&&this['llm_project']&&(_0x25e421[_0xb1cbe7(0x219)]=this['llm_project']),!_0x25e421[_0xb1cbe7(0x20c)]&&this[_0xb1cbe7(0x1fc)]&&(_0x25e421[_0xb1cbe7(0x20c)]=this['llm_agent']),!_0x25e421[_0xb1cbe7(0x20d)]&&this['workflow_project']&&(_0x25e421[_0xb1cbe7(0x20d)]=this[_0xb1cbe7(0x225)]);}[a46_0x5c727a(0x210)](){const _0x36bc76=a46_0x5c727a;return[{'key':'site','value':this[_0x36bc76(0x220)]},{'key':'database','value':this[_0x36bc76(0x22a)]},{'key':'parent_segment','value':this[_0x36bc76(0x208)]},{'key':_0x36bc76(0x221),'value':this[_0x36bc76(0x221)]},{'key':_0x36bc76(0x215),'value':this[_0x36bc76(0x215)]},{'key':'llm_agent','value':this['llm_agent']},{'key':'workflow_project','value':this[_0x36bc76(0x225)]},{'key':_0x36bc76(0x1e9),'value':this[_0x36bc76(0x1f0)]||undefined}];}[a46_0x5c727a(0x21b)](){const _0x17a10e=a46_0x5c727a;console['log'](_0x17a10e(0x1f2));for(const {key:_0x2757af,value:_0x4235d0}of this['getParameters']()){_0x4235d0&&console['log'](_0x2757af+':\x20'+_0x4235d0);}}['displayWithSources'](){const _0x42b96a=a46_0x5c727a;console[_0x42b96a(0x22b)](_0x42b96a(0x1f2));for(const {key:_0x50e08b,value:_0x2e8a39}of this['getParameters']()){if(_0x2e8a39){const _0x30a142=_0x50e08b===_0x42b96a(0x1e9)?'(active)':'('+this['getSource'](_0x50e08b,_0x2e8a39)+')';console[_0x42b96a(0x22b)](_0x50e08b+':\x20'+_0x2e8a39+'\x20'+_0x30a142);}}console[_0x42b96a(0x22b)](_0x42b96a(0x1f5));const _0xc1a38e=[{'label':'Session','path':this[_0x42b96a(0x218)][_0x42b96a(0x205)],'extra':_0x42b96a(0x21c)+this['sessionId']+')'},{'label':_0x42b96a(0x22d),'path':this['configFiles'][_0x42b96a(0x209)]},{'label':_0x42b96a(0x21a),'path':this[_0x42b96a(0x218)]['profile']},{'label':_0x42b96a(0x228),'path':this['configFiles']['profileCredentials']},{'label':_0x42b96a(0x1fb),'path':this['configFiles']['global']},{'label':_0x42b96a(0x1ef),'path':this[_0x42b96a(0x218)][_0x42b96a(0x216)]}];for(const {label:_0x40e976,path:_0x37b32a,extra:_0x5478f2}of _0xc1a38e){if(_0x37b32a)console['log'](_0x40e976+':\x20'+_0x37b32a+'\x20✓'+(_0x5478f2?'\x20'+_0x5478f2:''));else{if(_0x40e976==='Session')console[_0x42b96a(0x22b)](_0x40e976+':\x20none\x20(using\x20session:\x20'+this[_0x42b96a(0x203)]+')');else(_0x40e976===_0x42b96a(0x22d)||_0x40e976===_0x42b96a(0x1fb))&&console[_0x42b96a(0x22b)](_0x40e976+':\x20none');}}}async[a46_0x5c727a(0x207)](){const _0xdadb0=a46_0x5c727a;return this[_0xdadb0(0x200)]=await getAPIKeyAsync(this['site'],this[_0xdadb0(0x1f0)]||undefined),this[_0xdadb0(0x200)];}static async[a46_0x5c727a(0x20e)](_0x64e4cf){const _0x4ce532=a46_0x5c727a,_0x2f9933=new GlobalContext(_0x64e4cf);return await _0x2f9933[_0x4ce532(0x207)](),_0x2f9933;}}
@@ -1 +1 @@
1
- function a47_0x3e7b(_0x409b5b,_0x57d164){_0x409b5b=_0x409b5b-0xb4;const _0x2b33fb=a47_0x2b33();let _0x3e7b26=_0x2b33fb[_0x409b5b];return _0x3e7b26;}(function(_0x2322c0,_0x3c2fb0){const _0x530f8c=a47_0x3e7b,_0x1894e7=_0x2322c0();while(!![]){try{const _0x797989=parseInt(_0x530f8c(0xbe))/0x1+parseInt(_0x530f8c(0xba))/0x2*(-parseInt(_0x530f8c(0xc8))/0x3)+parseInt(_0x530f8c(0xc1))/0x4*(-parseInt(_0x530f8c(0xbc))/0x5)+-parseInt(_0x530f8c(0xb5))/0x6*(parseInt(_0x530f8c(0xc0))/0x7)+-parseInt(_0x530f8c(0xd5))/0x8+parseInt(_0x530f8c(0xc3))/0x9+-parseInt(_0x530f8c(0xc2))/0xa*(-parseInt(_0x530f8c(0xd3))/0xb);if(_0x797989===_0x3c2fb0)break;else _0x1894e7['push'](_0x1894e7['shift']());}catch(_0xcf959e){_0x1894e7['push'](_0x1894e7['shift']());}}}(a47_0x2b33,0x8699d));const SERVICE_NAME='tdx';let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x107b1d=a47_0x3e7b;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x4da918=await import(_0x107b1d(0xc7));return keyringModule=_0x4da918[_0x107b1d(0xcc)],keyringModule;}catch(_0x38fc13){return keyringLoadError=_0x38fc13 instanceof Error?_0x38fc13:new Error(String(_0x38fc13)),null;}}function getAccountName(_0x32e441){const _0x5c66ff=a47_0x3e7b,_0x58527a=_0x32e441||'';return _0x5c66ff(0xbb)+_0x58527a+_0x5c66ff(0xd1);}export async function getKeychainAPIKey(_0x1dab50){const _0x26d0c3=a47_0x3e7b,_0x50470e=await getKeychainAPIKeyWithStatus(_0x1dab50);if(_0x50470e[_0x26d0c3(0xcf)])return _0x50470e['value'];return _0x50470e[_0x26d0c3(0xc5)]===_0x26d0c3(0xd0)&&console['error'](_0x26d0c3(0xc6)+_0x50470e[_0x26d0c3(0xb6)]),null;}function a47_0x2b33(){const _0x1482a0=['98274GIimky','profile:','485zUkHcc','not_found','677982NFXIdD','setPassword','301JIiGds','11252xPuVfQ','5661440mHpBAY','3361338ogQdKh','not\x20supported','reason','Warning:\x20','@zowe/secrets-for-zowe-sdk','51mceJIm','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.','deletePassword','access','keyring','System\x20keychain\x20is\x20not\x20available','toLowerCase','success','access_denied',':api_key','getPassword','22JRSHHf','includes','2207296bfxVPB','not\x20found','34650wmSFRa','message','restricted','unavailable','-25293'];a47_0x2b33=function(){return _0x1482a0;};return a47_0x2b33();}export async function getKeychainAPIKeyWithStatus(_0x322e39){const _0x4f3a62=a47_0x3e7b;try{const _0x3c091c=await getKeyring();if(!_0x3c091c)return{'success':![],'reason':'unavailable'};const _0x3855e2=getAccountName(_0x322e39),_0xf7eb5f=await _0x3c091c['getPassword'](SERVICE_NAME,_0x3855e2);if(_0xf7eb5f)return{'success':!![],'value':_0xf7eb5f};return{'success':![],'reason':_0x4f3a62(0xbd)};}catch(_0x4a756e){const _0x88628=_0x4a756e instanceof Error?_0x4a756e[_0x4f3a62(0xb6)]:String(_0x4a756e);if(_0x88628[_0x4f3a62(0xd4)]('-25300')||_0x88628[_0x4f3a62(0xce)]()[_0x4f3a62(0xd4)]('could\x20not\x20be\x20found')||_0x88628[_0x4f3a62(0xce)]()['includes'](_0x4f3a62(0xb4)))return{'success':![],'reason':_0x4f3a62(0xbd)};if(_0x88628[_0x4f3a62(0xd4)](_0x4f3a62(0xb9))||_0x88628[_0x4f3a62(0xce)]()[_0x4f3a62(0xd4)](_0x4f3a62(0xb7))||_0x88628[_0x4f3a62(0xce)]()[_0x4f3a62(0xd4)](_0x4f3a62(0xcb)))return{'success':![],'reason':_0x4f3a62(0xd0),'message':_0x4f3a62(0xc9)};return{'success':![],'reason':_0x4f3a62(0xb8),'message':_0x88628};}}export async function saveKeychainAPIKey(_0x2e5862,_0x4fb5d8){const _0xb9196c=a47_0x3e7b,_0x10f7bd=await getKeyring();if(!_0x10f7bd)throw new Error(_0xb9196c(0xcd));const _0x46eaf0=getAccountName(_0x4fb5d8);await _0x10f7bd[_0xb9196c(0xbf)](SERVICE_NAME,_0x46eaf0,_0x2e5862);}export async function deleteKeychainAPIKey(_0x1694b7){const _0x3021d2=a47_0x3e7b;try{const _0xf4b850=await getKeyring();if(!_0xf4b850)return![];const _0x2a1b85=getAccountName(_0x1694b7);return await _0xf4b850[_0x3021d2(0xca)](SERVICE_NAME,_0x2a1b85);}catch{return![];}}export async function isKeychainAvailable(){const _0x2134a1=a47_0x3e7b;try{const _0x54355c=await getKeyring();if(!_0x54355c)return![];return await _0x54355c[_0x2134a1(0xd2)](SERVICE_NAME,'__keychain_test__'),!![];}catch(_0x1dc8e5){const _0x4e1f8d=_0x1dc8e5 instanceof Error?_0x1dc8e5[_0x2134a1(0xb6)][_0x2134a1(0xce)]():'';if(_0x4e1f8d[_0x2134a1(0xd4)]('not\x20available')||_0x4e1f8d['includes'](_0x2134a1(0xc4))||_0x4e1f8d[_0x2134a1(0xd4)]('cannot\x20find'))return![];return!![];}}
1
+ const a47_0x366914=a47_0x4ee1;(function(_0x3bc186,_0x25112f){const _0x3a0fb8=a47_0x4ee1,_0x516e94=_0x3bc186();while(!![]){try{const _0x30a8e6=-parseInt(_0x3a0fb8(0xb9))/0x1*(parseInt(_0x3a0fb8(0xbc))/0x2)+parseInt(_0x3a0fb8(0xcf))/0x3*(parseInt(_0x3a0fb8(0xb8))/0x4)+-parseInt(_0x3a0fb8(0xad))/0x5+parseInt(_0x3a0fb8(0xc8))/0x6*(parseInt(_0x3a0fb8(0xc7))/0x7)+parseInt(_0x3a0fb8(0xbe))/0x8+parseInt(_0x3a0fb8(0xbf))/0x9+parseInt(_0x3a0fb8(0xb7))/0xa;if(_0x30a8e6===_0x25112f)break;else _0x516e94['push'](_0x516e94['shift']());}catch(_0x260b40){_0x516e94['push'](_0x516e94['shift']());}}}(a47_0x5649,0xe2a39));const SERVICE_NAME=a47_0x366914(0xba);let keyringModule=null,keyringLoadError=null;function a47_0x5649(){const _0x1d1f5c=['could\x20not\x20be\x20found','setPassword','toLowerCase','restricted','546wbAzGl','99660wBbdoq','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.','profile:','__keychain_test__','includes','success','message','3342lwzwVm','7624265PbbiHf','System\x20keychain\x20is\x20not\x20available','-25300','reason','cannot\x20find','keyring','unavailable','value','access','@zowe/secrets-for-zowe-sdk','12397340FUDKoz','1552jUVWCO','69GttKjx','tdx','not\x20available','40742EPdEKv','getPassword','6717080SnQJst','464256RxUWrt','access_denied','not_found',':api_key'];a47_0x5649=function(){return _0x1d1f5c;};return a47_0x5649();}async function getKeyring(){const _0x5e20f5=a47_0x366914;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x930a14=await import(_0x5e20f5(0xb6));return keyringModule=_0x930a14[_0x5e20f5(0xb2)],keyringModule;}catch(_0x57923c){return keyringLoadError=_0x57923c instanceof Error?_0x57923c:new Error(String(_0x57923c)),null;}}function a47_0x4ee1(_0x3cf2f3,_0x9c1d7c){_0x3cf2f3=_0x3cf2f3-0xad;const _0x564974=a47_0x5649();let _0x4ee1c0=_0x564974[_0x3cf2f3];return _0x4ee1c0;}function getAccountName(_0x37e9fb){const _0x373c85=a47_0x366914,_0x417e70=_0x37e9fb||'';return _0x373c85(0xca)+_0x417e70+_0x373c85(0xc2);}export async function getKeychainAPIKey(_0x3a0026){const _0x269d22=a47_0x366914,_0x425b4a=await getKeychainAPIKeyWithStatus(_0x3a0026);if(_0x425b4a[_0x269d22(0xcd)])return _0x425b4a[_0x269d22(0xb4)];return _0x425b4a[_0x269d22(0xb0)]===_0x269d22(0xc0)&&console['error']('Warning:\x20'+_0x425b4a[_0x269d22(0xce)]),null;}export async function getKeychainAPIKeyWithStatus(_0x17bd92){const _0x11cfb4=a47_0x366914;try{const _0x49c0d2=await getKeyring();if(!_0x49c0d2)return{'success':![],'reason':_0x11cfb4(0xb3)};const _0x254e8a=getAccountName(_0x17bd92),_0x14bf26=await _0x49c0d2[_0x11cfb4(0xbd)](SERVICE_NAME,_0x254e8a);if(_0x14bf26)return{'success':!![],'value':_0x14bf26};return{'success':![],'reason':_0x11cfb4(0xc1)};}catch(_0xad0d84){const _0x4fa459=_0xad0d84 instanceof Error?_0xad0d84['message']:String(_0xad0d84);if(_0x4fa459[_0x11cfb4(0xcc)](_0x11cfb4(0xaf))||_0x4fa459[_0x11cfb4(0xc5)]()[_0x11cfb4(0xcc)](_0x11cfb4(0xc3))||_0x4fa459['toLowerCase']()['includes']('not\x20found'))return{'success':![],'reason':_0x11cfb4(0xc1)};if(_0x4fa459[_0x11cfb4(0xcc)]('-25293')||_0x4fa459['toLowerCase']()[_0x11cfb4(0xcc)](_0x11cfb4(0xc6))||_0x4fa459['toLowerCase']()[_0x11cfb4(0xcc)](_0x11cfb4(0xb5)))return{'success':![],'reason':_0x11cfb4(0xc0),'message':_0x11cfb4(0xc9)};return{'success':![],'reason':_0x11cfb4(0xb3),'message':_0x4fa459};}}export async function saveKeychainAPIKey(_0x537adc,_0x4b1f47){const _0xd62c98=a47_0x366914,_0x5b7b10=await getKeyring();if(!_0x5b7b10)throw new Error(_0xd62c98(0xae));const _0x5b6720=getAccountName(_0x4b1f47);await _0x5b7b10[_0xd62c98(0xc4)](SERVICE_NAME,_0x5b6720,_0x537adc);}export async function deleteKeychainAPIKey(_0x3be449){try{const _0x4596f1=await getKeyring();if(!_0x4596f1)return![];const _0xbd1165=getAccountName(_0x3be449);return await _0x4596f1['deletePassword'](SERVICE_NAME,_0xbd1165);}catch{return![];}}export async function isKeychainAvailable(){const _0x1688f8=a47_0x366914;try{const _0x42603e=await getKeyring();if(!_0x42603e)return![];return await _0x42603e['getPassword'](SERVICE_NAME,_0x1688f8(0xcb)),!![];}catch(_0x1b3437){const _0x330df1=_0x1b3437 instanceof Error?_0x1b3437['message']['toLowerCase']():'';if(_0x330df1[_0x1688f8(0xcc)](_0x1688f8(0xbb))||_0x330df1['includes']('not\x20supported')||_0x330df1[_0x1688f8(0xcc)](_0x1688f8(0xb1)))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0x4828d2,_0x51f8e9){const _0x14be80=a48_0x5682,_0x250929=_0x4828d2();while(!![]){try{const _0x57822c=parseInt(_0x14be80(0x1e6))/0x1*(parseInt(_0x14be80(0x1f5))/0x2)+parseInt(_0x14be80(0x1fc))/0x3+parseInt(_0x14be80(0x1e1))/0x4*(-parseInt(_0x14be80(0x1f7))/0x5)+parseInt(_0x14be80(0x1d5))/0x6+-parseInt(_0x14be80(0x1fd))/0x7*(parseInt(_0x14be80(0x208))/0x8)+-parseInt(_0x14be80(0x1f8))/0x9*(parseInt(_0x14be80(0x209))/0xa)+parseInt(_0x14be80(0x201))/0xb*(parseInt(_0x14be80(0x1df))/0xc);if(_0x57822c===_0x51f8e9)break;else _0x250929['push'](_0x250929['shift']());}catch(_0xb29a96){_0x250929['push'](_0x250929['shift']());}}}(a48_0x79dc,0x85819));import*as a48_0x2865c3 from'node:fs';import*as a48_0x4cb6eb 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(_0x4ceb7c){const _0x235dd0=a48_0x5682,_0x2c8e57={};if(!_0x4ceb7c)return _0x2c8e57;for(const [_0x4e741c,_0x5a9bef]of Object['entries'](_0x4ceb7c)){_0x4e741c!==_0x235dd0(0x1f0)&&_0x5a9bef!==undefined&&(_0x2c8e57[_0x4e741c]=_0x5a9bef);}return _0x2c8e57;}export function getProfilesDir(){return a48_0x4cb6eb['join'](getConfigDir(),'profiles');}function getProfileDir(_0x53c925){return a48_0x4cb6eb['join'](getProfilesDir(),_0x53c925);}function getProfileConfigPath(_0x1c64ce){const _0x218670=a48_0x5682;return a48_0x4cb6eb['join'](getProfileDir(_0x1c64ce),_0x218670(0x1c6));}function getProfileEnvPath(_0x445918){const _0x382a02=a48_0x5682;return a48_0x4cb6eb[_0x382a02(0x20b)](getProfileDir(_0x445918),_0x382a02(0x20e));}function getGlobalConfigPath(){const _0x74a242=a48_0x5682;return a48_0x4cb6eb[_0x74a242(0x20b)](getConfigDir(),_0x74a242(0x1c6));}function validateProfileName(_0x3633a3){const _0xfdf65a=a48_0x5682;if(!/^[a-zA-Z0-9_-]+$/['test'](_0x3633a3))throw new Error(_0xfdf65a(0x1e2)+_0x3633a3+_0xfdf65a(0x1e3));}function validateProfileConfig(_0x5180da,_0x20eb90){const _0x1acc2a=a48_0x5682;if(typeof _0x5180da!==_0x1acc2a(0x204)||_0x5180da===null)throw new Error(_0x1acc2a(0x1dc)+_0x20eb90+_0x1acc2a(0x1ee));const _0x1ecad4=[_0x1acc2a(0x1f0),_0x1acc2a(0x203),'database',_0x1acc2a(0x1d8),_0x1acc2a(0x1d7),_0x1acc2a(0x1d4)],_0x370f15=_0x5180da;for(const _0x40772a of Object[_0x1acc2a(0x1e0)](_0x370f15)){!_0x1ecad4[_0x1acc2a(0x213)](_0x40772a)&&console[_0x1acc2a(0x1eb)](_0x1acc2a(0x1ec)+_0x20eb90+_0x1acc2a(0x1fa)+_0x40772a+_0x1acc2a(0x1cb));}if(_0x370f15['description']!==undefined&&typeof _0x370f15[_0x1acc2a(0x1f0)]!=='string')throw new Error(_0x1acc2a(0x1dc)+_0x20eb90+_0x1acc2a(0x1e7));if(_0x370f15[_0x1acc2a(0x203)]!==undefined&&typeof _0x370f15[_0x1acc2a(0x203)]!=='string')throw new Error(_0x1acc2a(0x1dc)+_0x20eb90+_0x1acc2a(0x1ea));if(_0x370f15['database']!==undefined&&typeof _0x370f15[_0x1acc2a(0x1ff)]!=='string')throw new Error('Profile\x20\x27'+_0x20eb90+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x370f15[_0x1acc2a(0x1d8)]!==undefined&&typeof _0x370f15[_0x1acc2a(0x1d8)]!==_0x1acc2a(0x1ef))throw new Error('Profile\x20\x27'+_0x20eb90+_0x1acc2a(0x1f6));if(_0x370f15[_0x1acc2a(0x1d7)]!==undefined&&typeof _0x370f15[_0x1acc2a(0x1d7)]!==_0x1acc2a(0x1ef))throw new Error(_0x1acc2a(0x1dc)+_0x20eb90+_0x1acc2a(0x1fe));if(_0x370f15[_0x1acc2a(0x1d4)]!==undefined&&typeof _0x370f15[_0x1acc2a(0x1d4)]!==_0x1acc2a(0x1ef))throw new Error(_0x1acc2a(0x1dc)+_0x20eb90+_0x1acc2a(0x20f));return!![];}function loadProfilesFromTdxJson(_0x4274b4,_0x3503a5){const _0x54172d=a48_0x5682;if(!a48_0x2865c3[_0x54172d(0x210)](_0x4274b4))return[];try{const _0x12e4a0=a48_0x2865c3[_0x54172d(0x215)](_0x4274b4,'utf-8'),_0x38f2dc=JSON[_0x54172d(0x1d3)](_0x12e4a0);if(!_0x38f2dc[_0x54172d(0x1c8)]||typeof _0x38f2dc['profiles']!==_0x54172d(0x204))return[];const _0x55c4b1=[];for(const [_0x13da36,_0x2ba3cd]of Object['entries'](_0x38f2dc[_0x54172d(0x1c8)])){try{validateProfileConfig(_0x2ba3cd,_0x13da36);const _0x56fcd3=getNewCredentialPath(_0x13da36),_0x402ec1=getOldCredentialPath(_0x13da36),_0x310128=a48_0x2865c3[_0x54172d(0x210)](_0x56fcd3)||a48_0x2865c3[_0x54172d(0x210)](_0x402ec1);_0x55c4b1[_0x54172d(0x205)]({'name':_0x13da36,'config':_0x2ba3cd,'metadata':{'name':_0x13da36,'createdAt':new Date()[_0x54172d(0x1da)]()},'hasCredentials':_0x310128,'scope':_0x3503a5});}catch(_0x3666e2){_0x3666e2 instanceof Error&&(console[_0x54172d(0x1eb)](_0x54172d(0x211)+_0x4274b4+':'),console[_0x54172d(0x1eb)]('\x20\x20'+_0x3666e2[_0x54172d(0x20c)]+'\x0a'));}}return _0x55c4b1;}catch(_0x1fe1b0){return _0x1fe1b0 instanceof SyntaxError?(console[_0x54172d(0x1eb)](_0x54172d(0x1d1)+_0x4274b4+_0x54172d(0x1de)),console[_0x54172d(0x1eb)]('Error:\x20'+_0x1fe1b0[_0x54172d(0x20c)]+'\x0a')):console[_0x54172d(0x1eb)](_0x54172d(0x216)+_0x4274b4+':\x20'+_0x1fe1b0+'\x0a'),[];}}export function getNewCredentialPath(_0x2aebfa){const _0x7dcd63=a48_0x5682;return a48_0x4cb6eb['join'](getConfigDir(),_0x7dcd63(0x1e9)+_0x2aebfa);}function getOldCredentialPath(_0x22788b){const _0x20c2e2=a48_0x5682;return a48_0x4cb6eb['join'](getProfilesDir(),_0x22788b,_0x20c2e2(0x20e));}function loadProfilesFromTdxJsonFiles(){const _0x50747f=a48_0x5682,_0x466928=[],_0x45f90d=findProjectConfigPath();_0x45f90d&&_0x466928['push'](...loadProfilesFromTdxJson(_0x45f90d,_0x50747f(0x1c9)));const _0x437a22=a48_0x4cb6eb['join'](getConfigDir(),_0x50747f(0x1c6));return _0x466928[_0x50747f(0x205)](...loadProfilesFromTdxJson(_0x437a22,_0x50747f(0x1e5))),_0x466928;}function a48_0x5682(_0x222932,_0x4b5a21){_0x222932=_0x222932-0x1c6;const _0x79dcd2=a48_0x79dc();let _0x5682a3=_0x79dcd2[_0x222932];return _0x5682a3;}function loadProfilesFromDirectories(){const _0x4677d3=a48_0x5682,_0x4eaafe=getProfilesDir();if(!a48_0x2865c3[_0x4677d3(0x210)](_0x4eaafe))return[];try{return a48_0x2865c3[_0x4677d3(0x1f2)](_0x4eaafe,{'withFileTypes':!![]})[_0x4677d3(0x1cc)](_0xc86854=>_0xc86854[_0x4677d3(0x1f4)]())[_0x4677d3(0x1ed)](_0x1b173c=>_0x1b173c[_0x4677d3(0x200)])[_0x4677d3(0x1cc)](_0x4728cb=>{const _0x6fd83=_0x4677d3,_0x5d0a65=getProfileConfigPath(_0x4728cb),_0x517315=getProfileEnvPath(_0x4728cb);return a48_0x2865c3[_0x6fd83(0x210)](_0x5d0a65)||a48_0x2865c3[_0x6fd83(0x210)](_0x517315);})[_0x4677d3(0x1ed)](_0x79099c=>{const _0x4d9fc2=_0x4677d3,_0x4ef484=loadProfileFromDirectory(_0x79099c);if(_0x4ef484)return{..._0x4ef484,'scope':_0x4d9fc2(0x1d0)};return null;})[_0x4677d3(0x1cc)](_0x46e2cb=>_0x46e2cb!==null);}catch{return[];}}function loadProfileFromDirectory(_0x20a9b8){const _0x24fd46=a48_0x5682,_0x20f7fb=getProfileConfigPath(_0x20a9b8),_0x572041=getOldCredentialPath(_0x20a9b8);if(!a48_0x2865c3[_0x24fd46(0x210)](_0x20f7fb)&&!a48_0x2865c3['existsSync'](_0x572041))return null;let _0x4d120a={},_0x73b86f={'name':_0x20a9b8,'createdAt':new Date()[_0x24fd46(0x1da)]()};if(a48_0x2865c3[_0x24fd46(0x210)](_0x20f7fb))try{const _0x2c83db=a48_0x2865c3[_0x24fd46(0x215)](_0x20f7fb,'utf-8'),_0x34d1f6=JSON[_0x24fd46(0x1d3)](_0x2c83db),{metadata:_0x1dd315,..._0x41ae98}=_0x34d1f6;_0x4d120a=_0x41ae98,_0x1dd315&&(_0x73b86f=_0x1dd315);}catch{}return{'name':_0x20a9b8,'config':_0x4d120a,'metadata':_0x73b86f,'hasCredentials':a48_0x2865c3['existsSync'](_0x572041),'scope':'directory'};}export function listProfiles(){const _0xe01ec0=a48_0x5682,_0x28f8a6=loadProfilesFromTdxJsonFiles(),_0x5db9fe=loadProfilesFromDirectories();if(_0x5db9fe[_0xe01ec0(0x214)]>0x0){const _0x34ec03=_0x5db9fe[_0xe01ec0(0x1ed)](_0x4facda=>_0x4facda[_0xe01ec0(0x200)])[_0xe01ec0(0x20b)](',\x20'),_0x1df997=getConfigDir();console[_0xe01ec0(0x1eb)](_0xe01ec0(0x1e8)+_0x34ec03),console[_0xe01ec0(0x1eb)](_0xe01ec0(0x1f1)),console[_0xe01ec0(0x1eb)](_0xe01ec0(0x1ca)+a48_0x4cb6eb[_0xe01ec0(0x20b)](_0x1df997,'tdx.json')),console[_0xe01ec0(0x1eb)](_0xe01ec0(0x1d6)),console['warn']('\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a');}const _0x4cb799=[..._0x28f8a6,..._0x5db9fe],_0x2514f5=new Map();for(const _0x352ac9 of _0x4cb799){!_0x2514f5[_0xe01ec0(0x1db)](_0x352ac9['name'])&&_0x2514f5['set'](_0x352ac9[_0xe01ec0(0x200)],_0x352ac9);}return Array[_0xe01ec0(0x20d)](_0x2514f5['values']())[_0xe01ec0(0x20a)]((_0x22d861,_0x5dcdec)=>_0x22d861[_0xe01ec0(0x200)][_0xe01ec0(0x217)](_0x5dcdec[_0xe01ec0(0x200)]));}export function profileExists(_0x107675){const _0x385b28=a48_0x5682,_0x33f478=listProfiles();return _0x33f478['some'](_0x1ce3f9=>_0x1ce3f9[_0x385b28(0x200)]===_0x107675);}function a48_0x79dc(){const _0x1ce9f9=['8562717NFnDkd','profile','\x27:\x20unknown\x20config\x20key\x20\x27','Profile\x20','2426442PvQlhu','42ifoWmg','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','database','name','2563nsTSiU','env','site','object','push','Failed\x20to\x20parse\x20','stringify','203360LtzcAa','10lydcew','sort','join','message','from','.env','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','existsSync','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','Warning:\x20Failed\x20to\x20parse\x20','includes','length','readFileSync','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','localeCompare','TDX_PROFILE','tdx.json','utf-8','profiles','local','\x20\x201.\x20Edit:\x20','\x27\x20will\x20be\x20ignored','filter','\x27\x20not\x20found\x20in\x20user\x20configuration','find','\x20does\x20not\x20exist','directory','\x0aWarning:\x20Failed\x20to\x20parse\x20',',\x20creating\x20new\x20file','parse','llm_agent','2708532gFVhmS','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','llm_project','parent_segment','\x20already\x20exists','toISOString','has','Profile\x20\x27','\x22\x20\x22',':\x20Invalid\x20JSON\x20syntax','50916PuAdMA','keys','4rHDmyX','Invalid\x20profile\x20name:\x20','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','user','32883SERgZC','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','.env.','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','warn','Warning:\x20Profile\x20\x27','map','\x27:\x20config\x20must\x20be\x20an\x20object','string','description','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','readdirSync','rmSync','isDirectory','4PaBZde','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','3319235jfNUGJ'];a48_0x79dc=function(){return _0x1ce9f9;};return a48_0x79dc();}export function loadProfile(_0x48459a){const _0x42b491=a48_0x5682;validateProfileName(_0x48459a);const _0x1f1a0a=listProfiles(),_0x4d25f4=_0x1f1a0a[_0x42b491(0x1ce)](_0x2cda3c=>_0x2cda3c['name']===_0x48459a);return _0x4d25f4||null;}export function saveProfile(_0x46f3d2,_0x1a3385,_0x3df810=![]){saveProfileToUserConfig(_0x46f3d2,_0x1a3385);}export function deleteProfile(_0x274d80){const _0x4619c2=a48_0x5682;validateProfileName(_0x274d80);const _0x435d4c=getProfileDir(_0x274d80);if(!a48_0x2865c3['existsSync'](_0x435d4c))throw new Error(_0x4619c2(0x1fb)+_0x274d80+_0x4619c2(0x1cf));a48_0x2865c3[_0x4619c2(0x1f3)](_0x435d4c,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0xff7beb,_0x126b1a){const _0xd9497e=a48_0x5682;validateProfileName(_0xff7beb);const _0x468fc1=getGlobalConfigPath(),_0x4f5c3a=getConfigDir();!a48_0x2865c3['existsSync'](_0x4f5c3a)&&createSecureDirectory(_0x4f5c3a);let _0x3ca767={};if(a48_0x2865c3[_0xd9497e(0x210)](_0x468fc1))try{const _0x34971a=a48_0x2865c3[_0xd9497e(0x215)](_0x468fc1,'utf-8');_0x3ca767=JSON[_0xd9497e(0x1d3)](_0x34971a);}catch{console[_0xd9497e(0x1eb)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x468fc1+_0xd9497e(0x1d2));}!_0x3ca767['profiles']&&(_0x3ca767[_0xd9497e(0x1c8)]={}),_0x3ca767[_0xd9497e(0x1c8)][_0xff7beb]=_0x126b1a,writeSecureFile(_0x468fc1,JSON[_0xd9497e(0x207)](_0x3ca767,null,0x2));}export function removeProfileFromUserConfig(_0x2e17af){const _0x2c7122=a48_0x5682;validateProfileName(_0x2e17af);const _0xa19303=getGlobalConfigPath();if(!a48_0x2865c3[_0x2c7122(0x210)](_0xa19303))throw new Error(_0x2c7122(0x1dc)+_0x2e17af+_0x2c7122(0x1cd));let _0x8fd5e9={};try{const _0x5db2df=a48_0x2865c3[_0x2c7122(0x215)](_0xa19303,_0x2c7122(0x1c7));_0x8fd5e9=JSON[_0x2c7122(0x1d3)](_0x5db2df);}catch{throw new Error(_0x2c7122(0x206)+_0xa19303);}if(!_0x8fd5e9[_0x2c7122(0x1c8)]||!_0x8fd5e9[_0x2c7122(0x1c8)][_0x2e17af])throw new Error(_0x2c7122(0x1dc)+_0x2e17af+'\x27\x20not\x20found\x20in\x20user\x20configuration');delete _0x8fd5e9[_0x2c7122(0x1c8)][_0x2e17af],_0x8fd5e9[_0x2c7122(0x1f9)]===_0x2e17af&&delete _0x8fd5e9[_0x2c7122(0x1f9)],writeSecureFile(_0xa19303,JSON['stringify'](_0x8fd5e9,null,0x2));}export function getActiveProfile(){const _0x1d669f=a48_0x5682,_0x29fce9=loadSessionContext();if(_0x29fce9?.[_0x1d669f(0x1f9)])return _0x29fce9[_0x1d669f(0x1f9)];if(process[_0x1d669f(0x202)][_0x1d669f(0x218)])return process[_0x1d669f(0x202)][_0x1d669f(0x218)];const _0x33202b=getGlobalConfigPath();if(!a48_0x2865c3['existsSync'](_0x33202b))return null;try{const _0x36e366=a48_0x2865c3[_0x1d669f(0x215)](_0x33202b,_0x1d669f(0x1c7)),_0x57c364=JSON['parse'](_0x36e366);return _0x57c364[_0x1d669f(0x1f9)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x4faca6){const _0x5a3d7d=a48_0x5682,_0x4a91f0=getGlobalConfigPath(),_0x1fe4ad=getConfigDir();!a48_0x2865c3[_0x5a3d7d(0x210)](_0x1fe4ad)&&createSecureDirectory(_0x1fe4ad);let _0x3c1df9={};if(a48_0x2865c3['existsSync'](_0x4a91f0))try{const _0x3f68fb=a48_0x2865c3[_0x5a3d7d(0x215)](_0x4a91f0,_0x5a3d7d(0x1c7));_0x3c1df9=JSON['parse'](_0x3f68fb);}catch{console[_0x5a3d7d(0x1eb)](_0x5a3d7d(0x212)+_0x4a91f0+_0x5a3d7d(0x1d2));}_0x3c1df9[_0x5a3d7d(0x203)]=_0x4faca6,writeSecureFile(_0x4a91f0,JSON[_0x5a3d7d(0x207)](_0x3c1df9,null,0x2));}export function saveActiveProfileToUserConfig(_0x51ed7d){const _0x2cde5b=a48_0x5682;validateProfileName(_0x51ed7d);const _0x29837d=getGlobalConfigPath(),_0x56b31b=getConfigDir();!a48_0x2865c3[_0x2cde5b(0x210)](_0x56b31b)&&createSecureDirectory(_0x56b31b);let _0x2d4992={};if(a48_0x2865c3['existsSync'](_0x29837d))try{const _0x545ee6=a48_0x2865c3[_0x2cde5b(0x215)](_0x29837d,_0x2cde5b(0x1c7));_0x2d4992=JSON[_0x2cde5b(0x1d3)](_0x545ee6);}catch{console[_0x2cde5b(0x1eb)](_0x2cde5b(0x212)+_0x29837d+_0x2cde5b(0x1d2));}_0x2d4992['profile']=_0x51ed7d,writeSecureFile(_0x29837d,JSON[_0x2cde5b(0x207)](_0x2d4992,null,0x2));}function clearFieldFromUserConfig(_0x3d9fea){const _0xa0778a=a48_0x5682,_0x43d223=getGlobalConfigPath();if(!a48_0x2865c3[_0xa0778a(0x210)](_0x43d223))return;let _0x550ca8={};try{const _0x3cd4cf=a48_0x2865c3['readFileSync'](_0x43d223,'utf-8');_0x550ca8=JSON[_0xa0778a(0x1d3)](_0x3cd4cf);}catch{return;}delete _0x550ca8[_0x3d9fea],writeSecureFile(_0x43d223,JSON[_0xa0778a(0x207)](_0x550ca8,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){const _0x11ae99=a48_0x5682;clearFieldFromUserConfig(_0x11ae99(0x1f9));}export function createProfile(_0x1693c6,_0x35f92c){const _0x16edd8=a48_0x5682;validateProfileName(_0x1693c6);if(profileExists(_0x1693c6))throw new Error(_0x16edd8(0x1fb)+_0x1693c6+_0x16edd8(0x1d9));saveProfile(_0x1693c6,_0x35f92c);}export function saveProfileCredentials(_0x5dccfe,_0x927327){const _0x14708a=a48_0x5682;validateProfileName(_0x5dccfe);if(!profileExists(_0x5dccfe))throw new Error(_0x14708a(0x1fb)+_0x5dccfe+_0x14708a(0x1cf));const _0x2cbc3f=getNewCredentialPath(_0x5dccfe);writeSecureFile(_0x2cbc3f,_0x927327);}export function loadProfileCredentials(_0x1dd8f9){const _0x2c995c=a48_0x5682;validateProfileName(_0x1dd8f9);const _0x4fff0b=getNewCredentialPath(_0x1dd8f9);if(a48_0x2865c3[_0x2c995c(0x210)](_0x4fff0b))try{return a48_0x2865c3[_0x2c995c(0x215)](_0x4fff0b,_0x2c995c(0x1c7));}catch{}const _0x12de54=getOldCredentialPath(_0x1dd8f9);if(a48_0x2865c3['existsSync'](_0x12de54)){console[_0x2c995c(0x1eb)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x1dd8f9+'\x27'),console[_0x2c995c(0x1eb)]('To\x20migrate:'),console['warn']('\x20\x20mv\x20\x22'+_0x12de54+_0x2c995c(0x1dd)+_0x4fff0b+'\x22'),console[_0x2c995c(0x1eb)](_0x2c995c(0x1e4));try{return a48_0x2865c3[_0x2c995c(0x215)](_0x12de54,_0x2c995c(0x1c7));}catch{return null;}}return null;}
1
+ (function(_0x3602db,_0x31544c){const _0x5ddea3=a48_0x2a59,_0x5f23dc=_0x3602db();while(!![]){try{const _0xead6f5=-parseInt(_0x5ddea3(0x148))/0x1+parseInt(_0x5ddea3(0x129))/0x2+-parseInt(_0x5ddea3(0x134))/0x3+-parseInt(_0x5ddea3(0x14d))/0x4*(-parseInt(_0x5ddea3(0x12b))/0x5)+-parseInt(_0x5ddea3(0x12c))/0x6+parseInt(_0x5ddea3(0x16e))/0x7*(-parseInt(_0x5ddea3(0x13c))/0x8)+parseInt(_0x5ddea3(0x14a))/0x9;if(_0xead6f5===_0x31544c)break;else _0x5f23dc['push'](_0x5f23dc['shift']());}catch(_0x3aa980){_0x5f23dc['push'](_0x5f23dc['shift']());}}}(a48_0x5d7f,0xe6cfb));import*as a48_0xcaeaa6 from'node:fs';import*as a48_0x32d0c6 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(_0x8682cf){const _0x5f1c82=a48_0x2a59,_0x1f2b06={};if(!_0x8682cf)return _0x1f2b06;for(const [_0x3ec88d,_0x26a28b]of Object['entries'](_0x8682cf)){_0x3ec88d!==_0x5f1c82(0x140)&&_0x26a28b!==undefined&&(_0x1f2b06[_0x3ec88d]=_0x26a28b);}return _0x1f2b06;}export function getProfilesDir(){const _0x21e84e=a48_0x2a59;return a48_0x32d0c6[_0x21e84e(0x15e)](getConfigDir(),_0x21e84e(0x15b));}function getProfileDir(_0x2c3185){const _0x30086a=a48_0x2a59;return a48_0x32d0c6[_0x30086a(0x15e)](getProfilesDir(),_0x2c3185);}function getProfileConfigPath(_0x5cb053){const _0xfa215a=a48_0x2a59;return a48_0x32d0c6[_0xfa215a(0x15e)](getProfileDir(_0x5cb053),_0xfa215a(0x138));}function getProfileEnvPath(_0x5332b4){const _0x15a277=a48_0x2a59;return a48_0x32d0c6[_0x15a277(0x15e)](getProfileDir(_0x5332b4),_0x15a277(0x126));}function a48_0x2a59(_0x282dfc,_0x12974c){_0x282dfc=_0x282dfc-0x121;const _0x5d7f90=a48_0x5d7f();let _0x2a596d=_0x5d7f90[_0x282dfc];return _0x2a596d;}function getGlobalConfigPath(){const _0x1ce553=a48_0x2a59;return a48_0x32d0c6[_0x1ce553(0x15e)](getConfigDir(),_0x1ce553(0x138));}function validateProfileName(_0x192a14){const _0x2ac04c=a48_0x2a59;if(!/^[a-zA-Z0-9_-]+$/[_0x2ac04c(0x16d)](_0x192a14))throw new Error('Invalid\x20profile\x20name:\x20'+_0x192a14+_0x2ac04c(0x13a));}function validateProfileConfig(_0x45f860,_0x49adb7){const _0x5b0117=a48_0x2a59;if(typeof _0x45f860!=='object'||_0x45f860===null)throw new Error(_0x5b0117(0x151)+_0x49adb7+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0xa1f927=[_0x5b0117(0x140),_0x5b0117(0x155),_0x5b0117(0x14e),_0x5b0117(0x167),_0x5b0117(0x162),_0x5b0117(0x15d)],_0x482c12=_0x45f860;for(const _0x385caa of Object[_0x5b0117(0x14f)](_0x482c12)){!_0xa1f927[_0x5b0117(0x135)](_0x385caa)&&console[_0x5b0117(0x142)](_0x5b0117(0x16f)+_0x49adb7+_0x5b0117(0x122)+_0x385caa+_0x5b0117(0x149));}if(_0x482c12[_0x5b0117(0x140)]!==undefined&&typeof _0x482c12[_0x5b0117(0x140)]!==_0x5b0117(0x163))throw new Error('Profile\x20\x27'+_0x49adb7+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x482c12[_0x5b0117(0x155)]!==undefined&&typeof _0x482c12[_0x5b0117(0x155)]!==_0x5b0117(0x163))throw new Error(_0x5b0117(0x151)+_0x49adb7+_0x5b0117(0x139));if(_0x482c12[_0x5b0117(0x14e)]!==undefined&&typeof _0x482c12[_0x5b0117(0x14e)]!=='string')throw new Error('Profile\x20\x27'+_0x49adb7+_0x5b0117(0x127));if(_0x482c12['parent_segment']!==undefined&&typeof _0x482c12[_0x5b0117(0x167)]!==_0x5b0117(0x163))throw new Error(_0x5b0117(0x151)+_0x49adb7+_0x5b0117(0x150));if(_0x482c12[_0x5b0117(0x162)]!==undefined&&typeof _0x482c12[_0x5b0117(0x162)]!=='string')throw new Error(_0x5b0117(0x151)+_0x49adb7+_0x5b0117(0x13b));if(_0x482c12[_0x5b0117(0x15d)]!==undefined&&typeof _0x482c12['llm_agent']!==_0x5b0117(0x163))throw new Error('Profile\x20\x27'+_0x49adb7+_0x5b0117(0x128));return!![];}function loadProfilesFromTdxJson(_0x4938fd,_0x2bad3c){const _0x527e0f=a48_0x2a59;if(!a48_0xcaeaa6[_0x527e0f(0x15f)](_0x4938fd))return[];try{const _0x65117c=a48_0xcaeaa6[_0x527e0f(0x156)](_0x4938fd,'utf-8'),_0xafc659=JSON[_0x527e0f(0x12d)](_0x65117c);if(!_0xafc659[_0x527e0f(0x15b)]||typeof _0xafc659[_0x527e0f(0x15b)]!=='object')return[];const _0x1447e1=[];for(const [_0x3ed8a8,_0x17021e]of Object[_0x527e0f(0x125)](_0xafc659['profiles'])){try{validateProfileConfig(_0x17021e,_0x3ed8a8);const _0x2d0f2b=getNewCredentialPath(_0x3ed8a8),_0x515d45=getOldCredentialPath(_0x3ed8a8),_0x237f1c=a48_0xcaeaa6[_0x527e0f(0x15f)](_0x2d0f2b)||a48_0xcaeaa6[_0x527e0f(0x15f)](_0x515d45);_0x1447e1['push']({'name':_0x3ed8a8,'config':_0x17021e,'metadata':{'name':_0x3ed8a8,'createdAt':new Date()[_0x527e0f(0x144)]()},'hasCredentials':_0x237f1c,'scope':_0x2bad3c});}catch(_0xeb8f1f){_0xeb8f1f instanceof Error&&(console[_0x527e0f(0x142)](_0x527e0f(0x14c)+_0x4938fd+':'),console['warn']('\x20\x20'+_0xeb8f1f['message']+'\x0a'));}}return _0x1447e1;}catch(_0x2d47e9){return _0x2d47e9 instanceof SyntaxError?(console[_0x527e0f(0x142)](_0x527e0f(0x12e)+_0x4938fd+_0x527e0f(0x164)),console[_0x527e0f(0x142)](_0x527e0f(0x130)+_0x2d47e9[_0x527e0f(0x157)]+'\x0a')):console[_0x527e0f(0x142)](_0x527e0f(0x159)+_0x4938fd+':\x20'+_0x2d47e9+'\x0a'),[];}}export function getNewCredentialPath(_0x28030c){const _0x5dc169=a48_0x2a59;return a48_0x32d0c6[_0x5dc169(0x15e)](getConfigDir(),_0x5dc169(0x132)+_0x28030c);}function getOldCredentialPath(_0x34a741){const _0xf46c7f=a48_0x2a59;return a48_0x32d0c6[_0xf46c7f(0x15e)](getProfilesDir(),_0x34a741,'.env');}function loadProfilesFromTdxJsonFiles(){const _0x2bce02=a48_0x2a59,_0x41c63d=[],_0x291628=findProjectConfigPath();_0x291628&&_0x41c63d[_0x2bce02(0x154)](...loadProfilesFromTdxJson(_0x291628,'local'));const _0x35fd7a=a48_0x32d0c6[_0x2bce02(0x15e)](getConfigDir(),'tdx.json');return _0x41c63d[_0x2bce02(0x154)](...loadProfilesFromTdxJson(_0x35fd7a,_0x2bce02(0x12a))),_0x41c63d;}function loadProfilesFromDirectories(){const _0x233f2a=a48_0x2a59,_0x40ba1f=getProfilesDir();if(!a48_0xcaeaa6[_0x233f2a(0x15f)](_0x40ba1f))return[];try{return a48_0xcaeaa6[_0x233f2a(0x166)](_0x40ba1f,{'withFileTypes':!![]})[_0x233f2a(0x15a)](_0x275090=>_0x275090[_0x233f2a(0x141)]())[_0x233f2a(0x152)](_0x495d07=>_0x495d07[_0x233f2a(0x169)])[_0x233f2a(0x15a)](_0x49f829=>{const _0x28df03=_0x233f2a,_0x4fa7a8=getProfileConfigPath(_0x49f829),_0x4470c1=getProfileEnvPath(_0x49f829);return a48_0xcaeaa6[_0x28df03(0x15f)](_0x4fa7a8)||a48_0xcaeaa6[_0x28df03(0x15f)](_0x4470c1);})['map'](_0x36cd13=>{const _0x4c316f=_0x233f2a,_0x5c46a7=loadProfileFromDirectory(_0x36cd13);if(_0x5c46a7)return{..._0x5c46a7,'scope':_0x4c316f(0x16b)};return null;})[_0x233f2a(0x15a)](_0x5e2a3a=>_0x5e2a3a!==null);}catch{return[];}}function loadProfileFromDirectory(_0x7b522b){const _0x23db9a=a48_0x2a59,_0x7569d2=getProfileConfigPath(_0x7b522b),_0x2a8ac7=getOldCredentialPath(_0x7b522b);if(!a48_0xcaeaa6[_0x23db9a(0x15f)](_0x7569d2)&&!a48_0xcaeaa6[_0x23db9a(0x15f)](_0x2a8ac7))return null;let _0x4f1b97={},_0x156c06={'name':_0x7b522b,'createdAt':new Date()[_0x23db9a(0x144)]()};if(a48_0xcaeaa6[_0x23db9a(0x15f)](_0x7569d2))try{const _0x3dc826=a48_0xcaeaa6[_0x23db9a(0x156)](_0x7569d2,'utf-8'),_0x24c222=JSON['parse'](_0x3dc826),{metadata:_0x249d1a,..._0x527ad7}=_0x24c222;_0x4f1b97=_0x527ad7,_0x249d1a&&(_0x156c06=_0x249d1a);}catch{}return{'name':_0x7b522b,'config':_0x4f1b97,'metadata':_0x156c06,'hasCredentials':a48_0xcaeaa6['existsSync'](_0x2a8ac7),'scope':'directory'};}export function listProfiles(){const _0x33a8d1=a48_0x2a59,_0x34d90e=loadProfilesFromTdxJsonFiles(),_0x193676=loadProfilesFromDirectories();if(_0x193676['length']>0x0){const _0x3d24d1=_0x193676[_0x33a8d1(0x152)](_0x33c658=>_0x33c658[_0x33a8d1(0x169)])[_0x33a8d1(0x15e)](',\x20'),_0x4992db=getConfigDir();console[_0x33a8d1(0x142)](_0x33a8d1(0x131)+_0x3d24d1),console['warn'](_0x33a8d1(0x121)),console['warn'](_0x33a8d1(0x15c)+a48_0x32d0c6[_0x33a8d1(0x15e)](_0x4992db,'tdx.json')),console[_0x33a8d1(0x142)](_0x33a8d1(0x133)),console['warn']('\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a');}const _0x20cf3e=[..._0x34d90e,..._0x193676],_0x2c4b3a=new Map();for(const _0x4439cb of _0x20cf3e){!_0x2c4b3a[_0x33a8d1(0x145)](_0x4439cb[_0x33a8d1(0x169)])&&_0x2c4b3a[_0x33a8d1(0x146)](_0x4439cb[_0x33a8d1(0x169)],_0x4439cb);}return Array[_0x33a8d1(0x16a)](_0x2c4b3a[_0x33a8d1(0x137)]())[_0x33a8d1(0x124)]((_0x4b49bb,_0x1d9933)=>_0x4b49bb[_0x33a8d1(0x169)][_0x33a8d1(0x136)](_0x1d9933[_0x33a8d1(0x169)]));}export function profileExists(_0x2ab076){const _0x332307=a48_0x2a59,_0x3a3150=listProfiles();return _0x3a3150[_0x332307(0x158)](_0x544bed=>_0x544bed['name']===_0x2ab076);}export function loadProfile(_0x2c1f15){validateProfileName(_0x2c1f15);const _0x32c2c=listProfiles(),_0x29031f=_0x32c2c['find'](_0x2f111c=>_0x2f111c['name']===_0x2c1f15);return _0x29031f||null;}export function saveProfile(_0x93e36f,_0x57e709,_0x11e41f=![]){saveProfileToUserConfig(_0x93e36f,_0x57e709);}export function deleteProfile(_0xfd07f5){const _0x1a8972=a48_0x2a59;validateProfileName(_0xfd07f5);const _0x1af982=getProfileDir(_0xfd07f5);if(!a48_0xcaeaa6[_0x1a8972(0x15f)](_0x1af982))throw new Error(_0x1a8972(0x153)+_0xfd07f5+_0x1a8972(0x12f));a48_0xcaeaa6[_0x1a8972(0x161)](_0x1af982,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x9583d3,_0x55f75d){const _0x1a82d3=a48_0x2a59;validateProfileName(_0x9583d3);const _0x336c25=getGlobalConfigPath(),_0x177392=getConfigDir();!a48_0xcaeaa6[_0x1a82d3(0x15f)](_0x177392)&&createSecureDirectory(_0x177392);let _0x46aeee={};if(a48_0xcaeaa6[_0x1a82d3(0x15f)](_0x336c25))try{const _0x31d57d=a48_0xcaeaa6[_0x1a82d3(0x156)](_0x336c25,_0x1a82d3(0x13f));_0x46aeee=JSON['parse'](_0x31d57d);}catch{console[_0x1a82d3(0x142)](_0x1a82d3(0x16c)+_0x336c25+',\x20creating\x20new\x20file');}!_0x46aeee[_0x1a82d3(0x15b)]&&(_0x46aeee[_0x1a82d3(0x15b)]={}),_0x46aeee[_0x1a82d3(0x15b)][_0x9583d3]=_0x55f75d,writeSecureFile(_0x336c25,JSON[_0x1a82d3(0x147)](_0x46aeee,null,0x2));}export function removeProfileFromUserConfig(_0x68c2b7){const _0x33491f=a48_0x2a59;validateProfileName(_0x68c2b7);const _0x8867=getGlobalConfigPath();if(!a48_0xcaeaa6[_0x33491f(0x15f)](_0x8867))throw new Error(_0x33491f(0x151)+_0x68c2b7+_0x33491f(0x13d));let _0x3eac23={};try{const _0x14de79=a48_0xcaeaa6[_0x33491f(0x156)](_0x8867,_0x33491f(0x13f));_0x3eac23=JSON[_0x33491f(0x12d)](_0x14de79);}catch{throw new Error(_0x33491f(0x160)+_0x8867);}if(!_0x3eac23[_0x33491f(0x15b)]||!_0x3eac23[_0x33491f(0x15b)][_0x68c2b7])throw new Error(_0x33491f(0x151)+_0x68c2b7+_0x33491f(0x13d));delete _0x3eac23[_0x33491f(0x15b)][_0x68c2b7],_0x3eac23[_0x33491f(0x14b)]===_0x68c2b7&&delete _0x3eac23[_0x33491f(0x14b)],writeSecureFile(_0x8867,JSON['stringify'](_0x3eac23,null,0x2));}export function getActiveProfile(){const _0x4ef2f7=a48_0x2a59,_0x212cc6=loadSessionContext();if(_0x212cc6?.[_0x4ef2f7(0x14b)])return _0x212cc6[_0x4ef2f7(0x14b)];if(process['env'][_0x4ef2f7(0x123)])return process['env'][_0x4ef2f7(0x123)];const _0x265062=getGlobalConfigPath();if(!a48_0xcaeaa6[_0x4ef2f7(0x15f)](_0x265062))return null;try{const _0x4ee49e=a48_0xcaeaa6[_0x4ef2f7(0x156)](_0x265062,_0x4ef2f7(0x13f)),_0x245e93=JSON[_0x4ef2f7(0x12d)](_0x4ee49e);return _0x245e93[_0x4ef2f7(0x14b)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x28ecd8){const _0x2d6ccd=a48_0x2a59,_0x4bd589=getGlobalConfigPath(),_0x681749=getConfigDir();!a48_0xcaeaa6[_0x2d6ccd(0x15f)](_0x681749)&&createSecureDirectory(_0x681749);let _0x20b41d={};if(a48_0xcaeaa6[_0x2d6ccd(0x15f)](_0x4bd589))try{const _0x2602d1=a48_0xcaeaa6[_0x2d6ccd(0x156)](_0x4bd589,'utf-8');_0x20b41d=JSON['parse'](_0x2602d1);}catch{console[_0x2d6ccd(0x142)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x4bd589+',\x20creating\x20new\x20file');}_0x20b41d['site']=_0x28ecd8,writeSecureFile(_0x4bd589,JSON['stringify'](_0x20b41d,null,0x2));}export function saveActiveProfileToUserConfig(_0x33fdf5){const _0xa2b0ef=a48_0x2a59;validateProfileName(_0x33fdf5);const _0x3ad104=getGlobalConfigPath(),_0x156c22=getConfigDir();!a48_0xcaeaa6['existsSync'](_0x156c22)&&createSecureDirectory(_0x156c22);let _0x2391fd={};if(a48_0xcaeaa6[_0xa2b0ef(0x15f)](_0x3ad104))try{const _0x5543f3=a48_0xcaeaa6[_0xa2b0ef(0x156)](_0x3ad104,'utf-8');_0x2391fd=JSON[_0xa2b0ef(0x12d)](_0x5543f3);}catch{console[_0xa2b0ef(0x142)](_0xa2b0ef(0x16c)+_0x3ad104+',\x20creating\x20new\x20file');}_0x2391fd[_0xa2b0ef(0x14b)]=_0x33fdf5,writeSecureFile(_0x3ad104,JSON[_0xa2b0ef(0x147)](_0x2391fd,null,0x2));}function clearFieldFromUserConfig(_0x4faa11){const _0x286b79=a48_0x2a59,_0x10f6db=getGlobalConfigPath();if(!a48_0xcaeaa6[_0x286b79(0x15f)](_0x10f6db))return;let _0xff20a2={};try{const _0x40de35=a48_0xcaeaa6[_0x286b79(0x156)](_0x10f6db,'utf-8');_0xff20a2=JSON[_0x286b79(0x12d)](_0x40de35);}catch{return;}delete _0xff20a2[_0x4faa11],writeSecureFile(_0x10f6db,JSON[_0x286b79(0x147)](_0xff20a2,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x3d047a=a48_0x2a59;clearFieldFromUserConfig(_0x3d047a(0x155));}export function clearActiveProfileFromUserConfig(){const _0x181261=a48_0x2a59;clearFieldFromUserConfig(_0x181261(0x14b));}export function createProfile(_0x386f94,_0x3aa367){const _0x52282e=a48_0x2a59;validateProfileName(_0x386f94);if(profileExists(_0x386f94))throw new Error(_0x52282e(0x153)+_0x386f94+'\x20already\x20exists');saveProfile(_0x386f94,_0x3aa367);}export function saveProfileCredentials(_0x1e6586,_0x2ce376){const _0x39ea9f=a48_0x2a59;validateProfileName(_0x1e6586);if(!profileExists(_0x1e6586))throw new Error(_0x39ea9f(0x153)+_0x1e6586+_0x39ea9f(0x12f));const _0x104285=getNewCredentialPath(_0x1e6586);writeSecureFile(_0x104285,_0x2ce376);}export function loadProfileCredentials(_0xd71bca){const _0x165699=a48_0x2a59;validateProfileName(_0xd71bca);const _0x254eb0=getNewCredentialPath(_0xd71bca);if(a48_0xcaeaa6[_0x165699(0x15f)](_0x254eb0))try{return a48_0xcaeaa6['readFileSync'](_0x254eb0,_0x165699(0x13f));}catch{}const _0xbbfb9a=getOldCredentialPath(_0xd71bca);if(a48_0xcaeaa6[_0x165699(0x15f)](_0xbbfb9a)){console[_0x165699(0x142)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0xd71bca+'\x27'),console[_0x165699(0x142)](_0x165699(0x13e)),console['warn'](_0x165699(0x168)+_0xbbfb9a+_0x165699(0x165)+_0x254eb0+'\x22'),console[_0x165699(0x142)](_0x165699(0x143));try{return a48_0xcaeaa6[_0x165699(0x156)](_0xbbfb9a,_0x165699(0x13f));}catch{return null;}}return null;}function a48_0x5d7f(){const _0x20bc77=['site','readFileSync','message','some','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','filter','profiles','\x20\x201.\x20Edit:\x20','llm_agent','join','existsSync','Failed\x20to\x20parse\x20','rmSync','llm_project','string',':\x20Invalid\x20JSON\x20syntax','\x22\x20\x22','readdirSync','parent_segment','\x20\x20mv\x20\x22','name','from','directory','Warning:\x20Failed\x20to\x20parse\x20','test','275121KYBnsp','Warning:\x20Profile\x20\x27','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','\x27:\x20unknown\x20config\x20key\x20\x27','TDX_PROFILE','sort','entries','.env','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','793188LNzJHW','user','1745rQzlXC','8729538BVbxDN','parse','\x0aWarning:\x20Failed\x20to\x20parse\x20','\x20does\x20not\x20exist','Error:\x20','\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)','1802274GnnrKB','includes','localeCompare','values','tdx.json','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','112wOScDk','\x27\x20not\x20found\x20in\x20user\x20configuration','To\x20migrate:','utf-8','description','isDirectory','warn','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','toISOString','has','set','stringify','738905bvKZrJ','\x27\x20will\x20be\x20ignored','31584492WOkrlh','profile','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','4404UPTZgC','database','keys','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','Profile\x20\x27','map','Profile\x20','push'];a48_0x5d7f=function(){return _0x20bc77;};return a48_0x5d7f();}
@@ -1 +1 @@
1
- const a49_0x47c0a0=a49_0x5cc6;(function(_0x35aae7,_0x39b4b3){const _0x3be74a=a49_0x5cc6,_0x248b1d=_0x35aae7();while(!![]){try{const _0x545135=parseInt(_0x3be74a(0xc4))/0x1*(-parseInt(_0x3be74a(0xcf))/0x2)+parseInt(_0x3be74a(0xcd))/0x3+-parseInt(_0x3be74a(0xd1))/0x4+-parseInt(_0x3be74a(0xc3))/0x5+parseInt(_0x3be74a(0xc9))/0x6*(parseInt(_0x3be74a(0xd3))/0x7)+parseInt(_0x3be74a(0xd4))/0x8*(-parseInt(_0x3be74a(0xd6))/0x9)+parseInt(_0x3be74a(0xbd))/0xa;if(_0x545135===_0x39b4b3)break;else _0x248b1d['push'](_0x248b1d['shift']());}catch(_0x8cd4ef){_0x248b1d['push'](_0x248b1d['shift']());}}}(a49_0x80b7,0x27966));import*as a49_0x1f053b from'node:fs';import*as a49_0x3df9b7 from'node:path';function a49_0x5cc6(_0x1c71f9,_0x5f421e){_0x1c71f9=_0x1c71f9-0xba;const _0x80b7a=a49_0x80b7();let _0x5cc6e7=_0x80b7a[_0x1c71f9];return _0x5cc6e7;}const PROJECT_CONFIG_FILENAME=a49_0x47c0a0(0xbc);export function findProjectConfigPath(_0x548ecd){const _0x491789=a49_0x47c0a0;let _0x2972b0=_0x548ecd||process[_0x491789(0xbf)]();while(!![]){const _0x103d02=a49_0x3df9b7[_0x491789(0xc0)](_0x2972b0,PROJECT_CONFIG_FILENAME);if(a49_0x1f053b['existsSync'](_0x103d02))return _0x103d02;const _0x23493e=a49_0x3df9b7[_0x491789(0xbb)](_0x2972b0);if(_0x23493e===_0x2972b0)return null;_0x2972b0=_0x23493e;}}export function loadProjectConfig(_0x32da47){const _0x1d55a5=a49_0x47c0a0,_0x4cb10c=findProjectConfigPath(_0x32da47);if(!_0x4cb10c)return null;try{const _0x143028=a49_0x1f053b['readFileSync'](_0x4cb10c,_0x1d55a5(0xd2)),_0x3a811a=JSON['parse'](_0x143028),_0x2b6d62=JSON[_0x1d55a5(0xba)](_0x3a811a);if(_0x2b6d62[_0x1d55a5(0xc1)](_0x1d55a5(0xd0))||_0x2b6d62[_0x1d55a5(0xc1)]('apiKey')||_0x2b6d62[_0x1d55a5(0xc1)]('api_key'))throw new Error(_0x1d55a5(0xd5)+_0x4cb10c+_0x1d55a5(0xbe)+_0x1d55a5(0xce));const {metadata:_0x5efdb7,profile:_0x30dae8,..._0x4d6fb9}=_0x3a811a;return _0x30dae8&&console[_0x1d55a5(0xc5)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x4cb10c+'\x20is\x20ignored.\x20'+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x4d6fb9;}catch(_0x3c83b5){if(_0x3c83b5 instanceof Error&&'code'in _0x3c83b5&&_0x3c83b5[_0x1d55a5(0xca)]===_0x1d55a5(0xc7))return null;throw new Error(_0x1d55a5(0xc8)+_0x4cb10c+':\x20'+_0x3c83b5);}}function a49_0x80b7(){const _0x5c1dc0=['profile','647270KPKKxE','3IUVYco','warn','apiKey','ENOENT','Failed\x20to\x20load\x20project\x20config\x20from\x20','51186yeGzXB','code','api_key','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','894717IrKrHz','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','138608UeWUFx','TD_API_KEY','406948ZKlCUO','utf-8','56koiRBU','936uDdLrN','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','10188itggGA','stringify','dirname','tdx.json','3672100sHzalb',').\x20','cwd','join','includes'];a49_0x80b7=function(){return _0x5c1dc0;};return a49_0x80b7();}export function saveProjectConfig(_0x323520,_0x27dfcd){const _0x3f164d=a49_0x47c0a0,_0x42f0f2=_0x27dfcd||process[_0x3f164d(0xbf)](),_0x491728=a49_0x3df9b7[_0x3f164d(0xc0)](_0x42f0f2,PROJECT_CONFIG_FILENAME),_0x108119=JSON[_0x3f164d(0xba)](_0x323520);if(_0x108119[_0x3f164d(0xc1)](_0x3f164d(0xd0))||_0x108119[_0x3f164d(0xc1)](_0x3f164d(0xc6))||_0x108119[_0x3f164d(0xc1)](_0x3f164d(0xcb)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x3f164d(0xc2)in _0x323520)throw new Error(_0x3f164d(0xcc));a49_0x1f053b['writeFileSync'](_0x491728,JSON[_0x3f164d(0xba)](_0x323520,null,0x2));}export function hasProjectConfig(_0x1202fe){return findProjectConfigPath(_0x1202fe)!==null;}export function getProjectRoot(_0x3a595d){const _0x2c70b4=a49_0x47c0a0,_0x4b8137=findProjectConfigPath(_0x3a595d);return _0x4b8137?a49_0x3df9b7[_0x2c70b4(0xbb)](_0x4b8137):null;}
1
+ const a49_0x1ce469=a49_0x6965;(function(_0x477a64,_0xb83f6){const _0x13c183=a49_0x6965,_0x2e0a24=_0x477a64();while(!![]){try{const _0x35db17=-parseInt(_0x13c183(0x1b0))/0x1+parseInt(_0x13c183(0x1c2))/0x2*(parseInt(_0x13c183(0x1c8))/0x3)+-parseInt(_0x13c183(0x1af))/0x4*(-parseInt(_0x13c183(0x1be))/0x5)+parseInt(_0x13c183(0x1b5))/0x6+-parseInt(_0x13c183(0x1cc))/0x7+-parseInt(_0x13c183(0x1bc))/0x8*(parseInt(_0x13c183(0x1ac))/0x9)+parseInt(_0x13c183(0x1b8))/0xa;if(_0x35db17===_0xb83f6)break;else _0x2e0a24['push'](_0x2e0a24['shift']());}catch(_0x11e11d){_0x2e0a24['push'](_0x2e0a24['shift']());}}}(a49_0x35c8,0x2f10e));import*as a49_0x54906c from'node:fs';function a49_0x6965(_0x52a9c7,_0x159388){_0x52a9c7=_0x52a9c7-0x1ac;const _0x35c8c2=a49_0x35c8();let _0x6965f4=_0x35c8c2[_0x52a9c7];return _0x6965f4;}import*as a49_0x205b95 from'node:path';const PROJECT_CONFIG_FILENAME=a49_0x1ce469(0x1bb);export function findProjectConfigPath(_0x256f6b){const _0x121929=a49_0x1ce469;let _0x1d98fd=_0x256f6b||process['cwd']();while(!![]){const _0x5569ed=a49_0x205b95[_0x121929(0x1c0)](_0x1d98fd,PROJECT_CONFIG_FILENAME);if(a49_0x54906c['existsSync'](_0x5569ed))return _0x5569ed;const _0x9e8fc4=a49_0x205b95[_0x121929(0x1ad)](_0x1d98fd);if(_0x9e8fc4===_0x1d98fd)return null;_0x1d98fd=_0x9e8fc4;}}export function loadProjectConfig(_0xc6e7fe){const _0x58c615=a49_0x1ce469,_0x13a697=findProjectConfigPath(_0xc6e7fe);if(!_0x13a697)return null;try{const _0x3bb042=a49_0x54906c[_0x58c615(0x1b9)](_0x13a697,_0x58c615(0x1b7)),_0x1338d0=JSON['parse'](_0x3bb042),_0x4de8b8=JSON[_0x58c615(0x1b2)](_0x1338d0);if(_0x4de8b8['includes'](_0x58c615(0x1bd))||_0x4de8b8[_0x58c615(0x1b3)](_0x58c615(0x1cb))||_0x4de8b8[_0x58c615(0x1b3)](_0x58c615(0x1b1)))throw new Error(_0x58c615(0x1c6)+_0x13a697+_0x58c615(0x1c5)+_0x58c615(0x1c1));const {metadata:_0x1ab13b,profile:_0x25a4a6,..._0x240cd1}=_0x1338d0;return _0x25a4a6&&console[_0x58c615(0x1b6)](_0x58c615(0x1ca)+_0x13a697+_0x58c615(0x1ba)+_0x58c615(0x1bf)),_0x240cd1;}catch(_0x20547){if(_0x20547 instanceof Error&&_0x58c615(0x1ae)in _0x20547&&_0x20547['code']==='ENOENT')return null;throw new Error(_0x58c615(0x1c4)+_0x13a697+':\x20'+_0x20547);}}export function saveProjectConfig(_0x42e1b1,_0x38363b){const _0x1450ef=a49_0x1ce469,_0x5b7969=_0x38363b||process[_0x1450ef(0x1c3)](),_0x2562e7=a49_0x205b95['join'](_0x5b7969,PROJECT_CONFIG_FILENAME),_0x50a928=JSON[_0x1450ef(0x1b2)](_0x42e1b1);if(_0x50a928['includes'](_0x1450ef(0x1bd))||_0x50a928['includes'](_0x1450ef(0x1cb))||_0x50a928[_0x1450ef(0x1b3)](_0x1450ef(0x1b1)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x1450ef(0x1c9)in _0x42e1b1)throw new Error(_0x1450ef(0x1b4));a49_0x54906c[_0x1450ef(0x1c7)](_0x2562e7,JSON['stringify'](_0x42e1b1,null,0x2));}function a49_0x35c8(){const _0x23d748=['Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','join','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','10SofWsA','cwd','Failed\x20to\x20load\x20project\x20config\x20from\x20',').\x20','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','writeFileSync','32853NpfToN','profile','Warning:\x20\x27profile\x27\x20field\x20in\x20','apiKey','38094adWqpH','80010SuTOar','dirname','code','66644yOOiiq','357757DDUUkP','api_key','stringify','includes','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','458310QqLYGB','warn','utf-8','5838040IfSSln','readFileSync','\x20is\x20ignored.\x20','tdx.json','248lTSNUF','TD_API_KEY','35oHpJfj'];a49_0x35c8=function(){return _0x23d748;};return a49_0x35c8();}export function hasProjectConfig(_0x225083){return findProjectConfigPath(_0x225083)!==null;}export function getProjectRoot(_0x41a7ab){const _0x1c1481=a49_0x1ce469,_0xa74695=findProjectConfigPath(_0x41a7ab);return _0xa74695?a49_0x205b95[_0x1c1481(0x1ad)](_0xa74695):null;}
@@ -1 +1 @@
1
- (function(_0x2a97fb,_0x319ad4){const _0x226f98=a50_0x3cf5,_0x410e02=_0x2a97fb();while(!![]){try{const _0x1f6a51=parseInt(_0x226f98(0x194))/0x1*(-parseInt(_0x226f98(0x177))/0x2)+-parseInt(_0x226f98(0x181))/0x3*(-parseInt(_0x226f98(0x173))/0x4)+-parseInt(_0x226f98(0x196))/0x5+-parseInt(_0x226f98(0x180))/0x6+parseInt(_0x226f98(0x178))/0x7+-parseInt(_0x226f98(0x17e))/0x8+parseInt(_0x226f98(0x172))/0x9;if(_0x1f6a51===_0x319ad4)break;else _0x410e02['push'](_0x410e02['shift']());}catch(_0x292ee3){_0x410e02['push'](_0x410e02['shift']());}}}(a50_0x2c5d,0x71d5c));function a50_0x3cf5(_0x42d104,_0x2bb55e){_0x42d104=_0x42d104-0x172;const _0x2c5db2=a50_0x2c5d();let _0x3cf565=_0x2c5db2[_0x42d104];return _0x3cf565;}import*as a50_0x3a2e64 from'node:fs';import*as a50_0x1d5915 from'node:path';import*as a50_0x10b39a from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';function a50_0x2c5d(){const _0x52653e=['endsWith','createdAt','TDX_CONFIG_DIR','.json','writeFileSync','unlinkSync','replace','stringify','homedir','api_key','utf-8','includes','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','getTime','join','sort','16221IgrTrh','push','3436965JliqLB','tdx','apiKey','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','8082765OerKvQ','436924IZFycd','TD_API_KEY','env','warn','16YiQXxk','337197NskRPM','existsSync','.\x20This\x20is\x20insecure.\x20Removing\x20session.','toString','parse','now','2080856HQojVU','test','1659408zmdmtH','24mfieHt','readFileSync','toISOString'];a50_0x2c5d=function(){return _0x52653e;};return a50_0x2c5d();}import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x3f20c8=a50_0x3cf5,_0x5ab02c=process[_0x3f20c8(0x175)][_0x3f20c8(0x186)]||a50_0x1d5915[_0x3f20c8(0x192)](a50_0x10b39a[_0x3f20c8(0x18c)](),'.config',_0x3f20c8(0x197));return a50_0x1d5915[_0x3f20c8(0x192)](_0x5ab02c,'sessions');}function getSessionPath(_0x1f2b57){const _0x41f62a=a50_0x3cf5;return a50_0x1d5915[_0x41f62a(0x192)](getSessionsDir(),_0x1f2b57+_0x41f62a(0x187));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x2df3cb){const _0x10db69=a50_0x3cf5;if(_0x2df3cb)return _0x2df3cb;return getCurrentSessionPID()[_0x10db69(0x17b)]();}export function loadSessionContext(_0xc11a69){const _0x2d89ff=_0xc11a69||getCurrentSessionPID()['toString'](),_0x57aef3=/^\d+$/['test'](_0x2d89ff)?parseInt(_0x2d89ff,0xa):null;return _0x57aef3!==null?loadSessionContextByPID(_0x57aef3):loadSessionContextByString(_0x2d89ff);}export function loadSessionContextByPID(_0x223f21){const _0x41c4dc=a50_0x3cf5,_0x492e0e=getSessionPath(_0x223f21);if(!a50_0x3a2e64[_0x41c4dc(0x179)](_0x492e0e))return null;try{const _0x436930=a50_0x3a2e64[_0x41c4dc(0x182)](_0x492e0e,'utf-8'),_0x5bd517=JSON[_0x41c4dc(0x17c)](_0x436930),_0x43fb2e=new Date(_0x5bd517[_0x41c4dc(0x185)])['getTime'](),_0x7106fe=Date[_0x41c4dc(0x17d)]();if(_0x7106fe-_0x43fb2e>SESSION_EXPIRATION_MS)return a50_0x3a2e64[_0x41c4dc(0x189)](_0x492e0e),null;const _0x2541ec=JSON[_0x41c4dc(0x18b)](_0x5bd517);if(_0x2541ec[_0x41c4dc(0x18f)](_0x41c4dc(0x174))||_0x2541ec[_0x41c4dc(0x18f)](_0x41c4dc(0x198))||_0x2541ec[_0x41c4dc(0x18f)](_0x41c4dc(0x18d)))return console[_0x41c4dc(0x176)](_0x41c4dc(0x190)+_0x492e0e+_0x41c4dc(0x17a)),a50_0x3a2e64['unlinkSync'](_0x492e0e),null;return _0x5bd517;}catch{try{a50_0x3a2e64[_0x41c4dc(0x189)](_0x492e0e);}catch{}return null;}}function loadSessionContextByString(_0x486143){const _0x5a3f0d=a50_0x3cf5,_0x535381=a50_0x1d5915['join'](getSessionsDir(),_0x486143+'.json');if(!a50_0x3a2e64[_0x5a3f0d(0x179)](_0x535381))return null;try{const _0x59481c=a50_0x3a2e64[_0x5a3f0d(0x182)](_0x535381,_0x5a3f0d(0x18e)),_0xcf67ce=JSON[_0x5a3f0d(0x17c)](_0x59481c),_0xba7c59=new Date(_0xcf67ce[_0x5a3f0d(0x185)])['getTime'](),_0x5d0d91=Date[_0x5a3f0d(0x17d)]();if(_0x5d0d91-_0xba7c59>SESSION_EXPIRATION_MS)return a50_0x3a2e64[_0x5a3f0d(0x189)](_0x535381),null;const _0x27f2ae=JSON[_0x5a3f0d(0x18b)](_0xcf67ce);if(_0x27f2ae[_0x5a3f0d(0x18f)](_0x5a3f0d(0x174))||_0x27f2ae['includes'](_0x5a3f0d(0x198))||_0x27f2ae[_0x5a3f0d(0x18f)]('api_key'))return console[_0x5a3f0d(0x176)](_0x5a3f0d(0x190)+_0x535381+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a50_0x3a2e64[_0x5a3f0d(0x189)](_0x535381),null;return _0xcf67ce;}catch{try{a50_0x3a2e64[_0x5a3f0d(0x189)](_0x535381);}catch{}return null;}}export function saveSessionContext(_0x3b8169,_0xc579d2){const _0x1d7c4f=a50_0x3cf5,_0x408e11=_0xc579d2||getCurrentSessionPID()['toString'](),_0x200f10=/^\d+$/[_0x1d7c4f(0x17f)](_0x408e11)?parseInt(_0x408e11,0xa):getCurrentSessionPID(),_0xde068c=a50_0x1d5915[_0x1d7c4f(0x192)](getSessionsDir(),_0x408e11+_0x1d7c4f(0x187)),_0xd36a83=getSessionsDir();createSecureDirectory(_0xd36a83);const _0x37bd17=JSON['stringify'](_0x3b8169);if(_0x37bd17[_0x1d7c4f(0x18f)](_0x1d7c4f(0x174))||_0x37bd17[_0x1d7c4f(0x18f)](_0x1d7c4f(0x198))||_0x37bd17[_0x1d7c4f(0x18f)]('api_key'))throw new Error(_0x1d7c4f(0x199));let _0x3f54f8;const _0x160b48=/^\d+$/['test'](_0x408e11)?loadSessionContextByPID(parseInt(_0x408e11,0xa)):loadSessionContextByString(_0x408e11);_0x160b48?_0x3f54f8={..._0x160b48,..._0x3b8169,'pid':_0x200f10,'sessionId':_0x408e11!==_0x200f10[_0x1d7c4f(0x17b)]()?_0x408e11:undefined,'updatedAt':new Date()['toISOString']()}:_0x3f54f8={'pid':_0x200f10,'sessionId':_0x408e11!==_0x200f10['toString']()?_0x408e11:undefined,..._0x3b8169,'createdAt':new Date()[_0x1d7c4f(0x183)](),'updatedAt':new Date()[_0x1d7c4f(0x183)]()},a50_0x3a2e64[_0x1d7c4f(0x188)](_0xde068c,JSON['stringify'](_0x3f54f8,null,0x2));}export function clearSessionContext(_0x959a2c){const _0x38675b=a50_0x3cf5,_0x5d9d0f=_0x959a2c||getCurrentSessionPID()['toString'](),_0x50f068=a50_0x1d5915[_0x38675b(0x192)](getSessionsDir(),_0x5d9d0f+_0x38675b(0x187));a50_0x3a2e64[_0x38675b(0x179)](_0x50f068)&&a50_0x3a2e64[_0x38675b(0x189)](_0x50f068);}export function clearSessionContextField(_0x5ae724,_0x435233){const _0x47154d=a50_0x3cf5,_0x31fb47=_0x435233||getCurrentSessionPID()[_0x47154d(0x17b)](),_0x20ee17=a50_0x1d5915['join'](getSessionsDir(),_0x31fb47+_0x47154d(0x187));if(!a50_0x3a2e64[_0x47154d(0x179)](_0x20ee17))return;try{const _0x1fe9c4=a50_0x3a2e64['readFileSync'](_0x20ee17,_0x47154d(0x18e)),_0xadbdb4=JSON['parse'](_0x1fe9c4);delete _0xadbdb4[_0x5ae724],a50_0x3a2e64[_0x47154d(0x188)](_0x20ee17,JSON[_0x47154d(0x18b)](_0xadbdb4,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x259221=a50_0x3cf5,_0x3b6951=getSessionsDir();if(!a50_0x3a2e64[_0x259221(0x179)](_0x3b6951))return 0x0;let _0x5a3d69=0x0;const _0xdad0a0=Date[_0x259221(0x17d)]();try{const _0x30f317=a50_0x3a2e64['readdirSync'](_0x3b6951);for(const _0x55f026 of _0x30f317){if(!_0x55f026[_0x259221(0x184)](_0x259221(0x187)))continue;const _0x2467fb=a50_0x1d5915['join'](_0x3b6951,_0x55f026),_0x105ba9=_0x55f026[_0x259221(0x18a)](_0x259221(0x187),''),_0x18e5d9=parseInt(_0x105ba9,0xa),_0x46df9e=!isNaN(_0x18e5d9);if(_0x46df9e){if(!isProcessRunning(_0x18e5d9)){a50_0x3a2e64[_0x259221(0x189)](_0x2467fb),_0x5a3d69++;continue;}}try{const _0x1a30bb=a50_0x3a2e64[_0x259221(0x182)](_0x2467fb,_0x259221(0x18e)),_0x4b7563=JSON[_0x259221(0x17c)](_0x1a30bb),_0x3be92b=new Date(_0x4b7563[_0x259221(0x185)])[_0x259221(0x191)]();_0xdad0a0-_0x3be92b>SESSION_EXPIRATION_MS&&(a50_0x3a2e64['unlinkSync'](_0x2467fb),_0x5a3d69++);}catch{a50_0x3a2e64[_0x259221(0x189)](_0x2467fb),_0x5a3d69++;}}}catch{}return _0x5a3d69;}export function listActiveSessions(){const _0x1e9f90=a50_0x3cf5,_0x5c3aad=getSessionsDir();if(!a50_0x3a2e64['existsSync'](_0x5c3aad))return[];try{const _0x6335f9=a50_0x3a2e64['readdirSync'](_0x5c3aad),_0x93970a=[];for(const _0x544021 of _0x6335f9){if(!_0x544021[_0x1e9f90(0x184)]('.json'))continue;const _0x37a2c4=_0x544021[_0x1e9f90(0x18a)]('.json',''),_0x49d115=parseInt(_0x37a2c4,0xa);!isNaN(_0x49d115)&&isProcessRunning(_0x49d115)&&_0x93970a[_0x1e9f90(0x195)](_0x49d115);}return _0x93970a[_0x1e9f90(0x193)]((_0x17a4bb,_0x3f8b36)=>_0x17a4bb-_0x3f8b36);}catch{return[];}}
1
+ (function(_0x49a9a7,_0x16ea5c){const _0x51b65e=a50_0x35c6,_0x8c6d20=_0x49a9a7();while(!![]){try{const _0x3eca99=-parseInt(_0x51b65e(0xb3))/0x1*(parseInt(_0x51b65e(0xca))/0x2)+-parseInt(_0x51b65e(0xc6))/0x3*(parseInt(_0x51b65e(0xae))/0x4)+-parseInt(_0x51b65e(0x9d))/0x5*(-parseInt(_0x51b65e(0xcb))/0x6)+-parseInt(_0x51b65e(0xa6))/0x7*(-parseInt(_0x51b65e(0xc8))/0x8)+-parseInt(_0x51b65e(0xbe))/0x9*(parseInt(_0x51b65e(0xb4))/0xa)+parseInt(_0x51b65e(0xac))/0xb*(parseInt(_0x51b65e(0xbb))/0xc)+parseInt(_0x51b65e(0xa0))/0xd*(parseInt(_0x51b65e(0xa1))/0xe);if(_0x3eca99===_0x16ea5c)break;else _0x8c6d20['push'](_0x8c6d20['shift']());}catch(_0x2c9866){_0x8c6d20['push'](_0x8c6d20['shift']());}}}(a50_0x1dcd,0x65f96));import*as a50_0xea8b14 from'node:fs';import*as a50_0xa8b604 from'node:path';function a50_0x35c6(_0x8a952d,_0x5c3da2){_0x8a952d=_0x8a952d-0x9d;const _0x1dcd21=a50_0x1dcd();let _0x35c6a8=_0x1dcd21[_0x8a952d];return _0x35c6a8;}import*as a50_0x1db173 from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x163eda=a50_0x35c6,_0x158ba6=process[_0x163eda(0xc9)][_0x163eda(0x9f)]||a50_0xa8b604[_0x163eda(0xb2)](a50_0x1db173[_0x163eda(0xb6)](),_0x163eda(0xb9),_0x163eda(0xb8));return a50_0xa8b604[_0x163eda(0xb2)](_0x158ba6,_0x163eda(0xab));}function getSessionPath(_0x490d01){const _0x3a3a4b=a50_0x35c6;return a50_0xa8b604[_0x3a3a4b(0xb2)](getSessionsDir(),_0x490d01+_0x3a3a4b(0xaf));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x266764){const _0x3167e8=a50_0x35c6;if(_0x266764)return _0x266764;return getCurrentSessionPID()[_0x3167e8(0xa2)]();}export function loadSessionContext(_0x22bf48){const _0x99803f=a50_0x35c6,_0x57d6e8=_0x22bf48||getCurrentSessionPID()[_0x99803f(0xa2)](),_0x4ae994=/^\d+$/[_0x99803f(0xad)](_0x57d6e8)?parseInt(_0x57d6e8,0xa):null;return _0x4ae994!==null?loadSessionContextByPID(_0x4ae994):loadSessionContextByString(_0x57d6e8);}export function loadSessionContextByPID(_0x4245e9){const _0x259ade=a50_0x35c6,_0x11dd78=getSessionPath(_0x4245e9);if(!a50_0xea8b14[_0x259ade(0xa7)](_0x11dd78))return null;try{const _0x446646=a50_0xea8b14[_0x259ade(0xb1)](_0x11dd78,_0x259ade(0xbc)),_0x44e463=JSON['parse'](_0x446646),_0x150377=new Date(_0x44e463[_0x259ade(0xbf)])[_0x259ade(0xc2)](),_0x485622=Date['now']();if(_0x485622-_0x150377>SESSION_EXPIRATION_MS)return a50_0xea8b14[_0x259ade(0xc5)](_0x11dd78),null;const _0x571c06=JSON[_0x259ade(0xbd)](_0x44e463);if(_0x571c06['includes'](_0x259ade(0xc4))||_0x571c06[_0x259ade(0xcc)](_0x259ade(0xaa))||_0x571c06[_0x259ade(0xcc)]('api_key'))return console['warn'](_0x259ade(0xc0)+_0x11dd78+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a50_0xea8b14['unlinkSync'](_0x11dd78),null;return _0x44e463;}catch{try{a50_0xea8b14['unlinkSync'](_0x11dd78);}catch{}return null;}}function loadSessionContextByString(_0x532c97){const _0x3a6c48=a50_0x35c6,_0x3bbccd=a50_0xa8b604['join'](getSessionsDir(),_0x532c97+_0x3a6c48(0xaf));if(!a50_0xea8b14[_0x3a6c48(0xa7)](_0x3bbccd))return null;try{const _0xdc1f83=a50_0xea8b14[_0x3a6c48(0xb1)](_0x3bbccd,_0x3a6c48(0xbc)),_0x3b2174=JSON[_0x3a6c48(0xc7)](_0xdc1f83),_0x5f3326=new Date(_0x3b2174[_0x3a6c48(0xbf)])[_0x3a6c48(0xc2)](),_0x3f4e2b=Date[_0x3a6c48(0x9e)]();if(_0x3f4e2b-_0x5f3326>SESSION_EXPIRATION_MS)return a50_0xea8b14['unlinkSync'](_0x3bbccd),null;const _0x8967b7=JSON[_0x3a6c48(0xbd)](_0x3b2174);if(_0x8967b7[_0x3a6c48(0xcc)](_0x3a6c48(0xc4))||_0x8967b7['includes'](_0x3a6c48(0xaa))||_0x8967b7[_0x3a6c48(0xcc)](_0x3a6c48(0xc1)))return console[_0x3a6c48(0xa9)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x3bbccd+_0x3a6c48(0xc3)),a50_0xea8b14['unlinkSync'](_0x3bbccd),null;return _0x3b2174;}catch{try{a50_0xea8b14['unlinkSync'](_0x3bbccd);}catch{}return null;}}export function saveSessionContext(_0x5b96e7,_0x1a20d3){const _0x518e5e=a50_0x35c6,_0x5125b6=_0x1a20d3||getCurrentSessionPID()['toString'](),_0x458729=/^\d+$/['test'](_0x5125b6)?parseInt(_0x5125b6,0xa):getCurrentSessionPID(),_0x50e0b6=a50_0xa8b604['join'](getSessionsDir(),_0x5125b6+_0x518e5e(0xaf)),_0x2b200b=getSessionsDir();createSecureDirectory(_0x2b200b);const _0x3651dd=JSON['stringify'](_0x5b96e7);if(_0x3651dd[_0x518e5e(0xcc)](_0x518e5e(0xc4))||_0x3651dd[_0x518e5e(0xcc)]('apiKey')||_0x3651dd[_0x518e5e(0xcc)](_0x518e5e(0xc1)))throw new Error(_0x518e5e(0xb7));let _0x236d5e;const _0x417e6e=/^\d+$/['test'](_0x5125b6)?loadSessionContextByPID(parseInt(_0x5125b6,0xa)):loadSessionContextByString(_0x5125b6);_0x417e6e?_0x236d5e={..._0x417e6e,..._0x5b96e7,'pid':_0x458729,'sessionId':_0x5125b6!==_0x458729[_0x518e5e(0xa2)]()?_0x5125b6:undefined,'updatedAt':new Date()[_0x518e5e(0xa5)]()}:_0x236d5e={'pid':_0x458729,'sessionId':_0x5125b6!==_0x458729[_0x518e5e(0xa2)]()?_0x5125b6:undefined,..._0x5b96e7,'createdAt':new Date()[_0x518e5e(0xa5)](),'updatedAt':new Date()[_0x518e5e(0xa5)]()},a50_0xea8b14[_0x518e5e(0xba)](_0x50e0b6,JSON[_0x518e5e(0xbd)](_0x236d5e,null,0x2));}export function clearSessionContext(_0x22dcbb){const _0x43ed00=a50_0x35c6,_0x1f0724=_0x22dcbb||getCurrentSessionPID()[_0x43ed00(0xa2)](),_0xe15ace=a50_0xa8b604[_0x43ed00(0xb2)](getSessionsDir(),_0x1f0724+_0x43ed00(0xaf));a50_0xea8b14['existsSync'](_0xe15ace)&&a50_0xea8b14['unlinkSync'](_0xe15ace);}export function clearSessionContextField(_0x55ee26,_0x2b83b6){const _0x4f2df2=a50_0x35c6,_0x14ba34=_0x2b83b6||getCurrentSessionPID()[_0x4f2df2(0xa2)](),_0x483ff5=a50_0xa8b604['join'](getSessionsDir(),_0x14ba34+'.json');if(!a50_0xea8b14[_0x4f2df2(0xa7)](_0x483ff5))return;try{const _0x99bbc1=a50_0xea8b14[_0x4f2df2(0xb1)](_0x483ff5,'utf-8'),_0x12f1ab=JSON['parse'](_0x99bbc1);delete _0x12f1ab[_0x55ee26],a50_0xea8b14[_0x4f2df2(0xba)](_0x483ff5,JSON['stringify'](_0x12f1ab,null,0x2));}catch{}}function a50_0x1dcd(){const _0x4481ca=['getTime','.\x20This\x20is\x20insecure.\x20Removing\x20session.','TD_API_KEY','unlinkSync','309qyFBRi','parse','1157720wcRrBn','env','2pXqWdv','42LusmbG','includes','461870CBZnDA','now','TDX_CONFIG_DIR','1157ByAFIY','37254WIgNkr','toString','push','replace','toISOString','28JOzeOB','existsSync','sort','warn','apiKey','sessions','154egAgYg','test','13460QcrtWy','.json','readdirSync','readFileSync','join','811477gmbccx','42950VANSRS','endsWith','homedir','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','tdx','.config','writeFileSync','675228Hkagcc','utf-8','stringify','1413cxhSYl','createdAt','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','api_key'];a50_0x1dcd=function(){return _0x4481ca;};return a50_0x1dcd();}export function cleanExpiredSessions(){const _0x1af476=a50_0x35c6,_0x3b30ec=getSessionsDir();if(!a50_0xea8b14[_0x1af476(0xa7)](_0x3b30ec))return 0x0;let _0x2ef26f=0x0;const _0x248b07=Date[_0x1af476(0x9e)]();try{const _0x30c3cd=a50_0xea8b14[_0x1af476(0xb0)](_0x3b30ec);for(const _0x278129 of _0x30c3cd){if(!_0x278129[_0x1af476(0xb5)](_0x1af476(0xaf)))continue;const _0x26c234=a50_0xa8b604['join'](_0x3b30ec,_0x278129),_0x474de1=_0x278129[_0x1af476(0xa4)](_0x1af476(0xaf),''),_0x4312f8=parseInt(_0x474de1,0xa),_0x1b3f3d=!isNaN(_0x4312f8);if(_0x1b3f3d){if(!isProcessRunning(_0x4312f8)){a50_0xea8b14['unlinkSync'](_0x26c234),_0x2ef26f++;continue;}}try{const _0x6216d=a50_0xea8b14['readFileSync'](_0x26c234,'utf-8'),_0x4aad3b=JSON['parse'](_0x6216d),_0x983db2=new Date(_0x4aad3b[_0x1af476(0xbf)])[_0x1af476(0xc2)]();_0x248b07-_0x983db2>SESSION_EXPIRATION_MS&&(a50_0xea8b14[_0x1af476(0xc5)](_0x26c234),_0x2ef26f++);}catch{a50_0xea8b14['unlinkSync'](_0x26c234),_0x2ef26f++;}}}catch{}return _0x2ef26f;}export function listActiveSessions(){const _0x4a93cd=a50_0x35c6,_0x2e2507=getSessionsDir();if(!a50_0xea8b14['existsSync'](_0x2e2507))return[];try{const _0x328a68=a50_0xea8b14[_0x4a93cd(0xb0)](_0x2e2507),_0x5bdfba=[];for(const _0xaf08b5 of _0x328a68){if(!_0xaf08b5[_0x4a93cd(0xb5)](_0x4a93cd(0xaf)))continue;const _0x5d2502=_0xaf08b5[_0x4a93cd(0xa4)](_0x4a93cd(0xaf),''),_0x11ba04=parseInt(_0x5d2502,0xa);!isNaN(_0x11ba04)&&isProcessRunning(_0x11ba04)&&_0x5bdfba[_0x4a93cd(0xa3)](_0x11ba04);}return _0x5bdfba[_0x4a93cd(0xa8)]((_0x36d620,_0x2824e6)=>_0x36d620-_0x2824e6);}catch{return[];}}
@@ -1 +1 @@
1
- (function(_0x89eaa7,_0x1483e0){const _0x1a1a1f=a51_0x130f,_0x33ee5a=_0x89eaa7();while(!![]){try{const _0x11cc42=parseInt(_0x1a1a1f(0x1d3))/0x1+-parseInt(_0x1a1a1f(0x1cf))/0x2+-parseInt(_0x1a1a1f(0x1cb))/0x3*(parseInt(_0x1a1a1f(0x1ce))/0x4)+-parseInt(_0x1a1a1f(0x1d2))/0x5+parseInt(_0x1a1a1f(0x1d0))/0x6*(parseInt(_0x1a1a1f(0x1cc))/0x7)+parseInt(_0x1a1a1f(0x1d7))/0x8+-parseInt(_0x1a1a1f(0x1ca))/0x9*(parseInt(_0x1a1a1f(0x1d1))/0xa);if(_0x11cc42===_0x1483e0)break;else _0x33ee5a['push'](_0x33ee5a['shift']());}catch(_0x2e0289){_0x33ee5a['push'](_0x33ee5a['shift']());}}}(a51_0x4796,0x26d70));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';function a51_0x130f(_0x4eb861,_0x4b80ca){_0x4eb861=_0x4eb861-0x1ca;const _0x47968f=a51_0x4796();let _0x130fee=_0x47968f[_0x4eb861];return _0x130fee;}import{join}from'path';import{getCacheDir}from'./config.js';function a51_0x4796(){const _0x20a357=['.json','1838400Aaqaec','18jPAjda','27aueVcj','7ebsnlr','default','58856OLtRzp','113008JGKHVR','1897278Ecfecd','1673140MuVDBx','809960VBWrEG','298625uvAGNJ','users','utf-8'];a51_0x4796=function(){return _0x20a357;};return a51_0x4796();}function getCacheFilePath(_0x5a842e){const _0x40f37d=a51_0x130f,_0x219402=_0x5a842e||_0x40f37d(0x1cd);return join(getCacheDir(),'users-'+_0x219402+_0x40f37d(0x1d6));}export function loadCachedUsers(_0x34788d){const _0x55bb39=a51_0x130f,_0x446946=getCacheFilePath(_0x34788d);if(!existsSync(_0x446946))return null;try{const _0x403b12=readFileSync(_0x446946,_0x55bb39(0x1d5)),_0x58941c=JSON['parse'](_0x403b12);return _0x58941c[_0x55bb39(0x1d4)];}catch{return null;}}export function saveCachedUsers(_0x417012,_0x1f11f2){const _0x58107e=a51_0x130f,_0x915d2b=getCacheDir();!existsSync(_0x915d2b)&&mkdirSync(_0x915d2b,{'recursive':!![]});const _0x2dbf48=getCacheFilePath(_0x417012),_0x345669={'users':_0x1f11f2,'cachedAt':Date['now']()};writeFileSync(_0x2dbf48,JSON['stringify'](_0x345669,null,0x2),_0x58107e(0x1d5));}export function clearUserCache(_0x45e569){const _0x1d223a=getCacheFilePath(_0x45e569);if(existsSync(_0x1d223a))try{unlinkSync(_0x1d223a);}catch{}}
1
+ (function(_0x28a39f,_0x41333d){const _0x42c5c0=a51_0x173d,_0x24816b=_0x28a39f();while(!![]){try{const _0x5da1aa=parseInt(_0x42c5c0(0x1f1))/0x1*(parseInt(_0x42c5c0(0x1f5))/0x2)+-parseInt(_0x42c5c0(0x1f8))/0x3+-parseInt(_0x42c5c0(0x1f9))/0x4+parseInt(_0x42c5c0(0x1ee))/0x5*(parseInt(_0x42c5c0(0x1f2))/0x6)+parseInt(_0x42c5c0(0x1fb))/0x7+-parseInt(_0x42c5c0(0x1f0))/0x8*(parseInt(_0x42c5c0(0x1f3))/0x9)+parseInt(_0x42c5c0(0x1fa))/0xa*(parseInt(_0x42c5c0(0x1fd))/0xb);if(_0x5da1aa===_0x41333d)break;else _0x24816b['push'](_0x24816b['shift']());}catch(_0x5a2cea){_0x24816b['push'](_0x24816b['shift']());}}}(a51_0x5a7d,0x68d94));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';function a51_0x173d(_0x1a0b07,_0x1f9c99){_0x1a0b07=_0x1a0b07-0x1ee;const _0x5a7d14=a51_0x5a7d();let _0x173d03=_0x5a7d14[_0x1a0b07];return _0x173d03;}import{getCacheDir}from'./config.js';function getCacheFilePath(_0x5d123d){const _0x24b15c=a51_0x173d,_0x15bd0f=_0x5d123d||_0x24b15c(0x1f7);return join(getCacheDir(),'users-'+_0x15bd0f+_0x24b15c(0x1fc));}export function loadCachedUsers(_0x3db73b){const _0xbee9dc=a51_0x173d,_0x3f0cab=getCacheFilePath(_0x3db73b);if(!existsSync(_0x3f0cab))return null;try{const _0x1a9240=readFileSync(_0x3f0cab,_0xbee9dc(0x1ef)),_0xc4c02d=JSON[_0xbee9dc(0x1f6)](_0x1a9240);return _0xc4c02d['users'];}catch{return null;}}export function saveCachedUsers(_0x152fbd,_0x120cbb){const _0x2671b1=a51_0x173d,_0x4155df=getCacheDir();!existsSync(_0x4155df)&&mkdirSync(_0x4155df,{'recursive':!![]});const _0x4e135b=getCacheFilePath(_0x152fbd),_0x4deceb={'users':_0x120cbb,'cachedAt':Date[_0x2671b1(0x1f4)]()};writeFileSync(_0x4e135b,JSON['stringify'](_0x4deceb,null,0x2),_0x2671b1(0x1ef));}function a51_0x5a7d(){const _0xedcdc3=['parse','default','1480041LWyNyY','2690564YlalHX','430Qnqebs','1697745GAWcCQ','.json','207559UMtRDb','3335blzTEG','utf-8','371144JuePOg','5IaBSLe','6114UXRaHR','36xNoZIz','now','18978iQqDwG'];a51_0x5a7d=function(){return _0xedcdc3;};return a51_0x5a7d();}export function clearUserCache(_0x48f518){const _0x48bc13=getCacheFilePath(_0x48f518);if(existsSync(_0x48bc13))try{unlinkSync(_0x48bc13);}catch{}}
@@ -1 +1 @@
1
- function a52_0x3cf1(){const _0x47ada2=['0.0.0','117482AEmwiL','utf-8','782523OKxVSC','40019brljoN','336000nFqnkg','version','../../package.json','includes','6SksxjJ','3Mcejyl','1074815BcMrBs','8140680KRCgEz','565484WxLmUo','488XVnOLz','parse','.dev'];a52_0x3cf1=function(){return _0x47ada2;};return a52_0x3cf1();}(function(_0x5473e6,_0xa54ae9){const _0x2488e4=a52_0x36e3,_0x565299=_0x5473e6();while(!![]){try{const _0xe1e70e=-parseInt(_0x2488e4(0x111))/0x1+parseInt(_0x2488e4(0x10d))/0x2*(parseInt(_0x2488e4(0x116))/0x3)+-parseInt(_0x2488e4(0x119))/0x4+parseInt(_0x2488e4(0x117))/0x5*(parseInt(_0x2488e4(0x115))/0x6)+parseInt(_0x2488e4(0x110))/0x7*(-parseInt(_0x2488e4(0x11a))/0x8)+-parseInt(_0x2488e4(0x10f))/0x9+parseInt(_0x2488e4(0x118))/0xa;if(_0xe1e70e===_0xa54ae9)break;else _0x565299['push'](_0x565299['shift']());}catch(_0x1bdef6){_0x565299['push'](_0x565299['shift']());}}}(a52_0x3cf1,0x2aa7d));import{readFileSync}from'fs';import{fileURLToPath}from'url';function a52_0x36e3(_0x7fb13c,_0x3ef7cd){_0x7fb13c=_0x7fb13c-0x10c;const _0x3cf1aa=a52_0x3cf1();let _0x36e337=_0x3cf1aa[_0x7fb13c];return _0x36e337;}import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x3edd8a=a52_0x36e3;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x2230e1=fileURLToPath(import.meta.url),_0x5181e5=dirname(_0x2230e1);try{const _0x398067=join(_0x5181e5,'../build-info.json');cachedBuildInfo=JSON[_0x3edd8a(0x11b)](readFileSync(_0x398067,_0x3edd8a(0x10e)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x21f986=a52_0x36e3;if(cachedVersion!==null)return cachedVersion;const _0x5c2748=fileURLToPath(import.meta.url),_0x42661e=dirname(_0x5c2748),_0x52c6e5=getBuildInfo();if(_0x52c6e5[_0x21f986(0x112)])return cachedVersion=_0x52c6e5[_0x21f986(0x112)],cachedVersion;try{const _0x46bb8f=join(_0x42661e,_0x21f986(0x113)),_0x176371=JSON['parse'](readFileSync(_0x46bb8f,'utf-8'));cachedVersion=_0x176371['version'];}catch{cachedVersion=_0x21f986(0x10c);}return cachedVersion;}export function isDevVersion(){const _0x47174b=a52_0x36e3,_0xee786d=getVersion();return _0xee786d[_0x47174b(0x114)](_0x47174b(0x11c))||_0xee786d[_0x47174b(0x114)]('-');}
1
+ function a52_0x43da(){const _0x1ac2d8=['33MMtOkw','5NWWEcK','579ovcDea','utf-8','9076FujwrC','6IKxvzN','4863416bvRGbo','../build-info.json','includes','6529860tdBNzA','1314970gvZnyt','parse','3166226AiIoxD','158144oJGHOq','4950486lOEits','version','0.0.0'];a52_0x43da=function(){return _0x1ac2d8;};return a52_0x43da();}(function(_0x16b6aa,_0x8f2754){const _0x590d58=a52_0x32d9,_0x41a33d=_0x16b6aa();while(!![]){try{const _0x11d6ef=parseInt(_0x590d58(0x178))/0x1*(parseInt(_0x590d58(0x170))/0x2)+-parseInt(_0x590d58(0x16d))/0x3*(parseInt(_0x590d58(0x16f))/0x4)+parseInt(_0x590d58(0x16c))/0x5*(-parseInt(_0x590d58(0x179))/0x6)+-parseInt(_0x590d58(0x177))/0x7+parseInt(_0x590d58(0x171))/0x8+parseInt(_0x590d58(0x174))/0x9+-parseInt(_0x590d58(0x175))/0xa*(-parseInt(_0x590d58(0x16b))/0xb);if(_0x11d6ef===_0x8f2754)break;else _0x41a33d['push'](_0x41a33d['shift']());}catch(_0xdde78f){_0x41a33d['push'](_0x41a33d['shift']());}}}(a52_0x43da,0x76ea2));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x4abaae=a52_0x32d9;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x1545d5=fileURLToPath(import.meta.url),_0x120e20=dirname(_0x1545d5);try{const _0x59ed2d=join(_0x120e20,_0x4abaae(0x172));cachedBuildInfo=JSON[_0x4abaae(0x176)](readFileSync(_0x59ed2d,_0x4abaae(0x16e)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x593398=a52_0x32d9;if(cachedVersion!==null)return cachedVersion;const _0x598146=fileURLToPath(import.meta.url),_0x12c8c3=dirname(_0x598146),_0x1d9945=getBuildInfo();if(_0x1d9945['version'])return cachedVersion=_0x1d9945[_0x593398(0x169)],cachedVersion;try{const _0x20070c=join(_0x12c8c3,'../../package.json'),_0x8712c=JSON[_0x593398(0x176)](readFileSync(_0x20070c,'utf-8'));cachedVersion=_0x8712c['version'];}catch{cachedVersion=_0x593398(0x16a);}return cachedVersion;}function a52_0x32d9(_0x3fefe8,_0x57383e){_0x3fefe8=_0x3fefe8-0x169;const _0x43da71=a52_0x43da();let _0x32d95d=_0x43da71[_0x3fefe8];return _0x32d95d;}export function isDevVersion(){const _0x286fd7=a52_0x32d9,_0x194b80=getVersion();return _0x194b80[_0x286fd7(0x173)]('.dev')||_0x194b80[_0x286fd7(0x173)]('-');}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0x416e47,_0x201d9c){var _0x4e433c=a53_0x353a,_0x349bb1=_0x416e47();while(!![]){try{var _0x4ee582=-parseInt(_0x4e433c(0x92))/0x1+-parseInt(_0x4e433c(0x8e))/0x2*(parseInt(_0x4e433c(0x8a))/0x3)+-parseInt(_0x4e433c(0x89))/0x4*(parseInt(_0x4e433c(0x8f))/0x5)+parseInt(_0x4e433c(0x88))/0x6*(parseInt(_0x4e433c(0x8d))/0x7)+-parseInt(_0x4e433c(0x90))/0x8*(parseInt(_0x4e433c(0x93))/0x9)+parseInt(_0x4e433c(0x8b))/0xa*(-parseInt(_0x4e433c(0x8c))/0xb)+parseInt(_0x4e433c(0x91))/0xc;if(_0x4ee582===_0x201d9c)break;else _0x349bb1['push'](_0x349bb1['shift']());}catch(_0x4e297b){_0x349bb1['push'](_0x349bb1['shift']());}}}(a53_0x3816,0x2c735));export*from'./sdk/types/index.js';function a53_0x353a(_0x23ebd7,_0x1efdfb){_0x23ebd7=_0x23ebd7-0x88;var _0x381663=a53_0x3816();var _0x353a51=_0x381663[_0x23ebd7];return _0x353a51;}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';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';function a53_0x3816(){var _0x3f7eba=['515IZNsHX','10744KnSaCZ','7630608HXBNGm','295500fDSRvS','342siKPNH','24XEuBGh','8728MMZxAg','9TsoZRn','110710RYYvwM','143PdOjuK','604240bLgcgv','55928ZIukKg'];a53_0x3816=function(){return _0x3f7eba;};return a53_0x3816();}export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
1
+ (function(_0x59f769,_0x5a3f25){var _0x318fa1=a53_0x58a1,_0x2e88cb=_0x59f769();while(!![]){try{var _0x56e660=-parseInt(_0x318fa1(0x86))/0x1+parseInt(_0x318fa1(0x88))/0x2+parseInt(_0x318fa1(0x85))/0x3*(-parseInt(_0x318fa1(0x81))/0x4)+parseInt(_0x318fa1(0x80))/0x5+-parseInt(_0x318fa1(0x87))/0x6+-parseInt(_0x318fa1(0x83))/0x7*(-parseInt(_0x318fa1(0x84))/0x8)+parseInt(_0x318fa1(0x82))/0x9;if(_0x56e660===_0x5a3f25)break;else _0x2e88cb['push'](_0x2e88cb['shift']());}catch(_0x47b827){_0x2e88cb['push'](_0x2e88cb['shift']());}}}(a53_0xb717,0x935fc));export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';function a53_0xb717(){var _0x529c23=['84lWDXBn','6714576uYIANI','63931ZGhHYt','112utPdQS','65361QZObxm','867482eNUXgU','4092138NVrhYL','2249426mCepsF','3060185iKbTVL'];a53_0xb717=function(){return _0x529c23;};return a53_0xb717();}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';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';function a53_0x58a1(_0x5d9fc8,_0x18a1da){_0x5d9fc8=_0x5d9fc8-0x80;var _0xb717a2=a53_0xb717();var _0x58a1f2=_0xb717a2[_0x5d9fc8];return _0x58a1f2;}export*from'./sdk/index.js';