@treasuredata/tdx 2026.3.11 → 2026.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x1f7abd=a54_0x67aa;(function(_0x53e425,_0xef3240){const _0x226974=a54_0x67aa,_0x345aa5=_0x53e425();while(!![]){try{const _0x3ac493=-parseInt(_0x226974(0x178))/0x1+parseInt(_0x226974(0x169))/0x2+parseInt(_0x226974(0x17f))/0x3+parseInt(_0x226974(0x14c))/0x4*(-parseInt(_0x226974(0x142))/0x5)+parseInt(_0x226974(0x140))/0x6*(-parseInt(_0x226974(0x14a))/0x7)+parseInt(_0x226974(0x146))/0x8+parseInt(_0x226974(0x149))/0x9;if(_0x3ac493===_0xef3240)break;else _0x345aa5['push'](_0x345aa5['shift']());}catch(_0x5eed11){_0x345aa5['push'](_0x345aa5['shift']());}}}(a54_0x405e,0xf0409));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x2df7ff from'node:fs';import*as a54_0xd67e8a from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a54_0x25c200 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x5d49c5=a54_0x67aa;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x5d49c5(0x14e),'tdx');}export function getConfigFile(){const _0x322879=a54_0x67aa;return join(getConfigDir(),_0x322879(0x170));}export function getConfigFilePath(_0xf3dbe1){const _0x348220=a54_0x67aa,_0x314fb2=getConfigDir();return _0xf3dbe1?a54_0xd67e8a[_0x348220(0x152)](_0x314fb2,_0x348220(0x15b)+_0xf3dbe1):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x1f7abd(0x151),a54_0x1f7abd(0x160));export function getLLMProjectCacheFile(_0xda6ea5){return llmProjectCache['path'](_0xda6ea5);}export function readCachedLLMProject(_0x90c838){const _0x19df41=a54_0x1f7abd,_0x14e7f3=llmProjectCache['read'](_0x90c838);if(_0x14e7f3&&typeof _0x14e7f3['id']===_0x19df41(0x16b)&&typeof _0x14e7f3[_0x19df41(0x14d)]===_0x19df41(0x16b))return _0x14e7f3;return null;}export function writeCachedLLMProject(_0x4502c5,_0x6e7167,_0x4d4997){try{llmProjectCache['write']({'name':_0x4502c5,'id':_0x6e7167},_0x4d4997);}catch{}}const llmAgentCache=createOptionalProfileCache('llm_default_agent',a54_0x1f7abd(0x17b));export function getLLMAgentCacheFile(_0x34e21b){const _0x19c440=a54_0x1f7abd;return llmAgentCache[_0x19c440(0x17a)](_0x34e21b);}export function readCachedLLMAgent(_0x5772a8){const _0x1da9db=a54_0x1f7abd,_0x219832=llmAgentCache[_0x1da9db(0x141)](_0x5772a8);if(_0x219832&&typeof _0x219832['id']==='string'&&typeof _0x219832['name']===_0x1da9db(0x16b)&&typeof _0x219832['projectId']===_0x1da9db(0x16b))return _0x219832;return null;}export function writeCachedLLMAgent(_0x2aeec1,_0x2a5fd3,_0x290efc,_0x2907a7){const _0x12dce3=a54_0x1f7abd;try{llmAgentCache[_0x12dce3(0x180)]({'name':_0x2aeec1,'id':_0x2a5fd3,'projectId':_0x290efc},_0x2907a7);}catch{}}export function clearCachedLLMAgent(_0x4ef54a){const _0x3a4b9d=a54_0x1f7abd;try{llmAgentCache[_0x3a4b9d(0x16d)](_0x4ef54a);}catch{}}function a54_0x67aa(_0x32bcaa,_0x3d044b){_0x32bcaa=_0x32bcaa-0x136;const _0x405e3d=a54_0x405e();let _0x67aa59=_0x405e3d[_0x32bcaa];return _0x67aa59;}const accountInfoCache=createOptionalProfileCache(a54_0x1f7abd(0x165),a54_0x1f7abd(0x16a),{'suffix':a54_0x1f7abd(0x13e)});export function getAccountInfoCacheFile(_0x27e0af){return accountInfoCache['path'](_0x27e0af);}export function readCachedAccountInfo(_0x66ce5d){const _0x1e457c=a54_0x1f7abd,_0x1d3d00=accountInfoCache[_0x1e457c(0x141)](_0x66ce5d);if(_0x1d3d00&&typeof _0x1d3d00[_0x1e457c(0x137)]===_0x1e457c(0x16b)&&typeof _0x1d3d00['accountId']===_0x1e457c(0x153))return _0x1d3d00;return null;}export function writeCachedAccountInfo(_0x5cb617,_0x1921bf,_0x4b0cfc){const _0x2f2aa3=a54_0x1f7abd;try{accountInfoCache[_0x2f2aa3(0x180)]({'site':_0x5cb617,'accountId':_0x1921bf,'cachedAt':new Date()[_0x2f2aa3(0x172)]()},_0x4b0cfc);}catch{}}export function parseEnvFile(_0xb51e93){const _0x140391=a54_0x1f7abd,_0x1abeee={};for(const _0x60d80 of _0xb51e93['split']('\x0a')){const _0x448d7b=_0x60d80['trim']();if(!_0x448d7b||_0x448d7b[_0x140391(0x145)]('#'))continue;const _0x32cb8c=_0x448d7b[_0x140391(0x175)](/^([^=]+)=(.*)$/);if(_0x32cb8c){const _0xe451d6=_0x32cb8c[0x1]['trim']();let _0x43c079=_0x32cb8c[0x2][_0x140391(0x144)]();(_0x43c079[_0x140391(0x145)]('\x22')&&_0x43c079[_0x140391(0x162)]('\x22')||_0x43c079[_0x140391(0x145)]('\x27')&&_0x43c079[_0x140391(0x162)]('\x27'))&&(_0x43c079=_0x43c079['slice'](0x1,-0x1)),_0x1abeee[_0xe451d6]=_0x43c079;}}return _0x1abeee;}export function readUserConfig(){const _0x1e1b30=a54_0x1f7abd,_0x3a18c2=getConfigFile();if(!existsSync(_0x3a18c2))return{};try{const _0x324aa7=readFileSync(_0x3a18c2,'utf-8');return parseEnvFile(_0x324aa7);}catch(_0x35952f){return console[_0x1e1b30(0x164)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x3a18c2+':',_0x35952f),{};}}export function resolveSite(_0x388fa5){const _0x20641f=a54_0x1f7abd,_0x48e551=[_0x20641f(0x176),_0x20641f(0x168),_0x20641f(0x136),_0x20641f(0x147),_0x20641f(0x156),_0x20641f(0x161),_0x20641f(0x167),'stg-us01',_0x20641f(0x15a),'stg-ap03'];if(_0x48e551['includes'](_0x388fa5))return _0x388fa5;if(_0x388fa5 in SITE_ALIASES)return SITE_ALIASES[_0x388fa5];return console[_0x20641f(0x164)](_0x20641f(0x158)+_0x388fa5+_0x20641f(0x16f)),_0x20641f(0x176);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x310785){const _0x1f8747=a54_0x1f7abd,_0x36a1a8=_0x310785||getActiveProfileName()||undefined;if(_0x36a1a8){const _0x1939e4=_0x1f8747(0x163)+normalizeProfileForEnvVar(_0x36a1a8);if(process.env[_0x1939e4])return{'accessToken':process.env[_0x1939e4],'source':_0x1939e4+_0x1f8747(0x155)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x1f8747(0x13f)};return null;}export function getAccessToken(_0x445387){const _0x271071=a54_0x1f7abd;return resolveAccessToken(_0x445387)?.[_0x271071(0x154)];}export function getAPIKey(_0x472319){const _0x757c2a=a54_0x1f7abd,_0x36ba03=_0x472319||getActiveProfileName();if(_0x36ba03){const _0x5087d7=_0x757c2a(0x139)+normalizeProfileForEnvVar(_0x36ba03);if(process.env[_0x5087d7])return process.env[_0x5087d7];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x23200c){return _0x23200c['toUpperCase']()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x39de20,_0xf2e58c){const _0x12ffb8=a54_0x1f7abd,_0x248222=resolveAccessToken(_0xf2e58c);if(_0x248222)return{'apiKey':_0x248222['accessToken'],'source':_0x248222[_0x12ffb8(0x17c)],'isDeprecated':![]};const _0x6bc199=_0xf2e58c||getActiveProfileName()||undefined;if(_0x6bc199){const _0x23d8c6=_0x12ffb8(0x139)+normalizeProfileForEnvVar(_0x6bc199);if(process.env[_0x23d8c6])return{'apiKey':process.env[_0x23d8c6],'source':_0x23d8c6+'\x20env\x20var','isDeprecated':![]};const _0x3c9c60=getCachedCredential(_0x39de20,_0x6bc199);if(_0x3c9c60)return{'apiKey':_0x3c9c60,'source':_0x12ffb8(0x148)+_0x6bc199+')','isDeprecated':![]};const _0x110c53=await getKeychainAPIKey(_0x6bc199);if(_0x110c53)return setCachedCredential(_0x110c53,_0x39de20,_0x6bc199),{'apiKey':_0x110c53,'source':'keychain\x20(profile:\x20'+_0x6bc199+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x6bc199){const _0x4c9678=getCachedCredential(_0x39de20,undefined);if(_0x4c9678)return{'apiKey':_0x4c9678,'source':_0x12ffb8(0x173),'isDeprecated':![]};const _0x72c64a=await getKeychainAPIKey(undefined);if(_0x72c64a)return setCachedCredential(_0x72c64a,_0x39de20,undefined),{'apiKey':_0x72c64a,'source':_0x12ffb8(0x173),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x311705,_0x5953df){const _0x19acc0=a54_0x1f7abd,_0xea4c25=await resolveAPIKeyAsync(_0x311705,_0x5953df);return _0xea4c25?.[_0x19acc0(0x179)];}function a54_0x405e(){const _0x269858=['number','accessToken','\x20env\x20var','ap03','replace','Warning:\x20Unknown\x20site\x20\x27','entries','stg-ap01','.env.','stable','yellow','utf-8','TD_API_KEY_','config/llm-project','dev-us01','endsWith','TDX_ACCESS_TOKEN_','warn','account_info','map','dev-eu01','ap01','1240124GkxtZv','config/account-info','string','proxy','clear','existsSync','\x27,\x20defaulting\x20to\x20us01','.env','stg-ap03','toISOString','keychain','Warning:\x20Failed\x20to\x20read\x20','match','us01','stringify','1250549zlnvgu','apiKey','path','config/llm-agent','source','TD_API_KEY','tdx.json','5656605zzEjEq','write','apiKeys','eu01','site','release_channel','TDX_API_KEY_','filter','parse','some','readFileSync','.json','TDX_ACCESS_TOKEN\x20env\x20var','3359634hFMsNu','read','5IOciDh','next','trim','startsWith','15358952xbVpUD','ap02','keychain\x20(profile:\x20','7258752NRaUWj','14OIoShn','stg-us01','7509976SMNnEr','name','.config','split','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','llm_default_project','join'];a54_0x405e=function(){return _0x269858;};return a54_0x405e();}function cleanupLegacyEnvFile(_0x11fc80){const _0x56e7ac=a54_0x1f7abd;if(!existsSync(_0x11fc80))return![];try{const _0x365555=readFileSync(_0x11fc80,'utf-8'),_0xf0a937=_0x365555[_0x56e7ac(0x14f)]('\x0a'),_0x1a1c48=_0xf0a937[_0x56e7ac(0x13a)](_0x2a6af6=>{const _0xd27ed0=_0x56e7ac,_0x49ac3a=_0x2a6af6[_0xd27ed0(0x144)]();if(!_0x49ac3a||_0x49ac3a[_0xd27ed0(0x145)]('#'))return!![];const [_0x3d3247]=_0x49ac3a['split']('=');return!_0x3d3247[_0xd27ed0(0x145)](_0xd27ed0(0x17d));}),_0x4c5c09=_0x1a1c48[_0x56e7ac(0x13c)](_0x49b9cd=>{const _0x247b6d=_0x49b9cd['trim']();return _0x247b6d&&!_0x247b6d['startsWith']('#');});if(!_0x4c5c09)return unlinkSync(_0x11fc80),!![];return writeFileSync(_0x11fc80,_0x1a1c48[_0x56e7ac(0x152)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x355f3a=a54_0x1f7abd;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0xf1b09f=a54_0xd67e8a['join'](getConfigDir(),_0x355f3a(0x17e));if(!a54_0x2df7ff['existsSync'](_0xf1b09f))return null;try{const _0x1f88da=a54_0x2df7ff[_0x355f3a(0x13d)](_0xf1b09f,'utf-8'),_0x2bc4a1=JSON[_0x355f3a(0x13b)](_0x1f88da);return _0x2bc4a1['profile']||null;}catch{return null;}}export function saveAPIKey(_0x4aa6a5,_0x5017e8,_0x581c6b){const _0x530b0d=a54_0x1f7abd,_0x13b099=getConfigDir(),_0x444992=getConfigFilePath(_0x581c6b);!existsSync(_0x13b099)&&mkdirSync(_0x13b099,{'recursive':!![],'mode':0x1c0});let _0x1b5183={};if(existsSync(_0x444992))try{const _0x3e2081=readFileSync(_0x444992,_0x530b0d(0x15e));_0x1b5183=parseEnvFile(_0x3e2081);}catch(_0x336d1e){console[_0x530b0d(0x164)](_0x530b0d(0x174)+_0x444992+':',_0x336d1e);}const _0x366986=_0x4aa6a5['toUpperCase']()[_0x530b0d(0x157)](/-/g,'_');_0x1b5183[_0x530b0d(0x15f)+_0x366986]=_0x5017e8;const _0x11313b=Object[_0x530b0d(0x159)](_0x1b5183)[_0x530b0d(0x166)](([_0x40ff6a,_0x26b5e7])=>_0x40ff6a+'='+_0x26b5e7);writeFileSync(_0x444992,_0x11313b[_0x530b0d(0x152)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0xfc90b1,_0x43cacd,_0x6ec79d){const _0x229274=a54_0x1f7abd;await saveKeychainAPIKey(_0xfc90b1,_0x6ec79d),setCachedCredential(_0xfc90b1,_0x43cacd,_0x6ec79d);const _0x1a238a=getConfigFilePath(_0x6ec79d);cleanupLegacyEnvFile(_0x1a238a)&&console[_0x229274(0x164)](a54_0x25c200[_0x229274(0x15d)](_0x229274(0x150)));}export function loadConfig(){const _0x3ff6b8=a54_0x1f7abd,_0x2d845f={'apiKeys':{},'defaultSite':_0x3ff6b8(0x176)},_0x734176=['us01','ap01','eu01',_0x3ff6b8(0x147),_0x3ff6b8(0x156),_0x3ff6b8(0x161),_0x3ff6b8(0x167),_0x3ff6b8(0x14b),'stg-ap01',_0x3ff6b8(0x171)],_0x2f4143=getAPIKey();if(_0x2f4143)for(const _0xa606d9 of _0x734176){_0x2d845f[_0x3ff6b8(0x181)][_0xa606d9]=_0x2f4143;}return _0x2d845f;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x5748be=a54_0x1f7abd,_0x366076=a54_0xd67e8a[_0x5748be(0x152)](getConfigDir(),_0x5748be(0x17e));if(!a54_0x2df7ff['existsSync'](_0x366076))return undefined;try{const _0x128773=a54_0x2df7ff[_0x5748be(0x13d)](_0x366076,_0x5748be(0x15e)),_0x3c0f6a=JSON['parse'](_0x128773);return typeof _0x3c0f6a[_0x5748be(0x16c)]==='string'?_0x3c0f6a['proxy']:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x22af39=a54_0x1f7abd,_0x385084=process.env.TDX_RELEASE_CHANNEL;if(_0x385084===_0x22af39(0x143)||_0x385084==='stable')return _0x385084;const _0x2b694c=a54_0xd67e8a['join'](getConfigDir(),_0x22af39(0x17e));if(!a54_0x2df7ff[_0x22af39(0x16e)](_0x2b694c))return _0x22af39(0x15c);try{const _0x1e8aa3=a54_0x2df7ff[_0x22af39(0x13d)](_0x2b694c,'utf-8'),_0x53efcc=JSON['parse'](_0x1e8aa3);if(_0x53efcc['release_channel']===_0x22af39(0x143))return _0x22af39(0x143);}catch{}return'stable';}export function saveReleaseChannel(_0x5a7999){const _0x590468=a54_0x1f7abd,_0x4b7e3d=getConfigDir(),_0xbfd314=a54_0xd67e8a[_0x590468(0x152)](_0x4b7e3d,_0x590468(0x17e));!existsSync(_0x4b7e3d)&&mkdirSync(_0x4b7e3d,{'recursive':!![],'mode':0x1c0});let _0x7b138d={};if(existsSync(_0xbfd314))try{const _0x1d4878=readFileSync(_0xbfd314,_0x590468(0x15e));_0x7b138d=JSON[_0x590468(0x13b)](_0x1d4878);}catch{}_0x7b138d[_0x590468(0x138)]=_0x5a7999,writeFileSync(_0xbfd314,JSON[_0x590468(0x177)](_0x7b138d,null,0x2),{'mode':0x180});}
1
+ function a54_0x8923(_0x444b6a,_0x263b34){_0x444b6a=_0x444b6a-0x1b8;const _0x505f45=a54_0x505f();let _0x89239b=_0x505f45[_0x444b6a];return _0x89239b;}const a54_0x2f07fa=a54_0x8923;(function(_0x1fd6d6,_0x5037e2){const _0x520674=a54_0x8923,_0x4ebc22=_0x1fd6d6();while(!![]){try{const _0x1ede04=parseInt(_0x520674(0x1ff))/0x1*(parseInt(_0x520674(0x1c9))/0x2)+parseInt(_0x520674(0x1e8))/0x3+parseInt(_0x520674(0x1c6))/0x4+-parseInt(_0x520674(0x1c0))/0x5+parseInt(_0x520674(0x1ef))/0x6*(-parseInt(_0x520674(0x201))/0x7)+parseInt(_0x520674(0x1ea))/0x8*(parseInt(_0x520674(0x1d9))/0x9)+-parseInt(_0x520674(0x1bb))/0xa;if(_0x1ede04===_0x5037e2)break;else _0x4ebc22['push'](_0x4ebc22['shift']());}catch(_0x77c44f){_0x4ebc22['push'](_0x4ebc22['shift']());}}}(a54_0x505f,0x3fb4a));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x4690d2 from'node:fs';import*as a54_0x2f967d from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a54_0x15eca2 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x17b29e=a54_0x8923;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x17b29e(0x1ee),_0x17b29e(0x1fa));}export function getConfigFile(){const _0x138583=a54_0x8923;return join(getConfigDir(),_0x138583(0x1e1));}export function getConfigFilePath(_0x3862a3){const _0x309d7d=a54_0x8923,_0xfe7bc9=getConfigDir();return _0x3862a3?a54_0x2f967d[_0x309d7d(0x1e6)](_0xfe7bc9,'.env.'+_0x3862a3):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x2f07fa(0x1c1),'config/llm-project');export function getLLMProjectCacheFile(_0x25f8f2){const _0x32da0d=a54_0x2f07fa;return llmProjectCache[_0x32da0d(0x1be)](_0x25f8f2);}export function readCachedLLMProject(_0x357f6e){const _0x19d75a=a54_0x2f07fa,_0x2ab5ec=llmProjectCache['read'](_0x357f6e);if(_0x2ab5ec&&typeof _0x2ab5ec['id']===_0x19d75a(0x1d0)&&typeof _0x2ab5ec[_0x19d75a(0x1bd)]===_0x19d75a(0x1d0))return _0x2ab5ec;return null;}export function writeCachedLLMProject(_0x4203e7,_0x4bec0d,_0x150bf3){const _0x28291a=a54_0x2f07fa;try{llmProjectCache[_0x28291a(0x1fc)]({'name':_0x4203e7,'id':_0x4bec0d},_0x150bf3);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x2f07fa(0x1cb),a54_0x2f07fa(0x1ba));export function getLLMAgentCacheFile(_0x4ab1ee){const _0x4bb1da=a54_0x2f07fa;return llmAgentCache[_0x4bb1da(0x1be)](_0x4ab1ee);}export function readCachedLLMAgent(_0x966be0){const _0xb01905=a54_0x2f07fa,_0xdc24a6=llmAgentCache[_0xb01905(0x1c2)](_0x966be0);if(_0xdc24a6&&typeof _0xdc24a6['id']===_0xb01905(0x1d0)&&typeof _0xdc24a6[_0xb01905(0x1bd)]==='string'&&typeof _0xdc24a6[_0xb01905(0x1da)]===_0xb01905(0x1d0))return _0xdc24a6;return null;}export function writeCachedLLMAgent(_0x4941ec,_0x409a75,_0x45d290,_0x119b2e){const _0x1617c2=a54_0x2f07fa;try{llmAgentCache[_0x1617c2(0x1fc)]({'name':_0x4941ec,'id':_0x409a75,'projectId':_0x45d290},_0x119b2e);}catch{}}export function clearCachedLLMAgent(_0x1b70eb){try{llmAgentCache['clear'](_0x1b70eb);}catch{}}const accountInfoCache=createOptionalProfileCache('account_info',a54_0x2f07fa(0x1f9),{'suffix':a54_0x2f07fa(0x1f0)});export function getAccountInfoCacheFile(_0xae649){const _0x56194d=a54_0x2f07fa;return accountInfoCache[_0x56194d(0x1be)](_0xae649);}export function readCachedAccountInfo(_0x6e1b4c){const _0xcb63ab=a54_0x2f07fa,_0x2ac4fb=accountInfoCache[_0xcb63ab(0x1c2)](_0x6e1b4c);if(_0x2ac4fb&&typeof _0x2ac4fb[_0xcb63ab(0x1cd)]===_0xcb63ab(0x1d0)&&typeof _0x2ac4fb['accountId']===_0xcb63ab(0x1f7))return _0x2ac4fb;return null;}export function writeCachedAccountInfo(_0x8af8d1,_0x2938f6,_0x2487af){const _0xd59ff7=a54_0x2f07fa;try{accountInfoCache[_0xd59ff7(0x1fc)]({'site':_0x8af8d1,'accountId':_0x2938f6,'cachedAt':new Date()[_0xd59ff7(0x1d8)]()},_0x2487af);}catch{}}export function parseEnvFile(_0x2cf531){const _0x2841e9=a54_0x2f07fa,_0x122a05={};for(const _0xc7c381 of _0x2cf531['split']('\x0a')){const _0x1e5fa1=_0xc7c381[_0x2841e9(0x1f5)]();if(!_0x1e5fa1||_0x1e5fa1['startsWith']('#'))continue;const _0x3bc85c=_0x1e5fa1[_0x2841e9(0x1f2)](/^([^=]+)=(.*)$/);if(_0x3bc85c){const _0x16afac=_0x3bc85c[0x1][_0x2841e9(0x1f5)]();let _0x153519=_0x3bc85c[0x2]['trim']();(_0x153519[_0x2841e9(0x1bf)]('\x22')&&_0x153519[_0x2841e9(0x1c7)]('\x22')||_0x153519[_0x2841e9(0x1bf)]('\x27')&&_0x153519[_0x2841e9(0x1c7)]('\x27'))&&(_0x153519=_0x153519[_0x2841e9(0x1f8)](0x1,-0x1)),_0x122a05[_0x16afac]=_0x153519;}}return _0x122a05;}export function readUserConfig(){const _0x2f70bd=a54_0x2f07fa,_0x5d7a7d=getConfigFile();if(!existsSync(_0x5d7a7d))return{};try{const _0x141768=readFileSync(_0x5d7a7d,'utf-8');return parseEnvFile(_0x141768);}catch(_0x5be1c4){return console[_0x2f70bd(0x1f1)](_0x2f70bd(0x1cc)+_0x5d7a7d+':',_0x5be1c4),{};}}export function resolveSite(_0x406ce1){const _0x5de0a6=a54_0x2f07fa,_0x205f41=[_0x5de0a6(0x1ec),'ap01','eu01',_0x5de0a6(0x1de),'ap03',_0x5de0a6(0x1db),'dev-eu01',_0x5de0a6(0x1d5),'stg-ap01',_0x5de0a6(0x1cf)];if(_0x205f41[_0x5de0a6(0x1e5)](_0x406ce1))return _0x406ce1;if(_0x406ce1 in SITE_ALIASES)return SITE_ALIASES[_0x406ce1];return console[_0x5de0a6(0x1f1)]('Warning:\x20Unknown\x20site\x20\x27'+_0x406ce1+_0x5de0a6(0x1c4)),_0x5de0a6(0x1ec);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0xcb4d78){const _0x21c927=a54_0x2f07fa,_0x1cf482=_0xcb4d78||getActiveProfileName()||undefined;if(_0x1cf482){const _0x2b41dc=_0x21c927(0x1e2)+normalizeProfileForEnvVar(_0x1cf482);if(process.env[_0x2b41dc])return{'accessToken':process.env[_0x2b41dc],'source':_0x2b41dc+_0x21c927(0x1fb)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':'TDX_ACCESS_TOKEN\x20env\x20var'};return null;}export function getAccessToken(_0x5d88af){const _0x4bdb37=a54_0x2f07fa;return resolveAccessToken(_0x5d88af)?.[_0x4bdb37(0x1ca)];}export function getAPIKey(_0x11acd6){const _0x285894=a54_0x2f07fa,_0x1da43e=_0x11acd6||getActiveProfileName();if(_0x1da43e){const _0x22b5f8=_0x285894(0x1ce)+normalizeProfileForEnvVar(_0x1da43e);if(process.env[_0x22b5f8])return process.env[_0x22b5f8];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x8789){const _0x304a8e=a54_0x2f07fa;return _0x8789[_0x304a8e(0x1bc)]()[_0x304a8e(0x1d3)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0xc544fb,_0x58da65){const _0x190d73=a54_0x2f07fa,_0x40b9b6=resolveAccessToken(_0x58da65);if(_0x40b9b6)return{'apiKey':_0x40b9b6['accessToken'],'source':_0x40b9b6[_0x190d73(0x1b8)],'isDeprecated':![]};const _0x1c360b=_0x58da65||getActiveProfileName()||undefined;if(_0x1c360b){const _0x16e95e=_0x190d73(0x1ce)+normalizeProfileForEnvVar(_0x1c360b);if(process.env[_0x16e95e])return{'apiKey':process.env[_0x16e95e],'source':_0x16e95e+_0x190d73(0x1fb),'isDeprecated':![]};const _0x488161=getCachedCredential(_0xc544fb,_0x1c360b);if(_0x488161)return{'apiKey':_0x488161,'source':_0x190d73(0x1d1)+_0x1c360b+')','isDeprecated':![]};const _0x19473e=await getKeychainAPIKey(_0x1c360b);if(_0x19473e)return setCachedCredential(_0x19473e,_0xc544fb,_0x1c360b),{'apiKey':_0x19473e,'source':'keychain\x20(profile:\x20'+_0x1c360b+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x190d73(0x1e0),'isDeprecated':![]};if(!_0x1c360b){const _0x2e911a=getCachedCredential(_0xc544fb,undefined);if(_0x2e911a)return{'apiKey':_0x2e911a,'source':_0x190d73(0x1f6),'isDeprecated':![]};const _0x4093de=await getKeychainAPIKey(undefined);if(_0x4093de)return setCachedCredential(_0x4093de,_0xc544fb,undefined),{'apiKey':_0x4093de,'source':_0x190d73(0x1f6),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x46defd,_0x47c7e8){const _0x533655=a54_0x2f07fa,_0x31b1c7=await resolveAPIKeyAsync(_0x46defd,_0x47c7e8);return _0x31b1c7?.[_0x533655(0x1fe)];}function cleanupLegacyEnvFile(_0x3d96f9){const _0x263e8b=a54_0x2f07fa;if(!existsSync(_0x3d96f9))return![];try{const _0x29c82d=readFileSync(_0x3d96f9,'utf-8'),_0x72a69c=_0x29c82d[_0x263e8b(0x1df)]('\x0a'),_0x513668=_0x72a69c[_0x263e8b(0x1dd)](_0xd8496c=>{const _0x3635e1=_0x263e8b,_0x157c97=_0xd8496c[_0x3635e1(0x1f5)]();if(!_0x157c97||_0x157c97['startsWith']('#'))return!![];const [_0x450fe8]=_0x157c97[_0x3635e1(0x1df)]('=');return!_0x450fe8[_0x3635e1(0x1bf)](_0x3635e1(0x1c8));}),_0x227945=_0x513668[_0x263e8b(0x1c5)](_0x340e42=>{const _0x1ff9b6=_0x263e8b,_0x4c0c4c=_0x340e42['trim']();return _0x4c0c4c&&!_0x4c0c4c[_0x1ff9b6(0x1bf)]('#');});if(!_0x227945)return unlinkSync(_0x3d96f9),!![];return writeFileSync(_0x3d96f9,_0x513668[_0x263e8b(0x1e6)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x36c1de=a54_0x2f07fa;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x3164e6=a54_0x2f967d[_0x36c1de(0x1e6)](getConfigDir(),'tdx.json');if(!a54_0x4690d2[_0x36c1de(0x1e3)](_0x3164e6))return null;try{const _0x226764=a54_0x4690d2[_0x36c1de(0x202)](_0x3164e6,_0x36c1de(0x1e7)),_0x4db511=JSON[_0x36c1de(0x203)](_0x226764);return _0x4db511[_0x36c1de(0x1b9)]||null;}catch{return null;}}export function saveAPIKey(_0x313f57,_0x50f1c7,_0x27f291){const _0x3cdebf=a54_0x2f07fa,_0x3b8e90=getConfigDir(),_0x12f05f=getConfigFilePath(_0x27f291);!existsSync(_0x3b8e90)&&mkdirSync(_0x3b8e90,{'recursive':!![],'mode':0x1c0});let _0x5ee341={};if(existsSync(_0x12f05f))try{const _0x3a19d2=readFileSync(_0x12f05f,_0x3cdebf(0x1e7));_0x5ee341=parseEnvFile(_0x3a19d2);}catch(_0x4f4ad1){console['warn'](_0x3cdebf(0x1c3)+_0x12f05f+':',_0x4f4ad1);}const _0x542885=_0x313f57[_0x3cdebf(0x1bc)]()[_0x3cdebf(0x1d3)](/-/g,'_');_0x5ee341[_0x3cdebf(0x1d6)+_0x542885]=_0x50f1c7;const _0x421cc1=Object['entries'](_0x5ee341)[_0x3cdebf(0x1e9)](([_0x24c1a0,_0x5cf963])=>_0x24c1a0+'='+_0x5cf963);writeFileSync(_0x12f05f,_0x421cc1[_0x3cdebf(0x1e6)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x7ae8d6,_0x1fb859,_0x278469){const _0x46392f=a54_0x2f07fa;await saveKeychainAPIKey(_0x7ae8d6,_0x278469),setCachedCredential(_0x7ae8d6,_0x1fb859,_0x278469);const _0x925bf6=getConfigFilePath(_0x278469);cleanupLegacyEnvFile(_0x925bf6)&&console['warn'](a54_0x15eca2['yellow'](_0x46392f(0x200)));}export function loadConfig(){const _0x3fb294=a54_0x2f07fa,_0x23bf3f={'apiKeys':{},'defaultSite':'us01'},_0x10a9c5=[_0x3fb294(0x1ec),_0x3fb294(0x1fd),_0x3fb294(0x1d2),'ap02',_0x3fb294(0x1e4),_0x3fb294(0x1db),_0x3fb294(0x1f3),_0x3fb294(0x1d5),_0x3fb294(0x1dc),_0x3fb294(0x1cf)],_0x37aa00=getAPIKey();if(_0x37aa00)for(const _0x4959c1 of _0x10a9c5){_0x23bf3f['apiKeys'][_0x4959c1]=_0x37aa00;}return _0x23bf3f;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x51e4f1=a54_0x2f07fa,_0x25ed6f=a54_0x2f967d['join'](getConfigDir(),_0x51e4f1(0x1eb));if(!a54_0x4690d2[_0x51e4f1(0x1e3)](_0x25ed6f))return undefined;try{const _0x5e4df8=a54_0x4690d2['readFileSync'](_0x25ed6f,'utf-8'),_0xd3d6a8=JSON[_0x51e4f1(0x203)](_0x5e4df8);return typeof _0xd3d6a8['proxy']===_0x51e4f1(0x1d0)?_0xd3d6a8['proxy']:undefined;}catch{return undefined;}}function a54_0x505f(){const _0x1fe1d4=['name','path','startsWith','795055THTfbF','llm_default_project','read','Warning:\x20Failed\x20to\x20read\x20','\x27,\x20defaulting\x20to\x20us01','some','373844qYWLXv','endsWith','TD_API_KEY','48510agmVZb','accessToken','llm_default_agent','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','site','TDX_API_KEY_','stg-ap03','string','keychain\x20(profile:\x20','eu01','replace','release_channel','stg-us01','TD_API_KEY_','stable','toISOString','9GUKEGv','projectId','dev-us01','stg-ap01','filter','ap02','split','TDX_API_KEY\x20env\x20var','.env','TDX_ACCESS_TOKEN_','existsSync','ap03','includes','join','utf-8','1524774BJDPAz','map','1729128nwwgtD','tdx.json','us01','next','.config','846hIutXx','.json','warn','match','dev-eu01','stringify','trim','keychain','number','slice','config/account-info','tdx','\x20env\x20var','write','ap01','apiKey','3qZvwdZ','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','8505UJtlGq','readFileSync','parse','source','profile','config/llm-agent','2993610LtZCfe','toUpperCase'];a54_0x505f=function(){return _0x1fe1d4;};return a54_0x505f();}export function loadReleaseChannel(){const _0xf6ed29=a54_0x2f07fa,_0x5ac561=process.env.TDX_RELEASE_CHANNEL;if(_0x5ac561==='next'||_0x5ac561==='stable')return _0x5ac561;const _0x4399ae=a54_0x2f967d['join'](getConfigDir(),_0xf6ed29(0x1eb));if(!a54_0x4690d2['existsSync'](_0x4399ae))return'stable';try{const _0x555dea=a54_0x4690d2[_0xf6ed29(0x202)](_0x4399ae,_0xf6ed29(0x1e7)),_0x4540ab=JSON['parse'](_0x555dea);if(_0x4540ab['release_channel']===_0xf6ed29(0x1ed))return _0xf6ed29(0x1ed);}catch{}return _0xf6ed29(0x1d7);}export function saveReleaseChannel(_0x153a56){const _0x39519f=a54_0x2f07fa,_0x4f91ba=getConfigDir(),_0x34354a=a54_0x2f967d[_0x39519f(0x1e6)](_0x4f91ba,_0x39519f(0x1eb));!existsSync(_0x4f91ba)&&mkdirSync(_0x4f91ba,{'recursive':!![],'mode':0x1c0});let _0x555608={};if(existsSync(_0x34354a))try{const _0x255ecc=readFileSync(_0x34354a,_0x39519f(0x1e7));_0x555608=JSON[_0x39519f(0x203)](_0x255ecc);}catch{}_0x555608[_0x39519f(0x1d4)]=_0x153a56,writeFileSync(_0x34354a,JSON[_0x39519f(0x1f4)](_0x555608,null,0x2),{'mode':0x180});}
@@ -1 +1 @@
1
- const a55_0xe06ad7=a55_0x14c5;function a55_0x14c5(_0x35804d,_0xa23d11){_0x35804d=_0x35804d-0xb9;const _0x1260bc=a55_0x1260();let _0x14c506=_0x1260bc[_0x35804d];return _0x14c506;}(function(_0x411b12,_0x4d5c29){const _0x226fff=a55_0x14c5,_0x420a97=_0x411b12();while(!![]){try{const _0xd603c=parseInt(_0x226fff(0xb9))/0x1+parseInt(_0x226fff(0xc2))/0x2*(-parseInt(_0x226fff(0xc1))/0x3)+parseInt(_0x226fff(0xbb))/0x4+parseInt(_0x226fff(0xc0))/0x5+-parseInt(_0x226fff(0xbe))/0x6*(parseInt(_0x226fff(0xbf))/0x7)+parseInt(_0x226fff(0xbd))/0x8+-parseInt(_0x226fff(0xc5))/0x9;if(_0xd603c===_0x4d5c29)break;else _0x420a97['push'](_0x420a97['shift']());}catch(_0x15f6ff){_0x420a97['push'](_0x420a97['shift']());}}}(a55_0x1260,0x18a8c));import{createProfileCache}from'../utils/global-cache.js';function a55_0x1260(){const _0x692aa7=['606245PqNixt','214497iPBmJQ','2dstVzr','core/connection-cache','connections-{profile}.json','973467usUdDu','connections','167172byPtqm','write','69292JSkwKY','read','158832oyYuXM','24OHoRJf','78631FNdocP'];a55_0x1260=function(){return _0x692aa7;};return a55_0x1260();}const connectionCache=createProfileCache(a55_0xe06ad7(0xc4),a55_0xe06ad7(0xc3));export function loadCachedConnections(_0x4c2b6a){const _0x2d38ab=a55_0xe06ad7,_0x5d337e=connectionCache[_0x2d38ab(0xbc)](_0x4c2b6a);return _0x5d337e?.[_0x2d38ab(0xc6)]??null;}export function saveCachedConnections(_0x39031a,_0x385f31){const _0x195c88=a55_0xe06ad7;connectionCache[_0x195c88(0xba)](_0x39031a,{'connections':_0x385f31,'cachedAt':Date['now']()});}export function clearConnectionCache(_0x22f15a){connectionCache['clear'](_0x22f15a);}
1
+ function a55_0x1ab8(){const _0x4ea404=['write','3497864HUJmRp','connections-{profile}.json','6814950KYTBod','connections','5325523hVGAmV','6MaZeyv','read','26767116MVnpHG','572701SxNWDh','2642106ntJgPN','2hmtTRN','5139728NzzhUO'];a55_0x1ab8=function(){return _0x4ea404;};return a55_0x1ab8();}function a55_0x4160(_0x253a96,_0x4a273d){_0x253a96=_0x253a96-0x169;const _0x1ab84a=a55_0x1ab8();let _0x4160d2=_0x1ab84a[_0x253a96];return _0x4160d2;}const a55_0x1e9085=a55_0x4160;(function(_0x35a11e,_0x42f806){const _0x24f8ac=a55_0x4160,_0xb35f2a=_0x35a11e();while(!![]){try{const _0x2b1c25=-parseInt(_0x24f8ac(0x169))/0x1*(parseInt(_0x24f8ac(0x16b))/0x2)+-parseInt(_0x24f8ac(0x16a))/0x3+-parseInt(_0x24f8ac(0x16e))/0x4+-parseInt(_0x24f8ac(0x170))/0x5+-parseInt(_0x24f8ac(0x173))/0x6*(-parseInt(_0x24f8ac(0x172))/0x7)+parseInt(_0x24f8ac(0x16c))/0x8+parseInt(_0x24f8ac(0x175))/0x9;if(_0x2b1c25===_0x42f806)break;else _0xb35f2a['push'](_0xb35f2a['shift']());}catch(_0x15934f){_0xb35f2a['push'](_0xb35f2a['shift']());}}}(a55_0x1ab8,0xa79b8));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a55_0x1e9085(0x16f),'core/connection-cache');export function loadCachedConnections(_0x48e544){const _0x59251d=a55_0x1e9085,_0x5cc36f=connectionCache[_0x59251d(0x174)](_0x48e544);return _0x5cc36f?.[_0x59251d(0x171)]??null;}export function saveCachedConnections(_0x5d75ed,_0x543709){const _0x2840ff=a55_0x1e9085;connectionCache[_0x2840ff(0x16d)](_0x5d75ed,{'connections':_0x543709,'cachedAt':Date['now']()});}export function clearConnectionCache(_0xc09a38){connectionCache['clear'](_0xc09a38);}
@@ -1 +1 @@
1
- const a56_0xc19617=a56_0x9215;(function(_0x3d3aab,_0x13d60a){const _0x28e16a=a56_0x9215,_0x2e219a=_0x3d3aab();while(!![]){try{const _0x3a72e3=parseInt(_0x28e16a(0x165))/0x1+parseInt(_0x28e16a(0x166))/0x2*(parseInt(_0x28e16a(0x15f))/0x3)+parseInt(_0x28e16a(0x170))/0x4*(-parseInt(_0x28e16a(0x179))/0x5)+-parseInt(_0x28e16a(0x161))/0x6*(parseInt(_0x28e16a(0x177))/0x7)+-parseInt(_0x28e16a(0x174))/0x8+parseInt(_0x28e16a(0x169))/0x9*(parseInt(_0x28e16a(0x162))/0xa)+parseInt(_0x28e16a(0x16f))/0xb;if(_0x3a72e3===_0x13d60a)break;else _0x2e219a['push'](_0x2e219a['shift']());}catch(_0x3f622d){_0x2e219a['push'](_0x2e219a['shift']());}}}(a56_0x2c73,0xe2341));function a56_0x9215(_0x522e8b,_0xb5af79){_0x522e8b=_0x522e8b-0x15a;const _0x2c7378=a56_0x2c73();let _0x921584=_0x2c7378[_0x522e8b];return _0x921584;}import a56_0x1b839a from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a56_0x2c73(){const _0x4dfc71=['log','ap02','7741168BfROlf','ap02\x20-\x20Korea','select','161qFIWyD','Enter\x20custom\x20site','29035eOsjlB','value','length','trim','text','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','test','push','eu\x20\x20\x20-\x20Europe','4071AYmNTm','Select\x20your\x20Treasure\x20Data\x20site:','23280xOfrIe','468670ylYyvd','jp\x20\x20\x20-\x20Japan','us01','399119AagmCy','2504oDQmPh','other','eu01','243VpDXgN','site','us\x20\x20\x20-\x20United\x20States','customSite','Cancelled','ap01','2002066jMnNWP','1076wYDAcS','Site\x20name\x20cannot\x20be\x20empty'];a56_0x2c73=function(){return _0x4dfc71;};return a56_0x2c73();}export function resolveLimit(_0x479dc0,_0x13739d){if(_0x479dc0===undefined)return _0x13739d;if(typeof _0x479dc0==='number')return _0x479dc0;return parseInt(_0x479dc0,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a56_0xc19617(0x16b),'value':a56_0xc19617(0x164)},{'title':a56_0xc19617(0x163),'value':a56_0xc19617(0x16e)},{'title':a56_0xc19617(0x15e),'value':a56_0xc19617(0x168)},{'title':a56_0xc19617(0x175),'value':a56_0xc19617(0x173)}];export function buildSiteChoices(_0x1ee7ef){const _0x10598c=a56_0xc19617,_0x3f1b10=[...STANDARD_SITE_CHOICES];let _0x194c39=_0x3f1b10['findIndex'](_0x3708c5=>_0x3708c5[_0x10598c(0x17a)]===_0x1ee7ef);return _0x194c39===-0x1&&_0x1ee7ef!==_0x10598c(0x164)&&(_0x3f1b10[_0x10598c(0x15d)]({'title':_0x1ee7ef,'value':_0x1ee7ef}),_0x194c39=_0x3f1b10[_0x10598c(0x17b)]-0x1),_0x3f1b10[_0x10598c(0x15d)]({'title':_0x10598c(0x178),'value':'other'}),{'choices':_0x3f1b10,'initialIndex':_0x194c39>=0x0?_0x194c39:0x0};}export async function promptSiteSelection(_0x503888,_0xa1c990,_0xe6918a=a56_0xc19617(0x16d)){const _0x1f8804=a56_0xc19617,{choices:_0x16f3ab,initialIndex:_0x5a6ad5}=buildSiteChoices(_0x503888),_0x34eb50=_0xa1c990?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0xa1c990+'):':_0x1f8804(0x160),_0x5edb70=await a56_0x1b839a({'type':_0x1f8804(0x176),'name':_0x1f8804(0x16a),'message':_0x34eb50,'choices':_0x16f3ab,'initial':_0x5a6ad5});if(!_0x5edb70[_0x1f8804(0x16a)])return console[_0x1f8804(0x172)]('\x0a'+_0xe6918a),null;if(_0x5edb70[_0x1f8804(0x16a)]!==_0x1f8804(0x167))return _0x5edb70[_0x1f8804(0x16a)];const _0x2fe72f=await a56_0x1b839a({'type':_0x1f8804(0x15a),'name':_0x1f8804(0x16c),'message':'Enter\x20site\x20name:','initial':_0x1f8804(0x164),'validate':_0x3a0b2b=>{const _0x4de2b1=_0x1f8804;if(!_0x3a0b2b||!_0x3a0b2b[_0x4de2b1(0x17c)]())return _0x4de2b1(0x171);if(!/^[a-z0-9-]+$/[_0x4de2b1(0x15c)](_0x3a0b2b[_0x4de2b1(0x17c)]()))return _0x4de2b1(0x15b);return!![];}});if(!_0x2fe72f['customSite'])return console['log']('\x0a'+_0xe6918a),null;return _0x2fe72f[_0x1f8804(0x16c)];}
1
+ function a56_0x8dac(_0x1da760,_0x39818b){_0x1da760=_0x1da760-0x172;const _0x27a45e=a56_0x27a4();let _0x8dacf2=_0x27a45e[_0x1da760];return _0x8dacf2;}const a56_0x14c94b=a56_0x8dac;(function(_0x2cb069,_0x1da8a4){const _0x11ef35=a56_0x8dac,_0x2a19b1=_0x2cb069();while(!![]){try{const _0x5f0fc4=-parseInt(_0x11ef35(0x189))/0x1*(-parseInt(_0x11ef35(0x179))/0x2)+-parseInt(_0x11ef35(0x183))/0x3*(parseInt(_0x11ef35(0x18c))/0x4)+-parseInt(_0x11ef35(0x193))/0x5+parseInt(_0x11ef35(0x17d))/0x6*(parseInt(_0x11ef35(0x18b))/0x7)+parseInt(_0x11ef35(0x175))/0x8*(parseInt(_0x11ef35(0x17e))/0x9)+-parseInt(_0x11ef35(0x176))/0xa*(parseInt(_0x11ef35(0x173))/0xb)+-parseInt(_0x11ef35(0x182))/0xc;if(_0x5f0fc4===_0x1da8a4)break;else _0x2a19b1['push'](_0x2a19b1['shift']());}catch(_0xbcfe72){_0x2a19b1['push'](_0x2a19b1['shift']());}}}(a56_0x27a4,0xd7017));import a56_0x421c23 from'prompts';function a56_0x27a4(){const _0x80377b=['us01','number','select','36ctTUQf','18CChyWn','customSite','site','ap02','4131780RFaoXm','492537nbMyDW','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','trim','Select\x20your\x20Treasure\x20Data\x20site:','log','Site\x20name\x20cannot\x20be\x20empty','44127XIZtUF','Cancelled','577843TBpwsj','8Dipbvi','jp\x20\x20\x20-\x20Japan','push','Enter\x20custom\x20site','value','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','findIndex','379705lcSTUW','other','length','341uUrddj','eu\x20\x20\x20-\x20Europe','4708072VSqzoP','227400fDxuXy','ap01','us\x20\x20\x20-\x20United\x20States','30yWVoRK'];a56_0x27a4=function(){return _0x80377b;};return a56_0x27a4();}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x23ebd5,_0x23370a){const _0x397caa=a56_0x8dac;if(_0x23ebd5===undefined)return _0x23370a;if(typeof _0x23ebd5===_0x397caa(0x17b))return _0x23ebd5;return parseInt(_0x23ebd5,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a56_0x14c94b(0x178),'value':'us01'},{'title':a56_0x14c94b(0x18d),'value':a56_0x14c94b(0x177)},{'title':a56_0x14c94b(0x174),'value':'eu01'},{'title':'ap02\x20-\x20Korea','value':a56_0x14c94b(0x181)}];export function buildSiteChoices(_0x4d6722){const _0x4ba7e4=a56_0x14c94b,_0x2fc07c=[...STANDARD_SITE_CHOICES];let _0x520cc6=_0x2fc07c[_0x4ba7e4(0x192)](_0x4c68a7=>_0x4c68a7[_0x4ba7e4(0x190)]===_0x4d6722);return _0x520cc6===-0x1&&_0x4d6722!==_0x4ba7e4(0x17a)&&(_0x2fc07c[_0x4ba7e4(0x18e)]({'title':_0x4d6722,'value':_0x4d6722}),_0x520cc6=_0x2fc07c[_0x4ba7e4(0x172)]-0x1),_0x2fc07c[_0x4ba7e4(0x18e)]({'title':_0x4ba7e4(0x18f),'value':'other'}),{'choices':_0x2fc07c,'initialIndex':_0x520cc6>=0x0?_0x520cc6:0x0};}export async function promptSiteSelection(_0x42daf6,_0x1e76c8,_0x4f9f6e=a56_0x14c94b(0x18a)){const _0x347e90=a56_0x14c94b,{choices:_0x55002b,initialIndex:_0x173249}=buildSiteChoices(_0x42daf6),_0x4ac74e=_0x1e76c8?_0x347e90(0x184)+_0x1e76c8+'):':_0x347e90(0x186),_0x1cd6fb=await a56_0x421c23({'type':_0x347e90(0x17c),'name':_0x347e90(0x180),'message':_0x4ac74e,'choices':_0x55002b,'initial':_0x173249});if(!_0x1cd6fb[_0x347e90(0x180)])return console[_0x347e90(0x187)]('\x0a'+_0x4f9f6e),null;if(_0x1cd6fb[_0x347e90(0x180)]!==_0x347e90(0x194))return _0x1cd6fb['site'];const _0x362849=await a56_0x421c23({'type':'text','name':_0x347e90(0x17f),'message':'Enter\x20site\x20name:','initial':_0x347e90(0x17a),'validate':_0x4f7b9=>{const _0x42f325=_0x347e90;if(!_0x4f7b9||!_0x4f7b9[_0x42f325(0x185)]())return _0x42f325(0x188);if(!/^[a-z0-9-]+$/['test'](_0x4f7b9[_0x42f325(0x185)]()))return _0x42f325(0x191);return!![];}});if(!_0x362849['customSite'])return console[_0x347e90(0x187)]('\x0a'+_0x4f9f6e),null;return _0x362849['customSite'];}
@@ -1 +1 @@
1
- (function(_0xe84777,_0x261fc5){const _0xc177a=a57_0x1c69,_0x52ef43=_0xe84777();while(!![]){try{const _0x4726fd=parseInt(_0xc177a(0x1f4))/0x1*(-parseInt(_0xc177a(0x1e7))/0x2)+-parseInt(_0xc177a(0x1ea))/0x3*(-parseInt(_0xc177a(0x1f5))/0x4)+-parseInt(_0xc177a(0x1f6))/0x5*(-parseInt(_0xc177a(0x1f1))/0x6)+-parseInt(_0xc177a(0x1e8))/0x7*(-parseInt(_0xc177a(0x1f0))/0x8)+parseInt(_0xc177a(0x1e6))/0x9*(parseInt(_0xc177a(0x1eb))/0xa)+parseInt(_0xc177a(0x1e5))/0xb*(-parseInt(_0xc177a(0x1ed))/0xc)+-parseInt(_0xc177a(0x1f8))/0xd;if(_0x4726fd===_0x261fc5)break;else _0x52ef43['push'](_0x52ef43['shift']());}catch(_0x3ce6da){_0x52ef43['push'](_0x52ef43['shift']());}}}(a57_0x1bf8,0x2da31));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a57_0x1c69(_0xf34b95,_0x36bb96){_0xf34b95=_0xf34b95-0x1e5;const _0x1bf873=a57_0x1bf8();let _0x1c6947=_0x1bf873[_0xf34b95];return _0x1c6947;}function getCacheKey(_0x346de7,_0x5d8c26){const _0x30bba0=a57_0x1c69,_0x31fab9=_0x346de7||_0x30bba0(0x1f3),_0x59c07e=_0x5d8c26||_0x30bba0(0x1f7);return _0x31fab9+':'+_0x59c07e;}export function getCachedCredential(_0x28dd13,_0x47543d){const _0x4bdea5=a57_0x1c69,_0x28eeaf=getCacheKey(_0x28dd13,_0x47543d),_0x472948=cache['get'](_0x28eeaf);if(!_0x472948)return null;if(Date[_0x4bdea5(0x1e9)]()-_0x472948[_0x4bdea5(0x1ec)]>CACHE_TTL_MS)return cache[_0x4bdea5(0x1ee)](_0x28eeaf),null;return _0x472948[_0x4bdea5(0x1ef)];}export function setCachedCredential(_0x54258d,_0xa50da2,_0x301483){const _0x3d2a3b=a57_0x1c69,_0x1da95e=getCacheKey(_0xa50da2,_0x301483);cache[_0x3d2a3b(0x1f2)](_0x1da95e,{'apiKey':_0x54258d,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x328a19=a57_0x1c69;cache[_0x328a19(0x1f9)]();}export function clearCachedCredential(_0x195237,_0x32c7bc){const _0x36cc66=a57_0x1c69,_0x5b623d=getCacheKey(_0x195237,_0x32c7bc);cache[_0x36cc66(0x1ee)](_0x5b623d);}function a57_0x1bf8(){const _0x3e8476=['11qWPnog','477BndaTS','2WXylzv','511FKkFKE','now','87FflJEK','50640GkGVKO','loadedAt','3712836FJkBMZ','delete','apiKey','32888EIvuby','1113594UMByye','set','__default_site__','154006KZXFxw','18572dkufiO','5CkxtnL','__default_profile__','3099239bqUHrM','clear'];a57_0x1bf8=function(){return _0x3e8476;};return a57_0x1bf8();}
1
+ (function(_0x265e01,_0x52a8c1){const _0x1d868f=a57_0x5cc2,_0x3ae49c=_0x265e01();while(!![]){try{const _0x5afdfe=parseInt(_0x1d868f(0x100))/0x1*(-parseInt(_0x1d868f(0xff))/0x2)+-parseInt(_0x1d868f(0xf8))/0x3+parseInt(_0x1d868f(0xfb))/0x4+-parseInt(_0x1d868f(0xfa))/0x5+-parseInt(_0x1d868f(0x102))/0x6*(-parseInt(_0x1d868f(0x104))/0x7)+-parseInt(_0x1d868f(0xfe))/0x8+parseInt(_0x1d868f(0x103))/0x9;if(_0x5afdfe===_0x52a8c1)break;else _0x3ae49c['push'](_0x3ae49c['shift']());}catch(_0x3dcf52){_0x3ae49c['push'](_0x3ae49c['shift']());}}}(a57_0x3f05,0x5ae96));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a57_0x3f05(){const _0x533ae7=['clear','__default_site__','set','apiKey','1510326wiwSlY','get','1493445FTNkgE','548628zMPoLZ','loadedAt','delete','698384bTwUjP','2esFlcp','39559GiILZB','now','2064258ZpEHRw','4285071NkvtAa','14EiJjTc','__default_profile__'];a57_0x3f05=function(){return _0x533ae7;};return a57_0x3f05();}function a57_0x5cc2(_0x49cc05,_0x5d21b6){_0x49cc05=_0x49cc05-0xf8;const _0x3f053c=a57_0x3f05();let _0x5cc21d=_0x3f053c[_0x49cc05];return _0x5cc21d;}function getCacheKey(_0x4dbe8c,_0x325bfc){const _0x321bc5=a57_0x5cc2,_0x38517e=_0x4dbe8c||_0x321bc5(0x107),_0x17b260=_0x325bfc||_0x321bc5(0x105);return _0x38517e+':'+_0x17b260;}export function getCachedCredential(_0x1a7438,_0x8bab7){const _0x285dc7=a57_0x5cc2,_0x70dac=getCacheKey(_0x1a7438,_0x8bab7),_0x27dd86=cache[_0x285dc7(0xf9)](_0x70dac);if(!_0x27dd86)return null;if(Date[_0x285dc7(0x101)]()-_0x27dd86[_0x285dc7(0xfc)]>CACHE_TTL_MS)return cache['delete'](_0x70dac),null;return _0x27dd86[_0x285dc7(0x109)];}export function setCachedCredential(_0x1ee918,_0x3aec6a,_0x569c57){const _0x4dd38d=a57_0x5cc2,_0x2ed03b=getCacheKey(_0x3aec6a,_0x569c57);cache[_0x4dd38d(0x108)](_0x2ed03b,{'apiKey':_0x1ee918,'loadedAt':Date[_0x4dd38d(0x101)]()});}export function clearCredentialCache(){const _0x2b56aa=a57_0x5cc2;cache[_0x2b56aa(0x106)]();}export function clearCachedCredential(_0x9213ce,_0x4468c7){const _0x1d6d68=a57_0x5cc2,_0x442fb1=getCacheKey(_0x9213ce,_0x4468c7);cache[_0x1d6d68(0xfd)](_0x442fb1);}
@@ -1 +1 @@
1
- const a58_0x26f567=a58_0x104a;(function(_0x6708c7,_0x502804){const _0x3c0beb=a58_0x104a,_0x292450=_0x6708c7();while(!![]){try{const _0x43e68f=parseInt(_0x3c0beb(0x12e))/0x1+-parseInt(_0x3c0beb(0x12d))/0x2+parseInt(_0x3c0beb(0x143))/0x3+parseInt(_0x3c0beb(0x118))/0x4*(-parseInt(_0x3c0beb(0x119))/0x5)+-parseInt(_0x3c0beb(0x103))/0x6*(-parseInt(_0x3c0beb(0x13a))/0x7)+parseInt(_0x3c0beb(0x11c))/0x8*(-parseInt(_0x3c0beb(0x142))/0x9)+parseInt(_0x3c0beb(0x127))/0xa;if(_0x43e68f===_0x502804)break;else _0x292450['push'](_0x292450['shift']());}catch(_0x1bf282){_0x292450['push'](_0x292450['shift']());}}}(a58_0x11b6,0x6dcf1));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a58_0x104a(_0x256ffb,_0x4515e4){_0x256ffb=_0x256ffb-0xfa;const _0x11b6b=a58_0x11b6();let _0x104ae3=_0x11b6b[_0x256ffb];return _0x104ae3;}import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a58_0x5abc2c from'node:fs';import*as a58_0x11fc23 from'node:path';import a58_0x593242 from'chalk';export class GlobalContext{[a58_0x26f567(0x10f)];[a58_0x26f567(0x112)];[a58_0x26f567(0x109)];['segment_path'];[a58_0x26f567(0xfa)];['llm_agent'];[a58_0x26f567(0x147)];[a58_0x26f567(0x11d)];[a58_0x26f567(0x12b)];[a58_0x26f567(0x11b)];[a58_0x26f567(0x128)];[a58_0x26f567(0x146)];[a58_0x26f567(0x141)];[a58_0x26f567(0x101)]=null;['layers'];[a58_0x26f567(0x111)];[a58_0x26f567(0x132)];[a58_0x26f567(0x144)];constructor(_0x49fc24){const _0x50613d=a58_0x26f567;this['sessionId']=getSessionID(_0x49fc24['session']);const _0x5a5e30=loadSessionContext(_0x49fc24[_0x50613d(0x126)]),_0x2e25c3=loadProjectConfig(),_0x7fc4c5=this[_0x50613d(0x13b)]();if(_0x49fc24['profile'])this[_0x50613d(0x111)]=_0x49fc24[_0x50613d(0x141)],this[_0x50613d(0x101)]='cli';else{if(_0x5a5e30?.[_0x50613d(0x141)])this['activeProfile']=_0x5a5e30[_0x50613d(0x141)],this[_0x50613d(0x101)]=_0x50613d(0x126);else{if(_0x7fc4c5[_0x50613d(0x141)])this[_0x50613d(0x111)]=_0x7fc4c5['profile'],this[_0x50613d(0x101)]=_0x50613d(0x116);else process.env.TDX_PROFILE?(this[_0x50613d(0x111)]=process.env.TDX_PROFILE,this[_0x50613d(0x101)]=_0x50613d(0x122)):(this[_0x50613d(0x111)]=null,this['profileSource']=null);}}const _0x26584b=this[_0x50613d(0x111)]?loadProfile(this[_0x50613d(0x111)]):null,_0x321ac6=_0x2cdba6=>{const _0x49a631=_0x50613d;if(!_0x2cdba6)return{};const _0x11b985=_0x2cdba6,_0x5ef409={};for(const [_0x5270fa,_0xb20544]of Object['entries'](_0x11b985)){typeof _0xb20544===_0x49a631(0x12c)&&(_0x5ef409[_0x5270fa]=_0xb20544);}return _0x5ef409;},_0x3d37a5={},_0x531304=(_0x11ad15,_0x382b08,_0xd2f3d8)=>{const _0x1fa743=_0x50613d;if(!_0x11ad15)return![];if(_0xd2f3d8&&_0x11ad15===_0xd2f3d8)return![];const _0x4a97f1=_0x5a5e30,_0x260f94=_0x2e25c3,_0x2a793a=_0x26584b?.[_0x1fa743(0x116)],_0x3edc57=_0x7fc4c5,_0x5e33c6=_0x4a97f1?.[_0x382b08],_0x18bfc9=_0x260f94?.[_0x382b08],_0xf9f10f=_0x2a793a?.[_0x382b08],_0x54da16=_0x3edc57[_0x382b08];return _0x11ad15!==_0x5e33c6&&_0x11ad15!==_0x18bfc9&&_0x11ad15!==_0xf9f10f&&_0x11ad15!==_0x54da16;},_0x225147=[{'optionKey':_0x50613d(0x10f),'contextKey':_0x50613d(0x10f),'defaultValue':_0x50613d(0x138)},{'optionKey':_0x50613d(0x112),'contextKey':_0x50613d(0x112)},{'optionKey':_0x50613d(0xff),'contextKey':_0x50613d(0x109)},{'optionKey':_0x50613d(0xfc),'contextKey':_0x50613d(0xfa)},{'optionKey':_0x50613d(0x104),'contextKey':_0x50613d(0x108)},{'optionKey':_0x50613d(0x141),'contextKey':_0x50613d(0x141)}];for(const {optionKey:_0x4a17a0,contextKey:_0x44c92c,defaultValue:_0x39bd42}of _0x225147){const _0x3d0ee7=_0x49fc24[_0x4a17a0];_0x531304(_0x3d0ee7,_0x44c92c,_0x39bd42)&&(_0x3d37a5[_0x44c92c]=_0x3d0ee7);}this[_0x50613d(0x137)]={'cliFlags':_0x3d37a5,'session':_0x321ac6(_0x5a5e30),'project':_0x321ac6(_0x2e25c3),'profile':_0x321ac6(_0x26584b?.[_0x50613d(0x116)]),'global':_0x321ac6(_0x7fc4c5)};const _0x5a80b5={...this[_0x50613d(0x137)][_0x50613d(0x136)],...this['layers'][_0x50613d(0x141)],...this[_0x50613d(0x137)][_0x50613d(0x114)]};process.env.TDX_SITE&&!this[_0x50613d(0x137)][_0x50613d(0x126)]['site']&&!this['layers'][_0x50613d(0x130)][_0x50613d(0x10f)]&&(_0x5a80b5['site']=process.env.TDX_SITE);Object[_0x50613d(0xfb)](_0x5a80b5,this[_0x50613d(0x137)][_0x50613d(0x126)]),Object['assign'](_0x5a80b5,this[_0x50613d(0x137)]['cliFlags']);const _0xbf0568=_0x5a80b5[_0x50613d(0x10f)]||_0x50613d(0x138);this['site']=resolveSite(_0xbf0568),this[_0x50613d(0x112)]=_0x5a80b5[_0x50613d(0x112)],this[_0x50613d(0x109)]=_0x5a80b5[_0x50613d(0x109)],this[_0x50613d(0x107)]=_0x5a80b5['segment_path'],this[_0x50613d(0xfa)]=_0x5a80b5[_0x50613d(0xfa)],this[_0x50613d(0x108)]=_0x5a80b5[_0x50613d(0x108)],this[_0x50613d(0x147)]=_0x5a80b5[_0x50613d(0x147)],this[_0x50613d(0x128)]=_0x49fc24[_0x50613d(0x128)]||![],this[_0x50613d(0x146)]=_0x49fc24[_0x50613d(0x146)]??LogLevel[_0x50613d(0x113)],this[_0x50613d(0x141)]=this['activeProfile']||undefined,this[_0x50613d(0x12b)]=getAccessToken(this['activeProfile']||undefined),this['apiKey']=getAPIKey(this['activeProfile']||undefined);const _0x2c4b91=typeof _0x7fc4c5['proxy']===_0x50613d(0x12c)?_0x7fc4c5['proxy']:undefined;this['proxy']=_0x2c4b91||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x5c5f5b=getConfigDir(),_0x219667=a58_0x11fc23[_0x50613d(0x10c)](_0x5c5f5b,_0x50613d(0x148),this['sessionId']+_0x50613d(0x100)),_0x25544e=findProjectConfigPath(),_0x2eb386=a58_0x11fc23[_0x50613d(0x10c)](_0x5c5f5b,_0x50613d(0x105)),_0xb44754=a58_0x11fc23[_0x50613d(0x10c)](_0x5c5f5b,_0x50613d(0x125));let _0x34a92d=null,_0x1c73ed=null;this[_0x50613d(0x111)]&&(_0x34a92d=a58_0x11fc23[_0x50613d(0x10c)](_0x5c5f5b,_0x50613d(0x110),this[_0x50613d(0x111)],'tdx.json'),_0x1c73ed=a58_0x11fc23[_0x50613d(0x10c)](_0x5c5f5b,'profiles',this[_0x50613d(0x111)],_0x50613d(0x125))),this[_0x50613d(0x144)]={'session':a58_0x5abc2c[_0x50613d(0x11a)](_0x219667)?_0x219667:null,'project':_0x25544e,'profile':_0x34a92d&&a58_0x5abc2c[_0x50613d(0x11a)](_0x34a92d)?_0x34a92d:null,'profileCredentials':_0x1c73ed&&a58_0x5abc2c[_0x50613d(0x11a)](_0x1c73ed)?_0x1c73ed:null,'global':a58_0x5abc2c[_0x50613d(0x11a)](_0x2eb386)?_0x2eb386:null,'globalCredentials':a58_0x5abc2c[_0x50613d(0x11a)](_0xb44754)?_0xb44754:null};}[a58_0x26f567(0x131)](_0x289008,_0x2dbcf5){const _0x137eee=a58_0x26f567;if(!_0x2dbcf5)return _0x137eee(0x115);const _0x2f92c7=_0x2dbcf5;if(this[_0x137eee(0x137)][_0x137eee(0x130)][_0x289008]===_0x2f92c7){if(_0x289008==='site'&&_0x2f92c7===_0x137eee(0x138)&&!this[_0x137eee(0x137)]['session'][_0x137eee(0x10f)]&&!this[_0x137eee(0x137)][_0x137eee(0x114)]['site']&&!this[_0x137eee(0x137)][_0x137eee(0x141)][_0x137eee(0x10f)]&&!this['layers'][_0x137eee(0x136)][_0x137eee(0x10f)])return _0x137eee(0x139);return _0x137eee(0x129)+_0x289008[_0x137eee(0x13d)](/_/g,'-');}if(this[_0x137eee(0x137)][_0x137eee(0x126)][_0x289008]===_0x2f92c7)return _0x137eee(0x126);if(this[_0x137eee(0x137)][_0x137eee(0x114)][_0x289008]===_0x2f92c7)return _0x137eee(0x114);if(this['layers'][_0x137eee(0x141)][_0x289008]===_0x2f92c7)return _0x137eee(0x12a)+this['activeProfile'];if(this[_0x137eee(0x137)][_0x137eee(0x136)][_0x289008]===_0x2f92c7)return _0x137eee(0x136);return _0x137eee(0x139);}['loadGlobalConfig'](){const _0x7f9ab9=a58_0x26f567,_0x5725df=a58_0x11fc23['join'](getConfigDir(),_0x7f9ab9(0x105));if(!a58_0x5abc2c[_0x7f9ab9(0x11a)](_0x5725df))return{};try{const _0x4871c0=a58_0x5abc2c[_0x7f9ab9(0x134)](_0x5725df,'utf-8');return JSON[_0x7f9ab9(0x10d)](_0x4871c0);}catch{return{};}}[a58_0x26f567(0x140)](_0x387129){const _0x55e3ce=a58_0x26f567;_0x387129[_0x55e3ce(0x10f)]=this['site'],!_0x387129[_0x55e3ce(0x112)]&&this[_0x55e3ce(0x112)]&&(_0x387129[_0x55e3ce(0x112)]=this[_0x55e3ce(0x112)]),!_0x387129[_0x55e3ce(0xff)]&&this[_0x55e3ce(0x109)]&&(_0x387129[_0x55e3ce(0xff)]=this[_0x55e3ce(0x109)]),!_0x387129[_0x55e3ce(0x13c)]&&this[_0x55e3ce(0x107)]&&(_0x387129['segmentPath']=this[_0x55e3ce(0x107)]),!_0x387129['llmProject']&&this['llm_project']&&(_0x387129['llmProject']=this[_0x55e3ce(0xfa)]),!_0x387129[_0x55e3ce(0x104)]&&this[_0x55e3ce(0x108)]&&(_0x387129[_0x55e3ce(0x104)]=this[_0x55e3ce(0x108)]),!_0x387129['workflowProject']&&this[_0x55e3ce(0x147)]&&(_0x387129[_0x55e3ce(0x10b)]=this[_0x55e3ce(0x147)]);}[a58_0x26f567(0x10a)](){const _0x2ba8d5=a58_0x26f567;return[{'key':_0x2ba8d5(0x10f),'value':this[_0x2ba8d5(0x10f)]},{'key':_0x2ba8d5(0x112),'value':this[_0x2ba8d5(0x112)]},{'key':_0x2ba8d5(0x109),'value':this[_0x2ba8d5(0x109)]},{'key':'segment_path','value':this[_0x2ba8d5(0x107)]},{'key':_0x2ba8d5(0xfa),'value':this['llm_project']},{'key':_0x2ba8d5(0x108),'value':this[_0x2ba8d5(0x108)]},{'key':_0x2ba8d5(0x147),'value':this[_0x2ba8d5(0x147)]},{'key':_0x2ba8d5(0x141),'value':this[_0x2ba8d5(0x111)]||undefined}];}[a58_0x26f567(0x121)](){const _0x4e2972=a58_0x26f567;console[_0x4e2972(0x106)](a58_0x593242[_0x4e2972(0x11f)](_0x4e2972(0xfd)));for(const {key:_0x508388,value:_0x4192c1}of this['getParameters']()){_0x4192c1&&console[_0x4e2972(0x106)](a58_0x593242[_0x4e2972(0x14a)](_0x508388)+':\x20'+_0x4192c1);}}[a58_0x26f567(0x145)](){const _0x4fa041=a58_0x26f567;console[_0x4fa041(0x106)](a58_0x593242[_0x4fa041(0x11f)](_0x4fa041(0xfd)));for(const {key:_0x131556,value:_0x1418ba}of this[_0x4fa041(0x10a)]()){if(_0x1418ba){const _0x4de2ac=_0x131556==='profile'?'(active)':'('+this[_0x4fa041(0x131)](_0x131556,_0x1418ba)+')';console['log'](a58_0x593242['cyan'](_0x131556)+':\x20'+_0x1418ba+'\x20'+a58_0x593242[_0x4fa041(0x11e)](_0x4de2ac));}}console[_0x4fa041(0x106)]('\x0a'+a58_0x593242['bold'](_0x4fa041(0x124)));const _0x61068d=[{'label':_0x4fa041(0x149),'path':this['configFiles'][_0x4fa041(0x126)],'extra':'(session:\x20'+this['sessionId']+')'},{'label':_0x4fa041(0x133),'path':this[_0x4fa041(0x144)]['project']},{'label':_0x4fa041(0x13f),'path':this[_0x4fa041(0x144)][_0x4fa041(0x141)]},{'label':_0x4fa041(0x135),'path':this[_0x4fa041(0x144)][_0x4fa041(0x102)]},{'label':_0x4fa041(0xfe),'path':this[_0x4fa041(0x144)]['global']},{'label':'Global\x20Credentials','path':this[_0x4fa041(0x144)][_0x4fa041(0x12f)]}];for(const {label:_0x262093,path:_0xec33f4,extra:_0x42f89e}of _0x61068d){if(_0xec33f4)console[_0x4fa041(0x106)](a58_0x593242[_0x4fa041(0x14a)](_0x262093)+':\x20'+_0xec33f4+'\x20'+a58_0x593242[_0x4fa041(0x10e)]('✓')+(_0x42f89e?'\x20'+a58_0x593242[_0x4fa041(0x11e)](_0x42f89e):''));else{if(_0x262093==='Session')console[_0x4fa041(0x106)](a58_0x593242[_0x4fa041(0x14a)](_0x262093)+':\x20'+a58_0x593242[_0x4fa041(0x11e)]('none')+'\x20'+a58_0x593242['dim'](_0x4fa041(0x123)+this[_0x4fa041(0x132)]+')'));else(_0x262093===_0x4fa041(0x133)||_0x262093==='Global')&&console[_0x4fa041(0x106)](a58_0x593242['cyan'](_0x262093)+':\x20'+a58_0x593242[_0x4fa041(0x11e)](_0x4fa041(0x120)));}}}async['resolveAPIKeyAsync'](){const _0x8b4aa4=a58_0x26f567;if(!this[_0x8b4aa4(0x12b)]){const _0x239a2f=await getOAuthTokens(this[_0x8b4aa4(0x111)]||undefined);if(_0x239a2f)return this[_0x8b4aa4(0x12b)]=_0x239a2f['access_token'],undefined;}return this[_0x8b4aa4(0x11d)]=await getAPIKeyAsync(this[_0x8b4aa4(0x10f)],this[_0x8b4aa4(0x111)]||undefined),this['apiKey'];}static async[a58_0x26f567(0x117)](_0x4af897){const _0x3bcc6f=a58_0x26f567,_0x1b2a5c=new GlobalContext(_0x4af897);return await _0x1b2a5c[_0x3bcc6f(0x13e)](),_0x1b2a5c;}}function a58_0x11b6(){const _0x33daf2=['accessToken','string','1556544YaTsDe','833133YnWlPg','globalCredentials','cliFlags','getSource','sessionId','Project','readFileSync','Profile\x20Credentials','global','layers','us01','default','14efWrEY','loadGlobalConfig','segmentPath','replace','resolveAPIKeyAsync','Profile','injectIntoOptions','profile','678177bZuFgQ','555663aJIvBG','configFiles','displayWithSources','logLevel','workflow_project','sessions','Session','cyan','llm_project','assign','llmProject','[context]','Global','parentSegment','.json','profileSource','profileCredentials','1435086VpgpQM','llmAgent','tdx.json','log','segment_path','llm_agent','parent_segment','getParameters','workflowProject','join','parse','green','site','profiles','activeProfile','database','INFO','project','not\x20set','config','createAsync','10424RYeTnW','1660CqWiuX','existsSync','proxy','88WYDQDu','apiKey','dim','bold','none','display','env','(using\x20session:\x20','[configuration\x20files]','.env','session','14254080EvLLwQ','verbose','CLI\x20flag:\x20--','profile:\x20'];a58_0x11b6=function(){return _0x33daf2;};return a58_0x11b6();}
1
+ const a58_0x241559=a58_0x144f;function a58_0x144f(_0x1bf70b,_0x56c2e7){_0x1bf70b=_0x1bf70b-0x164;const _0x3dd9e3=a58_0x3dd9();let _0x144fb3=_0x3dd9e3[_0x1bf70b];return _0x144fb3;}function a58_0x3dd9(){const _0x11ae43=['profile','(using\x20session:\x20','green','9945864zuRzGI','loadGlobalConfig','assign','Profile\x20Credentials','verbose','8151730CLFleU','proxy','activeProfile','us01','apiKey','Project','tdx.json','Global','env','segmentPath','cyan','llmProject','llm_project','join','injectIntoOptions','llm_agent','llmAgent','layers','.json','INFO','660KtLijd','getParameters','1133726qBEJSR','getSource','.env','config','entries','dim','access_token','sessionId','workflowProject','database','Global\x20Credentials','globalCredentials','CLI\x20flag:\x20--','readFileSync','none','bold','[configuration\x20files]','project','cli','workflow_project','cliFlags','107821nybcCG','displayWithSources','configFiles','2620326rTTjJg','parse','segment_path','resolveAPIKeyAsync','display','session','logLevel','site','global','parentSegment','replace','108469anxdXg','string','[context]','createAsync','log','utf-8','default','profiles','27030KcpPqV','existsSync','profileSource','profileCredentials','8HJpovU','parent_segment','accessToken','Session','not\x20set','profile:\x20'];a58_0x3dd9=function(){return _0x11ae43;};return a58_0x3dd9();}(function(_0x4adcce,_0x4969ba){const _0x56707c=a58_0x144f,_0x527d0e=_0x4adcce();while(!![]){try{const _0x5f26e6=parseInt(_0x56707c(0x165))/0x1+-parseInt(_0x56707c(0x195))/0x2+parseInt(_0x56707c(0x16d))/0x3*(parseInt(_0x56707c(0x193))/0x4)+-parseInt(_0x56707c(0x17f))/0x5+parseInt(_0x56707c(0x1ad))/0x6+-parseInt(_0x56707c(0x1aa))/0x7+parseInt(_0x56707c(0x171))/0x8*(parseInt(_0x56707c(0x17a))/0x9);if(_0x5f26e6===_0x4969ba)break;else _0x527d0e['push'](_0x527d0e['shift']());}catch(_0x3baae){_0x527d0e['push'](_0x527d0e['shift']());}}}(a58_0x3dd9,0xe1aa4));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a58_0x2dd967 from'node:fs';import*as a58_0x584a91 from'node:path';import a58_0x347817 from'chalk';export class GlobalContext{['site'];[a58_0x241559(0x19e)];[a58_0x241559(0x172)];[a58_0x241559(0x1af)];[a58_0x241559(0x18b)];[a58_0x241559(0x18e)];[a58_0x241559(0x1a8)];[a58_0x241559(0x183)];[a58_0x241559(0x173)];[a58_0x241559(0x180)];[a58_0x241559(0x17e)];[a58_0x241559(0x1b3)];[a58_0x241559(0x177)];[a58_0x241559(0x16f)]=null;[a58_0x241559(0x190)];['activeProfile'];[a58_0x241559(0x19c)];[a58_0x241559(0x1ac)];constructor(_0x5cb55a){const _0x36dbb8=a58_0x241559;this['sessionId']=getSessionID(_0x5cb55a[_0x36dbb8(0x1b2)]);const _0x111593=loadSessionContext(_0x5cb55a[_0x36dbb8(0x1b2)]),_0x21f201=loadProjectConfig(),_0x491c4f=this[_0x36dbb8(0x17b)]();if(_0x5cb55a[_0x36dbb8(0x177)])this[_0x36dbb8(0x181)]=_0x5cb55a[_0x36dbb8(0x177)],this[_0x36dbb8(0x16f)]=_0x36dbb8(0x1a7);else{if(_0x111593?.['profile'])this[_0x36dbb8(0x181)]=_0x111593['profile'],this[_0x36dbb8(0x16f)]='session';else{if(_0x491c4f[_0x36dbb8(0x177)])this[_0x36dbb8(0x181)]=_0x491c4f[_0x36dbb8(0x177)],this['profileSource']=_0x36dbb8(0x198);else process.env.TDX_PROFILE?(this[_0x36dbb8(0x181)]=process.env.TDX_PROFILE,this[_0x36dbb8(0x16f)]=_0x36dbb8(0x187)):(this[_0x36dbb8(0x181)]=null,this[_0x36dbb8(0x16f)]=null);}}const _0x14fe0a=this[_0x36dbb8(0x181)]?loadProfile(this[_0x36dbb8(0x181)]):null,_0x3ebfda=_0x3cc4f1=>{const _0x3121e6=_0x36dbb8;if(!_0x3cc4f1)return{};const _0x4be58b=_0x3cc4f1,_0x315a61={};for(const [_0x28bae0,_0x5f4f0c]of Object[_0x3121e6(0x199)](_0x4be58b)){typeof _0x5f4f0c===_0x3121e6(0x166)&&(_0x315a61[_0x28bae0]=_0x5f4f0c);}return _0x315a61;},_0x23f4c0={},_0x29e02b=(_0x4a6f3a,_0x2e4104,_0x5ea7cf)=>{const _0x542cf1=_0x36dbb8;if(!_0x4a6f3a)return![];if(_0x5ea7cf&&_0x4a6f3a===_0x5ea7cf)return![];const _0x40f28f=_0x111593,_0x4a0b9b=_0x21f201,_0xac6230=_0x14fe0a?.[_0x542cf1(0x198)],_0x2632cb=_0x491c4f,_0x2cad55=_0x40f28f?.[_0x2e4104],_0x4a64aa=_0x4a0b9b?.[_0x2e4104],_0x15366e=_0xac6230?.[_0x2e4104],_0x179992=_0x2632cb[_0x2e4104];return _0x4a6f3a!==_0x2cad55&&_0x4a6f3a!==_0x4a64aa&&_0x4a6f3a!==_0x15366e&&_0x4a6f3a!==_0x179992;},_0x14d118=[{'optionKey':'site','contextKey':_0x36dbb8(0x1b4),'defaultValue':_0x36dbb8(0x182)},{'optionKey':_0x36dbb8(0x19e),'contextKey':_0x36dbb8(0x19e)},{'optionKey':_0x36dbb8(0x1b6),'contextKey':_0x36dbb8(0x172)},{'optionKey':_0x36dbb8(0x18a),'contextKey':'llm_project'},{'optionKey':'llmAgent','contextKey':'llm_agent'},{'optionKey':_0x36dbb8(0x177),'contextKey':_0x36dbb8(0x177)}];for(const {optionKey:_0x344971,contextKey:_0x27be23,defaultValue:_0x425425}of _0x14d118){const _0x554dae=_0x5cb55a[_0x344971];_0x29e02b(_0x554dae,_0x27be23,_0x425425)&&(_0x23f4c0[_0x27be23]=_0x554dae);}this['layers']={'cliFlags':_0x23f4c0,'session':_0x3ebfda(_0x111593),'project':_0x3ebfda(_0x21f201),'profile':_0x3ebfda(_0x14fe0a?.[_0x36dbb8(0x198)]),'global':_0x3ebfda(_0x491c4f)};const _0x391c88={...this[_0x36dbb8(0x190)][_0x36dbb8(0x1b5)],...this['layers']['profile'],...this[_0x36dbb8(0x190)][_0x36dbb8(0x1a6)]};process.env.TDX_SITE&&!this['layers'][_0x36dbb8(0x1b2)]['site']&&!this['layers'][_0x36dbb8(0x1a9)][_0x36dbb8(0x1b4)]&&(_0x391c88[_0x36dbb8(0x1b4)]=process.env.TDX_SITE);Object[_0x36dbb8(0x17c)](_0x391c88,this[_0x36dbb8(0x190)][_0x36dbb8(0x1b2)]),Object[_0x36dbb8(0x17c)](_0x391c88,this[_0x36dbb8(0x190)][_0x36dbb8(0x1a9)]);const _0xee7083=_0x391c88[_0x36dbb8(0x1b4)]||_0x36dbb8(0x182);this['site']=resolveSite(_0xee7083),this[_0x36dbb8(0x19e)]=_0x391c88[_0x36dbb8(0x19e)],this[_0x36dbb8(0x172)]=_0x391c88[_0x36dbb8(0x172)],this['segment_path']=_0x391c88[_0x36dbb8(0x1af)],this['llm_project']=_0x391c88[_0x36dbb8(0x18b)],this[_0x36dbb8(0x18e)]=_0x391c88[_0x36dbb8(0x18e)],this[_0x36dbb8(0x1a8)]=_0x391c88[_0x36dbb8(0x1a8)],this[_0x36dbb8(0x17e)]=_0x5cb55a[_0x36dbb8(0x17e)]||![],this[_0x36dbb8(0x1b3)]=_0x5cb55a[_0x36dbb8(0x1b3)]??LogLevel[_0x36dbb8(0x192)],this[_0x36dbb8(0x177)]=this['activeProfile']||undefined,this[_0x36dbb8(0x173)]=getAccessToken(this[_0x36dbb8(0x181)]||undefined),this[_0x36dbb8(0x183)]=getAPIKey(this[_0x36dbb8(0x181)]||undefined);const _0x1bef1a=typeof _0x491c4f['proxy']===_0x36dbb8(0x166)?_0x491c4f['proxy']:undefined;this[_0x36dbb8(0x180)]=_0x1bef1a||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x50914d=getConfigDir(),_0x178cec=a58_0x584a91['join'](_0x50914d,'sessions',this[_0x36dbb8(0x19c)]+_0x36dbb8(0x191)),_0x528e3b=findProjectConfigPath(),_0x1dace8=a58_0x584a91['join'](_0x50914d,'tdx.json'),_0x496a60=a58_0x584a91[_0x36dbb8(0x18c)](_0x50914d,_0x36dbb8(0x197));let _0x1019b2=null,_0xf81735=null;this[_0x36dbb8(0x181)]&&(_0x1019b2=a58_0x584a91[_0x36dbb8(0x18c)](_0x50914d,_0x36dbb8(0x16c),this[_0x36dbb8(0x181)],_0x36dbb8(0x185)),_0xf81735=a58_0x584a91['join'](_0x50914d,'profiles',this[_0x36dbb8(0x181)],_0x36dbb8(0x197))),this[_0x36dbb8(0x1ac)]={'session':a58_0x2dd967[_0x36dbb8(0x16e)](_0x178cec)?_0x178cec:null,'project':_0x528e3b,'profile':_0x1019b2&&a58_0x2dd967[_0x36dbb8(0x16e)](_0x1019b2)?_0x1019b2:null,'profileCredentials':_0xf81735&&a58_0x2dd967['existsSync'](_0xf81735)?_0xf81735:null,'global':a58_0x2dd967[_0x36dbb8(0x16e)](_0x1dace8)?_0x1dace8:null,'globalCredentials':a58_0x2dd967[_0x36dbb8(0x16e)](_0x496a60)?_0x496a60:null};}[a58_0x241559(0x196)](_0x5a12c3,_0x23af24){const _0x473448=a58_0x241559;if(!_0x23af24)return _0x473448(0x175);const _0x4b672a=_0x23af24;if(this[_0x473448(0x190)][_0x473448(0x1a9)][_0x5a12c3]===_0x4b672a){if(_0x5a12c3==='site'&&_0x4b672a===_0x473448(0x182)&&!this['layers'][_0x473448(0x1b2)]['site']&&!this['layers']['project'][_0x473448(0x1b4)]&&!this[_0x473448(0x190)][_0x473448(0x177)][_0x473448(0x1b4)]&&!this['layers'][_0x473448(0x1b5)][_0x473448(0x1b4)])return _0x473448(0x16b);return _0x473448(0x1a1)+_0x5a12c3[_0x473448(0x164)](/_/g,'-');}if(this[_0x473448(0x190)][_0x473448(0x1b2)][_0x5a12c3]===_0x4b672a)return'session';if(this[_0x473448(0x190)][_0x473448(0x1a6)][_0x5a12c3]===_0x4b672a)return _0x473448(0x1a6);if(this['layers']['profile'][_0x5a12c3]===_0x4b672a)return _0x473448(0x176)+this[_0x473448(0x181)];if(this[_0x473448(0x190)][_0x473448(0x1b5)][_0x5a12c3]===_0x4b672a)return _0x473448(0x1b5);return'default';}[a58_0x241559(0x17b)](){const _0x143c82=a58_0x241559,_0x528f43=a58_0x584a91['join'](getConfigDir(),_0x143c82(0x185));if(!a58_0x2dd967[_0x143c82(0x16e)](_0x528f43))return{};try{const _0x2a5010=a58_0x2dd967[_0x143c82(0x1a2)](_0x528f43,_0x143c82(0x16a));return JSON[_0x143c82(0x1ae)](_0x2a5010);}catch{return{};}}[a58_0x241559(0x18d)](_0x34e7df){const _0x4978cb=a58_0x241559;_0x34e7df['site']=this[_0x4978cb(0x1b4)],!_0x34e7df['database']&&this[_0x4978cb(0x19e)]&&(_0x34e7df[_0x4978cb(0x19e)]=this[_0x4978cb(0x19e)]),!_0x34e7df['parentSegment']&&this[_0x4978cb(0x172)]&&(_0x34e7df[_0x4978cb(0x1b6)]=this[_0x4978cb(0x172)]),!_0x34e7df[_0x4978cb(0x188)]&&this[_0x4978cb(0x1af)]&&(_0x34e7df['segmentPath']=this[_0x4978cb(0x1af)]),!_0x34e7df[_0x4978cb(0x18a)]&&this[_0x4978cb(0x18b)]&&(_0x34e7df[_0x4978cb(0x18a)]=this[_0x4978cb(0x18b)]),!_0x34e7df[_0x4978cb(0x18f)]&&this['llm_agent']&&(_0x34e7df[_0x4978cb(0x18f)]=this[_0x4978cb(0x18e)]),!_0x34e7df[_0x4978cb(0x19d)]&&this[_0x4978cb(0x1a8)]&&(_0x34e7df[_0x4978cb(0x19d)]=this[_0x4978cb(0x1a8)]);}[a58_0x241559(0x194)](){const _0x45be1b=a58_0x241559;return[{'key':_0x45be1b(0x1b4),'value':this[_0x45be1b(0x1b4)]},{'key':'database','value':this[_0x45be1b(0x19e)]},{'key':_0x45be1b(0x172),'value':this[_0x45be1b(0x172)]},{'key':_0x45be1b(0x1af),'value':this[_0x45be1b(0x1af)]},{'key':_0x45be1b(0x18b),'value':this['llm_project']},{'key':_0x45be1b(0x18e),'value':this[_0x45be1b(0x18e)]},{'key':_0x45be1b(0x1a8),'value':this[_0x45be1b(0x1a8)]},{'key':_0x45be1b(0x177),'value':this[_0x45be1b(0x181)]||undefined}];}[a58_0x241559(0x1b1)](){const _0xa1c86d=a58_0x241559;console[_0xa1c86d(0x169)](a58_0x347817[_0xa1c86d(0x1a4)]('[context]'));for(const {key:_0x544942,value:_0x23e351}of this[_0xa1c86d(0x194)]()){_0x23e351&&console['log'](a58_0x347817[_0xa1c86d(0x189)](_0x544942)+':\x20'+_0x23e351);}}[a58_0x241559(0x1ab)](){const _0x22556b=a58_0x241559;console[_0x22556b(0x169)](a58_0x347817[_0x22556b(0x1a4)](_0x22556b(0x167)));for(const {key:_0x10962d,value:_0x14cddf}of this[_0x22556b(0x194)]()){if(_0x14cddf){const _0x960482=_0x10962d===_0x22556b(0x177)?'(active)':'('+this[_0x22556b(0x196)](_0x10962d,_0x14cddf)+')';console[_0x22556b(0x169)](a58_0x347817['cyan'](_0x10962d)+':\x20'+_0x14cddf+'\x20'+a58_0x347817[_0x22556b(0x19a)](_0x960482));}}console['log']('\x0a'+a58_0x347817[_0x22556b(0x1a4)](_0x22556b(0x1a5)));const _0x5af5bf=[{'label':_0x22556b(0x174),'path':this['configFiles'][_0x22556b(0x1b2)],'extra':'(session:\x20'+this[_0x22556b(0x19c)]+')'},{'label':_0x22556b(0x184),'path':this[_0x22556b(0x1ac)][_0x22556b(0x1a6)]},{'label':'Profile','path':this[_0x22556b(0x1ac)][_0x22556b(0x177)]},{'label':_0x22556b(0x17d),'path':this[_0x22556b(0x1ac)][_0x22556b(0x170)]},{'label':'Global','path':this[_0x22556b(0x1ac)][_0x22556b(0x1b5)]},{'label':_0x22556b(0x19f),'path':this['configFiles'][_0x22556b(0x1a0)]}];for(const {label:_0x40b1a5,path:_0x42ad9e,extra:_0x14d192}of _0x5af5bf){if(_0x42ad9e)console[_0x22556b(0x169)](a58_0x347817['cyan'](_0x40b1a5)+':\x20'+_0x42ad9e+'\x20'+a58_0x347817[_0x22556b(0x179)]('✓')+(_0x14d192?'\x20'+a58_0x347817[_0x22556b(0x19a)](_0x14d192):''));else{if(_0x40b1a5===_0x22556b(0x174))console[_0x22556b(0x169)](a58_0x347817['cyan'](_0x40b1a5)+':\x20'+a58_0x347817[_0x22556b(0x19a)]('none')+'\x20'+a58_0x347817[_0x22556b(0x19a)](_0x22556b(0x178)+this['sessionId']+')'));else(_0x40b1a5===_0x22556b(0x184)||_0x40b1a5===_0x22556b(0x186))&&console[_0x22556b(0x169)](a58_0x347817[_0x22556b(0x189)](_0x40b1a5)+':\x20'+a58_0x347817[_0x22556b(0x19a)](_0x22556b(0x1a3)));}}}async[a58_0x241559(0x1b0)](){const _0x401b27=a58_0x241559;if(!this[_0x401b27(0x173)]){const _0x346dbe=await getOAuthTokens(this[_0x401b27(0x181)]||undefined);if(_0x346dbe)return this[_0x401b27(0x173)]=_0x346dbe[_0x401b27(0x19b)],undefined;}return this[_0x401b27(0x183)]=await getAPIKeyAsync(this['site'],this[_0x401b27(0x181)]||undefined),this[_0x401b27(0x183)];}static async[a58_0x241559(0x168)](_0x32e68f){const _0x5ee800=a58_0x241559,_0x488b61=new GlobalContext(_0x32e68f);return await _0x488b61[_0x5ee800(0x1b0)](),_0x488b61;}}
@@ -1 +1 @@
1
- const a59_0x492977=a59_0x5ef0;function a59_0x5bdc(){const _0x5d012d=['tdx','Warning:\x20','message','222962YiBSdC','4887925NXwbSD','deleteCredential','3818488tKzihf','@napi-rs/keyring','setPassword','not\x20supported','3815cFteHY','-25300','error','getPassword','__keychain_test__','access_denied','includes','1871115NtUYBv','unavailable','not_found','System\x20keychain\x20is\x20not\x20available','not\x20found','reason','437414MQYKol','restricted','no\x20matching\x20entry','not\x20available','could\x20not\x20be\x20found','success','access','toLowerCase','1224pcBDXR','204992BMFtiQ','Entry'];a59_0x5bdc=function(){return _0x5d012d;};return a59_0x5bdc();}(function(_0x52dfd8,_0x415309){const _0x3afdfd=a59_0x5ef0,_0x4022b0=_0x52dfd8();while(!![]){try{const _0x133e19=parseInt(_0x3afdfd(0xf3))/0x1+parseInt(_0x3afdfd(0x107))/0x2+parseInt(_0x3afdfd(0x101))/0x3+-parseInt(_0x3afdfd(0xf6))/0x4+parseInt(_0x3afdfd(0xfa))/0x5*(parseInt(_0x3afdfd(0xed))/0x6)+parseInt(_0x3afdfd(0xf4))/0x7+-parseInt(_0x3afdfd(0xee))/0x8;if(_0x133e19===_0x415309)break;else _0x4022b0['push'](_0x4022b0['shift']());}catch(_0x412254){_0x4022b0['push'](_0x4022b0['shift']());}}}(a59_0x5bdc,0xe542f));function a59_0x5ef0(_0x1d3911,_0x52ed4e){_0x1d3911=_0x1d3911-0xe6;const _0x5bdcb2=a59_0x5bdc();let _0x5ef065=_0x5bdcb2[_0x1d3911];return _0x5ef065;}const SERVICE_NAME=a59_0x492977(0xf0);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x2df4c7=a59_0x492977;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x6653e8=await import(_0x2df4c7(0xf7));return EntryClass=_0x6653e8[_0x2df4c7(0xef)],EntryClass;}catch(_0x19aa55){return keyringLoadError=_0x19aa55 instanceof Error?_0x19aa55:new Error(String(_0x19aa55)),null;}}function getAccountName(_0x50b370){const _0x5a7bfc=_0x50b370||'';return'profile:'+_0x5a7bfc+':api_key';}export async function getKeychainAPIKey(_0x4d9ea1){const _0x18e4cf=a59_0x492977,_0x3c5dce=await getKeychainAPIKeyWithStatus(_0x4d9ea1);if(_0x3c5dce[_0x18e4cf(0xea)])return _0x3c5dce['value'];return _0x3c5dce[_0x18e4cf(0x106)]===_0x18e4cf(0xff)&&console[_0x18e4cf(0xfc)](_0x18e4cf(0xf1)+_0x3c5dce['message']),null;}export async function getKeychainAPIKeyWithStatus(_0x512460){const _0x3b0456=a59_0x492977;try{const _0x21987f=await getEntryClass();if(!_0x21987f)return{'success':![],'reason':_0x3b0456(0x102)};const _0x326331=getAccountName(_0x512460),_0x2c91f5=new _0x21987f(SERVICE_NAME,_0x326331),_0x60c779=_0x2c91f5[_0x3b0456(0xfd)]();if(_0x60c779)return{'success':!![],'value':_0x60c779};return{'success':![],'reason':'not_found'};}catch(_0x5724e1){const _0x90b909=_0x5724e1 instanceof Error?_0x5724e1[_0x3b0456(0xf2)]:String(_0x5724e1);if(_0x90b909['includes'](_0x3b0456(0xfb))||_0x90b909[_0x3b0456(0xec)]()[_0x3b0456(0x100)](_0x3b0456(0xe9))||_0x90b909['toLowerCase']()['includes'](_0x3b0456(0x105))||_0x90b909[_0x3b0456(0xec)]()[_0x3b0456(0x100)](_0x3b0456(0xe7)))return{'success':![],'reason':_0x3b0456(0x103)};if(_0x90b909[_0x3b0456(0x100)]('-25293')||_0x90b909[_0x3b0456(0xec)]()[_0x3b0456(0x100)](_0x3b0456(0xe6))||_0x90b909['toLowerCase']()[_0x3b0456(0x100)](_0x3b0456(0xeb)))return{'success':![],'reason':_0x3b0456(0xff),'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':_0x90b909};}}export async function saveKeychainAPIKey(_0x350ea2,_0x5d030b){const _0x2aad24=a59_0x492977,_0x4b9b97=await getEntryClass();if(!_0x4b9b97)throw new Error(_0x2aad24(0x104));const _0x1a2d7a=getAccountName(_0x5d030b),_0x2fd473=new _0x4b9b97(SERVICE_NAME,_0x1a2d7a);_0x2fd473[_0x2aad24(0xf8)](_0x350ea2);}export async function deleteKeychainAPIKey(_0x5be70d){const _0x5a9db7=a59_0x492977;try{const _0x23e1b5=await getEntryClass();if(!_0x23e1b5)return![];const _0x391447=getAccountName(_0x5be70d),_0x586f3f=new _0x23e1b5(SERVICE_NAME,_0x391447);return _0x586f3f[_0x5a9db7(0xf5)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x8ac37a=a59_0x492977;try{const _0x1492d9=await getEntryClass();if(!_0x1492d9)return![];const _0x1a45f6=new _0x1492d9(SERVICE_NAME,_0x8ac37a(0xfe));return _0x1a45f6[_0x8ac37a(0xfd)](),!![];}catch(_0x34bcbf){const _0x36b0df=_0x34bcbf instanceof Error?_0x34bcbf['message'][_0x8ac37a(0xec)]():'';if(_0x36b0df[_0x8ac37a(0x100)](_0x8ac37a(0xe8))||_0x36b0df[_0x8ac37a(0x100)](_0x8ac37a(0xf9))||_0x36b0df[_0x8ac37a(0x100)]('cannot\x20find'))return![];return!![];}}
1
+ const a59_0x8e7b2c=a59_0x4e2d;(function(_0x5e9bba,_0x179705){const _0xa210d=a59_0x4e2d,_0x306ee9=_0x5e9bba();while(!![]){try{const _0x11f8cd=-parseInt(_0xa210d(0xbd))/0x1*(-parseInt(_0xa210d(0xc5))/0x2)+parseInt(_0xa210d(0xc8))/0x3+-parseInt(_0xa210d(0xc3))/0x4+-parseInt(_0xa210d(0xcb))/0x5*(parseInt(_0xa210d(0xb4))/0x6)+parseInt(_0xa210d(0xcf))/0x7*(parseInt(_0xa210d(0xca))/0x8)+-parseInt(_0xa210d(0xb2))/0x9+parseInt(_0xa210d(0xbf))/0xa;if(_0x11f8cd===_0x179705)break;else _0x306ee9['push'](_0x306ee9['shift']());}catch(_0x3f305a){_0x306ee9['push'](_0x306ee9['shift']());}}}(a59_0x5f56,0x381bf));const SERVICE_NAME=a59_0x8e7b2c(0xc6);function a59_0x5f56(){const _0x164561=['Warning:\x20','16QWRhAM','225aXSVpd','access_denied','not_found','@napi-rs/keyring','61579VOSmcc','setPassword','toLowerCase','no\x20matching\x20entry','System\x20keychain\x20is\x20not\x20available','could\x20not\x20be\x20found','getPassword','reason','2847447YPWroS','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.','5982vsHGsx','includes','-25293','not\x20available','Entry','deleteCredential','__keychain_test__','profile:','unavailable','3ZFLuMx','not\x20supported','2005460Vsiplr','cannot\x20find','message','success','671116UOjRUp',':api_key','296196TwsENY','tdx','value','289248iunQlT'];a59_0x5f56=function(){return _0x164561;};return a59_0x5f56();}let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x56fa8a=a59_0x8e7b2c;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x5030c2=await import(_0x56fa8a(0xce));return EntryClass=_0x5030c2[_0x56fa8a(0xb8)],EntryClass;}catch(_0x1a0f8b){return keyringLoadError=_0x1a0f8b instanceof Error?_0x1a0f8b:new Error(String(_0x1a0f8b)),null;}}function getAccountName(_0x153707){const _0x44e41c=a59_0x8e7b2c,_0x5861c1=_0x153707||'';return _0x44e41c(0xbb)+_0x5861c1+_0x44e41c(0xc4);}export async function getKeychainAPIKey(_0x53096b){const _0x5e733e=a59_0x8e7b2c,_0x24183c=await getKeychainAPIKeyWithStatus(_0x53096b);if(_0x24183c[_0x5e733e(0xc2)])return _0x24183c[_0x5e733e(0xc7)];return _0x24183c[_0x5e733e(0xb1)]===_0x5e733e(0xcc)&&console['error'](_0x5e733e(0xc9)+_0x24183c['message']),null;}export async function getKeychainAPIKeyWithStatus(_0x144b66){const _0x37c024=a59_0x8e7b2c;try{const _0x5ec853=await getEntryClass();if(!_0x5ec853)return{'success':![],'reason':'unavailable'};const _0x413f0a=getAccountName(_0x144b66),_0x43e25f=new _0x5ec853(SERVICE_NAME,_0x413f0a),_0x4cde83=_0x43e25f[_0x37c024(0xb0)]();if(_0x4cde83)return{'success':!![],'value':_0x4cde83};return{'success':![],'reason':_0x37c024(0xcd)};}catch(_0x42432d){const _0x38cb5b=_0x42432d instanceof Error?_0x42432d['message']:String(_0x42432d);if(_0x38cb5b[_0x37c024(0xb5)]('-25300')||_0x38cb5b[_0x37c024(0xac)]()[_0x37c024(0xb5)](_0x37c024(0xaf))||_0x38cb5b[_0x37c024(0xac)]()[_0x37c024(0xb5)]('not\x20found')||_0x38cb5b[_0x37c024(0xac)]()[_0x37c024(0xb5)](_0x37c024(0xad)))return{'success':![],'reason':_0x37c024(0xcd)};if(_0x38cb5b['includes'](_0x37c024(0xb6))||_0x38cb5b[_0x37c024(0xac)]()[_0x37c024(0xb5)]('restricted')||_0x38cb5b[_0x37c024(0xac)]()[_0x37c024(0xb5)]('access'))return{'success':![],'reason':'access_denied','message':_0x37c024(0xb3)};return{'success':![],'reason':_0x37c024(0xbc),'message':_0x38cb5b};}}function a59_0x4e2d(_0x1db056,_0x404a13){_0x1db056=_0x1db056-0xab;const _0x5f56a6=a59_0x5f56();let _0x4e2d08=_0x5f56a6[_0x1db056];return _0x4e2d08;}export async function saveKeychainAPIKey(_0x354f1c,_0x51872b){const _0x388d9d=a59_0x8e7b2c,_0x4a915e=await getEntryClass();if(!_0x4a915e)throw new Error(_0x388d9d(0xae));const _0x18c92b=getAccountName(_0x51872b),_0x3f1e8b=new _0x4a915e(SERVICE_NAME,_0x18c92b);_0x3f1e8b[_0x388d9d(0xab)](_0x354f1c);}export async function deleteKeychainAPIKey(_0x3e2b92){const _0x540e3f=a59_0x8e7b2c;try{const _0x47ec57=await getEntryClass();if(!_0x47ec57)return![];const _0x3853e2=getAccountName(_0x3e2b92),_0x47bfb1=new _0x47ec57(SERVICE_NAME,_0x3853e2);return _0x47bfb1[_0x540e3f(0xb9)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0xa369e=a59_0x8e7b2c;try{const _0x490216=await getEntryClass();if(!_0x490216)return![];const _0x12b717=new _0x490216(SERVICE_NAME,_0xa369e(0xba));return _0x12b717[_0xa369e(0xb0)](),!![];}catch(_0x3c786f){const _0x4b8111=_0x3c786f instanceof Error?_0x3c786f[_0xa369e(0xc1)][_0xa369e(0xac)]():'';if(_0x4b8111[_0xa369e(0xb5)](_0xa369e(0xb7))||_0x4b8111[_0xa369e(0xb5)](_0xa369e(0xbe))||_0x4b8111[_0xa369e(0xb5)](_0xa369e(0xc0)))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0x409146,_0x28c47e){const _0x2aec56=a60_0x41af,_0x5421ea=_0x409146();while(!![]){try{const _0x124364=-parseInt(_0x2aec56(0x1a4))/0x1+-parseInt(_0x2aec56(0x19c))/0x2*(parseInt(_0x2aec56(0x1a8))/0x3)+-parseInt(_0x2aec56(0x19a))/0x4*(-parseInt(_0x2aec56(0x19b))/0x5)+parseInt(_0x2aec56(0x19f))/0x6+-parseInt(_0x2aec56(0x1a7))/0x7+parseInt(_0x2aec56(0x19e))/0x8*(-parseInt(_0x2aec56(0x1a5))/0x9)+parseInt(_0x2aec56(0x199))/0xa*(parseInt(_0x2aec56(0x1a6))/0xb);if(_0x124364===_0x28c47e)break;else _0x5421ea['push'](_0x5421ea['shift']());}catch(_0x160fe3){_0x5421ea['push'](_0x5421ea['shift']());}}}(a60_0x1d72,0x66140));const SERVICE_NAME='tdx';function a60_0x1d72(){const _0xa73851=['1940484wQDjCL','255741ubpLel','getPassword','Entry','setPassword','4446620BxOKYM','2338124QCcbPt','5jOArgC','6XkPnar','deleteCredential','6423464hhHpuy','2568732INiFCN','System\x20keychain\x20is\x20not\x20available','profile:','parse','@napi-rs/keyring','147979KNdNxf','9oibrvW','22pBugmM'];a60_0x1d72=function(){return _0xa73851;};return a60_0x1d72();}let EntryClass=null,keyringLoadError=null;function a60_0x41af(_0x166cea,_0x13be9a){_0x166cea=_0x166cea-0x198;const _0x1d7295=a60_0x1d72();let _0x41aff8=_0x1d7295[_0x166cea];return _0x41aff8;}async function getEntryClass(){const _0x536f38=a60_0x41af;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x59d693=await import(_0x536f38(0x1a3));return EntryClass=_0x59d693[_0x536f38(0x1aa)],EntryClass;}catch(_0x4d44f9){return keyringLoadError=_0x4d44f9 instanceof Error?_0x4d44f9:new Error(String(_0x4d44f9)),null;}}function getOAuthAccountName(_0x385352){const _0x73ae48=a60_0x41af,_0x23ac6c=_0x385352||'';return _0x73ae48(0x1a1)+_0x23ac6c+':oauth_tokens';}export async function saveOAuthTokens(_0x9a3216,_0x2855ae){const _0x3813a0=a60_0x41af,_0xabecf0=await getEntryClass();if(!_0xabecf0)throw new Error(_0x3813a0(0x1a0));const _0x578e8a=getOAuthAccountName(_0x2855ae),_0x37a982=new _0xabecf0(SERVICE_NAME,_0x578e8a);_0x37a982[_0x3813a0(0x198)](JSON['stringify'](_0x9a3216));}export async function getOAuthTokens(_0x5c691f){const _0x13c1d4=a60_0x41af;try{const _0x157317=await getEntryClass();if(!_0x157317)return null;const _0x4b894d=getOAuthAccountName(_0x5c691f),_0x4e660b=new _0x157317(SERVICE_NAME,_0x4b894d),_0x2aa055=_0x4e660b[_0x13c1d4(0x1a9)]();if(_0x2aa055)return JSON[_0x13c1d4(0x1a2)](_0x2aa055);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x516856){const _0x4015a9=a60_0x41af;try{const _0x390190=await getEntryClass();if(!_0x390190)return![];const _0x3d8432=getOAuthAccountName(_0x516856),_0x328722=new _0x390190(SERVICE_NAME,_0x3d8432);return _0x328722[_0x4015a9(0x19d)](),!![];}catch{return![];}}
1
+ const a60_0x33dfc2=a60_0x20ff;(function(_0x393f56,_0x557053){const _0x1cbe26=a60_0x20ff,_0x1c45b8=_0x393f56();while(!![]){try{const _0x58acd7=-parseInt(_0x1cbe26(0xff))/0x1+parseInt(_0x1cbe26(0x105))/0x2+parseInt(_0x1cbe26(0x101))/0x3+parseInt(_0x1cbe26(0x10a))/0x4+-parseInt(_0x1cbe26(0x109))/0x5*(parseInt(_0x1cbe26(0x106))/0x6)+parseInt(_0x1cbe26(0x100))/0x7+parseInt(_0x1cbe26(0x10c))/0x8*(-parseInt(_0x1cbe26(0x10b))/0x9);if(_0x58acd7===_0x557053)break;else _0x1c45b8['push'](_0x1c45b8['shift']());}catch(_0x5c9806){_0x1c45b8['push'](_0x1c45b8['shift']());}}}(a60_0x1c1b,0x5de2b));const SERVICE_NAME=a60_0x33dfc2(0x103);function a60_0x1c1b(){const _0x37c475=['1115716uCcrHK','9tJsvUD','659112VCzViQ','profile:','parse','deleteCredential','stringify','337585KvzKPk','1118278oQlJRc','1060866zZHIyf',':oauth_tokens','tdx','Entry','763076MDEXvk','132JBiNku','setPassword','@napi-rs/keyring','83935BrODDp'];a60_0x1c1b=function(){return _0x37c475;};return a60_0x1c1b();}let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x6195c7=a60_0x33dfc2;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x48c1e6=await import(_0x6195c7(0x108));return EntryClass=_0x48c1e6[_0x6195c7(0x104)],EntryClass;}catch(_0x43e65e){return keyringLoadError=_0x43e65e instanceof Error?_0x43e65e:new Error(String(_0x43e65e)),null;}}function a60_0x20ff(_0x2ac642,_0x5eb013){_0x2ac642=_0x2ac642-0xfb;const _0x1c1b1b=a60_0x1c1b();let _0x20ffd3=_0x1c1b1b[_0x2ac642];return _0x20ffd3;}function getOAuthAccountName(_0x434cb5){const _0x4d0a78=a60_0x33dfc2,_0x3c33d3=_0x434cb5||'';return _0x4d0a78(0xfb)+_0x3c33d3+_0x4d0a78(0x102);}export async function saveOAuthTokens(_0x131442,_0xb689ac){const _0x5ab0f5=a60_0x33dfc2,_0x3c4d53=await getEntryClass();if(!_0x3c4d53)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x2cd894=getOAuthAccountName(_0xb689ac),_0x58794c=new _0x3c4d53(SERVICE_NAME,_0x2cd894);_0x58794c[_0x5ab0f5(0x107)](JSON[_0x5ab0f5(0xfe)](_0x131442));}export async function getOAuthTokens(_0x3c6b4c){const _0x5ceccd=a60_0x33dfc2;try{const _0xa0533b=await getEntryClass();if(!_0xa0533b)return null;const _0x34efef=getOAuthAccountName(_0x3c6b4c),_0x43825f=new _0xa0533b(SERVICE_NAME,_0x34efef),_0x52c9c8=_0x43825f['getPassword']();if(_0x52c9c8)return JSON[_0x5ceccd(0xfc)](_0x52c9c8);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x243e31){const _0x6b0431=a60_0x33dfc2;try{const _0x3577ea=await getEntryClass();if(!_0x3577ea)return![];const _0x3da514=getOAuthAccountName(_0x243e31),_0x22c79a=new _0x3577ea(SERVICE_NAME,_0x3da514);return _0x22c79a[_0x6b0431(0xfd)](),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a61_0x2d2b4d=a61_0x4101;(function(_0x21ace1,_0x787ce4){const _0x3a81fc=a61_0x4101,_0x3398ad=_0x21ace1();while(!![]){try{const _0x263727=parseInt(_0x3a81fc(0x189))/0x1+parseInt(_0x3a81fc(0x17f))/0x2+parseInt(_0x3a81fc(0x188))/0x3+parseInt(_0x3a81fc(0x15b))/0x4*(parseInt(_0x3a81fc(0x16b))/0x5)+-parseInt(_0x3a81fc(0x17a))/0x6*(parseInt(_0x3a81fc(0x15a))/0x7)+parseInt(_0x3a81fc(0x15d))/0x8*(-parseInt(_0x3a81fc(0x150))/0x9)+parseInt(_0x3a81fc(0x14a))/0xa;if(_0x263727===_0x787ce4)break;else _0x3398ad['push'](_0x3398ad['shift']());}catch(_0x240864){_0x3398ad['push'](_0x3398ad['shift']());}}}(a61_0x422c,0x21fca));function a61_0x4101(_0x24907c,_0x5cd4ba){_0x24907c=_0x24907c-0x147;const _0x422ca9=a61_0x422c();let _0x410158=_0x422ca9[_0x24907c];return _0x410158;}import*as a61_0x3ff94b from'node:crypto';import*as a61_0x1e5f8b from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a61_0x2d2b4d(0x184),a61_0x2d2b4d(0x157),a61_0x2d2b4d(0x183),a61_0x2d2b4d(0x169),a61_0x2d2b4d(0x167)]);export function isOAuthSupported(_0x1ff448){const _0x221d31=a61_0x2d2b4d;return OAUTH_SUPPORTED_SITES[_0x221d31(0x16d)](_0x1ff448);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a61_0x2d2b4d(0x161)+OAUTH_CALLBACK_PORT+a61_0x2d2b4d(0x18a);export function getOAuthClientId(){const _0x51f596=a61_0x2d2b4d;return process.env.TD_OAUTH_CLIENT_ID||_0x51f596(0x160);}function a61_0x422c(){const _0x4a3ca8=['url','redirectUri','stg-us01','dev-us01','/oauth/authorize','clientId','update','81681MbaFLe','87889XpsYAW','/oauth/callback','waitForCallback','createHash','message','1052810Kagfju','/oauth/token','state','authorization_code','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','463761RdkVqB','code_challenge_method','OAuth\x20token\x20request\x20failed\x20(','Port\x20','):\x20','codeChallenge','sha256','dev-eu01','createServer','POST','42Xrrtfi','224ZDTUzZ','text','40YzDYhL','randomBytes','searchParams','tdx','http://localhost:','close','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','hex','text/plain','code','stg-ap03','json','stg-ap01','status','17460IbPGpE','digest','has','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','set','text/html','redirect_uri','listen','writeHead','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','Not\x20Found','scope','end','error','127.0.0.1','144846MQAxNc','base64url','get','toString','client_id','251504usqJdO','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>'];a61_0x422c=function(){return _0x4a3ca8;};return a61_0x422c();}export function generatePKCEPair(){const _0x434380=a61_0x2d2b4d,_0x552881=a61_0x3ff94b[_0x434380(0x15e)](0x20)[_0x434380(0x17d)]('base64url'),_0x25f06c=a61_0x3ff94b[_0x434380(0x148)](_0x434380(0x156))[_0x434380(0x187)](_0x552881)[_0x434380(0x16c)](_0x434380(0x17b));return{'verifier':_0x552881,'challenge':_0x25f06c};}export function buildAuthorizeURL(_0x13ce65,_0x2d3af5){const _0x52432c=a61_0x2d2b4d,_0x4fedd8=new URL(_0x52432c(0x185),_0x13ce65);return _0x4fedd8[_0x52432c(0x15f)][_0x52432c(0x16f)]('response_type','code'),_0x4fedd8[_0x52432c(0x15f)]['set'](_0x52432c(0x17e),_0x2d3af5[_0x52432c(0x186)]),_0x4fedd8[_0x52432c(0x15f)][_0x52432c(0x16f)](_0x52432c(0x171),_0x2d3af5[_0x52432c(0x182)]),_0x4fedd8[_0x52432c(0x15f)][_0x52432c(0x16f)](_0x52432c(0x14c),_0x2d3af5['state']),_0x4fedd8['searchParams'][_0x52432c(0x16f)]('code_challenge',_0x2d3af5[_0x52432c(0x155)]),_0x4fedd8[_0x52432c(0x15f)][_0x52432c(0x16f)](_0x52432c(0x151),'S256'),_0x2d3af5['scope']&&_0x4fedd8['searchParams'][_0x52432c(0x16f)]('scope',_0x2d3af5[_0x52432c(0x176)]),_0x4fedd8[_0x52432c(0x17d)]();}export async function postTokenRequest(_0x359215,_0x25be36){const _0x26f5c6=a61_0x2d2b4d,_0x36df27=new URLSearchParams(_0x25be36)[_0x26f5c6(0x17d)](),_0x14c5c0=await fetch(_0x359215,{'method':_0x26f5c6(0x159),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x36df27});if(!_0x14c5c0['ok']){const _0x57cb39=await _0x14c5c0[_0x26f5c6(0x15c)]();throw new Error(_0x26f5c6(0x152)+_0x14c5c0[_0x26f5c6(0x16a)]+_0x26f5c6(0x154)+_0x57cb39);}return await _0x14c5c0[_0x26f5c6(0x168)]();}export async function exchangeCodeForTokens(_0x115a2b,_0x4e202d,_0x5f4368,_0x34d5e7){const _0x587a50=a61_0x2d2b4d,_0x1cd876=_0x115a2b+_0x587a50(0x14b);return postTokenRequest(_0x1cd876,{'grant_type':_0x587a50(0x14d),'client_id':getOAuthClientId(),'code':_0x4e202d,'code_verifier':_0x5f4368,'redirect_uri':_0x34d5e7});}export function startLocalCallbackServer(){const _0x2d5882=a61_0x2d2b4d;let _0x2c4b3e,_0x1af558;const _0x2a406d=new Promise((_0x5d1945,_0x3a3b6c)=>{_0x2c4b3e=_0x5d1945,_0x1af558=_0x3a3b6c;}),_0x35e32f=a61_0x1e5f8b[_0x2d5882(0x158)]((_0x6474c0,_0x5143a2)=>{const _0x51d4cb=_0x2d5882,_0x1af658=new URL(_0x6474c0[_0x51d4cb(0x181)]||'/','http://127.0.0.1');if(_0x1af658['pathname']!==_0x51d4cb(0x18a)){_0x5143a2['writeHead'](0x194,{'Content-Type':_0x51d4cb(0x165)}),_0x5143a2['end'](_0x51d4cb(0x175));return;}const _0x37375d=_0x1af658[_0x51d4cb(0x15f)][_0x51d4cb(0x17c)]('code'),_0x88e59c=_0x1af658[_0x51d4cb(0x15f)][_0x51d4cb(0x17c)](_0x51d4cb(0x14c)),_0x1df971=_0x1af658[_0x51d4cb(0x15f)][_0x51d4cb(0x17c)](_0x51d4cb(0x178));if(_0x1df971||!_0x37375d||!_0x88e59c){_0x5143a2[_0x51d4cb(0x173)](0x190,{'Content-Type':'text/html'}),_0x5143a2[_0x51d4cb(0x177)](_0x51d4cb(0x180)),_0x1af558(new Error('OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters'));return;}_0x5143a2[_0x51d4cb(0x173)](0xc8,{'Content-Type':_0x51d4cb(0x170)}),_0x5143a2[_0x51d4cb(0x177)](_0x51d4cb(0x174)),_0x2c4b3e({'code':_0x37375d,'state':_0x88e59c});});_0x35e32f['on'](_0x2d5882(0x178),_0x63cb97=>{const _0x5ceab8=_0x2d5882;_0x63cb97[_0x5ceab8(0x166)]==='EADDRINUSE'?_0x1af558(new Error(_0x5ceab8(0x153)+OAUTH_CALLBACK_PORT+_0x5ceab8(0x163))):_0x1af558(new Error(_0x5ceab8(0x16e)+_0x63cb97[_0x5ceab8(0x149)]));}),_0x35e32f[_0x2d5882(0x172)](OAUTH_CALLBACK_PORT,_0x2d5882(0x179));const _0x8e0a41=setTimeout(()=>{const _0x56adca=_0x2d5882;_0x1af558(new Error(_0x56adca(0x14e))),_0x35e32f[_0x56adca(0x162)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x2a406d,'close':()=>{const _0x1800ae=_0x2d5882;clearTimeout(_0x8e0a41),_0x35e32f[_0x1800ae(0x162)]();}};}export async function startOAuthFlow(_0x150aa5){const _0x1de212=a61_0x2d2b4d,_0x3c7f57=getConsoleUrl(_0x150aa5),_0x2a646b=getOAuthClientId(),{verifier:_0x37b8d8,challenge:_0x139324}=generatePKCEPair(),_0x444fb6=a61_0x3ff94b[_0x1de212(0x15e)](0x10)['toString'](_0x1de212(0x164)),_0xecf560=startLocalCallbackServer();try{const _0x43ed31=OAUTH_REDIRECT_URI,_0x4b39a6=buildAuthorizeURL(_0x3c7f57,{'clientId':_0x2a646b,'redirectUri':_0x43ed31,'state':_0x444fb6,'codeChallenge':_0x139324});openBrowser(_0x4b39a6);const _0x4b1ac0=await _0xecf560[_0x1de212(0x147)]();if(_0x4b1ac0[_0x1de212(0x14c)]!==_0x444fb6)throw new Error(_0x1de212(0x14f));return await exchangeCodeForTokens(_0x3c7f57,_0x4b1ac0['code'],_0x37b8d8,_0x43ed31);}finally{_0xecf560['close']();}}
1
+ const a61_0x445eac=a61_0xd51c;(function(_0x5951ba,_0xbe8388){const _0xe933f5=a61_0xd51c,_0x6f016e=_0x5951ba();while(!![]){try{const _0x38fa49=-parseInt(_0xe933f5(0x1a8))/0x1+-parseInt(_0xe933f5(0x1b9))/0x2*(-parseInt(_0xe933f5(0x1d8))/0x3)+-parseInt(_0xe933f5(0x1c4))/0x4*(parseInt(_0xe933f5(0x1aa))/0x5)+parseInt(_0xe933f5(0x1ba))/0x6*(parseInt(_0xe933f5(0x1b3))/0x7)+-parseInt(_0xe933f5(0x1a3))/0x8+-parseInt(_0xe933f5(0x1cb))/0x9+-parseInt(_0xe933f5(0x1d2))/0xa;if(_0x38fa49===_0xbe8388)break;else _0x6f016e['push'](_0x6f016e['shift']());}catch(_0x1a102d){_0x6f016e['push'](_0x6f016e['shift']());}}}(a61_0xa6e2,0x85b0c));import*as a61_0x50a467 from'node:crypto';function a61_0xa6e2(){const _0x3451cc=['<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','end','get','127.0.0.1','/oauth/token','client_id','state','toString','response_type','8xwledo','set','hex','error','redirectUri','text','searchParams','1107018BeCTGk','createHash','pathname','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','digest','application/x-www-form-urlencoded','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','2085030XGkEuH','close','/oauth/authorize','base64url','message','dev-eu01','807oAiFaM','update','randomBytes','stg-ap01','/oauth/callback','scope','EADDRINUSE','writeHead','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','status','json','2974400jbCZfk','):\x20','POST','text/html','sha256','358401acbhnf','text/plain','1286255BLYBDN','Port\x20','OAuth\x20token\x20request\x20failed\x20(','has','code','waitForCallback','stg-ap03','tdx','http://127.0.0.1','1829891qSzNVB','Not\x20Found','stg-us01','redirect_uri','codeChallenge','code_challenge_method','8016wrprYY','24ItyLdT'];a61_0xa6e2=function(){return _0x3451cc;};return a61_0xa6e2();}import*as a61_0x529dea from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set(['dev-us01',a61_0x445eac(0x1d7),a61_0x445eac(0x1b5),a61_0x445eac(0x19b),a61_0x445eac(0x1b0)]);export function isOAuthSupported(_0x58d7a0){const _0x37e8e7=a61_0x445eac;return OAUTH_SUPPORTED_SITES[_0x37e8e7(0x1ad)](_0x58d7a0);}function a61_0xd51c(_0x404d73,_0x7647fa){_0x404d73=_0x404d73-0x19b;const _0xa6e253=a61_0xa6e2();let _0xd51cd0=_0xa6e253[_0x404d73];return _0xd51cd0;}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI='http://localhost:'+OAUTH_CALLBACK_PORT+a61_0x445eac(0x19c);export function getOAuthClientId(){const _0x1e3e76=a61_0x445eac;return process.env.TD_OAUTH_CLIENT_ID||_0x1e3e76(0x1b1);}export function generatePKCEPair(){const _0x992972=a61_0x445eac,_0x3a0163=a61_0x50a467[_0x992972(0x1da)](0x20)[_0x992972(0x1c2)](_0x992972(0x1d5)),_0x28026c=a61_0x50a467[_0x992972(0x1cc)](_0x992972(0x1a7))[_0x992972(0x1d9)](_0x3a0163)[_0x992972(0x1cf)](_0x992972(0x1d5));return{'verifier':_0x3a0163,'challenge':_0x28026c};}export function buildAuthorizeURL(_0x15db07,_0x30e3c1){const _0x4588f7=a61_0x445eac,_0x49573a=new URL(_0x4588f7(0x1d4),_0x15db07);return _0x49573a[_0x4588f7(0x1ca)][_0x4588f7(0x1c5)](_0x4588f7(0x1c3),_0x4588f7(0x1ae)),_0x49573a[_0x4588f7(0x1ca)][_0x4588f7(0x1c5)](_0x4588f7(0x1c0),_0x30e3c1['clientId']),_0x49573a[_0x4588f7(0x1ca)][_0x4588f7(0x1c5)](_0x4588f7(0x1b6),_0x30e3c1[_0x4588f7(0x1c8)]),_0x49573a[_0x4588f7(0x1ca)][_0x4588f7(0x1c5)](_0x4588f7(0x1c1),_0x30e3c1[_0x4588f7(0x1c1)]),_0x49573a[_0x4588f7(0x1ca)][_0x4588f7(0x1c5)]('code_challenge',_0x30e3c1[_0x4588f7(0x1b7)]),_0x49573a['searchParams'][_0x4588f7(0x1c5)](_0x4588f7(0x1b8),'S256'),_0x30e3c1['scope']&&_0x49573a['searchParams'][_0x4588f7(0x1c5)]('scope',_0x30e3c1[_0x4588f7(0x19d)]),_0x49573a[_0x4588f7(0x1c2)]();}export async function postTokenRequest(_0xf5565c,_0x4b8652){const _0x58c579=a61_0x445eac,_0x2937f5=new URLSearchParams(_0x4b8652)['toString'](),_0x412280=await fetch(_0xf5565c,{'method':_0x58c579(0x1a5),'headers':{'Content-Type':_0x58c579(0x1d0)},'body':_0x2937f5});if(!_0x412280['ok']){const _0x5a67d0=await _0x412280[_0x58c579(0x1c9)]();throw new Error(_0x58c579(0x1ac)+_0x412280[_0x58c579(0x1a1)]+_0x58c579(0x1a4)+_0x5a67d0);}return await _0x412280[_0x58c579(0x1a2)]();}export async function exchangeCodeForTokens(_0x13d61e,_0x39501b,_0x2bc3ea,_0x369801){const _0x1e5b82=a61_0x445eac,_0x373c85=_0x13d61e+_0x1e5b82(0x1bf);return postTokenRequest(_0x373c85,{'grant_type':'authorization_code','client_id':getOAuthClientId(),'code':_0x39501b,'code_verifier':_0x2bc3ea,'redirect_uri':_0x369801});}export function startLocalCallbackServer(){const _0x1a184f=a61_0x445eac;let _0x344b09,_0x1746ab;const _0x5b891f=new Promise((_0x3f8373,_0x4fa520)=>{_0x344b09=_0x3f8373,_0x1746ab=_0x4fa520;}),_0x4fee65=a61_0x529dea['createServer']((_0x173a5a,_0x340e03)=>{const _0x258c7c=a61_0xd51c,_0x229b5e=new URL(_0x173a5a['url']||'/',_0x258c7c(0x1b2));if(_0x229b5e[_0x258c7c(0x1cd)]!==_0x258c7c(0x19c)){_0x340e03[_0x258c7c(0x19f)](0x194,{'Content-Type':_0x258c7c(0x1a9)}),_0x340e03['end'](_0x258c7c(0x1b4));return;}const _0x495717=_0x229b5e[_0x258c7c(0x1ca)][_0x258c7c(0x1bd)](_0x258c7c(0x1ae)),_0x2e5d6e=_0x229b5e[_0x258c7c(0x1ca)]['get']('state'),_0x12b4bc=_0x229b5e[_0x258c7c(0x1ca)]['get'](_0x258c7c(0x1c7));if(_0x12b4bc||!_0x495717||!_0x2e5d6e){_0x340e03['writeHead'](0x190,{'Content-Type':_0x258c7c(0x1a6)}),_0x340e03[_0x258c7c(0x1bc)](_0x258c7c(0x1a0)),_0x1746ab(new Error('OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters'));return;}_0x340e03[_0x258c7c(0x19f)](0xc8,{'Content-Type':'text/html'}),_0x340e03['end'](_0x258c7c(0x1bb)),_0x344b09({'code':_0x495717,'state':_0x2e5d6e});});_0x4fee65['on']('error',_0x27c689=>{const _0x254ede=a61_0xd51c;_0x27c689[_0x254ede(0x1ae)]===_0x254ede(0x19e)?_0x1746ab(new Error(_0x254ede(0x1ab)+OAUTH_CALLBACK_PORT+'\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.')):_0x1746ab(new Error(_0x254ede(0x1ce)+_0x27c689[_0x254ede(0x1d6)]));}),_0x4fee65['listen'](OAUTH_CALLBACK_PORT,_0x1a184f(0x1be));const _0x22743d=setTimeout(()=>{const _0x489c6b=_0x1a184f;_0x1746ab(new Error(_0x489c6b(0x1d1))),_0x4fee65[_0x489c6b(0x1d3)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x5b891f,'close':()=>{const _0x4dc930=_0x1a184f;clearTimeout(_0x22743d),_0x4fee65[_0x4dc930(0x1d3)]();}};}export async function startOAuthFlow(_0x53f32e){const _0xbe7b18=a61_0x445eac,_0x20be03=getConsoleUrl(_0x53f32e),_0x3ba1ba=getOAuthClientId(),{verifier:_0x5e557b,challenge:_0x17660a}=generatePKCEPair(),_0xf39afe=a61_0x50a467[_0xbe7b18(0x1da)](0x10)[_0xbe7b18(0x1c2)](_0xbe7b18(0x1c6)),_0x2f08e9=startLocalCallbackServer();try{const _0x2ee153=OAUTH_REDIRECT_URI,_0x8b94e7=buildAuthorizeURL(_0x20be03,{'clientId':_0x3ba1ba,'redirectUri':_0x2ee153,'state':_0xf39afe,'codeChallenge':_0x17660a});openBrowser(_0x8b94e7);const _0x206363=await _0x2f08e9[_0xbe7b18(0x1af)]();if(_0x206363[_0xbe7b18(0x1c1)]!==_0xf39afe)throw new Error('OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack');return await exchangeCodeForTokens(_0x20be03,_0x206363[_0xbe7b18(0x1ae)],_0x5e557b,_0x2ee153);}finally{_0x2f08e9[_0xbe7b18(0x1d3)]();}}
@@ -1 +1 @@
1
- const a62_0x353bfd=a62_0x3624;(function(_0x12433d,_0x16a6f5){const _0x81ed26=a62_0x3624,_0x2e2943=_0x12433d();while(!![]){try{const _0x5aefc4=parseInt(_0x81ed26(0x185))/0x1*(-parseInt(_0x81ed26(0x19e))/0x2)+parseInt(_0x81ed26(0x1a3))/0x3*(parseInt(_0x81ed26(0x17f))/0x4)+-parseInt(_0x81ed26(0x175))/0x5+-parseInt(_0x81ed26(0x189))/0x6+parseInt(_0x81ed26(0x1b4))/0x7*(-parseInt(_0x81ed26(0x1ba))/0x8)+parseInt(_0x81ed26(0x169))/0x9*(parseInt(_0x81ed26(0x186))/0xa)+-parseInt(_0x81ed26(0x179))/0xb*(-parseInt(_0x81ed26(0x1a0))/0xc);if(_0x5aefc4===_0x16a6f5)break;else _0x2e2943['push'](_0x2e2943['shift']());}catch(_0x4bf752){_0x2e2943['push'](_0x2e2943['shift']());}}}(a62_0x6d33,0x1a848));import*as a62_0x1fdf5e from'node:fs';function a62_0x3624(_0x41a91f,_0x1713d8){_0x41a91f=_0x41a91f-0x166;const _0x6d337d=a62_0x6d33();let _0x362416=_0x6d337d[_0x41a91f];return _0x362416;}import*as a62_0x89aedd from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME=a62_0x353bfd(0x1ac);export function getProfileParams(_0x156988){const _0x1ac459={};if(!_0x156988)return _0x1ac459;for(const [_0x575759,_0x24ffd4]of Object['entries'](_0x156988)){_0x575759!=='description'&&_0x24ffd4!==undefined&&(_0x1ac459[_0x575759]=_0x24ffd4);}return _0x1ac459;}export function getProfilesDir(){const _0xb9d648=a62_0x353bfd;return a62_0x89aedd[_0xb9d648(0x1ad)](getConfigDir(),_0xb9d648(0x183));}function getProfileDir(_0x21edd4){const _0xe2511=a62_0x353bfd;return a62_0x89aedd[_0xe2511(0x1ad)](getProfilesDir(),_0x21edd4);}function getProfileConfigPath(_0x508482){const _0x579bcd=a62_0x353bfd;return a62_0x89aedd['join'](getProfileDir(_0x508482),_0x579bcd(0x199));}function getProfileEnvPath(_0x293cf9){const _0x2de2b3=a62_0x353bfd;return a62_0x89aedd[_0x2de2b3(0x1ad)](getProfileDir(_0x293cf9),_0x2de2b3(0x1b6));}function getGlobalConfigPath(){const _0x3d4595=a62_0x353bfd;return a62_0x89aedd[_0x3d4595(0x1ad)](getConfigDir(),'tdx.json');}function validateProfileName(_0x24b280){const _0x3bb00d=a62_0x353bfd;if(/^@?[a-zA-Z0-9_-]+$/['test'](_0x24b280))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x3bb00d(0x19b)](_0x24b280))return;throw new Error(_0x3bb00d(0x1b3)+_0x24b280+_0x3bb00d(0x1a1));}function validateProfileConfig(_0x4c6378,_0x26cb9a){const _0x1aef9a=a62_0x353bfd;if(typeof _0x4c6378!=='object'||_0x4c6378===null)throw new SDKError(ErrorCode[_0x1aef9a(0x17d)],_0x1aef9a(0x177)+_0x26cb9a+_0x1aef9a(0x184));const _0x25916d=[_0x1aef9a(0x196),_0x1aef9a(0x173),_0x1aef9a(0x16e),_0x1aef9a(0x18f),'llm_project',_0x1aef9a(0x1a8),_0x1aef9a(0x19f)],_0x560c44=_0x4c6378;for(const _0xadf5df of Object[_0x1aef9a(0x1b0)](_0x560c44)){!_0x25916d[_0x1aef9a(0x188)](_0xadf5df)&&console[_0x1aef9a(0x17b)](_0x1aef9a(0x19a)+_0x26cb9a+_0x1aef9a(0x197)+_0xadf5df+_0x1aef9a(0x1ae));}if(_0x560c44[_0x1aef9a(0x196)]!==undefined&&typeof _0x560c44['description']!=='string')throw new SDKError(ErrorCode[_0x1aef9a(0x17d)],_0x1aef9a(0x177)+_0x26cb9a+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x560c44['site']!==undefined&&typeof _0x560c44[_0x1aef9a(0x173)]!==_0x1aef9a(0x1a4))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x26cb9a+_0x1aef9a(0x174));if(_0x560c44[_0x1aef9a(0x16e)]!==undefined&&typeof _0x560c44['database']!=='string')throw new SDKError(ErrorCode[_0x1aef9a(0x17d)],_0x1aef9a(0x177)+_0x26cb9a+_0x1aef9a(0x1a2));if(_0x560c44[_0x1aef9a(0x18f)]!==undefined&&typeof _0x560c44[_0x1aef9a(0x18f)]!==_0x1aef9a(0x1a4))throw new SDKError(ErrorCode[_0x1aef9a(0x17d)],_0x1aef9a(0x177)+_0x26cb9a+_0x1aef9a(0x170));if(_0x560c44[_0x1aef9a(0x16b)]!==undefined&&typeof _0x560c44[_0x1aef9a(0x16b)]!==_0x1aef9a(0x1a4))throw new SDKError(ErrorCode[_0x1aef9a(0x17d)],'Profile\x20\x27'+_0x26cb9a+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x560c44[_0x1aef9a(0x1a8)]!==undefined&&typeof _0x560c44[_0x1aef9a(0x1a8)]!==_0x1aef9a(0x1a4))throw new SDKError(ErrorCode[_0x1aef9a(0x17d)],'Profile\x20\x27'+_0x26cb9a+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0x27cc36,_0x4584c3){const _0x559253=a62_0x353bfd;if(!a62_0x1fdf5e[_0x559253(0x1b5)](_0x27cc36))return[];try{const _0x26673a=a62_0x1fdf5e[_0x559253(0x168)](_0x27cc36,_0x559253(0x182)),_0x2e7092=JSON[_0x559253(0x1b8)](_0x26673a);if(!_0x2e7092[_0x559253(0x183)]||typeof _0x2e7092[_0x559253(0x183)]!==_0x559253(0x1af))return[];const _0x13a322=[];for(const [_0x163c40,_0x21b0d8]of Object[_0x559253(0x181)](_0x2e7092[_0x559253(0x183)])){try{validateProfileConfig(_0x21b0d8,_0x163c40);const _0x2fd8a7=getNewCredentialPath(_0x163c40),_0x807c63=getOldCredentialPath(_0x163c40),_0x264f31=a62_0x1fdf5e[_0x559253(0x1b5)](_0x2fd8a7)||a62_0x1fdf5e[_0x559253(0x1b5)](_0x807c63);_0x13a322[_0x559253(0x16c)]({'name':_0x163c40,'config':_0x21b0d8,'metadata':{'name':_0x163c40,'createdAt':new Date()[_0x559253(0x16d)]()},'hasCredentials':_0x264f31,'scope':_0x4584c3});}catch(_0x41ebd0){_0x41ebd0 instanceof Error&&(console['warn'](_0x559253(0x171)+_0x27cc36+':'),console['warn']('\x20\x20'+_0x41ebd0[_0x559253(0x1b1)]+'\x0a'));}}return _0x13a322;}catch(_0x2866b5){return _0x2866b5 instanceof SyntaxError?(console['warn'](_0x559253(0x190)+_0x27cc36+_0x559253(0x1b9)),console['warn'](_0x559253(0x18e)+_0x2866b5['message']+'\x0a')):console[_0x559253(0x17b)]('\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20'+_0x27cc36+':\x20'+_0x2866b5+'\x0a'),[];}}export function getNewCredentialPath(_0x4513be){const _0x2e115e=a62_0x353bfd;return a62_0x89aedd[_0x2e115e(0x1ad)](getConfigDir(),_0x2e115e(0x18c)+_0x4513be);}function getOldCredentialPath(_0x56b25f){const _0x23acc1=a62_0x353bfd;return a62_0x89aedd[_0x23acc1(0x1ad)](getProfilesDir(),_0x56b25f,_0x23acc1(0x1b6));}function loadProfilesFromTdxJsonFiles(){const _0x272934=a62_0x353bfd,_0x351c61=[],_0x77525d=findProjectConfigPath();_0x77525d&&_0x351c61['push'](...loadProfilesFromTdxJson(_0x77525d,_0x272934(0x198)));const _0x4c36f5=a62_0x89aedd[_0x272934(0x1ad)](getConfigDir(),_0x272934(0x199));return _0x351c61[_0x272934(0x16c)](...loadProfilesFromTdxJson(_0x4c36f5,_0x272934(0x193))),_0x351c61;}function loadProfilesFromDirectories(){const _0x5260f3=a62_0x353bfd,_0x468aa5=getProfilesDir();if(!a62_0x1fdf5e['existsSync'](_0x468aa5))return[];try{return a62_0x1fdf5e[_0x5260f3(0x17a)](_0x468aa5,{'withFileTypes':!![]})[_0x5260f3(0x1a7)](_0x180100=>_0x180100['isDirectory']())[_0x5260f3(0x1a5)](_0x2185a7=>_0x2185a7[_0x5260f3(0x1aa)])[_0x5260f3(0x1a7)](_0x508767=>{const _0x205441=_0x5260f3,_0x8a789f=getProfileConfigPath(_0x508767),_0x3d6ec5=getProfileEnvPath(_0x508767);return a62_0x1fdf5e['existsSync'](_0x8a789f)||a62_0x1fdf5e[_0x205441(0x1b5)](_0x3d6ec5);})[_0x5260f3(0x1a5)](_0x193342=>{const _0x32fb40=_0x5260f3,_0x11ccfd=loadProfileFromDirectory(_0x193342);if(_0x11ccfd)return{..._0x11ccfd,'scope':_0x32fb40(0x172)};return null;})[_0x5260f3(0x1a7)](_0x2fc085=>_0x2fc085!==null);}catch{return[];}}function loadProfileFromDirectory(_0x540b37){const _0x5d6d79=a62_0x353bfd,_0x123d0d=getProfileConfigPath(_0x540b37),_0x3a23b0=getOldCredentialPath(_0x540b37);if(!a62_0x1fdf5e[_0x5d6d79(0x1b5)](_0x123d0d)&&!a62_0x1fdf5e[_0x5d6d79(0x1b5)](_0x3a23b0))return null;let _0xb01634={},_0x3bf553={'name':_0x540b37,'createdAt':new Date()[_0x5d6d79(0x16d)]()};if(a62_0x1fdf5e['existsSync'](_0x123d0d))try{const _0x2ae914=a62_0x1fdf5e['readFileSync'](_0x123d0d,_0x5d6d79(0x182)),_0x50dea1=JSON[_0x5d6d79(0x1b8)](_0x2ae914),{metadata:_0x21eaf7,..._0x4b0ae3}=_0x50dea1;_0xb01634=_0x4b0ae3,_0x21eaf7&&(_0x3bf553=_0x21eaf7);}catch{}return{'name':_0x540b37,'config':_0xb01634,'metadata':_0x3bf553,'hasCredentials':a62_0x1fdf5e[_0x5d6d79(0x1b5)](_0x3a23b0),'scope':_0x5d6d79(0x172)};}export function listProfiles(){const _0x4fa8d1=a62_0x353bfd,_0x5978dd=loadProfilesFromTdxJsonFiles(),_0x8c5c7d=loadProfilesFromDirectories();if(_0x8c5c7d['length']>0x0){const _0x5b928e=_0x8c5c7d[_0x4fa8d1(0x1a5)](_0x15f165=>_0x15f165[_0x4fa8d1(0x1aa)])[_0x4fa8d1(0x1ad)](',\x20'),_0x453b4f=getConfigDir();console[_0x4fa8d1(0x17b)]('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x5b928e),console[_0x4fa8d1(0x17b)](_0x4fa8d1(0x18a)),console[_0x4fa8d1(0x17b)](_0x4fa8d1(0x1a9)+a62_0x89aedd[_0x4fa8d1(0x1ad)](_0x453b4f,'tdx.json')),console[_0x4fa8d1(0x17b)]('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x4fa8d1(0x17b)](_0x4fa8d1(0x16f));}const _0x1eb76d=[..._0x5978dd,..._0x8c5c7d],_0x2a337d=new Map();for(const _0x5d4b77 of _0x1eb76d){!_0x2a337d[_0x4fa8d1(0x19c)](_0x5d4b77[_0x4fa8d1(0x1aa)])&&_0x2a337d['set'](_0x5d4b77[_0x4fa8d1(0x1aa)],_0x5d4b77);}return Array[_0x4fa8d1(0x191)](_0x2a337d[_0x4fa8d1(0x178)]())[_0x4fa8d1(0x176)]((_0x4dec93,_0x36e241)=>_0x4dec93[_0x4fa8d1(0x1aa)][_0x4fa8d1(0x17c)](_0x36e241['name']));}export function profileExists(_0x554d8d){const _0x5748ef=a62_0x353bfd,_0x36e6d7=listProfiles();return _0x36e6d7[_0x5748ef(0x1b7)](_0x53455d=>_0x53455d[_0x5748ef(0x1aa)]===_0x554d8d);}export function loadProfile(_0x53007c){const _0x3e144d=a62_0x353bfd;validateProfileName(_0x53007c);const _0x11a6c3=listProfiles(),_0x4de206=_0x11a6c3[_0x3e144d(0x16a)](_0x2b5be8=>_0x2b5be8['name']===_0x53007c);return _0x4de206||null;}export function saveProfile(_0x11ae21,_0xca99e6,_0x55375c=![]){saveProfileToUserConfig(_0x11ae21,_0xca99e6);}export function deleteProfile(_0x5c22ee){const _0x15241f=a62_0x353bfd;validateProfileName(_0x5c22ee);const _0x5f0805=getProfileDir(_0x5c22ee);if(!a62_0x1fdf5e['existsSync'](_0x5f0805))throw new Error('Profile\x20'+_0x5c22ee+_0x15241f(0x167));a62_0x1fdf5e[_0x15241f(0x194)](_0x5f0805,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x355958,_0x6d60b0){const _0x4053e5=a62_0x353bfd;validateProfileName(_0x355958);const _0x51385f=getGlobalConfigPath(),_0x44eebe=getConfigDir();!a62_0x1fdf5e[_0x4053e5(0x1b5)](_0x44eebe)&&createSecureDirectory(_0x44eebe);let _0x416939={};if(a62_0x1fdf5e[_0x4053e5(0x1b5)](_0x51385f))try{const _0x5ac554=a62_0x1fdf5e[_0x4053e5(0x168)](_0x51385f,_0x4053e5(0x182));_0x416939=JSON[_0x4053e5(0x1b8)](_0x5ac554);}catch{console[_0x4053e5(0x17b)](_0x4053e5(0x195)+_0x51385f+',\x20creating\x20new\x20file');}!_0x416939[_0x4053e5(0x183)]&&(_0x416939[_0x4053e5(0x183)]={}),_0x416939[_0x4053e5(0x183)][_0x355958]=_0x6d60b0,writeSecureFile(_0x51385f,JSON[_0x4053e5(0x18b)](_0x416939,null,0x2));}export function removeProfileFromUserConfig(_0x142503){const _0x5c5be7=a62_0x353bfd;validateProfileName(_0x142503);const _0x393d8b=getGlobalConfigPath();if(!a62_0x1fdf5e['existsSync'](_0x393d8b))throw new Error(_0x5c5be7(0x177)+_0x142503+_0x5c5be7(0x192));let _0x1cb281={};try{const _0x170011=a62_0x1fdf5e[_0x5c5be7(0x168)](_0x393d8b,_0x5c5be7(0x182));_0x1cb281=JSON[_0x5c5be7(0x1b8)](_0x170011);}catch{throw new Error('Failed\x20to\x20parse\x20'+_0x393d8b);}if(!_0x1cb281[_0x5c5be7(0x183)]||!_0x1cb281['profiles'][_0x142503])throw new Error('Profile\x20\x27'+_0x142503+_0x5c5be7(0x192));delete _0x1cb281[_0x5c5be7(0x183)][_0x142503],_0x1cb281[_0x5c5be7(0x1ab)]===_0x142503&&delete _0x1cb281[_0x5c5be7(0x1ab)],writeSecureFile(_0x393d8b,JSON[_0x5c5be7(0x18b)](_0x1cb281,null,0x2));}export function getActiveProfile(){const _0x4dbf19=a62_0x353bfd,_0x590b9d=loadSessionContext();if(_0x590b9d?.['profile'])return _0x590b9d[_0x4dbf19(0x1ab)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x19e8e3=getGlobalConfigPath();if(!a62_0x1fdf5e[_0x4dbf19(0x1b5)](_0x19e8e3))return null;try{const _0x3d0920=a62_0x1fdf5e[_0x4dbf19(0x168)](_0x19e8e3,_0x4dbf19(0x182)),_0x565656=JSON[_0x4dbf19(0x1b8)](_0x3d0920);return _0x565656[_0x4dbf19(0x1ab)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x103fce){const _0x42b934=a62_0x353bfd,_0xccdc7f=getGlobalConfigPath(),_0x385710=getConfigDir();!a62_0x1fdf5e[_0x42b934(0x1b5)](_0x385710)&&createSecureDirectory(_0x385710);let _0x54b175={};if(a62_0x1fdf5e[_0x42b934(0x1b5)](_0xccdc7f))try{const _0xc8f949=a62_0x1fdf5e[_0x42b934(0x168)](_0xccdc7f,'utf-8');_0x54b175=JSON[_0x42b934(0x1b8)](_0xc8f949);}catch{console[_0x42b934(0x17b)](_0x42b934(0x195)+_0xccdc7f+_0x42b934(0x180));}_0x54b175['site']=_0x103fce,writeSecureFile(_0xccdc7f,JSON['stringify'](_0x54b175,null,0x2));}export function saveActiveProfileToUserConfig(_0x415a13){const _0x322130=a62_0x353bfd;validateProfileName(_0x415a13);const _0x256ce9=getGlobalConfigPath(),_0x39d6f1=getConfigDir();!a62_0x1fdf5e[_0x322130(0x1b5)](_0x39d6f1)&&createSecureDirectory(_0x39d6f1);let _0x2cb203={};if(a62_0x1fdf5e[_0x322130(0x1b5)](_0x256ce9))try{const _0x1e1133=a62_0x1fdf5e[_0x322130(0x168)](_0x256ce9,'utf-8');_0x2cb203=JSON['parse'](_0x1e1133);}catch{console[_0x322130(0x17b)](_0x322130(0x195)+_0x256ce9+_0x322130(0x180));}_0x2cb203['profile']=_0x415a13,writeSecureFile(_0x256ce9,JSON['stringify'](_0x2cb203,null,0x2));}function clearFieldFromUserConfig(_0x415d8c){const _0x5cf649=a62_0x353bfd,_0xe35723=getGlobalConfigPath();if(!a62_0x1fdf5e['existsSync'](_0xe35723))return;let _0x5b3255={};try{const _0x5b10ca=a62_0x1fdf5e[_0x5cf649(0x168)](_0xe35723,_0x5cf649(0x182));_0x5b3255=JSON['parse'](_0x5b10ca);}catch{return;}delete _0x5b3255[_0x415d8c],writeSecureFile(_0xe35723,JSON[_0x5cf649(0x18b)](_0x5b3255,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x2643d3=a62_0x353bfd;clearFieldFromUserConfig(_0x2643d3(0x173));}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x52bf57,_0x277d8b){const _0x44561d=a62_0x353bfd;validateProfileName(_0x52bf57);if(profileExists(_0x52bf57))throw new Error('Profile\x20'+_0x52bf57+_0x44561d(0x166));saveProfile(_0x52bf57,_0x277d8b);}export function saveProfileCredentials(_0x2e2397,_0x4a21ba){const _0x66e145=a62_0x353bfd;validateProfileName(_0x2e2397);if(!profileExists(_0x2e2397))throw new Error(_0x66e145(0x18d)+_0x2e2397+_0x66e145(0x167));const _0x164a69=getNewCredentialPath(_0x2e2397);writeSecureFile(_0x164a69,_0x4a21ba);}function a62_0x6d33(){const _0x19e38b=['warn','localeCompare','INVALID_PROFILE_CONFIG','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','64hZaHNe',',\x20creating\x20new\x20file','entries','utf-8','profiles','\x27:\x20config\x20must\x20be\x20an\x20object','1CQBvNf','1130TzDsVi','\x22\x20\x22','includes','619776nRqTRG','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','stringify','.env.','Profile\x20','Error:\x20','parent_segment','\x0aWarning:\x20Failed\x20to\x20parse\x20','from','\x27\x20not\x20found\x20in\x20user\x20configuration','user','rmSync','Warning:\x20Failed\x20to\x20parse\x20','description','\x27:\x20unknown\x20config\x20key\x20\x27','local','tdx.json','Warning:\x20Profile\x20\x27','test','has','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','199458hkpQRu','user_info','12ugHJzk','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','28551qVeQiF','string','map','\x20\x20mv\x20\x22','filter','llm_agent','\x20\x201.\x20Edit:\x20','name','profile','@tdx-studio','join','\x27\x20will\x20be\x20ignored','object','keys','message','To\x20migrate:','Invalid\x20profile\x20name:\x20','7Ycqlfo','existsSync','.env','some','parse',':\x20Invalid\x20JSON\x20syntax','424696tDUUgK','\x20already\x20exists','\x20does\x20not\x20exist','readFileSync','11862CNQeGu','find','llm_project','push','toISOString','database','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','directory','site','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','521915ejDJve','sort','Profile\x20\x27','values','1846955fKODoS','readdirSync'];a62_0x6d33=function(){return _0x19e38b;};return a62_0x6d33();}export function loadProfileCredentials(_0x56ad78){const _0x2d11d8=a62_0x353bfd;validateProfileName(_0x56ad78);const _0x76ba4b=getNewCredentialPath(_0x56ad78);if(a62_0x1fdf5e[_0x2d11d8(0x1b5)](_0x76ba4b))try{return a62_0x1fdf5e[_0x2d11d8(0x168)](_0x76ba4b,'utf-8');}catch{}const _0x63d54f=getOldCredentialPath(_0x56ad78);if(a62_0x1fdf5e[_0x2d11d8(0x1b5)](_0x63d54f)){console['warn'](_0x2d11d8(0x17e)+_0x56ad78+'\x27'),console[_0x2d11d8(0x17b)](_0x2d11d8(0x1b2)),console[_0x2d11d8(0x17b)](_0x2d11d8(0x1a6)+_0x63d54f+_0x2d11d8(0x187)+_0x76ba4b+'\x22'),console[_0x2d11d8(0x17b)](_0x2d11d8(0x19d));try{return a62_0x1fdf5e[_0x2d11d8(0x168)](_0x63d54f,_0x2d11d8(0x182));}catch{return null;}}return null;}
1
+ const a62_0x3bdfa6=a62_0x2092;(function(_0x2f8dd5,_0x334e50){const _0x406ec0=a62_0x2092,_0x15a754=_0x2f8dd5();while(!![]){try{const _0x347233=parseInt(_0x406ec0(0xaa))/0x1+-parseInt(_0x406ec0(0xe8))/0x2*(-parseInt(_0x406ec0(0xc8))/0x3)+parseInt(_0x406ec0(0xb8))/0x4+-parseInt(_0x406ec0(0xec))/0x5+-parseInt(_0x406ec0(0xda))/0x6+-parseInt(_0x406ec0(0xae))/0x7*(parseInt(_0x406ec0(0xa7))/0x8)+parseInt(_0x406ec0(0xea))/0x9;if(_0x347233===_0x334e50)break;else _0x15a754['push'](_0x15a754['shift']());}catch(_0x1c7aff){_0x15a754['push'](_0x15a754['shift']());}}}(a62_0x586b,0x8983b));import*as a62_0x36f609 from'node:fs';import*as a62_0x525965 from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME=a62_0x3bdfa6(0xe9);export function getProfileParams(_0x33f218){const _0x38d1ba=a62_0x3bdfa6,_0x4376b8={};if(!_0x33f218)return _0x4376b8;for(const [_0x1fd545,_0x36c4dc]of Object[_0x38d1ba(0xe4)](_0x33f218)){_0x1fd545!=='description'&&_0x36c4dc!==undefined&&(_0x4376b8[_0x1fd545]=_0x36c4dc);}return _0x4376b8;}export function getProfilesDir(){return a62_0x525965['join'](getConfigDir(),'profiles');}function getProfileDir(_0x1e3208){const _0x387382=a62_0x3bdfa6;return a62_0x525965[_0x387382(0xbe)](getProfilesDir(),_0x1e3208);}function getProfileConfigPath(_0x287471){const _0x2e07c1=a62_0x3bdfa6;return a62_0x525965[_0x2e07c1(0xbe)](getProfileDir(_0x287471),_0x2e07c1(0xcd));}function a62_0x586b(){const _0x582e3f=['3023380iGtEwO','rmSync','llm_agent','set','parse','\x20does\x20not\x20exist','\x22\x20\x22','readdirSync','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','message','\x27\x20not\x20found\x20in\x20user\x20configuration','Error:\x20','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','localeCompare','8VIMaOd','description','.env','591385Mjzvna','\x0aWarning:\x20Failed\x20to\x20parse\x20','Profile\x20','stringify','4207469aGjwGY','local','Warning:\x20Profile\x20\x27','length','Warning:\x20Failed\x20to\x20parse\x20','\x20\x20mv\x20\x22','directory','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','user','profile','754368tdwjUH','isDirectory','site','has','\x20already\x20exists','object','join','readFileSync','utf-8','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','Failed\x20to\x20parse\x20','push','from','test','user_info','INVALID_PROFILE_CONFIG','27wmMobi','existsSync','includes','\x20\x201.\x20Edit:\x20','Profile\x20\x27','tdx.json','toISOString','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20',':\x20Invalid\x20JSON\x20syntax','profiles','sort','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','string','find','.env.','parent_segment','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','map','2179914TECzbZ',',\x20creating\x20new\x20file','\x27:\x20unknown\x20config\x20key\x20\x27','database','name','keys','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','Invalid\x20profile\x20name:\x20','llm_project','values','entries','warn','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','some','20414nEHGlq','@tdx-studio','11344329ZahrxW','filter'];a62_0x586b=function(){return _0x582e3f;};return a62_0x586b();}function getProfileEnvPath(_0xdc46bd){const _0xc7edbc=a62_0x3bdfa6;return a62_0x525965[_0xc7edbc(0xbe)](getProfileDir(_0xdc46bd),'.env');}function getGlobalConfigPath(){const _0x4517c5=a62_0x3bdfa6;return a62_0x525965[_0x4517c5(0xbe)](getConfigDir(),_0x4517c5(0xcd));}function validateProfileName(_0x2e7626){const _0x217815=a62_0x3bdfa6;if(/^@?[a-zA-Z0-9_-]+$/[_0x217815(0xc5)](_0x2e7626))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x217815(0xc5)](_0x2e7626))return;throw new Error(_0x217815(0xe1)+_0x2e7626+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.');}function validateProfileConfig(_0x19b5d1,_0x32fc58){const _0x51600b=a62_0x3bdfa6;if(typeof _0x19b5d1!==_0x51600b(0xbd)||_0x19b5d1===null)throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x51600b(0xcc)+_0x32fc58+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0x569471=[_0x51600b(0xa8),'site',_0x51600b(0xdd),_0x51600b(0xd7),_0x51600b(0xe2),_0x51600b(0x9b),_0x51600b(0xc6)],_0x4b8a4f=_0x19b5d1;for(const _0x5e9f5b of Object[_0x51600b(0xdf)](_0x4b8a4f)){!_0x569471[_0x51600b(0xca)](_0x5e9f5b)&&console[_0x51600b(0xe5)](_0x51600b(0xb0)+_0x32fc58+_0x51600b(0xdc)+_0x5e9f5b+'\x27\x20will\x20be\x20ignored');}if(_0x4b8a4f[_0x51600b(0xa8)]!==undefined&&typeof _0x4b8a4f[_0x51600b(0xa8)]!==_0x51600b(0xd4))throw new SDKError(ErrorCode[_0x51600b(0xc7)],_0x51600b(0xcc)+_0x32fc58+_0x51600b(0xe0));if(_0x4b8a4f[_0x51600b(0xba)]!==undefined&&typeof _0x4b8a4f[_0x51600b(0xba)]!==_0x51600b(0xd4))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x51600b(0xcc)+_0x32fc58+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x4b8a4f[_0x51600b(0xdd)]!==undefined&&typeof _0x4b8a4f[_0x51600b(0xdd)]!=='string')throw new SDKError(ErrorCode[_0x51600b(0xc7)],_0x51600b(0xcc)+_0x32fc58+_0x51600b(0xb5));if(_0x4b8a4f[_0x51600b(0xd7)]!==undefined&&typeof _0x4b8a4f[_0x51600b(0xd7)]!==_0x51600b(0xd4))throw new SDKError(ErrorCode[_0x51600b(0xc7)],_0x51600b(0xcc)+_0x32fc58+_0x51600b(0xe6));if(_0x4b8a4f[_0x51600b(0xe2)]!==undefined&&typeof _0x4b8a4f[_0x51600b(0xe2)]!==_0x51600b(0xd4))throw new SDKError(ErrorCode[_0x51600b(0xc7)],'Profile\x20\x27'+_0x32fc58+_0x51600b(0xd3));if(_0x4b8a4f['llm_agent']!==undefined&&typeof _0x4b8a4f[_0x51600b(0x9b)]!==_0x51600b(0xd4))throw new SDKError(ErrorCode[_0x51600b(0xc7)],_0x51600b(0xcc)+_0x32fc58+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0x3d85c2,_0x86d947){const _0x35441d=a62_0x3bdfa6;if(!a62_0x36f609['existsSync'](_0x3d85c2))return[];try{const _0x56d751=a62_0x36f609['readFileSync'](_0x3d85c2,_0x35441d(0xc0)),_0x49c401=JSON['parse'](_0x56d751);if(!_0x49c401[_0x35441d(0xd1)]||typeof _0x49c401['profiles']!==_0x35441d(0xbd))return[];const _0x131a4d=[];for(const [_0x59da5f,_0x29d89d]of Object[_0x35441d(0xe4)](_0x49c401['profiles'])){try{validateProfileConfig(_0x29d89d,_0x59da5f);const _0x25573e=getNewCredentialPath(_0x59da5f),_0x59c3f1=getOldCredentialPath(_0x59da5f),_0x2458a8=a62_0x36f609[_0x35441d(0xc9)](_0x25573e)||a62_0x36f609[_0x35441d(0xc9)](_0x59c3f1);_0x131a4d[_0x35441d(0xc3)]({'name':_0x59da5f,'config':_0x29d89d,'metadata':{'name':_0x59da5f,'createdAt':new Date()[_0x35441d(0xce)]()},'hasCredentials':_0x2458a8,'scope':_0x86d947});}catch(_0x572260){_0x572260 instanceof Error&&(console[_0x35441d(0xe5)](_0x35441d(0xa5)+_0x3d85c2+':'),console[_0x35441d(0xe5)]('\x20\x20'+_0x572260['message']+'\x0a'));}}return _0x131a4d;}catch(_0x455577){return _0x455577 instanceof SyntaxError?(console['warn'](_0x35441d(0xab)+_0x3d85c2+_0x35441d(0xd0)),console[_0x35441d(0xe5)](_0x35441d(0xa4)+_0x455577[_0x35441d(0xa2)]+'\x0a')):console[_0x35441d(0xe5)](_0x35441d(0xc1)+_0x3d85c2+':\x20'+_0x455577+'\x0a'),[];}}export function getNewCredentialPath(_0xf4a48b){const _0x29d6e4=a62_0x3bdfa6;return a62_0x525965['join'](getConfigDir(),_0x29d6e4(0xd6)+_0xf4a48b);}function getOldCredentialPath(_0xadac41){const _0x183cfb=a62_0x3bdfa6;return a62_0x525965['join'](getProfilesDir(),_0xadac41,_0x183cfb(0xa9));}function loadProfilesFromTdxJsonFiles(){const _0x20f4af=a62_0x3bdfa6,_0x3f03de=[],_0x581986=findProjectConfigPath();_0x581986&&_0x3f03de[_0x20f4af(0xc3)](...loadProfilesFromTdxJson(_0x581986,_0x20f4af(0xaf)));const _0x2416d9=a62_0x525965[_0x20f4af(0xbe)](getConfigDir(),_0x20f4af(0xcd));return _0x3f03de[_0x20f4af(0xc3)](...loadProfilesFromTdxJson(_0x2416d9,_0x20f4af(0xb6))),_0x3f03de;}function loadProfilesFromDirectories(){const _0x509424=a62_0x3bdfa6,_0x9b33a9=getProfilesDir();if(!a62_0x36f609[_0x509424(0xc9)](_0x9b33a9))return[];try{return a62_0x36f609[_0x509424(0xa0)](_0x9b33a9,{'withFileTypes':!![]})[_0x509424(0xeb)](_0x84e359=>_0x84e359[_0x509424(0xb9)]())[_0x509424(0xd9)](_0x3544b3=>_0x3544b3[_0x509424(0xde)])[_0x509424(0xeb)](_0x29fec7=>{const _0xf0cb0b=_0x509424,_0x1810ae=getProfileConfigPath(_0x29fec7),_0x541b6f=getProfileEnvPath(_0x29fec7);return a62_0x36f609['existsSync'](_0x1810ae)||a62_0x36f609[_0xf0cb0b(0xc9)](_0x541b6f);})[_0x509424(0xd9)](_0x5b2ea7=>{const _0x3e6256=loadProfileFromDirectory(_0x5b2ea7);if(_0x3e6256)return{..._0x3e6256,'scope':'directory'};return null;})[_0x509424(0xeb)](_0x5516a0=>_0x5516a0!==null);}catch{return[];}}function loadProfileFromDirectory(_0x2912c1){const _0x77a26=a62_0x3bdfa6,_0x4a1084=getProfileConfigPath(_0x2912c1),_0x5f2f03=getOldCredentialPath(_0x2912c1);if(!a62_0x36f609[_0x77a26(0xc9)](_0x4a1084)&&!a62_0x36f609[_0x77a26(0xc9)](_0x5f2f03))return null;let _0x24bf82={},_0x40fa1d={'name':_0x2912c1,'createdAt':new Date()[_0x77a26(0xce)]()};if(a62_0x36f609[_0x77a26(0xc9)](_0x4a1084))try{const _0x730c13=a62_0x36f609['readFileSync'](_0x4a1084,_0x77a26(0xc0)),_0xae7f3e=JSON[_0x77a26(0x9d)](_0x730c13),{metadata:_0x5b2f4b,..._0x4e048a}=_0xae7f3e;_0x24bf82=_0x4e048a,_0x5b2f4b&&(_0x40fa1d=_0x5b2f4b);}catch{}return{'name':_0x2912c1,'config':_0x24bf82,'metadata':_0x40fa1d,'hasCredentials':a62_0x36f609[_0x77a26(0xc9)](_0x5f2f03),'scope':_0x77a26(0xb4)};}export function listProfiles(){const _0xe678c8=a62_0x3bdfa6,_0x56197a=loadProfilesFromTdxJsonFiles(),_0x501687=loadProfilesFromDirectories();if(_0x501687[_0xe678c8(0xb1)]>0x0){const _0x3ba0e6=_0x501687['map'](_0x10175c=>_0x10175c[_0xe678c8(0xde)])[_0xe678c8(0xbe)](',\x20'),_0x1f99f7=getConfigDir();console[_0xe678c8(0xe5)](_0xe678c8(0xcf)+_0x3ba0e6),console[_0xe678c8(0xe5)](_0xe678c8(0xa1)),console[_0xe678c8(0xe5)](_0xe678c8(0xcb)+a62_0x525965['join'](_0x1f99f7,_0xe678c8(0xcd))),console[_0xe678c8(0xe5)](_0xe678c8(0xd8)),console[_0xe678c8(0xe5)]('\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a');}const _0x1c37f8=[..._0x56197a,..._0x501687],_0x30e9ae=new Map();for(const _0x1aeaa3 of _0x1c37f8){!_0x30e9ae[_0xe678c8(0xbb)](_0x1aeaa3[_0xe678c8(0xde)])&&_0x30e9ae[_0xe678c8(0x9c)](_0x1aeaa3['name'],_0x1aeaa3);}return Array[_0xe678c8(0xc4)](_0x30e9ae[_0xe678c8(0xe3)]())[_0xe678c8(0xd2)]((_0x509c3b,_0x5c76b1)=>_0x509c3b['name'][_0xe678c8(0xa6)](_0x5c76b1['name']));}export function profileExists(_0x4295dc){const _0x435781=a62_0x3bdfa6,_0x41574c=listProfiles();return _0x41574c[_0x435781(0xe7)](_0xba67c2=>_0xba67c2[_0x435781(0xde)]===_0x4295dc);}export function loadProfile(_0x520e26){const _0x19bcb0=a62_0x3bdfa6;validateProfileName(_0x520e26);const _0x3ada47=listProfiles(),_0x3912ff=_0x3ada47[_0x19bcb0(0xd5)](_0xe7021=>_0xe7021[_0x19bcb0(0xde)]===_0x520e26);return _0x3912ff||null;}export function saveProfile(_0x4a3abf,_0x4db229,_0x147e77=![]){saveProfileToUserConfig(_0x4a3abf,_0x4db229);}export function deleteProfile(_0x9727b5){const _0x538688=a62_0x3bdfa6;validateProfileName(_0x9727b5);const _0x4ed80c=getProfileDir(_0x9727b5);if(!a62_0x36f609[_0x538688(0xc9)](_0x4ed80c))throw new Error(_0x538688(0xac)+_0x9727b5+_0x538688(0x9e));a62_0x36f609[_0x538688(0x9a)](_0x4ed80c,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x3fd098,_0x5af727){const _0x5054ad=a62_0x3bdfa6;validateProfileName(_0x3fd098);const _0xda3434=getGlobalConfigPath(),_0x55d61e=getConfigDir();!a62_0x36f609[_0x5054ad(0xc9)](_0x55d61e)&&createSecureDirectory(_0x55d61e);let _0x364e0c={};if(a62_0x36f609[_0x5054ad(0xc9)](_0xda3434))try{const _0x202623=a62_0x36f609[_0x5054ad(0xbf)](_0xda3434,_0x5054ad(0xc0));_0x364e0c=JSON[_0x5054ad(0x9d)](_0x202623);}catch{console['warn'](_0x5054ad(0xb2)+_0xda3434+_0x5054ad(0xdb));}!_0x364e0c[_0x5054ad(0xd1)]&&(_0x364e0c[_0x5054ad(0xd1)]={}),_0x364e0c[_0x5054ad(0xd1)][_0x3fd098]=_0x5af727,writeSecureFile(_0xda3434,JSON[_0x5054ad(0xad)](_0x364e0c,null,0x2));}export function removeProfileFromUserConfig(_0x4a919c){const _0xa91060=a62_0x3bdfa6;validateProfileName(_0x4a919c);const _0x54b924=getGlobalConfigPath();if(!a62_0x36f609[_0xa91060(0xc9)](_0x54b924))throw new Error(_0xa91060(0xcc)+_0x4a919c+'\x27\x20not\x20found\x20in\x20user\x20configuration');let _0x1b9488={};try{const _0x4cf41a=a62_0x36f609[_0xa91060(0xbf)](_0x54b924,_0xa91060(0xc0));_0x1b9488=JSON[_0xa91060(0x9d)](_0x4cf41a);}catch{throw new Error(_0xa91060(0xc2)+_0x54b924);}if(!_0x1b9488[_0xa91060(0xd1)]||!_0x1b9488[_0xa91060(0xd1)][_0x4a919c])throw new Error(_0xa91060(0xcc)+_0x4a919c+_0xa91060(0xa3));delete _0x1b9488[_0xa91060(0xd1)][_0x4a919c],_0x1b9488[_0xa91060(0xb7)]===_0x4a919c&&delete _0x1b9488[_0xa91060(0xb7)],writeSecureFile(_0x54b924,JSON[_0xa91060(0xad)](_0x1b9488,null,0x2));}export function getActiveProfile(){const _0x5cb1fd=a62_0x3bdfa6,_0x549ab4=loadSessionContext();if(_0x549ab4?.['profile'])return _0x549ab4['profile'];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x1b6acb=getGlobalConfigPath();if(!a62_0x36f609[_0x5cb1fd(0xc9)](_0x1b6acb))return null;try{const _0x56a2e4=a62_0x36f609[_0x5cb1fd(0xbf)](_0x1b6acb,_0x5cb1fd(0xc0)),_0x2126e5=JSON[_0x5cb1fd(0x9d)](_0x56a2e4);return _0x2126e5[_0x5cb1fd(0xb7)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x43847b){const _0x4f54b9=a62_0x3bdfa6,_0x178b3e=getGlobalConfigPath(),_0x4c2240=getConfigDir();!a62_0x36f609[_0x4f54b9(0xc9)](_0x4c2240)&&createSecureDirectory(_0x4c2240);let _0x28ccb8={};if(a62_0x36f609['existsSync'](_0x178b3e))try{const _0x55ea92=a62_0x36f609[_0x4f54b9(0xbf)](_0x178b3e,'utf-8');_0x28ccb8=JSON[_0x4f54b9(0x9d)](_0x55ea92);}catch{console['warn'](_0x4f54b9(0xb2)+_0x178b3e+_0x4f54b9(0xdb));}_0x28ccb8[_0x4f54b9(0xba)]=_0x43847b,writeSecureFile(_0x178b3e,JSON['stringify'](_0x28ccb8,null,0x2));}function a62_0x2092(_0x4bbe19,_0x41986c){_0x4bbe19=_0x4bbe19-0x9a;const _0x586b78=a62_0x586b();let _0x2092ea=_0x586b78[_0x4bbe19];return _0x2092ea;}export function saveActiveProfileToUserConfig(_0x53d982){const _0x21ca50=a62_0x3bdfa6;validateProfileName(_0x53d982);const _0x197140=getGlobalConfigPath(),_0x42dd84=getConfigDir();!a62_0x36f609[_0x21ca50(0xc9)](_0x42dd84)&&createSecureDirectory(_0x42dd84);let _0x20efff={};if(a62_0x36f609[_0x21ca50(0xc9)](_0x197140))try{const _0x4967a6=a62_0x36f609['readFileSync'](_0x197140,'utf-8');_0x20efff=JSON[_0x21ca50(0x9d)](_0x4967a6);}catch{console[_0x21ca50(0xe5)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x197140+_0x21ca50(0xdb));}_0x20efff['profile']=_0x53d982,writeSecureFile(_0x197140,JSON['stringify'](_0x20efff,null,0x2));}function clearFieldFromUserConfig(_0x11313e){const _0x28117a=a62_0x3bdfa6,_0x33719c=getGlobalConfigPath();if(!a62_0x36f609[_0x28117a(0xc9)](_0x33719c))return;let _0x24db8d={};try{const _0x3bc72c=a62_0x36f609[_0x28117a(0xbf)](_0x33719c,'utf-8');_0x24db8d=JSON[_0x28117a(0x9d)](_0x3bc72c);}catch{return;}delete _0x24db8d[_0x11313e],writeSecureFile(_0x33719c,JSON[_0x28117a(0xad)](_0x24db8d,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x27398e=a62_0x3bdfa6;clearFieldFromUserConfig(_0x27398e(0xba));}export function clearActiveProfileFromUserConfig(){const _0x38ab9a=a62_0x3bdfa6;clearFieldFromUserConfig(_0x38ab9a(0xb7));}export function createProfile(_0x463248,_0x12b327){const _0x5c6187=a62_0x3bdfa6;validateProfileName(_0x463248);if(profileExists(_0x463248))throw new Error(_0x5c6187(0xac)+_0x463248+_0x5c6187(0xbc));saveProfile(_0x463248,_0x12b327);}export function saveProfileCredentials(_0x47c7fd,_0x1dacba){const _0x102277=a62_0x3bdfa6;validateProfileName(_0x47c7fd);if(!profileExists(_0x47c7fd))throw new Error(_0x102277(0xac)+_0x47c7fd+_0x102277(0x9e));const _0x5392ce=getNewCredentialPath(_0x47c7fd);writeSecureFile(_0x5392ce,_0x1dacba);}export function loadProfileCredentials(_0x5e2b65){const _0x53335a=a62_0x3bdfa6;validateProfileName(_0x5e2b65);const _0x33eb5c=getNewCredentialPath(_0x5e2b65);if(a62_0x36f609['existsSync'](_0x33eb5c))try{return a62_0x36f609['readFileSync'](_0x33eb5c,'utf-8');}catch{}const _0x2dff71=getOldCredentialPath(_0x5e2b65);if(a62_0x36f609[_0x53335a(0xc9)](_0x2dff71)){console[_0x53335a(0xe5)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x5e2b65+'\x27'),console[_0x53335a(0xe5)]('To\x20migrate:'),console[_0x53335a(0xe5)](_0x53335a(0xb3)+_0x2dff71+_0x53335a(0x9f)+_0x33eb5c+'\x22'),console[_0x53335a(0xe5)]('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a62_0x36f609['readFileSync'](_0x2dff71,_0x53335a(0xc0));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a63_0x5d5a86=a63_0x1b25;function a63_0x1b25(_0x14874a,_0x264147){_0x14874a=_0x14874a-0x7d;const _0x39d393=a63_0x39d3();let _0x1b25fb=_0x39d393[_0x14874a];return _0x1b25fb;}(function(_0x18d458,_0x2c5b72){const _0x201ebc=a63_0x1b25,_0x81efe7=_0x18d458();while(!![]){try{const _0x445d06=parseInt(_0x201ebc(0x8d))/0x1+-parseInt(_0x201ebc(0x8a))/0x2*(-parseInt(_0x201ebc(0x7d))/0x3)+parseInt(_0x201ebc(0x8b))/0x4*(parseInt(_0x201ebc(0x83))/0x5)+parseInt(_0x201ebc(0x7e))/0x6+-parseInt(_0x201ebc(0x96))/0x7+parseInt(_0x201ebc(0x9b))/0x8+parseInt(_0x201ebc(0x84))/0x9*(-parseInt(_0x201ebc(0x7f))/0xa);if(_0x445d06===_0x2c5b72)break;else _0x81efe7['push'](_0x81efe7['shift']());}catch(_0x1b1efe){_0x81efe7['push'](_0x81efe7['shift']());}}}(a63_0x39d3,0x85b7f));import*as a63_0x350b7e from'node:fs';import*as a63_0x2d5388 from'node:path';function a63_0x39d3(){const _0x27a0e4=['existsSync','cwd',').\x20','TD_API_KEY','2897384ycOVGV','\x20is\x20ignored.\x20','tdx.json','Failed\x20to\x20load\x20project\x20config\x20from\x20','Warning:\x20\x27profile\x27\x20field\x20in\x20','7464240rApVHz','writeFileSync','code','320217MHxwup','2998374deIJBM','28841390OvzmNs','utf-8','includes','ENOENT','2625StXzAY','9ShXLSy','apiKey','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','api_key','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','profile','6GWAefB','8232IdivyC','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','1012336XyKPAJ','stringify','readFileSync','dirname','join'];a63_0x39d3=function(){return _0x27a0e4;};return a63_0x39d3();}const PROJECT_CONFIG_FILENAME=a63_0x5d5a86(0x98);export function findProjectConfigPath(_0x4830c0){const _0x29e560=a63_0x5d5a86;let _0x2bcc48=_0x4830c0||process['cwd']();while(!![]){const _0x4867b9=a63_0x2d5388[_0x29e560(0x91)](_0x2bcc48,PROJECT_CONFIG_FILENAME);if(a63_0x350b7e[_0x29e560(0x92)](_0x4867b9))return _0x4867b9;const _0x12f29d=a63_0x2d5388[_0x29e560(0x90)](_0x2bcc48);if(_0x12f29d===_0x2bcc48)return null;_0x2bcc48=_0x12f29d;}}export function loadProjectConfig(_0x47b446){const _0x22502b=a63_0x5d5a86,_0x2163fd=findProjectConfigPath(_0x47b446);if(!_0x2163fd)return null;try{const _0xac2103=a63_0x350b7e[_0x22502b(0x8f)](_0x2163fd,_0x22502b(0x80)),_0x36186d=JSON['parse'](_0xac2103),_0x4da335=JSON['stringify'](_0x36186d);if(_0x4da335[_0x22502b(0x81)](_0x22502b(0x95))||_0x4da335[_0x22502b(0x81)](_0x22502b(0x85))||_0x4da335[_0x22502b(0x81)](_0x22502b(0x87)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x2163fd+_0x22502b(0x94)+_0x22502b(0x8c));const {metadata:_0x506592,profile:_0x29de3d,..._0x5671fa}=_0x36186d;return _0x29de3d&&console['warn'](_0x22502b(0x9a)+_0x2163fd+_0x22502b(0x97)+_0x22502b(0x86)),_0x5671fa;}catch(_0x2f6bf5){if(_0x2f6bf5 instanceof Error&&_0x22502b(0x9d)in _0x2f6bf5&&_0x2f6bf5[_0x22502b(0x9d)]===_0x22502b(0x82))return null;throw new Error(_0x22502b(0x99)+_0x2163fd+':\x20'+_0x2f6bf5);}}export function saveProjectConfig(_0x3f5213,_0x593575){const _0x37d003=a63_0x5d5a86,_0x11b2c5=_0x593575||process[_0x37d003(0x93)](),_0x4be0e9=a63_0x2d5388[_0x37d003(0x91)](_0x11b2c5,PROJECT_CONFIG_FILENAME),_0x465052=JSON[_0x37d003(0x8e)](_0x3f5213);if(_0x465052[_0x37d003(0x81)]('TD_API_KEY')||_0x465052[_0x37d003(0x81)]('apiKey')||_0x465052[_0x37d003(0x81)](_0x37d003(0x87)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x37d003(0x89)in _0x3f5213)throw new Error(_0x37d003(0x88));a63_0x350b7e[_0x37d003(0x9c)](_0x4be0e9,JSON['stringify'](_0x3f5213,null,0x2));}export function hasProjectConfig(_0x249d5e){return findProjectConfigPath(_0x249d5e)!==null;}export function getProjectRoot(_0x303804){const _0x26ded5=findProjectConfigPath(_0x303804);return _0x26ded5?a63_0x2d5388['dirname'](_0x26ded5):null;}
1
+ (function(_0x41b336,_0x23de12){const _0x5b487e=a63_0x3413,_0x1fda57=_0x41b336();while(!![]){try{const _0x1521ed=-parseInt(_0x5b487e(0x1fd))/0x1*(-parseInt(_0x5b487e(0x1f0))/0x2)+parseInt(_0x5b487e(0x1e8))/0x3*(-parseInt(_0x5b487e(0x1e5))/0x4)+-parseInt(_0x5b487e(0x1f4))/0x5*(parseInt(_0x5b487e(0x1f7))/0x6)+-parseInt(_0x5b487e(0x1eb))/0x7+-parseInt(_0x5b487e(0x1ec))/0x8*(-parseInt(_0x5b487e(0x1f2))/0x9)+-parseInt(_0x5b487e(0x1e2))/0xa*(-parseInt(_0x5b487e(0x1f9))/0xb)+parseInt(_0x5b487e(0x1e7))/0xc;if(_0x1521ed===_0x23de12)break;else _0x1fda57['push'](_0x1fda57['shift']());}catch(_0x4c5c78){_0x1fda57['push'](_0x1fda57['shift']());}}}(a63_0x481b,0xea488));function a63_0x481b(){const _0x33af13=['Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','2iEDlTH','profile','36SbSIcw','writeFileSync','1055EfQnIb','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','code','34758nPxJcB','readFileSync','223432thfabV','dirname','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','api_key','1430830ApRGOy','utf-8','Failed\x20to\x20load\x20project\x20config\x20from\x20','existsSync','apiKey',').\x20','Warning:\x20\x27profile\x27\x20field\x20in\x20','110tRhopo','stringify','TD_API_KEY','1336xpbVWb','ENOENT','19510260tNxsqm','11082XfKPGb','cwd','parse','6790182EdGsNF','2211304FiluZk','includes'];a63_0x481b=function(){return _0x33af13;};return a63_0x481b();}import*as a63_0x1422bb from'node:fs';import*as a63_0x2d10c5 from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x2ac6e2){const _0x1e8e38=a63_0x3413;let _0x213647=_0x2ac6e2||process[_0x1e8e38(0x1e9)]();while(!![]){const _0x9e5b9c=a63_0x2d10c5['join'](_0x213647,PROJECT_CONFIG_FILENAME);if(a63_0x1422bb[_0x1e8e38(0x200)](_0x9e5b9c))return _0x9e5b9c;const _0x46710e=a63_0x2d10c5['dirname'](_0x213647);if(_0x46710e===_0x213647)return null;_0x213647=_0x46710e;}}function a63_0x3413(_0x1e9ae2,_0x2f817d){_0x1e9ae2=_0x1e9ae2-0x1e1;const _0x481bf9=a63_0x481b();let _0x3413fc=_0x481bf9[_0x1e9ae2];return _0x3413fc;}export function loadProjectConfig(_0x418312){const _0x274af4=a63_0x3413,_0x26877c=findProjectConfigPath(_0x418312);if(!_0x26877c)return null;try{const _0x391832=a63_0x1422bb[_0x274af4(0x1f8)](_0x26877c,_0x274af4(0x1fe)),_0x273e30=JSON[_0x274af4(0x1ea)](_0x391832),_0x1e744c=JSON['stringify'](_0x273e30);if(_0x1e744c[_0x274af4(0x1ed)](_0x274af4(0x1e4))||_0x1e744c[_0x274af4(0x1ed)](_0x274af4(0x201))||_0x1e744c[_0x274af4(0x1ed)]('api_key'))throw new Error(_0x274af4(0x1ee)+_0x26877c+_0x274af4(0x202)+_0x274af4(0x1fb));const {metadata:_0x39518e,profile:_0x44182a,..._0x69e1cb}=_0x273e30;return _0x44182a&&console['warn'](_0x274af4(0x1e1)+_0x26877c+'\x20is\x20ignored.\x20'+_0x274af4(0x1f5)),_0x69e1cb;}catch(_0x3a0fb3){if(_0x3a0fb3 instanceof Error&&_0x274af4(0x1f6)in _0x3a0fb3&&_0x3a0fb3[_0x274af4(0x1f6)]===_0x274af4(0x1e6))return null;throw new Error(_0x274af4(0x1ff)+_0x26877c+':\x20'+_0x3a0fb3);}}export function saveProjectConfig(_0x189cd8,_0x425b90){const _0x29ff22=a63_0x3413,_0x4c1f27=_0x425b90||process[_0x29ff22(0x1e9)](),_0x5a3de7=a63_0x2d10c5['join'](_0x4c1f27,PROJECT_CONFIG_FILENAME),_0x5b9e65=JSON[_0x29ff22(0x1e3)](_0x189cd8);if(_0x5b9e65['includes'](_0x29ff22(0x1e4))||_0x5b9e65[_0x29ff22(0x1ed)]('apiKey')||_0x5b9e65[_0x29ff22(0x1ed)](_0x29ff22(0x1fc)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x29ff22(0x1f1)in _0x189cd8)throw new Error(_0x29ff22(0x1ef));a63_0x1422bb[_0x29ff22(0x1f3)](_0x5a3de7,JSON[_0x29ff22(0x1e3)](_0x189cd8,null,0x2));}export function hasProjectConfig(_0x1661cf){return findProjectConfigPath(_0x1661cf)!==null;}export function getProjectRoot(_0x527af1){const _0x51b89d=a63_0x3413,_0x37848e=findProjectConfigPath(_0x527af1);return _0x37848e?a63_0x2d10c5[_0x51b89d(0x1fa)](_0x37848e):null;}
@@ -1 +1 @@
1
- (function(_0xefc4b5,_0x22b5d1){const _0x5c87cd=a64_0x4009,_0x12ab78=_0xefc4b5();while(!![]){try{const _0x90efc6=-parseInt(_0x5c87cd(0x11b))/0x1+parseInt(_0x5c87cd(0x119))/0x2+parseInt(_0x5c87cd(0x105))/0x3*(parseInt(_0x5c87cd(0x129))/0x4)+parseInt(_0x5c87cd(0x11a))/0x5*(parseInt(_0x5c87cd(0x116))/0x6)+parseInt(_0x5c87cd(0x126))/0x7+parseInt(_0x5c87cd(0x10a))/0x8*(parseInt(_0x5c87cd(0x10b))/0x9)+-parseInt(_0x5c87cd(0x12c))/0xa*(parseInt(_0x5c87cd(0x120))/0xb);if(_0x90efc6===_0x22b5d1)break;else _0x12ab78['push'](_0x12ab78['shift']());}catch(_0x36cd2c){_0x12ab78['push'](_0x12ab78['shift']());}}}(a64_0x3b2d,0x1db02));import*as a64_0x561531 from'node:fs';import*as a64_0x396ed2 from'node:path';import*as a64_0x45673b 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 _0x442d6a=a64_0x4009,_0x19c70d=process.env.TDX_CONFIG_DIR||a64_0x396ed2[_0x442d6a(0x10d)](a64_0x45673b[_0x442d6a(0x121)](),_0x442d6a(0x10c),_0x442d6a(0x123));return a64_0x396ed2['join'](_0x19c70d,_0x442d6a(0x11e));}function getSessionPath(_0x3a6679){const _0x191200=a64_0x4009;return a64_0x396ed2[_0x191200(0x10d)](getSessionsDir(),_0x3a6679+_0x191200(0x109));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x262db1){const _0x2480d8=a64_0x4009;if(_0x262db1)return _0x262db1;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x2480d8(0x11c)]();}export function loadSessionContext(_0x4c3aa0){const _0x5860f1=a64_0x4009,_0x1af876=getSessionID(_0x4c3aa0),_0x53e16a=/^\d+$/[_0x5860f1(0x110)](_0x1af876)?parseInt(_0x1af876,0xa):null;return _0x53e16a!==null?loadSessionContextByPID(_0x53e16a):loadSessionContextByString(_0x1af876);}function a64_0x3b2d(){const _0x4eb4ac=['parse','121449AHVQto','existsSync','api_key','TD_API_KEY','.json','9304okykzB','990aqHJOm','.config','join','includes','utf-8','test','stringify','now','readFileSync','endsWith','unlinkSync','215658aVOVvs','sort','replace','470666DWGAmm','25UZMqty','237502uQROdO','toString','apiKey','sessions','readdirSync','77bDFeHC','homedir','getTime','tdx','toISOString','writeFileSync','534674AyDlEj','push','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','8UQaBfV','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','.\x20This\x20is\x20insecure.\x20Removing\x20session.','487460gMusTT'];a64_0x3b2d=function(){return _0x4eb4ac;};return a64_0x3b2d();}export function loadSessionContextByPID(_0x5302f3){const _0x925692=a64_0x4009,_0x23e8ec=getSessionPath(_0x5302f3);if(!a64_0x561531[_0x925692(0x106)](_0x23e8ec))return null;try{const _0x1f068b=a64_0x561531[_0x925692(0x113)](_0x23e8ec,_0x925692(0x10f)),_0x4945eb=JSON['parse'](_0x1f068b),_0x3ec711=new Date(_0x4945eb['createdAt'])[_0x925692(0x122)](),_0x489fd8=Date['now']();if(_0x489fd8-_0x3ec711>SESSION_EXPIRATION_MS)return a64_0x561531[_0x925692(0x115)](_0x23e8ec),null;const _0x29209c=JSON[_0x925692(0x111)](_0x4945eb);if(_0x29209c[_0x925692(0x10e)](_0x925692(0x108))||_0x29209c[_0x925692(0x10e)]('apiKey')||_0x29209c[_0x925692(0x10e)]('api_key'))return console['warn'](_0x925692(0x12a)+_0x23e8ec+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a64_0x561531[_0x925692(0x115)](_0x23e8ec),null;return _0x4945eb;}catch{try{a64_0x561531[_0x925692(0x115)](_0x23e8ec);}catch{}return null;}}function a64_0x4009(_0x190ac3,_0xb3c93b){_0x190ac3=_0x190ac3-0x104;const _0x3b2dbd=a64_0x3b2d();let _0x4009e9=_0x3b2dbd[_0x190ac3];return _0x4009e9;}function loadSessionContextByString(_0x1ff994){const _0x6e0ce5=a64_0x4009,_0x5a248e=a64_0x396ed2[_0x6e0ce5(0x10d)](getSessionsDir(),_0x1ff994+_0x6e0ce5(0x109));if(!a64_0x561531[_0x6e0ce5(0x106)](_0x5a248e))return null;try{const _0x12734f=a64_0x561531['readFileSync'](_0x5a248e,_0x6e0ce5(0x10f)),_0x44d041=JSON[_0x6e0ce5(0x104)](_0x12734f),_0x229e02=new Date(_0x44d041['createdAt'])['getTime'](),_0x359f9d=Date[_0x6e0ce5(0x112)]();if(_0x359f9d-_0x229e02>SESSION_EXPIRATION_MS)return a64_0x561531[_0x6e0ce5(0x115)](_0x5a248e),null;const _0x266b01=JSON[_0x6e0ce5(0x111)](_0x44d041);if(_0x266b01[_0x6e0ce5(0x10e)]('TD_API_KEY')||_0x266b01[_0x6e0ce5(0x10e)](_0x6e0ce5(0x11d))||_0x266b01['includes']('api_key'))return console['warn'](_0x6e0ce5(0x12a)+_0x5a248e+_0x6e0ce5(0x12b)),a64_0x561531[_0x6e0ce5(0x115)](_0x5a248e),null;return _0x44d041;}catch{try{a64_0x561531['unlinkSync'](_0x5a248e);}catch{}return null;}}export function saveSessionContext(_0x3f7c93,_0x32c6fd){const _0x29288b=a64_0x4009,_0x30e8d4=getSessionID(_0x32c6fd),_0x3f8f54=/^\d+$/['test'](_0x30e8d4)?parseInt(_0x30e8d4,0xa):getCurrentSessionPID(),_0x23e45d=a64_0x396ed2[_0x29288b(0x10d)](getSessionsDir(),_0x30e8d4+_0x29288b(0x109)),_0x51443f=getSessionsDir();createSecureDirectory(_0x51443f);const _0x1ee2e9=JSON[_0x29288b(0x111)](_0x3f7c93);if(_0x1ee2e9[_0x29288b(0x10e)](_0x29288b(0x108))||_0x1ee2e9[_0x29288b(0x10e)](_0x29288b(0x11d))||_0x1ee2e9[_0x29288b(0x10e)](_0x29288b(0x107)))throw new Error(_0x29288b(0x128));let _0x5bcfb0;const _0x8e30a5=/^\d+$/[_0x29288b(0x110)](_0x30e8d4)?loadSessionContextByPID(parseInt(_0x30e8d4,0xa)):loadSessionContextByString(_0x30e8d4);_0x8e30a5?_0x5bcfb0={..._0x8e30a5,..._0x3f7c93,'pid':_0x3f8f54,'sessionId':_0x30e8d4!==_0x3f8f54[_0x29288b(0x11c)]()?_0x30e8d4:undefined,'updatedAt':new Date()[_0x29288b(0x124)]()}:_0x5bcfb0={'pid':_0x3f8f54,'sessionId':_0x30e8d4!==_0x3f8f54['toString']()?_0x30e8d4:undefined,..._0x3f7c93,'createdAt':new Date()[_0x29288b(0x124)](),'updatedAt':new Date()[_0x29288b(0x124)]()},a64_0x561531['writeFileSync'](_0x23e45d,JSON[_0x29288b(0x111)](_0x5bcfb0,null,0x2));}export function clearSessionContext(_0x243a23){const _0x15f68d=a64_0x4009,_0x3e9d54=getSessionID(_0x243a23),_0x517eb6=a64_0x396ed2[_0x15f68d(0x10d)](getSessionsDir(),_0x3e9d54+'.json');a64_0x561531['existsSync'](_0x517eb6)&&a64_0x561531['unlinkSync'](_0x517eb6);}export function clearSessionContextField(_0x26098c,_0x4b4c52){const _0x598fdb=a64_0x4009,_0x23113e=getSessionID(_0x4b4c52),_0x29d337=a64_0x396ed2[_0x598fdb(0x10d)](getSessionsDir(),_0x23113e+_0x598fdb(0x109));if(!a64_0x561531[_0x598fdb(0x106)](_0x29d337))return;try{const _0xc5646=a64_0x561531[_0x598fdb(0x113)](_0x29d337,_0x598fdb(0x10f)),_0x313bc7=JSON['parse'](_0xc5646);delete _0x313bc7[_0x26098c],a64_0x561531[_0x598fdb(0x125)](_0x29d337,JSON[_0x598fdb(0x111)](_0x313bc7,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x59c499=a64_0x4009,_0x27b132=getSessionsDir();if(!a64_0x561531[_0x59c499(0x106)](_0x27b132))return 0x0;let _0x119d54=0x0;const _0x3d044a=Date['now']();try{const _0x4272bb=a64_0x561531['readdirSync'](_0x27b132);for(const _0x5e0d4d of _0x4272bb){if(!_0x5e0d4d[_0x59c499(0x114)](_0x59c499(0x109)))continue;const _0x289b8c=a64_0x396ed2[_0x59c499(0x10d)](_0x27b132,_0x5e0d4d),_0x1bac8b=_0x5e0d4d['replace'](_0x59c499(0x109),''),_0x46abb=parseInt(_0x1bac8b,0xa),_0x403486=!isNaN(_0x46abb);if(_0x403486){if(!isProcessRunning(_0x46abb)){a64_0x561531[_0x59c499(0x115)](_0x289b8c),_0x119d54++;continue;}}try{const _0x502eb8=a64_0x561531[_0x59c499(0x113)](_0x289b8c,_0x59c499(0x10f)),_0x27c05f=JSON[_0x59c499(0x104)](_0x502eb8),_0x6af3d3=new Date(_0x27c05f['createdAt'])['getTime']();_0x3d044a-_0x6af3d3>SESSION_EXPIRATION_MS&&(a64_0x561531[_0x59c499(0x115)](_0x289b8c),_0x119d54++);}catch{a64_0x561531[_0x59c499(0x115)](_0x289b8c),_0x119d54++;}}}catch{}return _0x119d54;}export function listActiveSessions(){const _0xf29362=a64_0x4009,_0xe21632=getSessionsDir();if(!a64_0x561531['existsSync'](_0xe21632))return[];try{const _0x463f80=a64_0x561531[_0xf29362(0x11f)](_0xe21632),_0x5d8cf1=[];for(const _0x58a63c of _0x463f80){if(!_0x58a63c[_0xf29362(0x114)]('.json'))continue;const _0x371285=_0x58a63c[_0xf29362(0x118)](_0xf29362(0x109),''),_0x2d4813=parseInt(_0x371285,0xa);!isNaN(_0x2d4813)&&isProcessRunning(_0x2d4813)&&_0x5d8cf1[_0xf29362(0x127)](_0x2d4813);}return _0x5d8cf1[_0xf29362(0x117)]((_0x3e3851,_0x2e8d83)=>_0x3e3851-_0x2e8d83);}catch{return[];}}
1
+ (function(_0x4c19b1,_0x13a19a){const _0x5930a4=a64_0x4aac,_0x2b2864=_0x4c19b1();while(!![]){try{const _0x5028ae=-parseInt(_0x5930a4(0x196))/0x1+parseInt(_0x5930a4(0x194))/0x2+parseInt(_0x5930a4(0x1a0))/0x3*(parseInt(_0x5930a4(0x1af))/0x4)+-parseInt(_0x5930a4(0x18d))/0x5*(parseInt(_0x5930a4(0x198))/0x6)+parseInt(_0x5930a4(0x1a6))/0x7*(parseInt(_0x5930a4(0x1a1))/0x8)+parseInt(_0x5930a4(0x1ae))/0x9*(-parseInt(_0x5930a4(0x1a2))/0xa)+-parseInt(_0x5930a4(0x19b))/0xb;if(_0x5028ae===_0x13a19a)break;else _0x2b2864['push'](_0x2b2864['shift']());}catch(_0x1b16cd){_0x2b2864['push'](_0x2b2864['shift']());}}}(a64_0x302e,0x56d86));import*as a64_0xfe48af from'node:fs';import*as a64_0x5d188f from'node:path';import*as a64_0x34e91b 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 _0x2a999d=a64_0x4aac,_0x56a236=process.env.TDX_CONFIG_DIR||a64_0x5d188f['join'](a64_0x34e91b[_0x2a999d(0x19d)](),'.config',_0x2a999d(0x1a8));return a64_0x5d188f[_0x2a999d(0x1a4)](_0x56a236,_0x2a999d(0x197));}function getSessionPath(_0x3f0dd9){const _0x35b8c2=a64_0x4aac;return a64_0x5d188f[_0x35b8c2(0x1a4)](getSessionsDir(),_0x3f0dd9+'.json');}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x4f3aaa){const _0xa55fbb=a64_0x4aac;if(_0x4f3aaa)return _0x4f3aaa;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0xa55fbb(0x18f)]();}export function loadSessionContext(_0x26e0d2){const _0x2ccdff=a64_0x4aac,_0x2edc0c=getSessionID(_0x26e0d2),_0x350ffc=/^\d+$/[_0x2ccdff(0x190)](_0x2edc0c)?parseInt(_0x2edc0c,0xa):null;return _0x350ffc!==null?loadSessionContextByPID(_0x350ffc):loadSessionContextByString(_0x2edc0c);}export function loadSessionContextByPID(_0x39241e){const _0x394f66=a64_0x4aac,_0x8691b9=getSessionPath(_0x39241e);if(!a64_0xfe48af[_0x394f66(0x191)](_0x8691b9))return null;try{const _0x2081cf=a64_0xfe48af['readFileSync'](_0x8691b9,_0x394f66(0x193)),_0x150e85=JSON[_0x394f66(0x1a3)](_0x2081cf),_0x5aa84c=new Date(_0x150e85[_0x394f66(0x1ab)])['getTime'](),_0xd0627=Date['now']();if(_0xd0627-_0x5aa84c>SESSION_EXPIRATION_MS)return a64_0xfe48af['unlinkSync'](_0x8691b9),null;const _0x385d9d=JSON[_0x394f66(0x1b3)](_0x150e85);if(_0x385d9d[_0x394f66(0x1b1)](_0x394f66(0x19c))||_0x385d9d['includes'](_0x394f66(0x1ac))||_0x385d9d[_0x394f66(0x1b1)](_0x394f66(0x1ad)))return console[_0x394f66(0x1a9)](_0x394f66(0x18e)+_0x8691b9+_0x394f66(0x1a7)),a64_0xfe48af['unlinkSync'](_0x8691b9),null;return _0x150e85;}catch{try{a64_0xfe48af[_0x394f66(0x1b0)](_0x8691b9);}catch{}return null;}}function a64_0x4aac(_0x4467bd,_0x478ae7){_0x4467bd=_0x4467bd-0x18d;const _0x302ea8=a64_0x302e();let _0x4aacc5=_0x302ea8[_0x4467bd];return _0x4aacc5;}function loadSessionContextByString(_0x5eeb92){const _0x3d030f=a64_0x4aac,_0x1c431b=a64_0x5d188f[_0x3d030f(0x1a4)](getSessionsDir(),_0x5eeb92+_0x3d030f(0x1b4));if(!a64_0xfe48af[_0x3d030f(0x191)](_0x1c431b))return null;try{const _0x28c319=a64_0xfe48af['readFileSync'](_0x1c431b,'utf-8'),_0x3de24f=JSON[_0x3d030f(0x1a3)](_0x28c319),_0x1a8c65=new Date(_0x3de24f[_0x3d030f(0x1ab)])['getTime'](),_0x526763=Date['now']();if(_0x526763-_0x1a8c65>SESSION_EXPIRATION_MS)return a64_0xfe48af[_0x3d030f(0x1b0)](_0x1c431b),null;const _0x3e0f26=JSON[_0x3d030f(0x1b3)](_0x3de24f);if(_0x3e0f26[_0x3d030f(0x1b1)](_0x3d030f(0x19c))||_0x3e0f26['includes']('apiKey')||_0x3e0f26[_0x3d030f(0x1b1)](_0x3d030f(0x1ad)))return console['warn'](_0x3d030f(0x18e)+_0x1c431b+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a64_0xfe48af[_0x3d030f(0x1b0)](_0x1c431b),null;return _0x3de24f;}catch{try{a64_0xfe48af['unlinkSync'](_0x1c431b);}catch{}return null;}}export function saveSessionContext(_0x387c00,_0x7bfef3){const _0x18220c=a64_0x4aac,_0x3b754f=getSessionID(_0x7bfef3),_0x4aed29=/^\d+$/[_0x18220c(0x190)](_0x3b754f)?parseInt(_0x3b754f,0xa):getCurrentSessionPID(),_0x1ea1cb=a64_0x5d188f[_0x18220c(0x1a4)](getSessionsDir(),_0x3b754f+_0x18220c(0x1b4)),_0x3ebe19=getSessionsDir();createSecureDirectory(_0x3ebe19);const _0x246b7b=JSON[_0x18220c(0x1b3)](_0x387c00);if(_0x246b7b[_0x18220c(0x1b1)]('TD_API_KEY')||_0x246b7b[_0x18220c(0x1b1)]('apiKey')||_0x246b7b['includes']('api_key'))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.');let _0x17eb19;const _0x28c307=/^\d+$/[_0x18220c(0x190)](_0x3b754f)?loadSessionContextByPID(parseInt(_0x3b754f,0xa)):loadSessionContextByString(_0x3b754f);_0x28c307?_0x17eb19={..._0x28c307,..._0x387c00,'pid':_0x4aed29,'sessionId':_0x3b754f!==_0x4aed29[_0x18220c(0x18f)]()?_0x3b754f:undefined,'updatedAt':new Date()[_0x18220c(0x195)]()}:_0x17eb19={'pid':_0x4aed29,'sessionId':_0x3b754f!==_0x4aed29[_0x18220c(0x18f)]()?_0x3b754f:undefined,..._0x387c00,'createdAt':new Date()[_0x18220c(0x195)](),'updatedAt':new Date()['toISOString']()},a64_0xfe48af[_0x18220c(0x192)](_0x1ea1cb,JSON[_0x18220c(0x1b3)](_0x17eb19,null,0x2));}export function clearSessionContext(_0x4f1316){const _0x1bca73=a64_0x4aac,_0x13e445=getSessionID(_0x4f1316),_0x5d7edb=a64_0x5d188f[_0x1bca73(0x1a4)](getSessionsDir(),_0x13e445+'.json');a64_0xfe48af['existsSync'](_0x5d7edb)&&a64_0xfe48af[_0x1bca73(0x1b0)](_0x5d7edb);}export function clearSessionContextField(_0xea34c9,_0x373e92){const _0x53cc15=a64_0x4aac,_0x9de8c2=getSessionID(_0x373e92),_0x378af9=a64_0x5d188f['join'](getSessionsDir(),_0x9de8c2+_0x53cc15(0x1b4));if(!a64_0xfe48af[_0x53cc15(0x191)](_0x378af9))return;try{const _0x4d2a7f=a64_0xfe48af[_0x53cc15(0x19f)](_0x378af9,'utf-8'),_0x40e239=JSON[_0x53cc15(0x1a3)](_0x4d2a7f);delete _0x40e239[_0xea34c9],a64_0xfe48af['writeFileSync'](_0x378af9,JSON[_0x53cc15(0x1b3)](_0x40e239,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x4a32e0=a64_0x4aac,_0x58635e=getSessionsDir();if(!a64_0xfe48af[_0x4a32e0(0x191)](_0x58635e))return 0x0;let _0x504a19=0x0;const _0x81a9f6=Date[_0x4a32e0(0x1aa)]();try{const _0xa26dcf=a64_0xfe48af['readdirSync'](_0x58635e);for(const _0x828d72 of _0xa26dcf){if(!_0x828d72['endsWith']('.json'))continue;const _0x8494ad=a64_0x5d188f[_0x4a32e0(0x1a4)](_0x58635e,_0x828d72),_0x91cdb2=_0x828d72['replace'](_0x4a32e0(0x1b4),''),_0x573b69=parseInt(_0x91cdb2,0xa),_0x4a6bb5=!isNaN(_0x573b69);if(_0x4a6bb5){if(!isProcessRunning(_0x573b69)){a64_0xfe48af[_0x4a32e0(0x1b0)](_0x8494ad),_0x504a19++;continue;}}try{const _0x39c2fc=a64_0xfe48af[_0x4a32e0(0x19f)](_0x8494ad,_0x4a32e0(0x193)),_0x4d3d69=JSON[_0x4a32e0(0x1a3)](_0x39c2fc),_0x34353a=new Date(_0x4d3d69[_0x4a32e0(0x1ab)])[_0x4a32e0(0x1a5)]();_0x81a9f6-_0x34353a>SESSION_EXPIRATION_MS&&(a64_0xfe48af[_0x4a32e0(0x1b0)](_0x8494ad),_0x504a19++);}catch{a64_0xfe48af[_0x4a32e0(0x1b0)](_0x8494ad),_0x504a19++;}}}catch{}return _0x504a19;}function a64_0x302e(){const _0x5bba07=['now','createdAt','apiKey','api_key','2189043kuYHZi','24JWyNfM','unlinkSync','includes','endsWith','stringify','.json','845ZpuKuX','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','toString','test','existsSync','writeFileSync','utf-8','868472PkicoU','toISOString','141802QvYKTV','sessions','930dwloAS','readdirSync','replace','1553134nmVUea','TD_API_KEY','homedir','sort','readFileSync','41079woRSZE','1352CfWKRQ','10OOAcxZ','parse','join','getTime','16226ZlllTZ','.\x20This\x20is\x20insecure.\x20Removing\x20session.','tdx','warn'];a64_0x302e=function(){return _0x5bba07;};return a64_0x302e();}export function listActiveSessions(){const _0x50993a=a64_0x4aac,_0x13792a=getSessionsDir();if(!a64_0xfe48af[_0x50993a(0x191)](_0x13792a))return[];try{const _0x52c604=a64_0xfe48af[_0x50993a(0x199)](_0x13792a),_0x1d96bc=[];for(const _0x1fadd9 of _0x52c604){if(!_0x1fadd9[_0x50993a(0x1b2)]('.json'))continue;const _0x521bf3=_0x1fadd9[_0x50993a(0x19a)]('.json',''),_0x37df69=parseInt(_0x521bf3,0xa);!isNaN(_0x37df69)&&isProcessRunning(_0x37df69)&&_0x1d96bc['push'](_0x37df69);}return _0x1d96bc[_0x50993a(0x19e)]((_0x177ab9,_0x161ed5)=>_0x177ab9-_0x161ed5);}catch{return[];}}
@@ -1 +1 @@
1
- const a65_0x46678c=a65_0x20d0;function a65_0x20d0(_0x40a36c,_0x52fbe2){_0x40a36c=_0x40a36c-0x1b7;const _0x49e54e=a65_0x49e5();let _0x20d05e=_0x49e54e[_0x40a36c];return _0x20d05e;}function a65_0x49e5(){const _0x1da9f8=['clear','502tReyfO','698ZWcdxY','2218625KomrAr','now','9337328wOxQAk','users-{profile}.json','729596AsQZVa','core/user-cache','421364tXyxMs','write','156858xvRdmC','1525989JVtkeB'];a65_0x49e5=function(){return _0x1da9f8;};return a65_0x49e5();}(function(_0x6cb508,_0x573bef){const _0x40a5e3=a65_0x20d0,_0x47d680=_0x6cb508();while(!![]){try{const _0x4ca319=parseInt(_0x40a5e3(0x1c3))/0x1*(parseInt(_0x40a5e3(0x1c2))/0x2)+-parseInt(_0x40a5e3(0x1c0))/0x3+-parseInt(_0x40a5e3(0x1bd))/0x4+-parseInt(_0x40a5e3(0x1b7))/0x5+-parseInt(_0x40a5e3(0x1bf))/0x6+parseInt(_0x40a5e3(0x1bb))/0x7+parseInt(_0x40a5e3(0x1b9))/0x8;if(_0x4ca319===_0x573bef)break;else _0x47d680['push'](_0x47d680['shift']());}catch(_0x9d00c8){_0x47d680['push'](_0x47d680['shift']());}}}(a65_0x49e5,0x588e0));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a65_0x46678c(0x1ba),a65_0x46678c(0x1bc));export function loadCachedUsers(_0x5b7ea5){const _0x1ce2e2=userCache['read'](_0x5b7ea5);return _0x1ce2e2?.['users']??null;}export function saveCachedUsers(_0x5e8927,_0x2e10a9){const _0x199c86=a65_0x46678c;userCache[_0x199c86(0x1be)](_0x5e8927,{'users':_0x2e10a9,'cachedAt':Date[_0x199c86(0x1b8)]()});}export function clearUserCache(_0xa5afa7){const _0x513126=a65_0x46678c;userCache[_0x513126(0x1c1)](_0xa5afa7);}
1
+ const a65_0x1518b7=a65_0xb28e;(function(_0x142435,_0x770497){const _0x4cd4be=a65_0xb28e,_0x1fb6c5=_0x142435();while(!![]){try{const _0x2a7b72=parseInt(_0x4cd4be(0xf0))/0x1+-parseInt(_0x4cd4be(0xec))/0x2*(parseInt(_0x4cd4be(0xed))/0x3)+parseInt(_0x4cd4be(0xf1))/0x4*(-parseInt(_0x4cd4be(0xeb))/0x5)+-parseInt(_0x4cd4be(0xee))/0x6+parseInt(_0x4cd4be(0xf8))/0x7*(-parseInt(_0x4cd4be(0xf6))/0x8)+parseInt(_0x4cd4be(0xf7))/0x9+-parseInt(_0x4cd4be(0xf4))/0xa*(-parseInt(_0x4cd4be(0xf2))/0xb);if(_0x2a7b72===_0x770497)break;else _0x1fb6c5['push'](_0x1fb6c5['shift']());}catch(_0x198c01){_0x1fb6c5['push'](_0x1fb6c5['shift']());}}}(a65_0x277a,0x50535));import{createProfileCache}from'../utils/global-cache.js';function a65_0xb28e(_0x226ec5,_0xe7c0d6){_0x226ec5=_0x226ec5-0xea;const _0x277a0b=a65_0x277a();let _0xb28e6f=_0x277a0b[_0x226ec5];return _0xb28e6f;}const userCache=createProfileCache(a65_0x1518b7(0xf9),a65_0x1518b7(0xef));export function loadCachedUsers(_0x10d370){const _0x39a143=a65_0x1518b7,_0x353f1e=userCache['read'](_0x10d370);return _0x353f1e?.[_0x39a143(0xf5)]??null;}export function saveCachedUsers(_0x27603d,_0x24bf39){const _0x131fe2=a65_0x1518b7;userCache[_0x131fe2(0xf3)](_0x27603d,{'users':_0x24bf39,'cachedAt':Date[_0x131fe2(0xea)]()});}export function clearUserCache(_0x4faafd){userCache['clear'](_0x4faafd);}function a65_0x277a(){const _0x4a14f1=['5012874vDZmgu','126gfpGVf','users-{profile}.json','now','1910630KbuYBA','86JvNDNR','14289xhyDBT','2519346yRuYKG','core/user-cache','268227TVBGvT','4tNHriV','583QRwchn','write','142360SqboZr','users','108392EpLlox'];a65_0x277a=function(){return _0x4a14f1;};return a65_0x277a();}
@@ -1 +1 @@
1
- function a66_0x10da(_0x556957,_0x4f9086){_0x556957=_0x556957-0xae;const _0x5a263b=a66_0x5a26();let _0x10da74=_0x5a263b[_0x556957];return _0x10da74;}(function(_0x360fe3,_0x428930){const _0x2634ed=a66_0x10da,_0xe62ba5=_0x360fe3();while(!![]){try{const _0xb1798a=-parseInt(_0x2634ed(0xb9))/0x1+-parseInt(_0x2634ed(0xb4))/0x2*(-parseInt(_0x2634ed(0xb6))/0x3)+-parseInt(_0x2634ed(0xba))/0x4+-parseInt(_0x2634ed(0xbd))/0x5*(parseInt(_0x2634ed(0xaf))/0x6)+-parseInt(_0x2634ed(0xb8))/0x7*(parseInt(_0x2634ed(0xb7))/0x8)+parseInt(_0x2634ed(0xb3))/0x9+parseInt(_0x2634ed(0xbc))/0xa;if(_0xb1798a===_0x428930)break;else _0xe62ba5['push'](_0xe62ba5['shift']());}catch(_0x21f849){_0xe62ba5['push'](_0xe62ba5['shift']());}}}(a66_0x5a26,0xc47f8));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x2e5da5=a66_0x10da;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x419961=fileURLToPath(import.meta.url),_0x11b906=dirname(_0x419961);try{const _0x58449d=join(_0x11b906,'../build-info.json');cachedBuildInfo=JSON[_0x2e5da5(0xbe)](readFileSync(_0x58449d,_0x2e5da5(0xbb)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x3bda49=a66_0x10da;if(cachedVersion!==null)return cachedVersion;const _0x542e3f=fileURLToPath(import.meta.url),_0x5d1403=dirname(_0x542e3f),_0x3b790e=getBuildInfo();if(_0x3b790e['version'])return cachedVersion=_0x3b790e[_0x3bda49(0xb0)],cachedVersion;try{const _0x59c23c=join(_0x5d1403,_0x3bda49(0xb5)),_0x5ed23c=JSON[_0x3bda49(0xbe)](readFileSync(_0x59c23c,_0x3bda49(0xbb)));cachedVersion=_0x5ed23c[_0x3bda49(0xb0)];}catch{cachedVersion=_0x3bda49(0xb2);}return cachedVersion;}function a66_0x5a26(){const _0x6bab34=['.dev','18Orlqcr','version','includes','0.0.0','14052447sVmqvU','6cAqHBq','../../package.json','1511151HkVeyK','2865112LXaQCX','7kIaDFF','929007wGKlfV','223876cGygBv','utf-8','3262510VgmSTp','2084690tgRdIx','parse'];a66_0x5a26=function(){return _0x6bab34;};return a66_0x5a26();}export function isDevVersion(){const _0x16af25=a66_0x10da,_0x3e6a1a=getVersion();return _0x3e6a1a['includes'](_0x16af25(0xae))||_0x3e6a1a[_0x16af25(0xb1)]('-');}
1
+ (function(_0x8b52f4,_0xc44f07){const _0x1b7c83=a66_0x1b18,_0xeab572=_0x8b52f4();while(!![]){try{const _0x317204=-parseInt(_0x1b7c83(0xae))/0x1+-parseInt(_0x1b7c83(0xa2))/0x2*(-parseInt(_0x1b7c83(0xa9))/0x3)+parseInt(_0x1b7c83(0xac))/0x4*(-parseInt(_0x1b7c83(0xaf))/0x5)+-parseInt(_0x1b7c83(0xa6))/0x6*(parseInt(_0x1b7c83(0xab))/0x7)+-parseInt(_0x1b7c83(0xa8))/0x8*(parseInt(_0x1b7c83(0xaa))/0x9)+parseInt(_0x1b7c83(0xad))/0xa*(parseInt(_0x1b7c83(0xa1))/0xb)+parseInt(_0x1b7c83(0x9c))/0xc*(parseInt(_0x1b7c83(0x9b))/0xd);if(_0x317204===_0xc44f07)break;else _0xeab572['push'](_0xeab572['shift']());}catch(_0x2ab65d){_0xeab572['push'](_0xeab572['shift']());}}}(a66_0x5a98,0x3ace7));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x3ecdf3=a66_0x1b18;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x4729b6=fileURLToPath(import.meta.url),_0x3a72c7=dirname(_0x4729b6);try{const _0x257c72=join(_0x3a72c7,_0x3ecdf3(0xa3));cachedBuildInfo=JSON['parse'](readFileSync(_0x257c72,_0x3ecdf3(0x9f)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}function a66_0x5a98(){const _0x42539e=['1158989ikQuNM','240eQyzFF','includes','.dev','utf-8','version','33GRmVma','22fUFfbF','../build-info.json','parse','../../package.json','6bgiALo','0.0.0','1960OtVfuq','3411udFNhw','16596epUkLu','3316726MdYZWD','34384TUqTjV','49160KyRTcK','179662qTIpZX','270MOjmSp'];a66_0x5a98=function(){return _0x42539e;};return a66_0x5a98();}export function getVersion(){const _0xc55406=a66_0x1b18;if(cachedVersion!==null)return cachedVersion;const _0x4f26ac=fileURLToPath(import.meta.url),_0x597a09=dirname(_0x4f26ac),_0x423259=getBuildInfo();if(_0x423259[_0xc55406(0xa0)])return cachedVersion=_0x423259[_0xc55406(0xa0)],cachedVersion;try{const _0x1fbb0c=join(_0x597a09,_0xc55406(0xa5)),_0x47a595=JSON[_0xc55406(0xa4)](readFileSync(_0x1fbb0c,_0xc55406(0x9f)));cachedVersion=_0x47a595[_0xc55406(0xa0)];}catch{cachedVersion=_0xc55406(0xa7);}return cachedVersion;}function a66_0x1b18(_0x1502c8,_0x1a7677){_0x1502c8=_0x1502c8-0x9b;const _0x5a98c1=a66_0x5a98();let _0x1b1851=_0x5a98c1[_0x1502c8];return _0x1b1851;}export function isDevVersion(){const _0x311c0f=a66_0x1b18,_0x49db5b=getVersion();return _0x49db5b['includes'](_0x311c0f(0x9e))||_0x49db5b[_0x311c0f(0x9d)]('-');}