@treasuredata/tdx 0.14.8 → 0.14.9

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 (144) hide show
  1. package/README.md +21 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/segment-command.js +1 -1
  29. package/dist/commands/segment-create-command.js +1 -1
  30. package/dist/commands/segment-fields-command.js +1 -1
  31. package/dist/commands/segment-pull-command.js +1 -1
  32. package/dist/commands/segment-push-command.js +1 -1
  33. package/dist/commands/segment-update-command.js +1 -1
  34. package/dist/commands/segment-use-command.js +1 -1
  35. package/dist/commands/segment-validate-command.js +1 -1
  36. package/dist/commands/segments.js +1 -1
  37. package/dist/commands/show.js +1 -1
  38. package/dist/commands/tables.js +1 -1
  39. package/dist/commands/unset-command.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.js +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/command-output.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/connection-cache.js +1 -1
  47. package/dist/core/constants.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.js +1 -1
  52. package/dist/core/project-config.js +1 -1
  53. package/dist/core/session.js +1 -1
  54. package/dist/core/user-cache.js +1 -1
  55. package/dist/core/version.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/proxy/anthropic-adapter.js +1 -1
  58. package/dist/proxy/claude-usage-tracker.js +1 -1
  59. package/dist/proxy/context-signature.js +1 -1
  60. package/dist/proxy/conversation-utils.js +1 -1
  61. package/dist/proxy/passthrough-server.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/proxy/sse-usage-parser.js +1 -1
  65. package/dist/sdk/agent/agent-config.js +1 -1
  66. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  67. package/dist/sdk/agent/agent-yaml.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/client/cdp-api-client.js +1 -1
  70. package/dist/sdk/client/endpoints.js +1 -1
  71. package/dist/sdk/client/engage-api-client.js +1 -1
  72. package/dist/sdk/client/http-client.js +1 -1
  73. package/dist/sdk/client/llm-api-client.js +1 -1
  74. package/dist/sdk/client/rate-limiter.js +1 -1
  75. package/dist/sdk/client/td-api-client.js +1 -1
  76. package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
  77. package/dist/sdk/client/trino-api-client.js +1 -1
  78. package/dist/sdk/client/trino-api-client.js.map +1 -1
  79. package/dist/sdk/client/workflow-client.js +1 -1
  80. package/dist/sdk/connection-validator.js +1 -1
  81. package/dist/sdk/connection.js +1 -1
  82. package/dist/sdk/engage.js +1 -1
  83. package/dist/sdk/errors.js +1 -1
  84. package/dist/sdk/index.js +1 -1
  85. package/dist/sdk/io/index.js +1 -1
  86. package/dist/sdk/io/node-filesystem.js +1 -1
  87. package/dist/sdk/job.js +1 -1
  88. package/dist/sdk/journey.js +1 -1
  89. package/dist/sdk/llm/chat-cache.js +1 -1
  90. package/dist/sdk/llm/index.js +1 -1
  91. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  92. package/dist/sdk/llm/model-aliases.js +1 -1
  93. package/dist/sdk/llm/model-factors.js +1 -1
  94. package/dist/sdk/query/index.js +1 -1
  95. package/dist/sdk/query/sql-parser.js +1 -1
  96. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  97. package/dist/sdk/segment/fields-display.js +1 -1
  98. package/dist/sdk/segment/file-discovery.js +1 -1
  99. package/dist/sdk/segment/journey-utils.js +1 -1
  100. package/dist/sdk/segment/journey-yaml.js +1 -1
  101. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  102. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  103. package/dist/sdk/segment/pull-workflow.js +1 -1
  104. package/dist/sdk/segment/push-workflow.js +1 -1
  105. package/dist/sdk/segment/resolution-context.js +1 -1
  106. package/dist/sdk/segment/segment-path-parser.js +1 -1
  107. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  108. package/dist/sdk/segment/target-resolution.js +1 -1
  109. package/dist/sdk/segment/tdx-config.js +1 -1
  110. package/dist/sdk/segment/validate-files.js +1 -1
  111. package/dist/sdk/segment/yaml-validator.js +1 -1
  112. package/dist/sdk/segment.js +1 -1
  113. package/dist/sdk/types/index.js +1 -1
  114. package/dist/sdk/types/progress.js +1 -1
  115. package/dist/sdk/user.js +1 -1
  116. package/dist/sdk/util/format-detector.js +1 -1
  117. package/dist/sdk/util/formatters.js +1 -1
  118. package/dist/sdk/util/index.js +1 -1
  119. package/dist/sdk/util/tree-formatter.js +1 -1
  120. package/dist/sdk/workflow/clone-workflow.js +1 -1
  121. package/dist/sdk/workflow/index.js +1 -1
  122. package/dist/sdk/workflow/pull-workflow.js +1 -1
  123. package/dist/sdk/workflow/push-workflow.js +1 -1
  124. package/dist/sdk/workflow/tdx-config.js +1 -1
  125. package/dist/sdk/workflow/workflow-utils.js +1 -1
  126. package/dist/utils/async.js +1 -1
  127. package/dist/utils/colors.d.ts +2 -1
  128. package/dist/utils/colors.d.ts.map +1 -1
  129. package/dist/utils/colors.js +1 -1
  130. package/dist/utils/colors.js.map +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.js +1 -1
  137. package/dist/utils/prompt.js +1 -1
  138. package/dist/utils/spinner.js +1 -1
  139. package/dist/utils/sse-parser.js +1 -1
  140. package/dist/utils/string-utils.js +1 -1
  141. package/dist/utils/table-ref-parser.js +1 -1
  142. package/dist/utils/tdx-logger.js +1 -1
  143. package/dist/utils/version-check.js +1 -1
  144. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x346469,_0x2734fc){const _0x31e383=a42_0x59ca,_0x5e4657=_0x346469();while(!![]){try{const _0x6c7227=-parseInt(_0x31e383(0x117))/0x1+parseInt(_0x31e383(0x10b))/0x2+-parseInt(_0x31e383(0x130))/0x3+parseInt(_0x31e383(0xf5))/0x4*(parseInt(_0x31e383(0x145))/0x5)+-parseInt(_0x31e383(0x146))/0x6*(-parseInt(_0x31e383(0x139))/0x7)+-parseInt(_0x31e383(0xf6))/0x8+parseInt(_0x31e383(0xfd))/0x9;if(_0x6c7227===_0x2734fc)break;else _0x5e4657['push'](_0x5e4657['shift']());}catch(_0x7912db){_0x5e4657['push'](_0x5e4657['shift']());}}}(a42_0x5a31,0xa8c0d));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a42_0x5d3624 from'node:fs';import*as a42_0x49a1b3 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';function a42_0x59ca(_0xf24195,_0x28288a){_0xf24195=_0xf24195-0xf5;const _0x5a3178=a42_0x5a31();let _0x59caf6=_0x5a3178[_0xf24195];return _0x59caf6;}import a42_0x4c6441 from'chalk';export function getConfigDir(){const _0x488f48=a42_0x59ca;return process['env'][_0x488f48(0x137)]||join(homedir(),_0x488f48(0x131),_0x488f48(0xfc));}export function getConfigFile(){const _0x27df25=a42_0x59ca;return join(getConfigDir(),_0x27df25(0x11c));}export function getConfigFilePath(_0x26548f){const _0xe56a7=a42_0x59ca,_0x5c8f11=getConfigDir();return _0x26548f?a42_0x49a1b3[_0xe56a7(0x101)](_0x5c8f11,_0xe56a7(0x143)+_0x26548f):getConfigFile();}export function getCacheDir(){const _0x5630d1=a42_0x59ca;return process[_0x5630d1(0x141)][_0x5630d1(0x104)]||join(homedir(),'.cache',_0x5630d1(0xfc));}export function getLLMProjectCacheFile(_0x20d8b1){const _0x6ce2ae=a42_0x59ca,_0x24c325=_0x20d8b1?_0x6ce2ae(0x11f)+_0x20d8b1:_0x6ce2ae(0x118);return join(getCacheDir(),_0x24c325);}export function readCachedLLMProject(_0x1e3a74){const _0x5668f7=a42_0x59ca;try{const _0x536e89=getLLMProjectCacheFile(_0x1e3a74);if(!existsSync(_0x536e89))return null;const _0x90f7c=readFileSync(_0x536e89,_0x5668f7(0x13e))['trim']();try{const _0x1140ae=JSON[_0x5668f7(0xff)](_0x90f7c);if(_0x1140ae&&typeof _0x1140ae['id']==='string'&&typeof _0x1140ae['name']==='string')return _0x1140ae;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x5e06e3,_0xcbdd60,_0x2ef359){const _0xf2427e=a42_0x59ca;try{const _0x57b81e=getCacheDir(),_0x9ff935=getLLMProjectCacheFile(_0x2ef359);!existsSync(_0x57b81e)&&mkdirSync(_0x57b81e,{'recursive':!![]});const _0x136843={'name':_0x5e06e3,'id':_0xcbdd60};writeFileSync(_0x9ff935,JSON[_0xf2427e(0x10c)](_0x136843),_0xf2427e(0x13e));}catch{}}export function getLLMAgentCacheFile(_0x16dfad){const _0x1725e4=a42_0x59ca,_0x23e6dc=_0x16dfad?_0x1725e4(0x13a)+_0x16dfad:'llm_default_agent';return join(getCacheDir(),_0x23e6dc);}export function readCachedLLMAgent(_0xb75b11){const _0x211f26=a42_0x59ca;try{const _0x4d9553=getLLMAgentCacheFile(_0xb75b11);if(!existsSync(_0x4d9553))return null;const _0x45d859=readFileSync(_0x4d9553,'utf-8')[_0x211f26(0x127)]();try{const _0x27a0ca=JSON['parse'](_0x45d859);if(_0x27a0ca&&typeof _0x27a0ca['id']===_0x211f26(0x108)&&typeof _0x27a0ca[_0x211f26(0x125)]==='string'&&typeof _0x27a0ca['projectId']===_0x211f26(0x108))return _0x27a0ca;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x234705,_0x3b27bd,_0x5ea297,_0x3148c4){const _0x40e202=a42_0x59ca;try{const _0x174e27=getCacheDir(),_0x56a93c=getLLMAgentCacheFile(_0x3148c4);!existsSync(_0x174e27)&&mkdirSync(_0x174e27,{'recursive':!![]});const _0x11858f={'name':_0x234705,'id':_0x3b27bd,'projectId':_0x5ea297};writeFileSync(_0x56a93c,JSON[_0x40e202(0x10c)](_0x11858f),_0x40e202(0x13e));}catch{}}export function clearCachedLLMAgent(_0x2d8e05){try{const _0x38f259=getLLMAgentCacheFile(_0x2d8e05);existsSync(_0x38f259)&&unlinkSync(_0x38f259);}catch{}}export function getAccountInfoCacheFile(_0x4de9fe){const _0x43c2b6=a42_0x59ca,_0x41589e=_0x4de9fe?_0x43c2b6(0x102)+_0x4de9fe+_0x43c2b6(0x136):_0x43c2b6(0x12a);return join(getCacheDir(),_0x41589e);}function a42_0x5a31(){const _0x59dee4=['us01','ap02','.json','TDX_CONFIG_DIR','source','13790ZhrYTs','llm_default_agent.','includes','isDeprecated','slice','utf-8','site','TDX_API_KEY_<PROFILE>','env','Warning:\x20Failed\x20to\x20read\x20','.env.','stg-us01','5fQtmMM','1068QWBQCU','4417524IRJAcs','2305080UzjsHF','toUpperCase','keychain','dev-us01','match','TD_API_KEY\x20env\x20var\x20(deprecated)','tdx','8268300UzrQXG','\x27,\x20defaulting\x20to\x20us01','parse','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','join','account_info.','\x20env\x20var','TDX_CACHE_DIR','accountId','legacy\x20.env\x20file\x20(profile:\x20','profiles','string','number','Warning:\x20Unknown\x20site\x20\x27','1680358tlQNeb','stringify','toISOString','TD_API_KEY_','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','legacy\x20.env\x20file','TDX_API_KEY\x20env\x20var','entries','jp01','TDX_API_KEY','stg-jp01','startsWith','1144997BveCHt','llm_default_project','Warning:\x20Failed\x20to\x20load\x20','yellow','stg-ap03','.env','profile','filter','llm_default_project.','TDX_API_KEY_','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','warn','tdx.json','TD_API_KEY','name','replace','trim','existsSync','map','account_info.json','ap03','split','dev-eu01','readFileSync','eu01','3268725oHPdWy','.config','endsWith','keychain\x20(profile:\x20'];a42_0x5a31=function(){return _0x59dee4;};return a42_0x5a31();}export function readCachedAccountInfo(_0x431b4c){const _0x5315bc=a42_0x59ca;try{const _0x5b6933=getAccountInfoCacheFile(_0x431b4c);if(!existsSync(_0x5b6933))return null;const _0x2f4ab7=readFileSync(_0x5b6933,_0x5315bc(0x13e))[_0x5315bc(0x127)](),_0x4da141=JSON[_0x5315bc(0xff)](_0x2f4ab7);if(_0x4da141&&typeof _0x4da141[_0x5315bc(0x13f)]===_0x5315bc(0x108)&&typeof _0x4da141[_0x5315bc(0x105)]===_0x5315bc(0x109))return _0x4da141;return null;}catch{return null;}}export function writeCachedAccountInfo(_0xe25fde,_0x233812,_0xba503d){const _0x533cc7=a42_0x59ca;try{const _0x47263a=getCacheDir(),_0x1f36de=getAccountInfoCacheFile(_0xba503d);!existsSync(_0x47263a)&&mkdirSync(_0x47263a,{'recursive':!![]});const _0x369ba6={'site':_0xe25fde,'accountId':_0x233812,'cachedAt':new Date()[_0x533cc7(0x10d)]()};writeFileSync(_0x1f36de,JSON['stringify'](_0x369ba6),_0x533cc7(0x13e));}catch{}}export function parseEnvFile(_0x8f6a41){const _0x44f1e8=a42_0x59ca,_0x314309={};for(const _0x89042 of _0x8f6a41[_0x44f1e8(0x12c)]('\x0a')){const _0x5a317b=_0x89042[_0x44f1e8(0x127)]();if(!_0x5a317b||_0x5a317b[_0x44f1e8(0x116)]('#'))continue;const _0x2aa72a=_0x5a317b[_0x44f1e8(0xfa)](/^([^=]+)=(.*)$/);if(_0x2aa72a){const _0x3a2eb9=_0x2aa72a[0x1][_0x44f1e8(0x127)]();let _0x33ae9d=_0x2aa72a[0x2][_0x44f1e8(0x127)]();(_0x33ae9d[_0x44f1e8(0x116)]('\x22')&&_0x33ae9d[_0x44f1e8(0x132)]('\x22')||_0x33ae9d[_0x44f1e8(0x116)]('\x27')&&_0x33ae9d['endsWith']('\x27'))&&(_0x33ae9d=_0x33ae9d[_0x44f1e8(0x13d)](0x1,-0x1)),_0x314309[_0x3a2eb9]=_0x33ae9d;}}return _0x314309;}export function readUserConfig(){const _0x256cff=a42_0x59ca,_0x27665d=getConfigFile();if(!existsSync(_0x27665d))return{};try{const _0x3575d9=readFileSync(_0x27665d,'utf-8');return parseEnvFile(_0x3575d9);}catch(_0x3bd634){return console[_0x256cff(0x122)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x27665d+':',_0x3bd634),{};}}export function resolveSite(_0x7c0b3a){const _0x18bf8b=a42_0x59ca,_0x1c8e26=[_0x18bf8b(0x134),_0x18bf8b(0x113),_0x18bf8b(0x12f),_0x18bf8b(0x135),_0x18bf8b(0x12b),_0x18bf8b(0xf9),_0x18bf8b(0x12d),_0x18bf8b(0x144),'stg-jp01',_0x18bf8b(0x11b)];if(_0x1c8e26['includes'](_0x7c0b3a))return _0x7c0b3a;if(_0x7c0b3a in SITE_ALIASES)return SITE_ALIASES[_0x7c0b3a];return console[_0x18bf8b(0x122)](_0x18bf8b(0x10a)+_0x7c0b3a+_0x18bf8b(0xfe)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x2537b4,_0x3a780c){const _0x3f5374=a42_0x59ca,_0x2874de=_0x3a780c||getActiveProfileName();if(_0x2874de){const _0x427777='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x2874de);if(process[_0x3f5374(0x141)][_0x427777])return process[_0x3f5374(0x141)][_0x427777];}if(process[_0x3f5374(0x141)][_0x3f5374(0x114)])return process['env'][_0x3f5374(0x114)];if(process[_0x3f5374(0x141)][_0x3f5374(0x124)])return process['env'][_0x3f5374(0x124)];const _0x5dc57e=_0x2537b4[_0x3f5374(0xf7)]()[_0x3f5374(0x126)](/-/g,'_'),_0x37cdbd='TD_API_KEY_'+_0x5dc57e;if(_0x2874de){const _0x5232d1=loadProfileEnv(_0x2874de);if(_0x5232d1){if(_0x5232d1[_0x37cdbd])return _0x5232d1[_0x37cdbd];if(_0x5232d1['TD_API_KEY'])return _0x5232d1[_0x3f5374(0x124)];}}const _0x28a2d5=loadUserConfigOnce();if(_0x28a2d5[_0x37cdbd])return _0x28a2d5[_0x37cdbd];if(_0x28a2d5[_0x3f5374(0x124)])return _0x28a2d5['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x352ffb){const _0x8c18b8=a42_0x59ca;return _0x352ffb[_0x8c18b8(0xf7)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x1240d6,_0x131023){const _0x31c34f=a42_0x59ca,_0x2fe113=_0x131023||getActiveProfileName()||undefined;if(_0x2fe113){const _0x4664d2=_0x31c34f(0x120)+normalizeProfileForEnvVar(_0x2fe113);if(process[_0x31c34f(0x141)][_0x4664d2])return{'apiKey':process[_0x31c34f(0x141)][_0x4664d2],'source':_0x4664d2+_0x31c34f(0x103),'isDeprecated':![]};const _0x543834=getCachedCredential(_0x1240d6,_0x2fe113);if(_0x543834)return{'apiKey':_0x543834,'source':_0x31c34f(0x133)+_0x2fe113+')','isDeprecated':![]};const _0x385bac=await getKeychainAPIKey(_0x2fe113);if(_0x385bac)return setCachedCredential(_0x385bac,_0x1240d6,_0x2fe113),{'apiKey':_0x385bac,'source':_0x31c34f(0x133)+_0x2fe113+')','isDeprecated':![]};}if(process['env'][_0x31c34f(0x114)])return{'apiKey':process[_0x31c34f(0x141)][_0x31c34f(0x114)],'source':_0x31c34f(0x111),'isDeprecated':![]};if(!_0x2fe113){const _0xeebc55=getCachedCredential(_0x1240d6,undefined);if(_0xeebc55)return{'apiKey':_0xeebc55,'source':_0x31c34f(0xf8),'isDeprecated':![]};const _0x497b0b=await getKeychainAPIKey(undefined);if(_0x497b0b)return setCachedCredential(_0x497b0b,_0x1240d6,undefined),{'apiKey':_0x497b0b,'source':_0x31c34f(0xf8),'isDeprecated':![]};}if(process[_0x31c34f(0x141)]['TD_API_KEY'])return{'apiKey':process['env'][_0x31c34f(0x124)],'source':_0x31c34f(0xfb),'isDeprecated':!![]};const _0x196d13=getLegacyEnvAPIKey(_0x1240d6,_0x2fe113);if(_0x196d13){const _0x4edeba=await isKeychainAvailable();if(_0x4edeba)try{await saveKeychainAPIKey(_0x196d13,_0x2fe113),setCachedCredential(_0x196d13,_0x1240d6,_0x2fe113);const _0x2e50ac=getConfigFilePath(_0x2fe113);cleanupLegacyEnvFile(_0x2e50ac)&&console[_0x31c34f(0x122)](a42_0x4c6441['yellow'](_0x31c34f(0x121)));}catch(_0x2d8baa){console[_0x31c34f(0x122)](a42_0x4c6441[_0x31c34f(0x11a)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x2d8baa));}const _0x4c87d3=_0x2fe113?_0x31c34f(0x106)+_0x2fe113+')':_0x31c34f(0x110);return{'apiKey':_0x196d13,'source':_0x4c87d3,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x44cdc7,_0xe88d33,_0x3b17ab=!![]){const _0x51d9f0=a42_0x59ca,_0x587782=await resolveAPIKeyAsync(_0x44cdc7,_0xe88d33);if(!_0x587782)return undefined;if(_0x3b17ab&&_0x587782[_0x51d9f0(0x13c)]&&_0x587782[_0x51d9f0(0x138)][_0x51d9f0(0x13b)](_0x51d9f0(0x124))){const _0x4e69a2=_0xe88d33||getActiveProfileName()||undefined,_0x2a6be4=_0x4e69a2?_0x51d9f0(0x120)+normalizeProfileForEnvVar(_0x4e69a2):_0x51d9f0(0x140);console[_0x51d9f0(0x122)](a42_0x4c6441['yellow']('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x51d9f0(0x10f)+_0x2a6be4+').')));}return _0x587782['apiKey'];}function getLegacyEnvAPIKey(_0x19f6b6,_0x346129){const _0x22aa64=a42_0x59ca,_0x2b83bd=_0x19f6b6[_0x22aa64(0xf7)]()[_0x22aa64(0x126)](/-/g,'_'),_0x2ca894=_0x22aa64(0x10e)+_0x2b83bd;if(_0x346129){const _0x477191=loadProfileEnv(_0x346129);if(_0x477191){if(_0x477191[_0x2ca894])return _0x477191[_0x2ca894];if(_0x477191[_0x22aa64(0x124)])return _0x477191[_0x22aa64(0x124)];}}const _0x1edb09=loadUserConfigOnce();if(_0x1edb09[_0x2ca894])return _0x1edb09[_0x2ca894];if(_0x1edb09[_0x22aa64(0x124)])return _0x1edb09[_0x22aa64(0x124)];return undefined;}function cleanupLegacyEnvFile(_0xafe808){const _0x599cae=a42_0x59ca;if(!existsSync(_0xafe808))return![];try{const _0x2cf4fa=readFileSync(_0xafe808,'utf-8'),_0x3c6085=_0x2cf4fa[_0x599cae(0x12c)]('\x0a'),_0x52b128=_0x3c6085[_0x599cae(0x11e)](_0x237713=>{const _0x561390=_0x599cae,_0x428581=_0x237713[_0x561390(0x127)]();if(!_0x428581||_0x428581[_0x561390(0x116)]('#'))return!![];const [_0x80c941]=_0x428581[_0x561390(0x12c)]('=');return!_0x80c941[_0x561390(0x116)](_0x561390(0x124));}),_0x3552f7=_0x52b128['some'](_0x584d9b=>{const _0x308d40=_0x599cae,_0x58995f=_0x584d9b[_0x308d40(0x127)]();return _0x58995f&&!_0x58995f[_0x308d40(0x116)]('#');});if(!_0x3552f7)return unlinkSync(_0xafe808),!![];return writeFileSync(_0xafe808,_0x52b128[_0x599cae(0x101)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x1b3c91){const _0x2e9f13=a42_0x59ca,_0x3b7f0b=a42_0x49a1b3[_0x2e9f13(0x101)](getConfigDir(),_0x2e9f13(0x143)+_0x1b3c91);if(a42_0x5d3624[_0x2e9f13(0x128)](_0x3b7f0b)){validateSecureFilePermissions(_0x3b7f0b);try{const _0x2a1b8b=a42_0x5d3624[_0x2e9f13(0x12e)](_0x3b7f0b,_0x2e9f13(0x13e));return parseEnvFile(_0x2a1b8b);}catch(_0x4c8300){console[_0x2e9f13(0x122)](_0x2e9f13(0x119)+_0x3b7f0b+':\x20'+_0x4c8300);}}const _0x460e31=a42_0x49a1b3[_0x2e9f13(0x101)](getConfigDir(),_0x2e9f13(0x107),_0x1b3c91,'.env');if(a42_0x5d3624[_0x2e9f13(0x128)](_0x460e31)){validateSecureFilePermissions(_0x460e31);try{const _0x364eaf=a42_0x5d3624[_0x2e9f13(0x12e)](_0x460e31,'utf-8');return parseEnvFile(_0x364eaf);}catch(_0x5a4f9){return console[_0x2e9f13(0x122)](_0x2e9f13(0x119)+_0x460e31+':\x20'+_0x5a4f9),null;}}return null;}function getActiveProfileName(){const _0x14d897=a42_0x59ca,_0x37a0df=a42_0x49a1b3['join'](getConfigDir(),_0x14d897(0x123));if(!a42_0x5d3624[_0x14d897(0x128)](_0x37a0df))return null;try{const _0x3981b3=a42_0x5d3624[_0x14d897(0x12e)](_0x37a0df,_0x14d897(0x13e)),_0x166f52=JSON['parse'](_0x3981b3);return _0x166f52[_0x14d897(0x11d)]||null;}catch{return null;}}export function saveAPIKey(_0x38af34,_0x3ca22a,_0x3da8cb){const _0x54b066=a42_0x59ca,_0x5b2626=getConfigDir(),_0xfd692d=getConfigFilePath(_0x3da8cb);!existsSync(_0x5b2626)&&mkdirSync(_0x5b2626,{'recursive':!![],'mode':0x1c0});let _0x23ebf7={};if(existsSync(_0xfd692d))try{const _0x12478a=readFileSync(_0xfd692d,_0x54b066(0x13e));_0x23ebf7=parseEnvFile(_0x12478a);}catch(_0xf2ab92){console[_0x54b066(0x122)](_0x54b066(0x142)+_0xfd692d+':',_0xf2ab92);}const _0x557948=_0x38af34[_0x54b066(0xf7)]()[_0x54b066(0x126)](/-/g,'_');_0x23ebf7[_0x54b066(0x10e)+_0x557948]=_0x3ca22a;const _0xa2b17d=Object[_0x54b066(0x112)](_0x23ebf7)[_0x54b066(0x129)](([_0x4b212d,_0x3db2a6])=>_0x4b212d+'='+_0x3db2a6);writeFileSync(_0xfd692d,_0xa2b17d[_0x54b066(0x101)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x13bbcc,_0x3eeb55,_0x939e24){const _0x145615=a42_0x59ca;await saveKeychainAPIKey(_0x13bbcc,_0x939e24),setCachedCredential(_0x13bbcc,_0x3eeb55,_0x939e24);const _0x567caf=getConfigFilePath(_0x939e24);cleanupLegacyEnvFile(_0x567caf)&&console['warn'](a42_0x4c6441['yellow'](_0x145615(0x100)));}export function loadConfig(){const _0x317ba7=a42_0x59ca,_0x1c52cf={'apiKeys':{},'defaultSite':'us01'},_0x3e8373=['us01','jp01',_0x317ba7(0x12f),_0x317ba7(0x135),_0x317ba7(0x12b),_0x317ba7(0xf9),'dev-eu01','stg-us01',_0x317ba7(0x115),_0x317ba7(0x11b)];for(const _0x3462f0 of _0x3e8373){const _0x222584=getAPIKey(_0x3462f0);_0x222584&&(_0x1c52cf['apiKeys'][_0x3462f0]=_0x222584);}return _0x1c52cf;}
1
+ function a42_0x27b4(){const _0x45447c=['\x27,\x20defaulting\x20to\x20us01','llm_default_agent','utf-8','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','jp01','dev-eu01','apiKeys','stg-jp01','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','.json','legacy\x20.env\x20file\x20(profile:\x20','apiKey','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','replace','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','isDeprecated','.env','TDX_CONFIG_DIR','ap02','1247716nDPaZc','ap03','keychain','env','profile','stringify','warn','TD_API_KEY','\x20env\x20var','TD_API_KEY_','TDX_API_KEY','entries','join','1459409IYzljB','dev-us01','tdx','startsWith','3003580zfjLFQ','account_info.json','number','6MzSnPq','12186omgpmC','legacy\x20.env\x20file','filter','eu01','.config','yellow','Warning:\x20Failed\x20to\x20load\x20','llm_default_project.','toUpperCase','string','existsSync','source','.env.','5686330SAOGHb','site','10663024iWbbMu','Warning:\x20Failed\x20to\x20read\x20','readFileSync','us01','TDX_API_KEY\x20env\x20var','split','parse','trim','map','accountId','endsWith','stg-us01','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','TD_API_KEY\x20env\x20var\x20(deprecated)','match','includes','5061CIxDCr','10905984dpjESG','name','TDX_CACHE_DIR','some','TDX_API_KEY_','keychain\x20(profile:\x20'];a42_0x27b4=function(){return _0x45447c;};return a42_0x27b4();}(function(_0x4d8aeb,_0x5d1e85){const _0x47f0d5=a42_0x2249,_0x33f600=_0x4d8aeb();while(!![]){try{const _0x2b2017=parseInt(_0x47f0d5(0x18b))/0x1+-parseInt(_0x47f0d5(0x18f))/0x2+-parseInt(_0x47f0d5(0x192))/0x3*(-parseInt(_0x47f0d5(0x1cd))/0x4)+-parseInt(_0x47f0d5(0x1a0))/0x5+-parseInt(_0x47f0d5(0x193))/0x6*(-parseInt(_0x47f0d5(0x1b2))/0x7)+-parseInt(_0x47f0d5(0x1a2))/0x8+parseInt(_0x47f0d5(0x1b3))/0x9;if(_0x2b2017===_0x5d1e85)break;else _0x33f600['push'](_0x33f600['shift']());}catch(_0x54f286){_0x33f600['push'](_0x33f600['shift']());}}}(a42_0x27b4,0xc13e2));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a42_0x2bb39e from'node:fs';import*as a42_0x31a464 from'node:path';function a42_0x2249(_0xc7e1ca,_0x309fd9){_0xc7e1ca=_0xc7e1ca-0x18b;const _0x27b4ad=a42_0x27b4();let _0x2249a2=_0x27b4ad[_0xc7e1ca];return _0x2249a2;}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_0x1a45e0 from'chalk';export function getConfigDir(){const _0x4d079a=a42_0x2249;return process[_0x4d079a(0x1d0)][_0x4d079a(0x1cb)]||join(homedir(),_0x4d079a(0x197),_0x4d079a(0x18d));}export function getConfigFile(){const _0x36aa21=a42_0x2249;return join(getConfigDir(),_0x36aa21(0x1ca));}export function getConfigFilePath(_0x4942f3){const _0x129f56=a42_0x2249,_0x2590a9=getConfigDir();return _0x4942f3?a42_0x31a464[_0x129f56(0x1d9)](_0x2590a9,'.env.'+_0x4942f3):getConfigFile();}export function getCacheDir(){const _0x130c6e=a42_0x2249;return process['env'][_0x130c6e(0x1b5)]||join(homedir(),'.cache',_0x130c6e(0x18d));}export function getLLMProjectCacheFile(_0xcbb34b){const _0x1dde40=a42_0x2249,_0x569750=_0xcbb34b?_0x1dde40(0x19a)+_0xcbb34b:'llm_default_project';return join(getCacheDir(),_0x569750);}export function readCachedLLMProject(_0x49549b){const _0x1b7737=a42_0x2249;try{const _0x2ae914=getLLMProjectCacheFile(_0x49549b);if(!existsSync(_0x2ae914))return null;const _0x12e444=readFileSync(_0x2ae914,_0x1b7737(0x1bb))['trim']();try{const _0x42d8c2=JSON[_0x1b7737(0x1a8)](_0x12e444);if(_0x42d8c2&&typeof _0x42d8c2['id']===_0x1b7737(0x19c)&&typeof _0x42d8c2[_0x1b7737(0x1b4)]===_0x1b7737(0x19c))return _0x42d8c2;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x10278c,_0xd8552f,_0x54f75c){const _0x525ac6=a42_0x2249;try{const _0x5d1236=getCacheDir(),_0xf1160f=getLLMProjectCacheFile(_0x54f75c);!existsSync(_0x5d1236)&&mkdirSync(_0x5d1236,{'recursive':!![]});const _0x1a78a1={'name':_0x10278c,'id':_0xd8552f};writeFileSync(_0xf1160f,JSON[_0x525ac6(0x1d2)](_0x1a78a1),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x477c34){const _0x527f9d=a42_0x2249,_0x35b7c0=_0x477c34?'llm_default_agent.'+_0x477c34:_0x527f9d(0x1ba);return join(getCacheDir(),_0x35b7c0);}export function readCachedLLMAgent(_0x919414){const _0x319c24=a42_0x2249;try{const _0x7874ec=getLLMAgentCacheFile(_0x919414);if(!existsSync(_0x7874ec))return null;const _0x6041f2=readFileSync(_0x7874ec,'utf-8')[_0x319c24(0x1a9)]();try{const _0x456ff0=JSON['parse'](_0x6041f2);if(_0x456ff0&&typeof _0x456ff0['id']===_0x319c24(0x19c)&&typeof _0x456ff0['name']==='string'&&typeof _0x456ff0['projectId']===_0x319c24(0x19c))return _0x456ff0;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x23f6c9,_0x2fa139,_0x2e4cbb,_0x331a95){const _0x711534=a42_0x2249;try{const _0x3a69c6=getCacheDir(),_0x337f9e=getLLMAgentCacheFile(_0x331a95);!existsSync(_0x3a69c6)&&mkdirSync(_0x3a69c6,{'recursive':!![]});const _0x356abe={'name':_0x23f6c9,'id':_0x2fa139,'projectId':_0x2e4cbb};writeFileSync(_0x337f9e,JSON[_0x711534(0x1d2)](_0x356abe),_0x711534(0x1bb));}catch{}}export function clearCachedLLMAgent(_0x1d8cee){try{const _0x2d71c5=getLLMAgentCacheFile(_0x1d8cee);existsSync(_0x2d71c5)&&unlinkSync(_0x2d71c5);}catch{}}export function getAccountInfoCacheFile(_0x5ef134){const _0x1e8747=a42_0x2249,_0x594a0a=_0x5ef134?'account_info.'+_0x5ef134+_0x1e8747(0x1c3):_0x1e8747(0x190);return join(getCacheDir(),_0x594a0a);}export function readCachedAccountInfo(_0x22f12c){const _0x4eeb33=a42_0x2249;try{const _0x3f3115=getAccountInfoCacheFile(_0x22f12c);if(!existsSync(_0x3f3115))return null;const _0x380db5=readFileSync(_0x3f3115,_0x4eeb33(0x1bb))[_0x4eeb33(0x1a9)](),_0x1d0c5b=JSON['parse'](_0x380db5);if(_0x1d0c5b&&typeof _0x1d0c5b[_0x4eeb33(0x1a1)]==='string'&&typeof _0x1d0c5b[_0x4eeb33(0x1ab)]===_0x4eeb33(0x191))return _0x1d0c5b;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x44d57c,_0x36706a,_0x222b5b){const _0x126728=a42_0x2249;try{const _0x566212=getCacheDir(),_0x1e697b=getAccountInfoCacheFile(_0x222b5b);!existsSync(_0x566212)&&mkdirSync(_0x566212,{'recursive':!![]});const _0x5ae69d={'site':_0x44d57c,'accountId':_0x36706a,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x1e697b,JSON[_0x126728(0x1d2)](_0x5ae69d),'utf-8');}catch{}}export function parseEnvFile(_0x4ba199){const _0x407599=a42_0x2249,_0x4efb06={};for(const _0x4305a1 of _0x4ba199['split']('\x0a')){const _0x4805bb=_0x4305a1[_0x407599(0x1a9)]();if(!_0x4805bb||_0x4805bb['startsWith']('#'))continue;const _0x59a077=_0x4805bb[_0x407599(0x1b0)](/^([^=]+)=(.*)$/);if(_0x59a077){const _0x8b0a6a=_0x59a077[0x1]['trim']();let _0xa991d1=_0x59a077[0x2][_0x407599(0x1a9)]();(_0xa991d1[_0x407599(0x18e)]('\x22')&&_0xa991d1['endsWith']('\x22')||_0xa991d1[_0x407599(0x18e)]('\x27')&&_0xa991d1[_0x407599(0x1ac)]('\x27'))&&(_0xa991d1=_0xa991d1['slice'](0x1,-0x1)),_0x4efb06[_0x8b0a6a]=_0xa991d1;}}return _0x4efb06;}export function readUserConfig(){const _0x420291=a42_0x2249,_0x2891ac=getConfigFile();if(!existsSync(_0x2891ac))return{};try{const _0x5964e1=readFileSync(_0x2891ac,_0x420291(0x1bb));return parseEnvFile(_0x5964e1);}catch(_0x266da9){return console['warn'](_0x420291(0x1c1)+_0x2891ac+':',_0x266da9),{};}}export function resolveSite(_0x58b25c){const _0x4a63e9=a42_0x2249,_0x3de3a9=[_0x4a63e9(0x1a5),_0x4a63e9(0x1bd),_0x4a63e9(0x196),_0x4a63e9(0x1cc),_0x4a63e9(0x1ce),_0x4a63e9(0x18c),'dev-eu01',_0x4a63e9(0x1ad),_0x4a63e9(0x1c0),'stg-ap03'];if(_0x3de3a9[_0x4a63e9(0x1b1)](_0x58b25c))return _0x58b25c;if(_0x58b25c in SITE_ALIASES)return SITE_ALIASES[_0x58b25c];return console[_0x4a63e9(0x1d3)]('Warning:\x20Unknown\x20site\x20\x27'+_0x58b25c+_0x4a63e9(0x1b9)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x64da09,_0x5efa11){const _0x507f8c=a42_0x2249,_0x1608aa=_0x5efa11||getActiveProfileName();if(_0x1608aa){const _0x518306=_0x507f8c(0x1b7)+normalizeProfileForEnvVar(_0x1608aa);if(process['env'][_0x518306])return process['env'][_0x518306];}if(process[_0x507f8c(0x1d0)][_0x507f8c(0x1d7)])return process['env'][_0x507f8c(0x1d7)];if(process[_0x507f8c(0x1d0)][_0x507f8c(0x1d4)])return process[_0x507f8c(0x1d0)]['TD_API_KEY'];const _0x9e39c2=_0x64da09['toUpperCase']()[_0x507f8c(0x1c7)](/-/g,'_'),_0x30f4f6=_0x507f8c(0x1d6)+_0x9e39c2;if(_0x1608aa){const _0x38dbc5=loadProfileEnv(_0x1608aa);if(_0x38dbc5){if(_0x38dbc5[_0x30f4f6])return _0x38dbc5[_0x30f4f6];if(_0x38dbc5['TD_API_KEY'])return _0x38dbc5[_0x507f8c(0x1d4)];}}const _0x30f637=loadUserConfigOnce();if(_0x30f637[_0x30f4f6])return _0x30f637[_0x30f4f6];if(_0x30f637[_0x507f8c(0x1d4)])return _0x30f637[_0x507f8c(0x1d4)];return undefined;}export function normalizeProfileForEnvVar(_0x2e8f0f){const _0x3531f7=a42_0x2249;return _0x2e8f0f[_0x3531f7(0x19b)]()[_0x3531f7(0x1c7)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x5667cb,_0x1944b0){const _0x22c2e0=a42_0x2249,_0x395173=_0x1944b0||getActiveProfileName()||undefined;if(_0x395173){const _0x164499='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x395173);if(process['env'][_0x164499])return{'apiKey':process['env'][_0x164499],'source':_0x164499+_0x22c2e0(0x1d5),'isDeprecated':![]};const _0x6e7b1d=getCachedCredential(_0x5667cb,_0x395173);if(_0x6e7b1d)return{'apiKey':_0x6e7b1d,'source':_0x22c2e0(0x1b8)+_0x395173+')','isDeprecated':![]};const _0x434df0=await getKeychainAPIKey(_0x395173);if(_0x434df0)return setCachedCredential(_0x434df0,_0x5667cb,_0x395173),{'apiKey':_0x434df0,'source':_0x22c2e0(0x1b8)+_0x395173+')','isDeprecated':![]};}if(process['env'][_0x22c2e0(0x1d7)])return{'apiKey':process['env']['TDX_API_KEY'],'source':_0x22c2e0(0x1a6),'isDeprecated':![]};if(!_0x395173){const _0x446c60=getCachedCredential(_0x5667cb,undefined);if(_0x446c60)return{'apiKey':_0x446c60,'source':_0x22c2e0(0x1cf),'isDeprecated':![]};const _0x36daa6=await getKeychainAPIKey(undefined);if(_0x36daa6)return setCachedCredential(_0x36daa6,_0x5667cb,undefined),{'apiKey':_0x36daa6,'source':_0x22c2e0(0x1cf),'isDeprecated':![]};}if(process[_0x22c2e0(0x1d0)][_0x22c2e0(0x1d4)])return{'apiKey':process[_0x22c2e0(0x1d0)][_0x22c2e0(0x1d4)],'source':_0x22c2e0(0x1af),'isDeprecated':!![]};const _0x9f7216=getLegacyEnvAPIKey(_0x5667cb,_0x395173);if(_0x9f7216){const _0x4adf9a=await isKeychainAvailable();if(_0x4adf9a)try{await saveKeychainAPIKey(_0x9f7216,_0x395173),setCachedCredential(_0x9f7216,_0x5667cb,_0x395173);const _0x122144=getConfigFilePath(_0x395173);cleanupLegacyEnvFile(_0x122144)&&console[_0x22c2e0(0x1d3)](a42_0x1a45e0['yellow'](_0x22c2e0(0x1ae)));}catch(_0x193514){console[_0x22c2e0(0x1d3)](a42_0x1a45e0[_0x22c2e0(0x198)](_0x22c2e0(0x1bc)+_0x193514));}const _0x3a7f18=_0x395173?_0x22c2e0(0x1c4)+_0x395173+')':_0x22c2e0(0x194);return{'apiKey':_0x9f7216,'source':_0x3a7f18,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x4507d7,_0x5798d2,_0x386bbd=!![]){const _0x692263=a42_0x2249,_0x4113b1=await resolveAPIKeyAsync(_0x4507d7,_0x5798d2);if(!_0x4113b1)return undefined;if(_0x386bbd&&_0x4113b1[_0x692263(0x1c9)]&&_0x4113b1[_0x692263(0x19e)][_0x692263(0x1b1)]('TD_API_KEY')){const _0x328aa5=_0x5798d2||getActiveProfileName()||undefined,_0x3932c2=_0x328aa5?_0x692263(0x1b7)+normalizeProfileForEnvVar(_0x328aa5):'TDX_API_KEY_<PROFILE>';console['warn'](a42_0x1a45e0[_0x692263(0x198)](_0x692263(0x1c6)+(_0x692263(0x1c2)+_0x3932c2+').')));}return _0x4113b1[_0x692263(0x1c5)];}function getLegacyEnvAPIKey(_0xa23679,_0x2e7e13){const _0x48abe8=a42_0x2249,_0x7d863a=_0xa23679[_0x48abe8(0x19b)]()['replace'](/-/g,'_'),_0x1b6f6f=_0x48abe8(0x1d6)+_0x7d863a;if(_0x2e7e13){const _0x16aa31=loadProfileEnv(_0x2e7e13);if(_0x16aa31){if(_0x16aa31[_0x1b6f6f])return _0x16aa31[_0x1b6f6f];if(_0x16aa31[_0x48abe8(0x1d4)])return _0x16aa31[_0x48abe8(0x1d4)];}}const _0x37bfcf=loadUserConfigOnce();if(_0x37bfcf[_0x1b6f6f])return _0x37bfcf[_0x1b6f6f];if(_0x37bfcf['TD_API_KEY'])return _0x37bfcf['TD_API_KEY'];return undefined;}function cleanupLegacyEnvFile(_0x3843cf){const _0x32b6db=a42_0x2249;if(!existsSync(_0x3843cf))return![];try{const _0x5e60df=readFileSync(_0x3843cf,_0x32b6db(0x1bb)),_0x4ef06d=_0x5e60df[_0x32b6db(0x1a7)]('\x0a'),_0x8aa004=_0x4ef06d[_0x32b6db(0x195)](_0x37e43c=>{const _0x1ef6b2=_0x32b6db,_0x8c6ff7=_0x37e43c[_0x1ef6b2(0x1a9)]();if(!_0x8c6ff7||_0x8c6ff7[_0x1ef6b2(0x18e)]('#'))return!![];const [_0x496322]=_0x8c6ff7['split']('=');return!_0x496322['startsWith'](_0x1ef6b2(0x1d4));}),_0xc48a6=_0x8aa004[_0x32b6db(0x1b6)](_0x520cf2=>{const _0x4d373a=_0x32b6db,_0x477126=_0x520cf2[_0x4d373a(0x1a9)]();return _0x477126&&!_0x477126['startsWith']('#');});if(!_0xc48a6)return unlinkSync(_0x3843cf),!![];return writeFileSync(_0x3843cf,_0x8aa004[_0x32b6db(0x1d9)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x207066){const _0x41ea3c=a42_0x2249,_0x2d509f=a42_0x31a464['join'](getConfigDir(),_0x41ea3c(0x19f)+_0x207066);if(a42_0x2bb39e['existsSync'](_0x2d509f)){validateSecureFilePermissions(_0x2d509f);try{const _0x463adf=a42_0x2bb39e['readFileSync'](_0x2d509f,_0x41ea3c(0x1bb));return parseEnvFile(_0x463adf);}catch(_0x2d2483){console[_0x41ea3c(0x1d3)](_0x41ea3c(0x199)+_0x2d509f+':\x20'+_0x2d2483);}}const _0x3b3832=a42_0x31a464['join'](getConfigDir(),'profiles',_0x207066,_0x41ea3c(0x1ca));if(a42_0x2bb39e['existsSync'](_0x3b3832)){validateSecureFilePermissions(_0x3b3832);try{const _0x336be1=a42_0x2bb39e[_0x41ea3c(0x1a4)](_0x3b3832,_0x41ea3c(0x1bb));return parseEnvFile(_0x336be1);}catch(_0x57e089){return console[_0x41ea3c(0x1d3)]('Warning:\x20Failed\x20to\x20load\x20'+_0x3b3832+':\x20'+_0x57e089),null;}}return null;}function getActiveProfileName(){const _0xaa9093=a42_0x2249,_0x444330=a42_0x31a464[_0xaa9093(0x1d9)](getConfigDir(),'tdx.json');if(!a42_0x2bb39e[_0xaa9093(0x19d)](_0x444330))return null;try{const _0x390792=a42_0x2bb39e['readFileSync'](_0x444330,_0xaa9093(0x1bb)),_0x276663=JSON[_0xaa9093(0x1a8)](_0x390792);return _0x276663[_0xaa9093(0x1d1)]||null;}catch{return null;}}export function saveAPIKey(_0x381d7d,_0x3db7c8,_0xc4373c){const _0x51c4ac=a42_0x2249,_0x14eb12=getConfigDir(),_0x4478ca=getConfigFilePath(_0xc4373c);!existsSync(_0x14eb12)&&mkdirSync(_0x14eb12,{'recursive':!![],'mode':0x1c0});let _0x5deae8={};if(existsSync(_0x4478ca))try{const _0x52e374=readFileSync(_0x4478ca,'utf-8');_0x5deae8=parseEnvFile(_0x52e374);}catch(_0x3ed3a6){console['warn'](_0x51c4ac(0x1a3)+_0x4478ca+':',_0x3ed3a6);}const _0x3056d0=_0x381d7d[_0x51c4ac(0x19b)]()['replace'](/-/g,'_');_0x5deae8[_0x51c4ac(0x1d6)+_0x3056d0]=_0x3db7c8;const _0x14d173=Object[_0x51c4ac(0x1d8)](_0x5deae8)[_0x51c4ac(0x1aa)](([_0x55187f,_0x5baa1c])=>_0x55187f+'='+_0x5baa1c);writeFileSync(_0x4478ca,_0x14d173[_0x51c4ac(0x1d9)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x3247e2,_0x471492,_0x41a689){const _0x3b1412=a42_0x2249;await saveKeychainAPIKey(_0x3247e2,_0x41a689),setCachedCredential(_0x3247e2,_0x471492,_0x41a689);const _0x2b1cff=getConfigFilePath(_0x41a689);cleanupLegacyEnvFile(_0x2b1cff)&&console[_0x3b1412(0x1d3)](a42_0x1a45e0[_0x3b1412(0x198)](_0x3b1412(0x1c8)));}export function loadConfig(){const _0x287a58=a42_0x2249,_0x499fee={'apiKeys':{},'defaultSite':_0x287a58(0x1a5)},_0x4687ff=[_0x287a58(0x1a5),_0x287a58(0x1bd),'eu01','ap02',_0x287a58(0x1ce),_0x287a58(0x18c),_0x287a58(0x1be),_0x287a58(0x1ad),_0x287a58(0x1c0),'stg-ap03'];for(const _0x10ad50 of _0x4687ff){const _0x3edc4e=getAPIKey(_0x10ad50);_0x3edc4e&&(_0x499fee[_0x287a58(0x1bf)][_0x10ad50]=_0x3edc4e);}return _0x499fee;}
@@ -1 +1 @@
1
- (function(_0x58dc33,_0x29ed8c){const _0x5838c2=a43_0x1fed,_0x138653=_0x58dc33();while(!![]){try{const _0x37d605=parseInt(_0x5838c2(0xbb))/0x1*(parseInt(_0x5838c2(0xc4))/0x2)+parseInt(_0x5838c2(0xc6))/0x3*(parseInt(_0x5838c2(0xc3))/0x4)+-parseInt(_0x5838c2(0xb8))/0x5+parseInt(_0x5838c2(0xbf))/0x6*(-parseInt(_0x5838c2(0xc5))/0x7)+parseInt(_0x5838c2(0xbd))/0x8*(-parseInt(_0x5838c2(0xbe))/0x9)+-parseInt(_0x5838c2(0xb7))/0xa*(-parseInt(_0x5838c2(0xb9))/0xb)+parseInt(_0x5838c2(0xc0))/0xc;if(_0x37d605===_0x29ed8c)break;else _0x138653['push'](_0x138653['shift']());}catch(_0x94d61f){_0x138653['push'](_0x138653['shift']());}}}(a43_0x357d,0x40c5b));function a43_0x357d(){const _0x4f8f80=['12LjvqUX','366564xVdAdK','stringify','utf-8','4BpRSxz','62zdIvoe','1164912WiOvvO','32211YSKjyB','connections','parse','150BULMBp','5140fZNnsY','67826pQflCg','.json','15268TJRbzv','default','8xghNGp','71235gqUrXV'];a43_0x357d=function(){return _0x4f8f80;};return a43_0x357d();}import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';function a43_0x1fed(_0x134699,_0x536181){_0x134699=_0x134699-0xb5;const _0x357dfa=a43_0x357d();let _0x1fed99=_0x357dfa[_0x134699];return _0x1fed99;}import{getCacheDir}from'./config.js';function getCacheFilePath(_0x347e57){const _0x5c2739=a43_0x1fed,_0x1c610c=_0x347e57||_0x5c2739(0xbc);return join(getCacheDir(),'connections-'+_0x1c610c+_0x5c2739(0xba));}export function loadCachedConnections(_0x35262e){const _0x5125a8=a43_0x1fed,_0x440115=getCacheFilePath(_0x35262e);if(!existsSync(_0x440115))return null;try{const _0x47af30=readFileSync(_0x440115,_0x5125a8(0xc2)),_0x1ea5ba=JSON[_0x5125a8(0xb6)](_0x47af30);return _0x1ea5ba[_0x5125a8(0xb5)];}catch{return null;}}export function saveCachedConnections(_0xff2480,_0x26b59c){const _0x58ce76=a43_0x1fed,_0x5cfc44=getCacheDir();!existsSync(_0x5cfc44)&&mkdirSync(_0x5cfc44,{'recursive':!![]});const _0x563de4=getCacheFilePath(_0xff2480),_0x52760b={'connections':_0x26b59c,'cachedAt':Date['now']()};writeFileSync(_0x563de4,JSON[_0x58ce76(0xc1)](_0x52760b,null,0x2),_0x58ce76(0xc2));}export function clearConnectionCache(_0xe02e3e){const _0x393c33=getCacheFilePath(_0xe02e3e);if(existsSync(_0x393c33))try{unlinkSync(_0x393c33);}catch{}}
1
+ (function(_0xe4ef2a,_0x47b3af){const _0x11cad8=a43_0x805c,_0x1c7cb2=_0xe4ef2a();while(!![]){try{const _0x3b78bd=-parseInt(_0x11cad8(0xa7))/0x1+parseInt(_0x11cad8(0xa9))/0x2*(parseInt(_0x11cad8(0xa0))/0x3)+-parseInt(_0x11cad8(0x9e))/0x4*(parseInt(_0x11cad8(0xa5))/0x5)+-parseInt(_0x11cad8(0x9f))/0x6+parseInt(_0x11cad8(0xa6))/0x7+-parseInt(_0x11cad8(0x9b))/0x8+-parseInt(_0x11cad8(0x99))/0x9*(-parseInt(_0x11cad8(0x9d))/0xa);if(_0x3b78bd===_0x47b3af)break;else _0x1c7cb2['push'](_0x1c7cb2['shift']());}catch(_0x427407){_0x1c7cb2['push'](_0x1c7cb2['shift']());}}}(a43_0x110b,0x6e515));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';function a43_0x805c(_0x12aeb9,_0x715d6b){_0x12aeb9=_0x12aeb9-0x99;const _0x110b0a=a43_0x110b();let _0x805ccc=_0x110b0a[_0x12aeb9];return _0x805ccc;}import{join}from'path';import{getCacheDir}from'./config.js';function a43_0x110b(){const _0x7c6ee4=['27YDKsad','default','1222680BLKJmQ','utf-8','1613660YlOiiu','4qNnjSr','3296526IIQRTU','123VyzBsM','.json','parse','now','connections-','1675740uEGNCi','5818729tLIRAK','85774JmwIHa','stringify','12668OuYLZD'];a43_0x110b=function(){return _0x7c6ee4;};return a43_0x110b();}function getCacheFilePath(_0x11b8d7){const _0x1c2ad9=a43_0x805c,_0x50ee42=_0x11b8d7||_0x1c2ad9(0x9a);return join(getCacheDir(),_0x1c2ad9(0xa4)+_0x50ee42+_0x1c2ad9(0xa1));}export function loadCachedConnections(_0x518d2a){const _0x15d8e3=a43_0x805c,_0x1c4493=getCacheFilePath(_0x518d2a);if(!existsSync(_0x1c4493))return null;try{const _0x2a6ea1=readFileSync(_0x1c4493,_0x15d8e3(0x9c)),_0x1f59d1=JSON[_0x15d8e3(0xa2)](_0x2a6ea1);return _0x1f59d1['connections'];}catch{return null;}}export function saveCachedConnections(_0x474766,_0x8a4323){const _0x12fea8=a43_0x805c,_0x552b32=getCacheDir();!existsSync(_0x552b32)&&mkdirSync(_0x552b32,{'recursive':!![]});const _0x4b9d11=getCacheFilePath(_0x474766),_0xc4165e={'connections':_0x8a4323,'cachedAt':Date[_0x12fea8(0xa3)]()};writeFileSync(_0x4b9d11,JSON[_0x12fea8(0xa8)](_0xc4165e,null,0x2),_0x12fea8(0x9c));}export function clearConnectionCache(_0x4cefec){const _0x33351f=getCacheFilePath(_0x4cefec);if(existsSync(_0x33351f))try{unlinkSync(_0x33351f);}catch{}}
@@ -1 +1 @@
1
- function a44_0x5ac9(){const _0x42e443=['848970nSUYiG','795220ponPmH','437404WdLPdi','5144hlsMcK','18zaIHtT','3ABHsGc','number','39778IhqOgV','1100895QwYcVW','2527DUBxPz','1qXeOWf','584516zXTROf'];a44_0x5ac9=function(){return _0x42e443;};return a44_0x5ac9();}(function(_0x373249,_0x2e4031){const _0x14a944=a44_0x35e2,_0x6d9104=_0x373249();while(!![]){try{const _0x2df63e=-parseInt(_0x14a944(0x175))/0x1*(-parseInt(_0x14a944(0x172))/0x2)+parseInt(_0x14a944(0x170))/0x3*(-parseInt(_0x14a944(0x176))/0x4)+parseInt(_0x14a944(0x173))/0x5+parseInt(_0x14a944(0x16b))/0x6+parseInt(_0x14a944(0x174))/0x7*(-parseInt(_0x14a944(0x16e))/0x8)+parseInt(_0x14a944(0x16f))/0x9*(parseInt(_0x14a944(0x16c))/0xa)+-parseInt(_0x14a944(0x16d))/0xb;if(_0x2df63e===_0x2e4031)break;else _0x6d9104['push'](_0x6d9104['shift']());}catch(_0x40f8d2){_0x6d9104['push'](_0x6d9104['shift']());}}}(a44_0x5ac9,0x1dedf));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a44_0x35e2(_0x2c9e97,_0xa40a2f){_0x2c9e97=_0x2c9e97-0x16b;const _0x5ac94b=a44_0x5ac9();let _0x35e27c=_0x5ac94b[_0x2c9e97];return _0x35e27c;}export function resolveLimit(_0x152516,_0xdc09d8){const _0x3ed4be=a44_0x35e2;if(_0x152516===undefined)return _0xdc09d8;if(typeof _0x152516===_0x3ed4be(0x171))return _0x152516;return parseInt(_0x152516,0xa);}
1
+ (function(_0x256814,_0xb0b325){const _0x35ae2c=a44_0x48b4,_0xa4f84e=_0x256814();while(!![]){try{const _0x20e2a8=parseInt(_0x35ae2c(0x168))/0x1*(parseInt(_0x35ae2c(0x16a))/0x2)+-parseInt(_0x35ae2c(0x16d))/0x3*(parseInt(_0x35ae2c(0x172))/0x4)+parseInt(_0x35ae2c(0x16f))/0x5*(-parseInt(_0x35ae2c(0x16c))/0x6)+-parseInt(_0x35ae2c(0x170))/0x7+-parseInt(_0x35ae2c(0x16e))/0x8*(-parseInt(_0x35ae2c(0x169))/0x9)+-parseInt(_0x35ae2c(0x16b))/0xa+parseInt(_0x35ae2c(0x171))/0xb;if(_0x20e2a8===_0xb0b325)break;else _0xa4f84e['push'](_0xa4f84e['shift']());}catch(_0x4f5658){_0xa4f84e['push'](_0xa4f84e['shift']());}}}(a44_0x339e,0x1c248));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;function a44_0x339e(){const _0x2efab2=['1426257VjnBeL','4810135geVOhq','250284qgYDrT','4lCyXnT','176031QadLCC','1912WiJaCD','397780ZhyKqo','67998IdHuWp','3sMOkPZ','80KVmpal','95MkvNny'];a44_0x339e=function(){return _0x2efab2;};return a44_0x339e();}export const DEFAULT_LLM_LIMIT=0x32;function a44_0x48b4(_0x501fe3,_0x219900){_0x501fe3=_0x501fe3-0x168;const _0x339eb4=a44_0x339e();let _0x48b4bd=_0x339eb4[_0x501fe3];return _0x48b4bd;}export function resolveLimit(_0x1f2c2c,_0x5da915){if(_0x1f2c2c===undefined)return _0x5da915;if(typeof _0x1f2c2c==='number')return _0x1f2c2c;return parseInt(_0x1f2c2c,0xa);}
@@ -1 +1 @@
1
- (function(_0x5895ff,_0x5bb694){const _0x3bcc62=a45_0xa32f,_0x17e39e=_0x5895ff();while(!![]){try{const _0x9aba8b=-parseInt(_0x3bcc62(0x95))/0x1*(parseInt(_0x3bcc62(0x91))/0x2)+parseInt(_0x3bcc62(0x9c))/0x3*(parseInt(_0x3bcc62(0x9d))/0x4)+-parseInt(_0x3bcc62(0x9f))/0x5+-parseInt(_0x3bcc62(0x90))/0x6+parseInt(_0x3bcc62(0x99))/0x7*(parseInt(_0x3bcc62(0xa0))/0x8)+parseInt(_0x3bcc62(0x92))/0x9*(parseInt(_0x3bcc62(0x96))/0xa)+-parseInt(_0x3bcc62(0x9e))/0xb;if(_0x9aba8b===_0x5bb694)break;else _0x17e39e['push'](_0x17e39e['shift']());}catch(_0x58df20){_0x17e39e['push'](_0x17e39e['shift']());}}}(a45_0x8657,0x82ba7));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a45_0xa32f(_0x4acaf2,_0x4b531b){_0x4acaf2=_0x4acaf2-0x8e;const _0x8657a8=a45_0x8657();let _0xa32f7e=_0x8657a8[_0x4acaf2];return _0xa32f7e;}function getCacheKey(_0x35c5d0,_0x3e1945){const _0x2878a5=a45_0xa32f,_0x264f67=_0x35c5d0||_0x2878a5(0x98),_0x15cb45=_0x3e1945||_0x2878a5(0x8f);return _0x264f67+':'+_0x15cb45;}function a45_0x8657(){const _0xca1cb4=['419445wkcBeh','16orZnXP','get','__default_profile__','3862896ktiNii','14OIDfMG','6338925aEEzQc','now','delete','27570VIfioF','10vVdOks','loadedAt','__default_site__','2032961KQunnR','apiKey','clear','3567xDtkBO','1560JPBkbP','3219953mbFBGT'];a45_0x8657=function(){return _0xca1cb4;};return a45_0x8657();}export function getCachedCredential(_0xa510bc,_0x2cce44){const _0x5ceff9=a45_0xa32f,_0x482bba=getCacheKey(_0xa510bc,_0x2cce44),_0x4fbb8d=cache[_0x5ceff9(0x8e)](_0x482bba);if(!_0x4fbb8d)return null;if(Date[_0x5ceff9(0x93)]()-_0x4fbb8d[_0x5ceff9(0x97)]>CACHE_TTL_MS)return cache['delete'](_0x482bba),null;return _0x4fbb8d[_0x5ceff9(0x9a)];}export function setCachedCredential(_0x10e074,_0x367387,_0x40e904){const _0x28f30b=a45_0xa32f,_0x12433a=getCacheKey(_0x367387,_0x40e904);cache['set'](_0x12433a,{'apiKey':_0x10e074,'loadedAt':Date[_0x28f30b(0x93)]()});}export function clearCredentialCache(){const _0x2d0803=a45_0xa32f;cache[_0x2d0803(0x9b)]();}export function clearCachedCredential(_0x108167,_0x37f34c){const _0xdf829c=a45_0xa32f,_0x535a1e=getCacheKey(_0x108167,_0x37f34c);cache[_0xdf829c(0x94)](_0x535a1e);}
1
+ function a45_0x18c5(_0x3950a2,_0x5bcc93){_0x3950a2=_0x3950a2-0xbb;const _0x759c56=a45_0x759c();let _0x18c54d=_0x759c56[_0x3950a2];return _0x18c54d;}function a45_0x759c(){const _0x37c057=['now','1704mmCxAW','apiKey','set','875720WUqkVM','get','7071TdAINA','__default_site__','1670kJudDC','loadedAt','3495160swkJXm','3871lINNZd','810ilZoPu','187073CXpcno','546624wkjTqg','68rUvKpA','__default_profile__','delete'];a45_0x759c=function(){return _0x37c057;};return a45_0x759c();}(function(_0x84dead,_0x497380){const _0xfff8e8=a45_0x18c5,_0x3072b2=_0x84dead();while(!![]){try{const _0x26345a=parseInt(_0xfff8e8(0xbb))/0x1+-parseInt(_0xfff8e8(0xbd))/0x2*(parseInt(_0xfff8e8(0xc6))/0x3)+parseInt(_0xfff8e8(0xc4))/0x4+parseInt(_0xfff8e8(0xc8))/0x5*(-parseInt(_0xfff8e8(0xcc))/0x6)+-parseInt(_0xfff8e8(0xcb))/0x7*(-parseInt(_0xfff8e8(0xc1))/0x8)+parseInt(_0xfff8e8(0xbc))/0x9+-parseInt(_0xfff8e8(0xca))/0xa;if(_0x26345a===_0x497380)break;else _0x3072b2['push'](_0x3072b2['shift']());}catch(_0x561d79){_0x3072b2['push'](_0x3072b2['shift']());}}}(a45_0x759c,0x1acd8));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x273fb3,_0x22fb61){const _0x2f7663=a45_0x18c5,_0x1fa505=_0x273fb3||_0x2f7663(0xc7),_0x160a65=_0x22fb61||_0x2f7663(0xbe);return _0x1fa505+':'+_0x160a65;}export function getCachedCredential(_0x53b83f,_0x2f5b79){const _0x5848e1=a45_0x18c5,_0x153c2d=getCacheKey(_0x53b83f,_0x2f5b79),_0x5bb104=cache[_0x5848e1(0xc5)](_0x153c2d);if(!_0x5bb104)return null;if(Date['now']()-_0x5bb104[_0x5848e1(0xc9)]>CACHE_TTL_MS)return cache[_0x5848e1(0xbf)](_0x153c2d),null;return _0x5bb104[_0x5848e1(0xc2)];}export function setCachedCredential(_0x19b5fe,_0x30f9f2,_0xacedc0){const _0x5827e1=a45_0x18c5,_0x2036d5=getCacheKey(_0x30f9f2,_0xacedc0);cache[_0x5827e1(0xc3)](_0x2036d5,{'apiKey':_0x19b5fe,'loadedAt':Date[_0x5827e1(0xc0)]()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x47f1a1,_0x50aae6){const _0x42f8fd=getCacheKey(_0x47f1a1,_0x50aae6);cache['delete'](_0x42f8fd);}
@@ -1 +1 @@
1
- const a46_0x3bd98c=a46_0x2699;(function(_0x41c4d5,_0x2eec02){const _0x459f5e=a46_0x2699,_0x10a4fe=_0x41c4d5();while(!![]){try{const _0x393f6c=-parseInt(_0x459f5e(0x1e1))/0x1*(-parseInt(_0x459f5e(0x1f6))/0x2)+-parseInt(_0x459f5e(0x1fd))/0x3*(parseInt(_0x459f5e(0x1c7))/0x4)+-parseInt(_0x459f5e(0x1f8))/0x5*(-parseInt(_0x459f5e(0x1cf))/0x6)+parseInt(_0x459f5e(0x1de))/0x7*(-parseInt(_0x459f5e(0x1ee))/0x8)+-parseInt(_0x459f5e(0x1f3))/0x9+parseInt(_0x459f5e(0x1f9))/0xa*(parseInt(_0x459f5e(0x1ea))/0xb)+parseInt(_0x459f5e(0x1e6))/0xc*(-parseInt(_0x459f5e(0x1dc))/0xd);if(_0x393f6c===_0x2eec02)break;else _0x10a4fe['push'](_0x10a4fe['shift']());}catch(_0x329111){_0x10a4fe['push'](_0x10a4fe['shift']());}}}(a46_0x3593,0xc05a4));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_0x2699(_0x2e3389,_0x44b4f8){_0x2e3389=_0x2e3389-0x1b8;const _0x3593ca=a46_0x3593();let _0x2699de=_0x3593ca[_0x2e3389];return _0x2699de;}import*as a46_0x285248 from'node:fs';import*as a46_0x4c2e04 from'node:path';function a46_0x3593(){const _0xc67edb=['10984923OQNtqP','profile','replace','2784332wOzcBh','.json','5xSObYs','10qIwplP','parent_segment','entries','site','1206Xsiovg','createAsync','[context]','(active)','llmProject','toString','.env','database','session','default','utf-8','log','Profile','llm_project','workflowProject','env','configFiles','Session','resolveAPIKeyAsync','1636MjBGsd','\x0a[configuration\x20files]','logLevel','not\x20set','INFO','global','Global\x20Credentials','loadGlobalConfig','6283926EmBrsC','string','getParameters','workflow_project','profiles','apiKey','llmAgent','(session:\x20','layers','existsSync','llm_agent','Global','profileCredentials','289939XAwSjG','segmentPath','14FJpXjn','globalCredentials','getSource','1SYkpVV','project','join','parentSegment','profile:\x20','180ervWzU','sessionId','TDX_SITE','cliFlags','7567109vuQpRN','verbose','CLI\x20flag:\x20--','activeProfile','2480080auSWep','assign','parse','segment_path','tdx.json'];a46_0x3593=function(){return _0xc67edb;};return a46_0x3593();}export class GlobalContext{[a46_0x3bd98c(0x1fc)];['database'];['parent_segment'];[a46_0x3bd98c(0x1f1)];[a46_0x3bd98c(0x1c1)];[a46_0x3bd98c(0x1d9)];['workflow_project'];[a46_0x3bd98c(0x1d4)];[a46_0x3bd98c(0x1eb)];['logLevel'];[a46_0x3bd98c(0x1f4)];['layers'];[a46_0x3bd98c(0x1ed)];[a46_0x3bd98c(0x1e7)];[a46_0x3bd98c(0x1c4)];constructor(_0x20c673){const _0x2aa8c4=a46_0x3bd98c;this['sessionId']=_0x20c673[_0x2aa8c4(0x1bc)]||getCurrentSessionPID()[_0x2aa8c4(0x1b9)]();const _0x131fa3=loadSessionContext(_0x20c673[_0x2aa8c4(0x1bc)]),_0x3dc6f7=loadProjectConfig(),_0x1b2e3f=this[_0x2aa8c4(0x1ce)]();this[_0x2aa8c4(0x1ed)]=_0x20c673['profile']||_0x131fa3?.[_0x2aa8c4(0x1f4)]||_0x1b2e3f[_0x2aa8c4(0x1f4)]||getActiveProfile();const _0x162850=this['activeProfile']?loadProfile(this[_0x2aa8c4(0x1ed)]):null,_0x3e44c5=_0x9897e0=>{const _0x3b3c52=_0x2aa8c4;if(!_0x9897e0)return{};const _0x3b6926=_0x9897e0,_0x299118={};for(const [_0x5427dc,_0x22df78]of Object[_0x3b3c52(0x1fb)](_0x3b6926)){typeof _0x22df78===_0x3b3c52(0x1d0)&&(_0x299118[_0x5427dc]=_0x22df78);}return _0x299118;},_0x3e99e8={};if(_0x20c673['site']&&_0x20c673[_0x2aa8c4(0x1fc)]!=='us01')_0x3e99e8[_0x2aa8c4(0x1fc)]=_0x20c673[_0x2aa8c4(0x1fc)];const _0x179eb1=_0x131fa3?.[_0x2aa8c4(0x1bb)],_0x25b521=_0x3dc6f7?.[_0x2aa8c4(0x1bb)],_0x536c40=_0x162850?.['config']?.['database'],_0x2aa382=_0x1b2e3f[_0x2aa8c4(0x1bb)];_0x20c673['database']&&(_0x20c673[_0x2aa8c4(0x1bb)]!==_0x179eb1&&_0x20c673[_0x2aa8c4(0x1bb)]!==_0x25b521&&_0x20c673[_0x2aa8c4(0x1bb)]!==_0x536c40&&_0x20c673['database']!==_0x2aa382)&&(_0x3e99e8[_0x2aa8c4(0x1bb)]=_0x20c673[_0x2aa8c4(0x1bb)]);if(_0x20c673[_0x2aa8c4(0x1e4)])_0x3e99e8[_0x2aa8c4(0x1fa)]=_0x20c673[_0x2aa8c4(0x1e4)];if(_0x20c673[_0x2aa8c4(0x1b8)])_0x3e99e8[_0x2aa8c4(0x1c1)]=_0x20c673[_0x2aa8c4(0x1b8)];if(_0x20c673['llmAgent'])_0x3e99e8[_0x2aa8c4(0x1d9)]=_0x20c673['llmAgent'];if(_0x20c673[_0x2aa8c4(0x1f4)])_0x3e99e8[_0x2aa8c4(0x1f4)]=_0x20c673[_0x2aa8c4(0x1f4)];this[_0x2aa8c4(0x1d7)]={'cliFlags':_0x3e99e8,'session':_0x3e44c5(_0x131fa3),'project':_0x3e44c5(_0x3dc6f7),'profile':_0x3e44c5(_0x162850?.['config']),'global':_0x3e44c5(_0x1b2e3f)};const _0x2c9336={...this['layers'][_0x2aa8c4(0x1cc)],...this[_0x2aa8c4(0x1d7)][_0x2aa8c4(0x1f4)],...this['layers'][_0x2aa8c4(0x1e2)]};process[_0x2aa8c4(0x1c3)][_0x2aa8c4(0x1e8)]&&!this[_0x2aa8c4(0x1d7)][_0x2aa8c4(0x1bc)][_0x2aa8c4(0x1fc)]&&!this[_0x2aa8c4(0x1d7)]['cliFlags']['site']&&(_0x2c9336[_0x2aa8c4(0x1fc)]=process['env'][_0x2aa8c4(0x1e8)]);Object['assign'](_0x2c9336,this[_0x2aa8c4(0x1d7)][_0x2aa8c4(0x1bc)]),Object[_0x2aa8c4(0x1ef)](_0x2c9336,this[_0x2aa8c4(0x1d7)][_0x2aa8c4(0x1e9)]);const _0x98b5f2=_0x2c9336['site']||'us01';this[_0x2aa8c4(0x1fc)]=resolveSite(_0x98b5f2),this[_0x2aa8c4(0x1bb)]=_0x2c9336[_0x2aa8c4(0x1bb)],this[_0x2aa8c4(0x1fa)]=_0x2c9336['parent_segment'],this['segment_path']=_0x2c9336['segment_path'],this['llm_project']=_0x2c9336['llm_project'],this['llm_agent']=_0x2c9336[_0x2aa8c4(0x1d9)],this['workflow_project']=_0x2c9336[_0x2aa8c4(0x1d2)],this[_0x2aa8c4(0x1eb)]=_0x20c673[_0x2aa8c4(0x1eb)]||![],this[_0x2aa8c4(0x1c9)]=_0x20c673[_0x2aa8c4(0x1c9)]??LogLevel[_0x2aa8c4(0x1cb)],this[_0x2aa8c4(0x1f4)]=this[_0x2aa8c4(0x1ed)]||undefined,this[_0x2aa8c4(0x1d4)]=getAPIKey(this[_0x2aa8c4(0x1fc)],this[_0x2aa8c4(0x1ed)]||undefined);const _0x4f08de=getConfigDir(),_0x354638=a46_0x4c2e04[_0x2aa8c4(0x1e3)](_0x4f08de,'sessions',this['sessionId']+_0x2aa8c4(0x1f7)),_0x382c9f=findProjectConfigPath(),_0x56c896=a46_0x4c2e04[_0x2aa8c4(0x1e3)](_0x4f08de,'tdx.json'),_0x2547a8=a46_0x4c2e04['join'](_0x4f08de,'.env');let _0x43bf0e=null,_0x4b0c88=null;this[_0x2aa8c4(0x1ed)]&&(_0x43bf0e=a46_0x4c2e04['join'](_0x4f08de,'profiles',this[_0x2aa8c4(0x1ed)],_0x2aa8c4(0x1f2)),_0x4b0c88=a46_0x4c2e04[_0x2aa8c4(0x1e3)](_0x4f08de,_0x2aa8c4(0x1d3),this[_0x2aa8c4(0x1ed)],_0x2aa8c4(0x1ba))),this[_0x2aa8c4(0x1c4)]={'session':a46_0x285248[_0x2aa8c4(0x1d8)](_0x354638)?_0x354638:null,'project':_0x382c9f,'profile':_0x43bf0e&&a46_0x285248[_0x2aa8c4(0x1d8)](_0x43bf0e)?_0x43bf0e:null,'profileCredentials':_0x4b0c88&&a46_0x285248[_0x2aa8c4(0x1d8)](_0x4b0c88)?_0x4b0c88:null,'global':a46_0x285248[_0x2aa8c4(0x1d8)](_0x56c896)?_0x56c896:null,'globalCredentials':a46_0x285248[_0x2aa8c4(0x1d8)](_0x2547a8)?_0x2547a8:null};}[a46_0x3bd98c(0x1e0)](_0x1e05f3,_0x29ea5e){const _0x2330a6=a46_0x3bd98c;if(!_0x29ea5e)return _0x2330a6(0x1ca);const _0x4839b2=_0x29ea5e;if(this['layers'][_0x2330a6(0x1e9)][_0x1e05f3]===_0x4839b2){if(_0x1e05f3===_0x2330a6(0x1fc)&&_0x4839b2==='us01'&&!this[_0x2330a6(0x1d7)][_0x2330a6(0x1bc)][_0x2330a6(0x1fc)]&&!this[_0x2330a6(0x1d7)]['project']['site']&&!this[_0x2330a6(0x1d7)][_0x2330a6(0x1f4)]['site']&&!this['layers']['global']['site'])return _0x2330a6(0x1bd);return _0x2330a6(0x1ec)+_0x1e05f3[_0x2330a6(0x1f5)](/_/g,'-');}if(this[_0x2330a6(0x1d7)][_0x2330a6(0x1bc)][_0x1e05f3]===_0x4839b2)return _0x2330a6(0x1bc);if(this[_0x2330a6(0x1d7)]['project'][_0x1e05f3]===_0x4839b2)return'project';if(this[_0x2330a6(0x1d7)][_0x2330a6(0x1f4)][_0x1e05f3]===_0x4839b2)return _0x2330a6(0x1e5)+this[_0x2330a6(0x1ed)];if(this[_0x2330a6(0x1d7)][_0x2330a6(0x1cc)][_0x1e05f3]===_0x4839b2)return _0x2330a6(0x1cc);return'default';}['loadGlobalConfig'](){const _0x567e1a=a46_0x3bd98c,_0x1152cc=a46_0x4c2e04[_0x567e1a(0x1e3)](getConfigDir(),'tdx.json');if(!a46_0x285248[_0x567e1a(0x1d8)](_0x1152cc))return{};try{const _0x2957c6=a46_0x285248['readFileSync'](_0x1152cc,_0x567e1a(0x1be));return JSON[_0x567e1a(0x1f0)](_0x2957c6);}catch{return{};}}['injectIntoOptions'](_0x1c4a88){const _0x5f70a2=a46_0x3bd98c;_0x1c4a88[_0x5f70a2(0x1fc)]=this[_0x5f70a2(0x1fc)],!_0x1c4a88['database']&&this[_0x5f70a2(0x1bb)]&&(_0x1c4a88[_0x5f70a2(0x1bb)]=this['database']),!_0x1c4a88[_0x5f70a2(0x1e4)]&&this[_0x5f70a2(0x1fa)]&&(_0x1c4a88[_0x5f70a2(0x1e4)]=this[_0x5f70a2(0x1fa)]),!_0x1c4a88[_0x5f70a2(0x1dd)]&&this[_0x5f70a2(0x1f1)]&&(_0x1c4a88[_0x5f70a2(0x1dd)]=this[_0x5f70a2(0x1f1)]),!_0x1c4a88['llmProject']&&this[_0x5f70a2(0x1c1)]&&(_0x1c4a88[_0x5f70a2(0x1b8)]=this[_0x5f70a2(0x1c1)]),!_0x1c4a88[_0x5f70a2(0x1d5)]&&this['llm_agent']&&(_0x1c4a88[_0x5f70a2(0x1d5)]=this['llm_agent']),!_0x1c4a88[_0x5f70a2(0x1c2)]&&this[_0x5f70a2(0x1d2)]&&(_0x1c4a88['workflowProject']=this[_0x5f70a2(0x1d2)]);}['getParameters'](){const _0x5cc1ae=a46_0x3bd98c;return[{'key':'site','value':this['site']},{'key':'database','value':this[_0x5cc1ae(0x1bb)]},{'key':_0x5cc1ae(0x1fa),'value':this[_0x5cc1ae(0x1fa)]},{'key':_0x5cc1ae(0x1f1),'value':this[_0x5cc1ae(0x1f1)]},{'key':_0x5cc1ae(0x1c1),'value':this['llm_project']},{'key':_0x5cc1ae(0x1d9),'value':this[_0x5cc1ae(0x1d9)]},{'key':_0x5cc1ae(0x1d2),'value':this['workflow_project']},{'key':_0x5cc1ae(0x1f4),'value':this[_0x5cc1ae(0x1ed)]||undefined}];}['display'](){const _0x57665e=a46_0x3bd98c;console[_0x57665e(0x1bf)](_0x57665e(0x1ff));for(const {key:_0x3e9b60,value:_0x5d3e2b}of this['getParameters']()){_0x5d3e2b&&console[_0x57665e(0x1bf)](_0x3e9b60+':\x20'+_0x5d3e2b);}}['displayWithSources'](){const _0x19fc4e=a46_0x3bd98c;console[_0x19fc4e(0x1bf)](_0x19fc4e(0x1ff));for(const {key:_0x30133d,value:_0x1a9874}of this[_0x19fc4e(0x1d1)]()){if(_0x1a9874){const _0x1bcccd=_0x30133d===_0x19fc4e(0x1f4)?_0x19fc4e(0x200):'('+this[_0x19fc4e(0x1e0)](_0x30133d,_0x1a9874)+')';console[_0x19fc4e(0x1bf)](_0x30133d+':\x20'+_0x1a9874+'\x20'+_0x1bcccd);}}console[_0x19fc4e(0x1bf)](_0x19fc4e(0x1c8));const _0x57560d=[{'label':'Session','path':this[_0x19fc4e(0x1c4)][_0x19fc4e(0x1bc)],'extra':_0x19fc4e(0x1d6)+this[_0x19fc4e(0x1e7)]+')'},{'label':'Project','path':this[_0x19fc4e(0x1c4)]['project']},{'label':_0x19fc4e(0x1c0),'path':this[_0x19fc4e(0x1c4)]['profile']},{'label':'Profile\x20Credentials','path':this['configFiles'][_0x19fc4e(0x1db)]},{'label':'Global','path':this[_0x19fc4e(0x1c4)][_0x19fc4e(0x1cc)]},{'label':_0x19fc4e(0x1cd),'path':this[_0x19fc4e(0x1c4)][_0x19fc4e(0x1df)]}];for(const {label:_0x49211b,path:_0x2cfa20,extra:_0x3d3564}of _0x57560d){if(_0x2cfa20)console[_0x19fc4e(0x1bf)](_0x49211b+':\x20'+_0x2cfa20+'\x20✓'+(_0x3d3564?'\x20'+_0x3d3564:''));else{if(_0x49211b===_0x19fc4e(0x1c5))console['log'](_0x49211b+':\x20none\x20(using\x20session:\x20'+this[_0x19fc4e(0x1e7)]+')');else(_0x49211b==='Project'||_0x49211b===_0x19fc4e(0x1da))&&console[_0x19fc4e(0x1bf)](_0x49211b+':\x20none');}}}async[a46_0x3bd98c(0x1c6)](){const _0x6643f2=a46_0x3bd98c;return this[_0x6643f2(0x1d4)]=await getAPIKeyAsync(this[_0x6643f2(0x1fc)],this[_0x6643f2(0x1ed)]||undefined),this[_0x6643f2(0x1d4)];}static async[a46_0x3bd98c(0x1fe)](_0x131979){const _0x417476=a46_0x3bd98c,_0x4c1a58=new GlobalContext(_0x131979);return await _0x4c1a58[_0x417476(0x1c6)](),_0x4c1a58;}}
1
+ const a46_0x26fb09=a46_0x5700;(function(_0x240e99,_0x3d0334){const _0x1031a2=a46_0x5700,_0x97d1e3=_0x240e99();while(!![]){try{const _0x3a9c60=parseInt(_0x1031a2(0xdc))/0x1+-parseInt(_0x1031a2(0xc4))/0x2+-parseInt(_0x1031a2(0x10a))/0x3*(parseInt(_0x1031a2(0xe9))/0x4)+-parseInt(_0x1031a2(0xe5))/0x5*(-parseInt(_0x1031a2(0xe4))/0x6)+-parseInt(_0x1031a2(0xec))/0x7*(-parseInt(_0x1031a2(0xd3))/0x8)+-parseInt(_0x1031a2(0xfa))/0x9+-parseInt(_0x1031a2(0xff))/0xa*(parseInt(_0x1031a2(0xc5))/0xb);if(_0x3a9c60===_0x3d0334)break;else _0x97d1e3['push'](_0x97d1e3['shift']());}catch(_0x325f02){_0x97d1e3['push'](_0x97d1e3['shift']());}}}(a46_0x5711,0x1f023));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';function a46_0x5711(){const _0x126632=['profile:\x20','profiles','parent_segment','llmAgent','site','cliFlags','toString','segment_path','193848rJaQxR','.env','log','\x0a[configuration\x20files]','Session','verbose','parentSegment',':\x20none\x20(using\x20session:\x20','672ijTLsG','9115nvJYYi','project','entries','join','8osQekY','llm_agent','logLevel','194642JbYTWD','apiKey',':\x20none','profileCredentials','segmentPath','Global','database','us01','workflowProject','existsSync','.json','activeProfile','assign','workflow_project','729423TASqWR','sessionId','config','resolveAPIKeyAsync','getParameters','98030CSnwLj','layers','llm_project','not\x20set','CLI\x20flag:\x20--','sessions','TDX_SITE','(active)','Global\x20Credentials','Profile','env','221703PxHPSL','replace','session','parse','configFiles','profile','205540HdaInw','88KzNUOx','utf-8','globalCredentials','Project','injectIntoOptions','tdx.json','default','displayWithSources','getSource','llmProject','string','INFO','display','global','40ajqGVT'];a46_0x5711=function(){return _0x126632;};return a46_0x5711();}import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a46_0x5700(_0x5388cd,_0x2f3956){_0x5388cd=_0x5388cd-0xbf;const _0x57110f=a46_0x5711();let _0x5700d7=_0x57110f[_0x5388cd];return _0x5700d7;}import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';import*as a46_0x27ea6b from'node:fs';import*as a46_0x202e9d from'node:path';export class GlobalContext{[a46_0x26fb09(0xd8)];[a46_0x26fb09(0xf2)];[a46_0x26fb09(0xd6)];['segment_path'];[a46_0x26fb09(0x101)];[a46_0x26fb09(0xea)];[a46_0x26fb09(0xf9)];[a46_0x26fb09(0xed)];[a46_0x26fb09(0xe1)];[a46_0x26fb09(0xeb)];[a46_0x26fb09(0xc3)];[a46_0x26fb09(0x100)];[a46_0x26fb09(0xf7)];[a46_0x26fb09(0xfb)];['configFiles'];constructor(_0x2c214a){const _0x3e4135=a46_0x26fb09;this[_0x3e4135(0xfb)]=_0x2c214a[_0x3e4135(0xc0)]||getCurrentSessionPID()[_0x3e4135(0xda)]();const _0x3866aa=loadSessionContext(_0x2c214a[_0x3e4135(0xc0)]),_0x6952ec=loadProjectConfig(),_0x33bb07=this['loadGlobalConfig']();this['activeProfile']=_0x2c214a['profile']||_0x3866aa?.[_0x3e4135(0xc3)]||_0x33bb07['profile']||getActiveProfile();const _0x54653b=this[_0x3e4135(0xf7)]?loadProfile(this['activeProfile']):null,_0x179ed3=_0x537ff5=>{const _0x405e7f=_0x3e4135;if(!_0x537ff5)return{};const _0x3b5337=_0x537ff5,_0x15aa70={};for(const [_0x308a00,_0x6b7335]of Object[_0x405e7f(0xe7)](_0x3b5337)){typeof _0x6b7335===_0x405e7f(0xcf)&&(_0x15aa70[_0x308a00]=_0x6b7335);}return _0x15aa70;},_0x63299a={};if(_0x2c214a['site']&&_0x2c214a['site']!==_0x3e4135(0xf3))_0x63299a[_0x3e4135(0xd8)]=_0x2c214a[_0x3e4135(0xd8)];const _0x2c9323=_0x3866aa?.[_0x3e4135(0xf2)],_0x1dbe7f=_0x6952ec?.[_0x3e4135(0xf2)],_0x451637=_0x54653b?.[_0x3e4135(0xfc)]?.['database'],_0x33d7a9=_0x33bb07['database'];_0x2c214a[_0x3e4135(0xf2)]&&(_0x2c214a[_0x3e4135(0xf2)]!==_0x2c9323&&_0x2c214a[_0x3e4135(0xf2)]!==_0x1dbe7f&&_0x2c214a[_0x3e4135(0xf2)]!==_0x451637&&_0x2c214a[_0x3e4135(0xf2)]!==_0x33d7a9)&&(_0x63299a[_0x3e4135(0xf2)]=_0x2c214a[_0x3e4135(0xf2)]);if(_0x2c214a[_0x3e4135(0xe2)])_0x63299a['parent_segment']=_0x2c214a[_0x3e4135(0xe2)];if(_0x2c214a['llmProject'])_0x63299a[_0x3e4135(0x101)]=_0x2c214a['llmProject'];if(_0x2c214a[_0x3e4135(0xd7)])_0x63299a[_0x3e4135(0xea)]=_0x2c214a['llmAgent'];if(_0x2c214a[_0x3e4135(0xc3)])_0x63299a['profile']=_0x2c214a[_0x3e4135(0xc3)];this['layers']={'cliFlags':_0x63299a,'session':_0x179ed3(_0x3866aa),'project':_0x179ed3(_0x6952ec),'profile':_0x179ed3(_0x54653b?.[_0x3e4135(0xfc)]),'global':_0x179ed3(_0x33bb07)};const _0x1a9f08={...this['layers'][_0x3e4135(0xd2)],...this[_0x3e4135(0x100)][_0x3e4135(0xc3)],...this[_0x3e4135(0x100)][_0x3e4135(0xe6)]};process[_0x3e4135(0x109)][_0x3e4135(0x105)]&&!this['layers'][_0x3e4135(0xc0)][_0x3e4135(0xd8)]&&!this[_0x3e4135(0x100)]['cliFlags'][_0x3e4135(0xd8)]&&(_0x1a9f08[_0x3e4135(0xd8)]=process['env'][_0x3e4135(0x105)]);Object[_0x3e4135(0xf8)](_0x1a9f08,this[_0x3e4135(0x100)][_0x3e4135(0xc0)]),Object['assign'](_0x1a9f08,this[_0x3e4135(0x100)][_0x3e4135(0xd9)]);const _0x8e094b=_0x1a9f08[_0x3e4135(0xd8)]||_0x3e4135(0xf3);this[_0x3e4135(0xd8)]=resolveSite(_0x8e094b),this[_0x3e4135(0xf2)]=_0x1a9f08[_0x3e4135(0xf2)],this[_0x3e4135(0xd6)]=_0x1a9f08[_0x3e4135(0xd6)],this[_0x3e4135(0xdb)]=_0x1a9f08[_0x3e4135(0xdb)],this[_0x3e4135(0x101)]=_0x1a9f08['llm_project'],this[_0x3e4135(0xea)]=_0x1a9f08['llm_agent'],this[_0x3e4135(0xf9)]=_0x1a9f08['workflow_project'],this[_0x3e4135(0xe1)]=_0x2c214a[_0x3e4135(0xe1)]||![],this[_0x3e4135(0xeb)]=_0x2c214a[_0x3e4135(0xeb)]??LogLevel[_0x3e4135(0xd0)],this['profile']=this[_0x3e4135(0xf7)]||undefined,this[_0x3e4135(0xed)]=getAPIKey(this[_0x3e4135(0xd8)],this[_0x3e4135(0xf7)]||undefined);const _0x5d9b8d=getConfigDir(),_0x57e225=a46_0x202e9d['join'](_0x5d9b8d,_0x3e4135(0x104),this['sessionId']+_0x3e4135(0xf6)),_0x3d2e7e=findProjectConfigPath(),_0x1cd949=a46_0x202e9d['join'](_0x5d9b8d,'tdx.json'),_0x50d86d=a46_0x202e9d[_0x3e4135(0xe8)](_0x5d9b8d,_0x3e4135(0xdd));let _0x124d79=null,_0x426934=null;this[_0x3e4135(0xf7)]&&(_0x124d79=a46_0x202e9d[_0x3e4135(0xe8)](_0x5d9b8d,_0x3e4135(0xd5),this[_0x3e4135(0xf7)],_0x3e4135(0xca)),_0x426934=a46_0x202e9d[_0x3e4135(0xe8)](_0x5d9b8d,_0x3e4135(0xd5),this['activeProfile'],_0x3e4135(0xdd))),this['configFiles']={'session':a46_0x27ea6b[_0x3e4135(0xf5)](_0x57e225)?_0x57e225:null,'project':_0x3d2e7e,'profile':_0x124d79&&a46_0x27ea6b[_0x3e4135(0xf5)](_0x124d79)?_0x124d79:null,'profileCredentials':_0x426934&&a46_0x27ea6b[_0x3e4135(0xf5)](_0x426934)?_0x426934:null,'global':a46_0x27ea6b[_0x3e4135(0xf5)](_0x1cd949)?_0x1cd949:null,'globalCredentials':a46_0x27ea6b['existsSync'](_0x50d86d)?_0x50d86d:null};}[a46_0x26fb09(0xcd)](_0x291faa,_0x3bbf16){const _0x78f926=a46_0x26fb09;if(!_0x3bbf16)return _0x78f926(0x102);const _0x3c419a=_0x3bbf16;if(this['layers']['cliFlags'][_0x291faa]===_0x3c419a){if(_0x291faa===_0x78f926(0xd8)&&_0x3c419a===_0x78f926(0xf3)&&!this[_0x78f926(0x100)][_0x78f926(0xc0)][_0x78f926(0xd8)]&&!this[_0x78f926(0x100)][_0x78f926(0xe6)][_0x78f926(0xd8)]&&!this[_0x78f926(0x100)]['profile'][_0x78f926(0xd8)]&&!this[_0x78f926(0x100)]['global'][_0x78f926(0xd8)])return _0x78f926(0xcb);return _0x78f926(0x103)+_0x291faa[_0x78f926(0xbf)](/_/g,'-');}if(this[_0x78f926(0x100)][_0x78f926(0xc0)][_0x291faa]===_0x3c419a)return'session';if(this[_0x78f926(0x100)][_0x78f926(0xe6)][_0x291faa]===_0x3c419a)return _0x78f926(0xe6);if(this[_0x78f926(0x100)][_0x78f926(0xc3)][_0x291faa]===_0x3c419a)return _0x78f926(0xd4)+this[_0x78f926(0xf7)];if(this[_0x78f926(0x100)][_0x78f926(0xd2)][_0x291faa]===_0x3c419a)return'global';return _0x78f926(0xcb);}['loadGlobalConfig'](){const _0x4c06d8=a46_0x26fb09,_0x233502=a46_0x202e9d['join'](getConfigDir(),_0x4c06d8(0xca));if(!a46_0x27ea6b[_0x4c06d8(0xf5)](_0x233502))return{};try{const _0x405998=a46_0x27ea6b['readFileSync'](_0x233502,_0x4c06d8(0xc6));return JSON[_0x4c06d8(0xc1)](_0x405998);}catch{return{};}}[a46_0x26fb09(0xc9)](_0x327ec8){const _0x3bb30c=a46_0x26fb09;_0x327ec8[_0x3bb30c(0xd8)]=this[_0x3bb30c(0xd8)],!_0x327ec8[_0x3bb30c(0xf2)]&&this[_0x3bb30c(0xf2)]&&(_0x327ec8[_0x3bb30c(0xf2)]=this[_0x3bb30c(0xf2)]),!_0x327ec8['parentSegment']&&this[_0x3bb30c(0xd6)]&&(_0x327ec8['parentSegment']=this[_0x3bb30c(0xd6)]),!_0x327ec8[_0x3bb30c(0xf0)]&&this['segment_path']&&(_0x327ec8[_0x3bb30c(0xf0)]=this[_0x3bb30c(0xdb)]),!_0x327ec8[_0x3bb30c(0xce)]&&this['llm_project']&&(_0x327ec8[_0x3bb30c(0xce)]=this[_0x3bb30c(0x101)]),!_0x327ec8['llmAgent']&&this['llm_agent']&&(_0x327ec8[_0x3bb30c(0xd7)]=this[_0x3bb30c(0xea)]),!_0x327ec8[_0x3bb30c(0xf4)]&&this[_0x3bb30c(0xf9)]&&(_0x327ec8['workflowProject']=this['workflow_project']);}[a46_0x26fb09(0xfe)](){const _0x1f7ac1=a46_0x26fb09;return[{'key':_0x1f7ac1(0xd8),'value':this[_0x1f7ac1(0xd8)]},{'key':'database','value':this[_0x1f7ac1(0xf2)]},{'key':_0x1f7ac1(0xd6),'value':this['parent_segment']},{'key':_0x1f7ac1(0xdb),'value':this[_0x1f7ac1(0xdb)]},{'key':_0x1f7ac1(0x101),'value':this[_0x1f7ac1(0x101)]},{'key':'llm_agent','value':this[_0x1f7ac1(0xea)]},{'key':'workflow_project','value':this[_0x1f7ac1(0xf9)]},{'key':_0x1f7ac1(0xc3),'value':this[_0x1f7ac1(0xf7)]||undefined}];}[a46_0x26fb09(0xd1)](){const _0x48745d=a46_0x26fb09;console[_0x48745d(0xde)]('[context]');for(const {key:_0x2f0953,value:_0x5323fb}of this[_0x48745d(0xfe)]()){_0x5323fb&&console[_0x48745d(0xde)](_0x2f0953+':\x20'+_0x5323fb);}}[a46_0x26fb09(0xcc)](){const _0x307f3=a46_0x26fb09;console[_0x307f3(0xde)]('[context]');for(const {key:_0x2f7245,value:_0x273ca6}of this['getParameters']()){if(_0x273ca6){const _0x1f3e01=_0x2f7245==='profile'?_0x307f3(0x106):'('+this[_0x307f3(0xcd)](_0x2f7245,_0x273ca6)+')';console[_0x307f3(0xde)](_0x2f7245+':\x20'+_0x273ca6+'\x20'+_0x1f3e01);}}console[_0x307f3(0xde)](_0x307f3(0xdf));const _0x5aa1b1=[{'label':'Session','path':this[_0x307f3(0xc2)][_0x307f3(0xc0)],'extra':'(session:\x20'+this[_0x307f3(0xfb)]+')'},{'label':_0x307f3(0xc8),'path':this[_0x307f3(0xc2)][_0x307f3(0xe6)]},{'label':_0x307f3(0x108),'path':this[_0x307f3(0xc2)][_0x307f3(0xc3)]},{'label':'Profile\x20Credentials','path':this[_0x307f3(0xc2)][_0x307f3(0xef)]},{'label':'Global','path':this[_0x307f3(0xc2)][_0x307f3(0xd2)]},{'label':_0x307f3(0x107),'path':this[_0x307f3(0xc2)][_0x307f3(0xc7)]}];for(const {label:_0x36f5ef,path:_0x319809,extra:_0x577bd2}of _0x5aa1b1){if(_0x319809)console[_0x307f3(0xde)](_0x36f5ef+':\x20'+_0x319809+'\x20✓'+(_0x577bd2?'\x20'+_0x577bd2:''));else{if(_0x36f5ef===_0x307f3(0xe0))console[_0x307f3(0xde)](_0x36f5ef+_0x307f3(0xe3)+this['sessionId']+')');else(_0x36f5ef===_0x307f3(0xc8)||_0x36f5ef===_0x307f3(0xf1))&&console[_0x307f3(0xde)](_0x36f5ef+_0x307f3(0xee));}}}async[a46_0x26fb09(0xfd)](){const _0x13b490=a46_0x26fb09;return this[_0x13b490(0xed)]=await getAPIKeyAsync(this['site'],this[_0x13b490(0xf7)]||undefined),this['apiKey'];}static async['createAsync'](_0x32ca4c){const _0x3cc5e9=a46_0x26fb09,_0x235380=new GlobalContext(_0x32ca4c);return await _0x235380[_0x3cc5e9(0xfd)](),_0x235380;}}
@@ -1 +1 @@
1
- const a47_0x575496=a47_0x46c4;(function(_0x40cd73,_0x126067){const _0x568bf0=a47_0x46c4,_0x2652ec=_0x40cd73();while(!![]){try{const _0x33267b=parseInt(_0x568bf0(0xcb))/0x1+parseInt(_0x568bf0(0xbe))/0x2*(parseInt(_0x568bf0(0xd5))/0x3)+-parseInt(_0x568bf0(0xc7))/0x4*(-parseInt(_0x568bf0(0xd8))/0x5)+-parseInt(_0x568bf0(0xcf))/0x6+-parseInt(_0x568bf0(0xd7))/0x7+-parseInt(_0x568bf0(0xc3))/0x8+parseInt(_0x568bf0(0xbc))/0x9*(parseInt(_0x568bf0(0xdb))/0xa);if(_0x33267b===_0x126067)break;else _0x2652ec['push'](_0x2652ec['shift']());}catch(_0x3ffcf7){_0x2652ec['push'](_0x2652ec['shift']());}}}(a47_0x58dd,0xb649e));function a47_0x58dd(){const _0x26e742=['error','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.','839490XpHIgq','keyring','7268548waAtHe','200mJwqVg','@zowe/secrets-for-zowe-sdk','cannot\x20find','7856710vFlJKf','restricted','reason','access_denied','tdx','success','profile:','18VficfT','setPassword','4JmwLfs','value','not\x20supported','getPassword',':api_key','2737120FfKYcj','not\x20found','System\x20keychain\x20is\x20not\x20available','includes','10484eQdOyU','unavailable','Warning:\x20','not_found','1058010aFhiwr','could\x20not\x20be\x20found','__keychain_test__','-25300','7000164rCsnxK','message','toLowerCase','-25293'];a47_0x58dd=function(){return _0x26e742;};return a47_0x58dd();}const SERVICE_NAME=a47_0x575496(0xdf);let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x5aa2aa=a47_0x575496;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x1b7b4e=await import(_0x5aa2aa(0xd9));return keyringModule=_0x1b7b4e[_0x5aa2aa(0xd6)],keyringModule;}catch(_0x402eb2){return keyringLoadError=_0x402eb2 instanceof Error?_0x402eb2:new Error(String(_0x402eb2)),null;}}function getAccountName(_0xe18798){const _0x388150=a47_0x575496,_0xb389fc=_0xe18798||'';return _0x388150(0xbb)+_0xb389fc+_0x388150(0xc2);}function a47_0x46c4(_0x46865f,_0x101575){_0x46865f=_0x46865f-0xbb;const _0x58dd3c=a47_0x58dd();let _0x46c410=_0x58dd3c[_0x46865f];return _0x46c410;}export async function getKeychainAPIKey(_0x306185){const _0x9fb655=a47_0x575496,_0x1ac6a5=await getKeychainAPIKeyWithStatus(_0x306185);if(_0x1ac6a5[_0x9fb655(0xe0)])return _0x1ac6a5[_0x9fb655(0xbf)];return _0x1ac6a5[_0x9fb655(0xdd)]===_0x9fb655(0xde)&&console[_0x9fb655(0xd3)](_0x9fb655(0xc9)+_0x1ac6a5['message']),null;}export async function getKeychainAPIKeyWithStatus(_0x5548b7){const _0x1ddde3=a47_0x575496;try{const _0x2124cd=await getKeyring();if(!_0x2124cd)return{'success':![],'reason':_0x1ddde3(0xc8)};const _0x47be60=getAccountName(_0x5548b7),_0x2b405b=await _0x2124cd['getPassword'](SERVICE_NAME,_0x47be60);if(_0x2b405b)return{'success':!![],'value':_0x2b405b};return{'success':![],'reason':_0x1ddde3(0xca)};}catch(_0x8c2160){const _0x1fb3ad=_0x8c2160 instanceof Error?_0x8c2160[_0x1ddde3(0xd0)]:String(_0x8c2160);if(_0x1fb3ad['includes'](_0x1ddde3(0xce))||_0x1fb3ad[_0x1ddde3(0xd1)]()['includes'](_0x1ddde3(0xcc))||_0x1fb3ad['toLowerCase']()['includes'](_0x1ddde3(0xc4)))return{'success':![],'reason':_0x1ddde3(0xca)};if(_0x1fb3ad[_0x1ddde3(0xc6)](_0x1ddde3(0xd2))||_0x1fb3ad[_0x1ddde3(0xd1)]()[_0x1ddde3(0xc6)](_0x1ddde3(0xdc))||_0x1fb3ad['toLowerCase']()[_0x1ddde3(0xc6)]('access'))return{'success':![],'reason':_0x1ddde3(0xde),'message':_0x1ddde3(0xd4)};return{'success':![],'reason':_0x1ddde3(0xc8),'message':_0x1fb3ad};}}export async function saveKeychainAPIKey(_0x42f863,_0x1f1e16){const _0x32fc2a=a47_0x575496,_0x57f817=await getKeyring();if(!_0x57f817)throw new Error(_0x32fc2a(0xc5));const _0x3255c6=getAccountName(_0x1f1e16);await _0x57f817[_0x32fc2a(0xbd)](SERVICE_NAME,_0x3255c6,_0x42f863);}export async function deleteKeychainAPIKey(_0x1d71cf){try{const _0x5daad0=await getKeyring();if(!_0x5daad0)return![];const _0xee1707=getAccountName(_0x1d71cf);return await _0x5daad0['deletePassword'](SERVICE_NAME,_0xee1707);}catch{return![];}}export async function isKeychainAvailable(){const _0x548609=a47_0x575496;try{const _0x15467a=await getKeyring();if(!_0x15467a)return![];return await _0x15467a[_0x548609(0xc1)](SERVICE_NAME,_0x548609(0xcd)),!![];}catch(_0x56b9f6){const _0xd66cad=_0x56b9f6 instanceof Error?_0x56b9f6['message'][_0x548609(0xd1)]():'';if(_0xd66cad[_0x548609(0xc6)]('not\x20available')||_0xd66cad['includes'](_0x548609(0xc0))||_0xd66cad['includes'](_0x548609(0xda)))return![];return!![];}}
1
+ function a47_0x179a(){const _0xa6da0=['-25300','setPassword',':api_key','getPassword','16943883vJwjoo','deletePassword','message','15670OLiZtI','6WcrawJ','870850yglrkg','toLowerCase','error','unavailable','3afKnxG','access','@zowe/secrets-for-zowe-sdk','profile:','could\x20not\x20be\x20found','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.','1513144WYWMMF','Warning:\x20','3223825favNDY','restricted','8UjhcIp','access_denied','5055701HZTJpY','includes','not\x20available','not\x20found','not_found','reason','100tSPXtv','273447EptAyr','value','-25293'];a47_0x179a=function(){return _0xa6da0;};return a47_0x179a();}(function(_0x1a862d,_0x358955){const _0x4b318a=a47_0x24e0,_0x517b3a=_0x1a862d();while(!![]){try{const _0x28590d=-parseInt(_0x4b318a(0x1a0))/0x1*(-parseInt(_0x4b318a(0x1ab))/0x2)+parseInt(_0x4b318a(0x1b1))/0x3*(-parseInt(_0x4b318a(0x1b7))/0x4)+-parseInt(_0x4b318a(0x1b9))/0x5+parseInt(_0x4b318a(0x1ac))/0x6*(-parseInt(_0x4b318a(0x19a))/0x7)+parseInt(_0x4b318a(0x1bb))/0x8*(-parseInt(_0x4b318a(0x1a1))/0x9)+-parseInt(_0x4b318a(0x1ad))/0xa+parseInt(_0x4b318a(0x1a8))/0xb;if(_0x28590d===_0x358955)break;else _0x517b3a['push'](_0x517b3a['shift']());}catch(_0x18de26){_0x517b3a['push'](_0x517b3a['shift']());}}}(a47_0x179a,0x70923));const SERVICE_NAME='tdx';let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0x15f7c5=a47_0x24e0;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x344ddc=await import(_0x15f7c5(0x1b3));return keyringModule=_0x344ddc['keyring'],keyringModule;}catch(_0x12407c){return keyringLoadError=_0x12407c instanceof Error?_0x12407c:new Error(String(_0x12407c)),null;}}function a47_0x24e0(_0x2dc729,_0x584a9b){_0x2dc729=_0x2dc729-0x199;const _0x179a79=a47_0x179a();let _0x24e0dd=_0x179a79[_0x2dc729];return _0x24e0dd;}function getAccountName(_0xf9d644){const _0x1ce38c=a47_0x24e0,_0x3892a8=_0xf9d644||'';return _0x1ce38c(0x1b4)+_0x3892a8+_0x1ce38c(0x1a6);}export async function getKeychainAPIKey(_0xbcfdc1){const _0x5ebda7=a47_0x24e0,_0xd615d2=await getKeychainAPIKeyWithStatus(_0xbcfdc1);if(_0xd615d2['success'])return _0xd615d2[_0x5ebda7(0x1a2)];return _0xd615d2[_0x5ebda7(0x19f)]==='access_denied'&&console[_0x5ebda7(0x1af)](_0x5ebda7(0x1b8)+_0xd615d2[_0x5ebda7(0x1aa)]),null;}export async function getKeychainAPIKeyWithStatus(_0x3ed431){const _0x453f1f=a47_0x24e0;try{const _0x4af4fd=await getKeyring();if(!_0x4af4fd)return{'success':![],'reason':_0x453f1f(0x1b0)};const _0x5afc7c=getAccountName(_0x3ed431),_0x440480=await _0x4af4fd[_0x453f1f(0x1a7)](SERVICE_NAME,_0x5afc7c);if(_0x440480)return{'success':!![],'value':_0x440480};return{'success':![],'reason':_0x453f1f(0x19e)};}catch(_0x7f604){const _0x322d0d=_0x7f604 instanceof Error?_0x7f604[_0x453f1f(0x1aa)]:String(_0x7f604);if(_0x322d0d[_0x453f1f(0x19b)](_0x453f1f(0x1a4))||_0x322d0d[_0x453f1f(0x1ae)]()[_0x453f1f(0x19b)](_0x453f1f(0x1b5))||_0x322d0d['toLowerCase']()[_0x453f1f(0x19b)](_0x453f1f(0x19d)))return{'success':![],'reason':_0x453f1f(0x19e)};if(_0x322d0d[_0x453f1f(0x19b)](_0x453f1f(0x1a3))||_0x322d0d[_0x453f1f(0x1ae)]()[_0x453f1f(0x19b)](_0x453f1f(0x1ba))||_0x322d0d[_0x453f1f(0x1ae)]()[_0x453f1f(0x19b)](_0x453f1f(0x1b2)))return{'success':![],'reason':_0x453f1f(0x199),'message':_0x453f1f(0x1b6)};return{'success':![],'reason':_0x453f1f(0x1b0),'message':_0x322d0d};}}export async function saveKeychainAPIKey(_0x385b3f,_0x14d975){const _0x4a7252=a47_0x24e0,_0xf8b097=await getKeyring();if(!_0xf8b097)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x33b9ce=getAccountName(_0x14d975);await _0xf8b097[_0x4a7252(0x1a5)](SERVICE_NAME,_0x33b9ce,_0x385b3f);}export async function deleteKeychainAPIKey(_0x2fe185){const _0x3281a5=a47_0x24e0;try{const _0x34bae0=await getKeyring();if(!_0x34bae0)return![];const _0x175cb4=getAccountName(_0x2fe185);return await _0x34bae0[_0x3281a5(0x1a9)](SERVICE_NAME,_0x175cb4);}catch{return![];}}export async function isKeychainAvailable(){const _0xaf1649=a47_0x24e0;try{const _0x34c034=await getKeyring();if(!_0x34c034)return![];return await _0x34c034[_0xaf1649(0x1a7)](SERVICE_NAME,'__keychain_test__'),!![];}catch(_0x5b6bc3){const _0xbc6028=_0x5b6bc3 instanceof Error?_0x5b6bc3[_0xaf1649(0x1aa)][_0xaf1649(0x1ae)]():'';if(_0xbc6028[_0xaf1649(0x19b)](_0xaf1649(0x19c))||_0xbc6028[_0xaf1649(0x19b)]('not\x20supported')||_0xbc6028[_0xaf1649(0x19b)]('cannot\x20find'))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0xc5dc70,_0x262e1e){const _0x3d6974=a48_0x55e2,_0x227f81=_0xc5dc70();while(!![]){try{const _0x1407e1=-parseInt(_0x3d6974(0x125))/0x1+parseInt(_0x3d6974(0x13b))/0x2*(-parseInt(_0x3d6974(0x144))/0x3)+parseInt(_0x3d6974(0x165))/0x4*(parseInt(_0x3d6974(0x156))/0x5)+-parseInt(_0x3d6974(0x132))/0x6+parseInt(_0x3d6974(0x140))/0x7+-parseInt(_0x3d6974(0x11e))/0x8*(parseInt(_0x3d6974(0x11f))/0x9)+parseInt(_0x3d6974(0x169))/0xa;if(_0x1407e1===_0x262e1e)break;else _0x227f81['push'](_0x227f81['shift']());}catch(_0x52cbd4){_0x227f81['push'](_0x227f81['shift']());}}}(a48_0x3f80,0xe2aa7));import*as a48_0x50d644 from'node:fs';import*as a48_0x1132ae 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(_0x97984b){const _0x4ea819={};if(!_0x97984b)return _0x4ea819;for(const [_0xfb7275,_0x5f0685]of Object['entries'](_0x97984b)){_0xfb7275!=='description'&&_0x5f0685!==undefined&&(_0x4ea819[_0xfb7275]=_0x5f0685);}return _0x4ea819;}export function getProfilesDir(){const _0x615941=a48_0x55e2;return a48_0x1132ae['join'](getConfigDir(),_0x615941(0x14c));}function getProfileDir(_0x5a5bd0){const _0x45fac7=a48_0x55e2;return a48_0x1132ae[_0x45fac7(0x12e)](getProfilesDir(),_0x5a5bd0);}function getProfileConfigPath(_0x3fb2e8){const _0xacfc7a=a48_0x55e2;return a48_0x1132ae[_0xacfc7a(0x12e)](getProfileDir(_0x3fb2e8),'tdx.json');}function getProfileEnvPath(_0x2fd866){const _0x183dd8=a48_0x55e2;return a48_0x1132ae[_0x183dd8(0x12e)](getProfileDir(_0x2fd866),_0x183dd8(0x164));}function getGlobalConfigPath(){const _0xc7f199=a48_0x55e2;return a48_0x1132ae['join'](getConfigDir(),_0xc7f199(0x15c));}function validateProfileName(_0x739583){const _0x3faeb2=a48_0x55e2;if(!/^[a-zA-Z0-9_-]+$/[_0x3faeb2(0x141)](_0x739583))throw new Error(_0x3faeb2(0x168)+_0x739583+_0x3faeb2(0x15d));}function validateProfileConfig(_0x4ca07d,_0xef0a45){const _0x288368=a48_0x55e2;if(typeof _0x4ca07d!==_0x288368(0x147)||_0x4ca07d===null)throw new Error(_0x288368(0x13d)+_0xef0a45+_0x288368(0x124));const _0x509d21=[_0x288368(0x12b),'site','database',_0x288368(0x12c),_0x288368(0x12a),_0x288368(0x157)],_0x8107c8=_0x4ca07d;for(const _0x96f1fa of Object[_0x288368(0x15a)](_0x8107c8)){!_0x509d21[_0x288368(0x129)](_0x96f1fa)&&console[_0x288368(0x128)]('Warning:\x20Profile\x20\x27'+_0xef0a45+_0x288368(0x138)+_0x96f1fa+_0x288368(0x136));}if(_0x8107c8[_0x288368(0x12b)]!==undefined&&typeof _0x8107c8[_0x288368(0x12b)]!=='string')throw new Error(_0x288368(0x13d)+_0xef0a45+_0x288368(0x123));if(_0x8107c8[_0x288368(0x150)]!==undefined&&typeof _0x8107c8[_0x288368(0x150)]!=='string')throw new Error(_0x288368(0x13d)+_0xef0a45+_0x288368(0x134));if(_0x8107c8[_0x288368(0x148)]!==undefined&&typeof _0x8107c8['database']!=='string')throw new Error(_0x288368(0x13d)+_0xef0a45+_0x288368(0x166));if(_0x8107c8['parent_segment']!==undefined&&typeof _0x8107c8['parent_segment']!==_0x288368(0x120))throw new Error(_0x288368(0x13d)+_0xef0a45+_0x288368(0x15f));if(_0x8107c8[_0x288368(0x12a)]!==undefined&&typeof _0x8107c8[_0x288368(0x12a)]!==_0x288368(0x120))throw new Error(_0x288368(0x13d)+_0xef0a45+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x8107c8[_0x288368(0x157)]!==undefined&&typeof _0x8107c8['llm_agent']!==_0x288368(0x120))throw new Error(_0x288368(0x13d)+_0xef0a45+_0x288368(0x137));return!![];}function loadProfilesFromTdxJson(_0x4a33ae,_0x33d91e){const _0x55dfcf=a48_0x55e2;if(!a48_0x50d644['existsSync'](_0x4a33ae))return[];try{const _0x345e64=a48_0x50d644[_0x55dfcf(0x14a)](_0x4a33ae,'utf-8'),_0x297d75=JSON[_0x55dfcf(0x15b)](_0x345e64);if(!_0x297d75[_0x55dfcf(0x14c)]||typeof _0x297d75[_0x55dfcf(0x14c)]!=='object')return[];const _0x528f4c=[];for(const [_0x7bef4a,_0x1e28e2]of Object[_0x55dfcf(0x167)](_0x297d75[_0x55dfcf(0x14c)])){try{validateProfileConfig(_0x1e28e2,_0x7bef4a);const _0x49f751=getNewCredentialPath(_0x7bef4a),_0x3ecc7a=getOldCredentialPath(_0x7bef4a),_0x38d85b=a48_0x50d644[_0x55dfcf(0x162)](_0x49f751)||a48_0x50d644[_0x55dfcf(0x162)](_0x3ecc7a);_0x528f4c[_0x55dfcf(0x158)]({'name':_0x7bef4a,'config':_0x1e28e2,'metadata':{'name':_0x7bef4a,'createdAt':new Date()[_0x55dfcf(0x14b)]()},'hasCredentials':_0x38d85b,'scope':_0x33d91e});}catch(_0x5e94a8){_0x5e94a8 instanceof Error&&(console[_0x55dfcf(0x128)](_0x55dfcf(0x131)+_0x4a33ae+':'),console[_0x55dfcf(0x128)]('\x20\x20'+_0x5e94a8[_0x55dfcf(0x163)]+'\x0a'));}}return _0x528f4c;}catch(_0x44fa0b){return _0x44fa0b instanceof SyntaxError?(console[_0x55dfcf(0x128)](_0x55dfcf(0x12d)+_0x4a33ae+':\x20Invalid\x20JSON\x20syntax'),console[_0x55dfcf(0x128)](_0x55dfcf(0x152)+_0x44fa0b[_0x55dfcf(0x163)]+'\x0a')):console[_0x55dfcf(0x128)]('\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20'+_0x4a33ae+':\x20'+_0x44fa0b+'\x0a'),[];}}export function getNewCredentialPath(_0x8ffbed){return a48_0x1132ae['join'](getConfigDir(),'.env.'+_0x8ffbed);}function getOldCredentialPath(_0x53226e){const _0x4df7b6=a48_0x55e2;return a48_0x1132ae[_0x4df7b6(0x12e)](getProfilesDir(),_0x53226e,_0x4df7b6(0x164));}function loadProfilesFromTdxJsonFiles(){const _0x1ab142=a48_0x55e2,_0x5ba7a4=[],_0x5068f9=findProjectConfigPath();_0x5068f9&&_0x5ba7a4['push'](...loadProfilesFromTdxJson(_0x5068f9,'local'));const _0x12ad68=a48_0x1132ae[_0x1ab142(0x12e)](getConfigDir(),_0x1ab142(0x15c));return _0x5ba7a4[_0x1ab142(0x158)](...loadProfilesFromTdxJson(_0x12ad68,_0x1ab142(0x145))),_0x5ba7a4;}function loadProfilesFromDirectories(){const _0x1f7d07=a48_0x55e2,_0x16bd37=getProfilesDir();if(!a48_0x50d644['existsSync'](_0x16bd37))return[];try{return a48_0x50d644[_0x1f7d07(0x14f)](_0x16bd37,{'withFileTypes':!![]})['filter'](_0x302ba9=>_0x302ba9[_0x1f7d07(0x130)]())[_0x1f7d07(0x155)](_0x4cc737=>_0x4cc737[_0x1f7d07(0x127)])[_0x1f7d07(0x135)](_0x2a93c6=>{const _0x8f23b2=_0x1f7d07,_0x2a26bf=getProfileConfigPath(_0x2a93c6),_0x5a304b=getProfileEnvPath(_0x2a93c6);return a48_0x50d644[_0x8f23b2(0x162)](_0x2a26bf)||a48_0x50d644[_0x8f23b2(0x162)](_0x5a304b);})[_0x1f7d07(0x155)](_0x4227d8=>{const _0x1ed0b7=_0x1f7d07,_0x549eb5=loadProfileFromDirectory(_0x4227d8);if(_0x549eb5)return{..._0x549eb5,'scope':_0x1ed0b7(0x14e)};return null;})[_0x1f7d07(0x135)](_0x36bbb0=>_0x36bbb0!==null);}catch{return[];}}function loadProfileFromDirectory(_0x9c8bcc){const _0x1c7229=a48_0x55e2,_0x49ffe5=getProfileConfigPath(_0x9c8bcc),_0xc2883=getOldCredentialPath(_0x9c8bcc);if(!a48_0x50d644[_0x1c7229(0x162)](_0x49ffe5)&&!a48_0x50d644[_0x1c7229(0x162)](_0xc2883))return null;let _0x21fa1b={},_0x9b46c1={'name':_0x9c8bcc,'createdAt':new Date()[_0x1c7229(0x14b)]()};if(a48_0x50d644[_0x1c7229(0x162)](_0x49ffe5))try{const _0x400412=a48_0x50d644['readFileSync'](_0x49ffe5,_0x1c7229(0x159)),_0x54d52a=JSON[_0x1c7229(0x15b)](_0x400412),{metadata:_0x5c4aa6,..._0xefc304}=_0x54d52a;_0x21fa1b=_0xefc304,_0x5c4aa6&&(_0x9b46c1=_0x5c4aa6);}catch{}return{'name':_0x9c8bcc,'config':_0x21fa1b,'metadata':_0x9b46c1,'hasCredentials':a48_0x50d644[_0x1c7229(0x162)](_0xc2883),'scope':_0x1c7229(0x14e)};}export function listProfiles(){const _0x2d719e=a48_0x55e2,_0x3bbba8=loadProfilesFromTdxJsonFiles(),_0x419f06=loadProfilesFromDirectories();if(_0x419f06[_0x2d719e(0x142)]>0x0){const _0x207ed5=_0x419f06['map'](_0x21451c=>_0x21451c[_0x2d719e(0x127)])[_0x2d719e(0x12e)](',\x20'),_0xd98588=getConfigDir();console[_0x2d719e(0x128)](_0x2d719e(0x146)+_0x207ed5),console['warn'](_0x2d719e(0x11c)),console[_0x2d719e(0x128)](_0x2d719e(0x15e)+a48_0x1132ae['join'](_0xd98588,'tdx.json')),console[_0x2d719e(0x128)](_0x2d719e(0x121)),console['warn']('\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a');}const _0x4f997d=[..._0x3bbba8,..._0x419f06],_0xadb292=new Map();for(const _0x3fca53 of _0x4f997d){!_0xadb292[_0x2d719e(0x149)](_0x3fca53[_0x2d719e(0x127)])&&_0xadb292['set'](_0x3fca53['name'],_0x3fca53);}return Array[_0x2d719e(0x143)](_0xadb292[_0x2d719e(0x126)]())['sort']((_0x314e73,_0x1d830f)=>_0x314e73[_0x2d719e(0x127)][_0x2d719e(0x133)](_0x1d830f[_0x2d719e(0x127)]));}export function profileExists(_0x7d3f58){const _0xc45684=a48_0x55e2,_0x24bc8e=listProfiles();return _0x24bc8e['some'](_0x9edf69=>_0x9edf69[_0xc45684(0x127)]===_0x7d3f58);}export function loadProfile(_0x52b06d){const _0xa89b7e=a48_0x55e2;validateProfileName(_0x52b06d);const _0x135736=listProfiles(),_0x463034=_0x135736[_0xa89b7e(0x13a)](_0x74c5a7=>_0x74c5a7[_0xa89b7e(0x127)]===_0x52b06d);return _0x463034||null;}export function saveProfile(_0x1e48d1,_0x103e1d,_0x3b80ef=![]){saveProfileToUserConfig(_0x1e48d1,_0x103e1d);}export function deleteProfile(_0x48c678){const _0x2e6dd=a48_0x55e2;validateProfileName(_0x48c678);const _0x390128=getProfileDir(_0x48c678);if(!a48_0x50d644[_0x2e6dd(0x162)](_0x390128))throw new Error(_0x2e6dd(0x14d)+_0x48c678+_0x2e6dd(0x154));a48_0x50d644[_0x2e6dd(0x151)](_0x390128,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x3d5637,_0x498362){const _0x3d75a2=a48_0x55e2;validateProfileName(_0x3d5637);const _0x55c001=getGlobalConfigPath(),_0x251dbf=getConfigDir();!a48_0x50d644[_0x3d75a2(0x162)](_0x251dbf)&&createSecureDirectory(_0x251dbf);let _0x2663f2={};if(a48_0x50d644[_0x3d75a2(0x162)](_0x55c001))try{const _0x5b40b1=a48_0x50d644['readFileSync'](_0x55c001,'utf-8');_0x2663f2=JSON['parse'](_0x5b40b1);}catch{console[_0x3d75a2(0x128)](_0x3d75a2(0x13e)+_0x55c001+_0x3d75a2(0x13f));}!_0x2663f2[_0x3d75a2(0x14c)]&&(_0x2663f2[_0x3d75a2(0x14c)]={}),_0x2663f2[_0x3d75a2(0x14c)][_0x3d5637]=_0x498362,writeSecureFile(_0x55c001,JSON['stringify'](_0x2663f2,null,0x2));}export function removeProfileFromUserConfig(_0x3e965e){const _0x15684f=a48_0x55e2;validateProfileName(_0x3e965e);const _0x25e9e1=getGlobalConfigPath();if(!a48_0x50d644[_0x15684f(0x162)](_0x25e9e1))throw new Error(_0x15684f(0x13d)+_0x3e965e+_0x15684f(0x122));let _0x12d4df={};try{const _0x2aa9ad=a48_0x50d644[_0x15684f(0x14a)](_0x25e9e1,_0x15684f(0x159));_0x12d4df=JSON[_0x15684f(0x15b)](_0x2aa9ad);}catch{throw new Error('Failed\x20to\x20parse\x20'+_0x25e9e1);}if(!_0x12d4df['profiles']||!_0x12d4df[_0x15684f(0x14c)][_0x3e965e])throw new Error('Profile\x20\x27'+_0x3e965e+'\x27\x20not\x20found\x20in\x20user\x20configuration');delete _0x12d4df[_0x15684f(0x14c)][_0x3e965e],_0x12d4df[_0x15684f(0x11a)]===_0x3e965e&&delete _0x12d4df[_0x15684f(0x11a)],writeSecureFile(_0x25e9e1,JSON[_0x15684f(0x153)](_0x12d4df,null,0x2));}export function getActiveProfile(){const _0x11ff51=a48_0x55e2,_0x17dc94=loadSessionContext();if(_0x17dc94?.[_0x11ff51(0x11a)])return _0x17dc94['profile'];if(process[_0x11ff51(0x161)][_0x11ff51(0x11b)])return process[_0x11ff51(0x161)][_0x11ff51(0x11b)];const _0x15123f=getGlobalConfigPath();if(!a48_0x50d644[_0x11ff51(0x162)](_0x15123f))return null;try{const _0xe1e8e5=a48_0x50d644[_0x11ff51(0x14a)](_0x15123f,'utf-8'),_0x3b5941=JSON[_0x11ff51(0x15b)](_0xe1e8e5);return _0x3b5941[_0x11ff51(0x11a)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x4c8f90){const _0x52b6d7=a48_0x55e2,_0x5bcf2e=getGlobalConfigPath(),_0x267b01=getConfigDir();!a48_0x50d644[_0x52b6d7(0x162)](_0x267b01)&&createSecureDirectory(_0x267b01);let _0x581d99={};if(a48_0x50d644[_0x52b6d7(0x162)](_0x5bcf2e))try{const _0x5e2303=a48_0x50d644[_0x52b6d7(0x14a)](_0x5bcf2e,_0x52b6d7(0x159));_0x581d99=JSON['parse'](_0x5e2303);}catch{console[_0x52b6d7(0x128)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x5bcf2e+_0x52b6d7(0x13f));}_0x581d99[_0x52b6d7(0x150)]=_0x4c8f90,writeSecureFile(_0x5bcf2e,JSON[_0x52b6d7(0x153)](_0x581d99,null,0x2));}export function saveActiveProfileToUserConfig(_0x4d4f9f){const _0x2aea77=a48_0x55e2;validateProfileName(_0x4d4f9f);const _0x3c42de=getGlobalConfigPath(),_0x5e6072=getConfigDir();!a48_0x50d644[_0x2aea77(0x162)](_0x5e6072)&&createSecureDirectory(_0x5e6072);let _0x2a67cb={};if(a48_0x50d644[_0x2aea77(0x162)](_0x3c42de))try{const _0x2c1210=a48_0x50d644[_0x2aea77(0x14a)](_0x3c42de,_0x2aea77(0x159));_0x2a67cb=JSON[_0x2aea77(0x15b)](_0x2c1210);}catch{console[_0x2aea77(0x128)](_0x2aea77(0x13e)+_0x3c42de+',\x20creating\x20new\x20file');}_0x2a67cb['profile']=_0x4d4f9f,writeSecureFile(_0x3c42de,JSON['stringify'](_0x2a67cb,null,0x2));}function clearFieldFromUserConfig(_0x4a7245){const _0x135dfa=a48_0x55e2,_0x2e3222=getGlobalConfigPath();if(!a48_0x50d644[_0x135dfa(0x162)](_0x2e3222))return;let _0x1b0aa6={};try{const _0x2bf657=a48_0x50d644[_0x135dfa(0x14a)](_0x2e3222,_0x135dfa(0x159));_0x1b0aa6=JSON[_0x135dfa(0x15b)](_0x2bf657);}catch{return;}delete _0x1b0aa6[_0x4a7245],writeSecureFile(_0x2e3222,JSON[_0x135dfa(0x153)](_0x1b0aa6,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}function a48_0x55e2(_0x179536,_0x1eace6){_0x179536=_0x179536-0x11a;const _0x3f80fa=a48_0x3f80();let _0x55e2df=_0x3f80fa[_0x179536];return _0x55e2df;}export function createProfile(_0x5f4a52,_0x592a4e){const _0x6af344=a48_0x55e2;validateProfileName(_0x5f4a52);if(profileExists(_0x5f4a52))throw new Error(_0x6af344(0x14d)+_0x5f4a52+_0x6af344(0x11d));saveProfile(_0x5f4a52,_0x592a4e);}function a48_0x3f80(){const _0x21e487=['map','1335ZtYZbM','llm_agent','push','utf-8','keys','parse','tdx.json','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','\x20\x201.\x20Edit:\x20','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','To\x20migrate:','env','existsSync','message','.env','7692wuWqAw','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','entries','Invalid\x20profile\x20name:\x20','29293550gYReyi','profile','TDX_PROFILE','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','\x20already\x20exists','88UeHFAo','964638xSeQTy','string','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','\x27\x20not\x20found\x20in\x20user\x20configuration','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','\x27:\x20config\x20must\x20be\x20an\x20object','1105012WJMpRK','values','name','warn','includes','llm_project','description','parent_segment','\x0aWarning:\x20Failed\x20to\x20parse\x20','join','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','isDirectory','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','5754210MqBUQi','localeCompare','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','filter','\x27\x20will\x20be\x20ignored','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','\x27:\x20unknown\x20config\x20key\x20\x27','\x22\x20\x22','find','5366JDBWXw','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','Profile\x20\x27','Warning:\x20Failed\x20to\x20parse\x20',',\x20creating\x20new\x20file','7185423qsjnzn','test','length','from','333ajAlpu','user','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','object','database','has','readFileSync','toISOString','profiles','Profile\x20','directory','readdirSync','site','rmSync','Error:\x20','stringify','\x20does\x20not\x20exist'];a48_0x3f80=function(){return _0x21e487;};return a48_0x3f80();}export function saveProfileCredentials(_0x532467,_0x3cec25){const _0x3c59cd=a48_0x55e2;validateProfileName(_0x532467);if(!profileExists(_0x532467))throw new Error(_0x3c59cd(0x14d)+_0x532467+_0x3c59cd(0x154));const _0x13afa7=getNewCredentialPath(_0x532467);writeSecureFile(_0x13afa7,_0x3cec25);}export function loadProfileCredentials(_0x56d56c){const _0x280d9d=a48_0x55e2;validateProfileName(_0x56d56c);const _0x1d564c=getNewCredentialPath(_0x56d56c);if(a48_0x50d644[_0x280d9d(0x162)](_0x1d564c))try{return a48_0x50d644['readFileSync'](_0x1d564c,_0x280d9d(0x159));}catch{}const _0xa6af8c=getOldCredentialPath(_0x56d56c);if(a48_0x50d644['existsSync'](_0xa6af8c)){console[_0x280d9d(0x128)](_0x280d9d(0x12f)+_0x56d56c+'\x27'),console[_0x280d9d(0x128)](_0x280d9d(0x160)),console[_0x280d9d(0x128)]('\x20\x20mv\x20\x22'+_0xa6af8c+_0x280d9d(0x139)+_0x1d564c+'\x22'),console[_0x280d9d(0x128)](_0x280d9d(0x13c));try{return a48_0x50d644[_0x280d9d(0x14a)](_0xa6af8c,_0x280d9d(0x159));}catch{return null;}}return null;}
1
+ function a48_0x3930(){const _0x517856=['parent_segment','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','Warning:\x20Profile\x20\x27','stringify','readFileSync','readdirSync','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','.env.','TDX_PROFILE','\x22\x20\x22','env','map','entries','string','Profile\x20\x27','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','parse','database','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','4pKfqXp',':\x20Invalid\x20JSON\x20syntax','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','warn','16acNGQK','site','includes','\x0aWarning:\x20Failed\x20to\x20parse\x20','profiles','object','llm_agent','join','\x27\x20will\x20be\x20ignored','filter','Profile\x20','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','toISOString','description',',\x20creating\x20new\x20file','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','user','\x20does\x20not\x20exist','message','846873gsNJVy','346180bxNgqO','isDirectory','\x20already\x20exists','Error:\x20','72awBNXY','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','72121brDDRe','To\x20migrate:','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','llm_project','push','680060twpHOI','length','33XgOrQo','utf-8','from','existsSync','profile','directory','rmSync','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','find','201903OYyGZT','\x27:\x20config\x20must\x20be\x20an\x20object','Warning:\x20Failed\x20to\x20parse\x20','name','398820ZvDkcP','set','has','\x20\x201.\x20Edit:\x20','300207CKBsld','tdx.json','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.'];a48_0x3930=function(){return _0x517856;};return a48_0x3930();}(function(_0x3558f2,_0x3ecbb8){const _0x5d4543=a48_0x3f61,_0x33a93e=_0x3558f2();while(!![]){try{const _0x3005a1=parseInt(_0x5d4543(0xcc))/0x1+-parseInt(_0x5d4543(0xea))/0x2*(parseInt(_0x5d4543(0xd4))/0x3)+parseInt(_0x5d4543(0x103))/0x4+-parseInt(_0x5d4543(0xd0))/0x5+parseInt(_0x5d4543(0x107))/0x6*(parseInt(_0x5d4543(0x10a))/0x7)+parseInt(_0x5d4543(0xee))/0x8*(parseInt(_0x5d4543(0x102))/0x9)+parseInt(_0x5d4543(0x10f))/0xa*(-parseInt(_0x5d4543(0x111))/0xb);if(_0x3005a1===_0x3ecbb8)break;else _0x33a93e['push'](_0x33a93e['shift']());}catch(_0x33a08e){_0x33a93e['push'](_0x33a93e['shift']());}}}(a48_0x3930,0x1c686));import*as a48_0x52f0d9 from'node:fs';import*as a48_0x56c1ce 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(_0x5e84ad){const _0x164059=a48_0x3f61,_0x36bf27={};if(!_0x5e84ad)return _0x36bf27;for(const [_0x196b18,_0x3b491d]of Object[_0x164059(0xe3)](_0x5e84ad)){_0x196b18!==_0x164059(0xfb)&&_0x3b491d!==undefined&&(_0x36bf27[_0x196b18]=_0x3b491d);}return _0x36bf27;}export function getProfilesDir(){const _0x1e698b=a48_0x3f61;return a48_0x56c1ce[_0x1e698b(0xf5)](getConfigDir(),_0x1e698b(0xf2));}function getProfileDir(_0x4414b6){return a48_0x56c1ce['join'](getProfilesDir(),_0x4414b6);}function getProfileConfigPath(_0x4c0f24){const _0x3a64b7=a48_0x3f61;return a48_0x56c1ce[_0x3a64b7(0xf5)](getProfileDir(_0x4c0f24),_0x3a64b7(0xd5));}function getProfileEnvPath(_0x293449){const _0x5cb1c6=a48_0x3f61;return a48_0x56c1ce[_0x5cb1c6(0xf5)](getProfileDir(_0x293449),'.env');}function getGlobalConfigPath(){const _0x490e24=a48_0x3f61;return a48_0x56c1ce[_0x490e24(0xf5)](getConfigDir(),_0x490e24(0xd5));}function validateProfileName(_0x3ef351){const _0x494d61=a48_0x3f61;if(!/^[a-zA-Z0-9_-]+$/['test'](_0x3ef351))throw new Error('Invalid\x20profile\x20name:\x20'+_0x3ef351+_0x494d61(0xd6));}function validateProfileConfig(_0x4886fb,_0x187e66){const _0x4e5986=a48_0x3f61;if(typeof _0x4886fb!=='object'||_0x4886fb===null)throw new Error(_0x4e5986(0xe5)+_0x187e66+_0x4e5986(0xcd));const _0xb750f7=[_0x4e5986(0xfb),'site',_0x4e5986(0xe8),'parent_segment','llm_project',_0x4e5986(0xf4)],_0x6c367b=_0x4886fb;for(const _0x46a4d9 of Object['keys'](_0x6c367b)){!_0xb750f7[_0x4e5986(0xf0)](_0x46a4d9)&&console['warn'](_0x4e5986(0xd9)+_0x187e66+'\x27:\x20unknown\x20config\x20key\x20\x27'+_0x46a4d9+_0x4e5986(0xf6));}if(_0x6c367b['description']!==undefined&&typeof _0x6c367b[_0x4e5986(0xfb)]!==_0x4e5986(0xe4))throw new Error(_0x4e5986(0xe5)+_0x187e66+_0x4e5986(0x10c));if(_0x6c367b[_0x4e5986(0xef)]!==undefined&&typeof _0x6c367b[_0x4e5986(0xef)]!=='string')throw new Error(_0x4e5986(0xe5)+_0x187e66+_0x4e5986(0xe6));if(_0x6c367b[_0x4e5986(0xe8)]!==undefined&&typeof _0x6c367b[_0x4e5986(0xe8)]!==_0x4e5986(0xe4))throw new Error('Profile\x20\x27'+_0x187e66+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x6c367b[_0x4e5986(0xd7)]!==undefined&&typeof _0x6c367b[_0x4e5986(0xd7)]!==_0x4e5986(0xe4))throw new Error(_0x4e5986(0xe5)+_0x187e66+_0x4e5986(0xd8));if(_0x6c367b[_0x4e5986(0x10d)]!==undefined&&typeof _0x6c367b[_0x4e5986(0x10d)]!=='string')throw new Error(_0x4e5986(0xe5)+_0x187e66+_0x4e5986(0xfe));if(_0x6c367b['llm_agent']!==undefined&&typeof _0x6c367b['llm_agent']!==_0x4e5986(0xe4))throw new Error('Profile\x20\x27'+_0x187e66+_0x4e5986(0xfd));return!![];}function loadProfilesFromTdxJson(_0x4e0003,_0x54a012){const _0x3798c9=a48_0x3f61;if(!a48_0x52f0d9[_0x3798c9(0x114)](_0x4e0003))return[];try{const _0x3184f3=a48_0x52f0d9[_0x3798c9(0xdb)](_0x4e0003,_0x3798c9(0x112)),_0x1674a3=JSON[_0x3798c9(0xe7)](_0x3184f3);if(!_0x1674a3[_0x3798c9(0xf2)]||typeof _0x1674a3[_0x3798c9(0xf2)]!==_0x3798c9(0xf3))return[];const _0x3d052b=[];for(const [_0x37b231,_0x1cc725]of Object[_0x3798c9(0xe3)](_0x1674a3[_0x3798c9(0xf2)])){try{validateProfileConfig(_0x1cc725,_0x37b231);const _0x2c5abd=getNewCredentialPath(_0x37b231),_0x387dd9=getOldCredentialPath(_0x37b231),_0x354b66=a48_0x52f0d9['existsSync'](_0x2c5abd)||a48_0x52f0d9['existsSync'](_0x387dd9);_0x3d052b['push']({'name':_0x37b231,'config':_0x1cc725,'metadata':{'name':_0x37b231,'createdAt':new Date()[_0x3798c9(0xfa)]()},'hasCredentials':_0x354b66,'scope':_0x54a012});}catch(_0x5aaf75){_0x5aaf75 instanceof Error&&(console[_0x3798c9(0xed)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x4e0003+':'),console[_0x3798c9(0xed)]('\x20\x20'+_0x5aaf75[_0x3798c9(0x101)]+'\x0a'));}}return _0x3d052b;}catch(_0x2bbfaa){return _0x2bbfaa instanceof SyntaxError?(console[_0x3798c9(0xed)](_0x3798c9(0xf1)+_0x4e0003+_0x3798c9(0xeb)),console[_0x3798c9(0xed)](_0x3798c9(0x106)+_0x2bbfaa[_0x3798c9(0x101)]+'\x0a')):console[_0x3798c9(0xed)](_0x3798c9(0xf9)+_0x4e0003+':\x20'+_0x2bbfaa+'\x0a'),[];}}export function getNewCredentialPath(_0x301b5e){const _0x2837cc=a48_0x3f61;return a48_0x56c1ce[_0x2837cc(0xf5)](getConfigDir(),_0x2837cc(0xde)+_0x301b5e);}function getOldCredentialPath(_0x4b1ea3){return a48_0x56c1ce['join'](getProfilesDir(),_0x4b1ea3,'.env');}function loadProfilesFromTdxJsonFiles(){const _0x5bd1f7=a48_0x3f61,_0x4391be=[],_0x144b7f=findProjectConfigPath();_0x144b7f&&_0x4391be['push'](...loadProfilesFromTdxJson(_0x144b7f,'local'));const _0x22c7ba=a48_0x56c1ce[_0x5bd1f7(0xf5)](getConfigDir(),_0x5bd1f7(0xd5));return _0x4391be[_0x5bd1f7(0x10e)](...loadProfilesFromTdxJson(_0x22c7ba,_0x5bd1f7(0xff))),_0x4391be;}function loadProfilesFromDirectories(){const _0x29019d=a48_0x3f61,_0x58e37b=getProfilesDir();if(!a48_0x52f0d9['existsSync'](_0x58e37b))return[];try{return a48_0x52f0d9[_0x29019d(0xdc)](_0x58e37b,{'withFileTypes':!![]})[_0x29019d(0xf7)](_0x140ea8=>_0x140ea8[_0x29019d(0x104)]())[_0x29019d(0xe2)](_0x37825c=>_0x37825c[_0x29019d(0xcf)])['filter'](_0x18fe05=>{const _0x544729=_0x29019d,_0x3bce67=getProfileConfigPath(_0x18fe05),_0x51ef31=getProfileEnvPath(_0x18fe05);return a48_0x52f0d9[_0x544729(0x114)](_0x3bce67)||a48_0x52f0d9[_0x544729(0x114)](_0x51ef31);})['map'](_0x2718a8=>{const _0x1de0d7=_0x29019d,_0x5c4120=loadProfileFromDirectory(_0x2718a8);if(_0x5c4120)return{..._0x5c4120,'scope':_0x1de0d7(0x116)};return null;})['filter'](_0x1ead8d=>_0x1ead8d!==null);}catch{return[];}}function loadProfileFromDirectory(_0x2aea93){const _0x33631c=a48_0x3f61,_0x127afb=getProfileConfigPath(_0x2aea93),_0x18e498=getOldCredentialPath(_0x2aea93);if(!a48_0x52f0d9['existsSync'](_0x127afb)&&!a48_0x52f0d9[_0x33631c(0x114)](_0x18e498))return null;let _0x16e690={},_0x197ca9={'name':_0x2aea93,'createdAt':new Date()[_0x33631c(0xfa)]()};if(a48_0x52f0d9['existsSync'](_0x127afb))try{const _0x2d1760=a48_0x52f0d9[_0x33631c(0xdb)](_0x127afb,_0x33631c(0x112)),_0x317a6d=JSON[_0x33631c(0xe7)](_0x2d1760),{metadata:_0x53d2fb,..._0x7c2b85}=_0x317a6d;_0x16e690=_0x7c2b85,_0x53d2fb&&(_0x197ca9=_0x53d2fb);}catch{}return{'name':_0x2aea93,'config':_0x16e690,'metadata':_0x197ca9,'hasCredentials':a48_0x52f0d9[_0x33631c(0x114)](_0x18e498),'scope':'directory'};}export function listProfiles(){const _0x60fed8=a48_0x3f61,_0x2bbf2d=loadProfilesFromTdxJsonFiles(),_0x5db9e5=loadProfilesFromDirectories();if(_0x5db9e5[_0x60fed8(0x110)]>0x0){const _0x5912ba=_0x5db9e5['map'](_0x4644fb=>_0x4644fb['name'])[_0x60fed8(0xf5)](',\x20'),_0x15b046=getConfigDir();console['warn'](_0x60fed8(0xe9)+_0x5912ba),console[_0x60fed8(0xed)](_0x60fed8(0xdd)),console[_0x60fed8(0xed)](_0x60fed8(0xd3)+a48_0x56c1ce[_0x60fed8(0xf5)](_0x15b046,_0x60fed8(0xd5))),console[_0x60fed8(0xed)](_0x60fed8(0xec)),console[_0x60fed8(0xed)](_0x60fed8(0x118));}const _0x402674=[..._0x2bbf2d,..._0x5db9e5],_0x57c6cb=new Map();for(const _0x116e39 of _0x402674){!_0x57c6cb[_0x60fed8(0xd2)](_0x116e39[_0x60fed8(0xcf)])&&_0x57c6cb[_0x60fed8(0xd1)](_0x116e39['name'],_0x116e39);}return Array[_0x60fed8(0x113)](_0x57c6cb['values']())['sort']((_0x2c948,_0x3de40e)=>_0x2c948[_0x60fed8(0xcf)]['localeCompare'](_0x3de40e[_0x60fed8(0xcf)]));}export function profileExists(_0x5da196){const _0x827811=listProfiles();return _0x827811['some'](_0x49043d=>_0x49043d['name']===_0x5da196);}export function loadProfile(_0x132d17){const _0x5224aa=a48_0x3f61;validateProfileName(_0x132d17);const _0x3a1bc5=listProfiles(),_0x56ce7a=_0x3a1bc5[_0x5224aa(0x119)](_0x31e7a9=>_0x31e7a9[_0x5224aa(0xcf)]===_0x132d17);return _0x56ce7a||null;}export function saveProfile(_0x27bac1,_0x5632e2,_0x4d80cd=![]){saveProfileToUserConfig(_0x27bac1,_0x5632e2);}export function deleteProfile(_0x5d5760){const _0x474123=a48_0x3f61;validateProfileName(_0x5d5760);const _0x32283d=getProfileDir(_0x5d5760);if(!a48_0x52f0d9[_0x474123(0x114)](_0x32283d))throw new Error(_0x474123(0xf8)+_0x5d5760+_0x474123(0x100));a48_0x52f0d9[_0x474123(0x117)](_0x32283d,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x51fe8b,_0x45988b){const _0x5554f8=a48_0x3f61;validateProfileName(_0x51fe8b);const _0x2cc1f9=getGlobalConfigPath(),_0x59bd62=getConfigDir();!a48_0x52f0d9[_0x5554f8(0x114)](_0x59bd62)&&createSecureDirectory(_0x59bd62);let _0x1f9ac1={};if(a48_0x52f0d9[_0x5554f8(0x114)](_0x2cc1f9))try{const _0x4a854c=a48_0x52f0d9[_0x5554f8(0xdb)](_0x2cc1f9,'utf-8');_0x1f9ac1=JSON[_0x5554f8(0xe7)](_0x4a854c);}catch{console['warn'](_0x5554f8(0xce)+_0x2cc1f9+_0x5554f8(0xfc));}!_0x1f9ac1[_0x5554f8(0xf2)]&&(_0x1f9ac1[_0x5554f8(0xf2)]={}),_0x1f9ac1[_0x5554f8(0xf2)][_0x51fe8b]=_0x45988b,writeSecureFile(_0x2cc1f9,JSON['stringify'](_0x1f9ac1,null,0x2));}export function removeProfileFromUserConfig(_0x24126b){const _0x117049=a48_0x3f61;validateProfileName(_0x24126b);const _0x120fa2=getGlobalConfigPath();if(!a48_0x52f0d9['existsSync'](_0x120fa2))throw new Error(_0x117049(0xe5)+_0x24126b+'\x27\x20not\x20found\x20in\x20user\x20configuration');let _0x922a27={};try{const _0x41e520=a48_0x52f0d9[_0x117049(0xdb)](_0x120fa2,_0x117049(0x112));_0x922a27=JSON[_0x117049(0xe7)](_0x41e520);}catch{throw new Error('Failed\x20to\x20parse\x20'+_0x120fa2);}if(!_0x922a27['profiles']||!_0x922a27['profiles'][_0x24126b])throw new Error(_0x117049(0xe5)+_0x24126b+'\x27\x20not\x20found\x20in\x20user\x20configuration');delete _0x922a27[_0x117049(0xf2)][_0x24126b],_0x922a27[_0x117049(0x115)]===_0x24126b&&delete _0x922a27[_0x117049(0x115)],writeSecureFile(_0x120fa2,JSON['stringify'](_0x922a27,null,0x2));}export function getActiveProfile(){const _0x38e4d4=a48_0x3f61,_0x186834=loadSessionContext();if(_0x186834?.[_0x38e4d4(0x115)])return _0x186834[_0x38e4d4(0x115)];if(process[_0x38e4d4(0xe1)][_0x38e4d4(0xdf)])return process[_0x38e4d4(0xe1)]['TDX_PROFILE'];const _0x6b49ab=getGlobalConfigPath();if(!a48_0x52f0d9[_0x38e4d4(0x114)](_0x6b49ab))return null;try{const _0x3035a6=a48_0x52f0d9['readFileSync'](_0x6b49ab,_0x38e4d4(0x112)),_0x270019=JSON[_0x38e4d4(0xe7)](_0x3035a6);return _0x270019[_0x38e4d4(0x115)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x3e04dc){const _0x506bee=a48_0x3f61,_0x5a8b46=getGlobalConfigPath(),_0x5bea48=getConfigDir();!a48_0x52f0d9[_0x506bee(0x114)](_0x5bea48)&&createSecureDirectory(_0x5bea48);let _0x35901d={};if(a48_0x52f0d9[_0x506bee(0x114)](_0x5a8b46))try{const _0x55afca=a48_0x52f0d9[_0x506bee(0xdb)](_0x5a8b46,'utf-8');_0x35901d=JSON[_0x506bee(0xe7)](_0x55afca);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x5a8b46+',\x20creating\x20new\x20file');}_0x35901d['site']=_0x3e04dc,writeSecureFile(_0x5a8b46,JSON[_0x506bee(0xda)](_0x35901d,null,0x2));}export function saveActiveProfileToUserConfig(_0x5c3fec){const _0x7c875d=a48_0x3f61;validateProfileName(_0x5c3fec);const _0x1c1534=getGlobalConfigPath(),_0x3f8f89=getConfigDir();!a48_0x52f0d9['existsSync'](_0x3f8f89)&&createSecureDirectory(_0x3f8f89);let _0x5c8579={};if(a48_0x52f0d9[_0x7c875d(0x114)](_0x1c1534))try{const _0x209e6b=a48_0x52f0d9['readFileSync'](_0x1c1534,_0x7c875d(0x112));_0x5c8579=JSON['parse'](_0x209e6b);}catch{console[_0x7c875d(0xed)](_0x7c875d(0xce)+_0x1c1534+',\x20creating\x20new\x20file');}_0x5c8579[_0x7c875d(0x115)]=_0x5c3fec,writeSecureFile(_0x1c1534,JSON[_0x7c875d(0xda)](_0x5c8579,null,0x2));}function clearFieldFromUserConfig(_0x16931c){const _0x4b2b14=a48_0x3f61,_0x206773=getGlobalConfigPath();if(!a48_0x52f0d9['existsSync'](_0x206773))return;let _0x5d2321={};try{const _0x43366b=a48_0x52f0d9[_0x4b2b14(0xdb)](_0x206773,_0x4b2b14(0x112));_0x5d2321=JSON[_0x4b2b14(0xe7)](_0x43366b);}catch{return;}delete _0x5d2321[_0x16931c],writeSecureFile(_0x206773,JSON[_0x4b2b14(0xda)](_0x5d2321,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x158e7e=a48_0x3f61;clearFieldFromUserConfig(_0x158e7e(0xef));}export function clearActiveProfileFromUserConfig(){const _0x4d783f=a48_0x3f61;clearFieldFromUserConfig(_0x4d783f(0x115));}export function createProfile(_0x28df94,_0x4f7d55){const _0x234303=a48_0x3f61;validateProfileName(_0x28df94);if(profileExists(_0x28df94))throw new Error(_0x234303(0xf8)+_0x28df94+_0x234303(0x105));saveProfile(_0x28df94,_0x4f7d55);}function a48_0x3f61(_0x5f43ad,_0x2d8999){_0x5f43ad=_0x5f43ad-0xcc;const _0x3930ff=a48_0x3930();let _0x3f612c=_0x3930ff[_0x5f43ad];return _0x3f612c;}export function saveProfileCredentials(_0x22c503,_0x444b1b){const _0x43c172=a48_0x3f61;validateProfileName(_0x22c503);if(!profileExists(_0x22c503))throw new Error('Profile\x20'+_0x22c503+_0x43c172(0x100));const _0x202cbf=getNewCredentialPath(_0x22c503);writeSecureFile(_0x202cbf,_0x444b1b);}export function loadProfileCredentials(_0x32d697){const _0x18abe6=a48_0x3f61;validateProfileName(_0x32d697);const _0x48d371=getNewCredentialPath(_0x32d697);if(a48_0x52f0d9['existsSync'](_0x48d371))try{return a48_0x52f0d9[_0x18abe6(0xdb)](_0x48d371,_0x18abe6(0x112));}catch{}const _0x3a0de6=getOldCredentialPath(_0x32d697);if(a48_0x52f0d9[_0x18abe6(0x114)](_0x3a0de6)){console[_0x18abe6(0xed)](_0x18abe6(0x108)+_0x32d697+'\x27'),console['warn'](_0x18abe6(0x10b)),console[_0x18abe6(0xed)]('\x20\x20mv\x20\x22'+_0x3a0de6+_0x18abe6(0xe0)+_0x48d371+'\x22'),console[_0x18abe6(0xed)](_0x18abe6(0x109));try{return a48_0x52f0d9[_0x18abe6(0xdb)](_0x3a0de6,_0x18abe6(0x112));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a49_0x58724e=a49_0x24bf;(function(_0x3cce8c,_0x12f8ac){const _0x2a8fb4=a49_0x24bf,_0x15e98c=_0x3cce8c();while(!![]){try{const _0x3ff294=parseInt(_0x2a8fb4(0xd0))/0x1*(parseInt(_0x2a8fb4(0xd1))/0x2)+-parseInt(_0x2a8fb4(0xbf))/0x3*(-parseInt(_0x2a8fb4(0xcc))/0x4)+parseInt(_0x2a8fb4(0xc8))/0x5*(-parseInt(_0x2a8fb4(0xb6))/0x6)+parseInt(_0x2a8fb4(0xc3))/0x7+-parseInt(_0x2a8fb4(0xce))/0x8+parseInt(_0x2a8fb4(0xc2))/0x9+-parseInt(_0x2a8fb4(0xb8))/0xa;if(_0x3ff294===_0x12f8ac)break;else _0x15e98c['push'](_0x15e98c['shift']());}catch(_0x4d670f){_0x15e98c['push'](_0x15e98c['shift']());}}}(a49_0x5ee7,0x7b2a8));function a49_0x24bf(_0x51184f,_0x4a5c82){_0x51184f=_0x51184f-0xb2;const _0x5ee76=a49_0x5ee7();let _0x24bf97=_0x5ee76[_0x51184f];return _0x24bf97;}import*as a49_0x5a05a9 from'node:fs';import*as a49_0x50be11 from'node:path';const PROJECT_CONFIG_FILENAME=a49_0x58724e(0xca);export function findProjectConfigPath(_0x57d899){const _0x2b133f=a49_0x58724e;let _0x5bdd6e=_0x57d899||process[_0x2b133f(0xbe)]();while(!![]){const _0x3a9e8b=a49_0x50be11[_0x2b133f(0xba)](_0x5bdd6e,PROJECT_CONFIG_FILENAME);if(a49_0x5a05a9[_0x2b133f(0xbd)](_0x3a9e8b))return _0x3a9e8b;const _0x3ce6a9=a49_0x50be11[_0x2b133f(0xc5)](_0x5bdd6e);if(_0x3ce6a9===_0x5bdd6e)return null;_0x5bdd6e=_0x3ce6a9;}}function a49_0x5ee7(){const _0x29c12a=['utf-8','warn','6182037djrcXY','6477170PDeKjy','api_key','dirname','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','parse','525495ISwOaz','writeFileSync','tdx.json','Warning:\x20\x27profile\x27\x20field\x20in\x20','2844WWbRFW','stringify','323360rwBgEI','readFileSync','14408NRqdCZ','48OndJXL','code','profile','ENOENT','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','48AwPaZv','TD_API_KEY','11467830ORTquZ','Failed\x20to\x20load\x20project\x20config\x20from\x20','join','includes','\x20is\x20ignored.\x20','existsSync','cwd','2424gTriwv'];a49_0x5ee7=function(){return _0x29c12a;};return a49_0x5ee7();}export function loadProjectConfig(_0x553374){const _0x12ef01=a49_0x58724e,_0x4e4f95=findProjectConfigPath(_0x553374);if(!_0x4e4f95)return null;try{const _0x5d6b2f=a49_0x5a05a9[_0x12ef01(0xcf)](_0x4e4f95,_0x12ef01(0xc0)),_0x5f0107=JSON[_0x12ef01(0xc7)](_0x5d6b2f),_0x414209=JSON[_0x12ef01(0xcd)](_0x5f0107);if(_0x414209[_0x12ef01(0xbb)](_0x12ef01(0xb7))||_0x414209[_0x12ef01(0xbb)]('apiKey')||_0x414209[_0x12ef01(0xbb)](_0x12ef01(0xc4)))throw new Error(_0x12ef01(0xc6)+_0x4e4f95+').\x20'+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x52df82,profile:_0xcf44,..._0xcd0e81}=_0x5f0107;return _0xcf44&&console[_0x12ef01(0xc1)](_0x12ef01(0xcb)+_0x4e4f95+_0x12ef01(0xbc)+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0xcd0e81;}catch(_0x5b4e4d){if(_0x5b4e4d instanceof Error&&'code'in _0x5b4e4d&&_0x5b4e4d[_0x12ef01(0xb2)]===_0x12ef01(0xb4))return null;throw new Error(_0x12ef01(0xb9)+_0x4e4f95+':\x20'+_0x5b4e4d);}}export function saveProjectConfig(_0x28b654,_0x5f50d1){const _0x3fe46c=a49_0x58724e,_0x5dddee=_0x5f50d1||process[_0x3fe46c(0xbe)](),_0x3dc673=a49_0x50be11[_0x3fe46c(0xba)](_0x5dddee,PROJECT_CONFIG_FILENAME),_0x48befd=JSON[_0x3fe46c(0xcd)](_0x28b654);if(_0x48befd[_0x3fe46c(0xbb)]('TD_API_KEY')||_0x48befd[_0x3fe46c(0xbb)]('apiKey')||_0x48befd[_0x3fe46c(0xbb)](_0x3fe46c(0xc4)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x3fe46c(0xb3)in _0x28b654)throw new Error(_0x3fe46c(0xb5));a49_0x5a05a9[_0x3fe46c(0xc9)](_0x3dc673,JSON[_0x3fe46c(0xcd)](_0x28b654,null,0x2));}export function hasProjectConfig(_0x52acf5){return findProjectConfigPath(_0x52acf5)!==null;}export function getProjectRoot(_0x4d3e46){const _0x7d2752=a49_0x58724e,_0x17887f=findProjectConfigPath(_0x4d3e46);return _0x17887f?a49_0x50be11[_0x7d2752(0xc5)](_0x17887f):null;}
1
+ function a49_0x5488(){const _0x1608cf=['Failed\x20to\x20load\x20project\x20config\x20from\x20','readFileSync','existsSync','includes','667732RoRyrP','dirname','utf-8','3mrFCcz','apiKey','warn','9499208WCvAZk','9357115gBvgjy','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','parse','2243481jnvpvF','Warning:\x20\x27profile\x27\x20field\x20in\x20','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','TD_API_KEY','3731518ihtSOP','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.',').\x20','9IzHaKi','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','13635666LlSnKy','stringify','6GuRUWM','join','profile','\x20is\x20ignored.\x20','cwd','api_key','ENOENT','code','4qUnCXE','7802210SGXjFy'];a49_0x5488=function(){return _0x1608cf;};return a49_0x5488();}(function(_0x1314f3,_0x41bb30){const _0x506931=a49_0x5a65,_0x292d85=_0x1314f3();while(!![]){try{const _0x2e472d=parseInt(_0x506931(0x7b))/0x1*(parseInt(_0x506931(0x78))/0x2)+-parseInt(_0x506931(0x82))/0x3*(-parseInt(_0x506931(0x95))/0x4)+parseInt(_0x506931(0x7f))/0x5*(-parseInt(_0x506931(0x8d))/0x6)+-parseInt(_0x506931(0x86))/0x7+parseInt(_0x506931(0x7e))/0x8+parseInt(_0x506931(0x89))/0x9*(-parseInt(_0x506931(0x96))/0xa)+parseInt(_0x506931(0x8b))/0xb;if(_0x2e472d===_0x41bb30)break;else _0x292d85['push'](_0x292d85['shift']());}catch(_0x154f81){_0x292d85['push'](_0x292d85['shift']());}}}(a49_0x5488,0xf21e2));function a49_0x5a65(_0xfd7425,_0x3b5653){_0xfd7425=_0xfd7425-0x76;const _0x548823=a49_0x5488();let _0x5a6585=_0x548823[_0xfd7425];return _0x5a6585;}import*as a49_0x57acf9 from'node:fs';import*as a49_0x3277f7 from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x110405){const _0x6c7279=a49_0x5a65;let _0x47813d=_0x110405||process[_0x6c7279(0x91)]();while(!![]){const _0x448749=a49_0x3277f7['join'](_0x47813d,PROJECT_CONFIG_FILENAME);if(a49_0x57acf9[_0x6c7279(0x76)](_0x448749))return _0x448749;const _0x52bf37=a49_0x3277f7[_0x6c7279(0x79)](_0x47813d);if(_0x52bf37===_0x47813d)return null;_0x47813d=_0x52bf37;}}export function loadProjectConfig(_0x297824){const _0x4dd6be=a49_0x5a65,_0x2b5bb2=findProjectConfigPath(_0x297824);if(!_0x2b5bb2)return null;try{const _0x4816ae=a49_0x57acf9[_0x4dd6be(0x98)](_0x2b5bb2,_0x4dd6be(0x7a)),_0x331b98=JSON[_0x4dd6be(0x81)](_0x4816ae),_0x419a94=JSON[_0x4dd6be(0x8c)](_0x331b98);if(_0x419a94[_0x4dd6be(0x77)](_0x4dd6be(0x85))||_0x419a94[_0x4dd6be(0x77)](_0x4dd6be(0x7c))||_0x419a94[_0x4dd6be(0x77)](_0x4dd6be(0x92)))throw new Error(_0x4dd6be(0x8a)+_0x2b5bb2+_0x4dd6be(0x88)+_0x4dd6be(0x84));const {metadata:_0x3b16c9,profile:_0x59abe7,..._0x44ee29}=_0x331b98;return _0x59abe7&&console[_0x4dd6be(0x7d)](_0x4dd6be(0x83)+_0x2b5bb2+_0x4dd6be(0x90)+_0x4dd6be(0x80)),_0x44ee29;}catch(_0x1b592d){if(_0x1b592d instanceof Error&&_0x4dd6be(0x94)in _0x1b592d&&_0x1b592d[_0x4dd6be(0x94)]===_0x4dd6be(0x93))return null;throw new Error(_0x4dd6be(0x97)+_0x2b5bb2+':\x20'+_0x1b592d);}}export function saveProjectConfig(_0x57c75e,_0x2d3898){const _0x1bfe6a=a49_0x5a65,_0x348d2f=_0x2d3898||process[_0x1bfe6a(0x91)](),_0x49a964=a49_0x3277f7[_0x1bfe6a(0x8e)](_0x348d2f,PROJECT_CONFIG_FILENAME),_0x245c70=JSON[_0x1bfe6a(0x8c)](_0x57c75e);if(_0x245c70[_0x1bfe6a(0x77)]('TD_API_KEY')||_0x245c70[_0x1bfe6a(0x77)](_0x1bfe6a(0x7c))||_0x245c70[_0x1bfe6a(0x77)](_0x1bfe6a(0x92)))throw new Error(_0x1bfe6a(0x87));if(_0x1bfe6a(0x8f)in _0x57c75e)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a49_0x57acf9['writeFileSync'](_0x49a964,JSON[_0x1bfe6a(0x8c)](_0x57c75e,null,0x2));}export function hasProjectConfig(_0xd0fda3){return findProjectConfigPath(_0xd0fda3)!==null;}export function getProjectRoot(_0x22c176){const _0x5d2c86=findProjectConfigPath(_0x22c176);return _0x5d2c86?a49_0x3277f7['dirname'](_0x5d2c86):null;}
@@ -1 +1 @@
1
- (function(_0x103bbe,_0x26e3e5){const _0x3a0295=a50_0x5439,_0x2174e7=_0x103bbe();while(!![]){try{const _0x368289=-parseInt(_0x3a0295(0x21e))/0x1*(-parseInt(_0x3a0295(0x1f6))/0x2)+-parseInt(_0x3a0295(0x1f5))/0x3*(parseInt(_0x3a0295(0x21c))/0x4)+parseInt(_0x3a0295(0x1fa))/0x5+parseInt(_0x3a0295(0x1f4))/0x6*(-parseInt(_0x3a0295(0x21d))/0x7)+parseInt(_0x3a0295(0x1ff))/0x8*(parseInt(_0x3a0295(0x201))/0x9)+parseInt(_0x3a0295(0x205))/0xa+-parseInt(_0x3a0295(0x214))/0xb*(parseInt(_0x3a0295(0x1fb))/0xc);if(_0x368289===_0x26e3e5)break;else _0x2174e7['push'](_0x2174e7['shift']());}catch(_0x263545){_0x2174e7['push'](_0x2174e7['shift']());}}}(a50_0x4b7e,0xd9a11));import*as a50_0x5bb8f0 from'node:fs';import*as a50_0x54c431 from'node:path';import*as a50_0x2e8d05 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 _0x24eea6=a50_0x5439,_0x1df56f=process[_0x24eea6(0x1f9)][_0x24eea6(0x210)]||a50_0x54c431[_0x24eea6(0x1f3)](a50_0x2e8d05[_0x24eea6(0x203)](),_0x24eea6(0x1fe),_0x24eea6(0x212));return a50_0x54c431[_0x24eea6(0x1f3)](_0x1df56f,_0x24eea6(0x219));}function getSessionPath(_0x544506){const _0x1956d9=a50_0x5439;return a50_0x54c431['join'](getSessionsDir(),_0x544506+_0x1956d9(0x213));}export function getCurrentSessionPID(){return getPPID();}function a50_0x5439(_0x2e9976,_0x834465){_0x2e9976=_0x2e9976-0x1f3;const _0x4b7e71=a50_0x4b7e();let _0x5439a9=_0x4b7e71[_0x2e9976];return _0x5439a9;}export function getSessionID(_0x11556d){const _0x173daf=a50_0x5439;if(_0x11556d)return _0x11556d;return getCurrentSessionPID()[_0x173daf(0x20b)]();}export function loadSessionContext(_0x34483a){const _0x1e1dce=a50_0x5439,_0x3f9570=_0x34483a||getCurrentSessionPID()[_0x1e1dce(0x20b)](),_0x123399=/^\d+$/['test'](_0x3f9570)?parseInt(_0x3f9570,0xa):null;return _0x123399!==null?loadSessionContextByPID(_0x123399):loadSessionContextByString(_0x3f9570);}export function loadSessionContextByPID(_0x3df1bf){const _0x78212e=a50_0x5439,_0x43cecd=getSessionPath(_0x3df1bf);if(!a50_0x5bb8f0[_0x78212e(0x216)](_0x43cecd))return null;try{const _0x4eef89=a50_0x5bb8f0[_0x78212e(0x21a)](_0x43cecd,_0x78212e(0x209)),_0x26b5c0=JSON[_0x78212e(0x206)](_0x4eef89),_0x45f672=new Date(_0x26b5c0['createdAt'])[_0x78212e(0x20c)](),_0x10c651=Date['now']();if(_0x10c651-_0x45f672>SESSION_EXPIRATION_MS)return a50_0x5bb8f0[_0x78212e(0x208)](_0x43cecd),null;const _0x501baa=JSON['stringify'](_0x26b5c0);if(_0x501baa[_0x78212e(0x1fd)](_0x78212e(0x218))||_0x501baa[_0x78212e(0x1fd)](_0x78212e(0x1fc))||_0x501baa[_0x78212e(0x1fd)](_0x78212e(0x1f8)))return console['warn'](_0x78212e(0x21b)+_0x43cecd+_0x78212e(0x207)),a50_0x5bb8f0[_0x78212e(0x208)](_0x43cecd),null;return _0x26b5c0;}catch{try{a50_0x5bb8f0[_0x78212e(0x208)](_0x43cecd);}catch{}return null;}}function loadSessionContextByString(_0x3d0a3e){const _0x46962d=a50_0x5439,_0x1f838a=a50_0x54c431['join'](getSessionsDir(),_0x3d0a3e+_0x46962d(0x213));if(!a50_0x5bb8f0[_0x46962d(0x216)](_0x1f838a))return null;try{const _0x5d2a60=a50_0x5bb8f0[_0x46962d(0x21a)](_0x1f838a,_0x46962d(0x209)),_0x2f52c9=JSON[_0x46962d(0x206)](_0x5d2a60),_0x46a3db=new Date(_0x2f52c9[_0x46962d(0x215)])[_0x46962d(0x20c)](),_0x1de436=Date[_0x46962d(0x21f)]();if(_0x1de436-_0x46a3db>SESSION_EXPIRATION_MS)return a50_0x5bb8f0[_0x46962d(0x208)](_0x1f838a),null;const _0xc0283f=JSON[_0x46962d(0x202)](_0x2f52c9);if(_0xc0283f['includes'](_0x46962d(0x218))||_0xc0283f[_0x46962d(0x1fd)]('apiKey')||_0xc0283f[_0x46962d(0x1fd)](_0x46962d(0x1f8)))return console[_0x46962d(0x200)](_0x46962d(0x21b)+_0x1f838a+_0x46962d(0x207)),a50_0x5bb8f0[_0x46962d(0x208)](_0x1f838a),null;return _0x2f52c9;}catch{try{a50_0x5bb8f0[_0x46962d(0x208)](_0x1f838a);}catch{}return null;}}export function saveSessionContext(_0x1ababe,_0x2f90bd){const _0x1fe1c1=a50_0x5439,_0x2543af=_0x2f90bd||getCurrentSessionPID()[_0x1fe1c1(0x20b)](),_0xf84b8=/^\d+$/[_0x1fe1c1(0x20e)](_0x2543af)?parseInt(_0x2543af,0xa):getCurrentSessionPID(),_0x353621=a50_0x54c431[_0x1fe1c1(0x1f3)](getSessionsDir(),_0x2543af+'.json'),_0x235bf8=getSessionsDir();createSecureDirectory(_0x235bf8);const _0x270f0a=JSON[_0x1fe1c1(0x202)](_0x1ababe);if(_0x270f0a[_0x1fe1c1(0x1fd)](_0x1fe1c1(0x218))||_0x270f0a[_0x1fe1c1(0x1fd)](_0x1fe1c1(0x1fc))||_0x270f0a[_0x1fe1c1(0x1fd)]('api_key'))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.');let _0x220b20;const _0x1ec171=/^\d+$/[_0x1fe1c1(0x20e)](_0x2543af)?loadSessionContextByPID(parseInt(_0x2543af,0xa)):loadSessionContextByString(_0x2543af);_0x1ec171?_0x220b20={..._0x1ec171,..._0x1ababe,'pid':_0xf84b8,'sessionId':_0x2543af!==_0xf84b8[_0x1fe1c1(0x20b)]()?_0x2543af:undefined,'updatedAt':new Date()[_0x1fe1c1(0x20f)]()}:_0x220b20={'pid':_0xf84b8,'sessionId':_0x2543af!==_0xf84b8[_0x1fe1c1(0x20b)]()?_0x2543af:undefined,..._0x1ababe,'createdAt':new Date()[_0x1fe1c1(0x20f)](),'updatedAt':new Date()['toISOString']()},a50_0x5bb8f0[_0x1fe1c1(0x217)](_0x353621,JSON['stringify'](_0x220b20,null,0x2));}function a50_0x4b7e(){const _0x12bbc9=['12335032BlQCtF','warn','9EKxmul','stringify','homedir','readdirSync','153180PfBKRR','parse','.\x20This\x20is\x20insecure.\x20Removing\x20session.','unlinkSync','utf-8','sort','toString','getTime','endsWith','test','toISOString','TDX_CONFIG_DIR','push','tdx','.json','22695046tKmnPq','createdAt','existsSync','writeFileSync','TD_API_KEY','sessions','readFileSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','326892XiXeLe','3542nBlnJU','1709553vICFgo','now','join','4716WIhwJJ','21oviQXX','2QMBCrV','replace','api_key','env','3288110XzWEtx','12NvtmIY','apiKey','includes','.config'];a50_0x4b7e=function(){return _0x12bbc9;};return a50_0x4b7e();}export function clearSessionContext(_0x3d1477){const _0x29051b=a50_0x5439,_0x32c2e0=_0x3d1477||getCurrentSessionPID()[_0x29051b(0x20b)](),_0x17e7e6=a50_0x54c431[_0x29051b(0x1f3)](getSessionsDir(),_0x32c2e0+_0x29051b(0x213));a50_0x5bb8f0['existsSync'](_0x17e7e6)&&a50_0x5bb8f0[_0x29051b(0x208)](_0x17e7e6);}export function clearSessionContextField(_0xb4b01,_0x3aeea1){const _0xf9fa14=a50_0x5439,_0x22ed52=_0x3aeea1||getCurrentSessionPID()[_0xf9fa14(0x20b)](),_0x4b38b8=a50_0x54c431[_0xf9fa14(0x1f3)](getSessionsDir(),_0x22ed52+_0xf9fa14(0x213));if(!a50_0x5bb8f0['existsSync'](_0x4b38b8))return;try{const _0x4fd1f8=a50_0x5bb8f0[_0xf9fa14(0x21a)](_0x4b38b8,_0xf9fa14(0x209)),_0x5ee74f=JSON[_0xf9fa14(0x206)](_0x4fd1f8);delete _0x5ee74f[_0xb4b01],a50_0x5bb8f0[_0xf9fa14(0x217)](_0x4b38b8,JSON['stringify'](_0x5ee74f,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x35797f=a50_0x5439,_0x37f8a7=getSessionsDir();if(!a50_0x5bb8f0[_0x35797f(0x216)](_0x37f8a7))return 0x0;let _0x20c0e0=0x0;const _0x419c97=Date[_0x35797f(0x21f)]();try{const _0xc6d16a=a50_0x5bb8f0[_0x35797f(0x204)](_0x37f8a7);for(const _0x4e9e71 of _0xc6d16a){if(!_0x4e9e71[_0x35797f(0x20d)]('.json'))continue;const _0x2d4c4a=a50_0x54c431[_0x35797f(0x1f3)](_0x37f8a7,_0x4e9e71),_0x545b23=_0x4e9e71[_0x35797f(0x1f7)](_0x35797f(0x213),''),_0x3b8df1=parseInt(_0x545b23,0xa),_0x3a5932=!isNaN(_0x3b8df1);if(_0x3a5932){if(!isProcessRunning(_0x3b8df1)){a50_0x5bb8f0[_0x35797f(0x208)](_0x2d4c4a),_0x20c0e0++;continue;}}try{const _0x3ffb12=a50_0x5bb8f0[_0x35797f(0x21a)](_0x2d4c4a,'utf-8'),_0x1e54b7=JSON[_0x35797f(0x206)](_0x3ffb12),_0x1974d9=new Date(_0x1e54b7[_0x35797f(0x215)])['getTime']();_0x419c97-_0x1974d9>SESSION_EXPIRATION_MS&&(a50_0x5bb8f0[_0x35797f(0x208)](_0x2d4c4a),_0x20c0e0++);}catch{a50_0x5bb8f0[_0x35797f(0x208)](_0x2d4c4a),_0x20c0e0++;}}}catch{}return _0x20c0e0;}export function listActiveSessions(){const _0x41131f=a50_0x5439,_0x13781e=getSessionsDir();if(!a50_0x5bb8f0['existsSync'](_0x13781e))return[];try{const _0x13e3b0=a50_0x5bb8f0['readdirSync'](_0x13781e),_0x597b3b=[];for(const _0x11221c of _0x13e3b0){if(!_0x11221c['endsWith'](_0x41131f(0x213)))continue;const _0x2f4b41=_0x11221c[_0x41131f(0x1f7)](_0x41131f(0x213),''),_0x4da386=parseInt(_0x2f4b41,0xa);!isNaN(_0x4da386)&&isProcessRunning(_0x4da386)&&_0x597b3b[_0x41131f(0x211)](_0x4da386);}return _0x597b3b[_0x41131f(0x20a)]((_0x2a2bcc,_0x70ae33)=>_0x2a2bcc-_0x70ae33);}catch{return[];}}
1
+ (function(_0x582255,_0x2355aa){const _0x3eb58c=a50_0x14fe,_0x22995c=_0x582255();while(!![]){try{const _0x41b724=-parseInt(_0x3eb58c(0x145))/0x1*(parseInt(_0x3eb58c(0x165))/0x2)+-parseInt(_0x3eb58c(0x166))/0x3+-parseInt(_0x3eb58c(0x16a))/0x4+-parseInt(_0x3eb58c(0x155))/0x5+-parseInt(_0x3eb58c(0x158))/0x6*(-parseInt(_0x3eb58c(0x15f))/0x7)+parseInt(_0x3eb58c(0x16c))/0x8*(parseInt(_0x3eb58c(0x144))/0x9)+-parseInt(_0x3eb58c(0x152))/0xa*(-parseInt(_0x3eb58c(0x15e))/0xb);if(_0x41b724===_0x2355aa)break;else _0x22995c['push'](_0x22995c['shift']());}catch(_0x23f779){_0x22995c['push'](_0x22995c['shift']());}}}(a50_0x5afd,0xe823a));import*as a50_0x31b6d9 from'node:fs';import*as a50_0x542ac8 from'node:path';import*as a50_0x55c243 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 _0x210d58=a50_0x14fe,_0x3882d7=process[_0x210d58(0x164)][_0x210d58(0x167)]||a50_0x542ac8['join'](a50_0x55c243[_0x210d58(0x153)](),'.config',_0x210d58(0x14d));return a50_0x542ac8['join'](_0x3882d7,_0x210d58(0x156));}function getSessionPath(_0x3c0877){const _0x1200b2=a50_0x14fe;return a50_0x542ac8[_0x1200b2(0x14a)](getSessionsDir(),_0x3c0877+_0x1200b2(0x157));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x4f658c){const _0x39a594=a50_0x14fe;if(_0x4f658c)return _0x4f658c;return getCurrentSessionPID()[_0x39a594(0x161)]();}export function loadSessionContext(_0x4e1ae6){const _0x383aab=a50_0x14fe,_0x3c64ff=_0x4e1ae6||getCurrentSessionPID()[_0x383aab(0x161)](),_0x38402f=/^\d+$/[_0x383aab(0x149)](_0x3c64ff)?parseInt(_0x3c64ff,0xa):null;return _0x38402f!==null?loadSessionContextByPID(_0x38402f):loadSessionContextByString(_0x3c64ff);}export function loadSessionContextByPID(_0x1391cf){const _0x5a981f=a50_0x14fe,_0x3eefae=getSessionPath(_0x1391cf);if(!a50_0x31b6d9['existsSync'](_0x3eefae))return null;try{const _0x344d13=a50_0x31b6d9[_0x5a981f(0x163)](_0x3eefae,_0x5a981f(0x143)),_0x2c422a=JSON[_0x5a981f(0x147)](_0x344d13),_0x4c0aee=new Date(_0x2c422a[_0x5a981f(0x150)])[_0x5a981f(0x14f)](),_0x16f2fd=Date['now']();if(_0x16f2fd-_0x4c0aee>SESSION_EXPIRATION_MS)return a50_0x31b6d9['unlinkSync'](_0x3eefae),null;const _0x4dd769=JSON[_0x5a981f(0x15c)](_0x2c422a);if(_0x4dd769[_0x5a981f(0x15b)]('TD_API_KEY')||_0x4dd769['includes'](_0x5a981f(0x160))||_0x4dd769[_0x5a981f(0x15b)](_0x5a981f(0x16d)))return console[_0x5a981f(0x146)](_0x5a981f(0x14c)+_0x3eefae+_0x5a981f(0x154)),a50_0x31b6d9[_0x5a981f(0x15a)](_0x3eefae),null;return _0x2c422a;}catch{try{a50_0x31b6d9[_0x5a981f(0x15a)](_0x3eefae);}catch{}return null;}}function loadSessionContextByString(_0x162015){const _0x3ea0c2=a50_0x14fe,_0x461adc=a50_0x542ac8[_0x3ea0c2(0x14a)](getSessionsDir(),_0x162015+_0x3ea0c2(0x157));if(!a50_0x31b6d9['existsSync'](_0x461adc))return null;try{const _0x249fc1=a50_0x31b6d9[_0x3ea0c2(0x163)](_0x461adc,_0x3ea0c2(0x143)),_0x127023=JSON[_0x3ea0c2(0x147)](_0x249fc1),_0x3d51cd=new Date(_0x127023['createdAt'])[_0x3ea0c2(0x14f)](),_0x1f0a8b=Date[_0x3ea0c2(0x162)]();if(_0x1f0a8b-_0x3d51cd>SESSION_EXPIRATION_MS)return a50_0x31b6d9[_0x3ea0c2(0x15a)](_0x461adc),null;const _0x565a7b=JSON['stringify'](_0x127023);if(_0x565a7b[_0x3ea0c2(0x15b)]('TD_API_KEY')||_0x565a7b['includes'](_0x3ea0c2(0x160))||_0x565a7b[_0x3ea0c2(0x15b)]('api_key'))return console[_0x3ea0c2(0x146)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x461adc+_0x3ea0c2(0x154)),a50_0x31b6d9[_0x3ea0c2(0x15a)](_0x461adc),null;return _0x127023;}catch{try{a50_0x31b6d9[_0x3ea0c2(0x15a)](_0x461adc);}catch{}return null;}}export function saveSessionContext(_0x539ebb,_0x2fe184){const _0x1deb70=a50_0x14fe,_0x131cd6=_0x2fe184||getCurrentSessionPID()[_0x1deb70(0x161)](),_0x3a7626=/^\d+$/[_0x1deb70(0x149)](_0x131cd6)?parseInt(_0x131cd6,0xa):getCurrentSessionPID(),_0x142fc1=a50_0x542ac8[_0x1deb70(0x14a)](getSessionsDir(),_0x131cd6+_0x1deb70(0x157)),_0x792ff5=getSessionsDir();createSecureDirectory(_0x792ff5);const _0x500d4f=JSON['stringify'](_0x539ebb);if(_0x500d4f[_0x1deb70(0x15b)](_0x1deb70(0x148))||_0x500d4f[_0x1deb70(0x15b)](_0x1deb70(0x160))||_0x500d4f[_0x1deb70(0x15b)](_0x1deb70(0x16d)))throw new Error(_0x1deb70(0x14e));let _0x518175;const _0x240f21=/^\d+$/[_0x1deb70(0x149)](_0x131cd6)?loadSessionContextByPID(parseInt(_0x131cd6,0xa)):loadSessionContextByString(_0x131cd6);_0x240f21?_0x518175={..._0x240f21,..._0x539ebb,'pid':_0x3a7626,'sessionId':_0x131cd6!==_0x3a7626[_0x1deb70(0x161)]()?_0x131cd6:undefined,'updatedAt':new Date()['toISOString']()}:_0x518175={'pid':_0x3a7626,'sessionId':_0x131cd6!==_0x3a7626[_0x1deb70(0x161)]()?_0x131cd6:undefined,..._0x539ebb,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0x1deb70(0x151)]()},a50_0x31b6d9['writeFileSync'](_0x142fc1,JSON[_0x1deb70(0x15c)](_0x518175,null,0x2));}export function clearSessionContext(_0x414451){const _0x3e34d7=a50_0x14fe,_0x252d6a=_0x414451||getCurrentSessionPID()['toString'](),_0x445e14=a50_0x542ac8['join'](getSessionsDir(),_0x252d6a+_0x3e34d7(0x157));a50_0x31b6d9[_0x3e34d7(0x14b)](_0x445e14)&&a50_0x31b6d9['unlinkSync'](_0x445e14);}function a50_0x5afd(){const _0x15939b=['8UAvDvt','api_key','sort','utf-8','1806075cSbrSt','25824JEWhvr','warn','parse','TD_API_KEY','test','join','existsSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','tdx','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','getTime','createdAt','toISOString','40XRrpdQ','homedir','.\x20This\x20is\x20insecure.\x20Removing\x20session.','6036145cKQiGP','sessions','.json','678cnSYTX','endsWith','unlinkSync','includes','stringify','push','6175037bTzskB','93884SHhsnl','apiKey','toString','now','readFileSync','env','12XnxddO','3472944tNxdAo','TDX_CONFIG_DIR','writeFileSync','replace','1964144laFqTR','readdirSync'];a50_0x5afd=function(){return _0x15939b;};return a50_0x5afd();}export function clearSessionContextField(_0x3788f3,_0x155b1e){const _0x1405b4=a50_0x14fe,_0x24bf81=_0x155b1e||getCurrentSessionPID()[_0x1405b4(0x161)](),_0x144365=a50_0x542ac8['join'](getSessionsDir(),_0x24bf81+_0x1405b4(0x157));if(!a50_0x31b6d9['existsSync'](_0x144365))return;try{const _0x298da1=a50_0x31b6d9[_0x1405b4(0x163)](_0x144365,_0x1405b4(0x143)),_0x5eb7a3=JSON[_0x1405b4(0x147)](_0x298da1);delete _0x5eb7a3[_0x3788f3],a50_0x31b6d9[_0x1405b4(0x168)](_0x144365,JSON[_0x1405b4(0x15c)](_0x5eb7a3,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x556eb8=a50_0x14fe,_0x65a63c=getSessionsDir();if(!a50_0x31b6d9[_0x556eb8(0x14b)](_0x65a63c))return 0x0;let _0x356525=0x0;const _0x11d084=Date[_0x556eb8(0x162)]();try{const _0x1dacfd=a50_0x31b6d9[_0x556eb8(0x16b)](_0x65a63c);for(const _0x9f9bd of _0x1dacfd){if(!_0x9f9bd[_0x556eb8(0x159)](_0x556eb8(0x157)))continue;const _0xd51557=a50_0x542ac8[_0x556eb8(0x14a)](_0x65a63c,_0x9f9bd),_0x4b2cf2=_0x9f9bd[_0x556eb8(0x169)](_0x556eb8(0x157),''),_0x43192e=parseInt(_0x4b2cf2,0xa),_0x5691db=!isNaN(_0x43192e);if(_0x5691db){if(!isProcessRunning(_0x43192e)){a50_0x31b6d9[_0x556eb8(0x15a)](_0xd51557),_0x356525++;continue;}}try{const _0x5165db=a50_0x31b6d9[_0x556eb8(0x163)](_0xd51557,_0x556eb8(0x143)),_0xd1ee9c=JSON[_0x556eb8(0x147)](_0x5165db),_0x480f19=new Date(_0xd1ee9c[_0x556eb8(0x150)])[_0x556eb8(0x14f)]();_0x11d084-_0x480f19>SESSION_EXPIRATION_MS&&(a50_0x31b6d9[_0x556eb8(0x15a)](_0xd51557),_0x356525++);}catch{a50_0x31b6d9[_0x556eb8(0x15a)](_0xd51557),_0x356525++;}}}catch{}return _0x356525;}function a50_0x14fe(_0x356abc,_0x4d7294){_0x356abc=_0x356abc-0x143;const _0x5afd2d=a50_0x5afd();let _0x14fe1c=_0x5afd2d[_0x356abc];return _0x14fe1c;}export function listActiveSessions(){const _0x11301c=a50_0x14fe,_0x305892=getSessionsDir();if(!a50_0x31b6d9['existsSync'](_0x305892))return[];try{const _0x4cf822=a50_0x31b6d9[_0x11301c(0x16b)](_0x305892),_0x2f27fd=[];for(const _0x349957 of _0x4cf822){if(!_0x349957[_0x11301c(0x159)](_0x11301c(0x157)))continue;const _0x5ab685=_0x349957[_0x11301c(0x169)](_0x11301c(0x157),''),_0x13f6be=parseInt(_0x5ab685,0xa);!isNaN(_0x13f6be)&&isProcessRunning(_0x13f6be)&&_0x2f27fd[_0x11301c(0x15d)](_0x13f6be);}return _0x2f27fd[_0x11301c(0x16e)]((_0x38953c,_0x91527c)=>_0x38953c-_0x91527c);}catch{return[];}}
@@ -1 +1 @@
1
- (function(_0x1031e0,_0x5539df){const _0x577bde=a51_0x5e44,_0x1a3490=_0x1031e0();while(!![]){try{const _0x552154=-parseInt(_0x577bde(0x147))/0x1+parseInt(_0x577bde(0x13d))/0x2*(parseInt(_0x577bde(0x149))/0x3)+parseInt(_0x577bde(0x143))/0x4+parseInt(_0x577bde(0x13f))/0x5+-parseInt(_0x577bde(0x140))/0x6*(-parseInt(_0x577bde(0x144))/0x7)+parseInt(_0x577bde(0x145))/0x8+-parseInt(_0x577bde(0x142))/0x9;if(_0x552154===_0x5539df)break;else _0x1a3490['push'](_0x1a3490['shift']());}catch(_0x4ec8ee){_0x1a3490['push'](_0x1a3490['shift']());}}}(a51_0x557d,0xb9e47));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x4a5c90){const _0x5842fc=a51_0x5e44,_0x5a7de2=_0x4a5c90||'default';return join(getCacheDir(),'users-'+_0x5a7de2+_0x5842fc(0x146));}function a51_0x557d(){const _0x279b75=['1114811rzNwqN','utf-8','3871101GpBwyv','now','2uINvpU','stringify','1247495hGkIGu','36ABPQMi','parse','15174504YhkTve','5761140HLeFlu','356230vXhNpz','2214328FKbBxH','.json'];a51_0x557d=function(){return _0x279b75;};return a51_0x557d();}function a51_0x5e44(_0x347b56,_0x4ca0a8){_0x347b56=_0x347b56-0x13c;const _0x557dec=a51_0x557d();let _0x5e442e=_0x557dec[_0x347b56];return _0x5e442e;}export function loadCachedUsers(_0x2e7c74){const _0x3adcd5=a51_0x5e44,_0x57e414=getCacheFilePath(_0x2e7c74);if(!existsSync(_0x57e414))return null;try{const _0x2b53e7=readFileSync(_0x57e414,_0x3adcd5(0x148)),_0x4aa576=JSON[_0x3adcd5(0x141)](_0x2b53e7);return _0x4aa576['users'];}catch{return null;}}export function saveCachedUsers(_0x24a28f,_0xf150de){const _0x13fa8f=a51_0x5e44,_0x1de0c3=getCacheDir();!existsSync(_0x1de0c3)&&mkdirSync(_0x1de0c3,{'recursive':!![]});const _0xa96cac=getCacheFilePath(_0x24a28f),_0x450bbd={'users':_0xf150de,'cachedAt':Date[_0x13fa8f(0x13c)]()};writeFileSync(_0xa96cac,JSON[_0x13fa8f(0x13e)](_0x450bbd,null,0x2),_0x13fa8f(0x148));}export function clearUserCache(_0x780533){const _0xba0427=getCacheFilePath(_0x780533);if(existsSync(_0xba0427))try{unlinkSync(_0xba0427);}catch{}}
1
+ (function(_0x2c81fc,_0x439a0e){const _0x20c5b6=a51_0x3095,_0x3cef05=_0x2c81fc();while(!![]){try{const _0x450602=-parseInt(_0x20c5b6(0x139))/0x1*(parseInt(_0x20c5b6(0x13a))/0x2)+-parseInt(_0x20c5b6(0x141))/0x3*(parseInt(_0x20c5b6(0x145))/0x4)+parseInt(_0x20c5b6(0x13f))/0x5*(-parseInt(_0x20c5b6(0x13e))/0x6)+-parseInt(_0x20c5b6(0x149))/0x7+-parseInt(_0x20c5b6(0x143))/0x8+-parseInt(_0x20c5b6(0x138))/0x9*(-parseInt(_0x20c5b6(0x140))/0xa)+parseInt(_0x20c5b6(0x13d))/0xb;if(_0x450602===_0x439a0e)break;else _0x3cef05['push'](_0x3cef05['shift']());}catch(_0x597ee4){_0x3cef05['push'](_0x3cef05['shift']());}}}(a51_0x4ce7,0x9e5d0));function a51_0x4ce7(){const _0x3e183f=['135066uzUdxl','utf-8','4061256JQfnCY','default','80wLITFl','parse','users-','stringify','2708783sTkUdA','27FGKwtw','8935sohhdH','184wHpoqZ','users','now','32219396nIOBJX','2430822eFlXzG','5czmhJT','2472810jWdpdr'];a51_0x4ce7=function(){return _0x3e183f;};return a51_0x4ce7();}import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';function a51_0x3095(_0x1eb0eb,_0x23125b){_0x1eb0eb=_0x1eb0eb-0x138;const _0x4ce78a=a51_0x4ce7();let _0x309528=_0x4ce78a[_0x1eb0eb];return _0x309528;}import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x350a0c){const _0x31137e=a51_0x3095,_0x3193b5=_0x350a0c||_0x31137e(0x144);return join(getCacheDir(),_0x31137e(0x147)+_0x3193b5+'.json');}export function loadCachedUsers(_0x436a6e){const _0x188419=a51_0x3095,_0x27cfcc=getCacheFilePath(_0x436a6e);if(!existsSync(_0x27cfcc))return null;try{const _0x121691=readFileSync(_0x27cfcc,'utf-8'),_0x541b52=JSON[_0x188419(0x146)](_0x121691);return _0x541b52[_0x188419(0x13b)];}catch{return null;}}export function saveCachedUsers(_0x20a56b,_0x15190a){const _0x18bde1=a51_0x3095,_0x1dde36=getCacheDir();!existsSync(_0x1dde36)&&mkdirSync(_0x1dde36,{'recursive':!![]});const _0x5ba3d0=getCacheFilePath(_0x20a56b),_0xc14605={'users':_0x15190a,'cachedAt':Date[_0x18bde1(0x13c)]()};writeFileSync(_0x5ba3d0,JSON[_0x18bde1(0x148)](_0xc14605,null,0x2),_0x18bde1(0x142));}export function clearUserCache(_0x1217c9){const _0x2b9d0b=getCacheFilePath(_0x1217c9);if(existsSync(_0x2b9d0b))try{unlinkSync(_0x2b9d0b);}catch{}}
@@ -1 +1 @@
1
- (function(_0x1f4d96,_0x3e7622){const _0x145b2a=a52_0x5799,_0x4dd366=_0x1f4d96();while(!![]){try{const _0x181633=-parseInt(_0x145b2a(0x17e))/0x1*(-parseInt(_0x145b2a(0x174))/0x2)+parseInt(_0x145b2a(0x175))/0x3*(parseInt(_0x145b2a(0x179))/0x4)+parseInt(_0x145b2a(0x171))/0x5+-parseInt(_0x145b2a(0x17d))/0x6*(parseInt(_0x145b2a(0x170))/0x7)+-parseInt(_0x145b2a(0x177))/0x8+parseInt(_0x145b2a(0x173))/0x9*(-parseInt(_0x145b2a(0x176))/0xa)+-parseInt(_0x145b2a(0x17c))/0xb;if(_0x181633===_0x3e7622)break;else _0x4dd366['push'](_0x4dd366['shift']());}catch(_0x32139e){_0x4dd366['push'](_0x4dd366['shift']());}}}(a52_0x27de,0x6df79));function a52_0x27de(){const _0x3fa840=['2773345DHUzzC','version','352287wsJJGT','352074czIaoJ','72FOUZtT','120NwCZan','3124304ukVaDt','utf-8','141140NHPCmt','includes','parse','4428017XrlpiJ','23046QmCtnQ','5YiTWDw','0.0.0','../build-info.json','1036eoRtGe'];a52_0x27de=function(){return _0x3fa840;};return a52_0x27de();}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x534c59=a52_0x5799;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x3e3471=fileURLToPath(import.meta.url),_0xc12605=dirname(_0x3e3471);try{const _0x4815cf=join(_0xc12605,_0x534c59(0x180));cachedBuildInfo=JSON[_0x534c59(0x17b)](readFileSync(_0x4815cf,_0x534c59(0x178)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}function a52_0x5799(_0x368a3d,_0x5650b2){_0x368a3d=_0x368a3d-0x170;const _0x27deca=a52_0x27de();let _0x5799a0=_0x27deca[_0x368a3d];return _0x5799a0;}export function getVersion(){const _0x54dfd6=a52_0x5799;if(cachedVersion!==null)return cachedVersion;const _0x574aa0=fileURLToPath(import.meta.url),_0x5dd063=dirname(_0x574aa0),_0x3c861b=getBuildInfo();if(_0x3c861b[_0x54dfd6(0x172)])return cachedVersion=_0x3c861b[_0x54dfd6(0x172)],cachedVersion;try{const _0x315389=join(_0x5dd063,'../../package.json'),_0x275a9f=JSON[_0x54dfd6(0x17b)](readFileSync(_0x315389,'utf-8'));cachedVersion=_0x275a9f[_0x54dfd6(0x172)];}catch{cachedVersion=_0x54dfd6(0x17f);}return cachedVersion;}export function isDevVersion(){const _0x59ea06=a52_0x5799,_0x1c0f87=getVersion();return _0x1c0f87['includes']('.dev')||_0x1c0f87[_0x59ea06(0x17a)]('-');}
1
+ (function(_0x3e1c31,_0x7a233f){const _0x312a37=a52_0x428a,_0x1d79ff=_0x3e1c31();while(!![]){try{const _0xcde963=parseInt(_0x312a37(0x6d))/0x1+parseInt(_0x312a37(0x7b))/0x2*(-parseInt(_0x312a37(0x70))/0x3)+parseInt(_0x312a37(0x78))/0x4*(parseInt(_0x312a37(0x7c))/0x5)+-parseInt(_0x312a37(0x71))/0x6*(parseInt(_0x312a37(0x79))/0x7)+parseInt(_0x312a37(0x77))/0x8+-parseInt(_0x312a37(0x7a))/0x9*(-parseInt(_0x312a37(0x76))/0xa)+-parseInt(_0x312a37(0x72))/0xb*(parseInt(_0x312a37(0x6e))/0xc);if(_0xcde963===_0x7a233f)break;else _0x1d79ff['push'](_0x1d79ff['shift']());}catch(_0x5eb41a){_0x1d79ff['push'](_0x1d79ff['shift']());}}}(a52_0x2bd8,0x33a45));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a52_0x2bd8(){const _0x47746c=['1432064KRttTi','4EQMIhL','777KpeuGG','459972nclEsb','22642lmEUzB','466420TMWulU','utf-8','version','includes','289748zidePS','64500ygomfU','.dev','15DGEHOv','17778FLmWNX','33GgbodQ','parse','../build-info.json','../../package.json','10nSXKmB'];a52_0x2bd8=function(){return _0x47746c;};return a52_0x2bd8();}function a52_0x428a(_0x1c55df,_0x54b1e1){_0x1c55df=_0x1c55df-0x6d;const _0x2bd834=a52_0x2bd8();let _0x428ab0=_0x2bd834[_0x1c55df];return _0x428ab0;}let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x4e107e=a52_0x428a;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x45145d=fileURLToPath(import.meta.url),_0xe33c67=dirname(_0x45145d);try{const _0xaeabf6=join(_0xe33c67,_0x4e107e(0x74));cachedBuildInfo=JSON[_0x4e107e(0x73)](readFileSync(_0xaeabf6,_0x4e107e(0x7d)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x3784ec=a52_0x428a;if(cachedVersion!==null)return cachedVersion;const _0xc63b50=fileURLToPath(import.meta.url),_0x1742d1=dirname(_0xc63b50),_0x22c28d=getBuildInfo();if(_0x22c28d[_0x3784ec(0x7e)])return cachedVersion=_0x22c28d[_0x3784ec(0x7e)],cachedVersion;try{const _0x57138b=join(_0x1742d1,_0x3784ec(0x75)),_0x2995bd=JSON['parse'](readFileSync(_0x57138b,_0x3784ec(0x7d)));cachedVersion=_0x2995bd[_0x3784ec(0x7e)];}catch{cachedVersion='0.0.0';}return cachedVersion;}export function isDevVersion(){const _0x3dfad6=a52_0x428a,_0x54e799=getVersion();return _0x54e799[_0x3dfad6(0x7f)](_0x3dfad6(0x6f))||_0x54e799[_0x3dfad6(0x7f)]('-');}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function a53_0x4234(_0x1952fb,_0x42f542){_0x1952fb=_0x1952fb-0x120;var _0x367455=a53_0x3674();var _0x4234b3=_0x367455[_0x1952fb];return _0x4234b3;}(function(_0x3b40f6,_0x52b4e9){var _0x54f25d=a53_0x4234,_0x26e8ed=_0x3b40f6();while(!![]){try{var _0x566c24=parseInt(_0x54f25d(0x126))/0x1+parseInt(_0x54f25d(0x125))/0x2+-parseInt(_0x54f25d(0x121))/0x3*(parseInt(_0x54f25d(0x123))/0x4)+parseInt(_0x54f25d(0x122))/0x5+-parseInt(_0x54f25d(0x128))/0x6+parseInt(_0x54f25d(0x124))/0x7*(parseInt(_0x54f25d(0x127))/0x8)+-parseInt(_0x54f25d(0x120))/0x9;if(_0x566c24===_0x52b4e9)break;else _0x26e8ed['push'](_0x26e8ed['shift']());}catch(_0x2ec479){_0x26e8ed['push'](_0x26e8ed['shift']());}}}(a53_0x3674,0x34195));export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';function a53_0x3674(){var _0x7242f9=['1697928wXJIcp','2285766zXMAuK','300Gputpt','128580civbnb','3124cCLXjC','24843LZAixK','688720JUVxgw','266737oRNown','432Smwrho'];a53_0x3674=function(){return _0x7242f9;};return a53_0x3674();}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';export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
1
+ (function(_0x5d6d70,_0x12a3c5){var _0x3e1811=a53_0x2b25,_0x17b6fd=_0x5d6d70();while(!![]){try{var _0x5d0712=parseInt(_0x3e1811(0x87))/0x1*(-parseInt(_0x3e1811(0x85))/0x2)+parseInt(_0x3e1811(0x82))/0x3*(parseInt(_0x3e1811(0x88))/0x4)+parseInt(_0x3e1811(0x83))/0x5+parseInt(_0x3e1811(0x89))/0x6+-parseInt(_0x3e1811(0x84))/0x7*(parseInt(_0x3e1811(0x86))/0x8)+parseInt(_0x3e1811(0x80))/0x9+parseInt(_0x3e1811(0x81))/0xa;if(_0x5d0712===_0x12a3c5)break;else _0x17b6fd['push'](_0x17b6fd['shift']());}catch(_0x48626b){_0x17b6fd['push'](_0x17b6fd['shift']());}}}(a53_0xf3d1,0x8d860));export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';export*from'./sdk/client/td-api-client.js';export{TrinoApiClient}from'./sdk/client/trino-api-client.js';export*from'./sdk/client/rate-limiter.js';export*from'./sdk/types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';function a53_0xf3d1(){var _0x56c4a7=['4329895KMWNpo','90461lrysOh','44aKuxHl','472fZlACW','9092sfyhck','652ncVsAv','814572uBtdKd','832653KMtQPi','4164440vVJIvv','579htyapl'];a53_0xf3d1=function(){return _0x56c4a7;};return a53_0xf3d1();}export*from'./commands/segments.js';export*from'./commands/activations.js';function a53_0x2b25(_0x51291b,_0x1d0190){_0x51291b=_0x51291b-0x80;var _0xf3d163=a53_0xf3d1();var _0x2b25d5=_0xf3d163[_0x51291b];return _0x2b25d5;}export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';