@treasuredata/tdx 2026.3.17 → 2026.3.18

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_0x24305c=a54_0x33fe;(function(_0x3e9c0c,_0x3cac31){const _0x38ada2=a54_0x33fe,_0x2c1270=_0x3e9c0c();while(!![]){try{const _0x41ea96=parseInt(_0x38ada2(0x137))/0x1+-parseInt(_0x38ada2(0x147))/0x2+parseInt(_0x38ada2(0x145))/0x3+parseInt(_0x38ada2(0x126))/0x4+parseInt(_0x38ada2(0x14d))/0x5*(parseInt(_0x38ada2(0x115))/0x6)+parseInt(_0x38ada2(0x150))/0x7+-parseInt(_0x38ada2(0x141))/0x8*(parseInt(_0x38ada2(0x15a))/0x9);if(_0x41ea96===_0x3cac31)break;else _0x2c1270['push'](_0x2c1270['shift']());}catch(_0x3828ed){_0x2c1270['push'](_0x2c1270['shift']());}}}(a54_0x20d8,0x28f25));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x27a34d from'node:fs';import*as a54_0x207ecf 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_0x298d92 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x1f7ade=a54_0x33fe;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x1f7ade(0x117),_0x1f7ade(0x140));}export function getConfigFile(){const _0x5c5e91=a54_0x33fe;return join(getConfigDir(),_0x5c5e91(0x10f));}export function getConfigFilePath(_0x2ffd75){const _0xf34055=a54_0x33fe,_0x56c4ca=getConfigDir();return _0x2ffd75?a54_0x207ecf['join'](_0x56c4ca,_0xf34055(0x128)+_0x2ffd75):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x24305c(0x11c),'config/llm-project');export function getLLMProjectCacheFile(_0x4c00e3){return llmProjectCache['path'](_0x4c00e3);}export function readCachedLLMProject(_0x546a27){const _0x59d344=a54_0x24305c,_0x46a2a0=llmProjectCache['read'](_0x546a27);if(_0x46a2a0&&typeof _0x46a2a0['id']==='string'&&typeof _0x46a2a0[_0x59d344(0x13f)]==='string')return _0x46a2a0;return null;}export function writeCachedLLMProject(_0x110ed8,_0xcfa4d4,_0x620198){const _0x39a2d2=a54_0x24305c;try{llmProjectCache[_0x39a2d2(0x123)]({'name':_0x110ed8,'id':_0xcfa4d4},_0x620198);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x24305c(0x13c),a54_0x24305c(0x134));export function getLLMAgentCacheFile(_0x2955b4){const _0x3be5de=a54_0x24305c;return llmAgentCache[_0x3be5de(0x149)](_0x2955b4);}export function readCachedLLMAgent(_0x3361e6){const _0x2e9ae8=a54_0x24305c,_0x34efef=llmAgentCache[_0x2e9ae8(0x127)](_0x3361e6);if(_0x34efef&&typeof _0x34efef['id']==='string'&&typeof _0x34efef[_0x2e9ae8(0x13f)]===_0x2e9ae8(0x133)&&typeof _0x34efef[_0x2e9ae8(0x153)]==='string')return _0x34efef;return null;}export function writeCachedLLMAgent(_0x4ee278,_0x302def,_0x1bc46c,_0x1af8f0){const _0x4d3033=a54_0x24305c;try{llmAgentCache[_0x4d3033(0x123)]({'name':_0x4ee278,'id':_0x302def,'projectId':_0x1bc46c},_0x1af8f0);}catch{}}export function clearCachedLLMAgent(_0x543367){try{llmAgentCache['clear'](_0x543367);}catch{}}const accountInfoCache=createOptionalProfileCache(a54_0x24305c(0x156),a54_0x24305c(0x14c),{'suffix':'.json'});export function getAccountInfoCacheFile(_0x3056f0){return accountInfoCache['path'](_0x3056f0);}export function readCachedAccountInfo(_0x4c2ab7){const _0x3ff1db=a54_0x24305c,_0x23542b=accountInfoCache['read'](_0x4c2ab7);if(_0x23542b&&typeof _0x23542b[_0x3ff1db(0x111)]===_0x3ff1db(0x133)&&typeof _0x23542b['accountId']===_0x3ff1db(0x11d))return _0x23542b;return null;}function a54_0x20d8(){const _0x34bb93=['llm_default_project','number','readFileSync','entries','some','stg-ap03','Warning:\x20Unknown\x20site\x20\x27','write','split','join','379476JReXez','read','.env.','stg-ap01','keychain','utf-8','ap03','stable','includes','stg-us01','tdx.json','TDX_API_KEY_','source','string','config/llm-agent','endsWith','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','122337Xvdqjh','existsSync','us01','\x20env\x20var','apiKey','llm_default_agent','trim','keychain\x20(profile:\x20','name','tdx','13152mOSfKf','slice','profile','parse','930354AyoghD','accessToken','197556FArrUc','TDX_ACCESS_TOKEN\x20env\x20var','path','TDX_ACCESS_TOKEN_','toUpperCase','config/account-info','20gfTeDP','apiKeys','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','203777DxkQOz','map','dev-us01','projectId','\x27,\x20defaulting\x20to\x20us01','TD_API_KEY','account_info','proxy','Warning:\x20Failed\x20to\x20read\x20','filter','2979zrQbTl','replace','startsWith','.env','stringify','site','TDX_API_KEY\x20env\x20var','TD_API_KEY_','warn','381336ZmaCXX','ap02','.config','release_channel','dev-eu01','ap01','yellow'];a54_0x20d8=function(){return _0x34bb93;};return a54_0x20d8();}export function writeCachedAccountInfo(_0x3343a7,_0xef03b0,_0x3702e9){const _0x5bd597=a54_0x24305c;try{accountInfoCache[_0x5bd597(0x123)]({'site':_0x3343a7,'accountId':_0xef03b0,'cachedAt':new Date()['toISOString']()},_0x3702e9);}catch{}}export function parseEnvFile(_0x3129d3){const _0x43e4f0=a54_0x24305c,_0x4f21cb={};for(const _0x167f95 of _0x3129d3[_0x43e4f0(0x124)]('\x0a')){const _0xcb78ac=_0x167f95[_0x43e4f0(0x13d)]();if(!_0xcb78ac||_0xcb78ac[_0x43e4f0(0x15c)]('#'))continue;const _0x31604b=_0xcb78ac['match'](/^([^=]+)=(.*)$/);if(_0x31604b){const _0x48b181=_0x31604b[0x1][_0x43e4f0(0x13d)]();let _0x3c26e6=_0x31604b[0x2][_0x43e4f0(0x13d)]();(_0x3c26e6[_0x43e4f0(0x15c)]('\x22')&&_0x3c26e6[_0x43e4f0(0x135)]('\x22')||_0x3c26e6[_0x43e4f0(0x15c)]('\x27')&&_0x3c26e6[_0x43e4f0(0x135)]('\x27'))&&(_0x3c26e6=_0x3c26e6[_0x43e4f0(0x142)](0x1,-0x1)),_0x4f21cb[_0x48b181]=_0x3c26e6;}}return _0x4f21cb;}export function readUserConfig(){const _0xb6e734=a54_0x24305c,_0x2889c2=getConfigFile();if(!existsSync(_0x2889c2))return{};try{const _0x336b33=readFileSync(_0x2889c2,_0xb6e734(0x12b));return parseEnvFile(_0x336b33);}catch(_0x538871){return console[_0xb6e734(0x114)](_0xb6e734(0x14f)+_0x2889c2+':',_0x538871),{};}}export function resolveSite(_0x1c4e00){const _0x257065=a54_0x24305c,_0x36b47f=[_0x257065(0x139),_0x257065(0x11a),'eu01',_0x257065(0x116),_0x257065(0x12c),_0x257065(0x152),_0x257065(0x119),_0x257065(0x12f),_0x257065(0x129),'stg-ap03'];if(_0x36b47f[_0x257065(0x12e)](_0x1c4e00))return _0x1c4e00;if(_0x1c4e00 in SITE_ALIASES)return SITE_ALIASES[_0x1c4e00];return console[_0x257065(0x114)](_0x257065(0x122)+_0x1c4e00+_0x257065(0x154)),_0x257065(0x139);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0xbf9a78){const _0x20d9de=a54_0x24305c,_0x4323c8=_0xbf9a78||getActiveProfileName()||undefined;if(_0x4323c8){const _0x5e89ad=_0x20d9de(0x14a)+normalizeProfileForEnvVar(_0x4323c8);if(process.env[_0x5e89ad])return{'accessToken':process.env[_0x5e89ad],'source':_0x5e89ad+'\x20env\x20var'};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x20d9de(0x148)};return null;}export function getAccessToken(_0x265633){const _0x44c43b=a54_0x24305c;return resolveAccessToken(_0x265633)?.[_0x44c43b(0x146)];}function a54_0x33fe(_0x351d87,_0x4cbf94){_0x351d87=_0x351d87-0x10f;const _0x20d87b=a54_0x20d8();let _0x33feac=_0x20d87b[_0x351d87];return _0x33feac;}export function getAPIKey(_0x2a787d){const _0x33d028=a54_0x24305c,_0x5756e1=_0x2a787d||getActiveProfileName();if(_0x5756e1){const _0x566a75=_0x33d028(0x131)+normalizeProfileForEnvVar(_0x5756e1);if(process.env[_0x566a75])return process.env[_0x566a75];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x402ef4){const _0xd654a6=a54_0x24305c;return _0x402ef4[_0xd654a6(0x14b)]()[_0xd654a6(0x15b)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x2c8530,_0x481d92){const _0x23a902=a54_0x24305c,_0x27635a=resolveAccessToken(_0x481d92);if(_0x27635a)return{'apiKey':_0x27635a[_0x23a902(0x146)],'source':_0x27635a[_0x23a902(0x132)],'isDeprecated':![]};const _0x1e94ce=_0x481d92||getActiveProfileName()||undefined;if(_0x1e94ce){const _0x1d61f2=_0x23a902(0x131)+normalizeProfileForEnvVar(_0x1e94ce);if(process.env[_0x1d61f2])return{'apiKey':process.env[_0x1d61f2],'source':_0x1d61f2+_0x23a902(0x13a),'isDeprecated':![]};const _0x13906c=getCachedCredential(_0x2c8530,_0x1e94ce);if(_0x13906c)return{'apiKey':_0x13906c,'source':_0x23a902(0x13e)+_0x1e94ce+')','isDeprecated':![]};const _0xb8d910=await getKeychainAPIKey(_0x1e94ce);if(_0xb8d910)return setCachedCredential(_0xb8d910,_0x2c8530,_0x1e94ce),{'apiKey':_0xb8d910,'source':'keychain\x20(profile:\x20'+_0x1e94ce+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x23a902(0x112),'isDeprecated':![]};if(!_0x1e94ce){const _0x266e93=getCachedCredential(_0x2c8530,undefined);if(_0x266e93)return{'apiKey':_0x266e93,'source':_0x23a902(0x12a),'isDeprecated':![]};const _0x2810e5=await getKeychainAPIKey(undefined);if(_0x2810e5)return setCachedCredential(_0x2810e5,_0x2c8530,undefined),{'apiKey':_0x2810e5,'source':_0x23a902(0x12a),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x4c8a4f,_0x9bd402){const _0x2e9835=a54_0x24305c,_0x57f0bb=await resolveAPIKeyAsync(_0x4c8a4f,_0x9bd402);return _0x57f0bb?.[_0x2e9835(0x13b)];}function cleanupLegacyEnvFile(_0x4c8314){const _0x1765b7=a54_0x24305c;if(!existsSync(_0x4c8314))return![];try{const _0x103f25=readFileSync(_0x4c8314,_0x1765b7(0x12b)),_0x4bef8a=_0x103f25[_0x1765b7(0x124)]('\x0a'),_0x5b4466=_0x4bef8a[_0x1765b7(0x159)](_0x5868a5=>{const _0x1cc207=_0x1765b7,_0xc97931=_0x5868a5[_0x1cc207(0x13d)]();if(!_0xc97931||_0xc97931[_0x1cc207(0x15c)]('#'))return!![];const [_0x52ea30]=_0xc97931['split']('=');return!_0x52ea30[_0x1cc207(0x15c)](_0x1cc207(0x155));}),_0x66e50f=_0x5b4466[_0x1765b7(0x120)](_0x5a28ae=>{const _0x49d07c=_0x1765b7,_0x1dacf6=_0x5a28ae['trim']();return _0x1dacf6&&!_0x1dacf6[_0x49d07c(0x15c)]('#');});if(!_0x66e50f)return unlinkSync(_0x4c8314),!![];return writeFileSync(_0x4c8314,_0x5b4466[_0x1765b7(0x125)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x2e0a4a=a54_0x24305c;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x243aa0=a54_0x207ecf[_0x2e0a4a(0x125)](getConfigDir(),_0x2e0a4a(0x130));if(!a54_0x27a34d['existsSync'](_0x243aa0))return null;try{const _0x61d87b=a54_0x27a34d['readFileSync'](_0x243aa0,_0x2e0a4a(0x12b)),_0x4cd5cc=JSON[_0x2e0a4a(0x144)](_0x61d87b);return _0x4cd5cc[_0x2e0a4a(0x143)]||null;}catch{return null;}}export function saveAPIKey(_0x18554d,_0x509b07,_0x5d9ad5){const _0x1afe28=a54_0x24305c,_0x50bdd8=getConfigDir(),_0x55ff6d=getConfigFilePath(_0x5d9ad5);!existsSync(_0x50bdd8)&&mkdirSync(_0x50bdd8,{'recursive':!![],'mode':0x1c0});let _0x54cb57={};if(existsSync(_0x55ff6d))try{const _0x289739=readFileSync(_0x55ff6d,_0x1afe28(0x12b));_0x54cb57=parseEnvFile(_0x289739);}catch(_0x14d921){console[_0x1afe28(0x114)](_0x1afe28(0x158)+_0x55ff6d+':',_0x14d921);}const _0x438562=_0x18554d[_0x1afe28(0x14b)]()[_0x1afe28(0x15b)](/-/g,'_');_0x54cb57[_0x1afe28(0x113)+_0x438562]=_0x509b07;const _0x36b570=Object[_0x1afe28(0x11f)](_0x54cb57)[_0x1afe28(0x151)](([_0x58683d,_0x50415f])=>_0x58683d+'='+_0x50415f);writeFileSync(_0x55ff6d,_0x36b570[_0x1afe28(0x125)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x2d07c3,_0x2fa113,_0x941647){const _0x222b6f=a54_0x24305c;await saveKeychainAPIKey(_0x2d07c3,_0x941647),setCachedCredential(_0x2d07c3,_0x2fa113,_0x941647);const _0x9535dc=getConfigFilePath(_0x941647);cleanupLegacyEnvFile(_0x9535dc)&&console['warn'](a54_0x298d92[_0x222b6f(0x11b)](_0x222b6f(0x136)));}export function loadConfig(){const _0x26f5ec=a54_0x24305c,_0x35347e={'apiKeys':{},'defaultSite':_0x26f5ec(0x139)},_0x439665=[_0x26f5ec(0x139),_0x26f5ec(0x11a),'eu01',_0x26f5ec(0x116),'ap03',_0x26f5ec(0x152),'dev-eu01',_0x26f5ec(0x12f),_0x26f5ec(0x129),_0x26f5ec(0x121)],_0x138215=getAPIKey();if(_0x138215)for(const _0x3786a8 of _0x439665){_0x35347e[_0x26f5ec(0x14e)][_0x3786a8]=_0x138215;}return _0x35347e;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x3b69e2=a54_0x24305c,_0x33d09f=a54_0x207ecf[_0x3b69e2(0x125)](getConfigDir(),_0x3b69e2(0x130));if(!a54_0x27a34d[_0x3b69e2(0x138)](_0x33d09f))return undefined;try{const _0x550f7f=a54_0x27a34d[_0x3b69e2(0x11e)](_0x33d09f,_0x3b69e2(0x12b)),_0x39ed58=JSON[_0x3b69e2(0x144)](_0x550f7f);return typeof _0x39ed58[_0x3b69e2(0x157)]==='string'?_0x39ed58[_0x3b69e2(0x157)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x35b7ef=a54_0x24305c,_0x83b9cd=process.env.TDX_RELEASE_CHANNEL;if(_0x83b9cd==='next'||_0x83b9cd===_0x35b7ef(0x12d))return _0x83b9cd;const _0x7fe6a7=a54_0x207ecf[_0x35b7ef(0x125)](getConfigDir(),_0x35b7ef(0x130));if(!a54_0x27a34d['existsSync'](_0x7fe6a7))return _0x35b7ef(0x12d);try{const _0x29b7b5=a54_0x27a34d[_0x35b7ef(0x11e)](_0x7fe6a7,_0x35b7ef(0x12b)),_0x29f31c=JSON[_0x35b7ef(0x144)](_0x29b7b5);if(_0x29f31c[_0x35b7ef(0x118)]==='next')return'next';}catch{}return _0x35b7ef(0x12d);}export function saveReleaseChannel(_0xdb9e9b){const _0x428ac0=a54_0x24305c,_0x5d6ca6=getConfigDir(),_0x2d57bd=a54_0x207ecf['join'](_0x5d6ca6,'tdx.json');!existsSync(_0x5d6ca6)&&mkdirSync(_0x5d6ca6,{'recursive':!![],'mode':0x1c0});let _0x56be71={};if(existsSync(_0x2d57bd))try{const _0x1f8b99=readFileSync(_0x2d57bd,_0x428ac0(0x12b));_0x56be71=JSON['parse'](_0x1f8b99);}catch{}_0x56be71[_0x428ac0(0x118)]=_0xdb9e9b,writeFileSync(_0x2d57bd,JSON[_0x428ac0(0x110)](_0x56be71,null,0x2),{'mode':0x180});}
1
+ const a54_0x1e6f47=a54_0x25b1;(function(_0x315dea,_0x2d36fb){const _0x48e30f=a54_0x25b1,_0x56cd68=_0x315dea();while(!![]){try{const _0x4c2519=parseInt(_0x48e30f(0x119))/0x1*(parseInt(_0x48e30f(0x105))/0x2)+parseInt(_0x48e30f(0x104))/0x3*(parseInt(_0x48e30f(0x11b))/0x4)+parseInt(_0x48e30f(0x12f))/0x5*(-parseInt(_0x48e30f(0x12e))/0x6)+parseInt(_0x48e30f(0xe3))/0x7+-parseInt(_0x48e30f(0xe1))/0x8+parseInt(_0x48e30f(0x10e))/0x9*(parseInt(_0x48e30f(0xe9))/0xa)+parseInt(_0x48e30f(0xf1))/0xb*(-parseInt(_0x48e30f(0xf9))/0xc);if(_0x4c2519===_0x2d36fb)break;else _0x56cd68['push'](_0x56cd68['shift']());}catch(_0x47be4b){_0x56cd68['push'](_0x56cd68['shift']());}}}(a54_0x13ff,0x34ebc));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x76dbc2 from'node:fs';import*as a54_0x48bb51 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_0x3cac3d from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x12571a=a54_0x25b1;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x12571a(0xf0),_0x12571a(0xf5));}function a54_0x13ff(){const _0xe7f516=['TD_API_KEY','source','some','string','.env','150wYKokO','includes','replace','startsWith','stg-us01','clear','\x27,\x20defaulting\x20to\x20us01','.config','346742XjIfrR','warn','llm_default_project','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','tdx','write','accountId','TDX_ACCESS_TOKEN\x20env\x20var','84jyXydo','config/llm-agent','filter','stg-ap01','stable','llm_default_agent','dev-us01','toUpperCase','keychain','.env.','existsSync','63012voxQfH','265966SvqOfD','stg-ap03','parse','projectId','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','release_channel','match','account_info','eu01','2007QoYCqf','join','ap03','map','profile','Warning:\x20Failed\x20to\x20read\x20','\x20env\x20var','proxy','utf-8','trim','read','3xnAcbE','slice','40DTcadw','TDX_ACCESS_TOKEN_','split','entries','config/account-info','name','tdx.json','keychain\x20(profile:\x20','ap01','number','site','path','accessToken','next','readFileSync','yellow','TDX_API_KEY\x20env\x20var','dev-eu01','us01','326562suIPvs','35PWWsZm','.json','TDX_API_KEY_','stringify','config/llm-project','175080JeLANg','ap02','1595706ilweLn'];a54_0x13ff=function(){return _0xe7f516;};return a54_0x13ff();}export function getConfigFile(){const _0x5952a4=a54_0x25b1;return join(getConfigDir(),_0x5952a4(0xe8));}export function getConfigFilePath(_0xb4a3f5){const _0x1928a8=a54_0x25b1,_0x4e94cb=getConfigDir();return _0xb4a3f5?a54_0x48bb51['join'](_0x4e94cb,_0x1928a8(0x102)+_0xb4a3f5):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x1e6f47(0xf3),a54_0x1e6f47(0xe0));export function getLLMProjectCacheFile(_0x1dc535){const _0x120071=a54_0x1e6f47;return llmProjectCache[_0x120071(0x126)](_0x1dc535);}export function readCachedLLMProject(_0xcfa52d){const _0x2cec05=a54_0x1e6f47,_0x2e85e3=llmProjectCache[_0x2cec05(0x118)](_0xcfa52d);if(_0x2e85e3&&typeof _0x2e85e3['id']==='string'&&typeof _0x2e85e3[_0x2cec05(0x120)]===_0x2cec05(0xe7))return _0x2e85e3;return null;}export function writeCachedLLMProject(_0x32d2d6,_0x1a7405,_0x47d908){try{llmProjectCache['write']({'name':_0x32d2d6,'id':_0x1a7405},_0x47d908);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x1e6f47(0xfe),a54_0x1e6f47(0xfa));export function getLLMAgentCacheFile(_0x42928f){const _0x1a98a9=a54_0x1e6f47;return llmAgentCache[_0x1a98a9(0x126)](_0x42928f);}export function readCachedLLMAgent(_0x1318ab){const _0xbd3a1d=a54_0x1e6f47,_0x22af1c=llmAgentCache[_0xbd3a1d(0x118)](_0x1318ab);if(_0x22af1c&&typeof _0x22af1c['id']==='string'&&typeof _0x22af1c[_0xbd3a1d(0x120)]===_0xbd3a1d(0xe7)&&typeof _0x22af1c[_0xbd3a1d(0x108)]===_0xbd3a1d(0xe7))return _0x22af1c;return null;}export function writeCachedLLMAgent(_0x21198f,_0x1f7e11,_0x3ca32d,_0x209d1f){try{llmAgentCache['write']({'name':_0x21198f,'id':_0x1f7e11,'projectId':_0x3ca32d},_0x209d1f);}catch{}}export function clearCachedLLMAgent(_0x6b3f0f){const _0x387046=a54_0x1e6f47;try{llmAgentCache[_0x387046(0xee)](_0x6b3f0f);}catch{}}const accountInfoCache=createOptionalProfileCache(a54_0x1e6f47(0x10c),a54_0x1e6f47(0x11f),{'suffix':a54_0x1e6f47(0x130)});export function getAccountInfoCacheFile(_0x45287b){return accountInfoCache['path'](_0x45287b);}export function readCachedAccountInfo(_0x5da564){const _0x503810=a54_0x1e6f47,_0x21d960=accountInfoCache['read'](_0x5da564);if(_0x21d960&&typeof _0x21d960[_0x503810(0x125)]===_0x503810(0xe7)&&typeof _0x21d960[_0x503810(0xf7)]===_0x503810(0x124))return _0x21d960;return null;}export function writeCachedAccountInfo(_0x5bc0d2,_0x274825,_0x173763){const _0x5799a9=a54_0x1e6f47;try{accountInfoCache[_0x5799a9(0xf6)]({'site':_0x5bc0d2,'accountId':_0x274825,'cachedAt':new Date()['toISOString']()},_0x173763);}catch{}}export function parseEnvFile(_0x143280){const _0x1748d1=a54_0x1e6f47,_0x420622={};for(const _0x281737 of _0x143280[_0x1748d1(0x11d)]('\x0a')){const _0x4a6c54=_0x281737[_0x1748d1(0x117)]();if(!_0x4a6c54||_0x4a6c54[_0x1748d1(0xec)]('#'))continue;const _0x936bd1=_0x4a6c54[_0x1748d1(0x10b)](/^([^=]+)=(.*)$/);if(_0x936bd1){const _0x418def=_0x936bd1[0x1][_0x1748d1(0x117)]();let _0x1dd97b=_0x936bd1[0x2][_0x1748d1(0x117)]();(_0x1dd97b[_0x1748d1(0xec)]('\x22')&&_0x1dd97b['endsWith']('\x22')||_0x1dd97b[_0x1748d1(0xec)]('\x27')&&_0x1dd97b['endsWith']('\x27'))&&(_0x1dd97b=_0x1dd97b[_0x1748d1(0x11a)](0x1,-0x1)),_0x420622[_0x418def]=_0x1dd97b;}}return _0x420622;}export function readUserConfig(){const _0x4bf3dc=a54_0x1e6f47,_0x4c1bd3=getConfigFile();if(!existsSync(_0x4c1bd3))return{};try{const _0x396b56=readFileSync(_0x4c1bd3,_0x4bf3dc(0x116));return parseEnvFile(_0x396b56);}catch(_0x494303){return console[_0x4bf3dc(0xf2)](_0x4bf3dc(0xf4)+_0x4c1bd3+':',_0x494303),{};}}export function resolveSite(_0x5df4e3){const _0xc5af8=a54_0x1e6f47,_0x25e077=[_0xc5af8(0x12d),_0xc5af8(0x123),_0xc5af8(0x10d),_0xc5af8(0xe2),_0xc5af8(0x110),_0xc5af8(0xff),_0xc5af8(0x12c),_0xc5af8(0xed),_0xc5af8(0xfc),_0xc5af8(0x106)];if(_0x25e077[_0xc5af8(0xea)](_0x5df4e3))return _0x5df4e3;if(_0x5df4e3 in SITE_ALIASES)return SITE_ALIASES[_0x5df4e3];return console[_0xc5af8(0xf2)]('Warning:\x20Unknown\x20site\x20\x27'+_0x5df4e3+_0xc5af8(0xef)),_0xc5af8(0x12d);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x2c5650){const _0x24d556=a54_0x1e6f47,_0xc1514d=_0x2c5650||getActiveProfileName()||undefined;if(_0xc1514d){const _0x6da995=_0x24d556(0x11c)+normalizeProfileForEnvVar(_0xc1514d);if(process.env[_0x6da995])return{'accessToken':process.env[_0x6da995],'source':_0x6da995+'\x20env\x20var'};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x24d556(0xf8)};return null;}export function getAccessToken(_0x1379a8){const _0x3f88e0=a54_0x1e6f47;return resolveAccessToken(_0x1379a8)?.[_0x3f88e0(0x127)];}export function getAPIKey(_0x2627ad){const _0x5ea907=a54_0x1e6f47,_0x322956=_0x2627ad||getActiveProfileName();if(_0x322956){const _0x2564b3=_0x5ea907(0x131)+normalizeProfileForEnvVar(_0x322956);if(process.env[_0x2564b3])return process.env[_0x2564b3];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x369af6){const _0x3fe28b=a54_0x1e6f47;return _0x369af6[_0x3fe28b(0x100)]()[_0x3fe28b(0xeb)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x3f60b2,_0x25e117){const _0x11497e=a54_0x1e6f47,_0x47a1e8=resolveAccessToken(_0x25e117);if(_0x47a1e8)return{'apiKey':_0x47a1e8[_0x11497e(0x127)],'source':_0x47a1e8[_0x11497e(0xe5)],'isDeprecated':![]};const _0x3e1c0d=_0x25e117||getActiveProfileName()||undefined;if(_0x3e1c0d){const _0x4b56d3=_0x11497e(0x131)+normalizeProfileForEnvVar(_0x3e1c0d);if(process.env[_0x4b56d3])return{'apiKey':process.env[_0x4b56d3],'source':_0x4b56d3+_0x11497e(0x114),'isDeprecated':![]};const _0x4899ea=getCachedCredential(_0x3f60b2,_0x3e1c0d);if(_0x4899ea)return{'apiKey':_0x4899ea,'source':_0x11497e(0x122)+_0x3e1c0d+')','isDeprecated':![]};const _0x148b8e=await getKeychainAPIKey(_0x3e1c0d);if(_0x148b8e)return setCachedCredential(_0x148b8e,_0x3f60b2,_0x3e1c0d),{'apiKey':_0x148b8e,'source':_0x11497e(0x122)+_0x3e1c0d+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x11497e(0x12b),'isDeprecated':![]};if(!_0x3e1c0d){const _0x449bb1=getCachedCredential(_0x3f60b2,undefined);if(_0x449bb1)return{'apiKey':_0x449bb1,'source':'keychain','isDeprecated':![]};const _0x127b50=await getKeychainAPIKey(undefined);if(_0x127b50)return setCachedCredential(_0x127b50,_0x3f60b2,undefined),{'apiKey':_0x127b50,'source':_0x11497e(0x101),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x9194dd,_0x150cc3){const _0x3ee833=await resolveAPIKeyAsync(_0x9194dd,_0x150cc3);return _0x3ee833?.['apiKey'];}function cleanupLegacyEnvFile(_0x5cf032){const _0x5dd8e0=a54_0x1e6f47;if(!existsSync(_0x5cf032))return![];try{const _0x38394d=readFileSync(_0x5cf032,_0x5dd8e0(0x116)),_0x3b4cbd=_0x38394d[_0x5dd8e0(0x11d)]('\x0a'),_0xc39653=_0x3b4cbd[_0x5dd8e0(0xfb)](_0x3347fa=>{const _0x334711=_0x5dd8e0,_0x4eb697=_0x3347fa['trim']();if(!_0x4eb697||_0x4eb697['startsWith']('#'))return!![];const [_0x26c509]=_0x4eb697[_0x334711(0x11d)]('=');return!_0x26c509[_0x334711(0xec)](_0x334711(0xe4));}),_0x415a65=_0xc39653[_0x5dd8e0(0xe6)](_0x5af4ad=>{const _0x3ff8c5=_0x5dd8e0,_0x3696c7=_0x5af4ad[_0x3ff8c5(0x117)]();return _0x3696c7&&!_0x3696c7[_0x3ff8c5(0xec)]('#');});if(!_0x415a65)return unlinkSync(_0x5cf032),!![];return writeFileSync(_0x5cf032,_0xc39653[_0x5dd8e0(0x10f)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function a54_0x25b1(_0x3e7321,_0x18f6e1){_0x3e7321=_0x3e7321-0xdf;const _0x13ff32=a54_0x13ff();let _0x25b157=_0x13ff32[_0x3e7321];return _0x25b157;}function getActiveProfileName(){const _0x32ff11=a54_0x1e6f47;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x40a6f7=a54_0x48bb51[_0x32ff11(0x10f)](getConfigDir(),_0x32ff11(0x121));if(!a54_0x76dbc2['existsSync'](_0x40a6f7))return null;try{const _0x2d1b7f=a54_0x76dbc2['readFileSync'](_0x40a6f7,_0x32ff11(0x116)),_0x234a0f=JSON[_0x32ff11(0x107)](_0x2d1b7f);return _0x234a0f[_0x32ff11(0x112)]||null;}catch{return null;}}export function saveAPIKey(_0x24f1f3,_0x12175f,_0x4846e7){const _0x3c4ece=a54_0x1e6f47,_0x2788bb=getConfigDir(),_0x5c0bb1=getConfigFilePath(_0x4846e7);!existsSync(_0x2788bb)&&mkdirSync(_0x2788bb,{'recursive':!![],'mode':0x1c0});let _0x2b6e09={};if(existsSync(_0x5c0bb1))try{const _0x392e68=readFileSync(_0x5c0bb1,_0x3c4ece(0x116));_0x2b6e09=parseEnvFile(_0x392e68);}catch(_0x4719ec){console[_0x3c4ece(0xf2)](_0x3c4ece(0x113)+_0x5c0bb1+':',_0x4719ec);}const _0x3e685e=_0x24f1f3[_0x3c4ece(0x100)]()['replace'](/-/g,'_');_0x2b6e09['TD_API_KEY_'+_0x3e685e]=_0x12175f;const _0x55ce06=Object[_0x3c4ece(0x11e)](_0x2b6e09)[_0x3c4ece(0x111)](([_0x3aa457,_0x5962f6])=>_0x3aa457+'='+_0x5962f6);writeFileSync(_0x5c0bb1,_0x55ce06[_0x3c4ece(0x10f)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x32f01d,_0x7918d9,_0x2051c7){const _0x4373c8=a54_0x1e6f47;await saveKeychainAPIKey(_0x32f01d,_0x2051c7),setCachedCredential(_0x32f01d,_0x7918d9,_0x2051c7);const _0x3d1380=getConfigFilePath(_0x2051c7);cleanupLegacyEnvFile(_0x3d1380)&&console[_0x4373c8(0xf2)](a54_0x3cac3d[_0x4373c8(0x12a)](_0x4373c8(0x109)));}export function loadConfig(){const _0x1a2edc=a54_0x1e6f47,_0xd31882={'apiKeys':{},'defaultSite':_0x1a2edc(0x12d)},_0x3a5c16=[_0x1a2edc(0x12d),_0x1a2edc(0x123),'eu01','ap02',_0x1a2edc(0x110),'dev-us01',_0x1a2edc(0x12c),_0x1a2edc(0xed),_0x1a2edc(0xfc),_0x1a2edc(0x106)],_0x52bc58=getAPIKey();if(_0x52bc58)for(const _0x2d5273 of _0x3a5c16){_0xd31882['apiKeys'][_0x2d5273]=_0x52bc58;}return _0xd31882;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0xe429cf=a54_0x1e6f47,_0x3e716c=a54_0x48bb51['join'](getConfigDir(),_0xe429cf(0x121));if(!a54_0x76dbc2[_0xe429cf(0x103)](_0x3e716c))return undefined;try{const _0x46f6f4=a54_0x76dbc2['readFileSync'](_0x3e716c,'utf-8'),_0x29e7aa=JSON['parse'](_0x46f6f4);return typeof _0x29e7aa[_0xe429cf(0x115)]===_0xe429cf(0xe7)?_0x29e7aa[_0xe429cf(0x115)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x174649=a54_0x1e6f47,_0x5a9f79=process.env.TDX_RELEASE_CHANNEL;if(_0x5a9f79===_0x174649(0x128)||_0x5a9f79===_0x174649(0xfd))return _0x5a9f79;const _0x5d1914=a54_0x48bb51[_0x174649(0x10f)](getConfigDir(),_0x174649(0x121));if(!a54_0x76dbc2[_0x174649(0x103)](_0x5d1914))return _0x174649(0xfd);try{const _0x4c24ca=a54_0x76dbc2[_0x174649(0x129)](_0x5d1914,_0x174649(0x116)),_0x437421=JSON['parse'](_0x4c24ca);if(_0x437421[_0x174649(0x10a)]===_0x174649(0x128))return _0x174649(0x128);}catch{}return'stable';}export function saveReleaseChannel(_0x4ecfe5){const _0x1c6240=a54_0x1e6f47,_0x408b34=getConfigDir(),_0x2420ef=a54_0x48bb51[_0x1c6240(0x10f)](_0x408b34,'tdx.json');!existsSync(_0x408b34)&&mkdirSync(_0x408b34,{'recursive':!![],'mode':0x1c0});let _0x35b79d={};if(existsSync(_0x2420ef))try{const _0x24547a=readFileSync(_0x2420ef,'utf-8');_0x35b79d=JSON['parse'](_0x24547a);}catch{}_0x35b79d[_0x1c6240(0x10a)]=_0x4ecfe5,writeFileSync(_0x2420ef,JSON[_0x1c6240(0xdf)](_0x35b79d,null,0x2),{'mode':0x180});}
@@ -1 +1 @@
1
- const a55_0x5c7a04=a55_0x1acb;(function(_0x26984a,_0x561fa1){const _0x1e0f93=a55_0x1acb,_0xeec8c4=_0x26984a();while(!![]){try{const _0x2f964e=parseInt(_0x1e0f93(0x1af))/0x1+-parseInt(_0x1e0f93(0x1b4))/0x2+parseInt(_0x1e0f93(0x1ba))/0x3*(parseInt(_0x1e0f93(0x1b8))/0x4)+-parseInt(_0x1e0f93(0x1b0))/0x5+-parseInt(_0x1e0f93(0x1b9))/0x6+-parseInt(_0x1e0f93(0x1b5))/0x7+-parseInt(_0x1e0f93(0x1b6))/0x8*(-parseInt(_0x1e0f93(0x1b1))/0x9);if(_0x2f964e===_0x561fa1)break;else _0xeec8c4['push'](_0xeec8c4['shift']());}catch(_0x562bb3){_0xeec8c4['push'](_0xeec8c4['shift']());}}}(a55_0x18ed,0x79459));function a55_0x1acb(_0x30be2a,_0x4b7e2d){_0x30be2a=_0x30be2a-0x1af;const _0x18ed3d=a55_0x18ed();let _0x1acbf5=_0x18ed3d[_0x30be2a];return _0x1acbf5;}import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a55_0x5c7a04(0x1b7),'core/connection-cache');export function loadCachedConnections(_0x3216c2){const _0x191a84=connectionCache['read'](_0x3216c2);return _0x191a84?.['connections']??null;}export function saveCachedConnections(_0x48ba7e,_0x5bb609){const _0x2dc510=a55_0x5c7a04;connectionCache[_0x2dc510(0x1b2)](_0x48ba7e,{'connections':_0x5bb609,'cachedAt':Date['now']()});}export function clearConnectionCache(_0x1fd406){const _0x59a152=a55_0x5c7a04;connectionCache[_0x59a152(0x1b3)](_0x1fd406);}function a55_0x18ed(){const _0x39ce5c=['4743809GRJFig','15344QfICve','connections-{profile}.json','264iQJtgD','2789940XZihKx','32982rYFoTX','189841fwxBLo','306195CurWQQ','6552WXobXx','write','clear','1222208sbEira'];a55_0x18ed=function(){return _0x39ce5c;};return a55_0x18ed();}
1
+ const a55_0x338c43=a55_0x2532;(function(_0x3596da,_0x5eb3c6){const _0x1961db=a55_0x2532,_0x4921c2=_0x3596da();while(!![]){try{const _0x206ab8=parseInt(_0x1961db(0x157))/0x1*(parseInt(_0x1961db(0x150))/0x2)+-parseInt(_0x1961db(0x154))/0x3+-parseInt(_0x1961db(0x15e))/0x4*(parseInt(_0x1961db(0x156))/0x5)+parseInt(_0x1961db(0x152))/0x6*(-parseInt(_0x1961db(0x158))/0x7)+-parseInt(_0x1961db(0x153))/0x8+parseInt(_0x1961db(0x15b))/0x9+parseInt(_0x1961db(0x15a))/0xa*(parseInt(_0x1961db(0x15f))/0xb);if(_0x206ab8===_0x5eb3c6)break;else _0x4921c2['push'](_0x4921c2['shift']());}catch(_0x4e78e3){_0x4921c2['push'](_0x4921c2['shift']());}}}(a55_0x4fa6,0xf3f76));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a55_0x338c43(0x155),a55_0x338c43(0x15d));function a55_0x4fa6(){const _0x16fb0c=['9004597kEaNyh','now','80690CxsxSt','17062713UBLtaO','clear','core/connection-cache','128ZNrbjQ','1771aboqxT','write','read','94OPEcil','connections','6yEPZzF','1360024qZfZkZ','1943565bGDbBH','connections-{profile}.json','203310eMODsp','25739kOSHsn'];a55_0x4fa6=function(){return _0x16fb0c;};return a55_0x4fa6();}export function loadCachedConnections(_0x55da9c){const _0x3d40c4=a55_0x338c43,_0x32c43b=connectionCache[_0x3d40c4(0x161)](_0x55da9c);return _0x32c43b?.[_0x3d40c4(0x151)]??null;}export function saveCachedConnections(_0x25947f,_0x397836){const _0x5f2421=a55_0x338c43;connectionCache[_0x5f2421(0x160)](_0x25947f,{'connections':_0x397836,'cachedAt':Date[_0x5f2421(0x159)]()});}function a55_0x2532(_0x558abe,_0x3bc231){_0x558abe=_0x558abe-0x150;const _0x4fa6b2=a55_0x4fa6();let _0x253261=_0x4fa6b2[_0x558abe];return _0x253261;}export function clearConnectionCache(_0x991f3b){const _0x549a38=a55_0x338c43;connectionCache[_0x549a38(0x15c)](_0x991f3b);}
@@ -1 +1 @@
1
- const a56_0x265b0a=a56_0x1f8d;(function(_0x139126,_0x101d3e){const _0x42cdd=a56_0x1f8d,_0x56eafc=_0x139126();while(!![]){try{const _0x2d517e=-parseInt(_0x42cdd(0xaf))/0x1*(-parseInt(_0x42cdd(0x9a))/0x2)+-parseInt(_0x42cdd(0x9e))/0x3+parseInt(_0x42cdd(0x9f))/0x4*(-parseInt(_0x42cdd(0x9c))/0x5)+parseInt(_0x42cdd(0xa0))/0x6*(parseInt(_0x42cdd(0xa9))/0x7)+-parseInt(_0x42cdd(0xa5))/0x8+parseInt(_0x42cdd(0xab))/0x9+parseInt(_0x42cdd(0xad))/0xa;if(_0x2d517e===_0x101d3e)break;else _0x56eafc['push'](_0x56eafc['shift']());}catch(_0x11761c){_0x56eafc['push'](_0x56eafc['shift']());}}}(a56_0x397f,0x46225));import a56_0x18c33c from'prompts';function a56_0x397f(){const _0x4e86f1=['ap01','select','14bHeVud','log','471915XdCCpC','test','7283680JLNhEo','length','1EMtKZl','value','us\x20\x20\x20-\x20United\x20States','number','other','eu\x20\x20\x20-\x20Europe','push','us01','text','Site\x20name\x20cannot\x20be\x20empty','eu01','1018178JlLFpl','customSite','460015iqrTDt','ap02\x20-\x20Korea','1257987vMxLku','4Yofclt','191214utXQCw','ap02','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','trim','site','4440232lCtLai','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'];a56_0x397f=function(){return _0x4e86f1;};return a56_0x397f();}function a56_0x1f8d(_0x285ec3,_0x80e7b6){_0x285ec3=_0x285ec3-0x92;const _0x397f9f=a56_0x397f();let _0x1f8dd1=_0x397f9f[_0x285ec3];return _0x1f8dd1;}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x5d13c6,_0x4fc402){const _0xfb9953=a56_0x1f8d;if(_0x5d13c6===undefined)return _0x4fc402;if(typeof _0x5d13c6===_0xfb9953(0x92))return _0x5d13c6;return parseInt(_0x5d13c6,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a56_0x265b0a(0xb1),'value':a56_0x265b0a(0x96)},{'title':'jp\x20\x20\x20-\x20Japan','value':a56_0x265b0a(0xa7)},{'title':a56_0x265b0a(0x94),'value':a56_0x265b0a(0x99)},{'title':a56_0x265b0a(0x9d),'value':a56_0x265b0a(0xa1)}];export function buildSiteChoices(_0x416c2d){const _0x19baad=a56_0x265b0a,_0x3f8031=[...STANDARD_SITE_CHOICES];let _0x1adb22=_0x3f8031['findIndex'](_0x293dbf=>_0x293dbf[_0x19baad(0xb0)]===_0x416c2d);return _0x1adb22===-0x1&&_0x416c2d!=='us01'&&(_0x3f8031['push']({'title':_0x416c2d,'value':_0x416c2d}),_0x1adb22=_0x3f8031[_0x19baad(0xae)]-0x1),_0x3f8031[_0x19baad(0x95)]({'title':'Enter\x20custom\x20site','value':_0x19baad(0x93)}),{'choices':_0x3f8031,'initialIndex':_0x1adb22>=0x0?_0x1adb22:0x0};}export async function promptSiteSelection(_0x387650,_0x1f20c0,_0x38f004='Cancelled'){const _0x4fe946=a56_0x265b0a,{choices:_0x411701,initialIndex:_0x371974}=buildSiteChoices(_0x387650),_0x589825=_0x1f20c0?_0x4fe946(0xa6)+_0x1f20c0+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x2f9afe=await a56_0x18c33c({'type':_0x4fe946(0xa8),'name':_0x4fe946(0xa4),'message':_0x589825,'choices':_0x411701,'initial':_0x371974});if(!_0x2f9afe[_0x4fe946(0xa4)])return console[_0x4fe946(0xaa)]('\x0a'+_0x38f004),null;if(_0x2f9afe[_0x4fe946(0xa4)]!==_0x4fe946(0x93))return _0x2f9afe[_0x4fe946(0xa4)];const _0x5d7cc5=await a56_0x18c33c({'type':_0x4fe946(0x97),'name':_0x4fe946(0x9b),'message':'Enter\x20site\x20name:','initial':_0x4fe946(0x96),'validate':_0x49cc42=>{const _0x1d1fea=_0x4fe946;if(!_0x49cc42||!_0x49cc42[_0x1d1fea(0xa3)]())return _0x1d1fea(0x98);if(!/^[a-z0-9-]+$/[_0x1d1fea(0xac)](_0x49cc42[_0x1d1fea(0xa3)]()))return _0x1d1fea(0xa2);return!![];}});if(!_0x5d7cc5[_0x4fe946(0x9b)])return console[_0x4fe946(0xaa)]('\x0a'+_0x38f004),null;return _0x5d7cc5[_0x4fe946(0x9b)];}
1
+ const a56_0x973f98=a56_0x5efe;(function(_0x5687b0,_0x4243a6){const _0x3f0aca=a56_0x5efe,_0x41852b=_0x5687b0();while(!![]){try{const _0x3501c8=parseInt(_0x3f0aca(0xe5))/0x1*(parseInt(_0x3f0aca(0xec))/0x2)+-parseInt(_0x3f0aca(0xdb))/0x3*(parseInt(_0x3f0aca(0xf7))/0x4)+-parseInt(_0x3f0aca(0xf6))/0x5+parseInt(_0x3f0aca(0xdc))/0x6+parseInt(_0x3f0aca(0xf1))/0x7+parseInt(_0x3f0aca(0xe8))/0x8+-parseInt(_0x3f0aca(0xe2))/0x9*(parseInt(_0x3f0aca(0xea))/0xa);if(_0x3501c8===_0x4243a6)break;else _0x41852b['push'](_0x41852b['shift']());}catch(_0x4e9caf){_0x41852b['push'](_0x41852b['shift']());}}}(a56_0x4a6f,0x44204));import a56_0x299095 from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;function a56_0x5efe(_0x4809d1,_0x112a66){_0x4809d1=_0x4809d1-0xdb;const _0x4a6f3c=a56_0x4a6f();let _0x5efe23=_0x4a6f3c[_0x4809d1];return _0x5efe23;}export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x10c45a,_0x582b3d){const _0x4b2572=a56_0x5efe;if(_0x10c45a===undefined)return _0x582b3d;if(typeof _0x10c45a===_0x4b2572(0xe3))return _0x10c45a;return parseInt(_0x10c45a,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a56_0x973f98(0xe7),'value':a56_0x973f98(0xe1)},{'title':'jp\x20\x20\x20-\x20Japan','value':a56_0x973f98(0xdd)},{'title':'eu\x20\x20\x20-\x20Europe','value':a56_0x973f98(0xe9)},{'title':'ap02\x20-\x20Korea','value':a56_0x973f98(0xeb)}];export function buildSiteChoices(_0x1dc3ae){const _0xf8c626=a56_0x973f98,_0x5ac797=[...STANDARD_SITE_CHOICES];let _0x33efd1=_0x5ac797[_0xf8c626(0xf9)](_0x1d17c6=>_0x1d17c6[_0xf8c626(0xde)]===_0x1dc3ae);return _0x33efd1===-0x1&&_0x1dc3ae!=='us01'&&(_0x5ac797[_0xf8c626(0xef)]({'title':_0x1dc3ae,'value':_0x1dc3ae}),_0x33efd1=_0x5ac797['length']-0x1),_0x5ac797[_0xf8c626(0xef)]({'title':_0xf8c626(0xee),'value':_0xf8c626(0xdf)}),{'choices':_0x5ac797,'initialIndex':_0x33efd1>=0x0?_0x33efd1:0x0};}export async function promptSiteSelection(_0x5282e2,_0x2c2b4e,_0x487df8='Cancelled'){const _0x3adb96=a56_0x973f98,{choices:_0x9a6337,initialIndex:_0x16b65e}=buildSiteChoices(_0x5282e2),_0x98d100=_0x2c2b4e?_0x3adb96(0xf4)+_0x2c2b4e+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x15e190=await a56_0x299095({'type':_0x3adb96(0xf3),'name':'site','message':_0x98d100,'choices':_0x9a6337,'initial':_0x16b65e});if(!_0x15e190['site'])return console[_0x3adb96(0xf2)]('\x0a'+_0x487df8),null;if(_0x15e190[_0x3adb96(0xf8)]!==_0x3adb96(0xdf))return _0x15e190[_0x3adb96(0xf8)];const _0x53d3d2=await a56_0x299095({'type':_0x3adb96(0xf0),'name':'customSite','message':_0x3adb96(0xe6),'initial':_0x3adb96(0xe1),'validate':_0x412425=>{const _0x329f9e=_0x3adb96;if(!_0x412425||!_0x412425[_0x329f9e(0xf5)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x329f9e(0xed)](_0x412425[_0x329f9e(0xf5)]()))return _0x329f9e(0xe4);return!![];}});if(!_0x53d3d2['customSite'])return console['log']('\x0a'+_0x487df8),null;return _0x53d3d2[_0x3adb96(0xe0)];}function a56_0x4a6f(){const _0x27b173=['number','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','25237wQSxRs','Enter\x20site\x20name:','us\x20\x20\x20-\x20United\x20States','400072uyLmgN','eu01','130070cevMZU','ap02','26llWwpX','test','Enter\x20custom\x20site','push','text','2032338GeLBSI','log','select','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','trim','1372860vRvWMO','62272GqGHRS','site','findIndex','57RhmbsK','1163946gCBpCA','ap01','value','other','customSite','us01','9RYMzkf'];a56_0x4a6f=function(){return _0x27b173;};return a56_0x4a6f();}
@@ -1 +1 @@
1
- function a57_0x4da8(){const _0xbc4d67=['__default_site__','626502GwcpbY','delete','clear','5073318AGLlfp','loadedAt','now','9920763SFEStp','4611656vpELDO','6107944mCXskj','__default_profile__','2635698kJmeVv','5mJmiDh','set','1118418ivenzq','10HbhYWQ','7uNxjcZ','get'];a57_0x4da8=function(){return _0xbc4d67;};return a57_0x4da8();}(function(_0x4e80d9,_0x47a81d){const _0x4f9524=a57_0x4bd6,_0x357770=_0x4e80d9();while(!![]){try{const _0x1622b4=parseInt(_0x4f9524(0x18b))/0x1+-parseInt(_0x4f9524(0x190))/0x2+parseInt(_0x4f9524(0x188))/0x3+-parseInt(_0x4f9524(0x186))/0x4*(parseInt(_0x4f9524(0x189))/0x5)+-parseInt(_0x4f9524(0x193))/0x6+-parseInt(_0x4f9524(0x18d))/0x7*(-parseInt(_0x4f9524(0x185))/0x8)+parseInt(_0x4f9524(0x196))/0x9*(parseInt(_0x4f9524(0x18c))/0xa);if(_0x1622b4===_0x47a81d)break;else _0x357770['push'](_0x357770['shift']());}catch(_0x5d5479){_0x357770['push'](_0x357770['shift']());}}}(a57_0x4da8,0xf1b06));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0xc7e9da,_0x29c645){const _0x3b5046=a57_0x4bd6,_0x4fc5e6=_0xc7e9da||_0x3b5046(0x18f),_0x18f344=_0x29c645||_0x3b5046(0x187);return _0x4fc5e6+':'+_0x18f344;}export function getCachedCredential(_0x27c614,_0x1b3976){const _0x1e6c43=a57_0x4bd6,_0x3ec84e=getCacheKey(_0x27c614,_0x1b3976),_0x58c3c7=cache[_0x1e6c43(0x18e)](_0x3ec84e);if(!_0x58c3c7)return null;if(Date['now']()-_0x58c3c7[_0x1e6c43(0x194)]>CACHE_TTL_MS)return cache[_0x1e6c43(0x191)](_0x3ec84e),null;return _0x58c3c7['apiKey'];}export function setCachedCredential(_0x4a7e1a,_0x149b2c,_0x3a29e2){const _0x461c84=a57_0x4bd6,_0x3b67cd=getCacheKey(_0x149b2c,_0x3a29e2);cache[_0x461c84(0x18a)](_0x3b67cd,{'apiKey':_0x4a7e1a,'loadedAt':Date[_0x461c84(0x195)]()});}export function clearCredentialCache(){const _0x3b5b4d=a57_0x4bd6;cache[_0x3b5b4d(0x192)]();}function a57_0x4bd6(_0x23bdd4,_0x19fa8f){_0x23bdd4=_0x23bdd4-0x185;const _0x4da877=a57_0x4da8();let _0x4bd69e=_0x4da877[_0x23bdd4];return _0x4bd69e;}export function clearCachedCredential(_0x11fa98,_0x5f3f74){const _0x5c73be=getCacheKey(_0x11fa98,_0x5f3f74);cache['delete'](_0x5c73be);}
1
+ (function(_0x5019d1,_0x539f75){const _0x48e076=a57_0x51c0,_0x430f58=_0x5019d1();while(!![]){try{const _0x377d23=-parseInt(_0x48e076(0x180))/0x1+parseInt(_0x48e076(0x16f))/0x2*(parseInt(_0x48e076(0x17e))/0x3)+parseInt(_0x48e076(0x181))/0x4*(parseInt(_0x48e076(0x17f))/0x5)+parseInt(_0x48e076(0x179))/0x6*(-parseInt(_0x48e076(0x177))/0x7)+parseInt(_0x48e076(0x176))/0x8*(-parseInt(_0x48e076(0x170))/0x9)+-parseInt(_0x48e076(0x17c))/0xa+-parseInt(_0x48e076(0x173))/0xb*(-parseInt(_0x48e076(0x17a))/0xc);if(_0x377d23===_0x539f75)break;else _0x430f58['push'](_0x430f58['shift']());}catch(_0x47dc41){_0x430f58['push'](_0x430f58['shift']());}}}(a57_0x5b87,0x2f094));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a57_0x51c0(_0x319f6c,_0x55154a){_0x319f6c=_0x319f6c-0x16f;const _0x5b8752=a57_0x5b87();let _0x51c0f6=_0x5b8752[_0x319f6c];return _0x51c0f6;}function getCacheKey(_0x2bc335,_0x923c19){const _0x337dd8=a57_0x51c0,_0x2cf3e5=_0x2bc335||'__default_site__',_0x535b29=_0x923c19||_0x337dd8(0x171);return _0x2cf3e5+':'+_0x535b29;}function a57_0x5b87(){const _0x5099e7=['2528460lUMhEE','loadedAt','5334sniiPK','2055mGdDam','60168kodNBz','752qWneQl','344ShrKDR','96318XgvXVx','__default_profile__','now','565444XMeISP','apiKey','delete','272wEmRIh','116599DrIsHN','set','84XNvDwk','168TYZboD','get'];a57_0x5b87=function(){return _0x5099e7;};return a57_0x5b87();}export function getCachedCredential(_0x4fb9b8,_0x164879){const _0x1fd4dc=a57_0x51c0,_0x446518=getCacheKey(_0x4fb9b8,_0x164879),_0x470d7a=cache[_0x1fd4dc(0x17b)](_0x446518);if(!_0x470d7a)return null;if(Date[_0x1fd4dc(0x172)]()-_0x470d7a[_0x1fd4dc(0x17d)]>CACHE_TTL_MS)return cache[_0x1fd4dc(0x175)](_0x446518),null;return _0x470d7a[_0x1fd4dc(0x174)];}export function setCachedCredential(_0x11ab6a,_0x506133,_0xcf14f1){const _0x1d747f=a57_0x51c0,_0x24b9b5=getCacheKey(_0x506133,_0xcf14f1);cache[_0x1d747f(0x178)](_0x24b9b5,{'apiKey':_0x11ab6a,'loadedAt':Date['now']()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x50b53f,_0xbb34a9){const _0x37db23=getCacheKey(_0x50b53f,_0xbb34a9);cache['delete'](_0x37db23);}
@@ -1 +1 @@
1
- function a58_0x49c6(_0x208f07,_0x1a97af){_0x208f07=_0x208f07-0x184;const _0x4fe100=a58_0x4fe1();let _0x49c6d8=_0x4fe100[_0x208f07];return _0x49c6d8;}const a58_0x361626=a58_0x49c6;(function(_0x5ce27e,_0x46ff0c){const _0x421298=a58_0x49c6,_0xb3bf4e=_0x5ce27e();while(!![]){try{const _0x5b7ced=-parseInt(_0x421298(0x19c))/0x1*(-parseInt(_0x421298(0x1aa))/0x2)+-parseInt(_0x421298(0x1b1))/0x3+parseInt(_0x421298(0x19a))/0x4*(-parseInt(_0x421298(0x1c5))/0x5)+parseInt(_0x421298(0x1a1))/0x6+parseInt(_0x421298(0x1a8))/0x7+parseInt(_0x421298(0x1c1))/0x8+parseInt(_0x421298(0x1ce))/0x9*(-parseInt(_0x421298(0x1a6))/0xa);if(_0x5b7ced===_0x46ff0c)break;else _0xb3bf4e['push'](_0xb3bf4e['shift']());}catch(_0x5a2726){_0xb3bf4e['push'](_0xb3bf4e['shift']());}}}(a58_0x4fe1,0x584ea));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_0x2e45f6 from'node:fs';import*as a58_0x190afb from'node:path';import a58_0x3e564f from'chalk';export class GlobalContext{['site'];['database'];['parent_segment'];[a58_0x361626(0x18c)];[a58_0x361626(0x1b4)];[a58_0x361626(0x1b6)];[a58_0x361626(0x1c4)];[a58_0x361626(0x1ad)];[a58_0x361626(0x1b7)];[a58_0x361626(0x195)];[a58_0x361626(0x1c2)];['logLevel'];['profile'];['profileSource']=null;[a58_0x361626(0x197)];[a58_0x361626(0x18e)];['sessionId'];[a58_0x361626(0x1cb)];constructor(_0x503b76){const _0x5e34ab=a58_0x361626;this['sessionId']=getSessionID(_0x503b76[_0x5e34ab(0x188)]);const _0xde0c83=loadSessionContext(_0x503b76[_0x5e34ab(0x188)]),_0x513d9c=loadProjectConfig(),_0x37d0d8=this[_0x5e34ab(0x1af)]();if(_0x503b76[_0x5e34ab(0x1be)])this[_0x5e34ab(0x18e)]=_0x503b76[_0x5e34ab(0x1be)],this[_0x5e34ab(0x1b0)]='cli';else{if(_0xde0c83?.['profile'])this[_0x5e34ab(0x18e)]=_0xde0c83[_0x5e34ab(0x1be)],this[_0x5e34ab(0x1b0)]=_0x5e34ab(0x188);else{if(_0x37d0d8['profile'])this[_0x5e34ab(0x18e)]=_0x37d0d8[_0x5e34ab(0x1be)],this['profileSource']=_0x5e34ab(0x1b3);else process.env.TDX_PROFILE?(this[_0x5e34ab(0x18e)]=process.env.TDX_PROFILE,this['profileSource']='env'):(this['activeProfile']=null,this[_0x5e34ab(0x1b0)]=null);}}const _0x445787=this['activeProfile']?loadProfile(this[_0x5e34ab(0x18e)]):null,_0x1685f9=_0x410592=>{const _0x260fc0=_0x5e34ab;if(!_0x410592)return{};const _0xd0c177=_0x410592,_0x3052d0={};for(const [_0x206a56,_0x17477a]of Object[_0x260fc0(0x19d)](_0xd0c177)){typeof _0x17477a===_0x260fc0(0x19e)&&(_0x3052d0[_0x206a56]=_0x17477a);}return _0x3052d0;},_0x4d2465={},_0x12443e=(_0x476c44,_0xc6c4e8,_0x5bdcad)=>{if(!_0x476c44)return![];if(_0x5bdcad&&_0x476c44===_0x5bdcad)return![];const _0x14ef6=_0xde0c83,_0x592b34=_0x513d9c,_0xd1a3a1=_0x445787?.['config'],_0x20833a=_0x37d0d8,_0x3283af=_0x14ef6?.[_0xc6c4e8],_0x17da3f=_0x592b34?.[_0xc6c4e8],_0x1fcc84=_0xd1a3a1?.[_0xc6c4e8],_0x53f67c=_0x20833a[_0xc6c4e8];return _0x476c44!==_0x3283af&&_0x476c44!==_0x17da3f&&_0x476c44!==_0x1fcc84&&_0x476c44!==_0x53f67c;},_0x16665f=[{'optionKey':'site','contextKey':_0x5e34ab(0x189),'defaultValue':_0x5e34ab(0x186)},{'optionKey':_0x5e34ab(0x18f),'contextKey':_0x5e34ab(0x18f)},{'optionKey':'parentSegment','contextKey':_0x5e34ab(0x1c8)},{'optionKey':'llmProject','contextKey':'llm_project'},{'optionKey':_0x5e34ab(0x1c3),'contextKey':_0x5e34ab(0x1b6)},{'optionKey':_0x5e34ab(0x1be),'contextKey':'profile'}];for(const {optionKey:_0x260247,contextKey:_0x167c55,defaultValue:_0x1c58c8}of _0x16665f){const _0x6c8cee=_0x503b76[_0x260247];_0x12443e(_0x6c8cee,_0x167c55,_0x1c58c8)&&(_0x4d2465[_0x167c55]=_0x6c8cee);}this['layers']={'cliFlags':_0x4d2465,'session':_0x1685f9(_0xde0c83),'project':_0x1685f9(_0x513d9c),'profile':_0x1685f9(_0x445787?.[_0x5e34ab(0x1b3)]),'global':_0x1685f9(_0x37d0d8)};const _0x38846b={...this[_0x5e34ab(0x197)][_0x5e34ab(0x1cc)],...this['layers'][_0x5e34ab(0x1be)],...this['layers'][_0x5e34ab(0x190)]};process.env.TDX_SITE&&!this[_0x5e34ab(0x197)][_0x5e34ab(0x188)]['site']&&!this[_0x5e34ab(0x197)][_0x5e34ab(0x1bc)][_0x5e34ab(0x189)]&&(_0x38846b[_0x5e34ab(0x189)]=process.env.TDX_SITE);Object[_0x5e34ab(0x1bb)](_0x38846b,this[_0x5e34ab(0x197)][_0x5e34ab(0x188)]),Object[_0x5e34ab(0x1bb)](_0x38846b,this[_0x5e34ab(0x197)][_0x5e34ab(0x1bc)]);const _0x48e3f1=_0x38846b['site']||_0x5e34ab(0x186);this[_0x5e34ab(0x189)]=resolveSite(_0x48e3f1),this[_0x5e34ab(0x18f)]=_0x38846b[_0x5e34ab(0x18f)],this[_0x5e34ab(0x1c8)]=_0x38846b['parent_segment'],this[_0x5e34ab(0x18c)]=_0x38846b['segment_path'],this['llm_project']=_0x38846b[_0x5e34ab(0x1b4)],this[_0x5e34ab(0x1b6)]=_0x38846b[_0x5e34ab(0x1b6)],this[_0x5e34ab(0x1c4)]=_0x38846b['workflow_project'],this[_0x5e34ab(0x1c2)]=_0x503b76['verbose']||![],this['logLevel']=_0x503b76[_0x5e34ab(0x1b2)]??LogLevel[_0x5e34ab(0x1c6)],this[_0x5e34ab(0x1be)]=this[_0x5e34ab(0x18e)]||undefined,this[_0x5e34ab(0x1b7)]=getAccessToken(this['activeProfile']||undefined),this[_0x5e34ab(0x1ad)]=getAPIKey(this[_0x5e34ab(0x18e)]||undefined);const _0x38d939=typeof _0x37d0d8[_0x5e34ab(0x195)]==='string'?_0x37d0d8[_0x5e34ab(0x195)]:undefined;this[_0x5e34ab(0x195)]=_0x38d939||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x1cde4c=getConfigDir(),_0x419790=a58_0x190afb[_0x5e34ab(0x1c0)](_0x1cde4c,'sessions',this['sessionId']+_0x5e34ab(0x1cd)),_0x5663b5=findProjectConfigPath(),_0x2cdb25=a58_0x190afb[_0x5e34ab(0x1c0)](_0x1cde4c,_0x5e34ab(0x191)),_0x5c6586=a58_0x190afb[_0x5e34ab(0x1c0)](_0x1cde4c,_0x5e34ab(0x1b9));let _0x517b3a=null,_0x12ab5a=null;this[_0x5e34ab(0x18e)]&&(_0x517b3a=a58_0x190afb[_0x5e34ab(0x1c0)](_0x1cde4c,_0x5e34ab(0x19b),this[_0x5e34ab(0x18e)],'tdx.json'),_0x12ab5a=a58_0x190afb['join'](_0x1cde4c,'profiles',this['activeProfile'],_0x5e34ab(0x1b9))),this[_0x5e34ab(0x1cb)]={'session':a58_0x2e45f6['existsSync'](_0x419790)?_0x419790:null,'project':_0x5663b5,'profile':_0x517b3a&&a58_0x2e45f6['existsSync'](_0x517b3a)?_0x517b3a:null,'profileCredentials':_0x12ab5a&&a58_0x2e45f6[_0x5e34ab(0x1a2)](_0x12ab5a)?_0x12ab5a:null,'global':a58_0x2e45f6[_0x5e34ab(0x1a2)](_0x2cdb25)?_0x2cdb25:null,'globalCredentials':a58_0x2e45f6[_0x5e34ab(0x1a2)](_0x5c6586)?_0x5c6586:null};}['getSource'](_0x364835,_0xed56a5){const _0x2d9c31=a58_0x361626;if(!_0xed56a5)return'not\x20set';const _0x46530c=_0xed56a5;if(this['layers'][_0x2d9c31(0x1bc)][_0x364835]===_0x46530c){if(_0x364835==='site'&&_0x46530c===_0x2d9c31(0x186)&&!this['layers']['session'][_0x2d9c31(0x189)]&&!this[_0x2d9c31(0x197)][_0x2d9c31(0x190)][_0x2d9c31(0x189)]&&!this[_0x2d9c31(0x197)][_0x2d9c31(0x1be)]['site']&&!this['layers'][_0x2d9c31(0x1cc)][_0x2d9c31(0x189)])return _0x2d9c31(0x1a5);return _0x2d9c31(0x1bf)+_0x364835['replace'](/_/g,'-');}if(this['layers']['session'][_0x364835]===_0x46530c)return _0x2d9c31(0x188);if(this[_0x2d9c31(0x197)][_0x2d9c31(0x190)][_0x364835]===_0x46530c)return _0x2d9c31(0x190);if(this[_0x2d9c31(0x197)]['profile'][_0x364835]===_0x46530c)return'profile:\x20'+this[_0x2d9c31(0x18e)];if(this[_0x2d9c31(0x197)][_0x2d9c31(0x1cc)][_0x364835]===_0x46530c)return _0x2d9c31(0x1cc);return'default';}[a58_0x361626(0x1af)](){const _0xe40380=a58_0x361626,_0x4e0c23=a58_0x190afb['join'](getConfigDir(),_0xe40380(0x191));if(!a58_0x2e45f6[_0xe40380(0x1a2)](_0x4e0c23))return{};try{const _0x245323=a58_0x2e45f6[_0xe40380(0x184)](_0x4e0c23,'utf-8');return JSON[_0xe40380(0x187)](_0x245323);}catch{return{};}}[a58_0x361626(0x185)](_0x8900f0){const _0x5552fe=a58_0x361626;_0x8900f0[_0x5552fe(0x189)]=this[_0x5552fe(0x189)],!_0x8900f0['database']&&this[_0x5552fe(0x18f)]&&(_0x8900f0[_0x5552fe(0x18f)]=this[_0x5552fe(0x18f)]),!_0x8900f0[_0x5552fe(0x193)]&&this[_0x5552fe(0x1c8)]&&(_0x8900f0[_0x5552fe(0x193)]=this['parent_segment']),!_0x8900f0[_0x5552fe(0x196)]&&this[_0x5552fe(0x18c)]&&(_0x8900f0[_0x5552fe(0x196)]=this[_0x5552fe(0x18c)]),!_0x8900f0['llmProject']&&this[_0x5552fe(0x1b4)]&&(_0x8900f0['llmProject']=this[_0x5552fe(0x1b4)]),!_0x8900f0[_0x5552fe(0x1c3)]&&this[_0x5552fe(0x1b6)]&&(_0x8900f0[_0x5552fe(0x1c3)]=this[_0x5552fe(0x1b6)]),!_0x8900f0['workflowProject']&&this[_0x5552fe(0x1c4)]&&(_0x8900f0[_0x5552fe(0x1a3)]=this[_0x5552fe(0x1c4)]);}['getParameters'](){const _0x28fdb0=a58_0x361626;return[{'key':'site','value':this['site']},{'key':_0x28fdb0(0x18f),'value':this['database']},{'key':_0x28fdb0(0x1c8),'value':this[_0x28fdb0(0x1c8)]},{'key':_0x28fdb0(0x18c),'value':this['segment_path']},{'key':_0x28fdb0(0x1b4),'value':this[_0x28fdb0(0x1b4)]},{'key':_0x28fdb0(0x1b6),'value':this[_0x28fdb0(0x1b6)]},{'key':_0x28fdb0(0x1c4),'value':this['workflow_project']},{'key':_0x28fdb0(0x1be),'value':this[_0x28fdb0(0x18e)]||undefined}];}['display'](){const _0x293455=a58_0x361626;console['log'](a58_0x3e564f[_0x293455(0x1ba)](_0x293455(0x19f)));for(const {key:_0x519895,value:_0x225348}of this['getParameters']()){_0x225348&&console[_0x293455(0x1ae)](a58_0x3e564f[_0x293455(0x18b)](_0x519895)+':\x20'+_0x225348);}}[a58_0x361626(0x198)](){const _0x179c4c=a58_0x361626;console[_0x179c4c(0x1ae)](a58_0x3e564f[_0x179c4c(0x1ba)]('[context]'));for(const {key:_0x39a71b,value:_0x2332c8}of this[_0x179c4c(0x1a7)]()){if(_0x2332c8){const _0xd4e132=_0x39a71b===_0x179c4c(0x1be)?_0x179c4c(0x1ca):'('+this[_0x179c4c(0x1bd)](_0x39a71b,_0x2332c8)+')';console[_0x179c4c(0x1ae)](a58_0x3e564f['cyan'](_0x39a71b)+':\x20'+_0x2332c8+'\x20'+a58_0x3e564f[_0x179c4c(0x1a9)](_0xd4e132));}}console[_0x179c4c(0x1ae)]('\x0a'+a58_0x3e564f[_0x179c4c(0x1ba)]('[configuration\x20files]'));const _0x566edb=[{'label':_0x179c4c(0x1b5),'path':this[_0x179c4c(0x1cb)][_0x179c4c(0x188)],'extra':_0x179c4c(0x192)+this[_0x179c4c(0x194)]+')'},{'label':'Project','path':this[_0x179c4c(0x1cb)]['project']},{'label':_0x179c4c(0x1ab),'path':this[_0x179c4c(0x1cb)][_0x179c4c(0x1be)]},{'label':_0x179c4c(0x1c7),'path':this[_0x179c4c(0x1cb)][_0x179c4c(0x199)]},{'label':'Global','path':this['configFiles'][_0x179c4c(0x1cc)]},{'label':_0x179c4c(0x18a),'path':this[_0x179c4c(0x1cb)][_0x179c4c(0x1ac)]}];for(const {label:_0x7eb486,path:_0x2bd31d,extra:_0x40b24f}of _0x566edb){if(_0x2bd31d)console[_0x179c4c(0x1ae)](a58_0x3e564f[_0x179c4c(0x18b)](_0x7eb486)+':\x20'+_0x2bd31d+'\x20'+a58_0x3e564f['green']('✓')+(_0x40b24f?'\x20'+a58_0x3e564f[_0x179c4c(0x1a9)](_0x40b24f):''));else{if(_0x7eb486===_0x179c4c(0x1b5))console[_0x179c4c(0x1ae)](a58_0x3e564f[_0x179c4c(0x18b)](_0x7eb486)+':\x20'+a58_0x3e564f[_0x179c4c(0x1a9)](_0x179c4c(0x1cf))+'\x20'+a58_0x3e564f[_0x179c4c(0x1a9)](_0x179c4c(0x1b8)+this[_0x179c4c(0x194)]+')'));else(_0x7eb486===_0x179c4c(0x1a4)||_0x7eb486===_0x179c4c(0x18d))&&console[_0x179c4c(0x1ae)](a58_0x3e564f['cyan'](_0x7eb486)+':\x20'+a58_0x3e564f['dim']('none'));}}}async[a58_0x361626(0x1c9)](){const _0x4ed4e2=a58_0x361626;if(!this[_0x4ed4e2(0x1b7)]){const _0x51454d=await getOAuthTokens(this[_0x4ed4e2(0x18e)]||undefined);if(_0x51454d)return this[_0x4ed4e2(0x1b7)]=_0x51454d[_0x4ed4e2(0x1a0)],undefined;}return this['apiKey']=await getAPIKeyAsync(this[_0x4ed4e2(0x189)],this[_0x4ed4e2(0x18e)]||undefined),this[_0x4ed4e2(0x1ad)];}static async['createAsync'](_0x5a88a7){const _0x49b766=a58_0x361626,_0x4d46db=new GlobalContext(_0x5a88a7);return await _0x4d46db[_0x49b766(0x1c9)](),_0x4d46db;}}function a58_0x4fe1(){const _0x31c8dc=['.json','180xShrBa','none','readFileSync','injectIntoOptions','us01','parse','session','site','Global\x20Credentials','cyan','segment_path','Global','activeProfile','database','project','tdx.json','(session:\x20','parentSegment','sessionId','proxy','segmentPath','layers','displayWithSources','profileCredentials','4hRUjWt','profiles','1588YAZFvI','entries','string','[context]','access_token','1254246MiFNqx','existsSync','workflowProject','Project','default','328940ZLpsJa','getParameters','1264662IzuqlA','dim','220tbCbmn','Profile','globalCredentials','apiKey','log','loadGlobalConfig','profileSource','309870PnlvjI','logLevel','config','llm_project','Session','llm_agent','accessToken','(using\x20session:\x20','.env','bold','assign','cliFlags','getSource','profile','CLI\x20flag:\x20--','join','5411776wPpuVo','verbose','llmAgent','workflow_project','589915UkNcSZ','INFO','Profile\x20Credentials','parent_segment','resolveAPIKeyAsync','(active)','configFiles','global'];a58_0x4fe1=function(){return _0x31c8dc;};return a58_0x4fe1();}
1
+ const a58_0x59b653=a58_0x38f1;(function(_0x3bdb90,_0x5f3626){const _0x5057d6=a58_0x38f1,_0x50dcf3=_0x3bdb90();while(!![]){try{const _0x3ff56a=parseInt(_0x5057d6(0x118))/0x1+parseInt(_0x5057d6(0x115))/0x2+-parseInt(_0x5057d6(0x11e))/0x3*(-parseInt(_0x5057d6(0x127))/0x4)+-parseInt(_0x5057d6(0x153))/0x5*(-parseInt(_0x5057d6(0x11f))/0x6)+parseInt(_0x5057d6(0x120))/0x7+parseInt(_0x5057d6(0x117))/0x8*(-parseInt(_0x5057d6(0x137))/0x9)+parseInt(_0x5057d6(0x13c))/0xa*(-parseInt(_0x5057d6(0x138))/0xb);if(_0x3ff56a===_0x5f3626)break;else _0x50dcf3['push'](_0x50dcf3['shift']());}catch(_0x355701){_0x50dcf3['push'](_0x50dcf3['shift']());}}}(a58_0x1b34,0xeda25));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';function a58_0x1b34(){const _0x504ad5=['getSource','tdx.json','not\x20set','854739XZgasE','297Xgmulm','(using\x20session:\x20','project','existsSync','754990DeFHUh','Profile\x20Credentials','profiles','profileCredentials','config','loadGlobalConfig','accessToken','llm_project','createAsync','segmentPath','none','Global\x20Credentials','verbose','Project','CLI\x20flag:\x20--','session','database','llm_agent','replace','configFiles','global','site','[configuration\x20files]','114470LqHKzL','Session','us01','parent_segment','sessionId','readFileSync','layers','proxy','parentSegment','llmProject','apiKey','workflow_project','.env','bold','dim','displayWithSources','1422342yiblaA','Profile','120XkgvTq','1250048HfkkUE','join','.json','[context]','getParameters','cyan','39QusVEF','342oRHwHY','7770868EUfcMB','log','profile:\x20','assign','segment_path','display','resolveAPIKeyAsync','18488uyyjmb','string','logLevel','injectIntoOptions','default','cliFlags','profileSource','profile','Global','activeProfile','workflowProject','INFO','llmAgent'];a58_0x1b34=function(){return _0x504ad5;};return a58_0x1b34();}function a58_0x38f1(_0xf0fc6,_0x5df4c6){_0xf0fc6=_0xf0fc6-0x113;const _0x1b3484=a58_0x1b34();let _0x38f17a=_0x1b3484[_0xf0fc6];return _0x38f17a;}import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a58_0x346684 from'node:fs';import*as a58_0x5d6fb2 from'node:path';import a58_0x2bb306 from'chalk';export class GlobalContext{[a58_0x59b653(0x151)];[a58_0x59b653(0x14c)];[a58_0x59b653(0x156)];[a58_0x59b653(0x124)];[a58_0x59b653(0x143)];['llm_agent'];[a58_0x59b653(0x15e)];['apiKey'];['accessToken'];[a58_0x59b653(0x15a)];[a58_0x59b653(0x148)];['logLevel'];[a58_0x59b653(0x12e)];[a58_0x59b653(0x12d)]=null;[a58_0x59b653(0x159)];['activeProfile'];[a58_0x59b653(0x157)];['configFiles'];constructor(_0x5020ef){const _0x3b77ab=a58_0x59b653;this['sessionId']=getSessionID(_0x5020ef['session']);const _0x50a6d6=loadSessionContext(_0x5020ef['session']),_0x144d1b=loadProjectConfig(),_0x5f5bed=this['loadGlobalConfig']();if(_0x5020ef[_0x3b77ab(0x12e)])this[_0x3b77ab(0x130)]=_0x5020ef[_0x3b77ab(0x12e)],this[_0x3b77ab(0x12d)]='cli';else{if(_0x50a6d6?.[_0x3b77ab(0x12e)])this['activeProfile']=_0x50a6d6[_0x3b77ab(0x12e)],this[_0x3b77ab(0x12d)]=_0x3b77ab(0x14b);else{if(_0x5f5bed['profile'])this[_0x3b77ab(0x130)]=_0x5f5bed['profile'],this[_0x3b77ab(0x12d)]=_0x3b77ab(0x140);else process.env.TDX_PROFILE?(this[_0x3b77ab(0x130)]=process.env.TDX_PROFILE,this['profileSource']='env'):(this[_0x3b77ab(0x130)]=null,this[_0x3b77ab(0x12d)]=null);}}const _0x3fb021=this['activeProfile']?loadProfile(this[_0x3b77ab(0x130)]):null,_0x2bf7bd=_0x5c0cd4=>{const _0x578874=_0x3b77ab;if(!_0x5c0cd4)return{};const _0x27ccf6=_0x5c0cd4,_0x2c32d5={};for(const [_0x4b8c50,_0x421cf2]of Object['entries'](_0x27ccf6)){typeof _0x421cf2===_0x578874(0x128)&&(_0x2c32d5[_0x4b8c50]=_0x421cf2);}return _0x2c32d5;},_0xee9692={},_0x2b7df0=(_0x5b406f,_0x357b38,_0x6e746b)=>{if(!_0x5b406f)return![];if(_0x6e746b&&_0x5b406f===_0x6e746b)return![];const _0x5064c0=_0x50a6d6,_0x411d13=_0x144d1b,_0x4bcdcd=_0x3fb021?.['config'],_0x5aca66=_0x5f5bed,_0x4ff758=_0x5064c0?.[_0x357b38],_0x166a8f=_0x411d13?.[_0x357b38],_0x4bae39=_0x4bcdcd?.[_0x357b38],_0x2cb32a=_0x5aca66[_0x357b38];return _0x5b406f!==_0x4ff758&&_0x5b406f!==_0x166a8f&&_0x5b406f!==_0x4bae39&&_0x5b406f!==_0x2cb32a;},_0x289917=[{'optionKey':'site','contextKey':'site','defaultValue':'us01'},{'optionKey':_0x3b77ab(0x14c),'contextKey':_0x3b77ab(0x14c)},{'optionKey':_0x3b77ab(0x15b),'contextKey':_0x3b77ab(0x156)},{'optionKey':_0x3b77ab(0x15c),'contextKey':_0x3b77ab(0x143)},{'optionKey':_0x3b77ab(0x133),'contextKey':_0x3b77ab(0x14d)},{'optionKey':'profile','contextKey':_0x3b77ab(0x12e)}];for(const {optionKey:_0x5a0756,contextKey:_0x308302,defaultValue:_0x59c8c4}of _0x289917){const _0x158d7e=_0x5020ef[_0x5a0756];_0x2b7df0(_0x158d7e,_0x308302,_0x59c8c4)&&(_0xee9692[_0x308302]=_0x158d7e);}this[_0x3b77ab(0x159)]={'cliFlags':_0xee9692,'session':_0x2bf7bd(_0x50a6d6),'project':_0x2bf7bd(_0x144d1b),'profile':_0x2bf7bd(_0x3fb021?.[_0x3b77ab(0x140)]),'global':_0x2bf7bd(_0x5f5bed)};const _0x1a0338={...this[_0x3b77ab(0x159)]['global'],...this[_0x3b77ab(0x159)][_0x3b77ab(0x12e)],...this[_0x3b77ab(0x159)][_0x3b77ab(0x13a)]};process.env.TDX_SITE&&!this[_0x3b77ab(0x159)][_0x3b77ab(0x14b)][_0x3b77ab(0x151)]&&!this['layers'][_0x3b77ab(0x12c)][_0x3b77ab(0x151)]&&(_0x1a0338['site']=process.env.TDX_SITE);Object[_0x3b77ab(0x123)](_0x1a0338,this[_0x3b77ab(0x159)]['session']),Object[_0x3b77ab(0x123)](_0x1a0338,this[_0x3b77ab(0x159)]['cliFlags']);const _0x8baa27=_0x1a0338[_0x3b77ab(0x151)]||_0x3b77ab(0x155);this[_0x3b77ab(0x151)]=resolveSite(_0x8baa27),this[_0x3b77ab(0x14c)]=_0x1a0338[_0x3b77ab(0x14c)],this[_0x3b77ab(0x156)]=_0x1a0338[_0x3b77ab(0x156)],this[_0x3b77ab(0x124)]=_0x1a0338['segment_path'],this[_0x3b77ab(0x143)]=_0x1a0338[_0x3b77ab(0x143)],this['llm_agent']=_0x1a0338[_0x3b77ab(0x14d)],this[_0x3b77ab(0x15e)]=_0x1a0338[_0x3b77ab(0x15e)],this[_0x3b77ab(0x148)]=_0x5020ef[_0x3b77ab(0x148)]||![],this[_0x3b77ab(0x129)]=_0x5020ef[_0x3b77ab(0x129)]??LogLevel[_0x3b77ab(0x132)],this['profile']=this['activeProfile']||undefined,this[_0x3b77ab(0x142)]=getAccessToken(this['activeProfile']||undefined),this[_0x3b77ab(0x15d)]=getAPIKey(this['activeProfile']||undefined);const _0x18ab96=typeof _0x5f5bed[_0x3b77ab(0x15a)]===_0x3b77ab(0x128)?_0x5f5bed['proxy']:undefined;this[_0x3b77ab(0x15a)]=_0x18ab96||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x1a49fc=getConfigDir(),_0x2e3488=a58_0x5d6fb2[_0x3b77ab(0x119)](_0x1a49fc,'sessions',this[_0x3b77ab(0x157)]+_0x3b77ab(0x11a)),_0x180bc0=findProjectConfigPath(),_0x157af8=a58_0x5d6fb2['join'](_0x1a49fc,_0x3b77ab(0x135)),_0x36ae83=a58_0x5d6fb2['join'](_0x1a49fc,'.env');let _0x5af897=null,_0xd1b9cd=null;this[_0x3b77ab(0x130)]&&(_0x5af897=a58_0x5d6fb2[_0x3b77ab(0x119)](_0x1a49fc,'profiles',this[_0x3b77ab(0x130)],_0x3b77ab(0x135)),_0xd1b9cd=a58_0x5d6fb2[_0x3b77ab(0x119)](_0x1a49fc,_0x3b77ab(0x13e),this['activeProfile'],_0x3b77ab(0x15f))),this['configFiles']={'session':a58_0x346684['existsSync'](_0x2e3488)?_0x2e3488:null,'project':_0x180bc0,'profile':_0x5af897&&a58_0x346684['existsSync'](_0x5af897)?_0x5af897:null,'profileCredentials':_0xd1b9cd&&a58_0x346684[_0x3b77ab(0x13b)](_0xd1b9cd)?_0xd1b9cd:null,'global':a58_0x346684[_0x3b77ab(0x13b)](_0x157af8)?_0x157af8:null,'globalCredentials':a58_0x346684[_0x3b77ab(0x13b)](_0x36ae83)?_0x36ae83:null};}[a58_0x59b653(0x134)](_0x2608a0,_0x1929f7){const _0x55288b=a58_0x59b653;if(!_0x1929f7)return _0x55288b(0x136);const _0x462d40=_0x1929f7;if(this[_0x55288b(0x159)][_0x55288b(0x12c)][_0x2608a0]===_0x462d40){if(_0x2608a0==='site'&&_0x462d40==='us01'&&!this[_0x55288b(0x159)][_0x55288b(0x14b)]['site']&&!this[_0x55288b(0x159)][_0x55288b(0x13a)][_0x55288b(0x151)]&&!this[_0x55288b(0x159)][_0x55288b(0x12e)]['site']&&!this[_0x55288b(0x159)][_0x55288b(0x150)][_0x55288b(0x151)])return'default';return _0x55288b(0x14a)+_0x2608a0[_0x55288b(0x14e)](/_/g,'-');}if(this[_0x55288b(0x159)][_0x55288b(0x14b)][_0x2608a0]===_0x462d40)return'session';if(this['layers'][_0x55288b(0x13a)][_0x2608a0]===_0x462d40)return _0x55288b(0x13a);if(this[_0x55288b(0x159)][_0x55288b(0x12e)][_0x2608a0]===_0x462d40)return _0x55288b(0x122)+this['activeProfile'];if(this[_0x55288b(0x159)][_0x55288b(0x150)][_0x2608a0]===_0x462d40)return _0x55288b(0x150);return _0x55288b(0x12b);}[a58_0x59b653(0x141)](){const _0x15b0ab=a58_0x59b653,_0x2dd548=a58_0x5d6fb2['join'](getConfigDir(),_0x15b0ab(0x135));if(!a58_0x346684[_0x15b0ab(0x13b)](_0x2dd548))return{};try{const _0x19245f=a58_0x346684[_0x15b0ab(0x158)](_0x2dd548,'utf-8');return JSON['parse'](_0x19245f);}catch{return{};}}[a58_0x59b653(0x12a)](_0x564fa6){const _0x543fd3=a58_0x59b653;_0x564fa6[_0x543fd3(0x151)]=this['site'],!_0x564fa6[_0x543fd3(0x14c)]&&this[_0x543fd3(0x14c)]&&(_0x564fa6['database']=this[_0x543fd3(0x14c)]),!_0x564fa6[_0x543fd3(0x15b)]&&this['parent_segment']&&(_0x564fa6[_0x543fd3(0x15b)]=this[_0x543fd3(0x156)]),!_0x564fa6[_0x543fd3(0x145)]&&this[_0x543fd3(0x124)]&&(_0x564fa6[_0x543fd3(0x145)]=this[_0x543fd3(0x124)]),!_0x564fa6[_0x543fd3(0x15c)]&&this['llm_project']&&(_0x564fa6[_0x543fd3(0x15c)]=this[_0x543fd3(0x143)]),!_0x564fa6[_0x543fd3(0x133)]&&this[_0x543fd3(0x14d)]&&(_0x564fa6[_0x543fd3(0x133)]=this[_0x543fd3(0x14d)]),!_0x564fa6[_0x543fd3(0x131)]&&this[_0x543fd3(0x15e)]&&(_0x564fa6['workflowProject']=this['workflow_project']);}['getParameters'](){const _0xf12cb5=a58_0x59b653;return[{'key':_0xf12cb5(0x151),'value':this[_0xf12cb5(0x151)]},{'key':_0xf12cb5(0x14c),'value':this['database']},{'key':_0xf12cb5(0x156),'value':this[_0xf12cb5(0x156)]},{'key':_0xf12cb5(0x124),'value':this[_0xf12cb5(0x124)]},{'key':_0xf12cb5(0x143),'value':this[_0xf12cb5(0x143)]},{'key':'llm_agent','value':this['llm_agent']},{'key':'workflow_project','value':this[_0xf12cb5(0x15e)]},{'key':_0xf12cb5(0x12e),'value':this[_0xf12cb5(0x130)]||undefined}];}[a58_0x59b653(0x125)](){const _0x27e5ba=a58_0x59b653;console['log'](a58_0x2bb306[_0x27e5ba(0x160)](_0x27e5ba(0x11b)));for(const {key:_0x40f79e,value:_0x2a2921}of this[_0x27e5ba(0x11c)]()){_0x2a2921&&console[_0x27e5ba(0x121)](a58_0x2bb306[_0x27e5ba(0x11d)](_0x40f79e)+':\x20'+_0x2a2921);}}[a58_0x59b653(0x114)](){const _0x170874=a58_0x59b653;console[_0x170874(0x121)](a58_0x2bb306[_0x170874(0x160)](_0x170874(0x11b)));for(const {key:_0x3c6e1e,value:_0x4751c9}of this['getParameters']()){if(_0x4751c9){const _0x2af61d=_0x3c6e1e===_0x170874(0x12e)?'(active)':'('+this[_0x170874(0x134)](_0x3c6e1e,_0x4751c9)+')';console['log'](a58_0x2bb306[_0x170874(0x11d)](_0x3c6e1e)+':\x20'+_0x4751c9+'\x20'+a58_0x2bb306[_0x170874(0x113)](_0x2af61d));}}console[_0x170874(0x121)]('\x0a'+a58_0x2bb306[_0x170874(0x160)](_0x170874(0x152)));const _0x5edd57=[{'label':_0x170874(0x154),'path':this[_0x170874(0x14f)][_0x170874(0x14b)],'extra':'(session:\x20'+this[_0x170874(0x157)]+')'},{'label':_0x170874(0x149),'path':this[_0x170874(0x14f)][_0x170874(0x13a)]},{'label':_0x170874(0x116),'path':this[_0x170874(0x14f)][_0x170874(0x12e)]},{'label':_0x170874(0x13d),'path':this[_0x170874(0x14f)][_0x170874(0x13f)]},{'label':_0x170874(0x12f),'path':this[_0x170874(0x14f)][_0x170874(0x150)]},{'label':_0x170874(0x147),'path':this[_0x170874(0x14f)]['globalCredentials']}];for(const {label:_0x4f523f,path:_0x10c5c4,extra:_0x761a2b}of _0x5edd57){if(_0x10c5c4)console['log'](a58_0x2bb306[_0x170874(0x11d)](_0x4f523f)+':\x20'+_0x10c5c4+'\x20'+a58_0x2bb306['green']('✓')+(_0x761a2b?'\x20'+a58_0x2bb306[_0x170874(0x113)](_0x761a2b):''));else{if(_0x4f523f===_0x170874(0x154))console['log'](a58_0x2bb306[_0x170874(0x11d)](_0x4f523f)+':\x20'+a58_0x2bb306['dim'](_0x170874(0x146))+'\x20'+a58_0x2bb306[_0x170874(0x113)](_0x170874(0x139)+this['sessionId']+')'));else(_0x4f523f===_0x170874(0x149)||_0x4f523f===_0x170874(0x12f))&&console[_0x170874(0x121)](a58_0x2bb306[_0x170874(0x11d)](_0x4f523f)+':\x20'+a58_0x2bb306['dim']('none'));}}}async['resolveAPIKeyAsync'](){const _0x44b06f=a58_0x59b653;if(!this[_0x44b06f(0x142)]){const _0x1a571a=await getOAuthTokens(this[_0x44b06f(0x130)]||undefined);if(_0x1a571a)return this[_0x44b06f(0x142)]=_0x1a571a['access_token'],undefined;}return this['apiKey']=await getAPIKeyAsync(this[_0x44b06f(0x151)],this[_0x44b06f(0x130)]||undefined),this['apiKey'];}static async[a58_0x59b653(0x144)](_0x5aaebb){const _0x4dc122=a58_0x59b653,_0x4dd324=new GlobalContext(_0x5aaebb);return await _0x4dd324[_0x4dc122(0x126)](),_0x4dd324;}}
@@ -1 +1 @@
1
- const a59_0x46dc22=a59_0x34c1;(function(_0x2755b2,_0x593878){const _0x309908=a59_0x34c1,_0x2c436=_0x2755b2();while(!![]){try{const _0x2dc4d5=-parseInt(_0x309908(0x1d5))/0x1+-parseInt(_0x309908(0x1e4))/0x2+-parseInt(_0x309908(0x1d6))/0x3+parseInt(_0x309908(0x1eb))/0x4+-parseInt(_0x309908(0x1d7))/0x5+-parseInt(_0x309908(0x1e8))/0x6+parseInt(_0x309908(0x1d4))/0x7;if(_0x2dc4d5===_0x593878)break;else _0x2c436['push'](_0x2c436['shift']());}catch(_0x411a09){_0x2c436['push'](_0x2c436['shift']());}}}(a59_0x2393,0x7b717));const SERVICE_NAME=a59_0x46dc22(0x1e9);let EntryClass=null,keyringLoadError=null;function a59_0x2393(){const _0x3f01ce=['message','-25293','System\x20keychain\x20is\x20not\x20available','__keychain_test__','no\x20matching\x20entry','error','Entry','unavailable','includes','1895702jNRSxf',':api_key','@napi-rs/keyring','access_denied','3556320PjtkQl','tdx','reason','2220468pyOaoU','deleteCredential','restricted','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.','value','not\x20available','Warning:\x20','18744782GLINDZ','64944JUbwbc','1708995eUpilY','2760700QLkIyE','-25300','toLowerCase','not_found'];a59_0x2393=function(){return _0x3f01ce;};return a59_0x2393();}function a59_0x34c1(_0x217da4,_0x5ad608){_0x217da4=_0x217da4-0x1d4;const _0x2393be=a59_0x2393();let _0x34c1d7=_0x2393be[_0x217da4];return _0x34c1d7;}async function getEntryClass(){const _0x1584fe=a59_0x46dc22;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x3e8e9b=await import(_0x1584fe(0x1e6));return EntryClass=_0x3e8e9b[_0x1584fe(0x1e1)],EntryClass;}catch(_0x578291){return keyringLoadError=_0x578291 instanceof Error?_0x578291:new Error(String(_0x578291)),null;}}function getAccountName(_0x533679){const _0x3ed532=a59_0x46dc22,_0x2f06e4=_0x533679||'';return'profile:'+_0x2f06e4+_0x3ed532(0x1e5);}export async function getKeychainAPIKey(_0x1b2c58){const _0x14edc5=a59_0x46dc22,_0x37f374=await getKeychainAPIKeyWithStatus(_0x1b2c58);if(_0x37f374['success'])return _0x37f374[_0x14edc5(0x1ef)];return _0x37f374[_0x14edc5(0x1ea)]==='access_denied'&&console[_0x14edc5(0x1e0)](_0x14edc5(0x1f1)+_0x37f374[_0x14edc5(0x1db)]),null;}export async function getKeychainAPIKeyWithStatus(_0x1b3ff3){const _0x47c130=a59_0x46dc22;try{const _0x1a06f1=await getEntryClass();if(!_0x1a06f1)return{'success':![],'reason':_0x47c130(0x1e2)};const _0x527e6e=getAccountName(_0x1b3ff3),_0x133602=new _0x1a06f1(SERVICE_NAME,_0x527e6e),_0x244118=_0x133602['getPassword']();if(_0x244118)return{'success':!![],'value':_0x244118};return{'success':![],'reason':_0x47c130(0x1da)};}catch(_0x13efcf){const _0x3b1b1d=_0x13efcf instanceof Error?_0x13efcf[_0x47c130(0x1db)]:String(_0x13efcf);if(_0x3b1b1d[_0x47c130(0x1e3)](_0x47c130(0x1d8))||_0x3b1b1d['toLowerCase']()[_0x47c130(0x1e3)]('could\x20not\x20be\x20found')||_0x3b1b1d[_0x47c130(0x1d9)]()[_0x47c130(0x1e3)]('not\x20found')||_0x3b1b1d[_0x47c130(0x1d9)]()[_0x47c130(0x1e3)](_0x47c130(0x1df)))return{'success':![],'reason':'not_found'};if(_0x3b1b1d[_0x47c130(0x1e3)](_0x47c130(0x1dc))||_0x3b1b1d[_0x47c130(0x1d9)]()[_0x47c130(0x1e3)](_0x47c130(0x1ed))||_0x3b1b1d['toLowerCase']()[_0x47c130(0x1e3)]('access'))return{'success':![],'reason':_0x47c130(0x1e7),'message':_0x47c130(0x1ee)};return{'success':![],'reason':_0x47c130(0x1e2),'message':_0x3b1b1d};}}export async function saveKeychainAPIKey(_0x3b5636,_0x2b99b2){const _0x31784e=a59_0x46dc22,_0x519ac5=await getEntryClass();if(!_0x519ac5)throw new Error(_0x31784e(0x1dd));const _0x2e9d03=getAccountName(_0x2b99b2),_0xa2cbe1=new _0x519ac5(SERVICE_NAME,_0x2e9d03);_0xa2cbe1['setPassword'](_0x3b5636);}export async function deleteKeychainAPIKey(_0x5a9805){const _0x349944=a59_0x46dc22;try{const _0x19ed9a=await getEntryClass();if(!_0x19ed9a)return![];const _0x4eee10=getAccountName(_0x5a9805),_0x29003c=new _0x19ed9a(SERVICE_NAME,_0x4eee10);return _0x29003c[_0x349944(0x1ec)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x2f2387=a59_0x46dc22;try{const _0x5d7a9a=await getEntryClass();if(!_0x5d7a9a)return![];const _0x49309e=new _0x5d7a9a(SERVICE_NAME,_0x2f2387(0x1de));return _0x49309e['getPassword'](),!![];}catch(_0x555e39){const _0x1839ef=_0x555e39 instanceof Error?_0x555e39[_0x2f2387(0x1db)][_0x2f2387(0x1d9)]():'';if(_0x1839ef[_0x2f2387(0x1e3)](_0x2f2387(0x1f0))||_0x1839ef[_0x2f2387(0x1e3)]('not\x20supported')||_0x1839ef[_0x2f2387(0x1e3)]('cannot\x20find'))return![];return!![];}}
1
+ const a59_0xa7ebf0=a59_0x29ed;(function(_0x3b26e8,_0x5e068e){const _0x27ffee=a59_0x29ed,_0x12fa9c=_0x3b26e8();while(!![]){try{const _0x448b98=parseInt(_0x27ffee(0x13f))/0x1*(parseInt(_0x27ffee(0x13d))/0x2)+parseInt(_0x27ffee(0x137))/0x3*(parseInt(_0x27ffee(0x123))/0x4)+parseInt(_0x27ffee(0x13b))/0x5*(parseInt(_0x27ffee(0x147))/0x6)+parseInt(_0x27ffee(0x13a))/0x7+parseInt(_0x27ffee(0x131))/0x8*(parseInt(_0x27ffee(0x140))/0x9)+parseInt(_0x27ffee(0x130))/0xa*(-parseInt(_0x27ffee(0x129))/0xb)+-parseInt(_0x27ffee(0x12a))/0xc;if(_0x448b98===_0x5e068e)break;else _0x12fa9c['push'](_0x12fa9c['shift']());}catch(_0x430034){_0x12fa9c['push'](_0x12fa9c['shift']());}}}(a59_0x4079,0xdac10));const SERVICE_NAME=a59_0xa7ebf0(0x128);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x1dd4f2=a59_0xa7ebf0;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x397f66=await import(_0x1dd4f2(0x124));return EntryClass=_0x397f66['Entry'],EntryClass;}catch(_0x8332a7){return keyringLoadError=_0x8332a7 instanceof Error?_0x8332a7:new Error(String(_0x8332a7)),null;}}function getAccountName(_0x28607b){const _0x507c37=a59_0xa7ebf0,_0x2ddc1c=_0x28607b||'';return _0x507c37(0x144)+_0x2ddc1c+_0x507c37(0x142);}function a59_0x29ed(_0x2fcffa,_0x123fb4){_0x2fcffa=_0x2fcffa-0x122;const _0x407900=a59_0x4079();let _0x29ed6c=_0x407900[_0x2fcffa];return _0x29ed6c;}function a59_0x4079(){const _0x342177=['-25300','includes','tdx','11UpPUop','21632688xwwShA','getPassword','reason','cannot\x20find','unavailable','-25293','213830LyzMam','373264jxmAGu','__keychain_test__','success','setPassword','no\x20matching\x20entry','not\x20found','23145GISlTl','System\x20keychain\x20is\x20not\x20available','message','6989311DSuOVa','20545XeTXdd','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.','57658WbMgmD','restricted','9DZZnlX','126uJeyYY','error',':api_key','not_found','profile:','access_denied','toLowerCase','618YKRbqf','access','not\x20available','200eXWjse','@napi-rs/keyring','value'];a59_0x4079=function(){return _0x342177;};return a59_0x4079();}export async function getKeychainAPIKey(_0x3619d8){const _0x2e3e9e=a59_0xa7ebf0,_0x2c4fbe=await getKeychainAPIKeyWithStatus(_0x3619d8);if(_0x2c4fbe[_0x2e3e9e(0x133)])return _0x2c4fbe[_0x2e3e9e(0x125)];return _0x2c4fbe[_0x2e3e9e(0x12c)]==='access_denied'&&console[_0x2e3e9e(0x141)]('Warning:\x20'+_0x2c4fbe[_0x2e3e9e(0x139)]),null;}export async function getKeychainAPIKeyWithStatus(_0x1b6228){const _0x3e974e=a59_0xa7ebf0;try{const _0x3225fe=await getEntryClass();if(!_0x3225fe)return{'success':![],'reason':_0x3e974e(0x12e)};const _0x37e885=getAccountName(_0x1b6228),_0x57cf60=new _0x3225fe(SERVICE_NAME,_0x37e885),_0x280403=_0x57cf60[_0x3e974e(0x12b)]();if(_0x280403)return{'success':!![],'value':_0x280403};return{'success':![],'reason':'not_found'};}catch(_0x5db451){const _0x1bac3c=_0x5db451 instanceof Error?_0x5db451[_0x3e974e(0x139)]:String(_0x5db451);if(_0x1bac3c['includes'](_0x3e974e(0x126))||_0x1bac3c[_0x3e974e(0x146)]()['includes']('could\x20not\x20be\x20found')||_0x1bac3c[_0x3e974e(0x146)]()[_0x3e974e(0x127)](_0x3e974e(0x136))||_0x1bac3c[_0x3e974e(0x146)]()['includes'](_0x3e974e(0x135)))return{'success':![],'reason':_0x3e974e(0x143)};if(_0x1bac3c[_0x3e974e(0x127)](_0x3e974e(0x12f))||_0x1bac3c['toLowerCase']()[_0x3e974e(0x127)](_0x3e974e(0x13e))||_0x1bac3c[_0x3e974e(0x146)]()[_0x3e974e(0x127)](_0x3e974e(0x148)))return{'success':![],'reason':_0x3e974e(0x145),'message':_0x3e974e(0x13c)};return{'success':![],'reason':_0x3e974e(0x12e),'message':_0x1bac3c};}}export async function saveKeychainAPIKey(_0x522257,_0x56f811){const _0x2a3409=a59_0xa7ebf0,_0x223d5b=await getEntryClass();if(!_0x223d5b)throw new Error(_0x2a3409(0x138));const _0x2996bb=getAccountName(_0x56f811),_0x7c0165=new _0x223d5b(SERVICE_NAME,_0x2996bb);_0x7c0165[_0x2a3409(0x134)](_0x522257);}export async function deleteKeychainAPIKey(_0x335a52){try{const _0x225262=await getEntryClass();if(!_0x225262)return![];const _0x4c4e5a=getAccountName(_0x335a52),_0x2dcf20=new _0x225262(SERVICE_NAME,_0x4c4e5a);return _0x2dcf20['deleteCredential'](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0xe87a53=a59_0xa7ebf0;try{const _0x414c9a=await getEntryClass();if(!_0x414c9a)return![];const _0x1fec2a=new _0x414c9a(SERVICE_NAME,_0xe87a53(0x132));return _0x1fec2a[_0xe87a53(0x12b)](),!![];}catch(_0x387303){const _0x3e1189=_0x387303 instanceof Error?_0x387303[_0xe87a53(0x139)][_0xe87a53(0x146)]():'';if(_0x3e1189[_0xe87a53(0x127)](_0xe87a53(0x122))||_0x3e1189[_0xe87a53(0x127)]('not\x20supported')||_0x3e1189['includes'](_0xe87a53(0x12d)))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0x2288d0,_0x48fe5b){const _0x2efacc=a60_0x111b,_0x58a8a6=_0x2288d0();while(!![]){try{const _0x184b44=parseInt(_0x2efacc(0x95))/0x1*(parseInt(_0x2efacc(0x93))/0x2)+parseInt(_0x2efacc(0x9a))/0x3*(-parseInt(_0x2efacc(0x92))/0x4)+parseInt(_0x2efacc(0x9e))/0x5*(-parseInt(_0x2efacc(0x9c))/0x6)+-parseInt(_0x2efacc(0x9d))/0x7+parseInt(_0x2efacc(0x99))/0x8+-parseInt(_0x2efacc(0x9f))/0x9+parseInt(_0x2efacc(0x94))/0xa*(parseInt(_0x2efacc(0xa0))/0xb);if(_0x184b44===_0x48fe5b)break;else _0x58a8a6['push'](_0x58a8a6['shift']());}catch(_0x5c3cae){_0x58a8a6['push'](_0x58a8a6['shift']());}}}(a60_0x5b18,0x4450e));const SERVICE_NAME='tdx';let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x697804=a60_0x111b;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x430851=await import(_0x697804(0x97));return EntryClass=_0x430851[_0x697804(0x98)],EntryClass;}catch(_0xa48f00){return keyringLoadError=_0xa48f00 instanceof Error?_0xa48f00:new Error(String(_0xa48f00)),null;}}function getOAuthAccountName(_0x2781af){const _0x28bc9b=_0x2781af||'';return'profile:'+_0x28bc9b+':oauth_tokens';}export async function saveOAuthTokens(_0x2b3290,_0x9bb830){const _0x1ca5c8=a60_0x111b,_0x26e0f6=await getEntryClass();if(!_0x26e0f6)throw new Error(_0x1ca5c8(0xa2));const _0x4eda9f=getOAuthAccountName(_0x9bb830),_0x2618c1=new _0x26e0f6(SERVICE_NAME,_0x4eda9f);_0x2618c1['setPassword'](JSON[_0x1ca5c8(0xa1)](_0x2b3290));}function a60_0x111b(_0x5c76a2,_0xf928f6){_0x5c76a2=_0x5c76a2-0x92;const _0x5b18db=a60_0x5b18();let _0x111bc3=_0x5b18db[_0x5c76a2];return _0x111bc3;}export async function getOAuthTokens(_0x22bb55){const _0x2bb121=a60_0x111b;try{const _0x3b269b=await getEntryClass();if(!_0x3b269b)return null;const _0x101a8e=getOAuthAccountName(_0x22bb55),_0x1b10b2=new _0x3b269b(SERVICE_NAME,_0x101a8e),_0x10217c=_0x1b10b2[_0x2bb121(0x96)]();if(_0x10217c)return JSON['parse'](_0x10217c);return null;}catch{return null;}}function a60_0x5b18(){const _0x5d06d4=['1188bMCIgG','520942PnItHw','20udPLxy','1qVwoxj','getPassword','@napi-rs/keyring','Entry','2621688kFCeKB','1791upovHj','deleteCredential','228DnQXhh','1528331KGRiLY','60105GwtVeO','1601676NbCaFP','3971242LuFbkm','stringify','System\x20keychain\x20is\x20not\x20available'];a60_0x5b18=function(){return _0x5d06d4;};return a60_0x5b18();}export async function deleteOAuthTokens(_0x2eae86){const _0x7d3ac3=a60_0x111b;try{const _0x2bf852=await getEntryClass();if(!_0x2bf852)return![];const _0x316c12=getOAuthAccountName(_0x2eae86),_0x1d72c7=new _0x2bf852(SERVICE_NAME,_0x316c12);return _0x1d72c7[_0x7d3ac3(0x9b)](),!![];}catch{return![];}}
1
+ const a60_0x468e11=a60_0x3eac;function a60_0x820a(){const _0x1ff9e9=['5lrzvtl','16120cpCjfd','deleteCredential','System\x20keychain\x20is\x20not\x20available','531TLDIlB','setPassword','76400LfjzkT','tdx','196kZPbzz','51PynUnQ','getPassword','parse','4427296exWKGS','1078816ZopRmx','13hhWgnk','profile:','@napi-rs/keyring','Entry','stringify','27293964ehumWo','9097gqecmS','15940LrlmMI',':oauth_tokens','43980LlaLPU'];a60_0x820a=function(){return _0x1ff9e9;};return a60_0x820a();}(function(_0x38ce9d,_0x2a8752){const _0x4f300e=a60_0x3eac,_0x2dac7c=_0x38ce9d();while(!![]){try{const _0x3a403c=parseInt(_0x4f300e(0x96))/0x1+parseInt(_0x4f300e(0x86))/0x2*(-parseInt(_0x4f300e(0x92))/0x3)+-parseInt(_0x4f300e(0x95))/0x4*(-parseInt(_0x4f300e(0x89))/0x5)+parseInt(_0x4f300e(0x88))/0x6*(parseInt(_0x4f300e(0x91))/0x7)+-parseInt(_0x4f300e(0x8f))/0x8*(parseInt(_0x4f300e(0x8d))/0x9)+parseInt(_0x4f300e(0x8a))/0xa*(parseInt(_0x4f300e(0x85))/0xb)+-parseInt(_0x4f300e(0x84))/0xc*(parseInt(_0x4f300e(0x7f))/0xd);if(_0x3a403c===_0x2a8752)break;else _0x2dac7c['push'](_0x2dac7c['shift']());}catch(_0x5e9786){_0x2dac7c['push'](_0x2dac7c['shift']());}}}(a60_0x820a,0xb73e7));const SERVICE_NAME=a60_0x468e11(0x90);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0xc2da97=a60_0x468e11;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x2ffd73=await import(_0xc2da97(0x81));return EntryClass=_0x2ffd73[_0xc2da97(0x82)],EntryClass;}catch(_0x257e1a){return keyringLoadError=_0x257e1a instanceof Error?_0x257e1a:new Error(String(_0x257e1a)),null;}}function getOAuthAccountName(_0x1cf029){const _0x4c4476=a60_0x468e11,_0x374e71=_0x1cf029||'';return _0x4c4476(0x80)+_0x374e71+_0x4c4476(0x87);}export async function saveOAuthTokens(_0x4beb94,_0x115a2b){const _0x44c61b=a60_0x468e11,_0x50c611=await getEntryClass();if(!_0x50c611)throw new Error(_0x44c61b(0x8c));const _0x520e33=getOAuthAccountName(_0x115a2b),_0x5ef876=new _0x50c611(SERVICE_NAME,_0x520e33);_0x5ef876[_0x44c61b(0x8e)](JSON[_0x44c61b(0x83)](_0x4beb94));}export async function getOAuthTokens(_0x176ecb){const _0x59f9e5=a60_0x468e11;try{const _0x4eb1cf=await getEntryClass();if(!_0x4eb1cf)return null;const _0x56badd=getOAuthAccountName(_0x176ecb),_0x4b0b27=new _0x4eb1cf(SERVICE_NAME,_0x56badd),_0x5a95b4=_0x4b0b27[_0x59f9e5(0x93)]();if(_0x5a95b4)return JSON[_0x59f9e5(0x94)](_0x5a95b4);return null;}catch{return null;}}function a60_0x3eac(_0xabfdf6,_0x1b06fd){_0xabfdf6=_0xabfdf6-0x7f;const _0x820a28=a60_0x820a();let _0x3eac1d=_0x820a28[_0xabfdf6];return _0x3eac1d;}export async function deleteOAuthTokens(_0x2e56de){const _0x13bdcb=a60_0x468e11;try{const _0x1f09a5=await getEntryClass();if(!_0x1f09a5)return![];const _0x595cd9=getOAuthAccountName(_0x2e56de),_0x461750=new _0x1f09a5(SERVICE_NAME,_0x595cd9);return _0x461750[_0x13bdcb(0x8b)](),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a61_0x2a3a55=a61_0x4ec2;(function(_0x4c22e2,_0x2de88d){const _0x491bdf=a61_0x4ec2,_0x17535e=_0x4c22e2();while(!![]){try{const _0x453bc8=parseInt(_0x491bdf(0x9d))/0x1*(-parseInt(_0x491bdf(0x8a))/0x2)+-parseInt(_0x491bdf(0xb8))/0x3*(parseInt(_0x491bdf(0xa4))/0x4)+-parseInt(_0x491bdf(0x9b))/0x5+-parseInt(_0x491bdf(0x84))/0x6*(parseInt(_0x491bdf(0xb5))/0x7)+-parseInt(_0x491bdf(0x80))/0x8+parseInt(_0x491bdf(0x78))/0x9*(parseInt(_0x491bdf(0x79))/0xa)+parseInt(_0x491bdf(0x9e))/0xb*(parseInt(_0x491bdf(0xa0))/0xc);if(_0x453bc8===_0x2de88d)break;else _0x17535e['push'](_0x17535e['shift']());}catch(_0xc7899b){_0x17535e['push'](_0x17535e['shift']());}}}(a61_0x5832,0xbcba2));import*as a61_0x4d5127 from'node:crypto';import*as a61_0x29db04 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set(['dev-us01',a61_0x2a3a55(0x92),a61_0x2a3a55(0x7c),a61_0x2a3a55(0xaa),a61_0x2a3a55(0x8f)]);export function isOAuthSupported(_0x224d1f){const _0x48eab4=a61_0x2a3a55;return OAUTH_SUPPORTED_SITES[_0x48eab4(0x98)](_0x224d1f);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a61_0x2a3a55(0xb0)+OAUTH_CALLBACK_PORT+'/oauth/callback';function a61_0x5832(){const _0xf4a117=['code_challenge','127.0.0.1','11637624nWKexO','base64url','json','state','423198wWzGjE','text','waitForCallback','close','hex','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','48PKWvmH','code_challenge_method','tdx','redirect_uri','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','stg-ap03','):\x20','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','dev-eu01','sha256','writeHead','/oauth/authorize','get','listen','has','message','code','2630655pGZaOc','text/html','29042jCpDWD','10735076jokdrt','status','72mEpKdg','codeChallenge','pathname','url','3049912AIbIlg','searchParams','client_id','update','application/x-www-form-urlencoded','randomBytes','stg-ap01','redirectUri','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','digest','text/plain','createServer','http://localhost:','http://127.0.0.1','error','scope','set','112jXvHqw','toString','createHash','6Bvdbmw','OAuth\x20token\x20request\x20failed\x20(','/oauth/callback','Not\x20Found','end','93321aqyrss','240BArSPa','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','S256','stg-us01','authorization_code'];a61_0x5832=function(){return _0xf4a117;};return a61_0x5832();}export function getOAuthClientId(){const _0x4ec268=a61_0x2a3a55;return process.env.TD_OAUTH_CLIENT_ID||_0x4ec268(0x8c);}export function generatePKCEPair(){const _0x91b892=a61_0x2a3a55,_0x38f6cb=a61_0x4d5127['randomBytes'](0x20)['toString'](_0x91b892(0x81)),_0x38b6f3=a61_0x4d5127[_0x91b892(0xb7)](_0x91b892(0x93))[_0x91b892(0xa7)](_0x38f6cb)[_0x91b892(0xad)](_0x91b892(0x81));return{'verifier':_0x38f6cb,'challenge':_0x38b6f3};}export function buildAuthorizeURL(_0x1facfc,_0x320e72){const _0x281c13=a61_0x2a3a55,_0x385aae=new URL(_0x281c13(0x95),_0x1facfc);return _0x385aae[_0x281c13(0xa5)][_0x281c13(0xb4)]('response_type',_0x281c13(0x9a)),_0x385aae[_0x281c13(0xa5)][_0x281c13(0xb4)](_0x281c13(0xa6),_0x320e72['clientId']),_0x385aae[_0x281c13(0xa5)]['set'](_0x281c13(0x8d),_0x320e72[_0x281c13(0xab)]),_0x385aae[_0x281c13(0xa5)][_0x281c13(0xb4)](_0x281c13(0x83),_0x320e72[_0x281c13(0x83)]),_0x385aae[_0x281c13(0xa5)][_0x281c13(0xb4)](_0x281c13(0x7e),_0x320e72[_0x281c13(0xa1)]),_0x385aae['searchParams'][_0x281c13(0xb4)](_0x281c13(0x8b),_0x281c13(0x7b)),_0x320e72[_0x281c13(0xb3)]&&_0x385aae[_0x281c13(0xa5)][_0x281c13(0xb4)]('scope',_0x320e72['scope']),_0x385aae[_0x281c13(0xb6)]();}function a61_0x4ec2(_0x12cfd9,_0x1d19ad){_0x12cfd9=_0x12cfd9-0x77;const _0x583245=a61_0x5832();let _0x4ec2fa=_0x583245[_0x12cfd9];return _0x4ec2fa;}export async function postTokenRequest(_0x4c634c,_0x55c1f5){const _0x568423=a61_0x2a3a55,_0xf3c924=new URLSearchParams(_0x55c1f5)[_0x568423(0xb6)](),_0x21bbd5=await fetch(_0x4c634c,{'method':'POST','headers':{'Content-Type':_0x568423(0xa8)},'body':_0xf3c924});if(!_0x21bbd5['ok']){const _0x48331b=await _0x21bbd5[_0x568423(0x85)]();throw new Error(_0x568423(0xb9)+_0x21bbd5[_0x568423(0x9f)]+_0x568423(0x90)+_0x48331b);}return await _0x21bbd5[_0x568423(0x82)]();}export async function exchangeCodeForTokens(_0xa9980d,_0x2f156e,_0x2b5924,_0x5ec106){const _0xf091ce=a61_0x2a3a55,_0x3daad6=_0xa9980d+'/oauth/token';return postTokenRequest(_0x3daad6,{'grant_type':_0xf091ce(0x7d),'client_id':getOAuthClientId(),'code':_0x2f156e,'code_verifier':_0x2b5924,'redirect_uri':_0x5ec106});}export function startLocalCallbackServer(){const _0x246596=a61_0x2a3a55;let _0x7f5e5f,_0x1691c4;const _0x4397b8=new Promise((_0x5bb055,_0x5d4abd)=>{_0x7f5e5f=_0x5bb055,_0x1691c4=_0x5d4abd;}),_0x1faa5c=a61_0x29db04[_0x246596(0xaf)]((_0x2e4455,_0x50a5fe)=>{const _0x43184b=_0x246596,_0x4532a4=new URL(_0x2e4455[_0x43184b(0xa3)]||'/',_0x43184b(0xb1));if(_0x4532a4[_0x43184b(0xa2)]!==_0x43184b(0xba)){_0x50a5fe[_0x43184b(0x94)](0x194,{'Content-Type':_0x43184b(0xae)}),_0x50a5fe['end'](_0x43184b(0xbb));return;}const _0x232fa4=_0x4532a4[_0x43184b(0xa5)]['get'](_0x43184b(0x9a)),_0x2b4279=_0x4532a4['searchParams'][_0x43184b(0x96)](_0x43184b(0x83)),_0x35e9d4=_0x4532a4['searchParams'][_0x43184b(0x96)](_0x43184b(0xb2));if(_0x35e9d4||!_0x232fa4||!_0x2b4279){_0x50a5fe['writeHead'](0x190,{'Content-Type':_0x43184b(0x9c)}),_0x50a5fe[_0x43184b(0x77)]('<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>'),_0x1691c4(new Error(_0x43184b(0x91)));return;}_0x50a5fe['writeHead'](0xc8,{'Content-Type':_0x43184b(0x9c)}),_0x50a5fe[_0x43184b(0x77)](_0x43184b(0xac)),_0x7f5e5f({'code':_0x232fa4,'state':_0x2b4279});});_0x1faa5c['on'](_0x246596(0xb2),_0x32a328=>{const _0x4762a3=_0x246596;_0x32a328['code']==='EADDRINUSE'?_0x1691c4(new Error('Port\x20'+OAUTH_CALLBACK_PORT+_0x4762a3(0x8e))):_0x1691c4(new Error('Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20'+_0x32a328[_0x4762a3(0x99)]));}),_0x1faa5c[_0x246596(0x97)](OAUTH_CALLBACK_PORT,_0x246596(0x7f));const _0x2a2b2f=setTimeout(()=>{const _0x263f0a=_0x246596;_0x1691c4(new Error(_0x263f0a(0x7a))),_0x1faa5c[_0x263f0a(0x87)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x4397b8,'close':()=>{clearTimeout(_0x2a2b2f),_0x1faa5c['close']();}};}export async function startOAuthFlow(_0x455384){const _0x203038=a61_0x2a3a55,_0x148e37=getConsoleUrl(_0x455384),_0x320f03=getOAuthClientId(),{verifier:_0x31f895,challenge:_0x555007}=generatePKCEPair(),_0x107805=a61_0x4d5127[_0x203038(0xa9)](0x10)[_0x203038(0xb6)](_0x203038(0x88)),_0x5eaea5=startLocalCallbackServer();try{const _0x1b8871=OAUTH_REDIRECT_URI,_0x402d75=buildAuthorizeURL(_0x148e37,{'clientId':_0x320f03,'redirectUri':_0x1b8871,'state':_0x107805,'codeChallenge':_0x555007});openBrowser(_0x402d75);const _0x2c5d69=await _0x5eaea5[_0x203038(0x86)]();if(_0x2c5d69[_0x203038(0x83)]!==_0x107805)throw new Error(_0x203038(0x89));return await exchangeCodeForTokens(_0x148e37,_0x2c5d69[_0x203038(0x9a)],_0x31f895,_0x1b8871);}finally{_0x5eaea5[_0x203038(0x87)]();}}
1
+ const a61_0x47bd15=a61_0x4538;(function(_0x1d246b,_0xa4a66b){const _0x50e0bb=a61_0x4538,_0x3de1b5=_0x1d246b();while(!![]){try{const _0x4697d1=parseInt(_0x50e0bb(0x1c4))/0x1+-parseInt(_0x50e0bb(0x1c8))/0x2+parseInt(_0x50e0bb(0x1b5))/0x3*(parseInt(_0x50e0bb(0x1d5))/0x4)+parseInt(_0x50e0bb(0x1ec))/0x5+parseInt(_0x50e0bb(0x1b4))/0x6+parseInt(_0x50e0bb(0x1c7))/0x7+-parseInt(_0x50e0bb(0x1b9))/0x8*(parseInt(_0x50e0bb(0x1d3))/0x9);if(_0x4697d1===_0xa4a66b)break;else _0x3de1b5['push'](_0x3de1b5['shift']());}catch(_0x41d99f){_0x3de1b5['push'](_0x3de1b5['shift']());}}}(a61_0x28b7,0xdd09e));import*as a61_0xd29f34 from'node:crypto';import*as a61_0x25c0ac from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set(['dev-us01','dev-eu01',a61_0x47bd15(0x1cf),'stg-ap01','stg-ap03']);export function isOAuthSupported(_0x439587){const _0x311d05=a61_0x47bd15;return OAUTH_SUPPORTED_SITES[_0x311d05(0x1bf)](_0x439587);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a61_0x47bd15(0x1e2)+OAUTH_CALLBACK_PORT+a61_0x47bd15(0x1c1);function a61_0x4538(_0x277ea2,_0x56bcea){_0x277ea2=_0x277ea2-0x1b0;const _0x28b72d=a61_0x28b7();let _0x453825=_0x28b72d[_0x277ea2];return _0x453825;}export function getOAuthClientId(){const _0x4b86ed=a61_0x47bd15;return process.env.TD_OAUTH_CLIENT_ID||_0x4b86ed(0x1c6);}function a61_0x28b7(){const _0x5c6157=['redirectUri','12241278gnJiAb','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','259196jVMDrA','url','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','response_type','update','http://127.0.0.1','S256','state','code_challenge_method','randomBytes','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','end','):\x20','http://localhost:','text/html','writeHead','POST','clientId','OAuth\x20token\x20request\x20failed\x20(','scope','error','pathname','hex','2308850ppamXY','toString','code_challenge','json','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','3562926VXFXoU','39Yafjsu','/oauth/authorize','waitForCallback','127.0.0.1','16PrOwak','close','codeChallenge','set','get','base64url','has','Not\x20Found','/oauth/callback','listen','code','968892pQmPhH','text','tdx','5555312PYXHqv','69656yqJLLP','status','sha256','searchParams','createServer','authorization_code','EADDRINUSE','stg-us01','createHash','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters'];a61_0x28b7=function(){return _0x5c6157;};return a61_0x28b7();}export function generatePKCEPair(){const _0x4b27b3=a61_0x47bd15,_0x238258=a61_0xd29f34[_0x4b27b3(0x1de)](0x20)[_0x4b27b3(0x1b0)](_0x4b27b3(0x1be)),_0x1a61f3=a61_0xd29f34[_0x4b27b3(0x1d0)](_0x4b27b3(0x1ca))[_0x4b27b3(0x1d9)](_0x238258)['digest'](_0x4b27b3(0x1be));return{'verifier':_0x238258,'challenge':_0x1a61f3};}export function buildAuthorizeURL(_0x4917d9,_0xf62f74){const _0x5d88f2=a61_0x47bd15,_0x2b5bf6=new URL(_0x5d88f2(0x1b6),_0x4917d9);return _0x2b5bf6[_0x5d88f2(0x1cb)][_0x5d88f2(0x1bc)](_0x5d88f2(0x1d8),'code'),_0x2b5bf6['searchParams'][_0x5d88f2(0x1bc)]('client_id',_0xf62f74[_0x5d88f2(0x1e6)]),_0x2b5bf6[_0x5d88f2(0x1cb)][_0x5d88f2(0x1bc)]('redirect_uri',_0xf62f74[_0x5d88f2(0x1d2)]),_0x2b5bf6['searchParams'][_0x5d88f2(0x1bc)](_0x5d88f2(0x1dc),_0xf62f74['state']),_0x2b5bf6[_0x5d88f2(0x1cb)][_0x5d88f2(0x1bc)](_0x5d88f2(0x1b1),_0xf62f74[_0x5d88f2(0x1bb)]),_0x2b5bf6['searchParams'][_0x5d88f2(0x1bc)](_0x5d88f2(0x1dd),_0x5d88f2(0x1db)),_0xf62f74[_0x5d88f2(0x1e8)]&&_0x2b5bf6[_0x5d88f2(0x1cb)]['set'](_0x5d88f2(0x1e8),_0xf62f74[_0x5d88f2(0x1e8)]),_0x2b5bf6[_0x5d88f2(0x1b0)]();}export async function postTokenRequest(_0x3f4493,_0x13975f){const _0x4502b0=a61_0x47bd15,_0x26e349=new URLSearchParams(_0x13975f)[_0x4502b0(0x1b0)](),_0x175d56=await fetch(_0x3f4493,{'method':_0x4502b0(0x1e5),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x26e349});if(!_0x175d56['ok']){const _0x436113=await _0x175d56[_0x4502b0(0x1c5)]();throw new Error(_0x4502b0(0x1e7)+_0x175d56[_0x4502b0(0x1c9)]+_0x4502b0(0x1e1)+_0x436113);}return await _0x175d56[_0x4502b0(0x1b2)]();}export async function exchangeCodeForTokens(_0x22a32c,_0x254d04,_0x3c9fcf,_0x5c3797){const _0x592167=a61_0x47bd15,_0x59ca9c=_0x22a32c+'/oauth/token';return postTokenRequest(_0x59ca9c,{'grant_type':_0x592167(0x1cd),'client_id':getOAuthClientId(),'code':_0x254d04,'code_verifier':_0x3c9fcf,'redirect_uri':_0x5c3797});}export function startLocalCallbackServer(){const _0x1787f9=a61_0x47bd15;let _0x13abee,_0x81f05f;const _0x2db2fd=new Promise((_0xa4b2cf,_0x419979)=>{_0x13abee=_0xa4b2cf,_0x81f05f=_0x419979;}),_0x411156=a61_0x25c0ac[_0x1787f9(0x1cc)]((_0x460d68,_0x2c4302)=>{const _0x244b82=_0x1787f9,_0x28d44c=new URL(_0x460d68[_0x244b82(0x1d6)]||'/',_0x244b82(0x1da));if(_0x28d44c[_0x244b82(0x1ea)]!==_0x244b82(0x1c1)){_0x2c4302[_0x244b82(0x1e4)](0x194,{'Content-Type':'text/plain'}),_0x2c4302[_0x244b82(0x1e0)](_0x244b82(0x1c0));return;}const _0x3af771=_0x28d44c['searchParams'][_0x244b82(0x1bd)](_0x244b82(0x1c3)),_0x25cdc9=_0x28d44c[_0x244b82(0x1cb)][_0x244b82(0x1bd)]('state'),_0x45010d=_0x28d44c[_0x244b82(0x1cb)][_0x244b82(0x1bd)](_0x244b82(0x1e9));if(_0x45010d||!_0x3af771||!_0x25cdc9){_0x2c4302[_0x244b82(0x1e4)](0x190,{'Content-Type':_0x244b82(0x1e3)}),_0x2c4302[_0x244b82(0x1e0)]('<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>'),_0x81f05f(new Error(_0x244b82(0x1d1)));return;}_0x2c4302[_0x244b82(0x1e4)](0xc8,{'Content-Type':_0x244b82(0x1e3)}),_0x2c4302[_0x244b82(0x1e0)](_0x244b82(0x1b3)),_0x13abee({'code':_0x3af771,'state':_0x25cdc9});});_0x411156['on']('error',_0x4cb2da=>{const _0x88ee49=_0x1787f9;_0x4cb2da[_0x88ee49(0x1c3)]===_0x88ee49(0x1ce)?_0x81f05f(new Error('Port\x20'+OAUTH_CALLBACK_PORT+_0x88ee49(0x1df))):_0x81f05f(new Error(_0x88ee49(0x1d4)+_0x4cb2da['message']));}),_0x411156[_0x1787f9(0x1c2)](OAUTH_CALLBACK_PORT,_0x1787f9(0x1b8));const _0x3aa1ee=setTimeout(()=>{const _0x119696=_0x1787f9;_0x81f05f(new Error(_0x119696(0x1d7))),_0x411156['close']();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x2db2fd,'close':()=>{const _0x1ab735=_0x1787f9;clearTimeout(_0x3aa1ee),_0x411156[_0x1ab735(0x1ba)]();}};}export async function startOAuthFlow(_0x388d0b){const _0xbb40f4=a61_0x47bd15,_0x4349fd=getConsoleUrl(_0x388d0b),_0x5686ff=getOAuthClientId(),{verifier:_0x5ebba0,challenge:_0x39fec8}=generatePKCEPair(),_0x15ec2f=a61_0xd29f34['randomBytes'](0x10)['toString'](_0xbb40f4(0x1eb)),_0x402ef9=startLocalCallbackServer();try{const _0x46d70a=OAUTH_REDIRECT_URI,_0x4c8b47=buildAuthorizeURL(_0x4349fd,{'clientId':_0x5686ff,'redirectUri':_0x46d70a,'state':_0x15ec2f,'codeChallenge':_0x39fec8});openBrowser(_0x4c8b47);const _0x2a1178=await _0x402ef9[_0xbb40f4(0x1b7)]();if(_0x2a1178['state']!==_0x15ec2f)throw new Error('OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack');return await exchangeCodeForTokens(_0x4349fd,_0x2a1178[_0xbb40f4(0x1c3)],_0x5ebba0,_0x46d70a);}finally{_0x402ef9[_0xbb40f4(0x1ba)]();}}
@@ -1 +1 @@
1
- const a62_0x14db7a=a62_0x2b77;(function(_0x20be45,_0x4500c4){const _0x4202fc=a62_0x2b77,_0x4b0043=_0x20be45();while(!![]){try{const _0xa86cbd=parseInt(_0x4202fc(0x1c2))/0x1+-parseInt(_0x4202fc(0x1b1))/0x2+-parseInt(_0x4202fc(0x18e))/0x3*(parseInt(_0x4202fc(0x1c4))/0x4)+-parseInt(_0x4202fc(0x1a3))/0x5*(-parseInt(_0x4202fc(0x1a4))/0x6)+-parseInt(_0x4202fc(0x1be))/0x7*(parseInt(_0x4202fc(0x1ac))/0x8)+parseInt(_0x4202fc(0x1ab))/0x9*(parseInt(_0x4202fc(0x189))/0xa)+parseInt(_0x4202fc(0x194))/0xb;if(_0xa86cbd===_0x4500c4)break;else _0x4b0043['push'](_0x4b0043['shift']());}catch(_0x37cd76){_0x4b0043['push'](_0x4b0043['shift']());}}}(a62_0x483e,0xa9cad));import*as a62_0x1f1aaf from'node:fs';import*as a62_0x2dca5c from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';function a62_0x2b77(_0x17f4c9,_0x303278){_0x17f4c9=_0x17f4c9-0x179;const _0x483e92=a62_0x483e();let _0x2b7773=_0x483e92[_0x17f4c9];return _0x2b7773;}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_0x14db7a(0x17a);export function getProfileParams(_0x50e7e8){const _0x5ae118={};if(!_0x50e7e8)return _0x5ae118;for(const [_0x5eacf6,_0x19c696]of Object['entries'](_0x50e7e8)){_0x5eacf6!=='description'&&_0x19c696!==undefined&&(_0x5ae118[_0x5eacf6]=_0x19c696);}return _0x5ae118;}export function getProfilesDir(){const _0x8b6d2a=a62_0x14db7a;return a62_0x2dca5c[_0x8b6d2a(0x199)](getConfigDir(),_0x8b6d2a(0x1bd));}function getProfileDir(_0x3fcb79){return a62_0x2dca5c['join'](getProfilesDir(),_0x3fcb79);}function getProfileConfigPath(_0x54d518){const _0x4cd688=a62_0x14db7a;return a62_0x2dca5c[_0x4cd688(0x199)](getProfileDir(_0x54d518),_0x4cd688(0x1bb));}function getProfileEnvPath(_0x43b9a2){const _0x30c2ca=a62_0x14db7a;return a62_0x2dca5c[_0x30c2ca(0x199)](getProfileDir(_0x43b9a2),'.env');}function getGlobalConfigPath(){const _0x53d44a=a62_0x14db7a;return a62_0x2dca5c[_0x53d44a(0x199)](getConfigDir(),_0x53d44a(0x1bb));}function validateProfileName(_0x115b68){const _0x1fcf16=a62_0x14db7a;if(/^@?[a-zA-Z0-9_-]+$/[_0x1fcf16(0x190)](_0x115b68))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/['test'](_0x115b68))return;throw new Error(_0x1fcf16(0x1b6)+_0x115b68+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.');}function validateProfileConfig(_0x434952,_0x4fed27){const _0xfc83cf=a62_0x14db7a;if(typeof _0x434952!==_0xfc83cf(0x1c9)||_0x434952===null)throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0xfc83cf(0x1aa)+_0x4fed27+_0xfc83cf(0x193));const _0x25a46f=[_0xfc83cf(0x1c8),_0xfc83cf(0x179),_0xfc83cf(0x183),_0xfc83cf(0x17b),_0xfc83cf(0x196),_0xfc83cf(0x1b2),_0xfc83cf(0x18d)],_0x368252=_0x434952;for(const _0x4a5e7f of Object[_0xfc83cf(0x180)](_0x368252)){!_0x25a46f[_0xfc83cf(0x1c1)](_0x4a5e7f)&&console['warn']('Warning:\x20Profile\x20\x27'+_0x4fed27+_0xfc83cf(0x191)+_0x4a5e7f+'\x27\x20will\x20be\x20ignored');}if(_0x368252[_0xfc83cf(0x1c8)]!==undefined&&typeof _0x368252[_0xfc83cf(0x1c8)]!=='string')throw new SDKError(ErrorCode[_0xfc83cf(0x17e)],_0xfc83cf(0x1aa)+_0x4fed27+_0xfc83cf(0x1b0));if(_0x368252['site']!==undefined&&typeof _0x368252[_0xfc83cf(0x179)]!==_0xfc83cf(0x18c))throw new SDKError(ErrorCode[_0xfc83cf(0x17e)],_0xfc83cf(0x1aa)+_0x4fed27+_0xfc83cf(0x19b));if(_0x368252[_0xfc83cf(0x183)]!==undefined&&typeof _0x368252[_0xfc83cf(0x183)]!=='string')throw new SDKError(ErrorCode[_0xfc83cf(0x17e)],_0xfc83cf(0x1aa)+_0x4fed27+_0xfc83cf(0x18b));if(_0x368252[_0xfc83cf(0x17b)]!==undefined&&typeof _0x368252[_0xfc83cf(0x17b)]!==_0xfc83cf(0x18c))throw new SDKError(ErrorCode[_0xfc83cf(0x17e)],_0xfc83cf(0x1aa)+_0x4fed27+_0xfc83cf(0x197));if(_0x368252['llm_project']!==undefined&&typeof _0x368252[_0xfc83cf(0x196)]!==_0xfc83cf(0x18c))throw new SDKError(ErrorCode[_0xfc83cf(0x17e)],_0xfc83cf(0x1aa)+_0x4fed27+_0xfc83cf(0x1a5));if(_0x368252['llm_agent']!==undefined&&typeof _0x368252[_0xfc83cf(0x1b2)]!==_0xfc83cf(0x18c))throw new SDKError(ErrorCode[_0xfc83cf(0x17e)],'Profile\x20\x27'+_0x4fed27+_0xfc83cf(0x1cb));return!![];}function loadProfilesFromTdxJson(_0x2b3188,_0x3abea4){const _0x3eb061=a62_0x14db7a;if(!a62_0x1f1aaf[_0x3eb061(0x1ad)](_0x2b3188))return[];try{const _0x257fc9=a62_0x1f1aaf[_0x3eb061(0x1c3)](_0x2b3188,_0x3eb061(0x1c7)),_0x1ac6b3=JSON[_0x3eb061(0x1a2)](_0x257fc9);if(!_0x1ac6b3[_0x3eb061(0x1bd)]||typeof _0x1ac6b3[_0x3eb061(0x1bd)]!==_0x3eb061(0x1c9))return[];const _0x4d48d9=[];for(const [_0x1d1661,_0x229a46]of Object[_0x3eb061(0x1a8)](_0x1ac6b3[_0x3eb061(0x1bd)])){try{validateProfileConfig(_0x229a46,_0x1d1661);const _0xf705ab=getNewCredentialPath(_0x1d1661),_0x11820b=getOldCredentialPath(_0x1d1661),_0x1f420a=a62_0x1f1aaf[_0x3eb061(0x1ad)](_0xf705ab)||a62_0x1f1aaf[_0x3eb061(0x1ad)](_0x11820b);_0x4d48d9[_0x3eb061(0x192)]({'name':_0x1d1661,'config':_0x229a46,'metadata':{'name':_0x1d1661,'createdAt':new Date()[_0x3eb061(0x1ba)]()},'hasCredentials':_0x1f420a,'scope':_0x3abea4});}catch(_0x1659f4){_0x1659f4 instanceof Error&&(console[_0x3eb061(0x1b3)](_0x3eb061(0x198)+_0x2b3188+':'),console[_0x3eb061(0x1b3)]('\x20\x20'+_0x1659f4[_0x3eb061(0x1ca)]+'\x0a'));}}return _0x4d48d9;}catch(_0x22cc03){return _0x22cc03 instanceof SyntaxError?(console[_0x3eb061(0x1b3)](_0x3eb061(0x17f)+_0x2b3188+':\x20Invalid\x20JSON\x20syntax'),console[_0x3eb061(0x1b3)](_0x3eb061(0x17d)+_0x22cc03[_0x3eb061(0x1ca)]+'\x0a')):console[_0x3eb061(0x1b3)](_0x3eb061(0x19c)+_0x2b3188+':\x20'+_0x22cc03+'\x0a'),[];}}export function getNewCredentialPath(_0x5df39e){const _0x4f1e42=a62_0x14db7a;return a62_0x2dca5c[_0x4f1e42(0x199)](getConfigDir(),_0x4f1e42(0x19f)+_0x5df39e);}function getOldCredentialPath(_0x431964){const _0x301b8d=a62_0x14db7a;return a62_0x2dca5c[_0x301b8d(0x199)](getProfilesDir(),_0x431964,_0x301b8d(0x181));}function loadProfilesFromTdxJsonFiles(){const _0x360717=a62_0x14db7a,_0x1b9e9f=[],_0x8f49c2=findProjectConfigPath();_0x8f49c2&&_0x1b9e9f['push'](...loadProfilesFromTdxJson(_0x8f49c2,_0x360717(0x1bf)));const _0x19b2c6=a62_0x2dca5c['join'](getConfigDir(),'tdx.json');return _0x1b9e9f[_0x360717(0x192)](...loadProfilesFromTdxJson(_0x19b2c6,_0x360717(0x1bc))),_0x1b9e9f;}function loadProfilesFromDirectories(){const _0x8670bf=a62_0x14db7a,_0x385e7e=getProfilesDir();if(!a62_0x1f1aaf['existsSync'](_0x385e7e))return[];try{return a62_0x1f1aaf['readdirSync'](_0x385e7e,{'withFileTypes':!![]})[_0x8670bf(0x1a7)](_0x4ddd37=>_0x4ddd37[_0x8670bf(0x1b5)]())[_0x8670bf(0x1ae)](_0x40a443=>_0x40a443[_0x8670bf(0x1a1)])[_0x8670bf(0x1a7)](_0x226f35=>{const _0x449d39=_0x8670bf,_0x2b57d7=getProfileConfigPath(_0x226f35),_0x5ec0c=getProfileEnvPath(_0x226f35);return a62_0x1f1aaf['existsSync'](_0x2b57d7)||a62_0x1f1aaf[_0x449d39(0x1ad)](_0x5ec0c);})[_0x8670bf(0x1ae)](_0x1d80c4=>{const _0xae0d70=_0x8670bf,_0x2ea9e8=loadProfileFromDirectory(_0x1d80c4);if(_0x2ea9e8)return{..._0x2ea9e8,'scope':_0xae0d70(0x184)};return null;})[_0x8670bf(0x1a7)](_0x29b2eb=>_0x29b2eb!==null);}catch{return[];}}function loadProfileFromDirectory(_0x122ca1){const _0x5b1d0a=a62_0x14db7a,_0x486f4d=getProfileConfigPath(_0x122ca1),_0x568431=getOldCredentialPath(_0x122ca1);if(!a62_0x1f1aaf['existsSync'](_0x486f4d)&&!a62_0x1f1aaf['existsSync'](_0x568431))return null;let _0x544066={},_0x54802e={'name':_0x122ca1,'createdAt':new Date()[_0x5b1d0a(0x1ba)]()};if(a62_0x1f1aaf[_0x5b1d0a(0x1ad)](_0x486f4d))try{const _0x19f1ae=a62_0x1f1aaf[_0x5b1d0a(0x1c3)](_0x486f4d,_0x5b1d0a(0x1c7)),_0x3a5b8d=JSON[_0x5b1d0a(0x1a2)](_0x19f1ae),{metadata:_0x4a0e84,..._0x475163}=_0x3a5b8d;_0x544066=_0x475163,_0x4a0e84&&(_0x54802e=_0x4a0e84);}catch{}return{'name':_0x122ca1,'config':_0x544066,'metadata':_0x54802e,'hasCredentials':a62_0x1f1aaf['existsSync'](_0x568431),'scope':_0x5b1d0a(0x184)};}export function listProfiles(){const _0x1ab274=a62_0x14db7a,_0x33a382=loadProfilesFromTdxJsonFiles(),_0x3c2ae7=loadProfilesFromDirectories();if(_0x3c2ae7[_0x1ab274(0x1b8)]>0x0){const _0x54d67b=_0x3c2ae7[_0x1ab274(0x1ae)](_0x7db991=>_0x7db991[_0x1ab274(0x1a1)])[_0x1ab274(0x199)](',\x20'),_0x5b8aae=getConfigDir();console['warn'](_0x1ab274(0x182)+_0x54d67b),console['warn']('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console[_0x1ab274(0x1b3)]('\x20\x201.\x20Edit:\x20'+a62_0x2dca5c[_0x1ab274(0x199)](_0x5b8aae,_0x1ab274(0x1bb))),console['warn'](_0x1ab274(0x186)),console['warn'](_0x1ab274(0x1a0));}const _0x2514ac=[..._0x33a382,..._0x3c2ae7],_0x17020d=new Map();for(const _0x1e9d51 of _0x2514ac){!_0x17020d[_0x1ab274(0x1b9)](_0x1e9d51[_0x1ab274(0x1a1)])&&_0x17020d[_0x1ab274(0x19d)](_0x1e9d51[_0x1ab274(0x1a1)],_0x1e9d51);}return Array[_0x1ab274(0x18f)](_0x17020d[_0x1ab274(0x1b4)]())[_0x1ab274(0x188)]((_0x1ef743,_0x2212cb)=>_0x1ef743['name']['localeCompare'](_0x2212cb['name']));}export function profileExists(_0x45729a){const _0x3ba863=a62_0x14db7a,_0x406acb=listProfiles();return _0x406acb[_0x3ba863(0x1c0)](_0x1d8540=>_0x1d8540[_0x3ba863(0x1a1)]===_0x45729a);}export function loadProfile(_0x34eeba){const _0x50d830=a62_0x14db7a;validateProfileName(_0x34eeba);const _0x4b3296=listProfiles(),_0xa5b519=_0x4b3296[_0x50d830(0x1cc)](_0x2dfa2a=>_0x2dfa2a['name']===_0x34eeba);return _0xa5b519||null;}export function saveProfile(_0x5042de,_0x34bdfa,_0x351699=![]){saveProfileToUserConfig(_0x5042de,_0x34bdfa);}export function deleteProfile(_0x52ff2e){const _0x3e730b=a62_0x14db7a;validateProfileName(_0x52ff2e);const _0x54c6b4=getProfileDir(_0x52ff2e);if(!a62_0x1f1aaf[_0x3e730b(0x1ad)](_0x54c6b4))throw new Error('Profile\x20'+_0x52ff2e+_0x3e730b(0x17c));a62_0x1f1aaf[_0x3e730b(0x187)](_0x54c6b4,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x4f0b92,_0x3b1fdd){const _0x109978=a62_0x14db7a;validateProfileName(_0x4f0b92);const _0x534c2c=getGlobalConfigPath(),_0x409ebb=getConfigDir();!a62_0x1f1aaf[_0x109978(0x1ad)](_0x409ebb)&&createSecureDirectory(_0x409ebb);let _0x36e250={};if(a62_0x1f1aaf[_0x109978(0x1ad)](_0x534c2c))try{const _0x1cbc70=a62_0x1f1aaf[_0x109978(0x1c3)](_0x534c2c,_0x109978(0x1c7));_0x36e250=JSON['parse'](_0x1cbc70);}catch{console[_0x109978(0x1b3)](_0x109978(0x19e)+_0x534c2c+_0x109978(0x185));}!_0x36e250['profiles']&&(_0x36e250['profiles']={}),_0x36e250[_0x109978(0x1bd)][_0x4f0b92]=_0x3b1fdd,writeSecureFile(_0x534c2c,JSON[_0x109978(0x195)](_0x36e250,null,0x2));}export function removeProfileFromUserConfig(_0x52b522){const _0x2b98c3=a62_0x14db7a;validateProfileName(_0x52b522);const _0xfd9bea=getGlobalConfigPath();if(!a62_0x1f1aaf[_0x2b98c3(0x1ad)](_0xfd9bea))throw new Error(_0x2b98c3(0x1aa)+_0x52b522+_0x2b98c3(0x1c6));let _0x445fed={};try{const _0x12d37a=a62_0x1f1aaf['readFileSync'](_0xfd9bea,_0x2b98c3(0x1c7));_0x445fed=JSON[_0x2b98c3(0x1a2)](_0x12d37a);}catch{throw new Error(_0x2b98c3(0x1cd)+_0xfd9bea);}if(!_0x445fed[_0x2b98c3(0x1bd)]||!_0x445fed[_0x2b98c3(0x1bd)][_0x52b522])throw new Error(_0x2b98c3(0x1aa)+_0x52b522+_0x2b98c3(0x1c6));delete _0x445fed[_0x2b98c3(0x1bd)][_0x52b522],_0x445fed[_0x2b98c3(0x18a)]===_0x52b522&&delete _0x445fed[_0x2b98c3(0x18a)],writeSecureFile(_0xfd9bea,JSON[_0x2b98c3(0x195)](_0x445fed,null,0x2));}export function getActiveProfile(){const _0x4e9cdf=a62_0x14db7a,_0x4ab1f2=loadSessionContext();if(_0x4ab1f2?.[_0x4e9cdf(0x18a)])return _0x4ab1f2[_0x4e9cdf(0x18a)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0xb529da=getGlobalConfigPath();if(!a62_0x1f1aaf[_0x4e9cdf(0x1ad)](_0xb529da))return null;try{const _0x2f0cc7=a62_0x1f1aaf[_0x4e9cdf(0x1c3)](_0xb529da,_0x4e9cdf(0x1c7)),_0x24743e=JSON['parse'](_0x2f0cc7);return _0x24743e[_0x4e9cdf(0x18a)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x453eb3){const _0x36812a=a62_0x14db7a,_0x1cb966=getGlobalConfigPath(),_0x12938e=getConfigDir();!a62_0x1f1aaf[_0x36812a(0x1ad)](_0x12938e)&&createSecureDirectory(_0x12938e);let _0x2ca2b1={};if(a62_0x1f1aaf['existsSync'](_0x1cb966))try{const _0x4327ec=a62_0x1f1aaf['readFileSync'](_0x1cb966,_0x36812a(0x1c7));_0x2ca2b1=JSON[_0x36812a(0x1a2)](_0x4327ec);}catch{console[_0x36812a(0x1b3)](_0x36812a(0x19e)+_0x1cb966+_0x36812a(0x185));}_0x2ca2b1[_0x36812a(0x179)]=_0x453eb3,writeSecureFile(_0x1cb966,JSON[_0x36812a(0x195)](_0x2ca2b1,null,0x2));}export function saveActiveProfileToUserConfig(_0x1f25ee){const _0x4877c8=a62_0x14db7a;validateProfileName(_0x1f25ee);const _0x1538d4=getGlobalConfigPath(),_0x22f4ec=getConfigDir();!a62_0x1f1aaf['existsSync'](_0x22f4ec)&&createSecureDirectory(_0x22f4ec);let _0x459f26={};if(a62_0x1f1aaf[_0x4877c8(0x1ad)](_0x1538d4))try{const _0x368c11=a62_0x1f1aaf['readFileSync'](_0x1538d4,'utf-8');_0x459f26=JSON[_0x4877c8(0x1a2)](_0x368c11);}catch{console[_0x4877c8(0x1b3)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x1538d4+_0x4877c8(0x185));}_0x459f26['profile']=_0x1f25ee,writeSecureFile(_0x1538d4,JSON['stringify'](_0x459f26,null,0x2));}function clearFieldFromUserConfig(_0x283bd9){const _0x5a4ef8=a62_0x14db7a,_0x314803=getGlobalConfigPath();if(!a62_0x1f1aaf[_0x5a4ef8(0x1ad)](_0x314803))return;let _0x2af728={};try{const _0x11233a=a62_0x1f1aaf[_0x5a4ef8(0x1c3)](_0x314803,_0x5a4ef8(0x1c7));_0x2af728=JSON[_0x5a4ef8(0x1a2)](_0x11233a);}catch{return;}delete _0x2af728[_0x283bd9],writeSecureFile(_0x314803,JSON[_0x5a4ef8(0x195)](_0x2af728,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x354fb8=a62_0x14db7a;clearFieldFromUserConfig(_0x354fb8(0x179));}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x2f8a16,_0x325483){const _0x281967=a62_0x14db7a;validateProfileName(_0x2f8a16);if(profileExists(_0x2f8a16))throw new Error('Profile\x20'+_0x2f8a16+_0x281967(0x1b7));saveProfile(_0x2f8a16,_0x325483);}export function saveProfileCredentials(_0xfe410d,_0x3a7387){const _0x5c869a=a62_0x14db7a;validateProfileName(_0xfe410d);if(!profileExists(_0xfe410d))throw new Error(_0x5c869a(0x1a6)+_0xfe410d+_0x5c869a(0x17c));const _0x3a6ac4=getNewCredentialPath(_0xfe410d);writeSecureFile(_0x3a6ac4,_0x3a7387);}function a62_0x483e(){const _0x2be7cd=['find','Failed\x20to\x20parse\x20','site','@tdx-studio','parent_segment','\x20does\x20not\x20exist','Error:\x20','INVALID_PROFILE_CONFIG','\x0aWarning:\x20Failed\x20to\x20parse\x20','keys','.env','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','database','directory',',\x20creating\x20new\x20file','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','rmSync','sort','5210yPlJXt','profile','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','string','user_info','538512cLZwsu','from','test','\x27:\x20unknown\x20config\x20key\x20\x27','push','\x27:\x20config\x20must\x20be\x20an\x20object','20265058yFRWbD','stringify','llm_project','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','join','To\x20migrate:','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','set','Warning:\x20Failed\x20to\x20parse\x20','.env.','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','name','parse','35NaSjMd','490542pIzVZj','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','Profile\x20','filter','entries','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','Profile\x20\x27','8919iQYaOu','3536280XHgdso','existsSync','map','\x22\x20\x22','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','2667222LjpjxY','llm_agent','warn','values','isDirectory','Invalid\x20profile\x20name:\x20','\x20already\x20exists','length','has','toISOString','tdx.json','user','profiles','14nsmdpq','local','some','includes','520774IXrIrt','readFileSync','12tYJXrD','\x20\x20mv\x20\x22','\x27\x20not\x20found\x20in\x20user\x20configuration','utf-8','description','object','message','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string'];a62_0x483e=function(){return _0x2be7cd;};return a62_0x483e();}export function loadProfileCredentials(_0x461530){const _0x192f20=a62_0x14db7a;validateProfileName(_0x461530);const _0x4ec86b=getNewCredentialPath(_0x461530);if(a62_0x1f1aaf[_0x192f20(0x1ad)](_0x4ec86b))try{return a62_0x1f1aaf[_0x192f20(0x1c3)](_0x4ec86b,'utf-8');}catch{}const _0x208176=getOldCredentialPath(_0x461530);if(a62_0x1f1aaf[_0x192f20(0x1ad)](_0x208176)){console[_0x192f20(0x1b3)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x461530+'\x27'),console[_0x192f20(0x1b3)](_0x192f20(0x19a)),console[_0x192f20(0x1b3)](_0x192f20(0x1c5)+_0x208176+_0x192f20(0x1af)+_0x4ec86b+'\x22'),console[_0x192f20(0x1b3)](_0x192f20(0x1a9));try{return a62_0x1f1aaf[_0x192f20(0x1c3)](_0x208176,'utf-8');}catch{return null;}}return null;}
1
+ const a62_0x277d66=a62_0x80ce;(function(_0x345c52,_0x58d821){const _0x4c0cba=a62_0x80ce,_0x5bbc60=_0x345c52();while(!![]){try{const _0x384312=parseInt(_0x4c0cba(0xc8))/0x1*(-parseInt(_0x4c0cba(0xc6))/0x2)+-parseInt(_0x4c0cba(0xd7))/0x3+-parseInt(_0x4c0cba(0xd9))/0x4+parseInt(_0x4c0cba(0xf0))/0x5*(-parseInt(_0x4c0cba(0xb3))/0x6)+-parseInt(_0x4c0cba(0xd6))/0x7*(parseInt(_0x4c0cba(0xfb))/0x8)+parseInt(_0x4c0cba(0xa5))/0x9*(-parseInt(_0x4c0cba(0xdb))/0xa)+parseInt(_0x4c0cba(0xce))/0xb*(parseInt(_0x4c0cba(0xf7))/0xc);if(_0x384312===_0x58d821)break;else _0x5bbc60['push'](_0x5bbc60['shift']());}catch(_0x1d8d10){_0x5bbc60['push'](_0x5bbc60['shift']());}}}(a62_0x1a83,0xd31cb));import*as a62_0x4c969a from'node:fs';import*as a62_0x11d209 from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';function a62_0x1a83(){const _0xed6e13=['207ZwLCyw','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','To\x20migrate:','database','set','object','Error:\x20','directory','profile','INVALID_PROFILE_CONFIG','\x20\x20mv\x20\x22','filter','user','12UjTtqI','Profile\x20','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','user_info','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','has','test','@tdx-studio','.env','Invalid\x20profile\x20name:\x20','parse','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','entries','\x22\x20\x22','utf-8','llm_project','warn','local','rmSync','8DJUSVx','map','373719ipRQul','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20',',\x20creating\x20new\x20file','some','\x27\x20not\x20found\x20in\x20user\x20configuration','localeCompare','69231030jsMQgU','site','length','description','string','Profile\x20\x27','.env.','Warning:\x20Failed\x20to\x20parse\x20','38710rVPWRL','2136036suxmis','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','176960jCRIRO','from','268810teGfkr','join','tdx.json','Failed\x20to\x20parse\x20','push','keys','name','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','message','\x0aWarning:\x20Failed\x20to\x20parse\x20','\x20\x201.\x20Edit:\x20','sort','parent_segment','\x20does\x20not\x20exist','isDirectory','\x27:\x20unknown\x20config\x20key\x20\x27','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','profiles','Warning:\x20Profile\x20\x27','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','2306860yezRCL','\x27:\x20config\x20must\x20be\x20an\x20object','existsSync','includes','llm_agent','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','readFileSync','12gacbNG','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','stringify','\x27\x20will\x20be\x20ignored','2368DqyoMD'];a62_0x1a83=function(){return _0xed6e13;};return a62_0x1a83();}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_0x277d66(0xba);export function getProfileParams(_0x18d8f7){const _0xe596eb=a62_0x277d66,_0x28b2b0={};if(!_0x18d8f7)return _0x28b2b0;for(const [_0x3f4def,_0x8e290]of Object[_0xe596eb(0xbf)](_0x18d8f7)){_0x3f4def!==_0xe596eb(0xd1)&&_0x8e290!==undefined&&(_0x28b2b0[_0x3f4def]=_0x8e290);}return _0x28b2b0;}export function getProfilesDir(){const _0x451bda=a62_0x277d66;return a62_0x11d209[_0x451bda(0xdc)](getConfigDir(),'profiles');}function getProfileDir(_0x2cb2c8){const _0x396142=a62_0x277d66;return a62_0x11d209[_0x396142(0xdc)](getProfilesDir(),_0x2cb2c8);}function getProfileConfigPath(_0x25bedc){const _0x53fd84=a62_0x277d66;return a62_0x11d209[_0x53fd84(0xdc)](getProfileDir(_0x25bedc),'tdx.json');}function getProfileEnvPath(_0x20c031){const _0x4c4d7b=a62_0x277d66;return a62_0x11d209[_0x4c4d7b(0xdc)](getProfileDir(_0x20c031),_0x4c4d7b(0xbb));}function getGlobalConfigPath(){const _0x415a95=a62_0x277d66;return a62_0x11d209[_0x415a95(0xdc)](getConfigDir(),_0x415a95(0xdd));}function validateProfileName(_0x148842){const _0x546b48=a62_0x277d66;if(/^@?[a-zA-Z0-9_-]+$/[_0x546b48(0xb9)](_0x148842))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x546b48(0xb9)](_0x148842))return;throw new Error(_0x546b48(0xbc)+_0x148842+_0x546b48(0xe2));}function validateProfileConfig(_0xaa619e,_0x5ebdc7){const _0x4d2a9=a62_0x277d66;if(typeof _0xaa619e!==_0x4d2a9(0xab)||_0xaa619e===null)throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xf1));const _0x5903cd=['description',_0x4d2a9(0xcf),_0x4d2a9(0xa9),_0x4d2a9(0xe8),'llm_project',_0x4d2a9(0xf4),_0x4d2a9(0xb6)],_0x36cfeb=_0xaa619e;for(const _0x2cbf07 of Object[_0x4d2a9(0xe0)](_0x36cfeb)){!_0x5903cd[_0x4d2a9(0xf3)](_0x2cbf07)&&console['warn'](_0x4d2a9(0xee)+_0x5ebdc7+_0x4d2a9(0xeb)+_0x2cbf07+_0x4d2a9(0xfa));}if(_0x36cfeb[_0x4d2a9(0xd1)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xd1)]!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xbe));if(_0x36cfeb[_0x4d2a9(0xcf)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xcf)]!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode[_0x4d2a9(0xaf)],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xa6));if(_0x36cfeb[_0x4d2a9(0xa9)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xa9)]!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode[_0x4d2a9(0xaf)],'Profile\x20\x27'+_0x5ebdc7+_0x4d2a9(0xec));if(_0x36cfeb[_0x4d2a9(0xe8)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xe8)]!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode[_0x4d2a9(0xaf)],'Profile\x20\x27'+_0x5ebdc7+_0x4d2a9(0xf5));if(_0x36cfeb[_0x4d2a9(0xc2)]!==undefined&&typeof _0x36cfeb['llm_project']!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode[_0x4d2a9(0xaf)],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xf8));if(_0x36cfeb[_0x4d2a9(0xf4)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xf4)]!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xef));return!![];}function loadProfilesFromTdxJson(_0x10c1b1,_0x4e859b){const _0x527f31=a62_0x277d66;if(!a62_0x4c969a[_0x527f31(0xf2)](_0x10c1b1))return[];try{const _0x542697=a62_0x4c969a[_0x527f31(0xf6)](_0x10c1b1,_0x527f31(0xc1)),_0x228975=JSON[_0x527f31(0xbd)](_0x542697);if(!_0x228975[_0x527f31(0xed)]||typeof _0x228975['profiles']!==_0x527f31(0xab))return[];const _0x358c85=[];for(const [_0x17fa57,_0x8b584d]of Object[_0x527f31(0xbf)](_0x228975[_0x527f31(0xed)])){try{validateProfileConfig(_0x8b584d,_0x17fa57);const _0x2ab397=getNewCredentialPath(_0x17fa57),_0x496520=getOldCredentialPath(_0x17fa57),_0x2247c0=a62_0x4c969a[_0x527f31(0xf2)](_0x2ab397)||a62_0x4c969a[_0x527f31(0xf2)](_0x496520);_0x358c85[_0x527f31(0xdf)]({'name':_0x17fa57,'config':_0x8b584d,'metadata':{'name':_0x17fa57,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x2247c0,'scope':_0x4e859b});}catch(_0x1afc72){_0x1afc72 instanceof Error&&(console['warn'](_0x527f31(0xc9)+_0x10c1b1+':'),console[_0x527f31(0xc3)]('\x20\x20'+_0x1afc72[_0x527f31(0xe4)]+'\x0a'));}}return _0x358c85;}catch(_0x550a3e){return _0x550a3e instanceof SyntaxError?(console[_0x527f31(0xc3)](_0x527f31(0xe5)+_0x10c1b1+':\x20Invalid\x20JSON\x20syntax'),console['warn'](_0x527f31(0xac)+_0x550a3e['message']+'\x0a')):console[_0x527f31(0xc3)](_0x527f31(0xb5)+_0x10c1b1+':\x20'+_0x550a3e+'\x0a'),[];}}export function getNewCredentialPath(_0x5f2adc){const _0x795ac5=a62_0x277d66;return a62_0x11d209['join'](getConfigDir(),_0x795ac5(0xd4)+_0x5f2adc);}function getOldCredentialPath(_0x2c0a95){const _0x522501=a62_0x277d66;return a62_0x11d209[_0x522501(0xdc)](getProfilesDir(),_0x2c0a95,_0x522501(0xbb));}function loadProfilesFromTdxJsonFiles(){const _0x1bea5f=a62_0x277d66,_0x531288=[],_0x277dfd=findProjectConfigPath();_0x277dfd&&_0x531288[_0x1bea5f(0xdf)](...loadProfilesFromTdxJson(_0x277dfd,_0x1bea5f(0xc4)));const _0x326e34=a62_0x11d209[_0x1bea5f(0xdc)](getConfigDir(),_0x1bea5f(0xdd));return _0x531288['push'](...loadProfilesFromTdxJson(_0x326e34,_0x1bea5f(0xb2))),_0x531288;}function loadProfilesFromDirectories(){const _0x63a139=a62_0x277d66,_0x1d126d=getProfilesDir();if(!a62_0x4c969a[_0x63a139(0xf2)](_0x1d126d))return[];try{return a62_0x4c969a['readdirSync'](_0x1d126d,{'withFileTypes':!![]})['filter'](_0x415b33=>_0x415b33[_0x63a139(0xea)]())[_0x63a139(0xc7)](_0xc6d685=>_0xc6d685[_0x63a139(0xe1)])[_0x63a139(0xb1)](_0x33b688=>{const _0x184c5a=_0x63a139,_0x499e02=getProfileConfigPath(_0x33b688),_0x4f42ee=getProfileEnvPath(_0x33b688);return a62_0x4c969a[_0x184c5a(0xf2)](_0x499e02)||a62_0x4c969a[_0x184c5a(0xf2)](_0x4f42ee);})[_0x63a139(0xc7)](_0x521ae8=>{const _0x4eef97=loadProfileFromDirectory(_0x521ae8);if(_0x4eef97)return{..._0x4eef97,'scope':'directory'};return null;})['filter'](_0x2b93fc=>_0x2b93fc!==null);}catch{return[];}}function loadProfileFromDirectory(_0x54ea4a){const _0xdf83d0=a62_0x277d66,_0x5b0598=getProfileConfigPath(_0x54ea4a),_0x47bb23=getOldCredentialPath(_0x54ea4a);if(!a62_0x4c969a[_0xdf83d0(0xf2)](_0x5b0598)&&!a62_0x4c969a['existsSync'](_0x47bb23))return null;let _0x42333b={},_0x352349={'name':_0x54ea4a,'createdAt':new Date()['toISOString']()};if(a62_0x4c969a['existsSync'](_0x5b0598))try{const _0x178933=a62_0x4c969a[_0xdf83d0(0xf6)](_0x5b0598,_0xdf83d0(0xc1)),_0x1d26d8=JSON[_0xdf83d0(0xbd)](_0x178933),{metadata:_0x1df147,..._0x31a97c}=_0x1d26d8;_0x42333b=_0x31a97c,_0x1df147&&(_0x352349=_0x1df147);}catch{}return{'name':_0x54ea4a,'config':_0x42333b,'metadata':_0x352349,'hasCredentials':a62_0x4c969a[_0xdf83d0(0xf2)](_0x47bb23),'scope':_0xdf83d0(0xad)};}export function listProfiles(){const _0x4c1cfa=a62_0x277d66,_0x49fde1=loadProfilesFromTdxJsonFiles(),_0x529238=loadProfilesFromDirectories();if(_0x529238[_0x4c1cfa(0xd0)]>0x0){const _0x90fccc=_0x529238[_0x4c1cfa(0xc7)](_0x3c20de=>_0x3c20de[_0x4c1cfa(0xe1)])[_0x4c1cfa(0xdc)](',\x20'),_0x1f5431=getConfigDir();console[_0x4c1cfa(0xc3)]('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x90fccc),console[_0x4c1cfa(0xc3)]('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console['warn'](_0x4c1cfa(0xe6)+a62_0x11d209['join'](_0x1f5431,_0x4c1cfa(0xdd))),console['warn'](_0x4c1cfa(0xd8)),console[_0x4c1cfa(0xc3)](_0x4c1cfa(0xe3));}const _0x1fe195=[..._0x49fde1,..._0x529238],_0x419a46=new Map();for(const _0x2ba47d of _0x1fe195){!_0x419a46[_0x4c1cfa(0xb8)](_0x2ba47d['name'])&&_0x419a46[_0x4c1cfa(0xaa)](_0x2ba47d[_0x4c1cfa(0xe1)],_0x2ba47d);}return Array[_0x4c1cfa(0xda)](_0x419a46['values']())[_0x4c1cfa(0xe7)]((_0x350357,_0x428774)=>_0x350357[_0x4c1cfa(0xe1)][_0x4c1cfa(0xcd)](_0x428774[_0x4c1cfa(0xe1)]));}export function profileExists(_0x2d3105){const _0x177f0c=a62_0x277d66,_0xd0276d=listProfiles();return _0xd0276d[_0x177f0c(0xcb)](_0x229503=>_0x229503[_0x177f0c(0xe1)]===_0x2d3105);}export function loadProfile(_0x542989){const _0x54ff79=a62_0x277d66;validateProfileName(_0x542989);const _0x35bd79=listProfiles(),_0x4aabb2=_0x35bd79['find'](_0x4461fe=>_0x4461fe[_0x54ff79(0xe1)]===_0x542989);return _0x4aabb2||null;}export function saveProfile(_0x86938a,_0x300512,_0xe18848=![]){saveProfileToUserConfig(_0x86938a,_0x300512);}export function deleteProfile(_0x4360e7){const _0x34954d=a62_0x277d66;validateProfileName(_0x4360e7);const _0x29099b=getProfileDir(_0x4360e7);if(!a62_0x4c969a[_0x34954d(0xf2)](_0x29099b))throw new Error(_0x34954d(0xb4)+_0x4360e7+_0x34954d(0xe9));a62_0x4c969a[_0x34954d(0xc5)](_0x29099b,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x503195,_0x554af1){const _0x1398bd=a62_0x277d66;validateProfileName(_0x503195);const _0x2340d0=getGlobalConfigPath(),_0x2d1698=getConfigDir();!a62_0x4c969a[_0x1398bd(0xf2)](_0x2d1698)&&createSecureDirectory(_0x2d1698);let _0x5d91c8={};if(a62_0x4c969a[_0x1398bd(0xf2)](_0x2340d0))try{const _0x37686b=a62_0x4c969a[_0x1398bd(0xf6)](_0x2340d0,_0x1398bd(0xc1));_0x5d91c8=JSON[_0x1398bd(0xbd)](_0x37686b);}catch{console[_0x1398bd(0xc3)](_0x1398bd(0xd5)+_0x2340d0+_0x1398bd(0xca));}!_0x5d91c8[_0x1398bd(0xed)]&&(_0x5d91c8[_0x1398bd(0xed)]={}),_0x5d91c8[_0x1398bd(0xed)][_0x503195]=_0x554af1,writeSecureFile(_0x2340d0,JSON[_0x1398bd(0xf9)](_0x5d91c8,null,0x2));}export function removeProfileFromUserConfig(_0x516301){const _0x2efec0=a62_0x277d66;validateProfileName(_0x516301);const _0x4d5e32=getGlobalConfigPath();if(!a62_0x4c969a[_0x2efec0(0xf2)](_0x4d5e32))throw new Error(_0x2efec0(0xd3)+_0x516301+_0x2efec0(0xcc));let _0x39522c={};try{const _0xe8cf79=a62_0x4c969a[_0x2efec0(0xf6)](_0x4d5e32,'utf-8');_0x39522c=JSON[_0x2efec0(0xbd)](_0xe8cf79);}catch{throw new Error(_0x2efec0(0xde)+_0x4d5e32);}if(!_0x39522c['profiles']||!_0x39522c[_0x2efec0(0xed)][_0x516301])throw new Error(_0x2efec0(0xd3)+_0x516301+_0x2efec0(0xcc));delete _0x39522c['profiles'][_0x516301],_0x39522c['profile']===_0x516301&&delete _0x39522c[_0x2efec0(0xae)],writeSecureFile(_0x4d5e32,JSON[_0x2efec0(0xf9)](_0x39522c,null,0x2));}export function getActiveProfile(){const _0x4b3d9b=a62_0x277d66,_0x43d031=loadSessionContext();if(_0x43d031?.[_0x4b3d9b(0xae)])return _0x43d031[_0x4b3d9b(0xae)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x172a7d=getGlobalConfigPath();if(!a62_0x4c969a[_0x4b3d9b(0xf2)](_0x172a7d))return null;try{const _0x1569f5=a62_0x4c969a[_0x4b3d9b(0xf6)](_0x172a7d,_0x4b3d9b(0xc1)),_0x3a38ab=JSON[_0x4b3d9b(0xbd)](_0x1569f5);return _0x3a38ab[_0x4b3d9b(0xae)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x4a88e2){const _0x1bd428=a62_0x277d66,_0x355b1a=getGlobalConfigPath(),_0x3c5f9d=getConfigDir();!a62_0x4c969a['existsSync'](_0x3c5f9d)&&createSecureDirectory(_0x3c5f9d);let _0x2ebc4d={};if(a62_0x4c969a[_0x1bd428(0xf2)](_0x355b1a))try{const _0x592e4e=a62_0x4c969a[_0x1bd428(0xf6)](_0x355b1a,_0x1bd428(0xc1));_0x2ebc4d=JSON[_0x1bd428(0xbd)](_0x592e4e);}catch{console['warn'](_0x1bd428(0xd5)+_0x355b1a+',\x20creating\x20new\x20file');}_0x2ebc4d[_0x1bd428(0xcf)]=_0x4a88e2,writeSecureFile(_0x355b1a,JSON[_0x1bd428(0xf9)](_0x2ebc4d,null,0x2));}export function saveActiveProfileToUserConfig(_0x4c1d85){const _0x39810f=a62_0x277d66;validateProfileName(_0x4c1d85);const _0x5b1c0c=getGlobalConfigPath(),_0x50c87c=getConfigDir();!a62_0x4c969a['existsSync'](_0x50c87c)&&createSecureDirectory(_0x50c87c);let _0x3a5366={};if(a62_0x4c969a[_0x39810f(0xf2)](_0x5b1c0c))try{const _0x59e4c5=a62_0x4c969a['readFileSync'](_0x5b1c0c,'utf-8');_0x3a5366=JSON[_0x39810f(0xbd)](_0x59e4c5);}catch{console[_0x39810f(0xc3)](_0x39810f(0xd5)+_0x5b1c0c+',\x20creating\x20new\x20file');}_0x3a5366[_0x39810f(0xae)]=_0x4c1d85,writeSecureFile(_0x5b1c0c,JSON[_0x39810f(0xf9)](_0x3a5366,null,0x2));}function clearFieldFromUserConfig(_0x587e06){const _0x198354=a62_0x277d66,_0x42c9f6=getGlobalConfigPath();if(!a62_0x4c969a[_0x198354(0xf2)](_0x42c9f6))return;let _0x41ddaa={};try{const _0x4a29b8=a62_0x4c969a[_0x198354(0xf6)](_0x42c9f6,_0x198354(0xc1));_0x41ddaa=JSON[_0x198354(0xbd)](_0x4a29b8);}catch{return;}delete _0x41ddaa[_0x587e06],writeSecureFile(_0x42c9f6,JSON[_0x198354(0xf9)](_0x41ddaa,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x9fcb26=a62_0x277d66;clearFieldFromUserConfig(_0x9fcb26(0xcf));}function a62_0x80ce(_0x28cd55,_0x57ad2b){_0x28cd55=_0x28cd55-0xa5;const _0x1a83b7=a62_0x1a83();let _0x80ceb9=_0x1a83b7[_0x28cd55];return _0x80ceb9;}export function clearActiveProfileFromUserConfig(){const _0x314968=a62_0x277d66;clearFieldFromUserConfig(_0x314968(0xae));}export function createProfile(_0x412893,_0x46c174){const _0x5175b0=a62_0x277d66;validateProfileName(_0x412893);if(profileExists(_0x412893))throw new Error(_0x5175b0(0xb4)+_0x412893+'\x20already\x20exists');saveProfile(_0x412893,_0x46c174);}export function saveProfileCredentials(_0x2ba801,_0x44bd5e){const _0x1006b5=a62_0x277d66;validateProfileName(_0x2ba801);if(!profileExists(_0x2ba801))throw new Error(_0x1006b5(0xb4)+_0x2ba801+_0x1006b5(0xe9));const _0x14f7c8=getNewCredentialPath(_0x2ba801);writeSecureFile(_0x14f7c8,_0x44bd5e);}export function loadProfileCredentials(_0x336a78){const _0x4814fc=a62_0x277d66;validateProfileName(_0x336a78);const _0x124138=getNewCredentialPath(_0x336a78);if(a62_0x4c969a[_0x4814fc(0xf2)](_0x124138))try{return a62_0x4c969a[_0x4814fc(0xf6)](_0x124138,_0x4814fc(0xc1));}catch{}const _0x40bede=getOldCredentialPath(_0x336a78);if(a62_0x4c969a[_0x4814fc(0xf2)](_0x40bede)){console[_0x4814fc(0xc3)](_0x4814fc(0xb7)+_0x336a78+'\x27'),console['warn'](_0x4814fc(0xa8)),console[_0x4814fc(0xc3)](_0x4814fc(0xb0)+_0x40bede+_0x4814fc(0xc0)+_0x124138+'\x22'),console[_0x4814fc(0xc3)](_0x4814fc(0xa7));try{return a62_0x4c969a['readFileSync'](_0x40bede,_0x4814fc(0xc1));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- function a63_0x1a52(_0xd831e9,_0x1bf85a){_0xd831e9=_0xd831e9-0x6b;const _0x228b12=a63_0x228b();let _0x1a5293=_0x228b12[_0xd831e9];return _0x1a5293;}(function(_0x37a769,_0x2e86f6){const _0x5851ff=a63_0x1a52,_0x5a633c=_0x37a769();while(!![]){try{const _0x39d75e=-parseInt(_0x5851ff(0x8a))/0x1*(-parseInt(_0x5851ff(0x7d))/0x2)+parseInt(_0x5851ff(0x82))/0x3*(-parseInt(_0x5851ff(0x85))/0x4)+parseInt(_0x5851ff(0x78))/0x5*(parseInt(_0x5851ff(0x74))/0x6)+-parseInt(_0x5851ff(0x84))/0x7+parseInt(_0x5851ff(0x6c))/0x8+parseInt(_0x5851ff(0x88))/0x9+-parseInt(_0x5851ff(0x89))/0xa*(-parseInt(_0x5851ff(0x6f))/0xb);if(_0x39d75e===_0x2e86f6)break;else _0x5a633c['push'](_0x5a633c['shift']());}catch(_0x42babc){_0x5a633c['push'](_0x5a633c['shift']());}}}(a63_0x228b,0xaa2a3));import*as a63_0x247909 from'node:fs';import*as a63_0x286818 from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x4ad74b){const _0x293262=a63_0x1a52;let _0x1fa99c=_0x4ad74b||process[_0x293262(0x7a)]();while(!![]){const _0x1e8ccb=a63_0x286818[_0x293262(0x72)](_0x1fa99c,PROJECT_CONFIG_FILENAME);if(a63_0x247909[_0x293262(0x86)](_0x1e8ccb))return _0x1e8ccb;const _0x5845cc=a63_0x286818['dirname'](_0x1fa99c);if(_0x5845cc===_0x1fa99c)return null;_0x1fa99c=_0x5845cc;}}export function loadProjectConfig(_0x2bd2ed){const _0x494ce0=a63_0x1a52,_0x43967a=findProjectConfigPath(_0x2bd2ed);if(!_0x43967a)return null;try{const _0x24dd25=a63_0x247909[_0x494ce0(0x7f)](_0x43967a,_0x494ce0(0x6e)),_0x50180a=JSON[_0x494ce0(0x83)](_0x24dd25),_0x583163=JSON[_0x494ce0(0x7e)](_0x50180a);if(_0x583163[_0x494ce0(0x73)](_0x494ce0(0x7b))||_0x583163[_0x494ce0(0x73)]('apiKey')||_0x583163['includes']('api_key'))throw new Error(_0x494ce0(0x76)+_0x43967a+_0x494ce0(0x79)+_0x494ce0(0x80));const {metadata:_0x31c700,profile:_0x5cf260,..._0xc14cdd}=_0x50180a;return _0x5cf260&&console[_0x494ce0(0x77)](_0x494ce0(0x71)+_0x43967a+'\x20is\x20ignored.\x20'+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0xc14cdd;}catch(_0x2adb45){if(_0x2adb45 instanceof Error&&'code'in _0x2adb45&&_0x2adb45[_0x494ce0(0x81)]===_0x494ce0(0x7c))return null;throw new Error(_0x494ce0(0x6b)+_0x43967a+':\x20'+_0x2adb45);}}export function saveProjectConfig(_0x2230e8,_0x29dd09){const _0x4b489e=a63_0x1a52,_0x5e3ce5=_0x29dd09||process[_0x4b489e(0x7a)](),_0x1cbcd1=a63_0x286818['join'](_0x5e3ce5,PROJECT_CONFIG_FILENAME),_0x18b0eb=JSON[_0x4b489e(0x7e)](_0x2230e8);if(_0x18b0eb[_0x4b489e(0x73)](_0x4b489e(0x7b))||_0x18b0eb[_0x4b489e(0x73)]('apiKey')||_0x18b0eb[_0x4b489e(0x73)](_0x4b489e(0x6d)))throw new Error(_0x4b489e(0x70));if(_0x4b489e(0x75)in _0x2230e8)throw new Error(_0x4b489e(0x87));a63_0x247909['writeFileSync'](_0x1cbcd1,JSON[_0x4b489e(0x7e)](_0x2230e8,null,0x2));}function a63_0x228b(){const _0x1537f4=['readFileSync','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','code','218904nQKTYM','parse','3113670rxPUyC','76AsJJWm','existsSync','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','3932226KllbnI','2559410OooYKF','1AaZMVy','dirname','Failed\x20to\x20load\x20project\x20config\x20from\x20','7734792QqysEA','api_key','utf-8','33pDlWLP','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','Warning:\x20\x27profile\x27\x20field\x20in\x20','join','includes','3642DfhKWt','profile','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','warn','2780ZErNdj',').\x20','cwd','TD_API_KEY','ENOENT','38238vXMNCQ','stringify'];a63_0x228b=function(){return _0x1537f4;};return a63_0x228b();}export function hasProjectConfig(_0xbb92b9){return findProjectConfigPath(_0xbb92b9)!==null;}export function getProjectRoot(_0x293934){const _0x321616=a63_0x1a52,_0x578e99=findProjectConfigPath(_0x293934);return _0x578e99?a63_0x286818[_0x321616(0x8b)](_0x578e99):null;}
1
+ (function(_0x5efa74,_0x237e90){const _0x51eb1f=a63_0x14d9,_0x1232c3=_0x5efa74();while(!![]){try{const _0x560650=-parseInt(_0x51eb1f(0xb6))/0x1*(parseInt(_0x51eb1f(0xc4))/0x2)+-parseInt(_0x51eb1f(0xa7))/0x3*(-parseInt(_0x51eb1f(0xc1))/0x4)+-parseInt(_0x51eb1f(0xae))/0x5+parseInt(_0x51eb1f(0xab))/0x6*(parseInt(_0x51eb1f(0xac))/0x7)+-parseInt(_0x51eb1f(0xb7))/0x8+-parseInt(_0x51eb1f(0xbf))/0x9*(parseInt(_0x51eb1f(0xad))/0xa)+parseInt(_0x51eb1f(0xb2))/0xb*(parseInt(_0x51eb1f(0xbc))/0xc);if(_0x560650===_0x237e90)break;else _0x1232c3['push'](_0x1232c3['shift']());}catch(_0x146da2){_0x1232c3['push'](_0x1232c3['shift']());}}}(a63_0x4693,0xa32fe));function a63_0x14d9(_0x5c5b81,_0x2de7a6){_0x5c5b81=_0x5c5b81-0xa7;const _0x46934d=a63_0x4693();let _0x14d935=_0x46934d[_0x5c5b81];return _0x14d935;}import*as a63_0x579c82 from'node:fs';import*as a63_0xec9186 from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x127bdc){const _0x3bfb87=a63_0x14d9;let _0x41c7d6=_0x127bdc||process[_0x3bfb87(0xbd)]();while(!![]){const _0x4a6d74=a63_0xec9186[_0x3bfb87(0xb8)](_0x41c7d6,PROJECT_CONFIG_FILENAME);if(a63_0x579c82[_0x3bfb87(0xa9)](_0x4a6d74))return _0x4a6d74;const _0xfda61d=a63_0xec9186[_0x3bfb87(0xba)](_0x41c7d6);if(_0xfda61d===_0x41c7d6)return null;_0x41c7d6=_0xfda61d;}}export function loadProjectConfig(_0x34d161){const _0x4847fe=a63_0x14d9,_0x5b9cd2=findProjectConfigPath(_0x34d161);if(!_0x5b9cd2)return null;try{const _0x309b33=a63_0x579c82['readFileSync'](_0x5b9cd2,_0x4847fe(0xb0)),_0x239f94=JSON[_0x4847fe(0xbb)](_0x309b33),_0x7c0949=JSON[_0x4847fe(0xc3)](_0x239f94);if(_0x7c0949[_0x4847fe(0xb3)]('TD_API_KEY')||_0x7c0949[_0x4847fe(0xb3)]('apiKey')||_0x7c0949[_0x4847fe(0xb3)](_0x4847fe(0xaa)))throw new Error(_0x4847fe(0xb1)+_0x5b9cd2+').\x20'+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x454376,profile:_0x17f38d,..._0x3a0b02}=_0x239f94;return _0x17f38d&&console[_0x4847fe(0xaf)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x5b9cd2+_0x4847fe(0xa8)+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x3a0b02;}catch(_0x1d6dba){if(_0x1d6dba instanceof Error&&_0x4847fe(0xc5)in _0x1d6dba&&_0x1d6dba[_0x4847fe(0xc5)]==='ENOENT')return null;throw new Error(_0x4847fe(0xbe)+_0x5b9cd2+':\x20'+_0x1d6dba);}}export function saveProjectConfig(_0x523b33,_0x6036f2){const _0x1d22f6=a63_0x14d9,_0x2d60d4=_0x6036f2||process[_0x1d22f6(0xbd)](),_0x4eadab=a63_0xec9186['join'](_0x2d60d4,PROJECT_CONFIG_FILENAME),_0x36eb3d=JSON[_0x1d22f6(0xc3)](_0x523b33);if(_0x36eb3d[_0x1d22f6(0xb3)](_0x1d22f6(0xc0))||_0x36eb3d[_0x1d22f6(0xb3)]('apiKey')||_0x36eb3d[_0x1d22f6(0xb3)]('api_key'))throw new Error(_0x1d22f6(0xc2));if(_0x1d22f6(0xb9)in _0x523b33)throw new Error(_0x1d22f6(0xb4));a63_0x579c82[_0x1d22f6(0xb5)](_0x4eadab,JSON[_0x1d22f6(0xc3)](_0x523b33,null,0x2));}export function hasProjectConfig(_0x4f60c3){return findProjectConfigPath(_0x4f60c3)!==null;}export function getProjectRoot(_0x3698a4){const _0x96e350=findProjectConfigPath(_0x3698a4);return _0x96e350?a63_0xec9186['dirname'](_0x96e350):null;}function a63_0x4693(){const _0x3d0dc4=['12SWcXeO','cwd','Failed\x20to\x20load\x20project\x20config\x20from\x20','96804AiPTXE','TD_API_KEY','744404VHSGBO','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','stringify','4ztimsp','code','9PrQywO','\x20is\x20ignored.\x20','existsSync','api_key','13074lMjEbT','1106GVDNyQ','980GqQMeH','5708685okvRTE','warn','utf-8','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','39165929CenSXD','includes','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','writeFileSync','207814cTSsUF','9466056ipSEmR','join','profile','dirname','parse'];a63_0x4693=function(){return _0x3d0dc4;};return a63_0x4693();}
@@ -1 +1 @@
1
- (function(_0x10fe23,_0xfb0245){const _0x2130a1=a64_0x2000,_0x32fc87=_0x10fe23();while(!![]){try{const _0x5ed804=-parseInt(_0x2130a1(0x13a))/0x1*(-parseInt(_0x2130a1(0x141))/0x2)+parseInt(_0x2130a1(0x125))/0x3*(-parseInt(_0x2130a1(0x13c))/0x4)+-parseInt(_0x2130a1(0x123))/0x5+parseInt(_0x2130a1(0x13e))/0x6*(-parseInt(_0x2130a1(0x136))/0x7)+-parseInt(_0x2130a1(0x13f))/0x8+parseInt(_0x2130a1(0x127))/0x9*(parseInt(_0x2130a1(0x132))/0xa)+parseInt(_0x2130a1(0x11d))/0xb;if(_0x5ed804===_0xfb0245)break;else _0x32fc87['push'](_0x32fc87['shift']());}catch(_0x297151){_0x32fc87['push'](_0x32fc87['shift']());}}}(a64_0x3d9e,0x4ed78));function a64_0x2000(_0x508d69,_0x245b4c){_0x508d69=_0x508d69-0x11b;const _0x3d9e7f=a64_0x3d9e();let _0x2000d0=_0x3d9e7f[_0x508d69];return _0x2000d0;}import*as a64_0x4d8008 from'node:fs';import*as a64_0x596620 from'node:path';import*as a64_0x38dc44 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 _0x85cc11=a64_0x2000,_0x4d31db=process.env.TDX_CONFIG_DIR||a64_0x596620[_0x85cc11(0x140)](a64_0x38dc44[_0x85cc11(0x121)](),_0x85cc11(0x135),_0x85cc11(0x137));return a64_0x596620[_0x85cc11(0x140)](_0x4d31db,_0x85cc11(0x128));}function getSessionPath(_0x4667a1){const _0x492cd1=a64_0x2000;return a64_0x596620[_0x492cd1(0x140)](getSessionsDir(),_0x4667a1+_0x492cd1(0x11f));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x561c05){if(_0x561c05)return _0x561c05;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()['toString']();}export function loadSessionContext(_0x1231bd){const _0x1631ee=a64_0x2000,_0x3bc1f6=getSessionID(_0x1231bd),_0x122485=/^\d+$/[_0x1631ee(0x13b)](_0x3bc1f6)?parseInt(_0x3bc1f6,0xa):null;return _0x122485!==null?loadSessionContextByPID(_0x122485):loadSessionContextByString(_0x3bc1f6);}export function loadSessionContextByPID(_0x5f020f){const _0x59600b=a64_0x2000,_0x3e2abb=getSessionPath(_0x5f020f);if(!a64_0x4d8008[_0x59600b(0x126)](_0x3e2abb))return null;try{const _0x540b03=a64_0x4d8008['readFileSync'](_0x3e2abb,_0x59600b(0x142)),_0x18f5b6=JSON[_0x59600b(0x143)](_0x540b03),_0x10790d=new Date(_0x18f5b6[_0x59600b(0x13d)])[_0x59600b(0x11c)](),_0x40179c=Date[_0x59600b(0x12d)]();if(_0x40179c-_0x10790d>SESSION_EXPIRATION_MS)return a64_0x4d8008['unlinkSync'](_0x3e2abb),null;const _0x256e7b=JSON['stringify'](_0x18f5b6);if(_0x256e7b[_0x59600b(0x12f)](_0x59600b(0x129))||_0x256e7b['includes'](_0x59600b(0x12b))||_0x256e7b[_0x59600b(0x12f)](_0x59600b(0x124)))return console[_0x59600b(0x131)](_0x59600b(0x11e)+_0x3e2abb+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a64_0x4d8008['unlinkSync'](_0x3e2abb),null;return _0x18f5b6;}catch{try{a64_0x4d8008[_0x59600b(0x11b)](_0x3e2abb);}catch{}return null;}}function loadSessionContextByString(_0x1ca2b7){const _0x4d8352=a64_0x2000,_0x201e56=a64_0x596620[_0x4d8352(0x140)](getSessionsDir(),_0x1ca2b7+_0x4d8352(0x11f));if(!a64_0x4d8008['existsSync'](_0x201e56))return null;try{const _0x1cb3f7=a64_0x4d8008[_0x4d8352(0x139)](_0x201e56,'utf-8'),_0x41bc0c=JSON['parse'](_0x1cb3f7),_0x443b2d=new Date(_0x41bc0c[_0x4d8352(0x13d)])[_0x4d8352(0x11c)](),_0x3ee9ad=Date[_0x4d8352(0x12d)]();if(_0x3ee9ad-_0x443b2d>SESSION_EXPIRATION_MS)return a64_0x4d8008[_0x4d8352(0x11b)](_0x201e56),null;const _0xb49489=JSON['stringify'](_0x41bc0c);if(_0xb49489[_0x4d8352(0x12f)](_0x4d8352(0x129))||_0xb49489[_0x4d8352(0x12f)]('apiKey')||_0xb49489[_0x4d8352(0x12f)](_0x4d8352(0x124)))return console['warn']('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x201e56+_0x4d8352(0x12e)),a64_0x4d8008[_0x4d8352(0x11b)](_0x201e56),null;return _0x41bc0c;}catch{try{a64_0x4d8008[_0x4d8352(0x11b)](_0x201e56);}catch{}return null;}}export function saveSessionContext(_0x225bca,_0x177565){const _0x2f20e4=a64_0x2000,_0x327aa5=getSessionID(_0x177565),_0x48b439=/^\d+$/[_0x2f20e4(0x13b)](_0x327aa5)?parseInt(_0x327aa5,0xa):getCurrentSessionPID(),_0x22f581=a64_0x596620[_0x2f20e4(0x140)](getSessionsDir(),_0x327aa5+_0x2f20e4(0x11f)),_0x558298=getSessionsDir();createSecureDirectory(_0x558298);const _0x237e71=JSON[_0x2f20e4(0x130)](_0x225bca);if(_0x237e71['includes'](_0x2f20e4(0x129))||_0x237e71['includes'](_0x2f20e4(0x12b))||_0x237e71[_0x2f20e4(0x12f)](_0x2f20e4(0x124)))throw new Error(_0x2f20e4(0x12a));let _0x41b531;const _0x410655=/^\d+$/['test'](_0x327aa5)?loadSessionContextByPID(parseInt(_0x327aa5,0xa)):loadSessionContextByString(_0x327aa5);_0x410655?_0x41b531={..._0x410655,..._0x225bca,'pid':_0x48b439,'sessionId':_0x327aa5!==_0x48b439['toString']()?_0x327aa5:undefined,'updatedAt':new Date()['toISOString']()}:_0x41b531={'pid':_0x48b439,'sessionId':_0x327aa5!==_0x48b439[_0x2f20e4(0x12c)]()?_0x327aa5:undefined,..._0x225bca,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0x2f20e4(0x122)]()},a64_0x4d8008[_0x2f20e4(0x138)](_0x22f581,JSON['stringify'](_0x41b531,null,0x2));}function a64_0x3d9e(){const _0x93fcae=['test','50536XHgmHA','createdAt','4602jxDwHz','3223360wxtIYj','join','2THNBDP','utf-8','parse','unlinkSync','getTime','11356521cIicJc','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','.json','endsWith','homedir','toISOString','1140230rmUQnt','api_key','114TWDbFw','existsSync','6498NoFrgp','sessions','TD_API_KEY','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','apiKey','toString','now','.\x20This\x20is\x20insecure.\x20Removing\x20session.','includes','stringify','warn','3290TSSmUz','push','replace','.config','2751ZzeQSM','tdx','writeFileSync','readFileSync','465476QVWiQl'];a64_0x3d9e=function(){return _0x93fcae;};return a64_0x3d9e();}export function clearSessionContext(_0x1840f5){const _0xa1a076=a64_0x2000,_0x1788dc=getSessionID(_0x1840f5),_0x268405=a64_0x596620[_0xa1a076(0x140)](getSessionsDir(),_0x1788dc+_0xa1a076(0x11f));a64_0x4d8008[_0xa1a076(0x126)](_0x268405)&&a64_0x4d8008[_0xa1a076(0x11b)](_0x268405);}export function clearSessionContextField(_0x31a003,_0x2a0589){const _0x23b8c0=a64_0x2000,_0x981b08=getSessionID(_0x2a0589),_0x133171=a64_0x596620['join'](getSessionsDir(),_0x981b08+_0x23b8c0(0x11f));if(!a64_0x4d8008[_0x23b8c0(0x126)](_0x133171))return;try{const _0x6aea50=a64_0x4d8008['readFileSync'](_0x133171,_0x23b8c0(0x142)),_0x472196=JSON['parse'](_0x6aea50);delete _0x472196[_0x31a003],a64_0x4d8008[_0x23b8c0(0x138)](_0x133171,JSON[_0x23b8c0(0x130)](_0x472196,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x2a0d05=a64_0x2000,_0x11db9d=getSessionsDir();if(!a64_0x4d8008[_0x2a0d05(0x126)](_0x11db9d))return 0x0;let _0x51ec95=0x0;const _0x50eeef=Date[_0x2a0d05(0x12d)]();try{const _0xc3e2a9=a64_0x4d8008['readdirSync'](_0x11db9d);for(const _0x1c77f5 of _0xc3e2a9){if(!_0x1c77f5[_0x2a0d05(0x120)]('.json'))continue;const _0x4f6a8e=a64_0x596620['join'](_0x11db9d,_0x1c77f5),_0x151c03=_0x1c77f5['replace'](_0x2a0d05(0x11f),''),_0x592167=parseInt(_0x151c03,0xa),_0x4cb455=!isNaN(_0x592167);if(_0x4cb455){if(!isProcessRunning(_0x592167)){a64_0x4d8008[_0x2a0d05(0x11b)](_0x4f6a8e),_0x51ec95++;continue;}}try{const _0x1c63d5=a64_0x4d8008[_0x2a0d05(0x139)](_0x4f6a8e,'utf-8'),_0x2dd9c9=JSON[_0x2a0d05(0x143)](_0x1c63d5),_0x2dbc26=new Date(_0x2dd9c9[_0x2a0d05(0x13d)])[_0x2a0d05(0x11c)]();_0x50eeef-_0x2dbc26>SESSION_EXPIRATION_MS&&(a64_0x4d8008['unlinkSync'](_0x4f6a8e),_0x51ec95++);}catch{a64_0x4d8008[_0x2a0d05(0x11b)](_0x4f6a8e),_0x51ec95++;}}}catch{}return _0x51ec95;}export function listActiveSessions(){const _0xd74c0a=a64_0x2000,_0x3573fc=getSessionsDir();if(!a64_0x4d8008['existsSync'](_0x3573fc))return[];try{const _0x6e4036=a64_0x4d8008['readdirSync'](_0x3573fc),_0x2638f4=[];for(const _0x445c5b of _0x6e4036){if(!_0x445c5b[_0xd74c0a(0x120)](_0xd74c0a(0x11f)))continue;const _0x99af0c=_0x445c5b[_0xd74c0a(0x134)]('.json',''),_0x3c557b=parseInt(_0x99af0c,0xa);!isNaN(_0x3c557b)&&isProcessRunning(_0x3c557b)&&_0x2638f4[_0xd74c0a(0x133)](_0x3c557b);}return _0x2638f4['sort']((_0x1f844c,_0x70e3a0)=>_0x1f844c-_0x70e3a0);}catch{return[];}}
1
+ function a64_0x1796(_0x17d0f3,_0x238722){_0x17d0f3=_0x17d0f3-0xa8;const _0x364eba=a64_0x364e();let _0x179641=_0x364eba[_0x17d0f3];return _0x179641;}(function(_0x3c9071,_0x8f1e06){const _0x42364=a64_0x1796,_0x2fa70d=_0x3c9071();while(!![]){try{const _0x59e380=-parseInt(_0x42364(0xb4))/0x1*(parseInt(_0x42364(0xb2))/0x2)+-parseInt(_0x42364(0xce))/0x3*(-parseInt(_0x42364(0xc0))/0x4)+parseInt(_0x42364(0xab))/0x5+parseInt(_0x42364(0xaa))/0x6*(parseInt(_0x42364(0xbf))/0x7)+-parseInt(_0x42364(0xac))/0x8+-parseInt(_0x42364(0xcf))/0x9+parseInt(_0x42364(0xbb))/0xa*(parseInt(_0x42364(0xc1))/0xb);if(_0x59e380===_0x8f1e06)break;else _0x2fa70d['push'](_0x2fa70d['shift']());}catch(_0x4ca7a4){_0x2fa70d['push'](_0x2fa70d['shift']());}}}(a64_0x364e,0x8c2dd));import*as a64_0x5a4fb4 from'node:fs';import*as a64_0xdf1ae4 from'node:path';function a64_0x364e(){const _0x1ddd10=['2746300qImyrN','3288768atPwLI','warn','now','readFileSync','homedir','.\x20This\x20is\x20insecure.\x20Removing\x20session.','64BtalWF','stringify','5848pqPeYk','existsSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','toString','readdirSync','unlinkSync','.json','320HfoYpx','includes','toISOString','TD_API_KEY','245175pBacyZ','10624jKDKJy','192467SSkDOV','replace','join','createdAt','sessions','sort','endsWith','test','api_key','writeFileSync','getTime','parse','apiKey','3aZLmvE','1030860rgXPyk','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','utf-8','30HmPONe'];a64_0x364e=function(){return _0x1ddd10;};return a64_0x364e();}import*as a64_0xf26ded 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 _0x59bfc2=a64_0x1796,_0x41141c=process.env.TDX_CONFIG_DIR||a64_0xdf1ae4[_0x59bfc2(0xc3)](a64_0xf26ded[_0x59bfc2(0xb0)](),'.config','tdx');return a64_0xdf1ae4['join'](_0x41141c,_0x59bfc2(0xc5));}function getSessionPath(_0x64faa1){const _0x2cfbe7=a64_0x1796;return a64_0xdf1ae4['join'](getSessionsDir(),_0x64faa1+_0x2cfbe7(0xba));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x55ac70){const _0x393b90=a64_0x1796;if(_0x55ac70)return _0x55ac70;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x393b90(0xb7)]();}export function loadSessionContext(_0xc9416d){const _0x1e9ca9=a64_0x1796,_0x107775=getSessionID(_0xc9416d),_0x4a9e81=/^\d+$/[_0x1e9ca9(0xc8)](_0x107775)?parseInt(_0x107775,0xa):null;return _0x4a9e81!==null?loadSessionContextByPID(_0x4a9e81):loadSessionContextByString(_0x107775);}export function loadSessionContextByPID(_0x4a232b){const _0x4d856e=a64_0x1796,_0x3f1457=getSessionPath(_0x4a232b);if(!a64_0x5a4fb4['existsSync'](_0x3f1457))return null;try{const _0x204bbd=a64_0x5a4fb4[_0x4d856e(0xaf)](_0x3f1457,_0x4d856e(0xa9)),_0x47f005=JSON[_0x4d856e(0xcc)](_0x204bbd),_0x310321=new Date(_0x47f005[_0x4d856e(0xc4)])['getTime'](),_0x196b9c=Date['now']();if(_0x196b9c-_0x310321>SESSION_EXPIRATION_MS)return a64_0x5a4fb4[_0x4d856e(0xb9)](_0x3f1457),null;const _0x361fe=JSON[_0x4d856e(0xb3)](_0x47f005);if(_0x361fe[_0x4d856e(0xbc)](_0x4d856e(0xbe))||_0x361fe[_0x4d856e(0xbc)]('apiKey')||_0x361fe[_0x4d856e(0xbc)]('api_key'))return console['warn']('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x3f1457+_0x4d856e(0xb1)),a64_0x5a4fb4[_0x4d856e(0xb9)](_0x3f1457),null;return _0x47f005;}catch{try{a64_0x5a4fb4['unlinkSync'](_0x3f1457);}catch{}return null;}}function loadSessionContextByString(_0x519953){const _0x2c2071=a64_0x1796,_0x4263d6=a64_0xdf1ae4['join'](getSessionsDir(),_0x519953+_0x2c2071(0xba));if(!a64_0x5a4fb4[_0x2c2071(0xb5)](_0x4263d6))return null;try{const _0x5b4226=a64_0x5a4fb4[_0x2c2071(0xaf)](_0x4263d6,'utf-8'),_0x1320b7=JSON[_0x2c2071(0xcc)](_0x5b4226),_0x56dbb2=new Date(_0x1320b7[_0x2c2071(0xc4)])['getTime'](),_0x136568=Date['now']();if(_0x136568-_0x56dbb2>SESSION_EXPIRATION_MS)return a64_0x5a4fb4[_0x2c2071(0xb9)](_0x4263d6),null;const _0x45c947=JSON[_0x2c2071(0xb3)](_0x1320b7);if(_0x45c947[_0x2c2071(0xbc)](_0x2c2071(0xbe))||_0x45c947[_0x2c2071(0xbc)](_0x2c2071(0xcd))||_0x45c947[_0x2c2071(0xbc)](_0x2c2071(0xc9)))return console[_0x2c2071(0xad)](_0x2c2071(0xb6)+_0x4263d6+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a64_0x5a4fb4[_0x2c2071(0xb9)](_0x4263d6),null;return _0x1320b7;}catch{try{a64_0x5a4fb4['unlinkSync'](_0x4263d6);}catch{}return null;}}export function saveSessionContext(_0x52fb71,_0x444aca){const _0x1487af=a64_0x1796,_0x30421e=getSessionID(_0x444aca),_0x246b3b=/^\d+$/[_0x1487af(0xc8)](_0x30421e)?parseInt(_0x30421e,0xa):getCurrentSessionPID(),_0x421668=a64_0xdf1ae4[_0x1487af(0xc3)](getSessionsDir(),_0x30421e+_0x1487af(0xba)),_0x689245=getSessionsDir();createSecureDirectory(_0x689245);const _0x48669d=JSON['stringify'](_0x52fb71);if(_0x48669d[_0x1487af(0xbc)](_0x1487af(0xbe))||_0x48669d[_0x1487af(0xbc)](_0x1487af(0xcd))||_0x48669d[_0x1487af(0xbc)](_0x1487af(0xc9)))throw new Error(_0x1487af(0xa8));let _0x118080;const _0x11580d=/^\d+$/[_0x1487af(0xc8)](_0x30421e)?loadSessionContextByPID(parseInt(_0x30421e,0xa)):loadSessionContextByString(_0x30421e);_0x11580d?_0x118080={..._0x11580d,..._0x52fb71,'pid':_0x246b3b,'sessionId':_0x30421e!==_0x246b3b['toString']()?_0x30421e:undefined,'updatedAt':new Date()[_0x1487af(0xbd)]()}:_0x118080={'pid':_0x246b3b,'sessionId':_0x30421e!==_0x246b3b[_0x1487af(0xb7)]()?_0x30421e:undefined,..._0x52fb71,'createdAt':new Date()[_0x1487af(0xbd)](),'updatedAt':new Date()['toISOString']()},a64_0x5a4fb4[_0x1487af(0xca)](_0x421668,JSON[_0x1487af(0xb3)](_0x118080,null,0x2));}export function clearSessionContext(_0x138758){const _0x2f3e58=a64_0x1796,_0x31a776=getSessionID(_0x138758),_0x22b270=a64_0xdf1ae4[_0x2f3e58(0xc3)](getSessionsDir(),_0x31a776+'.json');a64_0x5a4fb4[_0x2f3e58(0xb5)](_0x22b270)&&a64_0x5a4fb4[_0x2f3e58(0xb9)](_0x22b270);}export function clearSessionContextField(_0x10c205,_0x59eb94){const _0x3e3f03=a64_0x1796,_0x193f64=getSessionID(_0x59eb94),_0x298575=a64_0xdf1ae4[_0x3e3f03(0xc3)](getSessionsDir(),_0x193f64+_0x3e3f03(0xba));if(!a64_0x5a4fb4['existsSync'](_0x298575))return;try{const _0x29d161=a64_0x5a4fb4['readFileSync'](_0x298575,_0x3e3f03(0xa9)),_0x5ef560=JSON[_0x3e3f03(0xcc)](_0x29d161);delete _0x5ef560[_0x10c205],a64_0x5a4fb4['writeFileSync'](_0x298575,JSON[_0x3e3f03(0xb3)](_0x5ef560,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x6dfc5d=a64_0x1796,_0x48cad9=getSessionsDir();if(!a64_0x5a4fb4['existsSync'](_0x48cad9))return 0x0;let _0x4ec3c6=0x0;const _0x4a8696=Date[_0x6dfc5d(0xae)]();try{const _0x32fabd=a64_0x5a4fb4[_0x6dfc5d(0xb8)](_0x48cad9);for(const _0x216d0a of _0x32fabd){if(!_0x216d0a[_0x6dfc5d(0xc7)](_0x6dfc5d(0xba)))continue;const _0x3b968b=a64_0xdf1ae4[_0x6dfc5d(0xc3)](_0x48cad9,_0x216d0a),_0x243c12=_0x216d0a[_0x6dfc5d(0xc2)]('.json',''),_0x57d812=parseInt(_0x243c12,0xa),_0x45bd2=!isNaN(_0x57d812);if(_0x45bd2){if(!isProcessRunning(_0x57d812)){a64_0x5a4fb4['unlinkSync'](_0x3b968b),_0x4ec3c6++;continue;}}try{const _0x24c933=a64_0x5a4fb4['readFileSync'](_0x3b968b,_0x6dfc5d(0xa9)),_0x55a922=JSON[_0x6dfc5d(0xcc)](_0x24c933),_0x330c40=new Date(_0x55a922[_0x6dfc5d(0xc4)])[_0x6dfc5d(0xcb)]();_0x4a8696-_0x330c40>SESSION_EXPIRATION_MS&&(a64_0x5a4fb4[_0x6dfc5d(0xb9)](_0x3b968b),_0x4ec3c6++);}catch{a64_0x5a4fb4[_0x6dfc5d(0xb9)](_0x3b968b),_0x4ec3c6++;}}}catch{}return _0x4ec3c6;}export function listActiveSessions(){const _0x550db0=a64_0x1796,_0x17b95b=getSessionsDir();if(!a64_0x5a4fb4['existsSync'](_0x17b95b))return[];try{const _0x463218=a64_0x5a4fb4[_0x550db0(0xb8)](_0x17b95b),_0x2ac6c7=[];for(const _0x4f67a6 of _0x463218){if(!_0x4f67a6[_0x550db0(0xc7)](_0x550db0(0xba)))continue;const _0x5d95e8=_0x4f67a6[_0x550db0(0xc2)](_0x550db0(0xba),''),_0x596f05=parseInt(_0x5d95e8,0xa);!isNaN(_0x596f05)&&isProcessRunning(_0x596f05)&&_0x2ac6c7['push'](_0x596f05);}return _0x2ac6c7[_0x550db0(0xc6)]((_0x30489d,_0x174e6c)=>_0x30489d-_0x174e6c);}catch{return[];}}
@@ -1 +1 @@
1
- const a65_0x116563=a65_0x4dac;(function(_0x305e8e,_0x28103f){const _0xe610f1=a65_0x4dac,_0x2cd041=_0x305e8e();while(!![]){try{const _0x111701=-parseInt(_0xe610f1(0x17c))/0x1+-parseInt(_0xe610f1(0x17e))/0x2*(parseInt(_0xe610f1(0x180))/0x3)+-parseInt(_0xe610f1(0x17f))/0x4*(-parseInt(_0xe610f1(0x186))/0x5)+-parseInt(_0xe610f1(0x179))/0x6*(-parseInt(_0xe610f1(0x181))/0x7)+-parseInt(_0xe610f1(0x184))/0x8+-parseInt(_0xe610f1(0x178))/0x9*(-parseInt(_0xe610f1(0x17a))/0xa)+parseInt(_0xe610f1(0x188))/0xb*(parseInt(_0xe610f1(0x17b))/0xc);if(_0x111701===_0x28103f)break;else _0x2cd041['push'](_0x2cd041['shift']());}catch(_0x3e91bb){_0x2cd041['push'](_0x2cd041['shift']());}}}(a65_0x3080,0x734f0));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a65_0x116563(0x17d),a65_0x116563(0x187));export function loadCachedUsers(_0x32edc1){const _0x26349a=a65_0x116563,_0x5d7a9b=userCache[_0x26349a(0x185)](_0x32edc1);return _0x5d7a9b?.['users']??null;}export function saveCachedUsers(_0x336d5d,_0x5d1aa1){const _0x2bf7ff=a65_0x116563;userCache[_0x2bf7ff(0x182)](_0x336d5d,{'users':_0x5d1aa1,'cachedAt':Date['now']()});}export function clearUserCache(_0x423f2e){const _0x2399b3=a65_0x116563;userCache[_0x2399b3(0x183)](_0x423f2e);}function a65_0x4dac(_0x3bbada,_0x38ddc6){_0x3bbada=_0x3bbada-0x178;const _0x30802a=a65_0x3080();let _0x4dacfb=_0x30802a[_0x3bbada];return _0x4dacfb;}function a65_0x3080(){const _0x49ab79=['550KhVotE','8GfMrvj','8490sQrUrS','333781xnuuNV','write','clear','5661608MQKqXf','read','444305LXogSc','core/user-cache','11vJOzJl','253809BJqBve','42icIxDc','140bYHRmz','23322996VgWdOP','891645ajaoTK','users-{profile}.json'];a65_0x3080=function(){return _0x49ab79;};return a65_0x3080();}
1
+ function a65_0x1e52(){const _0xe43f95=['9DdQLOR','1287884WAzmSg','users','clear','16333624ikJYGG','2123336xNKCbr','3556885RGKmHw','core/user-cache','4856156ksZxvf','2387182GZgFjW','344328LPmUlz','3hoKIYf'];a65_0x1e52=function(){return _0xe43f95;};return a65_0x1e52();}const a65_0x22f437=a65_0x2ed9;(function(_0x89f5b0,_0x1a4f56){const _0x4d51ec=a65_0x2ed9,_0x5c33cf=_0x89f5b0();while(!![]){try{const _0x311b23=parseInt(_0x4d51ec(0x165))/0x1+-parseInt(_0x4d51ec(0x169))/0x2+-parseInt(_0x4d51ec(0x16f))/0x3*(parseInt(_0x4d51ec(0x16c))/0x4)+-parseInt(_0x4d51ec(0x16a))/0x5+parseInt(_0x4d51ec(0x16e))/0x6+parseInt(_0x4d51ec(0x16d))/0x7+-parseInt(_0x4d51ec(0x168))/0x8*(-parseInt(_0x4d51ec(0x164))/0x9);if(_0x311b23===_0x1a4f56)break;else _0x5c33cf['push'](_0x5c33cf['shift']());}catch(_0x242e6a){_0x5c33cf['push'](_0x5c33cf['shift']());}}}(a65_0x1e52,0xb4e35));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache('users-{profile}.json',a65_0x22f437(0x16b));function a65_0x2ed9(_0x378f5f,_0x33327d){_0x378f5f=_0x378f5f-0x164;const _0x1e5265=a65_0x1e52();let _0x2ed98b=_0x1e5265[_0x378f5f];return _0x2ed98b;}export function loadCachedUsers(_0x3f7d67){const _0x483dd1=a65_0x22f437,_0xbe03eb=userCache['read'](_0x3f7d67);return _0xbe03eb?.[_0x483dd1(0x166)]??null;}export function saveCachedUsers(_0x4955fe,_0x447c7b){userCache['write'](_0x4955fe,{'users':_0x447c7b,'cachedAt':Date['now']()});}export function clearUserCache(_0x57b37b){const _0x3b01c6=a65_0x22f437;userCache[_0x3b01c6(0x167)](_0x57b37b);}
@@ -1 +1 @@
1
- (function(_0x13e3c0,_0x254181){const _0x484a76=a66_0x32b7,_0x3d0374=_0x13e3c0();while(!![]){try{const _0x46cc20=parseInt(_0x484a76(0x1f7))/0x1*(-parseInt(_0x484a76(0x1f0))/0x2)+parseInt(_0x484a76(0x1f9))/0x3*(parseInt(_0x484a76(0x1eb))/0x4)+-parseInt(_0x484a76(0x1f1))/0x5+parseInt(_0x484a76(0x1f8))/0x6*(-parseInt(_0x484a76(0x1f5))/0x7)+-parseInt(_0x484a76(0x1ec))/0x8*(parseInt(_0x484a76(0x1f6))/0x9)+parseInt(_0x484a76(0x1ef))/0xa+-parseInt(_0x484a76(0x1f3))/0xb*(-parseInt(_0x484a76(0x1e9))/0xc);if(_0x46cc20===_0x254181)break;else _0x3d0374['push'](_0x3d0374['shift']());}catch(_0x3e653d){_0x3d0374['push'](_0x3d0374['shift']());}}}(a66_0x3f07,0xc3de0));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;function a66_0x3f07(){const _0x12af4e=['2431953uCmYTh','128768tesGGK','416496ImFFKI','638103kbJFla','0.0.0','../../package.json','24mhOjLt','../build-info.json','28WfJuUb','24PxWkUL','includes','utf-8','4653540aOEOXi','8gHpZcz','2461340ShCytt','parse','10535195Ovoceu','version','126QaquCl'];a66_0x3f07=function(){return _0x12af4e;};return a66_0x3f07();}export function getBuildInfo(){const _0x163d76=a66_0x32b7;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x290845=fileURLToPath(import.meta.url),_0x419003=dirname(_0x290845);try{const _0x3836a9=join(_0x419003,_0x163d76(0x1ea));cachedBuildInfo=JSON[_0x163d76(0x1f2)](readFileSync(_0x3836a9,_0x163d76(0x1ee)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x27af3f=a66_0x32b7;if(cachedVersion!==null)return cachedVersion;const _0x1a3e32=fileURLToPath(import.meta.url),_0x585403=dirname(_0x1a3e32),_0x15fbf5=getBuildInfo();if(_0x15fbf5[_0x27af3f(0x1f4)])return cachedVersion=_0x15fbf5[_0x27af3f(0x1f4)],cachedVersion;try{const _0x150f0a=join(_0x585403,_0x27af3f(0x1e8)),_0x5d6b2e=JSON[_0x27af3f(0x1f2)](readFileSync(_0x150f0a,_0x27af3f(0x1ee)));cachedVersion=_0x5d6b2e['version'];}catch{cachedVersion=_0x27af3f(0x1e7);}return cachedVersion;}function a66_0x32b7(_0x25d179,_0x103f62){_0x25d179=_0x25d179-0x1e7;const _0x3f0779=a66_0x3f07();let _0x32b788=_0x3f0779[_0x25d179];return _0x32b788;}export function isDevVersion(){const _0x51b763=a66_0x32b7,_0x454043=getVersion();return _0x454043[_0x51b763(0x1ed)]('.dev')||_0x454043['includes']('-');}
1
+ (function(_0x3d1f26,_0x23a76b){const _0x17930f=a66_0x3c3b,_0x14158a=_0x3d1f26();while(!![]){try{const _0x1099de=-parseInt(_0x17930f(0x178))/0x1+-parseInt(_0x17930f(0x174))/0x2*(parseInt(_0x17930f(0x17c))/0x3)+parseInt(_0x17930f(0x16d))/0x4*(parseInt(_0x17930f(0x175))/0x5)+-parseInt(_0x17930f(0x176))/0x6*(-parseInt(_0x17930f(0x172))/0x7)+-parseInt(_0x17930f(0x16e))/0x8*(parseInt(_0x17930f(0x170))/0x9)+parseInt(_0x17930f(0x17b))/0xa+parseInt(_0x17930f(0x17a))/0xb;if(_0x1099de===_0x23a76b)break;else _0x14158a['push'](_0x14158a['shift']());}catch(_0x1edeb5){_0x14158a['push'](_0x14158a['shift']());}}}(a66_0x501e,0xab35f));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0xacbdd0=a66_0x3c3b;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x5ae960=fileURLToPath(import.meta.url),_0x1c32e6=dirname(_0x5ae960);try{const _0x43e8e5=join(_0x1c32e6,_0xacbdd0(0x16c));cachedBuildInfo=JSON[_0xacbdd0(0x17d)](readFileSync(_0x43e8e5,'utf-8'));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x13a79c=a66_0x3c3b;if(cachedVersion!==null)return cachedVersion;const _0x53a742=fileURLToPath(import.meta.url),_0x1ce0ef=dirname(_0x53a742),_0x50c3c8=getBuildInfo();if(_0x50c3c8[_0x13a79c(0x173)])return cachedVersion=_0x50c3c8[_0x13a79c(0x173)],cachedVersion;try{const _0x4e3c97=join(_0x1ce0ef,_0x13a79c(0x179)),_0x1fe56d=JSON['parse'](readFileSync(_0x4e3c97,'utf-8'));cachedVersion=_0x1fe56d[_0x13a79c(0x173)];}catch{cachedVersion=_0x13a79c(0x177);}return cachedVersion;}function a66_0x3c3b(_0x17ed4a,_0x4e19bc){_0x17ed4a=_0x17ed4a-0x16c;const _0x501e34=a66_0x501e();let _0x3c3b2e=_0x501e34[_0x17ed4a];return _0x3c3b2e;}export function isDevVersion(){const _0x51f8f5=a66_0x3c3b,_0x1ac446=getVersion();return _0x1ac446[_0x51f8f5(0x16f)](_0x51f8f5(0x171))||_0x1ac446[_0x51f8f5(0x16f)]('-');}function a66_0x501e(){const _0x126205=['../build-info.json','28VVCUWF','184RgcsfM','includes','499689bYmsWH','.dev','14BFvQPJ','version','3346HOuqAH','239495JnuDOL','1880058LNAEod','0.0.0','669798LiCvHV','../../package.json','21538792tHztEt','8221510YqaXCy','1962lAzHnb','parse'];a66_0x501e=function(){return _0x126205;};return a66_0x501e();}