@treasuredata/tdx 2026.3.29 → 2026.3.30

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 (203) 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/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a55_0x322d1f=a55_0x3b87;(function(_0x4cda37,_0x3b8e04){const _0x4218ec=a55_0x3b87,_0x1c70ba=_0x4cda37();while(!![]){try{const _0x1903d4=parseInt(_0x4218ec(0x19b))/0x1*(parseInt(_0x4218ec(0x1b4))/0x2)+-parseInt(_0x4218ec(0x1c7))/0x3*(parseInt(_0x4218ec(0x1a0))/0x4)+-parseInt(_0x4218ec(0x1b8))/0x5+-parseInt(_0x4218ec(0x196))/0x6+parseInt(_0x4218ec(0x1b5))/0x7*(-parseInt(_0x4218ec(0x1de))/0x8)+parseInt(_0x4218ec(0x1a6))/0x9*(parseInt(_0x4218ec(0x194))/0xa)+parseInt(_0x4218ec(0x1d0))/0xb;if(_0x1903d4===_0x3b8e04)break;else _0x1c70ba['push'](_0x1c70ba['shift']());}catch(_0x2fe35c){_0x1c70ba['push'](_0x1c70ba['shift']());}}}(a55_0x2caa,0x748c7));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a55_0x287711 from'node:fs';import*as a55_0x46062e 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 a55_0x361d00 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x1a026a=a55_0x3b87;return process.env.TDX_CONFIG_DIR||join(homedir(),'.config',_0x1a026a(0x1b6));}export function getConfigFile(){const _0x535cb0=a55_0x3b87;return join(getConfigDir(),_0x535cb0(0x195));}export function getConfigFilePath(_0x5a26c7){const _0x31fd27=a55_0x3b87,_0x482b38=getConfigDir();return _0x5a26c7?a55_0x46062e[_0x31fd27(0x1ba)](_0x482b38,'.env.'+_0x5a26c7):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a55_0x322d1f(0x1b9),'config/llm-project');export function getLLMProjectCacheFile(_0x3d9c1d){const _0x381ddf=a55_0x322d1f;return llmProjectCache[_0x381ddf(0x1ca)](_0x3d9c1d);}function a55_0x2caa(){const _0x4ba683=['⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','account_info','parse','ap02','873suXSID','yellow','entries','endsWith','slice','trim','projectId','config/account-info','stg-us01','includes','name','tdx.json','stg-ap03','accountId','4iTVibs','567MFOEWz','tdx','filter','3520890nIieeQ','llm_default_project','join','accessToken','utf-8','proxy','next','TDX_API_KEY_','profile','write','stable','toUpperCase','replace','config/llm-agent','apiKeys','345843ZyCQTb','warn','Warning:\x20Failed\x20to\x20read\x20','path','map','existsSync','ap03','TDX_ACCESS_TOKEN_','apiKey','14395062NbnSUA','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','clear','release_channel','ap01','site','dev-eu01','dev-us01','number','\x27,\x20defaulting\x20to\x20us01','startsWith','read','TDX_ACCESS_TOKEN\x20env\x20var','.json','47368kAyYza','toISOString','72410CQnenh','.env','1421976KSfFze','keychain\x20(profile:\x20','readFileSync','match','stringify','231772McJEDP','keychain','split','string','us01','20iSzwSG','\x20env\x20var'];a55_0x2caa=function(){return _0x4ba683;};return a55_0x2caa();}export function readCachedLLMProject(_0x41c373){const _0x28ec0c=a55_0x322d1f,_0x451cdc=llmProjectCache[_0x28ec0c(0x1db)](_0x41c373);if(_0x451cdc&&typeof _0x451cdc['id']===_0x28ec0c(0x19e)&&typeof _0x451cdc['name']===_0x28ec0c(0x19e))return _0x451cdc;return null;}export function writeCachedLLMProject(_0x521977,_0x5ba922,_0x2d4d1b){try{llmProjectCache['write']({'name':_0x521977,'id':_0x5ba922},_0x2d4d1b);}catch{}}const llmAgentCache=createOptionalProfileCache('llm_default_agent',a55_0x322d1f(0x1c5));export function getLLMAgentCacheFile(_0x574a40){return llmAgentCache['path'](_0x574a40);}export function readCachedLLMAgent(_0x540ece){const _0x341962=a55_0x322d1f,_0x150e0f=llmAgentCache['read'](_0x540ece);if(_0x150e0f&&typeof _0x150e0f['id']===_0x341962(0x19e)&&typeof _0x150e0f[_0x341962(0x1b0)]===_0x341962(0x19e)&&typeof _0x150e0f[_0x341962(0x1ac)]===_0x341962(0x19e))return _0x150e0f;return null;}export function writeCachedLLMAgent(_0x4715c2,_0x3c433f,_0xf45934,_0x1aff86){const _0x52c6cb=a55_0x322d1f;try{llmAgentCache[_0x52c6cb(0x1c1)]({'name':_0x4715c2,'id':_0x3c433f,'projectId':_0xf45934},_0x1aff86);}catch{}}export function clearCachedLLMAgent(_0x30adb3){const _0x500488=a55_0x322d1f;try{llmAgentCache[_0x500488(0x1d2)](_0x30adb3);}catch{}}const accountInfoCache=createOptionalProfileCache(a55_0x322d1f(0x1a3),a55_0x322d1f(0x1ad),{'suffix':a55_0x322d1f(0x1dd)});export function getAccountInfoCacheFile(_0x2290df){const _0x535c88=a55_0x322d1f;return accountInfoCache[_0x535c88(0x1ca)](_0x2290df);}export function readCachedAccountInfo(_0x28e501){const _0x41d34e=a55_0x322d1f,_0x581c47=accountInfoCache[_0x41d34e(0x1db)](_0x28e501);if(_0x581c47&&typeof _0x581c47[_0x41d34e(0x1d5)]==='string'&&typeof _0x581c47[_0x41d34e(0x1b3)]===_0x41d34e(0x1d8))return _0x581c47;return null;}export function writeCachedAccountInfo(_0xe00096,_0x54959f,_0x55595c){const _0x41daf1=a55_0x322d1f;try{accountInfoCache[_0x41daf1(0x1c1)]({'site':_0xe00096,'accountId':_0x54959f,'cachedAt':new Date()[_0x41daf1(0x1df)]()},_0x55595c);}catch{}}export function parseEnvFile(_0x3ad4c4){const _0x527e17=a55_0x322d1f,_0x2bac7d={};for(const _0x4c9d4b of _0x3ad4c4[_0x527e17(0x19d)]('\x0a')){const _0x5d1981=_0x4c9d4b[_0x527e17(0x1ab)]();if(!_0x5d1981||_0x5d1981[_0x527e17(0x1da)]('#'))continue;const _0x355294=_0x5d1981[_0x527e17(0x199)](/^([^=]+)=(.*)$/);if(_0x355294){const _0x4a4107=_0x355294[0x1][_0x527e17(0x1ab)]();let _0x324bf2=_0x355294[0x2]['trim']();(_0x324bf2['startsWith']('\x22')&&_0x324bf2[_0x527e17(0x1a9)]('\x22')||_0x324bf2[_0x527e17(0x1da)]('\x27')&&_0x324bf2['endsWith']('\x27'))&&(_0x324bf2=_0x324bf2[_0x527e17(0x1aa)](0x1,-0x1)),_0x2bac7d[_0x4a4107]=_0x324bf2;}}return _0x2bac7d;}export function readUserConfig(){const _0x177c58=a55_0x322d1f,_0x138116=getConfigFile();if(!existsSync(_0x138116))return{};try{const _0x2bbe29=readFileSync(_0x138116,_0x177c58(0x1bc));return parseEnvFile(_0x2bbe29);}catch(_0x26ef63){return console['warn'](_0x177c58(0x1d1)+_0x138116+':',_0x26ef63),{};}}export function resolveSite(_0x26e1d6){const _0x25ed7e=a55_0x322d1f,_0x586fca=[_0x25ed7e(0x19f),'ap01','eu01',_0x25ed7e(0x1a5),'ap03',_0x25ed7e(0x1d7),_0x25ed7e(0x1d6),_0x25ed7e(0x1ae),'stg-ap01',_0x25ed7e(0x1b2)];if(_0x586fca[_0x25ed7e(0x1af)](_0x26e1d6))return _0x26e1d6;if(_0x26e1d6 in SITE_ALIASES)return SITE_ALIASES[_0x26e1d6];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x26e1d6+_0x25ed7e(0x1d9)),_0x25ed7e(0x19f);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}function a55_0x3b87(_0x39033b,_0x5030a1){_0x39033b=_0x39033b-0x194;const _0x2caa2b=a55_0x2caa();let _0x3b8790=_0x2caa2b[_0x39033b];return _0x3b8790;}export function resolveAccessToken(_0x53c2ae){const _0x2550a5=a55_0x322d1f,_0x43d585=_0x53c2ae||getActiveProfileName()||undefined;if(_0x43d585){const _0x2a6b90=_0x2550a5(0x1ce)+normalizeProfileForEnvVar(_0x43d585);if(process.env[_0x2a6b90])return{'accessToken':process.env[_0x2a6b90],'source':_0x2a6b90+_0x2550a5(0x1a1)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x2550a5(0x1dc)};return null;}export function getAccessToken(_0x5d341e){return resolveAccessToken(_0x5d341e)?.['accessToken'];}export function getAPIKey(_0x10d1cb){const _0xcb8eba=a55_0x322d1f,_0x860113=_0x10d1cb||getActiveProfileName();if(_0x860113){const _0x26b55a=_0xcb8eba(0x1bf)+normalizeProfileForEnvVar(_0x860113);if(process.env[_0x26b55a])return process.env[_0x26b55a];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x59d84b){const _0x229ca5=a55_0x322d1f;return _0x59d84b[_0x229ca5(0x1c3)]()[_0x229ca5(0x1c4)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x2d5a61,_0xee3ae7){const _0x47c091=a55_0x322d1f,_0x25a5f6=resolveAccessToken(_0xee3ae7);if(_0x25a5f6)return{'apiKey':_0x25a5f6[_0x47c091(0x1bb)],'source':_0x25a5f6['source'],'isDeprecated':![]};const _0x2b7f2a=_0xee3ae7||getActiveProfileName()||undefined;if(_0x2b7f2a){const _0x51f7bc=_0x47c091(0x1bf)+normalizeProfileForEnvVar(_0x2b7f2a);if(process.env[_0x51f7bc])return{'apiKey':process.env[_0x51f7bc],'source':_0x51f7bc+_0x47c091(0x1a1),'isDeprecated':![]};const _0x3eb9d1=getCachedCredential(_0x2d5a61,_0x2b7f2a);if(_0x3eb9d1)return{'apiKey':_0x3eb9d1,'source':_0x47c091(0x197)+_0x2b7f2a+')','isDeprecated':![]};const _0x14446e=await getKeychainAPIKey(_0x2b7f2a);if(_0x14446e)return setCachedCredential(_0x14446e,_0x2d5a61,_0x2b7f2a),{'apiKey':_0x14446e,'source':_0x47c091(0x197)+_0x2b7f2a+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x2b7f2a){const _0x57c2e1=getCachedCredential(_0x2d5a61,undefined);if(_0x57c2e1)return{'apiKey':_0x57c2e1,'source':_0x47c091(0x19c),'isDeprecated':![]};const _0x20a056=await getKeychainAPIKey(undefined);if(_0x20a056)return setCachedCredential(_0x20a056,_0x2d5a61,undefined),{'apiKey':_0x20a056,'source':'keychain','isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x1a4c1f,_0x516c68){const _0x1074de=a55_0x322d1f,_0x6fc5a3=await resolveAPIKeyAsync(_0x1a4c1f,_0x516c68);return _0x6fc5a3?.[_0x1074de(0x1cf)];}function cleanupLegacyEnvFile(_0x7b9f37){const _0x5c0014=a55_0x322d1f;if(!existsSync(_0x7b9f37))return![];try{const _0x160b54=readFileSync(_0x7b9f37,'utf-8'),_0x1378ee=_0x160b54[_0x5c0014(0x19d)]('\x0a'),_0x5d5bc0=_0x1378ee[_0x5c0014(0x1b7)](_0x5496d3=>{const _0x19bd4d=_0x5c0014,_0x903ce9=_0x5496d3[_0x19bd4d(0x1ab)]();if(!_0x903ce9||_0x903ce9[_0x19bd4d(0x1da)]('#'))return!![];const [_0x1d29b3]=_0x903ce9['split']('=');return!_0x1d29b3[_0x19bd4d(0x1da)]('TD_API_KEY');}),_0x42bbdb=_0x5d5bc0['some'](_0x36783d=>{const _0x2a7c10=_0x5c0014,_0x5c4ca8=_0x36783d[_0x2a7c10(0x1ab)]();return _0x5c4ca8&&!_0x5c4ca8[_0x2a7c10(0x1da)]('#');});if(!_0x42bbdb)return unlinkSync(_0x7b9f37),!![];return writeFileSync(_0x7b9f37,_0x5d5bc0[_0x5c0014(0x1ba)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x451b5c=a55_0x322d1f;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x3dc7a7=a55_0x46062e[_0x451b5c(0x1ba)](getConfigDir(),_0x451b5c(0x1b1));if(!a55_0x287711[_0x451b5c(0x1cc)](_0x3dc7a7))return null;try{const _0x4e4a7c=a55_0x287711[_0x451b5c(0x198)](_0x3dc7a7,_0x451b5c(0x1bc)),_0x288e07=JSON[_0x451b5c(0x1a4)](_0x4e4a7c);return _0x288e07[_0x451b5c(0x1c0)]||null;}catch{return null;}}export function saveAPIKey(_0xb8421a,_0x1858f3,_0x481064){const _0x4c2d8e=a55_0x322d1f,_0x52be02=getConfigDir(),_0x240ff1=getConfigFilePath(_0x481064);!existsSync(_0x52be02)&&mkdirSync(_0x52be02,{'recursive':!![],'mode':0x1c0});let _0x45b52b={};if(existsSync(_0x240ff1))try{const _0x5b136b=readFileSync(_0x240ff1,_0x4c2d8e(0x1bc));_0x45b52b=parseEnvFile(_0x5b136b);}catch(_0x16e4de){console[_0x4c2d8e(0x1c8)](_0x4c2d8e(0x1c9)+_0x240ff1+':',_0x16e4de);}const _0x140ae2=_0xb8421a[_0x4c2d8e(0x1c3)]()['replace'](/-/g,'_');_0x45b52b['TD_API_KEY_'+_0x140ae2]=_0x1858f3;const _0x493df0=Object[_0x4c2d8e(0x1a8)](_0x45b52b)[_0x4c2d8e(0x1cb)](([_0x277d01,_0x1bb223])=>_0x277d01+'='+_0x1bb223);writeFileSync(_0x240ff1,_0x493df0[_0x4c2d8e(0x1ba)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x4b17e2,_0x32adc1,_0x58d4b3){const _0x12f629=a55_0x322d1f;await saveKeychainAPIKey(_0x4b17e2,_0x58d4b3),setCachedCredential(_0x4b17e2,_0x32adc1,_0x58d4b3);const _0x1c20c2=getConfigFilePath(_0x58d4b3);cleanupLegacyEnvFile(_0x1c20c2)&&console['warn'](a55_0x361d00[_0x12f629(0x1a7)](_0x12f629(0x1a2)));}export function loadConfig(){const _0x50b113=a55_0x322d1f,_0x6a3e12={'apiKeys':{},'defaultSite':_0x50b113(0x19f)},_0xad1af1=['us01',_0x50b113(0x1d4),'eu01',_0x50b113(0x1a5),_0x50b113(0x1cd),'dev-us01',_0x50b113(0x1d6),_0x50b113(0x1ae),'stg-ap01','stg-ap03'],_0xbf2c6d=getAPIKey();if(_0xbf2c6d)for(const _0x1a7a1d of _0xad1af1){_0x6a3e12[_0x50b113(0x1c6)][_0x1a7a1d]=_0xbf2c6d;}return _0x6a3e12;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x51d4dd=a55_0x322d1f,_0x2fa118=a55_0x46062e[_0x51d4dd(0x1ba)](getConfigDir(),_0x51d4dd(0x1b1));if(!a55_0x287711['existsSync'](_0x2fa118))return undefined;try{const _0xe3399e=a55_0x287711[_0x51d4dd(0x198)](_0x2fa118,_0x51d4dd(0x1bc)),_0x356024=JSON[_0x51d4dd(0x1a4)](_0xe3399e);return typeof _0x356024[_0x51d4dd(0x1bd)]===_0x51d4dd(0x19e)?_0x356024['proxy']:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x58b96c=a55_0x322d1f,_0x591515=process.env.TDX_RELEASE_CHANNEL;if(_0x591515===_0x58b96c(0x1be)||_0x591515==='stable')return _0x591515;const _0x4f068f=a55_0x46062e[_0x58b96c(0x1ba)](getConfigDir(),_0x58b96c(0x1b1));if(!a55_0x287711['existsSync'](_0x4f068f))return _0x58b96c(0x1c2);try{const _0x3be1b4=a55_0x287711[_0x58b96c(0x198)](_0x4f068f,_0x58b96c(0x1bc)),_0x259d4f=JSON[_0x58b96c(0x1a4)](_0x3be1b4);if(_0x259d4f[_0x58b96c(0x1d3)]===_0x58b96c(0x1be))return _0x58b96c(0x1be);}catch{}return _0x58b96c(0x1c2);}export function saveReleaseChannel(_0x202fdb){const _0x2c8aa1=a55_0x322d1f,_0x1c4707=getConfigDir(),_0x3e4ef5=a55_0x46062e['join'](_0x1c4707,'tdx.json');!existsSync(_0x1c4707)&&mkdirSync(_0x1c4707,{'recursive':!![],'mode':0x1c0});let _0x2dbb65={};if(existsSync(_0x3e4ef5))try{const _0x52922a=readFileSync(_0x3e4ef5,_0x2c8aa1(0x1bc));_0x2dbb65=JSON[_0x2c8aa1(0x1a4)](_0x52922a);}catch{}_0x2dbb65[_0x2c8aa1(0x1d3)]=_0x202fdb,writeFileSync(_0x3e4ef5,JSON[_0x2c8aa1(0x19a)](_0x2dbb65,null,0x2),{'mode':0x180});}
1
+ const a55_0x3ceb42=a55_0x21ad;(function(_0x36bf35,_0x57882b){const _0x9837c8=a55_0x21ad,_0x24cc37=_0x36bf35();while(!![]){try{const _0x496ef3=parseInt(_0x9837c8(0x1ad))/0x1*(-parseInt(_0x9837c8(0x1ae))/0x2)+-parseInt(_0x9837c8(0x1b4))/0x3*(-parseInt(_0x9837c8(0x175))/0x4)+-parseInt(_0x9837c8(0x172))/0x5*(-parseInt(_0x9837c8(0x186))/0x6)+-parseInt(_0x9837c8(0x190))/0x7+parseInt(_0x9837c8(0x1b2))/0x8*(-parseInt(_0x9837c8(0x1a2))/0x9)+parseInt(_0x9837c8(0x179))/0xa*(-parseInt(_0x9837c8(0x1ab))/0xb)+parseInt(_0x9837c8(0x182))/0xc;if(_0x496ef3===_0x57882b)break;else _0x24cc37['push'](_0x24cc37['shift']());}catch(_0x54d406){_0x24cc37['push'](_0x24cc37['shift']());}}}(a55_0x4c33,0x24c44));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';function a55_0x21ad(_0x136e55,_0x12a73c){_0x136e55=_0x136e55-0x16e;const _0x4c338a=a55_0x4c33();let _0x21adf2=_0x4c338a[_0x136e55];return _0x21adf2;}import*as a55_0x59b68d from'node:fs';import*as a55_0x234348 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 a55_0x4b2672 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x4304e6=a55_0x21ad;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x4304e6(0x173),_0x4304e6(0x16f));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x55b37d){const _0x1f9e41=getConfigDir();return _0x55b37d?a55_0x234348['join'](_0x1f9e41,'.env.'+_0x55b37d):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a55_0x3ceb42(0x198),a55_0x3ceb42(0x1b7));export function getLLMProjectCacheFile(_0xc29889){const _0x3eb627=a55_0x3ceb42;return llmProjectCache[_0x3eb627(0x171)](_0xc29889);}export function readCachedLLMProject(_0x109e8b){const _0x78d529=a55_0x3ceb42,_0x424281=llmProjectCache[_0x78d529(0x18a)](_0x109e8b);if(_0x424281&&typeof _0x424281['id']==='string'&&typeof _0x424281[_0x78d529(0x1ba)]==='string')return _0x424281;return null;}export function writeCachedLLMProject(_0xdc5fc4,_0x19aeac,_0x3e0538){const _0x478d58=a55_0x3ceb42;try{llmProjectCache[_0x478d58(0x1a1)]({'name':_0xdc5fc4,'id':_0x19aeac},_0x3e0538);}catch{}}const llmAgentCache=createOptionalProfileCache(a55_0x3ceb42(0x18d),'config/llm-agent');export function getLLMAgentCacheFile(_0x36304f){const _0x1aa50f=a55_0x3ceb42;return llmAgentCache[_0x1aa50f(0x171)](_0x36304f);}export function readCachedLLMAgent(_0x160ed8){const _0x2cbcd6=a55_0x3ceb42,_0x513647=llmAgentCache[_0x2cbcd6(0x18a)](_0x160ed8);if(_0x513647&&typeof _0x513647['id']===_0x2cbcd6(0x1a6)&&typeof _0x513647[_0x2cbcd6(0x1ba)]===_0x2cbcd6(0x1a6)&&typeof _0x513647[_0x2cbcd6(0x19c)]===_0x2cbcd6(0x1a6))return _0x513647;return null;}export function writeCachedLLMAgent(_0x2f82c6,_0xf22dad,_0x1c7230,_0x25a90e){const _0x135820=a55_0x3ceb42;try{llmAgentCache[_0x135820(0x1a1)]({'name':_0x2f82c6,'id':_0xf22dad,'projectId':_0x1c7230},_0x25a90e);}catch{}}export function clearCachedLLMAgent(_0x4fbcba){const _0x392159=a55_0x3ceb42;try{llmAgentCache[_0x392159(0x17a)](_0x4fbcba);}catch{}}const accountInfoCache=createOptionalProfileCache(a55_0x3ceb42(0x17e),a55_0x3ceb42(0x192),{'suffix':a55_0x3ceb42(0x178)});export function getAccountInfoCacheFile(_0x125563){const _0x36ec04=a55_0x3ceb42;return accountInfoCache[_0x36ec04(0x171)](_0x125563);}export function readCachedAccountInfo(_0x6c3aa1){const _0x530651=a55_0x3ceb42,_0x40fa3c=accountInfoCache[_0x530651(0x18a)](_0x6c3aa1);if(_0x40fa3c&&typeof _0x40fa3c[_0x530651(0x1af)]==='string'&&typeof _0x40fa3c[_0x530651(0x18b)]===_0x530651(0x1a8))return _0x40fa3c;return null;}export function writeCachedAccountInfo(_0x42a4fe,_0x4b6639,_0x2f2499){const _0x3eb685=a55_0x3ceb42;try{accountInfoCache[_0x3eb685(0x1a1)]({'site':_0x42a4fe,'accountId':_0x4b6639,'cachedAt':new Date()[_0x3eb685(0x19e)]()},_0x2f2499);}catch{}}export function parseEnvFile(_0x169f44){const _0x5cbd40=a55_0x3ceb42,_0x4ee0b4={};for(const _0x14ed74 of _0x169f44[_0x5cbd40(0x18e)]('\x0a')){const _0x140504=_0x14ed74[_0x5cbd40(0x181)]();if(!_0x140504||_0x140504[_0x5cbd40(0x19a)]('#'))continue;const _0x191214=_0x140504[_0x5cbd40(0x1b1)](/^([^=]+)=(.*)$/);if(_0x191214){const _0x319a43=_0x191214[0x1]['trim']();let _0x3a1baa=_0x191214[0x2]['trim']();(_0x3a1baa['startsWith']('\x22')&&_0x3a1baa[_0x5cbd40(0x191)]('\x22')||_0x3a1baa['startsWith']('\x27')&&_0x3a1baa[_0x5cbd40(0x191)]('\x27'))&&(_0x3a1baa=_0x3a1baa[_0x5cbd40(0x189)](0x1,-0x1)),_0x4ee0b4[_0x319a43]=_0x3a1baa;}}return _0x4ee0b4;}function a55_0x4c33(){const _0x39d615=['config/account-info','readFileSync','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','stg-us01','tdx.json','profile','llm_default_project','TDX_API_KEY\x20env\x20var','startsWith','toUpperCase','projectId','keychain','toISOString','proxy','map','write','4617ypvoKX','eu01','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','TDX_ACCESS_TOKEN\x20env\x20var','string','parse','number','stg-ap01','dev-us01','66pWPTuF','stable','284WhqVpC','2012tcbkbr','site','existsSync','match','2504TBYpvr','accessToken','465108mddXWG','\x20env\x20var','join','config/llm-project','TD_API_KEY','includes','name','utf-8','tdx','warn','path','510uCVBVT','.config','Warning:\x20Unknown\x20site\x20\x27','4SerVMe','next','replace','.json','363230RDncHG','clear','ap01','dev-eu01','entries','account_info','apiKeys','apiKey','trim','5569260cFVEfi','TDX_API_KEY_','keychain\x20(profile:\x20','ap02','11694FqizTN','release_channel','stg-ap03','slice','read','accountId','us01','llm_default_agent','split','some','21924Gbwvfb','endsWith'];a55_0x4c33=function(){return _0x39d615;};return a55_0x4c33();}export function readUserConfig(){const _0x3f6b87=a55_0x3ceb42,_0x75a3b4=getConfigFile();if(!existsSync(_0x75a3b4))return{};try{const _0xf4e2fd=readFileSync(_0x75a3b4,_0x3f6b87(0x16e));return parseEnvFile(_0xf4e2fd);}catch(_0x5aaffe){return console['warn'](_0x3f6b87(0x194)+_0x75a3b4+':',_0x5aaffe),{};}}export function resolveSite(_0x5f5d9c){const _0x2e3404=a55_0x3ceb42,_0x4afb43=[_0x2e3404(0x18c),_0x2e3404(0x17b),'eu01',_0x2e3404(0x185),'ap03',_0x2e3404(0x1aa),_0x2e3404(0x17c),_0x2e3404(0x195),_0x2e3404(0x1a9),_0x2e3404(0x188)];if(_0x4afb43[_0x2e3404(0x1b9)](_0x5f5d9c))return _0x5f5d9c;if(_0x5f5d9c in SITE_ALIASES)return SITE_ALIASES[_0x5f5d9c];return console[_0x2e3404(0x170)](_0x2e3404(0x174)+_0x5f5d9c+'\x27,\x20defaulting\x20to\x20us01'),_0x2e3404(0x18c);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x4e1772){const _0x506bf2=a55_0x3ceb42,_0x277b38=_0x4e1772||getActiveProfileName()||undefined;if(_0x277b38){const _0x4a35d5='TDX_ACCESS_TOKEN_'+normalizeProfileForEnvVar(_0x277b38);if(process.env[_0x4a35d5])return{'accessToken':process.env[_0x4a35d5],'source':_0x4a35d5+_0x506bf2(0x1b5)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x506bf2(0x1a5)};return null;}export function getAccessToken(_0x561748){const _0x27a75f=a55_0x3ceb42;return resolveAccessToken(_0x561748)?.[_0x27a75f(0x1b3)];}export function getAPIKey(_0x3506fc){const _0x41975f=a55_0x3ceb42,_0x53c824=_0x3506fc||getActiveProfileName();if(_0x53c824){const _0x4a3399=_0x41975f(0x183)+normalizeProfileForEnvVar(_0x53c824);if(process.env[_0x4a3399])return process.env[_0x4a3399];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x21f6d9){const _0x11483d=a55_0x3ceb42;return _0x21f6d9[_0x11483d(0x19b)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x3c7337,_0x47d24e){const _0x3e7a62=a55_0x3ceb42,_0x42e4d2=resolveAccessToken(_0x47d24e);if(_0x42e4d2)return{'apiKey':_0x42e4d2[_0x3e7a62(0x1b3)],'source':_0x42e4d2['source'],'isDeprecated':![]};const _0x2f6957=_0x47d24e||getActiveProfileName()||undefined;if(_0x2f6957){const _0x23d9b5=_0x3e7a62(0x183)+normalizeProfileForEnvVar(_0x2f6957);if(process.env[_0x23d9b5])return{'apiKey':process.env[_0x23d9b5],'source':_0x23d9b5+'\x20env\x20var','isDeprecated':![]};const _0xfc3f38=getCachedCredential(_0x3c7337,_0x2f6957);if(_0xfc3f38)return{'apiKey':_0xfc3f38,'source':'keychain\x20(profile:\x20'+_0x2f6957+')','isDeprecated':![]};const _0x1242cc=await getKeychainAPIKey(_0x2f6957);if(_0x1242cc)return setCachedCredential(_0x1242cc,_0x3c7337,_0x2f6957),{'apiKey':_0x1242cc,'source':_0x3e7a62(0x184)+_0x2f6957+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x3e7a62(0x199),'isDeprecated':![]};if(!_0x2f6957){const _0x8aade0=getCachedCredential(_0x3c7337,undefined);if(_0x8aade0)return{'apiKey':_0x8aade0,'source':_0x3e7a62(0x19d),'isDeprecated':![]};const _0x3dc952=await getKeychainAPIKey(undefined);if(_0x3dc952)return setCachedCredential(_0x3dc952,_0x3c7337,undefined),{'apiKey':_0x3dc952,'source':_0x3e7a62(0x19d),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x5b7494,_0x220752){const _0x56e1ad=a55_0x3ceb42,_0x522503=await resolveAPIKeyAsync(_0x5b7494,_0x220752);return _0x522503?.[_0x56e1ad(0x180)];}function cleanupLegacyEnvFile(_0x543ff8){const _0x27f279=a55_0x3ceb42;if(!existsSync(_0x543ff8))return![];try{const _0x15664c=readFileSync(_0x543ff8,'utf-8'),_0x30019e=_0x15664c[_0x27f279(0x18e)]('\x0a'),_0x2b4920=_0x30019e['filter'](_0x2dcac9=>{const _0x1ee387=_0x27f279,_0x46ef99=_0x2dcac9[_0x1ee387(0x181)]();if(!_0x46ef99||_0x46ef99['startsWith']('#'))return!![];const [_0x2f8b9e]=_0x46ef99['split']('=');return!_0x2f8b9e[_0x1ee387(0x19a)](_0x1ee387(0x1b8));}),_0x498141=_0x2b4920[_0x27f279(0x18f)](_0x21ddb5=>{const _0x40c882=_0x27f279,_0x2ffc06=_0x21ddb5[_0x40c882(0x181)]();return _0x2ffc06&&!_0x2ffc06['startsWith']('#');});if(!_0x498141)return unlinkSync(_0x543ff8),!![];return writeFileSync(_0x543ff8,_0x2b4920[_0x27f279(0x1b6)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x259426=a55_0x3ceb42;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x3148b6=a55_0x234348['join'](getConfigDir(),_0x259426(0x196));if(!a55_0x59b68d[_0x259426(0x1b0)](_0x3148b6))return null;try{const _0x16d3aa=a55_0x59b68d[_0x259426(0x193)](_0x3148b6,'utf-8'),_0x23887a=JSON[_0x259426(0x1a7)](_0x16d3aa);return _0x23887a[_0x259426(0x197)]||null;}catch{return null;}}export function saveAPIKey(_0x10d7e6,_0x1df7eb,_0x2c0c24){const _0x511e25=a55_0x3ceb42,_0x348a0f=getConfigDir(),_0x51ac6c=getConfigFilePath(_0x2c0c24);!existsSync(_0x348a0f)&&mkdirSync(_0x348a0f,{'recursive':!![],'mode':0x1c0});let _0x188d5d={};if(existsSync(_0x51ac6c))try{const _0x5514c2=readFileSync(_0x51ac6c,'utf-8');_0x188d5d=parseEnvFile(_0x5514c2);}catch(_0x5410de){console['warn']('Warning:\x20Failed\x20to\x20read\x20'+_0x51ac6c+':',_0x5410de);}const _0x639899=_0x10d7e6[_0x511e25(0x19b)]()[_0x511e25(0x177)](/-/g,'_');_0x188d5d['TD_API_KEY_'+_0x639899]=_0x1df7eb;const _0x2bacce=Object[_0x511e25(0x17d)](_0x188d5d)[_0x511e25(0x1a0)](([_0x458172,_0x2d13c2])=>_0x458172+'='+_0x2d13c2);writeFileSync(_0x51ac6c,_0x2bacce[_0x511e25(0x1b6)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x2ccd6a,_0x391f7f,_0x1df32b){const _0x146e8b=a55_0x3ceb42;await saveKeychainAPIKey(_0x2ccd6a,_0x1df32b),setCachedCredential(_0x2ccd6a,_0x391f7f,_0x1df32b);const _0x143751=getConfigFilePath(_0x1df32b);cleanupLegacyEnvFile(_0x143751)&&console[_0x146e8b(0x170)](a55_0x4b2672['yellow'](_0x146e8b(0x1a4)));}export function loadConfig(){const _0x3ba29c=a55_0x3ceb42,_0x45d9d2={'apiKeys':{},'defaultSite':_0x3ba29c(0x18c)},_0x58fbd3=[_0x3ba29c(0x18c),'ap01',_0x3ba29c(0x1a3),_0x3ba29c(0x185),'ap03',_0x3ba29c(0x1aa),'dev-eu01',_0x3ba29c(0x195),'stg-ap01',_0x3ba29c(0x188)],_0x2676ca=getAPIKey();if(_0x2676ca)for(const _0x55b369 of _0x58fbd3){_0x45d9d2[_0x3ba29c(0x17f)][_0x55b369]=_0x2676ca;}return _0x45d9d2;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x30807d=a55_0x3ceb42,_0x53d450=a55_0x234348[_0x30807d(0x1b6)](getConfigDir(),_0x30807d(0x196));if(!a55_0x59b68d['existsSync'](_0x53d450))return undefined;try{const _0x4f4659=a55_0x59b68d['readFileSync'](_0x53d450,_0x30807d(0x16e)),_0x831a4=JSON[_0x30807d(0x1a7)](_0x4f4659);return typeof _0x831a4[_0x30807d(0x19f)]===_0x30807d(0x1a6)?_0x831a4[_0x30807d(0x19f)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x30dd43=a55_0x3ceb42,_0x4ee41b=process.env.TDX_RELEASE_CHANNEL;if(_0x4ee41b===_0x30dd43(0x176)||_0x4ee41b===_0x30dd43(0x1ac))return _0x4ee41b;const _0x29ee82=a55_0x234348[_0x30dd43(0x1b6)](getConfigDir(),_0x30dd43(0x196));if(!a55_0x59b68d[_0x30dd43(0x1b0)](_0x29ee82))return _0x30dd43(0x1ac);try{const _0x42fecf=a55_0x59b68d[_0x30dd43(0x193)](_0x29ee82,_0x30dd43(0x16e)),_0x449c1e=JSON[_0x30dd43(0x1a7)](_0x42fecf);if(_0x449c1e[_0x30dd43(0x187)]===_0x30dd43(0x176))return'next';}catch{}return _0x30dd43(0x1ac);}export function saveReleaseChannel(_0x4ddf93){const _0x3b62a0=a55_0x3ceb42,_0x3a9b30=getConfigDir(),_0x549537=a55_0x234348[_0x3b62a0(0x1b6)](_0x3a9b30,_0x3b62a0(0x196));!existsSync(_0x3a9b30)&&mkdirSync(_0x3a9b30,{'recursive':!![],'mode':0x1c0});let _0x360794={};if(existsSync(_0x549537))try{const _0x3c2053=readFileSync(_0x549537,_0x3b62a0(0x16e));_0x360794=JSON['parse'](_0x3c2053);}catch{}_0x360794['release_channel']=_0x4ddf93,writeFileSync(_0x549537,JSON['stringify'](_0x360794,null,0x2),{'mode':0x180});}
@@ -1 +1 @@
1
- function a56_0x29cb(_0x123c7a,_0x3f7c02){_0x123c7a=_0x123c7a-0x89;const _0x4839b9=a56_0x4839();let _0x29cbc7=_0x4839b9[_0x123c7a];return _0x29cbc7;}const a56_0x50dfa6=a56_0x29cb;(function(_0x5abe19,_0x3c8bdb){const _0x518f28=a56_0x29cb,_0x4a9e84=_0x5abe19();while(!![]){try{const _0x1937fc=parseInt(_0x518f28(0x8d))/0x1*(-parseInt(_0x518f28(0x98))/0x2)+-parseInt(_0x518f28(0x94))/0x3+parseInt(_0x518f28(0x8a))/0x4*(-parseInt(_0x518f28(0x89))/0x5)+-parseInt(_0x518f28(0x8e))/0x6*(parseInt(_0x518f28(0x93))/0x7)+parseInt(_0x518f28(0x99))/0x8*(parseInt(_0x518f28(0x8f))/0x9)+-parseInt(_0x518f28(0x92))/0xa+parseInt(_0x518f28(0x90))/0xb;if(_0x1937fc===_0x3c8bdb)break;else _0x4a9e84['push'](_0x4a9e84['shift']());}catch(_0x1275e4){_0x4a9e84['push'](_0x4a9e84['shift']());}}}(a56_0x4839,0x4b8be));function a56_0x4839(){const _0x206ea7=['1776612JUZiUW','read','clear','connections-{profile}.json','164546sdhvaZ','4371792mTfLgt','55bBgzzj','15632HzQFVR','core/connection-cache','connections','5EeYLQP','12BsfIwv','9SRiMaR','17486029UdhoEQ','write','4686040xrfOom','1090299estRhf'];a56_0x4839=function(){return _0x206ea7;};return a56_0x4839();}import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a56_0x50dfa6(0x97),a56_0x50dfa6(0x8b));export function loadCachedConnections(_0x56e3aa){const _0xc8099c=a56_0x50dfa6,_0x230a73=connectionCache[_0xc8099c(0x95)](_0x56e3aa);return _0x230a73?.[_0xc8099c(0x8c)]??null;}export function saveCachedConnections(_0x1eac12,_0x2d8a29){const _0x5f40fe=a56_0x50dfa6;connectionCache[_0x5f40fe(0x91)](_0x1eac12,{'connections':_0x2d8a29,'cachedAt':Date['now']()});}export function clearConnectionCache(_0x342832){const _0xa27928=a56_0x50dfa6;connectionCache[_0xa27928(0x96)](_0x342832);}
1
+ const a56_0x4f305b=a56_0x4bc3;function a56_0x4bc3(_0x3f6917,_0x24f876){_0x3f6917=_0x3f6917-0xad;const _0x49237a=a56_0x4923();let _0x4bc3ba=_0x49237a[_0x3f6917];return _0x4bc3ba;}(function(_0x452e8d,_0x4fdb26){const _0x477516=a56_0x4bc3,_0x13f87e=_0x452e8d();while(!![]){try{const _0x275c1f=parseInt(_0x477516(0xbe))/0x1*(parseInt(_0x477516(0xb9))/0x2)+parseInt(_0x477516(0xb4))/0x3+parseInt(_0x477516(0xaf))/0x4*(parseInt(_0x477516(0xbb))/0x5)+parseInt(_0x477516(0xb8))/0x6*(-parseInt(_0x477516(0xb7))/0x7)+-parseInt(_0x477516(0xba))/0x8+parseInt(_0x477516(0xbd))/0x9*(parseInt(_0x477516(0xb5))/0xa)+-parseInt(_0x477516(0xae))/0xb*(parseInt(_0x477516(0xbc))/0xc);if(_0x275c1f===_0x4fdb26)break;else _0x13f87e['push'](_0x13f87e['shift']());}catch(_0x2bbc1f){_0x13f87e['push'](_0x13f87e['shift']());}}}(a56_0x4923,0x7870e));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a56_0x4f305b(0xb3),a56_0x4f305b(0xad));export function loadCachedConnections(_0xb49d19){const _0x6710ec=a56_0x4f305b,_0x3dfc78=connectionCache[_0x6710ec(0xb1)](_0xb49d19);return _0x3dfc78?.[_0x6710ec(0xb2)]??null;}function a56_0x4923(){const _0x31f8dc=['463613WOLrae','core/connection-cache','11674685SJtwxg','3187320DoyYGR','clear','read','connections','connections-{profile}.json','1176576mUCmNL','3731020eXOWoI','write','7AuLAaL','1985982vdZjlQ','2kKCBpD','1120632bqcOmh','5yijiJY','12JYsjDg','9kxAHIC'];a56_0x4923=function(){return _0x31f8dc;};return a56_0x4923();}export function saveCachedConnections(_0x42601c,_0x3c459f){const _0x1816ce=a56_0x4f305b;connectionCache[_0x1816ce(0xb6)](_0x42601c,{'connections':_0x3c459f,'cachedAt':Date['now']()});}export function clearConnectionCache(_0x22363d){const _0x522023=a56_0x4f305b;connectionCache[_0x522023(0xb0)](_0x22363d);}
@@ -1 +1 @@
1
- const a57_0x36281d=a57_0x5ba1;(function(_0x5c0156,_0x4568c7){const _0x3b1079=a57_0x5ba1,_0x41b4cd=_0x5c0156();while(!![]){try{const _0x5bedba=-parseInt(_0x3b1079(0x1c1))/0x1+parseInt(_0x3b1079(0x1b6))/0x2*(parseInt(_0x3b1079(0x1ba))/0x3)+-parseInt(_0x3b1079(0x1bf))/0x4+-parseInt(_0x3b1079(0x1b1))/0x5*(-parseInt(_0x3b1079(0x1c3))/0x6)+parseInt(_0x3b1079(0x1ca))/0x7*(parseInt(_0x3b1079(0x1cb))/0x8)+-parseInt(_0x3b1079(0x1bb))/0x9*(parseInt(_0x3b1079(0x1ad))/0xa)+parseInt(_0x3b1079(0x1bd))/0xb*(parseInt(_0x3b1079(0x1c7))/0xc);if(_0x5bedba===_0x4568c7)break;else _0x41b4cd['push'](_0x41b4cd['shift']());}catch(_0x28130d){_0x41b4cd['push'](_0x41b4cd['shift']());}}}(a57_0xfbcf,0x35cdf));import a57_0x45d97e from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x5a645d,_0x1ebbd5){const _0x11c2d6=a57_0x5ba1;if(_0x5a645d===undefined)return _0x1ebbd5;if(typeof _0x5a645d===_0x11c2d6(0x1ae))return _0x5a645d;return parseInt(_0x5a645d,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a57_0x36281d(0x1b5),'value':a57_0x36281d(0x1b4)},{'title':a57_0x36281d(0x1b3),'value':a57_0x36281d(0x1b0)},{'title':a57_0x36281d(0x1c6),'value':a57_0x36281d(0x1c8)},{'title':a57_0x36281d(0x1af),'value':a57_0x36281d(0x1c9)}];export function buildSiteChoices(_0x49573c){const _0x54db70=a57_0x36281d,_0x2e17e2=[...STANDARD_SITE_CHOICES];let _0x300aee=_0x2e17e2['findIndex'](_0x3b3fc7=>_0x3b3fc7['value']===_0x49573c);return _0x300aee===-0x1&&_0x49573c!=='us01'&&(_0x2e17e2['push']({'title':_0x49573c,'value':_0x49573c}),_0x300aee=_0x2e17e2['length']-0x1),_0x2e17e2['push']({'title':'Enter\x20custom\x20site','value':_0x54db70(0x1b8)}),{'choices':_0x2e17e2,'initialIndex':_0x300aee>=0x0?_0x300aee:0x0};}function a57_0xfbcf(){const _0x872b75=['129yqjTeF','1785141KhMoBH','log','8265400UWiFUX','select','812768FKfMUp','Site\x20name\x20cannot\x20be\x20empty','323996HtqzNQ','test','6jJHehQ','Enter\x20site\x20name:','trim','eu\x20\x20\x20-\x20Europe','12uVmXLA','eu01','ap02','577171focccj','24itmGlq','20EoKeBl','number','ap02\x20-\x20Korea','ap01','509755QYsNPd','text','jp\x20\x20\x20-\x20Japan','us01','us\x20\x20\x20-\x20United\x20States','2026llxUBd','customSite','other','site'];a57_0xfbcf=function(){return _0x872b75;};return a57_0xfbcf();}function a57_0x5ba1(_0x242b20,_0x583e0b){_0x242b20=_0x242b20-0x1ad;const _0xfbcf01=a57_0xfbcf();let _0x5ba1f9=_0xfbcf01[_0x242b20];return _0x5ba1f9;}export async function promptSiteSelection(_0x5016bd,_0x37e2ba,_0x973d93='Cancelled'){const _0x53ded1=a57_0x36281d,{choices:_0x392a1a,initialIndex:_0x4e2ecd}=buildSiteChoices(_0x5016bd),_0x5ca685=_0x37e2ba?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x37e2ba+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x17ce82=await a57_0x45d97e({'type':_0x53ded1(0x1be),'name':_0x53ded1(0x1b9),'message':_0x5ca685,'choices':_0x392a1a,'initial':_0x4e2ecd});if(!_0x17ce82['site'])return console[_0x53ded1(0x1bc)]('\x0a'+_0x973d93),null;if(_0x17ce82[_0x53ded1(0x1b9)]!==_0x53ded1(0x1b8))return _0x17ce82[_0x53ded1(0x1b9)];const _0x1e0595=await a57_0x45d97e({'type':_0x53ded1(0x1b2),'name':'customSite','message':_0x53ded1(0x1c4),'initial':'us01','validate':_0xf9db3a=>{const _0x5299c8=_0x53ded1;if(!_0xf9db3a||!_0xf9db3a[_0x5299c8(0x1c5)]())return _0x5299c8(0x1c0);if(!/^[a-z0-9-]+$/[_0x5299c8(0x1c2)](_0xf9db3a[_0x5299c8(0x1c5)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x1e0595[_0x53ded1(0x1b7)])return console[_0x53ded1(0x1bc)]('\x0a'+_0x973d93),null;return _0x1e0595[_0x53ded1(0x1b7)];}
1
+ const a57_0x315c54=a57_0x4890;(function(_0x410867,_0x6c5b5b){const _0x39746f=a57_0x4890,_0x2061c5=_0x410867();while(!![]){try{const _0x1abadf=-parseInt(_0x39746f(0x160))/0x1+-parseInt(_0x39746f(0x172))/0x2*(parseInt(_0x39746f(0x16e))/0x3)+parseInt(_0x39746f(0x162))/0x4+parseInt(_0x39746f(0x16f))/0x5+parseInt(_0x39746f(0x156))/0x6+-parseInt(_0x39746f(0x15f))/0x7*(parseInt(_0x39746f(0x165))/0x8)+-parseInt(_0x39746f(0x168))/0x9;if(_0x1abadf===_0x6c5b5b)break;else _0x2061c5['push'](_0x2061c5['shift']());}catch(_0x1c2f91){_0x2061c5['push'](_0x2061c5['shift']());}}}(a57_0x4514,0x2e977));import a57_0x4d24c3 from'prompts';function a57_0x4514(){const _0x298735=['other','us01','push','Select\x20your\x20Treasure\x20Data\x20site:','us\x20\x20\x20-\x20United\x20States','365697GlHqfc','1886515ojkYWB','value','log','4VoovBa','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','text','1660062FTnMJS','length','select','Enter\x20custom\x20site','ap02','ap01','Cancelled','jp\x20\x20\x20-\x20Japan','eu\x20\x20\x20-\x20Europe','7679tAFBKr','67774VkqmXZ','site','1465356VaFOWW','Enter\x20site\x20name:','customSite','1504Etjjjn','trim','findIndex','2805048zucUOk'];a57_0x4514=function(){return _0x298735;};return a57_0x4514();}function a57_0x4890(_0x364531,_0xa935c4){_0x364531=_0x364531-0x155;const _0x4514f5=a57_0x4514();let _0x4890d0=_0x4514f5[_0x364531];return _0x4890d0;}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x2321f5,_0x2c4597){if(_0x2321f5===undefined)return _0x2c4597;if(typeof _0x2321f5==='number')return _0x2321f5;return parseInt(_0x2321f5,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a57_0x315c54(0x16d),'value':a57_0x315c54(0x16a)},{'title':a57_0x315c54(0x15d),'value':a57_0x315c54(0x15b)},{'title':a57_0x315c54(0x15e),'value':'eu01'},{'title':'ap02\x20-\x20Korea','value':a57_0x315c54(0x15a)}];export function buildSiteChoices(_0x57fa2c){const _0x4aedeb=a57_0x315c54,_0x33b6f3=[...STANDARD_SITE_CHOICES];let _0x3f7e93=_0x33b6f3[_0x4aedeb(0x167)](_0x2a4d16=>_0x2a4d16[_0x4aedeb(0x170)]===_0x57fa2c);return _0x3f7e93===-0x1&&_0x57fa2c!=='us01'&&(_0x33b6f3[_0x4aedeb(0x16b)]({'title':_0x57fa2c,'value':_0x57fa2c}),_0x3f7e93=_0x33b6f3[_0x4aedeb(0x157)]-0x1),_0x33b6f3[_0x4aedeb(0x16b)]({'title':_0x4aedeb(0x159),'value':_0x4aedeb(0x169)}),{'choices':_0x33b6f3,'initialIndex':_0x3f7e93>=0x0?_0x3f7e93:0x0};}export async function promptSiteSelection(_0x16ab0a,_0x3e5496,_0x538dc3=a57_0x315c54(0x15c)){const _0x1e66a6=a57_0x315c54,{choices:_0x3eb16c,initialIndex:_0x2fc20b}=buildSiteChoices(_0x16ab0a),_0x5dec5c=_0x3e5496?_0x1e66a6(0x174)+_0x3e5496+'):':_0x1e66a6(0x16c),_0xe7dba=await a57_0x4d24c3({'type':_0x1e66a6(0x158),'name':_0x1e66a6(0x161),'message':_0x5dec5c,'choices':_0x3eb16c,'initial':_0x2fc20b});if(!_0xe7dba['site'])return console[_0x1e66a6(0x171)]('\x0a'+_0x538dc3),null;if(_0xe7dba[_0x1e66a6(0x161)]!==_0x1e66a6(0x169))return _0xe7dba[_0x1e66a6(0x161)];const _0x3f75d3=await a57_0x4d24c3({'type':_0x1e66a6(0x155),'name':_0x1e66a6(0x164),'message':_0x1e66a6(0x163),'initial':_0x1e66a6(0x16a),'validate':_0x6935f6=>{const _0x28aa91=_0x1e66a6;if(!_0x6935f6||!_0x6935f6['trim']())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/['test'](_0x6935f6[_0x28aa91(0x166)]()))return _0x28aa91(0x173);return!![];}});if(!_0x3f75d3[_0x1e66a6(0x164)])return console['log']('\x0a'+_0x538dc3),null;return _0x3f75d3[_0x1e66a6(0x164)];}
@@ -1 +1 @@
1
- (function(_0x48634e,_0x2a223c){const _0x38386b=a58_0x2350,_0x1585a5=_0x48634e();while(!![]){try{const _0x48911c=parseInt(_0x38386b(0xad))/0x1*(parseInt(_0x38386b(0xa8))/0x2)+parseInt(_0x38386b(0xb6))/0x3*(-parseInt(_0x38386b(0xae))/0x4)+-parseInt(_0x38386b(0xa6))/0x5+parseInt(_0x38386b(0xb4))/0x6+-parseInt(_0x38386b(0xb0))/0x7+parseInt(_0x38386b(0xab))/0x8*(-parseInt(_0x38386b(0xb2))/0x9)+-parseInt(_0x38386b(0xaa))/0xa*(-parseInt(_0x38386b(0xa5))/0xb);if(_0x48911c===_0x2a223c)break;else _0x1585a5['push'](_0x1585a5['shift']());}catch(_0x30e5f5){_0x1585a5['push'](_0x1585a5['shift']());}}}(a58_0x50f7,0x2ce81));function a58_0x50f7(){const _0x2bc3ab=['5023282AqpAKH','1089485RRcFhe','get','4qmYnjK','apiKey','10HjmcwI','24ggLUCm','now','158451yGNbaJ','44NEZzPp','loadedAt','782929absrMS','delete','883782fBgmiv','set','779760MhIsAY','__default_profile__','25977HHZPny'];a58_0x50f7=function(){return _0x2bc3ab;};return a58_0x50f7();}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x305aaf,_0x17ba6b){const _0x586b79=a58_0x2350,_0x3f94b9=_0x305aaf||'__default_site__',_0x20e796=_0x17ba6b||_0x586b79(0xb5);return _0x3f94b9+':'+_0x20e796;}function a58_0x2350(_0x473151,_0x58aabb){_0x473151=_0x473151-0xa5;const _0x50f720=a58_0x50f7();let _0x235049=_0x50f720[_0x473151];return _0x235049;}export function getCachedCredential(_0x237fa6,_0xe8b180){const _0xe99c7c=a58_0x2350,_0x3ee37e=getCacheKey(_0x237fa6,_0xe8b180),_0x1fd7f5=cache[_0xe99c7c(0xa7)](_0x3ee37e);if(!_0x1fd7f5)return null;if(Date[_0xe99c7c(0xac)]()-_0x1fd7f5[_0xe99c7c(0xaf)]>CACHE_TTL_MS)return cache[_0xe99c7c(0xb1)](_0x3ee37e),null;return _0x1fd7f5[_0xe99c7c(0xa9)];}export function setCachedCredential(_0x183e99,_0x28c939,_0x1a4890){const _0x4f9bff=a58_0x2350,_0x5215e4=getCacheKey(_0x28c939,_0x1a4890);cache[_0x4f9bff(0xb3)](_0x5215e4,{'apiKey':_0x183e99,'loadedAt':Date[_0x4f9bff(0xac)]()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x20f8ba,_0x2817fb){const _0xc48b12=a58_0x2350,_0x76db28=getCacheKey(_0x20f8ba,_0x2817fb);cache[_0xc48b12(0xb1)](_0x76db28);}
1
+ function a58_0x5189(_0x2ba9f0,_0x33fbd4){_0x2ba9f0=_0x2ba9f0-0x77;const _0x5300fe=a58_0x5300();let _0x518997=_0x5300fe[_0x2ba9f0];return _0x518997;}(function(_0x35c890,_0x3355a4){const _0x425d13=a58_0x5189,_0x4d18d3=_0x35c890();while(!![]){try{const _0x106f9e=parseInt(_0x425d13(0x7e))/0x1+parseInt(_0x425d13(0x81))/0x2+parseInt(_0x425d13(0x7d))/0x3*(-parseInt(_0x425d13(0x80))/0x4)+-parseInt(_0x425d13(0x7a))/0x5*(parseInt(_0x425d13(0x7f))/0x6)+parseInt(_0x425d13(0x7c))/0x7+-parseInt(_0x425d13(0x85))/0x8+-parseInt(_0x425d13(0x77))/0x9*(-parseInt(_0x425d13(0x87))/0xa);if(_0x106f9e===_0x3355a4)break;else _0x4d18d3['push'](_0x4d18d3['shift']());}catch(_0x44779e){_0x4d18d3['push'](_0x4d18d3['shift']());}}}(a58_0x5300,0x48510));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x34f95c,_0x3f0594){const _0x3a707e=a58_0x5189,_0x3be1b3=_0x34f95c||_0x3a707e(0x83),_0x1346da=_0x3f0594||_0x3a707e(0x79);return _0x3be1b3+':'+_0x1346da;}export function getCachedCredential(_0x2bb8af,_0x39efda){const _0x105bc5=a58_0x5189,_0x50e892=getCacheKey(_0x2bb8af,_0x39efda),_0x11427b=cache[_0x105bc5(0x78)](_0x50e892);if(!_0x11427b)return null;if(Date[_0x105bc5(0x7b)]()-_0x11427b[_0x105bc5(0x86)]>CACHE_TTL_MS)return cache[_0x105bc5(0x88)](_0x50e892),null;return _0x11427b['apiKey'];}export function setCachedCredential(_0x158676,_0x4d8958,_0x1bb541){const _0x47d501=a58_0x5189,_0x32d248=getCacheKey(_0x4d8958,_0x1bb541);cache[_0x47d501(0x82)](_0x32d248,{'apiKey':_0x158676,'loadedAt':Date[_0x47d501(0x7b)]()});}export function clearCredentialCache(){const _0x42e180=a58_0x5189;cache[_0x42e180(0x84)]();}function a58_0x5300(){const _0x258c3b=['delete','172881TEWAoc','get','__default_profile__','1235690oJTCjj','now','2040766QwXAIy','628581oSAXjl','522268hJrtJs','12LHzLeC','4tIBNwl','810832sigJXR','set','__default_site__','clear','3597752tRgBDc','loadedAt','120NDErIx'];a58_0x5300=function(){return _0x258c3b;};return a58_0x5300();}export function clearCachedCredential(_0xe46483,_0x37f45f){const _0x223833=a58_0x5189,_0x466c31=getCacheKey(_0xe46483,_0x37f45f);cache[_0x223833(0x88)](_0x466c31);}
@@ -1 +1 @@
1
- const a59_0x154119=a59_0x2252;(function(_0x207c21,_0x49596c){const _0x1fea36=a59_0x2252,_0x5941e6=_0x207c21();while(!![]){try{const _0x2eef12=parseInt(_0x1fea36(0x10c))/0x1*(parseInt(_0x1fea36(0x138))/0x2)+-parseInt(_0x1fea36(0x125))/0x3*(-parseInt(_0x1fea36(0x135))/0x4)+parseInt(_0x1fea36(0xff))/0x5+-parseInt(_0x1fea36(0x13b))/0x6+parseInt(_0x1fea36(0x12b))/0x7+parseInt(_0x1fea36(0xf9))/0x8+-parseInt(_0x1fea36(0x140))/0x9*(parseInt(_0x1fea36(0x104))/0xa);if(_0x2eef12===_0x49596c)break;else _0x5941e6['push'](_0x5941e6['shift']());}catch(_0x434d79){_0x5941e6['push'](_0x5941e6['shift']());}}}(a59_0x27e9,0xcf98a));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 a59_0x45afe6 from'node:fs';function a59_0x2252(_0x2dc249,_0x23a6a7){_0x2dc249=_0x2dc249-0xed;const _0x27e97d=a59_0x27e9();let _0x2252b5=_0x27e97d[_0x2dc249];return _0x2252b5;}import*as a59_0x53da8a from'node:path';function a59_0x27e9(){const _0x50d959=['string','access_token','workflowProject','7956008ziqpGr','project','us01','profiles','config','segment_path','1630335kDSElg','database','entries','llm_agent','parse','730WpAAOk','replace','none','cliFlags','join','(active)','Profile\x20Credentials','Project','138959JvLXlg','session','tdx.json','profile','assign','logLevel','profileSource','proxy','(session:\x20','llmProject','apiKey','[context]','.env','bold','resolveAPIKeyAsync','profile:\x20','layers','dim','env','parentSegment','workflow_project','parent_segment','INFO','cli','not\x20set','144MDhtPa','global','displayWithSources','Session','globalCredentials','cyan','5438811gJjUgT','createAsync','loadGlobalConfig','CLI\x20flag:\x20--','configFiles','activeProfile','.json','verbose','site','llmAgent','68108ssxxTn','llm_project','sessions','20DaqpiX','accessToken','Global','4669788nkVpbK','(using\x20session:\x20','[configuration\x20files]','default','injectIntoOptions','329895nSuxsc','sessionId','getSource','segmentPath','log','profileCredentials','utf-8','existsSync','getParameters','Global\x20Credentials'];a59_0x27e9=function(){return _0x50d959;};return a59_0x27e9();}import a59_0x183456 from'chalk';export class GlobalContext{[a59_0x154119(0x133)];['database'];[a59_0x154119(0x121)];['segment_path'];[a59_0x154119(0x136)];[a59_0x154119(0x102)];[a59_0x154119(0x120)];['apiKey'];[a59_0x154119(0x139)];[a59_0x154119(0x113)];['verbose'];[a59_0x154119(0x111)];[a59_0x154119(0x10f)];[a59_0x154119(0x112)]=null;[a59_0x154119(0x11c)];[a59_0x154119(0x130)];[a59_0x154119(0xed)];[a59_0x154119(0x12f)];constructor(_0x18d7b4){const _0x482c3f=a59_0x154119;this[_0x482c3f(0xed)]=getSessionID(_0x18d7b4[_0x482c3f(0x10d)]);const _0x199805=loadSessionContext(_0x18d7b4[_0x482c3f(0x10d)]),_0x18ec2d=loadProjectConfig(),_0x498cc7=this[_0x482c3f(0x12d)]();if(_0x18d7b4['profile'])this['activeProfile']=_0x18d7b4[_0x482c3f(0x10f)],this[_0x482c3f(0x112)]=_0x482c3f(0x123);else{if(_0x199805?.[_0x482c3f(0x10f)])this[_0x482c3f(0x130)]=_0x199805[_0x482c3f(0x10f)],this[_0x482c3f(0x112)]=_0x482c3f(0x10d);else{if(_0x498cc7['profile'])this[_0x482c3f(0x130)]=_0x498cc7['profile'],this['profileSource']=_0x482c3f(0xfd);else process.env.TDX_PROFILE?(this[_0x482c3f(0x130)]=process.env.TDX_PROFILE,this[_0x482c3f(0x112)]=_0x482c3f(0x11e)):(this[_0x482c3f(0x130)]=null,this[_0x482c3f(0x112)]=null);}}const _0x31d300=this[_0x482c3f(0x130)]?loadProfile(this[_0x482c3f(0x130)]):null,_0x390b50=_0x237142=>{const _0x1a3022=_0x482c3f;if(!_0x237142)return{};const _0x512388=_0x237142,_0x25596f={};for(const [_0x242411,_0x1493fd]of Object[_0x1a3022(0x101)](_0x512388)){typeof _0x1493fd===_0x1a3022(0xf6)&&(_0x25596f[_0x242411]=_0x1493fd);}return _0x25596f;},_0x52748c={},_0x9b2090=(_0x4b4644,_0x33ff7d,_0x490f45)=>{const _0x104562=_0x482c3f;if(!_0x4b4644)return![];if(_0x490f45&&_0x4b4644===_0x490f45)return![];const _0x5b4f33=_0x199805,_0x1dd1b5=_0x18ec2d,_0x2c04bb=_0x31d300?.[_0x104562(0xfd)],_0x1a571a=_0x498cc7,_0x4d1be4=_0x5b4f33?.[_0x33ff7d],_0x4f28a0=_0x1dd1b5?.[_0x33ff7d],_0x496cb7=_0x2c04bb?.[_0x33ff7d],_0x620a09=_0x1a571a[_0x33ff7d];return _0x4b4644!==_0x4d1be4&&_0x4b4644!==_0x4f28a0&&_0x4b4644!==_0x496cb7&&_0x4b4644!==_0x620a09;},_0x2bef34=[{'optionKey':'site','contextKey':_0x482c3f(0x133),'defaultValue':'us01'},{'optionKey':_0x482c3f(0x100),'contextKey':_0x482c3f(0x100)},{'optionKey':_0x482c3f(0x11f),'contextKey':_0x482c3f(0x121)},{'optionKey':_0x482c3f(0x115),'contextKey':'llm_project'},{'optionKey':_0x482c3f(0x134),'contextKey':_0x482c3f(0x102)},{'optionKey':_0x482c3f(0x10f),'contextKey':_0x482c3f(0x10f)}];for(const {optionKey:_0x1fbcdb,contextKey:_0x5767be,defaultValue:_0x5e160f}of _0x2bef34){const _0xb0697b=_0x18d7b4[_0x1fbcdb];_0x9b2090(_0xb0697b,_0x5767be,_0x5e160f)&&(_0x52748c[_0x5767be]=_0xb0697b);}this['layers']={'cliFlags':_0x52748c,'session':_0x390b50(_0x199805),'project':_0x390b50(_0x18ec2d),'profile':_0x390b50(_0x31d300?.[_0x482c3f(0xfd)]),'global':_0x390b50(_0x498cc7)};const _0x511461={...this[_0x482c3f(0x11c)][_0x482c3f(0x126)],...this['layers'][_0x482c3f(0x10f)],...this[_0x482c3f(0x11c)][_0x482c3f(0xfa)]};process.env.TDX_SITE&&!this[_0x482c3f(0x11c)][_0x482c3f(0x10d)][_0x482c3f(0x133)]&&!this[_0x482c3f(0x11c)][_0x482c3f(0x107)]['site']&&(_0x511461[_0x482c3f(0x133)]=process.env.TDX_SITE);Object[_0x482c3f(0x110)](_0x511461,this[_0x482c3f(0x11c)][_0x482c3f(0x10d)]),Object[_0x482c3f(0x110)](_0x511461,this[_0x482c3f(0x11c)][_0x482c3f(0x107)]);const _0x274ac8=_0x511461[_0x482c3f(0x133)]||_0x482c3f(0xfb);this[_0x482c3f(0x133)]=resolveSite(_0x274ac8),this[_0x482c3f(0x100)]=_0x511461['database'],this[_0x482c3f(0x121)]=_0x511461[_0x482c3f(0x121)],this[_0x482c3f(0xfe)]=_0x511461['segment_path'],this['llm_project']=_0x511461[_0x482c3f(0x136)],this[_0x482c3f(0x102)]=_0x511461[_0x482c3f(0x102)],this[_0x482c3f(0x120)]=_0x511461[_0x482c3f(0x120)],this[_0x482c3f(0x132)]=_0x18d7b4['verbose']||![],this[_0x482c3f(0x111)]=_0x18d7b4[_0x482c3f(0x111)]??LogLevel[_0x482c3f(0x122)],this[_0x482c3f(0x10f)]=this['activeProfile']||undefined,this[_0x482c3f(0x139)]=getAccessToken(this['activeProfile']||undefined),this[_0x482c3f(0x116)]=getAPIKey(this[_0x482c3f(0x130)]||undefined);const _0x35b265=typeof _0x498cc7[_0x482c3f(0x113)]===_0x482c3f(0xf6)?_0x498cc7['proxy']:undefined;this[_0x482c3f(0x113)]=_0x35b265||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0xccfb54=getConfigDir(),_0x1ec76c=a59_0x53da8a[_0x482c3f(0x108)](_0xccfb54,_0x482c3f(0x137),this[_0x482c3f(0xed)]+_0x482c3f(0x131)),_0x49ec44=findProjectConfigPath(),_0x2f5bc8=a59_0x53da8a[_0x482c3f(0x108)](_0xccfb54,_0x482c3f(0x10e)),_0x478146=a59_0x53da8a[_0x482c3f(0x108)](_0xccfb54,_0x482c3f(0x118));let _0x148005=null,_0x340339=null;this['activeProfile']&&(_0x148005=a59_0x53da8a[_0x482c3f(0x108)](_0xccfb54,_0x482c3f(0xfc),this[_0x482c3f(0x130)],_0x482c3f(0x10e)),_0x340339=a59_0x53da8a[_0x482c3f(0x108)](_0xccfb54,'profiles',this[_0x482c3f(0x130)],_0x482c3f(0x118))),this[_0x482c3f(0x12f)]={'session':a59_0x45afe6['existsSync'](_0x1ec76c)?_0x1ec76c:null,'project':_0x49ec44,'profile':_0x148005&&a59_0x45afe6[_0x482c3f(0xf3)](_0x148005)?_0x148005:null,'profileCredentials':_0x340339&&a59_0x45afe6[_0x482c3f(0xf3)](_0x340339)?_0x340339:null,'global':a59_0x45afe6['existsSync'](_0x2f5bc8)?_0x2f5bc8:null,'globalCredentials':a59_0x45afe6['existsSync'](_0x478146)?_0x478146:null};}[a59_0x154119(0xee)](_0x20ab67,_0x3d33b7){const _0x439ecc=a59_0x154119;if(!_0x3d33b7)return _0x439ecc(0x124);const _0x43e371=_0x3d33b7;if(this[_0x439ecc(0x11c)][_0x439ecc(0x107)][_0x20ab67]===_0x43e371){if(_0x20ab67==='site'&&_0x43e371===_0x439ecc(0xfb)&&!this[_0x439ecc(0x11c)][_0x439ecc(0x10d)][_0x439ecc(0x133)]&&!this['layers'][_0x439ecc(0xfa)]['site']&&!this[_0x439ecc(0x11c)]['profile']['site']&&!this[_0x439ecc(0x11c)][_0x439ecc(0x126)][_0x439ecc(0x133)])return _0x439ecc(0x13e);return _0x439ecc(0x12e)+_0x20ab67[_0x439ecc(0x105)](/_/g,'-');}if(this[_0x439ecc(0x11c)]['session'][_0x20ab67]===_0x43e371)return _0x439ecc(0x10d);if(this[_0x439ecc(0x11c)]['project'][_0x20ab67]===_0x43e371)return _0x439ecc(0xfa);if(this[_0x439ecc(0x11c)]['profile'][_0x20ab67]===_0x43e371)return _0x439ecc(0x11b)+this[_0x439ecc(0x130)];if(this[_0x439ecc(0x11c)][_0x439ecc(0x126)][_0x20ab67]===_0x43e371)return _0x439ecc(0x126);return _0x439ecc(0x13e);}[a59_0x154119(0x12d)](){const _0x42a89c=a59_0x154119,_0x719d65=a59_0x53da8a['join'](getConfigDir(),'tdx.json');if(!a59_0x45afe6[_0x42a89c(0xf3)](_0x719d65))return{};try{const _0x468188=a59_0x45afe6['readFileSync'](_0x719d65,_0x42a89c(0xf2));return JSON[_0x42a89c(0x103)](_0x468188);}catch{return{};}}[a59_0x154119(0x13f)](_0x4d991e){const _0x4904c9=a59_0x154119;_0x4d991e[_0x4904c9(0x133)]=this[_0x4904c9(0x133)],!_0x4d991e[_0x4904c9(0x100)]&&this['database']&&(_0x4d991e[_0x4904c9(0x100)]=this[_0x4904c9(0x100)]),!_0x4d991e[_0x4904c9(0x11f)]&&this[_0x4904c9(0x121)]&&(_0x4d991e[_0x4904c9(0x11f)]=this[_0x4904c9(0x121)]),!_0x4d991e[_0x4904c9(0xef)]&&this['segment_path']&&(_0x4d991e[_0x4904c9(0xef)]=this['segment_path']),!_0x4d991e[_0x4904c9(0x115)]&&this['llm_project']&&(_0x4d991e['llmProject']=this[_0x4904c9(0x136)]),!_0x4d991e[_0x4904c9(0x134)]&&this['llm_agent']&&(_0x4d991e[_0x4904c9(0x134)]=this[_0x4904c9(0x102)]),!_0x4d991e[_0x4904c9(0xf8)]&&this[_0x4904c9(0x120)]&&(_0x4d991e[_0x4904c9(0xf8)]=this['workflow_project']);}[a59_0x154119(0xf4)](){const _0x40c1e0=a59_0x154119;return[{'key':'site','value':this['site']},{'key':'database','value':this['database']},{'key':_0x40c1e0(0x121),'value':this[_0x40c1e0(0x121)]},{'key':_0x40c1e0(0xfe),'value':this[_0x40c1e0(0xfe)]},{'key':_0x40c1e0(0x136),'value':this[_0x40c1e0(0x136)]},{'key':_0x40c1e0(0x102),'value':this[_0x40c1e0(0x102)]},{'key':_0x40c1e0(0x120),'value':this['workflow_project']},{'key':_0x40c1e0(0x10f),'value':this[_0x40c1e0(0x130)]||undefined}];}['display'](){const _0x3354d0=a59_0x154119;console['log'](a59_0x183456['bold']('[context]'));for(const {key:_0x143836,value:_0x57536e}of this[_0x3354d0(0xf4)]()){_0x57536e&&console[_0x3354d0(0xf0)](a59_0x183456['cyan'](_0x143836)+':\x20'+_0x57536e);}}[a59_0x154119(0x127)](){const _0x935551=a59_0x154119;console['log'](a59_0x183456[_0x935551(0x119)](_0x935551(0x117)));for(const {key:_0x10e70e,value:_0x161b82}of this['getParameters']()){if(_0x161b82){const _0x53807a=_0x10e70e===_0x935551(0x10f)?_0x935551(0x109):'('+this[_0x935551(0xee)](_0x10e70e,_0x161b82)+')';console[_0x935551(0xf0)](a59_0x183456['cyan'](_0x10e70e)+':\x20'+_0x161b82+'\x20'+a59_0x183456[_0x935551(0x11d)](_0x53807a));}}console[_0x935551(0xf0)]('\x0a'+a59_0x183456[_0x935551(0x119)](_0x935551(0x13d)));const _0x1da050=[{'label':_0x935551(0x128),'path':this['configFiles'][_0x935551(0x10d)],'extra':_0x935551(0x114)+this[_0x935551(0xed)]+')'},{'label':_0x935551(0x10b),'path':this[_0x935551(0x12f)]['project']},{'label':'Profile','path':this[_0x935551(0x12f)][_0x935551(0x10f)]},{'label':_0x935551(0x10a),'path':this[_0x935551(0x12f)][_0x935551(0xf1)]},{'label':_0x935551(0x13a),'path':this[_0x935551(0x12f)]['global']},{'label':_0x935551(0xf5),'path':this['configFiles'][_0x935551(0x129)]}];for(const {label:_0x46abb2,path:_0x159589,extra:_0x21de3c}of _0x1da050){if(_0x159589)console[_0x935551(0xf0)](a59_0x183456[_0x935551(0x12a)](_0x46abb2)+':\x20'+_0x159589+'\x20'+a59_0x183456['green']('✓')+(_0x21de3c?'\x20'+a59_0x183456[_0x935551(0x11d)](_0x21de3c):''));else{if(_0x46abb2===_0x935551(0x128))console[_0x935551(0xf0)](a59_0x183456[_0x935551(0x12a)](_0x46abb2)+':\x20'+a59_0x183456[_0x935551(0x11d)](_0x935551(0x106))+'\x20'+a59_0x183456[_0x935551(0x11d)](_0x935551(0x13c)+this[_0x935551(0xed)]+')'));else(_0x46abb2===_0x935551(0x10b)||_0x46abb2===_0x935551(0x13a))&&console[_0x935551(0xf0)](a59_0x183456[_0x935551(0x12a)](_0x46abb2)+':\x20'+a59_0x183456['dim'](_0x935551(0x106)));}}}async[a59_0x154119(0x11a)](){const _0x20a9c8=a59_0x154119;if(!this['accessToken']){const _0x289afa=await getOAuthTokens(this['activeProfile']||undefined);if(_0x289afa)return this[_0x20a9c8(0x139)]=_0x289afa[_0x20a9c8(0xf7)],undefined;}return this['apiKey']=await getAPIKeyAsync(this['site'],this[_0x20a9c8(0x130)]||undefined),this['apiKey'];}static async[a59_0x154119(0x12c)](_0x3c045b){const _0x350cd6=a59_0x154119,_0x4e46ea=new GlobalContext(_0x3c045b);return await _0x4e46ea[_0x350cd6(0x11a)](),_0x4e46ea;}}
1
+ const a59_0x21d07b=a59_0x2676;(function(_0x4e98e6,_0x3a62ce){const _0x53d38f=a59_0x2676,_0x2bcf37=_0x4e98e6();while(!![]){try{const _0x502865=-parseInt(_0x53d38f(0xbb))/0x1+parseInt(_0x53d38f(0xd8))/0x2+-parseInt(_0x53d38f(0xb8))/0x3+-parseInt(_0x53d38f(0xa8))/0x4+-parseInt(_0x53d38f(0x9e))/0x5+parseInt(_0x53d38f(0xcd))/0x6*(-parseInt(_0x53d38f(0xa1))/0x7)+parseInt(_0x53d38f(0x9c))/0x8;if(_0x502865===_0x3a62ce)break;else _0x2bcf37['push'](_0x2bcf37['shift']());}catch(_0x1620ad){_0x2bcf37['push'](_0x2bcf37['shift']());}}}(a59_0x4f47,0xa3838));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 a59_0x464611 from'node:fs';function a59_0x4f47(){const _0x1c2b10=['getSource','.json','accessToken','llmAgent','profiles','llm_project','Global\x20Credentials','access_token','dim','bold','profileCredentials','cliFlags','profileSource','6737778kmQwei','globalCredentials','verbose','.env','proxy','readFileSync','profile','entries','parse','config','none','960032FwIXzy','session','parent_segment','[context]','database','log','join','llmProject','loadGlobalConfig','parentSegment','assign','workflow_project','activeProfile','existsSync','injectIntoOptions','project','cyan','segment_path','logLevel','26371792LdlwKA','cli','2398125EonRuI','Session','createAsync','7ILoqbI','green','us01','llm_agent','env','Project','Profile\x20Credentials','2538632GhHZCU','layers','global','tdx.json','replace','apiKey','string','workflowProject','configFiles','resolveAPIKeyAsync','utf-8','profile:\x20','sessionId','sessions','getParameters','Profile','2080278XJHZCl','(using\x20session:\x20','site','176066EwVRAF','not\x20set','[configuration\x20files]','Global','segmentPath'];a59_0x4f47=function(){return _0x1c2b10;};return a59_0x4f47();}function a59_0x2676(_0x4f4a50,_0x154c30){_0x4f4a50=_0x4f4a50-0x8c;const _0x4f47d2=a59_0x4f47();let _0x26767d=_0x4f47d2[_0x4f4a50];return _0x26767d;}import*as a59_0x58eef7 from'node:path';import a59_0x5282a3 from'chalk';export class GlobalContext{[a59_0x21d07b(0xba)];[a59_0x21d07b(0x8d)];[a59_0x21d07b(0xda)];[a59_0x21d07b(0x9a)];[a59_0x21d07b(0xc5)];[a59_0x21d07b(0xa4)];[a59_0x21d07b(0x94)];[a59_0x21d07b(0xad)];[a59_0x21d07b(0xc2)];[a59_0x21d07b(0xd1)];[a59_0x21d07b(0xcf)];[a59_0x21d07b(0x9b)];[a59_0x21d07b(0xd3)];[a59_0x21d07b(0xcc)]=null;[a59_0x21d07b(0xa9)];[a59_0x21d07b(0x95)];['sessionId'];[a59_0x21d07b(0xb0)];constructor(_0x255c54){const _0x33ba02=a59_0x21d07b;this[_0x33ba02(0xb4)]=getSessionID(_0x255c54[_0x33ba02(0xd9)]);const _0x16b430=loadSessionContext(_0x255c54['session']),_0x463c2c=loadProjectConfig(),_0x38ccee=this[_0x33ba02(0x91)]();if(_0x255c54['profile'])this[_0x33ba02(0x95)]=_0x255c54[_0x33ba02(0xd3)],this[_0x33ba02(0xcc)]=_0x33ba02(0x9d);else{if(_0x16b430?.[_0x33ba02(0xd3)])this[_0x33ba02(0x95)]=_0x16b430[_0x33ba02(0xd3)],this['profileSource']=_0x33ba02(0xd9);else{if(_0x38ccee[_0x33ba02(0xd3)])this[_0x33ba02(0x95)]=_0x38ccee[_0x33ba02(0xd3)],this[_0x33ba02(0xcc)]=_0x33ba02(0xd6);else process.env.TDX_PROFILE?(this[_0x33ba02(0x95)]=process.env.TDX_PROFILE,this['profileSource']=_0x33ba02(0xa5)):(this[_0x33ba02(0x95)]=null,this[_0x33ba02(0xcc)]=null);}}const _0x1b0148=this['activeProfile']?loadProfile(this[_0x33ba02(0x95)]):null,_0xb53f16=_0x12364e=>{const _0x451d1b=_0x33ba02;if(!_0x12364e)return{};const _0x2a26b2=_0x12364e,_0x48846f={};for(const [_0x4976cb,_0x258553]of Object[_0x451d1b(0xd4)](_0x2a26b2)){typeof _0x258553===_0x451d1b(0xae)&&(_0x48846f[_0x4976cb]=_0x258553);}return _0x48846f;},_0x3f2136={},_0x235095=(_0x3c1abd,_0x59e5b0,_0x504fca)=>{const _0x250065=_0x33ba02;if(!_0x3c1abd)return![];if(_0x504fca&&_0x3c1abd===_0x504fca)return![];const _0x167fd3=_0x16b430,_0x5c5553=_0x463c2c,_0x24f9d7=_0x1b0148?.[_0x250065(0xd6)],_0x1c975f=_0x38ccee,_0x529c3c=_0x167fd3?.[_0x59e5b0],_0x516e3b=_0x5c5553?.[_0x59e5b0],_0x57eba6=_0x24f9d7?.[_0x59e5b0],_0x3c7f2b=_0x1c975f[_0x59e5b0];return _0x3c1abd!==_0x529c3c&&_0x3c1abd!==_0x516e3b&&_0x3c1abd!==_0x57eba6&&_0x3c1abd!==_0x3c7f2b;},_0x59bb00=[{'optionKey':_0x33ba02(0xba),'contextKey':_0x33ba02(0xba),'defaultValue':_0x33ba02(0xa3)},{'optionKey':_0x33ba02(0x8d),'contextKey':_0x33ba02(0x8d)},{'optionKey':_0x33ba02(0x92),'contextKey':'parent_segment'},{'optionKey':'llmProject','contextKey':_0x33ba02(0xc5)},{'optionKey':'llmAgent','contextKey':_0x33ba02(0xa4)},{'optionKey':'profile','contextKey':_0x33ba02(0xd3)}];for(const {optionKey:_0x3e9d55,contextKey:_0x28c9c9,defaultValue:_0x540777}of _0x59bb00){const _0x97576f=_0x255c54[_0x3e9d55];_0x235095(_0x97576f,_0x28c9c9,_0x540777)&&(_0x3f2136[_0x28c9c9]=_0x97576f);}this['layers']={'cliFlags':_0x3f2136,'session':_0xb53f16(_0x16b430),'project':_0xb53f16(_0x463c2c),'profile':_0xb53f16(_0x1b0148?.['config']),'global':_0xb53f16(_0x38ccee)};const _0x44d375={...this[_0x33ba02(0xa9)][_0x33ba02(0xaa)],...this[_0x33ba02(0xa9)][_0x33ba02(0xd3)],...this['layers'][_0x33ba02(0x98)]};process.env.TDX_SITE&&!this['layers'][_0x33ba02(0xd9)][_0x33ba02(0xba)]&&!this[_0x33ba02(0xa9)]['cliFlags'][_0x33ba02(0xba)]&&(_0x44d375[_0x33ba02(0xba)]=process.env.TDX_SITE);Object[_0x33ba02(0x93)](_0x44d375,this['layers'][_0x33ba02(0xd9)]),Object[_0x33ba02(0x93)](_0x44d375,this[_0x33ba02(0xa9)][_0x33ba02(0xcb)]);const _0xdf8835=_0x44d375[_0x33ba02(0xba)]||_0x33ba02(0xa3);this[_0x33ba02(0xba)]=resolveSite(_0xdf8835),this[_0x33ba02(0x8d)]=_0x44d375[_0x33ba02(0x8d)],this[_0x33ba02(0xda)]=_0x44d375[_0x33ba02(0xda)],this[_0x33ba02(0x9a)]=_0x44d375[_0x33ba02(0x9a)],this[_0x33ba02(0xc5)]=_0x44d375['llm_project'],this[_0x33ba02(0xa4)]=_0x44d375[_0x33ba02(0xa4)],this['workflow_project']=_0x44d375[_0x33ba02(0x94)],this['verbose']=_0x255c54[_0x33ba02(0xcf)]||![],this[_0x33ba02(0x9b)]=_0x255c54[_0x33ba02(0x9b)]??LogLevel['INFO'],this[_0x33ba02(0xd3)]=this[_0x33ba02(0x95)]||undefined,this[_0x33ba02(0xc2)]=getAccessToken(this[_0x33ba02(0x95)]||undefined),this[_0x33ba02(0xad)]=getAPIKey(this[_0x33ba02(0x95)]||undefined);const _0x3c48d8=typeof _0x38ccee[_0x33ba02(0xd1)]===_0x33ba02(0xae)?_0x38ccee[_0x33ba02(0xd1)]:undefined;this[_0x33ba02(0xd1)]=_0x3c48d8||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x470081=getConfigDir(),_0x171c1d=a59_0x58eef7[_0x33ba02(0x8f)](_0x470081,_0x33ba02(0xb5),this[_0x33ba02(0xb4)]+_0x33ba02(0xc1)),_0xad73df=findProjectConfigPath(),_0x456787=a59_0x58eef7[_0x33ba02(0x8f)](_0x470081,'tdx.json'),_0xb0dcd7=a59_0x58eef7[_0x33ba02(0x8f)](_0x470081,_0x33ba02(0xd0));let _0xbd2810=null,_0x30bab2=null;this[_0x33ba02(0x95)]&&(_0xbd2810=a59_0x58eef7[_0x33ba02(0x8f)](_0x470081,'profiles',this['activeProfile'],_0x33ba02(0xab)),_0x30bab2=a59_0x58eef7['join'](_0x470081,_0x33ba02(0xc4),this[_0x33ba02(0x95)],_0x33ba02(0xd0))),this['configFiles']={'session':a59_0x464611[_0x33ba02(0x96)](_0x171c1d)?_0x171c1d:null,'project':_0xad73df,'profile':_0xbd2810&&a59_0x464611['existsSync'](_0xbd2810)?_0xbd2810:null,'profileCredentials':_0x30bab2&&a59_0x464611['existsSync'](_0x30bab2)?_0x30bab2:null,'global':a59_0x464611[_0x33ba02(0x96)](_0x456787)?_0x456787:null,'globalCredentials':a59_0x464611[_0x33ba02(0x96)](_0xb0dcd7)?_0xb0dcd7:null};}['getSource'](_0x9e95c7,_0x2af805){const _0x545545=a59_0x21d07b;if(!_0x2af805)return _0x545545(0xbc);const _0x477271=_0x2af805;if(this[_0x545545(0xa9)][_0x545545(0xcb)][_0x9e95c7]===_0x477271){if(_0x9e95c7==='site'&&_0x477271===_0x545545(0xa3)&&!this[_0x545545(0xa9)][_0x545545(0xd9)]['site']&&!this['layers'][_0x545545(0x98)][_0x545545(0xba)]&&!this['layers'][_0x545545(0xd3)][_0x545545(0xba)]&&!this[_0x545545(0xa9)][_0x545545(0xaa)][_0x545545(0xba)])return'default';return'CLI\x20flag:\x20--'+_0x9e95c7[_0x545545(0xac)](/_/g,'-');}if(this['layers'][_0x545545(0xd9)][_0x9e95c7]===_0x477271)return _0x545545(0xd9);if(this[_0x545545(0xa9)]['project'][_0x9e95c7]===_0x477271)return _0x545545(0x98);if(this[_0x545545(0xa9)][_0x545545(0xd3)][_0x9e95c7]===_0x477271)return _0x545545(0xb3)+this[_0x545545(0x95)];if(this[_0x545545(0xa9)][_0x545545(0xaa)][_0x9e95c7]===_0x477271)return _0x545545(0xaa);return'default';}['loadGlobalConfig'](){const _0x30262f=a59_0x21d07b,_0x352253=a59_0x58eef7['join'](getConfigDir(),_0x30262f(0xab));if(!a59_0x464611[_0x30262f(0x96)](_0x352253))return{};try{const _0xac7075=a59_0x464611[_0x30262f(0xd2)](_0x352253,_0x30262f(0xb2));return JSON[_0x30262f(0xd5)](_0xac7075);}catch{return{};}}[a59_0x21d07b(0x97)](_0x21d0d9){const _0x1841a7=a59_0x21d07b;_0x21d0d9['site']=this['site'],!_0x21d0d9['database']&&this[_0x1841a7(0x8d)]&&(_0x21d0d9[_0x1841a7(0x8d)]=this[_0x1841a7(0x8d)]),!_0x21d0d9[_0x1841a7(0x92)]&&this['parent_segment']&&(_0x21d0d9[_0x1841a7(0x92)]=this[_0x1841a7(0xda)]),!_0x21d0d9[_0x1841a7(0xbf)]&&this[_0x1841a7(0x9a)]&&(_0x21d0d9[_0x1841a7(0xbf)]=this[_0x1841a7(0x9a)]),!_0x21d0d9[_0x1841a7(0x90)]&&this[_0x1841a7(0xc5)]&&(_0x21d0d9[_0x1841a7(0x90)]=this['llm_project']),!_0x21d0d9['llmAgent']&&this[_0x1841a7(0xa4)]&&(_0x21d0d9[_0x1841a7(0xc3)]=this[_0x1841a7(0xa4)]),!_0x21d0d9[_0x1841a7(0xaf)]&&this['workflow_project']&&(_0x21d0d9['workflowProject']=this[_0x1841a7(0x94)]);}[a59_0x21d07b(0xb6)](){const _0x2a284b=a59_0x21d07b;return[{'key':_0x2a284b(0xba),'value':this['site']},{'key':'database','value':this[_0x2a284b(0x8d)]},{'key':_0x2a284b(0xda),'value':this[_0x2a284b(0xda)]},{'key':'segment_path','value':this[_0x2a284b(0x9a)]},{'key':'llm_project','value':this[_0x2a284b(0xc5)]},{'key':'llm_agent','value':this[_0x2a284b(0xa4)]},{'key':_0x2a284b(0x94),'value':this[_0x2a284b(0x94)]},{'key':_0x2a284b(0xd3),'value':this[_0x2a284b(0x95)]||undefined}];}['display'](){const _0x11beda=a59_0x21d07b;console[_0x11beda(0x8e)](a59_0x5282a3[_0x11beda(0xc9)](_0x11beda(0x8c)));for(const {key:_0x2cb3e4,value:_0x2d5068}of this[_0x11beda(0xb6)]()){_0x2d5068&&console['log'](a59_0x5282a3[_0x11beda(0x99)](_0x2cb3e4)+':\x20'+_0x2d5068);}}['displayWithSources'](){const _0x2a982f=a59_0x21d07b;console[_0x2a982f(0x8e)](a59_0x5282a3[_0x2a982f(0xc9)](_0x2a982f(0x8c)));for(const {key:_0x44b150,value:_0x5666b9}of this[_0x2a982f(0xb6)]()){if(_0x5666b9){const _0x2d0727=_0x44b150===_0x2a982f(0xd3)?'(active)':'('+this[_0x2a982f(0xc0)](_0x44b150,_0x5666b9)+')';console[_0x2a982f(0x8e)](a59_0x5282a3['cyan'](_0x44b150)+':\x20'+_0x5666b9+'\x20'+a59_0x5282a3[_0x2a982f(0xc8)](_0x2d0727));}}console[_0x2a982f(0x8e)]('\x0a'+a59_0x5282a3[_0x2a982f(0xc9)](_0x2a982f(0xbd)));const _0x48037f=[{'label':_0x2a982f(0x9f),'path':this['configFiles'][_0x2a982f(0xd9)],'extra':'(session:\x20'+this['sessionId']+')'},{'label':_0x2a982f(0xa6),'path':this[_0x2a982f(0xb0)][_0x2a982f(0x98)]},{'label':_0x2a982f(0xb7),'path':this[_0x2a982f(0xb0)][_0x2a982f(0xd3)]},{'label':_0x2a982f(0xa7),'path':this['configFiles'][_0x2a982f(0xca)]},{'label':_0x2a982f(0xbe),'path':this[_0x2a982f(0xb0)][_0x2a982f(0xaa)]},{'label':_0x2a982f(0xc6),'path':this[_0x2a982f(0xb0)][_0x2a982f(0xce)]}];for(const {label:_0x2eea5c,path:_0x44c050,extra:_0x1d3c37}of _0x48037f){if(_0x44c050)console[_0x2a982f(0x8e)](a59_0x5282a3[_0x2a982f(0x99)](_0x2eea5c)+':\x20'+_0x44c050+'\x20'+a59_0x5282a3[_0x2a982f(0xa2)]('✓')+(_0x1d3c37?'\x20'+a59_0x5282a3['dim'](_0x1d3c37):''));else{if(_0x2eea5c===_0x2a982f(0x9f))console[_0x2a982f(0x8e)](a59_0x5282a3['cyan'](_0x2eea5c)+':\x20'+a59_0x5282a3[_0x2a982f(0xc8)](_0x2a982f(0xd7))+'\x20'+a59_0x5282a3[_0x2a982f(0xc8)](_0x2a982f(0xb9)+this[_0x2a982f(0xb4)]+')'));else(_0x2eea5c===_0x2a982f(0xa6)||_0x2eea5c===_0x2a982f(0xbe))&&console[_0x2a982f(0x8e)](a59_0x5282a3['cyan'](_0x2eea5c)+':\x20'+a59_0x5282a3[_0x2a982f(0xc8)](_0x2a982f(0xd7)));}}}async[a59_0x21d07b(0xb1)](){const _0xc37696=a59_0x21d07b;if(!this['accessToken']){const _0x847b61=await getOAuthTokens(this['activeProfile']||undefined);if(_0x847b61)return this[_0xc37696(0xc2)]=_0x847b61[_0xc37696(0xc7)],undefined;}return this[_0xc37696(0xad)]=await getAPIKeyAsync(this[_0xc37696(0xba)],this[_0xc37696(0x95)]||undefined),this[_0xc37696(0xad)];}static async[a59_0x21d07b(0xa0)](_0x5318b8){const _0x392a84=new GlobalContext(_0x5318b8);return await _0x392a84['resolveAPIKeyAsync'](),_0x392a84;}}
@@ -1 +1 @@
1
- const a60_0x4bab1c=a60_0x5984;function a60_0x5984(_0x29e479,_0x290ae5){_0x29e479=_0x29e479-0x189;const _0xd2c69=a60_0xd2c6();let _0x598403=_0xd2c69[_0x29e479];return _0x598403;}(function(_0x447248,_0x12c937){const _0x22b63d=a60_0x5984,_0xd3dc20=_0x447248();while(!![]){try{const _0x1ee97b=-parseInt(_0x22b63d(0x189))/0x1*(-parseInt(_0x22b63d(0x19b))/0x2)+-parseInt(_0x22b63d(0x18c))/0x3*(parseInt(_0x22b63d(0x19e))/0x4)+parseInt(_0x22b63d(0x1a0))/0x5+-parseInt(_0x22b63d(0x196))/0x6+parseInt(_0x22b63d(0x19a))/0x7+parseInt(_0x22b63d(0x1a5))/0x8*(-parseInt(_0x22b63d(0x19d))/0x9)+parseInt(_0x22b63d(0x193))/0xa;if(_0x1ee97b===_0x12c937)break;else _0xd3dc20['push'](_0xd3dc20['shift']());}catch(_0x3b627d){_0xd3dc20['push'](_0xd3dc20['shift']());}}}(a60_0xd2c6,0x1b082));const SERVICE_NAME=a60_0x4bab1c(0x192);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x3755a4=a60_0x4bab1c;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x28ca48=await import(_0x3755a4(0x191));return EntryClass=_0x28ca48[_0x3755a4(0x1a4)],EntryClass;}catch(_0x2f3df7){return keyringLoadError=_0x2f3df7 instanceof Error?_0x2f3df7:new Error(String(_0x2f3df7)),null;}}function getAccountName(_0x17792d){const _0x444012=a60_0x4bab1c,_0x14b57e=_0x17792d||'';return _0x444012(0x198)+_0x14b57e+_0x444012(0x1a6);}export async function getKeychainAPIKey(_0xb680a){const _0x5ce0d1=a60_0x4bab1c,_0x4aceff=await getKeychainAPIKeyWithStatus(_0xb680a);if(_0x4aceff[_0x5ce0d1(0x18f)])return _0x4aceff[_0x5ce0d1(0x197)];return _0x4aceff[_0x5ce0d1(0x18e)]===_0x5ce0d1(0x18a)&&console['error']('Warning:\x20'+_0x4aceff[_0x5ce0d1(0x1a2)]),null;}export async function getKeychainAPIKeyWithStatus(_0x3baace){const _0xe0cc85=a60_0x4bab1c;try{const _0x6f0c37=await getEntryClass();if(!_0x6f0c37)return{'success':![],'reason':_0xe0cc85(0x19f)};const _0x1ff89c=getAccountName(_0x3baace),_0x2f1c9c=new _0x6f0c37(SERVICE_NAME,_0x1ff89c),_0x395b62=_0x2f1c9c['getPassword']();if(_0x395b62)return{'success':!![],'value':_0x395b62};return{'success':![],'reason':_0xe0cc85(0x199)};}catch(_0x20745f){const _0x50dd50=_0x20745f instanceof Error?_0x20745f[_0xe0cc85(0x1a2)]:String(_0x20745f);if(_0x50dd50[_0xe0cc85(0x195)](_0xe0cc85(0x19c))||_0x50dd50[_0xe0cc85(0x190)]()[_0xe0cc85(0x195)]('could\x20not\x20be\x20found')||_0x50dd50[_0xe0cc85(0x190)]()[_0xe0cc85(0x195)](_0xe0cc85(0x18d))||_0x50dd50[_0xe0cc85(0x190)]()[_0xe0cc85(0x195)](_0xe0cc85(0x1a8)))return{'success':![],'reason':'not_found'};if(_0x50dd50[_0xe0cc85(0x195)](_0xe0cc85(0x1a3))||_0x50dd50['toLowerCase']()[_0xe0cc85(0x195)]('restricted')||_0x50dd50[_0xe0cc85(0x190)]()[_0xe0cc85(0x195)]('access'))return{'success':![],'reason':_0xe0cc85(0x18a),'message':'Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.'};return{'success':![],'reason':'unavailable','message':_0x50dd50};}}function a60_0xd2c6(){const _0xb99096=['9Icnxpa','740LKdWcS','unavailable','442575pNRZEL','cannot\x20find','message','-25293','Entry','715736cKAOUQ',':api_key','getPassword','no\x20matching\x20entry','7JvVLjI','access_denied','not\x20supported','1245JFXjey','not\x20found','reason','success','toLowerCase','@napi-rs/keyring','tdx','213120BPHZyy','System\x20keychain\x20is\x20not\x20available','includes','133158rCjPUU','value','profile:','not_found','657097SSAxhF','27274LSXQZJ','-25300'];a60_0xd2c6=function(){return _0xb99096;};return a60_0xd2c6();}export async function saveKeychainAPIKey(_0x429663,_0xfcfa17){const _0x2b45f2=a60_0x4bab1c,_0x45d720=await getEntryClass();if(!_0x45d720)throw new Error(_0x2b45f2(0x194));const _0x603c5a=getAccountName(_0xfcfa17),_0x4f51fe=new _0x45d720(SERVICE_NAME,_0x603c5a);_0x4f51fe['setPassword'](_0x429663);}export async function deleteKeychainAPIKey(_0x37e1a5){try{const _0x3ff5e4=await getEntryClass();if(!_0x3ff5e4)return![];const _0x15a5cc=getAccountName(_0x37e1a5),_0x2dec6c=new _0x3ff5e4(SERVICE_NAME,_0x15a5cc);return _0x2dec6c['deleteCredential'](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0xd4b8cf=a60_0x4bab1c;try{const _0x3a02c7=await getEntryClass();if(!_0x3a02c7)return![];const _0x35007a=new _0x3a02c7(SERVICE_NAME,'__keychain_test__');return _0x35007a[_0xd4b8cf(0x1a7)](),!![];}catch(_0x2477ec){const _0x274eea=_0x2477ec instanceof Error?_0x2477ec[_0xd4b8cf(0x1a2)][_0xd4b8cf(0x190)]():'';if(_0x274eea[_0xd4b8cf(0x195)]('not\x20available')||_0x274eea[_0xd4b8cf(0x195)](_0xd4b8cf(0x18b))||_0x274eea[_0xd4b8cf(0x195)](_0xd4b8cf(0x1a1)))return![];return!![];}}
1
+ const a60_0x235e70=a60_0x5133;(function(_0x2efed3,_0xa9e5c6){const _0x48781d=a60_0x5133,_0x285d66=_0x2efed3();while(!![]){try{const _0x1a293f=parseInt(_0x48781d(0x1d8))/0x1+-parseInt(_0x48781d(0x1ca))/0x2*(-parseInt(_0x48781d(0x1c4))/0x3)+parseInt(_0x48781d(0x1db))/0x4+-parseInt(_0x48781d(0x1c8))/0x5+-parseInt(_0x48781d(0x1ba))/0x6+-parseInt(_0x48781d(0x1d7))/0x7+-parseInt(_0x48781d(0x1b9))/0x8*(-parseInt(_0x48781d(0x1bc))/0x9);if(_0x1a293f===_0xa9e5c6)break;else _0x285d66['push'](_0x285d66['shift']());}catch(_0x52d7a4){_0x285d66['push'](_0x285d66['shift']());}}}(a60_0x5f21,0x29456));const SERVICE_NAME=a60_0x235e70(0x1c0);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x3cbeed=a60_0x235e70;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x2653a7=await import(_0x3cbeed(0x1d1));return EntryClass=_0x2653a7['Entry'],EntryClass;}catch(_0x17ec1d){return keyringLoadError=_0x17ec1d instanceof Error?_0x17ec1d:new Error(String(_0x17ec1d)),null;}}function a60_0x5133(_0x2a9929,_0x34329f){_0x2a9929=_0x2a9929-0x1b9;const _0x5f211c=a60_0x5f21();let _0x5133e8=_0x5f211c[_0x2a9929];return _0x5133e8;}function a60_0x5f21(){const _0x12a9b5=['-25300','deleteCredential','1646475Fnsdlw','access_denied','153646dMkGrQ','message','not\x20supported','setPassword','could\x20not\x20be\x20found','success','includes','@napi-rs/keyring','Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.','profile:','getPassword','value',':api_key','1516116dKhooI','111067GynIkC','access','not_found','1149152ZQvecK','not\x20found','4376pAAVRe','1933566MIKmzV','unavailable','7983dAiDEn','error','cannot\x20find','not\x20available','tdx','toLowerCase','restricted','no\x20matching\x20entry','6tsNzxo','reason'];a60_0x5f21=function(){return _0x12a9b5;};return a60_0x5f21();}function getAccountName(_0x48d3eb){const _0x2e633a=a60_0x235e70,_0x1e7931=_0x48d3eb||'';return _0x2e633a(0x1d3)+_0x1e7931+_0x2e633a(0x1d6);}export async function getKeychainAPIKey(_0x41d24e){const _0x16d775=a60_0x235e70,_0x2f6d9b=await getKeychainAPIKeyWithStatus(_0x41d24e);if(_0x2f6d9b[_0x16d775(0x1cf)])return _0x2f6d9b[_0x16d775(0x1d5)];return _0x2f6d9b[_0x16d775(0x1c5)]===_0x16d775(0x1c9)&&console[_0x16d775(0x1bd)]('Warning:\x20'+_0x2f6d9b[_0x16d775(0x1cb)]),null;}export async function getKeychainAPIKeyWithStatus(_0x2eea01){const _0x33ffb3=a60_0x235e70;try{const _0x5cc7e7=await getEntryClass();if(!_0x5cc7e7)return{'success':![],'reason':_0x33ffb3(0x1bb)};const _0x334be1=getAccountName(_0x2eea01),_0x5c1390=new _0x5cc7e7(SERVICE_NAME,_0x334be1),_0x8edb98=_0x5c1390[_0x33ffb3(0x1d4)]();if(_0x8edb98)return{'success':!![],'value':_0x8edb98};return{'success':![],'reason':_0x33ffb3(0x1da)};}catch(_0x42725d){const _0x536bc1=_0x42725d instanceof Error?_0x42725d[_0x33ffb3(0x1cb)]:String(_0x42725d);if(_0x536bc1['includes'](_0x33ffb3(0x1c6))||_0x536bc1[_0x33ffb3(0x1c1)]()[_0x33ffb3(0x1d0)](_0x33ffb3(0x1ce))||_0x536bc1[_0x33ffb3(0x1c1)]()[_0x33ffb3(0x1d0)](_0x33ffb3(0x1dc))||_0x536bc1[_0x33ffb3(0x1c1)]()[_0x33ffb3(0x1d0)](_0x33ffb3(0x1c3)))return{'success':![],'reason':_0x33ffb3(0x1da)};if(_0x536bc1[_0x33ffb3(0x1d0)]('-25293')||_0x536bc1[_0x33ffb3(0x1c1)]()['includes'](_0x33ffb3(0x1c2))||_0x536bc1['toLowerCase']()[_0x33ffb3(0x1d0)](_0x33ffb3(0x1d9)))return{'success':![],'reason':_0x33ffb3(0x1c9),'message':_0x33ffb3(0x1d2)};return{'success':![],'reason':'unavailable','message':_0x536bc1};}}export async function saveKeychainAPIKey(_0xacffd7,_0xc42443){const _0x6dda81=a60_0x235e70,_0x53f8a9=await getEntryClass();if(!_0x53f8a9)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x1f1e4d=getAccountName(_0xc42443),_0x122492=new _0x53f8a9(SERVICE_NAME,_0x1f1e4d);_0x122492[_0x6dda81(0x1cd)](_0xacffd7);}export async function deleteKeychainAPIKey(_0x2869cf){const _0xbb0ee0=a60_0x235e70;try{const _0x2a6c18=await getEntryClass();if(!_0x2a6c18)return![];const _0x2309d3=getAccountName(_0x2869cf),_0x4c1dc7=new _0x2a6c18(SERVICE_NAME,_0x2309d3);return _0x4c1dc7[_0xbb0ee0(0x1c7)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x18e12c=a60_0x235e70;try{const _0x17bdfe=await getEntryClass();if(!_0x17bdfe)return![];const _0x119e77=new _0x17bdfe(SERVICE_NAME,'__keychain_test__');return _0x119e77[_0x18e12c(0x1d4)](),!![];}catch(_0xa197b5){const _0x40942b=_0xa197b5 instanceof Error?_0xa197b5[_0x18e12c(0x1cb)][_0x18e12c(0x1c1)]():'';if(_0x40942b['includes'](_0x18e12c(0x1bf))||_0x40942b[_0x18e12c(0x1d0)](_0x18e12c(0x1cc))||_0x40942b['includes'](_0x18e12c(0x1be)))return![];return!![];}}
@@ -1 +1 @@
1
- function a61_0x7051(_0x4aaa70,_0x416bea){_0x4aaa70=_0x4aaa70-0x113;const _0x33e869=a61_0x33e8();let _0x705119=_0x33e869[_0x4aaa70];return _0x705119;}(function(_0x1a7468,_0x266411){const _0x1ce42e=a61_0x7051,_0x184df0=_0x1a7468();while(!![]){try{const _0x1922c5=-parseInt(_0x1ce42e(0x117))/0x1*(-parseInt(_0x1ce42e(0x11b))/0x2)+-parseInt(_0x1ce42e(0x120))/0x3+-parseInt(_0x1ce42e(0x115))/0x4+-parseInt(_0x1ce42e(0x11e))/0x5+-parseInt(_0x1ce42e(0x11a))/0x6*(-parseInt(_0x1ce42e(0x119))/0x7)+parseInt(_0x1ce42e(0x114))/0x8+-parseInt(_0x1ce42e(0x113))/0x9;if(_0x1922c5===_0x266411)break;else _0x184df0['push'](_0x184df0['shift']());}catch(_0x489eb3){_0x184df0['push'](_0x184df0['shift']());}}}(a61_0x33e8,0x7e602));const SERVICE_NAME='tdx';let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x575c9f=a61_0x7051;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x2ede7a=await import('@napi-rs/keyring');return EntryClass=_0x2ede7a[_0x575c9f(0x11c)],EntryClass;}catch(_0x26ac91){return keyringLoadError=_0x26ac91 instanceof Error?_0x26ac91:new Error(String(_0x26ac91)),null;}}function a61_0x33e8(){const _0x1d76af=['93585nCggWE','getPassword','288144ldiuoM','5049189aiyaoK','6723752jCLCvC','4120596WyPqrL','deleteCredential','495745oWMfGV','System\x20keychain\x20is\x20not\x20available','10955lbHROJ','3402RvMaHG','2ZlfeEP','Entry',':oauth_tokens'];a61_0x33e8=function(){return _0x1d76af;};return a61_0x33e8();}function getOAuthAccountName(_0x14d5e5){const _0x438407=a61_0x7051,_0x570007=_0x14d5e5||'';return'profile:'+_0x570007+_0x438407(0x11d);}export async function saveOAuthTokens(_0x4ce9d0,_0x4e55ca){const _0x1d5619=a61_0x7051,_0x2179b7=await getEntryClass();if(!_0x2179b7)throw new Error(_0x1d5619(0x118));const _0x4a28e1=getOAuthAccountName(_0x4e55ca),_0x299e0f=new _0x2179b7(SERVICE_NAME,_0x4a28e1);_0x299e0f['setPassword'](JSON['stringify'](_0x4ce9d0));}export async function getOAuthTokens(_0x2fadbd){const _0x1afe72=a61_0x7051;try{const _0x4ddf03=await getEntryClass();if(!_0x4ddf03)return null;const _0x4fca7f=getOAuthAccountName(_0x2fadbd),_0x51a8f0=new _0x4ddf03(SERVICE_NAME,_0x4fca7f),_0x6588a=_0x51a8f0[_0x1afe72(0x11f)]();if(_0x6588a)return JSON['parse'](_0x6588a);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x39d7d7){const _0x13aaba=a61_0x7051;try{const _0x194627=await getEntryClass();if(!_0x194627)return![];const _0x48dc3e=getOAuthAccountName(_0x39d7d7),_0x20c80d=new _0x194627(SERVICE_NAME,_0x48dc3e);return _0x20c80d[_0x13aaba(0x116)](),!![];}catch{return![];}}
1
+ const a61_0x50e757=a61_0x8549;(function(_0x4213c1,_0x51b175){const _0x259327=a61_0x8549,_0x575ca2=_0x4213c1();while(!![]){try{const _0x57e543=-parseInt(_0x259327(0x189))/0x1+parseInt(_0x259327(0x18b))/0x2*(-parseInt(_0x259327(0x19a))/0x3)+-parseInt(_0x259327(0x18d))/0x4+-parseInt(_0x259327(0x199))/0x5*(-parseInt(_0x259327(0x19b))/0x6)+parseInt(_0x259327(0x194))/0x7+parseInt(_0x259327(0x192))/0x8*(parseInt(_0x259327(0x18c))/0x9)+parseInt(_0x259327(0x195))/0xa;if(_0x57e543===_0x51b175)break;else _0x575ca2['push'](_0x575ca2['shift']());}catch(_0x586792){_0x575ca2['push'](_0x575ca2['shift']());}}}(a61_0x499f,0x4dd74));function a61_0x499f(){const _0x937862=['53031CMRbXd','1668jKGMOz','329376YGkLPY','Entry','70WRyIXI','18IsJDxx','2292140SCvllZ','getPassword','setPassword','deleteCredential',':oauth_tokens','1031656GDNIBT','tdx','560840lGvmAq','14663240sHajJP','@napi-rs/keyring','profile:','System\x20keychain\x20is\x20not\x20available','640ZYkrup'];a61_0x499f=function(){return _0x937862;};return a61_0x499f();}function a61_0x8549(_0x54e73d,_0x5041b8){_0x54e73d=_0x54e73d-0x189;const _0x499fd9=a61_0x499f();let _0x8549c6=_0x499fd9[_0x54e73d];return _0x8549c6;}const SERVICE_NAME=a61_0x50e757(0x193);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0xac85d4=a61_0x50e757;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x1ab981=await import(_0xac85d4(0x196));return EntryClass=_0x1ab981[_0xac85d4(0x18a)],EntryClass;}catch(_0x48cd54){return keyringLoadError=_0x48cd54 instanceof Error?_0x48cd54:new Error(String(_0x48cd54)),null;}}function getOAuthAccountName(_0xb4a4fd){const _0x1df7c8=a61_0x50e757,_0xa7b4d0=_0xb4a4fd||'';return _0x1df7c8(0x197)+_0xa7b4d0+_0x1df7c8(0x191);}export async function saveOAuthTokens(_0x524af3,_0x5e2885){const _0x45660f=a61_0x50e757,_0x3333b9=await getEntryClass();if(!_0x3333b9)throw new Error(_0x45660f(0x198));const _0x4d97d2=getOAuthAccountName(_0x5e2885),_0x6690b=new _0x3333b9(SERVICE_NAME,_0x4d97d2);_0x6690b[_0x45660f(0x18f)](JSON['stringify'](_0x524af3));}export async function getOAuthTokens(_0x572403){const _0x278c7d=a61_0x50e757;try{const _0x31f975=await getEntryClass();if(!_0x31f975)return null;const _0x890483=getOAuthAccountName(_0x572403),_0x3e5228=new _0x31f975(SERVICE_NAME,_0x890483),_0x51d588=_0x3e5228[_0x278c7d(0x18e)]();if(_0x51d588)return JSON['parse'](_0x51d588);return null;}catch{return null;}}export async function deleteOAuthTokens(_0xd42bc6){const _0x15005e=a61_0x50e757;try{const _0x40fe34=await getEntryClass();if(!_0x40fe34)return![];const _0x2ba795=getOAuthAccountName(_0xd42bc6),_0x1d541a=new _0x40fe34(SERVICE_NAME,_0x2ba795);return _0x1d541a[_0x15005e(0x190)](),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a62_0x3bb33d=a62_0x4086;(function(_0x1e1e8d,_0x45d09b){const _0x5d7db0=a62_0x4086,_0xc429ea=_0x1e1e8d();while(!![]){try{const _0x42b977=-parseInt(_0x5d7db0(0x1fc))/0x1+parseInt(_0x5d7db0(0x20c))/0x2+parseInt(_0x5d7db0(0x1f4))/0x3+-parseInt(_0x5d7db0(0x1f9))/0x4+parseInt(_0x5d7db0(0x1fb))/0x5*(parseInt(_0x5d7db0(0x1e7))/0x6)+-parseInt(_0x5d7db0(0x21c))/0x7*(parseInt(_0x5d7db0(0x1e8))/0x8)+parseInt(_0x5d7db0(0x1f3))/0x9;if(_0x42b977===_0x45d09b)break;else _0xc429ea['push'](_0xc429ea['shift']());}catch(_0x440e1c){_0xc429ea['push'](_0xc429ea['shift']());}}}(a62_0x485a,0x8f707));import*as a62_0x35ad9b from'node:crypto';import*as a62_0x4b4158 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a62_0x485a(){const _0x2afb85=['update','base64url','stg-ap03','1843552ylMYmd','/oauth/callback','90490zTpBhP','244569qkossk','end','randomBytes','S256','stg-us01','pathname','dev-us01','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','searchParams','toString','code_challenge','tdx','get','127.0.0.1','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','code','1292946JWHqmb','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','text/plain','waitForCallback','):\x20','POST','redirect_uri','redirectUri','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','dev-eu01','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','text','listen','scope','writeHead','codeChallenge','4769331cajGkw','digest','EADDRINUSE','close','application/x-www-form-urlencoded','set','createServer','http://localhost:','clientId','client_id','OAuth\x20token\x20request\x20failed\x20(','createHash','stg-ap01','24OeiRWO','8KZbWhL','Not\x20Found','response_type','openid\x20email\x20profile','text/html','json','error','url','Port\x20','state','http://127.0.0.1','3389796FyEwSK','2636424CpzJNT','status'];a62_0x485a=function(){return _0x2afb85;};return a62_0x485a();}import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a62_0x3bb33d(0x202),a62_0x3bb33d(0x215),a62_0x3bb33d(0x200),a62_0x3bb33d(0x1e6),a62_0x3bb33d(0x1f8)]);export function isOAuthSupported(_0x5ba09e){return OAUTH_SUPPORTED_SITES['has'](_0x5ba09e);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a62_0x3bb33d(0x223)+OAUTH_CALLBACK_PORT+a62_0x3bb33d(0x1fa);export function getOAuthClientId(){const _0x1883b0=a62_0x3bb33d;return process.env.TD_OAUTH_CLIENT_ID||_0x1883b0(0x207);}export function generatePKCEPair(){const _0x25dff1=a62_0x3bb33d,_0x638062=a62_0x35ad9b[_0x25dff1(0x1fe)](0x20)[_0x25dff1(0x205)](_0x25dff1(0x1f7)),_0x1f8572=a62_0x35ad9b[_0x25dff1(0x227)]('sha256')[_0x25dff1(0x1f6)](_0x638062)[_0x25dff1(0x21d)](_0x25dff1(0x1f7));return{'verifier':_0x638062,'challenge':_0x1f8572};}function a62_0x4086(_0x944360,_0x5d57c9){_0x944360=_0x944360-0x1e6;const _0x485a2e=a62_0x485a();let _0x40866e=_0x485a2e[_0x944360];return _0x40866e;}export function buildAuthorizeURL(_0x4d018e,_0x318afd){const _0x4a3ac7=a62_0x3bb33d,_0x4b26c3=new URL('/oauth/authorize',_0x4d018e);return _0x4b26c3[_0x4a3ac7(0x204)]['set'](_0x4a3ac7(0x1ea),_0x4a3ac7(0x20b)),_0x4b26c3[_0x4a3ac7(0x204)][_0x4a3ac7(0x221)](_0x4a3ac7(0x225),_0x318afd[_0x4a3ac7(0x224)]),_0x4b26c3[_0x4a3ac7(0x204)]['set'](_0x4a3ac7(0x212),_0x318afd[_0x4a3ac7(0x213)]),_0x4b26c3['searchParams']['set'](_0x4a3ac7(0x1f1),_0x318afd[_0x4a3ac7(0x1f1)]),_0x4b26c3[_0x4a3ac7(0x204)][_0x4a3ac7(0x221)](_0x4a3ac7(0x206),_0x318afd[_0x4a3ac7(0x21b)]),_0x4b26c3[_0x4a3ac7(0x204)][_0x4a3ac7(0x221)]('code_challenge_method',_0x4a3ac7(0x1ff)),_0x318afd['scope']&&_0x4b26c3[_0x4a3ac7(0x204)][_0x4a3ac7(0x221)](_0x4a3ac7(0x219),_0x318afd[_0x4a3ac7(0x219)]),_0x4b26c3['toString']();}export async function postTokenRequest(_0x337aba,_0x284c1e){const _0x4c313e=a62_0x3bb33d,_0x693a55=new URLSearchParams(_0x284c1e)[_0x4c313e(0x205)](),_0x1e0085=await fetch(_0x337aba,{'method':_0x4c313e(0x211),'headers':{'Content-Type':_0x4c313e(0x220)},'body':_0x693a55});if(!_0x1e0085['ok']){const _0x31b2ce=await _0x1e0085[_0x4c313e(0x217)]();throw new Error(_0x4c313e(0x226)+_0x1e0085[_0x4c313e(0x1f5)]+_0x4c313e(0x210)+_0x31b2ce);}return await _0x1e0085[_0x4c313e(0x1ed)]();}export async function exchangeCodeForTokens(_0x4b5927,_0x18398f,_0xda4d1d,_0x5e6af7){const _0x333098=_0x4b5927+'/oauth/token';return postTokenRequest(_0x333098,{'grant_type':'authorization_code','client_id':getOAuthClientId(),'code':_0x18398f,'code_verifier':_0xda4d1d,'redirect_uri':_0x5e6af7});}export function startLocalCallbackServer(){const _0x220747=a62_0x3bb33d;let _0x548bdf,_0x15be0c;const _0x118679=new Promise((_0x373626,_0x498921)=>{_0x548bdf=_0x373626,_0x15be0c=_0x498921;}),_0x276c44=a62_0x4b4158[_0x220747(0x222)]((_0xdc4900,_0x44361f)=>{const _0x2325fc=_0x220747,_0x5aacc9=new URL(_0xdc4900[_0x2325fc(0x1ef)]||'/',_0x2325fc(0x1f2));if(_0x5aacc9[_0x2325fc(0x201)]!==_0x2325fc(0x1fa)){_0x44361f['writeHead'](0x194,{'Content-Type':_0x2325fc(0x20e)}),_0x44361f[_0x2325fc(0x1fd)](_0x2325fc(0x1e9));return;}const _0x174c81=_0x5aacc9[_0x2325fc(0x204)][_0x2325fc(0x208)](_0x2325fc(0x20b)),_0xac377b=_0x5aacc9[_0x2325fc(0x204)][_0x2325fc(0x208)]('state'),_0x4c4aab=_0x5aacc9[_0x2325fc(0x204)][_0x2325fc(0x208)](_0x2325fc(0x1ee));if(_0x4c4aab||!_0x174c81||!_0xac377b){_0x44361f[_0x2325fc(0x21a)](0x190,{'Content-Type':_0x2325fc(0x1ec)}),_0x44361f['end']('<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>'),_0x15be0c(new Error(_0x2325fc(0x203)));return;}_0x44361f[_0x2325fc(0x21a)](0xc8,{'Content-Type':_0x2325fc(0x1ec)}),_0x44361f[_0x2325fc(0x1fd)](_0x2325fc(0x20d)),_0x548bdf({'code':_0x174c81,'state':_0xac377b});});_0x276c44['on'](_0x220747(0x1ee),_0x4b24a8=>{const _0x10a54e=_0x220747;_0x4b24a8['code']===_0x10a54e(0x21e)?_0x15be0c(new Error(_0x10a54e(0x1f0)+OAUTH_CALLBACK_PORT+_0x10a54e(0x214))):_0x15be0c(new Error(_0x10a54e(0x216)+_0x4b24a8['message']));}),_0x276c44[_0x220747(0x218)](OAUTH_CALLBACK_PORT,_0x220747(0x209));const _0x19d849=setTimeout(()=>{const _0x5411e1=_0x220747;_0x15be0c(new Error('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes')),_0x276c44[_0x5411e1(0x21f)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x118679,'close':()=>{const _0x30dbdb=_0x220747;clearTimeout(_0x19d849),_0x276c44[_0x30dbdb(0x21f)]();}};}export async function startOAuthFlow(_0x26a987){const _0x4234ad=a62_0x3bb33d,_0x445c8d=getConsoleUrl(_0x26a987),_0x3ad1c2=getOAuthClientId(),{verifier:_0x92a304,challenge:_0x554491}=generatePKCEPair(),_0x3de199=a62_0x35ad9b[_0x4234ad(0x1fe)](0x10)[_0x4234ad(0x205)]('hex'),_0x161f4b=startLocalCallbackServer();try{const _0x486eec=OAUTH_REDIRECT_URI,_0x2cf7b1=buildAuthorizeURL(_0x445c8d,{'clientId':_0x3ad1c2,'redirectUri':_0x486eec,'state':_0x3de199,'codeChallenge':_0x554491,'scope':_0x4234ad(0x1eb)});openBrowser(_0x2cf7b1);const _0x475baf=await _0x161f4b[_0x4234ad(0x20f)]();if(_0x475baf['state']!==_0x3de199)throw new Error(_0x4234ad(0x20a));return await exchangeCodeForTokens(_0x445c8d,_0x475baf[_0x4234ad(0x20b)],_0x92a304,_0x486eec);}finally{_0x161f4b[_0x4234ad(0x21f)]();}}
1
+ const a62_0x12ce39=a62_0x2542;function a62_0x2542(_0x41e842,_0x228888){_0x41e842=_0x41e842-0xc6;const _0x3a0619=a62_0x3a06();let _0x2542c4=_0x3a0619[_0x41e842];return _0x2542c4;}(function(_0x1126a9,_0x4311d0){const _0x3a7b73=a62_0x2542,_0x4027df=_0x1126a9();while(!![]){try{const _0x5a8f9d=-parseInt(_0x3a7b73(0xff))/0x1+parseInt(_0x3a7b73(0xcc))/0x2+parseInt(_0x3a7b73(0xd0))/0x3*(-parseInt(_0x3a7b73(0xd2))/0x4)+parseInt(_0x3a7b73(0xf8))/0x5+-parseInt(_0x3a7b73(0xfd))/0x6+parseInt(_0x3a7b73(0xfb))/0x7+parseInt(_0x3a7b73(0xda))/0x8;if(_0x5a8f9d===_0x4311d0)break;else _0x4027df['push'](_0x4027df['shift']());}catch(_0x176249){_0x4027df['push'](_0x4027df['shift']());}}}(a62_0x3a06,0x78f10));import*as a62_0x3cb65f from'node:crypto';import*as a62_0x1da9b0 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a62_0x3a06(){const _0x418c5d=['2320704UEhbeF','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','/oauth/authorize','message','text/html','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','pathname','base64url','hex','127.0.0.1','searchParams','/oauth/callback','S256','close','text/plain','get','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','http://localhost:','openid\x20email\x20profile','codeChallenge','OAuth\x20token\x20request\x20failed\x20(','http://127.0.0.1','redirectUri','randomBytes','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','POST','writeHead','scope','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','Port\x20','1410190cQpAIQ','createServer','code_challenge','1992452GsvGkB','application/x-www-form-urlencoded','3574380rleTSu','state','387842sYJpQa','redirect_uri','end','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','EADDRINUSE','digest','set','stg-us01','toString','):\x20','status','1842662JwcEPC','stg-ap03','/oauth/token','Not\x20Found','9CIrBHD','authorization_code','398860MZQdkY','dev-eu01','code_challenge_method','update','response_type','client_id','dev-us01','code'];a62_0x3a06=function(){return _0x418c5d;};return a62_0x3a06();}const OAUTH_SUPPORTED_SITES=new Set([a62_0x12ce39(0xd8),a62_0x12ce39(0xd3),a62_0x12ce39(0xc8),'stg-ap01',a62_0x12ce39(0xcd)]);export function isOAuthSupported(_0x9fb195){return OAUTH_SUPPORTED_SITES['has'](_0x9fb195);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a62_0x12ce39(0xeb)+OAUTH_CALLBACK_PORT+'/oauth/callback';export function getOAuthClientId(){return process.env.TD_OAUTH_CLIENT_ID||'tdx';}export function generatePKCEPair(){const _0x4a4c17=a62_0x12ce39,_0x5acc09=a62_0x3cb65f[_0x4a4c17(0xf1)](0x20)[_0x4a4c17(0xc9)](_0x4a4c17(0xe1)),_0x3e5fa5=a62_0x3cb65f['createHash']('sha256')[_0x4a4c17(0xd5)](_0x5acc09)[_0x4a4c17(0xc6)](_0x4a4c17(0xe1));return{'verifier':_0x5acc09,'challenge':_0x3e5fa5};}export function buildAuthorizeURL(_0x44103b,_0x402439){const _0x4c86ea=a62_0x12ce39,_0x712bc9=new URL(_0x4c86ea(0xdc),_0x44103b);return _0x712bc9[_0x4c86ea(0xe4)][_0x4c86ea(0xc7)](_0x4c86ea(0xd6),'code'),_0x712bc9[_0x4c86ea(0xe4)][_0x4c86ea(0xc7)](_0x4c86ea(0xd7),_0x402439['clientId']),_0x712bc9[_0x4c86ea(0xe4)][_0x4c86ea(0xc7)](_0x4c86ea(0x100),_0x402439[_0x4c86ea(0xf0)]),_0x712bc9[_0x4c86ea(0xe4)][_0x4c86ea(0xc7)](_0x4c86ea(0xfe),_0x402439[_0x4c86ea(0xfe)]),_0x712bc9[_0x4c86ea(0xe4)][_0x4c86ea(0xc7)](_0x4c86ea(0xfa),_0x402439[_0x4c86ea(0xed)]),_0x712bc9[_0x4c86ea(0xe4)][_0x4c86ea(0xc7)](_0x4c86ea(0xd4),_0x4c86ea(0xe6)),_0x402439[_0x4c86ea(0xf5)]&&_0x712bc9['searchParams'][_0x4c86ea(0xc7)]('scope',_0x402439[_0x4c86ea(0xf5)]),_0x712bc9[_0x4c86ea(0xc9)]();}export async function postTokenRequest(_0x44ba0d,_0x453231){const _0x185044=a62_0x12ce39,_0x5da694=new URLSearchParams(_0x453231)[_0x185044(0xc9)](),_0xb7e0a1=await fetch(_0x44ba0d,{'method':_0x185044(0xf3),'headers':{'Content-Type':_0x185044(0xfc)},'body':_0x5da694});if(!_0xb7e0a1['ok']){const _0x1541f0=await _0xb7e0a1['text']();throw new Error(_0x185044(0xee)+_0xb7e0a1[_0x185044(0xcb)]+_0x185044(0xca)+_0x1541f0);}return await _0xb7e0a1['json']();}export async function exchangeCodeForTokens(_0x26dceb,_0x35e217,_0x57ff58,_0x9e5f95){const _0x302025=a62_0x12ce39,_0x3a472e=_0x26dceb+_0x302025(0xce);return postTokenRequest(_0x3a472e,{'grant_type':_0x302025(0xd1),'client_id':getOAuthClientId(),'code':_0x35e217,'code_verifier':_0x57ff58,'redirect_uri':_0x9e5f95});}export function startLocalCallbackServer(){const _0x4b9753=a62_0x12ce39;let _0x3a184b,_0x23679b;const _0x582b81=new Promise((_0x5b040a,_0x75445c)=>{_0x3a184b=_0x5b040a,_0x23679b=_0x75445c;}),_0x18bb44=a62_0x1da9b0[_0x4b9753(0xf9)]((_0x325235,_0x5ef3be)=>{const _0x42bd1c=_0x4b9753,_0x14e25b=new URL(_0x325235['url']||'/',_0x42bd1c(0xef));if(_0x14e25b[_0x42bd1c(0xe0)]!==_0x42bd1c(0xe5)){_0x5ef3be['writeHead'](0x194,{'Content-Type':_0x42bd1c(0xe8)}),_0x5ef3be[_0x42bd1c(0x101)](_0x42bd1c(0xcf));return;}const _0x37149c=_0x14e25b[_0x42bd1c(0xe4)][_0x42bd1c(0xe9)](_0x42bd1c(0xd9)),_0x575e2d=_0x14e25b[_0x42bd1c(0xe4)][_0x42bd1c(0xe9)](_0x42bd1c(0xfe)),_0x55e034=_0x14e25b[_0x42bd1c(0xe4)][_0x42bd1c(0xe9)]('error');if(_0x55e034||!_0x37149c||!_0x575e2d){_0x5ef3be[_0x42bd1c(0xf4)](0x190,{'Content-Type':_0x42bd1c(0xde)}),_0x5ef3be[_0x42bd1c(0x101)]('<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>'),_0x23679b(new Error(_0x42bd1c(0xf2)));return;}_0x5ef3be['writeHead'](0xc8,{'Content-Type':_0x42bd1c(0xde)}),_0x5ef3be['end'](_0x42bd1c(0xf6)),_0x3a184b({'code':_0x37149c,'state':_0x575e2d});});_0x18bb44['on']('error',_0x181d8b=>{const _0x3aa001=_0x4b9753;_0x181d8b['code']===_0x3aa001(0x103)?_0x23679b(new Error(_0x3aa001(0xf7)+OAUTH_CALLBACK_PORT+_0x3aa001(0xea))):_0x23679b(new Error(_0x3aa001(0xdb)+_0x181d8b[_0x3aa001(0xdd)]));}),_0x18bb44['listen'](OAUTH_CALLBACK_PORT,_0x4b9753(0xe3));const _0x166ddf=setTimeout(()=>{const _0x4f9a59=_0x4b9753;_0x23679b(new Error(_0x4f9a59(0xdf))),_0x18bb44['close']();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x582b81,'close':()=>{const _0x5de6ee=_0x4b9753;clearTimeout(_0x166ddf),_0x18bb44[_0x5de6ee(0xe7)]();}};}export async function startOAuthFlow(_0x2582da){const _0x9eb12c=a62_0x12ce39,_0x1c24e1=getConsoleUrl(_0x2582da),_0x46d2cd=getOAuthClientId(),{verifier:_0x52fdcf,challenge:_0xfc0a85}=generatePKCEPair(),_0x5f3c3f=a62_0x3cb65f[_0x9eb12c(0xf1)](0x10)['toString'](_0x9eb12c(0xe2)),_0x34331f=startLocalCallbackServer();try{const _0x154ee4=OAUTH_REDIRECT_URI,_0x3a00cf=buildAuthorizeURL(_0x1c24e1,{'clientId':_0x46d2cd,'redirectUri':_0x154ee4,'state':_0x5f3c3f,'codeChallenge':_0xfc0a85,'scope':_0x9eb12c(0xec)});openBrowser(_0x3a00cf);const _0x4dff73=await _0x34331f['waitForCallback']();if(_0x4dff73['state']!==_0x5f3c3f)throw new Error(_0x9eb12c(0x102));return await exchangeCodeForTokens(_0x1c24e1,_0x4dff73[_0x9eb12c(0xd9)],_0x52fdcf,_0x154ee4);}finally{_0x34331f[_0x9eb12c(0xe7)]();}}
@@ -1 +1 @@
1
- const a63_0x1a82e5=a63_0x5209;(function(_0x2e37f4,_0xde6165){const _0x26c9da=a63_0x5209,_0x525f3a=_0x2e37f4();while(!![]){try{const _0x582d60=parseInt(_0x26c9da(0x86))/0x1+parseInt(_0x26c9da(0xa9))/0x2*(-parseInt(_0x26c9da(0xad))/0x3)+parseInt(_0x26c9da(0xa8))/0x4+-parseInt(_0x26c9da(0x8e))/0x5*(-parseInt(_0x26c9da(0xa7))/0x6)+parseInt(_0x26c9da(0x77))/0x7+parseInt(_0x26c9da(0xa0))/0x8+-parseInt(_0x26c9da(0xb4))/0x9*(parseInt(_0x26c9da(0x73))/0xa);if(_0x582d60===_0xde6165)break;else _0x525f3a['push'](_0x525f3a['shift']());}catch(_0x399ea8){_0x525f3a['push'](_0x525f3a['shift']());}}}(a63_0x45ce,0x330fe));import*as a63_0x5b5835 from'node:fs';import*as a63_0x4f58bf from'node:path';function a63_0x5209(_0x4a517d,_0x404403){_0x4a517d=_0x4a517d-0x71;const _0x45ce9a=a63_0x45ce();let _0x5209f9=_0x45ce9a[_0x4a517d];return _0x5209f9;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME=a63_0x1a82e5(0xa6);function a63_0x45ce(){const _0x4600da=['filter','entries','10hIYzMo','object','.\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','warn','tdx.json','from','\x0aWarning:\x20Failed\x20to\x20parse\x20','site','toISOString','Warning:\x20Failed\x20to\x20parse\x20','\x22\x20\x22','localeCompare','database','Warning:\x20Profile\x20\x27','llm_project','parent_segment','existsSync','2282592jgnpDE','To\x20migrate:','string','map','values','parse','@tdx-studio','997518EdlxZc','916684cbKHZw','143086FNIKTT','\x27\x20will\x20be\x20ignored','llm_agent','find','12ZMFTai','Profile\x20','.env','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','rmSync','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','utf-8','72OWCIDm','\x20already\x20exists','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x27:\x20config\x20must\x20be\x20an\x20object','isDirectory','\x20\x201.\x20Edit:\x20','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27',',\x20creating\x20new\x20file','profiles','readFileSync','some','push','description','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','669040CJqTtp','user','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','local','841106qerdgR','join','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','directory','INVALID_PROFILE_CONFIG','message',':\x20Invalid\x20JSON\x20syntax','stringify','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','test','.env.','includes','keys','name','profile','63395EvTSLG','Failed\x20to\x20parse\x20','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','Profile\x20\x27','\x27\x20not\x20found\x20in\x20user\x20configuration','\x20\x20mv\x20\x22'];a63_0x45ce=function(){return _0x4600da;};return a63_0x45ce();}export function getProfileParams(_0x31bcdd){const _0x521d7d=a63_0x1a82e5,_0x26f9c4={};if(!_0x31bcdd)return _0x26f9c4;for(const [_0x5f2bda,_0x437986]of Object[_0x521d7d(0x8d)](_0x31bcdd)){_0x5f2bda!==_0x521d7d(0x71)&&_0x437986!==undefined&&(_0x26f9c4[_0x5f2bda]=_0x437986);}return _0x26f9c4;}export function getProfilesDir(){const _0x15946e=a63_0x1a82e5;return a63_0x4f58bf['join'](getConfigDir(),_0x15946e(0xbc));}function getProfileDir(_0x4356a2){const _0x1489c9=a63_0x1a82e5;return a63_0x4f58bf[_0x1489c9(0x78)](getProfilesDir(),_0x4356a2);}function getProfileConfigPath(_0x349c76){const _0x393099=a63_0x1a82e5;return a63_0x4f58bf['join'](getProfileDir(_0x349c76),_0x393099(0x93));}function getProfileEnvPath(_0x3886e7){return a63_0x4f58bf['join'](getProfileDir(_0x3886e7),'.env');}function getGlobalConfigPath(){const _0x4555bc=a63_0x1a82e5;return a63_0x4f58bf['join'](getConfigDir(),_0x4555bc(0x93));}function validateProfileName(_0x304e63){const _0x5e083d=a63_0x1a82e5;if(/^@?[a-zA-Z0-9_-]+$/['test'](_0x304e63))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x5e083d(0x80)](_0x304e63))return;throw new Error('Invalid\x20profile\x20name:\x20'+_0x304e63+_0x5e083d(0x90));}function validateProfileConfig(_0x2a8101,_0xef2d4a){const _0x4a6e8e=a63_0x1a82e5;if(typeof _0x2a8101!==_0x4a6e8e(0x8f)||_0x2a8101===null)throw new SDKError(ErrorCode[_0x4a6e8e(0x7b)],_0x4a6e8e(0x89)+_0xef2d4a+_0x4a6e8e(0xb7));const _0x3225f4=[_0x4a6e8e(0x71),_0x4a6e8e(0x96),'database',_0x4a6e8e(0x9e),_0x4a6e8e(0x9d),_0x4a6e8e(0xab),'user_info'],_0x2e15e7=_0x2a8101;for(const _0x57b027 of Object[_0x4a6e8e(0x83)](_0x2e15e7)){!_0x3225f4[_0x4a6e8e(0x82)](_0x57b027)&&console[_0x4a6e8e(0x92)](_0x4a6e8e(0x9c)+_0xef2d4a+'\x27:\x20unknown\x20config\x20key\x20\x27'+_0x57b027+_0x4a6e8e(0xaa));}if(_0x2e15e7[_0x4a6e8e(0x71)]!==undefined&&typeof _0x2e15e7['description']!==_0x4a6e8e(0xa2))throw new SDKError(ErrorCode[_0x4a6e8e(0x7b)],_0x4a6e8e(0x89)+_0xef2d4a+_0x4a6e8e(0x79));if(_0x2e15e7['site']!==undefined&&typeof _0x2e15e7[_0x4a6e8e(0x96)]!==_0x4a6e8e(0xa2))throw new SDKError(ErrorCode[_0x4a6e8e(0x7b)],'Profile\x20\x27'+_0xef2d4a+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x2e15e7[_0x4a6e8e(0x9b)]!==undefined&&typeof _0x2e15e7['database']!==_0x4a6e8e(0xa2))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x4a6e8e(0x89)+_0xef2d4a+_0x4a6e8e(0xb0));if(_0x2e15e7[_0x4a6e8e(0x9e)]!==undefined&&typeof _0x2e15e7[_0x4a6e8e(0x9e)]!=='string')throw new SDKError(ErrorCode[_0x4a6e8e(0x7b)],_0x4a6e8e(0x89)+_0xef2d4a+'\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string');if(_0x2e15e7['llm_project']!==undefined&&typeof _0x2e15e7[_0x4a6e8e(0x9d)]!=='string')throw new SDKError(ErrorCode[_0x4a6e8e(0x7b)],_0x4a6e8e(0x89)+_0xef2d4a+_0x4a6e8e(0x75));if(_0x2e15e7['llm_agent']!==undefined&&typeof _0x2e15e7[_0x4a6e8e(0xab)]!==_0x4a6e8e(0xa2))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x4a6e8e(0x89)+_0xef2d4a+_0x4a6e8e(0x88));return!![];}function loadProfilesFromTdxJson(_0xc2bf71,_0x2f0020){const _0x5bdb47=a63_0x1a82e5;if(!a63_0x5b5835[_0x5bdb47(0x9f)](_0xc2bf71))return[];try{const _0x2ed24b=a63_0x5b5835[_0x5bdb47(0xbd)](_0xc2bf71,_0x5bdb47(0xb3)),_0x27ea20=JSON[_0x5bdb47(0xa5)](_0x2ed24b);if(!_0x27ea20[_0x5bdb47(0xbc)]||typeof _0x27ea20['profiles']!=='object')return[];const _0x3f6b02=[];for(const [_0x30bb8a,_0x1bfbfa]of Object['entries'](_0x27ea20['profiles'])){try{validateProfileConfig(_0x1bfbfa,_0x30bb8a);const _0x2ef401=getNewCredentialPath(_0x30bb8a),_0x4d076b=getOldCredentialPath(_0x30bb8a),_0x2137aa=a63_0x5b5835['existsSync'](_0x2ef401)||a63_0x5b5835[_0x5bdb47(0x9f)](_0x4d076b);_0x3f6b02[_0x5bdb47(0xbf)]({'name':_0x30bb8a,'config':_0x1bfbfa,'metadata':{'name':_0x30bb8a,'createdAt':new Date()[_0x5bdb47(0x97)]()},'hasCredentials':_0x2137aa,'scope':_0x2f0020});}catch(_0x5f2327){_0x5f2327 instanceof Error&&(console['warn'](_0x5bdb47(0x7f)+_0xc2bf71+':'),console[_0x5bdb47(0x92)]('\x20\x20'+_0x5f2327[_0x5bdb47(0x7c)]+'\x0a'));}}return _0x3f6b02;}catch(_0x4162af){return _0x4162af instanceof SyntaxError?(console[_0x5bdb47(0x92)](_0x5bdb47(0x95)+_0xc2bf71+_0x5bdb47(0x7d)),console[_0x5bdb47(0x92)]('Error:\x20'+_0x4162af[_0x5bdb47(0x7c)]+'\x0a')):console[_0x5bdb47(0x92)](_0x5bdb47(0xb2)+_0xc2bf71+':\x20'+_0x4162af+'\x0a'),[];}}export function getNewCredentialPath(_0x9a4cda){const _0x3eb6fb=a63_0x1a82e5;return a63_0x4f58bf['join'](getConfigDir(),_0x3eb6fb(0x81)+_0x9a4cda);}function getOldCredentialPath(_0x507144){const _0xf361f0=a63_0x1a82e5;return a63_0x4f58bf['join'](getProfilesDir(),_0x507144,_0xf361f0(0xaf));}function loadProfilesFromTdxJsonFiles(){const _0x2042db=a63_0x1a82e5,_0x434f95=[],_0x2d6f68=findProjectConfigPath();_0x2d6f68&&_0x434f95[_0x2042db(0xbf)](...loadProfilesFromTdxJson(_0x2d6f68,_0x2042db(0x76)));const _0x335af2=a63_0x4f58bf[_0x2042db(0x78)](getConfigDir(),'tdx.json');return _0x434f95[_0x2042db(0xbf)](...loadProfilesFromTdxJson(_0x335af2,_0x2042db(0x74))),_0x434f95;}function loadProfilesFromDirectories(){const _0x50ff96=a63_0x1a82e5,_0x5d6b92=getProfilesDir();if(!a63_0x5b5835[_0x50ff96(0x9f)](_0x5d6b92))return[];try{return a63_0x5b5835['readdirSync'](_0x5d6b92,{'withFileTypes':!![]})[_0x50ff96(0x8c)](_0x5d6dc8=>_0x5d6dc8[_0x50ff96(0xb8)]())['map'](_0x430428=>_0x430428[_0x50ff96(0x84)])['filter'](_0x2155c4=>{const _0x36a131=_0x50ff96,_0x489b1b=getProfileConfigPath(_0x2155c4),_0x3fca53=getProfileEnvPath(_0x2155c4);return a63_0x5b5835[_0x36a131(0x9f)](_0x489b1b)||a63_0x5b5835[_0x36a131(0x9f)](_0x3fca53);})[_0x50ff96(0xa3)](_0x1d1f5a=>{const _0x265cfa=_0x50ff96,_0x2a52b9=loadProfileFromDirectory(_0x1d1f5a);if(_0x2a52b9)return{..._0x2a52b9,'scope':_0x265cfa(0x7a)};return null;})['filter'](_0x3fddf9=>_0x3fddf9!==null);}catch{return[];}}function loadProfileFromDirectory(_0x5bebd3){const _0x31202d=a63_0x1a82e5,_0x4487d0=getProfileConfigPath(_0x5bebd3),_0x18d267=getOldCredentialPath(_0x5bebd3);if(!a63_0x5b5835[_0x31202d(0x9f)](_0x4487d0)&&!a63_0x5b5835[_0x31202d(0x9f)](_0x18d267))return null;let _0x2f569a={},_0x3e4e92={'name':_0x5bebd3,'createdAt':new Date()[_0x31202d(0x97)]()};if(a63_0x5b5835[_0x31202d(0x9f)](_0x4487d0))try{const _0x514fcb=a63_0x5b5835[_0x31202d(0xbd)](_0x4487d0,_0x31202d(0xb3)),_0x3b906c=JSON[_0x31202d(0xa5)](_0x514fcb),{metadata:_0xa0c078,..._0x1c4c1e}=_0x3b906c;_0x2f569a=_0x1c4c1e,_0xa0c078&&(_0x3e4e92=_0xa0c078);}catch{}return{'name':_0x5bebd3,'config':_0x2f569a,'metadata':_0x3e4e92,'hasCredentials':a63_0x5b5835[_0x31202d(0x9f)](_0x18d267),'scope':_0x31202d(0x7a)};}export function listProfiles(){const _0x4d43a7=a63_0x1a82e5,_0x393160=loadProfilesFromTdxJsonFiles(),_0x489611=loadProfilesFromDirectories();if(_0x489611['length']>0x0){const _0x3b5f41=_0x489611['map'](_0x367ea2=>_0x367ea2['name'])[_0x4d43a7(0x78)](',\x20'),_0x29f044=getConfigDir();console[_0x4d43a7(0x92)](_0x4d43a7(0xb6)+_0x3b5f41),console['warn']('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console[_0x4d43a7(0x92)](_0x4d43a7(0xb9)+a63_0x4f58bf[_0x4d43a7(0x78)](_0x29f044,_0x4d43a7(0x93))),console[_0x4d43a7(0x92)]('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x4d43a7(0x92)](_0x4d43a7(0x91));}const _0x5ada2f=[..._0x393160,..._0x489611],_0x5b1712=new Map();for(const _0x4bdcb9 of _0x5ada2f){!_0x5b1712['has'](_0x4bdcb9[_0x4d43a7(0x84)])&&_0x5b1712['set'](_0x4bdcb9['name'],_0x4bdcb9);}return Array[_0x4d43a7(0x94)](_0x5b1712[_0x4d43a7(0xa4)]())['sort']((_0x4eb6a9,_0x118c8a)=>_0x4eb6a9[_0x4d43a7(0x84)][_0x4d43a7(0x9a)](_0x118c8a['name']));}export function profileExists(_0x2bd8bd){const _0x39b38c=a63_0x1a82e5,_0x245c37=listProfiles();return _0x245c37[_0x39b38c(0xbe)](_0x1349d0=>_0x1349d0[_0x39b38c(0x84)]===_0x2bd8bd);}export function loadProfile(_0x6cb4b9){const _0x12ea5c=a63_0x1a82e5;validateProfileName(_0x6cb4b9);const _0x3b713d=listProfiles(),_0x261396=_0x3b713d[_0x12ea5c(0xac)](_0x2c9de1=>_0x2c9de1[_0x12ea5c(0x84)]===_0x6cb4b9);return _0x261396||null;}export function saveProfile(_0x481d83,_0x5e74a7,_0x212952=![]){saveProfileToUserConfig(_0x481d83,_0x5e74a7);}export function deleteProfile(_0x22e467){const _0xaea972=a63_0x1a82e5;validateProfileName(_0x22e467);const _0x50af17=getProfileDir(_0x22e467);if(!a63_0x5b5835[_0xaea972(0x9f)](_0x50af17))throw new Error(_0xaea972(0xae)+_0x22e467+'\x20does\x20not\x20exist');a63_0x5b5835[_0xaea972(0xb1)](_0x50af17,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x57d109,_0x3633ed){const _0x22341f=a63_0x1a82e5;validateProfileName(_0x57d109);const _0x1c8272=getGlobalConfigPath(),_0x24ed55=getConfigDir();!a63_0x5b5835[_0x22341f(0x9f)](_0x24ed55)&&createSecureDirectory(_0x24ed55);let _0x202e60={};if(a63_0x5b5835['existsSync'](_0x1c8272))try{const _0x4991eb=a63_0x5b5835[_0x22341f(0xbd)](_0x1c8272,_0x22341f(0xb3));_0x202e60=JSON[_0x22341f(0xa5)](_0x4991eb);}catch{console['warn'](_0x22341f(0x98)+_0x1c8272+_0x22341f(0xbb));}!_0x202e60[_0x22341f(0xbc)]&&(_0x202e60[_0x22341f(0xbc)]={}),_0x202e60[_0x22341f(0xbc)][_0x57d109]=_0x3633ed,writeSecureFile(_0x1c8272,JSON['stringify'](_0x202e60,null,0x2));}export function removeProfileFromUserConfig(_0x132e29){const _0x3953c0=a63_0x1a82e5;validateProfileName(_0x132e29);const _0x3cc65c=getGlobalConfigPath();if(!a63_0x5b5835['existsSync'](_0x3cc65c))throw new Error(_0x3953c0(0x89)+_0x132e29+'\x27\x20not\x20found\x20in\x20user\x20configuration');let _0x227381={};try{const _0x1445bc=a63_0x5b5835[_0x3953c0(0xbd)](_0x3cc65c,_0x3953c0(0xb3));_0x227381=JSON[_0x3953c0(0xa5)](_0x1445bc);}catch{throw new Error(_0x3953c0(0x87)+_0x3cc65c);}if(!_0x227381[_0x3953c0(0xbc)]||!_0x227381[_0x3953c0(0xbc)][_0x132e29])throw new Error(_0x3953c0(0x89)+_0x132e29+_0x3953c0(0x8a));delete _0x227381[_0x3953c0(0xbc)][_0x132e29],_0x227381['profile']===_0x132e29&&delete _0x227381[_0x3953c0(0x85)],writeSecureFile(_0x3cc65c,JSON[_0x3953c0(0x7e)](_0x227381,null,0x2));}export function getActiveProfile(){const _0x37cc35=a63_0x1a82e5,_0x4a0864=loadSessionContext();if(_0x4a0864?.[_0x37cc35(0x85)])return _0x4a0864[_0x37cc35(0x85)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x57c028=getGlobalConfigPath();if(!a63_0x5b5835[_0x37cc35(0x9f)](_0x57c028))return null;try{const _0x188cf0=a63_0x5b5835[_0x37cc35(0xbd)](_0x57c028,'utf-8'),_0x484b40=JSON[_0x37cc35(0xa5)](_0x188cf0);return _0x484b40[_0x37cc35(0x85)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0xd4d255){const _0x1e8e83=a63_0x1a82e5,_0x39e24d=getGlobalConfigPath(),_0x1d9c6c=getConfigDir();!a63_0x5b5835[_0x1e8e83(0x9f)](_0x1d9c6c)&&createSecureDirectory(_0x1d9c6c);let _0x44cd51={};if(a63_0x5b5835[_0x1e8e83(0x9f)](_0x39e24d))try{const _0x2401bf=a63_0x5b5835[_0x1e8e83(0xbd)](_0x39e24d,_0x1e8e83(0xb3));_0x44cd51=JSON[_0x1e8e83(0xa5)](_0x2401bf);}catch{console['warn'](_0x1e8e83(0x98)+_0x39e24d+',\x20creating\x20new\x20file');}_0x44cd51[_0x1e8e83(0x96)]=_0xd4d255,writeSecureFile(_0x39e24d,JSON[_0x1e8e83(0x7e)](_0x44cd51,null,0x2));}export function saveActiveProfileToUserConfig(_0x15015e){const _0x3d0873=a63_0x1a82e5;validateProfileName(_0x15015e);const _0x45124c=getGlobalConfigPath(),_0x1b88e2=getConfigDir();!a63_0x5b5835[_0x3d0873(0x9f)](_0x1b88e2)&&createSecureDirectory(_0x1b88e2);let _0x3f2665={};if(a63_0x5b5835['existsSync'](_0x45124c))try{const _0x3ca86d=a63_0x5b5835[_0x3d0873(0xbd)](_0x45124c,_0x3d0873(0xb3));_0x3f2665=JSON[_0x3d0873(0xa5)](_0x3ca86d);}catch{console['warn'](_0x3d0873(0x98)+_0x45124c+',\x20creating\x20new\x20file');}_0x3f2665['profile']=_0x15015e,writeSecureFile(_0x45124c,JSON['stringify'](_0x3f2665,null,0x2));}function clearFieldFromUserConfig(_0x4a83c1){const _0x2a6ac9=a63_0x1a82e5,_0x48ecae=getGlobalConfigPath();if(!a63_0x5b5835[_0x2a6ac9(0x9f)](_0x48ecae))return;let _0x38d8a6={};try{const _0x56b324=a63_0x5b5835[_0x2a6ac9(0xbd)](_0x48ecae,_0x2a6ac9(0xb3));_0x38d8a6=JSON[_0x2a6ac9(0xa5)](_0x56b324);}catch{return;}delete _0x38d8a6[_0x4a83c1],writeSecureFile(_0x48ecae,JSON[_0x2a6ac9(0x7e)](_0x38d8a6,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x1ff4f6,_0x4ed25b){const _0x13c802=a63_0x1a82e5;validateProfileName(_0x1ff4f6);if(profileExists(_0x1ff4f6))throw new Error('Profile\x20'+_0x1ff4f6+_0x13c802(0xb5));saveProfile(_0x1ff4f6,_0x4ed25b);}export function saveProfileCredentials(_0x37d9e9,_0x5f41a6){validateProfileName(_0x37d9e9);if(!profileExists(_0x37d9e9))throw new Error('Profile\x20'+_0x37d9e9+'\x20does\x20not\x20exist');const _0x16801a=getNewCredentialPath(_0x37d9e9);writeSecureFile(_0x16801a,_0x5f41a6);}export function loadProfileCredentials(_0x491939){const _0x33a1a5=a63_0x1a82e5;validateProfileName(_0x491939);const _0x470a65=getNewCredentialPath(_0x491939);if(a63_0x5b5835[_0x33a1a5(0x9f)](_0x470a65))try{return a63_0x5b5835[_0x33a1a5(0xbd)](_0x470a65,_0x33a1a5(0xb3));}catch{}const _0x1b371e=getOldCredentialPath(_0x491939);if(a63_0x5b5835[_0x33a1a5(0x9f)](_0x1b371e)){console[_0x33a1a5(0x92)](_0x33a1a5(0xba)+_0x491939+'\x27'),console[_0x33a1a5(0x92)](_0x33a1a5(0xa1)),console[_0x33a1a5(0x92)](_0x33a1a5(0x8b)+_0x1b371e+_0x33a1a5(0x99)+_0x470a65+'\x22'),console[_0x33a1a5(0x92)](_0x33a1a5(0x72));try{return a63_0x5b5835[_0x33a1a5(0xbd)](_0x1b371e,_0x33a1a5(0xb3));}catch{return null;}}return null;}
1
+ (function(_0x39cacf,_0x141f44){const _0x51c8a2=a63_0x5155,_0x367874=_0x39cacf();while(!![]){try{const _0x16a5a2=-parseInt(_0x51c8a2(0xe4))/0x1*(parseInt(_0x51c8a2(0x123))/0x2)+parseInt(_0x51c8a2(0xf1))/0x3*(-parseInt(_0x51c8a2(0xfc))/0x4)+parseInt(_0x51c8a2(0x10c))/0x5*(-parseInt(_0x51c8a2(0x128))/0x6)+parseInt(_0x51c8a2(0x133))/0x7+parseInt(_0x51c8a2(0xe9))/0x8+-parseInt(_0x51c8a2(0xfb))/0x9+parseInt(_0x51c8a2(0x10b))/0xa;if(_0x16a5a2===_0x141f44)break;else _0x367874['push'](_0x367874['shift']());}catch(_0x200886){_0x367874['push'](_0x367874['shift']());}}}(a63_0x49c3,0x70aab));import*as a63_0x4c8027 from'node:fs';import*as a63_0x2af5a4 from'node:path';function a63_0x5155(_0x374e85,_0x2f21b4){_0x374e85=_0x374e85-0xe4;const _0x49c302=a63_0x49c3();let _0x515588=_0x49c302[_0x374e85];return _0x515588;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME='@tdx-studio';export function getProfileParams(_0x1b0c21){const _0x416131=a63_0x5155,_0xe56f53={};if(!_0x1b0c21)return _0xe56f53;for(const [_0x58b902,_0x55b014]of Object[_0x416131(0x117)](_0x1b0c21)){_0x58b902!==_0x416131(0x11c)&&_0x55b014!==undefined&&(_0xe56f53[_0x58b902]=_0x55b014);}return _0xe56f53;}export function getProfilesDir(){const _0x44cea0=a63_0x5155;return a63_0x2af5a4[_0x44cea0(0xf0)](getConfigDir(),_0x44cea0(0x104));}function getProfileDir(_0xf1e2f){const _0x28ef0d=a63_0x5155;return a63_0x2af5a4[_0x28ef0d(0xf0)](getProfilesDir(),_0xf1e2f);}function getProfileConfigPath(_0x55390b){const _0x504c36=a63_0x5155;return a63_0x2af5a4[_0x504c36(0xf0)](getProfileDir(_0x55390b),_0x504c36(0x125));}function getProfileEnvPath(_0x1b9ccb){const _0x20c70b=a63_0x5155;return a63_0x2af5a4[_0x20c70b(0xf0)](getProfileDir(_0x1b9ccb),'.env');}function getGlobalConfigPath(){const _0x18f73e=a63_0x5155;return a63_0x2af5a4[_0x18f73e(0xf0)](getConfigDir(),_0x18f73e(0x125));}function validateProfileName(_0x507e52){const _0x40550f=a63_0x5155;if(/^@?[a-zA-Z0-9_-]+$/['test'](_0x507e52))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x40550f(0x130)](_0x507e52))return;throw new Error(_0x40550f(0x134)+_0x507e52+_0x40550f(0x114));}function validateProfileConfig(_0x3e142c,_0x1416cd){const _0xa717c9=a63_0x5155;if(typeof _0x3e142c!==_0xa717c9(0xf4)||_0x3e142c===null)throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0xa717c9(0x11b)+_0x1416cd+_0xa717c9(0xe8));const _0x52fe72=[_0xa717c9(0x11c),_0xa717c9(0xeb),_0xa717c9(0x122),_0xa717c9(0xf5),'llm_project',_0xa717c9(0x110),'user_info'],_0x43b393=_0x3e142c;for(const _0x228b54 of Object[_0xa717c9(0xef)](_0x43b393)){!_0x52fe72[_0xa717c9(0xfe)](_0x228b54)&&console[_0xa717c9(0x12b)](_0xa717c9(0xf8)+_0x1416cd+_0xa717c9(0xf6)+_0x228b54+_0xa717c9(0x121));}if(_0x43b393[_0xa717c9(0x11c)]!==undefined&&typeof _0x43b393[_0xa717c9(0x11c)]!==_0xa717c9(0x12e))throw new SDKError(ErrorCode[_0xa717c9(0x106)],_0xa717c9(0x11b)+_0x1416cd+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x43b393[_0xa717c9(0xeb)]!==undefined&&typeof _0x43b393[_0xa717c9(0xeb)]!==_0xa717c9(0x12e))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0xa717c9(0x11b)+_0x1416cd+_0xa717c9(0x127));if(_0x43b393[_0xa717c9(0x122)]!==undefined&&typeof _0x43b393[_0xa717c9(0x122)]!==_0xa717c9(0x12e))throw new SDKError(ErrorCode[_0xa717c9(0x106)],_0xa717c9(0x11b)+_0x1416cd+_0xa717c9(0x131));if(_0x43b393[_0xa717c9(0xf5)]!==undefined&&typeof _0x43b393[_0xa717c9(0xf5)]!==_0xa717c9(0x12e))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0xa717c9(0x11b)+_0x1416cd+_0xa717c9(0xf3));if(_0x43b393['llm_project']!==undefined&&typeof _0x43b393['llm_project']!==_0xa717c9(0x12e))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x1416cd+_0xa717c9(0x12c));if(_0x43b393[_0xa717c9(0x110)]!==undefined&&typeof _0x43b393[_0xa717c9(0x110)]!==_0xa717c9(0x12e))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0xa717c9(0x11b)+_0x1416cd+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0x5b96ec,_0x22b972){const _0x5c6fa6=a63_0x5155;if(!a63_0x4c8027['existsSync'](_0x5b96ec))return[];try{const _0x9f5c23=a63_0x4c8027[_0x5c6fa6(0x10f)](_0x5b96ec,_0x5c6fa6(0x11d)),_0x2d76f7=JSON[_0x5c6fa6(0x12f)](_0x9f5c23);if(!_0x2d76f7[_0x5c6fa6(0x104)]||typeof _0x2d76f7[_0x5c6fa6(0x104)]!==_0x5c6fa6(0xf4))return[];const _0x599bd4=[];for(const [_0x3373a7,_0x48d595]of Object[_0x5c6fa6(0x117)](_0x2d76f7['profiles'])){try{validateProfileConfig(_0x48d595,_0x3373a7);const _0x2a4dce=getNewCredentialPath(_0x3373a7),_0x518ce4=getOldCredentialPath(_0x3373a7),_0x125759=a63_0x4c8027[_0x5c6fa6(0xe6)](_0x2a4dce)||a63_0x4c8027[_0x5c6fa6(0xe6)](_0x518ce4);_0x599bd4[_0x5c6fa6(0x11a)]({'name':_0x3373a7,'config':_0x48d595,'metadata':{'name':_0x3373a7,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x125759,'scope':_0x22b972});}catch(_0x87e45){_0x87e45 instanceof Error&&(console[_0x5c6fa6(0x12b)](_0x5c6fa6(0xea)+_0x5b96ec+':'),console[_0x5c6fa6(0x12b)]('\x20\x20'+_0x87e45['message']+'\x0a'));}}return _0x599bd4;}catch(_0x59539b){return _0x59539b instanceof SyntaxError?(console[_0x5c6fa6(0x12b)](_0x5c6fa6(0x103)+_0x5b96ec+_0x5c6fa6(0x112)),console[_0x5c6fa6(0x12b)](_0x5c6fa6(0xec)+_0x59539b['message']+'\x0a')):console[_0x5c6fa6(0x12b)](_0x5c6fa6(0x113)+_0x5b96ec+':\x20'+_0x59539b+'\x0a'),[];}}export function getNewCredentialPath(_0x51969d){const _0x272c43=a63_0x5155;return a63_0x2af5a4[_0x272c43(0xf0)](getConfigDir(),_0x272c43(0x12d)+_0x51969d);}function getOldCredentialPath(_0x2fb18b){const _0x4d74f8=a63_0x5155;return a63_0x2af5a4[_0x4d74f8(0xf0)](getProfilesDir(),_0x2fb18b,_0x4d74f8(0x12a));}function loadProfilesFromTdxJsonFiles(){const _0x18c0b2=a63_0x5155,_0x27bf1c=[],_0x5587ef=findProjectConfigPath();_0x5587ef&&_0x27bf1c[_0x18c0b2(0x11a)](...loadProfilesFromTdxJson(_0x5587ef,_0x18c0b2(0xf9)));const _0x5df4e3=a63_0x2af5a4[_0x18c0b2(0xf0)](getConfigDir(),_0x18c0b2(0x125));return _0x27bf1c[_0x18c0b2(0x11a)](...loadProfilesFromTdxJson(_0x5df4e3,_0x18c0b2(0x11f))),_0x27bf1c;}function loadProfilesFromDirectories(){const _0x5a6d12=a63_0x5155,_0x95894f=getProfilesDir();if(!a63_0x4c8027[_0x5a6d12(0xe6)](_0x95894f))return[];try{return a63_0x4c8027[_0x5a6d12(0x108)](_0x95894f,{'withFileTypes':!![]})[_0x5a6d12(0xe5)](_0x3b7f02=>_0x3b7f02['isDirectory']())[_0x5a6d12(0x10a)](_0x181de0=>_0x181de0[_0x5a6d12(0x132)])['filter'](_0x4ec9af=>{const _0x4b0aff=_0x5a6d12,_0x566f51=getProfileConfigPath(_0x4ec9af),_0x4f75fd=getProfileEnvPath(_0x4ec9af);return a63_0x4c8027[_0x4b0aff(0xe6)](_0x566f51)||a63_0x4c8027[_0x4b0aff(0xe6)](_0x4f75fd);})[_0x5a6d12(0x10a)](_0x4a6156=>{const _0x3d5cb8=_0x5a6d12,_0x40629b=loadProfileFromDirectory(_0x4a6156);if(_0x40629b)return{..._0x40629b,'scope':_0x3d5cb8(0xfd)};return null;})[_0x5a6d12(0xe5)](_0x5c68d8=>_0x5c68d8!==null);}catch{return[];}}function loadProfileFromDirectory(_0x37c198){const _0x4de146=a63_0x5155,_0x2a7286=getProfileConfigPath(_0x37c198),_0x12cae3=getOldCredentialPath(_0x37c198);if(!a63_0x4c8027[_0x4de146(0xe6)](_0x2a7286)&&!a63_0x4c8027[_0x4de146(0xe6)](_0x12cae3))return null;let _0x1cb0dc={},_0x2b4f1f={'name':_0x37c198,'createdAt':new Date()[_0x4de146(0x101)]()};if(a63_0x4c8027[_0x4de146(0xe6)](_0x2a7286))try{const _0x34b084=a63_0x4c8027[_0x4de146(0x10f)](_0x2a7286,_0x4de146(0x11d)),_0x5c0de1=JSON[_0x4de146(0x12f)](_0x34b084),{metadata:_0x32131f,..._0x4d39cb}=_0x5c0de1;_0x1cb0dc=_0x4d39cb,_0x32131f&&(_0x2b4f1f=_0x32131f);}catch{}return{'name':_0x37c198,'config':_0x1cb0dc,'metadata':_0x2b4f1f,'hasCredentials':a63_0x4c8027[_0x4de146(0xe6)](_0x12cae3),'scope':_0x4de146(0xfd)};}export function listProfiles(){const _0x3d1878=a63_0x5155,_0x148d63=loadProfilesFromTdxJsonFiles(),_0x14f5a2=loadProfilesFromDirectories();if(_0x14f5a2[_0x3d1878(0x111)]>0x0){const _0x36d38e=_0x14f5a2['map'](_0xa292c5=>_0xa292c5['name'])[_0x3d1878(0xf0)](',\x20'),_0x3bde81=getConfigDir();console['warn']('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x36d38e),console[_0x3d1878(0x12b)](_0x3d1878(0xfa)),console['warn'](_0x3d1878(0x105)+a63_0x2af5a4[_0x3d1878(0xf0)](_0x3bde81,'tdx.json')),console[_0x3d1878(0x12b)](_0x3d1878(0x129)),console[_0x3d1878(0x12b)](_0x3d1878(0x102));}const _0x19f4df=[..._0x148d63,..._0x14f5a2],_0x693e73=new Map();for(const _0x25f35f of _0x19f4df){!_0x693e73[_0x3d1878(0x120)](_0x25f35f['name'])&&_0x693e73[_0x3d1878(0x100)](_0x25f35f['name'],_0x25f35f);}return Array[_0x3d1878(0xed)](_0x693e73['values']())['sort']((_0x3d58ee,_0x163516)=>_0x3d58ee[_0x3d1878(0x132)][_0x3d1878(0xf7)](_0x163516[_0x3d1878(0x132)]));}export function profileExists(_0x4029a5){const _0x43b2eb=a63_0x5155,_0xa5f98d=listProfiles();return _0xa5f98d[_0x43b2eb(0x126)](_0x4eff8d=>_0x4eff8d['name']===_0x4029a5);}export function loadProfile(_0x419ba8){const _0x3ae84f=a63_0x5155;validateProfileName(_0x419ba8);const _0x68dc47=listProfiles(),_0x4be586=_0x68dc47[_0x3ae84f(0xf2)](_0xdab272=>_0xdab272[_0x3ae84f(0x132)]===_0x419ba8);return _0x4be586||null;}export function saveProfile(_0x312c63,_0x479cbf,_0x510482=![]){saveProfileToUserConfig(_0x312c63,_0x479cbf);}function a63_0x49c3(){const _0x5bf1a4=['1591055qfunqI','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','profile','readFileSync','llm_agent','length',':\x20Invalid\x20JSON\x20syntax','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','To\x20migrate:','Warning:\x20Failed\x20to\x20parse\x20','entries','rmSync','Profile\x20','push','Profile\x20\x27','description','utf-8','\x22\x20\x22','user','has','\x27\x20will\x20be\x20ignored','database','2vLlGLn','\x20already\x20exists','tdx.json','some','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','6vXafkD','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','.env','warn','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','.env.','string','parse','test','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','name','3531983SJCpgU','Invalid\x20profile\x20name:\x20','215048gCjlOd','filter','existsSync','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','\x27:\x20config\x20must\x20be\x20an\x20object','4579848xxfiIe','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','site','Error:\x20','from','\x27\x20not\x20found\x20in\x20user\x20configuration','keys','join','39WPrkDl','find','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','object','parent_segment','\x27:\x20unknown\x20config\x20key\x20\x27','localeCompare','Warning:\x20Profile\x20\x27','local','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','3126024uSDuIk','132740lvyYhs','directory','includes','\x20does\x20not\x20exist','set','toISOString','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','\x0aWarning:\x20Failed\x20to\x20parse\x20','profiles','\x20\x201.\x20Edit:\x20','INVALID_PROFILE_CONFIG',',\x20creating\x20new\x20file','readdirSync','stringify','map','6964330KrSbRl'];a63_0x49c3=function(){return _0x5bf1a4;};return a63_0x49c3();}export function deleteProfile(_0x535d14){const _0x4636d1=a63_0x5155;validateProfileName(_0x535d14);const _0x2cd386=getProfileDir(_0x535d14);if(!a63_0x4c8027[_0x4636d1(0xe6)](_0x2cd386))throw new Error(_0x4636d1(0x119)+_0x535d14+_0x4636d1(0xff));a63_0x4c8027[_0x4636d1(0x118)](_0x2cd386,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x471b59,_0x17b42a){const _0x2c4449=a63_0x5155;validateProfileName(_0x471b59);const _0x2cf5b6=getGlobalConfigPath(),_0x2d346c=getConfigDir();!a63_0x4c8027[_0x2c4449(0xe6)](_0x2d346c)&&createSecureDirectory(_0x2d346c);let _0x2ed5e4={};if(a63_0x4c8027[_0x2c4449(0xe6)](_0x2cf5b6))try{const _0x704093=a63_0x4c8027[_0x2c4449(0x10f)](_0x2cf5b6,_0x2c4449(0x11d));_0x2ed5e4=JSON[_0x2c4449(0x12f)](_0x704093);}catch{console['warn'](_0x2c4449(0x116)+_0x2cf5b6+_0x2c4449(0x107));}!_0x2ed5e4[_0x2c4449(0x104)]&&(_0x2ed5e4[_0x2c4449(0x104)]={}),_0x2ed5e4[_0x2c4449(0x104)][_0x471b59]=_0x17b42a,writeSecureFile(_0x2cf5b6,JSON[_0x2c4449(0x109)](_0x2ed5e4,null,0x2));}export function removeProfileFromUserConfig(_0x4f2b32){const _0x5f5a77=a63_0x5155;validateProfileName(_0x4f2b32);const _0x2348a1=getGlobalConfigPath();if(!a63_0x4c8027[_0x5f5a77(0xe6)](_0x2348a1))throw new Error(_0x5f5a77(0x11b)+_0x4f2b32+_0x5f5a77(0xee));let _0x42796b={};try{const _0x5878c7=a63_0x4c8027[_0x5f5a77(0x10f)](_0x2348a1,'utf-8');_0x42796b=JSON[_0x5f5a77(0x12f)](_0x5878c7);}catch{throw new Error('Failed\x20to\x20parse\x20'+_0x2348a1);}if(!_0x42796b[_0x5f5a77(0x104)]||!_0x42796b[_0x5f5a77(0x104)][_0x4f2b32])throw new Error(_0x5f5a77(0x11b)+_0x4f2b32+'\x27\x20not\x20found\x20in\x20user\x20configuration');delete _0x42796b['profiles'][_0x4f2b32],_0x42796b[_0x5f5a77(0x10e)]===_0x4f2b32&&delete _0x42796b[_0x5f5a77(0x10e)],writeSecureFile(_0x2348a1,JSON[_0x5f5a77(0x109)](_0x42796b,null,0x2));}export function getActiveProfile(){const _0x29d59e=a63_0x5155,_0x11a6b8=loadSessionContext();if(_0x11a6b8?.[_0x29d59e(0x10e)])return _0x11a6b8[_0x29d59e(0x10e)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x5e5f33=getGlobalConfigPath();if(!a63_0x4c8027[_0x29d59e(0xe6)](_0x5e5f33))return null;try{const _0x459e9e=a63_0x4c8027['readFileSync'](_0x5e5f33,_0x29d59e(0x11d)),_0x46c87b=JSON[_0x29d59e(0x12f)](_0x459e9e);return _0x46c87b[_0x29d59e(0x10e)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x2b088d){const _0x1a488b=a63_0x5155,_0x286da4=getGlobalConfigPath(),_0x3bc223=getConfigDir();!a63_0x4c8027['existsSync'](_0x3bc223)&&createSecureDirectory(_0x3bc223);let _0x49bf50={};if(a63_0x4c8027['existsSync'](_0x286da4))try{const _0x1b3ed3=a63_0x4c8027['readFileSync'](_0x286da4,'utf-8');_0x49bf50=JSON[_0x1a488b(0x12f)](_0x1b3ed3);}catch{console[_0x1a488b(0x12b)](_0x1a488b(0x116)+_0x286da4+_0x1a488b(0x107));}_0x49bf50[_0x1a488b(0xeb)]=_0x2b088d,writeSecureFile(_0x286da4,JSON[_0x1a488b(0x109)](_0x49bf50,null,0x2));}export function saveActiveProfileToUserConfig(_0x2e8188){const _0x3da521=a63_0x5155;validateProfileName(_0x2e8188);const _0x799c27=getGlobalConfigPath(),_0x5bda3c=getConfigDir();!a63_0x4c8027[_0x3da521(0xe6)](_0x5bda3c)&&createSecureDirectory(_0x5bda3c);let _0x362fea={};if(a63_0x4c8027[_0x3da521(0xe6)](_0x799c27))try{const _0x239a2f=a63_0x4c8027[_0x3da521(0x10f)](_0x799c27,_0x3da521(0x11d));_0x362fea=JSON[_0x3da521(0x12f)](_0x239a2f);}catch{console[_0x3da521(0x12b)](_0x3da521(0x116)+_0x799c27+_0x3da521(0x107));}_0x362fea[_0x3da521(0x10e)]=_0x2e8188,writeSecureFile(_0x799c27,JSON[_0x3da521(0x109)](_0x362fea,null,0x2));}function clearFieldFromUserConfig(_0x159f48){const _0xc53394=a63_0x5155,_0x54629f=getGlobalConfigPath();if(!a63_0x4c8027['existsSync'](_0x54629f))return;let _0x4d0dfd={};try{const _0xaff361=a63_0x4c8027[_0xc53394(0x10f)](_0x54629f,_0xc53394(0x11d));_0x4d0dfd=JSON[_0xc53394(0x12f)](_0xaff361);}catch{return;}delete _0x4d0dfd[_0x159f48],writeSecureFile(_0x54629f,JSON[_0xc53394(0x109)](_0x4d0dfd,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x191e2d=a63_0x5155;clearFieldFromUserConfig(_0x191e2d(0xeb));}export function clearActiveProfileFromUserConfig(){const _0x227b83=a63_0x5155;clearFieldFromUserConfig(_0x227b83(0x10e));}export function createProfile(_0x185bcc,_0x15130d){const _0x280962=a63_0x5155;validateProfileName(_0x185bcc);if(profileExists(_0x185bcc))throw new Error(_0x280962(0x119)+_0x185bcc+_0x280962(0x124));saveProfile(_0x185bcc,_0x15130d);}export function saveProfileCredentials(_0x3b866c,_0x22d6d7){const _0x2cd94b=a63_0x5155;validateProfileName(_0x3b866c);if(!profileExists(_0x3b866c))throw new Error(_0x2cd94b(0x119)+_0x3b866c+'\x20does\x20not\x20exist');const _0x5e0949=getNewCredentialPath(_0x3b866c);writeSecureFile(_0x5e0949,_0x22d6d7);}export function loadProfileCredentials(_0x4e3407){const _0x4dafbc=a63_0x5155;validateProfileName(_0x4e3407);const _0x307a15=getNewCredentialPath(_0x4e3407);if(a63_0x4c8027[_0x4dafbc(0xe6)](_0x307a15))try{return a63_0x4c8027[_0x4dafbc(0x10f)](_0x307a15,_0x4dafbc(0x11d));}catch{}const _0x4a9f57=getOldCredentialPath(_0x4e3407);if(a63_0x4c8027[_0x4dafbc(0xe6)](_0x4a9f57)){console[_0x4dafbc(0x12b)](_0x4dafbc(0xe7)+_0x4e3407+'\x27'),console[_0x4dafbc(0x12b)](_0x4dafbc(0x115)),console[_0x4dafbc(0x12b)]('\x20\x20mv\x20\x22'+_0x4a9f57+_0x4dafbc(0x11e)+_0x307a15+'\x22'),console[_0x4dafbc(0x12b)](_0x4dafbc(0x10d));try{return a63_0x4c8027[_0x4dafbc(0x10f)](_0x4a9f57,_0x4dafbc(0x11d));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a64_0x2cec19=a64_0x3895;(function(_0x3177cd,_0x53adc3){const _0x1f655b=a64_0x3895,_0x18bbfb=_0x3177cd();while(!![]){try{const _0x15cfb2=-parseInt(_0x1f655b(0x1d8))/0x1+-parseInt(_0x1f655b(0x1ce))/0x2*(parseInt(_0x1f655b(0x1da))/0x3)+-parseInt(_0x1f655b(0x1c3))/0x4*(-parseInt(_0x1f655b(0x1d9))/0x5)+parseInt(_0x1f655b(0x1d1))/0x6+-parseInt(_0x1f655b(0x1cf))/0x7*(parseInt(_0x1f655b(0x1d3))/0x8)+-parseInt(_0x1f655b(0x1d7))/0x9*(-parseInt(_0x1f655b(0x1c2))/0xa)+-parseInt(_0x1f655b(0x1c1))/0xb;if(_0x15cfb2===_0x53adc3)break;else _0x18bbfb['push'](_0x18bbfb['shift']());}catch(_0x4c0faf){_0x18bbfb['push'](_0x18bbfb['shift']());}}}(a64_0x4208,0xc6eb6));import*as a64_0x24ca4d from'node:fs';import*as a64_0x3fab4c from'node:path';function a64_0x4208(){const _0x133420=['592677AhAEUi','255KZTKbE','3UlSYdx','cwd','dirname','api_key','code','\x20is\x20ignored.\x20',').\x20','6580508qcWKTz','3137240anlhsC','115796fGIaox','profile','apiKey','includes','stringify','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','readFileSync','Warning:\x20\x27profile\x27\x20field\x20in\x20','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','writeFileSync','224054wyrhwq','28AomHUd','Failed\x20to\x20load\x20project\x20config\x20from\x20','5305650gAXHeJ','join','2368280ktTVrY','tdx.json','utf-8','existsSync','27DjWcex'];a64_0x4208=function(){return _0x133420;};return a64_0x4208();}function a64_0x3895(_0x4aae4a,_0xac6e7e){_0x4aae4a=_0x4aae4a-0x1bd;const _0x4208fe=a64_0x4208();let _0x38958e=_0x4208fe[_0x4aae4a];return _0x38958e;}const PROJECT_CONFIG_FILENAME=a64_0x2cec19(0x1d4);export function findProjectConfigPath(_0x4ad3e5){const _0x29939b=a64_0x2cec19;let _0x4e37ac=_0x4ad3e5||process[_0x29939b(0x1db)]();while(!![]){const _0x3ed38b=a64_0x3fab4c[_0x29939b(0x1d2)](_0x4e37ac,PROJECT_CONFIG_FILENAME);if(a64_0x24ca4d[_0x29939b(0x1d6)](_0x3ed38b))return _0x3ed38b;const _0x73483f=a64_0x3fab4c[_0x29939b(0x1dc)](_0x4e37ac);if(_0x73483f===_0x4e37ac)return null;_0x4e37ac=_0x73483f;}}export function loadProjectConfig(_0x5c8955){const _0x160f4c=a64_0x2cec19,_0x2b3226=findProjectConfigPath(_0x5c8955);if(!_0x2b3226)return null;try{const _0x4997c0=a64_0x24ca4d[_0x160f4c(0x1c9)](_0x2b3226,_0x160f4c(0x1d5)),_0x4e86f6=JSON['parse'](_0x4997c0),_0x3172c2=JSON[_0x160f4c(0x1c7)](_0x4e86f6);if(_0x3172c2[_0x160f4c(0x1c6)]('TD_API_KEY')||_0x3172c2['includes'](_0x160f4c(0x1c5))||_0x3172c2['includes'](_0x160f4c(0x1bd)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x2b3226+_0x160f4c(0x1c0)+_0x160f4c(0x1cc));const {metadata:_0x3cf82d,profile:_0x38296d,..._0x4916b3}=_0x4e86f6;return _0x38296d&&console['warn'](_0x160f4c(0x1ca)+_0x2b3226+_0x160f4c(0x1bf)+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x4916b3;}catch(_0xed6b32){if(_0xed6b32 instanceof Error&&_0x160f4c(0x1be)in _0xed6b32&&_0xed6b32[_0x160f4c(0x1be)]==='ENOENT')return null;throw new Error(_0x160f4c(0x1d0)+_0x2b3226+':\x20'+_0xed6b32);}}export function saveProjectConfig(_0x351595,_0xad13c2){const _0x35e08b=a64_0x2cec19,_0x1f24ca=_0xad13c2||process['cwd'](),_0x1fe78b=a64_0x3fab4c[_0x35e08b(0x1d2)](_0x1f24ca,PROJECT_CONFIG_FILENAME),_0xd33aa9=JSON[_0x35e08b(0x1c7)](_0x351595);if(_0xd33aa9[_0x35e08b(0x1c6)]('TD_API_KEY')||_0xd33aa9[_0x35e08b(0x1c6)](_0x35e08b(0x1c5))||_0xd33aa9[_0x35e08b(0x1c6)](_0x35e08b(0x1bd)))throw new Error(_0x35e08b(0x1cb));if(_0x35e08b(0x1c4)in _0x351595)throw new Error(_0x35e08b(0x1c8));a64_0x24ca4d[_0x35e08b(0x1cd)](_0x1fe78b,JSON[_0x35e08b(0x1c7)](_0x351595,null,0x2));}export function hasProjectConfig(_0x14677e){return findProjectConfigPath(_0x14677e)!==null;}export function getProjectRoot(_0x33934e){const _0x1a08e4=a64_0x2cec19,_0x419a81=findProjectConfigPath(_0x33934e);return _0x419a81?a64_0x3fab4c[_0x1a08e4(0x1dc)](_0x419a81):null;}
1
+ (function(_0x1b1c05,_0x4444e3){const _0x3c1899=a64_0x37a7,_0x28f459=_0x1b1c05();while(!![]){try{const _0x3fdad6=parseInt(_0x3c1899(0x169))/0x1+-parseInt(_0x3c1899(0x17d))/0x2+parseInt(_0x3c1899(0x170))/0x3*(parseInt(_0x3c1899(0x178))/0x4)+parseInt(_0x3c1899(0x168))/0x5+-parseInt(_0x3c1899(0x16e))/0x6+parseInt(_0x3c1899(0x167))/0x7*(-parseInt(_0x3c1899(0x182))/0x8)+-parseInt(_0x3c1899(0x166))/0x9*(-parseInt(_0x3c1899(0x184))/0xa);if(_0x3fdad6===_0x4444e3)break;else _0x28f459['push'](_0x28f459['shift']());}catch(_0x31cca0){_0x28f459['push'](_0x28f459['shift']());}}}(a64_0x5a45,0x9cb6b));function a64_0x37a7(_0x27702e,_0x177d89){_0x27702e=_0x27702e-0x165;const _0x5a4587=a64_0x5a45();let _0x37a78a=_0x5a4587[_0x27702e];return _0x37a78a;}import*as a64_0x498279 from'node:fs';import*as a64_0x342e7e from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x22f6f5){const _0x406ad8=a64_0x37a7;let _0xe705c7=_0x22f6f5||process[_0x406ad8(0x17b)]();while(!![]){const _0x126158=a64_0x342e7e[_0x406ad8(0x173)](_0xe705c7,PROJECT_CONFIG_FILENAME);if(a64_0x498279[_0x406ad8(0x16a)](_0x126158))return _0x126158;const _0x440c8a=a64_0x342e7e[_0x406ad8(0x181)](_0xe705c7);if(_0x440c8a===_0xe705c7)return null;_0xe705c7=_0x440c8a;}}function a64_0x5a45(){const _0x973439=['93904pPVFMV','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','code','cwd','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','2069424OSpodW',').\x20','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','ENOENT','dirname','80UrNfiY','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','488170fQBBkp','profile','18gEpjcK','735203BqOiJB','4122715wMczNE','1187376OqLMIO','existsSync','\x20is\x20ignored.\x20','TD_API_KEY','utf-8','1507584ixupPz','warn','111XYsryg','Warning:\x20\x27profile\x27\x20field\x20in\x20','stringify','join','api_key','apiKey','includes','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('];a64_0x5a45=function(){return _0x973439;};return a64_0x5a45();}export function loadProjectConfig(_0x3110a9){const _0x3d6c84=a64_0x37a7,_0x40a5c3=findProjectConfigPath(_0x3110a9);if(!_0x40a5c3)return null;try{const _0xea1d18=a64_0x498279['readFileSync'](_0x40a5c3,_0x3d6c84(0x16d)),_0x363d02=JSON['parse'](_0xea1d18),_0x48461a=JSON[_0x3d6c84(0x172)](_0x363d02);if(_0x48461a['includes'](_0x3d6c84(0x16c))||_0x48461a[_0x3d6c84(0x176)](_0x3d6c84(0x175))||_0x48461a[_0x3d6c84(0x176)]('api_key'))throw new Error(_0x3d6c84(0x177)+_0x40a5c3+_0x3d6c84(0x17e)+_0x3d6c84(0x179));const {metadata:_0x59ee73,profile:_0x2bf3ed,..._0x1d67de}=_0x363d02;return _0x2bf3ed&&console[_0x3d6c84(0x16f)](_0x3d6c84(0x171)+_0x40a5c3+_0x3d6c84(0x16b)+_0x3d6c84(0x17f)),_0x1d67de;}catch(_0x5167bc){if(_0x5167bc instanceof Error&&_0x3d6c84(0x17a)in _0x5167bc&&_0x5167bc[_0x3d6c84(0x17a)]===_0x3d6c84(0x180))return null;throw new Error('Failed\x20to\x20load\x20project\x20config\x20from\x20'+_0x40a5c3+':\x20'+_0x5167bc);}}export function saveProjectConfig(_0x1534d4,_0x4d3262){const _0x3781ed=a64_0x37a7,_0x2cba56=_0x4d3262||process['cwd'](),_0x50fcaf=a64_0x342e7e['join'](_0x2cba56,PROJECT_CONFIG_FILENAME),_0x452754=JSON['stringify'](_0x1534d4);if(_0x452754['includes'](_0x3781ed(0x16c))||_0x452754[_0x3781ed(0x176)](_0x3781ed(0x175))||_0x452754['includes'](_0x3781ed(0x174)))throw new Error(_0x3781ed(0x17c));if(_0x3781ed(0x165)in _0x1534d4)throw new Error(_0x3781ed(0x183));a64_0x498279['writeFileSync'](_0x50fcaf,JSON['stringify'](_0x1534d4,null,0x2));}export function hasProjectConfig(_0x475f43){return findProjectConfigPath(_0x475f43)!==null;}export function getProjectRoot(_0x1fa611){const _0xea5f9d=findProjectConfigPath(_0x1fa611);return _0xea5f9d?a64_0x342e7e['dirname'](_0xea5f9d):null;}
@@ -1 +1 @@
1
- (function(_0x1f6cdd,_0x35dbf0){const _0x17dcfe=a65_0x1fa1,_0x174b3e=_0x1f6cdd();while(!![]){try{const _0x222656=-parseInt(_0x17dcfe(0xf7))/0x1*(parseInt(_0x17dcfe(0x105))/0x2)+-parseInt(_0x17dcfe(0xfc))/0x3+parseInt(_0x17dcfe(0xf2))/0x4+-parseInt(_0x17dcfe(0xed))/0x5+-parseInt(_0x17dcfe(0xf4))/0x6+parseInt(_0x17dcfe(0xf3))/0x7+parseInt(_0x17dcfe(0x104))/0x8;if(_0x222656===_0x35dbf0)break;else _0x174b3e['push'](_0x174b3e['shift']());}catch(_0x235b4c){_0x174b3e['push'](_0x174b3e['shift']());}}}(a65_0x3907,0x8246d));import*as a65_0x5e7fe8 from'node:fs';import*as a65_0xde314f from'node:path';import*as a65_0x1ffa4a 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 _0xd516ed=a65_0x1fa1,_0x325ff0=process.env.TDX_CONFIG_DIR||a65_0xde314f[_0xd516ed(0xeb)](a65_0x1ffa4a[_0xd516ed(0x108)](),'.config','tdx');return a65_0xde314f['join'](_0x325ff0,_0xd516ed(0x102));}function getSessionPath(_0x2e00dd){const _0x534556=a65_0x1fa1;return a65_0xde314f[_0x534556(0xeb)](getSessionsDir(),_0x2e00dd+_0x534556(0xff));}export function getCurrentSessionPID(){return getPPID();}function a65_0x3907(){const _0x3bf56c=['1412598YVFgry','push','existsSync','53bLOuCH','getTime','toString','endsWith','toISOString','1457883VkQUXd','includes','stringify','.json','warn','createdAt','sessions','now','4451936wIjRhV','1018YWGtFu','readdirSync','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','homedir','writeFileSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','apiKey','readFileSync','test','.\x20This\x20is\x20insecure.\x20Removing\x20session.','parse','join','utf-8','1931535rImARa','replace','api_key','sort','unlinkSync','1829904CDTavs','4580261aYQTBi'];a65_0x3907=function(){return _0x3bf56c;};return a65_0x3907();}export function getSessionID(_0x2c6abb){const _0x51084f=a65_0x1fa1;if(_0x2c6abb)return _0x2c6abb;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x51084f(0xf9)]();}export function loadSessionContext(_0x3af83d){const _0x2022f6=getSessionID(_0x3af83d),_0x2884d8=/^\d+$/['test'](_0x2022f6)?parseInt(_0x2022f6,0xa):null;return _0x2884d8!==null?loadSessionContextByPID(_0x2884d8):loadSessionContextByString(_0x2022f6);}export function loadSessionContextByPID(_0x12b578){const _0x11e771=a65_0x1fa1,_0x357870=getSessionPath(_0x12b578);if(!a65_0x5e7fe8[_0x11e771(0xf6)](_0x357870))return null;try{const _0x3b99b8=a65_0x5e7fe8['readFileSync'](_0x357870,_0x11e771(0xec)),_0x301d89=JSON['parse'](_0x3b99b8),_0x246b63=new Date(_0x301d89[_0x11e771(0x101)])['getTime'](),_0x1d8c6d=Date[_0x11e771(0x103)]();if(_0x1d8c6d-_0x246b63>SESSION_EXPIRATION_MS)return a65_0x5e7fe8[_0x11e771(0xf1)](_0x357870),null;const _0x1fa82d=JSON['stringify'](_0x301d89);if(_0x1fa82d[_0x11e771(0xfd)]('TD_API_KEY')||_0x1fa82d[_0x11e771(0xfd)](_0x11e771(0x10b))||_0x1fa82d[_0x11e771(0xfd)](_0x11e771(0xef)))return console[_0x11e771(0x100)](_0x11e771(0x10a)+_0x357870+_0x11e771(0xe9)),a65_0x5e7fe8[_0x11e771(0xf1)](_0x357870),null;return _0x301d89;}catch{try{a65_0x5e7fe8[_0x11e771(0xf1)](_0x357870);}catch{}return null;}}function loadSessionContextByString(_0x24dd56){const _0x1365f9=a65_0x1fa1,_0x341648=a65_0xde314f[_0x1365f9(0xeb)](getSessionsDir(),_0x24dd56+_0x1365f9(0xff));if(!a65_0x5e7fe8[_0x1365f9(0xf6)](_0x341648))return null;try{const _0x4c90bd=a65_0x5e7fe8[_0x1365f9(0x10c)](_0x341648,'utf-8'),_0x3c1be6=JSON['parse'](_0x4c90bd),_0x3c719e=new Date(_0x3c1be6[_0x1365f9(0x101)])['getTime'](),_0x47b562=Date[_0x1365f9(0x103)]();if(_0x47b562-_0x3c719e>SESSION_EXPIRATION_MS)return a65_0x5e7fe8[_0x1365f9(0xf1)](_0x341648),null;const _0xb8504=JSON[_0x1365f9(0xfe)](_0x3c1be6);if(_0xb8504['includes']('TD_API_KEY')||_0xb8504[_0x1365f9(0xfd)](_0x1365f9(0x10b))||_0xb8504['includes'](_0x1365f9(0xef)))return console['warn'](_0x1365f9(0x10a)+_0x341648+_0x1365f9(0xe9)),a65_0x5e7fe8[_0x1365f9(0xf1)](_0x341648),null;return _0x3c1be6;}catch{try{a65_0x5e7fe8[_0x1365f9(0xf1)](_0x341648);}catch{}return null;}}export function saveSessionContext(_0x14fa3b,_0x6777c6){const _0x2c276b=a65_0x1fa1,_0x11945f=getSessionID(_0x6777c6),_0x46e65a=/^\d+$/[_0x2c276b(0x10d)](_0x11945f)?parseInt(_0x11945f,0xa):getCurrentSessionPID(),_0x3d8407=a65_0xde314f['join'](getSessionsDir(),_0x11945f+_0x2c276b(0xff)),_0x52e38a=getSessionsDir();createSecureDirectory(_0x52e38a);const _0x16cea0=JSON['stringify'](_0x14fa3b);if(_0x16cea0[_0x2c276b(0xfd)]('TD_API_KEY')||_0x16cea0[_0x2c276b(0xfd)](_0x2c276b(0x10b))||_0x16cea0[_0x2c276b(0xfd)](_0x2c276b(0xef)))throw new Error(_0x2c276b(0x107));let _0x3b4312;const _0x5fc3f=/^\d+$/[_0x2c276b(0x10d)](_0x11945f)?loadSessionContextByPID(parseInt(_0x11945f,0xa)):loadSessionContextByString(_0x11945f);_0x5fc3f?_0x3b4312={..._0x5fc3f,..._0x14fa3b,'pid':_0x46e65a,'sessionId':_0x11945f!==_0x46e65a['toString']()?_0x11945f:undefined,'updatedAt':new Date()[_0x2c276b(0xfb)]()}:_0x3b4312={'pid':_0x46e65a,'sessionId':_0x11945f!==_0x46e65a['toString']()?_0x11945f:undefined,..._0x14fa3b,'createdAt':new Date()[_0x2c276b(0xfb)](),'updatedAt':new Date()['toISOString']()},a65_0x5e7fe8['writeFileSync'](_0x3d8407,JSON['stringify'](_0x3b4312,null,0x2));}export function clearSessionContext(_0x436398){const _0x28c556=a65_0x1fa1,_0x303cc4=getSessionID(_0x436398),_0xd3e47e=a65_0xde314f[_0x28c556(0xeb)](getSessionsDir(),_0x303cc4+'.json');a65_0x5e7fe8[_0x28c556(0xf6)](_0xd3e47e)&&a65_0x5e7fe8[_0x28c556(0xf1)](_0xd3e47e);}export function clearSessionContextField(_0x56a663,_0xde83e5){const _0x3a3321=a65_0x1fa1,_0x311a5b=getSessionID(_0xde83e5),_0x5d6c88=a65_0xde314f['join'](getSessionsDir(),_0x311a5b+'.json');if(!a65_0x5e7fe8[_0x3a3321(0xf6)](_0x5d6c88))return;try{const _0x1a6016=a65_0x5e7fe8[_0x3a3321(0x10c)](_0x5d6c88,_0x3a3321(0xec)),_0x20907a=JSON[_0x3a3321(0xea)](_0x1a6016);delete _0x20907a[_0x56a663],a65_0x5e7fe8[_0x3a3321(0x109)](_0x5d6c88,JSON[_0x3a3321(0xfe)](_0x20907a,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x6bdb72=a65_0x1fa1,_0x1a82ef=getSessionsDir();if(!a65_0x5e7fe8[_0x6bdb72(0xf6)](_0x1a82ef))return 0x0;let _0x4f3fb8=0x0;const _0x345571=Date['now']();try{const _0x11183d=a65_0x5e7fe8['readdirSync'](_0x1a82ef);for(const _0x22e8e9 of _0x11183d){if(!_0x22e8e9[_0x6bdb72(0xfa)](_0x6bdb72(0xff)))continue;const _0x2db23a=a65_0xde314f[_0x6bdb72(0xeb)](_0x1a82ef,_0x22e8e9),_0x2f8545=_0x22e8e9[_0x6bdb72(0xee)](_0x6bdb72(0xff),''),_0x40faad=parseInt(_0x2f8545,0xa),_0x2a84c5=!isNaN(_0x40faad);if(_0x2a84c5){if(!isProcessRunning(_0x40faad)){a65_0x5e7fe8['unlinkSync'](_0x2db23a),_0x4f3fb8++;continue;}}try{const _0x14da03=a65_0x5e7fe8[_0x6bdb72(0x10c)](_0x2db23a,_0x6bdb72(0xec)),_0x1a491f=JSON[_0x6bdb72(0xea)](_0x14da03),_0x56eaff=new Date(_0x1a491f[_0x6bdb72(0x101)])[_0x6bdb72(0xf8)]();_0x345571-_0x56eaff>SESSION_EXPIRATION_MS&&(a65_0x5e7fe8[_0x6bdb72(0xf1)](_0x2db23a),_0x4f3fb8++);}catch{a65_0x5e7fe8[_0x6bdb72(0xf1)](_0x2db23a),_0x4f3fb8++;}}}catch{}return _0x4f3fb8;}function a65_0x1fa1(_0x3282f6,_0x463652){_0x3282f6=_0x3282f6-0xe9;const _0x39079a=a65_0x3907();let _0x1fa14c=_0x39079a[_0x3282f6];return _0x1fa14c;}export function listActiveSessions(){const _0x2caf95=a65_0x1fa1,_0x36f843=getSessionsDir();if(!a65_0x5e7fe8[_0x2caf95(0xf6)](_0x36f843))return[];try{const _0x2d2d0a=a65_0x5e7fe8[_0x2caf95(0x106)](_0x36f843),_0x16db5b=[];for(const _0x92467c of _0x2d2d0a){if(!_0x92467c[_0x2caf95(0xfa)](_0x2caf95(0xff)))continue;const _0x2c788d=_0x92467c[_0x2caf95(0xee)](_0x2caf95(0xff),''),_0x1b04cc=parseInt(_0x2c788d,0xa);!isNaN(_0x1b04cc)&&isProcessRunning(_0x1b04cc)&&_0x16db5b[_0x2caf95(0xf5)](_0x1b04cc);}return _0x16db5b[_0x2caf95(0xf0)]((_0x4a7ee4,_0x21c768)=>_0x4a7ee4-_0x21c768);}catch{return[];}}
1
+ (function(_0x3b5e9e,_0x404da7){const _0x4310cf=a65_0x5de9,_0x189bda=_0x3b5e9e();while(!![]){try{const _0x6e0b95=-parseInt(_0x4310cf(0x194))/0x1*(parseInt(_0x4310cf(0x181))/0x2)+parseInt(_0x4310cf(0x18e))/0x3*(parseInt(_0x4310cf(0x190))/0x4)+-parseInt(_0x4310cf(0x18f))/0x5+parseInt(_0x4310cf(0x182))/0x6+parseInt(_0x4310cf(0x173))/0x7*(-parseInt(_0x4310cf(0x185))/0x8)+-parseInt(_0x4310cf(0x177))/0x9+parseInt(_0x4310cf(0x192))/0xa;if(_0x6e0b95===_0x404da7)break;else _0x189bda['push'](_0x189bda['shift']());}catch(_0xdd67f5){_0x189bda['push'](_0x189bda['shift']());}}}(a65_0x577a,0xc05ba));import*as a65_0xd08f17 from'node:fs';import*as a65_0x5535ad from'node:path';import*as a65_0x5ca787 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 _0x54063b=a65_0x5de9,_0x5a4aff=process.env.TDX_CONFIG_DIR||a65_0x5535ad[_0x54063b(0x178)](a65_0x5ca787[_0x54063b(0x17e)](),'.config',_0x54063b(0x174));return a65_0x5535ad[_0x54063b(0x178)](_0x5a4aff,'sessions');}function getSessionPath(_0xcb2b72){return a65_0x5535ad['join'](getSessionsDir(),_0xcb2b72+'.json');}export function getCurrentSessionPID(){return getPPID();}function a65_0x577a(){const _0x3fb14a=['553023aHqPsM','join','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','unlinkSync','existsSync','parse','warn','homedir','replace','now','51710fPcDTv','1010790BkoLpH','TD_API_KEY','toString','32jqiSdG','test','includes','sort','writeFileSync','createdAt','readdirSync','api_key','utf-8','18732FlIroZ','3635495tTCKvD','360yHhVuM','toISOString','19221540pseePE','endsWith','9BhLVGs','.\x20This\x20is\x20insecure.\x20Removing\x20session.','.json','getTime','apiKey','1476020pHmfTf','tdx','stringify','readFileSync'];a65_0x577a=function(){return _0x3fb14a;};return a65_0x577a();}export function getSessionID(_0x32a601){const _0x29206e=a65_0x5de9;if(_0x32a601)return _0x32a601;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x29206e(0x184)]();}export function loadSessionContext(_0x218773){const _0x3955db=a65_0x5de9,_0x35528f=getSessionID(_0x218773),_0x398ca2=/^\d+$/[_0x3955db(0x186)](_0x35528f)?parseInt(_0x35528f,0xa):null;return _0x398ca2!==null?loadSessionContextByPID(_0x398ca2):loadSessionContextByString(_0x35528f);}export function loadSessionContextByPID(_0x1545cc){const _0x4322b4=a65_0x5de9,_0x2fca77=getSessionPath(_0x1545cc);if(!a65_0xd08f17[_0x4322b4(0x17b)](_0x2fca77))return null;try{const _0x1078bc=a65_0xd08f17[_0x4322b4(0x176)](_0x2fca77,_0x4322b4(0x18d)),_0x3ac4f6=JSON['parse'](_0x1078bc),_0x5ec4fc=new Date(_0x3ac4f6[_0x4322b4(0x18a)])[_0x4322b4(0x197)](),_0x2d9494=Date[_0x4322b4(0x180)]();if(_0x2d9494-_0x5ec4fc>SESSION_EXPIRATION_MS)return a65_0xd08f17[_0x4322b4(0x17a)](_0x2fca77),null;const _0x39de56=JSON[_0x4322b4(0x175)](_0x3ac4f6);if(_0x39de56['includes'](_0x4322b4(0x183))||_0x39de56['includes'](_0x4322b4(0x172))||_0x39de56[_0x4322b4(0x187)]('api_key'))return console[_0x4322b4(0x17d)](_0x4322b4(0x179)+_0x2fca77+_0x4322b4(0x195)),a65_0xd08f17[_0x4322b4(0x17a)](_0x2fca77),null;return _0x3ac4f6;}catch{try{a65_0xd08f17['unlinkSync'](_0x2fca77);}catch{}return null;}}function loadSessionContextByString(_0xf2cd9d){const _0x2fcf87=a65_0x5de9,_0x453263=a65_0x5535ad[_0x2fcf87(0x178)](getSessionsDir(),_0xf2cd9d+'.json');if(!a65_0xd08f17[_0x2fcf87(0x17b)](_0x453263))return null;try{const _0x6e6695=a65_0xd08f17[_0x2fcf87(0x176)](_0x453263,_0x2fcf87(0x18d)),_0x1ad554=JSON[_0x2fcf87(0x17c)](_0x6e6695),_0x4a3b0d=new Date(_0x1ad554[_0x2fcf87(0x18a)])['getTime'](),_0x22cf81=Date[_0x2fcf87(0x180)]();if(_0x22cf81-_0x4a3b0d>SESSION_EXPIRATION_MS)return a65_0xd08f17[_0x2fcf87(0x17a)](_0x453263),null;const _0x2e0289=JSON[_0x2fcf87(0x175)](_0x1ad554);if(_0x2e0289[_0x2fcf87(0x187)](_0x2fcf87(0x183))||_0x2e0289['includes'](_0x2fcf87(0x172))||_0x2e0289[_0x2fcf87(0x187)](_0x2fcf87(0x18c)))return console['warn'](_0x2fcf87(0x179)+_0x453263+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a65_0xd08f17[_0x2fcf87(0x17a)](_0x453263),null;return _0x1ad554;}catch{try{a65_0xd08f17[_0x2fcf87(0x17a)](_0x453263);}catch{}return null;}}export function saveSessionContext(_0x2f6a3d,_0x784738){const _0x2a3f87=a65_0x5de9,_0x136c74=getSessionID(_0x784738),_0x7b65e9=/^\d+$/[_0x2a3f87(0x186)](_0x136c74)?parseInt(_0x136c74,0xa):getCurrentSessionPID(),_0x217898=a65_0x5535ad['join'](getSessionsDir(),_0x136c74+_0x2a3f87(0x196)),_0x2e86d3=getSessionsDir();createSecureDirectory(_0x2e86d3);const _0x1e29d8=JSON[_0x2a3f87(0x175)](_0x2f6a3d);if(_0x1e29d8['includes'](_0x2a3f87(0x183))||_0x1e29d8['includes']('apiKey')||_0x1e29d8['includes'](_0x2a3f87(0x18c)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.');let _0x1b576c;const _0x54b18d=/^\d+$/['test'](_0x136c74)?loadSessionContextByPID(parseInt(_0x136c74,0xa)):loadSessionContextByString(_0x136c74);_0x54b18d?_0x1b576c={..._0x54b18d,..._0x2f6a3d,'pid':_0x7b65e9,'sessionId':_0x136c74!==_0x7b65e9[_0x2a3f87(0x184)]()?_0x136c74:undefined,'updatedAt':new Date()[_0x2a3f87(0x191)]()}:_0x1b576c={'pid':_0x7b65e9,'sessionId':_0x136c74!==_0x7b65e9['toString']()?_0x136c74:undefined,..._0x2f6a3d,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()['toISOString']()},a65_0xd08f17[_0x2a3f87(0x189)](_0x217898,JSON[_0x2a3f87(0x175)](_0x1b576c,null,0x2));}export function clearSessionContext(_0x1fec9b){const _0x575c79=a65_0x5de9,_0x11a915=getSessionID(_0x1fec9b),_0x29bc61=a65_0x5535ad['join'](getSessionsDir(),_0x11a915+'.json');a65_0xd08f17[_0x575c79(0x17b)](_0x29bc61)&&a65_0xd08f17[_0x575c79(0x17a)](_0x29bc61);}export function clearSessionContextField(_0x3f5ac9,_0x2ee3b3){const _0x46e6e1=a65_0x5de9,_0x3f8107=getSessionID(_0x2ee3b3),_0x193ed3=a65_0x5535ad[_0x46e6e1(0x178)](getSessionsDir(),_0x3f8107+_0x46e6e1(0x196));if(!a65_0xd08f17['existsSync'](_0x193ed3))return;try{const _0x11e4d0=a65_0xd08f17[_0x46e6e1(0x176)](_0x193ed3,_0x46e6e1(0x18d)),_0x10741d=JSON[_0x46e6e1(0x17c)](_0x11e4d0);delete _0x10741d[_0x3f5ac9],a65_0xd08f17[_0x46e6e1(0x189)](_0x193ed3,JSON['stringify'](_0x10741d,null,0x2));}catch{}}function a65_0x5de9(_0x568f30,_0x50c553){_0x568f30=_0x568f30-0x172;const _0x577a06=a65_0x577a();let _0x5de979=_0x577a06[_0x568f30];return _0x5de979;}export function cleanExpiredSessions(){const _0x5742e9=a65_0x5de9,_0x27e2e3=getSessionsDir();if(!a65_0xd08f17[_0x5742e9(0x17b)](_0x27e2e3))return 0x0;let _0x2438ee=0x0;const _0x389322=Date[_0x5742e9(0x180)]();try{const _0x4887f8=a65_0xd08f17[_0x5742e9(0x18b)](_0x27e2e3);for(const _0x50f6ec of _0x4887f8){if(!_0x50f6ec[_0x5742e9(0x193)](_0x5742e9(0x196)))continue;const _0x1942df=a65_0x5535ad[_0x5742e9(0x178)](_0x27e2e3,_0x50f6ec),_0x4be9ea=_0x50f6ec[_0x5742e9(0x17f)](_0x5742e9(0x196),''),_0x1f3f08=parseInt(_0x4be9ea,0xa),_0x3ca0bd=!isNaN(_0x1f3f08);if(_0x3ca0bd){if(!isProcessRunning(_0x1f3f08)){a65_0xd08f17[_0x5742e9(0x17a)](_0x1942df),_0x2438ee++;continue;}}try{const _0x13faaf=a65_0xd08f17['readFileSync'](_0x1942df,'utf-8'),_0x3f8a1c=JSON[_0x5742e9(0x17c)](_0x13faaf),_0x53b2bd=new Date(_0x3f8a1c[_0x5742e9(0x18a)])['getTime']();_0x389322-_0x53b2bd>SESSION_EXPIRATION_MS&&(a65_0xd08f17[_0x5742e9(0x17a)](_0x1942df),_0x2438ee++);}catch{a65_0xd08f17[_0x5742e9(0x17a)](_0x1942df),_0x2438ee++;}}}catch{}return _0x2438ee;}export function listActiveSessions(){const _0x5f08b6=a65_0x5de9,_0x4202aa=getSessionsDir();if(!a65_0xd08f17[_0x5f08b6(0x17b)](_0x4202aa))return[];try{const _0x140984=a65_0xd08f17[_0x5f08b6(0x18b)](_0x4202aa),_0x16a4d6=[];for(const _0xcdac69 of _0x140984){if(!_0xcdac69[_0x5f08b6(0x193)](_0x5f08b6(0x196)))continue;const _0x3bf0f8=_0xcdac69['replace'](_0x5f08b6(0x196),''),_0x140cf5=parseInt(_0x3bf0f8,0xa);!isNaN(_0x140cf5)&&isProcessRunning(_0x140cf5)&&_0x16a4d6['push'](_0x140cf5);}return _0x16a4d6[_0x5f08b6(0x188)]((_0x3673fe,_0x38f745)=>_0x3673fe-_0x38f745);}catch{return[];}}
@@ -1 +1 @@
1
- const a66_0x1578da=a66_0x4797;function a66_0x4797(_0x2403d3,_0x28d502){_0x2403d3=_0x2403d3-0x10b;const _0x1e3a8e=a66_0x1e3a();let _0x479761=_0x1e3a8e[_0x2403d3];return _0x479761;}(function(_0x347110,_0x1c7bbe){const _0x3c2d6e=a66_0x4797,_0x2fa4df=_0x347110();while(!![]){try{const _0x40e381=-parseInt(_0x3c2d6e(0x10b))/0x1+-parseInt(_0x3c2d6e(0x11a))/0x2+-parseInt(_0x3c2d6e(0x112))/0x3*(parseInt(_0x3c2d6e(0x10f))/0x4)+parseInt(_0x3c2d6e(0x119))/0x5*(-parseInt(_0x3c2d6e(0x118))/0x6)+parseInt(_0x3c2d6e(0x110))/0x7+-parseInt(_0x3c2d6e(0x113))/0x8*(parseInt(_0x3c2d6e(0x117))/0x9)+parseInt(_0x3c2d6e(0x115))/0xa;if(_0x40e381===_0x1c7bbe)break;else _0x2fa4df['push'](_0x2fa4df['shift']());}catch(_0x73000b){_0x2fa4df['push'](_0x2fa4df['shift']());}}}(a66_0x1e3a,0x68172));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache('users-{profile}.json',a66_0x1578da(0x116));export function loadCachedUsers(_0x8afafe){const _0x34aea5=a66_0x1578da,_0x3bbb23=userCache[_0x34aea5(0x111)](_0x8afafe);return _0x3bbb23?.[_0x34aea5(0x10d)]??null;}export function saveCachedUsers(_0x59cd0a,_0x1ae0c6){const _0x59dc45=a66_0x1578da;userCache[_0x59dc45(0x10e)](_0x59cd0a,{'users':_0x1ae0c6,'cachedAt':Date[_0x59dc45(0x10c)]()});}export function clearUserCache(_0x34a004){const _0x1d4575=a66_0x1578da;userCache[_0x1d4575(0x114)](_0x34a004);}function a66_0x1e3a(){const _0x25ff7a=['read','2343741FvAGer','8pWIDRo','clear','24422330AVPovT','core/user-cache','2389761YbwAIq','147642LdkdbJ','130ftxwAO','1668400nnDbhm','189690xijIMa','now','users','write','4AJALoR','4861983SUkcCd'];a66_0x1e3a=function(){return _0x25ff7a;};return a66_0x1e3a();}
1
+ const a66_0x1ac81f=a66_0xed66;(function(_0x5d900f,_0x9c25ed){const _0xb01394=a66_0xed66,_0x2a9983=_0x5d900f();while(!![]){try{const _0x1092e7=-parseInt(_0xb01394(0x19c))/0x1+-parseInt(_0xb01394(0x1a4))/0x2*(-parseInt(_0xb01394(0x198))/0x3)+-parseInt(_0xb01394(0x1a7))/0x4*(parseInt(_0xb01394(0x1a0))/0x5)+parseInt(_0xb01394(0x19e))/0x6*(parseInt(_0xb01394(0x1a2))/0x7)+parseInt(_0xb01394(0x1a6))/0x8+-parseInt(_0xb01394(0x1a5))/0x9*(-parseInt(_0xb01394(0x197))/0xa)+-parseInt(_0xb01394(0x1a1))/0xb*(parseInt(_0xb01394(0x19f))/0xc);if(_0x1092e7===_0x9c25ed)break;else _0x2a9983['push'](_0x2a9983['shift']());}catch(_0x46ad6a){_0x2a9983['push'](_0x2a9983['shift']());}}}(a66_0x5c58,0x7325c));function a66_0xed66(_0x12b348,_0x3a6c4d){_0x12b348=_0x12b348-0x196;const _0x5c5800=a66_0x5c58();let _0xed66d7=_0x5c5800[_0x12b348];return _0xed66d7;}import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a66_0x1ac81f(0x199),a66_0x1ac81f(0x1a3));export function loadCachedUsers(_0x102344){const _0x1dab49=a66_0x1ac81f,_0xbe0e4b=userCache[_0x1dab49(0x19b)](_0x102344);return _0xbe0e4b?.[_0x1dab49(0x19a)]??null;}export function saveCachedUsers(_0x555d19,_0x4eb351){const _0x5e34d5=a66_0x1ac81f;userCache[_0x5e34d5(0x196)](_0x555d19,{'users':_0x4eb351,'cachedAt':Date['now']()});}function a66_0x5c58(){const _0x2149a3=['core/user-cache','2vMHvVe','9vCKJYz','4452728tWwXWL','12TXPgQM','write','1134430sBrmPT','1051593vZqHDU','users-{profile}.json','users','read','210320HVCDea','clear','6HIovol','1559004STiHYI','476565RJJEmU','11ZOImbX','540785hDBizE'];a66_0x5c58=function(){return _0x2149a3;};return a66_0x5c58();}export function clearUserCache(_0x3ada97){const _0x46f2e0=a66_0x1ac81f;userCache[_0x46f2e0(0x19d)](_0x3ada97);}
@@ -1 +1 @@
1
- (function(_0x401aab,_0x5b2887){const _0x297f53=a67_0x17de,_0x269934=_0x401aab();while(!![]){try{const _0x1afda4=parseInt(_0x297f53(0xb5))/0x1*(parseInt(_0x297f53(0xb2))/0x2)+-parseInt(_0x297f53(0xb4))/0x3*(parseInt(_0x297f53(0xb8))/0x4)+-parseInt(_0x297f53(0xbb))/0x5+parseInt(_0x297f53(0xbc))/0x6+parseInt(_0x297f53(0xb1))/0x7*(-parseInt(_0x297f53(0xba))/0x8)+-parseInt(_0x297f53(0xb6))/0x9+parseInt(_0x297f53(0xb3))/0xa;if(_0x1afda4===_0x5b2887)break;else _0x269934['push'](_0x269934['shift']());}catch(_0x5e3308){_0x269934['push'](_0x269934['shift']());}}}(a67_0x42f8,0xb6976));function a67_0x17de(_0x19461e,_0x1d1656){_0x19461e=_0x19461e-0xb1;const _0x42f84f=a67_0x42f8();let _0x17de99=_0x42f84f[_0x19461e];return _0x17de99;}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x310485=a67_0x17de;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x5e29cb=fileURLToPath(import.meta.url),_0x25911b=dirname(_0x5e29cb);try{const _0x2ae545=join(_0x25911b,_0x310485(0xbf));cachedBuildInfo=JSON['parse'](readFileSync(_0x2ae545,_0x310485(0xbd)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0xb3c919=a67_0x17de;if(cachedVersion!==null)return cachedVersion;const _0x1f2da4=fileURLToPath(import.meta.url),_0x359b35=dirname(_0x1f2da4),_0xfc0f80=getBuildInfo();if(_0xfc0f80[_0xb3c919(0xc0)])return cachedVersion=_0xfc0f80[_0xb3c919(0xc0)],cachedVersion;try{const _0x5eee4e=join(_0x359b35,_0xb3c919(0xb9)),_0x43a0dc=JSON[_0xb3c919(0xbe)](readFileSync(_0x5eee4e,_0xb3c919(0xbd)));cachedVersion=_0x43a0dc[_0xb3c919(0xc0)];}catch{cachedVersion=_0xb3c919(0xb7);}return cachedVersion;}export function isDevVersion(){const _0x13a695=a67_0x17de,_0x5d3c5f=getVersion();return _0x5d3c5f[_0x13a695(0xc1)]('.dev')||_0x5d3c5f[_0x13a695(0xc1)]('-');}function a67_0x42f8(){const _0x2efc0f=['../build-info.json','version','includes','77OqULit','4wGIaVm','15303840pYuxmf','3fpqlOM','200363fNlgvw','641664bEiqgl','0.0.0','4833896fbiSMZ','../../package.json','589048ibUhjn','2002080WAiZhE','7841466cqZpty','utf-8','parse'];a67_0x42f8=function(){return _0x2efc0f;};return a67_0x42f8();}
1
+ function a67_0x1913(_0x756fbb,_0x326235){_0x756fbb=_0x756fbb-0xe8;const _0x626795=a67_0x6267();let _0x19133d=_0x626795[_0x756fbb];return _0x19133d;}(function(_0x3080eb,_0x5d9a13){const _0x13b856=a67_0x1913,_0x5167fe=_0x3080eb();while(!![]){try{const _0x26d798=parseInt(_0x13b856(0xe8))/0x1+parseInt(_0x13b856(0xf1))/0x2*(parseInt(_0x13b856(0xed))/0x3)+parseInt(_0x13b856(0xee))/0x4*(parseInt(_0x13b856(0xf0))/0x5)+-parseInt(_0x13b856(0xf7))/0x6+parseInt(_0x13b856(0xf8))/0x7*(parseInt(_0x13b856(0xe9))/0x8)+parseInt(_0x13b856(0xf4))/0x9+-parseInt(_0x13b856(0xf6))/0xa*(parseInt(_0x13b856(0xf9))/0xb);if(_0x26d798===_0x5d9a13)break;else _0x5167fe['push'](_0x5167fe['shift']());}catch(_0x235cf7){_0x5167fe['push'](_0x5167fe['shift']());}}}(a67_0x6267,0x4143e));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x59f36d=a67_0x1913;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x338ef1=fileURLToPath(import.meta.url),_0x32ab85=dirname(_0x338ef1);try{const _0x3fb7bb=join(_0x32ab85,_0x59f36d(0xec));cachedBuildInfo=JSON[_0x59f36d(0xea)](readFileSync(_0x3fb7bb,_0x59f36d(0xf2)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x3d1d1d=a67_0x1913;if(cachedVersion!==null)return cachedVersion;const _0x562530=fileURLToPath(import.meta.url),_0x19f907=dirname(_0x562530),_0xe49c81=getBuildInfo();if(_0xe49c81['version'])return cachedVersion=_0xe49c81[_0x3d1d1d(0xf5)],cachedVersion;try{const _0x3c5aec=join(_0x19f907,_0x3d1d1d(0xfa)),_0x331cc7=JSON[_0x3d1d1d(0xea)](readFileSync(_0x3c5aec,_0x3d1d1d(0xf2)));cachedVersion=_0x331cc7[_0x3d1d1d(0xf5)];}catch{cachedVersion=_0x3d1d1d(0xf3);}return cachedVersion;}function a67_0x6267(){const _0x2e8a7f=['1115559tIHmDY','version','8364710PhaaHD','45294TtMBZb','7KRvyNQ','11AdELXT','../../package.json','360740LRahzX','1463752JPfonB','parse','includes','../build-info.json','447zYsahu','292564LiaeSO','.dev','10QpsHCy','3992ynGxXR','utf-8','0.0.0'];a67_0x6267=function(){return _0x2e8a7f;};return a67_0x6267();}export function isDevVersion(){const _0x25e288=a67_0x1913,_0xdc76e=getVersion();return _0xdc76e['includes'](_0x25e288(0xef))||_0xdc76e[_0x25e288(0xeb)]('-');}