@treasuredata/tdx 2026.3.13 → 2026.3.14

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 (201) 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/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +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/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x487961=a54_0x2aa0;(function(_0x5238d4,_0x226a84){const _0xa8a5f0=a54_0x2aa0,_0xe32ba4=_0x5238d4();while(!![]){try{const _0x2bb321=-parseInt(_0xa8a5f0(0x153))/0x1*(-parseInt(_0xa8a5f0(0x132))/0x2)+-parseInt(_0xa8a5f0(0x126))/0x3+-parseInt(_0xa8a5f0(0x159))/0x4+-parseInt(_0xa8a5f0(0x128))/0x5*(parseInt(_0xa8a5f0(0x147))/0x6)+parseInt(_0xa8a5f0(0x151))/0x7*(parseInt(_0xa8a5f0(0x13c))/0x8)+-parseInt(_0xa8a5f0(0x155))/0x9+parseInt(_0xa8a5f0(0x13a))/0xa;if(_0x2bb321===_0x226a84)break;else _0xe32ba4['push'](_0xe32ba4['shift']());}catch(_0x4813aa){_0xe32ba4['push'](_0xe32ba4['shift']());}}}(a54_0x101b,0x41fe5));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x35dc5f from'node:fs';import*as a54_0x3d6e3d from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a54_0x154318 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x5cd874=a54_0x2aa0;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x5cd874(0x119),_0x5cd874(0x121));}export function getConfigFile(){const _0x5a6a72=a54_0x2aa0;return join(getConfigDir(),_0x5a6a72(0x146));}export function getConfigFilePath(_0x12b105){const _0x445282=a54_0x2aa0,_0x2783e0=getConfigDir();return _0x12b105?a54_0x3d6e3d['join'](_0x2783e0,_0x445282(0x113)+_0x12b105):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x487961(0x142),a54_0x487961(0x125));export function getLLMProjectCacheFile(_0x393491){const _0xc2127f=a54_0x487961;return llmProjectCache[_0xc2127f(0x122)](_0x393491);}export function readCachedLLMProject(_0x1f17fb){const _0x14bc10=a54_0x487961,_0x2158eb=llmProjectCache[_0x14bc10(0x156)](_0x1f17fb);if(_0x2158eb&&typeof _0x2158eb['id']===_0x14bc10(0x14f)&&typeof _0x2158eb['name']===_0x14bc10(0x14f))return _0x2158eb;return null;}export function writeCachedLLMProject(_0x592388,_0x47cdd8,_0x1903f0){try{llmProjectCache['write']({'name':_0x592388,'id':_0x47cdd8},_0x1903f0);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x487961(0x12c),a54_0x487961(0x136));export function getLLMAgentCacheFile(_0x5d697b){const _0x2d7456=a54_0x487961;return llmAgentCache[_0x2d7456(0x122)](_0x5d697b);}export function readCachedLLMAgent(_0x8cdf91){const _0x57a8b6=a54_0x487961,_0x58e61e=llmAgentCache[_0x57a8b6(0x156)](_0x8cdf91);if(_0x58e61e&&typeof _0x58e61e['id']===_0x57a8b6(0x14f)&&typeof _0x58e61e['name']===_0x57a8b6(0x14f)&&typeof _0x58e61e[_0x57a8b6(0x12e)]==='string')return _0x58e61e;return null;}export function writeCachedLLMAgent(_0x4af354,_0x115805,_0x55af81,_0x5df5da){try{llmAgentCache['write']({'name':_0x4af354,'id':_0x115805,'projectId':_0x55af81},_0x5df5da);}catch{}}export function clearCachedLLMAgent(_0x16e943){const _0x5669b3=a54_0x487961;try{llmAgentCache[_0x5669b3(0x12b)](_0x16e943);}catch{}}const accountInfoCache=createOptionalProfileCache(a54_0x487961(0x137),a54_0x487961(0x110),{'suffix':a54_0x487961(0x13e)});export function getAccountInfoCacheFile(_0x1ce134){const _0x104d51=a54_0x487961;return accountInfoCache[_0x104d51(0x122)](_0x1ce134);}export function readCachedAccountInfo(_0x3e8174){const _0x2253cc=a54_0x487961,_0x1b2500=accountInfoCache[_0x2253cc(0x156)](_0x3e8174);if(_0x1b2500&&typeof _0x1b2500['site']===_0x2253cc(0x14f)&&typeof _0x1b2500[_0x2253cc(0x14d)]===_0x2253cc(0x141))return _0x1b2500;return null;}export function writeCachedAccountInfo(_0x3cc004,_0xa6dd47,_0x24a05b){const _0x5b3377=a54_0x487961;try{accountInfoCache[_0x5b3377(0x14c)]({'site':_0x3cc004,'accountId':_0xa6dd47,'cachedAt':new Date()[_0x5b3377(0x13f)]()},_0x24a05b);}catch{}}export function parseEnvFile(_0x5ce670){const _0x57162e=a54_0x487961,_0xc88d35={};for(const _0x10ef56 of _0x5ce670['split']('\x0a')){const _0x53bd06=_0x10ef56['trim']();if(!_0x53bd06||_0x53bd06[_0x57162e(0x11a)]('#'))continue;const _0x4e1c4b=_0x53bd06[_0x57162e(0x11b)](/^([^=]+)=(.*)$/);if(_0x4e1c4b){const _0x23c9b1=_0x4e1c4b[0x1][_0x57162e(0x144)]();let _0x36cf3d=_0x4e1c4b[0x2][_0x57162e(0x144)]();(_0x36cf3d[_0x57162e(0x11a)]('\x22')&&_0x36cf3d['endsWith']('\x22')||_0x36cf3d[_0x57162e(0x11a)]('\x27')&&_0x36cf3d[_0x57162e(0x15a)]('\x27'))&&(_0x36cf3d=_0x36cf3d[_0x57162e(0x120)](0x1,-0x1)),_0xc88d35[_0x23c9b1]=_0x36cf3d;}}return _0xc88d35;}export function readUserConfig(){const _0x3eedf5=a54_0x487961,_0x583a2d=getConfigFile();if(!existsSync(_0x583a2d))return{};try{const _0x1069a0=readFileSync(_0x583a2d,_0x3eedf5(0x145));return parseEnvFile(_0x1069a0);}catch(_0x559023){return console[_0x3eedf5(0x157)](_0x3eedf5(0x13d)+_0x583a2d+':',_0x559023),{};}}export function resolveSite(_0x37970b){const _0x5d3935=a54_0x487961,_0x509c32=[_0x5d3935(0x129),_0x5d3935(0x12f),_0x5d3935(0x124),_0x5d3935(0x133),'ap03','dev-us01','dev-eu01','stg-us01',_0x5d3935(0x117),_0x5d3935(0x140)];if(_0x509c32[_0x5d3935(0x116)](_0x37970b))return _0x37970b;if(_0x37970b in SITE_ALIASES)return SITE_ALIASES[_0x37970b];return console[_0x5d3935(0x157)](_0x5d3935(0x134)+_0x37970b+_0x5d3935(0x152)),_0x5d3935(0x129);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x286d75){const _0x5539ae=a54_0x487961,_0x3f3041=_0x286d75||getActiveProfileName()||undefined;if(_0x3f3041){const _0x436cdb=_0x5539ae(0x118)+normalizeProfileForEnvVar(_0x3f3041);if(process.env[_0x436cdb])return{'accessToken':process.env[_0x436cdb],'source':_0x436cdb+_0x5539ae(0x154)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x5539ae(0x11e)};return null;}export function getAccessToken(_0x25c016){return resolveAccessToken(_0x25c016)?.['accessToken'];}function a54_0x101b(){const _0x1fda40=['918631DoJdiM','\x27,\x20defaulting\x20to\x20us01','1jxLwkz','\x20env\x20var','3700692xFlKEy','read','warn','some','1281404LThZed','endsWith','existsSync','split','join','config/account-info','entries','replace','.env.','readFileSync','parse','includes','stg-ap01','TDX_ACCESS_TOKEN_','.config','startsWith','match','accessToken','proxy','TDX_ACCESS_TOKEN\x20env\x20var','dev-us01','slice','tdx','path','next','eu01','config/llm-project','51882DHngMe','stg-us01','46525TkZWHa','us01','map','clear','llm_default_agent','TDX_API_KEY_','projectId','ap01','release_channel','TD_API_KEY','1036618MKIPGR','ap02','Warning:\x20Unknown\x20site\x20\x27','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','config/llm-agent','account_info','Warning:\x20Failed\x20to\x20read\x20','keychain\x20(profile:\x20','5370900OtNPHb','tdx.json','8wDqqoi','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','.json','toISOString','stg-ap03','number','llm_default_project','keychain','trim','utf-8','.env','108MsIWak','apiKeys','dev-eu01','stringify','stable','write','accountId','profile','string','toUpperCase'];a54_0x101b=function(){return _0x1fda40;};return a54_0x101b();}export function getAPIKey(_0x536fa0){const _0x47f742=a54_0x487961,_0x389069=_0x536fa0||getActiveProfileName();if(_0x389069){const _0x53fffd=_0x47f742(0x12d)+normalizeProfileForEnvVar(_0x389069);if(process.env[_0x53fffd])return process.env[_0x53fffd];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0xe48c8d){const _0x256084=a54_0x487961;return _0xe48c8d[_0x256084(0x150)]()[_0x256084(0x112)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x22fefa,_0x5d95c6){const _0x4e9cb7=a54_0x487961,_0x16ea96=resolveAccessToken(_0x5d95c6);if(_0x16ea96)return{'apiKey':_0x16ea96[_0x4e9cb7(0x11c)],'source':_0x16ea96['source'],'isDeprecated':![]};const _0x83876e=_0x5d95c6||getActiveProfileName()||undefined;if(_0x83876e){const _0x512263=_0x4e9cb7(0x12d)+normalizeProfileForEnvVar(_0x83876e);if(process.env[_0x512263])return{'apiKey':process.env[_0x512263],'source':_0x512263+'\x20env\x20var','isDeprecated':![]};const _0x59db07=getCachedCredential(_0x22fefa,_0x83876e);if(_0x59db07)return{'apiKey':_0x59db07,'source':_0x4e9cb7(0x139)+_0x83876e+')','isDeprecated':![]};const _0x54cc39=await getKeychainAPIKey(_0x83876e);if(_0x54cc39)return setCachedCredential(_0x54cc39,_0x22fefa,_0x83876e),{'apiKey':_0x54cc39,'source':_0x4e9cb7(0x139)+_0x83876e+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x83876e){const _0x16718d=getCachedCredential(_0x22fefa,undefined);if(_0x16718d)return{'apiKey':_0x16718d,'source':'keychain','isDeprecated':![]};const _0x1fba87=await getKeychainAPIKey(undefined);if(_0x1fba87)return setCachedCredential(_0x1fba87,_0x22fefa,undefined),{'apiKey':_0x1fba87,'source':_0x4e9cb7(0x143),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0xadcb9a,_0x53dd6e){const _0x2d5603=await resolveAPIKeyAsync(_0xadcb9a,_0x53dd6e);return _0x2d5603?.['apiKey'];}function cleanupLegacyEnvFile(_0x232499){const _0x4df61b=a54_0x487961;if(!existsSync(_0x232499))return![];try{const _0xfb2295=readFileSync(_0x232499,_0x4df61b(0x145)),_0x2d6ab1=_0xfb2295[_0x4df61b(0x10e)]('\x0a'),_0x4cecb7=_0x2d6ab1['filter'](_0x45a64f=>{const _0x797d53=_0x4df61b,_0x4646de=_0x45a64f[_0x797d53(0x144)]();if(!_0x4646de||_0x4646de['startsWith']('#'))return!![];const [_0x55ef12]=_0x4646de['split']('=');return!_0x55ef12[_0x797d53(0x11a)](_0x797d53(0x131));}),_0x1d9f81=_0x4cecb7[_0x4df61b(0x158)](_0x10f263=>{const _0x442665=_0x4df61b,_0x30c4c3=_0x10f263[_0x442665(0x144)]();return _0x30c4c3&&!_0x30c4c3[_0x442665(0x11a)]('#');});if(!_0x1d9f81)return unlinkSync(_0x232499),!![];return writeFileSync(_0x232499,_0x4cecb7['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function a54_0x2aa0(_0x2d508a,_0x3eb791){_0x2d508a=_0x2d508a-0x10e;const _0x101bad=a54_0x101b();let _0x2aa095=_0x101bad[_0x2d508a];return _0x2aa095;}function getActiveProfileName(){const _0x14e185=a54_0x487961;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x13c56e=a54_0x3d6e3d[_0x14e185(0x10f)](getConfigDir(),_0x14e185(0x13b));if(!a54_0x35dc5f['existsSync'](_0x13c56e))return null;try{const _0x2d9e34=a54_0x35dc5f['readFileSync'](_0x13c56e,'utf-8'),_0x135074=JSON[_0x14e185(0x115)](_0x2d9e34);return _0x135074[_0x14e185(0x14e)]||null;}catch{return null;}}export function saveAPIKey(_0x200a48,_0x2b5863,_0x36d48a){const _0x2a6056=a54_0x487961,_0x49be8a=getConfigDir(),_0xec9374=getConfigFilePath(_0x36d48a);!existsSync(_0x49be8a)&&mkdirSync(_0x49be8a,{'recursive':!![],'mode':0x1c0});let _0x4075f1={};if(existsSync(_0xec9374))try{const _0x46a356=readFileSync(_0xec9374,_0x2a6056(0x145));_0x4075f1=parseEnvFile(_0x46a356);}catch(_0x1d0406){console[_0x2a6056(0x157)](_0x2a6056(0x138)+_0xec9374+':',_0x1d0406);}const _0x8df3f9=_0x200a48['toUpperCase']()[_0x2a6056(0x112)](/-/g,'_');_0x4075f1['TD_API_KEY_'+_0x8df3f9]=_0x2b5863;const _0x59f1ac=Object[_0x2a6056(0x111)](_0x4075f1)[_0x2a6056(0x12a)](([_0x4f6c0d,_0x7fdd9c])=>_0x4f6c0d+'='+_0x7fdd9c);writeFileSync(_0xec9374,_0x59f1ac[_0x2a6056(0x10f)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0xd823b9,_0x468f6c,_0x5b50a5){const _0xd0c0e1=a54_0x487961;await saveKeychainAPIKey(_0xd823b9,_0x5b50a5),setCachedCredential(_0xd823b9,_0x468f6c,_0x5b50a5);const _0x308544=getConfigFilePath(_0x5b50a5);cleanupLegacyEnvFile(_0x308544)&&console[_0xd0c0e1(0x157)](a54_0x154318['yellow'](_0xd0c0e1(0x135)));}export function loadConfig(){const _0x91986d=a54_0x487961,_0x1823ad={'apiKeys':{},'defaultSite':_0x91986d(0x129)},_0x54f6f2=[_0x91986d(0x129),_0x91986d(0x12f),_0x91986d(0x124),_0x91986d(0x133),'ap03',_0x91986d(0x11f),_0x91986d(0x149),_0x91986d(0x127),_0x91986d(0x117),_0x91986d(0x140)],_0x10feee=getAPIKey();if(_0x10feee)for(const _0x46698a of _0x54f6f2){_0x1823ad[_0x91986d(0x148)][_0x46698a]=_0x10feee;}return _0x1823ad;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x775f4d=a54_0x487961,_0x243bfa=a54_0x3d6e3d[_0x775f4d(0x10f)](getConfigDir(),'tdx.json');if(!a54_0x35dc5f[_0x775f4d(0x15b)](_0x243bfa))return undefined;try{const _0x5cfa31=a54_0x35dc5f[_0x775f4d(0x114)](_0x243bfa,_0x775f4d(0x145)),_0x1a63ff=JSON['parse'](_0x5cfa31);return typeof _0x1a63ff[_0x775f4d(0x11d)]===_0x775f4d(0x14f)?_0x1a63ff[_0x775f4d(0x11d)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x1ae889=a54_0x487961,_0x3b6c4a=process.env.TDX_RELEASE_CHANNEL;if(_0x3b6c4a===_0x1ae889(0x123)||_0x3b6c4a===_0x1ae889(0x14b))return _0x3b6c4a;const _0x4de139=a54_0x3d6e3d[_0x1ae889(0x10f)](getConfigDir(),_0x1ae889(0x13b));if(!a54_0x35dc5f[_0x1ae889(0x15b)](_0x4de139))return _0x1ae889(0x14b);try{const _0x4ed495=a54_0x35dc5f[_0x1ae889(0x114)](_0x4de139,_0x1ae889(0x145)),_0x5c43d7=JSON['parse'](_0x4ed495);if(_0x5c43d7[_0x1ae889(0x130)]===_0x1ae889(0x123))return _0x1ae889(0x123);}catch{}return _0x1ae889(0x14b);}export function saveReleaseChannel(_0x3357dd){const _0x47ad39=a54_0x487961,_0x4ee430=getConfigDir(),_0xd4c63d=a54_0x3d6e3d[_0x47ad39(0x10f)](_0x4ee430,_0x47ad39(0x13b));!existsSync(_0x4ee430)&&mkdirSync(_0x4ee430,{'recursive':!![],'mode':0x1c0});let _0x3a8e13={};if(existsSync(_0xd4c63d))try{const _0x19f329=readFileSync(_0xd4c63d,_0x47ad39(0x145));_0x3a8e13=JSON[_0x47ad39(0x115)](_0x19f329);}catch{}_0x3a8e13[_0x47ad39(0x130)]=_0x3357dd,writeFileSync(_0xd4c63d,JSON[_0x47ad39(0x14a)](_0x3a8e13,null,0x2),{'mode':0x180});}
1
+ const a54_0x25f646=a54_0x5dab;(function(_0x33f5e,_0x320685){const _0x4e0273=a54_0x5dab,_0x1fe76f=_0x33f5e();while(!![]){try{const _0x43f0c8=-parseInt(_0x4e0273(0x7e))/0x1+-parseInt(_0x4e0273(0x7b))/0x2+-parseInt(_0x4e0273(0x87))/0x3*(-parseInt(_0x4e0273(0x92))/0x4)+-parseInt(_0x4e0273(0xa1))/0x5+-parseInt(_0x4e0273(0x98))/0x6*(-parseInt(_0x4e0273(0x72))/0x7)+parseInt(_0x4e0273(0x91))/0x8*(-parseInt(_0x4e0273(0x73))/0x9)+parseInt(_0x4e0273(0x83))/0xa;if(_0x43f0c8===_0x320685)break;else _0x1fe76f['push'](_0x1fe76f['shift']());}catch(_0x199b6e){_0x1fe76f['push'](_0x1fe76f['shift']());}}}(a54_0x1652,0x26524));function a54_0x5dab(_0x4f1107,_0x2839b0){_0x4f1107=_0x4f1107-0x6b;const _0x1652a9=a54_0x1652();let _0x5dab92=_0x1652a9[_0x4f1107];return _0x5dab92;}import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x4bf65e from'node:fs';import*as a54_0xeec917 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a54_0x2e31d3 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x5a2d83=a54_0x5dab;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x5a2d83(0x86),_0x5a2d83(0xa2));}export function getConfigFile(){const _0x4a3862=a54_0x5dab;return join(getConfigDir(),_0x4a3862(0x7a));}export function getConfigFilePath(_0x321d90){const _0x29a2f1=a54_0x5dab,_0x3ca9d4=getConfigDir();return _0x321d90?a54_0xeec917['join'](_0x3ca9d4,_0x29a2f1(0xab)+_0x321d90):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x25f646(0x6f),a54_0x25f646(0xb6));export function getLLMProjectCacheFile(_0x140bc6){return llmProjectCache['path'](_0x140bc6);}export function readCachedLLMProject(_0xcc6212){const _0x288e8d=a54_0x25f646,_0x2eef5f=llmProjectCache[_0x288e8d(0x6d)](_0xcc6212);if(_0x2eef5f&&typeof _0x2eef5f['id']===_0x288e8d(0x8d)&&typeof _0x2eef5f[_0x288e8d(0x94)]===_0x288e8d(0x8d))return _0x2eef5f;return null;}export function writeCachedLLMProject(_0xdabcba,_0x4124fc,_0x4d095e){const _0x25aa57=a54_0x25f646;try{llmProjectCache[_0x25aa57(0xaa)]({'name':_0xdabcba,'id':_0x4124fc},_0x4d095e);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x25f646(0x75),a54_0x25f646(0x71));export function getLLMAgentCacheFile(_0x531b0e){const _0x49cce6=a54_0x25f646;return llmAgentCache[_0x49cce6(0x84)](_0x531b0e);}export function readCachedLLMAgent(_0x51021f){const _0x57453f=a54_0x25f646,_0x150942=llmAgentCache['read'](_0x51021f);if(_0x150942&&typeof _0x150942['id']==='string'&&typeof _0x150942[_0x57453f(0x94)]==='string'&&typeof _0x150942['projectId']===_0x57453f(0x8d))return _0x150942;return null;}export function writeCachedLLMAgent(_0x302b39,_0x5da555,_0x928821,_0x37d6ad){const _0x1953cf=a54_0x25f646;try{llmAgentCache[_0x1953cf(0xaa)]({'name':_0x302b39,'id':_0x5da555,'projectId':_0x928821},_0x37d6ad);}catch{}}export function clearCachedLLMAgent(_0x520700){const _0x11a6be=a54_0x25f646;try{llmAgentCache[_0x11a6be(0x70)](_0x520700);}catch{}}const accountInfoCache=createOptionalProfileCache(a54_0x25f646(0x99),a54_0x25f646(0x8e),{'suffix':a54_0x25f646(0xa4)});export function getAccountInfoCacheFile(_0x49f25f){const _0x394803=a54_0x25f646;return accountInfoCache[_0x394803(0x84)](_0x49f25f);}export function readCachedAccountInfo(_0x2aa534){const _0x41ff1d=a54_0x25f646,_0x448cc8=accountInfoCache[_0x41ff1d(0x6d)](_0x2aa534);if(_0x448cc8&&typeof _0x448cc8[_0x41ff1d(0x77)]==='string'&&typeof _0x448cc8[_0x41ff1d(0x8b)]===_0x41ff1d(0x9a))return _0x448cc8;return null;}export function writeCachedAccountInfo(_0x46e9eb,_0x483a1f,_0x442edc){const _0xf75455=a54_0x25f646;try{accountInfoCache[_0xf75455(0xaa)]({'site':_0x46e9eb,'accountId':_0x483a1f,'cachedAt':new Date()['toISOString']()},_0x442edc);}catch{}}export function parseEnvFile(_0x1d57b6){const _0x3ca5b7=a54_0x25f646,_0x41ab27={};for(const _0xf07fff of _0x1d57b6[_0x3ca5b7(0xa8)]('\x0a')){const _0x5e1eb0=_0xf07fff['trim']();if(!_0x5e1eb0||_0x5e1eb0['startsWith']('#'))continue;const _0x434e35=_0x5e1eb0[_0x3ca5b7(0x9c)](/^([^=]+)=(.*)$/);if(_0x434e35){const _0x561995=_0x434e35[0x1][_0x3ca5b7(0x95)]();let _0x4b3907=_0x434e35[0x2][_0x3ca5b7(0x95)]();(_0x4b3907[_0x3ca5b7(0x9e)]('\x22')&&_0x4b3907[_0x3ca5b7(0xb1)]('\x22')||_0x4b3907[_0x3ca5b7(0x9e)]('\x27')&&_0x4b3907[_0x3ca5b7(0xb1)]('\x27'))&&(_0x4b3907=_0x4b3907['slice'](0x1,-0x1)),_0x41ab27[_0x561995]=_0x4b3907;}}return _0x41ab27;}export function readUserConfig(){const _0x3a9f5c=a54_0x25f646,_0x241175=getConfigFile();if(!existsSync(_0x241175))return{};try{const _0x4b85f9=readFileSync(_0x241175,_0x3a9f5c(0x6e));return parseEnvFile(_0x4b85f9);}catch(_0x5241e9){return console['warn'](_0x3a9f5c(0xb3)+_0x241175+':',_0x5241e9),{};}}export function resolveSite(_0x11291d){const _0x58505b=a54_0x25f646,_0x33abc8=['us01',_0x58505b(0x90),_0x58505b(0x85),'ap02',_0x58505b(0x88),'dev-us01',_0x58505b(0xaf),_0x58505b(0xb2),_0x58505b(0xa9),_0x58505b(0x7c)];if(_0x33abc8['includes'](_0x11291d))return _0x11291d;if(_0x11291d in SITE_ALIASES)return SITE_ALIASES[_0x11291d];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x11291d+'\x27,\x20defaulting\x20to\x20us01'),_0x58505b(0xa0);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x5e7869){const _0x4c0ab4=a54_0x25f646,_0x1eb324=_0x5e7869||getActiveProfileName()||undefined;if(_0x1eb324){const _0x4bd770=_0x4c0ab4(0x78)+normalizeProfileForEnvVar(_0x1eb324);if(process.env[_0x4bd770])return{'accessToken':process.env[_0x4bd770],'source':_0x4bd770+_0x4c0ab4(0x93)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x4c0ab4(0x79)};return null;}export function getAccessToken(_0x314874){return resolveAccessToken(_0x314874)?.['accessToken'];}export function getAPIKey(_0x3b3f75){const _0x2f4ef6=_0x3b3f75||getActiveProfileName();if(_0x2f4ef6){const _0x664927='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x2f4ef6);if(process.env[_0x664927])return process.env[_0x664927];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0xc553d0){const _0x2bc434=a54_0x25f646;return _0xc553d0[_0x2bc434(0xad)]()[_0x2bc434(0x6b)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x256f63,_0x1a7ac4){const _0x324a76=a54_0x25f646,_0x2219e4=resolveAccessToken(_0x1a7ac4);if(_0x2219e4)return{'apiKey':_0x2219e4[_0x324a76(0x7f)],'source':_0x2219e4['source'],'isDeprecated':![]};const _0x39f109=_0x1a7ac4||getActiveProfileName()||undefined;if(_0x39f109){const _0x542832='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x39f109);if(process.env[_0x542832])return{'apiKey':process.env[_0x542832],'source':_0x542832+'\x20env\x20var','isDeprecated':![]};const _0x1b7f20=getCachedCredential(_0x256f63,_0x39f109);if(_0x1b7f20)return{'apiKey':_0x1b7f20,'source':_0x324a76(0xae)+_0x39f109+')','isDeprecated':![]};const _0x28ea5a=await getKeychainAPIKey(_0x39f109);if(_0x28ea5a)return setCachedCredential(_0x28ea5a,_0x256f63,_0x39f109),{'apiKey':_0x28ea5a,'source':_0x324a76(0xae)+_0x39f109+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x324a76(0xb5),'isDeprecated':![]};if(!_0x39f109){const _0xe040b8=getCachedCredential(_0x256f63,undefined);if(_0xe040b8)return{'apiKey':_0xe040b8,'source':_0x324a76(0xa3),'isDeprecated':![]};const _0x4264e5=await getKeychainAPIKey(undefined);if(_0x4264e5)return setCachedCredential(_0x4264e5,_0x256f63,undefined),{'apiKey':_0x4264e5,'source':'keychain','isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x93d3b2,_0x2fa3d7){const _0x38fa26=a54_0x25f646,_0x11fd82=await resolveAPIKeyAsync(_0x93d3b2,_0x2fa3d7);return _0x11fd82?.[_0x38fa26(0x74)];}function cleanupLegacyEnvFile(_0x11eee8){const _0x280529=a54_0x25f646;if(!existsSync(_0x11eee8))return![];try{const _0x52d3f5=readFileSync(_0x11eee8,_0x280529(0x6e)),_0x7d45b7=_0x52d3f5[_0x280529(0xa8)]('\x0a'),_0x1e230c=_0x7d45b7[_0x280529(0x80)](_0x57205b=>{const _0x37263f=_0x280529,_0x5af0ce=_0x57205b['trim']();if(!_0x5af0ce||_0x5af0ce[_0x37263f(0x9e)]('#'))return!![];const [_0x5c95c8]=_0x5af0ce[_0x37263f(0xa8)]('=');return!_0x5c95c8['startsWith'](_0x37263f(0xb4));}),_0x3730ca=_0x1e230c[_0x280529(0x96)](_0x244f5c=>{const _0x6705c8=_0x280529,_0x17f279=_0x244f5c['trim']();return _0x17f279&&!_0x17f279[_0x6705c8(0x9e)]('#');});if(!_0x3730ca)return unlinkSync(_0x11eee8),!![];return writeFileSync(_0x11eee8,_0x1e230c[_0x280529(0x76)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x28a940=a54_0x25f646;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x50b607=a54_0xeec917[_0x28a940(0x76)](getConfigDir(),_0x28a940(0x8a));if(!a54_0x4bf65e[_0x28a940(0x97)](_0x50b607))return null;try{const _0x11baf8=a54_0x4bf65e[_0x28a940(0x9f)](_0x50b607,_0x28a940(0x6e)),_0x3cf653=JSON[_0x28a940(0xa6)](_0x11baf8);return _0x3cf653[_0x28a940(0x9d)]||null;}catch{return null;}}export function saveAPIKey(_0x10d66e,_0x3a108f,_0x1406cc){const _0x3532e9=a54_0x25f646,_0xc2d6bd=getConfigDir(),_0x60b326=getConfigFilePath(_0x1406cc);!existsSync(_0xc2d6bd)&&mkdirSync(_0xc2d6bd,{'recursive':!![],'mode':0x1c0});let _0x40c958={};if(existsSync(_0x60b326))try{const _0x1f54c8=readFileSync(_0x60b326,'utf-8');_0x40c958=parseEnvFile(_0x1f54c8);}catch(_0x3857af){console[_0x3532e9(0xa5)](_0x3532e9(0x81)+_0x60b326+':',_0x3857af);}const _0x410395=_0x10d66e[_0x3532e9(0xad)]()['replace'](/-/g,'_');_0x40c958['TD_API_KEY_'+_0x410395]=_0x3a108f;const _0x264efd=Object['entries'](_0x40c958)[_0x3532e9(0x8c)](([_0x117e7d,_0x50a14e])=>_0x117e7d+'='+_0x50a14e);writeFileSync(_0x60b326,_0x264efd[_0x3532e9(0x76)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x55ba0b,_0x1cffea,_0x467787){const _0x365370=a54_0x25f646;await saveKeychainAPIKey(_0x55ba0b,_0x467787),setCachedCredential(_0x55ba0b,_0x1cffea,_0x467787);const _0x5c1870=getConfigFilePath(_0x467787);cleanupLegacyEnvFile(_0x5c1870)&&console[_0x365370(0xa5)](a54_0x2e31d3[_0x365370(0x8f)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x411aa3=a54_0x25f646,_0x332028={'apiKeys':{},'defaultSite':_0x411aa3(0xa0)},_0x7a81f9=[_0x411aa3(0xa0),_0x411aa3(0x90),_0x411aa3(0x85),_0x411aa3(0x89),_0x411aa3(0x88),_0x411aa3(0xb0),'dev-eu01',_0x411aa3(0xb2),_0x411aa3(0xa9),_0x411aa3(0x7c)],_0x435008=getAPIKey();if(_0x435008)for(const _0x2e0fc9 of _0x7a81f9){_0x332028[_0x411aa3(0x7d)][_0x2e0fc9]=_0x435008;}return _0x332028;}function a54_0x1652(){const _0x3085e2=['existsSync','19338SLUPnu','account_info','number','stringify','match','profile','startsWith','readFileSync','us01','257970Vqojjq','tdx','keychain','.json','warn','parse','next','split','stg-ap01','write','.env.','proxy','toUpperCase','keychain\x20(profile:\x20','dev-eu01','dev-us01','endsWith','stg-us01','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','TD_API_KEY','TDX_API_KEY\x20env\x20var','config/llm-project','replace','release_channel','read','utf-8','llm_default_project','clear','config/llm-agent','133wfVtcS','1969119KrKfQs','apiKey','llm_default_agent','join','site','TDX_ACCESS_TOKEN_','TDX_ACCESS_TOKEN\x20env\x20var','.env','226446JviWAj','stg-ap03','apiKeys','111815DgXAYc','accessToken','filter','Warning:\x20Failed\x20to\x20read\x20','stable','4276420ASfuYj','path','eu01','.config','123psCKMs','ap03','ap02','tdx.json','accountId','map','string','config/account-info','yellow','ap01','8FRsRWT','15952EcHGZO','\x20env\x20var','name','trim','some'];a54_0x1652=function(){return _0x3085e2;};return a54_0x1652();}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x14130b=a54_0x25f646,_0x56cd28=a54_0xeec917[_0x14130b(0x76)](getConfigDir(),_0x14130b(0x8a));if(!a54_0x4bf65e[_0x14130b(0x97)](_0x56cd28))return undefined;try{const _0x405def=a54_0x4bf65e[_0x14130b(0x9f)](_0x56cd28,_0x14130b(0x6e)),_0x13105d=JSON[_0x14130b(0xa6)](_0x405def);return typeof _0x13105d[_0x14130b(0xac)]===_0x14130b(0x8d)?_0x13105d[_0x14130b(0xac)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x13fc1d=a54_0x25f646,_0x1f047d=process.env.TDX_RELEASE_CHANNEL;if(_0x1f047d===_0x13fc1d(0xa7)||_0x1f047d==='stable')return _0x1f047d;const _0x12eee2=a54_0xeec917[_0x13fc1d(0x76)](getConfigDir(),_0x13fc1d(0x8a));if(!a54_0x4bf65e[_0x13fc1d(0x97)](_0x12eee2))return'stable';try{const _0x33812f=a54_0x4bf65e['readFileSync'](_0x12eee2,_0x13fc1d(0x6e)),_0x487574=JSON['parse'](_0x33812f);if(_0x487574[_0x13fc1d(0x6c)]===_0x13fc1d(0xa7))return _0x13fc1d(0xa7);}catch{}return _0x13fc1d(0x82);}export function saveReleaseChannel(_0x462675){const _0x2b9453=a54_0x25f646,_0x2645c7=getConfigDir(),_0xdd413d=a54_0xeec917[_0x2b9453(0x76)](_0x2645c7,_0x2b9453(0x8a));!existsSync(_0x2645c7)&&mkdirSync(_0x2645c7,{'recursive':!![],'mode':0x1c0});let _0x38e679={};if(existsSync(_0xdd413d))try{const _0x5b95ed=readFileSync(_0xdd413d,'utf-8');_0x38e679=JSON[_0x2b9453(0xa6)](_0x5b95ed);}catch{}_0x38e679[_0x2b9453(0x6c)]=_0x462675,writeFileSync(_0xdd413d,JSON[_0x2b9453(0x9b)](_0x38e679,null,0x2),{'mode':0x180});}
@@ -1 +1 @@
1
- const a55_0x4d9559=a55_0x5222;function a55_0x5222(_0x3e6479,_0x1cf720){_0x3e6479=_0x3e6479-0xfe;const _0x14b96f=a55_0x14b9();let _0x5222ec=_0x14b96f[_0x3e6479];return _0x5222ec;}(function(_0x31aad4,_0x2862a9){const _0x2aae86=a55_0x5222,_0x258c5a=_0x31aad4();while(!![]){try{const _0x4b5dde=parseInt(_0x2aae86(0x102))/0x1*(-parseInt(_0x2aae86(0x103))/0x2)+-parseInt(_0x2aae86(0x10b))/0x3*(-parseInt(_0x2aae86(0x107))/0x4)+-parseInt(_0x2aae86(0x106))/0x5+-parseInt(_0x2aae86(0x105))/0x6+-parseInt(_0x2aae86(0x104))/0x7*(-parseInt(_0x2aae86(0x10c))/0x8)+parseInt(_0x2aae86(0xff))/0x9+parseInt(_0x2aae86(0x108))/0xa*(parseInt(_0x2aae86(0x100))/0xb);if(_0x4b5dde===_0x2862a9)break;else _0x258c5a['push'](_0x258c5a['shift']());}catch(_0x588a18){_0x258c5a['push'](_0x258c5a['shift']());}}}(a55_0x14b9,0x22e85));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a55_0x4d9559(0x101),a55_0x4d9559(0x10d));function a55_0x14b9(){const _0x307777=['now','write','2000178SBAWCf','1403413vaIGUS','connections-{profile}.json','1747nTMZci','14wRqBHy','42dadvIq','373956wtkrBx','1053630WUyVsd','692STjjda','10XQGZId','read','clear','183haZivH','90512DBfMjj','core/connection-cache'];a55_0x14b9=function(){return _0x307777;};return a55_0x14b9();}export function loadCachedConnections(_0x506bd5){const _0x13b4a7=a55_0x4d9559,_0xb1c2d=connectionCache[_0x13b4a7(0x109)](_0x506bd5);return _0xb1c2d?.['connections']??null;}export function saveCachedConnections(_0x3fda4f,_0x5d6ef6){const _0x1572a5=a55_0x4d9559;connectionCache[_0x1572a5(0xfe)](_0x3fda4f,{'connections':_0x5d6ef6,'cachedAt':Date[_0x1572a5(0x10e)]()});}export function clearConnectionCache(_0x15cbf4){const _0x2c8fd9=a55_0x4d9559;connectionCache[_0x2c8fd9(0x10a)](_0x15cbf4);}
1
+ const a55_0xda8167=a55_0x1d97;(function(_0x520b88,_0x10aa78){const _0x30cd8c=a55_0x1d97,_0x1f84c2=_0x520b88();while(!![]){try{const _0x29e95c=-parseInt(_0x30cd8c(0x133))/0x1*(parseInt(_0x30cd8c(0x135))/0x2)+parseInt(_0x30cd8c(0x139))/0x3+parseInt(_0x30cd8c(0x137))/0x4+-parseInt(_0x30cd8c(0x138))/0x5*(-parseInt(_0x30cd8c(0x13b))/0x6)+-parseInt(_0x30cd8c(0x13a))/0x7*(parseInt(_0x30cd8c(0x130))/0x8)+-parseInt(_0x30cd8c(0x136))/0x9*(-parseInt(_0x30cd8c(0x134))/0xa)+-parseInt(_0x30cd8c(0x13d))/0xb;if(_0x29e95c===_0x10aa78)break;else _0x1f84c2['push'](_0x1f84c2['shift']());}catch(_0x1c72d1){_0x1f84c2['push'](_0x1f84c2['shift']());}}}(a55_0x170f,0x3be2a));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a55_0xda8167(0x12d),'core/connection-cache');function a55_0x170f(){const _0x3269c1=['2185566SNUcdc','write','1783584mYtNGf','connections-{profile}.json','connections','read','871048gjbZos','clear','now','69kEJyth','70pKWmRk','3646GWTpRL','340173hzjSDu','280740brzDbP','5EHKPxq','482517UmyrHY','21plrOkx'];a55_0x170f=function(){return _0x3269c1;};return a55_0x170f();}function a55_0x1d97(_0x481582,_0x156704){_0x481582=_0x481582-0x12d;const _0x170fe9=a55_0x170f();let _0x1d9748=_0x170fe9[_0x481582];return _0x1d9748;}export function loadCachedConnections(_0x5d48d5){const _0x3cabe1=a55_0xda8167,_0x323e1d=connectionCache[_0x3cabe1(0x12f)](_0x5d48d5);return _0x323e1d?.[_0x3cabe1(0x12e)]??null;}export function saveCachedConnections(_0x1c17c1,_0x335aec){const _0x3660cc=a55_0xda8167;connectionCache[_0x3660cc(0x13c)](_0x1c17c1,{'connections':_0x335aec,'cachedAt':Date[_0x3660cc(0x132)]()});}export function clearConnectionCache(_0x960071){const _0x7b8220=a55_0xda8167;connectionCache[_0x7b8220(0x131)](_0x960071);}
@@ -1 +1 @@
1
- function a56_0x5b39(_0x7bb3a6,_0x318272){_0x7bb3a6=_0x7bb3a6-0x149;const _0x2c3fda=a56_0x2c3f();let _0x5b399d=_0x2c3fda[_0x7bb3a6];return _0x5b399d;}const a56_0x588341=a56_0x5b39;(function(_0x43b270,_0x4f7edc){const _0x23f852=a56_0x5b39,_0x5233a8=_0x43b270();while(!![]){try{const _0xcfaa3=parseInt(_0x23f852(0x14d))/0x1+parseInt(_0x23f852(0x149))/0x2*(-parseInt(_0x23f852(0x155))/0x3)+parseInt(_0x23f852(0x157))/0x4+parseInt(_0x23f852(0x160))/0x5+parseInt(_0x23f852(0x15d))/0x6+-parseInt(_0x23f852(0x168))/0x7+-parseInt(_0x23f852(0x161))/0x8*(parseInt(_0x23f852(0x165))/0x9);if(_0xcfaa3===_0x4f7edc)break;else _0x5233a8['push'](_0x5233a8['shift']());}catch(_0x453efe){_0x5233a8['push'](_0x5233a8['shift']());}}}(a56_0x2c3f,0x960e6));import a56_0x18f7a3 from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;function a56_0x2c3f(){const _0x2d2221=['text','721715Bgisid','10768fUZugU','select','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','other','6273KvdMQw','Enter\x20site\x20name:','eu01','1258397PCIZoU','8aEOfFy','test','ap02','customSite','743768YpmjfR','ap01','us\x20\x20\x20-\x20United\x20States','log','findIndex','ap02\x20-\x20Korea','jp\x20\x20\x20-\x20Japan','number','170616iwPTdi','site','2335872utGglD','push','Cancelled','eu\x20\x20\x20-\x20Europe','trim','us01','2927832nDexqm','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens'];a56_0x2c3f=function(){return _0x2d2221;};return a56_0x2c3f();}export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x4d9162,_0x47376a){const _0x2f5e34=a56_0x5b39;if(_0x4d9162===undefined)return _0x47376a;if(typeof _0x4d9162===_0x2f5e34(0x154))return _0x4d9162;return parseInt(_0x4d9162,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a56_0x588341(0x14f),'value':a56_0x588341(0x15c)},{'title':a56_0x588341(0x153),'value':a56_0x588341(0x14e)},{'title':a56_0x588341(0x15a),'value':a56_0x588341(0x167)},{'title':a56_0x588341(0x152),'value':a56_0x588341(0x14b)}];export function buildSiteChoices(_0x51154f){const _0x947917=a56_0x588341,_0x21de79=[...STANDARD_SITE_CHOICES];let _0x20f4a8=_0x21de79[_0x947917(0x151)](_0x4de7be=>_0x4de7be['value']===_0x51154f);return _0x20f4a8===-0x1&&_0x51154f!==_0x947917(0x15c)&&(_0x21de79[_0x947917(0x158)]({'title':_0x51154f,'value':_0x51154f}),_0x20f4a8=_0x21de79['length']-0x1),_0x21de79['push']({'title':'Enter\x20custom\x20site','value':_0x947917(0x164)}),{'choices':_0x21de79,'initialIndex':_0x20f4a8>=0x0?_0x20f4a8:0x0};}export async function promptSiteSelection(_0x3f2912,_0x9296ef,_0x307f01=a56_0x588341(0x159)){const _0x410bc4=a56_0x588341,{choices:_0x30f013,initialIndex:_0x21afde}=buildSiteChoices(_0x3f2912),_0x5be5ec=_0x9296ef?_0x410bc4(0x163)+_0x9296ef+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x42b1d2=await a56_0x18f7a3({'type':_0x410bc4(0x162),'name':_0x410bc4(0x156),'message':_0x5be5ec,'choices':_0x30f013,'initial':_0x21afde});if(!_0x42b1d2[_0x410bc4(0x156)])return console[_0x410bc4(0x150)]('\x0a'+_0x307f01),null;if(_0x42b1d2[_0x410bc4(0x156)]!=='other')return _0x42b1d2[_0x410bc4(0x156)];const _0x1f1707=await a56_0x18f7a3({'type':_0x410bc4(0x15f),'name':_0x410bc4(0x14c),'message':_0x410bc4(0x166),'initial':_0x410bc4(0x15c),'validate':_0x5d9bf4=>{const _0x19eef4=_0x410bc4;if(!_0x5d9bf4||!_0x5d9bf4[_0x19eef4(0x15b)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x19eef4(0x14a)](_0x5d9bf4[_0x19eef4(0x15b)]()))return _0x19eef4(0x15e);return!![];}});if(!_0x1f1707[_0x410bc4(0x14c)])return console[_0x410bc4(0x150)]('\x0a'+_0x307f01),null;return _0x1f1707[_0x410bc4(0x14c)];}
1
+ const a56_0x27a2ba=a56_0x4df9;function a56_0x8c3d(){const _0x160670=['trim','200206nLZVFu','eu\x20\x20\x20-\x20Europe','11jeSFZR','Enter\x20custom\x20site','5403530LqgLAq','us01','1982232sjVaZu','45bFVzSj','select','17NZizHi','Site\x20name\x20cannot\x20be\x20empty','log','customSite','push','5273049isImwL','site','2007453EwsTyQ','11061906GzEZeI','Select\x20your\x20Treasure\x20Data\x20site:','eu01','other','1594136krudlb','value','ap02','findIndex','ap02\x20-\x20Korea','test','length','Cancelled','5JzrNWF','ap01'];a56_0x8c3d=function(){return _0x160670;};return a56_0x8c3d();}(function(_0x1a52a0,_0x3e1dc5){const _0x1e304c=a56_0x4df9,_0x121683=_0x1a52a0();while(!![]){try{const _0x3e6bb8=parseInt(_0x1e304c(0x19a))/0x1*(parseInt(_0x1e304c(0x191))/0x2)+parseInt(_0x1e304c(0x19f))/0x3+-parseInt(_0x1e304c(0x197))/0x4*(parseInt(_0x1e304c(0x18e))/0x5)+-parseInt(_0x1e304c(0x1a2))/0x6+parseInt(_0x1e304c(0x1a1))/0x7+parseInt(_0x1e304c(0x1a6))/0x8*(-parseInt(_0x1e304c(0x198))/0x9)+parseInt(_0x1e304c(0x195))/0xa*(parseInt(_0x1e304c(0x193))/0xb);if(_0x3e6bb8===_0x3e1dc5)break;else _0x121683['push'](_0x121683['shift']());}catch(_0x4ab59b){_0x121683['push'](_0x121683['shift']());}}}(a56_0x8c3d,0xe82ee));function a56_0x4df9(_0x947e8f,_0x313f82){_0x947e8f=_0x947e8f-0x188;const _0x8c3d70=a56_0x8c3d();let _0x4df939=_0x8c3d70[_0x947e8f];return _0x4df939;}import a56_0x2d884b from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x400920,_0x1f03ad){if(_0x400920===undefined)return _0x1f03ad;if(typeof _0x400920==='number')return _0x400920;return parseInt(_0x400920,0xa);}export const STANDARD_SITE_CHOICES=[{'title':'us\x20\x20\x20-\x20United\x20States','value':a56_0x27a2ba(0x196)},{'title':'jp\x20\x20\x20-\x20Japan','value':a56_0x27a2ba(0x18f)},{'title':a56_0x27a2ba(0x192),'value':a56_0x27a2ba(0x1a4)},{'title':a56_0x27a2ba(0x18a),'value':a56_0x27a2ba(0x188)}];export function buildSiteChoices(_0x241e28){const _0x2eee1e=a56_0x27a2ba,_0x931237=[...STANDARD_SITE_CHOICES];let _0x49cdcd=_0x931237[_0x2eee1e(0x189)](_0x570bba=>_0x570bba[_0x2eee1e(0x1a7)]===_0x241e28);return _0x49cdcd===-0x1&&_0x241e28!==_0x2eee1e(0x196)&&(_0x931237[_0x2eee1e(0x19e)]({'title':_0x241e28,'value':_0x241e28}),_0x49cdcd=_0x931237[_0x2eee1e(0x18c)]-0x1),_0x931237[_0x2eee1e(0x19e)]({'title':_0x2eee1e(0x194),'value':_0x2eee1e(0x1a5)}),{'choices':_0x931237,'initialIndex':_0x49cdcd>=0x0?_0x49cdcd:0x0};}export async function promptSiteSelection(_0x34e2c3,_0x5acf8c,_0x469911=a56_0x27a2ba(0x18d)){const _0x3af0f4=a56_0x27a2ba,{choices:_0x15f343,initialIndex:_0x137b28}=buildSiteChoices(_0x34e2c3),_0x4b07ef=_0x5acf8c?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x5acf8c+'):':_0x3af0f4(0x1a3),_0x5f4dca=await a56_0x2d884b({'type':_0x3af0f4(0x199),'name':_0x3af0f4(0x1a0),'message':_0x4b07ef,'choices':_0x15f343,'initial':_0x137b28});if(!_0x5f4dca['site'])return console[_0x3af0f4(0x19c)]('\x0a'+_0x469911),null;if(_0x5f4dca[_0x3af0f4(0x1a0)]!==_0x3af0f4(0x1a5))return _0x5f4dca[_0x3af0f4(0x1a0)];const _0x125e17=await a56_0x2d884b({'type':'text','name':_0x3af0f4(0x19d),'message':'Enter\x20site\x20name:','initial':'us01','validate':_0x4490eb=>{const _0x5f5573=_0x3af0f4;if(!_0x4490eb||!_0x4490eb[_0x5f5573(0x190)]())return _0x5f5573(0x19b);if(!/^[a-z0-9-]+$/[_0x5f5573(0x18b)](_0x4490eb[_0x5f5573(0x190)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x125e17[_0x3af0f4(0x19d)])return console[_0x3af0f4(0x19c)]('\x0a'+_0x469911),null;return _0x125e17[_0x3af0f4(0x19d)];}
@@ -1 +1 @@
1
- (function(_0x4f138c,_0x54f1ef){const _0x4dcf58=a57_0x22d0,_0x29af42=_0x4f138c();while(!![]){try{const _0x2294ac=parseInt(_0x4dcf58(0x1fe))/0x1+parseInt(_0x4dcf58(0x1ff))/0x2*(-parseInt(_0x4dcf58(0x1ef))/0x3)+parseInt(_0x4dcf58(0x1f5))/0x4*(-parseInt(_0x4dcf58(0x1f4))/0x5)+-parseInt(_0x4dcf58(0x1f9))/0x6+-parseInt(_0x4dcf58(0x1f2))/0x7+-parseInt(_0x4dcf58(0x1fd))/0x8+parseInt(_0x4dcf58(0x1f6))/0x9;if(_0x2294ac===_0x54f1ef)break;else _0x29af42['push'](_0x29af42['shift']());}catch(_0x21ac55){_0x29af42['push'](_0x29af42['shift']());}}}(a57_0x23f4,0x9b379));function a57_0x23f4(){const _0x1db048=['loadedAt','1068552VFRMCm','469912ucqibJ','504098ucdyDp','get','6aWGbtF','apiKey','delete','5349925FiwCsq','__default_site__','2507390YhWEpq','8yCqBOF','34368282CfzoKH','now','set','7487658nMDLXg','clear','__default_profile__'];a57_0x23f4=function(){return _0x1db048;};return a57_0x23f4();}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x55489a,_0x2f7577){const _0x5b174f=a57_0x22d0,_0x3e19b9=_0x55489a||_0x5b174f(0x1f3),_0x1b78a8=_0x2f7577||_0x5b174f(0x1fb);return _0x3e19b9+':'+_0x1b78a8;}export function getCachedCredential(_0x18f5f8,_0x1726f2){const _0x59cda1=a57_0x22d0,_0x16b422=getCacheKey(_0x18f5f8,_0x1726f2),_0x5b7589=cache[_0x59cda1(0x1ee)](_0x16b422);if(!_0x5b7589)return null;if(Date[_0x59cda1(0x1f7)]()-_0x5b7589[_0x59cda1(0x1fc)]>CACHE_TTL_MS)return cache[_0x59cda1(0x1f1)](_0x16b422),null;return _0x5b7589[_0x59cda1(0x1f0)];}export function setCachedCredential(_0x54d577,_0x17b7a1,_0x5ad647){const _0x2ed3b3=a57_0x22d0,_0x3a3afb=getCacheKey(_0x17b7a1,_0x5ad647);cache[_0x2ed3b3(0x1f8)](_0x3a3afb,{'apiKey':_0x54d577,'loadedAt':Date[_0x2ed3b3(0x1f7)]()});}function a57_0x22d0(_0x1176ea,_0x17cd92){_0x1176ea=_0x1176ea-0x1ee;const _0x23f4f5=a57_0x23f4();let _0x22d08e=_0x23f4f5[_0x1176ea];return _0x22d08e;}export function clearCredentialCache(){const _0x2665e3=a57_0x22d0;cache[_0x2665e3(0x1fa)]();}export function clearCachedCredential(_0x51e42d,_0x29d981){const _0x24a46e=a57_0x22d0,_0x4c4db6=getCacheKey(_0x51e42d,_0x29d981);cache[_0x24a46e(0x1f1)](_0x4c4db6);}
1
+ (function(_0x5d3d0e,_0x4b7b12){const _0x5c04d8=a57_0x231a,_0x3736dc=_0x5d3d0e();while(!![]){try{const _0x5d3de0=-parseInt(_0x5c04d8(0x1d6))/0x1+parseInt(_0x5c04d8(0x1cf))/0x2*(-parseInt(_0x5c04d8(0x1c8))/0x3)+-parseInt(_0x5c04d8(0x1d7))/0x4*(parseInt(_0x5c04d8(0x1cc))/0x5)+-parseInt(_0x5c04d8(0x1c7))/0x6+parseInt(_0x5c04d8(0x1d0))/0x7*(-parseInt(_0x5c04d8(0x1c9))/0x8)+-parseInt(_0x5c04d8(0x1cb))/0x9+parseInt(_0x5c04d8(0x1ce))/0xa;if(_0x5d3de0===_0x4b7b12)break;else _0x3736dc['push'](_0x3736dc['shift']());}catch(_0x480911){_0x3736dc['push'](_0x3736dc['shift']());}}}(a57_0xd44a,0x35eb0));function a57_0xd44a(){const _0x5ab706=['1185344izXJHX','2029410PRCJNF','321SdQkSM','2315064unOViP','loadedAt','2607615BOCYoa','5qmSoth','set','17737390LPsCew','3862AkdtAJ','7ZYLVKd','clear','__default_site__','now','delete','__default_profile__','132585UBJBVr'];a57_0xd44a=function(){return _0x5ab706;};return a57_0xd44a();}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x3d66f9,_0x547b29){const _0x23fe7c=a57_0x231a,_0x3a9787=_0x3d66f9||_0x23fe7c(0x1d2),_0x7cc601=_0x547b29||_0x23fe7c(0x1d5);return _0x3a9787+':'+_0x7cc601;}function a57_0x231a(_0x564a59,_0x234588){_0x564a59=_0x564a59-0x1c7;const _0xd44af4=a57_0xd44a();let _0x231aa4=_0xd44af4[_0x564a59];return _0x231aa4;}export function getCachedCredential(_0x4d7f14,_0xdd351e){const _0x2f59a1=a57_0x231a,_0x417681=getCacheKey(_0x4d7f14,_0xdd351e),_0x5cc499=cache['get'](_0x417681);if(!_0x5cc499)return null;if(Date['now']()-_0x5cc499[_0x2f59a1(0x1ca)]>CACHE_TTL_MS)return cache[_0x2f59a1(0x1d4)](_0x417681),null;return _0x5cc499['apiKey'];}export function setCachedCredential(_0x54a9f5,_0x22424b,_0x1df425){const _0x594451=a57_0x231a,_0x1fe70c=getCacheKey(_0x22424b,_0x1df425);cache[_0x594451(0x1cd)](_0x1fe70c,{'apiKey':_0x54a9f5,'loadedAt':Date[_0x594451(0x1d3)]()});}export function clearCredentialCache(){const _0x4332a7=a57_0x231a;cache[_0x4332a7(0x1d1)]();}export function clearCachedCredential(_0x4c93a2,_0x52f7bd){const _0x3c2ccc=a57_0x231a,_0x23d552=getCacheKey(_0x4c93a2,_0x52f7bd);cache[_0x3c2ccc(0x1d4)](_0x23d552);}
@@ -1 +1 @@
1
- function a58_0x5463(){const _0x590576=['workflow_project','INFO','resolveAPIKeyAsync','cliFlags','logLevel','Global\x20Credentials','[context]','segmentPath','2lmqhFz','bold','78700WBOWvv','getParameters','(active)','40xqhiEg','string','log','profileCredentials','1287126TFdzkz','getSource','[configuration\x20files]','global','llm_project','not\x20set','project','env','session','(using\x20session:\x20','existsSync','createAsync','163216VoapcY','globalCredentials','profile:\x20','Profile\x20Credentials','assign','parentSegment','database','profiles','.json','llm_agent','Global','tdx.json','Project','display','6550497npBsuZ','displayWithSources','profile','1152056WRbLtD','parent_segment','entries','none','replace','injectIntoOptions','segment_path','green','dim','sessions','llmProject','proxy','parse','join','cyan','utf-8','config','layers','.env','activeProfile','workflowProject','us01','verbose','llmAgent','462195nxvOOO','74564CaOptc','accessToken','apiKey','access_token','default','sessionId','site','configFiles','CLI\x20flag:\x20--','Session','profileSource'];a58_0x5463=function(){return _0x590576;};return a58_0x5463();}const a58_0x102413=a58_0x14e1;(function(_0x11e6ea,_0x3f0052){const _0x7be124=a58_0x14e1,_0x3929b5=_0x11e6ea();while(!![]){try{const _0x58c99d=parseInt(_0x7be124(0x185))/0x1+parseInt(_0x7be124(0x170))/0x2*(parseInt(_0x7be124(0x15c))/0x3)+parseInt(_0x7be124(0x144))/0x4+parseInt(_0x7be124(0x172))/0x5+parseInt(_0x7be124(0x179))/0x6+-parseInt(_0x7be124(0x15d))/0x7*(-parseInt(_0x7be124(0x175))/0x8)+-parseInt(_0x7be124(0x141))/0x9;if(_0x58c99d===_0x3f0052)break;else _0x3929b5['push'](_0x3929b5['shift']());}catch(_0xb1d6b4){_0x3929b5['push'](_0x3929b5['shift']());}}}(a58_0x5463,0x274d7));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';function a58_0x14e1(_0x5bee4a,_0x3f3c2a){_0x5bee4a=_0x5bee4a-0x13b;const _0x5463d0=a58_0x5463();let _0x14e1d2=_0x5463d0[_0x5bee4a];return _0x14e1d2;}import*as a58_0x315607 from'node:fs';import*as a58_0x1526f8 from'node:path';import a58_0x5bd287 from'chalk';export class GlobalContext{['site'];[a58_0x102413(0x18b)];[a58_0x102413(0x145)];[a58_0x102413(0x14a)];[a58_0x102413(0x17d)];['llm_agent'];[a58_0x102413(0x168)];['apiKey'];[a58_0x102413(0x15e)];[a58_0x102413(0x14f)];[a58_0x102413(0x15a)];['logLevel'];[a58_0x102413(0x143)];[a58_0x102413(0x167)]=null;[a58_0x102413(0x155)];[a58_0x102413(0x157)];['sessionId'];[a58_0x102413(0x164)];constructor(_0x1a692f){const _0x12eada=a58_0x102413;this[_0x12eada(0x162)]=getSessionID(_0x1a692f[_0x12eada(0x181)]);const _0xea2867=loadSessionContext(_0x1a692f[_0x12eada(0x181)]),_0x4f8258=loadProjectConfig(),_0x188acb=this['loadGlobalConfig']();if(_0x1a692f[_0x12eada(0x143)])this[_0x12eada(0x157)]=_0x1a692f[_0x12eada(0x143)],this[_0x12eada(0x167)]='cli';else{if(_0xea2867?.['profile'])this[_0x12eada(0x157)]=_0xea2867[_0x12eada(0x143)],this[_0x12eada(0x167)]=_0x12eada(0x181);else{if(_0x188acb['profile'])this[_0x12eada(0x157)]=_0x188acb[_0x12eada(0x143)],this[_0x12eada(0x167)]=_0x12eada(0x154);else process.env.TDX_PROFILE?(this[_0x12eada(0x157)]=process.env.TDX_PROFILE,this['profileSource']=_0x12eada(0x180)):(this['activeProfile']=null,this[_0x12eada(0x167)]=null);}}const _0x55011c=this[_0x12eada(0x157)]?loadProfile(this[_0x12eada(0x157)]):null,_0x3f8d5d=_0x33fd99=>{const _0x1d90ae=_0x12eada;if(!_0x33fd99)return{};const _0x2b7087=_0x33fd99,_0x2c4038={};for(const [_0xf3fe66,_0x4aa546]of Object[_0x1d90ae(0x146)](_0x2b7087)){typeof _0x4aa546===_0x1d90ae(0x176)&&(_0x2c4038[_0xf3fe66]=_0x4aa546);}return _0x2c4038;},_0x4c7e3a={},_0xcfed3=(_0xfa0959,_0x2bab85,_0x7b4010)=>{const _0x5c8e2a=_0x12eada;if(!_0xfa0959)return![];if(_0x7b4010&&_0xfa0959===_0x7b4010)return![];const _0x171faa=_0xea2867,_0x183f8d=_0x4f8258,_0x2d0409=_0x55011c?.[_0x5c8e2a(0x154)],_0x20862b=_0x188acb,_0x20fe62=_0x171faa?.[_0x2bab85],_0x1eae8f=_0x183f8d?.[_0x2bab85],_0x1670ed=_0x2d0409?.[_0x2bab85],_0x818873=_0x20862b[_0x2bab85];return _0xfa0959!==_0x20fe62&&_0xfa0959!==_0x1eae8f&&_0xfa0959!==_0x1670ed&&_0xfa0959!==_0x818873;},_0x483ba1=[{'optionKey':_0x12eada(0x163),'contextKey':_0x12eada(0x163),'defaultValue':_0x12eada(0x159)},{'optionKey':'database','contextKey':_0x12eada(0x18b)},{'optionKey':_0x12eada(0x18a),'contextKey':'parent_segment'},{'optionKey':_0x12eada(0x14e),'contextKey':_0x12eada(0x17d)},{'optionKey':_0x12eada(0x15b),'contextKey':_0x12eada(0x13c)},{'optionKey':_0x12eada(0x143),'contextKey':_0x12eada(0x143)}];for(const {optionKey:_0x4f550f,contextKey:_0x276c26,defaultValue:_0x402252}of _0x483ba1){const _0x3e1bc5=_0x1a692f[_0x4f550f];_0xcfed3(_0x3e1bc5,_0x276c26,_0x402252)&&(_0x4c7e3a[_0x276c26]=_0x3e1bc5);}this[_0x12eada(0x155)]={'cliFlags':_0x4c7e3a,'session':_0x3f8d5d(_0xea2867),'project':_0x3f8d5d(_0x4f8258),'profile':_0x3f8d5d(_0x55011c?.[_0x12eada(0x154)]),'global':_0x3f8d5d(_0x188acb)};const _0x2a59b0={...this[_0x12eada(0x155)][_0x12eada(0x17c)],...this[_0x12eada(0x155)]['profile'],...this[_0x12eada(0x155)]['project']};process.env.TDX_SITE&&!this['layers'][_0x12eada(0x181)][_0x12eada(0x163)]&&!this['layers'][_0x12eada(0x16b)]['site']&&(_0x2a59b0['site']=process.env.TDX_SITE);Object[_0x12eada(0x189)](_0x2a59b0,this[_0x12eada(0x155)]['session']),Object[_0x12eada(0x189)](_0x2a59b0,this[_0x12eada(0x155)][_0x12eada(0x16b)]);const _0xeb600=_0x2a59b0[_0x12eada(0x163)]||'us01';this[_0x12eada(0x163)]=resolveSite(_0xeb600),this[_0x12eada(0x18b)]=_0x2a59b0['database'],this[_0x12eada(0x145)]=_0x2a59b0[_0x12eada(0x145)],this[_0x12eada(0x14a)]=_0x2a59b0[_0x12eada(0x14a)],this[_0x12eada(0x17d)]=_0x2a59b0[_0x12eada(0x17d)],this[_0x12eada(0x13c)]=_0x2a59b0[_0x12eada(0x13c)],this[_0x12eada(0x168)]=_0x2a59b0[_0x12eada(0x168)],this[_0x12eada(0x15a)]=_0x1a692f[_0x12eada(0x15a)]||![],this[_0x12eada(0x16c)]=_0x1a692f[_0x12eada(0x16c)]??LogLevel[_0x12eada(0x169)],this[_0x12eada(0x143)]=this[_0x12eada(0x157)]||undefined,this[_0x12eada(0x15e)]=getAccessToken(this[_0x12eada(0x157)]||undefined),this['apiKey']=getAPIKey(this[_0x12eada(0x157)]||undefined);const _0x458dfa=typeof _0x188acb[_0x12eada(0x14f)]===_0x12eada(0x176)?_0x188acb[_0x12eada(0x14f)]:undefined;this[_0x12eada(0x14f)]=_0x458dfa||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x219011=getConfigDir(),_0x23cfd8=a58_0x1526f8[_0x12eada(0x151)](_0x219011,_0x12eada(0x14d),this['sessionId']+_0x12eada(0x13b)),_0x366dd9=findProjectConfigPath(),_0x2301b9=a58_0x1526f8[_0x12eada(0x151)](_0x219011,'tdx.json'),_0x3b8ae4=a58_0x1526f8[_0x12eada(0x151)](_0x219011,_0x12eada(0x156));let _0x1ccedd=null,_0x1660bd=null;this[_0x12eada(0x157)]&&(_0x1ccedd=a58_0x1526f8[_0x12eada(0x151)](_0x219011,_0x12eada(0x18c),this[_0x12eada(0x157)],'tdx.json'),_0x1660bd=a58_0x1526f8[_0x12eada(0x151)](_0x219011,'profiles',this['activeProfile'],_0x12eada(0x156))),this[_0x12eada(0x164)]={'session':a58_0x315607[_0x12eada(0x183)](_0x23cfd8)?_0x23cfd8:null,'project':_0x366dd9,'profile':_0x1ccedd&&a58_0x315607['existsSync'](_0x1ccedd)?_0x1ccedd:null,'profileCredentials':_0x1660bd&&a58_0x315607[_0x12eada(0x183)](_0x1660bd)?_0x1660bd:null,'global':a58_0x315607[_0x12eada(0x183)](_0x2301b9)?_0x2301b9:null,'globalCredentials':a58_0x315607['existsSync'](_0x3b8ae4)?_0x3b8ae4:null};}[a58_0x102413(0x17a)](_0x56e99c,_0x6122f1){const _0xbc6142=a58_0x102413;if(!_0x6122f1)return _0xbc6142(0x17e);const _0x45c2c2=_0x6122f1;if(this[_0xbc6142(0x155)][_0xbc6142(0x16b)][_0x56e99c]===_0x45c2c2){if(_0x56e99c===_0xbc6142(0x163)&&_0x45c2c2==='us01'&&!this[_0xbc6142(0x155)][_0xbc6142(0x181)]['site']&&!this[_0xbc6142(0x155)][_0xbc6142(0x17f)][_0xbc6142(0x163)]&&!this[_0xbc6142(0x155)][_0xbc6142(0x143)][_0xbc6142(0x163)]&&!this[_0xbc6142(0x155)][_0xbc6142(0x17c)][_0xbc6142(0x163)])return _0xbc6142(0x161);return _0xbc6142(0x165)+_0x56e99c[_0xbc6142(0x148)](/_/g,'-');}if(this[_0xbc6142(0x155)][_0xbc6142(0x181)][_0x56e99c]===_0x45c2c2)return'session';if(this[_0xbc6142(0x155)][_0xbc6142(0x17f)][_0x56e99c]===_0x45c2c2)return'project';if(this['layers'][_0xbc6142(0x143)][_0x56e99c]===_0x45c2c2)return _0xbc6142(0x187)+this['activeProfile'];if(this[_0xbc6142(0x155)][_0xbc6142(0x17c)][_0x56e99c]===_0x45c2c2)return _0xbc6142(0x17c);return _0xbc6142(0x161);}['loadGlobalConfig'](){const _0x203d66=a58_0x102413,_0x77e1c4=a58_0x1526f8[_0x203d66(0x151)](getConfigDir(),_0x203d66(0x13e));if(!a58_0x315607['existsSync'](_0x77e1c4))return{};try{const _0x51af12=a58_0x315607['readFileSync'](_0x77e1c4,_0x203d66(0x153));return JSON[_0x203d66(0x150)](_0x51af12);}catch{return{};}}[a58_0x102413(0x149)](_0x36a092){const _0x39cb66=a58_0x102413;_0x36a092['site']=this[_0x39cb66(0x163)],!_0x36a092[_0x39cb66(0x18b)]&&this[_0x39cb66(0x18b)]&&(_0x36a092['database']=this['database']),!_0x36a092[_0x39cb66(0x18a)]&&this[_0x39cb66(0x145)]&&(_0x36a092[_0x39cb66(0x18a)]=this[_0x39cb66(0x145)]),!_0x36a092[_0x39cb66(0x16f)]&&this[_0x39cb66(0x14a)]&&(_0x36a092['segmentPath']=this[_0x39cb66(0x14a)]),!_0x36a092[_0x39cb66(0x14e)]&&this[_0x39cb66(0x17d)]&&(_0x36a092[_0x39cb66(0x14e)]=this[_0x39cb66(0x17d)]),!_0x36a092[_0x39cb66(0x15b)]&&this['llm_agent']&&(_0x36a092[_0x39cb66(0x15b)]=this['llm_agent']),!_0x36a092[_0x39cb66(0x158)]&&this[_0x39cb66(0x168)]&&(_0x36a092[_0x39cb66(0x158)]=this[_0x39cb66(0x168)]);}['getParameters'](){const _0x8f3294=a58_0x102413;return[{'key':_0x8f3294(0x163),'value':this[_0x8f3294(0x163)]},{'key':_0x8f3294(0x18b),'value':this['database']},{'key':_0x8f3294(0x145),'value':this[_0x8f3294(0x145)]},{'key':_0x8f3294(0x14a),'value':this[_0x8f3294(0x14a)]},{'key':'llm_project','value':this[_0x8f3294(0x17d)]},{'key':'llm_agent','value':this[_0x8f3294(0x13c)]},{'key':_0x8f3294(0x168),'value':this[_0x8f3294(0x168)]},{'key':_0x8f3294(0x143),'value':this['activeProfile']||undefined}];}[a58_0x102413(0x140)](){const _0x44a01d=a58_0x102413;console[_0x44a01d(0x177)](a58_0x5bd287[_0x44a01d(0x171)](_0x44a01d(0x16e)));for(const {key:_0x4c40b6,value:_0x4c663d}of this[_0x44a01d(0x173)]()){_0x4c663d&&console[_0x44a01d(0x177)](a58_0x5bd287[_0x44a01d(0x152)](_0x4c40b6)+':\x20'+_0x4c663d);}}[a58_0x102413(0x142)](){const _0x56623f=a58_0x102413;console[_0x56623f(0x177)](a58_0x5bd287[_0x56623f(0x171)](_0x56623f(0x16e)));for(const {key:_0x4490b7,value:_0x437426}of this[_0x56623f(0x173)]()){if(_0x437426){const _0x1ac6a2=_0x4490b7===_0x56623f(0x143)?_0x56623f(0x174):'('+this[_0x56623f(0x17a)](_0x4490b7,_0x437426)+')';console[_0x56623f(0x177)](a58_0x5bd287['cyan'](_0x4490b7)+':\x20'+_0x437426+'\x20'+a58_0x5bd287[_0x56623f(0x14c)](_0x1ac6a2));}}console[_0x56623f(0x177)]('\x0a'+a58_0x5bd287[_0x56623f(0x171)](_0x56623f(0x17b)));const _0x36515f=[{'label':_0x56623f(0x166),'path':this['configFiles'][_0x56623f(0x181)],'extra':'(session:\x20'+this['sessionId']+')'},{'label':_0x56623f(0x13f),'path':this['configFiles'][_0x56623f(0x17f)]},{'label':'Profile','path':this[_0x56623f(0x164)][_0x56623f(0x143)]},{'label':_0x56623f(0x188),'path':this[_0x56623f(0x164)][_0x56623f(0x178)]},{'label':_0x56623f(0x13d),'path':this[_0x56623f(0x164)][_0x56623f(0x17c)]},{'label':_0x56623f(0x16d),'path':this[_0x56623f(0x164)][_0x56623f(0x186)]}];for(const {label:_0xf2d2cd,path:_0x302d66,extra:_0x202032}of _0x36515f){if(_0x302d66)console[_0x56623f(0x177)](a58_0x5bd287[_0x56623f(0x152)](_0xf2d2cd)+':\x20'+_0x302d66+'\x20'+a58_0x5bd287[_0x56623f(0x14b)]('✓')+(_0x202032?'\x20'+a58_0x5bd287[_0x56623f(0x14c)](_0x202032):''));else{if(_0xf2d2cd==='Session')console[_0x56623f(0x177)](a58_0x5bd287['cyan'](_0xf2d2cd)+':\x20'+a58_0x5bd287[_0x56623f(0x14c)](_0x56623f(0x147))+'\x20'+a58_0x5bd287[_0x56623f(0x14c)](_0x56623f(0x182)+this[_0x56623f(0x162)]+')'));else(_0xf2d2cd===_0x56623f(0x13f)||_0xf2d2cd==='Global')&&console[_0x56623f(0x177)](a58_0x5bd287[_0x56623f(0x152)](_0xf2d2cd)+':\x20'+a58_0x5bd287['dim']('none'));}}}async[a58_0x102413(0x16a)](){const _0x3a230c=a58_0x102413;if(!this[_0x3a230c(0x15e)]){const _0x4e26cc=await getOAuthTokens(this[_0x3a230c(0x157)]||undefined);if(_0x4e26cc)return this[_0x3a230c(0x15e)]=_0x4e26cc[_0x3a230c(0x160)],undefined;}return this['apiKey']=await getAPIKeyAsync(this['site'],this[_0x3a230c(0x157)]||undefined),this[_0x3a230c(0x15f)];}static async[a58_0x102413(0x184)](_0x1deaa8){const _0x408851=a58_0x102413,_0x177228=new GlobalContext(_0x1deaa8);return await _0x177228[_0x408851(0x16a)](),_0x177228;}}
1
+ const a58_0x68b67a=a58_0x5ddc;(function(_0xaf2721,_0x47f1a4){const _0x146b1f=a58_0x5ddc,_0x296486=_0xaf2721();while(!![]){try{const _0x3e8834=parseInt(_0x146b1f(0xe6))/0x1*(parseInt(_0x146b1f(0x121))/0x2)+parseInt(_0x146b1f(0xf1))/0x3+parseInt(_0x146b1f(0x120))/0x4*(parseInt(_0x146b1f(0xde))/0x5)+parseInt(_0x146b1f(0xf2))/0x6+-parseInt(_0x146b1f(0x10e))/0x7+parseInt(_0x146b1f(0xe8))/0x8+parseInt(_0x146b1f(0xe3))/0x9*(-parseInt(_0x146b1f(0x104))/0xa);if(_0x3e8834===_0x47f1a4)break;else _0x296486['push'](_0x296486['shift']());}catch(_0x311f1d){_0x296486['push'](_0x296486['shift']());}}}(a58_0x1c88,0xd7b67));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a58_0x6d8126 from'node:fs';function a58_0x1c88(){const _0x1f56ba=['workflow_project','INFO','join','llm_project','display','logLevel','cliFlags','100FElzos','62WFyAmd','activeProfile','existsSync','none','sessionId','dim','sessions','cyan','(using\x20session:\x20','tdx.json','profileSource','utf-8','project','displayWithSources','entries','Project','configFiles','loadGlobalConfig','154195oCSABc','createAsync','layers','accessToken','bold','426879Ztkbti','green','.json','44687QSMKJo','session','9808928wYfalG','llmProject','Global\x20Credentials','llm_agent','Profile','getSource','apiKey','us01','profiles','2290560hQRcvz','1039554biofBn','global','resolveAPIKeyAsync','not\x20set','workflowProject','string','[configuration\x20files]','site','profile:\x20','segment_path','proxy','injectIntoOptions','database','log','Profile\x20Credentials','default','access_token','parent_segment','680MpesjT','getParameters','Session','cli','env','[context]','profileCredentials','.env','(session:\x20','segmentPath','1472100jbtNWS','Global','parse','llmAgent','parentSegment','config','CLI\x20flag:\x20--','verbose','profile','globalCredentials','assign'];a58_0x1c88=function(){return _0x1f56ba;};return a58_0x1c88();}import*as a58_0x1a8fe4 from'node:path';function a58_0x5ddc(_0x271c0f,_0x5ec64e){_0x271c0f=_0x271c0f-0xd8;const _0x1c8824=a58_0x1c88();let _0x5ddc6b=_0x1c8824[_0x271c0f];return _0x5ddc6b;}import a58_0x1821de from'chalk';export class GlobalContext{[a58_0x68b67a(0xf9)];[a58_0x68b67a(0xfe)];['parent_segment'];[a58_0x68b67a(0xfb)];['llm_project'];[a58_0x68b67a(0xeb)];['workflow_project'];[a58_0x68b67a(0xee)];['accessToken'];[a58_0x68b67a(0xfc)];[a58_0x68b67a(0x115)];[a58_0x68b67a(0x11e)];[a58_0x68b67a(0x116)];[a58_0x68b67a(0x12b)]=null;[a58_0x68b67a(0xe0)];[a58_0x68b67a(0x122)];['sessionId'];[a58_0x68b67a(0xdc)];constructor(_0x13458d){const _0x1a61e5=a58_0x68b67a;this[_0x1a61e5(0x125)]=getSessionID(_0x13458d[_0x1a61e5(0xe7)]);const _0x24f4e7=loadSessionContext(_0x13458d[_0x1a61e5(0xe7)]),_0x23c1d1=loadProjectConfig(),_0x5e557f=this[_0x1a61e5(0xdd)]();if(_0x13458d[_0x1a61e5(0x116)])this[_0x1a61e5(0x122)]=_0x13458d['profile'],this[_0x1a61e5(0x12b)]=_0x1a61e5(0x107);else{if(_0x24f4e7?.[_0x1a61e5(0x116)])this['activeProfile']=_0x24f4e7[_0x1a61e5(0x116)],this[_0x1a61e5(0x12b)]=_0x1a61e5(0xe7);else{if(_0x5e557f[_0x1a61e5(0x116)])this[_0x1a61e5(0x122)]=_0x5e557f[_0x1a61e5(0x116)],this['profileSource']=_0x1a61e5(0x113);else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this[_0x1a61e5(0x12b)]=_0x1a61e5(0x108)):(this[_0x1a61e5(0x122)]=null,this[_0x1a61e5(0x12b)]=null);}}const _0x59a53d=this[_0x1a61e5(0x122)]?loadProfile(this['activeProfile']):null,_0x3033b2=_0x252a94=>{const _0x81a408=_0x1a61e5;if(!_0x252a94)return{};const _0x58fb9c=_0x252a94,_0x2f6d55={};for(const [_0x4b9d98,_0x170a19]of Object[_0x81a408(0xda)](_0x58fb9c)){typeof _0x170a19===_0x81a408(0xf7)&&(_0x2f6d55[_0x4b9d98]=_0x170a19);}return _0x2f6d55;},_0x255f49={},_0x2e67e0=(_0x146b1b,_0x21ecf2,_0x2aa595)=>{const _0x5af281=_0x1a61e5;if(!_0x146b1b)return![];if(_0x2aa595&&_0x146b1b===_0x2aa595)return![];const _0x4cf16d=_0x24f4e7,_0x3485ad=_0x23c1d1,_0xd627d4=_0x59a53d?.[_0x5af281(0x113)],_0x2a7f7c=_0x5e557f,_0x14ed99=_0x4cf16d?.[_0x21ecf2],_0xb138cd=_0x3485ad?.[_0x21ecf2],_0x1ccc27=_0xd627d4?.[_0x21ecf2],_0x5e4a7e=_0x2a7f7c[_0x21ecf2];return _0x146b1b!==_0x14ed99&&_0x146b1b!==_0xb138cd&&_0x146b1b!==_0x1ccc27&&_0x146b1b!==_0x5e4a7e;},_0x3d10b0=[{'optionKey':_0x1a61e5(0xf9),'contextKey':_0x1a61e5(0xf9),'defaultValue':'us01'},{'optionKey':'database','contextKey':_0x1a61e5(0xfe)},{'optionKey':_0x1a61e5(0x112),'contextKey':_0x1a61e5(0x103)},{'optionKey':_0x1a61e5(0xe9),'contextKey':_0x1a61e5(0x11c)},{'optionKey':_0x1a61e5(0x111),'contextKey':_0x1a61e5(0xeb)},{'optionKey':'profile','contextKey':_0x1a61e5(0x116)}];for(const {optionKey:_0x18482e,contextKey:_0x51bd7a,defaultValue:_0x209b16}of _0x3d10b0){const _0x2b1156=_0x13458d[_0x18482e];_0x2e67e0(_0x2b1156,_0x51bd7a,_0x209b16)&&(_0x255f49[_0x51bd7a]=_0x2b1156);}this[_0x1a61e5(0xe0)]={'cliFlags':_0x255f49,'session':_0x3033b2(_0x24f4e7),'project':_0x3033b2(_0x23c1d1),'profile':_0x3033b2(_0x59a53d?.['config']),'global':_0x3033b2(_0x5e557f)};const _0x404531={...this[_0x1a61e5(0xe0)][_0x1a61e5(0xf3)],...this[_0x1a61e5(0xe0)][_0x1a61e5(0x116)],...this[_0x1a61e5(0xe0)][_0x1a61e5(0xd8)]};process.env.TDX_SITE&&!this[_0x1a61e5(0xe0)]['session'][_0x1a61e5(0xf9)]&&!this[_0x1a61e5(0xe0)][_0x1a61e5(0x11f)][_0x1a61e5(0xf9)]&&(_0x404531[_0x1a61e5(0xf9)]=process.env.TDX_SITE);Object[_0x1a61e5(0x118)](_0x404531,this[_0x1a61e5(0xe0)]['session']),Object[_0x1a61e5(0x118)](_0x404531,this[_0x1a61e5(0xe0)][_0x1a61e5(0x11f)]);const _0x37f80c=_0x404531['site']||_0x1a61e5(0xef);this['site']=resolveSite(_0x37f80c),this[_0x1a61e5(0xfe)]=_0x404531[_0x1a61e5(0xfe)],this[_0x1a61e5(0x103)]=_0x404531[_0x1a61e5(0x103)],this[_0x1a61e5(0xfb)]=_0x404531[_0x1a61e5(0xfb)],this[_0x1a61e5(0x11c)]=_0x404531['llm_project'],this[_0x1a61e5(0xeb)]=_0x404531[_0x1a61e5(0xeb)],this[_0x1a61e5(0x119)]=_0x404531[_0x1a61e5(0x119)],this[_0x1a61e5(0x115)]=_0x13458d[_0x1a61e5(0x115)]||![],this[_0x1a61e5(0x11e)]=_0x13458d[_0x1a61e5(0x11e)]??LogLevel[_0x1a61e5(0x11a)],this[_0x1a61e5(0x116)]=this['activeProfile']||undefined,this[_0x1a61e5(0xe1)]=getAccessToken(this[_0x1a61e5(0x122)]||undefined),this['apiKey']=getAPIKey(this[_0x1a61e5(0x122)]||undefined);const _0x1681a8=typeof _0x5e557f[_0x1a61e5(0xfc)]===_0x1a61e5(0xf7)?_0x5e557f['proxy']:undefined;this[_0x1a61e5(0xfc)]=_0x1681a8||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x15080a=getConfigDir(),_0xd04f20=a58_0x1a8fe4['join'](_0x15080a,_0x1a61e5(0x127),this['sessionId']+_0x1a61e5(0xe5)),_0x4aec07=findProjectConfigPath(),_0xf32ae2=a58_0x1a8fe4['join'](_0x15080a,_0x1a61e5(0x12a)),_0x12018a=a58_0x1a8fe4['join'](_0x15080a,_0x1a61e5(0x10b));let _0x4c3ddd=null,_0x1d7737=null;this['activeProfile']&&(_0x4c3ddd=a58_0x1a8fe4[_0x1a61e5(0x11b)](_0x15080a,'profiles',this[_0x1a61e5(0x122)],_0x1a61e5(0x12a)),_0x1d7737=a58_0x1a8fe4[_0x1a61e5(0x11b)](_0x15080a,_0x1a61e5(0xf0),this[_0x1a61e5(0x122)],_0x1a61e5(0x10b))),this['configFiles']={'session':a58_0x6d8126['existsSync'](_0xd04f20)?_0xd04f20:null,'project':_0x4aec07,'profile':_0x4c3ddd&&a58_0x6d8126[_0x1a61e5(0x123)](_0x4c3ddd)?_0x4c3ddd:null,'profileCredentials':_0x1d7737&&a58_0x6d8126[_0x1a61e5(0x123)](_0x1d7737)?_0x1d7737:null,'global':a58_0x6d8126[_0x1a61e5(0x123)](_0xf32ae2)?_0xf32ae2:null,'globalCredentials':a58_0x6d8126[_0x1a61e5(0x123)](_0x12018a)?_0x12018a:null};}[a58_0x68b67a(0xed)](_0x5609e7,_0x13fd73){const _0x4a3fa3=a58_0x68b67a;if(!_0x13fd73)return _0x4a3fa3(0xf5);const _0x22d8c6=_0x13fd73;if(this[_0x4a3fa3(0xe0)][_0x4a3fa3(0x11f)][_0x5609e7]===_0x22d8c6){if(_0x5609e7===_0x4a3fa3(0xf9)&&_0x22d8c6===_0x4a3fa3(0xef)&&!this[_0x4a3fa3(0xe0)]['session'][_0x4a3fa3(0xf9)]&&!this[_0x4a3fa3(0xe0)]['project'][_0x4a3fa3(0xf9)]&&!this['layers'][_0x4a3fa3(0x116)][_0x4a3fa3(0xf9)]&&!this[_0x4a3fa3(0xe0)][_0x4a3fa3(0xf3)][_0x4a3fa3(0xf9)])return _0x4a3fa3(0x101);return _0x4a3fa3(0x114)+_0x5609e7['replace'](/_/g,'-');}if(this[_0x4a3fa3(0xe0)]['session'][_0x5609e7]===_0x22d8c6)return _0x4a3fa3(0xe7);if(this['layers'][_0x4a3fa3(0xd8)][_0x5609e7]===_0x22d8c6)return _0x4a3fa3(0xd8);if(this['layers']['profile'][_0x5609e7]===_0x22d8c6)return _0x4a3fa3(0xfa)+this[_0x4a3fa3(0x122)];if(this['layers'][_0x4a3fa3(0xf3)][_0x5609e7]===_0x22d8c6)return'global';return'default';}[a58_0x68b67a(0xdd)](){const _0x444aa0=a58_0x68b67a,_0x912bc=a58_0x1a8fe4[_0x444aa0(0x11b)](getConfigDir(),_0x444aa0(0x12a));if(!a58_0x6d8126['existsSync'](_0x912bc))return{};try{const _0x52113b=a58_0x6d8126['readFileSync'](_0x912bc,_0x444aa0(0x12c));return JSON[_0x444aa0(0x110)](_0x52113b);}catch{return{};}}[a58_0x68b67a(0xfd)](_0x57da0b){const _0x589ed9=a58_0x68b67a;_0x57da0b[_0x589ed9(0xf9)]=this[_0x589ed9(0xf9)],!_0x57da0b['database']&&this['database']&&(_0x57da0b[_0x589ed9(0xfe)]=this[_0x589ed9(0xfe)]),!_0x57da0b[_0x589ed9(0x112)]&&this[_0x589ed9(0x103)]&&(_0x57da0b[_0x589ed9(0x112)]=this[_0x589ed9(0x103)]),!_0x57da0b[_0x589ed9(0x10d)]&&this[_0x589ed9(0xfb)]&&(_0x57da0b[_0x589ed9(0x10d)]=this['segment_path']),!_0x57da0b['llmProject']&&this[_0x589ed9(0x11c)]&&(_0x57da0b['llmProject']=this[_0x589ed9(0x11c)]),!_0x57da0b[_0x589ed9(0x111)]&&this['llm_agent']&&(_0x57da0b['llmAgent']=this['llm_agent']),!_0x57da0b['workflowProject']&&this[_0x589ed9(0x119)]&&(_0x57da0b[_0x589ed9(0xf6)]=this[_0x589ed9(0x119)]);}[a58_0x68b67a(0x105)](){const _0x55f497=a58_0x68b67a;return[{'key':_0x55f497(0xf9),'value':this['site']},{'key':_0x55f497(0xfe),'value':this[_0x55f497(0xfe)]},{'key':_0x55f497(0x103),'value':this[_0x55f497(0x103)]},{'key':'segment_path','value':this[_0x55f497(0xfb)]},{'key':_0x55f497(0x11c),'value':this[_0x55f497(0x11c)]},{'key':'llm_agent','value':this[_0x55f497(0xeb)]},{'key':_0x55f497(0x119),'value':this[_0x55f497(0x119)]},{'key':_0x55f497(0x116),'value':this['activeProfile']||undefined}];}[a58_0x68b67a(0x11d)](){const _0xebbe2b=a58_0x68b67a;console[_0xebbe2b(0xff)](a58_0x1821de[_0xebbe2b(0xe2)](_0xebbe2b(0x109)));for(const {key:_0x568eb7,value:_0x124c12}of this[_0xebbe2b(0x105)]()){_0x124c12&&console[_0xebbe2b(0xff)](a58_0x1821de['cyan'](_0x568eb7)+':\x20'+_0x124c12);}}[a58_0x68b67a(0xd9)](){const _0x432af0=a58_0x68b67a;console[_0x432af0(0xff)](a58_0x1821de['bold'](_0x432af0(0x109)));for(const {key:_0x46b37a,value:_0x3bf4f4}of this[_0x432af0(0x105)]()){if(_0x3bf4f4){const _0x5ed9ea=_0x46b37a===_0x432af0(0x116)?'(active)':'('+this[_0x432af0(0xed)](_0x46b37a,_0x3bf4f4)+')';console[_0x432af0(0xff)](a58_0x1821de[_0x432af0(0x128)](_0x46b37a)+':\x20'+_0x3bf4f4+'\x20'+a58_0x1821de['dim'](_0x5ed9ea));}}console[_0x432af0(0xff)]('\x0a'+a58_0x1821de['bold'](_0x432af0(0xf8)));const _0x25a22f=[{'label':_0x432af0(0x106),'path':this['configFiles']['session'],'extra':_0x432af0(0x10c)+this[_0x432af0(0x125)]+')'},{'label':'Project','path':this[_0x432af0(0xdc)]['project']},{'label':_0x432af0(0xec),'path':this['configFiles'][_0x432af0(0x116)]},{'label':_0x432af0(0x100),'path':this['configFiles'][_0x432af0(0x10a)]},{'label':_0x432af0(0x10f),'path':this[_0x432af0(0xdc)]['global']},{'label':_0x432af0(0xea),'path':this[_0x432af0(0xdc)][_0x432af0(0x117)]}];for(const {label:_0x540b64,path:_0x14748b,extra:_0x29b084}of _0x25a22f){if(_0x14748b)console[_0x432af0(0xff)](a58_0x1821de['cyan'](_0x540b64)+':\x20'+_0x14748b+'\x20'+a58_0x1821de[_0x432af0(0xe4)]('✓')+(_0x29b084?'\x20'+a58_0x1821de['dim'](_0x29b084):''));else{if(_0x540b64==='Session')console[_0x432af0(0xff)](a58_0x1821de[_0x432af0(0x128)](_0x540b64)+':\x20'+a58_0x1821de[_0x432af0(0x126)](_0x432af0(0x124))+'\x20'+a58_0x1821de[_0x432af0(0x126)](_0x432af0(0x129)+this[_0x432af0(0x125)]+')'));else(_0x540b64===_0x432af0(0xdb)||_0x540b64===_0x432af0(0x10f))&&console[_0x432af0(0xff)](a58_0x1821de[_0x432af0(0x128)](_0x540b64)+':\x20'+a58_0x1821de[_0x432af0(0x126)](_0x432af0(0x124)));}}}async[a58_0x68b67a(0xf4)](){const _0x4b68dc=a58_0x68b67a;if(!this[_0x4b68dc(0xe1)]){const _0x53de05=await getOAuthTokens(this[_0x4b68dc(0x122)]||undefined);if(_0x53de05)return this[_0x4b68dc(0xe1)]=_0x53de05[_0x4b68dc(0x102)],undefined;}return this[_0x4b68dc(0xee)]=await getAPIKeyAsync(this[_0x4b68dc(0xf9)],this[_0x4b68dc(0x122)]||undefined),this[_0x4b68dc(0xee)];}static async[a58_0x68b67a(0xdf)](_0x359305){const _0x466308=new GlobalContext(_0x359305);return await _0x466308['resolveAPIKeyAsync'](),_0x466308;}}
@@ -1 +1 @@
1
- (function(_0x51a80c,_0x1e9249){const _0x16c68f=a59_0x1a0a,_0x2d5f45=_0x51a80c();while(!![]){try{const _0x4b20e7=parseInt(_0x16c68f(0x154))/0x1+parseInt(_0x16c68f(0x162))/0x2+-parseInt(_0x16c68f(0x168))/0x3+parseInt(_0x16c68f(0x15a))/0x4+parseInt(_0x16c68f(0x156))/0x5*(parseInt(_0x16c68f(0x16f))/0x6)+-parseInt(_0x16c68f(0x158))/0x7+-parseInt(_0x16c68f(0x16d))/0x8*(parseInt(_0x16c68f(0x152))/0x9);if(_0x4b20e7===_0x1e9249)break;else _0x2d5f45['push'](_0x2d5f45['shift']());}catch(_0x1d833a){_0x2d5f45['push'](_0x2d5f45['shift']());}}}(a59_0x2fdd,0x24068));function a59_0x1a0a(_0x352d8b,_0x47e1b2){_0x352d8b=_0x352d8b-0x152;const _0x2fdde2=a59_0x2fdd();let _0x1a0a53=_0x2fdde2[_0x352d8b];return _0x1a0a53;}const SERVICE_NAME='tdx';function a59_0x2fdd(){const _0x22ef67=['success','1064ABVKUS','not_found','210tawTcl','message','16515iBQAmy','@napi-rs/keyring','132078ORCVHP','getPassword','13540wFlPgu','value','220633vaCbNs','deleteCredential','456584nXwqpb','access','cannot\x20find','profile:','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.','not\x20available','not\x20found','includes','228474aKyNib','-25300','unavailable','could\x20not\x20be\x20found','restricted','no\x20matching\x20entry','96321rzbBrZ','toLowerCase','reason','access_denied'];a59_0x2fdd=function(){return _0x22ef67;};return a59_0x2fdd();}let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x27a5e5=a59_0x1a0a;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x5446c4=await import(_0x27a5e5(0x153));return EntryClass=_0x5446c4['Entry'],EntryClass;}catch(_0x573cc8){return keyringLoadError=_0x573cc8 instanceof Error?_0x573cc8:new Error(String(_0x573cc8)),null;}}function getAccountName(_0x25bad3){const _0x4574bd=a59_0x1a0a,_0x5cd961=_0x25bad3||'';return _0x4574bd(0x15d)+_0x5cd961+':api_key';}export async function getKeychainAPIKey(_0x1221d2){const _0x360f25=a59_0x1a0a,_0x3ef203=await getKeychainAPIKeyWithStatus(_0x1221d2);if(_0x3ef203[_0x360f25(0x16c)])return _0x3ef203[_0x360f25(0x157)];return _0x3ef203[_0x360f25(0x16a)]===_0x360f25(0x16b)&&console['error']('Warning:\x20'+_0x3ef203[_0x360f25(0x170)]),null;}export async function getKeychainAPIKeyWithStatus(_0x56574b){const _0x1620cc=a59_0x1a0a;try{const _0x1915e4=await getEntryClass();if(!_0x1915e4)return{'success':![],'reason':'unavailable'};const _0x2163d7=getAccountName(_0x56574b),_0x45c230=new _0x1915e4(SERVICE_NAME,_0x2163d7),_0x35e0c3=_0x45c230['getPassword']();if(_0x35e0c3)return{'success':!![],'value':_0x35e0c3};return{'success':![],'reason':'not_found'};}catch(_0x15cb5d){const _0x5862ac=_0x15cb5d instanceof Error?_0x15cb5d['message']:String(_0x15cb5d);if(_0x5862ac['includes'](_0x1620cc(0x163))||_0x5862ac['toLowerCase']()[_0x1620cc(0x161)](_0x1620cc(0x165))||_0x5862ac[_0x1620cc(0x169)]()['includes'](_0x1620cc(0x160))||_0x5862ac[_0x1620cc(0x169)]()['includes'](_0x1620cc(0x167)))return{'success':![],'reason':_0x1620cc(0x16e)};if(_0x5862ac[_0x1620cc(0x161)]('-25293')||_0x5862ac[_0x1620cc(0x169)]()[_0x1620cc(0x161)](_0x1620cc(0x166))||_0x5862ac['toLowerCase']()[_0x1620cc(0x161)](_0x1620cc(0x15b)))return{'success':![],'reason':_0x1620cc(0x16b),'message':_0x1620cc(0x15e)};return{'success':![],'reason':_0x1620cc(0x164),'message':_0x5862ac};}}export async function saveKeychainAPIKey(_0x898932,_0x125ebc){const _0x31ea41=await getEntryClass();if(!_0x31ea41)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x46e75e=getAccountName(_0x125ebc),_0x508f6b=new _0x31ea41(SERVICE_NAME,_0x46e75e);_0x508f6b['setPassword'](_0x898932);}export async function deleteKeychainAPIKey(_0x33afab){const _0x52cde8=a59_0x1a0a;try{const _0x47040c=await getEntryClass();if(!_0x47040c)return![];const _0x4714cf=getAccountName(_0x33afab),_0xc84f71=new _0x47040c(SERVICE_NAME,_0x4714cf);return _0xc84f71[_0x52cde8(0x159)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x18835e=a59_0x1a0a;try{const _0x47cbe6=await getEntryClass();if(!_0x47cbe6)return![];const _0x8ae180=new _0x47cbe6(SERVICE_NAME,'__keychain_test__');return _0x8ae180[_0x18835e(0x155)](),!![];}catch(_0x2947f0){const _0x447648=_0x2947f0 instanceof Error?_0x2947f0[_0x18835e(0x170)][_0x18835e(0x169)]():'';if(_0x447648[_0x18835e(0x161)](_0x18835e(0x15f))||_0x447648['includes']('not\x20supported')||_0x447648['includes'](_0x18835e(0x15c)))return![];return!![];}}
1
+ const a59_0x372af8=a59_0x4a18;(function(_0x3233cb,_0x462fce){const _0x2a5f18=a59_0x4a18,_0x5196bb=_0x3233cb();while(!![]){try{const _0x46e61a=-parseInt(_0x2a5f18(0xd5))/0x1*(-parseInt(_0x2a5f18(0xd8))/0x2)+parseInt(_0x2a5f18(0xe8))/0x3+-parseInt(_0x2a5f18(0xe4))/0x4*(parseInt(_0x2a5f18(0xe6))/0x5)+-parseInt(_0x2a5f18(0xea))/0x6*(parseInt(_0x2a5f18(0xdf))/0x7)+parseInt(_0x2a5f18(0xe5))/0x8+-parseInt(_0x2a5f18(0xf2))/0x9+parseInt(_0x2a5f18(0xdd))/0xa*(parseInt(_0x2a5f18(0xf1))/0xb);if(_0x46e61a===_0x462fce)break;else _0x5196bb['push'](_0x5196bb['shift']());}catch(_0x17efc8){_0x5196bb['push'](_0x5196bb['shift']());}}}(a59_0x22a7,0x65772));const SERVICE_NAME=a59_0x372af8(0xdc);let EntryClass=null,keyringLoadError=null;function a59_0x22a7(){const _0x136811=['error','restricted','__keychain_test__','not\x20available','access_denied','profile:','286QWfbJM','5572386jLxrer','not\x20found','@napi-rs/keyring','System\x20keychain\x20is\x20not\x20available','Entry',':api_key','getPassword','-25300','Warning:\x20','543JqUQsA','setPassword','toLowerCase','522GCLRkO','includes','no\x20matching\x20entry','reason','tdx','106550tNrJpi','unavailable','7RJrZcY','value','success','not_found','access','22228nBcFnd','6409616WrtvSq','25arIwHw','message','599403fBuNwk','cannot\x20find','2143290fHqqEE'];a59_0x22a7=function(){return _0x136811;};return a59_0x22a7();}async function getEntryClass(){const _0x16088d=a59_0x372af8;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x345577=await import(_0x16088d(0xf4));return EntryClass=_0x345577[_0x16088d(0xf6)],EntryClass;}catch(_0x4d7e3e){return keyringLoadError=_0x4d7e3e instanceof Error?_0x4d7e3e:new Error(String(_0x4d7e3e)),null;}}function getAccountName(_0xa31fc7){const _0x1e7503=a59_0x372af8,_0x4965af=_0xa31fc7||'';return _0x1e7503(0xf0)+_0x4965af+_0x1e7503(0xf7);}export async function getKeychainAPIKey(_0x5ba53d){const _0x4ddfae=a59_0x372af8,_0x46f719=await getKeychainAPIKeyWithStatus(_0x5ba53d);if(_0x46f719[_0x4ddfae(0xe1)])return _0x46f719[_0x4ddfae(0xe0)];return _0x46f719[_0x4ddfae(0xdb)]===_0x4ddfae(0xef)&&console[_0x4ddfae(0xeb)](_0x4ddfae(0xd4)+_0x46f719[_0x4ddfae(0xe7)]),null;}export async function getKeychainAPIKeyWithStatus(_0x3a5701){const _0x5702b0=a59_0x372af8;try{const _0x244bd0=await getEntryClass();if(!_0x244bd0)return{'success':![],'reason':'unavailable'};const _0x21834e=getAccountName(_0x3a5701),_0x2c644b=new _0x244bd0(SERVICE_NAME,_0x21834e),_0x261503=_0x2c644b[_0x5702b0(0xf8)]();if(_0x261503)return{'success':!![],'value':_0x261503};return{'success':![],'reason':'not_found'};}catch(_0x32acc6){const _0x3ab10f=_0x32acc6 instanceof Error?_0x32acc6[_0x5702b0(0xe7)]:String(_0x32acc6);if(_0x3ab10f[_0x5702b0(0xd9)](_0x5702b0(0xf9))||_0x3ab10f['toLowerCase']()[_0x5702b0(0xd9)]('could\x20not\x20be\x20found')||_0x3ab10f['toLowerCase']()[_0x5702b0(0xd9)](_0x5702b0(0xf3))||_0x3ab10f[_0x5702b0(0xd7)]()['includes'](_0x5702b0(0xda)))return{'success':![],'reason':_0x5702b0(0xe2)};if(_0x3ab10f[_0x5702b0(0xd9)]('-25293')||_0x3ab10f[_0x5702b0(0xd7)]()[_0x5702b0(0xd9)](_0x5702b0(0xec))||_0x3ab10f[_0x5702b0(0xd7)]()['includes'](_0x5702b0(0xe3)))return{'success':![],'reason':'access_denied','message':'Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.'};return{'success':![],'reason':_0x5702b0(0xde),'message':_0x3ab10f};}}export async function saveKeychainAPIKey(_0x4cdbd,_0x4743a6){const _0x48daf7=a59_0x372af8,_0x18a9ae=await getEntryClass();if(!_0x18a9ae)throw new Error(_0x48daf7(0xf5));const _0x4a0e58=getAccountName(_0x4743a6),_0x4b72b2=new _0x18a9ae(SERVICE_NAME,_0x4a0e58);_0x4b72b2[_0x48daf7(0xd6)](_0x4cdbd);}function a59_0x4a18(_0xf4a54e,_0x45fef1){_0xf4a54e=_0xf4a54e-0xd4;const _0x22a76d=a59_0x22a7();let _0x4a1834=_0x22a76d[_0xf4a54e];return _0x4a1834;}export async function deleteKeychainAPIKey(_0xd3a993){try{const _0x4efe36=await getEntryClass();if(!_0x4efe36)return![];const _0xaa264b=getAccountName(_0xd3a993),_0x281ca2=new _0x4efe36(SERVICE_NAME,_0xaa264b);return _0x281ca2['deleteCredential'](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x3818c5=a59_0x372af8;try{const _0x49217b=await getEntryClass();if(!_0x49217b)return![];const _0x50ec15=new _0x49217b(SERVICE_NAME,_0x3818c5(0xed));return _0x50ec15['getPassword'](),!![];}catch(_0x37f5d6){const _0x1e523e=_0x37f5d6 instanceof Error?_0x37f5d6[_0x3818c5(0xe7)][_0x3818c5(0xd7)]():'';if(_0x1e523e[_0x3818c5(0xd9)](_0x3818c5(0xee))||_0x1e523e[_0x3818c5(0xd9)]('not\x20supported')||_0x1e523e['includes'](_0x3818c5(0xe9)))return![];return!![];}}
@@ -1 +1 @@
1
- const a60_0x2805d5=a60_0x9de5;(function(_0x2ea865,_0x1753e0){const _0x1b0725=a60_0x9de5,_0x483a60=_0x2ea865();while(!![]){try{const _0x3d0c09=parseInt(_0x1b0725(0x1b2))/0x1*(parseInt(_0x1b0725(0x1aa))/0x2)+parseInt(_0x1b0725(0x1a8))/0x3+-parseInt(_0x1b0725(0x1a6))/0x4*(-parseInt(_0x1b0725(0x1ae))/0x5)+-parseInt(_0x1b0725(0x1ac))/0x6+parseInt(_0x1b0725(0x1b3))/0x7+parseInt(_0x1b0725(0x1a7))/0x8+-parseInt(_0x1b0725(0x1a9))/0x9;if(_0x3d0c09===_0x1753e0)break;else _0x483a60['push'](_0x483a60['shift']());}catch(_0x5be406){_0x483a60['push'](_0x483a60['shift']());}}}(a60_0x1012,0x7bade));const SERVICE_NAME=a60_0x2805d5(0x1b0);function a60_0x1012(){const _0x10295b=['deleteCredential','1guaAkj','4714871WgOnFD','stringify','8DQkGTI','2338680klWPau','1884006ToLGTW','16042671sXoTlW','1959450kBRhWb','profile:','5408232RcsvgT','System\x20keychain\x20is\x20not\x20available','1542165pKtKTm',':oauth_tokens','tdx'];a60_0x1012=function(){return _0x10295b;};return a60_0x1012();}let EntryClass=null,keyringLoadError=null;async function getEntryClass(){if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x1e0373=await import('@napi-rs/keyring');return EntryClass=_0x1e0373['Entry'],EntryClass;}catch(_0x1b7141){return keyringLoadError=_0x1b7141 instanceof Error?_0x1b7141:new Error(String(_0x1b7141)),null;}}function a60_0x9de5(_0x1fed00,_0x2a19ea){_0x1fed00=_0x1fed00-0x1a5;const _0x1012ff=a60_0x1012();let _0x9de557=_0x1012ff[_0x1fed00];return _0x9de557;}function getOAuthAccountName(_0x2f58b3){const _0x4bf5f8=a60_0x2805d5,_0x585d3e=_0x2f58b3||'';return _0x4bf5f8(0x1ab)+_0x585d3e+_0x4bf5f8(0x1af);}export async function saveOAuthTokens(_0x569261,_0x46e5a4){const _0x207de5=a60_0x2805d5,_0x4181c1=await getEntryClass();if(!_0x4181c1)throw new Error(_0x207de5(0x1ad));const _0x49dedc=getOAuthAccountName(_0x46e5a4),_0x20ac69=new _0x4181c1(SERVICE_NAME,_0x49dedc);_0x20ac69['setPassword'](JSON[_0x207de5(0x1a5)](_0x569261));}export async function getOAuthTokens(_0x4da822){try{const _0x4035bc=await getEntryClass();if(!_0x4035bc)return null;const _0x29ad94=getOAuthAccountName(_0x4da822),_0x458c13=new _0x4035bc(SERVICE_NAME,_0x29ad94),_0x197d6b=_0x458c13['getPassword']();if(_0x197d6b)return JSON['parse'](_0x197d6b);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x3af2d1){const _0x3d727f=a60_0x2805d5;try{const _0x27f087=await getEntryClass();if(!_0x27f087)return![];const _0x1b13f9=getOAuthAccountName(_0x3af2d1),_0x4983fe=new _0x27f087(SERVICE_NAME,_0x1b13f9);return _0x4983fe[_0x3d727f(0x1b1)](),!![];}catch{return![];}}
1
+ const a60_0x2ff146=a60_0x7783;(function(_0x40d470,_0x1bc6bc){const _0x59db1b=a60_0x7783,_0x208b70=_0x40d470();while(!![]){try{const _0x4ff01d=parseInt(_0x59db1b(0x10b))/0x1*(parseInt(_0x59db1b(0x107))/0x2)+-parseInt(_0x59db1b(0x108))/0x3+-parseInt(_0x59db1b(0x102))/0x4+parseInt(_0x59db1b(0x106))/0x5*(-parseInt(_0x59db1b(0xfc))/0x6)+-parseInt(_0x59db1b(0x100))/0x7+-parseInt(_0x59db1b(0x10a))/0x8*(-parseInt(_0x59db1b(0x10c))/0x9)+-parseInt(_0x59db1b(0x104))/0xa*(-parseInt(_0x59db1b(0x101))/0xb);if(_0x4ff01d===_0x1bc6bc)break;else _0x208b70['push'](_0x208b70['shift']());}catch(_0xa2b653){_0x208b70['push'](_0x208b70['shift']());}}}(a60_0x3792,0x6f5fc));function a60_0x3792(){const _0x40ba63=['@napi-rs/keyring','298434gjEYmI','Entry','parse','stringify','338303GIAtVj','22fMoRMT','3245776WxMVVA','tdx','7187170LoyHTS','profile:','25OelXhg','496246JeLGak','1850691JUfMbd','setPassword','1983984KdAaCf','1GYUBsP','18wbkALn'];a60_0x3792=function(){return _0x40ba63;};return a60_0x3792();}const SERVICE_NAME=a60_0x2ff146(0x103);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x54ad8c=a60_0x2ff146;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x3eb8ee=await import(_0x54ad8c(0x10d));return EntryClass=_0x3eb8ee[_0x54ad8c(0xfd)],EntryClass;}catch(_0x4a777a){return keyringLoadError=_0x4a777a instanceof Error?_0x4a777a:new Error(String(_0x4a777a)),null;}}function getOAuthAccountName(_0x1d7b93){const _0x14b0d9=a60_0x2ff146,_0x13f7ea=_0x1d7b93||'';return _0x14b0d9(0x105)+_0x13f7ea+':oauth_tokens';}export async function saveOAuthTokens(_0x532116,_0x4b5494){const _0x18b9e9=a60_0x2ff146,_0x1d3e7a=await getEntryClass();if(!_0x1d3e7a)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x355846=getOAuthAccountName(_0x4b5494),_0x7f1048=new _0x1d3e7a(SERVICE_NAME,_0x355846);_0x7f1048[_0x18b9e9(0x109)](JSON[_0x18b9e9(0xff)](_0x532116));}function a60_0x7783(_0x5affe0,_0x545b6f){_0x5affe0=_0x5affe0-0xfc;const _0x3792e9=a60_0x3792();let _0x7783d0=_0x3792e9[_0x5affe0];return _0x7783d0;}export async function getOAuthTokens(_0x249fe2){const _0x90d5f8=a60_0x2ff146;try{const _0x2c9417=await getEntryClass();if(!_0x2c9417)return null;const _0x4dd24f=getOAuthAccountName(_0x249fe2),_0x276b16=new _0x2c9417(SERVICE_NAME,_0x4dd24f),_0x20e90f=_0x276b16['getPassword']();if(_0x20e90f)return JSON[_0x90d5f8(0xfe)](_0x20e90f);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x19347d){try{const _0x54ffe5=await getEntryClass();if(!_0x54ffe5)return![];const _0x23a3e9=getOAuthAccountName(_0x19347d),_0x1d905f=new _0x54ffe5(SERVICE_NAME,_0x23a3e9);return _0x1d905f['deleteCredential'](),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a61_0x29904a=a61_0x2cd5;(function(_0x17cc4a,_0x8d364d){const _0x46bb6a=a61_0x2cd5,_0x28b92c=_0x17cc4a();while(!![]){try{const _0x64cf03=parseInt(_0x46bb6a(0xdb))/0x1*(parseInt(_0x46bb6a(0xac))/0x2)+-parseInt(_0x46bb6a(0xd3))/0x3+-parseInt(_0x46bb6a(0xc3))/0x4*(parseInt(_0x46bb6a(0xb5))/0x5)+-parseInt(_0x46bb6a(0xe5))/0x6+parseInt(_0x46bb6a(0xdf))/0x7+parseInt(_0x46bb6a(0xb1))/0x8+-parseInt(_0x46bb6a(0xd4))/0x9*(-parseInt(_0x46bb6a(0xcc))/0xa);if(_0x64cf03===_0x8d364d)break;else _0x28b92c['push'](_0x28b92c['shift']());}catch(_0x1eca23){_0x28b92c['push'](_0x28b92c['shift']());}}}(a61_0x8b57,0x46df8));function a61_0x2cd5(_0xb8136a,_0x4abdbe){_0xb8136a=_0xb8136a-0xab;const _0x8b57f5=a61_0x8b57();let _0x2cd5ea=_0x8b57f5[_0xb8136a];return _0x2cd5ea;}import*as a61_0x41c7a4 from'node:crypto';import*as a61_0x3575b2 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a61_0x29904a(0xd2),a61_0x29904a(0xd7),a61_0x29904a(0xab),a61_0x29904a(0xc8),a61_0x29904a(0xbf)]);export function isOAuthSupported(_0x35034d){const _0xb19b2c=a61_0x29904a;return OAUTH_SUPPORTED_SITES[_0xb19b2c(0xc9)](_0x35034d);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI='http://localhost:'+OAUTH_CALLBACK_PORT+'/oauth/callback';export function getOAuthClientId(){const _0x1039aa=a61_0x29904a;return process.env.TD_OAUTH_CLIENT_ID||_0x1039aa(0xc0);}export function generatePKCEPair(){const _0x578382=a61_0x29904a,_0x4bc728=a61_0x41c7a4[_0x578382(0xe2)](0x20)[_0x578382(0xaf)](_0x578382(0xae)),_0x2db21a=a61_0x41c7a4[_0x578382(0xea)](_0x578382(0xbd))[_0x578382(0xe4)](_0x4bc728)[_0x578382(0xe7)]('base64url');return{'verifier':_0x4bc728,'challenge':_0x2db21a};}export function buildAuthorizeURL(_0x47a1f9,_0x5351ff){const _0x545a53=a61_0x29904a,_0x25d7b2=new URL(_0x545a53(0xe9),_0x47a1f9);return _0x25d7b2[_0x545a53(0xde)][_0x545a53(0xc7)](_0x545a53(0xce),_0x545a53(0xd9)),_0x25d7b2['searchParams'][_0x545a53(0xc7)]('client_id',_0x5351ff['clientId']),_0x25d7b2[_0x545a53(0xde)][_0x545a53(0xc7)](_0x545a53(0xd6),_0x5351ff[_0x545a53(0xe8)]),_0x25d7b2[_0x545a53(0xde)][_0x545a53(0xc7)](_0x545a53(0xcd),_0x5351ff[_0x545a53(0xcd)]),_0x25d7b2[_0x545a53(0xde)]['set'](_0x545a53(0xcb),_0x5351ff['codeChallenge']),_0x25d7b2[_0x545a53(0xde)][_0x545a53(0xc7)](_0x545a53(0xd0),'S256'),_0x5351ff['scope']&&_0x25d7b2['searchParams'][_0x545a53(0xc7)]('scope',_0x5351ff[_0x545a53(0xeb)]),_0x25d7b2[_0x545a53(0xaf)]();}export async function postTokenRequest(_0x5a1c7e,_0x5365d6){const _0x36e4ea=a61_0x29904a,_0x31b6a4=new URLSearchParams(_0x5365d6)['toString'](),_0x19210f=await fetch(_0x5a1c7e,{'method':_0x36e4ea(0xb0),'headers':{'Content-Type':_0x36e4ea(0xb3)},'body':_0x31b6a4});if(!_0x19210f['ok']){const _0x2a6b81=await _0x19210f[_0x36e4ea(0xcf)]();throw new Error(_0x36e4ea(0xd5)+_0x19210f[_0x36e4ea(0xe3)]+_0x36e4ea(0xad)+_0x2a6b81);}return await _0x19210f[_0x36e4ea(0xbe)]();}export async function exchangeCodeForTokens(_0x650902,_0x39bc0d,_0x1ac7ac,_0x41be1e){const _0x4a4270=a61_0x29904a,_0x890ef5=_0x650902+_0x4a4270(0xda);return postTokenRequest(_0x890ef5,{'grant_type':_0x4a4270(0xd1),'client_id':getOAuthClientId(),'code':_0x39bc0d,'code_verifier':_0x1ac7ac,'redirect_uri':_0x41be1e});}export function startLocalCallbackServer(){const _0x4fa092=a61_0x29904a;let _0x1c1e14,_0x65ec;const _0x2e0c67=new Promise((_0x56b297,_0x493732)=>{_0x1c1e14=_0x56b297,_0x65ec=_0x493732;}),_0x26ee70=a61_0x3575b2[_0x4fa092(0xe6)]((_0x3015a1,_0xdbe1f6)=>{const _0x14f487=_0x4fa092,_0x408417=new URL(_0x3015a1[_0x14f487(0xe1)]||'/','http://127.0.0.1');if(_0x408417[_0x14f487(0xd8)]!==_0x14f487(0xb9)){_0xdbe1f6[_0x14f487(0xb2)](0x194,{'Content-Type':'text/plain'}),_0xdbe1f6[_0x14f487(0xb8)]('Not\x20Found');return;}const _0x34439=_0x408417[_0x14f487(0xde)][_0x14f487(0xb4)](_0x14f487(0xd9)),_0x586cb2=_0x408417[_0x14f487(0xde)]['get'](_0x14f487(0xcd)),_0x50f180=_0x408417[_0x14f487(0xde)][_0x14f487(0xb4)](_0x14f487(0xb6));if(_0x50f180||!_0x34439||!_0x586cb2){_0xdbe1f6['writeHead'](0x190,{'Content-Type':_0x14f487(0xc2)}),_0xdbe1f6['end'](_0x14f487(0xdd)),_0x65ec(new Error(_0x14f487(0xbc)));return;}_0xdbe1f6['writeHead'](0xc8,{'Content-Type':'text/html'}),_0xdbe1f6['end']('<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),_0x1c1e14({'code':_0x34439,'state':_0x586cb2});});_0x26ee70['on']('error',_0x4c3ea1=>{const _0x57258e=_0x4fa092;_0x4c3ea1[_0x57258e(0xd9)]==='EADDRINUSE'?_0x65ec(new Error(_0x57258e(0xc4)+OAUTH_CALLBACK_PORT+_0x57258e(0xc6))):_0x65ec(new Error(_0x57258e(0xbb)+_0x4c3ea1[_0x57258e(0xec)]));}),_0x26ee70[_0x4fa092(0xdc)](OAUTH_CALLBACK_PORT,_0x4fa092(0xb7));const _0x4ec7de=setTimeout(()=>{const _0x584e36=_0x4fa092;_0x65ec(new Error(_0x584e36(0xe0))),_0x26ee70[_0x584e36(0xba)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x2e0c67,'close':()=>{const _0xe6206d=_0x4fa092;clearTimeout(_0x4ec7de),_0x26ee70[_0xe6206d(0xba)]();}};}function a61_0x8b57(){const _0x256802=['):\x20','base64url','toString','POST','3094120ZHtdtk','writeHead','application/x-www-form-urlencoded','get','5bZleNf','error','127.0.0.1','end','/oauth/callback','close','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','sha256','json','stg-ap03','tdx','waitForCallback','text/html','2117084EScFlC','Port\x20','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','set','stg-ap01','has','hex','code_challenge','5423530aZroDM','state','response_type','text','code_challenge_method','authorization_code','dev-us01','1184424lJHFrw','18GVthRF','OAuth\x20token\x20request\x20failed\x20(','redirect_uri','dev-eu01','pathname','code','/oauth/token','41EFpGmV','listen','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','searchParams','776370VQNBBt','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','url','randomBytes','status','update','2696346amAmPH','createServer','digest','redirectUri','/oauth/authorize','createHash','scope','message','stg-us01','3970DVyEze'];a61_0x8b57=function(){return _0x256802;};return a61_0x8b57();}export async function startOAuthFlow(_0x3113a5){const _0x2363fa=a61_0x29904a,_0x190c69=getConsoleUrl(_0x3113a5),_0xa7db70=getOAuthClientId(),{verifier:_0xe0f7e3,challenge:_0x523181}=generatePKCEPair(),_0x572953=a61_0x41c7a4[_0x2363fa(0xe2)](0x10)[_0x2363fa(0xaf)](_0x2363fa(0xca)),_0x51ed44=startLocalCallbackServer();try{const _0x21124b=OAUTH_REDIRECT_URI,_0x2f826c=buildAuthorizeURL(_0x190c69,{'clientId':_0xa7db70,'redirectUri':_0x21124b,'state':_0x572953,'codeChallenge':_0x523181});openBrowser(_0x2f826c);const _0x37c4d4=await _0x51ed44[_0x2363fa(0xc1)]();if(_0x37c4d4[_0x2363fa(0xcd)]!==_0x572953)throw new Error(_0x2363fa(0xc5));return await exchangeCodeForTokens(_0x190c69,_0x37c4d4[_0x2363fa(0xd9)],_0xe0f7e3,_0x21124b);}finally{_0x51ed44['close']();}}
1
+ const a61_0x384251=a61_0xd297;(function(_0x16a60b,_0x171761){const _0x31d71f=a61_0xd297,_0x2f0b6a=_0x16a60b();while(!![]){try{const _0xbc9708=-parseInt(_0x31d71f(0x16e))/0x1*(-parseInt(_0x31d71f(0x18e))/0x2)+-parseInt(_0x31d71f(0x169))/0x3+parseInt(_0x31d71f(0x19d))/0x4*(parseInt(_0x31d71f(0x176))/0x5)+-parseInt(_0x31d71f(0x19b))/0x6+-parseInt(_0x31d71f(0x172))/0x7*(-parseInt(_0x31d71f(0x17d))/0x8)+-parseInt(_0x31d71f(0x187))/0x9+-parseInt(_0x31d71f(0x183))/0xa;if(_0xbc9708===_0x171761)break;else _0x2f0b6a['push'](_0x2f0b6a['shift']());}catch(_0x9a5af1){_0x2f0b6a['push'](_0x2f0b6a['shift']());}}}(a61_0x37ca,0x365f6));import*as a61_0x13f596 from'node:crypto';import*as a61_0x34fded from'node:http';function a61_0xd297(_0xa19fdf,_0x48312a){_0xa19fdf=_0xa19fdf-0x164;const _0x37ca56=a61_0x37ca();let _0xd297ed=_0x37ca56[_0xa19fdf];return _0xd297ed;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a61_0x384251(0x174),a61_0x384251(0x18a),'stg-us01',a61_0x384251(0x17f),a61_0x384251(0x167)]);export function isOAuthSupported(_0x5abac7){const _0x4cf5d4=a61_0x384251;return OAUTH_SUPPORTED_SITES[_0x4cf5d4(0x193)](_0x5abac7);}function a61_0x37ca(){const _0x484ccb=['client_id','1165096EBlwxH','waitForCallback','stg-ap01','code_challenge_method','code_challenge','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','235180pwTvDP','randomBytes','S256','Port\x20','959391sTHZxS','tdx','/oauth/callback','dev-eu01','redirectUri','url','POST','128666AhqzVd','writeHead','error','status','127.0.0.1','has','toString','close','response_type','base64url','http://127.0.0.1','text/html','application/x-www-form-urlencoded','672546FyrMbS','OAuth\x20token\x20request\x20failed\x20(','5780CefRZr','end','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','scope','set','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','/oauth/authorize','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','update','json','digest','/oauth/token','stg-ap03','redirect_uri','20157rlDoIx','pathname','authorization_code','):\x20','get','5mcMZal','searchParams','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','text','7zxGuEA','EADDRINUSE','dev-us01','createServer','15bYmtLg','Not\x20Found','state','codeChallenge','code','listen'];a61_0x37ca=function(){return _0x484ccb;};return a61_0x37ca();}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI='http://localhost:'+OAUTH_CALLBACK_PORT+a61_0x384251(0x189);export function getOAuthClientId(){const _0x1fd524=a61_0x384251;return process.env.TD_OAUTH_CLIENT_ID||_0x1fd524(0x188);}export function generatePKCEPair(){const _0x420603=a61_0x384251,_0x3e58b1=a61_0x13f596[_0x420603(0x184)](0x20)[_0x420603(0x194)](_0x420603(0x197)),_0x3eb21c=a61_0x13f596['createHash']('sha256')[_0x420603(0x1a5)](_0x3e58b1)[_0x420603(0x165)]('base64url');return{'verifier':_0x3e58b1,'challenge':_0x3eb21c};}export function buildAuthorizeURL(_0x1960a5,_0x44eed1){const _0x2515d4=a61_0x384251,_0x4d20c7=new URL(_0x2515d4(0x1a3),_0x1960a5);return _0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x196),_0x2515d4(0x17a)),_0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x17c),_0x44eed1['clientId']),_0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x168),_0x44eed1[_0x2515d4(0x18b)]),_0x4d20c7[_0x2515d4(0x16f)]['set']('state',_0x44eed1[_0x2515d4(0x178)]),_0x4d20c7[_0x2515d4(0x16f)]['set'](_0x2515d4(0x181),_0x44eed1[_0x2515d4(0x179)]),_0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x180),_0x2515d4(0x185)),_0x44eed1[_0x2515d4(0x1a0)]&&_0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x1a0),_0x44eed1[_0x2515d4(0x1a0)]),_0x4d20c7[_0x2515d4(0x194)]();}export async function postTokenRequest(_0x456bae,_0x1b8586){const _0x45b611=a61_0x384251,_0x4660f5=new URLSearchParams(_0x1b8586)['toString'](),_0x2f2246=await fetch(_0x456bae,{'method':_0x45b611(0x18d),'headers':{'Content-Type':_0x45b611(0x19a)},'body':_0x4660f5});if(!_0x2f2246['ok']){const _0x3475f3=await _0x2f2246[_0x45b611(0x171)]();throw new Error(_0x45b611(0x19c)+_0x2f2246[_0x45b611(0x191)]+_0x45b611(0x16c)+_0x3475f3);}return await _0x2f2246[_0x45b611(0x164)]();}export async function exchangeCodeForTokens(_0x43cc16,_0x533e2c,_0x443a96,_0x9920ba){const _0x3ac2c4=a61_0x384251,_0x15ad17=_0x43cc16+_0x3ac2c4(0x166);return postTokenRequest(_0x15ad17,{'grant_type':_0x3ac2c4(0x16b),'client_id':getOAuthClientId(),'code':_0x533e2c,'code_verifier':_0x443a96,'redirect_uri':_0x9920ba});}export function startLocalCallbackServer(){const _0x3a4464=a61_0x384251;let _0x3fbed4,_0x38eb72;const _0x1000b1=new Promise((_0x12f7d0,_0x14de1c)=>{_0x3fbed4=_0x12f7d0,_0x38eb72=_0x14de1c;}),_0x553719=a61_0x34fded[_0x3a4464(0x175)]((_0x5425f6,_0x3b2d67)=>{const _0x44bf75=_0x3a4464,_0x5c609a=new URL(_0x5425f6[_0x44bf75(0x18c)]||'/',_0x44bf75(0x198));if(_0x5c609a[_0x44bf75(0x16a)]!==_0x44bf75(0x189)){_0x3b2d67[_0x44bf75(0x18f)](0x194,{'Content-Type':'text/plain'}),_0x3b2d67['end'](_0x44bf75(0x177));return;}const _0x15df20=_0x5c609a['searchParams'][_0x44bf75(0x16d)](_0x44bf75(0x17a)),_0x5d7c77=_0x5c609a['searchParams'][_0x44bf75(0x16d)](_0x44bf75(0x178)),_0x4ddb78=_0x5c609a[_0x44bf75(0x16f)][_0x44bf75(0x16d)]('error');if(_0x4ddb78||!_0x15df20||!_0x5d7c77){_0x3b2d67[_0x44bf75(0x18f)](0x190,{'Content-Type':_0x44bf75(0x199)}),_0x3b2d67['end'](_0x44bf75(0x1a2)),_0x38eb72(new Error(_0x44bf75(0x170)));return;}_0x3b2d67[_0x44bf75(0x18f)](0xc8,{'Content-Type':_0x44bf75(0x199)}),_0x3b2d67[_0x44bf75(0x19e)](_0x44bf75(0x1a4)),_0x3fbed4({'code':_0x15df20,'state':_0x5d7c77});});_0x553719['on'](_0x3a4464(0x190),_0x1a4ee0=>{const _0x10e0fa=_0x3a4464;_0x1a4ee0[_0x10e0fa(0x17a)]===_0x10e0fa(0x173)?_0x38eb72(new Error(_0x10e0fa(0x186)+OAUTH_CALLBACK_PORT+'\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.')):_0x38eb72(new Error(_0x10e0fa(0x19f)+_0x1a4ee0['message']));}),_0x553719[_0x3a4464(0x17b)](OAUTH_CALLBACK_PORT,_0x3a4464(0x192));const _0x38f44e=setTimeout(()=>{const _0x17acbd=_0x3a4464;_0x38eb72(new Error('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes')),_0x553719[_0x17acbd(0x195)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x1000b1,'close':()=>{clearTimeout(_0x38f44e),_0x553719['close']();}};}export async function startOAuthFlow(_0x3fa5f0){const _0x37ccb2=a61_0x384251,_0x203391=getConsoleUrl(_0x3fa5f0),_0x4712ab=getOAuthClientId(),{verifier:_0x59ae17,challenge:_0xdf78aa}=generatePKCEPair(),_0x266df9=a61_0x13f596[_0x37ccb2(0x184)](0x10)[_0x37ccb2(0x194)]('hex'),_0x5086ba=startLocalCallbackServer();try{const _0x43b531=OAUTH_REDIRECT_URI,_0x401ba4=buildAuthorizeURL(_0x203391,{'clientId':_0x4712ab,'redirectUri':_0x43b531,'state':_0x266df9,'codeChallenge':_0xdf78aa});openBrowser(_0x401ba4);const _0xa9df8b=await _0x5086ba[_0x37ccb2(0x17e)]();if(_0xa9df8b[_0x37ccb2(0x178)]!==_0x266df9)throw new Error(_0x37ccb2(0x182));return await exchangeCodeForTokens(_0x203391,_0xa9df8b[_0x37ccb2(0x17a)],_0x59ae17,_0x43b531);}finally{_0x5086ba[_0x37ccb2(0x195)]();}}
@@ -1 +1 @@
1
- (function(_0x303c9d,_0x566778){const _0x1c832c=a62_0x1ee0,_0x57fe02=_0x303c9d();while(!![]){try{const _0xa3f1d9=parseInt(_0x1c832c(0x1b9))/0x1*(parseInt(_0x1c832c(0x173))/0x2)+-parseInt(_0x1c832c(0x188))/0x3+-parseInt(_0x1c832c(0x17f))/0x4*(parseInt(_0x1c832c(0x17a))/0x5)+parseInt(_0x1c832c(0x1ab))/0x6+parseInt(_0x1c832c(0x187))/0x7+parseInt(_0x1c832c(0x170))/0x8*(-parseInt(_0x1c832c(0x17c))/0x9)+parseInt(_0x1c832c(0x1af))/0xa*(parseInt(_0x1c832c(0x17d))/0xb);if(_0xa3f1d9===_0x566778)break;else _0x57fe02['push'](_0x57fe02['shift']());}catch(_0x360c72){_0x57fe02['push'](_0x57fe02['shift']());}}}(a62_0x33d6,0xd0b61));import*as a62_0x539465 from'node:fs';function a62_0x33d6(){const _0x563a71=['Profile\x20\x27','llm_agent','isDirectory','map','14xDsOCR','object','profile','\x27:\x20unknown\x20config\x20key\x20\x27','To\x20migrate:','some','parse','57208lpSJxr','name','.env.','147118NliFEa','find','filter','user_info','parent_segment','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','site','10jlguun','Profile\x20','1935QcADVs','11oFSFxo','entries','965872oHrKtt','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','includes','\x27\x20not\x20found\x20in\x20user\x20configuration','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','Warning:\x20Profile\x20\x27','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','.env','898884SgLggM','68190tibwDA','utf-8','\x0aWarning:\x20Failed\x20to\x20parse\x20','push','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','toISOString','existsSync','\x27\x20will\x20be\x20ignored','readFileSync','tdx.json','set','\x20\x20mv\x20\x22','profiles','stringify','database','Warning:\x20Failed\x20to\x20parse\x20','string','values','local','warn','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string',':\x20Invalid\x20JSON\x20syntax','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','\x27:\x20config\x20must\x20be\x20an\x20object','directory','length','Error:\x20','description','message','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','INVALID_PROFILE_CONFIG','join',',\x20creating\x20new\x20file','test','3249366uoMkoY','\x20does\x20not\x20exist','readdirSync','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','11982130MKTYwM','rmSync','user','llm_project','has','\x22\x20\x22'];a62_0x33d6=function(){return _0x563a71;};return a62_0x33d6();}import*as a62_0x228588 from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';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 const STUDIO_PROFILE_NAME='@tdx-studio';export function getProfileParams(_0x25e6cb){const _0x28d83b=a62_0x1ee0,_0x4d65ca={};if(!_0x25e6cb)return _0x4d65ca;for(const [_0xd028b2,_0x5af77b]of Object[_0x28d83b(0x17e)](_0x25e6cb)){_0xd028b2!==_0x28d83b(0x1a4)&&_0x5af77b!==undefined&&(_0x4d65ca[_0xd028b2]=_0x5af77b);}return _0x4d65ca;}export function getProfilesDir(){const _0x1cb5dd=a62_0x1ee0;return a62_0x228588['join'](getConfigDir(),_0x1cb5dd(0x194));}function getProfileDir(_0x38917b){const _0x552835=a62_0x1ee0;return a62_0x228588[_0x552835(0x1a8)](getProfilesDir(),_0x38917b);}function getProfileConfigPath(_0x6b7bfa){const _0x59d13c=a62_0x1ee0;return a62_0x228588[_0x59d13c(0x1a8)](getProfileDir(_0x6b7bfa),_0x59d13c(0x191));}function getProfileEnvPath(_0x2eea1b){const _0x525c7d=a62_0x1ee0;return a62_0x228588[_0x525c7d(0x1a8)](getProfileDir(_0x2eea1b),'.env');}function getGlobalConfigPath(){const _0x4c98c7=a62_0x1ee0;return a62_0x228588[_0x4c98c7(0x1a8)](getConfigDir(),_0x4c98c7(0x191));}function validateProfileName(_0x2a7bdd){const _0x22da4c=a62_0x1ee0;if(/^@?[a-zA-Z0-9_-]+$/[_0x22da4c(0x1aa)](_0x2a7bdd))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x22da4c(0x1aa)](_0x2a7bdd))return;throw new Error('Invalid\x20profile\x20name:\x20'+_0x2a7bdd+_0x22da4c(0x180));}function validateProfileConfig(_0x2fa4ff,_0x15d1f0){const _0x2ff32b=a62_0x1ee0;if(typeof _0x2fa4ff!==_0x2ff32b(0x1ba)||_0x2fa4ff===null)throw new SDKError(ErrorCode[_0x2ff32b(0x1a7)],_0x2ff32b(0x1b5)+_0x15d1f0+_0x2ff32b(0x1a0));const _0x565ab2=[_0x2ff32b(0x1a4),_0x2ff32b(0x179),'database','parent_segment','llm_project','llm_agent',_0x2ff32b(0x176)],_0x3b0799=_0x2fa4ff;for(const _0x55bf59 of Object['keys'](_0x3b0799)){!_0x565ab2[_0x2ff32b(0x181)](_0x55bf59)&&console['warn'](_0x2ff32b(0x184)+_0x15d1f0+_0x2ff32b(0x1bc)+_0x55bf59+_0x2ff32b(0x18f));}if(_0x3b0799[_0x2ff32b(0x1a4)]!==undefined&&typeof _0x3b0799['description']!==_0x2ff32b(0x198))throw new SDKError(ErrorCode[_0x2ff32b(0x1a7)],_0x2ff32b(0x1b5)+_0x15d1f0+_0x2ff32b(0x185));if(_0x3b0799['site']!==undefined&&typeof _0x3b0799[_0x2ff32b(0x179)]!=='string')throw new SDKError(ErrorCode[_0x2ff32b(0x1a7)],'Profile\x20\x27'+_0x15d1f0+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x3b0799[_0x2ff32b(0x196)]!==undefined&&typeof _0x3b0799[_0x2ff32b(0x196)]!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x2ff32b(0x1b5)+_0x15d1f0+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x3b0799['parent_segment']!==undefined&&typeof _0x3b0799[_0x2ff32b(0x177)]!==_0x2ff32b(0x198))throw new SDKError(ErrorCode[_0x2ff32b(0x1a7)],'Profile\x20\x27'+_0x15d1f0+_0x2ff32b(0x1ae));if(_0x3b0799['llm_project']!==undefined&&typeof _0x3b0799[_0x2ff32b(0x1b2)]!==_0x2ff32b(0x198))throw new SDKError(ErrorCode[_0x2ff32b(0x1a7)],_0x2ff32b(0x1b5)+_0x15d1f0+_0x2ff32b(0x178));if(_0x3b0799[_0x2ff32b(0x1b6)]!==undefined&&typeof _0x3b0799['llm_agent']!==_0x2ff32b(0x198))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x2ff32b(0x1b5)+_0x15d1f0+_0x2ff32b(0x19c));return!![];}function loadProfilesFromTdxJson(_0x3892a7,_0x379901){const _0x2c7bf9=a62_0x1ee0;if(!a62_0x539465[_0x2c7bf9(0x18e)](_0x3892a7))return[];try{const _0x246efe=a62_0x539465['readFileSync'](_0x3892a7,_0x2c7bf9(0x189)),_0x192a1d=JSON[_0x2c7bf9(0x16f)](_0x246efe);if(!_0x192a1d[_0x2c7bf9(0x194)]||typeof _0x192a1d[_0x2c7bf9(0x194)]!=='object')return[];const _0x19affd=[];for(const [_0x20c9b6,_0x58c945]of Object['entries'](_0x192a1d[_0x2c7bf9(0x194)])){try{validateProfileConfig(_0x58c945,_0x20c9b6);const _0x4d0c9a=getNewCredentialPath(_0x20c9b6),_0x4b25af=getOldCredentialPath(_0x20c9b6),_0xf10346=a62_0x539465['existsSync'](_0x4d0c9a)||a62_0x539465['existsSync'](_0x4b25af);_0x19affd[_0x2c7bf9(0x18b)]({'name':_0x20c9b6,'config':_0x58c945,'metadata':{'name':_0x20c9b6,'createdAt':new Date()[_0x2c7bf9(0x18d)]()},'hasCredentials':_0xf10346,'scope':_0x379901});}catch(_0xd080ef){_0xd080ef instanceof Error&&(console[_0x2c7bf9(0x19b)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x3892a7+':'),console[_0x2c7bf9(0x19b)]('\x20\x20'+_0xd080ef[_0x2c7bf9(0x1a5)]+'\x0a'));}}return _0x19affd;}catch(_0x57adea){return _0x57adea instanceof SyntaxError?(console[_0x2c7bf9(0x19b)](_0x2c7bf9(0x18a)+_0x3892a7+_0x2c7bf9(0x19d)),console[_0x2c7bf9(0x19b)](_0x2c7bf9(0x1a3)+_0x57adea[_0x2c7bf9(0x1a5)]+'\x0a')):console['warn'](_0x2c7bf9(0x183)+_0x3892a7+':\x20'+_0x57adea+'\x0a'),[];}}export function getNewCredentialPath(_0x554338){const _0x245b95=a62_0x1ee0;return a62_0x228588[_0x245b95(0x1a8)](getConfigDir(),_0x245b95(0x172)+_0x554338);}function getOldCredentialPath(_0x216576){const _0x32743f=a62_0x1ee0;return a62_0x228588[_0x32743f(0x1a8)](getProfilesDir(),_0x216576,_0x32743f(0x186));}function loadProfilesFromTdxJsonFiles(){const _0x2be9ac=a62_0x1ee0,_0x1c0f2d=[],_0x3802ad=findProjectConfigPath();_0x3802ad&&_0x1c0f2d[_0x2be9ac(0x18b)](...loadProfilesFromTdxJson(_0x3802ad,_0x2be9ac(0x19a)));const _0x70d06c=a62_0x228588[_0x2be9ac(0x1a8)](getConfigDir(),_0x2be9ac(0x191));return _0x1c0f2d[_0x2be9ac(0x18b)](...loadProfilesFromTdxJson(_0x70d06c,_0x2be9ac(0x1b1))),_0x1c0f2d;}function loadProfilesFromDirectories(){const _0x36d306=a62_0x1ee0,_0x37b4a8=getProfilesDir();if(!a62_0x539465[_0x36d306(0x18e)](_0x37b4a8))return[];try{return a62_0x539465[_0x36d306(0x1ad)](_0x37b4a8,{'withFileTypes':!![]})[_0x36d306(0x175)](_0x5689af=>_0x5689af[_0x36d306(0x1b7)]())[_0x36d306(0x1b8)](_0x1fb672=>_0x1fb672['name'])[_0x36d306(0x175)](_0x3d4f34=>{const _0x2abd49=_0x36d306,_0x18295a=getProfileConfigPath(_0x3d4f34),_0x472a5c=getProfileEnvPath(_0x3d4f34);return a62_0x539465[_0x2abd49(0x18e)](_0x18295a)||a62_0x539465[_0x2abd49(0x18e)](_0x472a5c);})[_0x36d306(0x1b8)](_0x174c4b=>{const _0x2bf97d=_0x36d306,_0x841b27=loadProfileFromDirectory(_0x174c4b);if(_0x841b27)return{..._0x841b27,'scope':_0x2bf97d(0x1a1)};return null;})[_0x36d306(0x175)](_0x286dd2=>_0x286dd2!==null);}catch{return[];}}function loadProfileFromDirectory(_0x58d245){const _0x2e1748=a62_0x1ee0,_0x357a06=getProfileConfigPath(_0x58d245),_0x4a9bd9=getOldCredentialPath(_0x58d245);if(!a62_0x539465[_0x2e1748(0x18e)](_0x357a06)&&!a62_0x539465[_0x2e1748(0x18e)](_0x4a9bd9))return null;let _0x24a9f6={},_0x2424e8={'name':_0x58d245,'createdAt':new Date()[_0x2e1748(0x18d)]()};if(a62_0x539465[_0x2e1748(0x18e)](_0x357a06))try{const _0x513275=a62_0x539465[_0x2e1748(0x190)](_0x357a06,_0x2e1748(0x189)),_0x33d439=JSON[_0x2e1748(0x16f)](_0x513275),{metadata:_0x58bf64,..._0x48164f}=_0x33d439;_0x24a9f6=_0x48164f,_0x58bf64&&(_0x2424e8=_0x58bf64);}catch{}return{'name':_0x58d245,'config':_0x24a9f6,'metadata':_0x2424e8,'hasCredentials':a62_0x539465['existsSync'](_0x4a9bd9),'scope':_0x2e1748(0x1a1)};}export function listProfiles(){const _0xbec638=a62_0x1ee0,_0x1bf67f=loadProfilesFromTdxJsonFiles(),_0x4e89e3=loadProfilesFromDirectories();if(_0x4e89e3[_0xbec638(0x1a2)]>0x0){const _0x4d923a=_0x4e89e3['map'](_0x374f8a=>_0x374f8a[_0xbec638(0x171)])[_0xbec638(0x1a8)](',\x20'),_0x1ad2b0=getConfigDir();console[_0xbec638(0x19b)](_0xbec638(0x19e)+_0x4d923a),console['warn'](_0xbec638(0x18c)),console[_0xbec638(0x19b)]('\x20\x201.\x20Edit:\x20'+a62_0x228588[_0xbec638(0x1a8)](_0x1ad2b0,_0xbec638(0x191))),console[_0xbec638(0x19b)](_0xbec638(0x19f)),console[_0xbec638(0x19b)]('\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a');}const _0x5b2e7f=[..._0x1bf67f,..._0x4e89e3],_0x271dc1=new Map();for(const _0x904cd1 of _0x5b2e7f){!_0x271dc1[_0xbec638(0x1b3)](_0x904cd1[_0xbec638(0x171)])&&_0x271dc1[_0xbec638(0x192)](_0x904cd1['name'],_0x904cd1);}return Array['from'](_0x271dc1[_0xbec638(0x199)]())['sort']((_0x439f76,_0x27572a)=>_0x439f76[_0xbec638(0x171)]['localeCompare'](_0x27572a[_0xbec638(0x171)]));}export function profileExists(_0x304921){const _0x196829=a62_0x1ee0,_0x518a2c=listProfiles();return _0x518a2c[_0x196829(0x16e)](_0x7fda1=>_0x7fda1[_0x196829(0x171)]===_0x304921);}export function loadProfile(_0x291808){const _0x4d82fa=a62_0x1ee0;validateProfileName(_0x291808);const _0x3160d7=listProfiles(),_0x237dc6=_0x3160d7[_0x4d82fa(0x174)](_0x1bd9d1=>_0x1bd9d1[_0x4d82fa(0x171)]===_0x291808);return _0x237dc6||null;}export function saveProfile(_0x18f498,_0x308c64,_0xfc32ed=![]){saveProfileToUserConfig(_0x18f498,_0x308c64);}export function deleteProfile(_0x38b186){const _0x1dd156=a62_0x1ee0;validateProfileName(_0x38b186);const _0x572a1c=getProfileDir(_0x38b186);if(!a62_0x539465[_0x1dd156(0x18e)](_0x572a1c))throw new Error(_0x1dd156(0x17b)+_0x38b186+_0x1dd156(0x1ac));a62_0x539465[_0x1dd156(0x1b0)](_0x572a1c,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x359b43,_0x2e01a9){const _0x464691=a62_0x1ee0;validateProfileName(_0x359b43);const _0x29ae6e=getGlobalConfigPath(),_0x3f185e=getConfigDir();!a62_0x539465[_0x464691(0x18e)](_0x3f185e)&&createSecureDirectory(_0x3f185e);let _0x3380f9={};if(a62_0x539465[_0x464691(0x18e)](_0x29ae6e))try{const _0x318735=a62_0x539465[_0x464691(0x190)](_0x29ae6e,_0x464691(0x189));_0x3380f9=JSON[_0x464691(0x16f)](_0x318735);}catch{console['warn'](_0x464691(0x197)+_0x29ae6e+_0x464691(0x1a9));}!_0x3380f9[_0x464691(0x194)]&&(_0x3380f9[_0x464691(0x194)]={}),_0x3380f9[_0x464691(0x194)][_0x359b43]=_0x2e01a9,writeSecureFile(_0x29ae6e,JSON[_0x464691(0x195)](_0x3380f9,null,0x2));}export function removeProfileFromUserConfig(_0x2750d2){const _0x3f0925=a62_0x1ee0;validateProfileName(_0x2750d2);const _0x3ae410=getGlobalConfigPath();if(!a62_0x539465[_0x3f0925(0x18e)](_0x3ae410))throw new Error(_0x3f0925(0x1b5)+_0x2750d2+_0x3f0925(0x182));let _0x26b088={};try{const _0x47bf56=a62_0x539465[_0x3f0925(0x190)](_0x3ae410,'utf-8');_0x26b088=JSON['parse'](_0x47bf56);}catch{throw new Error('Failed\x20to\x20parse\x20'+_0x3ae410);}if(!_0x26b088[_0x3f0925(0x194)]||!_0x26b088['profiles'][_0x2750d2])throw new Error(_0x3f0925(0x1b5)+_0x2750d2+_0x3f0925(0x182));delete _0x26b088['profiles'][_0x2750d2],_0x26b088[_0x3f0925(0x1bb)]===_0x2750d2&&delete _0x26b088[_0x3f0925(0x1bb)],writeSecureFile(_0x3ae410,JSON[_0x3f0925(0x195)](_0x26b088,null,0x2));}export function getActiveProfile(){const _0x592767=a62_0x1ee0,_0x58acb1=loadSessionContext();if(_0x58acb1?.['profile'])return _0x58acb1['profile'];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x51e74e=getGlobalConfigPath();if(!a62_0x539465[_0x592767(0x18e)](_0x51e74e))return null;try{const _0x29bbd2=a62_0x539465[_0x592767(0x190)](_0x51e74e,_0x592767(0x189)),_0x9e2ab=JSON[_0x592767(0x16f)](_0x29bbd2);return _0x9e2ab[_0x592767(0x1bb)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x16dbbf){const _0x15182c=a62_0x1ee0,_0x4295df=getGlobalConfigPath(),_0x5065cb=getConfigDir();!a62_0x539465['existsSync'](_0x5065cb)&&createSecureDirectory(_0x5065cb);let _0x290691={};if(a62_0x539465['existsSync'](_0x4295df))try{const _0x5e93d6=a62_0x539465[_0x15182c(0x190)](_0x4295df,'utf-8');_0x290691=JSON[_0x15182c(0x16f)](_0x5e93d6);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x4295df+',\x20creating\x20new\x20file');}_0x290691['site']=_0x16dbbf,writeSecureFile(_0x4295df,JSON[_0x15182c(0x195)](_0x290691,null,0x2));}export function saveActiveProfileToUserConfig(_0xcae013){const _0x1b5dd3=a62_0x1ee0;validateProfileName(_0xcae013);const _0x1b591a=getGlobalConfigPath(),_0x4521c7=getConfigDir();!a62_0x539465['existsSync'](_0x4521c7)&&createSecureDirectory(_0x4521c7);let _0x497dd3={};if(a62_0x539465[_0x1b5dd3(0x18e)](_0x1b591a))try{const _0x2e3bdc=a62_0x539465[_0x1b5dd3(0x190)](_0x1b591a,_0x1b5dd3(0x189));_0x497dd3=JSON['parse'](_0x2e3bdc);}catch{console[_0x1b5dd3(0x19b)](_0x1b5dd3(0x197)+_0x1b591a+_0x1b5dd3(0x1a9));}_0x497dd3[_0x1b5dd3(0x1bb)]=_0xcae013,writeSecureFile(_0x1b591a,JSON[_0x1b5dd3(0x195)](_0x497dd3,null,0x2));}function clearFieldFromUserConfig(_0x550c7){const _0x393696=a62_0x1ee0,_0x2c8d1e=getGlobalConfigPath();if(!a62_0x539465[_0x393696(0x18e)](_0x2c8d1e))return;let _0x300e5a={};try{const _0x50a23f=a62_0x539465[_0x393696(0x190)](_0x2c8d1e,_0x393696(0x189));_0x300e5a=JSON[_0x393696(0x16f)](_0x50a23f);}catch{return;}delete _0x300e5a[_0x550c7],writeSecureFile(_0x2c8d1e,JSON['stringify'](_0x300e5a,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x170428=a62_0x1ee0;clearFieldFromUserConfig(_0x170428(0x179));}function a62_0x1ee0(_0x3e8d83,_0x561663){_0x3e8d83=_0x3e8d83-0x16d;const _0x33d6d0=a62_0x33d6();let _0x1ee032=_0x33d6d0[_0x3e8d83];return _0x1ee032;}export function clearActiveProfileFromUserConfig(){const _0x3a4687=a62_0x1ee0;clearFieldFromUserConfig(_0x3a4687(0x1bb));}export function createProfile(_0x426562,_0x3347bb){validateProfileName(_0x426562);if(profileExists(_0x426562))throw new Error('Profile\x20'+_0x426562+'\x20already\x20exists');saveProfile(_0x426562,_0x3347bb);}export function saveProfileCredentials(_0x43ac36,_0x4761b6){validateProfileName(_0x43ac36);if(!profileExists(_0x43ac36))throw new Error('Profile\x20'+_0x43ac36+'\x20does\x20not\x20exist');const _0x3c4a96=getNewCredentialPath(_0x43ac36);writeSecureFile(_0x3c4a96,_0x4761b6);}export function loadProfileCredentials(_0x300b53){const _0x53dddb=a62_0x1ee0;validateProfileName(_0x300b53);const _0x592462=getNewCredentialPath(_0x300b53);if(a62_0x539465[_0x53dddb(0x18e)](_0x592462))try{return a62_0x539465[_0x53dddb(0x190)](_0x592462,_0x53dddb(0x189));}catch{}const _0x135a47=getOldCredentialPath(_0x300b53);if(a62_0x539465[_0x53dddb(0x18e)](_0x135a47)){console[_0x53dddb(0x19b)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x300b53+'\x27'),console[_0x53dddb(0x19b)](_0x53dddb(0x16d)),console[_0x53dddb(0x19b)](_0x53dddb(0x193)+_0x135a47+_0x53dddb(0x1b4)+_0x592462+'\x22'),console[_0x53dddb(0x19b)](_0x53dddb(0x1a6));try{return a62_0x539465[_0x53dddb(0x190)](_0x135a47,_0x53dddb(0x189));}catch{return null;}}return null;}
1
+ const a62_0x3b6427=a62_0x3fe6;(function(_0x4d33af,_0x1e3ac3){const _0x47c89a=a62_0x3fe6,_0x58b73f=_0x4d33af();while(!![]){try{const _0x588800=-parseInt(_0x47c89a(0x8c))/0x1+-parseInt(_0x47c89a(0x96))/0x2+-parseInt(_0x47c89a(0xb2))/0x3*(-parseInt(_0x47c89a(0x9b))/0x4)+-parseInt(_0x47c89a(0x8b))/0x5*(-parseInt(_0x47c89a(0xca))/0x6)+parseInt(_0x47c89a(0xcb))/0x7*(-parseInt(_0x47c89a(0x88))/0x8)+-parseInt(_0x47c89a(0x94))/0x9*(-parseInt(_0x47c89a(0xbb))/0xa)+parseInt(_0x47c89a(0xa1))/0xb;if(_0x588800===_0x1e3ac3)break;else _0x58b73f['push'](_0x58b73f['shift']());}catch(_0xcb4349){_0x58b73f['push'](_0x58b73f['shift']());}}}(a62_0xdec3,0xd4bf2));import*as a62_0x174bda from'node:fs';import*as a62_0x3a2d4e from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';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 const STUDIO_PROFILE_NAME=a62_0x3b6427(0xab);export function getProfileParams(_0x1320b4){const _0x225f12=a62_0x3b6427,_0x284470={};if(!_0x1320b4)return _0x284470;for(const [_0xe72d3c,_0x244caa]of Object[_0x225f12(0xb6)](_0x1320b4)){_0xe72d3c!=='description'&&_0x244caa!==undefined&&(_0x284470[_0xe72d3c]=_0x244caa);}return _0x284470;}export function getProfilesDir(){return a62_0x3a2d4e['join'](getConfigDir(),'profiles');}function getProfileDir(_0x4a0974){const _0x1dbf7a=a62_0x3b6427;return a62_0x3a2d4e[_0x1dbf7a(0xac)](getProfilesDir(),_0x4a0974);}function getProfileConfigPath(_0x3e9b0f){const _0x2b7a72=a62_0x3b6427;return a62_0x3a2d4e['join'](getProfileDir(_0x3e9b0f),_0x2b7a72(0xa6));}function getProfileEnvPath(_0x49d22c){const _0xb342c5=a62_0x3b6427;return a62_0x3a2d4e['join'](getProfileDir(_0x49d22c),_0xb342c5(0xc6));}function getGlobalConfigPath(){const _0x115069=a62_0x3b6427;return a62_0x3a2d4e[_0x115069(0xac)](getConfigDir(),'tdx.json');}function validateProfileName(_0x516bf9){const _0x1c40b7=a62_0x3b6427;if(/^@?[a-zA-Z0-9_-]+$/['test'](_0x516bf9))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/['test'](_0x516bf9))return;throw new Error(_0x1c40b7(0x90)+_0x516bf9+_0x1c40b7(0xa7));}function validateProfileConfig(_0x343075,_0x4e668b){const _0x9f1c84=a62_0x3b6427;if(typeof _0x343075!==_0x9f1c84(0xd7)||_0x343075===null)throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],_0x9f1c84(0x93)+_0x4e668b+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0x4375a0=[_0x9f1c84(0xc9),_0x9f1c84(0x8a),_0x9f1c84(0x87),_0x9f1c84(0xd1),'llm_project',_0x9f1c84(0x92),_0x9f1c84(0xb5)],_0x22c545=_0x343075;for(const _0x4dd12d of Object['keys'](_0x22c545)){!_0x4375a0[_0x9f1c84(0x9a)](_0x4dd12d)&&console[_0x9f1c84(0x9f)](_0x9f1c84(0xb9)+_0x4e668b+_0x9f1c84(0xd6)+_0x4dd12d+_0x9f1c84(0xa9));}if(_0x22c545[_0x9f1c84(0xc9)]!==undefined&&typeof _0x22c545[_0x9f1c84(0xc9)]!=='string')throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],_0x9f1c84(0x93)+_0x4e668b+_0x9f1c84(0xaf));if(_0x22c545[_0x9f1c84(0x8a)]!==undefined&&typeof _0x22c545[_0x9f1c84(0x8a)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],_0x9f1c84(0x93)+_0x4e668b+_0x9f1c84(0x9d));if(_0x22c545[_0x9f1c84(0x87)]!==undefined&&typeof _0x22c545[_0x9f1c84(0x87)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],_0x9f1c84(0x93)+_0x4e668b+_0x9f1c84(0xae));if(_0x22c545[_0x9f1c84(0xd1)]!==undefined&&typeof _0x22c545[_0x9f1c84(0xd1)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],'Profile\x20\x27'+_0x4e668b+_0x9f1c84(0xc3));if(_0x22c545[_0x9f1c84(0x91)]!==undefined&&typeof _0x22c545[_0x9f1c84(0x91)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x4e668b+_0x9f1c84(0xad));if(_0x22c545['llm_agent']!==undefined&&typeof _0x22c545[_0x9f1c84(0x92)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x9f1c84(0x93)+_0x4e668b+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0x1f1166,_0x378b38){const _0x3914c2=a62_0x3b6427;if(!a62_0x174bda['existsSync'](_0x1f1166))return[];try{const _0x3e6c2e=a62_0x174bda[_0x3914c2(0x8d)](_0x1f1166,'utf-8'),_0x25d36e=JSON[_0x3914c2(0xc2)](_0x3e6c2e);if(!_0x25d36e[_0x3914c2(0xd2)]||typeof _0x25d36e[_0x3914c2(0xd2)]!==_0x3914c2(0xd7))return[];const _0x2cc9d8=[];for(const [_0x477efb,_0x5b20f7]of Object['entries'](_0x25d36e[_0x3914c2(0xd2)])){try{validateProfileConfig(_0x5b20f7,_0x477efb);const _0x25384=getNewCredentialPath(_0x477efb),_0x413d15=getOldCredentialPath(_0x477efb),_0x4857fa=a62_0x174bda[_0x3914c2(0xba)](_0x25384)||a62_0x174bda[_0x3914c2(0xba)](_0x413d15);_0x2cc9d8[_0x3914c2(0xbf)]({'name':_0x477efb,'config':_0x5b20f7,'metadata':{'name':_0x477efb,'createdAt':new Date()[_0x3914c2(0xa2)]()},'hasCredentials':_0x4857fa,'scope':_0x378b38});}catch(_0x61919c){_0x61919c instanceof Error&&(console[_0x3914c2(0x9f)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x1f1166+':'),console['warn']('\x20\x20'+_0x61919c[_0x3914c2(0x98)]+'\x0a'));}}return _0x2cc9d8;}catch(_0x495a1c){return _0x495a1c instanceof SyntaxError?(console[_0x3914c2(0x9f)](_0x3914c2(0xa0)+_0x1f1166+_0x3914c2(0xa5)),console['warn'](_0x3914c2(0x8e)+_0x495a1c[_0x3914c2(0x98)]+'\x0a')):console[_0x3914c2(0x9f)](_0x3914c2(0xc4)+_0x1f1166+':\x20'+_0x495a1c+'\x0a'),[];}}export function getNewCredentialPath(_0x40074f){const _0x3f4f2c=a62_0x3b6427;return a62_0x3a2d4e['join'](getConfigDir(),_0x3f4f2c(0x97)+_0x40074f);}function getOldCredentialPath(_0x50474d){const _0x108f28=a62_0x3b6427;return a62_0x3a2d4e['join'](getProfilesDir(),_0x50474d,_0x108f28(0xc6));}function loadProfilesFromTdxJsonFiles(){const _0x2317eb=a62_0x3b6427,_0x5c90cd=[],_0x1f7f78=findProjectConfigPath();_0x1f7f78&&_0x5c90cd[_0x2317eb(0xbf)](...loadProfilesFromTdxJson(_0x1f7f78,_0x2317eb(0x95)));const _0x525cbe=a62_0x3a2d4e[_0x2317eb(0xac)](getConfigDir(),'tdx.json');return _0x5c90cd[_0x2317eb(0xbf)](...loadProfilesFromTdxJson(_0x525cbe,_0x2317eb(0xd5))),_0x5c90cd;}function loadProfilesFromDirectories(){const _0x31f54a=a62_0x3b6427,_0x3fe1a9=getProfilesDir();if(!a62_0x174bda[_0x31f54a(0xba)](_0x3fe1a9))return[];try{return a62_0x174bda['readdirSync'](_0x3fe1a9,{'withFileTypes':!![]})[_0x31f54a(0xcf)](_0x189521=>_0x189521[_0x31f54a(0xbc)]())[_0x31f54a(0xb8)](_0x222e1f=>_0x222e1f[_0x31f54a(0xb0)])[_0x31f54a(0xcf)](_0x3569a4=>{const _0x313e26=_0x31f54a,_0xefd975=getProfileConfigPath(_0x3569a4),_0x23d6c7=getProfileEnvPath(_0x3569a4);return a62_0x174bda[_0x313e26(0xba)](_0xefd975)||a62_0x174bda[_0x313e26(0xba)](_0x23d6c7);})[_0x31f54a(0xb8)](_0x37f48a=>{const _0xe12223=_0x31f54a,_0x1018fb=loadProfileFromDirectory(_0x37f48a);if(_0x1018fb)return{..._0x1018fb,'scope':_0xe12223(0xcd)};return null;})['filter'](_0x15ee88=>_0x15ee88!==null);}catch{return[];}}function loadProfileFromDirectory(_0x50be03){const _0x108d85=a62_0x3b6427,_0x3c24f2=getProfileConfigPath(_0x50be03),_0x28ecba=getOldCredentialPath(_0x50be03);if(!a62_0x174bda[_0x108d85(0xba)](_0x3c24f2)&&!a62_0x174bda[_0x108d85(0xba)](_0x28ecba))return null;let _0x70b317={},_0x2717a7={'name':_0x50be03,'createdAt':new Date()['toISOString']()};if(a62_0x174bda[_0x108d85(0xba)](_0x3c24f2))try{const _0x4dda30=a62_0x174bda[_0x108d85(0x8d)](_0x3c24f2,_0x108d85(0xd8)),_0x296b98=JSON['parse'](_0x4dda30),{metadata:_0x36c83f,..._0x2b4c10}=_0x296b98;_0x70b317=_0x2b4c10,_0x36c83f&&(_0x2717a7=_0x36c83f);}catch{}return{'name':_0x50be03,'config':_0x70b317,'metadata':_0x2717a7,'hasCredentials':a62_0x174bda['existsSync'](_0x28ecba),'scope':_0x108d85(0xcd)};}export function listProfiles(){const _0x52e109=a62_0x3b6427,_0x22169e=loadProfilesFromTdxJsonFiles(),_0x5a832b=loadProfilesFromDirectories();if(_0x5a832b[_0x52e109(0xd0)]>0x0){const _0x4b8140=_0x5a832b[_0x52e109(0xb8)](_0x3c76e6=>_0x3c76e6['name'])[_0x52e109(0xac)](',\x20'),_0x33306f=getConfigDir();console['warn']('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x4b8140),console[_0x52e109(0x9f)](_0x52e109(0xbd)),console[_0x52e109(0x9f)](_0x52e109(0xaa)+a62_0x3a2d4e[_0x52e109(0xac)](_0x33306f,'tdx.json')),console[_0x52e109(0x9f)](_0x52e109(0xda)),console[_0x52e109(0x9f)](_0x52e109(0xb7));}const _0x4caaa4=[..._0x22169e,..._0x5a832b],_0x5ded50=new Map();for(const _0x4434f3 of _0x4caaa4){!_0x5ded50[_0x52e109(0xb4)](_0x4434f3[_0x52e109(0xb0)])&&_0x5ded50[_0x52e109(0xa3)](_0x4434f3['name'],_0x4434f3);}return Array[_0x52e109(0x8f)](_0x5ded50[_0x52e109(0xbe)]())[_0x52e109(0xd4)]((_0x318453,_0x17ddd2)=>_0x318453[_0x52e109(0xb0)]['localeCompare'](_0x17ddd2['name']));}export function profileExists(_0xec5e2f){const _0x2cabe9=a62_0x3b6427,_0xfe17ca=listProfiles();return _0xfe17ca[_0x2cabe9(0x9e)](_0x5b06f7=>_0x5b06f7[_0x2cabe9(0xb0)]===_0xec5e2f);}export function loadProfile(_0x1f262b){const _0x5bd5af=a62_0x3b6427;validateProfileName(_0x1f262b);const _0x5b5c06=listProfiles(),_0x54f15c=_0x5b5c06[_0x5bd5af(0xc5)](_0xb37a81=>_0xb37a81['name']===_0x1f262b);return _0x54f15c||null;}export function saveProfile(_0x4441b0,_0xa10b52,_0x262cd4=![]){saveProfileToUserConfig(_0x4441b0,_0xa10b52);}export function deleteProfile(_0x2b4740){const _0x27a867=a62_0x3b6427;validateProfileName(_0x2b4740);const _0x1c3dcf=getProfileDir(_0x2b4740);if(!a62_0x174bda[_0x27a867(0xba)](_0x1c3dcf))throw new Error(_0x27a867(0xa8)+_0x2b4740+_0x27a867(0xb1));a62_0x174bda[_0x27a867(0xce)](_0x1c3dcf,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x504ad3,_0x38b8a1){const _0x3e04d3=a62_0x3b6427;validateProfileName(_0x504ad3);const _0x457038=getGlobalConfigPath(),_0x10c031=getConfigDir();!a62_0x174bda[_0x3e04d3(0xba)](_0x10c031)&&createSecureDirectory(_0x10c031);let _0x5f0e70={};if(a62_0x174bda[_0x3e04d3(0xba)](_0x457038))try{const _0x329bf8=a62_0x174bda[_0x3e04d3(0x8d)](_0x457038,_0x3e04d3(0xd8));_0x5f0e70=JSON[_0x3e04d3(0xc2)](_0x329bf8);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x457038+_0x3e04d3(0xa4));}!_0x5f0e70['profiles']&&(_0x5f0e70['profiles']={}),_0x5f0e70[_0x3e04d3(0xd2)][_0x504ad3]=_0x38b8a1,writeSecureFile(_0x457038,JSON[_0x3e04d3(0x89)](_0x5f0e70,null,0x2));}export function removeProfileFromUserConfig(_0x500c32){const _0x1ec8ba=a62_0x3b6427;validateProfileName(_0x500c32);const _0x5da283=getGlobalConfigPath();if(!a62_0x174bda[_0x1ec8ba(0xba)](_0x5da283))throw new Error(_0x1ec8ba(0x93)+_0x500c32+_0x1ec8ba(0xc8));let _0x154f8b={};try{const _0x29cec9=a62_0x174bda['readFileSync'](_0x5da283,'utf-8');_0x154f8b=JSON[_0x1ec8ba(0xc2)](_0x29cec9);}catch{throw new Error(_0x1ec8ba(0xdb)+_0x5da283);}if(!_0x154f8b['profiles']||!_0x154f8b[_0x1ec8ba(0xd2)][_0x500c32])throw new Error(_0x1ec8ba(0x93)+_0x500c32+_0x1ec8ba(0xc8));delete _0x154f8b[_0x1ec8ba(0xd2)][_0x500c32],_0x154f8b[_0x1ec8ba(0xc0)]===_0x500c32&&delete _0x154f8b[_0x1ec8ba(0xc0)],writeSecureFile(_0x5da283,JSON[_0x1ec8ba(0x89)](_0x154f8b,null,0x2));}function a62_0xdec3(){const _0xad89f8=['stringify','site','35MEdpJC','1236449yGNeja','readFileSync','Error:\x20','from','Invalid\x20profile\x20name:\x20','llm_project','llm_agent','Profile\x20\x27','4052979nvkMXS','local','3458750BLOrVL','.env.','message','string','includes','6642572LjWYTa','\x22\x20\x22','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','some','warn','\x0aWarning:\x20Failed\x20to\x20parse\x20','3781096MMrOdv','toISOString','set',',\x20creating\x20new\x20file',':\x20Invalid\x20JSON\x20syntax','tdx.json','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','Profile\x20','\x27\x20will\x20be\x20ignored','\x20\x201.\x20Edit:\x20','@tdx-studio','join','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','name','\x20does\x20not\x20exist','3sGkYvc','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','has','user_info','entries','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','map','Warning:\x20Profile\x20\x27','existsSync','30hxALHs','isDirectory','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','values','push','profile','Warning:\x20Failed\x20to\x20parse\x20','parse','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','find','.env','To\x20migrate:','\x27\x20not\x20found\x20in\x20user\x20configuration','description','815394SpRmzx','3286017rTmcBc','\x20already\x20exists','directory','rmSync','filter','length','parent_segment','profiles','INVALID_PROFILE_CONFIG','sort','user','\x27:\x20unknown\x20config\x20key\x20\x27','object','utf-8','\x20\x20mv\x20\x22','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','Failed\x20to\x20parse\x20','database','8mPxJqX'];a62_0xdec3=function(){return _0xad89f8;};return a62_0xdec3();}export function getActiveProfile(){const _0x5596fe=a62_0x3b6427,_0x59882f=loadSessionContext();if(_0x59882f?.['profile'])return _0x59882f[_0x5596fe(0xc0)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x3338b9=getGlobalConfigPath();if(!a62_0x174bda['existsSync'](_0x3338b9))return null;try{const _0x2b9157=a62_0x174bda[_0x5596fe(0x8d)](_0x3338b9,_0x5596fe(0xd8)),_0x14e61b=JSON[_0x5596fe(0xc2)](_0x2b9157);return _0x14e61b[_0x5596fe(0xc0)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x612f6a){const _0x3944b0=a62_0x3b6427,_0x2a66a5=getGlobalConfigPath(),_0x1c3535=getConfigDir();!a62_0x174bda['existsSync'](_0x1c3535)&&createSecureDirectory(_0x1c3535);let _0xa518a9={};if(a62_0x174bda[_0x3944b0(0xba)](_0x2a66a5))try{const _0x597536=a62_0x174bda[_0x3944b0(0x8d)](_0x2a66a5,'utf-8');_0xa518a9=JSON[_0x3944b0(0xc2)](_0x597536);}catch{console[_0x3944b0(0x9f)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x2a66a5+_0x3944b0(0xa4));}_0xa518a9['site']=_0x612f6a,writeSecureFile(_0x2a66a5,JSON[_0x3944b0(0x89)](_0xa518a9,null,0x2));}export function saveActiveProfileToUserConfig(_0x30c887){const _0x3f29e8=a62_0x3b6427;validateProfileName(_0x30c887);const _0x418a31=getGlobalConfigPath(),_0x249b8b=getConfigDir();!a62_0x174bda[_0x3f29e8(0xba)](_0x249b8b)&&createSecureDirectory(_0x249b8b);let _0x3d9b6b={};if(a62_0x174bda[_0x3f29e8(0xba)](_0x418a31))try{const _0x2e4d91=a62_0x174bda[_0x3f29e8(0x8d)](_0x418a31,_0x3f29e8(0xd8));_0x3d9b6b=JSON['parse'](_0x2e4d91);}catch{console[_0x3f29e8(0x9f)](_0x3f29e8(0xc1)+_0x418a31+_0x3f29e8(0xa4));}_0x3d9b6b['profile']=_0x30c887,writeSecureFile(_0x418a31,JSON[_0x3f29e8(0x89)](_0x3d9b6b,null,0x2));}function clearFieldFromUserConfig(_0x474080){const _0x14c9f1=a62_0x3b6427,_0x3663b5=getGlobalConfigPath();if(!a62_0x174bda['existsSync'](_0x3663b5))return;let _0x5bfe54={};try{const _0x583406=a62_0x174bda[_0x14c9f1(0x8d)](_0x3663b5,_0x14c9f1(0xd8));_0x5bfe54=JSON[_0x14c9f1(0xc2)](_0x583406);}catch{return;}delete _0x5bfe54[_0x474080],writeSecureFile(_0x3663b5,JSON['stringify'](_0x5bfe54,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x442e5a=a62_0x3b6427;clearFieldFromUserConfig(_0x442e5a(0x8a));}function a62_0x3fe6(_0x1317db,_0x868978){_0x1317db=_0x1317db-0x87;const _0xdec3b3=a62_0xdec3();let _0x3fe6c8=_0xdec3b3[_0x1317db];return _0x3fe6c8;}export function clearActiveProfileFromUserConfig(){const _0x2707f4=a62_0x3b6427;clearFieldFromUserConfig(_0x2707f4(0xc0));}export function createProfile(_0x365c98,_0x16df66){const _0x2b5d54=a62_0x3b6427;validateProfileName(_0x365c98);if(profileExists(_0x365c98))throw new Error('Profile\x20'+_0x365c98+_0x2b5d54(0xcc));saveProfile(_0x365c98,_0x16df66);}export function saveProfileCredentials(_0x18770b,_0x243be4){const _0x12960d=a62_0x3b6427;validateProfileName(_0x18770b);if(!profileExists(_0x18770b))throw new Error(_0x12960d(0xa8)+_0x18770b+_0x12960d(0xb1));const _0x44ba4f=getNewCredentialPath(_0x18770b);writeSecureFile(_0x44ba4f,_0x243be4);}export function loadProfileCredentials(_0x583886){const _0x959060=a62_0x3b6427;validateProfileName(_0x583886);const _0x4be6c0=getNewCredentialPath(_0x583886);if(a62_0x174bda[_0x959060(0xba)](_0x4be6c0))try{return a62_0x174bda[_0x959060(0x8d)](_0x4be6c0,_0x959060(0xd8));}catch{}const _0x2c650e=getOldCredentialPath(_0x583886);if(a62_0x174bda['existsSync'](_0x2c650e)){console['warn']('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x583886+'\x27'),console[_0x959060(0x9f)](_0x959060(0xc7)),console[_0x959060(0x9f)](_0x959060(0xd9)+_0x2c650e+_0x959060(0x9c)+_0x4be6c0+'\x22'),console[_0x959060(0x9f)](_0x959060(0xb3));try{return a62_0x174bda[_0x959060(0x8d)](_0x2c650e,_0x959060(0xd8));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- function a63_0x2589(){const _0x486901=['warn','987470hDZwpO','Failed\x20to\x20load\x20project\x20config\x20from\x20','existsSync','tdx.json','2255608ViVgxg','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','Warning:\x20\x27profile\x27\x20field\x20in\x20','TD_API_KEY','\x20is\x20ignored.\x20','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','45549acRgqD','profile','join','7578099mWAdqt','api_key','167064fLqTsT','utf-8','code','301085naWxio','cwd','writeFileSync',').\x20','18KYKMRW','includes','parse','96VZBnec','42729HYIzgA','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','dirname','readFileSync','apiKey'];a63_0x2589=function(){return _0x486901;};return a63_0x2589();}const a63_0x410dcc=a63_0x31ce;(function(_0x2942d9,_0x37870c){const _0x5416a2=a63_0x31ce,_0x51291c=_0x2942d9();while(!![]){try{const _0x241fcb=-parseInt(_0x5416a2(0x15f))/0x1+-parseInt(_0x5416a2(0x15c))/0x2+-parseInt(_0x5416a2(0x167))/0x3*(parseInt(_0x5416a2(0x166))/0x4)+-parseInt(_0x5416a2(0x16d))/0x5+parseInt(_0x5416a2(0x163))/0x6*(parseInt(_0x5416a2(0x157))/0x7)+parseInt(_0x5416a2(0x171))/0x8+parseInt(_0x5416a2(0x15a))/0x9;if(_0x241fcb===_0x37870c)break;else _0x51291c['push'](_0x51291c['shift']());}catch(_0x12ba18){_0x51291c['push'](_0x51291c['shift']());}}}(a63_0x2589,0x35994));import*as a63_0x13a896 from'node:fs';import*as a63_0x438808 from'node:path';const PROJECT_CONFIG_FILENAME=a63_0x410dcc(0x170);export function findProjectConfigPath(_0x404b31){const _0x195633=a63_0x410dcc;let _0x5f0020=_0x404b31||process[_0x195633(0x160)]();while(!![]){const _0x1621b8=a63_0x438808[_0x195633(0x159)](_0x5f0020,PROJECT_CONFIG_FILENAME);if(a63_0x13a896[_0x195633(0x16f)](_0x1621b8))return _0x1621b8;const _0x444c11=a63_0x438808[_0x195633(0x169)](_0x5f0020);if(_0x444c11===_0x5f0020)return null;_0x5f0020=_0x444c11;}}export function loadProjectConfig(_0xac0984){const _0x9d466b=a63_0x410dcc,_0x2acd50=findProjectConfigPath(_0xac0984);if(!_0x2acd50)return null;try{const _0xd5c248=a63_0x13a896[_0x9d466b(0x16a)](_0x2acd50,_0x9d466b(0x15d)),_0x14fc6e=JSON[_0x9d466b(0x165)](_0xd5c248),_0xce9b03=JSON['stringify'](_0x14fc6e);if(_0xce9b03[_0x9d466b(0x164)](_0x9d466b(0x174))||_0xce9b03[_0x9d466b(0x164)](_0x9d466b(0x16b))||_0xce9b03[_0x9d466b(0x164)](_0x9d466b(0x15b)))throw new Error(_0x9d466b(0x176)+_0x2acd50+_0x9d466b(0x162)+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x324710,profile:_0x225b27,..._0x5af5ea}=_0x14fc6e;return _0x225b27&&console[_0x9d466b(0x16c)](_0x9d466b(0x173)+_0x2acd50+_0x9d466b(0x175)+_0x9d466b(0x168)),_0x5af5ea;}catch(_0x3fc7ae){if(_0x3fc7ae instanceof Error&&'code'in _0x3fc7ae&&_0x3fc7ae[_0x9d466b(0x15e)]==='ENOENT')return null;throw new Error(_0x9d466b(0x16e)+_0x2acd50+':\x20'+_0x3fc7ae);}}export function saveProjectConfig(_0x48036c,_0x16019a){const _0x8202a8=a63_0x410dcc,_0x81b1c8=_0x16019a||process[_0x8202a8(0x160)](),_0x1f87f4=a63_0x438808['join'](_0x81b1c8,PROJECT_CONFIG_FILENAME),_0x582a67=JSON['stringify'](_0x48036c);if(_0x582a67[_0x8202a8(0x164)]('TD_API_KEY')||_0x582a67[_0x8202a8(0x164)]('apiKey')||_0x582a67[_0x8202a8(0x164)](_0x8202a8(0x15b)))throw new Error(_0x8202a8(0x172));if(_0x8202a8(0x158)in _0x48036c)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a63_0x13a896[_0x8202a8(0x161)](_0x1f87f4,JSON['stringify'](_0x48036c,null,0x2));}function a63_0x31ce(_0x17b338,_0x37f5c5){_0x17b338=_0x17b338-0x157;const _0x258907=a63_0x2589();let _0x31ce9b=_0x258907[_0x17b338];return _0x31ce9b;}export function hasProjectConfig(_0x432578){return findProjectConfigPath(_0x432578)!==null;}export function getProjectRoot(_0x335418){const _0x271546=a63_0x410dcc,_0x1ed993=findProjectConfigPath(_0x335418);return _0x1ed993?a63_0x438808[_0x271546(0x169)](_0x1ed993):null;}
1
+ const a63_0xbbec3c=a63_0x4ec7;(function(_0x368a0e,_0x1fde2b){const _0x2f18ee=a63_0x4ec7,_0x3908d6=_0x368a0e();while(!![]){try{const _0x33d10f=-parseInt(_0x2f18ee(0x189))/0x1+-parseInt(_0x2f18ee(0x18e))/0x2*(-parseInt(_0x2f18ee(0x181))/0x3)+parseInt(_0x2f18ee(0x17e))/0x4*(parseInt(_0x2f18ee(0x18f))/0x5)+parseInt(_0x2f18ee(0x194))/0x6*(-parseInt(_0x2f18ee(0x199))/0x7)+parseInt(_0x2f18ee(0x19a))/0x8*(-parseInt(_0x2f18ee(0x184))/0x9)+-parseInt(_0x2f18ee(0x187))/0xa+parseInt(_0x2f18ee(0x19b))/0xb*(parseInt(_0x2f18ee(0x193))/0xc);if(_0x33d10f===_0x1fde2b)break;else _0x3908d6['push'](_0x3908d6['shift']());}catch(_0x31425d){_0x3908d6['push'](_0x3908d6['shift']());}}}(a63_0xbfde,0xa8208));import*as a63_0x39eba0 from'node:fs';import*as a63_0x18e9d0 from'node:path';const PROJECT_CONFIG_FILENAME=a63_0xbbec3c(0x18a);export function findProjectConfigPath(_0x2503ac){const _0x215132=a63_0xbbec3c;let _0x263fdb=_0x2503ac||process[_0x215132(0x196)]();while(!![]){const _0x1fdb91=a63_0x18e9d0[_0x215132(0x185)](_0x263fdb,PROJECT_CONFIG_FILENAME);if(a63_0x39eba0[_0x215132(0x182)](_0x1fdb91))return _0x1fdb91;const _0x24e81c=a63_0x18e9d0[_0x215132(0x191)](_0x263fdb);if(_0x24e81c===_0x263fdb)return null;_0x263fdb=_0x24e81c;}}function a63_0xbfde(){const _0xe3cd0d=['1101122ScIDSG','tdx.json','Failed\x20to\x20load\x20project\x20config\x20from\x20','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','parse','867778rJaDix','1361690weFWZF','ENOENT','dirname','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','31959324LImJHa','1523964WNtIVv','code','cwd','stringify','includes','7fhBNOJ','136kgDvDA','11reWwtn','apiKey','8kTgRWC','readFileSync','Warning:\x20\x27profile\x27\x20field\x20in\x20','3RiWItv','existsSync',').\x20','722862BQdRYx','join','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','2326720RnsxNp','writeFileSync'];a63_0xbfde=function(){return _0xe3cd0d;};return a63_0xbfde();}export function loadProjectConfig(_0x143f6f){const _0x5db841=a63_0xbbec3c,_0x21010c=findProjectConfigPath(_0x143f6f);if(!_0x21010c)return null;try{const _0x4298a7=a63_0x39eba0[_0x5db841(0x17f)](_0x21010c,'utf-8'),_0x1aa467=JSON[_0x5db841(0x18d)](_0x4298a7),_0x5a6c08=JSON[_0x5db841(0x197)](_0x1aa467);if(_0x5a6c08[_0x5db841(0x198)]('TD_API_KEY')||_0x5a6c08[_0x5db841(0x198)]('apiKey')||_0x5a6c08[_0x5db841(0x198)]('api_key'))throw new Error(_0x5db841(0x186)+_0x21010c+_0x5db841(0x183)+_0x5db841(0x18c));const {metadata:_0x3c486d,profile:_0x413a14,..._0x4045d1}=_0x1aa467;return _0x413a14&&console['warn'](_0x5db841(0x180)+_0x21010c+'\x20is\x20ignored.\x20'+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x4045d1;}catch(_0x1a7e25){if(_0x1a7e25 instanceof Error&&_0x5db841(0x195)in _0x1a7e25&&_0x1a7e25['code']===_0x5db841(0x190))return null;throw new Error(_0x5db841(0x18b)+_0x21010c+':\x20'+_0x1a7e25);}}function a63_0x4ec7(_0x4be06b,_0x1c7b60){_0x4be06b=_0x4be06b-0x17d;const _0xbfde58=a63_0xbfde();let _0x4ec74c=_0xbfde58[_0x4be06b];return _0x4ec74c;}export function saveProjectConfig(_0x26ad10,_0x41f8e3){const _0xa344db=a63_0xbbec3c,_0x29a690=_0x41f8e3||process[_0xa344db(0x196)](),_0x58dd3a=a63_0x18e9d0[_0xa344db(0x185)](_0x29a690,PROJECT_CONFIG_FILENAME),_0x83a3be=JSON['stringify'](_0x26ad10);if(_0x83a3be[_0xa344db(0x198)]('TD_API_KEY')||_0x83a3be['includes'](_0xa344db(0x17d))||_0x83a3be[_0xa344db(0x198)]('api_key'))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if('profile'in _0x26ad10)throw new Error(_0xa344db(0x192));a63_0x39eba0[_0xa344db(0x188)](_0x58dd3a,JSON[_0xa344db(0x197)](_0x26ad10,null,0x2));}export function hasProjectConfig(_0x56e998){return findProjectConfigPath(_0x56e998)!==null;}export function getProjectRoot(_0x1536bb){const _0x1df522=a63_0xbbec3c,_0x5ca3ad=findProjectConfigPath(_0x1536bb);return _0x5ca3ad?a63_0x18e9d0[_0x1df522(0x191)](_0x5ca3ad):null;}
@@ -1 +1 @@
1
- (function(_0x55fd0f,_0x3cc107){const _0x2a8a69=a64_0x3dec,_0x21d695=_0x55fd0f();while(!![]){try{const _0x170bf2=-parseInt(_0x2a8a69(0xd4))/0x1+-parseInt(_0x2a8a69(0xd6))/0x2*(-parseInt(_0x2a8a69(0xc3))/0x3)+-parseInt(_0x2a8a69(0xb5))/0x4+parseInt(_0x2a8a69(0xc6))/0x5*(parseInt(_0x2a8a69(0xba))/0x6)+parseInt(_0x2a8a69(0xb3))/0x7*(parseInt(_0x2a8a69(0xbf))/0x8)+-parseInt(_0x2a8a69(0xbd))/0x9*(-parseInt(_0x2a8a69(0xd1))/0xa)+-parseInt(_0x2a8a69(0xd7))/0xb*(-parseInt(_0x2a8a69(0xb8))/0xc);if(_0x170bf2===_0x3cc107)break;else _0x21d695['push'](_0x21d695['shift']());}catch(_0x1813cf){_0x21d695['push'](_0x21d695['shift']());}}}(a64_0x3e86,0x7dbf0));import*as a64_0x404f82 from'node:fs';function a64_0x3dec(_0x202948,_0x1bf7fb){_0x202948=_0x202948-0xb2;const _0x3e86a0=a64_0x3e86();let _0x3dec75=_0x3e86a0[_0x202948];return _0x3dec75;}import*as a64_0x5caa3f from'node:path';import*as a64_0x728b63 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 _0x2f9b4e=a64_0x3dec,_0x48c16=process.env.TDX_CONFIG_DIR||a64_0x5caa3f[_0x2f9b4e(0xc2)](a64_0x728b63[_0x2f9b4e(0xb4)](),_0x2f9b4e(0xcb),_0x2f9b4e(0xcd));return a64_0x5caa3f[_0x2f9b4e(0xc2)](_0x48c16,_0x2f9b4e(0xb7));}function getSessionPath(_0x4e4f7f){const _0x1c607b=a64_0x3dec;return a64_0x5caa3f[_0x1c607b(0xc2)](getSessionsDir(),_0x4e4f7f+_0x1c607b(0xb6));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x263e48){const _0xd986a2=a64_0x3dec;if(_0x263e48)return _0x263e48;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0xd986a2(0xcc)]();}export function loadSessionContext(_0x5506d4){const _0x52c719=a64_0x3dec,_0x5c7d16=getSessionID(_0x5506d4),_0x4a3e29=/^\d+$/[_0x52c719(0xd5)](_0x5c7d16)?parseInt(_0x5c7d16,0xa):null;return _0x4a3e29!==null?loadSessionContextByPID(_0x4a3e29):loadSessionContextByString(_0x5c7d16);}function a64_0x3e86(){const _0x4f35ff=['createdAt','stringify','690490LqOqTh','writeFileSync','TD_API_KEY','parse','replace','.config','toString','tdx','includes','.\x20This\x20is\x20insecure.\x20Removing\x20session.','toISOString','8261690JtUtNm','unlinkSync','api_key','1011262PIFtwS','test','1506XcQUlb','585860LIQviW','readFileSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','now','apiKey','push','1743uUHznz','homedir','2906184ZbJTJN','.json','sessions','120iKljcc','warn','6SoFdCf','existsSync','readdirSync','9ZjCVpl','utf-8','17128wjFYgn','sort','getTime','join','888OBbXRd'];a64_0x3e86=function(){return _0x4f35ff;};return a64_0x3e86();}export function loadSessionContextByPID(_0x1a3932){const _0x55f409=a64_0x3dec,_0x4a3672=getSessionPath(_0x1a3932);if(!a64_0x404f82[_0x55f409(0xbb)](_0x4a3672))return null;try{const _0x51117e=a64_0x404f82['readFileSync'](_0x4a3672,_0x55f409(0xbe)),_0x333f94=JSON[_0x55f409(0xc9)](_0x51117e),_0x39644d=new Date(_0x333f94[_0x55f409(0xc4)])[_0x55f409(0xc1)](),_0x4ef0f2=Date[_0x55f409(0xda)]();if(_0x4ef0f2-_0x39644d>SESSION_EXPIRATION_MS)return a64_0x404f82[_0x55f409(0xd2)](_0x4a3672),null;const _0x358bc3=JSON[_0x55f409(0xc5)](_0x333f94);if(_0x358bc3[_0x55f409(0xce)](_0x55f409(0xc8))||_0x358bc3[_0x55f409(0xce)](_0x55f409(0xdb))||_0x358bc3['includes'](_0x55f409(0xd3)))return console[_0x55f409(0xb9)](_0x55f409(0xd9)+_0x4a3672+_0x55f409(0xcf)),a64_0x404f82['unlinkSync'](_0x4a3672),null;return _0x333f94;}catch{try{a64_0x404f82[_0x55f409(0xd2)](_0x4a3672);}catch{}return null;}}function loadSessionContextByString(_0x1abe88){const _0x45569e=a64_0x3dec,_0x11f656=a64_0x5caa3f[_0x45569e(0xc2)](getSessionsDir(),_0x1abe88+_0x45569e(0xb6));if(!a64_0x404f82[_0x45569e(0xbb)](_0x11f656))return null;try{const _0x7e669d=a64_0x404f82[_0x45569e(0xd8)](_0x11f656,_0x45569e(0xbe)),_0x8e3b0d=JSON[_0x45569e(0xc9)](_0x7e669d),_0x41af8e=new Date(_0x8e3b0d['createdAt'])[_0x45569e(0xc1)](),_0x41e6d3=Date[_0x45569e(0xda)]();if(_0x41e6d3-_0x41af8e>SESSION_EXPIRATION_MS)return a64_0x404f82[_0x45569e(0xd2)](_0x11f656),null;const _0x588f4b=JSON[_0x45569e(0xc5)](_0x8e3b0d);if(_0x588f4b[_0x45569e(0xce)](_0x45569e(0xc8))||_0x588f4b[_0x45569e(0xce)](_0x45569e(0xdb))||_0x588f4b[_0x45569e(0xce)](_0x45569e(0xd3)))return console[_0x45569e(0xb9)](_0x45569e(0xd9)+_0x11f656+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a64_0x404f82[_0x45569e(0xd2)](_0x11f656),null;return _0x8e3b0d;}catch{try{a64_0x404f82[_0x45569e(0xd2)](_0x11f656);}catch{}return null;}}export function saveSessionContext(_0x8907d8,_0x1e3481){const _0x5a1693=a64_0x3dec,_0x42c18f=getSessionID(_0x1e3481),_0x47ad03=/^\d+$/[_0x5a1693(0xd5)](_0x42c18f)?parseInt(_0x42c18f,0xa):getCurrentSessionPID(),_0x5b9aa5=a64_0x5caa3f['join'](getSessionsDir(),_0x42c18f+_0x5a1693(0xb6)),_0x2af96c=getSessionsDir();createSecureDirectory(_0x2af96c);const _0x56c2d2=JSON[_0x5a1693(0xc5)](_0x8907d8);if(_0x56c2d2['includes'](_0x5a1693(0xc8))||_0x56c2d2['includes'](_0x5a1693(0xdb))||_0x56c2d2[_0x5a1693(0xce)](_0x5a1693(0xd3)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.');let _0x513749;const _0x385f94=/^\d+$/[_0x5a1693(0xd5)](_0x42c18f)?loadSessionContextByPID(parseInt(_0x42c18f,0xa)):loadSessionContextByString(_0x42c18f);_0x385f94?_0x513749={..._0x385f94,..._0x8907d8,'pid':_0x47ad03,'sessionId':_0x42c18f!==_0x47ad03['toString']()?_0x42c18f:undefined,'updatedAt':new Date()[_0x5a1693(0xd0)]()}:_0x513749={'pid':_0x47ad03,'sessionId':_0x42c18f!==_0x47ad03['toString']()?_0x42c18f:undefined,..._0x8907d8,'createdAt':new Date()[_0x5a1693(0xd0)](),'updatedAt':new Date()[_0x5a1693(0xd0)]()},a64_0x404f82['writeFileSync'](_0x5b9aa5,JSON[_0x5a1693(0xc5)](_0x513749,null,0x2));}export function clearSessionContext(_0x32e60b){const _0x176935=a64_0x3dec,_0x40e462=getSessionID(_0x32e60b),_0x497416=a64_0x5caa3f[_0x176935(0xc2)](getSessionsDir(),_0x40e462+'.json');a64_0x404f82[_0x176935(0xbb)](_0x497416)&&a64_0x404f82[_0x176935(0xd2)](_0x497416);}export function clearSessionContextField(_0xb173de,_0x5c426d){const _0x4b3136=a64_0x3dec,_0x459b1e=getSessionID(_0x5c426d),_0x46e074=a64_0x5caa3f[_0x4b3136(0xc2)](getSessionsDir(),_0x459b1e+'.json');if(!a64_0x404f82[_0x4b3136(0xbb)](_0x46e074))return;try{const _0x4631ba=a64_0x404f82[_0x4b3136(0xd8)](_0x46e074,_0x4b3136(0xbe)),_0x3e09c6=JSON[_0x4b3136(0xc9)](_0x4631ba);delete _0x3e09c6[_0xb173de],a64_0x404f82[_0x4b3136(0xc7)](_0x46e074,JSON[_0x4b3136(0xc5)](_0x3e09c6,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x305987=a64_0x3dec,_0x30c437=getSessionsDir();if(!a64_0x404f82[_0x305987(0xbb)](_0x30c437))return 0x0;let _0x10fd98=0x0;const _0x33c49a=Date[_0x305987(0xda)]();try{const _0x1592ca=a64_0x404f82['readdirSync'](_0x30c437);for(const _0x2eaddb of _0x1592ca){if(!_0x2eaddb['endsWith'](_0x305987(0xb6)))continue;const _0x40ab62=a64_0x5caa3f[_0x305987(0xc2)](_0x30c437,_0x2eaddb),_0x5955d9=_0x2eaddb['replace'](_0x305987(0xb6),''),_0x4ac7eb=parseInt(_0x5955d9,0xa),_0x4762cc=!isNaN(_0x4ac7eb);if(_0x4762cc){if(!isProcessRunning(_0x4ac7eb)){a64_0x404f82[_0x305987(0xd2)](_0x40ab62),_0x10fd98++;continue;}}try{const _0x2f47a9=a64_0x404f82[_0x305987(0xd8)](_0x40ab62,_0x305987(0xbe)),_0xa3ef77=JSON[_0x305987(0xc9)](_0x2f47a9),_0x18421c=new Date(_0xa3ef77[_0x305987(0xc4)])[_0x305987(0xc1)]();_0x33c49a-_0x18421c>SESSION_EXPIRATION_MS&&(a64_0x404f82['unlinkSync'](_0x40ab62),_0x10fd98++);}catch{a64_0x404f82[_0x305987(0xd2)](_0x40ab62),_0x10fd98++;}}}catch{}return _0x10fd98;}export function listActiveSessions(){const _0x2fc695=a64_0x3dec,_0xb721a7=getSessionsDir();if(!a64_0x404f82['existsSync'](_0xb721a7))return[];try{const _0x4b9c1c=a64_0x404f82[_0x2fc695(0xbc)](_0xb721a7),_0x937903=[];for(const _0x5d1a62 of _0x4b9c1c){if(!_0x5d1a62['endsWith'](_0x2fc695(0xb6)))continue;const _0x69b41a=_0x5d1a62[_0x2fc695(0xca)](_0x2fc695(0xb6),''),_0xe33483=parseInt(_0x69b41a,0xa);!isNaN(_0xe33483)&&isProcessRunning(_0xe33483)&&_0x937903[_0x2fc695(0xb2)](_0xe33483);}return _0x937903[_0x2fc695(0xc0)]((_0x149dd1,_0x3f4603)=>_0x149dd1-_0x3f4603);}catch{return[];}}
1
+ (function(_0x1f8d5d,_0x55f22d){const _0x1485a9=a64_0x15fe,_0x2e92a1=_0x1f8d5d();while(!![]){try{const _0x5e4b9f=-parseInt(_0x1485a9(0x16c))/0x1*(-parseInt(_0x1485a9(0x160))/0x2)+-parseInt(_0x1485a9(0x174))/0x3*(-parseInt(_0x1485a9(0x178))/0x4)+-parseInt(_0x1485a9(0x16b))/0x5+-parseInt(_0x1485a9(0x172))/0x6*(parseInt(_0x1485a9(0x171))/0x7)+parseInt(_0x1485a9(0x179))/0x8*(parseInt(_0x1485a9(0x180))/0x9)+parseInt(_0x1485a9(0x186))/0xa*(parseInt(_0x1485a9(0x177))/0xb)+-parseInt(_0x1485a9(0x161))/0xc*(parseInt(_0x1485a9(0x166))/0xd);if(_0x5e4b9f===_0x55f22d)break;else _0x2e92a1['push'](_0x2e92a1['shift']());}catch(_0x15cfa8){_0x2e92a1['push'](_0x2e92a1['shift']());}}}(a64_0x1573,0xc44fa));import*as a64_0x49ae3a from'node:fs';import*as a64_0x40c9d4 from'node:path';import*as a64_0x2c0048 from'node:os';function a64_0x15fe(_0x144851,_0x14418d){_0x144851=_0x144851-0x15f;const _0x157325=a64_0x1573();let _0x15fecf=_0x157325[_0x144851];return _0x15fecf;}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 _0x54a776=a64_0x15fe,_0x44a71a=process.env.TDX_CONFIG_DIR||a64_0x40c9d4[_0x54a776(0x168)](a64_0x2c0048[_0x54a776(0x16f)](),'.config','tdx');return a64_0x40c9d4[_0x54a776(0x168)](_0x44a71a,_0x54a776(0x181));}function getSessionPath(_0x282b47){const _0x46ba5a=a64_0x15fe;return a64_0x40c9d4[_0x46ba5a(0x168)](getSessionsDir(),_0x282b47+'.json');}function a64_0x1573(){const _0x2d10e0=['.json','warn','1346njyEJO','313428WEKPBS','.\x20This\x20is\x20insecure.\x20Removing\x20session.','api_key','apiKey','TD_API_KEY','949tAYlfw','readdirSync','join','toISOString','replace','2319050jRHNWA','1415FllVGm','getTime','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','homedir','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','63zVWirZ','471276awXcOP','writeFileSync','2706nvVMdV','utf-8','now','790185DBeFLV','5636KGknht','6944824Viyorm','parse','test','includes','readFileSync','stringify','endsWith','9bjRXMi','sessions','unlinkSync','existsSync','sort','createdAt','110RFbAsQ','toString'];a64_0x1573=function(){return _0x2d10e0;};return a64_0x1573();}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x10863f){const _0x3cf2a6=a64_0x15fe;if(_0x10863f)return _0x10863f;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x3cf2a6(0x187)]();}export function loadSessionContext(_0x44685e){const _0x143e93=a64_0x15fe,_0x50fa41=getSessionID(_0x44685e),_0x342116=/^\d+$/[_0x143e93(0x17b)](_0x50fa41)?parseInt(_0x50fa41,0xa):null;return _0x342116!==null?loadSessionContextByPID(_0x342116):loadSessionContextByString(_0x50fa41);}export function loadSessionContextByPID(_0x4025fb){const _0x3c6e69=a64_0x15fe,_0x6cebbf=getSessionPath(_0x4025fb);if(!a64_0x49ae3a[_0x3c6e69(0x183)](_0x6cebbf))return null;try{const _0x4d7814=a64_0x49ae3a[_0x3c6e69(0x17d)](_0x6cebbf,'utf-8'),_0x459484=JSON[_0x3c6e69(0x17a)](_0x4d7814),_0x1dadd7=new Date(_0x459484['createdAt'])[_0x3c6e69(0x16d)](),_0x59e6ef=Date[_0x3c6e69(0x176)]();if(_0x59e6ef-_0x1dadd7>SESSION_EXPIRATION_MS)return a64_0x49ae3a['unlinkSync'](_0x6cebbf),null;const _0x46dfef=JSON['stringify'](_0x459484);if(_0x46dfef[_0x3c6e69(0x17c)](_0x3c6e69(0x165))||_0x46dfef[_0x3c6e69(0x17c)](_0x3c6e69(0x164))||_0x46dfef[_0x3c6e69(0x17c)](_0x3c6e69(0x163)))return console[_0x3c6e69(0x15f)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x6cebbf+_0x3c6e69(0x162)),a64_0x49ae3a[_0x3c6e69(0x182)](_0x6cebbf),null;return _0x459484;}catch{try{a64_0x49ae3a[_0x3c6e69(0x182)](_0x6cebbf);}catch{}return null;}}function loadSessionContextByString(_0x2e4c29){const _0x5570eb=a64_0x15fe,_0x545746=a64_0x40c9d4[_0x5570eb(0x168)](getSessionsDir(),_0x2e4c29+_0x5570eb(0x188));if(!a64_0x49ae3a['existsSync'](_0x545746))return null;try{const _0x4f83f3=a64_0x49ae3a[_0x5570eb(0x17d)](_0x545746,'utf-8'),_0x26f8d5=JSON['parse'](_0x4f83f3),_0x2381d5=new Date(_0x26f8d5[_0x5570eb(0x185)])['getTime'](),_0x49dd5c=Date[_0x5570eb(0x176)]();if(_0x49dd5c-_0x2381d5>SESSION_EXPIRATION_MS)return a64_0x49ae3a[_0x5570eb(0x182)](_0x545746),null;const _0x2c4a42=JSON[_0x5570eb(0x17e)](_0x26f8d5);if(_0x2c4a42[_0x5570eb(0x17c)](_0x5570eb(0x165))||_0x2c4a42[_0x5570eb(0x17c)](_0x5570eb(0x164))||_0x2c4a42[_0x5570eb(0x17c)](_0x5570eb(0x163)))return console['warn'](_0x5570eb(0x170)+_0x545746+_0x5570eb(0x162)),a64_0x49ae3a[_0x5570eb(0x182)](_0x545746),null;return _0x26f8d5;}catch{try{a64_0x49ae3a[_0x5570eb(0x182)](_0x545746);}catch{}return null;}}export function saveSessionContext(_0x9776e7,_0x5cbcad){const _0x414f4c=a64_0x15fe,_0x26a345=getSessionID(_0x5cbcad),_0x1492b3=/^\d+$/[_0x414f4c(0x17b)](_0x26a345)?parseInt(_0x26a345,0xa):getCurrentSessionPID(),_0x4dabff=a64_0x40c9d4['join'](getSessionsDir(),_0x26a345+_0x414f4c(0x188)),_0x4c9744=getSessionsDir();createSecureDirectory(_0x4c9744);const _0x44ab57=JSON[_0x414f4c(0x17e)](_0x9776e7);if(_0x44ab57['includes'](_0x414f4c(0x165))||_0x44ab57[_0x414f4c(0x17c)](_0x414f4c(0x164))||_0x44ab57[_0x414f4c(0x17c)](_0x414f4c(0x163)))throw new Error(_0x414f4c(0x16e));let _0x1c078a;const _0x3cbb3e=/^\d+$/[_0x414f4c(0x17b)](_0x26a345)?loadSessionContextByPID(parseInt(_0x26a345,0xa)):loadSessionContextByString(_0x26a345);_0x3cbb3e?_0x1c078a={..._0x3cbb3e,..._0x9776e7,'pid':_0x1492b3,'sessionId':_0x26a345!==_0x1492b3[_0x414f4c(0x187)]()?_0x26a345:undefined,'updatedAt':new Date()['toISOString']()}:_0x1c078a={'pid':_0x1492b3,'sessionId':_0x26a345!==_0x1492b3[_0x414f4c(0x187)]()?_0x26a345:undefined,..._0x9776e7,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0x414f4c(0x169)]()},a64_0x49ae3a[_0x414f4c(0x173)](_0x4dabff,JSON['stringify'](_0x1c078a,null,0x2));}export function clearSessionContext(_0x9a98fe){const _0x3d6af4=a64_0x15fe,_0xd111e4=getSessionID(_0x9a98fe),_0x273d6c=a64_0x40c9d4[_0x3d6af4(0x168)](getSessionsDir(),_0xd111e4+_0x3d6af4(0x188));a64_0x49ae3a['existsSync'](_0x273d6c)&&a64_0x49ae3a[_0x3d6af4(0x182)](_0x273d6c);}export function clearSessionContextField(_0x332599,_0xbdcfcc){const _0x3fae9e=a64_0x15fe,_0x897d=getSessionID(_0xbdcfcc),_0x846575=a64_0x40c9d4[_0x3fae9e(0x168)](getSessionsDir(),_0x897d+_0x3fae9e(0x188));if(!a64_0x49ae3a[_0x3fae9e(0x183)](_0x846575))return;try{const _0x2e916b=a64_0x49ae3a[_0x3fae9e(0x17d)](_0x846575,_0x3fae9e(0x175)),_0x4f1d4f=JSON[_0x3fae9e(0x17a)](_0x2e916b);delete _0x4f1d4f[_0x332599],a64_0x49ae3a[_0x3fae9e(0x173)](_0x846575,JSON[_0x3fae9e(0x17e)](_0x4f1d4f,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x498e85=a64_0x15fe,_0x767df8=getSessionsDir();if(!a64_0x49ae3a[_0x498e85(0x183)](_0x767df8))return 0x0;let _0x598501=0x0;const _0x4c2d85=Date['now']();try{const _0x32417c=a64_0x49ae3a[_0x498e85(0x167)](_0x767df8);for(const _0x4e66ef of _0x32417c){if(!_0x4e66ef[_0x498e85(0x17f)]('.json'))continue;const _0x1616ac=a64_0x40c9d4[_0x498e85(0x168)](_0x767df8,_0x4e66ef),_0x3539af=_0x4e66ef[_0x498e85(0x16a)](_0x498e85(0x188),''),_0x206059=parseInt(_0x3539af,0xa),_0x48fc54=!isNaN(_0x206059);if(_0x48fc54){if(!isProcessRunning(_0x206059)){a64_0x49ae3a['unlinkSync'](_0x1616ac),_0x598501++;continue;}}try{const _0x545d0e=a64_0x49ae3a['readFileSync'](_0x1616ac,_0x498e85(0x175)),_0x2def7a=JSON[_0x498e85(0x17a)](_0x545d0e),_0x3bb83e=new Date(_0x2def7a[_0x498e85(0x185)])['getTime']();_0x4c2d85-_0x3bb83e>SESSION_EXPIRATION_MS&&(a64_0x49ae3a[_0x498e85(0x182)](_0x1616ac),_0x598501++);}catch{a64_0x49ae3a[_0x498e85(0x182)](_0x1616ac),_0x598501++;}}}catch{}return _0x598501;}export function listActiveSessions(){const _0x15aec1=a64_0x15fe,_0x48eb32=getSessionsDir();if(!a64_0x49ae3a[_0x15aec1(0x183)](_0x48eb32))return[];try{const _0x385c10=a64_0x49ae3a[_0x15aec1(0x167)](_0x48eb32),_0x4127f0=[];for(const _0xa6a559 of _0x385c10){if(!_0xa6a559['endsWith'](_0x15aec1(0x188)))continue;const _0xb9336d=_0xa6a559[_0x15aec1(0x16a)](_0x15aec1(0x188),''),_0x1f4015=parseInt(_0xb9336d,0xa);!isNaN(_0x1f4015)&&isProcessRunning(_0x1f4015)&&_0x4127f0['push'](_0x1f4015);}return _0x4127f0[_0x15aec1(0x184)]((_0x76b531,_0x30e065)=>_0x76b531-_0x30e065);}catch{return[];}}
@@ -1 +1 @@
1
- const a65_0x42b822=a65_0x55ce;(function(_0x2e26d2,_0x30f3df){const _0x4775e3=a65_0x55ce,_0x18a2a6=_0x2e26d2();while(!![]){try{const _0x2bd1ef=parseInt(_0x4775e3(0x153))/0x1+parseInt(_0x4775e3(0x157))/0x2+-parseInt(_0x4775e3(0x151))/0x3*(-parseInt(_0x4775e3(0x14a))/0x4)+-parseInt(_0x4775e3(0x154))/0x5*(-parseInt(_0x4775e3(0x156))/0x6)+parseInt(_0x4775e3(0x14e))/0x7+parseInt(_0x4775e3(0x155))/0x8+-parseInt(_0x4775e3(0x14d))/0x9;if(_0x2bd1ef===_0x30f3df)break;else _0x18a2a6['push'](_0x18a2a6['shift']());}catch(_0x19f065){_0x18a2a6['push'](_0x18a2a6['shift']());}}}(a65_0x348c,0x24f23));function a65_0x55ce(_0x32c167,_0x214268){_0x32c167=_0x32c167-0x14a;const _0x348ca2=a65_0x348c();let _0x55ce85=_0x348ca2[_0x32c167];return _0x55ce85;}import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a65_0x42b822(0x14c),'core/user-cache');export function loadCachedUsers(_0x221aa4){const _0x35fe45=a65_0x42b822,_0x296983=userCache['read'](_0x221aa4);return _0x296983?.[_0x35fe45(0x14b)]??null;}function a65_0x348c(){const _0x3425fc=['1087176jAEtwU','71748ORDFiO','420704bPCiXR','75512eBSJoX','users','users-{profile}.json','9381006eZghmJ','1823745btmjsR','write','now','21gOpcDi','clear','179701wqzMGq','115DptVjI'];a65_0x348c=function(){return _0x3425fc;};return a65_0x348c();}export function saveCachedUsers(_0x5eb582,_0x8e1fd){const _0xe0dd08=a65_0x42b822;userCache[_0xe0dd08(0x14f)](_0x5eb582,{'users':_0x8e1fd,'cachedAt':Date[_0xe0dd08(0x150)]()});}export function clearUserCache(_0x4b93d9){const _0xfdb52f=a65_0x42b822;userCache[_0xfdb52f(0x152)](_0x4b93d9);}
1
+ function a65_0x1722(){const _0x7f2dc4=['8091016wQMkKb','9044895bruHYb','read','clear','users','write','136862YUcMaI','36XrYIRy','5057229dkgVrs','users-{profile}.json','2122332Jgdzsa','3365052gkuXSc','now','8799525wWGttM','7ObXKot'];a65_0x1722=function(){return _0x7f2dc4;};return a65_0x1722();}const a65_0x4fec01=a65_0x3446;(function(_0x2f2fb8,_0x5643e2){const _0x496a28=a65_0x3446,_0x15e207=_0x2f2fb8();while(!![]){try{const _0x19baf0=parseInt(_0x496a28(0x1a6))/0x1*(-parseInt(_0x496a28(0x1ad))/0x2)+parseInt(_0x496a28(0x1af))/0x3+-parseInt(_0x496a28(0x1b2))/0x4+-parseInt(_0x496a28(0x1a8))/0x5+-parseInt(_0x496a28(0x1b1))/0x6+-parseInt(_0x496a28(0x1a5))/0x7+parseInt(_0x496a28(0x1a7))/0x8*(parseInt(_0x496a28(0x1ae))/0x9);if(_0x19baf0===_0x5643e2)break;else _0x15e207['push'](_0x15e207['shift']());}catch(_0x538a9f){_0x15e207['push'](_0x15e207['shift']());}}}(a65_0x1722,0xf1fdb));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a65_0x4fec01(0x1b0),'core/user-cache');function a65_0x3446(_0x453eb7,_0xc3a4c6){_0x453eb7=_0x453eb7-0x1a5;const _0x1722e2=a65_0x1722();let _0x3446b5=_0x1722e2[_0x453eb7];return _0x3446b5;}export function loadCachedUsers(_0x3fc991){const _0x361e27=a65_0x4fec01,_0x1d50a4=userCache[_0x361e27(0x1a9)](_0x3fc991);return _0x1d50a4?.[_0x361e27(0x1ab)]??null;}export function saveCachedUsers(_0x256acc,_0x1be0f9){const _0x41e1dd=a65_0x4fec01;userCache[_0x41e1dd(0x1ac)](_0x256acc,{'users':_0x1be0f9,'cachedAt':Date[_0x41e1dd(0x1b3)]()});}export function clearUserCache(_0x4b484b){const _0x350f07=a65_0x4fec01;userCache[_0x350f07(0x1aa)](_0x4b484b);}
@@ -1 +1 @@
1
- (function(_0x5e4173,_0x57bcb3){const _0xdcae2c=a66_0x5291,_0xb796c8=_0x5e4173();while(!![]){try{const _0x583179=parseInt(_0xdcae2c(0xbf))/0x1*(-parseInt(_0xdcae2c(0xbc))/0x2)+parseInt(_0xdcae2c(0xc1))/0x3*(parseInt(_0xdcae2c(0xb6))/0x4)+-parseInt(_0xdcae2c(0xb8))/0x5+parseInt(_0xdcae2c(0xbb))/0x6*(parseInt(_0xdcae2c(0xb4))/0x7)+parseInt(_0xdcae2c(0xc2))/0x8+parseInt(_0xdcae2c(0xb5))/0x9*(parseInt(_0xdcae2c(0xb3))/0xa)+-parseInt(_0xdcae2c(0xbe))/0xb*(parseInt(_0xdcae2c(0xba))/0xc);if(_0x583179===_0x57bcb3)break;else _0xb796c8['push'](_0xb796c8['shift']());}catch(_0xd53a20){_0xb796c8['push'](_0xb796c8['shift']());}}}(a66_0x5847,0x618e3));import{readFileSync}from'fs';import{fileURLToPath}from'url';function a66_0x5291(_0x338bbf,_0x5e2ef1){_0x338bbf=_0x338bbf-0xb3;const _0x584771=a66_0x5847();let _0x5291eb=_0x584771[_0x338bbf];return _0x5291eb;}function a66_0x5847(){const _0x3b2a70=['utf-8','3040800BrNqAn','.dev','1764njKrRq','6IFIWvE','2KJQNFm','0.0.0','9658DbVDVJ','140636oZwZmn','../build-info.json','6AdTmkw','2278040XpfQCJ','version','parse','includes','../../package.json','10exqUvC','953519CtPYkW','1093275xuuEVh','1470004vEexiv'];a66_0x5847=function(){return _0x3b2a70;};return a66_0x5847();}import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x15f807=a66_0x5291;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x4c010e=fileURLToPath(import.meta.url),_0x5b4e56=dirname(_0x4c010e);try{const _0x372204=join(_0x5b4e56,_0x15f807(0xc0));cachedBuildInfo=JSON[_0x15f807(0xc4)](readFileSync(_0x372204,_0x15f807(0xb7)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x5efc19=a66_0x5291;if(cachedVersion!==null)return cachedVersion;const _0x25590e=fileURLToPath(import.meta.url),_0x395044=dirname(_0x25590e),_0x17dd95=getBuildInfo();if(_0x17dd95['version'])return cachedVersion=_0x17dd95['version'],cachedVersion;try{const _0x494343=join(_0x395044,_0x5efc19(0xc6)),_0x3c1a13=JSON[_0x5efc19(0xc4)](readFileSync(_0x494343,_0x5efc19(0xb7)));cachedVersion=_0x3c1a13[_0x5efc19(0xc3)];}catch{cachedVersion=_0x5efc19(0xbd);}return cachedVersion;}export function isDevVersion(){const _0x196b7d=a66_0x5291,_0x352be1=getVersion();return _0x352be1[_0x196b7d(0xc5)](_0x196b7d(0xb9))||_0x352be1['includes']('-');}
1
+ (function(_0x249f40,_0x1dff6a){const _0x22ed48=a66_0x3a9b,_0x3c7161=_0x249f40();while(!![]){try{const _0x9c4af1=-parseInt(_0x22ed48(0x1c6))/0x1*(-parseInt(_0x22ed48(0x1d1))/0x2)+-parseInt(_0x22ed48(0x1ca))/0x3+-parseInt(_0x22ed48(0x1c3))/0x4*(-parseInt(_0x22ed48(0x1d5))/0x5)+parseInt(_0x22ed48(0x1cb))/0x6*(parseInt(_0x22ed48(0x1ce))/0x7)+-parseInt(_0x22ed48(0x1c4))/0x8*(parseInt(_0x22ed48(0x1c7))/0x9)+parseInt(_0x22ed48(0x1cf))/0xa+-parseInt(_0x22ed48(0x1c9))/0xb;if(_0x9c4af1===_0x1dff6a)break;else _0x3c7161['push'](_0x3c7161['shift']());}catch(_0x4395f0){_0x3c7161['push'](_0x3c7161['shift']());}}}(a66_0x2341,0x2be95));import{readFileSync}from'fs';function a66_0x3a9b(_0x457004,_0x38e56d){_0x457004=_0x457004-0x1c3;const _0x2341e8=a66_0x2341();let _0x3a9b26=_0x2341e8[_0x457004];return _0x3a9b26;}import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x36788b=a66_0x3a9b;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x2a667a=fileURLToPath(import.meta.url),_0x3a504d=dirname(_0x2a667a);try{const _0x121847=join(_0x3a504d,_0x36788b(0x1d4));cachedBuildInfo=JSON['parse'](readFileSync(_0x121847,'utf-8'));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0xd63440=a66_0x3a9b;if(cachedVersion!==null)return cachedVersion;const _0x1de49e=fileURLToPath(import.meta.url),_0x416e69=dirname(_0x1de49e),_0x53656d=getBuildInfo();if(_0x53656d[_0xd63440(0x1cd)])return cachedVersion=_0x53656d[_0xd63440(0x1cd)],cachedVersion;try{const _0x380594=join(_0x416e69,_0xd63440(0x1c8)),_0x2bd40d=JSON[_0xd63440(0x1cc)](readFileSync(_0x380594,_0xd63440(0x1d0)));cachedVersion=_0x2bd40d['version'];}catch{cachedVersion=_0xd63440(0x1d3);}return cachedVersion;}export function isDevVersion(){const _0x48a1c2=a66_0x3a9b,_0x1d398d=getVersion();return _0x1d398d['includes'](_0x48a1c2(0x1d2))||_0x1d398d[_0x48a1c2(0x1c5)]('-');}function a66_0x2341(){const _0x18d412=['63MXJywW','../../package.json','3326125ixHzFA','819378dhvxic','1670982puJXbw','parse','version','7MOlAzR','1362200uRJsRK','utf-8','84826iFCdrU','.dev','0.0.0','../build-info.json','42885uIZAUM','92KPoEZq','30032jyXVsh','includes','4KankOd'];a66_0x2341=function(){return _0x18d412;};return a66_0x2341();}