@treasuredata/tdx 0.14.6 → 0.14.7

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 (142) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/api-command.js +1 -1
  8. package/dist/commands/auth-command.js +1 -1
  9. package/dist/commands/chat-command.js +1 -1
  10. package/dist/commands/claude-command.d.ts.map +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-command.js.map +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/unset-command.js +1 -1
  41. package/dist/commands/use-command.js +1 -1
  42. package/dist/commands/user-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/command-output.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/connection-cache.js +1 -1
  48. package/dist/core/constants.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/core/user-cache.js +1 -1
  56. package/dist/core/version.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/passthrough-server.js +1 -1
  63. package/dist/proxy/server.js +1 -1
  64. package/dist/proxy/session-cache.js +1 -1
  65. package/dist/proxy/sse-usage-parser.js +1 -1
  66. package/dist/sdk/agent/agent-config.js +1 -1
  67. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  68. package/dist/sdk/agent/agent-yaml.js +1 -1
  69. package/dist/sdk/api.js +1 -1
  70. package/dist/sdk/client/cdp-api-client.js +1 -1
  71. package/dist/sdk/client/endpoints.js +1 -1
  72. package/dist/sdk/client/engage-api-client.js +1 -1
  73. package/dist/sdk/client/http-client.d.ts.map +1 -1
  74. package/dist/sdk/client/http-client.js +1 -1
  75. package/dist/sdk/client/http-client.js.map +1 -1
  76. package/dist/sdk/client/llm-api-client.js +1 -1
  77. package/dist/sdk/client/rate-limiter.js +1 -1
  78. package/dist/sdk/client/td-api-client.js +1 -1
  79. package/dist/sdk/client/trino-api-client.js +1 -1
  80. package/dist/sdk/client/workflow-client.js +1 -1
  81. package/dist/sdk/connection-validator.js +1 -1
  82. package/dist/sdk/connection.js +1 -1
  83. package/dist/sdk/engage.js +1 -1
  84. package/dist/sdk/errors.js +1 -1
  85. package/dist/sdk/index.js +1 -1
  86. package/dist/sdk/io/index.js +1 -1
  87. package/dist/sdk/io/node-filesystem.js +1 -1
  88. package/dist/sdk/job.js +1 -1
  89. package/dist/sdk/journey.js +1 -1
  90. package/dist/sdk/llm/chat-cache.js +1 -1
  91. package/dist/sdk/llm/index.js +1 -1
  92. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  93. package/dist/sdk/llm/model-aliases.js +1 -1
  94. package/dist/sdk/llm/model-factors.js +1 -1
  95. package/dist/sdk/query/index.js +1 -1
  96. package/dist/sdk/query/sql-parser.js +1 -1
  97. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  98. package/dist/sdk/segment/fields-display.js +1 -1
  99. package/dist/sdk/segment/file-discovery.js +1 -1
  100. package/dist/sdk/segment/journey-utils.js +1 -1
  101. package/dist/sdk/segment/journey-yaml.js +1 -1
  102. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  103. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/pull-workflow.js +1 -1
  105. package/dist/sdk/segment/push-workflow.js +1 -1
  106. package/dist/sdk/segment/resolution-context.js +1 -1
  107. package/dist/sdk/segment/segment-path-parser.js +1 -1
  108. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  109. package/dist/sdk/segment/target-resolution.js +1 -1
  110. package/dist/sdk/segment/tdx-config.js +1 -1
  111. package/dist/sdk/segment/validate-files.js +1 -1
  112. package/dist/sdk/segment/yaml-validator.js +1 -1
  113. package/dist/sdk/segment.js +1 -1
  114. package/dist/sdk/types/index.js +1 -1
  115. package/dist/sdk/types/progress.js +1 -1
  116. package/dist/sdk/user.js +1 -1
  117. package/dist/sdk/util/format-detector.js +1 -1
  118. package/dist/sdk/util/formatters.js +1 -1
  119. package/dist/sdk/util/index.js +1 -1
  120. package/dist/sdk/util/tree-formatter.js +1 -1
  121. package/dist/sdk/workflow/clone-workflow.js +1 -1
  122. package/dist/sdk/workflow/index.js +1 -1
  123. package/dist/sdk/workflow/pull-workflow.js +1 -1
  124. package/dist/sdk/workflow/push-workflow.js +1 -1
  125. package/dist/sdk/workflow/tdx-config.js +1 -1
  126. package/dist/sdk/workflow/workflow-utils.js +1 -1
  127. package/dist/utils/async.js +1 -1
  128. package/dist/utils/colors.js +1 -1
  129. package/dist/utils/diff.js +1 -1
  130. package/dist/utils/file-permissions.js +1 -1
  131. package/dist/utils/json-loader.js +1 -1
  132. package/dist/utils/option-validation.js +1 -1
  133. package/dist/utils/port.js +1 -1
  134. package/dist/utils/process.js +1 -1
  135. package/dist/utils/prompt.js +1 -1
  136. package/dist/utils/spinner.js +1 -1
  137. package/dist/utils/sse-parser.js +1 -1
  138. package/dist/utils/string-utils.js +1 -1
  139. package/dist/utils/table-ref-parser.js +1 -1
  140. package/dist/utils/tdx-logger.js +1 -1
  141. package/dist/utils/version-check.js +1 -1
  142. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x395cd7,_0x290178){const _0x264827=a42_0xb962,_0x50a2c8=_0x395cd7();while(!![]){try{const _0x13e77b=-parseInt(_0x264827(0x1de))/0x1*(parseInt(_0x264827(0x1bb))/0x2)+parseInt(_0x264827(0x1db))/0x3*(-parseInt(_0x264827(0x1f0))/0x4)+parseInt(_0x264827(0x1e0))/0x5+parseInt(_0x264827(0x1b8))/0x6+-parseInt(_0x264827(0x1c0))/0x7+-parseInt(_0x264827(0x1dd))/0x8+parseInt(_0x264827(0x1c8))/0x9;if(_0x13e77b===_0x290178)break;else _0x50a2c8['push'](_0x50a2c8['shift']());}catch(_0x5aed3d){_0x50a2c8['push'](_0x50a2c8['shift']());}}}(a42_0x5cae,0xd2d39));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a42_0x5a132c from'node:fs';import*as a42_0x2a2137 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';function a42_0xb962(_0x138edb,_0x180802){_0x138edb=_0x138edb-0x1a6;const _0x5cae81=a42_0x5cae();let _0xb962ac=_0x5cae81[_0x138edb];return _0xb962ac;}import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a42_0x36fb2b from'chalk';export function getConfigDir(){const _0x5c37db=a42_0xb962;return process[_0x5c37db(0x1e6)][_0x5c37db(0x1bd)]||join(homedir(),_0x5c37db(0x1da),'tdx');}export function getConfigFile(){const _0x33ba56=a42_0xb962;return join(getConfigDir(),_0x33ba56(0x1be));}export function getConfigFilePath(_0x1db889){const _0x44afd5=a42_0xb962,_0x1d8860=getConfigDir();return _0x1db889?a42_0x2a2137[_0x44afd5(0x1dc)](_0x1d8860,_0x44afd5(0x1a9)+_0x1db889):getConfigFile();}export function getCacheDir(){const _0x401b0a=a42_0xb962;return process[_0x401b0a(0x1e6)][_0x401b0a(0x1ef)]||join(homedir(),'.cache',_0x401b0a(0x1ec));}export function getLLMProjectCacheFile(_0x520362){const _0x5634ce=a42_0xb962,_0x17af98=_0x520362?_0x5634ce(0x1a8)+_0x520362:_0x5634ce(0x1c4);return join(getCacheDir(),_0x17af98);}export function readCachedLLMProject(_0x2a6085){const _0x4e497c=a42_0xb962;try{const _0x74a197=getLLMProjectCacheFile(_0x2a6085);if(!existsSync(_0x74a197))return null;const _0x566559=readFileSync(_0x74a197,_0x4e497c(0x1c3))[_0x4e497c(0x1ee)]();try{const _0x40bf4e=JSON[_0x4e497c(0x1eb)](_0x566559);if(_0x40bf4e&&typeof _0x40bf4e['id']==='string'&&typeof _0x40bf4e['name']==='string')return _0x40bf4e;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x583246,_0x5b8d9f,_0x4c1936){const _0x3f5aaa=a42_0xb962;try{const _0x52bd47=getCacheDir(),_0x19ef10=getLLMProjectCacheFile(_0x4c1936);!existsSync(_0x52bd47)&&mkdirSync(_0x52bd47,{'recursive':!![]});const _0x5e965c={'name':_0x583246,'id':_0x5b8d9f};writeFileSync(_0x19ef10,JSON['stringify'](_0x5e965c),_0x3f5aaa(0x1c3));}catch{}}export function getLLMAgentCacheFile(_0x560e18){const _0x405bfd=a42_0xb962,_0x33edd7=_0x560e18?_0x405bfd(0x1c7)+_0x560e18:_0x405bfd(0x1b1);return join(getCacheDir(),_0x33edd7);}export function readCachedLLMAgent(_0x522311){const _0x520ecc=a42_0xb962;try{const _0x531ed6=getLLMAgentCacheFile(_0x522311);if(!existsSync(_0x531ed6))return null;const _0x1f6228=readFileSync(_0x531ed6,_0x520ecc(0x1c3))[_0x520ecc(0x1ee)]();try{const _0x290b1b=JSON['parse'](_0x1f6228);if(_0x290b1b&&typeof _0x290b1b['id']===_0x520ecc(0x1aa)&&typeof _0x290b1b[_0x520ecc(0x1e1)]===_0x520ecc(0x1aa)&&typeof _0x290b1b['projectId']==='string')return _0x290b1b;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x122e19,_0xcc1a85,_0x126410,_0x159856){const _0x42a9ad=a42_0xb962;try{const _0x541e62=getCacheDir(),_0x1296b5=getLLMAgentCacheFile(_0x159856);!existsSync(_0x541e62)&&mkdirSync(_0x541e62,{'recursive':!![]});const _0x282696={'name':_0x122e19,'id':_0xcc1a85,'projectId':_0x126410};writeFileSync(_0x1296b5,JSON[_0x42a9ad(0x1f1)](_0x282696),_0x42a9ad(0x1c3));}catch{}}export function clearCachedLLMAgent(_0x37c19a){try{const _0x49cfa8=getLLMAgentCacheFile(_0x37c19a);existsSync(_0x49cfa8)&&unlinkSync(_0x49cfa8);}catch{}}export function getAccountInfoCacheFile(_0x4144f9){const _0x36f824=a42_0xb962,_0xec1ec7=_0x4144f9?_0x36f824(0x1d9)+_0x4144f9+_0x36f824(0x1c9):'account_info.json';return join(getCacheDir(),_0xec1ec7);}export function readCachedAccountInfo(_0x52aec2){const _0x81f4cc=a42_0xb962;try{const _0x2bc181=getAccountInfoCacheFile(_0x52aec2);if(!existsSync(_0x2bc181))return null;const _0x4f2971=readFileSync(_0x2bc181,_0x81f4cc(0x1c3))[_0x81f4cc(0x1ee)](),_0x32557d=JSON[_0x81f4cc(0x1eb)](_0x4f2971);if(_0x32557d&&typeof _0x32557d['site']===_0x81f4cc(0x1aa)&&typeof _0x32557d[_0x81f4cc(0x1df)]===_0x81f4cc(0x1e8))return _0x32557d;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x2709f0,_0x3211c0,_0x24c4ef){const _0x9e22c3=a42_0xb962;try{const _0x206c7b=getCacheDir(),_0x2d4565=getAccountInfoCacheFile(_0x24c4ef);!existsSync(_0x206c7b)&&mkdirSync(_0x206c7b,{'recursive':!![]});const _0x32352c={'site':_0x2709f0,'accountId':_0x3211c0,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x2d4565,JSON[_0x9e22c3(0x1f1)](_0x32352c),_0x9e22c3(0x1c3));}catch{}}function a42_0x5cae(){const _0x5085b0=['apiKeys','TDX_CONFIG_DIR','.env','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','3369632bMyLQs','slice','Warning:\x20Failed\x20to\x20load\x20','utf-8','llm_default_project','replace','ap02','llm_default_agent.','12617397achJmg','.json','profile','tdx.json','split','existsSync','\x27,\x20defaulting\x20to\x20us01','map','stg-ap03','dev-us01','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','legacy\x20.env\x20file','includes','keychain','Warning:\x20Failed\x20to\x20read\x20','TDX_API_KEY','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','account_info.','.config','532509DMXJnJ','join','4092872QhnFDW','39cFRwFi','accountId','3953480bZJwNw','name','\x20env\x20var','toUpperCase','stg-us01','endsWith','env','entries','number','startsWith','Warning:\x20Unknown\x20site\x20\x27','parse','tdx','TD_API_KEY\x20env\x20var\x20(deprecated)','trim','TDX_CACHE_DIR','16JBCTjY','stringify','TD_API_KEY','TDX_API_KEY_','dev-eu01','llm_default_project.','.env.','string','some','ap03','TD_API_KEY_','match','filter','eu01','llm_default_agent','readFileSync','us01','jp01','warn','profiles','stg-jp01','7629456cuTfhS','keychain\x20(profile:\x20','yellow','46034tpQgoc'];a42_0x5cae=function(){return _0x5085b0;};return a42_0x5cae();}export function parseEnvFile(_0x30cfdd){const _0x53f12a=a42_0xb962,_0xd39e39={};for(const _0x5f3676 of _0x30cfdd[_0x53f12a(0x1cc)]('\x0a')){const _0x3026f6=_0x5f3676['trim']();if(!_0x3026f6||_0x3026f6[_0x53f12a(0x1e9)]('#'))continue;const _0x154812=_0x3026f6[_0x53f12a(0x1ae)](/^([^=]+)=(.*)$/);if(_0x154812){const _0x4e680c=_0x154812[0x1][_0x53f12a(0x1ee)]();let _0x35b1cf=_0x154812[0x2]['trim']();(_0x35b1cf[_0x53f12a(0x1e9)]('\x22')&&_0x35b1cf[_0x53f12a(0x1e5)]('\x22')||_0x35b1cf[_0x53f12a(0x1e9)]('\x27')&&_0x35b1cf[_0x53f12a(0x1e5)]('\x27'))&&(_0x35b1cf=_0x35b1cf[_0x53f12a(0x1c1)](0x1,-0x1)),_0xd39e39[_0x4e680c]=_0x35b1cf;}}return _0xd39e39;}export function readUserConfig(){const _0x5e9eaa=a42_0xb962,_0x40fe8e=getConfigFile();if(!existsSync(_0x40fe8e))return{};try{const _0x28ed32=readFileSync(_0x40fe8e,_0x5e9eaa(0x1c3));return parseEnvFile(_0x28ed32);}catch(_0x2eeffc){return console[_0x5e9eaa(0x1b5)](_0x5e9eaa(0x1bf)+_0x40fe8e+':',_0x2eeffc),{};}}export function resolveSite(_0x3edfe9){const _0x103de6=a42_0xb962,_0x5e3b95=[_0x103de6(0x1b3),_0x103de6(0x1b4),'eu01',_0x103de6(0x1c6),_0x103de6(0x1ac),_0x103de6(0x1d1),_0x103de6(0x1a7),_0x103de6(0x1e4),_0x103de6(0x1b7),'stg-ap03'];if(_0x5e3b95[_0x103de6(0x1d4)](_0x3edfe9))return _0x3edfe9;if(_0x3edfe9 in SITE_ALIASES)return SITE_ALIASES[_0x3edfe9];return console[_0x103de6(0x1b5)](_0x103de6(0x1ea)+_0x3edfe9+_0x103de6(0x1ce)),_0x103de6(0x1b3);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x4d277c,_0x34928a){const _0xeeb8fb=a42_0xb962,_0x3a7304=_0x34928a||getActiveProfileName();if(_0x3a7304){const _0xa05c5=_0xeeb8fb(0x1a6)+normalizeProfileForEnvVar(_0x3a7304);if(process[_0xeeb8fb(0x1e6)][_0xa05c5])return process[_0xeeb8fb(0x1e6)][_0xa05c5];}if(process[_0xeeb8fb(0x1e6)][_0xeeb8fb(0x1d7)])return process['env'][_0xeeb8fb(0x1d7)];if(process[_0xeeb8fb(0x1e6)][_0xeeb8fb(0x1f2)])return process[_0xeeb8fb(0x1e6)][_0xeeb8fb(0x1f2)];const _0x5d976f=_0x4d277c[_0xeeb8fb(0x1e3)]()[_0xeeb8fb(0x1c5)](/-/g,'_'),_0x44dc46='TD_API_KEY_'+_0x5d976f;if(_0x3a7304){const _0x4e68a6=loadProfileEnv(_0x3a7304);if(_0x4e68a6){if(_0x4e68a6[_0x44dc46])return _0x4e68a6[_0x44dc46];if(_0x4e68a6['TD_API_KEY'])return _0x4e68a6[_0xeeb8fb(0x1f2)];}}const _0x2bc255=loadUserConfigOnce();if(_0x2bc255[_0x44dc46])return _0x2bc255[_0x44dc46];if(_0x2bc255[_0xeeb8fb(0x1f2)])return _0x2bc255[_0xeeb8fb(0x1f2)];return undefined;}export function normalizeProfileForEnvVar(_0x4bbdd4){const _0x1fa923=a42_0xb962;return _0x4bbdd4[_0x1fa923(0x1e3)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x275e94,_0x2b462d){const _0x1d1cb4=a42_0xb962,_0xe80172=_0x2b462d||getActiveProfileName()||undefined;if(_0xe80172){const _0x32f5e8=_0x1d1cb4(0x1a6)+normalizeProfileForEnvVar(_0xe80172);if(process['env'][_0x32f5e8])return{'apiKey':process[_0x1d1cb4(0x1e6)][_0x32f5e8],'source':_0x32f5e8+_0x1d1cb4(0x1e2),'isDeprecated':![]};const _0x1c677d=getCachedCredential(_0x275e94,_0xe80172);if(_0x1c677d)return{'apiKey':_0x1c677d,'source':_0x1d1cb4(0x1b9)+_0xe80172+')','isDeprecated':![]};const _0x4fb0ba=await getKeychainAPIKey(_0xe80172);if(_0x4fb0ba)return setCachedCredential(_0x4fb0ba,_0x275e94,_0xe80172),{'apiKey':_0x4fb0ba,'source':_0x1d1cb4(0x1b9)+_0xe80172+')','isDeprecated':![]};}if(process[_0x1d1cb4(0x1e6)]['TDX_API_KEY'])return{'apiKey':process['env']['TDX_API_KEY'],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0xe80172){const _0x581d39=getCachedCredential(_0x275e94,undefined);if(_0x581d39)return{'apiKey':_0x581d39,'source':_0x1d1cb4(0x1d5),'isDeprecated':![]};const _0x4e9f46=await getKeychainAPIKey(undefined);if(_0x4e9f46)return setCachedCredential(_0x4e9f46,_0x275e94,undefined),{'apiKey':_0x4e9f46,'source':_0x1d1cb4(0x1d5),'isDeprecated':![]};}if(process[_0x1d1cb4(0x1e6)]['TD_API_KEY'])return{'apiKey':process['env'][_0x1d1cb4(0x1f2)],'source':_0x1d1cb4(0x1ed),'isDeprecated':!![]};const _0x2c7a3e=getLegacyEnvAPIKey(_0x275e94,_0xe80172);if(_0x2c7a3e){const _0x19d6f9=await isKeychainAvailable();if(_0x19d6f9)try{await saveKeychainAPIKey(_0x2c7a3e,_0xe80172),setCachedCredential(_0x2c7a3e,_0x275e94,_0xe80172);const _0x543c1b=getConfigFilePath(_0xe80172);cleanupLegacyEnvFile(_0x543c1b)&&console[_0x1d1cb4(0x1b5)](a42_0x36fb2b[_0x1d1cb4(0x1ba)](_0x1d1cb4(0x1d2)));}catch(_0x3346fa){console[_0x1d1cb4(0x1b5)](a42_0x36fb2b[_0x1d1cb4(0x1ba)](_0x1d1cb4(0x1d8)+_0x3346fa));}const _0x7ae629=_0xe80172?'legacy\x20.env\x20file\x20(profile:\x20'+_0xe80172+')':_0x1d1cb4(0x1d3);return{'apiKey':_0x2c7a3e,'source':_0x7ae629,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x190837,_0x81ba97,_0x5956f3=!![]){const _0x585b31=a42_0xb962,_0x27872d=await resolveAPIKeyAsync(_0x190837,_0x81ba97);if(!_0x27872d)return undefined;if(_0x5956f3&&_0x27872d['isDeprecated']&&_0x27872d['source'][_0x585b31(0x1d4)](_0x585b31(0x1f2))){const _0x226ec6=_0x81ba97||getActiveProfileName()||undefined,_0x5a5324=_0x226ec6?_0x585b31(0x1a6)+normalizeProfileForEnvVar(_0x226ec6):'TDX_API_KEY_<PROFILE>';console['warn'](a42_0x36fb2b[_0x585b31(0x1ba)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x5a5324+').')));}return _0x27872d['apiKey'];}function getLegacyEnvAPIKey(_0x1c5c29,_0x514403){const _0x45600e=a42_0xb962,_0x182bdd=_0x1c5c29[_0x45600e(0x1e3)]()[_0x45600e(0x1c5)](/-/g,'_'),_0x369260=_0x45600e(0x1ad)+_0x182bdd;if(_0x514403){const _0x1f8ad0=loadProfileEnv(_0x514403);if(_0x1f8ad0){if(_0x1f8ad0[_0x369260])return _0x1f8ad0[_0x369260];if(_0x1f8ad0[_0x45600e(0x1f2)])return _0x1f8ad0[_0x45600e(0x1f2)];}}const _0x34a0a4=loadUserConfigOnce();if(_0x34a0a4[_0x369260])return _0x34a0a4[_0x369260];if(_0x34a0a4[_0x45600e(0x1f2)])return _0x34a0a4[_0x45600e(0x1f2)];return undefined;}function cleanupLegacyEnvFile(_0x59514a){const _0x3f0cb7=a42_0xb962;if(!existsSync(_0x59514a))return![];try{const _0x405908=readFileSync(_0x59514a,'utf-8'),_0x17c12c=_0x405908['split']('\x0a'),_0x5a2aee=_0x17c12c[_0x3f0cb7(0x1af)](_0xcd3834=>{const _0x3c4a94=_0x3f0cb7,_0x3f3d09=_0xcd3834[_0x3c4a94(0x1ee)]();if(!_0x3f3d09||_0x3f3d09[_0x3c4a94(0x1e9)]('#'))return!![];const [_0x3d3d10]=_0x3f3d09[_0x3c4a94(0x1cc)]('=');return!_0x3d3d10['startsWith'](_0x3c4a94(0x1f2));}),_0x64c2a8=_0x5a2aee[_0x3f0cb7(0x1ab)](_0x4987d9=>{const _0x3e83ee=_0x3f0cb7,_0x2eb09f=_0x4987d9[_0x3e83ee(0x1ee)]();return _0x2eb09f&&!_0x2eb09f[_0x3e83ee(0x1e9)]('#');});if(!_0x64c2a8)return unlinkSync(_0x59514a),!![];return writeFileSync(_0x59514a,_0x5a2aee[_0x3f0cb7(0x1dc)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x1e4735){const _0x152127=a42_0xb962,_0x232f6c=a42_0x2a2137['join'](getConfigDir(),'.env.'+_0x1e4735);if(a42_0x5a132c[_0x152127(0x1cd)](_0x232f6c)){validateSecureFilePermissions(_0x232f6c);try{const _0x4e2a15=a42_0x5a132c['readFileSync'](_0x232f6c,'utf-8');return parseEnvFile(_0x4e2a15);}catch(_0x22c453){console[_0x152127(0x1b5)](_0x152127(0x1c2)+_0x232f6c+':\x20'+_0x22c453);}}const _0x15fa6b=a42_0x2a2137[_0x152127(0x1dc)](getConfigDir(),_0x152127(0x1b6),_0x1e4735,_0x152127(0x1be));if(a42_0x5a132c[_0x152127(0x1cd)](_0x15fa6b)){validateSecureFilePermissions(_0x15fa6b);try{const _0x29e275=a42_0x5a132c[_0x152127(0x1b2)](_0x15fa6b,_0x152127(0x1c3));return parseEnvFile(_0x29e275);}catch(_0x41b1ac){return console[_0x152127(0x1b5)](_0x152127(0x1c2)+_0x15fa6b+':\x20'+_0x41b1ac),null;}}return null;}function getActiveProfileName(){const _0x7e1199=a42_0xb962,_0x38cc3d=a42_0x2a2137[_0x7e1199(0x1dc)](getConfigDir(),_0x7e1199(0x1cb));if(!a42_0x5a132c[_0x7e1199(0x1cd)](_0x38cc3d))return null;try{const _0x50cc26=a42_0x5a132c['readFileSync'](_0x38cc3d,_0x7e1199(0x1c3)),_0x2bbc3b=JSON['parse'](_0x50cc26);return _0x2bbc3b[_0x7e1199(0x1ca)]||null;}catch{return null;}}export function saveAPIKey(_0x420217,_0xb223c,_0x1f73e8){const _0xd55280=a42_0xb962,_0x15a4e8=getConfigDir(),_0x54cb05=getConfigFilePath(_0x1f73e8);!existsSync(_0x15a4e8)&&mkdirSync(_0x15a4e8,{'recursive':!![],'mode':0x1c0});let _0x24854b={};if(existsSync(_0x54cb05))try{const _0x31230b=readFileSync(_0x54cb05,_0xd55280(0x1c3));_0x24854b=parseEnvFile(_0x31230b);}catch(_0x339ebe){console[_0xd55280(0x1b5)](_0xd55280(0x1d6)+_0x54cb05+':',_0x339ebe);}const _0x3508ae=_0x420217['toUpperCase']()[_0xd55280(0x1c5)](/-/g,'_');_0x24854b['TD_API_KEY_'+_0x3508ae]=_0xb223c;const _0x4331a=Object[_0xd55280(0x1e7)](_0x24854b)[_0xd55280(0x1cf)](([_0x455e1d,_0x3653d5])=>_0x455e1d+'='+_0x3653d5);writeFileSync(_0x54cb05,_0x4331a[_0xd55280(0x1dc)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x55360e,_0x50a1de,_0x389c19){const _0x2bad61=a42_0xb962;await saveKeychainAPIKey(_0x55360e,_0x389c19),setCachedCredential(_0x55360e,_0x50a1de,_0x389c19);const _0x1416d1=getConfigFilePath(_0x389c19);cleanupLegacyEnvFile(_0x1416d1)&&console[_0x2bad61(0x1b5)](a42_0x36fb2b[_0x2bad61(0x1ba)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x114b58=a42_0xb962,_0x4dc9d4={'apiKeys':{},'defaultSite':_0x114b58(0x1b3)},_0x388941=[_0x114b58(0x1b3),_0x114b58(0x1b4),_0x114b58(0x1b0),_0x114b58(0x1c6),'ap03','dev-us01','dev-eu01','stg-us01',_0x114b58(0x1b7),_0x114b58(0x1d0)];for(const _0x590b0a of _0x388941){const _0x13b49a=getAPIKey(_0x590b0a);_0x13b49a&&(_0x4dc9d4[_0x114b58(0x1bc)][_0x590b0a]=_0x13b49a);}return _0x4dc9d4;}
1
+ (function(_0x4ae646,_0x107b4e){const _0x3957d6=a42_0x1ce2,_0x205e7e=_0x4ae646();while(!![]){try{const _0x3d347e=parseInt(_0x3957d6(0x1ad))/0x1+parseInt(_0x3957d6(0x1e4))/0x2*(parseInt(_0x3957d6(0x1b5))/0x3)+-parseInt(_0x3957d6(0x1e2))/0x4*(-parseInt(_0x3957d6(0x1c5))/0x5)+parseInt(_0x3957d6(0x1ce))/0x6+parseInt(_0x3957d6(0x1e3))/0x7+parseInt(_0x3957d6(0x1ba))/0x8+parseInt(_0x3957d6(0x1ea))/0x9*(-parseInt(_0x3957d6(0x1e9))/0xa);if(_0x3d347e===_0x107b4e)break;else _0x205e7e['push'](_0x205e7e['shift']());}catch(_0x1735a7){_0x205e7e['push'](_0x205e7e['shift']());}}}(a42_0x2930,0xe5906));import{homedir}from'os';import{join}from'path';function a42_0x2930(){const _0x1889b1=['readFileSync','dev-us01','.cache','stg-us01','6012072VQqnwz','account_info.json','utf-8','existsSync','jp01','llm_default_project.','warn','accountId','join','tdx','profile','apiKey','stg-ap03','keychain','TD_API_KEY_','ap02','yellow','.config','entries','legacy\x20.env\x20file','8hZAKXU','1244768TdTwkI','4XXvClM','account_info.','TDX_API_KEY_','replace','.json','3499210MkKDrD','54pJFKJo','TDX_CONFIG_DIR','projectId','includes','.env','match','source','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','ap03','trim','split','map','slice','profiles','stg-jp01','TD_API_KEY','parse','217866tnMYvo','Warning:\x20Failed\x20to\x20read\x20','dev-eu01','apiKeys','TDX_API_KEY\x20env\x20var','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','.env.','stringify','2213238tBoJIK','TDX_CACHE_DIR','isDeprecated','keychain\x20(profile:\x20','env','358224dOtdWU','site','startsWith','\x20env\x20var','toUpperCase','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','llm_default_project','name','some','toISOString','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','304620lOjPCT','string','us01','endsWith','TDX_API_KEY'];a42_0x2930=function(){return _0x1889b1;};return a42_0x2930();}import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';function a42_0x1ce2(_0x37e289,_0x39cb49){_0x37e289=_0x37e289-0x19f;const _0x293005=a42_0x2930();let _0x1ce2b1=_0x293005[_0x37e289];return _0x1ce2b1;}import*as a42_0x51f76e from'node:fs';import*as a42_0x486212 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a42_0x298a71 from'chalk';export function getConfigDir(){const _0x570068=a42_0x1ce2;return process['env'][_0x570068(0x1eb)]||join(homedir(),_0x570068(0x1df),_0x570068(0x1d7));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x21d298){const _0x15abf8=a42_0x1ce2,_0x3947f3=getConfigDir();return _0x21d298?a42_0x486212[_0x15abf8(0x1d6)](_0x3947f3,_0x15abf8(0x1b3)+_0x21d298):getConfigFile();}export function getCacheDir(){const _0x3bdceb=a42_0x1ce2;return process['env'][_0x3bdceb(0x1b6)]||join(homedir(),_0x3bdceb(0x1cc),'tdx');}export function getLLMProjectCacheFile(_0x28fbd1){const _0x14b40b=a42_0x1ce2,_0x187d86=_0x28fbd1?_0x14b40b(0x1d3)+_0x28fbd1:_0x14b40b(0x1c0);return join(getCacheDir(),_0x187d86);}export function readCachedLLMProject(_0x49f7c5){const _0xd2847b=a42_0x1ce2;try{const _0x46b6ef=getLLMProjectCacheFile(_0x49f7c5);if(!existsSync(_0x46b6ef))return null;const _0x20c65c=readFileSync(_0x46b6ef,_0xd2847b(0x1d0))[_0xd2847b(0x1a5)]();try{const _0x42139f=JSON[_0xd2847b(0x1ac)](_0x20c65c);if(_0x42139f&&typeof _0x42139f['id']===_0xd2847b(0x1c6)&&typeof _0x42139f[_0xd2847b(0x1c1)]===_0xd2847b(0x1c6))return _0x42139f;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x22ef33,_0x4e2c3d,_0x54b5a1){const _0x362db5=a42_0x1ce2;try{const _0x9ff7ff=getCacheDir(),_0x48bde0=getLLMProjectCacheFile(_0x54b5a1);!existsSync(_0x9ff7ff)&&mkdirSync(_0x9ff7ff,{'recursive':!![]});const _0x654d3d={'name':_0x22ef33,'id':_0x4e2c3d};writeFileSync(_0x48bde0,JSON['stringify'](_0x654d3d),_0x362db5(0x1d0));}catch{}}export function getLLMAgentCacheFile(_0x2b6ccd){const _0x241093=_0x2b6ccd?'llm_default_agent.'+_0x2b6ccd:'llm_default_agent';return join(getCacheDir(),_0x241093);}export function readCachedLLMAgent(_0x488060){const _0x590589=a42_0x1ce2;try{const _0x2d0a82=getLLMAgentCacheFile(_0x488060);if(!existsSync(_0x2d0a82))return null;const _0x1dd60e=readFileSync(_0x2d0a82,_0x590589(0x1d0))[_0x590589(0x1a5)]();try{const _0x44bbb3=JSON[_0x590589(0x1ac)](_0x1dd60e);if(_0x44bbb3&&typeof _0x44bbb3['id']===_0x590589(0x1c6)&&typeof _0x44bbb3[_0x590589(0x1c1)]===_0x590589(0x1c6)&&typeof _0x44bbb3[_0x590589(0x1ec)]===_0x590589(0x1c6))return _0x44bbb3;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x15bbb4,_0x22c9ff,_0x24857f,_0x50e7e4){const _0xc8214f=a42_0x1ce2;try{const _0x6649cc=getCacheDir(),_0x29a34b=getLLMAgentCacheFile(_0x50e7e4);!existsSync(_0x6649cc)&&mkdirSync(_0x6649cc,{'recursive':!![]});const _0x23986b={'name':_0x15bbb4,'id':_0x22c9ff,'projectId':_0x24857f};writeFileSync(_0x29a34b,JSON[_0xc8214f(0x1b4)](_0x23986b),_0xc8214f(0x1d0));}catch{}}export function clearCachedLLMAgent(_0xfd7339){try{const _0x136495=getLLMAgentCacheFile(_0xfd7339);existsSync(_0x136495)&&unlinkSync(_0x136495);}catch{}}export function getAccountInfoCacheFile(_0xbc6671){const _0x34dbd6=a42_0x1ce2,_0x98a37b=_0xbc6671?_0x34dbd6(0x1e5)+_0xbc6671+_0x34dbd6(0x1e8):_0x34dbd6(0x1cf);return join(getCacheDir(),_0x98a37b);}export function readCachedAccountInfo(_0x451b84){const _0x1fdddd=a42_0x1ce2;try{const _0x49203b=getAccountInfoCacheFile(_0x451b84);if(!existsSync(_0x49203b))return null;const _0x54cc2f=readFileSync(_0x49203b,'utf-8')[_0x1fdddd(0x1a5)](),_0x45641c=JSON[_0x1fdddd(0x1ac)](_0x54cc2f);if(_0x45641c&&typeof _0x45641c[_0x1fdddd(0x1bb)]===_0x1fdddd(0x1c6)&&typeof _0x45641c[_0x1fdddd(0x1d5)]==='number')return _0x45641c;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x3cb397,_0x52e5c7,_0x1923d1){const _0x3b1b3d=a42_0x1ce2;try{const _0x44304e=getCacheDir(),_0x1eca64=getAccountInfoCacheFile(_0x1923d1);!existsSync(_0x44304e)&&mkdirSync(_0x44304e,{'recursive':!![]});const _0xba2be3={'site':_0x3cb397,'accountId':_0x52e5c7,'cachedAt':new Date()[_0x3b1b3d(0x1c3)]()};writeFileSync(_0x1eca64,JSON[_0x3b1b3d(0x1b4)](_0xba2be3),_0x3b1b3d(0x1d0));}catch{}}export function parseEnvFile(_0x13bca1){const _0x30d532=a42_0x1ce2,_0x48c269={};for(const _0x54b523 of _0x13bca1[_0x30d532(0x1a6)]('\x0a')){const _0x916ca9=_0x54b523[_0x30d532(0x1a5)]();if(!_0x916ca9||_0x916ca9['startsWith']('#'))continue;const _0x42b171=_0x916ca9[_0x30d532(0x1a1)](/^([^=]+)=(.*)$/);if(_0x42b171){const _0x3ad04b=_0x42b171[0x1][_0x30d532(0x1a5)]();let _0x3c31aa=_0x42b171[0x2][_0x30d532(0x1a5)]();(_0x3c31aa[_0x30d532(0x1bc)]('\x22')&&_0x3c31aa['endsWith']('\x22')||_0x3c31aa[_0x30d532(0x1bc)]('\x27')&&_0x3c31aa[_0x30d532(0x1c8)]('\x27'))&&(_0x3c31aa=_0x3c31aa[_0x30d532(0x1a8)](0x1,-0x1)),_0x48c269[_0x3ad04b]=_0x3c31aa;}}return _0x48c269;}export function readUserConfig(){const _0x2159a1=a42_0x1ce2,_0x560273=getConfigFile();if(!existsSync(_0x560273))return{};try{const _0x2ee94e=readFileSync(_0x560273,_0x2159a1(0x1d0));return parseEnvFile(_0x2ee94e);}catch(_0x23505f){return console[_0x2159a1(0x1d4)](_0x2159a1(0x1bf)+_0x560273+':',_0x23505f),{};}}export function resolveSite(_0x3822b1){const _0x504bb1=a42_0x1ce2,_0x451260=[_0x504bb1(0x1c7),_0x504bb1(0x1d2),'eu01',_0x504bb1(0x1dd),'ap03',_0x504bb1(0x1cb),_0x504bb1(0x1af),_0x504bb1(0x1cd),_0x504bb1(0x1aa),'stg-ap03'];if(_0x451260[_0x504bb1(0x19f)](_0x3822b1))return _0x3822b1;if(_0x3822b1 in SITE_ALIASES)return SITE_ALIASES[_0x3822b1];return console[_0x504bb1(0x1d4)]('Warning:\x20Unknown\x20site\x20\x27'+_0x3822b1+'\x27,\x20defaulting\x20to\x20us01'),_0x504bb1(0x1c7);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x2fba35,_0x313627){const _0x1ba8f0=a42_0x1ce2,_0x3e325a=_0x313627||getActiveProfileName();if(_0x3e325a){const _0x49d9ec=_0x1ba8f0(0x1e6)+normalizeProfileForEnvVar(_0x3e325a);if(process['env'][_0x49d9ec])return process[_0x1ba8f0(0x1b9)][_0x49d9ec];}if(process[_0x1ba8f0(0x1b9)][_0x1ba8f0(0x1c9)])return process['env'][_0x1ba8f0(0x1c9)];if(process[_0x1ba8f0(0x1b9)][_0x1ba8f0(0x1ab)])return process['env'][_0x1ba8f0(0x1ab)];const _0x56f520=_0x2fba35['toUpperCase']()[_0x1ba8f0(0x1e7)](/-/g,'_'),_0x564624='TD_API_KEY_'+_0x56f520;if(_0x3e325a){const _0x27d47a=loadProfileEnv(_0x3e325a);if(_0x27d47a){if(_0x27d47a[_0x564624])return _0x27d47a[_0x564624];if(_0x27d47a[_0x1ba8f0(0x1ab)])return _0x27d47a[_0x1ba8f0(0x1ab)];}}const _0x2d1e9a=loadUserConfigOnce();if(_0x2d1e9a[_0x564624])return _0x2d1e9a[_0x564624];if(_0x2d1e9a[_0x1ba8f0(0x1ab)])return _0x2d1e9a['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x17e481){const _0x28fc01=a42_0x1ce2;return _0x17e481['toUpperCase']()[_0x28fc01(0x1e7)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x5a02fb,_0x1d1ceb){const _0x515d33=a42_0x1ce2,_0x3dcc93=_0x1d1ceb||getActiveProfileName()||undefined;if(_0x3dcc93){const _0x1d48f3='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x3dcc93);if(process[_0x515d33(0x1b9)][_0x1d48f3])return{'apiKey':process[_0x515d33(0x1b9)][_0x1d48f3],'source':_0x1d48f3+_0x515d33(0x1bd),'isDeprecated':![]};const _0x2b9fa5=getCachedCredential(_0x5a02fb,_0x3dcc93);if(_0x2b9fa5)return{'apiKey':_0x2b9fa5,'source':_0x515d33(0x1b8)+_0x3dcc93+')','isDeprecated':![]};const _0x165908=await getKeychainAPIKey(_0x3dcc93);if(_0x165908)return setCachedCredential(_0x165908,_0x5a02fb,_0x3dcc93),{'apiKey':_0x165908,'source':_0x515d33(0x1b8)+_0x3dcc93+')','isDeprecated':![]};}if(process[_0x515d33(0x1b9)]['TDX_API_KEY'])return{'apiKey':process[_0x515d33(0x1b9)][_0x515d33(0x1c9)],'source':_0x515d33(0x1b1),'isDeprecated':![]};if(!_0x3dcc93){const _0x495b00=getCachedCredential(_0x5a02fb,undefined);if(_0x495b00)return{'apiKey':_0x495b00,'source':_0x515d33(0x1db),'isDeprecated':![]};const _0x301850=await getKeychainAPIKey(undefined);if(_0x301850)return setCachedCredential(_0x301850,_0x5a02fb,undefined),{'apiKey':_0x301850,'source':_0x515d33(0x1db),'isDeprecated':![]};}if(process[_0x515d33(0x1b9)][_0x515d33(0x1ab)])return{'apiKey':process[_0x515d33(0x1b9)][_0x515d33(0x1ab)],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x172aa3=getLegacyEnvAPIKey(_0x5a02fb,_0x3dcc93);if(_0x172aa3){const _0xdbc911=await isKeychainAvailable();if(_0xdbc911)try{await saveKeychainAPIKey(_0x172aa3,_0x3dcc93),setCachedCredential(_0x172aa3,_0x5a02fb,_0x3dcc93);const _0x4e9ee8=getConfigFilePath(_0x3dcc93);cleanupLegacyEnvFile(_0x4e9ee8)&&console[_0x515d33(0x1d4)](a42_0x298a71[_0x515d33(0x1de)](_0x515d33(0x1b2)));}catch(_0x37acd1){console[_0x515d33(0x1d4)](a42_0x298a71['yellow']('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x37acd1));}const _0x1f508e=_0x3dcc93?'legacy\x20.env\x20file\x20(profile:\x20'+_0x3dcc93+')':_0x515d33(0x1e1);return{'apiKey':_0x172aa3,'source':_0x1f508e,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x331768,_0x13a2f1,_0x3ddcc4=!![]){const _0x3b6094=a42_0x1ce2,_0x5c6f4d=await resolveAPIKeyAsync(_0x331768,_0x13a2f1);if(!_0x5c6f4d)return undefined;if(_0x3ddcc4&&_0x5c6f4d[_0x3b6094(0x1b7)]&&_0x5c6f4d[_0x3b6094(0x1a2)][_0x3b6094(0x19f)]('TD_API_KEY')){const _0x5b3ea7=_0x13a2f1||getActiveProfileName()||undefined,_0x4b60ed=_0x5b3ea7?_0x3b6094(0x1e6)+normalizeProfileForEnvVar(_0x5b3ea7):'TDX_API_KEY_<PROFILE>';console['warn'](a42_0x298a71[_0x3b6094(0x1de)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x3b6094(0x1c4)+_0x4b60ed+').')));}return _0x5c6f4d[_0x3b6094(0x1d9)];}function getLegacyEnvAPIKey(_0x17dd9d,_0x13cae3){const _0x489e6b=a42_0x1ce2,_0x123a96=_0x17dd9d[_0x489e6b(0x1be)]()[_0x489e6b(0x1e7)](/-/g,'_'),_0xfdbeec=_0x489e6b(0x1dc)+_0x123a96;if(_0x13cae3){const _0x22b558=loadProfileEnv(_0x13cae3);if(_0x22b558){if(_0x22b558[_0xfdbeec])return _0x22b558[_0xfdbeec];if(_0x22b558[_0x489e6b(0x1ab)])return _0x22b558[_0x489e6b(0x1ab)];}}const _0x25eff6=loadUserConfigOnce();if(_0x25eff6[_0xfdbeec])return _0x25eff6[_0xfdbeec];if(_0x25eff6[_0x489e6b(0x1ab)])return _0x25eff6[_0x489e6b(0x1ab)];return undefined;}function cleanupLegacyEnvFile(_0x3a83c1){const _0x80a6e0=a42_0x1ce2;if(!existsSync(_0x3a83c1))return![];try{const _0x19693d=readFileSync(_0x3a83c1,_0x80a6e0(0x1d0)),_0x37d3ae=_0x19693d['split']('\x0a'),_0x27dbea=_0x37d3ae['filter'](_0x55dc13=>{const _0x48a6dd=_0x80a6e0,_0x428e57=_0x55dc13[_0x48a6dd(0x1a5)]();if(!_0x428e57||_0x428e57[_0x48a6dd(0x1bc)]('#'))return!![];const [_0x44d863]=_0x428e57[_0x48a6dd(0x1a6)]('=');return!_0x44d863[_0x48a6dd(0x1bc)](_0x48a6dd(0x1ab));}),_0x43d754=_0x27dbea[_0x80a6e0(0x1c2)](_0xbc60c4=>{const _0x49b725=_0x80a6e0,_0x522264=_0xbc60c4[_0x49b725(0x1a5)]();return _0x522264&&!_0x522264[_0x49b725(0x1bc)]('#');});if(!_0x43d754)return unlinkSync(_0x3a83c1),!![];return writeFileSync(_0x3a83c1,_0x27dbea[_0x80a6e0(0x1d6)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x228c27){const _0x530100=a42_0x1ce2,_0x426d48=a42_0x486212['join'](getConfigDir(),_0x530100(0x1b3)+_0x228c27);if(a42_0x51f76e[_0x530100(0x1d1)](_0x426d48)){validateSecureFilePermissions(_0x426d48);try{const _0x7be02f=a42_0x51f76e['readFileSync'](_0x426d48,_0x530100(0x1d0));return parseEnvFile(_0x7be02f);}catch(_0x48bc0d){console[_0x530100(0x1d4)]('Warning:\x20Failed\x20to\x20load\x20'+_0x426d48+':\x20'+_0x48bc0d);}}const _0x4d228e=a42_0x486212[_0x530100(0x1d6)](getConfigDir(),_0x530100(0x1a9),_0x228c27,_0x530100(0x1a0));if(a42_0x51f76e[_0x530100(0x1d1)](_0x4d228e)){validateSecureFilePermissions(_0x4d228e);try{const _0x2d7d3f=a42_0x51f76e[_0x530100(0x1ca)](_0x4d228e,_0x530100(0x1d0));return parseEnvFile(_0x2d7d3f);}catch(_0x31b96d){return console['warn']('Warning:\x20Failed\x20to\x20load\x20'+_0x4d228e+':\x20'+_0x31b96d),null;}}return null;}function getActiveProfileName(){const _0x369252=a42_0x1ce2,_0x2234d3=a42_0x486212[_0x369252(0x1d6)](getConfigDir(),'tdx.json');if(!a42_0x51f76e['existsSync'](_0x2234d3))return null;try{const _0x1848c3=a42_0x51f76e['readFileSync'](_0x2234d3,_0x369252(0x1d0)),_0x1b40b1=JSON[_0x369252(0x1ac)](_0x1848c3);return _0x1b40b1[_0x369252(0x1d8)]||null;}catch{return null;}}export function saveAPIKey(_0x10db7f,_0x533863,_0x349a25){const _0x142176=a42_0x1ce2,_0x262af9=getConfigDir(),_0x20be78=getConfigFilePath(_0x349a25);!existsSync(_0x262af9)&&mkdirSync(_0x262af9,{'recursive':!![],'mode':0x1c0});let _0x10250e={};if(existsSync(_0x20be78))try{const _0x45e985=readFileSync(_0x20be78,_0x142176(0x1d0));_0x10250e=parseEnvFile(_0x45e985);}catch(_0x469cc0){console[_0x142176(0x1d4)](_0x142176(0x1ae)+_0x20be78+':',_0x469cc0);}const _0x5576b4=_0x10db7f[_0x142176(0x1be)]()[_0x142176(0x1e7)](/-/g,'_');_0x10250e[_0x142176(0x1dc)+_0x5576b4]=_0x533863;const _0x18ef36=Object[_0x142176(0x1e0)](_0x10250e)[_0x142176(0x1a7)](([_0x264b37,_0x22134c])=>_0x264b37+'='+_0x22134c);writeFileSync(_0x20be78,_0x18ef36[_0x142176(0x1d6)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x36f14f,_0x4fc305,_0x2e6165){const _0x2b4e41=a42_0x1ce2;await saveKeychainAPIKey(_0x36f14f,_0x2e6165),setCachedCredential(_0x36f14f,_0x4fc305,_0x2e6165);const _0x49bb3d=getConfigFilePath(_0x2e6165);cleanupLegacyEnvFile(_0x49bb3d)&&console[_0x2b4e41(0x1d4)](a42_0x298a71['yellow'](_0x2b4e41(0x1a3)));}export function loadConfig(){const _0x31c588=a42_0x1ce2,_0x399f1b={'apiKeys':{},'defaultSite':_0x31c588(0x1c7)},_0x2bb74d=[_0x31c588(0x1c7),_0x31c588(0x1d2),'eu01',_0x31c588(0x1dd),_0x31c588(0x1a4),_0x31c588(0x1cb),_0x31c588(0x1af),_0x31c588(0x1cd),_0x31c588(0x1aa),_0x31c588(0x1da)];for(const _0x4494e0 of _0x2bb74d){const _0x54a7e0=getAPIKey(_0x4494e0);_0x54a7e0&&(_0x399f1b[_0x31c588(0x1b0)][_0x4494e0]=_0x54a7e0);}return _0x399f1b;}
@@ -1 +1 @@
1
- function a43_0x42d9(_0x4230a5,_0x3f1369){_0x4230a5=_0x4230a5-0xe0;const _0x15276=a43_0x1527();let _0x42d9e8=_0x15276[_0x4230a5];return _0x42d9e8;}(function(_0x470bb9,_0x13e500){const _0x1bd93f=a43_0x42d9,_0x31a822=_0x470bb9();while(!![]){try{const _0x214568=-parseInt(_0x1bd93f(0xed))/0x1*(-parseInt(_0x1bd93f(0xe9))/0x2)+parseInt(_0x1bd93f(0xe8))/0x3+parseInt(_0x1bd93f(0xe4))/0x4+-parseInt(_0x1bd93f(0xea))/0x5*(-parseInt(_0x1bd93f(0xe5))/0x6)+-parseInt(_0x1bd93f(0xe6))/0x7*(parseInt(_0x1bd93f(0xee))/0x8)+parseInt(_0x1bd93f(0xe3))/0x9+-parseInt(_0x1bd93f(0xe1))/0xa;if(_0x214568===_0x13e500)break;else _0x31a822['push'](_0x31a822['shift']());}catch(_0x3450e3){_0x31a822['push'](_0x31a822['shift']());}}}(a43_0x1527,0x3bb8f));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';function a43_0x1527(){const _0x5881e7=['connections','default','14599390JAJItA','connections-','1903428JnKfeE','1838624AbPDDM','14418UbyuMd','462007LADNWI','parse','1307697dFszBS','282tvKNWh','445FRvNpR','stringify','utf-8','3189pgFVDW','8tRAumb','.json','now'];a43_0x1527=function(){return _0x5881e7;};return a43_0x1527();}import{getCacheDir}from'./config.js';function getCacheFilePath(_0x5d1c3e){const _0x27cc2f=a43_0x42d9,_0x3a6276=_0x5d1c3e||_0x27cc2f(0xe0);return join(getCacheDir(),_0x27cc2f(0xe2)+_0x3a6276+_0x27cc2f(0xef));}export function loadCachedConnections(_0x195f51){const _0x262a12=a43_0x42d9,_0x5a48e8=getCacheFilePath(_0x195f51);if(!existsSync(_0x5a48e8))return null;try{const _0x373ecd=readFileSync(_0x5a48e8,_0x262a12(0xec)),_0x44975b=JSON[_0x262a12(0xe7)](_0x373ecd);return _0x44975b[_0x262a12(0xf1)];}catch{return null;}}export function saveCachedConnections(_0x3b6548,_0x5d4a61){const _0x231c84=a43_0x42d9,_0x520e41=getCacheDir();!existsSync(_0x520e41)&&mkdirSync(_0x520e41,{'recursive':!![]});const _0x104e0d=getCacheFilePath(_0x3b6548),_0x217adb={'connections':_0x5d4a61,'cachedAt':Date[_0x231c84(0xf0)]()};writeFileSync(_0x104e0d,JSON[_0x231c84(0xeb)](_0x217adb,null,0x2),_0x231c84(0xec));}export function clearConnectionCache(_0x44736d){const _0x27ad6b=getCacheFilePath(_0x44736d);if(existsSync(_0x27ad6b))try{unlinkSync(_0x27ad6b);}catch{}}
1
+ (function(_0x451185,_0x85b74c){const _0x23249b=a43_0x2ee7,_0xe91eac=_0x451185();while(!![]){try{const _0x2171dc=parseInt(_0x23249b(0x1a2))/0x1*(-parseInt(_0x23249b(0x1a5))/0x2)+-parseInt(_0x23249b(0x19f))/0x3+-parseInt(_0x23249b(0x199))/0x4+parseInt(_0x23249b(0x1a4))/0x5*(parseInt(_0x23249b(0x19b))/0x6)+parseInt(_0x23249b(0x1a1))/0x7+parseInt(_0x23249b(0x19c))/0x8+parseInt(_0x23249b(0x19e))/0x9*(parseInt(_0x23249b(0x1a7))/0xa);if(_0x2171dc===_0x85b74c)break;else _0xe91eac['push'](_0xe91eac['shift']());}catch(_0x379f5e){_0xe91eac['push'](_0xe91eac['shift']());}}}(a43_0x1384,0xac876));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function a43_0x1384(){const _0x1ba735=['5277804oAhAyK','parse','1311912vGdPwH','2136016fiSNnT','stringify','144rOBbYt','3590358rziLHa','utf-8','7898674pfgAHV','209tDOFTa','connections','5vlxSNH','6178jgikXX','connections-','1409050gNTAFO','now'];a43_0x1384=function(){return _0x1ba735;};return a43_0x1384();}function getCacheFilePath(_0x2ab710){const _0x3cc657=a43_0x2ee7,_0x4f0196=_0x2ab710||'default';return join(getCacheDir(),_0x3cc657(0x1a6)+_0x4f0196+'.json');}export function loadCachedConnections(_0x1924e7){const _0x57e4c5=a43_0x2ee7,_0x277c11=getCacheFilePath(_0x1924e7);if(!existsSync(_0x277c11))return null;try{const _0x49e316=readFileSync(_0x277c11,'utf-8'),_0x482144=JSON[_0x57e4c5(0x19a)](_0x49e316);return _0x482144[_0x57e4c5(0x1a3)];}catch{return null;}}export function saveCachedConnections(_0x5820bb,_0x3b03c3){const _0x2a2bf1=a43_0x2ee7,_0x5cb6d3=getCacheDir();!existsSync(_0x5cb6d3)&&mkdirSync(_0x5cb6d3,{'recursive':!![]});const _0x55bd95=getCacheFilePath(_0x5820bb),_0x292092={'connections':_0x3b03c3,'cachedAt':Date[_0x2a2bf1(0x1a8)]()};writeFileSync(_0x55bd95,JSON[_0x2a2bf1(0x19d)](_0x292092,null,0x2),_0x2a2bf1(0x1a0));}function a43_0x2ee7(_0x501179,_0x54a082){_0x501179=_0x501179-0x199;const _0x138449=a43_0x1384();let _0x2ee7e2=_0x138449[_0x501179];return _0x2ee7e2;}export function clearConnectionCache(_0x27222e){const _0x85ce62=getCacheFilePath(_0x27222e);if(existsSync(_0x85ce62))try{unlinkSync(_0x85ce62);}catch{}}
@@ -1 +1 @@
1
- function a44_0x20cb(){const _0x299e9d=['76535gdZWlT','number','39780dCqUOp','57NFLdPd','138KJjPIH','991136oyTYXL','350570ArwmwU','750376JExaFa','8477739WoNqqT','613494tJFMyI'];a44_0x20cb=function(){return _0x299e9d;};return a44_0x20cb();}(function(_0x2f8f26,_0x53697a){const _0x1da167=a44_0x4c42,_0x7bf4e8=_0x2f8f26();while(!![]){try{const _0xfc99e1=-parseInt(_0x1da167(0xb4))/0x1+-parseInt(_0x1da167(0xb0))/0x2*(parseInt(_0x1da167(0xb1))/0x3)+-parseInt(_0x1da167(0xb3))/0x4+-parseInt(_0x1da167(0xae))/0x5*(-parseInt(_0x1da167(0xb2))/0x6)+parseInt(_0x1da167(0xad))/0x7+-parseInt(_0x1da167(0xb5))/0x8+parseInt(_0x1da167(0xac))/0x9;if(_0xfc99e1===_0x53697a)break;else _0x7bf4e8['push'](_0x7bf4e8['shift']());}catch(_0x11234c){_0x7bf4e8['push'](_0x7bf4e8['shift']());}}}(a44_0x20cb,0x4c13d));function a44_0x4c42(_0x410d4d,_0x5e9f24){_0x410d4d=_0x410d4d-0xac;const _0x20cbdf=a44_0x20cb();let _0x4c42e1=_0x20cbdf[_0x410d4d];return _0x4c42e1;}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0xc75e05,_0x8a81d4){const _0x2559e0=a44_0x4c42;if(_0xc75e05===undefined)return _0x8a81d4;if(typeof _0xc75e05===_0x2559e0(0xaf))return _0xc75e05;return parseInt(_0xc75e05,0xa);}
1
+ (function(_0x5ac1ea,_0x416943){const _0x362002=a44_0x392c,_0x1743ea=_0x5ac1ea();while(!![]){try{const _0x36ea2a=-parseInt(_0x362002(0x146))/0x1+parseInt(_0x362002(0x148))/0x2+parseInt(_0x362002(0x143))/0x3*(-parseInt(_0x362002(0x145))/0x4)+parseInt(_0x362002(0x147))/0x5+-parseInt(_0x362002(0x14a))/0x6+-parseInt(_0x362002(0x14b))/0x7+parseInt(_0x362002(0x149))/0x8*(parseInt(_0x362002(0x144))/0x9);if(_0x36ea2a===_0x416943)break;else _0x1743ea['push'](_0x1743ea['shift']());}catch(_0x47675d){_0x1743ea['push'](_0x1743ea['shift']());}}}(a44_0x47d0,0x25c38));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a44_0x392c(_0x18b637,_0x550ed0){_0x18b637=_0x18b637-0x143;const _0x47d014=a44_0x47d0();let _0x392c7e=_0x47d014[_0x18b637];return _0x392c7e;}export function resolveLimit(_0x1f391d,_0x2d6458){if(_0x1f391d===undefined)return _0x2d6458;if(typeof _0x1f391d==='number')return _0x1f391d;return parseInt(_0x1f391d,0xa);}function a44_0x47d0(){const _0x37d401=['371572DmFVaV','270217bvRpUg','728130gXWnYF','109092ajElNX','408RDlhKy','1508838eoSAUy','604884ZJZNmA','3FKGZcQ','115677uPZYjc'];a44_0x47d0=function(){return _0x37d401;};return a44_0x47d0();}
@@ -1 +1 @@
1
- (function(_0x3769fa,_0x2250e1){const _0x47ec7c=a45_0x48ef,_0x4185a6=_0x3769fa();while(!![]){try{const _0x200853=-parseInt(_0x47ec7c(0xb4))/0x1*(parseInt(_0x47ec7c(0xb2))/0x2)+-parseInt(_0x47ec7c(0xa6))/0x3*(-parseInt(_0x47ec7c(0xa9))/0x4)+-parseInt(_0x47ec7c(0xb7))/0x5+-parseInt(_0x47ec7c(0xad))/0x6*(-parseInt(_0x47ec7c(0xb8))/0x7)+-parseInt(_0x47ec7c(0xaa))/0x8*(-parseInt(_0x47ec7c(0xa7))/0x9)+-parseInt(_0x47ec7c(0xac))/0xa*(-parseInt(_0x47ec7c(0xb5))/0xb)+-parseInt(_0x47ec7c(0xab))/0xc;if(_0x200853===_0x2250e1)break;else _0x4185a6['push'](_0x4185a6['shift']());}catch(_0x4939c0){_0x4185a6['push'](_0x4185a6['shift']());}}}(a45_0x4bf5,0x196eb));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a45_0x4bf5(){const _0x3b2882=['115208cJBQZS','2053968fmsCmD','3710JfEXNF','6wfbdFj','loadedAt','clear','get','now','7124pNymzM','set','17IyjUav','2277mdeVPR','delete','201635NkQzLC','654514qpfDWJ','apiKey','19863vmGcor','108rvwqkJ','__default_profile__','20MjASGW'];a45_0x4bf5=function(){return _0x3b2882;};return a45_0x4bf5();}function getCacheKey(_0x24aed1,_0x9fa14f){const _0x49b342=a45_0x48ef,_0x176e69=_0x24aed1||'__default_site__',_0x3c98e4=_0x9fa14f||_0x49b342(0xa8);return _0x176e69+':'+_0x3c98e4;}export function getCachedCredential(_0x10a52e,_0x3557d3){const _0x273cd3=a45_0x48ef,_0xb5fc2c=getCacheKey(_0x10a52e,_0x3557d3),_0x12a430=cache[_0x273cd3(0xb0)](_0xb5fc2c);if(!_0x12a430)return null;if(Date['now']()-_0x12a430[_0x273cd3(0xae)]>CACHE_TTL_MS)return cache['delete'](_0xb5fc2c),null;return _0x12a430[_0x273cd3(0xa5)];}function a45_0x48ef(_0x35bd86,_0x7678e5){_0x35bd86=_0x35bd86-0xa5;const _0x4bf5ba=a45_0x4bf5();let _0x48ef71=_0x4bf5ba[_0x35bd86];return _0x48ef71;}export function setCachedCredential(_0x6c9f83,_0x56ac83,_0x10d860){const _0xeeee5f=a45_0x48ef,_0x4b14ba=getCacheKey(_0x56ac83,_0x10d860);cache[_0xeeee5f(0xb3)](_0x4b14ba,{'apiKey':_0x6c9f83,'loadedAt':Date[_0xeeee5f(0xb1)]()});}export function clearCredentialCache(){const _0x277a6c=a45_0x48ef;cache[_0x277a6c(0xaf)]();}export function clearCachedCredential(_0x4b02dd,_0x1a8baa){const _0x14b814=a45_0x48ef,_0x416104=getCacheKey(_0x4b02dd,_0x1a8baa);cache[_0x14b814(0xb6)](_0x416104);}
1
+ (function(_0x2ccd04,_0x24b6c1){const _0x1b1b47=a45_0x12cd,_0x5e3ea2=_0x2ccd04();while(!![]){try{const _0x515af0=parseInt(_0x1b1b47(0x1a5))/0x1+-parseInt(_0x1b1b47(0x1a8))/0x2+-parseInt(_0x1b1b47(0x1a1))/0x3*(parseInt(_0x1b1b47(0x1a3))/0x4)+-parseInt(_0x1b1b47(0x1a7))/0x5*(parseInt(_0x1b1b47(0x1ae))/0x6)+-parseInt(_0x1b1b47(0x1a0))/0x7+parseInt(_0x1b1b47(0x19f))/0x8+parseInt(_0x1b1b47(0x1ac))/0x9;if(_0x515af0===_0x24b6c1)break;else _0x5e3ea2['push'](_0x5e3ea2['shift']());}catch(_0x408e3f){_0x5e3ea2['push'](_0x5e3ea2['shift']());}}}(a45_0x429c,0x971ab));function a45_0x429c(){const _0xd436b8=['1400168vYTowc','clear','delete','now','19070433uxmMtY','loadedAt','6sCvAfi','get','__default_profile__','1105144YRjvyj','3913280aRMJrJ','172167UGaFKc','__default_site__','4KVRXVU','set','816288zFVHUn','apiKey','5689660zIvhIM'];a45_0x429c=function(){return _0xd436b8;};return a45_0x429c();}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x10c0b0,_0x5d8e6a){const _0x20fd81=a45_0x12cd,_0x1f638b=_0x10c0b0||_0x20fd81(0x1a2),_0x47c33f=_0x5d8e6a||_0x20fd81(0x19e);return _0x1f638b+':'+_0x47c33f;}function a45_0x12cd(_0x3f25c1,_0x1c8dc5){_0x3f25c1=_0x3f25c1-0x19d;const _0x429c06=a45_0x429c();let _0x12cdb7=_0x429c06[_0x3f25c1];return _0x12cdb7;}export function getCachedCredential(_0x42e0b0,_0x46a99d){const _0x1f9622=a45_0x12cd,_0x350b2c=getCacheKey(_0x42e0b0,_0x46a99d),_0x146489=cache[_0x1f9622(0x19d)](_0x350b2c);if(!_0x146489)return null;if(Date['now']()-_0x146489[_0x1f9622(0x1ad)]>CACHE_TTL_MS)return cache[_0x1f9622(0x1aa)](_0x350b2c),null;return _0x146489[_0x1f9622(0x1a6)];}export function setCachedCredential(_0x5dcace,_0x3a866c,_0xd7842d){const _0x43392d=a45_0x12cd,_0x5df4fc=getCacheKey(_0x3a866c,_0xd7842d);cache[_0x43392d(0x1a4)](_0x5df4fc,{'apiKey':_0x5dcace,'loadedAt':Date[_0x43392d(0x1ab)]()});}export function clearCredentialCache(){const _0x5361f1=a45_0x12cd;cache[_0x5361f1(0x1a9)]();}export function clearCachedCredential(_0x3726e0,_0x3d592b){const _0x31c060=a45_0x12cd,_0x5a49f7=getCacheKey(_0x3726e0,_0x3d592b);cache[_0x31c060(0x1aa)](_0x5a49f7);}
@@ -1 +1 @@
1
- const a46_0x5c727a=a46_0x451d;(function(_0x271603,_0x35d075){const _0x59bf20=a46_0x451d,_0x39ad35=_0x271603();while(!![]){try{const _0x377b30=-parseInt(_0x59bf20(0x1f1))/0x1*(-parseInt(_0x59bf20(0x223))/0x2)+-parseInt(_0x59bf20(0x22c))/0x3+-parseInt(_0x59bf20(0x1eb))/0x4*(-parseInt(_0x59bf20(0x1fe))/0x5)+parseInt(_0x59bf20(0x211))/0x6+parseInt(_0x59bf20(0x1f8))/0x7*(parseInt(_0x59bf20(0x1f9))/0x8)+-parseInt(_0x59bf20(0x20a))/0x9*(parseInt(_0x59bf20(0x224))/0xa)+-parseInt(_0x59bf20(0x21d))/0xb;if(_0x377b30===_0x35d075)break;else _0x39ad35['push'](_0x39ad35['shift']());}catch(_0xf5fe3e){_0x39ad35['push'](_0x39ad35['shift']());}}}(a46_0x8366,0x4f0db));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a46_0x8366(){const _0x46a593=['9vWGldT','existsSync','llmAgent','workflowProject','createAsync','CLI\x20flag:\x20--','getParameters','1534086GMeeOc','assign','toString','getSource','llm_project','globalCredentials','global','configFiles','llmProject','Profile','display','(session:\x20','3870317JhGWWs','readFileSync','tdx.json','site','segment_path','env','2IEuUrY','1701190YvTkey','workflow_project','layers','utf-8','Profile\x20Credentials','profiles','database','log','775338mmChJG','Project','.json','parentSegment','profile','.env','4TdXxXc','cliFlags','entries','injectIntoOptions','Global\x20Credentials','activeProfile','48681rRmElU','[context]','join','segmentPath','\x0a[configuration\x20files]','sessions','logLevel','7294zacvsh','2456RHHMgB','verbose','Global','llm_agent','string','2399795KnKTBJ','loadGlobalConfig','apiKey','replace','us01','sessionId','config','session','profile:\x20','resolveAPIKeyAsync','parent_segment','project'];a46_0x8366=function(){return _0x46a593;};return a46_0x8366();}import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/tdx-logger.js';function a46_0x451d(_0x568fa7,_0x4fa258){_0x568fa7=_0x568fa7-0x1e9;const _0x83669=a46_0x8366();let _0x451deb=_0x83669[_0x568fa7];return _0x451deb;}import*as a46_0x2d292b from'node:fs';import*as a46_0x3709d8 from'node:path';export class GlobalContext{[a46_0x5c727a(0x220)];[a46_0x5c727a(0x22a)];[a46_0x5c727a(0x208)];[a46_0x5c727a(0x221)];[a46_0x5c727a(0x215)];[a46_0x5c727a(0x1fc)];[a46_0x5c727a(0x225)];[a46_0x5c727a(0x200)];[a46_0x5c727a(0x1fa)];['logLevel'];[a46_0x5c727a(0x1e9)];[a46_0x5c727a(0x226)];[a46_0x5c727a(0x1f0)];[a46_0x5c727a(0x203)];[a46_0x5c727a(0x218)];constructor(_0x2c0496){const _0x4a3c5c=a46_0x5c727a;this['sessionId']=_0x2c0496[_0x4a3c5c(0x205)]||getCurrentSessionPID()[_0x4a3c5c(0x213)]();const _0x4371c4=loadSessionContext(_0x2c0496[_0x4a3c5c(0x205)]),_0xeab338=loadProjectConfig(),_0x8c3ab9=this['loadGlobalConfig']();this['activeProfile']=_0x2c0496[_0x4a3c5c(0x1e9)]||_0x4371c4?.[_0x4a3c5c(0x1e9)]||_0x8c3ab9[_0x4a3c5c(0x1e9)]||getActiveProfile();const _0x1ade69=this[_0x4a3c5c(0x1f0)]?loadProfile(this['activeProfile']):null,_0x6f427=_0x1163ad=>{const _0x5b5ea4=_0x4a3c5c;if(!_0x1163ad)return{};const _0x5df538=_0x1163ad,_0x30187a={};for(const [_0x101578,_0x1927cf]of Object[_0x5b5ea4(0x1ed)](_0x5df538)){typeof _0x1927cf===_0x5b5ea4(0x1fd)&&(_0x30187a[_0x101578]=_0x1927cf);}return _0x30187a;},_0x338b92={};if(_0x2c0496[_0x4a3c5c(0x220)]&&_0x2c0496[_0x4a3c5c(0x220)]!==_0x4a3c5c(0x202))_0x338b92[_0x4a3c5c(0x220)]=_0x2c0496[_0x4a3c5c(0x220)];const _0xc68427=_0x4371c4?.['database'],_0x440c94=_0xeab338?.[_0x4a3c5c(0x22a)],_0x171d49=_0x1ade69?.['config']?.[_0x4a3c5c(0x22a)],_0x33efe2=_0x8c3ab9[_0x4a3c5c(0x22a)];_0x2c0496[_0x4a3c5c(0x22a)]&&(_0x2c0496[_0x4a3c5c(0x22a)]!==_0xc68427&&_0x2c0496[_0x4a3c5c(0x22a)]!==_0x440c94&&_0x2c0496['database']!==_0x171d49&&_0x2c0496[_0x4a3c5c(0x22a)]!==_0x33efe2)&&(_0x338b92[_0x4a3c5c(0x22a)]=_0x2c0496[_0x4a3c5c(0x22a)]);if(_0x2c0496['parentSegment'])_0x338b92['parent_segment']=_0x2c0496[_0x4a3c5c(0x22f)];if(_0x2c0496['llmProject'])_0x338b92[_0x4a3c5c(0x215)]=_0x2c0496[_0x4a3c5c(0x219)];if(_0x2c0496[_0x4a3c5c(0x20c)])_0x338b92[_0x4a3c5c(0x1fc)]=_0x2c0496[_0x4a3c5c(0x20c)];if(_0x2c0496[_0x4a3c5c(0x1e9)])_0x338b92[_0x4a3c5c(0x1e9)]=_0x2c0496[_0x4a3c5c(0x1e9)];this[_0x4a3c5c(0x226)]={'cliFlags':_0x338b92,'session':_0x6f427(_0x4371c4),'project':_0x6f427(_0xeab338),'profile':_0x6f427(_0x1ade69?.[_0x4a3c5c(0x204)]),'global':_0x6f427(_0x8c3ab9)};const _0x3e10db={...this[_0x4a3c5c(0x226)]['global'],...this[_0x4a3c5c(0x226)][_0x4a3c5c(0x1e9)],...this[_0x4a3c5c(0x226)][_0x4a3c5c(0x209)]};process[_0x4a3c5c(0x222)]['TDX_SITE']&&!this['layers']['session']['site']&&!this[_0x4a3c5c(0x226)][_0x4a3c5c(0x1ec)]['site']&&(_0x3e10db['site']=process['env']['TDX_SITE']);Object[_0x4a3c5c(0x212)](_0x3e10db,this['layers']['session']),Object['assign'](_0x3e10db,this[_0x4a3c5c(0x226)][_0x4a3c5c(0x1ec)]);const _0x401fe1=_0x3e10db[_0x4a3c5c(0x220)]||_0x4a3c5c(0x202);this[_0x4a3c5c(0x220)]=resolveSite(_0x401fe1),this[_0x4a3c5c(0x22a)]=_0x3e10db[_0x4a3c5c(0x22a)],this['parent_segment']=_0x3e10db['parent_segment'],this[_0x4a3c5c(0x221)]=_0x3e10db[_0x4a3c5c(0x221)],this[_0x4a3c5c(0x215)]=_0x3e10db['llm_project'],this['llm_agent']=_0x3e10db[_0x4a3c5c(0x1fc)],this['workflow_project']=_0x3e10db[_0x4a3c5c(0x225)],this[_0x4a3c5c(0x1fa)]=_0x2c0496[_0x4a3c5c(0x1fa)]||![],this[_0x4a3c5c(0x1f7)]=_0x2c0496['logLevel']??LogLevel['INFO'],this[_0x4a3c5c(0x1e9)]=this[_0x4a3c5c(0x1f0)]||undefined,this[_0x4a3c5c(0x200)]=getAPIKey(this[_0x4a3c5c(0x220)],this[_0x4a3c5c(0x1f0)]||undefined);const _0x3125f9=getConfigDir(),_0x6bd8ca=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x1f6),this[_0x4a3c5c(0x203)]+_0x4a3c5c(0x22e)),_0x15797b=findProjectConfigPath(),_0x4a8532=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x21f)),_0x2e978=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x1ea));let _0x1fd8b3=null,_0x40c14d=null;this[_0x4a3c5c(0x1f0)]&&(_0x1fd8b3=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x229),this['activeProfile'],_0x4a3c5c(0x21f)),_0x40c14d=a46_0x3709d8[_0x4a3c5c(0x1f3)](_0x3125f9,_0x4a3c5c(0x229),this[_0x4a3c5c(0x1f0)],_0x4a3c5c(0x1ea))),this[_0x4a3c5c(0x218)]={'session':a46_0x2d292b[_0x4a3c5c(0x20b)](_0x6bd8ca)?_0x6bd8ca:null,'project':_0x15797b,'profile':_0x1fd8b3&&a46_0x2d292b[_0x4a3c5c(0x20b)](_0x1fd8b3)?_0x1fd8b3:null,'profileCredentials':_0x40c14d&&a46_0x2d292b[_0x4a3c5c(0x20b)](_0x40c14d)?_0x40c14d:null,'global':a46_0x2d292b['existsSync'](_0x4a8532)?_0x4a8532:null,'globalCredentials':a46_0x2d292b[_0x4a3c5c(0x20b)](_0x2e978)?_0x2e978:null};}[a46_0x5c727a(0x214)](_0x5dbbce,_0x4767ee){const _0x7f1918=a46_0x5c727a;if(!_0x4767ee)return'not\x20set';const _0x24a55e=_0x4767ee;if(this[_0x7f1918(0x226)][_0x7f1918(0x1ec)][_0x5dbbce]===_0x24a55e){if(_0x5dbbce===_0x7f1918(0x220)&&_0x24a55e===_0x7f1918(0x202)&&!this['layers']['session'][_0x7f1918(0x220)]&&!this[_0x7f1918(0x226)]['project'][_0x7f1918(0x220)]&&!this[_0x7f1918(0x226)][_0x7f1918(0x1e9)][_0x7f1918(0x220)]&&!this['layers'][_0x7f1918(0x217)]['site'])return'default';return _0x7f1918(0x20f)+_0x5dbbce[_0x7f1918(0x201)](/_/g,'-');}if(this[_0x7f1918(0x226)]['session'][_0x5dbbce]===_0x24a55e)return _0x7f1918(0x205);if(this[_0x7f1918(0x226)][_0x7f1918(0x209)][_0x5dbbce]===_0x24a55e)return _0x7f1918(0x209);if(this[_0x7f1918(0x226)][_0x7f1918(0x1e9)][_0x5dbbce]===_0x24a55e)return _0x7f1918(0x206)+this[_0x7f1918(0x1f0)];if(this[_0x7f1918(0x226)][_0x7f1918(0x217)][_0x5dbbce]===_0x24a55e)return'global';return'default';}[a46_0x5c727a(0x1ff)](){const _0x4833e6=a46_0x5c727a,_0x4aec4d=a46_0x3709d8[_0x4833e6(0x1f3)](getConfigDir(),_0x4833e6(0x21f));if(!a46_0x2d292b[_0x4833e6(0x20b)](_0x4aec4d))return{};try{const _0x1edafc=a46_0x2d292b[_0x4833e6(0x21e)](_0x4aec4d,_0x4833e6(0x227));return JSON['parse'](_0x1edafc);}catch{return{};}}[a46_0x5c727a(0x1ee)](_0x25e421){const _0xb1cbe7=a46_0x5c727a;_0x25e421[_0xb1cbe7(0x220)]=this[_0xb1cbe7(0x220)],!_0x25e421[_0xb1cbe7(0x22a)]&&this[_0xb1cbe7(0x22a)]&&(_0x25e421[_0xb1cbe7(0x22a)]=this[_0xb1cbe7(0x22a)]),!_0x25e421[_0xb1cbe7(0x22f)]&&this[_0xb1cbe7(0x208)]&&(_0x25e421[_0xb1cbe7(0x22f)]=this[_0xb1cbe7(0x208)]),!_0x25e421[_0xb1cbe7(0x1f4)]&&this['segment_path']&&(_0x25e421[_0xb1cbe7(0x1f4)]=this[_0xb1cbe7(0x221)]),!_0x25e421[_0xb1cbe7(0x219)]&&this['llm_project']&&(_0x25e421[_0xb1cbe7(0x219)]=this['llm_project']),!_0x25e421[_0xb1cbe7(0x20c)]&&this[_0xb1cbe7(0x1fc)]&&(_0x25e421[_0xb1cbe7(0x20c)]=this['llm_agent']),!_0x25e421[_0xb1cbe7(0x20d)]&&this['workflow_project']&&(_0x25e421[_0xb1cbe7(0x20d)]=this[_0xb1cbe7(0x225)]);}[a46_0x5c727a(0x210)](){const _0x36bc76=a46_0x5c727a;return[{'key':'site','value':this[_0x36bc76(0x220)]},{'key':'database','value':this[_0x36bc76(0x22a)]},{'key':'parent_segment','value':this[_0x36bc76(0x208)]},{'key':_0x36bc76(0x221),'value':this[_0x36bc76(0x221)]},{'key':_0x36bc76(0x215),'value':this[_0x36bc76(0x215)]},{'key':'llm_agent','value':this['llm_agent']},{'key':'workflow_project','value':this[_0x36bc76(0x225)]},{'key':_0x36bc76(0x1e9),'value':this[_0x36bc76(0x1f0)]||undefined}];}[a46_0x5c727a(0x21b)](){const _0x17a10e=a46_0x5c727a;console['log'](_0x17a10e(0x1f2));for(const {key:_0x2757af,value:_0x4235d0}of this['getParameters']()){_0x4235d0&&console['log'](_0x2757af+':\x20'+_0x4235d0);}}['displayWithSources'](){const _0x42b96a=a46_0x5c727a;console[_0x42b96a(0x22b)](_0x42b96a(0x1f2));for(const {key:_0x50e08b,value:_0x2e8a39}of this['getParameters']()){if(_0x2e8a39){const _0x30a142=_0x50e08b===_0x42b96a(0x1e9)?'(active)':'('+this['getSource'](_0x50e08b,_0x2e8a39)+')';console[_0x42b96a(0x22b)](_0x50e08b+':\x20'+_0x2e8a39+'\x20'+_0x30a142);}}console[_0x42b96a(0x22b)](_0x42b96a(0x1f5));const _0xc1a38e=[{'label':'Session','path':this[_0x42b96a(0x218)][_0x42b96a(0x205)],'extra':_0x42b96a(0x21c)+this['sessionId']+')'},{'label':_0x42b96a(0x22d),'path':this['configFiles'][_0x42b96a(0x209)]},{'label':_0x42b96a(0x21a),'path':this[_0x42b96a(0x218)]['profile']},{'label':_0x42b96a(0x228),'path':this['configFiles']['profileCredentials']},{'label':_0x42b96a(0x1fb),'path':this['configFiles']['global']},{'label':_0x42b96a(0x1ef),'path':this[_0x42b96a(0x218)][_0x42b96a(0x216)]}];for(const {label:_0x40e976,path:_0x37b32a,extra:_0x5478f2}of _0xc1a38e){if(_0x37b32a)console['log'](_0x40e976+':\x20'+_0x37b32a+'\x20✓'+(_0x5478f2?'\x20'+_0x5478f2:''));else{if(_0x40e976==='Session')console[_0x42b96a(0x22b)](_0x40e976+':\x20none\x20(using\x20session:\x20'+this[_0x42b96a(0x203)]+')');else(_0x40e976===_0x42b96a(0x22d)||_0x40e976===_0x42b96a(0x1fb))&&console[_0x42b96a(0x22b)](_0x40e976+':\x20none');}}}async[a46_0x5c727a(0x207)](){const _0xdadb0=a46_0x5c727a;return this[_0xdadb0(0x200)]=await getAPIKeyAsync(this['site'],this[_0xdadb0(0x1f0)]||undefined),this[_0xdadb0(0x200)];}static async[a46_0x5c727a(0x20e)](_0x64e4cf){const _0x4ce532=a46_0x5c727a,_0x2f9933=new GlobalContext(_0x64e4cf);return await _0x2f9933[_0x4ce532(0x207)](),_0x2f9933;}}
1
+ const a46_0x541496=a46_0x1377;(function(_0x8626ec,_0x556a87){const _0x3c0e1d=a46_0x1377,_0x4384b7=_0x8626ec();while(!![]){try{const _0x3067d4=-parseInt(_0x3c0e1d(0x234))/0x1+-parseInt(_0x3c0e1d(0x215))/0x2*(parseInt(_0x3c0e1d(0x206))/0x3)+-parseInt(_0x3c0e1d(0x218))/0x4*(parseInt(_0x3c0e1d(0x1f3))/0x5)+-parseInt(_0x3c0e1d(0x20a))/0x6+parseInt(_0x3c0e1d(0x1f7))/0x7+-parseInt(_0x3c0e1d(0x20c))/0x8+parseInt(_0x3c0e1d(0x205))/0x9*(parseInt(_0x3c0e1d(0x1f8))/0xa);if(_0x3067d4===_0x556a87)break;else _0x4384b7['push'](_0x4384b7['shift']());}catch(_0x298540){_0x4384b7['push'](_0x4384b7['shift']());}}}(a46_0x18dc,0x59bac));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a46_0x1377(_0x41dca0,_0x37a70a){_0x41dca0=_0x41dca0-0x1ee;const _0x18dc62=a46_0x18dc();let _0x1377db=_0x18dc62[_0x41dca0];return _0x1377db;}import{getActiveProfile,loadProfile}from'./profile.js';function a46_0x18dc(){const _0x3c2b12=['loadGlobalConfig','configFiles','getParameters','workflow_project','profile:\x20','global','getSource','5emrsWI','activeProfile','globalCredentials','project','1291955TYyprB','40HFmfVZ',':\x20none\x20(using\x20session:\x20','parentSegment','profile','parent_segment','TDX_SITE','injectIntoOptions','tdx.json','toString','\x0a[configuration\x20files]','layers','join','segment_path','5238306XjzdlC','1183851NCneDr','sessionId','site','llmAgent','3705234naaxIK','log','5062648SkrpeD','not\x20set','CLI\x20flag:\x20--','database','session','.json','resolveAPIKeyAsync','Global\x20Credentials','llmProject','2hLdZpW','default','Global','254908VQFFEy','Profile','parse','logLevel','llm_agent','us01','workflowProject','cliFlags','[context]','Session','INFO','utf-8','Profile\x20Credentials','entries','Project','verbose','env','segmentPath','sessions','createAsync','apiKey','(active)','profiles','readFileSync','(session:\x20','llm_project','existsSync','displayWithSources','436455tdjnwL'];a46_0x18dc=function(){return _0x3c2b12;};return a46_0x18dc();}import{LogLevel}from'../utils/tdx-logger.js';import*as a46_0x360b5c from'node:fs';import*as a46_0x4ea364 from'node:path';export class GlobalContext{[a46_0x541496(0x208)];[a46_0x541496(0x20f)];[a46_0x541496(0x1fc)];['segment_path'];[a46_0x541496(0x231)];[a46_0x541496(0x21c)];['workflow_project'];[a46_0x541496(0x22c)];[a46_0x541496(0x227)];[a46_0x541496(0x21b)];[a46_0x541496(0x1fb)];[a46_0x541496(0x202)];[a46_0x541496(0x1f4)];[a46_0x541496(0x207)];['configFiles'];constructor(_0x5874a9){const _0x16d292=a46_0x541496;this[_0x16d292(0x207)]=_0x5874a9[_0x16d292(0x210)]||getCurrentSessionPID()[_0x16d292(0x200)]();const _0x4fe5f1=loadSessionContext(_0x5874a9[_0x16d292(0x210)]),_0x1f1c3b=loadProjectConfig(),_0x47a811=this[_0x16d292(0x235)]();this[_0x16d292(0x1f4)]=_0x5874a9[_0x16d292(0x1fb)]||_0x4fe5f1?.[_0x16d292(0x1fb)]||_0x47a811[_0x16d292(0x1fb)]||getActiveProfile();const _0x4be738=this[_0x16d292(0x1f4)]?loadProfile(this[_0x16d292(0x1f4)]):null,_0x236c60=_0x437208=>{const _0x3f9102=_0x16d292;if(!_0x437208)return{};const _0x4fd13a=_0x437208,_0x3e7093={};for(const [_0xbcef2c,_0x148fbd]of Object[_0x3f9102(0x225)](_0x4fd13a)){typeof _0x148fbd==='string'&&(_0x3e7093[_0xbcef2c]=_0x148fbd);}return _0x3e7093;},_0x7d617e={};if(_0x5874a9[_0x16d292(0x208)]&&_0x5874a9[_0x16d292(0x208)]!==_0x16d292(0x21d))_0x7d617e[_0x16d292(0x208)]=_0x5874a9[_0x16d292(0x208)];const _0x134a3f=_0x4fe5f1?.[_0x16d292(0x20f)],_0x55b2d5=_0x1f1c3b?.[_0x16d292(0x20f)],_0x55d589=_0x4be738?.['config']?.[_0x16d292(0x20f)],_0x2003b0=_0x47a811[_0x16d292(0x20f)];_0x5874a9[_0x16d292(0x20f)]&&(_0x5874a9[_0x16d292(0x20f)]!==_0x134a3f&&_0x5874a9[_0x16d292(0x20f)]!==_0x55b2d5&&_0x5874a9[_0x16d292(0x20f)]!==_0x55d589&&_0x5874a9['database']!==_0x2003b0)&&(_0x7d617e[_0x16d292(0x20f)]=_0x5874a9[_0x16d292(0x20f)]);if(_0x5874a9[_0x16d292(0x1fa)])_0x7d617e[_0x16d292(0x1fc)]=_0x5874a9['parentSegment'];if(_0x5874a9[_0x16d292(0x214)])_0x7d617e['llm_project']=_0x5874a9[_0x16d292(0x214)];if(_0x5874a9['llmAgent'])_0x7d617e[_0x16d292(0x21c)]=_0x5874a9['llmAgent'];if(_0x5874a9[_0x16d292(0x1fb)])_0x7d617e['profile']=_0x5874a9[_0x16d292(0x1fb)];this[_0x16d292(0x202)]={'cliFlags':_0x7d617e,'session':_0x236c60(_0x4fe5f1),'project':_0x236c60(_0x1f1c3b),'profile':_0x236c60(_0x4be738?.['config']),'global':_0x236c60(_0x47a811)};const _0x1a9a91={...this[_0x16d292(0x202)][_0x16d292(0x1f1)],...this[_0x16d292(0x202)][_0x16d292(0x1fb)],...this[_0x16d292(0x202)][_0x16d292(0x1f6)]};process[_0x16d292(0x228)][_0x16d292(0x1fd)]&&!this['layers'][_0x16d292(0x210)][_0x16d292(0x208)]&&!this['layers'][_0x16d292(0x21f)][_0x16d292(0x208)]&&(_0x1a9a91['site']=process[_0x16d292(0x228)][_0x16d292(0x1fd)]);Object['assign'](_0x1a9a91,this[_0x16d292(0x202)][_0x16d292(0x210)]),Object['assign'](_0x1a9a91,this['layers'][_0x16d292(0x21f)]);const _0x3a6ab7=_0x1a9a91[_0x16d292(0x208)]||_0x16d292(0x21d);this[_0x16d292(0x208)]=resolveSite(_0x3a6ab7),this[_0x16d292(0x20f)]=_0x1a9a91[_0x16d292(0x20f)],this['parent_segment']=_0x1a9a91['parent_segment'],this[_0x16d292(0x204)]=_0x1a9a91[_0x16d292(0x204)],this[_0x16d292(0x231)]=_0x1a9a91['llm_project'],this[_0x16d292(0x21c)]=_0x1a9a91[_0x16d292(0x21c)],this[_0x16d292(0x1ef)]=_0x1a9a91['workflow_project'],this[_0x16d292(0x227)]=_0x5874a9[_0x16d292(0x227)]||![],this['logLevel']=_0x5874a9['logLevel']??LogLevel[_0x16d292(0x222)],this[_0x16d292(0x1fb)]=this[_0x16d292(0x1f4)]||undefined,this[_0x16d292(0x22c)]=getAPIKey(this[_0x16d292(0x208)],this[_0x16d292(0x1f4)]||undefined);const _0xf124b7=getConfigDir(),_0x5f571c=a46_0x4ea364[_0x16d292(0x203)](_0xf124b7,_0x16d292(0x22a),this[_0x16d292(0x207)]+_0x16d292(0x211)),_0x1ee394=findProjectConfigPath(),_0x10e28a=a46_0x4ea364[_0x16d292(0x203)](_0xf124b7,_0x16d292(0x1ff)),_0x181628=a46_0x4ea364[_0x16d292(0x203)](_0xf124b7,'.env');let _0x22f511=null,_0x5583f8=null;this[_0x16d292(0x1f4)]&&(_0x22f511=a46_0x4ea364[_0x16d292(0x203)](_0xf124b7,'profiles',this[_0x16d292(0x1f4)],_0x16d292(0x1ff)),_0x5583f8=a46_0x4ea364[_0x16d292(0x203)](_0xf124b7,_0x16d292(0x22e),this[_0x16d292(0x1f4)],'.env')),this[_0x16d292(0x236)]={'session':a46_0x360b5c['existsSync'](_0x5f571c)?_0x5f571c:null,'project':_0x1ee394,'profile':_0x22f511&&a46_0x360b5c[_0x16d292(0x232)](_0x22f511)?_0x22f511:null,'profileCredentials':_0x5583f8&&a46_0x360b5c[_0x16d292(0x232)](_0x5583f8)?_0x5583f8:null,'global':a46_0x360b5c[_0x16d292(0x232)](_0x10e28a)?_0x10e28a:null,'globalCredentials':a46_0x360b5c['existsSync'](_0x181628)?_0x181628:null};}['getSource'](_0xa78218,_0x46a37a){const _0x105566=a46_0x541496;if(!_0x46a37a)return _0x105566(0x20d);const _0x1bd541=_0x46a37a;if(this['layers'][_0x105566(0x21f)][_0xa78218]===_0x1bd541){if(_0xa78218===_0x105566(0x208)&&_0x1bd541==='us01'&&!this[_0x105566(0x202)][_0x105566(0x210)][_0x105566(0x208)]&&!this[_0x105566(0x202)][_0x105566(0x1f6)][_0x105566(0x208)]&&!this[_0x105566(0x202)][_0x105566(0x1fb)]['site']&&!this[_0x105566(0x202)]['global'][_0x105566(0x208)])return'default';return _0x105566(0x20e)+_0xa78218['replace'](/_/g,'-');}if(this[_0x105566(0x202)][_0x105566(0x210)][_0xa78218]===_0x1bd541)return _0x105566(0x210);if(this[_0x105566(0x202)][_0x105566(0x1f6)][_0xa78218]===_0x1bd541)return'project';if(this[_0x105566(0x202)]['profile'][_0xa78218]===_0x1bd541)return _0x105566(0x1f0)+this[_0x105566(0x1f4)];if(this[_0x105566(0x202)][_0x105566(0x1f1)][_0xa78218]===_0x1bd541)return _0x105566(0x1f1);return _0x105566(0x216);}[a46_0x541496(0x235)](){const _0x4a2d49=a46_0x541496,_0x1acbae=a46_0x4ea364[_0x4a2d49(0x203)](getConfigDir(),_0x4a2d49(0x1ff));if(!a46_0x360b5c['existsSync'](_0x1acbae))return{};try{const _0x51550d=a46_0x360b5c[_0x4a2d49(0x22f)](_0x1acbae,_0x4a2d49(0x223));return JSON[_0x4a2d49(0x21a)](_0x51550d);}catch{return{};}}[a46_0x541496(0x1fe)](_0x3ac290){const _0x51b284=a46_0x541496;_0x3ac290[_0x51b284(0x208)]=this[_0x51b284(0x208)],!_0x3ac290[_0x51b284(0x20f)]&&this[_0x51b284(0x20f)]&&(_0x3ac290[_0x51b284(0x20f)]=this['database']),!_0x3ac290['parentSegment']&&this[_0x51b284(0x1fc)]&&(_0x3ac290['parentSegment']=this[_0x51b284(0x1fc)]),!_0x3ac290[_0x51b284(0x229)]&&this[_0x51b284(0x204)]&&(_0x3ac290[_0x51b284(0x229)]=this[_0x51b284(0x204)]),!_0x3ac290['llmProject']&&this[_0x51b284(0x231)]&&(_0x3ac290['llmProject']=this[_0x51b284(0x231)]),!_0x3ac290[_0x51b284(0x209)]&&this[_0x51b284(0x21c)]&&(_0x3ac290['llmAgent']=this[_0x51b284(0x21c)]),!_0x3ac290[_0x51b284(0x21e)]&&this['workflow_project']&&(_0x3ac290[_0x51b284(0x21e)]=this[_0x51b284(0x1ef)]);}[a46_0x541496(0x1ee)](){const _0x475af2=a46_0x541496;return[{'key':_0x475af2(0x208),'value':this['site']},{'key':_0x475af2(0x20f),'value':this['database']},{'key':_0x475af2(0x1fc),'value':this[_0x475af2(0x1fc)]},{'key':_0x475af2(0x204),'value':this[_0x475af2(0x204)]},{'key':_0x475af2(0x231),'value':this[_0x475af2(0x231)]},{'key':_0x475af2(0x21c),'value':this[_0x475af2(0x21c)]},{'key':'workflow_project','value':this[_0x475af2(0x1ef)]},{'key':'profile','value':this[_0x475af2(0x1f4)]||undefined}];}['display'](){const _0x2644b8=a46_0x541496;console[_0x2644b8(0x20b)]('[context]');for(const {key:_0x98b474,value:_0x560ba0}of this['getParameters']()){_0x560ba0&&console[_0x2644b8(0x20b)](_0x98b474+':\x20'+_0x560ba0);}}[a46_0x541496(0x233)](){const _0x189640=a46_0x541496;console[_0x189640(0x20b)](_0x189640(0x220));for(const {key:_0x513bb4,value:_0x3bc1b3}of this[_0x189640(0x1ee)]()){if(_0x3bc1b3){const _0x1f6d60=_0x513bb4===_0x189640(0x1fb)?_0x189640(0x22d):'('+this[_0x189640(0x1f2)](_0x513bb4,_0x3bc1b3)+')';console['log'](_0x513bb4+':\x20'+_0x3bc1b3+'\x20'+_0x1f6d60);}}console[_0x189640(0x20b)](_0x189640(0x201));const _0x4d0b08=[{'label':_0x189640(0x221),'path':this[_0x189640(0x236)][_0x189640(0x210)],'extra':_0x189640(0x230)+this[_0x189640(0x207)]+')'},{'label':_0x189640(0x226),'path':this[_0x189640(0x236)][_0x189640(0x1f6)]},{'label':_0x189640(0x219),'path':this[_0x189640(0x236)]['profile']},{'label':_0x189640(0x224),'path':this[_0x189640(0x236)]['profileCredentials']},{'label':_0x189640(0x217),'path':this[_0x189640(0x236)][_0x189640(0x1f1)]},{'label':_0x189640(0x213),'path':this[_0x189640(0x236)][_0x189640(0x1f5)]}];for(const {label:_0x143e78,path:_0x10dea5,extra:_0x27c048}of _0x4d0b08){if(_0x10dea5)console[_0x189640(0x20b)](_0x143e78+':\x20'+_0x10dea5+'\x20✓'+(_0x27c048?'\x20'+_0x27c048:''));else{if(_0x143e78==='Session')console[_0x189640(0x20b)](_0x143e78+_0x189640(0x1f9)+this[_0x189640(0x207)]+')');else(_0x143e78==='Project'||_0x143e78===_0x189640(0x217))&&console[_0x189640(0x20b)](_0x143e78+':\x20none');}}}async[a46_0x541496(0x212)](){const _0x34ef70=a46_0x541496;return this[_0x34ef70(0x22c)]=await getAPIKeyAsync(this[_0x34ef70(0x208)],this['activeProfile']||undefined),this[_0x34ef70(0x22c)];}static async[a46_0x541496(0x22b)](_0x2f6f8c){const _0x5a2e64=a46_0x541496,_0x378bc3=new GlobalContext(_0x2f6f8c);return await _0x378bc3[_0x5a2e64(0x212)](),_0x378bc3;}}
@@ -1 +1 @@
1
- const a47_0x366914=a47_0x4ee1;(function(_0x3bc186,_0x25112f){const _0x3a0fb8=a47_0x4ee1,_0x516e94=_0x3bc186();while(!![]){try{const _0x30a8e6=-parseInt(_0x3a0fb8(0xb9))/0x1*(parseInt(_0x3a0fb8(0xbc))/0x2)+parseInt(_0x3a0fb8(0xcf))/0x3*(parseInt(_0x3a0fb8(0xb8))/0x4)+-parseInt(_0x3a0fb8(0xad))/0x5+parseInt(_0x3a0fb8(0xc8))/0x6*(parseInt(_0x3a0fb8(0xc7))/0x7)+parseInt(_0x3a0fb8(0xbe))/0x8+parseInt(_0x3a0fb8(0xbf))/0x9+parseInt(_0x3a0fb8(0xb7))/0xa;if(_0x30a8e6===_0x25112f)break;else _0x516e94['push'](_0x516e94['shift']());}catch(_0x260b40){_0x516e94['push'](_0x516e94['shift']());}}}(a47_0x5649,0xe2a39));const SERVICE_NAME=a47_0x366914(0xba);let keyringModule=null,keyringLoadError=null;function a47_0x5649(){const _0x1d1f5c=['could\x20not\x20be\x20found','setPassword','toLowerCase','restricted','546wbAzGl','99660wBbdoq','Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.','profile:','__keychain_test__','includes','success','message','3342lwzwVm','7624265PbbiHf','System\x20keychain\x20is\x20not\x20available','-25300','reason','cannot\x20find','keyring','unavailable','value','access','@zowe/secrets-for-zowe-sdk','12397340FUDKoz','1552jUVWCO','69GttKjx','tdx','not\x20available','40742EPdEKv','getPassword','6717080SnQJst','464256RxUWrt','access_denied','not_found',':api_key'];a47_0x5649=function(){return _0x1d1f5c;};return a47_0x5649();}async function getKeyring(){const _0x5e20f5=a47_0x366914;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x930a14=await import(_0x5e20f5(0xb6));return keyringModule=_0x930a14[_0x5e20f5(0xb2)],keyringModule;}catch(_0x57923c){return keyringLoadError=_0x57923c instanceof Error?_0x57923c:new Error(String(_0x57923c)),null;}}function a47_0x4ee1(_0x3cf2f3,_0x9c1d7c){_0x3cf2f3=_0x3cf2f3-0xad;const _0x564974=a47_0x5649();let _0x4ee1c0=_0x564974[_0x3cf2f3];return _0x4ee1c0;}function getAccountName(_0x37e9fb){const _0x373c85=a47_0x366914,_0x417e70=_0x37e9fb||'';return _0x373c85(0xca)+_0x417e70+_0x373c85(0xc2);}export async function getKeychainAPIKey(_0x3a0026){const _0x269d22=a47_0x366914,_0x425b4a=await getKeychainAPIKeyWithStatus(_0x3a0026);if(_0x425b4a[_0x269d22(0xcd)])return _0x425b4a[_0x269d22(0xb4)];return _0x425b4a[_0x269d22(0xb0)]===_0x269d22(0xc0)&&console['error']('Warning:\x20'+_0x425b4a[_0x269d22(0xce)]),null;}export async function getKeychainAPIKeyWithStatus(_0x17bd92){const _0x11cfb4=a47_0x366914;try{const _0x49c0d2=await getKeyring();if(!_0x49c0d2)return{'success':![],'reason':_0x11cfb4(0xb3)};const _0x254e8a=getAccountName(_0x17bd92),_0x14bf26=await _0x49c0d2[_0x11cfb4(0xbd)](SERVICE_NAME,_0x254e8a);if(_0x14bf26)return{'success':!![],'value':_0x14bf26};return{'success':![],'reason':_0x11cfb4(0xc1)};}catch(_0xad0d84){const _0x4fa459=_0xad0d84 instanceof Error?_0xad0d84['message']:String(_0xad0d84);if(_0x4fa459[_0x11cfb4(0xcc)](_0x11cfb4(0xaf))||_0x4fa459[_0x11cfb4(0xc5)]()[_0x11cfb4(0xcc)](_0x11cfb4(0xc3))||_0x4fa459['toLowerCase']()['includes']('not\x20found'))return{'success':![],'reason':_0x11cfb4(0xc1)};if(_0x4fa459[_0x11cfb4(0xcc)]('-25293')||_0x4fa459['toLowerCase']()[_0x11cfb4(0xcc)](_0x11cfb4(0xc6))||_0x4fa459['toLowerCase']()[_0x11cfb4(0xcc)](_0x11cfb4(0xb5)))return{'success':![],'reason':_0x11cfb4(0xc0),'message':_0x11cfb4(0xc9)};return{'success':![],'reason':_0x11cfb4(0xb3),'message':_0x4fa459};}}export async function saveKeychainAPIKey(_0x537adc,_0x4b1f47){const _0xd62c98=a47_0x366914,_0x5b7b10=await getKeyring();if(!_0x5b7b10)throw new Error(_0xd62c98(0xae));const _0x5b6720=getAccountName(_0x4b1f47);await _0x5b7b10[_0xd62c98(0xc4)](SERVICE_NAME,_0x5b6720,_0x537adc);}export async function deleteKeychainAPIKey(_0x3be449){try{const _0x4596f1=await getKeyring();if(!_0x4596f1)return![];const _0xbd1165=getAccountName(_0x3be449);return await _0x4596f1['deletePassword'](SERVICE_NAME,_0xbd1165);}catch{return![];}}export async function isKeychainAvailable(){const _0x1688f8=a47_0x366914;try{const _0x42603e=await getKeyring();if(!_0x42603e)return![];return await _0x42603e['getPassword'](SERVICE_NAME,_0x1688f8(0xcb)),!![];}catch(_0x1b3437){const _0x330df1=_0x1b3437 instanceof Error?_0x1b3437['message']['toLowerCase']():'';if(_0x330df1[_0x1688f8(0xcc)](_0x1688f8(0xbb))||_0x330df1['includes']('not\x20supported')||_0x330df1[_0x1688f8(0xcc)](_0x1688f8(0xb1)))return![];return!![];}}
1
+ const a47_0x47f281=a47_0x301e;(function(_0x67c842,_0x48d322){const _0x5175e6=a47_0x301e,_0x2dde6d=_0x67c842();while(!![]){try{const _0x3b4601=-parseInt(_0x5175e6(0x125))/0x1+-parseInt(_0x5175e6(0x102))/0x2+-parseInt(_0x5175e6(0x109))/0x3*(parseInt(_0x5175e6(0x122))/0x4)+parseInt(_0x5175e6(0x119))/0x5+-parseInt(_0x5175e6(0x11a))/0x6+parseInt(_0x5175e6(0x103))/0x7*(parseInt(_0x5175e6(0x10e))/0x8)+parseInt(_0x5175e6(0x108))/0x9*(parseInt(_0x5175e6(0x123))/0xa);if(_0x3b4601===_0x48d322)break;else _0x2dde6d['push'](_0x2dde6d['shift']());}catch(_0x39ad09){_0x2dde6d['push'](_0x2dde6d['shift']());}}}(a47_0x250c,0xa7517));const SERVICE_NAME=a47_0x47f281(0x11c);let keyringModule=null,keyringLoadError=null;async function getKeyring(){const _0xbf181e=a47_0x47f281;if(keyringModule!==null)return keyringModule;if(keyringLoadError!==null)return null;try{const _0x1a243c=await import(_0xbf181e(0x107));return keyringModule=_0x1a243c['keyring'],keyringModule;}catch(_0x2b22ed){return keyringLoadError=_0x2b22ed instanceof Error?_0x2b22ed:new Error(String(_0x2b22ed)),null;}}function getAccountName(_0x474dcf){const _0x401a8f=a47_0x47f281,_0x3af9d7=_0x474dcf||'';return _0x401a8f(0x110)+_0x3af9d7+_0x401a8f(0x116);}export async function getKeychainAPIKey(_0x33a138){const _0x3b39c2=a47_0x47f281,_0x304f02=await getKeychainAPIKeyWithStatus(_0x33a138);if(_0x304f02[_0x3b39c2(0x115)])return _0x304f02[_0x3b39c2(0x121)];return _0x304f02['reason']===_0x3b39c2(0x105)&&console[_0x3b39c2(0x106)](_0x3b39c2(0x104)+_0x304f02[_0x3b39c2(0x113)]),null;}export async function getKeychainAPIKeyWithStatus(_0x234581){const _0x19999c=a47_0x47f281;try{const _0x389c01=await getKeyring();if(!_0x389c01)return{'success':![],'reason':'unavailable'};const _0x100805=getAccountName(_0x234581),_0x2ddcee=await _0x389c01[_0x19999c(0x10b)](SERVICE_NAME,_0x100805);if(_0x2ddcee)return{'success':!![],'value':_0x2ddcee};return{'success':![],'reason':'not_found'};}catch(_0x26b8ea){const _0x2875af=_0x26b8ea instanceof Error?_0x26b8ea['message']:String(_0x26b8ea);if(_0x2875af[_0x19999c(0x11e)](_0x19999c(0x11f))||_0x2875af['toLowerCase']()[_0x19999c(0x11e)](_0x19999c(0x10c))||_0x2875af[_0x19999c(0x11d)]()[_0x19999c(0x11e)](_0x19999c(0x114)))return{'success':![],'reason':_0x19999c(0x120)};if(_0x2875af[_0x19999c(0x11e)]('-25293')||_0x2875af[_0x19999c(0x11d)]()['includes'](_0x19999c(0x10a))||_0x2875af['toLowerCase']()[_0x19999c(0x11e)](_0x19999c(0x117)))return{'success':![],'reason':_0x19999c(0x105),'message':_0x19999c(0x11b)};return{'success':![],'reason':_0x19999c(0x101),'message':_0x2875af};}}function a47_0x301e(_0x5a4f59,_0x15e99c){_0x5a4f59=_0x5a4f59-0x101;const _0x250cad=a47_0x250c();let _0x301e4d=_0x250cad[_0x5a4f59];return _0x301e4d;}export async function saveKeychainAPIKey(_0x3859c8,_0x5d6af1){const _0x10e80d=a47_0x47f281,_0x14ef71=await getKeyring();if(!_0x14ef71)throw new Error(_0x10e80d(0x124));const _0x59ce97=getAccountName(_0x5d6af1);await _0x14ef71[_0x10e80d(0x10f)](SERVICE_NAME,_0x59ce97,_0x3859c8);}export async function deleteKeychainAPIKey(_0x19cb55){const _0x1af626=a47_0x47f281;try{const _0x525ed3=await getKeyring();if(!_0x525ed3)return![];const _0x2ea232=getAccountName(_0x19cb55);return await _0x525ed3[_0x1af626(0x111)](SERVICE_NAME,_0x2ea232);}catch{return![];}}function a47_0x250c(){const _0x4102c5=['__keychain_test__','message','not\x20found','success',':api_key','access','cannot\x20find','2858940SzjvQv','6726060pjhgLx','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.','tdx','toLowerCase','includes','-25300','not_found','value','1720jxHfdF','430pJhwGF','System\x20keychain\x20is\x20not\x20available','50974qcIYBN','unavailable','2521384YbkdRY','6219710sGqIEH','Warning:\x20','access_denied','error','@zowe/secrets-for-zowe-sdk','358119MarvWi','372EPXiTo','restricted','getPassword','could\x20not\x20be\x20found','not\x20available','8eDPbwO','setPassword','profile:','deletePassword'];a47_0x250c=function(){return _0x4102c5;};return a47_0x250c();}export async function isKeychainAvailable(){const _0x2f654b=a47_0x47f281;try{const _0xf65f75=await getKeyring();if(!_0xf65f75)return![];return await _0xf65f75[_0x2f654b(0x10b)](SERVICE_NAME,_0x2f654b(0x112)),!![];}catch(_0xaceb1a){const _0x48aecb=_0xaceb1a instanceof Error?_0xaceb1a[_0x2f654b(0x113)][_0x2f654b(0x11d)]():'';if(_0x48aecb[_0x2f654b(0x11e)](_0x2f654b(0x10d))||_0x48aecb[_0x2f654b(0x11e)]('not\x20supported')||_0x48aecb[_0x2f654b(0x11e)](_0x2f654b(0x118)))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0x3602db,_0x31544c){const _0x5ddea3=a48_0x2a59,_0x5f23dc=_0x3602db();while(!![]){try{const _0xead6f5=-parseInt(_0x5ddea3(0x148))/0x1+parseInt(_0x5ddea3(0x129))/0x2+-parseInt(_0x5ddea3(0x134))/0x3+-parseInt(_0x5ddea3(0x14d))/0x4*(-parseInt(_0x5ddea3(0x12b))/0x5)+-parseInt(_0x5ddea3(0x12c))/0x6+parseInt(_0x5ddea3(0x16e))/0x7*(-parseInt(_0x5ddea3(0x13c))/0x8)+parseInt(_0x5ddea3(0x14a))/0x9;if(_0xead6f5===_0x31544c)break;else _0x5f23dc['push'](_0x5f23dc['shift']());}catch(_0x3aa980){_0x5f23dc['push'](_0x5f23dc['shift']());}}}(a48_0x5d7f,0xe6cfb));import*as a48_0xcaeaa6 from'node:fs';import*as a48_0x32d0c6 from'node:path';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export function getProfileParams(_0x8682cf){const _0x5f1c82=a48_0x2a59,_0x1f2b06={};if(!_0x8682cf)return _0x1f2b06;for(const [_0x3ec88d,_0x26a28b]of Object['entries'](_0x8682cf)){_0x3ec88d!==_0x5f1c82(0x140)&&_0x26a28b!==undefined&&(_0x1f2b06[_0x3ec88d]=_0x26a28b);}return _0x1f2b06;}export function getProfilesDir(){const _0x21e84e=a48_0x2a59;return a48_0x32d0c6[_0x21e84e(0x15e)](getConfigDir(),_0x21e84e(0x15b));}function getProfileDir(_0x2c3185){const _0x30086a=a48_0x2a59;return a48_0x32d0c6[_0x30086a(0x15e)](getProfilesDir(),_0x2c3185);}function getProfileConfigPath(_0x5cb053){const _0xfa215a=a48_0x2a59;return a48_0x32d0c6[_0xfa215a(0x15e)](getProfileDir(_0x5cb053),_0xfa215a(0x138));}function getProfileEnvPath(_0x5332b4){const _0x15a277=a48_0x2a59;return a48_0x32d0c6[_0x15a277(0x15e)](getProfileDir(_0x5332b4),_0x15a277(0x126));}function a48_0x2a59(_0x282dfc,_0x12974c){_0x282dfc=_0x282dfc-0x121;const _0x5d7f90=a48_0x5d7f();let _0x2a596d=_0x5d7f90[_0x282dfc];return _0x2a596d;}function getGlobalConfigPath(){const _0x1ce553=a48_0x2a59;return a48_0x32d0c6[_0x1ce553(0x15e)](getConfigDir(),_0x1ce553(0x138));}function validateProfileName(_0x192a14){const _0x2ac04c=a48_0x2a59;if(!/^[a-zA-Z0-9_-]+$/[_0x2ac04c(0x16d)](_0x192a14))throw new Error('Invalid\x20profile\x20name:\x20'+_0x192a14+_0x2ac04c(0x13a));}function validateProfileConfig(_0x45f860,_0x49adb7){const _0x5b0117=a48_0x2a59;if(typeof _0x45f860!=='object'||_0x45f860===null)throw new Error(_0x5b0117(0x151)+_0x49adb7+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0xa1f927=[_0x5b0117(0x140),_0x5b0117(0x155),_0x5b0117(0x14e),_0x5b0117(0x167),_0x5b0117(0x162),_0x5b0117(0x15d)],_0x482c12=_0x45f860;for(const _0x385caa of Object[_0x5b0117(0x14f)](_0x482c12)){!_0xa1f927[_0x5b0117(0x135)](_0x385caa)&&console[_0x5b0117(0x142)](_0x5b0117(0x16f)+_0x49adb7+_0x5b0117(0x122)+_0x385caa+_0x5b0117(0x149));}if(_0x482c12[_0x5b0117(0x140)]!==undefined&&typeof _0x482c12[_0x5b0117(0x140)]!==_0x5b0117(0x163))throw new Error('Profile\x20\x27'+_0x49adb7+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x482c12[_0x5b0117(0x155)]!==undefined&&typeof _0x482c12[_0x5b0117(0x155)]!==_0x5b0117(0x163))throw new Error(_0x5b0117(0x151)+_0x49adb7+_0x5b0117(0x139));if(_0x482c12[_0x5b0117(0x14e)]!==undefined&&typeof _0x482c12[_0x5b0117(0x14e)]!=='string')throw new Error('Profile\x20\x27'+_0x49adb7+_0x5b0117(0x127));if(_0x482c12['parent_segment']!==undefined&&typeof _0x482c12[_0x5b0117(0x167)]!==_0x5b0117(0x163))throw new Error(_0x5b0117(0x151)+_0x49adb7+_0x5b0117(0x150));if(_0x482c12[_0x5b0117(0x162)]!==undefined&&typeof _0x482c12[_0x5b0117(0x162)]!=='string')throw new Error(_0x5b0117(0x151)+_0x49adb7+_0x5b0117(0x13b));if(_0x482c12[_0x5b0117(0x15d)]!==undefined&&typeof _0x482c12['llm_agent']!==_0x5b0117(0x163))throw new Error('Profile\x20\x27'+_0x49adb7+_0x5b0117(0x128));return!![];}function loadProfilesFromTdxJson(_0x4938fd,_0x2bad3c){const _0x527e0f=a48_0x2a59;if(!a48_0xcaeaa6[_0x527e0f(0x15f)](_0x4938fd))return[];try{const _0x65117c=a48_0xcaeaa6[_0x527e0f(0x156)](_0x4938fd,'utf-8'),_0xafc659=JSON[_0x527e0f(0x12d)](_0x65117c);if(!_0xafc659[_0x527e0f(0x15b)]||typeof _0xafc659[_0x527e0f(0x15b)]!=='object')return[];const _0x1447e1=[];for(const [_0x3ed8a8,_0x17021e]of Object[_0x527e0f(0x125)](_0xafc659['profiles'])){try{validateProfileConfig(_0x17021e,_0x3ed8a8);const _0x2d0f2b=getNewCredentialPath(_0x3ed8a8),_0x515d45=getOldCredentialPath(_0x3ed8a8),_0x237f1c=a48_0xcaeaa6[_0x527e0f(0x15f)](_0x2d0f2b)||a48_0xcaeaa6[_0x527e0f(0x15f)](_0x515d45);_0x1447e1['push']({'name':_0x3ed8a8,'config':_0x17021e,'metadata':{'name':_0x3ed8a8,'createdAt':new Date()[_0x527e0f(0x144)]()},'hasCredentials':_0x237f1c,'scope':_0x2bad3c});}catch(_0xeb8f1f){_0xeb8f1f instanceof Error&&(console[_0x527e0f(0x142)](_0x527e0f(0x14c)+_0x4938fd+':'),console['warn']('\x20\x20'+_0xeb8f1f['message']+'\x0a'));}}return _0x1447e1;}catch(_0x2d47e9){return _0x2d47e9 instanceof SyntaxError?(console[_0x527e0f(0x142)](_0x527e0f(0x12e)+_0x4938fd+_0x527e0f(0x164)),console[_0x527e0f(0x142)](_0x527e0f(0x130)+_0x2d47e9[_0x527e0f(0x157)]+'\x0a')):console[_0x527e0f(0x142)](_0x527e0f(0x159)+_0x4938fd+':\x20'+_0x2d47e9+'\x0a'),[];}}export function getNewCredentialPath(_0x28030c){const _0x5dc169=a48_0x2a59;return a48_0x32d0c6[_0x5dc169(0x15e)](getConfigDir(),_0x5dc169(0x132)+_0x28030c);}function getOldCredentialPath(_0x34a741){const _0xf46c7f=a48_0x2a59;return a48_0x32d0c6[_0xf46c7f(0x15e)](getProfilesDir(),_0x34a741,'.env');}function loadProfilesFromTdxJsonFiles(){const _0x2bce02=a48_0x2a59,_0x41c63d=[],_0x291628=findProjectConfigPath();_0x291628&&_0x41c63d[_0x2bce02(0x154)](...loadProfilesFromTdxJson(_0x291628,'local'));const _0x35fd7a=a48_0x32d0c6[_0x2bce02(0x15e)](getConfigDir(),'tdx.json');return _0x41c63d[_0x2bce02(0x154)](...loadProfilesFromTdxJson(_0x35fd7a,_0x2bce02(0x12a))),_0x41c63d;}function loadProfilesFromDirectories(){const _0x233f2a=a48_0x2a59,_0x40ba1f=getProfilesDir();if(!a48_0xcaeaa6[_0x233f2a(0x15f)](_0x40ba1f))return[];try{return a48_0xcaeaa6[_0x233f2a(0x166)](_0x40ba1f,{'withFileTypes':!![]})[_0x233f2a(0x15a)](_0x275090=>_0x275090[_0x233f2a(0x141)]())[_0x233f2a(0x152)](_0x495d07=>_0x495d07[_0x233f2a(0x169)])[_0x233f2a(0x15a)](_0x49f829=>{const _0x28df03=_0x233f2a,_0x4fa7a8=getProfileConfigPath(_0x49f829),_0x4470c1=getProfileEnvPath(_0x49f829);return a48_0xcaeaa6[_0x28df03(0x15f)](_0x4fa7a8)||a48_0xcaeaa6[_0x28df03(0x15f)](_0x4470c1);})['map'](_0x36cd13=>{const _0x4c316f=_0x233f2a,_0x5c46a7=loadProfileFromDirectory(_0x36cd13);if(_0x5c46a7)return{..._0x5c46a7,'scope':_0x4c316f(0x16b)};return null;})[_0x233f2a(0x15a)](_0x5e2a3a=>_0x5e2a3a!==null);}catch{return[];}}function loadProfileFromDirectory(_0x7b522b){const _0x23db9a=a48_0x2a59,_0x7569d2=getProfileConfigPath(_0x7b522b),_0x2a8ac7=getOldCredentialPath(_0x7b522b);if(!a48_0xcaeaa6[_0x23db9a(0x15f)](_0x7569d2)&&!a48_0xcaeaa6[_0x23db9a(0x15f)](_0x2a8ac7))return null;let _0x4f1b97={},_0x156c06={'name':_0x7b522b,'createdAt':new Date()[_0x23db9a(0x144)]()};if(a48_0xcaeaa6[_0x23db9a(0x15f)](_0x7569d2))try{const _0x3dc826=a48_0xcaeaa6[_0x23db9a(0x156)](_0x7569d2,'utf-8'),_0x24c222=JSON['parse'](_0x3dc826),{metadata:_0x249d1a,..._0x527ad7}=_0x24c222;_0x4f1b97=_0x527ad7,_0x249d1a&&(_0x156c06=_0x249d1a);}catch{}return{'name':_0x7b522b,'config':_0x4f1b97,'metadata':_0x156c06,'hasCredentials':a48_0xcaeaa6['existsSync'](_0x2a8ac7),'scope':'directory'};}export function listProfiles(){const _0x33a8d1=a48_0x2a59,_0x34d90e=loadProfilesFromTdxJsonFiles(),_0x193676=loadProfilesFromDirectories();if(_0x193676['length']>0x0){const _0x3d24d1=_0x193676[_0x33a8d1(0x152)](_0x33c658=>_0x33c658[_0x33a8d1(0x169)])[_0x33a8d1(0x15e)](',\x20'),_0x4992db=getConfigDir();console[_0x33a8d1(0x142)](_0x33a8d1(0x131)+_0x3d24d1),console['warn'](_0x33a8d1(0x121)),console['warn'](_0x33a8d1(0x15c)+a48_0x32d0c6[_0x33a8d1(0x15e)](_0x4992db,'tdx.json')),console[_0x33a8d1(0x142)](_0x33a8d1(0x133)),console['warn']('\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a');}const _0x20cf3e=[..._0x34d90e,..._0x193676],_0x2c4b3a=new Map();for(const _0x4439cb of _0x20cf3e){!_0x2c4b3a[_0x33a8d1(0x145)](_0x4439cb[_0x33a8d1(0x169)])&&_0x2c4b3a[_0x33a8d1(0x146)](_0x4439cb[_0x33a8d1(0x169)],_0x4439cb);}return Array[_0x33a8d1(0x16a)](_0x2c4b3a[_0x33a8d1(0x137)]())[_0x33a8d1(0x124)]((_0x4b49bb,_0x1d9933)=>_0x4b49bb[_0x33a8d1(0x169)][_0x33a8d1(0x136)](_0x1d9933[_0x33a8d1(0x169)]));}export function profileExists(_0x2ab076){const _0x332307=a48_0x2a59,_0x3a3150=listProfiles();return _0x3a3150[_0x332307(0x158)](_0x544bed=>_0x544bed['name']===_0x2ab076);}export function loadProfile(_0x2c1f15){validateProfileName(_0x2c1f15);const _0x32c2c=listProfiles(),_0x29031f=_0x32c2c['find'](_0x2f111c=>_0x2f111c['name']===_0x2c1f15);return _0x29031f||null;}export function saveProfile(_0x93e36f,_0x57e709,_0x11e41f=![]){saveProfileToUserConfig(_0x93e36f,_0x57e709);}export function deleteProfile(_0xfd07f5){const _0x1a8972=a48_0x2a59;validateProfileName(_0xfd07f5);const _0x1af982=getProfileDir(_0xfd07f5);if(!a48_0xcaeaa6[_0x1a8972(0x15f)](_0x1af982))throw new Error(_0x1a8972(0x153)+_0xfd07f5+_0x1a8972(0x12f));a48_0xcaeaa6[_0x1a8972(0x161)](_0x1af982,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x9583d3,_0x55f75d){const _0x1a82d3=a48_0x2a59;validateProfileName(_0x9583d3);const _0x336c25=getGlobalConfigPath(),_0x177392=getConfigDir();!a48_0xcaeaa6[_0x1a82d3(0x15f)](_0x177392)&&createSecureDirectory(_0x177392);let _0x46aeee={};if(a48_0xcaeaa6[_0x1a82d3(0x15f)](_0x336c25))try{const _0x31d57d=a48_0xcaeaa6[_0x1a82d3(0x156)](_0x336c25,_0x1a82d3(0x13f));_0x46aeee=JSON['parse'](_0x31d57d);}catch{console[_0x1a82d3(0x142)](_0x1a82d3(0x16c)+_0x336c25+',\x20creating\x20new\x20file');}!_0x46aeee[_0x1a82d3(0x15b)]&&(_0x46aeee[_0x1a82d3(0x15b)]={}),_0x46aeee[_0x1a82d3(0x15b)][_0x9583d3]=_0x55f75d,writeSecureFile(_0x336c25,JSON[_0x1a82d3(0x147)](_0x46aeee,null,0x2));}export function removeProfileFromUserConfig(_0x68c2b7){const _0x33491f=a48_0x2a59;validateProfileName(_0x68c2b7);const _0x8867=getGlobalConfigPath();if(!a48_0xcaeaa6[_0x33491f(0x15f)](_0x8867))throw new Error(_0x33491f(0x151)+_0x68c2b7+_0x33491f(0x13d));let _0x3eac23={};try{const _0x14de79=a48_0xcaeaa6[_0x33491f(0x156)](_0x8867,_0x33491f(0x13f));_0x3eac23=JSON[_0x33491f(0x12d)](_0x14de79);}catch{throw new Error(_0x33491f(0x160)+_0x8867);}if(!_0x3eac23[_0x33491f(0x15b)]||!_0x3eac23[_0x33491f(0x15b)][_0x68c2b7])throw new Error(_0x33491f(0x151)+_0x68c2b7+_0x33491f(0x13d));delete _0x3eac23[_0x33491f(0x15b)][_0x68c2b7],_0x3eac23[_0x33491f(0x14b)]===_0x68c2b7&&delete _0x3eac23[_0x33491f(0x14b)],writeSecureFile(_0x8867,JSON['stringify'](_0x3eac23,null,0x2));}export function getActiveProfile(){const _0x4ef2f7=a48_0x2a59,_0x212cc6=loadSessionContext();if(_0x212cc6?.[_0x4ef2f7(0x14b)])return _0x212cc6[_0x4ef2f7(0x14b)];if(process['env'][_0x4ef2f7(0x123)])return process['env'][_0x4ef2f7(0x123)];const _0x265062=getGlobalConfigPath();if(!a48_0xcaeaa6[_0x4ef2f7(0x15f)](_0x265062))return null;try{const _0x4ee49e=a48_0xcaeaa6[_0x4ef2f7(0x156)](_0x265062,_0x4ef2f7(0x13f)),_0x245e93=JSON[_0x4ef2f7(0x12d)](_0x4ee49e);return _0x245e93[_0x4ef2f7(0x14b)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x28ecd8){const _0x2d6ccd=a48_0x2a59,_0x4bd589=getGlobalConfigPath(),_0x681749=getConfigDir();!a48_0xcaeaa6[_0x2d6ccd(0x15f)](_0x681749)&&createSecureDirectory(_0x681749);let _0x20b41d={};if(a48_0xcaeaa6[_0x2d6ccd(0x15f)](_0x4bd589))try{const _0x2602d1=a48_0xcaeaa6[_0x2d6ccd(0x156)](_0x4bd589,'utf-8');_0x20b41d=JSON['parse'](_0x2602d1);}catch{console[_0x2d6ccd(0x142)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x4bd589+',\x20creating\x20new\x20file');}_0x20b41d['site']=_0x28ecd8,writeSecureFile(_0x4bd589,JSON['stringify'](_0x20b41d,null,0x2));}export function saveActiveProfileToUserConfig(_0x33fdf5){const _0xa2b0ef=a48_0x2a59;validateProfileName(_0x33fdf5);const _0x3ad104=getGlobalConfigPath(),_0x156c22=getConfigDir();!a48_0xcaeaa6['existsSync'](_0x156c22)&&createSecureDirectory(_0x156c22);let _0x2391fd={};if(a48_0xcaeaa6[_0xa2b0ef(0x15f)](_0x3ad104))try{const _0x5543f3=a48_0xcaeaa6[_0xa2b0ef(0x156)](_0x3ad104,'utf-8');_0x2391fd=JSON[_0xa2b0ef(0x12d)](_0x5543f3);}catch{console[_0xa2b0ef(0x142)](_0xa2b0ef(0x16c)+_0x3ad104+',\x20creating\x20new\x20file');}_0x2391fd[_0xa2b0ef(0x14b)]=_0x33fdf5,writeSecureFile(_0x3ad104,JSON[_0xa2b0ef(0x147)](_0x2391fd,null,0x2));}function clearFieldFromUserConfig(_0x4faa11){const _0x286b79=a48_0x2a59,_0x10f6db=getGlobalConfigPath();if(!a48_0xcaeaa6[_0x286b79(0x15f)](_0x10f6db))return;let _0xff20a2={};try{const _0x40de35=a48_0xcaeaa6[_0x286b79(0x156)](_0x10f6db,'utf-8');_0xff20a2=JSON[_0x286b79(0x12d)](_0x40de35);}catch{return;}delete _0xff20a2[_0x4faa11],writeSecureFile(_0x10f6db,JSON[_0x286b79(0x147)](_0xff20a2,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x3d047a=a48_0x2a59;clearFieldFromUserConfig(_0x3d047a(0x155));}export function clearActiveProfileFromUserConfig(){const _0x181261=a48_0x2a59;clearFieldFromUserConfig(_0x181261(0x14b));}export function createProfile(_0x386f94,_0x3aa367){const _0x52282e=a48_0x2a59;validateProfileName(_0x386f94);if(profileExists(_0x386f94))throw new Error(_0x52282e(0x153)+_0x386f94+'\x20already\x20exists');saveProfile(_0x386f94,_0x3aa367);}export function saveProfileCredentials(_0x1e6586,_0x2ce376){const _0x39ea9f=a48_0x2a59;validateProfileName(_0x1e6586);if(!profileExists(_0x1e6586))throw new Error(_0x39ea9f(0x153)+_0x1e6586+_0x39ea9f(0x12f));const _0x104285=getNewCredentialPath(_0x1e6586);writeSecureFile(_0x104285,_0x2ce376);}export function loadProfileCredentials(_0xd71bca){const _0x165699=a48_0x2a59;validateProfileName(_0xd71bca);const _0x254eb0=getNewCredentialPath(_0xd71bca);if(a48_0xcaeaa6[_0x165699(0x15f)](_0x254eb0))try{return a48_0xcaeaa6['readFileSync'](_0x254eb0,_0x165699(0x13f));}catch{}const _0xbbfb9a=getOldCredentialPath(_0xd71bca);if(a48_0xcaeaa6[_0x165699(0x15f)](_0xbbfb9a)){console[_0x165699(0x142)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0xd71bca+'\x27'),console[_0x165699(0x142)](_0x165699(0x13e)),console['warn'](_0x165699(0x168)+_0xbbfb9a+_0x165699(0x165)+_0x254eb0+'\x22'),console[_0x165699(0x142)](_0x165699(0x143));try{return a48_0xcaeaa6[_0x165699(0x156)](_0xbbfb9a,_0x165699(0x13f));}catch{return null;}}return null;}function a48_0x5d7f(){const _0x20bc77=['site','readFileSync','message','some','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','filter','profiles','\x20\x201.\x20Edit:\x20','llm_agent','join','existsSync','Failed\x20to\x20parse\x20','rmSync','llm_project','string',':\x20Invalid\x20JSON\x20syntax','\x22\x20\x22','readdirSync','parent_segment','\x20\x20mv\x20\x22','name','from','directory','Warning:\x20Failed\x20to\x20parse\x20','test','275121KYBnsp','Warning:\x20Profile\x20\x27','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','\x27:\x20unknown\x20config\x20key\x20\x27','TDX_PROFILE','sort','entries','.env','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','793188LNzJHW','user','1745rQzlXC','8729538BVbxDN','parse','\x0aWarning:\x20Failed\x20to\x20parse\x20','\x20does\x20not\x20exist','Error:\x20','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','.env.','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','1802274GnnrKB','includes','localeCompare','values','tdx.json','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','112wOScDk','\x27\x20not\x20found\x20in\x20user\x20configuration','To\x20migrate:','utf-8','description','isDirectory','warn','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','toISOString','has','set','stringify','738905bvKZrJ','\x27\x20will\x20be\x20ignored','31584492WOkrlh','profile','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','4404UPTZgC','database','keys','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','Profile\x20\x27','map','Profile\x20','push'];a48_0x5d7f=function(){return _0x20bc77;};return a48_0x5d7f();}
1
+ (function(_0x9ee0fc,_0x208d32){const _0x495670=a48_0x5614,_0x5f500b=_0x9ee0fc();while(!![]){try{const _0x53914a=-parseInt(_0x495670(0x1e2))/0x1+parseInt(_0x495670(0x22a))/0x2+parseInt(_0x495670(0x1ef))/0x3*(parseInt(_0x495670(0x210))/0x4)+parseInt(_0x495670(0x228))/0x5+-parseInt(_0x495670(0x1e9))/0x6*(-parseInt(_0x495670(0x203))/0x7)+parseInt(_0x495670(0x212))/0x8+-parseInt(_0x495670(0x200))/0x9;if(_0x53914a===_0x208d32)break;else _0x5f500b['push'](_0x5f500b['shift']());}catch(_0x18668e){_0x5f500b['push'](_0x5f500b['shift']());}}}(a48_0x1dc3,0xb44e9));import*as a48_0x30f2f0 from'node:fs';import*as a48_0x41671b from'node:path';function a48_0x5614(_0x112fb6,_0x106db8){_0x112fb6=_0x112fb6-0x1e1;const _0x1dc383=a48_0x1dc3();let _0x5614c7=_0x1dc383[_0x112fb6];return _0x5614c7;}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(_0x46fa6b){const _0x1d11a2=a48_0x5614,_0x492a93={};if(!_0x46fa6b)return _0x492a93;for(const [_0x28371e,_0x43ae00]of Object['entries'](_0x46fa6b)){_0x28371e!==_0x1d11a2(0x207)&&_0x43ae00!==undefined&&(_0x492a93[_0x28371e]=_0x43ae00);}return _0x492a93;}export function getProfilesDir(){const _0x37b868=a48_0x5614;return a48_0x41671b[_0x37b868(0x21b)](getConfigDir(),_0x37b868(0x1f7));}function getProfileDir(_0x3351a7){const _0x55a992=a48_0x5614;return a48_0x41671b[_0x55a992(0x21b)](getProfilesDir(),_0x3351a7);}function getProfileConfigPath(_0x6ea5d6){const _0x123b35=a48_0x5614;return a48_0x41671b[_0x123b35(0x21b)](getProfileDir(_0x6ea5d6),'tdx.json');}function getProfileEnvPath(_0x26f8c9){const _0x550b76=a48_0x5614;return a48_0x41671b[_0x550b76(0x21b)](getProfileDir(_0x26f8c9),_0x550b76(0x1fe));}function getGlobalConfigPath(){const _0x276619=a48_0x5614;return a48_0x41671b[_0x276619(0x21b)](getConfigDir(),_0x276619(0x1e1));}function validateProfileName(_0x501f15){const _0x1c8210=a48_0x5614;if(!/^[a-zA-Z0-9_-]+$/['test'](_0x501f15))throw new Error(_0x1c8210(0x1e8)+_0x501f15+_0x1c8210(0x218));}function validateProfileConfig(_0x535d80,_0xc5ddc2){const _0x3ce2b8=a48_0x5614;if(typeof _0x535d80!=='object'||_0x535d80===null)throw new Error('Profile\x20\x27'+_0xc5ddc2+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0x3f699f=[_0x3ce2b8(0x207),'site',_0x3ce2b8(0x215),_0x3ce2b8(0x20c),_0x3ce2b8(0x20f),_0x3ce2b8(0x211)],_0x387cbf=_0x535d80;for(const _0x156a07 of Object['keys'](_0x387cbf)){!_0x3f699f[_0x3ce2b8(0x1eb)](_0x156a07)&&console[_0x3ce2b8(0x1f2)](_0x3ce2b8(0x21f)+_0xc5ddc2+_0x3ce2b8(0x1e3)+_0x156a07+_0x3ce2b8(0x1e4));}if(_0x387cbf[_0x3ce2b8(0x207)]!==undefined&&typeof _0x387cbf[_0x3ce2b8(0x207)]!==_0x3ce2b8(0x217))throw new Error(_0x3ce2b8(0x1ed)+_0xc5ddc2+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x387cbf['site']!==undefined&&typeof _0x387cbf[_0x3ce2b8(0x22b)]!==_0x3ce2b8(0x217))throw new Error(_0x3ce2b8(0x1ed)+_0xc5ddc2+_0x3ce2b8(0x1ff));if(_0x387cbf[_0x3ce2b8(0x215)]!==undefined&&typeof _0x387cbf[_0x3ce2b8(0x215)]!=='string')throw new Error(_0x3ce2b8(0x1ed)+_0xc5ddc2+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x387cbf['parent_segment']!==undefined&&typeof _0x387cbf['parent_segment']!==_0x3ce2b8(0x217))throw new Error('Profile\x20\x27'+_0xc5ddc2+_0x3ce2b8(0x1ec));if(_0x387cbf[_0x3ce2b8(0x20f)]!==undefined&&typeof _0x387cbf['llm_project']!==_0x3ce2b8(0x217))throw new Error(_0x3ce2b8(0x1ed)+_0xc5ddc2+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x387cbf[_0x3ce2b8(0x211)]!==undefined&&typeof _0x387cbf[_0x3ce2b8(0x211)]!=='string')throw new Error(_0x3ce2b8(0x1ed)+_0xc5ddc2+_0x3ce2b8(0x225));return!![];}function loadProfilesFromTdxJson(_0x1e4be4,_0x37f8be){const _0x59b109=a48_0x5614;if(!a48_0x30f2f0[_0x59b109(0x1f5)](_0x1e4be4))return[];try{const _0x2787a0=a48_0x30f2f0[_0x59b109(0x1fb)](_0x1e4be4,'utf-8'),_0x31a6ba=JSON[_0x59b109(0x1f4)](_0x2787a0);if(!_0x31a6ba[_0x59b109(0x1f7)]||typeof _0x31a6ba[_0x59b109(0x1f7)]!=='object')return[];const _0x25d2fe=[];for(const [_0x2c94da,_0x58968f]of Object[_0x59b109(0x229)](_0x31a6ba[_0x59b109(0x1f7)])){try{validateProfileConfig(_0x58968f,_0x2c94da);const _0xf35579=getNewCredentialPath(_0x2c94da),_0x17dc26=getOldCredentialPath(_0x2c94da),_0x422e14=a48_0x30f2f0[_0x59b109(0x1f5)](_0xf35579)||a48_0x30f2f0[_0x59b109(0x1f5)](_0x17dc26);_0x25d2fe[_0x59b109(0x220)]({'name':_0x2c94da,'config':_0x58968f,'metadata':{'name':_0x2c94da,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x422e14,'scope':_0x37f8be});}catch(_0x55eec3){_0x55eec3 instanceof Error&&(console[_0x59b109(0x1f2)](_0x59b109(0x1fd)+_0x1e4be4+':'),console[_0x59b109(0x1f2)]('\x20\x20'+_0x55eec3[_0x59b109(0x222)]+'\x0a'));}}return _0x25d2fe;}catch(_0xeab82d){return _0xeab82d instanceof SyntaxError?(console[_0x59b109(0x1f2)](_0x59b109(0x1fa)+_0x1e4be4+_0x59b109(0x213)),console[_0x59b109(0x1f2)](_0x59b109(0x1e7)+_0xeab82d[_0x59b109(0x222)]+'\x0a')):console['warn']('\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20'+_0x1e4be4+':\x20'+_0xeab82d+'\x0a'),[];}}export function getNewCredentialPath(_0x42619e){const _0x74f893=a48_0x5614;return a48_0x41671b['join'](getConfigDir(),_0x74f893(0x20a)+_0x42619e);}function getOldCredentialPath(_0x5c2e29){const _0x48efc0=a48_0x5614;return a48_0x41671b[_0x48efc0(0x21b)](getProfilesDir(),_0x5c2e29,_0x48efc0(0x1fe));}function loadProfilesFromTdxJsonFiles(){const _0x2b33c5=a48_0x5614,_0x28e3f7=[],_0x5ce859=findProjectConfigPath();_0x5ce859&&_0x28e3f7[_0x2b33c5(0x220)](...loadProfilesFromTdxJson(_0x5ce859,_0x2b33c5(0x1e5)));const _0x4d9174=a48_0x41671b[_0x2b33c5(0x21b)](getConfigDir(),_0x2b33c5(0x1e1));return _0x28e3f7['push'](...loadProfilesFromTdxJson(_0x4d9174,_0x2b33c5(0x1f8))),_0x28e3f7;}function loadProfilesFromDirectories(){const _0x1cbfe5=a48_0x5614,_0x3faa55=getProfilesDir();if(!a48_0x30f2f0[_0x1cbfe5(0x1f5)](_0x3faa55))return[];try{return a48_0x30f2f0[_0x1cbfe5(0x227)](_0x3faa55,{'withFileTypes':!![]})[_0x1cbfe5(0x21c)](_0xce2600=>_0xce2600['isDirectory']())[_0x1cbfe5(0x20e)](_0x11cffb=>_0x11cffb[_0x1cbfe5(0x1e6)])[_0x1cbfe5(0x21c)](_0x207731=>{const _0xeba66b=_0x1cbfe5,_0x564679=getProfileConfigPath(_0x207731),_0x890e1a=getProfileEnvPath(_0x207731);return a48_0x30f2f0[_0xeba66b(0x1f5)](_0x564679)||a48_0x30f2f0['existsSync'](_0x890e1a);})[_0x1cbfe5(0x20e)](_0x120fc4=>{const _0x7ca6b4=_0x1cbfe5,_0x587c87=loadProfileFromDirectory(_0x120fc4);if(_0x587c87)return{..._0x587c87,'scope':_0x7ca6b4(0x1f1)};return null;})[_0x1cbfe5(0x21c)](_0x560259=>_0x560259!==null);}catch{return[];}}function loadProfileFromDirectory(_0x5ecbcc){const _0x5f4d12=a48_0x5614,_0x11fe0f=getProfileConfigPath(_0x5ecbcc),_0x5d36e1=getOldCredentialPath(_0x5ecbcc);if(!a48_0x30f2f0[_0x5f4d12(0x1f5)](_0x11fe0f)&&!a48_0x30f2f0[_0x5f4d12(0x1f5)](_0x5d36e1))return null;let _0x3ed513={},_0x7cb92e={'name':_0x5ecbcc,'createdAt':new Date()[_0x5f4d12(0x208)]()};if(a48_0x30f2f0['existsSync'](_0x11fe0f))try{const _0x28a615=a48_0x30f2f0[_0x5f4d12(0x1fb)](_0x11fe0f,_0x5f4d12(0x204)),_0x4002e3=JSON[_0x5f4d12(0x1f4)](_0x28a615),{metadata:_0x2bc0d5,..._0x537d71}=_0x4002e3;_0x3ed513=_0x537d71,_0x2bc0d5&&(_0x7cb92e=_0x2bc0d5);}catch{}return{'name':_0x5ecbcc,'config':_0x3ed513,'metadata':_0x7cb92e,'hasCredentials':a48_0x30f2f0[_0x5f4d12(0x1f5)](_0x5d36e1),'scope':'directory'};}export function listProfiles(){const _0x361269=a48_0x5614,_0x2124fa=loadProfilesFromTdxJsonFiles(),_0x30133b=loadProfilesFromDirectories();if(_0x30133b['length']>0x0){const _0x2ff7c0=_0x30133b[_0x361269(0x20e)](_0x199a55=>_0x199a55[_0x361269(0x1e6)])[_0x361269(0x21b)](',\x20'),_0x35269c=getConfigDir();console[_0x361269(0x1f2)](_0x361269(0x219)+_0x2ff7c0),console['warn']('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console[_0x361269(0x1f2)]('\x20\x201.\x20Edit:\x20'+a48_0x41671b[_0x361269(0x21b)](_0x35269c,'tdx.json')),console[_0x361269(0x1f2)](_0x361269(0x21d)),console[_0x361269(0x1f2)](_0x361269(0x209));}const _0x5d4aad=[..._0x2124fa,..._0x30133b],_0x42326e=new Map();for(const _0x8db16c of _0x5d4aad){!_0x42326e['has'](_0x8db16c[_0x361269(0x1e6)])&&_0x42326e[_0x361269(0x201)](_0x8db16c['name'],_0x8db16c);}return Array['from'](_0x42326e['values']())[_0x361269(0x223)]((_0x45630b,_0x47c48f)=>_0x45630b['name'][_0x361269(0x1ea)](_0x47c48f[_0x361269(0x1e6)]));}export function profileExists(_0x33d436){const _0xf44983=a48_0x5614,_0x41628=listProfiles();return _0x41628[_0xf44983(0x1f6)](_0x4e30c8=>_0x4e30c8['name']===_0x33d436);}export function loadProfile(_0x4e38ca){const _0x1a3b95=a48_0x5614;validateProfileName(_0x4e38ca);const _0x5120b8=listProfiles(),_0x8384d1=_0x5120b8[_0x1a3b95(0x206)](_0x5281fa=>_0x5281fa[_0x1a3b95(0x1e6)]===_0x4e38ca);return _0x8384d1||null;}export function saveProfile(_0xc0ae36,_0x5571b0,_0x321a66=![]){saveProfileToUserConfig(_0xc0ae36,_0x5571b0);}export function deleteProfile(_0x144770){const _0x42b900=a48_0x5614;validateProfileName(_0x144770);const _0x548301=getProfileDir(_0x144770);if(!a48_0x30f2f0['existsSync'](_0x548301))throw new Error('Profile\x20'+_0x144770+'\x20does\x20not\x20exist');a48_0x30f2f0[_0x42b900(0x216)](_0x548301,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x28ded9,_0x40ffd5){const _0x4d7207=a48_0x5614;validateProfileName(_0x28ded9);const _0xfab6e2=getGlobalConfigPath(),_0x2ce792=getConfigDir();!a48_0x30f2f0[_0x4d7207(0x1f5)](_0x2ce792)&&createSecureDirectory(_0x2ce792);let _0x59d244={};if(a48_0x30f2f0[_0x4d7207(0x1f5)](_0xfab6e2))try{const _0x26db81=a48_0x30f2f0[_0x4d7207(0x1fb)](_0xfab6e2,_0x4d7207(0x204));_0x59d244=JSON[_0x4d7207(0x1f4)](_0x26db81);}catch{console[_0x4d7207(0x1f2)]('Warning:\x20Failed\x20to\x20parse\x20'+_0xfab6e2+',\x20creating\x20new\x20file');}!_0x59d244[_0x4d7207(0x1f7)]&&(_0x59d244[_0x4d7207(0x1f7)]={}),_0x59d244[_0x4d7207(0x1f7)][_0x28ded9]=_0x40ffd5,writeSecureFile(_0xfab6e2,JSON['stringify'](_0x59d244,null,0x2));}export function removeProfileFromUserConfig(_0x4ef9a9){const _0x2b52ee=a48_0x5614;validateProfileName(_0x4ef9a9);const _0x54d681=getGlobalConfigPath();if(!a48_0x30f2f0[_0x2b52ee(0x1f5)](_0x54d681))throw new Error(_0x2b52ee(0x1ed)+_0x4ef9a9+_0x2b52ee(0x224));let _0x7dfa17={};try{const _0x14383b=a48_0x30f2f0[_0x2b52ee(0x1fb)](_0x54d681,_0x2b52ee(0x204));_0x7dfa17=JSON['parse'](_0x14383b);}catch{throw new Error(_0x2b52ee(0x221)+_0x54d681);}if(!_0x7dfa17[_0x2b52ee(0x1f7)]||!_0x7dfa17['profiles'][_0x4ef9a9])throw new Error(_0x2b52ee(0x1ed)+_0x4ef9a9+_0x2b52ee(0x224));delete _0x7dfa17['profiles'][_0x4ef9a9],_0x7dfa17[_0x2b52ee(0x226)]===_0x4ef9a9&&delete _0x7dfa17['profile'],writeSecureFile(_0x54d681,JSON[_0x2b52ee(0x22c)](_0x7dfa17,null,0x2));}export function getActiveProfile(){const _0x5d88d5=a48_0x5614,_0x5acb02=loadSessionContext();if(_0x5acb02?.['profile'])return _0x5acb02['profile'];if(process[_0x5d88d5(0x1f0)][_0x5d88d5(0x21e)])return process[_0x5d88d5(0x1f0)]['TDX_PROFILE'];const _0x213755=getGlobalConfigPath();if(!a48_0x30f2f0[_0x5d88d5(0x1f5)](_0x213755))return null;try{const _0x41bf78=a48_0x30f2f0['readFileSync'](_0x213755,_0x5d88d5(0x204)),_0x43a9c8=JSON[_0x5d88d5(0x1f4)](_0x41bf78);return _0x43a9c8['profile']||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x5237ab){const _0x215851=a48_0x5614,_0x5bc166=getGlobalConfigPath(),_0x9397b8=getConfigDir();!a48_0x30f2f0[_0x215851(0x1f5)](_0x9397b8)&&createSecureDirectory(_0x9397b8);let _0x5f536a={};if(a48_0x30f2f0[_0x215851(0x1f5)](_0x5bc166))try{const _0x133bbd=a48_0x30f2f0[_0x215851(0x1fb)](_0x5bc166,_0x215851(0x204));_0x5f536a=JSON[_0x215851(0x1f4)](_0x133bbd);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x5bc166+',\x20creating\x20new\x20file');}_0x5f536a[_0x215851(0x22b)]=_0x5237ab,writeSecureFile(_0x5bc166,JSON[_0x215851(0x22c)](_0x5f536a,null,0x2));}export function saveActiveProfileToUserConfig(_0x3d8e46){const _0x21d971=a48_0x5614;validateProfileName(_0x3d8e46);const _0x161355=getGlobalConfigPath(),_0x220e2b=getConfigDir();!a48_0x30f2f0[_0x21d971(0x1f5)](_0x220e2b)&&createSecureDirectory(_0x220e2b);let _0x52b2ed={};if(a48_0x30f2f0[_0x21d971(0x1f5)](_0x161355))try{const _0x1f580a=a48_0x30f2f0[_0x21d971(0x1fb)](_0x161355,_0x21d971(0x204));_0x52b2ed=JSON[_0x21d971(0x1f4)](_0x1f580a);}catch{console[_0x21d971(0x1f2)](_0x21d971(0x205)+_0x161355+_0x21d971(0x20d));}_0x52b2ed[_0x21d971(0x226)]=_0x3d8e46,writeSecureFile(_0x161355,JSON['stringify'](_0x52b2ed,null,0x2));}function a48_0x1dc3(){const _0x3b20e1=['\x0aWarning:\x20Failed\x20to\x20parse\x20','readFileSync','\x20does\x20not\x20exist','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','.env','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','10524276hLGzvZ','set','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','201495wkhFQO','utf-8','Warning:\x20Failed\x20to\x20parse\x20','find','description','toISOString','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','.env.','To\x20migrate:','parent_segment',',\x20creating\x20new\x20file','map','llm_project','860424YcNIqO','llm_agent','7504016wNQrQL',':\x20Invalid\x20JSON\x20syntax','Profile\x20','database','rmSync','string','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore.','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x22\x20\x22','join','filter','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','TDX_PROFILE','Warning:\x20Profile\x20\x27','push','Failed\x20to\x20parse\x20','message','sort','\x27\x20not\x20found\x20in\x20user\x20configuration','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','profile','readdirSync','4839280dcpDLY','entries','437636JLXtQI','site','stringify','tdx.json','934837nbkMpp','\x27:\x20unknown\x20config\x20key\x20\x27','\x27\x20will\x20be\x20ignored','local','name','Error:\x20','Invalid\x20profile\x20name:\x20','60TfIExZ','localeCompare','includes','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','Profile\x20\x27','\x20already\x20exists','6CgStXK','env','directory','warn','\x20\x20mv\x20\x22','parse','existsSync','some','profiles','user','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a'];a48_0x1dc3=function(){return _0x3b20e1;};return a48_0x1dc3();}function clearFieldFromUserConfig(_0x10475b){const _0x4dfee1=a48_0x5614,_0x3e6be6=getGlobalConfigPath();if(!a48_0x30f2f0[_0x4dfee1(0x1f5)](_0x3e6be6))return;let _0x197180={};try{const _0x46b67f=a48_0x30f2f0[_0x4dfee1(0x1fb)](_0x3e6be6,_0x4dfee1(0x204));_0x197180=JSON[_0x4dfee1(0x1f4)](_0x46b67f);}catch{return;}delete _0x197180[_0x10475b],writeSecureFile(_0x3e6be6,JSON[_0x4dfee1(0x22c)](_0x197180,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x2d4122=a48_0x5614;clearFieldFromUserConfig(_0x2d4122(0x22b));}export function clearActiveProfileFromUserConfig(){const _0x4afe30=a48_0x5614;clearFieldFromUserConfig(_0x4afe30(0x226));}export function createProfile(_0x14615a,_0x188168){const _0x554a9f=a48_0x5614;validateProfileName(_0x14615a);if(profileExists(_0x14615a))throw new Error(_0x554a9f(0x214)+_0x14615a+_0x554a9f(0x1ee));saveProfile(_0x14615a,_0x188168);}export function saveProfileCredentials(_0x244a81,_0x36d37d){const _0x16fc09=a48_0x5614;validateProfileName(_0x244a81);if(!profileExists(_0x244a81))throw new Error(_0x16fc09(0x214)+_0x244a81+_0x16fc09(0x1fc));const _0xea57e2=getNewCredentialPath(_0x244a81);writeSecureFile(_0xea57e2,_0x36d37d);}export function loadProfileCredentials(_0x33b3bd){const _0x4462e6=a48_0x5614;validateProfileName(_0x33b3bd);const _0x561597=getNewCredentialPath(_0x33b3bd);if(a48_0x30f2f0[_0x4462e6(0x1f5)](_0x561597))try{return a48_0x30f2f0['readFileSync'](_0x561597,'utf-8');}catch{}const _0x3aa96f=getOldCredentialPath(_0x33b3bd);if(a48_0x30f2f0[_0x4462e6(0x1f5)](_0x3aa96f)){console['warn'](_0x4462e6(0x202)+_0x33b3bd+'\x27'),console['warn'](_0x4462e6(0x20b)),console[_0x4462e6(0x1f2)](_0x4462e6(0x1f3)+_0x3aa96f+_0x4462e6(0x21a)+_0x561597+'\x22'),console[_0x4462e6(0x1f2)](_0x4462e6(0x1f9));try{return a48_0x30f2f0[_0x4462e6(0x1fb)](_0x3aa96f,_0x4462e6(0x204));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a49_0x1ce469=a49_0x6965;(function(_0x477a64,_0xb83f6){const _0x13c183=a49_0x6965,_0x2e0a24=_0x477a64();while(!![]){try{const _0x35db17=-parseInt(_0x13c183(0x1b0))/0x1+parseInt(_0x13c183(0x1c2))/0x2*(parseInt(_0x13c183(0x1c8))/0x3)+-parseInt(_0x13c183(0x1af))/0x4*(-parseInt(_0x13c183(0x1be))/0x5)+parseInt(_0x13c183(0x1b5))/0x6+-parseInt(_0x13c183(0x1cc))/0x7+-parseInt(_0x13c183(0x1bc))/0x8*(parseInt(_0x13c183(0x1ac))/0x9)+parseInt(_0x13c183(0x1b8))/0xa;if(_0x35db17===_0xb83f6)break;else _0x2e0a24['push'](_0x2e0a24['shift']());}catch(_0x11e11d){_0x2e0a24['push'](_0x2e0a24['shift']());}}}(a49_0x35c8,0x2f10e));import*as a49_0x54906c from'node:fs';function a49_0x6965(_0x52a9c7,_0x159388){_0x52a9c7=_0x52a9c7-0x1ac;const _0x35c8c2=a49_0x35c8();let _0x6965f4=_0x35c8c2[_0x52a9c7];return _0x6965f4;}import*as a49_0x205b95 from'node:path';const PROJECT_CONFIG_FILENAME=a49_0x1ce469(0x1bb);export function findProjectConfigPath(_0x256f6b){const _0x121929=a49_0x1ce469;let _0x1d98fd=_0x256f6b||process['cwd']();while(!![]){const _0x5569ed=a49_0x205b95[_0x121929(0x1c0)](_0x1d98fd,PROJECT_CONFIG_FILENAME);if(a49_0x54906c['existsSync'](_0x5569ed))return _0x5569ed;const _0x9e8fc4=a49_0x205b95[_0x121929(0x1ad)](_0x1d98fd);if(_0x9e8fc4===_0x1d98fd)return null;_0x1d98fd=_0x9e8fc4;}}export function loadProjectConfig(_0xc6e7fe){const _0x58c615=a49_0x1ce469,_0x13a697=findProjectConfigPath(_0xc6e7fe);if(!_0x13a697)return null;try{const _0x3bb042=a49_0x54906c[_0x58c615(0x1b9)](_0x13a697,_0x58c615(0x1b7)),_0x1338d0=JSON['parse'](_0x3bb042),_0x4de8b8=JSON[_0x58c615(0x1b2)](_0x1338d0);if(_0x4de8b8['includes'](_0x58c615(0x1bd))||_0x4de8b8[_0x58c615(0x1b3)](_0x58c615(0x1cb))||_0x4de8b8[_0x58c615(0x1b3)](_0x58c615(0x1b1)))throw new Error(_0x58c615(0x1c6)+_0x13a697+_0x58c615(0x1c5)+_0x58c615(0x1c1));const {metadata:_0x1ab13b,profile:_0x25a4a6,..._0x240cd1}=_0x1338d0;return _0x25a4a6&&console[_0x58c615(0x1b6)](_0x58c615(0x1ca)+_0x13a697+_0x58c615(0x1ba)+_0x58c615(0x1bf)),_0x240cd1;}catch(_0x20547){if(_0x20547 instanceof Error&&_0x58c615(0x1ae)in _0x20547&&_0x20547['code']==='ENOENT')return null;throw new Error(_0x58c615(0x1c4)+_0x13a697+':\x20'+_0x20547);}}export function saveProjectConfig(_0x42e1b1,_0x38363b){const _0x1450ef=a49_0x1ce469,_0x5b7969=_0x38363b||process[_0x1450ef(0x1c3)](),_0x2562e7=a49_0x205b95['join'](_0x5b7969,PROJECT_CONFIG_FILENAME),_0x50a928=JSON[_0x1450ef(0x1b2)](_0x42e1b1);if(_0x50a928['includes'](_0x1450ef(0x1bd))||_0x50a928['includes'](_0x1450ef(0x1cb))||_0x50a928[_0x1450ef(0x1b3)](_0x1450ef(0x1b1)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x1450ef(0x1c9)in _0x42e1b1)throw new Error(_0x1450ef(0x1b4));a49_0x54906c[_0x1450ef(0x1c7)](_0x2562e7,JSON['stringify'](_0x42e1b1,null,0x2));}function a49_0x35c8(){const _0x23d748=['Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','join','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','10SofWsA','cwd','Failed\x20to\x20load\x20project\x20config\x20from\x20',').\x20','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','writeFileSync','32853NpfToN','profile','Warning:\x20\x27profile\x27\x20field\x20in\x20','apiKey','38094adWqpH','80010SuTOar','dirname','code','66644yOOiiq','357757DDUUkP','api_key','stringify','includes','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','458310QqLYGB','warn','utf-8','5838040IfSSln','readFileSync','\x20is\x20ignored.\x20','tdx.json','248lTSNUF','TD_API_KEY','35oHpJfj'];a49_0x35c8=function(){return _0x23d748;};return a49_0x35c8();}export function hasProjectConfig(_0x225083){return findProjectConfigPath(_0x225083)!==null;}export function getProjectRoot(_0x41a7ab){const _0x1c1481=a49_0x1ce469,_0xa74695=findProjectConfigPath(_0x41a7ab);return _0xa74695?a49_0x205b95[_0x1c1481(0x1ad)](_0xa74695):null;}
1
+ const a49_0x2fa591=a49_0x513c;(function(_0x23ef58,_0x18f1a8){const _0xbba221=a49_0x513c,_0x4c16c2=_0x23ef58();while(!![]){try{const _0x5bd380=parseInt(_0xbba221(0x198))/0x1*(parseInt(_0xbba221(0x18d))/0x2)+parseInt(_0xbba221(0x1a4))/0x3*(parseInt(_0xbba221(0x18c))/0x4)+-parseInt(_0xbba221(0x196))/0x5+-parseInt(_0xbba221(0x18f))/0x6+-parseInt(_0xbba221(0x18a))/0x7*(parseInt(_0xbba221(0x19e))/0x8)+-parseInt(_0xbba221(0x195))/0x9*(-parseInt(_0xbba221(0x186))/0xa)+-parseInt(_0xbba221(0x192))/0xb*(parseInt(_0xbba221(0x197))/0xc);if(_0x5bd380===_0x18f1a8)break;else _0x4c16c2['push'](_0x4c16c2['shift']());}catch(_0x20fba0){_0x4c16c2['push'](_0x4c16c2['shift']());}}}(a49_0x475f,0x865e0));import*as a49_0x2f3f26 from'node:fs';import*as a49_0x179ccc from'node:path';function a49_0x475f(){const _0x28af95=['Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','code','join','722472mEfUPL','\x20is\x20ignored.\x20','utf-8','includes','readFileSync','ENOENT','162093BdXrGW','270bFABYW',').\x20','tdx.json','Failed\x20to\x20load\x20project\x20config\x20from\x20','7ZiUwHR','cwd','76haJNEy','12wgoCJv','dirname','4616316UWFFTe','Warning:\x20\x27profile\x27\x20field\x20in\x20','writeFileSync','55UeDonZ','apiKey','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','313929FZQpPZ','970500CUstHB','1088196nPOeXd','14867SgsMPX','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','TD_API_KEY'];a49_0x475f=function(){return _0x28af95;};return a49_0x475f();}const PROJECT_CONFIG_FILENAME=a49_0x2fa591(0x188);export function findProjectConfigPath(_0x19fa78){const _0x43a780=a49_0x2fa591;let _0x4ca427=_0x19fa78||process['cwd']();while(!![]){const _0x3d276d=a49_0x179ccc[_0x43a780(0x19d)](_0x4ca427,PROJECT_CONFIG_FILENAME);if(a49_0x2f3f26['existsSync'](_0x3d276d))return _0x3d276d;const _0x162e20=a49_0x179ccc[_0x43a780(0x18e)](_0x4ca427);if(_0x162e20===_0x4ca427)return null;_0x4ca427=_0x162e20;}}function a49_0x513c(_0x1310ce,_0x34a348){_0x1310ce=_0x1310ce-0x186;const _0x475fe1=a49_0x475f();let _0x513cbd=_0x475fe1[_0x1310ce];return _0x513cbd;}export function loadProjectConfig(_0x48e8d1){const _0x22b9de=a49_0x2fa591,_0x3ca48f=findProjectConfigPath(_0x48e8d1);if(!_0x3ca48f)return null;try{const _0x4a20fb=a49_0x2f3f26[_0x22b9de(0x1a2)](_0x3ca48f,_0x22b9de(0x1a0)),_0x108fca=JSON['parse'](_0x4a20fb),_0x95b1af=JSON['stringify'](_0x108fca);if(_0x95b1af['includes'](_0x22b9de(0x19a))||_0x95b1af['includes']('apiKey')||_0x95b1af['includes']('api_key'))throw new Error(_0x22b9de(0x19b)+_0x3ca48f+_0x22b9de(0x187)+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x2dff63,profile:_0x37569f,..._0x25aa47}=_0x108fca;return _0x37569f&&console['warn'](_0x22b9de(0x190)+_0x3ca48f+_0x22b9de(0x19f)+_0x22b9de(0x199)),_0x25aa47;}catch(_0x3937b7){if(_0x3937b7 instanceof Error&&'code'in _0x3937b7&&_0x3937b7[_0x22b9de(0x19c)]===_0x22b9de(0x1a3))return null;throw new Error(_0x22b9de(0x189)+_0x3ca48f+':\x20'+_0x3937b7);}}export function saveProjectConfig(_0x292caf,_0x470cb1){const _0x184c1e=a49_0x2fa591,_0x17fb12=_0x470cb1||process[_0x184c1e(0x18b)](),_0x58e8ff=a49_0x179ccc[_0x184c1e(0x19d)](_0x17fb12,PROJECT_CONFIG_FILENAME),_0x29f1bf=JSON['stringify'](_0x292caf);if(_0x29f1bf[_0x184c1e(0x1a1)](_0x184c1e(0x19a))||_0x29f1bf['includes'](_0x184c1e(0x193))||_0x29f1bf[_0x184c1e(0x1a1)]('api_key'))throw new Error(_0x184c1e(0x194));if('profile'in _0x292caf)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a49_0x2f3f26[_0x184c1e(0x191)](_0x58e8ff,JSON['stringify'](_0x292caf,null,0x2));}export function hasProjectConfig(_0x5bc8a5){return findProjectConfigPath(_0x5bc8a5)!==null;}export function getProjectRoot(_0x4c6caf){const _0x1799e2=findProjectConfigPath(_0x4c6caf);return _0x1799e2?a49_0x179ccc['dirname'](_0x1799e2):null;}
@@ -1 +1 @@
1
- (function(_0x49a9a7,_0x16ea5c){const _0x51b65e=a50_0x35c6,_0x8c6d20=_0x49a9a7();while(!![]){try{const _0x3eca99=-parseInt(_0x51b65e(0xb3))/0x1*(parseInt(_0x51b65e(0xca))/0x2)+-parseInt(_0x51b65e(0xc6))/0x3*(parseInt(_0x51b65e(0xae))/0x4)+-parseInt(_0x51b65e(0x9d))/0x5*(-parseInt(_0x51b65e(0xcb))/0x6)+-parseInt(_0x51b65e(0xa6))/0x7*(-parseInt(_0x51b65e(0xc8))/0x8)+-parseInt(_0x51b65e(0xbe))/0x9*(parseInt(_0x51b65e(0xb4))/0xa)+parseInt(_0x51b65e(0xac))/0xb*(parseInt(_0x51b65e(0xbb))/0xc)+parseInt(_0x51b65e(0xa0))/0xd*(parseInt(_0x51b65e(0xa1))/0xe);if(_0x3eca99===_0x16ea5c)break;else _0x8c6d20['push'](_0x8c6d20['shift']());}catch(_0x2c9866){_0x8c6d20['push'](_0x8c6d20['shift']());}}}(a50_0x1dcd,0x65f96));import*as a50_0xea8b14 from'node:fs';import*as a50_0xa8b604 from'node:path';function a50_0x35c6(_0x8a952d,_0x5c3da2){_0x8a952d=_0x8a952d-0x9d;const _0x1dcd21=a50_0x1dcd();let _0x35c6a8=_0x1dcd21[_0x8a952d];return _0x35c6a8;}import*as a50_0x1db173 from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x163eda=a50_0x35c6,_0x158ba6=process[_0x163eda(0xc9)][_0x163eda(0x9f)]||a50_0xa8b604[_0x163eda(0xb2)](a50_0x1db173[_0x163eda(0xb6)](),_0x163eda(0xb9),_0x163eda(0xb8));return a50_0xa8b604[_0x163eda(0xb2)](_0x158ba6,_0x163eda(0xab));}function getSessionPath(_0x490d01){const _0x3a3a4b=a50_0x35c6;return a50_0xa8b604[_0x3a3a4b(0xb2)](getSessionsDir(),_0x490d01+_0x3a3a4b(0xaf));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x266764){const _0x3167e8=a50_0x35c6;if(_0x266764)return _0x266764;return getCurrentSessionPID()[_0x3167e8(0xa2)]();}export function loadSessionContext(_0x22bf48){const _0x99803f=a50_0x35c6,_0x57d6e8=_0x22bf48||getCurrentSessionPID()[_0x99803f(0xa2)](),_0x4ae994=/^\d+$/[_0x99803f(0xad)](_0x57d6e8)?parseInt(_0x57d6e8,0xa):null;return _0x4ae994!==null?loadSessionContextByPID(_0x4ae994):loadSessionContextByString(_0x57d6e8);}export function loadSessionContextByPID(_0x4245e9){const _0x259ade=a50_0x35c6,_0x11dd78=getSessionPath(_0x4245e9);if(!a50_0xea8b14[_0x259ade(0xa7)](_0x11dd78))return null;try{const _0x446646=a50_0xea8b14[_0x259ade(0xb1)](_0x11dd78,_0x259ade(0xbc)),_0x44e463=JSON['parse'](_0x446646),_0x150377=new Date(_0x44e463[_0x259ade(0xbf)])[_0x259ade(0xc2)](),_0x485622=Date['now']();if(_0x485622-_0x150377>SESSION_EXPIRATION_MS)return a50_0xea8b14[_0x259ade(0xc5)](_0x11dd78),null;const _0x571c06=JSON[_0x259ade(0xbd)](_0x44e463);if(_0x571c06['includes'](_0x259ade(0xc4))||_0x571c06[_0x259ade(0xcc)](_0x259ade(0xaa))||_0x571c06[_0x259ade(0xcc)]('api_key'))return console['warn'](_0x259ade(0xc0)+_0x11dd78+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a50_0xea8b14['unlinkSync'](_0x11dd78),null;return _0x44e463;}catch{try{a50_0xea8b14['unlinkSync'](_0x11dd78);}catch{}return null;}}function loadSessionContextByString(_0x532c97){const _0x3a6c48=a50_0x35c6,_0x3bbccd=a50_0xa8b604['join'](getSessionsDir(),_0x532c97+_0x3a6c48(0xaf));if(!a50_0xea8b14[_0x3a6c48(0xa7)](_0x3bbccd))return null;try{const _0xdc1f83=a50_0xea8b14[_0x3a6c48(0xb1)](_0x3bbccd,_0x3a6c48(0xbc)),_0x3b2174=JSON[_0x3a6c48(0xc7)](_0xdc1f83),_0x5f3326=new Date(_0x3b2174[_0x3a6c48(0xbf)])[_0x3a6c48(0xc2)](),_0x3f4e2b=Date[_0x3a6c48(0x9e)]();if(_0x3f4e2b-_0x5f3326>SESSION_EXPIRATION_MS)return a50_0xea8b14['unlinkSync'](_0x3bbccd),null;const _0x8967b7=JSON[_0x3a6c48(0xbd)](_0x3b2174);if(_0x8967b7[_0x3a6c48(0xcc)](_0x3a6c48(0xc4))||_0x8967b7['includes'](_0x3a6c48(0xaa))||_0x8967b7[_0x3a6c48(0xcc)](_0x3a6c48(0xc1)))return console[_0x3a6c48(0xa9)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x3bbccd+_0x3a6c48(0xc3)),a50_0xea8b14['unlinkSync'](_0x3bbccd),null;return _0x3b2174;}catch{try{a50_0xea8b14['unlinkSync'](_0x3bbccd);}catch{}return null;}}export function saveSessionContext(_0x5b96e7,_0x1a20d3){const _0x518e5e=a50_0x35c6,_0x5125b6=_0x1a20d3||getCurrentSessionPID()['toString'](),_0x458729=/^\d+$/['test'](_0x5125b6)?parseInt(_0x5125b6,0xa):getCurrentSessionPID(),_0x50e0b6=a50_0xa8b604['join'](getSessionsDir(),_0x5125b6+_0x518e5e(0xaf)),_0x2b200b=getSessionsDir();createSecureDirectory(_0x2b200b);const _0x3651dd=JSON['stringify'](_0x5b96e7);if(_0x3651dd[_0x518e5e(0xcc)](_0x518e5e(0xc4))||_0x3651dd[_0x518e5e(0xcc)]('apiKey')||_0x3651dd[_0x518e5e(0xcc)](_0x518e5e(0xc1)))throw new Error(_0x518e5e(0xb7));let _0x236d5e;const _0x417e6e=/^\d+$/['test'](_0x5125b6)?loadSessionContextByPID(parseInt(_0x5125b6,0xa)):loadSessionContextByString(_0x5125b6);_0x417e6e?_0x236d5e={..._0x417e6e,..._0x5b96e7,'pid':_0x458729,'sessionId':_0x5125b6!==_0x458729[_0x518e5e(0xa2)]()?_0x5125b6:undefined,'updatedAt':new Date()[_0x518e5e(0xa5)]()}:_0x236d5e={'pid':_0x458729,'sessionId':_0x5125b6!==_0x458729[_0x518e5e(0xa2)]()?_0x5125b6:undefined,..._0x5b96e7,'createdAt':new Date()[_0x518e5e(0xa5)](),'updatedAt':new Date()[_0x518e5e(0xa5)]()},a50_0xea8b14[_0x518e5e(0xba)](_0x50e0b6,JSON[_0x518e5e(0xbd)](_0x236d5e,null,0x2));}export function clearSessionContext(_0x22dcbb){const _0x43ed00=a50_0x35c6,_0x1f0724=_0x22dcbb||getCurrentSessionPID()[_0x43ed00(0xa2)](),_0xe15ace=a50_0xa8b604[_0x43ed00(0xb2)](getSessionsDir(),_0x1f0724+_0x43ed00(0xaf));a50_0xea8b14['existsSync'](_0xe15ace)&&a50_0xea8b14['unlinkSync'](_0xe15ace);}export function clearSessionContextField(_0x55ee26,_0x2b83b6){const _0x4f2df2=a50_0x35c6,_0x14ba34=_0x2b83b6||getCurrentSessionPID()[_0x4f2df2(0xa2)](),_0x483ff5=a50_0xa8b604['join'](getSessionsDir(),_0x14ba34+'.json');if(!a50_0xea8b14[_0x4f2df2(0xa7)](_0x483ff5))return;try{const _0x99bbc1=a50_0xea8b14[_0x4f2df2(0xb1)](_0x483ff5,'utf-8'),_0x12f1ab=JSON['parse'](_0x99bbc1);delete _0x12f1ab[_0x55ee26],a50_0xea8b14[_0x4f2df2(0xba)](_0x483ff5,JSON['stringify'](_0x12f1ab,null,0x2));}catch{}}function a50_0x1dcd(){const _0x4481ca=['getTime','.\x20This\x20is\x20insecure.\x20Removing\x20session.','TD_API_KEY','unlinkSync','309qyFBRi','parse','1157720wcRrBn','env','2pXqWdv','42LusmbG','includes','461870CBZnDA','now','TDX_CONFIG_DIR','1157ByAFIY','37254WIgNkr','toString','push','replace','toISOString','28JOzeOB','existsSync','sort','warn','apiKey','sessions','154egAgYg','test','13460QcrtWy','.json','readdirSync','readFileSync','join','811477gmbccx','42950VANSRS','endsWith','homedir','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','tdx','.config','writeFileSync','675228Hkagcc','utf-8','stringify','1413cxhSYl','createdAt','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','api_key'];a50_0x1dcd=function(){return _0x4481ca;};return a50_0x1dcd();}export function cleanExpiredSessions(){const _0x1af476=a50_0x35c6,_0x3b30ec=getSessionsDir();if(!a50_0xea8b14[_0x1af476(0xa7)](_0x3b30ec))return 0x0;let _0x2ef26f=0x0;const _0x248b07=Date[_0x1af476(0x9e)]();try{const _0x30c3cd=a50_0xea8b14[_0x1af476(0xb0)](_0x3b30ec);for(const _0x278129 of _0x30c3cd){if(!_0x278129[_0x1af476(0xb5)](_0x1af476(0xaf)))continue;const _0x26c234=a50_0xa8b604['join'](_0x3b30ec,_0x278129),_0x474de1=_0x278129[_0x1af476(0xa4)](_0x1af476(0xaf),''),_0x4312f8=parseInt(_0x474de1,0xa),_0x1b3f3d=!isNaN(_0x4312f8);if(_0x1b3f3d){if(!isProcessRunning(_0x4312f8)){a50_0xea8b14['unlinkSync'](_0x26c234),_0x2ef26f++;continue;}}try{const _0x6216d=a50_0xea8b14['readFileSync'](_0x26c234,'utf-8'),_0x4aad3b=JSON['parse'](_0x6216d),_0x983db2=new Date(_0x4aad3b[_0x1af476(0xbf)])[_0x1af476(0xc2)]();_0x248b07-_0x983db2>SESSION_EXPIRATION_MS&&(a50_0xea8b14[_0x1af476(0xc5)](_0x26c234),_0x2ef26f++);}catch{a50_0xea8b14['unlinkSync'](_0x26c234),_0x2ef26f++;}}}catch{}return _0x2ef26f;}export function listActiveSessions(){const _0x4a93cd=a50_0x35c6,_0x2e2507=getSessionsDir();if(!a50_0xea8b14['existsSync'](_0x2e2507))return[];try{const _0x328a68=a50_0xea8b14[_0x4a93cd(0xb0)](_0x2e2507),_0x5bdfba=[];for(const _0xaf08b5 of _0x328a68){if(!_0xaf08b5[_0x4a93cd(0xb5)](_0x4a93cd(0xaf)))continue;const _0x5d2502=_0xaf08b5[_0x4a93cd(0xa4)](_0x4a93cd(0xaf),''),_0x11ba04=parseInt(_0x5d2502,0xa);!isNaN(_0x11ba04)&&isProcessRunning(_0x11ba04)&&_0x5bdfba[_0x4a93cd(0xa3)](_0x11ba04);}return _0x5bdfba[_0x4a93cd(0xa8)]((_0x36d620,_0x2824e6)=>_0x36d620-_0x2824e6);}catch{return[];}}
1
+ function a50_0x4a96(){const _0x4708c0=['existsSync','now','api_key','116ovjRIv','push','TDX_CONFIG_DIR','4977324xvygCX','parse','6BKpzql','7186940CNPbxb','13421695CatHid','replace','unlinkSync','join','tdx','toString','4259sWchaW','createdAt','5683704jjAPcv','includes','32935941NfsfYr','TD_API_KEY','.\x20This\x20is\x20insecure.\x20Removing\x20session.','endsWith','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','sessions','.json','readFileSync','toISOString','warn','sort','8064065MCxfPr','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','test','.config','utf-8','env','stringify','readdirSync','apiKey'];a50_0x4a96=function(){return _0x4708c0;};return a50_0x4a96();}function a50_0x3c81(_0x156938,_0x2c41df){_0x156938=_0x156938-0x188;const _0x4a9654=a50_0x4a96();let _0x3c8136=_0x4a9654[_0x156938];return _0x3c8136;}(function(_0x13a379,_0x3b4325){const _0x575f09=a50_0x3c81,_0x21cabf=_0x13a379();while(!![]){try{const _0x37c9a6=-parseInt(_0x575f09(0x1af))/0x1*(-parseInt(_0x575f09(0x1a2))/0x2)+-parseInt(_0x575f09(0x1a5))/0x3+parseInt(_0x575f09(0x1a8))/0x4+parseInt(_0x575f09(0x196))/0x5*(parseInt(_0x575f09(0x1a7))/0x6)+parseInt(_0x575f09(0x1a9))/0x7+parseInt(_0x575f09(0x189))/0x8+-parseInt(_0x575f09(0x18b))/0x9;if(_0x37c9a6===_0x3b4325)break;else _0x21cabf['push'](_0x21cabf['shift']());}catch(_0x1c6c86){_0x21cabf['push'](_0x21cabf['shift']());}}}(a50_0x4a96,0xebc81));import*as a50_0x2aadff from'node:fs';import*as a50_0x6abcd0 from'node:path';import*as a50_0x5d7fdf 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 _0x1ce382=a50_0x3c81,_0x12d965=process[_0x1ce382(0x19b)][_0x1ce382(0x1a4)]||a50_0x6abcd0['join'](a50_0x5d7fdf['homedir'](),_0x1ce382(0x199),_0x1ce382(0x1ad));return a50_0x6abcd0[_0x1ce382(0x1ac)](_0x12d965,_0x1ce382(0x190));}function getSessionPath(_0x50b952){const _0x5b36b7=a50_0x3c81;return a50_0x6abcd0['join'](getSessionsDir(),_0x50b952+_0x5b36b7(0x191));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x136cb0){const _0x223fe4=a50_0x3c81;if(_0x136cb0)return _0x136cb0;return getCurrentSessionPID()[_0x223fe4(0x1ae)]();}export function loadSessionContext(_0x33cd84){const _0x48ca04=a50_0x3c81,_0x2656d0=_0x33cd84||getCurrentSessionPID()[_0x48ca04(0x1ae)](),_0x4f938d=/^\d+$/[_0x48ca04(0x198)](_0x2656d0)?parseInt(_0x2656d0,0xa):null;return _0x4f938d!==null?loadSessionContextByPID(_0x4f938d):loadSessionContextByString(_0x2656d0);}export function loadSessionContextByPID(_0x455966){const _0x27a073=a50_0x3c81,_0x483ccf=getSessionPath(_0x455966);if(!a50_0x2aadff[_0x27a073(0x19f)](_0x483ccf))return null;try{const _0x1b7205=a50_0x2aadff[_0x27a073(0x192)](_0x483ccf,'utf-8'),_0x53e9dd=JSON['parse'](_0x1b7205),_0x3765e7=new Date(_0x53e9dd[_0x27a073(0x188)])['getTime'](),_0x5b0ad1=Date[_0x27a073(0x1a0)]();if(_0x5b0ad1-_0x3765e7>SESSION_EXPIRATION_MS)return a50_0x2aadff[_0x27a073(0x1ab)](_0x483ccf),null;const _0x35708f=JSON['stringify'](_0x53e9dd);if(_0x35708f[_0x27a073(0x18a)]('TD_API_KEY')||_0x35708f[_0x27a073(0x18a)](_0x27a073(0x19e))||_0x35708f[_0x27a073(0x18a)](_0x27a073(0x1a1)))return console['warn'](_0x27a073(0x18f)+_0x483ccf+_0x27a073(0x18d)),a50_0x2aadff[_0x27a073(0x1ab)](_0x483ccf),null;return _0x53e9dd;}catch{try{a50_0x2aadff[_0x27a073(0x1ab)](_0x483ccf);}catch{}return null;}}function loadSessionContextByString(_0x35c27c){const _0x2ec248=a50_0x3c81,_0xadcfb8=a50_0x6abcd0[_0x2ec248(0x1ac)](getSessionsDir(),_0x35c27c+'.json');if(!a50_0x2aadff[_0x2ec248(0x19f)](_0xadcfb8))return null;try{const _0x52c621=a50_0x2aadff[_0x2ec248(0x192)](_0xadcfb8,_0x2ec248(0x19a)),_0x18f165=JSON['parse'](_0x52c621),_0x4afc51=new Date(_0x18f165[_0x2ec248(0x188)])['getTime'](),_0xe498c7=Date['now']();if(_0xe498c7-_0x4afc51>SESSION_EXPIRATION_MS)return a50_0x2aadff['unlinkSync'](_0xadcfb8),null;const _0x386892=JSON[_0x2ec248(0x19c)](_0x18f165);if(_0x386892[_0x2ec248(0x18a)]('TD_API_KEY')||_0x386892[_0x2ec248(0x18a)](_0x2ec248(0x19e))||_0x386892[_0x2ec248(0x18a)](_0x2ec248(0x1a1)))return console[_0x2ec248(0x194)](_0x2ec248(0x18f)+_0xadcfb8+_0x2ec248(0x18d)),a50_0x2aadff[_0x2ec248(0x1ab)](_0xadcfb8),null;return _0x18f165;}catch{try{a50_0x2aadff[_0x2ec248(0x1ab)](_0xadcfb8);}catch{}return null;}}export function saveSessionContext(_0x3bf473,_0x39ccd9){const _0x15bcf4=a50_0x3c81,_0x348c29=_0x39ccd9||getCurrentSessionPID()['toString'](),_0xe85204=/^\d+$/['test'](_0x348c29)?parseInt(_0x348c29,0xa):getCurrentSessionPID(),_0x29a721=a50_0x6abcd0[_0x15bcf4(0x1ac)](getSessionsDir(),_0x348c29+'.json'),_0x3c336f=getSessionsDir();createSecureDirectory(_0x3c336f);const _0x5009bd=JSON[_0x15bcf4(0x19c)](_0x3bf473);if(_0x5009bd[_0x15bcf4(0x18a)](_0x15bcf4(0x18c))||_0x5009bd[_0x15bcf4(0x18a)](_0x15bcf4(0x19e))||_0x5009bd[_0x15bcf4(0x18a)](_0x15bcf4(0x1a1)))throw new Error(_0x15bcf4(0x197));let _0x50cf94;const _0x5ae84b=/^\d+$/[_0x15bcf4(0x198)](_0x348c29)?loadSessionContextByPID(parseInt(_0x348c29,0xa)):loadSessionContextByString(_0x348c29);_0x5ae84b?_0x50cf94={..._0x5ae84b,..._0x3bf473,'pid':_0xe85204,'sessionId':_0x348c29!==_0xe85204['toString']()?_0x348c29:undefined,'updatedAt':new Date()['toISOString']()}:_0x50cf94={'pid':_0xe85204,'sessionId':_0x348c29!==_0xe85204[_0x15bcf4(0x1ae)]()?_0x348c29:undefined,..._0x3bf473,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0x15bcf4(0x193)]()},a50_0x2aadff['writeFileSync'](_0x29a721,JSON[_0x15bcf4(0x19c)](_0x50cf94,null,0x2));}export function clearSessionContext(_0x5d9cd9){const _0x57ef6a=a50_0x3c81,_0xde9d78=_0x5d9cd9||getCurrentSessionPID()['toString'](),_0x333495=a50_0x6abcd0[_0x57ef6a(0x1ac)](getSessionsDir(),_0xde9d78+_0x57ef6a(0x191));a50_0x2aadff[_0x57ef6a(0x19f)](_0x333495)&&a50_0x2aadff[_0x57ef6a(0x1ab)](_0x333495);}export function clearSessionContextField(_0x3fc51d,_0x5d9357){const _0x1ba5e4=a50_0x3c81,_0x20a6e9=_0x5d9357||getCurrentSessionPID()[_0x1ba5e4(0x1ae)](),_0x296b17=a50_0x6abcd0[_0x1ba5e4(0x1ac)](getSessionsDir(),_0x20a6e9+_0x1ba5e4(0x191));if(!a50_0x2aadff[_0x1ba5e4(0x19f)](_0x296b17))return;try{const _0x542e68=a50_0x2aadff['readFileSync'](_0x296b17,'utf-8'),_0x246f9d=JSON[_0x1ba5e4(0x1a6)](_0x542e68);delete _0x246f9d[_0x3fc51d],a50_0x2aadff['writeFileSync'](_0x296b17,JSON['stringify'](_0x246f9d,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x24c978=a50_0x3c81,_0xda9ac3=getSessionsDir();if(!a50_0x2aadff[_0x24c978(0x19f)](_0xda9ac3))return 0x0;let _0x479aba=0x0;const _0xe90964=Date[_0x24c978(0x1a0)]();try{const _0xd7ffb9=a50_0x2aadff[_0x24c978(0x19d)](_0xda9ac3);for(const _0xd94673 of _0xd7ffb9){if(!_0xd94673[_0x24c978(0x18e)](_0x24c978(0x191)))continue;const _0x19ab64=a50_0x6abcd0[_0x24c978(0x1ac)](_0xda9ac3,_0xd94673),_0x33ef0b=_0xd94673[_0x24c978(0x1aa)](_0x24c978(0x191),''),_0x8ccc63=parseInt(_0x33ef0b,0xa),_0x2487ae=!isNaN(_0x8ccc63);if(_0x2487ae){if(!isProcessRunning(_0x8ccc63)){a50_0x2aadff['unlinkSync'](_0x19ab64),_0x479aba++;continue;}}try{const _0xe641cd=a50_0x2aadff[_0x24c978(0x192)](_0x19ab64,_0x24c978(0x19a)),_0x344c88=JSON[_0x24c978(0x1a6)](_0xe641cd),_0x3e1ac5=new Date(_0x344c88[_0x24c978(0x188)])['getTime']();_0xe90964-_0x3e1ac5>SESSION_EXPIRATION_MS&&(a50_0x2aadff[_0x24c978(0x1ab)](_0x19ab64),_0x479aba++);}catch{a50_0x2aadff[_0x24c978(0x1ab)](_0x19ab64),_0x479aba++;}}}catch{}return _0x479aba;}export function listActiveSessions(){const _0x4c4906=a50_0x3c81,_0x4f39c2=getSessionsDir();if(!a50_0x2aadff[_0x4c4906(0x19f)](_0x4f39c2))return[];try{const _0x59b3f5=a50_0x2aadff[_0x4c4906(0x19d)](_0x4f39c2),_0x2b944c=[];for(const _0x2a5dcf of _0x59b3f5){if(!_0x2a5dcf[_0x4c4906(0x18e)](_0x4c4906(0x191)))continue;const _0x501f4a=_0x2a5dcf[_0x4c4906(0x1aa)](_0x4c4906(0x191),''),_0x56a0d9=parseInt(_0x501f4a,0xa);!isNaN(_0x56a0d9)&&isProcessRunning(_0x56a0d9)&&_0x2b944c[_0x4c4906(0x1a3)](_0x56a0d9);}return _0x2b944c[_0x4c4906(0x195)]((_0x5f246a,_0x2576c3)=>_0x5f246a-_0x2576c3);}catch{return[];}}
@@ -1 +1 @@
1
- (function(_0x28a39f,_0x41333d){const _0x42c5c0=a51_0x173d,_0x24816b=_0x28a39f();while(!![]){try{const _0x5da1aa=parseInt(_0x42c5c0(0x1f1))/0x1*(parseInt(_0x42c5c0(0x1f5))/0x2)+-parseInt(_0x42c5c0(0x1f8))/0x3+-parseInt(_0x42c5c0(0x1f9))/0x4+parseInt(_0x42c5c0(0x1ee))/0x5*(parseInt(_0x42c5c0(0x1f2))/0x6)+parseInt(_0x42c5c0(0x1fb))/0x7+-parseInt(_0x42c5c0(0x1f0))/0x8*(parseInt(_0x42c5c0(0x1f3))/0x9)+parseInt(_0x42c5c0(0x1fa))/0xa*(parseInt(_0x42c5c0(0x1fd))/0xb);if(_0x5da1aa===_0x41333d)break;else _0x24816b['push'](_0x24816b['shift']());}catch(_0x5a2cea){_0x24816b['push'](_0x24816b['shift']());}}}(a51_0x5a7d,0x68d94));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';function a51_0x173d(_0x1a0b07,_0x1f9c99){_0x1a0b07=_0x1a0b07-0x1ee;const _0x5a7d14=a51_0x5a7d();let _0x173d03=_0x5a7d14[_0x1a0b07];return _0x173d03;}import{getCacheDir}from'./config.js';function getCacheFilePath(_0x5d123d){const _0x24b15c=a51_0x173d,_0x15bd0f=_0x5d123d||_0x24b15c(0x1f7);return join(getCacheDir(),'users-'+_0x15bd0f+_0x24b15c(0x1fc));}export function loadCachedUsers(_0x3db73b){const _0xbee9dc=a51_0x173d,_0x3f0cab=getCacheFilePath(_0x3db73b);if(!existsSync(_0x3f0cab))return null;try{const _0x1a9240=readFileSync(_0x3f0cab,_0xbee9dc(0x1ef)),_0xc4c02d=JSON[_0xbee9dc(0x1f6)](_0x1a9240);return _0xc4c02d['users'];}catch{return null;}}export function saveCachedUsers(_0x152fbd,_0x120cbb){const _0x2671b1=a51_0x173d,_0x4155df=getCacheDir();!existsSync(_0x4155df)&&mkdirSync(_0x4155df,{'recursive':!![]});const _0x4e135b=getCacheFilePath(_0x152fbd),_0x4deceb={'users':_0x120cbb,'cachedAt':Date[_0x2671b1(0x1f4)]()};writeFileSync(_0x4e135b,JSON['stringify'](_0x4deceb,null,0x2),_0x2671b1(0x1ef));}function a51_0x5a7d(){const _0xedcdc3=['parse','default','1480041LWyNyY','2690564YlalHX','430Qnqebs','1697745GAWcCQ','.json','207559UMtRDb','3335blzTEG','utf-8','371144JuePOg','5IaBSLe','6114UXRaHR','36xNoZIz','now','18978iQqDwG'];a51_0x5a7d=function(){return _0xedcdc3;};return a51_0x5a7d();}export function clearUserCache(_0x48f518){const _0x48bc13=getCacheFilePath(_0x48f518);if(existsSync(_0x48bc13))try{unlinkSync(_0x48bc13);}catch{}}
1
+ (function(_0x2dfb33,_0x998514){const _0x123a2d=a51_0x3763,_0x352c8b=_0x2dfb33();while(!![]){try{const _0x115537=-parseInt(_0x123a2d(0xb8))/0x1+-parseInt(_0x123a2d(0xbe))/0x2*(parseInt(_0x123a2d(0xc5))/0x3)+-parseInt(_0x123a2d(0xb9))/0x4+-parseInt(_0x123a2d(0xbd))/0x5*(-parseInt(_0x123a2d(0xc9))/0x6)+parseInt(_0x123a2d(0xc6))/0x7*(-parseInt(_0x123a2d(0xbf))/0x8)+parseInt(_0x123a2d(0xc8))/0x9+-parseInt(_0x123a2d(0xbc))/0xa*(-parseInt(_0x123a2d(0xbb))/0xb);if(_0x115537===_0x998514)break;else _0x352c8b['push'](_0x352c8b['shift']());}catch(_0x45612d){_0x352c8b['push'](_0x352c8b['shift']());}}}(a51_0x11e6,0xc5764));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';function a51_0x11e6(){const _0x37e6a3=['now','users','default','stringify','users-','4281FjAQLw','22407nxOdOI','.json','7488396FRstko','18CJOjUE','utf-8','1339626kuXasR','3897264aiGZFt','parse','12188YaRdUL','38550rldzIr','1454230FLnYVO','1814eNEttM','3896oUVBiT'];a51_0x11e6=function(){return _0x37e6a3;};return a51_0x11e6();}import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x55865c){const _0x5192ef=a51_0x3763,_0x1d03fd=_0x55865c||_0x5192ef(0xc2);return join(getCacheDir(),_0x5192ef(0xc4)+_0x1d03fd+_0x5192ef(0xc7));}export function loadCachedUsers(_0x3fe2ce){const _0x19836c=a51_0x3763,_0x21f301=getCacheFilePath(_0x3fe2ce);if(!existsSync(_0x21f301))return null;try{const _0x89f5=readFileSync(_0x21f301,_0x19836c(0xca)),_0x53352f=JSON[_0x19836c(0xba)](_0x89f5);return _0x53352f[_0x19836c(0xc1)];}catch{return null;}}function a51_0x3763(_0x5cc731,_0x2a0e87){_0x5cc731=_0x5cc731-0xb8;const _0x11e6bd=a51_0x11e6();let _0x37639a=_0x11e6bd[_0x5cc731];return _0x37639a;}export function saveCachedUsers(_0x2cca9b,_0x5ba33f){const _0xc08c30=a51_0x3763,_0x1e02c4=getCacheDir();!existsSync(_0x1e02c4)&&mkdirSync(_0x1e02c4,{'recursive':!![]});const _0x2c85ef=getCacheFilePath(_0x2cca9b),_0x3ddfa0={'users':_0x5ba33f,'cachedAt':Date[_0xc08c30(0xc0)]()};writeFileSync(_0x2c85ef,JSON[_0xc08c30(0xc3)](_0x3ddfa0,null,0x2),_0xc08c30(0xca));}export function clearUserCache(_0x135c27){const _0x27c2f7=getCacheFilePath(_0x135c27);if(existsSync(_0x27c2f7))try{unlinkSync(_0x27c2f7);}catch{}}
@@ -1 +1 @@
1
- function a52_0x43da(){const _0x1ac2d8=['33MMtOkw','5NWWEcK','579ovcDea','utf-8','9076FujwrC','6IKxvzN','4863416bvRGbo','../build-info.json','includes','6529860tdBNzA','1314970gvZnyt','parse','3166226AiIoxD','158144oJGHOq','4950486lOEits','version','0.0.0'];a52_0x43da=function(){return _0x1ac2d8;};return a52_0x43da();}(function(_0x16b6aa,_0x8f2754){const _0x590d58=a52_0x32d9,_0x41a33d=_0x16b6aa();while(!![]){try{const _0x11d6ef=parseInt(_0x590d58(0x178))/0x1*(parseInt(_0x590d58(0x170))/0x2)+-parseInt(_0x590d58(0x16d))/0x3*(parseInt(_0x590d58(0x16f))/0x4)+parseInt(_0x590d58(0x16c))/0x5*(-parseInt(_0x590d58(0x179))/0x6)+-parseInt(_0x590d58(0x177))/0x7+parseInt(_0x590d58(0x171))/0x8+parseInt(_0x590d58(0x174))/0x9+-parseInt(_0x590d58(0x175))/0xa*(-parseInt(_0x590d58(0x16b))/0xb);if(_0x11d6ef===_0x8f2754)break;else _0x41a33d['push'](_0x41a33d['shift']());}catch(_0xdde78f){_0x41a33d['push'](_0x41a33d['shift']());}}}(a52_0x43da,0x76ea2));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x4abaae=a52_0x32d9;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x1545d5=fileURLToPath(import.meta.url),_0x120e20=dirname(_0x1545d5);try{const _0x59ed2d=join(_0x120e20,_0x4abaae(0x172));cachedBuildInfo=JSON[_0x4abaae(0x176)](readFileSync(_0x59ed2d,_0x4abaae(0x16e)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x593398=a52_0x32d9;if(cachedVersion!==null)return cachedVersion;const _0x598146=fileURLToPath(import.meta.url),_0x12c8c3=dirname(_0x598146),_0x1d9945=getBuildInfo();if(_0x1d9945['version'])return cachedVersion=_0x1d9945[_0x593398(0x169)],cachedVersion;try{const _0x20070c=join(_0x12c8c3,'../../package.json'),_0x8712c=JSON[_0x593398(0x176)](readFileSync(_0x20070c,'utf-8'));cachedVersion=_0x8712c['version'];}catch{cachedVersion=_0x593398(0x16a);}return cachedVersion;}function a52_0x32d9(_0x3fefe8,_0x57383e){_0x3fefe8=_0x3fefe8-0x169;const _0x43da71=a52_0x43da();let _0x32d95d=_0x43da71[_0x3fefe8];return _0x32d95d;}export function isDevVersion(){const _0x286fd7=a52_0x32d9,_0x194b80=getVersion();return _0x194b80[_0x286fd7(0x173)]('.dev')||_0x194b80[_0x286fd7(0x173)]('-');}
1
+ (function(_0x3b7b88,_0x3f8012){const _0x536c7e=a52_0x1687,_0x4cacf1=_0x3b7b88();while(!![]){try{const _0x3db57d=-parseInt(_0x536c7e(0x1f7))/0x1+parseInt(_0x536c7e(0x1ea))/0x2+-parseInt(_0x536c7e(0x1f2))/0x3+-parseInt(_0x536c7e(0x1f0))/0x4+-parseInt(_0x536c7e(0x1ed))/0x5+-parseInt(_0x536c7e(0x1f8))/0x6*(parseInt(_0x536c7e(0x1f5))/0x7)+parseInt(_0x536c7e(0x1f1))/0x8;if(_0x3db57d===_0x3f8012)break;else _0x4cacf1['push'](_0x4cacf1['shift']());}catch(_0x3fa03e){_0x4cacf1['push'](_0x4cacf1['shift']());}}}(a52_0x213a,0x28887));import{readFileSync}from'fs';function a52_0x1687(_0x138036,_0x1a1f6b){_0x138036=_0x138036-0x1ea;const _0x213a87=a52_0x213a();let _0x1687c4=_0x213a87[_0x138036];return _0x1687c4;}function a52_0x213a(){const _0x43d3da=['252976JIJiZw','5532360LRoZoG','270186EASvOH','utf-8','0.0.0','1144031mjjyQv','includes','200313StFump','6oSRmpu','parse','323576THlpVy','../build-info.json','.dev','851290ZkTULz','../../package.json','version'];a52_0x213a=function(){return _0x43d3da;};return a52_0x213a();}import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x4d9a4f=a52_0x1687;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x51c7b3=fileURLToPath(import.meta.url),_0x947365=dirname(_0x51c7b3);try{const _0x48f1b9=join(_0x947365,_0x4d9a4f(0x1eb));cachedBuildInfo=JSON['parse'](readFileSync(_0x48f1b9,_0x4d9a4f(0x1f3)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x60920=a52_0x1687;if(cachedVersion!==null)return cachedVersion;const _0x52d450=fileURLToPath(import.meta.url),_0x2d3d28=dirname(_0x52d450),_0x447492=getBuildInfo();if(_0x447492[_0x60920(0x1ef)])return cachedVersion=_0x447492[_0x60920(0x1ef)],cachedVersion;try{const _0x17af3a=join(_0x2d3d28,_0x60920(0x1ee)),_0x42394a=JSON[_0x60920(0x1f9)](readFileSync(_0x17af3a,_0x60920(0x1f3)));cachedVersion=_0x42394a[_0x60920(0x1ef)];}catch{cachedVersion=_0x60920(0x1f4);}return cachedVersion;}export function isDevVersion(){const _0x170bc5=a52_0x1687,_0x46a62a=getVersion();return _0x46a62a['includes'](_0x170bc5(0x1ec))||_0x46a62a[_0x170bc5(0x1f6)]('-');}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0x59f769,_0x5a3f25){var _0x318fa1=a53_0x58a1,_0x2e88cb=_0x59f769();while(!![]){try{var _0x56e660=-parseInt(_0x318fa1(0x86))/0x1+parseInt(_0x318fa1(0x88))/0x2+parseInt(_0x318fa1(0x85))/0x3*(-parseInt(_0x318fa1(0x81))/0x4)+parseInt(_0x318fa1(0x80))/0x5+-parseInt(_0x318fa1(0x87))/0x6+-parseInt(_0x318fa1(0x83))/0x7*(-parseInt(_0x318fa1(0x84))/0x8)+parseInt(_0x318fa1(0x82))/0x9;if(_0x56e660===_0x5a3f25)break;else _0x2e88cb['push'](_0x2e88cb['shift']());}catch(_0x47b827){_0x2e88cb['push'](_0x2e88cb['shift']());}}}(a53_0xb717,0x935fc));export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';function a53_0xb717(){var _0x529c23=['84lWDXBn','6714576uYIANI','63931ZGhHYt','112utPdQS','65361QZObxm','867482eNUXgU','4092138NVrhYL','2249426mCepsF','3060185iKbTVL'];a53_0xb717=function(){return _0x529c23;};return a53_0xb717();}export*from'./sdk/client/td-api-client.js';export{TrinoApiClient}from'./sdk/client/trino-api-client.js';export*from'./sdk/client/rate-limiter.js';export*from'./sdk/types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';export*from'./commands/show.js';export*from'./commands/describe.js';function a53_0x58a1(_0x5d9fc8,_0x18a1da){_0x5d9fc8=_0x5d9fc8-0x80;var _0xb717a2=a53_0xb717();var _0x58a1f2=_0xb717a2[_0x5d9fc8];return _0x58a1f2;}export*from'./sdk/index.js';
1
+ (function(_0x1577f8,_0xcca859){var _0x24053c=a53_0x4e7a,_0x172711=_0x1577f8();while(!![]){try{var _0x1a73a8=-parseInt(_0x24053c(0x120))/0x1*(parseInt(_0x24053c(0x11a))/0x2)+-parseInt(_0x24053c(0x11d))/0x3+parseInt(_0x24053c(0x11c))/0x4*(parseInt(_0x24053c(0x11e))/0x5)+-parseInt(_0x24053c(0x121))/0x6+-parseInt(_0x24053c(0x11f))/0x7*(parseInt(_0x24053c(0x11b))/0x8)+parseInt(_0x24053c(0x119))/0x9+parseInt(_0x24053c(0x117))/0xa*(parseInt(_0x24053c(0x118))/0xb);if(_0x1a73a8===_0xcca859)break;else _0x172711['push'](_0x172711['shift']());}catch(_0x4d3011){_0x172711['push'](_0x172711['shift']());}}}(a53_0x57c8,0x62e46));export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';function a53_0x57c8(){var _0x352a25=['2101YXbKlC','6157278QahpFi','8rZPwds','16cpeWqF','14028AFGELB','589902MPkswu','785ikNkUQ','694554SHoVoA','73943fSQkRd','4606752FOMZML','32930GVAAgF'];a53_0x57c8=function(){return _0x352a25;};return a53_0x57c8();}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';function a53_0x4e7a(_0x4e40c3,_0xecfa64){_0x4e40c3=_0x4e40c3-0x117;var _0x57c821=a53_0x57c8();var _0x4e7a3a=_0x57c821[_0x4e40c3];return _0x4e7a3a;}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';